示例#1
0
        public TreeNodeStation(PicesDataBase _dbConn,
                               PicesRunLog _runLog,
                               PicesSipperStation _station
                               )
        {
            dbConn  = _dbConn;
            runLog  = _runLog;
            station = _station;
            LoadDeploymentDetails();

            Text = ToString();

            ContextMenuStrip cms = new ContextMenuStrip();

            cms.Items.Add("Edit Station Parameters", null, EditStationParameters);

            if (PicesSipperVariables.AllowUpdates())
            {
                if (Nodes.Count < 1)
                {
                    cms.Items.Add("Delete Station", null, DeleteStation);
                }
                cms.Items.Add("Add a new Deployment", null, AddANewDeployment);
            }
            this.ContextMenuStrip = cms;
        }
示例#2
0
        private void  DeleteStation(Object sender, EventArgs e)
        {
            if (!PicesSipperVariables.AllowUpdates())
            {
                return;
            }

            if (station == null)
            {
                return;
            }
            StationDialog sd = new StationDialog(station, dbConn, runLog, false, true);

            sd.ShowDialog();
            this.Text = this.ToString();
            if (sd.StationDeleted)
            {
                if (this.Parent != null)
                {
                    this.Parent.Nodes.Remove(this);
                    return;
                }

                this.Text             = "Station[" + station.StationName + "]   ***Deleted***";
                this.ContextMenuStrip = null;
                this.station          = null;
            }
        } /* DeleteStation */
示例#3
0
        public TreeNodeCruise(PicesDataBase _dbConn,
                              PicesRunLog _runLog,
                              PicesSipperCruise _cruise
                              )
        {
            dbConn = _dbConn;
            runLog = _runLog;
            cruise = _cruise;
            LoadStationDetails();

            Text = ToString();

            if (PicesSipperVariables.AllowUpdates())
            {
                ContextMenuStrip cms = new ContextMenuStrip();
                cms.Items.Add("Edit Cruise Parameters", null, EditCruiseParameters);

                if (Nodes.Count < 1)
                {
                    cms.Items.Add("Delete Cruise", null, DeleteCruise);
                }

                cms.Items.Add("Add a new Station", null, AddANewStation);
                this.ContextMenuStrip = cms;
            }
        }
示例#4
0
 static void Main()
 {
     PicesSipperVariables.InitializeEnvironment();
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     Application.Run(new GetRunTimeParameters());
 }
示例#5
0
        private void ImageGroupGrid_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            DataGridView dgv = (DataGridView)sender;

            if (dgv.Columns[e.ColumnIndex].Name != "Delete")
            {
                return;
            }

            if (!allowUpdates)
            {
                PicesSipperVariables.UpdatesNotAllowed("Group Maintenance");
                return;
            }

            if (e.RowIndex < 0)
            {
                return;
            }

            PicesDataBaseImageGroup ig = dbConn.ImageGroupLoad((String)dgv.Rows[e.RowIndex].Cells[1].Value);

            if (ig == null)
            {
                return;
            }
            DialogResult dr = MessageBox.Show(this, "Are you sure you want to delete this group ?", "Delete " + ig.Name, MessageBoxButtons.YesNo);

            if (dr == DialogResult.Yes)
            {
                dbConn.ImageGroupDelete(ig.ImageGroupId);
                LoadGroups();
            }
        }
        public ChartAbundanceByDeployment(String _cruise,
                                          String _station,
                                          String _deployment,
                                          PicesClass _classToPlot,
                                          int _sizeMin,
                                          int _sizeMax,
                                          float _probMin,
                                          float _probMax,
                                          float _depthMin,
                                          float _depthMax,
                                          char _classKeyToUse,
                                          PicesClassList _classes,
                                          PicesClassList _activeClasses,
                                          String _rootDir
                                          )
        {
            cruise        = _cruise;
            station       = _station;
            deployment    = _deployment;
            classToPlot   = _classToPlot;
            sizeMin       = _sizeMin;
            sizeMax       = _sizeMax;
            probMin       = _probMin;
            probMax       = _probMax;
            depthMin      = _depthMin;
            depthMax      = _depthMax;
            classKeyToUse = _classKeyToUse;
            classes       = _classes;
            activeClasses = _activeClasses;
            rootDir       = _rootDir;

            if ((sizeMin > 0) && (sizeMax <= 0))
            {
                sizeMax = int.MaxValue;
            }
            if ((probMin >= 0.0f) && (probMax <= 0.0f))
            {
                probMax = 1.0f;
            }
            if ((depthMin > 0.0f) && (depthMax <= 0.0f))
            {
                depthMax = float.MaxValue;
            }

            filterSize  = (sizeMin > 0) || ((sizeMax > 0) && (sizeMax > sizeMin));
            filterProb  = ((probMin > 0.0f) || (probMax < 1.0f)) && (probMax > probMin);
            filterDepth = ((depthMax > 0) && (depthMax > depthMin));

            statusMsgs = new PicesMsgQueue("ChartAbundanceByDeployment-StatusMsgs");
            msgQueue   = new PicesMsgQueue("ChartAbundanceByDeployment-RunLog");
            runLog     = new PicesRunLog(msgQueue);

            mainWinConn = PicesDataBase.GetGlobalDatabaseManagerNewInstance(runLog);

            configFileName = OSservices.AddSlash(PicesSipperVariables.ConfigurationDirectory()) + "ChartAbundanceByDeployment.cfg";

            BuildCriteriaString();

            InitializeComponent();
        }
