Example #1
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            using (StreamReader rd = new StreamReader("Tasks.json"))
            {
                Tasks = new ObservableCollection <Task>(
                    Newtonsoft.Json.JsonConvert.DeserializeObject <Task[]>(
                        rd.ReadToEnd()
                        )
                    );
            }

            Scheduler = new RateMonotonicScheduler(Tasks);
        }
Example #2
0
 private void ButtonComplete_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         scheduler.schedule();
     }
     catch (ProcessNotFinishedException pe)
     {
         OPA rta = new OPA(Scheduler.Processes);
         MessageBoxResult res = MessageBox.Show(pe.ToString() + "\n\n" + rta.ToString() + "\n\nOverwrite Priorities?", pe.CausingProcess.Task.Name, MessageBoxButton.YesNo);
         if (res == MessageBoxResult.Yes)
         {
             Scheduler = rta;
             Scheduler.Processes.ToList().ForEach(p => p.Reset());
         }
         //MessageBox.Show(pe.ToString() , pe.CausingProcess.Task.Name);
     }
 }