Add handling of test-mode.
This commit is contained in:
parent
f2556412d8
commit
17eaa7858f
@ -83,6 +83,7 @@ Update::Update(hwinf *hw,
|
|||||||
QString update_ctrl_file,
|
QString update_ctrl_file,
|
||||||
QString workingDir,
|
QString workingDir,
|
||||||
bool maintenanceMode,
|
bool maintenanceMode,
|
||||||
|
bool testMode,
|
||||||
QObject *parent,
|
QObject *parent,
|
||||||
char const *serialInterface,
|
char const *serialInterface,
|
||||||
char const *baudrate)
|
char const *baudrate)
|
||||||
@ -94,8 +95,10 @@ Update::Update(hwinf *hw,
|
|||||||
, m_update_ctrl_file_copy(update_ctrl_file + ".copy")
|
, m_update_ctrl_file_copy(update_ctrl_file + ".copy")
|
||||||
, m_workingDir(workingDir)
|
, m_workingDir(workingDir)
|
||||||
, m_maintenanceMode(maintenanceMode)
|
, m_maintenanceMode(maintenanceMode)
|
||||||
|
, m_testMode(testMode)
|
||||||
, m_init(true) {
|
, m_init(true) {
|
||||||
|
|
||||||
|
if (!m_testMode) {
|
||||||
// make sure the files are empty
|
// make sure the files are empty
|
||||||
if (m_update_ctrl_file.exists()) {
|
if (m_update_ctrl_file.exists()) {
|
||||||
if (m_update_ctrl_file.open(QIODevice::ReadWrite |
|
if (m_update_ctrl_file.open(QIODevice::ReadWrite |
|
||||||
@ -119,12 +122,16 @@ Update::Update(hwinf *hw,
|
|||||||
<< "does not exist";
|
<< "does not exist";
|
||||||
m_init = false;
|
m_init = false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// execute update_psa-script
|
// execute update_psa-script
|
||||||
if (m_init) {
|
if (m_init) {
|
||||||
|
if (!m_testMode) {
|
||||||
if ((m_init = execUpdateScript()) == false) {
|
if ((m_init = execUpdateScript()) == false) {
|
||||||
qCritical() << "UPDATE_SCRIPT FAILED";
|
qCritical() << "UPDATE_SCRIPT FAILED";
|
||||||
} else {
|
}
|
||||||
|
}
|
||||||
|
if (m_init) {
|
||||||
if (!m_update_ctrl_file.open(QIODevice::ReadWrite | QIODevice::Text)) {
|
if (!m_update_ctrl_file.open(QIODevice::ReadWrite | QIODevice::Text)) {
|
||||||
qCritical() << "CAN NOT OPEN" << m_update_ctrl_file.fileName();
|
qCritical() << "CAN NOT OPEN" << m_update_ctrl_file.fileName();
|
||||||
m_init = false;
|
m_init = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user