7.9 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |||
|---|---|---|---|---|---|---|---|
|
2026-04-17T15:39:25.870361+00:00 | zai-org/GLM-5-FP8 | 1 | 605a991ac1639306 |
EQX Import Parsers Documentation
1. Purpose
This module provides parsing functionality for importing Equipment Exchange (EQX) format files into the DTS system. It consists of three main components: EQXTestSetupParser for importing test setup configurations including groups and channel assignments, EQXSensorsParser for importing sensor definitions and calibration data, and EQXGroupImport for processing group-to-sensor mappings during test setup creation. The module bridges the proprietary EQX XML format with the internal DTS data model, handling version compatibility, calibration assignments, and group hierarchy construction.
2. Public Interface
EQXTestSetupParser
Constructor:
public EQXTestSetupParser(
IImportNotification importNotification,
EqxImportOptions eqxImportOptions,
IGroupImport groupImport,
EquipmentExchange.EQXSensorDatabase eqxSensorDatabase,
bool createDynamicGroups)
Initializes the parser with notification services, import options, group import handler, sensor database reference, and a flag indicating whether dynamic groups should be created.
Methods:
public override void Parse(ref ImportObject importObject)
Parses the EQX file specified by FileName (inherited from ParseVariantBase) and populates the importObject with test setup data. Validates that group name test object lookup exists; if not, adds a critical error and aborts. Assigns group lookups, creates test templates, fixes calibrations, assigns groups to test setup, and sets the TestSetupImportFileFormat on the import object.
EQXGroupImport
Implements: IGroupImport
Properties:
public ParseParameters ParseParameters { get; set; }
Methods:
public Tuple<TestTemplate, List<IGroup>> CreateGroups(
List<SensorData> sensors,
Dictionary<string, List<TsetSetupImportSensorInfo>> groupSensorLookup,
TestTemplate testTemplate,
bool createDynamicGroups,
List<IGroup> staticGroups,
Action<double> setProgress)
Creates groups from the provided sensor data and group-sensor lookup. Returns a tuple containing the populated TestTemplate and list of static groups. Returns null if groupSensorLookup is null or empty. Groups are sorted by sensor count (descending), then by name (ascending). Each group is populated with GroupChannel objects containing sensor data, calibration info, squib settings, and digital I/O configuration.
public Dictionary<string, List<TsetSetupImportSensorInfo>> GetGroupSensorLookup(
List<SensorData> sensors,
Dictionary<string, string> sensorGroupNameLookup,
Dictionary<string, List<string>> groupNameSensorListLookup)
Builds a lookup dictionary mapping group names to lists of TsetSetupImportSensorInfo. Handles two mutually exclusive input formats: sensorGroupNameLookup (sensor → group name) or groupNameSensorListLookup (group name → list of sensor serial numbers).
EQXSensorsParser
Constructor:
public EQXSensorsParser(
IImportNotification importNotification,
User user,
EqxImportOptions eqxImportOptions,
EquipmentExchange.EQXSensorDatabase eqxSensorDatabase)
Constants:
const float MAX_EQX_VERSION_SUPPORT = 1.5F;
Properties:
public bool ImportCreateDynamicGroups { get; set; }
public bool EQXUseSerialNumberFieldForSN { get; set; }
public bool UseZeroForUnfiltered { get; set; }
Methods:
public override void Parse(ref ImportObject importObject)
Parses the EQX file for sensor data. Validates XML structure and EQX format version (must be ≤ 1.5). Delegates to ParseSensor for actual processing.
3. Invariants
- EQX Version Compatibility: The maximum supported EQX DataFormatEdition is
1.5F. Files with higher versions will cause import rejection with an error message. - Null ImportObject Handling: Both
EQXTestSetupParser.Parse()andEQXSensorsParser.Parse()throwArgumentNullExceptionifimportObjectis null. - Empty FileName Handling: Both parsers return immediately without processing if
FileNameis null or empty. - Group Lookup Mutual Exclusivity: In
EQXGroupImport.GetGroupSensorLookup(), eithersensorGroupNameLookupORgroupNameSensorListLookupwill be populated, but not both (per comment FB 30358). - Calibration Assignment: In
FixCalibrations(), calibrations are sorted and the first calibration (index 0) is assigned to each sensor. - Test Setup Uniqueness:
EQXTestSetupParser.Parse()returns early without creating a test setup if a test setup with the same name already exists inimportObject.TestSetups(). - Group Sorting: Groups are sorted by sensor count descending, then alphabetically by name ascending when equal.
- Channel Order:
GroupChannelOrderandTestSetupOrderare 1-indexed (1 + sensor index).
4. Dependencies
Direct Dependencies (Imports):
EQXTestSetupParser:
DataPROWin7.DataModel-ImportObject,ImportError,ImportSeverityError,TestTemplate,SensorDataDTS.Common.Import.ImportOptions-EqxImportOptionsDTS.Common.Import.Parsers-ParseVariantBaseDTS.Common.Interface.Groups.GroupList-IGroupImport,IGroupDTS.Common.SharedResource.Strings-StringResourcesDTS.Common.Utilities.Logging-APILoggerDTS.Common.Utils-GroupHelperDTS.SensorDB-EquipmentExchange.EQXSensorDatabaseSystem.Xml.Linq- XML parsing
EQXGroupImport:
DataPROWin7.DataModel-SensorData,TestTemplate,TsetSetupImportSensorInfoDTS.Common.Classes.Groups- Group-related classesDTS.Common.Classes.Sensors-GroupChannelDTS.Common.Interface.Groups.GroupList-IGroupImport,IGroupDTS.Common.Storage-DbOperationsDTS.SensorDB- Sensor database types
EQXSensorsParser:
DataPROWin7.DataModel-ImportObject,SensorDataDTS.Common.Enums- Enumerations includingBridgeType,ExcitationVoltageOptions,SquibMeasurementTypeDTS.Common.Import.ImportOptions-EqxImportOptionsDTS.Common.Import.Parsers-ParseVariantBaseDTS.Common.Storage-DbOperationsDTS.Common.Classes.Sensors-FactorySensorModel,SensorsCollectionDTS.Common.Interface.Sensors-ISensorDataDTS.Common.SharedResource.Strings-StringResourcesDTS.Slice.Users-UserDTS.SensorDB-EquipmentExchange.EQXSensorDatabaseSystem.Xml.Linq- XML parsing
Consumers:
- The module is consumed by the DTS import system (exact consumers not visible in provided source).
5. Gotchas
Calibration Reset Issue (FB 44105 / Historical Bug)
The comment in EQXTestSetupParser.AssignGroupsToTestSetup() references a bug where GroupHelper.NormalizeSensorIds() can reset calibrations for sensors. The workaround is calling FixCalibrations(importObject) immediately after normalization to restore calibrations from the import data.
Duplicate Calibration Fix Calls
FixCalibrations() is called twice in EQXTestSetupParser.Parse(): once early in the method, and again inside AssignGroupsToTestSetup() after NormalizeSensorIds(). This is intentional due to the normalization side-effect noted above.
EID Preservation (Bug 18467)
EQXSensorsParser.ParseSensor() contains special logic to preserve existing EID values when the EQX file has a NULL IDModuleString. Without this, importing an EQX file with missing IDModuleString would clear the EID on existing sensors.
Null IDModule Handling
The method SensorHasNullIDModule() and GetSensorNullIdModuleValue() are called on `_eq