Skip to content

Commit

Permalink
Version 2.1.7 provisional
Browse files Browse the repository at this point in the history
See WHATS_NEW
  • Loading branch information
chrishamm committed May 5, 2020
1 parent 26d4ad6 commit 5aa9795
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 9 deletions.
13 changes: 13 additions & 0 deletions WHATS_NEW.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
Summary of important changes in recent versions
===============================================

Version 2.1.7
==============
Compatible files:
- DuetSoftwareFramework 2.0.0 or newer
- RepRapFirmware 2 or newer (1.2x may work but untested)

Changed behaviour:
- Codes that only consist of comments no longer wait for a response

Bug fixes:
- Message box axis controls are shown again for unhomed axes
- HTTP code 503 was not properly handled

Version 2.1.6
==============
Compatible files:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "duetwebcontrol",
"version": "2.1.6",
"version": "2.1.7",
"repository": "github:chrishamm/DuetWebControl",
"homepage": "https://forum.duet3d.com/category/27/duet-web-control",
"license": "GPL-3.0",
Expand Down
2 changes: 1 addition & 1 deletion src/components/dialogs/MessageBoxDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export default {
...mapGetters('machine/settings', ['moveSteps', 'numMoveSteps']),
displayedAxes() {
const axisControls = this.messageBox ? this.messageBox.axisControls : 0;
return this.move.axes.filter((axis, index) => axis.visible && axis.homed && ((axisControls & (1 << index)) !== 0));
return this.move.axes.filter((axis, index) => axis.visible && ((axisControls & (1 << index)) !== 0));
}
},
data() {
Expand Down
44 changes: 37 additions & 7 deletions src/store/machine/connector/PollConnector.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,27 @@ export default class PollConnector extends BaseConnector {
.catch(error => reject(error));
} else if (xhr.status === 404) {
reject(new FileNotFoundError(filename));
} else if (xhr.status === 501) {
} else if (xhr.status === 503) {
if (retry < maxRetries) {
// RRF may have run out of output buffers, retry if possible
that.request(method, url, params, responseType, body, onProgress, timeout, cancellationToken, filename, retry + 1)
.then(result => resolve(result))
.catch(error => reject(error));
// RRF may have run out of output buffers. We usually get here when a code reply is blocking
if (retry === 0) {
that.lastSeq++;
that.getGCodeReply(that.lastSeq)
.then(function() {
// Retry the original request when the code reply has been received
that.request(method, url, params, responseType, body, onProgress, timeout, cancellationToken, filename, retry + 1)
.then(result => resolve(result))
.catch(error => reject(error));
})
.catch(error => reject(error));
} else {
// Retry the original request after a while
setTimeout(function() {
that.request(method, url, params, responseType, body, onProgress, timeout, cancellationToken, filename, retry + 1)
.then(result => resolve(result))
.catch(error => reject(error));
}, 2000);
}
} else {
reject(new OperationFailedError(xhr.responseText || xhr.statusText));
}
Expand Down Expand Up @@ -960,8 +975,23 @@ export default class PollConnector extends BaseConnector {
throw new CodeBufferError();
}

const pendingCodes = this.pendingCodes, seq = this.lastSeq;
return new Promise((resolve, reject) => pendingCodes.push({ seq, resolve, reject }));
let inBraces = false;
for (let i = 0; i < code.length; i++) {
if (inBraces) {
inBraces = (code[i] !== ')');
} else if (code[i] === '(') {
inBraces = true;
} else {
if (code[i] === ';') {
return '';
}

if (code[i] !== ' ' && code[i] !== '\t' && code[i] !== '\r' && code !== '\n') {
const pendingCodes = this.pendingCodes, seq = this.lastSeq;
return new Promise((resolve, reject) => pendingCodes.push({ seq, resolve, reject }));
}
}
}
}

async getGCodeReply(seq) {
Expand Down

0 comments on commit 5aa9795

Please sign in to comment.