/* * FtssCsv.File.cs * * Copyright © 2009 * Diversified Technical Systems, Inc. * All Rights Reserved */ using System.Collections.Generic; namespace DTS.Serialization.RDF { /// /// /// Basic representation of a Toyota CSV file. /// /// public partial class File : Serialization.File, IWritable { /// /// /// Initialize an instance of the FtssCsv.File class. /// /// 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; /// /// Get this file format's extension. /// public static string Extension => ".001"; public bool UseZeroForUnfiltered { get; set; } = false; public bool FilteredExport { get; set; } = false; private readonly Dictionary _EUUnfilteredDataForLinearizedChannels = new Dictionary(); public override void SetEUData(string channelID, FilteredData fd) { _EUUnfilteredDataForLinearizedChannels[channelID] = fd; } public override FilteredData GetEUData(string channelID) { return _EUUnfilteredDataForLinearizedChannels[channelID]; } /// /// Get the file writer for this file type. /// public IWriter 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 _Exporter = null; } }