- fixed issue with not loading old projects that do not have certain information's required by the new versions of FlatCAM

- compacted a bit more the GUI for Gerber Object
This commit is contained in:
Marius Stanciu
2019-02-19 13:00:38 +02:00
committed by Marius
parent 7f65cf628d
commit d998b87601
4 changed files with 22 additions and 12 deletions

View File

@@ -6272,7 +6272,6 @@ class App(QtCore.QObject):
obj_inst.from_dict(obj)
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.plot_all()
self.inform.emit("[success] Project loaded from: " + filename)

View File

@@ -106,7 +106,12 @@ class FlatCAMObj(QtCore.QObject):
if attr == 'options':
self.options.update(d[attr])
else:
setattr(self, attr, d[attr])
try:
setattr(self, attr, d[attr])
except KeyError:
log.debug("FlatCAMObj.from_dict() --> KeyError: %s. Means that we are loading an old project that don't"
"have all attributes in the latest FlatCAM." % str(attr))
pass
def on_options_change(self, key):
# Update form on programmatically options change

View File

@@ -390,16 +390,19 @@ class GerberObjectUI(ObjectUI):
# Rounded corners
self.noncopper_rounded_cb = FCCheckBox(label="Rounded corners")
self.noncopper_rounded_cb.setToolTip(
"Creates a Geometry objects with polygons\n"
"covering the copper-free areas of the PCB."
"Resulting geometry will have rounded corners."
)
grid4.addWidget(self.noncopper_rounded_cb, 1, 0, 1, 2)
grid4.addWidget(self.noncopper_rounded_cb, 1, 0)
self.generate_noncopper_button = QtWidgets.QPushButton('Generate Geometry')
self.custom_box.addWidget(self.generate_noncopper_button)
self.generate_noncopper_button = QtWidgets.QPushButton('Generate Geo')
grid4.addWidget(self.generate_noncopper_button, 1, 1)
## Bounding box
self.boundingbox_label = QtWidgets.QLabel('<b>Bounding Box:</b>')
self.boundingbox_label.setToolTip(
"Create a geometry surrounding the Gerber object.\n"
"Square shape."
)
self.custom_box.addWidget(self.boundingbox_label)
grid5 = QtWidgets.QGridLayout()
@@ -421,13 +424,13 @@ class GerberObjectUI(ObjectUI):
"their radius is equal to\n"
"the margin."
)
grid5.addWidget(self.bbrounded_cb, 1, 0, 1, 2)
grid5.addWidget(self.bbrounded_cb, 1, 0)
self.generate_bb_button = QtWidgets.QPushButton('Generate Geometry')
self.generate_bb_button = QtWidgets.QPushButton('Generate Geo')
self.generate_bb_button.setToolTip(
"Genrate the Geometry object."
"Generate the Geometry object."
)
self.custom_box.addWidget(self.generate_bb_button)
grid5.addWidget(self.generate_bb_button, 1, 1)
class ExcellonObjectUI(ObjectUI):

View File

@@ -12,7 +12,10 @@ CAD program, and create G-Code for Isolation routing.
19.02.2019
- added the ability to compress the FlatCAM project on save with LZMA compression. There is a setting in Edit -> Preferences -> Compression Level between 0 and 9. 9 level yields best compression at the price of RAM usage and time spent.
- made FlatCAM able to load old type (uncompressed) FlatCAM projects
- made FlatCAM able to load old type (uncompressed) FlatCAM projects
- fixed issue with not loading old projects that do not have certain information's required by the new versions of FlatCAM
- compacted a bit more the GUI for Gerber Object
18.02.2019