Commit Graph

33 Commits

Author SHA1 Message Date
Léa Saviot
344ea5a67a [apps/code] Handle Home event when in the toolbox
If editing a script, the empty space at the end of the script should be
moved to the end of the storage.
2020-02-12 15:13:18 +01:00
Romain Goyet
758c217120 [ion] ion_main takes const arguments 2019-10-16 10:01:00 +02:00
Ruben Dashyan
eb6d697927 [apps] Make app accessors static members of App classes 2019-07-19 15:06:25 +02:00
Ruben Dashyan
44809f4b3f Substitute Escher app() by Container::activeApp() 2019-07-19 15:06:25 +02:00
Romain Goyet
21907fb89a [apps] Get rid of App casts 2019-07-19 15:06:25 +02:00
Ruben Dashyan
1f06819974 [apps] Remove Container * parameter from all App constructors 2019-07-19 15:06:25 +02:00
Léa Saviot
58f94f5e5f [apps/code] Check that app can be exited before switching to DFU
This fixes the following crash: create a script which contains only
"input()". Execute it, then while in the input, plug in the calculator.
When un-plugging it, the device crashes.
2019-01-07 13:36:01 +01:00
Émilie Feral
916493a4d2 [apps] Reset (exam mode) delete all records at once 2018-11-23 12:04:10 +01:00
Émilie Feral
a4f7d83805 [code] Load Variable box content before compiling any other python code
to avoid memory exhaustion when displaying variable box
2018-11-23 12:04:03 +01:00
Émilie Feral
0a823da78c [escher] Variable box pop-up is handle as Toolbox pop-up by asking
InputEventHandlerDelegate
2018-11-23 12:04:03 +01:00
Émilie Feral
698332c355 [escher] InputTextDelegate and LayoutFieldDelegate don't inherit from
InputTextDelegate to avoid diamond inheritance
2018-11-23 12:04:03 +01:00
Émilie Feral
01e433a9f2 [escher] Clean Field and Input class hierarchy:
Class hierarchy:
- InputEventHandler
- TextInput
- EditableField derives from InputEventHandler
- LayoutField, TextField and ExpressioField derives from EditableField
- TextArea and TextField derives from TextInput
2018-11-23 12:04:02 +01:00
Léa Saviot
2661032993 [apps/code] Fix Python loading when going in the VarBoxController
The Var box controller deinited python on exit, and the console
controller did not reload python + it made the console controller lose
all its context, such as imported scripts
2018-09-21 11:55:12 +02:00
Émilie Feral
afce751eb7 [code] Get rid of malloc: keep a buffer in Code::App to be used as python heap 2018-09-19 18:20:30 +02:00
Émilie Feral
da8286d3f7 [code] Escaping the input loop on a 'home' event should be handled by
the code app instead of the console controller to ensure to escape the
input loop even when the toolbox (or any modal) is displayed
2018-05-23 10:01:15 +02:00
Émilie Feral
5cfe20ad15 [code] Move ConsoleController from MenuController to App 2018-05-23 10:01:15 +02:00
Léa Saviot
3059f27c00 [apps/code] Remove un-necessary dependency.
Change-Id: I65a7b81b44aa1be6ff064e8fde0af23760fb5d7d
2018-04-06 14:31:49 +02:00
Émilie Feral
3db86a8111 [apps] Code: merge actions for text input in ConsoleController and
EditorController
2018-03-22 13:12:12 +01:00
Émilie Feral
c5e525ddb7 Enable to give options at run-time 2018-03-22 11:58:56 +01:00
Léa Saviot
53d2ae2c46 [code] Rename Code::Toolbox in Code::PythonToolbox for more clarity.
Change-Id: I3729fedd8a26531edcd17105ed5fc177c06a8fcb
2017-12-01 13:19:30 +01:00
Léa Saviot
e6b4d07cb6 [code] Dynamic toolbox that displays script functions and variables.
Change-Id: Id1494580b3832540633d3aefaf04710d21e0a44c
2017-12-01 12:06:05 +01:00
Léa Saviot
13bf8c2d62 [code] Python toolbox.
Change-Id: I4028b05c662cae04a5ac3af5021f3438bb22dcd0
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
745eddfa05 [code] Added default Fibonacci script.
Change-Id: I2766fa542ee64722018486a874e9855a5976a788
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
493cef0d4d [code] Python console that stores and displays commands that are
entered.

Change-Id: I0343c38b60f4bbea6dfab173e2b5f46f66b83251
2017-11-17 11:59:50 +01:00
Émilie Feral
eec8c7f1ce [apps/code] Add a model program
Change-Id: I79b74f1f245d98d1ce02a590ee25de2c4fbb3c59
2017-08-17 16:21:21 +02:00
Émilie Feral
8b6dfdc3f9 [apps/code] Add a menu to edit and execute the program
Change-Id: I036e5a32fa6823b25af4ccd742967841579d7639
2017-08-17 16:21:21 +02:00
Émilie Feral
f434cda428 [code] Add a pop up to warn about beta version
Change-Id: I4301c7a53d0d43bb1e322b9e3e1587ec2040e0b8
2017-08-17 16:21:21 +02:00
Émilie Feral
bb5523b747 [python] Change app name and icon
Change-Id: I0c505d08a464d63200bd5e1e0dc81825632691e5
2017-08-17 16:21:21 +02:00
Romain Goyet
19cf3a4958 [apps] Add a code app
Change-Id: Icc72c378a6434b5d3b0af74f23e31ea7514882b8
2017-08-03 23:28:56 +02:00