示例#7
0
        private string  ConstructInstrumentFileName(string sipperFileName)
        {
            String instDataDir = OSservices.AddSlash(PicesSipperVariables.SipperInterfaceDir()) + "InstrumentData";

            if (instDataDir == "")
            {
                instDataDir = OSservices.AddSlash(PicesSipperVariables.SipperInterfaceDir()) + "InstrumentData";
            }
            OSservices.CreateDirectory(instDataDir);

            string instDataRootName = sipperFileName;

            if (instDataRootName == "")
            {
                instDataRootName = "InstrumentData";
            }
            else
            {
                instDataRootName = instDataRootName + "_InstrumentData";
            }

            string instDataFileName = OSservices.AddSlash(instDataDir) + instDataRootName + ".txt";

            return(instDataFileName);
        } /* ConstructInstrumentFileName */
示例#8
0
        public void  Load()
        {
            string temp = "";

            headerRec = new SipperHeaderRec();

            string sipperInterfaceDir = PicesSipperVariables.SipperInterfaceDir();

            //checking to see if the config file exist and if so load that first
            if (!File.Exists(sipperConfigurationFileName))
            {
                loadedFromConfigFile = false;
            }
            else
            {
                StreamReader Reader = new StreamReader(sipperConfigurationFileName);

                while ((temp = Reader.ReadLine()) != null)
                {
                    ParseConfigTextLine(temp);
                }

                Reader.Close();
                loadedFromConfigFile = true;
            }

            return;
        } /* Load */
示例#9
0
        public ChartSizeDistribution(String _cruise,
                                     String _station,
                                     String _deployment,
                                     PicesClass _classToPlot,
                                     PicesClassList _classes,
                                     PicesClassList _activeClasses,
                                     String _rootDir
                                     )
        {
            cruise        = _cruise;
            station       = _station;
            deployment    = _deployment;
            classToPlot   = _classToPlot;
            classes       = _classes;
            activeClasses = _activeClasses;
            rootDir       = _rootDir;

            lastSaveDirectory = OSservices.AddSlash(PicesSipperVariables.PicesReportDir()) + "AbundanceReports";

            statusMsgs = new PicesMsgQueue("ChartSizeDistribution-StatusMsgs");
            msgQueue   = new PicesMsgQueue("ChartSizeDistribution-RunLog");
            runLog     = new PicesRunLog(msgQueue);

            mainWinConn = PicesDataBase.GetGlobalDatabaseManagerNewInstance(runLog);

            configFileName = OSservices.AddSlash(PicesSipperVariables.ConfigurationDirectory()) + "ChartSizeDistribution.cfg";

            InitializeComponent();
        }
示例#10
0
        private void  DeleteCruise(Object sender, EventArgs e)
        {
            if (!PicesSipperVariables.AllowUpdates())
            {
                return;
            }

            if (cruise == null)
            {
                return;
            }
            CruiseDialog sd = new CruiseDialog(cruise, dbConn, runLog, false, true);

            sd.ShowDialog();
            this.Text = this.ToString();
            if (sd.CruiseDeleted)
            {
                if (this.Parent != null)
                {
                    this.Parent.Nodes.Remove(this);
                    return;
                }

                this.Text             = "Cruise[" + cruise.CruiseName + "]   ***Deleted***";
                this.ContextMenuStrip = null;
                this.cruise           = null;
            }
        } /* DeleteCruise */
示例#11
0
        private void  PerformUpdate()
        {
            if (!allowUpdates)
            {
                PicesSipperVariables.UpdatesNotAllowed("Deployment Dialog");
                return;
            }

            PopulateDeploymentFromScreen();
            if (addingNewDeployment)
            {
                DbConn().SipperDeploymentInsert(deployment);
            }

            else if (deletingDeployment)
            {
                DbConn().SipperDeploymentDelete(deployment.CruiseName, deployment.StationName, deployment.DeploymentNum);
                if (DbConn().Valid())
                {
                    deploymentDeleted = true;
                }
            }

            else
            {
                DbConn().SipperDeploymentUpdate(deployment);
            }

            if (!DbConn().LastOpSuccessful)
            {
                MessageBox.Show(this, "Update operation failed.\n\n" + DbConn().LastErrorDesc(), "Update MySQL Server", MessageBoxButtons.OK);
            }
        }
示例#12
0
        } /* ValidateAllFields */

        private void  PerformUpdate()
        {
            if (!allowUpdates)
            {
                PicesSipperVariables.UpdatesNotAllowed("Sipper File Dialog");
                return;
            }


            UpdateFromScreen();

            if (addMode)
            {
                DbConn().SipperFileInsert(sipperFile);
            }
            else
            {
                DbConn().SipperFileUpdate(sipperFile);
            }

            if (DbConn().Valid())
            {
                Close();
            }
            else
            {
                MessageBox.Show(this, "Update of database failed.\n\n" + DbConn().LastErrorDesc(), "Update Failed", MessageBoxButtons.OK);
            }
        }
示例#13
0
        public ClassMaintenance()
        {
            runLog         = new PicesRunLog();
            runLogGoalie   = new PicesGoalKeeper("Harvesting Run Log");
            runLogMsgQueue = new Queue <String> ();

            InitializeComponent();

            allowUpdates = PicesSipperVariables.AllowUpdates();
        }
示例#14
0
        private List <String> imageFileErrorList = null;         // Will contain a list of Image File Names that could not be inserted.



        public ImportGroupAssignments()
        {
            runLogMsgQueue = new PicesMsgQueue("ImportGroupAssignemnts");
            runLog         = new PicesRunLog(runLogMsgQueue);
            mainWinConn    = PicesDataBase.GetGlobalDatabaseManagerNewInstance(runLog);

            InitializeComponent();

            SourceDirectory.Text = PicesSipperVariables.HomeDir();
        }
示例#15
0
        } /* PaintErrorRetreivingCammeraLineData   */

        private void  SaveImageInLogDirectory()
        {
            if (chartBuff != null)
            {
                DateTime d           = DateTime.Now;
                string   logFileDir  = OSservices.AddSlash(PicesSipperVariables.SipperInterfaceLogDir()) + "CameraLines";
                string   logFileName = OSservices.AddSlash(logFileDir) + "CameraLine_" + d.ToString("yyyy-MM-dd_HHmmss") + ".jpg";
                OSservices.CreateDirectory(logFileDir);
                chartBuff.Save(logFileName);
            }
        } /* SaveImageInLogDirectory */
