feat: Add two static methods CEcho & GetStoragePoints to ReconManager
This commit is contained in:
@@ -192,3 +192,50 @@ bool ReconManager::isConnected()
|
||||
{
|
||||
return mIsConnected;
|
||||
}
|
||||
|
||||
void ReconManager::CEcho(const QString& aIP, int aPort, const QString& aAETitle, bool& aResult, QString& aMessage)
|
||||
{
|
||||
ReconClient tempClient(CRT_FILE, KEY_FILE);
|
||||
host reconServerInfo = JsonObject::Instance()->getServer(JsonObject::RECON);
|
||||
tempClient.SetHost(toReconServerAddress(reconServerInfo.ip , reconServerInfo.port));
|
||||
auto result = tempClient.Echo(aIP.toStdString(),aPort,aAETitle.toStdString());
|
||||
if(result.good())
|
||||
{
|
||||
aResult = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
aResult = false;
|
||||
if(result.isConnectFailure()){
|
||||
aMessage = tr("Can't connect to Recon server");
|
||||
}
|
||||
else{
|
||||
aMessage = result.message().data();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ReconManager::GetStoragePoints(bool& aResult, QList<PACSSetting>& aStoragePoint)
|
||||
{
|
||||
ReconClient tempClient(CRT_FILE, KEY_FILE);
|
||||
host reconServerInfo = JsonObject::Instance()->getServer(JsonObject::RECON);
|
||||
tempClient.SetHost(toReconServerAddress(reconServerInfo.ip , reconServerInfo.port));
|
||||
std::vector<PACSSetting> vector;
|
||||
auto result = tempClient.GetPACSSetting(vector);
|
||||
if (result.isConnectFailure()){
|
||||
aResult = false;
|
||||
return;
|
||||
}
|
||||
if(result.good())
|
||||
{
|
||||
aResult = true;
|
||||
for (const PACSSetting& item : vector)
|
||||
{
|
||||
aStoragePoint.append(item);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
aResult = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
#include <QObject>
|
||||
|
||||
#include "ProtocolStructs.h"
|
||||
|
||||
class QTimer;
|
||||
class ReconClient;
|
||||
|
||||
@@ -17,6 +19,9 @@ public:
|
||||
public:
|
||||
void setReconIpAndPort(const QString& aIp, const QString& aPort);
|
||||
bool isConnected();
|
||||
static void CEcho(const QString& aIP, int aPort, const QString& aAETitle, bool& aResult, QString& aMessage);
|
||||
static void GetStoragePoints(bool& aResult, QList<PACSSetting>& aStoragePoint);
|
||||
|
||||
|
||||
public slots:
|
||||
void createEmptyScan(const QString& aScanID, const QString& aPath);
|
||||
|
||||
Reference in New Issue
Block a user