diff --git a/CHANGELOG.md b/CHANGELOG.md index 34e9c33d..87ee0bba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/appGUI/GUIElements.py b/appGUI/GUIElements.py index c9994221..a5c5d750 100644 --- a/appGUI/GUIElements.py +++ b/appGUI/GUIElements.py @@ -123,14 +123,14 @@ class RadioSetDefaults(RadioSet): * 'label': Shown in the UI * 'value': The value returned is selected - :param choices: List of choices. See description. - :param orientation: 'horizontal' (default) of 'vertical'. - :param parent: Qt parent widget. - :type choices: list + :param choices: List of choices. See description. + :param orientation: 'horizontal' (default) of 'vertical'. + :param parent: Qt parent widget. + :type choices: list :param dictionary: - :type dictionary: "dict" + :type dictionary: "dict" :param key_spec: - :type key_spec: 'str' + :type key_spec: 'str' """ super(RadioSetDefaults, self).__init__(choices=choices, orientation=orientation, compact=compact, parent=parent) diff --git a/appGUI/preferences/excellon/ExcellonGenPrefGroupUI.py b/appGUI/preferences/excellon/ExcellonGenPrefGroupUI.py index ea00fd62..4b5d7032 100644 --- a/appGUI/preferences/excellon/ExcellonGenPrefGroupUI.py +++ b/appGUI/preferences/excellon/ExcellonGenPrefGroupUI.py @@ -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) diff --git a/appGUI/preferences/geometry/GeometryGenPrefGroupUI.py b/appGUI/preferences/geometry/GeometryGenPrefGroupUI.py index 88066350..9c4dd072 100644 --- a/appGUI/preferences/geometry/GeometryGenPrefGroupUI.py +++ b/appGUI/preferences/geometry/GeometryGenPrefGroupUI.py @@ -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 diff --git a/requirements.txt b/requirements.txt index 141b8014..aeedc4a0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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 @@ -30,5 +35,4 @@ pikepdf>=2.0 pyqt6>=6.1.0 vispy>=0.9.0 rasterio -foronoi>=1.0.3 -networkx \ No newline at end of file +foronoi>=1.0.3 \ No newline at end of file diff --git a/setup_ubuntu.sh b/setup_ubuntu.sh index 4d1710b3..8c2a9e10 100644 --- a/setup_ubuntu.sh +++ b/setup_ubuntu.sh @@ -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 +# ################################