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

metadata: support multiple filaments length for prusaslicer #756

Merged
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
11 changes: 8 additions & 3 deletions moonraker/components/file_manager/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,9 +357,14 @@ 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)
if line:
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
Loading