This commit is contained in:
2026-04-17 14:55:32 -04:00
commit bc3ac1d4c9
18017 changed files with 4371742 additions and 0 deletions

View File

@@ -0,0 +1,115 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DTS.SensorDB.TDCINI
{
/// <summary>
/// encapsulates all possible errors reading INI file, including section, line number, and a message or extra information
/// </summary>
public class TDCINIError
{
public enum INIErrors
{
INI_FILE_NOT_FOUND,
INI_FILE_INCOMPLETE,
INI_COMINFO_INVALID,
INI_FILE_SIGNALTONOISERATIO_INVALID,
INI_FILE_CALPULSETOLERANCE_INVALID,
INI_FILE_COMPORTForSoftwareExportTODAS_INVALID,
INI_PLOTFILLTYPE_INVALID,
INI_SHUNTCHECKOPTIONS_INVALID,
INI_DefaultSoftwareZeroReference_INVALID,
INI_DataZeroTimeWindow_INVALID,
INI_CurrentFirmwareVersion,
INI_GRAPHBACKGROUNDANDTRACE_INVALID,
INI_PROANDG5AAF_INVALID,
INI_USERACCESSTOQUICKMODIFY_INVALID,
INI_SAMPLERATES_INVALID,
INI_CORRESPONDING_VARIABLE_FCS_INVALID,
INI_CALIBRATION_INTERVALINMONTHS_INVALID,
INI_RACKINVENTORY_INVALID,
INI_COMPORTMODE_INVALID,
INI_DUPLICATESENSORSALLOWED_INVALID,
INI_ENABLESENSORID_INVALID,
INI_POSTCALWAITTIME_INVALID,
INI_TSFReadSIFProtocol,
INI_VALIDCUSTOMERDATACOLLECTIONS,
INI_DefaultDataCollectionMode,
INI_DefaultRealtimeMode,
INI_RealtimeBeforeDataCollection,
INI_ExportToASCIIOptions,
INI_SensorWarmupTimeSeconds_INVALID,
INI_SIMConnectorType_INVALID,
INI_TOMEVENT_INVALID,
INI_TOMRecording_INVALID,
INI_TOMACFrequency,
INI_TOMFireTypeDefault_INVALID,
INI_TOMCurrentDefault_INVALID,
INI_ROI_INVALID,
INI_MakeAllDataChannelNumbersSequential_INVALID,
INI_PercentOverRange_INVALID,
INI_DefaultAndBackupSIFDirectories_INVALID,
INI_DefaultAndBackupTSFDirectories_INVALID,
INI_DefaultAndBackupDataDirectories_INVALID,
INI_PerformAutomaticRackDiscovery_INVALID,
INI_ChannelDescriptionFilters,
INI_CurrentRS232,
INI_CheckHardwareTriggerDuringDataCollection_INVALID,
INI_FIREINTOTOMDUMMYLOADS_INVALID,
INI_CreateDIAdemHeaderOnDownload_INVALID,
INI_DIAdemChannelNameOption,
INI_DIAdemChannelCommentOption,
INI_MinimizeTOMSafetySwitchMessages_INVALID,
INI_EnableSoftwareStartTrigger_INVALID,
INI_EnableLowPowerModeForG5_INVALID,
INI_MeterModeChannelOrder_INVALID,
INI_AutomaticallyStartDownloadAfterSequencerComplete_INVALID,
INI_AutomaticallyStartDownloadAfterTestComplete_INVALID,
INI_G5DockingStationConnectorPanelOption_INVALID,
INI_MultipleTestMode_Invalid,
INI_MultipleTestModeDelayBetweenTests_INVALID,
INI_MultipleTestCalibrationInterval_INVALID,
INI_EnableACModeForSquibChannels_INVALID,
INI_OperatingMode,
INI_ViewerROI_INVALID,
INI_SmartBatteryStatusThresholds,
INI_SensorDatabaseDataSourceName_INVALID,
INI_MaximumGainForForcedExcitationMode_INVALID,
INI_ISOEXPORTPARAMETERS_INVALID,
INI_CheckForUndownloadedDataBeforeRealtime_INVALID,
INI_IIHSExport_INVALID,
INI_RealtimeLoggingEnabled_INVALID,
INI_ForceOldTestTrigger,
INI_DefaultExportFolder_INVALID,
INI_ExcitationVoltage_INVALID,
INI_PROGainOptions,
INI_MemorySize_INVALID,
INI_LastDataSet_INVALID,
INI_G5GainOptions_INVALID,
INI_ShuntValueOptions_INVALID
}
private INIErrors _error;
public INIErrors Error { get { return _error; } }
private int _line = -1;
public int Line { get { return _line; } set { _line = value; } }
private string _extraInfo;
public string ExtraInfo { get { return _extraInfo; } }
public TDCINIError(INIErrors error) { _error = error; }
public TDCINIError(INIErrors error, string extraInfo)
{
_error = error;
_extraInfo = extraInfo;
}
public TDCINIError(INIErrors error, string extraInfo, int currentLine)
{
_line = currentLine;
_extraInfo = extraInfo;
_error = error;
}
}
}

