Files
DP44/Common/DTS.Common.Serialization/TDMS/TDMS.File.cs
2026-04-17 14:55:32 -04:00

68 lines
2.2 KiB
C#

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