You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There have been discussions about delegating the deserialization of select parameters to outside libraries in the event they wish to keep their own copies and do their own deserialization.
Code changes:
Here is some sample generated code from Ref/RecvBuffApp/RecvBuffComponentAc.cpp, loadParameters() function:
...
FwPrmIdType _id;
_id = this->getIdBase() + PARAMID_PARAMETER1;
// Get parameter parameter1this->m_param_parameter1_valid =
this->m_ParamGet_OutputPort[0].invoke(
_id,
buff
);
// Deserialize valuethis->m_paramLock.lock();
// If there was a deserialization issue, mark it invalidif (this->m_param_parameter1_valid == Fw::ParamValid::VALID) {
stat = buff.deserialize(this->m_parameter1);
if (stat != Fw::FW_SERIALIZE_OK) {
this->m_param_parameter1_valid = Fw::ParamValid::DEFAULT;
// Set default valuethis->m_parameter1 = 10;
}
}
else {
// Set default valuethis->m_param_parameter1_valid = Fw::ParamValid::DEFAULT;
this->m_parameter1 = 10;
}
this->m_paramLock.unLock();
If the FPP could have a tag to specify that a certain parameter is delegated, the above code could be replaced with:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
There have been discussions about delegating the deserialization of select parameters to outside libraries in the event they wish to keep their own copies and do their own deserialization.
Code changes:
Here is some sample generated code from
Ref/RecvBuffApp/RecvBuffComponentAc.cpp
,loadParameters()
function:If the FPP could have a tag to specify that a certain parameter is delegated, the above code could be replaced with:
where:
Would be overridden by the implementation component. The instance variable
this->m_parameter1
could be removed from the component.For saving a particular parameter, the code is currently:
The new function could be:
where:
Beta Was this translation helpful? Give feedback.
All reactions