init
This commit is contained in:
74
Common/DTS.Common.Serialization/Iso/Report/ChannelData.cs
Normal file
74
Common/DTS.Common.Serialization/Iso/Report/ChannelData.cs
Normal file
@@ -0,0 +1,74 @@
|
||||
using DTS.Common;
|
||||
|
||||
namespace DTS.Serialization.Iso.Report
|
||||
{
|
||||
/// <summary>
|
||||
/// this class encapsulates a single line in the iso test summary report
|
||||
/// </summary>
|
||||
internal class ChannelData
|
||||
{
|
||||
/// <summary>
|
||||
/// the number of the channel among all channels in the data
|
||||
/// </summary>
|
||||
public int ChannelNumber { get; set; } = 1;
|
||||
/// <summary>
|
||||
/// the iso code for a channel
|
||||
/// </summary>
|
||||
public string ISOCode { get; set; } = string.Empty;
|
||||
/// <summary>
|
||||
/// the name of the channel (iso channel name)
|
||||
/// </summary>
|
||||
public string ChannelName { get; set; } = string.Empty;
|
||||
/// <summary>
|
||||
/// the channel filter class for the channel (as in test setup, does not need to match exported data)
|
||||
/// </summary>
|
||||
public string SAEFilterClass { get; set; } = string.Empty;
|
||||
/// <summary>
|
||||
/// the electronic id at test setup time for the channel
|
||||
/// </summary>
|
||||
public string SetupEID { get; set; } = string.Empty;
|
||||
/// <summary>
|
||||
/// the electronic id at run test time on channel
|
||||
/// </summary>
|
||||
public string DataCollectionEID { get; set; } = string.Empty;
|
||||
/// <summary>
|
||||
/// any data flags present on channel
|
||||
/// </summary>
|
||||
public DataFlag DataFlag { get; set; } = DataFlag.None;
|
||||
|
||||
public const string NAME_OF_CHANNEL = "Name of channel";
|
||||
public string GetLine()
|
||||
{
|
||||
return $"{NAME_OF_CHANNEL} {(1 + ChannelNumber):000} :{ISOCode} / {ChannelName} / {SAEFilterClass} / {SetupEID} / {DataCollectionEID} / {(int)DataFlag}";
|
||||
}
|
||||
/// <summary>
|
||||
/// creates a channeldata instance given a test data channel
|
||||
/// </summary>
|
||||
/// <param name="channel"></param>
|
||||
/// <returns></returns>
|
||||
public static ChannelData CreateChannel(Test.Module.Channel channel)
|
||||
{
|
||||
var isoCode = string.Empty;
|
||||
var isoChannelName = string.Empty;
|
||||
string filter = string.Empty;
|
||||
if ( channel is Test.Module.AnalogInputChannel analog)
|
||||
{
|
||||
isoCode = analog.IsoCode;
|
||||
filter = analog.SoftwareFilter.Replace(" ", "");
|
||||
isoChannelName = analog.IsoChannelName;
|
||||
}
|
||||
var channelData = new ChannelData()
|
||||
{
|
||||
ChannelName = isoChannelName,
|
||||
ChannelNumber = channel.AbsoluteDisplayOrder,
|
||||
DataCollectionEID = channel.DataCollectionEID,
|
||||
DataFlag = (DataFlag)channel.DataFlag,
|
||||
ISOCode = isoCode,
|
||||
SAEFilterClass = filter,
|
||||
SetupEID = channel.SetupEID
|
||||
};
|
||||
return channelData;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user