예제 #1
0
        /// <summary>
        /// Process the row from the DB.  A row represents an ensemble.
        /// </summary>
        /// <param name="reader">Database connection data.</param>
        /// <param name="bin">Bin number.</param>
        /// <returns>Magnitude data for a row.</returns>
        private double ParseDirData(DbDataReader reader, int bin)
        {
            try
            {
                // Get the data
                DbDataHelper.VelocityMagDir velMagDir = DbDataHelper.CreateVelocityVectors(reader, _backupBtEast, _backupBtNorth, true, false);

                // Store the backup value
                if (velMagDir.IsBtVelGood)
                {
                    _backupBtEast  = velMagDir.BtEastVel;
                    _backupBtNorth = velMagDir.BtNorthVel;
                }

                if (bin < velMagDir.Magnitude.Length)
                {
                    if (Math.Round(velMagDir.DirectionYNorth[bin], 3) != DbDataHelper.BAD_VELOCITY)
                    {
                        return(velMagDir.DirectionYNorth[bin]);
                    }
                }

                return(0.0);
            }
            catch (Exception e)
            {
                Debug.WriteLine("Error parsing the Earth Velocity Direction data row", e);
                return(0.0);
            }
        }
예제 #2
0
        /// <summary>
        /// Process the row from the DB.  A row represents an ensemble.
        /// </summary>
        /// <param name="reader">Database connection data.</param>
        /// <returns>Direction data for a row.</returns>
        private double[] ParseDirData(DbDataReader reader)
        {
            try
            {
                // Get data
                DbDataHelper.VelocityMagDir velMagDir = DbDataHelper.CreateVelocityVectors(reader, _backupBtEast, _backupBtNorth, _IsRemoveShipSpeed, _IsMarkBadBelowBottom);

                // Store the backup value
                if (velMagDir.IsBtVelGood)
                {
                    _backupBtEast  = velMagDir.BtEastVel;
                    _backupBtNorth = velMagDir.BtNorthVel;
                }

                return(velMagDir.DirectionYNorth);
            }
            catch (Exception e)
            {
                Debug.WriteLine("Error parsing the Earth Velocity Direction data row", e);
                return(null);
            }
        }