9.0 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
2026-04-16T02:26:15.632629+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | f7166919537b0724 |
TestSetups
Documentation: TestSetups Module
1. Purpose
This module defines a set of interfaces that model test setup data structures and UI/viewmodel abstractions within the DTS (Data Acquisition and Test System) platform. It serves as the contract layer for representing hardware configuration (DAS, sensors), regions of interest (ROIs), calculated channels, and ISF (Instrumented Sensor File) format specifications. These interfaces enable decoupled data handling across layers—particularly for persistence, UI binding, and file I/O—while enforcing domain-specific constraints like channel ordering, ROI definitions, and sensor calibration metadata.
2. Public Interface
Interfaces (No concrete implementations provided in source)
| Interface | Signature | Behavior |
|---|---|---|
ITestSetupsView |
interface ITestSetupsView : IBaseView |
Marker interface for the view layer in the test setups feature. Inherits from IBaseView. |
ITestSetupsViewModel |
interface ITestSetupsViewModel : IBaseViewModel |
Marker interface for the viewmodel layer in the test setups feature. Inherits from IBaseViewModel. |
ITestDASOrder |
interface ITestDASOrder |
Allows DAS (Data Acquisition System) instances to be ordered within a test setup. Defines a single property: int DASIndex { get; set; }. |
IROIPeriodChannelRecord |
interface IROIPeriodChannelRecord |
Represents a row in the ROIPeriodChannels database table. Properties: int TestSetupROIId, string ChannelName. |
ITestSetupHardwareRecord |
interface ITestSetupHardwareRecord |
Represents a row in the test setup hardware configuration table. Properties: int DASId, int TestSetupId, bool AddDAS, int SamplesPerSecond, bool IsClockMaster, int AntiAliasFilterRate, byte PTPDomainId. |
ITestSetupROIRecord |
interface ITestSetupROIRecord |
Represents a row in the TestSetupROIs database table. Properties: int TestSetupROIId, int TestSetupId, string Suffix, double ROIStart, double ROIEnd, bool IsEnabled, bool IsDefault. |
ICalculatedChannelRecord |
interface ICalculatedChannelRecord |
Represents a calculated channel record in the database. Properties: string Name, string TestSetupName, int Id, Operations Operation, string CalculatedValueCode, string[] InputChannelIds, string CFCForInputChannels, string ChannelFilterClassForOutput, int TestSetupId, bool ViewInRealtime, int ClipLength. |
IISFFile |
interface IISFFile |
Models an ISF file structure (used for sensor calibration/sensor definition files). Properties: char[] HeaderLine1, char[] TestSetupName, short NumberOfRecords { get }, char[] TestType, char[] TestDivision, char[] TCFile, char[] HeaderLine2, char[] HeaderLine3, IISFSensorRecord[] Records. Methods: void AddRecord(IISFSensorRecord record), void WriteToFile(string pathToFile), void AddSensors(ISensorData[] sensors). |
IISFSensorRecord |
interface IISFSensorRecord |
Models a 4-record (320-byte) ISF sensor entry. Contains many fixed-width char[] fields with precise offsets (e.g., DataChannelNumber at char 7, length 5). Methods: void SetDataChannelNumber(short value), void SetCapacity(double), double GetCapacity(), void SetSensitivity(double), double GetSensitivity(), void SetBridgeResistance(double), void SetC1(double), double GetC1(), void SetC2(double), void SetC3(double), void SetSensorComment(string), void Write(BinaryWriter), void SetSensor(ISensorData). |
Operations (enum) |
enum Operations |
Defines supported calculated channel operations: SUM, AVERAGE, IRTRACC3D, IRTRACC3D_ABDOMEN, IRTRACC3D_LOWERTHORAX, Resultant, HIC. Each has a [DescriptionResource] attribute for localization. |
ConstantsAndEnums (nested abstract class) |
abstract class ConstantsAndEnums |
Defines constants and enums used by IISFFile: RECORD_LENGTH = 80, ISFKnownChannelTypes enum (VS, VU, SB, TI, TC, CT, XP, P4, VF, NB, EX). |
3. Invariants
-
ISF File Format Constraints
- All
char[]fields inIISFSensorRecordhave fixed lengths and byte offsets (e.g.,TestSetupNamestarts at char 7, length 8;NumberOfRecordsis 5 chars starting at char 15). RECORD_LENGTHis strictly 80 bytes per record; sensor records consist of exactly 4 records.NumberOfRecordsis read-only and must reflect the count ofRecordsin the file.SensitivityandC1/C2/C3fields store scaled values (e.g., sensitivity is stored as V/1000; polynomial coefficients are stored as /1000).TOMConfigurationNamedefaults to"STANDARD"; other values are not currently supported.SensorTypemust contain"N/O"or"N/C"for digital inputs.
- All
-
Test Setup Data Invariants
ITestSetupROIRecord.IsEnabledandIsDefaultare boolean flags; only one ROI per test setup may beIsDefault = true.ITestSetupHardwareRecord.IsClockMasterindicates which DAS provides timing; only one DAS per test setup should be master.InputChannelIdsinICalculatedChannelRecordis a CSV-separated list encoded asstring[](note: type mismatch between description and property type—see Gotchas).ClipLengthapplies only to certainOperations(e.g., max over a clip), but no enforcement is present in the interface.
-
Naming & IDs
TestSetupIdappears consistently acrossITestSetupHardwareRecord,ITestSetupROIRecord, andICalculatedChannelRecordas the foreign key to a test setup.TestSetupROIIdis the primary key for ROIs and referenced byIROIPeriodChannelRecord.TestSetupROIId.
4. Dependencies
-
Internal Dependencies
DTS.Common.Base: All view/viewmodel interfaces (IBaseView,IBaseViewModel) are defined here.DTS.Common.Enums.DASFactory.DFConstantsAndEnums: Referenced inITestSetupHardwareRecord(e.g., for PTP domain IDs).DTS.Common.Interface.Sensors:IISFFiledepends onISensorData(from this namespace).System.ComponentModel: Used forTypeConverterattribute onOperationsenum.System.IO: Used forBinaryWriterinIISFSensorRecord.Write.
-
External Dependencies
- No external (non-DTS) libraries are imported beyond .NET base types.
- Localization resources (e.g.,
"CalculatedChannel_Sum") are referenced via[DescriptionResource]but not defined in this module.
5. Gotchas
-
Type Mismatch in
ICalculatedChannelRecord.InputChannelIds
The property is declared asstring[], but the XML comment states it is a "CSV separated list of channel ids". This suggests the implementation likely stores a single CSV string (e.g.,"1,2,3"), not an array. Developers must clarify whether this is a documentation error or if the array is used for intermediate processing. -
ISF Record Field Offsets Are Implicit
Offsets and lengths ofchar[]fields are only documented in comments (e.g.,"starts at character 15, 5 characters long"). There is no runtime validation or helper to enforce these constraints—implementations must manually parse/write at exact byte positions. -
NumberOfRecordsIs Read-Only but Must Be Updated
IISFFile.NumberOfRecordsis read-only, yetAddRecordmust update it. This implies the implementation must internally track and expose the count, but the interface does not enforce consistency (e.g., ifRecordsarray is modified directly). -
ISFKnownChannelTypes.TI/TCAre Non-Analog
The enum includesTIandTCas known channel types, but comments note they are "not analog (TOM)". Implementations must handle these as special cases (e.g., digital triggers), not standard analog channels. -
SetSensorCommentAggregates Three Fields
SetSensorComment(string)writes toCommentPart1,CommentPart2, andCommentPart3(total 70 chars: 15+40+15). There is no truncation or padding behavior specified—implementations must decide how to handle overflow/underflow. -
No Validation on
ROIStart/ROIEnd
ITestSetupROIRecorddoes not enforceROIStart < ROIEndor that values are non-negative. Invalid ranges may propagate to downstream logic. -
PTPDomainIdIsbyte
Whilebyteis appropriate for PTP domain IDs (0–255), no validation ensures the value is within valid range for the target PTP implementation.