/// <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; }
/// <summary> /// Set the data sets for the WE message. /// </summary> /// <param name="sentence">Message with the WE data.</param> private void SetWE(string sentence) { _prevWE = new WE(sentence); // Set DVL DataSet _prevEns.DvlData.WmEastVelocity = _prevWE.E; _prevEns.DvlData.WmNorthVelocity = _prevWE.N; _prevEns.DvlData.WmUpwardVelocity = _prevWE.U; _prevEns.DvlData.WmEarthIsGoodVelocity = _prevWE.IsGood; // Add Earth Water Mass DataSet if (!_prevEns.IsEarthWaterMassAvail) { _prevEns.EarthWaterMassData = new DataSet.EarthWaterMassDataSet(); _prevEns.IsEarthWaterMassAvail = true; } _prevEns.EarthWaterMassData.VelocityEast = _prevWE.E; _prevEns.EarthWaterMassData.VelocityNorth = _prevWE.N; _prevEns.EarthWaterMassData.VelocityVertical = _prevWE.U; }
/// <summary> /// Set the data sets for the WE message. /// </summary> /// <param name="sentence">Message with the WE data.</param> private void SetWE(string sentence) { // Verify byte count if (sentence.Count(x => x == ',') != WE.NUM_ELEM - 1) { return; } var we = new WE(sentence); if (we != null) { // Add DVL dataset if (_prevEns.DvlData == null) { _prevEns.DvlData = new DataSet.DvlDataSet(); _prevEns.IsDvlDataAvail = true; } // Check for bad velocity // WmEastVelocity if (we.E == DataSet.Ensemble.BAD_VELOCITY || we.E == PD0.BAD_VELOCITY) { _prevEns.DvlData.WmEastVelocity = DataSet.Ensemble.BAD_VELOCITY; } else { _prevEns.DvlData.WmEastVelocity = we.E * 0.001f; } // WmNorthVelocity if (we.N == DataSet.Ensemble.BAD_VELOCITY || we.N == PD0.BAD_VELOCITY) { _prevEns.DvlData.WmNorthVelocity = DataSet.Ensemble.BAD_VELOCITY; } else { _prevEns.DvlData.WmNorthVelocity = we.N * 0.001f; } // WmUpwardVelocity if (we.U == DataSet.Ensemble.BAD_VELOCITY || we.U == PD0.BAD_VELOCITY) { _prevEns.DvlData.WmUpwardVelocity = DataSet.Ensemble.BAD_VELOCITY; } else { _prevEns.DvlData.WmUpwardVelocity = we.U * 0.001f; } _prevEns.DvlData.WmEarthIsGoodVelocity = we.IsGood; // Add Earth Water Mass DataSet if (!_prevEns.IsEarthWaterMassAvail) { _prevEns.EarthWaterMassData = new DataSet.EarthWaterMassDataSet(); _prevEns.IsEarthWaterMassAvail = true; } _prevEns.EarthWaterMassData.VelocityEast = _prevEns.DvlData.WmEastVelocity; _prevEns.EarthWaterMassData.VelocityNorth = _prevEns.DvlData.WmNorthVelocity; _prevEns.EarthWaterMassData.VelocityVertical = _prevEns.DvlData.WmUpwardVelocity; } _prevWE = we; }