Skip to content

Commit

Permalink
Alterando as cores somente quando for EDF
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavooquinteiro committed Jun 9, 2019
1 parent 8d86042 commit fc7d5db
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Gantt.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def updategantt(self, tick, escalonator, io, cpu):
self.tableWidget.item(i, tick).setFlags(Qt.NoItemFlags)

for i in escalonator.ready_queue:
if i.deadline <= 0:
if i.deadline <= 0 and escalonator.algorithm == "EDF":
self.tableWidget.setItem(self.dicionary[i.id], tick, QTableWidgetItem())
self.tableWidget.item(self.dicionary[i.id], tick).setBackground(QColor(189,183,107))
self.tableWidget.item(self.dicionary[i.id], tick).setFlags(Qt.NoItemFlags)
Expand All @@ -195,7 +195,7 @@ def updategantt(self, tick, escalonator, io, cpu):
self.tableWidget.item(self.dicionary[i.id], tick).setFlags(Qt.NoItemFlags)
#print(cpu.state)
if cpu.state == "Executando" or cpu.state == "PreSobrecarga" or cpu.state == "Pronto" :
if cpu.process.deadline <= 0:
if cpu.process.deadline <= 0 and escalonator.algorithm == "EDF":
self.tableWidget.setItem(self.dicionary[cpu.process.id], tick, QTableWidgetItem())
self.tableWidget.item(self.dicionary[cpu.process.id], tick).setBackground(QColor(0,100,0))
self.tableWidget.item(self.dicionary[cpu.process.id], tick).setFlags(Qt.NoItemFlags)
Expand Down

0 comments on commit fc7d5db

Please sign in to comment.