When simulating a circuit at slow speed, the rendered circuit state (wire colours, LEDs, counter outputs etc) is odd.
The circuit works correctly, but the way it is displayed during simulation is not what the user expects at slow speed. The circuit seems to make large jumps, while the visual representation is updated only once in a while.
This is because the simulation is driven by a timer going to sleep in order to slow down simulation. However, the simulation calculates a lot of pending simulation requests when the timer is active. In the example above, the timer wakes up every 1 to 2 seconds and executes thousands of simulation requests. During that time, the UI is not updated, which leads to
large jumps in the counter output
wires and LED are only updated every 1 to 2 seconds
This odd behaviour was probably introduced with #518 "Improve simulation speed slider behaviour", which attempted to harmonise the three speed ranges "Use", "Observer" and "Explore" by avoiding abrupt speed changes at their boundaries.
Improve the timing and repainting strategy such that the simulation appears smoother with slow simulations.
When simulating a circuit at slow speed, the rendered circuit state (wire colours, LEDs, counter outputs etc) is odd.
The circuit works correctly, but the way it is displayed during simulation is not what the user expects at slow speed. The circuit seems to make large jumps, while the visual representation is updated only once in a while.
https://github.com/flandreas/antares/assets/24633141/36a00ec6-6061-48da-81d6-a58020b9320d
This is because the simulation is driven by a timer going to sleep in order to slow down simulation. However, the simulation calculates a lot of pending simulation requests when the timer is active. In the example above, the timer wakes up every 1 to 2 seconds and executes thousands of simulation requests. During that time, the UI is not updated, which leads to
This odd behaviour was probably introduced with #518 "Improve simulation speed slider behaviour", which attempted to harmonise the three speed ranges "Use", "Observer" and "Explore" by avoiding abrupt speed changes at their boundaries.
Improve the timing and repainting strategy such that the simulation appears smoother with slow simulations.