Fixed post processors and Command constructor (wasn't dealing with parameters being optional).

This commit is contained in:
ml
2016-10-23 02:43:13 -07:00
committed by wmayer
parent eb9e9096ce
commit 6b69276342
6 changed files with 16 additions and 10 deletions

View File

@@ -60,6 +60,7 @@ class ObjectPathJob:
posts = glob.glob(path + '/*_post.py')
allposts.extend([ str(os.path.split(os.path.splitext(p)[0])[1][:-5]) for p in posts])
allposts.sort()
# obj.addProperty("App::PropertyFile", "PostProcessor", "CodeOutput", "Select the Post Processor file for this project")
obj.addProperty("App::PropertyFile", "OutputFile", "CodeOutput", QtCore.QT_TRANSLATE_NOOP("App::Property","The NC output file for this project"))

View File

@@ -27,6 +27,8 @@ import FreeCAD
import Path, PathScripts
from PathScripts import PostUtils
SHOW_EDITOR=True
def fmt(num):
fnum = ""
fnum += '%.3f' % (num)
@@ -98,7 +100,8 @@ def export(obj,filename,argstring):
gfile.close()
else:
FreeCAD.Console.PrintError('Select a path object and try again\n')
if obj[0].Editor:
if SHOW_EDITOR:
FreeCAD.Console.PrintMessage('Editor Activated\n')
dia = PostUtils.GCodeEditorDialog()
dia.editor.setText(gcode)

View File

@@ -123,7 +123,7 @@ def export(objectslist,filename,argstring):
#Find the machine.
#The user my have overriden post processor defaults in the GUI. Make sure we're using the current values in the Machine Def.
myMachine = None
for pathobj in selection:
for pathobj in objectslist:
if hasattr(pathobj,"MachineName"):
myMachine = pathobj.MachineName
if hasattr(pathobj, "MachineUnits"):

View File

@@ -119,7 +119,7 @@ def export(objectslist, filename, argstring):
# The user my have overriden post processor defaults in the GUI. Make
# sure we're using the current values in the Machine Def.
myMachine = None
for pathobj in selection:
for pathobj in objectslist:
if hasattr(pathobj,"MachineName"):
myMachine = pathobj.MachineName
if hasattr(pathobj, "MachineUnits"):