Merge branch 'Beta' of https://bitbucket.org/jpcgt/flatcam into extract-prefs-code-from-app-class

This commit is contained in:
David Robertson
2020-04-29 02:57:17 +01:00
657 changed files with 750 additions and 261 deletions

View File

@@ -716,7 +716,7 @@ class CNCJobObject(FlatCAMObj, CNCjob):
else:
return 'M02'
def export_gcode(self, filename=None, preamble='', postamble='', to_file=False):
def export_gcode(self, filename=None, preamble='', postamble='', to_file=False, from_tcl=False):
"""
This will save the GCode from the Gcode object to a file on the OS filesystem
@@ -724,6 +724,7 @@ class CNCJobObject(FlatCAMObj, CNCjob):
:param preamble: a custom Gcode block to be added at the beginning of the Gcode file
:param postamble: a custom Gcode block to be added at the end of the Gcode file
:param to_file: if False then no actual file is saved but the app will know that a file was created
:param from_tcl: True if run from Tcl Shell
:return: None
"""
# gcode = ''

View File

@@ -177,7 +177,7 @@ class ScriptObject(FlatCAMObj):
try:
self.app.shell.open_processing() # Disables input box.
result = self.app.tcl.eval(str(new_command))
result = self.app.shell.tcl.eval(str(new_command))
if result != 'None':
self.app.shell.append_output(result + '\n')
@@ -189,9 +189,9 @@ class ScriptObject(FlatCAMObj):
if old_line != '':
# it means that the script finished with an error
result = self.app.tcl.eval("set errorInfo")
log.error("Exec command Exception: %s" % (result + '\n'))
self.app.shell.append_error('ERROR: ' + result + '\n')
result = self.app.shell.tcl.eval("set errorInfo")
log.error("Exec command Exception: %s\n" % result)
self.app.shell.append_error('ERROR: %s\n '% result)
self.app.shell.close_processing()

View File

@@ -247,12 +247,12 @@ class ObjectCollection(QtCore.QAbstractItemModel):
}
icon_files = {
"gerber": "share/flatcam_icon16.png",
"excellon": "share/drill16.png",
"cncjob": "share/cnc16.png",
"geometry": "share/geometry16.png",
"script": "share/script_new16.png",
"document": "share/notes16_1.png"
"gerber": "assets/resources/flatcam_icon16.png",
"excellon": "assets/resources/drill16.png",
"cncjob": "assets/resources/cnc16.png",
"geometry": "assets/resources/geometry16.png",
"script": "assets/resources/script_new16.png",
"document": "assets/resources/notes16_1.png"
}
# will emit the name of the object that was just selected
@@ -272,7 +272,7 @@ class ObjectCollection(QtCore.QAbstractItemModel):
self.icons = {}
for kind in ObjectCollection.icon_files:
self.icons[kind] = QtGui.QPixmap(
ObjectCollection.icon_files[kind].replace('share', self.app.resource_location))
ObjectCollection.icon_files[kind].replace('assets/resources', self.app.resource_location))
# Create root tree view item
self.root_item = TreeItem(["root"])