fix: Recon connection failed with new recon interface.

This commit is contained in:
sunwen
2024-05-28 11:30:09 +08:00
parent 03bf58f069
commit 885e971ada
3 changed files with 12 additions and 6 deletions

View File

@@ -2,6 +2,7 @@
#include "components/ULineEdit.h"
#include "dialogs/DicomSettingsArea.h"
#include "json/jsonobject.h"
#include "recon/ReconManager.h"
#include <QVBoxLayout>
#include <QLabel>
@@ -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;
}

View File

@@ -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();
}

View File

@@ -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:"<<state;
if(mIsConnected != response.good())
{
emit checkReconConnectionResponsed(response.good());
@@ -115,6 +110,14 @@ void ReconManager::checkReconConnection()
emit restartCreatReconRecord();
}
mIsConnected = response.good();
if (mIsConnected)
{
cJSON* json = cJSON_Parse(response.message().data());
cJSON* stateProperty = cJSON_GetObjectItem(json, "State");
int state = stateProperty->valueint;
cJSON_Delete(json);
qDebug()<<"Recon State:"<<state;
}
}
void ReconManager::setPacsSettings(const QString& aClientAETitle, const QString& aServerAETitle, const QString& aServerIP, int aServerPort)