I want to create an interactive web page which allows you to interact with the electrical components. The interaction would be simple. When you close a switch the corresponding line in the circuit diagram would get highlighted. I have found SVG to somewhat interact with the graph elements but still the connection of different circuit elements is not clearly specified in SVG. Is it possible to do such thing? I want to get all the list of connected components of a electrical part representation. Is there any graphics model which can help me?
Asked
Active
Viewed 80 times
0
-
It is a bit unclear if you are asking about gfx or electric modeling and also too broad: not a WEB programmer but: 1.you can use PHP to generate HTM/SVG code. 2. there is no such model in gfx but there are structures in programing for this like graphs... 3.btw you can make SVG code for all components supported, add their pins relative position and then compose the output SVG programaticly via PHP script according to your simulated circuit. If you are asking how to simulate the circuit learn the physics around it (VA diagrams,kirchoff rules)... see http://stackoverflow.com/a/22567233/2521214 – Spektre Dec 14 '14 at 10:03
-
I know how to do electrical modelling, My idea was something like this: 1) I would like to open and close the switch in SVG using some outside button. If there is a powersource, then I must be able to show the flow of current in the Diagram using some highlighting. Now The same thing has to be implemented in very large diagrams, so creating graphs manually would waste a lot of time. Having a structured data model would save a lot of effort and time. – Nishkarsh Shastri Dec 15 '14 at 13:32
-
then create set of SVG's per each type of supported component (with all highlight possibilities) and during generating the target SVG view use the right one (according to modeled electrical state). – Spektre Dec 15 '14 at 13:43
-
But as the problem goes for bigger circuits, the above approach would have to handle large number of possibilities. And in varied situations, mapping each possibility would be difficult. You can assume that I have atleast 20 switches connecting 10 components and 50 wires. That is just one case. If I have to do multiple circuits, then this problem will further increase. – Nishkarsh Shastri Dec 15 '14 at 15:03
-
don't get your problem if you have 20 or 1 resistor it is still just the same resistor image with 3 possibilitis (off,on direction from pin 1 to 2,on direction from pin 2 to 1) ... – Spektre Dec 15 '14 at 16:20