- added fix such that the application will work without having the ortools package installed: TSA and RTree algorithms will be automatically used in that case
This commit is contained in:
committed by
Marius Stanciu
parent
57004cf948
commit
9761e8a4d1
@@ -10,6 +10,7 @@ CHANGELOG for FlatCAM beta
|
|||||||
17.11.2021
|
17.11.2021
|
||||||
|
|
||||||
- fixed an issue when using Python 3.10, in GUI elements
|
- fixed an issue when using Python 3.10, in GUI elements
|
||||||
|
- added fix such that the application will work without having the ortools package installed: TSA and RTree algorithms will be automatically used in that case
|
||||||
|
|
||||||
10.11.2021
|
10.11.2021
|
||||||
|
|
||||||
|
|||||||
20
camlib.py
20
camlib.py
@@ -7,7 +7,7 @@
|
|||||||
# ########################################################## ##
|
# ########################################################## ##
|
||||||
|
|
||||||
|
|
||||||
from PyQt6 import QtWidgets, QtCore
|
from PyQt6 import QtWidgets
|
||||||
from io import StringIO
|
from io import StringIO
|
||||||
|
|
||||||
from numpy.linalg import solve, norm
|
from numpy.linalg import solve, norm
|
||||||
@@ -53,9 +53,14 @@ from appCommon.Common import GracefulException as grace
|
|||||||
from appParsers.ParseSVG import *
|
from appParsers.ParseSVG import *
|
||||||
from appParsers.ParseDXF import *
|
from appParsers.ParseDXF import *
|
||||||
|
|
||||||
|
HAS_ORTOOLS = True
|
||||||
|
|
||||||
if platform.architecture()[0] == '64bit':
|
if platform.architecture()[0] == '64bit':
|
||||||
from ortools.constraint_solver import pywrapcp
|
try:
|
||||||
from ortools.constraint_solver import routing_enums_pb2
|
from ortools.constraint_solver import pywrapcp
|
||||||
|
from ortools.constraint_solver import routing_enums_pb2
|
||||||
|
except ModuleNotFoundError:
|
||||||
|
HAS_ORTOOLS = False
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
@@ -3362,6 +3367,9 @@ class CNCjob(Geometry):
|
|||||||
locations = []
|
locations = []
|
||||||
optimized_path = []
|
optimized_path = []
|
||||||
|
|
||||||
|
if not HAS_ORTOOLS:
|
||||||
|
opt_type = 'T'
|
||||||
|
|
||||||
if opt_type == 'M':
|
if opt_type == 'M':
|
||||||
locations = self.create_tool_data_array(points=points)
|
locations = self.create_tool_data_array(points=points)
|
||||||
# if there are no locations then go to the next tool
|
# if there are no locations then go to the next tool
|
||||||
@@ -3607,6 +3615,9 @@ class CNCjob(Geometry):
|
|||||||
|
|
||||||
# Optimization type. Can be: 'M', 'B', 'T', 'R', 'No'
|
# Optimization type. Can be: 'M', 'B', 'T', 'R', 'No'
|
||||||
opt_type = tool_dict['tools_mill_optimization_type']
|
opt_type = tool_dict['tools_mill_optimization_type']
|
||||||
|
if not HAS_ORTOOLS:
|
||||||
|
opt_type = 'R'
|
||||||
|
|
||||||
opt_time = tool_dict['tools_mill_search_time'] if 'tools_mill_search_time' in tool_dict else 'R'
|
opt_time = tool_dict['tools_mill_search_time'] if 'tools_mill_search_time' in tool_dict else 'R'
|
||||||
|
|
||||||
if opt_type == 'M':
|
if opt_type == 'M':
|
||||||
@@ -4197,6 +4208,9 @@ class CNCjob(Geometry):
|
|||||||
else:
|
else:
|
||||||
used_excellon_optimization_type = 'T'
|
used_excellon_optimization_type = 'T'
|
||||||
|
|
||||||
|
if not HAS_ORTOOLS:
|
||||||
|
used_excellon_optimization_type = 'T'
|
||||||
|
|
||||||
# #############################################################################################################
|
# #############################################################################################################
|
||||||
# #############################################################################################################
|
# #############################################################################################################
|
||||||
# ################################## DRILLING !!! #########################################################
|
# ################################## DRILLING !!! #########################################################
|
||||||
|
|||||||
Reference in New Issue
Block a user