/// <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 SA messages. /// </summary> /// <param name="sentence">Message with the SA data.</param> private void SetSA(string sentence) { _prevSA = new SA(sentence); // Add DVL DataSet _prevEns.DvlData.Heading = _prevSA.Heading; _prevEns.DvlData.Pitch = _prevSA.Pitch; _prevEns.DvlData.Roll = _prevSA.Roll; // Add Ancillary DataSet if (!_prevEns.IsAncillaryAvail) { _prevEns.AncillaryData = new DataSet.AncillaryDataSet(); _prevEns.IsAncillaryAvail = true; } _prevEns.AncillaryData.Heading = _prevSA.Heading; _prevEns.AncillaryData.Pitch = _prevSA.Pitch; _prevEns.AncillaryData.Roll = _prevSA.Roll; // Add Bottom Track DataSet if (!_prevEns.IsBottomTrackAvail) { _prevEns.BottomTrackData = new DataSet.BottomTrackDataSet(); _prevEns.IsBottomTrackAvail = true; } _prevEns.BottomTrackData.Heading = _prevSA.Heading; _prevEns.BottomTrackData.Pitch = _prevSA.Pitch; _prevEns.BottomTrackData.Roll = _prevSA.Roll; }
/// <summary> /// Set the data sets for the SA messages. /// </summary> /// <param name="sentence">Message with the SA data.</param> private void SetSA(string sentence) { // Verify byte count if(sentence.Count(x => x == ',') != SA.NUM_ELEM-1) { return; } var sa = new SA(sentence); if(sa != null) { // Add DVL dataset if (_prevEns.DvlData == null) { _prevEns.DvlData = new DataSet.DvlDataSet(); _prevEns.IsDvlDataAvail = true; } _prevEns.DvlData.Heading = sa.Heading; _prevEns.DvlData.Pitch = sa.Pitch; _prevEns.DvlData.Roll = sa.Roll; // Add Ancillary DataSet if (!_prevEns.IsAncillaryAvail) { _prevEns.AncillaryData = new DataSet.AncillaryDataSet(); _prevEns.IsAncillaryAvail = true; } _prevEns.AncillaryData.Heading = sa.Heading; _prevEns.AncillaryData.Pitch = sa.Pitch; _prevEns.AncillaryData.Roll = sa.Roll; // Add Bottom Track DataSet if (!_prevEns.IsBottomTrackAvail) { _prevEns.BottomTrackData = new DataSet.BottomTrackDataSet(); _prevEns.IsBottomTrackAvail = true; } _prevEns.BottomTrackData.Heading = sa.Heading; _prevEns.BottomTrackData.Pitch = sa.Pitch; _prevEns.BottomTrackData.Roll = sa.Roll; } // Set the value _prevSA = sa; }