当前位置: 首页>>代码示例>>C#>>正文


C# DataSet.AddNmeaData方法代码示例

本文整理汇总了C#中DataSet.AddNmeaData方法的典型用法代码示例。如果您正苦于以下问题:C# DataSet.AddNmeaData方法的具体用法?C# DataSet.AddNmeaData怎么用?C# DataSet.AddNmeaData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DataSet的用法示例。


在下文中一共展示了DataSet.AddNmeaData方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetNmeaData

        /// <summary>
        /// Get the latest data from the NMEA buffer
        /// and create a string.  
        /// Then record the NMEA data and add it to
        /// the ensemble.
        /// </summary>
        /// <param name="adcpData">Ensemble data.</param>
        /// <returns>Binary data.</returns>
        private byte[] GetNmeaData(ref DataSet.Ensemble adcpData)
        {
            // Byte array of the binary data
            List<byte> byteList = new List<byte>();

            string nmeaData = GetNmeaBuffer();
            if (nmeaData.Length > 0)
            {
                // Add the NMEA data to the dataset
                adcpData.AddNmeaData(nmeaData.ToString());

                // Create byte array for all the NMEA data accumulated
                // Record the NMEA data to the file
                // Get the NMEA data from the dataset to ensure valid NMEA messages
                for (int x = 0; x < adcpData.NmeaData.NmeaStrings.Count; x++)
                {
                    string nmeaStr = adcpData.NmeaData.NmeaStrings[x] + NMEA_END;
                    byte[] nmeaBA = System.Text.Encoding.ASCII.GetBytes(nmeaStr);
                    byteList.AddRange(nmeaBA);
                }
            }

            // Return the binary data
            return byteList.ToArray();
        }
开发者ID:rowetechinc,项目名称:RTI,代码行数:33,代码来源:AdcpDvlCodec.cs

示例2: MergeNmeaDataSet

        /// <summary>
        /// Add NMEA data to the ensemble.
        /// </summary>
        /// <param name="adcpData">DataSet to add NMEA data.</param>
        private void MergeNmeaDataSet(ref DataSet.Ensemble adcpData)
        {
            // Copy the data from the buffer
            // This will take a current cout of the buffer.
            // Then create a string of the buffer and remove
            // the item from the buffer at the same time.
            StringBuilder nmeaData = new StringBuilder();

            // Copy the buffer so it can be unlocked
            LinkedList<string> bufferCopy;
            lock (_nmeaBufferLock)
            {
                // Copy the buffer then clear it
                bufferCopy = new LinkedList<string>(_nmeaBuffer);
                _nmeaBuffer.Clear();
            }

            // Create a string of all the buffered data
            for (int x = 0; x < bufferCopy.Count; x++)
            {
                nmeaData.Append(bufferCopy.First.Value);

                // Remove the data
                bufferCopy.RemoveFirst();
            }

            // Check if NMEA data already exsit, if it does, combine the data
            if (adcpData.IsNmeaAvail)
            {
                // Merge the NMEA data with the new nmea data
                adcpData.NmeaData.MergeNmeaData(nmeaData.ToString());
            }
            else
            {
                // Add the NMEA data to the dataset
                adcpData.AddNmeaData(nmeaData.ToString());
            }
        }
开发者ID:rowetechinc,项目名称:RTI,代码行数:42,代码来源:AdcpBinaryCodec.cs

示例3: AddNmea

 /// <summary>
 /// Add Nmea data set.
 /// </summary>
 /// <param name="ensemble">Ensemble to add the dataset.</param>
 public static void AddNmea(ref DataSet.Ensemble ensemble)
 {
     ensemble.AddNmeaData(DataSet.Ensemble.DATATYPE_BYTE,
                                     DataSet.EarthWaterMassDataSet.NUM_DATA_ELEMENTS,        // Num elements (Bins)
                                     DataSet.Ensemble.DEFAULT_NUM_BEAMS_BEAM,                // Num Beams
                                     DataSet.Ensemble.DEFAULT_IMAG,                          // Image
                                     DataSet.Ensemble.DEFAULT_NAME_LENGTH,                   // Name length
                                     DataSet.Ensemble.NmeaID);                               // Name (Dataset ID)
 }
开发者ID:Bobfrat,项目名称:RTI,代码行数:13,代码来源:EnsembleHelper.cs


注:本文中的DataSet.AddNmeaData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。