added attribute to Toolbit for spindlepower

setting this to false will suppress M3 commands.
User can configure a toolbit to never have the spindle turn on
this is to prevent accidental powering of the spindle with
unpowered tools like dragknife and probe
This commit is contained in:
sliptonic
2020-11-04 14:04:32 -06:00
parent 5c47912cc1
commit ec3285a006
3 changed files with 65 additions and 27 deletions

View File

@@ -169,14 +169,16 @@ class ToolBitEditor(object):
# get the attributes
for i, name in enumerate(self.props):
print('in accept: {}'.format(name))
prop = self.proto.getProperty(name)
enabled = self.model.item(i, 0).checkState() == QtCore.Qt.Checked
if enabled and not prop.getValue() is None:
prop.setupProperty(self.tool, name,
PathToolBit.PropertyGroupAttribute,
prop.getValue())
elif hasattr(self.tool, name):
self.tool.removeProperty(name)
if self.model.item(i, 0) is not None:
enabled = self.model.item(i, 0).checkState() == QtCore.Qt.Checked
if enabled and not prop.getValue() is None:
prop.setupProperty(self.tool, name,
PathToolBit.PropertyGroupAttribute,
prop.getValue())
elif hasattr(self.tool, name):
self.tool.removeProperty(name)
def reject(self):
PathLog.track()