Commit Graph

265 Commits

Author SHA1 Message Date
Léa Saviot
9d82804ff3 [code/emscripten] On emscripten, fixed waiting after a Python drawing.
The user can now push OK or Back to remove a Python drawing.

Change-Id: I293064a9458f8c0c6d0da5351500600fd9e82706
2017-12-01 12:06:05 +01:00
Léa Saviot
8dfeaa1f63 [code] Fixed bug in Accordion.
The last edited buffer was not properly computed.

Change-Id: I7aadbc6e3ea41b3b0e344276933dca14c505ee71
2017-12-01 12:06:03 +01:00
Léa Saviot
9d57d7f173 [code] Cleaned MenuController.
Change-Id: I499fcaf728a4f60557475b64e371a97e362b558d
2017-11-28 10:27:33 +01:00
Léa Saviot
2ce26f2625 [code] Fixed assertion bug in MenuController.
The assert should take into account the fact that there might not be any
script.

Change-Id: I68f0e5071ffd011fc5bb1dacc035d2127bdd8176
2017-11-28 10:27:12 +01:00
Léa Saviot
07bc7672e8 [code] Fixed cursor bug when inserting text in editor.
Now the cursor moves only if the insterion was successful.

Change-Id: If2f74307aecd4b9b86183a3437a53fd8875c1751
2017-11-21 17:37:48 +01:00
Léa Saviot
711f78f837 [code] Added Kandinsky module and other functions in Toolbox.
Change-Id: I81a1323993c91990b13e81cbf4ea2af1ace8ef11
2017-11-21 17:37:48 +01:00
Léa Saviot
c537a59006 [code] Removed "input()" and Random module from the Toolbox catalog.
Change-Id: Id9e99cc908d533f018b1fe28f60b6fa26d8ea546
2017-11-21 17:37:48 +01:00
Léa Saviot
f7a6e615ca [code] The cursor in a toolbox command does not go before a point.
The cursor now goes either after the first open parenthesis or at the
end of the command.
Fixed z.real and z.imag.

Change-Id: I46ca3be0415832fd91273ca7fed12ed3d6f125dc
2017-11-21 17:37:48 +01:00
Léa Saviot
92789330de [code] Search function in the code Toolbox.
When the user types a letter, the toolbox scrolls to the first row that begins
with said letter (without considering if it is lower or upper case). If
there is not such a row, the toolbox scrolls to the first row that has a
letter higher than the typed letter.

Change-Id: I353d23560d8a4d618d96426c393b024e7fb487af
2017-11-21 17:30:04 +01:00
Léa Saviot
95bf921138 [code] The Mandelbrot script now uses complex numbers.
Change-Id: I47f14d414c86c09f85093c201d16ef71ce028510
2017-11-21 17:12:42 +01:00
Léa Saviot
a9f4da92c0 [code/python] Fixed the Kandinsky module in Python.
User can draw on the 320*220 drawing screen.

Change-Id: I25034b05f21aacc35608358fdb7a4d9924dd22e8
2017-11-21 17:12:38 +01:00
Léa Saviot
c8a5f4dbe2 [code] Fixed bug in console history copy-paste.
The ConsoleController also tried to copy-paste the edit textfield.

Change-Id: Ib1e8d003a9c4793c0666d489f4b4278759eff484
2017-11-17 14:05:23 +01:00
Léa Saviot
f2e2e93888 [code] Larger console button in MenuController.
Change-Id: Ia8a495d4de95a4a9d6fee698975b2c7e831c4c43
2017-11-17 14:05:23 +01:00
Léa Saviot
c543145aae [code] Optimized MenuController's script list scrolling speed.
To know if the AddScript row should be displayed, we need to compute the free
space size of the accordion, which is very slow. We thus memoized a bool
indicating if the AddScript row should be displayed.

Change-Id: Ia3891c0fc8df9b0b8bf2a9ad053be6dfc848c970
2017-11-17 14:05:23 +01:00
Léa Saviot
6baaa8547a [code] Execute a script from the script options.
A button in the options opens the console, with only the current script
imported.

Change-Id: Ia3053534d6fdb2bd1340ce3c42b7249510c97bbc
2017-11-17 14:05:23 +01:00
Léa Saviot
57633829a9 [code] Split the Menu Controller in two columns.
The scripts names are on the right and open the script edition.
The left cells open the script options.

