Михаил Капелько 4 months ago
parent
commit
9b8b7fb424
2 changed files with 6 additions and 7 deletions
  1. +2
    -2
      v5/desktop_SequentialTimer.py
  2. +4
    -5
      v5/main-gui.py

+ 2
- 2
v5/desktop_SequentialTimer.py View File

@@ -3,7 +3,7 @@ import time
class desktop_SequentialTimer():
def __init__(self):
self.activeTimeout = None
self.ctrl = None
self.callback = None
self.queue = []
#}

@@ -26,7 +26,7 @@ class desktop_SequentialTimer():
value = self.queue[0][2]
self.queue.pop(0)
self.activeTimeout = None
self.ctrl.set(key, value)
self.callback(key, value)
#}
#}



+ 4
- 5
v5/main-gui.py View File

@@ -75,16 +75,15 @@ ctrl.registerFunctions([
memory_selectItem,
])

def printOutput(c):
if c.recentField.startswith("output"):
print(c.field(c.recentField))
ctrl.registerCallback(printOutput)
def printDbg(c):
print(f"Dbg key/value: '{c.recentField}'/'{c.field(c.recentField)}'")
ctrl.registerCallback(printDbg)
ctrl.registerFieldCallback("exit", lambda c: sys.exit(0))

p = desktop_Platform()
p.ctrl = ctrl
p.sequentialTimer = desktop_SequentialTimer()
p.sequentialTimer.ctrl = ctrl
p.sequentialTimer.callback = lambda key, value: ctrl.set(key, value)

# Copy context to platform.
# And process lots of functions that are interested in changes.


Loading…
Cancel
Save