Beispiel #1
0
        public void TestReserved82_85Decode()
        {
            Pd0BottomTrack bt = new Pd0BottomTrack();

            byte[] data = new byte[Pd0BottomTrack.DATATYPE_SIZE];

            // Decode the data
            data[81] = 0x9B;
            data[82] = 0x0D;
            data[83] = 0x02;
            data[84] = 0x00;
            bt.Decode(data);
            Assert.AreEqual(134555, bt.Reserved82_85, "Reserved 82-85 Decode is incorrect.");
        }
Beispiel #2
0
        public void TestGainDecode()
        {
            Pd0BottomTrack bt = new Pd0BottomTrack();

            byte[] data = new byte[Pd0BottomTrack.DATATYPE_SIZE];

            // Decode the data
            data[76] = 0xF3;
            bt.Decode(data);
            Assert.AreEqual(243, bt.BtGain, "Gain Decode is incorrect.");
        }
Beispiel #3
0
        public void TestGetRangeBeam0()
        {
            Pd0BottomTrack bt = new Pd0BottomTrack();

            byte[] data = new byte[Pd0BottomTrack.DATATYPE_SIZE];

            // Decode the data
            data[16] = 0x39;                // LSB LSB
            data[17] = 0x30;                // LSB MSB (12345)
            data[77] = 0x4C;                // MSB (76)
            bt.Decode(data);

            // (76 * 65535 ) + 12345 = 4980736 + 12345 = 4993081

            Assert.AreEqual(4993005, bt.GetRangeBeam0(), "GetRangeBeam0() is incorrect.");
        }
Beispiel #4
0
        public void TestErrVelMaxDecode()
        {
            Pd0BottomTrack bt = new Pd0BottomTrack();

            byte[] data = new byte[Pd0BottomTrack.DATATYPE_SIZE];

            // Decode the data
            data[10] = 0xF3;
            data[11] = 0x02;
            bt.Decode(data);
            Assert.AreEqual(755, bt.BtErrVelMax, "Error Velocity Max Decode is incorrect.");
        }
Beispiel #5
0
        public void TestEvalAmpMinDecode()
        {
            Pd0BottomTrack bt = new Pd0BottomTrack();

            byte[] data = new byte[Pd0BottomTrack.DATATYPE_SIZE];

            // Decode the data
            data[7] = 0xF3;
            bt.Decode(data);
            Assert.AreEqual(243, bt.BtEvalAmpMin, "Evaluation Amplitude Minimum Decode is incorrect.");
        }
Beispiel #6
0
        public void TestCorrMagMinDecode()
        {
            Pd0BottomTrack bt = new Pd0BottomTrack();

            byte[] data = new byte[Pd0BottomTrack.DATATYPE_SIZE];

            // Decode the data
            data[6] = 0xF3;
            bt.Decode(data);
            Assert.AreEqual(243, bt.BtCorrMagMin, "Correlation Magnitude Minimum Decode is incorrect.");
        }
Beispiel #7
0
        public void TestDelayBeforeReacquireDecode()
        {
            Pd0BottomTrack bt = new Pd0BottomTrack();

            byte[] data = new byte[Pd0BottomTrack.DATATYPE_SIZE];

            // Decode the data
            data[4] = 0xF3;
            data[5] = 0x02;
            bt.Decode(data);
            Assert.AreEqual(755, bt.BtDelayBeforeReacquire, "Delay Before Reacquire Decode is incorrect.");
        }
Beispiel #8
0
        public void TestAmplitudeBeam3EncodeMin()
        {
            Pd0BottomTrack bt = new Pd0BottomTrack();

            bt.BtAmplitudeBeam3 = 0;
            byte[] data = bt.Encode();
            Assert.AreEqual(0x00, data[39], "Amplitude Beam 3 Min Encode is incorrect.");
        }
