Compare commits

...

137 Commits

Author SHA1 Message Date
Laury
51fd990c31 [geometry] Start of graph 2022-01-25 21:15:57 +01:00
Laury
7af2b45f1d [geometry] Make the app multi-tabs 2022-01-23 21:11:02 +01:00
Laury
d95785ba42 [geometry] Finished V1 of the first menu 2022-01-22 12:44:40 +01:00
Laury
d108b76a32 [geometry] Added text field in FigureParametersController 2021-12-19 14:54:54 +01:00
Laury
a3d3cbbfa5 [geometry] WIP 2021-12-13 20:39:57 +01:00
Laury
3a41cbdc85 [geometry] Some progress but don't compile 2021-12-11 21:21:18 +01:00
Laury
3ccfdf0365 [geometry] Also not working 2021-12-06 20:43:13 +01:00
Laury
6aad7d2279 [geometry] Not working third menu 2021-11-11 17:46:45 +01:00
Laury
5c1f192228 [geometry] Base app and firsts two menu (WIP) 2021-11-05 13:49:01 +01:00
Laury
84d88a3e8d [Apps] Updated submodules 2021-10-31 21:58:49 +01:00
lolocomotive
00b5d4b9fe Make gutter view background the right width (#70) 2021-10-31 21:43:29 +01:00
Lauryy06
2aee07ae55 [github] Updated issue templates 2021-10-31 21:40:52 +01:00
Yaya-Cout
41b2b64d80 Fix somes Upsilon name in somes files (#61) 2021-10-28 22:23:10 +02:00
Mino1289
473b0bbfcb [apps/settings|code] Add a Flag to remove Code option in settings if code app is not compiled (#67) 2021-10-28 22:20:00 +02:00
Mino1289
58ef8cb95d [apps/code] Remove import of mathsup (residue of #50) (#63) 2021-10-28 19:15:53 +02:00
Mino1289
5dce215165 [build/config.mak] Update of base theme (#64) 2021-10-28 19:15:26 +02:00
lolocomotive
f2f44f0f6f Make use theme colors instead of hard-coded ones (#65) 2021-10-28 19:13:21 +02:00
Laury
fbe542e5bf [python] Fix bug in draw_string 2021-10-28 14:41:33 +02:00
Laury
0a1b3bcaee [theme] Added upsilon light theme 2021-10-28 14:38:32 +02:00
Laury
f6e937a927 [settings] Bug fix in code options controller 2021-10-27 19:35:19 +02:00
Laporte
c4ed8f84d3 Custom themes script (#46) 2021-10-27 19:30:35 +02:00
Yaya-Cout
8e1b311be0 [apps/settings] Fix gamma selector (#60) 2021-10-27 19:29:53 +02:00
lolocomotive
89e51166e7 Make battery background use appropriate colors (#59) 2021-10-27 10:10:14 +02:00
Mino1289
e4961563e9 [apps/code] Remove base python script and add mathsup.py (#50) 2021-10-25 16:27:21 +02:00
Laury
e72b0f633e [calculation] Fix bug in second degree list controller 2021-10-24 19:31:14 +02:00
Hector
0550b66c03 Dark Theme changes (#42)
* Dark Theme changes

* added reader icon for dark mode

* epsilon Dark Theme changes
2021-10-20 23:11:30 +02:00
Lauryy06
e41910e2f8 [workflow] Re-update SDK version of emscripten 2021-10-20 22:38:49 +02:00
Lauryy06
d91ae29607 [workflow] Change sdk of emscripten for tests 2021-10-20 22:36:18 +02:00
ArtichautCosmique
3b90969b42 [mpy] Enabled property/etc decorators (#52) 2021-10-20 22:26:01 +02:00
lolocomotive
bd207cb845 Replace hard-coded color values with Palette colors and use the correct palette colors (#51) 2021-10-20 22:25:27 +02:00
lolocomotive
917ba7ce83 Allow themes to override default colors (#49) 2021-10-20 22:20:19 +02:00
Laury
9c9758fcb6 [reader] update README 2021-10-15 14:50:03 +02:00
Laury
83ce9d5e86 [reader] Rich text support (look at README.md) 2021-10-15 14:47:00 +02:00
ArtichOwO
d4f0c7d3e8 Added sys to the code toolbox 2021-10-15 14:47:00 +02:00
ArtichOwO
2837b240e9 [mpy] Added sys module
Removed useless "path" and "argv"
2021-10-15 14:46:39 +02:00
ArtichautCosmique
0906dc919b [mpy/kandinsky] Fix draw_string() on new line + good colors (#47)
* [mpy/kandinsky] Use good colors

* [kandinsky/context_text] Avoid returning to pos x=0 on new line, use arg's x coordinate instead
2021-10-11 20:25:03 +02:00
Faustin
9cda9d9e59 [apps/code] Add a settings for autocomplete (#36) 2021-10-07 21:48:19 +02:00
Yaya-Cout
553f3fc682 [apps/settings] Use right key to enable setting (#35) 2021-10-07 20:36:03 +02:00
Mino1289
9fdedecbff [apps/toolbox] Order of submenus & New electricity constants (#34) 2021-10-06 18:26:17 +02:00
Lauryy06
83c63a7011 [readme] Update readme 2021-10-01 21:37:44 +02:00
Yolwoocle
9636964cb9 Better English translation (#32) 2021-09-29 18:31:10 +02:00
Yaya-Cout
69d6ad5205 Add get_keys in toolbox and fix setlocaltime description (#33) 2021-09-29 18:30:30 +02:00
Laury
f9a123cc08 [mpy/ulab] Added support of from and to bytes array methods 2021-09-28 20:50:34 +02:00
Lauryy06
56f735e302 [github] update metric-workflow.yml 2021-09-26 20:50:53 +02:00
ArtichautCosmique
0a5e9e0889 [apps/code][mpy][makefile] Fix size error on n0100 (#30) 2021-09-26 20:37:56 +02:00
apoleon33
8c949d7048 [build]changed color of upsilon logo in pimp.mak (#31) 2021-09-26 20:36:13 +02:00
Laporte
2f7edc5024 Update pimp.mak (#29)
* Update pimp.mak

Mise a jour du pimp.mak pour le nouveau slogan et le logo ascii.

* Update pimp.mak
2021-09-26 14:25:00 +02:00
Lauryy06
cd40938b26 [readme] Add a capital line 10 2021-09-25 19:52:14 +02:00
ArtichautCosmique
0b54bf13f4 [storage][apps/code] Change sizes (#28) 2021-09-25 19:49:26 +02:00
Laury
f5f11c6478 [poincare] Added simplification of equals 2021-09-25 19:32:23 +02:00
ArtichautCosmique
efda561425 [ion/device/flasher] Pimp my flasher (light & verbose) (#27) 2021-09-25 18:55:43 +02:00
Lauryy06
15c96cefa6 [readme] Update french readme 2021-09-25 10:29:29 +02:00
Lauryy06
400d03ebdb [readme] Addition of a "useful links" section 2021-09-25 10:25:57 +02:00
Lauryy06
6f48adde7d Merge pull request #25 from Mino1289/upsilon-dev-dev 2021-09-25 10:17:21 +02:00
Mino1289
3a573b1204 [apps/code] fix typo 2021-09-24 11:15:56 +02:00
Mino1289
48598296cf [apps/code] Increase of number of variables loaded in the variable box 2021-09-24 11:09:23 +02:00
Lauryy06
a54d60644f Merge pull request #21 from ArtichOwO/USB-Prompt-Palette-Fix 2021-09-23 21:07:20 +02:00
Lauryy06
d579e9d14c Merge pull request #22 from ArtichOwO/Localisation-Palette-FIx 2021-09-23 21:05:57 +02:00
ArtichOwO
db0ae2f7a0 [apps/shared] Fixed localization text bg 2021-09-23 00:44:53 +02:00
ArtichOwO
2a66fbb75d [apps/usb] Fixed "white bg" text on usb prompt 2021-09-23 00:29:09 +02:00
Lauryy06
feb94af827 Merge pull request #19 from Yaya-Cout/upsilon-dev
[code/time] Add somes functions in python toolbox
2021-09-21 12:49:56 +02:00
Yaya.Cout
0b564510e7 [code/time] Add time in python toolbox 2021-09-20 17:21:41 +02:00
Lauryy06
05227184a1 [readme] Add a space line 152 2021-09-18 21:47:27 +02:00
Lauryy06
e551c69d06 Merge pull request #16 from lemoustachu/upsilon-dev 2021-09-18 21:33:40 +02:00
Laury
37c7b85da8 [reader] Removed unused include 2021-09-18 21:15:28 +02:00
Laury
0bed38576a [reader] Fix bug when changing page 2021-09-18 21:13:45 +02:00
Laury
7c02c9e72f [reader] Binded python font choice to reader files 2021-09-18 21:13:45 +02:00
Lauryy06
a5584634e5 Merge pull request #15 from Yaya-Cout/upsilon-dev 2021-09-18 13:12:02 +02:00
lemoustachu
62e5b3e135 update README.md 2021-09-18 08:49:47 +02:00
lemoustachu
62f43f393d removed abusive double <br> in readme 2021-09-18 08:47:49 +02:00
lemoustachu
3318780d7d update README.md by adding beaks to clearify the code 2021-09-18 08:44:40 +02:00
lemoustachu
a9fc3b7850 update tutorial on readme.md to build Upsilon 2021-09-18 08:41:08 +02:00
Yaya.Cout
959efdc995 [reader] Disabled reader app on N100 2021-09-17 19:28:53 +02:00
Lauryy06
fa278b0d78 Merge pull request #9 from FaustinM/omega-dev-get-battery-data 2021-09-15 18:39:48 +02:00
Lauryy06
e8044f938e Merge branch 'upsilon-dev' into omega-dev-get-battery-data 2021-09-15 18:38:40 +02:00
Lauryy06
02f4f6fe74 Merge pull request #13 from lemoustachu/upsilon-dev 2021-09-15 18:37:34 +02:00
Hugo Berthet-Rambaud
fe973b0535 update README.md
changed cd Omega to cd Upsilon
2021-09-13 08:38:53 +02:00
Hugo Berthet-Rambaud
71a764277f Merge branch 'Lauryy06:upsilon-dev' into upsilon-dev 2021-09-13 07:57:08 +02:00
Hugo Berthet-Rambaud
f6379d16fd Update README.md
just changed cd Omega to cd Upsilon in binpack commmands
2021-09-13 07:54:37 +02:00
Laury
2156ca7e42 [calculation] Added additional output about second degree polynomials 2021-09-12 21:28:07 +02:00
FaustinM
2f3339dff7 Removed a modified file from pull request 2021-09-12 00:15:55 +02:00
FaustinM
48a0da8a95 Add more python functions in ion module
Ion.battery_level() return a int with the current battery level
Ion.battery_ischarging() return a bool with the current battery charging state
bugfix for upsilon
2021-09-12 00:06:44 +02:00
FaustinM
3460e9ffd8 Merge remote-tracking branch 'origin/upsilon-dev' into upsilon-dev-get-battery-data 2021-09-11 21:16:23 +02:00
Laury
1487acbe38 [git] Added .vs to gitignore 2021-09-11 19:57:36 +02:00
Laury
367f64dac8 [reader] Fixed a bug when going backwards 2021-09-08 21:42:39 +02:00
Laury
19ee32986f [reader] Make improve coding style and added empty view message 2021-09-05 21:28:45 +02:00
Laury
7f0b8170d4 Merge OmegaWithReader 2021-09-05 17:44:51 +02:00
Lauryy06
bba7408e6c Merge upsilon-dev-ulab 2021-09-05 17:21:34 +02:00
Lauryy06
838ee83a8c Merge pull request #6 from Yaya-Cout/upsilon-dev
Fix OmegaVersion in settings
2021-09-05 17:01:15 +02:00
Laury
74c500df01 [code/ulab] removed unnecessary module utils 2021-09-05 16:57:50 +02:00
Laury
98b665ac4b [code/ulab] Disabled scipy in toolbox for n0100 + added 2 forgotten numpy functions 2021-09-05 16:57:09 +02:00
Laury
0f4502ebce [code/ulab] Added scipy 2021-09-05 16:27:44 +02:00
Yaya.Cout
9eb81a6daf Fix OmegaVersion in settings 2021-09-05 11:49:42 +02:00
Laury
a15c682e3e [code/ulab] Replaced translations by official documentation 2021-09-04 21:23:23 +02:00
Laury
74635f8d88 [code/ulab] Added ulab to toolbox 2021-09-03 22:57:04 +02:00
Yaya-Cout
ebe6a7cc5f Merge pull request #2 (Update some translations) 2021-09-02 17:58:23 +02:00
Lauryy06
3a4e33a1a7 Merge pull request #2 from ArtichOwO/uLab 2021-09-01 18:03:06 +02:00
Lauryy06
dd757969f3 [readme] Correct readme.fr 2021-09-01 18:00:24 +02:00
Laporte
0df76f1680 [readme] Update readme
* Update README.fr.md

* Update README.md
2021-09-01 17:58:06 +02:00
Laury
788e75eb4a Merge branch 'upsilon-dev' of https://github.com/Lauryy06/Upsilon into upsilon-dev 2021-09-01 17:53:01 +02:00
Laury
7b4a94296b [calculation][poincare] Revert 'b8544e3' and improve equal simplification 2021-09-01 17:31:51 +02:00
Lauryy06
86511cc59d Merge pull request #1 from ArtichOwO/FixMacSrc-StoreScript
[ion/mac] Added missing source
2021-09-01 17:20:53 +02:00
Laury
d90af0323e Merge omega-dev into upsilon dev 2021-08-31 23:03:30 +02:00
Laury
c0739b0e06 [atomic] updated submodule 2021-08-31 19:23:09 +02:00
Laury
210a83b04d [python/kandinsky] Added get_palette() function 2021-08-31 16:17:36 +02:00
Laury
fb4fc4862d [python] Enable operator overload 2021-08-31 15:48:11 +02:00
Laury
74c6bea8f8 Merge commit 'dc8a1d48d9e29fd2fc87ddd8075f6d7047a1aadb' into upsilon-master 2021-08-30 21:09:18 +02:00
Laury
7c1dc4d5c3 [python] merge '6fcab395' and fix a bug in fill_polygon() 2021-08-30 19:40:30 +02:00
ArtichOwO
eb02fb5baa [ion/mac] Added missing source 2021-07-14 19:52:32 +02:00
Laury
6fcab3952f [python] Add some useful functions in kandinsky 2021-07-08 22:34:43 +02:00
Maxime FRIESS
dc8a1d48d9 [escher] Remove unnecessary include 2021-07-06 16:23:28 +02:00
Laury
649f48919e [home] Added support for a wallpaper in a special format (.obm) 2021-07-06 14:54:55 +02:00
ArtichOwO
837fcd9bcc [MPY/MOD/ULAB] Added N100 compatibility
N100:
- doesn't have Scipy;
- uses function pointers
2021-06-23 23:08:46 +02:00
ArtichOwO
b0befbdbc5 [MPY/MOD] Added uLab 2021-06-23 22:40:41 +02:00
FaustinM
cf9142b5a2 Add "ion.battery()" for obtain the current voltage of the battery
Ion.battery() return a float with the current battery voltage

TODO : Update the translation of the toolbox (only FR and EN currently)
2021-06-23 16:57:42 +02:00
FaustinM
80587f35f1 Add a new entry in about menu to see current voltage
- Add a new traduction for this entry
- Add the entry in submenu
2021-06-23 16:55:37 +02:00
M4x1m3
6f797833b2 [omega] 1.22.1 2021-03-21 20:31:06 +01:00
Quentin Guidée
58ff19858f [omega] 1.22.0 2021-03-15 21:54:08 +01:00
Quentin Guidée
9eff895a95 [omega] 1.21.0 2021-02-24 22:25:36 +01:00
Quentin
f052ad7bf8 [.github/issue_template] New issue templates 2021-01-29 12:22:16 +01:00
Quentin Guidée
116cbf7df4 [.github/issue_template] Remove issue templates temporarily 2021-01-29 12:13:23 +01:00
Fournier Gabriel
890592854a fix for device 2020-12-13 22:13:33 +01:00
Fournier Gabriel
6c6f8b581c saving 2020-12-13 21:55:03 +01:00
Fournier Gabriel
92ee632ce2 word wrapping 2020-12-05 22:24:13 +01:00
Fournier Gabriel
3e2b5178ed word wrap - part 1 and 2 2020-11-21 19:29:46 +01:00
Fournier Gabriel
5b21c57e4c list files on simulator 2020-11-17 22:44:35 +01:00
Fournier Gabriel
76beed20da fix nb_Files limit 2020-11-17 00:04:15 +01:00
Fournier Gabriel
86985a4aef Merge branch 'main' of https://github.com/Gabriel79/OmegaWithReaderTutorial into main 2020-11-17 00:03:29 +01:00
Fournier Gabriel
aacd1a6f32 Lister des fichiers 2020-11-16 23:44:47 +01:00
Fournier Gabriel
dd258a7975 Lister des fichiers 2020-11-16 23:37:45 +01:00
Fournier Gabriel
b4e9ceed18 ListBookController - partie 2 2020-11-15 18:55:34 +01:00
Fournier Gabriel
c37b4bd1f4 ListBookController - partie 1 2020-11-14 13:39:11 +01:00
Gabriel
a0acdc171b Squelette 2020-11-13 00:48:46 +01:00
Quentin Guidée
46658f7077 [omega] 1.20.3 2020-08-26 14:17:23 +02:00
Quentin Guidée
0235de8010 [omega] 1.20.2 2020-07-23 18:23:30 +02:00
Quentin Guidée
636c5c1d24 Merge branch 'omega-hotfix' into omega-master 2020-07-23 18:23:11 +02:00
Quentin Guidée
4af76cc3ae [omega] 1.20.1 2020-07-21 22:32:19 +02:00
332 changed files with 18349 additions and 491 deletions

View File

@@ -1,14 +1,27 @@
--- ---
name: Bug report name: Bug report
about: Omega is not working like it should? Let us know! about: Upsilon is not working like it should? Let us know!
title: '' title: ''
labels: Bug, Triage labels: 'Status: Triage, Type: Bug'
assignees: '' assignees: ''
--- ---
#### Describe the bug **Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
#### Environment **Expected behavior**
- Omega Version: {go to settings > about > Omega Version and type the version here} A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
- Upsilon Version: [go to settings > about > Upsilon Version and type the version here]

View File

@@ -1 +0,0 @@
blank_issues_enabled: false

View File

@@ -1,10 +1,17 @@
--- ---
name: Feature request name: Feature request
about: Suggest an idea for an improvement of Omega about: Suggest an idea for Upsilon
title: '' title: ''
labels: Feature, Triage labels: 'Status: Triage, Type: Feature'
assignees: '' assignees: ''
--- ---
#### What I want to see in the next version of Omega **Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Additional context**
Add any other context or screenshots about the feature request here.

View File

@@ -1,8 +1,8 @@
--- ---
name: Other name: Other
about: A question? A problem? ... about: A question? A problem?
title: '' title: ''
labels: Triage labels: 'Status: Triage'
assignees: '' assignees: ''
--- ---

View File

@@ -1,19 +1,19 @@
--- ---
name: Problems during installation name: Problems during installation
about: Need help to install Omega? about: Need help to install Upsilon?
title: '' title: ''
labels: Installation issue, Triage labels: 'Status: Triage, Type: Installation issue'
assignees: '' assignees: ''
--- ---
#### Describe the problem **Describe the problem**
#### Logs **Logs**
``` ```
Copy/paste the logs here (If you have some) Copy/paste the logs here (If you have some)
``` ```
#### Environment **Environment**
- Omega Version: {go to settings > about > Omega Version and type the version here} - Upsilon Version: {go to settings > about > Upsilon Version and type the version here}

View File

@@ -140,7 +140,7 @@ jobs:
steps: steps:
- uses: numworks/setup-emscripten@v1 - uses: numworks/setup-emscripten@v1
with: with:
sdk: latest-upstream sdk: 1.40.1-fastcomp
- uses: actions/checkout@v2 - uses: actions/checkout@v2
with: with:
submodules: 'recursive' submodules: 'recursive'

View File

@@ -31,7 +31,6 @@ jobs:
- name: Add comment - name: Add comment
uses: actions/github-script@v3.0.0 uses: actions/github-script@v3.0.0
with: with:
github-token: ${{ secrets.OMEGA_ROBOT_TOKEN }}
script: | script: |
await github.issues.createComment({ await github.issues.createComment({
owner: context.repo.owner, owner: context.repo.owner,

2
.gitignore vendored
View File

@@ -6,3 +6,5 @@ epsilon.map
.vscode .vscode
.DS_Store .DS_Store
.gradle .gradle
.idea/
.vs

4
.gitmodules vendored
View File

@@ -1,6 +1,6 @@
[submodule "apps/rpn"] [submodule "apps/rpn"]
path = apps/rpn path = apps/rpn
url = https://github.com/Omega-Numworks/Omega-RPN.git url = https://github.com/Lauryy06/Upsilon-RPN.git
[submodule "apps/atomic"] [submodule "apps/atomic"]
path = apps/atomic path = apps/atomic
url = https://github.com/Omega-Numworks/Omega-Atomic.git url = https://github.com/Lauryy06/atomic

View File

@@ -12,6 +12,21 @@ include build/toolchain.$(TOOLCHAIN).mak
include build/variants.mak include build/variants.mak
include build/helpers.mk include build/helpers.mk
ifeq (${MODEL}, n0100)
ifeq ($(filter reader,$(apps_list)),)
$(warning reader app included, removing it on n0100. )
EPSILON_APPS := $(filter-out reader,$(EPSILON_APPS))
endif
ifneq ($(words $(EPSILON_I18N)), 1)
$(warning Only use 1 language on n0100, defaulting to en. )
EPSILON_I18N := en
endif
ifeq ($(INCLUDE_ULAB), 1)
$(warning Removing uLab on n0100. )
INCLUDE_ULAB := 0
endif
endif
ifeq (${MODEL}, n0110) ifeq (${MODEL}, n0110)
apps_list = ${EPSILON_APPS} apps_list = ${EPSILON_APPS}
else else
@@ -22,6 +37,10 @@ ifdef FORCE_EXTERNAL
apps_list = ${EPSILON_APPS} apps_list = ${EPSILON_APPS}
endif endif
ifeq ($(INCLUDE_ULAB), 1)
SFLAGS += -DINCLUDE_ULAB
endif
ifdef HOME_DISPLAY_EXTERNALS ifdef HOME_DISPLAY_EXTERNALS
ifneq ($(filter external,$(apps_list)),) ifneq ($(filter external,$(apps_list)),)
SFLAGS += -DHOME_DISPLAY_EXTERNALS SFLAGS += -DHOME_DISPLAY_EXTERNALS

View File

@@ -1,37 +1,34 @@
<p align="center"><img src="https://github.com/Omega-Numworks/Omega-Design/blob/master/Banners/Omega-Banner-Dev-Branch.png?raw=true" /></p> <p align="center"><img src="https://github.com/Laporte12974/UpsilonDesign/blob/89a15953ae128aef8aa7d066dcaaf8d5c70f02a5/UPSILogo.png" /></p>
<p align="center"> <p align="center">
<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/"><img alt="cc by-nc-sa 4.0" src="https://img.shields.io/badge/License-CC%20BY--NC--SA%204.0-525252.svg?labelColor=292929&logo=creative%20commons&style=for-the-badge" /></a> <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/"><img alt="cc by-nc-sa 4.0" src="https://img.shields.io/badge/License-CC%20BY--NC--SA%204.0-525252.svg?labelColor=292929&logo=creative%20commons&style=for-the-badge" /></a>
<a href="https://github.com/Omega-Numworks/Omega/issues"><img alt="Issues" src="https://img.shields.io/github/issues/Omega-Numworks/Omega.svg?labelColor=292929&logo=git&style=for-the-badge" /></a> <a href="https://github.com/Lauryy06/Upsilon/issues"><img alt="Issues" src="https://img.shields.io/github/issues/Lauryy06/Upsilon.svg?labelColor=292929&logo=git&style=for-the-badge" /></a>
<br/> <br/>
<a href="https://discord.gg/X2TWhh9"><img alt="Discord" src="https://img.shields.io/discord/663420259851567114?color=blue&labelColor=292929&label=chat%20-%20discord&logo=discord&style=for-the-badge" /></a> <a href="https://discord.gg/Q9buEMduXG"><img alt="Discord" src="https://img.shields.io/discord/663420259851567114?color=blue&labelColor=292929&label=chat%20-%20discord&logo=discord&style=for-the-badge" /></a>
</p> </p>
> Don't understand french ? speak english ? here's the [english README](./README.md) ! > Don't understand french ? speak english ? here's the [english README](./README.md) !
## À propos ## À propos
Omega est un fork d'Epsilon, l'OS de Numworks tournant sur les calculatrices du même nom, qui apporte beaucoup de fonctionnalités en plus. Omega est fait pour ceux qui aimeraient ajouter certaines fonctionnalités ayant été rejetées par Numworks à leurs calculatrices (pour des raisons 100% compréhensibles !). [Essayez en ligne](https://getomega.web.app/simulator). Upsilon est un fork d'Omega, un fork d'Epsilon, l'OS de Numworks tournant sur les calculatrices du même nom, qui apporte beaucoup de fonctionnalités en plus, mais qui fut archivé et fermé pour des raisons légales après un changement de politique de Numworks. Upsilon est fait pour ceux qui aimeraient voir un futur pour les OS créées par les utilisateurs pour Numworks, même après l'arrèt du projet initial.
### Quelques fonctionnalités supplémentaires ### Quelques fonctionnalités supplémentaires
- Retour du calcul littéral - Un module python kandinsky amélioré
- Une application RPN - Un support pour fonds d'écrans personnalisés
- Application Externes - Des applications externes
- Des thèmes - Un thème Upsilon
- Python amélioré (module os, méthode open...) - La surcharge des opérateurs en python
- Un tableau périodique et toutes les masses molaires des éléments dans la toolbox - Un tableau périodique légèrement amélioré
- *Ainsi que d'autres à découvrir...* [Changelogs complets](https://github.com/Omega-Numworks/Omega/wiki/Changelog) | [Fonctionnalités princpales & captures d'écran](https://github.com/Omega-Numworks/Omega/wiki/Main-features). - L'utilisation possible du signe "=" dans les calculs
- *Ainsi que tout ce qui a été ajouté sur Omega, et bien plus...* [Changelogs complets d'Omega](https://github.com/Omega-Numworks/Omega/wiki/Changelog) | [Fonctionnalités principales d'Omega & captures d'écran](https://github.com/Omega-Numworks/Omega/wiki/Main-features).
## Installation ## Installation
### Automatique
Vous pouvez installer Omega automatiquement depuis [notre site](https://getomega.web.app/) sur la page "installer".
<a href="https://getomega.web.app"><p align="center"><img alt="Omega Banner Discord" src="https://user-images.githubusercontent.com/12123721/86352956-e9000480-bc66-11ea-82b7-79fd7e56fa27.png" /></p></a>
### Manuelle ### Manuelle
*A l'heure actuelle, seule l'installation manuelle est possible.*
Tout d'abord, suivez **la première étape** [ici](https://www.numworks.com/resources/engineering/software/build/), puis : Tout d'abord, suivez **la première étape** [ici](https://www.numworks.com/resources/engineering/software/build/), puis :
<details> <details>
@@ -40,15 +37,15 @@ Tout d'abord, suivez **la première étape** [ici](https://www.numworks.com/reso
(note : vous pouvez changer `EPSILON_I18N=fr` en `en`, `nl`, `pt`, `it`, `de`, `es` ou `hu`). (note : vous pouvez changer `EPSILON_I18N=fr` en `en`, `nl`, `pt`, `it`, `de`, `es` ou `hu`).
```bash ```bash
git clone --recursive https://github.com/Omega-Numworks/Omega.git git clone --recursive https://github.com/Lauryy06/Upsilon.git
cd Omega cd Upsilon
git checkout omega-master git checkout omega-master
make MODEL=n0100 clean make MODEL=n0100 clean
make MODEL=n0100 EPSILON_I18N=fr OMEGA_USERNAME="{Votre nom ici, 15 caractères max}" -j4 make MODEL=n0100 EPSILON_I18N=fr OMEGA_USERNAME="{Votre nom ici, 15 caractères max}" -j4
make MODEL=n0100 epsilon_flash make MODEL=n0100 epsilon_flash
``` ```
Important : N'oubliez pas l'argument `--recursive`, Omega a besoin de sous-modules. Important : N'oubliez pas l'argument `--recursive`, Upsilon a besoin de sous-modules.
Vous pouvez aussi changer le nombre de processus parallèles pendant la compilation en changeant la valeur suivant `-j`. Vous pouvez aussi changer le nombre de processus parallèles pendant la compilation en changeant la valeur suivant `-j`.
</details> </details>
@@ -57,15 +54,15 @@ Vous pouvez aussi changer le nombre de processus parallèles pendant la compilat
<summary><b>Modèle n0110</b></summary> <summary><b>Modèle n0110</b></summary>
```bash ```bash
git clone --recursive https://github.com/Omega-Numworks/Omega.git git clone --recursive https://github.com/Lauryy06/Upsilon.git
cd Omega cd Upsilon
git checkout omega-master git checkout omega-master
make clean make clean
make OMEGA_USERNAME="{Votre nom ici, 15 caractères max}" -j4 make OMEGA_USERNAME="{Votre nom ici, 15 caractères max}" -j4
make epsilon_flash make epsilon_flash
``` ```
Important : N'oubliez pas l'argument `--recursive`, Omega a besoin de sous-modules. Important : N'oubliez pas l'argument `--recursive`, Upsilon a besoin de sous-modules.
Vous pouvez aussi changer le nombre de processus parallèles pendant la compilation en changeant la valeur suivant `-j`. Vous pouvez aussi changer le nombre de processus parallèles pendant la compilation en changeant la valeur suivant `-j`.
</details> </details>
@@ -73,11 +70,11 @@ Vous pouvez aussi changer le nombre de processus parallèles pendant la compilat
<details> <details>
<summary><b>Fichiers binaires</b></summary> <summary><b>Fichiers binaires</b></summary>
Ces fichiers peuvent être utilisés pour distribuer Omega (pour que tout le monde puisse le flasher via [Webdfu_Numworks](https://ti-planet.github.io/webdfu_numworks/)). Ces fichiers peuvent être utilisés pour distribuer Upsilon (pour que tout le monde puisse le flasher via [Webdfu_Numworks](https://ti-planet.github.io/webdfu_numworks/)).
```bash ```bash
git clone --recursive https://github.com/Omega-Numworks/Omega.git git clone --recursive https://github.com/Lauryy06/Upsilon.git
cd Omega cd Upsilon
git checkout omega-master git checkout omega-master
make clean make clean
make MODEL=n0100 OMEGA_USERNAME="" -j8 make MODEL=n0100 OMEGA_USERNAME="" -j8
@@ -86,7 +83,7 @@ make OMEGA_USERNAME="" -j8
make OMEGA_USERNAME="" binpack -j8 make OMEGA_USERNAME="" binpack -j8
``` ```
Important : N'oubliez pas l'argument `--recursive`, Omega a besoin de sous-modules. Important : N'oubliez pas l'argument `--recursive`, Upsilon a besoin de sous-modules.
Vous pouvez aussi changer le nombre de processus parallèles pendant la compilation en changeant la valeur suivant `-j`. Vous pouvez aussi changer le nombre de processus parallèles pendant la compilation en changeant la valeur suivant `-j`.
</details> </details>
@@ -104,11 +101,11 @@ cd emsdk
source emsdk_env.sh source emsdk_env.sh
``` ```
Puis, compilez Omega : Puis, compilez Upsilon :
```bash ```bash
git clone --recursive https://github.com/Omega-Numworks/Omega.git git clone --recursive https://github.com/Lauryy06/Upsilon.git
cd Omega cd Upsilon
git checkout omega-master git checkout omega-master
make clean make clean
make PLATFORM=simulator TARGET=web OMEGA_USERNAME="{Votre nom ici, 15 caractères max}" -j4 make PLATFORM=simulator TARGET=web OMEGA_USERNAME="{Votre nom ici, 15 caractères max}" -j4
@@ -116,7 +113,7 @@ make PLATFORM=simulator TARGET=web OMEGA_USERNAME="{Votre nom ici, 15 caractère
Le simulateur se trouve dans `output/release/simulator/web/simulator.zip` Le simulateur se trouve dans `output/release/simulator/web/simulator.zip`
Important : N'oubliez pas l'argument `--recursive`, Omega a besoin de sous-modules. Important : N'oubliez pas l'argument `--recursive`, Upsilon a besoin de sous-modules.
Vous pouvez aussi changer le nombre de processus parallèles pendant la compilation en changeant la valeur suivant `-j`. Vous pouvez aussi changer le nombre de processus parallèles pendant la compilation en changeant la valeur suivant `-j`.
</details> </details>
@@ -127,9 +124,9 @@ Vous pouvez aussi changer le nombre de processus parallèles pendant la compilat
Vous aurez besoin de devkitPro et de devkitARM disponible dans votre `$PATH` (instructions [ici](https://devkitpro.org/wiki/Getting_Started) (en anglais)) Vous aurez besoin de devkitPro et de devkitARM disponible dans votre `$PATH` (instructions [ici](https://devkitpro.org/wiki/Getting_Started) (en anglais))
```bash ```bash
git clone --recursive https://github.com/Omega-Numworks/Omega.git git clone --recursive https://github.com/Lauryy06/Upsilon.git
cd Omega cd Upsilon
git checkout --recursive omega-dev git checkout --recursive upsilon-dev
make PLATFORM=simulator TARGET=3ds -j make PLATFORM=simulator TARGET=3ds -j
``` ```
@@ -141,16 +138,22 @@ Vous pouvez ensuite copier epsilon.3dsx sur une carte SD pour l'exécuter depuis
</details> </details>
Si vous avez besoin d'aide, n'hésitez pas à rejoindre notre serveur discord : https://discord.gg/X2TWhh9 Si vous avez besoin d'aide, n'hésitez pas à rejoindre notre serveur discord : https://discord.gg/Q9buEMduXG
<a href="https://discord.gg/X2TWhh9"><p align="center"><img alt="Omega Banner Discord" src="https://user-images.githubusercontent.com/12123721/86287349-54ef5800-bbe8-11ea-80c1-34eb1f93eebd.png" /></p></a> <a href="https://discord.gg/Q9buEMduXG"><p align="center"><img alt="Omega Banner Discord" src="https://user-images.githubusercontent.com/12123721/86287349-54ef5800-bbe8-11ea-80c1-34eb1f93eebd.png" /></p></a>
--- ---
## Liens utiles
* [Upsilon external (pour installer des applications supplémentaires et des fonds d'écran)](https://lauryy06.github.io/Upsilon-External/)
* [Documentation d'ulab](https://micropython-ulab.readthedocs.io/en/latest/)
## Contribution ## Contribution
Pour contribuer, merci de lire le [Wiki](https://github.com/Omega-Numworks/Omega/wiki/Contributing) Pour contribuer, merci de lire le [Wiki d'Omega](https://github.com/Omega-Numworks/Omega/wiki/Contributing), les mêmes règles s'appliquent ici.
## Nos autres projets ## Les autres projets
Les anciens projets d'Omega, avant sa fermeture, qui ont été utilisés pour ce projet
* [Omega Themes](https://github.com/Omega-Numworks/Omega-Themes) * [Omega Themes](https://github.com/Omega-Numworks/Omega-Themes)
* [Omega Website](https://github.com/Omega-Numworks/Omega-Website) * [Omega Website](https://github.com/Omega-Numworks/Omega-Website)
@@ -163,6 +166,8 @@ Pour contribuer, merci de lire le [Wiki](https://github.com/Omega-Numworks/Omega
## À propos d'Epsilon ## À propos d'Epsilon
Upsilon est un fork d'Omega, visant a continuer le projet des OS utilisateurs pour Numworks
Omega est un fork d'Epsilon, un système d'exploitation performant pour calculatrices graphiques. Il inclut huit applications pour les mathématiques de lycée et d'études supérieurs Omega est un fork d'Epsilon, un système d'exploitation performant pour calculatrices graphiques. Il inclut huit applications pour les mathématiques de lycée et d'études supérieurs
Vous pouvez essayer Epsilon depuis votre navigateur sur le [simulateur en ligne](https://www.numworks.com/simulator/). Vous pouvez essayer Epsilon depuis votre navigateur sur le [simulateur en ligne](https://www.numworks.com/simulator/).
@@ -175,3 +180,4 @@ NumWorks SAS et Nintendo of America Inc ne sont en aucun cas associés avec ce p
* NumWorks Epsilon est disponible sous [Lisense CC BY-NC-SA](https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode). * NumWorks Epsilon est disponible sous [Lisense CC BY-NC-SA](https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode).
* Omega est disponible sous [Lisense CC BY-NC-SA](https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode). * Omega est disponible sous [Lisense CC BY-NC-SA](https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode).
* Upsilon est disponible sous [Lisense CC BY-NC-SA](https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode).

249
README.md
View File

@@ -1,38 +1,156 @@
<p align="center"><img src="https://github.com/Omega-Numworks/Omega-Design/blob/master/Banners/Omega-Banner-Dev-Branch.png?raw=true" /></p> <p align="center"><img src="https://github.com/Laporte12974/UpsilonDesign/blob/89a15953ae128aef8aa7d066dcaaf8d5c70f02a5/UPSILogo.png" /></p>
<p align="center"> <p align="center">
<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/"><img alt="cc by-nc-sa 4.0" src="https://img.shields.io/badge/License-CC%20BY--NC--SA%204.0-525252.svg?labelColor=292929&logo=creative%20commons&style=for-the-badge" /></a> <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/"><img alt="cc by-nc-sa 4.0" src="https://img.shields.io/badge/License-CC%20BY--NC--SA%204.0-525252.svg?labelColor=292929&logo=creative%20commons&style=for-the-badge" /></a>
<a href="https://github.com/Omega-Numworks/Omega/issues"><img alt="Issues" src="https://img.shields.io/github/issues/Omega-Numworks/Omega.svg?labelColor=292929&logo=git&style=for-the-badge" /></a> <a href="https://github.com/Lauryy06/Upsilon/issues"><img alt="Issues" src="https://img.shields.io/github/issues/Lauryy06/Upsilon.svg?labelColor=292929&logo=git&style=for-the-badge" /></a>
<br/> <br/>
<a href="https://discord.gg/X2TWhh9"><img alt="Discord" src="https://img.shields.io/discord/663420259851567114?color=blue&labelColor=292929&label=chat%20-%20discord&logo=discord&style=for-the-badge" /></a> <a href="https://discord.gg/Q9buEMduXG"><img alt="Discord" src="https://img.shields.io/discord/663420259851567114?color=blue&labelColor=292929&label=chat%20-%20discord&logo=discord&style=for-the-badge" /></a>
</p> </p>
> Vous ne comprenez pas l'anglais ? vous êtes francophone ? Regardez le [*LISEZ-MOI* français](./README.fr.md) ! > Vous ne comprenez pas l'anglais ? Vous êtes francophone ? Regardez le [*LISEZ-MOI* français](./README.fr.md) !
## About ## About
Omega is a fork of Numworks' Epsilon, the OS that runs on their calculator, which brings many features to it. Omega is for the people who want to add features to the calculator, but cannot because they have been rejected by Numworks (for reasons that are 100% understandable!). [Try it online](https://getomega.web.app/simulator). Upsilon is a fork of Omega, an user-made OS that runs on the Numworks calculator, which brings many features to it, but was discontinued because of a policy change from Numworks. Upsilon is for the people who want to see a future for user-made OSes for Numworks, even after the closure and archiving of Omega.
### Some new features ### Some new features
- Adding symbolic calculation back into the calculator - Enhancements for the Kandinsky python module
- An app for RPN - Support for wallpapers
- Exernal apps - Exernal apps
- A theme engine - A custom theme
- New python features (os module, open method...) - Operator overload for python
- A periodic table app + all of the molar masses for the elements in the toolbox - Improvements for the Periodic table application
- *And much more to discover...* [Complete changelog](https://github.com/Omega-Numworks/Omega/wiki/Changelog) | [Main new features + screenshots](https://github.com/Omega-Numworks/Omega/wiki/Main-features). - *And everything that has been added to Omega before its termination!* [See Omega's changelog here](https://github.com/Omega-Numworks/Omega/wiki/Changelog) | [Main Omega features + screenshots](https://github.com/Omega-Numworks/Omega/wiki/Main-features).
<br>
## Installation ## Installation
### Automatic
You can install Omega automatically on our website [here](https://getomega.web.app/) in the "install" page.
<a href="https://getomega.web.app"><p align="center"><img alt="Omega Banner Discord" src="https://user-images.githubusercontent.com/12123721/86352956-e9000480-bc66-11ea-82b7-79fd7e56fa27.png" /></p></a>
### Manual ### Manual
First of all, follow **step 1** [here](https://www.numworks.com/resources/engineering/software/build/). Then: *As of today, only the manual installation is available. You can refer to this [website](https://www.numworks.com/resources/engineering/software/build/) for the first step if you get errors.*
### 1. Install SDK
<br>
<details>
<summary><b>1.1 Linux</b></summary>
<br>
<details>
<summary>Debian or Ubuntu</summary>
<br>
You just have to install dependencies by running these command with superuser privileges in a Terminal:
```bash
apt-get install build-essential git imagemagick libx11-dev libxext-dev libfreetype6-dev libpng-dev libjpeg-dev pkg-config gcc-arm-none-eabi binutils-arm-none-eabi
```
And there you can go to step 2!
<br>
</details>
<details>
<summary>Fedora</summary>
<br>
First install basics dev tools.
```bash
dnf install make automake gcc gcc-c++ kernel-devel
```
Then install required packages.
```bash
dnf install git ImageMagick libX11-devel libXext-devel freetype-devel libpng-devel libjpeg-devel pkg-config
```
Then, install GCC cross compiler for ARM.
```bash
dnf install arm-none-eabi-gcc-cs arm-none-eabi-gcc-cs-c++
```
<br>
</details>
<br>
</details>
<details>
<summary><b>1.2 Mac</b></summary>
<br>
It's recommended to use [Homebrew](https://brew.sh/). Once it's installed, just run:
```bash
brew install numworks/tap/epsilon-sdk
```
and it will install all dependencies.
<br>
And there you can go to step 2!
<br>
</details>
<details>
<summary><b>1.3 Windows</b></summary>
<br>
[Msys2](https://www.msys2.org/) environment is recommended to get most of the required tools on Windows easily. It's where you'll paste all the commands of this tutorial. Once it's installed, paste these commands into the Msys2 terminal.
```bash
pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-freetype mingw-w64-x86_64-pkg-config mingw-w64-x86_64-libusb git make python
echo "export PATH=/mingw64/bin:$PATH" >> .bashrc
```
Next, you'll need to install the [GCC toolchain for ARM](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads). When prompted for an install location, choose `C:\msys64\home\User\gcc-arm\`. You'll then need to add this folder to your $PATH. Just enter:
```bash
echo "export PATH=$PATH:$HOME/gcc-arm/bin" >> .bashrc
```
Just restart and you can go to step 2!
</details>
<br>
### 2. Set up repo
Clone repo and use 'upsilon-dev' branch by pasting these two commands:
```bash
git clone --recursive https://github.com/Lauryy06/Upsilon.git
cd Upsilon
git checkout upsilon-dev
```
<br>
### 3. Choose the target
<details> <details>
<summary><b>Model n0100</b></summary> <summary><b>Model n0100</b></summary>
@@ -40,55 +158,53 @@ First of all, follow **step 1** [here](https://www.numworks.com/resources/engine
(note: you can change the `EPSILON_I18N=en` flag to `fr`, `nl`, `pt`, `it`, `de`, `es` or `hu`). (note: you can change the `EPSILON_I18N=en` flag to `fr`, `nl`, `pt`, `it`, `de`, `es` or `hu`).
```bash ```bash
git clone --recursive https://github.com/Omega-Numworks/Omega.git
cd Omega
git checkout omega-master
make MODEL=n0100 clean make MODEL=n0100 clean
make MODEL=n0100 EPSILON_I18N=en OMEGA_USERNAME="{Your name, max 15 characters}" -j4 make MODEL=n0100 EPSILON_I18N=en OMEGA_USERNAME="{Your name, max 15 characters}" -j4
make MODEL=n0100 epsilon_flash
``` ```
Important: Don't forget the `--recursive` tag, because Omega relies on submodules. Now, run either:
Also, you can change the number of processes that run in parallel during the build by changing the value of the `-j` flag.
```bash
make MODEL=n0100 epsilon_flash
```
to directly flash the calculator after pressing simultaneously `reset` and `6` buttons and pluging in.
<br>
or:
```bash
make MODEL=n0100 OMEGA_USERNAME="" binpack -j4
```
to make binpack wich you can flash to the caculator from [Ti-planet's webDFU](https://ti-planet.github.io/webdfu_numworks/n0100/). Binpacks are a great way to share a custom build of Upsilon to friends.
</details> </details>
<details> <details>
<summary><b>Model n0110</b></summary> <summary><b>Model n0110</b></summary>
```bash ```bash
git clone --recursive https://github.com/Omega-Numworks/Omega.git
cd Omega
git checkout omega-master
make clean make clean
make OMEGA_USERNAME="{Your name, max 15 characters}" -j4 make OMEGA_USERNAME="{Your name, max 15 characters}" -j4
make epsilon_flash
``` ```
Important: Don't forget the `--recursive` tag, because Omega relies on submodules. Now, run either:
Also, you can change the number of processes that run in parallel during the build by changing the value of the `-j` flag.
</details>
<details>
<summary><b>Bin files</b></summary>
These can be used to distribute Omega (so that it can be flashed by anyone with [Webdfu_Numworks](https://ti-planet.github.io/webdfu_numworks/)).
```bash ```bash
git clone --recursive https://github.com/Omega-Numworks/Omega.git make epsilon_flash
cd Omega
git checkout omega-master
make clean
make MODEL=n0100 OMEGA_USERNAME="" -j8
make MODEL=n0100 OMEGA_USERNAME="" binpack -j8
make OMEGA_USERNAME="" -j8
make OMEGA_USERNAME="" binpack -j8
``` ```
to directly flash the calculator after pressing simultaneously `reset` and `6` buttons and pluging in.
<br>
or:
```bash
make OMEGA_USERNAME="" binpack -j4
```
to make binpack wich you can flash to the caculator from [Ti-planet's webDFU](https://ti-planet.github.io/webdfu_numworks/n0110/). Binpacks are a great way to share a custom build of Upsilon to friends.
Important: Don't forget the `--recursive` tag, because Omega relies on submodules.
Also, you can change the number of processes that run in parallel during the build by changing the value of the `-j` flag.
</details> </details>
<details> <details>
@@ -104,20 +220,15 @@ cd emsdk
source emsdk_env.sh source emsdk_env.sh
``` ```
Then, compile Omega : Then, compile Upsilon :
```bash ```bash
git clone --recursive https://github.com/Omega-Numworks/Omega.git
cd Omega
git checkout omega-master
make clean make clean
make PLATFORM=simulator TARGET=web OMEGA_USERNAME="{Your name, max 15 characters}" -j4 make PLATFORM=simulator TARGET=web OMEGA_USERNAME="{Your name, max 15 characters}" -j4
``` ```
The simulator is now in `output/release/simulator/web/simulator.zip` The simulator is now in `output/release/simulator/web/simulator.zip`
Important: Don't forget the `--recursive` tag, because Omega relies on submodules.
Also, you can change the number of processes that run in parallel during the build by changing the value of the `-j` flag.
</details> </details>
@@ -127,9 +238,9 @@ Also, you can change the number of processes that run in parallel during the bui
You need devkitPro and devkitARM installed and in your path (instructions [here](https://devkitpro.org/wiki/Getting_Started)) You need devkitPro and devkitARM installed and in your path (instructions [here](https://devkitpro.org/wiki/Getting_Started))
```bash ```bash
git clone --recursive https://github.com/Omega-Numworks/Omega.git git clone --recursive https://github.com/Lauryy06/Upsilon.git
cd Omega cd Upsilon
git checkout --recursive omega-dev git checkout --recursive upsilon-dev
make PLATFORM=simulator TARGET=3ds -j make PLATFORM=simulator TARGET=3ds -j
``` ```
You can then put epsilon.3dsx on a SD card to run it from the HBC or use 3dslink to launch it over the network: You can then put epsilon.3dsx on a SD card to run it from the HBC or use 3dslink to launch it over the network:
@@ -140,17 +251,30 @@ You can then put epsilon.3dsx on a SD card to run it from the HBC or use 3dslink
</details> </details>
If you need help, you can join our Discord server here : https://discord.gg/X2TWhh9 <br>
<a href="https://discord.gg/X2TWhh9"><p align="center"><img alt="Omega Banner Discord" src="https://user-images.githubusercontent.com/12123721/86287349-54ef5800-bbe8-11ea-80c1-34eb1f93eebd.png" /></p></a> Important: Don't forget the `--recursive` tag, because Upsilon relies on submodules.
Also, you can change the number of processes that run in parallel during the build by changing the value of the `-j` flag.
Don't forget to put your pseudo instead of `{your pseudo, max 15 char}`. If you don't want one, just remove the `OMEGA_USERNAME=""` argument.
<br>
If you need help, you can join our Discord server here : https://discord.gg/NFvzdCBTQn
<a href="https://discord.gg/NFvzdCBTQn"><p align="center"><img alt="Omega Banner Discord" src="https://user-images.githubusercontent.com/12123721/86287349-54ef5800-bbe8-11ea-80c1-34eb1f93eebd.png" /></p></a>
--- ---
## Useful links
* [Upsilon external (to install additional apps and wallpapers)](https://lauryy06.github.io/Upsilon-External/)
* [Ulab documentation](https://micropython-ulab.readthedocs.io/en/latest/)
## Contributing ## Contributing
To contribute, please refer to the [Wiki](https://github.com/Omega-Numworks/Omega/wiki/Contributing) To contribute, please refer to [Omega's Wiki](https://github.com/Omega-Numworks/Omega/wiki/Contributing), the same rules apply here.
## Related repositories ## Related repositories
Here are the main links toward Omega's different websites and repositories, that have been used for the creation of Upsilon.
* [Omega Themes](https://github.com/Omega-Numworks/Omega-Themes) * [Omega Themes](https://github.com/Omega-Numworks/Omega-Themes)
* [Omega Website](https://github.com/Omega-Numworks/Omega-Website) * [Omega Website](https://github.com/Omega-Numworks/Omega-Website)
* [Omega RPN `APP`](https://github.com/Omega-Numworks/Omega-RPN) * [Omega RPN `APP`](https://github.com/Omega-Numworks/Omega-RPN)
@@ -162,6 +286,8 @@ To contribute, please refer to the [Wiki](https://github.com/Omega-Numworks/Omeg
## About Epsilon ## About Epsilon
Upsilon is a fork of Omega, after the project's discontinuation.
Omega is a fork of Epsilon, a high-performance graphing calculator operating system. It includes eight apps that cover the high school mathematics curriculum. Omega is a fork of Epsilon, a high-performance graphing calculator operating system. It includes eight apps that cover the high school mathematics curriculum.
You can try Epsilon straight from your browser in the [online simulator](https://www.numworks.com/simulator/). You can try Epsilon straight from your browser in the [online simulator](https://www.numworks.com/simulator/).
@@ -174,3 +300,4 @@ NumWorks SAS and Nintendo of America Inc aren't associated in any shape or form
* NumWorks Epsilon is released under a [CC BY-NC-SA License](https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode). * NumWorks Epsilon is released under a [CC BY-NC-SA License](https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode).
* Omega is released under a [CC BY-NC-SA License](https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode). * Omega is released under a [CC BY-NC-SA License](https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode).
* Upsilon is released under a [CC BY-NC-SA License](https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode).

View File

@@ -29,7 +29,7 @@ AppsContainer::AppsContainer() :
m_globalContext(), m_globalContext(),
m_variableBoxController(), m_variableBoxController(),
m_examPopUpController(this), m_examPopUpController(this),
m_promptController(k_promptMessages, k_promptColors, k_promptNumberOfMessages), m_promptController(k_promptMessages, k_promptFGColors, k_promptBGColors, k_promptNumberOfMessages),
m_batteryTimer(), m_batteryTimer(),
m_suspendTimer(), m_suspendTimer(),
m_backlightDimmingTimer(), m_backlightDimmingTimer(),

View File

@@ -66,7 +66,8 @@ private:
bool updateAlphaLock(); bool updateAlphaLock();
static I18n::Message k_promptMessages[]; static I18n::Message k_promptMessages[];
static KDColor k_promptColors[]; static KDColor k_promptFGColors[];
static KDColor k_promptBGColors[];
static int k_promptNumberOfMessages; static int k_promptNumberOfMessages;
AppsWindow m_window; AppsWindow m_window;
EmptyBatteryWindow m_emptyBatteryWindow; EmptyBatteryWindow m_emptyBatteryWindow;

View File

@@ -10,7 +10,7 @@ I18n::Message AppsContainer::k_promptMessages[] = {
I18n::Message::BetaVersionMessage5, I18n::Message::BetaVersionMessage5,
I18n::Message::BetaVersionMessage6}; I18n::Message::BetaVersionMessage6};
KDColor AppsContainer::k_promptColors[] = { KDColor AppsContainer::k_promptFGColors[] = {
KDColorBlack, KDColorBlack,
KDColorBlack, KDColorBlack,
KDColorBlack, KDColorBlack,
@@ -20,4 +20,14 @@ KDColor AppsContainer::k_promptColors[] = {
KDColorBlack, KDColorBlack,
Palette::AccentText}; Palette::AccentText};
KDColor AppsContainer::k_promptBGColors[] = {
KDColorWhite,
KDColorWhite,
KDColorWhite,
KDColorWhite,
KDColorWhite,
KDColorWhite,
KDColorWhite,
KDColorWhite};
int AppsContainer::k_promptNumberOfMessages = 8; int AppsContainer::k_promptNumberOfMessages = 8;

View File

@@ -2,7 +2,8 @@
I18n::Message AppsContainer::k_promptMessages[] = {}; I18n::Message AppsContainer::k_promptMessages[] = {};
KDColor AppsContainer::k_promptColors[] = {}; KDColor AppsContainer::k_promptFGColors[] = {};
KDColor AppsContainer::k_promptBGColors[] = {};
int AppsContainer::k_promptNumberOfMessages = 0; int AppsContainer::k_promptNumberOfMessages = 0;

View File

@@ -8,7 +8,7 @@ I18n::Message AppsContainer::k_promptMessages[] = {
I18n::Message::UpdateMessage3, I18n::Message::UpdateMessage3,
I18n::Message::UpdateMessage4}; I18n::Message::UpdateMessage4};
KDColor AppsContainer::k_promptColors[] = { KDColor AppsContainer::k_promptFGColors[] = {
KDColorBlack, KDColorBlack,
KDColorBlack, KDColorBlack,
KDColorBlack, KDColorBlack,
@@ -16,4 +16,12 @@ KDColor AppsContainer::k_promptColors[] = {
KDColorBlack, KDColorBlack,
Palette::AccentText}; Palette::AccentText};
KDColor AppsContainer::k_promptBGColors[] = {
KDColorWhite,
KDColorWhite,
KDColorWhite,
KDColorBlack,
KDColorWhite,
KDColorBlack};
int AppsContainer::k_promptNumberOfMessages = 6; int AppsContainer::k_promptNumberOfMessages = 6;

View File

@@ -75,13 +75,13 @@ void BatteryView::drawRect(KDContext * ctx, KDRect rect) const {
assert(!m_isPlugged); assert(!m_isPlugged);
// Low: Quite empty battery // Low: Quite empty battery
ctx->fillRect(KDRect(batteryInsideX, 0, 2*k_elementWidth, k_batteryHeight), Palette::BatteryLow); ctx->fillRect(KDRect(batteryInsideX, 0, 2*k_elementWidth, k_batteryHeight), Palette::BatteryLow);
ctx->fillRect(KDRect(3*k_elementWidth+k_separatorThickness, 0, k_batteryWidth-5*k_elementWidth-2*k_separatorThickness, k_batteryHeight), Palette::BatteryInCharge); ctx->fillRect(KDRect(3*k_elementWidth+k_separatorThickness, 0, k_batteryWidth-5*k_elementWidth-2*k_separatorThickness, k_batteryHeight), KDColor::blend(Palette::Toolbar, Palette::Battery, 128));
} else if (m_chargeState == Ion::Battery::Charge::SOMEWHERE_INBETWEEN) { } else if (m_chargeState == Ion::Battery::Charge::SOMEWHERE_INBETWEEN) {
assert(!m_isPlugged); assert(!m_isPlugged);
// Middle: Half full battery // Middle: Half full battery
constexpr KDCoordinate middleChargeWidth = batteryInsideWidth/2; constexpr KDCoordinate middleChargeWidth = batteryInsideWidth/2;
ctx->fillRect(KDRect(batteryInsideX, 0, middleChargeWidth, k_batteryHeight), Palette::Battery); ctx->fillRect(KDRect(batteryInsideX, 0, middleChargeWidth, k_batteryHeight), Palette::Battery);
ctx->fillRect(KDRect(batteryInsideX+middleChargeWidth, 0, middleChargeWidth, k_batteryHeight), Palette::BatteryInCharge); ctx->fillRect(KDRect(batteryInsideX+middleChargeWidth, 0, middleChargeWidth, k_batteryHeight), KDColor::blend(Palette::Toolbar, Palette::Battery, 128));
} else { } else {
assert(m_chargeState == Ion::Battery::Charge::FULL); assert(m_chargeState == Ion::Battery::Charge::FULL);
// Full but not plugged: Full battery // Full but not plugged: Full battery

View File

@@ -19,6 +19,7 @@ app_calculation_src = $(addprefix apps/calculation/,\
additional_outputs/list_controller.cpp \ additional_outputs/list_controller.cpp \
additional_outputs/matrix_list_controller.cpp \ additional_outputs/matrix_list_controller.cpp \
additional_outputs/rational_list_controller.cpp \ additional_outputs/rational_list_controller.cpp \
additional_outputs/second_degree_list_controller.cpp \
additional_outputs/trigonometry_graph_cell.cpp \ additional_outputs/trigonometry_graph_cell.cpp \
additional_outputs/trigonometry_list_controller.cpp \ additional_outputs/trigonometry_list_controller.cpp \
additional_outputs/trigonometry_model.cpp \ additional_outputs/trigonometry_model.cpp \

View File

@@ -0,0 +1,312 @@
#include "../app.h"
#include <apps/global_preferences.h>
#include "../../shared/poincare_helpers.h"
#include <poincare/layout_helper.h>
#include <poincare/code_point_layout.h>
#include <poincare/rational.h>
#include <poincare/opposite.h>
#include <poincare/addition.h>
#include <poincare/parenthesis.h>
#include <poincare/equal.h>
#include <poincare/subtraction.h>
#include <poincare/multiplication.h>
#include <poincare/division.h>
#include <poincare/square_root.h>
#include <poincare/symbol.h>
#include <poincare/power.h>
#include "second_degree_list_controller.h"
using namespace Poincare;
using namespace Shared;
namespace Calculation {
void SecondDegreeListController::setExpression(Poincare::Expression e) {
ExpressionsListController::setExpression(e);
assert(!m_expression.isUninitialized());
Expression polynomialCoefficients[Expression::k_maxNumberOfPolynomialCoefficients];
Context * context = App::app()->localContext();
Preferences * preferences = Preferences::sharedPreferences();
Poincare::ExpressionNode::ReductionContext reductionContext = Poincare::ExpressionNode::ReductionContext(context,
preferences->complexFormat(), preferences->angleUnit(),
GlobalPreferences::sharedGlobalPreferences()->unitFormat(),
ExpressionNode::ReductionTarget::SystemForApproximation,
ExpressionNode::SymbolicComputation::ReplaceAllDefinedSymbolsWithDefinition,
Poincare::ExpressionNode::UnitConversion::Default);
PoincareHelpers::Reduce(&m_expression, context, ExpressionNode::ReductionTarget::SystemForAnalysis);
int degree = m_expression.getPolynomialReducedCoefficients(
"x",
polynomialCoefficients,
context,
Expression::UpdatedComplexFormatWithExpressionInput(preferences->complexFormat(), m_expression, context),
preferences->angleUnit(),
GlobalPreferences::sharedGlobalPreferences()->unitFormat(),
ExpressionNode::SymbolicComputation::ReplaceAllDefinedSymbolsWithDefinition);
assert(degree == 2);
Expression a = polynomialCoefficients[2];
Expression b = polynomialCoefficients[1];
Expression c = polynomialCoefficients[0];
Expression delta = Subtraction::Builder(Power::Builder(b.clone(), Rational::Builder(2)), Multiplication::Builder(Rational::Builder(4), a.clone(), c.clone()));
PoincareHelpers::Simplify(&delta, context, ExpressionNode::ReductionTarget::SystemForApproximation);
// Alpha is -b/2a, but because after we use -α, we immediately store -α=-(-b/2a)=b/2a.
Expression minusAlpha = Division::Builder(b.clone(), Multiplication::Builder(Rational::Builder(2), a.clone()));
PoincareHelpers::Reduce(&minusAlpha, context, ExpressionNode::ReductionTarget::SystemForApproximation);
// Same thing for β
Expression minusBeta = Division::Builder(delta.clone(), Multiplication::Builder(Rational::Builder(4), a.clone()));
PoincareHelpers::Reduce(&minusBeta, context, ExpressionNode::ReductionTarget::SystemForApproximation);
enum MultiplicationTypeForA {
Nothing,
Minus,
Parenthesis,
Normal
};
MultiplicationTypeForA multiplicationTypeForA;
if (a.type() == ExpressionNode::Type::Rational && static_cast<const Rational &>(a).isOne()) {
multiplicationTypeForA = MultiplicationTypeForA::Nothing;
}
else if(a.type() == ExpressionNode::Type::Rational && static_cast<const Rational &>(a).isMinusOne()){
multiplicationTypeForA = MultiplicationTypeForA::Minus;
}
else if (a.type() == ExpressionNode::Type::Addition) {
multiplicationTypeForA = MultiplicationTypeForA::Parenthesis;
}
else {
multiplicationTypeForA = MultiplicationTypeForA::Normal;
}
PoincareHelpers::Simplify(&a, context, ExpressionNode::ReductionTarget::User);
/*
* Because when can't apply reduce or simplify to keep the
* canonized form we must beautify the expression manually
*/
Expression xMinusAlphaPowerTwo;
Expression alpha = getOppositeIfExists(minusAlpha, &reductionContext);
if (alpha.isUninitialized()) {
PoincareHelpers::Simplify(&minusAlpha, context, ExpressionNode::ReductionTarget::User);
xMinusAlphaPowerTwo = Power::Builder(Parenthesis::Builder(Addition::Builder(Symbol::Builder("x", strlen("x")), minusAlpha)), Rational::Builder(2));
}
else {
PoincareHelpers::Simplify(&alpha, context, ExpressionNode::ReductionTarget::User);
xMinusAlphaPowerTwo = Power::Builder(Parenthesis::Builder(Subtraction::Builder(Symbol::Builder("x", strlen("x")), alpha)), Rational::Builder(2));
}
Expression xMinusAlphaPowerTwoWithFactor;
switch (multiplicationTypeForA)
{
case MultiplicationTypeForA::Nothing:
xMinusAlphaPowerTwoWithFactor = xMinusAlphaPowerTwo;
break;
case MultiplicationTypeForA::Minus:
xMinusAlphaPowerTwoWithFactor = Multiplication::Builder(a.clone(), xMinusAlphaPowerTwo);
break;
case MultiplicationTypeForA::Parenthesis:
xMinusAlphaPowerTwoWithFactor = Multiplication::Builder(Parenthesis::Builder(a.clone()), xMinusAlphaPowerTwo);
break;
case MultiplicationTypeForA::Normal:
xMinusAlphaPowerTwoWithFactor = Multiplication::Builder(a.clone(), xMinusAlphaPowerTwo);
break;
default:
assert(false);
break;
}
Expression canonized;
Expression beta = getOppositeIfExists(minusBeta, &reductionContext);
if (beta.isUninitialized()) {
PoincareHelpers::Simplify(&minusBeta, context, ExpressionNode::ReductionTarget::User);
canonized = Subtraction::Builder(xMinusAlphaPowerTwoWithFactor, minusBeta);
}
else {
PoincareHelpers::Simplify(&beta, context, ExpressionNode::ReductionTarget::User);
canonized = Addition::Builder(xMinusAlphaPowerTwoWithFactor, beta);
}
Expression x0;
Expression x1;
if (delta.nullStatus(context) == ExpressionNode::NullStatus::Null) {
// x0 = x1 = -b/(2a)
x0 = Division::Builder(Opposite::Builder(b.clone()), Multiplication::Builder(Rational::Builder(2), a.clone()));
m_numberOfSolutions = 1;
PoincareHelpers::Simplify(&x0, context, ExpressionNode::ReductionTarget::SystemForApproximation);
}
else {
// x0 = (-b-sqrt(delta))/(2a)
x0 = Division::Builder(Subtraction::Builder(Opposite::Builder(b.clone()), SquareRoot::Builder(delta.clone())), Multiplication::Builder(Rational::Builder(2), a.clone()));
// x1 = (-b+sqrt(delta))/(2a)
x1 = Division::Builder(Addition::Builder(Opposite::Builder(b.clone()), SquareRoot::Builder(delta.clone())), Multiplication::Builder(Rational::Builder(2), a.clone()));
m_numberOfSolutions = 2;
PoincareHelpers::Simplify(&x0, context, ExpressionNode::ReductionTarget::SystemForApproximation);
PoincareHelpers::Simplify(&x1, context, ExpressionNode::ReductionTarget::SystemForApproximation);
if (x0.type() == ExpressionNode::Type::Unreal) {
assert(x1.type() == ExpressionNode::Type::Unreal);
m_numberOfSolutions = 0;
}
}
Expression factorized;
if (m_numberOfSolutions == 2) {
Expression firstFactor;
Expression secondFactor;
Expression x0Opposite = getOppositeIfExists(x0, &reductionContext);
if (x0Opposite.isUninitialized()) {
PoincareHelpers::Simplify(&x0, context, ExpressionNode::ReductionTarget::User);
firstFactor = Subtraction::Builder(Symbol::Builder("x", strlen("x")), x0);
}
else {
PoincareHelpers::Simplify(&x0Opposite, context, ExpressionNode::ReductionTarget::User);
firstFactor = Addition::Builder(Symbol::Builder("x", strlen("x")), x0Opposite);
}
if (x0.type() == ExpressionNode::Type::Opposite) {
factorized = Parenthesis::Builder(Addition::Builder(Symbol::Builder("x", strlen("x")), x0.childAtIndex(0).clone()));
}
Expression x1Opposite = getOppositeIfExists(x1, &reductionContext);
if (x1Opposite.isUninitialized()) {
PoincareHelpers::Simplify(&x1, context, ExpressionNode::ReductionTarget::User);
secondFactor = Subtraction::Builder(Symbol::Builder("x", strlen("x")), x1);
}
else {
PoincareHelpers::Simplify(&x1Opposite, context, ExpressionNode::ReductionTarget::User);
secondFactor = Addition::Builder(Symbol::Builder("x", strlen("x")), x1Opposite);
}
Expression solutionProduct = Multiplication::Builder(Parenthesis::Builder(firstFactor), Parenthesis::Builder(secondFactor));
switch (multiplicationTypeForA)
{
case MultiplicationTypeForA::Nothing:
factorized = solutionProduct;
break;
case MultiplicationTypeForA::Minus:
factorized = Multiplication::Builder(a.clone(), solutionProduct);
break;
case MultiplicationTypeForA::Parenthesis:
factorized = Multiplication::Builder(Parenthesis::Builder(a.clone()), solutionProduct);
break;
case MultiplicationTypeForA::Normal:
factorized = Multiplication::Builder(a.clone(), solutionProduct);
break;
default:
assert(false);
break;
}
}
else if (m_numberOfSolutions == 1) {
Expression x0Opposite = getOppositeIfExists(x0, &reductionContext);
Expression factor;
if (x0Opposite.isUninitialized()) {
PoincareHelpers::Simplify(&x0, context, ExpressionNode::ReductionTarget::User);
factor = Subtraction::Builder(Symbol::Builder("x", strlen("x")), x0);
}
else {
PoincareHelpers::Simplify(&x0Opposite, context, ExpressionNode::ReductionTarget::User);
factor = Addition::Builder(Symbol::Builder("x", strlen("x")), x0Opposite);
}
Expression solutionProduct = Power::Builder(Parenthesis::Builder(factor), Rational::Builder(2));
switch (multiplicationTypeForA)
{
case MultiplicationTypeForA::Nothing:
factorized = solutionProduct;
break;
case MultiplicationTypeForA::Minus:
factorized = Multiplication::Builder(a.clone(), solutionProduct);
break;
case MultiplicationTypeForA::Parenthesis:
factorized = Multiplication::Builder(Parenthesis::Builder(a.clone()), solutionProduct);
break;
case MultiplicationTypeForA::Normal:
factorized = Multiplication::Builder(a.clone(), solutionProduct);
break;
default:
assert(false);
break;
}
}
PoincareHelpers::Simplify(&delta, context, ExpressionNode::ReductionTarget::User);
m_layouts[0] = PoincareHelpers::CreateLayout(canonized);
if (m_numberOfSolutions > 0) {
m_layouts[1] = PoincareHelpers::CreateLayout(factorized);
m_layouts[2] = PoincareHelpers::CreateLayout(delta);
m_layouts[3] = PoincareHelpers::CreateLayout(x0);
if (m_numberOfSolutions > 1) {
m_layouts[4] = PoincareHelpers::CreateLayout(x1);
}
}
else {
m_layouts[1] = PoincareHelpers::CreateLayout(delta);
}
}
Expression SecondDegreeListController::getOppositeIfExists(Expression e, Poincare::ExpressionNode::ReductionContext * reductionContext) {
if (e.isNumber() && e.sign(reductionContext->context()) == ExpressionNode::Sign::Negative) {
Number n = static_cast<Number&>(e);
return std::move(n.setSign(ExpressionNode::Sign::Positive));
}
else if (e.type() == ExpressionNode::Type::Multiplication && e.numberOfChildren() > 0 && e.childAtIndex(0).isNumber() && e.childAtIndex(0).sign(reductionContext->context()) == ExpressionNode::Sign::Negative) {
Multiplication m = static_cast<Multiplication&>(e);
if (m.childAtIndex(0).type() == ExpressionNode::Type::Rational && static_cast<Rational&>(e).isMinusOne()) {
// The negative numeral factor is -1, we just remove it
m.removeChildAtIndexInPlace(0);
} else {
Expression firstChild = m.childAtIndex(0);
Number n = static_cast<Number&>(firstChild);
m.childAtIndex(0).setChildrenInPlace(n.setSign(ExpressionNode::Sign::Positive));
}
PoincareHelpers::Simplify(&m, reductionContext->context(), ExpressionNode::ReductionTarget::User);
return std::move(m);
}
return Expression();
}
I18n::Message SecondDegreeListController::messageAtIndex(int index) {
if (m_numberOfSolutions > 0) {
if (index == 0) {
return I18n::Message::CanonicalForm;
}
if (index == 1) {
return I18n::Message::FactorizedForm;
}
if (index == 2) {
return I18n::Message::Discriminant;
}
if (index == 3) {
if (m_numberOfSolutions == 1) {
return I18n::Message::OnlyRoot;
}
else {
return I18n::Message::FirstRoot;
}
}
return I18n::Message::SecondRoot;
}
else {
switch (index) {
case 0:
return I18n::Message::CanonicalForm;
default:
return I18n::Message::Discriminant;
}
}
}
}

View File

@@ -0,0 +1,26 @@
#ifndef CALCULATION_ADDITIONAL_OUTPUTS_SECOND_DEGREE_CONTROLLER_H
#define CALCULATION_ADDITIONAL_OUTPUTS_SECOND_DEGREE_CONTROLLER_H
#include "expressions_list_controller.h"
namespace Calculation {
class SecondDegreeListController : public ExpressionsListController {
public:
SecondDegreeListController(EditExpressionController * editExpressionController) :
ExpressionsListController(editExpressionController),
m_numberOfSolutions(0) {}
void setExpression(Poincare::Expression e) override;
private:
Poincare::Expression getOppositeIfExists(Poincare::Expression e, Poincare::ExpressionNode::ReductionContext * reductionContext);
I18n::Message messageAtIndex(int index) override;
int m_numberOfSolutions;
};
}
#endif

View File

@@ -72,7 +72,7 @@ bool App::isAcceptableExpression(const Poincare::Expression expression) {
return false; return false;
} }
} }
return !(expression.isUninitialized() || expression.type() == ExpressionNode::Type::Equal); return !expression.isUninitialized();
} }
void App::didBecomeActive(Window * window) { void App::didBecomeActive(Window * window) {

View File

@@ -11,4 +11,10 @@ AdditionalDeterminant = "Determinante"
AdditionalInverse = "Inverse" AdditionalInverse = "Inverse"
AdditionalRowEchelonForm = "Stufenform" AdditionalRowEchelonForm = "Stufenform"
AdditionalReducedRowEchelonForm = "Reduzierte Stufenform" AdditionalReducedRowEchelonForm = "Reduzierte Stufenform"
AdditionalTrace = "Spur" AdditionalTrace = "Spur"
CanonicalForm = "Kanonische Form"
FactorizedForm = "Factorisierte Form"
Discriminant = "Diskriminante"
OnlyRoot = "Wurzel"
FirstRoot = "Erste Wurzel"
SecondRoot = "Zweite Wurzel"

View File

@@ -12,3 +12,9 @@ AdditionalInverse = "Inverse"
AdditionalRowEchelonForm = "Row echelon form" AdditionalRowEchelonForm = "Row echelon form"
AdditionalReducedRowEchelonForm = "Reduced row echelon form" AdditionalReducedRowEchelonForm = "Reduced row echelon form"
AdditionalTrace = "Trace" AdditionalTrace = "Trace"
CanonicalForm = "Canonical form"
FactorizedForm = "Factorized form"
Discriminant = "Discriminant"
OnlyRoot = "Root"
FirstRoot = "First root"
SecondRoot = "Second root"

View File

@@ -11,4 +11,10 @@ AdditionalDeterminant = "Determinante"
AdditionalInverse = "Inversa" AdditionalInverse = "Inversa"
AdditionalRowEchelonForm = "Matriz escalonada" AdditionalRowEchelonForm = "Matriz escalonada"
AdditionalReducedRowEchelonForm = "Matriz escalonada reducida" AdditionalReducedRowEchelonForm = "Matriz escalonada reducida"
AdditionalTrace = "Traza" AdditionalTrace = "Traza"
CanonicalForm = "Forma canónica"
FactorizedForm = "Forma factorizada"
Discriminant = "Discriminante"
OnlyRoot = "Raíz"
FirstRoot = "Primera raíz"
SecondRoot = "Segunda raíz"

View File

@@ -11,4 +11,10 @@ AdditionalDeterminant = "Déterminant"
AdditionalInverse = "Inverse" AdditionalInverse = "Inverse"
AdditionalRowEchelonForm = "Forme échelonnée" AdditionalRowEchelonForm = "Forme échelonnée"
AdditionalReducedRowEchelonForm = "Forme échelonnée réduite" AdditionalReducedRowEchelonForm = "Forme échelonnée réduite"
AdditionalTrace = "Trace" AdditionalTrace = "Trace"
CanonicalForm = "Forme canonique"
FactorizedForm = "Forme factorisée"
Discriminant = "Discriminant"
OnlyRoot = "Racine"
FirstRoot = "Première racine"
SecondRoot = "Seconde racine"

View File

@@ -12,3 +12,9 @@ AdditionalInverse = "inverz"
AdditionalRowEchelonForm = "Sor echelon forma" AdditionalRowEchelonForm = "Sor echelon forma"
AdditionalReducedRowEchelonForm = "Csökkentett sorú Echelon forma" AdditionalReducedRowEchelonForm = "Csökkentett sorú Echelon forma"
AdditionalTrace = "Nyomkövetés" AdditionalTrace = "Nyomkövetés"
CanonicalForm = "Kanonikus forma"
FactorizedForm = "Factorizált forma"
Discriminant = "Discriminant"
OnlyRoot = "Gyökér"
FirstRoot = "Első gyökér"
SecondRoot = "Második gyökér"

View File

@@ -11,4 +11,10 @@ AdditionalDeterminant = "Determinante"
AdditionalInverse = "Inversa" AdditionalInverse = "Inversa"
AdditionalRowEchelonForm = "Matrice a scalini" AdditionalRowEchelonForm = "Matrice a scalini"
AdditionalReducedRowEchelonForm = "Matrice ridotta a scalini" AdditionalReducedRowEchelonForm = "Matrice ridotta a scalini"
AdditionalTrace = "Traccia" AdditionalTrace = "Traccia"
CanonicalForm = "Forma canonica"
FactorizedForm = "Forma fattorizzata"
Discriminant = "Discriminante"
OnlyRoot = "Radice"
FirstRoot = "Prima radice"
SecondRoot = "Seconda radice"

View File

@@ -11,4 +11,10 @@ AdditionalDeterminant = "Determinant"
AdditionalInverse = "Inverse" AdditionalInverse = "Inverse"
AdditionalRowEchelonForm = "Echelonvorm" AdditionalRowEchelonForm = "Echelonvorm"
AdditionalReducedRowEchelonForm = "Gereduceerde echelonvorm" AdditionalReducedRowEchelonForm = "Gereduceerde echelonvorm"
AdditionalTrace = "Spoor" AdditionalTrace = "Spoor"
CanonicalForm = "Canonische vorm"
FactorizedForm = "Factorized vorm"
Discriminant = "Discriminant"
OnlyRoot = "Wortel"
FirstRoot = "Eerste wortel"
SecondRoot = "Tweede wortel"

View File

@@ -11,4 +11,10 @@ AdditionalDeterminant = "Determinante"
AdditionalInverse = "Matriz inversa" AdditionalInverse = "Matriz inversa"
AdditionalRowEchelonForm = "Matriz escalonada" AdditionalRowEchelonForm = "Matriz escalonada"
AdditionalReducedRowEchelonForm = "Matriz escalonada reduzida" AdditionalReducedRowEchelonForm = "Matriz escalonada reduzida"
AdditionalTrace = "Traço" AdditionalTrace = "Traço"
CanonicalForm = "Forma canónica"
FactorizedForm = "Factorized form"
Discriminant = "Discriminante"
OnlyRoot = "Raiz"
FirstRoot = "Primeira raiz"
SecondRoot = "Segunda raiz"

View File

@@ -8,6 +8,7 @@
#include <poincare/undefined.h> #include <poincare/undefined.h>
#include <poincare/unit.h> #include <poincare/unit.h>
#include <poincare/unreal.h> #include <poincare/unreal.h>
#include <poincare/symbol_abstract.h>
#include <string.h> #include <string.h>
#include <cmath> #include <cmath>
#include <algorithm> #include <algorithm>
@@ -272,6 +273,9 @@ Calculation::AdditionalInformationType Calculation::additionalInformationType(Co
if (o.type() == ExpressionNode::Type::Matrix) { if (o.type() == ExpressionNode::Type::Matrix) {
return AdditionalInformationType::Matrix; return AdditionalInformationType::Matrix;
} }
if (o.polynomialDegree(context, "x") == 2) {
return AdditionalInformationType::SecondDegree;
}
return AdditionalInformationType::None; return AdditionalInformationType::None;
} }

View File

@@ -39,6 +39,7 @@ public:
None = 0, None = 0,
Integer, Integer,
Rational, Rational,
SecondDegree,
Trigonometry, Trigonometry,
Unit, Unit,
Matrix, Matrix,

View File

@@ -16,6 +16,7 @@ HistoryController::HistoryController(EditExpressionController * editExpressionCo
m_complexController(editExpressionController), m_complexController(editExpressionController),
m_integerController(editExpressionController), m_integerController(editExpressionController),
m_rationalController(editExpressionController), m_rationalController(editExpressionController),
m_secondDegreeController(editExpressionController),
m_trigonometryController(editExpressionController), m_trigonometryController(editExpressionController),
m_unitController(editExpressionController), m_unitController(editExpressionController),
m_matrixController(editExpressionController) m_matrixController(editExpressionController)
@@ -100,6 +101,8 @@ bool HistoryController::handleEvent(Ion::Events::Event event) {
Expression e = calculationAtIndex(focusRow)->exactOutput(); Expression e = calculationAtIndex(focusRow)->exactOutput();
if (additionalInfoType == Calculation::AdditionalInformationType::Complex) { if (additionalInfoType == Calculation::AdditionalInformationType::Complex) {
vc = &m_complexController; vc = &m_complexController;
} else if (additionalInfoType == Calculation::AdditionalInformationType::SecondDegree) {
vc = &m_secondDegreeController;
} else if (additionalInfoType == Calculation::AdditionalInformationType::Trigonometry) { } else if (additionalInfoType == Calculation::AdditionalInformationType::Trigonometry) {
vc = &m_trigonometryController; vc = &m_trigonometryController;
// Find which of the input or output is the cosine/sine // Find which of the input or output is the cosine/sine

View File

@@ -8,6 +8,7 @@
#include "additional_outputs/complex_list_controller.h" #include "additional_outputs/complex_list_controller.h"
#include "additional_outputs/integer_list_controller.h" #include "additional_outputs/integer_list_controller.h"
#include "additional_outputs/rational_list_controller.h" #include "additional_outputs/rational_list_controller.h"
#include "additional_outputs/second_degree_list_controller.h"
#include "additional_outputs/trigonometry_list_controller.h" #include "additional_outputs/trigonometry_list_controller.h"
#include "additional_outputs/unit_list_controller.h" #include "additional_outputs/unit_list_controller.h"
#include "additional_outputs/matrix_list_controller.h" #include "additional_outputs/matrix_list_controller.h"
@@ -47,6 +48,7 @@ private:
ComplexListController m_complexController; ComplexListController m_complexController;
IntegerListController m_integerController; IntegerListController m_integerController;
RationalListController m_rationalController; RationalListController m_rationalController;
SecondDegreeListController m_secondDegreeController;
TrigonometryListController m_trigonometryController; TrigonometryListController m_trigonometryController;
UnitListController m_unitController; UnitListController m_unitController;
MatrixListController m_matrixController; MatrixListController m_matrixController;

View File

@@ -81,7 +81,7 @@ void HistoryViewCell::reloadSubviewHighlight() {
m_ellipsis.setHighlighted(false); m_ellipsis.setHighlighted(false);
if (isHighlighted()) { if (isHighlighted()) {
if (m_dataSource->selectedSubviewType() == HistoryViewCellDataSource::SubviewType::Input) { if (m_dataSource->selectedSubviewType() == HistoryViewCellDataSource::SubviewType::Input) {
m_inputView.setExpressionBackgroundColor(Palette::ListCellBackgroundSelected); m_inputView.setExpressionBackgroundColor(Palette::Select);
} else if (m_dataSource->selectedSubviewType() == HistoryViewCellDataSource::SubviewType::Output) { } else if (m_dataSource->selectedSubviewType() == HistoryViewCellDataSource::SubviewType::Output) {
m_scrollableOutputView.evenOddCell()->setHighlighted(true); m_scrollableOutputView.evenOddCell()->setHighlighted(true);
} else { } else {

View File

@@ -1,6 +1,8 @@
apps += Code::App apps += Code::App
app_headers += apps/code/app.h app_headers += apps/code/app.h
SFLAGS += -DHAS_CODE
app_code_src = $(addprefix apps/code/,\ app_code_src = $(addprefix apps/code/,\
app.cpp \ app.cpp \
console_controller.cpp \ console_controller.cpp \

View File

@@ -75,7 +75,7 @@ public:
VariableBoxController * variableBoxController() { return &m_variableBoxController; } VariableBoxController * variableBoxController() { return &m_variableBoxController; }
static constexpr int k_pythonHeapSize = 100000; static constexpr int k_pythonHeapSize = 67000;
private: private:
/* Python delegate: /* Python delegate:

View File

@@ -45,6 +45,7 @@ PythonCosh = "Hyperbolischer Kosinus"
PythonCount = "Zählt die Vorkommen von x" PythonCount = "Zählt die Vorkommen von x"
PythonDegrees = "x von Bogenmaß in Grad umrechnen" PythonDegrees = "x von Bogenmaß in Grad umrechnen"
PythonDivMod = "Quotient und Rest" PythonDivMod = "Quotient und Rest"
PythonDrawCircle = "Zeichne einen Kreis"
PythonDrawLine = "Eine Linie zeichnen" PythonDrawLine = "Eine Linie zeichnen"
PythonDrawString = "Text bei Pixel (x,y) darstellen" PythonDrawString = "Text bei Pixel (x,y) darstellen"
PythonErf = "Fehlerfunktion" PythonErf = "Fehlerfunktion"
@@ -54,11 +55,15 @@ PythonExp = "Exponentialfunktion"
PythonExpm1 = "Berechne exp(x)-1" PythonExpm1 = "Berechne exp(x)-1"
PythonFabs = "Absoluter Wert" PythonFabs = "Absoluter Wert"
PythonFillRect = "Gefülltes Rechteck bei Pixel (x,y)" PythonFillRect = "Gefülltes Rechteck bei Pixel (x,y)"
PythonFillCircle = "Füllt einen Kreis"
PythonFillPolygon = "Füllt ein Polygon"
PythonFloat = "x in einen Fließkommawert umwandeln" PythonFloat = "x in einen Fließkommawert umwandeln"
PythonFloor = "Abrunden" PythonFloor = "Abrunden"
PythonFmod = "a modulo b" PythonFmod = "a modulo b"
PythonFrExp = "Mantisse und Exponent von x: (m,e)" PythonFrExp = "Mantisse und Exponent von x: (m,e)"
PythonGamma = "Gamma-Funktion" PythonGamma = "Gamma-Funktion"
PythonGetKeys = "Gedrückte Tasten erhalten"
PythonGetPalette = "Themenpalette erhalten"
PythonGetPixel = "Farbe von Pixel (x,y) zurückgeben" PythonGetPixel = "Farbe von Pixel (x,y) zurückgeben"
PythonGetrandbits = "Ganzzahl mit k Zufallsbits" PythonGetrandbits = "Ganzzahl mit k Zufallsbits"
PythonGrid = "Sichtbarkeit des Gitters umschalten" PythonGrid = "Sichtbarkeit des Gitters umschalten"
@@ -70,12 +75,22 @@ PythonImportKandinsky = "Kandinsky-Modul importieren"
PythonImportRandom = "Random-Modul importieren" PythonImportRandom = "Random-Modul importieren"
PythonImportMath = "Math-Modul importieren" PythonImportMath = "Math-Modul importieren"
PythonImportMatplotlibPyplot = "Matplotlib.pyplot-Modul importieren" PythonImportMatplotlibPyplot = "Matplotlib.pyplot-Modul importieren"
PythonImportNumpy = "Ulab.numpy-Modul importieren"
PythonImportScipy = "Ulab.scipy-Modul importieren"
PythonImportOs = "OS-Modul importieren" PythonImportOs = "OS-Modul importieren"
PythonImportSys = "SYS-Modul importieren"
PythonOsUname = "Informationen über das System holen" PythonOsUname = "Informationen über das System holen"
PythonOsGetlogin = "Benutzernamen holen" PythonOsGetlogin = "Benutzernamen holen"
PythonOsRemove = "Datei namens Dateiname entfernen" PythonOsRemove = "Datei namens Dateiname entfernen"
PythonOsRename = "Datei umbenennen von Alt nach Neu" PythonOsRename = "Datei umbenennen von Alt nach Neu"
PythonOsListdir = "Dateien im Speicher auflisten" PythonOsListdir = "Dateien im Speicher auflisten"
PythonSysExit = "Terminate current program"
PythonSysPrintexception = "Print exception"
PythonSysByteorder = "The byte order of the system"
PythonSysImplementation = "Information about Python"
PythonSysModules = "Dictionary of loaded modules"
PythonSysVersion = "Python language version (string)"
PythonSysVersioninfo = "Python language version (tuple)"
PythonImportTime = "Time-Modul importieren" PythonImportTime = "Time-Modul importieren"
PythonImportTurtle = "Turtle-Modul importieren" PythonImportTurtle = "Turtle-Modul importieren"
PythonIndex = "Index des ersten x-Vorkommens" PythonIndex = "Index des ersten x-Vorkommens"
@@ -87,6 +102,9 @@ PythonIsFinite = "Prüfen, ob x endlich ist"
PythonIsInfinite = "Prüfen, ob x unendlich ist" PythonIsInfinite = "Prüfen, ob x unendlich ist"
PythonIsNaN = "Prüfen, ob x keine Zahl ist" PythonIsNaN = "Prüfen, ob x keine Zahl ist"
PythonIsKeyDown = "Wahr, wenn die Taste k gedrückt ist" PythonIsKeyDown = "Wahr, wenn die Taste k gedrückt ist"
PythonBattery = "Return battery voltage"
PythonBatteryLevel = "Return battery level"
PythonBatteryIscharging = "Return if battery is charging"
PythonKandinskyFunction = "Kandinsky-Modul Funktionspräfix" PythonKandinskyFunction = "Kandinsky-Modul Funktionspräfix"
PythonLdexp = "Liefert x*(2**i), Inverse von frexp" PythonLdexp = "Liefert x*(2**i), Inverse von frexp"
PythonLength = "Länge eines Objekts" PythonLength = "Länge eines Objekts"
@@ -100,6 +118,14 @@ PythonMax = "Maximum"
PythonMin = "Minimum" PythonMin = "Minimum"
PythonModf = "Bruch- und Ganzzahl-Anteile von x" PythonModf = "Bruch- und Ganzzahl-Anteile von x"
PythonMonotonic = "Wert einer monotonen Uhr" PythonMonotonic = "Wert einer monotonen Uhr"
PythonNumpyFunction = "numpy Modul-Präfix"
PythonNumpyFftFunction = "numpy.fft Modul-Präfix"
PythonNumpyLinalgFunction = "numpy.linalg Modul-Präfix"
PythonScipyFunction = "scipy Modul-Präfix"
PythonScipyLinalgFunction = "scipy.linalg Modul-Präfix"
PythonScipyOptimizeFunction = "scipy.optimize Modul-Präfix"
PythonScipySignalFunction = "scipy.signal Modul-Präfix"
PythonScipySpecialFunction = "scipy.special Modul-Präfix"
PythonOct = "Ganzzahl in Oktal umwandeln" PythonOct = "Ganzzahl in Oktal umwandeln"
PythonPhase = "Phase von z" PythonPhase = "Phase von z"
PythonPlot = "Plotten von y gegen x als Linien" PythonPlot = "Plotten von y gegen x als Linien"
@@ -125,6 +151,12 @@ PythonShow = "Figur anzeigen"
PythonSin = "Sinus" PythonSin = "Sinus"
PythonSinh = "Hyperbolischer Sinus" PythonSinh = "Hyperbolischer Sinus"
PythonSleep = "Ausführung aussetzen für t Sekunden" PythonSleep = "Ausführung aussetzen für t Sekunden"
PythonLocalTime = "Zeit in Tupel umwandeln"
PythonMktime = "Tupel in Zeit umwandeln"
PythonTime = "Abrufen des aktuellen Zeitstempels"
PythonSetLocaltime = "Zeit aus einem Tupel einstellen"
PythonRTCmode = "Aktuellen RTC-Modus abrufen"
PythonSetRTCmode = "RTC-Modus festlegen"
PythonSort = "Die Liste sortieren" PythonSort = "Die Liste sortieren"
PythonSqrt = "Quadratwurzel" PythonSqrt = "Quadratwurzel"
PythonSum = "Summe der Elemente einer Liste" PythonSum = "Summe der Elemente einer Liste"

View File

@@ -45,6 +45,7 @@ PythonCosh = "Hyperbolic cosine"
PythonCount = "Count the occurrences of x" PythonCount = "Count the occurrences of x"
PythonDegrees = "Convert x from radians to degrees" PythonDegrees = "Convert x from radians to degrees"
PythonDivMod = "Quotient and remainder" PythonDivMod = "Quotient and remainder"
PythonDrawCircle = "Draw a circle"
PythonDrawLine = "Draw a line" PythonDrawLine = "Draw a line"
PythonDrawString = "Display a text from pixel (x,y)" PythonDrawString = "Display a text from pixel (x,y)"
PythonErf = "Error function" PythonErf = "Error function"
@@ -53,12 +54,16 @@ PythonEval = "Return the evaluated expression"
PythonExp = "Exponential function" PythonExp = "Exponential function"
PythonExpm1 = "Compute exp(x)-1" PythonExpm1 = "Compute exp(x)-1"
PythonFabs = "Absolute value" PythonFabs = "Absolute value"
PythonFillCircle = "Fill a circle"
PythonFillPolygon = "Fill a polygon"
PythonFillRect = "Fill a rectangle at pixel (x,y)" PythonFillRect = "Fill a rectangle at pixel (x,y)"
PythonFloat = "Convert x to a float" PythonFloat = "Convert x to a float"
PythonFloor = "Floor" PythonFloor = "Floor"
PythonFmod = "a modulo b" PythonFmod = "a modulo b"
PythonFrExp = "Mantissa and exponent of x: (m,e)" PythonFrExp = "Mantissa and exponent of x: (m,e)"
PythonGamma = "Gamma function" PythonGamma = "Gamma function"
PythonGetKeys = "Get keys pressed"
PythonGetPalette = "Get theme palette"
PythonGetPixel = "Return pixel (x,y) color" PythonGetPixel = "Return pixel (x,y) color"
PythonGetrandbits = "Integer with k random bits" PythonGetrandbits = "Integer with k random bits"
PythonGrid = "Toggle the visibility of the grid" PythonGrid = "Toggle the visibility of the grid"
@@ -70,6 +75,8 @@ PythonImportKandinsky = "Import kandinsky module"
PythonImportRandom = "Import random module" PythonImportRandom = "Import random module"
PythonImportMath = "Import math module" PythonImportMath = "Import math module"
PythonImportMatplotlibPyplot = "Import matplotlib.pyplot module" PythonImportMatplotlibPyplot = "Import matplotlib.pyplot module"
PythonImportNumpy = "Import ulab.numpy module"
PythonImportScipy = "Import ulab.scipy module"
PythonImportTime = "Import time module" PythonImportTime = "Import time module"
PythonImportTurtle = "Import turtle module" PythonImportTurtle = "Import turtle module"
PythonIndex = "Index of the first x occurrence" PythonIndex = "Index of the first x occurrence"
@@ -80,6 +87,9 @@ PythonIonFunction = "ion module function prefix"
PythonIsFinite = "Check if x is finite" PythonIsFinite = "Check if x is finite"
PythonIsInfinite = "Check if x is infinity" PythonIsInfinite = "Check if x is infinity"
PythonIsKeyDown = "Return True if the k key is down" PythonIsKeyDown = "Return True if the k key is down"
PythonBattery = "Return battery voltage"
PythonBatteryLevel = "Return battery level"
PythonBatteryIscharging = "Return if battery is charging"
PythonIsNaN = "Check if x is a NaN" PythonIsNaN = "Check if x is a NaN"
PythonKandinskyFunction = "kandinsky module function prefix" PythonKandinskyFunction = "kandinsky module function prefix"
PythonLdexp = "Return x*(2**i), inverse of frexp" PythonLdexp = "Return x*(2**i), inverse of frexp"
@@ -94,6 +104,14 @@ PythonMax = "Maximum"
PythonMin = "Minimum" PythonMin = "Minimum"
PythonModf = "Fractional and integer parts of x" PythonModf = "Fractional and integer parts of x"
PythonMonotonic = "Value of a monotonic clock" PythonMonotonic = "Value of a monotonic clock"
PythonNumpyFunction = "numpy module prefix"
PythonNumpyFftFunction = "numpy.fft module prefix"
PythonNumpyLinalgFunction = "numpy.linalg module prefix"
PythonScipyFunction = "scipy module prefix"
PythonScipyLinalgFunction = "scipy.linalg module prefix"
PythonScipyOptimizeFunction = "scipy.optimize module prefix"
PythonScipySignalFunction = "scipy.signal module prefix"
PythonScipySpecialFunction = "scipy.special module prefix"
PythonOct = "Convert integer to octal" PythonOct = "Convert integer to octal"
PythonPhase = "Phase of z" PythonPhase = "Phase of z"
PythonPlot = "Plot y versus x as lines" PythonPlot = "Plot y versus x as lines"
@@ -119,6 +137,12 @@ PythonShow = "Display the figure"
PythonSin = "Sine" PythonSin = "Sine"
PythonSinh = "Hyperbolic sine" PythonSinh = "Hyperbolic sine"
PythonSleep = "Suspend the execution for t seconds" PythonSleep = "Suspend the execution for t seconds"
PythonLocalTime = "Convert time into tuple"
PythonMktime = "Convert tuple into time"
PythonTime = "Get the current timestamp"
PythonSetLocaltime = "Set time from a tuple"
PythonRTCmode = "Get current RTC mode"
PythonSetRTCmode = "Set RTC mode"
PythonSort = "Sort the list" PythonSort = "Sort the list"
PythonSqrt = "Square root" PythonSqrt = "Square root"
PythonSum = "Sum the items of a list" PythonSum = "Sum the items of a list"
@@ -152,11 +176,19 @@ PythonTurtleWrite = "Display a text"
PythonUniform = "Floating point number in [a,b]" PythonUniform = "Floating point number in [a,b]"
PythonImportTime = "Import time module" PythonImportTime = "Import time module"
PythonImportOs = "Import os module" PythonImportOs = "Import os module"
PythonImportSys = "Import sys module"
PythonOsUname = "Get infos about the system" PythonOsUname = "Get infos about the system"
PythonOsGetlogin = "Get username" PythonOsGetlogin = "Get username"
PythonOsRemove = "Remove file named filename" PythonOsRemove = "Remove file named filename"
PythonOsRename = "Rename file oldname to newname" PythonOsRename = "Rename file oldname to newname"
PythonOsListdir = "List files in memory" PythonOsListdir = "List files in memory"
PythonSysExit = "Terminate current program"
PythonSysPrintexception = "Print exception"
PythonSysByteorder = "The byte order of the system"
PythonSysImplementation = "Information about Python"
PythonSysModules = "Dictionary of loaded modules"
PythonSysVersion = "Python language version (string)"
PythonSysVersioninfo = "Python language version (tuple)"
PythonTimePrefix = "time module function prefix" PythonTimePrefix = "time module function prefix"
PythonTimeSleep = "Wait for n second" PythonTimeSleep = "Wait for n second"
PythonMonotonic = "Return monotonic time" PythonMonotonic = "Return monotonic time"

View File

@@ -45,6 +45,7 @@ PythonCosh = "Hyperbolic cosine"
PythonCount = "Count the occurrences of x" PythonCount = "Count the occurrences of x"
PythonDegrees = "Convert x from radians to degrees" PythonDegrees = "Convert x from radians to degrees"
PythonDivMod = "Quotient and remainder" PythonDivMod = "Quotient and remainder"
PythonDrawCircle = "Draw a circle"
PythonDrawLine = "Draw a line" PythonDrawLine = "Draw a line"
PythonDrawString = "Display a text from pixel (x,y)" PythonDrawString = "Display a text from pixel (x,y)"
PythonErf = "Error function" PythonErf = "Error function"
@@ -53,12 +54,16 @@ PythonEval = "Return the evaluated expression"
PythonExp = "Exponential function" PythonExp = "Exponential function"
PythonExpm1 = "Compute exp(x)-1" PythonExpm1 = "Compute exp(x)-1"
PythonFabs = "Absolute value" PythonFabs = "Absolute value"
PythonFillCircle = "Fill a circle"
PythonFillPolygon = "Fill a polygon"
PythonFillRect = "Fill a rectangle at pixel (x,y)" PythonFillRect = "Fill a rectangle at pixel (x,y)"
PythonFloat = "Convert x to a float" PythonFloat = "Convert x to a float"
PythonFloor = "Floor" PythonFloor = "Floor"
PythonFmod = "a modulo b" PythonFmod = "a modulo b"
PythonFrExp = "Mantissa and exponent of x: (m,e)" PythonFrExp = "Mantissa and exponent of x: (m,e)"
PythonGamma = "Gamma function" PythonGamma = "Gamma function"
PythonGetKeys = "Obtener teclas presionadas"
PythonGetPalette = "Get theme palette"
PythonGetPixel = "Return pixel (x,y) color" PythonGetPixel = "Return pixel (x,y) color"
PythonGetrandbits = "Integer with k random bits" PythonGetrandbits = "Integer with k random bits"
PythonGrid = "Toggle the visibility of the grid" PythonGrid = "Toggle the visibility of the grid"
@@ -70,6 +75,8 @@ PythonImportKandinsky = "Import kandinsky module"
PythonImportRandom = "Import random module" PythonImportRandom = "Import random module"
PythonImportMath = "Import math module" PythonImportMath = "Import math module"
PythonImportMatplotlibPyplot = "Import matplotlib.pyplot module" PythonImportMatplotlibPyplot = "Import matplotlib.pyplot module"
PythonImportNumpy = "Import ulab.numpy module"
PythonImportScipy = "Import ulab.scipy module"
PythonImportTime = "Import time module" PythonImportTime = "Import time module"
PythonImportTurtle = "Import turtle module" PythonImportTurtle = "Import turtle module"
PythonIndex = "Index of the first x occurrence" PythonIndex = "Index of the first x occurrence"
@@ -80,6 +87,9 @@ PythonIonFunction = "ion module function prefix"
PythonIsFinite = "Check if x is finite" PythonIsFinite = "Check if x is finite"
PythonIsInfinite = "Check if x is infinity" PythonIsInfinite = "Check if x is infinity"
PythonIsKeyDown = "Return True if the k key is down" PythonIsKeyDown = "Return True if the k key is down"
PythonBattery = "Return battery voltage"
PythonBatteryLevel = "Return battery level"
PythonBatteryIscharging = "Return if battery is charging"
PythonIsNaN = "Check if x is a NaN" PythonIsNaN = "Check if x is a NaN"
PythonKandinskyFunction = "kandinsky module function prefix" PythonKandinskyFunction = "kandinsky module function prefix"
PythonLdexp = "Return x*(2**i), inverse of frexp" PythonLdexp = "Return x*(2**i), inverse of frexp"
@@ -94,6 +104,14 @@ PythonMax = "Maximum"
PythonMin = "Minimum" PythonMin = "Minimum"
PythonModf = "Fractional and integer parts of x" PythonModf = "Fractional and integer parts of x"
PythonMonotonic = "Value of a monotonic clock" PythonMonotonic = "Value of a monotonic clock"
PythonNumpyFunction = "numpy module prefix"
PythonNumpyFftFunction = "numpy.fft module prefix"
PythonNumpyLinalgFunction = "numpy.linalg module prefix"
PythonScipyFunction = "scipy module prefix"
PythonScipyLinalgFunction = "scipy.linalg module prefix"
PythonScipyOptimizeFunction = "scipy.optimize module prefix"
PythonScipySignalFunction = "scipy.signal module prefix"
PythonScipySpecialFunction = "scipy.special module prefix"
PythonOct = "Convert integer to octal" PythonOct = "Convert integer to octal"
PythonPhase = "Phase of z" PythonPhase = "Phase of z"
PythonPlot = "Plot y versus x as lines" PythonPlot = "Plot y versus x as lines"
@@ -119,6 +137,12 @@ PythonShow = "Display the figure"
PythonSin = "Sine" PythonSin = "Sine"
PythonSinh = "Hyperbolic sine" PythonSinh = "Hyperbolic sine"
PythonSleep = "Suspend the execution for t seconds" PythonSleep = "Suspend the execution for t seconds"
PythonLocalTime = "Convertir el tiempo en tupla"
PythonMktime = "Convertir tupla en tiempo"
PythonTime = "Obtener la marca de tiempo actual"
PythonSetLocaltime = "Establecer tiempo desde una tupla"
PythonRTCmode = "Obtener el modo RTC actual"
PythonSetRTCmode = "Establecer modo RTC"
PythonSort = "Sort the list" PythonSort = "Sort the list"
PythonSqrt = "Square root" PythonSqrt = "Square root"
PythonSum = "Sum the items of a list" PythonSum = "Sum the items of a list"
@@ -152,11 +176,19 @@ PythonTurtleWrite = "Display a text"
PythonUniform = "Floating point number in [a,b]" PythonUniform = "Floating point number in [a,b]"
PythonImportTime = "Import time module" PythonImportTime = "Import time module"
PythonImportOs = "Import os module" PythonImportOs = "Import os module"
PythonImportSys = "Import sys module"
PythonOsUname = " Información del sistema " PythonOsUname = " Información del sistema "
PythonOsGetlogin = "Get username" PythonOsGetlogin = "Get username"
PythonOsRemove = "Eliminar un archivo" PythonOsRemove = "Eliminar un archivo"
PythonOsRename = "Renombrar archivo" PythonOsRename = "Renombrar archivo"
PythonOsListdir = "Archivos de la lista" PythonOsListdir = "Archivos de la lista"
PythonSysExit = "Terminate current program"
PythonSysPrintexception = "Print exception"
PythonSysByteorder = "The byte order of the system"
PythonSysImplementation = "Information about Python"
PythonSysModules = "Dictionary of loaded modules"
PythonSysVersion = "Python language version (string)"
PythonSysVersioninfo = "Python language version (tuple)"
PythonTimePrefix = "time module function prefix" PythonTimePrefix = "time module function prefix"
PythonTimeSleep = "Esperar n segundos" PythonTimeSleep = "Esperar n segundos"
PythonMonotonic = "Tiempo monótono de retorno" PythonMonotonic = "Tiempo monótono de retorno"

View File

@@ -45,6 +45,7 @@ PythonCosh = "Cosinus hyperbolique"
PythonCount = "Compte les occurrences de x" PythonCount = "Compte les occurrences de x"
PythonDegrees = "Conversion de radians en degrés" PythonDegrees = "Conversion de radians en degrés"
PythonDivMod = "Quotient et reste" PythonDivMod = "Quotient et reste"
PythonDrawCircle = "Trace un cercle"
PythonDrawLine = "Trace une ligne" PythonDrawLine = "Trace une ligne"
PythonDrawString = "Affiche un texte au pixel (x,y)" PythonDrawString = "Affiche un texte au pixel (x,y)"
PythonErf = "Fonction d'erreur" PythonErf = "Fonction d'erreur"
@@ -53,12 +54,16 @@ PythonEval = "Evalue l'expression en argument "
PythonExp = "Fonction exponentielle" PythonExp = "Fonction exponentielle"
PythonExpm1 = "Calcul de exp(x)-1" PythonExpm1 = "Calcul de exp(x)-1"
PythonFabs = "Valeur absolue" PythonFabs = "Valeur absolue"
PythonFillCircle = "Remplit un cercle"
PythonFillPolygon = "Remplit un polygone"
PythonFillRect = "Remplit un rectangle" PythonFillRect = "Remplit un rectangle"
PythonFloat = "Conversion en flottant" PythonFloat = "Conversion en flottant"
PythonFloor = "Partie entière" PythonFloor = "Partie entière"
PythonFmod = "a modulo b" PythonFmod = "a modulo b"
PythonFrExp = "Mantisse et exposant de x : (m,e)" PythonFrExp = "Mantisse et exposant de x : (m,e)"
PythonGamma = "Fonction gamma" PythonGamma = "Fonction gamma"
PythonGetKeys = "Obtenir les touches pressées"
PythonGetPalette = "Obtient la palette du thème"
PythonGetPixel = "Renvoie la couleur du pixel (x,y)" PythonGetPixel = "Renvoie la couleur du pixel (x,y)"
PythonGetrandbits = "Nombre aléatoire sur k bits" PythonGetrandbits = "Nombre aléatoire sur k bits"
PythonGrid = "Affiche ou masque la grille" PythonGrid = "Affiche ou masque la grille"
@@ -70,6 +75,8 @@ PythonImportKandinsky = "Importation du module kandinsky"
PythonImportRandom = "Importation du module random" PythonImportRandom = "Importation du module random"
PythonImportMath = "Importation du module math" PythonImportMath = "Importation du module math"
PythonImportMatplotlibPyplot = "Importation de matplotlib.pyplot" PythonImportMatplotlibPyplot = "Importation de matplotlib.pyplot"
PythonImportNumpy = "Importation de ulab.numpy"
PythonImportScipy = "Importation de ulab.scipy"
PythonImportTurtle = "Importation du module turtle" PythonImportTurtle = "Importation du module turtle"
PythonImportTime = "Importation du module time" PythonImportTime = "Importation du module time"
PythonIndex = "Indice première occurrence de x" PythonIndex = "Indice première occurrence de x"
@@ -80,6 +87,9 @@ PythonIonFunction = "Préfixe fonction module ion"
PythonIsFinite = "Teste si x est fini" PythonIsFinite = "Teste si x est fini"
PythonIsInfinite = "Teste si x est infini" PythonIsInfinite = "Teste si x est infini"
PythonIsKeyDown = "Renvoie True si touche k enfoncée" PythonIsKeyDown = "Renvoie True si touche k enfoncée"
PythonBattery = "Renvoie le voltage de la batterie"
PythonBatteryLevel = "Renvoie le niveau de la batterie"
PythonBatteryIscharging = "Chargement en cours"
PythonIsNaN = "Teste si x est NaN" PythonIsNaN = "Teste si x est NaN"
PythonKandinskyFunction = "Préfixe fonction module kandinsky" PythonKandinskyFunction = "Préfixe fonction module kandinsky"
PythonLdexp = "Inverse de frexp : x*(2**i)" PythonLdexp = "Inverse de frexp : x*(2**i)"
@@ -94,6 +104,14 @@ PythonMax = "Maximum"
PythonMin = "Minimum" PythonMin = "Minimum"
PythonModf = "Parties fractionnaire et entière" PythonModf = "Parties fractionnaire et entière"
PythonMonotonic = "Renvoie la valeur de l'horloge" PythonMonotonic = "Renvoie la valeur de l'horloge"
PythonNumpyFunction = "Préfixe fonction du module numpy"
PythonNumpyFftFunction = "Préfixe fonction du module numpy.fft"
PythonNumpyLinalgFunction = "Préfixe fonction du module numpy.linalg"
PythonScipyFunction = "Préfixe fonction du module scipy"
PythonScipyLinalgFunction = "Préfixe fonction du module scipy.linalg"
PythonScipyOptimizeFunction = "Préfixe fonction du module scipy.optimize"
PythonScipySignalFunction = "Préfixe fonction du module scipy.signal"
PythonScipySpecialFunction = "Préfixe fonction du module scipy.special"
PythonOct = "Conversion en octal" PythonOct = "Conversion en octal"
PythonPhase = "Argument de z" PythonPhase = "Argument de z"
PythonPlot = "Trace y en fonction de x" PythonPlot = "Trace y en fonction de x"
@@ -119,6 +137,12 @@ PythonShow = "Affiche la figure"
PythonSin = "Sinus" PythonSin = "Sinus"
PythonSinh = "Sinus hyperbolique" PythonSinh = "Sinus hyperbolique"
PythonSleep = "Suspend l'exécution t secondes" PythonSleep = "Suspend l'exécution t secondes"
PythonLocalTime = "Convertir le temps en tuple"
PythonMktime = "Convertir le tuple en temps"
PythonTime = "Obtenir l'horodatage actuel"
PythonSetLocaltime = "Définir l'heure à partir d'un tuple"
PythonRTCmode = "Obtenir le mode RTC actuel"
PythonSetRTCmode = "Définir le mode RTC"
PythonSort = "Trie la liste" PythonSort = "Trie la liste"
PythonSqrt = "Racine carrée" PythonSqrt = "Racine carrée"
PythonSum = "Somme des éléments de la liste" PythonSum = "Somme des éléments de la liste"
@@ -152,11 +176,19 @@ PythonTurtleWrite = "Affiche un texte"
PythonUniform = "Nombre décimal dans [a,b]" PythonUniform = "Nombre décimal dans [a,b]"
PythonImportTime = "Importation du module temps" PythonImportTime = "Importation du module temps"
PythonImportOs = "Importation du module os" PythonImportOs = "Importation du module os"
PythonImportSys = "Importation du module sys"
PythonOsUname = "Donne des infos sur le système" PythonOsUname = "Donne des infos sur le système"
PythonOsGetlogin = "Donne le nom d'utilisateur" PythonOsGetlogin = "Donne le nom d'utilisateur"
PythonOsRemove = "Supprime le fichier nommé filename" PythonOsRemove = "Supprime le fichier nommé filename"
PythonOsRename = "Renomme oldname en newname" PythonOsRename = "Renomme oldname en newname"
PythonOsListdir = "Liste les fichiers" PythonOsListdir = "Liste les fichiers"
PythonSysExit = "Termine le programme"
PythonSysPrintexception = "Imprime une exception"
PythonSysByteorder = "L'ordre des octets du système"
PythonSysImplementation = "Information sur Python"
PythonSysModules = "Dictionnaire des modules chargés"
PythonSysVersion = "Version du langage Python (string)"
PythonSysVersioninfo = "Version du langage Python (tuple)"
PythonTimePrefix = "Préfixe fonction du module temps" PythonTimePrefix = "Préfixe fonction du module temps"
PythonTimeSleep = "Attendre n secondes" PythonTimeSleep = "Attendre n secondes"
PythonMonotonic = "Retourne le temps monotone" PythonMonotonic = "Retourne le temps monotone"

View File

@@ -45,6 +45,7 @@ PythonCosh = "Hiperbolikus koszinusz"
PythonCount = "Számolja az x elöfordulását" PythonCount = "Számolja az x elöfordulását"
PythonDegrees = "x konvertálása radiánokrol fokokra" PythonDegrees = "x konvertálása radiánokrol fokokra"
PythonDivMod = "Hányados és maradék" PythonDivMod = "Hányados és maradék"
PythonDrawCircle = "Rajzolj egy kört"
PythonDrawLine = "Húzzon egy vonalat " PythonDrawLine = "Húzzon egy vonalat "
PythonDrawString = "Szöveg megjelenítése (x, y)-en" PythonDrawString = "Szöveg megjelenítése (x, y)-en"
PythonErf = "Hiba funkció" PythonErf = "Hiba funkció"
@@ -54,11 +55,15 @@ PythonExp = "Exponenciális függvény"
PythonExpm1 = "exp(x)-1 sámitása" PythonExpm1 = "exp(x)-1 sámitása"
PythonFabs = "Abszolút érték" PythonFabs = "Abszolút érték"
PythonFillRect = "Téglalap töltése" PythonFillRect = "Téglalap töltése"
PythonFillCircle = "Kitölti a kört"
PythonFillPolygon = "Kitölti a poligont"
PythonFloat = "Konvertálása tizedes számra" PythonFloat = "Konvertálása tizedes számra"
PythonFloor = "Egész része" PythonFloor = "Egész része"
PythonFmod = "a modulo b" PythonFmod = "a modulo b"
PythonFrExp = "X mantissája és kiállítója" PythonFrExp = "X mantissája és kiállítója"
PythonGamma = "Gamma funkció" PythonGamma = "Gamma funkció"
PythonGetKeys = "Billentyűk lenyomva"
PythonGetPalette = "Téma paletta beszerzése"
PythonGetPixel = "Visszatéríti (x,y) színét" PythonGetPixel = "Visszatéríti (x,y) színét"
PythonGetrandbits = "Váletlenszám visszatérítése k biten" PythonGetrandbits = "Váletlenszám visszatérítése k biten"
PythonGrid = "Rács megjelenítése/elrejtése" PythonGrid = "Rács megjelenítése/elrejtése"
@@ -70,6 +75,8 @@ PythonImportKandinsky = "Kandinsky modul importálása"
PythonImportRandom = "Véletlenszerü modul importálása" PythonImportRandom = "Véletlenszerü modul importálása"
PythonImportMath = "math modul importálása" PythonImportMath = "math modul importálása"
PythonImportMatplotlibPyplot = "matplotlib.pyplot modul importálása" PythonImportMatplotlibPyplot = "matplotlib.pyplot modul importálása"
PythonImportNumpy = "ulab.numpy modul importálása"
PythonImportScipy = "ulab.scipy modul importálása"
PythonImportTurtle = "turtle modul importálása" PythonImportTurtle = "turtle modul importálása"
PythonImportTime = "time modul importálása" PythonImportTime = "time modul importálása"
PythonIndex = "Az elsö x esemény indexe" PythonIndex = "Az elsö x esemény indexe"
@@ -80,6 +87,9 @@ PythonIonFunction = "ion modul funkció elötag"
PythonIsFinite = "x véges-e" PythonIsFinite = "x véges-e"
PythonIsInfinite = "x végtelen-e" PythonIsInfinite = "x végtelen-e"
PythonIsKeyDown = "True-t válaszol ha a k gomb le van nyomva" PythonIsKeyDown = "True-t válaszol ha a k gomb le van nyomva"
PythonBattery = "Return battery voltage"
PythonBatteryLevel = "Return battery level"
PythonBatteryIscharging = "Return if battery is charging"
PythonIsNaN = "Ellenörizze hogy x nem NaN" PythonIsNaN = "Ellenörizze hogy x nem NaN"
PythonKandinskyFunction = "kandinsky modul funkció elötag" PythonKandinskyFunction = "kandinsky modul funkció elötag"
PythonLdexp = "frexp ellentéte : x*(2**i)" PythonLdexp = "frexp ellentéte : x*(2**i)"
@@ -94,6 +104,14 @@ PythonMax = "Maximum"
PythonMin = "Minimum" PythonMin = "Minimum"
PythonModf = "x-nek tört és egész részei" PythonModf = "x-nek tört és egész részei"
PythonMonotonic = "Az óra értékét adja vissza" PythonMonotonic = "Az óra értékét adja vissza"
PythonNumpyFunction = "numpy elötag"
PythonNumpyFftFunction = "numpy.fft elötag"
PythonNumpyLinalgFunction = "numpy.linalg elötag"
PythonScipyFunction = "scipy elötag"
PythonScipyLinalgFunction = "scipy.linalg elötag"
PythonScipyOptimizeFunction = "scipy.optimize elötag"
PythonScipySignalFunction = "scipy.signal elötag"
PythonScipySpecialFunction = "scipy.special elötag"
PythonOct = "Decimális szám konvertálása octális számra" PythonOct = "Decimális szám konvertálása octális számra"
PythonPhase = "z fázisa" PythonPhase = "z fázisa"
PythonPlot = "y-t jelöli x függvényében" PythonPlot = "y-t jelöli x függvényében"
@@ -119,6 +137,12 @@ PythonShow = "Mutassa az ábrát"
PythonSin = "Szinusz" PythonSin = "Szinusz"
PythonSinh = "Hiperbolikus szinusz" PythonSinh = "Hiperbolikus szinusz"
PythonSleep = "t másodpercre meg állitani a programmot" PythonSleep = "t másodpercre meg állitani a programmot"
PythonLocalTime = "Idő konvertálása csomóvá"
PythonMktime = "A tuple konvertálása az időben"
PythonTime = "Az aktuális időbélyeg letöltése"
PythonSetLocaltime = "Idő beállítása egy csomóból"
PythonRTCmode = "Aktuális RTC mód"
PythonSetRTCmode = "RTC mód beállítása"
PythonSort = "A listát rendezni" PythonSort = "A listát rendezni"
PythonSqrt = "Négyzetgyök" PythonSqrt = "Négyzetgyök"
PythonSum = "Összeadni a lista elemeit" PythonSum = "Összeadni a lista elemeit"
@@ -176,3 +200,11 @@ PythonOsGetlogin = "Get username"
PythonOsRemove = "Fájl törlése" PythonOsRemove = "Fájl törlése"
PythonOsRename = "Fájl átnevezése" PythonOsRename = "Fájl átnevezése"
PythonOsListdir = "Fájlok listája" PythonOsListdir = "Fájlok listája"
PythonImportSys = "sys modul importálása"
PythonSysExit = "Terminate current program"
PythonSysPrintexception = "Print exception"
PythonSysByteorder = "The byte order of the system"
PythonSysImplementation = "Information about Python"
PythonSysModules = "Dictionary of loaded modules"
PythonSysVersion = "Python language version (string)"
PythonSysVersioninfo = "Python language version (tuple)"

View File

@@ -45,6 +45,7 @@ PythonCosh = "Coseno iperbolico"
PythonCount = "Conta le ricorrenze di x" PythonCount = "Conta le ricorrenze di x"
PythonDegrees = "Conversione di radianti in gradi" PythonDegrees = "Conversione di radianti in gradi"
PythonDivMod = "Quoziente e resto" PythonDivMod = "Quoziente e resto"
PythonDrawCircle = "Disegnare un cerchio"
PythonDrawLine = "Disegna una linea" PythonDrawLine = "Disegna una linea"
PythonDrawString = "Visualizza il testo dal pixel x,y" PythonDrawString = "Visualizza il testo dal pixel x,y"
PythonErf = "Funzione d'errore" PythonErf = "Funzione d'errore"
@@ -53,12 +54,16 @@ PythonEval = "Valuta l'espressione nell'argomento "
PythonExp = "Funzione esponenziale" PythonExp = "Funzione esponenziale"
PythonExpm1 = "Calcola exp(x)-1" PythonExpm1 = "Calcola exp(x)-1"
PythonFabs = "Valore assoluto" PythonFabs = "Valore assoluto"
PythonFillCircle = "Riempire un cerchio"
PythonFillPolygon = "Riempire un poligono"
PythonFillRect = "Riempie un rettangolo" PythonFillRect = "Riempie un rettangolo"
PythonFloat = "Conversione in flottanti" PythonFloat = "Conversione in flottanti"
PythonFloor = "Parte intera" PythonFloor = "Parte intera"
PythonFmod = "a modulo b" PythonFmod = "a modulo b"
PythonFrExp = "Mantissa ed esponente di x : (m,e)" PythonFrExp = "Mantissa ed esponente di x : (m,e)"
PythonGamma = "Funzione gamma" PythonGamma = "Funzione gamma"
PythonGetKeys = "Premere i tasti"
PythonGetPalette = "Ottieni la tavolozza del tema"
PythonGetPixel = "Restituisce colore del pixel(x,y)" PythonGetPixel = "Restituisce colore del pixel(x,y)"
PythonGetrandbits = "Numero aleatorio con k bit" PythonGetrandbits = "Numero aleatorio con k bit"
PythonGrid = "Attiva la visibilità della griglia" PythonGrid = "Attiva la visibilità della griglia"
@@ -70,6 +75,8 @@ PythonImportKandinsky = "Importa modulo kandinsky"
PythonImportRandom = "Importa modulo random" PythonImportRandom = "Importa modulo random"
PythonImportMath = "Importa modulo math" PythonImportMath = "Importa modulo math"
PythonImportMatplotlibPyplot = "Importa modulo matplotlib.pyplot" PythonImportMatplotlibPyplot = "Importa modulo matplotlib.pyplot"
PythonImportNumpy = "Importa modulo ulab.numpy"
PythonImportScipy = "Importa modulo ulab.scipy"
PythonImportTurtle = "Importa del modulo turtle" PythonImportTurtle = "Importa del modulo turtle"
PythonImportTime = "Importa del modulo time" PythonImportTime = "Importa del modulo time"
PythonImportOs = "Importa modulo os" PythonImportOs = "Importa modulo os"
@@ -78,6 +85,14 @@ PythonOsGetlogin = "Get username"
PythonOsRemove = "Rimuovere un file" PythonOsRemove = "Rimuovere un file"
PythonOsRename = "Rinomina file" PythonOsRename = "Rinomina file"
PythonOsListdir = "Elenca file" PythonOsListdir = "Elenca file"
PythonImportSys = "Importa modulo sys"
PythonSysExit = "Terminate current program"
PythonSysPrintexception = "Print exception"
PythonSysByteorder = "The byte order of the system"
PythonSysImplementation = "Information about Python"
PythonSysModules = "Dictionary of loaded modules"
PythonSysVersion = "Python language version (string)"
PythonSysVersioninfo = "Python language version (tuple)"
PythonIndex = "Indice prima occorrenza di x" PythonIndex = "Indice prima occorrenza di x"
PythonInput = "Inserire un valore" PythonInput = "Inserire un valore"
PythonInsert = "Inserire x in posizione i-esima" PythonInsert = "Inserire x in posizione i-esima"
@@ -86,6 +101,9 @@ PythonIonFunction = "Prefisso di funzione modulo ion"
PythonIsFinite = "Testa se x è finito" PythonIsFinite = "Testa se x è finito"
PythonIsInfinite = "Testa se x est infinito" PythonIsInfinite = "Testa se x est infinito"
PythonIsKeyDown = "Restituisce True premendo tasto k" PythonIsKeyDown = "Restituisce True premendo tasto k"
PythonBattery = "Return battery voltage"
PythonBatteryLevel = "Return battery level"
PythonBatteryIscharging = "Return if battery is charging"
PythonIsNaN = "Testa se x è NaN" PythonIsNaN = "Testa se x è NaN"
PythonKandinskyFunction = "Prefisso funzione modulo kandinsky" PythonKandinskyFunction = "Prefisso funzione modulo kandinsky"
PythonLdexp = "Inversa di frexp : x*(2**i)" PythonLdexp = "Inversa di frexp : x*(2**i)"
@@ -100,6 +118,14 @@ PythonMax = "Massimo"
PythonMin = "Minimo" PythonMin = "Minimo"
PythonModf = "Parti frazionarie e intere" PythonModf = "Parti frazionarie e intere"
PythonMonotonic = "Restituisce il valore dell'orologio" PythonMonotonic = "Restituisce il valore dell'orologio"
PythonNumpyFunction = "Prefisso modulo numpy"
PythonNumpyFftFunction = "Prefisso modulo numpy.fft"
PythonNumpyLinalgFunction = "Prefisso modulo numpy.linalg"
PythonScipyFunction = "Prefisso modulo scipy"
PythonScipyLinalgFunction = "Prefisso modulo scipy.linalg"
PythonScipyOptimizeFunction = "Prefisso modulo scipy.optimize"
PythonScipySignalFunction = "Prefisso modulo scipy.signal"
PythonScipySpecialFunction = "Prefisso modulo scipy.special"
PythonOct = "Conversione in ottale" PythonOct = "Conversione in ottale"
PythonPhase = "Argomento di z" PythonPhase = "Argomento di z"
PythonPlot = "Disegna y in f. di x come linee" PythonPlot = "Disegna y in f. di x come linee"
@@ -125,6 +151,12 @@ PythonShow = "Mostra la figura"
PythonSin = "Seno" PythonSin = "Seno"
PythonSinh = "Seno iperbolico" PythonSinh = "Seno iperbolico"
PythonSleep = "Sospende l'esecuzione t secondi" PythonSleep = "Sospende l'esecuzione t secondi"
PythonLocalTime = "Converti il tempo in tuple"
PythonMktime = "Converti tuple in tempo"
PythonTime = "Ottieni il timestamp corrente"
PythonSetLocaltime = "Imposta il tempo da una tupla"
PythonRTCmode = "Ottieni la modalità RTC corrente"
PythonSetRTCmode = "Imposta modalità RTC"
PythonSort = "Ordina l'elenco" PythonSort = "Ordina l'elenco"
PythonSqrt = "Radice quadrata" PythonSqrt = "Radice quadrata"
PythonSum = "Somma degli elementi della lista" PythonSum = "Somma degli elementi della lista"

View File

@@ -45,6 +45,7 @@ PythonCosh = "Cosinus hyperbolicus"
PythonCount = "Tel voorkomen van x" PythonCount = "Tel voorkomen van x"
PythonDegrees = "Zet x om van radialen naar graden" PythonDegrees = "Zet x om van radialen naar graden"
PythonDivMod = "Quotiënt en rest" PythonDivMod = "Quotiënt en rest"
PythonDrawCircle = "Teken een cirkel"
PythonDrawLine = "Teken een lijn" PythonDrawLine = "Teken een lijn"
PythonDrawString = "Geef een tekst weer van pixel (x,y)" PythonDrawString = "Geef een tekst weer van pixel (x,y)"
PythonErf = "Error functie" PythonErf = "Error functie"
@@ -53,12 +54,16 @@ PythonEval = "Geef de geëvalueerde uitdrukking"
PythonExp = "Exponentiële functie" PythonExp = "Exponentiële functie"
PythonExpm1 = "Bereken exp(x)-1" PythonExpm1 = "Bereken exp(x)-1"
PythonFabs = "Absolute waarde" PythonFabs = "Absolute waarde"
PythonFillCircle = "Vul een cirkel"
PythonFillPolygon = "Vul een veelhoek"
PythonFillRect = "Vul een rechthoek bij pixel (x,y)" PythonFillRect = "Vul een rechthoek bij pixel (x,y)"
PythonFloat = "Zet x om in een float" PythonFloat = "Zet x om in een float"
PythonFloor = "Vloer" PythonFloor = "Vloer"
PythonFmod = "a modulo b" PythonFmod = "a modulo b"
PythonFrExp = "Mantisse en exponent van x: (m,e)" PythonFrExp = "Mantisse en exponent van x: (m,e)"
PythonGamma = "Gammafunctie" PythonGamma = "Gammafunctie"
PythonGetKeys = "Get toetsen ingedrukt"
PythonGetPalette = "Thema palet krijgen"
PythonGetPixel = "Geef pixel (x,y) kleur (rgb)" PythonGetPixel = "Geef pixel (x,y) kleur (rgb)"
PythonGetrandbits = "Integer met k willekeurige bits" PythonGetrandbits = "Integer met k willekeurige bits"
PythonGrid = "Verander zichtbaarheid raster" PythonGrid = "Verander zichtbaarheid raster"
@@ -70,6 +75,8 @@ PythonImportKandinsky = "Importeer kandinsky module"
PythonImportRandom = "Importeer random module" PythonImportRandom = "Importeer random module"
PythonImportMath = "Importeer math module" PythonImportMath = "Importeer math module"
PythonImportMatplotlibPyplot = "Importeer matplotlib.pyplot module" PythonImportMatplotlibPyplot = "Importeer matplotlib.pyplot module"
PythonImportNumpy = "Importeer ulab.numpy module"
PythonImportScipy = "Importeer ulab.scipy module"
PythonImportTime = "Importeer time module" PythonImportTime = "Importeer time module"
PythonImportOs = "Importeer os module" PythonImportOs = "Importeer os module"
PythonOsUname = " Krijg systeeminfo" PythonOsUname = " Krijg systeeminfo"
@@ -77,6 +84,15 @@ PythonOsGetlogin = "Get username"
PythonOsRemove = "Een bestand verwijderen" PythonOsRemove = "Een bestand verwijderen"
PythonOsRename = "Hernoem bestand" PythonOsRename = "Hernoem bestand"
PythonOsListdir = "Lijstbestanden" PythonOsListdir = "Lijstbestanden"
PythonImportSys = "Importeer sys module"
PythonImportSys = "Importeer sys module"
PythonSysExit = "Terminate current program"
PythonSysPrintexception = "Print exception"
PythonSysByteorder = "The byte order of the system"
PythonSysImplementation = "Information about Python"
PythonSysModules = "Dictionary of loaded modules"
PythonSysVersion = "Python language version (string)"
PythonSysVersioninfo = "Python language version (tuple)"
PythonImportTurtle = "Importeer turtle module" PythonImportTurtle = "Importeer turtle module"
PythonIndex = "Index van de eerste x aanwezigheden" PythonIndex = "Index van de eerste x aanwezigheden"
PythonInput = "Wijs een waarde toe" PythonInput = "Wijs een waarde toe"
@@ -86,6 +102,9 @@ PythonIonFunction = "ion module voorvoegsel"
PythonIsFinite = "Controleer of x eindig is" PythonIsFinite = "Controleer of x eindig is"
PythonIsInfinite = "Controleer of x oneindig is" PythonIsInfinite = "Controleer of x oneindig is"
PythonIsKeyDown = "Geef True als k toets omlaag is" PythonIsKeyDown = "Geef True als k toets omlaag is"
PythonBattery = "Return battery voltage"
PythonBatteryLevel = "Return battery level"
PythonBatteryIscharging = "Return if battery is charging"
PythonIsNaN = "Controleer of x geen getal is" PythonIsNaN = "Controleer of x geen getal is"
PythonKandinskyFunction = "kandinsky module voorvoegsel" PythonKandinskyFunction = "kandinsky module voorvoegsel"
PythonLdexp = "Geeft x*(2**i), inversie van frexp" PythonLdexp = "Geeft x*(2**i), inversie van frexp"
@@ -100,6 +119,14 @@ PythonMax = "Maximum"
PythonMin = "Minimum" PythonMin = "Minimum"
PythonModf = "Fractionele en gehele delen van x" PythonModf = "Fractionele en gehele delen van x"
PythonMonotonic = "Waarde van een monotone klok" PythonMonotonic = "Waarde van een monotone klok"
PythonNumpyFunction = "numpy module prefix"
PythonNumpyFftFunction = "numpy.fft module prefix"
PythonNumpyLinalgFunction = "numpy.linalg module prefix"
PythonScipyFunction = "scipy module prefix"
PythonScipyLinalgFunction = "scipy.linalg module prefix"
PythonScipyOptimizeFunction = "scipy.optimize module prefix"
PythonScipySignalFunction = "scipy.signal module prefix"
PythonScipySpecialFunction = "scipy.special module prefix"
PythonOct = "Integer omzetten naar octaal" PythonOct = "Integer omzetten naar octaal"
PythonPhase = "Fase van z in radialen" PythonPhase = "Fase van z in radialen"
PythonPlot = "Plot y versus x als lijnen" PythonPlot = "Plot y versus x als lijnen"
@@ -125,6 +152,12 @@ PythonShow = "Figuur weergeven"
PythonSin= "Sinus" PythonSin= "Sinus"
PythonSinh = "Sinus hyperbolicus" PythonSinh = "Sinus hyperbolicus"
PythonSleep = "Stel executie voor t seconden uit" PythonSleep = "Stel executie voor t seconden uit"
PythonLocalTime = "Zet tijd om in tuple"
PythonMktime = "Tuple omzetten in tijd"
PythonTime = "Haal de huidige tijdstempel"
PythonSetLocaltime = "Stel de tijd in vanaf een tuple"
PythonRTCmode = "Huidige RTC-modus kregen"
PythonSetRTCmode = "RTC-modus instellen"
PythonSort = "Sorteer de lijst" PythonSort = "Sorteer de lijst"
PythonSqrt = "Vierkantswortel" PythonSqrt = "Vierkantswortel"
PythonSum = "Sommeer de items van een lijst" PythonSum = "Sommeer de items van een lijst"

View File

@@ -45,6 +45,7 @@ PythonCosh = "Cosseno hiperbólico"
PythonCount = "Contar as ocorrências de x" PythonCount = "Contar as ocorrências de x"
PythonDegrees = "Converter x de radianos para graus" PythonDegrees = "Converter x de radianos para graus"
PythonDivMod = "Quociente e resto" PythonDivMod = "Quociente e resto"
PythonDrawCircle = "Desenha um círculo"
PythonDrawLine = "Desenhe uma linha" PythonDrawLine = "Desenhe uma linha"
PythonDrawString = "Mostrar o texto do pixel (x,y)" PythonDrawString = "Mostrar o texto do pixel (x,y)"
PythonErf = "Função erro" PythonErf = "Função erro"
@@ -53,12 +54,16 @@ PythonEval = "Devolve a expressão avaliada"
PythonExp = "Função exponencial" PythonExp = "Função exponencial"
PythonExpm1 = "Calcular exp(x)-1" PythonExpm1 = "Calcular exp(x)-1"
PythonFabs = "Valor absoluto" PythonFabs = "Valor absoluto"
PythonFillCircle = "Preencher um círculo"
PythonFillPolygon = "Preencher um polígono"
PythonFillRect = "Preencher um retângulo em (x,y)" PythonFillRect = "Preencher um retângulo em (x,y)"
PythonFloat = "Converter x num flutuante" PythonFloat = "Converter x num flutuante"
PythonFloor = "Parte inteira" PythonFloor = "Parte inteira"
PythonFmod = "a módulo b" PythonFmod = "a módulo b"
PythonFrExp = "Coeficiente e expoente de x: (m, e)" PythonFrExp = "Coeficiente e expoente de x: (m, e)"
PythonGamma = "Função gama" PythonGamma = "Função gama"
PythonGetKeys = "Obter teclas pressionadas"
PythonGetPalette = "Obter paleta temática"
PythonGetPixel = "Devolve a cor do pixel (x,y)" PythonGetPixel = "Devolve a cor do pixel (x,y)"
PythonGetrandbits = "Número inteiro aleatório com k bits" PythonGetrandbits = "Número inteiro aleatório com k bits"
PythonGrid = "Alterar visibilidade da grelha" PythonGrid = "Alterar visibilidade da grelha"
@@ -70,6 +75,8 @@ PythonImportKandinsky = "Importar módulo kandinsky"
PythonImportRandom = "Importar módulo random" PythonImportRandom = "Importar módulo random"
PythonImportMath = "Importar módulo math" PythonImportMath = "Importar módulo math"
PythonImportMatplotlibPyplot = "Importar módulo matplotlib.pyplot" PythonImportMatplotlibPyplot = "Importar módulo matplotlib.pyplot"
PythonImportNumpy = "Importar módulo ulab.numpy"
PythonImportScipy = "Importar módulo ulab.scipy"
PythonImportTime = "Importar módulo time" PythonImportTime = "Importar módulo time"
PythonImportTurtle = "Importar módulo turtle" PythonImportTurtle = "Importar módulo turtle"
PythonIndex = "Índice da primeira ocorrência de x" PythonIndex = "Índice da primeira ocorrência de x"
@@ -80,6 +87,9 @@ PythonIonFunction = "Prefixo da função do módulo ion"
PythonIsFinite = "Verificar se x é finito" PythonIsFinite = "Verificar se x é finito"
PythonIsInfinite = "Verificar se x é infinito" PythonIsInfinite = "Verificar se x é infinito"
PythonIsKeyDown = "Devolve True se tecla k pressionada" PythonIsKeyDown = "Devolve True se tecla k pressionada"
PythonBattery = "Return battery voltage"
PythonBatteryLevel = "Return battery level"
PythonBatteryIscharging = "Return if battery is charging"
PythonIsNaN = "Verificar se x é um NaN" PythonIsNaN = "Verificar se x é um NaN"
PythonKandinskyFunction = "Prefixo da função do módulo kandinsky" PythonKandinskyFunction = "Prefixo da função do módulo kandinsky"
PythonLdexp = "Devolve x*(2**i), inverso de frexp" PythonLdexp = "Devolve x*(2**i), inverso de frexp"
@@ -94,6 +104,14 @@ PythonMax = "Máximo"
PythonMin = "Mínimo" PythonMin = "Mínimo"
PythonModf = "Partes inteira e frácionária de x" PythonModf = "Partes inteira e frácionária de x"
PythonMonotonic = "Devolve o valor do relógio" PythonMonotonic = "Devolve o valor do relógio"
PythonNumpyFunction = "Prefixo do módulo numpy"
PythonNumpyFftFunction = "Prefixo do módulo numpy.fft"
PythonNumpyLinalgFunction = "Prefixo do módulo numpy.linalg"
PythonScipyFunction = "Prefixo do módulo scipy"
PythonScipyLinalgFunction = "Prefixo do módulo scipy.linalg"
PythonScipyOptimizeFunction = "Prefixo do módulo scipy.optimize"
PythonScipySignalFunction = "Prefixo do módulo scipy.signal"
PythonScipySpecialFunction = "Prefixo do módulo scipy.special"
PythonOct = "Converter número inteiro em octal" PythonOct = "Converter número inteiro em octal"
PythonPhase = "Argumento de z" PythonPhase = "Argumento de z"
PythonPlot = "Desenhar y em função de x" PythonPlot = "Desenhar y em função de x"
@@ -119,6 +137,12 @@ PythonShow = "Mostrar a figura"
PythonSin = "Seno" PythonSin = "Seno"
PythonSinh = "Seno hiperbólico" PythonSinh = "Seno hiperbólico"
PythonSleep = "Suspender a execução por t segundos" PythonSleep = "Suspender a execução por t segundos"
PythonLocalTime = "Convert o tempo em tupla"
PythonMktime = "Convert tuple em tempo"
PythonTime = "Obter o estamp de tempo atual"
PythonSetLocaltime = "Definir tempo a partir de uma tupla"
PythonRTCmode = "Obter o modo RTC atual"
PythonSetRTCmode = "Definir o modo RTC"
PythonSort = "Ordenar a lista" PythonSort = "Ordenar a lista"
PythonSqrt = "Raiz quadrada" PythonSqrt = "Raiz quadrada"
PythonSum = "Soma dos itens da lista" PythonSum = "Soma dos itens da lista"
@@ -157,6 +181,14 @@ PythonOsGetlogin = "Get username"
PythonOsRemove = "Remover um ficheiro" PythonOsRemove = "Remover um ficheiro"
PythonOsRename = "Renomear ficheiro" PythonOsRename = "Renomear ficheiro"
PythonOsListdir = "Listar ficheiros" PythonOsListdir = "Listar ficheiros"
PythonImportSys = "Import sys module"
PythonSysExit = "Terminate current program"
PythonSysPrintexception = "Print exception"
PythonSysByteorder = "The byte order of the system"
PythonSysImplementation = "Information about Python"
PythonSysModules = "Dictionary of loaded modules"
PythonSysVersion = "Python language version (string)"
PythonSysVersioninfo = "Python language version (tuple)"
PythonTimePrefix = "time module function prefix" PythonTimePrefix = "time module function prefix"
PythonTimeSleep = "Wait for n second" PythonTimeSleep = "Wait for n second"
PythonMonotonic = "Return monotonic time" PythonMonotonic = "Return monotonic time"

View File

@@ -50,6 +50,7 @@ PythonCommandCount = "list.count(x)"
PythonCommandCountWithoutArg = ".count(\x11)" PythonCommandCountWithoutArg = ".count(\x11)"
PythonCommandDegrees = "degrees(x)" PythonCommandDegrees = "degrees(x)"
PythonCommandDivMod = "divmod(a,b)" PythonCommandDivMod = "divmod(a,b)"
PythonCommandDrawCircle = "draw_circle(x,y,r,color)"
PythonCommandDrawLine = "draw_line(x1,y1,x2,y2,color)" PythonCommandDrawLine = "draw_line(x1,y1,x2,y2,color)"
PythonCommandDrawString = "draw_string(\"text\",x,y)" PythonCommandDrawString = "draw_string(\"text\",x,y)"
PythonCommandConstantE = "e" PythonCommandConstantE = "e"
@@ -60,12 +61,16 @@ PythonCommandExp = "exp(x)"
PythonCommandExpComplex = "exp(z)" PythonCommandExpComplex = "exp(z)"
PythonCommandExpm1 = "expm1(x)" PythonCommandExpm1 = "expm1(x)"
PythonCommandFabs = "fabs(x)" PythonCommandFabs = "fabs(x)"
PythonCommandFillCircle = "fill_circle(x,y,r,color)"
PythonCommandFillPolygon = "fill_polygon([(x1,y1),...],color)"
PythonCommandFillRect = "fill_rect(x,y,width,height,color)" PythonCommandFillRect = "fill_rect(x,y,width,height,color)"
PythonCommandFloat = "float(x)" PythonCommandFloat = "float(x)"
PythonCommandFloor = "floor(x)" PythonCommandFloor = "floor(x)"
PythonCommandFmod = "fmod(a,b)" PythonCommandFmod = "fmod(a,b)"
PythonCommandFrExp = "frexp(x)" PythonCommandFrExp = "frexp(x)"
PythonCommandGamma = "gamma(x)" PythonCommandGamma = "gamma(x)"
PythonCommandGetKeys = "get_keys()"
PythonCommandGetPalette = "get_palette()"
PythonCommandGetPixel = "get_pixel(x,y)" PythonCommandGetPixel = "get_pixel(x,y)"
PythonCommandGetrandbits = "getrandbits(k)" PythonCommandGetrandbits = "getrandbits(k)"
PythonCommandGrid = "grid()" PythonCommandGrid = "grid()"
@@ -86,9 +91,13 @@ PythonCommandImportIon = "import ion"
PythonCommandImportKandinsky = "import kandinsky" PythonCommandImportKandinsky = "import kandinsky"
PythonCommandImportMath = "import math" PythonCommandImportMath = "import math"
PythonCommandImportMatplotlibPyplot = "import matplotlib.pyplot" PythonCommandImportMatplotlibPyplot = "import matplotlib.pyplot"
PythonCommandImportFromNumpy = "from ulab import numpy as np"
PythonCommandImportFromScipy = "from ulab import scipy as spy"
PythonCommandImportRandom = "import random" PythonCommandImportRandom = "import random"
PythonCommandImportOs = "import os" PythonCommandImportOs = "import os"
PythonCommandImportFromOs = "from os import *" PythonCommandImportFromOs = "from os import *"
PythonCommandImportSys = "import sys"
PythonCommandImportFromSys = "from sys import *"
PythonCommandImportTime = "import time" PythonCommandImportTime = "import time"
PythonCommandImportTurtle = "import turtle" PythonCommandImportTurtle = "import turtle"
PythonCommandIndex = "list.index(x)" PythonCommandIndex = "list.index(x)"
@@ -151,6 +160,9 @@ PythonCommandKeyEe = "KEY_EE"
PythonCommandKeyAns = "KEY_ANS" PythonCommandKeyAns = "KEY_ANS"
PythonCommandKeyExe = "KEY_EXE" PythonCommandKeyExe = "KEY_EXE"
PythonCommandIsKeyDown = "keydown(k)" PythonCommandIsKeyDown = "keydown(k)"
PythonCommandBattery = "battery()"
PythonCommandBatteryLevel = "battery_level()"
PythonCommandBatteryIscharging = "battery_ischarging()"
PythonCommandLdexp = "ldexp(x,i)" PythonCommandLdexp = "ldexp(x,i)"
PythonCommandLength = "len(object)" PythonCommandLength = "len(object)"
PythonCommandLgamma = "lgamma(x)" PythonCommandLgamma = "lgamma(x)"
@@ -166,6 +178,120 @@ PythonCommandMax = "max(list)"
PythonCommandMin = "min(list)" PythonCommandMin = "min(list)"
PythonCommandModf = "modf(x)" PythonCommandModf = "modf(x)"
PythonCommandMonotonic = "monotonic()" PythonCommandMonotonic = "monotonic()"
PythonCommandNumpyArray = "np.array(a)"
PythonCommandNumpyArange = "np.arange(i)"
PythonCommandNumpyConcatenate = "np.concatenate(a,b)"
PythonCommandNumpyDiag = "np.diag(a)"
PythonCommandNumpyZeros = "np.zeros(s)"
PythonCommandNumpyOnes = "np.ones(s)"
PythonCommandNumpyEmpty = "np.empty(s)"
PythonCommandNumpyEye = "np.eye(n, m)"
PythonCommandNumpyFull = "np.full(s, v)"
PythonCommandNumpyLinspace = "np.linspace(s, e)"
PythonCommandNumpyLogspace = "np.logspace(s, e)"
PythonCommandNumpyCopy = "ndarray.copy()"
PythonCommandNumpyCopyWithoutArg = ".copy()"
PythonCommandNumpyDtype = "ndarray.dtype"
PythonCommandNumpyDtypeWithoutArg = ".dtype"
PythonCommandNumpyFlat = "ndarray.flat"
PythonCommandNumpyFlatWithoutArg = ".flat"
PythonCommandNumpyFlatten = "ndarray.flatten()"
PythonCommandNumpyFlattenWithoutArg = ".flatten()"
PythonCommandNumpyShape = "ndarray.shape"
PythonCommandNumpyShapeWithoutArg = ".shape"
PythonCommandNumpyReshape = "ndarray.reshape(s)"
PythonCommandNumpyReshapeWithoutArg = ".reshape(\x11)"
PythonCommandNumpySize = "ndarray.size"
PythonCommandNumpySizeWithoutArg = ".size"
PythonCommandNumpyTranspose = "ndarray.transpose()"
PythonCommandNumpyTransposeWithoutArg = ".transpose()"
PythonCommandNumpySort = "ndarray.sort()"
PythonCommandNumpySortWithoutArg = ".sort()"
PythonCommandNumpyFromBuffer = "ndarray.frombuffer(b)"
PythonCommandNumpyToBytes = "ndarray.tobytes()"
PythonCommandNumpyToBytesWithoutArg = ".tobytes()"
PythonCommandNumpySetPrintOptions = "np.set_printoptions()"
PythonCommandNumpyGetPrintOptions = "np.get_printoptions()"
PythonCommandNumpyNdinfo = "np.ndinfo(a)"
PythonCommandNumpyAll = "np.all(a)"
PythonCommandNumpyAny = "np.any(a)"
PythonCommandNumpyArgmax = "np.argmax(a)"
PythonCommandNumpyArgmin = "np.argmin(a)"
PythonCommandNumpyArgsort = "np.argsort(a)"
PythonCommandNumpyClip = "np.clip(a, min, max)"
PythonCommandNumpyConvolve = "np.convolve(a, b)"
PythonCommandNumpyDiff = "np.diff(a)"
PythonCommandNumpyInterp = "np.interp(a)"
PythonCommandNumpyDot = "np.dot(a, b)"
PythonCommandNumpyCross = "np.cross(a, b)"
PythonCommandNumpyEqual = "np.equal(a, b)"
PythonCommandNumpyNot_equal = "np.not_equal(a, b)"
PythonCommandNumpyFlip = "np.flip(a)"
PythonCommandNumpyIsfinite = "np.isfinite(a)"
PythonCommandNumpyIsinf = "np.isinf(a)"
PythonCommandNumpyMean = "np.mean(a)"
PythonCommandNumpyMin = "np.min(a)"
PythonCommandNumpyMax = "np.max(a)"
PythonCommandNumpyMedian = "np.median(a)"
PythonCommandNumpyMinimum = "np.minimum(a, b)"
PythonCommandNumpyMaximum = "np.maximum(a, b)"
PythonCommandNumpyPolyfit = "np.polyfit(a, b, y)"
PythonCommandNumpyPolyval = "np.polyval(p, x)"
PythonCommandNumpyRoll = "np.roll(a, n)"
PythonCommandNumpySortWithArguments = "np.sort(a)"
PythonCommandNumpyStd = "np.std(a)"
PythonCommandNumpySum = "np.sum(a)"
PythonCommandNumpyTrace = "np.trace(a)"
PythonCommandNumpyTrapz = "np.trapz(y)"
PythonCommandNumpyWhere = "np.where(c, x, y)"
PythonCommandNumpyVectorize = "np.vectorize(f)"
PythonCommandNumpyAcos = "np.acos(a)"
PythonCommandNumpyAcosh = "np.acosh(a)"
PythonCommandNumpyArctan2 = "np.arctan2(a)"
PythonCommandNumpyAround = "np.around(a)"
PythonCommandNumpyAsin = "np.asin(a)"
PythonCommandNumpyAsinh = "np.asinh(a)"
PythonCommandNumpyAtan = "np.atan(a)"
PythonCommandNumpyAtanh = "np.atanh(a)"
PythonCommandNumpyCeil = "np.ceil(a)"
PythonCommandNumpyCos = "np.cos(a)"
PythonCommandNumpyCosh = "np.cosh(a)"
PythonCommandNumpyDegrees = "np.degrees(a)"
PythonCommandNumpyExp = "np.exp(a)"
PythonCommandNumpyExpm1 = "np.expm1(a)"
PythonCommandNumpyFloor = "np.floor(a)"
PythonCommandNumpyLog = "np.log(a)"
PythonCommandNumpyLog10 = "np.log10(a)"
PythonCommandNumpyLog2 = "np.log2(a)"
PythonCommandNumpyRadians = "np.radians(a)"
PythonCommandNumpySin = "np.sin(a)"
PythonCommandNumpySinh = "np.sinh(a)"
PythonCommandNumpySqrt = "np.sqrt(a)"
PythonCommandNumpyTan = "np.tan(a)"
PythonCommandNumpyTanh = "np.tanh(a)"
PythonCommandNumpyBool = "np.bool"
PythonCommandNumpyFloat = "np.float"
PythonCommandNumpyUint8 = "np.uint8"
PythonCommandNumpyInt8 = "np.int8"
PythonCommandNumpyUint16 = "np.uint16"
PythonCommandNumpyInt16 = "np.int16"
PythonCommandNumpyNan = "np.nan"
PythonCommandNumpyInf = "np.inf"
PythonCommandNumpyE = "np.e"
PythonCommandNumpyPi = "np.pi"
PythonCommandNumpyFft = "np.fft.fft(a)"
PythonCommandNumpyIfft = "np.fft.ifft(a)"
PythonCommandNumpyDet = "np.linalg.det(a)"
PythonCommandNumpyEig = "np.linalg.eig(a)"
PythonCommandNumpyCholesky = "np.linalg.cholesky(a)"
PythonCommandNumpyInv = "np.linalg.inv(a)"
PythonCommandNumpyNorm = "np.linalg.norm(a)"
PythonCommandNumpyFunction = "np.function"
PythonCommandNumpyFunctionWithoutArg = "np.\x11"
PythonCommandNumpyFftFunction = "np.fft.function"
PythonCommandNumpyFftFunctionWithoutArg = "np.fft.\x11"
PythonCommandNumpyLinalgFunction = "np.linalg.function"
PythonCommandNumpyLinalgFunctionWithoutArg = "np.linalg.\x11"
PythonCommandOct = "oct(x)" PythonCommandOct = "oct(x)"
PythonCommandPhase = "phase(z)" PythonCommandPhase = "phase(z)"
PythonCommandPlot = "plot(x,y,color)" PythonCommandPlot = "plot(x,y,color)"
@@ -192,12 +318,39 @@ PythonCommandReverseWithoutArg = ".reverse()"
PythonCommandRound = "round(x,n)" PythonCommandRound = "round(x,n)"
PythonCommandScatter = "scatter(x,y)" PythonCommandScatter = "scatter(x,y)"
PythonCommandSeed = "seed(x)" PythonCommandSeed = "seed(x)"
PythonCommandScipyFunction = "spy.function"
PythonCommandScipyFunctionWithoutArg = "spy.\x11"
PythonCommandScipyLinalgFunction = "spy.linalg.function"
PythonCommandScipyLinalgFunctionWithoutArg = "spy.linalg.\x11"
PythonCommandScipyOptimizeFunction = "spy.optimize.function"
PythonCommandScipyOptimizeFunctionWithoutArg = "spy.optimize.\x11"
PythonCommandScipySignalFunction = "spy.signal.function"
PythonCommandScipySignalFunctionWithoutArg = "spy.signal.\x11"
PythonCommandScipySpecialFunction = "spy.special.function"
PythonCommandScipySpecialFunctionWithoutArg = "spy.special.\x11"
PythonCommandScipyLinalgChoSolve = "spy.linalg.cho_solve(a, b)"
PythonCommandScipyLinalgSolveTriangular = "spy.linalg.solve_triangular(a, b)"
PythonCommandScipyOptimizeBisect = "spy.optimize.bisect(f, a, b)"
PythonCommandScipyOptimizeFmin = "spy.optimize.fmin(f, x0)"
PythonCommandScipyOptimizeNewton = "spy.optimize.newton(f, x0)"
PythonCommandScipySignalSosfilt = "spy.signal.sosfilt(sos, x)"
PythonCommandScipySignalSpectrogram = "spy.signal.spectrogram(y)"
PythonCommandScipySpecialErf = "spy.erf(a)"
PythonCommandScipySpecialErfc = "spy.erfc(a)"
PythonCommandScipySpecialGamma = "spy.gamma(a)"
PythonCommandScipySpecialGammaln = "spy.gammaln(a)"
PythonCommandSetPixel = "set_pixel(x,y,color)" PythonCommandSetPixel = "set_pixel(x,y,color)"
PythonCommandShow = "show()" PythonCommandShow = "show()"
PythonCommandSin = "sin(x)" PythonCommandSin = "sin(x)"
PythonCommandSinComplex = "sin(z)" PythonCommandSinComplex = "sin(z)"
PythonCommandSinh = "sinh(x)" PythonCommandSinh = "sinh(x)"
PythonCommandSleep = "sleep(t)" PythonCommandSleep = "sleep(t)"
PythonCommandLocalTime = "localtime([timestamp])"
PythonCommandMktime = "mktime(tm)"
PythonCommandTime = "time()"
PythonCommandSetLocaltime = "setlocaltime(tm)"
PythonCommandRTCmode = "rtcmode()"
PythonCommandSetRTCmode = "setrtcmode(mode)"
PythonCommandSort = "list.sort()" PythonCommandSort = "list.sort()"
PythonCommandSortWithoutArg = ".sort()" PythonCommandSortWithoutArg = ".sort()"
PythonCommandSorted = "sorted(list)" PythonCommandSorted = "sorted(list)"
@@ -222,6 +375,14 @@ PythonOsCommandRename = "rename(oldname, newname)"
PythonOsCommandRemoveWithoutArg = "remove(\x11)" PythonOsCommandRemoveWithoutArg = "remove(\x11)"
PythonOsCommandRenameWithoutArg = "rename(\x11,)" PythonOsCommandRenameWithoutArg = "rename(\x11,)"
PythonOsCommandListdir = "listdir()" PythonOsCommandListdir = "listdir()"
PythonSysCommandExit = "exit()"
PythonSysCommandPrintexception = "print_exception(exc)"
PythonSysCommandPrintexceptionWithoutArg = "print_exception(\x11)"
PythonSysCommandByteorder = "byteorder"
PythonSysCommandImplementation = "implementation"
PythonSysCommandModules = "modules"
PythonSysCommandVersion = "version"
PythonSysCommandVersioninfo = "version_info"
PythonTurtleCommandBackward = "backward(x)" PythonTurtleCommandBackward = "backward(x)"
PythonTurtleCommandCircle = "circle(r)" PythonTurtleCommandCircle = "circle(r)"
PythonTurtleCommandColor = "color('c')" PythonTurtleCommandColor = "color('c')"

View File

@@ -102,7 +102,7 @@ void EditorView::GutterView::setOffset(KDCoordinate offset) {
KDSize EditorView::GutterView::minimalSizeForOptimalDisplay() const { KDSize EditorView::GutterView::minimalSizeForOptimalDisplay() const {
int numberOfChars = 2; // TODO: Could be computed int numberOfChars = 2; // TODO: Could be computed
return KDSize(2 * k_margin + numberOfChars * Poincare::Preferences::sharedPreferences()->KDPythonFont()->glyphSize().width(), 0); return KDSize(2 * k_margin + numberOfChars * m_font->glyphSize().width(), 0);
} }
} }

View File

@@ -3,6 +3,7 @@
#include <escher/palette.h> #include <escher/palette.h>
#include <ion/unicode/utf8_helper.h> #include <ion/unicode/utf8_helper.h>
#include <python/port/port.h> #include <python/port/port.h>
#include "../global_preferences.h"
extern "C" { extern "C" {
#include "py/nlr.h" #include "py/nlr.h"
@@ -444,6 +445,11 @@ void PythonTextArea::addAutocompletion() {
} }
bool PythonTextArea::addAutocompletionTextAtIndex(int nextIndex, int * currentIndexToUpdate) { bool PythonTextArea::addAutocompletionTextAtIndex(int nextIndex, int * currentIndexToUpdate) {
// If Autocomplete disable, skip this step
if(!GlobalPreferences::sharedGlobalPreferences()->autocomplete()) {
return false;
}
// The variable box should be loaded at this point // The variable box should be loaded at this point
const char * autocompletionTokenBeginning = nullptr; const char * autocompletionTokenBeginning = nullptr;
const char * autocompletionLocation = const_cast<char *>(cursorLocation()); const char * autocompletionLocation = const_cast<char *>(cursorLocation());

View File

@@ -135,6 +135,173 @@ const ToolboxMessageTree MatplotlibPyplotModuleChildren[] = {
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandColorGray, I18n::Message::PythonColorGray, false) ToolboxMessageTree::Leaf(I18n::Message::PythonCommandColorGray, I18n::Message::PythonColorGray, false)
}; };
#if defined(INCLUDE_ULAB)
const ToolboxMessageTree NumpyNdarrayModuleChildren[] = {
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyArray),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyArange),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyConcatenate),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyDiag),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyZeros),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyOnes),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyEmpty),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyEye),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyFull),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyLinspace),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyLogspace),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyFromBuffer),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyCopy, I18n::Message::Default, false, I18n::Message::PythonCommandNumpyCopyWithoutArg),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyDtype, I18n::Message::Default, false, I18n::Message::PythonCommandNumpyDtypeWithoutArg),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyFlat, I18n::Message::Default, false, I18n::Message::PythonCommandNumpyFlatWithoutArg),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyFlatten, I18n::Message::Default, false, I18n::Message::PythonCommandNumpyFlattenWithoutArg),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyShape, I18n::Message::Default, false, I18n::Message::PythonCommandNumpyShapeWithoutArg),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyReshape, I18n::Message::Default, false, I18n::Message::PythonCommandNumpyReshapeWithoutArg),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpySize, I18n::Message::Default, false, I18n::Message::PythonCommandNumpySizeWithoutArg),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyTranspose, I18n::Message::Default, false, I18n::Message::PythonCommandNumpyTransposeWithoutArg),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpySort, I18n::Message::Default, false, I18n::Message::PythonCommandNumpySortWithoutArg),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyToBytes, I18n::Message::Default, false, I18n::Message::PythonCommandNumpyToBytesWithoutArg)
};
const ToolboxMessageTree NumpyFunctionsModuleChildren[] = {
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyNdinfo),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyAll),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyAny),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyArgmax),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyArgmin),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyArgsort),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyClip),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyConvolve),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyDiff),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyInterp),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyDot),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyCross),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyEqual),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyNot_equal),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyFlip),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyIsfinite),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyIsinf),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyMean),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyMin),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyMax),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyMedian),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyMinimum),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyMaximum),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyPolyfit),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyPolyval),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyRoll),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpySortWithArguments),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyStd),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpySum),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyTrace),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyTrapz),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyWhere),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyVectorize),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyAcos),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyAcosh),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyArctan2),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyAround),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyAsin),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyAsinh),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyAtan),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyAtanh),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyCeil),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyCos),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyCosh),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyDegrees),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyExp),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyExpm1),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyFloor),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyLog),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyLog10),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyLog2),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyRadians),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpySin),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpySinh),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpySqrt),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyTan),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyTanh),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyBool),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyFloat),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyUint8),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyInt8),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyUint16),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyInt16),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyNan),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyInf),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyE),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyPi),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpySetPrintOptions),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyGetPrintOptions)
};
const ToolboxMessageTree NumpyFftModuleChildren[] = {
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyFftFunction, I18n::Message::PythonNumpyFftFunction, false, I18n::Message::PythonCommandNumpyFftFunctionWithoutArg),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyFft),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyIfft)
};
const ToolboxMessageTree NumpyLinalgModuleChildren[] = {
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyLinalgFunction, I18n::Message::PythonNumpyLinalgFunction, false, I18n::Message::PythonCommandNumpyLinalgFunctionWithoutArg),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyDet),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyEig),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyCholesky),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyInv),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyNorm)
};
const ToolboxMessageTree NumpyModuleChildren[] = {
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandImportFromNumpy, I18n::Message::PythonImportNumpy, false),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyFunction, I18n::Message::PythonNumpyFunction, false, I18n::Message::PythonCommandNumpyFunctionWithoutArg),
ToolboxMessageTree::Node(I18n::Message::NumpyNdarray, NumpyNdarrayModuleChildren),
ToolboxMessageTree::Node(I18n::Message::Functions, NumpyFunctionsModuleChildren),
ToolboxMessageTree::Node(I18n::Message::NumpyFftModule, NumpyFftModuleChildren),
ToolboxMessageTree::Node(I18n::Message::NumpyLinalgModule, NumpyLinalgModuleChildren)
};
const ToolboxMessageTree ScipyLinalgModuleChildren[] = {
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandScipyLinalgFunction, I18n::Message::PythonScipyLinalgFunction, false, I18n::Message::PythonCommandScipyLinalgFunctionWithoutArg),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandScipyLinalgChoSolve),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandScipyLinalgSolveTriangular)
};
const ToolboxMessageTree ScipyOptimizeModuleChildren[] = {
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandScipyOptimizeFunction, I18n::Message::PythonScipyOptimizeFunction, false, I18n::Message::PythonCommandScipyOptimizeFunctionWithoutArg),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandScipyOptimizeBisect),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandScipyOptimizeFmin),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandScipyOptimizeNewton)
};
const ToolboxMessageTree ScipySignalModuleChildren[] = {
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandScipySignalFunction, I18n::Message::PythonScipySignalFunction, false, I18n::Message::PythonCommandScipySignalFunctionWithoutArg),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandScipySignalSosfilt),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandScipySignalSpectrogram)
};
const ToolboxMessageTree ScipySpecialModuleChildren[] = {
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandScipySpecialFunction, I18n::Message::PythonScipySpecialFunction, false, I18n::Message::PythonCommandScipySpecialFunctionWithoutArg),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandScipySpecialErf),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandScipySpecialErfc),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandScipySpecialGamma),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandScipySpecialGammaln),
};
const ToolboxMessageTree ScipyModuleChildren[] = {
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandImportFromScipy, I18n::Message::PythonImportScipy, false),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandScipyFunction, I18n::Message::PythonScipyFunction, false, I18n::Message::PythonCommandScipyFunctionWithoutArg),
ToolboxMessageTree::Node(I18n::Message::ScipyLinalgModule, ScipyLinalgModuleChildren),
ToolboxMessageTree::Node(I18n::Message::ScipyOptimizeModule, ScipyOptimizeModuleChildren),
ToolboxMessageTree::Node(I18n::Message::ScipySignalModule, ScipySignalModuleChildren),
ToolboxMessageTree::Node(I18n::Message::ScipySpecialModule, ScipySpecialModuleChildren),
};
const ToolboxMessageTree UlabModuleChildren[] = {
ToolboxMessageTree::Node(I18n::Message::NumpyModule, NumpyModuleChildren),
ToolboxMessageTree::Node(I18n::Message::ScipyModule, ScipyModuleChildren),
ToolboxMessageTree::Leaf(I18n::Message::UlabDocumentation, I18n::Message::UlabDocumentationLink)
};
#endif
const ToolboxMessageTree TurtleModuleChildren[] = { const ToolboxMessageTree TurtleModuleChildren[] = {
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandImportTurtle, I18n::Message::PythonImportTurtle, false), ToolboxMessageTree::Leaf(I18n::Message::PythonCommandImportTurtle, I18n::Message::PythonImportTurtle, false),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandImportFromTurtle, I18n::Message::PythonImportTurtle, false), ToolboxMessageTree::Leaf(I18n::Message::PythonCommandImportFromTurtle, I18n::Message::PythonImportTurtle, false),
@@ -194,14 +361,21 @@ const ToolboxMessageTree KandinskyModuleChildren[] = {
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandColor, I18n::Message::PythonColor), ToolboxMessageTree::Leaf(I18n::Message::PythonCommandColor, I18n::Message::PythonColor),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandDrawString, I18n::Message::PythonDrawString), ToolboxMessageTree::Leaf(I18n::Message::PythonCommandDrawString, I18n::Message::PythonDrawString),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandDrawLine, I18n::Message::PythonDrawLine), ToolboxMessageTree::Leaf(I18n::Message::PythonCommandDrawLine, I18n::Message::PythonDrawLine),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandFillRect, I18n::Message::PythonFillRect) ToolboxMessageTree::Leaf(I18n::Message::PythonCommandDrawCircle, I18n::Message::PythonDrawCircle),
}; ToolboxMessageTree::Leaf(I18n::Message::PythonCommandFillRect, I18n::Message::PythonFillRect),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandFillCircle, I18n::Message::PythonFillCircle),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandFillPolygon, I18n::Message::PythonFillPolygon),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandGetKeys, I18n::Message::PythonGetKeys),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandGetPalette, I18n::Message::PythonGetPalette)};
const ToolboxMessageTree IonModuleChildren[] = { const ToolboxMessageTree IonModuleChildren[] = {
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandImportIon, I18n::Message::PythonImportIon, false), ToolboxMessageTree::Leaf(I18n::Message::PythonCommandImportIon, I18n::Message::PythonImportIon, false),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandImportFromIon, I18n::Message::PythonImportIon, false), ToolboxMessageTree::Leaf(I18n::Message::PythonCommandImportFromIon, I18n::Message::PythonImportIon, false),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandIonFunction, I18n::Message::PythonIonFunction, false, I18n::Message::PythonCommandIonFunctionWithoutArg), ToolboxMessageTree::Leaf(I18n::Message::PythonCommandIonFunction, I18n::Message::PythonIonFunction, false, I18n::Message::PythonCommandIonFunctionWithoutArg),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandIsKeyDown, I18n::Message::PythonIsKeyDown), ToolboxMessageTree::Leaf(I18n::Message::PythonCommandIsKeyDown, I18n::Message::PythonIsKeyDown),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandBattery, I18n::Message::PythonBattery),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandBatteryLevel, I18n::Message::PythonBatteryLevel),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandBatteryIscharging, I18n::Message::PythonBatteryIscharging),
ToolboxMessageTree::Leaf(I18n::Message::IonSelector, I18n::Message::IonSelector) ToolboxMessageTree::Leaf(I18n::Message::IonSelector, I18n::Message::IonSelector)
}; };
@@ -209,8 +383,14 @@ const ToolboxMessageTree TimeModuleChildren[] = {
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandImportTime, I18n::Message::PythonImportTime, false), ToolboxMessageTree::Leaf(I18n::Message::PythonCommandImportTime, I18n::Message::PythonImportTime, false),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandImportFromTime, I18n::Message::PythonImportTime, false), ToolboxMessageTree::Leaf(I18n::Message::PythonCommandImportFromTime, I18n::Message::PythonImportTime, false),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandTimeFunction, I18n::Message::PythonTimeFunction, false, I18n::Message::PythonCommandTimeFunctionWithoutArg), ToolboxMessageTree::Leaf(I18n::Message::PythonCommandTimeFunction, I18n::Message::PythonTimeFunction, false, I18n::Message::PythonCommandTimeFunctionWithoutArg),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandTime, I18n::Message::PythonTime),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandMonotonic, I18n::Message::PythonMonotonic, false), ToolboxMessageTree::Leaf(I18n::Message::PythonCommandMonotonic, I18n::Message::PythonMonotonic, false),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandSleep, I18n::Message::PythonSleep) ToolboxMessageTree::Leaf(I18n::Message::PythonCommandSleep, I18n::Message::PythonSleep),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandLocalTime, I18n::Message::PythonLocalTime),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandMktime, I18n::Message::PythonMktime),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandSetLocaltime, I18n::Message::PythonSetLocaltime),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandRTCmode, I18n::Message::PythonRTCmode),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandSetRTCmode, I18n::Message::PythonSetRTCmode),
}; };
const ToolboxMessageTree OsModuleChildren[] = { const ToolboxMessageTree OsModuleChildren[] = {
@@ -223,15 +403,31 @@ const ToolboxMessageTree OsModuleChildren[] = {
ToolboxMessageTree::Leaf(I18n::Message::PythonOsCommandListdir, I18n::Message::PythonOsListdir, false) ToolboxMessageTree::Leaf(I18n::Message::PythonOsCommandListdir, I18n::Message::PythonOsListdir, false)
}; };
const ToolboxMessageTree SysModuleChildren[] = {
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandImportSys, I18n::Message::PythonImportSys, false),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandImportFromSys, I18n::Message::PythonImportSys, false),
ToolboxMessageTree::Leaf(I18n::Message::PythonSysCommandExit, I18n::Message::PythonSysExit, false),
ToolboxMessageTree::Leaf(I18n::Message::PythonSysCommandPrintexception, I18n::Message::PythonSysPrintexception, false, I18n::Message::PythonSysCommandPrintexceptionWithoutArg),
ToolboxMessageTree::Leaf(I18n::Message::PythonSysCommandByteorder, I18n::Message::PythonSysByteorder, false),
ToolboxMessageTree::Leaf(I18n::Message::PythonSysCommandImplementation, I18n::Message::PythonSysImplementation, false),
ToolboxMessageTree::Leaf(I18n::Message::PythonSysCommandModules, I18n::Message::PythonSysModules, false),
ToolboxMessageTree::Leaf(I18n::Message::PythonSysCommandVersion, I18n::Message::PythonSysVersion, false),
ToolboxMessageTree::Leaf(I18n::Message::PythonSysCommandVersioninfo, I18n::Message::PythonSysVersioninfo, false)
};
const ToolboxMessageTree modulesChildren[] = { const ToolboxMessageTree modulesChildren[] = {
ToolboxMessageTree::Node(I18n::Message::MathModule, MathModuleChildren), ToolboxMessageTree::Node(I18n::Message::MathModule, MathModuleChildren),
ToolboxMessageTree::Node(I18n::Message::CmathModule, CMathModuleChildren), ToolboxMessageTree::Node(I18n::Message::CmathModule, CMathModuleChildren),
ToolboxMessageTree::Node(I18n::Message::MatplotlibPyplotModule, MatplotlibPyplotModuleChildren), ToolboxMessageTree::Node(I18n::Message::MatplotlibPyplotModule, MatplotlibPyplotModuleChildren),
#if defined(INCLUDE_ULAB)
ToolboxMessageTree::Node(I18n::Message::UlabModule, UlabModuleChildren),
#endif
ToolboxMessageTree::Node(I18n::Message::TurtleModule, TurtleModuleChildren), ToolboxMessageTree::Node(I18n::Message::TurtleModule, TurtleModuleChildren),
ToolboxMessageTree::Node(I18n::Message::RandomModule, RandomModuleChildren), ToolboxMessageTree::Node(I18n::Message::RandomModule, RandomModuleChildren),
ToolboxMessageTree::Node(I18n::Message::KandinskyModule, KandinskyModuleChildren), ToolboxMessageTree::Node(I18n::Message::KandinskyModule, KandinskyModuleChildren),
ToolboxMessageTree::Node(I18n::Message::IonModule, IonModuleChildren), ToolboxMessageTree::Node(I18n::Message::IonModule, IonModuleChildren),
ToolboxMessageTree::Node(I18n::Message::OsModule, OsModuleChildren), ToolboxMessageTree::Node(I18n::Message::OsModule, OsModuleChildren),
ToolboxMessageTree::Node(I18n::Message::SysModule, SysModuleChildren),
ToolboxMessageTree::Node(I18n::Message::TimeModule, TimeModuleChildren) ToolboxMessageTree::Node(I18n::Message::TimeModule, TimeModuleChildren)
}; };
@@ -273,6 +469,7 @@ const ToolboxMessageTree catalogChildren[] = {
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandCosh, I18n::Message::PythonCosh), ToolboxMessageTree::Leaf(I18n::Message::PythonCommandCosh, I18n::Message::PythonCosh),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandDegrees, I18n::Message::PythonDegrees), ToolboxMessageTree::Leaf(I18n::Message::PythonCommandDegrees, I18n::Message::PythonDegrees),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandDivMod, I18n::Message::PythonDivMod), ToolboxMessageTree::Leaf(I18n::Message::PythonCommandDivMod, I18n::Message::PythonDivMod),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandDrawCircle, I18n::Message::PythonDrawCircle),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandDrawLine, I18n::Message::PythonDrawLine), ToolboxMessageTree::Leaf(I18n::Message::PythonCommandDrawLine, I18n::Message::PythonDrawLine),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandDrawString, I18n::Message::PythonDrawString), ToolboxMessageTree::Leaf(I18n::Message::PythonCommandDrawString, I18n::Message::PythonDrawString),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandConstantE, I18n::Message::PythonConstantE, false), ToolboxMessageTree::Leaf(I18n::Message::PythonCommandConstantE, I18n::Message::PythonConstantE, false),
@@ -282,6 +479,8 @@ const ToolboxMessageTree catalogChildren[] = {
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandExp, I18n::Message::PythonExp), ToolboxMessageTree::Leaf(I18n::Message::PythonCommandExp, I18n::Message::PythonExp),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandExpm1, I18n::Message::PythonExpm1), ToolboxMessageTree::Leaf(I18n::Message::PythonCommandExpm1, I18n::Message::PythonExpm1),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandFabs, I18n::Message::PythonFabs), ToolboxMessageTree::Leaf(I18n::Message::PythonCommandFabs, I18n::Message::PythonFabs),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandFillCircle, I18n::Message::PythonFillCircle),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandFillPolygon, I18n::Message::PythonFillPolygon),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandFillRect, I18n::Message::PythonFillRect), ToolboxMessageTree::Leaf(I18n::Message::PythonCommandFillRect, I18n::Message::PythonFillRect),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandFloat, I18n::Message::PythonFloat), ToolboxMessageTree::Leaf(I18n::Message::PythonCommandFloat, I18n::Message::PythonFloat),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandFloor, I18n::Message::PythonFloor), ToolboxMessageTree::Leaf(I18n::Message::PythonCommandFloor, I18n::Message::PythonFloor),
@@ -324,6 +523,7 @@ const ToolboxMessageTree catalogChildren[] = {
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandIsNaN, I18n::Message::PythonIsNaN), ToolboxMessageTree::Leaf(I18n::Message::PythonCommandIsNaN, I18n::Message::PythonIsNaN),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandKandinskyFunction, I18n::Message::PythonKandinskyFunction, false, I18n::Message::PythonCommandKandinskyFunctionWithoutArg), ToolboxMessageTree::Leaf(I18n::Message::PythonCommandKandinskyFunction, I18n::Message::PythonKandinskyFunction, false, I18n::Message::PythonCommandKandinskyFunctionWithoutArg),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandIsKeyDown, I18n::Message::PythonIsKeyDown), ToolboxMessageTree::Leaf(I18n::Message::PythonCommandIsKeyDown, I18n::Message::PythonIsKeyDown),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandBattery, I18n::Message::PythonBattery),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandLdexp, I18n::Message::PythonLdexp), ToolboxMessageTree::Leaf(I18n::Message::PythonCommandLdexp, I18n::Message::PythonLdexp),
ToolboxMessageTree::Leaf(I18n::Message::PythonTurtleCommandLeft, I18n::Message::PythonTurtleLeft), ToolboxMessageTree::Leaf(I18n::Message::PythonTurtleCommandLeft, I18n::Message::PythonTurtleLeft),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandLength, I18n::Message::PythonLength), ToolboxMessageTree::Leaf(I18n::Message::PythonCommandLength, I18n::Message::PythonLength),
@@ -493,8 +693,13 @@ KDCoordinate PythonToolbox::rowHeight(int j) {
} }
bool PythonToolbox::selectLeaf(int selectedRow) { bool PythonToolbox::selectLeaf(int selectedRow) {
m_selectableTableView.deselectTable();
ToolboxMessageTree * node = (ToolboxMessageTree *)m_messageTreeModel->childAtIndex(selectedRow); ToolboxMessageTree * node = (ToolboxMessageTree *)m_messageTreeModel->childAtIndex(selectedRow);
#if defined(INCLUDE_ULAB)
if(node->text() == I18n::Message::UlabDocumentationLink){
return true;
}
#endif
m_selectableTableView.deselectTable();
if(node->insertedText() == I18n::Message::IonSelector){ if(node->insertedText() == I18n::Message::IonSelector){
m_ionKeys.setSender(sender()); m_ionKeys.setSender(sender());
Container::activeApp()->displayModalViewController(static_cast<ViewController*>(&m_ionKeys), 0.f, 0.f, Metric::PopUpTopMargin, Metric::PopUpLeftMargin, 0, Metric::PopUpRightMargin); Container::activeApp()->displayModalViewController(static_cast<ViewController*>(&m_ionKeys), 0.f, 0.f, Metric::PopUpTopMargin, Metric::PopUpLeftMargin, 0, Metric::PopUpRightMargin);

View File

@@ -21,10 +21,10 @@ void ScriptNodeCell::ScriptNodeView::drawRect(KDContext * ctx, KDRect rect) cons
const int nodeNameLength = m_scriptNode->nameLength(); const int nodeNameLength = m_scriptNode->nameLength();
KDSize nameSize = k_font->stringSize(nodeName, nodeNameLength); KDSize nameSize = k_font->stringSize(nodeName, nodeNameLength);
const KDCoordinate nodeNameY = k_topMargin; const KDCoordinate nodeNameY = k_topMargin;
ctx->drawString(nodeName, KDPoint(0, nodeNameY), k_font, KDColorBlack, backgroundColor, nodeNameLength); ctx->drawString(nodeName, KDPoint(0, nodeNameY), k_font, Palette::PrimaryText, backgroundColor, nodeNameLength);
// If it is needed, draw the parentheses // If it is needed, draw the parentheses
if (m_scriptNode->type() == ScriptNode::Type::WithParentheses) { if (m_scriptNode->type() == ScriptNode::Type::WithParentheses) {
ctx->drawString(ScriptNodeCell::k_parentheses, KDPoint(nameSize.width(), nodeNameY), k_font, KDColorBlack, backgroundColor); ctx->drawString(ScriptNodeCell::k_parentheses, KDPoint(nameSize.width(), nodeNameY), k_font, Palette::PrimaryText, backgroundColor);
} }
/* If it exists, draw the source name. If it did not fit, we would have put /* If it exists, draw the source name. If it did not fit, we would have put

View File

@@ -8,11 +8,9 @@ bool ScriptStore::ScriptNameIsFree(const char * baseName) {
return ScriptBaseNamed(baseName).isNull(); return ScriptBaseNamed(baseName).isNull();
} }
// Here we add "base" script
ScriptStore::ScriptStore() { ScriptStore::ScriptStore() {
addScriptFromTemplate(ScriptTemplate::Squares());
addScriptFromTemplate(ScriptTemplate::Parabola());
addScriptFromTemplate(ScriptTemplate::Mandelbrot());
addScriptFromTemplate(ScriptTemplate::Polynomial());
} }
void ScriptStore::deleteAllScripts() { void ScriptStore::deleteAllScripts() {

View File

@@ -5,103 +5,9 @@ namespace Code {
constexpr ScriptTemplate emptyScriptTemplate(".py", "\x01" R"(from math import * constexpr ScriptTemplate emptyScriptTemplate(".py", "\x01" R"(from math import *
)"); )");
constexpr ScriptTemplate squaresScriptTemplate("squares.py", "\x01" R"(from math import *
from turtle import *
def squares(angle=0.5):
reset()
L=330
speed(10)
penup()
goto(-L/2,-L/2)
pendown()
for i in range(660):
forward(L)
left(90+angle)
L=L-L*sin(angle*pi/180)
hideturtle())");
constexpr ScriptTemplate mandelbrotScriptTemplate("mandelbrot.py", "\x01" R"(# This script draws a Mandelbrot fractal set
# N_iteration: degree of precision
import kandinsky
def mandelbrot(N_iteration):
for x in range(320):
for y in range(222):
# Compute the mandelbrot sequence for the point c = (c_r, c_i) with start value z = (z_r, z_i)
z = complex(0,0)
# Rescale to fit the drawing screen 320x222
c = complex(3.5*x/319-2.5, -2.5*y/221+1.25)
i = 0
while (i < N_iteration) and abs(z) < 2:
i = i + 1
z = z*z+c
# Choose the color of the dot from the Mandelbrot sequence
rgb = int(255*i/N_iteration)
col = kandinsky.color(int(rgb*0.82),int(rgb*0.13),int(rgb*0.18))
# Draw a pixel colored in 'col' at position (x,y)
kandinsky.set_pixel(x,y,col))");
constexpr ScriptTemplate polynomialScriptTemplate("polynomial.py", "\x01" R"(from math import *
# roots(a,b,c) computes the solutions of the equation a*x**2+b*x+c=0
def roots(a,b,c):
delta = b*b-4*a*c
if delta == 0:
return -b/(2*a)
elif delta > 0:
x_1 = (-b-sqrt(delta))/(2*a)
x_2 = (-b+sqrt(delta))/(2*a)
return x_1, x_2
else:
return None)");
constexpr ScriptTemplate parabolaScriptTemplate("parabola.py", "\x01" R"(from matplotlib.pyplot import *
from math import *
g=9.81
def x(t,v_0,alpha):
return v_0*cos(alpha)*t
def y(t,v_0,alpha,h_0):
return -0.5*g*t**2+v_0*sin(alpha)*t+h_0
def vx(v_0,alpha):
return v_0*cos(alpha)
def vy(t,v_0,alpha):
return -g*t+v_0*sin(alpha)
def t_max(v_0,alpha,h_0):
return (v_0*sin(alpha)+sqrt((v_0**2)*(sin(alpha)**2)+2*g*h_0))/g
def simulation(v_0=15,alpha=pi/4,h_0=2):
tMax=t_max(v_0,alpha,h_0)
accuracy=1/10**(floor(log10(tMax))-1)
T_MAX=floor(tMax*accuracy)+1
X=[x(t/accuracy,v_0,alpha) for t in range(T_MAX)]
Y=[y(t/accuracy,v_0,alpha,h_0) for t in range(T_MAX)]
VX=[vx(v_0,alpha) for t in range(T_MAX)]
VY=[vy(t/accuracy,v_0,alpha) for t in range(T_MAX)]
for i in range(T_MAX):
arrow(X[i],Y[i],VX[i]/accuracy,VY[i]/accuracy)
grid()
show())");
const ScriptTemplate * ScriptTemplate::Empty() { const ScriptTemplate * ScriptTemplate::Empty() {
return &emptyScriptTemplate; return &emptyScriptTemplate;
} }
const ScriptTemplate * ScriptTemplate::Squares() {
return &squaresScriptTemplate;
}
const ScriptTemplate * ScriptTemplate::Mandelbrot() {
return &mandelbrotScriptTemplate;
}
const ScriptTemplate * ScriptTemplate::Polynomial() {
return &polynomialScriptTemplate;
}
const ScriptTemplate * ScriptTemplate::Parabola() {
return &parabolaScriptTemplate;
}
} }

View File

@@ -9,10 +9,6 @@ class ScriptTemplate {
public: public:
constexpr ScriptTemplate(const char * name, const char * value) : m_name(name), m_value(value) {} constexpr ScriptTemplate(const char * name, const char * value) : m_name(name), m_value(value) {}
static const ScriptTemplate * Empty(); static const ScriptTemplate * Empty();
static const ScriptTemplate * Squares();
static const ScriptTemplate * Mandelbrot();
static const ScriptTemplate * Polynomial();
static const ScriptTemplate * Parabola();
const char * name() const { return m_name; } const char * name() const { return m_name; }
const char * content() const { return m_value + Script::StatusSize(); } const char * content() const { return m_value + Script::StatusSize(); }
const char * value() const { return m_value; } const char * value() const { return m_value; }

View File

@@ -4,3 +4,4 @@ Modules = "Module"
LoopsAndTests = "Schleifen und Tests" LoopsAndTests = "Schleifen und Tests"
Files = "Dateien" Files = "Dateien"
Exceptions = "Ausnahmen" Exceptions = "Ausnahmen"
UlabDocumentation = "Dokumentation"

View File

@@ -4,3 +4,4 @@ Modules = "Modules"
LoopsAndTests = "Loops and tests" LoopsAndTests = "Loops and tests"
Files = "Files" Files = "Files"
Exceptions = "Exceptions" Exceptions = "Exceptions"
UlabDocumentation = "Documentation"

View File

@@ -4,3 +4,4 @@ Modules = "Modules"
LoopsAndTests = "Loops and tests" LoopsAndTests = "Loops and tests"
Files = "Files" Files = "Files"
Exceptions = "Exceptions" Exceptions = "Exceptions"
UlabDocumentation = "Documentación"

View File

@@ -4,3 +4,4 @@ Modules = "Modules"
LoopsAndTests = "Boucles et tests" LoopsAndTests = "Boucles et tests"
Files = "Fichiers" Files = "Fichiers"
Exceptions = "Exceptions" Exceptions = "Exceptions"
UlabDocumentation = "Documentation"

View File

@@ -4,3 +4,4 @@ Modules = "Modulok"
LoopsAndTests = "Hurkok és tesztek" LoopsAndTests = "Hurkok és tesztek"
Files = "Fájlok" Files = "Fájlok"
Exceptions = "Kivételek" Exceptions = "Kivételek"
UlabDocumentation = "Dokumentáció"

View File

@@ -4,3 +4,4 @@ Modules = "Moduli"
LoopsAndTests = "Cicli e test" LoopsAndTests = "Cicli e test"
Files = "Files" Files = "Files"
Exceptions = "Exceptions" Exceptions = "Exceptions"
UlabDocumentation = "Documentazione"

View File

@@ -4,3 +4,4 @@ Modules = "Modules"
LoopsAndTests = "Herhalingen en testen" LoopsAndTests = "Herhalingen en testen"
Files = "Files" Files = "Files"
Exceptions = "Exceptions" Exceptions = "Exceptions"
UlabDocumentation = "Documentatie"

View File

@@ -4,3 +4,4 @@ Modules = "Módulos"
LoopsAndTests = "Laços e testes" LoopsAndTests = "Laços e testes"
Files = "Files" Files = "Files"
Exceptions = "Exceptions" Exceptions = "Exceptions"
UlabDocumentation = "Documentação"

View File

@@ -3,9 +3,20 @@ IonModule = "ion"
KandinskyModule = "kandinsky" KandinskyModule = "kandinsky"
MathModule = "math" MathModule = "math"
MatplotlibPyplotModule = "matplotlib.pyplot" MatplotlibPyplotModule = "matplotlib.pyplot"
NumpyModule = "numpy"
NumpyFftModule = "fft"
NumpyLinalgModule = "linalg"
ScipyModule = "scipy"
ScipyLinalgModule = "linalg"
ScipyOptimizeModule = "optimize"
ScipySignalModule = "signal"
ScipySpecialModule = "special"
NumpyNdarray = "ndarray"
OsModule = "os" OsModule = "os"
SysModule = "sys"
TimeModule = "time" TimeModule = "time"
TurtleModule = "turtle" TurtleModule = "turtle"
UlabModule = "ulab"
ForLoopMenu = "For" ForLoopMenu = "For"
IfStatementMenu = "If" IfStatementMenu = "If"
WhileLoopMenu = "While" WhileLoopMenu = "While"
@@ -59,3 +70,4 @@ PythonCommandReturn = "return "
RandomModule = "random" RandomModule = "random"
IonSelector = "Key selector" IonSelector = "Key selector"
PressAKey = "Press a key" PressAKey = "Press a key"
UlabDocumentationLink = "micropython-ulab.readthedocs.io"

View File

@@ -37,10 +37,10 @@ namespace Code {
} }
void toolboxIonKeys::toolboxIonView::drawRect(KDContext * ctx, KDRect rect) const { void toolboxIonKeys::toolboxIonView::drawRect(KDContext * ctx, KDRect rect) const {
ctx->fillRect(rect, Palette::GrayBright); ctx->fillRect(rect, Palette::WallScreen);
ctx->strokeRect(rect, Palette::GrayDark); ctx->strokeRect(rect, Palette::ListCellBorder);
ctx->drawString(I18n::translate(I18n::Message::PressAKey),KDPoint(rect.left()+80, rect.top()+20)); ctx->drawString(I18n::translate(I18n::Message::PressAKey),KDPoint(rect.left()+80, rect.top()+20),KDFont::LargeFont,Palette::PrimaryText,Palette::WallScreen);
} }
View * toolboxIonKeys::view(){ View * toolboxIonKeys::view(){

View File

@@ -43,9 +43,9 @@ public:
private: private:
constexpr static size_t k_maxNumberOfDisplayedItems = (Ion::Display::Height - Metric::TitleBarHeight - Metric::PopUpTopMargin) / ScriptNodeCell::k_simpleItemHeight + 2; // +2 if the cells are cropped on top and at the bottom constexpr static size_t k_maxNumberOfDisplayedItems = (Ion::Display::Height - Metric::TitleBarHeight - Metric::PopUpTopMargin) / ScriptNodeCell::k_simpleItemHeight + 2; // +2 if the cells are cropped on top and at the bottom
constexpr static size_t k_maxScriptNodesCount = 32; // Chosen without particular reasons constexpr static size_t k_maxScriptNodesCount = 64; // Chosen without particular reasons (Number of functions in the variables box)
constexpr static int k_totalBuiltinNodesCount = 107; constexpr static int k_totalBuiltinNodesCount = 107;
constexpr static uint8_t k_scriptOriginsCount = 3; constexpr static uint8_t k_scriptOriginsCount = 8; // Number of scripts loaded in the variable box
constexpr static uint8_t k_subtitleCellType = NodeCellType; // We don't care as it is not selectable constexpr static uint8_t k_subtitleCellType = NodeCellType; // We don't care as it is not selectable
constexpr static uint8_t k_itemCellType = LeafCellType; // So that upper class NestedMenuController knows it's a leaf constexpr static uint8_t k_itemCellType = LeafCellType; // So that upper class NestedMenuController knows it's a leaf
constexpr static KDCoordinate k_subtitleRowHeight = 23; constexpr static KDCoordinate k_subtitleRowHeight = 23;

23
apps/geometry/Makefile Normal file
View File

@@ -0,0 +1,23 @@
apps += Geometry::App
app_headers += apps/geometry/app.h
app_geometry_src = $(addprefix apps/geometry/,\
app.cpp \
list/figures_controller.cpp \
list/definition_type_controller.cpp \
list/figure_type_controller.cpp \
list/figure_parameters_controller.cpp \
list/objects_controller.cpp \
list/message_table_cell_with_selector.cpp \
figure_store.cpp \
graph/graph_controller.cpp \
graph/banner_view.cpp \
)
apps_src += $(app_geometry_src)
app_images += apps/geometry/geometry_icon.png
i18n_files += $(call i18n_with_universal_for,geometry/base)
$(eval $(call depends_on_image,apps/geometry/app.cpp,apps/geometry/geometry_icon.png))

48
apps/geometry/app.cpp Normal file
View File

@@ -0,0 +1,48 @@
#include "app.h"
#include "geometry_icon.h"
#include "apps/apps_container.h"
#include "apps/i18n.h"
namespace Geometry
{
I18n::Message App::Descriptor::name()
{
return I18n::Message::GeometryApp;
}
I18n::Message App::Descriptor::upperName()
{
return I18n::Message::GeometryAppCapital;
}
const Image * App::Descriptor::icon()
{
return ImageStore::GeometryIcon;
}
App * App::Snapshot::unpack(Container * container)
{
return new (container->currentAppBuffer()) App(this);
}
App::Descriptor * App::Snapshot::descriptor()
{
static Descriptor descriptor;
return &descriptor;
}
App::App(Snapshot * snapshot) :
TextFieldDelegateApp(snapshot, &m_tabViewController),
m_figuresController(&m_stackViewController),
m_stackViewController(&m_tabViewController, &m_figuresController),
m_graphController(&m_graphAlternateEmptyViewController, this, &m_graphHeader, nullptr, nullptr, nullptr),
m_graphAlternateEmptyViewController(&m_graphHeader, &m_graphController, &m_graphController),
m_graphHeader(&m_graphStackViewController, &m_graphAlternateEmptyViewController, &m_graphController),
m_graphStackViewController(&m_tabViewController, &m_graphHeader),
m_otherViewController(&m_tabViewController),
m_tabViewController(&m_modalViewController, snapshot, &m_stackViewController, &m_graphAlternateEmptyViewController, &m_otherViewController)
{
}
}

40
apps/geometry/app.h Normal file
View File

@@ -0,0 +1,40 @@
#ifndef GEOMETRY_H
#define GEOMETRY_H
#include <escher.h>
#include "list/figures_controller.h"
#include "graph/graph_controller.h"
#include "other/other_view_controller.h"
#include "../shared/text_field_delegate_app.h"
namespace Geometry {
class App : public Shared::TextFieldDelegateApp {
public:
class Descriptor : public ::App::Descriptor {
public:
I18n::Message name() override;
I18n::Message upperName() override;
const Image * icon() override;
};
class Snapshot : public ::App::Snapshot, public TabViewDataSource {
public:
App * unpack(Container * container) override;
Descriptor * descriptor() override;
};
private:
App(Snapshot * snapshot);
FiguresController m_figuresController;
StackViewController m_stackViewController;
GraphController m_graphController;
AlternateEmptyViewController m_graphAlternateEmptyViewController;
StackViewController m_graphStackViewController;
ButtonRowController m_graphHeader;
OtherViewController m_otherViewController;
TabViewController m_tabViewController;
};
}
#endif

View File

@@ -0,0 +1,6 @@
GeometryApp = "Geometry"
GeometryAppCapital = "GEOMETRY"
AddFigure = "Ajouter une figure"
FigureType = "Type de figure"
DefinitionType = "Définition de la figure"
ParametersChoice = "Choix des paramètres"

View File

@@ -0,0 +1,6 @@
GeometryApp = "Geometry"
GeometryAppCapital = "GEOMETRY"
AddFigure = "Ajouter une figure"
FigureType = "Type de figure"
DefinitionType = "Définition de la figure"
ParametersChoice = "Choix des paramètres"

View File

@@ -0,0 +1,6 @@
GeometryApp = "Geometry"
GeometryAppCapital = "GEOMETRY"
AddFigure = "Ajouter une figure"
FigureType = "Type de figure"
DefinitionType = "Définition de la figure"
ParametersChoice = "Choix des paramètres"

View File

@@ -0,0 +1,6 @@
GeometryApp = "Geometry"
GeometryAppCapital = "GEOMETRY"
AddFigure = "Ajouter une figure"
FigureType = "Type de figure"
DefinitionType = "Définition de la figure"
ParametersChoice = "Choix des paramètres"

View File

@@ -0,0 +1,6 @@
GeometryApp = "Geometry"
GeometryAppCapital = "GEOMETRY"
AddFigure = "Ajouter une figure"
FigureType = "Type de figure"
DefinitionType = "Définition de la figure"
ParametersChoice = "Choix des paramètres"

View File

@@ -0,0 +1,6 @@
GeometryApp = "Geometry"
GeometryAppCapital = "GEOMETRY"
AddFigure = "Ajouter une figure"
FigureType = "Type de figure"
DefinitionType = "Définition de la figure"
ParametersChoice = "Choix des paramètres"

View File

@@ -0,0 +1,6 @@
GeometryApp = "Geometry"
GeometryAppCapital = "GEOMETRY"
AddFigure = "Ajouter une figure"
FigureType = "Type de figure"
DefinitionType = "Définition de la figure"
ParametersChoice = "Choix des paramètres"

View File

@@ -0,0 +1,6 @@
GeometryApp = "Geometry"
GeometryAppCapital = "GEOMETRY"
AddFigure = "Ajouter une figure"
FigureType = "Type de figure"
DefinitionType = "Définition de la figure"
ParametersChoice = "Choix des paramètres"

View File

@@ -0,0 +1,24 @@
FiguresTab = "Figures"
NoFigures = "Aucune figure à afficher"
OtherTab = "TODO"
Coordinates = "Coordonnées"
Middle = "Milieu"
VectorProject = "Projeté vectoriel"
OrthogonalProject = "Projeté orthogonal"
CartesianEquation = "Equation cartésienne"
LinearEquation = "Equation linéaire"
Points = "Points"
PointAndVector = "Point et vecteur"
Parallele = "Parallèle"
Perpendicular = "Perpendiculaire"
PointAndRadius = "Point et rayon"
Diameter = "Diamètre"
TwoPoints = "Deux points"
Segment = "Segment"
Angle = "Angle"
Area = "Surface"
Point = "Point"
Line = "Droite"
Circle = "Cercle"
Vector = "Vecteur"
Indicator = "Indicateur"

View File

@@ -0,0 +1 @@
#include "figure_store.h"

View File

@@ -0,0 +1,14 @@
#ifndef FIGURE__STORE__H
#define FIGURE__STORE__H
#include "../shared/expression_model_store.h"
namespace Geometry {
class FigureStore: Shared::ExpressionModelStore {
};
}
#endif

View File

@@ -0,0 +1,27 @@
#ifndef POINCARE_FIGURE_H
#define POINCARE_FIGURE_H
#include "figure_type.h"
using namespace Poincare;
namespace Geometry {
class FigureNode : public TreeNode {
public:
virtual size_t size() const override = 0;
virtual int numberOfChildren() const override { return 0; }
virtual FigureType type() const = 0;
virtual FigureDefinitionType definitionType() const = 0;
};
class Figure : public TreeHandle {
public:
Figure(const FigureNode * node) : TreeHandle(node) {}
};
}
#endif

View File

@@ -0,0 +1,24 @@
#ifndef GEOMETRY_FIGURE_TYPE_H
#define GEOMETRY_FIGURE_TYPE_H
namespace Geometry {
enum class FigureType {
None = 0, // Used to trigger assert in debug mode
Expression, // It's not a real figure type but we use it to build figures like points
Point,
Line,
Circle,
Vector,
Indicator
};
enum class FigureDefinitionType {
PointByCoordinates
};
}
#endif

View File

@@ -0,0 +1,6 @@
#ifndef FIGURES_H
#define FIGURES_H
#include "point_by_coordinates.h"
#endif

View File

@@ -0,0 +1 @@
#include "point.h"

View File

@@ -0,0 +1,18 @@
#ifndef GEOMETRY_POINT_H
#define GEOMETRY_POINT_H
#include "figure.h"
namespace Geometry {
class PointNode : public FigureNode {
virtual FigureType type() const override { return FigureType::Point; }
};
class Point : public Figure {
public:
Point(const PointNode * n) : Figure(n) {}
};
}
#endif

View File

@@ -0,0 +1,31 @@
#ifndef POINT_BY_COORDINATES_H
#define POINT_BY_COORDINATES_H
#include <poincare/expression.h>
#include "point.h"
namespace Geometry {
class PointByCoordinatesNode : public PointNode {
public:
virtual size_t size() const override { return sizeof(PointByCoordinatesNode); }
virtual int numberOfChildren() const override { return 2; }
virtual FigureDefinitionType definitionType() const override { return FigureDefinitionType::PointByCoordinates; }
#if POINCARE_TREE_LOG
void logNodeName(std::ostream & stream) const override {
stream << "PointByCoordinates";
}
#endif
};
class PointByCoordinates : public Figure {
public:
PointByCoordinates(const PointByCoordinatesNode * n) : Figure(n) {}
static PointByCoordinates Builder(Expression x, Expression y) { return TreeHandle::FixedArityBuilder<PointByCoordinates, PointByCoordinatesNode>({x, x}); }
static int numberOfParameters() { return 2; }
static FigureType parameterTypeAtIndex(int i) { return FigureType::Expression; }
};
}
#endif

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -0,0 +1,15 @@
#include "banner_view.h"
namespace Geometry {
BannerView::BannerView(
Responder * parentResponder,
InputEventHandlerDelegate * inputEventHandlerDelegate,
TextFieldDelegate * textFieldDelegate
) :
Shared::XYBannerView(parentResponder, inputEventHandlerDelegate, textFieldDelegate)
{
}
}

View File

@@ -0,0 +1,15 @@
#ifndef GEOMETRY_BANNER_VIEW_H
#define GEOMETRY_BANNER_VIEW_H
#include "../../shared/xy_banner_view.h"
namespace Geometry {
class BannerView : public Shared::XYBannerView {
public:
BannerView(Responder * parentResponder, InputEventHandlerDelegate * inputEventHandlerDelegate, TextFieldDelegate * textFieldDelegate);
};
}
#endif

View File

@@ -0,0 +1,11 @@
#include "graph_controller.h"
namespace Geometry {
GraphController::GraphController(Responder * parentResponder, InputEventHandlerDelegate * inputEventHandlerDelegate, ButtonRowController * header, Shared::InteractiveCurveViewRange/*TODO -> Store*/ * store, Shared::CurveViewCursor * cursor, uint32_t * rangeVersion) :
InteractiveCurveViewController(parentResponder, inputEventHandlerDelegate, header, store, nullptr, cursor, rangeVersion)
{
/* WHEREIWAS: Now i must make the app launch again without crash, by replacing the multiples nullptr that I used... */
}
}

View File

@@ -0,0 +1,33 @@
#ifndef GRAPH_VIEW_CONTROLLER_H
#define GRAPH_VIEW_CONTROLLER_H
#include "../shared/interactive_curve_view_controller.h"
namespace Geometry {
class GraphController : public Shared::InteractiveCurveViewController {
public:
GraphController(Responder * parentResponder, InputEventHandlerDelegate * inputEventHandlerDelegate, ButtonRowController * header, Shared::InteractiveCurveViewRange * store, Shared::CurveViewCursor * cursor, uint32_t * rangeVersion);
virtual Shared::InteractiveCurveViewRange * interactiveCurveViewRange() override { return nullptr; } //TOIMPLEMENT
virtual Shared::CurveView * curveView() override { return nullptr; } //TOIMPLEMENT
virtual void reloadBannerView() override { } //TOIMPLEMENT
virtual bool handleEnter() override { return false; } //TOIMPLEMENT
virtual void initCursorParameters() override { } //TOIMPLEMENT
virtual bool moveCursorVertically(int direction) override { return false; } //TOIMPLEMENT
virtual uint32_t rangeVersion() override { return 0; } //TOIMPLEMENT
virtual bool cursorMatchesModel() override { return false; } //TOIMPLEMENT
virtual Poincare::Coordinate2D<double> xyValues(int curveIndex, double t, Poincare::Context * context) const override { return Poincare::Coordinate2D<double>(0, 0); } //TOIMPLEMENT
virtual bool closestCurveIndexIsSuitable(int newIndex, int currentIndex) const override { return false; }
virtual int selectedCurveIndex() const override { return 0; }
virtual int numberOfCurves() const override { return 0; }
/* AlternateEmptyViewDefaultDelegate */
virtual bool isEmpty() const override { return false; }
virtual I18n::Message emptyMessage() override { return I18n::Message::NoFigures; }
private:
};
}
#endif

View File

@@ -0,0 +1,147 @@
#include "figure_type_controller.h"
#include "../figures/figures.h"
namespace Geometry {
static constexpr I18n::Message sPointDefinitionsMessages[] = {
I18n::Message::Coordinates,
I18n::Message::Middle,
I18n::Message::VectorProject,
I18n::Message::OrthogonalProject
};
static const uint8_t sPointDefinitionsMessagesCount = sizeof(sPointDefinitionsMessages) / sizeof(I18n::Message);
static constexpr I18n::Message sLineDefinitionMessages[] = {
I18n::Message::CartesianEquation,
I18n::Message::LinearEquation,
I18n::Message::Points,
I18n::Message::PointAndVector,
I18n::Message::Parallele,
I18n::Message::Perpendicular
};
static const uint8_t sLineDefinitionsMessagesCount = sizeof(sLineDefinitionMessages) / sizeof(I18n::Message);
static constexpr I18n::Message sCircleDefinitionsMessages[] = {
I18n::Message::PointAndRadius,
I18n::Message::Diameter,
I18n::Message::CartesianEquation,
};
static const uint8_t sCircleDefinitionsMessagesCount = sizeof(sCircleDefinitionsMessages) / sizeof(I18n::Message);
static constexpr I18n::Message sVectorDefinitionsMessages[] = {
I18n::Message::Coordinates,
I18n::Message::TwoPoints
};
static const uint8_t sVectorDefinitionsMessagesCount = sizeof(sVectorDefinitionsMessages) / sizeof(I18n::Message);
static constexpr I18n::Message sIndicatorDefinitionsMessages[] = {
I18n::Message::Segment,
I18n::Message::Angle,
I18n::Message::Area,
};
static const uint8_t sIndicatorDefinitionsMessagesCount = sizeof(sIndicatorDefinitionsMessages) / sizeof(I18n::Message);
DefinitionTypeController::DefinitionTypeController(Responder * parentResponder, FigureParametersController * parametersController):
ViewController(parentResponder),
m_lastSelectedRow(0),
m_selectableTableView(this),
m_messages(nullptr),
m_figureType(FigureType::None),
m_parametersController(parametersController)
{
for (int i = 0; i < k_numberOfCells; i ++) {
m_cells[i].setMessageFont(KDFont::LargeFont);
}
}
void DefinitionTypeController::viewWillAppear() {
assert(m_figureType != FigureType::None && m_messages != nullptr);
selectRow(m_lastSelectedRow);
m_selectableTableView.reloadData(); // We reload the cell of the table view to update their message
}
void DefinitionTypeController::didBecomeFirstResponder() {
//App::app()->snapshot()->setActivePage(App::Snapshot::Page::Distribution);
Container::activeApp()->setFirstResponder(&m_selectableTableView);
}
bool DefinitionTypeController::handleEvent(Ion::Events::Event event) {
if (event == Ion::Events::OK || event == Ion::Events::EXE || event == Ion::Events::Right) {
m_lastSelectedRow = selectedRow();
StackViewController * stack = static_cast<StackViewController *>(parentResponder());
m_parametersController->setParametersInfoFunctions(PointByCoordinates::numberOfParameters, PointByCoordinates::parameterTypeAtIndex);
stack->push(m_parametersController);
return true;
}
if (event == Ion::Events::Back) {
StackViewController * stack = static_cast<StackViewController *>(parentResponder());
stack->pop();
return true;
}
return false;
}
HighlightCell * DefinitionTypeController::reusableCell(int index) {
assert(index >= 0);
assert(index < k_numberOfCells);
return &m_cells[index];
}
void DefinitionTypeController::willDisplayCellForIndex(HighlightCell * cell, int index) {
MessageTableCellWithChevron * myCell = (MessageTableCellWithChevron *)cell;
myCell->setMessage(m_messages[index]);
}
int DefinitionTypeController::numberOfRows() const {
switch (m_figureType) {
case FigureType::Point:
return sPointDefinitionsMessagesCount;
break;
case FigureType::Line:
return sLineDefinitionsMessagesCount;
break;
case FigureType::Circle:
return sCircleDefinitionsMessagesCount;
break;
case FigureType::Vector:
return sVectorDefinitionsMessagesCount;
break;
case FigureType::Indicator:
return sIndicatorDefinitionsMessagesCount;
break;
default:
assert(false);
return 0;
}
}
void DefinitionTypeController::setFigureType(FigureType figureType) {
m_figureType = figureType;
switch (m_figureType) {
case FigureType::Point:
m_messages = sPointDefinitionsMessages;
break;
case FigureType::Line:
m_messages = sLineDefinitionMessages;
break;
case FigureType::Circle:
m_messages = sCircleDefinitionsMessages;
break;
case FigureType::Vector:
m_messages = sVectorDefinitionsMessages;
break;
case FigureType::Indicator:
m_messages = sIndicatorDefinitionsMessages;
break;
default:
assert(false);
break;
}
}
}

View File

@@ -0,0 +1,53 @@
#ifndef GEOMETRY_DEFINITION_TYPE_CONTROLLER_H
#define GEOMETRY_DEFINITION_TYPE_CONTROLLER_H
#include <escher.h>
#include "apps/i18n.h"
#include "../figures/figure_type.h"
#include "figure_parameters_controller.h"
namespace Geometry {
/**
* \brief DefinitionTypeController is a controller to choose how the figure is defined
*/
class DefinitionTypeController : public ViewController, public SimpleListViewDataSource, public SelectableTableViewDataSource {
public:
DefinitionTypeController(Responder * parentResponder, FigureParametersController * parametersController);
/* ViewController */
View * view() override { return &m_selectableTableView; }
// We want to avoid using half of the screen just for titles
virtual DisplayParameter displayParameter() override { return DisplayParameter::DoNotShowOwnTitle; }
const char * title() override { return I18n::translate(I18n::Message::DefinitionType); }
/* Responder */
bool handleEvent(Ion::Events::Event event) override;
/* ViewController */
void didBecomeFirstResponder() override;
void viewWillAppear() override;
TELEMETRY_ID("FigureType");
/* SelectableTableViewDataSource */
int numberOfRows() const override;
void willDisplayCellForIndex(HighlightCell * cell, int index) override;
KDCoordinate cellHeight() override { return k_cellHeight; }
HighlightCell * reusableCell(int index) override;
int reusableCellCount() const override { return k_numberOfCells; }
/* Customs methods */
void setFigureType(FigureType type);
private:
constexpr static KDCoordinate k_cellHeight = Metric::ParameterCellHeight;
constexpr static int k_numberOfCells = 6;
int m_lastSelectedRow;
MessageTableCellWithChevron m_cells[k_numberOfCells];
SelectableTableView m_selectableTableView;
const I18n::Message * m_messages;
FigureType m_figureType;
FigureParametersController * m_parametersController;
};
}
#endif

View File

@@ -0,0 +1,114 @@
#include "figure_parameters_controller.h"
#include "../app.h"
namespace Geometry {
FigureParametersController::FigureParametersController(Responder * parentResponder):
ViewController(parentResponder),
m_lastSelectedRow(0),
m_selectableTableView(this),
m_okButton(&m_selectableTableView, I18n::Message::Ok, Invocation([](void * context, void * sender) {
FigureParametersController * parameterController = (FigureParametersController *) context;
parameterController->returnToMenu();
return true;
}, this))
{
for (int i = 0; i < k_choiceCells; i++) {
m_choicesCells[i].setParentResponder(&m_selectableTableView);
}
for (int i = 0; i < k_textCells; i++) {
m_textCells[i].setParentResponder(&m_selectableTableView);
m_textCells[i].textField()->setDelegates(this, this);
}
}
void FigureParametersController::setParametersInfoFunctions(NumberOfParametersFunction numberOfParametersFunction, TypeOfParametersAtIndexFunction typeOfParametersAtIndexFunction) {
m_numberOfParametersFunction = numberOfParametersFunction;
m_typeOfParametersAtIndexFunction = typeOfParametersAtIndexFunction;
}
void FigureParametersController::didBecomeFirstResponder() {
Container::activeApp()->setFirstResponder(&m_selectableTableView);
}
void FigureParametersController::viewWillAppear() {
selectRow(m_lastSelectedRow);
}
void FigureParametersController::returnToMenu() {
StackViewController * stack = static_cast<StackViewController *>(parentResponder());
stack->pop();
stack->pop();
stack->pop();
}
/* ListViewDataSource */
int FigureParametersController::typeAtLocation(int i, int j) {
if (j == m_numberOfParametersFunction()) {
return 0; // It's equivalent to "None", so we can use it for button cell
}
return (int) m_typeOfParametersAtIndexFunction(j);
}
int FigureParametersController::reusableCellCount(int type) {
if (type == 0) {
return 1;
}
return type == (int) FigureType::Expression ? k_textCells: k_choiceCells;
}
HighlightCell * FigureParametersController::reusableCell(int index, int type) {
if (type == 0) {
return &m_okButton;
}
if (type == (int) FigureType::Expression) {
return &m_textCells[index];
}
return &m_choicesCells[index];
}
int FigureParametersController::numberOfRows() const {
return m_numberOfParametersFunction() + 1;
}
KDCoordinate FigureParametersController::rowHeight(int j) {
if (j == numberOfRows()-1) {
return Metric::ParameterCellHeight+k_buttonMargin;
}
return Metric::ParameterCellHeight;
}
KDCoordinate FigureParametersController::cumulatedHeightFromIndex(int j) {
if (j == numberOfRows()) {
return j*Metric::ParameterCellHeight+k_buttonMargin;
}
return Metric::ParameterCellHeight*j;
}
int FigureParametersController::indexFromCumulatedHeight(KDCoordinate offsetY) {
return (offsetY - 1) / Metric::ParameterCellHeight;
}
void FigureParametersController::willDisplayCellForIndex(HighlightCell * cell, int index) {
}
bool FigureParametersController::textFieldShouldFinishEditing(TextField * textField, Ion::Events::Event event) {
return (event == Ion::Events::Down && selectedRow() < numberOfRows()-1)
|| (event == Ion::Events::Up && selectedRow() > 0)
|| TextFieldDelegate::textFieldShouldFinishEditing(textField, event);
}
bool FigureParametersController::textFieldDidFinishEditing(TextField * textField, const char * text, Ion::Events::Event event) {
m_selectableTableView.reloadCellAtLocation(0, selectedRow());
m_selectableTableView.reloadData();
textField->setText(text);
if (event == Ion::Events::EXE || event == Ion::Events::OK) {
m_selectableTableView.selectCellAtLocation(selectedColumn(), selectedRow() + 1);
} else {
m_selectableTableView.handleEvent(event);
}
return true;
}
}

View File

@@ -0,0 +1,64 @@
#ifndef GEOMETRY_FIGURE_PARAMETERS_CONTROLLER_H
#define GEOMETRY_FIGURE_PARAMETERS_CONTROLLER_H
#include <escher.h>
#include "apps/i18n.h"
#include "message_table_cell_with_selector.h"
#include "../figures/figure.h"
#include "../../shared/parameter_text_field_delegate.h"
#include "../../shared/input_event_handler_delegate.h"
#include "../../shared/button_with_separator.h"
namespace Geometry {
typedef int (*NumberOfParametersFunction)();
typedef FigureType (*TypeOfParametersAtIndexFunction)(int);
/**
* \brief Controller returning the parameter choosen by the user to define the figure
*/
class FigureParametersController : public ViewController, public ListViewDataSource, public SelectableTableViewDataSource, public Shared::ParameterTextFieldDelegate, public Shared::InputEventHandlerDelegate {
public:
FigureParametersController(Responder * parentResponder);
void setParametersInfoFunctions(NumberOfParametersFunction numberOfParametersFunction, TypeOfParametersAtIndexFunction typeOfParametersAtIndexFunction);
void returnToMenu();
/* ViewController */
const char * title() override { return I18n::translate(I18n::Message::ParametersChoice); }
// We want to avoid using half of the screen just for titles
virtual DisplayParameter displayParameter() override { return DisplayParameter::DoNotShowOwnTitle; }
View * view() override { return &m_selectableTableView; };
/* Responder */
void didBecomeFirstResponder() override;
void viewWillAppear() override;
/* ListViewDataSource */
int typeAtLocation(int i, int j) override;
int reusableCellCount(int type) override; // TO IMPLEMENT
HighlightCell * reusableCell(int index, int type) override;
int numberOfRows() const override;
KDCoordinate rowHeight(int j) override;
KDCoordinate cumulatedHeightFromIndex(int j) override;
int indexFromCumulatedHeight(KDCoordinate offsetY) override;
void willDisplayCellForIndex(HighlightCell * cell, int index) override;
/* InputEventHandlerDelegate */
bool textFieldShouldFinishEditing(TextField * textField, Ion::Events::Event event) override;
bool textFieldDidFinishEditing(TextField * textField, const char * text, Ion::Events::Event event) override;
private:
SelectableTableView m_selectableTableView;
constexpr static int k_textCells = 2;
constexpr static int k_choiceCells = 3;
constexpr static int k_buttonMargin = 6;
int m_lastSelectedRow;
MessageTableCellWithEditableText m_textCells[k_textCells];
MessageTableCellWithSelector m_choicesCells[k_choiceCells];
ButtonWithSeparator m_okButton;
NumberOfParametersFunction m_numberOfParametersFunction;
TypeOfParametersAtIndexFunction m_typeOfParametersAtIndexFunction;
};
}
#endif

View File

@@ -0,0 +1,70 @@
#include "figure_type_controller.h"
#include "apps/i18n.h"
namespace Geometry {
static FigureType sTypes[] = {
FigureType::Point,
FigureType::Line,
FigureType::Circle,
FigureType::Vector,
FigureType::Indicator
};
static I18n::Message sMessages[] = {
I18n::Message::Point,
I18n::Message::Line,
I18n::Message::Circle,
I18n::Message::Vector,
I18n::Message::Indicator
};
FigureTypeController::FigureTypeController(Responder * parentResponder, DefinitionTypeController * definitionTypeController) :
ViewController(parentResponder),
m_lastSelectedRow(0),
m_selectableTableView(this),
m_definitionTypeController(definitionTypeController),
m_messages(sMessages)
{
for (int i = 0; i < k_numberOfCells; i ++) {
m_cells[i].setMessageFont(KDFont::LargeFont);
}
}
void FigureTypeController::viewWillAppear() {
selectRow(m_lastSelectedRow);
}
void FigureTypeController::didBecomeFirstResponder() {
//App::app()->snapshot()->setActivePage(App::Snapshot::Page::Distribution);
Container::activeApp()->setFirstResponder(&m_selectableTableView);
}
bool FigureTypeController::handleEvent(Ion::Events::Event event) {
if (event == Ion::Events::OK || event == Ion::Events::EXE || event == Ion::Events::Right) {
m_lastSelectedRow = selectedRow();
StackViewController * stack = static_cast<StackViewController *>(parentResponder());
m_definitionTypeController->setFigureType(sTypes[selectedRow()]);
stack->push(m_definitionTypeController);
return true;
}
if (event == Ion::Events::Back ) {
StackViewController * stack = static_cast<StackViewController *>(parentResponder());
stack->pop();
return true;
}
return false;
}
HighlightCell * FigureTypeController::reusableCell(int index) {
assert(index >= 0);
assert(index < k_numberOfCells);
return &m_cells[index];
}
void FigureTypeController::willDisplayCellForIndex(HighlightCell * cell, int index) {
MessageTableCellWithChevron * myCell = (MessageTableCellWithChevron *)cell;
myCell->setMessage(m_messages[index]);
}
}

View File

@@ -0,0 +1,49 @@
#ifndef GEOMETRY_FIGURE_TYPE_CONTROLLER_H
#define GEOMETRY_FIGURE_TYPE_CONTROLLER_H
#include <escher.h>
#include "definition_type_controller.h"
namespace Geometry {
/**
* \brief FigureTypeController is a controller that is used to select the type of
* figure to be created.
*/
class FigureTypeController : public ViewController, public SimpleListViewDataSource, public SelectableTableViewDataSource {
public:
FigureTypeController(Responder * parentResponder, DefinitionTypeController * definitionController);
/* ViewController */
View * view() override { return &m_selectableTableView; }
// We want to avoid using half of the screen just for titles
virtual DisplayParameter displayParameter() override { return DisplayParameter::DoNotShowOwnTitle; }
const char * title() override { return I18n::translate(I18n::Message::FigureType); }
/* Responder */
bool handleEvent(Ion::Events::Event event) override;
void didBecomeFirstResponder() override;
/* ViewController */
void viewWillAppear() override;
TELEMETRY_ID("FigureType");
/* TableViewDataSource */
int numberOfRows() const override { return k_numberOfRows; }
void willDisplayCellForIndex(HighlightCell * cell, int index) override;
KDCoordinate cellHeight() override { return k_cellHeight; }
HighlightCell * reusableCell(int index) override;
int reusableCellCount() const override { return k_numberOfCells; }
private:
constexpr static KDCoordinate k_cellHeight = Metric::ParameterCellHeight;
constexpr static int k_numberOfCells = 5;
constexpr static int k_numberOfRows = 5;
int m_lastSelectedRow;
MessageTableCellWithChevron m_cells[k_numberOfCells];
SelectableTableView m_selectableTableView;
DefinitionTypeController * m_definitionTypeController;
I18n::Message * m_messages;
};
}
#endif

View File

@@ -0,0 +1,77 @@
#include "figures_controller.h"
#include "definition_type_controller.h"
#include <apps/i18n.h>
namespace Geometry {
FiguresController::FiguresController(Responder * parentResponder):
ViewController(parentResponder),
m_selectableTableView(this, this, this, this),
m_addFigureCell(),
m_emptyCell(),
m_figureTypeController(this, &m_definitionTypeController),
m_definitionTypeController(&m_figureTypeController, &m_parametersController),
m_parametersController(&m_definitionTypeController)
{
m_addFigureCell.setMessage(I18n::Message::AddFigure);
}
bool FiguresController::handleEvent(Ion::Events::Event event) {
if (event == Ion::Events::OK || event == Ion::Events::EXE) {
if (isAddFigureRow(selectedRow())) {
StackViewController * stack = static_cast<StackViewController *>(parentResponder());
stack->push(&m_figureTypeController);
return true;
}
}
if (event == Ion::Events::Up && selectedRow() == 0) {
m_selectableTableView.deselectTable();
assert(selectedRow() == -1);
Container::activeApp()->setFirstResponder(parentResponder()->parentResponder());
return true;
}
return false;
}
void FiguresController::didBecomeFirstResponder() {
Container::activeApp()->setFirstResponder(&m_selectableTableView);
}
HighlightCell * FiguresController::reusableCell(int index, int type) {
assert(index >= 0);
if (type == 2) {
return &m_emptyCell;
}
return &m_addFigureCell;
}
void FiguresController::willDisplayCellAtLocation(HighlightCell * cell, int i, int j) {
if (i == 0) {
return;
}
EvenOddCell * myCell = (EvenOddCell *)cell;
myCell->setEven(j%2 == 0);
myCell->setHighlighted(i == selectedColumn() && j == selectedRow());
myCell->reloadCell();
}
bool FiguresController::isAddFigureRow(int j) {
return j == 0;
}
int FiguresController::reusableCellCount(int type) {
if (type > 1) {
return 1;
}
return 0;
}
int FiguresController::typeAtLocation(int i, int j) {
if (isAddFigureRow(j)) {
return i + 2;
}
return i;
}
}

View File

@@ -0,0 +1,47 @@
#ifndef FIGURES_CONTROLLER_H
#define FIGURES_CONTROLLER_H
#include <escher.h>
#include "figure_type_controller.h"
namespace Geometry
{
/**
* \brief FiguresController is a controller to show the list of the figures
*/
class FiguresController : public ViewController, public SelectableTableViewDataSource, public SelectableTableViewDelegate, public TableViewDataSource {
public:
FiguresController(Responder * parentResponder);
/* ViewController */
View * view() override { return &m_selectableTableView; }
const char * title() override { return I18n::translate(I18n::Message::FiguresTab); }
virtual DisplayParameter displayParameter() override { return DisplayParameter::DoNotShowOwnTitle; }
/* Responder */
bool handleEvent(Ion::Events::Event event) override; // TO IMPLEMENT
void didBecomeFirstResponder() override;
/* TableView */
int numberOfRows() const override { return 1; } // TO IMPLEMENT
int numberOfColumns() const override { return 2; } // TO IMPLEMENT
KDCoordinate columnWidth(int i) { return i == 0 ? 50 : 150; } // TO IMPLEMENT
KDCoordinate rowHeight(int j) { return 50; } // TO IMPLEMENT
HighlightCell * reusableCell(int index, int type); // TO IMPLEMENT
void willDisplayCellAtLocation(HighlightCell * cell, int i, int j) override; // TO IMPLEMENT
int reusableCellCount(int type);
int typeAtLocation(int i, int j); // TO IMPLEMENT
private:
/* Customs methods */
bool isAddFigureRow(int j); // TO IMPLEMENT
SelectableTableView m_selectableTableView;
EvenOddMessageTextCell m_addFigureCell;
EvenOddCell m_emptyCell;
FigureTypeController m_figureTypeController;
DefinitionTypeController m_definitionTypeController;
FigureParametersController m_parametersController;
};
}
#endif

View File

@@ -0,0 +1,24 @@
#include "message_table_cell_with_selector.h"
#include <escher/container.h>
namespace Geometry {
MessageTableCellWithSelector::MessageTableCellWithSelector(ToolboxMessageTree * root, const KDFont * font) :
Responder(nullptr),
MessageTableCell((I18n::Message)0, font),
m_objectsRoot(root),
m_selectedMessage(nullptr),
m_toolbox(this)
{
}
bool MessageTableCellWithSelector::handleEvent(Ion::Events::Event event) {
if (event == Ion::Events::OK || event == Ion::Events::EXE) {
Container::activeApp()->displayModalViewController(&m_toolbox, 0.f, 0.f, Metric::PopUpTopMargin, Metric::PopUpLeftMargin, 0, Metric::PopUpRightMargin);
return true;
}
return false;
}
}

View File

@@ -0,0 +1,26 @@
#ifndef ESHER_MESSAGE_TABLE_CELL_WITH_OBJECT_SELECTOR_H_
#define ESHER_MESSAGE_TABLE_CELL_WITH_OBJECT_SELECTOR_H_
#include <escher/message_table_cell_with_buffer.h>
#include <escher/toolbox_message_tree.h>
#include "objects_controller.h"
namespace Geometry {
class MessageTableCellWithSelector : public Responder, public MessageTableCell {
public:
MessageTableCellWithSelector(ToolboxMessageTree * root = nullptr, const KDFont * font = KDFont::SmallFont);
ToolboxMessageTree * getSelectedMessage() const { return m_selectedMessage; };
bool handleEvent(Ion::Events::Event event);
Responder * responder() override {
return this;
}
private:
ToolboxMessageTree * m_objectsRoot;
ToolboxMessageTree * m_selectedMessage;
ObjectsController m_toolbox;
};
}
#endif

Some files were not shown because too many files have changed in this diff Show More