Ejemplo n.º 1
0
        /// <summary>
        /// Initialize all the codecs.
        /// </summary>
        public AdcpCodec()
        {
            // Counters
            _binaryCounter = 0;
            _dvlCounter    = 0;
            _pd0Counter    = 0;
            _pd6_13Counter = 0;
            _pd4_5Counter  = 0;

            //PD0 Subsystem Generator
            _pd0SubsystemGen = new Pd0SubsystemGen();

            // Binary Codecs
            _binaryCodec = new AdcpBinaryCodecNew();
            _binaryCodec.ProcessDataEvent         += new AdcpBinaryCodecNew.ProcessDataEventHandler(_binaryCodec_ProcessDataEvent);
            _binaryCodec.ProcessDataCompleteEvent += binaryCodec_ProcessDataCompleteEvent;
            _binaryCodec.GoodEnsembleEvent        += ReceivedGoodEnsembleEvent;
            _binaryCodec.BadEnsembleEvent         += ReceivedBadEnsembleEvent;

            // DVL Codec
            _dvlCodec = new AdcpDvlCodec();
            _dvlCodec.ProcessDataEvent         += new AdcpDvlCodec.ProcessDataEventHandler(_dvlCodec_ProcessDataEvent);
            _dvlCodec.ProcessDataCompleteEvent += dvlCodec_ProcessDataCompleteEvent;

            // PD0 Codec
            _pd0Codec = new Pd0Codec();
            _pd0Codec.ProcessDataEvent         += new Pd0Codec.ProcessDataEventHandler(_pd0Codec_ProcessDataEvent);
            _pd0Codec.ProcessDataCompleteEvent += pd0Codec_ProcessDataCompleteEvent;
            _pd0Codec.GoodEnsembleEvent        += ReceivedGoodEnsembleEvent;
            _pd0Codec.BadEnsembleEvent         += ReceivedBadEnsembleEvent;

            // PD6 and PD13 Codec
            _pd6_13Codec = new Pd6_13Codec();
            _pd6_13Codec.ProcessDataEvent         += new Pd6_13Codec.ProcessDataEventHandler(_pd6_13Codec_ProcessDataEvent);
            _pd6_13Codec.ProcessDataCompleteEvent += pd6_13Codec_ProcessDataCompleteEvent;

            // PD4 and PD5 Codec
            _pd4_5Codec = new PD4_5Codec();
            _pd4_5Codec.ProcessDataEvent         += new PD4_5Codec.ProcessDataEventHandler(_pd4_5Codec_ProcessDataEvent);
            _pd4_5Codec.ProcessDataCompleteEvent += pd4_5Codec_ProcessDataCompleteEvent;
        }
