-
-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added capability to scan Digikey barcodes and open the local part part page based on the result #811
Merged
Conversation
This file contains 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
…e based on the digikey part number or manufacturer part number
…o put them onto their barcodes
jbtronics
force-pushed
the
VendorBarcodes
branch
from
January 4, 2025 00:20
2d0dc5f
to
9284764
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #811 +/- ##
============================================
- Coverage 60.86% 60.81% -0.05%
- Complexity 5887 5925 +38
============================================
Files 523 524 +1
Lines 19919 20040 +121
============================================
+ Hits 12123 12187 +64
- Misses 7796 7853 +57 ☔ View full report in Codecov by Sentry. |
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.
All of the digikey bags already have barcodes with all the information needed to find a part, so registering the barcodes individually doesn't seem so useful. I added a decoder for the digikey barcodes which allows directly jumping to the part without registering the barcode. It should be noted, that the current implementation of the barcode scanner is hardly able to scan Digikey's Datamatrix codes, so more work needs to be done to make this pull request useful.
See this discussion for more info: #808
This feature has a bit of an issue naming wise. The existing implementation already defines vendor barcodes as user defined ids that can be added as a way to identify a lot (and find that lot by scanning a barcode with that id). I find that naming very confusing, because the way the feature works doesn't care about whether this is a vendor barcode or anything else that you're adding; it's just any user defined scanned string that you want to use. When I first found that feature it took me a good while to understand what it actually does, especially since I could find any documentation on it and I didn't manage to connect the name "part lot" to "part stock".
Since this pull request adds support for actually reading and extracting the information from, specifically, vendor barcodes I felt it would be best to rename the old feature to "user defined barcodes". I found however, that the naming spans across so many files, that the merit is questionable. In the files I committed I started this renaming process but didn't complete it across all usages of the term "vendor" in properties and variables. (variable names for the same variable are consistent, i.e. no functionality is broken, only the naming among different variables or properties is not consistent)
Generally, introducing barcodes that actually contain information is rather different from the old concept where a barcode was just an identifier. I have created a new data class VendorBarcodeScanResult, but that means some of the functions now have to handle two different kinds of objects. Maybe it makes sense to separate concerns further and break the interpretation of id barcodes and information barcodes up into two classes. Also, in contrast to id barcodes, vendor barcode formats should be easy to add. It might make sense to create a list of known formats and corresponding parser functions somewhere and use that to generate the options in the ui and try out the different parsers