00001
00037 #ifndef __MXS_DEVICE_HH__
00038 #define __MXS_DEVICE_HH__
00039
00040 #include <string>
00041 #include <boost/shared_ptr.hpp>
00042 #include <global-types.h>
00043 #include <devicefactory.hh>
00044 #include <device.hh>
00045 #include <accdevice.hh>
00046 #include <nativedevice.hh>
00047 #include <mxs-dev-def.hh>
00048
00049 #define MXS_OK MX_OK
00050
00051
00052 using DeviceAccess::AccDevException;
00053 using DeviceAccess::AccData;
00054
00056 namespace DeviceAccess {
00058 namespace EqModMXS
00059 {
00061 class MXSDevice : public NativeDevice
00062 {
00063 private:
00064 static const ULong STATUS_INIT_VALUE = 0;
00065
00066 DeviceFactory* _df;
00067 boost::shared_ptr<Device> _magnet;
00068 boost::shared_ptr<Device> _hallprobe;
00069 DevConstDesc _devConst;
00070 ULong _status;
00071
00072 void convertDevConst(const AccData& dbc);
00073
00074 public:
00078 explicit MXSDevice(const string& name);
00079
00081 ~MXSDevice() {};
00082
00089 virtual SLong checkSupStatus();
00090
00092 void setDevDataP() {}
00093
00099 virtual ULong initDevice();
00100
00106 virtual ULong resetDevice();
00107
00114 virtual ULong getStatus(AccData& outData);
00115
00119 virtual ULong updateStatus();
00120
00124 virtual ULong readStatusAlarmMask() { return 0xFFFFFFFF; }
00125
00132 virtual ULong getVersionStrings(AccData& outData);
00133
00139 virtual ULong onlineTest();
00140
00146 void setDevConstants() throw();
00147
00153 virtual ULong updateDevConst();
00154
00156 DevConstDesc* devConstP() throw() { return &_devConst; };
00157
00161 boost::shared_ptr<Device> magnet() { return _magnet; }
00162
00166 boost::shared_ptr<Device> hallprobe() { return _hallprobe; }
00167 };
00168 }
00169 }
00170
00171 #endif