Ejemplo n.º 2
0
        public void TestPrti02()
        {
            string nmea = "$PRTI02,1000,8,1464,-1205,-24,-347,79380,300,-200,400,100,0000*22";

            //CurrentDataSetManager.Instance.ReceiveRecordDataset += new CurrentDataSetManager.RecordDatasetEventHandler(ReceiveMsg02);

            AdcpDvlCodec codec = new AdcpDvlCodec();
            codec.ProcessDataEvent += new AdcpDvlCodec.ProcessDataEventHandler(ReceiveMsg02);
            codec.AddIncomingData(System.Text.Encoding.ASCII.GetBytes(nmea));
            codec.Dispose();                                                           // Clear the remaining data

            _eventWaitResponse.WaitOne(TIMEOUT);

            Assert.IsNotNull(recvData02, "Message was not received.");

            // Check if Ensemble data set available
            Assert.AreEqual(true, recvData02.IsEnsembleAvail, "Ensemble Data Set not available");
            Assert.AreEqual(8, recvData02.EnsembleData.EnsembleNumber, "Ensemble number is incorrect");

            // Check number of beams
            Assert.AreEqual(DataSet.Ensemble.DEFAULT_NUM_BEAMS_BEAM, recvData02.EnsembleData.NumBeams, "Number of beams is Incorrect");
            Assert.AreEqual(DataSet.Ensemble.DEFAULT_NUM_BEAMS_NONBEAM, recvData02.EnsembleData.ElementsMultiplier, "Element Multiplier is Incorrect");

            // Check number of bins
            Assert.AreEqual(0, recvData02.EnsembleData.NumBins);

            // Check time
            Assert.AreEqual(DateTime.Now.Hour, recvBad.EnsembleData.EnsDateTime.Hour, "Incorrect Ensemble time in Hours " + recvBad.EnsembleData.EnsDateTime.ToString());
            Assert.AreEqual(DateTime.Now.Minute, recvBad.EnsembleData.EnsDateTime.Minute, "Incorrect Ensemble time in Minutes " + recvBad.EnsembleData.EnsDateTime.ToString());
            Assert.AreEqual(DateTime.Now.Second, recvBad.EnsembleData.EnsDateTime.Second, "Incorrect Ensemble time in Seconds " + recvBad.EnsembleData.EnsDateTime.ToString());
            //Assert.AreEqual(DateTime.Now.Millisecond, recvBad.EnsembleData.EnsDateTime.Millisecond, "Incorrece Ensemble time in Milliseconds " + recvBad.EnsembleData.EnsDateTime.ToString());

            // Check Ancillary data set available
            Assert.AreEqual(true, recvData02.IsAncillaryAvail, "Ancillary Data Set not available");

            // Check Tempearture
            Assert.AreEqual(14.64, recvData02.AncillaryData.WaterTemp, 0.00001, "Water Temperature was incorrect");

            Assert.AreEqual(0, recvData02.AncillaryData.FirstBinRange, "First Bin Range was incorrect");
            Assert.AreEqual(0, recvData02.AncillaryData.BinSize, "Bin Size was incorrect");
            Assert.AreEqual(0, recvData02.AncillaryData.FirstPingTime, "First Ping Time was incorrect");
            Assert.AreEqual(10, recvData02.AncillaryData.LastPingTime, "Last Ping Time was incorrect");
            Assert.AreEqual(0, recvData02.AncillaryData.Heading, "Heading was incorrect");
            Assert.AreEqual(0, recvData02.AncillaryData.Pitch, "Pitch was incorrect");
            Assert.AreEqual(0, recvData02.AncillaryData.Roll, "Roll was incorrect");
            Assert.AreEqual(0, recvData02.AncillaryData.SystemTemp, "System Temp was incorrect");
            Assert.AreEqual(0, recvData02.AncillaryData.Salinity, "Salinity was incorrect");
            Assert.AreEqual(0, recvData02.AncillaryData.Pressure, "Pressure was incorrect");
            Assert.AreEqual(0, recvData02.AncillaryData.TransducerDepth, "Transducer Depth was incorrect");
            Assert.AreEqual(0, recvData02.AncillaryData.SpeedOfSound, "Speed Of Sound was incorrect");

            Assert.AreEqual(true, recvData02.IsBottomTrackAvail, "Bottom Track DataSet not added");

            Assert.AreEqual(new DotSpatial.Positioning.Distance("79380 mm").ToMeters().Value, recvData02.BottomTrackData.Range[0], 0.00001, "Bottom Track Range B1 incorrect");
            Assert.AreEqual(new DotSpatial.Positioning.Distance("79380 mm").ToMeters().Value, recvData02.BottomTrackData.Range[1], 0.00001, "Bottom Track Range B2 incorrect");
            Assert.AreEqual(new DotSpatial.Positioning.Distance("79380 mm").ToMeters().Value, recvData02.BottomTrackData.Range[2], 0.00001, "Bottom Track Range B3 incorrect");
            Assert.AreEqual(new DotSpatial.Positioning.Distance("79380 mm").ToMeters().Value, recvData02.BottomTrackData.Range[3], 0.00001, "Bottom Track Range B4 incorrect");

            Assert.AreNotEqual(DataSet.Ensemble.BAD_VELOCITY, recvData02.BottomTrackData.EarthVelocity[0], "Bottom Track Earth Velocity East incorrect");
            Assert.AreNotEqual(DataSet.Ensemble.BAD_VELOCITY, recvData02.BottomTrackData.EarthVelocity[1], "Bottom Track Earth Velocity North incorrect");
            Assert.AreNotEqual(DataSet.Ensemble.BAD_VELOCITY, recvData02.BottomTrackData.EarthVelocity[2], "Bottom Track Earth Velocity Vertical incorrect");
            Assert.AreEqual(0, recvData02.BottomTrackData.EarthVelocity[3], "Bottom Track Earth Velocity Q incorrect");

            Assert.AreEqual(Convert.ToSingle(new DotSpatial.Positioning.Speed("-1205 mm/s").ToMetersPerSecond().Value), recvData02.BottomTrackData.EarthVelocity[0], "Bottom Track Earth Velocity East incorrect");
            Assert.AreEqual(Convert.ToSingle(new DotSpatial.Positioning.Speed("-24 mm/s").ToMetersPerSecond().Value), recvData02.BottomTrackData.EarthVelocity[1], "Bottom Track Earth Velocity North incorrect");
            Assert.AreEqual(Convert.ToSingle(new DotSpatial.Positioning.Speed("-347 mm/s").ToMetersPerSecond().Value), recvData02.BottomTrackData.EarthVelocity[2], "Bottom Track Earth Velocity Vertical incorrect");

            Assert.IsTrue(recvData02.IsEarthWaterMassAvail, "Earth Water Mass not added to dataset");

            Assert.AreEqual(recvData02.EarthWaterMassData.VelocityEast, (new DotSpatial.Positioning.Speed(300, DotSpatial.Positioning.SpeedUnit.MillimetersPerSecond)).ToMetersPerSecond().Value, 0.00001, "Earth Water Mass East not properly set.");
            Assert.AreEqual(recvData02.EarthWaterMassData.VelocityNorth, (new DotSpatial.Positioning.Speed(-200, DotSpatial.Positioning.SpeedUnit.MillimetersPerSecond)).ToMetersPerSecond().Value, 0.00001, "Earth Water Mass North not properly set.");
            Assert.AreEqual(recvData02.EarthWaterMassData.VelocityVertical, (new DotSpatial.Positioning.Speed(400, DotSpatial.Positioning.SpeedUnit.MillimetersPerSecond)).ToMetersPerSecond().Value, 0.00001, "Earth Water Mass Vertical not properly set.");
            Assert.AreEqual(recvData02.EarthWaterMassData.WaterMassDepthLayer, (new DotSpatial.Positioning.Distance(100, DotSpatial.Positioning.DistanceUnit.Millimeters)).ToMeters().Value, 0.00001, "Earth Water Mass Depth Layer not properly set.");

            Assert.AreEqual(0000, recvData02.BottomTrackData.Status.Value, "Bottom Track Instrument Status incorrect");
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Initialize all the codecs.
        /// </summary>
        public AdcpCodec()
        {
            // Counters
            _binaryCounter = 0;
            _dvlCounter = 0;
            _pd0Counter = 0;
            _pd6_13Counter = 0;
            _pd4_5Counter = 0;

            // Binary Codecs
            _binaryCodec = new AdcpBinaryCodec();
            _binaryCodec.ProcessDataEvent += new AdcpBinaryCodec.ProcessDataEventHandler(_binaryCodec_ProcessDataEvent);
            _binaryCodec.ProcessDataCompleteEvent += binaryCodec_ProcessDataCompleteEvent;

            // DVL Codec
            _dvlCodec = new AdcpDvlCodec();
            _dvlCodec.ProcessDataEvent += new AdcpDvlCodec.ProcessDataEventHandler(_dvlCodec_ProcessDataEvent);
            _dvlCodec.ProcessDataCompleteEvent += dvlCodec_ProcessDataCompleteEvent;

            // PD0 Codec
            _pd0Codec = new Pd0Codec();
            _pd0Codec.ProcessDataEvent += new Pd0Codec.ProcessDataEventHandler(_pd0Codec_ProcessDataEvent);
            _pd0Codec.ProcessDataCompleteEvent += pd0Codec_ProcessDataCompleteEvent;

            // PD6 and PD13 Codec
            _pd6_13Codec = new Pd6_13Codec();
            _pd6_13Codec.ProcessDataEvent += new Pd6_13Codec.ProcessDataEventHandler(_pd6_13Codec_ProcessDataEvent);
            _pd6_13Codec.ProcessDataCompleteEvent += pd6_13Codec_ProcessDataCompleteEvent;

            // PD4 and PD5 Codec
            _pd4_5Codec = new PD4_5Codec();
            _pd4_5Codec.ProcessDataEvent += new PD4_5Codec.ProcessDataEventHandler(_pd4_5Codec_ProcessDataEvent);
            _pd4_5Codec.ProcessDataCompleteEvent += pd4_5Codec_ProcessDataCompleteEvent;
        }
Ejemplo n.º 4
0
        public void TestPrti01Incomplete()
        {
            string nmea = "$PRTI01,380250,9,1464,-1205,";
            recvData1 = null;

            //CurrentDataSetManager.Instance.ReceiveRecordDataset += new CurrentDataSetManager.RecordDatasetEventHandler(ReceiveMsgIncomplete);

            AdcpDvlCodec codec = new AdcpDvlCodec();
            codec.ProcessDataEvent += new AdcpDvlCodec.ProcessDataEventHandler(ReceiveMsgIncomplete);
            codec.AddIncomingData(System.Text.Encoding.ASCII.GetBytes(nmea));

            string nmea1 = "-24,-347,79380,,,,,0000*04";
            codec.AddIncomingData(System.Text.Encoding.ASCII.GetBytes(nmea1));
            codec.Dispose();

            _eventWaitResponse.WaitOne(TIMEOUT);

            // Check if the ensemble could be created
            Assert.IsNotNull(recvData1, "Data was not processed");
        }
Ejemplo n.º 5
0
        public void TestNmeaMultiple()
        {
            string nmea0 = "$PRTI01,379550,1,1468,-99999,-99999,-99999,0,,,,,0004*09";
            string nmea00 = "$PRTI02,379550,1,1468,-99999,-99999,-99999,0,,,,,0004*0A";
            string nmea1 = "$PRTI01,380250,8,1464,-1205,-24,-347,79380,,,,,0000*05";
            string nmea2 = "$PRTI02,380250,8,1464,1142,323,407,79380,,,,,0000*1C";

            recvNmeaMultiple = null;

            AdcpDvlCodec codec = new AdcpDvlCodec();
            codec.ProcessDataEvent += new AdcpDvlCodec.ProcessDataEventHandler(ReceiveNmeaMultiple);
            codec.AddIncomingData(System.Text.Encoding.ASCII.GetBytes(nmea0));
            codec.AddIncomingData(System.Text.Encoding.ASCII.GetBytes(nmea00));
            codec.AddIncomingData(System.Text.Encoding.ASCII.GetBytes(nmea1));
            codec.AddIncomingData(System.Text.Encoding.ASCII.GetBytes(nmea2));
            codec.Dispose();                                                       // Clear remaining data

            _eventWaitResponse.WaitOne(TIMEOUT);

            Assert.IsNotNull(recvNmeaCombineSeperate, "CombinedSeperated message was not received.");

            // Check if Ensemble data set available
            Assert.AreEqual(true, recvNmeaCombineSeperate.IsEnsembleAvail, "Ensemble Data Set not available");
            Assert.AreEqual(8, recvNmeaCombineSeperate.EnsembleData.EnsembleNumber, "Ensemble number is incorrect");

            Assert.AreEqual(Convert.ToSingle(new DotSpatial.Positioning.Speed("-1205 mm/s").ToMetersPerSecond().Value), recvNmeaMultiple.BottomTrackData.InstrumentVelocity[0], "Bottom Track Instrument Velocity X incorrect");
            Assert.AreEqual(Convert.ToSingle(new DotSpatial.Positioning.Speed("-24 mm/s").ToMetersPerSecond().Value), recvNmeaMultiple.BottomTrackData.InstrumentVelocity[1], "Bottom Track Instrument Velocity Y incorrect");
            Assert.AreEqual(Convert.ToSingle(new DotSpatial.Positioning.Speed("-347 mm/s").ToMetersPerSecond().Value), recvNmeaMultiple.BottomTrackData.InstrumentVelocity[2], "Bottom Track Instrument Velocity Z incorrect");
            Assert.AreEqual(Convert.ToSingle(new DotSpatial.Positioning.Speed("1142 mm/s").ToMetersPerSecond().Value), recvNmeaMultiple.BottomTrackData.EarthVelocity[0], "Bottom Track Earth Velocity East incorrect");
            Assert.AreEqual(Convert.ToSingle(new DotSpatial.Positioning.Speed("323 mm/s").ToMetersPerSecond().Value), recvNmeaMultiple.BottomTrackData.EarthVelocity[1], "Bottom Track Earth Velocity North incorrect");
            Assert.AreEqual(Convert.ToSingle(new DotSpatial.Positioning.Speed("407 mm/s").ToMetersPerSecond().Value), recvNmeaMultiple.BottomTrackData.EarthVelocity[2], "Bottom Track Earth Velocity Up incorrect");
        }
Ejemplo n.º 6
0
        public void TestNmeaCombine()
        {
            string nmea1 = "$PRTI01,379550,1,1468,-99999,-99999,-99999,0,,,,,0004*0$PRTI02,379550,1,1468,-99999,-99999,-99999,0,,,,,0004*0A";

            recvNmeaCombine = null;

            AdcpDvlCodec codec = new AdcpDvlCodec();
            codec.ProcessDataEvent += new AdcpDvlCodec.ProcessDataEventHandler(ReceiveNmeaCombine);
            codec.AddIncomingData(System.Text.Encoding.ASCII.GetBytes(nmea1));
            codec.Dispose();

            _eventWaitResponse.WaitOne(TIMEOUT);

            Assert.IsNotNull(recvNmeaCombine, "Combined message was not received.");

            // Check if Ensemble data set available
            Assert.AreEqual(true, recvNmeaCombine.IsEnsembleAvail, "Ensemble Data Set not available");
            Assert.AreEqual(1, recvNmeaCombine.EnsembleData.EnsembleNumber, "Ensemble number is incorrect");
            Assert.IsFalse(recvNmeaCombine.IsInstrumentVelocityAvail, "Instrument Velocity should not be included");

            Assert.AreEqual(DataSet.Ensemble.BAD_VELOCITY, recvNmeaCombine.BottomTrackData.EarthVelocity[0], "Bottom Track Earth Velocity East incorrect");
            Assert.AreEqual(DataSet.Ensemble.BAD_VELOCITY, recvNmeaCombine.BottomTrackData.EarthVelocity[1], "Bottom Track Earth Velocity North incorrect");
            Assert.AreEqual(DataSet.Ensemble.BAD_VELOCITY, recvNmeaCombine.BottomTrackData.EarthVelocity[2], "Bottom Track Earth Velocity Up incorrect");
        }
Ejemplo n.º 7
0
        public void TestMaxBufferSize()
        {
            string badNmea = "This is a a bad nmea string.";
            string goodNmea = "$PRTI01,1000,10,1464,-1205,-24,-347,79380,,,,,0000*31";
            recvData1 = null;

            AdcpDvlCodec codec = new AdcpDvlCodec();
            codec.ProcessDataEvent += new AdcpDvlCodec.ProcessDataEventHandler(ReceiveMsgMaxBuffSize);

            // Send a lot of bad data and ensure the buffer does not get to large
            // Should debug with breakpoints to verify.
            // Compile code in debug mode
            // Attach NUnit-agent-x86.exe
            // Then run the test and breakpoints will be hit
            // Breakpoint when data is sent to event and verify the buffer is empty
            for (int x = 0; x < 500; x++)
            {
                codec.AddIncomingData(System.Text.Encoding.ASCII.GetBytes(badNmea));
            }
            codec.AddIncomingData(System.Text.Encoding.ASCII.GetBytes(goodNmea));
            codec.Dispose();                                                           // Clear the remaining data

            _eventWaitResponse.WaitOne(TIMEOUT);

            Assert.IsNotNull(recvMaxBuffSize, "Message was not received.");

            // Check if Ensemble data set available
            Assert.AreEqual(true, recvMaxBuffSize.IsEnsembleAvail, "Ensemble Data Set not available");
            Assert.AreEqual(10, recvMaxBuffSize.EnsembleData.EnsembleNumber, "Ensemble number is incorrect");

            // Check number of beams
            Assert.AreEqual(DataSet.Ensemble.DEFAULT_NUM_BEAMS_BEAM, recvMaxBuffSize.EnsembleData.NumBeams, "Number of beams is Incorrect");
            Assert.AreEqual(DataSet.Ensemble.DEFAULT_NUM_BEAMS_NONBEAM, recvMaxBuffSize.EnsembleData.ElementsMultiplier, "Element Multiplier is Incorrect");

            // Check number of bins
            Assert.AreEqual(0, recvMaxBuffSize.EnsembleData.NumBins);

            // Check time
            Assert.AreEqual(DateTime.Now.Hour, recvBad.EnsembleData.EnsDateTime.Hour, "Incorrect Ensemble time in Hours " + recvBad.EnsembleData.EnsDateTime.ToString());
            Assert.AreEqual(DateTime.Now.Minute, recvBad.EnsembleData.EnsDateTime.Minute, "Incorrect Ensemble time in Minutes " + recvBad.EnsembleData.EnsDateTime.ToString());
            Assert.AreEqual(DateTime.Now.Second, recvBad.EnsembleData.EnsDateTime.Second, "Incorrect Ensemble time in Seconds " + recvBad.EnsembleData.EnsDateTime.ToString());
            //Assert.AreEqual(DateTime.Now.Millisecond, recvBad.EnsembleData.EnsDateTime.Millisecond, "Incorrece Ensemble time in Milliseconds " + recvBad.EnsembleData.EnsDateTime.ToString());

            // Check Ancillary data set available
            Assert.AreEqual(true, recvMaxBuffSize.IsAncillaryAvail, "Ancillary Data Set not available");

            // Check Tempearture
            Assert.AreEqual(14.64, recvMaxBuffSize.AncillaryData.WaterTemp, 0.00001, "Water Temperature was incorrect");

            Assert.AreEqual(0, recvMaxBuffSize.AncillaryData.FirstBinRange, "First Bin Range was incorrect");
            Assert.AreEqual(0, recvMaxBuffSize.AncillaryData.BinSize, "Bin Size was incorrect");
            Assert.AreEqual(0, recvMaxBuffSize.AncillaryData.FirstPingTime, "First Ping Time was incorrect");
            Assert.AreEqual(10, recvMaxBuffSize.AncillaryData.LastPingTime, "Last Ping Time was incorrect");
            Assert.AreEqual(0, recvMaxBuffSize.AncillaryData.Heading, "Heading was incorrect");
            Assert.AreEqual(0, recvMaxBuffSize.AncillaryData.Pitch, "Pitch was incorrect");
            Assert.AreEqual(0, recvMaxBuffSize.AncillaryData.Roll, "Roll was incorrect");
            Assert.AreEqual(0, recvMaxBuffSize.AncillaryData.SystemTemp, "System Temp was incorrect");
            Assert.AreEqual(0, recvMaxBuffSize.AncillaryData.Salinity, "Salinity was incorrect");
            Assert.AreEqual(0, recvMaxBuffSize.AncillaryData.Pressure, "Pressure was incorrect");
            Assert.AreEqual(0, recvMaxBuffSize.AncillaryData.TransducerDepth, "Transducer Depth was incorrect");
            Assert.AreEqual(0, recvMaxBuffSize.AncillaryData.SpeedOfSound, "Speed Of Sound was incorrect");

            Assert.AreEqual(true, recvMaxBuffSize.IsBottomTrackAvail, "Bottom Track DataSet not added");

            Assert.AreEqual(new DotSpatial.Positioning.Distance("79380 mm").ToMeters().Value, recvMaxBuffSize.BottomTrackData.Range[0], 0.00001, "Bottom Track Range B1 incorrect");
            Assert.AreEqual(new DotSpatial.Positioning.Distance("79380 mm").ToMeters().Value, recvMaxBuffSize.BottomTrackData.Range[1], 0.00001, "Bottom Track Range B2 incorrect");
            Assert.AreEqual(new DotSpatial.Positioning.Distance("79380 mm").ToMeters().Value, recvMaxBuffSize.BottomTrackData.Range[2], 0.00001, "Bottom Track Range B3 incorrect");
            Assert.AreEqual(new DotSpatial.Positioning.Distance("79380 mm").ToMeters().Value, recvMaxBuffSize.BottomTrackData.Range[3], 0.00001, "Bottom Track Range B4 incorrect");

            Assert.AreNotEqual(DataSet.Ensemble.BAD_VELOCITY, recvMaxBuffSize.BottomTrackData.InstrumentVelocity[0], "Bottom Track Instrument Velocity X incorrect");
            Assert.AreNotEqual(DataSet.Ensemble.BAD_VELOCITY, recvMaxBuffSize.BottomTrackData.InstrumentVelocity[1], "Bottom Track Instrument Velocity Y incorrect");
            Assert.AreNotEqual(DataSet.Ensemble.BAD_VELOCITY, recvMaxBuffSize.BottomTrackData.InstrumentVelocity[2], "Bottom Track Instrument Velocity Z incorrect");
            Assert.AreEqual(0, recvMaxBuffSize.BottomTrackData.InstrumentVelocity[3], "Bottom Track Instrument Velocity Q incorrect");

            Assert.AreEqual(Convert.ToSingle(new DotSpatial.Positioning.Speed("-1205 mm/s").ToMetersPerSecond().Value), recvMaxBuffSize.BottomTrackData.InstrumentVelocity[0], "Bottom Track Instrument Velocity X incorrect");
            Assert.AreEqual(Convert.ToSingle(new DotSpatial.Positioning.Speed("-24 mm/s").ToMetersPerSecond().Value), recvMaxBuffSize.BottomTrackData.InstrumentVelocity[1], "Bottom Track Instrument Velocity Y incorrect");
            Assert.AreEqual(Convert.ToSingle(new DotSpatial.Positioning.Speed("-347 mm/s").ToMetersPerSecond().Value), recvMaxBuffSize.BottomTrackData.InstrumentVelocity[2], "Bottom Track Instrument Velocity Z incorrect");

            Assert.AreEqual(0000, recvMaxBuffSize.BottomTrackData.Status.Value, "Bottom Track Instrument Status incorrect");
        }
Ejemplo n.º 8
0
        public void TestBadNmea()
        {
            string badNmea = "CBTTBP 0.5\r\nCWTON 0\r\nCWTBB 1\r\nCWTBL 8\r\nCWTBS 8\r\nCWTTBP 1\r\nCWS 0\r\nCWT 15\r\nCTD 0\r\nCWSS 1500\r\nCHS 1\r\nCHO 0";
            string badNmea1 = "\r\nC232B 19200\r\nC485B 115200\r\nSTART\r\n$PRTI01,379550,1,1468,-99999,-99999,-99999,0,,,,,0004*09";

            recvBadNmea = null;

            AdcpDvlCodec codec = new AdcpDvlCodec();
            codec.ProcessDataEvent += new AdcpDvlCodec.ProcessDataEventHandler(ReceiveBadNmea);
            codec.AddIncomingData(System.Text.Encoding.ASCII.GetBytes(badNmea));
            codec.AddIncomingData(System.Text.Encoding.ASCII.GetBytes(badNmea1));
            codec.Dispose();                                                           // Clear the remaining data

            _eventWaitResponse.WaitOne(TIMEOUT);

            Assert.IsNotNull(recvBadNmea, "Message was not received.");

            // Check if Ensemble data set available
            Assert.AreEqual(true, recvBadNmea.IsEnsembleAvail, "Ensemble Data Set not available");
            Assert.AreEqual(1, recvBadNmea.EnsembleData.EnsembleNumber, "Ensemble number is incorrect");
        }