Merge branch 'main' into engrave
This commit is contained in:
@@ -1920,7 +1920,7 @@ std::vector<shared_ptr<Area>> Area::makeSections(PARAM_ARGS(PARAM_FARG, AREA_PAR
|
||||
builder.MakeCompound(comp);
|
||||
|
||||
for (TopExp_Explorer xp(s.shape.Moved(loc), TopAbs_SOLID); xp.More(); xp.Next()) {
|
||||
showShape(xp.Current(), nullptr, "section_%u_shape", i);
|
||||
showShape(xp.Current(), nullptr, "section_%ul_shape", i);
|
||||
std::list<TopoDS_Wire> wires;
|
||||
Part::CrossSection section(a, b, c, xp.Current());
|
||||
Part::FuzzyHelper::withBooleanFuzzy(.0, [&]() {
|
||||
@@ -1930,7 +1930,7 @@ std::vector<shared_ptr<Area>> Area::makeSections(PARAM_ARGS(PARAM_FARG, AREA_PAR
|
||||
// here for now to be on the safe side.
|
||||
wires = section.slice(-d);
|
||||
});
|
||||
showShapes(wires, nullptr, "section_%u_wire", i);
|
||||
showShapes(wires, nullptr, "section_%ul_wire", i);
|
||||
if (wires.empty()) {
|
||||
AREA_LOG("Section returns no wires");
|
||||
continue;
|
||||
@@ -1951,7 +1951,7 @@ std::vector<shared_ptr<Area>> Area::makeSections(PARAM_ARGS(PARAM_FARG, AREA_PAR
|
||||
AREA_WARN("FaceMakerBullseye return null shape on section");
|
||||
}
|
||||
else {
|
||||
showShape(shape, nullptr, "section_%u_face", i);
|
||||
showShape(shape, nullptr, "section_%ul_face", i);
|
||||
for (auto it = wires.begin(), itNext = it; it != wires.end();
|
||||
it = itNext) {
|
||||
++itNext;
|
||||
@@ -1979,7 +1979,7 @@ std::vector<shared_ptr<Area>> Area::makeSections(PARAM_ARGS(PARAM_FARG, AREA_PAR
|
||||
// Make sure the compound has at least one edge
|
||||
if (TopExp_Explorer(comp, TopAbs_EDGE).More()) {
|
||||
const TopoDS_Shape& shape = comp.Moved(locInverse);
|
||||
showShape(shape, nullptr, "section_%u_result", i);
|
||||
showShape(shape, nullptr, "section_%ul_result", i);
|
||||
area->add(shape, s.op);
|
||||
}
|
||||
else if (area->myShapes.empty()) {
|
||||
@@ -1994,7 +1994,7 @@ std::vector<shared_ptr<Area>> Area::makeSections(PARAM_ARGS(PARAM_FARG, AREA_PAR
|
||||
if (!area->myShapes.empty()) {
|
||||
sections.push_back(area);
|
||||
FC_TIME_LOG(t1, "makeSection " << z);
|
||||
showShape(area->getShape(), nullptr, "section_%u_final", i);
|
||||
showShape(area->getShape(), nullptr, "section_%ul_final", i);
|
||||
break;
|
||||
}
|
||||
if (retried) {
|
||||
|
||||
@@ -27,7 +27,7 @@ from unittest.mock import MagicMock
|
||||
from Path.Tool.toolbit.ui.editor import ToolBitPropertiesWidget
|
||||
from Path.Tool.toolbit.models.base import ToolBit
|
||||
from Path.Tool.shape.ui.shapewidget import ShapeWidget
|
||||
from Path.Tool.ui.property import BasePropertyEditorWidget
|
||||
from Path.Tool.docobject.ui.property import BasePropertyEditorWidget
|
||||
from .PathTestUtils import PathTestWithAssets
|
||||
|
||||
|
||||
|
||||
@@ -24,7 +24,8 @@
|
||||
|
||||
import unittest
|
||||
import FreeCAD
|
||||
from Path.Tool.ui.property import (
|
||||
from Path.Tool.docobject import DetachedDocumentObject
|
||||
from Path.Tool.docobject.ui.property import (
|
||||
BasePropertyEditorWidget,
|
||||
QuantityPropertyEditorWidget,
|
||||
BoolPropertyEditorWidget,
|
||||
@@ -32,7 +33,6 @@ from Path.Tool.ui.property import (
|
||||
EnumPropertyEditorWidget,
|
||||
LabelPropertyEditorWidget,
|
||||
)
|
||||
from Path.Tool.toolbit.docobject import DetachedDocumentObject
|
||||
|
||||
|
||||
class TestPropertyEditorFactory(unittest.TestCase):
|
||||
|
||||
@@ -26,7 +26,9 @@ import unittest
|
||||
from unittest.mock import MagicMock
|
||||
import FreeCAD
|
||||
from PySide import QtGui
|
||||
from Path.Tool.ui.property import (
|
||||
from Path.Tool.docobject import DetachedDocumentObject
|
||||
from Path.Tool.docobject.ui.docobject import DocumentObjectEditorWidget, _get_label_text
|
||||
from Path.Tool.docobject.ui.property import (
|
||||
BasePropertyEditorWidget,
|
||||
QuantityPropertyEditorWidget,
|
||||
BoolPropertyEditorWidget,
|
||||
@@ -34,8 +36,6 @@ from Path.Tool.ui.property import (
|
||||
EnumPropertyEditorWidget,
|
||||
LabelPropertyEditorWidget,
|
||||
)
|
||||
from Path.Tool.ui.docobject import DocumentObjectEditorWidget, _get_label_text
|
||||
from Path.Tool.toolbit.docobject import DetachedDocumentObject
|
||||
|
||||
|
||||
class TestDocumentObjectEditorWidget(unittest.TestCase):
|
||||
|
||||
@@ -882,6 +882,52 @@ G54
|
||||
|
||||
#############################################################################
|
||||
|
||||
def test00145(self) -> None:
|
||||
"""Test the finish label argument."""
|
||||
# test the default finish label
|
||||
self.multi_compare(
|
||||
[],
|
||||
"""(Begin preamble)
|
||||
G90
|
||||
G21
|
||||
(Begin operation)
|
||||
G54
|
||||
(Finish operation)
|
||||
(Begin operation)
|
||||
(TC: Default Tool)
|
||||
(Begin toolchange)
|
||||
(M6 T1)
|
||||
(Finish operation)
|
||||
(Begin operation)
|
||||
(Finish operation)
|
||||
(Begin postamble)
|
||||
""",
|
||||
"--comments",
|
||||
)
|
||||
|
||||
# test a changed finish label
|
||||
self.multi_compare(
|
||||
[],
|
||||
"""(Begin preamble)
|
||||
G90
|
||||
G21
|
||||
(Begin operation)
|
||||
G54
|
||||
(End operation)
|
||||
(Begin operation)
|
||||
(TC: Default Tool)
|
||||
(Begin toolchange)
|
||||
(M6 T1)
|
||||
(End operation)
|
||||
(Begin operation)
|
||||
(End operation)
|
||||
(Begin postamble)
|
||||
""",
|
||||
"--finish_label='End' --comments",
|
||||
)
|
||||
|
||||
#############################################################################
|
||||
|
||||
def test00150(self):
|
||||
"""Test output with an empty path.
|
||||
|
||||
@@ -1178,6 +1224,9 @@ G0 Z8.000
|
||||
--feed-precision FEED_PRECISION
|
||||
Number of digits of precision for feed rate, default
|
||||
is 3
|
||||
--finish_label FINISH_LABEL
|
||||
The characters to use in the 'Finish operation'
|
||||
comment, default is "Finish"
|
||||
--header Output headers (default)
|
||||
--no-header Suppress header output
|
||||
--line_number_increment LINE_NUMBER_INCREMENT
|
||||
@@ -1198,6 +1247,16 @@ G0 Z8.000
|
||||
Output all of the available arguments
|
||||
--no-output_all_arguments
|
||||
Don't output all of the available arguments (default)
|
||||
--output_machine_name
|
||||
Output the machine name in the pre-operation
|
||||
information
|
||||
--no-output_machine_name
|
||||
Don't output the machine name in the pre-operation
|
||||
information (default)
|
||||
--output_path_labels Output Path labels at the beginning of each Path
|
||||
--no-output_path_labels
|
||||
Don't output Path labels at the beginning of each Path
|
||||
(default)
|
||||
--output_visible_arguments
|
||||
Output all of the visible arguments
|
||||
--no-output_visible_arguments
|
||||
@@ -1205,6 +1264,9 @@ G0 Z8.000
|
||||
--postamble POSTAMBLE
|
||||
Set commands to be issued after the last command,
|
||||
default is ""
|
||||
--post_operation POST_OPERATION
|
||||
Set commands to be issued after every operation,
|
||||
default is ""
|
||||
--preamble PREAMBLE Set commands to be issued before the first command,
|
||||
default is ""
|
||||
--precision PRECISION
|
||||
@@ -1293,6 +1355,146 @@ G0 X2.000
|
||||
|
||||
#############################################################################
|
||||
|
||||
def test00205(self) -> None:
|
||||
"""Test output_machine_name argument."""
|
||||
# test the default behavior
|
||||
self.multi_compare(
|
||||
[],
|
||||
"""(Begin preamble)
|
||||
G90
|
||||
G21
|
||||
(Begin operation)
|
||||
G54
|
||||
(Finish operation)
|
||||
(Begin operation)
|
||||
(TC: Default Tool)
|
||||
(Begin toolchange)
|
||||
(M6 T1)
|
||||
(Finish operation)
|
||||
(Begin operation)
|
||||
(Finish operation)
|
||||
(Begin postamble)
|
||||
""",
|
||||
"--comments",
|
||||
)
|
||||
|
||||
# test outputting the machine name
|
||||
self.multi_compare(
|
||||
[],
|
||||
"""(Begin preamble)
|
||||
G90
|
||||
G21
|
||||
(Begin operation)
|
||||
(Machine: test, mm/min)
|
||||
G54
|
||||
(Finish operation)
|
||||
(Begin operation)
|
||||
(Machine: test, mm/min)
|
||||
(TC: Default Tool)
|
||||
(Begin toolchange)
|
||||
(M6 T1)
|
||||
(Finish operation)
|
||||
(Begin operation)
|
||||
(Machine: test, mm/min)
|
||||
(Finish operation)
|
||||
(Begin postamble)
|
||||
""",
|
||||
"--output_machine_name --comments",
|
||||
)
|
||||
|
||||
# test not outputting the machine name
|
||||
self.multi_compare(
|
||||
[],
|
||||
"""(Begin preamble)
|
||||
G90
|
||||
G21
|
||||
(Begin operation)
|
||||
G54
|
||||
(Finish operation)
|
||||
(Begin operation)
|
||||
(TC: Default Tool)
|
||||
(Begin toolchange)
|
||||
(M6 T1)
|
||||
(Finish operation)
|
||||
(Begin operation)
|
||||
(Finish operation)
|
||||
(Begin postamble)
|
||||
""",
|
||||
"--no-output_machine_name --comments",
|
||||
)
|
||||
|
||||
#############################################################################
|
||||
|
||||
def test00206(self) -> None:
|
||||
"""Test output_path_labels argument."""
|
||||
# test the default behavior
|
||||
self.multi_compare(
|
||||
[],
|
||||
"""(Begin preamble)
|
||||
G90
|
||||
G21
|
||||
(Begin operation)
|
||||
G54
|
||||
(Finish operation)
|
||||
(Begin operation)
|
||||
(TC: Default Tool)
|
||||
(Begin toolchange)
|
||||
(M6 T1)
|
||||
(Finish operation)
|
||||
(Begin operation)
|
||||
(Finish operation)
|
||||
(Begin postamble)
|
||||
""",
|
||||
"--comments",
|
||||
)
|
||||
|
||||
# test outputting the path labels
|
||||
self.multi_compare(
|
||||
[],
|
||||
"""(Begin preamble)
|
||||
G90
|
||||
G21
|
||||
(Begin operation)
|
||||
(Path: Fixture)
|
||||
G54
|
||||
(Finish operation)
|
||||
(Begin operation)
|
||||
(Path: TC: Default Tool)
|
||||
(TC: Default Tool)
|
||||
(Begin toolchange)
|
||||
(M6 T1)
|
||||
(Finish operation)
|
||||
(Begin operation)
|
||||
(Path: Profile)
|
||||
(Finish operation)
|
||||
(Begin postamble)
|
||||
""",
|
||||
"--output_path_labels --comments",
|
||||
)
|
||||
|
||||
# test not outputting the path labels
|
||||
self.multi_compare(
|
||||
[],
|
||||
"""(Begin preamble)
|
||||
G90
|
||||
G21
|
||||
(Begin operation)
|
||||
G54
|
||||
(Finish operation)
|
||||
(Begin operation)
|
||||
(TC: Default Tool)
|
||||
(Begin toolchange)
|
||||
(M6 T1)
|
||||
(Finish operation)
|
||||
(Begin operation)
|
||||
(Finish operation)
|
||||
(Begin postamble)
|
||||
""",
|
||||
"--no-output_path_labels --comments",
|
||||
)
|
||||
|
||||
#############################################################################
|
||||
|
||||
def test00210(self):
|
||||
"""Test Post-amble."""
|
||||
nl = "\n"
|
||||
@@ -1307,6 +1509,36 @@ G0 X2.000
|
||||
|
||||
#############################################################################
|
||||
|
||||
def test00215(self) -> None:
|
||||
"""Test the post_operation argument."""
|
||||
self.multi_compare(
|
||||
[],
|
||||
"""(Begin preamble)
|
||||
G90
|
||||
G21
|
||||
(Begin operation)
|
||||
G54
|
||||
(Finish operation)
|
||||
G90 G80
|
||||
G40 G49
|
||||
(Begin operation)
|
||||
(TC: Default Tool)
|
||||
(Begin toolchange)
|
||||
(M6 T1)
|
||||
(Finish operation)
|
||||
G90 G80
|
||||
G40 G49
|
||||
(Begin operation)
|
||||
(Finish operation)
|
||||
G90 G80
|
||||
G40 G49
|
||||
(Begin postamble)
|
||||
""",
|
||||
"--comments --post_operation='G90 G80\nG40 G49'",
|
||||
)
|
||||
|
||||
#############################################################################
|
||||
|
||||
def test00220(self):
|
||||
"""Test Pre-amble."""
|
||||
nl = "\n"
|
||||
|
||||
@@ -142,20 +142,28 @@ SET(PathPythonToolsAssetsUi_SRCS
|
||||
Path/Tool/assets/ui/util.py
|
||||
)
|
||||
|
||||
SET(PathPythonToolsDocObject_SRCS
|
||||
Path/Tool/docobject/__init__.py
|
||||
)
|
||||
|
||||
SET(PathPythonToolsDocObjectModels_SRCS
|
||||
Path/Tool/docobject/models/__init__.py
|
||||
Path/Tool/docobject/models/docobject.py
|
||||
)
|
||||
|
||||
SET(PathPythonToolsDocObjectUi_SRCS
|
||||
Path/Tool/docobject/ui/__init__.py
|
||||
Path/Tool/docobject/ui/docobject.py
|
||||
Path/Tool/docobject/ui/property.py
|
||||
)
|
||||
|
||||
SET(PathPythonToolsGui_SRCS
|
||||
Path/Tool/Gui/__init__.py
|
||||
Path/Tool/Gui/Controller.py
|
||||
)
|
||||
|
||||
SET(PathPythonToolsUi_SRCS
|
||||
Path/Tool/ui/__init__.py
|
||||
Path/Tool/ui/docobject.py
|
||||
Path/Tool/ui/property.py
|
||||
)
|
||||
|
||||
SET(PathPythonToolsToolBit_SRCS
|
||||
Path/Tool/toolbit/__init__.py
|
||||
Path/Tool/toolbit/docobject.py
|
||||
Path/Tool/toolbit/util.py
|
||||
)
|
||||
|
||||
@@ -554,15 +562,8 @@ SET(PathImages_Ops
|
||||
Images/Ops/chamfer.svg
|
||||
)
|
||||
|
||||
SET(PathImages_Tools
|
||||
Images/Tools/drill.svg
|
||||
Images/Tools/endmill.svg
|
||||
Images/Tools/v-bit.svg
|
||||
)
|
||||
|
||||
SET(Path_Images
|
||||
${PathImages_Ops}
|
||||
${PathImages_Tools}
|
||||
)
|
||||
|
||||
SET(PathData_Threads
|
||||
@@ -598,8 +599,10 @@ SET(all_files
|
||||
${PathPythonToolsAssets_SRCS}
|
||||
${PathPythonToolsAssetsStore_SRCS}
|
||||
${PathPythonToolsAssetsUi_SRCS}
|
||||
${PathPythonToolsDocObject_SRCS}
|
||||
${PathPythonToolsDocObjectModels_SRCS}
|
||||
${PathPythonToolsDocObjectUi_SRCS}
|
||||
${PathPythonToolsGui_SRCS}
|
||||
${PathPythonToolsUi_SRCS}
|
||||
${PathPythonToolsShape_SRCS}
|
||||
${PathPythonToolsShapeModels_SRCS}
|
||||
${PathPythonToolsShapeUi_SRCS}
|
||||
@@ -772,9 +775,23 @@ INSTALL(
|
||||
|
||||
INSTALL(
|
||||
FILES
|
||||
${PathPythonToolsUi_SRCS}
|
||||
${PathPythonToolsDocObject_SRCS}
|
||||
DESTINATION
|
||||
Mod/CAM/Path/Tool/ui
|
||||
Mod/CAM/Path/Tool/docobject
|
||||
)
|
||||
|
||||
INSTALL(
|
||||
FILES
|
||||
${PathPythonToolsDocObjectModels_SRCS}
|
||||
DESTINATION
|
||||
Mod/CAM/Path/Tool/docobject/models
|
||||
)
|
||||
|
||||
INSTALL(
|
||||
FILES
|
||||
${PathPythonToolsDocObjectUi_SRCS}
|
||||
DESTINATION
|
||||
Mod/CAM/Path/Tool/docobject/ui
|
||||
)
|
||||
|
||||
INSTALL(
|
||||
@@ -939,13 +956,6 @@ INSTALL(
|
||||
Mod/CAM/Images/Ops
|
||||
)
|
||||
|
||||
INSTALL(
|
||||
FILES
|
||||
${PathImages_Tools}
|
||||
DESTINATION
|
||||
Mod/CAM/Images/Tools
|
||||
)
|
||||
|
||||
INSTALL(
|
||||
FILES
|
||||
${PathData_Threads}
|
||||
|
||||
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 18 KiB |
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 36 KiB |
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 42 KiB |
@@ -1,439 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<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"
|
||||
id="svg8"
|
||||
version="1.1"
|
||||
viewBox="0 0 210 297"
|
||||
height="297mm"
|
||||
width="210mm">
|
||||
<defs
|
||||
id="defs2">
|
||||
<marker
|
||||
orient="auto"
|
||||
refY="0"
|
||||
refX="0"
|
||||
id="marker7593"
|
||||
style="overflow:visible">
|
||||
<path
|
||||
id="path7591"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.625;stroke-linejoin:round;stroke-opacity:1"
|
||||
d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
|
||||
transform="matrix(1.1,0,0,1.1,1.1,0)" />
|
||||
</marker>
|
||||
<marker
|
||||
style="overflow:visible"
|
||||
id="marker4880"
|
||||
refX="0"
|
||||
refY="0"
|
||||
orient="auto">
|
||||
<path
|
||||
transform="matrix(-1.1,0,0,-1.1,-1.1,0)"
|
||||
d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.625;stroke-linejoin:round;stroke-opacity:1"
|
||||
id="path4878" />
|
||||
</marker>
|
||||
<marker
|
||||
style="overflow:visible"
|
||||
id="marker4732"
|
||||
refX="0"
|
||||
refY="0"
|
||||
orient="auto">
|
||||
<path
|
||||
transform="matrix(1.1,0,0,1.1,1.1,0)"
|
||||
d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.625;stroke-linejoin:round;stroke-opacity:1"
|
||||
id="path4730" />
|
||||
</marker>
|
||||
<marker
|
||||
orient="auto"
|
||||
refY="0"
|
||||
refX="0"
|
||||
id="marker4584"
|
||||
style="overflow:visible">
|
||||
<path
|
||||
id="path4582"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.625;stroke-linejoin:round;stroke-opacity:1"
|
||||
d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
|
||||
transform="matrix(-1.1,0,0,-1.1,-1.1,0)" />
|
||||
</marker>
|
||||
<marker
|
||||
style="overflow:visible"
|
||||
id="marker4328"
|
||||
refX="0"
|
||||
refY="0"
|
||||
orient="auto">
|
||||
<path
|
||||
transform="matrix(-1.1,0,0,-1.1,-1.1,0)"
|
||||
d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.625;stroke-linejoin:round;stroke-opacity:1"
|
||||
id="path4326" />
|
||||
</marker>
|
||||
<marker
|
||||
orient="auto"
|
||||
refY="0"
|
||||
refX="0"
|
||||
id="marker4186"
|
||||
style="overflow:visible">
|
||||
<path
|
||||
id="path4184"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.625;stroke-linejoin:round;stroke-opacity:1"
|
||||
d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
|
||||
transform="matrix(1.1,0,0,1.1,1.1,0)" />
|
||||
</marker>
|
||||
<marker
|
||||
style="overflow:visible"
|
||||
id="marker3948"
|
||||
refX="0"
|
||||
refY="0"
|
||||
orient="auto">
|
||||
<path
|
||||
transform="matrix(1.1,0,0,1.1,1.1,0)"
|
||||
d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.625;stroke-linejoin:round;stroke-opacity:1"
|
||||
id="path3946" />
|
||||
</marker>
|
||||
<marker
|
||||
style="overflow:visible"
|
||||
id="Arrow2Lend"
|
||||
refX="0"
|
||||
refY="0"
|
||||
orient="auto">
|
||||
<path
|
||||
transform="matrix(-1.1,0,0,-1.1,-1.1,0)"
|
||||
d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
|
||||
style="fill:#000025;fill-opacity:1;fill-rule:evenodd;stroke:#000025;stroke-width:0.625;stroke-linejoin:round;stroke-opacity:1"
|
||||
id="path920" />
|
||||
</marker>
|
||||
<marker
|
||||
style="overflow:visible"
|
||||
id="Arrow2Lstart"
|
||||
refX="0"
|
||||
refY="0"
|
||||
orient="auto">
|
||||
<path
|
||||
transform="matrix(1.1,0,0,1.1,1.1,0)"
|
||||
d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
|
||||
style="fill:#000025;fill-opacity:1;fill-rule:evenodd;stroke:#000025;stroke-width:0.625;stroke-linejoin:round;stroke-opacity:1"
|
||||
id="path917" />
|
||||
</marker>
|
||||
<marker
|
||||
style="overflow:visible"
|
||||
id="marker7497"
|
||||
refX="0"
|
||||
refY="0"
|
||||
orient="auto">
|
||||
<path
|
||||
transform="scale(-0.6)"
|
||||
d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
|
||||
style="fill:#000025;fill-opacity:1;fill-rule:evenodd;stroke:#000025;stroke-width:0.625;stroke-linejoin:round;stroke-opacity:1"
|
||||
id="path7495" />
|
||||
</marker>
|
||||
<marker
|
||||
style="overflow:visible"
|
||||
id="marker7379"
|
||||
refX="0"
|
||||
refY="0"
|
||||
orient="auto">
|
||||
<path
|
||||
transform="matrix(0.4,0,0,0.4,4,0)"
|
||||
style="fill:#000025;fill-opacity:1;fill-rule:evenodd;stroke:#000025;stroke-width:1.00000003pt;stroke-opacity:1"
|
||||
d="M 0,0 5,-5 -12.5,0 5,5 Z"
|
||||
id="path7377" />
|
||||
</marker>
|
||||
<marker
|
||||
orient="auto"
|
||||
refY="0"
|
||||
refX="0"
|
||||
id="marker5480"
|
||||
style="overflow:visible">
|
||||
<path
|
||||
id="path5478"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.625;stroke-linejoin:round;stroke-opacity:1"
|
||||
d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
|
||||
transform="scale(-0.6)" />
|
||||
</marker>
|
||||
<marker
|
||||
orient="auto"
|
||||
refY="0"
|
||||
refX="0"
|
||||
id="marker5470"
|
||||
style="overflow:visible">
|
||||
<path
|
||||
id="path5468"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.625;stroke-linejoin:round;stroke-opacity:1"
|
||||
d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
|
||||
transform="scale(-0.6)" />
|
||||
</marker>
|
||||
<marker
|
||||
orient="auto"
|
||||
refY="0"
|
||||
refX="0"
|
||||
id="marker5220"
|
||||
style="overflow:visible">
|
||||
<path
|
||||
id="path5218"
|
||||
d="M 0,0 5,-5 -12.5,0 5,5 Z"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
|
||||
transform="matrix(0.4,0,0,0.4,4,0)" />
|
||||
</marker>
|
||||
<marker
|
||||
orient="auto"
|
||||
refY="0"
|
||||
refX="0"
|
||||
id="marker5210"
|
||||
style="overflow:visible">
|
||||
<path
|
||||
id="path5208"
|
||||
d="M 0,0 5,-5 -12.5,0 5,5 Z"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
|
||||
transform="matrix(0.4,0,0,0.4,4,0)" />
|
||||
</marker>
|
||||
<marker
|
||||
orient="auto"
|
||||
refY="0"
|
||||
refX="0"
|
||||
id="marker5072"
|
||||
style="overflow:visible">
|
||||
<path
|
||||
id="path5070"
|
||||
d="M 0,0 5,-5 -12.5,0 5,5 Z"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
|
||||
transform="matrix(-0.8,0,0,-0.8,-10,0)" />
|
||||
</marker>
|
||||
<marker
|
||||
orient="auto"
|
||||
refY="0"
|
||||
refX="0"
|
||||
id="marker5014"
|
||||
style="overflow:visible">
|
||||
<path
|
||||
id="path5012"
|
||||
d="M 0,0 5,-5 -12.5,0 5,5 Z"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
|
||||
transform="matrix(-0.8,0,0,-0.8,-10,0)" />
|
||||
</marker>
|
||||
<marker
|
||||
orient="auto"
|
||||
refY="0"
|
||||
refX="0"
|
||||
id="marker4968"
|
||||
style="overflow:visible">
|
||||
<path
|
||||
id="path4966"
|
||||
d="M 0,0 5,-5 -12.5,0 5,5 Z"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
|
||||
transform="matrix(-0.8,0,0,-0.8,-10,0)" />
|
||||
</marker>
|
||||
<marker
|
||||
orient="auto"
|
||||
refY="0"
|
||||
refX="0"
|
||||
id="marker4884"
|
||||
style="overflow:visible">
|
||||
<path
|
||||
id="path4882"
|
||||
d="M 0,0 5,-5 -12.5,0 5,5 Z"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
|
||||
transform="matrix(0.8,0,0,0.8,10,0)" />
|
||||
</marker>
|
||||
<marker
|
||||
orient="auto"
|
||||
refY="0"
|
||||
refX="0"
|
||||
id="marker4856"
|
||||
style="overflow:visible">
|
||||
<path
|
||||
id="path4854"
|
||||
d="M 0,0 5,-5 -12.5,0 5,5 Z"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
|
||||
transform="matrix(0.8,0,0,0.8,10,0)" />
|
||||
</marker>
|
||||
<marker
|
||||
orient="auto"
|
||||
refY="0"
|
||||
refX="0"
|
||||
id="marker4834"
|
||||
style="overflow:visible">
|
||||
<path
|
||||
id="path4832"
|
||||
d="M 0,0 5,-5 -12.5,0 5,5 Z"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
|
||||
transform="matrix(0.8,0,0,0.8,10,0)" />
|
||||
</marker>
|
||||
<marker
|
||||
orient="auto"
|
||||
refY="0"
|
||||
refX="0"
|
||||
id="marker5220-5"
|
||||
style="overflow:visible">
|
||||
<path
|
||||
id="path5218-3"
|
||||
d="M 0,0 5,-5 -12.5,0 5,5 Z"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
|
||||
transform="matrix(0.4,0,0,0.4,4,0)" />
|
||||
</marker>
|
||||
<marker
|
||||
orient="auto"
|
||||
refY="0"
|
||||
refX="0"
|
||||
id="marker5480-5"
|
||||
style="overflow:visible">
|
||||
<path
|
||||
id="path5478-7"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.625;stroke-linejoin:round;stroke-opacity:1"
|
||||
d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
|
||||
transform="scale(-0.6)" />
|
||||
</marker>
|
||||
</defs>
|
||||
<metadata
|
||||
id="metadata5">
|
||||
<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>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
transform="translate(-2.9715041,189.05423)"
|
||||
id="layer1">
|
||||
<path
|
||||
id="path3652"
|
||||
d="M 16.482124,-35.533338 H 161.08374 l -60.25067,63.90854 H 76.732798 Z"
|
||||
style="fill:#000000;fill-opacity:0.1372549;stroke:#000000;stroke-width:0.80668455;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
<path
|
||||
id="path4520"
|
||||
d="m 52.632531,-125.00529 v 89.471952 H 16.482124 l 60.250677,63.90854 h 24.100269 l 60.25067,-63.90854 h -36.15041 v -89.471952 z"
|
||||
style="fill:none;stroke:#000000;stroke-width:3.28361988px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
|
||||
<path
|
||||
id="path4526"
|
||||
d="M 88.782934,-137.787 V 41.156909"
|
||||
style="fill:none;stroke:#000000;stroke-width:1.24105322;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:9.9284259, 2.48210647, 1.24105325, 2.48210647;stroke-dashoffset:0;stroke-opacity:1" />
|
||||
<path
|
||||
id="path4528"
|
||||
d="m 52.632531,-125.00529 v -38.34513"
|
||||
style="fill:none;stroke:#000000;stroke-width:0.80668455;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
<path
|
||||
id="path4530"
|
||||
d="m 124.93333,-125.00529 v -38.34513"
|
||||
style="fill:none;stroke:#000000;stroke-width:0.80668455;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
<g
|
||||
transform="matrix(12.050135,0,0,12.781708,4.431989,-176.13213)"
|
||||
id="g7053">
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.065;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 8,16 v 2"
|
||||
id="path4536" />
|
||||
</g>
|
||||
<path
|
||||
id="path4538"
|
||||
d="M 161.08374,79.502035 V -35.533338"
|
||||
style="fill:none;stroke:#000000;stroke-width:0.80668455;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
<path
|
||||
id="path4542"
|
||||
d="M 52.632531,-150.56871 H 124.93333"
|
||||
style="fill:none;stroke:#000000;stroke-width:0.80668455;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#marker4186);marker-end:url(#marker4584)" />
|
||||
<path
|
||||
id="path4546"
|
||||
d="m 100.83307,44.466662 v 0 h 24.10026"
|
||||
style="fill:none;stroke:#000000;stroke-width:0.65865523;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#marker4732)" />
|
||||
<path
|
||||
id="path4548"
|
||||
d="M 16.482124,66.720326 H 161.08374"
|
||||
style="fill:none;stroke:#000000;stroke-width:0.80668455;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#marker3948);marker-end:url(#marker4328)" />
|
||||
<text
|
||||
transform="scale(0.97096034,1.0299082)"
|
||||
id="text5680"
|
||||
y="-150.39774"
|
||||
x="81.176964"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:35.02528px;line-height:1.25;font-family:'URW Bookman L';-inkscape-font-specification:'URW Bookman L, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:3.28361988"
|
||||
xml:space="preserve"><tspan
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:35.02528px;font-family:'URW Bookman L';-inkscape-font-specification:'URW Bookman L, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;stroke-width:3.28361988"
|
||||
y="-150.39774"
|
||||
x="81.176964"
|
||||
id="tspan5678">S</tspan></text>
|
||||
<text
|
||||
transform="scale(0.97096034,1.0299082)"
|
||||
id="text5692"
|
||||
y="96.250031"
|
||||
x="78.339798"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:35.02528px;line-height:1.25;font-family:'URW Bookman L';-inkscape-font-specification:'URW Bookman L, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:3.28361988"
|
||||
xml:space="preserve"><tspan
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:35.02528px;font-family:'URW Bookman L';-inkscape-font-specification:'URW Bookman L, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;stroke-width:3.28361988"
|
||||
y="96.250031"
|
||||
x="78.339798"
|
||||
id="tspan5690">D</tspan></text>
|
||||
<path
|
||||
transform="matrix(-0.00747619,-0.99997205,0.99996462,-0.00841146,0,0)"
|
||||
d="M 13.451117,38.457364 A 76.688599,72.377235 0 0 1 12.422369,139.63833"
|
||||
id="path5698"
|
||||
style="fill:none;fill-opacity:1;stroke:#000025;stroke-width:0.80668473;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker-start:url(#Arrow2Lstart);marker-end:url(#Arrow2Lend)" />
|
||||
<text
|
||||
transform="scale(0.97096033,1.0299082)"
|
||||
id="text5688-7"
|
||||
y="-39.443188"
|
||||
x="95.738831"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:35.02528px;line-height:1.25;font-family:'URW Bookman L';-inkscape-font-specification:'URW Bookman L, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:3.28361988"
|
||||
xml:space="preserve"><tspan
|
||||
style="stroke-width:3.28361988"
|
||||
y="-39.443188"
|
||||
x="95.738831"
|
||||
id="tspan5718">α</tspan></text>
|
||||
<text
|
||||
transform="scale(0.97096033,1.0299082)"
|
||||
id="text5692-8"
|
||||
y="51.168293"
|
||||
x="28.921215"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:35.02528px;line-height:1.25;font-family:'URW Bookman L';-inkscape-font-specification:'URW Bookman L, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:3.28361988"
|
||||
xml:space="preserve"><tspan
|
||||
style="stroke-width:3.28361988"
|
||||
y="51.168293"
|
||||
x="28.921215"
|
||||
id="tspan10475">d</tspan></text>
|
||||
<path
|
||||
id="path4546-7"
|
||||
d="m 50.833067,44.466662 v 0 h 24.100267"
|
||||
style="fill:none;stroke:#000000;stroke-width:0.65865511;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker4880)" />
|
||||
<g
|
||||
id="g7053-6"
|
||||
transform="matrix(12.050135,0,0,12.781708,-19.668283,-176.13213)">
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.065;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 8,16 v 2"
|
||||
id="path4536-1" />
|
||||
</g>
|
||||
<path
|
||||
id="path4538-8"
|
||||
d="M 16.482124,79.502035 V -35.533338"
|
||||
style="fill:none;stroke:#000000;stroke-width:0.80668455;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
<path
|
||||
id="path4548-6"
|
||||
d="m 160.33172,-35.533338 24.60161,0"
|
||||
style="fill:none;stroke:#000000;stroke-width:0.68599999;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
<path
|
||||
id="path4548-6-8"
|
||||
d="m 100.93333,28.466662 84,0"
|
||||
style="fill:none;stroke:#000000;stroke-width:0.75753552;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
<path
|
||||
id="path4538-7"
|
||||
d="m 174.93333,28.466662 0,-64"
|
||||
style="fill:none;stroke:#000000;stroke-width:0.80668455;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#marker7593);marker-end:url(#marker5072)" />
|
||||
<text
|
||||
transform="scale(0.97096033,1.0299082)"
|
||||
id="text5692-9"
|
||||
y="9.0554771"
|
||||
x="185.5818"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:35.02518845px;line-height:1.25;font-family:'URW Bookman L';-inkscape-font-specification:'URW Bookman L, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:3.28361988"
|
||||
xml:space="preserve"><tspan
|
||||
y="9.0554771"
|
||||
x="185.5818"
|
||||
id="tspan7855">H</tspan></text>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 20 KiB |
@@ -22,11 +22,39 @@
|
||||
# * *
|
||||
# ***************************************************************************
|
||||
import FreeCAD
|
||||
from PySide.QtCore import QT_TRANSLATE_NOOP
|
||||
import Path.Dressup.Gui.Preferences as PathPreferencesPathDressup
|
||||
import Path.Tool.assets.ui.preferences as AssetPreferences
|
||||
import Path.Main.Gui.PreferencesJob as PathPreferencesPathJob
|
||||
import Path.Base.Gui.PreferencesAdvanced as PathPreferencesAdvanced
|
||||
import Path.Op.Base
|
||||
import Path.Tool
|
||||
|
||||
|
||||
FreeCAD.__unit_test__ += ["TestCAMGui"]
|
||||
|
||||
|
||||
if FreeCAD.GuiUp:
|
||||
import FreeCADGui
|
||||
|
||||
FreeCADGui.addPreferencePage(
|
||||
PathPreferencesPathJob.JobPreferencesPage,
|
||||
QT_TRANSLATE_NOOP("QObject", "CAM"),
|
||||
)
|
||||
FreeCADGui.addPreferencePage(
|
||||
AssetPreferences.AssetPreferencesPage,
|
||||
QT_TRANSLATE_NOOP("QObject", "CAM"),
|
||||
)
|
||||
FreeCADGui.addPreferencePage(
|
||||
PathPreferencesPathDressup.DressupPreferencesPage,
|
||||
QT_TRANSLATE_NOOP("QObject", "CAM"),
|
||||
)
|
||||
FreeCADGui.addPreferencePage(
|
||||
PathPreferencesAdvanced.AdvancedPreferencesPage,
|
||||
QT_TRANSLATE_NOOP("QObject", "CAM"),
|
||||
)
|
||||
|
||||
|
||||
class PathCommandGroup:
|
||||
def __init__(self, cmdlist, menu, tooltip=None):
|
||||
self.cmdlist = cmdlist
|
||||
@@ -66,13 +94,10 @@ class CAMWorkbench(Workbench):
|
||||
import Path.Tool.assets.ui.preferences as AssetPreferences
|
||||
import Path.Main.Gui.PreferencesJob as PathPreferencesPathJob
|
||||
|
||||
translate = FreeCAD.Qt.translate
|
||||
|
||||
# load the builtin modules
|
||||
import Path
|
||||
import PathScripts
|
||||
import PathGui
|
||||
from PySide import QtCore, QtGui
|
||||
|
||||
FreeCADGui.addLanguagePath(":/translations")
|
||||
FreeCADGui.addIconPath(":/icons")
|
||||
@@ -89,19 +114,6 @@ class CAMWorkbench(Workbench):
|
||||
import subprocess
|
||||
from packaging.version import Version, parse
|
||||
|
||||
FreeCADGui.addPreferencePage(
|
||||
PathPreferencesPathJob.JobPreferencesPage,
|
||||
QT_TRANSLATE_NOOP("QObject", "CAM"),
|
||||
)
|
||||
FreeCADGui.addPreferencePage(
|
||||
AssetPreferences.AssetPreferencesPage,
|
||||
QT_TRANSLATE_NOOP("QObject", "CAM"),
|
||||
)
|
||||
FreeCADGui.addPreferencePage(
|
||||
PathPreferencesPathDressup.DressupPreferencesPage,
|
||||
QT_TRANSLATE_NOOP("QObject", "CAM"),
|
||||
)
|
||||
|
||||
Path.GuiInit.Startup()
|
||||
|
||||
# build commands list
|
||||
@@ -126,6 +138,7 @@ class CAMWorkbench(Workbench):
|
||||
"CAM_MillFace",
|
||||
"CAM_Helix",
|
||||
"CAM_Adaptive",
|
||||
"CAM_Slot",
|
||||
]
|
||||
threedopcmdlist = ["CAM_Pocket3D"]
|
||||
engravecmdlist = ["CAM_Engrave", "CAM_Deburr", "CAM_Vcarve"]
|
||||
@@ -177,7 +190,6 @@ class CAMWorkbench(Workbench):
|
||||
prepcmdlist.append("CAM_PathShapeTC")
|
||||
extracmdlist.extend(["CAM_Area", "CAM_Area_Workplane"])
|
||||
specialcmdlist.append("CAM_ThreadMilling")
|
||||
twodopcmdlist.append("CAM_Slot")
|
||||
|
||||
if Path.Preferences.advancedOCLFeaturesEnabled():
|
||||
try:
|
||||
@@ -291,14 +303,6 @@ class CAMWorkbench(Workbench):
|
||||
if curveAccuracy:
|
||||
Path.Area.setDefaultParams(Accuracy=curveAccuracy)
|
||||
|
||||
# keep this one the last entry in the preferences
|
||||
import Path.Base.Gui.PreferencesAdvanced as PathPreferencesAdvanced
|
||||
from Path.Preferences import preferences
|
||||
|
||||
FreeCADGui.addPreferencePage(
|
||||
PathPreferencesAdvanced.AdvancedPreferencesPage,
|
||||
QT_TRANSLATE_NOOP("QObject", "CAM"),
|
||||
)
|
||||
Log("Loading CAM workbench... done\n")
|
||||
|
||||
def GetClassName(self):
|
||||
@@ -314,8 +318,6 @@ class CAMWorkbench(Workbench):
|
||||
pass
|
||||
|
||||
def ContextMenu(self, recipient):
|
||||
import PathScripts
|
||||
|
||||
menuAppended = False
|
||||
if len(FreeCADGui.Selection.getSelection()) == 1:
|
||||
obj = FreeCADGui.Selection.getSelection()[0]
|
||||
|
||||
@@ -33,8 +33,12 @@ else:
|
||||
class AdvancedPreferencesPage:
|
||||
def __init__(self, parent=None):
|
||||
self.form = FreeCADGui.PySideUic.loadUi(":preferences/Advanced.ui")
|
||||
self.form.WarningSuppressAllSpeeds.stateChanged.connect(self.updateSelection)
|
||||
self.form.EnableAdvancedOCLFeatures.stateChanged.connect(self.updateSelection)
|
||||
if hasattr(self.form.WarningSuppressAllSpeeds, "checkStateChanged"): # Qt version >= 6.7.0
|
||||
self.form.WarningSuppressAllSpeeds.checkStateChanged.connect(self.updateSelection)
|
||||
self.form.EnableAdvancedOCLFeatures.checkStateChanged.connect(self.updateSelection)
|
||||
else: # Qt version < 6.7.0
|
||||
self.form.WarningSuppressAllSpeeds.stateChanged.connect(self.updateSelection)
|
||||
self.form.EnableAdvancedOCLFeatures.stateChanged.connect(self.updateSelection)
|
||||
|
||||
def saveSettings(self):
|
||||
Path.Preferences.setPreferencesAdvanced(
|
||||
|
||||
@@ -182,7 +182,10 @@ class TaskPanel(object):
|
||||
self.form.stockInside.setChecked(self.obj.Inside)
|
||||
|
||||
self.form.stock.currentIndexChanged.connect(self.updateStockEditor)
|
||||
self.form.stockInside.stateChanged.connect(self.setDirty)
|
||||
if hasattr(self.form.stockInside, "checkStateChanged"): # Qt version >= 6.7.0
|
||||
self.form.stockInside.checkStateChanged.connect(self.setDirty)
|
||||
else: # Qt version < 6.7.0
|
||||
self.form.stockInside.stateChanged.connect(self.setDirty)
|
||||
self.form.stockExtXneg.textChanged.connect(self.setDirty)
|
||||
self.form.stockExtXpos.textChanged.connect(self.setDirty)
|
||||
self.form.stockExtYneg.textChanged.connect(self.setDirty)
|
||||
|
||||
@@ -150,6 +150,15 @@ class ViewProvider:
|
||||
def onChanged(self, vobj, prop):
|
||||
if prop == "Visibility":
|
||||
self.showOriginAxis(vobj.Visibility)
|
||||
|
||||
# if we're currently restoring the document we do NOT want to call
|
||||
# hideXXX as this would mark all currently hidden children as
|
||||
# explicitly hidden by the user and prevent showing them when
|
||||
# showing the job
|
||||
|
||||
if self.obj.Document.Restoring:
|
||||
return
|
||||
|
||||
if vobj.Visibility:
|
||||
self.restoreOperationsVisibility()
|
||||
self.restoreModelsVisibility()
|
||||
@@ -170,7 +179,8 @@ class ViewProvider:
|
||||
def restoreOperationsVisibility(self):
|
||||
if hasattr(self, "operationsVisibility"):
|
||||
for op in self.obj.Operations.Group:
|
||||
op.Visibility = self.operationsVisibility[op.Name]
|
||||
if self.operationsVisibility.get(op.Name, True):
|
||||
op.Visibility = True
|
||||
else:
|
||||
for op in self.obj.Operations.Group:
|
||||
op.Visibility = True
|
||||
@@ -183,11 +193,12 @@ class ViewProvider:
|
||||
|
||||
def restoreModelsVisibility(self):
|
||||
if hasattr(self, "modelsVisibility"):
|
||||
for base in self.obj.Model.Group:
|
||||
base.Visibility = self.modelsVisibility[base.Name]
|
||||
for model in self.obj.Model.Group:
|
||||
if self.modelsVisibility.get(model.Name, True):
|
||||
model.Visibility = True
|
||||
else:
|
||||
for base in self.obj.Model.Group:
|
||||
base.Visibility = True
|
||||
for model in self.obj.Model.Group:
|
||||
model.Visibility = True
|
||||
|
||||
def hideStock(self):
|
||||
self.stockVisibility = self.obj.Stock.Visibility
|
||||
@@ -195,7 +206,8 @@ class ViewProvider:
|
||||
|
||||
def restoreStockVisibility(self):
|
||||
if hasattr(self, "stockVisibility"):
|
||||
self.obj.Stock.Visibility = self.stockVisibility
|
||||
if self.stockVisibility:
|
||||
self.obj.Stock.Visibility = True
|
||||
|
||||
def hideTools(self):
|
||||
self.toolsVisibility = {}
|
||||
@@ -206,7 +218,8 @@ class ViewProvider:
|
||||
def restoreToolsVisibility(self):
|
||||
if hasattr(self, "toolsVisibility"):
|
||||
for tc in self.obj.Tools.Group:
|
||||
tc.Tool.Visibility = self.toolsVisibility[tc.Tool.Name]
|
||||
if self.toolsVisibility.get(tc.Tool.Name, True):
|
||||
tc.Tool.Visibility = True
|
||||
|
||||
def showOriginAxis(self, yes):
|
||||
sw = coin.SO_SWITCH_ALL if yes else coin.SO_SWITCH_NONE
|
||||
|
||||
@@ -163,11 +163,26 @@ class ObjectCustom(PathOp.ObjectOp):
|
||||
|
||||
def opExecute(self, obj):
|
||||
self.commandlist.append(Path.Command("(Begin Custom)"))
|
||||
errorNumLines = []
|
||||
errorLines = []
|
||||
counter = 0
|
||||
|
||||
if obj.Source == "Text" and obj.Gcode:
|
||||
for l in obj.Gcode:
|
||||
newcommand = Path.Command(str(l))
|
||||
self.commandlist.append(newcommand)
|
||||
counter += 1
|
||||
try:
|
||||
newcommand = Path.Command(str(l))
|
||||
self.commandlist.append(newcommand)
|
||||
except ValueError:
|
||||
errorNumLines.append(counter)
|
||||
if len(errorLines) < 7:
|
||||
errorLines.append(f"{counter}: {str(l).strip()}")
|
||||
if errorLines:
|
||||
Path.Log.warning(
|
||||
translate("PathCustom", "Total invalid lines in Custom Text G-code: %s")
|
||||
% len(errorNumLines)
|
||||
)
|
||||
|
||||
elif obj.Source == "File" and len(obj.GcodeFile) > 0:
|
||||
gcode_file = self.findGcodeFile(obj.GcodeFile)
|
||||
|
||||
@@ -176,15 +191,33 @@ class ObjectCustom(PathOp.ObjectOp):
|
||||
Path.Log.error(
|
||||
translate("PathCustom", "Custom file %s could not be found.") % obj.GcodeFile
|
||||
)
|
||||
else:
|
||||
with open(gcode_file) as fd:
|
||||
for l in fd.readlines():
|
||||
counter += 1
|
||||
try:
|
||||
newcommand = Path.Command(str(l))
|
||||
self.commandlist.append(newcommand)
|
||||
except ValueError:
|
||||
errorNumLines.append(counter)
|
||||
if len(errorLines) < 7:
|
||||
errorLines.append(f"{counter}: {str(l).strip()}")
|
||||
if errorLines:
|
||||
Path.Log.warning(f'"{gcode_file}"')
|
||||
Path.Log.warning(
|
||||
translate("PathCustom", "Total invalid lines in Custom File G-code: %s")
|
||||
% len(errorNumLines)
|
||||
)
|
||||
|
||||
with open(gcode_file) as fd:
|
||||
for l in fd.readlines():
|
||||
try:
|
||||
newcommand = Path.Command(str(l))
|
||||
self.commandlist.append(newcommand)
|
||||
except ValueError:
|
||||
Path.Log.warning(translate("PathCustom", "Invalid G-code line: %s") % l)
|
||||
continue
|
||||
if errorNumLines:
|
||||
Path.Log.warning(
|
||||
translate("PathCustom", "Please check lines: %s")
|
||||
% ", ".join(map(str, errorNumLines))
|
||||
)
|
||||
|
||||
if len(errorLines) > 7:
|
||||
errorLines.append("...")
|
||||
Path.Log.warning("\n" + "\n".join(errorLines))
|
||||
|
||||
self.commandlist.append(Path.Command("(End Custom)"))
|
||||
|
||||
|
||||
@@ -68,10 +68,16 @@ class TaskPanelOpPage(PathOpGui.TaskPanelPage):
|
||||
signals.append(self.form.StockToLeave.valueChanged)
|
||||
signals.append(self.form.ZStockToLeave.valueChanged)
|
||||
signals.append(self.form.coolantController.currentIndexChanged)
|
||||
signals.append(self.form.ForceInsideOut.stateChanged)
|
||||
signals.append(self.form.FinishingProfile.stateChanged)
|
||||
signals.append(self.form.useOutline.stateChanged)
|
||||
signals.append(self.form.orderCutsByRegion.stateChanged)
|
||||
if hasattr(self.form.ForceInsideOut, "checkStateChanged"): # Qt version >= 6.7.0
|
||||
signals.append(self.form.ForceInsideOut.checkStateChanged)
|
||||
signals.append(self.form.FinishingProfile.checkStateChanged)
|
||||
signals.append(self.form.useOutline.checkStateChanged)
|
||||
signals.append(self.form.orderCutsByRegion.checkStateChanged)
|
||||
else: # Qt version < 6.7.0
|
||||
signals.append(self.form.ForceInsideOut.stateChanged)
|
||||
signals.append(self.form.FinishingProfile.stateChanged)
|
||||
signals.append(self.form.useOutline.stateChanged)
|
||||
signals.append(self.form.orderCutsByRegion.stateChanged)
|
||||
signals.append(self.form.StopButton.toggled)
|
||||
return signals
|
||||
|
||||
|
||||
@@ -188,15 +188,23 @@ class TaskPanelOpPage(PathCircularHoleBaseGui.TaskPanelOpPage):
|
||||
signals.append(self.form.peckRetractHeight.editingFinished)
|
||||
signals.append(self.form.peckDepth.editingFinished)
|
||||
signals.append(self.form.dwellTime.editingFinished)
|
||||
signals.append(self.form.dwellEnabled.stateChanged)
|
||||
signals.append(self.form.peckEnabled.stateChanged)
|
||||
signals.append(self.form.chipBreakEnabled.stateChanged)
|
||||
if hasattr(self.form.dwellEnabled, "checkStateChanged"): # Qt version >= 6.7.0
|
||||
signals.append(self.form.dwellEnabled.checkStateChanged)
|
||||
signals.append(self.form.peckEnabled.checkStateChanged)
|
||||
signals.append(self.form.chipBreakEnabled.checkStateChanged)
|
||||
else: # Qt version < 6.7.0
|
||||
signals.append(self.form.dwellEnabled.stateChanged)
|
||||
signals.append(self.form.peckEnabled.stateChanged)
|
||||
signals.append(self.form.chipBreakEnabled.stateChanged)
|
||||
signals.append(self.form.toolController.currentIndexChanged)
|
||||
signals.append(self.form.coolantController.currentIndexChanged)
|
||||
signals.append(self.form.ExtraOffset.currentIndexChanged)
|
||||
signals.append(self.form.KeepToolDownEnabled.stateChanged)
|
||||
signals.append(self.form.feedRetractEnabled.stateChanged)
|
||||
|
||||
if hasattr(self.form.KeepToolDownEnabled, "checkStateChanged"): # Qt version >= 6.7.0
|
||||
signals.append(self.form.KeepToolDownEnabled.checkStateChanged)
|
||||
signals.append(self.form.feedRetractEnabled.checkStateChanged)
|
||||
else: # Qt version < 6.7.0
|
||||
signals.append(self.form.KeepToolDownEnabled.stateChanged)
|
||||
signals.append(self.form.feedRetractEnabled.stateChanged)
|
||||
return signals
|
||||
|
||||
def updateData(self, obj, prop):
|
||||
|
||||
@@ -125,11 +125,18 @@ class TaskPanelOpPage(PathOpGui.TaskPanelPage):
|
||||
signals.append(self.form.extraOffset.editingFinished)
|
||||
signals.append(self.form.numPasses.editingFinished)
|
||||
signals.append(self.form.stepover.editingFinished)
|
||||
signals.append(self.form.useCompensation.stateChanged)
|
||||
signals.append(self.form.useStartPoint.stateChanged)
|
||||
signals.append(self.form.processHoles.stateChanged)
|
||||
signals.append(self.form.processPerimeter.stateChanged)
|
||||
signals.append(self.form.processCircles.stateChanged)
|
||||
if hasattr(self.form.useCompensation, "checkStateChanged"): # Qt version >= 6.7.0
|
||||
signals.append(self.form.useCompensation.checkStateChanged)
|
||||
signals.append(self.form.useStartPoint.checkStateChanged)
|
||||
signals.append(self.form.processHoles.checkStateChanged)
|
||||
signals.append(self.form.processPerimeter.checkStateChanged)
|
||||
signals.append(self.form.processCircles.checkStateChanged)
|
||||
else: # Qt version < 6.7.0
|
||||
signals.append(self.form.useCompensation.stateChanged)
|
||||
signals.append(self.form.useStartPoint.stateChanged)
|
||||
signals.append(self.form.processHoles.stateChanged)
|
||||
signals.append(self.form.processPerimeter.stateChanged)
|
||||
signals.append(self.form.processCircles.stateChanged)
|
||||
|
||||
return signals
|
||||
|
||||
@@ -159,7 +166,10 @@ class TaskPanelOpPage(PathOpGui.TaskPanelPage):
|
||||
self.form.stepover.setEnabled(self.obj.NumPasses > 1)
|
||||
|
||||
def registerSignalHandlers(self, obj):
|
||||
self.form.useCompensation.stateChanged.connect(self.updateVisibility)
|
||||
if hasattr(self.form.useCompensation, "checkStateChanged"): # Qt version >= 6.7.0
|
||||
self.form.useCompensation.checkStateChanged.connect(self.updateVisibility)
|
||||
else: # Qt version < 6.7.0
|
||||
self.form.useCompensation.stateChanged.connect(self.updateVisibility)
|
||||
self.form.numPasses.editingFinished.connect(self.updateVisibility)
|
||||
|
||||
|
||||
|
||||
@@ -142,7 +142,10 @@ class TaskPanelOpPage(PathOpGui.TaskPanelPage):
|
||||
signals.append(self.form.geo2Reference.currentIndexChanged)
|
||||
signals.append(self.form.layerMode.currentIndexChanged)
|
||||
signals.append(self.form.pathOrientation.currentIndexChanged)
|
||||
signals.append(self.form.reverseDirection.stateChanged)
|
||||
if hasattr(self.form.reverseDirection, "checkStateChanged"): # Qt version >= 6.7.0
|
||||
signals.append(self.form.reverseDirection.checkStateChanged)
|
||||
else: # Qt version < 6.7.0
|
||||
signals.append(self.form.reverseDirection.stateChanged)
|
||||
return signals
|
||||
|
||||
def updateVisibility(self, sentObj=None):
|
||||
|
||||
@@ -217,10 +217,16 @@ class TaskPanelOpPage(PathOpGui.TaskPanelPage):
|
||||
signals.append(self.form.depthOffset.editingFinished)
|
||||
signals.append(self.form.stepOver.editingFinished)
|
||||
signals.append(self.form.sampleInterval.editingFinished)
|
||||
signals.append(self.form.useStartPoint.stateChanged)
|
||||
signals.append(self.form.boundaryEnforcement.stateChanged)
|
||||
signals.append(self.form.optimizeEnabled.stateChanged)
|
||||
signals.append(self.form.optimizeStepOverTransitions.stateChanged)
|
||||
if hasattr(self.form.useStartPoint, "checkStateChanged"): # Qt version >= 6.7.0
|
||||
signals.append(self.form.useStartPoint.checkStateChanged)
|
||||
signals.append(self.form.boundaryEnforcement.checkStateChanged)
|
||||
signals.append(self.form.optimizeEnabled.checkStateChanged)
|
||||
signals.append(self.form.optimizeStepOverTransitions.checkStateChanged)
|
||||
else: # Qt version < 6.7.0
|
||||
signals.append(self.form.useStartPoint.stateChanged)
|
||||
signals.append(self.form.boundaryEnforcement.stateChanged)
|
||||
signals.append(self.form.optimizeEnabled.stateChanged)
|
||||
signals.append(self.form.optimizeStepOverTransitions.stateChanged)
|
||||
|
||||
return signals
|
||||
|
||||
|
||||
@@ -229,7 +229,10 @@ class TaskPanelOpPage(PathCircularHoleBaseGui.TaskPanelOpPage):
|
||||
signals.append(self.form.threadTPI.editingFinished)
|
||||
signals.append(self.form.opDirection.currentIndexChanged)
|
||||
signals.append(self.form.opPasses.editingFinished)
|
||||
signals.append(self.form.leadInOut.stateChanged)
|
||||
if hasattr(self.form.leadInOut, "checkStateChanged"): # Qt version >= 6.7.0
|
||||
signals.append(self.form.leadInOut.checkStateChanged)
|
||||
else: # Qt version < 6.7.0
|
||||
signals.append(self.form.leadInOut.stateChanged)
|
||||
|
||||
signals.append(self.form.toolController.currentIndexChanged)
|
||||
|
||||
|
||||
@@ -126,7 +126,10 @@ class TaskPanelOpPage(PathOpGui.TaskPanelPage):
|
||||
signals.append(self.form.boundaryAdjustment.editingFinished)
|
||||
signals.append(self.form.stepOver.editingFinished)
|
||||
signals.append(self.form.sampleInterval.editingFinished)
|
||||
signals.append(self.form.optimizeEnabled.stateChanged)
|
||||
if hasattr(self.form.optimizeEnabled, "checkStateChanged"): # Qt version >= 6.7.0
|
||||
signals.append(self.form.optimizeEnabled.checkStateChanged)
|
||||
else: # Qt version < 6.7.0
|
||||
signals.append(self.form.optimizeEnabled.stateChanged)
|
||||
|
||||
return signals
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -222,6 +222,13 @@ class PostProcessor:
|
||||
curlist = [] # list of ops for tool, will repeat for each fixture
|
||||
sublist = [] # list of ops for output splitting
|
||||
|
||||
def commitToPostlist():
|
||||
if len(curlist) > 0:
|
||||
for fixture in fixturelist:
|
||||
sublist.append(fixture)
|
||||
sublist.extend(curlist)
|
||||
postlist.append((toolstring, sublist))
|
||||
|
||||
Path.Log.track(self._job.PostProcessorOutputFile)
|
||||
for idx, obj in enumerate(self._job.Operations.Group):
|
||||
Path.Log.track(obj.Label)
|
||||
@@ -231,40 +238,36 @@ class PostProcessor:
|
||||
Path.Log.track()
|
||||
continue
|
||||
|
||||
# Determine the proper string for the Op's TC
|
||||
tc = PathUtil.toolControllerForOp(obj)
|
||||
if tc is None:
|
||||
tcstring = "None"
|
||||
elif "%T" in self._job.PostProcessorOutputFile:
|
||||
tcstring = f"{tc.ToolNumber}"
|
||||
else:
|
||||
tcstring = re.sub(r"[^\w\d-]", "_", tc.Label)
|
||||
Path.Log.track(toolstring)
|
||||
|
||||
# The operation has no ToolController or uses the same
|
||||
# ToolController as the previous operations
|
||||
|
||||
if tc is None or tc.ToolNumber == currTool:
|
||||
# Queue current operation
|
||||
curlist.append(obj)
|
||||
elif tc.ToolNumber != currTool and currTool is None: # first TC
|
||||
sublist.append(tc)
|
||||
curlist.append(obj)
|
||||
currTool = tc.ToolNumber
|
||||
toolstring = tcstring
|
||||
|
||||
elif tc.ToolNumber != currTool and currTool is not None: # TC
|
||||
for fixture in fixturelist:
|
||||
sublist.append(fixture)
|
||||
sublist.extend(curlist)
|
||||
postlist.append((toolstring, sublist))
|
||||
# The operation is the first operation or uses a different
|
||||
# ToolController as the previous operations
|
||||
|
||||
else:
|
||||
# Commit previous operations
|
||||
commitToPostlist()
|
||||
|
||||
# Queue current ToolController and operation
|
||||
sublist = [tc]
|
||||
curlist = [obj]
|
||||
currTool = tc.ToolNumber
|
||||
toolstring = tcstring
|
||||
|
||||
if idx == len(self._job.Operations.Group) - 1: # Last operation.
|
||||
for fixture in fixturelist:
|
||||
sublist.append(fixture)
|
||||
sublist.extend(curlist)
|
||||
# Determine the proper string for the operation's
|
||||
# ToolController
|
||||
if "%T" in self._job.PostProcessorOutputFile:
|
||||
toolstring = f"{tc.ToolNumber}"
|
||||
else:
|
||||
toolstring = re.sub(r"[^\w\d-]", "_", tc.Label)
|
||||
|
||||
postlist.append((toolstring, sublist))
|
||||
# Commit remaining operations
|
||||
commitToPostlist()
|
||||
|
||||
elif orderby == "Operation":
|
||||
Path.Log.debug("Ordering by Operation")
|
||||
|
||||
@@ -82,6 +82,8 @@ def init_argument_defaults(argument_defaults: Dict[str, bool]) -> None:
|
||||
argument_defaults["metric_inches"] = True
|
||||
argument_defaults["modal"] = False
|
||||
argument_defaults["output_all_arguments"] = False
|
||||
argument_defaults["output_machine_name"] = False
|
||||
argument_defaults["output_path_labels"] = False
|
||||
argument_defaults["output_visible_arguments"] = False
|
||||
argument_defaults["show-editor"] = True
|
||||
argument_defaults["tlo"] = True
|
||||
@@ -102,6 +104,7 @@ def init_arguments_visible(arguments_visible: Dict[str, bool]) -> None:
|
||||
arguments_visible["enable_machine_specific_commands"] = False
|
||||
arguments_visible["end_of_line_characters"] = False
|
||||
arguments_visible["feed-precision"] = True
|
||||
arguments_visible["finish_label"] = False
|
||||
arguments_visible["header"] = True
|
||||
arguments_visible["line_number_increment"] = False
|
||||
arguments_visible["line_number_start"] = False
|
||||
@@ -110,8 +113,11 @@ def init_arguments_visible(arguments_visible: Dict[str, bool]) -> None:
|
||||
arguments_visible["metric_inches"] = True
|
||||
arguments_visible["modal"] = True
|
||||
arguments_visible["output_all_arguments"] = True
|
||||
arguments_visible["output_machine_name"] = False
|
||||
arguments_visible["output_path_labels"] = False
|
||||
arguments_visible["output_visible_arguments"] = True
|
||||
arguments_visible["postamble"] = True
|
||||
arguments_visible["post_operation"] = False
|
||||
arguments_visible["preamble"] = True
|
||||
arguments_visible["precision"] = True
|
||||
arguments_visible["return-to"] = False
|
||||
@@ -263,6 +269,17 @@ def init_shared_arguments(
|
||||
type=int,
|
||||
help=help_message,
|
||||
)
|
||||
if arguments_visible["finish_label"]:
|
||||
help_message = (
|
||||
"The characters to use in the 'Finish operation' comment, "
|
||||
f'default is "{values["FINISH_LABEL"]}"'
|
||||
)
|
||||
else:
|
||||
help_message = argparse.SUPPRESS
|
||||
shared.add_argument(
|
||||
"--finish_label",
|
||||
help=help_message,
|
||||
)
|
||||
add_flag_type_arguments(
|
||||
shared,
|
||||
argument_defaults["header"],
|
||||
@@ -332,6 +349,24 @@ def init_shared_arguments(
|
||||
"Don't output all of the available arguments",
|
||||
arguments_visible["output_all_arguments"],
|
||||
)
|
||||
add_flag_type_arguments(
|
||||
shared,
|
||||
argument_defaults["output_machine_name"],
|
||||
"--output_machine_name",
|
||||
"--no-output_machine_name",
|
||||
"Output the machine name in the pre-operation information",
|
||||
"Don't output the machine name in the pre-operation information",
|
||||
arguments_visible["output_machine_name"],
|
||||
)
|
||||
add_flag_type_arguments(
|
||||
shared,
|
||||
argument_defaults["output_path_labels"],
|
||||
"--output_path_labels",
|
||||
"--no-output_path_labels",
|
||||
"Output Path labels at the beginning of each Path",
|
||||
"Don't output Path labels at the beginning of each Path",
|
||||
arguments_visible["output_path_labels"],
|
||||
)
|
||||
add_flag_type_arguments(
|
||||
shared,
|
||||
argument_defaults["output_visible_arguments"],
|
||||
@@ -349,6 +384,14 @@ def init_shared_arguments(
|
||||
else:
|
||||
help_message = argparse.SUPPRESS
|
||||
shared.add_argument("--postamble", help=help_message)
|
||||
if arguments_visible["post_operation"]:
|
||||
help_message = (
|
||||
f"Set commands to be issued after every operation, "
|
||||
f'default is "{values["POST_OPERATION"]}"'
|
||||
)
|
||||
else:
|
||||
help_message = argparse.SUPPRESS
|
||||
shared.add_argument("--post_operation", help=help_message)
|
||||
if arguments_visible["preamble"]:
|
||||
help_message = (
|
||||
f"Set commands to be issued before the first command, "
|
||||
@@ -817,6 +860,8 @@ def process_shared_arguments(
|
||||
values["END_OF_LINE_CHARACTERS"] = "\r\n"
|
||||
else:
|
||||
print("invalid end_of_line_characters, ignoring")
|
||||
if args.finish_label:
|
||||
values["FINISH_LABEL"] = args.finish_label
|
||||
if args.header:
|
||||
values["OUTPUT_HEADER"] = True
|
||||
if args.no_header:
|
||||
@@ -837,8 +882,18 @@ def process_shared_arguments(
|
||||
values["MODAL"] = True
|
||||
if args.no_modal:
|
||||
values["MODAL"] = False
|
||||
if args.output_machine_name:
|
||||
values["OUTPUT_MACHINE_NAME"] = True
|
||||
if args.no_output_machine_name:
|
||||
values["OUTPUT_MACHINE_NAME"] = False
|
||||
if args.output_path_labels:
|
||||
values["OUTPUT_PATH_LABELS"] = True
|
||||
if args.no_output_path_labels:
|
||||
values["OUTPUT_PATH_LABELS"] = False
|
||||
if args.postamble is not None:
|
||||
values["POSTAMBLE"] = args.postamble.replace("\\n", "\n")
|
||||
if args.post_operation is not None:
|
||||
values["POST_OPERATION"] = args.post_operation.replace("\\n", "\n")
|
||||
if args.preamble is not None:
|
||||
values["PREAMBLE"] = args.preamble.replace("\\n", "\n")
|
||||
if args.return_to != "":
|
||||
|
||||
3
src/Mod/CAM/Path/Tool/docobject/__init__.py
Normal file
3
src/Mod/CAM/Path/Tool/docobject/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from .models.docobject import DetachedDocumentObject
|
||||
|
||||
__all__ = ["DetachedDocumentObject"]
|
||||
3
src/Mod/CAM/Path/Tool/docobject/ui/__init__.py
Normal file
3
src/Mod/CAM/Path/Tool/docobject/ui/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from .docobject import DocumentObjectEditorWidget
|
||||
|
||||
__all__ = ["DocumentObjectEditorWidget"]
|
||||
@@ -33,10 +33,10 @@ from lazy_loader.lazy_loader import LazyLoader
|
||||
from typing import Any, List, Optional, Tuple, Type, Union, Mapping, cast
|
||||
from PySide.QtCore import QT_TRANSLATE_NOOP
|
||||
from Path.Base.Generator import toolchange
|
||||
from ...assets import Asset
|
||||
from ...docobject import DetachedDocumentObject
|
||||
from ...assets.asset import Asset
|
||||
from ...camassets import cam_assets
|
||||
from ...shape import ToolBitShape, ToolBitShapeCustom, ToolBitShapeIcon
|
||||
from ..docobject import DetachedDocumentObject
|
||||
from ..util import to_json, format_value
|
||||
|
||||
|
||||
|
||||
@@ -22,13 +22,12 @@
|
||||
|
||||
"""Widget for editing a ToolBit object."""
|
||||
|
||||
from functools import partial
|
||||
import FreeCAD
|
||||
import FreeCADGui
|
||||
from PySide import QtGui, QtCore
|
||||
from ..models.base import ToolBit
|
||||
from ...shape.ui.shapewidget import ShapeWidget
|
||||
from ...ui.docobject import DocumentObjectEditorWidget
|
||||
from ...docobject.ui import DocumentObjectEditorWidget
|
||||
from ..models.base import ToolBit
|
||||
|
||||
|
||||
class ToolBitPropertiesWidget(QtGui.QWidget):
|
||||
|
||||
@@ -63,36 +63,38 @@ class PathUtilsUserInput(object):
|
||||
def chooseJob(self, jobs):
|
||||
job = None
|
||||
selected = FreeCADGui.Selection.getSelection()
|
||||
if 1 == len(selected) and selected[0] in jobs:
|
||||
job = selected[0]
|
||||
if 1 == len(selected):
|
||||
found = PathUtils.findParentJob(selected[0])
|
||||
if found:
|
||||
return found
|
||||
|
||||
modelSelected = []
|
||||
for job in jobs:
|
||||
if all([o in job.Model.Group for o in selected]):
|
||||
modelSelected.append(job)
|
||||
if 1 == len(modelSelected):
|
||||
job = modelSelected[0]
|
||||
else:
|
||||
modelSelected = []
|
||||
modelObjectSelected = []
|
||||
for job in jobs:
|
||||
if all([o in job.Model.Group for o in selected]):
|
||||
modelSelected.append(job)
|
||||
if 1 == len(modelSelected):
|
||||
job = modelSelected[0]
|
||||
if all([o in job.Proxy.baseObjects(job) for o in selected]):
|
||||
modelObjectSelected.append(job)
|
||||
if 1 == len(modelObjectSelected):
|
||||
job = modelObjectSelected[0]
|
||||
else:
|
||||
modelObjectSelected = []
|
||||
for job in jobs:
|
||||
if all([o in job.Proxy.baseObjects(job) for o in selected]):
|
||||
modelObjectSelected.append(job)
|
||||
if 1 == len(modelObjectSelected):
|
||||
job = modelObjectSelected[0]
|
||||
if modelObjectSelected:
|
||||
mylist = [j.Label for j in modelObjectSelected]
|
||||
else:
|
||||
if modelObjectSelected:
|
||||
mylist = [j.Label for j in modelObjectSelected]
|
||||
else:
|
||||
mylist = [j.Label for j in jobs]
|
||||
mylist = [j.Label for j in jobs]
|
||||
|
||||
jobname, result = QtGui.QInputDialog.getItem(
|
||||
None, translate("Path", "Choose a CAM Job"), None, mylist
|
||||
)
|
||||
jobname, result = QtGui.QInputDialog.getItem(
|
||||
None, translate("Path", "Choose a CAM Job"), None, mylist
|
||||
)
|
||||
|
||||
if result is False:
|
||||
return None
|
||||
else:
|
||||
job = [j for j in jobs if j.Label == jobname][0]
|
||||
if result is False:
|
||||
return None
|
||||
else:
|
||||
job = [j for j in jobs if j.Label == jobname][0]
|
||||
return job
|
||||
|
||||
def createJob(self):
|
||||
|
||||
Reference in New Issue
Block a user