correcting init false start
This commit is contained in:
1 parent
c613e83420
commit
a9fe68d1b4
1 file changed
+4
-2
@@ -56,6 +56,8 @@ TMFeResult powerSwitch::HandleInit(const std::vector<std::string> &args) {
|
||||
midas::odb to_watch(this->equipmentPath + SLASH + VARIABLES_DIR + SLASH +
|
||||
COMMAND_VARNAME);
|
||||
|
||||
updateOutletNumber();
|
||||
|
||||
to_watch.watch(
|
||||
[&](midas::odb &arg) { this->sendCommand(arg.get_last_index()); });
|
||||
return TMFeOk();
|
||||
@@ -118,10 +120,10 @@ void powerSwitch::updateOutletNumber() {
|
||||
}
|
||||
|
||||
void powerSwitch::sendCommand(int index) {
|
||||
if (index < 0 || index >= (int)outlets.size()) {
|
||||
if (index < 0 || index >= static_cast<int>(outlets.size())) {
|
||||
fMfe->Msg(MERROR, __FUNCTION__,
|
||||
"Command received for outlet %d but only %d outlet(s) ready",
|
||||
index, (int)outlets.size());
|
||||
index, static_cast<int>(outlets.size()));
|
||||
return;
|
||||
}
|
||||
midas::odb o(this->equipmentPath);
|
||||
|
||||
Reference in new issue
Block a user