예제 #1
0
        public Form3(schedAlgo tempAlgo)
        {
            InitializeComponent();
            temp = tempAlgo;
            List <data_gride> buttons = new List <data_gride>();

            data_gride newButton = new data_gride(temp);

            buttons.Add(newButton);
            this.Controls.Add(newButton);
            this.textBox1.Text = tempAlgo.avgWaitingTime.ToString();
        }
예제 #2
0
        public data_gride(schedAlgo tempAlgo)
        {
            InitializeComponent();
            //Process temp = new Process { s = 0, name1 = "Process1", e = 5 };
            //Process temp2 = new Process { s = 6, name1 = "Process2", e = 8 };
            //Process temp3 = new Process { s = 9, name1 = "Process3", e = 12 };

            //Process[] x = new Process[3];
            //x[0] = temp;
            //x[1] = temp2;
            //x[2] = temp3;

            dataGridView2.ColumnCount          = tempAlgo.output.Count;
            dataGridView2.ColumnHeadersVisible = true;

            var tabs = new string(' ', 10);

            for (int i = 0; i < tempAlgo.output.Count; i++)
            {
                dataGridView2.Columns[i].Name = tempAlgo.output[i].name.ToString() + Environment.NewLine + tempAlgo.output[i].startTime.ToString() + tabs + tempAlgo.output[i].endTime.ToString();
            }
        }
예제 #3
0
        public Form2(Int32 n, string SchedType, string q)
        {
            InitializeComponent();
            int noOfProcess = n;

            dataGridView1.RowCount          = noOfProcess;
            dataGridView1.RowHeadersVisible = false;

            DataGridViewCell cell = dataGridView1.Rows[0].Cells[0];

            dataGridView1.CurrentCell = cell;
            dataGridView1.BeginEdit(true);


            //Set The value Type Of The Cells
            dataGridView1.SelectAll();
            foreach (DataGridViewCell c in dataGridView1.SelectedCells)
            {
                if (c.OwningColumn.Name == "processName")
                {
                    c.ValueType = typeof(string);
                }
                else
                {
                    c.ValueType = typeof(int);
                }
            }

            //add thes priority and quantum columns if needed
            switch (SchedType)
            {
            case "Priority (NonPr)":
            {
                dataGridView1.Columns["priority"].Visible = true;
                tempAlgo = new Priority_NonPr();
                break;
            }

            case "Priority (Pr)":
            {
                dataGridView1.Columns["priority"].Visible = true;
                tempAlgo = new Priority_Pr();
                break;
            }

            case "RR":
            {
                tempAlgo             = new RR();
                tempAlgo.QuantumTime = Int32.Parse(q);
                break;
            }

            case "FCFS":
            {
                tempAlgo = new FCFS();
                break;
            }

            case "SJF (Pr)":
            {
                tempAlgo = new SJF_Pr();
                break;
            }

            case "SJF (NonPr)":
            {
                tempAlgo = new SJF_NonPr();
                break;
            }
            }
        }