extract_metadata: add Cura filament weight parsing

Adds a simple implementation for parsing filament weight from Cura g-code with help of a custom start-g-code comment.

Signed-off-by:  Dominik Willner <th33xitus@gmail.com>
This commit is contained in:
th33xitus 2021-04-13 14:09:39 +02:00 committed by Eric Callahan
parent 0d601073a6
commit f203567381
1 changed files with 4 additions and 0 deletions

View File

@ -323,6 +323,10 @@ class Cura(PrusaSlicer):
filament *= 1000
return filament
def parse_filament_weight_total(self):
return _regex_find_first(
r";Filament\sweight\s=\s.(\d+\.\d+).", self.header_data)
def parse_estimated_time(self):
return self._parse_max_float(r";TIME:.*", self.header_data)