Skip to content

Commit 14019be

Browse files
committed
Update
1 parent 8348161 commit 14019be

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed
-3.68 KB
Loading

CPU_Scheduler/NonPreemptivePriorityScheduling.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ def Execute(self, processList):
7777
current_process = MemoryQueue.pop(0) # pops the first elemnt stored in the memory queue
7878
ProcessComplete.append(current_process)
7979
self.process_Timing[current_process[0]] = (currentTime, currentTime+current_process[2])
80-
print(f"{current_process[0]} : {currentTime} - {currentTime+current_process[2]}")
8180
currentTime += current_process[2]
8281

8382

-145 Bytes
Binary file not shown.

CPU_Scheduler/main.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
from tkinter import ttk
1010
from PIL import Image, ImageTk
1111

12+
## TODO
13+
# Change background and foreground color of table to black and white respectively
14+
1215
NP = 0
1316
data = []
1417
WT = 0
@@ -18,12 +21,11 @@ def __init__(self, master):
1821
super().__init__(master)
1922
# Label For Process Table
2023
title = customtkinter.CTkLabel(self, text="Process Table", fg_color="transparent", font=("Arial", 20))
21-
# self.title.grid(row=0, column=0, sticky="ew", pady=20, padx=20)
2224
title.pack()
2325
# # The Table generated by Matplotlib that shows the process
2426
# # this inlucdes the Process ID, Burst Time, Arrival Time and Priority Number
2527

26-
processtable = ttk.Treeview(self, columns=("Process ID", "Arrival Time", "Burst Time", "Priority Number"), show="headings")
28+
processtable = ttk.Treeview(self, columns=("Process ID", "Arrival Time", "Burst Time", "Priority Number"), show="headings", height=NP)
2729
processtable.heading("Process ID", text="Process ID")
2830
processtable.heading("Arrival Time", text="Arrival Time")
2931
processtable.heading("Burst Time", text="Burst Time")
@@ -57,15 +59,15 @@ def __init__(self, master):
5759
self.title.pack()
5860

5961
## WT Avg
60-
self.title = customtkinter.CTkLabel(self, text=f"Waiting Time Average: {round(WT, 2)}", fg_color="transparent", font=("Arial", 10))
62+
self.title = customtkinter.CTkLabel(self, text=f"Waiting Time Average: {round(WT, 2)}", fg_color="transparent", font=("Arial", 13))
6163
self.title.pack()
6264

6365
## TT Avg
64-
self.title = customtkinter.CTkLabel(self, text=f"Turnaround Time Average: {round(TT, 2)}", fg_color="transparent", font=("Arial", 10))
66+
self.title = customtkinter.CTkLabel(self, text=f"Turnaround Time Average: {round(TT, 2)}", fg_color="transparent", font=("Arial", 13))
6567
self.title.pack()
6668

6769

68-
self.myimg = customtkinter.CTkImage(Image.open("./GANTT_OUTPUT/GTChart.png"), size=(400, self.height))
70+
self.myimg = customtkinter.CTkImage(Image.open("./GANTT_OUTPUT/GTChart.png"), size=(600, self.height))
6971
self.imgLabel = customtkinter.CTkLabel(self, image=self.myimg, text="")
7072
self.imgLabel.pack()
7173

@@ -131,13 +133,12 @@ def GenerateGANTT_Chart(self, processList, process_Timing):
131133
start, end = timings
132134
ax.barh(i, end - start, left=start, align='center', label=process)
133135

134-
ax.set_xlabel('Time')
136+
ax.set_xlabel('Time', fontsize=9)
135137
ax.set_yticks(range(len(process_Timing)))
136-
ax.set_yticklabels(process_Timing.keys())
137-
ax.legend()
138+
ax.set_yticklabels(process_Timing.keys(), fontsize=7)
138139

139140
plt.grid(axis='x')
140-
plt.savefig("./GANTT_OUTPUT/GTChart.png", bbox_inches='tight', dpi=150)
141+
plt.savefig("./GANTT_OUTPUT/GTChart.png", bbox_inches='tight', dpi=100)
141142

142143

143144
def startExecution(self):

0 commit comments

Comments
 (0)