Skip to content

Commit

Permalink
disable gates greater than number configured on mmu incase of connect…
Browse files Browse the repository at this point in the history
…ing to multiple mmus
  • Loading branch information
moggieuk committed Nov 7, 2024
1 parent 0eeedbf commit 726ef5b
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 12 deletions.
3 changes: 3 additions & 0 deletions happy_hare/iter_calibration.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ name: {{ gettext('Calibrate #{i}') }}
icon: mmu_calibrate
method: printer.gcode.script
params: { "script":"MMU_CALIBRATE_GATES GATE={i}" }
enable: {{ printer.mmu.action == "Idle" and printer.mmu.num_gates > {i} }}
show_disabled: True
refresh_on: printer.mmu.action
2 changes: 1 addition & 1 deletion happy_hare/iter_check_gates.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ name: {{ gettext('Check Gate #{i}') }}
icon: mmu_checkgate{i}
method: printer.gcode.script
params: { "script":"MMU_CHECK_GATE GATE={i} QUIET=1" }
enable: {{ printer.mmu.action == "Idle" }}
enable: {{ printer.mmu.action == "Idle" and printer.mmu.num_gates > {i} }}
show_disabled: True
refresh_on: printer.mmu.action
2 changes: 1 addition & 1 deletion happy_hare/iter_config_select_gates.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ name: {{ gettext('Select Gate #{i}') }}
icon: mmu_select_gate
method: printer.gcode.script
params: { "script":"MMU_SELECT GATE={i}" }
enable: {{ printer.mmu.gate != {i} and printer.mmu.action == "Idle" }}
enable: {{ printer.mmu.gate != {i} and printer.mmu.action == "Idle" and printer.mmu.num_gates > {i} }}
show_disabled: True
refresh_on: printer.mmu.gate, printer.mmu.action
2 changes: 1 addition & 1 deletion happy_hare/iter_eject_gates.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ name: {{ gettext('Eject Gate #{i}') }}
icon: mmu_eject
method: printer.gcode.script
params: { "script":"MMU_EJECT GATE={i}" }
enable: {{ printer.mmu.action == "Idle" and printer.mmu.gate_status[{i}] != 0 }}
enable: {{ printer.mmu.action == "Idle" and printer.mmu.gate_status[{i}] != 0 and printer.mmu.num_gates > {i} }}
show_disabled: True
refresh_on: printer.mmu.gate, printer.mmu.action
2 changes: 1 addition & 1 deletion happy_hare/iter_load_tools.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ name: {{ gettext('T{i}') }}
icon: mmu_t{i}
method: printer.gcode.script
params: { "script":"MMU_CHANGE_TOOL TOOL={i} QUIET=1" }
enable: {{ (printer.mmu.tool != {i} or (printer.mmu.tool == {i} and printer.mmu.filament != "Loaded")) and printer.mmu.gate_status[{i}] != 0 and printer.mmu.action == "Idle" }}
enable: {{ (printer.mmu.tool != {i} or (printer.mmu.tool == {i} and printer.mmu.filament != "Loaded")) and printer.mmu.gate_status[{i}] != 0 and printer.mmu.action == "Idle" and printer.mmu.num_gates > {i} }}
show_disabled: True
refresh_on: printer.mmu.tool, printer.mmu.gate_status, printer.mmu.filament, printer.mmu.action
2 changes: 1 addition & 1 deletion happy_hare/iter_preload_gates.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ name: {{ gettext('Preload Gate #{i}') }}
icon: mmu_reset
method: printer.gcode.script
params: { "script":"MMU_PRELOAD GATE={i}" }
enable: {{ printer.mmu.action == "Idle" }}
enable: {{ printer.mmu.action == "Idle" and printer.mmu.num_gates > {i} }}
show_disabled: True
refresh_on: printer.mmu.action
2 changes: 1 addition & 1 deletion happy_hare/iter_select_gates.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ name: {{ gettext('Select Gate #{i}') }}
icon: mmu_select_gate
method: printer.gcode.script
params: { "script":"MMU_SELECT GATE={i}" }
enable: {{ printer.mmu.gate != {i} and printer.mmu.action == "Idle" }}
enable: {{ printer.mmu.gate != {i} and printer.mmu.action == "Idle" and printer.mmu.num_gates > {i} }}
show_disabled: True
refresh_on: printer.mmu.gate, printer.mmu.action
2 changes: 1 addition & 1 deletion happy_hare/iter_select_tools.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ name: {{ gettext('Select Tool T{i}') }}
icon: mmu_t{i}
method: printer.gcode.script
params: { "script":"MMU_SELECT TOOL={i}" }
enable: {{ printer.mmu.tool != {i} and printer.mmu.action == "Idle" }}
enable: {{ printer.mmu.tool != {i} and printer.mmu.action == "Idle" and printer.mmu.num_gates > {i} }}
show_disabled: True
refresh_on: printer.mmu.tool, printer.mmu.action
12 changes: 7 additions & 5 deletions happy_hare/menus.conf
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ name: {{ gettext('Select Bypass') }}
icon: mmu_select_bypass
method: printer.gcode.script
params: {"script":"MMU_SELECT_BYPASS"}
enable: {{ printer.mmu.gate != -2 and printer.mmu.action == "Idle" }}
enable: {{ printer.mmu.gate != -2 and printer.mmu.action == "Idle" and printer.mmu.has_bypass }}
show_disabled: True
refresh_on: printer.mmu.gate, printer.mmu.action
refresh_on: printer.mmu.gate, printer.mmu.action, printer.mmu.has_bypass

MMU_iter_select_gates

Expand Down Expand Up @@ -238,6 +238,8 @@ name: {{ gettext('Home') }}
icon: home
method: printer.gcode.script
params: {"script":"MMU_HOME"}
enable: {{ printer.mmu.selector_type and printer.mmu.selector_type != "VirtualSelector" }}
show_disabled: True

[menu __main more mmu_calib select_gates]
name: {{ gettext('Select Gate...') }}
Expand All @@ -262,7 +264,7 @@ name: {{ gettext('Servo UP') }}
icon: arrow-up
method: printer.gcode.script
params: {"script":"MMU_SERVO POS=up"}
enable: {{ printer.mmu.servo != "Up" }}
enable: {{ printer.mmu.selector_type and printer.mmu.selector_type != "VirtualSelector" and printer.mmu.servo != "Up" }}
show_disabled: True
refresh_on: printer.mmu.servo

Expand All @@ -271,7 +273,7 @@ name: {{ gettext('Servo MOVE') }}
icon: arrow-right
method: printer.gcode.script
params: {"script":"MMU_SERVO POS=move"}
enable: {{ printer.mmu.servo != "Move" }}
enable: {{ printer.mmu.selector_type and printer.mmu.selector_type != "VirtualSelector" and printer.mmu.servo != "Move" }}
show_disabled: True
refresh_on: printer.mmu.servo

Expand All @@ -280,7 +282,7 @@ name: {{ gettext('Servo DOWN') }}
icon: arrow-down
method: printer.gcode.script
params: {"script":"MMU_SERVO POS=down"}
enable: {{ printer.mmu.servo != "Down" }}
enable: {{ printer.mmu.selector_type and printer.mmu.selector_type != "VirtualSelector" and printer.mmu.servo != "Down" }}
show_disabled: True
refresh_on: printer.mmu.servo

Expand Down

0 comments on commit 726ef5b

Please sign in to comment.