37 Commits

Author SHA1 Message Date
052028afe8 Check if download/reporting thread are running 2024-02-29 11:30:24 +01:00
9b087f62f9 Check if json-file to be downloaded to device-controller is empty before
starting a download.
2024-02-17 08:04:06 +01:00
7d38cc1269 Set version to 2.0.0 2024-02-09 13:07:22 +01:00
f5baad16d5 Prepend last-commit with pid of ATBUpdateTool (to be used in ISMAS). 2024-02-09 13:02:35 +01:00
b35e6812aa getDCVersionPreparedForDownload(): implemented. 2024-02-09 13:02:11 +01:00
d7e709d997 Minor: make a 2-sec nap before starting reporting threadw 2024-02-09 13:01:15 +01:00
4d93aa1392 getDCVersionPreparedForDownload(): added for future use. 2024-02-09 12:59:25 +01:00
b0f1e0a493 Minor: reformatting code.w 2024-02-06 11:28:01 +01:00
0dffc1d1c2 Create m_update-object inside of constructor of worker-class:
this way the object belongs to the GUI-thread, and can be addressed via emit
by the reporting thread.
2024-02-06 11:25:46 +01:00
3581dd4b1d doUpdate(): start reorting thread to report download-progress to GUI. 2024-02-05 16:31:24 +01:00
8d2d7bbb15 Connect slots
void onReportDCDownloadStatus(QString const &status);
    void onReportDCDownloadSuccess(QString const &msg);
    void onReportDCDownloadFailure(QString const &errorMsg);
2024-02-05 16:30:41 +01:00
e2e7c0772d Implemented slots:
void onReportDCDownloadStatus(QString const &status);
    void onReportDCDownloadSuccess(QString const &msg);
    void onReportDCDownloadFailure(QString const &errorMsg);
2024-02-05 16:30:01 +01:00
807cea1042 Added slots:
void onReportDCDownloadStatus(QString const &status);
    void onReportDCDownloadSuccess(QString const &msg);
    void onReportDCDownloadFailure(QString const &errorMsg);
2024-02-05 16:28:34 +01:00
80712964ef Use of pointer m_update. 2024-02-05 16:26:53 +01:00
978e98b2ee removed dependency to interface.h 2024-02-05 14:53:56 +01:00
44c2820130 Make sure to lookup only "apism", not the new "apism-tools" 2024-02-02 08:18:13 +01:00
123f22cd21 add .gitignore file 2024-01-29 09:03:16 +01:00
b60af1a4fc Flowchart for ATBUpdateTool 1.4.0 2024-01-26 14:19:50 +01:00
bb3ecc4b76 Use same interfaces.h as DCLibraries (master branch) 2024-01-26 11:39:21 +01:00
fa30fe045b Minor: added interfaces.h 2024-01-26 11:38:43 +01:00
bae014822d Fix: set version info several times to reflect real current git commit 2024-01-26 11:17:06 +01:00
6c472b542e Merge remote-tracking branch 'origin/korneuburg-improvements' 2024-01-26 08:55:50 +01:00
7578746d2f make it explicit that no device-controller is loaded down with this version 2024-01-25 15:46:46 +01:00
0b1ed62df1 Optimization: if customer repository does not exist, do noy check the
ISMAS trigger, but proceed with the update procedure.
2024-01-25 15:14:42 +01:00
76ec41c291 Minor: add some comment. 2024-01-25 15:13:56 +01:00
630cd36f13 Minor: removed typo 2024-01-25 11:54:13 +01:00
cbe8bb7aeb Minor: add comment 2024-01-25 09:01:04 +01:00
e04636e3f7 Minor: add debug output 2024-01-24 13:07:39 +01:00
728185ddb9 Set
m_lastFailedUpdateStep = UPDATE_STEP::NONE
as last step in case of a successful update.
2024-01-24 08:31:22 +01:00
aaa485e2fc Send messages to ISMAS for checking/repairing the customer repository 2024-01-23 16:09:15 +01:00
854c8b9706 Minor: add some additional debug output 2024-01-10 09:58:37 +01:00
d521fd977a Using interface.h, verion 4.4, from 20230802. set version to v.1.3._25_ 2023-12-21 13:02:12 +01:00
ebbdc2f864 Use interface file from 20230802, version 4.4 2023-12-21 13:00:00 +01:00
62496c5d95 Prepare special version for szeged. set version to 1.3._24_ 2023-12-20 12:27:29 +01:00
edd606fe78 Change for szeged (dc-version: 4.42): do not check if dc is alive.
Comment out some functions which are not available in old interface.h
2023-12-20 12:20:06 +01:00
1748c35c45 Add interfaces.h as given for 26.Sep 2023 (szeged) 2023-12-20 12:18:02 +01:00
4c46932a3c Specail version for szeged (dc-version: 4.42): use master lib. 2023-12-20 12:16:07 +01:00
10 changed files with 549 additions and 137 deletions

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
tags
*.tags

View File

@@ -6,7 +6,7 @@ plugin-directory="/usr/lib/"
working-directory="/opt/app/tools/atbupdate/" working-directory="/opt/app/tools/atbupdate/"
[PLUGINS] [PLUGINS]
plugin-name="libCAslave.so" plugin-name="libCAmaster.so"
[FLAGS] [FLAGS]
no-psa-hardware-update=false no-psa-hardware-update=false

View File

@@ -95,12 +95,16 @@ DEFINES += QT_DEPRECATED_WARNINGS
# 1.4.0 : Start with version at 1.4.0 (mainly to see a difference with Szeged) # 1.4.0 : Start with version at 1.4.0 (mainly to see a difference with Szeged)
# Set hash-value in EVENT-objects. Set location (project), version # Set hash-value in EVENT-objects. Set location (project), version
# and info in send-last-version. # and info in send-last-version.
# Check the ISMAS update-trigger as very first step. # If the customer repository does not exist, then do not check the
# ISMAS trigger, but proceed with the update procedure. Otherwise,
# check the ISMAS update-trigger as first step.
# If the current time is between 0.00 - 4.00 o'clock, then a wrong # If the current time is between 0.00 - 4.00 o'clock, then a wrong
# trigger-value wil result in an UPDATE_STEP_NOT_NECESSARY. # trigger-value will result in an UPDATE_STEP_NOT_NECESSARY.
# Move final processing to subclass UpdateProcessRunning. # Move final processing to subclass UpdateProcessRunning.
VERSION="1.4.0" # Disable EXIT-button for the whole update-process, except for the
# checking of the ISMAS-trigger-button (aka WAIT-button).
# 2.0.0 Download device-controller using reporting-/download-thread.
VERSION="2.0.0"
# PLANNED TODOS: # PLANNED TODOS:
# 1: Das Repository wird repariert bwz. neu geklont. Unabhaengig vom WAIT. # 1: Das Repository wird repariert bwz. neu geklont. Unabhaengig vom WAIT.
# 2: Wenn der WAIT-Button aktiv ist, dann wird ein Repository repariert (neu # 2: Wenn der WAIT-Button aktiv ist, dann wird ein Repository repariert (neu
@@ -173,7 +177,10 @@ GIT_COMMIT=$$system("git log -1 --format=oneline | cut -d' ' -f1")
EXTENDED_VERSION="$${VERSION}-$${GIT_COMMIT}" EXTENDED_VERSION="$${VERSION}-$${GIT_COMMIT}"
INCLUDEPATH += plugins !contains(CONFIG, INCLUDEINTERFACES) {
INCLUDEINTERFACES=/opt/ptu5/opt/DCLibraries/include
}
INCLUDEPATH += plugins $${INCLUDEINTERFACES}
CONFIG += c++17 CONFIG += c++17
# CONFIG -= app_bundle # CONFIG -= app_bundle
@@ -246,8 +253,7 @@ HEADERS += \
process/command.h \ process/command.h \
message_handler.h \ message_handler.h \
worker.h \ worker.h \
commandline_parser.h \ commandline_parser.h
plugins/interfaces.h
OTHER_FILES += \ OTHER_FILES += \
ATBUpdateTool.ini ATBUpdateTool.ini

