-
Notifications
You must be signed in to change notification settings - Fork 0
/
DebugWindow.py
37 lines (31 loc) · 959 Bytes
/
DebugWindow.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/python
from tkinter import *
from enum import Enum
import threading
#import fcntl, array, RPi.GPIO as GPIO
FONT="Helvetica 8"
class DebugWindow():
def __init__(self, DEBUG, LED_LIST, tkWindow, window):
self.DEBUG = DEBUG
if(DEBUG):
self.tkWindow = tkWindow
print(self.tkWindow)
self.window = window
self.test = 0
self.LED_LIST = LED_LIST
self.NUM_LEDS = len(LED_LIST)
#open the SPI device for writing
n = 0
while(n<self.NUM_LEDS):
pos = (n+1)
x1 = 7
y1 = 7
self.window.create_rectangle((x1*pos), 10, (y1*pos)+10, 300, fill="yellow", tags ="Light_"+str(pos))
self.window.create_text((x1*pos)+5, y1+10 , text=str(pos), fill="purple", font=FONT, tags = "Text_"+str(pos))
n = n+1
self.window.pack(side="top", fill="both", expand=True)
self.tkwindow.mainloop()
def run(self):
if (self.DEBUG):
self.window.pack(side="top", fill="both", expand=True)
self.tkwindow.mainloop()