Example #1
0
        /// <summary>
        /// Initialize values
        /// </summary>
        public AdcpDatabaseReader()
        {
            // Setup the codec
            _adcpDbCodec = new AdcpDatabaseCodec();

            // Initialize values
            _prevProject = null;
            _cnn         = null;
        }
        /// <summary>
        /// Generate an image of the project
        /// based off the velocity data.
        /// </summary>
        /// <param name="prj">Project to create the image.</param>
        /// <param name="maxVelocity">Maximum velocity for the image.</param>
        /// <param name="minVelocity">Minimum velocity for the image.</param>
        public void GenerateImage(Project prj, double minVelocity, double maxVelocity)
        {
            // Codec to read the database
            _adcpDbCodec = new AdcpDatabaseCodec();

            // Set the project
            SelectedProject = prj;

            // Set the min and max velocity
            MinVelocity = minVelocity;
            MaxVelocity = maxVelocity;

            // Verify the project is good
            if (SelectedProject != null)
            {
                // Get the number of ensembles
                _numEnsembles = GetNumberOfEnsembles(prj);

                // Verfiy there is data in the project
                if (_numEnsembles > 0)
                {
                    // Remove the old file
                    if (File.Exists(SelectedProject.GetProjectImagePath()))
                    {
                        try
                        {
                            File.Delete(SelectedProject.GetProjectImagePath());
                        }
                        catch (Exception e)
                        {
                            log.Error("Error Deleting Existing Image", e);
                        }
                    }

                    // Produce the image based off the
                    // set project.
                    //ProduceImage();
                    ProduceCompleteImage();
                }
            }
        }
 /// <summary>
 /// Get the number of ensembles in this project.
 /// </summary>
 /// <param name="prj">Project to check for number of ensembles.</param>
 /// <returns>Number of ensembles in the project.</returns>
 private int GetNumberOfEnsembles(Project prj)
 {
     return(AdcpDatabaseCodec.GetNumberOfEnsembles(prj));
 }
Example #4
0
        /// <summary>
        /// Initialize values
        /// </summary>
        public AdcpDatabaseReader()
        {
            // Setup the codec
            _adcpDbCodec = new AdcpDatabaseCodec();

            // Initialize values
            _prevProject = null;
            _cnn = null;
        }
Example #5
0
 /// <summary>
 /// Get the number of ensembles in the given
 /// project.
 /// </summary>
 /// <param name="project">Project to determine the number of ensembles.</param>
 public int GetNumberOfEnsembles(Project project)
 {
     return(AdcpDatabaseCodec.GetNumberOfEnsembles(project));
 }