private void AutoSchemesOnAddingNew(object sender, AddingNewEventArgs addingNewEventArgs)
        {
            var apc = new AutoProtectionCriterions();

            addingNewEventArgs.NewObject = apc;
            apc.Name += _autoSchemes.Count == 0 ? "" : _autoSchemes.Count.ToString();
        }
        private void RefreshDgvDataSource(AutoProtectionCriterions autoProtectionCriterions)
        {
            // 边坡的自动防护
            dgv_Slope.SetDataSource(autoProtectionCriterions.SlopeCriterions);

            // 平台的自动防护
            // dgv_Platform.SetDataSource(autoProtectionCriterions.PlatformCriterions);
        }
Exemple #3
0
        /// <summary> 导入自动防护规则 </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btn_btn_ImportProtectRull_Click(object sender, EventArgs e)
        {
            var f   = AutoProtectionForm.GetUniqueInstance();
            var res = f.ShowDialog();

            if (res == DialogResult.OK)
            {
                _autoSpCriterion = f.ActiveSpCriterion;
            }
        }
        private AutoProtectionForm()
        {
            InitializeComponent();

            // 构造初始的自动防护数据
            if (LoadedSpCriterions == null)
            {
                LoadedSpCriterions = new List <AutoProtectionCriterions>();
            }
            if (LoadedSpCriterions.Count == 0)
            {
                var defaultSPC = new AutoProtectionCriterions();
                LoadedSpCriterions.Add(defaultSPC);
            }
            ActiveSpCriterion = LoadedSpCriterions[0];
            //
            ConstructUI();
        }
        private void CbbAutoSchemesOnSelectedValueChanged(object sender, EventArgs eventArgs)
        {
            var src = cbb_AutoSchemes.SelectedItem as AutoProtectionCriterions;

            ActiveSpCriterion = src;
        }