示例#1
0
 public void add_task(task itask)
 {
     loading += itask.task_complexity / perf;
     tstak.Add(itask);
 }
示例#2
0
        private void Timer1_Tick(object sender, EventArgs e)
        {
            task new_task = new task();

            if (ok_user_compl)
            {
                new_task.min_complexity = user_compl;
                new_task.max_complexity = user_compl1;
            }
            new_task.generate_compl();
            new_task.generate_units();
            tasks.Add(new_task);

            string sUnts = "";
            string sComl = "";

            itask++;

            sComl = Convert.ToString(new_task.task_complexity);

            for (int i = 0; i < new_task.units.Count(); i++)
            {
                sUnts += Convert.ToString(new_task.units[i]) + " ";
            }

            string id = Convert.ToString(itask);

            string[]     strs = { id, sUnts, sComl };
            ListViewItem item = new ListViewItem(strs);

            lTasks.Items.Add(item);

            /*if (timecheck == true)
             * {
             *  MethodFifo(new_task);
             *
             *  Method2(new_task);
             *
             *  Method3(new_task);
             * }
             *
             * if (timecheck == false)
             * {
             *  double systime = units[0].loading;
             *  for (int i = 1; i < units.Count(); i++)
             *  {
             *      if (systime < units[i].loading)
             *      {
             *          systime = units[i].loading;
             *      }
             *  }
             *  double systime1 = units1[0].loading;
             *  for (int i = 1; i < units1.Count(); i++)
             *  {
             *      if (systime1 < units1[i].loading)
             *      {
             *          systime1 = units1[i].loading;
             *      }
             *  }
             *  double systime2 = units2[0].loading;
             *  for (int i = 1; i < units2.Count(); i++)
             *  {
             *      if (systime2 < units2[i].loading)
             *      {
             *          systime2 = units2[i].loading;
             *      }
             *  }
             *
             *  if (systime < checktime)
             *      MethodFifo(new_task);
             *
             *  if (systime1 < checktime)
             *      Method2(new_task);
             *
             *  if (systime2 < checktime)
             *      Method3(new_task);
             *
             *  if ((systime >= checktime) && (systime1 >= checktime) && (systime2 >= checktime))
             *  {
             *      TaskTimer.Stop();
             *  }
             * }*/
        }