Replies: 3 comments 1 reply
-
We have a guide here Parameters that speaks to the Svc.PrmDb component which I think is exactly what you're looking for? Your restart sequence should send the appropriate commands to |
Beta Was this translation helpful? Give feedback.
-
Fprime's parameter system intentionally doesn't cache volatile parameter values across resets as a safety measure. The volitile/nonvolatile parameter setting distinction allows you to "try" a parameter value and make sure it works before permanently adjusting the value. Ex. If you change the critical parameter like radio configuration to an invalid value, you might lose communications with the spacecraft, but you'll be able to recover when the spacecraft resets and reverts back the original values. If you want to cache parameter values, did you consider just calling parameter SET, than SAVE back to back to commit the parameter value to disk? |
Beta Was this translation helpful? Give feedback.
-
I think it is worth noting that the parameter database port interface is well defined and cleanly separated. As somebody who has implemented a custom PrmDB component, I would avoid muddying the water in the component by trying to leverage the parameter autocoded private classes for something it was not meant for. Instead, If I was going to leverage the parameter database component for saving state data at shutdown, I would create and use parameter ports directly, without telling FPP that they are Parameters. If the goal is to save things while an assert is happening, I would have the assert handler call out to the components doing "the saving of data" to trigger them. They could then directly put the data to be saved in their parameter save port call and the assert procedure can proceed from there. |
Beta Was this translation helpful? Give feedback.
-
Is there an elegant way to cache the last known state of a component's member variable into a parameter as part of a restart sequence? One way I've thought of doing this is to have a command handler that sets and saves a parameter to the state of a component's member variable, but I don't see a way to set a parameter directly in the source code.
Beta Was this translation helpful? Give feedback.
All reactions