示例#16
0
        private void  ConfigurationLoad()
        {
            configFileName = OSservices.AddSlash(PicesSipperVariables.ConfigurationDirectory()) + "ImageViewer.cfg";
            System.IO.StreamReader i = null;
            dataFieldAssignments    = new int[4];
            dataFieldAssignments[0] = PicesInstrumentData.GetFieldNum("Depth");
            dataFieldAssignments[1] = PicesInstrumentData.GetFieldNum("Temperature");
            dataFieldAssignments[2] = PicesInstrumentData.GetFieldNum("Oxygen");
            dataFieldAssignments[3] = PicesInstrumentData.GetFieldNum("Salinity");

            try { i = new System.IO.StreamReader(configFileName); }  catch (Exception) { i = null; }
            if (i != null)
            {
                String nextLine = null;

                while (true)
                {
                    try  { nextLine = i.ReadLine(); }  catch (Exception) { break; }
                    if (nextLine == null)
                    {
                        break;
                    }

                    nextLine = nextLine.Trim();

                    if ((nextLine.Length < 3) || (nextLine.Substring(0, 2) == "//"))
                    {
                        continue;
                    }

                    String[] fields = nextLine.Split('\t');
                    if (fields.Length != 2)
                    {
                        continue;
                    }

                    String fieldName  = fields[0];
                    String fieldValue = fields[1];

                    switch (fieldName)
                    {
                    case  "DataLabel0":  dataFieldAssignments[0] = PicesInstrumentData.GetFieldNum(fieldValue);   break;

                    case  "DataLabel1":  dataFieldAssignments[1] = PicesInstrumentData.GetFieldNum(fieldValue);   break;

                    case  "DataLabel2":  dataFieldAssignments[2] = PicesInstrumentData.GetFieldNum(fieldValue);   break;

                    case  "DataLabel3":  dataFieldAssignments[3] = PicesInstrumentData.GetFieldNum(fieldValue);   break;
                    }
                }

                i.Close();
            }
        } /* ConfigurationLoad */
示例#17
0
        static void Main()
        {
#if DEBUG
            PicesMethods.StartMemoryLeakDetection();
#endif
            PicesSipperVariables.InitializeEnvironment();
            PicesDataBase.Initialization();
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new PicesCommander());
            GC.Collect();
        }
示例#18
0
        public SipperSimulator(String sipperFileName)
        {
            InitializeComponent();

            if (String.IsNullOrEmpty(sipperFileName))
            {
                sipperFileName = "C:\\Pices\\SipperFiles\\WB0813\\WB0813DSH09\\WB0813DSH09_03.spr";
            }

            //ConvertCTDfile ();

            simulatorDir = OSservices.AddSlash(OSservices.AddSlash(PicesSipperVariables.SipperInterfaceDir()) + "Simulator");

            configRec      = new SipperConfigRec();
            currentDataRow = new InstrumentData();

            conversationBuffer   = Queue.Synchronized(new Queue());
            serialPortBuffers    = new SerialPortBuffer[3];
            serialPortBuffers[0] = new SerialPortBuffer(512);
            serialPortBuffers[1] = new SerialPortBuffer(512);
            serialPortBuffers[2] = new SerialPortBuffer(512);

            // SplitFile ();
            // ChkFile ();
            //LoadSipperFile();

            ctdData         = new List <char>();
            ctdDataNextByte = 0;

            pitchRollData        = new ArrayList();
            pitchRollDataNextRow = 0;

            ExtractDataFromSIPPERFile(sipperFileName);

            LoadCameraLines();

            batteryPack  = new BatteryPack();
            sipperCamera = new SipperCamera();

            ctdThread      = new Thread(new ThreadStart(CTDDataInstrument));
            ctdThread.Name = "SipperCtdData";
            ctdThread.Start();

            pitchRollThread      = new Thread(new ThreadStart(PitchRollDataInstrument));
            pitchRollThread.Name = "SipperPitchRollData";
            pitchRollThread.Start();

            batteryPackThread      = new Thread(new ThreadStart(BatteryPackInstrument));
            batteryPackThread.Name = "SipperBatteryData";
            batteryPackThread.Start();

            LoadSipperFilesNames();
        }
