- added a new setting in Edit -> Preferences -> General that allow to select the type of saving for the FlatCAM project: either compressed or uncompressed. Compression introduce an time overhead to the saving/restoring of a FlatCAM project.
This commit is contained in:
parent
9d0bcf477a
commit
4dbecde32f
|
@ -314,6 +314,7 @@ class App(QtCore.QObject):
|
||||||
"global_project_autohide": self.general_defaults_form.general_app_group.project_autohide_cb,
|
"global_project_autohide": self.general_defaults_form.general_app_group.project_autohide_cb,
|
||||||
"global_advanced": self.general_defaults_form.general_app_group.advanced_cb,
|
"global_advanced": self.general_defaults_form.general_app_group.advanced_cb,
|
||||||
"global_compression_level": self.general_defaults_form.general_app_group.compress_combo,
|
"global_compression_level": self.general_defaults_form.general_app_group.compress_combo,
|
||||||
|
"global_save_compressed": self.general_defaults_form.general_app_group.save_type_cb,
|
||||||
|
|
||||||
"global_gridx": self.general_defaults_form.general_gui_group.gridx_entry,
|
"global_gridx": self.general_defaults_form.general_gui_group.gridx_entry,
|
||||||
"global_gridy": self.general_defaults_form.general_gui_group.gridy_entry,
|
"global_gridy": self.general_defaults_form.general_gui_group.gridy_entry,
|
||||||
|
@ -550,6 +551,8 @@ class App(QtCore.QObject):
|
||||||
"global_shell_at_startup": False, # Show the shell at startup.
|
"global_shell_at_startup": False, # Show the shell at startup.
|
||||||
"global_recent_limit": 10, # Max. items in recent list.
|
"global_recent_limit": 10, # Max. items in recent list.
|
||||||
"global_compression_level": 3,
|
"global_compression_level": 3,
|
||||||
|
"global_save_compressed": True,
|
||||||
|
|
||||||
"fit_key": 'V',
|
"fit_key": 'V',
|
||||||
"zoom_out_key": '-',
|
"zoom_out_key": '-',
|
||||||
"zoom_in_key": '=',
|
"zoom_in_key": '=',
|
||||||
|
@ -6929,42 +6932,45 @@ The normal flow when working in FlatCAM is the following:</span></p>
|
||||||
"options": self.options,
|
"options": self.options,
|
||||||
"version": self.version}
|
"version": self.version}
|
||||||
|
|
||||||
|
if self.defaults["global_save_compressed"] is True:
|
||||||
with lzma.open(filename, "w", preset=int(self.defaults['global_compression_level'])) as f:
|
with lzma.open(filename, "w", preset=int(self.defaults['global_compression_level'])) as f:
|
||||||
g = json.dumps(d, default=to_dict, indent=2, sort_keys=True).encode('utf-8')
|
g = json.dumps(d, default=to_dict, indent=2, sort_keys=True).encode('utf-8')
|
||||||
# # Write
|
# # Write
|
||||||
f.write(g)
|
f.write(g)
|
||||||
self.inform.emit("[success] Project saved to: %s" % filename)
|
self.inform.emit("[success] Project saved to: %s" % filename)
|
||||||
|
else:
|
||||||
# Open file
|
# Open file
|
||||||
# try:
|
try:
|
||||||
# f = open(filename, 'w')
|
f = open(filename, 'w')
|
||||||
# except IOError:
|
except IOError:
|
||||||
# App.log.error("[ERROR] Failed to open file for saving: %s", filename)
|
App.log.error("[ERROR] Failed to open file for saving: %s", filename)
|
||||||
# return
|
return
|
||||||
#
|
|
||||||
# # Write
|
# Write
|
||||||
# json.dump(d, f, default=to_dict, indent=2, sort_keys=True)
|
json.dump(d, f, default=to_dict, indent=2, sort_keys=True)
|
||||||
# f.close()
|
f.close()
|
||||||
#
|
|
||||||
# # verification of the saved project
|
# verification of the saved project
|
||||||
# # Open and parse
|
# Open and parse
|
||||||
# try:
|
try:
|
||||||
# saved_f = open(filename, 'r')
|
saved_f = open(filename, 'r')
|
||||||
# except IOError:
|
except IOError:
|
||||||
# self.inform.emit("[ERROR_NOTCL] Failed to verify project file: %s. Retry to save it." % filename)
|
self.inform.emit("[ERROR_NOTCL] Failed to verify project file: %s. Retry to save it." % filename)
|
||||||
# return
|
return
|
||||||
#
|
|
||||||
# try:
|
try:
|
||||||
# saved_d = json.load(saved_f, object_hook=dict2obj)
|
saved_d = json.load(saved_f, object_hook=dict2obj)
|
||||||
# except:
|
except:
|
||||||
# self.inform.emit("[ERROR_NOTCL] Failed to parse saved project file: %s. Retry to save it." % filename)
|
self.inform.emit(
|
||||||
# f.close()
|
"[ERROR_NOTCL] Failed to parse saved project file: %s. Retry to save it." % filename)
|
||||||
# return
|
f.close()
|
||||||
# saved_f.close()
|
return
|
||||||
#
|
saved_f.close()
|
||||||
# if 'version' in saved_d:
|
|
||||||
# self.inform.emit("[success] Project saved to: %s" % filename)
|
if 'version' in saved_d:
|
||||||
# else:
|
self.inform.emit("[success] Project saved to: %s" % filename)
|
||||||
# self.inform.emit("[ERROR_NOTCL] Failed to save project file: %s. Retry to save it." % filename)
|
else:
|
||||||
|
self.inform.emit("[ERROR_NOTCL] Failed to save project file: %s. Retry to save it." % filename)
|
||||||
|
|
||||||
def on_options_app2project(self):
|
def on_options_app2project(self):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -3105,8 +3105,9 @@ class GeneralAppPrefGroupUI(OptionsGroupUI):
|
||||||
# to the main layout of this TAB
|
# to the main layout of this TAB
|
||||||
self.layout.addLayout(self.form_box)
|
self.layout.addLayout(self.form_box)
|
||||||
|
|
||||||
hlay = QtWidgets.QHBoxLayout()
|
# hlay = QtWidgets.QHBoxLayout()
|
||||||
self.layout.addLayout(hlay)
|
# self.layout.addLayout(hlay)
|
||||||
|
# hlay.addStretch()
|
||||||
|
|
||||||
# Advanced CB
|
# Advanced CB
|
||||||
self.advanced_cb = FCCheckBox('Show Advanced Options')
|
self.advanced_cb = FCCheckBox('Show Advanced Options')
|
||||||
|
@ -3116,8 +3117,16 @@ class GeneralAppPrefGroupUI(OptionsGroupUI):
|
||||||
"kind of objects."
|
"kind of objects."
|
||||||
)
|
)
|
||||||
# self.advanced_cb.setLayoutDirection(QtCore.Qt.RightToLeft)
|
# self.advanced_cb.setLayoutDirection(QtCore.Qt.RightToLeft)
|
||||||
hlay.addWidget(self.advanced_cb)
|
self.layout.addWidget(self.advanced_cb)
|
||||||
hlay.addStretch()
|
|
||||||
|
# Save compressed project CB
|
||||||
|
self.save_type_cb = FCCheckBox('Save Compressed Project')
|
||||||
|
self.save_type_cb.setToolTip(
|
||||||
|
"Whether to save a compressed or uncompressed project.\n"
|
||||||
|
"When checked it will save a compressed FlatCAM project."
|
||||||
|
)
|
||||||
|
# self.advanced_cb.setLayoutDirection(QtCore.Qt.RightToLeft)
|
||||||
|
self.layout.addWidget(self.save_type_cb)
|
||||||
|
|
||||||
hlay1 = QtWidgets.QHBoxLayout()
|
hlay1 = QtWidgets.QHBoxLayout()
|
||||||
self.layout.addLayout(hlay1)
|
self.layout.addLayout(hlay1)
|
||||||
|
@ -3136,6 +3145,8 @@ class GeneralAppPrefGroupUI(OptionsGroupUI):
|
||||||
hlay1.addWidget(self.compress_label)
|
hlay1.addWidget(self.compress_label)
|
||||||
hlay1.addWidget(self.compress_combo)
|
hlay1.addWidget(self.compress_combo)
|
||||||
|
|
||||||
|
self.proj_ois = OptionalInputSection(self.save_type_cb, [self.compress_label, self.compress_combo], True)
|
||||||
|
|
||||||
self.form_box_2 = QtWidgets.QFormLayout()
|
self.form_box_2 = QtWidgets.QFormLayout()
|
||||||
self.layout.addLayout(self.form_box_2)
|
self.layout.addLayout(self.form_box_2)
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,7 @@ CAD program, and create G-Code for Isolation routing.
|
||||||
- compacted a bit more the GUI for Gerber Object
|
- compacted a bit more the GUI for Gerber Object
|
||||||
- removed the Open Gerber with 'follow' menu entry and also the open_gerber Tcl Command attribute 'follow'. This is no longer required because now the follow_geometry is stored by default in a Gerber object attribute gerber_obj.follow_geometry
|
- removed the Open Gerber with 'follow' menu entry and also the open_gerber Tcl Command attribute 'follow'. This is no longer required because now the follow_geometry is stored by default in a Gerber object attribute gerber_obj.follow_geometry
|
||||||
- added a new parameter for the Tcl CommandIsolate, named: 'follow'. When follow = 1 (True) the resulting geometry will follow the Gerber paths.
|
- added a new parameter for the Tcl CommandIsolate, named: 'follow'. When follow = 1 (True) the resulting geometry will follow the Gerber paths.
|
||||||
|
- added a new setting in Edit -> Preferences -> General that allow to select the type of saving for the FlatCAM project: either compressed or uncompressed. Compression introduce an time overhead to the saving/restoring of a FlatCAM project.
|
||||||
|
|
||||||
18.02.2019
|
18.02.2019
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue