usermagnetps.h
1 /***************************************************************************
2  Copyright (C) 2002-2015 Kentaro Kitagawa
3  kitagawa@phys.s.u-tokyo.ac.jp
4 
5  This program is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License as published by the Free Software Foundation; either
8  version 2 of the License, or (at your option) any later version.
9 
10  You should have received a copy of the GNU Library General
11  Public License and a list of authors along with this program;
12  see the files COPYING and AUTHORS.
13 ***************************************************************************/
14 //---------------------------------------------------------------------------
15 #ifndef usermagnetpsH
16 #define usermagnetpsH
17 
18 #include "magnetps.h"
19 #include "oxforddriver.h"
20 //---------------------------------------------------------------------------
21 //OXFORD PS120 Magnet Power Supply
22 class XPS120 : public XOxfordDriver<XMagnetPS> {
23 public:
24  XPS120(const char *name, bool runtime,
25  Transaction &tr_meas, const shared_ptr<XMeasure> &meas);
26  virtual ~XPS120() {}
27 
28 protected:
29  virtual void toNonPersistent();
30  virtual void toPersistent();
31  virtual void toZero();
32  virtual void toSetPoint();
33  virtual double getTargetField();
34  virtual double getSweepRate();
35  virtual double getOutputField();
36  virtual double getPersistentField();
37  virtual double getOutputVolt();
38  virtual double getOutputCurrent();
39 
40  //! Persistent Current Switch Heater
41  //! please return *TRUE* if no PCS fitted
42  virtual bool isPCSHeaterOn();
43  //! please return false if no PCS fitted
44  virtual bool isPCSFitted();
45 
46  virtual double fieldResolution() {return 0.001;}
47 
48  virtual void setPoint(double field);
49  virtual void setRate(double hpm);
50 private:
51  virtual double currentResolution() {return 0.01;}
52  virtual double voltageResolution() {return 0.01;}
53 
54  void setPCSHeater(bool val) throw (XInterface::XInterfaceError&);
55  void setActivity(int val) throw (XInterface::XInterfaceError&);
56 };
57 
58 //OXFORD IPS120 Magnet Power Supply
59 class XIPS120 : public XPS120 {
60 public:
61  XIPS120(const char *name, bool runtime,
62  Transaction &tr_meas, const shared_ptr<XMeasure> &meas) :
63  XPS120(name, runtime, ref(tr_meas), meas) {}
64  virtual ~XIPS120() {}
65  virtual double fieldResolution() {return 0.0001;}
66 protected:
67  //! Be called just after opening interface. Call start() inside this routine appropriately.
68  virtual void open() throw (XKameError &);
69 
70  virtual double currentResolution() {return 0.001;}
71  virtual double voltageResolution() {return 0.001;}
72  virtual double getTargetField();
73  virtual double getSweepRate();
74  virtual double getOutputField();
75  virtual double getPersistentField();
76  virtual double getOutputVolt();
77  virtual double getOutputCurrent();
78  virtual void setPoint(double field);
79  virtual void setRate(double hpm);
80 };
81 
82 //Cryogenic Superconducting Magnet Power Supply SMS10/30/120C
83 class XCryogenicSMS : public XCharDeviceDriver<XMagnetPS> {
84 public:
85  XCryogenicSMS(const char *name, bool runtime,
86  Transaction &tr_meas, const shared_ptr<XMeasure> &meas);
87  virtual ~XCryogenicSMS() {}
88 protected:
89  //! Be called just after opening interface. Call start() inside this routine appropriately.
90  virtual void open() throw (XKameError &);
91 
92  virtual void toNonPersistent();
93  virtual void toPersistent();
94  virtual void toZero();
95  virtual void toSetPoint();
96  virtual double getTargetField();
97  virtual double getSweepRate();
98  virtual double getOutputField();
99  virtual double getPersistentField();
100  virtual double getOutputVolt();
101  virtual double getOutputCurrent();
102 
103  //! Persistent Current Switch Heater
104  virtual bool isPCSHeaterOn();
105  //! please return false if no PCS fitted
106  virtual bool isPCSFitted();
107 
108  virtual bool canChangePolarityDuringSweep() {return false;}
109 
110  virtual double fieldResolution();
111 
112  virtual void setPoint(double field);
113  virtual void setRate(double hpm);
114 private:
115  void changePauseState(bool pause);
116  void changePolarity(int p);
117  void ramp(const char *str);
118 
119  std::string receiveMessage(const char *title, bool is_stamp_required = false);
120 
121  double teslaPerAmp() const {return m_tpa;}
122  bool isOutputPositive();
123  double m_tpa;
124 };
125 #endif
126 

Generated for KAME4 by  doxygen 1.8.3