Skip to content

Commit

Permalink
resin_used_ml as usedMaterial in config.json
Browse files Browse the repository at this point in the history
  • Loading branch information
sarkafa committed Aug 29, 2024
1 parent 4b4b4f9 commit f6ffacb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions gcode_metadata/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,8 @@ def __init__(self, key_to_parse: str):
"expTimeFirst": "exposure_time_first",
"layerHeight": "layer_height",
"materialName": "material",
"printerModel": "printer_model"
"printerModel": "printer_model",
"usedMaterial": "resin_used_ml",
}

@staticmethod
Expand Down Expand Up @@ -813,7 +814,8 @@ class SLMetaData(MetaData):
"exposure_time_first": int,
"total_layers": int,
"total_height": int,
"resin_used_ml": int,
# to unify with filament used [mm] rounded to 2 decimal places
"resin_used_ml": lambda x: round(float(x), 2),
"printer_model": str,
}

Expand Down
3 changes: 2 additions & 1 deletion tests/test_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,8 @@ def test_sl(self):
'exposure_time_first': 25,
'layer_height': 0.05,
'material': 'Prusament Resin Tough Prusa Orange @0.05 SL1S',
'printer_model': 'SL1S'
'printer_model': 'SL1S',
'resin_used_ml': 17.15,
}

assert len(meta.thumbnails["400x400_PNG"]) == 26948
Expand Down

0 comments on commit f6ffacb

Please sign in to comment.