Skip to content

Commit

Permalink
fix mmu attributes parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
sarkafa committed Jul 1, 2024
1 parent 1ed0c19 commit c0048e3
Show file tree
Hide file tree
Showing 3 changed files with 148,303 additions and 27 deletions.
20 changes: 10 additions & 10 deletions gcode_metadata/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,18 @@
r"((?P<seconds>[0-9]+)s)?")

PRINTERS = [
'MK4IS', 'MK4MMU3', 'MK4', 'MK3SMMU3', 'MK3MMU3', 'MK3SMMU2S',
'MK3MMU2', 'MK3S', 'MK3', 'MK2.5SMMU2S', 'MK2.5MMU2', 'MK2.5S',
'MK2.5', 'MK3.5', 'MK3.9', 'MINI', 'MINIIS', 'XL5', 'XL4', 'XL3',
'XL2', 'XL', 'iX', 'SL1', 'SHELF', 'EXTRACTOR', 'HARVESTER'
]
'MK4IS', 'MK4MMU3', 'MK4', 'MK3SMMU3', 'MK3MMU3', 'MK3SMMU2S', 'MK3MMU2',
'MK3S', 'MK3', 'MK2.5SMMU2S', 'MK2.5MMU2', 'MK2.5S', 'MK2.5', 'MK3.5',
'MK3.9', 'MINI', 'MINIIS', 'XL5', 'XL4', 'XL3', 'XL2', 'XL', 'iX', 'SL1',
'SHELF', 'EXTRACTOR', 'HARVESTER'
]

PRINTERS.sort(key=len, reverse=True)

MATERIALS = [
'PLA', 'PETG', 'ABS', 'ASA', 'FLEX', 'HIPS', 'EDGE', 'NGEN', 'PA',
'PVA', 'PCTG', 'PP', 'PC', 'PEBA', 'CPE', 'PVB', 'PET', 'PLA Tough',
'METAL', 'TPU', 'NYLON'
'PLA', 'PETG', 'ABS', 'ASA', 'FLEX', 'HIPS', 'EDGE', 'NGEN', 'PA', 'PVA',
'PCTG', 'PP', 'PC', 'PEBA', 'CPE', 'PVB', 'PET', 'PLA Tough', 'METAL',
'TPU', 'NYLON'
]

IMAGE_FORMATS = ['PNG', 'JPG']
Expand Down Expand Up @@ -440,6 +440,7 @@ def from_string(self, raw_value):

class FDMMetaData(MetaData):
"""Class for extracting Metadata for FDM gcodes"""

# pylint: disable=too-many-instance-attributes

def set_attr(self, name, value):
Expand Down Expand Up @@ -613,8 +614,7 @@ def from_comment_line(self, line):

# We store the image data only during parsing. If actively parsing:
if self.img is not None:
line = line[2:].strip()
self.img.append(line)
self.img.append(line[2:].strip())

# For the bulk of metadata comments
match = self.KEY_VAL_PAT.match(line)
Expand Down
Loading

0 comments on commit c0048e3

Please sign in to comment.