Files
DP44/docs/ai/DataPRO/StateMachine.Tests/StatusAndParameters.md
2026-04-17 14:55:32 -04:00

3.6 KiB

source_files, generated_at, model, schema_version, sha256
source_files generated_at model schema_version sha256
DataPRO/StateMachine.Tests/StatusAndParameters/GlobalStatusInformationShould.cs
2026-04-17T15:59:41.130173+00:00 zai-org/GLM-5-FP8 1 c691b9e3930f9a67

GlobalStatusInformation Module Documentation

1. Purpose

GlobalStatusInformation is a state tracking class within the DTS.DASLib.Service.StateMachine namespace that manages collections of device units (IDASCommunication objects) across multiple operational states: Realtime, Arm, LowPower, and HighPower. It serves as a central registry for tracking which devices are in which operational mode within a state machine context, and includes an ExcitationOn flag for system-wide excitation state.

2. Public Interface

The following members are inferred from test usage. The actual implementation file was not provided, so signatures are reconstructed from test patterns:

Member Signature Behavior
GetUnitsInRealtime IList<IDASCommunication> GetUnitsInRealtime() Returns a list of units currently in realtime mode. Returns empty list when no units are registered.
AddUnitInRealtime void AddUnitInRealtime(IDASCommunication device) Adds a device to the realtime collection. Duplicate references are ignored.
GetUnitsInArm IList<IDASCommunication> GetUnitsInArm() Returns a list of units currently in arm state. Returns empty list when no units are registered.
AddUnitInArm void AddUnitInArm(IDASCommunication device) Adds a device to the arm collection. Duplicate references are ignored.
GetUnitsAtLowPower IList<IDASCommunication> GetUnitsAtLowPower() Returns a list of units currently at low power. Returns empty list when no units are registered.
AddUnitAtLowPower void AddUnitAtLowPower(IDASCommunication device) Adds a device to the low power collection. Removes the device from high power collection if present. Duplicate references are ignored.
GetUnitsAtHighPower IList<IDASCommunication> GetUnitsAtHighPower() Returns a list of units currently at high power. Returns empty list when no units are registered.
AddUnitAtHighPower void AddUnitAtHighPower(IDASCommunication device) Adds a device to the high power collection. Removes the device from low power collection if present. Duplicate references are ignored.
Reset void Reset() Clears all unit collections (Realtime, Arm, LowPower, HighPower) and sets ExcitationOn to false.
ExcitationOn bool ExcitationOn { get; set; } Boolean property tracking excitation state. Defaults to false.

Note: The exact return type of the GetUnits* methods is unclear from source alone. Tests show the return value has a .Length property and supports indexer access ([0], [1]), suggesting array-like behavior, yet tests also compare against new List<IDASCommunication>().

3. Invariants

  • Empty State: All unit collections are empty upon instantiation; ExcitationOn is false.
  • No Duplicate References: Adding the same object reference to any collection more than once results in only one entry.
  • Mutual Exclusivity (LowPower/HighPower): A unit cannot exist in both LowPower and HighPower collections simultaneously. Adding to one removes from the other.
  • Independence of Realtime/Arm Collections: The Realtime and Arm collections appear independent of LowPower/HighPower (a unit can exist in multiple non-mutually-exclusive states).
  • Order Preservation: Units are retrieved in the order they were added (index 0 is first added, etc.).

4. Dependencies

This module depends on: