- made sure that if the OR-TOOLS package is not installed then the options in the Preferences for the related optimizations are disabled

This commit is contained in:
Marius Stanciu
2021-11-20 19:41:52 +02:00
committed by Marius
parent 640739cc65
commit b494669ca0
6 changed files with 32 additions and 11 deletions

View File

@@ -12,6 +12,7 @@ CHANGELOG for FlatCAM beta
- fixed another issue when using Python 3.10, in GUI elements
- fixed the Rtree optimization when drilling with no toolchange such that all drill points are used
- fixed the CNCJob object Tools Table when drilling with no toolchange: now only one tool is displayed
- made sure that if the OR-TOOLS package is not installed then the options in the Preferences for the related optimizations are disabled
19.11.2021

View File

@@ -346,6 +346,13 @@ class ExcellonGenPrefGroupUI(OptionsGroupUI):
self.optimization_time_label.setDisabled(True)
self.optimization_time_entry.setDisabled(True)
try:
import ortools
except ModuleNotFoundError:
self.excellon_optimization_radio.setOptionsDisabled([_('MetaHeuristic'), _('Basic')], True)
self.optimization_time_label.setDisabled(True)
self.optimization_time_entry.setDisabled(True)
# Setting plot colors signals
self.line_color_entry.editingFinished.connect(self.on_line_color_entry)
self.fill_color_entry.editingFinished.connect(self.on_fill_color_entry)

View File

@@ -171,6 +171,13 @@ class GeometryGenPrefGroupUI(OptionsGroupUI):
self.optimization_time_label.setDisabled(True)
self.optimization_time_entry.setDisabled(True)
try:
import ortools
except ModuleNotFoundError:
self.opt_algorithm_radio.setOptionsDisabled([_('MetaHeuristic'), _('Basic')], True)
self.optimization_time_label.setDisabled(True)
self.optimization_time_entry.setDisabled(True)
self.opt_algorithm_radio.activated_custom.connect(self.optimization_selection)
# Setting plot colors signals

View File

@@ -4,16 +4,21 @@
# Usage: pip3 install -r requirements.txt
numpy>=1.16
matplotlib>=3.4.5
cycler>=0.10
python-dateutil>=2.1
kiwisolver>=1.1
matplotlib>=3.5.0
six
setuptools
dill
rtree
pyopengl
# ###############################
# OR-TOOLS package is now optional
ortools>=7.0
# ###############################
svg.path>=4.0
simplejson
shapely>=1.7.1
@@ -31,4 +36,3 @@ pyqt6>=6.1.0
vispy>=0.9.0
rasterio
foronoi>=1.0.3
networkx

View File

@@ -18,6 +18,7 @@ sudo apt-get install -y \
python3-tk
# ################################
# Python packages
sudo -H python3 -m pip install --upgrade \
@@ -35,7 +36,6 @@ sudo -H python3 -m pip install --upgrade \
pyopengl \
setuptools \
svg.path \
ortools \
freetype-py \
fontTools \
rasterio \
@@ -48,4 +48,6 @@ sudo -H python3 -m pip install --upgrade \
pyserial \
pikepdf \
foronoi \
networkx
ortools
# OR-TOOLS package is now optional
# ################################