Set dms simulator can read from config file.

This commit is contained in:
sunwen
2023-08-30 11:16:21 +08:00
parent 52605ed981
commit a384950cd6
5 changed files with 50 additions and 36 deletions

View File

@@ -73,5 +73,8 @@
},
"screensaver": {
"content": "screensaver.PNG;screensaver.mp4"
},
"dms":{
"simulator": true
}
}

View File

@@ -1,6 +1,6 @@
{
"login": {
"defaultUser": ""
"defaultUser": "usct"
},
"deviceparam": {
"aeTitle": "ACME1",
@@ -20,7 +20,8 @@
"language": "zh_CN;en_US",
"institutionName": "浙江大学附属第二医院",
"institutionAddr": "杭州市滨江区",
"lockscreen": "30"
"lockscreen": "0",
"CompleteNotify": true
},
"protocol": {
"default": "LSTAND",
@@ -40,22 +41,22 @@
"usercode": ""
},
"worklist": {
"ae": "OFFIS",
"ip": "127.0.0.1",
"name": "wklistserver",
"port": "101"
"ae": "CONQUESTSRV1",
"ip": "192.168.1.178",
"name": "gui",
"port": "5678"
},
"pacs": {
"ae": "HELLO",
"ip": "127.0.0.2",
"name": "pacsserver22",
"port": "102"
"ae": "ORTHANC",
"ip": "192.168.1.10",
"name": "Radiant",
"port": "4242"
},
"recon": {
"ae": "TURTLE",
"ip": "127.0.0.4",
"ae": "krad",
"ip": "192.168.1.15",
"name": "3D recon",
"port": "104"
"port": "5003"
},
"address": {
"device": "eth0",
@@ -91,5 +92,9 @@
},
"screensaver": {
"content": "screensaver.PNG;screensaver.mp4"
},
"dms":{
"simulator": true
}
}

View File

@@ -81,29 +81,28 @@ QString getFullScanJson(QObject* obj)
return QString::fromUtf8(QJsonDocument(fullJson).toJson(QJsonDocument::Compact));
}
void errorCallback(const char* msg)
{
DeviceManager::Default()->emitErrorCallback(msg);
}
void infoCallback(const char* msg,const unsigned int aInfoType)
{
DeviceManager::Default()->emitInfoCallback(msg,aInfoType);
}
void DeviceManager::initDevice()
{
dmsmq_init();
if(JsonObject::Instance()->isDmsSimulator())
{
qDebug()<< JsonObject::Instance()->isDmsSimulator();
//set simulator
QString simulatorCode = "{ \"code\":0, \"info\":\"1\"}";
QByteArray byteArray = simulatorCode.toUtf8();
uint8_t* data = reinterpret_cast<uint8_t*>(byteArray.data());
dmsmq_send(USRV_SCAN, ACT_SCAN_SIMULATOR,data, simulatorCode.size());
}
//set heart beat=0
QString heartBeatCode = "{ \"code\":0, \"info\":\"0\"}";
byteArray = heartBeatCode.toUtf8();
data = reinterpret_cast<uint8_t*>(byteArray.data());
QByteArray byteArray = heartBeatCode.toUtf8();
uint8_t* data = reinterpret_cast<uint8_t*>(byteArray.data());
dmsmq_send(USRV_INFOCFG, ACT_IFCFG_HBCFG,data, heartBeatCode.size());
//set log level
QString logLevelCode = "{ \"code\":0, \"info\":\"3\"}";
byteArray = logLevelCode.toUtf8();
data = reinterpret_cast<uint8_t*>(byteArray.data());
dmsmq_send(USRV_LOGALARM, ACT_LOGALM_CFG,data, heartBeatCode.size());
mTemperatureTimer = startTimer(GET_TEMPERATURE_TIME);
@@ -285,7 +284,7 @@ void DeviceManager::prepareFinishScan(bool isNormalFinish, const QString& aReaso
TRIGGER_EVENT(InvokeOperationEnd, nullptr, var);
}
startTransfer();
startTransfer();
}
void DeviceManager::stopFullScan()

View File

@@ -543,3 +543,9 @@ QStringList JsonObject::getScreenSaverInfomation()
{
return QString(getJsonString("screensaver", "content")).split(";");
}
bool JsonObject::isDmsSimulator()
{
return getBool("dms","simulator");
}

View File

@@ -85,6 +85,7 @@ public:
void setInterfaceName(const QString& name);
bool isDHCP();
bool isDmsSimulator();
void autoDHCP(bool);
bool getScanConfirm();