From a21ccc9c21c71af5746c7f09799cc53fe33b89c2 Mon Sep 17 00:00:00 2001 From: Strelok Date: Sat, 22 Feb 2020 19:09:55 +0300 Subject: [PATCH] Add DWEL pause support for marlin firmware --- src/components/settings.js | 11 ++++++----- src/lib/action2gcode/generators/default-generator.js | 2 ++ src/lib/action2gcode/generators/marlin-generator.js | 2 ++ src/lib/cam-gcode-laser-cut.js | 5 +++-- src/lib/cam-gcode-raster.js | 1 + src/reducers/settings.js | 7 ++++--- 6 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/components/settings.js b/src/components/settings.js index a589fb86..5565ca6b 100644 --- a/src/components/settings.js +++ b/src/components/settings.js @@ -270,6 +270,7 @@ class Settings extends React.Component { + @@ -283,7 +284,7 @@ class Settings extends React.Component { Enter from 0.1 (Ultra High Precision - Slow) to 2.0 (Low Precision - Fast) to achieve different levels of curve to gcode performance

,"Gcode Linearization Factor")} } /> - +
Grid
@@ -294,17 +295,17 @@ class Settings extends React.Component {
-
+
X
Y
Z
A

,"Jog using Numpad")}} /> - + Gamepad for jogging. Use analog left stick (XY) or right stick (Z) to move on Jog tab.

) }} /> - +

Enable Display cache. Disable animations.

@@ -335,7 +336,7 @@ class Settings extends React.Component { - + diff --git a/src/lib/action2gcode/generators/default-generator.js b/src/lib/action2gcode/generators/default-generator.js index fd76e584..91d78897 100644 --- a/src/lib/action2gcode/generators/default-generator.js +++ b/src/lib/action2gcode/generators/default-generator.js @@ -34,6 +34,8 @@ class DefaultGenerator extends AbstractGenerator{ if(params.hasOwnProperty("i")) gcode = gcode.split("$INTENSITY").join(params.i); + if(this.settings.gcodeToolPause) + gcode += `${this.settings.gcodeToolPause}\r\n`; return gcode; } diff --git a/src/lib/action2gcode/generators/marlin-generator.js b/src/lib/action2gcode/generators/marlin-generator.js index 65871be6..7395df3f 100644 --- a/src/lib/action2gcode/generators/marlin-generator.js +++ b/src/lib/action2gcode/generators/marlin-generator.js @@ -58,6 +58,8 @@ class MarlinGenerator extends AbstractGenerator{ gcode += `${this.settings.gcodeToolOn} ${params.i}\r\n`; } } + if(this.settings.gcodeToolPause && this.settings.gcodeToolPause.length > 0 && (params.hasOwnProperty("i") || params.hasOwnProperty("s"))) + gcode += `${this.settings.gcodeToolPause}\r\n`; gcode += prefix; diff --git a/src/lib/cam-gcode-laser-cut.js b/src/lib/cam-gcode-laser-cut.js index a0526b24..4aac58c2 100644 --- a/src/lib/cam-gcode-laser-cut.js +++ b/src/lib/cam-gcode-laser-cut.js @@ -4,12 +4,12 @@ // it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. -// +// // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . @@ -266,6 +266,7 @@ export function getLaserCutGcodeFromOp(settings, opIndex, op, geometry, openGeom aAxisDiameter: op.aAxisDiameter, tabGeometry: tabGeometry, gcodeToolOn: settings.gcodeToolOn, + gcodeToolPause: settings.gcodeToolPause, gcodeToolOff: settings.gcodeToolOff, gcodeLaserIntensity: settings.gcodeLaserIntensity, gcodeLaserIntensitySeparateLine: settings.gcodeLaserIntensitySeparateLine, diff --git a/src/lib/cam-gcode-raster.js b/src/lib/cam-gcode-raster.js index 8746dc57..2ed942ab 100644 --- a/src/lib/cam-gcode-raster.js +++ b/src/lib/cam-gcode-raster.js @@ -206,6 +206,7 @@ export function getLaserRasterGcodeFromOp(settings, opIndex, op, docsWithImages, overscan: op.overScan, gcodeGenerator : settings.gcodeGenerator, gcodeToolOn : settings.gcodeToolOn, + gcodeToolPause: settings.gcodeToolPause, gcodeToolOff : settings.gcodeToolOff, gcodeLaserIntensity: settings.gcodeLaserIntensity, nonBlocking: false, diff --git a/src/reducers/settings.js b/src/reducers/settings.js index 77171c19..6081b2ca 100644 --- a/src/reducers/settings.js +++ b/src/reducers/settings.js @@ -70,7 +70,7 @@ export const SETTINGS_INITIALSTATE = { A: {min: 1, max:50000}, S: {min: 0, max:30000}, }, - + machineXYProbeOffset: 0, machineZEnabled: false, @@ -88,7 +88,7 @@ export const SETTINGS_INITIALSTATE = { pxPerInch: 96, forcePxPerInch: false, dpiBitmap: 300, - + toolGridWidth: 500, toolGridHeight: 500, @@ -107,7 +107,7 @@ export const SETTINGS_INITIALSTATE = { toolVideoLens: { a: 1, b: 1, F: 1, scale: 1 }, toolVideoFov: { x: 1, y: 1 }, toolVideoResolution: "720p(HD)", - + toolVideoOMR: false, toolVideoOMROffsetX: 0, toolVideoOMROffsetY: 0, @@ -123,6 +123,7 @@ export const SETTINGS_INITIALSTATE = { gcodeHoming: "", gcodeGenerator: "default", gcodeToolOn: "", + gcodeToolPause: "", gcodeToolOff: "", gcodeLaserIntensity: 'S', gcodeLaserIntensitySeparateLine: false,