feat: Improve the prompt message for alarm dialog.

This commit is contained in:
sunwen
2024-09-23 15:12:33 +08:00
parent 3e5415e3d6
commit e8f3e7aaed
5 changed files with 218 additions and 39 deletions

View File

@@ -24,6 +24,7 @@
#include "dialogs/MultyMessageDialog.h"
#include "UsctStateManager.h"
#include "utilities/ScanProcessSequence.h"
#include "utilities/AlarmHelper.h"
#include "log/LogManager.h"
#define TRIGGER_EVENT EventCenter::Default()->triggerEvent
@@ -784,7 +785,7 @@ void DeviceManager::processAlarm(const QString& aAlarm)
{
QJsonObject jsonObj = toJsonObject(aAlarm);
int alarmCode = jsonObj["code"].toInt();
QString alarm = tr("Error: ") + QString::number(alarmCode);
QString alarm = tr("Error: ") + QString::number(alarmCode) + AlarmHelper::getAlarmString(alarmCode);
qDebug()<<"processAlarm : "<<alarmCode;
if(alarmCode >= 400 && alarmCode < 500)
{
@@ -879,7 +880,7 @@ bool DeviceManager::startFullScan(const QString& aPatientInfo)
int code = jsonObj["code"].toInt();
if(code != 0)
{
QString msg = tr("Start scan failed. Reason:%1").arg(jsonObj["info"].toString());
QString msg = tr("Start scan failed. Reason:%1").arg(jsonObj["info"].toString()) + AlarmHelper::getAlarmString(code);
LOG_SYS_OPERATION("Start full scan failed. " + msg);
THROW_ERROR(msg);
TRIGGER_EVENT(StopScanProcess, nullptr, nullptr);
@@ -1382,7 +1383,7 @@ bool DeviceManager::startAutoLocate()
}
emit startAutoLocateResult(false);
TRIGGER_EVENT(StopScanProcess, nullptr, nullptr);
QString errorMessage = tr("Start auto locate failed");
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;