Merge pull request 'STR tweaks parameter update' (#544) from str_tweaks_param_update into develop
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
Reviewed-on: #544
This commit is contained in:
commit
87d622c82c
@ -213,6 +213,8 @@ ReturnValue_t StarTrackerHandler::executeAction(ActionId_t actionId, MessageQueu
|
||||
default:
|
||||
break;
|
||||
}
|
||||
// In case the JSON has changed, reinitiate the next parameter set to update.
|
||||
reinitNextSetParam = true;
|
||||
return DeviceHandlerBase::executeAction(actionId, commandedBy, data, size);
|
||||
}
|
||||
|
||||
@ -273,6 +275,7 @@ void StarTrackerHandler::doShutDown() {
|
||||
startupState = StartupState::IDLE;
|
||||
bootState = FwBootState::NONE;
|
||||
solutionSet.setReportingEnabled(false);
|
||||
reinitNextSetParam = false;
|
||||
setMode(_MODE_POWER_DOWN);
|
||||
}
|
||||
|
||||
@ -313,6 +316,8 @@ ReturnValue_t StarTrackerHandler::buildTransitionDeviceCommand(DeviceCommandId_t
|
||||
if (bootCountdown.isBusy()) {
|
||||
return NOTHING_TO_SEND;
|
||||
}
|
||||
// Was already done.
|
||||
reinitNextSetParam = false;
|
||||
bootState = FwBootState::REQ_VERSION;
|
||||
}
|
||||
switch (bootState) {
|
||||
@ -461,7 +466,8 @@ ReturnValue_t StarTrackerHandler::buildCommandFromCommand(DeviceCommandId_t devi
|
||||
return returnvalue::OK;
|
||||
}
|
||||
case (startracker::SUBSCRIPTION): {
|
||||
result = prepareParamCommand(commandData, commandDataLen, jcfgs.subscription);
|
||||
result = prepareParamCommand(commandData, commandDataLen, jcfgs.subscription,
|
||||
reinitNextSetParam);
|
||||
return returnvalue::OK;
|
||||
}
|
||||
case (startracker::REQ_SOLUTION): {
|
||||
@ -477,55 +483,55 @@ ReturnValue_t StarTrackerHandler::buildCommandFromCommand(DeviceCommandId_t devi
|
||||
return returnvalue::OK;
|
||||
}
|
||||
case (startracker::LIMITS): {
|
||||
result = prepareParamCommand(commandData, commandDataLen, jcfgs.limits);
|
||||
result = prepareParamCommand(commandData, commandDataLen, jcfgs.limits, reinitNextSetParam);
|
||||
return result;
|
||||
}
|
||||
case (startracker::MOUNTING): {
|
||||
result = prepareParamCommand(commandData, commandDataLen, jcfgs.mounting);
|
||||
result = prepareParamCommand(commandData, commandDataLen, jcfgs.mounting, reinitNextSetParam);
|
||||
return result;
|
||||
}
|
||||
case (startracker::IMAGE_PROCESSOR): {
|
||||
result = prepareParamCommand(commandData, commandDataLen, jcfgs.imageProcessor);
|
||||
result = prepareParamCommand(commandData, commandDataLen, jcfgs.imageProcessor, reinitNextSetParam);
|
||||
return result;
|
||||
}
|
||||
case (startracker::CAMERA): {
|
||||
result = prepareParamCommand(commandData, commandDataLen, jcfgs.camera);
|
||||
result = prepareParamCommand(commandData, commandDataLen, jcfgs.camera, reinitNextSetParam);
|
||||
return result;
|
||||
}
|
||||
case (startracker::CENTROIDING): {
|
||||
result = prepareParamCommand(commandData, commandDataLen, jcfgs.centroiding);
|
||||
result = prepareParamCommand(commandData, commandDataLen, jcfgs.centroiding, reinitNextSetParam);
|
||||
return result;
|
||||
}
|
||||
case (startracker::LISA): {
|
||||
result = prepareParamCommand(commandData, commandDataLen, jcfgs.lisa);
|
||||
result = prepareParamCommand(commandData, commandDataLen, jcfgs.lisa, reinitNextSetParam);
|
||||
return result;
|
||||
}
|
||||
case (startracker::MATCHING): {
|
||||
result = prepareParamCommand(commandData, commandDataLen, jcfgs.matching);
|
||||
result = prepareParamCommand(commandData, commandDataLen, jcfgs.matching, reinitNextSetParam);
|
||||
return result;
|
||||
}
|
||||
case (startracker::VALIDATION): {
|
||||
result = prepareParamCommand(commandData, commandDataLen, jcfgs.validation);
|
||||
result = prepareParamCommand(commandData, commandDataLen, jcfgs.validation, reinitNextSetParam);
|
||||
return result;
|
||||
}
|
||||
case (startracker::ALGO): {
|
||||
result = prepareParamCommand(commandData, commandDataLen, jcfgs.algo);
|
||||
result = prepareParamCommand(commandData, commandDataLen, jcfgs.algo, reinitNextSetParam);
|
||||
return result;
|
||||
}
|
||||
case (startracker::TRACKING): {
|
||||
result = prepareParamCommand(commandData, commandDataLen, jcfgs.tracking);
|
||||
result = prepareParamCommand(commandData, commandDataLen, jcfgs.tracking, reinitNextSetParam);
|
||||
return result;
|
||||
}
|
||||
case (startracker::LOGLEVEL): {
|
||||
result = prepareParamCommand(commandData, commandDataLen, jcfgs.logLevel);
|
||||
result = prepareParamCommand(commandData, commandDataLen, jcfgs.logLevel, reinitNextSetParam);
|
||||
return result;
|
||||
}
|
||||
case (startracker::LOGSUBSCRIPTION): {
|
||||
result = prepareParamCommand(commandData, commandDataLen, jcfgs.logSubscription);
|
||||
result = prepareParamCommand(commandData, commandDataLen, jcfgs.logSubscription, reinitNextSetParam);
|
||||
return result;
|
||||
}
|
||||
case (startracker::DEBUG_CAMERA): {
|
||||
result = prepareParamCommand(commandData, commandDataLen, jcfgs.debugCamera);
|
||||
result = prepareParamCommand(commandData, commandDataLen, jcfgs.debugCamera, reinitNextSetParam);
|
||||
return result;
|
||||
}
|
||||
case (startracker::CHECKSUM): {
|
||||
@ -1690,12 +1696,19 @@ void StarTrackerHandler::prepareHistogramRequest() {
|
||||
|
||||
ReturnValue_t StarTrackerHandler::prepareParamCommand(const uint8_t* commandData,
|
||||
size_t commandDataLen,
|
||||
ArcsecJsonParamBase& paramSet) {
|
||||
ArcsecJsonParamBase& paramSet,
|
||||
bool reinitSet) {
|
||||
// Stopwatch watch;
|
||||
ReturnValue_t result = returnvalue::OK;
|
||||
if (commandDataLen > MAX_PATH_SIZE) {
|
||||
return FILE_PATH_TOO_LONG;
|
||||
}
|
||||
if(reinitSet) {
|
||||
result = paramSet.init(paramJsonFile);
|
||||
if(result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
result = paramSet.create(commandBuffer);
|
||||
if (result != returnvalue::OK) {
|
||||
|
@ -287,6 +287,8 @@ class StarTrackerHandler : public DeviceHandlerBase {
|
||||
|
||||
InternalState internalState = InternalState::IDLE;
|
||||
|
||||
bool reinitNextSetParam = false;
|
||||
|
||||
bool strHelperHandlingSpecialRequest = false;
|
||||
|
||||
const power::Switch_t powerSwitch = power::NO_SWITCH;
|
||||
@ -409,7 +411,7 @@ class StarTrackerHandler : public DeviceHandlerBase {
|
||||
* @return returnvalue::OK if successful, otherwise error return Value
|
||||
*/
|
||||
ReturnValue_t prepareParamCommand(const uint8_t* commandData, size_t commandDataLen,
|
||||
ArcsecJsonParamBase& paramSet);
|
||||
ArcsecJsonParamBase& paramSet, bool reinitSet);
|
||||
|
||||
/**
|
||||
* @brief The following function will fill the command buffer with the command to request
|
||||
|
Loading…
Reference in New Issue
Block a user