periodic task if adapted
This commit is contained in:
parent
2177877625
commit
4d3f0875c1
@ -90,12 +90,9 @@ ReturnValue_t PeriodicTask::addComponent(object_id_t object, bool setTaskIF) {
|
|||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return HasReturnvaluesIF::RETURN_FAILED;
|
||||||
}
|
}
|
||||||
objectList.push_back(newObject);
|
objectList.push_back(newObject);
|
||||||
|
newObject->setTaskIF(this);
|
||||||
|
|
||||||
if(setTaskIF) {
|
return newObject->initializeAfterTaskCreation();
|
||||||
newObject->setTaskIF(this);
|
|
||||||
}
|
|
||||||
ReturnValue_t result = newObject->initializeAfterTaskCreation();
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t PeriodicTask::getPeriodMs() const {
|
uint32_t PeriodicTask::getPeriodMs() const {
|
||||||
|
@ -65,8 +65,7 @@ public:
|
|||||||
* -@c RETURN_OK on success
|
* -@c RETURN_OK on success
|
||||||
* -@c RETURN_FAILED if the object could not be added.
|
* -@c RETURN_FAILED if the object could not be added.
|
||||||
*/
|
*/
|
||||||
ReturnValue_t addComponent(object_id_t object,
|
ReturnValue_t addComponent(object_id_t object) override;
|
||||||
bool setTaskIF = true) override;
|
|
||||||
|
|
||||||
uint32_t getPeriodMs() const override;
|
uint32_t getPeriodMs() const override;
|
||||||
|
|
||||||
|
@ -22,8 +22,7 @@ void* PeriodicPosixTask::taskEntryPoint(void* arg) {
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t PeriodicPosixTask::addComponent(object_id_t object,
|
ReturnValue_t PeriodicPosixTask::addComponent(object_id_t object) {
|
||||||
bool setTaskIF) {
|
|
||||||
ExecutableObjectIF* newObject = objectManager->get<ExecutableObjectIF>(
|
ExecutableObjectIF* newObject = objectManager->get<ExecutableObjectIF>(
|
||||||
object);
|
object);
|
||||||
if (newObject == nullptr) {
|
if (newObject == nullptr) {
|
||||||
@ -32,13 +31,9 @@ ReturnValue_t PeriodicPosixTask::addComponent(object_id_t object,
|
|||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return HasReturnvaluesIF::RETURN_FAILED;
|
||||||
}
|
}
|
||||||
objectList.push_back(newObject);
|
objectList.push_back(newObject);
|
||||||
|
newObject->setTaskIF(this);
|
||||||
|
|
||||||
if(setTaskIF) {
|
return newObject->initializeAfterTaskCreation();
|
||||||
newObject->setTaskIF(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
ReturnValue_t result = newObject->initializeAfterTaskCreation();
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t PeriodicPosixTask::sleepFor(uint32_t ms) {
|
ReturnValue_t PeriodicPosixTask::sleepFor(uint32_t ms) {
|
||||||
|
@ -39,8 +39,7 @@ public:
|
|||||||
* @param object Id of the object to add.
|
* @param object Id of the object to add.
|
||||||
* @return RETURN_OK on success, RETURN_FAILED if the object could not be added.
|
* @return RETURN_OK on success, RETURN_FAILED if the object could not be added.
|
||||||
*/
|
*/
|
||||||
ReturnValue_t addComponent(object_id_t object,
|
ReturnValue_t addComponent(object_id_t object) override;
|
||||||
bool setTaskIF = true) override;
|
|
||||||
|
|
||||||
uint32_t getPeriodMs() const override;
|
uint32_t getPeriodMs() const override;
|
||||||
|
|
||||||
|
@ -36,8 +36,7 @@ public:
|
|||||||
* to the component.
|
* to the component.
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
virtual ReturnValue_t addComponent(object_id_t object,
|
virtual ReturnValue_t addComponent(object_id_t object) {
|
||||||
bool setTaskIF = true) {
|
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return HasReturnvaluesIF::RETURN_FAILED;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user