Added job default values to template export.
This commit is contained in:
@@ -109,6 +109,38 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="defaultsGroup">
|
||||
<property name="title">
|
||||
<string>Defaults</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<widget class="QCheckBox" name="defaultToolRapid">
|
||||
<property name="text">
|
||||
<string>Tool Rapid Speeds</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QCheckBox" name="defaultOperationHeights">
|
||||
<property name="text">
|
||||
<string>Operation Heights</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="toolsGroup">
|
||||
<property name="toolTip">
|
||||
@@ -148,12 +180,12 @@
|
||||
<tabstop>stockGroup</tabstop>
|
||||
<tabstop>stockExtent</tabstop>
|
||||
<tabstop>stockPlacement</tabstop>
|
||||
<tabstop>defaultsGroup</tabstop>
|
||||
<tabstop>defaultToolRapid</tabstop>
|
||||
<tabstop>defaultOperationHeights</tabstop>
|
||||
<tabstop>toolsGroup</tabstop>
|
||||
<tabstop>toolsList</tabstop>
|
||||
<tabstop>buttonBox</tabstop>
|
||||
<tabstop>stockExtentHint</tabstop>
|
||||
<tabstop>stockPlacementHint</tabstop>
|
||||
<tabstop>postProcessingHint</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<string>Job Edit</string>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>3</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tabGeneral">
|
||||
<attribute name="title">
|
||||
@@ -401,7 +401,7 @@
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Tool Rapid Feed</string>
|
||||
<string>Tool Rapid Speed</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
|
||||
@@ -123,6 +123,8 @@ class ObjectJob:
|
||||
obj.setEditorMode('Operations', 2) # hide
|
||||
obj.setEditorMode('Placement', 2)
|
||||
|
||||
self.initDefaultValues(obj)
|
||||
|
||||
obj.Base = createResourceClone(obj, base, 'Base', 'BaseGeometry')
|
||||
obj.Proxy = self
|
||||
|
||||
@@ -136,7 +138,6 @@ class ObjectJob:
|
||||
if obj.Stock.ViewObject:
|
||||
obj.Stock.ViewObject.Visibility = False
|
||||
|
||||
self.initDefaultValues(obj)
|
||||
|
||||
def initDefaultValues(self, obj):
|
||||
if not hasattr(obj, 'DefaultHorizRapid'):
|
||||
|
||||
@@ -183,13 +183,18 @@ class DlgJobTemplateExport:
|
||||
|
||||
def includeStock(self):
|
||||
return self.dialog.stockGroup.isChecked()
|
||||
|
||||
def includeStockExtent(self):
|
||||
return self.dialog.stockExtent.isChecked()
|
||||
|
||||
def includeStockPlacement(self):
|
||||
return self.dialog.stockPlacement.isChecked()
|
||||
|
||||
def includeDefaults(self):
|
||||
return self.dialog.defaultsGroup.isChecked()
|
||||
def includeDefaultToolRapid(self):
|
||||
return self.dialog.defaultToolRapid.isChecked()
|
||||
def includeDefaultOperationHeights(self):
|
||||
return self.dialog.defaultOperationHeights.isChecked()
|
||||
|
||||
def exec_(self):
|
||||
return self.dialog.exec_()
|
||||
|
||||
@@ -223,14 +228,20 @@ class CommandJobTemplateExport:
|
||||
@classmethod
|
||||
def Execute(cls, job, path, dialog=None):
|
||||
attrs = job.Proxy.templateAttrs(job)
|
||||
|
||||
# post processor settings
|
||||
if dialog and not dialog.includePostProcessing():
|
||||
attrs.pop(PathJob.JobTemplate.PostProcessor, None)
|
||||
attrs.pob(PathJob.JobTemplate.PostProcessorArgs, None)
|
||||
attrs.pob(PathJob.JobTemplate.PostProcessorOutputFile, None)
|
||||
attrs.pop(PathJob.JobTemplate.PostProcessorArgs, None)
|
||||
attrs.pop(PathJob.JobTemplate.PostProcessorOutputFile, None)
|
||||
|
||||
# tool controller settings
|
||||
toolControllers = dialog.includeToolControllers() if dialog else job.ToolController
|
||||
if toolControllers:
|
||||
tcAttrs = [tc.Proxy.templateAttrs(tc) for tc in toolControllers]
|
||||
attrs[PathJob.JobTemplate.ToolController] = tcAttrs
|
||||
|
||||
# stock settings
|
||||
stockAttrs = None
|
||||
if dialog:
|
||||
if dialog.includeStock():
|
||||
@@ -239,6 +250,16 @@ class CommandJobTemplateExport:
|
||||
stockAttrs = PathStock.TemplateAttributes(job.Stock)
|
||||
if stockAttrs:
|
||||
attrs[PathJob.JobTemplate.Stock] = stockAttrs
|
||||
|
||||
# defaults settings
|
||||
if dialog and not (dialog.includeDefaults() and dialog.includeDefaultToolRapid()):
|
||||
attrs.pop(PathJob.JobTemplate.DefaultVertRapid, None)
|
||||
attrs.pop(PathJob.JobTemplate.DefaultHorizRapid, None)
|
||||
if dialog and not (dialog.includeDefaults() and dialog.includeDefaultOperationHeights()):
|
||||
attrs.pop(PathJob.JobTemplate.DefaultSafeHeight, None)
|
||||
attrs.pop(PathJob.JobTemplate.DefaultClearanceHeight, None)
|
||||
|
||||
# write template
|
||||
with open(unicode(path), 'wb') as fp:
|
||||
json.dump(attrs, fp, sort_keys=True, indent=2)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user