diff --git a/src/app/containers/Preferences/Preferences.jsx b/src/app/containers/Preferences/Preferences.jsx index 7604033e0..a0b7ee3ce 100644 --- a/src/app/containers/Preferences/Preferences.jsx +++ b/src/app/containers/Preferences/Preferences.jsx @@ -182,7 +182,6 @@ class PreferencesPage extends PureComponent { shouldWarnZero: store.get('workspace.shouldWarnZero', false), ipRange: store.get('widgets.connection.ip', [192, 168, 5, 1]), toolChange: { - passthrough: store.get('workspace.toolChange.passthrough', false), skipDialog: store.get('workspace.toolChange.skipDialog', false) }, rotary: { @@ -750,15 +749,6 @@ class PreferencesPage extends PureComponent { } }, toolChange: { - handlePassthroughToggle: () => { - const { toolChange } = this.state; - this.setState({ - toolChange: { - ...toolChange, - passthrough: !toolChange.passthrough - } - }); - }, handleSkipDialog: () => { const { toolChange } = this.state; this.setState({ @@ -897,7 +887,6 @@ class PreferencesPage extends PureComponent { this.probeConfig.set('probeFastFeedrate', probeSettings.fastFeedrate); this.probeConfig.set('connectivityTest', probeSettings.connectivityTest); this.probeConfig.set('zProbeDistance', probeSettings.zProbeDistance); - store.set('workspace.toolChange.passthrough', toolChange.passthrough); store.set('workspace.toolChange.skipDialog', toolChange.skipDialog); controller.command('settings:updated', this.state); diff --git a/src/app/containers/Preferences/ToolChange/ToolChange.js b/src/app/containers/Preferences/ToolChange/ToolChange.js index a32fb36bc..c2c586fab 100644 --- a/src/app/containers/Preferences/ToolChange/ToolChange.js +++ b/src/app/containers/Preferences/ToolChange/ToolChange.js @@ -51,6 +51,11 @@ export const TOOLCHANGE_OPTIONS = { key: 'CODE', label: 'Code', description: 'Run code before and after the toolchange.' + }, + PASSTHROUGH: { + key: 'PASSTHROUGH', + label: 'Passthrough', + description: 'Send the toolchange line as is. This assumes that your firmware can properly handle both M6 and T commands.' } }; @@ -67,7 +72,7 @@ const ToolChange = ({ state, actions, mpos, $13 }) => { // State const [toolChangeOption, setToolChangeOption] = useState(store.get('workspace.toolChangeOption')); const [toolChangePosition, setToolChangePosition] = useState($13 ? convertToolChangePosition() : store.get('workspace.toolChangePosition')); - const [optionDescription, setOptionDescription] = useState(''); + const [optionDescription, setOptionDescription] = useState(TOOLCHANGE_OPTIONS[toolChangeOption.toUpperCase()]?.description); const [preHook, setPreHook] = useState(store.get('workspace.toolChangeHooks.preHook')); const [postHook, setPostHook] = useState(store.get('workspace.toolChangeHooks.postHook')); //const [combineBlocks, setCombineBlocks] = useState(false); @@ -152,30 +157,7 @@ const ToolChange = ({ state, actions, mpos, $13 }) => { return (
- { - toolChangeOption !== 'Code' && ( - - - - ) - } - { - toolChangeOption === 'Code' && ( - - - - ) - } + Strategy to handle M6 tool change commands
{ toolChangeOption === 'Code' && (
- +