/* * TDMS.File.cs * * Copyright © 2015 * Diversified Technical Systems, Inc. * All Rights Reserved */ using System.Collections.Generic; namespace DTS.Serialization.TDMS { /// /// /// Basic representation of a TDMS file. /// /// public partial class File : Serialization.File, IWritable { /// /// /// Initialize an instance of the TDMS.File class. /// /// public File(Common.ISO.TestPlan plan) : base("TDMS") { _testPlan = plan; } private readonly Common.ISO.TestPlan _testPlan = null; /// /// Get this file format's extension. /// public static string Extension => ".tdms"; 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; _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; } }