5.5 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |
|---|---|---|---|---|---|
|
2026-04-16T03:57:12.321531+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | 155f476d57ed5515 |
PowerProInput
1. Purpose
This module provides a concrete implementation of SLICEBaseInputReader for reading diagnostic inputs from a PowerPro device via the SLICE DAS (Data Acquisition System) infrastructure. It enables retrieval of key power-related diagnostic metrics—specifically input voltage, device temperature, and direct backup (battery) voltage—by executing synchronous measurements using the MeasurePowerProDiagnosticChannel command class. Its role is to abstract low-level communication details and expose standardized, type-safe properties for downstream system components (e.g., monitoring, diagnostics, or control logic) to consume real-time PowerPro hardware state.
2. Public Interface
SLICEPowerProInputReader(ICommunication comm)
- Type: Constructor
- Behavior: Initializes a new instance with the specified
ICommunicationinterface (_comm) used for hardware interaction. Delegates to the base class constructor with the samecomminstance.
override double InputMilliVolts { get; }
- Type: Read-only property
- Behavior: Returns the PowerPro input voltage in millivolts. Internally creates a
MeasurePowerProDiagnosticChannelinstance, configures it to readInputVoltage_Aon device group0, device ID0, executes a synchronous measurement, and returnsMeasurement * 1000.0.
override double TemperatureC { get; }
- Type: Read-only property
- Behavior: Returns the PowerPro internal temperature in degrees Celsius. Internally creates a
MeasurePowerProDiagnosticChannel, setsChanneltoTemperatureC, configures device group and ID to0, executes a synchronous measurement, and returnsMeasurementdirectly.
override double DirectBackupMilliVolts { get; }
- Type: Read-only property
- Behavior: Returns the direct backup (battery) voltage in millivolts. Internally creates a
MeasurePowerProDiagnosticChannel, setsChanneltoBatteryVoltage, configures device group and ID to0, executes a synchronous measurement, and returnsMeasurement * 1000.0.
Note
: All three properties override abstract members defined in the base class
SLICEBaseInputReader. Each property performs a synchronous hardware read on every access.
3. Invariants
- Device targeting: All measurements are hard-coded to
DeviceGroup = 0andDeviceID = 0. No support for multi-device or configurable addressing is present. - Unit consistency:
InputMilliVoltsandDirectBackupMilliVoltsare returned in millivolts (i.e.,Measurement * 1000.0).TemperatureCis returned in degrees Celsius (i.e., rawMeasurementvalue).
- Synchronous execution: Every property getter performs a blocking
SyncExecute()call; no async or buffered reads are used. - Channel mapping: Only three specific diagnostic channels are supported:
InputVoltage_A,TemperatureC, andBatteryVoltage. Other channels inPowerProDiagnosticChannelListare not exposed via this class.
4. Dependencies
Dependencies on this module:
SLICEBaseInputReader(base class) — defines the abstract properties (InputMilliVolts,TemperatureC,DirectBackupMilliVolts) implemented here.ICommunication— injected dependency for low-level hardware communication.MeasurePowerProDiagnosticChannel— concrete command class fromDTS.DASLib.Command.SLICEused to perform synchronous measurements.
Dependencies of this module:
- External libraries:
DTS.Common.Interface.DASFactory(forICommunication)DTS.DASLib.Command.SLICE(forMeasurePowerProDiagnosticChannel)
- Inferred callers: Likely consumed by higher-level services (e.g., monitoring daemons, status reporters) that inherit from or use
SLICEBaseInputReaderpolymorphically.
5. Gotchas
- Repeated hardware calls per property access: Each property read triggers a new
MeasurePowerProDiagnosticChannelinstance and a fullSyncExecute()round-trip to the device. This may cause performance issues if properties are accessed frequently (e.g., in tight loops or high-frequency telemetry). Caching is not implemented. - Hard-coded device addressing: All reads target
DeviceGroup = 0,DeviceID = 0. If the PowerPro system supports multiple devices, this class cannot be used without modification. - No error handling visible: The source does not show explicit exception handling (e.g., for communication failures, invalid measurements). Failures in
SyncExecute()or invalidmeasure.Measurementvalues may propagate unhandled exceptions. - Unit ambiguity in base
Measurement: The rawmeasure.Measurementvalue’s unit (e.g., volts, °C) is assumed by context but not enforced by this class. Incorrect assumptions about the underlyingMeasurePowerProDiagnosticChannel’s output units could lead to incorrect scaling. - No thread-safety guarantees: Since each property creates a new
MeasurePowerProDiagnosticChanneland callsSyncExecute()on_comm, concurrent access to multiple properties may be safe if_commis thread-safe, but this is not documented or verified in the source.
None identified from source alone. (Note: The above gotchas are inferred from observed patterns in the code, not explicit warnings.)