Skip to content

Commit

Permalink
Better display of GRBL Alarm states vlachoudis#1428
Browse files Browse the repository at this point in the history
  • Loading branch information
Harvie committed Dec 28, 2020
1 parent b8c2c54 commit 2b7ba2a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
3 changes: 2 additions & 1 deletion bCNC/controllers/GRBL1.py
Expand Up @@ -103,7 +103,8 @@ def parseBracketAngle(self, line, cline):
if CNC.vars["state"] != fields[0] or self.master.runningPrev != self.master.running:
self.master.controllerStateChange(fields[0])
self.master.runningPrev = self.master.running
CNC.vars["state"] = fields[0]

self.displayState(fields[0])

for field in fields[1:]:
word = SPLITPAT.split(field)
Expand Down
17 changes: 16 additions & 1 deletion bCNC/controllers/_GenericController.py
Expand Up @@ -185,6 +185,21 @@ def purgeController(self):
self.viewState()


#----------------------------------------------------------------------
def displayState(self, state):
state = state.strip()

#Do not show g-code errors, when machine is already in alarm state
if (CNC.vars["state"].startswith("ALARM:") and state.startswith("error:")):
return

# Do not show alarm without number when we already display alarm with number
if (state == "Alarm" and CNC.vars["state"].startswith("ALARM:")):
return

CNC.vars["state"] = state


#----------------------------------------------------------------------
def parseLine(self, line, cline, sline):
if not line:
Expand All @@ -208,7 +223,7 @@ def parseLine(self, line, cline, sline):
if sline: CNC.vars["errline"] = sline.pop(0)
if not self.master._alarm: self.master._posUpdate = True
self.master._alarm = True
CNC.vars["state"] = line
self.displayState(line)
if self.master.running:
self.master._stop = True

Expand Down

0 comments on commit 2b7ba2a

Please sign in to comment.