123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220 |
- #pragma once
- #include <string>
- #include <algorithm>
- using namespace std;
- //
- //#include "TmplMould.tlh"
- //#include "TmplMould.tli"
- #include "DIOS.Dev.MouldDefine.hpp"
- #pragma warning (disable:4244) // warning C4244: “初始化”: 从“double”转换到“float”,可能丢失数据
- namespace DIOS::Dev::Detail
- {
- namespace SYNBOX
- {
- static const char* DeviceDriverType = "{93A0633D-0BF0-4C45-9973-BFF841D5E2DC}";
- static const char* SyncConsoleUnitType = "{D1AF818B-72D0-400E-B780-DF58E2EF23D4}";
- namespace AttrKey
- {
- static const char* SYNSTATE = "SYNBOXSTATUS"; //同步盒设备状态
- enum SYNBOX_STATUS {
- SYNBOX_STATUS_SHUTDOWN,
- SYNBOX_STATUS_INIT,
- SYNBOX_STATUS_SLEEP,
- SYNBOX_STATUS_CHARGING,//充电
- SYNBOX_STATUS_STANDBY,
- SYNBOX_STATUS_ERROR,
- SYNBOX_STATUS_SERVICE,
- SYNBOX_STATUS_MAX
- };
- static const char* WORKSTATION = "WORKSTATION";
- static const char* EXPMODE = "EXPMODE";
- static const char* EXPFRAMERAT = "EXPFRAMERAT";
- static const char* EXPTIMES = "EXPTIMES";
- static const char* DiosGeneratorSync = "GENERATORSYNCSTATE";
- static const char* DiosGRIDSync = "GRIDSYNCSTATE";
- typedef enum _Dios_Generator_Sync
- {
- GENERATOR_SYNC_ERR = -1,
- GENERATOR_RAD_OFF,
- GENERATOR_RAD_PREPARE,
- GENERATOR_RAD_READY,
- GENERATOR_RAD_XRAYON,
- GENERATOR_RAD_XRAYOFF,
- GENERATOR_FLU_OFF,
- GENERATOR_FLU_READY,
- GENERATOR_FLU_XRAYON,
- GENERATOR_FLU_XRAYOFF,
- GENERATOR_FLU_CINE_READY,
- GENERATOR_SYNC_MAX
- }GENERATOR_SYNC;
- static const char* DiosHandSwitch = "HANDSWITCHSTATE";
- typedef enum _HAND_SWITCH {
- HAND_OFF,
- HAND_DWON1,
- HAND_DWON2,
- HAND_MAX
- }HAND_SWITCH;
- static const char* DiosFootSwitch = "FOOTSWITCHSTATE";
- typedef enum _FOOT_SWITCH {
- FOOT_OFF,
- FOOT_DWON1,
- FOOT_MAX
- }FOOT_SWITCH;
- static const char* TOTALEXPSURENUMBER = "TotalExposureNumber";
- static const char* CURRENTEXPOSUREBNUMBER = "CurrentExposureNumber";
- static const char* DiosDetectorStatus = "DETECTORSTATUS";
- typedef enum _Dios_Detector_Status
- {
- DETECTOR_STATUS_SHUTDOWN,
- DETECTOR_STATUS_INIT,
- DETECTOR_STATUS_SLEEP,
- DETECTOR_STATUS_WAKEUP,//低能耗,能工作
- DETECTOR_STATUS_STANDBY,//高能耗,能采集
- //DETECTOR_STATUS_ACQ_WAIT,//在STANDBY状态,执行ACQ Action且没到ACQ状态
- DETECTOR_STATUS_ACQ,
- //DETECTOR_STATUS_STANDBY_WAIT,//在ACQ状态,执行StopAcq Action且没到STANDBY状态
- DETECTOR_STATUS_ERROR,
- DETECTOR_STATUS_MAX
- }DETECTOR_STATUS;
- static const char* DiosXwindowStatus = "XwindowStatus";
- typedef enum _Xwindow_Status {
- XWINDOW_OFF,
- XWINDOW_ON,
- XWINDOW_MAX
- }XWINDOW_STATUS;
- typedef enum _Xgrid_Status {
- XGRID_DISABLE,
- XGRID_ENABLE,
- }XGRID_STATUS;
- }
- namespace ActionKey
- {
- static const char* Reset = "RESET";
- static const char* SetValue_WORKSTATION = "SetValue_WORKSTATION";
- static const char* SetExpMode = "SetExpMode";
- static const char* SetGeneratortoSyncStatus = "SetGeneratortoSyncStatus";
- static const char* SetExpEnable = "SetExpEnable";
- static const char* SetExpDisable = "SetExpDisable";
- static const char* PrepareAcquisition = "PrepareAcquisition";
- static const char* StartWindowRequest = "StartWindowRequest";
- static const char* SetExposureTimes = "SetExposureTimes";
- static const char* StopWindowRequest = "StopWindowRequest";
- static const char* SetFrameRate = "SetFrameRate";
- static const char* SetValue_PPS = "SetValue_PPS";
- static const char* SetGenAECSignal = "SetGenAECSignal";
- static const char* SimulateFootSwitchSignal = "SimulateFootSwitchSignal";
- static const char* SimulateHandSwitchSignal = "SimulateHandSwitchSignal";
- static const char* SetDirectSignal = "SetDirectSignal";
- static const char* ActiveSyncMode = "ActiveSyncMode";//取代WorkStation设置同步模式,由上层调用设置
- }
- //##################################################################################################
- //定义具体设备属性
- #define UNIT_DATA_INT(NAME, KEY) \
- class NAME :public IntMould\
- {\
- using super = IntMould;\
- public:\
- NAME(int initialvalue, int lower, int upper, int accuracy)\
- :super(KEY, initialvalue, lower, upper, accuracy)\
- {}\
- ~NAME() {}\
- };\
- #define UNIT_DATA_INT_withLimit(NAME, KEY, INIT, MIN, MAX, ACC) \
- class NAME :public IntMould\
- {\
- using super = IntMould;\
- public:\
- NAME(int initialvalue = INIT, int lower = MIN, int upper = MAX, int accuracy = ACC)\
- :super(KEY, initialvalue, lower, upper, accuracy)\
- {}\
- ~NAME() {}\
- };\
- #define UNIT_DATA_FLOAT(NAME, KEY) \
- class NAME :public FloatMould\
- {\
- using super = FloatMould;\
- public:\
- NAME(float initialvalue, float lower, float upper, float accuracy)\
- :super(KEY, initialvalue, lower, upper, accuracy)\
- {}\
- ~NAME() {}\
- };\
- #define UNIT_DATA_STR(NAME, KEY) \
- class NAME :public StringMould\
- {\
- using super = StringMould;\
- public:\
- NAME(std::string initialvalue)\
- :super(KEY, initialvalue)\
- {}\
- ~NAME() {}\
- };\
- UNIT_DATA_INT(SYNSTATEMould, AttrKey::SYNSTATE);
- UNIT_DATA_INT(HANDSWITCHMould, AttrKey::DiosHandSwitch);
- UNIT_DATA_INT(GENSYNSTATEMould, AttrKey::DiosGeneratorSync);
- UNIT_DATA_INT(TOTALEXPNUMMould, AttrKey::TOTALEXPSURENUMBER);
- UNIT_DATA_INT(CUREXPNUMMould, AttrKey::CURRENTEXPOSUREBNUMBER);
- UNIT_DATA_INT(DETECTORSTATUSMould, AttrKey::DiosDetectorStatus);
- UNIT_DATA_INT(XWINDOWSTATUSMould, AttrKey::DiosXwindowStatus);
- UNIT_DATA_STR(WORKSTATIONMould, AttrKey::WORKSTATION);
- UNIT_DATA_STR(EXPMODEMould, AttrKey::EXPMODE);
- UNIT_DATA_INT(EXPFRAMERATEMould, AttrKey::EXPFRAMERAT);
- UNIT_DATA_INT(EXPTIMESMould, AttrKey::EXPTIMES);
- UNIT_DATA_INT(GRIDSYNSTATEMould, AttrKey::DiosGRIDSync);
-
- //-----------------------------------------------------------------------------
- // _tSyncModeArgs
- //-----------------------------------------------------------------------------
- struct _tSyncModeArgs
- {
- string strWS;
- string strSyncMode;
- string strSyncValue;
- };
- //-----------------------------------------------------------------------------
- // ConfigInfo
- //-----------------------------------------------------------------------------
- namespace ConfKey
- {
- static const char* DiosType = "Vender";
- static const char* DiosModel = "Model";
- static const char* DiosConfig = "DeviceConfig";
- static const char* DiosAttribute = "Attribute";
- static const char* DiosDescription = "Description";
- static const char* AttributeType = "Type";
- static const char* AttributeAccess = "Access";
- static const char* AttributeRangeMax = "RangeMax";
- static const char* AttributeRangeMin = "RangeMin";
- static const char* AttributeListNum = "ListNum";
- static const char* AttributeList = "List";
- static const char* AttributeRequired = "Required";
- static const char* AttributeDefaultValue = "DefaultValue";
- static const char* DiosSCFType = "SCFType";
- static const char* DiosSCFTCPIP = "TCPIP";
- static const char* DiosSCFCOM = "COM";
- static const char* DiosSCFIP = "ip";
- static const char* DiosSCFPort = "port";
- static const char* DiosSCFBaudrate = "baudrate";
- static const char* DiosSCFBytesize = "bytesize";
- static const char* DiosSCFParity = "parity";
- static const char* DiosSCFStopbits = "stopbits";
- static const char* DiosIsConnect = "IsConnect";
- }
- }
- }
|