diff --git a/app/css/image-checkbox.css b/app/css/image-checkbox.css new file mode 100644 index 00000000..10d2c02b --- /dev/null +++ b/app/css/image-checkbox.css @@ -0,0 +1,81 @@ +.image-checkbox-text { + font-size: 11px; + text-align: center; + width: 95px; + height: 36px; + word-wrap: break-word; +} + +.image-checkbox-ul { + list-style-type: none; +} + +.image-checkbox-ul>li { + display: inline-block; +} + +.image-checkbox-ul input[type="checkbox"] { + display: none; +} + +.image-checkbox-ul input[type="radio"] { + display: none; +} + +.image-checkbox-ul label { + padding: 10px; + display: block; + position: relative; + margin: 5px; + margin-bottom: 2px; + cursor: pointer; +} + +.image-checkbox-ul label { + border: 1px solid #fff; +} + +.theme_dark .image-checkbox-ul label { + border: 1px solid #222; +} + +.image-checkbox-ul label:before { + background-color: white; + color: white; + content: " "; + display: block; + border-radius: 50%; + border: 1px solid grey; + position: absolute; + top: -5px; + left: -5px; + width: 25px; + height: 25px; + text-align: center; + line-height: 28px; + transition-duration: 0.4s; + transform: scale(0); +} + +.image-checkbox-ul label img { + height: 64px; + width: 64px; + transition-duration: 0.2s; + transform-origin: 50% 50%; +} + +.image-checkbox-ul :checked+label { + border-color: #ddd; +} + +.image-checkbox-ul :checked+label:before { + content: "✓"; + background-color: grey; + transform: scale(1); +} + +.image-checkbox-ul :checked+label img { + transform: scale(0.9); + /* box-shadow: 0 0 5px #333; */ + z-index: -1; +} \ No newline at end of file diff --git a/app/css/main.css b/app/css/main.css index 9bc37d7b..e3da3fc6 100644 --- a/app/css/main.css +++ b/app/css/main.css @@ -276,4 +276,8 @@ select { background: white; left: 20px; margin-top: 10px; +} + +.step-list>li::before { + color: #111 !important; } \ No newline at end of file diff --git a/app/img/toolhead/laser.png b/app/img/toolhead/laser.png new file mode 100644 index 00000000..0c301731 Binary files /dev/null and b/app/img/toolhead/laser.png differ diff --git a/app/img/toolhead/leadplasma.png b/app/img/toolhead/leadplasma.png new file mode 100644 index 00000000..852ae19d Binary files /dev/null and b/app/img/toolhead/leadplasma.png differ diff --git a/app/img/toolhead/plotter.png b/app/img/toolhead/plotter.png new file mode 100644 index 00000000..982ef120 Binary files /dev/null and b/app/img/toolhead/plotter.png differ diff --git a/app/img/toolhead/router11.png b/app/img/toolhead/router11.png new file mode 100644 index 00000000..c494e5b6 Binary files /dev/null and b/app/img/toolhead/router11.png differ diff --git a/app/img/toolhead/vfd.png b/app/img/toolhead/vfd.png new file mode 100644 index 00000000..ffaa2dd9 Binary files /dev/null and b/app/img/toolhead/vfd.png differ diff --git a/app/img/toolhead/xtensionslimit.png b/app/img/toolhead/xtensionslimit.png new file mode 100644 index 00000000..172222d8 Binary files /dev/null and b/app/img/toolhead/xtensionslimit.png differ diff --git a/app/index.html b/app/index.html index b788ebd8..2fb242ed 100644 --- a/app/index.html +++ b/app/index.html @@ -15,6 +15,7 @@ + @@ -46,7 +47,7 @@ Machine Control - Grbl Settings + Grbl Settings FluidNC Settings Troubleshooting diff --git a/app/js/grbl-settings-templates.js b/app/js/grbl-settings-templates.js index 45dfd994..afa054b2 100644 --- a/app/js/grbl-settings-templates.js +++ b/app/js/grbl-settings-templates.js @@ -256,7 +256,9 @@ var grblSettingsTemplate2 = { key: `$30`, title: `Maximum spindle speed, RPM`, description: `This sets the spindle speed for the maximum 5V PWM pin output. For example, if you want to set 10000rpm at 5V, program $30=10000. For 255rpm at 5V, program $30=255. If a program tries to set a higher spindle RPM greater than the $30 max spindle speed, Grbl will just output the max 5V, since it can't go any faster. By default, Grbl linearly relates the max-min RPMs to 5V-0.02V PWM pin output in 255 equally spaced increments. When the PWM pin reads 0V, this indicates spindle disabled. Note that there are additional configuration options are available in config.h to tweak how this operates.`, - template: ``, + template: ` + + `, utils: `` }, 31: { @@ -479,7 +481,8 @@ var grblSettingsTemplate2 = { key: `$33`, title: `Spindle PWM frequency`, description: ``, - template: ``, + template: ` + `, utils: `` }, 34: { diff --git a/app/js/grbl-settings.js b/app/js/grbl-settings.js index dc937411..001f20cf 100644 --- a/app/js/grbl-settings.js +++ b/app/js/grbl-settings.js @@ -83,6 +83,12 @@ function grblSettings(data) { // $('#grblFirmwareBtn').removeAttr('disabled'); $('#grblSettings').show() + if (laststatus.machine.firmware.platform == "grblHAL") { + $("#grbl-settings-tab-title").html('grblHAL'); + } else { + $("#grbl-settings-tab-title").html('Grbl'); + } + if (grblParams['$22'] > 0) { @@ -106,7 +112,6 @@ function grblSettings(data) { $('#enLaser').removeClass('success').addClass('alert').html('OFF') } - // grblHAL - enable Servo Buttons if Spindle PWM == 50hz if (grblParams['$33'] == 50) { $('#enServo').removeClass('alert').addClass('success').html('ON') @@ -134,120 +139,217 @@ function grblPopulate() { - 1. Load Machine Profile - Loads our standard Machine Profiles to your controller. If you have built a machine exactly to specification this is all your need. If you made modifications, or built a custom machine, you can customize the parameters in Section (2) below. Remember to click SAVE TO FIRMWARE to save the settings to your controller - - - - - - - Select your machine type from the list: - - CUSTOM Machine (Profile sets sane defaults) - - OpenBuilds ACRO - - OpenBuilds ACRO 55 - OpenBuilds ACRO 510 - OpenBuilds ACRO 1010 - OpenBuilds ACRO 1510 - OpenBuilds ACRO 1515 + + + Select your MachineTell us what machine you have? + Select + your machine type from the list: + + CUSTOM Machine (Profile + sets sane defaults) + + OpenBuilds ACRO + + OpenBuilds ACRO 55 + OpenBuilds ACRO + 510 + OpenBuilds ACRO + 1010 + OpenBuilds ACRO + 1510 + OpenBuilds ACRO + 1515 - OpenBuilds ACRO A1 - - - - OpenBuilds C-Beam Machine - - OpenBuilds C-Beam Machine - OpenBuilds C-Beam XL - - - - OpenBuilds LEAD Machine - - OpenBuilds LEAD 1010 - OpenBuilds LEAD 1010 with Laser Module - OpenBuilds LEAD 1010 Plasma Add-On - OpenBuilds LEAD 1515 - - - OpenBuilds MiniMill - - OpenBuilds Sphinx - - OpenBuilds Sphinx 55 - OpenBuilds Sphinx 1050 - - - - OpenBuilds WorkBee - - OpenBuilds WorkBee 1010 - OpenBuilds WorkBee 1050 - OpenBuilds WorkBee 1510 - - - - - - - - - - - - - - - - - - - 2. Customize Profile (Optional)Customise your Grbl settings below. For custom machines, modifications and also for fine tuning your machine profile. Remember to make a BACKUP so you don't lose your customized settings - - - - - - Key - Parameter - Value - Utility - - - ` + OpenBuilds ACRO A1 + + + + OpenBuilds C-Beam Machine + + OpenBuilds C-Beam + Machine + OpenBuilds C-Beam + XL + + + + OpenBuilds + LEAD Machine + + OpenBuilds + LEAD 1010 + OpenBuilds + LEAD 1010 with Laser Module + OpenBuilds + LEAD 1010 Plasma Add-On + OpenBuilds + LEAD 1515 + + + OpenBuilds MiniMill + + OpenBuilds Sphinx + + OpenBuilds Sphinx + 55 + OpenBuilds + Sphinx 1050 + + + + OpenBuilds WorkBee + + OpenBuilds + WorkBee 1010 + OpenBuilds + WorkBee 1050 + OpenBuilds + WorkBee 1510 + + + + + + Add-Ons InstalledTelling us what kind of attachments the + machine has, allows us to pre-configure your Grbl Settings to match + + + + + Xtension Limit Switches + + + + + + RoutER11 with IoT Relay + + + + + LEAD 1010 Plasma Add-On + + + + + Laser Diode Module + + + + + SCRIBEPen Lifter + + + + + Variable Speed Spindle + + + + + + + Advanced SettingsIf you have any custom requirements, + please customise the settings in the Advanced Settings section + + Show Advanced Settings + + + + + + + Key + Parameter + Value + Utility + + + ` for (key in grblParams) { var key2 = key.split('=')[0].substr(1); //console.log(key2) if (grblSettingsTemplate2[key2] !== undefined) { //template += grblSettingsTemplate2[key2].template; - template += ` - ` + grblSettingsTemplate2[key2].key + ` - ` + grblSettingsTemplate2[key2].title + ` - ` + grblSettingsTemplate2[key2].template + ` - ` + grblSettingsTemplate2[key2].utils + ` - ` + template += ` + ` + grblSettingsTemplate2[key2].key + ` + ` + grblSettingsTemplate2[key2].title + ` + ` + grblSettingsTemplate2[key2].template + ` + ` + grblSettingsTemplate2[key2].utils + ` + ` } else { template += ` - - ` + key + ` - ` + key + ` - - - - ` + + ` + key + ` + ` + key + ` + + + + ` } } template += ` - - - - - ` + + + + + + + + ` $('#grblconfig').append(template) $('#grblSettingsTable').on('keyup paste click change', 'input, select', function() { @@ -273,6 +375,12 @@ function grblPopulate() { $('#homeBtn').attr('disabled', true) } + if (grblParams['$33'] == 50 && grblParams['$34'] == 5 && grblParams['$35'] == 5 && grblParams['$36'] == 10) { + $('#scribeinstalled:checkbox').prop('checked', true); + } else { + $('#scribeinstalled:checkbox').prop('checked', false); + } + setTimeout(function() { setMachineButton(laststatus.machine.name) }, 500) @@ -602,6 +710,27 @@ function setup_settings_table() { enableLimits(); }); + // $('#scribeinstalled:checkbox').change(function() { + // enableScribe(); + // }); + + // Handle the change event for radio buttons + $('input[name="toolhead"]').on('change', function() { + console.log(`Selected toolhead: ${$(this).val()}`); + var selectedToolhead = $(this).val(); + if (selectedToolhead == 'router11') { + enableRouter(); + } else if (selectedToolhead == 'scribe') { + enableScribe(); + } else if (selectedToolhead == 'laser') { + enableLaser(); + } else if (selectedToolhead == 'plasma') { + enablePlasma(); + } else if (selectedToolhead == 'vfd_spindle') { + enableVFD(); + } + }); + $('#xdirinvert:checkbox').change(function() { changeDirInvert(); }); @@ -656,6 +785,144 @@ function enableLimits() { }, 500); checkifchanged(); var elm = document.getElementById("grblSettingsLimits"); - elm.scrollIntoView(true); + // elm.scrollIntoView(true); +} + +function enableScribe() { + var grblParams_scribe = { + $33: "50", //PWM Freq for RC Servo + $34: "5", //Spindle Off Value for RC Servo + $35: "5", //Spinde Min Value for RC Servo + $36: "10", //Spindle max Value for RC Servo + } + for (var key in grblParams_scribe) { + if (grblParams_scribe.hasOwnProperty(key)) { + var j = key.substring(1) + var newVal = $("#val-" + j + "-input").val(); + // console.log("$" + j + " = " + newVal) + $("#val-" + j + "-input").val(parseFloat(grblParams_scribe[key])) + } + } + allowGrblSettingsViewScroll = false; + setTimeout(function() { + allowGrblSettingsViewScroll = true; + }, 500); + checkifchanged(); + var elm = document.getElementById("grblSettingsPWM"); + // elm.scrollIntoView(true); +} + +function enableLaser() { + var grblParams_laser = { + $30: "1000", // S Max + $32: "1", // Laser Mode On + $33: "100", //PWM Freq + $34: "0", //Spindle Off Value + $35: "0", //Spinde Min Value + $36: "100", //Spindle max Value + } + for (var key in grblParams_laser) { + if (grblParams_laser.hasOwnProperty(key)) { + var j = key.substring(1) + var newVal = $("#val-" + j + "-input").val(); + // console.log("$" + j + " = " + newVal) + $("#val-" + j + "-input").val(parseFloat(grblParams_laser[key])) + } + } + allowGrblSettingsViewScroll = false; + setTimeout(function() { + allowGrblSettingsViewScroll = true; + }, 500); + checkifchanged(); + var elm = document.getElementById("grblSettingsPWM"); + // elm.scrollIntoView(true); +} + +function enableRouter() { + var grblParams_router = { + $30: "1000", // S Max + $32: "0", // Laser Mode On + $33: "5000", //PWM Freq + $34: "0", //Spindle Off Value + $35: "0", //Spinde Min Value + $36: "100", //Spindle max Value + } + for (var key in grblParams_router) { + if (grblParams_router.hasOwnProperty(key)) { + var j = key.substring(1) + var newVal = $("#val-" + j + "-input").val(); + // console.log("$" + j + " = " + newVal) + $("#val-" + j + "-input").val(parseFloat(grblParams_router[key])) + } + } + allowGrblSettingsViewScroll = false; + setTimeout(function() { + allowGrblSettingsViewScroll = true; + }, 500); + checkifchanged(); + var elm = document.getElementById("grblSettingsPWM"); + // elm.scrollIntoView(true); +} +function enablePlasma() { + var grblParams_router = { + $30: "1000", // S Max + $32: "0", // Laser Mode On + $33: "5000", //PWM Freq + $34: "0", //Spindle Off Value + $35: "0", //Spinde Min Value + $36: "100", //Spindle max Value + } + for (var key in grblParams_router) { + if (grblParams_router.hasOwnProperty(key)) { + var j = key.substring(1) + var newVal = $("#val-" + j + "-input").val(); + // console.log("$" + j + " = " + newVal) + $("#val-" + j + "-input").val(parseFloat(grblParams_router[key])) + } + } + allowGrblSettingsViewScroll = false; + setTimeout(function() { + allowGrblSettingsViewScroll = true; + }, 500); + checkifchanged(); + var elm = document.getElementById("grblSettingsPWM"); + // elm.scrollIntoView(true); +} + +function enableVFD() { + var grblParams_vfd = { + $30: "24000", // S Max + $32: "0", // Laser Mode On + $33: "1000", //PWM Freq + $34: "0", //Spindle Off Value + $35: "0", //Spinde Min Value + $36: "100", //Spindle max Value + } + for (var key in grblParams_vfd) { + if (grblParams_vfd.hasOwnProperty(key)) { + var j = key.substring(1) + var newVal = $("#val-" + j + "-input").val(); + // console.log("$" + j + " = " + newVal) + $("#val-" + j + "-input").val(parseFloat(grblParams_vfd[key])) + } + } + allowGrblSettingsViewScroll = false; + setTimeout(function() { + allowGrblSettingsViewScroll = true; + }, 500); + checkifchanged(); + var elm = document.getElementById("grblSettingsPWM"); + // elm.scrollIntoView(true); +} + + +// Function to programmatically set the selected radio +function setSelectedToolhead(value) { + const $radio = $(`input[name="toolhead"][value="${value}"]`); + if ($radio.length) { + $radio.prop('checked', true).trigger('change'); // Trigger the change event + } else { + console.error('Toolhead not found:', value); + } } \ No newline at end of file diff --git a/index.js b/index.js index df304246..f1986bf1 100644 --- a/index.js +++ b/index.js @@ -3167,7 +3167,9 @@ if (isElectron()) { jogWindow = new BrowserWindow({ // 1366 * 768 == minimum to cater for width: 1000, + minWidth: 1000, height: 850, + minHeight: 850, fullscreen: false, center: true, resizable: true,