Skip to content

Commit

Permalink
Merge pull request #3107 from Sigma1912/2.9-fix-sim-config-manual-too…
Browse files Browse the repository at this point in the history
…lchange-with-tool-length-switch

2.9 fix sim config manual toolchange with tool length switch
  • Loading branch information
andypugh authored Sep 11, 2024
2 parents 7edb174 + b737fa6 commit 2a2513e
Show file tree
Hide file tree
Showing 3 changed files with 206 additions and 113 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,6 @@ PARAMETER_FILE = sim_mm.var
SUBROUTINE_PATH = nc_subroutines:../../nc_files/remap_lib/common_nc_subs
LOG_LEVEL = 9

# optional features - a bit mask to selectively turn on experimental/dubious features
# see
# RETAIN_G43 0x00000001
# OWORD_N_ARGS 0x00000002
# INI_VARS 0x00000004
# HAL_PIN_VARS 0x00000008
# NO_DOWNCASE_OWORD 0x00000010
# turn on all optional features

# turn on all optional features except RETAIN_G43
FEATURES= 30

ON_ABORT_COMMAND= O <on_abort> call

# ------ remapping toolchange - related codes ----------------------
Expand Down
Original file line number Diff line number Diff line change
@@ -1,141 +1,246 @@
<?xml version="1.0"?>
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.38.2 -->
<interface>
<requires lib="gtk+" version="2.16"/>
<!-- interface-requires gladevcp 0.0 -->
<!-- interface-naming-policy project-wide -->
<requires lib="gtk+" version="3.0"/>
<requires lib="gladevcp" version="0.0"/>
<object class="GtkWindow" id="window1">
<property name="can-focus">False</property>
<child>
<object class="GtkVBox" id="vbox1">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="HAL_Table" id="enable">
<object class="GtkBox">
<property name="visible">True</property>
<property name="n_rows">6</property>
<property name="n_columns">2</property>
<child>
<object class="HAL_Button" id="changed">
<property name="label" translatable="yes">Change complete</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options"></property>
<property name="y_options"></property>
</packing>
</child>
<child>
<object class="HAL_ToggleButton" id="reftool">
<property name="label" translatable="yes">Reference Tool</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options"></property>
<property name="y_options"></property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="label" translatable="yes">probing:</property>
</object>
<packing>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
</packing>
</child>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="HAL_LED" id="probing-led">
<object class="GtkLabel" id="label2">
<property name="visible">True</property>
<property name="pick_color_on">#1525ffff4fdc</property>
<property name="led_shape">2</property>
<property name="can-focus">False</property>
<property name="margin-bottom">8</property>
<property name="xpad">0</property>
<property name="ypad">5</property>
<property name="label" translatable="yes">Manual Toolchange
with Probing</property>
<attributes>
<attribute name="font-desc" value="Sans Bold 12"/>
</attributes>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="HAL_LED" id="change-led">
<!-- n-columns=2 n-rows=1 -->
<object class="GtkGrid">
<property name="visible">True</property>
<property name="pick_color_on">#fffff232127d</property>
<property name="led_shape">2</property>
<signal name="hal_pin_changed" handler="on_led_change"/>
<property name="can-focus">False</property>
<child>
<object class="HAL_LED" id="change-led">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-left">20</property>
<property name="led-blink-rate">0</property>
<property name="led-shape">2</property>
<property name="off-color">black</property>
<property name="on-color">orange</property>
<property name="pick-color-off">#000000000000</property>
<property name="pick-color-on">#c6c646460000</property>
<signal name="hal-pin-changed" handler="on_led_change" swapped="no"/>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="change-text">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-left">10</property>
<property name="xpad">5</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">0</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<!-- n-columns=1 n-rows=3 -->
<object class="HAL_Table" id="enable">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkLabel" id="change-text">
<property name="visible">True</property>
</object>
</child>
<child>
<object class="HAL_Button" id="probe-contact">
<property name="label" translatable="yes">Simulate probe
contact</property>
<!-- n-columns=1 n-rows=2 -->
<object class="GtkGrid">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="can-focus">False</property>
<property name="halign">end</property>
<property name="valign">center</property>
<property name="row-spacing">5</property>
<child>
<object class="HAL_ToggleButton" id="reftool">
<property name="label" translatable="yes">Reference Tool</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="margin-right">25</property>
<property name="image-position">top</property>
<property name="active">True</property>
<property name="draw-indicator">True</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="HAL_Button" id="changed">
<property name="label" translatable="yes">Tool change complete</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="margin-right">25</property>
<property name="image-position">top</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">1</property>
</packing>
</child>
</object>
<packing>
<property name="right_attach">2</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="x_options"></property>
<property name="y_options"></property>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="HAL_Label" id="reflen">
<object class="GtkFrame">
<property name="visible">True</property>
<property name="label" translatable="yes">label</property>
<property name="label_pin_type">1</property>
<property name="text_template">Reference Z length: %f</property>
<property name="can-focus">False</property>
<property name="margin-left">5</property>
<property name="margin-right">5</property>
<property name="margin-top">5</property>
<property name="margin-bottom">5</property>
<property name="label-xalign">0</property>
<child>
<object class="GtkAlignment">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="left-padding">12</property>
<child>
<!-- n-columns=2 n-rows=3 -->
<object class="GtkGrid">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="HAL_LED" id="probing-led">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-right">10</property>
<property name="led-blink-rate">5</property>
<property name="led-shape">2</property>
<property name="off-color">black</property>
<property name="pick-color-off"/>
<property name="pick-color-on">#1525ffff4fdc</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="HAL_Button" id="probe-contact">
<property name="label" translatable="yes">Simulate probe contact</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="margin-right">5</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="HAL_Label" id="currlen">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">label</property>
<property name="label-pin-type">1</property>
<property name="text-template">Current Z length: %f</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="HAL_Label" id="reflen">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">label</property>
<property name="label-pin-type">1</property>
<property name="text-template">Reference Z length: %f</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="xpad">10</property>
<property name="ypad">3</property>
<property name="label" translatable="yes">Tool probe</property>
</object>
</child>
</object>
<packing>
<property name="right_attach">2</property>
<property name="top_attach">4</property>
<property name="bottom_attach">5</property>
<property name="y_padding">4</property>
<property name="left-attach">0</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="HAL_Label" id="currlen">
<property name="visible">True</property>
<property name="label" translatable="yes">label</property>
<property name="label_pin_type">1</property>
<property name="text_template">Current Z length: %f</property>
</object>
<packing>
<property name="right_attach">2</property>
<property name="top_attach">5</property>
<property name="bottom_attach">6</property>
<property name="y_padding">4</property>
</packing>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="padding">3</property>
<property name="position">0</property>
<property name="position">1</property>
</packing>
</child>
<child>
<placeholder/>
</child>
</object>
</child>
</object>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ def on_led_change(self,hal_led,data=None):
'''
if hal_led.hal_pin.get():
if self.halcomp["number"] > 0.0:
self.change_text.set_label("Insert too number %d" % (int(self.halcomp["number"])))
self.change_text.set_label("Insert tool number %d" % (int(self.halcomp["number"])))
else:
self.change_text.set_label("Remove tool")
else:
self.change_text.set_label("")
self.change_text.set_label("No change requested")

def __init__(self, halcomp,builder,useropts):
self.halcomp = halcomp
Expand Down

0 comments on commit 2a2513e

Please sign in to comment.