8.0 KiB
8.0 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
2026-04-16T03:02:46.464691+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | 4654e7bd069055b4 |
TestSetups
Documentation: TestSetups Module
1. Purpose
This module defines a set of interfaces and data contracts that model test setup configurations within the DTS (Data Acquisition and Test System) platform. It serves as the canonical abstraction layer for test setup metadata—including hardware composition (DAS units), regions of interest (ROIs), calculated channels, and ISF (Instrumented Sensor File) format specifications—enabling consistent data exchange between UI, business logic, and persistence layers. The interfaces are designed to support serialization, validation, and domain-specific operations (e.g., ordering DAS units, computing derived signals), forming the backbone of test setup management functionality.
2. Public Interface
Interfaces (All in DTS.Common.Interface or DTS.Common.Interface.TestSetups namespace)
| Interface | Signature | Description |
|---|---|---|
ITestSetupsView |
interface ITestSetupsView : IBaseView |
Marker interface for the view layer associated with test setup UI. Inherits IBaseView. |
ITestSetupsViewModel |
interface ITestSetupsViewModel : IBaseViewModel |
Marker interface for the view model layer associated with test setup UI. Inherits IBaseViewModel. |
ITestDASOrder |
interface ITestDASOrder |
Enables ordering of DAS units within a test setup via the DASIndex property. |
IROIPeriodChannelRecord |
interface IROIPeriodChannelRecord |
Represents a row in the ROIPeriodChannels database table. Maps a channel to a specific ROI. Properties: TestSetupROIId, ChannelName, ChannelId. |
ITestSetupHardwareRecord |
interface ITestSetupHardwareRecord |
Represents a row in the test setup hardware configuration table. Properties: DASId, TestSetupId, AddDAS, SamplesPerSecond, IsClockMaster, AntiAliasFilterRate, PTPDomainId. |
ITestSetupROIRecord |
interface ITestSetupROIRecord |
Represents a row in the TestSetupROIs database table. Defines a time interval (ROI) and metadata. Properties: TestSetupROIId, TestSetupId, Suffix, ROIStart, ROIEnd, IsEnabled, IsDefault. |
ICalculatedChannelRecord |
interface ICalculatedChannelRecord |
Represents a calculated channel definition. Properties: Name, TestSetupName, Id, Operation (enum), CalculatedValueCode, InputChannelIds (array), CFCForInputChannels, ChannelFilterClassForOutput, TestSetupId, ViewInRealtime, ClipLength. |
IISFFile |
interface IISFFile |
Models an ISF file structure (used for sensor metadata in test setups). Properties: HeaderLine1, TestSetupName, NumberOfRecords, TestType, TestDivision, TCFile, HeaderLine2, HeaderLine3, Records. Methods: AddRecord, WriteToFile, AddSensors. |
IISFSensorRecord |
interface IISFSensorRecord |
Models a single sensor record within an ISF file (4 × 80-byte records). Provides typed access to fixed-width fields (e.g., DataChannelNumber, Sensitivity, SerialNumber, EngineeringUnits, SensorType, C1–C3, comments, etc.). Methods: SetDataChannelNumber, SetCapacity, GetCapacity, SetSensitivity, GetSensitivity, SetBridgeResistance, SetC1, GetC1, SetC2, SetC3, SetSensorComment, Write, SetSensor. |
Enumerations
| Enum | Values | Description |
|---|---|---|
Operations (in ICalculatedChannelRecord) |
SUM = 1, AVERAGE = 2, IRTRACC3D = 3, IRTRACC3D_ABDOMEN = 4, IRTRACC3D_LOWERTHORAX = 5, Resultant = 6, HIC = 7 |
Defines supported operations for calculated channels. Each value has a [DescriptionResource] attribute for localization. |
ISFKnownChannelTypes (in IISFFile.ConstantsAndEnums) |
VS, VU, SB, TI, TC, CT, XP, P4, VF, NB, EX |
Known channel type codes in ISF files. TI, TC, and CT are explicitly noted as non-analog. |
ConstantsAndEnums.RECORD_LENGTH |
80 |
Fixed record length (in bytes) for ISF file records. |
3. Invariants
ITestDASOrder:DASIndexmust be non-negative and unique per DAS unit within a test setup to ensure deterministic ordering.ITestSetupROIRecord:ROIStart≤ROIEnd.IsDefaultmust be true for exactly one ROI per test setup (enforced by domain logic, not interface).ITestSetupHardwareRecord:SamplesPerSecond> 0;AntiAliasFilterRate≥ 0;PTPDomainId∈ [0, 255] (due tobytetype).ICalculatedChannelRecord:InputChannelIdsmust be non-null and non-empty for operations requiring inputs (e.g.,SUM,AVERAGE).ClipLength≥ 0.IISFFile:NumberOfRecordsmust match the actual count ofRecords.HeaderLine1,TestSetupName, etc., must conform to fixed-width, fixed-position parsing rules (e.g.,TestSetupNamestarts at char 7, length 8).IISFSensorRecord: All character arrays are fixed-length (perRECORD_LENGTH = 80). Field offsets are strictly defined (e.g.,Tagat char 75, length 2).SetSensorCommentmust populateCommentPart1,CommentPart2,CommentPart3consistently.ISFKnownChannelTypes:TI,TC, andCTare non-analog; other types are analog. This distinction affects interpretation of calibration coefficients (C1,C2,C3).
4. Dependencies
Dependencies of this module:
DTS.Common.Base(forIBaseView,IBaseViewModel)System.ComponentModel(forTypeConverteronOperations)DTS.Common.Converters(forEnumDescriptionTypeConverter)DTS.Common.Interface.Sensors(forISensorDataused inIISFFile.AddSensors)DTS.Common.Enums.DASFactory.DFConstantsAndEnums(forDASFactory.DFConstantsAndEnumsnamespace import inITestSetupHardwareRecord)
Dependencies on this module:
- UI layer (via
ITestSetupsView,ITestSetupsViewModel) - Data persistence layer (maps
*Recordinterfaces to database tables:TestSetupROIs,ROIPeriodChannels, calculated channels table) - ISF file I/O layer (implements
IISFFile,IISFSensorRecord) - Signal processing layer (uses
ICalculatedChannelRecordandOperationsto configure channel calculations)
5. Gotchas
- ISF Record Parsing: Field positions and lengths in
IISFSensorRecordare hardcoded (e.g.,Sensitivityat char 42, length 11). Changing ISF spec requires updating all field accessors. OperationsEnum:IRTRACC3D_*values imply 3D acceleration calculations (Thorax/Abdomen/LowerThorax); misuse may cause incorrect signal processing.ClipLengthSemantics: Not all operations useClipLength; its meaning is operation-specific (e.g., max over clip forHIC).SensitivityUnits: For polynomial calibrations,Sensitivity(c0) is stored as/1000of the actual value (seeICalculatedChannelRecordcomments).UserIdSensorIDIsNotSpecified: A boolean flag inIISFSensorRecord;truemeans user ID is not specified (counterintuitive naming).NumberOfRecordsis Read-Only: InIISFFile,NumberOfRecordsis a read-only property; it must be updated internally byAddRecord.- No Validation in Interfaces: All interfaces are pure contracts; validation rules (e.g.,
ROIStart ≤ ROIEnd) are enforced by consumers, not the interfaces themselves. ISFFileHeader Fields:HeaderLine2andHeaderLine3are documented as unused; relying on them may introduce fragility.
None identified beyond those explicitly noted in source comments.