Binary file not shown.

99
interfaces.h Executable file → Normal file
View File

@@ -24,6 +24,7 @@ struct T_emp
// dynamic: // dynamic:
uint8_t state; // step counter of EMP (electronic coin checker) FSM (finite state machine): uint8_t state; // step counter of EMP (electronic coin checker) FSM (finite state machine):
/*
// 0=start command // 0=start command
// 1=powered, do emp ini, send reset // 1=powered, do emp ini, send reset
// 2=delay // 2=delay
@@ -39,7 +40,7 @@ struct T_emp
// 90: stop all, 1s delay // 90: stop all, 1s delay
// 99: off, all stopped // 99: off, all stopped
*/
uint8_t pollingRunning; uint8_t pollingRunning;
uint8_t paymentRunning; uint8_t paymentRunning;
@@ -238,6 +239,7 @@ struct T_dynamicCondition
uint8_t lastVDoorState; uint8_t lastVDoorState;
uint8_t lastCBstate; uint8_t lastCBstate;
char paymentInProgress; char paymentInProgress;
// Version Szeged: aug2023
// 0: stopped by timeout // 0: stopped by timeout
// 1: running 2: wait4lastCoin // 1: running 2: wait4lastCoin
// 3: payment stopped manually, coins in Escrow // 3: payment stopped manually, coins in Escrow
@@ -246,6 +248,21 @@ struct T_dynamicCondition
// 6: coins encashed 7:coins returned // 6: coins encashed 7:coins returned
// 8: CoinChecker or MDB on Error // 8: CoinChecker or MDB on Error
// since Schoenau with bill and changer, nov2023
//0 = no payment
//will be set to 1 by cash_startCollection()
//neu 1: wait for devices getting ready for payment
//2 = payment,
//3 = wait for last coin/bill
//4 = Bezahlvorgang manuell beendet
//5 = payment stopped autom, amount collected, coins in Escrow
//6 = Bezahlvorgang beendet weil ZK voll
//4,5,6: payment done, keep on polling, wait for cash or return command
//7 = encash collected money from coin escrow into cash box
//8 = return "amountToReturn", can be complete inserted amount or only overpayment
//9 = wait for changer result
//10= print refund receipt with "amountToReturn"
char res1; char res1;
uint16_t U_Batt; uint16_t U_Batt;
@@ -397,6 +414,7 @@ struct T_bna
}; };
class DownloadThread;
class hwinf class hwinf
{ {
@@ -2252,14 +2270,23 @@ public:
virtual void bna_requestCurrentNotes() const {} virtual void bna_requestCurrentNotes() const {}
// send command to DC in order to get transaction data // send command to DC in order to get transaction data
virtual uint8_t bna_getCurrentNotes(uint16_t latestBill, uint16_t *currentNotes) const { virtual uint8_t bna_getCurrentNotes(uint16_t latestBill, uint16_t *currentNotes) const
{
Q_UNUSED(latestBill); Q_UNUSED(latestBill);
Q_UNUSED(currentNotes); Q_UNUSED(currentNotes);
return 0; return 0;
} }
// returns number of collected bank notes since start-command (current transaction) // returns number of collected bank notes since start-command (current transaction)
// latestBill: last accepted bank note, value in cent // return value: numbers of bills or 99 in case of error
// currentNotes an array with up to 16 (further) notes collected // latestBill: not used
// in case of error: currentNotes[0,1,2,3] = 1..4 error number(s)
// in normal case:
// currentNotes[0]: last bill in cent (e.g. 1000 = 10€)
// currentNotes[1]: bin 1 = bill is still in escrow else bill is stacked
// note: by now (dec2023) escrow is not used, bills always go to stacker (box)
// currentNotes[2]: total sum of bills in cent, low word (16bit)
// currentNotes[3]: total sum of bills in cent, high word (16bit)
virtual void bna_requestStackerLevel() const {} virtual void bna_requestStackerLevel() const {}
@@ -2273,9 +2300,73 @@ public:
// countOfBills[1] for 10€ and so on // countOfBills[1] for 10€ and so on
// download device controller
virtual bool dcDownloadRequest(QString const &fileToDownload) const {
Q_UNUSED(fileToDownload);
return false;
}
virtual bool dcDownloadRequested() const { return false; }
virtual bool dcDownloadResetRequest() const { return false; }
virtual bool dcDownloadRequestAck() const { return false; }
virtual bool dcDownloadRunning() const { return false; }
virtual bool dcDownloadFinished() { return false; }
virtual bool dcDownloadReportStart() const { return false; }
virtual bool dcDownloadReportRunning() const { return true; }
virtual bool dcDownloadReportFinished() { return true; }
virtual bool dcDownloadThreadStart() { return false; }
virtual bool dcDownloadThreadRunning() const { return true; }
virtual void dcDownloadThreadFinalize(DownloadThread *) {}
virtual bool dcDownloadThreadFinished() const { return true; }
virtual bool dcDownloadReportThreadStart() { return false; }
virtual bool dcDownloadReportThreadRunning() const { return true; }
virtual void dcDownloadReportThreadFinalize() {}
virtual void dcDownloadReportThreadQuit() {}
virtual bool dcDownloadReportThreadFinished() const { return true; }
virtual QString dcDownloadFileName() const { return ""; }
virtual bool dcDownloadSetRequested(bool requested) {
Q_UNUSED(requested); return false;
}
virtual bool dcDownloadSetRunning(bool running) {
Q_UNUSED(running); return false;
}
virtual bool dcDownloadSetFinished(bool finished) {
Q_UNUSED(finished); return false;
}
virtual void dcDownloadSetTotalBlockNumber(uint16_t totalBlockNumber) {
Q_UNUSED(totalBlockNumber);
}
virtual void dcDownloadSetCurrentBlockNumber(uint16_t currentBlockNumber) {
Q_UNUSED(currentBlockNumber);
}
virtual bool dcDownloadGetRequested() const { return false; }
virtual bool dcDownloadGetRunning() const { return false; }
virtual bool dcDownloadGetFinished() const { return false; }
virtual uint16_t dcDownloadGetTotalBlockNumber() const { return 0; }
virtual uint16_t dcDownloadGetCurrentBlockNumber() const { return 0; }
virtual QObject const *getAPI() { return nullptr; }
signals: signals:
/*
NOTE: the difference between a virtual Qt signal and a normal Qt signal:
A Qt virtual signal is a connection that is established using a pointer
or reference and is not connected to an object or data. It is therefore
not bound to a particular object, but to a specific class (object type).
Qt virtual signals are useful because they allow you to create
connections without worrying about whether an object or a specific data
element has been destroyed.
https://www.youtube.com/watch?v=HTH3VFfqsXw
*/
virtual void hwapi_reportDCDownloadStatus(QString const&) const {}
virtual void hwapi_reportDCDownloadSuccess(QString const&) const {}
virtual void hwapi_reportDCDownloadFailure(QString const&) const {}
virtual void hwapi_templatePrintFinished_OK(void) const=0; virtual void hwapi_templatePrintFinished_OK(void) const=0;
virtual void hwapi_templatePrintFinished_Err(void) const=0; virtual void hwapi_templatePrintFinished_Err(void) const=0;

View File

@@ -24,6 +24,7 @@ struct T_emp
// dynamic: // dynamic:
uint8_t state; // step counter of EMP (electronic coin checker) FSM (finite state machine): uint8_t state; // step counter of EMP (electronic coin checker) FSM (finite state machine):
/*
// 0=start command // 0=start command
// 1=powered, do emp ini, send reset // 1=powered, do emp ini, send reset
// 2=delay // 2=delay
@@ -39,7 +40,7 @@ struct T_emp
// 90: stop all, 1s delay // 90: stop all, 1s delay
// 99: off, all stopped // 99: off, all stopped
*/
uint8_t pollingRunning; uint8_t pollingRunning;
uint8_t paymentRunning; uint8_t paymentRunning;
@@ -238,6 +239,7 @@ struct T_dynamicCondition
uint8_t lastVDoorState; uint8_t lastVDoorState;
uint8_t lastCBstate; uint8_t lastCBstate;
char paymentInProgress; char paymentInProgress;
// Version Szeged: aug2023
// 0: stopped by timeout // 0: stopped by timeout
// 1: running 2: wait4lastCoin // 1: running 2: wait4lastCoin
// 3: payment stopped manually, coins in Escrow // 3: payment stopped manually, coins in Escrow
@@ -246,6 +248,21 @@ struct T_dynamicCondition
// 6: coins encashed 7:coins returned // 6: coins encashed 7:coins returned
// 8: CoinChecker or MDB on Error // 8: CoinChecker or MDB on Error
// since Schoenau with bill and changer, nov2023
//0 = no payment
//will be set to 1 by cash_startCollection()
//neu 1: wait for devices getting ready for payment
//2 = payment,
//3 = wait for last coin/bill
//4 = Bezahlvorgang manuell beendet
//5 = payment stopped autom, amount collected, coins in Escrow
//6 = Bezahlvorgang beendet weil ZK voll
//4,5,6: payment done, keep on polling, wait for cash or return command
//7 = encash collected money from coin escrow into cash box
//8 = return "amountToReturn", can be complete inserted amount or only overpayment
//9 = wait for changer result
//10= print refund receipt with "amountToReturn"
char res1; char res1;
uint16_t U_Batt; uint16_t U_Batt;
@@ -397,6 +414,7 @@ struct T_bna
}; };
class DownloadThread;
class hwinf class hwinf
{ {
@@ -1834,6 +1852,9 @@ public:
virtual uint8_t prn_getPrintResult() const { virtual uint8_t prn_getPrintResult() const {
return 0; return 0;
} }
// return: 0: just printing, wait
// 1: OK - last print was succesful
// 2: error - not printed
@@ -2249,14 +2270,23 @@ public:
virtual void bna_requestCurrentNotes() const {} virtual void bna_requestCurrentNotes() const {}
// send command to DC in order to get transaction data // send command to DC in order to get transaction data
virtual uint8_t bna_getCurrentNotes(uint16_t latestBill, uint16_t *currentNotes) const { virtual uint8_t bna_getCurrentNotes(uint16_t latestBill, uint16_t *currentNotes) const
{
Q_UNUSED(latestBill); Q_UNUSED(latestBill);
Q_UNUSED(currentNotes); Q_UNUSED(currentNotes);
return 0; return 0;
} }
// returns number of collected bank notes since start-command (current transaction) // returns number of collected bank notes since start-command (current transaction)
// latestBill: last accepted bank note, value in cent // return value: numbers of bills or 99 in case of error
// currentNotes an array with up to 16 (further) notes collected // latestBill: not used
// in case of error: currentNotes[0,1,2,3] = 1..4 error number(s)
// in normal case:
// currentNotes[0]: last bill in cent (e.g. 1000 = 10€)
// currentNotes[1]: bin 1 = bill is still in escrow else bill is stacked
// note: by now (dec2023) escrow is not used, bills always go to stacker (box)
// currentNotes[2]: total sum of bills in cent, low word (16bit)
// currentNotes[3]: total sum of bills in cent, high word (16bit)
virtual void bna_requestStackerLevel() const {} virtual void bna_requestStackerLevel() const {}
@@ -2270,10 +2300,99 @@ public:
// countOfBills[1] for 10€ and so on // countOfBills[1] for 10€ and so on
// download device controller
virtual bool dcDownloadRequest(QString const &fileToDownload) const {
Q_UNUSED(fileToDownload);
return false;
}
virtual bool dcDownloadRequested() const { return false; }
virtual bool dcDownloadResetRequest() const { return false; }
virtual bool dcDownloadRequestAck() const { return false; }
virtual bool dcDownloadRunning() const { return false; }
virtual bool dcDownloadFinished() { return false; }
virtual bool dcDownloadReportStart() const { return false; }
virtual bool dcDownloadReportRunning() const { return true; }
virtual bool dcDownloadReportFinished() { return true; }
virtual bool dcDownloadThreadStart() { return false; }
virtual bool dcDownloadThreadRunning() const { return true; }
virtual void dcDownloadThreadFinalize(DownloadThread *) {}
virtual bool dcDownloadThreadFinished() const { return true; }
virtual bool dcDownloadReportThreadStart() { return false; }
virtual bool dcDownloadReportThreadRunning() const { return true; }
virtual void dcDownloadReportThreadFinalize() {}
virtual void dcDownloadReportThreadQuit() {}
virtual bool dcDownloadReportThreadFinished() const { return true; }
virtual QString dcDownloadFileName() const { return ""; }
virtual bool dcDownloadSetRequested(bool requested) {
Q_UNUSED(requested); return false;
}
virtual bool dcDownloadSetRunning(bool running) {
Q_UNUSED(running); return false;
}
virtual bool dcDownloadSetFinished(bool finished) {
Q_UNUSED(finished); return false;
}
virtual void dcDownloadSetTotalBlockNumber(uint16_t totalBlockNumber) {
Q_UNUSED(totalBlockNumber);
}
virtual void dcDownloadSetCurrentBlockNumber(uint16_t currentBlockNumber) {
Q_UNUSED(currentBlockNumber);
}
virtual bool dcDownloadGetRequested() const { return false; }
virtual bool dcDownloadGetRunning() const { return false; }
virtual bool dcDownloadGetFinished() const { return false; }
virtual uint16_t dcDownloadGetTotalBlockNumber() const { return 0; }
virtual uint16_t dcDownloadGetCurrentBlockNumber() const { return 0; }
virtual QObject const *getAPI() { return nullptr; }
signals: signals:
/*
NOTE: the difference between a virtual Qt signal and a normal Qt signal:
A Qt virtual signal is a connection that is established using a pointer
or reference and is not connected to an object or data. It is therefore
not bound to a particular object, but to a specific class (object type).
Qt virtual signals are useful because they allow you to create
connections without worrying about whether an object or a specific data
element has been destroyed.
https://www.youtube.com/watch?v=HTH3VFfqsXw
*/
virtual void hwapi_reportDCDownloadStatus(QString const&) const {}
virtual void hwapi_reportDCDownloadSuccess(QString const&) const {}
virtual void hwapi_reportDCDownloadFailure(QString const&) const {}
virtual void hwapi_templatePrintFinished_OK(void) const=0;
virtual void hwapi_templatePrintFinished_Err(void) const=0;
virtual void hwapi_coinCollectionJustStarted(void) const=0;
virtual void hwapi_coinCollectionAborted(void) const=0;
virtual void hwapi_gotNewCoin(void) const=0;
virtual void hwapi_payStopByMax(void) const=0;
virtual void hwapi_payStopByPushbutton(void) const=0;
virtual void hwapi_payStopByEscrow(void) const=0;
virtual void hwapi_payStopByError(void) const=0;
virtual void hwapi_payStopByTimeout(void) const=0;
virtual void hwapi_payCancelled(void) const=0;
virtual void hwapi_coinProcessJustStopped(void) const=0;
virtual void hwapi_doorServiceDoorOpened(void) const=0;
virtual void hwapi_doorVaultDoorOpened(void) const=0;
virtual void hwapi_doorCoinBoxRemoved(void) const=0;
virtual void hwapi_doorCoinBoxInserted(void) const=0;
virtual void hwapi_doorCBinAndAllDoorsClosed(void) const=0;
virtual void hwapi_doorAllDoorsClosed(void) const=0;
// NOTE: declaring a "pure virtual" "signal" should be an error and thus not valid. // NOTE: declaring a "pure virtual" "signal" should be an error and thus not valid.
/* GH Version, bringt Fehler
void hwapi_templatePrintFinished_OK() const; void hwapi_templatePrintFinished_OK() const;
void hwapi_templatePrintFinished_Err() const; void hwapi_templatePrintFinished_Err() const;
@@ -2296,6 +2415,7 @@ signals:
void hwapi_doorCoinBoxInserted() const; void hwapi_doorCoinBoxInserted() const;
void hwapi_doorCBinAndAllDoorsClosed() const; void hwapi_doorCBinAndAllDoorsClosed() const;
void hwapi_doorAllDoorsClosed() const; void hwapi_doorAllDoorsClosed() const;
*/
}; };

