using DTS.Common; namespace DTS.Serialization.Iso.Report { /// /// this class encapsulates a single line in the iso test summary report /// internal class ChannelData { /// /// the number of the channel among all channels in the data /// public int ChannelNumber { get; set; } = 1; /// /// the iso code for a channel /// public string ISOCode { get; set; } = string.Empty; /// /// the name of the channel (iso channel name) /// public string ChannelName { get; set; } = string.Empty; /// /// the channel filter class for the channel (as in test setup, does not need to match exported data) /// public string SAEFilterClass { get; set; } = string.Empty; /// /// the electronic id at test setup time for the channel /// public string SetupEID { get; set; } = string.Empty; /// /// the electronic id at run test time on channel /// public string DataCollectionEID { get; set; } = string.Empty; /// /// any data flags present on channel /// 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}"; } /// /// creates a channeldata instance given a test data channel /// /// /// 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; } } }