lingua-franca
lingua-franca copied to clipboard
Ports on the north or south side are not rotated in the diagram
The following program
target Python
reactor Src {
physical action a
@side("north")
output out1
@side("east")
output out2
reaction(a) -> out1, out2 {==}
}
produced this diagram:
This looks a bit odd, as I would expect the ports to point up or down.
For some reason I cannot assign @soerendomroes, so I am pinging ;)
This should be the case since KLighD defines the port rendering to look this way for output ports, which does not seem to consider NORTH
or SOUTH
ports.
@a-sr Could you point to the part in the synthesis where this is handled?
I also just noticed that the layout looks suboptimal in the following example. It would be nice to draw the two reactors centered on top of each other in this case.
target Python
reactor Src {
@side("south")
output out
}
reactor Sink {
@side("north")
input inp
}
main reactor {
src = new Src()
sink = new Sink()
src.out -> sink.inp
}
Yes, it would but this is not possible if the layout direction is RIGHT
.
What exactly do you want to achieve? Maybe you could do a quick sketch what you want LF programs to look like and I could suggest layout options to achieve the desired layout?
I find it rather unproductive to comment on every small change you make regarding NORTH
and SOUTH
ports. I would rather show you the different available options and their consequences in a short meeting.
I am trying to reproduce this figure (ignore the blue dashed errors, they represent asynchronous communication outside the reactor model and would need to be edited in later).
Generally, I am working on some figures for my dissertation and opened an issue whenever I found something that didn't work as expected. The issues have accumulated a bit, and yes perhaps it's best we have a short meeting. I'll ping you on zulip.
While north
and south
works with the layout, I did not implement the orientation for the port figure in those cases because I did not expect that it will be used. You can find the code here: https://github.com/lf-lang/lingua-franca/blob/master/core/src/main/java/org/lflang/diagram/synthesis/LinguaFrancaSynthesis.java#L1648