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