11 KiB
11 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |||||
|---|---|---|---|---|---|---|---|---|---|
|
2026-04-16T03:33:56.095301+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | 899d8d4385eb5461 |
Documentation: Test Template Data Model Module
1. Purpose
This module defines core data structures and interfaces for configuring and managing test setups in the DataPROWin7 system, specifically for hardware-agnostic test template handling, event download configuration, and build-time test setup generation. It enables programmatic construction of test configurations from XML templates or runtime templates, supports hardware inclusion/exclusion instructions for flexible group-based test composition (e.g., DAS-less groups), and provides caching and singleton access patterns for standardized test setups like TSRAIR_GO_TEST. The module serves as the foundational data layer for test configuration, bridging high-level test templates with low-level XML serialization and hardware mapping.
2. Public Interface
ICachedContainer (Interface)
- Namespace:
DataPROWin7.DataModel.Classes.TestTemplate - Purpose: Provides cached access to hardware, sensor, and calibration data by serial number, and enumeration of all cached hardware.
- Methods:
DASHardware GetCachedHardware(string serialNumber)
Retrieves cached DAS hardware data for the given serial number.SensorData GetCachedSensor(string serialNumber)
Retrieves cached sensor data for the given serial number.SensorCalibration[] GetCalibrations(string serialNumber)
Retrieves an array of calibrations associated with the given serial number.IISOHardware[] GetAllCachedHardware()
Returns all hardware currently in the cache.
HardwareInclusionInstruction (Class)
- Namespace:
DataPROWin7.DataModel - Purpose: Represents an explicit instruction to include or exclude a specific piece of hardware in a test, overriding group-based inclusion logic.
- Properties:
string HardwareId { get; }
The identifier of the hardware to which the instruction applies.Actions Action { get; }
The action to take (RemoveorAdd).
- Constructors:
HardwareInclusionInstruction(string hardwareId, Actions action)
Creates a new instruction with the specified hardware ID and action.HardwareInclusionInstruction(HardwareInclusionInstruction copy)
Copy constructor.
TSRAIRGoTestSetup (Class)
- Namespace:
DTS.Common.DataModel.Classes.TestTemplate - Purpose: Implements a singleton test setup for the
"TSRAIR_GO_TEST"template, with caching and lazy initialization. - Constants:
public const string TEST_NAME = "TSRAIR_GO_TEST"
- Properties:
public override string Name { get; }
Always returns"TSRAIR_GO_TEST"; setter is a no-op.
- Methods:
public static TSRAIRGoTestSetup GetInstance(int userId, bool useCache = true)
Returns a singleton instance ofTSRAIRGoTestSetup. IfuseCacheis true and an instance exists, returns it; otherwise, loads the template named"TSRAIR_GO_TEST"fromTestTemplateList, or falls back to user-specific defaults if the template is not found. Thread-safe vialock.
DownloadEvent (Class)
- Namespace:
DataPROWin7.DataModel - Purpose: Represents a downloadable test event with metadata for export and display, implementing
IDownloadEventandINotifyPropertyChanged. - Properties:
int EventNumber { get; set; }
Event index; setting triggersEventNumberDisplayupdate.bool IsEnabled { get; set; }
Whether the event is active.bool IsDefault { get; }
Read-only; indicates if this is the default event.bool IsReadonly { get; set; }
Indicates if the event is immutable.string EventNumberDisplay { get; }
Display string of the form"Event XX"(e.g.,"Event 01"), derived fromEventNumber.string TestItem { get; set; }
Stores"<TestSetup>:<TestId>:("<All or ROI>")for export (see comment: issue #43387).string DTSFile { get; set; }
Stores the.DTSfile path for export (see comment: issue #43387).TimeSpan EventLength { get; set; }
Total time available for the download event.bool ShouldDisplayLength { get; set; }
Controls whetherEventLengthis displayed.
BuildTestSetup (Class)
- Namespace:
DataPROWin7.DataModel - Purpose: Converts high-level test templates or XML test setup definitions into a structured, serializable representation for UI and export consumption. Implements
IBuildTestSetupandINotifyPropertyChanged. - Constructors:
BuildTestSetup(string dasSerialNumber, string testSetupName, ExportFileXMLClass exportFileXML)
Parses aExportFileXMLClassobject to populate properties and groups.BuildTestSetup(string dasSerialNumber, string testSetupName, TestTemplate testTemplate)
Maps properties from aTestTemplateinstance to string-based properties.
- Key Properties (all
string-typed for serialization compatibility):- Hardware/Setup:
DASSerialNumber,SetupName,SetupDescription - Timing/Triggering:
RecordingMode,SamplesPerSecond,PreTriggerSeconds,PostTriggerSeconds,NumberOfEvents,WakeUpMotionTimeout,ScheduledStartDateTime,IntervalBetweenEventStartsMinutes,StartWithEvent,WakeUpWithMotion,TriggerCheckStep - Diagnostics/Validation:
StrictDiagnostics,RequireConfirmationOnErrors,WarnOnBatteryFail,AllowMissingSensors,AllowSensorIdToBlankChannel,SuppressMissingSensorsWarning - Arm/Checklist Steps:
PerformArmChecklist,CheckInputVoltage,CheckBatteryVoltage,CheckSquibResistance,CheckSensorIds,CheckStartEventLines,CheckTiltSensor,CheckTemperature,RequireAllUnitsPassArmCheckList,ExcitationWarmupTimeMS - Export/Download:
ROIDownload,ViewROIDownload,DownloadAll,ViewDownloadAll,Export,ExportFolder,ExportCh10FilteredEUDesired,ExportChryslerDDASDesired,ExportCSVADCDesired,ExportCSVFilteredDesired,ExportCSVMVDesired,ExportCSVUnfilteredDesired,ExportDiademADCDesired,ExportASCDesired,ExportHDFADCDesired,ExportHDFMVDesired,ExportHDFUnfilteredDesired,ExportISOFilteredDesired,ExportISOUnfilteredDesired,ExportRDFADCDesired,ExportTDASADCDesired,ExportTDMSADCDesired,ExportToyotaUnfilteredDesired,ExportTSVFilteredDesired,ExportTSVUnfilteredDesired,ExportXLSXFilteredDesired,ExportXLSXUnfilteredDesired - UI/Display:
ViewRealtime,RealtimeCharts,ROIStart,ROIEnd,CommonStatusLine,UploadData,UploadDataFolder,UseLabDetails,UseCustomerDetails,UseTestEngineerDetails,AutoArm,Streaming,CalibrationBehavior,NotAllChannelsRealTime,NotAllChannelsViewer,QuitTestWithoutWarning,MeasureSquibResistances - Metadata:
LastModified,LastModifiedBy,UserTags
- Hardware/Setup:
- Collections:
List<GroupXMLClass> Groups { get; set; }
List of test groups with channels and settings.List<LevelTriggerXMLClass> LevelTriggers { get; set; }
List of level trigger definitions.
3. Invariants
TSRAIRGoTestSetupsingleton: Only one instance exists per application domain (enforced vialockand_setupfield). TheNameproperty is immutable and always equals"TSRAIR_GO_TEST".DownloadEventdefaults: Default constructor initializesEventNumber = 0,IsEnabled = true,IsDefault = true,IsReadonly = true.EventNumberDisplayis derived fromEventNumberand formatted as"Event XX".BuildTestSetupproperty types: All configuration properties are stored asstring, even if originally numeric or boolean (e.g.,SamplesPerSecond,AutomaticMode). This is intentional for XML round-tripping.- Export format parsing: In
DecodeExportFormats, only the following export formats are decoded to boolean flags (others are commented out and ignored):Ch10FilteredEU,ChryslerDDAS,CSVADC,csvfiltered,CSVMV,csvunfiltered,diademadc,FIATASC,HDFADC,HDFMV,HDFUnfiltered,isofiltered,isounfiltered,rdfadc,tdasadc,tdmsadc,toyotaunfiltered,tsvfiltered,tsvunfiltered,xlsxfiltered,xlsxunfiltered
HardwareInclusionInstruction.Action: Must be eitherRemoveorAdd; no validation is performed at construction, so callers must ensure valid values.
4. Dependencies
Imports/References (from source):
DTS.Common.Interface.DASFactory.DiagnosticsDTS.SensorDBDTS.Slice.Users.UserSettingsDTS.Common.Interface.DownloadEventDTS.Common.XMLUtilsDTS.Common.EnumsDTS.Common.SharedResource.StringsDataPROWin7.DataModel(internal namespace forTestTemplate,GroupXMLClass,ChannelXMLClass,LevelTriggerXMLClass,ExportFileXMLClass,TestSetupDefaults,TestTemplateList,SupportedExportFormatBitFlags)
Inferred Dependencies:
TestTemplate: Required byTSRAIRGoTestSetupandBuildTestSetupconstructors.TestTemplateList: Used byTSRAIRGoTestSetup.GetInstanceto retrieve named templates.TestSetupDefaults: Used byTSRAIRGoTestSetup.GetInstancefor fallback user settings.GroupXMLClass,ChannelXMLClass,LevelTriggerXMLClass,ExportFileXMLClass: Referenced inBuildTestSetupconstructors and XML parsing logic.SupportedExportFormatBitFlags: Used inDecodeExportFormatsto decode export format bitmasks.
5. Gotchas
TSRAIRGoTestSetupcaching behavior: The singleton instance is not invalidated on user change unlessuseCache = false. Reusing the instance across different users may lead to incorrect settings ifuserIdis not consistent.BuildTestSetupstring-based properties: All properties arestring, even for numeric/boolean values (e.g.,"True","100"). Consumers must parse these values appropriately; no runtime type safety is enforced.- Export format decoding is incomplete: In
DecodeExportFormats, several formats are commented out (ExportCh10UnfilteredEUDesired,ExportHDFFilteredDesired,ExportSomatFilteredDesired,ExportSomatUnfilteredDesired,ExportToyotaFilteredDesired). This may cause confusion if export formats are expected to be fully symmetric. HardwareInclusionInstructionimmutability:HardwareIdandActionare read-only (get;only), but the class itself is not immutable (e.g., noreadonlyfields). Copy constructor exists but is not enforced.DownloadEvent.TestItemandDTSFile: These properties are documented as being for export (issue #43387), but there is no validation or enforcement of their format or usage. Misuse could break export logic.BuildTestSetup.ParseSettings: Uses hardcoded string prefixes (e.g.,"0=","1=") to parse settings. If the XML format changes or prefixes are reordered, parsing will silently fail or misassign values.- Thread safety:
TSRAIRGoTestSetup.GetInstanceis thread-safe vialock, but no other classes in this module declare thread-safety guarantees. Concurrent access to shared mutable state (e.g.,DownloadEventproperties) is not protected.