init
This commit is contained in:
@@ -0,0 +1,105 @@
|
||||
---
|
||||
source_files:
|
||||
- Common/DTS.Common/Enums/Sensors/SensorsList/DigitalInputFields.cs
|
||||
- Common/DTS.Common/Enums/Sensors/SensorsList/CanSettingFields.cs
|
||||
- Common/DTS.Common/Enums/Sensors/SensorsList/DigitalOutFields.cs
|
||||
- Common/DTS.Common/Enums/Sensors/SensorsList/SensorListTabs.cs
|
||||
- Common/DTS.Common/Enums/Sensors/SensorsList/UartSettingFields.cs
|
||||
- Common/DTS.Common/Enums/Sensors/SensorsList/SquibFields.cs
|
||||
- Common/DTS.Common/Enums/Sensors/SensorsList/StreamInSettingFields.cs
|
||||
- Common/DTS.Common/Enums/Sensors/SensorsList/StreamOutSettingFields.cs
|
||||
- Common/DTS.Common/Enums/Sensors/SensorsList/CACOption.cs
|
||||
- Common/DTS.Common/Enums/Sensors/SensorsList/AnalogSensorFields.cs
|
||||
generated_at: "2026-04-16T03:21:45.048133+00:00"
|
||||
model: "Qwen/Qwen3-Coder-Next-FP8"
|
||||
schema_version: 1
|
||||
sha256: "86047a70fdfac4c0"
|
||||
---
|
||||
|
||||
# SensorsList
|
||||
|
||||
## Documentation: Sensor Field Enumerations (`DTS.Common.Enums.Sensors.SensorsList`)
|
||||
|
||||
---
|
||||
|
||||
### 1. **Purpose**
|
||||
|
||||
This module defines a set of strongly-typed enumerations that specify the *valid field names* for various sensor configuration types within the DTS system. Each enumeration corresponds to a specific sensor category (e.g., `AnalogSensorFields`, `DigitalInputFields`, `SquibFields`) and enumerates the fields that may be used for operations such as data binding, serialization/deserialization, UI display, or configuration editing. These enums serve as metadata contracts—ensuring consistency across layers (e.g., UI, persistence, validation) when referring to sensor properties by name.
|
||||
|
||||
---
|
||||
|
||||
### 2. **Public Interface**
|
||||
|
||||
All types are `public enum`s in the `DTS.Common.Enums.Sensors.SensorsList` namespace.
|
||||
|
||||
| Enum | Fields | Description |
|
||||
|------|--------|-------------|
|
||||
| `DigitalInputFields` | `Included`, `SerialNumber`, `Description`, `Mode`, `ModifiedBy`, `LastModified` | Fields applicable to digital input sensors. |
|
||||
| `CanSettingFields` | `CanIsFD`, `CanArbBaseBitrate`, `CanArbBaseSJW`, `CanDataBitrate`, `CanDataSJW`, `CanFileType` | Fields for configuring CAN bus settings (including CAN FD parameters). |
|
||||
| `DigitalOutFields` | `Included`, `SerialNumber`, `Description`, `Delay`, `Duration`, `ModifiedBy`, `LastModified` | Fields applicable to digital output sensors. |
|
||||
| `SensorListTabs` | `ANALOG = 0`, `SQUIB = 1`, `DIGITAL_IN = 2`, `DIGITAL_OUT = 3`, `UART = 4`, `STREAM_IN = 5`, `STREAM_OUT = 6` | Defines tab identifiers for the sensor list UI; maps to sensor categories. |
|
||||
| `UartSettingFields` | `Included`, `SerialNumber`, `BaudRate`, `DataBits`, `StopBits`, `Parity`, `FlowControl`, `DataFormat`, `LastModifiedBy`, `LastModified` | Fields for UART configuration. |
|
||||
| `SquibFields` | `Included`, `SerialNumber`, `Description`, `ResistanceLow`, `ResistanceHigh`, `Id`, `Mode`, `Delay`, `Current`, `Duration`, `ModifiedBy`, `LastModified` | Fields for squib (explosive device) sensor configuration. |
|
||||
| `StreamInSettingFields` | `Included`, `SerialNumber`, `Description`, `LastModifiedBy`, `LastModified`, `UDPAddress` | Fields for stream-in (e.g., UDP-based input) configuration. |
|
||||
| `StreamOutSettingFields` | `Included`, `SerialNumber`, `Description`, `LastModifiedBy`, `LastModified`, `UDPProfile`, `UDPAddress`, `UDPTimeChannelId`, `UDPDataChannelId`, `UDPTmNSConfig`, `IRIGTimeDataPacketIntervalMs`, `TMATSIntervalMs` | Fields for stream-out (e.g., UDP-based output) configuration. |
|
||||
| `CACOption` | `Manual`, `Capacity`, `RangeHigh`, `RangeMedium`, `RangeLow` | Options for CAC (likely Calibration/Auto-Calibration) mode. Each value is annotated with `[DescriptionResourceAttribute]` referencing a resource key (e.g., `"CAC_Manual"`). |
|
||||
| `AnalogSensorFields` | `Included`, `SerialNumber`, `Description`, `Manufacturer`, `Model`, `Capacity`, `CalInterval`, `Sensitivity`, `LinearSensitivity`, `Resistance`, `Excitation`, `Units`, `Id`, `CalDate`, `CalDueDate`, `ModifiedBy`, `LastModified`, `IEPE`, `OutOfDate`, `InWarningPeriod`, `UsageMaximized`, `InUsageWarningPeriod`, `NonLinearCalucationType`, `ZeroMethod`, `ZeroMethodStart`, `ZeroMethodEnd`, `FirstUseDate`, `UserValue1`, `UserValue2`, `UserValue3`, `Assembly`, `UsageCount`, `MaximumUsage` | Fields for analog sensor configuration. Includes calibration, usage tracking, and nonlinear calibration parameters. |
|
||||
|
||||
> **Note**: `CACOption` is the only enum in this module that references an external attribute (`DescriptionResourceAttribute` from `DTS.Common.Base.Classes`). Its behavior depends on the presence and implementation of that attribute and associated resource files.
|
||||
|
||||
---
|
||||
|
||||
### 3. **Invariants**
|
||||
|
||||
- **Field Name Consistency**: Each enum value name is intended to map directly to a *property or field name* in a corresponding sensor configuration class (e.g., a `DigitalInputSensor` class would have a `Mode` property). The enum values are *not* arbitrary strings—they are compile-time constants representing known keys.
|
||||
- **`Included` is universal**: Every sensor-specific field enum (`DigitalInputFields`, `DigitalOutFields`, `UartSettingFields`, etc.) includes an `Included` field. This likely indicates whether the sensor instance is active/enabled in the current configuration.
|
||||
- **`LastModified` / `LastModifiedBy` / `ModifiedBy`**: Most enums include at least one of these metadata fields, suggesting auditability is required across sensor types. Note the inconsistency: `DigitalInputFields` and `DigitalOutFields` use `ModifiedBy`, while `UartSettingFields`, `StreamInSettingFields`, and `StreamOutSettingFields` use `LastModifiedBy`.
|
||||
- **`SensorListTabs` is zero-indexed and ordered**: The enum values are assigned explicit integer values starting at `0`, implying they may be used for array indexing or tab ordering in UI components.
|
||||
- **`CACOption` values are mutually exclusive**: As a standard enum, only one `CACOption` value can be selected at a time (unless bitwise flags are applied elsewhere, but no `[Flags]` attribute is present).
|
||||
- **Typo in `AnalogSensorFields`**: `NonLinearCalucationType` is misspelled (`Calucation` instead of `Calculation`). This is preserved as-is per source.
|
||||
|
||||
---
|
||||
|
||||
### 4. **Dependencies**
|
||||
|
||||
- **Internal Dependencies**:
|
||||
- `CACOption` depends on `DTS.Common.Base.Classes.DescriptionResourceAttribute`. This attribute is assumed to be defined in `DTS.Common.Base.Classes` and used for localization/resource-based description lookup.
|
||||
- All enums reside in the `DTS.Common` assembly (specifically, the `DTS.Common` project under `Common/DTS.Common/`).
|
||||
- **Consumers (inferred)**:
|
||||
- UI layers (e.g., WPF/WinForms) likely use `SensorListTabs` to manage tab ordering.
|
||||
- Data binding or serialization frameworks likely use the `*Fields` enums to map UI controls or JSON/XML properties to sensor configuration objects.
|
||||
- Validation or persistence logic likely uses the `*Fields` enums to determine which fields to include/exclude during save/load operations.
|
||||
|
||||
---
|
||||
|
||||
### 5. **Gotchas**
|
||||
|
||||
- **Inconsistent naming for modifier fields**:
|
||||
- `DigitalInputFields` and `DigitalOutFields` use `ModifiedBy`.
|
||||
- `UartSettingFields`, `StreamInSettingFields`, and `StreamOutSettingFields` use `LastModifiedBy`.
|
||||
- `AnalogSensorFields`, `SquibFields` use `ModifiedBy`.
|
||||
This inconsistency may cause bugs if code assumes uniform naming (e.g., in reflection-based logic or generic UI scaffolding).
|
||||
|
||||
- **`CACOption` requires resource infrastructure**:
|
||||
The enum values rely on `DescriptionResourceAttribute`, which is not defined in the provided source. Without the corresponding resource files (e.g., `.resx`) and runtime support for `DescriptionResourceAttribute`, the enum values will not display user-friendly descriptions.
|
||||
|
||||
- **`FirstUseDate` comment is inline**:
|
||||
In `AnalogSensorFields`, the comment `//13065 Sensor "First Use" Date` suggests a legacy requirement or ticket reference. Its presence implies special handling may be needed for this field (e.g., initialization logic, audit logging), but no further context is available.
|
||||
|
||||
- **`NonLinearCalucationType` is misspelled**:
|
||||
The typo (`Calucation` instead of `Calculation`) is preserved in the enum. Any code referencing this field must use the exact misspelled name to avoid runtime errors.
|
||||
|
||||
- **No `Included` in `CACOption`**:
|
||||
Unlike all other sensor field enums, `CACOption` does *not* include an `Included` field. This suggests `CACOption` is not a sensor configuration set but rather a *setting*—likely used within another configuration object (e.g., a CAN or analog sensor config).
|
||||
|
||||
- **`StreamInSettingFields` and `StreamOutSettingFields` share `UDPAddress`**:
|
||||
Both enums include `UDPAddress`, but `StreamOutSettingFields` has additional UDP-specific fields (`UDPProfile`, `UDPTimeChannelId`, etc.). Ensure consumers do not assume `UDPAddress` alone is sufficient for stream-out configuration.
|
||||
|
||||
- **No `Included` in `CanSettingFields`**:
|
||||
This enum lacks an `Included` field, implying CAN settings may be enabled/disabled elsewhere (e.g., at a higher level in the configuration hierarchy).
|
||||
|
||||
- **No `Included` in `SensorListTabs`**:
|
||||
This enum represents *tabs*, not sensor instances, so `Included` is not applicable—but developers might mistakenly expect it.
|
||||
|
||||
- **None identified from source alone.**
|
||||
*(Note: The above gotchas are inferred from patterns and inconsistencies in the provided source.)*
|
||||
Reference in New Issue
Block a user