Skip to content

Commit

Permalink
metadata: support multiple filaments length for prusaslicer
Browse files Browse the repository at this point in the history
  • Loading branch information
bakatrouble committed Nov 26, 2023
1 parent fb15b2a commit bd85916
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions moonraker/components/file_manager/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,9 +357,13 @@ def parse_object_height(self) -> Optional[float]:
return regex_find_max_float(r"G1\sZ(%F)\sF", self.footer_data)

def parse_filament_total(self) -> Optional[float]:
return regex_find_float(
r"filament\sused\s\[mm\]\s=\s(%F)", self.footer_data
line = regex_find_string(r'filament\sused\s\[mm\]\s=\s(%S)\n', self.footer_data)
filament = regex_find_floats(
r"(%F)", line
)
if filament:
return sum(filament)
return None

def parse_filament_weight_total(self) -> Optional[float]:
return regex_find_float(
Expand Down

0 comments on commit bd85916

Please sign in to comment.