Example #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;
 }
Example #2
0
        /// <summary>
        /// Set the data sets for the WD message.
        /// </summary>
        /// <param name="sentence">Message with the WD data.</param>
        private void SetWD(string sentence)
        {
            _prevWD = new WD(sentence);

            // Set DVL DataSet
            _prevEns.DvlData.WmEastDistance = _prevWD.E;
            _prevEns.DvlData.WmNorthDistance = _prevWD.N;
            _prevEns.DvlData.WmUpwardDistance = _prevWD.U;
            _prevEns.DvlData.WmEarthRangeToWaterMassCenter = _prevWD.RangeToWmCenter;
            _prevEns.DvlData.WmEarthTimeLastGoodVel = _prevWD.Time;

            // Add Instrument Water Mass DataSet
            if (!_prevEns.IsInstrumentWaterMassAvail)
            {
                _prevEns.InstrumentWaterMassData = new DataSet.InstrumentWaterMassDataSet();
                _prevEns.IsInstrumentWaterMassAvail = true;
            }
            _prevEns.InstrumentWaterMassData.WaterMassDepthLayer = _prevWD.RangeToWmCenter;

            // Add Earth Water Mass DataSet
            if (!_prevEns.IsEarthWaterMassAvail)
            {
                _prevEns.EarthWaterMassData = new DataSet.EarthWaterMassDataSet();
                _prevEns.IsEarthWaterMassAvail = true;
            }
            _prevEns.EarthWaterMassData.WaterMassDepthLayer = _prevWD.RangeToWmCenter;
        }
Example #3
0
        /// <summary>
        /// Set the data sets for the WD message.
        /// </summary>
        /// <param name="sentence">Message with the WD data.</param>
        private void SetWD(string sentence)
        {
            // Verify byte count
            if (sentence.Count(x => x == ',') != WD.NUM_ELEM - 1)
            {
                return;
            }

            var wd = new WD(sentence);

            if (wd != null)
            {
                // Add DVL dataset
                if (_prevEns.DvlData == null)
                {
                    _prevEns.DvlData = new DataSet.DvlDataSet();
                    _prevEns.IsDvlDataAvail = true;
                }
                _prevEns.DvlData.WmEastDistance = wd.E;
                _prevEns.DvlData.WmNorthDistance = wd.N;
                _prevEns.DvlData.WmUpwardDistance = wd.U;
                _prevEns.DvlData.WmEarthRangeToWaterMassCenter = wd.RangeToWmCenter;
                _prevEns.DvlData.WmEarthTimeLastGoodVel = wd.Time;

                // Add Instrument Water Mass DataSet
                if (!_prevEns.IsInstrumentWaterMassAvail)
                {
                    _prevEns.InstrumentWaterMassData = new DataSet.InstrumentWaterMassDataSet();
                    _prevEns.IsInstrumentWaterMassAvail = true;
                }
                _prevEns.InstrumentWaterMassData.WaterMassDepthLayer = wd.RangeToWmCenter;

                // Add Earth Water Mass DataSet
                if (!_prevEns.IsEarthWaterMassAvail)
                {
                    _prevEns.EarthWaterMassData = new DataSet.EarthWaterMassDataSet();
                    _prevEns.IsEarthWaterMassAvail = true;
                }
                _prevEns.EarthWaterMassData.WaterMassDepthLayer = wd.RangeToWmCenter;
            }

            _prevWD = wd;
        }