simplified test task
This commit is contained in:
parent
5f8adc63b7
commit
2126e6e375
@ -6,9 +6,8 @@
|
|||||||
bool TestTask::oneShotAction = true;
|
bool TestTask::oneShotAction = true;
|
||||||
MutexIF* TestTask::testLock = nullptr;
|
MutexIF* TestTask::testLock = nullptr;
|
||||||
|
|
||||||
TestTask::TestTask(object_id_t objectId, bool periodicPrintout, bool periodicEvent):
|
TestTask::TestTask(object_id_t objectId):
|
||||||
SystemObject(objectId), testMode(testModes::A),
|
SystemObject(objectId), testMode(testModes::A) {
|
||||||
periodicPrinout(periodicPrintout), periodicEvent(periodicEvent) {
|
|
||||||
if(testLock == nullptr) {
|
if(testLock == nullptr) {
|
||||||
testLock = MutexFactory::instance()->createMutex();
|
testLock = MutexFactory::instance()->createMutex();
|
||||||
}
|
}
|
||||||
@ -52,17 +51,6 @@ ReturnValue_t TestTask::performOneShotAction() {
|
|||||||
ReturnValue_t TestTask::performPeriodicAction() {
|
ReturnValue_t TestTask::performPeriodicAction() {
|
||||||
/* This is performed each task cycle */
|
/* This is performed each task cycle */
|
||||||
ReturnValue_t result = RETURN_OK;
|
ReturnValue_t result = RETURN_OK;
|
||||||
|
|
||||||
if(periodicPrinout) {
|
|
||||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
|
||||||
sif::info << "TestTask::performPeriodicAction: Hello World!" << std::endl;
|
|
||||||
#else
|
|
||||||
sif::printInfo("TestTask::performPeriodicAction: Hello World!\n");
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
if(periodicEvent) {
|
|
||||||
triggerEvent(TEST_EVENT, 0x1234, 0x4321);
|
|
||||||
}
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,9 +5,6 @@
|
|||||||
#include <fsfw/objectmanager/SystemObject.h>
|
#include <fsfw/objectmanager/SystemObject.h>
|
||||||
#include <fsfw/storagemanager/StorageManagerIF.h>
|
#include <fsfw/storagemanager/StorageManagerIF.h>
|
||||||
|
|
||||||
#include "fsfw/events/Event.h"
|
|
||||||
#include "events/subsystemIdRanges.h"
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Test class for general C++ testing and any other code which will not be part of the
|
* @brief Test class for general C++ testing and any other code which will not be part of the
|
||||||
* primary mission software.
|
* primary mission software.
|
||||||
@ -19,12 +16,9 @@ class TestTask :
|
|||||||
public ExecutableObjectIF,
|
public ExecutableObjectIF,
|
||||||
public HasReturnvaluesIF {
|
public HasReturnvaluesIF {
|
||||||
public:
|
public:
|
||||||
TestTask(object_id_t objectId, bool periodicPrintout = false, bool periodicEvent = false);
|
TestTask(object_id_t objectId);
|
||||||
virtual ~TestTask();
|
virtual ~TestTask();
|
||||||
virtual ReturnValue_t performOperation(uint8_t operationCode = 0);
|
virtual ReturnValue_t performOperation(uint8_t operationCode = 0) override;
|
||||||
|
|
||||||
static constexpr uint8_t subsystemId = SUBSYSTEM_ID::TEST_TASK_ID;
|
|
||||||
static constexpr Event TEST_EVENT = event::makeEvent(subsystemId, 0, severity::INFO);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual ReturnValue_t performOneShotAction();
|
virtual ReturnValue_t performOneShotAction();
|
||||||
@ -38,15 +32,8 @@ protected:
|
|||||||
};
|
};
|
||||||
|
|
||||||
testModes testMode;
|
testModes testMode;
|
||||||
bool periodicPrinout = false;
|
|
||||||
bool periodicEvent = false;
|
|
||||||
|
|
||||||
bool testFlag = false;
|
bool testFlag = false;
|
||||||
uint8_t counter { 1 };
|
|
||||||
uint8_t counterTrigger { 3 };
|
|
||||||
|
|
||||||
void performPusInjectorTest();
|
|
||||||
void examplePacketTest();
|
|
||||||
private:
|
private:
|
||||||
static bool oneShotAction;
|
static bool oneShotAction;
|
||||||
static MutexIF* testLock;
|
static MutexIF* testLock;
|
||||||
|
Loading…
Reference in New Issue
Block a user