Beispiel #9
0
        public void TestVelocityBeam3Decode()
        {
            Pd0BottomTrack bt = new Pd0BottomTrack();

            byte[] data = new byte[Pd0BottomTrack.DATATYPE_SIZE];

            // Decode the data
            data[30] = 0xF3;
            data[31] = 0x02;
            bt.Decode(data);
            Assert.AreEqual(755, bt.BtVelocityBeam3, "Velocity Beam 3 Decode is incorrect.");
        }
Beispiel #10
0
        public void TestRSSIBeam3EncodeMax()
        {
            Pd0BottomTrack bt = new Pd0BottomTrack();

            bt.BtRssiBeam3 = 255 * 0.45f;
            byte[] data = bt.Encode();
            Assert.AreEqual(0xFF, data[75], "RSSI Beam 3 Max Encode is incorrect.");
        }
Beispiel #11
0
        public void TestRSSIBeam3EncodeMin()
        {
            Pd0BottomTrack bt = new Pd0BottomTrack();

            bt.BtRssiBeam3 = 0;
            byte[] data = bt.Encode();
            Assert.AreEqual(0x00, data[75], "RSSI Beam 3 Min Encode is incorrect.");
        }
Beispiel #12
0
        public void TestRSSIBeam3Decode()
        {
            Pd0BottomTrack bt = new Pd0BottomTrack();

            byte[] data = new byte[Pd0BottomTrack.DATATYPE_SIZE];

            // Decode the data
            data[75] = 0x4C;
            bt.Decode(data);
            Assert.AreEqual(76 * 0.45f, bt.BtRssiBeam3, "RSSI Beam 3 Decode is incorrect.");
        }
Beispiel #13
0
        public void TestRSSIBeam2Encode()
        {
            Pd0BottomTrack bt = new Pd0BottomTrack();

            bt.BtRssiBeam2 = 76 * 0.45f;
            byte[] data = bt.Encode();
            Assert.AreEqual(0x4C, data[74], "RSSI Beam 2 Encode is incorrect.");
        }
Beispiel #14
0
        public void TestReserved82_85Encode()
        {
            Pd0BottomTrack bt = new Pd0BottomTrack();

            bt.Reserved82_85 = 134555;
            byte[] data = bt.Encode();
            Assert.AreEqual(0x9B, data[81], "Reserved 82-85 Max LSB Encode is incorrect.");
            Assert.AreEqual(0x0D, data[82], "Reserved 82-85 Max     Encode is incorrect.");
            Assert.AreEqual(0x02, data[83], "Reserved 82-85 Max     Encode is incorrect.");
            Assert.AreEqual(0x00, data[84], "Reserved 82-85 Max MSB Encode is incorrect.");
        }
Beispiel #15
0
        public void TestCorrelationBeam3Decode()
        {
            Pd0BottomTrack bt = new Pd0BottomTrack();

            byte[] data = new byte[Pd0BottomTrack.DATATYPE_SIZE];

            // Decode the data
            data[35] = 0x4C;
            bt.Decode(data);
            Assert.AreEqual(76, bt.BtCorrelationMagnitudeBeam3, "Correlation Beam 3 Decode is incorrect.");
        }
Beispiel #16
0
        public void TestVelocityBeam3Encode()
        {
            Pd0BottomTrack bt = new Pd0BottomTrack();

            bt.BtVelocityBeam3 = 755;
            byte[] data = bt.Encode();
            Assert.AreEqual(0xF3, data[30], "Velocity Beam 3 LSB Encode is incorrect.");
            Assert.AreEqual(0x02, data[31], "Velocity Beam 3 MSB Encode is incorrect.");
        }
Beispiel #17
0
        public void TestCorrelationBeam3EncodeMax()
        {
            Pd0BottomTrack bt = new Pd0BottomTrack();

            bt.BtCorrelationMagnitudeBeam3 = 255;
            byte[] data = bt.Encode();
            Assert.AreEqual(0xFF, data[35], "Correlation Beam 3 Max Encode is incorrect.");
        }
