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

View File

@@ -0,0 +1,154 @@
/*
Test.IntervalSec.cs
Copyright © 2008
Diversified Technical Systems, Inc.
All Rights Reserved
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DTS.Utilities;
using DTS.Utilities.DotNetProgrammingConstructs;
namespace DTS.Serialization
{
// *** see test.cs ***
public partial class Test
{
/// <summary>
/// Get/set the begin value.
/// </summary>
public class IntervalSec : Exceptional
{
/// <summary>
/// Create an instance of the IntervalSec class.
/// </summary>
public IntervalSec()
{ //
// Note that calling the parameterless constructor will leave the begin and
// end properties "uninitialized".
} //
/// <summary>
/// Create an instance of the IntervalSec class.
/// </summary>
///
/// <param name="begin">
/// The <see cref="double"/> begin time of this interval.
/// </param>
///
/// <param name="end">
/// The <see cref="double"/> end time of this interval.
/// </param>
///
public IntervalSec(double begin, double end)
{
try
{
Begin = begin;
End = end;
}
catch (System.Exception ex)
{
throw new Exception("encountered problem constructing \"IntervalSec\" object", ex);
}
}
/// <summary>
/// Get/set whether or not Begin and End values are automatically rounded.
/// </summary>
public bool DoRoundOffValues { get; set; }
/// <summary>
/// Get/set the number of decimal places Begin and End values will automatically be rounded
/// to if DoRoundOffValues property is true.
/// </summary>
public int NumberRoundingDecimalPlaces
{
get { return _NumberOfRoundingDecimalPlaces.Value; }
set { _NumberOfRoundingDecimalPlaces.Value = value; }
}
private Property<int> _NumberOfRoundingDecimalPlaces =
new Property<int>(
typeof( IntervalSec ).Namespace + ".IntervalSec.NumberOfRoundingDecimalPlaces",
6,
true
);
/// <summary>
/// Get/set the <see cref="double"/> begin time of the interval.
/// </summary>
public double Begin
{
get { return DoRoundOffValues ? Math.Round( _Begin.Value, NumberRoundingDecimalPlaces ) : _Begin.Value; }
set { _Begin.Value = value; }
}
private Property<double> _Begin
= new Property<double>( typeof( IntervalSec ).Namespace + ".Test.IntervalSec.Begin", 0, false);
/// <summary>
/// Get/set the <see cref="double"/> end time of the interval.
/// </summary>
public double End
{
get { return DoRoundOffValues ? Math.Round( _End.Value, NumberRoundingDecimalPlaces ) : _End.Value ; }
set { _End.Value = value; }
}
private Property<double> _End
= new Property<double>( typeof( IntervalSec ).Namespace + ".Test.IntervalSec.End", 0, false);
/// <summary>
/// Determine whether or not this object and the one specified are equal.
/// </summary>
///
/// <param name="obj">
/// The <see cref="object"/> to be equality-checked.
/// </param>
///
/// <returns>
/// <see cref="bool"/> true if the object is equal; false otherwise.
/// </returns>
///
public override bool Equals( object obj )
{
try
{
IntervalSec that = obj as IntervalSec;
return null != obj
&& this.Begin.Equals( that.Begin )
&& this.End.Equals( that.End );
}
catch ( System.Exception ex )
{
throw new Test.IntervalSec.Exception( "encountered problem equality checking " + this.GetType( ).FullName, ex );
}
}
/// <summary>
/// Get has code for this object.
/// </summary>
///
/// <returns>
/// The <see cref="int"/> hash code for this object.
/// </returns>
///
public override int GetHashCode( )
{
try
{
return base.GetHashCode( );
}
catch ( System.Exception ex )
{
throw new Exception( "encountered problem generating hash code for " + this.GetType( ).FullName, ex );
}
}
}
}
}