示例#1
0
        /// <summary>
        /// Get the data type size.  Some of the data types have a fixed size.
        /// The others depend on the number of depth cells.
        /// </summary>
        /// <param name="dataType">Data type.</param>
        /// <returns>Number of bytes for each data types.</returns>
        public int GetDataTypeSize(Pd0DataType dataType)
        {
            switch (dataType.ID.Type)
            {
            case Pd0ID.Pd0Types.Header:
                return(GetDataTypeSize());                          // Sized based of number of type types

            case Pd0ID.Pd0Types.FixedLeader:
                return(Pd0FixedLeader.DATATYPE_SIZE);               // Fixed size

            case Pd0ID.Pd0Types.VariableLeader:
                return(Pd0VariableLeader.DATATYPE_SIZE);            // Fixed size

            case Pd0ID.Pd0Types.BottomTrack:
                return(Pd0BottomTrack.DATATYPE_SIZE);               // Fixed size

            case Pd0ID.Pd0Types.Velocity:
                return(GetVelocitySize());                          // 2 Bytes for every beam, 4 beams for every depth cell

            case Pd0ID.Pd0Types.Correlation:
            case Pd0ID.Pd0Types.EchoIntensity:
            case Pd0ID.Pd0Types.PercentGood:
                return(GetCorrEchoPerGdSize());                     // 1 Byte for every beam, 4 beams for every depth cell

            case Pd0ID.Pd0Types.NmeaData:
                //return GetNmeaDataSize();                       // Varies based of NMEA data
                return(dataType.GetDataTypeSize());

            default:
                return(0);
            }
        }
示例#2
0
        /// <summary>
        /// Add the data type to the ensemble.
        /// </summary>
        /// <param name="dataType">Data type.</param>
        public void AddDataType(Pd0DataType dataType)
        {
            // Increase the number of bytes
            // Add 2 for the offset added to the header
            NumberOfBytes += GetDataTypeSize(dataType) + 2;

            if (!DataTypes.ContainsKey(dataType.ID.Type))
            {
                // Add the offset to the list
                DataTypes.Add(dataType.ID.Type, dataType);
            }
            else
            {
                Debug.WriteLine("Data type already exist." + dataType.ID.Type);
            }
        }
示例#3
0
文件: Pd0Header.cs 项目: Bobfrat/RTI
 /// <summary>
 /// Get the data type size.  Some of the data types have a fixed size.
 /// The others depend on the number of depth cells.
 /// </summary>
 /// <param name="dataType">Data type.</param>
 /// <returns>Number of bytes for each data types.</returns>
 public int GetDataTypeSize(Pd0DataType dataType)
 {
     switch(dataType.ID.Type)
     {
         case Pd0ID.Pd0Types.Header:
             return GetDataTypeSize();                       // Sized based of number of type types
         case Pd0ID.Pd0Types.FixedLeader:
             return Pd0FixedLeader.DATATYPE_SIZE;            // Fixed size
         case Pd0ID.Pd0Types.VariableLeader:
             return Pd0VariableLeader.DATATYPE_SIZE;         // Fixed size
         case Pd0ID.Pd0Types.BottomTrack:
             return Pd0BottomTrack.DATATYPE_SIZE;            // Fixed size
         case Pd0ID.Pd0Types.Velocity:
             return GetVelocitySize();                       // 2 Bytes for every beam, 4 beams for every depth cell
         case Pd0ID.Pd0Types.Correlation:
         case Pd0ID.Pd0Types.EchoIntensity:
         case Pd0ID.Pd0Types.PercentGood:
             return GetCorrEchoPerGdSize();                  // 1 Byte for every beam, 4 beams for every depth cell
         default:
             return 0;
     }
 }
示例#4
0
文件: Pd0Header.cs 项目: Bobfrat/RTI
        /// <summary>
        /// Add the data type to the ensemble.
        /// </summary>
        /// <param name="dataType">Data type.</param>
        public void AddDataType(Pd0DataType dataType)
        {
            // Increase the number of bytes
            // Add 2 for the offset added to the header
            NumberOfBytes += GetDataTypeSize(dataType) + 2;

            // Add the offset to the list
            DataTypes.Add(dataType.ID.Type, dataType);
        }
示例#5
0
 /// <summary>
 /// Added the data type to the ensemble.
 /// </summary>
 /// <param name="dataType">Data type.</param>
 public void AddDataType(Pd0DataType dataType)
 {
     Header.AddDataType(dataType);
 }
示例#6
0
文件: PD0.cs 项目: rowetechinc/RTI
 /// <summary>
 /// Added the data type to the ensemble.
 /// </summary>
 /// <param name="dataType">Data type.</param>
 public void AddDataType(Pd0DataType dataType)
 {
     Header.AddDataType(dataType);
 }