Beispiel #18
0
        public void TestVelocityBeam3EncodeMax()
        {
            Pd0BottomTrack bt = new Pd0BottomTrack();

            bt.BtVelocityBeam3 = 32767;
            byte[] data = bt.Encode();
            Assert.AreEqual(0xFF, data[30], "Velocity Beam 3 LSB Max Encode is incorrect.");
            Assert.AreEqual(0x7F, data[31], "Velocity Beam 3 MSB Max Encode is incorrect.");
        }
Beispiel #19
0
        public void TestCorrMagMinEncodeMin()
        {
            Pd0BottomTrack bt = new Pd0BottomTrack();

            bt.BtCorrMagMin = 0;
            byte[] data = bt.Encode();
            Assert.AreEqual(0x00, data[6], "Correlation Magnitude MinimumMin Encode is incorrect.");
        }
Beispiel #20
0
        public void TestVelocityBeam3EncodeMin()
        {
            Pd0BottomTrack bt = new Pd0BottomTrack();

            bt.BtVelocityBeam3 = -32768;
            byte[] data = bt.Encode();
            Assert.AreEqual(0x00, data[30], "Velocity Beam 3 LSB Min Encode is incorrect.");
            Assert.AreEqual(0x80, data[31], "Velocity Beam 3 MSB Min Encode is incorrect.");
        }
Beispiel #21
0
        public void TestDelayBeforeReacquireEncodeMin()
        {
            Pd0BottomTrack bt = new Pd0BottomTrack();

            bt.BtDelayBeforeReacquire = 0;
            byte[] data = bt.Encode();
            Assert.AreEqual(0x00, data[4], "Delay Before Reacquire LSB Min Encode is incorrect.");
            Assert.AreEqual(0x00, data[5], "Delay Before Reacquire MSB Min Encode is incorrect.");
        }
Beispiel #22
0
        public void TestBtModeEncodeMin()
        {
            Pd0BottomTrack bt = new Pd0BottomTrack();

            bt.BtMode = 0;
            byte[] data = bt.Encode();
            Assert.AreEqual(0x00, data[9], "BT Mode Encode is incorrect.");
        }
Beispiel #23
0
        public void TestErrVelMaxEncodeMin()
        {
            Pd0BottomTrack bt = new Pd0BottomTrack();

            bt.BtErrVelMax = 0;
            byte[] data = bt.Encode();
            Assert.AreEqual(0x00, data[10], "Error Velocity Max LSB Min Encode is incorrect.");
            Assert.AreEqual(0x00, data[11], "Error Velocity Max MSB Min Encode is incorrect.");
        }
