2019-04-08 11:20:33 +02:00
|
|
|
from DesignEntity import DesignEntity
|
|
|
|
from TextDesign import TextDesign
|
|
|
|
from Assets import colors
|
|
|
|
|
|
|
|
font_size = 20
|
|
|
|
|
2019-07-13 08:05:35 +02:00
|
|
|
|
2019-04-08 11:20:33 +02:00
|
|
|
class TechnicalDataDesign(DesignEntity):
|
|
|
|
'''Prints data about the current loop ontop of the panel'''
|
2019-07-13 08:05:35 +02:00
|
|
|
|
2019-04-08 11:20:33 +02:00
|
|
|
def __init__(self, size, start, stop):
|
2019-07-13 08:05:35 +02:00
|
|
|
super(TechnicalDataDesign, self).__init__(size, mask=True)
|
2019-04-08 11:20:33 +02:00
|
|
|
self.start = start
|
|
|
|
self.stop = stop
|
|
|
|
|
|
|
|
def __finish_image__(self):
|
|
|
|
data = self.__get_data__()
|
|
|
|
|
|
|
|
txt = TextDesign(self.size, text=data, fontsize=font_size)
|
|
|
|
txt.color = colors["fg"]
|
|
|
|
txt.pos = (0, 0)
|
|
|
|
self.draw_design(txt)
|
|
|
|
|
|
|
|
txt = TextDesign(self.size, text=data, fontsize=font_size)
|
|
|
|
txt.color = colors["hl"]
|
|
|
|
txt.pos = (1, 1)
|
|
|
|
self.draw_design(txt)
|
|
|
|
|
|
|
|
txt = TextDesign(self.size, text=data, fontsize=font_size)
|
|
|
|
txt.color = colors["fg"]
|
|
|
|
txt.pos = (2, 2)
|
|
|
|
self.draw_design(txt)
|
|
|
|
|
|
|
|
def __get_data__(self):
|
|
|
|
data = "START: "
|
|
|
|
data += str(self.start)
|
2019-04-08 15:20:09 +02:00
|
|
|
data += "\nDURATION BEFORE RENDER: "
|
2019-04-08 11:20:33 +02:00
|
|
|
dur = self.stop - self.start
|
|
|
|
data += str(dur)
|
|
|
|
data += "\nSTOP: "
|
|
|
|
data += str(self.stop)
|
2019-07-13 08:05:35 +02:00
|
|
|
return data
|