Skip to content
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

shelf_id Bug #95

Open
jmwright opened this issue Oct 21, 2024 · 3 comments
Open

shelf_id Bug #95

jmwright opened this issue Oct 21, 2024 · 3 comments

Comments

@jmwright
Copy link
Contributor

The code here in device.py that gets the shelf_builder_id is supposed to just strip a trailing -6 or -st, but it seems to incorrectly force some shelf IDs to be generic.

The following JSON in devices.json leads to a generic shelf.

{"ID": "Western_Digital_Red_HDD","Type": "Storage","Hardware": "Western Digital Red HDD","Brand": "Western Digital", "Model": "WD20EFAX","Shelf": "HDD 3.5 Shelf","Rack": "6 in","ShelfId": "hdd35","HeightUnits": "2","LengthMm": "147.07 mm","Depth": "101.60 mm","Height": "26.16 mm","PoEIn": "","PoEOut": "","WattageMax": "","EstCostUsd": "$131.00","ProductWebsiteUsd": "","ProductWebsiteEur": "https://www.amazon.de/-/en/Western-Digital-Internal-Hard-Drive/dp/B083XVY99B/ref=sr_1_5","RAM": "","Field19": "","PoEInInputVoltage": "","Voltage": "","Amperage": "","WRTVersion": "","OpenWRTLink": "","Comments": "Part number is for the 2TB version"}

Whereas adding a -6 to the ShelfId fixes the issue.

{"ID": "Western_Digital_Red_HDD","Type": "Storage","Hardware": "Western Digital Red HDD","Brand": "Western Digital", "Model": "WD20EFAX","Shelf": "HDD 3.5 Shelf","Rack": "6 in","ShelfId": "hdd35-6","HeightUnits": "2","LengthMm": "147.07 mm","Depth": "101.60 mm","Height": "26.16 mm","PoEIn": "","PoEOut": "","WattageMax": "","EstCostUsd": "$131.00","ProductWebsiteUsd": "","ProductWebsiteEur": "https://www.amazon.de/-/en/Western-Digital-Internal-Hard-Drive/dp/B083XVY99B/ref=sr_1_5","RAM": "","Field19": "","PoEInInputVoltage": "","Voltage": "","Amperage": "","WRTVersion": "","OpenWRTLink": "","Comments": "Part number is for the 2TB version"}

@julianstirling

@julianstirling
Copy link
Collaborator

This is legacy code. Currently the way it works is that it has to match the regex, which involves the -6 but then the -6 is stripped off.

I think having the shelf_id in the database itself is the problem. Because it splits the thinking, and means we have to update both the database and the cad to update how we build for a shelf.

The database should tell us what the hardware is. If we have made a shelf that can accept that hardware the the CAD side should know this. As we have said before we really need to have a think about what data actually belongs in the database.

@jmwright
Copy link
Contributor Author

@julianstirling So for now since I am trying to get the assemblies working, should I just add the -6?

@julianstirling
Copy link
Collaborator

Yeah I think that's best

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants