00001
00002 #ifndef SCT_SCTAPI_SCTAPIDDC_H
00003 #define SCT_SCTAPI_SCTAPIDDC_H
00004
00005
00006
00007
00008 namespace SctApi {
00009 class SctApiDDC;
00010 };
00011
00012
00013 #include <string>
00014 #include <map>
00015 #include <vector>
00016 #include "CommonWithDsp/processor.h"
00017 #include "boost/shared_ptr.hpp"
00018
00019
00020 class IPCPartition;
00021 class SCTDCSCommand;
00022 namespace SctConfiguration {
00023 class Configuration;
00024 };
00025 namespace SctApi{
00026 class Log;
00027 };
00028
00029
00030 namespace SctApi {
00031 class SctApiDDC {
00032 private:
00034 void initDDC();
00036 boost::shared_ptr<SctConfiguration::Configuration> m_config;
00037 boost::shared_ptr<Log> m_log;
00038 IPCPartition * m_ddcPartition;
00039 std::string * m_ddcCtrls[2];
00040 SCTDCSCommand * m_ddcCmd;
00042 SCTDCSCommand * ddcCmd();
00044 SctConfiguration::Configuration * config();
00045 std::ostream & log();
00046 public:
00047 SctApiDDC(boost::shared_ptr<SctConfiguration::Configuration> conf,
00048 boost::shared_ptr<Log> log = boost::shared_ptr<Log>());
00050 void ddcChangeState (int crate, int channel, short state, int timeout = 2);
00052 void ddcChangeStates (int crate, const char* name, short state, int timeout = 2);
00054 void ddcChangeStateAll (int crate, short state, int timeout = 2);
00056 void ddcLoadConfiguration (int crate, short state, int timeout = 2);
00058 void ddcHardReset (int crate, int channel, int timeout = 2);
00060 void ddcHardResetAll (int crate, int timeout = 2);
00061
00063 int ddcGetChannelParameterInt (int crate, int channel, std::string name, int timeout = 2);
00065 float ddcGetChannelParameterFloat (int crate, int channel, std::string name, int timeout = 2);
00067 std::string ddcGetChannelParameterString (int crate, int channel, std::string name, int timeout = 2);
00069 int ddcGetCardParameterInt (int crate, int card, std::string name, int timeout = 2);
00071 float ddcGetCardParameterFloat (int crate, int card, std::string name, int timeout = 2);
00073 std::string ddcGetCardParameterString (int crate, int card, std::string name, int timeout = 2);
00075 int ddcGetCrateParameterInt (int crate, std::string name, int timeout = 2);
00077 float ddcGetCrateParameterFloat (int crate, std::string name, int timeout = 2);
00079 std::string ddcGetCrateParameterString (int crate, std::string name, int timeout = 2);
00080
00082
00087 void ddcGetCrateParameters(int crate, std::vector<std::string> names,
00088 std::map<std::string, float>& dpeValues, int timeout);
00089
00091 void ddcSetChannelParameter (int crate, int channel, std::string name, float value, int timeout = 2);
00093 void ddcSetCardParameter (int crate, int card, std::string name, float value, int timeout = 2);
00095 void ddcSetCrateParameter (int crate, std::string name, float value, int timeout = 2);
00096
00097
00098
00099
00100
00108 void requestHardResetAll();
00109
00117 void requestHardReset(UINT32 mid);
00118
00126 void requestIVCurve(UINT32 mid, FLOAT32 start, FLOAT32 stop, FLOAT32 step, UINT16 delay, FLOAT32 currentLim);
00127
00135 void requestIVCurveAll(FLOAT32 start, FLOAT32 stop, FLOAT32 step, UINT16 delay, FLOAT32 currentLim);
00136
00147 void setSelectAllInCrate(int crate, bool value, int timeout = 5);
00148
00159
00160 void setSelect(UINT32 mid, bool value);
00161
00171 void changeRunState(int state);
00172
00173 };
00174 };
00175
00176 #endif