metadata: support multiple filament lengths for prusaslicer
Signed-off-by: Aleksey Frolov <bakatrouble@gmail.com>
This commit is contained in:
parent
f0ae51792f
commit
6b1b8c5102
|
@ -357,9 +357,14 @@ class PrusaSlicer(BaseSlicer):
|
||||||
return regex_find_max_float(r"G1\sZ(%F)\sF", self.footer_data)
|
return regex_find_max_float(r"G1\sZ(%F)\sF", self.footer_data)
|
||||||
|
|
||||||
def parse_filament_total(self) -> Optional[float]:
|
def parse_filament_total(self) -> Optional[float]:
|
||||||
return regex_find_float(
|
line = regex_find_string(r'filament\sused\s\[mm\]\s=\s(%S)\n', self.footer_data)
|
||||||
r"filament\sused\s\[mm\]\s=\s(%F)", 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]:
|
def parse_filament_weight_total(self) -> Optional[float]:
|
||||||
return regex_find_float(
|
return regex_find_float(
|
||||||
|
|
Loading…
Reference in New Issue