lf-lang / lingua-franca

Intuitive concurrent programming in any language
https://www.lf-lang.org
Other
220 stars 57 forks source link

Diagram: reaction trigger of multiple timers in modes is displayed wrong #2325

Open NiklasRentzCAU opened 1 week ago

NiklasRentzCAU commented 1 week ago

Take this LF program:

target C

main reactor {
    timer t(0, 200 msec)
    timer t2(0, 1000 msec)

    initial mode S1 {
        reaction(t) -> reset(S2) {=
            lf_set_mode(S2);
            // Do something.
            printf("timer t fired\n");
        =}
    }

    mode S2 {
        reaction(t2) -> reset(S1) {=
            lf_set_mode(S1);
            // Do something else.
            printf("timer t2 fired\n");
        =}
    }
}

LF-mode-timers

The diagram displays both modes to take their input from the timer t, although S2 reacts on the timer t2. The timer t2 should to be connected to the reactor and reaction 2 inside S2 should be (visually) triggered by t2.

The execution does not seem to be affected, only the graphical representation here is incorrect, indicating that there is an issue in the KLighD synthesis of LF.