53 lines
2.3 KiB
C#
53 lines
2.3 KiB
C#
using System.Text;
|
|
|
|
namespace DTS.Common.ISO
|
|
{
|
|
public class IsoCodeStatics
|
|
{
|
|
public static string GetString(MMEPossibleChannels channel, MMETestObjects container, MMEPositions position, MMEFilterClasses fc)
|
|
{
|
|
var iso = new IsoCode("");
|
|
iso.Direction = channel.Direction;
|
|
iso.FilterClass = channel.Default_Filter_Class;
|
|
iso.FineLocation1 = channel.Fine_Loc_1;
|
|
iso.FineLocation2 = channel.Fine_Loc_2;
|
|
iso.FineLocation3 = channel.Fine_Loc_3;
|
|
iso.MainLocation = channel.Trans_Main_Loc;
|
|
iso.PhysicalDimension = channel.Physical_Dimension;
|
|
iso.Position = position?.Position ?? "?";
|
|
iso.TestObject = container?.Test_Object ?? "?";
|
|
iso.FilterClass = fc?.Filter_Class ?? "?";
|
|
return iso.StringRepresentation;
|
|
}
|
|
/// <summary>
|
|
/// returns the isocode for a channel
|
|
/// considers whether it should mask the test time fields in the isocode
|
|
/// test time fields are test object, and filterclass
|
|
/// returns isocode
|
|
/// </summary>
|
|
/// <param name="channel"></param>
|
|
/// <param name="careAboutTestTimeFields"></param>
|
|
/// <returns></returns>
|
|
public static string GetString(MMEPossibleChannels channel, bool careAboutTestTimeFields)
|
|
{
|
|
var iso = new IsoCode("")
|
|
{
|
|
Direction = channel.Direction,
|
|
FineLocation1 = channel.Fine_Loc_1,
|
|
FineLocation2 = channel.Fine_Loc_2,
|
|
FineLocation3 = channel.Fine_Loc_3,
|
|
MainLocation = channel.Trans_Main_Loc,
|
|
PhysicalDimension = channel.Physical_Dimension,
|
|
Position = channel.Position,
|
|
TestObject = careAboutTestTimeFields ? channel.Test_Object : "??",
|
|
FilterClass = careAboutTestTimeFields ? channel.Default_Filter_Class : "?"
|
|
};
|
|
return iso.StringRepresentation;
|
|
}
|
|
public static string GetString(string testObject, string position, string main, string floc1, string floc2, string floc3, string physdim, string dir, string fc)
|
|
{
|
|
return $"{testObject}{position}{main}{floc1}{floc2}{floc3}{physdim}{dir}{fc}";
|
|
}
|
|
}
|
|
}
|