12 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | ||||
|---|---|---|---|---|---|---|---|---|
|
2026-04-16T02:55:10.398143+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | b24dcc791db74827 |
Documentation: DTS.Common.Constant Namespace
1. Purpose
This module centralizes application-wide constants used across the DTS (Data Acquisition and Test System) platform. It consolidates magic numbers, default values, validation ranges, and configuration flags related to digital inputs, embedded sensors, and general system behavior. The constants are used to ensure consistency in thresholds, UI behavior, data processing, and hardware configuration across multiple components (e.g., SLICE, TSR AIR, DIM, embedded firmware interfaces). By isolating these values, the module reduces duplication, improves maintainability, and clarifies the source of truth for critical operational parameters.
2. Public Interface
DTS.Common.Constant.DigitalInputs
-
public const double ConstantCurrentBreakPointDefault = 19005D;
Default threshold (in ADC units) for detecting contact closure transitions. A transition across this value flips the digital input bit. -
public const double VoltageInputBreakPointDefault = 19661D;
Default threshold (in ADC units) for voltage input mode (used for THL/TLH digital modes), where a transition across this value flips the digital input bit. -
public const bool DisplaySPDADCDefault = false;
Default value controlling whether the SLICE PRO Digital ADC is displayed in the UI. -
public static double ConstantCurrentBreakPoint { get; set; } = ConstantCurrentBreakPointDefault;
Runtime-configurable threshold for contact closure detection. Does not persist or query storage—value must be set externally. -
public static double VoltageInputBreakPoint { get; set; } = VoltageInputBreakPointDefault;
Runtime-configurable threshold for voltage input detection. Does not persist or query storage—value must be set externally. -
public static bool DisplaySPDADC { get; set; } = DisplaySPDADCDefault;
Runtime-configurable flag for SLICE PRO Digital ADC visibility. Does not persist or query storage—value must be set externally.
DTS.Common.Constant.EmbeddedSensors
Contains constants for embedded sensor specifications, sample rates, CAN/UART configuration, and file format options. All values are const or static readonly.
-
Timeouts & Limits
MotionDetectInactivitySMaximum = 300(5 minutes)MagnetTimeoutMsMaximum = 300000(5 minutes)TimedIntervalEventDurationMsMinimum = 30TimedIntervalEventDurationMsMaximum = 300000(5 minutes)TimedIntervalNumberOfEventsMaximum = 100IntervalBetweenEventStartsMinutesMaximum = 1440(24 hours)
-
Sensor Ranges
EmbeddedLowGLinearAccelerometerRange = 8EmbeddedHighGLinearAccelerometerRange = 400EmbeddedAngularAccelerometerRange = 2000EmbeddedAngularRateSensorRange = 2000HumidityMinimum = 10,HumidityMaximum = 100PressureMinimum = 5,PressureMaximum = 15TemperatureMinimum = 0,TemperatureMaximum = 65
-
Sample Rates
EmbeddedLowGLinearAccelerometerSampleRateMinimum/Maximum = 1/6400EmbeddedHighGLinearAccelerometerSampleRateMinimum/Maximum = 1/5120EmbeddedAngularAccelerometerSampleRateMinimum/Maximum = 1/1600EmbeddedAngularAccelerometerAndRateSensorSampleRateMinimum/Maximum = 1/5120EmbeddedAtmosphericSensorSampleRateMinimum/Maximum = 1/157- Default sample rates (e.g.,
DefaultEmbeddedLowGLinearAccelerometerSampleRate = 6400)
-
UART & CAN Configuration
BAUD_RATE_MIN = 96,BAUD_RATE_DEFAULT = 57600,BAUD_RATE_MAX = 921600BAUD_RATES(array of supported rates)CANISFD_DEFAULT = true- CAN FD arbitration/base bitrate ranges and defaults (
CANFD_ARB_BASE_BITRATE_*,NON_CANFD_ARB_BASE_BITRATE_*) - CAN FD/non-CAN FD SJW values (e.g.,
CANFD_500000_ARB_BASE_SJW_DEFAULT = 8,CANFD_1000000_ARBBASESJW_VALUES) - Data bitrate (
DATA_BITRATE_DEFAULT = 4000000,DATABITRATE_VALUES) - Data SJW arrays (e.g.,
NON_CANFD_500000_DATASJW_VALUES) FILETYPE_DEFAULT = "asc",FILETYPE_VALUES = { "asc", "blf" }
DTS.Common.Constant.Constants
Contains broad system constants, many tied to specific hardware (SLICE6AIR, TSR AIR), UI behavior, file formats, and protocol details.
-
Timeouts & Intervals
GETARMSTATUS_TIMEOUT = 30000PING_ICMP_TIMEOUT { get; set; } = 500EXECUTABLE_TIMEOUT = 30000UpdateIntervalRealtimeCharts { get; set; } = 100
-
Graphing & Autozoom
GRAPH_MIN_AUTOZOOM = 0.01D(1% of full scale)GRAPH_MAX_AUTOZOOM = 1.2D(120% of full scale)CheckStatusLinesInRealtime { get; set; } = true
-
Units & Tags
ACCELERATION_UNITS = { "g", "msec", "m/sec", "m/sec^2", "m/s^2" }ROI_TAG = "ROI",ALL_TAG = "ALL",ALL = "ALL"DAS_TEST_SETUPS = "DASTestSetup",DAS_CONFIGS = "DASConfigs"
-
File & Data Handling
BACKUP_HEADER_EXTENSION = ".header.bak",BACKUP_FILE_EXTENSION = ".bak"TEMP_FILE_EXTENSION = ".tmp",CHANNEL_FILE_EXTENSION = ".chn",BINARY_FILE_EXTENSION = ".bin"REPORT_DIR_NAME = "Reports",REPORT_TEMPLATE_DIR_NAME = "ReportTemplates"BINARY = "Binary",CURRENT_SUFFIX = "_CU"MAX_USER_CHANNEL_NAME_LENGTH = 100ALLOWED_DOWNLOAD_FILE_LENGTH = 260,ALLOWED_DOWNLOAD_DIRECTORY_LENGTH = 248UNUSED_START_TIME = 0,UNUSED_DATA_COLLECTION_LENGTH = 0
-
Hardware & Protocol
BITS_PER_MINOR_FRAME_S6A = 128BITS_PER_MINOR_FRAME_TSRAIR = 320ADC_MIDPOINT = 32767(16-bit midpoint)UDP_STREAMPROFILES_MAX = 15UART_MODE_MAX_SAMPLERATE = 30000SLICE6AIR_STREAMING_DIGITAL_FILTERING_MAX_SAMPLERATE = 10000SLICE6AIR_STREAMING_DIGITAL_FILTERING_MAX_SAMPLERATE_20k = 20000SLICE6AIR_20K_DIGITAL_FILTER_MIN_PROTOCOL = 46SLICE6AIR_BR_DB_VERSION = 95,SLICE_PRO_CAN_FD_DB_VERSION = 100, etc.
-
Clock Sync & Recording Modes
MasterProfiles,SlaveProfiles,OnePPSOutProfiles(arrays ofClockSyncProfile)NonStreamingRecordingModes(array ofRecordingModes)
-
NMEA Parsing
$GPRMCand$GPGGAfield positions (e.g.,NMEA_GPRMC_LAT_POSN = 3,NMEA_GPGGA_ALT_POSN = 9)
-
UI & Formatting
TABANDPAGEBUTTONSFontSizeMin = 12,TabAndPageButtonsFontSizeMax = 32MINIMUM_VOLTAGE_INSERTION_RANGE_MV_SLICE = 10SENSITIVITY_CHANGE_TOLERANCE_PERCENT_DEFAULT = 5DNOVALUE = "NOVALUE"ISO_CH_ONLY_PREFIX = "__ISO_CH_ONLY__"ExportNameFilters = { "(Voltage)" → "Voltage", "(Current)" → "Current" }
-
Special Values
NANOS_PER_SECOND = 1000000000m,TEN_MILLIS_IN_SEC = 0.01DMAX_VIEWER_POINTS = 45000000LOWEST_NONZERO_TSR_AIR_PRETRIGGER_SECONDS = 0.0128D
-
Properties with Dynamic Errors
ScheduleStartTimeError: Formatted error string usingStringResources.EditTestSetupPage_ScheduleMustBeInFutureandDFConstantsAndEnums.SCHEDULE_AHEAD_IN_MINUTES.IntervalError: Formatted error string usingStringResources.EditTestSetupPage_EventLengthTooLongandDFConstantsAndEnums.TIME_TO_REARM_SECONDS.
DTS.Common.Constant.XamlConstants
public partial class XamlConstants { }
Currently an empty partial class. No public members defined.
3. Invariants
-
Digital Input Thresholds:
ConstantCurrentBreakPointandVoltageInputBreakPointare not persisted or auto-loaded; they rely on external initialization (e.g., from config or UI settings).ConstantCurrentBreakPointDefault(19005) is used for contact closure;VoltageInputBreakPointDefault(19661) is used for THL/TLH voltage modes.
-
Embedded Sensor Ranges:
- All minimum/maximum values for sensors (e.g., humidity, temperature, sample rates) are hard limits derived from device IC specifications.
- Default sample rates are set to the maximum supported rate per sensor type.
-
CAN Configuration:
CANISFD_DEFAULT = trueimplies CAN FD is enabled by default.- SJW (Sample Jump Width) arrays are strictly bounded by hardware constraints for specific bitrates.
-
Graph Autozoom:
GRAPH_MIN_AUTOZOOM = 0.01andGRAPH_MAX_AUTOZOOM = 1.2define the scaling envelope for auto-zoomed graphs (as % of full scale), regardless of signal amplitude.
-
Download Paths:
- File paths must not exceed
ALLOWED_DOWNLOAD_FILE_LENGTH = 260characters (Windows MAX_PATH), and directories must not exceedALLOWED_DOWNLOAD_DIRECTORY_LENGTH = 248.
- File paths must not exceed
-
Clock Sync Profiles:
MasterProfiles,SlaveProfiles, andOnePPSOutProfilesare exhaustive and exclude unsupported combinations (commented-out values indicate deprecated/invalid options).
4. Dependencies
Imports/References (from source):
DTS.Common.Constantdepends on:DTS.Common.Enums(forClockSyncProfile,RecordingModes)DTS.Common.SharedResource.Strings(forStringResourcesinConstants)
Referenced By:
DTS.Common.Constantis used throughout the codebase for:- Hardware configuration (e.g., embedded sensor setup, CAN/UART initialization)
- UI validation (e.g., thresholds, timeouts, sample rate limits)
- Data export (NMEA, file formats, path length checks)
- Graphing logic (autozoom, units, tags)
- Protocol-specific constants (e.g.,
BITS_PER_MINOR_FRAME_*,SLICE6AIR_*)
5. Gotchas
-
Static Properties Are Not Persistent:
DigitalInputs.ConstantCurrentBreakPoint,VoltageInputBreakPoint, andDisplaySPDADCare mutable static properties. They do not read from configuration storage—consumers must explicitly set them (e.g., from a config file or UI). -
XamlConstantsIs Empty:
TheXamlConstantsclass is declared but contains no members. Its purpose is unclear from the source alone. -
ScheduleStartTimeErrorandIntervalErrorAre Dynamically Formatted:
These properties usestring.Formatwith external resources (StringResources) and enums (DFConstantsAndEnums). Their values depend on runtime localization and enum definitions not visible here. -
CAN FD vs. Non-CAN FD Bitrate Arrays:
CANFD_ARBBASEBITRATE_VALUESandNON_CANFD_ARBBASEBITRATE_VALUESare not contiguous ranges (e.g.,NON_CANFD_ARBBASEBITRATE_VALUESincludes non-standard rates like62000,83000). Consumers must use the arrays, not assume min/max. -
Sample Rate Limits Are Protocol-Dependent:
SLICE6AIR_STREAMING_DIGITAL_FILTERING_MAX_SAMPLERATE = 10000applies to older firmware, whileSLICE6AIR_20K_DIGITAL_FILTER_MIN_PROTOCOL = 46andSLICE6AIR_STREAMING_DIGITAL_FILTERING_MAX_SAMPLERATE_20k = 20000indicate newer firmware relaxes this limit. -
ALLvs.ALL_TAG:
BothALL = "ALL"andALL_TAG = "ALL"exist. Their usage context is unclear—ensure consistency with downstream consumers. -
UNUSED_START_TIMEandUNUSED_DATA_COLLECTION_LENGTH:
Both are0, but their semantic meaning ("unused") may conflict with valid data (e.g.,0-length recordings). Validation logic must distinguish intent. -
NANOS_PER_SECONDIs Decimal:
Used for high-precision time calculations (e.g.,TEN_MILLIS_IN_SEC = 0.01D). Mixingdoubleanddecimalcould cause precision issues if not handled carefully. -
MAX_VIEWER_POINTS = 45000000:
This is a hard limit for Viewer graphs. Exceeding it may cause crashes or performance degradation—consumers must enforce truncation or sampling.