Emit state machine's state in an event/as telemetry (typing the state variable) #4368
-
|
I am trying to emit my state machine's state in an event / as a telemetry, but I can't figure out what type should I use for the variable that will be assigned the state. My component looks like this - module App {
active component EventAction {
state machine StateMachine {
...
}
state machine instance stateMachine: StateMachine
...
}I can see that the state is defined in - namespace App {
class EventAction_StateMachineStateMachineBase {
...
enum class State : FwEnumStoreType {
//! The uninitialized state
__FPRIME_AC_UNINITIALIZED,
//! The CHARGE state
CHARGE,
//! The COM state
COM,
//! The DOWNLINK state
DOWNLINK,
//! The MEASURE state
MEASURE,
//! The SAFE-CHARGE sub-state
SAFE_SAFE_CHARGE,
//! The SAFE-COM sub-state
SAFE_SAFE_COM,
//! The SAFE-DETUMBLE sub-state
SAFE_SAFE_DETUMBLE,
};
...
}
}What type do I use in these cases - event MODE_CHANGE(new_mode: <?what_type_to_use_here?>) severity activity high id 0 format "Mode set to {}"
telemetry Mode: <?what_type_to_use_here?> |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
For now you need to construct your own FPP enumeration and write code to convert from the C++ enumeration to the FPP enumeration. We have an issue open to automatically generate the FPP enumeration: nasa/fpp#615. |
Beta Was this translation helpful? Give feedback.
-
|
@ebenezerarunkumar since I saw #4598 go by, I wanted to comment that we have constructed mirror enumerations for our deployments. I haven't gone so far as to resurrect the |
Beta Was this translation helpful? Give feedback.
For now you need to construct your own FPP enumeration and write code to convert from the C++ enumeration to the FPP enumeration. We have an issue open to automatically generate the FPP enumeration: nasa/fpp#615.