예제 #1
0
파일: GRBL0.py 프로젝트: Nacturus/gabxer4
    def parseBracketAngle(self, line, cline):
        self.master.sio_status = False
        pat = STATUSPAT.match(line)
        if pat:
            if not self.master._alarm:
                CNC.vars["state"] = pat.group(1)
            CNC.vars["mx"] = float(pat.group(2))
            CNC.vars["my"] = float(pat.group(3))
            CNC.vars["mz"] = float(pat.group(4))
            CNC.vars["wx"] = float(pat.group(5))
            CNC.vars["wy"] = float(pat.group(6))
            CNC.vars["wz"] = float(pat.group(7))
            CNC.vars["wcox"] = CNC.vars["mx"] - CNC.vars["wx"]
            CNC.vars["wcoy"] = CNC.vars["my"] - CNC.vars["wy"]
            CNC.vars["wcoz"] = CNC.vars["mz"] - CNC.vars["wz"]
            self.master._posUpdate = True
            if pat.group(1)[:4] != "Hold" and self.master._msg:
                self.master._msg = None

            # Machine is Idle buffer is empty
            # stop waiting and go on
            #print "<<< WAIT=",wait,sline,pat.group(1),sum(cline)
            #print ">>>", line
            if self.master.sio_wait and not cline and pat.group(1) not in (
                    "Run", "Jog", "Hold"):
                #print ">>>",line
                self.master.sio_wait = False
                #print "<<< NO MORE WAIT"
                self.master._gcount += 1
            else:
                self.master.log.put((self.master.MSG_RECEIVE, line))
예제 #2
0
파일: GRBL0.py 프로젝트: vlachoudis/bCNC
	def parseBracketAngle(self, line, cline):
		self.master.sio_status = False
		pat = STATUSPAT.match(line)
		if pat:
			if not self.master._alarm:
				CNC.vars["state"] = pat.group(1)
			CNC.vars["mx"] = float(pat.group(2))
			CNC.vars["my"] = float(pat.group(3))
			CNC.vars["mz"] = float(pat.group(4))
			CNC.vars["wx"] = float(pat.group(5))
			CNC.vars["wy"] = float(pat.group(6))
			CNC.vars["wz"] = float(pat.group(7))
			CNC.vars["wcox"] = CNC.vars["mx"] - CNC.vars["wx"]
			CNC.vars["wcoy"] = CNC.vars["my"] - CNC.vars["wy"]
			CNC.vars["wcoz"] = CNC.vars["mz"] - CNC.vars["wz"]
			self.master._posUpdate = True
			if pat.group(1)[:4] != "Hold" and self.master._msg:
				self.master._msg = None

			# Machine is Idle buffer is empty
			# stop waiting and go on
			#print "<<< WAIT=",wait,sline,pat.group(1),sum(cline)
			#print ">>>", line
			if self.master.sio_wait and not cline and pat.group(1) not in ("Run", "Jog", "Hold"):
				#print ">>>",line
				self.master.sio_wait = False
				#print "<<< NO MORE WAIT"
				self.master._gcount += 1
			else:
				self.master.log.put((self.master.MSG_RECEIVE, line))