View File

@@ -98,6 +98,7 @@ bool Update::unloadDCPlugin() {
return false; return false;
} }
class hwapi;
Update::Update(Worker *worker, Update::Update(Worker *worker,
QString customerRepository, QString customerRepository,
QString customerNrStr, QString customerNrStr,
@@ -122,6 +123,9 @@ Update::Update(Worker *worker,
, m_dryRun(dryRun) , m_dryRun(dryRun)
, m_sys_areDCdataValid(false) { , m_sys_areDCdataValid(false) {
if (!m_hw) {
qCritical() << "(" << __func__ << ":" << __LINE__ << ") m_hw == nullptr -> ca-slave plugin loaded ???";
} else {
int tries = 20; int tries = 20;
while ((m_sys_areDCdataValid = m_hw->sys_areDCdataValid()) == false) { while ((m_sys_areDCdataValid = m_hw->sys_areDCdataValid()) == false) {
// must deliver 'true', only then are all data from hwapi valid // must deliver 'true', only then are all data from hwapi valid
@@ -133,20 +137,56 @@ Update::Update(Worker *worker,
QThread::msleep(500); QThread::msleep(500);
} }
qCritical() << __PRETTY_FUNCTION__ << "m_sys_areDCDataValid ..." << m_sys_areDCdataValid; qCritical() << "(" << __func__ << ":" << __LINE__ << ") m_sys_areDCDataValid ..."
<< m_sys_areDCdataValid;
//qInfo() << "UPDATE: m_serialInterface ..." << m_serialInterface; QObject const *obj = m_hw->getAPI();
//qInfo() << "UPDATE: m_baudrate ..." << m_baudrate; Q_ASSERT(obj != nullptr);
//qInfo() << "UPDATE: m_customerRepository ..." << m_customerRepository;
//qInfo() << "UPDATE: m_customerNr ..........." << m_customerNrStr; QDebug critical = qCritical();
//qInfo() << "UPDATE: m_branchName ..........." << m_branchName; critical << "connect() to onReportDCDownloadStatus() ...";
//qInfo() << "UPDATE: m_pluginName ..........." << m_pluginName; if (!connect(obj,
//qInfo() << "UPDATE: m_workingDirectory ....." << m_workingDir; SIGNAL(hwapi_reportDCDownloadStatus(QString const&)),
this,
SLOT(onReportDCDownloadStatus(QString const &)))) {
critical << "FAILED";
} else critical << "DONE";
critical = qCritical();
critical << "connect() to onReportDCDownloadSuccess() ...";
if (!connect(obj,
SIGNAL(hwapi_reportDCDownloadSuccess(QString const&)), this,
SLOT(onReportDCDownloadSuccess(QString const &)))) {
critical << "FAILED";
} else critical << "DONE";
critical = qCritical();
critical << "connect() to onReportDCDownloadFailure() ...";
if (!connect(obj,
SIGNAL(hwapi_reportDCDownloadFailure(QString const &)), this,
SLOT(onReportDCDownloadFailure(QString const &)))) {
critical << "FAILED";
} else critical << "DONE";
}
} }
Update::~Update() { Update::~Update() {
} }
void Update::onReportDCDownloadStatus(QString const &status) {
emit m_worker->showStatusMessage("DL", status);
}
void Update::onReportDCDownloadSuccess(QString const &msg) {
qCritical() << "msg" << msg;
}
void Update::onReportDCDownloadFailure(QString const &errorMsg) {
qCritical() << "msg" << errorMsg;
}
// br is a index into a table, used for historical reasons. // br is a index into a table, used for historical reasons.
bool Update::openSerial(int br, QString baudrate, QString comPort) const { bool Update::openSerial(int br, QString baudrate, QString comPort) const {
qDebug() << "opening serial" << br << baudrate << comPort << "..."; qDebug() << "opening serial" << br << baudrate << comPort << "...";
@@ -266,6 +306,7 @@ bool Update::updateBinary(QString const &fileToSendToDC) {
return false; return false;
#if 0
QFile fn(fileToSendToDC); QFile fn(fileToSendToDC);
if (!fn.exists()) { if (!fn.exists()) {
// output via CONSOLE() etc // output via CONSOLE() etc
@@ -334,6 +375,7 @@ bool Update::updateBinary(QString const &fileToSendToDC) {
} }
return true; return true;
#endif
} }
QString Update::jsonType(enum FileTypeJson type) { QString Update::jsonType(enum FileTypeJson type) {
@@ -372,7 +414,7 @@ bool Update::downloadJson(enum FileTypeJson type,
QFileInfo fi(jsFileToSendToDC); // max. size of template file is 800 bytes QFileInfo fi(jsFileToSendToDC); // max. size of template file is 800 bytes
if (file.exists()) { if (file.exists()) {
if (file.open(QIODevice::ReadOnly)) { if (file.open(QIODevice::ReadOnly)) {
if (fi.size() <= 800) { if (fi.size() > 0 && fi.size() <= 800) {
QByteArray ba = file.readAll(); QByteArray ba = file.readAll();
// kindOfFile: 1=config, 2=device, 3=cash, 4=serial, 5=time, 6=printer // kindOfFile: 1=config, 2=device, 3=cash, 4=serial, 5=time, 6=printer
// nrOfTemplate=1...32 if kindOfFile==6 // nrOfTemplate=1...32 if kindOfFile==6
@@ -561,7 +603,7 @@ bool Update::checkDownloadedJsonVersions(QStringList const& jsonFileNames) {
} }
if (jsonNr != 0) { if (jsonNr != 0) {
#if 0
m_hw->sys_requestJsonVersions(jsonNr); m_hw->sys_requestJsonVersions(jsonNr);
QThread::msleep(500); QThread::msleep(500);
@@ -579,6 +621,8 @@ bool Update::checkDownloadedJsonVersions(QStringList const& jsonFileNames) {
if (installedVersion == fileVersion) { if (installedVersion == fileVersion) {
} }
#endif
} else { } else {
qCritical() << "CANNOT FIND JSON-NR FOR" << jsonFileNames[i]; qCritical() << "CANNOT FIND JSON-NR FOR" << jsonFileNames[i];
} }
@@ -586,7 +630,6 @@ bool Update::checkDownloadedJsonVersions(QStringList const& jsonFileNames) {
return false; return false;
} }
bool Update::doUpdate(int &displayIndex, QStringList const &filesToWorkOn) { bool Update::doUpdate(int &displayIndex, QStringList const &filesToWorkOn) {
if (m_sys_areDCdataValid == false) { if (m_sys_areDCdataValid == false) {
qCritical() << "ERROR!!! DC DATA NOT VALID -> CA-MASTER-PLUGIN NOT CONNECTED"; qCritical() << "ERROR!!! DC DATA NOT VALID -> CA-MASTER-PLUGIN NOT CONNECTED";
@@ -594,17 +637,83 @@ bool Update::doUpdate(int &displayIndex, QStringList const &filesToWorkOn) {
} }
bool res = false; bool res = false;
bool dcDownloadPossible = true;
QList<QString>::const_iterator it; QList<QString>::const_iterator it;
for (it = filesToWorkOn.cbegin(); it != filesToWorkOn.cend(); ++it) { for (it = filesToWorkOn.cbegin(); it != filesToWorkOn.cend(); ++it) {
m_worker->startProgressLoop(); m_worker->startProgressLoop();
QString const &fToWorkOn = QDir::cleanPath(m_customerRepository + QDir::separator() + it->trimmed()); QString const &fToWorkOn = QDir::cleanPath(m_customerRepository + QDir::separator() + it->trimmed());
if (fToWorkOn.endsWith("/dc2c.bin") && dcDownloadPossible) {
// download for dc possible only once
// download of device-controller should always be the last step
dcDownloadPossible = false;
if (!m_hw->dcDownloadRequest(fToWorkOn)) { // initiate download process
qCritical() << "DOWNLOAD-REQUEST-ERROR FOR" << fToWorkOn;
continue;
}
QThread::sleep(2);
int tries = 5;
while (!m_hw->dcDownloadRunning()) { // may take some time
if (--tries < 0) {
qCritical() << QDateTime::currentDateTime().toString(Qt::ISODate)
<< "(" << __func__ << ":" << __LINE__ << ") DOWNLOAD NOT RUNNING";
break;
}
QThread::sleep(1);
continue;
}
qCritical() << QDateTime::currentDateTime().toString(Qt::ISODate)
<< "(" << __func__ << ":" << __LINE__ << ") DOWNLOAD RUNNING";
QThread::sleep(2);
tries = 5;
while (!m_hw->dcDownloadReportThreadStart()) { // may take some time
if (--tries < 0) {
qCritical() << QDateTime::currentDateTime().toString(Qt::ISODate)
<< "(" << __func__ << ":" << __LINE__ << ") REPORT THREAD NOT STARTED";
break;
}
continue;
}
qCritical() << QDateTime::currentDateTime().toString(Qt::ISODate)
<< "(" << __func__ << ":" << __LINE__ << ") REPORT THREAD STARTED";
QThread::sleep(2);
tries = 5;
while (!m_hw->dcDownloadReportRunning()) { // may take some time
if (--tries < 0) {
qCritical() << QDateTime::currentDateTime().toString(Qt::ISODate)
<< "(" << __func__ << ":" << __LINE__ << ") DOWNLOAD REPORT NOT RUNNING";
break;
}
continue;
}
qCritical() << QDateTime::currentDateTime().toString(Qt::ISODate)
<< "(" << __func__ << ":" << __LINE__ << ") DOWNLOAD REPORT RUNNING";
tries = 1200;
while (m_hw->dcDownloadReportRunning()) {
QThread::msleep(1000);
if (--tries < 0) {
qCritical() << QDateTime::currentDateTime().toString(Qt::ISODate)
<< "(" << __func__ << ":" << __LINE__
<< ") DOWNLOAD REPORT STILL RUNNING AFTER 20mins";
break;
}
}
if (fToWorkOn.contains("dc2c.bin")) {
bool updateBinaryRes = true; bool updateBinaryRes = true;
// CONSOLE() // CONSOLE()
#if 0
m_hw->dc_autoRequest(false);// default: turn auto-request setting off m_hw->dc_autoRequest(false);// default: turn auto-request setting off
QThread::sleep(1); // wait to be sure that there are no more QThread::sleep(1); // wait to be sure that there are no more
// commands sent to dc-hardware // commands sent to dc-hardware
@@ -633,11 +742,10 @@ bool Update::doUpdate(int &displayIndex, QStringList const &filesToWorkOn) {
qInfo() << "dc-firmware-version (NOT UPDATED)" << versions[1]; qInfo() << "dc-firmware-version (NOT UPDATED)" << versions[1];
} }
} }
#endif
res = updateBinaryRes; res = updateBinaryRes;
} else { } else if (fToWorkOn.contains("DC2C_print", Qt::CaseInsensitive)
if (fToWorkOn.contains("DC2C_print", Qt::CaseInsensitive)
&& fToWorkOn.endsWith(".json", Qt::CaseInsensitive)) { && fToWorkOn.endsWith(".json", Qt::CaseInsensitive)) {
res = true; res = true;
int i = fToWorkOn.indexOf("DC2C_print", Qt::CaseInsensitive); int i = fToWorkOn.indexOf("DC2C_print", Qt::CaseInsensitive);
@@ -691,7 +799,8 @@ bool Update::doUpdate(int &displayIndex, QStringList const &filesToWorkOn) {
qCritical() << "UNKNOWN JSON FILE NAME" << fToWorkOn; qCritical() << "UNKNOWN JSON FILE NAME" << fToWorkOn;
res = false; res = false;
} }
} // m_worker->stopProgressLoop();
// m_worker->setProgress(100);
if (res == false) { if (res == false) {
break; break;

View File

@@ -94,6 +94,8 @@ private slots:
void readyReadStandardOutput(); void readyReadStandardOutput();
void readyReadStandardError(); void readyReadStandardError();
void finished(int exitCode, QProcess::ExitStatus exitStatus); void finished(int exitCode, QProcess::ExitStatus exitStatus);
void onReportDCDownloadStatus(QString const &status);
void onReportDCDownloadSuccess(QString const &msg);
void onReportDCDownloadFailure(QString const &errorMsg);
}; };
#endif // UPDATE_H_INCLUDED #endif // UPDATE_H_INCLUDED

View File

@@ -165,8 +165,14 @@ Worker::Worker(int customerNr,
// TODO: turn object into singleton // TODO: turn object into singleton
instance = this; instance = this;
m_lastFailedUpdateStep = UPDATE_STEP::NONE; m_lastFailedUpdateStep = UPDATE_STEP::NONE;
m_update = new Update(this,
QDir::cleanPath(m_workingDirectory + QDir::separator() + m_customerNrStr),
m_customerNrStr,
m_branchName,
m_pluginDir,
m_pluginName,
m_workingDirectory);
this->setObjectName("worker-object"); this->setObjectName("worker-object");
QDir::setCurrent(m_workingDirectory); QDir::setCurrent(m_workingDirectory);
@@ -175,6 +181,10 @@ Worker::Worker(int customerNr,
} }
Worker::~Worker() { Worker::~Worker() {
if (m_update != nullptr) {
delete m_update;
m_update = nullptr;
}
} }
void Worker::displayProgressInMainWindow(int progress) { void Worker::displayProgressInMainWindow(int progress) {
@@ -272,22 +282,41 @@ void Worker::privateUpdate() {
m_ismasTriggerActive = false; m_ismasTriggerActive = false;
m_updateNotNecessary = false; m_updateNotNecessary = false;
QDateTime const &current = QDateTime::currentDateTime(); if (QDir(m_customerRepository).exists()) { // ignore a possibly corrupted repository
m_automaticUpdate = (current.time().hour() < 4);
m_ismasTriggerActive = updateTriggerSet(); m_ismasTriggerActive = updateTriggerSet();
if (m_ismasTriggerActive == false) { if (m_ismasTriggerActive == false) {
if (QDir(m_customerRepository).exists()) { // ignore a possibly corrupted repository QDateTime const &current = QDateTime::currentDateTime();
m_automaticUpdate = (current.time().hour() < 4);
m_versionInfo = m_gc.gitShowReason(m_branchName); m_versionInfo = m_gc.gitShowReason(m_branchName);
qCritical() << "***";
qCritical() << "privateUpdate ............. m_versionInfo:" << m_versionInfo;
qCritical() << "privateUpdate ......... m_automaticUpdate:" << m_automaticUpdate;
if (m_automaticUpdate) { // update has been triggered within [00:00:00, 00:03:59] if (m_automaticUpdate) { // update has been triggered within [00:00:00, 00:03:59]
m_updateNotNecessary = true; m_updateNotNecessary = true;
m_ismasTriggerStatusMessage = QStringList(QString("NO UPDATE NECESSARY (%1)").arg(current.toString(Qt::ISODate))); m_ismasTriggerStatusMessage = QStringList(QString("NO UPDATE NECESSARY (%1)").arg(current.toString(Qt::ISODate)));
qCritical() << "privateUpdate m_ismasTriggerStatusMessage:" << QStringList(QString("NO UPDATE NECESSARY (%1)").arg(current.toString(Qt::ISODate)));
qCritical() << "***";
// the customer-repository does exist, but the ISMAS-trigger is
// *NOT* "WAIT", but from 00:00:00 - 00:03:59 this counts as an
// automatic update
m_lastFailedUpdateStep = UPDATE_STEP::NONE; m_lastFailedUpdateStep = UPDATE_STEP::NONE;
return;
} }
qCritical() << "***";
// the customer-repository does exist, but the ISMAS-trigger is // the customer-repository does exist, but the ISMAS-trigger is
// *NOT* "WAIT", so STOP the update procedure // *NOT* "WAIT", so STOP the update procedure
return; return;
} }
// the customer-repository does exist, and the ISMAS-trigger is "WAIT",
// so continue the update procedure
} else {
// the customer-repository does not exist, so PROCEED with the // the customer-repository does not exist, so PROCEED with the
// update procedure, even if ISMAS-trigger is not correctly set ("WAIT") // update procedure, even if ISMAS-trigger is not correctly set ("WAIT")
} }
@@ -339,9 +368,7 @@ void Worker::privateUpdate() {
setProgress(i); // and switch to branch setProgress(i); // and switch to branch
if (m_gc.gitCloneAndCheckoutBranch()) { if (m_gc.gitCloneAndCheckoutBranch()) {
if (!isRepositoryCorrupted()) { if (!isRepositoryCorrupted()) {
if (m_versionInfo.size() == 0) {
m_versionInfo = m_gc.gitShowReason(m_branchName); m_versionInfo = m_gc.gitShowReason(m_branchName);
}
GUI() << (ISMAS() << (CONSOLE() << UPDATE_STEP::CLONE_REPOSITORY_SUCCESS)); GUI() << (ISMAS() << (CONSOLE() << UPDATE_STEP::CLONE_REPOSITORY_SUCCESS));
continueUpdate = true; continueUpdate = true;
m_clone = true; m_clone = true;
@@ -371,10 +398,7 @@ void Worker::privateUpdate() {
} }
} }
} }
if (m_versionInfo.size() == 0) {
m_versionInfo = m_gc.gitShowReason(m_branchName); m_versionInfo = m_gc.gitShowReason(m_branchName);
}
CONSOLE() << UPDATE_STEP::CHECK_REPOSITORY_SUCCESS; CONSOLE() << UPDATE_STEP::CHECK_REPOSITORY_SUCCESS;
setProgress(_CHECKOUT_REPOSITORY_SUCCESS); setProgress(_CHECKOUT_REPOSITORY_SUCCESS);
@@ -392,9 +416,6 @@ void Worker::privateUpdate() {
} }
} }
qCritical() << "**** m_ismasTriggerActive:" << m_ismasTriggerActive;
qCritical() << "**** m_clone:" << m_clone;
if (m_ismasTriggerActive == false) {// make it explicit again: only if the if (m_ismasTriggerActive == false) {// make it explicit again: only if the
// ismas trigger is active ('WAIT'), // ismas trigger is active ('WAIT'),
// then proceed // then proceed
@@ -413,11 +434,11 @@ void Worker::privateUpdate() {
if ((continueUpdate = customerEnvironment()) == false) { if ((continueUpdate = customerEnvironment()) == false) {
return; return;
} }
m_versionInfo = m_gc.gitShowReason(m_branchName);
lst = QStringList(QString(smap[UPDATE_STEP::CHECKOUT_BRANCH_SUCCESS])); lst = QStringList(QString(smap[UPDATE_STEP::CHECKOUT_BRANCH_SUCCESS]));
ISMAS(lst) << (CONSOLE(lst) << UPDATE_STEP::CHECKOUT_BRANCH); ISMAS(lst) << (CONSOLE(lst) << UPDATE_STEP::CHECKOUT_BRANCH);
setProgress(_CHECKOUT_BRANCH_SUCCESS); setProgress(_CHECKOUT_BRANCH_SUCCESS);
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
// //
// COMPUTE CHANGED FILES OF CUSTOMER REPOSITORY // COMPUTE CHANGED FILES OF CUSTOMER REPOSITORY
@@ -426,6 +447,7 @@ void Worker::privateUpdate() {
if ((continueUpdate = filesToUpdate()) == false) { if ((continueUpdate = filesToUpdate()) == false) {
return; return;
} }
m_versionInfo = m_gc.gitShowReason(m_branchName);
lst = QStringList(QString(smap[UPDATE_STEP::UPDATE_REPOSITORY_SUCCESS])); lst = QStringList(QString(smap[UPDATE_STEP::UPDATE_REPOSITORY_SUCCESS]));
ISMAS() << (GUI() << (CONSOLE() << UPDATE_STEP::UPDATE_REPOSITORY)); ISMAS() << (GUI() << (CONSOLE() << UPDATE_STEP::UPDATE_REPOSITORY));
setProgress(_UPDATE_REPOSITORY_SUCCESS); setProgress(_UPDATE_REPOSITORY_SUCCESS);
@@ -481,6 +503,7 @@ void Worker::privateUpdate() {
setProgress(_SAVE_LOGS_SUCCESS); setProgress(_SAVE_LOGS_SUCCESS);
// final messages: see destructor of UpdateProcessRunning subclass // final messages: see destructor of UpdateProcessRunning subclass
m_lastFailedUpdateStep = UPDATE_STEP::NONE;
} }
bool Worker::updateTriggerSet() { bool Worker::updateTriggerSet() {
@@ -739,7 +762,7 @@ bool Worker::filesToUpdate() {
} }
m_filesToUpdate.removeDuplicates(); m_filesToUpdate.removeDuplicates();
qCritical() << __PRETTY_FUNCTION__ << "FILES-TO-UPDATE" << m_filesToUpdate; qCritical() << "(" << __func__ << ":" << __LINE__ << ") FILES-TO-UPDATE" << m_filesToUpdate;
GUI(m_filesToUpdate) << (CONSOLE(m_filesToUpdate) << UPDATE_STEP::FILES_TO_UPDATE); GUI(m_filesToUpdate) << (CONSOLE(m_filesToUpdate) << UPDATE_STEP::FILES_TO_UPDATE);
setProgress(_FILES_TO_UPDATE); setProgress(_FILES_TO_UPDATE);
@@ -876,15 +899,7 @@ bool Worker::downloadFilesToPSAHardware() {
QStringList lst = m_filesToDownload; QStringList lst = m_filesToDownload;
ISMAS(lst) << (CONSOLE(lst) << UPDATE_STEP::FILES_TO_DOWNLOAD); ISMAS(lst) << (CONSOLE(lst) << UPDATE_STEP::FILES_TO_DOWNLOAD);
Update update(this, if (m_update && m_update->doUpdate(m_displayIndex, m_filesToDownload)) {
QDir::cleanPath(m_workingDirectory + QDir::separator() + m_customerNrStr),
m_customerNrStr,
m_branchName,
m_pluginDir,
m_pluginName,
m_workingDirectory);
if (update.doUpdate(m_displayIndex, m_filesToDownload)) {
// prepared for use: at the moment, the dc-library does not work // prepared for use: at the moment, the dc-library does not work
// as expected. // as expected.
@@ -1017,7 +1032,7 @@ QString Worker::getATBUpdateToolYoctoVersion() {
QString Worker::getAPISMYoctoVersion() { QString Worker::getAPISMYoctoVersion() {
if (QFile::exists("/var/lib/opkg/status")) { if (QFile::exists("/var/lib/opkg/status")) {
QString const cmd = QString("echo -n $(cat /var/lib/opkg/status | grep -A1 apism | tail -n 1 | cut -d':' -f2 | cut -d' ' -f2)"); QString const cmd = QString("echo -n $(cat /var/lib/opkg/status | grep -A1 -e apism[[:space:]]*$ | tail -n 1 | cut -d':' -f2 | cut -d' ' -f2)");
Command c("bash"); Command c("bash");
if (c.execute("/tmp", QStringList() << "-c" << cmd)) { if (c.execute("/tmp", QStringList() << "-c" << cmd)) {
return c.getCommandResult(); // 1.4.1.0-r4 return c.getCommandResult(); // 1.4.1.0-r4
@@ -1048,6 +1063,17 @@ QString Worker::getAPISMYoctoInstallationStatus() {
return "N/A"; return "N/A";
} }
QString Worker::getDCVersionPreparedForDownload(QString const &filename) {
if (QFile::exists(filename)) { // <customer-repo/etc/dc/dc2c.bin>
QString const cmd = QString("strings %1 | grep -e DC2[Cc]\\. | head -n1").arg(filename);
Command c("bash");
if (c.execute("/tmp", QStringList() << "-c" << cmd)) {
return c.getCommandResult(); // DC2c.04.42 14.09.2023
}
}
return "N/A";
}
QString Worker::getATBQTVersion() const { QString Worker::getATBQTVersion() const {
QString const cmd = QString("echo -n $(/opt/app/ATBAPP/ATBQT -v | head -n 2 | cut -d':' -f2)"); QString const cmd = QString("echo -n $(/opt/app/ATBAPP/ATBQT -v | head -n 2 | cut -d':' -f2)");
@@ -1170,7 +1196,11 @@ PSAInstalled Worker::getPSAInstalled() {
psaInstalled.versionInfo.created = "N/A"; psaInstalled.versionInfo.created = "N/A";
if (m_versionInfo.size() == 3) { if (m_versionInfo.size() == 3) {
psaInstalled.versionInfo.lastCommit = m_versionInfo.at(0); qCritical() << QString("***** %1:%2").arg(__func__).arg(__LINE__)
<< "m_versionInfo" << m_versionInfo << "*****";
psaInstalled.versionInfo.lastCommit = QString("%1-%2")
.arg(QCoreApplication::applicationPid())
.arg(m_versionInfo.at(0));
psaInstalled.versionInfo.reason = m_versionInfo.at(1); psaInstalled.versionInfo.reason = m_versionInfo.at(1);
psaInstalled.versionInfo.created = m_versionInfo.at(2); psaInstalled.versionInfo.created = m_versionInfo.at(2);
} }

View File

@@ -249,7 +249,6 @@ class Worker : public QThread{
<< UPDATE_STEP::SEND_LAST_VERSION)); << UPDATE_STEP::SEND_LAST_VERSION));
} }
m_worker->stopProgressLoop(); m_worker->stopProgressLoop();
m_worker->m_updateProcessRunning = false; m_worker->m_updateProcessRunning = false;
emit m_worker->enableExit(); emit m_worker->enableExit();
emit m_worker->restartExitTimer(); emit m_worker->restartExitTimer();
@@ -370,6 +369,7 @@ public:
static QString getATBUpdateToolYoctoInstallationStatus(); static QString getATBUpdateToolYoctoInstallationStatus();
static QString getAPISMYoctoVersion(); static QString getAPISMYoctoVersion();
static QString getAPISMYoctoInstallationStatus(); static QString getAPISMYoctoInstallationStatus();
static QString getDCVersionPreparedForDownload(QString const &filename);
static const QString UPDATE_STEP_OK; static const QString UPDATE_STEP_OK;
static const QString UPDATE_STEP_DONE; static const QString UPDATE_STEP_DONE;
@@ -714,21 +714,73 @@ private:
case UPDATE_STEP::CHECK_REPOSITORY: case UPDATE_STEP::CHECK_REPOSITORY:
ismasClient.setProgressInPercent(_CHECK_REPOSITORY); ismasClient.setProgressInPercent(_CHECK_REPOSITORY);
break; break;
case UPDATE_STEP::CHECK_REPOSITORY_SUCCESS: case UPDATE_STEP::CHECK_REPOSITORY_SUCCESS: {
ismasClient.setProgressInPercent(_CHECK_REPOSITORY_SUCCESS); ismasClient.setProgressInPercent(_CHECK_REPOSITORY_SUCCESS);
break; QString const &ismasUpdateNews =
case UPDATE_STEP::CHECK_REPOSITORY_FAILURE: QString("#M=APISM#C=CMD_EVENT#J=") +
ismasClient.updateNewsToIsmas(
"U0010",
_CHECKOUT_REPOSITORY_SUCCESS,
IsmasClient::RESULT_CODE::SUCCESS,
smap[UPDATE_STEP::CHECK_REPOSITORY],
QString("REPOSITORY %1 AND BRANCH %2 OK")
.arg(instance->m_customerRepository)
.arg(instance->m_gc.branchName()).toStdString().c_str(),
instance->m_versionInfo.size() >= 1 ? instance->m_versionInfo.at(0).toUtf8().constData() : "N/A");
ismasClient.sendRequestReceiveResponse(
IsmasClient::APISM::DB_PORT, ismasUpdateNews);
} break;
case UPDATE_STEP::CHECK_REPOSITORY_FAILURE: {
ismasClient.setProgressInPercent(_CHECK_REPOSITORY_FAILURE); ismasClient.setProgressInPercent(_CHECK_REPOSITORY_FAILURE);
break; QString const &ismasUpdateNews =
case UPDATE_STEP::CHECK_SANITY: QString("#M=APISM#C=CMD_EVENT#J=") +
ismasClient.updateNewsToIsmas(
"U0010",
_CHECKOUT_REPOSITORY_FAILURE,
IsmasClient::RESULT_CODE::INSTALL_ERROR,
smap[UPDATE_STEP::CHECKOUT_REPOSITORY],
QString("REPOSITORY %1 and BRANCH %2 ***NOT OK***")
.arg(instance->m_customerRepository)
.arg(instance->m_gc.branchName()).toStdString().c_str(),
instance->m_versionInfo.size() >= 1 ? instance->m_versionInfo.at(0).toUtf8().constData() : "N/A");
ismasClient.sendRequestReceiveResponse(
IsmasClient::APISM::DB_PORT, ismasUpdateNews);
} break;
case UPDATE_STEP::CHECK_SANITY: {
ismasClient.setProgressInPercent(_CHECK_SANITY); ismasClient.setProgressInPercent(_CHECK_SANITY);
break; } break;
case UPDATE_STEP::CHECK_SANITY_SUCCESS: case UPDATE_STEP::CHECK_SANITY_SUCCESS: {
ismasClient.setProgressInPercent(_CHECK_SANITY_SUCCESS); ismasClient.setProgressInPercent(_CHECK_SANITY_SUCCESS);
break; QString const &ismasUpdateNews =
case UPDATE_STEP::CHECK_SANITY_FAILURE: QString("#M=APISM#C=CMD_EVENT#J=") +
ismasClient.updateNewsToIsmas(
"U0010",
_CHECK_SANITY_SUCCESS,
IsmasClient::RESULT_CODE::SUCCESS,
smap[UPDATE_STEP::CHECK_SANITY],
QString("SANITY OF %1 (BRANCH %2) OK")
.arg(instance->m_customerRepository)
.arg(instance->m_gc.branchName()).toStdString().c_str(),
instance->m_versionInfo.size() >= 1 ? instance->m_versionInfo.at(0).toUtf8().constData() : "N/A");
ismasClient.sendRequestReceiveResponse(
IsmasClient::APISM::DB_PORT, ismasUpdateNews);
} break;
case UPDATE_STEP::CHECK_SANITY_FAILURE: {
ismasClient.setProgressInPercent(_CHECK_SANITY_FAILURE); ismasClient.setProgressInPercent(_CHECK_SANITY_FAILURE);
break; QString const &ismasUpdateNews =
QString("#M=APISM#C=CMD_EVENT#J=") +
ismasClient.updateNewsToIsmas(
"U0010",
_CHECK_SANITY_FAILURE,
IsmasClient::RESULT_CODE::INSTALL_ERROR,
smap[UPDATE_STEP::CHECK_SANITY],
QString("SANITY OF %1 and BRANCH %2 ***NOT*** OK")
.arg(instance->m_customerRepository)
.arg(instance->m_gc.branchName()).toStdString().c_str(),
instance->m_versionInfo.size() >= 1 ? instance->m_versionInfo.at(0).toUtf8().constData() : "N/A");
ismasClient.sendRequestReceiveResponse(
IsmasClient::APISM::DB_PORT, ismasUpdateNews);
} break;
case UPDATE_STEP::REPOSITORY_RECOVERED_SUCCESS: case UPDATE_STEP::REPOSITORY_RECOVERED_SUCCESS:
ismasClient.setProgressInPercent(_REPOSITORY_RECOVERED_SUCCESS); ismasClient.setProgressInPercent(_REPOSITORY_RECOVERED_SUCCESS);
break; break;