|
|
@ -78,6 +78,7 @@ class Visualisation:
|
|
|
|
|
|
|
|
|
|
|
|
def reload(self):
|
|
|
|
def reload(self):
|
|
|
|
self.mapfile.load()
|
|
|
|
self.mapfile.load()
|
|
|
|
|
|
|
|
self.histograms = None
|
|
|
|
self.squares = None
|
|
|
|
self.squares = None
|
|
|
|
self.draw()
|
|
|
|
self.draw()
|
|
|
|
|
|
|
|
|
|
|
@ -94,8 +95,8 @@ class Visualisation:
|
|
|
|
def run(self, *, refresh=1800):
|
|
|
|
def run(self, *, refresh=1800):
|
|
|
|
pygame.time.set_timer(pygame.USEREVENT, refresh * 1000)
|
|
|
|
pygame.time.set_timer(pygame.USEREVENT, refresh * 1000)
|
|
|
|
pygame.event.set_blocked(None)
|
|
|
|
pygame.event.set_blocked(None)
|
|
|
|
# pygame.event.set_allowed([pygame.USEREVENT, pygame.VIDEORESIZE, pygame.VIDEOEXPOSE, pygame.QUIT, pygame.KEYDOWN])
|
|
|
|
pygame.event.set_allowed([pygame.USEREVENT, pygame.VIDEORESIZE, pygame.VIDEOEXPOSE, pygame.QUIT, pygame.KEYDOWN])
|
|
|
|
pygame.event.set_allowed([pygame.VIDEORESIZE, pygame.VIDEOEXPOSE, pygame.QUIT, pygame.KEYDOWN])
|
|
|
|
# pygame.event.set_allowed([pygame.VIDEORESIZE, pygame.VIDEOEXPOSE, pygame.QUIT, pygame.KEYDOWN])
|
|
|
|
self.draw()
|
|
|
|
self.draw()
|
|
|
|
while True:
|
|
|
|
while True:
|
|
|
|
ev = pygame.event.wait()
|
|
|
|
ev = pygame.event.wait()
|
|
|
@ -121,5 +122,11 @@ class Visualisation:
|
|
|
|
colors['+'] = (0, 0, 0)
|
|
|
|
colors['+'] = (0, 0, 0)
|
|
|
|
self.squares = None
|
|
|
|
self.squares = None
|
|
|
|
self.draw()
|
|
|
|
self.draw()
|
|
|
|
|
|
|
|
if ev.type == pygame.KEYDOWN and ev.key == pygame.K_x:
|
|
|
|
|
|
|
|
self.order = ['@', '+', '?', '-', '/', '*']
|
|
|
|
|
|
|
|
self.squares = None
|
|
|
|
|
|
|
|
self.draw()
|
|
|
|
|
|
|
|
if ev.type == pygame.USEREVENT:
|
|
|
|
|
|
|
|
self.reload()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|