本文整理汇总了Python中PathUtils.findParentJob方法的典型用法代码示例。如果您正苦于以下问题:Python PathUtils.findParentJob方法的具体用法?Python PathUtils.findParentJob怎么用?Python PathUtils.findParentJob使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PathUtils
的用法示例。
在下文中一共展示了PathUtils.findParentJob方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: onChanged
# 需要导入模块: import PathUtils [as 别名]
# 或者: from PathUtils import findParentJob [as 别名]
def onChanged(self, obj, prop):
if prop == "ToolNumber" and not 'Restore' in obj.State:
job = PathUtils.findParentJob(obj)
if job is not None:
for g in job.Group:
if not(isinstance(g.Proxy, PathScripts.PathLoadTool.LoadTool)):
g.touch()
示例2: onChanged
# 需要导入模块: import PathUtils [as 别名]
# 或者: from PathUtils import findParentJob [as 别名]
def onChanged(self, obj, prop):
mode = 2
obj.setEditorMode('Placement', mode)
# if prop == "ToolNumber":
job = PathUtils.findParentJob(obj)
if job is not None:
for g in job.Group:
if not(isinstance(g.Proxy, PathScripts.PathLoadTool.LoadTool)):
g.touch()
示例3: changeTool
# 需要导入模块: import PathUtils [as 别名]
# 或者: from PathUtils import findParentJob [as 别名]
def changeTool(self):
myJob = PathUtils.findParentJob(self.obj)
newtool = self.form.cboToolSelect.currentText()
tooltable = myJob.Tooltable
for number, tool in tooltable.Tools.iteritems():
if tool.Name == newtool:
self.obj.ToolNumber = number
self.setFields()
示例4: onChanged
# 需要导入模块: import PathUtils [as 别名]
# 或者: from PathUtils import findParentJob [as 别名]
def onChanged(self, obj, prop):
PathLog.track('prop: {} state: {}'.format(prop, obj.State))
if 'Restore' not in obj.State:
if prop == "ToolNumber":
toolitem = obj.Tooltable.Tools.popitem()
oldtoolnum = toolitem[0]
tool = toolitem[1]
obj.Tooltable.deleteTool(oldtoolnum)
obj.Tooltable.setTool(obj.ToolNumber, tool)
else:
job = PathUtils.findParentJob(obj)
if job is not None:
for g in job.Group:
if not(isinstance(g.Proxy, PathScripts.PathLoadTool.LoadTool)):
g.touch()
示例5: setFields
# 需要导入模块: import PathUtils [as 别名]
# 或者: from PathUtils import findParentJob [as 别名]
def setFields(self):
self.form.cboToolSelect.blockSignals(True)
self.form.vertFeed.setText(str(self.obj.VertFeed.Value))
self.form.horizFeed.setText(str(self.obj.HorizFeed.Value))
self.form.vertRapid.setText(str(self.obj.VertRapid.Value))
self.form.horizRapid.setText(str(self.obj.HorizRapid.Value))
self.form.spindleSpeed.setValue(self.obj.SpindleSpeed)
self.form.tcoName.setText(str(self.obj.Label))
index = self.form.cboSpindleDirection.findText(self.obj.SpindleDir, QtCore.Qt.MatchFixedString)
if index >= 0:
self.form.cboSpindleDirection.setCurrentIndex(index)
myJob = PathUtils.findParentJob(self.obj)
#populate the toolselector and select correct tool
self.form.cboToolSelect.clear()
tooltable = myJob.Tooltable
for number, tool in tooltable.Tools.iteritems():
self.form.cboToolSelect.addItem(tool.Name)
try:
tool = myJob.Tooltable.Tools[self.obj.ToolNumber]
self.form.txtToolType.setText(tool.ToolType)
self.form.txtToolMaterial.setText(tool.Material)
self.form.txtToolDiameter.setText(str(tool.Diameter))
index = self.form.cboToolSelect.findText(tool.Name, QtCore.Qt.MatchFixedString)
if index >= 0:
self.form.cboToolSelect.setCurrentIndex(index)
except:
self.form.cboToolSelect.setCurrentIndex(-1)
self.form.txtToolType.setText("UNDEFINED")
self.form.txtToolMaterial.setText("UNDEFINED")
self.form.txtToolDiameter.setText("UNDEFINED")
self.form.cboToolSelect.blockSignals(False)
radius = tool.Diameter / 2
length = tool.CuttingEdgeHeight
t = Part.makeCylinder(radius, length)
self.toolrep.Shape = t