123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678 |
- #pragma once
- #include <string>
- #include <algorithm>
- 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";
- }
- }
- }
|