This commit is contained in:
parent
013692cc41
commit
3f8603967c
@ -213,6 +213,8 @@ ReturnValue_t StarTrackerHandler::executeAction(ActionId_t actionId, MessageQueu
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
// In case the JSON has changed, reinitiate the next parameter set to update.
|
||||||
|
reinitNextSetParam = true;
|
||||||
return DeviceHandlerBase::executeAction(actionId, commandedBy, data, size);
|
return DeviceHandlerBase::executeAction(actionId, commandedBy, data, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -273,6 +275,7 @@ void StarTrackerHandler::doShutDown() {
|
|||||||
startupState = StartupState::IDLE;
|
startupState = StartupState::IDLE;
|
||||||
bootState = FwBootState::NONE;
|
bootState = FwBootState::NONE;
|
||||||
solutionSet.setReportingEnabled(false);
|
solutionSet.setReportingEnabled(false);
|
||||||
|
reinitNextSetParam = false;
|
||||||
setMode(_MODE_POWER_DOWN);
|
setMode(_MODE_POWER_DOWN);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -313,6 +316,8 @@ ReturnValue_t StarTrackerHandler::buildTransitionDeviceCommand(DeviceCommandId_t
|
|||||||
if (bootCountdown.isBusy()) {
|
if (bootCountdown.isBusy()) {
|
||||||
return NOTHING_TO_SEND;
|
return NOTHING_TO_SEND;
|
||||||
}
|
}
|
||||||
|
// Was already done.
|
||||||
|
reinitNextSetParam = false;
|
||||||
bootState = FwBootState::REQ_VERSION;
|
bootState = FwBootState::REQ_VERSION;
|
||||||
}
|
}
|
||||||
switch (bootState) {
|
switch (bootState) {
|
||||||
@ -461,7 +466,8 @@ ReturnValue_t StarTrackerHandler::buildCommandFromCommand(DeviceCommandId_t devi
|
|||||||
return returnvalue::OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
case (startracker::SUBSCRIPTION): {
|
case (startracker::SUBSCRIPTION): {
|
||||||
result = prepareParamCommand(commandData, commandDataLen, jcfgs.subscription);
|
result = prepareParamCommand(commandData, commandDataLen, jcfgs.subscription,
|
||||||
|
reinitNextSetParam);
|
||||||
return returnvalue::OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
case (startracker::REQ_SOLUTION): {
|
case (startracker::REQ_SOLUTION): {
|
||||||
@ -477,55 +483,55 @@ ReturnValue_t StarTrackerHandler::buildCommandFromCommand(DeviceCommandId_t devi
|
|||||||
return returnvalue::OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
case (startracker::LIMITS): {
|
case (startracker::LIMITS): {
|
||||||
result = prepareParamCommand(commandData, commandDataLen, jcfgs.limits);
|
result = prepareParamCommand(commandData, commandDataLen, jcfgs.limits, reinitNextSetParam);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
case (startracker::MOUNTING): {
|
case (startracker::MOUNTING): {
|
||||||
result = prepareParamCommand(commandData, commandDataLen, jcfgs.mounting);
|
result = prepareParamCommand(commandData, commandDataLen, jcfgs.mounting, reinitNextSetParam);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
case (startracker::IMAGE_PROCESSOR): {
|
case (startracker::IMAGE_PROCESSOR): {
|
||||||
result = prepareParamCommand(commandData, commandDataLen, jcfgs.imageProcessor);
|
result = prepareParamCommand(commandData, commandDataLen, jcfgs.imageProcessor, reinitNextSetParam);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
case (startracker::CAMERA): {
|
case (startracker::CAMERA): {
|
||||||
result = prepareParamCommand(commandData, commandDataLen, jcfgs.camera);
|
result = prepareParamCommand(commandData, commandDataLen, jcfgs.camera, reinitNextSetParam);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
case (startracker::CENTROIDING): {
|
case (startracker::CENTROIDING): {
|
||||||
result = prepareParamCommand(commandData, commandDataLen, jcfgs.centroiding);
|
result = prepareParamCommand(commandData, commandDataLen, jcfgs.centroiding, reinitNextSetParam);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
case (startracker::LISA): {
|
case (startracker::LISA): {
|
||||||
result = prepareParamCommand(commandData, commandDataLen, jcfgs.lisa);
|
result = prepareParamCommand(commandData, commandDataLen, jcfgs.lisa, reinitNextSetParam);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
case (startracker::MATCHING): {
|
case (startracker::MATCHING): {
|
||||||
result = prepareParamCommand(commandData, commandDataLen, jcfgs.matching);
|
result = prepareParamCommand(commandData, commandDataLen, jcfgs.matching, reinitNextSetParam);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
case (startracker::VALIDATION): {
|
case (startracker::VALIDATION): {
|
||||||
result = prepareParamCommand(commandData, commandDataLen, jcfgs.validation);
|
result = prepareParamCommand(commandData, commandDataLen, jcfgs.validation, reinitNextSetParam);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
case (startracker::ALGO): {
|
case (startracker::ALGO): {
|
||||||
result = prepareParamCommand(commandData, commandDataLen, jcfgs.algo);
|
result = prepareParamCommand(commandData, commandDataLen, jcfgs.algo, reinitNextSetParam);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
case (startracker::TRACKING): {
|
case (startracker::TRACKING): {
|
||||||
result = prepareParamCommand(commandData, commandDataLen, jcfgs.tracking);
|
result = prepareParamCommand(commandData, commandDataLen, jcfgs.tracking, reinitNextSetParam);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
case (startracker::LOGLEVEL): {
|
case (startracker::LOGLEVEL): {
|
||||||
result = prepareParamCommand(commandData, commandDataLen, jcfgs.logLevel);
|
result = prepareParamCommand(commandData, commandDataLen, jcfgs.logLevel, reinitNextSetParam);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
case (startracker::LOGSUBSCRIPTION): {
|
case (startracker::LOGSUBSCRIPTION): {
|
||||||
result = prepareParamCommand(commandData, commandDataLen, jcfgs.logSubscription);
|
result = prepareParamCommand(commandData, commandDataLen, jcfgs.logSubscription, reinitNextSetParam);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
case (startracker::DEBUG_CAMERA): {
|
case (startracker::DEBUG_CAMERA): {
|
||||||
result = prepareParamCommand(commandData, commandDataLen, jcfgs.debugCamera);
|
result = prepareParamCommand(commandData, commandDataLen, jcfgs.debugCamera, reinitNextSetParam);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
case (startracker::CHECKSUM): {
|
case (startracker::CHECKSUM): {
|
||||||
@ -1690,12 +1696,16 @@ void StarTrackerHandler::prepareHistogramRequest() {
|
|||||||
|
|
||||||
ReturnValue_t StarTrackerHandler::prepareParamCommand(const uint8_t* commandData,
|
ReturnValue_t StarTrackerHandler::prepareParamCommand(const uint8_t* commandData,
|
||||||
size_t commandDataLen,
|
size_t commandDataLen,
|
||||||
ArcsecJsonParamBase& paramSet) {
|
ArcsecJsonParamBase& paramSet,
|
||||||
|
bool reinitSet) {
|
||||||
// Stopwatch watch;
|
// Stopwatch watch;
|
||||||
ReturnValue_t result = returnvalue::OK;
|
ReturnValue_t result = returnvalue::OK;
|
||||||
if (commandDataLen > MAX_PATH_SIZE) {
|
if (commandDataLen > MAX_PATH_SIZE) {
|
||||||
return FILE_PATH_TOO_LONG;
|
return FILE_PATH_TOO_LONG;
|
||||||
}
|
}
|
||||||
|
if(reinitSet) {
|
||||||
|
result = paramSet.init(paramJsonFile);
|
||||||
|
}
|
||||||
|
|
||||||
result = paramSet.create(commandBuffer);
|
result = paramSet.create(commandBuffer);
|
||||||
if (result != returnvalue::OK) {
|
if (result != returnvalue::OK) {
|
||||||
|
@ -287,6 +287,8 @@ class StarTrackerHandler : public DeviceHandlerBase {
|
|||||||
|
|
||||||
InternalState internalState = InternalState::IDLE;
|
InternalState internalState = InternalState::IDLE;
|
||||||
|
|
||||||
|
bool reinitNextSetParam = false;
|
||||||
|
|
||||||
bool strHelperHandlingSpecialRequest = false;
|
bool strHelperHandlingSpecialRequest = false;
|
||||||
|
|
||||||
const power::Switch_t powerSwitch = power::NO_SWITCH;
|
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
|
* @return returnvalue::OK if successful, otherwise error return Value
|
||||||
*/
|
*/
|
||||||
ReturnValue_t prepareParamCommand(const uint8_t* commandData, size_t commandDataLen,
|
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
|
* @brief The following function will fill the command buffer with the command to request
|
||||||
|
2
tmtc
2
tmtc
@ -1 +1 @@
|
|||||||
Subproject commit aab50dce5ace6878432377fff5e6b2cd1c485213
|
Subproject commit 5b613f98eea415242c152ed3498ed3c0434f139f
|
Loading…
Reference in New Issue
Block a user