Files
2026-04-17 14:55:32 -04:00

111 lines
3.3 KiB
C#

/*
* FtssCsv.File.cs
*
* Copyright © 2009
* Diversified Technical Systems, Inc.
* All Rights Reserved
*/
using DTS.Common.ISO;
namespace DTS.Serialization.Diadem
{ ///
/// <summary>
/// Basic representation of a Toyota CSV file.
/// </summary>
///
public partial class File
: Serialization.File, IWritable<Test>
{ ///
/// <summary>
/// Initialize an instance of the FtssCsv.File class.
/// </summary>
///
public File(bool bUseEVG20, TestPlan plan)
: base("Diadem")
{
_bUseEVG20 = bUseEVG20;
_testPlan = plan;
}
private readonly TestPlan _testPlan;
private readonly bool _bUseEVG20;
/// <summary>
/// Get this file format's extension.
/// </summary>
public static string Extension => ".dat";
public bool UseIsoCodeForDiadem200 { get; set; } = true;
public bool UseZeroForUnfiltered { get; set; } = false;
// FB16225: change options to iso code, sensor serial, or (iso/user) name
public enum DiademOptions
{
NONE,
ISO_CODE,
SENSOR_SERIAL_NUMBER,
CHANNEL_NAME
}
// 43958 Add Group Name as a possibility instead of AAF Rate in Reserved 1
public enum DiademOptionsReserved1
{
NONE,
AAF_RATE,
GROUP_NAME
}
// FB43958: Add Channel Sensitivity as a possibility in Reserved 2
public enum DiademOptionsReserved2
{
NONE,
CHANNEL_SENSITIVITY
}
public DiademOptions ChannelName200Option { get; set; }
public DiademOptions UserComment201Option { get; set; }
public DiademOptionsReserved1 Reserved1_301Option { get; set; }
public DiademOptionsReserved2 Reserved2_302Option { get; set; }
/// <inheritdoc />
/// <summary>
/// Get the file writer for this file type.
/// </summary>
public IWriter<Test> Exporter
{
get
{
try
{
if (_Exporter == null)
{
var writer = new Writer(this, DefaultEncoding);
writer.UseEVG20 = _bUseEVG20;
writer.TestPlan = _testPlan;
writer.UseIsoCodeForDiadem200 = UseIsoCodeForDiadem200;
writer.UseZeroForUnfiltered = UseZeroForUnfiltered;
writer.ChannelName200Option = ChannelName200Option;
writer.UserComment201Option = UserComment201Option;
writer.Reserved1_301Option = Reserved1_301Option;
writer.Reserved2_302Option = Reserved2_302Option;
_Exporter = writer;
}
((Writer)_Exporter).WriterParent = this;
return _Exporter;
}
catch (System.Exception ex)
{
throw new Exception("encountered problem getting exporter", ex);
}
}
}
private IWriter<Test> _Exporter = null;
}
}