Skip to content

Commit

Permalink
preparation for schematic editor
Browse files Browse the repository at this point in the history
  • Loading branch information
johnrm174 committed Feb 26, 2022
1 parent f9148ff commit 43dba32
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 996 deletions.
Binary file removed colourlight.png
Binary file not shown.
22 changes: 0 additions & 22 deletions model_railway_signals/signals_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -589,26 +589,4 @@ def publish_signal_passed_event(sig_id:int):
mqtt_interface.send_mqtt_message("signal_passed_event",sig_id,data=data,log_message=log_message,retain=False)
return()

# ------------------------------------------------------------------------------------------
# Common internal functions for deleting a signal object (including all the drawing objects)
# This is used by the schematic editor for moving signals and changing signal types where we
# delete the existing signal with all its data and then recreate it in its new configuration
# ------------------------------------------------------------------------------------------

def delete_signal(sig_id:int):
global signals
if sig_exists(sig_id):
# Delete all the tkinter canvas drawing objects created for the signal
signals[str(sig_id)]["canvas"].delete("signal"+str(sig_id))
# Delete all the tkinter button objects created for the signal
signals[str(sig_id)]["sigbutton"].destroy()
signals[str(sig_id)]["subbutton"].destroy()
signals[str(sig_id)]["passedbutton"].destroy()
# This buttons is only common to colour light and semaphore types
if signals[str(sig_id)]["sigtype"] in (sig_type.colour_light,sig_type.semaphore):
signals[str(sig_id)]["releasebutton"].destroy()
# Finally, delete the signal entry from the dictionary of signals
del signals[str(sig_id)]
return()

#################################################################################################
Loading

0 comments on commit 43dba32

Please sign in to comment.