Namespaces | |
| namespace | detail |
Typedefs | |
| using | LoopCloseFactory |
| using | ActionsLoop1CloseLoop = ActionsLoopClose<1> |
| using | ActionsLoop2CloseLoop = ActionsLoopClose<2> |
| using | ActionsLoop3CloseLoop = ActionsLoopClose<3> |
| using | ActionsLoop4CloseLoop = ActionsLoopClose<4> |
| using | ActionsLoop5CloseLoop = ActionsLoopClose<5> |
| using | ActionsLoop6CloseLoop = ActionsLoopClose<6> |
| using | ActionsLoop7CloseLoop = ActionsLoopClose<7> |
| using | ActionsLoop8CloseLoop = ActionsLoopClose<8> |
| using | ActionsLoop9CloseLoop = ActionsLoopClose<9> |
| using | ActionsLoop1S = ActionsLoopSuspended<1> |
| using | ActionsLoop2S = ActionsLoopSuspended<2> |
| using | ActionsLoop3S = ActionsLoopSuspended<3> |
| using | ActionsLoop4S = ActionsLoopSuspended<4> |
| using | ActionsLoop5S = ActionsLoopSuspended<5> |
| using | ActionsLoop6S = ActionsLoopSuspended<6> |
| using | ActionsLoop7S = ActionsLoopSuspended<7> |
| using | ActionsLoop8S = ActionsLoopSuspended<8> |
| using | ActionsLoop9S = ActionsLoopSuspended<9> |
Enumerations | |
| enum | LoopState { SL_OPEN = 1 , SL_CLOSED = 2 , SL_SUSPENDED = 3 } |
| enum | SlIndex { SL_1 = 1 , SL_2 , SL_3 , SL_4 , SL_5 , SL_6 , SL_7 , SL_8 , SL_9 } |
Functions | |
| template<int LOOP_INDEX> | |
| void | CreateCloseLoopTimer (boost::asio::io_context &ios, rad::SMAdapter &sm, std::unique_ptr< rad::Timer > &timer, int period_sec) |
| rad::UniqueEvent | MakeTriggerEvent (int loop_index) |
| log4cplus::Logger & | GetLogger () |
| std::unique_ptr< LoopCompletionHandler > | CreateLoopCompletionHandler (rad::Application &appl) |
| Factory function to create LoopCompletionHandler instances. | |
| void | ResetAllLoopStates (OldbInterface &oldb, const rad::Config &config) |
| std::string | GetLoopOldbKey (int loop_index, const std::string ¶m_name) |
| std::string | ResolveEndpoint (const std::string &spec, const ServiceResolver &resolver, const std::string &name_space=ServiceResolver::DefaultNamespace()) |
| std::string | GetLoopConfigKey (int loop_index, const std::string ¶m_name) |
| std::string | GetLoopOldbKey (const std::string &prefix, int loop_index, const std::string ¶m_name) |
| int | GetNumSecondaryLoops (const rad::Config &config) |
| std::vector< int > | GetEnabledLoopIndices (const rad::Config &config) |
| std::string | GetLoopParam (const rad::Config &config, int loop_index, const std::string ¶m_name) |
| bool | IsLoopEnabled (const rad::Config &config, int loop_index) |
| void | DecomposeStatus (const std::string &sm_status, std::string &state, std::string &substate) |
| std::string | ToSupervisorSubstate (const std::string &substate) |
| std::string | FormatSupervisorStatus (const std::string &sm_status) |
| bool | TryGetLoopVectorParam (const rad::Config &config, int loop_index, const std::string ¶m_name, std::string &out) |
| template<typename T> | |
| T | GetLoopParamFromConfig (const rad::Config &config, int loop_index, const std::string &name) |
| template<typename T> | |
| T | GetLoopParamFromConfig (const rad::Config &config, int loop_index, const std::string &name, const T &default_value) |
As above, returning default_value when the parameter is absent. | |
| void | LoadLoopParamsIntoConfig (rad::Config &config, const std::string &config_filename="") |
| TEST_F (TestActionMgr, Ctor) | |
| TEST_F (TestActionMgr, CreateActions) | |
| TEST_F (TestActionMgr, CreateLoopCloseAction_OutOfRange) | |
| TEST_F (TestActionMgr, CreateLoopCloseAction_ValidRange) | |
| TEST_F (TestActionMgr, RegisterLoopCloseActionFactory) | |
| TEST_F (TestActionMgr, RegisterLoopExecuteActivityFactory) | |
| TEST_F (TestActionsLM, ActionGroupsExist) | |
| TEST_F (TestActionsLM, CloseLoopNoEventHandlesGracefully) | |
| TEST_F (TestActionsLM, OpenLoopNoEventHandlesGracefully) | |
| TEST_F (TestActionsLM, ResumeLoopNoEventHandlesGracefully) | |
| TEST_F (TestActionsLM, SuspendLoopNoEventHandlesGracefully) | |
| TEST_F (TestActionsLM, RunSlmNoEventHandlesGracefully) | |
| TEST_F (TestActionsLM, StopSlmNoEventHandlesGracefully) | |
| TEST_F (TestActionsLM, AllLoopCommandsHandleNullContext) | |
| TEST_F (TestActionsLoopCloseHelpers, MakeTriggerEventValidRange) | |
| TEST_F (TestActionsLoopCloseHelpers, MakeTriggerEventInvalidLow) | |
| TEST_F (TestActionsLoopCloseHelpers, MakeTriggerEventInvalidHigh) | |
| TEST_F (TestActionsLoopCloseHelpers, MakeTriggerEventNegative) | |
| TEST_F (TestActionsLoopCloseHelpers, TypeAliasesDistinct) | |
| TEST_F (TestActionsLoopCloseHelpers, CreateWithDefaultConfig) | |
| TEST_F (TestActionsRunning, GroupHasExpectedId) | |
| The action group reports the expected id. | |
| TEST_F (TestActionsRunning, CompleteIsCallable) | |
| Complete() (Running onentry hook) runs without throwing. | |
| TEST_F (TestActionsRunning, AbortResetsLoopsWithoutThrowing) | |
| Abort() (Running onexit hook) resets all enabled loops without throwing, exercising ResetAllLoopStates over the configured loops. | |
| TEST_F (TestBaseLoopActions, InitSetsOpen) | |
| TEST_F (TestBaseLoopActions, ExecuteCallsOnCycleStart) | |
| TEST_F (TestBaseLoopActions, CompleteResetsErrors) | |
| TEST_F (TestBaseLoopActions, AbortSetsError) | |
| TEST_F (TestBaseLoopCloseActions, ExecuteSetsClosedAndStartsCycle) | |
| TEST_F (TestBaseLoopCloseActions, CompleteResetsErrors) | |
| TEST_F (TestBaseLoopCloseActions, AbortDoesNotSetError) | |
| TEST_F (TestBaseLoopCloseActions, CycleErrorBelowThresholdIncrementsButDoesNotTripStop) | |
| TEST_F (TestBaseLoopCloseActions, CycleErrorAtThresholdTripsStopGuard) | |
| TEST_F (TestBaseLoopSuspendedActions, ExecuteSuspendsWithoutError) | |
| TEST_F (TestBaseLoopSuspendedActions, CompleteResetsErrors) | |
| TEST_F (TestBaseLoopSuspendedActions, AbortDoesNotSetError) | |
| TEST_F (TestLoopExecuteActivityParams, ReadsConfiguredVectorStringParams) | |
| TEST_F (TestLoopExecuteActivityParams, UnknownParamFallsBackToDefault) | |
| TEST_F (TestLoopExecuteActivityParams, ReadsPlainScalarLoopKeys) | |
| TEST_F (TestKillableActivity, IsThreadJoinedBeforeStart) | |
| TEST_F (TestKillableActivity, StartAndJoinNormal) | |
| TEST_F (TestKillableActivity, MultipleStartStopCycles) | |
| TEST_F (TestKillableActivity, DetachOnKill) | |
| TEST_F (TestKillableActivity, GetNativeHandleAfterStart) | |
| TEST_F (TestLoopCompletionHandler, CreateHandler) | |
| Test that CreateLoopCompletionHandler returns a valid handler. | |
| TEST_F (TestLoopCompletionHandler, SignalSuccessValidRange) | |
| Test that SignalSuccess works for valid loop indices (1-9) | |
| TEST_F (TestLoopCompletionHandler, SignalSuccessOutOfRange) | |
| Test that SignalSuccess throws for out-of-range indices. | |
| TEST_F (TestLoopCompletionHandler, SignalErrorValidRange) | |
| Test that SignalError works for valid loop indices (1-9) | |
| TEST_F (TestLoopCompletionHandler, SignalErrorOutOfRange) | |
| Test that SignalError throws for out-of-range indices. | |
| TEST_F (TestLoopStateData, InitialState) | |
| TEST_F (TestLoopStateData, SetActiveSetsClosed) | |
| TEST_F (TestLoopStateData, SetInactiveSetsOpen) | |
| TEST_F (TestLoopStateData, SetStateSuspended) | |
| TEST_F (TestLoopStateData, SetStateClosed) | |
| TEST_F (TestLoopStateData, CycleUpdateDoesNotAffectErrorCount) | |
| TEST_F (TestLoopStateData, SetFailIncrementsOnTrue) | |
| TEST_F (TestLoopStateData, SetFailResetsOnFalse) | |
| TEST_F (TestLoopStateData, CheckStopWithMaxErrors) | |
| TEST_F (TestLoopStateData, CheckStopWithZeroMaxErrors) | |
| TEST_F (TestLoopStateData, CheckStopWithOneMaxError) | |
| TEST_F (TestLoopStateData, SetValueAndGetValue) | |
| TEST_F (TestLoopStateData, CycleResetClearsErrorCount) | |
| TEST_F (TestLoopStateData, MultipleLoopsIndependentState) | |
| TEST (TestServiceResolver, ResolvesNomadFirstInstance) | |
| TEST (TestServiceResolver, HonoursScheme) | |
| TEST (TestServiceResolver, FallsBackToConsulWhenNomadEmpty) | |
| TEST (TestServiceResolver, ThrowsWhenNeitherResolves) | |
| TEST (TestServiceResolver, ResolveEndpointPassesThroughLiteralUri) | |
| TEST (TestServiceResolver, ResolveEndpointResolvesServiceAndAppendsPath) | |
| TEST (TestServiceResolver, ResolveEndpointServiceWithoutPath) | |
| TEST_F (TestSlConfig, GetNumSecondaryLoops_Default) | |
| Test that GetNumSecondaryLoops returns 0 for empty config. | |
| TEST_F (TestSlConfig, IsLoopEnabled_Default) | |
| Test that IsLoopEnabled returns false when loop is not configured. | |
| TEST_F (TestSlConfig, GetEnabledLoopIndices_Default) | |
| Test that GetEnabledLoopIndices returns empty for empty config. | |
| TEST_F (TestSlConfig, GetLoopParam) | |
| Test GetLoopParam retrieval with default empty config. | |
| TEST_F (TestSlConfig, GetNumSecondaryLoops_OneEnabled) | |
| Test with a populated config (1 enabled loop) | |
| TEST_F (TestSlConfig, IsLoopEnabled_Configured) | |
| Test IsLoopEnabled with a populated config. | |
| TEST_F (TestSlConfig, GetEnabledLoopIndices_WithEnabled) | |
| Test GetEnabledLoopIndices returns only enabled loops. | |
| TEST_F (TestSlConfig, GetNumSecondaryLoops_TwoEnabled) | |
| Test GetNumSecondaryLoops with 2 enabled loops. | |
| TEST_F (TestSlConfig, GetLoopParam_Configured) | |
| Test GetLoopParam with configured parameter. | |
| TEST_F (TestSlConfig, DecomposeStatus_StatesAndSubstates) | |
| DecomposeStatus maps SM status paths to state/substate, incl. Running. | |
| TEST_F (TestSlConfig, ToSupervisorSubstate_Mapping) | |
| ToSupervisorSubstate maps Running -> Idle and passes others through. | |
| TEST_F (TestSlConfig, FormatSupervisorStatus_WireFormat) | |
| FormatSupervisorStatus emits the STD interface "<state>;<substate>". | |
| TEST_F (TestSlConfig, DecomposeStatus_ErrorAndDefaults) | |
| DecomposeStatus maps an Error path and falls back to Off/Idle. | |
| TEST_F (TestSlConfig, GetEnabledLoopIndices_StopsAtGap) | |
| GetEnabledLoopIndices stops at the first unconfigured loop. | |
| TEST_F (TestSlConfig, GetLoopParam_VectorStringEntries) | |
| "params/<name>" lookups resolve to the configured value. | |
| TEST_F (TestSlConfig, TryGetLoopVectorParam_AndTypedConversion) | |
| TryGetLoopVectorParam reports found/not-found and ignores non-params names; the typed GetLoopParamFromConfig converts the parsed value. | |
| TEST_F (TestSuspendedActions, CreateLoop1SuspendedActions) | |
| The factory creates a suspended action group for loop 1. | |
| TEST_F (TestSuspendedActions, CreateLoopSuspendedActions_ValidRange) | |
| The factory creates a suspended action group for every loop (1-9). | |
| TEST_F (TestSuspendedActions, ExecuteMarksSuspendedWithoutError) | |
| Execute() (entering Suspended) marks the loop SUSPENDED and is not a cycle error. | |
| TEST_F (TestSuspendedActions, AbortDoesNotCountAsError) | |
| Abort() (Resume/Open) is a clean transition: it must not increment the consecutive-error count. | |
| TEST_F (TestSuspendedActions, CompleteResetsErrors) | |
| Complete() clears a pending error count. | |
Variables | |
| const std::string | CONFIG_DEFAULT_VERSION = std::string(VERSION) |
| const std::string | CONFIG_DEFAULT_MODNAME = "slm" |
| const std::string | CONFIG_DEFAULT_PROCNAME = "ifw-slm" |
| const std::string | CONFIG_DEFAULT_FILENAME = "config/ifw/slm/config.yaml" |
| const std::string | CONFIG_DEFAULT_SCXML_FILENAME = "config/ifw/slm/sm.xml" |
| const std::string | CONFIG_DEFAULT_SCXML_APPEND = "" |
| const std::string | CONFIG_DEFAULT_LOG_LEVEL = "INFO" |
| const std::string | CONFIG_DEFAULT_LOG_PROPERTIES = "config/ifw/slm/log.properties" |
| const std::string | CONFIG_DEFAULT_REQ_ENDPOINT = "zpb.rr://127.0.0.1:12081/" |
| const std::string | CONFIG_DEFAULT_PUB_ENDPOINT = "zpb.ps://127.0.0.1:12082/" |
| const std::string | CONFIG_DEFAULT_OLDB_URI_PREFIX = "cii.oldb:/elt/xxx/" |
| constexpr auto | KEY_CONFIG_PUB_ENDPOINT = "server/pub_endpoint" |
| const int | CONFIG_DEFAULT_LOOP_PERIOD_SEC = 60 |
| const int | CONFIG_DEFAULT_OLDB_CONN_TIMEOUT = 1 |
| const int | CONFIG_DEFAULT_OLDB_ASYNC_PERIOD = 1000 |
| const bool | CONFIG_DEFAULT_TRS_HEALTH_ENABLED = false |
| const std::string | LOGGER_NAME = "ifwslm" |
| const std::string | KEY_SL_NUM_IN_USE = "config/SL_inUse" |
| const int | SL_MAX_NUM = 9 |
| const std::string | SL_DB_NUM_IN_USE = "config/SL_inUse" |
| const std::string | SL_KEY_LOOP_NUM = "sl/loop_num" |
| const std::string | SL_KEY_LOOP_PREFIX = "sl/loop/" |
| const std::string | SL_KEY_ACTIVE = "active" |
| const std::string | SL_KEY_STATE = "state" |
| const std::string | SL_KEY_CYCLE_COUNTER = "cycle_counter" |
| const std::string | SL_KEY_CYCLE_LAST_SUCCESS = "cycle_last_success" |
| const std::string | SL_KEY_CYCLE_LAST = "cycle_last" |
| const std::string | SL_KEY_CYCLE_START = "cycle_start" |
| const std::string | SL_KEY_CYCLE_FAILURE = "cycle_failure" |
| const std::string | SL_KEY_CYCLE_NERRORS = "cycle_nerrors" |
| const std::string | SL_KEY_CYCLE_NSUCCESS = "cycle_nsuccess" |
| const std::string | SL_KEY_CYCLE_VALUE = "cycle_value" |
| const std::string | SL_KEY_CYCLE_LAST_ERROR = "cycle_last_error" |
| const std::string | SL_KEY_TIMER_PERIOD_SEC = "timer_period_sec" |
| using ifw::slm::ActionsLoop1CloseLoop = ActionsLoopClose<1> |
| using ifw::slm::ActionsLoop1S = ActionsLoopSuspended<1> |
| using ifw::slm::ActionsLoop2CloseLoop = ActionsLoopClose<2> |
| using ifw::slm::ActionsLoop2S = ActionsLoopSuspended<2> |
| using ifw::slm::ActionsLoop3CloseLoop = ActionsLoopClose<3> |
| using ifw::slm::ActionsLoop3S = ActionsLoopSuspended<3> |
| using ifw::slm::ActionsLoop4CloseLoop = ActionsLoopClose<4> |
| using ifw::slm::ActionsLoop4S = ActionsLoopSuspended<4> |
| using ifw::slm::ActionsLoop5CloseLoop = ActionsLoopClose<5> |
| using ifw::slm::ActionsLoop5S = ActionsLoopSuspended<5> |
| using ifw::slm::ActionsLoop6CloseLoop = ActionsLoopClose<6> |
| using ifw::slm::ActionsLoop6S = ActionsLoopSuspended<6> |
| using ifw::slm::ActionsLoop7CloseLoop = ActionsLoopClose<7> |
| using ifw::slm::ActionsLoop7S = ActionsLoopSuspended<7> |
| using ifw::slm::ActionsLoop8CloseLoop = ActionsLoopClose<8> |
| using ifw::slm::ActionsLoop8S = ActionsLoopSuspended<8> |
| using ifw::slm::ActionsLoop9CloseLoop = ActionsLoopClose<9> |
| using ifw::slm::ActionsLoop9S = ActionsLoopSuspended<9> |
| enum ifw::slm::LoopState |
| enum ifw::slm::SlIndex |
|
inline |
| std::unique_ptr< LoopCompletionHandler > ifw::slm::CreateLoopCompletionHandler | ( | rad::Application & | appl | ) |
Factory function to create LoopCompletionHandler instances.
| appl | Reference to RAD application |
| void ifw::slm::DecomposeStatus | ( | const std::string & | sm_status, |
| std::string & | state, | ||
| std::string & | substate ) |
Decompose a hierarchical state-machine status path (e.g. "On::Operational::Running:...") into a summarized ELT state/substate pair.
| sm_status | Full SM status path as returned by Application::GetStatus(). |
| state | [out] Summarized state ("Operational", "NotOperational", "Off"). |
| substate | [out] Summarized substate ("Running", "Idle", "Ready", "NotReady", "Error"). |
| std::string ifw::slm::FormatSupervisorStatus | ( | const std::string & | sm_status | ) |
Build the STD interface status string "<state>;<substate>" that the ELT Supervisor understands, from a raw SM status path.
| sm_status | Full SM status path as returned by Application::GetStatus(). |
| std::vector< int > ifw::slm::GetEnabledLoopIndices | ( | const rad::Config & | config | ) |
Get the list of enabled loop indices from configuration.
| config | Reference to the configuration object |
| log4cplus::Logger & ifw::slm::GetLogger | ( | ) |
| std::string ifw::slm::GetLoopConfigKey | ( | int | loop_index, |
| const std::string & | param_name ) |
Get the full configuration key for a secondary loop parameter.
| loop_index | Loop index (1-based) |
| param_name | Parameter name (e.g., "event_name", "cmd_name") |
| std::string ifw::slm::GetLoopOldbKey | ( | const std::string & | prefix, |
| int | loop_index, | ||
| const std::string & | param_name ) |
Get the OLDB key for a secondary loop parameter.
| loop_index | Loop index (1-based) |
| param_name | Parameter name (e.g., "event_name", "cmd_name") |
| std::string ifw::slm::GetLoopOldbKey | ( | int | loop_index, |
| const std::string & | param_name ) |
Get the full OLDB key for a secondary loop parameter.
| loop_index | Loop index (1-based) |
| param_name | Parameter name (e.g., "event_name", "cmd_name") |
| std::string ifw::slm::GetLoopParam | ( | const rad::Config & | config, |
| int | loop_index, | ||
| const std::string & | param_name ) |
Get loop parameter value from configuration.
| config | Reference to the configuration object |
| loop_index | Loop index (1-based) |
| param_name | Parameter name |
|
inline |
Read a per-loop configuration parameter, transparently handling "params/<name>" entries stored in the vector_string params node.
| if | name is not a params entry and the key is absent (mirrors rad::Config::GetParam). Use the defaulted overload to avoid throwing. |
|
inline |
As above, returning default_value when the parameter is absent.
| int ifw::slm::GetNumSecondaryLoops | ( | const rad::Config & | config | ) |
Read the number of secondary loops from configuration.
| config | Reference to the configuration object |
| bool ifw::slm::IsLoopEnabled | ( | const rad::Config & | config, |
| int | loop_index ) |
Check if a loop is enabled in configuration.
| config | Reference to the configuration object |
| loop_index | Loop index (1-based) |
| void ifw::slm::LoadLoopParamsIntoConfig | ( | rad::Config & | config, |
| const std::string & | config_filename = "" ) |
Retained for API/backward compatibility. Per-loop params are now resolved on read by TryGetLoopVectorParam / GetLoopParamFromConfig, so there is no longer any flattening to perform here (and config-ng rejects writing params/<name> into the vector_string node). This is now a no-op.
| config | Configuration object (unused). |
| config_filename | Unused. |
|
inline |
| void ifw::slm::ResetAllLoopStates | ( | OldbInterface & | oldb, |
| const rad::Config & | config ) |
Reset every enabled loop to the OPEN state and clear its cycle counters in OLDB.
Used when the SLM leaves the Running state (StopSlm / Stop / Disable) so the reported loop state no longer shows stale CLOSED loops.
| oldb | OLDB interface to write through. |
| config | Configuration used to determine the enabled loops. |
| std::string ifw::slm::ResolveEndpoint | ( | const std::string & | spec, |
| const ServiceResolver & | resolver, | ||
| const std::string & | name_space = ServiceResolver::DefaultNamespace() ) |
Resolve a configured endpoint spec into a literal MAL URI.
spec already contains "://" it is a literal URI and returned as-is (backward compatible).service is resolved through resolver and the optional "/path" suffix is appended. e.g. "fcs-req/AppCmds" -> "zpb.rr://10.0.0.5:25376/AppCmds". | ifw::slm::TEST | ( | TestServiceResolver | , |
| FallsBackToConsulWhenNomadEmpty | ) |
| ifw::slm::TEST | ( | TestServiceResolver | , |
| HonoursScheme | ) |
| ifw::slm::TEST | ( | TestServiceResolver | , |
| ResolveEndpointPassesThroughLiteralUri | ) |
| ifw::slm::TEST | ( | TestServiceResolver | , |
| ResolveEndpointResolvesServiceAndAppendsPath | ) |
| ifw::slm::TEST | ( | TestServiceResolver | , |
| ResolveEndpointServiceWithoutPath | ) |
| ifw::slm::TEST | ( | TestServiceResolver | , |
| ResolvesNomadFirstInstance | ) |
| ifw::slm::TEST | ( | TestServiceResolver | , |
| ThrowsWhenNeitherResolves | ) |
| ifw::slm::TEST_F | ( | TestActionMgr | , |
| CreateActions | ) |
| ifw::slm::TEST_F | ( | TestActionMgr | , |
| CreateLoopCloseAction_OutOfRange | ) |
| ifw::slm::TEST_F | ( | TestActionMgr | , |
| CreateLoopCloseAction_ValidRange | ) |
| ifw::slm::TEST_F | ( | TestActionMgr | , |
| Ctor | ) |
| ifw::slm::TEST_F | ( | TestActionMgr | , |
| RegisterLoopCloseActionFactory | ) |
| ifw::slm::TEST_F | ( | TestActionMgr | , |
| RegisterLoopExecuteActivityFactory | ) |
| ifw::slm::TEST_F | ( | TestActionsLM | , |
| ActionGroupsExist | ) |
| ifw::slm::TEST_F | ( | TestActionsLM | , |
| AllLoopCommandsHandleNullContext | ) |
| ifw::slm::TEST_F | ( | TestActionsLM | , |
| CloseLoopNoEventHandlesGracefully | ) |
| ifw::slm::TEST_F | ( | TestActionsLM | , |
| OpenLoopNoEventHandlesGracefully | ) |
| ifw::slm::TEST_F | ( | TestActionsLM | , |
| ResumeLoopNoEventHandlesGracefully | ) |
| ifw::slm::TEST_F | ( | TestActionsLM | , |
| RunSlmNoEventHandlesGracefully | ) |
| ifw::slm::TEST_F | ( | TestActionsLM | , |
| StopSlmNoEventHandlesGracefully | ) |
| ifw::slm::TEST_F | ( | TestActionsLM | , |
| SuspendLoopNoEventHandlesGracefully | ) |
| ifw::slm::TEST_F | ( | TestActionsLoopCloseHelpers | , |
| CreateWithDefaultConfig | ) |
Test creating ActionsLoopClose in a minimal context. This verifies that construction with default config works and the timer is created without crashing.
| ifw::slm::TEST_F | ( | TestActionsLoopCloseHelpers | , |
| MakeTriggerEventInvalidHigh | ) |
| ifw::slm::TEST_F | ( | TestActionsLoopCloseHelpers | , |
| MakeTriggerEventInvalidLow | ) |
| ifw::slm::TEST_F | ( | TestActionsLoopCloseHelpers | , |
| MakeTriggerEventNegative | ) |
| ifw::slm::TEST_F | ( | TestActionsLoopCloseHelpers | , |
| MakeTriggerEventValidRange | ) |
| ifw::slm::TEST_F | ( | TestActionsLoopCloseHelpers | , |
| TypeAliasesDistinct | ) |
| ifw::slm::TEST_F | ( | TestActionsRunning | , |
| AbortResetsLoopsWithoutThrowing | ) |
Abort() (Running onexit hook) resets all enabled loops without throwing, exercising ResetAllLoopStates over the configured loops.
| ifw::slm::TEST_F | ( | TestActionsRunning | , |
| CompleteIsCallable | ) |
Complete() (Running onentry hook) runs without throwing.
| ifw::slm::TEST_F | ( | TestActionsRunning | , |
| GroupHasExpectedId | ) |
The action group reports the expected id.
| ifw::slm::TEST_F | ( | TestBaseLoopActions | , |
| AbortSetsError | ) |
| ifw::slm::TEST_F | ( | TestBaseLoopActions | , |
| CompleteResetsErrors | ) |
| ifw::slm::TEST_F | ( | TestBaseLoopActions | , |
| ExecuteCallsOnCycleStart | ) |
| ifw::slm::TEST_F | ( | TestBaseLoopActions | , |
| InitSetsOpen | ) |
| ifw::slm::TEST_F | ( | TestBaseLoopCloseActions | , |
| AbortDoesNotSetError | ) |
| ifw::slm::TEST_F | ( | TestBaseLoopCloseActions | , |
| CompleteResetsErrors | ) |
| ifw::slm::TEST_F | ( | TestBaseLoopCloseActions | , |
| CycleErrorAtThresholdTripsStopGuard | ) |
| ifw::slm::TEST_F | ( | TestBaseLoopCloseActions | , |
| CycleErrorBelowThresholdIncrementsButDoesNotTripStop | ) |
| ifw::slm::TEST_F | ( | TestBaseLoopCloseActions | , |
| ExecuteSetsClosedAndStartsCycle | ) |
| ifw::slm::TEST_F | ( | TestBaseLoopSuspendedActions | , |
| AbortDoesNotSetError | ) |
| ifw::slm::TEST_F | ( | TestBaseLoopSuspendedActions | , |
| CompleteResetsErrors | ) |
| ifw::slm::TEST_F | ( | TestBaseLoopSuspendedActions | , |
| ExecuteSuspendsWithoutError | ) |
| ifw::slm::TEST_F | ( | TestKillableActivity | , |
| DetachOnKill | ) |
| ifw::slm::TEST_F | ( | TestKillableActivity | , |
| GetNativeHandleAfterStart | ) |
| ifw::slm::TEST_F | ( | TestKillableActivity | , |
| IsThreadJoinedBeforeStart | ) |
| ifw::slm::TEST_F | ( | TestKillableActivity | , |
| MultipleStartStopCycles | ) |
| ifw::slm::TEST_F | ( | TestKillableActivity | , |
| StartAndJoinNormal | ) |
| ifw::slm::TEST_F | ( | TestLoopCompletionHandler | , |
| CreateHandler | ) |
Test that CreateLoopCompletionHandler returns a valid handler.
| ifw::slm::TEST_F | ( | TestLoopCompletionHandler | , |
| SignalErrorOutOfRange | ) |
Test that SignalError throws for out-of-range indices.
| ifw::slm::TEST_F | ( | TestLoopCompletionHandler | , |
| SignalErrorValidRange | ) |
Test that SignalError works for valid loop indices (1-9)
| ifw::slm::TEST_F | ( | TestLoopCompletionHandler | , |
| SignalSuccessOutOfRange | ) |
Test that SignalSuccess throws for out-of-range indices.
| ifw::slm::TEST_F | ( | TestLoopCompletionHandler | , |
| SignalSuccessValidRange | ) |
Test that SignalSuccess works for valid loop indices (1-9)
| ifw::slm::TEST_F | ( | TestLoopExecuteActivityParams | , |
| ReadsConfiguredVectorStringParams | ) |
| ifw::slm::TEST_F | ( | TestLoopExecuteActivityParams | , |
| ReadsPlainScalarLoopKeys | ) |
| ifw::slm::TEST_F | ( | TestLoopExecuteActivityParams | , |
| UnknownParamFallsBackToDefault | ) |
| ifw::slm::TEST_F | ( | TestLoopStateData | , |
| CheckStopWithMaxErrors | ) |
| ifw::slm::TEST_F | ( | TestLoopStateData | , |
| CheckStopWithOneMaxError | ) |
| ifw::slm::TEST_F | ( | TestLoopStateData | , |
| CheckStopWithZeroMaxErrors | ) |
| ifw::slm::TEST_F | ( | TestLoopStateData | , |
| CycleResetClearsErrorCount | ) |
| ifw::slm::TEST_F | ( | TestLoopStateData | , |
| CycleUpdateDoesNotAffectErrorCount | ) |
| ifw::slm::TEST_F | ( | TestLoopStateData | , |
| InitialState | ) |
| ifw::slm::TEST_F | ( | TestLoopStateData | , |
| MultipleLoopsIndependentState | ) |
| ifw::slm::TEST_F | ( | TestLoopStateData | , |
| SetActiveSetsClosed | ) |
| ifw::slm::TEST_F | ( | TestLoopStateData | , |
| SetFailIncrementsOnTrue | ) |
| ifw::slm::TEST_F | ( | TestLoopStateData | , |
| SetFailResetsOnFalse | ) |
| ifw::slm::TEST_F | ( | TestLoopStateData | , |
| SetInactiveSetsOpen | ) |
| ifw::slm::TEST_F | ( | TestLoopStateData | , |
| SetStateClosed | ) |
| ifw::slm::TEST_F | ( | TestLoopStateData | , |
| SetStateSuspended | ) |
| ifw::slm::TEST_F | ( | TestLoopStateData | , |
| SetValueAndGetValue | ) |
| ifw::slm::TEST_F | ( | TestSlConfig | , |
| DecomposeStatus_ErrorAndDefaults | ) |
DecomposeStatus maps an Error path and falls back to Off/Idle.
Error must win over the Ready/NotReady/Running checks (order matters), and an unrecognized/empty path must yield the default Off/Idle pair.
| ifw::slm::TEST_F | ( | TestSlConfig | , |
| DecomposeStatus_StatesAndSubstates | ) |
DecomposeStatus maps SM status paths to state/substate, incl. Running.
| ifw::slm::TEST_F | ( | TestSlConfig | , |
| FormatSupervisorStatus_WireFormat | ) |
FormatSupervisorStatus emits the STD interface "<state>;<substate>".
Regression guard: the Supervisor boost::splits both the std/status topic and the GetStatus reply on ';' and looks each half up in its own state/substate bimaps (ifw-sup states.hpp). A different separator collapses the reply into a single unmatched token and the subsystem reports as "Undefined / Undefined". The substate must also be in the Supervisor vocabulary, i.e. "Running" is reported as "Idle" here even though OLDB keeps "Running".
| ifw::slm::TEST_F | ( | TestSlConfig | , |
| GetEnabledLoopIndices_Default | ) |
Test that GetEnabledLoopIndices returns empty for empty config.
| ifw::slm::TEST_F | ( | TestSlConfig | , |
| GetEnabledLoopIndices_StopsAtGap | ) |
GetEnabledLoopIndices stops at the first unconfigured loop.
The scanner assumes a contiguous loop array: loop 1 is enabled, loop 2 has no enable key, so scanning stops and loop 3 (even if enabled) is not returned.
| ifw::slm::TEST_F | ( | TestSlConfig | , |
| GetEnabledLoopIndices_WithEnabled | ) |
Test GetEnabledLoopIndices returns only enabled loops.
| ifw::slm::TEST_F | ( | TestSlConfig | , |
| GetLoopParam | ) |
Test GetLoopParam retrieval with default empty config.
| ifw::slm::TEST_F | ( | TestSlConfig | , |
| GetLoopParam_Configured | ) |
Test GetLoopParam with configured parameter.
| ifw::slm::TEST_F | ( | TestSlConfig | , |
| GetLoopParam_VectorStringEntries | ) |
"params/<name>" lookups resolve to the configured value.
params is a vector_string ("name=value" entries) in the SlmServer typedef. GetLoopParam / TryGetLoopVectorParam resolve a "params/<name>" request by parsing that vector (config-ng cannot store it as a flattened map key), so the configured value is returned rather than a default. A bare entry (no '=') resolves to an empty string.
| ifw::slm::TEST_F | ( | TestSlConfig | , |
| GetNumSecondaryLoops_Default | ) |
Test that GetNumSecondaryLoops returns 0 for empty config.
| ifw::slm::TEST_F | ( | TestSlConfig | , |
| GetNumSecondaryLoops_OneEnabled | ) |
Test with a populated config (1 enabled loop)
| ifw::slm::TEST_F | ( | TestSlConfig | , |
| GetNumSecondaryLoops_TwoEnabled | ) |
Test GetNumSecondaryLoops with 2 enabled loops.
| ifw::slm::TEST_F | ( | TestSlConfig | , |
| IsLoopEnabled_Configured | ) |
Test IsLoopEnabled with a populated config.
| ifw::slm::TEST_F | ( | TestSlConfig | , |
| IsLoopEnabled_Default | ) |
Test that IsLoopEnabled returns false when loop is not configured.
| ifw::slm::TEST_F | ( | TestSlConfig | , |
| ToSupervisorSubstate_Mapping | ) |
ToSupervisorSubstate maps Running -> Idle and passes others through.
| ifw::slm::TEST_F | ( | TestSlConfig | , |
| TryGetLoopVectorParam_AndTypedConversion | ) |
TryGetLoopVectorParam reports found/not-found and ignores non-params names; the typed GetLoopParamFromConfig converts the parsed value.
| ifw::slm::TEST_F | ( | TestSuspendedActions | , |
| AbortDoesNotCountAsError | ) |
Abort() (Resume/Open) is a clean transition: it must not increment the consecutive-error count.
| ifw::slm::TEST_F | ( | TestSuspendedActions | , |
| CompleteResetsErrors | ) |
Complete() clears a pending error count.
| ifw::slm::TEST_F | ( | TestSuspendedActions | , |
| CreateLoop1SuspendedActions | ) |
The factory creates a suspended action group for loop 1.
| ifw::slm::TEST_F | ( | TestSuspendedActions | , |
| CreateLoopSuspendedActions_ValidRange | ) |
The factory creates a suspended action group for every loop (1-9).
| ifw::slm::TEST_F | ( | TestSuspendedActions | , |
| ExecuteMarksSuspendedWithoutError | ) |
Execute() (entering Suspended) marks the loop SUSPENDED and is not a cycle error.
| std::string ifw::slm::ToSupervisorSubstate | ( | const std::string & | substate | ) |
Translate an SLM substate into the vocabulary recognized by the ELT Supervisor (ifw-sup states.hpp). The Supervisor does not know "Running", so it is reported as "Idle" (operational and available) on the std/status topic. Recognized substates are passed through unchanged.
Note: the OLDB sm/status/substate key keeps the original substate (e.g. "Running") so the GUI can gate loop commands on it; the wire formats (the std/status topic and the GetStatus reply) use this mapping.
| bool ifw::slm::TryGetLoopVectorParam | ( | const rad::Config & | config, |
| int | loop_index, | ||
| const std::string & | param_name, | ||
| std::string & | out ) |
Resolve a "params/<name>" entry by parsing the per-loop params vector_string ("name=value" entries) directly from configuration.
params is declared vector_string in the SlmServer typedef, i.e. a YAML sequence node. config-ng does not allow adding a named (map) child such as params/<name> to a sequence node, so the value must be read back by parsing the vector rather than by a flattened map key.
| config | Configuration object. |
| loop_index | Loop index (1-based). |
| param_name | Parameter name; only names starting with "params/" are resolved here (anything else returns false). |
| out | [out] The resolved value (empty for a bare "name" entry). |
param_name is a "params/<name>" lookup that was found. | const std::string ifw::slm::CONFIG_DEFAULT_FILENAME = "config/ifw/slm/config.yaml" |
| const std::string ifw::slm::CONFIG_DEFAULT_LOG_LEVEL = "INFO" |
| const std::string ifw::slm::CONFIG_DEFAULT_LOG_PROPERTIES = "config/ifw/slm/log.properties" |
| const int ifw::slm::CONFIG_DEFAULT_LOOP_PERIOD_SEC = 60 |
| const std::string ifw::slm::CONFIG_DEFAULT_MODNAME = "slm" |
| const int ifw::slm::CONFIG_DEFAULT_OLDB_ASYNC_PERIOD = 1000 |
| const int ifw::slm::CONFIG_DEFAULT_OLDB_CONN_TIMEOUT = 1 |
| const std::string ifw::slm::CONFIG_DEFAULT_OLDB_URI_PREFIX = "cii.oldb:/elt/xxx/" |
| const std::string ifw::slm::CONFIG_DEFAULT_PROCNAME = "ifw-slm" |
| const std::string ifw::slm::CONFIG_DEFAULT_PUB_ENDPOINT = "zpb.ps://127.0.0.1:12082/" |
| const std::string ifw::slm::CONFIG_DEFAULT_REQ_ENDPOINT = "zpb.rr://127.0.0.1:12081/" |
| const std::string ifw::slm::CONFIG_DEFAULT_SCXML_APPEND = "" |
| const std::string ifw::slm::CONFIG_DEFAULT_SCXML_FILENAME = "config/ifw/slm/sm.xml" |
| const bool ifw::slm::CONFIG_DEFAULT_TRS_HEALTH_ENABLED = false |
| const std::string ifw::slm::CONFIG_DEFAULT_VERSION = std::string(VERSION) |
Default application configuration values.
|
constexpr |
| const std::string ifw::slm::KEY_SL_NUM_IN_USE = "config/SL_inUse" |
| const std::string ifw::slm::LOGGER_NAME = "ifwslm" |
| const std::string ifw::slm::SL_DB_NUM_IN_USE = "config/SL_inUse" |
OLDB attribute name for storing the number of secondary loops in use.
| const std::string ifw::slm::SL_KEY_ACTIVE = "active" |
| const std::string ifw::slm::SL_KEY_CYCLE_COUNTER = "cycle_counter" |
| const std::string ifw::slm::SL_KEY_CYCLE_FAILURE = "cycle_failure" |
| const std::string ifw::slm::SL_KEY_CYCLE_LAST = "cycle_last" |
| const std::string ifw::slm::SL_KEY_CYCLE_LAST_ERROR = "cycle_last_error" |
| const std::string ifw::slm::SL_KEY_CYCLE_LAST_SUCCESS = "cycle_last_success" |
| const std::string ifw::slm::SL_KEY_CYCLE_NERRORS = "cycle_nerrors" |
| const std::string ifw::slm::SL_KEY_CYCLE_NSUCCESS = "cycle_nsuccess" |
| const std::string ifw::slm::SL_KEY_CYCLE_START = "cycle_start" |
| const std::string ifw::slm::SL_KEY_CYCLE_VALUE = "cycle_value" |
| const std::string ifw::slm::SL_KEY_LOOP_NUM = "sl/loop_num" |
Per-loop configuration keys (sl is nested under server: in config-ng):
| const std::string ifw::slm::SL_KEY_LOOP_PREFIX = "sl/loop/" |
| const std::string ifw::slm::SL_KEY_STATE = "state" |
| const std::string ifw::slm::SL_KEY_TIMER_PERIOD_SEC = "timer_period_sec" |
| const int ifw::slm::SL_MAX_NUM = 9 |
Maximum number of secondary loops supported. Note: This value should match the enum values in this file.