From eef270aea402e0eb2401a7a42c9795cce5215acb Mon Sep 17 00:00:00 2001 From: Sophia Beluli Date: Tue, 27 Feb 2024 16:31:00 -0500 Subject: [PATCH 1/2] [MI-1339] only remove line length from buffer if ok was sent; code cleanup --- .../Preferences/About/releases.json | 2 +- .../controllers/Grblhal/GrblHalController.js | 19 +++++-------------- src/server/lib/Sender.js | 12 ++++++------ 3 files changed, 12 insertions(+), 21 deletions(-) diff --git a/src/app/containers/Preferences/About/releases.json b/src/app/containers/Preferences/About/releases.json index df1f8c90d..75a0af3d4 100644 --- a/src/app/containers/Preferences/About/releases.json +++ b/src/app/containers/Preferences/About/releases.json @@ -1 +1 @@ -["### 1.4.2 (February 16, 2024)","- Added ability to assign macros to gamepad buttons","- Controller type is now annotated in the Errors and Alarms report and diagnostic file","- Go To function on UI now accounts for preferred units","- Added spindle selector to Laser/Spindle tab when using grblHAL firmware","- Unlock button now only shows 100% of the time when using grblHAL controller","- Fixed machine profiles missing in some situations","- Remote mode UI jog controls are once again properly contained within their widget container","- Fix for remote mode settings crashing on Firefox","- Fixed toggling laser offsets with inches enabled","- Various improvements to time estimation","- \"Use Last Port\" button in firmware tool should now properly connect when the last connection was over Ethernet","- Alterations to outline behaviour - should move in a consistent direction and more accurately outline the toolpath","- Fixed tool change offsets being concatenated as strings instead of added","- Surfacing tool better handles extreme values by warning the user instead of exceeding the call stack","- Various rotary fixes","- Fix for pass-through toolchanging in macros","- Fix for spindle delay being added when the line already had a delay from the post-processor","- Start-From-Line should now better handle starting G2/G3 commands and clear errors on grblHAL controller","- Fix for toolchange wizard not resuming correctly on grblHAL controller","- Verify job should behave more consistently like grbl controller on grblHAL firmware","### 1.4.1 (January 26, 2024)","- Fix for black screen on application startup in some situations","- Fix for jog buttons on UI not registering click events correctly on some operating systems","- Strip comments sent to controller to prevent buffer overflow and better support Shapeoko","- Fix issue with firmware tool not updating values correctly if settings limited by search bar","- Handle missing file name in recent files","- Updated EEPROM values for travel on multiple Sienci profiles","- Fixed issue with surfacing tool crashing in some situations","- Fixed several bugs with gamepad support","### 1.4.0 (January 23, 2024)","- Added Rotary Mode","- gSender is now able to run 2+1 axis files on grbl and 4 axis files on grblHAL","- Visualizer updated to support 4 axis rotations","- A-axis DRO and jogging","- Rotary probing","- Added grblHAL controller support","- Connect to and run jobs as normal on any grblHAL device","- Connect over ethernet where hardware is supported","- New grblHAL specific firmware tool that is dynamically generated based on reported settings","- New UI elements where appropriate to support new functionality such as single axis homing","- Gamepad improvements","- Restructured logic and mapping of buttons to actions","- Add secondary functionality to buttons","- Added joystick MPG mode","- Added lockout button to deactivate gamepad when needed","- Improved job time estimation","- Significantly improved initial time estimation algorithm based on machine acceleration and max speeds","- Mid-job estimation uses initial estimate per line for more accurate remaining duration","- Multi-corner probing - touch off any corner using both standard and auto-zero touchplates","- Added Go To UI button to quickly go to an absolute or relative workspace coordinate","- Clearer distinction on planned lines vs cut lines - planned lines show up as a (customizable) yellow instead of the default cut gray","- Remote mode improvements","- Added QR code for easier navigation to remote address on phone","- Added workflow controls and unit selection to remote mode UI","- Added preference to prompt on Zero to prevent accidentally resetting zero on any axis","- Code block toolchange again supported","- Firmware active modals now displayed in diagnostic tab","- PRB values available to use in macros","- Files are now parsed once per run time","- Fix for DRO precision in some situations","- Improved job stats area - now tracks jobs per com port, more information about each job run and the number of problems encountered","- Maintenance reminders - set up and customize maintenance reminders to prompt tasks after specific run time totals have occured","- Improved alarm and error recording"] \ No newline at end of file +["### 1.4.3 (February 22, 2024)","- Fix for probe migration values not running","- Fix for jog value migration not running","- Spindles on HAL no longer duplicate when running the spindle command multiple times","- Connection widget should no longer zero out selected controller in some situations","- Toolchanger should no longer error out in situations when the user has connected then disconnected","### 1.4.2 (February 16, 2024)","- Added ability to assign macros to gamepad buttons","- Controller type is now annotated in the Errors and Alarms report and diagnostic file","- Go To function on UI now accounts for preferred units","- Added spindle selector to Laser/Spindle tab when using grblHAL firmware","- Unlock button now only shows 100% of the time when using grblHAL controller","- Fixed machine profiles missing in some situations","- Remote mode UI jog controls are once again properly contained within their widget container","- Fix for remote mode settings crashing on Firefox","- Fixed toggling laser offsets with inches enabled","- Various improvements to time estimation","- \"Use Last Port\" button in firmware tool should now properly connect when the last connection was over Ethernet","- Alterations to outline behaviour - should move in a consistent direction and more accurately outline the toolpath","- Fixed tool change offsets being concatenated as strings instead of added","- Surfacing tool better handles extreme values by warning the user instead of exceeding the call stack","- Various rotary fixes","- Fix for pass-through toolchanging in macros","- Fix for spindle delay being added when the line already had a delay from the post-processor","- Start-From-Line should now better handle starting G2/G3 commands and clear errors on grblHAL controller","- Fix for toolchange wizard not resuming correctly on grblHAL controller","- Verify job should behave more consistently like grbl controller on grblHAL firmware","### 1.4.1 (January 26, 2024)","- Fix for black screen on application startup in some situations","- Fix for jog buttons on UI not registering click events correctly on some operating systems","- Strip comments sent to controller to prevent buffer overflow and better support Shapeoko","- Fix issue with firmware tool not updating values correctly if settings limited by search bar","- Handle missing file name in recent files","- Updated EEPROM values for travel on multiple Sienci profiles","- Fixed issue with surfacing tool crashing in some situations","- Fixed several bugs with gamepad support"] \ No newline at end of file diff --git a/src/server/controllers/Grblhal/GrblHalController.js b/src/server/controllers/Grblhal/GrblHalController.js index 76f5bab71..1869b5f04 100644 --- a/src/server/controllers/Grblhal/GrblHalController.js +++ b/src/server/controllers/Grblhal/GrblHalController.js @@ -679,7 +679,7 @@ class GrblHalController { this.sender.unhold(); } this.sender.ack(); - this.sender.next(); + this.sender.next({ isOk: true }); return; } @@ -692,7 +692,7 @@ class GrblHalController { log.debug(`Stop sending G-code: hold=${hold}, sent=${sent}, received=${received + 1}`); } this.sender.ack(); - this.sender.next(); + this.sender.next({ isOk: true }); return; } @@ -1633,7 +1633,7 @@ class GrblHalController { } else { this.workflow.pause(); await delay(100); - this.write('!'); + this.write(GRBLHAL_REALTIME_COMMANDS.FEED_HOLD); } }, 'resume': () => { @@ -1642,24 +1642,15 @@ class GrblHalController { }, 'gcode:resume': async () => { log.debug('gcode:resume called - program to continue sending'); - const [type] = args; if (this.event.hasEnabledEvent(PROGRAM_RESUME)) { this.feederCB = () => { - if (type === GRBLHAL) { - this.write(GRBLHAL_REALTIME_COMMANDS.CYCLE_START); - } else { - this.write('~'); - } + this.write(GRBLHAL_REALTIME_COMMANDS.CYCLE_START); this.workflow.resume(); this.feederCB = null; }; this.event.trigger(PROGRAM_RESUME); } else { - if (type === GRBLHAL) { - this.write(GRBLHAL_REALTIME_COMMANDS.CYCLE_START); - } else { - this.write('~'); - } + this.write(GRBLHAL_REALTIME_COMMANDS.CYCLE_START); await delay(1000); this.workflow.resume(); } diff --git a/src/server/lib/Sender.js b/src/server/lib/Sender.js index 994d3b76a..21bbdeadd 100644 --- a/src/server/lib/Sender.js +++ b/src/server/lib/Sender.js @@ -85,8 +85,8 @@ class SPCharCounting { } } - process() { - this.callback && this.callback(this); + process(isOk) { + this.callback && this.callback(this, isOk); } reset() { @@ -195,8 +195,8 @@ class Sender extends events.EventEmitter { // character-counting if (type === SP_TYPE_CHAR_COUNTING) { - this.sp = new SPCharCounting(options, (sp) => { - if (sp.queue.length > 0) { + this.sp = new SPCharCounting(options, (sp, isOk) => { + if (sp.queue.length > 0 && isOk) { // only remove line length from buffer if ok was sent const lineLength = sp.queue.shift(); sp.dataLength -= lineLength; } @@ -410,7 +410,7 @@ class Sender extends events.EventEmitter { // Tells the sender to send more data. // @return {boolean} Returns true on success, false otherwise. next(options = {}) { - const { startFromLine, timePaused, forceEnd } = options; + const { startFromLine, timePaused, forceEnd, isOk } = options; if (!this.state.gcode) { return false; @@ -451,7 +451,7 @@ class Sender extends events.EventEmitter { } if (this.sp) { - this.sp.process(); + this.sp.process(isOk); } // Elapsed Time From 15d9934c7e7725623a65144aede24dc9035d34eb Mon Sep 17 00:00:00 2001 From: Sophia Beluli Date: Wed, 28 Feb 2024 10:23:38 -0500 Subject: [PATCH 2/2] [MI-1374] add null check in firmware selector --- src/app/widgets/NavbarConnection/FirmwareSelector.jsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/app/widgets/NavbarConnection/FirmwareSelector.jsx b/src/app/widgets/NavbarConnection/FirmwareSelector.jsx index 4a42c03bb..b3b70e61d 100644 --- a/src/app/widgets/NavbarConnection/FirmwareSelector.jsx +++ b/src/app/widgets/NavbarConnection/FirmwareSelector.jsx @@ -24,9 +24,11 @@ import React from 'react'; import cx from 'classnames'; import { uniqueId } from 'lodash'; +import { GRBL } from 'app/constants'; import styles from './Index.styl'; const FirmwareSelector = ({ options = [], selectedFirmware, handleSelect }) => { + selectedFirmware = selectedFirmware || GRBL; // null check return (