There is a topic in Power SCADA which is called “dynamic coloring” and I have to implement it in the Ignition.
This feature is used to show operators the state of energizing and de-energize of each elements
and line in SLD (Single Line diagram) base on the state of CBs and power sources like a power plant or substation in the whole circuit by changing the color.
As the SLD getting larger and larger (for example for a small city) using the traditional binding method on tags or using expression binding with a lot of if statement is pointless and really time-consuming,
so I wonder how to make lines and elements color dynamics.
As a very simple example consider the following samples. There are many loops and complex conditions to decide which line has to show powered or not. We may have lines that can be energized on three different sides.
One method is to parse power grid mesh with an algorithm and find out the final state and send it as JSON to the view that shows the SLD. The message receiver in the view then assigns data one by one to the background SVG of SLD by using the SVG ID Tag. But I don’t know how to calculate JSON in the first place.
Some specific SCADA packages can import SLD as AutoCAD and after you define the sources of power they calculate it for you automatically.
If anyone has any experience or idea on how to do that please share it.