feat: Remove data transfer in gui.

This commit is contained in:
sunwen
2025-02-13 14:29:40 +08:00
parent 80be60042a
commit 7c66abb72d
10 changed files with 340 additions and 673 deletions

View File

@@ -126,8 +126,6 @@ void DeviceManager::initDevice()
mFullScanAction = new DmsSyncAction(USRV_SCAN, ACT_SCAN_FULLSCAN, this, "responseFullScan(const QString&)", this); mFullScanAction = new DmsSyncAction(USRV_SCAN, ACT_SCAN_FULLSCAN, this, "responseFullScan(const QString&)", this);
mStopScanAction = new DmsSyncAction(USRV_SCAN, ACT_SCAN_STOP, this, "responseStopScan(const QString&)", this); mStopScanAction = new DmsSyncAction(USRV_SCAN, ACT_SCAN_STOP, this, "responseStopScan(const QString&)", this);
mPreviewScanAction = new DmsSyncAction(USRV_SCAN, ACT_SCAN_PREVIEW, this, "responsePreviewScan(const QString&)", this); mPreviewScanAction = new DmsSyncAction(USRV_SCAN, ACT_SCAN_PREVIEW, this, "responsePreviewScan(const QString&)", this);
mTransferAction = new DmsSyncAction(USRV_XFR, ACT_XFR_START, this, "responseTransfer(const QString&)", this);
mGetTransferProgressAction = new DmsSyncAction(USRV_XFR, ACT_XFR_PROGRESS_PASSIVE, this, "responseGetTransferProgress(const QString&)", this);
mCEScanAction = new DmsSyncAction(USRV_SCAN, ACT_SCAN_CE, this, "responseCEScan(const QString&)", this); mCEScanAction = new DmsSyncAction(USRV_SCAN, ACT_SCAN_CE, this, "responseCEScan(const QString&)", this);
mGetCEStatusAction = new DmsSyncAction(USRV_SCAN, ACT_SCAN_CE_STATUS, this, "responseGetCEStatus(const QString&)", this); mGetCEStatusAction = new DmsSyncAction(USRV_SCAN, ACT_SCAN_CE_STATUS, this, "responseGetCEStatus(const QString&)", this);
mSetSimulatorModeAction = new DmsSyncAction(USRV_SCAN, ACT_SCAN_SIMULATOR, this, "responseSetSimulatorMode(const QString&)", this); mSetSimulatorModeAction = new DmsSyncAction(USRV_SCAN, ACT_SCAN_SIMULATOR, this, "responseSetSimulatorMode(const QString&)", this);
@@ -140,7 +138,6 @@ void DeviceManager::initDevice()
//Async action //Async action
mGetScanProgressAction = new DmsAsyncAction(USRV_SCAN, ACT_SCAN_PROGRESS_PASSIVE, this,"responseGetScanProgress(const QString&)", this); mGetScanProgressAction = new DmsAsyncAction(USRV_SCAN, ACT_SCAN_PROGRESS_PASSIVE, this,"responseGetScanProgress(const QString&)", this);
mGetDeviceTemperatureAction = new DmsAsyncAction(USRV_SCAN, ACT_SCAN_TEMP, this, "responseGetDeviceTemperature(const QString&)", this); mGetDeviceTemperatureAction = new DmsAsyncAction(USRV_SCAN, ACT_SCAN_TEMP, this, "responseGetDeviceTemperature(const QString&)", this);
mStopTransferAction = new DmsAsyncAction(USRV_XFR, ACT_XFR_STOP, this, "responseStopTransfer(const QString&)", this);
mShutDownAction = new DmsAsyncAction(USRV_CONTROL, ACT_CTL_PWRDOWN, this, "responseShutDown(const QString&)", this); mShutDownAction = new DmsAsyncAction(USRV_CONTROL, ACT_CTL_PWRDOWN, this, "responseShutDown(const QString&)", this);
mShutDownAction->setTimeoutInterval(SHUT_DOWN_TIMEOUT); mShutDownAction->setTimeoutInterval(SHUT_DOWN_TIMEOUT);
mPumpControlAction = new DmsAsyncAction(USRV_CONTROL, ACT_CTL_PUMP, this, "responsePumpControl(const QString&)", this); mPumpControlAction = new DmsAsyncAction(USRV_CONTROL, ACT_CTL_PUMP, this, "responsePumpControl(const QString&)", this);
@@ -434,7 +431,10 @@ void DeviceManager::prepareFinishScan(bool isNormalFinish, const QString& aReaso
insertScanRecord(); insertScanRecord();
} }
startTransfer(); if(ReconManager::getInstance()->isConnected())
{
startCreateReconRecord();
}
if(isCompleteNotify) if(isCompleteNotify)
{ {
@@ -467,11 +467,6 @@ void DeviceManager::prepareFinishInitialize()
void DeviceManager::stopFullScan() void DeviceManager::stopFullScan()
{ {
// DeviceStatus inf = getDeviceStatus();
// if (inf != DeviceStatus::Scanning)
// {
// return;
// }
DmsSyncActionResult result = mStopScanAction->execute(); DmsSyncActionResult result = mStopScanAction->execute();
if(!result.mIsSucessful) if(!result.mIsSucessful)
{ {
@@ -633,8 +628,6 @@ void DeviceManager::timerEvent(QTimerEvent* event)
getDeviceTemperature(); getDeviceTemperature();
return QObject::timerEvent(event); return QObject::timerEvent(event);
} }
} }
void DeviceManager::emitErrorCallback(const QString& msg) void DeviceManager::emitErrorCallback(const QString& msg)
@@ -702,6 +695,7 @@ void DeviceManager::processReceiveDMSInfoResult(int aServerID, int aActionID, co
break; break;
case ACT_SCAN_IMGQUALITI: case ACT_SCAN_IMGQUALITI:
emit responseCheckDataQuality(aContents); emit responseCheckDataQuality(aContents);
break;
default: default:
break; break;
} }
@@ -716,23 +710,6 @@ void DeviceManager::processReceiveDMSInfoResult(int aServerID, int aActionID, co
break; break;
} }
break; break;
case USRV_XFR :
switch(aActionID)
{
case ACT_XFR_START :
emit responseTransfer(aContents);
break;
case ACT_XFR_STOP :
emit responseStopTransfer(aContents);
break;
case ACT_XFR_PROGRESS_PASSIVE :
emit responseGetTransferProgress(aContents);
break;
case ACT_XFR_PROGRESS_ACTIVE :
processTransferProgress(aContents);
break;
}
break;
case USRV_INFOCFG: case USRV_INFOCFG:
switch(aActionID) switch(aActionID)
{ {
@@ -933,13 +910,6 @@ void DeviceManager::getScanProcess()
void DeviceManager::shutdownDms() void DeviceManager::shutdownDms()
{ {
if(mIsTransfering)
{
QString msg = tr("Data is currently being transmitted, please shut down later.");
THROW_ERROR(msg);
return;
}
if(!mShutDownAction->execute()) if(!mShutDownAction->execute())
{ {
QString msg = tr("Shut down failed, please push emergency button to shutdown."); QString msg = tr("Shut down failed, please push emergency button to shutdown.");
@@ -1015,126 +985,6 @@ void DeviceManager::insertScanRecord()
} }
} }
void DeviceManager::startTransfer()
{
if(mIsTransfering)
{
return;
}
QString sql = "SELECT ScanID FROM %1 WHERE State<200 ORDER BY ScanDateTime ASC LIMIT 1";
QString table = "EScan";
QVariant sqlResult = SQLHelper::queryValue(sql.arg(table));
mIsTransferEmptyScan = true;
if(sqlResult.isNull())
{
mIsTransferEmptyScan = false;
table = "Scan";
sqlResult = SQLHelper::queryValue(sql.arg(table));
if(sqlResult.isNull())
{
return;
}
}
QString scanID = sqlResult.toString();
auto host = JsonObject::Instance()->getServer(JsonObject::RECON);
mTransferAction->setSendData("{\"MD5\":1, \"dst\":\"" + host.ae + "@" + host.ip +":" + mReconTransferPath + "\", \"src\":\"" + scanID + "\",\"delete\":1,\"active report\":0}");
DmsSyncActionResult result = mTransferAction->execute();
if(!result.mIsSucessful)
{
QString msg = tr("Scan data transfer failed.");
emitInfoCallback(msg, MessageLevel::Error);
return;
}
QJsonObject jsonObj = toJsonObject(result.mData);
int code = jsonObj["code"].toInt();
if(code != 0)
{
mStopTransferAction->execute();
QString msg = tr("Scan data transfer failed.");
emitInfoCallback(msg, MessageLevel::Error);
return;
}
mIsTransfering = true;
mCurrentTransferMeasurementID = scanID;
mCurrentTransferPatientID = mIsTransferEmptyScan ? "" : SQLHelper::queryValue(QString("SELECT PatientID FROM %1 WHERE ScanID = '%2'").arg(table).arg(scanID)).toString();
sql = QString("UPDATE %1 set State = 100 where ScanID = '%2'")
.arg(mIsTransferEmptyScan ? "EScan" : "Scan")
.arg(mCurrentTransferMeasurementID);
if(!SQLHelper::exec(sql))
{
QString msg = "DB Error. Code:G501";
emitInfoCallback(msg, MessageLevel::Error);
}
else
{
updateTransferState();
}
}
void DeviceManager::processTransferProgress(const QString& aProgress)
{
if(!mIsTransfering)
{
return;
}
QJsonObject jsonObj = toJsonObject(aProgress);
int code = jsonObj["code"].toInt();
QString msg = jsonObj["info"].toString();
switch (code)
{
case 1:
{
break;
}
case 2:
{
QString sql = QString("UPDATE %1 set State = 200 where ScanID = '%2'")
.arg(mIsTransferEmptyScan ? "EScan" : "Scan")
.arg(mCurrentTransferMeasurementID);
mIsTransfering = false;
mTransferProgress = 0;
mCurrentTransferMeasurementID.clear();
if(!SQLHelper::exec(sql))
{
QString msg = "DB Error. Code:G502";
emitInfoCallback(msg, MessageLevel::Error);
break;
}
emitInfoCallback(tr("Scan data transfer Succeeded!"), MessageLevel::Sucess);
updateTransferState();
if(ReconManager::getInstance()->isConnected())
{
startCreateReconRecord();
}
startTransfer();
break;
}
default:
QString sql = QString("UPDATE %1 set State = 104 where ScanID = '%2'")
.arg(mIsTransferEmptyScan ? "EScan" : "Scan")
.arg(mCurrentTransferMeasurementID);
mIsTransfering = false;
mTransferProgress = 0;
mCurrentTransferMeasurementID.clear();
if(!SQLHelper::exec(sql))
{
QString msg = "DB Error. Code:G503";
emitInfoCallback(msg, MessageLevel::Error);
break;
}
QString message = tr("Scan data transfer failed.");
emitInfoCallback(message, MessageLevel::Error);
updateTransferState();
break;
}
}
void DeviceManager::processReconCreateEmptyScan(bool aResult, const QString& aScanID, const QString& aMessage, bool aIsConnectSucceed) void DeviceManager::processReconCreateEmptyScan(bool aResult, const QString& aScanID, const QString& aMessage, bool aIsConnectSucceed)
{ {
if(aResult) if(aResult)
@@ -1205,7 +1055,7 @@ void DeviceManager::processReconQueryScanState(bool aResult, const QVariant& aSt
void DeviceManager::startCreateReconRecord() void DeviceManager::startCreateReconRecord()
{ {
QString sql = "SELECT ScanID FROM EScan WHERE State < 300 And State >= 200 ORDER BY ScanDateTime ASC"; QString sql = "SELECT ScanID FROM EScan WHERE State < 300 ORDER BY ScanDateTime ASC";
auto result = SQLHelper::queryValues(sql); auto result = SQLHelper::queryValues(sql);
for (const QVariant &variant : result) for (const QVariant &variant : result)
{ {
@@ -1213,7 +1063,7 @@ void DeviceManager::startCreateReconRecord()
emit createEmptyScanToRecon(scanid, mReconTransferPath + "/" + scanid); emit createEmptyScanToRecon(scanid, mReconTransferPath + "/" + scanid);
} }
sql = "SELECT ScanID, ReferenceID, PatientID, AccessionNumber, StudyUID, MPPSUID FROM Scan WHERE State < 300 And State >= 200 ORDER BY ScanDateTime ASC"; sql = "SELECT ScanID, ReferenceID, PatientID, AccessionNumber, StudyUID, MPPSUID FROM Scan WHERE State < 300 ORDER BY ScanDateTime ASC";
result = SQLHelper::queryValues(sql); result = SQLHelper::queryValues(sql);
for (const QVariant &variant : result) for (const QVariant &variant : result)
{ {
@@ -1227,7 +1077,6 @@ void DeviceManager::startCreateReconRecord()
emit createScanToRecon(scanID, mppsUID, referenceID, mReconTransferPath + "/" + scanID); emit createScanToRecon(scanID, mppsUID, referenceID, mReconTransferPath + "/" + scanID);
} }
startTransfer();
} }
void DeviceManager::initEmptyScanMeasurementID() void DeviceManager::initEmptyScanMeasurementID()
@@ -1259,41 +1108,6 @@ void DeviceManager::updateReconState()
emit queryScanStatusToRecon(scanIDs); emit queryScanStatusToRecon(scanIDs);
} }
bool DeviceManager::updateTransferProgress()
{
if(!mIsTransfering)
{
return false;
}
mTransferProgress = 0;
auto result = mGetTransferProgressAction->execute();
QJsonObject jsonObj = toJsonObject(result.mData);
if(jsonObj["code"].toInt() == 1 )
{
mTransferProgress = jsonObj["info"].toString().toInt();
return true;
}
return false;
}
void DeviceManager::updateTransferState()
{
if(mIsTransferEmptyScan)
{
EventCenter::Default()->triggerEvent(EmptyScanDataStateUpdated, nullptr, nullptr);
}
else
{
emit transferStatusUpdated();
}
}
int DeviceManager::getTransferProgress()
{
return mTransferProgress;
}
bool DeviceManager::getCEStatus() bool DeviceManager::getCEStatus()
{ {
auto result = mGetCEStatusAction->execute(); auto result = mGetCEStatusAction->execute();

View File

@@ -67,8 +67,6 @@ public:
void emitErrorCallback(const QString& msg); void emitErrorCallback(const QString& msg);
void emitInfoCallback(const QString& aMessage,const unsigned int aInfoType); void emitInfoCallback(const QString& aMessage,const unsigned int aInfoType);
bool hasValidEmptyScan(); bool hasValidEmptyScan();
bool updateTransferProgress();
int getTransferProgress();
void prepareEmergencyReset(); void prepareEmergencyReset();
public slots: public slots:
@@ -105,7 +103,6 @@ private:
void getAutoLocatePosition(); void getAutoLocatePosition();
bool getCEStatus(); bool getCEStatus();
bool startCEScan(); bool startCEScan();
void startTransfer();
void initEmptyScanMeasurementID(); void initEmptyScanMeasurementID();
void controlDrainage(const QString& aCode); void controlDrainage(const QString& aCode);
void checkInitStatus(); void checkInitStatus();
@@ -122,7 +119,6 @@ private:
void processAlarm(const QString& aAlarm); void processAlarm(const QString& aAlarm);
void processPreviewData(const QString& aPreviewData); void processPreviewData(const QString& aPreviewData);
void processDeviceTemperature(const QString& aResponseTemperature); void processDeviceTemperature(const QString& aResponseTemperature);
void processTransferProgress(const QString& aProgress);
void processShutDownDms(const QString& aResponse); void processShutDownDms(const QString& aResponse);
void processPumpResult(const QString& aResponse); void processPumpResult(const QString& aResponse);
void processGetSoftwareVersion(const QString& aResponse); void processGetSoftwareVersion(const QString& aResponse);
@@ -130,8 +126,6 @@ private:
void insertEmptyScanRecord(); void insertEmptyScanRecord();
void insertScanRecord(); void insertScanRecord();
void updateTransferState();
private slots: private slots:
//DMS //DMS
@@ -157,13 +151,10 @@ signals:
void responseStopScan(const QString& aResponse); void responseStopScan(const QString& aResponse);
void responsePreviewScan(const QString& aResponse); void responsePreviewScan(const QString& aResponse);
void responseGetSoftwareVersion(const QString& aSoftwareVersion); void responseGetSoftwareVersion(const QString& aSoftwareVersion);
void responseTransfer(const QString& aResponse);
void responseGetTransferProgress(const QString& aProgress);
void responseGetCEStatus(const QString& aProgress); void responseGetCEStatus(const QString& aProgress);
void responsePumpControl(const QString& aResponse); void responsePumpControl(const QString& aResponse);
void responseSetSimulatorMode(const QString& aResponse); void responseSetSimulatorMode(const QString& aResponse);
void responseSetHeartBeat(const QString& aResponese); void responseSetHeartBeat(const QString& aResponese);
void responseStopTransfer(const QString& aResponse);
void responseShutDown(const QString& aResponse); void responseShutDown(const QString& aResponse);
void responseCheckInitStatus(const QString& aResponse); void responseCheckInitStatus(const QString& aResponse);
void responseStartAutoLocate(const QString& aResponse); void responseStartAutoLocate(const QString& aResponse);
@@ -180,7 +171,6 @@ signals:
//GUI //GUI
void initializeFinished(); void initializeFinished();
void initializeProgress(const QString& aProgress); void initializeProgress(const QString& aProgress);
void transferStatusUpdated();
void startPreviewScanResult(bool aIsSucessful); void startPreviewScanResult(bool aIsSucessful);
void startPumpControlResult(bool aIsSucessful); void startPumpControlResult(bool aIsSucessful);
void startAutoLocateResult(bool aIsSucessful); void startAutoLocateResult(bool aIsSucessful);
@@ -197,12 +187,9 @@ private:
int mScanProgressTimer = -1; int mScanProgressTimer = -1;
int mCheckInitStatusTimer = -1; int mCheckInitStatusTimer = -1;
int mGetAutoLocatePositionTimer = -1; int mGetAutoLocatePositionTimer = -1;
int mTransferProgress = 0;
int mEffectivePositionCount = 0; int mEffectivePositionCount = 0;
bool mIsEmptyScan = false; bool mIsEmptyScan = false;
bool mIsTransferEmptyScan = false;
bool mIsScanning = false; bool mIsScanning = false;
bool mIsTransfering = false;
bool mIsPreviewing = false; bool mIsPreviewing = false;
bool mIsInitializing = false; bool mIsInitializing = false;
bool mIsAutoLocating = false; bool mIsAutoLocating = false;
@@ -214,8 +201,6 @@ private:
QString mCurrentAccessionNumber = ""; QString mCurrentAccessionNumber = "";
QString mCurrentLaterality = ""; QString mCurrentLaterality = "";
QString mCurrentOperatorName = ""; QString mCurrentOperatorName = "";
QString mCurrentTransferMeasurementID = "";
QString mCurrentTransferPatientID = "";
QString mSoftwareVersion = ""; QString mSoftwareVersion = "";
QString mReconTransferPath = ""; QString mReconTransferPath = "";
@@ -226,8 +211,6 @@ private:
DmsSyncAction* mPreviewScanAction = nullptr; DmsSyncAction* mPreviewScanAction = nullptr;
DmsSyncAction* mCEScanAction = nullptr; DmsSyncAction* mCEScanAction = nullptr;
DmsSyncAction* mStopScanAction = nullptr; DmsSyncAction* mStopScanAction = nullptr;
DmsSyncAction* mTransferAction = nullptr;
DmsSyncAction* mGetTransferProgressAction = nullptr;
DmsSyncAction* mGetCEStatusAction = nullptr; DmsSyncAction* mGetCEStatusAction = nullptr;
DmsSyncAction* mSetSimulatorModeAction = nullptr; DmsSyncAction* mSetSimulatorModeAction = nullptr;
DmsSyncAction* mSetHeartBeatAction = nullptr; DmsSyncAction* mSetHeartBeatAction = nullptr;
@@ -238,7 +221,6 @@ private:
DmsAsyncAction* mGetDeviceTemperatureAction = nullptr; DmsAsyncAction* mGetDeviceTemperatureAction = nullptr;
DmsAsyncAction* mGetScanProgressAction = nullptr; DmsAsyncAction* mGetScanProgressAction = nullptr;
DmsAsyncAction* mStopTransferAction = nullptr;
DmsAsyncAction* mShutDownAction = nullptr; DmsAsyncAction* mShutDownAction = nullptr;
DmsAsyncAction* mPumpControlAction = nullptr; DmsAsyncAction* mPumpControlAction = nullptr;
DmsAsyncAction* mGetAutoLocatePositionAction = nullptr; DmsAsyncAction* mGetAutoLocatePositionAction = nullptr;

View File

@@ -72,24 +72,11 @@ void InfoReceiveWorker::responsed(int aServerID, int aActionID)
break; break;
case ACT_SCAN_IMGQUALITI: case ACT_SCAN_IMGQUALITI:
DeviceManager::Default()->mCheckDataQualityAction->responsed(); DeviceManager::Default()->mCheckDataQualityAction->responsed();
break;
default: default:
break; break;
} }
break; break;
case USRV_XFR :
switch(aActionID)
{
case ACT_XFR_START :
DeviceManager::Default()->mTransferAction->responsed();
break;
case ACT_XFR_STOP :
DeviceManager::Default()->mStopTransferAction->responsed();
break;
case ACT_XFR_PROGRESS_PASSIVE :
DeviceManager::Default()->mGetTransferProgressAction->responsed();
break;
}
break;
case USRV_INFOCFG: case USRV_INFOCFG:
switch(aActionID) switch(aActionID)
{ {

View File

@@ -26,7 +26,6 @@ ReconFormWidget::ReconFormWidget(QWidget *parent)
, mScanTable(new SlideTableView(this)) , mScanTable(new SlideTableView(this))
, mSearchWidget(new ScanSearchCriteriaForm(this)) , mSearchWidget(new ScanSearchCriteriaForm(this))
, mModel(nullptr) , mModel(nullptr)
, mRefreshTimer(new QTimer(this))
{ {
auto layout = new QHBoxLayout(ui->commandWidget); auto layout = new QHBoxLayout(ui->commandWidget);
layout->setAlignment(Qt::AlignmentFlag::AlignLeft); layout->setAlignment(Qt::AlignmentFlag::AlignLeft);
@@ -51,10 +50,8 @@ ReconFormWidget::ReconFormWidget(QWidget *parent)
// DeviceManager::Default()->updateReconState(); // DeviceManager::Default()->updateReconState();
// }); // });
connect(DeviceManager::Default(), &DeviceManager::updateReconStateFinished, mModel, &QSqlTableModel::select); connect(DeviceManager::Default(), &DeviceManager::updateReconStateFinished, mModel, &QSqlTableModel::select);
connect(DeviceManager::Default(), &DeviceManager::transferStatusUpdated, mModel, &QSqlTableModel::select);
connect(mSearchWidget, &ScanSearchCriteriaForm::searchFilterUpdated, this, &ReconFormWidget::updateSearchFilter); connect(mSearchWidget, &ScanSearchCriteriaForm::searchFilterUpdated, this, &ReconFormWidget::updateSearchFilter);
connect(mSearchWidget, &ScanSearchCriteriaForm::refreshData, DeviceManager::Default(), &DeviceManager::updateReconState); connect(mSearchWidget, &ScanSearchCriteriaForm::refreshData, DeviceManager::Default(), &DeviceManager::updateReconState);
connect(mRefreshTimer, &QTimer::timeout, this, &ReconFormWidget::refreshTransferprogress);
connect(EventCenter::Default(), &EventCenter::AnonymousModeChanged, this, &ReconFormWidget::updateSearchFilter); connect(EventCenter::Default(), &EventCenter::AnonymousModeChanged, this, &ReconFormWidget::updateSearchFilter);
connect(EventCenter::Default(), &EventCenter::ReloadLanguage, this, &ReconFormWidget::reloadLanguage); connect(EventCenter::Default(), &EventCenter::ReloadLanguage, this, &ReconFormWidget::reloadLanguage);
} }
@@ -126,12 +123,10 @@ void ReconFormWidget::showEvent(QShowEvent *aEvent)
{ {
TabFormWidget::showEvent(aEvent); TabFormWidget::showEvent(aEvent);
DeviceManager::Default()->updateReconState(); DeviceManager::Default()->updateReconState();
mRefreshTimer->start(1000);
} }
void ReconFormWidget::hideEvent(QHideEvent *aEvent) void ReconFormWidget::hideEvent(QHideEvent *aEvent)
{ {
mRefreshTimer->stop();
TabFormWidget::hideEvent(aEvent); TabFormWidget::hideEvent(aEvent);
} }
@@ -140,14 +135,6 @@ int ReconFormWidget::getTableColumnIndex(const QString& aColumnName)
return mModel->record().indexOf(aColumnName); return mModel->record().indexOf(aColumnName);
} }
void ReconFormWidget::refreshTransferprogress()
{
if(DeviceManager::Default()->updateTransferProgress())
{
mScanTable->viewport()->update();
}
}
void ReconFormWidget::reloadLanguage() void ReconFormWidget::reloadLanguage()
{ {
mModel->setHeaderData(getTableColumnIndex("PatientID"), Qt::Horizontal, tr("Patient ID")); mModel->setHeaderData(getTableColumnIndex("PatientID"), Qt::Horizontal, tr("Patient ID"));

View File

@@ -24,7 +24,6 @@ protected:
private slots: private slots:
void updateSearchFilter(); void updateSearchFilter();
void refreshTransferprogress();
void reloadLanguage(); void reloadLanguage();
private: private:
@@ -34,7 +33,6 @@ private:
SlideTableView* mScanTable; SlideTableView* mScanTable;
ScanSearchCriteriaForm* mSearchWidget; ScanSearchCriteriaForm* mSearchWidget;
QSqlTableModel *mModel; QSqlTableModel *mModel;
QTimer* mRefreshTimer;
void initTableView(QHBoxLayout *contentLayout); void initTableView(QHBoxLayout *contentLayout);

View File

@@ -22,37 +22,7 @@ void ReconStateDelegate::paint(QPainter *painter, const QStyleOptionViewItem &op
switch (state) switch (state)
{ {
case 0: case 0:
displayText = tr("Wait to transfer"); displayText = tr("Scan completed");
break;
case 100:
{
displayText = tr("Transfering");
int progress = DeviceManager::Default()->getTransferProgress();
QRect textRect = option.rect;
textRect.setRight(option.rect.right() - 180);
painter->drawText(textRect, Qt::AlignCenter, displayText);
QRect progressBarRect = option.rect;
progressBarRect.setLeft(textRect.right() + 10);
progressBarRect.setRight(option.rect.right() - 5);
progressBarRect.setTop(option.rect.top() + 5);
progressBarRect.setBottom(option.rect.bottom() - 5);
QStyleOptionProgressBarV2 progressBarOption;
progressBarOption.rect = progressBarRect;
progressBarOption.minimum = 0;
progressBarOption.maximum = 100;
progressBarOption.progress = progress;
QApplication::style()->drawControl(QStyle::CE_ProgressBar, &progressBarOption, painter);
painter->restore();
return;
}
case 104:
displayText = tr("Transfer failed");
painter->setPen(QColor(Qt::red));
break;
case 200:
displayText = tr("Transfer completed");
break; break;
case 204: case 204:
displayText = tr("Recon create failed"); displayText = tr("Recon create failed");

View File

@@ -17,7 +17,6 @@ SystemCorrectionForm::SystemCorrectionForm(QWidget* aParent)
, mCurrentEmptyScanDate(new QLabel(this)) , mCurrentEmptyScanDate(new QLabel(this))
, mExpirationEmptyScanDate(new QLabel(this)) , mExpirationEmptyScanDate(new QLabel(this))
, mCurrentEmptyScanState(new QLabel(this)) , mCurrentEmptyScanState(new QLabel(this))
, mTimer(new QTimer(this))
, mEmptyScanState() , mEmptyScanState()
{ {
setObjectName("SystemCorrectionForm"); setObjectName("SystemCorrectionForm");
@@ -115,8 +114,6 @@ void SystemCorrectionForm::init()
LOG_USER_OPERATION("Start Empty Scan") LOG_USER_OPERATION("Start Empty Scan")
}); });
mTimer->setInterval(1000);
connect(mTimer, &QTimer::timeout, this, &SystemCorrectionForm::updateEmptyScanTransferProgress);
connect(EventCenter::Default(), &EventCenter::EmptyScanFinished, this, &SystemCorrectionForm::updateEmptyScanDate); connect(EventCenter::Default(), &EventCenter::EmptyScanFinished, this, &SystemCorrectionForm::updateEmptyScanDate);
connect(EventCenter::Default(), &EventCenter::EmptyScanDataStateUpdated, this, &SystemCorrectionForm::updateEmptyScanState); connect(EventCenter::Default(), &EventCenter::EmptyScanDataStateUpdated, this, &SystemCorrectionForm::updateEmptyScanState);
connect(EventCenter::Default(), &EventCenter::EmptyScanDataExpire, this, &SystemCorrectionForm::updateEmptyScanDateExpire); connect(EventCenter::Default(), &EventCenter::EmptyScanDataExpire, this, &SystemCorrectionForm::updateEmptyScanDateExpire);
@@ -138,26 +135,9 @@ void SystemCorrectionForm::updateEmptyScanDate()
void SystemCorrectionForm::updateEmptyScanState() void SystemCorrectionForm::updateEmptyScanState()
{ {
mEmptyScanState = SQLHelper::queryValue("SELECT State FROM EScan ORDER BY ScanDateTime DESC LIMIT 1").toInt(); mEmptyScanState = SQLHelper::queryValue("SELECT State FROM EScan ORDER BY ScanDateTime DESC LIMIT 1").toInt();
if(mEmptyScanState == 100 && !mTimer->isActive())
{
mTimer->start();
}
else if(mEmptyScanState != 100 && mTimer->isActive())
{
mTimer->stop();
}
mCurrentEmptyScanState->setText(tr("Current state for Empty Scanning %1").arg(getStateString(mEmptyScanState))); mCurrentEmptyScanState->setText(tr("Current state for Empty Scanning %1").arg(getStateString(mEmptyScanState)));
} }
void SystemCorrectionForm::updateEmptyScanTransferProgress()
{
if(DeviceManager::Default()->updateTransferProgress())
{
int progress = DeviceManager::Default()->getTransferProgress();
mCurrentEmptyScanState->setText(tr("Current state for Empty Scanning %1").arg(getStateString(mEmptyScanState) + QString::number(progress) + "%"));
}
}
void SystemCorrectionForm::updateEmptyScanBroked() void SystemCorrectionForm::updateEmptyScanBroked()
{ {
mEmptyScanState = -1; mEmptyScanState = -1;
@@ -176,10 +156,7 @@ QString SystemCorrectionForm::getStateString(int aState)
{ {
case -2: return QString("<font color='red'>&nbsp;&nbsp;%1</font>").arg(tr("Expired")); case -2: return QString("<font color='red'>&nbsp;&nbsp;%1</font>").arg(tr("Expired"));
case -1: return QString("<font color='red'>&nbsp;&nbsp;%1</font>").arg(tr("Broked")); case -1: return QString("<font color='red'>&nbsp;&nbsp;%1</font>").arg(tr("Broked"));
case 0: return tr("Wait To Transfer"); case 0: return tr("Scan completed");
case 100: return tr("Transferring");
case 104: return QString("<font color='red'>&nbsp;&nbsp;%1</font>").arg(tr("Transfer Failed"));
case 200: return tr("Transfer succeed");
case 204: return QString("<font color='red'>&nbsp;&nbsp;%1</font>").arg(tr("Recon Error")); case 204: return QString("<font color='red'>&nbsp;&nbsp;%1</font>").arg(tr("Recon Error"));
case 300: return tr("Normal"); case 300: return tr("Normal");
case 304: return QString("<font color='red'>&nbsp;&nbsp;%1</font>").arg(tr("Recon Error")); case 304: return QString("<font color='red'>&nbsp;&nbsp;%1</font>").arg(tr("Recon Error"));

View File

@@ -21,7 +21,6 @@ private:
private slots: private slots:
void updateEmptyScanDate(); void updateEmptyScanDate();
void updateEmptyScanState(); void updateEmptyScanState();
void updateEmptyScanTransferProgress();
void updateEmptyScanDateExpire(); void updateEmptyScanDateExpire();
void updateEmptyScanBroked(); void updateEmptyScanBroked();
@@ -29,7 +28,6 @@ private:
QLabel* mCurrentEmptyScanDate; QLabel* mCurrentEmptyScanDate;
QLabel* mExpirationEmptyScanDate; QLabel* mExpirationEmptyScanDate;
QLabel* mCurrentEmptyScanState; QLabel* mCurrentEmptyScanState;
QTimer* mTimer;
int mEmptyScanState; int mEmptyScanState;
}; };

View File

@@ -11,10 +11,6 @@
<source>?</source> <source>?</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Copyright © 2017-2022 Zhejiang Equilibrium Nine Medical Equipment Co., Ltd. All Rights Reversed</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<source>GUI Software V%1</source> <source>GUI Software V%1</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
@@ -67,6 +63,10 @@
<source>Reconstruction Software Loading...</source> <source>Reconstruction Software Loading...</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Copyright © 2017-2022 Zhejiang Equilibrium Nine Medical Equipment Co., Ltd. All Rights Reserved</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>AccessionInformation</name> <name>AccessionInformation</name>
@@ -313,10 +313,6 @@
</context> </context>
<context> <context>
<name>DeviceManager</name> <name>DeviceManager</name>
<message>
<source>Data is currently being transmitted, please shut down later.</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<source>Shut down failed, please push emergency button to shutdown.</source> <source>Shut down failed, please push emergency button to shutdown.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
@@ -383,10 +379,6 @@ progress:99%</source>
<source>Create scan data failed</source> <source>Create scan data failed</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Scan data transfer failed.</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<source>Device is not ready, start scan operation failed!</source> <source>Device is not ready, start scan operation failed!</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
@@ -403,10 +395,6 @@ progress:99%</source>
<source>Scan completed!</source> <source>Scan completed!</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Scan data transfer Succeeded!</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<source>Error: </source> <source>Error: </source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
@@ -1493,22 +1481,6 @@ The emergency button has been pushed. Please reset it before other operations.</
</context> </context>
<context> <context>
<name>ReconStateDelegate</name> <name>ReconStateDelegate</name>
<message>
<source>Wait to transfer</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Transfering</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Transfer failed</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Transfer completed</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<source>Recon create failed</source> <source>Recon create failed</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
@@ -1541,6 +1513,10 @@ The emergency button has been pushed. Please reset it before other operations.</
<source>Unknow</source> <source>Unknow</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Scan completed</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>ScanFormWidget</name> <name>ScanFormWidget</name>
@@ -1584,10 +1560,6 @@ The emergency button has been pushed. Please reset it before other operations.</
<source>Shut Down</source> <source>Shut Down</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Stop Scan Process</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<source>Left side scan initiated, auto positioning in progress.</source> <source>Left side scan initiated, auto positioning in progress.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
@@ -1604,6 +1576,10 @@ The emergency button has been pushed. Please reset it before other operations.</
<source>Data exporting, patient can leave the holder</source> <source>Data exporting, patient can leave the holder</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Waterflood</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>ScanSearchCriteriaForm</name> <name>ScanSearchCriteriaForm</name>
@@ -1913,18 +1889,6 @@ The emergency button has been pushed. Please reset it before other operations.</
<source>Broked</source> <source>Broked</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Wait To Transfer</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Transferring</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Transfer Failed</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<source>Recon Error</source> <source>Recon Error</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
@@ -1937,10 +1901,6 @@ The emergency button has been pushed. Please reset it before other operations.</
<source>Unknow</source> <source>Unknow</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Transfer succeed</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<source>Expired</source> <source>Expired</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
@@ -1949,6 +1909,10 @@ The emergency button has been pushed. Please reset it before other operations.</
<source>Current state for Empty Scanning %1</source> <source>Current state for Empty Scanning %1</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Scan completed</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>SystemSettingForm</name> <name>SystemSettingForm</name>

File diff suppressed because it is too large Load Diff