Ejemplo n.º 1
0
        private void  SizeDistributionForAClass(PicesClass c,
                                                bool includeChildren,
                                                ref PicesImageSizeDistribution downCastAcumulated,
                                                ref PicesImageSizeDistribution upCastAcumulated
                                                )
        {
            statusMsgs.AddMsg("Extracting for Class[" + c.Name + "]");
            sbyte ch = (sbyte)statistic;
            PicesImageSizeDistribution classDownCast = null;
            PicesImageSizeDistribution classUpCast   = null;

            threadConn.ImagesSizeDistributionByDepth(this.cruise, this.station, this.deployment, c.Name,
                                                     0.0f, // MaxDepth
                                                     5.0f,
                                                     ch,
                                                     initialSizeValue,
                                                     growthRate,
                                                     (float)MaxSizeField.Value,
                                                     ref classDownCast,
                                                     ref classUpCast
                                                     );

            if (classDownCast != null)
            {
                if (downCastAcumulated == null)
                {
                    downCastAcumulated = classDownCast;
                }
                else
                {
                    downCastAcumulated.AddIn(classDownCast, runLog);
                }
            }

            if (classUpCast != null)
            {
                if (upCastAcumulated == null)
                {
                    upCastAcumulated = classUpCast;
                }
                else
                {
                    upCastAcumulated.AddIn(classUpCast, runLog);
                }
            }

            if (includeChildren)
            {
                foreach (PicesClass pc in  c.Children)
                {
                    if (cancelRequested)
                    {
                        break;
                    }
                    SizeDistributionForAClass(pc, includeChildren, ref downCastAcumulated, ref upCastAcumulated);
                }
            }
        } /* SizeDistributionForAClass */
Ejemplo n.º 2
0
        } /* SizeDistributionForAClass */

        /// <summary>
        /// This method will be ran as a separate thread; it is responsible for collecting all the data needed to generate the plot.
        /// </summary>
        private void  BuildPlotData()
        {
            if (buildPlotDataRunning)
            {
                return;
            }

            PicesDataBase.ThreadInit();

            threadConn = PicesDataBase.GetGlobalDatabaseManagerNewInstance(runLog);

            buildPlotDataRunning = true;

            classToPlot = PicesClassList.GetUniqueClass(ClassToPlot.Text, "");

            sbyte ch = (sbyte)statistic;

            downCast = null;
            upCast   = null;

            goalie.StartBlock();

            SizeDistributionForAClass(classToPlot,
                                      IncludeSubClasses.Checked,
                                      ref downCast,
                                      ref upCast
                                      );

            if (cast == "Down")
            {
                bucketsDisplayed = downCast;
            }

            else if (cast == "Up")
            {
                bucketsDisplayed = upCast;
            }

            else
            {
                bucketsDisplayed = new PicesImageSizeDistribution(downCast);
                bucketsDisplayed.AddIn(upCast, runLog);
            }

            integratedDensityDistribution = bucketsDisplayed.IntegratedDensityDistribution();

            threadConn.Close();
            threadConn = null;
            GC.Collect();
            PicesDataBase.ThreadEnd();

            goalie.EndBlock();

            if (cancelRequested)
            {
                statusMsgs.AddMsg("Plotting of data CANCELLED!!!");
            }
            else
            {
                statusMsgs.AddMsg("Building of plot data completed !!!");
            }

            buildPlotDataRunning = false;
            buildPlotDataDone    = true;
        } /* BuildPlotData */