-
Notifications
You must be signed in to change notification settings - Fork 844
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
Fixes dragging bendpoints of 4 or more wires (fixes #3006). #3942
base: develop
Are you sure you want to change the base?
Conversation
…onnected). Fixes fritzing#3933 and fritzing#3827 Now, when an item is connected to the breadboard, only the holes of the breadboard that are connected are in green; a wire connecting two holes of the breadboard has both ends in green.
The yellow highlight for same level subnet should still highlight all connectors of that breadboard strip. Is it affected by the patch? |
No, that is handed by a different code and still works with my fix. My patch only modifies the colors of the connectors (green, red or no color) based on their connection status. |
Hi, Edit: Notice that the commit fixes #3827 |
…her in the PCB. Thus, we need to remove the opposite connector.
Yes, I tried it in the breadboard and schematic but I did not notice the error in the PCB view. The problem is that is finding two connectors (the top one and the bottom one). I have made a fix to consider only one of the connectors of the stack. Could you try it again to double-check it? |
…pad stack (top or bottom) to the list of connected connectors. The previous commit only worked if the function was called from a connector in a pad stack. If the connector was from a trace, then we were still adding the two connectors of the pad stack.
Ok. I fixed the issue. Can you give it a try? |
@@ -1365,7 +1386,7 @@ void ConnectorItem::collectEqualPotential(QList<ConnectorItem *> &connectorItems | |||
// When the kept connector item is part of a bus, include all of the other | |||
// connectors on the bus in the list being processed | |||
Bus *bus = connectorItem->bus(); | |||
if (bus) { | |||
if (bus && (followBuses||fromWire)) { | |||
QList<ConnectorItem *> busConnectedItems; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the "skipBuses" param was broken, or maybe never implemented.
For the IPC-D 356 export we also needed this and I modified this to
@@ -1381,7 +1384,7 @@ void ConnectorItem::collectEqualPotential(QList<ConnectorItem *> &connectorItems
// When the kept connector item is part of a bus, include all of the other
// connectors on the bus in the list being processed
Bus *bus = connectorItem->bus();
- if (bus) {
+ if (!skipBuses && bus) {
QList<ConnectorItem *> busConnectedItems;
The renaming is not an issue, but I am a bit paranoid about the "fromWire". The collectEqualPotential method is quite critical. Do you think by adding the skipBuses like in our current version, we are excluding to many items?
Is the patch about more than just highlighting the connections? Or do we need it to send proper netlists to ngspice?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think skipBuses was never implemented and you implemented it recently. At least, I cannot find it in the source code. I guess skipBuses and followBuses are basically the same.
The fromWire is because I want to avoid following buses of the parts (e.g., breadboard or Arduino pins), but I still want to follow the wires. And the wires are implemented as buses. Removing the fromWire from the code breaks the connector highlighting.
The patch is to fix issue #3827 and is just about improving the highlighting of the connector status (not related to the SPICE netlist). That issue is caused because the current algorithm checks if a part is connected to another part (ItemBase). In my patch, I changed it to check if a connector is connected to other connectors (from the same part or from a different one). No following the buses makes that ony the hole of the breadboard that is connected is highlighted.
In my code, the only point where buses are not followed is in the restoreColor function. The code for generating the spice netlists uses the default argument of followBuses (as it is necessary to follow the buses). Not sure how the exporting of the IPC-D 356 netlists works.
This fixes issue #3006. When dragging a bendpoint with a junction of 4 or more wires, all wires are updated correctly. This fixes the schematic and PCB views.
There is a similar problem (issue #3580) when dragging a part (the wires connected to that part are not updated correctly). Probably, it is the same cause as in this bug, but in a different part of the code (dragging part code). There is a video of this issue also in #3006.