SubsystemBase: Add function to update child modes
This commit is contained in:
parent
fe41d73895
commit
a6d707a7db
@ -117,6 +117,20 @@ ReturnValue_t SubsystemBase::updateChildMode(MessageQueueId_t queue, Mode_t mode
|
|||||||
return CHILD_NOT_FOUND;
|
return CHILD_NOT_FOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ReturnValue_t SubsystemBase::updateChildModeByObjId(object_id_t objectId, Mode_t mode,
|
||||||
|
Submode_t submode) {
|
||||||
|
std::map<object_id_t, ChildInfo>::iterator iter;
|
||||||
|
|
||||||
|
for (iter = childrenMap.begin(); iter != childrenMap.end(); iter++) {
|
||||||
|
if (iter->first == objectId) {
|
||||||
|
iter->second.mode = mode;
|
||||||
|
iter->second.submode = submode;
|
||||||
|
return returnvalue::OK;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return CHILD_NOT_FOUND;
|
||||||
|
}
|
||||||
|
|
||||||
ReturnValue_t SubsystemBase::updateChildChangedHealth(MessageQueueId_t queue, bool changedHealth) {
|
ReturnValue_t SubsystemBase::updateChildChangedHealth(MessageQueueId_t queue, bool changedHealth) {
|
||||||
for (auto iter = childrenMap.begin(); iter != childrenMap.end(); iter++) {
|
for (auto iter = childrenMap.begin(); iter != childrenMap.end(); iter++) {
|
||||||
if (iter->second.commandQueue == queue) {
|
if (iter->second.commandQueue == queue) {
|
||||||
|
@ -115,6 +115,7 @@ class SubsystemBase : public SystemObject,
|
|||||||
Submode_t targetSubmode = SUBMODE_NONE);
|
Submode_t targetSubmode = SUBMODE_NONE);
|
||||||
|
|
||||||
ReturnValue_t updateChildMode(MessageQueueId_t queue, Mode_t mode, Submode_t submode);
|
ReturnValue_t updateChildMode(MessageQueueId_t queue, Mode_t mode, Submode_t submode);
|
||||||
|
ReturnValue_t updateChildModeByObjId(object_id_t objectId, Mode_t mode, Submode_t submode);
|
||||||
|
|
||||||
ReturnValue_t updateChildChangedHealth(MessageQueueId_t queue, bool changedHealth = true);
|
ReturnValue_t updateChildChangedHealth(MessageQueueId_t queue, bool changedHealth = true);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user