init
This commit is contained in:
571
DataPRO/EquipmentExchange/CrashDesignerTestSetup.cs
Normal file
571
DataPRO/EquipmentExchange/CrashDesignerTestSetup.cs
Normal file
@@ -0,0 +1,571 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Xml;
|
||||
|
||||
namespace EquipmentExchange
|
||||
{
|
||||
public class CrashDesignerTestSetup
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public static void GetEqxElectricalMethod(string eqxBridge,
|
||||
out bool isProportional,
|
||||
out DTS.Common.Enums.Sensors.SensorConstants.BridgeType bridgeType)
|
||||
{
|
||||
isProportional = true;
|
||||
bridgeType = DTS.Common.Enums.Sensors.SensorConstants.BridgeType.FullBridge;
|
||||
switch (eqxBridge)
|
||||
{
|
||||
case "PiezoInput": bridgeType = DTS.Common.Enums.Sensors.SensorConstants.BridgeType.IEPE; break;
|
||||
case "ActiveSensor":
|
||||
case "Active":
|
||||
isProportional = false;
|
||||
bridgeType = DTS.Common.Enums.Sensors.SensorConstants.BridgeType.FullBridge;
|
||||
break;
|
||||
case "FullBridge":
|
||||
isProportional = true;
|
||||
bridgeType = DTS.Common.Enums.Sensors.SensorConstants.BridgeType.FullBridge;
|
||||
break;
|
||||
case "HalfBridge":
|
||||
isProportional = true;
|
||||
bridgeType = DTS.Common.Enums.Sensors.SensorConstants.BridgeType.HalfBridge;
|
||||
break;
|
||||
case "HalfBridgeActive":
|
||||
isProportional = false;
|
||||
bridgeType = DTS.Common.Enums.Sensors.SensorConstants.BridgeType.HalfBridge;
|
||||
break;
|
||||
case "QuarterBridge":
|
||||
isProportional = true;
|
||||
bridgeType = DTS.Common.Enums.Sensors.SensorConstants.BridgeType.QuarterBridge;
|
||||
break;
|
||||
case "QuarterBridgeActive":
|
||||
isProportional = false;
|
||||
bridgeType = DTS.Common.Enums.Sensors.SensorConstants.BridgeType.QuarterBridge;
|
||||
break;
|
||||
}
|
||||
}
|
||||
public static CrashDesignerTestSetup ReadXML(string importFile)
|
||||
{
|
||||
var test = new CrashDesignerTestSetup();
|
||||
|
||||
var doc = new XmlDocument();
|
||||
|
||||
doc.Load(importFile);
|
||||
|
||||
foreach (var node in doc.ChildNodes)
|
||||
{
|
||||
if (node is XmlElement element)
|
||||
{
|
||||
if (element.LocalName == "TestSetupDefinition")
|
||||
{
|
||||
test.Name = element.GetAttribute("Name");
|
||||
foreach (var subNode in element.ChildNodes)
|
||||
{
|
||||
if (subNode is XmlElement subElement)
|
||||
{
|
||||
if (subElement.LocalName == "General")
|
||||
{
|
||||
test.General.ReadXml(subElement);
|
||||
}
|
||||
else if (subElement.LocalName == "ChannelGroups")
|
||||
{
|
||||
test.ChannGroups.ReadXml(subElement);
|
||||
}
|
||||
else if (subElement.LocalName == "DataAcquisitionUnit")
|
||||
{
|
||||
test.DataAcquisition.ReadXml(subElement);
|
||||
}
|
||||
else
|
||||
{
|
||||
System.Diagnostics.Trace.WriteLine($"unknown element: {subElement.LocalName}");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return test;
|
||||
}
|
||||
public class GeneralSection
|
||||
{
|
||||
public DateTime DateGenerated { get; set; }
|
||||
public string GeneratorName { get; set; }
|
||||
public string Description { get; set; }
|
||||
public string TestType { get; set; }
|
||||
public double PreTriggerTime { get; set; }
|
||||
public double PostTriggerTime { get; set; }
|
||||
public string OutputDataDirectory { get; set; }
|
||||
private readonly List<string> _groups = new List<string>();
|
||||
public string[] TestSetupGroup { get => _groups.ToArray(); set { _groups.Clear(); _groups.AddRange(value); } }
|
||||
public void ReadXml(XmlElement root)
|
||||
{
|
||||
foreach (var childNode in root.ChildNodes)
|
||||
{
|
||||
if (childNode is XmlElement element)
|
||||
{
|
||||
if (Enum.TryParse(element.LocalName, out Fields field))
|
||||
{
|
||||
switch (field)
|
||||
{
|
||||
case Fields.DateGenerated:
|
||||
if (DateTime.TryParse(element.InnerText, System.Globalization.CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.AssumeUniversal, out var dt))
|
||||
{
|
||||
DateGenerated = dt;
|
||||
}
|
||||
else { System.Diagnostics.Trace.WriteLine($"Failed to parse DateGenerated: {element.InnerText}"); }
|
||||
break;
|
||||
case Fields.Description:
|
||||
Description = element.InnerText;
|
||||
break;
|
||||
case Fields.GeneratorName:
|
||||
GeneratorName = element.InnerText;
|
||||
break;
|
||||
case Fields.OutputDataDirectory:
|
||||
OutputDataDirectory = element.InnerText;
|
||||
break;
|
||||
case Fields.PostTriggerTimeReadout:
|
||||
if (double.TryParse(element.InnerText, out var d))
|
||||
{
|
||||
PostTriggerTime = d;
|
||||
}
|
||||
break;
|
||||
case Fields.PreTriggerTimeReadout:
|
||||
if (double.TryParse(element.InnerText, out var d2))
|
||||
{
|
||||
PreTriggerTime = d2;
|
||||
}
|
||||
break;
|
||||
case Fields.TestSetupGroup:
|
||||
_groups.Add(element.InnerText);
|
||||
break;
|
||||
case Fields.TestType:
|
||||
TestType = element.InnerText;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public enum Fields
|
||||
{
|
||||
DateGenerated,
|
||||
GeneratorName,
|
||||
Description,
|
||||
TestType,
|
||||
PreTriggerTimeReadout,
|
||||
PostTriggerTimeReadout,
|
||||
OutputDataDirectory,
|
||||
TestSetupGroup
|
||||
}
|
||||
}
|
||||
public GeneralSection General { get; set; } = new GeneralSection();
|
||||
public ChannelGroupsSection ChannGroups { get; set; } = new ChannelGroupsSection();
|
||||
public class ChannelGroupsSection
|
||||
{
|
||||
private readonly List<Group> _groups = new List<Group>();
|
||||
public Group[] Groups { get => _groups.ToArray(); set { _groups.Clear(); _groups.AddRange(value); } }
|
||||
|
||||
public void ReadXml(XmlElement root)
|
||||
{
|
||||
foreach (var node in root.ChildNodes)
|
||||
{
|
||||
if (node is XmlElement element)
|
||||
{
|
||||
if (element.LocalName == "Group")
|
||||
{
|
||||
var group = Group.ReadXml(element);
|
||||
_groups.Add(group);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public class Group
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string Id { get; set; }
|
||||
public string Parent { get; set; }
|
||||
public string Description { get; set; }
|
||||
private readonly Dictionary<string, string> _properties = new Dictionary<string, string>();
|
||||
public bool HasProperty(string key) { return _properties.ContainsKey(key); }
|
||||
public string GetProperty(string key) { return _properties[key]; }
|
||||
public void SetProperty(string key, string value) { _properties[key] = value; }
|
||||
public enum KnownFormats
|
||||
{
|
||||
[Description("DataFormat")]
|
||||
DataFormat,
|
||||
[Description("ISO Title")]
|
||||
ISOTitle,
|
||||
[Description("Regulation")]
|
||||
Regulation,
|
||||
[Description("Media")]
|
||||
Media,
|
||||
[Description("TestDate")]
|
||||
TestDate,
|
||||
[Description("SignConvInstrStandard")]
|
||||
SignConvInstrStandard,
|
||||
[Description("LabName")]
|
||||
LabName,
|
||||
[Description("ContactName")]
|
||||
ContactName,
|
||||
[Description("ContactPhone")]
|
||||
ContactPhone,
|
||||
[Description("LabFax")]
|
||||
LabFax,
|
||||
[Description("LaboratoryContactEmail")]
|
||||
LaboratoryContactEmail,
|
||||
[Description("LaboratoryTestRefNumber")]
|
||||
LaboratoryTestRefNumber,
|
||||
[Description("CustomerName")]
|
||||
CustomerName,
|
||||
[Description("Testreference")]
|
||||
Testreference,
|
||||
[Description("CustomerReference")]
|
||||
CustomerReference,
|
||||
[Description("CustomerOrderNumber")]
|
||||
CustomerOrderNumber,
|
||||
[Description("CustomerCostUnit")]
|
||||
CustomerCostUnit,
|
||||
[Description("CustomerTestEngineerName")]
|
||||
CustomerTestEngineerName,
|
||||
[Description("CustomerTestEngineerPhone")]
|
||||
CustomerTestEngineerPhone,
|
||||
[Description("CustomerTestEngineerFax")]
|
||||
CustomerTestEngineerFax,
|
||||
[Description("CustomerTestEngineerEmail")]
|
||||
CustomerTestEngineerEmail,
|
||||
[Description("Name")]
|
||||
Name,
|
||||
[Description("Velocity")]
|
||||
Velocity,
|
||||
[Description("Mass")]
|
||||
Mass,
|
||||
[Description("DriverPosition")]
|
||||
DriverPosition,
|
||||
[Description("ImpactSide")]
|
||||
ImpactSide,
|
||||
[Description("TestObjectRefNumber")]
|
||||
TestObjectRefNumber,
|
||||
[Description("Class")]
|
||||
Class,
|
||||
[Description("Code")]
|
||||
Code
|
||||
}
|
||||
public static Group ReadXml(XmlElement root)
|
||||
{
|
||||
var group = new Group();
|
||||
if (root.HasAttribute("Id"))
|
||||
{
|
||||
group.Id = root.GetAttribute("Id");
|
||||
}
|
||||
if (root.HasAttribute("Parent"))
|
||||
{
|
||||
group.Parent = root.GetAttribute("Parent");
|
||||
}
|
||||
foreach (var node in root.ChildNodes)
|
||||
{
|
||||
if (node is XmlElement element)
|
||||
{
|
||||
switch (element.LocalName)
|
||||
{
|
||||
case "Name": group.Name = element.InnerText; break;
|
||||
case "Description": group.Description = element.InnerText; break;
|
||||
case "Property":
|
||||
group.SetProperty(element.GetAttribute("Name"), element.GetAttribute("Value"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return group;
|
||||
}
|
||||
}
|
||||
|
||||
public DataAcquisitionSection DataAcquisition { get; set; } = new DataAcquisitionSection();
|
||||
public class DataAcquisitionSection
|
||||
{
|
||||
private readonly List<DataAcquisitionUnit> _units = new List<DataAcquisitionUnit>();
|
||||
public DataAcquisitionUnit[] DataAcquisitionUnits { get => _units.ToArray(); set { _units.Clear(); _units.AddRange(value); } }
|
||||
|
||||
public void ReadXml(XmlElement element)
|
||||
{
|
||||
var daq = DataAcquisitionUnit.ReadXml(element);
|
||||
_units.Add(daq);
|
||||
}
|
||||
}
|
||||
//public DataAcquisitionSection DataAcquisitionUnit { get; set; } = new DataAcquisitionSection();
|
||||
public class DataAcquisitionUnit
|
||||
{
|
||||
private static double GetDouble(string text)
|
||||
{
|
||||
if (double.TryParse(text, System.Globalization.NumberStyles.Any, System.Globalization.CultureInfo.InvariantCulture, out var d))
|
||||
{
|
||||
return d;
|
||||
}
|
||||
return double.NaN;
|
||||
}
|
||||
public static DataAcquisitionUnit ReadXml(XmlElement root)
|
||||
{
|
||||
var daq = new DataAcquisitionUnit();
|
||||
|
||||
if (root.HasAttribute("Enabled"))
|
||||
{
|
||||
daq.Enabled = bool.Parse(root.GetAttribute("Enabled"));
|
||||
}
|
||||
|
||||
foreach (var node in root.ChildNodes)
|
||||
{
|
||||
if (node is XmlElement element)
|
||||
{
|
||||
switch (element.LocalName)
|
||||
{
|
||||
case "DatabaseUID": daq.DataBaseUID = element.InnerText; break;
|
||||
case "Name": daq.Name = element.InnerText; break;
|
||||
case "Type": daq.Type = element.InnerText; break;
|
||||
case "SubType": daq.SubType = element.InnerText; break;
|
||||
case "FirmwareVersion": daq.FirmwareVersion = element.InnerText; break;
|
||||
case "ModelDescription": daq.ModelDescription = element.InnerText; break;
|
||||
case "DefaultTriggerString": daq.DefaultTriggerString = element.InnerText; break;
|
||||
case "Trigger": daq.Trigger.ReadXml(element); break;
|
||||
case "Manufacturer": daq.Manufacturer = element.InnerText; break;
|
||||
case "ADRangeNegV": daq.ADRangeNegV = GetDouble(element.InnerText); break;
|
||||
case "ADRangePosV": daq.ADRangePosV = GetDouble(element.InnerText); break;
|
||||
case "ADResolutionV": daq.ADResolutionV = GetDouble(element.InnerText); break;
|
||||
case "GainRangeMax1": daq.GainRangeMax1 = GetDouble(element.InnerText); break;
|
||||
case "GainRangeMin1": daq.GainRangeMin1 = GetDouble(element.InnerText); break;
|
||||
case "GainRangeStep1": daq.GainRangeStep1 = GetDouble(element.InnerText); break;
|
||||
case "GainRangeMax2": daq.GainRangeMax2 = GetDouble(element.InnerText); break;
|
||||
case "GainRangeMin2": daq.GainRangeMin2 = GetDouble(element.InnerText); break;
|
||||
case "GainRangeStep2": daq.GainRangeStep2 = GetDouble(element.InnerText); break;
|
||||
case "FilterFrequencyHz": daq.FilterFrequencyHz = GetDouble(element.InnerText); break;
|
||||
case "FilterSpecification": daq.FilterSpecification = element.InnerText; break;
|
||||
case "SampleFrequencyHz": daq.SampleFrequencyHz = GetDouble(element.InnerText); break;
|
||||
case "MaxSampleFrequencyHz": daq.MaxSampleFrequencyHz = GetDouble(element.InnerText); break;
|
||||
case "MinSampleFrequencyHz": daq.MinSampleFrequencyHz = GetDouble(element.InnerText); break;
|
||||
case "BitResolution": daq.BitResolution = GetDouble(element.InnerText); break;
|
||||
case "Description": daq.Description = element.InnerText; break;
|
||||
case "Status": daq.Status = element.InnerText; break;
|
||||
case "Label": daq.Label = element.InnerText; break;
|
||||
case "SerialNr": daq.SerialNr = element.InnerText; break;
|
||||
case "TCPIPAddress": daq.TCPIPAddress = element.InnerText; break;
|
||||
case "ControllerNr": daq.ControllerNr = element.InnerText; break;
|
||||
case "RS422UnitNr": daq.RS422UnitNr = element.InnerText; break;
|
||||
case "UseRS422Communication": daq.UseRS422Communication = bool.Parse(element.InnerText); break;
|
||||
case "RS422COMPort": daq.RS422ComPort = int.Parse(element.InnerText); break;
|
||||
case "AnalogInputChannelCount": daq.AnalogInputChannelCount = int.Parse(element.InnerText); break;
|
||||
case "DigitalInputChannelCount": daq.DigitalInputChannelCount = int.Parse(element.InnerText); break;
|
||||
case "DigitalOutputChannelCount": daq.DigitalOutputChannelCount = int.Parse(element.InnerText); break;
|
||||
case "SystemChannelCount": daq.SystemChannelCount = int.Parse(element.InnerText); break;
|
||||
case "StartAnalogChannelNr": daq.StartAnalogChannelNr = int.Parse(element.InnerText); break;
|
||||
case "AnalogInChannel":
|
||||
daq.AnalogChannels.ReadXml(element);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return daq;
|
||||
}
|
||||
public bool Enabled { get; set; }
|
||||
public string DataBaseUID { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Type { get; set; }
|
||||
public string SubType { get; set; }
|
||||
public string FirmwareVersion { get; set; }
|
||||
public string ModelDescription { get; set; }
|
||||
public string DefaultTriggerString { get; set; }
|
||||
public TriggerSection Trigger { get; set; } = new TriggerSection();
|
||||
public class TriggerSection
|
||||
{
|
||||
public string TriggerMode { get; set; }
|
||||
public string RecBus { get; set; }
|
||||
public string T0Bus { get; set; }
|
||||
public string Filter { get; set; }
|
||||
|
||||
public void ReadXml(XmlElement root)
|
||||
{
|
||||
foreach (var node in root.ChildNodes)
|
||||
{
|
||||
if (node is XmlElement element)
|
||||
{
|
||||
switch (element.LocalName)
|
||||
{
|
||||
case "TriggerMode": TriggerMode = element.InnerText; break;
|
||||
case "RecBus": RecBus = element.InnerText; break;
|
||||
case "T0Bus": T0Bus = element.InnerText; break;
|
||||
case "Filter": Filter = element.InnerText; break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public string Manufacturer { get; set; }
|
||||
public double ADRangeNegV { get; set; }
|
||||
public double ADRangePosV { get; set; }
|
||||
public double ADResolutionV { get; set; }
|
||||
public double GainRangeMax1 { get; set; }
|
||||
public double GainRangeMin1 { get; set; }
|
||||
public double GainRangeStep1 { get; set; }
|
||||
public double GainRangeMax2 { get; set; }
|
||||
public double GainRangeMin2 { get; set; }
|
||||
public double GainRangeStep2 { get; set; }
|
||||
public double FilterFrequencyHz { get; set; }
|
||||
public string FilterSpecification { get; set; }
|
||||
public double SampleFrequencyHz { get; set; }
|
||||
public double MaxSampleFrequencyHz { get; set; }
|
||||
public double MinSampleFrequencyHz { get; set; }
|
||||
public double BitResolution { get; set; }
|
||||
public string Description { get; set; }
|
||||
public string Status { get; set; }
|
||||
public string Label { get; set; }
|
||||
public string SerialNr { get; set; }
|
||||
public string TCPIPAddress { get; set; }
|
||||
public string ControllerNr { get; set; }
|
||||
public string RS422UnitNr { get; set; }
|
||||
public bool UseRS422Communication { get; set; }
|
||||
public int RS422ComPort { get; set; }
|
||||
public int AnalogInputChannelCount { get; set; }
|
||||
public int DigitalInputChannelCount { get; set; }
|
||||
public int DigitalOutputChannelCount { get; set; }
|
||||
public int SystemChannelCount { get; set; }
|
||||
public int StartAnalogChannelNr { get; set; }
|
||||
|
||||
public AnalogInChannelSection AnalogChannels { get; set; } = new AnalogInChannelSection();
|
||||
|
||||
|
||||
public class AnalogInChannelSection
|
||||
{
|
||||
private readonly List<AnalogInChannel> _channels = new List<AnalogInChannel>();
|
||||
public AnalogInChannel[] Channels { get => _channels.ToArray(); set { _channels.Clear(); _channels.AddRange(value); } }
|
||||
|
||||
public void ReadXml(XmlElement element)
|
||||
{
|
||||
var analog = AnalogInChannel.ReadXml(element);
|
||||
_channels.Add(analog);
|
||||
}
|
||||
}
|
||||
public class AnalogInChannel
|
||||
{
|
||||
public bool Enabled { get; set; }
|
||||
public string Id { get; set; }
|
||||
public string GroupId { get; set; }
|
||||
public bool DataConversionEnabled { get; set; }
|
||||
public string ChannelName { get; set; }
|
||||
public int GlobalNr { get; set; }
|
||||
public string ISOCodeName { get; set; }
|
||||
public string ISOCodeLongName { get; set; }
|
||||
public string CompanyCodeName { get; set; }
|
||||
public string CompanyCodeLongName { get; set; }
|
||||
public string Comment { get; set; }
|
||||
public string SubType { get; set; }
|
||||
public int SampleFGroupId { get; set; }
|
||||
public bool ReadoutEnabled { get; set; }
|
||||
public int ChannelNr { get; set; }
|
||||
public double SampleFrequency { get; set; }
|
||||
public string SensorModelName { get; set; }
|
||||
public string SerialNr { get; set; }
|
||||
public string SensorName { get; set; }
|
||||
public string SensorAxisName { get; set; }
|
||||
public string SensorStatus { get; set; }
|
||||
public bool SensorStatusUsable { get; set; }
|
||||
public string SensorIDType { get; set; }
|
||||
public DateTime NextCalibrationDate { get; set; }
|
||||
public bool VoltageEngineeringUnit { get; set; }
|
||||
public string ElectronicID { get; set; }
|
||||
public string BridgeType { get; set; }
|
||||
public bool SelfDescriptive { get; set; }
|
||||
public double ExcitationVoltage { get; set; }
|
||||
public double Sensitivity { get; set; }
|
||||
public bool InvertFlag { get; set; }
|
||||
public double CalculatedGain { get; set; }
|
||||
public double PreferredMeasurementRange { get; set; }
|
||||
public string PhysicalUnit { get; set; }
|
||||
public string Direction { get; set; }
|
||||
public bool HWAdjustOffsetFlag { get; set; }
|
||||
public bool SWAdjustOffsetFlag { get; set; }
|
||||
public bool OffsetFlag { get; set; }
|
||||
public double OffsetMaxToleranceV { get; set; }
|
||||
public double OffsetReferenceV { get; set; }
|
||||
public bool ShuntPosFlag { get; set; }
|
||||
public double ShuntGainPos { get; set; }
|
||||
public double ShuntPosMaxToleranceV { get; set; }
|
||||
public double ShuntPosReferenceV { get; set; }
|
||||
public bool ShuntNegFlag { get; set; }
|
||||
public double ShuntGainNeg { get; set; }
|
||||
public double ShuntNegMaxToleranceV { get; set; }
|
||||
public double ShuntNegReferenceV { get; set; }
|
||||
public static DateTime GetDate(string text)
|
||||
{
|
||||
if (DateTime.TryParse(text, System.Globalization.CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.None, out var dt))
|
||||
{
|
||||
return dt;
|
||||
}
|
||||
return DateTime.MinValue;
|
||||
}
|
||||
public static AnalogInChannel ReadXml(XmlElement root)
|
||||
{
|
||||
var analog = new AnalogInChannel();
|
||||
if (root.HasAttribute("Enabled")) { analog.Enabled = bool.Parse(root.GetAttribute("Enabled")); }
|
||||
if (root.HasAttribute("Id")) { analog.Id = root.GetAttribute("Id"); }
|
||||
if (root.HasAttribute("GroupId")) { analog.GroupId = root.GetAttribute("GroupId"); }
|
||||
|
||||
foreach (var node in root.ChildNodes)
|
||||
{
|
||||
if (node is XmlElement element)
|
||||
{
|
||||
switch (element.LocalName)
|
||||
{
|
||||
case "DataConversionEnabled": analog.DataConversionEnabled = bool.Parse(element.InnerText); break;
|
||||
case "ChannelName": analog.ChannelName = element.InnerText; break;
|
||||
case "GlobalNr": analog.GlobalNr = int.Parse(element.InnerText); break;
|
||||
case "ISOCodeName": analog.ISOCodeName = element.InnerText; break;
|
||||
case "ISOCodeLongName": analog.ISOCodeLongName = element.InnerText; break;
|
||||
case "CompanyCodeName": analog.CompanyCodeName = element.InnerText; break;
|
||||
case "CompanyCodeLongName": analog.CompanyCodeLongName = element.InnerText; break;
|
||||
case "Comment": analog.Comment = element.InnerText; break;
|
||||
case "SubType": analog.SubType = element.InnerText; break;
|
||||
case "SampleFGroupId": analog.SampleFGroupId = int.Parse(element.InnerText); break;
|
||||
case "ReadoutEnabled": analog.ReadoutEnabled = bool.Parse(element.InnerText); break;
|
||||
case "ChannelNr": analog.ChannelNr = int.Parse(element.InnerText); break;
|
||||
case "SampleFrequency": analog.SampleFrequency = GetDouble(element.InnerText); break;
|
||||
case "SensorModelName": analog.SensorModelName = element.InnerText; break;
|
||||
case "SerialNr": analog.SerialNr = element.InnerText; break;
|
||||
case "SensorName": analog.SensorName = element.InnerText; break;
|
||||
case "SensorAxisName": analog.SensorAxisName = element.InnerText; break;
|
||||
case "SensorStatus": analog.SensorStatus = element.InnerText; break;
|
||||
case "SensorStatusUsable": analog.SensorStatusUsable = bool.Parse(element.InnerText); break;
|
||||
case "SensorIDType": analog.SensorIDType = element.InnerText; break;
|
||||
case "NextCalibrationDate": analog.NextCalibrationDate = GetDate(element.InnerText); break;
|
||||
case "VoltageEngineeringUnit": analog.VoltageEngineeringUnit = bool.Parse(element.InnerText); break;
|
||||
case "ElectronicID": analog.ElectronicID = element.InnerText; break;
|
||||
case "BridgeType": analog.BridgeType = element.InnerText; break;
|
||||
case "SelfDescriptive": analog.SelfDescriptive = bool.Parse(element.InnerText); break;
|
||||
case "ExcitationVoltage": analog.ExcitationVoltage = GetDouble(element.InnerText); break;
|
||||
case "Sensitivity": analog.Sensitivity = GetDouble(element.InnerText); break;
|
||||
case "InvertFlag": analog.InvertFlag = bool.Parse(element.InnerText); break;
|
||||
case "CalculatedGain": analog.CalculatedGain = GetDouble(element.InnerText); break;
|
||||
case "PreferredMeasurementRange": analog.PreferredMeasurementRange = GetDouble(element.InnerText); break;
|
||||
case "PhysicalUnit": analog.PhysicalUnit = element.InnerText; break;
|
||||
case "Direction": analog.Direction = element.InnerText; break;
|
||||
case "HWAdjustOffsetFlag": analog.HWAdjustOffsetFlag = bool.Parse(element.InnerText); break;
|
||||
case "SWAdjustOffsetFlag": analog.SWAdjustOffsetFlag = bool.Parse(element.InnerText); break;
|
||||
case "OffsetFlag": analog.OffsetFlag = bool.Parse(element.InnerText); break;
|
||||
case "OffsetMaxToleranceV": analog.OffsetMaxToleranceV = GetDouble(element.InnerText); break;
|
||||
case "OffsetReferenceV": analog.OffsetReferenceV = GetDouble(element.InnerText); break;
|
||||
case "ShuntPosFlag": analog.ShuntPosFlag = bool.Parse(element.InnerText); break;
|
||||
case "ShuntGainPos": analog.ShuntGainPos = GetDouble(element.InnerText); break;
|
||||
case "ShuntPosMaxToleranceV": analog.ShuntGainPos = GetDouble(element.InnerText); break;
|
||||
case "ShuntPosReferenceV": analog.ShuntPosReferenceV = GetDouble(element.InnerText); break;
|
||||
case "ShuntNegFlag": analog.ShuntNegFlag = bool.Parse(element.InnerText); break;
|
||||
case "ShuntGainNeg": analog.ShuntGainNeg = GetDouble(element.InnerText); break;
|
||||
case "ShuntNegMaxToleranceV": analog.ShuntNegMaxToleranceV = GetDouble(element.InnerText); break;
|
||||
case "ShuntNegReferenceV": analog.ShuntNegReferenceV = GetDouble(element.InnerText); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return analog;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user