Skip to content

Commit ce40680

Browse files
committed
Error checking for #22
1 parent b70e563 commit ce40680

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/views/providers/gcodeRuntimeParser.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,9 @@ export class GCodeRuntimeParser {
106106

107107
// Feed Rate
108108
if (letter === 'E' || letter === 'F') {
109-
state.feedrate = +argument;
109+
if (!isNaN(+argument)) {
110+
state.feedrate = +argument;
111+
}
110112
}
111113

112114
// Coords
@@ -187,7 +189,7 @@ export class GCodeRuntimeParser {
187189
// New Point -> Old Point
188190
Object.assign(oldpt, newpt);
189191

190-
if (!state.rapid) {
192+
if (!state.rapid && !isNaN(state.distance)) {
191193
// Calculate Time :: t = d / v :: Convert Feedrate from IPM to Per Second
192194
state.rt += state.distance / (state.feedrate / 60);
193195
}

0 commit comments

Comments
 (0)