Add Color Count

This commit is contained in:
Queen Vinyl Da.i'gyu-Kazotetsu committed 2024-06-14 21:11:52 -07:00
1 parent 7a4a57b0aa
commit 3073f81c9f
2 files changed
+6 -4

No files matched your search

+2 -1
View File
@@ -97,6 +97,7 @@ class Tag():
"uid": bytes_to_hex(self.blocks[0][0:4]),
"filament_type": bytes_to_string(self.blocks[2]),
"detailed_filament_type": bytes_to_string(self.blocks[4]),
"filament_color_count": bytes_to_int(self.blocks[16][2:4]),
"filament_color": "#" + bytes_to_hex(self.blocks[5][0:4]),
"spool_weight": Unit(bytes_to_int(self.blocks[5][4:6]), "g"),
"filament_length": Unit(bytes_to_int(self.blocks[14][4:6]), "m"),
@@ -121,7 +122,7 @@ class Tag():
}
# Check for a second color
if self.blocks[16][4]:
if self.data["filament_color_count"] == 2:
self.data["filament_color"] += " / #" + bytes_to_hex(self.blocks[16][4:8][::-1])
def __str__(self, blocks_to_output = IMPORTANT_BLOCKS):