Ejemplo n.º 1
0
        } /* ValidateAll */

        private void  StartTheBackGroundProcedure()
        {
            DateTime n           = DateTime.Now;
            String   logFileName = OSservices.AddSlash(PicesSipperVariables.TempDirectory()) + "ImportGroupAssignments_Log_" +
                                   n.Year.ToString("0000") + "-" + n.Month.ToString("00") + "-" + n.Day.ToString("00") + "_" +
                                   n.Hour.ToString("00") + "-" + n.Minute.ToString("00") + "-" + n.Hour.ToString("00") +
                                   ".txt";

            backGroundLog = new PicesRunLog(logFileName);

            cancelBackGround = false;
            backGroundThread = new Thread(new ThreadStart(ImportAssignments));
            backGroundThread.Start();

            BackGroundTimer.Enabled  = true;
            SourceDirectory.Enabled  = false;
            BrowseSourceDir.Enabled  = false;
            GroupName.Enabled        = false;
            GroupDescription.Enabled = false;
        } /* StartTheHarvestingProcedure */
Ejemplo n.º 2
0
        private void  StartReconciliationThread()
        {
            String   rootName    = OSservices.GetRootNameOfDirectory(SourceDirectory.Text);
            DateTime d           = DateTime.Now;
            String   logFileName = OSservices.AddSlash(PicesSipperVariables.TempDirectory()) + rootName + "_ReconcileImageNames_" +
                                   d.ToString("yyyyMMdd-HHmmss") + ".txt";

            // Any images that are not in the Database that are to be removed will be moved to the subdirectory structure below.
            removalDestRootDir = "c:\\Temp\\PicesDatabaseImageReconciliationRemovedImages\\" + rootName;
            OSservices.CreateDirectoryPath(removalDestRootDir);

            reconcilingRunLog = new PicesRunLog(logFileName);


            Start.Enabled                 = false;
            SourceDirectory.ReadOnly      = true;
            SourceDirectoryBrowse.Enabled = false;
            reconcilingThread             = new Thread(new ThreadStart(ReconciliationThread));
            reconcilingThread.Start();
            Cancel.Enabled        = true;
            RunStatsTimer.Enabled = true;
        } /* StartReconciliationThread */
        private void SaveActiveTrainingModelFeatureData_Load(object sender, EventArgs e)
        {
            modelNames = TrainingModel2.GetListOfTrainingModels();
            if (modelNames != null)
            {
                foreach (String s in modelNames)
                {
                    ModelName.Items.Add(s);
                }
            }
            ModelName.Text = OSservices.GetRootName(initialModelName);

            String[] fileFormats = PicesFeatureFileIO.RegisteredDriverNames(false, true);
            if (fileFormats != null)
            {
                foreach (String ff in fileFormats)
                {
                    FileFormat.Items.Add(ff);
                }
            }
            FileFormat.Text = "Pices";

            DestinationFileName.Text = OSservices.AddSlash(PicesSipperVariables.TempDirectory()) + ModelName.Text + ".data";
        }
Ejemplo n.º 4
0
        } /* StartTheBackGroundProcedure */

        private void  BackGroundProcess()
        {
            backGroundRunning = true;

            PicesDataBase.ThreadInit();


            OSservices.CreateDirectoryPath(reportFileDir);

            DateTime n           = DateTime.Now;
            String   logFileName = OSservices.AddSlash(PicesSipperVariables.TempDirectory()) + "InstrumentDataByDeployment_Log_" +
                                   n.Year.ToString("0000") + "-" + n.Month.ToString("00") + "-" + n.Day.ToString("00") + "_" +
                                   n.Hour.ToString("00") + "-" + n.Minute.ToString("00") + "-" + n.Hour.ToString("00") +
                                   ".txt";

            backGroundLog = new PicesRunLog(logFileName);
            PicesDataBase threadConn = PicesDataBase.GetGlobalDatabaseManagerNewInstance(backGroundLog);

            RunLogAddMsg("Cruise           [" + cruiseName + "]" + "\n");
            RunLogAddMsg("Station          [" + stationName + "]" + "\n");
            RunLogAddMsg("Deployment       [" + deploymentNum + "]" + "\n");
            RunLogAddMsg("Start Date/Time  [" + DateTime.Now.ToString("yyyy-MMM-dd HH:mm:ss") + "]" + "\n");
            RunLogAddMsg("Active DataBase  [" + threadConn.Server.Description + "]" + "\n");

            PicesSipperDeploymentList deployments = null;

            if (!String.IsNullOrEmpty(deploymentNum))
            {
                PicesSipperDeployment d = threadConn.SipperDeploymentLoad(cruiseName, stationName, deploymentNum);
                if (d != null)
                {
                    deployments = new PicesSipperDeploymentList();
                    deployments.Add(d);
                }
            }
            else
            {
                deployments = threadConn.SipperDeploymentLoad(cruiseName, stationName);
            }

            if (deployments == null)
            {
                RunLogAddMsg("\n\nNo Deployments for Specified Criteria!\n\n");
                return;
            }

            int reportNum = 0;

            foreach (PicesSipperDeployment d in deployments)
            {
                if (cancelBackGround)
                {
                    break;
                }

                reportNum++;

                RunLogAddMsg("Generating Report " + reportNum.ToString() + " of " + deployments.Count.ToString());

                SummarizeInstrumentDataForADeployment(threadConn, d.CruiseName, d.StationName, d.DeploymentNum);
            }

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

            PicesDataBase.ThreadEnd();

            backGroundRunning = false;
        } /* BackGroundProcess */