public NmeaDataSet(List <string> NmeaStrings) : base(DataSet.Ensemble.DATATYPE_BYTE, 0, DataSet.Ensemble.DEFAULT_NUM_BEAMS_NONBEAM, DataSet.Ensemble.DEFAULT_IMAG, DataSet.Ensemble.DEFAULT_NAME_LENGTH, DataSet.Ensemble.NmeaID) { // Initialize all values GPGGA = null; GPVTG = null; GPRMC = null; PGRMF = null; GPGLL = null; GPGSV = null; GPGSA = null; GPHDT = null; // Initialized list if (NmeaStrings != null) { this.NmeaStrings = NmeaStrings; } else { NmeaStrings = new List <string>(); } // Decode the byte array for NMEA data DecodeNmeaData(NmeaStrings); }
/// <summary> /// Set any possible values for the given NMEA data. /// It will continue to replace /// the values so the last value is used as the final value. /// </summary> /// <param name="sentence">NMEA sentence containing data.</param> private void SetValues(NmeaSentence sentence) { /* * NMEA specification states that the first two letters of * a sentence may change. For example, for "$GPGSV" there may be variations such as * "$__GSV" where the first two letters change. As a result, we need only test the last three * characters. */ try { if (sentence.CommandWord.EndsWith("GGA", StringComparison.Ordinal)) { // Yes. Convert it using the fast pre-parseed constructor GPGGA = new GpggaSentence(sentence.Sentence); // Set the Lat and Lon and time } if (sentence.CommandWord.EndsWith("VTG", StringComparison.Ordinal)) { // Yes. Convert it using the fast pre-parseed constructor GPVTG = new GpvtgSentence(sentence.Sentence); } if (sentence.CommandWord.EndsWith("RMC", StringComparison.Ordinal)) { // Yes. Convert it using the fast pre-parseed constructor GPRMC = new GprmcSentence(sentence.Sentence); } if (sentence.CommandWord.EndsWith("RMF", StringComparison.Ordinal)) { // Yes. Convert it using the fast pre-parseed constructor PGRMF = new PgrmfSentence(sentence.Sentence); } if (sentence.CommandWord.EndsWith("GLL", StringComparison.Ordinal)) { // Yes. Convert it using the fast pre-parseed constructor GPGLL = new GpgllSentence(sentence.Sentence); } if (sentence.CommandWord.EndsWith("GSV", StringComparison.Ordinal)) { // Yes. Convert it using the fast pre-parseed constructor GPGSV = new GpgsvSentence(sentence.Sentence); } if (sentence.CommandWord.EndsWith("GSA", StringComparison.Ordinal)) { // Yes. Convert it using the fast pre-parseed constructor GPGSA = new GpgsaSentence(sentence.Sentence); } if (sentence.CommandWord.EndsWith("HDT", StringComparison.Ordinal)) { // Yes. Convert it using the fast pre-parseed constructor GPHDT = new GphdtSentence(sentence.Sentence); } } catch (Exception e) { log.Error("Error decoding a NMEA sentance.", e); } }
/// <summary> /// Convert the RTI Amplitude data set to the PD0 Echo Intensity data type. /// </summary> /// <param name="nmeaDS">RTI Amplitude data set.</param> public void DecodeRtiEnsemble(DataSet.NmeaDataSet nmeaDS) { NmeaStrings = nmeaDS.NmeaStrings; GPGGA = nmeaDS.GPGGA; GPGLL = nmeaDS.GPGLL; GPGSA = nmeaDS.GPGSA; GPGSV = nmeaDS.GPGSV; GPHDT = nmeaDS.GPHDT; GPRMC = nmeaDS.GPRMC; GPVTG = nmeaDS.GPVTG; PGRMF = nmeaDS.PGRMF; }
/// <summary> /// Create an empty NMEA data set. /// </summary> /// <param name="valueType">Whether it contains 32 bit Integers or Single precision floating point </param> /// <param name="numBins">Number of Bin</param> /// <param name="numBeams">Number of beams</param> /// <param name="imag"></param> /// <param name="nameLength">Length of name</param> /// <param name="name">Name of data type</param> public NmeaDataSet(int valueType, int numBins, int numBeams, int imag, int nameLength, string name) : base(valueType, numBins, numBeams, imag, nameLength, name) { // Initialize all values GPGGA = null; GPVTG = null; GPRMC = null; PGRMF = null; GPGLL = null; GPGSV = null; GPGSA = null; GPHDT = null; // Initialized list NmeaStrings = new List <string>(); }
/// <summary> /// Create an NMEA data set. Include all the information to /// create the data set. /// </summary> /// <param name="valueType">Whether it contains 32 bit Integers or Single precision floating point </param> /// <param name="numBins">Number of Bin</param> /// <param name="numBeams">Number of beams</param> /// <param name="imag"></param> /// <param name="nameLength">Length of name</param> /// <param name="name">Name of data type</param> /// <param name="nmeaData">Byte array containing NMEA data</param> public NmeaDataSet(int valueType, int numBins, int numBeams, int imag, int nameLength, string name, byte[] nmeaData) : base(valueType, numBins, numBeams, imag, nameLength, name) { // Initialize all values GPGGA = null; GPVTG = null; GPRMC = null; PGRMF = null; GPGLL = null; GPGSV = null; GPGSA = null; GPHDT = null; // Initialized list NmeaStrings = new List <string>(); // Decode the byte array for NMEA data DecodeNmeaData(nmeaData); }
/// <summary> /// Set any possible values for the given NMEA data. /// It will continue to replace /// the values so the last value is used as the final value. /// </summary> /// <param name="sentence">NMEA sentence containing data.</param> private void SetValues(NmeaSentence sentence) { /* * NMEA specification states that the first two letters of * a sentence may change. For example, for "$GPGSV" there may be variations such as * "$__GSV" where the first two letters change. As a result, we need only test the last three * characters. */ if (sentence.CommandWord.EndsWith("GGA", StringComparison.Ordinal)) { // Yes. Convert it using the fast pre-parseed constructor GPGGA = new GpggaSentence(sentence.Sentence); // Set the Lat and Lon and time } if (sentence.CommandWord.EndsWith("VTG", StringComparison.Ordinal)) { // Yes. Convert it using the fast pre-parseed constructor GPVTG = new GpvtgSentence(sentence.Sentence); } if (sentence.CommandWord.EndsWith("RMC", StringComparison.Ordinal)) { // Yes. Convert it using the fast pre-parseed constructor GPRMC = new GprmcSentence(sentence.Sentence); } if (sentence.CommandWord.EndsWith("RMF", StringComparison.Ordinal)) { // Yes. Convert it using the fast pre-parseed constructor PGRMF = new PgrmfSentence(sentence.Sentence); } if (sentence.CommandWord.EndsWith("GLL", StringComparison.Ordinal)) { // Yes. Convert it using the fast pre-parseed constructor GPGLL = new GpgllSentence(sentence.Sentence); } if (sentence.CommandWord.EndsWith("GSV", StringComparison.Ordinal)) { // Yes. Convert it using the fast pre-parseed constructor GPGSV = new GpgsvSentence(sentence.Sentence); } if (sentence.CommandWord.EndsWith("GSA", StringComparison.Ordinal)) { // Yes. Convert it using the fast pre-parseed constructor GPGSA = new GpgsaSentence(sentence.Sentence); } if (sentence.CommandWord.EndsWith("HDT", StringComparison.Ordinal)) { // Yes. Convert it using the fast pre-parseed constructor GPHDT = new GphdtSentence(sentence.Sentence); } }
public NmeaDataSet(List<string> NmeaStrings) : base(DataSet.Ensemble.DATATYPE_BYTE, 0, DataSet.Ensemble.DEFAULT_NUM_BEAMS_NONBEAM, DataSet.Ensemble.DEFAULT_IMAG, DataSet.Ensemble.DEFAULT_NAME_LENGTH, DataSet.Ensemble.NmeaID) { // Initialize all values GPGGA = null; GPVTG = null; GPRMC = null; PGRMF = null; GPGLL = null; GPGSV = null; GPGSA = null; GPHDT = null; // Initialized list if (NmeaStrings != null) { this.NmeaStrings = NmeaStrings; } else { NmeaStrings = new List<string>(); } // Decode the byte array for NMEA data DecodeNmeaData(NmeaStrings); }
/// <summary> /// Create an NMEA data set. Include all the information to /// create the data set. /// </summary> /// <param name="valueType">Whether it contains 32 bit Integers or Single precision floating point </param> /// <param name="numBins">Number of Bin</param> /// <param name="numBeams">Number of beams</param> /// <param name="imag"></param> /// <param name="nameLength">Length of name</param> /// <param name="name">Name of data type</param> /// <param name="nmeaData">Byte array containing NMEA data</param> public NmeaDataSet(int valueType, int numBins, int numBeams, int imag, int nameLength, string name, byte[] nmeaData) : base(valueType, numBins, numBeams, imag, nameLength, name) { // Initialize all values GPGGA = null; GPVTG = null; GPRMC = null; PGRMF = null; GPGLL = null; GPGSV = null; GPGSA = null; GPHDT = null; // Initialized list NmeaStrings = new List<string>(); // Decode the byte array for NMEA data DecodeNmeaData(nmeaData); }
/// <summary> /// Create an empty NMEA data set. /// </summary> /// <param name="valueType">Whether it contains 32 bit Integers or Single precision floating point </param> /// <param name="numBins">Number of Bin</param> /// <param name="numBeams">Number of beams</param> /// <param name="imag"></param> /// <param name="nameLength">Length of name</param> /// <param name="name">Name of data type</param> public NmeaDataSet(int valueType, int numBins, int numBeams, int imag, int nameLength, string name) : base(valueType, numBins, numBeams, imag, nameLength, name) { // Initialize all values GPGGA = null; GPVTG = null; GPRMC = null; PGRMF = null; GPGLL = null; GPGSV = null; GPGSA = null; GPHDT = null; // Initialized list NmeaStrings = new List<string>(); }