- added possibility to see the GCode when right clicking on the Project tab on a CNCJob object and then clicking View Source
This commit is contained in:
parent
b0d545eb03
commit
c06317374e
|
@ -8217,14 +8217,28 @@ class App(QtCore.QObject):
|
||||||
|
|
||||||
if obj.kind == 'gerber':
|
if obj.kind == 'gerber':
|
||||||
flt = "Gerber Files (*.GBR);;All Files (*.*)"
|
flt = "Gerber Files (*.GBR);;All Files (*.*)"
|
||||||
else:
|
elif obj.kind == 'excellon':
|
||||||
flt = "Excellon Files (*.DRL);;All Files (*.*)"
|
flt = "Excellon Files (*.DRL);;All Files (*.*)"
|
||||||
|
elif obj.kind == 'cncjob':
|
||||||
|
"GCode Files (*.NC);;All Files (*.*)"
|
||||||
|
else:
|
||||||
|
flt = "All Files (*.*)"
|
||||||
|
|
||||||
self.init_code_editor(name=_("Source Editor"))
|
self.init_code_editor(name=_("Source Editor"))
|
||||||
self.ui.buttonOpen.clicked.connect(lambda: self.handleOpen(filt=flt))
|
self.ui.buttonOpen.clicked.connect(lambda: self.handleOpen(filt=flt))
|
||||||
self.ui.buttonSave.clicked.connect(lambda: self.handleSaveGCode(filt=flt))
|
self.ui.buttonSave.clicked.connect(lambda: self.handleSaveGCode(filt=flt))
|
||||||
|
|
||||||
# then append the text from GCode to the text editor
|
# then append the text from GCode to the text editor
|
||||||
|
if obj.kind == 'cncjob':
|
||||||
|
try:
|
||||||
|
file = obj.export_gcode(preamble='', postamble='', to_file=True)
|
||||||
|
if file == 'fail':
|
||||||
|
return 'fail'
|
||||||
|
except AttributeError:
|
||||||
|
self.inform.emit('[WARNING_NOTCL] %s' %
|
||||||
|
_("There is no selected object for which to see it's source file code."))
|
||||||
|
return 'fail'
|
||||||
|
else:
|
||||||
try:
|
try:
|
||||||
file = StringIO(obj.source_file)
|
file = StringIO(obj.source_file)
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
|
|
|
@ -5842,11 +5842,12 @@ class FlatCAMCNCjob(FlatCAMObj, CNCjob):
|
||||||
|
|
||||||
preamble = str(self.ui.prepend_text.get_value())
|
preamble = str(self.ui.prepend_text.get_value())
|
||||||
postamble = str(self.ui.append_text.get_value())
|
postamble = str(self.ui.append_text.get_value())
|
||||||
gc = self.export_gcode(preamble=preamble, postamble=postamble, to_file=True)
|
|
||||||
if gc == 'fail':
|
gco = self.export_gcode(preamble=preamble, postamble=postamble, to_file=True)
|
||||||
|
if gco == 'fail':
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
self.app.gcode_edited = gc
|
self.app.gcode_edited = gco
|
||||||
|
|
||||||
self.app.init_code_editor(name=_("Code Editor"))
|
self.app.init_code_editor(name=_("Code Editor"))
|
||||||
self.app.ui.buttonOpen.clicked.connect(self.app.handleOpen)
|
self.app.ui.buttonOpen.clicked.connect(self.app.handleOpen)
|
||||||
|
|
|
@ -320,7 +320,7 @@ class ObjectCollection(QtCore.QAbstractItemModel):
|
||||||
self.app.ui.menuprojectgeneratecnc.setVisible(False)
|
self.app.ui.menuprojectgeneratecnc.setVisible(False)
|
||||||
if type(obj) != FlatCAMGeometry and type(obj) != FlatCAMExcellon and type(obj) != FlatCAMGerber:
|
if type(obj) != FlatCAMGeometry and type(obj) != FlatCAMExcellon and type(obj) != FlatCAMGerber:
|
||||||
self.app.ui.menuprojectedit.setVisible(False)
|
self.app.ui.menuprojectedit.setVisible(False)
|
||||||
if type(obj) != FlatCAMGerber and type(obj) != FlatCAMExcellon:
|
if type(obj) != FlatCAMGerber and type(obj) != FlatCAMExcellon and type(obj) != FlatCAMCNCjob:
|
||||||
self.app.ui.menuprojectviewsource.setVisible(False)
|
self.app.ui.menuprojectviewsource.setVisible(False)
|
||||||
else:
|
else:
|
||||||
self.app.ui.menuprojectgeneratecnc.setVisible(False)
|
self.app.ui.menuprojectgeneratecnc.setVisible(False)
|
||||||
|
|
|
@ -20,6 +20,7 @@ CAD program, and create G-Code for Isolation routing.
|
||||||
- fixed the TclCommand cncjob to use the -outname parameter
|
- fixed the TclCommand cncjob to use the -outname parameter
|
||||||
- added some more keywords in the data_model for auto-completer
|
- added some more keywords in the data_model for auto-completer
|
||||||
- fixed isolate TclCommand to use correctly the -outname parameter
|
- fixed isolate TclCommand to use correctly the -outname parameter
|
||||||
|
- added possibility to see the GCode when right clicking on the Project tab on a CNCJob object and then clicking View Source
|
||||||
|
|
||||||
14.09.2019
|
14.09.2019
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue