/// <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(Prti03Sentence 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 = Convert.ToSingle(sentence.WaterMassVelQ.ToMetersPerSecond().Value); WaterMassDepthLayer = Convert.ToSingle(sentence.WaterMassDepth.ToMeters().Value); BtRefLayerFar = 0; BtRefLayerMin = 0; BtRefLayerNear = 0; BtRefLayerCorrBeam0 = 0; BtRefLayerCorrBeam1 = 0; BtRefLayerCorrBeam2 = 0; BtRefLayerCorrBeam3 = 0; BtRefLayerEchoIntensityBeam0 = 0; BtRefLayerEchoIntensityBeam1 = 0; BtRefLayerEchoIntensityBeam2 = 0; BtRefLayerEchoIntensityBeam3 = 0; BtRefLayerPercentGoodBeam0 = 0; BtRefLayerPercentGoodBeam1 = 0; BtRefLayerPercentGoodBeam2 = 0; BtRefLayerPercentGoodBeam3 = 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(Prti03Sentence 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. }
/// <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(Prti03Sentence 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 = Convert.ToSingle(sentence.WaterMassVelQ.ToMetersPerSecond().Value); WaterMassDepthLayer = Convert.ToSingle(sentence.WaterMassDepth.ToMeters().Value); }
/// <summary> /// Prti03Sentence contains bottom track velocity in Instrument form. It also /// contains the Error velocity, depth and status. /// </summary> /// <param name="sentence">DVL sentence containing data.</param> private void DecodeBottomTrackData(Prti03Sentence 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 the instrument velocity Q in m/s // If the velocity is bad, set bad velocity if (sentence.BottomTrackVelQ.Value != DotSpatial.Positioning.Speed.BadDVL.Value) { InstrumentVelocity[3] = Convert.ToSingle(sentence.BottomTrackVelQ.ToMetersPerSecond().Value); } else { // Set Bad velocity InstrumentVelocity[3] = DataSet.Ensemble.BAD_VELOCITY; EarthVelocity[3] = 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 }
/// <summary> /// Create a Bottom Track data set. Includes all the information /// about the current Bottom Track data. /// </summary> /// <param name="sentence">NMEA sentence.</param> public BottomTrackDataSet(Prti03Sentence 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); }
/// <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(Prti03Sentence 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; }