Merge pull request #2499 from dubstar-04/feature/tooltable
[Path] Enable Tool Duplication and Moving
This commit is contained in:
@@ -103,6 +103,7 @@ SET(PathScripts_SRCS
|
||||
PathScripts/PathToolControllerGui.py
|
||||
PathScripts/PathToolEdit.py
|
||||
PathScripts/PathToolLibraryManager.py
|
||||
PathScripts/PathToolLibraryEditor.py
|
||||
PathScripts/PathUtil.py
|
||||
PathScripts/PathUtils.py
|
||||
PathScripts/PathUtilsGui.py
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
<file>icons/Path-Stop.svg</file>
|
||||
<file>icons/Path-ToolChange.svg</file>
|
||||
<file>icons/Path-ToolController.svg</file>
|
||||
<file>icons/Path-ToolDuplicate.svg</file>
|
||||
<file>icons/Path-Toolpath.svg</file>
|
||||
<file>icons/Path-ToolTable.svg</file>
|
||||
<file>icons/Path-Area.svg</file>
|
||||
|
||||
856
src/Mod/Path/Gui/Resources/icons/Path-ToolDuplicate.svg
Normal file
856
src/Mod/Path/Gui/Resources/icons/Path-ToolDuplicate.svg
Normal file
@@ -0,0 +1,856 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="64px"
|
||||
height="64px"
|
||||
id="svg2816"
|
||||
version="1.1"
|
||||
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
|
||||
sodipodi:docname="Path-ToolDuplicate.svg">
|
||||
<defs
|
||||
id="defs2818">
|
||||
<linearGradient
|
||||
id="linearGradient3136">
|
||||
<stop
|
||||
style="stop-color:#ef2929;stop-opacity:1"
|
||||
offset="0"
|
||||
id="stop3138" />
|
||||
<stop
|
||||
style="stop-color:#a40000;stop-opacity:1"
|
||||
offset="1"
|
||||
id="stop3140" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient4218">
|
||||
<stop
|
||||
id="stop4220"
|
||||
offset="0"
|
||||
style="stop-color:#fb0000;stop-opacity:1" />
|
||||
<stop
|
||||
id="stop4222"
|
||||
offset="1"
|
||||
style="stop-color:#570000;stop-opacity:1" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient4513">
|
||||
<stop
|
||||
style="stop-color:#ffffff;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop4515" />
|
||||
<stop
|
||||
style="stop-color:#999999;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop4517" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient3681">
|
||||
<stop
|
||||
id="stop3697"
|
||||
offset="0"
|
||||
style="stop-color:#fff110;stop-opacity:1;" />
|
||||
<stop
|
||||
style="stop-color:#cf7008;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop3685" />
|
||||
</linearGradient>
|
||||
<inkscape:perspective
|
||||
sodipodi:type="inkscape:persp3d"
|
||||
inkscape:vp_x="0 : 32 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_z="64 : 32 : 1"
|
||||
inkscape:persp3d-origin="32 : 21.333333 : 1"
|
||||
id="perspective2824" />
|
||||
<inkscape:perspective
|
||||
id="perspective3622"
|
||||
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||
inkscape:vp_z="1 : 0.5 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_x="0 : 0.5 : 1"
|
||||
sodipodi:type="inkscape:persp3d" />
|
||||
<inkscape:perspective
|
||||
id="perspective3622-9"
|
||||
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||
inkscape:vp_z="1 : 0.5 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_x="0 : 0.5 : 1"
|
||||
sodipodi:type="inkscape:persp3d" />
|
||||
<inkscape:perspective
|
||||
id="perspective3653"
|
||||
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||
inkscape:vp_z="1 : 0.5 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_x="0 : 0.5 : 1"
|
||||
sodipodi:type="inkscape:persp3d" />
|
||||
<inkscape:perspective
|
||||
id="perspective3675"
|
||||
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||
inkscape:vp_z="1 : 0.5 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_x="0 : 0.5 : 1"
|
||||
sodipodi:type="inkscape:persp3d" />
|
||||
<inkscape:perspective
|
||||
id="perspective3697"
|
||||
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||
inkscape:vp_z="1 : 0.5 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_x="0 : 0.5 : 1"
|
||||
sodipodi:type="inkscape:persp3d" />
|
||||
<inkscape:perspective
|
||||
id="perspective3720"
|
||||
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||
inkscape:vp_z="1 : 0.5 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_x="0 : 0.5 : 1"
|
||||
sodipodi:type="inkscape:persp3d" />
|
||||
<inkscape:perspective
|
||||
id="perspective3742"
|
||||
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||
inkscape:vp_z="1 : 0.5 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_x="0 : 0.5 : 1"
|
||||
sodipodi:type="inkscape:persp3d" />
|
||||
<inkscape:perspective
|
||||
id="perspective3764"
|
||||
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||
inkscape:vp_z="1 : 0.5 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_x="0 : 0.5 : 1"
|
||||
sodipodi:type="inkscape:persp3d" />
|
||||
<inkscape:perspective
|
||||
id="perspective3785"
|
||||
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||
inkscape:vp_z="1 : 0.5 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_x="0 : 0.5 : 1"
|
||||
sodipodi:type="inkscape:persp3d" />
|
||||
<inkscape:perspective
|
||||
id="perspective3806"
|
||||
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||
inkscape:vp_z="1 : 0.5 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_x="0 : 0.5 : 1"
|
||||
sodipodi:type="inkscape:persp3d" />
|
||||
<inkscape:perspective
|
||||
id="perspective3806-3"
|
||||
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||
inkscape:vp_z="1 : 0.5 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_x="0 : 0.5 : 1"
|
||||
sodipodi:type="inkscape:persp3d" />
|
||||
<inkscape:perspective
|
||||
id="perspective3835"
|
||||
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||
inkscape:vp_z="1 : 0.5 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_x="0 : 0.5 : 1"
|
||||
sodipodi:type="inkscape:persp3d" />
|
||||
<inkscape:perspective
|
||||
id="perspective3614"
|
||||
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||
inkscape:vp_z="1 : 0.5 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_x="0 : 0.5 : 1"
|
||||
sodipodi:type="inkscape:persp3d" />
|
||||
<inkscape:perspective
|
||||
id="perspective3614-8"
|
||||
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||
inkscape:vp_z="1 : 0.5 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_x="0 : 0.5 : 1"
|
||||
sodipodi:type="inkscape:persp3d" />
|
||||
<inkscape:perspective
|
||||
id="perspective3643"
|
||||
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||
inkscape:vp_z="1 : 0.5 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_x="0 : 0.5 : 1"
|
||||
sodipodi:type="inkscape:persp3d" />
|
||||
<inkscape:perspective
|
||||
id="perspective3643-3"
|
||||
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||
inkscape:vp_z="1 : 0.5 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_x="0 : 0.5 : 1"
|
||||
sodipodi:type="inkscape:persp3d" />
|
||||
<inkscape:perspective
|
||||
id="perspective3672"
|
||||
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||
inkscape:vp_z="1 : 0.5 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_x="0 : 0.5 : 1"
|
||||
sodipodi:type="inkscape:persp3d" />
|
||||
<inkscape:perspective
|
||||
id="perspective3672-5"
|
||||
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||
inkscape:vp_z="1 : 0.5 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_x="0 : 0.5 : 1"
|
||||
sodipodi:type="inkscape:persp3d" />
|
||||
<inkscape:perspective
|
||||
id="perspective3701"
|
||||
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||
inkscape:vp_z="1 : 0.5 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_x="0 : 0.5 : 1"
|
||||
sodipodi:type="inkscape:persp3d" />
|
||||
<inkscape:perspective
|
||||
id="perspective3701-8"
|
||||
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||
inkscape:vp_z="1 : 0.5 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_x="0 : 0.5 : 1"
|
||||
sodipodi:type="inkscape:persp3d" />
|
||||
<inkscape:perspective
|
||||
id="perspective3746"
|
||||
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||
inkscape:vp_z="1 : 0.5 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_x="0 : 0.5 : 1"
|
||||
sodipodi:type="inkscape:persp3d" />
|
||||
<pattern
|
||||
patternTransform="matrix(0.67643728,-0.81829155,2.4578314,1.8844554,-26.450606,18.294947)"
|
||||
id="pattern5231"
|
||||
xlink:href="#Strips1_1-4"
|
||||
inkscape:collect="always" />
|
||||
<inkscape:perspective
|
||||
id="perspective5224"
|
||||
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||
inkscape:vp_z="1 : 0.5 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_x="0 : 0.5 : 1"
|
||||
sodipodi:type="inkscape:persp3d" />
|
||||
<pattern
|
||||
inkscape:stockid="Stripes 1:1"
|
||||
id="Strips1_1-4"
|
||||
patternTransform="matrix(0.66772843,-1.0037085,2.4261878,2.3114548,3.4760987,3.534923)"
|
||||
height="1"
|
||||
width="2"
|
||||
patternUnits="userSpaceOnUse"
|
||||
inkscape:collect="always">
|
||||
<rect
|
||||
id="rect4483-4"
|
||||
height="2"
|
||||
width="1"
|
||||
y="-0.5"
|
||||
x="0"
|
||||
style="fill:black;stroke:none" />
|
||||
</pattern>
|
||||
<inkscape:perspective
|
||||
id="perspective5224-9"
|
||||
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||
inkscape:vp_z="1 : 0.5 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_x="0 : 0.5 : 1"
|
||||
sodipodi:type="inkscape:persp3d" />
|
||||
<pattern
|
||||
patternTransform="matrix(0.66772843,-1.0037085,2.4261878,2.3114548,39.618381,8.9692804)"
|
||||
id="pattern5231-4"
|
||||
xlink:href="#Strips1_1-6"
|
||||
inkscape:collect="always" />
|
||||
<inkscape:perspective
|
||||
id="perspective5224-3"
|
||||
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||
inkscape:vp_z="1 : 0.5 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_x="0 : 0.5 : 1"
|
||||
sodipodi:type="inkscape:persp3d" />
|
||||
<pattern
|
||||
inkscape:stockid="Stripes 1:1"
|
||||
id="Strips1_1-6"
|
||||
patternTransform="matrix(0.66772843,-1.0037085,2.4261878,2.3114548,3.4760987,3.534923)"
|
||||
height="1"
|
||||
width="2"
|
||||
patternUnits="userSpaceOnUse"
|
||||
inkscape:collect="always">
|
||||
<rect
|
||||
id="rect4483-0"
|
||||
height="2"
|
||||
width="1"
|
||||
y="-0.5"
|
||||
x="0"
|
||||
style="fill:black;stroke:none" />
|
||||
</pattern>
|
||||
<pattern
|
||||
patternTransform="matrix(0.66513382,-1.0631299,2.4167603,2.4482973,-49.762569,2.9546807)"
|
||||
id="pattern5296"
|
||||
xlink:href="#pattern5231-3"
|
||||
inkscape:collect="always" />
|
||||
<inkscape:perspective
|
||||
id="perspective5288"
|
||||
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||
inkscape:vp_z="1 : 0.5 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_x="0 : 0.5 : 1"
|
||||
sodipodi:type="inkscape:persp3d" />
|
||||
<pattern
|
||||
patternTransform="matrix(0.66772843,-1.0037085,2.4261878,2.3114548,-26.336284,10.887197)"
|
||||
id="pattern5231-3"
|
||||
xlink:href="#Strips1_1-4-3"
|
||||
inkscape:collect="always" />
|
||||
<pattern
|
||||
inkscape:stockid="Stripes 1:1"
|
||||
id="Strips1_1-4-3"
|
||||
patternTransform="matrix(0.66772843,-1.0037085,2.4261878,2.3114548,3.4760987,3.534923)"
|
||||
height="1"
|
||||
width="2"
|
||||
patternUnits="userSpaceOnUse"
|
||||
inkscape:collect="always">
|
||||
<rect
|
||||
id="rect4483-4-6"
|
||||
height="2"
|
||||
width="1"
|
||||
y="-0.5"
|
||||
x="0"
|
||||
style="fill:black;stroke:none" />
|
||||
</pattern>
|
||||
<pattern
|
||||
patternTransform="matrix(0.42844886,-0.62155849,1.5567667,1.431396,27.948414,13.306456)"
|
||||
id="pattern5330"
|
||||
xlink:href="#Strips1_1-9"
|
||||
inkscape:collect="always" />
|
||||
<inkscape:perspective
|
||||
id="perspective5323"
|
||||
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||
inkscape:vp_z="1 : 0.5 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_x="0 : 0.5 : 1"
|
||||
sodipodi:type="inkscape:persp3d" />
|
||||
<pattern
|
||||
inkscape:stockid="Stripes 1:1"
|
||||
id="Strips1_1-9"
|
||||
patternTransform="matrix(0.66772843,-1.0037085,2.4261878,2.3114548,3.4760987,3.534923)"
|
||||
height="1"
|
||||
width="2"
|
||||
patternUnits="userSpaceOnUse"
|
||||
inkscape:collect="always">
|
||||
<rect
|
||||
id="rect4483-3"
|
||||
height="2"
|
||||
width="1"
|
||||
y="-0.5"
|
||||
x="0"
|
||||
style="fill:black;stroke:none" />
|
||||
</pattern>
|
||||
<inkscape:perspective
|
||||
id="perspective5361"
|
||||
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||
inkscape:vp_z="1 : 0.5 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_x="0 : 0.5 : 1"
|
||||
sodipodi:type="inkscape:persp3d" />
|
||||
<inkscape:perspective
|
||||
id="perspective5383"
|
||||
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||
inkscape:vp_z="1 : 0.5 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_x="0 : 0.5 : 1"
|
||||
sodipodi:type="inkscape:persp3d" />
|
||||
<inkscape:perspective
|
||||
id="perspective5411"
|
||||
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||
inkscape:vp_z="1 : 0.5 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_x="0 : 0.5 : 1"
|
||||
sodipodi:type="inkscape:persp3d" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3681"
|
||||
id="linearGradient3687"
|
||||
x1="37.89756"
|
||||
y1="41.087898"
|
||||
x2="4.0605712"
|
||||
y2="40.168594"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(127.27273,-51.272729)" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3681"
|
||||
id="linearGradient3695"
|
||||
x1="37.894287"
|
||||
y1="40.484772"
|
||||
x2="59.811455"
|
||||
y2="43.558987"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(127.27273,-51.272729)" />
|
||||
<linearGradient
|
||||
id="linearGradient3681-3">
|
||||
<stop
|
||||
id="stop3697-3"
|
||||
offset="0"
|
||||
style="stop-color:#fff110;stop-opacity:1;" />
|
||||
<stop
|
||||
style="stop-color:#cf7008;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop3685-4" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
y2="43.558987"
|
||||
x2="59.811455"
|
||||
y1="40.484772"
|
||||
x1="37.894287"
|
||||
gradientTransform="translate(-37.00068,-20.487365)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="linearGradient3608"
|
||||
xlink:href="#linearGradient3681-3"
|
||||
inkscape:collect="always" />
|
||||
<linearGradient
|
||||
id="linearGradient4513-2">
|
||||
<stop
|
||||
style="stop-color:#ffffff;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop4515-2" />
|
||||
<stop
|
||||
style="stop-color:#999999;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop4517-4" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
r="23.634638"
|
||||
fy="7.9319997"
|
||||
fx="32.151962"
|
||||
cy="7.9319997"
|
||||
cx="32.151962"
|
||||
gradientTransform="matrix(1,0,0,1.1841158,-8.5173246,-3.4097568)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="radialGradient4538"
|
||||
xlink:href="#linearGradient4513-2"
|
||||
inkscape:collect="always" />
|
||||
<linearGradient
|
||||
id="linearGradient4513-1">
|
||||
<stop
|
||||
style="stop-color:#ffffff;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop4515-8" />
|
||||
<stop
|
||||
style="stop-color:#999999;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop4517-6" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
r="23.634638"
|
||||
fy="7.9319997"
|
||||
fx="32.151962"
|
||||
cy="7.9319997"
|
||||
cx="32.151962"
|
||||
gradientTransform="matrix(1,0,0,1.1841158,-8.5173246,-3.4097568)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="radialGradient4538-6"
|
||||
xlink:href="#linearGradient4513-1"
|
||||
inkscape:collect="always" />
|
||||
<linearGradient
|
||||
id="linearGradient4513-1-3">
|
||||
<stop
|
||||
style="stop-color:#ffffff;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop4515-8-7" />
|
||||
<stop
|
||||
style="stop-color:#999999;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop4517-6-5" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
r="23.634638"
|
||||
fy="35.869175"
|
||||
fx="32.151962"
|
||||
cy="35.869175"
|
||||
cx="32.151962"
|
||||
gradientTransform="matrix(0.39497909,0,0,1.1841158,-2.716491,-26.067007)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="radialGradient3069"
|
||||
xlink:href="#linearGradient4513-1-3"
|
||||
inkscape:collect="always" />
|
||||
<linearGradient
|
||||
id="linearGradient4513-1-2">
|
||||
<stop
|
||||
style="stop-color:#ffffff;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop4515-8-6" />
|
||||
<stop
|
||||
style="stop-color:#999999;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop4517-6-6" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
r="23.634638"
|
||||
fy="35.869175"
|
||||
fx="32.151962"
|
||||
cy="35.869175"
|
||||
cx="32.151962"
|
||||
gradientTransform="matrix(0.39497909,0,0,1.1841158,-2.716491,-26.067007)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="radialGradient3102"
|
||||
xlink:href="#linearGradient4513-1-2"
|
||||
inkscape:collect="always" />
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4513-1"
|
||||
id="radialGradient3132"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.39497909,0,0,1.1841158,32.603233,-2.4523784)"
|
||||
cx="32.151962"
|
||||
cy="27.950663"
|
||||
fx="32.151962"
|
||||
fy="27.950663"
|
||||
r="23.634638" />
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4513-1-27"
|
||||
id="radialGradient3132-0"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.39497909,0,0,1.1841158,38.088973,2.175957)"
|
||||
cx="32.151962"
|
||||
cy="27.950663"
|
||||
fx="32.151962"
|
||||
fy="27.950663"
|
||||
r="23.634638" />
|
||||
<linearGradient
|
||||
id="linearGradient4513-1-27">
|
||||
<stop
|
||||
style="stop-color:#ffffff;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop4515-8-1" />
|
||||
<stop
|
||||
style="stop-color:#999999;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop4517-6-0" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4513-1-5"
|
||||
id="radialGradient3132-02"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.39497909,0,0,1.1841158,38.088973,2.175957)"
|
||||
cx="32.151962"
|
||||
cy="27.950663"
|
||||
fx="32.151962"
|
||||
fy="27.950663"
|
||||
r="23.634638" />
|
||||
<linearGradient
|
||||
id="linearGradient4513-1-5">
|
||||
<stop
|
||||
style="stop-color:#ffffff;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop4515-8-10" />
|
||||
<stop
|
||||
style="stop-color:#999999;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop4517-6-1" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
r="23.634638"
|
||||
fy="27.950663"
|
||||
fx="32.151962"
|
||||
cy="27.950663"
|
||||
cx="32.151962"
|
||||
gradientTransform="matrix(0.39497909,0,0,1.1841158,5.9076929,-2.181546)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="radialGradient3101-6"
|
||||
xlink:href="#linearGradient4218"
|
||||
inkscape:collect="always" />
|
||||
<linearGradient
|
||||
gradientTransform="translate(56,-4)"
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3989"
|
||||
id="linearGradient3987"
|
||||
x1="31"
|
||||
y1="15"
|
||||
x2="33"
|
||||
y2="23"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
id="linearGradient3989">
|
||||
<stop
|
||||
id="stop3991"
|
||||
offset="0"
|
||||
style="stop-color:#d3d7cf;stop-opacity:1" />
|
||||
<stop
|
||||
id="stop3993"
|
||||
offset="1"
|
||||
style="stop-color:#888a85;stop-opacity:1" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4031"
|
||||
id="linearGradient4029"
|
||||
x1="27.909092"
|
||||
y1="27.90909"
|
||||
x2="36"
|
||||
y2="54.227272"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
id="linearGradient4031">
|
||||
<stop
|
||||
id="stop4033"
|
||||
offset="0"
|
||||
style="stop-color:#d3d7cf;stop-opacity:1" />
|
||||
<stop
|
||||
id="stop4035"
|
||||
offset="1"
|
||||
style="stop-color:#888a85;stop-opacity:1" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
gradientTransform="translate(87.999998,-1)"
|
||||
y2="54.227272"
|
||||
x2="36"
|
||||
y1="10"
|
||||
x1="30.000002"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="linearGradient4177-6"
|
||||
xlink:href="#linearGradient4031-7"
|
||||
inkscape:collect="always" />
|
||||
<linearGradient
|
||||
id="linearGradient4031-7">
|
||||
<stop
|
||||
id="stop4033-5"
|
||||
offset="0"
|
||||
style="stop-color:#d3d7cf;stop-opacity:1" />
|
||||
<stop
|
||||
id="stop4035-3"
|
||||
offset="1"
|
||||
style="stop-color:#888a85;stop-opacity:1" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3898-8-9"
|
||||
id="linearGradient3147"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="35.05999"
|
||||
y1="53.008698"
|
||||
x2="27.286415"
|
||||
y2="7.311924" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
id="linearGradient3898-8-9">
|
||||
<stop
|
||||
style="stop-color:#888a85;stop-opacity:1"
|
||||
offset="0"
|
||||
id="stop3900-2-2" />
|
||||
<stop
|
||||
style="stop-color:#d3d7cf;stop-opacity:1"
|
||||
offset="1"
|
||||
id="stop3902-4-7" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3898-8-9"
|
||||
id="linearGradient3143"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="35.05999"
|
||||
y1="53.008698"
|
||||
x2="27.286415"
|
||||
y2="7.311924" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3898-8-9"
|
||||
id="linearGradient3145"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="35.05999"
|
||||
y1="53.008698"
|
||||
x2="27.286415"
|
||||
y2="7.311924" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3898-8-9"
|
||||
id="linearGradient4715"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="35.05999"
|
||||
y1="53.008698"
|
||||
x2="27.286415"
|
||||
y2="7.311924" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3898-8-9"
|
||||
id="linearGradient4717"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="35.05999"
|
||||
y1="53.008698"
|
||||
x2="27.286415"
|
||||
y2="7.311924" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3898-8-9"
|
||||
id="linearGradient4719"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="35.05999"
|
||||
y1="53.008698"
|
||||
x2="27.286415"
|
||||
y2="7.311924" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3898-8-9"
|
||||
id="linearGradient4732"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="35.05999"
|
||||
y1="53.008698"
|
||||
x2="27.286415"
|
||||
y2="7.311924" />
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="15.556349"
|
||||
inkscape:cx="32.327322"
|
||||
inkscape:cy="30.689935"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="true"
|
||||
inkscape:document-units="px"
|
||||
inkscape:grid-bbox="true"
|
||||
inkscape:snap-bbox="true"
|
||||
inkscape:bbox-paths="true"
|
||||
inkscape:bbox-nodes="true"
|
||||
inkscape:snap-bbox-edge-midpoints="true"
|
||||
inkscape:snap-bbox-midpoints="true"
|
||||
inkscape:object-paths="true"
|
||||
inkscape:object-nodes="true"
|
||||
inkscape:window-width="2498"
|
||||
inkscape:window-height="1376"
|
||||
inkscape:window-x="62"
|
||||
inkscape:window-y="27"
|
||||
inkscape:window-maximized="1">
|
||||
<inkscape:grid
|
||||
type="xygrid"
|
||||
id="grid3068"
|
||||
empspacing="2"
|
||||
visible="true"
|
||||
enabled="true"
|
||||
snapvisiblegridlinesonly="true" />
|
||||
</sodipodi:namedview>
|
||||
<metadata
|
||||
id="metadata2821">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title />
|
||||
<dc:title>Path-ToolChange</dc:title>
|
||||
<dc:date>2016-01-20</dc:date>
|
||||
<dc:relation>http://www.freecadweb.org/wiki/index.php?title=Artwork</dc:relation>
|
||||
<dc:publisher>
|
||||
<cc:Agent>
|
||||
<dc:title>FreeCAD</dc:title>
|
||||
</cc:Agent>
|
||||
</dc:publisher>
|
||||
<dc:identifier>FreeCAD/src/Mod/Path/Gui/Resources/icons/Path-ToolChange.svg</dc:identifier>
|
||||
<dc:rights>
|
||||
<cc:Agent>
|
||||
<dc:title>FreeCAD LGPL2+</dc:title>
|
||||
</cc:Agent>
|
||||
</dc:rights>
|
||||
<cc:license>https://www.gnu.org/copyleft/lesser.html</cc:license>
|
||||
<dc:contributor>
|
||||
<cc:Agent>
|
||||
<dc:title>[agryson] Alexander Gryson</dc:title>
|
||||
</cc:Agent>
|
||||
</dc:contributor>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
id="layer1"
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer">
|
||||
<g
|
||||
id="g3908-1-4-8"
|
||||
transform="matrix(1.2383679,0,0,1,-73.54617,-2)">
|
||||
<g
|
||||
id="g3135-8"
|
||||
style="stroke:#280000" />
|
||||
</g>
|
||||
<g
|
||||
id="g3908-1-4-7"
|
||||
transform="matrix(1.0540179,0,0,0.85113471,-56.974936,-4.0853847)"
|
||||
style="opacity:0.6">
|
||||
<g
|
||||
id="g3135-5"
|
||||
style="">
|
||||
<g
|
||||
transform="matrix(0.78612717,0,0,1,48.768786,3)"
|
||||
id="g3859-7-3-3"
|
||||
style="">
|
||||
<g
|
||||
id="g3126-1-1-5"
|
||||
style="fill:url(#linearGradient4719);fill-opacity:1">
|
||||
<path
|
||||
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:url(#linearGradient4732);fill-opacity:1;fill-rule:nonzero;stroke:#2e3436;stroke-width:2.02702332;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate"
|
||||
d="m 22.755149,28 v 9 l 18.489706,-8 v -9 z m 18.489706,3 -18.489706,8 v 9 l 18.489706,-8 z m 0,11 L 22.755149,50 32,56 41.244855,50 Z"
|
||||
id="rect4417-1-2-6"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="ccccccccccccccc" />
|
||||
<path
|
||||
style="fill:url(#linearGradient4717);fill-opacity:1;stroke:#2e3436;stroke-width:2.02702332;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1"
|
||||
d="M 22.755149,26 V 6 h 18.489706 v 12 z"
|
||||
id="path3085-5-3-2"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="ccccc" />
|
||||
</g>
|
||||
<path
|
||||
sodipodi:nodetypes="ccccccccccccccc"
|
||||
inkscape:connector-curvature="0"
|
||||
id="rect4417-1-4-2-3-9"
|
||||
d="m 24.826699,29.299103 0.02839,4.492034 14.320401,-6.092914 0.02324,-4.645526 z m 14.361546,4.789285 -14.374245,6.229006 0.01513,4.5902 14.389879,-6.224988 z m -0.01949,10.999765 -12.158366,5.23507 4.97403,3.277297 7.174659,-4.659288 z"
|
||||
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:none;stroke:#d3d7cf;stroke-width:2.02702332;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate" />
|
||||
</g>
|
||||
<path
|
||||
style="fill:none;stroke:#d3d7cf;stroke-width:1.7972362;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="m 68.272256,11 0.014,14.948166 L 79.576261,19.762958 79.577458,11 Z"
|
||||
id="path3906-7-4-1"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="ccccc" />
|
||||
</g>
|
||||
</g>
|
||||
<g
|
||||
id="g3908-1-4"
|
||||
transform="matrix(1.3640232,0,0,1.1014685,-63.83522,-4.4499183)">
|
||||
<g
|
||||
id="g3135">
|
||||
<g
|
||||
transform="matrix(0.78612717,0,0,1,48.768786,3)"
|
||||
id="g3859-7-3">
|
||||
<g
|
||||
id="g3126-1-1"
|
||||
style="fill:url(#linearGradient3147);fill-opacity:1">
|
||||
<path
|
||||
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:url(#linearGradient3143);fill-opacity:1;fill-rule:nonzero;stroke:#2e3436;stroke-width:2.02702332;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate"
|
||||
d="m 22.755149,28 v 9 l 18.489706,-8 v -9 z m 18.489706,3 -18.489706,8 v 9 l 18.489706,-8 z m 0,11 L 22.755149,50 32,56 41.244855,50 Z"
|
||||
id="rect4417-1-2"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="ccccccccccccccc" />
|
||||
<path
|
||||
style="fill:url(#linearGradient3145);fill-opacity:1;stroke:#2e3436;stroke-width:2.02702332;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1"
|
||||
d="M 22.755149,26 V 6 h 18.489706 v 12 z"
|
||||
id="path3085-5-3"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="ccccc" />
|
||||
</g>
|
||||
<path
|
||||
sodipodi:nodetypes="ccccccccccccccc"
|
||||
inkscape:connector-curvature="0"
|
||||
id="rect4417-1-4-2-3"
|
||||
d="m 24.826699,29.299103 0.02839,4.492034 14.320401,-6.092914 0.02324,-4.645526 z m 14.361546,4.789285 -14.374245,6.229006 0.01513,4.5902 14.389879,-6.224988 z m -0.01949,10.999765 -12.158366,5.23507 4.97403,3.277297 7.174659,-4.659288 z"
|
||||
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:none;stroke:#d3d7cf;stroke-width:2.02702332;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate" />
|
||||
</g>
|
||||
<path
|
||||
style="fill:none;stroke:#d3d7cf;stroke-width:1.7972362;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="m 68.272256,11 0.014,14.948166 L 79.576261,19.762958 79.577458,11 Z"
|
||||
id="path3906-7-4"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="ccccc" />
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 29 KiB |
@@ -39,258 +39,342 @@
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QWidget" name="widget" native="true">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>225</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
<item>
|
||||
<widget class="QWidget" name="widget" native="true">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>225</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Tool Tables</string>
|
||||
</property>
|
||||
</widget>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Tool Tables</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QPushButton" name="ButtonRenameToolTable">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../../../Gui/Icons/resource.qrc">
|
||||
<normaloff>:/icons/FreeCAD-default/scalable/edit-edit.svg</normaloff>:/icons/FreeCAD-default/scalable/edit-edit.svg</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="ButtonRemoveToolTable">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normalon>:/icons/FreeCAD-default/scalable/list-remove.svg</normalon>
|
||||
</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="ButtonAddToolTable">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normalon>:/icons/FreeCAD-default/scalable/list-add.svg</normalon>
|
||||
</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
<widget class="QListWidget" name="TableList">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="baseSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="dragDropOverwriteMode">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="dragDropMode">
|
||||
<enum>QAbstractItemView::NoDragDrop</enum>
|
||||
</property>
|
||||
<property name="defaultDropAction">
|
||||
<enum>Qt::IgnoreAction</enum>
|
||||
</property>
|
||||
<property name="alternatingRowColors">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QPushButton" name="ButtonRenameToolTable">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../../../Gui/Icons/resource.qrc">
|
||||
<normaloff>:/icons/FreeCAD-default/scalable/edit-edit.svg</normaloff>:/icons/FreeCAD-default/scalable/edit-edit.svg</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="ButtonRemoveToolTable">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normalon>:/icons/FreeCAD-default/scalable/list-remove.svg</normalon>
|
||||
</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="ButtonAddToolTable">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normalon>:/icons/FreeCAD-default/scalable/list-add.svg</normalon>
|
||||
</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QListWidget" name="TableList">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="baseSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="alternatingRowColors">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTableView" name="ToolsList">
|
||||
<property name="dragEnabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="dragDropOverwriteMode">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="dragDropMode">
|
||||
<enum>QAbstractItemView::DragOnly</enum>
|
||||
</property>
|
||||
<property name="defaultDropAction">
|
||||
<enum>Qt::IgnoreAction</enum>
|
||||
</property>
|
||||
<property name="alternatingRowColors">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::SingleSelection</enum>
|
||||
</property>
|
||||
<property name="selectionBehavior">
|
||||
<enum>QAbstractItemView::SelectRows</enum>
|
||||
</property>
|
||||
<property name="cornerButtonEnabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<attribute name="horizontalHeaderStretchLastSection">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<attribute name="verticalHeaderVisible">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<attribute name="verticalHeaderStretchLastSection">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTableView" name="ToolsList">
|
||||
<property name="dragEnabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="dragDropOverwriteMode">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="dragDropMode">
|
||||
<enum>QAbstractItemView::NoDragDrop</enum>
|
||||
</property>
|
||||
<property name="defaultDropAction">
|
||||
<enum>Qt::IgnoreAction</enum>
|
||||
</property>
|
||||
<property name="alternatingRowColors">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::SingleSelection</enum>
|
||||
</property>
|
||||
<property name="selectionBehavior">
|
||||
<enum>QAbstractItemView::SelectRows</enum>
|
||||
</property>
|
||||
<property name="cornerButtonEnabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<attribute name="horizontalHeaderStretchLastSection">
|
||||
<bool>true</bool>
|
||||
</attribute>
|
||||
<attribute name="verticalHeaderVisible">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<attribute name="verticalHeaderStretchLastSection">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
</widget>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QPushButton" name="ButtonNewTool">
|
||||
<property name="text">
|
||||
<string>New Tool</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../Path.qrc">
|
||||
<normaloff>:/icons/Path-ToolController.svg</normaloff>:/icons/Path-ToolController.svg</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="ButtonDelete">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Delete</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../../../Gui/Icons/resource.qrc">
|
||||
<normaloff>:/icons/delete.svg</normaloff>:/icons/delete.svg</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="ButtonEdit">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="autoFillBackground">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Edit</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../../../Gui/Icons/resource.qrc">
|
||||
<normaloff>:/icons/edit-edit.svg</normaloff>:/icons/edit-edit.svg</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="ButtonDuplicate">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="autoFillBackground">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Duplicate</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../Path.qrc">
|
||||
<normaloff>:/icons/Path-ToolDuplicate.svg</normaloff>:/icons/Path-ToolDuplicate.svg</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="ButtonUp">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Move up</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../../../Gui/Icons/resource.qrc">
|
||||
<normaloff>:/icons/button_up.svg</normaloff>:/icons/button_up.svg</iconset>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="default">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="ButtonDown">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="autoFillBackground">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Move down</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../../../Gui/Icons/resource.qrc">
|
||||
<normaloff>:/icons/button_down.svg</normaloff>:/icons/button_down.svg</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnCopyTools">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Create Tool Controllers for the selected tools</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Create Tool Controller(s)</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../Path.qrc">
|
||||
<normaloff>:/icons/Path-LengthOffset.svg</normaloff>:/icons/Path-LengthOffset.svg</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="ButtonNewTool">
|
||||
<property name="text">
|
||||
<string>New Tool</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../Path.qrc">
|
||||
<normaloff>:/icons/Path-ToolController.svg</normaloff>:/icons/Path-ToolController.svg</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="ButtonDelete">
|
||||
<property name="text">
|
||||
<string>Delete</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../../../Gui/Icons/resource.qrc">
|
||||
<normaloff>:/icons/delete.svg</normaloff>:/icons/delete.svg</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="ButtonUp">
|
||||
<property name="text">
|
||||
<string>Move up</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../../../Gui/Icons/resource.qrc">
|
||||
<normaloff>:/icons/button_up.svg</normaloff>:/icons/button_up.svg</iconset>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="default">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="ButtonDown">
|
||||
<property name="text">
|
||||
<string>Move down</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../../../Gui/Icons/resource.qrc">
|
||||
<normaloff>:/icons/button_down.svg</normaloff>:/icons/button_down.svg</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
<widget class="QPushButton" name="btnCopyTools">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Create Tool Controllers for the selected tools</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Create Tool Controller(s)</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../Path.qrc">
|
||||
<normaloff>:/icons/Path-LengthOffset.svg</normaloff>:/icons/Path-LengthOffset.svg</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
|
||||
@@ -77,6 +77,7 @@ def Startup():
|
||||
from PathScripts import PathToolController
|
||||
from PathScripts import PathToolControllerGui
|
||||
from PathScripts import PathToolLibraryManager
|
||||
from PathScripts import PathToolLibraryEditor
|
||||
from PathScripts import PathUtilsGui
|
||||
Processed = True
|
||||
else:
|
||||
|
||||
@@ -36,7 +36,7 @@ import PathScripts.PathPreferences as PathPreferences
|
||||
import PathScripts.PathSetupSheetGui as PathSetupSheetGui
|
||||
import PathScripts.PathStock as PathStock
|
||||
import PathScripts.PathToolControllerGui as PathToolControllerGui
|
||||
import PathScripts.PathToolLibraryManager as PathToolLibraryManager
|
||||
import PathScripts.PathToolLibraryEditor as PathToolLibraryEditor
|
||||
import PathScripts.PathUtil as PathUtil
|
||||
import PathScripts.PathUtils as PathUtils
|
||||
import math
|
||||
@@ -854,7 +854,7 @@ class TaskPanel:
|
||||
self.toolControllerSelect()
|
||||
|
||||
def toolControllerAdd(self):
|
||||
PathToolLibraryManager.CommandToolLibraryEdit().edit(self.obj, self.updateToolController)
|
||||
PathToolLibraryEditor.CommandToolLibraryEdit().edit(self.obj, self.updateToolController)
|
||||
|
||||
def toolControllerDelete(self):
|
||||
self.objectDelete(self.form.toolControllerList)
|
||||
|
||||
464
src/Mod/Path/PathScripts/PathToolLibraryEditor.py
Normal file
464
src/Mod/Path/PathScripts/PathToolLibraryEditor.py
Normal file
@@ -0,0 +1,464 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# ***************************************************************************
|
||||
# * *
|
||||
# * Copyright (c) 2014 sliptonic <shopinthewoods@gmail.com> *
|
||||
# * *
|
||||
# * This program is free software; you can redistribute it and/or modify *
|
||||
# * it under the terms of the GNU Lesser General Public License (LGPL) *
|
||||
# * as published by the Free Software Foundation; either version 2 of *
|
||||
# * the License, or (at your option) any later version. *
|
||||
# * for detail see the LICENCE text file. *
|
||||
# * *
|
||||
# * This program is distributed in the hope that it will be useful, *
|
||||
# * but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
# * GNU Library General Public License for more details. *
|
||||
# * *
|
||||
# * You should have received a copy of the GNU Library General Public *
|
||||
# * License along with this program; if not, write to the Free Software *
|
||||
# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
|
||||
# * USA *
|
||||
# * *
|
||||
# ***************************************************************************
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
import FreeCAD
|
||||
import FreeCADGui
|
||||
import Path
|
||||
import PathScripts
|
||||
import PathScripts.PathLog as PathLog
|
||||
import PathScripts.PathToolEdit as PathToolEdit
|
||||
import PathScripts.PathUtils as PathUtils
|
||||
import PathScripts.PathToolLibraryManager as ToolLibraryManager
|
||||
|
||||
from PySide import QtCore, QtGui
|
||||
|
||||
PathLog.setLevel(PathLog.Level.INFO, PathLog.thisModule())
|
||||
#PathLog.trackModule(PathLog.thisModule())
|
||||
|
||||
def translate(context, text, disambig=None):
|
||||
return QtCore.QCoreApplication.translate(context, text, disambig)
|
||||
|
||||
class EditorPanel():
|
||||
|
||||
def __init__(self, job, cb):
|
||||
self.form = FreeCADGui.PySideUic.loadUi(":/panels/ToolLibraryEditor.ui")
|
||||
self.TLM = ToolLibraryManager.ToolLibraryManager()
|
||||
listname = self.TLM.getCurrentTableName()
|
||||
|
||||
if listname:
|
||||
self.loadToolTables()
|
||||
|
||||
self.job = job
|
||||
self.cb = cb
|
||||
|
||||
def toolEditor(self, tool):
|
||||
dialog = FreeCADGui.PySideUic.loadUi(":/panels/DlgToolEdit.ui")
|
||||
editor = PathToolEdit.ToolEditor(tool, dialog.toolEditor, dialog)
|
||||
editor.setupUI()
|
||||
return editor
|
||||
|
||||
def accept(self):
|
||||
pass
|
||||
|
||||
def reject(self):
|
||||
FreeCADGui.Control.closeDialog()
|
||||
FreeCAD.ActiveDocument.recompute()
|
||||
|
||||
def getFields(self):
|
||||
pass
|
||||
|
||||
def setFields(self):
|
||||
pass
|
||||
|
||||
def open(self):
|
||||
pass
|
||||
|
||||
def getType(self, tooltype):
|
||||
"gets a combobox index number for a given type or viceversa"
|
||||
toolslist = Path.Tool.getToolTypes(Path.Tool())
|
||||
if isinstance(tooltype, str):
|
||||
if tooltype in toolslist:
|
||||
return toolslist.index(tooltype)
|
||||
else:
|
||||
return 0
|
||||
else:
|
||||
return toolslist[tooltype]
|
||||
|
||||
def getMaterial(self, material):
|
||||
'''gets a combobox index number for a given material or viceversa'''
|
||||
matslist = Path.Tool.getToolMaterials(Path.Tool())
|
||||
if isinstance(material, str):
|
||||
if material in matslist:
|
||||
return matslist.index(material)
|
||||
else:
|
||||
return 0
|
||||
else:
|
||||
return matslist[material]
|
||||
|
||||
def addTool(self):
|
||||
'''adds new tool to the current tool table'''
|
||||
tool = Path.Tool()
|
||||
editor = self.toolEditor(tool)
|
||||
|
||||
r = editor.Parent.exec_()
|
||||
if r:
|
||||
editor.accept()
|
||||
listname = self.TLM.getCurrentTableName()
|
||||
self.TLM.addnew(listname, editor.Tool)
|
||||
self.loadTable(listname)
|
||||
|
||||
def delete(self):
|
||||
'''deletes the selected tool'''
|
||||
listname = self.TLM.getCurrentTableName()
|
||||
model = self.form.ToolsList.model()
|
||||
for i in range(model.rowCount()):
|
||||
item = model.item(i, 0)
|
||||
if item.checkState():
|
||||
t = model.index(i, 1)
|
||||
self.TLM.delete(int(t.data()) ,listname)
|
||||
self.loadTable(listname)
|
||||
self.toolSelectionChanged()
|
||||
|
||||
def editTool(self, currItem):
|
||||
'''load the tool edit dialog'''
|
||||
if not currItem:
|
||||
currItem = self.form.ToolsList.selectedIndexes()[1]
|
||||
|
||||
row = currItem.row()
|
||||
value = currItem.sibling(row, 1).data()
|
||||
listname = self.TLM.getCurrentTableName()
|
||||
toolnum = int(value)
|
||||
tool = self.TLM.getTool(listname, toolnum)
|
||||
editor = self.toolEditor(tool)
|
||||
|
||||
r = editor.Parent.exec_()
|
||||
if r:
|
||||
editor.accept()
|
||||
if self.TLM.updateTool(listname, toolnum, editor.Tool) is True:
|
||||
self.loadTable(listname)
|
||||
|
||||
def moveUp(self):
|
||||
'''moves a tool to a lower number, if possible'''
|
||||
item = self.form.ToolsList.selectedIndexes()[1].data()
|
||||
if item:
|
||||
number = int(item)
|
||||
listname = self.TLM.getCurrentTableName()
|
||||
success, newNum = self.TLM.moveup(number, listname)
|
||||
if success:
|
||||
self.loadTable(listname)
|
||||
self.updateSelection(newNum)
|
||||
|
||||
def moveDown(self):
|
||||
'''moves a tool to a higher number, if possible'''
|
||||
item = self.form.ToolsList.selectedIndexes()[1].data()
|
||||
if item:
|
||||
number = int(item)
|
||||
listname = self.TLM.getCurrentTableName()
|
||||
success, newNum = self.TLM.movedown(number, listname)
|
||||
if success:
|
||||
self.loadTable(listname)
|
||||
self.updateSelection(newNum)
|
||||
|
||||
def duplicate(self):
|
||||
'''duplicated the selected tool in the current tool table'''
|
||||
item = self.form.ToolsList.selectedIndexes()[1].data()
|
||||
if item:
|
||||
number = int(item)
|
||||
listname = self.TLM.getCurrentTableName()
|
||||
success, newNum = self.TLM.duplicate(number, listname)
|
||||
if success:
|
||||
self.loadTable(listname)
|
||||
self.updateSelection(newNum)
|
||||
|
||||
def updateSelection(self, number):
|
||||
'''update the tool list selection to track moves'''
|
||||
model = self.form.ToolsList.model()
|
||||
for i in range(model.rowCount()):
|
||||
if int(model.index(i, 1).data()) == number:
|
||||
self.form.ToolsList.selectRow(i)
|
||||
self.form.ToolsList.model().item(i, 0).setCheckState(QtCore.Qt.Checked)
|
||||
return
|
||||
|
||||
|
||||
def importFile(self):
|
||||
'''imports a tooltable from a file'''
|
||||
filename = QtGui.QFileDialog.getOpenFileName(self.form, translate( "TooltableEditor", "Open tooltable", None), None, "{};;{};;{}".format(self.TLM.TooltableTypeJSON, self.TLM.TooltableTypeXML, self.TLM.TooltableTypeHeekscad))
|
||||
if filename[0]:
|
||||
listname = self.TLM.getNextToolTableName()
|
||||
if self.TLM.read(filename, listname):
|
||||
self.loadToolTables()
|
||||
|
||||
def exportFile(self):
|
||||
'''export a tooltable to a file'''
|
||||
filename = QtGui.QFileDialog.getSaveFileName(self.form, translate("TooltableEditor", "Save tooltable", None), None, "{};;{};;{}".format(self.TLM.TooltableTypeJSON, self.TLM.TooltableTypeXML, self.TLM.TooltableTypeLinuxCNC))
|
||||
if filename[0]:
|
||||
listname = self.TLM.getCurrentTableName()
|
||||
self.TLM.write(filename, listname)
|
||||
|
||||
def toolSelectionChanged(self, index=None):
|
||||
''' updates the ui when tools are selected'''
|
||||
if index:
|
||||
self.form.ToolsList.selectRow(index.row())
|
||||
|
||||
self.form.btnCopyTools.setEnabled(False)
|
||||
self.form.ButtonDelete.setEnabled(False)
|
||||
self.form.ButtonUp.setEnabled(False)
|
||||
self.form.ButtonDown.setEnabled(False)
|
||||
self.form.ButtonEdit.setEnabled(False)
|
||||
self.form.ButtonDuplicate.setEnabled(False)
|
||||
|
||||
model = self.form.ToolsList.model()
|
||||
checkCount = 0
|
||||
checkList = []
|
||||
for i in range(model.rowCount()):
|
||||
item = model.item(i, 0)
|
||||
if item.checkState():
|
||||
checkCount += 1
|
||||
checkList.append(i)
|
||||
self.form.btnCopyTools.setEnabled(True)
|
||||
|
||||
# only allow moving or deleting a single tool at a time.
|
||||
if checkCount == 1:
|
||||
#make sure the row is highlighted when the check box gets ticked
|
||||
self.form.ToolsList.selectRow(checkList[0])
|
||||
self.form.ButtonDelete.setEnabled(True)
|
||||
self.form.ButtonUp.setEnabled(True)
|
||||
self.form.ButtonDown.setEnabled(True)
|
||||
self.form.ButtonEdit.setEnabled(True)
|
||||
self.form.ButtonDuplicate.setEnabled(True)
|
||||
|
||||
if len(PathUtils.GetJobs()) == 0:
|
||||
self.form.btnCopyTools.setEnabled(False)
|
||||
|
||||
def copyTools(self):
|
||||
''' copy selected tool '''
|
||||
tools = []
|
||||
model = self.form.ToolsList.model()
|
||||
for i in range(model.rowCount()):
|
||||
item = model.item(i, 0)
|
||||
if item.checkState():
|
||||
item = model.index(i, 1)
|
||||
tools.append(item.data())
|
||||
if len(tools) == 0:
|
||||
return
|
||||
|
||||
targets = self.TLM.getJobList()
|
||||
currList = self.TLM.getCurrentTableName()
|
||||
|
||||
for target in targets:
|
||||
if target == currList:
|
||||
targets.remove(target)
|
||||
|
||||
if len(targets) == 0:
|
||||
FreeCAD.Console.PrintWarning("No Path Jobs in current document")
|
||||
return
|
||||
elif len(targets) == 1:
|
||||
targetlist = targets[0]
|
||||
else:
|
||||
form = FreeCADGui.PySideUic.loadUi(":/panels/DlgToolCopy.ui")
|
||||
form.cboTarget.addItems(targets)
|
||||
r = form.exec_()
|
||||
if r is False:
|
||||
return None
|
||||
else:
|
||||
targetlist = form.cboTarget.currentText()
|
||||
|
||||
for toolnum in tools:
|
||||
tool = self.TLM.getTool(currList, int(toolnum))
|
||||
PathLog.debug('tool: {}, toolnum: {}'.format(tool, toolnum))
|
||||
if self.job:
|
||||
label = "T{}: {}".format(toolnum, tool.Name)
|
||||
tc = PathScripts.PathToolController.Create(label, tool=tool, toolNumber=int(toolnum))
|
||||
self.job.Proxy.addToolController(tc)
|
||||
else:
|
||||
for job in FreeCAD.ActiveDocument.findObjects("Path::Feature"):
|
||||
if isinstance(job.Proxy, PathScripts.PathJob.ObjectJob) and job.Label == targetlist:
|
||||
label = "T{}: {}".format(toolnum, tool.Name)
|
||||
tc = PathScripts.PathToolController.Create(label, tool=tool, toolNumber=int(toolnum))
|
||||
job.Proxy.addToolController(tc)
|
||||
if self.cb:
|
||||
self.cb()
|
||||
FreeCAD.ActiveDocument.recompute()
|
||||
|
||||
def tableSelected(self, index):
|
||||
''' loads the tools for the selected tool table '''
|
||||
name = self.form.TableList.itemWidget(self.form.TableList.itemFromIndex(index)).getTableName()
|
||||
self.loadTable(name)
|
||||
|
||||
def loadTable(self, name):
|
||||
''' loads the tools for the selected tool table '''
|
||||
tooldata = self.TLM.getTools(name)
|
||||
if tooldata:
|
||||
self.form.ToolsList.setModel(tooldata)
|
||||
self.form.ToolsList.resizeColumnsToContents()
|
||||
self.form.ToolsList.horizontalHeader().setResizeMode(self.form.ToolsList.model().columnCount() - 1, QtGui.QHeaderView.Stretch)
|
||||
self.setCurrentToolTableByName(name)
|
||||
|
||||
def addNewToolTable(self):
|
||||
''' adds new tool to selected tool table '''
|
||||
name = self.TLM.addNewToolTable()
|
||||
self.loadToolTables()
|
||||
self.loadTable(name)
|
||||
|
||||
def loadToolTables(self):
|
||||
''' Load list of available tool tables '''
|
||||
self.form.TableList.clear()
|
||||
model = self.form.ToolsList.model()
|
||||
if model:
|
||||
model.clear()
|
||||
if len(self.TLM.getToolTables()) > 0:
|
||||
for table in self.TLM.getToolTables():
|
||||
listWidgetItem = QtGui.QListWidgetItem()
|
||||
listItem = ToolTableListWidgetItem(self.TLM)
|
||||
listItem.setTableName(table.Name)
|
||||
listItem.setIcon(QtGui.QPixmap(':/icons/Path-ToolTable.svg'))
|
||||
listItem.toolMoved.connect(self.reloadReset)
|
||||
listWidgetItem.setSizeHint(QtCore.QSize(0,40))
|
||||
self.form.TableList.addItem(listWidgetItem)
|
||||
self.form.TableList.setItemWidget(listWidgetItem, listItem)
|
||||
#Load the first tooltable
|
||||
self.loadTable(self.TLM.getCurrentTableName())
|
||||
|
||||
def reloadReset(self):
|
||||
''' reloads the current tooltable'''
|
||||
name = self.TLM.getCurrentTableName()
|
||||
self.loadTable(name)
|
||||
|
||||
def setCurrentToolTableByName(self, name):
|
||||
''' get the current tool table '''
|
||||
item = self.getToolTableByName(name)
|
||||
if item:
|
||||
self.form.TableList.setCurrentItem(item)
|
||||
|
||||
def getToolTableByName(self, name):
|
||||
''' returns the listWidgetItem for the selected name'''
|
||||
for i in range(self.form.TableList.count()):
|
||||
tableName = self.form.TableList.itemWidget(self.form.TableList.item(i)).getTableName()
|
||||
if tableName == name:
|
||||
return self.form.TableList.item(i)
|
||||
return False
|
||||
|
||||
def removeToolTable(self):
|
||||
''' delete the selected tool table '''
|
||||
self.TLM.deleteToolTable()
|
||||
self.loadToolTables()
|
||||
|
||||
def renameTable(self):
|
||||
''' provides dialog for new tablename and renames teh selected tool table'''
|
||||
name = self.TLM.getCurrentTableName()
|
||||
newName, ok = QtGui.QInputDialog.getText(None, translate("TooltableEditor","Rename Tooltable"),translate("TooltableEditor","Enter Name:"),QtGui.QLineEdit.Normal,name)
|
||||
if ok and newName:
|
||||
index = self.form.TableList.indexFromItem(self.getToolTableByName(name)).row()
|
||||
reloadTables = self.TLM.renameToolTable(newName, index)
|
||||
if reloadTables:
|
||||
self.loadToolTables()
|
||||
self.loadTable(newName)
|
||||
|
||||
def getStandardButtons(self):
|
||||
return int(QtGui.QDialogButtonBox.Ok)
|
||||
|
||||
def setupUi(self):
|
||||
# Connect Signals and Slots
|
||||
self.form.ButtonNewTool.clicked.connect(self.addTool)
|
||||
self.form.ButtonImport.clicked.connect(self.importFile)
|
||||
self.form.ButtonExport.clicked.connect(self.exportFile)
|
||||
self.form.ButtonDown.clicked.connect(self.moveDown)
|
||||
self.form.ButtonUp.clicked.connect(self.moveUp)
|
||||
self.form.ButtonDelete.clicked.connect(self.delete)
|
||||
self.form.ButtonEdit.clicked.connect(self.editTool)
|
||||
self.form.ButtonDuplicate.clicked.connect(self.duplicate)
|
||||
self.form.btnCopyTools.clicked.connect(self.copyTools)
|
||||
|
||||
self.form.ToolsList.doubleClicked.connect(self.editTool)
|
||||
self.form.ToolsList.clicked.connect(self.toolSelectionChanged)
|
||||
|
||||
self.form.TableList.clicked.connect(self.tableSelected)
|
||||
self.form.TableList.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
|
||||
self.form.TableList.itemChanged.connect(self.renameTable)
|
||||
|
||||
self.form.ButtonAddToolTable.clicked.connect(self.addNewToolTable)
|
||||
self.form.ButtonAddToolTable.setToolTip(translate("TooltableEditor","Add New Tool Table"))
|
||||
self.form.ButtonRemoveToolTable.clicked.connect(self.removeToolTable)
|
||||
self.form.ButtonRemoveToolTable.setToolTip(translate("TooltableEditor","Delete Selected Tool Table"))
|
||||
self.form.ButtonRenameToolTable.clicked.connect(self.renameTable)
|
||||
self.form.ButtonRenameToolTable.setToolTip(translate("TooltableEditor","Rename Selected Tool Table"))
|
||||
|
||||
self.setFields()
|
||||
|
||||
class ToolTableListWidgetItem(QtGui.QWidget):
|
||||
|
||||
toolMoved = QtCore.Signal()
|
||||
|
||||
def __init__(self, TLM):
|
||||
super(ToolTableListWidgetItem, self).__init__()
|
||||
|
||||
self.tlm = TLM
|
||||
self.setAcceptDrops(True)
|
||||
|
||||
self.mainLayout = QtGui.QHBoxLayout()
|
||||
self.iconQLabel = QtGui.QLabel()
|
||||
self.tableNameLabel = QtGui.QLabel()
|
||||
self.mainLayout.addWidget(self.iconQLabel, 0)
|
||||
self.mainLayout.addWidget(self.tableNameLabel, 1)
|
||||
self.setLayout(self.mainLayout)
|
||||
|
||||
def setTableName (self, text):
|
||||
self.tableNameLabel.setText(text)
|
||||
|
||||
def getTableName(self):
|
||||
return self.tableNameLabel.text()
|
||||
|
||||
def setIcon (self, icon):
|
||||
icon = icon.scaled(24, 24)
|
||||
self.iconQLabel.setPixmap(icon)
|
||||
|
||||
def dragEnterEvent(self, e):
|
||||
currentToolTable = self.tlm.getCurrentTableName()
|
||||
thisToolTable = self.getTableName()
|
||||
|
||||
if not currentToolTable == thisToolTable:
|
||||
e.accept()
|
||||
else:
|
||||
e.ignore()
|
||||
|
||||
def dropEvent(self, e):
|
||||
selectedTools = e.source().selectedIndexes()
|
||||
if selectedTools:
|
||||
toolData = selectedTools[1].data()
|
||||
|
||||
if toolData:
|
||||
self.tlm.moveToTable(int(toolData), self.getTableName())
|
||||
self.toolMoved.emit()
|
||||
|
||||
|
||||
class CommandToolLibraryEdit():
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
def edit(self, job=None, cb=None):
|
||||
editor = EditorPanel(job, cb)
|
||||
editor.setupUi()
|
||||
|
||||
r = editor.form.exec_()
|
||||
if r:
|
||||
pass
|
||||
|
||||
def GetResources(self):
|
||||
return {'Pixmap' : 'Path-ToolTable',
|
||||
'MenuText': QtCore.QT_TRANSLATE_NOOP("Path_ToolTable","Tool Manager"),
|
||||
'Accel': "P, T",
|
||||
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Path_ToolTable","Tool Manager")}
|
||||
|
||||
def IsActive(self):
|
||||
return not FreeCAD.ActiveDocument is None
|
||||
|
||||
def Activated(self):
|
||||
|
||||
self.edit()
|
||||
|
||||
if FreeCAD.GuiUp:
|
||||
# register the FreeCAD command
|
||||
FreeCADGui.addCommand('Path_ToolLibraryEdit',CommandToolLibraryEdit())
|
||||
@@ -29,9 +29,7 @@ import FreeCADGui
|
||||
import Path
|
||||
import PathScripts
|
||||
import PathScripts.PathLog as PathLog
|
||||
import PathScripts.PathToolEdit as PathToolEdit
|
||||
import PathScripts.PathUtil as PathUtil
|
||||
import PathScripts.PathUtils as PathUtils
|
||||
import json
|
||||
import os
|
||||
import xml.sax
|
||||
@@ -145,12 +143,10 @@ class ToolLibraryManager():
|
||||
preferences and all or part of the library can be exported to other formats
|
||||
'''
|
||||
|
||||
#TODO: copy & Duplicate tools between lists
|
||||
|
||||
TooltableTypeJSON = translate("TooltableEditor", "Tooltable JSON (*.json)")
|
||||
TooltableTypeXML = translate("TooltableEditor", "Tooltable XML (*.xml)")
|
||||
TooltableTypeHeekscad = translate("TooltableEditor", "HeeksCAD tooltable (*.tooltable)")
|
||||
TooltableTypeLinuxCNC = translate("TooltableEditor", "LinuxCNC tooltable (*.tbl)")
|
||||
TooltableTypeJSON = translate("PathToolLibraryManager", "Tooltable JSON (*.json)")
|
||||
TooltableTypeXML = translate("PathToolLibraryManager", "Tooltable XML (*.xml)")
|
||||
TooltableTypeHeekscad = translate("PathToolLibraryManager", "HeeksCAD tooltable (*.tooltable)")
|
||||
TooltableTypeLinuxCNC = translate("PathToolLibraryManager", "LinuxCNC tooltable (*.tbl)")
|
||||
|
||||
PreferenceMainLibraryXML = "ToolLibrary"
|
||||
PreferenceMainLibraryJSON = "ToolLibrary-Main"
|
||||
@@ -334,7 +330,7 @@ class ToolLibraryManager():
|
||||
return None
|
||||
|
||||
tt = self.getTableFromName(tablename)
|
||||
headers = ["","Tool Num.","Name","Tool Type","Material","Diameter","Length Offset","Flat Radius","Corner Radius","Cutting Edge Angle","Cutting Edge Height"]
|
||||
headers = ["","Tool Num.","Name","Tool Type","Diameter"]
|
||||
model = QtGui.QStandardItemModel()
|
||||
model.setHorizontalHeaderLabels(headers)
|
||||
|
||||
@@ -353,15 +349,9 @@ class ToolLibraryManager():
|
||||
itemNumber = QtGui.QStandardItem(str(number))
|
||||
itemName = QtGui.QStandardItem(t.Name)
|
||||
itemToolType = QtGui.QStandardItem(t.ToolType)
|
||||
itemMaterial = QtGui.QStandardItem(t.Material)
|
||||
itemDiameter = QtGui.QStandardItem(unitconv(t.Diameter))
|
||||
itemLengthOffset = QtGui.QStandardItem(unitconv(t.LengthOffset))
|
||||
itemFlatRadius = QtGui.QStandardItem(unitconv(t.FlatRadius))
|
||||
itemCornerRadius = QtGui.QStandardItem(unitconv(t.CornerRadius))
|
||||
itemCuttingEdgeAngle = QtGui.QStandardItem(str(t.CuttingEdgeAngle))
|
||||
itemCuttingEdgeHeight = QtGui.QStandardItem(unitconv(t.CuttingEdgeHeight))
|
||||
|
||||
row = [itemcheck, itemNumber, itemName, itemToolType, itemMaterial, itemDiameter, itemLengthOffset, itemFlatRadius, itemCornerRadius, itemCuttingEdgeAngle, itemCuttingEdgeHeight]
|
||||
row = [itemcheck, itemNumber, itemName, itemToolType, itemDiameter]
|
||||
model.appendRow(row)
|
||||
|
||||
return model
|
||||
@@ -505,377 +495,30 @@ class ToolLibraryManager():
|
||||
self.saveMainLibrary()
|
||||
return True, target
|
||||
|
||||
def duplicate(self, number, listname):
|
||||
''' duplicates the selected tool in the selected tool table '''
|
||||
tt = self.getTableFromName(listname)
|
||||
tool = tt.getTool(number).copy()
|
||||
tt.addTools(tool)
|
||||
|
||||
newID = list(tt.Tools)[-1]
|
||||
|
||||
if listname == self.getCurrentTableName():
|
||||
self.saveMainLibrary()
|
||||
return True, newID
|
||||
|
||||
def moveToTable(self, number, listname):
|
||||
''' Moves the tool to selected tool table '''
|
||||
fromTable = self.getTableFromName(self.getCurrentTableName())
|
||||
toTable = self.getTableFromName(listname)
|
||||
tool = fromTable.getTool(number).copy()
|
||||
toTable.addTools(tool)
|
||||
fromTable.deleteTool(number)
|
||||
|
||||
def delete(self, number, listname):
|
||||
'''deletes a tool from the current list'''
|
||||
tt = self.getTableFromName(listname)
|
||||
tt.deleteTool(number)
|
||||
if listname == self.getCurrentTableName():
|
||||
self.saveMainLibrary()
|
||||
return True
|
||||
|
||||
|
||||
class EditorPanel():
|
||||
|
||||
def __init__(self, job, cb):
|
||||
self.form = FreeCADGui.PySideUic.loadUi(":/panels/ToolLibraryEditor.ui")
|
||||
self.TLM = ToolLibraryManager()
|
||||
listname = self.TLM.getCurrentTableName()
|
||||
|
||||
if listname:
|
||||
self.loadToolTables()
|
||||
|
||||
self.job = job
|
||||
self.cb = cb
|
||||
|
||||
def toolEditor(self, tool):
|
||||
dialog = FreeCADGui.PySideUic.loadUi(":/panels/DlgToolEdit.ui")
|
||||
editor = PathToolEdit.ToolEditor(tool, dialog.toolEditor, dialog)
|
||||
editor.setupUI()
|
||||
return editor
|
||||
|
||||
def accept(self):
|
||||
pass
|
||||
|
||||
def reject(self):
|
||||
FreeCADGui.Control.closeDialog()
|
||||
FreeCAD.ActiveDocument.recompute()
|
||||
|
||||
def getFields(self):
|
||||
pass
|
||||
|
||||
def setFields(self):
|
||||
pass
|
||||
|
||||
def open(self):
|
||||
pass
|
||||
|
||||
def getType(self, tooltype):
|
||||
"gets a combobox index number for a given type or viceversa"
|
||||
toolslist = Path.Tool.getToolTypes(Path.Tool())
|
||||
if isinstance(tooltype, str):
|
||||
if tooltype in toolslist:
|
||||
return toolslist.index(tooltype)
|
||||
else:
|
||||
return 0
|
||||
else:
|
||||
return toolslist[tooltype]
|
||||
|
||||
def getMaterial(self, material):
|
||||
'''gets a combobox index number for a given material or viceversa'''
|
||||
matslist = Path.Tool.getToolMaterials(Path.Tool())
|
||||
if isinstance(material, str):
|
||||
if material in matslist:
|
||||
return matslist.index(material)
|
||||
else:
|
||||
return 0
|
||||
else:
|
||||
return matslist[material]
|
||||
|
||||
def addTool(self):
|
||||
'''adds new tool to the current tool table'''
|
||||
tool = Path.Tool()
|
||||
editor = self.toolEditor(tool)
|
||||
|
||||
r = editor.Parent.exec_()
|
||||
if r:
|
||||
editor.accept()
|
||||
listname = self.TLM.getCurrentTableName()
|
||||
self.TLM.addnew(listname, editor.Tool) # is True:
|
||||
self.loadTable(listname)
|
||||
|
||||
def delete(self):
|
||||
'''deletes the selected tool'''
|
||||
#listname = self.form.listView.selectedIndexes()[0].data()
|
||||
listname = self.TLM.getCurrentTableName()
|
||||
model = self.form.ToolsList.model()
|
||||
for i in range(model.rowCount()):
|
||||
item = model.item(i, 0)
|
||||
if item.checkState():
|
||||
t = model.index(i, 1)
|
||||
self.TLM.delete(int(t.data()) ,listname)
|
||||
self.loadTable(listname)
|
||||
|
||||
def editTool(self, currItem):
|
||||
'''load the tool edit dialog'''
|
||||
row = currItem.row()
|
||||
value = currItem.sibling(row, 1).data()
|
||||
listname = self.TLM.getCurrentTableName()
|
||||
toolnum = int(value)
|
||||
tool = self.TLM.getTool(listname, toolnum)
|
||||
editor = self.toolEditor(tool)
|
||||
|
||||
r = editor.Parent.exec_()
|
||||
if r:
|
||||
editor.accept()
|
||||
if self.TLM.updateTool(listname, toolnum, editor.Tool) is True:
|
||||
self.loadTable(listname)
|
||||
|
||||
def moveUp(self):
|
||||
'''moves a tool to a lower number, if possible'''
|
||||
item = self.form.ToolsList.selectedIndexes()[1].data()
|
||||
if item:
|
||||
number = int(item)
|
||||
listname = self.TLM.getCurrentTableName()
|
||||
success, newNum = self.TLM.moveup(number, listname)
|
||||
if success:
|
||||
self.loadTable(listname)
|
||||
self.updateSelection(newNum)
|
||||
|
||||
def moveDown(self):
|
||||
'''moves a tool to a higher number, if possible'''
|
||||
item = self.form.ToolsList.selectedIndexes()[1].data()
|
||||
if item:
|
||||
number = int(item)
|
||||
listname = self.TLM.getCurrentTableName()
|
||||
success, newNum = self.TLM.movedown(number, listname)
|
||||
if success:
|
||||
self.loadTable(listname)
|
||||
self.updateSelection(newNum)
|
||||
|
||||
def updateSelection(self, number):
|
||||
'''update the tool list selection to track moves'''
|
||||
model = self.form.ToolsList.model()
|
||||
for i in range(model.rowCount()):
|
||||
if int(model.index(i, 1).data()) == number:
|
||||
self.form.ToolsList.selectRow(i)
|
||||
self.form.ToolsList.model().item(i, 0).setCheckState(QtCore.Qt.Checked)
|
||||
return
|
||||
|
||||
|
||||
def importFile(self):
|
||||
'''imports a tooltable from a file'''
|
||||
filename = QtGui.QFileDialog.getOpenFileName(self.form, translate( "TooltableEditor", "Open tooltable", None), None, "{};;{};;{}".format(ToolLibraryManager.TooltableTypeJSON, ToolLibraryManager.TooltableTypeXML, ToolLibraryManager.TooltableTypeHeekscad))
|
||||
if filename[0]:
|
||||
listname = self.TLM.getNextToolTableName()
|
||||
if self.TLM.read(filename, listname):
|
||||
self.loadToolTables()
|
||||
#self.loadTable(listname)
|
||||
|
||||
|
||||
def exportFile(self):
|
||||
'''export a tooltable to a file'''
|
||||
filename = QtGui.QFileDialog.getSaveFileName(self.form, translate("TooltableEditor", "Save tooltable", None), None, "{};;{};;{}".format(ToolLibraryManager.TooltableTypeJSON, ToolLibraryManager.TooltableTypeXML, ToolLibraryManager.TooltableTypeLinuxCNC))
|
||||
if filename[0]:
|
||||
listname = self.TLM.getCurrentTableName()
|
||||
self.TLM.write(filename, listname)
|
||||
|
||||
def toolSelected(self, index):
|
||||
''' updates the ui when tools are selected'''
|
||||
self.form.ToolsList.selectRow(index.row())
|
||||
|
||||
self.form.btnCopyTools.setEnabled(False)
|
||||
self.form.ButtonDelete.setEnabled(False)
|
||||
self.form.ButtonUp.setEnabled(False)
|
||||
self.form.ButtonDown.setEnabled(False)
|
||||
|
||||
model = self.form.ToolsList.model()
|
||||
checkCount = 0
|
||||
checkList = []
|
||||
for i in range(model.rowCount()):
|
||||
item = model.item(i, 0)
|
||||
if item.checkState():
|
||||
checkCount += 1
|
||||
checkList.append(i)
|
||||
self.form.btnCopyTools.setEnabled(True)
|
||||
|
||||
# only allow moving or deleting a single tool at a time.
|
||||
if checkCount == 1:
|
||||
#make sure the row is highlighted when the check box gets ticked
|
||||
self.form.ToolsList.selectRow(checkList[0])
|
||||
self.form.ButtonDelete.setEnabled(True)
|
||||
self.form.ButtonUp.setEnabled(True)
|
||||
self.form.ButtonDown.setEnabled(True)
|
||||
|
||||
if len(PathUtils.GetJobs()) == 0:
|
||||
self.form.btnCopyTools.setEnabled(False)
|
||||
|
||||
def copyTools(self):
|
||||
''' copy selected tool '''
|
||||
tools = []
|
||||
model = self.form.ToolsList.model()
|
||||
for i in range(model.rowCount()):
|
||||
item = model.item(i, 0)
|
||||
if item.checkState():
|
||||
item = model.index(i, 1)
|
||||
tools.append(item.data())
|
||||
if len(tools) == 0:
|
||||
return
|
||||
|
||||
targets = self.TLM.getJobList()
|
||||
currList = self.TLM.getCurrentTableName()
|
||||
|
||||
for target in targets:
|
||||
if target == currList:
|
||||
targets.remove(target)
|
||||
|
||||
if len(targets) == 0:
|
||||
FreeCAD.Console.PrintWarning("No Path Jobs in current document")
|
||||
return
|
||||
elif len(targets) == 1:
|
||||
targetlist = targets[0]
|
||||
else:
|
||||
form = FreeCADGui.PySideUic.loadUi(":/panels/DlgToolCopy.ui")
|
||||
form.cboTarget.addItems(targets)
|
||||
r = form.exec_()
|
||||
if r is False:
|
||||
return None
|
||||
else:
|
||||
targetlist = form.cboTarget.currentText()
|
||||
|
||||
for toolnum in tools:
|
||||
tool = self.TLM.getTool(currList, int(toolnum))
|
||||
PathLog.debug('tool: {}, toolnum: {}'.format(tool, toolnum))
|
||||
if self.job:
|
||||
label = "T{}: {}".format(toolnum, tool.Name)
|
||||
tc = PathScripts.PathToolController.Create(label, tool=tool, toolNumber=int(toolnum))
|
||||
self.job.Proxy.addToolController(tc)
|
||||
else:
|
||||
for job in FreeCAD.ActiveDocument.findObjects("Path::Feature"):
|
||||
if isinstance(job.Proxy, PathScripts.PathJob.ObjectJob) and job.Label == targetlist:
|
||||
label = "T{}: {}".format(toolnum, tool.Name)
|
||||
tc = PathScripts.PathToolController.Create(label, tool=tool, toolNumber=int(toolnum))
|
||||
job.Proxy.addToolController(tc)
|
||||
if self.cb:
|
||||
self.cb()
|
||||
FreeCAD.ActiveDocument.recompute()
|
||||
|
||||
def tableSelected(self, index):
|
||||
''' loads the tools for the selected tool table '''
|
||||
name = self.form.TableList.itemFromIndex(index).text()
|
||||
self.loadTable(name)
|
||||
|
||||
def loadTable(self, name):
|
||||
''' loads the tools for the selected tool table '''
|
||||
tooldata = self.TLM.getTools(name)
|
||||
if tooldata:
|
||||
self.form.ToolsList.setModel(tooldata)
|
||||
self.form.ToolsList.resizeColumnsToContents()
|
||||
self.setCurrentToolTableByName(name)
|
||||
|
||||
|
||||
def addNewToolTable(self):
|
||||
''' adds new tool to selected tool table '''
|
||||
name = self.TLM.addNewToolTable()
|
||||
self.loadToolTables()
|
||||
self.loadTable(name)
|
||||
|
||||
def loadToolTables(self):
|
||||
''' Load list of available tool tables '''
|
||||
self.form.TableList.clear()
|
||||
model = self.form.ToolsList.model()
|
||||
if model:
|
||||
model.clear()
|
||||
if len(self.TLM.getToolTables()) > 0:
|
||||
for table in self.TLM.getToolTables():
|
||||
listItem = QtGui.QListWidgetItem(table.Name)
|
||||
listItem.setIcon(QtGui.QIcon(':/icons/Path-ToolTable.svg'))
|
||||
listItem.setFlags(listItem.flags() | QtCore.Qt.ItemIsEditable)
|
||||
listItem.setSizeHint(QtCore.QSize(0,40))
|
||||
self.form.TableList.addItem(listItem)
|
||||
self.loadTable(self.TLM.getToolTables()[0].Name)
|
||||
|
||||
def setCurrentToolTableByName(self, name):
|
||||
''' get the current tool table '''
|
||||
item = self.form.TableList.findItems(name, QtCore.Qt.MatchExactly)[0]
|
||||
self.form.TableList.setCurrentItem(item)
|
||||
|
||||
def removeToolTable(self):
|
||||
''' delete the selected tool table '''
|
||||
self.TLM.deleteToolTable()
|
||||
self.loadToolTables()
|
||||
|
||||
def initTableRename(self):
|
||||
''' update the tool table list entry to allow renaming '''
|
||||
name = self.TLM.getCurrentTableName()
|
||||
item = self.form.TableList.findItems(name, QtCore.Qt.MatchExactly)[0]
|
||||
self.form.TableList.editItem(item)
|
||||
|
||||
def renameTable(self, listItem):
|
||||
''' rename the selected too table '''
|
||||
newName = listItem.text()
|
||||
index = self.form.TableList.indexFromItem(listItem).row()
|
||||
reloadTables = self.TLM.renameToolTable(newName, index)
|
||||
if reloadTables:
|
||||
self.loadToolTables()
|
||||
|
||||
def getStandardButtons(self):
|
||||
return int(QtGui.QDialogButtonBox.Ok)
|
||||
|
||||
# def openMenu(self, position):
|
||||
# menu = QtGui.QMenu()
|
||||
# newAction = menu.addAction("New Tool Table")
|
||||
# deleteAction = menu.addAction("Delete")
|
||||
# renameAction = menu.addAction("Rename")
|
||||
# action = menu.exec_(self.form.TableList.mapToGlobal(position))
|
||||
# if action == newAction:
|
||||
# self.addNewToolTable()
|
||||
# pass
|
||||
# if action == deleteAction:
|
||||
# self.removeToolTable()
|
||||
# pass
|
||||
# if action == renameAction:
|
||||
# self.initTableRename()
|
||||
# pass
|
||||
|
||||
def setupUi(self):
|
||||
# Connect Signals and Slots
|
||||
self.form.ButtonNewTool.clicked.connect(self.addTool)
|
||||
self.form.ButtonImport.clicked.connect(self.importFile)
|
||||
self.form.ButtonExport.clicked.connect(self.exportFile)
|
||||
self.form.ButtonDown.clicked.connect(self.moveDown)
|
||||
self.form.ButtonUp.clicked.connect(self.moveUp)
|
||||
self.form.ButtonDelete.clicked.connect(self.delete)
|
||||
|
||||
self.form.ToolsList.doubleClicked.connect(self.editTool)
|
||||
self.form.ToolsList.clicked.connect(self.toolSelected)
|
||||
|
||||
self.form.btnCopyTools.clicked.connect(self.copyTools)
|
||||
|
||||
self.form.TableList.clicked.connect(self.tableSelected)
|
||||
self.form.TableList.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
|
||||
#self.form.TableList.customContextMenuRequested.connect(self.openMenu)
|
||||
self.form.TableList.itemChanged.connect(self.renameTable)
|
||||
|
||||
self.form.ButtonAddToolTable.clicked.connect(self.addNewToolTable)
|
||||
self.form.ButtonAddToolTable.setToolTip(translate("TooltableEditor","Add New Tool Table"))
|
||||
self.form.ButtonRemoveToolTable.clicked.connect(self.removeToolTable)
|
||||
self.form.ButtonRemoveToolTable.setToolTip(translate("TooltableEditor","Delete Selected Tool Table"))
|
||||
self.form.ButtonRenameToolTable.clicked.connect(self.initTableRename)
|
||||
self.form.ButtonRenameToolTable.setToolTip(translate("TooltableEditor","Rename Selected Tool Table"))
|
||||
|
||||
|
||||
self.form.btnCopyTools.setEnabled(False)
|
||||
self.form.ButtonDelete.setEnabled(False)
|
||||
self.form.ButtonUp.setEnabled(False)
|
||||
self.form.ButtonDown.setEnabled(False)
|
||||
|
||||
self.setFields()
|
||||
|
||||
class CommandToolLibraryEdit():
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
def edit(self, job=None, cb=None):
|
||||
editor = EditorPanel(job, cb)
|
||||
editor.setupUi()
|
||||
|
||||
r = editor.form.exec_()
|
||||
if r:
|
||||
pass
|
||||
|
||||
def GetResources(self):
|
||||
return {'Pixmap' : 'Path-ToolTable',
|
||||
'MenuText': QtCore.QT_TRANSLATE_NOOP("Path_ToolTable","Tool Manager"),
|
||||
'Accel': "P, T",
|
||||
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Path_ToolTable","Tool Manager")}
|
||||
|
||||
def IsActive(self):
|
||||
return not FreeCAD.ActiveDocument is None
|
||||
|
||||
def Activated(self):
|
||||
|
||||
self.edit()
|
||||
|
||||
if FreeCAD.GuiUp:
|
||||
# register the FreeCAD command
|
||||
FreeCADGui.addCommand('Path_ToolLibraryEdit',CommandToolLibraryEdit())
|
||||
return True
|
||||
Reference in New Issue
Block a user