Beispiel #1
0
 private void ActiveRun(object sender, EventArgs e)//算法动态展示
 {
     FormOperating formOperating = new FormOperating(this.myOperator,new Resourse(trackBarA.Value, trackBarB.Value, trackBarC.Value), comboBox_selectProcess.SelectedItem.ToString());
     formOperating.StartPosition = FormStartPosition.CenterScreen;
     formOperating.Show();
     update_draw(sender, e);
     formOperating.TransfEvent +=new FormOperating.TransfDelegate(refresh);
 }
Beispiel #2
0
        private void useTemp_Click(object sender, EventArgs e)//使用模板运行按钮被点击
        {
            if(this.myOperator.available.A!=12|| this.myOperator.available.B != 5|| this.myOperator.available.C != 9)
            {
                MessageBox.Show("无法使用模板,因为你已经进行过资源分配,请点击刷新键重置后再使用模板");
                return;
            }
            switch (comboBox_selectTemp.SelectedIndex)//模板内容配置并以此生成算法动态展示界面
            {
                case -1:
                    {
                        MessageBox.Show("还未选择默认模板");
                        break;
                    }
                case 0:
                    {
                        myOperator.addRequest(2, 2, 2, "P0");
                        FormOperating formOperating = new FormOperating(this.myOperator, new Resourse(1,0,1),"P1");
                        formOperating.StartPosition = FormStartPosition.CenterScreen;
                        formOperating.Show();
                        update_draw(sender, e);
                        formOperating.TransfEvent += new FormOperating.TransfDelegate(refresh);
                        break;
                    }
                case 1:
                    {

                        FormOperating formOperating = new FormOperating(this.myOperator, new Resourse(4, 1, 1), "P3");
                        formOperating.Show();
                        update_draw(sender, e);
                        formOperating.TransfEvent += new FormOperating.TransfDelegate(refresh);
                        break;
                    }
                case 2:
                    {
                        myOperator.addRequest(3, 3, 3, "P4");
                        FormOperating formOperating = new FormOperating(this.myOperator, new Resourse(7, 0, 0), "P0");
                        formOperating.Show();
                        update_draw(sender, e);
                        formOperating.TransfEvent += new FormOperating.TransfDelegate(refresh);
                        break;
                    }
                case 3:
                    {
                        myOperator.addRequest(3, 3, 3, "P4");
                        FormOperating formOperating = new FormOperating(this.myOperator, new Resourse(8, 0, 0), "P0");
                        formOperating.Show();
                        update_draw(sender, e);
                        formOperating.TransfEvent += new FormOperating.TransfDelegate(refresh);
                        break;
                    }
                default:
                    {
                        listBox_tempDetail.Items.Add("出现了问题");
                        break;
                    }
            }
        }