Clean up code
This commit is contained in:
parent
fcd9d6465f
commit
e1e6878923
|
@ -18,28 +18,21 @@ class CharacterDisplay:
|
|||
self.minX = minX
|
||||
self.maxX = maxX
|
||||
|
||||
def displayDigit(self, x, y, digit, color):
|
||||
if digit == 0:
|
||||
self.displayZero(x, y, color)
|
||||
elif digit == 1:
|
||||
self.displayOne(x, y, color)
|
||||
elif digit == 2:
|
||||
self.displayTwo(x, y, color)
|
||||
elif digit == 3:
|
||||
self.displayThree(x, y, color)
|
||||
elif digit == 4:
|
||||
self.displayFour(x, y, color)
|
||||
elif digit == 5:
|
||||
self.displayFive(x, y, color)
|
||||
elif digit == 6:
|
||||
self.displaySix(x, y, color)
|
||||
elif digit == 7:
|
||||
self.displaySeven(x, y, color)
|
||||
elif digit == 8:
|
||||
self.displayEight(x, y, color)
|
||||
elif digit == 9:
|
||||
self.displayNine(x, y, color)
|
||||
self.digits = {
|
||||
0: self.displayZero,
|
||||
1: self.displayOne,
|
||||
2: self.displayTwo,
|
||||
3: self.displayThree,
|
||||
4: self.displayFour,
|
||||
5: self.displayFive,
|
||||
6: self.displaySix,
|
||||
7: self.displaySeven,
|
||||
8: self.displayEight,
|
||||
9: self.displayNine
|
||||
}
|
||||
|
||||
def displayDigit(self, x, y, digit, color):
|
||||
self.digits[digit](x, y, color)
|
||||
self.unicorn.show()
|
||||
|
||||
def clearDigit(self, x, y):
|
||||
|
|
|
@ -9,7 +9,7 @@ class TimeDisplay:
|
|||
self.currentHour = [-1, -1]
|
||||
self.currentMinute = [-1, -1]
|
||||
self.currentColor = [0, 0, 0]
|
||||
self.color = [255, 120, 0]
|
||||
self.color = [255, 80, 0]
|
||||
self.hourStartColumn = -1
|
||||
self.timeDotsColumn = 7
|
||||
self.minuteStartColumn = 9
|
||||
|
|
Loading…
Reference in New Issue