77 lines
2.5 KiB
C#
77 lines
2.5 KiB
C#
/*
|
|
* FtssCsv.File.cs
|
|
*
|
|
* Copyright © 2009
|
|
* Diversified Technical Systems, Inc.
|
|
* All Rights Reserved
|
|
*/
|
|
|
|
using System.Collections.Generic;
|
|
|
|
namespace DTS.Serialization.RDF
|
|
{ ///
|
|
/// <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(Common.ISO.TestPlan plan)
|
|
: base("RDF")
|
|
{
|
|
_testPlan = plan;
|
|
}
|
|
public const string SUFFIX_RUNTEST = " RunTest";
|
|
public const string SUFFIX_CHECKOUT = " Checkout";
|
|
public const int MAX_TEST_NAME_LENGTH = 8;
|
|
|
|
private readonly Common.ISO.TestPlan _testPlan = null;
|
|
/// <summary>
|
|
/// Get this file format's extension.
|
|
/// </summary>
|
|
public static string Extension => ".001";
|
|
|
|
public bool UseZeroForUnfiltered { get; set; } = false;
|
|
|
|
public bool FilteredExport { get; set; } = false;
|
|
|
|
private readonly Dictionary<string, FilteredData> _EUUnfilteredDataForLinearizedChannels = new Dictionary<string, FilteredData>();
|
|
public override void SetEUData(string channelID, FilteredData fd) { _EUUnfilteredDataForLinearizedChannels[channelID] = fd; }
|
|
public override FilteredData GetEUData(string channelID) { return _EUUnfilteredDataForLinearizedChannels[channelID]; }
|
|
/// <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.TestPlan = _testPlan;
|
|
|
|
writer.UseZeroForUnfiltered = UseZeroForUnfiltered;
|
|
writer.FilteredExport = FilteredExport;
|
|
_Exporter = writer;
|
|
}
|
|
(_Exporter as Writer).WriterParent = this;
|
|
return _Exporter;
|
|
}
|
|
|
|
catch (System.Exception ex)
|
|
{
|
|
throw new Exception("encountered problem getting exporter", ex);
|
|
}
|
|
}
|
|
}
|
|
private IWriter<Test> _Exporter = null;
|
|
}
|
|
}
|