示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
        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");
        }
示例#4
0
        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);
        }