feat: Remove auto locate in scan process and change prompt after scanning one side.

This commit is contained in:
sunwen
2024-09-23 10:08:53 +08:00
parent aecc6d6943
commit 37b67b99da
5 changed files with 272 additions and 255 deletions

View File

@@ -194,9 +194,9 @@ void CoordinateXYWidget::updateStopFlash()
void CoordinateXYWidget::startFlash() void CoordinateXYWidget::startFlash()
{ {
show(); show();
connect(mTimer,&QTimer::timeout,this, &CoordinateXYWidget::updateFlash); // connect(mTimer,&QTimer::timeout,this, &CoordinateXYWidget::updateFlash);
mStopGradientEnd = 1; // mStopGradientEnd = 1;
mTimer->start(20); // mTimer->start(20);
} }
void CoordinateXYWidget::stopFlash() void CoordinateXYWidget::stopFlash()

View File

@@ -34,6 +34,7 @@ CoordinateZWidget::CoordinateZWidget(QWidget* aParent)
connect(ScanProcessSequence::getInstance(), &ScanProcessSequence::quitAutoLocate, this, &CoordinateZWidget::quit); connect(ScanProcessSequence::getInstance(), &ScanProcessSequence::quitAutoLocate, this, &CoordinateZWidget::quit);
connect(ScanProcessSequence::getInstance(), &ScanProcessSequence::autoLocateZUpdated, this, &CoordinateZWidget::setBlinkPoint); connect(ScanProcessSequence::getInstance(), &ScanProcessSequence::autoLocateZUpdated, this, &CoordinateZWidget::setBlinkPoint);
hide(); hide();
mBlinkPoint.setY(204);
} }
void CoordinateZWidget::paintEvent(QPaintEvent* aEvent) void CoordinateZWidget::paintEvent(QPaintEvent* aEvent)
@@ -116,9 +117,9 @@ void CoordinateZWidget::setBlinkPoint(int aZ)
void CoordinateZWidget::startFlash() void CoordinateZWidget::startFlash()
{ {
show(); show();
connect(mTimer,&QTimer::timeout,this, &CoordinateZWidget::updateFlash); // connect(mTimer,&QTimer::timeout,this, &CoordinateZWidget::updateFlash);
mStopGradientEnd = 1; // mStopGradientEnd = 1;
mTimer->start(20); // mTimer->start(20);
} }
void CoordinateZWidget::stopFlash() void CoordinateZWidget::stopFlash()

View File

@@ -428,7 +428,8 @@ void DeviceManager::prepareFinishScan(bool isNormalFinish, const QString& aReaso
if(isCompleteNotify) if(isCompleteNotify)
{ {
QString msg = tr("Scan completed!"); QString msg = ScanProcessSequence::getInstance()->getScanPositionSize() == 2 ? tr("Scan completed! Please prepare for the next scan. \n"
"Click the confirm button after lying down.") : tr("Scan completed!") ;
TRIGGER_EVENT(InvokeOperationEnd, nullptr, (QObject *)&msg); TRIGGER_EVENT(InvokeOperationEnd, nullptr, (QObject *)&msg);
} }
else else
@@ -1321,7 +1322,7 @@ void DeviceManager::stopScanProcess()
AppGlobalValues::setInProcessing(false); AppGlobalValues::setInProcessing(false);
mIsScanning = false; mIsScanning = false;
LOG_SYS_OPERATION("Stop scan process.") LOG_SYS_OPERATION("Stop scan process.")
stopAutoLocate(); //stopAutoLocate();
} }
bool DeviceManager::startAutoLocate() bool DeviceManager::startAutoLocate()
@@ -1331,24 +1332,27 @@ bool DeviceManager::startAutoLocate()
TRIGGER_EVENT(StopScanProcess, nullptr, nullptr); TRIGGER_EVENT(StopScanProcess, nullptr, nullptr);
return false; return false;
} }
auto result = mStartAutoLocateAction->execute();
if(result.mIsSucessful)
{
mIsAutoLocating = true;
QJsonObject jsonObj = toJsonObject(result.mData);
if(jsonObj["code"].toInt() == 0 )
{
emit startAutoLocateResult(true); emit startAutoLocateResult(true);
mEffectivePositionCount = 0; emit autolocatePositionEffective();
mGetAutoLocatePositionTimer = startTimer(1000);
return true; return true;
} // auto result = mStartAutoLocateAction->execute();
} // if(result.mIsSucessful)
TRIGGER_EVENT(StopScanProcess, nullptr, nullptr); // {
QString errorMessage = tr("Start auto locate failed"); // mIsAutoLocating = true;
THROW_ERROR(errorMessage) // QJsonObject jsonObj = toJsonObject(result.mData);
LOG_SYS_OPERATION("Start auto locate failed.") // if(jsonObj["code"].toInt() == 0 )
return false; // {
// emit startAutoLocateResult(true);
// mEffectivePositionCount = 0;
// mGetAutoLocatePositionTimer = startTimer(1000);
// return true;
// }
// }
// TRIGGER_EVENT(StopScanProcess, nullptr, nullptr);
// QString errorMessage = tr("Start auto locate failed");
// THROW_ERROR(errorMessage)
// LOG_SYS_OPERATION("Start auto locate failed.")
// return false;
} }
void DeviceManager::stopAutoLocate() void DeviceManager::stopAutoLocate()

View File

@@ -370,6 +370,11 @@ progress:99%</source>
<source>Error: </source> <source>Error: </source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Scan completed! Please prepare for the next scan.
Click the confirm button after lying down.</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>DicomCfgDialog</name> <name>DicomCfgDialog</name>

File diff suppressed because it is too large Load Diff