4.9 KiB
4.9 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | ||
|---|---|---|---|---|---|---|
|
2026-04-16T02:06:34.717084+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | c231715b4e36a96d |
ImportOptions
Documentation: Import Options Module
1. Purpose
This module defines data structures for configuring import behavior in the DTS system, specifically for equipment (Eqx) and CSV-based sensor data ingestion. It centralizes user-controllable settings that dictate how imported data interacts with existing system state (e.g., overwriting sensors, importing sensor models) and how raw data files are interpreted (e.g., encoding, separators, cultural formatting, zeroing logic). The classes reside in the DTS.Common.Import.ImportOptions namespace and serve as configuration payloads passed to import pipelines.
2. Public Interface
EqxImportOptions
- Namespace:
DTS.Common.Import.ImportOptions - Properties:
bool OverwriteExistingSensors { get; set; } = true
Controls whether imported equipment sensor definitions should replace existing sensors with matching identifiers. Defaults totrue.bool ImportSensorModels { get; set; } = true
Determines whether sensor model metadata (e.g., calibration curves, physical specs) should be imported alongside sensor instances. Defaults totrue.
CsvImportOptions
- Namespace:
DTS.Common.Import.ImportOptions - Properties:
string Encoding { get; set; }
Specifies the text encoding used in the CSV file (e.g.,"utf-8","iso-8859-1"). No default is set; must be provided by caller if non-default encoding is required.string FieldSeparator { get; set; }
Defines the character(s) used to delimit fields in the CSV (e.g.,",",";","\t"). No default is set; must be provided by caller.CultureInfo ImportCulture { get; set; }
Specifies the culture used to parse numeric values (e.g., decimal separators, date formats). No default is set; must be provided by caller.bool StripBackSlash { get; set; }
Indicates whether leading/trailing backslashes (\) should be removed from field values during parsing. No default is set; defaults tofalse(C# default forbool).
ZeroMethodOptions
- Namespace:
DTS.Common.Import.ImportOptions - Properties:
ZeroMethodType ZeroMethodType { get; set; }
Specifies the algorithm used to compute a zero offset (e.g.,Average,Median,Manual). Type is defined inDTS.Common.Enums.Sensors.double ZeroMethodStart { get; set; }
Start index or time offset (in seconds or samples, depending on context) for the region used to calculate the zero offset.double ZeroMethodEnd { get; set; }
End index or time offset for the zero-calculation region. Must be ≥ZeroMethodStart.
3. Invariants
- For
ZeroMethodOptions:ZeroMethodEnd ≥ ZeroMethodStartmust hold. Violation implies invalid configuration, though no runtime enforcement is visible in this file. CsvImportOptionsproperties (Encoding,FieldSeparator,ImportCulture) are nullable reference types (no= null!or default initialization), implying they are optional but may be required by consumers.OverwriteExistingSensorsandImportSensorModelsinEqxImportOptionsdefault totrue; callers relying on default behavior will overwrite and import models unless explicitly disabled.StripBackSlashdefaults tofalse(C# default forbool), meaning backslash stripping is opt-in.
4. Dependencies
- Imports/References:
System(core types, LINQ,CultureInfo)DTS.Common.Enums.Sensors(forZeroMethodTypeenum used inZeroMethodOptions)
- Consumers:
- Import pipeline classes (e.g.,
EqxImporter,CsvImporter) in theDTS.Common.Importhierarchy are implied consumers, though not visible here. - UI or configuration layers that serialize/deserialize these options for user input.
- Import pipeline classes (e.g.,
5. Gotchas
- Missing validation: No validation is performed in these classes (e.g.,
ZeroMethodEnd ≥ ZeroMethodStart, non-emptyFieldSeparator). Consumers must enforce constraints. - Ambiguous defaults:
Encoding,FieldSeparator, andImportCultureinCsvImportOptionshave no defaults. If leftnull, behavior depends on downstream parsing logic (e.g.,Encodingmay default to UTF-8 viaStreamReader, but this is not guaranteed here). ZeroMethodOptionssemantics: The unit ofZeroMethodStart/ZeroMethodEnd(samples vs. seconds) is context-dependent and not encoded in the type. Consumers must interpret consistently.- No inheritance or interfaces: These are plain POCOs; no polymorphic behavior or shared base is defined.
- No XML comments: Source lacks documentation comments; all descriptions are inferred from property names and types.