sm_operation_mode

State machine managing normal warning protective and recovery modes.

Inherited Component

Inherited Requirements

Relationship Diagram

UML class diagram for sm_operation_mode

SW Unit Relations

Incoming Relations

Relation

UML Type

Visibility

Source Unit

Description

SWR-003

composition

private

ao_runtime_supervisor

Runtime supervisor embeds operation mode state machine.

Data Types

sm_operation_mode_contextstruct

Internal runtime context for sm_operation_mode.

Struct Members

Name

Type

Description

sm_state

uint8_t

Operation mode state.

startup_complete

bool

Startup completion flag.

degraded_mode

bool

Degraded mode flag.

transition_tick

uint32_t

Last transition tick.

sm_operation_mode_eventstruct

Event payload handled by sm_operation_mode.

Struct Members

Name

Type

Description

signal_id

uint16_t

Operation mode event id.

init_ok

bool

Init completed input.

fault_present

bool

Fault presence input.

shutdown_request

bool

Shutdown request input.

sm_operation_mode_resultenum

Result code for sm_operation_mode operations.

Enum Members

Name

Value

Description

OK

0

Mode transition applied.

INVALID_TRANSITION

1

Transition invalid for state.

DEGRADED_MODE

2

Transitioned to degraded mode.

Attributes

Attribute

Type

Visibility

Description

ctx

sm_operation_mode_context

private

Runtime context for sm_operation_mode state timing and error tracking.

Methods

dispatch

  • Return Type: sm_operation_mode_result

  • Visibility: public

  • Description: Process one sm_operation_mode event and update runtime outputs.

Parameters

Name

Type

Direction

Description

event

sm_operation_mode_event

in

Process one sm_operation_mode event and update runtime outputs.

init

  • Return Type: sm_operation_mode_result

  • Visibility: public

  • Description: Initialize sm_operation_mode runtime state and dependencies.

Dynamic Behaviour

State Machines

sm_operation_mode_state

@startuml
hide empty description


[*] --> Init
Init --> Normal : EVT_STARTUP_DONE

Normal --> Warning : EVT_WARN_ON
Warning --> Normal : EVT_WARN_CLEAR

Normal --> Protective : EVT_PROTECT_ENTER
Warning --> Protective : EVT_PROTECT_ENTER
Recovery --> Protective : EVT_PROTECT_ENTER

Normal --> Protective : EVT_FAULT_SET
Warning --> Protective : EVT_FAULT_SET

Protective --> Recovery : EVT_PROTECT_CLEAR
Recovery --> Normal : EVT_FAULT_CLEAR

state Protective {
  [*] --> Enforced
  Enforced : do / disable_active_outputs()
  Enforced : do / assert_fault_indication()
}

@enduml

This state machine defines high level operating mode transitions across Init Normal Warning Protective and Recovery and documents how warning events safety triggers and fault lifecycle events govern mode arbitration and output policy.

Sequence Diagrams

SEQ-001_Runtime_Event_Orchestration

@startuml

hide footbox
title Runtime Event Orchestration

participant ao_runtime_supervisor
participant evt_timer_service
participant evt_dispatcher
participant ao_monitoring
participant ao_control
participant ao_safety
participant ao_diagnostics
participant ao_modbus_server

ao_runtime_supervisor -> evt_timer_service : init periodic tick
ao_runtime_supervisor -> evt_dispatcher : init event loop
loop each scheduler tick
  evt_timer_service -> ao_runtime_supervisor : tick event
  ao_runtime_supervisor -> evt_dispatcher : dispatch cycle
  evt_dispatcher -> ao_monitoring : monitor_event
  evt_dispatcher -> ao_control : control_event
  evt_dispatcher -> ao_safety : safety_event
  evt_dispatcher -> ao_diagnostics : diagnostics_event
  evt_dispatcher -> ao_modbus_server : comms_event
end

@enduml

Primary runtime interoperability sequence showing scheduler tick propagation through dispatcher fan-out and deterministic active-object processing order across monitoring control safety diagnostics and communication units.