feat: Remove autolocate in scan process.

This commit is contained in:
sunwen
2025-02-08 15:14:46 +08:00
parent e48f429206
commit b2158943ec
3 changed files with 39 additions and 36 deletions

View File

@@ -1365,7 +1365,7 @@ void DeviceManager::stopScanProcess()
AppGlobalValues::setInProcessing(false);
mIsScanning = false;
LOG_SYS_OPERATION("Stop scan process.")
stopAutoLocate();
//stopAutoLocate();
}
bool DeviceManager::startAutoLocate()
@@ -1375,25 +1375,28 @@ bool DeviceManager::startAutoLocate()
TRIGGER_EVENT(StopScanProcess, nullptr, nullptr);
return false;
}
auto result = mStartAutoLocateAction->execute();
if(result.mIsSucessful)
{
mIsAutoLocating = true;
QJsonObject jsonObj = toJsonObject(result.mData);
if(jsonObj["code"].toInt() == 0 )
{
emit startAutoLocateResult(true);
mEffectivePositionCount = 0;
mGetAutoLocatePositionTimer = startTimer(1000);
return true;
}
}
emit startAutoLocateResult(false);
TRIGGER_EVENT(StopScanProcess, nullptr, nullptr);
QString errorMessage = tr("Start auto locate failed") + AlarmHelper::getAlarmString(toJsonObject(result.mData)["info"].toInt());
THROW_ERROR(errorMessage)
LOG_SYS_OPERATION("Start auto locate failed.")
return false;
emit startAutoLocateResult(true);
ScanProcessSequence::getInstance()->startFullScan();
return true;
// auto result = mStartAutoLocateAction->execute();
// if(result.mIsSucessful)
// {
// mIsAutoLocating = true;
// QJsonObject jsonObj = toJsonObject(result.mData);
// if(jsonObj["code"].toInt() == 0 )
// {
// emit startAutoLocateResult(true);
// mEffectivePositionCount = 0;
// mGetAutoLocatePositionTimer = startTimer(1000);
// return true;
// }
// }
// emit startAutoLocateResult(false);
// TRIGGER_EVENT(StopScanProcess, nullptr, nullptr);
// QString errorMessage = tr("Start auto locate failed") + AlarmHelper::getAlarmString(toJsonObject(result.mData)["info"].toInt());
// THROW_ERROR(errorMessage)
// LOG_SYS_OPERATION("Start auto locate failed.")
// return false;
}
void DeviceManager::stopAutoLocate()