Пример #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  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 */
Пример #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
        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 */
Пример #5
0
        public ClassMaintenance()
        {
            runLog         = new PicesRunLog();
            runLogGoalie   = new PicesGoalKeeper("Harvesting Run Log");
            runLogMsgQueue = new Queue <String> ();

            InitializeComponent();

            allowUpdates = PicesSipperVariables.AllowUpdates();
        }
Пример #6
0
        private void CruiseDialog_Load(object sender, EventArgs e)
        {
            if (runLog == null)
            {
                runLog = new PicesRunLog();
            }

            allowUpdates = PicesSipperVariables.AllowUpdates();

            PopulateScreen();
            LoadCruiseDetails();
            EnableFields();
        }
Пример #7
0
        public DeploymentDialog(PicesSipperDeployment _deployment,
                                bool _addingNewDeployment,
                                bool _deletingDeployment
                                )
        {
            allowUpdates        = PicesSipperVariables.AllowUpdates();
            deployment          = _deployment;
            addingNewDeployment = _addingNewDeployment;
            deletingDeployment  = _deletingDeployment;

            runLog = new PicesRunLog();

            InitializeComponent();
        }
Пример #8
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));
            }
        }
Пример #9
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();
        }
Пример #10
0
        } /* DeleteCruise */

        private void  AddANewStation(Object sender, EventArgs e)
        {
            if (!PicesSipperVariables.AllowUpdates())
            {
                return;
            }

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

            dd.ShowDialog();
            LoadStationDetails();
            this.Text = this.ToString();
        }
Пример #11
0
        public GroupMaintenance()
        {
            allowUpdates = PicesSipperVariables.AllowUpdates();

            runLog = new PicesRunLog();
            InitializeComponent();

            DataGridViewCellStyle style = ImageGroupGrid.Columns[0].DefaultCellStyle;

            if (style == null)
            {
                style           = new DataGridViewCellStyle();
                style.Alignment = DataGridViewContentAlignment.MiddleCenter;
            }
            style.Alignment = DataGridViewContentAlignment.MiddleCenter;
            ImageGroupGrid.Columns[0].DefaultCellStyle = style;
            ImageGroupGrid.Columns[3].DefaultCellStyle = style;
        }
Пример #12
0
        public CruiseDialog(String _cruiseName,
                            PicesRunLog _runLog
                            )
        {
            runLog      = _runLog;
            weOwnDbConn = true;

            cruise = DbConn().SipperCruiseLoad(_cruiseName);
            if (cruise == null)
            {
                cruise            = new PicesSipperCruise();
                cruise.CruiseName = _cruiseName;
                addingNewCruise   = true;
            }

            InitializeComponent();

            allowUpdates = PicesSipperVariables.AllowUpdates();
        }
Пример #13
0
        public SipperFileDialog(String _siperFileName,
                                PicesRunLog _runLog
                                )
        {
            runLog     = _runLog;
            sipperFile = DbConn().SipperFileRecLoad(_siperFileName);
            if (sipperFile == null)
            {
                sipperFile = new PicesSipperFile(_siperFileName);
                sipperFile.SipperFileName = _siperFileName;
                addMode = true;
            }

            InitializeComponent();

            allowUpdates = PicesSipperVariables.AllowUpdates();

            PopulateScreen();
        }
Пример #14
0
        public StationDialog(PicesSipperStation _station,
                             PicesDataBase _dbConn,
                             PicesRunLog _runLog,
                             bool _addingNewStation,
                             bool _deletingStation
                             )
        {
            station          = _station;
            dbConn           = _dbConn;
            runLog           = _runLog;
            addingNewStation = _addingNewStation;
            deletingStation  = _deletingStation;

            if (runLog == null)
            {
                runLog = new PicesRunLog();
            }

            InitializeComponent();

            allowUpdates = PicesSipperVariables.AllowUpdates();
        }
Пример #15
0
        private void SipperFileDialog_Load(object sender, EventArgs e)
        {
            allowUpdates = PicesSipperVariables.AllowUpdates();

            if (runLog == null)
            {
                runLog = new PicesRunLog();
            }

            LoadValidCTDExtrnlPorts();

            String[]   fieldNames = { "NumScanLines", "DateTimeStart", "NumImages" };
            String[][] results    = DbConn().QueryStatement("call SipperFilesCalcStats(\"" + sipperFile.SipperFileName + "\")",
                                                            fieldNames
                                                            );

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

            uint numScanLines = PicesKKStr.StrToUint(results[0][0]);
            uint numImages    = PicesKKStr.StrToUint(results[0][2]);

            if (numScanLines > 0)
            {
                ScanLines.Text = numScanLines.ToString("###,###,##0");
            }

            if (numImages > 0)
            {
                NumImages.Text = numImages.ToString("###,###,##0");
            }

            latitude  = sipperFile.Latitude;
            longitude = sipperFile.Longitude;

            PopulateScreen();
        } /* SipperFileDialog_Load */
Пример #16
0
        } /* DeleteStation */

        private void  AddANewDeployment(Object sender, EventArgs e)
        {
            if (!PicesSipperVariables.AllowUpdates())
            {
                return;
            }

            if (station == null)
            {
                return;
            }
            PicesSipperDeployment deployment = new PicesSipperDeployment(station.CruiseName, station.StationName);

            deployment.Latitude      = station.Latitude;
            deployment.Longitude     = station.Longitude;
            deployment.DeploymentNum = nextDeploymentNum;

            DeploymentDialog dd = new DeploymentDialog(deployment, true, false);

            dd.ShowDialog();
            LoadDeploymentDetails();
            this.Text = this.ToString();
        }
Пример #17
0
        } /* PerformUpdate*/

        private void StationDialog_Load(object sender, EventArgs e)
        {
            allowUpdates = PicesSipperVariables.AllowUpdates();
            PopulateScreen();
        }