Skip to content

Commit 8af3f8a

Browse files
committed
Update
1 parent 2ff19e3 commit 8af3f8a

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed
455 Bytes
Loading

CPU_Scheduler/main.py

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -78,19 +78,21 @@ def __init__(self, title):
7878
super().__init__()
7979
self.geometry("1080x720")
8080
self.grid_columnconfigure((0,1), weight=1)
81-
self.grid_rowconfigure(0, weight=1)
82-
# Label for TOP_LEVEL WINDOW
83-
84-
81+
self.grid_rowconfigure((0, 1), weight=1)
82+
# Back button for TOP_LEVEL WINDOW
83+
self.back_Btn = customtkinter.CTkButton(self, text="Back to Main", command=self.backToMain)
84+
self.back_Btn.grid(row=0, column=0, sticky="ew", columnspan=2)
8585
# Instantiating Process Table Frame
8686
self.Process_Table_Box = ProcessTableBox(self)
87-
self.Process_Table_Box.grid(row=0, column=0, sticky="nsew", pady=20, padx=20)
87+
self.Process_Table_Box.grid(row=1, column=0, sticky="ew")
8888

8989
# Instantiating Process
9090
self.Gantt_Chart_Box = GanttChartBox(self, title)
91-
self.Gantt_Chart_Box.grid(row=0, column=1, sticky="nsew", pady=20, padx=20)
91+
self.Gantt_Chart_Box.grid(row=1, column=1, sticky="ew")
9292

9393

94+
def backToMain(self):
95+
self.destroy()
9496

9597
class OptionWindow(customtkinter.CTkFrame): # Amo adi an window kun hain naka butang an mga buttons
9698
def __init__(self, master):
@@ -160,13 +162,15 @@ def startExecution(self):
160162
global NP
161163
global WT
162164
global TT
165+
163166
NP = int(self.Process_Input.get())
164167
if self.AlgoMenu.get() == "Preemptive Priority Scheduling":
165168

166169
processList = self.PPS_Instance.inputRandom(int(self.Process_Input.get()), math.trunc(self.Burst_Time.get()))
167-
completed_list = self.PPS_Instance.schedulingProcess(process_list=processList)
168-
WT = self.PPS_Instance.waitingTime
169-
TT = self.PPS_Instance.turnaroundTime
170+
# completed_list = self.PPS_Instance.schedulingProcess(process_list=processList)
171+
# WT = self.PPS_Instance.waitingTime
172+
# TT = self.PPS_Instance.turnaroundTime
173+
print(processList)
170174

171175

172176
elif self.AlgoMenu.get() == "Non-Preemtive Priotity Scheduling":
@@ -178,6 +182,7 @@ def startExecution(self):
178182

179183
## The two lines below are used sa printing of process table
180184
global data
185+
181186
data = processList
182187
self.toplev = ToplevelWindow(self.AlgoMenu.get())
183188

0 commit comments

Comments
 (0)