- added a new setting in Preferences ("3D compatibility") controlled by a checkbox. If the checkbox is checked then multithreading is disabled for the 3D mode (lower performance but perhaps more compatibility, especially for Linux) - this was done from the research done by Matti Eiden on bitbucket

This commit is contained in:
Marius Stanciu
2022-09-25 05:44:43 +03:00
committed by Marius
parent 565c839460
commit 9b08191660
7 changed files with 25 additions and 7 deletions

View File

@@ -7,6 +7,10 @@ CHANGELOG for FlatCAM Evo beta
================================================= =================================================
25.09.2022
- added a new setting in Preferences ("3D compatibility") controlled by a checkbox. If the checkbox is checked then multithreading is disabled for the 3D mode (lower performance but perhaps more compatibility, especially for Linux) - this was done from the research done by Matti Eiden on bitbucket
10.09.2022 10.09.2022
- hided the main UI on application quit to create a user experience of a shutdown without lag - hided the main UI on application quit to create a user experience of a shutdown without lag

View File

@@ -511,7 +511,7 @@ class PlotCanvas(QtCore.QObject, VisPyCanvas):
# sc = ShapeCollection(parent=self.view.scene, pool=self.app.pool, **kwargs) # sc = ShapeCollection(parent=self.view.scene, pool=self.app.pool, **kwargs)
# self.shape_collections.append(sc) # self.shape_collections.append(sc)
# return sc # return sc
return ShapeCollection(parent=self.view.scene, pool=self.fcapp.pool, **kwargs) return ShapeCollection(parent=self.view.scene, pool=self.fcapp.pool, fcoptions=self.fcapp.options, **kwargs)
def new_cursor(self, big=None): def new_cursor(self, big=None):
""" """

View File

@@ -230,7 +230,7 @@ class ShapeGroup(object):
class ShapeCollectionVisual(CompoundVisual): class ShapeCollectionVisual(CompoundVisual):
def __init__(self, linewidth=1, triangulation='vispy', layers=3, pool=None, **kwargs): def __init__(self, linewidth=1, triangulation='vispy', layers=3, pool=None, fcoptions=None, **kwargs):
""" """
Represents collection of shapes to draw on VisPy scene Represents collection of shapes to draw on VisPy scene
:param linewidth: float :param linewidth: float
@@ -244,6 +244,8 @@ class ShapeCollectionVisual(CompoundVisual):
Each layer adds 2 visuals on VisPy scene. Be careful: more layers cause less fps Each layer adds 2 visuals on VisPy scene. Be careful: more layers cause less fps
:param kwargs: :param kwargs:
""" """
self.fc_options = fcoptions
self.data = {} self.data = {}
self.last_key = -1 self.last_key = -1
@@ -329,6 +331,9 @@ class ShapeCollectionVisual(CompoundVisual):
if linewidth: if linewidth:
self._line_width = linewidth self._line_width = linewidth
if self.fc_options and self.fc_options["global_graphic_engine_3d_no_mp"] is True:
self.data[key] = _update_shape_buffers(self.data[key])
else:
# Add data to process pool if pool exists # Add data to process pool if pool exists
try: try:
self.results[key] = self.pool.map_async(_update_shape_buffers, [self.data[key]]) self.results[key] = self.pool.map_async(_update_shape_buffers, [self.data[key]])

View File

@@ -57,6 +57,7 @@ class PreferencesUIManager(QtCore.QObject):
"decimals_metric": self.ui.general_pref_form.general_app_group.precision_metric_entry, "decimals_metric": self.ui.general_pref_form.general_app_group.precision_metric_entry,
"units": self.ui.general_pref_form.general_app_group.units_radio, "units": self.ui.general_pref_form.general_app_group.units_radio,
"global_graphic_engine": self.ui.general_pref_form.general_app_group.ge_radio, "global_graphic_engine": self.ui.general_pref_form.general_app_group.ge_radio,
"global_graphic_engine_3d_no_mp": self.ui.general_pref_form.general_app_group.ge_comp_cb,
"global_app_level": self.ui.general_pref_form.general_app_group.app_level_radio, "global_app_level": self.ui.general_pref_form.general_app_group.app_level_radio,
"global_log_verbose": self.ui.general_pref_form.general_app_group.verbose_combo, "global_log_verbose": self.ui.general_pref_form.general_app_group.verbose_combo,
"global_portable": self.ui.general_pref_form.general_app_group.portability_cb, "global_portable": self.ui.general_pref_form.general_app_group.portability_cb,

View File

@@ -102,6 +102,12 @@ class GeneralAppPrefGroupUI(OptionsGroupUI):
grid1.addWidget(self.ge_label, 0, 0) grid1.addWidget(self.ge_label, 0, 0)
grid1.addWidget(self.ge_radio, 0, 1) grid1.addWidget(self.ge_radio, 0, 1)
self.ge_comp_cb = FCCheckBox(_("3D Compatibility"))
self.ge_comp_cb.setToolTip(_("Check this if you have problems in 3D mode. Works only for 3D mode.\n"
"It will disable performance mods but perhaps add more compatibility."))
grid1.addWidget(self.ge_comp_cb, 1, 0, 1, 2)
# separator_line = QtWidgets.QFrame() # separator_line = QtWidgets.QFrame()
# separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine) # separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
# separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) # separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)

View File

@@ -94,7 +94,8 @@ class FlatCAMObj(QtCore.QObject):
if self.app.use_3d_engine: if self.app.use_3d_engine:
self.shapes = self.app.plotcanvas.new_shape_group() self.shapes = self.app.plotcanvas.new_shape_group()
self.mark_shapes = ShapeCollection(parent=self.app.plotcanvas.view.scene, layers=1, pool=self.app.pool) self.mark_shapes = ShapeCollection(parent=self.app.plotcanvas.view.scene, layers=1, pool=self.app.pool,
fcoptions=self.app.options)
else: else:
self.shapes = ShapeCollectionLegacy(obj=self, app=self.app, name=name) self.shapes = ShapeCollectionLegacy(obj=self, app=self.app, name=name)
self.mark_shapes = ShapeCollectionLegacy(obj=self, app=self.app, name=name + "_mark_shapes") self.mark_shapes = ShapeCollectionLegacy(obj=self, app=self.app, name=name + "_mark_shapes")

View File

@@ -85,6 +85,7 @@ class AppDefaults:
"decimals_inch": 4, "decimals_inch": 4,
"decimals_metric": 4, "decimals_metric": 4,
"global_graphic_engine": '3D', "global_graphic_engine": '3D',
"global_graphic_engine_3d_no_mp": False,
"global_app_level": 'b', "global_app_level": 'b',
"global_log_verbose": 2, "global_log_verbose": 2,