#pragma once #include #include using namespace std; #include "DIOS.Dev.MouldDefine.hpp" #pragma warning (disable:4244) // warning C4244: “初始化”: 从“double”转换到“float”,可能丢失数据 namespace DIOS::Dev::Detail { namespace Generator { static const char* GeneratorDriverType = "{18FDF176-DECE-445F-A52C-A14BDD3AC2C1}"; static const char* GeneratorUnitType = "{123492D6-A546-4ACF-8EF1-2CCAA9EA974E}"; namespace AttrKey { static const char* KV = "KV"; static const char* MA = "MA"; static const char* MS = "MS"; static const char* MAS = "MAS"; static const char* FOCUS = "FOCUS"; static const char* WORKSTATION = "WORKSTATION"; static const char* TECHMODE = "TECHMODE"; static const char* AECDENSITY = "AECDENSITY"; static const char* AECFIELD = "AECFIELD"; static const char* AECFILM = "AECFILM"; static const char* TUBEHEAT = "TUBEHEAT"; static const char* POSTKV = "POSTKV"; static const char* POSTMA = "POSTMA"; static const char* POSTMS = "POSTMS"; static const char* POSTMAS = "POSTMAS"; static const char* GENSYNSTATE = "GENERATORSYNCSTATE"; static const char* GENSTATE = "GENERATORSTATUS"; static const char* TOTALEXPSURENUMBER = "TotalExposureNumber"; static const char* TOTALACQTIMES = "TotalAcqTimes"; static const char* TUBECOOLWAITTIME = "TubeCoolWaitTime"; static const char* TUBEOVERLOADNUMBER = "TubeOverLoadNumber"; static const char* CURRENTEXPOSUREBNUMBER = "CurrentExposureNumber"; static const char* EXPMODE = "EXPMODE"; static const char* MODALITY = "Modality"; static const char* FRAMERATE = "FrameRate"; static const char* BATTERYCHARGESTATE = "BatteryChargeState"; static const char* REFERENCEAIRKERMA = "ReferenceAirKerma"; static const char* KVLIST = "KVList"; static const char* MASLIST = "MASList"; 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_SYNC_MAX }GENERATOR_SYNC; typedef enum _Dios_Generator_Status { GENERATOR_STATUS_SHUTDOWN, GENERATOR_STATUS_INIT, GENERATOR_STATUS_SLEEP, GENERATOR_STATUS_CHARGING,//充电 GENERATOR_STATUS_STANDBY, GENERATOR_STATUS_EXP, GENERATOR_STATUS_ERROR, GENERATOR_STATUS_NOWORK, GENERATOR_STATUS_MAX }GENERATOR_STATUS; } namespace ActionKey { static const char* IncParam_KV = "IncParam_KV"; static const char* DecParam_KV = "DecParam_KV"; static const char* SetValue_KV = "SetValue_KV"; static const char* IncParam_MA = "IncParam_MA"; static const char* DecParam_MA = "DecParam_MA"; static const char* SetValue_MA = "SetValue_MA"; static const char* IncParam_MS = "IncParam_MS"; static const char* DecParam_MS = "DecParam_MS"; static const char* SetValue_MS = "SetValue_MS"; static const char* IncParam_MAS = "IncParam_MAS"; static const char* DecParam_MAS = "DecParam_MAS"; static const char* SetValue_MAS = "SetValue_MAS"; static const char* SetValue_TECHMODE = "SetValue_TECHMODE"; static const char* SetValue_FOCUS = "SetValue_FOCUS"; static const char* SetValue_AECDENSITY = "SetValue_AECDENSITY"; static const char* SetValue_AECFIELD = "SetValue_AECFIELD"; static const char* SetValue_AECFILM = "SetValue_AECFILM"; static const char* SetValue_WORKSTATION = "SetValue_WORKSTATION"; static const char* Query_HE = "Query_HE"; static const char* GetValue_POSTKV = "GetValue_POSTKV"; static const char* GetValue_POSTMA = "GetValue_POSTMA"; static const char* GetValue_POSTMS = "GetValue_POSTMS"; static const char* GetValue_POSTMAS = "GetValue_POSTMAS"; static const char* SetAPR = "SetAPR"; static const char* SetGeneratortoSyncStatus = "SetGeneratortoSyncStatus"; static const char* SetExpEnable = "SetExpEnable"; static const char* SetExpDisable = "SetExpDisable"; static const char* Reset = "RESET"; static const char* SetExpMode = "SetExpMode"; static const char* SetFrameRate = "SetFrameRate"; static const char* SetModality = "SetModality"; } namespace GENPARAM { static const int ET_TIME = 0; static const int ET_MAS = 1; static const int ET_AEC = 2; static const int FOCUS_BIG = 1; static const int FOCUS_SMALL = 0; static const int FOCUS_AUTO = 2; } //----------------------------------------------------------------------------- // KV //----------------------------------------------------------------------------- class KVMould : public FloatMould { using super = FloatMould; public: KVMould(float initialvalue, float min, float max, float accuracy) :super(AttrKey::KV, initialvalue, min, max, accuracy) {} ~KVMould() {} static constexpr const char * Unit { "kV" }; std::string GetDescription() { ResDataObject temp, result; temp.add(ValKey::UPPERLIMIT, m_LimitMax); temp.add(ValKey::LOWERLIMIT, m_LimitMin); temp.add(ValKey::ACCURACY, m_Accuracy); temp.add(ValKey::UNIT, Unit); result.add(Key.c_str(), temp); return result.encode(); } }; //----------------------------------------------------------------------------- // MA //----------------------------------------------------------------------------- class MAMould :public FloatMould { using super = FloatMould; public: MAMould(float initialvalue, float min, float max, float accuracy) :super(AttrKey::MA, initialvalue, min, max, accuracy) {} ~MAMould() {} static constexpr const char * Unit { "mA" }; std::string GetDescription() { ResDataObject temp, result; temp.add(ValKey::UPPERLIMIT, m_LimitMax); temp.add(ValKey::LOWERLIMIT, m_LimitMin); temp.add(ValKey::ACCURACY, m_Accuracy); temp.add(ValKey::UNIT, Unit); result.add(Key.c_str(), temp); return result.encode(); } }; //----------------------------------------------------------------------------- // MS //----------------------------------------------------------------------------- class MSMould :public FloatMould { using super = FloatMould; public: MSMould(float initialvalue, float min, float max, float accuracy) :super(AttrKey::MS, initialvalue, min, max, accuracy) {} ~MSMould() {} static constexpr const char* Unit { "ms" }; std::string GetDescription() { ResDataObject temp, result; temp.add(ValKey::UPPERLIMIT, m_LimitMax); temp.add(ValKey::LOWERLIMIT, m_LimitMin); temp.add(ValKey::ACCURACY, m_Accuracy); temp.add(ValKey::UNIT, Unit); result.add(Key.c_str(), temp); return result.encode(); } }; //----------------------------------------------------------------------------- // MAS //----------------------------------------------------------------------------- class MASMould :public FloatMould { using super = FloatMould; public: MASMould(float initialvalue, float min, float max, float accuracy) :super(AttrKey::MAS, initialvalue, min, max, accuracy) {} ~MASMould() {} static constexpr const char* Unit { "mAs" }; std::string strUnit = Unit; //std::string GetDescription(); }; //----------------------------------------------------------------------------- // FOCUS //----------------------------------------------------------------------------- class FOCUSMould :public IntMould { using super = IntMould; public: FOCUSMould(int initialvalue, int min, int max, int accuracy) :super(AttrKey::FOCUS, initialvalue, min, max, accuracy) {} ~FOCUSMould() {} }; //----------------------------------------------------------------------------- // WORKSTATION //----------------------------------------------------------------------------- class WORKSTATIONMould :public IntMould { using super = IntMould; public: WORKSTATIONMould(int initialvalue, int min, int max, int accuracy) :super(AttrKey::WORKSTATION, initialvalue, min, max, accuracy) {} ~WORKSTATIONMould() {} }; //----------------------------------------------------------------------------- // TECHMODE //----------------------------------------------------------------------------- class TECHMODEMould :public IntMould { using super = IntMould; public: TECHMODEMould(int initialvalue, int min, int max, int accuracy) :super(AttrKey::TECHMODE, initialvalue, min, max, accuracy) {} ~TECHMODEMould() {} }; //----------------------------------------------------------------------------- // AECField //----------------------------------------------------------------------------- class AECFIELDMould :public IntMould { using super = IntMould; public: AECFIELDMould(int initialvalue, int min, int max, int accuracy) :super(AttrKey::AECFIELD, initialvalue, min, max, accuracy) {} ~AECFIELDMould() {} }; //----------------------------------------------------------------------------- // AECFilm //----------------------------------------------------------------------------- class AECFILMMould :public IntMould { using super = IntMould; public: AECFILMMould(int initialvalue, int min, int max, int accuracy) :super(AttrKey::AECFILM, initialvalue, min, max, accuracy) {} ~AECFILMMould() {} }; //----------------------------------------------------------------------------- // AECDensity //----------------------------------------------------------------------------- class AECDENSITYMould :public IntMould { using super = IntMould; public: AECDENSITYMould(int initialvalue, int min, int max, int accuracy) :super(AttrKey::AECDENSITY, initialvalue, min, max, accuracy) {} ~AECDENSITYMould() {} }; //----------------------------------------------------------------------------- // TUBEHEATMould //----------------------------------------------------------------------------- class TUBEHEATMould :public IntMould { using super = IntMould; public: TUBEHEATMould(int initialvalue, int min, int max, int accuracy) :super(AttrKey::TUBEHEAT, initialvalue, min, max, accuracy) {} ~TUBEHEATMould() {} }; //----------------------------------------------------------------------------- // POSTKVMould //----------------------------------------------------------------------------- class POSTKVMould :public FloatMould { using super = FloatMould; public: POSTKVMould(float initialvalue, float min, float max, float accuracy) :super(AttrKey::POSTKV, initialvalue, min, max, accuracy) {} ~POSTKVMould() {} static constexpr const char* Unit{ "kV" }; std::string strUnit = Unit; //std::string GetDescription(); }; //----------------------------------------------------------------------------- // POSTMAMould //----------------------------------------------------------------------------- class POSTMAMould :public FloatMould { using super = FloatMould; public: POSTMAMould(float initialvalue, float min, float max, float accuracy) :super(AttrKey::POSTMA, initialvalue, min, max, accuracy) {} ~POSTMAMould() {} static constexpr const char* Unit{ "mA" }; std::string GetDescription() { ResDataObject temp, result; temp.add(ValKey::UPPERLIMIT, m_LimitMax); temp.add(ValKey::LOWERLIMIT, m_LimitMin); temp.add(ValKey::ACCURACY, m_Accuracy); temp.add(ValKey::UNIT, Unit); result.add(Key.c_str(), temp); return result.encode(); } }; //----------------------------------------------------------------------------- // POSTMSMould //----------------------------------------------------------------------------- class POSTMSMould :public FloatMould { using super = FloatMould; public: POSTMSMould(float initialvalue, float min, float max, float accuracy) :super(AttrKey::POSTMS, initialvalue, min, max, accuracy) {} ~POSTMSMould() {} static constexpr const char* Unit { "ms" }; std::string GetDescription() { ResDataObject temp, result; temp.add(ValKey::UPPERLIMIT, m_LimitMax); temp.add(ValKey::LOWERLIMIT, m_LimitMin); temp.add(ValKey::ACCURACY, m_Accuracy); temp.add(ValKey::UNIT, Unit); result.add(Key.c_str(), temp); return result.encode(); } }; //----------------------------------------------------------------------------- // POSTMASMould //----------------------------------------------------------------------------- class POSTMASMould :public FloatMould { using super = FloatMould; public: POSTMASMould(float initialvalue, float min, float max, float accuracy) :super(AttrKey::POSTMAS, initialvalue, min, max, accuracy) {} ~POSTMASMould() {} static constexpr const char* Unit { "mAs" }; std::string GetDescription() { ResDataObject temp, result; temp.add(ValKey::UPPERLIMIT, m_LimitMax); temp.add(ValKey::LOWERLIMIT, m_LimitMin); temp.add(ValKey::ACCURACY, m_Accuracy); temp.add(ValKey::UNIT, Unit); result.add(Key.c_str(), temp); return result.encode(); } }; //----------------------------------------------------------------------------- // GENSYNSTATEMould //----------------------------------------------------------------------------- class GENSYNSTATEMould :public IntMould { using super = IntMould; public: GENSYNSTATEMould(int initialvalue, int min, int max, int accuracy) :super(AttrKey::GENSYNSTATE, initialvalue, min, max, accuracy) {} ~GENSYNSTATEMould() {} }; //----------------------------------------------------------------------------- // GENSTATE //----------------------------------------------------------------------------- class GENSTATEMould :public IntMould { using super = IntMould; public: GENSTATEMould(int initialvalue, int min, int max, int accuracy) :super(AttrKey::GENSTATE, initialvalue, min, max, accuracy) {} ~GENSTATEMould() {} }; //----------------------------------------------------------------------------- // TotalExposureNumberMould //----------------------------------------------------------------------------- class TOTALEXPNUMMould :public IntMould { using super = IntMould; public: TOTALEXPNUMMould(int initialvalue, int min, int max, int accuracy) :super(AttrKey::TOTALEXPSURENUMBER, initialvalue, min, max, accuracy) { } ~TOTALEXPNUMMould() { } }; //----------------------------------------------------------------------------- // TotalAcqTimesMould //----------------------------------------------------------------------------- class TOTALACQTIMESMould :public IntMould { using super = IntMould; public: TOTALACQTIMESMould(int initialvalue, int min, int max, int accuracy) :super(AttrKey::TOTALACQTIMES,initialvalue, min, max, accuracy) { } ~TOTALACQTIMESMould() { } }; //----------------------------------------------------------------------------- // TubeCoolWaitTimeMould //----------------------------------------------------------------------------- class TUBECOOLTIMEMould :public IntMould { using super = IntMould; public: TUBECOOLTIMEMould(int initialvalue, int min, int max, int accuracy) :super(AttrKey::TUBECOOLWAITTIME,initialvalue, min, max, accuracy) { } ~TUBECOOLTIMEMould() { } }; //----------------------------------------------------------------------------- // TubeOverLoadNumber //----------------------------------------------------------------------------- class TUBEOVERLOADNUMMould :public IntMould { using super = IntMould; public: TUBEOVERLOADNUMMould(int initialvalue, int min, int max, int accuracy) :super(AttrKey::TUBEOVERLOADNUMBER,initialvalue, min, max, accuracy) { } ~TUBEOVERLOADNUMMould() { } }; //----------------------------------------------------------------------------- // CurrentExposureNumber //----------------------------------------------------------------------------- class CUREXPNUMMould :public IntMould { using super = IntMould; public: CUREXPNUMMould(int initialvalue, int min, int max, int accuracy) :super(AttrKey::CURRENTEXPOSUREBNUMBER,initialvalue, min, max, accuracy) { } ~CUREXPNUMMould() { } }; //----------------------------------------------------------------------------- // _tAPRArgs //----------------------------------------------------------------------------- struct _tAPRArgs { int nFocus; int nTechmode; float fKV; float fMA; float fMS; float fMAS; int nAECDensity; int nAECFilm; int nAECField; }; //----------------------------------------------------------------------------- // EXPMODEMould //----------------------------------------------------------------------------- class EXPMODEMould :public StringMould { using super = StringMould; public: EXPMODEMould(std::string initialvalue) :super(AttrKey::EXPMODE, initialvalue) { } ~EXPMODEMould() { } }; //----------------------------------------------------------------------------- // MODALITYMould //----------------------------------------------------------------------------- class MODALITYMould :public StringMould { using super = StringMould; public: MODALITYMould(std::string initialvalue) :super(AttrKey::MODALITY, initialvalue) { } ~MODALITYMould() { } }; //----------------------------------------------------------------------------- // FRAMERATEMould //----------------------------------------------------------------------------- class FRAMERATEMould :public FloatMould { using super = FloatMould; public: FRAMERATEMould(float initialvalue, float min, float max, float accuracy) :super(AttrKey::FRAMERATE, initialvalue, min, max, accuracy) { } ~FRAMERATEMould() { } }; //----------------------------------------------------------------------------- // CurrentExposureNumber //----------------------------------------------------------------------------- class BATTERYCHARGSTATEMould :public IntMould { using super = IntMould; public: BATTERYCHARGSTATEMould(int initialvalue, int min, int max, int accuracy) :super(AttrKey::BATTERYCHARGESTATE, initialvalue, min, max, accuracy) { } ~BATTERYCHARGSTATEMould() { } }; //----------------------------------------------------------------------------- // REFERENCEAIRKERMAMould //----------------------------------------------------------------------------- class REFERENCEAIRKERMAMould :public FloatMould { using super = FloatMould; public: REFERENCEAIRKERMAMould(float initialvalue, float min, float max, float accuracy) :super(AttrKey::REFERENCEAIRKERMA, initialvalue, min, max, accuracy) { } ~REFERENCEAIRKERMAMould() { } }; //----------------------------------------------------------------------------- // KVLISTMould //----------------------------------------------------------------------------- class KVLISTMould :public StringMould { using super = StringMould; public: KVLISTMould(std::string initialvalue) :super(AttrKey::KVLIST, initialvalue) { } ~KVLISTMould() { } }; //----------------------------------------------------------------------------- // MASLISTMould //----------------------------------------------------------------------------- class MASLISTMould :public StringMould { using super = StringMould; public: MASLISTMould(std::string initialvalue) :super(AttrKey::MASLIST, initialvalue) { } ~MASLISTMould() { } }; //----------------------------------------------------------------------------- // ConfigInfo //----------------------------------------------------------------------------- namespace ConfKey { static const char* DiosGeneratorType = "GeneratorVender"; static const char* DiosGeneratorModel = "GeneratorModel"; static const char* DiosGeneratorConfig = "DeviceConfig"; static const char* DiosGeneratorAttribute = "Attribute"; static const char* DiosGeneratorDescription = "Description"; static const char* DiosSyncType = "SyncType"; 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* DiosWSTable = "WSTable"; static const char* DiosWSWall = "WSWall"; static const char* DiosWSFree = "WSFree"; static const char* DiosWSTomo = "WSTomo"; static const char* DiosWSConventional = "WSConventional"; static const char* DiosSynTable = "SYNTable"; static const char* DiosSynWall = "SYNWall"; static const char* DiosSynFree = "SYNFree"; static const char* DiosSynTomo = "SYNTomo"; static const char* DiosSynConventional = "SYNConventional"; static const char* DiosConsoleRole = "ConsoleRole"; static const char* DiosIsConnect = "IsConnect"; } } }