simplified test task

This commit is contained in:
Robin Müller 2021-10-26 17:24:28 +02:00
parent 5f8adc63b7
commit 2126e6e375
2 changed files with 4 additions and 29 deletions

View File

@ -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;
} }

View File

@ -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;