Files
2026-04-17 14:55:32 -04:00

3.0 KiB

source_files, generated_at, model, schema_version, sha256
source_files generated_at model schema_version sha256
Common/DTS.Common.DataModel/Classes/Configuration/Configuration.cs
2026-04-17T15:42:37.313288+00:00 zai-org/GLM-5-FP8 1 bbafb2fe040fef50

Documentation: Configuration Class

1. Purpose

The Configuration class is responsible for configuring Data Acquisition System (DAS) hardware devices by applying voltage threshold settings, resetting hardware lines, and persisting configuration files. It serves as a bridge between test templates and physical DAS hardware, ensuring devices are properly configured for either diagnostic or armed operational modes. The class handles the complete configuration lifecycle including threshold application, hardware line reset, configuration upload, and local file backup.

2. Public Interface

Configuration() (Constructor)

Signature: public Configuration()

Default parameterless constructor. Performs no initialization.


SetConfig

Signature:

public void SetConfig(
    DataModel.TestTemplate currentTest,
    List<IDASCommunication> dasList,
    bool calledDuringDiagnostics,
    StatusHelpers.SetProgressValueDelegate setProgressFunction)

Behavior: Configures all DAS devices in dasList with voltage thresholds and hardware settings. The method:

  1. Acquires a lock on DASHardware.GetArmStatusLock
  2. Sets minimum/maximum valid input and battery voltage thresholds for each DAS
  3. Applies either diagnostic or armed voltage thresholds based on calledDuringDiagnostics parameter
  4. Resets hardware lines via ConfigurationService.ResetHardwareLines
  5. Calls ConfigurationService.SetConfiguration with multiple parameters including AAF rates and DSP settings
  6. Copies configuration files to the test directory via CopyGlobalConfigsToLocalFolder

ErrorCallback

Signature:

public static DialogResult ErrorCallback(string errorString, string units)

Behavior: Static callback method that logs configuration errors via APILogger.Log and returns DialogResult.OK. The units parameter is not used in the implementation.


CopyGlobalConfigsToLocalFolder (Private)

Signature:

private void CopyGlobalConfigsToLocalFolder(
    DataModel.TestTemplate currentTest,
    List<IDASCommunication> dasList)

Behavior: Copies DAS and module configuration XML files from the current directory's Constants.DAS_CONFIGS subfolder to the test directory. Creates the destination directory if it does not exist. Catches and logs exceptions without re-throwing.

3. Invariants

  • Thread Safety: All configuration operations within SetConfig are protected by a lock on DASHardware.GetArmStatusLock.
  • Voltage Threshold Ordering: The code does not explicitly validate that minimum thresholds are less than maximum thresholds.
  • Configuration File Naming: DAS config files are named {OwningDAS}.xml; module config files are named {SerialNumber}.xml.
  • Callback Completion: Both ResetHardwareLines and SetConfiguration operations block