11 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |||
|---|---|---|---|---|---|---|---|
|
2026-04-16T03:38:27.625300+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | 94471ae1594e14ef |
Documentation: DTS.Serialization.TestSetup Module
1. Purpose
This module defines core data structures used to serialize and deserialize test setup configurations in the DTS (Dynamic Test System) platform. It provides strongly-typed, property-backed classes (TestSetup, Sensor, ExtraProperty) that model metadata about a test run—including laboratory and customer information, test parameters, associated sensors, graphs, and upload settings. These classes are designed to support XML serialization (evidenced by [Serializable] and [XmlIgnore] attributes) and are part of a larger serialization framework leveraging DTS.Common.Utilities.DotNetProgrammingConstructs.Property<T> for change tracking and metadata management. The module serves as the foundational schema for persisting and restoring test configurations across sessions.
2. Public Interface
All classes reside in the DTS.Serialization namespace and inherit from Exceptional.
TestSetup (partial class, [Serializable])
-
TestSetup()
Default constructor. Initializes all backingProperty<T>fields to default values (e.g.,nullfor strings,0forInt32,CalibrationBehaviors.NonLinearIfAvailable, empty lists,"2.0.0.0"forVersion,falseforUpload/UploadExportsOnly,""forUploadFolder).
Note: Several fields are initialized redundantly (e.g.,_dateOfTheTestis assignednulltwice), but this is harmless. -
bool Upload
Indicates whether the test setup was configured to upload when run. Default:false. -
string UploadFolder
Stores the simple upload folder value set in the UI. May be overridden by an INI file at runtime. Default:"". -
bool UploadExportsOnly
Indicates whether only exported files should be uploaded. Default:false. -
string ISFFile
Stores the path or name of the ISF (Instrument Setup File) associated with the test. Default:"". -
string DateOfTheTest
Date of the test as a string. Default:null. -
string Description
Free-text description of the test. Default:null. -
CalibrationBehaviors CalibrationBehavior
Calibration behavior setting. Default:CalibrationBehaviors.NonLinearIfAvailable. -
string ExportFolder
Folder path for exported data. Default:null. -
int ExportTypes
Bitmask or enum value indicating export formats. Default:0. -
List<Graph> Graphs
List of multi-channel graphs defined in the test. Default: new empty list. -
List<Sensor> Sensors
List of sensors used in the test. Default: new empty list. -
List<ExtraProperty> ExtraProperties
List of arbitrary key-value metadata pairs. Default: new empty list. -
List<TestObject> TestObjects
List of test objects involved. (Note:TestObjecttype not defined in provided sources.)
Default: new empty list. -
List<Graph.Channel> Channels
Placeholder for all graph channels (XML-ignored). Initialized as empty list. -
List<Graph> SingleChannelGraphs
Placeholder for single-channel graphs (XML-ignored). Initialized as empty list. -
IDictionary<Guid, Graph> SortedGraphs
Sorted dictionary of graphs (XML-ignored), populated bySortGraphs(). -
void SortGraphs()
ClearsSortedGraphs, then populates it with entries fromGraphs(multi-channel) in order, followed by entries fromSingleChannelGraphssorted byAbsoluteDisplayOrderof their first channel. -
string LabName,LaboratoryName,LaboratoryContactName,LaboratoryContactPhone,LaboratoryContactFax,LaboratoryContactEmail,LaboratoryTestReferenceNumber,LaboratoryProjectReferenceNumber
Laboratory-related metadata fields. Most default tonull.
LaboratoryProjectReferenceNumberhas a custom getter: returns""if_laboratoryProjectReferenceNumber.IsValueInitializedisfalse, otherwise returns the value. -
string CustName,CustomerName,CustomerTestReferenceNumber,CustomerProjectReferenceNumber,CustomerOrderNumber,CustomerCostUnit
Customer-related metadata fields. All default tonull. -
string TEName,TestEngineerName,TestEngineerPhone,TestEngineerFax,TestEngineerEmail
Test engineer contact fields.
TENamehas a custom getter: returns""if_teName.IsValueInitializedisfalse, otherwise returns the value. -
string Name
Name of the test setup. Default:null. -
string NumberOfTestObjects,NumberOfMedia
String representations of counts. Default:null. -
string ReferenceTemperature,Regulation,RelativeAirHumidity,Subtype,TestComment,TypeOfTheTest,Timestamp
Various test parameters. All default tonull. -
virtual string Version
Version of theTestSetupschema. Default:"2.0.0.0"(set in constructor). Overridable in derived classes.
TestSetup.Sensor (nested partial class)
-
Sensor()
Default constructor. Initializes all string properties tonull, exceptVersion, which is set to"1.0.0.0". -
string FilterClass
Filter class name. Default:null. -
string Name
Sensor name. Default:null. -
string Polarity
Polarity setting (e.g., “Positive”, “Negative”). Default:null. -
string Position
Physical or logical position of the sensor. Default:null. -
string Range
Measurement range of the sensor. Default:null. -
string Version
Schema version for this sensor definition. Default:"1.0.0.0".
TestSetup.ExtraProperty (nested partial class)
-
ExtraProperty()
Default constructor. SetsKeyandValuetonull,Versionto"1.0.0.0". -
ExtraProperty(string key, string value)
Constructor that initializesKeyandValueto the provided arguments. -
string Key
Key/name of the extra property. Default:null. -
string Value
Value of the extra property. Default:null. -
string Version
Schema version for this property. Default:"1.0.0.0".
3. Invariants
- All
Property<T>fields are initialized with a unique metadata key (e.g.,typeof(TestSetup).Namespace + ".TestSetup.Upload") and default value. - The
Versionproperty ofTestSetupis initialized to"2.0.0.0"in the constructor and is markedvirtual, implying extensibility. - The
Versionproperties ofSensorandExtraPropertyare initialized to"1.0.0.0". UploadFolderandISFFiledefault to""(empty string), notnull.ExportTypesdefaults to0(i.e., no export formats selected).CalibrationBehaviordefaults toCalibrationBehaviors.NonLinearIfAvailable.Graphs,Sensors,ExtraProperties, andTestObjectsdefault to new empty lists (notnull).Channels,SingleChannelGraphs, andSortedGraphsare XML-ignored and used only at runtime.SortGraphs()enforces ordering: multi-channelGraphsfirst (in original list order), thenSingleChannelGraphssorted byAbsoluteDisplayOrderof their first channel.TENameandLaboratoryProjectReferenceNumberhave non-standard getters: they return""if the underlyingProperty<T>.IsValueInitializedisfalse, otherwise return the stored value.
4. Dependencies
Internal Dependencies (from source):
DTS.Common.Utilities— Provides base types (Exceptional,Property<T>).DTS.Common.Utilities.DotNetProgrammingConstructs— ContainsProperty<T>implementation.DTS.Common.Enums.Sensors— DefinesCalibrationBehaviorsenum (used inTestSetup.CalibrationBehavior).System.Collections.Generic— ForList<T>andIDictionary<TKey, TValue>.System.Xml.Serialization— Used for[Serializable]and[XmlIgnore]attributes.
External Dependencies (inferred):
Graphclass — Referenced inTestSetup.Graphs,SingleChannelGraphs,Channels, andSortedGraphs. Not defined in provided sources, but its nestedChannelclass andIdentifierandFirstTestChannelproperties are used.TestObjectclass — Referenced inTestSetup.TestObjects. Not defined in provided sources.GraphDisplayOrderComparer— A private method inTestSetupthat comparesGraphinstances byAbsoluteDisplayOrderof their first channel.
5. Gotchas
- Redundant field initialization: In
TestSetup(),_dateOfTheTest.Value = nullappears twice. Likely a copy-paste artifact, but harmless. - Inconsistent null vs. empty string defaults:
UploadFolder,ISFFile→""ExportFolder,DateOfTheTest,Description, etc. →null
This may cause confusion when checking for presence (e.g.,string.IsNullOrEmpty()vs.nullchecks).
- Non-standard getters for optional fields:
TENameandLaboratoryProjectReferenceNumberreturn""when uninitialized, while other string properties returnnull. This breaks consistency and may lead to bugs if consumers assume uniform nullability. IsValueInitializedusage is undocumented inProperty<T>:
The behavior ofIsValueInitializedis not defined in the source; its semantics (e.g., whether it tracks explicitnullassignments) are unknown.VersionisvirtualinTestSetupbut not in nested classes:
Sensor.VersionandExtraProperty.Versionare notvirtual, suggesting they are not intended for override, whileTestSetup.Versionis. This may indicate a versioning strategy where only top-level objects evolve schema.ExtraPropertiesandSensorslists are mutable but not defensively copied:
SettingTestSetup.Sensors = nullorTestSetup.Sensors = new List<Sensor>()is allowed, but no validation prevents null or duplicate entries.SortGraphs()mutatesSortedGraphsbut does not validate inputs:
IfGraph.Identifieris not unique,SortedGraphs.Add()will throw anArgumentException.GraphDisplayOrderComparermay throwNullReferenceException:
Ifa.FirstTestChannelorb.FirstTestChannelisnull, the comparison will fail. No null checks are present.[Serializable]onTestSetupbut noISerializableimplementation:
Relies on default .NET serialization; may break across assembly version changes if field names or types change.
Documentation generated from provided source files. No external assumptions or behaviors were inferred beyond what is strictly observable.