Beispiel #24
0
        public void TestConstructor()
        {
            Pd0BottomTrack bt = new Pd0BottomTrack();

            Assert.AreEqual(0, bt.BtPingsPerEnsemble, "Pings Per Ensemble is incorrect.");
            Assert.AreEqual(0, bt.BtDelayBeforeReacquire, "BtDelayBeforeReacquire is incorrect.");
            Assert.AreEqual(0, bt.BtCorrMagMin, "BtCorrMagMin is incorrect.");
            Assert.AreEqual(0, bt.BtEvalAmpMin, "BtEvalAmpMinis incorrect.");
            Assert.AreEqual(0, bt.BtPercentGoodMin, "BtPercentGoodMin is incorrect.");
            Assert.AreEqual(0, bt.BtMode, "BtMode is incorrect.");
            Assert.AreEqual(0, bt.BtErrVelMax, "BtErrVelMax is incorrect.");
            Assert.AreEqual(0, bt.Reserved13_16, "Reserved13_16 is incorrect.");
            Assert.AreEqual(0, bt.BtRangeLsbBeam0, "BtRangeLsbBeam0 is incorrect.");
            Assert.AreEqual(0, bt.BtRangeLsbBeam1, "BtRangeLsbBeam1 is incorrect.");
            Assert.AreEqual(0, bt.BtRangeLsbBeam2, "BtRangeLsbBeam2 is incorrect.");
            Assert.AreEqual(0, bt.BtRangeLsbBeam3, "BtRangeLsbBeam3 is incorrect.");
            Assert.AreEqual(0, bt.BtRangeMsbBeam0, "BtRangeMsbBeam0 is incorrect.");
            Assert.AreEqual(0, bt.BtRangeMsbBeam1, "BtRangeMsbBeam1 is incorrect.");
            Assert.AreEqual(0, bt.BtRangeMsbBeam2, "BtRangeMsbBeam2 is incorrect.");
            Assert.AreEqual(0, bt.BtRangeMsbBeam3, "BtRangeMsbBeam3 is incorrect.");
            Assert.AreEqual(0, bt.BtVelocityBeam0, "BtVelocityBeam0 is incorrect.");
            Assert.AreEqual(0, bt.BtVelocityBeam1, "BtVelocityBeam1 is incorrect.");
            Assert.AreEqual(0, bt.BtVelocityBeam2, "BtVelocityBeam2 is incorrect.");
            Assert.AreEqual(0, bt.BtVelocityBeam3, "BtVelocityBeam3 is incorrect.");
            Assert.AreEqual(0, bt.BtCorrelationMagnitudeBeam0, "BtCorrelationMagnitudeBeam0 is incorrect.");
            Assert.AreEqual(0, bt.BtCorrelationMagnitudeBeam1, "BtCorrelationMagnitudeBeam1 is incorrect.");
            Assert.AreEqual(0, bt.BtCorrelationMagnitudeBeam2, "BtCorrelationMagnitudeBeam2 is incorrect.");
            Assert.AreEqual(0, bt.BtCorrelationMagnitudeBeam3, "BtCorrelationMagnitudeBeam3 is incorrect.");
            Assert.AreEqual(0, bt.BtAmplitudeBeam0, "BtAmplitudeBeam0 is incorrect.");
            Assert.AreEqual(0, bt.BtAmplitudeBeam1, "BtAmplitudeBeam1 is incorrect.");
            Assert.AreEqual(0, bt.BtAmplitudeBeam2, "BtAmplitudeBeam2 is incorrect.");
            Assert.AreEqual(0, bt.BtAmplitudeBeam3, "BtAmplitudeBeam3 is incorrect.");
            Assert.AreEqual(0, bt.BtPercentGoodBeam0, "BtPercentGoodBeam0 is incorrect.");
            Assert.AreEqual(0, bt.BtPercentGoodBeam1, "BtPercentGoodBeam1 is incorrect.");
            Assert.AreEqual(0, bt.BtPercentGoodBeam2, "BtPercentGoodBeam2 is incorrect.");
            Assert.AreEqual(0, bt.BtPercentGoodBeam3, "BtPercentGoodBeam3 is incorrect.");
            Assert.AreEqual(0, bt.BtRefLayerMin, "BtRefLayerMin is incorrect.");
            Assert.AreEqual(0, bt.BtRefLayerNear, "BtRefLayerNear is incorrect.");
            Assert.AreEqual(0, bt.BtRefLayerFar, "BtRefLayerFar is incorrect.");
            Assert.AreEqual(0, bt.BtRefLayerVelocityBeam0, "BtRefLayerVelocityBeam0 is incorrect.");
            Assert.AreEqual(0, bt.BtRefLayerVelocityBeam1, "BtRefLayerVelocityBeam1 is incorrect.");
            Assert.AreEqual(0, bt.BtRefLayerVelocityBeam2, "BtRefLayerVelocityBeam2 is incorrect.");
            Assert.AreEqual(0, bt.BtRefLayerVelocityBeam3, "BtRefLayerVelocityBeam3 is incorrect.");
            Assert.AreEqual(0, bt.BtRefLayerCorrBeam0, "BtRefLayerCorrBeam0 is incorrect.");
            Assert.AreEqual(0, bt.BtRefLayerCorrBeam1, "BtRefLayerCorrBeam1 is incorrect.");
            Assert.AreEqual(0, bt.BtRefLayerCorrBeam2, "BtRefLayerCorrBeam2 is incorrect.");
            Assert.AreEqual(0, bt.BtRefLayerCorrBeam3, "BtRefLayerCorrBeam3 is incorrect.");
            Assert.AreEqual(0, bt.BtRefLayerEchoIntensityBeam0, "BtRefLayerEchoIntensityBeam0 is incorrect.");
            Assert.AreEqual(0, bt.BtRefLayerEchoIntensityBeam1, "BtRefLayerEchoIntensityBeam1 is incorrect.");
            Assert.AreEqual(0, bt.BtRefLayerEchoIntensityBeam2, "BtRefLayerEchoIntensityBeam2 is incorrect.");
            Assert.AreEqual(0, bt.BtRefLayerEchoIntensityBeam3, "BtRefLayerEchoIntensityBeam3 is incorrect.");
            Assert.AreEqual(0, bt.BtRefLayerPercentGoodBeam0, "BtRefLayerPercentGoodBeam0 is incorrect.");
            Assert.AreEqual(0, bt.BtRefLayerPercentGoodBeam1, "BtRefLayerPercentGoodBeam1 is incorrect.");
            Assert.AreEqual(0, bt.BtRefLayerPercentGoodBeam2, "BtRefLayerPercentGoodBeam2 is incorrect.");
            Assert.AreEqual(0, bt.BtRefLayerPercentGoodBeam3, "BtRefLayerPercentGoodBeam3 is incorrect.");
            Assert.AreEqual(80, bt.BtMaxDepth, "BtMaxDepth is incorrect.");
            Assert.AreEqual(0, bt.BtRssiBeam0, "BtRssiBeam0 is incorrect.");
            Assert.AreEqual(0, bt.BtRssiBeam1, "BtRssiBeam1 is incorrect.");
            Assert.AreEqual(0, bt.BtRssiBeam2, "BtRssiBeam2 is incorrect.");
            Assert.AreEqual(0, bt.BtRssiBeam3, "BtRssiBeam3 is incorrect.");
            Assert.AreEqual(0, bt.BtGain, "Gain is incorrect.");
            Assert.AreEqual(0, bt.Reserved82_85, "Reserved82_85 is incorrect.");
        }
