Change recon page can refresh transfer progress automaticly.
This commit is contained in:
@@ -702,7 +702,10 @@ void DeviceManager::startTransfer()
|
||||
QString msg = "DB Error. Code:G501";
|
||||
emitInfoCallback(msg, MessageLevel::Error);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
emit transferStatusUpdated();
|
||||
}
|
||||
}
|
||||
|
||||
void DeviceManager::processTransferProgress(const QString& aProgress)
|
||||
@@ -727,6 +730,7 @@ void DeviceManager::processTransferProgress(const QString& aProgress)
|
||||
.arg(mIsTransferEmptyScan ? "EScan" : "Scan")
|
||||
.arg(mCurrentTransferMeasurementID);
|
||||
mIsTransfering = false;
|
||||
mTransferProgress = 0;
|
||||
mCurrentTransferMeasurementID.clear();
|
||||
if(!SQLHelper::exec(sql))
|
||||
{
|
||||
@@ -735,6 +739,7 @@ void DeviceManager::processTransferProgress(const QString& aProgress)
|
||||
break;
|
||||
}
|
||||
emitInfoCallback("Scan data transfer Succeeded!", MessageLevel::Sucess);
|
||||
emit transferStatusUpdated();
|
||||
startCreateReconRecord();
|
||||
startTransfer();
|
||||
break;
|
||||
@@ -744,6 +749,7 @@ void DeviceManager::processTransferProgress(const QString& aProgress)
|
||||
.arg(mIsTransferEmptyScan ? "EScan" : "Scan")
|
||||
.arg(mCurrentTransferMeasurementID);
|
||||
mIsTransfering = false;
|
||||
mTransferProgress = 0;
|
||||
mCurrentTransferMeasurementID.clear();
|
||||
if(!SQLHelper::exec(sql))
|
||||
{
|
||||
@@ -852,7 +858,6 @@ void DeviceManager::initEmptyScanMeasurementID()
|
||||
|
||||
void DeviceManager::updateReconState()
|
||||
{
|
||||
updateTransferProgress();
|
||||
QString sql = "SELECT ScanID FROM Scan WHERE State < 999 And State >= 300";
|
||||
auto result = SQLHelper::queryValues(sql);
|
||||
QStringList scanIDs;
|
||||
@@ -869,19 +874,22 @@ void DeviceManager::updateReconState()
|
||||
emit queryScanStatusToRecon(scanIDs);
|
||||
}
|
||||
|
||||
void DeviceManager::updateTransferProgress()
|
||||
bool DeviceManager::updateTransferProgress()
|
||||
{
|
||||
if(!mIsTransfering)
|
||||
{
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
mTransferProgress = 0;
|
||||
auto result = mGetTransferProgressAction->execute();
|
||||
QJsonObject jsonObj = toJsonObject(result.mData);
|
||||
if(jsonObj["code"].toInt() == 0 )
|
||||
if(jsonObj["code"].toInt() == 1 )
|
||||
{
|
||||
mTransferProgress = jsonObj["info"].toInt();
|
||||
mTransferProgress = jsonObj["info"].toString().toInt();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
int DeviceManager::getTransferProgress()
|
||||
|
||||
@@ -69,7 +69,7 @@ public:
|
||||
void emitErrorCallback(const char *msg);
|
||||
void emitInfoCallback(const QString& aMessage,const unsigned int aInfoType);
|
||||
bool hasValidEmptyScan();
|
||||
void updateTransferProgress();
|
||||
bool updateTransferProgress();
|
||||
int getTransferProgress();
|
||||
|
||||
public slots:
|
||||
@@ -142,6 +142,9 @@ signals:
|
||||
void createScanToRecon(const QString& aScanID, const QString& aPatientID, const QString& aReferenceID, const QString& aPath);
|
||||
void queryScanStatusToRecon(const QStringList& aScanIDs);
|
||||
void updateReconStateFinished();
|
||||
//GUI
|
||||
void initializeFinished();
|
||||
void transferStatusUpdated();
|
||||
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user