You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
464 lines
25 KiB
464 lines
25 KiB
1 year ago
|
from UI import *
|
||
|
# import tkinter as tk
|
||
|
|
||
|
|
||
|
class Print_line:
|
||
|
def show(self):
|
||
|
lines = ['PC_MAD', 'SIG_MEM', 'SIG_IR', 'IR_SIG', 'IR_MCO', 'MCO_IR', 'MCO_MEM', 'MEM_MCO', 'MAD_MEM',
|
||
|
'PC_SIG', 'SIG_PC', 'MCO_PC', 'IR_MAD', 'SIG_R1', 'SIG_R2', 'SIG_R3', 'SIG_R4', 'MCO_R1',
|
||
|
'MCO_R2', 'MCO_R3', 'MCO_R4', 'R1_MCO', 'R2_MCO', 'R3_MCO', 'R4_MCO', 'SIG_ALU']
|
||
|
for l in lines:
|
||
|
if cpu.SigObj[l][1] == False:
|
||
|
eval('self.' + l + '(cv, -1)')
|
||
|
for l in lines:
|
||
|
if cpu.SigObj[l][1] == True:
|
||
|
eval('self.' + l + '(cv, 1)')
|
||
|
|
||
|
# print(cpu.SigObj[l][1])
|
||
|
|
||
|
def all(self):
|
||
|
lines = ['PC_MAD', 'SIG_MEM', 'SIG_IR', 'IR_SIG', 'IR_MCO', 'MCO_IR', 'MCO_MEM', 'MEM_MCO', 'MAD_MEM',
|
||
|
'PC_SIG', 'SIG_PC', 'MCO_PC', 'IR_MAD', 'SIG_R1', 'SIG_R2', 'SIG_R3', 'SIG_R4', 'MCO_R1',
|
||
|
'MCO_R2', 'MCO_R3', 'MCO_R4', 'R1_MCO', 'R2_MCO', 'R3_MCO', 'R4_MCO', 'SIG_ALU']
|
||
|
for l in lines:
|
||
|
eval('self.' + l + '(cv, 1)')
|
||
|
|
||
|
def init(self):
|
||
|
lines = ['PC_MAD', 'SIG_MEM', 'SIG_IR', 'IR_SIG', 'IR_MCO', 'MCO_IR', 'MCO_MEM', 'MEM_MCO', 'MAD_MEM',
|
||
|
'PC_SIG', 'SIG_PC', 'MCO_PC', 'IR_MAD', 'SIG_R1', 'SIG_R2', 'SIG_R3', 'SIG_R4', 'MCO_R1',
|
||
|
'MCO_R2', 'MCO_R3', 'MCO_R4', 'R1_MCO', 'R2_MCO', 'R3_MCO', 'R4_MCO', 'SIG_ALU']
|
||
|
# for l in lines:
|
||
|
# eval('self.' + l + '(cv, 0)')
|
||
|
for l in lines:
|
||
|
eval('self.' + l + '(cv, -1)')
|
||
|
|
||
|
|
||
|
def mark(self, lines):
|
||
|
for i in range(5):
|
||
|
if i:
|
||
|
time.sleep(cpu.time)
|
||
|
if i % 2:
|
||
|
for l in lines:
|
||
|
# print('self.' + l + '(cv, 1)')
|
||
|
# self.init()
|
||
|
eval('self.' + l + '(cv, 1)')
|
||
|
else:
|
||
|
for l in lines:
|
||
|
# print('self.' + l + '(cv, 0)')
|
||
|
# self.init()
|
||
|
eval('self.' + l + '(cv, -1)')
|
||
|
cv.update()
|
||
|
|
||
|
|
||
|
def PC_MAD(self, cv:tk.Canvas, flag):
|
||
|
if flag == 1:
|
||
|
cv.create_line(500, 469 + 4.5, 480 + 120 + 12, 469 + 4.5, width=9, arrow=LAST, capstyle=ROUND, fill=color1)
|
||
|
|
||
|
else:
|
||
|
cv.create_line(500, 469 + 4.5, 480 + 120 + 12, 469 + 4.5, width=9, arrow=LAST, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.update()
|
||
|
def SIG_MEM(self, cv:tk.Canvas, flag):
|
||
|
if flag == 1:
|
||
|
cv.create_line(185 + 4.5, 635, 185 + 4.5, 660, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(185 + 4.5, 660, 635, 660, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(635, 550 - 5, 635, 660, width=9, capstyle=ROUND, arrow=FIRST, fill=color1)
|
||
|
|
||
|
else:
|
||
|
cv.create_line(185 + 4.5, 635, 185 + 4.5, 660, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(185 + 4.5, 660, 635, 660, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(635, 550 - 5, 635, 660, width=9, capstyle=ROUND, arrow=FIRST, fill=NOMARK)
|
||
|
cv.update()
|
||
|
|
||
|
def SIG_IR(self,cv:tk.Canvas, flag):
|
||
|
if flag == 1:
|
||
|
cv.create_line(281 + 10, 575 + 4.5, 334, 575 + 4.5, width=9, arrow=LAST, capstyle=ROUND, fill=color1)
|
||
|
|
||
|
else:
|
||
|
cv.create_line(281 + 10, 575 + 4.5, 334, 575 + 4.5, width=9, arrow=LAST, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.update()
|
||
|
|
||
|
def IR_SIG(self,cv:tk.Canvas, flag):
|
||
|
if flag == 1:
|
||
|
cv.create_line(281, 575 + 4.5, 334 - 10, 575 + 4.5, width=9, arrow=FIRST, capstyle=ROUND, fill=color1)
|
||
|
|
||
|
else:
|
||
|
cv.create_line(281, 575 + 4.5, 334 - 10, 575 + 4.5, width=9, arrow=FIRST, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.update()
|
||
|
|
||
|
def IR_MCO(self,cv:tk.Canvas, flag):
|
||
|
if flag == 1:
|
||
|
cv.create_line(500, 580, 580, 580, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(580, 180 + 4.5, 580, 580, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(580, 180 + 4.5, 620, 180 + 4.5, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(620, 145, 620, 180 + 4.5, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(770, 145, 620, 145, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(770, 215, 770, 145, width=9, capstyle=ROUND, arrow=FIRST, fill=color1)
|
||
|
|
||
|
else:
|
||
|
cv.create_line(500, 580, 580, 580, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(580, 180 + 4.5, 580, 580, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(580, 180 + 4.5, 620, 180 + 4.5, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(620, 145, 620, 180 + 4.5, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(770, 145, 620, 145, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(770, 215, 770, 145, width=9, capstyle=ROUND, arrow=FIRST, fill=NOMARK)
|
||
|
cv.update()
|
||
|
|
||
|
def MCO_IR(self,cv:tk.Canvas, flag):
|
||
|
if flag == 1:
|
||
|
cv.create_line(490, 580, 580, 580, width=9, capstyle=ROUND, arrow=FIRST, fill=color1)
|
||
|
cv.create_line(580, 180 + 4.5, 580, 580, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(580, 180 + 4.5, 620, 180 + 4.5, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(620, 145, 620, 180 + 4.5, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(770, 145, 620, 145, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(770, 220 - 10, 770, 145, width=9, capstyle=ROUND, fill=color1)
|
||
|
|
||
|
else:
|
||
|
cv.create_line(490, 580, 580, 580, width=9, capstyle=ROUND, arrow=FIRST, fill=NOMARK)
|
||
|
cv.create_line(580, 180 + 4.5, 580, 580, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(580, 180 + 4.5, 620, 180 + 4.5, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(620, 145, 620, 180 + 4.5, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(770, 145, 620, 145, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(770, 220 - 10, 770, 145, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.update()
|
||
|
|
||
|
def MCO_MEM(self,cv:tk.Canvas, flag):
|
||
|
if flag == 1:
|
||
|
cv.create_line(780, 245, 780, 273, width=9, capstyle=ROUND, arrow=LAST, fill=color1)
|
||
|
|
||
|
else:
|
||
|
cv.create_line(780, 245, 780, 273, width=9, capstyle=ROUND, arrow=LAST, fill=NOMARK)
|
||
|
|
||
|
cv.update()
|
||
|
|
||
|
def MEM_MCO(self,cv:tk.Canvas, flag):
|
||
|
if flag == 1:
|
||
|
cv.create_line(820, 245, 820, 273, width=9, capstyle=ROUND, arrow=FIRST, fill=color1)
|
||
|
|
||
|
else:
|
||
|
cv.create_line(820, 245, 820, 273, width=9, capstyle=ROUND, arrow=FIRST, fill=NOMARK)
|
||
|
|
||
|
cv.update()
|
||
|
|
||
|
def PC_SIG(self,cv:tk.Canvas, flag):
|
||
|
if flag == 1:
|
||
|
cv.create_line(230 + 5, 510, 230 + 5, 525, width=10, arrow=LAST, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(230 + 5, 505 + 5, 230 + 180, 505 + 5, width=10, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(405 + 5, 497, 405 + 5, 510, width=10, capstyle=ROUND, fill=color1)
|
||
|
|
||
|
else:
|
||
|
cv.create_line(230 + 5, 510, 230 + 5, 525, width=10, arrow=LAST, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(230 + 5, 505 + 5, 230 + 180, 505 + 5, width=10, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(405 + 5, 497, 405 + 5, 510, width=10, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.update()
|
||
|
|
||
|
def SIG_PC(self,cv:tk.Canvas, flag):
|
||
|
if flag == 1:
|
||
|
cv.create_line(230 + 5, 510, 230 + 5, 518, width=10, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(230 + 5, 505 + 5, 230 + 180, 505 + 5, width=10, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(405 + 5, 490, 405 + 5, 490 + 20, width=10, arrow=FIRST, capstyle=ROUND, fill=color1)
|
||
|
|
||
|
else:
|
||
|
cv.create_line(230 + 5, 510, 230 + 5, 518, width=10, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(230 + 5, 505 + 5, 230 + 180, 505 + 5, width=10, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(405 + 5, 490, 405 + 5, 490 + 20, width=10, arrow=FIRST, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.update()
|
||
|
|
||
|
def IR_MAD(self,cv:tk.Canvas, flag):
|
||
|
if flag == 1:
|
||
|
cv.create_line(500, 580, 580, 580, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(580, 510, 580, 580, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(580, 510, 610, 510, width=9, capstyle=ROUND, fill=color1, arrow=LAST)
|
||
|
|
||
|
else:
|
||
|
cv.create_line(500, 580, 580, 580, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(580, 510, 580, 580, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(580, 510, 610, 510, width=9, capstyle=ROUND, fill=NOMARK, arrow=LAST)
|
||
|
cv.update()
|
||
|
|
||
|
def SIG_R1(self,cv:tk.Canvas, flag):
|
||
|
if flag == 1:
|
||
|
cv.create_line(120 + 4.5, 635, 120 + 4.5, 660, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(40, 660, 120 + 4.5, 660, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(40, 30, 40, 660, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(40, 30, 620, 30, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(620, 30, 620, 103, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(515, 103, 620, 103, width=10, arrow=FIRST, capstyle=ROUND, fill=color1)
|
||
|
|
||
|
else:
|
||
|
cv.create_line(120 + 4.5, 635, 120 + 4.5, 660, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(40, 660, 120 + 4.5, 660, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(40, 30, 40, 660, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(40, 30, 620, 30, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(620, 30, 620, 103, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(515, 103, 620, 103, width=10, arrow=FIRST, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.update()
|
||
|
|
||
|
def SIG_R2(self,cv:tk.Canvas, flag):
|
||
|
if flag == 1:
|
||
|
cv.create_line(120 + 4.5, 635, 120 + 4.5, 660, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(40, 660, 120 + 4.5, 660, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(40, 30, 40, 660, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(40, 30, 620, 30, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(620, 30, 620, 120, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(538, 120, 620, 120, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(538, 120, 538, 190, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(538, 190, 515, 190, width=9, capstyle=ROUND, arrow=LAST, fill=color1)
|
||
|
|
||
|
else:
|
||
|
cv.create_line(120 + 4.5, 635, 120 + 4.5, 660, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(40, 660, 120 + 4.5, 660, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(40, 30, 40, 660, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(40, 30, 620, 30, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(620, 30, 620, 120, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(538, 120, 620, 120, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(538, 120, 538, 190, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(538, 190, 515, 190, width=9, capstyle=ROUND, arrow=LAST, fill=NOMARK)
|
||
|
cv.update()
|
||
|
|
||
|
def SIG_R3(self, cv: tk.Canvas, flag):
|
||
|
if flag == 1:
|
||
|
cv.create_line(120 + 4.5, 635, 120 + 4.5, 660, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(40, 660, 120 + 4.5, 660, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(40, 30, 40, 660, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(40, 30, 620, 30, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(620, 30, 620, 140, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(550, 140, 620, 140, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(550, 140, 550, 280, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(515, 280, 550, 280, width=9, capstyle=ROUND, arrow=FIRST, fill=color1)
|
||
|
|
||
|
else:
|
||
|
cv.create_line(120 + 4.5, 635, 120 + 4.5, 660, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(40, 660, 120 + 4.5, 660, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(40, 30, 40, 660, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(40, 30, 620, 30, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(620, 30, 620, 140, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(550, 140, 620, 140, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(550, 140, 550, 280, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(515, 280, 550, 280, width=9, capstyle=ROUND, arrow=FIRST, fill=NOMARK)
|
||
|
cv.update()
|
||
|
|
||
|
def SIG_R4(self,cv:tk.Canvas, flag):
|
||
|
if flag == 1:
|
||
|
cv.create_line(120 + 4.5, 635, 120 + 4.5, 660, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(40, 660, 120 + 4.5, 660, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(40, 30, 40, 660, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(40, 30, 620, 30, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(620, 30, 620, 160, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(565, 160, 620, 160, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(565, 160, 565, 370, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(515, 370, 565, 370, width=9, capstyle=ROUND, arrow=FIRST, fill=color1)
|
||
|
|
||
|
else:
|
||
|
cv.create_line(120 + 4.5, 635, 120 + 4.5, 660, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(40, 660, 120 + 4.5, 660, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(40, 30, 40, 660, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(40, 30, 620, 30, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(620, 30, 620, 160, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(565, 160, 620, 160, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(565, 160, 565, 370, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(515, 370, 565, 370, width=9, capstyle=ROUND, arrow=FIRST, fill=NOMARK)
|
||
|
cv.update()
|
||
|
|
||
|
def MCO_R1(self,cv:tk.Canvas, flag):
|
||
|
if flag == 1:
|
||
|
cv.create_line(770, 145, 620, 145, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(770, 220 - 10, 770, 145, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(620, 145, 620, 103, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(515, 103, 620, 103, width=10, arrow=FIRST, capstyle=ROUND, fill=color1)
|
||
|
|
||
|
else:
|
||
|
cv.create_line(770, 145, 620, 145, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(770, 220 - 10, 770, 145, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(620, 145, 620, 103, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(515, 103, 620, 103, width=10, arrow=FIRST, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.update()
|
||
|
|
||
|
def R1_MCO(self,cv:tk.Canvas, flag):
|
||
|
if flag == 1:
|
||
|
cv.create_line(770, 145, 620, 145, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(770, 215, 770, 145, width=9, capstyle=ROUND, fill=color1, arrow=FIRST)
|
||
|
cv.create_line(620, 145, 620, 103, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(515 + 10, 103, 620, 103, width=10, capstyle=ROUND, fill=color1)
|
||
|
|
||
|
else:
|
||
|
cv.create_line(770, 145, 620, 145, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(770, 215, 770, 145, width=9, capstyle=ROUND, fill=NOMARK, arrow=FIRST)
|
||
|
cv.create_line(620, 145, 620, 103, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(515 + 10, 103, 620, 103, width=10, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.update()
|
||
|
|
||
|
def MCO_R2(self,cv:tk.Canvas, flag):
|
||
|
if flag == 1:
|
||
|
cv.create_line(770, 145, 620, 145, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(770, 220 - 10, 770, 145, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(620, 145, 620, 120, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(538, 120, 620, 120, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(538, 120, 538, 190, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(538, 190, 515, 190, width=9, capstyle=ROUND, arrow=LAST, fill=color1)
|
||
|
|
||
|
else:
|
||
|
cv.create_line(770, 145, 620, 145, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(770, 220 - 10, 770, 145, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(620, 145, 620, 120, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(538, 120, 620, 120, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(538, 120, 538, 190, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(538, 190, 515, 190, width=9, capstyle=ROUND, arrow=LAST, fill=NOMARK)
|
||
|
cv.update()
|
||
|
|
||
|
def R2_MCO(self,cv:tk.Canvas, flag):
|
||
|
if flag == 1:
|
||
|
cv.create_line(770, 145, 620, 145, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(770, 215, 770, 145, width=9, capstyle=ROUND, fill=color1, arrow=FIRST)
|
||
|
cv.create_line(620, 145, 620, 120, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(538, 120, 620, 120, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(538, 120, 538, 190, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(538, 190, 525, 190, width=9, capstyle=ROUND, fill=color1)
|
||
|
|
||
|
else:
|
||
|
cv.create_line(770, 145, 620, 145, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(770, 215, 770, 145, width=9, capstyle=ROUND, fill=NOMARK, arrow=FIRST)
|
||
|
cv.create_line(620, 145, 620, 120, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(538, 120, 620, 120, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(538, 120, 538, 190, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(538, 190, 525, 190, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.update()
|
||
|
|
||
|
def MCO_R3(self,cv:tk.Canvas, flag):
|
||
|
if flag == 1:
|
||
|
cv.create_line(770, 145, 620, 145, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(770, 220 - 10, 770, 145, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(620, 145, 620, 140, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(550, 140, 620, 140, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(550, 140, 550, 280, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(515, 280, 550, 280, width=9, capstyle=ROUND, arrow=FIRST, fill=color1)
|
||
|
|
||
|
else:
|
||
|
cv.create_line(770, 145, 620, 145, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(770, 220 - 10, 770, 145, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(620, 145, 620, 140, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(550, 140, 620, 140, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(550, 140, 550, 280, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(515, 280, 550, 280, width=9, capstyle=ROUND, arrow=FIRST, fill=NOMARK)
|
||
|
cv.update()
|
||
|
|
||
|
def R3_MCO(self,cv:tk.Canvas, flag):
|
||
|
if flag == 1:
|
||
|
cv.create_line(770, 145, 620, 145, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(770, 215, 770, 145, width=9, capstyle=ROUND, fill=color1, arrow=FIRST)
|
||
|
cv.create_line(620, 145, 620, 140, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(550, 140, 620, 140, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(550, 140, 550, 280, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(525, 280, 550, 280, width=9, capstyle=ROUND, fill=color1)
|
||
|
|
||
|
else:
|
||
|
cv.create_line(770, 145, 620, 145, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(770, 215, 770, 145, width=9, capstyle=ROUND, fill=NOMARK, arrow=FIRST)
|
||
|
cv.create_line(620, 145, 620, 140, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(550, 140, 620, 140, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(550, 140, 550, 280, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(525, 280, 550, 280, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.update()
|
||
|
|
||
|
def MCO_R4(self, cv:tk.Canvas, flag):
|
||
|
if flag == 1:
|
||
|
cv.create_line(770, 145, 620, 145, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(770, 220 - 10, 770, 145, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(620, 145, 620, 160, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(565, 160, 620, 160, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(565, 160, 565, 370, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(515, 370, 565, 370, width=9, capstyle=ROUND, arrow=FIRST, fill=color1)
|
||
|
|
||
|
else:
|
||
|
cv.create_line(770, 145, 620, 145, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(770, 220 - 10, 770, 145, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(620, 145, 620, 160, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(565, 160, 620, 160, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(565, 160, 565, 370, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(515, 370, 565, 370, width=9, capstyle=ROUND, arrow=FIRST, fill=NOMARK)
|
||
|
cv.update()
|
||
|
|
||
|
def R4_MCO(self,cv:tk.Canvas, flag):
|
||
|
if flag == 1:
|
||
|
cv.create_line(770, 145, 620, 145, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(770, 215, 770, 145, width=9, capstyle=ROUND, fill=color1, arrow=FIRST)
|
||
|
cv.create_line(620, 145, 620, 160, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(565, 160, 620, 160, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(565, 160, 565, 370, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(525, 370, 565, 370, width=9, capstyle=ROUND, arrow=FIRST, fill=color1)
|
||
|
|
||
|
else:
|
||
|
cv.create_line(770, 145, 620, 145, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(770, 215, 770, 145, width=9, capstyle=ROUND, fill=NOMARK, arrow=FIRST)
|
||
|
cv.create_line(620, 145, 620, 160, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(565, 160, 620, 160, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(565, 160, 565, 370, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(525, 370, 565, 370, width=9, capstyle=ROUND, arrow=FIRST, fill=NOMARK)
|
||
|
cv.update()
|
||
|
|
||
|
def SIG_ALU(self, cv:tk.Canvas, flag):
|
||
|
if flag == 1:
|
||
|
cv.create_line(85, 578, 55, 578, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(55, 232, 55, 578, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(55, 232, 90, 232, width=9, capstyle=ROUND, fill=color1, arrow=LAST)
|
||
|
|
||
|
else:
|
||
|
cv.create_line(85, 578, 55, 578, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(55, 232, 55, 578, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(55, 232, 90, 232, width=9, capstyle=ROUND, fill=NOMARK, arrow=LAST)
|
||
|
cv.update()
|
||
|
|
||
|
def MAD_MEM(self, cv:tk.Canvas, flag):
|
||
|
if flag == 1:
|
||
|
cv.create_line(635, 353, 635, 320, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(670, 320, 635, 320, width=9, capstyle=ROUND, fill=color1, arrow=FIRST)
|
||
|
|
||
|
else:
|
||
|
cv.create_line(635, 353, 635, 320, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(670, 320, 635, 320, width=9, capstyle=ROUND, fill=NOMARK, arrow=FIRST)
|
||
|
cv.update()
|
||
|
|
||
|
def MCO_PC(self, cv:tk.Canvas, flag):
|
||
|
if flag == 1:
|
||
|
cv.create_line(490, 469 + 4.5, 580, 469 + 4.5, width=9, capstyle=ROUND, arrow=FIRST, fill=color1)
|
||
|
cv.create_line(580, 180 + 4.5, 580, 469 + 4.5, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(580, 180 + 4.5, 620, 180 + 4.5, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(620, 145, 620, 180 + 4.5, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(770, 145, 620, 145, width=9, capstyle=ROUND, fill=color1)
|
||
|
cv.create_line(770, 220 - 15, 770, 145, width=9, capstyle=ROUND, fill=color1)
|
||
|
|
||
|
else:
|
||
|
cv.create_line(490, 469 + 4.5, 580, 469 + 4.5, width=9, capstyle=ROUND, arrow=FIRST, fill=NOMARK)
|
||
|
cv.create_line(580, 180 + 4.5, 580, 469 + 4.5, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(580, 180 + 4.5, 620, 180 + 4.5, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(620, 145, 620, 180 + 4.5, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(770, 145, 620, 145, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.create_line(770, 220 - 15, 770, 145, width=9, capstyle=ROUND, fill=NOMARK)
|
||
|
cv.update()
|
||
|
|
||
|
if __name__ == '__main__':
|
||
|
from ALU import *
|
||
|
# al = ALU()
|
||
|
# al.init(cv, root)
|
||
|
|
||
|
co = Print_line()
|
||
|
# co.all()
|
||
|
# co.init()
|
||
|
# co.MCO_IR(cv, 1)
|
||
|
cpu.SigObj['MCO_PC'][1] = True
|
||
|
cpu.SigObj['MCO_IR'][1] = True
|
||
|
# co.mark(['PC_SIG'])
|
||
|
co.show()
|
||
|
# co.mark(['SIG_PC'])
|
||
|
# co.init()
|
||
|
|
||
|
|
||
|
|
||
|
def left1(event):
|
||
|
print(event.x,event.y)
|
||
|
cv.bind('<Button-1>', left1)
|
||
|
root.mainloop()
|
||
|
|
||
|
|
||
|
|
||
|
|