14 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
2026-04-17T15:32:07.033417+00:00 | zai-org/GLM-5-FP8 | 1 | 666ebf3a34293f35 |
DTS.Common.DataModel Module Documentation
1. Purpose
This module provides the core data model and application-wide state management for the DTS (Data Acquisition System) application. It contains global application properties, configuration settings, hardware abstraction representations, data file management, and device discovery orchestration. The module serves as the central hub connecting UI components to underlying hardware communication layers, test data storage, and ISO standard compliance data.
2. Public Interface
ApplicationProperties (static class)
Global application state container.
| Property | Type | Description |
|---|---|---|
CurrentUser |
User |
The currently logged-in user. |
DASFactory |
DASFactory |
Factory instance for DAS device management. |
CurrentView |
User |
Current view context (distinct from CurrentUser). |
IsoDb |
ISO13499FileDb |
ISO 13499 database reference. |
LicenseValidationResult |
ValidationResult |
Result of license validation. |
CanCurrentUserCommitChannelCodes |
bool |
Permission flag for channel code commits. |
DataModelSettings (static class)
Application-wide configuration with default values.
Key Properties:
UseISOCodeForDiadem200(bool, default:false)SampleRateAAFilterRatio(byte, default:5)SupportedSquibFireModes(string, default:"CAP,CONSTANT")ShowCompactHardware(bool, default:true)AllowedVoltageInsertionErrorPercent(double, default:1)AllowedExcitationErrorPercent(double, default:2)AllowedShuntErrorPercent(double, default:5)AllowedGainErrorPercent(double, default:2)AllowedGainErrorPercent_SLICE6andSLICE6A(double, default:5)DownloadFolder(string, default:"..\\..\\Data")RequireXCrashCompatibilityForISOExports(bool, default:true)SLICETurnOffAAFRealtime(bool, default:true)ArmChecklistRequiredIfTOM(bool, default:true)CheckUnitsIntervalMillisecond(int, default:50)SemaphoreDelay(double, default:10)SemaphoreSpots(int, default:3)SLICEConcurrentSpots(int, default:999)MulticastAutoDiscoveryReceiveTimeoutMS(int, default:1500)LocalKeepAliveRetryIntervalMS(uint, default:1000)LocalKeepAliveTimeOutMS(uint, default:5000)RemoteKeepAliveRetryIntervalSeconds(uint, default:5)RemoteKeepAliveSeconds(uint, default:60)ReceiveBufferSizeBytes/SendBufferSizeBytes(int, default:65536)HeartbeatAsyncConnectTimeoutMS(int, default:10000)DefaultTDCSensorDatabaseFolder/DefaultTDCSensorDatabaseFile(string defaults for sensor database)
CollectDataProcess
Represents a data collection process with visual properties. Inherits from BasePropertyChanged.
public CollectDataProcess(string name, Color color)
| Property | Type | Description |
|---|---|---|
Name |
string |
Process name (notifies property change). |
BackgroundColor |
Color |
Display color for the process. |
IsEnabled |
bool |
Enablement state. |
SysBuiltObjectType
Container for Dynamic Groups of a given test object type (Vehicle 1, Vehicle 2, Sled, etc.).
public SysBuiltObjectType(string testObjectType)
| Property | Type | Description |
|---|---|---|
TestObject |
MMETestObjects |
Resolved test object from ApplicationProperties.IsoDb. Setter stores Test_Object string internally. |
ISOTestObjectType |
string |
Returns TestObject.Text_L1. |
Methods:
ToString()- ReturnsTestObject.Text_L1.
DataFiles
Metadata container for test data files.
public DataFiles(string expandCollapse, string testName, string id, string allOrROI,
string lab, string customer, DateTime dateCreated, string description,
string numberOfChannels, string testEngineer, bool isTSRAIR, string roiSuffix = "")
| Property | Type | Description |
|---|---|---|
ExpandCollapse |
string |
UI expansion state ("+", "-", or empty). |
TestId |
string |
Test identifier. |
TestName |
string |
Test name. |
AllOrROI |
string |
"All" or "ROI" designation. |
Lab / Customer / TestEngineer |
string |
Test metadata. |
DateCreated |
DateTime |
Creation timestamp. |
Description |
string |
Test description. |
NumberOfChannels |
string |
Channel count. |
ROISuffix |
string |
ROI suffix identifier. |
DTSFile |
string |
Location of DTS file (populated in export tab). |
IsTSRAIR |
bool |
TSR AIR test flag. |
TestSelected |
bool |
Selection state. |
LongString |
string |
Extended description. |
DataFilesList
Manages discovery and listing of test data files. Singleton pattern.
public static DataFilesList DataFileList { get; } // Singleton accessor
Key Methods:
DataFiles[] GetAllFiles(string testName)- Returns all data files for a given test name, recursively searching for folders containing both.dtsand.chnfiles.DataFiles[] GetAllDataFiles()- Returns top-level test folder summaries.DataFiles[] Contract(DataFiles df)- Collapses expanded test entries in the list.DataFiles[] DataFiles(property) - Gets/sets the current file list.
Private Methods:
string[] GetFoldersWithData(string folder)- Recursively finds folders with both.dtsand.chnfiles.bool GetTestInfo(string dtsFilePath, out string lab, out string customer, out string description, out string testEngineer, out DateTime dt, out string name)- Parses test metadata from DTS file using streaming XML parsing.int GetFileCount(string binaryFolder, string testId)- Counts test data sets in a binary folder.
ChannelRepresentation
Converts internal channel numbers to display-friendly representations for various hardware types.
public ChannelRepresentation(DASHardware h, DTS.DASLib.Service.DASChannel c, int startingChannelNumber)
public ChannelRepresentation(HardwareChannel c, int startingChannelNumber, IDASHardware[] hardwares = null)
Nested Enum:
public enum ChannelTypeEnum { SQUIB, TOMDigital, DigitalInput, Other }
| Property | Type | Description |
|---|---|---|
DASSerialNumber |
string |
DAS device serial number. |
SerialNumber |
string |
Module serial number. |
ChannelNumberString |
string |
Formatted display string (e.g., "CH01", "SQ02"). |
ChannelNumber |
int |
Numeric channel number. |
Behavior: Handles channel number conversion for hardware types including:
- TDAS_Pro_Rack, TDAS_LabRack
- SLICE variants (SLICE2_TOM, SLICE2_SLT, SLICE6_AIR, SLICE_PRO_CAN_FD, etc.)
- G5VDS, G5INDUMMY
- EMB devices (EMB_ANG_ARS, EMB_ATM, EMB_LIN_ACC_HI, EMB_LIN_ACC_LO)
- TSR_AIR, TSR_AIR_RevB, DIR, DKR
- SLICE6_AIR_TC (thermocouple handling)
DASFactory
Wrapper around DTS.DASLib.DASFactory.DASFactory for device discovery and management.
public DASFactory() // Constructor initializes semaphores, keep-alive settings, and performs initial refresh
Events:
DASFactoryEventHandler OnDeviceArrived- Fired when a device is discovered.DASFactoryEventHandler OnFactoryChanged- Fired on device arrival, failure, or removal.DiscoveredDASEventHandler DiscoveredDAS- Fired during discovery thread iterations.
Key Methods:
void StartMulticastAutoDiscovery()/void StopMulticastAutoDiscovery()- Control auto-discovery process.IDiscoveredDevice[] GetDiscoveredDevices()- Returns discovered devices.IDASFactory GetDASFactory()- Returns underlying factory interface.void TakeOwnership()- Takes ownership of devices.void DetachAllDevices(bool detachUSB = false)- Detaches devices (USB detach conditional).void DisposeFactory()- Disposes the underlying factory.void Refresh(bool wait)- Refreshes device list; prevents overlapping refresh calls.List<IDASCommunication> GetActiveDevices()- Returns active DAS devices.string[] GetReportedConnections()- Returns connections reported by ECM/SDB/S6DB.SortableBindingList<IDiscoveredDevice> AutoDiscoverMulticast()- Performs multicast discovery.void DiscoveryThread(DFConstantsAndEnums.MultiCastDeviceClasses[] deviceFilter, CancellationToken ct, bool discoverParents = true)- Background discovery thread.void AutoDiscoverIfNecessary()- Runs auto-discovery for SLICE6/SLICE6Db downstream MAC addresses.void StartQATSListening()/void StopQATSListening()/void SendQATSRequest()/IUDPQATSEntry[] GetQATS()- QATS (Query Arm Trigger Status) operations.
Static Methods:
bool IsStreaming(IDASCommunication das)- Returns true if SLICE6 Air is streaming.bool IsInRealtime(IDASCommunication das)- Returns true if unit is in realtime or streaming.bool AnyInRealtime(List<IDASCommunication> das)- Returns true if any unit is in realtime.
Properties:
TDASHostNames,SPFDHostNames,SDBHostNames(string arrays) - Host name configurations.MulticastAutoDiscoveryReceiveTimeoutMS,MulticastAutoDiscoveryAddress,MulticastAutoDiscoveryPort,MulticastAutoDiscoveryResponsePort- Multicast configuration.S6ConnectNewTimeout(double) - SLICE6 connection timeout.
3. Invariants
-
ApplicationProperties singleton state: All properties are static and globally accessible; consumers must ensure thread-safe access patterns.
-
DataFilesList singleton: The
DataFileListproperty uses lazy initialization and returns a single shared instance. -
DASFactory refresh concurrency: The
_bInRefreshflag guards against overlappingRefresh()calls. IfRefresh()is called while already refreshing, the second call is silently ignored. -
ChannelRepresentation hardware type handling: The
ConvertChannelNumbersmethod must receive a validHardwareTypesenum value; unhandled types fall through to a default case that uses the starting channel number directly. -
Data folder structure expectation:
DataFilesListexpects a folder hierarchy ofTestName/TestId/Binary/[All|ROI]for proper parsing ofAllOrROIvalues. -
DTS file uniqueness:
GetFileCountandGetAllFilesassume exactly one.dtsfile per data folder; folders with zero or multiple DTS files are skipped.
4. Dependencies
This module depends on:
DTS.Slice.Users- User typesDTS.Common.Base-BasePropertyChangedfor INPCDTS.Common.ISO- ISO 13499 database types (ISO13499FileDb,MMETestObjects)DTS.Common.Licensing.Messages-ValidationResultDTS.Common.Enums.Hardware-HardwareTypesenumDTS.Common.Enums.Sensors- Sensor enumsDTS.Common.Interface.DataRecorders-IDASHardwareDTS.Common.Interface.DASFactory-IDASFactory,IDiscoveredDeviceDTS.Common.Enums.DASFactory-DFConstantsAndEnumsDTS.Common.Converters-EnumDescriptionTypeConverterDTS.Common.Constant.DASSpecific-SensorConstantsDTS.Common.SharedResource.Strings- Localized stringsDTS.Common.Utilities.Logging-APILoggerDTS.Common.Utils- Utility functionsDTS.Common.DataModel.Classes.TestTemplate-TSRAIRGoTestSetupDTS.Serialization- Serialization utilitiesDTS.DASLib.DASFactory- Underlying DAS factory implementationDTS.DASLib.Service- DAS channel typesDTS.DASLib.Command- Command infrastructureSystem.Windows.Media-Colortype
What depends on this module:
- Unclear from source alone;
ApplicationPropertiesis a global state container likely used throughout the application.
5. Gotchas
-
ApplicationProperties mutable global state: All properties are get/set with no validation or change notification. Setting
CurrentUser,DASFactory, orIsoDbto null could cause null reference exceptions in consumers likeSysBuiltObjectType.TestObjectwhich accessesApplicationProperties.IsoDb.GetTestObjectByIso(). -
SysBuiltObjectType null handling: The
TestObjectgetter callsIsoDb.GetTestObjectByIso(_testObject)without null-checkingIsoDb. IfApplicationProperties.IsoDbis null, this will throw. -
DASFactory TDASHostNames/SDBHostNames setters have side effects: Setting these properties triggers refresh logic in the underlying factory. The setter includes a check to avoid redundant updates but only after checking
_bInRefreshflag with conditional compilation logging. -
ChannelRepresentation casting without validation: The constructor casts
ctoDTS.DASLib.Service.AnalogInputDASChannelwithout type checking when determiningDigitalInputchannel type. This could throw ifcis not anAnalogInputDASChannel. -
DataFilesList.GetTestInfo XML parsing fragility: The method manually constructs XML by appending
"</Test>"to incomplete tags. Malformed DTS files could causeXElement.Parseto throw. -
DASFactory.Refresh wait behavior: When
waitisfalse, the_bInRefreshflag is set tofalseinside the callback, but if the callback never fires (exception case),_bInRefreshremainstrue, blocking future refreshes. -
ChannelRepresentation.DoSquibConversion returns 0 for unexpected remainders: Squib channel numbers with remainders 0, 2, 4, 6 return 0, which may represent an error state but is not documented.
-
Conditional compilation LOG_DEBUG_REFRESH: Debug logging for refresh overlap detection is controlled by
#define LOG_DEBUG_REFRESHand is not compiled into release builds.