210 lines
7.7 KiB
Markdown
210 lines
7.7 KiB
Markdown
|
|
---
|
||
|
|
source_files:
|
||
|
|
- Common/DTS.Common/Constant/XamlConstants.xaml.cs
|
||
|
|
- Common/DTS.Common/Constant/DigitalInputs.cs
|
||
|
|
- Common/DTS.Common/Constant/EmbeddedSensors.cs
|
||
|
|
- Common/DTS.Common/Constant/Constants.cs
|
||
|
|
generated_at: "2026-04-17T15:38:05.950870+00:00"
|
||
|
|
model: "zai-org/GLM-5-FP8"
|
||
|
|
schema_version: 1
|
||
|
|
sha256: "fa6c5368d806d741"
|
||
|
|
---
|
||
|
|
|
||
|
|
# Documentation: DTS.Common.Constant Namespace
|
||
|
|
|
||
|
|
## 1. Purpose
|
||
|
|
|
||
|
|
This module provides a centralized collection of constant values, configuration defaults, and runtime-adjustable parameters for the DTS (Data Translation System) application. It encompasses hardware-specific thresholds for digital inputs, embedded sensor operational ranges and sample rates, CAN/CAN-FD communication parameters, and miscellaneous system-wide constants including database version markers, file extensions, clock synchronization profiles, and UI configuration values. The module serves as the single source of truth for magic numbers, hardware limits, and default settings used throughout the system.
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## 2. Public Interface
|
||
|
|
|
||
|
|
### Class: `XamlConstants` (partial)
|
||
|
|
**File:** `XamlConstants.xaml.cs`
|
||
|
|
**Namespace:** `DTS.Common.Constant`
|
||
|
|
|
||
|
|
```
|
||
|
|
public partial class XamlConstants
|
||
|
|
```
|
||
|
|
|
||
|
|
An empty partial class. The XAML counterpart and actual constants are not visible in the provided source.
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
### Class: `DigitalInputs` (static)
|
||
|
|
**File:** `DigitalInputs.cs`
|
||
|
|
**Namespace:** `DTS.Common.Constant`
|
||
|
|
|
||
|
|
**Constants:**
|
||
|
|
```
|
||
|
|
public const double ConstantCurrentBreakPointDefault = 19005D;
|
||
|
|
public const double VoltageInputBreakPointDefault = 19661D;
|
||
|
|
public const bool DisplaySPDADCDefault = false;
|
||
|
|
```
|
||
|
|
|
||
|
|
**Static Properties:**
|
||
|
|
```
|
||
|
|
public static double ConstantCurrentBreakPoint { get; set; } // Default: 19005D
|
||
|
|
public static double VoltageInputBreakPoint { get; set; } // Default: 19661D
|
||
|
|
public static bool DisplaySPDADC { get; set; } // Default: false
|
||
|
|
```
|
||
|
|
|
||
|
|
- `ConstantCurrentBreakPoint` / `ConstantCurrentBreakPointDefault`: Threshold for contact closure detection (value 19005).
|
||
|
|
- `VoltageInputBreakPoint` / `VoltageInputBreakPointDefault`: Threshold for voltage input modes THL and TLH (value 19661, approximately 1.5V with signal grounded).
|
||
|
|
- `DisplaySPDADC` / `DisplaySPDADCDefault`: Controls visibility of SLICE Pro Digital analog ADC display.
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
### Class: `EmbeddedSensors` (static)
|
||
|
|
**File:** `EmbeddedSensors.cs`
|
||
|
|
**Namespace:** `DTS.Common.Constant`
|
||
|
|
|
||
|
|
**Power Management Constants:**
|
||
|
|
```
|
||
|
|
public const int MotionDetectInactivitySMaximum = 300; // 5 minutes
|
||
|
|
public const int MagnetTimeoutMsMaximum = 300000; // 5 minutes
|
||
|
|
```
|
||
|
|
|
||
|
|
**Sensor Range Constants:**
|
||
|
|
```
|
||
|
|
public const double EmbeddedLowGLinearAccelerometerRange = 8;
|
||
|
|
public const double EmbeddedHighGLinearAccelerometerRange = 400;
|
||
|
|
public const double EmbeddedAngularAccelerometerRange = 2000;
|
||
|
|
public const double EmbeddedAngularRateSensorRange = 2000;
|
||
|
|
public const double HumidityMinimum = 10;
|
||
|
|
public const double HumidityMaximum = 100;
|
||
|
|
public const double PressureMinimum = 5;
|
||
|
|
public const double PressureMaximum = 15;
|
||
|
|
public const double TemperatureMinimum = 0;
|
||
|
|
public const double TemperatureMaximum = 65;
|
||
|
|
```
|
||
|
|
|
||
|
|
**Timed Event Constants:**
|
||
|
|
```
|
||
|
|
public const double TimedIntervalEventDurationMsMinimum = 30;
|
||
|
|
public const double TimedIntervalEventDurationMsMaximum = 300000; // 5 minutes
|
||
|
|
public const double TimedIntervalNumberOfEventsMaximum = 100;
|
||
|
|
public const int IntervalBetweenEventStartsMinutesMaximum = 1440; // 24 hours
|
||
|
|
```
|
||
|
|
|
||
|
|
**Sample Rate Constants (Min/Max/Default):**
|
||
|
|
```
|
||
|
|
// Low-G Linear Accelerometer
|
||
|
|
public const double EmbeddedLowGLinearAccelerometerSampleRateMinimum = 1;
|
||
|
|
public const double EmbeddedLowGLinearAccelerometerSampleRateMaximum = 6400;
|
||
|
|
public const int DefaultEmbeddedLowGLinearAccelerometerSampleRate = 6400;
|
||
|
|
|
||
|
|
// High-G Linear Accelerometer
|
||
|
|
public const double EmbeddedHighGLinearAccelerometerSampleRateMinimum = 1;
|
||
|
|
public const double EmbeddedHighGLinearAccelerometerSampleRateMaximum = 5120;
|
||
|
|
public const int DefaultEmbeddedHighGLinearAccelerometerSampleRate = 5120;
|
||
|
|
|
||
|
|
// Angular Accelerometer
|
||
|
|
public const double EmbeddedAngularAccelerometerSampleRateMinimum = 1;
|
||
|
|
public const double EmbeddedAngularAccelerometerSampleRateMaximum = 1600;
|
||
|
|
public const int DefaultEmbeddedAngularAccelerometerSampleRate = 1600;
|
||
|
|
|
||
|
|
// Angular Accelerometer and Rate Sensor
|
||
|
|
public const double EmbeddedAngularAccelerometerAndRateSensorSampleRateMinimum = 1;
|
||
|
|
public const double EmbeddedAngularAccelerometerAndRateSensorSampleRateMaximum = 5120;
|
||
|
|
public const int DefaultEmbeddedAngularAccelerometerAndRateSensorSampleRate = 5120;
|
||
|
|
|
||
|
|
// Atmospheric Sensor
|
||
|
|
public const double EmbeddedAtmosphericSensorSampleRateMinimum = 1;
|
||
|
|
public const double EmbeddedAtmosphericSensorSampleRateMaximum = 157;
|
||
|
|
public const int DefaultEmbeddedAtmosphericSensorSampleRate = 157;
|
||
|
|
```
|
||
|
|
|
||
|
|
**Baud Rate Constants:**
|
||
|
|
```
|
||
|
|
public const uint BAUD_RATE_MIN = 96;
|
||
|
|
public const uint BAUD_RATE_DEFAULT = 57600;
|
||
|
|
public const uint BAUD_RATE_MAX = 921600;
|
||
|
|
public static readonly uint[] BAUD_RATES = { 300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 614400, 806400, 921600 };
|
||
|
|
```
|
||
|
|
|
||
|
|
**CAN/CAN-FD Constants:**
|
||
|
|
```
|
||
|
|
public const bool CANISFD_DEFAULT = true;
|
||
|
|
|
||
|
|
// Arbitration/Base Bitrate
|
||
|
|
public const int CANFD_ARB_BASE_BITRATE_MIN = 500000;
|
||
|
|
public const int CANFD_ARB_BASE_BITRATE_MAX = 1000000;
|
||
|
|
public const int CANFD_ARB_BASE_BITRATE_DEFAULT = 1000000;
|
||
|
|
public static readonly int[] CANFD_ARBBASEBITRATE_VALUES = { 500000, 1000000 };
|
||
|
|
|
||
|
|
public const int NON_CANFD_ARB_BASE_BITRATE_MIN = 50000;
|
||
|
|
public const int NON_CANFD_ARB_BASE_BITRATE_MAX = 500000;
|
||
|
|
public const int NON_CANFD_ARB_BASE_BITRATE_DEFAULT = 500000;
|
||
|
|
public static readonly int[] NON_CANFD_ARBBASEBITRATE_VALUES = { 50000, 62000, 83000, 100000, 125000, 250000, 500000 };
|
||
|
|
|
||
|
|
// Data Bitrate
|
||
|
|
public const int DATA_BITRATE_DEFAULT = 4000000;
|
||
|
|
public static readonly int[] DATABITRATE_VALUES = { 500000, 1000000, 2000000, 4000000, 8000000 };
|
||
|
|
|
||
|
|
// SJW (Synchronization Jump Width) values for various configurations
|
||
|
|
public const int DATA_SJW_DEFAULT = 2;
|
||
|
|
public const int DATA_SJW_MIN = 1;
|
||
|
|
// Multiple SJW arrays for different bitrate configurations (see source for full list)
|
||
|
|
```
|
||
|
|
|
||
|
|
**Filetype Constants:**
|
||
|
|
```
|
||
|
|
public const string FILETYPE_DEFAULT = "asc";
|
||
|
|
public static readonly string[] FILETYPE_VALUES = { "asc", "blf" };
|
||
|
|
```
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
### Class: `Constants` (static)
|
||
|
|
**File:** `Constants.cs`
|
||
|
|
**Namespace:** `DTS.Common`
|
||
|
|
|
||
|
|
**Timeout Constants:**
|
||
|
|
```
|
||
|
|
public const int GETARMSTATUS_TIMEOUT = 30000;
|
||
|
|
public const int EXECUTABLE_TIMEOUT = 30000;
|
||
|
|
public static int PING_ICMP_TIMEOUT { get; set; } = 500;
|
||
|
|
```
|
||
|
|
|
||
|
|
**Graph Auto-Zoom Constants:**
|
||
|
|
```
|
||
|
|
public const double GRAPH_MIN_AUTOZOOM = 0.01D; // 1% of full scale
|
||
|
|
public const double GRAPH_MAX_AUTOZOOM = 1.2D; // 120% of signal
|
||
|
|
```
|
||
|
|
|
||
|
|
**Runtime-Adjustable Properties:**
|
||
|
|
```
|
||
|
|
public static bool CheckStatusLinesInRealtime { get; set; } = true;
|
||
|
|
public static int UpdateIntervalRealtimeCharts { get; set; } = 100;
|
||
|
|
```
|
||
|
|
|
||
|
|
**File Extension Constants:**
|
||
|
|
```
|
||
|
|
public const string BACKUP_HEADER_EXTENSION = ".header.bak";
|
||
|
|
public const string BACKUP_FILE_EXTENSION = ".bak";
|
||
|
|
public const string TEMP_FILE_EXTENSION = ".tmp";
|
||
|
|
public const string CHANNEL_FILE_EXTENSION = ".chn";
|
||
|
|
public const string BINARY_FILE_EXTENSION = ".bin";
|
||
|
|
```
|
||
|
|
|
||
|
|
**Directory/Path Constants:**
|
||
|
|
```
|
||
|
|
public const string DAS_TEST_SETUPS = "DASTestSetup";
|
||
|
|
public const string DAS_CONFIGS = "DASConfigs";
|
||
|
|
public const string REPORT_DIR_NAME = "Reports";
|
||
|
|
public const string REPORT_TEMPLATE_DIR_NAME = "ReportTemplates";
|
||
|
|
public const string ManualsFolder = "Manuals";
|
||
|
|
```
|
||
|
|
|
||
|
|
**Database Version Constants:**
|
||
|
|
```
|
||
|
|
public const int TRACK_ANALOG_DIAGNOSTICS_DB_VERSION = 98;
|
||
|
|
public const int ALIGNUDPTOPPS_DB_VERSION = 98;
|
||
|
|
public const int ROITables_DB_VERSION = 92;
|
||
|
|
public const int EnableRepeat_DB_VERSION = 92;
|
||
|
|
public const int IgnoreShorted_DB_VERSION = 92;
|
||
|
|
public const int ONEPPS_OUT_DB_VERSION = 92;
|
||
|
|
public const int UNIX_EPOCH_TIME = 93;
|
||
|
|
public
|