--- source_files: - Common/DTS.Common/Classes/ISO/IsoCode.cs generated_at: "2026-04-17T16:27:17.170851+00:00" model: "zai-org/GLM-5-FP8" schema_version: 1 sha256: "38189089a59088e0" --- # ISO ### Purpose The `IsoCode` class provides a structured representation of a 16-character ISO code, breaking it down into discrete fields: `TestObject` (1 char), `Position` (1 char), `MainLocation` (4 chars), `FineLocation1` (2 chars), `FineLocation2` (2 chars), `FineLocation3` (2 chars), `PhysicalDimension` (2 chars), `Direction` (1 char), and `FilterClass` (1 char). This class exists to parse, store, and reconstruct ISO codes used for identifying test objects and their spatial/dimensional attributes within the system. ### Public Interface **Constructor:** - `IsoCode(string isoCode)` — Constructs an `IsoCode` from a string. If null, treats as empty string. Truncates to 16 characters if longer; pads right with `'?'` if shorter. **Properties:** - `string TestObject` — Gets/sets the single-character test object identifier. Defaults to `'?'` if set to null/empty. - `string Position` — Gets/sets the single-character position. Defaults to `'?'` if set to null/empty. - `string MainLocation` — Gets/sets the 4-character main location. Pads right with `'?'` if under 4 chars; truncates to 4 if over. - `string FineLocation1` — Gets/sets the 2-character fine location 1. Pads right with `'?'` if under 2 chars. - `string FineLocation2` — Gets/sets the 2-character fine location 2. Pads right with `'?'` if under 2 chars. - `string FineLocation3` — Gets/sets the 2-character fine location 3. Pads right with `'?'` if under 2 chars. - `string PhysicalDimension` — Gets/sets the 2-character physical dimension. Pads right with `'?'` if under 2 chars; truncates to 2 if over. - `string Direction` — Gets/sets the single-character direction. Defaults to `'?'` if set to null/empty. - `string FilterClass` — Gets/sets the single-character filter class. Defaults to `'?'` if set to null/empty. - `string StringRepresentation` — Gets the full 16-character ISO code string, or sets all 16 internal characters from a string (pads with `'0'` if shorter). ### Invariants - The internal `_isoCodeFull` character array is always exactly 16 characters. - All public property setters normalize input: single-character properties default to `'?'` on null/empty; multi-character properties pad with `'?'` or truncate to their fixed widths. - The constructor always produces a fully-initialized 16-character code. ### Dependencies - **Depends on:** `System.Text` (for `StringBuilder` in `StringRepresentation` getter). - **Depended on by:** Not determinable from source alone. ### Gotchas - **Inconsistent padding characters:** The constructor and public property setters pad with `'?'`, but the `StringRepresentation` setter pads with `'0'`. This could cause unexpected behavior when reconstructing an `IsoCode` via `StringRepresentation`. - **Potential off-by-one bugs in private setters:** The private setters for `_fineLocation1`, `_fineLocation2`, `_fineLocation3`, and `_physicalDimension` use the condition `value.Length < i` instead of `value.Length <= i`. Since `i` starts at 0, this condition is always false for the first iteration, meaning the first character may not be set correctly when the input is shorter than expected. - **Silent truncation:** `MainLocation` and `PhysicalDimension` silently truncate input exceeding their field width; other fields do not have this behavior documented in the same way. ---