Make Job gui work with new PostProcessor class

This commit is contained in:
sliptonic
2024-04-24 21:34:56 -05:00
parent 798e93b480
commit c97e199a28
3 changed files with 14 additions and 10 deletions

View File

@@ -20,7 +20,7 @@
# * *
# ***************************************************************************
from Path.Post.Processor import PostProcessor
from Path.Post.Processor import PostProcessorFactory # PostProcessor,
from PySide import QtCore
from PySide.QtCore import QT_TRANSLATE_NOOP
import FreeCAD
@@ -112,7 +112,9 @@ class ObjectJob:
"App::PropertyFile",
"PostProcessorOutputFile",
"Output",
QT_TRANSLATE_NOOP("App::Property", "The G-code output file for this project"),
QT_TRANSLATE_NOOP(
"App::Property", "The G-code output file for this project"
),
)
obj.addProperty(
"App::PropertyEnumeration",
@@ -549,7 +551,7 @@ class ObjectJob:
def onChanged(self, obj, prop):
if prop == "PostProcessor" and obj.PostProcessor:
processor = PostProcessor.load(obj.PostProcessor)
processor = PostProcessorFactory.get_post_processor(obj, obj.PostProcessor)
self.tooltip = processor.tooltip
self.tooltipArgs = processor.tooltipArgs

View File

@@ -30,10 +30,11 @@ import Path.Base.Util as PathUtil
import importlib.util
import os
import sys
import re
Path.Log.setLevel(Path.Log.Level.INFO, Path.Log.thisModule())
debug = True
debug = False
if debug:
Path.Log.setLevel(Path.Log.Level.DEBUG, Path.Log.thisModule())
Path.Log.trackModule(Path.Log.thisModule())
@@ -108,12 +109,14 @@ class PostProcessor:
@property
def tooltip(self):
"""Get the tooltip text for the post processor."""
return self._tooltip
raise NotImplementedError("Subclass must implement abstract method")
# return self._tooltip
@property
def tooltipargs(self):
def tooltipArgs(self):
"""Get the tooltip arguments for the post processor."""
return self._tooltipargs
raise NotImplementedError("Subclass must implement abstract method")
# return self._tooltipargs
@property
def units(self):
@@ -259,7 +262,7 @@ class PostProcessor:
Path.Log.debug(f"obj: {obj.Name}")
for index, f in enumerate(wcslist):
sublist.append(_fixtureSetup(index, f, self._job))
sublist.append(__fixtureSetup(index, f, self._job))
tc = PathUtil.toolControllerForOp(obj)
if tc is not None:
if self._job.SplitOutput or (tc.ToolNumber != currTool):
@@ -334,7 +337,7 @@ class WrapperPost(PostProcessor):
return self._tooltip
@property
def tooltipargs(self):
def tooltipArgs(self):
return self._tooltipargs
@property

View File

@@ -175,7 +175,6 @@ class FilenameGenerator:
yield os.path.normpath(full_path)
class GCodeHighlighter(QtGui.QSyntaxHighlighter):
def __init__(self, parent=None):
super(GCodeHighlighter, self).__init__(parent)