- updated the Excellon plot function so it can plot the Excellon's from old projects
- removed the message boxes that popup on Excellon Export errors and replaced them with status bar messages
This commit is contained in:
parent
681f1ef1eb
commit
679b33fa72
|
@ -4978,23 +4978,12 @@ class App(QtCore.QObject):
|
||||||
|
|
||||||
obj = self.collection.get_active()
|
obj = self.collection.get_active()
|
||||||
if obj is None:
|
if obj is None:
|
||||||
self.inform.emit("[WARNING_NOTCL] No object selected.")
|
self.inform.emit("[WARNING_NOTCL] No object selected. Please Select an Excellon object to export.")
|
||||||
msg = "Please Select an Excellon object to export"
|
|
||||||
msgbox = QtWidgets.QMessageBox()
|
|
||||||
msgbox.setInformativeText(msg)
|
|
||||||
msgbox.setStandardButtons(QtWidgets.QMessageBox.Ok)
|
|
||||||
msgbox.setDefaultButton(QtWidgets.QMessageBox.Ok)
|
|
||||||
msgbox.exec_()
|
|
||||||
return
|
return
|
||||||
|
|
||||||
# Check for more compatible types and add as required
|
# Check for more compatible types and add as required
|
||||||
if not isinstance(obj, FlatCAMExcellon):
|
if not isinstance(obj, FlatCAMExcellon):
|
||||||
msg = "[WARNING_NOTCL] Only Excellon objects can be used."
|
self.inform.emit("[ERROR_NOTCL] Failed. Only Excellon objects can be saved as Excellon files...")
|
||||||
msgbox = QtWidgets.QMessageBox()
|
|
||||||
msgbox.setInformativeText(msg)
|
|
||||||
msgbox.setStandardButtons(QtWidgets.QMessageBox.Ok)
|
|
||||||
msgbox.setDefaultButton(QtWidgets.QMessageBox.Ok)
|
|
||||||
msgbox.exec_()
|
|
||||||
return
|
return
|
||||||
|
|
||||||
name = self.collection.get_active().options["name"]
|
name = self.collection.get_active().options["name"]
|
||||||
|
@ -6105,7 +6094,7 @@ class App(QtCore.QObject):
|
||||||
App.log.debug(obj['kind'] + ": " + obj['options']['name'])
|
App.log.debug(obj['kind'] + ": " + obj['options']['name'])
|
||||||
self.new_object(obj['kind'], obj['options']['name'], obj_init, active=False, fit=False, plot=True)
|
self.new_object(obj['kind'], obj['options']['name'], obj_init, active=False, fit=False, plot=True)
|
||||||
|
|
||||||
# self.plot_all()
|
self.plot_all()
|
||||||
self.inform.emit("[success] Project loaded from: " + filename)
|
self.inform.emit("[success] Project loaded from: " + filename)
|
||||||
|
|
||||||
self.should_we_save = False
|
self.should_we_save = False
|
||||||
|
|
|
@ -2226,29 +2226,31 @@ class FlatCAMExcellon(FlatCAMObj, Excellon):
|
||||||
self.add_shape(shape=ints, color='green', visible=self.options['plot'])
|
self.add_shape(shape=ints, color='green', visible=self.options['plot'])
|
||||||
|
|
||||||
self.shapes.redraw()
|
self.shapes.redraw()
|
||||||
except (ObjectDeleted, AttributeError):
|
return
|
||||||
|
except (ObjectDeleted, AttributeError, KeyError):
|
||||||
self.shapes.clear(update=True)
|
self.shapes.clear(update=True)
|
||||||
|
|
||||||
# try:
|
# this stays for compatibility reasons, in case we try to open old projects
|
||||||
# _ = iter(self.solid_geometry)
|
try:
|
||||||
# except TypeError:
|
_ = iter(self.solid_geometry)
|
||||||
# self.solid_geometry = [self.solid_geometry]
|
except TypeError:
|
||||||
#
|
self.solid_geometry = [self.solid_geometry]
|
||||||
# try:
|
|
||||||
# # Plot excellon (All polygons?)
|
try:
|
||||||
# if self.options["solid"]:
|
# Plot excellon (All polygons?)
|
||||||
# for geo in self.solid_geometry:
|
if self.options["solid"]:
|
||||||
# self.add_shape(shape=geo, color='#750000BF', face_color='#C40000BF', visible=self.options['plot'],
|
for geo in self.solid_geometry:
|
||||||
# layer=2)
|
self.add_shape(shape=geo, color='#750000BF', face_color='#C40000BF', visible=self.options['plot'],
|
||||||
# else:
|
layer=2)
|
||||||
# for geo in self.solid_geometry:
|
else:
|
||||||
# self.add_shape(shape=geo.exterior, color='red', visible=self.options['plot'])
|
for geo in self.solid_geometry:
|
||||||
# for ints in geo.interiors:
|
self.add_shape(shape=geo.exterior, color='red', visible=self.options['plot'])
|
||||||
# self.add_shape(shape=ints, color='green', visible=self.options['plot'])
|
for ints in geo.interiors:
|
||||||
#
|
self.add_shape(shape=ints, color='green', visible=self.options['plot'])
|
||||||
# self.shapes.redraw()
|
|
||||||
# except (ObjectDeleted, AttributeError):
|
self.shapes.redraw()
|
||||||
# self.shapes.clear(update=True)
|
except (ObjectDeleted, AttributeError):
|
||||||
|
self.shapes.clear(update=True)
|
||||||
|
|
||||||
# try:
|
# try:
|
||||||
# # Plot excellon (All polygons?)
|
# # Plot excellon (All polygons?)
|
||||||
|
|
|
@ -17,6 +17,8 @@ CAD program, and create G-Code for Isolation routing.
|
||||||
- remade the Excellon export function to work with parameters entered in Edit -> Preferences -> Excellon Export
|
- remade the Excellon export function to work with parameters entered in Edit -> Preferences -> Excellon Export
|
||||||
- added a new entry in the Project Context Menu named 'Save'. It will actually work for Geometry and it will do Export DXF and for Excellon and it will do Export Excellon
|
- added a new entry in the Project Context Menu named 'Save'. It will actually work for Geometry and it will do Export DXF and for Excellon and it will do Export Excellon
|
||||||
- reworked the offer to save a project so it is done only if there are objects in the project but those objects are new and/or are modified since last project load (if an old project was loaded.)
|
- reworked the offer to save a project so it is done only if there are objects in the project but those objects are new and/or are modified since last project load (if an old project was loaded.)
|
||||||
|
- updated the Excellon plot function so it can plot the Excellon's from old projects
|
||||||
|
- removed the message boxes that popup on Excellon Export errors and replaced them with status bar messages
|
||||||
|
|
||||||
14.02.2019
|
14.02.2019
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue