add new MessageQueue to ModeHelper; which is equal to the parentQueue and can command the object without forcing the object to EXTERNAL_CONTROL
This commit is contained in:
parent
131456e19e
commit
0681b1895b
@ -35,8 +35,12 @@ ReturnValue_t ModeHelper::handleModeCommand(CommandMessage* command) {
|
||||
commandedMode = mode;
|
||||
commandedSubmode = submode;
|
||||
|
||||
if ((parentQueueId != MessageQueueIF::NO_QUEUE) &&
|
||||
(theOneWhoCommandedAMode != parentQueueId)) {
|
||||
// if (((parentQueueId != MessageQueueIF::NO_QUEUE) &&
|
||||
// (theOneWhoCommandedAMode != parentQueueId))) {
|
||||
// owner->setToExternalControl();
|
||||
// }
|
||||
|
||||
if(theOneWhoCommandedAMode != parentQueueId and theOneWhoCommandedAMode != powerswitchQueueId) {
|
||||
owner->setToExternalControl();
|
||||
}
|
||||
|
||||
@ -106,3 +110,7 @@ bool ModeHelper::isTimedOut() { return countdown.hasTimedOut(); }
|
||||
bool ModeHelper::isForced() { return forced; }
|
||||
|
||||
void ModeHelper::setForced(bool forced) { this->forced = forced; }
|
||||
|
||||
void ModeHelper::setPowerswitchQueueId(MessageQueueId_t queueId) {
|
||||
powerswitchQueueId = queueId;
|
||||
}
|
||||
|
@ -25,6 +25,11 @@ class ModeHelper {
|
||||
*/
|
||||
void setParentQueue(MessageQueueId_t parentQueueId);
|
||||
|
||||
/**
|
||||
* Set to MessageQueue::NO_QUEUE if no powerswitch is commanding the obejct.
|
||||
*/
|
||||
void setPowerswitchQueueId(MessageQueueId_t queueId);
|
||||
|
||||
ReturnValue_t initialize(MessageQueueId_t parentQueueId);
|
||||
|
||||
ReturnValue_t initialize(void);
|
||||
@ -42,6 +47,7 @@ class ModeHelper {
|
||||
protected:
|
||||
HasModesIF *owner;
|
||||
MessageQueueId_t parentQueueId = MessageQueueIF::NO_QUEUE;
|
||||
MessageQueueId_t powerswitchQueueId = MessageQueueIF::NO_QUEUE;
|
||||
|
||||
Countdown countdown;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user