Add m_sys_areDCdataValid plus its handling
This commit is contained in:
parent
9967d5cc45
commit
5577cc5d6d
62
update.cpp
62
update.cpp
@ -115,15 +115,28 @@ Update::Update(Worker *worker,
|
|||||||
, m_branchName(branchName)
|
, m_branchName(branchName)
|
||||||
, m_pluginName(pluginName)
|
, m_pluginName(pluginName)
|
||||||
, m_workingDir(workingDir)
|
, m_workingDir(workingDir)
|
||||||
, m_dryRun(dryRun) {
|
, m_dryRun(dryRun)
|
||||||
|
, m_sys_areDCdataValid(false) {
|
||||||
|
|
||||||
qInfo() << "UPDATE: m_serialInterface ..." << m_serialInterface;
|
int tries = 20;
|
||||||
qInfo() << "UPDATE: m_baudrate ..." << m_baudrate;
|
while ((m_sys_areDCdataValid = m_hw->sys_areDCdataValid()) == false) {
|
||||||
qInfo() << "UPDATE: m_customerRepository ..." << m_customerRepository;
|
// must deliver 'true', only then are all data from hwapi valid
|
||||||
qInfo() << "UPDATE: m_customerNr ..........." << m_customerNrStr;
|
if (--tries < 0) {
|
||||||
qInfo() << "UPDATE: m_branchName ..........." << m_branchName;
|
qCritical() << "ERROR!!! DC DATA NOT VALID -> CA-MASTER-PLUGIN NOT CONNECTED";
|
||||||
qInfo() << "UPDATE: m_pluginName ..........." << m_pluginName;
|
}
|
||||||
qInfo() << "UPDATE: m_workingDirectory ....." << m_workingDir;
|
m_hw->dc_autoRequest(true);
|
||||||
|
QThread::msleep(500);
|
||||||
|
}
|
||||||
|
|
||||||
|
qCritical() << "UPDATE: m_sys_areDCDataValid ..." << m_sys_areDCdataValid;
|
||||||
|
|
||||||
|
//qInfo() << "UPDATE: m_serialInterface ..." << m_serialInterface;
|
||||||
|
//qInfo() << "UPDATE: m_baudrate ..." << m_baudrate;
|
||||||
|
//qInfo() << "UPDATE: m_customerRepository ..." << m_customerRepository;
|
||||||
|
//qInfo() << "UPDATE: m_customerNr ..........." << m_customerNrStr;
|
||||||
|
//qInfo() << "UPDATE: m_branchName ..........." << m_branchName;
|
||||||
|
//qInfo() << "UPDATE: m_pluginName ..........." << m_pluginName;
|
||||||
|
//qInfo() << "UPDATE: m_workingDirectory ....." << m_workingDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
Update::~Update() {
|
Update::~Update() {
|
||||||
@ -363,23 +376,24 @@ bool Update::downloadJson(enum FileTypeJson type,
|
|||||||
templateIdx,
|
templateIdx,
|
||||||
(uint8_t *)ba.data())) {
|
(uint8_t *)ba.data())) {
|
||||||
|
|
||||||
QThread::msleep(1000);
|
m_hw->dc_autoRequest(true);
|
||||||
|
QThread::msleep(500);
|
||||||
|
|
||||||
// testing
|
// testing
|
||||||
//m_hw->request_ReadbackMachineID();
|
m_hw->request_ReadbackMachineID();
|
||||||
//QThread::msleep(500);
|
QThread::msleep(500);
|
||||||
|
|
||||||
//uint8_t data[64];
|
uint8_t data[64];
|
||||||
//memset(data, 0x00, sizeof(data));
|
memset(data, 0x00, sizeof(data));
|
||||||
//uint8_t length = 0;
|
uint8_t length = 0;
|
||||||
|
|
||||||
//m_hw->readback_machineIDdata(&length, data);
|
m_hw->readback_machineIDdata(&length, data);
|
||||||
|
|
||||||
//QThread::msleep(500);
|
QThread::msleep(500);
|
||||||
|
|
||||||
//QByteArray ba((const char*)data, length);
|
QByteArray ba((const char*)data, length);
|
||||||
|
|
||||||
//qCritical() << length << "MACHINE ID =" << ba.toHex(':');
|
qCritical() << length << "MACHINE ID =" << ba.toHex(':');
|
||||||
|
|
||||||
ret = true;
|
ret = true;
|
||||||
}
|
}
|
||||||
@ -481,15 +495,9 @@ QStringList Update::getDcSoftAndHardWareVersion() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool Update::doUpdate(int &displayIndex, QStringList const &filesToWorkOn) {
|
bool Update::doUpdate(int &displayIndex, QStringList const &filesToWorkOn) {
|
||||||
int tries = 20;
|
if (m_sys_areDCdataValid == false) {
|
||||||
while (!m_hw->sys_areDCdataValid()) { // must deliver 'true', only then are all
|
qCritical() << "ERROR!!! DC DATA NOT VALID -> CA-MASTER-PLUGIN NOT CONNECTED";
|
||||||
// data from hwapi valid
|
return false;
|
||||||
if (--tries < 0) {
|
|
||||||
qCritical() << "ERROR!!! DC DATA NOT VALID -> CA-MASTER-PLUGIN NOT CONNECTED";
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
m_hw->dc_autoRequest(true);
|
|
||||||
QThread::msleep(500);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool res = false;
|
bool res = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user