public void TestOpenFile()
        {
            RecordReader record;

            record = new RecordReader(@"D:\YandexDisk\Oscillogram\Undefined_A\1.dat");
            record.GetTimeLine();
            record.GetAnalogPrimaryChannel(0);
            record.GetDigitalChannel(0);

            record = new RecordReader(@"D:\YandexDisk\Oscillogram\LossOfSyncronism_B\ALAR.DAT");
            record.GetTimeLine();
            record.GetAnalogPrimaryChannel(0);
            record.GetDigitalChannel(0);

            record = new RecordReader(@"D:\YandexDisk\Oscillogram\Ground Fault_B\3.cFg");
            record.GetTimeLine();
            record.GetAnalogPrimaryChannel(0);
            record.GetDigitalChannel(0);

            record = new RecordReader(@"D:\YandexDisk\Oscillogram\Ground Fault_B\3.cfg");

            record = new RecordReader(@"D:\YandexDisk\Oscillogram\Sepam_StopingGenerator_B\1.DAT");
            record.GetTimeLine();
            record.GetAnalogPrimaryChannel(0);
            record.GetDigitalChannel(0);

            record = new RecordReader(@"D:\YandexDisk\Oscillogram\Undefined_2013_B32\000.DAT");
            record.GetTimeLine();
            record.GetAnalogPrimaryChannel(0);
            record.GetDigitalChannel(0);
        }
Пример #2
0
        void ReaderAsserts(string fullpath)
        {
            var reader = new RecordReader(fullpath);

            Assert.That(reader.Configuration.AnalogChannelInformations.Count, Is.EqualTo(3));
            Assert.That(reader.Configuration.DigitalChannelInformations.Count, Is.EqualTo(17));

            var timeLine   = reader.GetTimeLine();
            var analogs1   = reader.GetAnalogPrimaryChannel(0);
            var analogs2   = reader.GetAnalogPrimaryChannel(1);
            var analogs3   = reader.GetAnalogPrimaryChannel(2);
            var digitals1  = reader.GetDigitalChannel(0);
            var digitals5  = reader.GetDigitalChannel(4);
            var digitals17 = reader.GetDigitalChannel(16);


            Assert.That(timeLine[0], Is.EqualTo(0).Within(0.01));
            Assert.That(timeLine[1], Is.EqualTo(500).Within(0.01));
            Assert.That(timeLine[2], Is.EqualTo(1000).Within(0.01));

            Assert.That(analogs1[0], Is.EqualTo(0).Within(0.01));
            Assert.That(analogs1[1], Is.EqualTo(1.0).Within(0.01));
            Assert.That(analogs1[2], Is.EqualTo(-1.0).Within(0.01));

            Assert.That(analogs2[0], Is.EqualTo(0).Within(0.01));
            Assert.That(analogs2[1], Is.EqualTo(2.0).Within(0.01));
            Assert.That(analogs2[2], Is.EqualTo(2.0).Within(0.01));

            Assert.That(analogs3[0], Is.EqualTo(0).Within(0.01));
            Assert.That(analogs3[1], Is.EqualTo(3.0).Within(0.01));
            Assert.That(analogs3[2], Is.EqualTo(-3.5).Within(0.01));

            Assert.That(digitals1[0], Is.EqualTo(true));
            Assert.That(digitals1[1], Is.EqualTo(false));
            Assert.That(digitals1[2], Is.EqualTo(false));

            Assert.That(digitals5[0], Is.EqualTo(true));
            Assert.That(digitals5[1], Is.EqualTo(false));
            Assert.That(digitals5[2], Is.EqualTo(true));

            Assert.That(digitals17[0], Is.EqualTo(true));
            Assert.That(digitals17[1], Is.EqualTo(false));
            Assert.That(digitals17[2], Is.EqualTo(true));

            Assert.That(reader.Configuration.startTime, Is.EqualTo(new DateTime(1234567890)));
            Assert.That(reader.Configuration.triggerTime, Is.EqualTo(new DateTime(1234569000)));
        }