F1: EptStateMachine (E116 Equipment Performance Tracking)

Adds the six E116-0712 §6.2 buckets for classifying equipment time:

  NonScheduledTime (0)   not scheduled to operate
  ScheduledDowntime (1)  planned maintenance window
  UnscheduledDowntime (2) faults / unplanned stoppage
  Engineering (3)        engineering / qualification time
  Standby (4)            idle but available
  Productive (5)         actively producing

Wire-byte values pinned via static_assert to E116 §10.3.

The FSM is a classifier rather than a strict lifecycle — every
(state, event) pair is legal — but it remains data-driven through the
shared CarrierTransitionTable template so the default cross-product is
expressible declaratively.

The state-change handler also surfaces dwell time (how long the
previous state was held) computed off std::chrono::steady_clock, so
accounting code can compute MTBF / availability / utilization from a
single source without maintaining a parallel timestamp log.

4 test cases cover the initial state, every event firing, dwell-time
reporting, and the no-op same-state event (no handler call).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-06-08 02:17:16 +02:00
parent 777fa5e9f9
commit 7bff01c363
4 changed files with 235 additions and 0 deletions
+2
View File
@@ -57,6 +57,7 @@ add_library(secsgem
src/gem/carrier_state.cpp
src/gem/load_port_state.cpp
src/gem/substrate_state.cpp
src/gem/ept_state.cpp
src/gem/host_handler.cpp
src/config/loader.cpp
src/endpoint.cpp
@@ -104,6 +105,7 @@ add_executable(secsgem_tests
tests/test_carrier_state.cpp
tests/test_carriers.cpp
tests/test_substrates.cpp
tests/test_ept.cpp
)
target_link_libraries(secsgem_tests PRIVATE secsgem doctest::doctest)
target_compile_definitions(secsgem_tests PRIVATE