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,45 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DTS.SensorDB.TDCINI
{
/// <summary>
/// helper class for DataZeroTimeWindow section of INI
/// </summary>
public class INIDataZeroTimeWindowSeconds
{
/// <summary>
/// start of datazero window
/// </summary>
public double Start { get; set; }
/// <summary>
/// end of data zero window
/// </summary>
public double End { get; set; }
public bool ReadFrom(string line, ref List<TDCINIError> errors, int iCurrentLine)
{
string[] tokens = line.Split(new char[] { ',' });
if (2 != tokens.Length)
{
errors.Add(new TDCINIError(TDCINIError.INIErrors.INI_DataZeroTimeWindow_INVALID, line, iCurrentLine));
return false;
}
double d;
if (!double.TryParse(tokens[0], System.Globalization.NumberStyles.Any, System.Globalization.CultureInfo.InvariantCulture, out d))
{
errors.Add(new TDCINIError(TDCINIError.INIErrors.INI_DataZeroTimeWindow_INVALID, line, iCurrentLine));
return false;
}
else { Start = d; }
if (!double.TryParse(tokens[1], System.Globalization.NumberStyles.Any, System.Globalization.CultureInfo.InvariantCulture, out d))
{
errors.Add(new TDCINIError(TDCINIError.INIErrors.INI_DataZeroTimeWindow_INVALID, line, iCurrentLine));
return false;
}
else { End = d; }
return true;
}
}
}

View File

@@ -0,0 +1,71 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DTS.SensorDB.TDCINI
{
/// <summary>
/// helper class for IIHS export section of INI
/// </summary>
public class INIIIHSExport
{
/// <summary>
/// whether to apply region of interest or not
/// </summary>
public bool ApplyROI { get; set; }
/// <summary>
/// start of ROI in seconds
/// </summary>
public double ROIStartSeconds { get; set; }
/// <summary>
/// end of ROI in seconds
/// </summary>
public double ROIEndSeconds { get; set; }
public bool ReadFrom(string line, int curLine, ref List<TDCINIError> errors)
{
string[] tokens = line.Split(new char[] { ',' });
if (3 != tokens.Length)
{
errors.Add(new TDCINIError(TDCINIError.INIErrors.INI_IIHSExport_INVALID, line, curLine));
return false;
}
switch (tokens[0])
{
case "0":
case "F":
case "N":
ApplyROI = false; break;
case "1":
case "T":
case "Y":
ApplyROI = true; break;
default:
{
errors.Add(new TDCINIError(TDCINIError.INIErrors.INI_IIHSExport_INVALID, tokens[0], curLine));
return false;
}
}
double d;
if (!double.TryParse(tokens[1], System.Globalization.NumberStyles.Any, System.Globalization.CultureInfo.InvariantCulture, out d))
{
errors.Add(new TDCINIError(TDCINIError.INIErrors.INI_IIHSExport_INVALID, tokens[1], curLine));
return false;
}
else { ROIStartSeconds = d; }
if (!double.TryParse(tokens[2], System.Globalization.NumberStyles.Any, System.Globalization.CultureInfo.InvariantCulture, out d))
{
errors.Add(new TDCINIError(TDCINIError.INIErrors.INI_IIHSExport_INVALID, tokens[2], curLine));
return false;
}
else { ROIEndSeconds = d; }
return true;
}
}
}

View File

