Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions src/components/settings/ToolheadSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,23 @@
<v-divider />
</template>

<app-setting
:title="$t('app.setting.label.toolhead_drop_tool_gcode')"
:sub-title="$t('app.setting.tooltip.toolhead_drop_tool_gcode')"
>
<app-text-field
:value="toolheadDropToolGcode"
filled
dense
single-line
hide-details="auto"
submit-on-change
@submit="setToolheadDropToolGcode"
/>
</app-setting>

<v-divider />

<app-setting :title="$t('app.setting.label.reset')">
<app-btn
outlined
Expand Down Expand Up @@ -479,6 +496,18 @@ export default class ToolHeadSettings extends Mixins(ToolheadMixin) {
})
}

get toolheadDropToolGcode (): string {
return this.$typedState.config.uiSettings.general.toolheadDropToolGcode
}

setToolheadDropToolGcode (value: string) {
this.$typedDispatch('config/saveByPath', {
path: 'uiSettings.general.toolheadDropToolGcode',
value: value.trim(),
server: true
})
}

get zAdjustValues (): number[] {
return this.$typedState.config.uiSettings.general.zAdjustDistances
}
Expand Down
24 changes: 24 additions & 0 deletions src/components/widgets/toolhead/ToolChangeCommands.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,26 @@
</template>
{{ macro.description }}
</v-tooltip>
<v-tooltip
v-if="dropToolGcode && index2 === toolChangeCommandsGrouped.length - 1"
top
>
<template #activator="{ on, attrs }">
<app-btn
v-bind="attrs"
min-width="10"
:disabled="!klippyReady || printerPrinting"
class="px-0 flex-grow-1"
v-on="on"
@click="sendGcode(dropToolGcode)"
>
<v-icon small>
$mmuEject
</v-icon>
</app-btn>
</template>
{{ $t('app.tool.tooltip.drop_tool') }}
</v-tooltip>
</app-btn-group>
</v-col>
</v-row>
Expand Down Expand Up @@ -100,6 +120,10 @@ export default class ToolChangeCommands extends Mixins(StateMixin) {
.sort((a, b) => +a.name.substring(1) - +b.name.substring(1))
}

get dropToolGcode (): string {
return this.$typedState.config.uiSettings.general.toolheadDropToolGcode
}

get toolChangeCommandsGrouped (): ToolChangeCommand[][] {
const toolChangeCommands = this.toolChangeCommands

Expand Down
3 changes: 3 additions & 0 deletions src/locales/en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,7 @@ app:
to_browser_local_storage: To browser local storage
to_browser_session_storage: To browser session storage
toolhead_control_style: Toolhead control style
toolhead_drop_tool_gcode: Drop tool G-code
toolhead_move_distances: Toolhead distance values
toolhead_xy_move_distances: Toolhead XY distance values
toolhead_z_move_distances: Toolhead Z distance values
Expand Down Expand Up @@ -829,6 +830,7 @@ app:
[BETA] Enable and press '?' to view the list of available keyboard shortcuts
show_manual_probe_dialog_automatically: Automatically shows helper dialog if running a Manual Probe tool
show_bed_screws_adjust_dialog_automatically: Automatically shows helper dialog if running BED_SCREWS_ADJUST tool
toolhead_drop_tool_gcode: G-code command to run when dropping the current tool. Leave empty to hide the button.
show_screws_tilt_adjust_dialog_automatically: Automatically shows helper dialog if running SCREWS_TILT_CALCULATE tool
theme_disclaimer: >-
These themes feature brand names and logos that are the intellectual property of their respective owners.<br>
Expand Down Expand Up @@ -905,6 +907,7 @@ app:
manual_probe: Manual Probe
motors_off: Motors Off
relative_positioning: Relative Positioning
drop_tool: Drop current tool
select_tool: Select tool %{tool}
tools: Tools
label:
Expand Down
1 change: 1 addition & 0 deletions src/store/config/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export const defaultState = (): ConfigState => {
defaultToolheadXYSpeed: 130,
defaultToolheadZSpeed: 10,
toolheadControlStyle: 'cross',
toolheadDropToolGcode: 'TOOL_DROPOFF',
toolheadMoveDistances: [0.1, 1, 10, 25, 50, 100],
toolheadXYMoveDistances: [1, 10, 50],
toolheadZMoveDistances: [0.1, 1, 10],
Expand Down
1 change: 1 addition & 0 deletions src/store/config/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ export interface GeneralConfig {
defaultToolheadXYSpeed: number;
defaultToolheadZSpeed: number;
toolheadControlStyle: ToolheadControlStyle;
toolheadDropToolGcode: string;
toolheadMoveDistances: number[];
toolheadXYMoveDistances: number[];
toolheadZMoveDistances: number[];
Expand Down