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

Part numbers for wires in Breadboards #4177

Open
veng1 opened this issue Sep 29, 2024 · 5 comments
Open

Part numbers for wires in Breadboards #4177

veng1 opened this issue Sep 29, 2024 · 5 comments

Comments

@veng1
Copy link

veng1 commented Sep 29, 2024

I’d like to have a property like a part number property for a breadboard so I can specify the length of the wire in millimeters.

I have been able to compile the code to show the part number field but don’t see how to edit the field. How is that enabled?

Proposed Solution

Add the ability to edit the wires with a part number field or similar.
Or, give me some guidance where the code to edit the part number field is located and I'll see if I can change it. I'm primarily a Python guy, not cpp, so I need some fairly specific guidance.

@KjellMorgenstern
Copy link
Member

One starting point could be the "View'-> Color Wires By Length' feature, which indicates the length.

image

Another one could be #4179 to show labels on wires.

The Inspector is managed in the "HtmlInfoView"
I don't know about any existing use cases for the part number field for wires, and using it to code the the length, diameter or material makes some sense.

If a length is specified, I think Fritzing must then also use this as a constraint on the wire. It would be confusing to have a wire half across the breadboard that is specified as 5mm length. Even if we don't implement that constraint right now, the possibility is still a very good reason the use a distinct property for the length, and not re-use the part number.

Properties are part of the Qt framework (both, python or C++), see qobject.h

@failiz
Copy link
Contributor

failiz commented Oct 1, 2024

To edit the field in Fritzing, the part needs to be a Capacitor item. Check capacitor.cpp and partfactory.cpp which makes this possible.

@veng1
Copy link
Author

veng1 commented Oct 1, 2024

To further elaborate, my "Breadboard" will actually be parts mounted on a DIN rail. The Fritzing Breadboard diagram does a stellar job of illustrating this using photos to create svg images of the parts. Consequently, the lengths of the wires are longer than the color codes which are used in the kits. And this being a 120VA battery-up back circuit, the AC power wire should be the conventional colors while V+ should be red and V- should be black in this use case. So, I think that part numbers are a reasonable solution.

A wire on a breadboard or any other real world circuit is a physical part just like a resistor, so I'd like to suggest this as an improvement to a future release. However, I'll attempt to change the code for my temporary use.

Thanks for the guidance.

@veng1
Copy link
Author

veng1 commented Oct 1, 2024

I changed the Wire to a Capacitor item in partfactory.cpp but the field is still not editable. What have I overlooked?

@failiz
Copy link
Contributor

failiz commented Oct 2, 2024

You must add the property in the properties.xml file

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

No branches or pull requests

3 participants