From c98cad4802b2a7f93dd62943469f66c4e6b8caed Mon Sep 17 00:00:00 2001 From: sdoe0 <69821734+sdoe0@users.noreply.github.com> Date: Wed, 2 Oct 2024 00:06:27 +0200 Subject: [PATCH] module: metadata.py Bugfix/Improvement regarding Simplify3D meta parsing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Current parsing param are not able to get filament_name and filament_type correctly. printMaterial,(%S) for filament_name is not present in Gcode (anymore?). makerBotModelMaterial,(%S) for type of filament is only changable for Export File Format= .makerbot. Even worse: the last state of the Setting is present in Gcode even if the user didnt ever used something different than Standard G-Code Export. (By default = pla) By using autoConfigurationMaterial,(%S), wich is by default one of PLA, PETG, ABS..., as filament_type we can avoid unnecessary Spoolman warnings and get a pleasurable printing history. -even with S3D ;) Signed-off-by: Silas Döring sdoe0@proton.me module: metadata.py Bugfix/Improvement regarding Simplify3D meta parsing Current parsing param are not able to get filament_name and filament_type correctly. printMaterial,(%S) for filament_name is not present in Gcode (anymore?). makerBotModelMaterial,(%S) for type of filament is only changeable for Export File Format= .makerbot. Even worse: the last state of the Setting is present in Gcode even if the user didnt ever used something different than Standard G-Code Export (By default = pla). By using autoConfigurationMaterial,(%S), wich is by default one of PLA, PETG, ABS..., as filament_type we can avoid unnecessary Spoolman warnings and get a pleasurable printing history. -even with S3D ;) Signed-off-by: Silas Döring sdoe0@proton.me --- moonraker/components/file_manager/metadata.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/moonraker/components/file_manager/metadata.py b/moonraker/components/file_manager/metadata.py index af48d7b08..6492dff53 100644 --- a/moonraker/components/file_manager/metadata.py +++ b/moonraker/components/file_manager/metadata.py @@ -594,11 +594,11 @@ def parse_filament_weight_total(self) -> Optional[float]: def parse_filament_name(self) -> Optional[str]: return regex_find_string( - r";\s+printMaterial,(%S)", self.header_data) + r";\s+(?:printMaterial|autoConfigureBrand),(%S)", self.header_data) def parse_filament_type(self) -> Optional[str]: return regex_find_string( - r";\s+makerBotModelMaterial,(%S)", self.footer_data) + r";\s+autoConfigureMaterial,(%S)", self.footer_data) def parse_estimated_time(self) -> Optional[float]: time_match = re.search(r';\s+Build (t|T)ime:.*', self.footer_data)