Skip to content

Commit

Permalink
Add a "received" counter that can be used to report the exact line th…
Browse files Browse the repository at this point in the history
…at caused an error while streaming a G-code program
  • Loading branch information
cheton committed Dec 7, 2016
1 parent 2a2ed0b commit 3f42993
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/web/widgets/GCode/GCode.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ class GCode extends Component {
}
render() {
const { state } = this.props;
const { lines, sent } = state;
const { lines, received } = state;

return (
<div>
<GCodeStats {...this.props} />
{_.size(lines) > 0 &&
<GCodeTable rows={lines} scrollToRow={sent} />
<GCodeTable rows={lines} scrollToRow={received} />
}
</div>
);
Expand Down
8 changes: 5 additions & 3 deletions src/web/widgets/GCode/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ class GCodeWidget extends Component {
};
controllerEvents = {
'sender:status': (data) => {
const { remain, sent, total, createdTime, startedTime, finishedTime } = data;
const { remain, sent, received, total, createdTime, startedTime, finishedTime } = data;

let lines = this.state.lines;
if (this.state.lines.length > 0) {
const from = this.state.sent;
const to = sent;
const from = this.state.received;
const to = received;
let list = {};

// Reset obsolete queue items
Expand Down Expand Up @@ -84,6 +84,7 @@ class GCodeWidget extends Component {
lines,
remain,
sent,
received,
total,
createdTime,
startedTime,
Expand Down Expand Up @@ -154,6 +155,7 @@ class GCodeWidget extends Component {
// G-code Status (from server)
remain: 0,
sent: 0,
received: 0,
total: 0,
createdTime: 0,
startedTime: 0,
Expand Down

0 comments on commit 3f42993

Please sign in to comment.