3.4 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |||||
|---|---|---|---|---|---|---|---|---|---|
|
2026-04-16T11:33:05.077220+00:00 | zai-org/GLM-5-FP8 | 1 | 6d6fac19105f4e74 |
DTS.Common.Tests
Documentation: DTS.Common Module
1. Purpose
The DTS.Common module provides core utility classes and data structures for handling sensor configuration, signal processing, and network communication within the DTS system. It centralizes logic for parsing sensor identifiers, linearizing raw sensor data using polynomial formulas, managing software filter channel configurations (ISO codes), and parsing network connection strings. This module serves as the foundational layer for sensor data interpretation and device connectivity.
2. Public Interface
Class: DTS.Common.Classes.Sensors.ChannelTypeUtility
A utility class for parsing sensor naming conventions.
string ParseSensorKnownChannelType(string sensorName)- Extracts a known channel type prefix from a sensor name string.
- Returns the string representation of the
KnownChannelTypesenum if the prefix is valid. - Returns
string.Emptyif the input isnull, empty, has fewer than 2 characters, or if the 2-character prefix is not defined inKnownChannelTypes.
Class: DTS.Common.Utils.NetworkUtils
A utility class for network-related string parsing.
bool TryParseConnectionString(string connectionString, out string ipAddress)- Attempts to extract an IP address from a connection string.
- Returns
trueand populatesipAddress(excluding port) if a valid IP is found. - Returns
falseif the connection string isnullor does not contain a parseable IP address (e.g., a USB device path). - Supports formats:
IP,IP:Port,protocol://IP:Port(e.g.,http,udp).
Class: DTS.Common.Classes.Sensors.LinearizationFormula
Handles the conversion of raw sensor values to Engineering Units (EU).
double[] PolynomialCoefficients(Property)- An array of doubles representing the coefficients for the linearization polynomial.
NonLinearStyles NonLinearStyle(Property)- Specifies the style of non-linear calculation. Defaults to
NonLinearStyles.Polynomial.
- Specifies the style of non-linear calculation. Defaults to
double GetLinearizedValue(double input, int decimalPlaces, bool? proportional)- Calculates the linearized value based on the
PolynomialCoefficients. input: The raw sensor value.decimalPlaces: Precision of the result (inferred from test context).proportional: A nullable boolean flag affecting the calculation logic. Whennullortrue, the calculation differs from when it isfalse.
- Calculates the linearized value based on the
Class: DTS.Common.Classes.Sensors.FilterClass
Represents a software filter configuration and provides mapping logic between ISO codes, frequencies, and filter class types.
FilterClassType FClass(Property)- The type of the filter (e.g.,
CFC1000,AdHoc).
- The type of the filter (e.g.,
double Frequency(Property)- The frequency associated with the filter class.
static FilterClass GetFilterClassFromString(string input)- Parses a string (e.g., "CFC 1000", "600", "1700Hz", "None") into a
FilterClassobject. - Returns
- Parses a string (e.g., "CFC 1000", "600", "1700Hz", "None") into a