Skip to content

Commit

Permalink
Preselect tools based on machine type
Browse files Browse the repository at this point in the history
  • Loading branch information
petervanderwalt committed Dec 5, 2024
1 parent e03c201 commit bca135b
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 11 deletions.
4 changes: 2 additions & 2 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1815,11 +1815,11 @@
<!-- end job completion confirmation -->

<!-- Saving Grbl Parameters Progress -->
<div class="dialog dark" data-role="dialog" id="savingGrblSettingsProgress" data-role="dialog" data-overlay-click-close="false" data-close-button="false">
<div class="dialog dark" data-role="dialog" id="savingGrblSettingsProgress" data-role="dialog" data-overlay-click-close="false" data-close-button="false" data-width="600">
<div class="dialog-title"><i class="fas fa-microchip"></i> Saving Grbl Settings</div>
<div class="dialog-content">

Writing changed parameters to controller:<p>
Writing changed parameters to controller's onboard memory:<p>

<table class="table striped compact">
<thead>
Expand Down
28 changes: 20 additions & 8 deletions app/js/grbl-settings-defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ function selectMachine(type) {
$131: "325.000", //"Y-axis maximum travel, millimeters"
$132: "85.000", //"Z-axis maximum travel, millimeters"
}
setSelectedToolhead('router11');
} else if (type == "sphinx1050") {
// Sphinx 1050
var customFirmware = false;
Expand Down Expand Up @@ -120,6 +121,7 @@ function selectMachine(type) {
$131: "325", //"Y-axis maximum travel, millimeters"
$132: "85", //"Z-axis maximum travel, millimeters"
}
setSelectedToolhead('router11');
} else if (type == "workbee1050") {
//Workbee 1050 COMPLETE with homing switches
var customFirmware = false;
Expand Down Expand Up @@ -159,6 +161,7 @@ function selectMachine(type) {
$131: "762.000", //"Y-axis maximum travel, millimeters"
$132: "122.000", //"Z-axis maximum travel, millimeters"
}
setSelectedToolhead('router11');
} else if (type == "workbee1010") {
// Workbee 1010
var customFirmware = false;
Expand Down Expand Up @@ -198,6 +201,7 @@ function selectMachine(type) {
$131: "780.000", //"Y-axis maximum travel, millimeters"
$132: "122.000", //"Z-axis maximum travel, millimeters"
}
setSelectedToolhead('router11');
} else if (type == "workbee1510") {
// Workbee1510
var customFirmware = false;
Expand Down Expand Up @@ -237,6 +241,7 @@ function selectMachine(type) {
$131: "1280.000", //"Y-axis maximum travel, millimeters"
$132: "122.000", //"Z-axis maximum travel, millimeters"
}
setSelectedToolhead('router11');
} else if (type == "acro55") {
// Acro 55
var customFirmware = 'acro';
Expand Down Expand Up @@ -276,6 +281,7 @@ function selectMachine(type) {
$131: "300.000", //Y-axis maximum travel, millimeters
$132: "70.000", //Z-axis maximum travel, millimeters
}
setSelectedToolhead('laser');
} else if (type == "acro510") {
// Acro 510
var customFirmware = 'acro';
Expand Down Expand Up @@ -315,6 +321,7 @@ function selectMachine(type) {
$131: "300.000", //Y-axis maximum travel, millimeters
$132: "70.000", //Z-axis maximum travel, millimeters
}
setSelectedToolhead('laser');
} else if (type == "acro1010") {
// Acro 1010
var customFirmware = 'acro';
Expand Down Expand Up @@ -354,6 +361,7 @@ function selectMachine(type) {
$131: "800.000", //Y-axis maximum travel, millimeters
$132: "70.000", //Z-axis maximum travel, millimeters
}
setSelectedToolhead('laser');
} else if (type == "acro1510") {
// Acro 1510
var customFirmware = 'acro';
Expand Down Expand Up @@ -393,6 +401,7 @@ function selectMachine(type) {
$131: "1300.000", //Y-axis maximum travel, millimeters
$132: "70.000", //Z-axis maximum travel, millimeters
}
setSelectedToolhead('laser');
} else if (type == "acro1515") {
// Acro 1515
var customFirmware = 'acro';
Expand Down Expand Up @@ -432,6 +441,7 @@ function selectMachine(type) {
$131: "1300.000", //Y-axis maximum travel, millimeters
$132: "70.000", //Z-axis maximum travel, millimeters
}
setSelectedToolhead('laser');
} else if (type == "acroa1") {
// Acro 1010
var customFirmware = false;
Expand Down Expand Up @@ -479,14 +489,7 @@ function selectMachine(type) {
$131: "609.000", //Y-axis maximum travel, millimeters
$132: "50.000", //Z-axis maximum travel, millimeters
}
// Set Default Pen Up/Down values
penupval = 250
pendownval = 0
servo = {
up: penupval,
down: pendownval
}
localStorage.setItem("servo-calibration", JSON.stringify(servo));
setSelectedToolhead('scribe')
// End default pen up/down
} else if (type == "minimill") {
// minimill
Expand Down Expand Up @@ -527,6 +530,7 @@ function selectMachine(type) {
$131: "120.000", //"Y-axis maximum travel, millimeters"
$132: "60.000", //"Z-axis maximum travel, millimeters"
}
setSelectedToolhead('router11');
} else if (type == "cbeam") {
// C-Beam Machine
var customFirmware = false;
Expand Down Expand Up @@ -566,6 +570,7 @@ function selectMachine(type) {
$131: "270.000", //"Y-axis maximum travel, millimeters"
$132: "80.000", //"Z-axis maximum travel, millimeters"
}
setSelectedToolhead('router11');
} else if (type == "cbeamxl") {
// C-Beam XL:
var customFirmware = false;
Expand Down Expand Up @@ -605,6 +610,7 @@ function selectMachine(type) {
$131: "200.000", //"Y-axis maximum travel, millimeters"
$132: "200.000", //"Z-axis maximum travel, millimeters"
}
setSelectedToolhead('router11');
} else if (type == "leadmachine1010") {
// Leadmachine 1010
var customFirmware = false;
Expand Down Expand Up @@ -644,6 +650,7 @@ function selectMachine(type) {
$131: "730", //"Y-axis maximum travel, millimeters"
$132: "90", //"Z-axis maximum travel, millimeters"
}
setSelectedToolhead('router11');
} else if (type == "leadmachine1010plasma") {
// Leadmachine 1010
var customFirmware = false;
Expand Down Expand Up @@ -683,6 +690,7 @@ function selectMachine(type) {
$131: "830", //"Y-axis maximum travel, millimeters"
$132: "80", //"Z-axis maximum travel, millimeters"
}
setSelectedToolhead('plasma')
} else if (type == "leadmachine1515") {
// Leadmachine 1010
var customFirmware = false;
Expand Down Expand Up @@ -722,6 +730,7 @@ function selectMachine(type) {
$131: "1270", //"Y-axis maximum travel, millimeters"
$132: "90", //"Z-axis maximum travel, millimeters"
}
setSelectedToolhead('router11');
} else if (type == "leadmachine1010laser") {
// Leadmachine 55
var customFirmware = false;
Expand Down Expand Up @@ -761,6 +770,7 @@ function selectMachine(type) {
$131: "730", //"Y-axis maximum travel, millimeters"
$132: "90", //"Z-axis maximum travel, millimeters"
}
setSelectedToolhead('laser');
} else if (type == "custom") {
// Leadmachine 55
var customFirmware = false;
Expand Down Expand Up @@ -800,7 +810,9 @@ function selectMachine(type) {
$131: "1000", //"Y-axis maximum travel, millimeters"
$132: "100", //"Z-axis maximum travel, millimeters"
}
setSelectedToolhead('router11')
}

for (var key in grblParams_def) {
if (grblParams_def.hasOwnProperty(key)) {
var j = key.substring(1)
Expand Down
13 changes: 12 additions & 1 deletion app/js/grbl-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ function grblSaveSettings() {
toSaveCommands = [];
askToResetOnGrblSettingsChange();
}
}, 400); // send another command every 200ms
}, 400); // send another command every 400ms
}

}
Expand Down Expand Up @@ -1027,4 +1027,15 @@ function setSelectedToolhead(value) {
} else {
console.error('Toolhead not found:', value);
}

if (value == "scribe") {
// Set Default Pen Up/Down values
penupval = 250
pendownval = 0
servo = {
up: penupval,
down: pendownval
}
localStorage.setItem("servo-calibration", JSON.stringify(servo));
}
}

0 comments on commit bca135b

Please sign in to comment.