123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669 |
- #include "stdafx.h"
- #include <map>
- #include "All.h"
- #include "MACHINE_DPC.h"
- #include "MACHINE_Logical.h"
- #include "MACHINE_MammoLogic.h"
- #include "MACHINE_StitchLogic.h"
- #include "PacketAnalizer.h"
- #include "common_api.h"
- #ifdef CMD_ANSYNC
- #include "RingBuffer.h"
- #endif
- #define MACHINERY_TID "DetectorToTableDistance"
- #define MACHINERY_SID "DistanceSourcetoDetector"
- #define MACHINERY_ENTRANCE "DistanceSourcetoEntrance"
- #define MACHINERY_GEOMETRY "GeometryKeyword"
- #define MACHINERY_PROJECTIONNUM "ProjectionNum"
- #define MACHINERY_MAXANGLE "ProjectionMaxAngle"
- #define MACHINERY_DIRECTION "ProjectionDirection"
- int FormatCMD(char * pCmd, int nSize)
- {
- pCmd[nSize] = 0x0d;
- nSize++;
- pCmd[nSize] = 0x0a;
- nSize++;
- pCmd[nSize] = 0;
- return nSize;
- }
- /////////////////////////////////////////////////////////////////////////
- /////////////////////////////////////////////////////////////////////////
- #define FUNNAME_CREATE_SCF TEXT("GetSCF")
- #define FUNNAME_RELEASE_SCF TEXT("ReleseSCF")
- #define OFFSET_CLASSNAME_DOSE 14
- #define OFFSET_CLASSNAME_DOSE_SP 22
- #define OFFSET_CLASSNAME_LOGIC 17
- #define OFFSET_CLASSNAME_LOGIC_SP 25
- #define CMD_LEN_MAX 128
- #define TIMEOUTVALUE 1000
- CMACHINE_DPC::CMACHINE_DPC()
- {
- m_pWorkpath = new std::string();
- m_pNotify = NULL;
- m_hConnectFinish = CreateEvent(NULL, true, false, NULL);
- m_hBeginConnect = CreateEvent(NULL, true, false, NULL);
- m_hConnection = CreateEvent(NULL, true, false, NULL);
- m_hMechReady = CreateEvent(NULL, false, false, NULL);
- m_hMechGetPostionFinished = CreateEvent(NULL, false, false, NULL);
- m_DetectorToTableDistance.add(MACHINERY_TID, (FLOAT)0.0);
- m_DistanceSourcetoDetector.add(MACHINERY_SID, (FLOAT)1.0);
- m_DistanceSourcetoEntrance.add(MACHINERY_ENTRANCE, (FLOAT)15.0);
- m_GEOMETRY.add(MACHINERY_GEOMETRY, "liner");
- m_ProjectionNum.add(MACHINERY_PROJECTIONNUM, (INT)15);
- m_ProjectionMaxAngle.add(MACHINERY_MAXANGLE, (FLOAT)15.0);
- m_ProjectionDirection.add(MACHINERY_DIRECTION, (INT)-1);
- m_pGenVender = new ConfigInfo("Vender");
- m_pGenModel = new ConfigInfo("Model");
- m_pGenSyncType = new ConfigInfo(DiosSyncType);
- m_pGenSCFType = new ConfigInfo(DiosSCFType);
- m_pGenSCFPort = new ConfigInfo(DiosSCFPort);
- m_pTID = new ConfigInfo(MACHINERY_TID);
- m_pSID = new ConfigInfo(MACHINERY_SID);
- m_pENTRANCE = new ConfigInfo(MACHINERY_ENTRANCE);
- m_pGEOMETRY = new ConfigInfo(MACHINERY_GEOMETRY);
- }
- CMACHINE_DPC::~CMACHINE_DPC()
- {
- delete m_pWorkpath;
- delete m_pGenVender;
- delete m_pGenModel;
- delete m_pGenSyncType;
- delete m_pGenSCFType;
- delete m_pGenSCFPort;
- delete m_pTID;
- delete m_pSID;
- delete m_pENTRANCE;
- delete m_pGEOMETRY;
- }
- //bool CMACHINE_DPC::DpcEntry(ResDataObject &Configuration)
- //{
- // try
- // {
- // m_DeviceConfig = Configuration;
- // }
- // catch (...)
- // {
- // PRINTA_INFO(m_pLog, "Can't get the Configuration for Device");
- // }
- // PRINTA_INFO(m_pLog, "DpcEntry Configuration");
- //
- // return true;
- //}
- //
- //ResDataObject CMACHINE_DPC::GetConnectionType()
- //{
- // return ResDataObject();
- //}
- //
- //bool CMACHINE_DPC::Connect(ResDataObject &Connection)
- //{
- // m_pSCFServer = m_fpGetSCF();
- //
- // int Result = m_pSCFServer->Connect(Connection, &CMACHINE_DPC::PackageProcess, SCF_PACKET_TRANSFER);
- // if (Result != SCF_SUCCEED)
- // {
- // return false;
- // }
- //
- // return true;
- //}
- //
- //bool CMACHINE_DPC::Probe(ResDataObject &HardwareInfo)
- //{
- //#ifdef ENV_DIOS
- // HardwareInfo.add("MajorID", "Generator");
- // HardwareInfo.add("MinorID", "DR");
- // HardwareInfo.add("VendorID", "CPI");
- // HardwareInfo.add("ProductID", "SHF");
- // HardwareInfo.add("SerialID", "1234");
- //#endif
- // return true;
- //}
- //
- //bool CMACHINE_DPC::SetWorkPath(const char *pWorkPath)
- //{
- // m_strWorkPath = pWorkPath;
- // return true;
- //}
- //
- //PVOID CMACHINE_DPC::LoadLogicDevices()
- //{
- // DevTree *pTree = new DevTree();
- // LogicDevice * pLD = NULL;
- //
- // //Load DOSE Logic unit
- // m_pGenDose = new CMACHINE_Dose();
- // m_pGenDose->DPCPoint(this);
- // pLD = (LogicDevice *)m_pGenDose;
- // pTree->Add((PVOID)pLD, TYPE_DEVICE);
- //
- // //Load SyncGen
- // m_pGenLogical = new CMACHINE_Logical();
- // m_pGenLogical->DPCPoint(this);
- // pLD = (LogicDevice *)m_pGenLogical;
- // pTree->Add((PVOID)pLD, TYPE_DEVICE);
- //
- //#if 0
- // try{
- // m_pGenDose->m_DeviceConfig.nTable = (int)(m_DeviceConfig["Table"]);
- // m_pGenDose->m_DeviceConfig.nWall = (int)(m_DeviceConfig["Wall"]);
- // m_pGenDose->m_DeviceConfig.nFree = (int)(m_DeviceConfig["Free"]);
- // m_pGenDose->m_DeviceConfig.nTomo = (int)(m_DeviceConfig["Tomo"]);
- // m_pGenDose->m_DeviceConfig.nConventional = (int)(m_DeviceConfig["Conventional"]);
- // }
- // catch (...)
- // {
- // printf("Get Gen config item Crash.\n");
- // }
- //#endif
- // return (PVOID)pTree;
- //}
- //
- //void CMACHINE_DPC::UnloadLogicDevices(/*LogicDevice*/PVOID p)
- //{
- //#ifdef ENV_DIOS
- // DevTree *pTree = (DevTree*)p;
- // size_t Size = pTree->size();
- // for (size_t i = 0; i < Size; i++)
- // {
- // DevTreeNode node = (*pTree)[i];
- // if (node.m_NodeType == TYPE_DEVICE)
- // {
- // LogicDevice *pdev = (LogicDevice*)node.m_pObject;
- // delete pdev;
- // }
- // else
- // {
- // //tree dev
- // //do not copy this!!!!
- // UnloadLogicDevices(node.m_pObject);
- // }
- // }
- //
- // delete pTree;
- //#endif
- //}
- //
- //bool CMACHINE_DPC::DisConnect()
- //{
- // m_pSCFServer->Disconnect();
- // m_fpReleaseSCF(m_pSCFServer);
- // return true;
- //}
- //
- //bool CMACHINE_DPC::OnNotify(HANDLE ExitNotify)
- //{
- // Work();
- // return true;
- //}
- bool CMACHINE_DPC::DriverEntry(ResDataObject &Configuration)
- {
- try
- {
- m_DeviceConfig = Configuration;
- }
- catch (...)
- {
- PRINTA_INFO(m_pLog, "Can't get the Configuration for Device");
- }
- PRINTA_INFO(m_pLog, "DpcEntry Configuration");
- return LogicDriver::DriverEntry(Configuration);
- }
- bool CMACHINE_DPC::Driver_Probe(ResDataObject &HardwareInfo)
- {
- ResDataObject Config;
- GetConfiguration(&Config);
- HardwareInfo.add("MajorID", (const char*)Config["MajorID"]);
- HardwareInfo.add("MinorID", (const char*)Config["MinorID"]);
- HardwareInfo.add("VendorID", (const char*)Config["VendorID"]);
- HardwareInfo.add("ProductID", (const char*)Config["ProductID"]);
- HardwareInfo.add("SerialID", (const char*)Config["SerialID"]);
- return true;
- }
- bool SYSTEM_CALL CMACHINE_DPC::SetDriverWorkPath(const char * PARAM_IN pWorkPath)
- {
- return true;
- }
- PVOID SYSTEM_CALL CMACHINE_DPC::LoadDriver()
- {
- return NULL;
- }
- void SYSTEM_CALL CMACHINE_DPC::UnloadDriver()
- {
- }
- bool CMACHINE_DPC::Connect()
- {
- LogicDriver::Connect();
- return true;
- }
- bool CMACHINE_DPC::Device_Probe(ResDataObject &HardwareInfo)
- {
- ResDataObject Config;
- GetConfiguration(&Config);
- HardwareInfo.add("MajorID", (const char*)Config["MajorID"]);
- HardwareInfo.add("MinorID", (const char*)Config["MinorID"]);
- HardwareInfo.add("VendorID", (const char*)Config["VendorID"]);
- HardwareInfo.add("ProductID", (const char*)Config["ProductID"]);
- HardwareInfo.add("SerialID", "1234");
- return true;
- }
- bool CMACHINE_DPC::SetDeviceWorkPath(const char *pWorkPath)
- {
- (*m_pWorkpath) = pWorkPath;
- //要把读取单一硬件属性的过程放到此处
- return true;
- }
- PVOID CMACHINE_DPC::LoadLogicDevices()
- {
- DevTree *pTree = (DevTree *)GetDeviceTree();
- if ((string)m_DeviceConfig["MechType"] == "0")
- {
- m_pGenLogical = new CMACHINE_Logical();
- m_pGenLogical->DPCPoint(this);
- LogicDevice *pret = (LogicDevice *)m_pGenLogical;
- pTree->Add((PVOID)pret, TYPE_DEVICE);
- m_pGenLogical->NotifyMachineryReadyState(true);
- }
- else if ((string)m_DeviceConfig["MechType"] == "1")
- {
- CMACHINE_StitchLogic *pGenLogical = new CMACHINE_StitchLogic();
- pGenLogical->DPCPoint(this);
- LogicDevice *pret = (LogicDevice *)pGenLogical;
- pTree->Add((PVOID)pret, TYPE_DEVICE);
- }
- else
- {
- CMACHINE_MammoLogic *pGenLogical = new CMACHINE_MammoLogic();
- pGenLogical->DPCPoint(this);
- LogicDevice *pret = (LogicDevice *)pGenLogical;
- pTree->Add((PVOID)pret, TYPE_DEVICE);
- }
- return (PVOID)pTree;
- }
- void CMACHINE_DPC::UnloadLogicDevices()
- {
- DevTree *pTree = (DevTree *)GetDeviceTree();
- size_t Size = pTree->size();
- for (size_t i = 0; i < Size; i++)
- {
- DevTreeNode node = (*pTree)[i];
- if (node.m_NodeType == TYPE_DEVICE)
- {
- LogicDevice *pdev = (LogicDevice*)node.m_pObject;
- delete pdev;
- }
- else
- {
- //tree dev
- //do not copy this!!!!
- //UnloadLogicDevices(node.m_pObject);
- }
- }
- pTree->clear();
- PRINTA_INFO(m_pLog, "UnLoad Over");
- }
- void CMACHINE_DPC::DisConnect()
- {
- LogicDriver::DisConnect();
- }
- bool SYSTEM_CALL CMACHINE_DPC::OnHeartBeat()
- {
- return true;
- }
- void MakeComList(int TotalIdx, string &Result)
- {
- Result = "";
- ResDataObject Res;
- for (int i = 0; i < TotalIdx; i++)
- {
- string key = FormatstdString("%d", i);
- string Context = FormatstdString("COM%d", i + 1);
- Res.add(key.c_str(), Context.c_str());
- }
- Result = Res.encode();
- }
- RET_STATUS SYSTEM_CALL CMACHINE_DPC::GetDeviceResource(ResDataObject PARAM_OUT *pDeviceResource)
- {
- RET_STATUS rs = LogicDriver::GetDeviceResource(pDeviceResource);
- bool ret = true;
- ResDataObject val = (*pDeviceResource)["Attribute"];
- //val.add(MACHINERY_READY, m_MachineryReady[MACHINERY_READY]);
- val.add(MACHINERY_TID, m_DetectorToTableDistance[MACHINERY_TID]);
- val.add(MACHINERY_SID, m_DistanceSourcetoDetector[MACHINERY_SID]);
- val.add(MACHINERY_ENTRANCE, m_DistanceSourcetoEntrance[MACHINERY_ENTRANCE]);
- val.add(MACHINERY_GEOMETRY, m_GEOMETRY[MACHINERY_GEOMETRY]);
- val.add(MACHINERY_PROJECTIONNUM, m_ProjectionNum[MACHINERY_PROJECTIONNUM]);
- val.add(MACHINERY_MAXANGLE, m_ProjectionMaxAngle[MACHINERY_MAXANGLE]);
- val.add(MACHINERY_DIRECTION, m_ProjectionDirection[MACHINERY_DIRECTION]);
- string ComList;
- ResDataObject DeviceConfig;
- m_pGenVender->SetCurrentValue("ECOM");
- m_pGenVender->SetType("string");
- m_pGenVender->SetAccessReadOnly();
- m_pGenVender->SetRequired(true);
- m_pGenModel->SetCurrentValue("MACHINE");
- m_pGenModel->SetType("string");
- m_pGenModel->SetAccessReadOnly();
- m_pGenModel->SetRequired(true);
- m_pGenSCFType->SetCurrentValue("COM");
- m_pGenSCFType->SetType("string");
- m_pGenSCFType->SetAccessReadOnly();
- m_pGenSCFType->SetRequired(true);
- m_pGenSCFPort->SetCurrentValue("");
- m_pGenSCFPort->SetType("string");
- m_pGenSCFPort->SetAccessReadWrite();
- MakeComList(12, ComList);
- m_pGenSCFPort->SetList(ComList.c_str());
- //m_pGenSCFPort->SetList("COM1;COM2;COM3;COM4;COM5;COM6;COM7;COM8;COM9;COM10;COM11;COM12");
- m_pGenSCFPort->SetRequired(true);
- m_pTID->SetCurrentValue("20");
- m_pTID->SetType("int");
- m_pTID->SetAccessReadWrite();
- m_pTID->SetRequired(true);
- m_pSID->SetCurrentValue("1000");
- m_pSID->SetType("int");
- m_pSID->SetAccessReadWrite();
- m_pSID->SetRequired(true);
- m_pENTRANCE->SetCurrentValue("1000");
- m_pENTRANCE->SetType("int");
- m_pENTRANCE->SetAccessReadWrite();
- m_pENTRANCE->SetRequired(true);
- m_pGEOMETRY->SetCurrentValue("liner");
- m_pGEOMETRY->SetType("string");
- m_pGEOMETRY->SetAccessReadWrite();
- ResDataObject resList;
- resList.add("0", "liner");
- resList.add("1", "arc");
- m_pGEOMETRY->SetList(resList.encode());
- m_pGEOMETRY->SetRequired(true);
- GetDeviceConfig(&DeviceConfig);
- val.add(DeviceConfig.GetKey(0), DeviceConfig[0]);
- ret &= pDeviceResource->update("Attribute", val);
- PRINTA_INFO(m_pLog, pDeviceResource->encode());
- if (ret)
- {
- return RET_SUCCEED;
- }
- return RET_FAILED;
- }
- /////////////////////////////////////////////////////////////////////////
- int CMACHINE_DPC::CMDSet(const char *pKey, int len)
- {
- return 1;
- }
- RET_STATUS SYSTEM_CALL CMACHINE_DPC::GetDriverDictionary(ResDataObject& PARAM_OUT DriverInfo)
- {
- DriverInfo.add("DriverType", "PositionMachine");
- DriverInfo.add("DeviceName", "SiemensTOMO");
- DriverInfo.add("DateOfManufacture", "2019.4.12");
- DriverInfo.add("SoftwareVersion", "Alpha1.0");
- DriverInfo.add("HardwareVersion", "Alpha1.0");
- DriverInfo.add("Description", "None");
- DriverInfo.add("Properties", "None");
- return RET_SUCCEED;
- }
- bool CMACHINE_DPC::SendDate(void)
- {
- return true;
- }
- bool CMACHINE_DPC::SendTomoExam(void)
- {
- return true;
- }
- bool CMACHINE_DPC::StartMove(bool state)
- {
- return true;
- }
- bool CMACHINE_DPC::ClearMoveState()
- {
- return true;
- }
- bool CMACHINE_DPC::SendIXRAY(void)
- {
- return true;
- }
- bool CMACHINE_DPC::MechMoveReady()
- {
- return true;
- }
- bool CMACHINE_DPC::SetPositionNum(const char* code)
- {
- return true;
- }
- void OEM_IF CMACHINE_DPC::NotifyTomoParams(FLOAT fSID, FLOAT fTID, FLOAT fMaxAngle, int nDirection, int nProjectionNumber)
- {
- //距离单位为mm
- m_DetectorToTableDistance[MACHINERY_TID] = fTID;
- m_DistanceSourcetoDetector[MACHINERY_SID] = fSID;
- m_ProjectionMaxAngle[MACHINERY_MAXANGLE] = fMaxAngle;
- m_ProjectionNum[MACHINERY_PROJECTIONNUM] = nProjectionNumber;
- m_ProjectionDirection[MACHINERY_DIRECTION] = nDirection;
- ResDataObject NotifyData;
- PacketAnalizer::MakeNotify(NotifyData, PACKET_CMD_UPDATE, MACHINERY_TID, (const char *)m_DetectorToTableDistance[MACHINERY_TID]);
- CmdFromLogicDev(&NotifyData);
- PacketAnalizer::MakeNotify(NotifyData, PACKET_CMD_UPDATE, MACHINERY_SID, (const char *)m_DistanceSourcetoDetector[MACHINERY_SID]);
- CmdFromLogicDev(&NotifyData);
- PacketAnalizer::MakeNotify(NotifyData, PACKET_CMD_UPDATE, MACHINERY_MAXANGLE, (const char *)m_ProjectionMaxAngle[MACHINERY_MAXANGLE]);
- CmdFromLogicDev(&NotifyData);
- PacketAnalizer::MakeNotify(NotifyData, PACKET_CMD_UPDATE, MACHINERY_PROJECTIONNUM, (const char *)m_ProjectionNum[MACHINERY_PROJECTIONNUM]);
- CmdFromLogicDev(&NotifyData);
- PacketAnalizer::MakeNotify(NotifyData, PACKET_CMD_UPDATE, MACHINERY_DIRECTION, (const char *)m_ProjectionDirection[MACHINERY_DIRECTION]);
- CmdFromLogicDev(&NotifyData);
- }
- bool CMACHINE_DPC::MechGetPosReady()
- {
- return true;
- }
- bool CMACHINE_DPC::GetPosition(ResDataObject &resangle, ResDataObject &resheight)
- {
- resangle = m_MechAngle;
- resheight = m_MechHeight;
- return true;
- }
- RET_STATUS CMACHINE_DPC::SetDeviceConfig(ResDataObject PARAM_IN *DeviceConfig)
- {
- string strKey;
- printf("\n SetDeviceConfig before : %s\n", DeviceConfig->encode());
- ResDataObject &ConfigContext = (*DeviceConfig)[0][0];
- for (int i = 0; i < ConfigContext.size(); i++)
- {
- strKey = ConfigContext.GetKey(i);
- printf("\n Key : %s, Value : %s\n", strKey.c_str(), ((string)(ConfigContext)[i]).c_str());
- if (strKey == (string)m_pGenSCFPort->GetKey(0))
- {
- m_DeviceConfig["connections"][0][DiosSCFPort] = (ConfigContext)[i];
- m_pGenSCFPort->SetCurrentValue((ConfigContext)[i]);
- }
- else if (strKey == MACHINERY_TID)
- {
- m_DetectorToTableDistance[MACHINERY_TID] = (ConfigContext)[i];
- m_DeviceConfig.update(MACHINERY_TID, (ConfigContext)[i]);
- m_pTID->SetCurrentValue(((string)ConfigContext[i]).c_str());
- }
- else if (strKey == MACHINERY_SID)
- {
- m_DistanceSourcetoDetector[MACHINERY_SID] = (ConfigContext)[i];
- m_DeviceConfig.update(MACHINERY_SID, (ConfigContext)[i]);
- m_pSID->SetCurrentValue(((string)ConfigContext[i]).c_str());
- }
- else if (strKey == MACHINERY_ENTRANCE)
- {
- m_DistanceSourcetoEntrance[MACHINERY_ENTRANCE] = (ConfigContext)[i];
- m_DeviceConfig.update(MACHINERY_ENTRANCE, (ConfigContext)[i]);
- m_pENTRANCE->SetCurrentValue(((string)ConfigContext[i]).c_str());
- }
- else if (strKey == MACHINERY_GEOMETRY)
- {
- m_GEOMETRY[MACHINERY_GEOMETRY] = (ConfigContext)[i];
- m_DeviceConfig.update(MACHINERY_GEOMETRY, (ConfigContext)[i]);
- m_pGEOMETRY->SetCurrentValue(((string)ConfigContext[i]).c_str());
- }
- }
- printf("\n m_DeviceConfig after : %s\n", m_DeviceConfig.encode());
- ResDataObject config, writecontent;
- LogicDriver::GetConfiguration(&config);
- string configpath = GetDriverConfigFilePath();
- writecontent.add("CONFIGURATION", m_DeviceConfig);
- writecontent.SaveFile(configpath.c_str());
- LogicDriver::SetDeviceConfig(&ConfigContext);
- return RET_SUCCEED;
- }
- RET_STATUS CMACHINE_DPC::GetDeviceConfig(ResDataObject PARAM_OUT *pDeviceConfig)
- {
- if (m_DeviceConfig.size() > 0)
- {
- printf("\n m_DeviceConfig: %s \n", m_DeviceConfig.encode());
- m_pGenSCFType->SetCurrentValue(((string)m_DeviceConfig["connections"][0]["type"]).c_str());
- m_pGenSCFPort->SetCurrentValue(((string)m_DeviceConfig["connections"][0][DiosSCFPort]).c_str());
- for (int i = 0; i < m_DeviceConfig.size(); i++)
- {
- if ((string)m_DeviceConfig.GetKey(i) == MACHINERY_TID)
- {
- m_pTID->SetCurrentValue(((string)m_DeviceConfig[i]).c_str());
- }
- else if ((string)m_DeviceConfig.GetKey(i) == MACHINERY_SID)
- {
- m_pSID->SetCurrentValue(((string)m_DeviceConfig[i]).c_str());
- }
- else if ((string)m_DeviceConfig.GetKey(i) == MACHINERY_ENTRANCE)
- {
- m_pENTRANCE->SetCurrentValue(((string)m_DeviceConfig[i]).c_str());
- }
- else if ((string)m_DeviceConfig.GetKey(i) == MACHINERY_GEOMETRY)
- {
- m_pGEOMETRY->SetCurrentValue(((string)m_DeviceConfig[i]).c_str());
- }
- }
- }
- ResDataObject temp, DeviceConfig;
- temp.add(m_pGenVender->GetKey(0), m_pGenVender->GetCurrentValue());
- temp.add(m_pGenModel->GetKey(0), m_pGenModel->GetCurrentValue());
- temp.add(m_pGenSCFType->GetKey(0), m_pGenSCFType->GetCurrentValue());
- temp.add(m_pGenSCFPort->GetKey(0), m_pGenSCFPort->GetCurrentValue());
- temp.add(m_pTID->GetKey(0), m_pTID->GetCurrentValue());
- temp.add(m_pSID->GetKey(0), m_pSID->GetCurrentValue());
- temp.add(m_pENTRANCE->GetKey(0), m_pENTRANCE->GetCurrentValue());
- temp.add(m_pGEOMETRY->GetKey(0), m_pGEOMETRY->GetCurrentValue());
- DeviceConfig.update("Attribute", temp);
- ResDataObject resdescription;
- resdescription += *m_pGenVender;
- resdescription += *m_pGenModel;
- resdescription += *m_pGenSCFType;
- resdescription += *m_pGenSCFPort;
- resdescription += *m_pTID;
- resdescription += *m_pSID;
- resdescription += *m_pENTRANCE;
- resdescription += *m_pGEOMETRY;
- DeviceConfig.update("Description", resdescription);
- pDeviceConfig->add("DeviceConfig", DeviceConfig);
- //(*pDeviceConfig) = DeviceConfig;
- LogicDriver::GetDeviceConfig(pDeviceConfig);
- return RET_SUCCEED;
- }
|