Compare commits
11 Commits
e20ed57bd5
...
v1.3.20
Author | SHA1 | Date | |
---|---|---|---|
d2e11d8f07 | |||
fbffdc923f | |||
8faf5af2bf | |||
1d532c13a4 | |||
d2d3afc28e | |||
f4bb201633 | |||
b68cf1fd1d | |||
0888c1b525 | |||
a6faf9ce21 | |||
5577cc5d6d | |||
9967d5cc45 |
@@ -63,8 +63,9 @@ DEFINES += QT_DEPRECATED_WARNINGS
|
|||||||
# 1.3.17: Add ATBUpdateTool.ini and custom command line parser. Settings
|
# 1.3.17: Add ATBUpdateTool.ini and custom command line parser. Settings
|
||||||
# given in ATBUpdateTool.ini can be overwritten on the command-line.
|
# given in ATBUpdateTool.ini can be overwritten on the command-line.
|
||||||
# 1.3.18: Bug fixes found during testing.
|
# 1.3.18: Bug fixes found during testing.
|
||||||
VERSION="1.3.19"
|
|
||||||
# 1.3.19: Bug fixes found during testing.
|
# 1.3.19: Bug fixes found during testing.
|
||||||
|
VERSION="1.3.20"
|
||||||
|
# 1.3.20: Bug fixes found during testing.
|
||||||
|
|
||||||
# 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.
|
||||||
@@ -91,7 +92,10 @@ VERSION="1.3.19"
|
|||||||
# es so arrangieren, dass der DC plus die Json-files im Repository immer
|
# es so arrangieren, dass der DC plus die Json-files im Repository immer
|
||||||
# runtergeladen werden, obwohl sich im Repository gar nicts veraendert
|
# runtergeladen werden, obwohl sich im Repository gar nicts veraendert
|
||||||
# hat. Eeventuell nuetzlich beim initialen Setuo eines PSA.
|
# hat. Eeventuell nuetzlich beim initialen Setuo eines PSA.
|
||||||
|
# 9: Das Kunden-Repository sollte immer gezogen werden, unabhaengig von der
|
||||||
|
# Stellung des WAIT-Button. Grund: es koennte sein, dass andernfalls ein
|
||||||
|
# PSA weit hiter anderen steht, und dann ploetzlich einmal alle vorher-
|
||||||
|
# gehenden Aenderungen anzieht, die gar nicht fuer ihn gemeint waren.
|
||||||
|
|
||||||
|
|
||||||
win32 {
|
win32 {
|
||||||
|
14
main.cpp
14
main.cpp
@@ -85,6 +85,12 @@ int main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
QString const rtPath = QCoreApplication::applicationDirPath();
|
QString const rtPath = QCoreApplication::applicationDirPath();
|
||||||
|
|
||||||
|
int const machineNr = Utils::read1stLineOfFile("/mnt/system_data/machine_nr");
|
||||||
|
int const customerNr = Utils::read1stLineOfFile("/mnt/system_data/cust_nr");
|
||||||
|
int const zoneNr = Utils::read1stLineOfFile("/mnt/system_data/zone_nr");
|
||||||
|
QString const branchName = (zoneNr != 0)
|
||||||
|
? QString("zg1/zone%1").arg(zoneNr) : "master";
|
||||||
|
|
||||||
qInfo() << "pwd ......................" << rtPath;
|
qInfo() << "pwd ......................" << rtPath;
|
||||||
qInfo() << "repositoryUrl ............" << repositoryUrl;
|
qInfo() << "repositoryUrl ............" << repositoryUrl;
|
||||||
qInfo() << "plugInDir ................" << plugInDir;
|
qInfo() << "plugInDir ................" << plugInDir;
|
||||||
@@ -99,6 +105,9 @@ int main(int argc, char *argv[]) {
|
|||||||
qInfo() << "showExtendedVersion ......" << showExtendedVersion;
|
qInfo() << "showExtendedVersion ......" << showExtendedVersion;
|
||||||
qInfo() << "iniFileName .............." << iniFileName;
|
qInfo() << "iniFileName .............." << iniFileName;
|
||||||
qInfo() << "extended-version ........." << APP_EXTENDED_VERSION;
|
qInfo() << "extended-version ........." << APP_EXTENDED_VERSION;
|
||||||
|
qInfo() << "machineNr ................" << machineNr;
|
||||||
|
qInfo() << "customerNr ..............." << customerNr;
|
||||||
|
qInfo() << "zoneNr ..................." << zoneNr;
|
||||||
|
|
||||||
if (showExtendedVersion) {
|
if (showExtendedVersion) {
|
||||||
printf(APP_EXTENDED_VERSION"\n");
|
printf(APP_EXTENDED_VERSION"\n");
|
||||||
@@ -113,11 +122,6 @@ int main(int argc, char *argv[]) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int machineNr = Utils::read1stLineOfFile("/etc/machine_nr");
|
|
||||||
int customerNr = Utils::read1stLineOfFile("/etc/cust_nr");
|
|
||||||
int zoneNr = Utils::read1stLineOfFile("/etc/zone_nr");
|
|
||||||
QString const branchName = (zoneNr != 0)
|
|
||||||
? QString("zg1/zone%1").arg(zoneNr) : "master";
|
|
||||||
|
|
||||||
QThread::currentThread()->setObjectName("main thread");
|
QThread::currentThread()->setObjectName("main thread");
|
||||||
qInfo() << "Main thread" << QThread::currentThreadId();
|
qInfo() << "Main thread" << QThread::currentThreadId();
|
||||||
|
@@ -208,13 +208,12 @@ void MainWindow::onAppendText(QString text, QString suffix) {
|
|||||||
// Utils::printLineEditInfo(editText.split('\n', QString::SplitBehavior::SkipEmptyParts));
|
// Utils::printLineEditInfo(editText.split('\n', QString::SplitBehavior::SkipEmptyParts));
|
||||||
// ui->updateStatus->setText(editText.trimmed());
|
// ui->updateStatus->setText(editText.trimmed());
|
||||||
|
|
||||||
// scrollDownTextEdit();
|
scrollDownTextEdit();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::onReplaceLast(QStringList newTextLines, QString suffix) {
|
void MainWindow::onReplaceLast(QStringList newTextLines, QString suffix) {
|
||||||
// Utils::printInfoMsg(QString("ON REPLACE LAST (LIST) CALLED AT ")
|
// Utils::printInfoMsg(QString("ON REPLACE LAST (LIST) CALLED AT ")
|
||||||
// + QDateTime::currentDateTime().toString(Qt::ISODateWithMs));
|
// + QDateTime::currentDateTime().toString(Qt::ISODateWithMs));
|
||||||
|
|
||||||
int const s = newTextLines.size();
|
int const s = newTextLines.size();
|
||||||
if (s > 0) {
|
if (s > 0) {
|
||||||
QString editText = ui->updateStatus->toPlainText();
|
QString editText = ui->updateStatus->toPlainText();
|
||||||
@@ -249,11 +248,15 @@ void MainWindow::onReplaceLast(QStringList newTextLines, QString suffix) {
|
|||||||
void MainWindow::onReplaceLast(QString text, QString suffix) {
|
void MainWindow::onReplaceLast(QString text, QString suffix) {
|
||||||
// Utils::printInfoMsg(QString("ON REPLACE LAST (TEXT) CALLED AT ")
|
// Utils::printInfoMsg(QString("ON REPLACE LAST (TEXT) CALLED AT ")
|
||||||
// + QDateTime::currentDateTime().toString(Qt::ISODateWithMs));
|
// + QDateTime::currentDateTime().toString(Qt::ISODateWithMs));
|
||||||
|
|
||||||
QString editText = ui->updateStatus->toPlainText();
|
QString editText = ui->updateStatus->toPlainText();
|
||||||
QStringList lines = editText.split('\n', QString::SplitBehavior::SkipEmptyParts);
|
QStringList lines = editText.split('\n', QString::SplitBehavior::SkipEmptyParts);
|
||||||
if (lines.size() > 0) {
|
if (lines.size() > 0) {
|
||||||
lines.removeLast();
|
// removing the last line is really meant for refreshing the last line
|
||||||
|
// with a string very similar than the original one, typically only
|
||||||
|
// followed by a suffix.
|
||||||
|
if (lines.last().contains(text)) {
|
||||||
|
lines.removeLast();
|
||||||
|
}
|
||||||
if (!suffix.isNull() && suffix.size() > 0 && suffix != "\n") {
|
if (!suffix.isNull() && suffix.size() > 0 && suffix != "\n") {
|
||||||
QString const add = text.leftJustified(m_width-10) + suffix;
|
QString const add = text.leftJustified(m_width-10) + suffix;
|
||||||
if (!add.isEmpty()) {
|
if (!add.isEmpty()) {
|
||||||
|
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;
|
||||||
|
1
update.h
1
update.h
@@ -32,6 +32,7 @@ class Update : public QObject {
|
|||||||
QString m_workingDir;
|
QString m_workingDir;
|
||||||
bool m_maintenanceMode;
|
bool m_maintenanceMode;
|
||||||
bool m_dryRun;
|
bool m_dryRun;
|
||||||
|
bool m_sys_areDCdataValid;
|
||||||
|
|
||||||
static QPluginLoader pluginLoader;
|
static QPluginLoader pluginLoader;
|
||||||
|
|
||||||
|
@@ -457,7 +457,7 @@ bool Worker::updateTriggerSet() {
|
|||||||
|
|
||||||
GUI() << (ISMAS() << (CONSOLE() << UPDATE_STEP::CHECK_ISMAS_TRIGGER));
|
GUI() << (ISMAS() << (CONSOLE() << UPDATE_STEP::CHECK_ISMAS_TRIGGER));
|
||||||
|
|
||||||
QString triggerValue("");
|
QString triggerValue("NOT CHECKED YET");
|
||||||
|
|
||||||
for (int repeat = 1; repeat <= 100; ++repeat) {
|
for (int repeat = 1; repeat <= 100; ++repeat) {
|
||||||
|
|
||||||
@@ -682,6 +682,9 @@ bool Worker::filesToUpdate() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
m_filesToUpdate.removeDuplicates();
|
m_filesToUpdate.removeDuplicates();
|
||||||
|
|
||||||
|
qCritical() << __PRETTY_FUNCTION__ << "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);
|
||||||
} else {
|
} else {
|
||||||
@@ -809,7 +812,7 @@ bool Worker::execOpkgCommands() {
|
|||||||
bool Worker::downloadFilesToPSAHardware() {
|
bool Worker::downloadFilesToPSAHardware() {
|
||||||
m_displayIndex = 0;
|
m_displayIndex = 0;
|
||||||
|
|
||||||
GUI(m_filesToUpdate) << (CONSOLE(m_filesToUpdate) << UPDATE_STEP::DOWNLOAD_FILES_TO_PSA_HARDWARE);
|
GUI(m_filesToDownload) << (CONSOLE(m_filesToDownload) << UPDATE_STEP::DOWNLOAD_FILES_TO_PSA_HARDWARE);
|
||||||
setProgress(_DOWNLOAD_FILES_TO_PSA_HARDWARE);
|
setProgress(_DOWNLOAD_FILES_TO_PSA_HARDWARE);
|
||||||
|
|
||||||
if (m_noUpdatePsaHardware == false) {
|
if (m_noUpdatePsaHardware == false) {
|
||||||
|
9
worker.h
9
worker.h
@@ -520,8 +520,10 @@ private:
|
|||||||
break;
|
break;
|
||||||
case UPDATE_STEP::CHECK_FOR_REPOSITORY_CHANGES_FAILURE:
|
case UPDATE_STEP::CHECK_FOR_REPOSITORY_CHANGES_FAILURE:
|
||||||
break;
|
break;
|
||||||
case UPDATE_STEP::FILES_TO_UPDATE:
|
case UPDATE_STEP::FILES_TO_UPDATE: {
|
||||||
break;
|
lst << instance->m_debugMsg;
|
||||||
|
Utils::printUpdateStatusMsg(debug, lst);
|
||||||
|
} break;
|
||||||
case UPDATE_STEP::DOWNLOAD_FILES_TO_PSA_HARDWARE: {
|
case UPDATE_STEP::DOWNLOAD_FILES_TO_PSA_HARDWARE: {
|
||||||
lst << instance->m_debugMsg;
|
lst << instance->m_debugMsg;
|
||||||
Utils::printUpdateStatusMsg(debug, lst);
|
Utils::printUpdateStatusMsg(debug, lst);
|
||||||
@@ -1173,7 +1175,8 @@ private:
|
|||||||
for (int i = 0; i < size; ++i) {
|
for (int i = 0; i < size; ++i) {
|
||||||
emit worker->appendText(QString("\n ") + worker->m_filesToUpdate.at(i));
|
emit worker->appendText(QString("\n ") + worker->m_filesToUpdate.at(i));
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
if (size == 1) {
|
||||||
emit worker->appendText("Found 1 file to update :", UPDATE_STEP_DONE);
|
emit worker->appendText("Found 1 file to update :", UPDATE_STEP_DONE);
|
||||||
emit worker->appendText(QString("\n ") + worker->m_filesToUpdate.at(0));
|
emit worker->appendText(QString("\n ") + worker->m_filesToUpdate.at(0));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user