STR extensions #798

Merged
muellerr merged 32 commits from str-extensions into main 2023-10-27 13:50:13 +02:00
2 changed files with 18 additions and 5 deletions
Showing only changes of commit e65352818f - Show all commits

View File

@ -64,6 +64,8 @@ StarTrackerHandler::StarTrackerHandler(object_id_t objectId, object_id_t comIF,
sif::error << "StarTrackerHandler: Invalid str image loader" << std::endl; sif::error << "StarTrackerHandler: Invalid str image loader" << std::endl;
} }
eventQueue = QueueFactory::instance()->createMessageQueue(EventMessage::EVENT_MESSAGE_SIZE * 5); eventQueue = QueueFactory::instance()->createMessageQueue(EventMessage::EVENT_MESSAGE_SIZE * 5);
additionalRequestedTm.emplace(startracker::REQ_TEMPERATURE);
currentSecondaryTmIter = additionalRequestedTm.begin();
} }
StarTrackerHandler::~StarTrackerHandler() {} StarTrackerHandler::~StarTrackerHandler() {}
@ -311,13 +313,20 @@ ReturnValue_t StarTrackerHandler::buildNormalDeviceCommand(DeviceCommandId_t* id
return NOTHING_TO_SEND; return NOTHING_TO_SEND;
} }
switch (normalState) { switch (normalState) {
case NormalState::TEMPERATURE_REQUEST: case NormalState::SECONDARY_REQUEST:
*id = startracker::REQ_TEMPERATURE; if (additionalRequestedTm.size() == 0) {
break;
}
*id = *currentSecondaryTmIter;
currentSecondaryTmIter++;
if (currentSecondaryTmIter == additionalRequestedTm.end()) {
currentSecondaryTmIter = additionalRequestedTm.begin();
}
normalState = NormalState::SOLUTION_REQUEST; normalState = NormalState::SOLUTION_REQUEST;
break; break;
case NormalState::SOLUTION_REQUEST: case NormalState::SOLUTION_REQUEST:
*id = startracker::REQ_SOLUTION; *id = startracker::REQ_SOLUTION;
normalState = NormalState::TEMPERATURE_REQUEST; normalState = NormalState::SECONDARY_REQUEST;
break; break;
default: default:
sif::debug << "StarTrackerHandler::buildNormalDeviceCommand: Invalid normal step" sif::debug << "StarTrackerHandler::buildNormalDeviceCommand: Invalid normal step"

View File

@ -8,6 +8,7 @@
#include <mission/acs/str/strJsonCommands.h> #include <mission/acs/str/strJsonCommands.h>
#include <thirdparty/sagittactl/wire/common/genericstructs.h> #include <thirdparty/sagittactl/wire/common/genericstructs.h>
#include <set>
#include <thread> #include <thread>
#include "OBSWConfig.h" #include "OBSWConfig.h"
@ -245,9 +246,9 @@ class StarTrackerHandler : public DeviceHandlerBase {
std::string paramJsonFile; std::string paramJsonFile;
enum class NormalState { TEMPERATURE_REQUEST, SOLUTION_REQUEST }; enum class NormalState { SECONDARY_REQUEST, SOLUTION_REQUEST };
NormalState normalState = NormalState::TEMPERATURE_REQUEST; NormalState normalState = NormalState::SECONDARY_REQUEST;
enum class StartupState { enum class StartupState {
IDLE, IDLE,
@ -305,6 +306,9 @@ class StarTrackerHandler : public DeviceHandlerBase {
size_t fullPacketLen = 0; size_t fullPacketLen = 0;
std::set<DeviceCommandId_t> additionalRequestedTm{};
std::set<DeviceCommandId_t>::iterator currentSecondaryTmIter;
/** /**
* @brief Handles internal state * @brief Handles internal state
*/ */