list of commands to execute
This commit is contained in:
32
UpdatePTUDevCtrl/work_process_list.cpp
Normal file
32
UpdatePTUDevCtrl/work_process_list.cpp
Normal file
@@ -0,0 +1,32 @@
|
||||
#include "work_process_list.h"
|
||||
#include "process/update_command.h"
|
||||
|
||||
#include <limits>
|
||||
#include <QDebug>
|
||||
|
||||
unsigned WorkList::nextExecIndex() const {
|
||||
if (m_workList.size() > 0 && m_workListIndex < (m_workList.size() - 1)) {
|
||||
return m_workListIndex + 1;
|
||||
}
|
||||
return std::numeric_limits<unsigned>::max();
|
||||
}
|
||||
|
||||
bool WorkList::nextExec() const {
|
||||
return m_workListIndex < m_workList.size();
|
||||
}
|
||||
|
||||
bool WorkList::exec(bool last) {
|
||||
if (last == false) {
|
||||
if (nextExec()) {
|
||||
m_workList[m_workListIndex]->start("/opt/app/tools/atbupdate");
|
||||
m_workListIndex += 1;
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
m_workList.back()->start("/opt/app/tools/atbupdate");
|
||||
m_workListIndex = std::numeric_limits<unsigned>::max();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
Reference in New Issue
Block a user