예제 #1
0
        public ImportView(SchedulersResult result) :
            base(WindowType.Toplevel)
        {
            Build();
            fcfs    = result.FCFS.ConvertAll((input) => { return(new PlotableProcess(input.Name, input.execTime)); });
            sjf     = result.SJF.ConvertAll((input) => { return(new PlotableProcess(input.Name, input.execTime)); });
            rr      = result.RR.ConvertAll((input) => { return(new PlotableProcess(input.Name, input.execTime)); });
            quantum = result.Quantum;

            escalonadPlot = new PlotInterface(vbox1);
            escalonadPlot.AnimateData(fcfs, true, "FCFS");
        }
예제 #2
0
    public MainWindow() : base(WindowType.Toplevel)
    {
        Build();
        creationController = new CreationController(new List <ComboBox>
        {
            dirCreatorEntry,
            directoryEntry
        },
                                                    scrolledWindow);

        plot          = new PlotInterface(plotBox);
        escalonadPlot = new PlotInterface(plotBox, AtualizeAnimCallBack);
        DisableAll();
    }
예제 #3
0
        public static string ExportALL <T>(List <T> fcfs, List <T> sjf, List <T> rr, string extension, ComboBox box, PlotInterface @interface)
        {
            if (fcfs != null && sjf != null && rr != null)
            {
                if (GTKUtils.ShowFolderChooser(out string path))
                {
                    string[] names =
                    {
                        "FCFS", "SJF", "RR", "Benchmark",
                    };

                    for (int i = 0; i < names.Length; i++)
                    {
                        ExportTo(i, path, names[i], extension, box, @interface);
                    }

                    return(path);
                }
            }
            else
            {
                NotProcess();
            }

            return(null);
        }
예제 #4
0
 private static void ExportTo(int index, string path, string name, string extension, ComboBox box, PlotInterface @interface)
 {
     box.Active = index;
     @interface.ExportPNG(path + name + extension);
 }
예제 #5
0
 public static void Export <T>(List <T> toExport, int index, string extension, ComboBox box, PlotInterface @interface)
 {
     if (toExport != null)
     {
         if (GTKUtils.ShowFileChooser(out string path, extension, "Salvar Como...", "Salvar"))
         {
             ExportTo(index, path, "", "", box, @interface);
         }
     }
     else
     {
         NotProcess();
     }
 }