9.8 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | ||||
|---|---|---|---|---|---|---|---|---|
|
2026-04-16T03:59:19.825998+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | 4eeb90f6bf6e5cce |
TDAS
Documentation: TDAS Configuration and Setup Info Classes
1. Purpose
This module provides data structures and configuration persistence for the TDAS (Test Data Acquisition System) service layer. It defines setup metadata (TDASServiceSetupInfo, TDASServiceSetupInfoLookup) used to configure acquisition parameters at runtime, and XML-serializable configuration classes (TDASConfig, TDASModuleConfig) that store per-module hardware and test settings to disk. These classes enable centralized management of DAS module configurations, channel definitions, and acquisition parameters across test sessions.
2. Public Interface
TDASServiceSetupInfo
-
Constructor:
TDASServiceSetupInfo(string setupDescription, double? samplesPerSecond, float hardwareFilterRateHz, DFConstantsAndEnums.RecordingMode recordingMode, bool? checkoutMode)
Initializes a new instance with fixed (non-lookup) acquisition parameters. All parameters are required;samplesPerSecondandcheckoutModeare nullable. -
Properties:
string SetupDescription– Human-readable description of the setup.double? SamplesPerSecond– Fixed sample rate (Hz); nullable to allow optional specification.float HardwareFilterRateHz– Hardware anti-aliasing filter rate in Hz (non-nullable).DFConstantsAndEnums.RecordingMode RecordingMode– Recording mode enum value (e.g., continuous, triggered).bool? CheckoutMode– Optional flag indicating whether the setup is for hardware checkout.
TDASServiceSetupInfoLookup
-
Constructor:
TDASServiceSetupInfoLookup(string setupDescription, Dictionary<string, double> sampleRateLookup, Dictionary<string, float> aafLookup, DFConstantsAndEnums.RecordingMode recordingMode, bool? checkoutMode)
Initializes a lookup-based setup info where sample rate and filter rate vary by DAS unit (identified by string key, likely serial number). -
Properties:
string SetupDescription– Same as above.Dictionary<string, double> SamplesPerSecondLookup– Maps DAS identifier (e.g., serial number) to its sample rate.Dictionary<string, float> HardwareFilterRateHzLookup– Maps DAS identifier to its hardware filter rate.DFConstantsAndEnums.RecordingMode RecordingMode– Same as above.bool? CheckoutMode– Same as above.
TDASConfig
-
Constructor:
TDASConfig()– Default constructor.
TDASConfig(string fileName, bool deleteIfPresent)– Loads config fromDASConfigs/<fileName>(relative to executing assembly directory). IfdeleteIfPresentistrue, deletes existing file before proceeding; otherwise, attempts to deserialize. -
Properties:
Dictionary<string, TDASModuleConfig> Modules– Read-only dictionary of modules keyed by serial number.string FileName– Full path to the config file (read-only).
-
Methods:
void SetModule(TDASModuleConfig module)– Adds or updates a module in_modulesbySerialNumber.TDASModuleConfig GetModule(TDASModuleConfig module)– Retrieves module bySerialNumber; if missing, adds the provided module and returns it.void ReadXml(XmlReader reader)– Deserializes XML into_modules(expects<TDASConfig><Modules>...</Modules></TDASConfig>structure).void WriteXml(XmlWriter writer)– Serializes_modulesto XML.XmlSchema GetSchema()– Returnsnull(perIXmlSerializableconvention for schema-less types).
TDASModuleConfig
-
Constructor:
TDASModuleConfig()– Default constructor.
TDASModuleConfig(string fileName)– Loads module config fromDASConfigs/<fileName>. -
Properties:
string SerialNumber– Unique identifier for the module.string TestId– Test identifier string.string TestDescription– Human-readable test description.DFConstantsAndEnums.RecordingMode RecordingMode– Recording mode (default:InvalidArmMode).float AAFilterRateHz– Anti-aliasing filter rate (default:0).double PreTriggerSeconds– Pre-trigger hold time (default:0).double PostTriggerSeconds– Post-trigger record time (default:0).string FirmwareVersion– Module firmware version string.UInt64? MaxEventStorageSpaceInBytes– Optional max storage for event data.int ModuleArrayIndex– Zero-based index for module ordering (default:0).string FileName– Full path to config file (read-only).Dictionary<int, DASChannel> Channels– Internal dictionary of channels keyed byModuleChannelNumber(not exposed directly; accessed viaSetChannel/GetChanneloverloads).
-
Methods:
void SetChannel(OutputTOMDigitalChannel channel)/SetChannel(OutputSquibChannel channel)/SetChannel(AnalogInputDASChannel channel)– Adds or updates channel byModuleChannelNumber.AnalogInputDASChannel GetChannel(AnalogInputDASChannel channel)/GetChannel(OutputSquibChannel channel)/GetChannel(OutputTOMDigitalChannel channel)– Retrieves channel byModuleChannelNumber; if missing, adds the provided channel and returns it.void ReadXml(XmlReader reader)– Deserializes XML into module properties and channels. Handles legacy configs (e.g., missingModuleArrayIndexelement).void WriteXml(XmlWriter writer)– Serializes module properties and channels to XML.XmlSchema GetSchema()– Returnsnull.virtual void WriteElementStart(XmlWriter writer)– Writes<TDASModule xsi:type="...">with concrete type.virtual void WriteElementEnd(XmlWriter writer)– Closes the<TDASModule>element.
3. Invariants
TDASConfig:_modulesdictionary is keyed byTDASModuleConfig.SerialNumber; duplicates are overwritten bySetModule.FileNameis always an absolute path constructed relative to the executing assembly’s directory underDASConfigs/.
TDASModuleConfig:RecordingModedefaults toDFConstantsAndEnums.RecordingMode.InvalidArmMode(invalid state); must be explicitly set to a valid mode.AAFilterRateHz,PreTriggerSeconds,PostTriggerSecondsdefault to0.MaxEventStorageSpaceInBytesis nullable; invalid values (negative or ≥ulong.MaxValue) are logged and ignored.ModuleArrayIndexdefaults to0; invalid values (negative or ≥int.MaxValue) are logged and ignored.- Channel dictionaries use
ModuleChannelNumberas the key; duplicate channel numbers overwrite existing entries.
- XML Serialization:
TDASConfigexpects<TDASConfig><Modules>...</Modules></TDASConfig>.TDASModuleConfigexpects<TDASModule>...</TDASModule>with child elements in a fixed order (e.g.,SerialNumber,TestId,RecordingMode, etc.).- Channel serialization uses
WriteElementStart/WriteElementEndto includexsi:typefor polymorphic deserialization.
4. Dependencies
- Imports/Usings:
DTS.Common.DAS.Concepts– ProvidesDASChannel,AnalogInputDASChannel,OutputSquibChannel,OutputTOMDigitalChannel.DTS.Common.Enums.DASFactory– ProvidesDFConstantsAndEnums.RecordingMode.DTS.DASLib.Command.SLICE– Referenced but not directly used in these classes (likely transitive dependency).DTS.Common.Utilities.Logging– ProvidesAPILoggerfor error logging during XML deserialization.- Standard .NET libraries:
System.Xml,System.IO,System.Collections.Generic,System.
- Consumers:
TDASConfigandTDASModuleConfigare used by the TDAS service layer to persist/load configurations.TDASServiceSetupInfo/TDASServiceSetupInfoLookupare likely used by higher-level configuration or initialization logic (e.g., service startup, test setup UI).- XML serialization implies integration with external tools or UIs that read/write config files.
5. Gotchas
TDASServiceSetupInfoLookupnaming: The constructor parameteraafLookupis named inconsistently with the propertyHardwareFilterRateHzLookup; this may cause confusion.GetModule/GetChannelbehavior: Both methods add the provided object to the dictionary if missing, which can silently mutate state. Callers must ensure the input object is fully initialized.- XML deserialization robustness:
RecordingModeand numeric fields (AAFilterRateHz,PreTriggerSeconds, etc.) usetry/catch+APILogger.Logfor errors, but silently default to0/InvalidArmModeon failure.ModuleArrayIndexis wrapped in atry/catchblock to handle legacy configs (missing element), but other elements lack this fallback.
- Path construction: Config paths are hardcoded to
DASConfigs/under the assembly directory; this may not work in all deployment scenarios (e.g., ClickOnce, containerized). - Channel polymorphism:
WriteElementStartusesGetType()to writexsi:type, butReadXmlrelies on thetypeattribute to deserialize intoOutputSquibChannel,OutputTOMDigitalChannel, orAnalogInputDASChannel. Mismatched types in XML will cause silent fallback toAnalogInputDASChannel. - No validation: No validation is performed on
SetupDescription,SerialNumber, orTestId(e.g., empty strings allowed). SamplesPerSecondvsSamplesPerSecondLookup: The nullabledouble?inTDASServiceSetupInfovs.Dictionary<string, double>inTDASServiceSetupInfoLookupsuggests two distinct use cases (single rate vs. per-DAS rates), but the distinction is not enforced programmatically.