1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633 |
- #pragma once
- #include <stdlib.h>
- #include "Detector_Model_Def.h"
- #include "Generator_Model_Def.h"
- #include "ResDataObject.h"
- #define Gen_DEFAULT_PARAM_ZERO 0.0f
- #define Gen_DEFAULT_APPMODE APP_DR
- #define Gen_DEFAULT_EXAMMODE EXM_SINGLE
- #define Gen_DEFAULT_PARAM_KV 0.0f
- #define Gen_DEFAULT_PARAM_MAS 0.0f
- #define Gen_DEFAULT_PARAM_MA 0.0f
- #define Gen_DEFAULT_PARAM_MS 0.0f
- #define Gen_DEFAULT_PARAM_FOCUS -1
- #define Gen_DEFAULT_PARAM_WORKSTATION -1
- #define Gen_DEFAULT_PARAM_TECHMODE -1
- #define Gen_DEFAULT_PARAM_AECDENSITY 0.0f
- #define Gen_DEFAULT_PARAM_AECFIELD -1
- #define Gen_DEFAULT_PARAM_AECFILM -1
- #define Gen_DEFAULT_PARAM_POSTMS 0.0f
- #define Gen_DEFAULT_PARAM_POSTMAS 0.0f
- #define MAX_STRING 1024
- typedef enum _Application_Mode {
- APP_DR,
- APP_DX,
- APP_US,
- APP_MODE_MAX
- }APP_MODE;
- #define APPMODEDX ("DX")
- #define APPMODERF ("RF")
- //mamo
- #define APPMODEMG ("MG")
- typedef enum _Exam_Mode {
- EXM_ERROR = -1,
- EXM_SINGLE = 0,
- EXM_DUALENERGY,
- EXM_STITCH,
- EXM_AEC,
- EXM_HDR,
- EXM_GAIN,
- EXM_OFFSET,
- EXM_TOMO,
- EXM_MAMO_MANUAL,
- EXM_MAMO_SEMIAUTO,
- EXM_MAMO_AUTOMATIC,
- EXM_MAMO_AUTOFILTER,
- EXM_MAMO_TOMOSEMIAUTO,
- EXM_MAMO_TOMOAUTOMATIC,
- EXM_MODE_MAX
- }EXAM_MODE;
- #define EXAMMODE_SINGLE ("Single")
- #define EXAMMODE_STITCH ("Stitch")
- #define EXAMMODE_PF ("PulseSerial")
- #define EXAMMODE_CF ("CoutineSerial")
- #define EXAMMODE_TOMO ("TOMO")
- #define EXAMMODE_MAMO_MANUAL ("MANUAL")
- #define EXAMMODE_MAMO_SEMIAUTO ("SEMIAUTO")
- #define EXAMMODE_MAMO_AUTOMATIC ("AUTOMATIC")
- #define EXAMMODE_MAMO_AUTOFILTER ("AUTOFILTER")
- #define EXAMMODE_MAMO_TOMOSEMIAUTO ("TOMO_SEMIAUTO")
- #define EXAMMODE_MAMO_TOMOAUTOMATIC ("TOMO_AUTOMATIC")
- typedef enum _Ultral_Sound_Exam_Mode {
- EXM_BRIGHTNESS,
- EXM_COLOR_DOPPLER_FLOW,
- EXM_POWER_DOPPLER,
- EXM_DIRECTIONAL_POWER_DOPPLER,
- EXM_PULSE_WAVE,
- EXM_CONTINOUS_WAVE
- }US_EXAM_MODE;
- typedef enum _Result_SM {
- RESM_INVALID = -3,
- RESM_NOSUPPORT = -2,
- RESM_TIMEOUT = -1,
- RESM_FAILED = 0,
- RESM_SUCCEED,
- RESM_WARNING
- }RES_SM;
- typedef enum Image_Type {
- IMAGE_TYPE_2D,
- IMAGE_TYPE_3D,
- IMAGE_TYPE_1D
- }IMAGE_TYPE;
- typedef enum WorkStation_Type {
- WS_TABLE,
- WS_WALL,
- WS_CONVENTIONAL,
- WS_FREE,
- WS_TOMO,
- WS_TABLE_WALL,
- }WORKSTATION_TYPE;
- typedef enum Techmode_Type {
- TECHMODE_NOAEC_3P,
- TECHMODE_NOAEC_2P,
- TECHMODE_AEC_3P,
- TECHMODE_AEC_2P,
- TECHMODE_AEC_1P
- }TECHMODE_TYPE;
- typedef enum Focus_Type {
- FOCUS_SMALL,
- FOCUS_LARGE,
- FOCUS_AUTOMATIC
- }FOCUS_TYPE;
- typedef enum AECField_Type {
- FIELD_RIGHT = 1,
- FIELD_CENTER,
- FIELD_RIGHT_CENTER,
- FIELD_LEFT,
- FIELD_LEFT_RIGHT,
- FIELD_CENTER_LEFT,
- FIELD_LEFT_CENTER_RIGHT
- }AECFIELD_TYPE;
- typedef enum AECFilm_Type {
- FILM_SLOW,
- FILM_MEDIUM,
- FILM_FAST
- }AECFILM_TYPE;
- typedef enum _Gen_Param {
- Gen_APPMODE,
- Gen_EXAMMODE,
- Gen_Param_KV,
- Gen_Param_MAS,
- Gen_Param_MA,
- Gen_Param_MS,
- Gen_Param_FOCUS,
- Gen_Param_WORKSTATION,
- Gen_Param_TECHMODE,
- Gen_Param_AECDENSITY,
- Gen_Param_AECFIELD,
- Gen_Param_AECFILM,
- Gen_Param_POSTKV,
- Gen_Param_POSTMA,
- Gen_Param_POSTMS,
- Gen_Param_POSTMAS,
- Gen_Param_REPLAYWALLKV,
- Gen_Param_REPLAYWALLMA,
- Gen_Param_REPLAYWALLMS,
- Gen_Param_REPLAYTABLEKV,
- Gen_Param_REPLAYTABLEMA,
- Gen_Param_REPLAYTABLEMS,
- Gen_Param_APR,
- Gen_RESET,
- Gen_EXPOSURESTATUS,
- Gen_IMAGESTATUS,
- Gen_Param_CUREXPOSURESTEP,
- Gen_Param_TOTALEXPOSURESTEP,
- Gen_Param_CURMECHSIZE,
- Gen_Param_TOTALMECHSIZE,
- Gen_Param_STEPMECHSIZE,
- Gen_Param_EXPOSEDDOSE,
- Gen_Param_FLKV,
- Gen_Param_FLMA,
- Gen_Param_ABS,
- Gen_Param_EXO,
- Gen_Param_HE,
- Gen_Param_DAP,
- Gen_Param_PositionCode
- }GEN_PARAM;
- typedef enum _Dap_Param {
- Dap_Param_KV,
- Dap_Param_MA,
- Dap_Param_MS,
- Dap_Param_MAS,
- Dap_Param_PostMS,
- Dap_Param_PostMAS,
- Dap_Param_DAP,
- Dap_Param_DapRate,
- Dap_Param_MAX
- }DAP_PARAM;
- typedef enum _Gen_Exposure_Status {
- Gen_Infomation = 0,
- Gen_Warning,
- Gen_Error,
- Gen_PerHandSwitchPress, //First HandSwitch press
- Gen_SecondHandSwitchPress, //Second HandSwitch press
- Gen_Ready,
- Gen_XayOn,
- Gen_XayOff,
- Gen_SecondHandSwitchRelease, //Second HandSwitch press
- Gen_PerHandSwitchRelease, //First HandSwitch Release
- Gen_ExpDisEnable, //Device No Ready
- Gen_ExpEnable //Device Ready
- }GEN_EXPOSURE_STATUS;
- typedef enum US_Image_View_Type
- {
- IMAGE_B = 0,
- IMAGE_CDF,
- IMAGE_M
- }US_IMAGE_VIEW_TYPE;
- typedef enum _SM_Status
- {
- SM_SeqPrep = 0,
- SM_SeqReady,
- SM_FramePrep,
- SM_FrameReady,
- SM_FrameStart,
- SM_FrameIn,
- SM_FramePost,
- SM_FrameEnd,
- SM_FrameError,
- SM_SeqPost
- }SM_STATUS;
- typedef enum Calibration_Type
- {
- CAL_TYPE_NONE = 0,
- CAL_TYPE_OFFSET,
- CAL_TYPE_GAIN,
- CAL_TYPE_DEFECT
- }CAL_TYPE;
- typedef enum Calibration_Status
- {
- CAL_STATUS_NOTSTART = 0,
- CAL_STATUS_START,
- CAL_STATUS_COMPLETE
- }CAL_STATUS;
- typedef enum Offset_Type
- {
- OFT_NONE= 0,
- OFT_OOOEO, //AAAAAAAAAAA(A) + Exp + B
- OFT_O_PERIOD_E,//A__ + A__ + A__ + Exp//采集界面有offset超时
- OFT_OOO_PERIOD_E,//AAAAAAAA ____Exp1__Exp2__Exp3______AAAAAAAA//采集界面有offset超时
- OFT_PANEL
-
- }OFFSET_TYPE;
- /*
- typedef enum ECOM_FPD_State
- {
- ECOM_FPD_STATE_NOT_INI = 0,
- ECOM_FPD_STATE_ERR,
- ECOM_FPD_STATE_STANDBY,
- ECOM_FPD_STATE_PREPARE,
- ECOM_FPD_STATE_READY,
- ECOM_FPD_STATE_SLEEP,
- ECOM_FPD_STATE_SHUTDOWN,
- ECOM_FPD_STATE_EXIT
- }ECOM_FPD_STATE;*/
- typedef enum ECOM_GRID_State
- {
- ECOM_GRID_ABSENT = 0,
- ECOM_GRID_PRESENT,
- ECOM_GRID_120,
- ECOM_GRID_180,
- ECOM_GRID_UNKNOWN,
- ECOM_GRID_120_ROTATE,
- ECOM_GRID_PARALLEL,
- ECOM_GRID_100,
- ECOM_GRID_150,
- ECOM_GRID_PARTINSERT,
- ECOM_GRID_STATE_MAX
- }ECOM_GRID_STATE;
- typedef enum ECOM_Templerature_state
- {
- ECOM_TEM_STATE_TOO_LOW = 0,
- ECOM_TEM_STATE_LOW,
- ECOM_TEM_STAE_NORMAL,
- ECOM_TEM_STATE_HIGH,
- ECOM_TEM_STATE_TOO_HIGH
- }ECOM_TEMPERATURE_STATE;
- typedef enum ECOM_Battery_state
- {
- ECOM_BAT_STATE_TOO_LOW = 0,
- ECOM_BAT_STATE_LOW,
- ECOM_BAT_STAE_NORMAL,
- ECOM_BAT_STATE_GOOD,
- ECOM_BAT_STATE_FULL
- }ECOM_BATTERY_STATE;
- typedef enum ECOM_Wifi_state
- {
- ECOM_WIFI_STATE_TOO_LOW = 0,
- ECOM_WIFI_STATE_LOW,
- ECOM_WIFI_STAE_NORMAL,
- ECOM_WIFI_STATE_GOOD,
- ECOM_WIFI_STATE_FULL
- }ECOM_WIFI_STATE;
- typedef enum ECOM_Wifi_UNIT_TYPE
- {
- ECOM_WIFI_UNIT_PERCENTAGE= 0,
- ECOM_WIFI_UNIT_DBM
-
- }ECOM_WIFI_UNIT_TYPE;
- typedef enum ECOM_Battery_Charg_State
- {
- BATTERY_CHARG = 0,
- BATTERY_DISCHARG,
- BATTERY_CHARG_AND_DISCHARG
- }ECOM_BATTERY_CHARG_STATE;
- typedef struct _Xray_Cal_Attr_Struct
- {
- bool bExpired;
- bool bShowImage;
- bool bECOMCal;
- unsigned int nCalStatus;
- }Xray_Cal_Attr_Struct;
- typedef struct _Offset_Cal_Attr_Struct
- {
- bool bExpired;
- bool bShowImage;
- bool bECOMCal;
- unsigned int nCalStatus;
- unsigned int nOftType;
- }Offset_Cal_Attr_Struct;
- template<typename T> class AECInfo : public BaseJsonDataObject<T>
- {
- public:
- BaseJsonDataObject<int> m_AECDensity;
- BaseJsonDataObject<int> m_AECFiled;
- BaseJsonDataObject<int> m_AECFilm;
- BaseJsonDataObject<float> m_AECDose;
- AECInfo(void)
- {
- BaseJsonDataObject<T>::SetKey("AEC");
- m_AECDensity.SetKey("AECDensity");
- m_AECFiled.SetKey("AECFiled");
- m_AECFilm.SetKey("AECFilm");
- m_AECDose.SetKey("AECDose");
- }
- virtual ~AECInfo(void)
- {
- }
- virtual bool SetResDataObject(ResDataObject &obj)
- {
- bool ret = true;
- try {
- m_AECDensity = obj[m_AECDensity.GetKey()];
- m_AECFiled = obj[m_AECFiled.GetKey()];
- m_AECFilm = obj[m_AECFilm.GetKey()];
- m_AECDose = obj[m_AECDose.GetKey()];
- }
- catch (...)
- {
- ret = false;
- }
- return ret;
- };
- virtual void GetResDataObject(ResDataObject &obj)
- {
- //ResDataObject loca1;
- obj.add(m_AECDensity.GetKey(), m_AECDensity.GetVal());
- obj.add(m_AECFiled.GetKey(), m_AECFiled.GetVal());
- obj.add(m_AECFilm.GetKey(), m_AECFilm.GetVal());
- obj.add(m_AECDose.GetKey(), m_AECDose.GetVal());
- //obj.add(GetKey(), loca1);
- };
- virtual const char *GetVal()
- {
- ResDataObject obj;
- obj.add(m_AECDensity.GetKey(), m_AECDensity.GetVal());
- obj.add(m_AECFiled.GetKey(), m_AECFiled.GetVal());
- obj.add(m_AECFilm.GetKey(), m_AECFilm.GetVal());
- obj.add(m_AECDose.GetKey(), m_AECDose.GetVal());
- std::string m_ValString = obj.encode();
- return m_ValString.c_str();
- };
- virtual bool SetVal(const char* pValString)
- {
- ResDataObject obj;
- if (obj.decode(pValString))
- {
- int idx;
- idx = obj.GetFirstOf(m_AECDensity.GetKey());
- if (idx >= 0)
- {
- m_AECDensity.SetVal(obj[idx]);
- }
- idx = obj.GetFirstOf(m_AECFiled.GetKey());
- if (idx >= 0)
- {
- m_AECFiled.SetVal(obj[idx]);
- }
- idx = obj.GetFirstOf(m_AECFilm.GetKey());
- if (idx >= 0)
- {
- m_AECFilm.SetVal(obj[idx]);
- }
- idx = obj.GetFirstOf(m_AECDose.GetKey());
- if (idx >= 0)
- {
- m_AECDose.SetVal(obj[idx]);
- }
- return true;
- }
- return false;
- };
- };
- class APRStruct : public BaseJsonDataObject<BOOL>
- {
- public:
- /* "FOCUS": "0",
- "TECHMODE" : "0",
- "AECFIELD" : "0",
- "AECFILM" : "0",
- "AECDENSITY" : "0",
- "KV" : "70",
- "MA" : "160.0",
- "MS" : "100.0",
- "MAS" : "16.0",
- "DOSE" : "0.0",
- "FILTER" : "0",
- "TUBELOAD" : "80.0"*/
-
- BaseJsonDataObject<float> m_KV;
- BaseJsonDataObject<float> m_MA;
- BaseJsonDataObject<float> m_MS;
- BaseJsonDataObject<float> m_MAS;
- BaseJsonDataObject<int> m_FOCUS;
- BaseJsonDataObject<float> m_FOCUSSIZE;
- BaseJsonDataObject<int> m_TECHMODE;
- BaseJsonDataObject<int> m_AECFIELD;
- BaseJsonDataObject<int> m_AECFILM;
- BaseJsonDataObject<int> m_AECDENSITY;
- BaseJsonDataObject<float> m_TUBELOAD;
- BaseJsonDataObject<float> m_DOSE;
- BaseJsonDataObject<int> m_FILTER;
- BaseJsonDataObject<int> m_WORKSTATION;
- //AECInfo<int> m_AEC;
- APRStruct(void)
- {
- SetKey("APR");
- m_KV.SetKey("KV");
- m_MA.SetKey("MA");
- m_MS.SetKey("MS");
- m_MAS.SetKey("MAS");
- m_FOCUS.SetKey("FOCUS");
- m_FOCUSSIZE.SetKey("FOCUSSIZE");
- m_TECHMODE.SetKey("TECHMODE");
- m_AECFIELD.SetKey("AECFIELD");
- m_AECFILM.SetKey("AECFILM");
- m_AECDENSITY.SetKey("AECDENSITY");
- m_TUBELOAD.SetKey("TUBELOAD");
- m_DOSE.SetKey("DOSE");
- m_FILTER.SetKey("FILTER");
- m_WORKSTATION.SetKey("WORKSTATION");
- }
- virtual ~APRStruct(void)
- {
- }
- virtual bool SetResDataObjectfromUI(ResDataObject &obj)
- {
- bool ret = true;
- try {
- if (obj.GetFirstOf(m_KV.GetKey()) >= 0)
- {
- m_KV = (float)atof((const char *)obj[m_KV.GetKey()]);
- }
- if (obj.GetFirstOf(m_MA.GetKey()) >= 0)
- {
- m_MA = (float)atof((const char *)obj[m_MA.GetKey()]);
- }
- if (obj.GetFirstOf(m_MS.GetKey()) >= 0)
- {
- m_MS = (float)atof((const char *)obj[m_MS.GetKey()]);
- }
- if (obj.GetFirstOf(m_MAS.GetKey()) >= 0)
- {
- m_MAS = (float)atof((const char *)obj[m_MAS.GetKey()]);
- }
- if (obj.GetFirstOf(m_FOCUS.GetKey()) >= 0)
- {
- m_FOCUS = obj[m_FOCUS.GetKey()];
- }
- if (obj.GetFirstOf(m_TECHMODE.GetKey()) >= 0)
- {
- m_TECHMODE = obj[m_TECHMODE.GetKey()];
- }
- if (obj.GetFirstOf(m_AECFIELD.GetKey()) >= 0)
- {
- m_AECFIELD = obj[m_AECFIELD.GetKey()];
- }
- if (obj.GetFirstOf(m_AECFILM.GetKey()) >= 0)
- {
- m_AECFILM = obj[m_AECFILM.GetKey()];
- }
- if (obj.GetFirstOf(m_AECDENSITY.GetKey()) >= 0)
- {
- m_AECDENSITY = obj[m_AECDENSITY.GetKey()];
- }
- if (obj.GetFirstOf(m_TUBELOAD.GetKey()) >= 0)
- {
- m_TUBELOAD = (float)atof((const char *)obj[m_TUBELOAD.GetKey()]);
- }
- if (obj.GetFirstOf(m_DOSE.GetKey()) >= 0)
- {
- m_DOSE = (float)atof((const char *)obj[m_DOSE.GetKey()]);
- }
- if (obj.GetFirstOf(m_FILTER.GetKey()) >= 0)
- {
- m_FILTER = obj[m_FILTER.GetKey()];
- }
- if (obj.GetFirstOf(m_WORKSTATION.GetKey()) >= 0)
- {
- m_WORKSTATION = obj[m_WORKSTATION.GetKey()];
- }
- }
- catch (...)
- {
- ret = false;
- }
- return ret;
- };
- virtual bool SetResDataObject(ResDataObject &obj)
- {
- bool ret = true;
- try {
- if (obj.GetFirstOf(m_KV.GetKey()) >= 0)
- {
- m_KV = obj[m_KV.GetKey()];
- }
- if (obj.GetFirstOf(m_MA.GetKey()) >= 0)
- {
- m_MA = obj[m_MA.GetKey()];
- }
- if (obj.GetFirstOf(m_MS.GetKey()) >= 0)
- {
- m_MS = obj[m_MS.GetKey()];
- }
- if (obj.GetFirstOf(m_MAS.GetKey()) >= 0)
- {
- m_MAS = obj[m_MAS.GetKey()];
- }
- if (obj.GetFirstOf(m_FOCUS.GetKey()) >= 0)
- {
- m_FOCUS = obj[m_FOCUS.GetKey()];
- }
- if (obj.GetFirstOf(m_TECHMODE.GetKey()) >= 0)
- {
- m_TECHMODE = obj[m_TECHMODE.GetKey()];
- }
- if (obj.GetFirstOf(m_AECFIELD.GetKey()) >= 0)
- {
- m_AECFIELD = obj[m_AECFIELD.GetKey()];
- }
- if (obj.GetFirstOf(m_AECFILM.GetKey()) >= 0)
- {
- m_AECFILM = obj[m_AECFILM.GetKey()];
- }
- if (obj.GetFirstOf(m_AECDENSITY.GetKey()) >= 0)
- {
- m_AECDENSITY = obj[m_AECDENSITY.GetKey()];
- }
- if (obj.GetFirstOf(m_TUBELOAD.GetKey()) >= 0)
- {
- m_TUBELOAD = obj[m_TUBELOAD.GetKey()];
- }
- if (obj.GetFirstOf(m_DOSE.GetKey()) >= 0)
- {
- m_DOSE = obj[m_DOSE.GetKey()];
- }
- if (obj.GetFirstOf(m_FILTER.GetKey()) >= 0)
- {
- m_FILTER = obj[m_FILTER.GetKey()];
- }
- if (obj.GetFirstOf(m_WORKSTATION.GetKey()) >= 0)
- {
- m_WORKSTATION = obj[m_WORKSTATION.GetKey()];
- }
- }
- catch (...)
- {
- ret = false;
- }
- return ret;
- };
- virtual void GetResDataObject(ResDataObject &obj)
- {
- //ResDataObject loca1;
- //m_AEC.GetResDataObject(loca1);
- obj.add(m_KV.GetKey(), m_KV);
- obj.add(m_MA.GetKey(), m_MA);
- obj.add(m_MS.GetKey(), m_MS);
- obj.add(m_MAS.GetKey(), m_MAS);
- obj.add(m_FOCUS.GetKey(), m_FOCUS);
- obj.add(m_TECHMODE.GetKey(), m_TECHMODE);
- obj.add(m_FILTER.GetKey(), m_FILTER);
- obj.add(m_DOSE.GetKey(), m_DOSE);
- obj.add(m_AECDENSITY.GetKey(), m_AECDENSITY);
- obj.add(m_AECFILM.GetKey(), m_AECFILM);
- obj.add(m_AECFIELD.GetKey(), m_AECFIELD);
- obj.add(m_TUBELOAD.GetKey(), m_TUBELOAD);
- obj.add(m_WORKSTATION.GetKey(), m_WORKSTATION);
- //obj.add(m_AEC.GetKey(), loca1);
- //obj.add(GetKey(), loca1);
- };
- virtual const char *GetVal()
- {
- ResDataObject obj;
- obj.add(m_KV.GetKey(), m_KV.GetVal());
- obj.add(m_MA.GetKey(), m_MA.GetVal());
- obj.add(m_MS.GetKey(), m_MS.GetVal());
- obj.add(m_MAS.GetKey(), m_MAS.GetVal());
- obj.add(m_FOCUS.GetKey(), m_FOCUS.GetVal());
- obj.add(m_TECHMODE.GetKey(), m_TECHMODE.GetVal());
- obj.add(m_FILTER.GetKey(), m_FILTER.GetVal());
- obj.add(m_DOSE.GetKey(), m_DOSE.GetVal());
- //obj.add(m_AEC.GetKey(), m_AEC.GetVal());
- std::string m_ValString = obj.encode();
- return m_ValString.c_str();
- };
- virtual bool SetVal(const char* pValString)
- {
- ResDataObject obj;
- if (obj.decode(pValString))
- {
- int idx;
- idx = obj.GetFirstOf(m_KV.GetKey());
- if (idx >= 0)
- {
- m_KV.SetVal(obj[idx]);
- }
- idx = obj.GetFirstOf(m_MA.GetKey());
- if (idx >= 0)
- {
- m_MA.SetVal(obj[idx]);
- }
- idx = obj.GetFirstOf(m_MS.GetKey());
- if (idx >= 0)
- {
- m_MS.SetVal(obj[idx]);
- }
- idx = obj.GetFirstOf(m_MAS.GetKey());
- if (idx >= 0)
- {
- m_MAS.SetVal(obj[idx]);
- }
- idx = obj.GetFirstOf(m_FOCUS.GetKey());
- if (idx >= 0)
- {
- m_FOCUS.SetVal(obj[idx]);
- }
- idx = obj.GetFirstOf(m_TECHMODE.GetKey());
- if (idx >= 0)
- {
- m_TECHMODE.SetVal(obj[idx]);
- }
- idx = obj.GetFirstOf(m_FILTER.GetKey());
- if (idx >= 0)
- {
- m_FILTER.SetVal(obj[idx]);
- }
- idx = obj.GetFirstOf(m_DOSE.GetKey());
- if (idx >= 0)
- {
- m_DOSE.SetVal(obj[idx]);
- }
- //idx = obj.GetFirstOf(m_AEC.GetKey());
- //if (idx >= 0)
- //{
- // m_AEC.SetVal(obj[idx]);
- //}
- return true;
- }
- return false;
- }
- //virtual void SetKey(const char* pKeyString)
- //{
- // SetKey(pKeyString);
- // //return true;
- //};
- };
- template<typename T> class FrameData : public BaseJsonDataObject<T>
- {
- public:
- BaseJsonDataObject<string> m_FrameID;
- APRStruct m_ExpData;
- FrameData(void)
- {
- BaseJsonDataObject<T>::SetKey("FrameData");
- m_FrameID.SetKey("FramID");
- m_ExpData.SetKey("EXPData");
- }
- virtual ~FrameData(void)
- {
- }
- virtual const char *GetVal()
- {
- ResDataObject obj;
- obj.add(m_FrameID.GetKey(), m_FrameID.GetVal());
- obj.add(m_ExpData.GetKey(), m_ExpData.GetVal());
- std::string m_ValString = obj.encode();
- return m_ValString.c_str();
- };
- virtual bool SetVal(const char* pValString)
- {
- ResDataObject obj;
- if (obj.decode(pValString))
- {
- int idx;
- idx = obj.GetFirstOf(m_FrameID.GetKey());
- if (idx >= 0)
- {
- m_FrameID.SetVal(obj[idx]);
- }
- idx = obj.GetFirstOf(m_ExpData.GetKey());
- if (idx >= 0)
- {
- m_ExpData.SetVal(obj[idx]);
- }
- return true;
- }
- return false;
- }
- };
- template<typename T> class ExamDatalist : public BaseJsonDataObject<T>
- {
- public:
- vector<FrameData<T>>m_ExamDatalist;
- FrameData<T> temp;
- ExamDatalist(void)
- {
- BaseJsonDataObject<T>::SetKey("FrameData");
- }
- virtual ~ExamDatalist(void)
- {
- }
- virtual const char *GetVal()
- {
- ResDataObject obj;
- for (size_t i = 0; i<m_ExamDatalist.size(); i++)
- {
- obj.add(m_ExamDatalist[i].GetKey(), m_ExamDatalist[i].GetVal());
- }
- std::string m_ValString = obj.encode();
- return m_ValString.c_str();
- };
- void AddVal(string pValString)
- {
- temp.SetVal(pValString.c_str());
- m_ExamDatalist.push_back(temp);
- }
- int DelVal(string pValString)
- {
- ResDataObject obj;
- if (obj.decode(pValString.c_str()))
- {
- int idx;
- for (int i = 0; i<m_ExamDatalist.size(); i++)
- {
- idx = obj.GetFirstOf(m_ExamDatalist[i].m_FrameID.GetKey());
- if (idx >= 0)
- {
- if (m_ExamDatalist[i].m_FrameID.GetVal() == obj[idx])
- {
- m_ExamDatalist.erase(i);
- return true;
- }
- }
- }
- }
- return false;
- }
- int Find(const char * pValString)
- {
- ResDataObject obj;
- int index;
- if (obj.decode(pValString))
- {
- int idx;
- for (int i = 0; i<m_ExamDatalist.size(); i++)
- {
- idx = obj.GetFirstOf(m_ExamDatalist[i].m_FrameID.GetKey());
- if (idx >= 0)
- {
- if (m_ExamDatalist[i].m_FrameID.GetVal() == obj[idx])
- {
- index = i;
- return index;
- }
- }
- }
- }
- return false;
- }
- };
- template<typename T> class EXAMInfo : public BaseJsonDataObject<T>
- {
- public:
- BaseJsonDataObject<int> m_ExamMode;
- BaseJsonDataObject<int> m_WorkStation;
- BaseJsonDataObject<int> m_FrameID;
- EXAMInfo(void)
- {
- BaseJsonDataObject<T>::SetKey("EXAMInfo");
- m_ExamMode.SetKey("ExamMode");
- m_WorkStation.SetKey("WorkStation");
- m_FrameID.SetKey("FrameID");
- }
- virtual ~EXAMInfo(void)
- {
- }
- virtual bool SetResDataObject(ResDataObject &obj)
- {
- bool ret = true;
- try {
- m_ExamMode = obj[m_ExamMode.GetKey()];
- m_WorkStation = obj[m_WorkStation.GetKey()];
- m_FrameID = obj[m_FrameID.GetKey()];
- }
- catch (...)
- {
- ret = false;
- }
- return ret;
- };
- virtual void GetResDataObject(ResDataObject &obj)
- {
- obj.add(m_ExamMode.GetKey(), m_ExamMode);
- obj.add(m_WorkStation.GetKey(), m_WorkStation);
- obj.add(m_FrameID.GetKey(), m_FrameID);
- };
- virtual const char *GetVal()
- {
- ResDataObject obj;
- obj.add(m_ExamMode.GetKey(), m_ExamMode.GetVal());
- obj.add(m_WorkStation.GetKey(), m_WorkStation.GetVal());
- obj.add(m_FrameID.GetKey(), m_FrameID.GetVal());
-
- std::string m_ValString = obj.encode();
- return m_ValString.c_str();
- };
- virtual bool SetVal(const char* pValString)
- {
- ResDataObject obj;
- if (obj.decode(pValString))
- {
- int idx;
- idx = obj.GetFirstOf(m_ExamMode.GetKey());
- if (idx >= 0)
- {
- m_ExamMode.SetVal(obj[idx]);
- }
- idx = obj.GetFirstOf(m_WorkStation.GetKey());
- if (idx >= 0)
- {
- m_WorkStation.SetVal(obj[idx]);
- }
- idx = obj.GetFirstOf(m_FrameID.GetKey());
- if (idx >= 0)
- {
- m_FrameID.SetVal(obj[idx]);
- }
- return true;
- }
- return false;
- };
- };
- class ImgInfoDef : public BaseJsonDataObject<bool>
- {
- public:
- BaseJsonDataObject<unsigned int> nWidth;//宽度
- BaseJsonDataObject<unsigned int> nHeight;//高度
- BaseJsonDataObject<unsigned int> nBit;//位数
- ImgInfoDef()
- {
- SetKey("ImgInfo");
- nWidth.SetKey("Width");
- nHeight.SetKey("Height");
- nBit.SetKey("Bit");
- }
- virtual ~ImgInfoDef(void)
- {
- }
- virtual void GetResDataObject(ResDataObject &obj)
- {
- obj.clear();
- obj.add(nWidth.GetKey(), nWidth.GetVal());
- obj.add(nHeight.GetKey(), nHeight.GetVal());
- obj.add(nBit.GetKey(), nBit.GetVal());
- //obj.add(GetKey(), loca1);
- };
- virtual bool SetResDataObject(ResDataObject &obj)
- {
- bool ret = true;
- try {
- nBit = obj[nBit.GetKey()];
- nHeight = obj[nHeight.GetKey()];
- nWidth = obj[nWidth.GetKey()];
- }
- catch (...)
- {
- ret = false;
- }
- return ret;
- };
- virtual const char *GetVal()
- {
- ResDataObject obj;
- obj.add(nWidth.GetKey(), nWidth.GetVal());
- obj.add(nHeight.GetKey(), nHeight.GetVal());
- obj.add(nBit.GetKey(), nBit.GetVal());
- std::string m_ValString = obj.encode();
- return m_ValString.c_str();
- };
- virtual bool SetVal(const char* pValString)
- {
- ResDataObject obj;
- if (obj.decode(pValString))
- {
- int idx;
- idx = obj.GetFirstOf(nWidth.GetKey());
- if (idx >= 0)
- {
- nWidth.SetVal(obj[idx]);
- }
- idx = obj.GetFirstOf(nHeight.GetKey());
- if (idx >= 0)
- {
- nHeight.SetVal(obj[idx]);
- }
- idx = obj.GetFirstOf(nBit.GetKey());
- if (idx >= 0)
- {
- nBit.SetVal(obj[idx]);
- }
- return true;
- }
- return false;
- };
- virtual void SetKey(const char* pKeyString)
- {
- std::string temp = pKeyString;
- std::string keystring;
- BaseJsonDataObject<bool>::SetKey(pKeyString);
- //make key
- keystring = "Width";
- nWidth.SetKey(keystring.c_str());
- keystring = "Height";
- nHeight.SetKey(keystring.c_str());
- keystring = "Bit";
- nBit.SetKey(keystring.c_str());
- };
- };
- class ImgDataInfo : public BaseJsonDataObject<bool>
- {
- public:
- BaseJsonDataObject<unsigned int> nImageType;
- BaseJsonDataObject<unsigned int> nViewType;
- BaseJsonDataObject<unsigned long long> nShareMemID;
- BaseJsonDataObject<unsigned long long> nImageID;
- BaseJsonDataObject<unsigned int> nWidth;
- BaseJsonDataObject<unsigned int> nHeight;
- BaseJsonDataObject<unsigned int> nBit;
- ImgDataInfo(void)
- {
- const char* keystring = "ImageType";
- nImageType.SetKey(keystring);
- keystring = "Viewtype";
- nViewType.SetKey(keystring);
- keystring = "Sharememid";
- nShareMemID.SetKey(keystring);
- keystring = "Imageid";
- nImageID.SetKey(keystring);
- keystring = "Width";
- nWidth.SetKey(keystring);
- keystring = "Height";
- nHeight.SetKey(keystring);
- keystring = "Bit";
- nBit.SetKey(keystring);
- }
- virtual ~ImgDataInfo(void)
- {
- }
- virtual void GetResDataObject(ResDataObject &obj)
- {
- //ResDataObject loca1;
- obj.add(nImageType.GetKey(), nImageType.GetVal());
- obj.add(nViewType.GetKey(), nViewType.GetVal());
- obj.add(nShareMemID.GetKey(), nShareMemID.GetVal());
- obj.add(nImageID.GetKey(), nImageID.GetVal());
- obj.add(nWidth.GetKey(), nWidth.GetVal());
- obj.add(nHeight.GetKey(), nHeight.GetVal());
- obj.add(nBit.GetKey(), nBit.GetVal());
- //obj.add(GetKey(), loca1);
- };
- virtual bool SetResDataObject(ResDataObject &obj)
- {
- bool ret = true;
- try {
- nImageType = obj[nImageType.GetKey()];
- nViewType = obj[nViewType.GetKey()];
- nShareMemID = obj[nShareMemID.GetKey()];
- nImageID = obj[nImageID.GetKey()];
- nWidth = obj[nWidth.GetKey()];
- nHeight = obj[nHeight.GetKey()];
- nBit = obj[nBit.GetKey()];
- }
- catch (...)
- {
- ret = false;
- }
- return ret;
- };
- virtual const char *GetVal()
- {
- ResDataObject obj;
- obj.add(nImageType.GetKey(), nImageType.GetVal());
- obj.add(nViewType.GetKey(), nViewType.GetVal());
- obj.add(nShareMemID.GetKey(), nShareMemID.GetVal());
- obj.add(nImageID.GetKey(), nImageID.GetVal());
- obj.add(nWidth.GetKey(), nWidth.GetVal());
- obj.add(nHeight.GetKey(), nHeight.GetVal());
- obj.add(nBit.GetKey(), nBit.GetVal());
- std::string m_ValString = obj.encode();
- return m_ValString.c_str();
- };
- virtual bool SetVal(const char* pValString)
- {
- ResDataObject obj;
- if (obj.decode(pValString))
- {
- int idx;
- idx = obj.GetFirstOf(nImageType.GetKey());
- if (idx >= 0)
- {
- nImageType.SetVal(obj[idx]);
- }
- idx = obj.GetFirstOf(nViewType.GetKey());
- if (idx >= 0)
- {
- nViewType.SetVal(obj[idx]);
- }
- idx = obj.GetFirstOf(nShareMemID.GetKey());
- if (idx >= 0)
- {
- nShareMemID.SetVal(obj[idx]);
- }
- idx = obj.GetFirstOf(nImageID.GetKey());
- if (idx >= 0)
- {
- nImageID.SetVal(obj[idx]);
- }
- idx = obj.GetFirstOf(nWidth.GetKey());
- if (idx >= 0)
- {
- nWidth.SetVal(obj[idx]);
- }
- idx = obj.GetFirstOf(nHeight.GetKey());
- if (idx >= 0)
- {
- nHeight.SetVal(obj[idx]);
- }
- idx = obj.GetFirstOf(nBit.GetKey());
- if (idx >= 0)
- {
- nBit.SetVal(obj[idx]);
- }
- return true;
- }
- return false;
- };
- virtual void SetKey(const char* pKeyString)
- {
- BaseJsonDataObject<bool>::SetKey(pKeyString);
- //make key
- const char* keystring = "ImageType";
- nImageType.SetKey(keystring);
- keystring = "Viewtype";
- nViewType.SetKey(keystring);
- keystring = "Sharememid";
- nShareMemID.SetKey(keystring);
- keystring = "Imageid";
- nImageID.SetKey(keystring);
- keystring = "Width";
- nWidth.SetKey(keystring);
- keystring = "Height";
- nHeight.SetKey(keystring);
- keystring = "Bit";
- nBit.SetKey(keystring);
- };
- };
- class XRAY_CAL_ATTR : public BaseJsonDataObject<bool>
- {
- public:
- BaseJsonDataObject<bool> bExpired;
- BaseJsonDataObject<bool> bShowImage;
- BaseJsonDataObject<bool> bECOMCal;
- BaseJsonDataObject<unsigned int> nCalStatus;
- XRAY_CAL_ATTR(void)
- {
- const char* keystring = "Expire";
- bExpired.SetKey(keystring);
- bShowImage = "ShowImage";
- bShowImage.SetKey(keystring);
- keystring = "ECOMCal";
- bECOMCal.SetKey(keystring);
- keystring = "CalStatus";
- nCalStatus.SetKey(keystring);
- bExpired = false;
- bShowImage = false;
- bECOMCal = false;
- nCalStatus = CAL_TYPE_NONE;
- }
- virtual ~XRAY_CAL_ATTR(void)
- {
- }
- virtual void GetResDataObject(ResDataObject &obj)
- {
- //ResDataObject loca1;
- obj.add(bExpired.GetKey(), bExpired.GetVal());
- obj.add(bShowImage.GetKey(), bShowImage.GetVal());
- obj.add(bECOMCal.GetKey(), bECOMCal.GetVal());
- obj.add(nCalStatus.GetKey(), nCalStatus.GetVal());
- //obj.add(GetKey(), loca1);
- };
- virtual bool SetResDataObject(ResDataObject &obj)
- {
- bool ret = true;
- try {
- bExpired = obj[bExpired.GetKey()];
- bShowImage = obj[bShowImage.GetKey()];
- bECOMCal = obj[bECOMCal.GetKey()];
- nCalStatus = obj[nCalStatus.GetKey()];
- }
- catch (...)
- {
- ret = false;
- }
- return ret;
- };
- virtual const char *GetVal()
- {
- ResDataObject obj;
- obj.add(bExpired.GetKey(), bExpired.GetVal());
- obj.add(bShowImage.GetKey(), bShowImage.GetVal());
- obj.add(bECOMCal.GetKey(), bECOMCal.GetVal());
- obj.add(nCalStatus.GetKey(), nCalStatus.GetVal());
- std::string m_ValString = obj.encode();
- return m_ValString.c_str();
- };
- virtual bool SetVal(const char* pValString)
- {
- ResDataObject obj;
- if (obj.decode(pValString))
- {
- int idx;
- idx = obj.GetFirstOf(bExpired.GetKey());
- if (idx >= 0)
- {
- bExpired.SetVal(obj[idx]);
- }
- idx = obj.GetFirstOf(bShowImage.GetKey());
- if (idx >= 0)
- {
- bShowImage.SetVal(obj[idx]);
- }
- idx = obj.GetFirstOf(bECOMCal.GetKey());
- if (idx >= 0)
- {
- bECOMCal.SetVal(obj[idx]);
- }
- idx = obj.GetFirstOf(nCalStatus.GetKey());
- if (idx >= 0)
- {
- nCalStatus.SetVal(obj[idx]);
- }
- return true;
- }
- return false;
- };
- virtual void SetKey(const char* pKeyString)
- {
- BaseJsonDataObject<bool>::SetKey(pKeyString);
- //make key
- const char* keystring = "Expired";
- bExpired.SetKey(keystring);
- keystring = "ShowImage";
- bShowImage.SetKey(keystring);
- keystring = "ECOMCal";
- bECOMCal.SetKey(keystring);
- keystring = "CalStatus";
- nCalStatus.SetKey(keystring);
- };
- };
- class OFFSETT_CAL_ATTR : public BaseJsonDataObject<bool>
- {
- public:
- BaseJsonDataObject<bool> bExpired;
- BaseJsonDataObject<bool> bShowImage;
- BaseJsonDataObject<bool> bECOMCal;
- BaseJsonDataObject<unsigned int> nCalStatus;
- BaseJsonDataObject<unsigned int> nOftType;
- OFFSETT_CAL_ATTR(void)
- {
- const char* keystring = "Expire";
- bExpired.SetKey(keystring);
- bShowImage = "ShowImage";
- bShowImage.SetKey(keystring);
- keystring = "ECOMCal";
- bECOMCal.SetKey(keystring);
- keystring = "CalStatus";
- nCalStatus.SetKey(keystring);
- keystring = "OftType";
- nOftType.SetKey(keystring);
- bExpired = false;
- bShowImage = false;
- bECOMCal = false;
- nCalStatus = CAL_TYPE_NONE;
- nOftType = OFT_NONE;
- }
- virtual ~OFFSETT_CAL_ATTR(void)
- {
- }
- virtual void GetResDataObject(ResDataObject &obj)
- {
- //ResDataObject loca1;
- obj.add(bExpired.GetKey(), bExpired.GetVal());
- obj.add(bShowImage.GetKey(), bShowImage.GetVal());
- obj.add(bECOMCal.GetKey(), bECOMCal.GetVal());
- obj.add(nCalStatus.GetKey(), nCalStatus.GetVal());
- obj.add(nOftType.GetKey(), nOftType.GetVal());
- //obj.add(GetKey(), loca1);
- };
- virtual bool SetResDataObject(ResDataObject &obj)
- {
- bool ret = true;
- try {
- bExpired = obj[bExpired.GetKey()];
- bShowImage = obj[bShowImage.GetKey()];
- bECOMCal = obj[bECOMCal.GetKey()];
- nCalStatus = obj[nCalStatus.GetKey()];
- nOftType = obj[nOftType.GetKey()];
- }
- catch (...)
- {
- ret = false;
- }
- return ret;
- };
- virtual const char *GetVal()
- {
- ResDataObject obj;
- obj.add(bExpired.GetKey(), bExpired.GetVal());
- obj.add(bShowImage.GetKey(), bShowImage.GetVal());
- obj.add(bECOMCal.GetKey(), bECOMCal.GetVal());
- obj.add(nCalStatus.GetKey(), nCalStatus.GetVal());
- obj.add(nOftType.GetKey(), nOftType.GetVal());
- std::string m_ValString = obj.encode();
- return m_ValString.c_str();
- };
- virtual bool SetVal(const char* pValString)
- {
- ResDataObject obj;
- if (obj.decode(pValString))
- {
- int idx;
- idx = obj.GetFirstOf(bExpired.GetKey());
- if (idx >= 0)
- {
- bExpired.SetVal(obj[idx]);
- }
- idx = obj.GetFirstOf(bShowImage.GetKey());
- if (idx >= 0)
- {
- bShowImage.SetVal(obj[idx]);
- }
- idx = obj.GetFirstOf(bECOMCal.GetKey());
- if (idx >= 0)
- {
- bECOMCal.SetVal(obj[idx]);
- }
- idx = obj.GetFirstOf(nCalStatus.GetKey());
- if (idx >= 0)
- {
- nCalStatus.SetVal(obj[idx]);
- }
- idx = obj.GetFirstOf(nOftType.GetKey());
- if (idx >= 0)
- {
- nOftType.SetVal(obj[idx]);
- }
- return true;
- }
- return false;
- };
- virtual void SetKey(const char* pKeyString)
- {
- BaseJsonDataObject<bool>::SetKey(pKeyString);
- //make key
- const char* keystring = "Expired";
- bExpired.SetKey(keystring);
- keystring = "ShowImage";
- bShowImage.SetKey(keystring);
- keystring = "ECOMCal";
- bECOMCal.SetKey(keystring);
- keystring = "CalStatus";
- nCalStatus.SetKey(keystring);
- keystring = "OftType";
- nOftType.SetKey(keystring);
- };
- };
- //class MESSAGE_ERROR : public BaseJsonDataObject<bool>
- //{
- //public:
- // BaseJsonDataObject<int> nCode;
- // BaseJsonDataObject<string> strName;
- // BaseJsonDataObject<string> strDescription;
- // BaseJsonDataObject<string> strSolution;
- // BaseJsonDataObject<int> nNotifyType;
- // BaseJsonDataObject<string> strInterlock;
- // BaseJsonDataObject<string> strBackCommand;
- // MESSAGE_ERROR(void)
- // {
- // const char* keystring = "Code";
- // nCode.SetKey(keystring);
- // keystring = "Name";
- // strName.SetKey(keystring);
- // keystring = "Description";
- // strDescription.SetKey(keystring);
- // keystring = "Solution";
- // strSolution.SetKey(keystring);
- // keystring = "NotifyType";
- // nNotifyType.SetKey(keystring);
- // keystring = "Interlock";
- // strInterlock.SetKey(keystring);
- // keystring = "BackCommand";
- // strBackCommand.SetKey(keystring);
- // nCode = 0;
- // strName = "";
- // strDescription = "";
- // strSolution = "";
- // nNotifyType = 0;
- // strInterlock = "";
- // strBackCommand = "";
- // }
- // virtual ~MESSAGE_ERROR(void)
- // {
- // }
- // virtual void GetResDataObject(ResDataObject &obj)
- // {
- // //ResDataObject loca1;
- // obj.add(nCode.GetKey(), nCode.GetVal());
- // obj.add(strName.GetKey(), strName.GetVal());
- // obj.add(strDescription.GetKey(), strDescription.GetVal());
- // obj.add(strSolution.GetKey(), strSolution.GetVal());
- // obj.add(nNotifyType.GetKey(), nNotifyType.GetVal());
- // obj.add(strInterlock.GetKey(), strInterlock.GetVal());
- // obj.add(strBackCommand.GetKey(), strBackCommand.GetVal());
- // };
- // virtual bool SetResDataObject(ResDataObject &obj)
- // {
- // bool ret = true;
- // try {
- // nCode = obj[nCode.GetKey()];
- // strName = (const char *)obj[strName.GetKey()];
- // strDescription = (const char *)obj[strDescription.GetKey()];
- // strSolution = (const char *)obj[strSolution.GetKey()];
- // nNotifyType = obj[nNotifyType.GetKey()];
- // strInterlock = (const char *)obj[strInterlock.GetKey()];
- // strBackCommand = (const char *)obj[strBackCommand.GetKey()];
- // }
- // catch (...)
- // {
- // ret = false;
- // }
- // return ret;
- // };
- // virtual const char *GetVal()
- // {
- // ResDataObject obj;
- // obj.add(nCode.GetKey(), nCode.GetVal());
- // obj.add(strName.GetKey(), strName.GetVal());
- // obj.add(strDescription.GetKey(), strDescription.GetVal());
- // obj.add(strSolution.GetKey(), strSolution.GetVal());
- // obj.add(nNotifyType.GetKey(), nNotifyType.GetVal());
- // obj.add(strInterlock.GetKey(), strInterlock.GetVal());
- // obj.add(strBackCommand.GetKey(), strBackCommand.GetVal());
- // std::string m_ValString = obj.encode();
- // return m_ValString.c_str();
- // };
- // virtual bool SetVal(const char* pValString)
- // {
- // ResDataObject obj;
- // if (obj.decode(pValString))
- // {
- // int idx;
- // idx = obj.GetFirstOf(nCode.GetKey());
- // if (idx >= 0)
- // {
- // nCode.SetVal(obj[idx]);
- // }
- // idx = obj.GetFirstOf(strName.GetKey());
- // if (idx >= 0)
- // {
- // strName.SetVal(obj[idx]);
- // }
- // idx = obj.GetFirstOf(strDescription.GetKey());
- // if (idx >= 0)
- // {
- // strDescription.SetVal(obj[idx]);
- // }
- // idx = obj.GetFirstOf(strSolution.GetKey());
- // if (idx >= 0)
- // {
- // strSolution.SetVal(obj[idx]);
- // }
- // idx = obj.GetFirstOf(nNotifyType.GetKey());
- // if (idx >= 0)
- // {
- // nNotifyType.SetVal(obj[idx]);
- // }
- // idx = obj.GetFirstOf(strInterlock.GetKey());
- // if (idx >= 0)
- // {
- // strInterlock.SetVal(obj[idx]);
- // }
- // idx = obj.GetFirstOf(strBackCommand.GetKey());
- // if (idx >= 0)
- // {
- // strBackCommand.SetVal(obj[idx]);
- // }
- // return true;
- // }
- // return false;
- // };
- // virtual void SetKey(const char* pKeyString)
- // {
- // BaseJsonDataObject<bool>::SetKey(pKeyString);
- // //make key
- // const char* keystring = "Code";
- // nCode.SetKey(keystring);
- // keystring = "Name";
- // strName.SetKey(keystring);
- // keystring = "Description";
- // strDescription.SetKey(keystring);
- // keystring = "Solution";
- // strSolution.SetKey(keystring);
- // keystring = "NotifyType";
- // nNotifyType.SetKey(keystring);
- // keystring = "Interlock";
- // strInterlock.SetKey(keystring);
- // keystring = "BackCommand";
- // strBackCommand.SetKey(keystring);
- // };
- //};
|