211 lines
8.5 KiB
C#
211 lines
8.5 KiB
C#
|
|
using System;
|
|||
|
|
|
|||
|
|
namespace DatabaseExport
|
|||
|
|
{
|
|||
|
|
public sealed class SerializedSettings
|
|||
|
|
{
|
|||
|
|
public enum Keys
|
|||
|
|
{
|
|||
|
|
IgnorePowerMode,
|
|||
|
|
UseUserCodes,
|
|||
|
|
NumberRealtimeCharts,
|
|||
|
|
UseCircBufTriggerCheck,
|
|||
|
|
TriggerCheckPostRealtime,
|
|||
|
|
DeriveROIFromAll,
|
|||
|
|
// ReSharper disable once InconsistentNaming
|
|||
|
|
CRIBCOM,
|
|||
|
|
LastEventStartTime,
|
|||
|
|
ExportINIFile,
|
|||
|
|
ShowISOCodes,
|
|||
|
|
UseMeterModeTable,
|
|||
|
|
AutoArmDiagLevel,
|
|||
|
|
AutoArmDiagDelayMS,
|
|||
|
|
RealtimeSampleRates,
|
|||
|
|
RealtimeSampleRate,
|
|||
|
|
OverheadPercent,
|
|||
|
|
AutozeroRealtime,
|
|||
|
|
AllowCalculatedChannels,
|
|||
|
|
AllowLevelTriggerUI,
|
|||
|
|
TDASCalPeriod,
|
|||
|
|
G5CalPeriod,
|
|||
|
|
Slice1CalPeriod,
|
|||
|
|
Slice1_5CalPeriod,
|
|||
|
|
Slice2_CalPeriod,
|
|||
|
|
CalWarningPeriod,
|
|||
|
|
CalHWGracePeriod,
|
|||
|
|
HardwareCalPolicy,
|
|||
|
|
DefaultRecordingMode,
|
|||
|
|
DefaultIsoChannelSensorCompatibilityLevel,
|
|||
|
|
AllowAdvancedRecordingModes,
|
|||
|
|
IncludeGroupNameInISOExport,
|
|||
|
|
WarnIfTestCancelledWithoutExport,
|
|||
|
|
DiademChannelName200Option,
|
|||
|
|
DiademUserComment201Option,
|
|||
|
|
StartingTestSetup,
|
|||
|
|
SensitivityDisplayFormat,
|
|||
|
|
TriggerSecondsDisplayFormat,
|
|||
|
|
NonLinearDisplayFormat,
|
|||
|
|
TestSetupDefaultAutomaticMode,
|
|||
|
|
CommonStatusLine,
|
|||
|
|
AutomaticModeDelayMS,
|
|||
|
|
IsoSupportLevel,
|
|||
|
|
TriggerCheckQuickMode,
|
|||
|
|
Diagnostics_TDAS_TimeoutSec,
|
|||
|
|
Diagnostics_SLICE_TimeoutSec,
|
|||
|
|
ResolveChannels_TDAS_QueryDownloadTimeoutSec,
|
|||
|
|
ResolveChannels_SLICE_QueryDownloadTimeoutSec,
|
|||
|
|
ResolveChannels_TDAS_QueryConfigTimeoutSec,
|
|||
|
|
ResolveChannels_SLICE_QueryConfigTimeoutSec,
|
|||
|
|
SLICE_CONNECT_ALLOWED_SECONDS,
|
|||
|
|
TDAS_CONNECT_ALLOWED_SECONDS,
|
|||
|
|
ISOSupport_Allow_Transitional,
|
|||
|
|
ISOSupport_Allow_NonISO,
|
|||
|
|
TestSetup_AllowQuickTestSetup,
|
|||
|
|
Graphs_PFSZoomValues,
|
|||
|
|
AutoAdd_ArmChecklist,
|
|||
|
|
TESTSETUP_WARNBATFAIL,
|
|||
|
|
TESTSETUPDEFAULT_DONTALLOWOUTOFCALSENSOR,
|
|||
|
|
SPSINDICE_COUNT,
|
|||
|
|
TDAS_MAXAAFRATE,
|
|||
|
|
G5_MAXAAFRATE,
|
|||
|
|
DefaultDigitalOutMode,
|
|||
|
|
DownloadMode,
|
|||
|
|
SLICE_Distributor_PowerSetting,
|
|||
|
|
TDAS_Pro_Rack_PowerSetting,
|
|||
|
|
G5VDS_PowerSetting,
|
|||
|
|
SLICE1_5_Nano_Base_PowerSetting,
|
|||
|
|
SLICE_Micro_Base_PowerSetting,
|
|||
|
|
SLICE_NANO_Base_PowerSetting,
|
|||
|
|
SLICE2_SIM_PowerSetting,
|
|||
|
|
SLICE2_DIM_PowerSetting,
|
|||
|
|
SLICE2_TOM_PowerSetting,
|
|||
|
|
G5INDUMMY_PowerSetting,
|
|||
|
|
SLICE_EthernetController_PowerSetting,
|
|||
|
|
SLICE1_5_Micro_Base_PowerSetting,
|
|||
|
|
SLICE_LabEthernet_PowerSetting,
|
|||
|
|
SLICE2_SLS_PowerSetting,
|
|||
|
|
SLICE1_G5Stack_PowerSetting,
|
|||
|
|
SLICE2_SLT_PowerSetting,
|
|||
|
|
SLICE2_SLD_PowerSetting,
|
|||
|
|
RealtimeSampleRateSliceUSB,
|
|||
|
|
RealtimeSampleRateSliceIP,
|
|||
|
|
RealtimeSampleRateTDASG5,
|
|||
|
|
MaxParallelTDASDownloads,
|
|||
|
|
UseTestSetupNameForTestIDHeaderInCSVExport,
|
|||
|
|
TestIDPrefixSuffixValues,
|
|||
|
|
SLICE6_PowerSetting,
|
|||
|
|
SLICE6_CalPeriod,
|
|||
|
|
WarnOnEIDPositionSwap,
|
|||
|
|
AllowEIDSensorsOutOfPlace,
|
|||
|
|
SLICE6MulticastResponsePort,
|
|||
|
|
SLICE6MulticastCommandPort,
|
|||
|
|
SLICE6MulticastAddress,
|
|||
|
|
ClearDBBeforeTSFImport,
|
|||
|
|
//Valid Sample Rates
|
|||
|
|
SPSINDEX_0,
|
|||
|
|
SPSINDEX_1,
|
|||
|
|
SPSINDEX_2,
|
|||
|
|
SPSINDEX_3,
|
|||
|
|
SPSINDEX_4,
|
|||
|
|
SPSINDEX_5,
|
|||
|
|
SPSINDEX_6,
|
|||
|
|
SPSINDEX_7,
|
|||
|
|
SPSINDEX_8,
|
|||
|
|
SPSINDEX_9,
|
|||
|
|
SPSINDEX_10,
|
|||
|
|
SPSINDEX_11,
|
|||
|
|
SPSINDEX_12,
|
|||
|
|
SPSINDEX_13,
|
|||
|
|
SPSINDEX_14,
|
|||
|
|
SPSINDEX_15,
|
|||
|
|
SPSINDEX_16,
|
|||
|
|
SPSINDEX_17,
|
|||
|
|
SPSINDEX_18,
|
|||
|
|
SPSINDEX_19,
|
|||
|
|
SPSINDEX_20,
|
|||
|
|
SPSINDEX_21,
|
|||
|
|
SPSINDEX_22,
|
|||
|
|
SPSINDEX_23,
|
|||
|
|
POWERPRO_CalPeriod,
|
|||
|
|
SLICE6Air_CalPeriod,
|
|||
|
|
SLICE6DB_CalPeriod,
|
|||
|
|
TSRAir_CalPeriod
|
|||
|
|
}
|
|||
|
|
public const string ExportINIFileDefault = "";
|
|||
|
|
/// <summary>
|
|||
|
|
/// the location of the export INI file in use.
|
|||
|
|
/// This is used by GMMilford to control the directories of some export files
|
|||
|
|
/// </summary>
|
|||
|
|
public static string ExportINIFile
|
|||
|
|
{
|
|||
|
|
get => SettingsDB.GetGlobalValue(Keys.ExportINIFile.ToString(), ExportINIFileDefault);
|
|||
|
|
set => SettingsDB.SetGlobalValue(Keys.ExportINIFile.ToString(), value);
|
|||
|
|
}
|
|||
|
|
public static IsoChannelSensorCompatibilityLevels IsoChannelSensorCompatibilityLevelDefault = IsoChannelSensorCompatibilityLevels.Warn;
|
|||
|
|
public static IsoChannelSensorCompatibilityLevels IsoChannelSensorCompatibilityLevel
|
|||
|
|
{
|
|||
|
|
get
|
|||
|
|
{
|
|||
|
|
var s = SettingsDB.GetGlobalValue(Keys.DefaultIsoChannelSensorCompatibilityLevel.ToString(), IsoChannelSensorCompatibilityLevelDefault.ToString());
|
|||
|
|
return !Enum.TryParse(s, out IsoChannelSensorCompatibilityLevels isoChannelSensorCompatibilityLevel) ? IsoChannelSensorCompatibilityLevelDefault : isoChannelSensorCompatibilityLevel;
|
|||
|
|
}
|
|||
|
|
set => SettingsDB.SetGlobalValue(Keys.DefaultIsoChannelSensorCompatibilityLevel.ToString(), value.ToString());
|
|||
|
|
}
|
|||
|
|
public const bool TestSetupAutomaticModeDefault = false;
|
|||
|
|
public static bool TestSetupAutomaticMode
|
|||
|
|
{
|
|||
|
|
get => SettingsDB.GetGlobalValueBool(Keys.TestSetupDefaultAutomaticMode.ToString(), TestSetupAutomaticModeDefault);
|
|||
|
|
set => SettingsDB.SetGlobalValueBoolean(Keys.TestSetupDefaultAutomaticMode.ToString(), value);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
public const bool TestSetupDefault_CommonStatusLineDefault = true;
|
|||
|
|
public static bool TestSetupDefaultCommonStatusLine
|
|||
|
|
{
|
|||
|
|
get => SettingsDB.GetGlobalValueBool(Keys.CommonStatusLine.ToString(), TestSetupDefault_CommonStatusLineDefault);
|
|||
|
|
set => SettingsDB.SetGlobalValueBoolean(Keys.CommonStatusLine.ToString(), value);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
public const int TestSetupAutomaticProgressDelayMSDefault = 0;
|
|||
|
|
public static int TestSetupAutomaticProgressDelayMS
|
|||
|
|
{
|
|||
|
|
get => SettingsDB.GetGlobalValueInt(Keys.AutomaticModeDelayMS.ToString(), TestSetupAutomaticProgressDelayMSDefault);
|
|||
|
|
set => SettingsDB.SetGlobalValueInt(Keys.AutomaticModeDelayMS.ToString(), value);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public enum ISOSupportLevels
|
|||
|
|
{
|
|||
|
|
ISO_ONLY, //channels named by iso
|
|||
|
|
TRANSITORY, //UserValue1 for JCODE/Chimchim/etc, which takes the place of isocode in multiple places
|
|||
|
|
NO_ISO //channels named by user only
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
public const ISOSupportLevels ISOSupportLevelDefault = ISOSupportLevels.ISO_ONLY;
|
|||
|
|
public static ISOSupportLevels ISOSupportLevel
|
|||
|
|
{
|
|||
|
|
get
|
|||
|
|
{
|
|||
|
|
var s = SettingsDB.GetGlobalValue(Keys.IsoSupportLevel.ToString(), ISOSupportLevelDefault.ToString());
|
|||
|
|
return !Enum.TryParse(s, out ISOSupportLevels level) ? ISOSupportLevels.ISO_ONLY : level;
|
|||
|
|
}
|
|||
|
|
set => SettingsDB.SetGlobalValue(Keys.IsoSupportLevel.ToString(), value.ToString());
|
|||
|
|
}
|
|||
|
|
public const bool TestSetupDefaultWarnOnBatteryFailDefault = false;
|
|||
|
|
public static bool TestSetupDefaultWarnOnBatteryFail
|
|||
|
|
{
|
|||
|
|
get => SettingsDB.GetGlobalValueBool(Keys.TESTSETUP_WARNBATFAIL.ToString(), TestSetupDefaultWarnOnBatteryFailDefault);
|
|||
|
|
set => SettingsDB.SetGlobalValueBoolean(Keys.TESTSETUP_WARNBATFAIL.ToString(), value);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
public const bool TestSetupDefaultDontAllowOutOfCalSensorsDefault = false;
|
|||
|
|
public static bool TestSetupDefaultDontAllowOutOfCalSensors
|
|||
|
|
{
|
|||
|
|
get => SettingsDB.GetGlobalValueBool(Keys.TESTSETUPDEFAULT_DONTALLOWOUTOFCALSENSOR.ToString(), TestSetupDefaultDontAllowOutOfCalSensorsDefault);
|
|||
|
|
set => SettingsDB.SetGlobalValueBoolean(Keys.TESTSETUPDEFAULT_DONTALLOWOUTOFCALSENSOR.ToString(), value);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|