added missing health and mode helper init

This commit is contained in:
Robin Müller 2022-09-30 14:14:45 +02:00
parent 10dd855244
commit acab5f6bce
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
3 changed files with 23 additions and 9 deletions

View File

@ -20,11 +20,15 @@ ControllerBase::ControllerBase(object_id_t setObjectId, size_t commandQueueDepth
ControllerBase::~ControllerBase() { QueueFactory::instance()->deleteMessageQueue(commandQueue); }
ReturnValue_t ControllerBase::initialize() {
ReturnValue_t result = SystemObject::initialize();
if (result != returnvalue::OK) {
ReturnValue_t result = modeHelper.initialize();
if(result != returnvalue::OK) {
return result;
}
return returnvalue::OK;
result = healthHelper.initialize();
if(result != returnvalue::OK) {
return result;
}
return SystemObject::initialize();
}
MessageQueueId_t ControllerBase::getCommandQueue() const { return commandQueue->getId(); }

View File

@ -129,7 +129,17 @@ ReturnValue_t SubsystemBase::updateChildChangedHealth(MessageQueueId_t queue, bo
MessageQueueId_t SubsystemBase::getCommandQueue() const { return commandQueue->getId(); }
ReturnValue_t SubsystemBase::initialize() { return SystemObject::initialize(); }
ReturnValue_t SubsystemBase::initialize() {
ReturnValue_t result = modeHelper.initialize();
if(result != returnvalue::OK) {
return result;
}
result = healthHelper.initialize();
if(result != returnvalue::OK) {
return result;
}
return SystemObject::initialize();
}
ReturnValue_t SubsystemBase::performOperation(uint8_t opCode) {
childrenChangedMode = false;
@ -187,7 +197,7 @@ ReturnValue_t SubsystemBase::checkTable(HybridIterator<ModeListEntry> tableIter)
using namespace std;
sif::warning << "SubsystemBase::checkTable: Could not find Object " << setfill('0') << hex
<< "0x" << setw(8) << tableIter.value->getObject() << " in object " << setw(8)
<< "0x" << SystemObject::getObjectId() << dec << std::endl;
<< setw(0) << "0x" << setw(8) << SystemObject::getObjectId() << dec << std::endl;
#endif
return TABLE_CONTAINS_INVALID_OBJECT_ID;
}

View File

@ -62,13 +62,13 @@ class SubsystemBase : public SystemObject,
*/
ReturnValue_t registerChild(const ModeTreeChildIF &child) override;
virtual ReturnValue_t initialize() override;
ReturnValue_t initialize() override;
virtual ReturnValue_t performOperation(uint8_t opCode) override;
ReturnValue_t performOperation(uint8_t opCode) override;
virtual ReturnValue_t setHealth(HealthState health) override;
ReturnValue_t setHealth(HealthState health) override;
virtual HasHealthIF::HealthState getHealth() override;
HasHealthIF::HealthState getHealth() override;
protected:
struct ChildInfo {