I show a small celsius to fahrenheit converter (this is one of the tasks from 7Gui) that I build using my visual programming system and extended it where needed.
The solution uses an observe-variable node-type which triggers a flow when a variable gets set. I've also build a new user-input node with decimal formatting option (in the near future I will extend this to be configurable forms for collecting user-input).
You can see what happens as you type in the celsius or fahrenheit temperature in the input fields (you see the data flowing though the flow). To prevent an infinite loop, the flow-engine uses a call-stack which stops running when a node gets run twice.
I am still thinking of different solutions but for now this works (some nodes gets run unneeded, I think this can be optimized). Per node-call the node-id, scope-id and input port-name is stored on the call-stack, this is needed to keep other things working like the recursive functions in the quicksort example.
The celsius-to-fahrenheit converter can be tried out here : https://demo.codeflowcanvas.io via the examples dropdown.
🍰 2
Maikel
04/20/2024, 9:09 AM
this is an alternate flow which requires code changes (I haven't commited this yet). It makes more sense to do the calculations directly after the user-input nodes I think. But somehow it feels more cluttered and the data flows a bit weirdly because of the order of execution and how this is stored in the execution history. Something to think about further.
👍 1
Maikel
04/21/2024, 8:29 AM
I changed the implementation and the example and made a small video about it:
https://youtu.be/_rrIsdqM4ik▾
Something that I want to improve on further is how parallel flows are handled together with the timeline slider. The timeline slider currently shows the execution path differently then when you are executing a flow when entering data in the user-input nodes (this also happens in other scenarios for example when a flow contains the parallel node-type or when a node contains multiple outputs).