[WIP]Processing Jumpers and Loops, Plus Processing Wires inside the Table as Edges based on #251#412
Closed
tobiasfalk wants to merge 117 commits intowireviz:devfrom
Closed
[WIP]Processing Jumpers and Loops, Plus Processing Wires inside the Table as Edges based on #251#412tobiasfalk wants to merge 117 commits intowireviz:devfrom
tobiasfalk wants to merge 117 commits intowireviz:devfrom
Conversation
`edotor.net` does not seem to like leading underscores, which makes GraphViz debugging difficult.
no diff should ocurr as a result of the refactoring
to avoid diffs later when calling via CLI
for debugging purposes
wireviz#251 (comment) No output changed for any examples/tutorial/tests input.
Removed from `Connector` class since it is already defined in the `Component` superclass.
This was referenced Sep 25, 2024
Contributor
|
Hey I tried your branch and ran into the following issues:
...
<td>
<table border="0" cellborder="1" cellpadding="3" cellspacing="0">
<tr>
<td>GND</td>
[]
<td port="p1r">1</td>
</tr>
<tr>
<td>VCC</td>
[]
<td port="p2r">2</td>
</tr>
<tr>
<td>RX</td>
[]
<td port="p3r">3</td>
</tr>
<tr>
<td>TX</td>
[]
<td port="p4r">4</td>
</tr>
</table>
</td>
...
def gv_short_row_part(pin, connector) -> List:
short_row = []# Td("ADA"), Td("DAD")
for short, shPins in connector.shorts.items():
if pin.index + 1 in shPins:
short_row.append(Td("", port=f"p{pin.index+1}j"))
else:
short_row.append(Td(""))
- return short_row
+ return short_row if len(short_row) > 0 else None
<tr>
<td border="0" cellspacing="0" cellpadding="0" colspan="5" height="6" port="w1">
<table border="0" cellborder="0" cellspacing="0">
<tr>
<td bgcolor="#FFFFFF" border="0" cellpadding="0" colspan="5" height="2"></td>
</tr>
<tr>
<td bgcolor="#FFFFFF" border="0" cellpadding="0" colspan="5" height="2"></td>
</tr>
<tr>
<td bgcolor="#FFFFFF" border="0" cellpadding="0" colspan="5" height="2"></td>
</tr>
</table>
</td>
</tr>
def gv_wire_cell(wire: Union[WireClass, ShieldClass], colspan: int) -> Td:
- if wire.color:
- color_list = ["#000000"] + wire.color.html_padded_list + ["#000000"]
- else:
- color_list = ["#000000"]
-
- wire_inner_rows = []
- for j, bgcolor in enumerate(color_list[::-1]):
- wire_inner_cell_attribs = {
- "bgcolor": "#FFFFFF", # bgcolor if bgcolor != "" else "#000000", # TODO: More elegent solution for making black/whit space needed, since the wire is drawn as an actual edge
- "border": 0,
- "cellpadding": 0,
- "colspan": colspan,
- "height": 2,
- }
- wire_inner_rows.append(Tr(Td("", **wire_inner_cell_attribs)))
- wire_inner_table = Table(wire_inner_rows, border=0, cellborder=0, cellspacing=0)
wire_outer_cell_attribs = {
"border": 0,
"cellspacing": 0,
"cellpadding": 0,
"colspan": colspan,
- "height": 2 * len(color_list),
+ "height": 6, # is 6 correct here? before it was 6 for single color wires
"port": f"w{wire.index+1}",
}
# ports in GraphViz are 1-indexed for more natural maping to pin/wire numbers
- wire_outer_cell = Td(wire_inner_table, **wire_outer_cell_attribs)
+ wire_outer_cell = Td(None, **wire_outer_cell_attribs)
return wire_outer_cellShould I create a merge request against your branch? |
Author
|
@SnowMB Yes please, did not see that there is a problem with the html output. |
Author
This was intentionally, since I was a bit leasy and it was the fastest🤦♂️ |
Fix examples for jumper branch
|
Interested in this. (To anyone else you can see changes more clearly by comparing to refactor/big-refactor |
Author
|
See #455 |
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.
Now, based on #251.
Thanks, @kvid, for your help with git(#251 (comment))
I will implement a fix for the problem that was discussed in #369 with @martinrieder and I will look into the implementation of the discussion in #286 by @formatc1702 and @martinrieder.