示例#19
0
        private void CruiseDialog_Load(object sender, EventArgs e)
        {
            if (runLog == null)
            {
                runLog = new PicesRunLog();
            }

            allowUpdates = PicesSipperVariables.AllowUpdates();

            PopulateScreen();
            LoadCruiseDetails();
            EnableFields();
        }
示例#20
0
        public ChartGPSByStation(String _stationName)
        {
            stationName = _stationName;

            statusMsgs = new PicesMsgQueue("ChartGPSByStation-StatusMsgs");
            msgQueue   = new PicesMsgQueue("ChartGPSByStation-RunLog");
            runLog     = new PicesRunLog(msgQueue);

            mainWinConn = PicesDataBase.GetGlobalDatabaseManagerNewInstance(runLog);

            configFileName = OSservices.AddSlash(PicesSipperVariables.ConfigurationDirectory()) + "ChartGPSByStation.cfg";

            InitializeComponent();
        }
示例#21
0
        public DeploymentDialog(PicesSipperDeployment _deployment,
                                bool _addingNewDeployment,
                                bool _deletingDeployment
                                )
        {
            allowUpdates        = PicesSipperVariables.AllowUpdates();
            deployment          = _deployment;
            addingNewDeployment = _addingNewDeployment;
            deletingDeployment  = _deletingDeployment;

            runLog = new PicesRunLog();

            InitializeComponent();
        }
示例#22
0
        public GetRunTimeParameters()
        {
            msgQueue = new PicesMsgQueue("GradeTrainingModel");
            runLog   = new PicesRunLog(msgQueue);

            InitializeComponent();
            noAgreementClass = PicesClassList.GetUniqueClass("NoAgreement", "");

            configFileName = OSservices.AddSlash(PicesSipperVariables.ConfigurationDirectory()) + "GradeTrainingModel.txt";

            LoadTrainingModelComboBox();
            InitializeTrainAndPredLevelFields();
            EnableComponentsForParameterEntry();
        }
示例#23
0
        private void  PerformUpdate()
        {
            if (!allowUpdates)
            {
                PicesSipperVariables.UpdatesNotAllowed("Cruise Dialog");
                return;
            }
            cruise.CruiseName  = CruiseName.Text;
            cruise.ShipName    = ShipName.Text;
            cruise.Description = Description.Text;
            cruise.DateStart   = DateStart.Value;
            cruise.DateEnd     = DateEnd.Value;
            cruise.Location    = CruiseLocation.Text;
            cruise.Objective   = Objective.Text;
            cruise.Principal   = Principal.Text;
            cruise.ResearchOrg = ResearchOrg.Text;

            if (addingNewCruise)
            {
                DbConn().SipperCruiseInsert(cruise);
            }

            else if (deletingCruise)
            {
                DbConn().SipperCruiseDelete(CruiseName.Text);
            }

            else
            {
                DbConn().SipperCruiseUpdate(cruise);
            }

            if (DbConn().Valid())
            {
                if (deletingCruise)
                {
                    cruiseDeleted = true;
                }
                if (addingNewCruise)
                {
                    cruiseAdded = true;
                }
                Close();
            }
            else
            {
                MessageBox.Show(DbConn().LastErrorDesc(), "Update Failed");
            }
        } /* PerformUpdate */
        private void CreateFeatureSelectionDataSets_Load(object sender, EventArgs e)
        {
            modelNames = TrainingModel2.GetListOfTrainingModels();
            if (modelNames != null)
            {
                foreach (String s in modelNames)
                {
                    ModelName.Items.Add(s);
                }
            }

            ModelName.Text = initialModelName;

            UpdatePercentageFields();
            DestinationDirectory.Text = OSservices.AddSlash(PicesSipperVariables.DataFilesDirectory()) + "FeatureSelection";
        }
