Exemple #1
0
 /// <summary>
 /// Reinitialize the values.
 /// </summary>
 private void Clear()
 {
     // Initialize all the sentences
     _prevSA = null;
     _prevTS = null;
     _prevRA = null;
     _prevWI = null;
     _prevWS = null;
     _prevWE = null;
     _prevWD = null;
     _prevBI = null;
     _prevBS = null;
     _prevBE = null;
     _prevBD = null;
     _prevEns = new DataSet.Ensemble();
     _count = 0;
 }
Exemple #2
0
        /// <summary>
        /// Set the data sets for the BE message.
        /// </summary>
        /// <param name="sentence">Message with the BE data.</param>
        private void SetBE(string sentence)
        {
            _prevBE = new BE(sentence);

            // Set DVL DataSet
            _prevEns.DvlData.BtEastVelocity = _prevBE.E;
            _prevEns.DvlData.BtNorthVelocity = _prevBE.N;
            _prevEns.DvlData.BtUpwardVelocity = _prevBE.U;
            _prevEns.DvlData.BtEarthIsGoodVelocity = _prevBE.IsGood;

            // Add Bottom Track DataSet
            if (!_prevEns.IsBottomTrackAvail)
            {
                _prevEns.BottomTrackData = new DataSet.BottomTrackDataSet();
                _prevEns.IsBottomTrackAvail = true;
            }
            _prevEns.BottomTrackData.InstrumentVelocity[DataSet.Ensemble.BEAM_EAST_INDEX] = _prevBE.E;
            _prevEns.BottomTrackData.InstrumentVelocity[DataSet.Ensemble.BEAM_NORTH_INDEX] = _prevBE.N;
            _prevEns.BottomTrackData.InstrumentVelocity[DataSet.Ensemble.BEAM_VERTICAL_INDEX] = _prevBE.U;
        }
Exemple #3
0
        /// <summary>
        /// Set the data sets for the BE message.
        /// </summary>
        /// <param name="sentence">Message with the BE data.</param>
        private void SetBE(string sentence)
        {
            // Verify byte count
            if (sentence.Count(x => x == ',') != BE.NUM_ELEM - 1)
            {
                return;
            }

            var be = new BE(sentence);

            if (be != null)
            {
                // Add DVL dataset
                if (_prevEns.DvlData == null)
                {
                    _prevEns.DvlData = new DataSet.DvlDataSet();
                    _prevEns.IsDvlDataAvail = true;
                }

                // Check for bad velocity
                // BtEastVelocity
                if (be.E == DataSet.Ensemble.BAD_VELOCITY || be.E == PD0.BAD_VELOCITY)
                {
                    _prevEns.DvlData.BtEastVelocity = DataSet.Ensemble.BAD_VELOCITY;
                }
                else
                {
                    _prevEns.DvlData.BtEastVelocity = be.E * 0.001f;
                }

                // BtNorthVelocity
                if (be.N == DataSet.Ensemble.BAD_VELOCITY || be.N == PD0.BAD_VELOCITY)
                {
                    _prevEns.DvlData.BtNorthVelocity = DataSet.Ensemble.BAD_VELOCITY;
                }
                else
                {
                    _prevEns.DvlData.BtNorthVelocity = be.N * 0.001f;
                }

                // BtUpwardVelocity
                if (be.U == DataSet.Ensemble.BAD_VELOCITY || be.U == PD0.BAD_VELOCITY)
                {
                    _prevEns.DvlData.BtUpwardVelocity = DataSet.Ensemble.BAD_VELOCITY;
                }
                else
                {
                    _prevEns.DvlData.BtUpwardVelocity = be.U * 0.001f;
                }

                _prevEns.DvlData.BtEarthIsGoodVelocity = be.IsGood;

                // Add Bottom Track DataSet
                if (!_prevEns.IsBottomTrackAvail)
                {
                    _prevEns.BottomTrackData = new DataSet.BottomTrackDataSet();
                    _prevEns.IsBottomTrackAvail = true;
                }
                _prevEns.BottomTrackData.EarthVelocity[DataSet.Ensemble.BEAM_EAST_INDEX] = _prevEns.DvlData.BtEastVelocity;
                _prevEns.BottomTrackData.EarthVelocity[DataSet.Ensemble.BEAM_NORTH_INDEX] = _prevEns.DvlData.BtNorthVelocity;
                _prevEns.BottomTrackData.EarthVelocity[DataSet.Ensemble.BEAM_VERTICAL_INDEX] = _prevEns.DvlData.BtUpwardVelocity;
            }

            _prevBE = be;
        }