init
This commit is contained in:
@@ -0,0 +1,80 @@
|
||||
---
|
||||
source_files:
|
||||
- Common/DTS.Common/XMLUtils/TestSetupExportXML/TestSetups/TestSetup/Groups/Group/GroupXMLClass.cs
|
||||
generated_at: "2026-04-16T03:23:39.376658+00:00"
|
||||
model: "Qwen/Qwen3-Coder-Next-FP8"
|
||||
schema_version: 1
|
||||
sha256: "962edca5954a813a"
|
||||
---
|
||||
|
||||
# Group
|
||||
|
||||
## 1. Purpose
|
||||
`GroupXMLClass` is a data transfer object (DTO) used to serialize and deserialize test group definitions to/from XML within the DTS (Device Test System) framework. It represents a logical grouping of test hardware and channels in a test setup, enabling structured persistence and exchange of test configuration data. The class is specifically tailored for XML serialization via `System.Xml.Serialization`, supporting round-trip conversion between in-memory objects and XML documents conforming to the expected schema for test setups.
|
||||
|
||||
## 2. Public Interface
|
||||
|
||||
- **`GroupXMLClass()`**
|
||||
Parameterless constructor. Initializes `HardwareList` to a new `HardwareListXMLClass` instance and `Channel` to a new empty `List<ChannelXMLClass>`. Required for XML deserialization.
|
||||
|
||||
- **`string Name { get; set; }`**
|
||||
Internal identifier for the group. Serialized as `<Name>` element.
|
||||
|
||||
- **`string DisplayName { get; set; }`**
|
||||
Human-readable label for UI display. Serialized as `<DisplayName>` element.
|
||||
|
||||
- **`string Description { get; set; }`**
|
||||
Optional descriptive text for the group. Serialized as `<Description>` element.
|
||||
|
||||
- **`string TestSetupName { get; set; }`**
|
||||
Name of the parent test setup this group belongs to. Serialized as `<TestSetupName>` element.
|
||||
|
||||
- **`string DisplayOrder { get; set; }`**
|
||||
String-based ordering hint (e.g., "1", "2", "A", "B") to determine display sequence. Serialized as `<DisplayOrder>` element.
|
||||
|
||||
- **`string Position { get; set; }`**
|
||||
Physical or logical position indicator (e.g., "Top", "Bottom", "1.2"). Serialized as `<Position>` element.
|
||||
|
||||
- **`string TestObjectType { get; set; }`**
|
||||
Type of test object associated with this group (e.g., "Device", "Fixture"). Serialized as `<TestObjectType>` element.
|
||||
|
||||
- **`string Id { get; set; }`**
|
||||
Unique identifier for the group instance. Serialized as `<Id>` element.
|
||||
|
||||
- **`string StaticGroupId { get; set; }`**
|
||||
Identifier linking to a static template or base group definition. Serialized as `<StaticGroupId>` element.
|
||||
|
||||
- **`HardwareListXMLClass HardwareList { get; set; }`**
|
||||
Container for hardware-related metadata (e.g., device connections, power supplies). Serialized as `<HardwareList>` element. Never null after construction.
|
||||
|
||||
- **`List<ChannelXMLClass> Channel { get; set; }`**
|
||||
Ordered list of channel definitions associated with this group. Serialized as repeated `<Channel>` elements. Initialized to an empty list by the constructor; may be empty but not null.
|
||||
|
||||
## 3. Invariants
|
||||
|
||||
- `HardwareList` is **never null** after construction (ensured by constructor).
|
||||
- `Channel` is **never null** after construction (ensured by constructor), though it may be empty.
|
||||
- All string properties (`Name`, `DisplayName`, etc.) may be `null` or empty unless constrained by higher-level validation logic (not enforced in this class).
|
||||
- XML element names are strictly controlled via `[XmlElement]` attributes: `HardwareList` and `Channel` map directly to those element names; all other properties serialize as elements named after the property (e.g., `<Name>`, `<Channel>`).
|
||||
- The class assumes `ChannelXMLClass` and `HardwareListXMLClass` are serializable types (not validated here, but required for successful XML round-trip).
|
||||
|
||||
## 4. Dependencies
|
||||
|
||||
- **Internal dependencies (from source):**
|
||||
- `HardwareListXMLClass` (used as a property type; must be defined elsewhere in the codebase).
|
||||
- `ChannelXMLClass` (used as a list element type; must be defined elsewhere).
|
||||
- `System.Xml.Serialization` (for `[XmlElement]` attribute usage).
|
||||
|
||||
- **External dependencies (inferred):**
|
||||
- `DTS.Common.XMLUtils` namespace (contains related XML DTOs like `TestSetupXMLClass`, `ChannelXMLClass`, etc.).
|
||||
- Likely consumed by XML serialization/deserialization utilities (e.g., `XmlSerializer`) and higher-level test setup management classes (e.g., `TestSetupXMLClass` would contain a list of `GroupXMLClass`).
|
||||
|
||||
## 5. Gotchas
|
||||
|
||||
- **String-based ordering fields:** `DisplayOrder` and `Position` are stored as `string`, not numeric types, despite implying ordering/position semantics. Consumers must handle parsing and comparison logic (e.g., lexicographic ordering may not match intended numeric order if values like "1", "2", "10" are used).
|
||||
- **No validation:** The class performs no runtime validation of property values (e.g., `Id` uniqueness, required fields like `Name`). Validation is expected to occur at a higher layer.
|
||||
- **Constructor-only initialization:** The `Channel` list is initialized *only* in the parameterless constructor. If an instance is created via reflection or deserialization without invoking the constructor (e.g., `FormatterServices.GetUninitializedObject`), `Channel` may be `null`—though `XmlSerializer` always calls the parameterless constructor, this is a risk if the class is instantiated manually.
|
||||
- **No inheritance or interfaces:** The class is a plain DTO with no interfaces or extensibility hooks; modifications require direct changes.
|
||||
- **No documentation on semantics:** The meaning of fields like `StaticGroupId` or `TestObjectType` is not clarified in this file; their usage depends on external documentation or schema.
|
||||
|
||||
None identified beyond the above.
|
||||
@@ -0,0 +1,78 @@
|
||||
---
|
||||
source_files:
|
||||
- Common/DTS.Common/XMLUtils/TestSetupExportXML/TestSetups/TestSetup/Groups/Group/Channel/ChannelXMLClass.cs
|
||||
generated_at: "2026-04-16T03:23:54.057890+00:00"
|
||||
model: "Qwen/Qwen3-Coder-Next-FP8"
|
||||
schema_version: 1
|
||||
sha256: "664ac61411c95d4f"
|
||||
---
|
||||
|
||||
# Channel
|
||||
|
||||
## 1. Purpose
|
||||
This module defines the `ChannelXMLClass`, a data transfer object (DTO) used to serialize and deserialize channel configuration data for test setups in XML format. It serves as the structured representation of a single channel within a test setup hierarchy (nested under `Group` → `Channel`), capturing both standardized (ISO) and user-defined naming, status (enabled/disabled), and hardware mapping information (e.g., sensor, DAS, channel index). The class is specifically designed for use with `System.Xml.Serialization` to support export/import of test setup configurations.
|
||||
|
||||
## 2. Public Interface
|
||||
All members are public instance properties; no methods or nested types are defined.
|
||||
|
||||
- **`ChannelXMLClass()`**
|
||||
Parameterless constructor. Initializes the `Settings` property to a new `SettingsXMLClass` instance.
|
||||
|
||||
- **`string ISOChannelName { get; set; }`**
|
||||
Gets or sets the standardized (ISO-compliant) channel name.
|
||||
|
||||
- **`string ISOCode { get; set; }`**
|
||||
Gets or sets the standardized (ISO) channel code.
|
||||
|
||||
- **`string UserChannelName { get; set; }`**
|
||||
Gets or sets the user-defined (custom) channel name.
|
||||
|
||||
- **`string UserCode { get; set; }`**
|
||||
Gets or sets the user-defined (custom) channel code.
|
||||
|
||||
- **`string Disabled { get; set; }`**
|
||||
Gets or sets a string value indicating whether the channel is disabled. *Note: The type is `string` (not `bool`), implying serialization of `"true"`/`"false"`, `"1"`/`"0"`, or similar—exact semantics depend on usage context.*
|
||||
|
||||
- **`SettingsXMLClass Settings { get; set; }`**
|
||||
Gets or sets the channel’s settings object. Marked with `[XmlElement("Settings")]`, meaning it will be serialized as a nested `<Settings>` element (not an attribute or wrapper element).
|
||||
|
||||
- **`string SensorId { get; set; }`**
|
||||
Gets or sets the identifier for the sensor associated with this channel.
|
||||
|
||||
- **`string DASId { get; set; }`**
|
||||
Gets or sets the identifier for the Data Acquisition System (DAS) device.
|
||||
|
||||
- **`string DASChannelIdx { get; set; }`**
|
||||
Gets or sets the channel index *within* the DAS device (0-based or 1-based—context-dependent).
|
||||
|
||||
- **`string TestSetupOrder { get; set; }`**
|
||||
Gets or sets the order/index of this channel within the full test setup (likely for ordering/sorting).
|
||||
|
||||
- **`string GroupOrder { get; set; }`**
|
||||
Gets or sets the order/index of this channel *within its parent group*.
|
||||
|
||||
## 3. Invariants
|
||||
- The `Settings` property is guaranteed to be non-null *after construction* due to initialization in the constructor. However, it may be reassigned to `null` externally (no null-checking is present in the class).
|
||||
- All properties are of type `string`, including logically boolean (`Disabled`) and numeric (`DASChannelIdx`, `TestSetupOrder`, `GroupOrder`) fields. This suggests values are stored as strings in XML and may require parsing/conversion at usage boundaries.
|
||||
- The `[XmlElement("Settings")]` attribute enforces that `Settings` is serialized as a direct child element named `"Settings"` (not nested under a `"Channel"` wrapper or as an attribute).
|
||||
- No validation rules are enforced in the class itself (e.g., no null/empty checks, no format validation on codes or IDs).
|
||||
|
||||
## 4. Dependencies
|
||||
- **Direct Dependencies (from imports):**
|
||||
- `System` (core types: `string`, `object`, etc.)
|
||||
- `System.Collections.Generic`, `System.Linq`, `System.Text`, `System.Threading.Tasks` (likely unused in this file but included by default)
|
||||
- `System.Xml.Serialization` (for `[XmlElement]` attribute)
|
||||
- **Type Dependencies (from property types):**
|
||||
- `SettingsXMLClass` (used in `Settings` property; defined elsewhere in the same namespace `DTS.Common.XMLUtils`).
|
||||
- **Inferred Usage:**
|
||||
- This class is part of a larger XML serialization hierarchy (e.g., `TestSetup`, `Group`, `Channel`), as indicated by the file path and namespace. It is consumed by XML serialization/deserialization logic elsewhere in the codebase.
|
||||
|
||||
## 5. Gotchas
|
||||
- **`Disabled` is a `string`, not a `bool`**: This is error-prone. Consumers must handle parsing (e.g., case-insensitive `"true"`, `"false"`, `"1"`, `"0"`) and decide how to interpret unexpected values (e.g., `null`, `"yes"`, `"disabled"`).
|
||||
- **Numeric fields (`DASChannelIdx`, `TestSetupOrder`, `GroupOrder`) are `string`**: Requires parsing before arithmetic or comparison. No validation ensures these are numeric strings.
|
||||
- **No null-safety**: Properties like `ISOChannelName`, `UserChannelName`, or `Settings` may be `null` after deserialization if absent in the XML (unless constrained by schema/consumer logic).
|
||||
- **Order fields (`TestSetupOrder`, `GroupOrder`) lack semantics**: Their meaning (0-based vs. 1-based index, sort key, etc.) is not defined in this class and must be inferred from usage.
|
||||
- **No documentation on XML schema**: The class assumes a specific XML structure (e.g., `<Channel>...</Channel>`), but the expected element/attribute layout (beyond `Settings`) is not self-evident.
|
||||
- **No immutability or validation**: Designed purely as a DTO; not suitable for direct business logic without additional layers.
|
||||
|
||||
*None identified from source alone.*
|
||||
@@ -0,0 +1,44 @@
|
||||
---
|
||||
source_files:
|
||||
- Common/DTS.Common/XMLUtils/TestSetupExportXML/TestSetups/TestSetup/Groups/Group/Channel/Settings/SettingsXMLClass.cs
|
||||
generated_at: "2026-04-16T03:24:01.382044+00:00"
|
||||
model: "Qwen/Qwen3-Coder-Next-FP8"
|
||||
schema_version: 1
|
||||
sha256: "24437ea76542151b"
|
||||
---
|
||||
|
||||
# Settings
|
||||
|
||||
## 1. Purpose
|
||||
The `SettingsXMLClass` is a data transfer object (DTO) used to serialize and deserialize channel-specific configuration settings for test setups in the DTS system. It acts as a structured container for XML persistence of channel parameters—such as filter class, polarity, range, zeroing method, and associated offsets—enabling consistent storage and retrieval of hardware or signal conditioning settings during test setup export/import workflows.
|
||||
|
||||
## 2. Public Interface
|
||||
All members are public read-write properties of type `string`. No methods are defined.
|
||||
|
||||
- **`FilterClass`** (`string`): Represents the classification or type of filter applied to the channel (e.g., "LowPass", "HighPass").
|
||||
- **`Polarity`** (`string`): Indicates the signal polarity setting (e.g., "AC", "DC", "AC+DC").
|
||||
- **`Range`** (`string`): Specifies the measurement or output range (e.g., "±10V", "0–5A").
|
||||
- **`ZeroMethod`** (`string`): Defines the zeroing approach used (e.g., "Auto", "Manual", "None").
|
||||
- **`ZeroMethodStart`** (`string`): Specifies the zeroing method applied at the start of a measurement sequence.
|
||||
- **`ZeroMethodEnd`** (`string`): Specifies the zeroing method applied at the end of a measurement sequence.
|
||||
- **`InitialOffset`** (`string`): Holds the initial offset value (e.g., "0.001", "-0.5").
|
||||
- **`UserValue1`**, **`UserValue2`**, **`UserValue3`** (`string`): Generic user-defined string fields for extensible configuration (purpose not documented in source).
|
||||
|
||||
## 3. Invariants
|
||||
- All properties are nullable (`null` is a valid value) and have no enforced non-null constraints in the class definition.
|
||||
- No validation, normalization, or formatting rules are enforced on property values (e.g., `Range` could be any arbitrary string).
|
||||
- The class assumes a fixed set of 11 string-typed fields; no dynamic or extensible schema is present.
|
||||
- Ordering of properties in XML serialization is not guaranteed by the class itself (depends on serializer behavior, e.g., `XmlSerializer` typically uses declaration order).
|
||||
|
||||
## 4. Dependencies
|
||||
- **Dependencies**: None (only uses `System.*` namespaces; no external project or library references).
|
||||
- **Depended upon**: Inferred from namespace (`DTS.Common.XMLUtils`) and class name—likely consumed by XML serialization/deserialization logic elsewhere in the `DTS.Common.XMLUtils` module (e.g., methods that convert between `SettingsXMLClass` and XML elements). Exact consumers are not visible in this file.
|
||||
|
||||
## 5. Gotchas
|
||||
- **No validation or business logic**: Values are stored as raw strings; downstream consumers must interpret and validate semantics (e.g., `ZeroMethod` values like `"Auto"` vs `"Manual"` are not enforced).
|
||||
- **Ambiguous `UserValue*` fields**: The purpose of `UserValue1`, `UserValue2`, and `UserValue3` is undocumented—consumers may rely on implicit conventions (e.g., `UserValue1` = gain, `UserValue2` = coupling), risking fragility.
|
||||
- **String-based typed data**: Numerical or enum-like values (e.g., `Range`, `InitialOffset`) are stored as strings, increasing risk of parsing errors or typos (e.g., `"±10V"` vs `"+/-10V"`).
|
||||
- **No versioning or backward/forward compatibility handling**: Changes to the schema (e.g., adding/removing fields) may break XML round-trips without additional logic.
|
||||
- **No XML-specific attributes**: The class lacks `[XmlElement]`, `[XmlAttribute]`, or `[DataContract]` annotations—behavior during XML serialization depends on default .NET serializer conventions (e.g., property names map directly to element names).
|
||||
|
||||
None identified beyond the above.
|
||||
@@ -0,0 +1,49 @@
|
||||
---
|
||||
source_files:
|
||||
- Common/DTS.Common/XMLUtils/TestSetupExportXML/TestSetups/TestSetup/Groups/Group/HardwareList/HardwareListXMLClass.cs
|
||||
generated_at: "2026-04-16T03:23:43.663947+00:00"
|
||||
model: "Qwen/Qwen3-Coder-Next-FP8"
|
||||
schema_version: 1
|
||||
sha256: "ab08dc04bffd8487"
|
||||
---
|
||||
|
||||
# HardwareList
|
||||
|
||||
## 1. Purpose
|
||||
This module defines a data contract class (`HardwareListXMLClass`) used for serializing and deserializing hardware list data to/from XML within the DTS system. It serves as a structured container for a collection of hardware identifiers (represented as strings), enabling interoperability with XML-based export/import workflows—specifically in the context of test setup configuration data under the `TestSetups/TestSetup/Groups/Group/HardwareList` path.
|
||||
|
||||
## 2. Public Interface
|
||||
- **`HardwareListXMLClass()`**
|
||||
Parameterless constructor. Initializes the `Hardware` property to an empty `List<string>`.
|
||||
|
||||
- **`List<string> Hardware { get; set; }`**
|
||||
Public property annotated with `[XmlElement("Hardware")]`. Holds the list of hardware identifiers. During XML serialization/deserialization, each string in this list is serialized as a `<Hardware>` element (not wrapped in a container element).
|
||||
|
||||
Example XML output for `Hardware = ["HW001", "HW002"]`:
|
||||
```xml
|
||||
<HardwareListXMLClass>
|
||||
<Hardware>HW001</Hardware>
|
||||
<Hardware>HW002</Hardware>
|
||||
</HardwareListXMLClass>
|
||||
```
|
||||
|
||||
## 3. Invariants
|
||||
- The `Hardware` list is **never null** after construction (guaranteed by the constructor initializing it to `new List<string>()`).
|
||||
- All elements in the `Hardware` list are of type `string`.
|
||||
- XML serialization uses `System.Xml.Serialization.XmlSerializer`; element names are strictly `"Hardware"` per the `[XmlElement("Hardware")]` attribute.
|
||||
- No validation is performed on the contents of the `Hardware` list (e.g., no uniqueness, format, or non-empty checks enforced by this class).
|
||||
|
||||
## 4. Dependencies
|
||||
- **Dependencies on other modules**:
|
||||
- `System.Xml.Serialization` (via `XmlElementAttribute`)
|
||||
- Standard .NET libraries (`System.Collections.Generic`, `System.Linq`, etc.)
|
||||
- **Dependencies *of* this module**:
|
||||
- This class is part of the `DTS.Common.XMLUtils` namespace, implying it is used in XML utility pipelines (e.g., test setup export).
|
||||
- Likely consumed by higher-level XML serialization logic (e.g., a serializer/deserializer for `TestSetup` objects), though no direct references to other types in this file are present.
|
||||
|
||||
## 5. Gotchas
|
||||
- The class name `HardwareListXMLClass` is generic and non-descriptive; its purpose is only clear from its usage context (e.g., file path `.../HardwareList/HardwareListXMLClass.cs`).
|
||||
- No explicit XML root element name is defined (e.g., via `[XmlRoot]`), so the root element during serialization will default to the class name (`HardwareListXMLClass`). This may conflict with expected XML schema if the consumer expects a different root tag (e.g., `<HardwareList>`).
|
||||
- The `[XmlElement("Hardware")]` attribute applies to the *list items*, not the container—this is correct for flattening the list into repeated elements, but could be misinterpreted if expecting a wrapper element.
|
||||
- No error handling or null-safety is implemented beyond constructor initialization; external code must ensure thread-safety if used concurrently.
|
||||
- None identified from source alone.
|
||||
@@ -0,0 +1,40 @@
|
||||
---
|
||||
source_files:
|
||||
- Common/DTS.Common/XMLUtils/TestSetupExportXML/TestSetups/TestSetup/Groups/Group/HardwareList/Hardware/HardwareXMLClass.cs
|
||||
generated_at: "2026-04-16T03:23:50.939100+00:00"
|
||||
model: "Qwen/Qwen3-Coder-Next-FP8"
|
||||
schema_version: 1
|
||||
sha256: "3cfe73099bdaf1e6"
|
||||
---
|
||||
|
||||
# Hardware
|
||||
|
||||
1. **Purpose**
|
||||
This module defines a simple data transfer object (DTO) class, `HardwareXMLClass`, used for serializing/deserializing hardware identifiers within XML-based test setup export/import workflows. It resides in the `DTS.Common.XMLUtils` namespace and serves as a structured container for a single hardware name string, likely used in XML serialization contexts (e.g., as part of a collection in a larger XML document representing test setups).
|
||||
|
||||
2. **Public Interface**
|
||||
- `public class HardwareXMLClass`
|
||||
A public class with one auto-implemented property:
|
||||
- `public string Hardware { get; set; }`
|
||||
Gets or sets the hardware identifier (e.g., a hardware name or model string). This property is intended to hold the value that will be serialized to or deserialized from an XML element or attribute named `Hardware`.
|
||||
|
||||
3. **Invariants**
|
||||
- The `Hardware` property may be `null` or an empty string; no validation or non-null enforcement is present in the class itself.
|
||||
- No ordering, uniqueness, or semantic constraints are enforced by this class (e.g., duplicate hardware names are not prevented).
|
||||
- The class is a pure data container with no behavior beyond property accessors.
|
||||
|
||||
4. **Dependencies**
|
||||
- **Dependencies on external modules**:
|
||||
- `System` (core runtime types: `string`, `System.*` namespaces used implicitly via `using` directives).
|
||||
- Standard .NET libraries (`System.Collections.Generic`, `System.Linq`, etc.) are imported but unused in this file.
|
||||
- **Used by**:
|
||||
- Inferred to be consumed by XML serialization logic elsewhere in `DTS.Common.XMLUtils` (e.g., `XmlSerializer` usage in related classes like `TestSetupXMLClass`, `GroupXMLClass`, etc.).
|
||||
- Likely part of a hierarchy under `TestSetups/TestSetup/Groups/Group/HardwareList/Hardware/` in XML documents (based on file path and namespace).
|
||||
- **Depends on**: Nothing beyond base .NET types.
|
||||
|
||||
5. **Gotchas**
|
||||
- The class name `HardwareXMLClass` is generic and non-descriptive; it does not clarify its specific role (e.g., `HardwareEntry` or `HardwareItem` might be clearer).
|
||||
- No XML serialization attributes (e.g., `[XmlElement]`, `[DataContract]`) are present in this file—serialization behavior depends on how this class is used in *other* types (e.g., via properties in parent classes decorated with attributes).
|
||||
- The property name `Hardware` (same as the class name sans `Class`) may cause confusion in XML output (e.g., `<Hardware>...</Hardware>`), but this is consistent with typical DTO patterns.
|
||||
- No null-safety or defensive copying is implemented; consumers must handle potential `null` values.
|
||||
- None identified from source alone.
|
||||
Reference in New Issue
Block a user