From 437772c9081a4da256db1889317a7039f93361eb Mon Sep 17 00:00:00 2001 From: David Carley Date: Mon, 15 Mar 2021 19:21:06 -0700 Subject: [PATCH 1/2] Added a setting to allow disabling probing prompts --- src/js/control-view.js | 5 +++++ src/pug/templates/settings-view.pug | 6 ++++++ src/py/bbctrl/Config.py | 1 + src/resources/config-template.json | 5 +++++ src/resources/onefinity_machinist_defaults.json | 3 ++- src/resources/onefinity_woodworker_defaults.json | 3 ++- 6 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/js/control-view.js b/src/js/control-view.js index 02153c0..da1e56f 100644 --- a/src/js/control-view.js +++ b/src/js/control-view.js @@ -267,6 +267,11 @@ module.exports = { }, start_probe_test: function(on_finish) { + if (!this.config.settings['probing-prompts']) { + on_finish(); + return; + } + this.show_probe_test_modal = true; Vue.set(this.state, "saw_probe_connected", false); Vue.set(this.state, "on_probe_finish", on_finish); diff --git a/src/pug/templates/settings-view.pug b/src/pug/templates/settings-view.pug index bd596c7..058e043 100644 --- a/src/pug/templates/settings-view.pug +++ b/src/pug/templates/settings-view.pug @@ -35,6 +35,12 @@ script#settings-view-template(type="text/x-template") | units used in motor configuration. GCode #[tt program-start], | set below, may also change the default machine units. + fieldset + h2 Probing safety prompts + templated-input(name="probing-prompts", + :model.sync="config.settings['probing-prompts']", + :template="template.settings['probing-prompts']") + fieldset h2 Probe Dimensions templated-input(v-for="templ in template.probe", :name="$key", diff --git a/src/py/bbctrl/Config.py b/src/py/bbctrl/Config.py index ab557a8..7c03e0c 100644 --- a/src/py/bbctrl/Config.py +++ b/src/py/bbctrl/Config.py @@ -144,6 +144,7 @@ class Config(object): if version < (1, 0, 7): config['settings']['max-deviation'] = 0.001 config['settings']['junction-accel'] = 200000 + config['settings']['probing-prompts'] = True for motor in config['motors']: motor['stall-microstep'] = 8 motor['stall-current'] = 1 diff --git a/src/resources/config-template.json b/src/resources/config-template.json index a2368bc..3c3efc8 100644 --- a/src/resources/config-template.json +++ b/src/resources/config-template.json @@ -22,6 +22,11 @@ "max": 100000000, "unit": "mm/min²", "default": 200000 + }, + "probing-prompts": { + "help": "Enable or disable safety prompts during and after probing", + "type": "bool", + "default": true } }, "motors": { diff --git a/src/resources/onefinity_machinist_defaults.json b/src/resources/onefinity_machinist_defaults.json index 1fc9a26..d6577e3 100644 --- a/src/resources/onefinity_machinist_defaults.json +++ b/src/resources/onefinity_machinist_defaults.json @@ -29,7 +29,8 @@ "settings": { "junction-accel": 200000, "max-deviation": 0.001, - "units": "METRIC" + "units": "METRIC", + "probing-prompts": true }, "motors": [ { diff --git a/src/resources/onefinity_woodworker_defaults.json b/src/resources/onefinity_woodworker_defaults.json index c6de435..ccfe8bc 100644 --- a/src/resources/onefinity_woodworker_defaults.json +++ b/src/resources/onefinity_woodworker_defaults.json @@ -29,7 +29,8 @@ "settings": { "junction-accel": 200000, "max-deviation": 0.001, - "units": "METRIC" + "units": "METRIC", + "probing-prompts": true }, "motors": [ { From f913382726d0b6a07d0bd70d962b0064c761767c Mon Sep 17 00:00:00 2001 From: David Carley Date: Tue, 16 Mar 2021 19:10:37 -0700 Subject: [PATCH 2/2] No "probing complete" modal if disabled --- src/js/control-view.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/js/control-view.js b/src/js/control-view.js index da1e56f..1d49078 100644 --- a/src/js/control-view.js +++ b/src/js/control-view.js @@ -406,7 +406,9 @@ module.exports = { M2 `); - setTimeout(() => Vue.set(this.state, "wait_for_probing_complete", true), 1000); + if (this.config.settings['probing-prompts']) { + setTimeout(() => Vue.set(this.state, "wait_for_probing_complete", true), 1000); + } }, probe_z() { @@ -436,7 +438,9 @@ module.exports = { M2 `); - setTimeout(() => Vue.set(this.state, "wait_for_probing_complete", true), 1000); + if (this.config.settings['probing-prompts']) { + setTimeout(() => Vue.set(this.state, "wait_for_probing_complete", true), 1000); + } }, jog_fn: function (x_jog,y_jog,z_jog,a_jog) {