init
This commit is contained in:
67
Common/DTS.Common.Serialization/TDMS/TDMS.File.cs
Normal file
67
Common/DTS.Common.Serialization/TDMS/TDMS.File.cs
Normal file
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* 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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user