Set progress values.

This commit is contained in:
Gerhard Hoffmann 2023-08-11 10:59:26 +02:00
parent 746565dbe0
commit a8941f4ef4

View File

@ -535,8 +535,8 @@ bool Worker::updateTriggerSet() {
emit replaceLast("Update trigger set ...", UPDATE_STEP_FAIL); emit replaceLast("Update trigger set ...", UPDATE_STEP_FAIL);
return false; return false;
} }
progress += 1;
setProgress(progress + 1); setProgress(progress);
QJsonObject obj = document.object(); QJsonObject obj = document.object();
// sanity check: cust_nr and machine_nr of PSA correct ? // sanity check: cust_nr and machine_nr of PSA correct ?
@ -552,6 +552,7 @@ bool Worker::updateTriggerSet() {
int customerNr = c.toInt(-1); int customerNr = c.toInt(-1);
int machineNr = m.toInt(-1); int machineNr = m.toInt(-1);
if (customerNr != m_customerNr) { if (customerNr != m_customerNr) {
setProgress(100);
m_updateStatus = UpdateStatus(UPDATE_STATUS::ISMAS_WAIT_STATE_CHECK_FAILURE, m_updateStatus = UpdateStatus(UPDATE_STATUS::ISMAS_WAIT_STATE_CHECK_FAILURE,
QString("CUSTOMER-NR (%1) != LOCAL CUSTOMER-NR (%2)") QString("CUSTOMER-NR (%1) != LOCAL CUSTOMER-NR (%2)")
.arg(customerNr).arg(m_customerNr)); .arg(customerNr).arg(m_customerNr));
@ -617,8 +618,8 @@ bool Worker::updateTriggerSet() {
emit replaceLast("Update trigger set ...", UPDATE_STEP_FAIL); emit replaceLast("Update trigger set ...", UPDATE_STEP_FAIL);
return false; return false;
} }
progress += 1;
setProgress(progress + 1); setProgress(progress);
if (obj.contains("Fileupload")) { if (obj.contains("Fileupload")) {
QJsonValue v = obj.value("Fileupload"); QJsonValue v = obj.value("Fileupload");
@ -702,6 +703,8 @@ bool Worker::updateTriggerSet() {
} }
if (obj.contains("error")) { if (obj.contains("error")) {
progress += 1;
setProgress(progress);
QString value = obj.value("error").toString(); QString value = obj.value("error").toString();
emit showErrorMessage("check update trigger", QString("REPEAT %1 error=<").arg(repeat) + value + ">"); emit showErrorMessage("check update trigger", QString("REPEAT %1 error=<").arg(repeat) + value + ">");
qInfo() << "REPEAT" << repeat << "In updateTriggerSet() error=<" qInfo() << "REPEAT" << repeat << "In updateTriggerSet() error=<"
@ -710,6 +713,7 @@ bool Worker::updateTriggerSet() {
} else { } else {
stopProgressLoop(); stopProgressLoop();
int progress = (m_mainWindow->progressValue()/10) + 10; int progress = (m_mainWindow->progressValue()/10) + 10;
progress += 1;
setProgress(progress); setProgress(progress);
emit showErrorMessage("check update trigger", "no ISMAS response"); emit showErrorMessage("check update trigger", "no ISMAS response");
QThread::sleep(6); QThread::sleep(6);