@@ -0,0 +1,183 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DTS.SensorDB.TDCINI
{
/// <summary>
/// helper class for ISO Export section of INI
/// </summary>
public class INIISOExportParameters
{
/// <summary>
/// whether to automatically export ISO on download
/// </summary>
public bool AutomaticISOExportOnDownload { get; set; }
/// <summary>
/// the MME header template (empty if none)
/// </summary>
public string MMEHeaderTemplateFilename { get; set; }
/// <summary>
/// whether to prompt the user for MME header template file or not
/// </summary>
public bool PromptUserForMMETemplateFilename { get; set; }
/// <summary>
/// channel header template (empty if none)
/// </summary>
public string ChannelHeaderTemplateFilename { get; set; }
/// <summary>
/// whether to prompt the user for a channel header template file
/// </summary>
public bool PromptUserForChannelHeaderFilename { get; set; }
public enum FilterOutputOptions
{
UnFiltered = 0,
Filtered = 1,
PromptUser = 2
}
/// <summary>
/// what type of output is desired
/// </summary>
public FilterOutputOptions FilterOutput { get; set; }
/// <summary>
/// whether to supress the export completion dialog
/// </summary>
public bool SuppressExportCompletionDialog { get; set; }
/// <summary>
/// dummy template file (empty if none)
/// </summary>
public string DummyTemplateFilename { get; set; }
/// <summary>
/// whether to prompt the user for dummy template file or not
/// </summary>
public bool PromptUserForDummyTemplateFilename { get; set; }
/// <summary>
/// reads settings from a line
/// returns true if successful or false if not
/// </summary>
/// <param name="line"></param>
/// <param name="curLine"></param>
/// <param name="errors"></param>
/// <returns></returns>
public bool ReadFrom(string line, int curLine, ref List<TDCINIError> errors)
{
string[] tokens = line.Split(new char[] { ',' });
if (tokens.Length != 9)
{
errors.Add(new TDCINIError(TDCINIError.INIErrors.INI_ISOEXPORTPARAMETERS_INVALID, line, curLine));
return false;
}
switch (tokens[0])
{
case "0":
case "F":
case "N":
AutomaticISOExportOnDownload = false;
break;
case "1":
case "T":
case "Y":
AutomaticISOExportOnDownload = true;
break;
default:
{
errors.Add(new TDCINIError(TDCINIError.INIErrors.INI_ISOEXPORTPARAMETERS_INVALID, tokens[0], curLine));
return false;
}
}
MMEHeaderTemplateFilename = tokens[1];
switch (tokens[2])
{
case "0":
case "F":
case "N":
PromptUserForMMETemplateFilename = false;
break;
case "1":
case "T":
case "Y":
PromptUserForMMETemplateFilename = true;
break;
default:
{
errors.Add(new TDCINIError(TDCINIError.INIErrors.INI_ISOEXPORTPARAMETERS_INVALID, tokens[2], curLine));
return false;
}
}
ChannelHeaderTemplateFilename = tokens[3];
switch (tokens[4])
{
case "0":
case "F":
case "N":
PromptUserForChannelHeaderFilename = false;
break;
case "1":
case "T":
case "Y":
PromptUserForChannelHeaderFilename = true;
break;
default:
{
errors.Add(new TDCINIError(TDCINIError.INIErrors.INI_ISOEXPORTPARAMETERS_INVALID, tokens[4], curLine));
return false;
}
}
switch (tokens[5])
{
case "0": FilterOutput = FilterOutputOptions.UnFiltered; break;
case "1": FilterOutput = FilterOutputOptions.Filtered; break;
case "2": FilterOutput = FilterOutputOptions.PromptUser; break;
default:
{
errors.Add(new TDCINIError(TDCINIError.INIErrors.INI_ISOEXPORTPARAMETERS_INVALID, tokens[5], curLine));
return false;
}
}
switch (tokens[6])
{
case "0":
case "F":
case "N":
SuppressExportCompletionDialog = false; break;
case "1":
case "T":
case "Y":
SuppressExportCompletionDialog = true; break;
default:
{
errors.Add(new TDCINIError(TDCINIError.INIErrors.INI_ISOEXPORTPARAMETERS_INVALID, tokens[6], curLine));
return false;
}
}
DummyTemplateFilename = tokens[7];
switch (tokens[8])
{
case "0":
case "F":
case "N":
PromptUserForDummyTemplateFilename = false; break;
case "1":
case "T":
case "Y":
PromptUserForDummyTemplateFilename = true; break;
default:
{
errors.Add(new TDCINIError(TDCINIError.INIErrors.INI_ISOEXPORTPARAMETERS_INVALID, tokens[8], curLine));
return false;
}
}
return true;
}
}
}

View File

