Skip to content

Commit

Permalink
Merge pull request FreeCAD#11171 from LarryWoestman/staging
Browse files Browse the repository at this point in the history
Path:  Removed some unneeded variables; shortened some long lines.
  • Loading branch information
sliptonic authored Oct 30, 2023
2 parents 196cbec + 1222e77 commit 680c518
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 19 deletions.
11 changes: 0 additions & 11 deletions src/Mod/Path/Path/Post/UtilsArguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,12 +343,6 @@ def init_shared_values(values: Values):
#
values["COMMENT_SYMBOL"] = "("
#
# Variables storing the current position for the drill_translate routine.
#
values["CURRENT_X"] = 0.0
values["CURRENT_Y"] = 0.0
values["CURRENT_Z"] = 0.0
#
# Default axis precision for metric is 3 digits after the decimal point.
# (see http://linuxcnc.org/docs/2.7/html/gcode/overview.html#_g_code_best_practices)
#
Expand All @@ -371,11 +365,6 @@ def init_shared_values(values: Values):
#
values["DRILL_CYCLES_TO_TRANSLATE"] = ["G73", "G81", "G82", "G83"]
#
# The default value of drill retractations (CURRENT_Z).
# The other possible value is G99.
#
values["DRILL_RETRACT_MODE"] = "G98"
#
# If this is set to True, then M7, M8, and M9 commands
# to enable/disable coolant will be output.
#
Expand Down
40 changes: 32 additions & 8 deletions src/Mod/Path/PathTests/TestRefactoredTestPostGCodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,36 +123,54 @@ def test10000(self):
"""Test G0 command Generation."""
self.compare_third_line(
"G0 X10 Y20 Z30 A40 B50 C60 U70 V80 W90",
"G0 X10.000 Y20.000 Z30.000 A40.000 B50.000 C60.000 U70.000 V80.000 W90.000",
(
"G0 X10.000 Y20.000 Z30.000 A40.000 B50.000 C60.000 "
"U70.000 V80.000 W90.000"
),
"",
)
self.compare_third_line(
"G00 X10 Y20 Z30 A40 B50 C60 U70 V80 W90",
"G00 X10.000 Y20.000 Z30.000 A40.000 B50.000 C60.000 U70.000 V80.000 W90.000",
(
"G00 X10.000 Y20.000 Z30.000 A40.000 B50.000 C60.000 "
"U70.000 V80.000 W90.000"
),
"",
)

def test10010(self):
"""Test G1 command Generation."""
self.compare_third_line(
"G1 X10 Y20 Z30 A40 B50 C60 U70 V80 W90 F1.23456",
"G1 X10.000 Y20.000 Z30.000 A40.000 B50.000 C60.000 U70.000 V80.000 W90.000 F74.074",
(
"G1 X10.000 Y20.000 Z30.000 A40.000 B50.000 C60.000 "
"U70.000 V80.000 W90.000 F74.074"
),
"",
)
self.compare_third_line(
"G01 X10 Y20 Z30 A40 B50 C60 U70 V80 W90 F1.23456",
"G01 X10.000 Y20.000 Z30.000 A40.000 B50.000 C60.000 U70.000 V80.000 W90.000 F74.074",
(
"G01 X10.000 Y20.000 Z30.000 A40.000 B50.000 C60.000 "
"U70.000 V80.000 W90.000 F74.074"
),
"",
)
# Test argument order
self.compare_third_line(
"G1 F1.23456 Z30 V80 C60 W90 X10 B50 U70 Y20 A40",
"G1 X10.000 Y20.000 Z30.000 A40.000 B50.000 C60.000 U70.000 V80.000 W90.000 F74.074",
(
"G1 X10.000 Y20.000 Z30.000 A40.000 B50.000 C60.000 "
"U70.000 V80.000 W90.000 F74.074"
),
"",
)
self.compare_third_line(
"G1 X10 Y20 Z30 A40 B50 C60 U70 V80 W90 F1.23456",
"G1 X0.3937 Y0.7874 Z1.1811 A1.5748 B1.9685 C2.3622 U2.7559 V3.1496 W3.5433 F2.9163",
(
"G1 X0.3937 Y0.7874 Z1.1811 A1.5748 B1.9685 C2.3622 "
"U2.7559 V3.1496 W3.5433 F2.9163"
),
"--inches",
)

Expand Down Expand Up @@ -311,7 +329,10 @@ def test10280(self):
self.compare_third_line("G28", "G28", "")
self.compare_third_line(
"G28 X10 Y20 Z30 A40 B50 C60 U70 V80 W90",
"G28 X10.000 Y20.000 Z30.000 A40.000 B50.000 C60.000 U70.000 V80.000 W90.000",
(
"G28 X10.000 Y20.000 Z30.000 A40.000 B50.000 C60.000 "
"U70.000 V80.000 W90.000"
),
"",
)

Expand Down Expand Up @@ -1233,7 +1254,10 @@ def test10920(self):
"""Test G92 command Generation."""
self.compare_third_line(
"G92 X10 Y20 Z30 A40 B50 C60 U70 V80 W90",
"G92 X10.000 Y20.000 Z30.000 A40.000 B50.000 C60.000 U70.000 V80.000 W90.000",
(
"G92 X10.000 Y20.000 Z30.000 A40.000 B50.000 C60.000 "
"U70.000 V80.000 W90.000"
),
"",
)

Expand Down

0 comments on commit 680c518

Please sign in to comment.