using System.Collections.Generic;
using DTS.Common.Enums;
using DTS.Common.Enums.DASFactory;
using DTS.Common.SharedResource.Strings;
namespace DTS.Common
{
public static class Constants
{
public const int GETARMSTATUS_TIMEOUT = 30000;
public static readonly string[] ACCELERATION_UNITS = new[] { "g", "msec", "m/sec", "m/sec^2", "m/s^2" };
public const string ROI_TAG = "ROI";
public const string ALL_TAG = "ALL";
public const string DAS_TEST_SETUPS = "DASTestSetup";
public const int MINIMUM_VOLTAGE_INSERTION_RANGE_MV_SLICE = 10;
///
/// Senstivity change tolerance percent default value
///
public const double SENSITIVITY_CHANGE_TOLERANCE_PERCENT_DEFAULT = 5D;
///
/// The max zoom to apply to a graph if the data in the graph does not meet the zoom ranges. This is specified as % full scale
/// (of capacity)
/// so for 2400 EU if the graph is a flat line the max over or under of the plot would be 24 units.
/// http://manuscript.dts.local/f/cases/29416/Limit-view-of-TSR-AIR-data-to-2-of-full-scale-in-auto-range-mode
/// these variables already existed, I just abstracted them to a common spot from two disparate spots
///
public const double GRAPH_MIN_AUTOZOOM = 0.01D;
///
/// The max zoom to apply to a graph. This is specified as % full scale (of signal)
/// http://manuscript.dts.local/f/cases/29416/Limit-view-of-TSR-AIR-data-to-2-of-full-scale-in-auto-range-mode
/// these variables already existed, I just abstracted them to a common spot from two disparate spots
///
public const double GRAPH_MAX_AUTOZOOM = 1.2D;
///
/// whether to check status line while doing realtime polling
/// http://manuscript.dts.local/f/cases/27067/
///
public static bool CheckStatusLinesInRealtime { get; set; } = true;
///
/// sleep time between chart updates
/// http://manuscript.dts.local/f/cases/27067/
///
public static int UpdateIntervalRealtimeCharts { get; set; } = 100;
public const string USB = "USB";
public const string BACKUP_HEADER_EXTENSION = ".header.bak";
public const string BACKUP_FILE_EXTENSION = ".bak";
public const string DAS_CONFIGS = "DASConfigs";
public const double UNUSED_START_TIME = 0;
public const int UNUSED_DATA_COLLECTION_LENGTH = 0;
public const int MAX_USER_CHANNEL_NAME_LENGTH = 100;
public const string REPORT_DIR_NAME = "Reports";
public const string REPORT_TEMPLATE_DIR_NAME = "ReportTemplates";
public const string TEMP_FILE_EXTENSION = ".tmp";
public const string UDP_STREAM_CH10_TF2 = "2HDR";
public const string EventNumber = "_Event Number";
public const string CHANNEL_FILE_EXTENSION = ".chn";
public const string BINARY_FILE_EXTENSION = ".bin";
public const string BINARY = "Binary";
public const string ALL = "ALL";
public const string CURRENT_SUFFIX = "_CU";
public const string MESSAGEBOXBUTTON_OK = "MessageBoxButton_OK";
///
/// This is the string _ROI_PERIOD - I'm using it when calculating extra space that might be needed
/// for downloading when you have multiple ROI
///
public const string ROI_PERIOD = "_ROI Period";
public const string UseMeasuredExcitation = "UseMeasuredExcitation";
public const int TRACK_ANALOG_DIAGNOSTICS_DB_VERSION = 98;
// http://manuscript.dts.local/f/cases/39470/Add-UI-for-configurable-option-to-allow-UDP-aligning-to-PPS
public const int ALIGNUDPTOPPS_DB_VERSION = 98;
public const string TrackAnalogDiagnostics = "TrackAnalogDiagnostics";
public const string SensorAssembly = "SensorAssembly";
public const string ManualsFolder = "Manuals";
public const string WindowsExplorer = "explorer.exe";
//FB 23926 Moved to constants
public const string NoValue = "NOVALUE";
public const string ISO_CH_ONLY_PREFIX = "__ISO_CH_ONLY__";
//FB 25526 Moved from SLICE6AIR so they can be used by multiple classes
public const uint XML_HEADER_LENGTH = 8;
public readonly static byte[] XML_STORE_MAGIC_BYTES = new byte[] { 0xAA, 0x55, 0xA5, 0x5A };
public const ushort FILE_STORE_DSP_FILTER_ID = 104;
public const byte DEVICE_STREAMING_ONLY = 1;
///
///FB 28107 Maximum value allowed for TDAS Tom Digital out duration
///
public const double TDAS_TOM_DIGITAL_OUT_DURATION_MAX = 1600;
///
/// bps = (32bit + 6x16bit) * sampling rate. Our PCM data payload is 128bit per minor frame
///
public const int BITS_PER_MINOR_FRAME_S6A = 128;
//bps = (32 + 18*16)*sampling rate for TSR AIR - per EF
//[2:14 PM] Eric Fizer should be 18 * 16bit +32bit frame sync, no?
public const int BITS_PER_MINOR_FRAME_TSRAIR = 320;
///
/// FB15339 DACs are 16-bit, so midpoint ADC value would be 2^15 - 1
///
public const int ADC_MIDPOINT = 32767;
///
/// timeout supplied to ping_ICMP
/// 14735 Updates for GM Process flow, time improvement and bug fix
/// max time in MS to wait for an individual ping attempt
///
public static int PING_ICMP_TIMEOUT { get; set; } = 500;
///
/// 14966 AAF Realtime rate if we're turning off AAFRealtime via the config file
///
public const float SLICE2_NO_AAF_REALTIME_RATE = 100000F;
///
/// FB15313 Configure S6A udp streaming
///
public const int UDP_STREAMPROFILES_MAX = 15;
///
/// FB15323 Restrict Sample Rates when in UART recording modes
///
public const int UART_MODE_MAX_SAMPLERATE = 30000;
///
/// FB30273 Implement 'Warning' Validation for Streaming sample rate greater than 10k when Digital Filtering is configured
///
public const int SLICE6AIR_STREAMING_DIGITAL_FILTERING_MAX_SAMPLERATE = 10000;
public const int SLICE6AIR_STREAMING_DIGITAL_FILTERING_MAX_SAMPLERATE_20k = 20000;
public const int SLICE6AIR_20K_DIGITAL_FILTER_MIN_PROTOCOL = 46;
///
/// max sample rate that digital filtering will reliably work for S6A F/W version 46 and beyond
/// http://manuscript.dts.local/f/cases/39106/Datapro-shouldnt-be-warning-about-digital-filter-availability-until-20k-sps
///
public const decimal NANOS_PER_SECOND = 1000000000m;
public const double TEN_MILLIS_IN_SEC = 0.01D;
///
/// Wait timeout for 3rd party executables
///
public const int EXECUTABLE_TIMEOUT = 30000;
///
/// FB15154 Restrict Clock Master & Clock Slave Test Setup Default profile selections
///
public static readonly ClockSyncProfile[] MasterProfiles = { ClockSyncProfile.None,
ClockSyncProfile.Manual,
ClockSyncProfile.Master_E2E,
ClockSyncProfile.Master_E2E_PPS_OUT,
ClockSyncProfile.Master_E2E_IRIG,
ClockSyncProfile.IRIG_Master_E2E_PPS_OUT,
ClockSyncProfile.IRIG_PPS_OUT,
ClockSyncProfile.Master_E2E_IRIG_EXT_PPS,
ClockSyncProfile.Master_E2E_GPS_EXT_PPS,
ClockSyncProfile.Master_E2E_EXT_PPS,
ClockSyncProfile.IRIG,
ClockSyncProfile.IRIG_EXT_PPS,
ClockSyncProfile.GPS_EXT_PPS,
ClockSyncProfile.EXT_PPS,
//Combinations that are possible in UI, but no device supports
//30487: GPS only clock sync option should be removed
// also clean up available selections in TSD
/*ClockSyncProfile.PPS_OUT,
ClockSyncProfile.GPS,
ClockSyncProfile.GPS_PPS_OUT,
ClockSyncProfile.GPS_Master_E2E_PPS_OUT,
ClockSyncProfile.GPS_EXT_PPS_PPS_OUT,
ClockSyncProfile.GPS_EXT_PPS_Master_E2E_PPS_OUT,
ClockSyncProfile.EXT_PPS_PPS_OUT,
ClockSyncProfile.EXT_PPS_Master_E2E_PPS_OUT,
ClockSyncProfile.IRIG_EXT_PPS_PPS_OUT,
ClockSyncProfile.IRIG_EXT_PPS_Master_E2E_PPS_OUT,*/
};
public static readonly ClockSyncProfile[] SlaveProfiles = { ClockSyncProfile.None,
ClockSyncProfile.Manual,
ClockSyncProfile.Slave_E2E,
ClockSyncProfile.Slave_E2E_PPS_OUT,
//Combinations that are possible in UI, but no device supports
//30487: also clean up available selections in TSD
/*ClockSyncProfile.Auto_E2E,
ClockSyncProfile.Slave_E2E_Master_E2E_OUT,
ClockSyncProfile.Slave_E2E_Master_E2E_PPS_OUT,*/
};
public static readonly ClockSyncProfile[] OnePPSOutProfiles = { ClockSyncProfile.Slave_E2E_PPS_OUT,
ClockSyncProfile.Master_E2E_PPS_OUT,
ClockSyncProfile.IRIG_Master_E2E_PPS_OUT,
ClockSyncProfile.IRIG_PPS_OUT,
//Combinations that are possible in UI, but no device supports
ClockSyncProfile.PPS_OUT,
ClockSyncProfile.GPS_PPS_OUT,
ClockSyncProfile.GPS_Master_E2E_PPS_OUT,
ClockSyncProfile.GPS_EXT_PPS_PPS_OUT,
ClockSyncProfile.GPS_EXT_PPS_Master_E2E_PPS_OUT,
ClockSyncProfile.EXT_PPS_PPS_OUT,
ClockSyncProfile.EXT_PPS_Master_E2E_PPS_OUT,
ClockSyncProfile.IRIG_EXT_PPS_PPS_OUT,
ClockSyncProfile.IRIG_EXT_PPS_Master_E2E_PPS_OUT,
ClockSyncProfile.Slave_E2E_Master_E2E_PPS_OUT,
};
///
/// FB15520 Restrict Recording Mode Test Setup Default selections to non-streaming
/// FB39190 Also restrict multiple-event variants of regular modes
/// FB39189 Add scheduled
///
public static readonly RecordingModes[] NonStreamingRecordingModes = { RecordingModes.CircularBuffer, RecordingModes.CircularBufferPlusUART, RecordingModes.CircularBufferAndStreamSubSample,
RecordingModes.Recorder, RecordingModes.RecorderPlusUART, RecordingModes.RecorderAndStreamSubSample,
RecordingModes.HybridRecorder, RecordingModes.HybridAndStream, RecordingModes.ContinuousRecorder, RecordingModes.ContinuousRecorderPlusUART,
RecordingModes.RAMActive, RecordingModes.RecordOnBoot, RecordingModes.RecordOnBootPlusUART,
RecordingModes.Active, RecordingModes.Scheduled
};
///
/// 17650 sanitize name output for certain exports
///
public static readonly Dictionary ExportNameFilters = new Dictionary { { "(Voltage)", "Voltage" }, { "(Current)", "Current" } };
public const string DUMMY_MOD_DESCRIP_S6DB = "slice6db module";
public const string DUMMY_MOD_DESCRIP_POWERPRO = "powerpro module";
public const uint MaxAAFilterRateHz = 200000;
public const int PSD_DEFAULT_MAX_POW10 = 0;
public const int PSD_DEFAULT_MIN_POW10 = -12;
public const string ISOTestInfo = "_";
///
/// 18361 NMEA data exports
/// 28173 NMEA additional data
///
public const string NMEA_GPRMC_HEADER = "$GPRMC";
public const int NMEA_GPRMC_TIME_POSN = 1;
public const int NMEA_GPRMC_VALID_POSN = 2;
public const int NMEA_GPRMC_LAT_POSN = 3;
public const int NMEA_GPRMC_LAT_LEN = 9;
public const int NMEA_GPRMC_LATD_POSN = 4;
public const int NMEA_GPRMC_LONG_POSN = 5;
public const int NMEA_GPRMC_LONG_LEN = 10;
public const int NMEA_GPRMC_LONGD_POSN = 6;
public const int NMEA_GPRMC_VELO_POSN = 7;
public const int NMEA_GPRMC_DIR_POSN = 8;
public const int NMEA_GPRMC_DATE_POSN = 9;
public const string NMEA_GPGGA_HEADER = "$GPGGA";
public const int NMEA_GPGGA_TIME_POSN = 1;
public const int NMEA_GPGGA_VALID_POSN = 6;
public const int NMEA_GPGGA_ALT_POSN = 9;
public const int NMEA_GPGGA_ALTU_POSN = 10;
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;
//http://manuscript.dts.local/f/cases/29987/Add-CG-DP-TMATS-interval-UI-support
public const int TMATS_INTERVAL_VERSION = 93;
//FB 29978 Allowed directory & file name in Windows
public const int ALLOWED_DOWNLOAD_FILE_LENGTH = 260;
public const int ALLOWED_DOWNLOAD_DIRECTORY_LENGTH = 248;
public const int ADC_TO_UART_DB_VERSION = 93;
public const int SLICE6AIR_BR_DB_VERSION = 95;
public const int PTP_DOMAIN_ID_DB_VERSION = 95;
public const int BULK_GROUPCHANNELSETTINGS_GET_DB_VERSION = 95;
// 35514 Multiple-event UART support
public const int MULTIPLE_EVENT_UART_DB_VERSION = 96;
public const int RECORD_ON_BOOT_VERSION = 96;
public const int TSRAIR_GO_VERSION = 97;
public const int ROIPERIODCHANNELS_CHANNELID_DB_VERSION = 98;
public const int SENSOR_ASSEMBLY_DB_VERSION = 98;
public const int ALLOW_INSPECT_BEFORE_USE_DB_VERSION = 98;
public const int SLICE_TC_DB_VERSION = 99;
///
/// 38048 maximum points for a Viewer graph
///
public const int MAX_VIEWER_POINTS = 45000000;
public const double LOWEST_NONZERO_TSR_AIR_PRETRIGGER_SECONDS = 0.0128D;
private static string scheduleStartTimeError = string.Format(StringResources.EditTestSetupPage_ScheduleMustBeInFuture, DFConstantsAndEnums.SCHEDULE_AHEAD_IN_MINUTES);
public static string ScheduleStartTimeError
{
get => scheduleStartTimeError;
}
private static string intervalError = string.Format(StringResources.EditTestSetupPage_EventLengthTooLong, DFConstantsAndEnums.TIME_TO_REARM_SECONDS);
public static string IntervalError
{
get => intervalError;
}
}
}