# cpy Thonny - guizero shuttle simulation - track
# provided by Anthony Vogelaar, Perth Scotland
# rev 0.10  2025-01-03  initial release

# tools |  manage packages | guizero : search on pypi | install
# drawing: https://lawsie.github.io/guizero/drawing/

from guizero import App, Drawing

# ==================== GUI setup =========================

app = App('Shuttle simulation', width=800, height=200)
ctx = Drawing(app, width='fill', height='fill')

# ======================= Widgets ========================

# draw track, center @ x=400, y=100
def track():
    ctx.line(10,  90, 790,  90, width=4)
    ctx.line(10, 110, 790, 110, width=4)


# draw layout,  signals, track and train
def layout():
    ctx.clear()					# clear context
    track()

# ======================= Timer =========================

# application sequencer
def onTimer():
    ...
    
# ========================= main =========================

layout()							# initial layout
# ctx.repeat(50, onTimer)			# sequencer
app.display()						# start GUI loop
    
# ========================== end =========================    
