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

@@ -17,7 +17,6 @@ SystemCorrectionForm::SystemCorrectionForm(QWidget* aParent)
, mCurrentEmptyScanDate(new QLabel(this))
, mExpirationEmptyScanDate(new QLabel(this))
, mCurrentEmptyScanState(new QLabel(this))
, mTimer(new QTimer(this))
, mEmptyScanState()
{
setObjectName("SystemCorrectionForm");
@@ -115,8 +114,6 @@ void SystemCorrectionForm::init()
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::EmptyScanDataStateUpdated, this, &SystemCorrectionForm::updateEmptyScanState);
connect(EventCenter::Default(), &EventCenter::EmptyScanDataExpire, this, &SystemCorrectionForm::updateEmptyScanDateExpire);
@@ -138,26 +135,9 @@ void SystemCorrectionForm::updateEmptyScanDate()
void SystemCorrectionForm::updateEmptyScanState()
{
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)));
}
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()
{
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 -1: return QString("<font color='red'>&nbsp;&nbsp;%1</font>").arg(tr("Broked"));
case 0: return tr("Wait To Transfer");
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 0: return tr("Scan completed");
case 204: return QString("<font color='red'>&nbsp;&nbsp;%1</font>").arg(tr("Recon Error"));
case 300: return tr("Normal");
case 304: return QString("<font color='red'>&nbsp;&nbsp;%1</font>").arg(tr("Recon Error"));

View File

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