Port of Gtk+ Analog Electricity
Open, NormalPublic

Description

Port the Analog Electricity activity.

This one is requested very often, so we really need to get it back at some point.

Also, some comments from a user requesting a few improvements to it:
"it would be cool to add some components in the future:
adjustable resistor, capacitor and inductor, diode, one small signal NPN and PNP transistor, relais, loudspeaker (-> sound).
And a dream would be a simple oscilloscope with self-adjusting scales."

Related Objects

Here is the javascript library we should use for this activity:
https://github.com/Aerlinger/maxwell

(we even asked for it here: https://github.com/Aerlinger/maxwell/issues/1 )

.. and another possible library we could use: https://github.com/willymcallister/Circuit-sandbox

Not sure which one is the easiest to use yet.

Hi. I was just looking at the Gtk+ version of this activity. Is there supposed to be a specific goal which shall lead to a win in a particular level? Because although resistors and connectors are offered, I can't find any use for them in lighting the bulb.

Having like the digital mode would be interested.
A tutorial mode where we explain the use of the components + having a particular goal with them.
And a free mode where the child have all the components and do what he wants.

Ok. Yes that would be much better in fact. Thanks.

is this activity started in any branch ?

no, it's to be started from scratch, some code from the digital_electricity version can probably be used too (and if it can be refactored into one base code thta would be awesome instead of copy/paste)

rohitdas added a comment.EditedMar 7 2018, 6:08 AM

Hi. I was looking through the libraries suggested above. I think the Maxwell app seems to have more potential than the circuit sandbox. Maxwell has a signal generator, which can be used for showing wave forms, and will look pretty and educational to a child as well. Also, the current flow is shown. So what do you suggest? @jjazeix @timotheegiet I have yet to look through the code completely, and the Maxwell code is much more complicated and varied, but I believe we can simply import the file structure, and use it as a library for GCompris.
Also, Maxwell has much more components than Circuit sandbox, and is a little overwhelming. The demo doesn't have any tutorial or help, so trying to figure it out is a little difficult.

Last time I checked, Qt didn't supported the js with classes which is the case for Maxwell, I don't know if there can be a workaround for it. We don't really care if the code behind is difficult or not, what is important is the library interface, to know if it is easy to interact with it.

dekumar added a comment.EditedMar 3 2019, 5:24 AM

@timotheegiet @jjazeix I have gone through the code of both the library the circuit-sandbox and the zupolgec/circuit-simulator.I think the zuplogec/circuit- simulator ( https://github.com/zupolgec/circuit-simulator ) is easy to use.But one thing I am not sure does Qt support the js with prototype and this keyword ?

@dekumar do a test and you'll see :)