5.7 KiB
5.7 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
2026-04-17T16:02:47.396088+00:00 | zai-org/GLM-5-FP8 | 1 | 78f079bf5483238e |
Interfaces
Purpose
This module defines the core abstraction layer for the import subsystem, providing interfaces for parsing, persisting, locking, and grouping imported data. It establishes contracts for handling CSV-based test and sensor imports, calibration records, and database locking mechanisms during import operations. The interfaces enable a separation between import orchestration and concrete implementations.
Public Interface
IPersistImport
void Save()- Persists the current import state. No parameters; returns void.
IParseImport
ImportObject Parse(IEnumerable<string> importFiles)- Parses a collection of file paths into anImportObject. AcceptsIEnumerable<string>of file paths.
IParseVariant
string FileName { get; set; }- Property for the file name being parsed.void Parse(ref ImportObject importObject)- Parses variant data into the providedImportObject. Note:importObjectis passed by reference.
IParseCSVTest
int Version { get; }- Read-only property indicating the parser version.void ParseVersion(CsvReader csvReader, TestSetupImportData tsid)- Parses version-specific test data using aCsvReaderintoTestSetupImportData.
IParseCSVSensor
int Version { get; }- Read-only property indicating the parser version.void Initialize(ICalibrationImport import, ZeroMethodOptions zmOptions, IImportNotification importNotification, bool importCreateDynamicGroups, bool useIsoCodeFilterMapping, bool useZeroForUnfiltered)- Initializes the parser with calibration import, zero method options, notification handler, and various import flags.void ParseVersion(CSVImportTags.Tags field, string val, ParseParameters pp)- Parses a specific field/value pair for the current version.
ICalibrationImport
SensorCalibration AddLinearCalRecordIfNeeded(SensorCalibration sc, bool savedIsProportional, bool savedRemoveOffset)- Adds a linear calibration record if conditions are met.SensorCalibration AddLinearZeroMethodIfNeeded(SensorCalibration sc, ZeroMethodType zeroMethodType, double zeroMethodStart, double zeroMethodEnd)- Adds a linear zero method to calibration if needed.SensorCalibration CheckForExcitationCalibration(SensorCalibration sc, double sensitivity, ExcitationVoltageOptions.ExcitationVoltageOption excitation, string EU)- Checks and configures excitation calibration.
ILockImport
bool Contended { get; }- Returns true if the collection of contended locks has any items.void SetLock(ref ImportObject importObject, ref StringBuilder message)- Sets a database lock for the import object; errors populate theStringBuildermessage.void FreeLock(ref ImportObject importObject)- Releases the database lock for the import object.bool StealLock(bool proceed)- Steals the database lock; returns success status.
IGroupImport
ParseParameters ParseParameters { get; set; }- Property for parsing parameters.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 sensor data with progress reporting.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 sensor info.
Invariants
IParseVariant.ParsemodifiesImportObjectvia reference; the caller must expect mutation.ILockImport.SetLockrequires an emptyStringBuilderto be passed in; it will be populated with errors if any occur.IParseCSVSensor.Initializemust be called beforeParseVersion(implied by initialization pattern).IUserDbRecord.UserNamemust be unique (documented in interface comments, though this interface is in a different module).
Dependencies
Depends on:
System.Collections.Generic(IEnumerable, Dictionary, List)System.Text(StringBuilder)CsvHelper(CsvReader)DTS.Common.Classes(TestSetupImportData)DTS.Common.Classes.Sensors(SensorData)DTS.Common.Enums(ZeroMethodType)DTS.Common.Enums.Sensors(sensor-related enums)DTS.Common.Import.ImportOptions(ZeroMethodOptions)DTS.Common.Interface.Groups.GroupList(IGroup)DTS.SensorDB(SensorCalibration)DataPROWin7.DataModel(TestTemplate, TsetSetupImportSensorInfo)
Depended on by: Not determinable from source alone; these are interfaces consumed by implementations.
Gotchas
IParseVariant.Parseusesref ImportObjectwhileIParseImport.Parsereturns a newImportObject. This inconsistency suggests different ownership models.ILockImporthas a comment referencing "FB 36740" indicating a feature request/bug tracking reference.- The
ILockImport.StealLockmethod'sproceedparameter purpose is unclear from the signature alone. IParseCSVSensor.ParseVersiontakes astring valparameter, suggesting string-based field values rather than typed parsing.