14 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | ||||
|---|---|---|---|---|---|---|---|---|
|
2026-04-16T12:03:56.985206+00:00 | zai-org/GLM-5-FP8 | 1 | 02cf11f3a90b1f89 |
Documentation: DTS.Common.Constant
1. Purpose
This module provides a centralized collection of application-wide constants and configuration values for the DTS (Data Translation System) software. It defines hardware thresholds for digital inputs, sensor range limits and sample rates for embedded devices, graph display parameters, streaming configuration limits, clock synchronization profiles, recording mode definitions, NMEA parsing constants, and database version markers. These constants ensure consistent behavior across the system and serve as the single source of truth for hardware-specific magic numbers, validation boundaries, and default values.
2. Public Interface
DTS.Common.Constant.XamlConstants (partial class)
- Signature:
public partial class XamlConstants - Behavior: Empty partial class intended as code-behind for XAML resource definitions. No members defined in source.
DTS.Common.Constant.DigitalInputs (static class)
| Member | Signature | Description |
|---|---|---|
ConstantCurrentBreakPointDefault |
public const double |
Default breakpoint value (19005.0) for contact closure detection. "Magic number from CPB." |
VoltageInputBreakPointDefault |
public const double |
Default breakpoint value (19661.0) for voltage input modes THL and TLH (1.5V with sig- grounded). |
DisplaySPDADCDefault |
public const bool |
Default display setting for SLICE PRO Digital ADC (false). |
ConstantCurrentBreakPoint |
public static double { get; set; } |
Runtime value for constant current breakpoint. Initialized to ConstantCurrentBreakPointDefault. Does NOT query storage; relies on external initialization. |
VoltageInputBreakPoint |
public static double { get; set; } |
Runtime value for voltage input breakpoint. Initialized to VoltageInputBreakPointDefault. Does NOT query storage. |
DisplaySPDADC |
public static bool { get; set; } |
Runtime control for displaying SLICE Pro Digital analog ADC. Initialized to DisplaySPDADCDefault. Does NOT query storage. |
DTS.Common.Constant.EmbeddedSensors (static class)
Power Management / Wake Up:
| Member | Value | Description |
|---|---|---|
MotionDetectInactivitySMaximum |
300 | Maximum motion detect inactivity timeout (5 minutes). |
MagnetTimeoutMsMaximum |
300000 | Maximum magnet timeout in milliseconds (5 minutes). |
Device Trigger Ranges:
| Member | Value | Description |
|---|---|---|
EmbeddedLowGLinearAccelerometerRange |
8 | Low-G linear accelerometer range. |
EmbeddedHighGLinearAccelerometerRange |
400 | High-G linear accelerometer range. |
EmbeddedAngularAccelerometerRange |
2000 | Angular accelerometer range. |
EmbeddedAngularRateSensorRange |
2000 | Angular rate sensor range. |
HumidityMinimum / HumidityMaximum |
10 / 100 | Humidity valid range. |
PressureMinimum / PressureMaximum |
5 / 15 | Pressure valid range. |
TemperatureMinimum / TemperatureMaximum |
0 / 65 | Temperature valid range (°C). |
TimedIntervalEventDurationMsMinimum / Maximum |
30 / 300000 | Timed interval event duration range. |
TimedIntervalNumberOfEventsMaximum |
100 | Maximum number of timed interval events. |
IntervalBetweenEventStartsMinutesMaximum |
1440 | Maximum interval between event starts (24 hours). |
Sample Rate Limits (Hz):
| Sensor | Minimum | Maximum | Default |
|---|---|---|---|
| Low-G Linear Accelerometer | 1 | 6400 | 6400 |
| High-G Linear Accelerometer | 1 | 5120 | 5120 |
| Angular Accelerometer | 1 | 1600 | 1600 |
| Angular Accelerometer & Rate Sensor | 1 | 5120 | 5120 |
| Atmospheric Sensor | 1 | 157 | 157 |
DTS.Common.Constants (static class)
String Constants:
| Member | Value | Description |
|---|---|---|
ROI_TAG |
"ROI" | Region of interest tag. |
ALL_TAG |
"ALL" | All-encompassing tag. |
DAS_TEST_SETUPS |
"DASTestSetup" | DAS test setup identifier. |
USB |
"USB" | USB connection identifier. |
BACKUP_HEADER_EXTENSION |
".header.bak" | Backup header file extension. |
BACKUP_FILE_EXTENSION |
".bak" | Backup file extension. |
DAS_CONFIGS |
"DASConfigs" | DAS configuration directory name. |
TEMP_FILE_EXTENSION |
".tmp" | Temporary file extension. |
UDP_STREAM_CH10_TF2 |
"2HDR" | UDP streaming Chapter 10 tag. |
EventNumber |
"_Event Number" | Event number identifier. |
UseMeasuredExcitation |
"UseMeasuredExcitation" | Measured excitation flag. |
ManualsFolder |
"Manuals" | Manuals directory name. |
WindowsExplorer |
"explorer.exe" | Windows Explorer executable. |
NoValue |
"NOVALUE" | No-value placeholder. |
ISO_CH_ONLY_PREFIX |
"ISO_CH_ONLY" | ISO channel-only prefix. |
DUMMY_MOD_DESCRIP_S6DB |
"slice6db module" | Dummy module description. |
DUMMY_MOD_DESCRIP_POWERPRO |
"powerpro module" | Dummy module description. |
ISOTestInfo |
"_" | ISO test info marker. |
NMEA_GPRMC_HEADER |
"$GPRMC" | NMEA RMC sentence header. |
NMEA_GPGGA_HEADER |
"$GPGGA" | NMEA GGA sentence header. |
Graph & Display Constants:
| Member | Value | Description |
|---|---|---|
MINIMUM_VOLTAGE_INSERTION_RANGE_MV_SLICE |
10 | Minimum voltage insertion range for SLICE (mV). |
GRAPH_MIN_AUTOZOOM |
0.01D | Minimum auto-zoom as % of full scale (capacity). |
GRAPH_MAX_AUTOZOOM |
1.2D | Maximum auto-zoom as % of full scale (signal). |
MAX_VIEWER_POINTS |
45000000 | Maximum points for a Viewer graph. |
Runtime-Configurable Properties:
| Member | Default | Description |
|---|---|---|
CheckStatusLinesInRealtime |
true | Whether to check status lines during realtime polling. |
UpdateIntervalRealtimeCharts |
100 | Sleep time (ms) between chart updates. |
PING_ICMP_TIMEOUT |
500 | Max time (ms) to wait for individual ping attempt. |
Hardware & Streaming Constants:
| Member | Value | Description |
|---|---|---|
XML_HEADER_LENGTH |
8 | XML header length in bytes. |
XML_STORE_MAGIC_BYTES |
{0xAA, 0x55, 0xA5, 0x5A} |
Magic bytes for XML storage. |
FILE_STORE_DSP_FILTER_ID |
104 | DSP filter ID for file storage. |
DEVICE_STREAMING_ONLY |
1 | Device streaming-only flag. |
TDAS_TOM_DIGITAL_OUT_DURATION_MAX |
1600 | Maximum TDAS Tom digital out duration. |
BITS_PER_MINOR_FRAME_S6A |
128 | Bits per minor frame for SLICE6AIR. |
BITS_PER_MINOR_FRAME_TSRAIR |
320 | Bits per minor frame for TSR AIR. |
ADC_MIDPOINT |
32767 | ADC midpoint (16-bit DAC, 2^15 - 1). |
SLICE2_NO_AAF_REALTIME_RATE |
100000F | AAF realtime rate when disabled via config. |
UDP_STREAMPROFILES_MAX |
15 | Maximum UDP stream profiles. |
UART_MODE_MAX_SAMPLERATE |
30000 | Maximum sample rate in UART recording modes. |
SLICE6AIR_STREAMING_DIGITAL_FILTERING_MAX_SAMPLERATE |
10000 | Max sample rate for digital filtering. |
SLICE6AIR_STREAMING_DIGITAL_FILTERING_MAX_SAMPLERATE_20k |
20000 | Extended max sample rate for digital filtering. |
SLICE6AIR_20K_DIGITAL_FILTER_MIN_PROTOCOL |
46 | Minimum protocol version for 20k digital filter. |
MaxAAFilterRateHz |
200000 | Maximum AA filter rate. |
NANOS_PER_SECOND |
1000000000m | Nanoseconds per second. |
TEN_MILLIS_IN_SEC |
0.01D | Ten milliseconds in seconds. |
EXECUTABLE_TIMEOUT |
30000 | Wait timeout for 3rd party executables (ms). |
Clock Synchronization Profiles:
| Member | Type | Description |
|---|---|---|
MasterProfiles |
readonly ClockSyncProfile[] |
Valid clock master profile selections (14 profiles). |
SlaveProfiles |
readonly ClockSyncProfile[] |
Valid clock slave profile selections (4 profiles). |
OnePPSOutProfiles |
readonly ClockSyncProfile[] |
Profiles supporting 1PPS output (13 profiles). |
Recording Modes:
| Member | Type | Description |
|---|---|---|
NonStreamingRecordingModes |
readonly RecordingModes[] |
Non-streaming recording mode selections (15 modes). |
NMEA Parsing Constants:
| Member | Value | Description |
|---|---|---|
NMEA_GPRMC_TIME_POSN |
1 | Position of time in GPRMC sentence. |
NMEA_GPRMC_VALID_POSN |
2 | Position of validity flag in GPRMC. |
NMEA_GPRMC_LAT_POSN / LAT_LEN / LATD_POSN |
3 / 9 / 4 | Latitude position, length, and direction. |
NMEA_GPRMC_LONG_POSN / LONG_LEN / LONGD_POSN |
5 / 10 / 6 | Longitude position, length, and direction. |
NMEA_GPRMC_VELO_POSN / DIR_POSN / DATE_POSN |
7 / 8 / 9 | Velocity, direction, and date positions. |
NMEA_GPGGA_TIME_POSN / VALID_POSN / ALT_POSN / ALTU_POSN |
1 / 6 / 9 / 10 | GPGGA time, validity, altitude, and altitude unit positions. |
Database Version Markers:
| Member | Value | Description |
|---|---|---|
ROITables_DB_VERSION |
92 | ROI tables feature version. |
EnableRepeat_DB_VERSION |
92 | Enable repeat feature version. |
IgnoreShorted_DB_VERSION |
92 | Ignore shorted feature version. |
ONEPPS_OUT_DB_VERSION |
92 | 1PPS out feature version. |
UNIX_EPOCH_TIME |
93 | Unix epoch time feature version. |
TMATS_INTERVAL_VERSION |
93 | TMATS interval UI support version. |
ALLOWED_DOWNLOAD_FILE_LENGTH |
260 | Maximum Windows file name length. |
ALLOWED_DOWNLOAD_DIRECTORY_LENGTH |
248 | Maximum Windows directory name length. |
ADC_TO_UART_DB_VERSION |
93 | ADC to UART feature version. |
SLICE6AIR_BR_DB_VERSION |
95 | SLICE6AIR BR feature version. |
PTP_DOMAIN_ID_DB_VERSION |
95 | PTP domain ID feature version. |
BULK_GROUPCHANNELSETTINGS_GET_DB_VERSION |
95 | Bulk group channel settings version. |
MULTIPLE_EVENT_UART_DB_VERSION |
96 | Multiple-event UART support version. |
RECORD_ON_BOOT_VERSION |
96 | Record on boot feature version. |
Other:
| Member | Type | Description |
|---|---|---|
ExportNameFilters |
readonly Dictionary<string, string> |
Name sanitization for exports (maps "(Voltage)" → "Voltage", "(Current)" → "Current"). |
PSD_DEFAULT_MAX_POW10 / MIN_POW10 |
0 / -12 | PSD default power-of-10 bounds. |
3. Invariants
-
Digital Input Breakpoints:
ConstantCurrentBreakPointandVoltageInputBreakPointmust be set externally before use; they do not auto-initialize from persistent storage. -
Sample Rate Defaults: All default sample rates in
EmbeddedSensorsare set to their respective maximum values. -
Clock Sync Profile Arrays:
MasterProfiles,SlaveProfiles, andOnePPSOutProfilesarereadonlyand cannot be modified at runtime. -
Database Version Ordering: Version numbers are monotonically increasing (92 → 93 → 95 → 96). Note: Version 94 is not present in the defined constants.
-
NMEA Position Indices: Position constants are 1-indexed (based on NMEA sentence structure), not 0-indexed.
-
ADC Midpoint: Fixed at 32767 (2^15 - 1) for 16-bit DACs; this is a hardware constraint.
-
Windows Path Limits:
ALLOWED_DOWNLOAD_FILE_LENGTH(260) andALLOWED_DOWNLOAD_DIRECTORY_LENGTH(248) reflect Windows API limitations.
4. Dependencies
This module depends on:
DTS.Common.Enums— forClockSyncProfileandRecordingModesenum types (imported inConstants.cs)
What depends on this module:
- Unclear from source alone. Given the central nature of these constants, likely consumed by:
- Device communication/hardware abstraction layers
- Data acquisition and streaming components
- UI components (graph rendering, configuration dialogs)
- Export/import functionality
- Database migration logic
5. Gotchas
-
Static Properties Without Storage Persistence: The properties
ConstantCurrentBreakPoint,VoltageInputBreakPoint, andDisplaySPDADCinDigitalInputsare explicitly documented as NOT querying values from storage. They rely on being set separately, which could lead to uninitialized or stale values if the initialization sequence is not properly managed. -
Magic Numbers Without Clear Origin:
ConstantCurrentBreakPointDefault(19005) is documented as a "magic number from CPB" with no explanation of its derivation. The voltage breakpoint (19661) corresponds to "1.5V with sig- grounded" but the conversion formula is not documented. -
Commented-Out Clock Sync Profiles: Several profiles in
MasterProfiles,SlaveProfiles, andOnePPSOutProfilesare commented out with notes like "Combinations that are possible in UI, but no device supports." This suggests potential UI/backend mismatch if these values are used elsewhere. -
Missing Database Version 94: The version constants jump from 93 to 95 with no version 94 defined. The significance of this gap is unclear from source.
-
Hardcoded Internal URLs: Comments reference internal URLs (e.g.,
http://manuscript.dts.local/f/cases/...) which may be inaccessible outside the development environment. -
Mixed Naming Conventions: Some constants use SCREAMING_SNAKE_CASE (e.g.,
ROI_TAG), others use PascalCase (e.g.,NanosecondsPerSecondwould be expected, but actual isNANOS_PER_SECOND). This inconsistency may cause confusion. -
Graph Auto-Zoom Units:
GRAPH_MIN_AUTOZOOMandGRAPH_MAX_AUTOZOOMhave different semantic bases—one references "capacity" full scale, the other "signal" full scale. The distinction is subtle and could lead to misuse.