Change-Id: I3fbab8c3861f3395c3206775c92cda3470963b26
2017-11-17 14:05:23 +01:00
Léa Saviot
c294c15072 [code] Changed script auto importation label.
Change-Id: Iead9dc6499f2ba7f909a791a29045d88241cd86c
2017-11-17 14:05:23 +01:00
Léa Saviot
b73170b77b [code] Print errors in the Python console.
Change-Id: If3a096ee46105229b6c4c77906826e78666cdc11
2017-11-17 14:05:23 +01:00
Léa Saviot
07c6acada4 [escher/code] Move Accordion from escher/ to apps/code/.
Change-Id: Id90ef9791f8c18bcdce497b8e20f060314f7b58b
2017-11-17 14:05:23 +01:00
Léa Saviot
414e537969 [code] Empty console commands are not accepted.
Change-Id: Ie6affec97669312566c1b360bb2220f2c8723219
2017-11-17 14:05:23 +01:00
Léa Saviot
59c840ef9a [code] Auto-indentation when inserting Toolbox items in scripts.
Change-Id: Id444ab91965999a3d322dee2fa58f73c86aa6992
2017-11-17 14:05:23 +01:00
Léa Saviot
4f74b6d849 [code] The addScript button disappears when needed.
When there is already the maximal number of scripts or when the
ScriptStore accordion buffer is full.

Change-Id: I0d43d42626da7f060a2309c66f1806b35a29bf38
2017-11-17 14:05:23 +01:00
Léa Saviot
07bffe9069 [code] Increased memory allocated for scripts to 4096.
Change-Id: Ida0c3190e4aa21a2e373bf3d1561a97006c84e4b
2017-11-17 11:59:50 +01:00
Léa Saviot
4194165217 [apps] Fixed size_t / int comparison warnings.
Change-Id: I08bae0d687a52d708053c4279f68b42c5bb5d180
2017-11-17 11:59:50 +01:00
Léa Saviot
42e6435973 [code] Fixed Script edition cursor bugs.
The scroll is now reloaded when text is inserted or a new line is
entered. When opening a script, the cursor moves to the end of the
script.

Change-Id: I027ea80db485916fc3fc962cfa9e032ca0bbc81e
2017-11-17 11:59:50 +01:00
Léa Saviot
13bf8c2d62 [code] Python toolbox.
Change-Id: I4028b05c662cae04a5ac3af5021f3438bb22dcd0
2017-11-17 11:59:50 +01:00
Léa Saviot
a19377ad5e [code] Default numbered script names (e.g. script1.py)
When the script name is empty after renaming a script, a default new name is
given. We look for the first available scriptI.py name, with 0<I<100.

Change-Id: If17f1df95c552320c0412ce652e7ae7e0cfd9cbc
2017-11-17 11:59:50 +01:00
Léa Saviot
2456c7eeba [code] Improved console command editing.
When the user scrolls the history, the draft command is not erased.
When pasting a previous command, the text is inserted at the cursor
location.

Change-Id: I1cd9645de74f34fad4ed0898203e05bd3352456a
2017-11-17 11:59:50 +01:00
Léa Saviot
59d0e6dabf [code] Left/right navigation in the console history.
Change-Id: Ibbd534aa80f2f8dcb41d10e38f4abfcc7dbfd4a7
2017-11-17 11:59:50 +01:00
Léa Saviot
ce51228ca8 [escher/code] Changed Console and TitleBar margins.
Change-Id: I8ac4d84da84e0194122f34bb6259a1a7b6a1c81e
2017-11-17 11:59:50 +01:00
Léa Saviot
fbdf6379d8 [code] Script editor and Console are stacked.
Before, they appeared in modal views.

Change-Id: I42ea742370cd3cf0854965f67fc44b43db4cc309
2017-11-17 11:59:50 +01:00
Léa Saviot
fc603df886 [code] Activate AlphaLock mode when renaming a script.
Default Alphalock mode when finishing or aborting edition.

Change-Id: I6455d5e18957c822de34271c53b64be43a5099ea
2017-11-17 11:59:50 +01:00
Léa Saviot
6ee47d6168 [code] Prevent script name extension edition.
Change-Id: I4ac8d032fd88b853670afeebaecc8d6fd5ef981d
2017-11-17 11:59:50 +01:00
Léa Saviot
b7baec4a40 [code] Keyboard events translation, for script or command edition.
For instance, the "power" event should insert "**" in the text, not "^".
Added a universal i18n file in apps/code.