示例#25
0
        public SipperDiskManager()
        {
            destDir = OSservices.AddSlash(PicesSipperVariables.HomeDir()) + "SipperFiles";
            OSservices.CreateDirectory(destDir);

            InitializeComponent();

            UpdateAvailableBytes();
            DownLoadDir.Text = destDir;

            selectedFiles = new SipperFileControlBlockList();
            UpdateAvailableBytes();

            oldHeight = this.Height;
            oldWidth  = this.Width;
        }
示例#26
0
        public ImportValidatdClass()
        {
            runLog      = new PicesRunLog();
            mainWinConn = PicesDataBase.GetGlobalDatabaseManagerNewInstance(runLog);

            runLogGoalie   = new PicesGoalKeeper("ImportValidatingClass");
            runLogMsgQueue = new Queue <String> ();

            sipperFile   = mainWinConn.SipperFileRecLoad(sipperFileName);
            unknownClass = GetClassFromName(mainWinConn, "UnKnown");

            InitializeComponent();

            SourceDirectory.Text = PicesSipperVariables.HomeDir();
            SourceDirectory.Text = "D:\\Users\\kkramer\\PlanktonCompetition\\trunk\\Data\\";
        }
示例#27
0
        public TimePlot(SipperConfigRec _sipperConfigRec,
                        InstrumentDataList _history
                        )
        {
            OSservices.CreateDirectory(PicesSipperVariables.ConfigurationDirectory());
            timePlotConfigFileName = OSservices.AddSlash(PicesSipperVariables.ConfigurationDirectory()) + "TimePlotConfig.txt";

            sipperConfigRec = _sipperConfigRec;
            history         = _history;
            InitializeComponent();
            InitializeVariables();
            LoadConfiguration();

            SetToLiveMode();
            updateChartTimer.Enabled = true;
        }
示例#28
0
        private void AddNewCruiseButton_Click(object sender, EventArgs e)
        {
            if (!PicesSipperVariables.AllowUpdates())
            {
                MessageBox.Show(this, "Updates are not allowed.", "Cruise Maintenance", MessageBoxButtons.OK);
                return;
            }

            PicesSipperCruise newCruise = new PicesSipperCruise();
            CruiseDialog      cd        = new CruiseDialog(newCruise, DbConn(), runLog, true, false);

            cd.ShowDialog(this);
            if (cd.CruiseAdded)
            {
                CruiseTreeList.Nodes.Add(new TreeNodeCruise(DbConn(), runLog, newCruise));
            }
        }
示例#29
0
        public InstrumentDataByDeploymentProfile(String _cruiseName,
                                                 String _stationName,
                                                 String _deploymentNum,
                                                 PicesClass _mlClass
                                                 )
        {
            cruiseName    = _cruiseName;
            stationName   = _stationName;
            deploymentNum = _deploymentNum;
            mlClass       = _mlClass;

            reportFileDir = OSservices.AddSlash(PicesSipperVariables.PicesReportDir()) + "InstrumentSummariesByDeployment";

            runLogGoalie = new PicesGoalKeeper("InstrumentDataByDeploymentProfile");

            InitializeComponent();
        }
示例#30
0
        public TreeNodeDeployment(PicesDataBase _dbConn,
                                  PicesSipperDeployment _deployment
                                  )
        {
            allowUpdates = PicesSipperVariables.AllowUpdates();
            dbConn       = _dbConn;
            deployment   = _deployment;
            Text         = ToString();
            ContextMenuStrip cms = new ContextMenuStrip();

            cms.Items.Add("Edit Deployment Parameters", null, EditDeploymentParameters);
            if ((this.Nodes.Count < 1) && allowUpdates)
            {
                cms.Items.Add("Delete Deployment", null, DeleteDeployment);
            }
            this.ContextMenuStrip = cms;
            LoadSipperFileDetails();
        }