From 9c4f85f865d0ddfd7b1e4583466b280cc222e3d7 Mon Sep 17 00:00:00 2001 From: Jonathan Hogg Date: Wed, 18 Sep 2019 10:37:35 +0100 Subject: [PATCH] Threaded server support --- innernaut.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/innernaut.py b/innernaut.py index 95b73f9..764ea31 100644 --- a/innernaut.py +++ b/innernaut.py @@ -1,3 +1,12 @@ +#%% + +from flight.server import FlightServer + +server = FlightServer.ensure_threaded_instance() + + +#%% + import math @@ -104,7 +113,7 @@ with Screen('main', width=1920, height=1080) as screen: client.activate() with Cue('Q1', name='Spinning triangles') as Q1: - period = 20 + period = 10 count = t / period Match('#outer').rotate = count Match('#inner').rotate = -count @@ -118,3 +127,6 @@ with Cue('Q2', name='Blinking eyes') as Q2: blink = 1 - when((cycle > offset) & (cycle < offset + duration), impulse((cycle - offset) / duration), 0) Match('.pupil > Rect').y = -PupilHeight / 2 * blink Match('.pupil > Rect').height = PupilHeight * blink + + +start('#Q1')