STR extensions #798
@ -64,6 +64,8 @@ StarTrackerHandler::StarTrackerHandler(object_id_t objectId, object_id_t comIF,
|
||||
sif::error << "StarTrackerHandler: Invalid str image loader" << std::endl;
|
||||
}
|
||||
eventQueue = QueueFactory::instance()->createMessageQueue(EventMessage::EVENT_MESSAGE_SIZE * 5);
|
||||
additionalRequestedTm.emplace(startracker::REQ_TEMPERATURE);
|
||||
currentSecondaryTmIter = additionalRequestedTm.begin();
|
||||
}
|
||||
|
||||
StarTrackerHandler::~StarTrackerHandler() {}
|
||||
@ -311,13 +313,20 @@ ReturnValue_t StarTrackerHandler::buildNormalDeviceCommand(DeviceCommandId_t* id
|
||||
return NOTHING_TO_SEND;
|
||||
}
|
||||
switch (normalState) {
|
||||
case NormalState::TEMPERATURE_REQUEST:
|
||||
*id = startracker::REQ_TEMPERATURE;
|
||||
case NormalState::SECONDARY_REQUEST:
|
||||
if (additionalRequestedTm.size() == 0) {
|
||||
break;
|
||||
}
|
||||
*id = *currentSecondaryTmIter;
|
||||
currentSecondaryTmIter++;
|
||||
if (currentSecondaryTmIter == additionalRequestedTm.end()) {
|
||||
currentSecondaryTmIter = additionalRequestedTm.begin();
|
||||
}
|
||||
normalState = NormalState::SOLUTION_REQUEST;
|
||||
break;
|
||||
case NormalState::SOLUTION_REQUEST:
|
||||
*id = startracker::REQ_SOLUTION;
|
||||
normalState = NormalState::TEMPERATURE_REQUEST;
|
||||
normalState = NormalState::SECONDARY_REQUEST;
|
||||
break;
|
||||
default:
|
||||
sif::debug << "StarTrackerHandler::buildNormalDeviceCommand: Invalid normal step"
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include <mission/acs/str/strJsonCommands.h>
|
||||
#include <thirdparty/sagittactl/wire/common/genericstructs.h>
|
||||
|
||||
#include <set>
|
||||
#include <thread>
|
||||
|
||||
#include "OBSWConfig.h"
|
||||
@ -245,9 +246,9 @@ class StarTrackerHandler : public DeviceHandlerBase {
|
||||
|
||||
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 {
|
||||
IDLE,
|
||||
@ -305,6 +306,9 @@ class StarTrackerHandler : public DeviceHandlerBase {
|
||||
|
||||
size_t fullPacketLen = 0;
|
||||
|
||||
std::set<DeviceCommandId_t> additionalRequestedTm{};
|
||||
std::set<DeviceCommandId_t>::iterator currentSecondaryTmIter;
|
||||
|
||||
/**
|
||||
* @brief Handles internal state
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user