Ejemplo n.º 1
0
            /// <summary>
            /// Prti01Sentence contains bottom track velocity in Instrument form. It also
            /// contains the depth and status.
            /// </summary>
            /// <param name="sentence">DVL sentence containing data.</param>
            private void DecodeBottomTrackData(Prti01Sentence sentence)
            {
                // Set the instrument velocity X in m/s
                // If the velocity is bad, set bad velocity
                if (sentence.BottomTrackVelX.Value != DotSpatial.Positioning.Speed.BadDVL.Value)
                {
                    InstrumentVelocity[0] = Convert.ToSingle(sentence.BottomTrackVelX.ToMetersPerSecond().Value);
                }
                else
                {
                    // Set Bad velocity
                    InstrumentVelocity[0] = DataSet.Ensemble.BAD_VELOCITY;
                    EarthVelocity[0] = DataSet.Ensemble.BAD_VELOCITY;
                }

                // Set the instrument velocity Y in m/s
                // If the velocity is bad, set bad velocity
                if (sentence.BottomTrackVelY.Value != DotSpatial.Positioning.Speed.BadDVL.Value)
                {
                    InstrumentVelocity[1] = Convert.ToSingle(sentence.BottomTrackVelY.ToMetersPerSecond().Value);
                }
                else
                {
                    // Set Bad velocity
                    InstrumentVelocity[1] = DataSet.Ensemble.BAD_VELOCITY;
                    EarthVelocity[1] = DataSet.Ensemble.BAD_VELOCITY;
                }

                // Set the instrument velocity Z in m/s
                // If the velocity is bad, set bad velocity
                if (sentence.BottomTrackVelZ.Value != DotSpatial.Positioning.Speed.BadDVL.Value)
                {
                    InstrumentVelocity[2] = Convert.ToSingle(sentence.BottomTrackVelZ.ToMetersPerSecond().Value);
                }
                else
                {
                    // Set Bad velocity
                    InstrumentVelocity[2] = DataSet.Ensemble.BAD_VELOCITY;
                    EarthVelocity[2] = DataSet.Ensemble.BAD_VELOCITY;
                }

                // Set all 4 values to the same range, then average range will also report the correct value
                Range[0] = Convert.ToSingle(sentence.BottomTrackDepth.ToMeters().Value);
                Range[1] = Convert.ToSingle(sentence.BottomTrackDepth.ToMeters().Value);
                Range[2] = Convert.ToSingle(sentence.BottomTrackDepth.ToMeters().Value);
                Range[3] = Convert.ToSingle(sentence.BottomTrackDepth.ToMeters().Value);

                // Set the status value
                Status = new Status(sentence.SystemStatus.Value);

                // Set the water temp
                WaterTemp = Convert.ToSingle(sentence.Temperature / 100.0);   // Sentence stores temp at 1/100 degree Celcius.

                // First ping time
                FirstPingTime = Convert.ToInt32(sentence.StartTime / 100);      // Sentence stores the time in hundredths of a second
            }
Ejemplo n.º 2
0
            /// <summary>
            /// Create a Bottom Track data set.  Includes all the information
            /// about the current Bottom Track data.
            /// </summary>
            /// <param name="sentence"></param>
            public BottomTrackDataSet(Prti01Sentence sentence)
                : base(DataSet.Ensemble.DATATYPE_FLOAT, NUM_DATA_ELEMENTS, DataSet.Ensemble.DEFAULT_NUM_BEAMS_BEAM, DataSet.Ensemble.DEFAULT_IMAG, DataSet.Ensemble.DEFAULT_NAME_LENGTH, DataSet.Ensemble.BottomTrackID)
            {
                // Initialize arrays
                Init(DataSet.Ensemble.DEFAULT_NUM_BEAMS_BEAM);

                // Decode the information
                DecodeBottomTrackData(sentence);
            }