Beispiel #25
0
        public void TestEvalAmpMinEncodeMin()
        {
            Pd0BottomTrack bt = new Pd0BottomTrack();

            bt.BtEvalAmpMin = 0;
            byte[] data = bt.Encode();
            Assert.AreEqual(0x00, data[7], "Evaluation Amplitude Minimum Encode is incorrect.");
        }
Beispiel #26
0
        public void DecodeRtiTest()
        {
            DataSet.BottomTrackDataSet rtiBT = new DataSet.BottomTrackDataSet(DataSet.Ensemble.DATATYPE_FLOAT,                 // Type of data stored (Float or Int)
                                                                            30,                                             // Number of bins
                                                                            4,                                              // Number of beams
                                                                            DataSet.Ensemble.DEFAULT_IMAG,                  // Default Image
                                                                            DataSet.Ensemble.DEFAULT_NAME_LENGTH,           // Default Image length
                                                                            DataSet.Ensemble.BottomTrackID);                // Dataset ID

            rtiBT.ActualPingCount = 5;
            rtiBT.Range[0] = 3450.99f;
            rtiBT.Range[1] = 1235.78f;
            rtiBT.Range[2] = 2345.23f;
            rtiBT.Range[3] = 3456.23f;
            rtiBT.SNR[0] = 23f;
            rtiBT.SNR[1] = 34f;
            rtiBT.SNR[2] = 45f;
            rtiBT.SNR[3] = 56f;
            rtiBT.Correlation[0] = 0.23f;
            rtiBT.Correlation[1] = 0.34f;
            rtiBT.Correlation[2] = 0.45f;
            rtiBT.Correlation[3] = 0.56f;
            rtiBT.EarthGood[0] = 5;
            rtiBT.EarthGood[1] = 5;
            rtiBT.EarthGood[2] = 2;
            rtiBT.EarthGood[3] = 5;
            rtiBT.Amplitude[0] = 23f;
            rtiBT.Amplitude[1] = 34f;
            rtiBT.Amplitude[2] = 45f;
            rtiBT.Amplitude[3] = 56f;

            Pd0BottomTrack bt = new Pd0BottomTrack(rtiBT, PD0.CoordinateTransforms.Coord_Beam);

            Assert.AreEqual(rtiBT.ActualPingCount, bt.BtPingsPerEnsemble, "Pings per Ensemble is incorrect.");
            Assert.AreEqual(0, bt.BtDelayBeforeReacquire, "Delay before reacquire is incorrect.");
            Assert.AreEqual(0, bt.BtCorrMagMin, "Correlation Magintude Min is incorrect.");
            Assert.AreEqual(0, bt.BtEvalAmpMin, "Evalation Amplitude Min is incorrect.");
            Assert.AreEqual(0, bt.BtPercentGoodMin, "Percent Good Min is incorrect.");
            Assert.AreEqual(0, bt.BtMode, "BT Mode is incorrect.");
            Assert.AreEqual(0, bt.BtErrVelMax, "Error Velocity Max is incorrect.");
            Assert.AreEqual(0, bt.Reserved13_16, "Reserved is incorrect.");
            Assert.AreEqual(5, bt.BtRangeMsbBeam3, "Range Beam 3 MSB is incorrect.");

            Assert.AreEqual(17424, bt.BtRangeLsbBeam3, "Range Beam 3 LSB is incorrect.");
            Assert.AreEqual(345099, bt.GetRangeBeam3(), "GetRangeBeam3 is incorrect.");
            Assert.AreEqual(1, bt.BtRangeMsbBeam2, "Range Beam 2 MSB is incorrect.");
            Assert.AreEqual(58043, bt.BtRangeLsbBeam2, "Range Beam 2 LSB is incorrect.");
            Assert.AreEqual(123578, bt.GetRangeBeam2(), "GetRangeBeam2 is incorrect.");
            Assert.AreEqual(3, bt.BtRangeMsbBeam0, "Range Beam 0 MSB is incorrect.");
            Assert.AreEqual(37918, bt.BtRangeLsbBeam0, "Range Beam 0 LSB is incorrect.");
            Assert.AreEqual(234523, bt.GetRangeBeam0(), "GetRangeBeam0 is incorrect.");
            Assert.AreEqual(5, bt.BtRangeMsbBeam1, "Range Beam 1 MSB is incorrect.");
            Assert.AreEqual(17948, bt.BtRangeLsbBeam1, "Range Beam 1 LSB is incorrect.");
            Assert.AreEqual(345623, bt.GetRangeBeam1(), "GetRangeBeam1 is incorrect.");

            Assert.AreEqual(112, bt.BtAmplitudeBeam0, "Amplitude Beam 0 is incorrect.");
            Assert.AreEqual(90, bt.BtAmplitudeBeam1, "Amplitude Beam 1 is incorrect.");
            Assert.AreEqual(46, bt.BtAmplitudeBeam2, "Amplitude Beam 2 is incorrect.");
            Assert.AreEqual(68, bt.BtAmplitudeBeam3, "Amplitude Beam 3 is incorrect.");

            Assert.AreEqual(143, bt.BtCorrelationMagnitudeBeam0, "Correlation Beam 0 is incorrect.");
            Assert.AreEqual(115, bt.BtCorrelationMagnitudeBeam1, "Correlation Beam 1 is incorrect.");
            Assert.AreEqual(59, bt.BtCorrelationMagnitudeBeam2, "Correlation Beam 2 is incorrect.");
            Assert.AreEqual(87, bt.BtCorrelationMagnitudeBeam3, "Correlation Beam 3 is incorrect.");

            Assert.AreEqual(100, bt.BtPercentGoodBeam0, "Percent Good Beam 0 is incorrect.");
            Assert.AreEqual(40, bt.BtPercentGoodBeam1, "Percent Good Beam 1 is incorrect.");
            Assert.AreEqual(100, bt.BtPercentGoodBeam2, "Percent Good Beam 2 is incorrect.");
            Assert.AreEqual(100, bt.BtPercentGoodBeam3, "Percent Good Beam 3 is incorrect.");

            Assert.AreEqual(112, bt.BtRssiBeam0, "RSSI Beam 0 is incorrect.");
            Assert.AreEqual(90, bt.BtRssiBeam1, "RSSI Beam 1 is incorrect.");
            Assert.AreEqual(46, bt.BtRssiBeam2, "RSSI Beam 2 is incorrect.");
            Assert.AreEqual(68, bt.BtRssiBeam3, "RSSI Beam 3 is incorrect.");

            Assert.AreEqual(1, bt.BtGain, "Gain is incorrect.");
            Assert.AreEqual(0, bt.Reserved82_85, "Reserved 82-85 is incorrect.");
        }