@@ -0,0 +1,92 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DTS.SensorDB.TDCINI
{
/// <summary>
/// helper class for the rack inventory section of the INI
/// </summary>
public class INIRackInventory
{
/// <summary>
/// helper class for an entry in the INI RackInventory section
/// </summary>
public class INIRackInfo
{
public int Number { get; set; }
public string SerialNumber { get; set; }
public int Size { get; set; }
public string IPAddress { get; set; }
public bool ReadFrom(string line, ref List<TDCINIError> errors)
{
string[] tokens = line.Split(new char[] { ',' });
if (tokens.Length != 4)
{
errors.Add(new TDCINIError(TDCINIError.INIErrors.INI_RACKINVENTORY_INVALID, line));
return false;
}
int i;
if (!int.TryParse(tokens[0], System.Globalization.NumberStyles.Any, System.Globalization.CultureInfo.InvariantCulture, out i))
{
errors.Add(new TDCINIError(TDCINIError.INIErrors.INI_RACKINVENTORY_INVALID, tokens[0]));
return false;
}
else { Number = i; }
SerialNumber = tokens[1];
if (!int.TryParse(tokens[2], System.Globalization.NumberStyles.Any, System.Globalization.CultureInfo.InvariantCulture, out i))
{
errors.Add(new TDCINIError(TDCINIError.INIErrors.INI_RACKINVENTORY_INVALID, tokens[2]));
return false;
}
else { Size = i; }
IPAddress = tokens[3];
return true;
}
public TSFRackDescription ToTSFRackDescription()
{
TSFRackDescription rack = new TSFRackDescription();
rack.Number = Number;
rack.HWIPAddress = IPAddress;
rack.HWSerialNumber = SerialNumber.Trim();
return rack;
}
}
private List<INIRackInfo> _racks = new List<INIRackInfo>();
public INIRackInfo[] Racks
{
get { return _racks.ToArray(); }
set { _racks = new List<INIRackInfo>(value); }
}
public bool ReadFrom(string[] lines, ref int iCurLine, ref List<TDCINIError> errors)
{
bool bDone = false;
List<INIRackInfo> racks = new List<INIRackInfo>();
while (!bDone)
{
string line = TDCINIFile.GetNextLine(lines, ref iCurLine, ref errors, TDCINIError.INIErrors.INI_RACKINVENTORY_INVALID);
if (null == line) { return false; }
if (line.StartsWith("----")) { bDone = true; }
else
{
INIRackInfo rack = new INIRackInfo();
if (!rack.ReadFrom(line, ref errors))
{
return false;
}
else { racks.Add(rack); }
}
}
Racks = racks.ToArray();
iCurLine--;
return true;
}
}
}

View File

@@ -0,0 +1,47 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DTS.SensorDB.TDCINI
{
/// <summary>
/// helper class for SmartBatteryThreshold section in ini
/// </summary>
public class INISmartBatteryThresholds
{
/// <summary>
/// time in minutes for Yellow battery warning
/// </summary>
public int Yellow { get; set; }
/// <summary>
/// time in minutes for Red battery warning
/// </summary>
public int Red { get; set; }
public bool ReadFrom(string line, int curLine, ref List<TDCINIError> errors)
{
string[] tokens = line.Split(new char[] { ',' });
if (2 != tokens.Length)
{
errors.Add(new TDCINIError(TDCINIError.INIErrors.INI_SmartBatteryStatusThresholds, line, curLine));
return false;
}
int temp;
if (!int.TryParse(tokens[0], System.Globalization.NumberStyles.Any, System.Globalization.CultureInfo.InvariantCulture, out temp))
{
errors.Add(new TDCINIError(TDCINIError.INIErrors.INI_SmartBatteryStatusThresholds, line, curLine));
return false;
}
else { Yellow = temp; }
if (!int.TryParse(tokens[1], System.Globalization.NumberStyles.Any, System.Globalization.CultureInfo.InvariantCulture, out temp))
{
errors.Add(new TDCINIError(TDCINIError.INIErrors.INI_SmartBatteryStatusThresholds, line, curLine));
return false;
}
else { Red = temp; }
return true;
}
}
}

View File

