diff --git a/src/dialogs/ReconSettingsDialog.cpp b/src/dialogs/ReconSettingsDialog.cpp index 9641af6..c51e06e 100644 --- a/src/dialogs/ReconSettingsDialog.cpp +++ b/src/dialogs/ReconSettingsDialog.cpp @@ -2,6 +2,7 @@ #include "components/ULineEdit.h" #include "dialogs/DicomSettingsArea.h" #include "json/jsonobject.h" +#include "recon/ReconManager.h" #include #include @@ -102,6 +103,8 @@ bool ReconSettingsDialog::updateReferenceData() serverInfo.name = myAETitle; serverInfo.port = serverPort; JsonObject::Instance()->setServer(JsonObject::RECON, serverInfo); + ReconManager::getInstance()->setReconIpAndPort(serverIp, serverPort); + QMetaObject::invokeMethod(ReconManager::getInstance(), "checkReconConnection", Qt::QueuedConnection); return true; } diff --git a/src/recon/ReconClient.cpp b/src/recon/ReconClient.cpp index c67c8a7..802b866 100644 --- a/src/recon/ReconClient.cpp +++ b/src/recon/ReconClient.cpp @@ -72,7 +72,7 @@ RequestResult ReconClient::Create(const Scan &aScan) content.append(str); free(str); auto resp = mRequest.post(mHost + CREATE_URL, content, mHeaders); - if (resp.httpCode() == 201) + if (resp.httpCode() == 200) { return RequestResult::Success(); } diff --git a/src/recon/ReconManager.cpp b/src/recon/ReconManager.cpp index b9e234e..a993867 100644 --- a/src/recon/ReconManager.cpp +++ b/src/recon/ReconManager.cpp @@ -101,11 +101,6 @@ void ReconManager::queryReconStatus(const QStringList& aScanIDs) void ReconManager::checkReconConnection() { auto response = mReconClient->CheckActive(); - cJSON* json = cJSON_Parse(response.message().data()); - cJSON* stateProperty = cJSON_GetObjectItem(json, "State"); - int state = stateProperty->valueint; - cJSON_Delete(json); - qDebug()<<"Recon State:"<valueint; + cJSON_Delete(json); + qDebug()<<"Recon State:"<