public void TDMSHandlerShouldReturnLineLogData() { string ExampleLogPath = @"C:\NI Projects\EXAM\EXAM CVI dotnet\VS\Logs\EXAM_TEMP__NIVS_testMeas.tdms"; VeriStandTDMSHandler TDMSHandler = new VeriStandTDMSHandler(); TDMSHandler.TDMSOpen(ExampleLogPath); double[] logLine; double[] toCompare = { 1300, 2500, 20.51 }; logLine = TDMSHandler.TDMSReadLine(600); TDMSHandler.TDMSClose(); Assert.AreEqual(logLine, toCompare); }
public void TDMSHandlerShouldReturnColumnLogData() { string ExampleLogPath = @"C:\NI Projects\EXAM\EXAM CVI dotnet\VS\Logs\EXAM_TEMP__NIVS_testMeas_column.tdms"; VeriStandTDMSHandler TDMSHandler = new VeriStandTDMSHandler(); TDMSHandler.TDMSOpen(ExampleLogPath); double[] logColumn; double[] toCompare = { 20.43, 20.45, 20.47, 20.49, 20.51 }; logColumn = TDMSHandler.TDMSReadColumn(2); TDMSHandler.TDMSClose(); decimal[] logColumnDec = Array.ConvertAll(logColumn, x => (decimal)x); decimal[] toCompareDec = Array.ConvertAll(toCompare, x => (decimal)x); Assert.AreEqual(logColumnDec, toCompareDec); }
public void TDMSLoggingPropertiesTest() { string ExampleLogPath = @"C:\NI Projects\EXAM\EXAM CVI dotnet\VS\Logs\EXAM_TEMP__NIVS_testMeas_column.tdms"; VeriStandTDMSHandler TDMSHandler = new VeriStandTDMSHandler(); TDMSHandler.TDMSOpen(ExampleLogPath); double loggingRate = TDMSHandler.GetTDMSLoggingRate(); long logLength = TDMSHandler.GetTDMSLogLength(); int logChannelCount = TDMSHandler.GetTDMSLogChannelCount(); string TDMSprop = TDMSHandler.GetTDMSLogChannelProperty(1, "datatype"); TDMSHandler.TDMSClose(); Assert.AreEqual((decimal)loggingRate, 50); Assert.AreEqual((decimal)logLength, 5); Assert.AreEqual((decimal)logChannelCount, 3); Assert.AreEqual(TDMSprop, "DT_DOUBLE"); }
public void TDMSHandlerTimeShouldReturnColumnTimeLogData() { string ExampleLogPath = @"C:\NI Projects\EXAM\EXAM CVI dotnet\VS\Logs\EXAM_TEMP__NIVS_testMeasTime.tdms"; VeriStandTDMSHandler TDMSHandler = new VeriStandTDMSHandler(); TDMSHandler.TDMSOpen(ExampleLogPath); double[] logColumn; double[] toCompare = { 4.05, 4.06, 4.07, 4.08, 4.09 }; logColumn = TDMSHandler.TDMSTimeColumn(); TDMSHandler.TDMSClose(); var logColumnSubset = new double[toCompare.Count()]; Array.Copy(logColumn, 0, logColumnSubset, 0, logColumnSubset.Length); decimal[] logColumnDec = Array.ConvertAll(logColumnSubset, x => (decimal)x); decimal[] toCompareDec = Array.ConvertAll(toCompare, x => (decimal)x); Assert.AreEqual(logColumnDec, toCompareDec); }