View File

@@ -0,0 +1,99 @@
using DTS.Common.Interface.Sensors;
using DTS.Common.Settings;
namespace DTS.SensorDB
{
public class DigitalInputSensorDefault : DTS.Common.Base.BasePropertyChanged, IDigitalInputDefaults
{
private double _constantCurrentBreakpoint;
/// <summary>
/// breakpoint in ADC where transition is made from active state to default state or vice versa
/// only valid for Constant Current Normally Open (CCNO) or Normally Closed (CCNC)
/// </summary>
public double ConstantCurrentBreakpointADC
{
get => _constantCurrentBreakpoint;
set => SetProperty(ref _constantCurrentBreakpoint, value, "ConstantCurrentBreakpointADC");
}
private double _voltageBreakpoint;
/// <summary>
/// breakpoint in ADC where transition is made from active state to default state or vice versa
/// only valid for Transition High to Low (THL) or (TLH)
/// </summary>
public double VoltageBreakpointADC
{
get => _voltageBreakpoint;
set => SetProperty(ref _voltageBreakpoint, value, "VoltageBreakpointADC");
}
private bool _displaySPDADC;
/// <summary>
/// whether to display analog SLICE PRO DIGITAL ADC data
/// </summary>
public bool DisplaySPDADC
{
get => _displaySPDADC;
set => SetProperty(ref _displaySPDADC, value, "DisplaySPDADC");
}
/// <summary>
/// returns true if properties are valid
/// </summary>
/// <returns></returns>
public bool Validate()
{
return true;
}
private const string VOLTAGE_INPUT_KEY = "VoltageInputBreakpoint";
private const string CONSTANT_CURRENT_KEY = "ConstantCurrentInputBreakpoint";
private const string DISPLAY_SPD_ADC_KEY = "DisplaySPDADC";
/// <summary>
/// returns the defaults for digital inputs
/// </summary>
/// <param name="user"></param>
/// <returns></returns>
public static IDigitalInputDefaults GetDigitalInputDefaults(string user)
{
var ccDefault = SettingsDB.GetGlobalValueDouble(CONSTANT_CURRENT_KEY,
DTS.Common.Constant.DigitalInputs.ConstantCurrentBreakPointDefault);
var voltageDefault = SettingsDB.GetGlobalValueDouble(VOLTAGE_INPUT_KEY,
DTS.Common.Constant.DigitalInputs.VoltageInputBreakPointDefault);
var displaySPDADC = SettingsDB.GetGlobalValueBool(DISPLAY_SPD_ADC_KEY,
DTS.Common.Constant.DigitalInputs.DisplaySPDADCDefault);
return new DigitalInputSensorDefault()
{
ConstantCurrentBreakpointADC = ccDefault,
VoltageBreakpointADC = voltageDefault,
DisplaySPDADC = displaySPDADC
};
}
/// <summary>
/// commits digital inputs to storage
/// </summary>
/// <param name="defaults"></param>
public static void Save(IDigitalInputDefaults defaults)
{
SettingsDB.SetGlobalValueDouble(CONSTANT_CURRENT_KEY, defaults.ConstantCurrentBreakpointADC);
SettingsDB.SetGlobalValueDouble(VOLTAGE_INPUT_KEY, defaults.VoltageBreakpointADC);
SettingsDB.SetGlobalValueBoolean(DISPLAY_SPD_ADC_KEY, defaults.DisplaySPDADC);
DTS.Common.Constant.DigitalInputs.ConstantCurrentBreakPoint = defaults.ConstantCurrentBreakpointADC;
DTS.Common.Constant.DigitalInputs.VoltageInputBreakPoint = defaults.VoltageBreakpointADC;
DTS.Common.Constant.DigitalInputs.DisplaySPDADC = defaults.DisplaySPDADC;
}
/// <summary>
/// restores digital input settings to defaults
/// </summary>
/// <param name="sensorDefaults"></param>
public static void RestoreDefaults(IDigitalInputDefaults sensorDefaults)
{
sensorDefaults.ConstantCurrentBreakpointADC = DTS.Common.Constant.DigitalInputs.ConstantCurrentBreakPointDefault;
sensorDefaults.VoltageBreakpointADC = DTS.Common.Constant.DigitalInputs.VoltageInputBreakPointDefault;
sensorDefaults.DisplaySPDADC = DTS.Common.Constant.DigitalInputs.DisplaySPDADC;
}
}
}