Beispiel #27
0
        public void TestGainEncodeMin()
        {
            Pd0BottomTrack bt = new Pd0BottomTrack();

            bt.BtGain = 0;
            byte[] data = bt.Encode();
            Assert.AreEqual(0x00, data[76], "Gain Encode is incorrect.");
        }
Beispiel #28
0
        public void TestCorrelationBeam2Encode()
        {
            Pd0BottomTrack bt = new Pd0BottomTrack();

            bt.BtCorrelationMagnitudeBeam2 = 76;
            byte[] data = bt.Encode();
            Assert.AreEqual(0x4C, data[34], "Correlation Beam 2 Encode is incorrect.");
        }
Beispiel #29
0
        public void DecodePd0Test()
        {
            Pd0BottomTrack pd0Bt = new Pd0BottomTrack();
            pd0Bt.BtPingsPerEnsemble = 5;

            pd0Bt.BtRangeLsbBeam0 = 17424;
            pd0Bt.BtRangeMsbBeam0 = 5;
            pd0Bt.BtRangeLsbBeam1 = 58043;
            pd0Bt.BtRangeMsbBeam1 = 1;
            pd0Bt.BtRangeLsbBeam2 = 37918;
            pd0Bt.BtRangeMsbBeam2 = 3;
            pd0Bt.BtRangeLsbBeam3 = 17948;
            pd0Bt.BtRangeMsbBeam3 = 5;

            pd0Bt.BtAmplitudeBeam0 = 112;                       // RTI Beam 2
            pd0Bt.BtAmplitudeBeam1 = 90;                        // RTI Beam 3
            pd0Bt.BtAmplitudeBeam2 = 46;                        // RTI Beam 1
            pd0Bt.BtAmplitudeBeam3 = 68;                        // RTI Beam 0

            pd0Bt.BtCorrelationMagnitudeBeam0 = 143;            // RTI Beam 2
            pd0Bt.BtCorrelationMagnitudeBeam1 = 115;            // RTI Beam 3
            pd0Bt.BtCorrelationMagnitudeBeam2 = 59;             // RTI Beam 1
            pd0Bt.BtCorrelationMagnitudeBeam3 = 87;             // RTI Beam 0

            pd0Bt.BtPercentGoodBeam0 = 100;
            pd0Bt.BtPercentGoodBeam1 = 100;
            pd0Bt.BtPercentGoodBeam2 = 40;
            pd0Bt.BtPercentGoodBeam3 = 100;

            pd0Bt.BtRssiBeam0 = 112;
            pd0Bt.BtRssiBeam1 = 90;
            pd0Bt.BtRssiBeam2 = 46;
            pd0Bt.BtRssiBeam3 = 68;

            DataSet.BottomTrackDataSet bt = new DataSet.BottomTrackDataSet();
            bt.DecodePd0Ensemble(pd0Bt, PD0.CoordinateTransforms.Coord_Earth, new Pd0VariableLeader());

            Assert.AreEqual(bt.ActualPingCount, pd0Bt.BtPingsPerEnsemble, "Pings per Ensemble is incorrect.");
            //Assert.AreEqual(0, bt.BtDelayBeforeReacquire, "Delay before reacquire is incorrect.");
            //Assert.AreEqual(0, bt.BtCorrMagMin, "Correlation Magintude Min is incorrect.");
            //Assert.AreEqual(0, bt.BtEvalAmpMin, "Evalation Amplitude Min is incorrect.");
            //Assert.AreEqual(0, bt.BtPercentGoodMin, "Percent Good Min is incorrect.");
            //Assert.AreEqual(0, bt.BtMode, "BT Mode is incorrect.");
            //Assert.AreEqual(0, bt.BtErrVelMax, "Error Velocity Max is incorrect.");
            //Assert.AreEqual(0, bt.Reserved13_16, "Reserved is incorrect.");

            Assert.AreEqual(3456.23f, bt.Range[0], "Range 0 is incorrect.");
            Assert.AreEqual(2345.23f, bt.Range[1], "Range 1 is incorrect.");
            Assert.AreEqual(3450.99f, bt.Range[2], "Range 2 is incorrect.");
            Assert.AreEqual(1235.78f, bt.Range[3], "Range 3 is incorrect.");

            Assert.AreEqual(23f, bt.SNR[0], "SNR Beam 0 is incorrect.");
            Assert.AreEqual(34f, bt.SNR[1], "SNR Beam 1 is incorrect.");
            Assert.AreEqual(45f, bt.SNR[2], "SNR Beam 2 is incorrect.");
            Assert.AreEqual(56f, bt.SNR[3], "SNR Beam 3 is incorrect.");

            Assert.AreEqual(0.23f, bt.Correlation[0], 0.1f, "Correlation Beam 0 is incorrect.");
            Assert.AreEqual(0.34f, bt.Correlation[1], 0.1f, "Correlation Beam 1 is incorrect.");
            Assert.AreEqual(0.45f, bt.Correlation[2], 0.1f, "Correlation Beam 2 is incorrect.");
            Assert.AreEqual(0.56f, bt.Correlation[3], 0.1f, "Correlation Beam 3 is incorrect.");

            Assert.AreEqual(2, bt.EarthGood[0], "Percent Good Beam 0 is incorrect.");
            Assert.AreEqual(5, bt.EarthGood[1], "Percent Good Beam 1 is incorrect.");
            Assert.AreEqual(5, bt.EarthGood[2], "Percent Good Beam 2 is incorrect.");
            Assert.AreEqual(5, bt.EarthGood[3], "Percent Good Beam 3 is incorrect.");

            Assert.AreEqual(23f, bt.Amplitude[0], "Amplitude Beam 0 is incorrect.");
            Assert.AreEqual(34f, bt.Amplitude[1], "Amplitude Beam 1 is incorrect.");
            Assert.AreEqual(45f, bt.Amplitude[2], "Amplitude Beam 2 is incorrect.");
            Assert.AreEqual(56f, bt.Amplitude[3], "Amplitude Beam 3 is incorrect.");

            //Assert.AreEqual(1, bt.BtGain, "Gain is incorrect.");
            //Assert.AreEqual(0, bt.Reserved82_85, "Reserved 82-85 is incorrect.");
        }
Beispiel #30
0
        public void TestReserved13_16Encode()
        {
            Pd0BottomTrack bt = new Pd0BottomTrack();

            bt.Reserved13_16 = 134555;
            byte[] data = bt.Encode();
            Assert.AreEqual(0x9B, data[12], "Reserved 13-16 Max LSB Encode is incorrect.");
            Assert.AreEqual(0x0D, data[13], "Reserved 13-16 Max     Encode is incorrect.");
            Assert.AreEqual(0x02, data[14], "Reserved 13-16 Max     Encode is incorrect.");
            Assert.AreEqual(0x00, data[15], "Reserved 13-16 Max MSB Encode is incorrect.");
        }