Files
DP44/enriched-qwen3-coder-next/Common/DTS.Common/Enums/DBExport.md

91 lines
8.7 KiB
Markdown
Raw Normal View History

2026-04-17 14:55:32 -04:00
---
source_files:
- Common/DTS.Common/Enums/DBExport/TestObjectFields.cs
- Common/DTS.Common/Enums/DBExport/CustomDirectionFields.cs
- Common/DTS.Common/Enums/DBExport/CustomFinLoc2Fields.cs
- Common/DTS.Common/Enums/DBExport/CustomFinLoc1Fields.cs
- Common/DTS.Common/Enums/DBExport/CustomFinLoc3Fields.cs
- Common/DTS.Common/Enums/DBExport/CustomFilterFields.cs
- Common/DTS.Common/Enums/DBExport/PositionFields.cs
- Common/DTS.Common/Enums/DBExport/MainLocationFields.cs
- Common/DTS.Common/Enums/DBExport/PhysicalDimensionFields.cs
- Common/DTS.Common/Enums/DBExport/TopLevelFields.cs
generated_at: "2026-04-16T03:20:09.296204+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "968ad729b3c9621d"
---
# Documentation: DBExport Enumerations (`DTS.Common.Enums.DBExport`)
## 1. Purpose
This module defines a set of strongly-typed enumerations that represent field names used for mapping database records to XML export structures for various domain objects in the DTS (likely *Data Transfer System*) framework. Each enumeration corresponds to a specific type of database entity (e.g., `TestObject`, `FineLocation1`, `FilterClass`, `PhysicalDimension`) and enumerates the XML tag names (as string-equivalent identifiers) that should be used when serializing or deserializing instances of that entity during database export/import operations. These enums act as a contract between the data layer and the XML export pipeline, ensuring consistent field naming across the system.
## 2. Public Interface
All types in this module are **public enums**. No classes, methods, or properties are exposed.
| Enum Name | Field Values (in declaration order) | Notes |
|-----------|-------------------------------------|-------|
| `TestObjectFields` | `s_GUID`, `TEST_OBJECT`, `TEXT_L1`, `TEXT_L2`, `VERSION`, `DATE`, `REMARKS`, `EXPIRED`, `SORTKEY`, `LAST_CHANGE`, `LAST_CHANGE_TEXT`, `HISTORY` | Used for `ISODll.TestObject`. Note: `s_GUID` uses lowercase `s_` prefix, unlike most others. |
| `CustomDirectionFields` | `Direction`, `Expired`, `History`, `Last_Change`, `Last_Change_Text`, `Remarks`, `GUID`, `SortKey`, `Text_L1`, `Text_L2`, `Version` | Used for `ISODll.MMEDirection`. `Direction` maps to the primary identifier. |
| `CustomFinLoc1Fields` | `Date`, `Expired`, `Fine_Loc_1`, `History`, `Last_Change`, `Last_Change_Text`, `Remarks`, `S_GUID`, `SortKey`, `Text_L1`, `Text_L2`, `Version` | Used for `ISODll.FineLocation1`. |
| `CustomFinLoc2Fields` | `Date`, `Expired`, `Fine_Loc_2`, `History`, `Last_Change`, `Last_Change_Text`, `Remarks`, `S_GUID`, `SortKey`, `Text_L1`, `Text_L2`, `Version` | Used for `ISODll.FineLocation2`. |
| `CustomFinLoc3Fields` | `Date`, `Expired`, `Fine_Loc_3`, `History`, `Last_Change`, `Last_Change_Text`, `Remarks`, `S_GUID`, `SortKey`, `Text_L1`, `Text_L2`, `Version` | Used for `ISODll.MMEFineLocation3`. |
| `CustomFilterFields` | `Date`, `Expired`, `Filter_Class`, `History`, `Last_Change`, `Last_Change_Text`, `Remarks`, `S_GUID`, `SortKey`, `Text_L1`, `Text_L2`, `Version` | Used for `ISODll.MME_FilterClass`. |
| `PositionFields` | `Date`, `Expired`, `History`, `Last_Change`, `Last_Change_Text`, `Position`, `RecordType`, `Remarks`, `S_GUID`, `SortKey`, `Text_L1`, `Text_L2`, `Version` | Used for `ISODll.MMEPositions`. Includes `RecordType`. |
| `MainLocationFields` | `Date`, `Expired`, `History`, `Last_Change`, `Last_Change_Text`, `Picture_ShortName`, `Remarks`, `S_GUID`, `SortKey`, `Text_L1`, `Text_L2`, `Trans_Main_Loc`, `Type`, `Version` | Used for `ISODll.MMETransducerMainLocation`. Includes `Picture_ShortName`, `Trans_Main_Loc`, and `Type`. |
| `PhysicalDimensionFields` | `Amount_Of_Substance_EXP`, `Date`, `Default_Unit`, `Electric_Current_EXP`, `Expired`, `History`, `Last_Change`, `Last_Change_Text`, `Length_EXP`, `Luminous_Intensity_Exp`, `Mass_EXP`, `Physical_Dimension`, `RecordType`, `Remarks`, `S_GUID`, `SortKey`, `Temperature_EXP`, `Text_L1`, `Text_L2`, `Time_EXP`, `Version` | Used for `ISODll.MMEPhysicalDimension`. Contains SI base unit exponent fields (e.g., `Length_EXP`, `Time_EXP`). |
| `TopLevelFields` | `CustomerDetails`, `TestEngineerDetails`, `LabDetails`, `DASList`, `SensorModels`, `Sensors`, `Calibrations`, `CustomDirections`, `CustomFilterClasses`, `CustomTestObjects`, `CustomFinLoc1s`, `CustomFinLoc2s`, `CustomFinLoc3s`, `CustomMainLocs`, `CustomPhysicalDimensions`, `CustomPositions`, `CustomChannels`, `GroupTemplates`, `Groups`, `TestSetups`, `Users`, `GlobalSettings`, `SensorChangeHistory` | Represents top-level XML container tags. Includes a comment indicating `SensorChangeHistory` was introduced in V7. |
> **Note**: All enum values are declared in PascalCase (except `TestObjectFields.s_GUID`, which uses `s_` prefix), and use underscores (`_`) to separate words in multi-word identifiers (e.g., `Last_Change_Text`, `Fine_Loc_1`).
## 3. Invariants
- **Consistency within each enum**: Each enums values represent the *complete set* of field names used for a specific entity type in the XML export schema. No field should be missing or duplicated *within a single enum*.
- **Naming convention**: Except for `TestObjectFields.s_GUID`, all field names use `PascalCase` with underscores (`_`) as word separators. `s_GUID` is an exception (lowercase `s_` prefix).
- **Common fields across most enums**: Most enums include the following fields: `S_GUID` (or `GUID`), `DATE`, `VERSION`, `REMARKS`, `EXPIRED`, `SORTKEY`, `LAST_CHANGE`, `LAST_CHANGE_TEXT`, `HISTORY`, `TEXT_L1`, `TEXT_L2`. The presence/absence of `RecordType` and domain-specific fields (e.g., `Fine_Loc_1`, `Filter_Class`, `Position`) distinguishes the enums.
- **Top-level enum scope**: `TopLevelFields` enumerates *root XML elements* only—not nested fields. It does not overlap with the other domain-specific field enums.
## 4. Dependencies
- **Internal dependencies**:
- These enums are defined in the `DTS.Common` assembly (namespace `DTS.Common.Enums.DBExport`).
- They are referenced by code that handles XML serialization/deserialization of database entities, likely in modules dealing with `ISODll.*` types (e.g., `ISODll.TestObject`, `ISODll.MME_FilterClass`, etc.).
- The `TopLevelFields` enum likely drives the top-level structure of the export XML document.
- **External dependencies**:
- The comments reference `ISODll.*` types (e.g., `ISODll.MMEDirection`, `ISODll.FineLocation1`), implying a dependency on the `ISODll` native or interop library (not included in this module).
- No external .NET or third-party dependencies are declared in the source files.
- **Depended upon by**:
- XML export/import logic (not shown here) that maps database records to XML elements using these enum values as tag names.
- Possibly validation or schema-checking components that rely on these field names.
## 5. Gotchas
- **Inconsistent `GUID` naming**:
- `TestObjectFields` uses `s_GUID`, while all other enums use `S_GUID` (uppercase `S_`). `CustomDirectionFields` uses `GUID` (no `S_` prefix). This inconsistency may cause mismatches if field name mapping is case-sensitive or expects uniform prefixes.
- **`S_GUID` vs `s_GUID` vs `GUID`**:
- The three variants (`s_GUID`, `S_GUID`, `GUID`) across enums suggest possible legacy naming differences or evolving schema conventions. Care must be taken when writing generic export logic to handle these variations.
- **`TopLevelFields` includes pluralized names**:
- E.g., `CustomFinLoc1s`, `CustomMainLocs`, `CustomFilterClasses`. This implies the XML structure uses pluralized root tags for collections, but the corresponding *field* enums (e.g., `CustomFinLoc1Fields`) use singular names for individual record fields. Confusing these could lead to incorrect XML generation.
- **Missing `CustomChannels` field enum**:
- `TopLevelFields` includes `CustomChannels`, but no corresponding `CustomChannelFields` enum is defined in the provided source files. This suggests either:
- The enum is defined elsewhere,
- It is unused or deprecated, or
- It is an oversight in the codebase.
**Unclear from source alone.**
- **`PhysicalDimensionFields` has mixed casing in exponent fields**:
- `Luminous_Intensity_Exp` uses `Exp` (not `EXP` like others: `Length_EXP`, `Time_EXP`). This may be intentional (e.g., legacy naming) or a typo—requires verification.
- **No validation or constraints**:
- These are plain enums with no runtime validation. It is possible to assign arbitrary integer values or mix enums (e.g., cast `PositionFields.Position` to `TestObjectFields`), which could lead to runtime errors if used incorrectly in XML mapping.
- **No documentation for field semantics**:
- While the enum names are clear, the *meaning* of each field (e.g., what `LAST_CHANGE` vs `LAST_CHANGE_TEXT` represents) is not documented here. This must be inferred from the underlying `ISODll` types or database schema.