Ejemplo n.º 1
0
        private void btnCustomMonitor_Click(object sender, EventArgs e)
        {
            FilterMonitors frm = new FilterMonitors();

            frm.MonitorAdvanceFilter = MyMonitorAdvance;
            frm.bcg       = bcg;
            frm.mDataLine = mDataLine;
            DialogResult rtn = frm.ShowDialog();

            if (rtn == DialogResult.OK)
            {
                MyMonitorAdvance = frm.MonitorAdvanceFilter;
            }
        }
Ejemplo n.º 2
0
        private void btnAdvanced_Click(object sender, EventArgs e)
        {
            if (cboRollbackGridType.SelectedIndex == -1)
            {
                MessageBox.Show("Please select rollback grid type first.");
                return;
            }
            if (tabControl1.SelectedIndex == 0)
            {
                if (cboMonitorDataSet.SelectedIndex == -1 || cboMonitorLibraryYear.SelectedIndex == -1)
                {
                    MessageBox.Show("Please select monitor library year."); return;
                }
                _monitorRollbackLine.MonitorDirectType  = 0;
                _monitorRollbackLine.MonitorDataSetID   = Convert.ToInt32((cboMonitorDataSet.SelectedItem as DataRowView)["MonitorDataSetID"]);
                _monitorRollbackLine.MonitorLibraryYear = Convert.ToInt32((cboMonitorLibraryYear.SelectedItem as DataRowView)["Yyear"]);
                _strPath = "Monitor Rollback: libary";
            }
            else if (tabControl1.SelectedIndex == 1)
            {
                if (txtMonitorDataFile.Text == "")
                {
                    MessageBox.Show("Please select monitor data file."); return;
                }
                _monitorRollbackLine.MonitorDirectType   = 1;
                _monitorRollbackLine.MonitorDataFilePath = txtMonitorDataFile.Text;
                _strPath = "Monitor Rollback: " + txtMonitorDataFile.Text;
            }
            _monitorRollbackLine.RollbackGrid = _monitorRollbackGrid;
            _monitorRollbackLine.GridType     = CommonClass.GBenMAPGrid;
            _monitorRollbackLine.Pollutant    = _bgc.Pollutant;
            MonitorAdvance MyMonitorAdvance = new MonitorAdvance()
            {
            };

            if (_monitorRollbackLine.MonitorAdvance != null)
            {
                MyMonitorAdvance = new MonitorAdvance()
                {
                    DataTypesToUse              = _monitorRollbackLine.MonitorAdvance.DataTypesToUse,
                    EndDate                     = _monitorRollbackLine.MonitorAdvance.EndDate,
                    EndHour                     = _monitorRollbackLine.MonitorAdvance.EndHour,
                    FilterExcludeIDs            = _monitorRollbackLine.MonitorAdvance.FilterExcludeIDs,
                    FilterIncludeIDs            = _monitorRollbackLine.MonitorAdvance.FilterIncludeIDs,
                    FilterMaximumPOC            = _monitorRollbackLine.MonitorAdvance.FilterMaximumPOC,
                    FilterMaxLatitude           = _monitorRollbackLine.MonitorAdvance.FilterMaxLatitude,
                    FilterMaxLongitude          = _monitorRollbackLine.MonitorAdvance.FilterMaxLongitude,
                    FilterMinLatitude           = _monitorRollbackLine.MonitorAdvance.FilterMinLatitude,
                    FilterMinLongitude          = _monitorRollbackLine.MonitorAdvance.FilterMinLongitude,
                    FilterStates                = _monitorRollbackLine.MonitorAdvance.FilterStates,
                    GetClosedIfNoneWithinRadius = _monitorRollbackLine.MonitorAdvance.GetClosedIfNoneWithinRadius,
                    IncludeMethods              = _monitorRollbackLine.MonitorAdvance.IncludeMethods,
                    MaxinumNeighborDistance     = _monitorRollbackLine.MonitorAdvance.MaxinumNeighborDistance,
                    NumberOfPerQuarter          = _monitorRollbackLine.MonitorAdvance.NumberOfPerQuarter,
                    NumberOfValidHour           = _monitorRollbackLine.MonitorAdvance.NumberOfValidHour,
                    OutputType                  = _monitorRollbackLine.MonitorAdvance.OutputType,
                    PercentOfValidDays          = _monitorRollbackLine.MonitorAdvance.PercentOfValidDays,
                    POCPreferenceOrder          = _monitorRollbackLine.MonitorAdvance.POCPreferenceOrder,
                    PreferredType               = _monitorRollbackLine.MonitorAdvance.PreferredType,
                    RelativeNeighborDistance    = _monitorRollbackLine.MonitorAdvance.RelativeNeighborDistance,
                    StartDate                   = _monitorRollbackLine.MonitorAdvance.StartDate,
                    StartHour                   = _monitorRollbackLine.MonitorAdvance.StartHour,
                    WeightingApproach           = _monitorRollbackLine.MonitorAdvance.WeightingApproach
                };
            }
            FilterMonitors frm = new FilterMonitors();

            frm.MonitorAdvanceFilter = MyMonitorAdvance;
            frm.bcg       = this._bgc;
            frm.mDataLine = _monitorRollbackLine;
            DialogResult rtn = frm.ShowDialog();

            if (rtn == DialogResult.OK)
            {
                MyMonitorAdvance = frm.MonitorAdvanceFilter;
                _monitorRollbackLine.MonitorAdvance = MyMonitorAdvance;
            }
        }