@@ -0,0 +1,56 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DTS.SensorDB.TDCINI
{
/// <summary>
/// helper class for ViewerROI section of ROI
/// </summary>
public class INIViewerROI
{
/// <summary>
/// x Min value
/// </summary>
public double XMin { get; set; }
/// <summary>
/// x Max value
/// </summary>
public double XMax { get; set; }
/// <summary>
/// reads section from a line
/// returns false if failed to read section, true if section was read.
/// </summary>
/// <param name="line"></param>
/// <param name="curLine"></param>
/// <param name="errors"></param>
/// <returns></returns>
public bool ReadFrom(string line, int curLine, ref List<TDCINIError> errors)
{
string[] tokens = line.Split(new char[] { ',' });
if (2 != tokens.Length)
{
errors.Add(new TDCINIError(TDCINIError.INIErrors.INI_ViewerROI_INVALID, line, curLine));
return false;
}
double d;
if (!double.TryParse(tokens[0], System.Globalization.NumberStyles.Any, System.Globalization.CultureInfo.InvariantCulture, out d))
{
errors.Add(new TDCINIError(TDCINIError.INIErrors.INI_ViewerROI_INVALID, tokens[0], curLine));
return false;
}
else { XMin = d; }
if (!double.TryParse(tokens[1], System.Globalization.NumberStyles.Any, System.Globalization.CultureInfo.InvariantCulture, out d))
{
errors.Add(new TDCINIError(TDCINIError.INIErrors.INI_ViewerROI_INVALID, tokens[1], curLine));
return false;
}
else { XMax = d; }
return true;
}
}
}

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;
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,66 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DTS.SensorDB.TDCINI
{
/// <summary>
/// helper class for RS232 section of INI file
/// </summary>
public class TDCINIRS232Info
{
/// <summary>
/// Communication port
/// </summary>
public int ComPortNumber { get; set; }
/// <summary>
/// Max speed of com port
/// </summary>
public int MaxComSpeed { get; set; }
/// <summary>
/// max number of ports
/// </summary>
public int MaxComPorts { get; set; }
public TDCINIRS232Info() { }
/// <summary>
/// read section from a line
/// returns true if read successfully, false if there were errors
/// </summary>
/// <param name="line"></param>
/// <param name="errors"></param>
/// <returns></returns>
public bool ReadFrom(string line, ref List<TDCINIError> errors)
{
string[] tokens = line.Split(new char[] { ',' });
if (3 != tokens.Length)
{
errors.Add(new TDCINIError(TDCINIError.INIErrors.INI_COMINFO_INVALID, line));
return false;
}
int i;
if (!int.TryParse(tokens[0], System.Globalization.NumberStyles.Any, System.Globalization.CultureInfo.InvariantCulture, out i))
{
errors.Add(new TDCINIError(TDCINIError.INIErrors.INI_COMINFO_INVALID, line));
return false;
}
else { ComPortNumber = i; }
if (!int.TryParse(tokens[1], System.Globalization.NumberStyles.Any, System.Globalization.CultureInfo.InvariantCulture, out i))
{
errors.Add(new TDCINIError(TDCINIError.INIErrors.INI_COMINFO_INVALID, line));
return false;
}
else { MaxComSpeed = i; }
if (!int.TryParse(tokens[2], System.Globalization.NumberStyles.Any, System.Globalization.CultureInfo.InvariantCulture, out i))
{
errors.Add(new TDCINIError(TDCINIError.INIErrors.INI_COMINFO_INVALID, line));
return false;
}
else { MaxComPorts = i; }
return true;
}
}
}

View File

@@ -0,0 +1,56 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DTS.SensorDB.TDCINI
{
/// <summary>
/// helper class for region of interest section of INI
/// </summary>
public class TSFINIRegionOfInterest
{
/// <summary>
/// Start in seconds of ROI relative to T0
/// </summary>
public double StartSeconds { get; set; }
/// <summary>
/// end in seconds of ROI relative to T0
/// </summary>
public double EndSeconds { get; set; }
/// <summary>
/// reads section from a line,
/// returns true if read successfully
/// false if there were errors
/// </summary>
/// <param name="line"></param>
/// <param name="currentLine"></param>
/// <param name="errors"></param>
/// <returns></returns>
public bool ReadFrom(string line, int currentLine, ref List<TDCINIError> errors)
{
string[] tokens = line.Split(new char[] { ',' });
if (2 != tokens.Length)
{
errors.Add(new TDCINIError(TDCINIError.INIErrors.INI_ROI_INVALID, line, currentLine));
return false;
}
double d;
if (!double.TryParse(tokens[0], System.Globalization.NumberStyles.Any, System.Globalization.CultureInfo.InvariantCulture, out d))
{
errors.Add(new TDCINIError(TDCINIError.INIErrors.INI_ROI_INVALID, line, currentLine));
return false;
}
else { StartSeconds = d; }
if (!double.TryParse(tokens[1], System.Globalization.NumberStyles.Any, System.Globalization.CultureInfo.InvariantCulture, out d))
{
errors.Add(new TDCINIError(TDCINIError.INIErrors.INI_ROI_INVALID, line, currentLine));
return false;
}
else { EndSeconds = d; }
return true;
}
}
}