Only use IconViewProvider in PathStock when required.
This commit is contained in:
@@ -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'
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user