From 334778c3c01db349560c3ac43c012a3ed3a327a8 Mon Sep 17 00:00:00 2001 From: sliptonic Date: Mon, 11 Jul 2022 16:01:58 -0500 Subject: [PATCH 1/5] minor black fixes --- src/Mod/Path/PathScripts/PathSurface.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Mod/Path/PathScripts/PathSurface.py b/src/Mod/Path/PathScripts/PathSurface.py index 7b1daa0088..33cf4d92f7 100644 --- a/src/Mod/Path/PathScripts/PathSurface.py +++ b/src/Mod/Path/PathScripts/PathSurface.py @@ -2103,7 +2103,7 @@ class ObjectSurface(PathOp.ObjectOp): hlim = bb.XMax # Compute max radius of stock, as it rotates, and rotational clearance & safe heights - self.bbRadius = math.sqrt(hlim ** 2 + vlim ** 2) + self.bbRadius = math.sqrt(hlim**2 + vlim**2) self.clearHeight = self.bbRadius + JOB.SetupSheet.ClearanceHeightOffset.Value self.safeHeight = self.bbRadius + JOB.SetupSheet.ClearanceHeightOffset.Value From 38e4182440194ee86a78d1a00978dbd26e78257c Mon Sep 17 00:00:00 2001 From: sliptonic Date: Mon, 11 Jul 2022 16:05:55 -0500 Subject: [PATCH 2/5] G38 fixes for probe visualization per mlampert --- src/Mod/Path/App/PathSegmentWalker.cpp | 3 ++- src/Mod/Path/Gui/ViewProviderPath.cpp | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Mod/Path/App/PathSegmentWalker.cpp b/src/Mod/Path/App/PathSegmentWalker.cpp index 545ca246e7..32dd2e729d 100644 --- a/src/Mod/Path/App/PathSegmentWalker.cpp +++ b/src/Mod/Path/App/PathSegmentWalker.cpp @@ -342,9 +342,10 @@ void PathSegmentWalker::walk(PathSegmentVisitor &cb, const Base::Vector3d &start lrot = nrot; - } else if ((name=="G38.2")||(name=="38.3")||(name=="G38.4")||(name=="G38.5")){ + } else if ((name=="G38.2")||(name=="G38.3")||(name=="G38.4")||(name=="G38.5")){ // Straight probe cb.g38(i, last, next); + last = next; } else if(name=="G17") { pz = &Base::Vector3d::z; } else if(name=="G18") { diff --git a/src/Mod/Path/Gui/ViewProviderPath.cpp b/src/Mod/Path/Gui/ViewProviderPath.cpp index 870e937702..dbb449b4d1 100644 --- a/src/Mod/Path/Gui/ViewProviderPath.cpp +++ b/src/Mod/Path/Gui/ViewProviderPath.cpp @@ -549,6 +549,7 @@ public: virtual void g38(int id, const Base::Vector3d &last, const Base::Vector3d &next) { +#if 0 Base::Vector3d p1(next.x,next.y,last.z); points.push_back(p1); colorindex.push_back(0); @@ -561,6 +562,11 @@ public: colorindex.push_back(0); pushCommand(id); +#else + (void)last; + const std::deque pts{}; + gx(id, &next, pts, 2); +#endif } private: From 6bc60776f6aacfa75dc94b3a1e5221f6d2dce90e Mon Sep 17 00:00:00 2001 From: sliptonic Date: Sat, 2 Jul 2022 12:03:11 -0500 Subject: [PATCH 3/5] Avoid python 3.6 error. subprocess doesn't have capture_output. Use subprocess.PIPE instead. --- src/Mod/Path/PathScripts/PathGuiInit.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Mod/Path/PathScripts/PathGuiInit.py b/src/Mod/Path/PathScripts/PathGuiInit.py index fca0052a5a..3ad0db2b42 100644 --- a/src/Mod/Path/PathScripts/PathGuiInit.py +++ b/src/Mod/Path/PathScripts/PathGuiInit.py @@ -85,10 +85,12 @@ def Startup(): import camotics r = subprocess.run( - ["camotics", "--version"], capture_output=True, text=True + ["camotics", "--version"], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, ).stderr.strip() - v = parse(r) + v = parse(r.decode("utf-8")) if v >= Version("1.2.2"): from PathScripts import PathCamoticsGui except (FileNotFoundError, ModuleNotFoundError): From 10abaee855fe6dea9a792bf83fa5ccb210799342 Mon Sep 17 00:00:00 2001 From: sliptonic Date: Mon, 11 Jul 2022 17:55:07 -0500 Subject: [PATCH 4/5] remove G53 from fixture list --- src/Mod/Path/Gui/Resources/panels/PathEdit.ui | 482 +++++++++--------- src/Mod/Path/PathScripts/PathFixture.py | 2 - src/Mod/Path/PathScripts/PathJobGui.py | 2 +- 3 files changed, 233 insertions(+), 253 deletions(-) diff --git a/src/Mod/Path/Gui/Resources/panels/PathEdit.ui b/src/Mod/Path/Gui/Resources/panels/PathEdit.ui index da0e10b89a..63f59c94e1 100644 --- a/src/Mod/Path/Gui/Resources/panels/PathEdit.ui +++ b/src/Mod/Path/Gui/Resources/panels/PathEdit.ui @@ -65,30 +65,28 @@ - - - - - - Qt::Horizontal - - - - 334 - 20 - - - - - - - - Edit - - - - - + + + + + Qt::Horizontal + + + + 334 + 20 + + + + + + + + Edit + + + + @@ -223,7 +221,7 @@ - <html><head/><body><p><span style=" font-style:italic;">Work Coordinate Systems</span> also called <span style=" font-style:italic;">Work Offsets</span>, <span style=" font-style:italic;">Fixture Offsets</span>, or <span style=" font-style:italic;">Fixtures </span>are useful for building efficient production jobs where the same part is done many times on the machine.</p><p>FreeCAD has no knowledge of where a particular coordinate system exists within the machine coordinate system so adding additional coordinate systems to your job will have no visual change within your job. It will, however, change your gcode output. The exact way in which the output is affected is controlled by the 'order by' setting.</p></body></html> + <html><head/><body><p><span style=" font-style:italic;">Work Coordinate Systems</span> also called <span style=" font-style:italic;">Work Offsets</span>, <span style=" font-style:italic;">Fixture Offsets</span>, or <span style=" font-style:italic;">Fixtures </span>are useful for building efficient production jobs where the same part is done many times on the machine.</p><p>FreeCAD has no knowledge of where a particular coordinate system exists within the machine coordinate system so adding additional coordinate systems to your job will have no visual change within your job. It will, however, change your gcode output. The exact way in which the output is affected is controlled by the 'order by' setting.</p></body></html> QListView::Adjust @@ -242,7 +240,7 @@ - G53 + G54 Unchecked @@ -250,7 +248,7 @@ - G54 + G55 Unchecked @@ -258,7 +256,7 @@ - G55 + G56 Unchecked @@ -266,7 +264,7 @@ - G56 + G57 Unchecked @@ -274,7 +272,7 @@ - G57 + G58 Unchecked @@ -282,7 +280,7 @@ - G58 + G59 Unchecked @@ -290,7 +288,7 @@ - G59 + G59.1 Unchecked @@ -298,7 +296,7 @@ - G59.1 + G59.2 Unchecked @@ -306,7 +304,7 @@ - G59.2 + G59.3 Unchecked @@ -314,7 +312,7 @@ - G59.3 + G59.4 Unchecked @@ -322,7 +320,7 @@ - G59.4 + G59.5 Unchecked @@ -330,7 +328,7 @@ - G59.5 + G59.6 Unchecked @@ -338,7 +336,7 @@ - G59.6 + G59.7 Unchecked @@ -346,7 +344,7 @@ - G59.7 + G59.8 Unchecked @@ -354,15 +352,7 @@ - G59.8 - - - Unchecked - - - - - G59.9 + G59.9 Unchecked @@ -376,7 +366,7 @@ <html><head/><body><p>If multiple coordinate systems are in use, setting this to TRUE will cause the gcode to be written to multiple output files as controlled by the 'order by' property. For example, if ordering by Fixture, the first output file will be for the first fixture and separate file for the second.</p><p><br/></p><p><br/></p></body></html> - <html><head/><body><p>If True, post-processing will create multiple output files based on the <span style=" font-style:italic;">order by</span> setting.</p><p><br/></p><p>For example, if <span style=" font-style:italic;">order by</span> is set to Tool, the first output file will contain the first tool change and all operations, in all coordinate systems, that can be done with that tool before the next tool change is called.</p><p><br/></p><p>If <span style=" font-style:italic;">order by</span> is set to <span style=" font-style:italic;">operation</span> and <span style=" font-style:italic;">split output</span> is true, each operation will be written to a separate file.</p></body></html> + <html><head/><body><p>If True, post-processing will create multiple output files based on the <span style=" font-style:italic;">order by</span> setting.</p><p><br/></p><p>For example, if <span style=" font-style:italic;">order by</span> is set to Tool, the first output file will contain the first tool change and all operations, in all coordinate systems, that can be done with that tool before the next tool change is called.</p><p><br/></p><p>If <span style=" font-style:italic;">order by</span> is set to <span style=" font-style:italic;">operation</span> and <span style=" font-style:italic;">split output</span> is true, each operation will be written to a separate file.</p></body></html> Split Output @@ -386,7 +376,7 @@ - + Qt::Vertical @@ -399,7 +389,7 @@ - + @@ -417,7 +407,7 @@ 0 0 548 - 941 + 929 @@ -434,50 +424,48 @@ 0 - - - - - - - 0 - 0 - - - - 2 - - - - Create Box - - - - - Create Cylinder - - - - - Extend Model's Bound Box - - - - - Use Existing Solid - - - - - - + + + + + + 0 + 0 + + + + 2 + + - Refresh + Create Box - - - - + + + + Create Cylinder + + + + + Extend Model's Bound Box + + + + + Use Existing Solid + + + + + + + + Refresh + + + + @@ -534,7 +522,7 @@ - + @@ -550,7 +538,7 @@ - + @@ -573,10 +561,10 @@ - + - + @@ -609,10 +597,10 @@ - + - + @@ -631,7 +619,7 @@ - + Set Origin @@ -652,7 +640,7 @@ - + @@ -901,45 +889,43 @@ - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - -180.000000000000000 - - - 360.000000000000000 - - - 90.000000000000000 - - - - - - - Compound - - - true - - - - - + + + 0 + + + 0 + + + 0 + + + 0 + + + + + -180.000000000000000 + + + 360.000000000000000 + + + 90.000000000000000 + + + + + + + Compound + + + true + + + + @@ -1234,37 +1220,35 @@ - - - - - - false - - - Edit - - - - - - - Add - - - - - - - false - - - Remove - - - - - + + + + + false + + + Edit + + + + + + + Add + + + + + + + false + + + Remove + + + + @@ -1361,7 +1345,7 @@ - + QFormLayout::AllNonFixedFieldsGrow @@ -1380,86 +1364,84 @@ - - - - - - QAbstractItemView::InternalMove + + + + + QAbstractItemView::InternalMove + + + + + + + + 1 - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - ... - - - - :/icons/button_up.svg:/icons/button_up.svg - - - - - - - ... - - - - :/icons/button_down.svg:/icons/button_down.svg - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - + + 1 + + + 1 + + + 1 + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + ... + + + + :/icons/button_up.svg:/icons/button_up.svg + + + + + + + ... + + + + :/icons/button_down.svg:/icons/button_down.svg + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + - + diff --git a/src/Mod/Path/PathScripts/PathFixture.py b/src/Mod/Path/PathScripts/PathFixture.py index cfa67d4c47..4a847306ff 100644 --- a/src/Mod/Path/PathScripts/PathFixture.py +++ b/src/Mod/Path/PathScripts/PathFixture.py @@ -38,7 +38,6 @@ class Fixture: QT_TRANSLATE_NOOP("App::Property", "Fixture Offset Number"), ) obj.Fixture = [ - "G53", "G54", "G55", "G56", @@ -68,7 +67,6 @@ class Fixture: def execute(self, obj): fixlist = [ - "G53", "G54", "G55", "G56", diff --git a/src/Mod/Path/PathScripts/PathJobGui.py b/src/Mod/Path/PathScripts/PathJobGui.py index 8ea9cb60ab..89795a59a7 100644 --- a/src/Mod/Path/PathScripts/PathJobGui.py +++ b/src/Mod/Path/PathScripts/PathJobGui.py @@ -54,7 +54,7 @@ DraftVecUtils = LazyLoader("DraftVecUtils", globals(), "DraftVecUtils") translate = FreeCAD.Qt.translate -if False: +if True: PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule()) PathLog.trackModule(PathLog.thisModule()) else: From 6364c75240e5dcdeca466da0e72d0865b724c971 Mon Sep 17 00:00:00 2001 From: sliptonic Date: Tue, 12 Jul 2022 14:15:52 -0500 Subject: [PATCH 5/5] Fixes #7164 --- src/Mod/Path/PathScripts/PathJobGui.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Mod/Path/PathScripts/PathJobGui.py b/src/Mod/Path/PathScripts/PathJobGui.py index 89795a59a7..8727f17ec4 100644 --- a/src/Mod/Path/PathScripts/PathJobGui.py +++ b/src/Mod/Path/PathScripts/PathJobGui.py @@ -54,7 +54,7 @@ DraftVecUtils = LazyLoader("DraftVecUtils", globals(), "DraftVecUtils") translate = FreeCAD.Qt.translate -if True: +if False: PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule()) PathLog.trackModule(PathLog.thisModule()) else: @@ -768,7 +768,7 @@ class TaskPanel: ] try: self.obj.SplitOutput = self.form.splitOutput.isChecked() - self.obj.OrderOutputBy = str(self.form.orderBy.currentText()) + self.obj.OrderOutputBy = str(self.form.orderBy.currentData()) flist = [] for i in range(self.form.wcslist.count()): @@ -778,7 +778,8 @@ class TaskPanel: ): flist.append(self.form.wcslist.item(i).text()) self.obj.Fixtures = flist - except Exception: + except Exception as e: + PathLog.debug(e) FreeCAD.Console.PrintWarning( "The Job was created without fixture support. Please delete and recreate the job\r\n" )