Example #1
0
        } /* CountsByDepth */

        private float[]  GetDepthVolumeProfile()
        {
            String msg = "Retrieving Depth-Volume profile Station[" + cruise + "]  Station[" + station + "]  Deployment[" + deployment + "].";

            msgQueue.AddMsg(msg);
            statusMsgs.AddMsg(msg);
            PicesVolumeSampledStatList
                volStats = threadConn.InstrumentDataGetVolumePerMeterDepth(cruise, station, deployment, depthIncrement);

            if (volStats == null)
            {
                return(null);
            }

            return(volStats.ToArray());
        }
        } /* LoadStatsForSelectedGroup */

        private void  LoadStatsForOneSipperFile(String sfn)
        {
            curSipperFileName = sfn;
            uint[] nextBunch = dbConn.ImageGetDepthStatistics
                                   (null, // ImageGroup
                                   sfn,
                                   depthIncrements,
                                   mlClass,
                                   classKeyToUse,
                                   probMin, probMax,
                                   sizeMin, sizeMax
                                   );

            if ((nextBunch == null) || (nextBunch.Length < 1))
            {
                return;
            }

            {
                PicesVolumeSampledStatList statsThisClass = dbConn.InstrumentDataGetVolumePerMeterDepth(sfn, depthIncrements);

                if (volumeWaterSampled == null)
                {
                    volumeWaterSampled = statsThisClass;
                }
                else
                {
                    volumeWaterSampled.MergeIn(statsThisClass);
                }
            }

            blocker.StartBlock();
            AddNextBunchIntoLoadedStats(ref loadedStats, nextBunch, ref imageCountTotal);
            newStatsAvailable = true;
            blocker.EndBlock();
        } /* LoadStatsForOneSipperFile */
        } /* LoadStatsForOneSipperFile */

        private void  LoadStatsThread()
        {
            blocker.StartBlock();
            loaderThreadRuning = true;
            PicesDataBase.ThreadInit();
            blocker.EndBlock();

            dbConn = PicesDataBase.GetGlobalDatabaseManagerNewInstance(runLog);

            allSipperFiles = (String.IsNullOrEmpty(cruiseName) &&
                              String.IsNullOrEmpty(stationName) &&
                              String.IsNullOrEmpty(deploymentNum) &&
                              String.IsNullOrEmpty(sipperFileName)
                              );

            if (!String.IsNullOrEmpty(sipperFileName))
            {
                sipperFileNames    = new String[1];
                sipperFileNames[0] = sipperFileName;
            }
            else
            {
                sipperFileNames = dbConn.SipperFileGetList(cruiseName, stationName, deploymentNum);
            }

            sipperFilesCount = ((sipperFileNames == null) ? 0 : sipperFileNames.Length);

            if (selectedImageGroup != null)
            {
                LoadStatsForSelectedGroup();
            }
            else
            {
                if (sipperFileNames != null)
                {
                    for (curSipperFileIdx = 0; (curSipperFileIdx < sipperFileNames.Length) && (!cancelRequested); curSipperFileIdx++)
                    {
                        LoadStatsForOneSipperFile(sipperFileNames[curSipperFileIdx]);
                    }
                }
            }

            if (!cancelRequested)
            {
                volumeWaterSampled
                    = dbConn.InstrumentDataGetVolumePerMeterDepth(cruiseName,
                                                                  stationName,
                                                                  deploymentNum,
                                                                  1.0f
                                                                  );
            }

            blocker.StartBlock();
            if (!cancelRequested)
            {
                doneLoading = true;
            }
            loaderThreadRuning = false;
            blocker.EndBlock();

            if (completionEvent != null)
            {
                completionEvent(this);
            }

            dbConn.Close();
            dbConn = null;
            GC.Collect();

            PicesDataBase.ThreadEnd();
        } /* LoadStatsThread */