예제 #1
0
파일: ChartGPS.cs 프로젝트: PalakDave/Pices
        private void  PopulatDeploymentsToPlot()
        {
            DeploymentsToPlot.Items.Clear();
            PicesSipperDeploymentList deployments = mainWinConn.SipperDeploymentLoad(cruiseName, "");

            if (deployments == null)
            {
                return;
            }

            stations = mainWinConn.SipperStationLoad(cruiseName);

            cruiseAdjGpsToActTime = new TimeSpan(0, 0, 0);
            long adjGpsToActTime = 0;

            foreach (PicesSipperDeployment deployment in deployments)
            {
                long deploymentAdjGpsToAct = deployment.SyncTimeStampGPS.ToFileTimeUtc() - deployment.SyncTimeStampActual.ToFileTimeUtc();
                if (deploymentAdjGpsToAct != adjGpsToActTime)
                {
                    adjGpsToActTime       = deploymentAdjGpsToAct;
                    cruiseAdjGpsToActTime = deployment.SyncTimeStampActual - deployment.SyncTimeStampGPS;
                }

                DeploymentsToPlot.Items.Add(deployment, true);
            }
        }
예제 #2
0
        private void  LoadDeployments()
        {
            deployment = null;
            PicesSipperDeploymentList deployments = mainWinConn.SipperDeploymentLoad(cruiseName, stationName);

            if (deployments == null)
            {
                return;
            }
            DeploymentField.Items.Clear();
            deployment = null;
            foreach (PicesSipperDeployment d in  deployments)
            {
                DeploymentField.Items.Add(d);
                if (d.DeploymentNum.Equals(deploymentNum, StringComparison.InvariantCultureIgnoreCase))
                {
                    deployment = d;
                }
            }
            if (deployment == null)
            {
                deploymentNum = "";
            }
            else
            {
                DeploymentField.SelectedItem = deployment;
            }
        }
예제 #3
0
        private void  LoadDeploymentDetails()
        {
            nextDeploymentNum = "A";
            this.Nodes.Clear();
            PicesSipperDeploymentList deplomyents = dbConn.SipperDeploymentLoad(station.CruiseName, station.StationName);

            if (deplomyents == null)
            {
                return;
            }
            String lastDeplymentNum = "";

            foreach (PicesSipperDeployment deployment in deplomyents)
            {
                this.Nodes.Add(new TreeNodeDeployment(dbConn, deployment));
                if (deployment.DeploymentNum.Length > 0)
                {
                    lastDeplymentNum = deployment.DeploymentNum;
                }
            }

            if (lastDeplymentNum.Length > 0)
            {
                if ((lastDeplymentNum[0] >= 'A') && (lastDeplymentNum[0] < 'Z'))
                {
                    Char x = lastDeplymentNum[0];
                    x++;
                    nextDeploymentNum = x.ToString();
                }
            }
        } /* LoadDeploymentDetails */
예제 #4
0
        private void  PopulatDeploymentsToPlot()
        {
            DeploymentsToPlot.Items.Clear();
            PicesSipperDeploymentList deployments = mainWinConn.SipperDeploymentLoad(cruise, "");

            if (deployments == null)
            {
                return;
            }
            foreach (PicesSipperDeployment deployment in deployments)
            {
                DeploymentsToPlot.Items.Add(deployment, true);
            }
        }
예제 #5
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;
        }
예제 #6
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 */