Esempio n. 1
0
        private void  UpdateProcessDelete(PicesDataBase updDbConn)
        {
            RunLogAddMsg("Deleting Class[" + selectedClass.Name + "]" + "\n");
            // Go through each sipper file and change the class name in there related Images table entries.

            TimeSpan startProcessTime = System.Diagnostics.Process.GetCurrentProcess().TotalProcessorTime;

            PicesDataBaseLogEntry logEntry =
                updDbConn.LogEntriesProcessStart("DL",
                                                 "ClassMaintenanceDelete",
                                                 ExecutableDateTimeStamp(),
                                                 "ClassMaintenance::UpdateProcessDelete " + selectedClass.Name,
                                                 ""
                                                 );

            String sqlCmd = "Call MLClassDeleteComprehensive (\"" + selectedClass.Name + "\")";

            updDbConn.QueryStatement(sqlCmd, null);

            PicesClassList.UpdateParent(selectedClass, selectedClass.Parent);

            if (selectedClass.Parent != null)
            {
                if (selectedClass.Parent.Children != null)
                {
                    selectedClass.Parent.Children.Remove(mergeClass);
                }
            }

            TimeSpan endProcessTime = System.Diagnostics.Process.GetCurrentProcess().TotalProcessorTime;

            updDbConn.LogEntriesProcessEnd(logEntry, (float)((startProcessTime - endProcessTime).TotalSeconds), "Done");

            selectedClass.StoredOnDataBase = false;
        } /* UpdateProcessDelete */
Esempio n. 2
0
        } /* ToCmdLine */

        private void  ImportValidatedClassAssignments()
        {
            importingRunning   = true;
            importingCompleted = false;

            PicesDataBase.ThreadInit();

            PicesRunLog   runLog     = new PicesRunLog();
            PicesDataBase threadConn = PicesDataBase.GetGlobalDatabaseManagerNewInstance(runLog);

            extractionLogEntryId = threadConn.LogEntriesProcessStart("IV",
                                                                     "ImportValidatedClass",
                                                                     ExecutableDateTimeStamp(),
                                                                     ToCmdLine(),
                                                                     OSservices.GetRootName(sipperFileName)
                                                                     );
            totalImagesUpdated = 0;

            ImportValidatedClassAssignmentsDir(threadConn, sourceDirectory);
            if (cancelImporting)
            {
                RunLogAddMsg("\n" + "Importing Assignments has been Canceled." + "\n\n");
            }
            else
            {
                RunLogAddMsg("\n\n" + "Total Images[" + totalImagesUpdated.ToString("###,##0") + "\n\n");
            }

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

            PicesDataBase.ThreadEnd();

            importingRunning   = false;
            importingCompleted = true;
        } /* ImportValidatedClassAssignments */
        } /* ToCmdLine */

        private void  ImportImagesIntoDeploymentProcess()
        {
            importingRunning   = true;
            importingCompleted = false;

            PicesDataBase.ThreadInit();

            PicesRunLog   runLog     = new PicesRunLog();
            PicesDataBase threadConn = PicesDataBase.GetGlobalDatabaseManagerNewInstance(runLog);

            extractionLogEntryId = threadConn.LogEntriesProcessStart("II",
                                                                     "ImportImagesIntoDeployment",
                                                                     ExecutableDateTimeStamp(),
                                                                     ToCmdLine(),
                                                                     ""
                                                                     );
            totalImagesUpdated = 0;

            ImportImagesFromDirectoryStructure(threadConn, sourceDirectory);
            if (cancelImporting)
            {
                runLog.Writeln("\n" + "Importing Images has been Canceled." + "\n\n");
            }
            else
            {
                runLog.Writeln("\n\n" + "Total Images[" + totalImagesUpdated.ToString("###,##0") + "\n\n");
            }

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

            PicesDataBase.ThreadEnd();

            importingRunning   = false;
            importingCompleted = true;
        } /* ImportImagesIntoDeploymentProcess */
Esempio n. 4
0
        public ImageViewer(PicesRaster _raster,
                           PicesDataBaseImage _image,
                           PicesClassList _classes
                           )
        {
            runLog  = new PicesRunLog();
            raster  = _raster;
            classes = _classes;
            dbConn  = PicesDataBase.GetGlobalDatabaseManagerNewInstance(runLog);
            image   = _image;

            sizeCoordinates = image.SizeCoordinates;

            if (raster == null)
            {
                raster = PicesRaster.GetOrigSipperImage(image.SipperFileName,
                                                        image.ByteOffset,
                                                        image.TopLeftRow,
                                                        image.TopLeftCol,
                                                        image.Height,
                                                        image.Width,
                                                        image.ConnectedPixelDist,
                                                        runLog
                                                        );
            }

            if (raster == null)
            {
                MessageBox.Show("Could not locate source image or SipperFile[" + image.SipperFileName + "]");
                return;
            }

            {
                uint scanLine = image.TopLeftRow;
                scanLine       = 4096 * (uint)(scanLine / 4096);
                instrumentData = dbConn.InstrumentDataGetByScanLine(image.SipperFileName, image.TopLeftRow);
                sipperFile     = dbConn.SipperFileRecLoad(image.SipperFileName);
            }

            double pixelsPerScanLine = pixelsPerScanLineDefault;


            if (instrumentData != null)
            {
                if (instrumentData.ActiveColumns > 0)
                {
                    pixelsPerScanLine = instrumentData.ActiveColumns;
                }
                if (instrumentData.FlowRate1 > 0.0)
                {
                    flowRate1 = instrumentData.FlowRate1;
                }
            }

            if (sipperFile != null)
            {
                if (sipperFile.ScanRate > 0.0)
                {
                    scanRate = sipperFile.ScanRate;
                }
                deployment = dbConn.SipperDeploymentLoad(sipperFile.CruiseName, sipperFile.StationName, sipperFile.DeploymentNum);
                if (deployment != null)
                {
                    chamberWidth = deployment.ChamberWidth;
                }
            }

            if ((dataFieldAssignments == null) || (DataLabels == null))
            {
                ConfigurationLoad();
            }

            InitializeComponent();
            if (image != null)
            {
                extractionLogEntry = dbConn.LogEntriesSelect(image.ExtractionLogEntryId);
                classLogEntry      = dbConn.LogEntriesSelect(image.ClassLogEntryId);
            }

            mmPerPixelAccrossChamber = chamberWidth * mmPerMeter / pixelsPerScanLine;
            mmPerPixelWithFlow       = mmPerMeter * flowRate1 / scanRate;

            DataLabels    = new Label[4];
            DataLabels[0] = DataLabel0;
            DataLabels[1] = DataLabel1;
            DataLabels[2] = DataLabel2;
            DataLabels[3] = DataLabel3;

            displayDataFields    = new TextBox[4];
            displayDataFields[0] = DataField0;
            displayDataFields[1] = DataField1;
            displayDataFields[2] = DataField2;
            displayDataFields[3] = DataField3;

            UpdateDataFields();

            ImageFileName.Text = image.ImageFileName;
        }
Esempio n. 5
0
 public LogEntryViewer(PicesDataBaseLogEntry _logEntry)
 {
     logEntry = _logEntry;
     InitializeComponent();
     PopulateForm();
 }