Change-Id: I5d067b0c5b86590af95aa98856522d54e42acba6
2017-11-17 11:59:50 +01:00
Léa Saviot
681be23c30 [code] Auto indentation in the script editor.
Change-Id: I7066c41fa53068e6f18a5ad226b5e72f591f02e2
2017-11-17 11:59:50 +01:00
Léa Saviot
239e702d37 [code] Navigation in the console history.
The user can copy previous commands or results, into the clipboard or in
the console prompt.

Change-Id: I280fff2d4937f4d17ab6c8907d6e5c359a322372
2017-11-17 11:59:50 +01:00
Léa Saviot
745eddfa05 [code] Added default Fibonacci script.
Change-Id: I2766fa542ee64722018486a874e9855a5976a788
2017-11-17 11:59:50 +01:00
Léa Saviot
35520fb3d4 [code] Scripts can be automatically imported when the console is opened.
Editing, renaming, deleting or changing the auto-importation of a script
triggers the reloading of the console (the history is cleared, Python
restarted and the scripts re-imported).

Change-Id: If8b933cc077ecd36cab09214b5e7a181aa3ae030
2017-11-17 11:59:50 +01:00
Léa Saviot
45aa526cd6 [code] Fixed SelectableTableView selection problem.
If adding a script fails, the selectableTableView should select the "Add
script" line.

Change-Id: I373cdfa0afcc334e4bf306b1cee4bfb817417980
2017-11-17 11:59:50 +01:00
Léa Saviot
fbb5c70339 [code] Cleaned Script and ScriptStore classes, created accordion.h
A Script object now contains its AutoImport marker, its name and its
content. The ScripStore methods have better names and the optimization
is cleaner.

Change-Id: I1b21af2d23f1c9a34f984309512b0c01b2f1c320
2017-11-17 11:59:50 +01:00
Léa Saviot
a14cfd0aea [code] Script names are displayed and can be edited.
Change-Id: I5acc468920b66673e78da130bf90a74d0c062211
2017-11-17 11:59:50 +01:00
Léa Saviot
68f368fcde [code] The user can delete scripts.
Change-Id: I1b60a4c79a58efe5213add1b1c5d60cdfe85c1e6
2017-11-17 11:59:50 +01:00
Léa Saviot
5de4b5cd67 [code] Each script has a name, stored in the accordeon buffer.
A script can now be imported in the console.
Moved all the MicroPython functions to python/port files.

Change-Id: I0a23e8cb20005719b800e81470e1c574c702c3b7
2017-11-17 11:59:50 +01:00
Léa Saviot
f3200fe2e9 [code] Program store that uses an accordeon buffer to store the
programs. The user can now add scripts.
A contextual menu displays various options when clicking on a script,
such as editing.

Change-Id: I124a17f7584b0beedb897e8499ca0a1bb6c13cbe
2017-11-17 11:59:50 +01:00
Léa Saviot
adabf95b59 [code] The interface is a list with a button at the bottom to
start the console.

Change-Id: I4a4a432db2d4cdc72e9a0ad7aa5904c1ded3c0e1
2017-11-17 11:59:50 +01:00
Léa Saviot
c57f9cf8b1 [code] The Python console compiles and executes commands entered.
It stores and displays the result in the console store.
An empty line returned at the end of the execution is deleted.

Change-Id: Ic90e02e2d91d0a0033413da0588032d9450aefd0
2017-11-17 11:59:50 +01:00
Léa Saviot
493cef0d4d [code] Python console that stores and displays commands that are
entered.

Change-Id: I0343c38b60f4bbea6dfab173e2b5f46f66b83251
2017-11-17 11:59:50 +01:00
Romain Goyet
3d10d3e951 Use zero-initialization for character arrays
It makes some not-fully-compliant compilers happy
2017-10-19 17:31:40 +02:00
Romain Goyet
e6ed6c74a4 [apps] Split the i18n in multiple files
A Python script aggregates all i18n files and merges them.
We now can pick a list of locales to build in EPSILON_I18N_LANGUAGES
2017-09-29 17:08:46 +02:00
Romain Goyet
dcdd27d6bf [apps] Apps can be picked and ordered at compile-time 2017-09-20 11:18:39 +02:00