adding guard for send command
This commit is contained in:
1 parent
579e7b8e84
commit
c613e83420
2 files changed
+6
-2
No files matched your search
@@ -82,8 +82,6 @@ target_include_directories(
|
||||
${EPICSSYS}/include/compiler/clang
|
||||
)
|
||||
|
||||
|
||||
|
||||
################################################################################
|
||||
## Frontend
|
||||
################################################################################
|
||||
|
||||
@@ -118,6 +118,12 @@ void powerSwitch::updateOutletNumber() {
|
||||
}
|
||||
|
||||
void powerSwitch::sendCommand(int index) {
|
||||
if (index < 0 || index >= (int)outlets.size()) {
|
||||
fMfe->Msg(MERROR, __FUNCTION__,
|
||||
"Command received for outlet %d but only %d outlet(s) ready",
|
||||
index, (int)outlets.size());
|
||||
return;
|
||||
}
|
||||
midas::odb o(this->equipmentPath);
|
||||
std::string command = o[COMMAND_PATH.c_str()][index];
|
||||
Outlet *outlet = &outlets.at(index);
|
||||
|
||||
Reference in new issue
Block a user