[phoenix-project] Re: Block based programming for ExpEYES?
- From: Georges Khaznadar <georges.khaznadar@xxxxxxx>
- To: Ambar Chatterjee <drambar@xxxxxxxxx>
- Date: Sun, 1 Oct 2017 12:04:58 +0200
Dear Ambar, dear Özhan,
Ambar Chatterjee a écrit :
However the following points need to be noted:
Scratch is a block based GUI development paradigm which is aimed at
introducing programming to kids. The target age group is 8-11 years.
ExpEyes is (in my opinion) expected to touch children in that age group so
as to excite them into the more advanced world of engineering and science.
I agree with Ambar:
I began to develop a block-oriented user interface for developers who
want to program Expeyes, here is the work done so far:
(take a look at the screenshots).
As can be seen, the main paradigm among the blocks which are used is
*not* about teaching basic algorithmics, but the logical connections
between signals and components able to digest those signals, i.e.
formulae like additions, substractions, or something more complicated
like FFT, displays for the GUI like a scope window, and text displays.
After assembling blocks, the "F5" key allows one to have the program
running, but it also yields a Python program as a side-effect.
So, the next step can be to take the automatically generated program and
edit it with a suitable editor, like every program developer in the
Programming is just one aspect, science and engineering is the real target.
ExpEYES17-Qt/blocks/ is rather targetted at science and engineering,
programming is only possible in a second step.
If kids of that age want to dabble in programming - Expeyes is intended to
lead them onto more mathematically oriented languages like Python.
Personally I would be more inclined to develop Expeyes code in mainstream
programming frameworks like Visual Studio .NET (C++, C#) and GTK3 under
The current effort made by Ajith Kumar and Jithin is rather based on
Qt4/Qt5, which are (in my opinion) as good as Gtk3 to generate GUIs.
Besides, Qt5 is well ported on much platforms, see
http://doc.qt.io/qt-5/supported-platforms.html ... Win, Mac, Linux, and
UWP, iOS, Android.
As you know I made several steps in that direction
(http://expeyes.000webhostapp.com/) , but did not find the time to give a
finishing touch to the work. Nor did anyone else come forward (after the
young schoolboy Asutosh Mishra moved on with his education - presently
studying software engineering in IIT).
I saw the page http://expeyes.000webhostapp.com/programming.php which
describes three alternatives to develop for Expeyes on Windows
platforms: Win32 API, MFC, and Windows Forms.
I would like to suggest you a fourth development alternative, Qt SDK for
Windows ... see for example
As sources developed for Windows with Qt5 Creator are seamlessly ported
to other systems, your community is no longer in an island disconnected
from other Expeyes developers' islands.
If someone with programming knowledge comes forward, I am ready to assist
for any re-coding of ExpEyes. Anyone particularly interested in Scratch,
let me know, and we can take it from there.
For Scratch development, I would like to know the target platform (Windows
As far as I know, Scratch is platform-agnostic.
Also would like to know how the main parts of code would be
written (other than the GUI) particularly interacting with the driver,
mathematical part (Fourier transform, graph plotting etc). GUI is what
users see, but much of the real coding is in the other logical parts, not
the GUI. Can these parts be written in Scratch?
I ignore whether high level signal processing libraries have been
connected to Scratch. I am happy enough with Python, as four "creative" lines
of text are enough to acquire a signal, make some FFT, and display them in two
featureful windows. Unfortunately, the minimal program must contain
seven "mandatory", non-creative lines, if you write it with a plain
editor and use Python unshielded. See attachments: hello.py and
An alternative would be to develop a custom editor which will
automatically prepend and append mandatory lines, to make some magics
before submitting the program to Python. However I am reluctant to
propose such black boxes to users. Even young students can notice what
is a modifiable part in a text. Besides, "mandatory" parts can be
rewritten in many other and useful ways.
Best regards, Georges.
################### mandatory introduction: libraries, initializations
from eyes17.eyes import open
from eyes17.eyemath17 import fft
from PyQt4.QtGui import QApplication
from pyqtgraph import PlotWidget
################## first creative section: capturing, plotting a signal
pw1=PlotWidget(); pw1.show(); pw1.plot(t,v1)
################## second creative section: frequency/amplitude chart
f,a = fft(v1,10e-3)
pw2=PlotWidget(); pw2.show(); pw2.plot(f,a)
################# mandatory conclusion to start the user interaction.
Description: PNG image
Description: PGP signature
Other related posts: