コード例 #1
0
ファイル: stdglue.py プロジェクト: litti/myfenjalinuxcnc
def prepare_epilog(self, **words):
    try:
        if not self.value_returned:
            r = self.blocks[self.remap_level].executing_remap
            self.set_errormsg(
                "the %s remap procedure %s did not return a value" %
                (r.name, r.remap_ngc if r.remap_ngc else r.remap_py))
            return INTERP_ERROR
        if self.blocks[self.remap_level].builtin_used:
            #print "---------- T builtin recursion, nothing to do"
            return INTERP_OK
        else:
            if self.return_value > 0:
                self.selected_tool = int(self.params["tool"])
                self.selected_pocket = int(self.params["pocket"])
                emccanon.SELECT_POCKET(self.selected_pocket,
                                       self.selected_tool)
                return INTERP_OK
            else:
                self.set_errormsg(
                    "T%d: aborted (return code %.1f)" %
                    (int(self.params["tool"]), self.return_value))
                return INTERP_ERROR
    except Exception, e:
        self.set_errormsg("T%d/prepare_epilog: %s" % (tool, e))
        return INTERP_ERROR
コード例 #2
0
ファイル: remap.py プロジェクト: pmcstone-packages/machinekit
def prepare_epilog(self, userdata, **words):
	#print "prepare_epilog cl=",self.call_level, self._pocket
	retval = self.return_value
	if retval >= 0:
		self.selected_pocket = self._pocket
		self.selected_index = self._index
		self.selected_tool = self._tool
		emccanon.SELECT_POCKET( self._index, self._tool)
		return INTERP_OK
	else:
		self.set_errormsg("T%d: aborted (return code %.4f)" % (self._tool,retval))
		return INTERP_ERROR