From abca623803e6a0cf8fe5f0875075ecd73bb547ae Mon Sep 17 00:00:00 2001 From: Markus Lampert Date: Mon, 15 Feb 2021 12:21:33 -0800 Subject: [PATCH] Only use IconViewProvider in PathStock when required. --- src/Mod/Path/PathScripts/PathStock.py | 4 ++-- src/Mod/Path/PathTests/TestPathDepthParams.py | 20 +++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/Mod/Path/PathScripts/PathStock.py b/src/Mod/Path/PathScripts/PathStock.py index 93bc5e8a28..17d66d42d7 100644 --- a/src/Mod/Path/PathScripts/PathStock.py +++ b/src/Mod/Path/PathScripts/PathStock.py @@ -23,7 +23,6 @@ '''Used to create material stock around a machined part - for visualization''' import FreeCAD -import PathScripts.PathIconViewProvider as PathIconViewProvider import PathScripts.PathLog as PathLog import math @@ -227,7 +226,8 @@ def SetupStockObject(obj, stockType): obj.StockType = stockType obj.setEditorMode('StockType', 2) # hide - PathIconViewProvider.ViewProvider(obj.ViewObject, 'Stock') + import PathScripts.PathIconViewProvider + PathScripts.PathIconViewProvider.ViewProvider(obj.ViewObject, 'Stock') obj.ViewObject.Transparency = 90 obj.ViewObject.DisplayMode = 'Wireframe' diff --git a/src/Mod/Path/PathTests/TestPathDepthParams.py b/src/Mod/Path/PathTests/TestPathDepthParams.py index 313fd9de78..3dfa419e7f 100644 --- a/src/Mod/Path/PathTests/TestPathDepthParams.py +++ b/src/Mod/Path/PathTests/TestPathDepthParams.py @@ -20,7 +20,7 @@ # * * # *************************************************************************** -import PathScripts.PathUtils as PU +import PathScripts.PathUtils as PathUtils import unittest @@ -38,7 +38,7 @@ class depthTestCases(unittest.TestCase): expected =[8,6,4,2,1,0] - d = PU.depth_params(clearance_height, safe_height, start_depth, step_down, z_finish_step, final_depth, user_depths) + d = PathUtils.depth_params(clearance_height, safe_height, start_depth, step_down, z_finish_step, final_depth, user_depths) r = [i for i in d] self.assertListEqual (r, expected) @@ -56,7 +56,7 @@ class depthTestCases(unittest.TestCase): expected =[-2, -4, -6, -8, -10] - d = PU.depth_params(clearance_height, safe_height, start_depth, step_down, z_finish_step, final_depth, user_depths) + d = PathUtils.depth_params(clearance_height, safe_height, start_depth, step_down, z_finish_step, final_depth, user_depths) r = [i for i in d] self.assertListEqual (r, expected) @@ -73,7 +73,7 @@ class depthTestCases(unittest.TestCase): expected =[10] - d = PU.depth_params(clearance_height, safe_height, start_depth, step_down, z_finish_step, final_depth, user_depths) + d = PathUtils.depth_params(clearance_height, safe_height, start_depth, step_down, z_finish_step, final_depth, user_depths) r = [i for i in d] self.assertListEqual (r, expected) @@ -82,7 +82,7 @@ class depthTestCases(unittest.TestCase): expected =[] - d = PU.depth_params(clearance_height, safe_height, start_depth, step_down, z_finish_step, final_depth, user_depths) + d = PathUtils.depth_params(clearance_height, safe_height, start_depth, step_down, z_finish_step, final_depth, user_depths) r = [i for i in d] self.assertListEqual (r, expected) @@ -99,7 +99,7 @@ class depthTestCases(unittest.TestCase): expected =[2, 4, 8, 10, 11, 12] - d = PU.depth_params(clearance_height, safe_height, start_depth, step_down, z_finish_step, final_depth, user_depths) + d = PathUtils.depth_params(clearance_height, safe_height, start_depth, step_down, z_finish_step, final_depth, user_depths) r = [i for i in d] self.assertListEqual (r, expected) @@ -116,7 +116,7 @@ class depthTestCases(unittest.TestCase): expected =[-2, -4, -6, -8, -9, -10] - d = PU.depth_params(clearance_height, safe_height, start_depth, step_down, z_finish_step, final_depth, user_depths) + d = PathUtils.depth_params(clearance_height, safe_height, start_depth, step_down, z_finish_step, final_depth, user_depths) r = [i for i in d] self.assertListEqual (r, expected) @@ -134,7 +134,7 @@ class depthTestCases(unittest.TestCase): expected =[7.5, 5.0, 2.5, 0] - d = PU.depth_params(clearance_height, safe_height, start_depth, step_down, z_finish_step, final_depth, user_depths, equalstep=True) + d = PathUtils.depth_params(clearance_height, safe_height, start_depth, step_down, z_finish_step, final_depth, user_depths, equalstep=True) r = [i for i in d] self.assertListEqual (r, expected) @@ -152,7 +152,7 @@ class depthTestCases(unittest.TestCase): expected =[7.0, 4.0, 1.0, 0] - d = PU.depth_params(clearance_height, safe_height, start_depth, step_down, z_finish_step, final_depth, user_depths, equalstep=True) + d = PathUtils.depth_params(clearance_height, safe_height, start_depth, step_down, z_finish_step, final_depth, user_depths, equalstep=True) r = [i for i in d] self.assertListEqual (r, expected) @@ -169,7 +169,7 @@ class depthTestCases(unittest.TestCase): expected =[1.0, 0] - d = PU.depth_params(clearance_height, safe_height, start_depth, step_down, z_finish_step, final_depth, user_depths) + d = PathUtils.depth_params(clearance_height, safe_height, start_depth, step_down, z_finish_step, final_depth, user_depths) r = [i for i in d] self.assertListEqual (r, expected)