fix: Recon connection failed with new recon interface.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user