From 1222e77ee86ce78cae10eb2a7ed6ca53dc03fe92 Mon Sep 17 00:00:00 2001 From: LarryWoestman Date: Sat, 6 Aug 2022 19:53:03 -0700 Subject: [PATCH] Path: Removed some unneeded variables; shortened some long lines. --- src/Mod/Path/Path/Post/UtilsArguments.py | 11 ----- .../PathTests/TestRefactoredTestPostGCodes.py | 40 +++++++++++++++---- 2 files changed, 32 insertions(+), 19 deletions(-) diff --git a/src/Mod/Path/Path/Post/UtilsArguments.py b/src/Mod/Path/Path/Post/UtilsArguments.py index b7559aa91807..e91a0378cf94 100644 --- a/src/Mod/Path/Path/Post/UtilsArguments.py +++ b/src/Mod/Path/Path/Post/UtilsArguments.py @@ -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) # @@ -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. # diff --git a/src/Mod/Path/PathTests/TestRefactoredTestPostGCodes.py b/src/Mod/Path/PathTests/TestRefactoredTestPostGCodes.py index 24f44d168fda..4b8ddc9915d5 100644 --- a/src/Mod/Path/PathTests/TestRefactoredTestPostGCodes.py +++ b/src/Mod/Path/PathTests/TestRefactoredTestPostGCodes.py @@ -123,12 +123,18 @@ 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" + ), "", ) @@ -136,23 +142,35 @@ 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", ) @@ -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" + ), "", ) @@ -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" + ), "", )