Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update PostProcessingPlugin.py #19845

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions plugins/PostProcessingPlugin/PostProcessingPlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import os.path
import pkgutil
import sys
import re
from typing import Dict, Type, TYPE_CHECKING, List, Optional, cast

from PyQt6.QtCore import QObject, pyqtProperty, pyqtSignal, pyqtSlot
Expand Down Expand Up @@ -98,11 +99,20 @@ def execute(self, output_device) -> None:
for pp_name in pp_name_list.split("\n"):
pp_name = pp_name.split("]")
gcode_list[0] += "; " + str(pp_name[0]) + "]\n"
post_processor_setting_str = self.getPostProcessorSettings(pp_name_list)
gcode_list[len(gcode_list)-1] += post_processor_setting_str
gcode_dict[active_build_plate_id] = gcode_list
setattr(scene, "gcode_dict", gcode_dict)
else:
Logger.log("e", "Already post processed")

def getPostProcessorSettings(self, pp_name_list: str) -> str:
setting_str = ";...Post Processor Settings (all settings)\n"
for script_str in pp_name_list.split("\n"):
script_str = script_str.replace(r"\\\n", "\n; ").replace("\n; \n; ", "\n")
setting_str += ";" + str(script_str)
return setting_str

@pyqtSlot(int)
def setSelectedScriptIndex(self, index: int) -> None:
if self._selected_script_index != index:
Expand Down
Loading