Ejemplo n.º 3
0
            /// <summary>
            /// Create an Ensemble data set.  Include all the information
            /// about the current ensemble from the sentence.  This will include
            /// the ensemble number and status.
            /// </summary>
            /// <param name="sentence">Sentence containing data.</param>
            public EnsembleDataSet(Prti01Sentence sentence)
                : base(DataSet.Ensemble.DATATYPE_INT, NUM_DATA_ELEMENTS, DataSet.Ensemble.DEFAULT_NUM_BEAMS_NONBEAM, DataSet.Ensemble.DEFAULT_IMAG, DataSet.Ensemble.DEFAULT_NAME_LENGTH, DataSet.Ensemble.EnsembleDataID)
            {
                // Set the ensemble number
                EnsembleNumber = sentence.SampleNumber;

                // Set time to now
                SetTime();

                // Create UniqueId
                UniqueId = new UniqueID(EnsembleNumber, EnsDateTime);

                // Use default value for beams
                NumBeams = DataSet.Ensemble.DEFAULT_NUM_BEAMS_BEAM;

                // Use the special serial number for a DVL
                SysSerialNumber = SerialNumber.DVL;

                // Create blank firmware
                SysFirmware = new Firmware();

                // Create Subsystem Configuration based off Firmware and Serialnumber
                if (sentence.SubsystemConfig != null)
                {
                    SubsystemConfig = sentence.SubsystemConfig;
                    SysFirmware.SubsystemCode = sentence.SubsystemConfig.SubSystem.Code;
                }
                else
                {
                    // Create Subsystem Configuration based off Firmware and Serialnumber
                    SubsystemConfig = new SubsystemConfiguration(SysFirmware.GetSubsystem(SysSerialNumber), 0, 0);
                }

                // Get the status from the sentence
                Status = sentence.SystemStatus;

                // No bin data
                NumBins = 0;
            }
Ejemplo n.º 4
0
            /// <summary>
            /// Create a Ancillary data set.  Include all the information
            /// about the current Ancillary data from the sentence.
            /// This will set the temperature.
            /// </summary>
            /// <param name="sentence">Sentence containing data.</param>
            public AncillaryDataSet(Prti01Sentence sentence)
                : base(DataSet.Ensemble.DATATYPE_FLOAT, NUM_DATA_ELEMENTS, DataSet.Ensemble.DEFAULT_NUM_BEAMS_NONBEAM, DataSet.Ensemble.DEFAULT_IMAG, DataSet.Ensemble.DEFAULT_NAME_LENGTH, DataSet.Ensemble.AncillaryID)
            {
                // Init the values
                Init();

                WaterTemp = Convert.ToSingle(sentence.Temperature / 100.0);     // Sentence stores temp at 1/100 degree Celcius.
                LastPingTime = sentence.StartTime / 100;                        // Convert the Start Time for hundreds of seconds to seconds.
            }
Ejemplo n.º 5
0
 ///// <summary>
 ///// Create an Instrument Water Mass Velocity 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="x">Water Mass East Velocity in m/s.</param>
 ///// <param name="y">Water Mass North Velocity in m/s.</param>
 ///// <param name="z">Water Mass Vertical Velocity in m/s.</param>
 ///// <param name="depthLayer">Depth layer of the Water Mass measurement in meters.</param>
 ///// <param name="orientation">Orientation of the beams.  Default Down.</param>
 //public InstrumentWaterMassDataSet(int valueType, int numBins, int numBeams, int imag, int nameLength, string name, float x, float y, float z, float depthLayer) :
 //    base(valueType, numBins, numBeams, imag, nameLength, name)
 //{
 //    // Initialize data
 //    VelocityX = x;
 //    VelocityY = y;
 //    VelocityZ = z;
 //    WaterMassDepthLayer = depthLayer;
 //}
 /// <summary>
 /// Create an Insturment Water Mass Velocity data set.  Include all the information
 /// to create the data set from the NMEA sentence.
 /// </summary>
 /// <param name="sentence">NMEA sentence containing the data.</param>
 public InstrumentWaterMassDataSet(Prti01Sentence sentence)
     : base(DataSet.Ensemble.DATATYPE_FLOAT, NUM_DATA_ELEMENTS, DataSet.Ensemble.DEFAULT_NUM_BEAMS_BEAM, DataSet.Ensemble.DEFAULT_IMAG, DataSet.Ensemble.DEFAULT_NAME_LENGTH, DataSet.Ensemble.WaterMassInstrumentID)
 {
     // Initialize data
     VelocityX = Convert.ToSingle(sentence.WaterMassVelX.ToMetersPerSecond().Value);
     VelocityY = Convert.ToSingle(sentence.WaterMassVelY.ToMetersPerSecond().Value);
     VelocityZ = Convert.ToSingle(sentence.WaterMassVelZ.ToMetersPerSecond().Value);
     VelocityQ = Ensemble.EMPTY_VELOCITY;
     WaterMassDepthLayer = Convert.ToSingle(sentence.WaterMassDepth.ToMeters().Value);
 }