Skip to content

Commit 8078bbb

Browse files
committed
260202.2
1 parent 41ac3cd commit 8078bbb

File tree

5 files changed

+23
-6
lines changed

5 files changed

+23
-6
lines changed

easycoder/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
from .ec_timestamp import *
1616
from .ec_value import *
1717

18-
__version__ = "260202.1"
18+
__version__ = "260202.2"

easycoder/debugger/ec_debug.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,12 @@ def __init__(self, program, width=800, height=600, ratio=0.2):
466466
self._flush_timer.timeout.connect(self._flush_console_buffer)
467467
self._flush_timer.stop()
468468

469+
# Periodic program flush (needed for wait/timers in debug mode)
470+
self._program_timer = QTimer(self)
471+
self._program_timer.setInterval(10)
472+
self._program_timer.timeout.connect(self._tick_program)
473+
self._program_timer.start()
474+
469475
# Keep a ratio so proportions are preserved when window is resized
470476
self.ratio = ratio
471477

@@ -905,6 +911,15 @@ def _restoreQueueState(self):
905911
ec_program.queue.extend(self.saved_queue)
906912
except Exception as ex:
907913
print(f"Error restoring queue state: {ex}")
914+
915+
def _tick_program(self):
916+
"""Periodic flush to keep debug-mode scripts progressing."""
917+
try:
918+
if self.program and self.program.running:
919+
from easycoder.ec_program import flush
920+
flush()
921+
except Exception as ex:
922+
print(f"Error during program tick: {ex}")
908923

909924
def doRun(self):
910925
"""Resume free-running execution from current PC"""

easycoder/ec_core.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1909,9 +1909,8 @@ def r_wait(self, command):
19091909
# In debug mode, use Qt's event loop to resume safely on the UI thread
19101910
from PySide6.QtCore import QTimer
19111911
def resume():
1912-
self.program.run(next)
1913-
from easycoder.ec_program import flush
1914-
flush()
1912+
# Just enqueue - let the graphics timer's flush handle execution
1913+
self.program.queueIntent(next)
19151914
QTimer.singleShot(int(value), resume)
19161915
else:
19171916
# In normal mode, resume via the thread-safe intent queue

easycoder/ec_graphics.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1043,7 +1043,10 @@ def r_init(self, command):
10431043
def on_last_window_closed():
10441044
self.program.kill()
10451045
def init():
1046-
self.program.flush(self.nextPC())
1046+
try:
1047+
self.program.flush(self.nextPC())
1048+
except Exception as e:
1049+
pass
10471050
def flush():
10481051
if not self.blocked:
10491052
if self.runOnTick != 0:

testnewui.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
from easycoder import Program
55

66
os.chdir('/home/graham/dev/rbr/dev/rbr/')
7-
Program('uicore.ecs').start()
7+
Program('debug uicore.ecs').start()

0 commit comments

Comments
 (0)