Repository navigation
Read the remaining filament weight (TigerTag and OpenTag3D) - #35
Open
TigerTag-Project wants to merge 1 commit into
Open
TigerTag-Project wants to merge 1 commit into
TigerTag-Project wants to merge 1 commit into
Conversation
Add a shared remaining_weight_grams field to GenericFilament for the measured remaining filament, as written back by smart scales. 0 means unknown, like the other optional fields. It is exported in to_dict(), so webhooks and templates can use it, and shown in pretty_text() when known. - TigerTag: read Measure Available (+76, u24 BE), converted with the same unit as the measure. Factory-written tags leave it at 0 (not weighed). - OpenTag3D: export Measured Filament Weight, which was decoded but not exported. - Tests: an eSun TigerTag+ copy with 742 g written at +76 (outside the signed region, so the signature stays valid), the original dump as the unknown case, and an OpenTag3D measured-weight case.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Smart scales such as Tiger Scale weigh a spool and write the remaining quantity back to its tag. Several projects already read this value. OpenRFID did not expose it, so this PR adds a shared field and fills it for the two supported formats that store it.
GenericFilament.remaining_weight_gramstdand the other optional fields, so processors that don't support it are unaffected.to_dict(), so it is available to the webhook and to templates ({{ filament.remaining_weight_grams }}).pretty_text()shows it when known.TigerTag
+76, u24 BE, page0x17; see the TigerTag spec). It is converted to grams with the same unit as the initial measure.0. That means "not weighed yet", not "empty", which is why 0 maps to unknown. All the real TigerTag dumps intest/tagshave0here.OpenTag3D
0xA4). The schema already decoded it, but it was not exported.weight_gramsstays the target weight, as before. The processor README is updated.Tests
eSun PLA Basic Refill Cold White TigerTag+ Weighed 742g: a copy of the existing eSun dump with 742 g written at+76, as a scale would do. Page0x17is outside the signed region, so the TigerTag+ signature still verifies.0.0).98 passed, 1 skipped.
Note: #32 and #34 also add fields at the end of
GenericFilamentandto_dict(). Whichever is merged later will need a trivial conflict resolution there; happy to rebase.