Exemplo n.º 1
0
        private void StatusButton_Click(object sender, EventArgs e)
        {
            switch (runningStatus)
            {
            case 1:
                ProcessController.Pause();
                runningStatus     = 2;
                statusButton.Text = "继续";
                break;

            case 0:
                ProcessController.ToForm += showList;
                ProcessController.Pause();
                runningStatus     = 1;
                statusButton.Text = "暂停";
                break;

            case 2:
                ProcessController.Pause();
                runningStatus     = 1;
                statusButton.Text = "暂停";
                break;

            default:
                break;
            }
        }
Exemplo n.º 2
0
        private void RandomButton_Click(object sender, EventArgs e)
        {
            int timeLength = this.RadioButton1.Checked ? -1 : (int)(this.TimeSizeNumeric.Value);

            this.ProcessData = ProcessController.CreateRandomProcesses(
                (int)this.ProcessNumNumeric.Value,
                timeLength,
                (int)this.MiniumArrivalNumeric.Value,
                (int)this.MaxiumArrivalNumeric.Value,
                (int)this.MiniumRunNumeric.Value,
                (int)this.MaxiumrunNumeric.Value,
                (int)this.MiniumPriorityNumeric.Value,
                (int)this.MaxiumPriorityNumeric.Value
                );
            // Set the view to show details.
            ProcessListView.View = View.Details;
            // Allow the user to edit item text.
            ProcessListView.LabelEdit = true;
            // Allow the user to rearrange columns.
            ProcessListView.AllowColumnReorder = true;
            // Display grid lines.
            ProcessListView.GridLines = true;

            //Add the items to the ListView.
            ProcessListView.Items.Clear();
            for (int i = 0; i < ProcessData.Count(); i++)
            {
                ListViewItem tmp = new ListViewItem(ProcessData[i].Name, 0);
                tmp.SubItems.Add(ProcessData[i].Createtime.ToString());
                tmp.SubItems.Add(ProcessData[i].Cputime.ToString());
                tmp.SubItems.Add(runningType == 3 ? ProcessData[i].Priority.ToString() : "-");
                ProcessListView.Items.Add(tmp);
            }
        }
Exemplo n.º 3
0
 private void ShowMainPanel()
 {
     this.panel1.Show();
     this.ProcessPanel.Hide();
     ProcessController.Shut();
     this.ProcessControl.restartList();
 }
Exemplo n.º 4
0
 private void ShowMainPanel()
 {
     this.panel1.Show();
     this.ProcessPanel.Hide();
     ProcessController.Shut();
     this.ProcessPanel.Controls.Clear();
     this._ProcessControl?.Dispose();
     //this.ProcessControl.restartList();
 }
Exemplo n.º 5
0
        public void CreateProcessSimulationTest()
        {
            int min_a = 1;
            int max_a = 100;
            int min_b = 1;
            int max_b = 100;

            ProcessController.CreateProcessSimulation()
        }
Exemplo n.º 6
0
        private void StartButton_Click(object sender, EventArgs e)
        {
            StartButtonClicked?.Invoke();
            List <Process> CopyProcessData = new List <Process>();

            ProcessData.ForEach((u) =>
            {
                CopyProcessData.Add(new Process(u));
            });
            ProcessController.CreateProcessSimulation(runningType == 3, CopyProcessData, 1, (int)CoreNumeric.Value);
        }
Exemplo n.º 7
0
        private void RandomButton_Click(object sender, EventArgs e)
        {
            int timeLength = this.radioButton1.Checked ? -1 : (int)(this.timeSizeNumeric.Value);

            this.ProcessData = ProcessController.CreateRandomProcesses(
                (int)this.processNumNumeric.Value,
                timeLength,
                (int)this.miniumArrivalNumeric.Value,
                (int)this.maxiumArrivalNumeric.Value,
                (int)this.miniumRunNumeric.Value,
                (int)this.maxiumrunNumeric.Value,
                (int)this.miniumPriorityNumeric.Value,
                (int)this.maxiumPriorityNumeric.Value
                );
            // Set the view to show details.
            processListView.View = View.Details;
            // Allow the user to edit item text.
            processListView.LabelEdit = true;
            // Allow the user to rearrange columns.
            processListView.AllowColumnReorder = true;
            // Display check boxes.
            //listView1.CheckBoxes = true;
            // Select the item and subitems when selection is made.
            //listView1.FullRowSelect = true;
            // Display grid lines.
            processListView.GridLines = true;
            // Sort the items in the list in ascending order.
            // processListView.Sorting = SortOrder.Ascending;

            //Add the items to the ListView.
            processListView.Items.Clear();
            for (int i = 0; i < ProcessData.Count(); i++)
            {
                ListViewItem tmp = new ListViewItem(ProcessData[i].Name, 0);
                tmp.SubItems.Add(ProcessData[i].Createtime.ToString());
                tmp.SubItems.Add(ProcessData[i].Cputime.ToString());
                tmp.SubItems.Add(runningType == 3 ? ProcessData[i].Priority.ToString() : "-");
                processListView.Items.Add(tmp);
            }
            //processListView.Items.AddRange(new ListViewItem[] { item1, item2, item3 });

            // Create two ImageList objects.
            //ImageList imageListSmall = new ImageList();
            //ImageList imageListLarge = new ImageList();
        }
Exemplo n.º 8
0
 private void RateNumeric_ValueChanged(object sender, EventArgs e)
 {
     ProcessController.Speed((int)rateNumeric.Value);
 }
Exemplo n.º 9
0
 private void ReadyButton_Click(object sender, EventArgs e)
 {
     ProcessController.Ready(blockBox.Text);
 }
Exemplo n.º 10
0
 private void BlockButton_Click(object sender, EventArgs e)
 {
     ProcessController.Block(runningBox.Text);
 }
Exemplo n.º 11
0
 private void StepButton_Click(object sender, EventArgs e)
 {
     ProcessController.OneTick();
 }
Exemplo n.º 12
0
 private void StartButton_Click(object sender, EventArgs e)
 {
     StartButtonClicked?.Invoke();
     ProcessController.CreateProcessSimulation(runningType == 3, ProcessData, 1, (int)coreNumeric.Value);
 }