Compare commits

...

1488 Commits

Author SHA1 Message Date
Yaya-Cout
b9b49e0c17 [simulator/web] Fix window definition check 2025-12-14 12:59:08 +01:00
Yaya-Cout
bcef91bb59 [simulator/web] Better window definition check 2025-12-14 12:34:23 +01:00
Yaya-Cout
ff068ca797 [simulator/web] Add createContext to exported methods (emcc change) 2025-12-14 12:32:34 +01:00
Yaya-Cout
9d8e78ca1e [simulator/web] Avoid broadcasting storage if navigator isn't defined (on Node CI) 2025-12-14 12:20:49 +01:00
Yaya-Cout
90efabb404 [simulator/web] Broadcast storage after script execution 2025-12-14 12:09:05 +01:00
Yaya-Cout
26ee665d50 [simulator/web] Fix keyHandler not defined (backported from Upsilon Workshop) 2025-12-14 12:02:58 +01:00
Yaya-Cout
2233ca341b Merge pull request #389 from Random-Penguin/patch-1
Update toolbox.en.i18n molar masses
2025-12-06 17:45:57 +00:00
Random Penguin
677528dfb6 Update toolbox.en.i18n molar masses
Finally got around to fixing the molar masses of the atomic elements in the toolbox for the English language.
2025-12-04 15:19:33 +01:00
Yaya-Cout
bd78483d82 Merge pull request #388 from mickbot-92/ci
[CI] Update workflows
2025-11-30 10:46:29 +00:00
Yaya-Cout
2b5d6e9d7f [bootloader] Mark Epsilon 24.10.0 as safe 2025-11-26 22:11:08 +01:00
mickbot-92
9bf61ded07 [CI] Update workflows 2025-11-23 13:43:11 +01:00
Yaya-Cout
e3938e355b Merge pull request #387 from mickbot-92/bump-android
[Simulator/Android] Bump Gradle and Java & Add Android on README
2025-11-23 10:11:03 +00:00
Yaya-Cout
076fa3ab81 [apps/home] Fix trailing comma in apps_layout.csv 2025-11-10 19:07:34 +01:00
mickbot-92
be0edc48b6 [Simulator/Android] Bump Gradle and Java & Add Android on README 2025-11-08 23:25:11 +01:00
Yaya-Cout
d1b8cefcf9 Merge pull request #254 from RedGl0w/additional_result_trigo
Changes to the trigonometry additional result
2025-11-05 17:17:44 +00:00
Yaya-Cout
81ced8662c Merge pull request #308 from joecrop/logic-toolbox
Logic Toolbox
2025-11-05 15:08:30 +00:00
Yaya-Cout
c1f5b4afac Merge branch 'upsilon-dev' into logic-toolbox 2025-11-05 15:01:45 +00:00
Yaya-Cout
18f979dffe Merge pull request #294 from fmOOmf/upsilon-dev
Correction CIRCLE avec angle négatif (correct circle with negative angle)
2025-11-05 14:58:05 +00:00
Yaya-Cout
3c1bf54f0b Merge pull request #341 from AngeDieu/apps-layout
[build] update apps_layout.csv from EPSILON_APPS flag in make command
2025-11-05 14:49:27 +00:00
Yaya-Cout
5eb8054cde Merge pull request #361 from Ozero4/upsilon-dev
-- devient ans-
2025-11-05 14:40:59 +00:00
Yaya-Cout
f0f67b2766 Merge pull request #351 from AngeDieu/upsilon-dev
Update README.md
2025-11-05 14:40:28 +00:00
Yaya-Cout
c403aeaa04 Merge branch 'upsilon-dev' into upsilon-dev 2025-11-05 14:39:44 +00:00
Yaya-Cout
0a119fbad1 Merge pull request #383 from mickbot-92/build-on-arm
[CI] Build using Ubuntu ARM
2025-11-05 14:35:14 +00:00
Yaya-Cout
be688a487d Merge branch 'upsilon-dev' into build-on-arm 2025-11-05 14:29:20 +00:00
Lukas MAUFFRÉ
84fe92e3d7 Fix highlight background in console line view
Replaces Palette::BackgroundApps with Palette::CodeBackground for highlighted console lines to ensure consistent background color.
2025-11-02 10:43:17 +00:00
Yaya-Cout
96077fcfb6 [build] Version 1.1.2 2025-10-12 11:21:24 +02:00
Yaya-Cout
3566d44df2 [ion/usb] Fix USB descriptor 2025-10-12 10:58:59 +02:00
Yaya-Cout
13902cae72 [ion/platformInfo] Fix recovery boot address computation 2025-10-08 15:07:40 +02:00
Martin
59db12e78e [simulator/macos] Add universal binary support for x86_64 and ARM64
Build universal macOS simulator binaries that work on both Intel and Apple Silicon Macs by default. The build system now:
- Defaults to building for both x86_64 and ARM64 architectures
- Uses lipo to create universal binaries
- Allows single-architecture builds via ARCHS=arm64 or ARCHS=x86_64
- Conditionally includes the appropriate assembly files for each architecture
2025-10-08 11:15:37 +00:00
Yaya-Cout
696747a9a0 [build] Version 1.1.1 2025-10-02 18:34:05 +02:00
Yaya-Cout
7093f706ff [CI] Push to binfiles repo for N0110/N0110/Bootloader configs 2025-09-22 21:04:44 +02:00
Yaya-Cout
cc4b008048 [ion/usb] Fake alt interface to fix NumWorks website 2025-09-22 20:38:39 +02:00
Yaya-Cout
1b9b53a201 [build] Version 1.1.0 2025-09-22 20:34:33 +02:00
Yaya-Cout
a1f598194c [bootloader] Skip animation on keyboard event 2025-09-07 17:43:45 +02:00
Yaya-Cout
768bd52d46 [bootloader] Mark Epsilon 24.4.0 as safe 2025-09-07 16:52:21 +02:00
Yaya-Cout
818e4d281f [apps/external] Fix SCANCODE_OnOff being triggered by the left arrow 2025-08-25 17:00:00 +02:00
mickbot-92
f380c927f7 [CI] Build using Ubuntu ARM 2025-05-11 17:30:27 +02:00
Yaya-Cout
0fc06fafaf [README] Update usbipd instructions for WSL 2025-04-07 18:29:07 +02:00
Yaya-Cout
7a9a8ba371 [CI/Android] Run APT update to fix 404 2025-03-31 20:53:33 +02:00
Yaya-Cout
e6f14741d6 [CI] Install Linux toolchain for Web build to avoid dependancies issues (mainly libpng) 2025-03-31 20:46:25 +02:00
Yaya-Cout
6a83882826 [CI] Run APT update to fix 404 2025-03-31 20:40:23 +02:00
cartoone222
34506d334c Add an option to disable shift + clear (#368)
* add bgcolor to turtul module

* add bgcolor to toolbox and a minor fix

* ok is ok now i hope however

* Submodule Omega-Kawaii-Theme remove

* this featurs https://github.com/UpsilonNumworks/Upsilon/issues/285

* Update escher/src/text_area.cpp casse coresction

Co-authored-by: Yaya-Cout <67095734+Yaya-Cout@users.noreply.github.com>

* change name of function beacause code to late in night is bad idee

* invation of capital letter

* Update apps/settings/sub_menu/code_options_controller.cpp

Co-authored-by: Yaya-Cout <67095734+Yaya-Cout@users.noreply.github.com>

* Update escher/src/text_area.cpp

Co-authored-by: Yaya-Cout <67095734+Yaya-Cout@users.noreply.github.com>

* im not shure all is done

* the last hiden locke

* fix https://github.com/UpsilonNumworks/Upsilon/issues/271

* Update apps/global_preferences.h

Co-authored-by: Quentin <github@arra.red>

* Update apps/settings/sub_menu/code_options_controller.cpp

Co-authored-by: Quentin <git@quentinguidee.dev>

* Update apps/global_preferences.h

Co-authored-by: Yaya-Cout <67095734+Yaya-Cout@users.noreply.github.com>

* Update apps/global_preferences.h

Co-authored-by: Yaya-Cout <67095734+Yaya-Cout@users.noreply.github.com>

* reformatting the code to meet the expected quality

* Update apps/settings/base.pt.i18n

Co-authored-by: Yaya-Cout <67095734+Yaya-Cout@users.noreply.github.com>

* Update apps/settings/base.de.i18n

Co-authored-by: Yaya-Cout <67095734+Yaya-Cout@users.noreply.github.com>

* Update apps/settings/base.es.i18n

Co-authored-by: Yaya-Cout <67095734+Yaya-Cout@users.noreply.github.com>

* Update apps/settings/base.hu.i18n

Co-authored-by: Yaya-Cout <67095734+Yaya-Cout@users.noreply.github.com>

* Update apps/settings/base.it.i18n

Co-authored-by: Yaya-Cout <67095734+Yaya-Cout@users.noreply.github.com>

* Update apps/settings/base.nl.i18n

Co-authored-by: Yaya-Cout <67095734+Yaya-Cout@users.noreply.github.com>

* fix nameing

* Update apps/settings/base.en.i18n

---------

Co-authored-by: Yaya-Cout <67095734+Yaya-Cout@users.noreply.github.com>
Co-authored-by: Quentin <github@arra.red>
Co-authored-by: Quentin <git@quentinguidee.dev>
2025-03-31 18:17:30 +00:00
mickbot-92
ee8d456f1e [CI] [Simulator] Fix CI building (#381)
* [CI] Install more dependencies

* [Simulator] Some upgrades

* [CI] Fix Metrics

* Re-add newlines
2025-02-26 13:05:40 +00:00
Yaya-Cout
e971681dfd [Ion/bldata] Fix crash when going back to home screen after suspending 2025-01-25 19:21:56 +01:00
Yaya-Cout
276e8a603a [apps/settings] Unify prompt controller 2025-01-25 18:09:46 +01:00
Yaya-Cout
c1cc19d47c Avoid initializing storage to flash, reduce storage size by 8B and restore GCC 11 in CI 2025-01-25 18:00:29 +01:00
Yaya-Cout
7f560f8a5b [platformInfo] Add attribute weak to static storage declaration for simulators to fix windaube build (declaration is always weak for non-N0110 bootloader config) 2025-01-03 23:09:25 +01:00
Yaya-Cout
f7cd1693c9 [CI/Linux] Install libxtst-dev to fix build 2025-01-03 19:44:34 +01:00
Yaya-Cout
e6a308891b [CI/bootloader] Take toolchain from Ubuntu repos 2025-01-03 19:05:42 +01:00
Yaya-Cout
0c3506d85d Fix build for N0100 and legacy N0110 2025-01-03 18:32:20 +01:00
Yaya-Cout
d6831e46bf [bootloader] Change to version 1.1.0 - RECOVER 2024-12-29 12:01:21 +01:00
Yaya-Cout
b6d5bda120 [platformInfo] Hardcode recovery boot address to fix build on GCC 13+ 2024-12-29 11:57:44 +01:00
Yaya-Cout
4c26e846d3 Fix some spammy warnings 2024-12-29 11:48:18 +01:00
Yaya-Cout
219c6c4046 [bootloader] Don't shutdown he screen when booting to keep compatibility 2024-12-29 11:45:13 +01:00
Yaya-Cout
ea1e0c8140 Merge remote-tracking branch 'devdl11/upsilon-dev-1.0.1.01fix' into upsilon-dev 2024-12-27 19:01:17 +01:00
Yaya-Cout
7f5fc1269d [bootloader] Mark Epsilon 24.0.1 as safe 2024-12-27 18:38:56 +01:00
Yaya-Cout
deda7483e3 [bootloader] Fix slotInfo on Epsilon 2024-12-27 18:30:36 +01:00
Yaya-Cout
520b88e364 [Liba] Fix build on new GCC versions 2024-12-08 22:10:50 +01:00
mickbot-92
172f168bb2 [Simulator/Android] Bump to latest dependencies + other improvements (#376)
Co-authored-by: mickbot-92 <e3rck4b4[at]duck[dot]com>

* Bumping to latest stable dependencies and Gradle.
  * [CI] Building with JDK 21 instead of with JDK 11 (JDK 17 works fine too if you remove the latest line of build.gradle).
  * Using `mavenCentral()` instead of [deprecated](https://docs.gradle.org/current/userguide/upgrading_version_6.html#jcenter_deprecation) `jcenter()`
* Removing useless Google plugins.
* Setting `compileSdk` to 33 : Upsilon no longer requires the Notification permission.
* versionCode : compiling with the current Unix/Epoch timestamp.
* versionName : using the `UPSILON_VERSION` variable instead of the Omega one + adding the date of compiling.
* Some improvements about icons.
* [CI] Using the latests `uses: ` to make the warning about NodeJS deprecation disappear.

Many thanks to @Yaya-Cout (and to @pi-dev500 too :) 🫡
2024-10-20 08:39:17 +00:00
Yaya-Cout
89def884f7 [bootloader] Mark Epsilon 23.2.6 as safe and change the warning a bit the error message 2024-10-19 18:29:01 +02:00
Raphael Le Goaller
d3513a0763 [apps/math_toolbox] Remove duplicate entries in French i18n (#369) 2024-06-17 18:53:04 +00:00
cartoone222
ff54918502 [python] add bgcolor to turtule module (#367)
* add bgcolor to turtul module

* add bgcolor to toolbox and a minor fix

* ok is ok now i hope however

* Submodule Omega-Kawaii-Theme remove
2024-06-09 07:01:17 +00:00
Yaya-Cout
3b22656d4f Merge branch 'upsilon-dev' of github.com:UpsilonNumworks/Upsilon into upsilon-dev 2024-06-06 11:18:06 +02:00
Yaya-Cout
16d1946934 [Simulator/Android] Rename to Upsilon and other improvements 2024-06-06 11:18:02 +02:00
Leviathan3DPrinting
ac71576acc [Ion] Prevent crash if locale is null (#365)
* fix a compilation issue

* revert file

---------

Co-authored-by: Leviathan3DPrinting <leviathan3dprinting@gmail.com>
2024-05-12 11:35:12 +00:00
Yaya-Cout
891693abe2 [CI] Update Fxcg git url 2024-05-11 11:19:11 +02:00
Yaya-Cout
cf3cec7442 [Simulator] Fix Web simulator build on latest emscripten 2024-05-11 10:48:53 +02:00
Yaya-Cout
e20b1dee07 [bootloader] Update version code (1.0.11) 2024-05-08 20:18:33 +02:00
Yaya-Cout
8ff2e021ec Merge branch 'upsilon-dev' of github.com:UpsilonNumworks/Upsilon into upsilon-dev 2024-05-08 19:09:17 +02:00
Yaya-Cout
43a96629a4 [bootloader] Fix Epsilon 22+ exam mode detection on first flash 2024-05-08 19:09:12 +02:00
mickbot-92
6748f12239 Typos in README (#363)
* Update README.md

* Update README.fr.md
2024-04-17 16:12:14 +00:00
Yaya-Cout
5e83c03f8d [bootloader] Fix booting on newer toolchain versions 2024-04-04 19:22:56 +02:00
Yaya-Cout
510143678f [ion/simulator] Reduce rumble from 40 ms to 1 ms
Waaaay better on Android, simulator is usable (Look like RetroArch, even if I didn't copy the parameters)
2024-04-02 21:08:28 +02:00
Ozero4
35799f9a0d Update expression_field.h 2024-03-18 18:18:15 +01:00
Ozero4
46f7eb5afe Update expression_field.h 2024-03-18 18:14:01 +01:00
Ozero4
2671b6e0e1 Update expression_field.cpp 2024-03-18 18:13:25 +01:00
Ozero4
64b4012f90 Update expression_field.cpp 2024-03-18 18:11:43 +01:00
Yaya-Cout
2374fe4cf8 [bootloader] Fix exam mode with Epsilon 16-19 2024-02-29 12:49:58 +01:00
Yaya-Cout
1953371266 [apps/math_toolbox] Add centimeter and square meter 2024-02-18 20:28:54 +01:00
Yaya-Cout
b667509ab4 [themes/script.sh] Make script executable by default 2024-02-10 14:32:33 +01:00
Yaya-Cout
cb6fd76141 [bootloader] Fix exam mode with Epsilon 22 2024-01-17 19:35:43 +01:00
Yaya-Cout
f7a298aa0b [build] Fix DFU on recent Python versions and drop Python 2 2024-01-14 12:13:24 +01:00
Rathmox
5b87721f6e Fix Numworks not recognizing calculator (#352)
* Fix Numworks not recognizing calculator

* Fix issue also for scripts recovery
2023-12-20 06:38:39 +00:00
AngeDieu
d51c55fc6c Update README.md
precise to use linux terminal with wsl installation
2023-12-07 22:29:44 +01:00
Yaya-Cout
52bc616cd2 Merge branch 'upsilon-dev' of https://github.com/UpsilonNumworks/Upsilon into upsilon-dev 2023-11-23 19:21:13 +01:00
Yaya-Cout
458c9316f1 [Ion][DFU] Restore compatibility with NumWorks website
Revert product string descriptor change
2023-11-23 19:21:10 +01:00
AngeDieu
9ac62c0496 add factorial to toolbox -> combinatorics (#348)
* add factorial to toolbox -> combinatorics

* Update math_toolbox.cpp

removed newline for format purpose
2023-11-11 18:27:58 +01:00
Rathmox
7f2ba08761 Mark 21.3.0 as safe (#347)
* Mark 21.3.0 as safe

* set to FREEDOM 21.3
2023-10-20 19:03:52 +02:00
Yaya-Cout
a5354f589a Merge branch 'upsilon-dev' of https://github.com/UpsilonNumworks/Upsilon into upsilon-dev 2023-10-16 19:35:51 +02:00
Yaya-Cout
2bf46f59ce [apps_container] Avoid crashing on ×10^ on N0100 2023-10-16 19:35:31 +02:00
Rathmox
0f2ce293d1 Mark 21.2.0 as safe (#342)
* Mark 21.2.0 as safe

* Update messages.h
2023-10-02 21:12:43 +02:00
Yaya-Cout
764ff6fd86 Merge branch 'upsilon-dev' of https://github.com/UpsilonNumworks/Upsilon into upsilon-dev 2023-09-28 20:39:04 +02:00
Yaya-Cout
a0583aa2a9 [python] Prevent waiting for 2^32 ms if user entered a negative delay
This is due to a missing check in the interruptible sleep function which was not
checking if the delay was negative, then was passed to the
Ion::Timing::usleep function, who only takes signed values
2023-09-28 20:38:40 +02:00
Luminoso-256
0cabec542d [NSpire Simulator] Fix framebuffer in nspire port (#340)
* Fix the nspire port (ergo: framebuffer functions, shift/ctrl don't corrupt things due to weird draw calls)

* cleanup the k_csdk changes
2023-09-15 16:12:05 +00:00
AngeDieu
ab854e16ab Merge branch 'UpsilonNumworks:upsilon-dev' into upsilon-dev 2023-08-30 21:12:45 +02:00
Yaya-Cout
fd159fe489 [bootloader] Update version number 2023-08-29 12:26:38 +02:00
Yaya-Cout
f89ffc9b00 [bootloader] Mark Epsilon 21.1.1 as safe 2023-08-29 11:54:31 +02:00
AngeDieu
51d5ed04d0 [build] update apps_layout.csv from EPSILON_APPS flag in make command
python approach
2023-07-13 18:28:27 +02:00
Yaya-Cout
a945fc1025 [python/kandinsky] Fix big font selection 2023-07-01 20:14:20 +02:00
Yaya-Cout
6976e524ad [python/kandinsky] Allow selecting italic font for draw_string using 7th argument 2023-06-27 20:04:24 +02:00
Yaya-Cout
4630052630 [i18n/code] Fix random description in italian 2023-06-26 18:18:28 +02:00
andrigamerita
3c6641c808 [it.i18n] Add missing italian translations, fix typos / excessive length in the existing ones (#331)
* [it.i18n] [apps/code] Add missing translations

* [it.i18n] [apps/reader] Fix typo

* [it.i18n] [apps/external, apps/setting] Add missing translations + fixes
2023-06-26 17:01:54 +02:00
Yaya-Cout
45a9dda989 [apps/host_filemanager] Fix N0100 build 2023-06-07 08:54:38 +02:00
Yaya-Cout
73450419bb [Ports] Merge Nspire port and Fxcg improvements
Close #327
2023-06-06 21:28:54 +02:00
Yaya-Cout
a124ed72b5 [Ion] Quick-and-dirty fix for the Web simulator 2023-05-21 11:53:08 +02:00
circuit10
b44a95a9b3 Casio fx-CG series port (#324)
* Initial test - working on Linux

* Try to make it work with liba

* Stop using liba and the filesystem

* IT WORKS

* Key input, full res, fix some of the crashes

* Fix the hang when doing calculations

* Add some more key mappings

* Fix the square root issue

* Icons

* Better key mappings, brightness control, better gamma correction, more effficient framebuffer

* Cleanup stage 1

* Cleanup stage 2

* Make the build system build a g3a

* Make it not exit when you press the menu button

* Add Casio port to README

* Use omega-master instead of omega-dev

* Fix mistake with cherry-picking in the README

* Fix internal storage crash

* Fix compile error on Numworks calculators

* Upsilon branding

* Sharper icon

* Make the CI work

* Add power off and improve menu

* Map Alpha + up/down to the brightness shortcut

* Add missing file

* Fix web CI build

* Revert "Fix web CI build"

This reverts commit f19657d9fc.

* Change "prizm" to "fxcg"

* Add FASTLOAD option for Add-in Push

* Add some charatcers to the catalog on Casio and improve key mappings

* Build with -Os -flto

* Disable LTO for now as it's causing crashes

* Put back the fonts I accidently changed

I'd like to add an option for this though as I prefer the ones from Epsilon
2023-05-10 18:28:18 +02:00
Yaya-Cout
aadcd37f31 Fix 3DS simulator (#243)
* [CI] Fix 3DS try 1

* [CI] Fix 3DS try 2

* [CI] Fix 3DS try 3

* [CI] Fix 3DS try 4

* [CI] Fix 3DS try 5

* [CI] Fix 3DS try 6

* [CI] Fix 3DS try 7

* [CI] Fix 3DS try 8

* [CI] Fix 3DS try 9

* [CI] Fix 3DS try 10

* [CI] Fix 3DS try 11

* [CI] Fix 3DS try 12

* [CI] Fix 3DS try 13

* [CI] Fix 3DS try 14

* [CI] Fix 3DS try 15

* [CI] Fix 3DS try 16

* [CI] Fix 3DS try 17

* [CI] Fix 3DS try 18

* [CI] Fix 3DS try 19

* [CI] Make other simulators than 3DS working

* [CI] Fix 3DS without breaking others simulators try 1

* Apply suggestions from code review

* Improve SDL assert

* Fix SDL assert

* Fix SDL assert 2

* [CI] Enable iOS, macOS and 3DS tests by default

* [CI] Change epsilon-sdk tap url

* Revert "[CI] Change epsilon-sdk tap url"

This reverts commit 9516607aba.
2023-04-13 16:24:38 +02:00
Lisra-git
0916996121 [Bootloader] Enhance Global Stability 2023-04-08 14:25:31 +02:00
Wiwok
b4820d52e4 [README] Fix a bad string in French README (#317) 2023-03-19 10:31:27 +01:00
Yaya-Cout
a87a99af7a [bootloader] Mark Epsilon 20.4 as safe 2023-03-17 17:20:23 +01:00
Yaya-Cout
83d6d33edf [apps/math_toolbox] Move Matrix and Vectors to a submenu 2023-03-12 11:19:14 +01:00
Yaya-Cout
1067216d4f [bootloader] Mark Epsilon 20.3 as safe 2023-02-17 21:39:51 +01:00
Yaya-Cout
c0d998017d [apps/main] Add open app option 2023-02-17 19:32:50 +01:00
Yaya-Cout
a729ef2a4c [apps] Move Dimensions i18n out of calculation
This allow Escher to build successfully without calculation app
2023-02-17 19:32:16 +01:00
Yaya-Cout
b43d773051 [calculation/UnitList] Fix crash when pressing OK 2023-02-08 17:09:48 +01:00
Yaya-Cout
4acc79f1c7 [apps/on_boarding] Fix logo view crash when interrupted 2023-02-03 08:25:54 +01:00
Yaya-Cout
58a373e683 [apps/reader] Fix reader crash when opening bookmark
I just disabled color restoration, but I am still not understanding why it isn't working

Fix #307
2023-01-29 19:36:13 +01:00
Joe Crop
8041c7a9d0 Updated french translations after feedback 2023-01-21 21:12:46 -08:00
Yaya-Cout
c5960430a3 Merge pull request #313 from lolocomotive/simulator-fix
[Simulator] Fix keys not working and reduce log spam
2023-01-21 15:01:00 +01:00
lolocomotive
12d8eeeb2c [Simulator] Fix keys not working and reduce log spam 2023-01-21 14:39:57 +01:00
Yaya-Cout
224cec5efc [apps/settings] Remove rests of USB protection 2023-01-16 18:49:52 +01:00
Yaya-Cout
7af7b895f5 [i18n] Clean translations 2023-01-16 18:39:31 +01:00
Yaya-Cout
0e65c97774 [Simulator] Fix MicroPython in Web simulator and update to Emscripten 3.1.30 2023-01-14 19:52:30 +00:00
Loïc
72d10f8396 [Simulator] Don't resize canvas to 0x0 (#310)
* [Simulator] Don't resize canvas to 0x0

* [storage] Fix broken script saving/loading

* [Simulator] Don't resize canvas to 0x0

Co-authored-by: Yaya-Cout <yaya.cout@free.fr>
2023-01-05 17:33:53 +01:00
Yaya-Cout
7030c58c51 [storage] Fix broken script saving/loading 2023-01-05 17:18:11 +01:00
Loïc
1a681c7c75 Fix android simulator (#277)
* Fix android CI

* Set NDK path

* Reduced log spam

* Fixed NDK path

* Fixed NDK path

* Android NDK v21e

* Use debug signin config
if SIGNING_STORE_FILE is not defined
This allows the apk to be installed

* Fix OmegaActivity class name

* Fix formatting

Co-authored-by: Yaya-Cout <yaya.cout@free.fr>

Co-authored-by: Yaya-Cout <yaya.cout@free.fr>
2023-01-01 14:16:12 +01:00
Yaya-Cout
ed002ed14b [apps/atomic] Fix last commit (std::max error) 2023-01-01 11:59:36 +01:00
Yaya-Cout
2312147957 [apps/atomic] Use latest commit (redesign) 2022-12-29 12:38:44 +01:00
Joe Crop
d7f54ad644 removed shift functions with explicit number of bits 2022-12-26 22:01:11 -08:00
Yaya-Cout
1de090cea4 [apps/home] Quick select for apps using numbers (#306)
* [apps/home] Quick select for apps using numbers

* [apps/home] Fix build error
2022-12-09 17:42:44 +01:00
Joe Crop
81dc1bd806 moved logic toolbox to the bottom of the list 2022-12-06 11:16:04 -08:00
Joe Crop
fc95028b57 - Added clog2 function
- negative numbers can now be displayed in 2's compliment binary
2022-12-06 11:10:01 -08:00
Yaya-Cout
c9c868c32c [CI] Use latest version of ARM toolchain for bootloader 2022-12-06 17:14:27 +01:00
Yaya-Cout
8d6c7d1bff [CI] Build all bin checksums 2022-12-06 16:37:41 +01:00
Joe Crop
42d8fea8c6 logic toolbox with logic functions 2022-12-05 20:07:45 -08:00
Yaya-Cout
2a89c23e07 [CI] Rebuild checksums before uploading bootloader 2022-12-05 20:57:51 +01:00
Yaya-Cout
62d4d59d6b [CI] Fix bootloader upload 2022-12-05 20:44:54 +01:00
Yaya-Cout
1bf164e1e3 [CI] Add bootloader in bootloader binpack (#304)
* [CI] Add bootloader in bootloader binpack

* [CI] Second try to add bootloader in bootloader binpack
2022-12-03 18:53:22 +01:00
Yaya-Cout
851ec2ab69 [bootloader] Fix exam mode with Epsilon 19 and add support for Epsilon 20 (#302)
* [bootloader] Fix exam mode on Epsilon 19

* [bootloader] Fix comment indentation

* [bootloader] Restore comment indentation (even if GitHub tell that it isn't indented properly)

* [bootloader] Turn tabulations into spaces

* [bootloader] Mark Epsilon 19 as "safe to boot"

* [bootloader] Fix Epsilon 20 boot

* [bootloader] Chang version to 1.0.2
2022-12-03 18:14:43 +01:00
Yaya-Cout
08eb1aec99 [CI] Fix Web CI (#303) 2022-12-03 17:21:26 +01:00
devdl11
78b606e825 [bootloader] Fix e19 boot (#263) 2022-11-19 11:13:17 +01:00
fmOOmf
ea89bc9aa5 code comment
Co-authored-by: Yaya-Cout <yaya.cout@ik.me>
2022-10-27 11:26:01 +02:00
fmOOmf
56ce3b0f42 Review changes (indentation, spaces) 2022-10-26 22:10:15 +02:00
fmOOmf
57e4cbe402 Final Heading correction 2022-10-26 21:22:56 +02:00
fmOOmf
dfb5b90e55 Modif pour le circle avec angle négatif (modif for circle with negative angle) 2022-10-26 19:43:33 +02:00
Rathmox
1d00d7d9d3 Fix README powershell commands (#278) 2022-10-08 19:25:28 +02:00
Hug0
3a220c0507 Upsilon readme nix (#287) 2022-10-08 19:25:03 +02:00
Laury
1fbd5281a9 [escher] Fixed bugs in previous commit (XNT) 2022-07-07 12:37:55 +02:00
Laury
51a5f699c3 [escher] XNT button is now cyclic 2022-07-06 22:52:49 +02:00
Laury
77167d1706 [statistics] Added 3 new measurements 2022-07-04 11:12:19 +02:00
Yaya-Cout
a1e213ac91 [apps] Add Shift + Ans shortcut to go to the last application (#196) 2022-07-04 11:09:58 +02:00
Laury
d87c67d35b [kandinsky | code] Coding style improvement in the new font (part 1) 2022-07-01 21:11:45 +02:00
Oreig403
99b070a30d New font and italic in python keywords (#232) 2022-07-01 11:39:23 +02:00
Laury
2a234305f3 [reader] FIxed "syntax error" with colors when going backward 2022-06-27 13:00:30 +02:00
Laury
992fb5dc85 [escher] Fixed icon view 2022-06-27 11:44:53 +02:00
Laury
891afff4bb [code] Added ulab.utils in toolbox 2022-06-26 14:30:50 +02:00
Yaya-Cout
92c653f2f2 [python] Upgrade MicroPython to version 1.19.1, Ulab and add unit tests for Ulab (#259) 2022-06-26 13:03:22 +02:00
Laury
25d4793441 [poincare] Fixed tests 2022-06-25 23:35:38 +02:00
Laury
4893b73917 [test] Fixed tests compilation 2022-06-25 19:46:00 +02:00
Laury
0b2a581177 [escher] Rework of timers and bigger text in toolboxes 2022-06-25 19:46:00 +02:00
Laury
391fd5e243 [python/ion] Error if brightness isn't between 0 and 240 in set_brightness 2022-06-25 19:45:59 +02:00
fmOOmf
ba43135fcb [kandinsky/font] Fix replacement character 2022-06-25 12:32:06 +02:00
LeMoustachu
4d5b37fab1 Improvements to README.md and README.fr.md (#256)
* [README] clean fedora dependencies installation instruction

* [README] n0110 instructions clearification

* [README] add instruction for native simulator build

* Fix translation

Changed "native simulator" into "simulateur natif"

Co-authored-by: Yaya-Cout <yaya.cout@free.fr>

* [README] add automatic platform detection command to native simulator instructions

* [README.fr] fix translations

* Update README.fr.md

change "apps external" into "appllications externes"

Co-authored-by: Yaya-Cout <yaya.cout@free.fr>

* Update README.fr.md

Co-authored-by: Yaya-Cout <yaya.cout@free.fr>

Co-authored-by: Yaya-Cout <yaya.cout@free.fr>
2022-06-21 18:09:41 +02:00
Laury
e8ea693e5c [calculation] Dimension in additional output for values with units 2022-06-18 22:36:55 +02:00
Laury
125e1a8a82 [settings] Remove option to save cursor 2022-06-17 18:01:15 +02:00
Joachim LF
7dff05287d [calculation/additional_result] draw in trigonometric graph the tangent 2022-06-17 13:23:51 +02:00
Joachim LF
25cd0d44f3 [calculation/additional_outputs] Use input rather than output if possible, and open on tan 2022-06-17 13:09:45 +02:00
Mino1289
0751c88a2d [TexParser] Adding Sum, Product and Integral (#252) 2022-06-17 12:25:38 +02:00
Laury
d983797ac8 Revert "[storage] New attempt to save cursor position"
This reverts commit c826e556a1.
2022-06-17 12:12:39 +02:00
Yaya-Cout
1319ad2f42 [Make] Add shasum for bootloader binpack 2022-06-14 19:58:50 +02:00
Yaya-Cout
741a71554d [CI] Add bootloader upload to dev version on Firebase 2022-06-14 19:46:06 +02:00
fmOOmf
9588052d68 Correction de la gestion de la couleur marron Liseuse / Brown color processing in Reader (#251)
* Ajout de \binom pour afficher les coefficients binomiaux

* Correction in reader Brown color  processing
2022-06-12 18:24:55 +02:00
Lisra-git
35017ec167 Lock Hardware Test while Exam Mode enabled (#227) 2022-06-12 11:38:52 +02:00
Mino1289
3b12f29815 [apps/reader] Adding new symbols and functions in the TexParser (#237) 2022-06-12 11:37:17 +02:00
Rathmox
1f91a5f900 Fixing README Files (#241) 2022-06-12 11:36:03 +02:00
Laury
c826e556a1 [storage] New attempt to save cursor position 2022-06-10 16:16:16 +02:00
fmOOmf
1db74c78ab Ajout de \binom pour afficher les coefficients binomiaux (#250) 2022-06-09 17:10:07 +02:00
Yaya-Cout
71a8c20ee7 [bootloader] Fix minimum brightness when booting 2022-05-31 18:23:51 +02:00
Joachim Le Fournis
d8423fb4f1 [LD] Fixed warning about different array declaration (#242)
The size declared in toolbox_ion_keys.cpp for the modion_module_globals_table array was different that the defined array in micropython
2022-05-29 10:26:59 +02:00
Yaya-Cout
5444bdae99 [build] Disable telemetry on IOS 2022-05-27 16:56:27 +02:00
devdl11
952a83400a ld fix possibility 2022-05-27 10:02:59 +02:00
devdl11
8996f960dc Add specific header and extra version 2022-05-25 09:53:00 +02:00
Yaya-Cout
e4718fcb95 [apps/external] Add simulator support (#238) 2022-05-21 17:38:26 +02:00
Yaya-Cout
19de87f9b5 [CI] Fix metric workflow 2022-05-21 10:54:24 +02:00
Yaya-Cout
5f51ed0628 [README/CI] Fix README and CI (#235)
* [README] Fix readme

* [CI] Fix CI

* [CI] Fix bootloader
2022-05-20 19:31:21 +02:00
Yaya-Cout
e4f0762db3 [README/build] Add bootloader in README 2022-05-20 19:07:50 +02:00
devdl11
cbec2e5883 Update bootloader/interface/menus/upsilon_recovery.h
Co-authored-by: Yaya-Cout <yaya.cout@free.fr>
2022-05-20 18:00:00 +02:00
devdl11
1e0fa89efe Update bootloader/interface/menus/upsilon_recovery.cpp
Co-authored-by: Yaya-Cout <yaya.cout@free.fr>
2022-05-20 17:59:53 +02:00
devdl11
363ffbcaf8 Removing debug led 2022-05-20 11:43:40 +02:00
devdl11
48587c15d7 Review 2022-05-19 20:51:18 +02:00
devdl11
3eaa116ec6 Merge branch 'upsilon-dev' of https://github.com/UpsilonNumworks/Upsilon into upsilon-dev-v1.0.1.01fix_bis 2022-05-19 19:54:08 +02:00
Yaya-Cout
ab8b353c9c Change Upsilon version from 1.0.0 to 1.0.1-dev 2022-05-19 19:52:46 +02:00
devdl11
8e543f30c9 Magical Backup 2022-05-19 19:52:46 +02:00
Andrej
833bc4a120 [bootloader/menu] Fix typo (#231) 2022-05-19 19:52:46 +02:00
emanuel
a01f4bcf1a Update config.mak (#230)
[build/config.mak] Set OMEGA_VERSION to 2.0.2
2022-05-19 19:52:46 +02:00
Laury
3e42d4847a Revert "[storage] Possibility to store metadata with records (cursor in scripts)" 2022-05-19 19:52:45 +02:00
Yaya-Cout
2a6d110f2f Change Upsilon version from 1.0.0 to 1.0.1-dev 2022-05-18 13:02:41 +02:00
Andrej
2ee7b67af1 [bootloader/menu] Fix typo (#231) 2022-05-11 20:27:12 +02:00
emanuel
be3c8fce9c Update config.mak (#230)
[build/config.mak] Set OMEGA_VERSION to 2.0.2
2022-05-10 18:06:46 +02:00
Laury
ec36325799 Merge branch 'upsilon-dev' of https://github.com/UpsilonNumworks/Upsilon into upsilon-dev 2022-05-09 18:40:45 +02:00
Laury
36fa4a4152 Revert "[storage] Possibility to store metadata with records (cursor in scripts)" 2022-05-09 18:39:10 +02:00
iamlambda
6758a95292 misleading comment (#216) 2022-05-07 20:40:23 +02:00
LeMoustachu
5be8d6a1f5 [minor changes] Just Update issues badge to work with new repo URL (#222) 2022-05-07 20:39:53 +02:00
Laury
5220dda095 Merge remote-tracking branch 'origin/upsilon-dev' into upsilon-master 2022-05-05 18:02:51 +02:00
Yaya-Cout
7c51b1e55d [apps/code] Fix fr" typing in editor
Fix #217
2022-05-05 17:55:19 +02:00
Laury
7a2ee2bc56 [config] Set upsilon version to 1.0.0 2022-05-04 15:49:24 +02:00
Laury
9f6d52d9d5 [usb] Removing residues from the USB protection 2022-05-04 15:49:11 +02:00
Laury
efb32c9612 [bootloader] Fix "make binpack" in the CI 2022-05-03 18:41:39 +02:00
Laury
caf23dcbab [bootloader] Fix compilation to dfu file 2022-05-03 17:48:16 +02:00
Laury
6a894997fc [flasher] Fixed compilation 2022-05-03 16:34:22 +02:00
Laury
f348d9eb5d [bootloader] Fixed compilation 2022-05-03 16:34:07 +02:00
Laury
0e0dc4a9c2 Revert "[apps] Add Shift + Ans shortcut to go to the last application" 2022-05-02 18:55:46 +02:00
Laury
2be1a6e5a9 [usb] Changed link in descriptor 2022-05-02 17:01:20 +02:00
Laury
adab2c223b [reader] Improved previous position algorithm and fixed symbols 2022-05-01 21:02:07 +02:00
Laury
745099842a [poincare] Fixed two serious bugs in sequences simplification 2022-04-30 19:12:54 +02:00
Yaya-Cout
39f33347f9 Merge remote-tracking branch 'upsilon-yayacout/upsilon-dev-ci-bootloader-fix' into upsilon-master 2022-04-29 22:04:52 +02:00
Yaya-Cout
03ae762b4a [external] Updated for compatibility with KhiCAS 2022-04-29 22:00:12 +02:00
Laury
5b7bdc1ec1 Revert "[external] First attempt to merge Khi external API"
This reverts commit 38796253cb.
2022-04-28 21:33:01 +02:00
Laury
7d61e236df [bootloader] Small fixes 2022-04-28 21:32:42 +02:00
devdl11
7f8e6a6b87 Merged new bootloader
Co-authored-by: Yaya-Cout <yaya.cout@free.fr>
2022-04-27 21:02:04 +02:00
devdl11
9c69379096 fix 2022-04-27 20:37:39 +02:00
Yaya-Cout
aff5803ef3 [CI] Fix bootloader CI 2022-04-27 20:07:08 +02:00
devdl11
fd7bdc7345 Dumb error fix 2022-04-27 19:56:37 +02:00
Yaya-Cout
807945ad0f [CI] Fix bench.flash 2022-04-27 19:45:55 +02:00
devdl11
35f09ed389 Merge branch 'upsilon-new-bootloader' of https://github.com/devdl11/Upsilon into upsilon-new-bootloader 2022-04-27 19:25:03 +02:00
devdl11
c73b13bd41 Some code 2022-04-27 19:24:59 +02:00
devdl11
47558446c4 Update bootloader/interface/menus/dfu.h
Co-authored-by: Yaya-Cout <yaya.cout@free.fr>
2022-04-27 18:56:06 +02:00
devdl11
45b4dd337c Update bootloader/interface/static/messages.h
Co-authored-by: Yaya-Cout <yaya.cout@free.fr>
2022-04-27 15:46:31 +02:00
devdl11
0332f43c5c Reviews 2022-04-27 15:44:42 +02:00
Yaya-Cout
667bac136b Merge remote-tracking branch 'upsilon-yayacout/upsilon-dev-autocompletion-fix' into upsilon-master 2022-04-27 15:26:58 +02:00
Yaya-Cout
b15d49511d [apps/python] Use super implementation in the select sub menu function of the toolbox 2022-04-27 14:06:02 +02:00
devdl11
04ae526a39 Removing useless file 2022-04-26 18:10:34 +02:00
devdl11
0e49d23faa Apply suggestions from code review
Co-authored-by: Yaya-Cout <yaya.cout@free.fr>
2022-04-26 15:26:34 +02:00
Laury
595c69bfcf Merged upsilon-dev 2022-04-26 12:48:52 +02:00
devdl11
18ff283580 Boot fix 2022-04-25 19:52:58 +02:00
devdl11
42368ecd6e second patch 2022-04-25 18:40:55 +02:00
devdl11
27cf6a0615 Fix CLI bootloader 2022-04-25 18:35:16 +02:00
devdl11
5ed8aef907 Bootloader pre-release 2022-04-25 18:22:19 +02:00
Laury
3c53421ffa [poincare] Added simplification of nested radicals 2022-04-23 23:10:58 +02:00
Laury
d10d1cd65d [rpn] Updated submodule to fix dirty line 2022-04-17 21:57:47 +02:00
Laury
cec75bfaed [rpn] Updated submodules 2022-04-17 18:05:58 +02:00
Laury
77352e34b5 [storage] Possibility to store metadata with records (cursor in scripts) 2022-04-15 22:30:53 +02:00
Laury
38796253cb [external] First attempt to merge Khi external API 2022-04-15 22:30:35 +02:00
Yaya.Cout
4b7631e78a [apps/apps_container_storage.cpp] Add an assert 2022-04-15 22:19:32 +02:00
Yaya.Cout
c54a97a03d [apps/apps_container_storage.cpp] Add newline 2022-04-15 22:19:32 +02:00
Yaya.Cout
d42e4269a9 [apps] Add Shift + Ans shortcut to go to the last application 2022-04-15 22:19:32 +02:00
Laury
2bf6de5044 [reader] Fixed bug when a word is too big 2022-04-15 22:19:31 +02:00
Laury
22ba190542 [calculation] Fix bug in calculation store 2022-04-15 22:19:31 +02:00
Nithin
0e24823511 Fix Readme Links (#210) 2022-04-15 18:50:17 +02:00
Yaya.Cout
f174fbc3f5 [apps/code] Fix Key selector in auto completion
Scenario: Go in the Python editor and type "from ion import *",
          then type "K" and see what happens.
This fix UpsilonNumworks#198
2022-04-15 17:05:19 +02:00
Lauryy06
4ca7d9208c [escher] Changed PopUpTopMargin in metrics (#201) 2022-04-10 22:17:52 +02:00
LeMoustachu
2bfc243e5a update atomic submodule (#208) 2022-04-09 19:08:04 +02:00
devdl11
add333b920 [bootloade] Fix freezing 2022-04-09 11:08:02 +02:00
devdl11
eeff886cc1 [bootloader > menus] Improvement 2022-04-09 11:02:34 +02:00
devdl11
ff307b8df8 [bootloader > interfaces] Interface improvement 2022-04-08 23:44:24 +02:00
devdl11
21f08a2d06 [bootloader/interface] Yaya-cout commit 2022-04-08 18:53:26 +02:00
devdl11
c837709801 [flasher] Fix old dfu code 2022-04-08 18:40:08 +02:00
devdl11
a0caf67d7c [review] revert flasher code 2022-04-08 18:33:27 +02:00
devdl11
f4e84bc208 Update ion/src/device/n0110/internal_flash.ld
Co-authored-by: Yaya-Cout <67095734+Yaya-Cout@users.noreply.github.com>
2022-04-08 18:07:28 +02:00
devdl11
225b942989 Update ion/src/device/shared/usb/dfu.ld
Co-authored-by: Yaya-Cout <67095734+Yaya-Cout@users.noreply.github.com>
2022-04-08 18:07:11 +02:00
devdl11
3b955c2eb6 Update ion/src/device/n0110/drivers/board.cpp
Co-authored-by: Yaya-Cout <67095734+Yaya-Cout@users.noreply.github.com>
2022-04-08 18:06:59 +02:00
devdl11
0e46954f80 Update ion/src/device/shared/usb/dfu_interface.h
Co-authored-by: Yaya-Cout <67095734+Yaya-Cout@users.noreply.github.com>
2022-04-08 18:06:22 +02:00
devdl11
bf1d570623 Update ion/src/device/shared/usb/dfu_relocated.cpp
Co-authored-by: Yaya-Cout <67095734+Yaya-Cout@users.noreply.github.com>
2022-04-08 18:06:15 +02:00
devdl11
5f50f3fc9c Update ion/src/device/shared/usb/stack/device.cpp
Co-authored-by: Yaya-Cout <67095734+Yaya-Cout@users.noreply.github.com>
2022-04-08 18:06:07 +02:00
devdl11
4a830a0f30 Update ion/src/device/n0100/flash.ld
Co-authored-by: Yaya-Cout <67095734+Yaya-Cout@users.noreply.github.com>
2022-04-08 18:05:57 +02:00
devdl11
01c3f767e4 Update ion/src/device/bootloader/usb/Makefile
Co-authored-by: Yaya-Cout <67095734+Yaya-Cout@users.noreply.github.com>
2022-04-08 18:03:32 +02:00
devdl11
3c098b684b Update bootloader/usb_data.h
Co-authored-by: Yaya-Cout <67095734+Yaya-Cout@users.noreply.github.com>
2022-04-08 18:03:19 +02:00
devdl11
e886863230 Update bootloader/messages.h
Co-authored-by: Yaya-Cout <67095734+Yaya-Cout@users.noreply.github.com>
2022-04-08 18:03:11 +02:00
devdl11
7ce3aac2f6 Update bootloader/messages.h
Co-authored-by: Yaya-Cout <67095734+Yaya-Cout@users.noreply.github.com>
2022-04-08 18:02:56 +02:00
devdl11
3c26035feb [Review] Class to namespace 2022-04-08 14:01:55 +02:00
devdl11
ff40b8b862 Merge branch 'upsilon-new-bootloader' of https://github.com/devdl11/Upsilon into upsilon-new-bootloader 2022-04-08 13:50:39 +02:00
devdl11
62e98107f7 [Reviews] Code correction and improvement 2022-04-08 13:49:44 +02:00
devdl11
7a6c211001 Update bootloader/itoa.cpp
Co-authored-by: Lauryy06 <80424145+Lauryy06@users.noreply.github.com>
2022-04-08 13:20:56 +02:00
devdl11
80f099c274 Update bootloader/usb_data.cpp
Co-authored-by: Lauryy06 <80424145+Lauryy06@users.noreply.github.com>
2022-04-08 13:17:43 +02:00
devdl11
d3754a931a Update bootloader/itoa.h
Co-authored-by: Lauryy06 <80424145+Lauryy06@users.noreply.github.com>
2022-04-08 13:17:27 +02:00
devdl11
3af3d70055 Update bootloader/itoa.cpp
Co-authored-by: Lauryy06 <80424145+Lauryy06@users.noreply.github.com>
2022-04-08 13:17:11 +02:00
devdl11
8db051474c Update bootloader/itoa.cpp
Co-authored-by: Lauryy06 <80424145+Lauryy06@users.noreply.github.com>
2022-04-08 13:17:04 +02:00
devdl11
3328bc28b9 Update bootloader/itoa.cpp
Co-authored-by: Lauryy06 <80424145+Lauryy06@users.noreply.github.com>
2022-04-08 13:16:52 +02:00
devdl11
c65b1c6d3c [Review] Review Update 2022-04-07 22:18:05 +02:00
devdl11
15801ae9e4 [DFU] Fix simulators 2022-04-07 20:07:03 +02:00
devdl11
3dfc8d749c [bootloader/storage] new bootloader and fix python issue 2022-04-07 19:56:53 +02:00
lolocomotive
9f7aba4593 Run upload to firebase only when on UpsilonNumworks/Upsilon on upsilon-dev (#197) 2022-04-06 21:43:46 +02:00
Yaya.Cout
5365718761 [bootloader] Fix building with no computer and cable icons 2022-04-05 18:23:02 +02:00
Yaya.Cout
c0c1615f14 [apps] Swap graph and rpn apps
Close #195
2022-04-03 09:56:07 +02:00
Laury
a770ee919b [code] End of revert #113 2022-03-31 22:23:21 +02:00
Laury
7e64124ddc Revert #113 because of incompatibility with the workshop 2022-03-31 22:19:54 +02:00
Andrej
e2598031c8 [escher] Changed font in Toolbox expressions to LargeFont for better readability and aesthetics (#190) 2022-03-31 16:10:05 +02:00
Yaya.Cout
2ebc1bc22f [apps] Add Shift + EE to go to the settings
Before, EE go to the settings, because ShiftEE event wasn't correctly bound :
It was bound to a simple press of the key, and not to a Shift press.
This commit keep this behavior, but add the correct binding (Shift + EE).

This fix #194.
2022-03-30 19:25:43 +02:00
Yaya.Cout
202c273c67 [apps/graph] Separate Cyan from Blue (fix #192)
This separate the Cyan colour's name from the blue, before this commit, it was the same text
2022-03-30 08:18:18 +02:00
Mino1289
45229b80cd [python] Support more operators overload (classes) (#188) 2022-03-28 20:59:21 +02:00
Laury
b675a78a87 [ion] Part of the fix for CI 2022-03-28 19:25:29 +02:00
Laury
15f0833f3b [ion] Fix compilation 2022-03-28 18:23:22 +02:00
Laury
e40d63a6ff Merge Upsilon-dev 2022-03-23 22:02:27 +01:00
Laury
323eba63e1 Merge with Omega-dev 2022-03-23 21:51:06 +01:00
Yaya-Cout
3b293c822a [apps/graph] Added a color menu in graph and list (#189)
* Revert "[github/workflows] Update Metrics to remove NumWorksBot"

This reverts commit 110f333122.

* Added a color menu in graph and list

* Fixed color select display issue and build issue

* Changed color_cell to a circle

* Revert "Changed color_cell to a circle"

This reverts commit 28dddb42af.

* Color_cell with mask

* Fixed build issue

* Color selection : Added right handle and color name display in menu

* Fixed constexpr static colorMask

* Changed font in color_parameter_controller

* Fix building without debug

* Re-Fix building without debug

* Update colors

Co-authored-by: Hugo Saint-Vignes <hugo.saint-vignes@numworks.com>
Co-authored-by: Joachim LF <joachimlf@pm.me>
2022-03-23 08:36:23 +01:00
Yaya-Cout
8ac969d772 [Feature] Backlight settings (#137)
* Added backlight settings

* Changed location of the brightness setting

* Fix row size of brightness settings

* [apps/settings/brightness] Update translations

* Fix dimmer

* Update translations

* [apps/settings] Add dimmer duration setting

* [apps/settings] Ensure of the brightness level is greater than the dimmed brightness level

* Make transition smooth

* Removed transition time setting
I personally think that this setting is completely useless except if you absolutely want a transition that is not smooth, which is weird.

* Moved everything related to brightness in one submenu

* Some refactoring

* Update defaults

* Removed unnecessary translation

* [apps/settings] Fix Shift + Minus/Plus in settings

* Apply suggestions from code review

* [apps/shared] Remove a think that I don't know what it is

* Apply review suggestions

Co-authored-by: Joachim LF <joachimlf@pm.me>
Co-authored-by: lolocomotive <lolocomotive181@gmail.com>
2022-03-22 17:59:52 +01:00
Yaya-Cout
865bacf89a [build/utilities] Add translations clean script (#179) 2022-03-20 16:10:54 +01:00
Assim ZEMOUCHI
841ac7d5f4 [ion] Fix win11 build for n0110 (#182) (#183) 2022-03-20 16:09:02 +01:00
Yaya-Cout
c92c4d8383 [apps/reader] Add slanted arrows, \in, \cdot, \cdots and \ldots (#184) 2022-03-20 16:08:39 +01:00
Laury
97a168052b [code] Improved code quality in gutter view resize 2022-03-19 23:39:44 +01:00
devdl11
42343d562c [ code ] Gutter improvement (#71) (#168) 2022-03-19 19:01:50 +01:00
Laury
3740a93a9f [ion] Fixed CI 2022-03-19 17:59:07 +01:00
Laury
6dc31401fe [bootloader] Compatibility with Omega 2.0 2022-03-17 20:05:20 +01:00
Maxime FRIESS
8c3378a723 [ion/bootloader] Fixed wrong trampoline call. 2022-03-16 00:06:24 +01:00
Maxime FRIESS
126bdd68bb Merge pull request #2 from quentinguidee/fix-assert-external-flash
[ion/external_flash] Fix SectorAtAddress assert()
2022-03-15 23:59:42 +01:00
Quentin Guidée
f1c24db90a [ion/external_flash] Fix SectorAtAddress assert() 2022-03-15 22:41:51 +01:00
Maxime FRIESS
fd4a2205f3 Merge pull request #1 from quentinguidee/fix-macos-simulator
[Simulator] Fix macOS compilation
2022-03-15 22:36:08 +01:00
Quentin Guidée
fc252672cc [Simulator] Fix macOS compilation 2022-03-15 22:14:08 +01:00
Laury
1c918f549c [ion] Try a fix to make compilation work 2022-03-13 21:43:14 +01:00
Laury
72a25ec26d [ion] Rework of storage trash 2022-03-13 21:32:35 +01:00
M4x1m3
bdfae184e9 [config.mak] Omega 2.0.0 2022-03-10 19:34:49 +01:00
M4x1m3
23936a0c63 [themes] Fixed building bootloader 2022-03-10 19:34:49 +01:00
M4x1m3
209428ca9d [bootloader] Made bootloader Upsilon-aware 2022-03-10 19:34:49 +01:00
M4x1m3
370eb14a04 [build] Fixed wrong model comparaison 2022-03-10 19:34:48 +01:00
lolocomotive
bf8f8bcb27 Fix web simulator 2022-03-10 19:34:48 +01:00
M4x1m3
fc3941511f [build] Fixed bootloader build system 2022-03-10 19:34:48 +01:00
M4x1m3
9fda743de9 [build/bootloader] Rewrote binpack 2022-03-10 19:34:48 +01:00
M4x1m3
74ef528845 [build] Added "bootloader" target 2022-03-10 19:34:48 +01:00
M4x1m3
7a2721c979 [bootloader] Allow quitting the DFU stack 2022-03-10 19:34:48 +01:00
M4x1m3
227ca616ca [bootloader] Boot other slot if a slot is invalid 2022-03-10 19:34:48 +01:00
M4x1m3
1c04949336 [bootloader] Added custom trampolines 2022-03-10 19:34:48 +01:00
M4x1m3
93099ad808 [bootloader] Expose ExternalFlash instead of Flash 2022-03-10 19:34:47 +01:00
M4x1m3
88b4e904c0 [ion/external_flash] Take absolute address for WriteMemory 2022-03-10 19:34:47 +01:00
M4x1m3
dee783065b [bootloader] Use custom USB descriptor 2022-03-10 19:34:47 +01:00
M4x1m3
5a7b076ebe [bootloader] Added dual boot 2022-03-10 19:34:47 +01:00
M4x1m3
85ef57f7ed [bootloader] Added userland header, rewrote lernel header 2022-03-10 19:34:47 +01:00
M4x1m3
63c2b99260 [ion/simulator] Fixed simulator 2022-03-10 19:34:47 +01:00
M4x1m3
377f4eee0c [ci] Build bootloader 2022-03-10 19:34:47 +01:00
M4x1m3
a63cbcf0c2 [bootloader] Make work with Numworks workshop 2022-03-10 19:34:47 +01:00
M4x1m3
f2c17121d2 [bootloader] Added trampolines 2022-03-10 19:34:46 +01:00
M4x1m3
d16808183b [bootloader] MPU config 2022-03-10 19:34:46 +01:00
M4x1m3
6eabe9acae [ion/n0110] Fixed invalid assert in external flash driver 2022-03-10 19:34:46 +01:00
M4x1m3
e1dcbad18a [bootloader] Run usb stack on Reset+4 2022-03-10 19:34:46 +01:00
M4x1m3
4fe84a4959 [bootloader] Added slot definition 2022-03-10 19:34:46 +01:00
M4x1m3
272797f31f [bootloader] Added bootloader 2022-03-10 19:34:46 +01:00
M4x1m3
c635f4e2b9 [ci] Add building Omega for bootloader 2022-03-10 19:34:46 +01:00
M4x1m3
c8ba2fd268 [build/bootloader] Allow building slot A and B 2022-03-10 19:34:46 +01:00
M4x1m3
3a391261c7 [ion/bootloader/usb] Removed internal flash from descriptior 2022-03-10 19:34:45 +01:00
M4x1m3
2da1610b27 [build/bootloader] Include extrnal 2022-03-10 19:34:45 +01:00
M4x1m3
5e130cc4f2 [ion/bootloader] Made suspend work 2022-03-10 19:34:45 +01:00
M4x1m3
2b5a773993 [ion/bootloader] Made exam mode work 2022-03-10 19:34:39 +01:00
BAALBAKYA
19e5562228 2 corrections of bugs about the battery level in the settings (#148)
* added battery level handler for simulator

* added battery level > 100% when charging

* corrected version

* laury version but with float type

* Update apps/settings/sub_menu/about_controller.cpp

* Update apps/settings/sub_menu/about_controller.cpp

Co-authored-by: = <=>
Co-authored-by: Lauryy06 <80424145+Lauryy06@users.noreply.github.com>
2022-03-03 17:16:24 +01:00
Yaya.Cout
9edf026110 [python] Fix brackets in get_keys() 2022-03-01 18:59:22 +01:00
M4x1m3
ffb4c39e04 [ion] Added bootloader device 2022-02-27 00:32:24 +01:00
M4x1m3
61673cd1b5 [apps] Reduced heap to make room for SVC table 2022-02-25 15:07:47 +01:00
Laury
f95f9ebb2d [poincare] Better simplification of sequences 2022-02-24 18:48:10 +01:00
Laury
23af100ed5 [poincare] Allow replacement of sequences by their definition if rank is an integer 2022-02-24 18:05:30 +01:00
Laury
c7516f1464 [settings] Fixed name of contributors 2022-02-22 20:44:16 +01:00
Laury
23a94b7f50 [calculation] Simplify angles in additional outputs and fix an assert in calculation store 2022-02-21 17:30:27 +01:00
Laury
af5f9ea578 [ion/storage] Added the "ctrl-z" system everywhere 2022-02-19 12:09:02 +01:00
Laury
f3d632c462 [apps/calculation] Add a "ctrl-z" system 2022-02-15 22:24:50 +01:00
Laury
893a2a550d [reader] Fixed a bug in list of books 2022-02-14 20:52:33 +01:00
Laury
2443fa7d57 Merge branch 'upsilon-dev' of https://github.com/UpsilonNumworks/Upsilon into upsilon-dev 2022-02-11 19:52:34 +01:00
Yaya-Cout
4f0f41be56 [python] Add FStrings support (#155) 2022-02-09 22:21:07 +01:00
Yaya-Cout
5eb0598107 [apps/code] Add documentation on math.factorial (#146) 2022-02-06 19:06:48 +01:00
LeMoustachu
43b56f3a89 Update doc titlebar to match upsilon color. (#145) 2022-02-05 19:01:47 +01:00
Laury
034fc65bc2 [settings] Updated contributors ! 2022-02-05 19:00:33 +01:00
LeMoustachu
9ab3e6c715 remove white reader icon background in omega_dark (#144) 2022-02-05 13:49:47 +01:00
Jules
d8f93709b8 Update README.fr.md (#142) 2022-02-04 13:14:32 +01:00
Laury
708070c284 [calculation] Fix (again) a bug in second degree additional output 2022-02-02 23:16:52 +01:00
Laury
9632b59b67 [reader] Separated .urt and .txt files 2022-02-02 23:16:52 +01:00
LeMoustachu
a0afbe9916 Update building docs and french readme (#136) 2022-02-02 22:19:36 +01:00
Yaya-Cout
100917f29f [build] Add auto translate script (#140) 2022-02-02 22:18:45 +01:00
Yaya-Cout
814e2dee06 [python] Enable math.factorial (#141) 2022-02-02 22:18:04 +01:00
lolocomotive
1a546e011b Upload artifacts to google cloud (#138) 2022-02-01 19:43:46 +01:00
Yaya-Cout
1faac23ee8 [apps/settings] Fix assert in about submenu when username enabled (#134) 2022-01-25 20:17:07 +01:00
Yaya-Cout
38614a849f [apps/python] Add set_brightness and get_brightness in Ion module (#132) 2022-01-25 18:58:25 +01:00
Yaya-Cout
24205a7e03 Fix CI and replacement character (#133) 2022-01-24 18:22:07 +01:00
Yaya-Cout
f4ce415e32 [apps/code] Fix multiplication in Python app on simulator (#126) 2022-01-21 16:51:58 +01:00
Yaya-Cout
169fb7404e Fix spelling (#128)
* Fix spelling in .cpp files

* Fix spelling in all files
2022-01-20 17:21:35 +01:00
Laury
e575ffc7ce [apps/code] Shift + OK don't quit toolbox 2022-01-15 21:33:32 +01:00
Laury
f591816122 [apps/functions] Save if user want display derivative even when quitting the app 2022-01-15 12:40:06 +01:00
Laury
cbbe7ef6ac [poincare] Fix bug in equal simplifcation 2022-01-15 11:07:06 +01:00
Yaya-Cout
f862cb023a [apps/code] Add a setting for cursor saving (#125) 2022-01-14 13:42:30 +01:00
Laury
f296778014 [python] Moved get_keys to ion module 2022-01-14 13:36:11 +01:00
Laury
16eaab3b52 [apps/calculation] Make the second_degree_controller works 2022-01-13 18:57:34 +01:00
Laury
77707cd930 [kandinsky] Fix bugs in fill_polygon and removed the limit of 32 points 2022-01-13 17:23:25 +01:00
apoleon33
a3e2c9732f fix link to the discord (#122) 2022-01-12 22:25:26 +01:00
Overengined
98c919db88 added mention of the installer in the readme (#119) 2022-01-10 22:20:30 +01:00
Yaya-Cout
8126e0da7e Fix cursor storage (#120) 2022-01-10 20:53:38 +01:00
Laury
685e73c52d [reader] Make reader works ! 2022-01-09 21:47:53 +01:00
Laury
64a90422c4 [settings] Removed auto usb reactivation 2022-01-09 21:47:53 +01:00
Laury
fea588bd9d [escher/timer] Little code quality improvement 2022-01-09 21:47:53 +01:00
Laury
9595ed1570 [calculation] Fix a bug in second degree controller 2022-01-09 21:47:53 +01:00
Laury
4f63100195 [theme] Added reader icons 2022-01-09 21:47:52 +01:00
Laury
ed06b4e48b [python/ulab] Updated ulab 2022-01-09 21:47:52 +01:00
Laury
d5dbb8df6f [reader] Make fonts better 2022-01-09 21:47:51 +01:00
Mino1289
fdef2b5d6e Merge branch 'upsilon-dev-latex' 2022-01-09 21:47:51 +01:00
Laury
7fc28f8b72 [reader] Added detection of rich text files (.urt) TODO: parse differently this files 2022-01-09 21:47:51 +01:00
lolocomotive
2248e415c4 Separate Upsilon and Omega versions (#112) 2022-01-04 20:37:46 +01:00
lolocomotive
1da537479f Fix CI (#115) 2021-12-28 21:51:52 +01:00
devdl11
0860e48cb6 For those who likes to code ❤ (#113) 2021-12-28 15:13:01 +01:00
Yaya-Cout
70b162e63b Fix web simulator and binpack build (#114) 2021-12-28 15:12:13 +01:00
Joachim Le Fournis
398e974ccd Fix ODR warnings (#107) 2021-12-22 17:40:28 +01:00
Yaya-Cout
d57e19ae70 Add natural dimer (#106) 2021-12-18 14:34:35 +01:00
Mino1289
87a5dc354d [apps/calculation/additional_output] Adding parenthesis. (#97) 2021-12-17 22:17:21 +01:00
Yaya-Cout
cd3f5225bb Various fixes (#102) 2021-12-17 19:12:24 +01:00
Lauryy06
139ef4a052 Merge pull request #104 from lemoustachu/upsilon-dev 2021-12-17 18:58:47 +01:00
Lauryy06
66afb977db Merge pull request #103 from lolocomotive/patch-2 2021-12-17 18:57:22 +01:00
Lauryy06
cb9dc38fa9 Merge pull request #101 from Yaya-Cout/mpy-update 2021-12-17 18:43:53 +01:00
LeMoustachu
67e42aaac3 Readme update for wsl usb support 2021-12-17 17:54:44 +01:00
lolocomotive
f1be48bdb1 Use a fallback theme
This allows themes to be incomplete (with missing values), which leads to following benefits:
- Older themes that have not been updated to have the latest colors will not result in compilation errors
- If you only want to change one single color you don't have to copy the whole json file which makes it much more readable
2021-12-15 23:38:54 +01:00
Yaya.Cout
ed5cff15c6 Fix sys in Python toolbox 2021-12-15 18:35:41 +01:00
Lauryy06
963647d59f Merge pull request #100 from Yaya-Cout/mpy-update
MicroPython update
2021-12-15 14:36:46 +01:00
Yaya.Cout
a14f2015cf Remove sys module 2021-12-15 14:31:07 +01:00
Yaya.Cout
dbbf27e59b Fix sys module 2021-12-15 13:40:13 +01:00
ArtichautCosmique
65b3a2857f [ion/simulator/assets] New background.jpg (#99) 2021-12-15 13:39:51 +01:00
devdl11
dd48235721 USB Protection correction (#90) 2021-12-14 21:51:53 +01:00
Yaya.Cout
46041e8e9a Fix Matplotlib 2021-12-14 19:06:50 +01:00
Yaya.Cout
38faecda29 Update MicroPython from 1.12 to 1.17 2021-12-14 18:18:45 +01:00
ArtichautCosmique
0bd30ed2e6 [ion/simulator/assets] New icons Upsilon flavored (#98) 2021-12-13 19:37:12 +01:00
Laury
5cbce3c116 [calculation] Fix a bug in second degree controller 2021-12-09 19:05:42 +01:00
ArtichautCosmique
665de51bae [toolbar] Fix battery icon width when "half full battery" (#93) 2021-12-08 22:12:52 +01:00
apoleon33
47e3036afd [readme] changed link to the discord server (#88)
in the LISEZ_MOI.md
2021-11-29 20:27:29 +01:00
Yaya-Cout
1df3ef87e6 [apps/settings] Fix voltage in settings (#86)
* [apps/settings] Fix voltage in settings

* [apps/settings] Fix batteryLevel size
2021-11-28 19:07:48 +01:00
Laury
4222137549 [apps/code] Improve code style in syntax highlighting setting 2021-11-27 13:42:47 +01:00
Yaya-Cout
806b11b589 [apps/code] Add a setting for syntax highlighting (#85) 2021-11-27 12:34:09 +01:00
Laury
fb4b2ffdfa [usb | recovery] Make the code works 2021-11-26 23:41:53 +01:00
Laury
d2ec87d9fd Merge branch 'upsilon-dev-usb-protection' into upsilon-dev 2021-11-21 21:53:53 +01:00
Laury
6b12d1aebf [settings] Translations and bug fixed 2021-11-21 21:53:33 +01:00
Laury
9afb42716d [usb | recovery] Improve code quality 2021-11-21 21:48:51 +01:00
Thibaut
2d4c0f18d0 Update of a name in the list of contributors (#83) 2021-11-18 19:24:51 +01:00
lolocomotive
918c9249db Partly fix #66 (#82)
Removed the double V appearing sometimes
2021-11-17 12:19:44 +01:00
Quentin Guidée
cf33f84106 [config.mak] Omega 1.23.0 2021-11-11 22:13:07 +01:00
ArtichautCosmique
df7b97bb87 [toolbar] Pimp my battery (#80) 2021-11-11 18:48:01 +01:00
devdl11
e8a1bc6149 Creation of a protection system against unintentional updates to Epsilon 16 (foundation) + Recovery Improvement (#37) 2021-11-11 18:20:16 +01:00
Lauryy06
b304a2ff7d [github] Update bug_report.md 2021-11-11 17:47:12 +01:00
Mino1289
50ee8021f3 [apps/settings] Fixing newline with Flag checking (#77) 2021-11-09 19:28:45 +01:00
lolocomotive
ed7e0bd915 Show battery percentage in about menu (#69) 2021-11-05 13:46:42 +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
M4x1m3
5a6dfd8a20 [ci] Remove duplicate tests action 2021-07-07 12:09:08 +02:00
Hyperengined
c8afdcacab [ion/battery] Doubled hysteresis to avoid sudden fluctuactions 2021-07-07 11:49:19 +02:00
Fevret
ef45fab63d [themes] Improved epsilon-dark icons 2021-07-07 11:43:14 +02:00
Laury
0366c4cd00 [home] Added support for a wallpaper in a special format (.obm) 2021-07-06 16:48:57 +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
Maxime FRIESS
c3b752d6cc Merge pull request #544 from ArtichOwO/omega-dev-OS-attributes
[MPY/MOD/OS] Added new function and attribute to OS module
2021-06-29 21:06:11 +02:00
Maxime FRIESS
c5ca1e916a Merge branch 'omega-dev' into omega-dev-OS-attributes 2021-06-29 20:52:29 +02:00
ArtichOwO
24f3ccf007 Removed username from "uname()", and "getlogin()" now uses "Ion::username()" 2021-06-29 20:41:12 +02:00
ArtichOwO
25b74ea2f8 Removed "Omega or Epsilon" check 2021-06-29 20:40:19 +02:00
Maxime FRIESS
0e7db3ce8a Merge pull request #548 from Pixelpunker/omega-dev
Some corrections and many additions to German translation, mostly Python toolbox
2021-06-29 17:52:45 +02:00
Pixelpunker
786a3273da All translated german strings limited to 35 characters 2021-06-29 17:11:10 +02:00
Pixelpunker
ed54927c5b Fix for 4 translation keys 2021-06-28 16:41:40 +02:00
Pixelpunker
2ee86ce52f Fix build error "BetaVersionMessage4" 2021-06-28 16:31:52 +02:00
Pixelpunker
a3720d3d76 Some corrections and many additions to German translation, mostly Python toolbox 2021-06-28 16:09:49 +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
ArtichOwO
ba94c7db00 [Code/Toolbox] Added "getlogin()" to code toolbox 2021-06-21 23:24:50 +02:00
ArtichOwO
4c29b05b53 [MPY/MOD/OS] Added "name" attribute, "getlogin()" function and "username" key in "uname()"
"os.name" returns either "Omega" (only if OMEGA_VERSION is defined) or "Epsilon"
"os.getlogin()" returns the calculator owner username
"os.uname()" returns an object which has now the "username" attribute
2021-06-21 19:34:26 +02:00
Maxime FRIESS
85f8f4fedd Merge pull request #538 from RedGl0w/omegaV15-5
Omega with epsilon 15.5
2021-06-20 22:22:26 +02:00
Maxime FRIESS
e62c328661 Merge pull request #536 from RedGl0w/omegaFixCI
[code/tests] Fix issue with toolboxIonKeys
2021-05-27 18:55:16 +02:00
Joachim LF
080ac51aae [Simulator/android] Fix language auto selection 2021-05-15 09:19:01 +02:00
Joachim LF
bf5f24f96c [Simulator/windows] Fix deleted file 2021-05-14 21:10:47 +02:00
Joachim LF
7e24502414 [Simulator] Use std::cout and added dummy store_script 2021-05-14 20:04:59 +02:00
Joachim LF
dd45419006 [Simulator/windows] fix build 2021-05-14 19:45:57 +02:00
Joachim LF
aba2388253 [Ion/web] Fix build 2021-05-14 19:41:37 +02:00
Joachim LF
5fca77a8f8 [Build] Disable telemetry 2021-05-14 14:18:10 +02:00
Joachim LF
f258da16f1 [Build] revert binpack move 2021-05-14 14:16:41 +02:00
Joachim LF
35e4146551 [Workflow/unit] change target name 2021-05-14 13:35:44 +02:00
Joachim LF
76dad83aec [n0110] Disable OTP lock 2021-05-14 13:29:49 +02:00
Joachim LF
f999c796c3 [Upstream] Merged epsilon 15.5 2021-05-14 13:28:22 +02:00
Maxime FRIESS
f86c22f10b Merge pull request #528 from RedGl0w/patch-20
Delete .gitlab-ci.yml
2021-05-12 23:58:36 +02:00
Maxime FRIESS
c841362a63 Merge pull request #535 from RedGl0w/fixLocalization
[shared/localization] Fix theme palette
2021-05-12 23:55:35 +02:00
Joachim LF
33ad74e1be [code/tests] Fix issue with toolboxIonKeys 2021-05-12 19:56:34 +02:00
Joachim Le Fournis
e4aa82e62a [shared/localization] Fix theme palette
this fixes https://github.com/Omega-Numworks/Omega/issues/534
2021-05-12 12:06:18 +02:00
Joachim Le Fournis
f40fe27b68 Delete .gitlab-ci.yml 2021-04-26 12:09:58 +02:00
Gabriel Ozouf
3e071a59fe build: Version 15.5.0 2021-04-16 10:53:34 +02:00
Gabriel Ozouf
f50f22081c [apps/main] Move lockUnlockedPCBVersion to ion_main
Although we always include the on-boarding when releasing a firmware,
moving this method here costs nothing and prevents mistakes if we ever
decide to remove on-boarding.
2021-04-16 10:46:10 +02:00
Gabriel Ozouf
313b5ed222 [apps/settings] Add comment on version cycle display 2021-04-16 10:46:10 +02:00
Gabriel Ozouf
f8798aa561 [ion] Move pcbVersion method to its own file 2021-04-16 10:46:10 +02:00
Gabriel Ozouf
46acd4eb61 [ion/device/n0110/internal_flash] Add method OTPLockAddress 2021-04-16 10:46:10 +02:00
Gabriel Ozouf
018ea07796 [ion/device] Add comments and rename variables for clarity 2021-04-16 10:46:10 +02:00
Gabriel Ozouf
d7f41e306c [ion/device/n0100] Add comment on dummy PCB version methods 2021-04-16 10:46:10 +02:00
Gabriel Ozouf
029dc2be5e [build/targets.device.n0110] Move flag before target
This is in keeping with the order set up in build/all.mak.
2021-04-16 10:46:10 +02:00
Gabriel Ozouf
bf99a2976b [build] Improve comments 2021-04-16 10:46:10 +02:00
Gabriel Ozouf
03c85c0b0e [ion/device/external_flash] Move model specific code
As the N0100 does not have an external flash chip, the code to handle
the external flash does not need to be compiled on this model.
2021-04-16 10:46:10 +02:00
Gabriel Ozouf
bd0c7de2bf [ion] Create method to lock PCB versions on old boards 2021-04-16 10:46:10 +02:00
Gabriel Ozouf
08f351fe31 [settings] Add PCB version to software version / patch level cycle 2021-04-16 10:46:10 +02:00
Gabriel Ozouf
0282104086 [ion] Add getter method for PCB version in string form 2021-04-16 10:46:10 +02:00
Gabriel Ozouf
ed95b46c5b [build/n0110] Set PCB_LATEST to proper PCB version 2021-04-16 10:46:10 +02:00
Gabriel Ozouf
b8727bc256 [ion/device] Rename some PCB version methods 2021-04-16 10:46:10 +02:00
Gabriel Ozouf
5ccf8d6b97 [ion/device/external_flash] Add dsb instruction in method wait
This mimics the behavior of InternalFlash::wait, and fixes a bug found
on the bench when reading the flashed firmware.
2021-04-16 10:46:10 +02:00
Gabriel Ozouf
b80daf70d3 [ion/device/n0110/usb] Consolidate configs of Vbus pin
Even though the configuration of the Vbus pin depends on the hardware
running Epsilon, we do not actually need one VbusPin object for each
configuration. Indeed, an AFGPIOPin object can be used to configure the
pin as a standard GPIO, provided one does not call its init() method.
2021-04-16 10:46:10 +02:00
Gabriel Ozouf
36655f1c19 [ion/device/n0110] Change getter for OTPAddress 2021-04-16 10:46:10 +02:00
Gabriel Ozouf
ed18f1e95f [ion/device] Lock OTP after writing version 2021-04-16 10:46:10 +02:00
Gabriel Ozouf
cbb435d656 [ion/device] Adapt behaviour in factory
When flashing fo the first time, we need Epsilon to know the PCB version
before the OTP are flashed. We also need the to prevent Epsilon from
writing the OTP outside of the factory.
2021-04-16 10:46:10 +02:00
Gabriel Ozouf
00b74430cd [build] Add mendatory USE_IN_FACTORY variable to binpack rule
This variable specifies whether the binpack is used for first-time
flashing on assembly-line, or for diagnostic later on.
2021-04-16 10:46:10 +02:00
Gabriel Ozouf
8705ddaf8a [ion/device/bench] Add command to write and validate PCB version 2021-04-16 10:46:10 +02:00
Gabriel Ozouf
ddae6607f9 [ion/device/n0110] Deduce Vbus config from PCB version
Revised PCB (version number > 0) should configure Vbus as a GPIO instead
of an alternate function.
2021-04-16 10:46:10 +02:00
Gabriel Ozouf
c4ef2016ba [ion/device/n0110] Methods to read and write PCB version in OTP 2021-04-16 10:46:10 +02:00
Gabriel Ozouf
524a7d9619 [ion/device/n0110] Define OTP blocks in internal flash 2021-04-16 10:46:10 +02:00
Gabriel Ozouf
e456667d5e [ion/device] Add parameter PCB_LATEST
This indicates the latest PCB revision on which this version of Epsilon
can run.
2021-04-16 10:46:10 +02:00
Léa Saviot
3000431f3b build: Version 15.3.6 2021-03-29 10:20:17 +02:00
Léa Saviot
50a32b470d [ion/drivers/external_flash] Remove assertion unvalid on n0100 2021-03-29 10:20:17 +02:00
Léa Saviot
3746354f26 [ion/external_flash] Code cleaning 2021-03-29 09:55:00 +02:00
Léa Saviot
8fae36bcd3 [ion/external_flash] Use both possible commands for QuadPageProgram 2021-03-29 09:55:00 +02:00
Léa Saviot
9e9c088e9e [ion/external_flash] Code cleaning 2021-03-29 09:55:00 +02:00
Léa Saviot
a635ecf59b [ion/external_flash] Make the AT25SF641B work
Main changes are:
- No QPI but QuadSPI
- Use 32 command instead of 33
- Better programming of the instruction/address/data modes, according to
the 641B spec
- Use sOperatingMode instead of DefaultOperatingMode

TODO:
- Support both QPI and QuadSPI, for both flashs
- There is still confusion between sOperatingMode and DefaultOperatingMode
  -> DefaultOperatingMode should not really be used
  -> Read and write commands assume quad operation
2021-03-29 09:55:00 +02:00
Hugo Saint-Vignes
a6ae1957d1 build: Version 15.3.5
Change-Id: I79e237766ba64f1e14b8e2889611153437ee6775
2021-03-24 10:49:08 +01:00
Hugo Saint-Vignes
3686f819d6 [ion/src/simulator] Add headers and fix Macros for iOS
Change-Id: I0f1f888e4823fc9a80a7ac986cf8732dc9df2998
2021-03-24 10:12:11 +01:00
Hugo Saint-Vignes
382c303bd2 [build] Update EPSILON_TELEMETRY variable precedence 2021-03-23 14:49:09 +01:00
Hugo Saint-Vignes
402858739e [ion/simulator/android] Fix method signature
Change-Id: I7ac83b8b3a4eca82313e9de3e3d9f5a76ff92951
2021-03-23 14:48:40 +01:00
Hugo Saint-Vignes
192794e299 [ion/simulator/android] Delete JNI local references in platform_language.cpp
Change-Id: I28251ec57ed0c87922efc2689f587f6bc0daaa76
2021-03-23 14:48:29 +01:00
M4x1m3
6f797833b2 [omega] 1.22.1 2021-03-21 20:31:06 +01:00
M4x1m3
44d745eff3 [apps] Updates atomic 2021-03-21 20:24:23 +01:00
Cyprien Méjat
4e7a846540 [config.mak] Dev Branch 1.22 incrementation (#517) 2021-03-21 18:24:46 +01:00
M4x1m3
a35fb141c4 [ion] Made username volatile
This ensures the compiler doesn't assume that the username is fixed, allowing
us top change it before flashing, to let the user change his username.
2021-03-20 20:14:12 +01:00
Léa Saviot
58602544e2 build: Version 15.3.4 2021-03-17 09:52:00 +01:00
Cyprien Méjat
4242c77d64 [themes] Omega Atomic dark theme (#516)
* update dark mode in atomic

* Fix mistake

* update atomic epsilon dark
2021-03-16 23:55:44 +01:00
Quentin Guidée
58ff19858f [omega] 1.22.0 2021-03-15 21:54:08 +01:00
M4x1m3
f1d15022aa [apps/code] Removed keys from HU catalog 2021-03-15 21:46:56 +01:00
Maxime FRIESS
fc3986f65a Merge pull request #513 from RedGl0w/IonToolboxEpsilon
[Code] Added ion keys submenu
2021-03-15 21:42:50 +01:00
Maxime FRIESS
b795834c63 Merge branch 'omega-dev' into IonToolboxEpsilon 2021-03-15 21:23:35 +01:00
M4x1m3
9c8112658e Fixed device build 2021-03-15 21:05:52 +01:00
Maxime FRIESS
ed86abebde Merge pull request #511 from RedGl0w/strcmp
Strcmp
2021-03-15 20:49:52 +01:00
M4x1m3
671321db10 Merge branch 'RedGl0w-kmat' into omega-dev 2021-03-15 20:48:54 +01:00
M4x1m3
3ccd7d0fb7 Merge branch 'kmat' of https://github.com/RedGl0w/epsilon into RedGl0w-kmat 2021-03-15 20:48:43 +01:00
Maxime FRIESS
4f34cd17a1 Merge pull request #510 from RedGl0w/patch-12
[Calculation/expression_field] EE add Ans
2021-03-15 20:28:00 +01:00
M4x1m3
5cd22c9429 Merge branch '0b101-epsilon-appShortcuts' into omega-dev 2021-03-15 20:24:45 +01:00
M4x1m3
893539b76e Merge branch 'epsilon-appShortcuts' of https://github.com/0b101/Omega into 0b101-epsilon-appShortcuts 2021-03-15 20:24:33 +01:00
Joachim LF
b2e2f3c5a6 [Code] Added ion keys submenu 2021-03-15 20:10:54 +01:00
Maxime FRIESS
48ec836129 Merge pull request #508 from RedGl0w/CRLF
[Ion/clipboard] Remove CR when there's LF next
2021-03-15 19:52:51 +01:00
M4x1m3
3d320b2768 Merge branch 'Lauryy06-master' into omega-dev 2021-03-15 19:50:33 +01:00
M4x1m3
134456267b Merge branch 'master' of https://github.com/Lauryy06/epsilon into Lauryy06-master 2021-03-15 19:50:10 +01:00
Maxime FRIESS
d2df42bc35 Merge pull request #506 from RedGl0w/DrawStringFont
Draw string font
2021-03-15 19:34:39 +01:00
Maxime FRIESS
20d7094352 Merge branch 'omega-dev' into DrawStringFont 2021-03-15 19:31:16 +01:00
Maxime FRIESS
d95b50abef Merge pull request #505 from numworks/master
Pull epsilon master
2021-03-15 19:29:12 +01:00
M4x1m3
ed03aae9ed [apps] Fixed missing dynamically-generated dependency 2021-03-15 17:29:37 +01:00
Maxime FRIESS
32f567c60a Merge pull request #504 from quentinguidee/omega-dev-atomic-theme
[themes] Change Atomic app theme
2021-03-13 23:55:47 +01:00
Quentin Guidée
83e6fc9579 [themes] Change atomic theme 2021-03-13 23:43:45 +01:00
M4x1m3
73585d9f48 Changed from Atom to Atomic in README 2021-03-12 18:16:12 +01:00
M4x1m3
8a400b7871 Updated atomic 2021-03-12 18:11:46 +01:00
Laury
297fbd3c00 [python] Add a draw_line function in kandinsky 2021-03-11 19:47:22 +01:00
Léa Saviot
ece6aa5f27 [build/targets.simulator.web.mak] Rule for htmlpack.official.zip 2021-03-10 11:49:57 +01:00
Joachim LF
8feb8e3ea2 [Python/kandinsky] Added font constant 2021-03-08 18:03:15 +01:00
Joachim LF
7b57f31fbf [Python/kandinsky] Added in draw_string choice of font 2021-03-08 17:56:49 +01:00
Émilie Feral
6b8db108d2 [build] Add comment to dfu.py 2021-03-08 10:53:01 +01:00
Joachim LF
cf8ecfb438 [pyUSB] Update to V1.1.1 a54ebc7 2021-03-08 10:53:01 +01:00
Joachim LF
5605515fa1 [Ion/clipboard] Remove CR when there's LF next 2021-03-05 10:42:15 +01:00
Romain Goyet
30cfa022d1 [ion] Don't set the window title when screen only
Prevents the web simulator from overriding the HTML page's title
2021-03-03 12:37:15 -05:00
Léa Saviot
23f3407267 build: Version 15.3.3 2021-03-03 15:59:44 +01:00
Léa Saviot
1006b951b9 [ion/src/simulator] Fix journal.cpp 2021-03-03 15:37:57 +01:00
Romain Goyet
43b7f767ee [ion/simulator/web] Clean the htmlpack API 2021-03-03 15:37:57 +01:00
Romain Goyet
eb0ca7b118 [ion/simulator/web] Add a loader 2021-03-03 15:37:57 +01:00
Romain Goyet
0cdfc44c6f [ion/simulator/web] Improve dependency tracking 2021-03-03 15:37:57 +01:00
Romain Goyet
2ebff40c62 [ion/simulator/web] Implement a custom journal with callbacks
This journal adds two new callbacks:
 - onIonEvent
 - onEpsilonIdle
2021-03-03 15:37:57 +01:00
Romain Goyet
c66db8c98d [ion] Actually send None events to the destination journal
Said journal will most likely ignore it, but it gives it the opporunity
to do something about it.
2021-03-03 15:37:57 +01:00
Romain Goyet
a6b13185ab [ion/simulator] Extrude the QueueJournal class 2021-03-03 15:37:57 +01:00
Romain Goyet
e8956f4293 [build/simulator/web] Add a htmlpack target 2021-03-03 15:37:57 +01:00
Romain Goyet
36a40faaaf [build/emscripten] Silence the Emterpreter warning 2021-03-03 15:37:57 +01:00
Romain Goyet
2554ec666e [build] Add a rule to build a ZIP file out of its dependencies 2021-03-03 15:37:57 +01:00
Romain Goyet
1aac2a1d4d [ion/simulator/web] Use a shared layout.json file 2021-03-03 15:37:57 +01:00
Romain Goyet
32d591317b [simulator/web] Use specialHTMLTargets to allow picking a canvas 2021-03-03 15:37:57 +01:00
Romain Goyet
2703f9a506 [build] Add prerequisite path when processing through CPP 2021-03-03 15:37:57 +01:00
Romain Goyet
497e4890b1 [ion/simulator/web] Fix the build 2021-03-03 15:37:48 +01:00
Romain Goyet
6c389c9a1d [ion/simulator] Get rid of useless Ion:: prefixes 2021-03-03 15:37:48 +01:00
Romain Goyet
699cf22023 [ion/simulator] Don't enable the framebuffer in headless mode
A quick test on a state file with 64k events took 2.5 seconds to process
with the framebuffer vs 1.9 without.
2021-03-03 15:37:48 +01:00
Romain Goyet
543d3d540e [ion/simulator] Use shutdown instead of quit 2021-03-03 15:37:48 +01:00
Romain Goyet
2f2e45a6a5 [ion/simulator] Headless simulator maps Ion::Console to stdio 2021-03-03 15:37:48 +01:00
Romain Goyet
a834c954b8 [ion/simulator] Get rid of the headless target 2021-03-03 15:37:48 +01:00
Romain Goyet
2bee7eb267 [ion] Make Ion::Events::Journal optional 2021-03-03 15:37:48 +01:00
Romain Goyet
6d18c33068 [ion/simulator] State files can have a wildcard version 2021-03-03 15:37:48 +01:00
Romain Goyet
8242113641 [ion/simulator] Ignore invalid events in nws files 2021-03-03 15:37:48 +01:00
Romain Goyet
7c8c7f79f6 [ion/simulator] Don't leak file descriptors 2021-03-03 15:37:48 +01:00
Romain Goyet
f578c24af1 [ion/simulator] Used buffer I/O
Avoid making a syscall for every single byte
2021-03-03 15:37:48 +01:00
Romain Goyet
8059821025 [ion/simulator] Fix libpng/libjpeg usage 2021-03-03 15:37:48 +01:00
Romain Goyet
b32497da23 [ion/simulator] Remove a useless printf 2021-03-03 15:37:48 +01:00
Romain Goyet
c3c7651ca8 [ion/simulator] Add Termination event when headless 2021-03-03 15:37:48 +01:00
Romain Goyet
e8f1ea6aa5 [ion/simulator/sdl] Backport an Emscripten fix for setWindowTitle
See https://bugzilla.libsdl.org/show_bug.cgi?id=5133
2021-03-03 15:37:48 +01:00
Romain Goyet
ba3109e47a [ion/simulator] Fix the dummy language implementation 2021-03-03 15:37:48 +01:00
Romain Goyet
c2f8bbaf3c [ion/simulator] Load nws files sent from the host OS 2021-03-03 15:37:48 +01:00
Romain Goyet
0587e41b3c [ion/simulator] Support writing image files per-platform
Linux uses libpng, macOS/iOS use CoreGraphics, Windows GDI+
2021-03-03 15:37:48 +01:00
Romain Goyet
ab1df4fbef [ion/simulator] Unify iOS/macOS image loading 2021-03-03 15:37:48 +01:00
Romain Goyet
a4213dcca8 [ion/simulator] Allow "-" to designate stdin 2021-03-03 15:37:48 +01:00
Romain Goyet
2cf6f15dde [ion/simulator] Allow CTRL or GUI for common shortcuts 2021-03-03 15:37:48 +01:00
Romain Goyet
f37008d8d7 [ion/simulator] Ignore empty cli arguments 2021-03-03 15:37:48 +01:00
Romain Goyet
3740e0f135 [ion/simulator] Support headless msleep 2021-03-03 15:37:48 +01:00
Romain Goyet
cb3a6694a5 [ion/simulator/macos] Register the nws file extension 2021-03-03 15:37:48 +01:00
Romain Goyet
cba596dde7 [ion/simulator] Add actions 2021-03-03 15:37:48 +01:00
Romain Goyet
11f2b92e5d [ion/simulator/windows] Add an icon 2021-03-03 15:37:48 +01:00
Romain Goyet
a69fc679a9 [ion/simulator] Add StateFile support 2021-03-03 15:37:48 +01:00
Romain Goyet
f4905c59a2 [ion] Events::Journal has isEmpty 2021-03-03 15:37:47 +01:00
Romain Goyet
22b6990e63 [ion/simulator/android] Get the language directly
Without using the "--language" command-line option
2021-03-03 15:37:47 +01:00
Romain Goyet
09a7b9daca [ion/simulator] Sort the platform functions 2021-03-03 15:37:47 +01:00
Romain Goyet
0116dc2e07 [ion/simulator] Add a runtime "--headless" option
We probably can ditch the static headless version
2021-03-03 15:37:47 +01:00
Romain Goyet
37b8c56b3d [ion/simulator] Clean the callbacks 2021-03-03 15:37:47 +01:00
Romain Goyet
1a4cb3ad37 [ion/simulator] Add a Journal implementation 2021-03-03 15:37:47 +01:00
Romain Goyet
d4984722cf [ion/simulator] Rename the events_platform file 2021-03-03 15:37:47 +01:00
Romain Goyet
cbc3951ab1 [ion] Add an event journal
It's pretty much just two callbacks that one can hook into to get some
events in or out of Ion.

It adds a couple useless checks and pointers to any build and could be
hidden behind a feature flag, but the extra weight is minimal.
2021-03-03 15:37:47 +01:00
Romain Goyet
62aafa7597 [ion] Fix a comment 2021-03-03 15:37:47 +01:00
Romain Goyet
baf8b8cbf0 [ion/simulator] Clean the Keyboard implementation 2021-03-03 15:37:47 +01:00
Romain Goyet
90b25ecf51 [ion] Clean some dummy files 2021-03-03 15:37:47 +01:00
Romain Goyet
d02ce2dd16 [ion] Sort dummy functions
Dummy Ion-level functions should be in the top-level shared folder. And
dummy functions for simulator headers should be in the simulator folder.
2021-03-03 15:37:47 +01:00
Romain Goyet
79985a0199 [ion/simulator] Proper argument parsing 2021-03-03 15:37:47 +01:00
Romain Goyet
f10cd19616 [ion/simulator] Factorize the main function 2021-03-03 15:37:47 +01:00
Romain Goyet
945a7b8d56 [ion/simulator] Add a Window namespace 2021-03-03 15:37:47 +01:00
Romain Goyet
784234690c [ion/simulator] Sort Ion::Timing::msleep implementations 2021-03-03 15:37:47 +01:00
Romain Goyet
fd0284756f [apps] Simplify locale lookup by code 2021-03-03 15:37:47 +01:00
Yolwoocle
ca6a0bdcb6 [apps/code] Fix French translation mistakes (#500)
Corrected a few French translation issues in Python catalogue (lis -> lit; écris -> écrit)
2021-03-03 09:19:59 +01:00
Maxime FRIESS
35c4c7fa2e Merge pull request #499 from M4xi1m3/patch-151
Fixed issues with settings
2021-03-02 16:31:53 +01:00
M4x1m3
b08f793776 [apps/settings] Fix #151 2021-03-02 16:16:23 +01:00
M4x1m3
9f380bf424 [apps/settings] Fixed broken about submenu 2021-03-02 16:09:09 +01:00
Joachim Le Fournis
d7f7bbe862 [Inliner] Use png_destroy_read_struct 2021-03-02 09:56:10 +01:00
Joachim Le Fournis
4718ff8016 [Inliner] Fixed memory leak 2021-03-02 09:56:10 +01:00
Maxime FRIESS
a25ebc516a Merge pull request #498 from A2drien/credit-name
Update contributor and tester names (Omega 1.21)
2021-03-01 23:19:12 +01:00
A2drien
cabc1a9564 credit name update 2021-03-01 23:12:20 +01:00
Maxime FRIESS
acd80f06ed Merge pull request #495 from M4xi1m3/omega-atomic
[apps] Replaced atom with atomic
2021-03-01 21:52:37 +01:00
M4x1m3
c988233b84 [apps] Replaced atom with atomic 2021-03-01 20:10:58 +01:00
Maxime FRIESS
b3bba17306 Merge pull request #469 from RedGl0w/omegaSingleQuote
[Poincare/parser] support ' as derivative
2021-03-01 13:55:27 +01:00
Maxime FRIESS
668bd6ba48 Merge pull request #491 from RedGl0w/omegaUsernameHidden
[Settings] Always compile with empty username, and don't dipslay
2021-03-01 13:40:28 +01:00
Maxime FRIESS
af1be64644 Merge pull request #474 from M4xi1m3/units
Fixed python in debug and -j build issues
2021-02-28 09:38:02 +01:00
Maxime FRIESS
ea71a83143 Merge pull request #493 from M4xi1m3/patch-492
[external] Fixed #492
2021-02-27 23:52:04 +01:00
M4x1m3
30f1d8464c [external] Fixed #492 2021-02-27 23:42:06 +01:00
Joachim LF
6072307e34 [Settings] Always compile with empty username, and don't dipslay 2021-02-26 08:19:50 +01:00
Maxime FRIESS
4926e273ed Merge pull request #479 from Calvineries/omega-dev
ScriptSize French Translation
2021-02-25 15:25:28 +01:00
Maxime FRIESS
27ea26b03f Merge pull request #490 from M4xi1m3/jni-crash
[ion/android] Fix #489
2021-02-25 11:19:36 +01:00
M4x1m3
f274b34939 [ion/android] Fix #489 2021-02-25 10:00:44 +01:00
Quentin Guidée
9eff895a95 [omega] 1.21.0 2021-02-24 22:25:36 +01:00
Maxime FRIESS
6e7cf88e3f Merge pull request #487 from M4xi1m3/magnify-fix
[apps] Fixed #456
2021-02-24 21:53:42 +01:00
M4x1m3
ba6ee3f1b9 [apps] Fixed #456 2021-02-24 21:47:29 +01:00
ArtichautCosmique
41554caf27 [ion] Icon for the AUR repo (#484)
flat design this time
2021-02-21 18:59:52 +01:00
ArtichautCosmique
0a807c3b69 [ion] Brand new icon for the Windows simulator (#483) 2021-02-21 15:09:32 +01:00
ArtichautCosmique
73017819ac [ion] New icon for the macOS simulator (#464)
* New icon for the macOS simulator!!

* Added a shadow to the macOS icon
2021-02-19 19:04:21 +01:00
Maxime FRIESS
d0e0ee610c Merge pull request #470 from RedGl0w/omegaCIFix
Fix tests with omega and inf new symbol
2021-02-18 19:22:51 +01:00
Maxime FRIESS
a540ef8153 Merge pull request #480 from M4xi1m3/omega-dev
[ion/web] Fixed emscripten EGL error
2021-02-18 15:48:06 +01:00
M4x1m3
a77028a36b [ion/web] Fixed emscripten EGL error 2021-02-18 14:04:04 +01:00
Calvineries
1838024934 ScriptSize French Translation 2021-02-17 01:35:01 +01:00
Maxime FRIESS
0250ad8520 Merge pull request #473 from M4xi1m3/omega-dev
[external] Fixed #454
2021-02-16 18:32:10 +01:00
lapingenieur
fcc803d7c5 [readme] Added French README (#475)
Co-authored-by: Quentin <quentin.guidee@gmail.com>
Co-authored-by: Maxime FRIESS <M4x1me@protonmail.com>
2021-02-16 10:01:00 +01:00
Maxime FRIESS
d83e712256 Merge pull request #477 from gkelly/posix-shells
[build] Remove bash-ismes
2021-02-15 19:57:23 +01:00
M4x1m3
7c51ab2130 [apps] Fixed build issue when too much cores 2021-02-15 14:57:04 +01:00
M4x1m3
6628b54218 [py] Fixed Illegal Instruction when building in debug 2021-02-15 14:56:41 +01:00
M4x1m3
6f3cb70f64 [external] Fixed memory leak #454 2021-02-15 12:23:09 +01:00
Maxime FRIESS
77ec00bc50 Merge pull request #471 from M4xi1m3/mk-app-check
[build] Throw an error when user is missing apps
2021-02-13 22:13:46 +01:00
M4x1m3
085c90353d [build] Throw an error when user is missing apps 2021-02-13 22:01:27 +01:00
Joachim LF
b09da48748 [calculation/tests] Fix tests on omega 2021-02-12 10:21:42 +01:00
Joachim LF
ef3682b904 [Poincare/tests] Added infinity symbols 2021-02-12 09:05:41 +01:00
Joachim LF
135a56b6b3 [Poincare/tests] Fix ∞ tests 2021-02-12 09:05:15 +01:00
Joachim LF
491c873c90 [Poincare/parser] support ' as derivative 2021-02-12 08:36:57 +01:00
Maxime FRIESS
f6c9bb23c6 Merge pull request #468 from M4xi1m3/i18n-fix
[i18n] Fixed missing / duplicate entries.
2021-02-10 21:26:13 +01:00
M4x1m3
17284985f7 [i18n] Fixed missing / duplicate entries. 2021-02-10 21:11:10 +01:00
lapingenieur
76e1bf8822 [*.hu.i18n] Improved Hungarian translations 2021-02-10 20:03:36 +01:00
Maxime FRIESS
540c87c71f Merge pull request #465 from LeGmask/infinity
[poincare/parser] Use infinity symbol
2021-02-10 17:28:48 +01:00
Evann DREUMONT
391904900a [apps/toolbox] Add infinity in maths/calcul toolbox 2021-02-10 17:21:12 +01:00
Evann DREUMONT
763ce87d14 [poincare/parser] Use infinity symbol
- Use infinity symbol
- Parse inf, oo, infity
2021-02-10 17:20:14 +01:00
Joachim Le Fournis
37f78c5d4d [makefiles] Fix epsilon_run on windows 2021-02-08 18:02:15 -05:00
Hugo Saint-Vignes
4f2ea99c85 build: Version 15.3.2
Change-Id: I9cf7a21e14ba042d33c06062f922d8c0191adc5c
2021-02-08 10:56:34 +01:00
Hugo Saint-Vignes
bef8719ce0 [simulator/android] Handle getSerialNumber exception
Based on SDL commit :
85c1d40792

Change-Id: Ie6810dae48f5944a515ee016f228ecf33edd8fc4
2021-02-08 10:56:34 +01:00
Hugo Saint-Vignes
ba64458660 [ion/simulator/android] Delete JNI local references
Change-Id: Idd4d6c769786fb595a357bcc3f54e67429ed1840
2021-02-08 10:56:34 +01:00
Maxime FRIESS
a60d47bd2e [ion/3ds] Changed launch logo to Homebrew 2021-02-07 18:08:29 +01:00
Maxime FRIESS
875b7b3734 Merge pull request #462 from M4xi1m3/3ds-simu-fix
[ion/3ds] Works again, added CIA target
2021-02-06 18:46:14 +01:00
M4x1m3
9773c09eba [ci] Build 3ds CIA 2021-02-06 18:38:01 +01:00
M4x1m3
fda0848036 [ion/3ds] Added CIA target 2021-02-06 18:34:53 +01:00
M4x1m3
7733378bdc [ion/3ds] Make simulator work again 2021-02-06 17:00:14 +01:00
Maxime FRIESS
3e3a6347a6 Merge pull request #460 from RedGl0w/omegaHomeFix
[Fix] Select last app with incomplete row in home
2021-02-06 16:27:03 +01:00
Maxime FRIESS
3227e7ca8a Merge pull request #452 from ArtichOwO/omega-dev
[themes] Wrong colors in Omega Dark
2021-02-06 16:25:46 +01:00
Maxime FRIESS
51ef7d7404 Merge pull request #461 from M4xi1m3/fix-ci
[Fix] Make CI work again
2021-02-06 16:16:52 +01:00
M4x1m3
da3c4a48d0 [ci] Fixed invalid YML 2021-02-06 16:05:37 +01:00
M4x1m3
ec0e72fcb8 [ci] Made CI run on push 2021-02-06 16:05:37 +01:00
M4x1m3
8a45b3d552 [ci] Moved unit tests to separate workflow 2021-02-06 16:05:27 +01:00
M4x1m3
d35e93901c [ci] Reintroduced 3DS with toggle switch 2021-02-06 15:11:54 +01:00
M4x1m3
8f380adc4f [ci] Fixed checkout and wrong makefile 2021-02-06 10:27:27 +01:00
Joachim LF
61a015b6f1 [Fix] Select last app with incomplete row in home 2021-02-06 09:28:56 +01:00
0b101
aa51661aa7 Added app shortcuts 2021-02-05 16:58:55 -06:00
Hugo Saint-Vignes
73172f8d0c [ion/simulator/android] Add assert, remove TODO
Change-Id: Id818d0cd9a83727171ebe675ee50e35ef64e31d0
2021-02-05 17:51:40 +01:00
Hugo Saint-Vignes
5a20d914df [ion/simulator/android] Fix haptic feedback memory leaks 2021-02-05 17:31:46 +01:00
Hugo Saint-Vignes
05e6fbbcca [ion/simulator/android] Fix haptic feddback type return 2021-02-05 17:31:27 +01:00
ArtichOwO
66ea24584c [Theme] Wrong colors in Omega Dark 2021-01-30 11:22:13 +01:00
Quentin
859976423f Merge pull request #451 from RedGl0w/someFixOnOmega21
Added env var for omega state
2021-01-29 12:26:27 +01:00
Quentin
f052ad7bf8 [.github/issue_template] New issue templates 2021-01-29 12:22:16 +01:00
Joachim LF
61646ccabc Added env var for omega state 2021-01-29 12:21:40 +01:00
Quentin Guidée
116cbf7df4 [.github/issue_template] Remove issue templates temporarily 2021-01-29 12:13:23 +01:00
Quentin Guidée
1354b3e4f3 [apps/settings] Add Omega to exam mode warnings 2021-01-29 11:48:55 +01:00
Quentin
5e91b12836 Merge pull request #449 from RedGl0w/someFixOnOmega21
Some fix on omega21
2021-01-29 10:34:50 +01:00
Cyprien Méjat
3b74553ed7 [escher] Fix color of the "auto" and "equal" axes buttons (#450) 2021-01-28 22:23:26 +01:00
Joachim LF
44fc94469e [code] Fix movement in input 2021-01-28 20:02:45 +01:00
Joachim LF
40b81313cb [Exam] Fixed exam mode to omega one 2021-01-28 20:02:31 +01:00
Quentin
0c01ccb13e Merge pull request #446 from RedGl0w/omegaE15
Fix home external apps display and accessibility
2021-01-23 15:30:31 +01:00
Joachim LF
71449239c8 Fix external apps display 2021-01-22 18:39:21 +01:00
Joachim LF
917e753426 Fix display issue 2021-01-22 17:56:58 +01:00
Quentin Guidée
134f1da4b0 [build/config] Fix Epsilon Version in settings 2021-01-22 15:06:52 +01:00
Quentin Guidée
0a3754aa23 [apps/*.i18n] Fixes for E15 2021-01-22 13:56:35 +01:00
Quentin Guidée
cb9f9e0e40 [.submodules] Update RPN submodule 2021-01-22 13:33:43 +01:00
Quentin
11f41a97d4 Merge pull request #445 from RedGl0w/omegaE15
[Update] Epsilon 15.3.1
2021-01-22 13:09:26 +01:00
Joachim LF
738a477b66 [Theme] Fix button_state 2021-01-21 19:56:22 +01:00
Joachim LF
9b17d1b882 [Update] Epsilon 15.3.1 2021-01-21 19:56:06 +01:00
Émilie Feral
11ef4bd996 build: Version 15.3.1 2021-01-07 12:47:23 +01:00
Émilie Feral
ed2d5e3b2d [simulator/android] Bump targetSdkVersion 2021-01-07 12:46:43 +01:00
Émilie Feral
49b74fb475 build: Version 15.3.0 2021-01-06 16:31:07 +01:00
Émilie Feral
e8887a4e70 [poincare] Remove unused variable 2021-01-06 16:30:07 +01:00
Hugo Saint-Vignes
5e7d93b331 [apps/statistics] Update and replace comment 2021-01-05 16:43:01 +01:00
Hugo Saint-Vignes
83722342f7 [apps/statistics] Reload CurveView before drawing histogram labels 2021-01-05 16:43:01 +01:00
Hugo Saint-Vignes
a42208f773 [apps/shared] Handle null labelStep in numberOfLabels 2021-01-05 16:33:48 +01:00
Hugo Saint-Vignes
9f0c7a87fd [apps/shared] Use sizeof data 2021-01-05 11:38:21 +01:00
Hugo Saint-Vignes
990c45b661 [apps/shared] Prevent label method from being called on uninitialized chars 2021-01-05 11:38:21 +01:00
Gabriel Ozouf
5b106f091d [interactive_curve_view_range] Fix isOrthonormal when using Navigate
The method isOrthonormal takes into account the "offscreen" portion of
the Y axis. This fixes a bug where zooming when using the Navigate
option would remove the orthonormality marker while the graph was still
orthonormal.
2021-01-05 11:01:45 +01:00
Gabriel Ozouf
878685b83c [interactive_curve_view_range] Test isOrthonormal 2021-01-05 11:01:45 +01:00
Gabriel Ozouf
abefc800d9 [interactive_curve_view_range] Fix variable type 2021-01-05 11:01:45 +01:00
Gabriel Ozouf
89c50509d8 [shared] InteractiveCurveViewRange::isOrthonormal
The old method isOrthonormal has been split into two :
  - shouldBeNormalized tests whether the range is close enough to a
    normal range
  - isOrthonormal tests whether the range is strictly orthonormal, but
    takes into account imprecisions of floating-point arithmetic
2021-01-05 11:01:45 +01:00
Roberta Rabotti
89107da1ae Update toolbox.it.i18n 2021-01-05 10:15:12 +01:00
Gabriel Ozouf
d022231a3a [statistics] Fix use of uninitialized variable 2021-01-05 10:12:02 +01:00
Martijn Oost
f449db62c3 [NL] fix omission sigma in toolbox
While changing from using sigma squared to just sigma I guess we deleted one character too much.
2021-01-04 15:14:38 +01:00
Martijn Oost
7a6c0e6e7d [NL] fix translations 2021-01-04 15:14:38 +01:00
Gabriel Ozouf
f6c91f7dbe [poincare/function] Add tests on getVariables 2020-12-29 17:20:09 +01:00
Gabriel Ozouf
4209f0a26c [poincare/function] getVariables always gets the argument
When applied to a function f(x) = constant, the method getVariables
would not find any, as the search is performed on the function's
definition.
Thus, when using the "Fill with formula" tool in Statistics, if the
formula to fill V1 is "V1=f(V2)", the formula will be considered
constant and applied to all values in V1. However, if V1 is longer than
V2, the program will attempt to read undefined values of V2.
With this change, the formula will only be applied to lines in V1 for
which there is a corresponding line in V2.
2020-12-29 17:20:09 +01:00
Gabriel Ozouf
d26ba0250b [statistics] Missing include 2020-12-29 13:34:35 +01:00
Gabriel Ozouf
48d93584e7 [poincare/parametered_expression] Fix variables detection
The method getVariables would not correctly remove the parameter from
the list of variables.
e.g. In the expression "box+y×int(z,x,0,1)", when trying to remove x
from the list of variables, the letter x would be removed from the name
"box" instead.
2020-12-29 13:34:09 +01:00
Gabriel Ozouf
fff514d410 [poincare/unit] Fix temperature conversion
The program would crash when trying to evaluate a unit conversion of the
form "x→_U" where U was a unit of temperature and x did not have any
unit.
2020-12-29 09:51:47 +01:00
Gabriel Ozouf
5ce5f4fbac [statistics] Fix glitch with histogram parameters
In the window to change the histogram parameters, it was possible to set
a rectangle width that was considered valid, but would make the starting
abscissa invalid, while triggering no error message. The message would
only show if the user closed the window and opened it again.
e.g. : Set a series with only one value 1e10
       Change its starting abscissa to 0
       Change its rectangle width to 1, confirm and close the menu
       Re-open the menu, a message appears, and stays onscreen when
leaving the menu.
2020-12-29 09:50:24 +01:00
Gabriel Ozouf
ea4770fc81 [shared/interactive_curve_view_range] Change normalization tolerance
The loss of significance that occurs when subtracting the bounds of the
axes must be taken into account when asserting whether the range is
orthonormal.
2020-12-29 09:47:29 +01:00
Hugo Saint-Vignes
e09bd0a18c [poincare] Factorize reduce and removeUnit methods 2020-12-22 17:32:40 +01:00
Hugo Saint-Vignes
7146eff7ee [poincare/src] Use reduce before removeUnit
With deepReduce(), when a simplifiaction was interrupted, expression could
contain Undefined children, which would trigger the assert in
removeUnit(). With reduce(), if a simplification is interrupted, the
entire expression becomes Undefined, which is handled by removeUnits().
2020-12-22 17:32:40 +01:00
Gabriel Ozouf
5bc9579db6 [shared/interactive_curve_view_range] Test zoom method 2020-12-22 17:22:33 +01:00
Gabriel Ozouf
e9c953fd6e [shared/interact_curve_view_range] Check orthonormality after zoom
Zooming in and out on a graph usually preserves orthonormality. However,
if the window has its bounds close to the limits for the values on the
axes, zooming can change the ratio.
2020-12-22 17:22:33 +01:00
Gabriel Ozouf
02d7a02a93 [poincare/unit] Add test 2020-12-22 17:21:37 +01:00
Gabriel Ozouf
9b3f7edfcd [poincare/unit] Handle kelvin with prefix
Units derived from kelvin (mK, cK, ...) were handled like Celsius and
Fahrenheit, causing a bug where multiplications such as 2*pi*_cK to
simplify as undef.
2020-12-22 17:21:37 +01:00
Hugo Saint-Vignes
fa523c25c9 [apps] Split italian text into two lines in variable box 2020-12-22 10:16:27 +01:00
Hugo Saint-Vignes
1939293cd2 [apps/shared] Add margin to avoid visible approximation errors 2020-12-21 16:12:27 +01:00
Léa Saviot
60f875220e build: Version 15.2.0 2020-12-17 17:10:56 +01:00
Gabriel Ozouf
24456780e6 [regression] Invalidate cursor when selected dot does not exist 2020-12-17 17:10:56 +01:00
Hugo Saint-Vignes
af3b2d4de4 [apps/shared] Tidy model name on sequence type change 2020-12-17 17:10:56 +01:00
Hugo Saint-Vignes
479f34502f [apps/shared] Rename methods and Factorize comparison logic 2020-12-16 16:16:26 +01:00
Hugo Saint-Vignes
10c296e671 [apps/shared] Add comment for isCursorHanging method 2020-12-16 16:16:26 +01:00
Hugo Saint-Vignes
b7bbb258a8 [apps/regression] Fix NaN comparison in isCursorHanging method 2020-12-16 16:16:26 +01:00
Hugo Saint-Vignes
7646f13ca8 [apps/shared] Fix NaN comparison in isCursorHanging method 2020-12-16 16:16:26 +01:00
Hugo Saint-Vignes
56a6917cfd [apps/shared] Fix context pointer when sorting rows 2020-12-16 11:40:54 +01:00
Gabriel Ozouf
efbbbe94ff [poincare/expression] Comment and variable names 2020-12-14 10:20:09 +01:00
Gabriel Ozouf
c7b758f536 [poincare/expression] Fix solutions to e^x=0
Because of the limitations of the floating-point representation, e^x is
null for x <= 710, causing the nextRoot functions to find roots for it.
To prevent this, we looking for places where a function changes sign, we
actually require the function to take two non-null values of different
signs.
2020-12-14 10:20:09 +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
Maxime FRIESS
f202a4f902 [mpy/files] Fixed append implementation (#434) 2020-12-10 21:30:54 +01:00
Hugo Saint-Vignes
78cb340065 [apps/regression] Only uniformize c if needed 2020-12-10 16:42:59 +01:00
Hugo Saint-Vignes
6e318593ae [apps/regression] Code review fixes 2020-12-10 16:42:59 +01:00
Hugo Saint-Vignes
79e59f525e [apps/regression] Ensure unicity for trigonometric regression 2020-12-10 16:42:59 +01:00
Gabriel Ozouf
94b2da8e60 [poincare/zoom] Comment on the representation of ranges 2020-12-10 13:45:56 +01:00
Gabriel Ozouf
185c780215 [poincare/zoom] Handle NAN in ExpandSparseWindow 2020-12-10 13:45:56 +01:00
Gabriel Ozouf
35bfb8ec16 [poincare/zoom] Method ExpandSparseWindow
This method is used to remove extraneous empty sapce in the middle of
the window for functions that are discontinuous between their points of
interest.
2020-12-10 13:45:56 +01:00
Gabriel Ozouf
625a89e610 [poincare/zoom] RefinedYRangeForDisplay signature 2020-12-10 13:45:56 +01:00
Gabriel Ozouf
3cdb076c2c [shared/interactive_curve_view_range] Factor zoom
The zoom method to zoom in and out on a curve view make use of the
SetZoom method in Poincare::Zoom.
2020-12-10 13:45:56 +01:00
Gabriel Ozouf
71070ee052 [poincare/zoom] Helper method SetZoom
Create a method SetZoom to zoom in and out on a window.
2020-12-10 13:45:56 +01:00
Hugo Saint-Vignes
c28a5198d6 [apps/regression/test] Add a test case, factorize logic 2020-12-09 17:31:14 +01:00
Hugo Saint-Vignes
a08e3e1024 [apps/regression] Update comment 2020-12-09 17:31:14 +01:00
Hugo Saint-Vignes
357db4493d [apps/regression] Add TODO to improve coefficient update 2020-12-09 17:31:14 +01:00
Hugo Saint-Vignes
e17ff842b5 [apps/regression/test] Update trigonometric tests 2020-12-09 17:31:14 +01:00
Hugo Saint-Vignes
d0f40f0177 [apps/regression] Set coefficient c initial value to 0 2020-12-09 17:31:14 +01:00
Émilie Feral
fe4e2e3e9d Misc. clang static analyzer fixes 2020-12-09 13:34:36 +01:00
Martijn Oost
c3ceb0074f [NL] fix translation mistakes 2020-12-09 13:31:15 +01:00
Émilie Feral
0f95b579a4 build: Version 15.1.0 2020-12-07 17:13:14 +01:00
Gabriel Ozouf
55f21f127c [poincare/zoom] Fix array overflow 2020-12-07 16:45:54 +01:00
Gabriel Ozouf
89979b4f50 [poincare/zoom] Comment on the RangeWithRatio method 2020-12-07 15:58:56 +01:00
Gabriel Ozouf
71be09b4e7 [poincare, graph] Factor helper function 2020-12-07 15:58:56 +01:00
Gabriel Ozouf
ffebd2e987 [shared] Rename methods 2020-12-07 15:58:56 +01:00
Gabriel Ozouf
1f8ab10ae5 [graph] Update tests on automatic zoom 2020-12-07 15:58:56 +01:00
Gabriel Ozouf
8726bbda3e [poincare/zoom] Update tests 2020-12-07 15:58:56 +01:00
Gabriel Ozouf
072fdda6b8 [poincare/zoom] Redraft search of orthonormal range
To find the optimal range with a specified ratio, we compute the values
of the function on a default range, then center the Y axis to display
the maximum number of points of the function.
2020-12-07 15:58:56 +01:00
Gabriel Ozouf
316d054935 [sequence] Restore margins on the sequence graph 2020-12-07 15:58:56 +01:00
Gabriel Ozouf
f3b770cb29 [graph] Add tests for the full range computation
Change-Id: I040a36c035ec75ee950f1998667b70a417dea2f3
2020-12-07 15:58:56 +01:00
Gabriel Ozouf
a9aeae94df [shared] Create helper functions for ranges
These functions are used to test the full algorithm used to compute
ranges.

Change-Id: I48069e245aa6e879f66aecc29709fc6f992f5220
2020-12-07 15:58:56 +01:00
Gabriel Ozouf
1e7babadb8 [solver] Change angle unit before test
A test in equation_solve relies on the angle unit being set to Degree,
but doesn't actually set it. Changing the angle unit to another one in a
test prior would break this test.

Change-Id: I6785b087f171d46226d484ebaa3ebdc9e791cedc
2020-12-07 15:58:56 +01:00
Gabriel Ozouf
7f63daa28e [poincare/zoom] Change weight function in RangeWithRatioForDisplay
Change-Id: I21520d8220083b40baa2e4928632632f2b73cb9b
2020-12-07 15:58:56 +01:00
Gabriel Ozouf
b1da6031c6 [shared] Do not compute range for convoluted functions
Evaluating a function containing a sequence, an integral or a
derivative, is time consuming. Computing a range requires a plethora of
evaluations, as such ranges for these functions cannot be evaluated in a
timely fashion.

Change-Id: I088a0e896dbc26e6563291cafdfe9ceba36dd5d0
2020-12-07 15:58:56 +01:00
Gabriel Ozouf
c89a7bc496 [graph] Take margins into account for normalization
When building an orthonormal range for the automatic zoom, we provide a
ratio for the screen without the margins. This way, adding the margins
will make the graph orthonormal, and the banner cannot cover the
function.

Change-Id: If3a3f799d4e7e3e81ab77c6b418d70b734a6fbca
2020-12-07 15:58:56 +01:00
Gabriel Ozouf
a8858023ba [shared] Remove const qualifiers from interestingRanges
Change-Id: I794aa144af9dc9eab3090eea7fd54a7cdac2fd68
2020-12-07 15:58:56 +01:00
Gabriel Ozouf
ff220b7103 [graph] Preserve default X range
When computing the automatic zoom, if the X axis has integer bounds
(most likely because the range has been built to be orthonormal), do not
add margins to the X axis, so that it keeps user friendly values.

Change-Id: I49d99b79c68fbd8a49e5c2521b250c40aad75d48
2020-12-07 15:58:56 +01:00
Gabriel Ozouf
6e9195fafa [shared] Add forceChangeY parameter to normalize()
Change-Id: Iff5417cd765f3fd09825b81cb41f883530b39233
2020-12-07 15:58:56 +01:00
Gabriel Ozouf
bd302bb67b [poincare/unreal] Type in derivate method
Unreal's derivate method returns true, to signify that it is unchanged
by the derivation operation. This implementation mostly exists for
documentation, as an Unreal derivand will be handled by the
defaultShallowReduce method.
2020-12-07 15:01:52 +01:00
Gabriel Ozouf
7ae03975cc [poincare/derivative] Derivate special numbers
Derivate the numbers Undefined, Unreal, Infinity symbolically :
  Undefined -> Undefined
  Unreal    -> Unreal
  Infinity  -> Undefined
2020-12-07 15:01:52 +01:00
Martijn Oost
76eb155ed5 [NL] translation fixes 2020-12-07 14:12:29 +01:00
Gabriel Ozouf
3f6e4444a5 [poincare/derivative] Reduce before replacing symbol
The general formula for deriving a power makes use of the logarithm,
which often disappears at simplification. However, replacing the symbol
before simplifying can lead to applying an invalid argument to the
logarithm, making the whole expression invalid.

e.g. diff(1/x,x,-2)
     If x is replaced by -2 before reducing the power derivative, ln(-2)
will reduce to Unreal, as will the rest of the expression.
2020-12-07 14:06:24 +01:00
Fournier Gabriel
92ee632ce2 word wrapping 2020-12-05 22:24:13 +01:00
Gabriel Ozouf
1a47207bee [poincare/trigonometry] Add comments 2020-12-04 11:59:12 +01:00
Gabriel Ozouf
1f0a18f94c [poincare/derivative] Update tests for trigonometric derivatives 2020-12-04 11:59:12 +01:00
Gabriel Ozouf
a113801ec2 [poincare/derivative] Fix derivative of trigonometric functions
The classic differentiation forumals for trigonometric functions assume
a variable in radians. A multiplicative constant must be added when
another unit is used.

Change-Id: Iec428acd7d93e415fddb184300437ae09d1d997c
2020-12-04 11:59:12 +01:00
Gabriel Ozouf
64208a7f3c [poincare/trigonometry] Method UnitConversionFactor
Change-Id: I4ef3e4404071a305354b572e15e5199040f9bf48
2020-12-04 11:59:12 +01:00
Gabriel Ozouf
f329ca825f [poincare] Add ReductionContext to unaryFunctionDifferential
Change-Id: I99ba90f8c38cab5d8fe2139f49e4f94c1d52d296
2020-12-04 11:59:12 +01:00
Hugo Saint-Vignes
f54c5a8172 [apps/statistics] Update wording
Change-Id: I4e3a042e1da6c7264932ff87fba0529f7aa1091d
2020-12-03 16:09:46 +01:00
Hugo Saint-Vignes
8cd3fe679f [escher/src] Add TODO comment 2020-12-02 17:20:32 +01:00
Hugo Saint-Vignes
636e863323 [escher] Moved repetition factor logic up in Escher from poincare
Change-Id: I7c8f932e3e7d04c928ca881113ba6b5df05b94e7
2020-12-02 17:20:32 +01:00
Gabriel Ozouf
b69f06b772 [poincare/logarithm] Comment clarity 2020-12-02 16:54:09 +01:00
Gabriel Ozouf
1531f96bb8 [poincare/derivative] Update test on derivation 2020-12-02 16:54:09 +01:00
Gabriel Ozouf
764d14fed1 [poincare/constant] Constants differentiate to 0 2020-12-02 16:54:09 +01:00
Gabriel Ozouf
a178c88e54 [poincare/logarithm] Fix derivative domain of definition
The logarithm function is undefined for negative numbers, but its
derivative, the inverse function, is defined everywhere. We thus need to
virtually limit the domain of definition of the derivative.
2020-12-02 16:54:09 +01:00
Gabriel Ozouf
591f47d6a9 [continuous_function_cache] Coding style 2020-12-02 16:50:17 +01:00
Gabriel Ozouf
937979503a [shared/continous_function] Detach cache of inactive function
When a function that had previously been cached is deactivated, its
cache can be used by another function. When the function is reactivated,
if it tries to reuse its previous cache, it will be filled with values
from another function, and will not be cleared. By detaching the cache
of a function that becomes inactive, we ensure that the next time this
function is cached, the chache will be cleared.

e.g. Define to functions f(x)=x, g(x)=-x, draw them both.
     Deactivate f, the redraw the graph
     Reactivate f, the draw again
2020-12-02 16:50:17 +01:00
Gabriel Ozouf
3501146e35 [shared/continuous_function_cache] Detach cache from function
When three functions or more, the third function and later don't use
caching. But it is still possible for them to have been linked to a
cache (for instance if previous functions had been deactivated earlier).
To avoid a function tapping into another function's cache, we reset the
cache.

e.g. Define 3 functions f(x)=1, g(x)=2, h(x)=3, and deactivate f.
     Draw the graph, come back, reactivate f, then draw again.
---> The space between y=2 and y=3 will be filled with the color of h,
as h "remembers" using cache n°2, wich currently contains the values of
function g.
2020-12-02 16:50:17 +01:00
Gabriel Ozouf
48bd7b6a77 [poincare/logarithm] Factor corner case log(x,0) and log(x,1) 2020-12-02 16:49:09 +01:00
Gabriel Ozouf
f09f06d7ac [poincare/logarithm] Update tests 2020-12-02 16:49:09 +01:00
Gabriel Ozouf
9775953142 [poincare/logarithm] ln(0) = undef
As a consequence, log(x,0) = ln(x)/ln(0) = undef
2020-12-02 16:49:09 +01:00
Gabriel Ozouf
71ac56f8a7 [ion/simulator] Update calculator keyboard image
Remove the "sto" from the x^y/sto->/F key, and add the % symbol to the
Backspace key.
2020-12-01 09:37:09 -05:00
Hugo Saint-Vignes
e295e9ead0 [github/workflows] Update Metrics to remove NumWorksBot
Change-Id: Icfd19cbad5472f6bf81a2a1accb88e79ab7a115b
2020-11-30 14:01:12 +01:00
Joachim Le Fournis
36742789b0 [py] Support round on int 2020-11-30 14:01:12 +01:00
Émilie Feral
312c02fd69 [.github/workflows] ci-workflows: update setup-emscripten 2020-11-30 14:01:12 +01:00
Romain Goyet
bd22c06d98 Use semantic branches on setup-arm-toolchain 2020-11-30 14:01:12 +01:00
ThePythonGuy
b343c5a02c [base.es.i18n] Translated some missing stuff to Spanish (#430)
* Update base.es.i18n

* Update base.es.i18n

* Update base.es.i18n

* Update base.es.i18n

* Update base.es.i18n

* Update apps/home/base.es.i18n

Co-authored-by: Quentin <quentin.guidee@gmail.com>

Co-authored-by: Quentin <quentin.guidee@gmail.com>
2020-11-28 22:40:43 +01:00
Quentin
1f05547437 [github] Update README.md to fix n0100 compilation (#429) 2020-11-27 16:51:08 +01:00
Quentin Guidée
68397ad0a6 [.github/workflows] Fix metrics 2020-11-27 16:42:07 +01:00
Quentin
f0ecb4c833 Merge pull request #428 from Omega-Numworks/omega-bot-for-workflows
[github/workflows] Omega-Robot for workflows
2020-11-27 14:25:01 +01:00
Quentin Guidée
5bbba6cf80 [github/workflows] Reintroduce OmegaRobot 2020-11-27 13:56:02 +01:00
Quentin
7f488b45f1 Merge pull request #427 from quentinguidee/merge-upstream
[upstream] Update
2020-11-27 13:52:03 +01:00
Quentin Guidée
ff029ea785 Merge branch 'omega-dev' into merge-upstream 2020-11-27 13:24:57 +01:00
Quentin Guidée
1347b1a20c [upstream] Update 2020-11-27 13:23:07 +01:00
Hugo Saint-Vignes
1fd970fe50 [apps/regression] Remove TODO and update comment
Change-Id: I049645e03c82e953dde14f363d113b718408efd5
2020-11-26 17:52:42 +01:00
Hugo Saint-Vignes
e9662e4c45 [apps/regression] Compute numberOfPoints automatically
Change-Id: I35a1902aeda06cc80ae8808d886b3e161bae8ad9
2020-11-26 17:52:42 +01:00
Hugo Saint-Vignes
72e8ac7d02 [apps/regression] Add tests for Trigonometric regressions
Change-Id: Ie4363d79a53c09369b24924b35bf26a66e9a8f93
2020-11-26 17:52:42 +01:00
Hugo Saint-Vignes
06d7104776 [apps/regression] Improve initial coefficient value
Change-Id: I2026b8de7e031f7e22921be2def800fa71d7a4e4
2020-11-26 17:52:42 +01:00
Hugo Saint-Vignes
1025fd9937 [apps/regression] Use cmath for sin and cos functions
Change-Id: I670eda49a73d9bf1d1d75194178344adda9b1014
2020-11-26 17:52:42 +01:00
Hugo Saint-Vignes
c55eb6b028 [apps/regression] Fix angleUnit dependent coefficients for trigonometric model
Change-Id: I8027c131b0fd7b020eb502168ac068a0b84da1e4
2020-11-26 17:52:42 +01:00
Gabriel Ozouf
2ba1941270 [poincare/zoom] Float litterals
Change-Id: Ifea5f356b9cee271c43b3d9b9168fd38db78d87a
2020-11-26 17:51:40 +01:00
Gabriel Ozouf
ddfde60982 [poincare/zoom] Update tests for the device
Change-Id: Ied73829ff294dc243ca177c5c2acfb374a7446b9
2020-11-26 17:51:40 +01:00
Gabriel Ozouf
746a781016 [poincare/zoom] Fix coding style
Change-Id: I263e1a95023f650376bf6a1c4bb45426d52d5e4c
2020-11-26 17:51:40 +01:00
Gabriel Ozouf
fdcccde996 [poincare/zoom] Update unit tests
Change-Id: Ic108bfbacd54d43ef6c721589ada813ca648e88e
2020-11-26 17:51:40 +01:00
Gabriel Ozouf
4869383263 [poincare/zoom] Better handling of single points of interest
Functions with a single point of inerest used to be drawn on a tiny
interval around this point.
Now, an orthonormal window is built around the point of interest, giving
a much nicer view.

Change-Id: I7793797aead2695532ddea44d93d62bb7ef870f4
2020-11-26 17:51:40 +01:00
Gabriel Ozouf
229865aff8 [poincare/zoom] Rework unit tests
Change-Id: Id0ff36517d14710701f6a4c1cec8817442b6f946
2020-11-26 17:51:40 +01:00
Gabriel Ozouf
291b400595 [poincare/zoom] Ignore imprecise float value
When looking for extrema in a function, we need to discard results where
the function growth rate is smaller than the precision of the float type
itself : these results are likely to be too noisy, and can cause false
positives.
e.g. : The sqrt(x^2+1)-x function

Change-Id: I6e2c002d7308b41a4c226d274cbb5d9efe4ea7db
2020-11-26 17:51:40 +01:00
Gabriel Ozouf
adf28345b1 [poincare/zoom] Reduce zoom artifact
Do not use the bounds of the interval when computing a refined range.
As the bounds are often integers, the zoom would give strange result on
some non-continuous functions (e.g. f(x) = x!).

Change-Id: Ie127fe15191cb3951cff223adc8dc3172188c789
2020-11-26 17:51:40 +01:00
Gabriel Ozouf
a418602763 [poincare/zoom] Remember points of interest when refining
Change-Id: I229cbffa2577d23bfa0a4c0632bc9ec32ae338e7
2020-11-26 17:51:40 +01:00
Gabriel Ozouf
ca9cb63909 [poincare/zoom] Reduce the step for searching points of interest
The algorithm to search for points of interest will miss some. We reduce
the step to make it more precise, so that tan(x) and tan(x-90) have the
same profile.

Change-Id: Ia1bac1d4e7b98d2d6f36f8ce12ed9dac67d40198
2020-11-26 17:51:40 +01:00
Gabriel Ozouf
540209f1a9 [poincare/zoom] Preserve standard bound when normalizing
Change-Id: I6d736e945eda6982ad26836763feded8a55134a0
2020-11-26 17:51:40 +01:00
Gabriel Ozouf
e4162976e4 [poincare/zoom] Method NextUnit
Change-Id: I8200c38fd44b662dcffa8e9850fc272f3e2dc7e8
2020-11-26 17:51:40 +01:00
Hugo Saint-Vignes
cfc37f1bac [apps/sequence] Factorize sequence row index offsets
Change-Id: Id6fa632521858c48fe7d3daf35fd846bf24a05eb
2020-11-24 13:26:55 +01:00
Hugo Saint-Vignes
387d3c9aa1 [apps/sequence] Fix row offset when returning to previous menu
Change-Id: Ic3eee6bb1ecb991b97dc9190fab95774938d294e
2020-11-24 13:26:55 +01:00
Hugo Saint-Vignes
b08a29cab4 [apps/sequence] Fix typo
Change-Id: Ic34b84073ef268eaddfe4224c3171c9aaa7ca395
2020-11-24 13:26:55 +01:00
Hugo Saint-Vignes
110f333122 [github/workflows] Update Metrics to remove NumWorksBot
Change-Id: Icfd19cbad5472f6bf81a2a1accb88e79ab7a115b
2020-11-24 10:41:59 +01:00
Gabriel Ozouf
4aa19ccd78 [i18n] Fix PT translation for imperial units
Pint -> "Pinto"
Cup -> "Copo"

Change-Id: I96dea0c6f1551db617f017d2121aaf0f2b6d0095
2020-11-24 10:40:56 +01:00
Gabriel Ozouf
56e03aae0c [shared] Remove angleUnitVersion
The angleUnitVersion check is no longer needed, as changing the angle
unit with a trigonometric function set would leave the cursor hanging.

Change-Id: I17d99c05daeacfec953865158cdfe7706635cd32
2020-11-24 09:55:22 +01:00
Gabriel Ozouf
5e679b7bc8 [graph] Change cursor initial position
The cursor now initially aligns with the grid, and tries to avoid points
where the function is not defined.

Change-Id: Ie3b304281f5848102c2f3c0aa5c031b351418186
2020-11-24 09:55:22 +01:00
Joachim Le Fournis
bd5cdb0f65 [py] Support round on int 2020-11-23 12:12:46 +01:00
Émilie Feral
99e63ec30b [.github/workflows] ci-workflows: update setup-emscripten 2020-11-23 11:26:01 +01:00
Hugo Saint-Vignes
962136ce8f [ion/simulator] Temporarly increase stack size on simulator
Change-Id: I0f27277ea704f81e316c7ff78fb7bed8c70ff4ae
2020-11-23 11:26:01 +01:00
Émilie Feral
5eaea62073 [.github/workflows] CI: use msys2/setup-msys2 instead of
numworks/setup-msys2
2020-11-23 11:26:01 +01:00
Fournier Gabriel
3e2b5178ed word wrap - part 1 and 2 2020-11-21 19:29:46 +01:00
Hugo Saint-Vignes
3ac3fba468 [poincare] Prevent system parenthesis text insertion
Change-Id: I5963d2fda37ed9776059b29edced75f88b4ccb2b
2020-11-20 13:33:00 +01:00
Romain Goyet
0de5c89d9b Use semantic branches on setup-arm-toolchain 2020-11-20 11:19:40 +01:00
Hugo Saint-Vignes
d8527b02ad [poincare] Add a vector type for matrix product and norm operations
Change-Id: I28b0956273f8c0a3a9bdc4389956caa106d6b8af
2020-11-19 11:41:29 +01:00
Hugo Saint-Vignes
522456677a [poincare] Add an Array class to factorize Matrix and Grid methods
Change-Id: Ia61caf0bf182c1111119740d43d957f203c0975c
2020-11-19 11:41:29 +01:00
Hugo Saint-Vignes
c0413709b7 [poincare] Require same vector orientation for dot and cross products
Change-Id: I4cf248cf564899314a1efb1c5e39a041395ba583
2020-11-19 11:41:29 +01:00
Hugo Saint-Vignes
cb54e22272 [poincare/test] Add tests on horizontal vectors
Change-Id: If2d6293ede044ffe71e632212eff155b80ad683f
2020-11-19 11:41:29 +01:00
Hugo Saint-Vignes
bee8d8531b [poincare] Handle horizontal vectors
Change-Id: I98088b2b9f2dbc0549795a5c3eed4787fea70068
2020-11-19 11:41:29 +01:00
Fournier Gabriel
5b21c57e4c list files on simulator 2020-11-17 22:44:35 +01:00
Martijn Oost
0ecfa0012c [nl] improved translation statistics 2020-11-17 14:06:18 +01:00
Gabriel Ozouf
0c44deb35f [poincare/matrix_layout] Change comparison order
Change-Id: Iaa048d82005a7dfa380357e80bbac447c0976e55
2020-11-17 11:42:55 +01:00
Gabriel Ozouf
323e72a50c [poincare/matrix_layout] Remove columns with backspace
Allow removing empty columns with backspace, the same way one can remove
empty rows. This allows deleting the internal columns that are not
automatically deleted.

Change-Id: I52def7939257942a8396721d01c4d1531ef90361
2020-11-17 11:42:55 +01:00
Gabriel Ozouf
7184202a6e [poincare/matrix_layout] Keep median rows and columns
Empty columns and rows are only removed automatically when they are the
last row/column. This way, the user can edit a median row/column without
the matrix collapsing.

Change-Id: If611fa0133f270d785809d433ae879879b6b093f
2020-11-17 11:42:55 +01:00
Gabriel Ozouf
62e2a71da1 [poincare/matrix_layout] Remove empty rows
Empty columns are automatically removed ; the same is now done to empty
rows.

Change-Id: Ib66dfe83f1ea712d3f9a450eedd7ade709296413
2020-11-17 11:42:55 +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
Hugo Saint-Vignes
04b2683af2 [poincare] Replaced an escape case with an assert only
Change-Id: I5ea501beeb42577a25dd752f8b9492210abd38fc
2020-11-16 17:12:42 +01:00
Hugo Saint-Vignes
73b5b0775a [poincare] Avoid nullptr context on non-Numbers sign and nullStatus methods
Change-Id: I3361344c1e0b50cdbe999d6ea50025022a51f603
2020-11-16 17:12:42 +01:00
Hugo Saint-Vignes
a0497d3bd7 [poincare] Prevent Bad access on abstract symbol context
Change-Id: I3077db5fdc2430ee11ceb1c6eb651e4331fb2ba0
2020-11-16 17:12:42 +01:00
Gabriel Ozouf
41778433b1 [graph] Fix a bug when zooming
When entering the Navigate menu, a portion of the Y axis is memoized to
preserve the grid units.
However, this portion was not modified when zooming, causing some
glitches.

Change-Id: I06b4ee044eaa75d48b8f338c9ef6ea33bb299e39
2020-11-16 16:50:21 +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
Quentin
83b4d9390d Merge pull request #402 from RedGl0w/patch-4
[Python] Change heap (32 to 100K)
2020-11-13 20:50:22 +01:00
Quentin
3252bad547 Merge pull request #415 from RedGl0w/patch-9
[Ion/usb] Changed URL in order to have easier update
2020-11-13 20:42:51 +01:00
Gabriel Ozouf
ea3e3287dc [graph] Keep Auto when opening and closing Navigate
If the user opens the Navigate menu, then closes it immediately, the
Auto status is not turned off.

Change-Id: I2d1ca0cfdae1b9c957dede7bf9f3c2890dea1bb0
2020-11-13 17:32:08 +01:00
Gabriel Ozouf
4233f197d3 [shared] Keep graph units when using navigation
When using the Navigate menu on graphs, the grid units are computed
using the normal graph's range, so that the units won't change.

Change-Id: I8ff8853868e5c90319619a6271d6a7d87ae82ab0
2020-11-13 10:50:31 +01:00
Gabriel
a0acdc171b Squelette 2020-11-13 00:48:46 +01:00
Émilie Feral
80f3af389f [build] Add %_run targets to linux, macos and windows platforms 2020-11-12 14:49:12 +01:00
Émilie Feral
0dcb4e9aff [docs] Improve SDK doc: executables are not in the root folder anymore 2020-11-12 14:49:12 +01:00
Roberta Rabotti
6c508d9c29 [IT]translation changes: imperial units
Change translation Imperial units
2020-11-09 17:49:47 +01:00
Martijn Oost
f42b7e4b20 [nl] fix imperial unit translation 2020-11-09 17:31:23 +01:00
Léa Saviot
4df996cfd2 [poincare/expression_node] TODO: use ReductionContext via pointers 2020-11-09 15:50:27 +01:00
Léa Saviot
5df60e946a [poincare] shallowBeautify can modify the reduction context
UnitConvert must set UnitConversion to None, otherwise the unit asked
for in the conversion might get changed after being properly set in
UnitConvert::shallowBeautify.
2020-11-09 15:50:27 +01:00
Léa Saviot
3a0796d3c5 [poincare/test] Add tests about negtive unit convert simplification 2020-11-09 15:50:27 +01:00
Martijn Oost
d7f83eca1c [nl] fix spelling mistakes 2020-11-09 10:48:01 +01:00
Émilie Feral
6e0528deac [apps] it i18n: ortogonale --> ortonormale 2020-11-09 10:34:00 +01:00
Quentin Guidée
78beafe3f1 [ion] Fix web simulator 2020-11-06 23:53:51 +01:00
Émilie Feral
d789e8da97 [poincare] In Multiplication::shallowBeautify, when extracting the unit,
reduce without changing the unit in order to extract the right unit.

This fixes the following bug: simplify "πππ23*_cK"
2020-11-06 14:51:49 +01:00
Émilie Feral
50bc31fcfa [poincare] Test: add a simplification test regarding unit 2020-11-06 14:51:49 +01:00
Léa Saviot
e00cb91f74 [ion/utf8_helper] Reuse strlen value 2020-11-05 13:23:21 +01:00
Léa Saviot
f96e4e92ce [ion/utf8_helper] Fix bad variable use 2020-11-05 13:23:21 +01:00
Joachim Le Fournis
5f34d07e53 [Calculation/expression_field] EE add Ans 2020-11-05 11:39:29 +01:00
Émilie Feral
7acec88006 [python] Port: we used the wrong variable
Found by clang-analyzer
2020-11-05 10:28:24 +01:00
Émilie Feral
5afdec00b8 [poincare] Avoid reading "garbage" value: result variable can be
read in the while condition without being set to an initial value
(if the first ridderApproximation was undefined for instance)

Found by clang-analyzer
2020-11-05 10:28:24 +01:00
Romain Goyet
d9b5acc70d [fuzzer] Invoke Python3 2020-11-04 17:32:45 +01:00
Romain Goyet
55615c10e3 [fuzzer] Always keep assert() when building with AFL 2020-11-04 17:32:45 +01:00
Romain Goyet
cca750a1c4 [fuzzer] The fuzzer detects the number of CPUs 2020-11-04 17:32:45 +01:00
Romain Goyet
7030159530 [fuzzer] make the afl.py script executable 2020-11-04 17:32:45 +01:00
Émilie Feral
4f9c37e96b build: Version 15.0.0 2020-11-04 16:14:28 +01:00
Léa Saviot
7f6a3f0fc1 [apps/curve_view] Fix KDCoordinate overflow
Scenario: (with the current auto zoom algorithm)
Graph f(x) = x! -> Auto axes are x=[-13,17647;13,17647],
y=[3628793;2628807]
Press "0" "EXE" to go to x = 0 -> Axes are x=[-13,17647;13,17647],
y=[-0.8612717;13.13873]
Press auto
Press "0" "EXE" to go to x = 0 -> the assertion about KDCoordinates
breaks.
2020-11-04 15:58:43 +01:00
Émilie Feral
95aa47625c [.github] ci-workflow: missing line 2020-11-04 15:58:43 +01:00
Émilie Feral
c7711b74c2 [poincare] Sequence: reorder condition (optimization) 2020-11-04 15:58:43 +01:00
Émilie Feral
a7b55776d6 [sequence] Remove unused function 2020-11-04 15:58:42 +01:00
Émilie Feral
c5beb6fdd2 [app/sequence] Test: avoid duplicating sequence stores and ensure to
tidy it (empty the Poincare Pool) between quiz_cases
2020-11-04 15:58:42 +01:00
Émilie Feral
5e83bee589 [apps/shared] ExpressionModel: expressionReduced can call itself so it
need to keep a valid m_expression
2020-11-04 15:58:42 +01:00
Émilie Feral
cf2cbd109e [apps/sequence] Add breaking test 2020-11-04 15:58:42 +01:00
Émilie Feral
4cc3542a99 [poincare] Sequence: when approximating within a reduce routine, escape to avoid
infinite loop
2020-11-04 15:58:41 +01:00
Émilie Feral
7142f9545e [poincare] Finish replacing approximateContext 2020-11-04 15:58:41 +01:00
Léa Saviot
f8b3156f19 [poincare] Start replacing approximateContext 2020-11-04 15:58:41 +01:00
Léa Saviot
644cf4dcf3 [poincare] Step II: create ApproximateContext 2020-11-04 15:58:40 +01:00
Émilie Feral
75dc415e27 [poincare] Step I: add a parameter to approximation routines to indicate
if we're within a reduction routine
2020-11-04 15:58:40 +01:00
Gabriel Ozouf
58867b66ca [sequence] Add tests on self referencing sequences
Change-Id: I031f0e8f166aa2d017c0f86679bc9e13e6a432bd
2020-11-04 15:58:40 +01:00
Émilie Feral
291941f4e2 [.github/workflows] CI: use msys2/setup-msys2 instead of
numworks/setup-msys2
2020-11-04 15:58:39 +01:00
Émilie Feral
547b4b2d71 [.github/workflows] CI: trigger CI manually or on PR only 2020-11-04 15:58:39 +01:00
Martijn Oost
bf79d4e438 [nl] stats definitions improved 2020-11-04 15:58:39 +01:00
Léa Saviot
fbf38f891d [apps/shared] Rephrase "Pan" -> "Navigate", "Move" -> "Pan" 2020-11-04 15:58:39 +01:00
Gabriel Ozouf
6f21310e08 [ion/events] Add comment about defaultText method
Change-Id: Ief2b53395a7921d85b116ded935c9dfeb10d08fd
2020-11-04 15:58:38 +01:00
Gabriel Ozouf
993de56d59 [ion/events] Remove method defaultIsDefined
Change-Id: Ic5c057a451bfc49d99f4b2a70ec5dbff16844a86
2020-11-04 15:58:38 +01:00
Gabriel Ozouf
0185e0562c [escher/run_loop] Move kandinksy include
To check whether an ExternalText could be written with Epsilon's fonts,
UTF8Helper made a reference to Kandinsky, which is prohibited. This
check is now done in Escher, before dispatching the event.

Change-Id: I55e9db1ba43c3115775499db47b90a6bdd7cc7b3
2020-11-04 15:58:38 +01:00
Hugo Saint-Vignes
d5e810f2b8 [ion/shared] Remove contexpr array definition in header
Change-Id: I620e977b000ee53c3db97510e666dfda30f4db30
2020-11-04 15:58:38 +01:00
Hugo Saint-Vignes
8dc6391e92 [apps/shared] Prevent Array index overflow
Change-Id: I67ffcb71d0d62a3e67e6d63d2b30b0696800cb42
2020-11-04 15:58:37 +01:00
Gabriel Ozouf
fe950386a0 [interactive_curve_view_range] Fix assert
Change-Id: I2ff3cfe90f10b33db3e18b321cf931c9f0946479
2020-11-04 15:58:37 +01:00
Gabriel Ozouf
9e9033537c [WIP][interactive_curve_view_range] Tweak tolerance
Change-Id: Iacfb7de81a4ab8a7fb73770053e189d596016201
2020-11-04 15:58:37 +01:00
Gabriel Ozouf
ad7890a19c [interactive_curve_view_range] Missing refresh
Fixes the following bug :
  - Plot ln(x) (or any other curve that's normlalized by default)
  - Go back and replace ln(x) with log(x) (or any other curve that's NOT
    normalized by default)
--> The 'Equal Axes' button is still on.

Change-Id: I0ef50dc9866e908894bd4f5c3ade198f9b3ea318
2020-11-04 15:58:37 +01:00
Hugo Saint-Vignes
f789bb156d [ion/keyboard] Fix const const array
Change-Id: I75cfc94ed36493a78bd104f8c4734f2ecd3d042d
2020-11-04 15:58:36 +01:00
Hugo Saint-Vignes
aa50a5eb7c [apps/shared] Silence warning for unused variable
Change-Id: I1df4a8c111688e00a82d4448d47fd571fec738e4
2020-11-04 15:58:36 +01:00
Gabriel Ozouf
eb5f4b333a [ion/clipboard] Update comments 2
Change-Id: Ib628a888f6712ad6ea62ccb20192845d19e84986
2020-11-04 15:58:36 +01:00
Gabriel Ozouf
8bb0b47b9f [ion/clipboard] Update comments
Change-Id: I320f8130b7bc897b6e8e3bf7d79cfcda837a9984
2020-11-04 15:58:35 +01:00
Gabriel Ozouf
f66bde6d31 [ion/clipboard] Rework clipboard handling
Change the way the clipboard is fetched, so as to preserve the
Poincare/Python translation feature, and remove the cap on the length of
text being imported into the simulator.

Change-Id: I0f3e83c0c8aa4b64eb08d882aa6891b31f191e22
2020-11-04 15:58:35 +01:00
Gabriel Ozouf
010b474f77 [ion/clipboard] Add support for web simulator
Wrote methods for accessing the system clipboard from the web
simulator, as the methods in SDL_Clipboard do not work when the video
device uses emscripten.

Change-Id: Ib2e66530a6b013eca0cf69fb52372e9e3a21c8bb
2020-11-04 15:58:35 +01:00
Gabriel Ozouf
b9c34ace3a [ion/clipboard] Use system clipboard on simulator
Add methods to interface Epsilon's clipboard with the system's when
running a simulator.
Note that the clipboard still uses a buffer located in the
Escher::Clipboard class, as some features require a buffer to execute
computations on the clipboard's content.

Change-Id: I14c19615805d38735e64d481c617863db22db9bc
2020-11-04 15:58:35 +01:00
Hugo Saint-Vignes
6ba88921b9 [apps/calculation] Add Unknown NullStatus Todo
Change-Id: Ic67eca0b95350c72167057c40f18ae969793ef18
2020-11-04 15:58:34 +01:00
Hugo Saint-Vignes
42f20fb58d [poincare] Add NullStatus and sign for more complex expressions
Change-Id: Ic593517bf7a983985fe3c521e10c19ab0bca4191
2020-11-04 15:58:34 +01:00
Hugo Saint-Vignes
61d33be2a7 [poincare] Add NullStatus and sign for more expressions
Change-Id: I4443a28532f5b728afe169a3d2a70d9026bc1909
2020-11-04 15:58:34 +01:00
Hugo Saint-Vignes
4a3f749cc6 [poincare] Add NullStatus for expressions
Change-Id: Ibaba72e3e3589ba259c7b22d402e2b27937f27c1
2020-11-04 15:58:34 +01:00
Hugo Saint-Vignes
b2945c3f8b [poincare] Add isNumberZero tests
Change-Id: Ia8906e27c5c28f96c87ed39f522f4b1028ad80b8
2020-11-04 15:58:33 +01:00
Hugo Saint-Vignes
98499f6c9f [poincare] Rename isRationalZero to isNumberZero
Change-Id: I554dd5e9b9ab3af4364ca23cde590f9e0a458ef8
2020-11-04 15:58:33 +01:00
Hugo Saint-Vignes
58114255e5 [poincare] implement isRationalZero for other numbers
Change-Id: I40f61958f9e51adb376407b2a512097962979417
2020-11-04 15:58:33 +01:00
Hugo Saint-Vignes
9d077c672d [poincare/test] Add tests for multiplication reduction
Change-Id: I54186c0a7c12f7fb0122c0a67f4a6d0d462feb82
2020-11-04 15:58:32 +01:00
Hugo Saint-Vignes
0d883bfb19 [poincare] Handle division by 0 when combining powers
Change-Id: I108ba8131ef2f8d3d210a769322a815121311f6b
2020-11-04 15:58:32 +01:00
Hugo Saint-Vignes
aba09e1a1f [poincare] Fix multiplication.cpp comment typos
Change-Id: I1553144fb45f45cbdb4e021b14ef20cb319984cc
2020-11-04 15:58:32 +01:00
Gabriel Ozouf
3b24f9c2c3 [interactive_curve_view_range] Check auto status
Deactivate Auto status every time the range effectively changes.

Change-Id: I695b840d5e72061a73a229a6e726433660bdfdbf
2020-11-04 15:58:31 +01:00
Gabriel Ozouf
5a5955b513 [interactive_curve_view_range] Status unchanged
Only notify the delegate to the refresh the button when the status has
changed.

Change-Id: I6689d2c292ff96039a68cd1b437b18df5fb98829
2020-11-04 15:58:31 +01:00
Gabriel Ozouf
82a77df088 [interactive_curve_view_range] Missing resets
Added some missing resets of the Auto and Normalize statuses

Change-Id: I5514a2566c1f6ba73d04b526402b428b2edce4b4
2020-11-04 15:58:31 +01:00
Hugo Saint-Vignes
f2ba5daab9 [apps/regression] Comment assert that cannot be satisfied
Change-Id: Iaae5ee4292e33f923f47590ee4520bac44c5d750
2020-11-04 15:58:31 +01:00
Hugo Saint-Vignes
f58633b03c [apps/regression] Add escape case if data is not suitable for regression
Change-Id: Ie2e028a5030e1b0d3f133efdde971645d5b4687b
2020-11-04 15:58:31 +01:00
Hugo Saint-Vignes
b2d7ee800a [apps/statistics] Add pop-up to confirm parameter discard
Change-Id: I0d0d7dca0e167cfcb40f4b26d8208e12056ebf40
2020-11-04 15:58:30 +01:00
Hugo Saint-Vignes
a922e44558 [apps/statistics] Add temporary parameters for histogram
Change-Id: I67c21d59263b7eddd7ee8ee9e61c168e6b013d13
2020-11-04 15:58:30 +01:00
Hugo Saint-Vignes
cab22fcbce [apps/shared] Set buttonAction method as protected
Change-Id: Iaef80fdbb6083be688fadc2b5fc515dbbd0d004c
2020-11-04 15:58:30 +01:00
Gabriel Ozouf
aadf8f5716 [ion/events] Fix ExternalText buffer size
The size of the ExternalText events shared buffer is now defined as the
size of the SDL_TextInputEvent 'text' field, as it should.
Also fix a wrong parameter being passed to a strlcpy.

Change-Id: I6a57d49d61fec8a009c4711efce564c65544e571
2020-11-04 15:58:29 +01:00
Gabriel Ozouf
b0b6fe33c9 [ion/events] Factor includes of layout_events.h
Change-Id: Id7f68f4dfb4727453a02437a0b824492a8c94730
2020-11-04 15:58:29 +01:00
Gabriel Ozouf
4ea8263185 [ion/simulator/events_keyboard] Serve ExternalText
Generate an ExternalText event when catching a SDL_TextInputEvent whose
text cannot be boiled down to one of the regular events.

Change-Id: I036fa2a153c8351979521d7f8cba6b62aa64604b
2020-11-04 15:58:29 +01:00
Gabriel Ozouf
8181753553 [ion/utf8_helper] Method to check text compliance
Change-Id: I9683a8ba819b1a4aad18bcc4759160509e424d4e
2020-11-04 15:58:29 +01:00
Gabriel Ozouf
96b8e1859a [ion/events] Create event ExternalText
Added an event to represent the typing of text that is not on the
device's keyboard. ExternalText event's text is read from a buffer, that
will be filled when the event is generated.

ExternalText only exists on the simulator.

Change-Id: Ie78d2c7c2de91da986a1ce2130a5ecd123db48ee
2020-11-04 15:58:28 +01:00
Gabriel Ozouf
65156c8e5a [poincare/zoom] Add test for x*ln(x)
Change-Id: Ia28a7ffb826a9b6e3618b222b6ed9d0d43de308a
2020-11-04 15:58:28 +01:00
Hugo Saint-Vignes
93b5a3f63a [poincare] Handle equal negative numbers in GCD LCM
Change-Id: Ia46966270418a339f8a37e8a1971a7f7dd046034
2020-11-04 15:58:28 +01:00
Gabriel Ozouf
82c4fe2190 [poincare/zoom] Limit explosion detection
Do not take strong variations into account if they would erase more
interesting variations.

Change-Id: I6299a64bed449a611f90eda4234af10a183958d1
2020-11-04 15:58:28 +01:00
Gabriel Ozouf
3a90ed6109 [ion/events_keyboard] Fix selection on long press
A previous fix to prevent AlphaLock from interfering with the long press
feature broke the long press selection. Revert the changes and find
another solution to the previous problem.
We compare the alpha status to both the state of the Alpha key and the
Lock, which makes sense : Lock is supposed to mimic Alpha being
continuously pressed.

Change-Id: I1349eb83f8971d3a5efcb10de020bb6c0aed64a1
2020-11-04 15:58:27 +01:00
Hugo Saint-Vignes
2740056472 [apps/statiastics] Rename i18n messages accurately
Change-Id: If88f91d6e925dbb2ad293b537661eb3d137ea826
2020-11-04 15:58:27 +01:00
Hugo Saint-Vignes
81616950f3 [apps/statistics] Fix horizontal alignement for size legend
Change-Id: I834444aee7dd547c71254df4658c0db05eb101d7
2020-11-04 15:58:27 +01:00
Martijn Oost
6628e76d36 [NL] adjust translation in python app 2020-11-04 15:58:27 +01:00
Martijn Oost
52adea0c1f [NL] correct spelling mistake 2020-11-04 15:58:27 +01:00
Hugo Saint-Vignes
14e2f6247a [apps/shared] Update translation size -> frequency
Change-Id: I841bd22077cccacc7d2a4a541cca2e463f13925b
2020-11-04 15:58:26 +01:00
Hugo Saint-Vignes
bb8a28ade0 [poincare/zoom] Simplify plot ranges after adding margins
Change-Id: If8904ca4e7d306376de785a125fe5fba168de718
2020-11-04 15:58:26 +01:00
Hugo Saint-Vignes
3f25a37cc8 [i18n] Update Graph view parameters wording
Change-Id: Icd65c4e19b78cd8751d6b1b583c112abb08c9237
2020-11-04 15:58:26 +01:00
Hugo Saint-Vignes
2f97dab6d1 [apps/shared] Add toggle buttons in Graph view
Change-Id: I7548d11fb114b2605ce34d3bda0776277b79ff9d
2020-11-04 15:58:25 +01:00
Gabriel Ozouf
a76e54642c [poincare/zoom] Change struct to class
Change-Id: I06d1850074b266a694d74e4db4c754ff156c8098
2020-11-04 15:58:25 +01:00
Gabriel Ozouf
194cd0491c [sequence] Format comment
Change-Id: Iaff562cca9af3eb903d6cc8a529c730184235e4b
2020-11-04 15:58:25 +01:00
Gabriel Ozouf
29f47124b1 [poincare/zoom] Use std::min & max
Change-Id: If3983c16d3bfa0de31aefe8a3f5c650e1858f822
2020-11-04 15:58:25 +01:00
Gabriel Ozouf
3a87e47de5 [interactive_curve_view_controller] Zoom button
Renamed zoom button

Change-Id: I476c0991d5ab88c6642b793fbe10debbcca4e014
2020-11-04 15:58:24 +01:00
Gabriel Ozouf
0e4de43b8f [shared] Rename ZoomParameterController
Change-Id: I64a6500b66db4455217920a1e73efd5848216411
2020-11-04 15:58:24 +01:00
Gabriel Ozouf
f491be2db5 [poincare/zoom] Accelerate normal range search
Change-Id: I4a7f2e024ca82a3996ad3e395c8f62ca4170ec9e
2020-11-04 15:58:24 +01:00
Gabriel Ozouf
31e694f41a [poincare/zoom] Add tests
Change-Id: Ia7229d790ef1d2039071e35accb102804c94cb01
2020-11-04 15:58:23 +01:00
Gabriel Ozouf
9c320185dd [poincare/zoom] Return value for boring curve
Change-Id: Iad983da0aa3066f5be0c75c5b8e38e62a907d5a1
2020-11-04 15:58:23 +01:00
Gabriel Ozouf
c647bfe566 [poincare/zoom] Clean up and comment API
Change-Id: I58347d7188551471817fb334bcb54d5c5b398f72
2020-11-04 15:58:23 +01:00
Gabriel Ozouf
91e1154bb8 [sequence/curve_view_range] Fix normalize
Change-Id: I1e4aa49dd84f12fe4e0f2ab59912fc68fe00b2fa
2020-11-04 15:58:23 +01:00
Gabriel Ozouf
6f8d80f8ae [regression/store] Sanitize default range
Add range sanitation and checks for orthonormal ranges in setDefault.

Change-Id: I733a8808e944a477573a76b52fef479853b8ad6d
2020-11-04 15:58:22 +01:00
Gabriel Ozouf
c4cd3ecffa [poincare/zoom] Factor range sanitation
Checking wether the range that has been computed is suitable is now
done in Poincare::Zoom by SanitizeRange.

Change-Id: Ib7ff73a3beae29996b1a773744021ad85c6ba946
2020-11-04 15:58:22 +01:00
Gabriel Ozouf
b10be2c60c [poincare/zoom] Method SanitizeRange
Create a method to clean up an ill-formed range, ie a range whose bounds
are not finite, or where max <= min.

Change-Id: If4525e65f95385cfa970be72bbcc21ad84286bfa
2020-11-04 15:58:22 +01:00
Gabriel Ozouf
71e7070657 [function_graph_controller] Remove yRangeForCursorFirstMove
This method, that prevented the graph from panning when moving the
cursor for the first time, caused more problems than it solved.
For instance, the graph for 1/(1-x) was not symmetrical because of it.

Change-Id: Ibb22e38ec0ace6b219c0e42dda481c98b5f717f0
2020-11-04 15:58:21 +01:00
Gabriel Ozouf
3ba4f974f7 [interactive_curve_view_range] Move status update
The methods setDefault and normalize now update the zoomAuto and
zoomNormalize status.

Change-Id: I0400c22816c17d38fd1b3dee5c8a2f1ccfa79340
2020-11-04 15:58:21 +01:00
Gabriel Ozouf
958b172d08 [poincare/zoom] Handle undefined functions
Rework the logic so that :
  - an undefined function will be displayed with a clealry defined
    null range.
  - display both an undefined function and a correct function at the
    same time will not affect the correct range.

Change-Id: Ife9dc0d2ace667cab5a6b8826347078fca33e4d5
2020-11-04 15:58:21 +01:00
Gabriel Ozouf
20cbefad41 [function_graph_controller] Fix y for first move
Method yForCursorFirstMove is supposed to expand the window so that the
first move of the cursor won't cause it to pan. It now filters extreme
values to prevent the original window to be totally squashed, such as
with the drawing of e^x and (x-100)(x+10) at the same time.

Change-Id: Icd6c26b01475a112c4231f293e03ab31d80d5e51
2020-11-04 15:58:20 +01:00
Gabriel Ozouf
0a6ac0b40b [apps/graph] Remove tests on ranges
As zooming has moved to Poincare, so will the tests.

Change-Id: I6c1fe581edc903369779e46a295447273a89e517
2020-11-04 15:58:20 +01:00
Gabriel Ozouf
1bfeeb5842 [poincare/zoom] Detect explosions
Add a clause in InterestingRangesForDisplay to detect strong variations.
This improve the graph for x^x or x^2+x+1 for instance.

Change-Id: I74214c2382cfe4b0e2603556dd8c6cbd450effc0
2020-11-04 15:58:20 +01:00
Gabriel Ozouf
8ce9f363ad [interactive_curve_view_range] Force equal axes
Added a tolerance when checking orthonormality, so that ranges that are
nearly orthonormal will be made orthonormal.

Change-Id: Ie3bf076086561e3ff6374e7daa9dd1a884c52d5a
2020-11-04 15:58:19 +01:00
Gabriel Ozouf
482ca10363 [poincare/zoom] Improve null range
When displaying f(x) = undef, the range now defaults to an orthonormal
range, centered on the origin, with axis unit 1.

Change-Id: Ie3515be0572af4849b8ebd113449f4444755b34f
2020-11-04 15:58:19 +01:00
Gabriel Ozouf
190568ea84 [interactive_curve_view_controller] Fix Cursor
Restore the permanence of the cursor between accesses to the graph
window.
The cursor used to be reset when the models had been modified. As there
is no longer a system in place to track these modifications, we manually
check if there is a curve beneath the cursor before reseting it.

Change-Id: I6f71fc17744b5bf1ee552c82126bb4a08b823629
2020-11-04 15:58:19 +01:00
Gabriel Ozouf
16707aa518 [poincare/zoom] Tweak orthonormal range
Change some parameters to improve the output of
RangeWithRatioForDisplay. Notably, change how the size of the range is
weighed.

Change-Id: I7695c61c3f93482f3fed9c7d2183642573b02cff
2020-11-04 15:58:18 +01:00
Gabriel Ozouf
6be5e7d62c [apps/shared] Change Zoom API
Moved some code around to decrease redundancy and put more of the logic
into Poincare::Zoom

Change-Id: I4804cf39493ac7f2f0b3c4eb554e5c15c3cef1c9
2020-11-04 15:58:18 +01:00
Gabriel Ozouf
8572f4953c [poincare/zoom] Method CombineRanges
The logic behind combining several ranges will be handled by the Zoom
class directly.

Change-Id: I4de3f020d94b9bc1a21953b0c416158c65beb606
2020-11-04 15:58:18 +01:00
Gabriel Ozouf
81e425eb04 [poincare/zoom] Method FullRange
Change-Id: Ibfaa0b694afecab312199b20b102a57901f34ae7
2020-11-04 15:58:17 +01:00
Gabriel Ozouf
09c061e871 [poincare/zoom] Method RangeFromSingleValue
This method adds margins to a range whose bounds are equal.

Change-Id: I2b2fe26fe431deda112389060d401f738a75b1ae
2020-11-04 15:58:17 +01:00
Gabriel Ozouf
a525c35ebb [poincare/zoom] Factor constants
The mantissas {1, 2, 5} used in CurveViewRange to compute the grid units
can be factored in Zoom.

Change-Id: I2bcc9b9df1ff6b6df82092a5d78ed3db132bf63a
2020-11-04 15:58:17 +01:00
Gabriel Ozouf
88ea32bd0d [poincare/zoom] Change range forms for fixed ratio
When looking for a range with a certain ratio using
RangeWithRatioForDisplay, instead of looking for ranges of the form
0.01*1.1^n, search for ranges of the form a*10^k, with a being either 1,
  2, or 5.

Change-Id: I2eaa229574a9a6aa4afa6eb1a3d57365d3d52801
2020-11-04 15:58:17 +01:00
Gabriel Ozouf
43f50b7b2d [interactive_curve_view_range] Missing refresh
The normalized status would not be refreshed after a call to setDefault
triggered by InteractiveCurveViewController::viewWillAppear.

Change-Id: I923ef3ca0585dbcc1f32b992d7dd1f4a3a206532
2020-11-04 15:58:16 +01:00
Gabriel Ozouf
bcb4b3095b [function_graph_controller] Fix Y range expansion
The method FunctionGraphController::yRangeForCursorFirstMove expands the
Y range to include the values of the first cursor moves on the left and
the right of the center. It has been modified to preserve
orthonormality.

Change-Id: I898ab9721e45e2acde261f8b94b80cab81b39a92
2020-11-04 15:58:16 +01:00
Gabriel Ozouf
f54b15b9c8 [interactive_curve_view_range] Preserve ratio
Preserve orthonormality when adding margins to a default range.

Change-Id: Iaa1da8d36812e2dad1be3894198ee0fabcd3020f
2020-11-04 15:58:16 +01:00
Gabriel Ozouf
5d9c7b0c1f [interactive_curve_view_range] isOrthonormal
Change-Id: I154487908d1a2a11e01b2a4e51ef867e235babab
2020-11-04 15:58:15 +01:00
Gabriel Ozouf
29714b401e [shared/function] Create an orthonormal range
When the function does not have any points of interest, fall back to an
orthonormal range.

Change-Id: I90e4bcfae80ebd37f95d404a4a63121c93cf7cff
2020-11-04 15:58:15 +01:00
Gabriel Ozouf
d642339963 [interactive_curve_view_range] Normal ratio
The method NormaRatio returns the screen ratio for an orthonormal
range.

Change-Id: Ib834f9934232866646da16c78447782cdbdc0af2
2020-11-04 15:58:15 +01:00
Gabriel Ozouf
403315f6ac [poincare/zoom] Find range with specific ratio
Change-Id: Id0c816c42e3fa93519241bf53f920c333e204af1
2020-11-04 15:58:15 +01:00
Gabriel Ozouf
08c96c5107 [poincare/zoom] Method SetToRatio
Added a method to Zoom to set a range to a specific ratio. This method
is used by InteractiveCurveViewRange::normalize.

Change-Id: Id3029439294ece02ea19fb6c6de90b9edc85d771
2020-11-04 15:58:14 +01:00
Gabriel Ozouf
c4aad1641e [poincare/zoom] Rename k_defaultMaxInterval
Bring it in line with k_minimalDistance which as a similar role.

Change-Id: Ifc3ad793e8b5ff1e7f2598d0665abdd5c954e61f
2020-11-04 15:58:14 +01:00
Gabriel Ozouf
0465cec924 [poincare/zoom] Remove rounding of abscissa
As margins are added later in InteractiveCurveViewRange::setDefault,
rounding abscissa at this point is premature.

Change-Id: I411dd014b712649efd55cb995ed7a9c5c14a7f43
2020-11-04 15:58:14 +01:00
Gabriel Ozouf
ad6edffc07 [poincare/zoom] Remove tuneXRange argument
The ability to perform a range search without changing the X range was
only there to accomodate the Yauto feature.

Change-Id: I8c2b61b447fbd3dc1f4e303dff06d1a8d6e7a4f2
2020-11-04 15:58:14 +01:00
Gabriel Ozouf
07c52139b9 [apps/shared] InteractiveCurveViewRangeDelegate
Clean up the class by removing some unused methods and structures.

Change-Id: Ife38a9a0ed4bfb84986227d1f57fe3f5d2c4ff2a
2020-11-04 15:58:13 +01:00
Gabriel Ozouf
26754a3230 [graph] Force same grid unit on orthonormal graphs
Change-Id: I2abca9eb1c4a14057323ee97e1044715f89620ff
2020-11-04 15:58:13 +01:00
Gabriel Ozouf
7322751453 [regression] Compute Y range for curve
Regression's automatic Y range used to rely on the Yauto feature. Since
it has been removed, it is now done in Store::setDefault.

Change-Id: I1b6653bb8ebe0ba99decff05bae29bd5a69a9f6c
2020-11-04 15:58:13 +01:00
Gabriel Ozouf
0f1e27b2b6 [apps/sequence] Add Y range to interestingRanges
The computation of Sequence's graph default Y range used to rely on
Yauto. As this feature does not exist anymore, this work is now done int
Sequence::GraphController::interestingRanges.

Change-Id: Idba8560d5f25d0bf34dd0e1dd98c2af67f427709
2020-11-04 15:58:12 +01:00
Gabriel Ozouf
1d4d56a7dd [apps/range_parameter_controller] Change margins
Reduce the top and bottom margin of the table view to better see the
Confirm button.

Change-Id: I71df479400c44a10fe75b8beaae1c81be305cdfd
2020-11-04 15:58:12 +01:00
Gabriel Ozouf
f0cd0694a6 [apps/shared] Activating Auto zoom resets cursor
Change-Id: Ib815286e1316e20f72b31d3d9206aa032b06eff4
2020-11-04 15:58:11 +01:00
Gabriel Ozouf
bf76b56f90 [apps/shared] Change Zoom button in curves
Zoom is now called navigate, and its button is placed before the Axes
button.

Change-Id: Ied194c20438e573a237ce36f221b9be87cfd4bab
2020-11-04 15:58:11 +01:00
Gabriel Ozouf
43d21180bc [apps/shared] Deactivate zoomAuto on pan and zoom
The Auto mode for curve ranges must be deactivated when moving the
cursor outside the screen and when activating navigation (formerly
Zoom).

Change-Id: I281a1d069c2ebcc30e7ead469c4f48438054d7c2
2020-11-04 15:58:11 +01:00
Gabriel Ozouf
5c67f92d18 [apps/interactive_curve_view_controller] Buttons
Add two new buttons to toggle Auto and Normalized modes for curves.

Change-Id: Ib583d087ce5ae779d24f6a8bbc72ab7140752dd5
2020-11-04 15:58:10 +01:00
Gabriel Ozouf
cc22b0d298 [apps/shared] Reset curve range to default in Auto
When the range is set to ZoomAuto, the range is recomputed before
displaying the curve.
2020-11-04 15:58:10 +01:00
Gabriel Ozouf
e2725c8e61 [apps/interactive_curve_view_range] Status markers
Add member variable m_zoomAuto and m_zoomNormalized to remember the
interactive range's status.

Change-Id: I77c43ddd683d3c6011742801139d23f5e20c99fe
2020-11-04 15:58:10 +01:00
Gabriel Ozouf
13d1b7077c [apps/shared] Removed method computeYRange
This method of InteractiveCurveViewRangeDelegate was only used to
compute the Y range when Yauto was on.

Change-Id: I9b688a87e16fc58c7d2b00eb071076b98f945df6
2020-11-04 15:58:09 +01:00
Gabriel Ozouf
8970e294aa [apps] Remove modelVersion from curves apps
The graph range used to be reset to default whenever all functions were
modified. As we no longer want to reset the range without the user's
input, we do not need to track whether the functions changed at all.

/!\ As of this commit, there is no longer a way to restore the default
zoom, until a new automatic zoom button is added.

Change-Id: Ie74e8fd61e13055fa6ce2b2d1e883182d4ecffce
2020-11-04 15:58:09 +01:00
Gabriel Ozouf
1a5661fd4c [apps/range_parameter_controller] Remove YAuto
This allows for a great deal of simplifications in the class
RangeParamterController.

Change-Id: I5de55d4e8e1f598eb13b08fb8f042907f55b2fa8
2020-11-04 15:58:08 +01:00
Gabriel Ozouf
5a07db3452 [apps] Remove "Preadjustments" menu for curves
Change-Id: I1a30efd502c5db36325d87fa0f1dffacc37a4f1c
2020-11-04 15:58:08 +01:00
Gabriel Ozouf
d2b36be846 [poincare/zoom] Move automatic zoom to Poincare
Change-Id: I7a70ab54b33b9150682cc4f999ff4999a8288b7f
2020-11-04 15:58:07 +01:00
Hugo Saint-Vignes
7499a9e0a4 [apps] Set Country from language in main.cpp
Change-Id: I09f6733fa36e8f0c7870bc26eb8662cda79ae715
2020-11-04 15:58:07 +01:00
Hugo Saint-Vignes
5339d9e7b4 [apps/shared] Add static assert for cache steps
Change-Id: I77498775b4caf3d97522219d2a7c979601b985e8
2020-11-04 15:58:07 +01:00
Hugo Saint-Vignes
4acbf3346b [apps/shared] Add comments and minimize threshold
Change-Id: Ieb56513ea0a7fab35acf15531277aec5cd6071ca
2020-11-04 15:58:03 +01:00
Hugo Saint-Vignes
ebe207d67d [apps/shared] Fix cache overlap when plotting polar curves
Change-Id: I4b1d6dccdedc5b3cea455e2ad2038336b4b48064
2020-11-04 15:55:40 +01:00
Arthur Camouseigt
b567a09103 [VariableBox] Allowing sequences to display their type
Change-Id: I2929f7d9f3a266fbff81100a39f793fe6200da1d
2020-11-04 15:33:05 +01:00
Léa Saviot
ad80c2c4d7 [ion/keyboard] Do not define constexpr arrays in headers
They are duplicated in each compilation unit where they are called
2020-11-04 15:33:05 +01:00
Hugo Saint-Vignes
697f727429 [apps/shared] Add discard confirmation on range parameters
Change-Id: I609acbd136cb0bc84899777810f4c1497832952f
2020-11-04 15:33:05 +01:00
Hugo Saint-Vignes
3705ce4f92 [apps/graph] Add discard confirmation on domain parameters
Change-Id: I61043aa195f10038bbcfb6c091f08e684db20849
2020-11-04 15:33:04 +01:00
Hugo Saint-Vignes
150a5bfa5a [apps/shared] Add discard confirmation on table intervals
Change-Id: Id152577c570febf06b4d829fd2723c2a30c3ccd9
2020-11-04 15:33:04 +01:00
Hugo Saint-Vignes
bd23135198 [apps/shared] Add Discard confirmation pop-up
Change-Id: Ida3878894090ecfa99145618b8e1ff0bbcb4743a
2020-11-04 15:33:04 +01:00
Arthur Camouseigt
91dc5eb5ec [Sequence Graph] Fixing the banner to display u(n)
The banner used to display u(n+1)/u(n+2) if the sequences were not
explicit. This was incorrect and fixed

Change-Id: I59100942b51f4170d9662a6fd7b82d0f7e50ae6f
2020-11-04 15:33:04 +01:00
Arthur Camouseigt
bf95b460c3 [Sequence] Fixed computation error and asan fails
Change-Id: Ib3a619d29bee5cc6f10b939ee066459a5b135c5d
2020-11-04 15:33:04 +01:00
Arthur Camouseigt
86d0c19293 [ok view] Fixing the grey tone of the ok symbol
Change-Id: Id65a4e37c41e1b675178d3220c15ebfe26b1e71e
2020-11-04 15:33:04 +01:00
Arthur Camouseigt
bf0f6c7a33 [Global Context] Fixed rank approximation error for sequences
Change-Id: I29c0a55956aee8764e50650b229a49aa8a0f9336
2020-11-04 15:33:04 +01:00
Émilie Feral
f64a650ef6 [apps] I18n: localize Dutch exam mode messages 2020-11-04 15:33:04 +01:00
Martijn Oost
8f117e9d4e [NL] correct spelling mistake 2020-11-04 15:33:04 +01:00
Roberta Rabotti
8a5ed92a56 [IT] Translation changes: Prime factors 2020-11-04 15:33:04 +01:00
Serenela Moreira
59b2a64830 [pt] corrected prime factors
And improved translation of another detail
2020-11-04 15:33:04 +01:00
Gabriel Ozouf
25ab4b2a52 [shared/localization_controller] Table cropping
Forced the top cell of the country table to be cropped in the middle,
cutting the text, to avoid the cell looking squashed.

Change-Id: I4d126ed19249f47652bd7f2001384b2491cfe6f8
2020-11-04 15:33:03 +01:00
Hugo Saint-Vignes
b051242f2b [test] Avoid high precision number approximation
Change-Id: I88537653cea2a399581e9686bd027c9d20953667
2020-11-04 15:33:03 +01:00
Hugo Saint-Vignes
a326a1f9ff [poincare] Fix approximation test
Change-Id: I0951e01acf7266e33d05f40de3119b73c656b9a2
2020-11-04 15:33:03 +01:00
Hugo Saint-Vignes
d224778330 [ion/simulator] Temporarly increase stack size on simulator
Change-Id: I0f27277ea704f81e316c7ff78fb7bed8c70ff4ae
2020-11-04 15:33:03 +01:00
Hugo Saint-Vignes
fa9c9c1567 [apps/regression] Add todos for logistic regressions
Change-Id: If2ddc0527d8be89970803de240a6760d037570e2
2020-11-04 15:33:03 +01:00
Hugo Saint-Vignes
e517128a9e [apps/regression] Compute R2 better when dealing with constant regression
Change-Id: Ic724d8d96cb723718a1ce57e72132972a782fc5e
2020-11-04 15:33:03 +01:00
Hugo Saint-Vignes
3f43504398 [poincare] Check for nan values when inverting matrix
Change-Id: Idb542682003348da151975e635958cf909010d16
2020-11-04 15:33:03 +01:00
Gabriel Ozouf
ab864d10d8 [ion/events] Compare event for repetition
This fixes the following bug :
  (Anywhere with a movable cursor, like a table, a text field or a curve)
  - press Alpha (once, or twice to activate the lock)
  - keep pressing a direction
--> The cursor would only move once.

Change-Id: I46115d1a31ced244615bfdfe08f37dfe7e918d6e
2020-11-04 15:33:03 +01:00
Gabriel Ozouf
d8e6b63a2e [sequence] Type stays selected in menu
- Create a first-order recursive sequence
  - Select u_n -> Sequence type
--> The second line will be selected, as expected.

Change-Id: I2025ebaa9a7b49ee33ff5e63a4c767a858b46850
2020-11-04 15:33:03 +01:00
Émilie Feral
7168188a44 [ion] Simulator apple: fix rule_label for assets 2020-11-04 15:33:03 +01:00
Martijn Oost
388d1a785e [apps/calculation] Update NL translation
Change NL definition in additional results
2020-11-04 15:33:03 +01:00
Émilie Feral
64ff5b4c70 [app/shared] CurveView: simplify implementation of
pixelLengthToFloatLength (avoid avoidable overflows)
2020-11-04 15:33:03 +01:00
Émilie Feral
5b4fc6ff84 [apps/shared] CurveView: implement CurveView::pixelLength(Axis) 2020-11-04 15:33:03 +01:00
Émilie Feral
d6751e6e03 [apps/shared] CurveView: improve floatLengthToPixelLength to avoid
useless computations (and potential overflowing)

This fixes the drawing of arrow(100,100,0.1,3) in matplotlib module of
python
2020-11-04 15:33:02 +01:00
Gabriel Ozouf
5d3069ff34 [code/catalog] Capitalize 'line feed' in EN
Change-Id: I91b8c4b613b9e9dece13fbb0e9635b4aa8dbfd4a
2020-11-04 15:33:02 +01:00
Gabriel Ozouf
c1b0465ca4 [apps/i18n] Add 'Metric' message
'Metric' is used to label the toolbox sub-menus containing metric units
when the selected country uses the imperial system.

Change-Id: I6f40bcd3151be614a5a02cdd17c70ea4a91bfc00
2020-11-04 15:33:02 +01:00
Gabriel Ozouf
bad0c81bf0 [apps/math_toolbox] Rearrange unit toolbox
The layout of the unit toolbox changes depending on the unit system in
the selected country.
All units have been rearranged by increasing order of magnitude.

Change-Id: Ib51759cca88fd6b6122dd5a3a25b8ed04024aaf3
2020-11-04 15:33:02 +01:00
Gabriel Ozouf
2e2845370a [apps/math_toolbox] Add fork nodes in tree
Some nodes of the ToolboxMessageTree can be marked as "forks",
dispatching one branch or the other depending on preferences.
They are used in the Unit menu to provide a different toolbox depending
on the unit system.

Change-Id: I591f7abc3d24e682e827a540a9defac1877871b5
2020-11-04 15:33:02 +01:00
Gabriel Ozouf
6105f44a46 [escher/toolbox_message_tree] Add indirection
The children of a ToolboxMessageTree object can be stored as a simple
pointer, representing an array of all the children stored consecutively,
or as a double pointer, representing an array storing the addresses of
all children.

Change-Id: I10134684963aaafc635aaf9a2374d0f3c32d3d0c
2020-11-04 15:33:02 +01:00
Gabriel Ozouf
f777cad3f7 [kandinsky/font] Degree symbol
Aligned the top of the degree symbol ° with the top of capital C and F,
and reduced its right margin.

Change-Id: I63f50654afd965186400e451d71be41add9556c8
2020-11-04 15:33:02 +01:00
Gabriel Ozouf
0c1d0195cd [poincare/unit] Check uninitialized expressions
In Calculation, keeping the BACK key pressed can lead to iffy
simplifications and uninitialized expressions beign passed to
ShouldDisplayAdditionalOutputs and SetAdditionalExpressions methods.

Change-Id: If248ab193c471ff433828fc841e01a391e0c052d
2020-11-04 15:33:02 +01:00
Gabriel Ozouf
bc7ca057a0 [apps/calculation] Add Joules to results on energy
Change-Id: Ib775b1bd2bac1fd3bf755a9a4d3d5b3739a67cfa
2020-11-04 15:33:02 +01:00
Gabriel Ozouf
10f8e2f507 [poicare/unit] Rename method
hasAdditionalExpressions -> hasSpecialAdditionalExpressions

Change-Id: Ia5200402b23ab5adf0f94dabe027955a86d1174d
2020-11-04 15:33:02 +01:00
Gabriel Ozouf
ddbe76fec5 [poincare/unit] Add missing additonal results
Additional results are proposed for all units combinations that include
a non-base unit, in addition to units with special results.

Change-Id: I91f2a1a43c72bad0327132396534a223e87b06a2
2020-11-04 15:33:01 +01:00
Gabriel Ozouf
4e771fdb54 [poincare/unit] Missing prefix reset
When tuning the representative without tuning the prefix, the prefix
would not be reset to its default value, causing a problem for masses,
whose base prefix depend on the representative (k for grams, none for
the rest).
Fixes a crash when typing sqrt(_N) with country set to US.

Change-Id: Iade900de5fb31e06fdfafef34ae27da3f36983fa
2020-11-04 15:33:01 +01:00
Gabriel Ozouf
d862d5503c [poincare/unit] Fix rational exponent rounding
In metric, sqrt(N) would be simplified to _N_kg^-0.5_m^-0.5_s instead of
_kg^0.5_m^0.5_s^-1.
We solve this issue by preventing simplification using derived units
in presence of rational exponents.

Change-Id: I97118bb32c963809c8d176b7b297d1682965e9af
2020-11-04 15:33:01 +01:00
Gabriel Ozouf
4ba0603e0c [apps/calculation] Duplicate additional result
Fix duplicate additional results on units by comparing serialization.

Change-Id: Ia360ae7846716a801253b60fcf000240834528bc
2020-11-04 15:33:01 +01:00
Gabriel Ozouf
4d0950fa1e [ion/simulator] Handle typing % on simulator
Change-Id: Ib47786659e710e473f75d1c6887a9794fad0a75f
2020-11-04 15:33:01 +01:00
Gabriel Ozouf
ac2dd9cdf0 [i18n] Translated "Tonne" to "Metric Ton"
Change-Id: I515d78445065a94cc387781ee87a5fa23b3c2df2
2020-11-04 15:33:01 +01:00
Gabriel Ozouf
586e53bb42 [i18n] Set International as default country
When launching a firmware without onboarding, starts with International
selected by default instead of Canada.

Change-Id: Ice5cde4210c4c2934c909d97296460707343773f
2020-11-04 15:33:01 +01:00
Hugo Saint-Vignes
073893ae48 [poincare] Exact undef results with GCD and LCM
Change-Id: Iba39cd6140d8ef5b3fd24e0f53c9e28fbd57d438
2020-11-04 15:33:01 +01:00
Hugo Saint-Vignes
a89878a24d [poincare] Allow more BinomialCoefficient exact results
Change-Id: I9dbbf9471ee6d9e12fe4861a5b11990858382562
2020-11-04 15:33:01 +01:00
Gabriel Ozouf
857ca4eecd [poincare/trigonometry] Fix wrong use of pi
In Trigonometry::shallowReduceInverseFunction, the reduction of
atan(1/x) used the hard value of pi instead of its equivalent in the
selected angle unit.
This fixes a bug causing atan(1/tan(40°)) to be equal to π/2-40 instead
of 50.

Change-Id: Ifd7df5cd168fadf3146eee168c0bc2136ea15a7b
2020-11-04 15:33:01 +01:00
Hugo Saint-Vignes
91d9438421 [poincare] Fix forbidden array access
Change-Id: I3de76c114f6712ee08007601766577d87ed96877
2020-11-04 15:33:01 +01:00
Hugo Saint-Vignes
7e5ddcd36b [python/turtle] Prevent position overflow from turtle
Change-Id: Ieb8a7b64bab1ce6fac23ca4c8dcb43467b8d4d5c
2020-11-04 15:33:01 +01:00
Gabriel Ozouf
6a9a5dbe27 [i18n] Factor duplicate messages in universal
Units with the same name in all available languages have been moved to
the new file toolbox.universal.i18n.

Change-Id: I82ef362ca335dc61da5f3bca67714a9ae409793d
2020-11-04 15:33:01 +01:00
Gabriel Ozouf
63076758a3 [i18n] Check for redundancy in localized messages
After parsing the .i18n files, compare the messages and raise an error
if some of them could be factored into a universal file.

Change-Id: I0dcfe309dc4c310555a0ea16b6d1680e51a8e87d
2020-11-04 15:33:00 +01:00
Arthur Camouseigt
3019609946 [Sequence] Fixing display issue in sequence graphs
Change-Id: I1b914c31cf2e7a84329e86486e30f3a7244f235d
2020-11-04 15:33:00 +01:00
Gabriel Ozouf
64e7057d50 [apps/on_boarding] Remember language choice
When choosing a language and then pressing back from the country menu to
get back to the language menu, the previously selected language remains
selected.

Change-Id: I018c51cce09d47b15bb4864c135d381a94b2a72f
2020-11-04 15:33:00 +01:00
Gabriel Ozouf
54c28fc87f [escher/modal_view_controller] Hide regular view
Do not display the regular view when the main view takes up all the
frame.
This fixes a bug causing the language menu to be briefly visible before
the logo on start-up.

Change-Id: Ia2de44de52ac6f852e0eca05101587042f02913b
2020-11-04 15:33:00 +01:00
Gabriel Ozouf
77ac333e11 [on_boarding/i18n] Localize contact email address
Change-Id: I19ae4299e09b63c373734ddff835fedcabb6749c
2020-11-04 15:33:00 +01:00
Arthur Camouseigt
6a84ba2523 [global_context.cpp] Fixing sequence bug
u(n+2) = u(n+1) + u(n) + u(2)
u(0) = 2
u(1) = 2
Crashed because the global context was not checking if the sequence was
badly referencing itself

Change-Id: I97f694955e15518bb088db50deb761d7ee09d75f
2020-11-04 15:33:00 +01:00
Gabriel Ozouf
d5ce234d4d [probability] Align snapshot buffers
char buffers m_distribution and m_calculation had too weak an alignment,
causing a crash when starting the web simulator.

Change-Id: Ibfd3c2582bc4de97beb4d6cc51b9fb86300edb5e
2020-11-04 15:33:00 +01:00
Gabriel Ozouf
4bde3ed4b0 [poincare/solver] Fix type ambiguity warning
Change-Id: I9248080520d6fa6430dddb8811dbd0120fc08d79
2020-11-04 15:33:00 +01:00
Gabriel Ozouf
28d18dd6a5 [ion/utf8_helper] Signedness and capitalization
Change-Id: I3451a206fbd45a490eea0115621c07abb868344a
2020-11-04 15:33:00 +01:00
Gabriel Ozouf
bd068312d9 [apps/continuous_function_cache] Clear on bad step
Cache did not check that the step was the same before panning, causing
old values to remains cached.
e.g. :
  - Type f(x) = x, and plot it.
  - Go to Axes, and set Xmax = 0.
  - Confirm

Change-Id: Ie8ed10c336cf517a65f19b05bd14866daf8128c2
2020-11-04 15:33:00 +01:00
Gabriel Ozouf
3f19d66c78 [poincare/unit] Change temperature symbols
Celsius and Fahrenheit now use the degree symbol °.
  _Cel -> _°C
  _Fah -> _°F

Change-Id: Ic5935d3a6263a556692bebb6254b6b6d4de48431
2020-11-04 15:33:00 +01:00
Gabriel Ozouf
67e6e38825 [poincare/parsing] Parse degree sign ° in units
Change-Id: I518aba17214b049dfa8fd3b89f4ce124dbd6b41a
2020-11-04 15:33:00 +01:00
Gabriel Ozouf
d37540f032 [poincare/unit] Add Celsius and Fahrenheit
Temperatures can be converted to and from degree Celsius and Fahrenheit.
When used in non-trivial calculations, they are always reduced to undef,
as the rules for manipulating relative scales are not well defined.

Change-Id: If59e224a0e7f940b421bc894bbe2279c90f38d04
2020-11-04 15:33:00 +01:00
Arthur Camouseigt
4274b558b6 [Sequences] Changing the name of CacheContext to SequenceCacheContext
Change-Id: If2d542748f6f7b2363d6c1443f88c058475945eb
2020-11-04 15:32:59 +01:00
Arthur Camouseigt
960335c330 [Sequences] Fixed a few crashes
Change-Id: Ib929bbae0f9ca06409706336ff799075e1288694
2020-11-04 15:32:59 +01:00
Gabriel Ozouf
26bbdead7d [apps/shared] Allow movement from undef curve
Fix a bug preventing the cursor from moving to other curves using UP and
DOWN when the y value was undef.
To reproduce :
  - In Graph, define f(x) = 1 and g(x) = ln(x), then draw the curves
  - Press DOWN to select g
  - Press LEFT until g is not defined anymore
--> Pressing UP or DOWN won't allow you to select f

Change-Id: I79ed4a57b78ac0b8dac3f66e722e358bd4be18d9
2020-11-04 15:32:59 +01:00
Hugo Saint-Vignes
c130f8e881 [apps/shared] Prevent KDPoint overlfowed translation on cursorFrame
Change-Id: Ifc32eefaf4241d59d7567cadb9b2962ba5efb4d9
2020-11-04 15:32:59 +01:00
Arthur Camouseigt
ea36c6e5d7 [Clipboard] Changed the general copy/paste
Fixed issues due to copy/paste of empty formulas. When pasted, empty
formulas are now recognized by the parser and apear with the
correct layout

Without this process, copying an empty integral then pasting it gives :
int((), x, (), ()) instead of drawing an empty integral

Change-Id: I680aaf4eea953149e2d57efa8153ab4d3f93e2a7
2020-11-04 15:32:59 +01:00
Arthur Camouseigt
8f97a332f6 [Python] Modified the paste effect in script and shell area
When a formula is pasted in a script or in the shell, some symbols are
replaced by their equivalent in python :
x turns into *
^ turns into **
√ turns into sqrt
etc
Change-Id: If6f2a22d4f3c148c2655e0892023b0e28058a9a6
2020-11-04 15:32:59 +01:00
Gabriel Ozouf
4b965a0ff6 [shared/localization_controller] Add top border
When selecting a country, the table would be cropped by the text, with
no separator between the white of the cropped cell and the background
color.

Change-Id: Ia6be40bce40b7cdb3efa064989d45ef5c046e364
2020-11-04 15:32:59 +01:00
Arthur Camouseigt
913c81a0d3 [solver] Modified the way to solve some equations
The solutions of equations that need numerical approximations to be
solved are now computed base on the undeveloped equation (instead of
fully the expended one used to identify polynomials)

This allow (x-10)^7=0 to yield x=10 as result (9.95 before)
Change-Id: Ia8acbe57a9cfebf0b5016e9c896d21c8ddac7a64
2020-11-04 15:32:59 +01:00
Gabriel Ozouf
6e9a5a010f [poincare/integer] Add tests on euclidean division
This commit also adds tests on mixed fractions.

Change-Id: I0fee88eb00febccaa9445230f8f2bbb92cd1ba98
2020-11-04 15:32:59 +01:00
Gabriel Ozouf
bad21f0ab5 [poincare/integer] Fix negative mixed fraction
Mixed fractions for negative rational numbers are now computed as the
opposite of their opposite's mixed fraction, as is conventionnal.
ex : -9/5 is now decomposed as -1-4/5 instead of -2+1/5

Change-Id: I6df3dce585ccadd1bcd7cc562576995face98f9c
2020-11-04 15:32:59 +01:00
Hugo Saint-Vignes
b92c819ea2 [escher/src/text_area] Add char limit in text_area line
Change-Id: I9284936f0202d788edc785aa3f7c82b45ab34cf5
2020-11-04 15:32:59 +01:00
Arthur Camouseigt
51002066e9 [sequence] Fixed crash due to undefined sequence
Change-Id: Ie67ff4aa9a53eb8b04535e3b61737e11c9049316
2020-11-04 15:32:59 +01:00
Gabriel Ozouf
b8544e3708 [apps/shared/text_field_delegate_app] Refuse Equal
The Equal sign now triggers a syntax error in all apps but Solver. This
make its behaviour symmetrical with that of < and >.

Change-Id: Ia886c547a315d5627a69f3f2acac2cbce0e202c2
2020-11-04 15:32:58 +01:00
Arthur Camouseigt
fa0e8de0a9 [VariableBoxController] Changed the way sequences appear
Change-Id: I45a1cb01ab9c5aefd298c40050e69850a4cc5c71
2020-11-04 15:32:58 +01:00
Arthur Camouseigt
1d71a14d2c [Context] Modifying context method signature for sequences
This allows sequences to be used in functions by calling u(x)

Change-Id: I336e84a19bf9b3dd0f2e435d1aaebda3c9e71ec8
2020-11-04 15:32:58 +01:00
Arthur Camouseigt
3dca515441 [VariableBox] Added sequences to the variable box
It is now possible to call the value of a defined sequence anywhere.

Change-Id: I1990e93c50f9add175b7ea274e07004ba63289e5
2020-11-04 15:32:58 +01:00
Arthur Camouseigt
c006ed7b10 [Sequence & Shared] Changed the location of various files
Moved sequences files to shared in order to allow the system to compile
without the app sequence.

Change-Id: Ia8349814a72776244acc41af964059f24e58cff0
2020-11-04 15:32:58 +01:00
Arthur Camouseigt
ed358590ce [Sequence] Changed the way sequences are parsed
Change-Id: If19b46a317e4f336ac857690827ab08e147ac75a
2020-11-04 15:32:58 +01:00
Arthur Camouseigt
8434da60ef [sequence] Changed sequences behavior
Sequences can now be defined using specific terms form other sequences :
Un = n
Vn = u(3)

Initial values can also depend on other sequences.
Should there be a circular dependency, the sequences concerned will
display "undef" as value

Change-Id: I6fe1f3ff7b500f35d480ddefb42de729c327432e
2020-11-04 15:32:58 +01:00
Hugo Saint-Vignes
688394abce [ion] Set stack pointer when testing as well
Change-Id: Ibeae7961535208c224f9ac51f4cf33e3978665b3
2020-11-04 15:32:58 +01:00
Hugo Saint-Vignes
e199143412 [apps/shared/curve_view] Small binary code size optimization
Change-Id: I4b61506edb434cb901a6fb92ef5c145f43c51035
2020-11-04 15:32:57 +01:00
Hugo Saint-Vignes
8fdec305c4 [apps/graph/test] Fix caching test
Change-Id: I536d1422ca6c9ecded66f7876ae019aaf5742005
2020-11-04 15:30:54 +01:00
Hugo Saint-Vignes
70a628f2c8 [apps] Fix Python assert crash on malloc free
Change-Id: I48f86422f7d6af5227e2556e6ef531dfad696da4
2020-11-04 15:30:53 +01:00
Gabriel Ozouf
d917b2e1c9 [poincare/unit_convert] Fix improper reduction
In UnitConvert::shallowBeautify, an orphan expression would be reduced
without reaffecting the reduction's result. The reduction not being
taken into account would cause problem when handling undef values.
ex : Try to calculate i->_min

Change-Id: I4e53afa40ba838fed8c2fba9944c9c9ed1dc95b4
2020-11-04 15:30:53 +01:00
Arthur Camouseigt
1995781a9f [Poincare/IEEE754] Changed methods to use std function
Implemented std::nextafter to replace hand made one.
Methods next and previous are no longer making the difference between -0
and +0

Change-Id: I42e1a073623b70656d9df954694803840cf3088c
2020-11-04 15:30:53 +01:00
Martijn Oost
338968a493 improved translations in toolbox and the calculation, python and functions app 2020-11-04 15:30:53 +01:00
Arthur Camouseigt
ae43ec0cc9 [Poincare/layouts] Fixed a crash due to infinite loop
Change-Id: Ieb6563dd978c5c363326163b983b40ed13dab913
2020-11-04 15:30:53 +01:00
Gabriel Ozouf
a6db9688cd [apps/function] Factorize zoom in Function class
The new zoom implemented for ContinuousFunction is now factorized inside
Function to benefit the Sequence class. The same things is done to code
added to Graph::GraphController, which is moved into
FunctionGraphController.
This removes the reimplementation of several methods, most notably
computeYRange, as the implementation for function is general enough to
work on sequences.

Change-Id: I9b8211354064f46c3fa3dde3191dcb39d627a1d2
2020-11-04 15:30:53 +01:00
Gabriel Ozouf
33f9bb50a3 [apps/continuous_function] Forced X axis display
The auto zoom did not display the X axis when drawing positive curves
with roots, such as sqrt(x).

Change-Id: Ic80fd3207691dc917f7b64c07d7745ab5df1daa3
2020-11-04 15:30:53 +01:00
Gabriel Ozouf
a1aefb0cb2 [apps/graph] Added tests on graph ranges
Change-Id: I6c080f40c934cd31083be3d19aa0a4d0bb33c5cc
2020-11-04 15:30:53 +01:00
Gabriel Ozouf
17f39e5e39 [apps/graph] Take cursor into account for Y range
Additional checks have been added to ensure that the first move of the
cursor from the center of the graph would not cause the window to pan up
or down.

Change-Id: I44d7e86223941076cbf03db7a221e9c0427a64e4
2020-11-04 15:30:53 +01:00
Gabriel Ozouf
0ed0cc56e9 [poincare] Remove characteristicXHalfRange
Method characteristicXHalfRange was used to compute the range on which
to display cartesian function in Graph. With the new zoom algorithm,
this method is deprecated.

Change-Id: Ic681fab8d58d0f5628a94302a7b49dacaaa1a6a3
2020-11-04 15:30:53 +01:00
Gabriel Ozouf
8104caea50 [apps/shared] New automatic zoom on curves
Initial zoom for displaying curves is computed according to the
following rules :
  - For polar and parametric curves, the algorithm has not changed.
    Vertical and horizontal ranges are chosen in order to display the
    full curve with orthonormal graduations.
  - For cartesian curves, the horizontal range is chosen in order to
    display all points of interest (roots, extrema, asymptotes...).
    The vertical range is fitted to be able to display those points, but
    also cuts out points outside of the function's order of magnitude.

Change-Id: Idf8233fc2e6586b85d34c4da152c83e75513d85c
2020-11-04 15:30:53 +01:00
Gabriel Ozouf
1917999f6d [poincare/unit] Fix crash with Units in Graph
In Graph, the weak ReductionTarget would cause _X^0 to not be simplified
to 1, and would break an assertion in
Unit::chooseBestRepresentativeAndPrefix.

Change-Id: I8167a472802baf0a73bf48513f492e78517107ef
2020-11-04 15:30:53 +01:00
Gabriel Ozouf
9be5e7671c [apps/settings] Fix broken assert
Pressing OK or EXE with the brightness setting selected would cause a
crash because of a mishandling of the events for this cell.

Change-Id: I4978b4f749b5f19bc1e49ec05b60a32044d86638
2020-11-04 15:30:53 +01:00
Gabriel Ozouf
d6c7b2b1ac [poincare/multiplication] Factoring undef power
When factoring 1^inf * 1^-inf with Multiplication::factorizeBase, an
Undef factor would appear an be carried into the reduced multiplication.
We escape early in this situation by returning Undef.

Change-Id: Id826ad3cc131349e5bb460f7a8c82fe606294b97
2020-11-04 15:30:53 +01:00
Hugo Saint-Vignes
59d5adace3 [apps/shared] Optimize polar curve range display
Change-Id: Ic1b044212711d1f73e147cb0857084ff9d61fbd9
2020-11-04 15:30:53 +01:00
Hugo Saint-Vignes
0e11760f08 [apps/shared/curve_view] Improving performances for non cartesian curves
Change-Id: Ie1a9a6450e8f92ceaf93c5fe78711640be175e9e
2020-11-04 15:16:55 +01:00
Hugo Saint-Vignes
d937bc692b [apps/code] Fix crashes on full buffer
Change-Id: If9297f1ca29015cad0cc1cdda3ad610fd1493392
2020-11-04 15:11:45 +01:00
Hugo Saint-Vignes
aba135bc8b [escher] Add textArea line number limit
Change-Id: Ia0d9a9136282efc87c0996c141c0852ed75892f9
2020-11-04 15:11:45 +01:00
Hugo Saint-Vignes
52f83eb682 [apps/shared] Halve k_parametricStepFactor to maximise cache hits
Change-Id: Ibe3c441e4af88277d1e4594801b805336a1f3e0b
2020-11-04 15:11:45 +01:00
Gabriel Ozouf
db4a1b0265 [poincare/tests] Add tests on power layout
Change-Id: Ic7b0fbf87eec528221a4f836d34e1736e219ab96
2020-11-04 15:11:45 +01:00
Gabriel Ozouf
7c27440916 [poincare/layout] Tracking issue in addSibling
The addSibling method sometimes did not take into account the offset
introduced by adding parentheses, leading to some issues :
  - Type 2 SQUARE RIGHTPARENTHESIS LEFT SQUARE. Parentheses are added
    but the new square should be outside, between the two right
    parentheses.

Change-Id: Ifbc49cee2cd03c4511fc5a678d6d5d42243f4a22
2020-11-04 15:11:45 +01:00
Gabriel Ozouf
be8e452285 [poincare/layout_cursor] Fix cursor after Square
When typing Square in 2D Edition mode, the cursor would not be
repositionned correctly, leading to some issues :
  - Typing 2 POW 3, pressing RIGHT to return to the baseline, then
    typing POW again adds parentheses around 2^3, as is mathematically
    correct. Typing 2 SQUARE, then POW, would show 2^2^_, while
    the user really typed (2^2)^_.

Change-Id: I29c01d964924907a1866490189ea56e40771521d
2020-11-04 15:11:45 +01:00
Gabriel Ozouf
504223612d [apps/apps_container] Add timer to circuit breaker
poincareCircuitBreaker requires the Back key to be pressed for at least
50 ms before interrupting a computation.
This is effectively invisible for the user, but fixes a bug in
Calculation :
  - When leaving the additional results for a result using units by
    pressing the Back key, a reduction preceding a call to removeUnits
    would be interrupted, causing an undefined behaviour.

Change-Id: Iec667ae964f190de2171850cc22e1726959e6cb5
2020-11-04 15:11:45 +01:00
Gabriel Ozouf
df6383d2d8 [apps/i18n] Added default country for languages
After choosing a language at onboarding, the country menu now has a
specific country selected by default (Spain for Spanish, Italy for
Italian...)
Default countries are specified in apps/language_preferences.csv

Change-Id: Ia6392aceb9bebf7e62a692c5a79eb8c4d7b71a9d
2020-11-04 15:11:45 +01:00
Gabriel Ozouf
ec6ee82b81 [poincare/multiplication] Imperial volume display
With the imperial system selected, volumes are expressed as volume in
Calculation's results, instead of cubic lengths.

Change-Id: Ib6c0a1a595dce8ae8db6371b41af818b3fdc6236
2020-11-04 15:11:45 +01:00
Gabriel Ozouf
860ce558c2 [poincare/unit] Remove some additional results
Imperial additional results now only appear when the selected unit
system is Imperial.

Change-Id: Icc314d0148810bea67e4d729179393f1fceaf214
2020-11-04 15:11:45 +01:00
Gabriel Ozouf
801c61549c [poincare/unit] Change units for volume split
In additional outputs, a volume is now splitted as :
  _gal+_qt+_pt+_cup
instead of :
  _gal+_cup+_floz

Change-Id: I5020afbab23be6331d8a8742fd6295db178f0b37
2020-11-04 15:11:45 +01:00
Gabriel Ozouf
5e06f62ff6 [poincare/unit] Symbols for cup and tablespoon
_cp   -> _cup
_Tbsp -> _tbsp

Change-Id: Ied3e1624edc980f76c2f775cbb9e6028db8a83c5
2020-11-04 15:11:45 +01:00
Gabriel Ozouf
52dcd8e749 [poincare/unit] Restructure Unit
1. Information about a unit's dimension now uses inheritance.
   _m is an instance of DistanceAlias, which is derived from Alias.
   A UnitNode now keeps a pointer to an Alias and one to a Prefix.
   All aliases are still defined as constexpr.
   This cleans up a lot of the code used namely for computing the
   additional outputs in Calculation.

2. Instead of being defined with a string, each unit is described by its
   ratio with the base SI unit (ex: _L is 0.001 instead of "0.001_m^3").
   This greatly speeds up the calculations using units, as the algorithm
   to find the best unit used to parse the definition.

Change-Id: I4d6ed6ad4cb967026a3f01a335aec270066e2b9f
2020-11-04 15:11:45 +01:00
Gabriel Ozouf
e48e826536 [poincare/test] Updated tests on units
Change-Id: I7c146174bcedcccc3ed31a298c9720aa2a5ba3a9
2020-11-04 15:11:45 +01:00
Gabriel Ozouf
1f3c4b66a0 [poincare/unit] Changed imperial units definitions
Imperial units are now defined directly from the base unit, instead of
building on one another.

Change-Id: Ieb020643983ef49092d2d3033a7cc2135c646015
2020-11-04 15:11:45 +01:00
Gabriel Ozouf
87dd1b6310 [apps/i18n] Translate imperial units
Change-Id: I8f586b752c0c2114dfb656e34c9b9d928c5b6c59
2020-11-04 15:11:44 +01:00
Gabriel Ozouf
f288573db0 [apps/unit] Add short and long tons
Change-Id: Ib48c6a7c773e9e1d18c9f55e6dda5330fe0a28f9
2020-11-04 15:11:44 +01:00
Gabriel Ozouf
284c501532 [apps/unit] Add restriction to some input prefixes
The symbol for pint (_pt) conflicts with the symbol for pico-tonne. To
solve that, prefixes for tonnes are now restricted to the positive
prefixes : k, M, G, T.

Change-Id: Ie968374bbb5e0ebd2c0f08e4b1bdc1708eb6a041
2020-11-04 15:11:44 +01:00
Gabriel Ozouf
b2f81db4a9 [apps/home] Apps placement defined by country
Instead of relying on the order in which the apps are passed at compile
time, the look of the Home app is defined in a config file, and depends
on the country chosen.

Change-Id: If7f56a284e0001d6d75ece1e7efdf5fd1d0a9978
2020-11-04 15:11:44 +01:00
Gabriel Ozouf
fad375c11c [poincare] Add unitFormat to ReductionContext
Change-Id: I1d3fcd2f47c973c041e1be84e9a902dd58de3562
2020-11-04 15:11:44 +01:00
Gabriel Ozouf
6c676782aa [apps/calculation] New additional results on units
The additional results on units now include conversions into both unit
systems (metric and imperial).

Change-Id: Ie0f12eb3735e775560b66c2cbd78bc9a659145bb
2020-11-04 15:11:44 +01:00
Gabriel Ozouf
3ff25fb5c1 [poincare/unit] Standard unit methods
Added methods to return the standard format for each dimension,
depending on the chosen unit system.

Change-Id: I3591a806beca315674cc09093b57e8753db5db6a
2020-11-04 15:11:44 +01:00
Gabriel Ozouf
9f40e45b20 [poincare/unit] Split for several dimensions
A split (such as _h+_min+_s) can now be generated for distances, volumes
and masses using imperial units.

Change-Id: Ib3ad63614979eddd02fbe0e99f16cf09dcf7c1fc
2020-11-04 15:11:44 +01:00
Gabriel Ozouf
4d9f3aae97 [poincare/unit] Generalized BuildTimeSplit method
BuildTimesplit (used to create expressions of the form h+min+s) is now
based on the more general BuildSplit.

Change-Id: I3e55359cc6b9735269140942b29bd1d364fc35e7
2020-11-04 15:11:44 +01:00
Gabriel Ozouf
5a31a6c1e2 [poincare/unit] Output units based on region
When the country is USA, the units will be simplified to common imperial
units rather than metric.

Change-Id: Ia533527a429ac26526380e324b9543b359f3b400
2020-11-04 15:11:44 +01:00
Gabriel Ozouf
62f598110e [apps/shared] Created LocalizationController
Classes LanguageController and CountryController have been fused into
one class LocalizationController, as they were very similar. This allows
the Settings and OnBoarding apps to only keep one controller for both
functions.

Change-Id: Ic23f300c37122249d34caaf18a633b5815240a78
2020-11-04 15:11:44 +01:00
Gabriel Ozouf
5749d871b0 [apps/i18n] Moved country preferences
Instead of being hardcoded in the python script, preferences specific to
each country are defined in the country_preferences.h and .csv files.

Change-Id: I71e276341e1586935b4d5814be5b1be80fa170a0
2020-11-04 15:11:44 +01:00
Gabriel Ozouf
8121400cf2 [apps/i18n.py] Method for printing lists
New methods print_block_from_list factors code used to generate enum
classes and arrays.

Change-Id: I4ce7d22c3ffca4f12b9439f88ce288fcf9b85090
2020-11-04 15:11:44 +01:00
Gabriel Ozouf
2b59509fdd [apps/i18n] Derive preferences from country
Each country comes with an set of preferences, built at compile time by
apps/i18n.py, used to define :
  - the exam mode
  - the method for computing quartiles
  - the unit system in which to output the results with units
Functions to access those preferences are available in
via sharedGlobalPreferences.

Change-Id: I220ebaa9b9e8954dfe33cd51936f47505b98978d
2020-11-04 15:11:44 +01:00
Gabriel Ozouf
e2a6edd78f [poincare/preferences] Added UnitFormat preference
The UnitFormat can either be Imperial (for the US) or Metric (for the
rest of the world.

Change-Id: Ic698e6732f1fa225d88a14e61751b775fe70f1ab
2020-11-04 15:11:44 +01:00
Gabriel Ozouf
4d6682e211 [poincare/unit] Added imperial units
The new units are :
  distance    mile, yard, foot, inch
  mass        pound, ounce
  volume      gallon, quart, pint, cup, fluid ounce
              table spoon, tea spoon

Change-Id: I6864067a1822a077764ed3b61fc46004732e9447
2020-11-04 15:11:44 +01:00
Gabriel Ozouf
ea127cdfa9 [apps/statistics] Added tests for all countries
As some definitions now depend on the selected country, tests for the
statistics app now check that the right method is used for each country,
and that each method yields the correct results.

Change-Id: Ia5ad091136746f3284f7524376301fac0c582364
2020-11-04 15:11:44 +01:00
Gabriel Ozouf
86f7a87d45 [apps/statistics] International quartiles
Implemented a new method for computing quartiles, used for all countries
except France and Italy. Quartiles are now computed as the medians of
the lower half and upper half of the dataset.

Change-Id: Idfb89a617799eca1d23326ebbcfbbea58e6236b8
2020-11-04 15:11:44 +01:00
Gabriel Ozouf
8d362ef4de [apps/settings] Added message to country menu
Change-Id: Iec064d0ac86f54a10cf63236b6f958d53cecb2e2
2020-11-04 15:11:44 +01:00
Gabriel Ozouf
b35cdca9bb [apps/exam_mode] Country-locked Dutch exam mode
The Dutch exam mode is now only accessible when the selected country is
Netherlands on an official firmware.

Change-Id: I6d70f79b6e728482d8c7d86ef6a2e5c53ee18a39
2020-11-04 15:11:44 +01:00
Gabriel Ozouf
509a7e4628 [apps/on_boarding] Added country to onboarding
Change-Id: I55c50330baf226826e44467756bcd9e5c89d4262
2020-11-04 15:11:44 +01:00
Gabriel Ozouf
a96b5d1bc4 [escher] Typo in StackViewController
Change-Id: I13bdd05759fd2f0bc6911adafe8950e46c2bfe85
2020-11-04 15:11:44 +01:00
Gabriel Ozouf
fe25118d04 [apps/shared] Sorted countries in menu
Country names now appear in alphabetical order in the menu, depending on
the chosen language.

Change-Id: I57b8ce0a7120a3c8a433ce1b05628842c4d0aeb5
2020-11-04 15:11:44 +01:00
Gabriel Ozouf
51747d3d36 [apps/settings] Added country to settings
Refactored Settings::MainController::handleEvent

Change-Id: Id8ad604183a64520dd785356514e87fddc50354c
2020-11-04 15:11:44 +01:00
Gabriel Ozouf
1642276678 [apps/shared] CountryController
Created a CountryController class to chose the country in the settings
and at onboarding.

Change-Id: I6787e8b45744a8a98e83f59e5d2c4760364635cb
2020-11-04 15:11:44 +01:00
Gabriel Ozouf
3f9b8f03af [apps/global_preferences] Added country preference
Change-Id: Ifbe09e2a24b4e1b9386f323bd5ebd9bed7fc8440
2020-11-04 15:11:44 +01:00
Gabriel Ozouf
d156c8c99e [apps/i18n] Added country support
Added a list of supported countries to I18n, and created messages for
each country's names in each language.

Change-Id: I1b887d75da980d99e21f89cc151249e42c78de88
2020-11-04 15:11:44 +01:00
Gabriel Ozouf
87591369b8 [apps/regression] Model stays selected in menu
When opening the window for choosing the regression model, the row
corresponding to the currently selected model will be highlighted.

Change-Id: I65772186fc302c3706a5571f98ecff620e4a8ca9
2020-11-04 15:11:44 +01:00
Gabriel Ozouf
0a7833ec3d [poincare/test] Added 0*inf*π = undef test
Change-Id: Ie18e75c3cfd2a39f8436405f1061ba8fc5317b7f
2020-11-04 15:11:44 +01:00
Gabriel Ozouf
206013f2db [poincare/multiplication] Return Undef early
Multiplication::privateShallowReduce can create an Undef node by
multiplying 0 and inf. In this case, we set the whole multiplication to
undef, to avoid things such as undef*π.
This fixes the following bug :
  - In Graph, enter i*inf*π as one of the bounds. An assertion fails in
    Multiplication::removeUnit.

Change-Id: Ie9d0d561d6e310f52220b98541f22a4b5e56762c
2020-11-04 15:11:44 +01:00
Hugo Saint-Vignes
aa14a6a82e [apps/apps_conainer] Add Home and PowerOn/Off to interrupt computations
Change-Id: I3951cda606760843fb0703864b9da078bf7fd887
2020-11-04 15:11:44 +01:00
Arthur Camouseigt
58b69c2779 [AbsoluteValue] Adding formal derivate to absolute value
This will prevent diff(|x|, x, 0) to be evaluated to 0 instead of undef
This fixes issue #1393
Change-Id: I73f40aa29f04c373cd3e9edbbd4fbe7be6d7a988
2020-11-04 15:11:44 +01:00
Hugo Saint-Vignes
f562886a7e [poincare] Fixed crash due to infinite loop with horizontal layout
Change-Id: I00106525b29ce441e10a6d88766efdecd80d8291
2020-11-04 15:11:44 +01:00
Hugo Saint-Vignes
74a2211a6a [poincare] Use default methods for GCD and LCM instead of n_ary ones
Change-Id: Id353e4367bcb6700bae2f9c121af93b9379a8051
2020-11-04 15:11:44 +01:00
Émilie Feral
ec0e766c94 [apps/graph] text_field_function_title_cell: fix read of uninitialized buffer
This fixes the following crash: when reloading the cell before
initializing the m_textFieldBuffer, TextField::ContentView::text() will
use the content of the uninitialized m_textFieldBuffer to compute the
minimalSizeForOptimalDisplay.
2020-11-04 15:11:44 +01:00
Hugo Saint-Vignes
5b82b94c20 [poincare] Prevent forbidden ChildAtIndex call in fraction_layout
Change-Id: I00d282a6dd3618f669aaeb0202d6495ae8035f12
2020-11-04 15:11:44 +01:00
Arthur Camouseigt
edcc1f6e80 [Poincare/integral_layout.cpp] Fixed crash due to infinite loop
Changed previousNestedIntegral method to prevent integrals located in
integral bounds to be considered as nested.

Change-Id: Id8cc4369f53c278ac59039fde1c2818af2ccacab
2020-11-04 15:11:44 +01:00
Hugo Saint-Vignes
685b2a8d6d [poincare] Reduce Abs layout verticalMargin
Change-Id: I3edacc192b0274d73fd787bb81b0c895e29ddda3
2020-11-04 15:11:43 +01:00
Hugo Saint-Vignes
2512425868 [poincare] Factorize bracket pair rendering
Change-Id: I80f2d04c8833352f4097bcfdcf90b5ec147dc19f
2020-11-04 15:11:43 +01:00
Hugo Saint-Vignes
3aa5e8bcd6 [poincare] Add Vector Norm Layout
Change-Id: Iae5bbeabaa0ca627ae6651f187d1a42b970df37d
2020-11-04 15:11:43 +01:00
Hugo Saint-Vignes
8d2af7e77f [poincare/test] Add VectorOperation tests, tidy rref tests
Change-Id: I4072bee6b2d3bf1ad17045149bff8dcdb6a2f238
2020-11-04 15:11:43 +01:00
Hugo Saint-Vignes
6db02ea122 [poincare/vectors] Implement Vectors operations
Change-Id: Ib5aa2f5951f4eabe3b04078eab8b7d3a4d3769e7
2020-11-04 15:11:43 +01:00
Hugo Saint-Vignes
ca91b7c43d [apps/toolbox] Add Vector operation toolbox menus
Change-Id: Iab8faa45a3f30be979f7d705ac169e8f2b801da9
2020-11-04 15:11:43 +01:00
Hugo Saint-Vignes
8688fd5b95 [apps/shared] Add template for privateEvaluateXYAtParameter
Change-Id: I97b4165307f57e52924e321cb85154cb32ba1008
2020-11-04 15:11:43 +01:00
Hugo Saint-Vignes
56a9e8d74b [poincare] Fix LCM GCD bug on device compilation
Change-Id: I5ac11b7e72ede335db503b1d0f9c0be00710cd0b
2020-11-04 15:11:43 +01:00
Hugo Saint-Vignes
53e204db3a [liba] Add abs function for int
Change-Id: Ic133ff2f34c7ff24ecbec69d5f31e447a72ae4fe
2020-11-04 15:11:43 +01:00
Arthur Camouseigt
0a92499dd7 [Poincare/unit] Changing the value of AU
The value of astronomical unit was wrong. This fixes issue #1637

Change-Id: I175c8fae9044beb1e863ddbf3a260224a9c60bd6
2020-11-04 15:11:43 +01:00
Hugo Saint-Vignes
cbd26e69d1 [apps/graph/list] Apply changes on confirm with function interval selection
Change-Id: I0ec1ae54788f1c72fc8277544ed51a85ba4474d5
2020-11-04 15:11:43 +01:00
Hugo Saint-Vignes
cce1fa0c90 [poincare/test] Add tests for LCM and GCD
Change-Id: If91c1ef863c9810e1ab87525a5ed2b4c7ed45656
2020-11-04 15:11:43 +01:00
Hugo Saint-Vignes
cafb1c1c05 [poincare] LCM and GCD accept set of numbers
Change-Id: I367ff5e48fa2856e976aa020ac0d172216f3a421
2020-11-04 15:11:43 +01:00
Hugo Saint-Vignes
0322a1a6a7 [apps/shared] Fix draw curve issues when tStep << tStart
Change-Id: Iaf054cff1f78f3c800564a0e6c133192bdfab260
2020-11-04 15:11:43 +01:00
Arthur Camouseigt
22a15f5ed6 [Shared/store_parameter_controler] Fixed a bug
In stats when selecting an action on a column, all actions listed after
the one selected were applied. Adding breaks to the switch solved the
issue

Change-Id: I4a2f8a41f734a209abb17e76388eed551bf1769c
2020-11-04 15:07:20 +01:00
Hugo Saint-Vignes
9e12b61849 [apps/graph] Round x before evaluating graph cursor on scroll
Change-Id: I13500669963eb8130e188a898bed0bf63655add6
2020-11-04 15:07:20 +01:00
Hugo Saint-Vignes
bd2609bcba [apps/graph] Remove horizontal margins when panning on some graph calculations
Change-Id: I1a28555c5b4f04986b223617ab15110711a74841
2020-11-04 15:07:20 +01:00
Gabriel Ozouf
c04a7af22f [escher/layout_field] Change cursor behavior
Some code to prevent the input field from scrolling when switching to
the history in layout mode causes problems :
  - With a calculation in the history, type an empty matrix or fraction.
    Then with the cursor on an empty square, go to the history. The
    square will appear shifted to the right.

Change-Id: I72ebee675215dc3c3a3f8432890f6fee820ef5c9
2020-11-04 15:07:20 +01:00
Gabriel Ozouf
9e3470436a [apps/calculation] Move input memoization
Calculation's input is now only saved and restored when the app truly
closes or opens, instead of whenever the EditExpressionController enters
or leaves the responder chain (which also happens when the user switches
to the history or the toolbox, or triggers a syntax error).

Change-Id: I8404f1bc5619bcbc03272b406962d284fe25f7e2
2020-11-04 15:07:20 +01:00
Hugo Saint-Vignes
d027d99597 [apps/calculation] Reset highlighted cells in additional results
Change-Id: I517e7d3dd025413f405fed605631dad830540e76
2020-11-04 15:07:20 +01:00
Gabriel Ozouf
44da25dd64 [poincare/number] Fixed typo
Change-Id: Id691ade099f09c8479582751aaab6dbd7f077711
2020-11-04 15:07:20 +01:00
Gabriel Ozouf
891366c51d [poincare/expression_node] Added Double type
Float<float> and Float<double> used to share the same expression type
(Float), and the distinction was made by comparing their size. However,
due to padding, their size could be the same, leading to some issues :
  - On the simulator, in Calculation, type 1_mm^3 and go to the
    additional outputs. One of the results would be -0.0003081979_µm^3.

Change-Id: Ic8f9328bf462104776fbab636c34d0d152cd7e58
2020-11-04 15:07:20 +01:00
Arthur Camouseigt
1e82d5012b [Stats] Moved sort messages to shared+NL translation
This allows compilation without stats app

Change-Id: I0f564ee46756420f0cff5da91ed77677b22cdee0
2020-11-04 15:07:20 +01:00
Arthur Camouseigt
f9a1f1a1b7 [Poincare/test/approximation.cpp] Fixed broken test
Change-Id: I6d851abf9626d282133f143afa2a16ca2d8bec7e
2020-11-04 15:07:20 +01:00
Arthur Camouseigt
b7bfc253eb [poincare/trigonometry] Modified shallowReduceInverseFunction
This fixes issues #1541. Formulas as asin(sin(X)) with X a large number
were failling to simplify themselves into the image interval of asin
ex : previous version asin(sin(6)) = 6
     new version asin(sin(6)) = -2pi+6

Change-Id: Ia6200b67914224cecd2cd943bcf9bc2ff6e0447a
2020-11-04 15:07:20 +01:00
Arthur Camouseigt
5569ba92a2 [poincare/approximation_helper] Changed the way to approximate
To prevent incorrect approximations, such as cos(1.5707963267949) = 0, we lowered the precision value. This way,
  the approximation is more selective. However, when ploting functions such as e^(i.pi+x), the float approximation fails
  and therefore, the function appears "undef".
  As a result we created two functions Epsilon that behave differently according to the number's type. When it is a double,
  we want a maximal precision -> epsilon_double = 1x10^(-15), and when it is a float, we accept more agressive approximations
 -> epsilon_float = 10 x 1x10^(-7).

Change-Id: I844ac52ade665f51fe6888db38f4485c193286d9
2020-11-04 15:07:20 +01:00
Hugo Saint-Vignes
1f9d0b5810 [apps/code] Reorder rows due to color name change
Change-Id: I1c8f3e9d015cf55ec8fc38082f60e957b19b196d
2020-11-04 15:07:20 +01:00
Hugo Saint-Vignes
641186d89c [python] Accept "grey" color
Change-Id: Ia9b70eb3b4205ae9571eb4269410c30cfbdd1214
2020-11-04 15:07:20 +01:00
Hugo Saint-Vignes
e27c668c40 [apps,escher,kandinsky,poincare,python] Replace every "grey" with "gray"
Change-Id: I60a232849dce90f70e6977b6024d6e9b1ce1b731
2020-11-04 15:07:20 +01:00
Hugo Saint-Vignes
4331686818 [apps/toolbox] Update toolbox and additional result text for matrices
Change-Id: I59e1561dcb97c75e57f0c24cfe1953ff594daf92
2020-11-04 15:07:20 +01:00
Hugo Saint-Vignes
c4018d0648 [poincare] Update rowCanonize pivot selection for more consistent ref results
Change-Id: Id7e856f57ccd3d990077b0f6753089bc6edcc03b
2020-11-04 15:07:20 +01:00
Hugo Saint-Vignes
3bfc0c83d8 [poincare] Factorize Echelon Form classes
Change-Id: I7ec7290a4d94b9bd1224ad4c53be8b4662bd32d5
2020-11-04 15:07:20 +01:00
Hugo Saint-Vignes
f00c135b69 [apps/calculation] Add additional outputs for matrix
Change-Id: Ia4b285eb0f28eaed838d32a1fdfb785d13664f65
2020-11-04 15:07:20 +01:00
Hugo Saint-Vignes
007c38652f [poincare] Add ref and rref matrix functions
Change-Id: Id0e57a4f85d551ca5320c4b6e3c0baadae70946d
2020-11-04 15:07:20 +01:00
Arthur Camouseigt
997c103fba [Toolbox] Changed the required parameters for normal_distributions
Changed the parameter σ2 to σ. This is now consistant with the
probability app

Change-Id: I96101ba158cebef972e536cfa5cc1b2da71b543d
2020-11-04 15:07:19 +01:00
Arthur Camouseigt
6072ffd848 [poincare/normal_distribution.cpp] Fixed approximation error
Removed limitation in calculation of normal_distribution. It was used to
speed-up computation but yielded 0 for small values.
Previously P(X<5) with X->N(7,0.3162) gave 0 as a result
now it gives 1.26e-10

Change-Id: I3f1c997dfe2ba6424b372a0a82af6d9871443657
2020-11-04 15:07:19 +01:00
Gabriel Ozouf
de681705e6 [escher/expression_field] Renamed dumpLayout
Changed dumpLayout's name to moveCursorAndDumpContent, as the name
suggested the method was only usable on layouts (while it also works on
text). The method is also no longer marked const, and the previous name
could imply that it had no side effects.
Likewise, renamed restoreLayout to restoreContent.

Change-Id: I46b320e74c07b48e256dc2146f9ecc15af38a8e6
2020-11-04 15:07:19 +01:00
Gabriel Ozouf
67af3a5b4e [apps/calculation] Fixed grey and yellow squares
When closing and reopening Calculation, if the cursor was on an
EmptyLayout, this layout would be invisible, instead of being denoted by
its usual yellow square.
This also fixes a bug that would leave the grey squares in matrices when
leaving and reopening the app, causing a failed assertion on the simulator.

Change-Id: Ib723797c079f1441f5cde174aa5c492ad4226335
2020-11-04 15:07:19 +01:00
Gabriel Ozouf
e49dc08759 [escher/expression_field] Fixed dumpLayout
Closing the Calculation app because of a full pool would crash the
device, by attempting to dump a layout with no node.

Change-Id: Ic926da61ae93f47eb576848788e1de5e3f94f5bb
2020-11-04 15:07:19 +01:00
Hugo Saint-Vignes
433639c471 [ion] Implement dynamic scroll speed profile
Change-Id: Ib3ec2ef63d19bfb88b627f06bcc185fa1b232223
2020-11-04 15:07:19 +01:00
Gabriel Ozouf
2bfdc482a6 [apps/continuous_function] Cut clearCache method
Inlined call to ContinuousFunction::clearCache and removed the method,
as its name was confusing.

Change-Id: I54454fb0b06167e01249afaa5b23932451125f2e
2020-11-04 15:07:19 +01:00
Gabriel Ozouf
1de6ac702d [apps/continuous_function_cache] abs -> fabs
Replaced abs calls on float with fabs.

Change-Id: I26eda164416ca8b2d601431a59171fd7b00ed33f
2020-11-04 15:07:19 +01:00
Gabriel Ozouf
15988f0fae [liba/float] Redefined FLT_EPSILON
FLT_EPSILON is now compliant with the definition : the difference
between 1 and the next representable float.

Change-Id: I4f79c3eee93447e76893d850bd84265c9d45aca5
2020-11-04 15:07:19 +01:00
Gabriel Ozouf
aea9176f86 [apps/graph] Added tests for graph caching
Wrote some tests to check that the caching process does not lead to
aberrant values.

Change-Id: I28137e66f430dbcf4417733d1274319dbadfc9af
2020-11-04 15:07:19 +01:00
Gabriel Ozouf
b0533e6836 [apps/graph] Changed cache tolerance
This fixes a bug where, when drawing 1/x, a vertical bar would appear on
0, because of false positive cache hits.

Change-Id: I2eafeac5e254c8a556769a41c8edc532db44383a
2020-11-04 15:07:19 +01:00
Gabriel Ozouf
beb228fa78 [apps/graph] Fixed cache step quirks
Change-Id: I5b630301ab2a4b17a5a4d77c7d9a05120449e55e
2020-11-04 15:07:19 +01:00
Gabriel Ozouf
1bee23cf4f [apps/graph] Reworked function caching
Instead of being memoized all at once before display, functions values
are now stored at evaluation time. Fixed some quirks with caching
preparation.

Change-Id: I5d212c271c8c41a6dc9074a15c720f0bccf8ac40
2020-11-04 15:07:19 +01:00
Gabriel Ozouf
42fcf557b8 [apps/graph] Limited number of cached functions
The caches used for function values memoization are now stored in
ContinuousFunctionStore : there are now only a fixed number, instead of
one per function. This effectively enables caching only for the first
few functions on screen, while reducing the memory usage.

Change-Id: I2ade091717f73a14a756fe527c773db8e8627be7
2020-11-04 15:04:24 +01:00
Gabriel Ozouf
95fef86ec0 [apps/graph] Activated caching for graph drawing
Added a default argument to CurveView::drawCurve : a function to initiate the
memoization of continuous functions. The function is implemented in
ContinuousFunctionCache and provided by GraphView. This should be invisible
to other types of curves that rely on CurveView::drawCurve.

Change-Id: I59aa55d67154b6d4bf9614b7ed87c48408773d86
2020-11-04 15:00:43 +01:00
Gabriel Ozouf
c70b545ba1 [apps/shared] Cache lookup on function evaluation
When evaluating a ContinuousFunction for a float value, the function
will first try to ask its cache (if it has been filled beforehand).

Change-Id: I519d2d3dcf344ba63e30a0f011db2306c7141315
2020-11-04 14:45:35 +01:00
Gabriel Ozouf
a9c633a540 [apps/shared] Functions cache clears on change
Added several triggers to clear the cache when the function's type,
range or content is changed.

Change-Id: I4f49a90bb6571e335a4a601723d7715b8de1e25e
2020-11-04 14:45:35 +01:00
Gabriel Ozouf
552dca9494 [apps/shared] Implemented function memoization
ContinuousFunction now has an attribute of type ContinuousFunctionCache,
implementing methods to store and retrieve 320 float values, in order to
speed up function display in Graph.

Change-Id: I6f7ccdf3ae3c6dd8b08b93d786c8d0be7aa4dee8
2020-11-04 14:45:35 +01:00
Gabriel Ozouf
0308b18400 [liba/float.h] Comment on FLT_EPSILON's definition
Change-Id: Iac2da58d9a2f8e4b1bb131255341696db99df188
2020-11-04 14:45:35 +01:00
Gabriel Ozouf
4007f4d452 [apps] Tweaked panning for better cache alignement
Method InteractiveCurveViewRange::panToMakePointVisible now moves the
range of a whole number of pixels when panning horizontally. This allows
the cache of cartesian functions not to be invalidated.

Change-Id: Idb9904fef134dd13458e1f2287b0fe5145e8aec7
2020-11-04 14:45:35 +01:00
Hugo Saint-Vignes
5bc19af196 [apps/shared] Revert to pack record
It appeared that without the packed keyword, the compiler did not handle
access to unaligned record data members, which leads to crashes on the
device.

Change-Id: I401f075e7f62458a4733baa8d81983d4be34b730
2020-11-04 14:45:35 +01:00
Hugo Saint-Vignes
969fea7494 [poincare] Improve float variables usage
Change-Id: I965c425cbe70c0a201c504565d5d0991618ce0b9
2020-11-04 14:45:35 +01:00
Hugo Saint-Vignes
10de970814 [poincare] Remove unnecessary unit norm code
Change-Id: I7d7abf88d1dcc10fb4ae0f6b3570ebfe4b4af311
2020-11-04 14:45:35 +01:00
Hugo Saint-Vignes
9f2c4bccdf [apps/math_toolbox] Reorder toolbox units
Change-Id: I2a599c90ce221c173bd05bfa2d31e908c6bdbbdf
2020-11-04 14:45:35 +01:00
Hugo Saint-Vignes
a5a57c4076 [poincare] Improve prefixes for mass and inductance unities
Change-Id: Ic9eb7b5adff7b172452b4c73bd7ddc5c59761219
2020-11-04 14:45:35 +01:00
Hugo Saint-Vignes
11e41bb4dc [poincare] Add comments and alternative algorithm to beautify units
Change-Id: I4b1ce9528d9d6796fe08f8566ee5d1efafa1d87d
2020-11-04 14:45:35 +01:00
Hugo Saint-Vignes
51f1cdb076 [poincare] Handle rational unit exponents
Change-Id: Id710702dbed19d34992da90978d5823d68abb80a
2020-11-04 14:45:35 +01:00
Arthur Camouseigt
09e39ad890 [Stat+Reg] Allowing lists of values to be sorted
Change-Id: I181bb55443bf87356d127eb6c56ff6140806fdea
2020-11-04 14:45:35 +01:00
Arthur Camouseigt
018dd91ca1 [Probability] Changed distribution parameter's type to double
Plots are still rendered in float but computations are now in double

Change-Id: I7e0a38effb780861b1443ee92a097cd319de3bc8
2020-11-04 14:45:35 +01:00
Arthur Camouseigt
082f9819e9 [Poincare] Changed ConvertFloatToText to prevent conversion error
We now compute the value of the mantissa in double (instead of float)
to limit conversion error occuring for big numbers.

Change-Id: Ia61c052f0bc4a9196c53e2c7900eb48e3343d39c
2020-11-04 14:45:35 +01:00
Hugo Saint-Vignes
776edd4dd8 [apps/shared] Extend function table view to 101 cells
Increasing the lenght of graph table view to give users more
possibilities

Change-Id: I4023a5f81974b8302bf81b56d2610908e207241f
2020-11-04 14:45:35 +01:00
Arthur
6380bf7885 [poincare/integral_layout] Changing the integral layout and behavior
Should there be multiple integrals in a row,
they now all have the same height.

Change-Id: I106c4e2cb2671f6518f1d916f414f6e9349f83dc
2020-11-04 14:45:35 +01:00
Arthur
02af868274 [poincare/sum_layout.cpp] Modified the look of the sigma symbol
Change-Id: Ib79414eed96aedacc51b89dce22a14a4e7891cdf
2020-11-04 14:45:35 +01:00
Arthur
bd74ab9718 [poincare/sequence_layout] Modified the height of sigma and product signs
Because of their previous even height, those symbols were not aligned with fractions. Now that they have an uneven size, they line up correctly.
2020-11-04 14:45:35 +01:00
Arthur
45db7f1d48 [poincare/integral_layout.cpp] Reduced the gap between integral sign and integrand
The gap between the integral sign and the integrand has been reduced. It looks more natural this way.
2020-11-04 14:45:35 +01:00
Arthur Camouseigt
9998f9b578 [apps/shared/ok_view.cpp] Changed the look of the OK symbol
New look for the ok symbol. The updated version is antialiazed.

Change-Id: I1ee0e4b6680a7582f6216854a5e5cfe308801669
2020-11-04 14:45:35 +01:00
Arthur Camouseigt
92f56445fe [poincare/sum_layout] Modified the way to draw sigma
New way of drawing sigma sign. Only a single branch is stored. The full
symbol is created by mirroring half a symbol.

Change-Id: I0fc32393203e51578c88b01125a907d402291534
2020-11-04 14:45:35 +01:00
Arthur Camouseigt
1e0449791d [poincare/integral_layout] Changing the integral symbol
Changed the look of the integral symbol and the positions of the upper
and lower bounds. Added a drawing of the window to explain the meaning
of various margins.

Change-Id: I3ffc07848dc9ad68dce3c0e01853d548e31dd152
2020-11-04 14:45:35 +01:00
Arthur Camouseigt
653b7d0ac4 [poincare] Bigger product and sum signs
Replacing the product and sum signs with bigger and antialiased ones.
2020-11-04 14:45:35 +01:00
Gabriel Ozouf
abb662b606 [poincare/test] Added tests on fraction layouts
Change-Id: I351d707c03b96c93e090e2e74c1841ebe9d7a691
2020-11-04 14:45:35 +01:00
Gabriel Ozouf
4ca4d4f45e [poincare/layout] Factored Parenthesis collapsing
Parenthesis collapsing is no longer handled by LeftParenthesisLayout and
RightParenthesisLayout, but by ParenthesisLayout itself.

Change-Id: I6797cd40ee02881544e01e9b88f31a597c51d179
2020-11-04 14:45:35 +01:00
Gabriel Ozouf
e2e062e128 [poincare/layout] Changed Fraction collapsing
Fraction are now only collapsed if they are the first thing to be
collapsed or if a parenthesis is open.

Change-Id: Ie7f3a99498b9981dff70221efd7de6bee6d0c379
2020-11-04 14:45:35 +01:00
Gabriel Ozouf
e295516928 [apps/calculation] Remember input layout
When leaving the Calculation app, the layout currently being edited is
now stored in a buffer, to be restored when the app resumes.

Change-Id: I59c16e18f7193bdcbb36888b54cb2722897f85f5
2020-11-04 14:45:35 +01:00
Gabriel Ozouf
8ab23f66b5 [escher/expression_field] Methods on layout
Added some methods to manipulate the layout of a LayoutField from an
ExpressionField, like storing into and restoring from a buffer.

Change-Id: I7b7b5b53626f19237a5215bd196e897a518e9577
2020-11-04 14:45:35 +01:00
Gabriel Ozouf
9527894b25 [poincare] Function LayoutFromAddress
Created function Layout::LayoutFromAddress, which creates in the pool a layout
that has been stored in a buffer. Functionally identical to
Expression::ExpressionFromAddress.

Change-Id: I204e6b7d42f259ef2732563aa2a168a644060867
2020-11-04 14:45:35 +01:00
Gabriel Ozouf
0927ffca29 [apps/calculation] Moved input buffer to snapshot
The cacheBuffer from EditExpressionController has been moved in the
snapshot, to act as a zone where layout information can be kept while
the app is inactive.

Change-Id: If9206abf77f37d6b984826e5f09658848381a75f
2020-11-04 14:45:35 +01:00
Hugo Saint-Vignes
3db1cad18b [poincare] Move IsApproximatelyEqual to a better helper
Change-Id: I056a96b3721005e01c6ef3f166a80a08195ff338
2020-11-04 14:45:34 +01:00
Gabriel Ozouf
9f4aafd6b6 [apps/graph] FunctionTitleCell reload
Changed TextFieldFunctionTitleCell::reloadCell to solve an issue with
the alignment of a function's name and definition when changing the
expression :
  - typing u_n = (1/3)/2 then changing to u_n = 1/(2/3) without erasing
    the formula first. u_n would no longer be aligned with the = sign.

Change-Id: Ib58e4220dc67c77639272c7ea784418bddffb432
2020-11-04 14:45:34 +01:00
Gabriel Ozouf
43fc937469 [apps/sequence] SequenceTitleCell reload
SequenceTitleCell::reloadCell now triggers a layoutSubviews, causing the
vertical alignment to be recomputed. This solves issues regarding the
alignment of a sequence's name and definition, such as :
  - typing u_n = v_n ; v_n would be displayed above u_n
  - typing u_n = (1/3)/2 then changing to u_n = 1/(2/3) without erasing
    the formula first. u_n would no longer be aligned with the = sign.

Change-Id: I4a771d96ea79e42e2f4822e93f9f1cbbcf867610
2020-11-04 14:45:34 +01:00
Gabriel Ozouf
e03bb7432e [escher] Tweaked LayoutField event handling
LayoutField does no redraw its content on every occasion anymore. This
allows the input window in Calculation to not scroll to the beginning
when writing an overly long formula.

Change-Id: I14276828884035463b0a6438bfca4dd76c7f5057
2020-11-04 14:45:34 +01:00
Gabriel Ozouf
41cf0aaac6 [apps] Stopped battery warning when plugged
Change-Id: Id4f0d5d730c6045bf69cfadd724dc8ad819494d5
2020-11-04 14:45:34 +01:00
Hugo Saint-Vignes
735fc6e1bb [poincare] Generalize Binomial Coefficient n to any real
Change-Id: I3cda882e67db4becfe232c6428e14905e922662b
2020-11-04 14:45:34 +01:00
Hugo Saint-Vignes
ada369bf08 [apps/shared] Add comment for selectNonHiddenCellAtClippedLocation
Change-Id: I0e0f7963274688facb467caa934f410e66c9f859
2020-11-04 14:45:34 +01:00
Hugo Saint-Vignes
af32f33141 [ion] Remove unused function and rename longRepetitionScrollSpeed
Change-Id: I11268eb34060c74eb8770ba0eb999f84737c76d8
2020-11-04 14:45:34 +01:00
Hugo Saint-Vignes
70cd166da5 [escher] Scroll speed increase for long repetition in layout fields
Change-Id: I9460cb44631f0b225598804334da5a0e74029915
2020-11-04 14:45:34 +01:00
Hugo Saint-Vignes
70830e0b74 [escher] Scroll speed increase for long repetition in selectable table
Change-Id: Idfc3edcedff5a933b6f2168b475e22ea56ea0ab0
2020-11-04 14:45:34 +01:00
Hugo Saint-Vignes
e35f2cc938 [escher] Scroll speed increase for long repetition in text area
Change-Id: Ia468bd3ae3f247937127228a11e3d51653dd2ae2
2020-11-04 14:45:34 +01:00
Hugo Saint-Vignes
c9964e69c2 [escher] Scroll speed increase for long repetition in scrollable views.
Change-Id: Ie7671ced53da1a144068756f6b584dbb287f9e0e
2020-11-04 14:45:34 +01:00
Hugo Saint-Vignes
b60c67ff88 [apps] Factorize scrolling speed for long repetition
Change-Id: I5fcfaf04e418942664641c4b1cd044cda7f5aebb
2020-11-04 14:45:34 +01:00
Hugo Saint-Vignes
241a217f58 [apps/graph] Add fast scroll for regression and sequence graph views
Change-Id: I6b36e929234ec5dc161b0eefb20eb84aa360fe3b
2020-11-04 14:45:34 +01:00
Hugo Saint-Vignes
1879eb36d8 [ion/test] Typo Fix
Change-Id: I49d041dea6333a7f7f1a179e2ffcff2391dbaa28
2020-11-04 14:45:34 +01:00
Hugo Saint-Vignes
0a2ededfcf [apps/shared] Remove packed data members for RecordDataBuffer
Change-Id: I04ea5ccb4c15bda975bf5af178f07092c0387312
2020-11-04 14:45:34 +01:00
Gabriel Ozouf
78a1350f15 [poincare/test/derivative.cpp] Added context-aware tests.
New tests compute derivatives while replacing symbols with their definitions or undefined, as the device does.

Change-Id: I99179bf6540182ff929938fb96a00a1ed2fbcf49
2020-11-04 14:45:34 +01:00
Gabriel Ozouf
a9c94236c2 [poincare] Implemented further derivation methods and updated tests.
Derivation now works on tangents and the three hyperbolic functions.

Change-Id: I62049e79c661c3c4a031be0a93c403fb936d611b
2020-11-04 14:45:34 +01:00
Gabriel Ozouf
eab8167a56 [poicare/logarithm] Implemented didDerivate and unaryFunctionDifferential for Logarithm
Derivation now computes as expected on logarithms, as long as their base is not a function of the derivation variable.

Change-Id: Ia56da1c1151c0ddf3887be84ddb4bd02664c5188
2020-11-04 14:45:34 +01:00
Gabriel Ozouf
407d4bce6e [poincare/cosine] Implemented didDerivate and unaryFunctionDifferential for Cosine
Derivation now propagates as expected on cosines.

Change-Id: I6f5af48ac7462c5b8e77ff1a6428a65bf6c0c7de
2020-11-04 14:45:34 +01:00
Gabriel Ozouf
5cf85368ea [poincare] Added framework to derivate unary functions, and implemented it for Sine
Added a method unaryFunctionDifferential to ExpressionNode and Expression, to be implemented by subclasses representing unary functions.
Added a function derivateUnaryFunction to Derivative, to factor (f°g)' -> g' * f'°g.

Change-Id: Id1780f1082ccd001f1282fe4ddfff2b7055d3a27
2020-11-04 14:45:34 +01:00
Gabriel Ozouf
648cdbaa29 [poincare] Implemented didDerivate method for Power
Derivation now propagates to powers as expected, whether the base, the exponent, or both are functions of the variable. This also makes division derive as intended.

Change-Id: I51cbd5f7ec9f6aaa1df068625bbda1437941fa08
2020-11-04 14:45:34 +01:00
Gabriel Ozouf
6f378ef3ef [poincare] Implemented didDerivate for Multiplication
Derivation propagates as expected on multiplications (but not power). Some tests involving diff had to be updated to reflect that behaviour.

Change-Id: Ifa32031bc37a156c18d296757bcdd6ccdb0ea43e
2020-11-04 14:45:34 +01:00
Gabriel Ozouf
c65687e9f6 [poincare] Implemented didDerivate methods for Number, Symbol and Addition
Number's subclasses, with the exception of Undefined and Unreal, derive as zero. Symbols derive as expected. Derivation propagates as expected on additions.

Change-Id: Icedbb1dfac8099347a19c14bf2537011b2e8b199
2020-11-04 14:45:34 +01:00
Gabriel Ozouf
051e608835 [poincare] Added method didDerivate to Expression and ExpressionNode
This method is to be implemented by derivable expression subclasses, for use in Derivative::shallowReduce. It performs the calculation for the derivative, and returns whether calculations happened.

Change-Id: I13cdb131e2044578392f5178a9f389314c1c4c8a
2020-11-04 14:45:34 +01:00
Hugo Saint-Vignes
eed1648363 [apps/statistics] Improve variance accuracy for statistics
Change-Id: Ie8f6f93c8e95940662e72a23619b53ac4ab0d6b6
2020-11-04 14:45:34 +01:00
Hugo Saint-Vignes
29b0e86225 [quiz] Improve test possibilities for regression and statistics
Change-Id: I4414fad24e10dcbd56cd9aff1e35e00ba66dda2c
2020-11-04 14:45:34 +01:00
Hugo Saint-Vignes
d16e49fc5f [apps/regression] Improve Variance precision
Change-Id: Ia9e406b14c0baec76835e226a7801ba73ff9174e
2020-11-04 14:45:34 +01:00
Hugo Saint-Vignes
db69f6a6f5 [regression] Implement R2 computation using evaluated values
Change-Id: Iecf8cb84f092c2ec8a9bc17bc0265d7dddaac36c
2020-11-04 14:45:34 +01:00
Hugo Saint-Vignes
5c95cbd1d3 [regression] Add r2 to any regression stats
Change-Id: I3088dd66b1c3f48973b8a9277de687bdd24e094b
2020-11-04 14:45:34 +01:00
Hugo Saint-Vignes
d3727dde97 [regression] Add unit tests for regression metrics
Change-Id: I25d7fd89053a1bd5fb369c8c145dba92d188f550
2020-11-04 14:45:34 +01:00
Gabriel Ozouf
e8505d79e7 [ion/device/exam_mode] Fixed missing parentheses in assertion
Change-Id: If10b6ea98ed224d79cfa50f38f9e229331d0f9f9
2020-11-04 14:45:34 +01:00
Gabriel Ozouf
0454b65a94 [ion/device/usb] Fixed missing static member definitions
Change-Id: Iedf6ce51d3213f9265fec247c7bdfda4e3304d3a
2020-11-04 14:45:34 +01:00
Gabriel Ozouf
1d74a8f757 [poincare/power] Fixed missing template definitions
Change-Id: I9e7db458c97cc1fba29689690b67c3c678976405
2020-11-04 14:45:34 +01:00
Arthur
d77e924014 [Apps/Calculation] Modified the calculationStore of additional results
-Additional results are now stored in smaller calculationStores

Change-Id: I7d09bfb09e57cbb80e9385668adeb29a31398bc0
2020-11-04 14:45:34 +01:00
Arthur
d7a0914d13 [Apps/CalculationStore] Changed the way to store calculations
-No more limit to the number of calculations
-All calculations are memoized
-Added tests to test/calculation_store.cpp

Change-Id: Ia10e2b009576eaf4496ba44a0c88f6e7e76f6cef
2020-11-04 14:45:34 +01:00
Quentin Guidée
715ff95cf1 [epsilon] Fix upstream merge 2020-11-03 19:49:43 +01:00
Quentin Guidée
5d50c80604 Merge remote-tracking branch 'upstream/master' into omega-dev 2020-11-03 19:35:37 +01:00
Joachim LF
8e4187fb60 [Poincare] Added kmat() 2020-10-31 10:58:39 +01:00
Joachim LF
a680539b7c [Apps/main] Added comments 2020-10-28 19:49:09 +01:00
Joachim LF
69a708fd1b [Apps/main] Removed strcmp (see #1695) 2020-10-28 19:45:05 +01:00
Émilie Feral
e0dcdcea28 [build] Add a target flasher.verbose.flash 2020-10-27 08:50:05 +01:00
Émilie Feral
1f81c97371 [ion] USB::DFU takes an argument specifying if the DFU mode should be
leavable from keyboard
2020-10-27 08:50:05 +01:00
Émilie Feral
2d71e98b52 [ion] n0100 Console: fix pin alternate function 2020-10-27 08:45:41 +01:00
Gabriel Ozouf
c71b2dee99 [curve_view] Factor bounding box code for joinDots
Change-Id: Iae974aa2bee12e6c56bad84fd3b45093fb2a856f
2020-10-23 08:56:56 +02:00
Gabriel Ozouf
26fdfcd25c [curve_view] Fixed variable names
Change-Id: I8aad13c6bce719ba8f3a30cd86f06f7c89ec041e
2020-10-23 08:56:56 +02:00
Gabriel Ozouf
fe8e490ac0 [curve_view] Filter unwanted vertical asymptotes
Change-Id: Ia603a2fb1553b6dfc038d2a28472ce48e41936db
2020-10-23 08:56:56 +02:00
Gabriel Ozouf
106916e7bf [curve_view] Add double evaluation
Add the possibility to use a double-typed evaluator when tracing a
curve, useful when errors caused by float approximation mess with the
drawing.

Change-Id: I3ab410deec4823149239b0a26b1885fd2a493226
2020-10-23 08:56:56 +02:00
Quentin Guidée
3c9bf7456e Merge branch 'omega-hotfix' into omega-dev 2020-10-18 09:59:17 +02:00
Quentin
a812b52fee Merge pull request #416 from RedGl0w/SDLHotfix
[Ion/SDL] Fix conflicts with master
2020-10-18 09:56:30 +02:00
Émilie Feral
c91c2a6e3f [app/shared] CurveView: Avoid dashSize overflow in
drawHorizontalOrVerticalSegment
2020-10-12 09:48:55 +02:00
Émilie Feral
8e025b0823 [apps/shared] CurveView: avoid overflowing KDCoordinate
This fixes the following bug: add the sequence, u(n)=2^n. On the graph,
go to "sum of terms" and try to sum terms from 0 to 18 by moving the
cursor. It hangs.
2020-10-12 09:48:55 +02:00
Joachim LF
ab906da53d [Ion/SDL] Fix conflicts with master 2020-10-11 12:37:44 +02:00
Joachim Le Fournis
f2edb0a033 [Ion/usb] Changed URL in order to have easier update 2020-10-11 09:08:48 +02:00
Quentin Guidée
e8b86ca6a1 [upstream] Update 2020-10-10 02:28:33 +02:00
Émilie Feral
17fd1aea29 [ion] Haptics implementation are on all simulators but
Ion::Haptics::isEnabled is per platform.
2020-09-30 17:30:34 +02:00
Émilie Feral
0c0510599d [ion] Simulator: haptics feedback are only implemented on Android and
depends on the System settings
2020-09-30 17:30:34 +02:00
Émilie Feral
9786db308a [ion] Haptics events don't depend on SCREEN_ONLY 2020-09-30 17:30:34 +02:00
Émilie Feral
979c227d54 [ion] web: improve key highlight positions 2020-09-30 17:30:34 +02:00
Émilie Feral
595532e0a5 [ion] Remove useless variables 2020-09-30 17:30:34 +02:00
Émilie Feral
42cedf5b10 [ion] Windows: improve resgen.py script 2020-09-30 17:30:34 +02:00
Émilie Feral
f4b9635fee [ion] Change variable name 2020-09-30 17:30:34 +02:00
Émilie Feral
560c4b3821 [ion] Linux: improve incbin.py script 2020-09-30 17:30:34 +02:00
Émilie Feral
5da82d8423 [ion] Add comment 2020-09-30 17:30:34 +02:00
Émilie Feral
33425e04c0 [ion] Coding style 2020-09-30 17:30:34 +02:00
Émilie Feral
7535abc298 [ion] Change name of variable in Makefile 2020-09-30 17:30:34 +02:00
Émilie Feral
308b321ead [ion] Clean windows flag 2020-09-30 17:30:34 +02:00
Émilie Feral
8976ebfc41 [ion] Makefile linux: simplify build system by generating a header 2020-09-30 17:30:34 +02:00
Émilie Feral
4620aa8aa8 [ion] Remove useless comment 2020-09-30 17:30:34 +02:00
Émilie Feral
c96efa76b9 [ion] Windows Makefile: build .rc from the list of assets 2020-09-30 17:30:34 +02:00
Émilie Feral
40392fff9c [ion] Simulator: assets declaration is common to all targets 2020-09-30 17:30:34 +02:00
Émilie Feral
815a06adad [ion] Avoid unhighlighting key when the mouse is still on it.
Distinguish with smartphones behaviour.
2020-09-30 17:30:34 +02:00
Émilie Feral
22b585057d [ion] Simulator: key layouts assets are PNG instead of JPG V (fix windows) 2020-09-30 17:30:34 +02:00
Émilie Feral
165b129385 [ion] Simulator: key layouts assets are PNG instead of JPG IV (fix linux) 2020-09-30 17:30:34 +02:00
Émilie Feral
1946c68ef8 [ion] Simulator: key layouts assets are PNG instead of JPG III (fix ios) 2020-09-30 17:30:34 +02:00
Émilie Feral
d2632bff4f [ion] Simulator: key layouts assets are PNG instead of JPG II (fix
android)
2020-09-30 17:30:34 +02:00
Émilie Feral
d4b7b6baf0 [ion] Simulator: key layouts assets are PNG instead of JPG I (fix macos) 2020-09-30 17:30:34 +02:00
Émilie Feral
11236c67cb [ion] Improve key positions 2020-09-30 17:30:34 +02:00
Émilie Feral
0b114abb95 [ion] Simulator windows: fix pixel format typo 2020-09-30 17:30:34 +02:00
Émilie Feral
8000ff733e [ion] Simulator: improve key center positions 2020-09-30 17:30:34 +02:00
Émilie Feral
8b5caeb394 [ion] IonSimulatorLoadImage returns a Texture (otherwise the pixels data
which needs to be deleted when freeing the surface is hard to retrieve)
2020-09-30 17:30:34 +02:00
Émilie Feral
02b648e36d [ion] IonSimulatorLoadImage returns a surface instead of a texture: this
way we can set a transparent color key before turning it into a texture.
2020-09-30 17:30:34 +02:00
Émilie Feral
674703f4dc [ion] Missing include 2020-09-30 17:30:34 +02:00
Émilie Feral
64bcbd708a [ion] Linux: fix images: get the asset addresses instead of consecutive
table addresses
2020-09-30 17:30:34 +02:00
Émilie Feral
2236dcdbed [ion] Fix: unhighlight the key on mouse up event (when you clicked on the key
on a smartphone, you want the key to be deselected)
2020-09-30 17:30:34 +02:00
Émilie Feral
af544a95d1 [ion] Windows: IonSimulatorLoadImage can now load any resource. Enable
to use key layouts jpg files in C/C++ code.
2020-09-30 17:30:34 +02:00
Émilie Feral
22250b4234 [ion] linux: enable to use key layouts jpg files in C/C++ code 2020-09-30 17:30:34 +02:00
Émilie Feral
a27122802d [ion] Macos Makefile: add depencies on keys layouts jpg images 2020-09-30 17:30:34 +02:00
Émilie Feral
ad1ef783ce [ion][escher] Revert previous commit: move inliner back to escher 2020-09-30 17:30:34 +02:00
Émilie Feral
4ae39f56fd [ion] Simulator: Layout uses jpg images instead of image built by the
inliner
2020-09-30 17:30:34 +02:00
Émilie Feral
652d2e6bac TODOs 2020-09-30 17:30:34 +02:00
Émilie Feral
50031c4836 [ion] Unhighlight the key on mouse up event (when you clicked on the key
on a smartphone, you want the key to be deselected)
2020-09-30 17:30:34 +02:00
Émilie Feral
ef363c57ac [ion] Reset the highlighted key once it has been drawn 2020-09-30 17:30:34 +02:00
Émilie Feral
ded2174578 [ion] simulator/shared: fix macro EPSILON_SDL_SCREEN_ONLY 2020-09-30 17:30:34 +02:00
Émilie Feral
c5add52e61 [ion] simulator: move key_layouts to ion/src/simulator/assets 2020-09-30 17:30:34 +02:00
Émilie Feral
1ad55139b4 [ion] simulator/shared/key_layouts: udpate png files 2020-09-30 17:30:34 +02:00
Émilie Feral
db1874fdac [ion] simulator/shared/layout: update the center of keys to centered the
highlight keys
2020-09-30 17:30:34 +02:00
Émilie Feral
23a542e639 [ion/simulator/shared/layout] Round instead of truncate when converting
relative to absolute coordinates
2020-09-30 17:30:34 +02:00
Émilie Feral
a8c318f90f [ion] simulator: move background render methods to layout 2020-09-30 17:30:34 +02:00
Émilie Feral
a3ef7c9234 [ion] simulator: fix magic number in display 2020-09-30 17:30:34 +02:00
Émilie Feral
649fb0bebe [ion] Simulator: highlight keys when the mouse is over 2020-09-30 17:30:34 +02:00
Émilie Feral
94851da7f9 [ion] Add drafts of images reprensenting key shapes 2020-09-30 17:30:34 +02:00
Émilie Feral
fcf4c011cb [ion] simulator/layout: change signature of makeAbsolute 2020-09-30 17:30:34 +02:00
Émilie Feral
8f8f42edd5 [ion] simulator: add forgotten Display::quit 2020-09-30 17:30:34 +02:00
Émilie Feral
f7479e0cf5 [ion][escher] Move image inliner to ion 2020-09-30 17:30:34 +02:00
Émilie Feral
ca56ba6327 [ion] Fix include 2020-09-30 17:30:34 +02:00
Émilie Feral
158afa7a27 [ion] simulator: the key detection distance threshold is responsive to
the frame dimension
2020-09-30 17:30:34 +02:00
Léa Saviot
b020cb2f98 [ion/simulator] Add haptic feedback 2020-09-30 17:30:34 +02:00
Émilie Feral
1c0f6a7913 [ion] Keyboard: don't detect a key down when the mouse is too far away
from a key
2020-09-30 17:30:34 +02:00
Joachim Le Fournis
aeb22bf35d [external] change heapSize 2020-09-05 11:20:15 +02:00
Joachim Le Fournis
befcfd10b7 [Python] Change heap 2020-09-05 11:16:25 +02:00
Quentin
ae41a19fb2 Merge pull request #401 from quentinguidee/merge-omega-themes-submodule
Merge omega-themes submodule in the main repository
2020-09-04 14:43:31 +02:00
Émilie Feral
4c41b1699d [docs] Add/remove dependencies in windows SDK 2020-09-03 15:36:21 +02:00
Quentin Guidée
ff7a72eca8 [themes] Remove submodule dependency 2020-09-03 14:59:55 +02:00
Quentin Guidée
28fe0e31b1 [github] Update README.md 2020-09-02 16:14:13 +02:00
Quentin Guidée
be931445ac [themes] Update submodule 2020-09-02 15:35:54 +02:00
Quentin
4c10ad471b Merge pull request #396 from quentinguidee/omega-dev-doc-design
[build/doc] Better Doxygen design
2020-09-02 11:57:15 +02:00
Quentin Guidée
9233422b1a [build/doc] Some design improvements 2020-09-02 11:41:53 +02:00
Gabriel Ozouf
b7c7695707 [apps/code] Remove interruption check
A check for interruption in ConsoleController::printText caused script
to immediately stop when launched after an interrupted script.
This check was used to break out of infinite print loop, but now
becomes redundant with how micropython_port_vm_hook_loop was changed.

Change-Id: Ifa8d415e1b2c2406ad67300eb14ce46889af296f
2020-08-31 15:32:02 +02:00
Gabriel Ozouf
7dcf1662b0 [python/helpers] Change interrupt check delay
Keyboard interruption used to be checked once every 20000 calls to
micropython_port_vm_hook_loop. However, if costly functions were
executed in between calls to this method, the delay for activating
interruptions would increase.
Now, keyboard interruption is checked after a fixed amount of time has
passed. This way, if the process waits a long time between two calls
to micropython_port_vm_hook_loop, it is still interrupted in a timely
manner.

Change-Id: I37ca3bd4a996fa086078f504340dd857526e356a
2020-08-31 15:32:02 +02:00
Gabriel Ozouf
34ebf1e6e0 [python/kandinsky] Remove additional interrupt
Additional checks for interruptions were making the kandinsky module
slower.
/!\ Some scripts are now very difficult to interrupt

Change-Id: I4c18273d8895deaac68084411a52556c8459d52b
2020-08-31 15:32:02 +02:00
Gabriel Ozouf
0a493d1f34 [kandinsky/color] Update comment on blend method
Change-Id: I5fb68608657d2f604c8cb7c9294382ed4a8603ff
2020-08-25 15:51:58 +02:00
Gabriel Ozouf
e33543aacb [kandinsky/color] Add tests on color blending
Change-Id: If1792bd9ec44052238632d28b806f5582b190fe9
2020-08-25 15:51:58 +02:00
Gabriel Ozouf
078bba2fb9 [kandinsky/color] Fix blend method
When computing the barycenter between two colors, the some of the two
factors a and (1-a) was equal to 255/256 instead of 1.

Change-Id: Ia9a779d43470ef42d9430ad730e842da0f007140
2020-08-25 15:51:58 +02:00
Gabriel Ozouf
38e15da5d0 [kandinsky/color] Blend identical colors
KDColor::blend used to produce different colors when blending two
identical colors (ex : use draw_string in Python to print white text on
a white background).
blend now escapes early when its two color arguments are identical.

Change-Id: I01dc5a0d5e4e6a20e09fee0f346dafc313dae97b
2020-08-25 15:51:58 +02:00
Joachim Le Fournis
d154611023 [Ion] Fix broken link 2020-08-24 16:37:03 -04:00
Quentin
fa5bfaf15d Merge pull request #347 from boricj/feature/rtcBringup
[Feature] Real-time clock
2020-08-16 17:57:43 +02:00
Jean-Baptiste Boric
eff8f09dda [apps] Settings for date/time 2020-08-16 15:49:40 +02:00
Jean-Baptiste Boric
43376996a1 [python] Add RTC functions in time module 2020-08-16 15:49:40 +02:00
Jean-Baptiste Boric
93e6daec6b [apps] Show clock in titlebar 2020-08-16 15:49:40 +02:00
Jean-Baptiste Boric
2fd15b7d7f [ion] Add RTC subsystem 2020-08-16 15:49:40 +02:00
Hugo Saint-Vignes
7eb694822d [python] Add magenta color
Change-Id: I7a5e12f6f3d79da802149a6aeef88387941ccdd8
2020-08-11 17:08:23 +02:00
Hugo Saint-Vignes
0b683b6994 [apps/shared] Handle identical layout in MinimalSizeForOptimalDisplay
Change-Id: I99a523e9e88ea9c3064e4367d96b01edb0020df9
2020-08-11 17:06:07 +02:00
Quentin Guidée
60f871c29c [build/doc] Fix CSS indentation 2020-08-10 21:27:40 +02:00
Quentin
07da4831b1 Merge pull request #395 from M4xi1m3/omega-dev-doc
[build/doc] Custom CSS, for the pleasure of your eyes.
2020-08-10 16:02:00 +02:00
M4x1m3
dbc0e94c91 [build/doc] Custom CSS, for the pleasure of your eyes. 2020-08-10 15:57:02 +02:00
Quentin Guidée
b987d22419 Merge branch 'omega-hotfix' into omega-dev 2020-08-09 13:28:57 +02:00
Quentin Guidée
e2dfb9fc4f Merge branch 'omega-hotfix' into omega-dev 2020-08-06 15:24:58 +02:00
Quentin Guidée
d0de9b4af2 [omega] Set version to 1.21.0 2020-08-05 10:44:08 +02:00
Quentin Guidée
7a40497a9f Merge branch 'omega-hotfix' into omega-dev 2020-08-04 10:36:11 +02:00
Quentin Guidée
d1aaa7c125 Merge branch 'omega-hotfix' into omega-dev 2020-07-23 18:24:39 +02:00
Quentin Guidée
7bdd973ddc Merge branch 'omega-hotfix' into omega-dev 2020-07-21 22:38:03 +02:00
Quentin Guidée
a38297f8d0 [github] Fix README.md 2020-07-21 09:41:07 +02:00
Quentin
f3067ccfee [Fix] Conflicts 2020-07-21 09:41:07 +02:00
Garret Kelly
668bc95f15 [build] Don't invoke bash-specific '[['
'[[' isn't available when $SHELL isn't set to bash, so use expr from
coreutils to check for the presence of the device in DFU mode.
2020-01-15 22:34:39 -05:00
2036 changed files with 88261 additions and 20379 deletions

View File

@@ -1,14 +1,29 @@
---
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: ''
labels: Bug, Triage
labels: 'Status: Triage, Type: Bug'
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
- Omega Version: {go to settings > about > Omega Version and type the version here}
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Device (please complete the following information):**
- The device on which you're running Upsilon (computer, n0110, n0100, etc...)
- Upsilon Version: [go to settings > about > Upsilon Version and type the version here]
- Upsilon commit: [settings > about > click one time on epsilon version]

View File

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

View File

@@ -1,10 +1,17 @@
---
name: Feature request
about: Suggest an idea for an improvement of Omega
about: Suggest an idea for Upsilon
title: ''
labels: Feature, Triage
labels: 'Status: Triage, Type: Feature'
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
about: A question? A problem? ...
about: A question? A problem?
title: ''
labels: Triage
labels: 'Status: Triage'
assignees: ''
---

View File

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

View File

@@ -1,12 +0,0 @@
name: Docker Image CI
on: [pull_request, push]
jobs:
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Build the Docker image
run: docker build . --file docker/Dockerfile --tag omega:$(date +%s)

View File

@@ -1,123 +1,582 @@
name: Continuous integration
on: [pull_request, push]
#on: [pull_request, push]
on:
push:
pull_request:
workflow_dispatch:
inputs:
triggerIos:
description: 'Run iOS tests'
required: true
default: 'yes'
triggerMacos:
description: 'Run macOS tests'
required: true
default: 'yes'
trigger3DS:
description: 'Run 3DS tests'
required: true
default: 'yes'
triggerFxcg:
description: 'Run fxcg tests'
required: true
default: 'no'
jobs:
# nintendo_3ds:
# runs-on: ubuntu-latest
# steps:
# - run: wget https://github.com/devkitPro/pacman/releases/download/v1.0.2/devkitpro-pacman.amd64.deb -O /tmp/devkitpro-pacman.deb
# - run: yes | sudo dpkg -i /tmp/devkitpro-pacman.deb
# - run: yes | sudo dkp-pacman -Syu --needed devkitARM 3dstools libctru
# - run: echo ::set-env name=DEVKITPRO::/opt/devkitpro
# - run: echo ::set-env name=DEVKITARM::/opt/devkitpro/devkitARM
# - run: echo ::set-env name=PATH::$DEVKITPRO/tools/bin:$DEVKITARM/bin:$PATH
# - uses: actions/checkout@v1
# with:
# submodules: true
# - run: make -j2 PLATFORM=simulator TARGET=3ds
# - uses: actions/upload-artifact@master
# with:
# name: epsilon-3ds.3dsx
# path: output/release/simulator/3ds/epsilon.3dsx
fxcg: # fxcg build is broken for now, disabling it for now to avoid noise
if: github.event.inputs.triggerFxcg == 'yes'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
submodules: 'recursive'
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install build-essential cmake libfreetype-dev -y
- name: Get latest gint commit hash
run: |
LATEST_COMMIT_HASH=$(curl --silent https://git.planet-casio.com/api/v1/repos/Lephenixnoir/gint/branches/master | jq -r .commit.id)
echo "Latest commit hash is: $LATEST_COMMIT_HASH"
echo "LATEST_COMMIT_HASH=$LATEST_COMMIT_HASH" >> $GITHUB_OUTPUT
id: get-latest-commit-hash
- name: Cache gint/fxsdk installation
id: cache-gint
uses: actions/cache@v4
with:
path: |
~/.local/*/*
!~/.local/share/containers
key: ${{ runner.os }}-gint-${{ steps.get-latest-commit-hash.outputs.LATEST_COMMIT_HASH }}
- name: Install gint/fxsdk
if: steps.cache-gint.outputs.cache-hit != 'true'
env:
URL: "https://git.planet-casio.com/Lephenixnoir/GiteaPC/archive/master.tar.gz"
run: |
export PATH="~/.local/bin:$PATH"
cd "$(mktemp -d)"
curl "$URL" -o giteapc-master.tar.gz
tar -xzf giteapc-master.tar.gz
cd giteapc
python3 giteapc.py install Lephenixnoir/GiteaPC -y
sudo apt-get install python3-pil libusb-1.0-0-dev libudev-dev libsdl2-dev libpng-dev libudisks2-dev libglib2.0-dev libmpfr-dev libmpc-dev libppl-dev -y
giteapc install Lephenixnoir/fxsdk:noudisks2 Lephenixnoir/sh-elf-binutils Lephenixnoir/sh-elf-gcc -y
giteapc install Lephenixnoir/OpenLibm Vhex-Kernel-Core/fxlibc Lephenixnoir/sh-elf-gcc -y
giteapc install Lephenixnoir/gint -y
- name: Add fxsdk to PATH
run: echo "~/.local/bin" >> $GITHUB_PATH
- run: make -j2 PLATFORM=simulator TARGET=fxcg
- id: 'auth'
if: ${{ github.event_name == 'push' && github.ref_name == 'upsilon-dev' && github.repository == 'UpsilonNumworks/Upsilon' }}
uses: 'google-github-actions/auth@v0'
with:
credentials_json: '${{secrets.GOOGLE_CREDENTIALS}}'
- id: 'upload-directory'
if: ${{ github.event_name == 'push' && github.ref_name == 'upsilon-dev' && github.repository == 'UpsilonNumworks/Upsilon' }}
uses: 'google-github-actions/upload-cloud-storage@v0'
with:
path: 'output/release/simulator/fxcg/epsilon.g3a'
destination: 'upsilon-binfiles.appspot.com/dev/simulator/'
parent: false
- if: ${{ github.event_name == 'push' && github.ref_name == 'upsilon-dev' && github.repository == 'UpsilonNumworks/Upsilon' }}
uses: actions/checkout@v5
with:
repository: Yaya-Cout/Upsilon-binfiles
ref: 'main'
token: ${{ secrets.PAT_UPSILON_BINFILES }}
path: 'binfiles'
# TODO: Handle git conflicts using rebase
- name: Upload binary files to website
if: ${{ github.event_name == 'push' && github.ref_name == 'upsilon-dev' && github.repository == 'UpsilonNumworks/Upsilon'}}
run: |
cp -r output/release/simulator/fxcg/epsilon.g3a binfiles/binaries/dev/simulator
cd binfiles
git add -A
git config --global user.email "ci@github.com"
git config --global user.name "GitHub Upsilon CI"
git pull
git commit -m "Update from CI"
git push
- uses: actions/upload-artifact@v4
with:
name: epsilon.g3a
path: output/release/simulator/fxcg/epsilon.g3a
nintendo_3ds:
if: github.event.inputs.trigger3DS == 'yes' || github.event.inputs.trigger3DS == ''
runs-on: ubuntu-latest
container: devkitpro/devkitarm:latest
steps:
- uses: actions/checkout@v5
with:
submodules: true
- run: sudo apt-get update
- run: sudo apt-get install build-essential imagemagick libfreetype6-dev libjpeg-dev libpng-dev pkg-config -y
- run: yes | sudo dkp-pacman -S --needed devkitARM 3dstools libctru
- run: wget https://github.com/3DSGuy/Project_CTR/releases/download/makerom-v0.18.3/makerom-v0.18.3-ubuntu_x86_64.zip
- run: unzip makerom-v0.18.3-ubuntu_x86_64.zip
- run: rm makerom-v0.18.3-ubuntu_x86_64.zip
- run: chmod +x ./makerom
- run: echo "PATH=.:$PATH" >> $GITHUB_ENV
- run: make -j2 PLATFORM=simulator TARGET=3ds
- run: make -j2 PLATFORM=simulator TARGET=3ds epsilon.cia
- uses: actions/upload-artifact@v4
with:
name: epsilon-3ds.3dsx
path: output/release/simulator/3ds/epsilon.3dsx
- uses: actions/upload-artifact@v4
with:
name: epsilon-3ds.cia
path: output/release/simulator/3ds/epsilon.cia
- if: ${{ github.event_name == 'push' && github.ref_name == 'upsilon-dev' && github.repository == 'UpsilonNumworks/Upsilon' }}
uses: actions/checkout@v5
with:
repository: Yaya-Cout/Upsilon-binfiles
ref: 'main'
token: ${{ secrets.PAT_UPSILON_BINFILES }}
path: 'binfiles'
# TODO: Handle git conflicts using rebase
- name: Upload binary files to website
if: ${{ github.event_name == 'push' && github.ref_name == 'upsilon-dev' && github.repository == 'UpsilonNumworks/Upsilon'}}
run: |
cp -r output/release/simulator/3ds/epsilon.3dsx output/release/simulator/3ds/epsilon.cia binfiles/binaries/dev/simulator
cd binfiles
git add -A
git config --global user.email "ci@github.com"
git config --global user.name "GitHub Upsilon CI"
git pull
git commit -m "Update from CI"
git push
android:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v5
with:
submodules: true
- run: make -j2 PLATFORM=simulator TARGET=android
- uses: actions/upload-artifact@master
submodules: 'recursive'
- run: |
sudo apt-get update
sudo apt-get install imagemagick libfreetype-dev libpng-dev
- name: Set up JDK 25
uses: actions/setup-java@v5
with:
java-version: '25'
distribution: 'temurin'
- run: wget -nv https://dl.google.com/android/repository/android-ndk-r21e-linux-x86_64.zip
- run: unzip -q android-ndk-r21e-linux-x86_64.zip
- run: make -j2 PLATFORM=simulator TARGET=android NDK_PATH=./android-ndk-r21e
- id: 'auth'
if: ${{ github.event_name == 'push' && github.ref_name == 'upsilon-dev' && github.repository == 'UpsilonNumworks/Upsilon' }}
uses: 'google-github-actions/auth@v0'
with:
credentials_json: '${{secrets.GOOGLE_CREDENTIALS}}'
- id: 'upload-file'
if: ${{ github.event_name == 'push' && github.ref_name == 'upsilon-dev' && github.repository == 'UpsilonNumworks/Upsilon' }}
uses: 'google-github-actions/upload-cloud-storage@v0'
with:
path: 'output/release/simulator/android/epsilon.apk'
destination: 'upsilon-binfiles.appspot.com/dev/simulator/'
parent: false
- if: ${{ github.event_name == 'push' && github.ref_name == 'upsilon-dev' && github.repository == 'UpsilonNumworks/Upsilon' }}
uses: actions/checkout@v5
with:
repository: Yaya-Cout/Upsilon-binfiles
ref: 'main'
token: ${{ secrets.PAT_UPSILON_BINFILES }}
path: 'binfiles'
# TODO: Handle git conflicts using rebase
- name: Upload binary files to website
if: ${{ github.event_name == 'push' && github.ref_name == 'upsilon-dev' && github.repository == 'UpsilonNumworks/Upsilon'}}
run: |
cp -r output/release/simulator/android/epsilon.apk binfiles/binaries/dev/simulator
cd binfiles
git add -A
git config --global user.email "ci@github.com"
git config --global user.name "GitHub Upsilon CI"
git pull
git commit -m "Update from CI"
git push
- uses: actions/upload-artifact@v4
with:
name: epsilon-android.apk
path: output/release/simulator/android/epsilon.apk
n0100:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04-arm
steps:
- run: sudo apt-get install build-essential imagemagick libfreetype6-dev libjpeg-dev libpng-dev pkg-config
- uses: numworks/setup-arm-toolchain@v1
- uses: actions/checkout@v1
- run: |
sudo apt-get update
sudo apt-get install build-essential imagemagick libfreetype6-dev libjpeg-dev libpng-dev pkg-config gcc-arm-none-eabi binutils-arm-none-eabi
- uses: actions/checkout@v5
with:
submodules: true
submodules: 'recursive'
- run: mkdir final-output
- run: make -j2 MODEL=n0100 EPSILON_I18N=en output/release/device/n0100/epsilon.onboarding.two_binaries
- run: mv output/release/device/n0100/epsilon.onboarding.internal.bin final-output/epsilon.onboarding.internal.en.bin
- run: make -j2 MODEL=n0100 EPSILON_I18N=en output/release/device/n0100/epsilon.onboarding.two_binaries
- run: mv output/release/device/n0100/epsilon.onboarding.internal.bin final-output/epsilon.onboarding.en.internal.bin
- run: rm output/release/device/n0100/apps/i18n.o output/release/device/n0100/apps/i18n.cpp
# We need to duplicate make to work around i18n generator race condition in Makefile leading to inconsistent incremental rebuilds
- run: make -j2 MODEL=n0100 EPSILON_I18N=fr output/release/device/n0100/epsilon.onboarding.two_binaries
- run: mv output/release/device/n0100/epsilon.onboarding.internal.bin final-output/epsilon.onboarding.internal.fr.bin
- run: make -j2 MODEL=n0100 EPSILON_I18N=fr output/release/device/n0100/epsilon.onboarding.two_binaries
- run: mv output/release/device/n0100/epsilon.onboarding.internal.bin final-output/epsilon.onboarding.fr.internal.bin
- run: rm output/release/device/n0100/apps/i18n.o output/release/device/n0100/apps/i18n.cpp
- run: make -j2 MODEL=n0100 EPSILON_I18N=nl output/release/device/n0100/epsilon.onboarding.two_binaries
- run: mv output/release/device/n0100/epsilon.onboarding.internal.bin final-output/epsilon.onboarding.internal.nl.bin
- run: make -j2 MODEL=n0100 EPSILON_I18N=nl output/release/device/n0100/epsilon.onboarding.two_binaries
- run: mv output/release/device/n0100/epsilon.onboarding.internal.bin final-output/epsilon.onboarding.nl.internal.bin
- run: rm output/release/device/n0100/apps/i18n.o output/release/device/n0100/apps/i18n.cpp
- run: make -j2 MODEL=n0100 EPSILON_I18N=pt output/release/device/n0100/epsilon.onboarding.two_binaries
- run: mv output/release/device/n0100/epsilon.onboarding.internal.bin final-output/epsilon.onboarding.internal.pt.bin
- run: make -j2 MODEL=n0100 EPSILON_I18N=pt output/release/device/n0100/epsilon.onboarding.two_binaries
- run: mv output/release/device/n0100/epsilon.onboarding.internal.bin final-output/epsilon.onboarding.pt.internal.bin
- run: rm output/release/device/n0100/apps/i18n.o output/release/device/n0100/apps/i18n.cpp
- run: make -j2 MODEL=n0100 EPSILON_I18N=it output/release/device/n0100/epsilon.onboarding.two_binaries
- run: mv output/release/device/n0100/epsilon.onboarding.internal.bin final-output/epsilon.onboarding.internal.it.bin
- run: make -j2 MODEL=n0100 EPSILON_I18N=it output/release/device/n0100/epsilon.onboarding.two_binaries
- run: mv output/release/device/n0100/epsilon.onboarding.internal.bin final-output/epsilon.onboarding.it.internal.bin
- run: rm output/release/device/n0100/apps/i18n.o output/release/device/n0100/apps/i18n.cpp
- run: make -j2 MODEL=n0100 EPSILON_I18N=de output/release/device/n0100/epsilon.onboarding.two_binaries
- run: mv output/release/device/n0100/epsilon.onboarding.internal.bin final-output/epsilon.onboarding.internal.de.bin
- run: make -j2 MODEL=n0100 EPSILON_I18N=de output/release/device/n0100/epsilon.onboarding.two_binaries
- run: mv output/release/device/n0100/epsilon.onboarding.internal.bin final-output/epsilon.onboarding.de.internal.bin
- run: rm output/release/device/n0100/apps/i18n.o output/release/device/n0100/apps/i18n.cpp
- run: make -j2 MODEL=n0100 EPSILON_I18N=es output/release/device/n0100/epsilon.onboarding.two_binaries
- run: mv output/release/device/n0100/epsilon.onboarding.internal.bin final-output/epsilon.onboarding.internal.es.bin
- run: make -j2 MODEL=n0100 EPSILON_I18N=es output/release/device/n0100/epsilon.onboarding.two_binaries
- run: mv output/release/device/n0100/epsilon.onboarding.internal.bin final-output/epsilon.onboarding.es.internal.bin
- run: rm output/release/device/n0100/apps/i18n.o output/release/device/n0100/apps/i18n.cpp
- run: make -j2 MODEL=n0100 EPSILON_I18N=hu output/release/device/n0100/epsilon.onboarding.two_binaries
- run: mv output/release/device/n0100/epsilon.onboarding.internal.bin final-output/epsilon.onboarding.internal.hu.bin
- run: make -j2 MODEL=n0100 EPSILON_I18N=hu output/release/device/n0100/epsilon.onboarding.two_binaries
- run: mv output/release/device/n0100/epsilon.onboarding.internal.bin final-output/epsilon.onboarding.hu.internal.bin
- run: rm output/release/device/n0100/apps/i18n.o output/release/device/n0100/apps/i18n.cpp
- run: make -j2 MODEL=n0100 output/release/device/n0100/flasher.light.bin
- run: mv output/release/device/n0100/flasher.light.bin final-output/flasher.light.bin
- run: make -j2 MODEL=n0100 output/release/device/n0100/flasher.verbose.bin
- run: mv output/release/device/n0100/flasher.verbose.bin final-output/flasher.verbose.bin
- run: find final-output/ -type f -exec bash -c "shasum -a 256 -b {} > {}.sha256" \;
- run: tar cvfz binpack-n0100.tgz final-output/*
- uses: actions/upload-artifact@master
- uses: actions/upload-artifact@v4
with:
name: epsilon-binpack-n0100.tgz
path: binpack-n0100.tgz
n0110:
runs-on: ubuntu-latest
steps:
- run: sudo apt-get install build-essential imagemagick libfreetype6-dev libjpeg-dev libpng-dev pkg-config
- uses: numworks/setup-arm-toolchain@v1
- uses: actions/checkout@v1
- if: ${{ github.event_name == 'push' && github.ref_name == 'upsilon-dev' && github.repository == 'UpsilonNumworks/Upsilon' }}
uses: actions/checkout@v5
with:
submodules: true
- run: make -j2 epsilon.dfu
- run: make -j2 epsilon.onboarding.dfu
- run: make -j2 epsilon.onboarding.update.dfu
- run: make -j2 epsilon.onboarding.beta.dfu
- run: make -j2 flasher.light.dfu
- run: make -j2 flasher.verbose.dfu
- run: make -j2 bench.ram.dfu
- run: make -j2 bench.flash.dfu
- run: make -j2 binpack
repository: Yaya-Cout/Upsilon-binfiles
ref: 'main'
token: ${{ secrets.PAT_UPSILON_BINFILES }}
path: 'binfiles'
# TODO: Handle git conflicts using rebase
- name: Upload binary files to website
if: ${{ github.event_name == 'push' && github.ref_name == 'upsilon-dev' && github.repository == 'UpsilonNumworks/Upsilon'}}
run: |
cp -r final-output/* binfiles/binaries/dev/n100
cd binfiles
git add -A
git config --global user.email "ci@github.com"
git config --global user.name "GitHub Upsilon CI"
git pull
git commit -m "Update from CI"
git push
n0110:
runs-on: ubuntu-24.04-arm
steps:
- run: |
sudo apt-get update
sudo apt-get install build-essential imagemagick libfreetype6-dev libjpeg-dev libpng-dev pkg-config gcc-arm-none-eabi binutils-arm-none-eabi
- uses: actions/checkout@v5
with:
submodules: 'recursive'
- run: make -j2 MODEL=n0110 epsilon.dfu
- run: make -j2 MODEL=n0110 epsilon.onboarding.dfu
- run: make -j2 MODEL=n0110 epsilon.onboarding.update.dfu
- run: make -j2 MODEL=n0110 epsilon.onboarding.beta.dfu
- run: make -j2 MODEL=n0110 flasher.light.dfu
- run: make -j2 MODEL=n0110 flasher.verbose.dfu
- run: make -j2 MODEL=n0110 flasher.verbose.bin
- run: make -j2 MODEL=n0110 bench.ram.dfu
# - run: make -j2 MODEL=n0110 bench.flash.dfu
- run: make -j2 MODEL=n0110 binpack
- run: cp output/release/device/n0110/binpack-n0110-`git rev-parse HEAD | head -c 7`.tgz output/release/device/n0110/binpack-n0110.tgz
- uses: actions/upload-artifact@master
- run: cp output/release/device/n0110/flasher.verbose.bin output/release/device/n0110/binpack/
- run: cd output/release/device/n0110 && for binary in *.bin; do shasum -a 256 -b binpack/${binary} > binpack/${binary}.sha256;done
- run: cp output/release/device/n0110/binpack-n0110-`git rev-parse HEAD | head -c 7`.tgz output/release/device/n0110/binpack/binpack.tgz
- uses: actions/upload-artifact@v4
with:
name: epsilon-binpack-n0110.tgz
path: output/release/device/n0110/binpack-n0110.tgz
- if: ${{ github.event_name == 'push' && github.ref_name == 'upsilon-dev' && github.repository == 'UpsilonNumworks/Upsilon' }}
uses: actions/checkout@v5
with:
repository: Yaya-Cout/Upsilon-binfiles
ref: 'main'
token: ${{ secrets.PAT_UPSILON_BINFILES }}
path: 'binfiles'
# TODO: Handle git conflicts using rebase
- name: Upload binary files to website
if: ${{ github.event_name == 'push' && github.ref_name == 'upsilon-dev' && github.repository == 'UpsilonNumworks/Upsilon'}}
run: |
cp -r output/release/device/n0110/binpack/* binfiles/binaries/dev/n110
cd binfiles
git add -A
git config --global user.email "ci@github.com"
git config --global user.name "GitHub Upsilon CI"
git pull
git commit -m "Update from CI"
git push
bootloader:
runs-on: ubuntu-24.04-arm
steps:
- run: |
sudo apt-get update
sudo apt-get install build-essential imagemagick libfreetype6-dev libjpeg-dev libpng-dev pkg-config gcc-arm-none-eabi binutils-arm-none-eabi
- uses: actions/checkout@v5
with:
submodules: 'recursive'
- run: make -j2 MODEL=n0110 bootloader
- run: make -j2 epsilon.A.dfu epsilon.B.dfu
- run: make -j2 epsilon.onboarding.A.dfu
- run: make -j2 epsilon.onboarding.B.dfu
- run: make -j2 epsilon.onboarding.update.A.dfu
- run: make -j2 epsilon.onboarding.update.B.dfu
- run: make -j2 epsilon.onboarding.beta.A.dfu
- run: make -j2 epsilon.onboarding.beta.B.dfu
- run: make -j2 binpack
- run: cp output/release/device/bootloader/binpack-bootloader-`git rev-parse HEAD | head -c 7`.tgz output/release/device/bootloader/binpack-bootloader.tgz
- run: cp output/release/device/n0110/bootloader.bin output/release/device/bootloader/binpack/
- run: cp output/release/device/n0110/bootloader.bin output/release/device/bootloader/
- run: cd output/release/device/bootloader && for binary in *.bin; do shasum -a 256 -b binpack/${binary} > binpack/${binary}.sha256;done
- run: cd output/release/device/bootloader && tar cvfz binpack-bootloader.tgz binpack/*
- uses: actions/upload-artifact@v4
with:
name: epsilon-binpack-bootloader.tgz
path: output/release/device/bootloader/binpack-bootloader.tgz
- if: ${{ github.event_name == 'push' && github.ref_name == 'upsilon-dev' && github.repository == 'UpsilonNumworks/Upsilon' }}
uses: actions/checkout@v5
with:
repository: Yaya-Cout/Upsilon-binfiles
ref: 'main'
token: ${{ secrets.PAT_UPSILON_BINFILES }}
path: 'binfiles'
# TODO: Handle git conflicts using rebase
- name: Upload binary files to website
if: ${{ github.event_name == 'push' && github.ref_name == 'upsilon-dev' && github.repository == 'UpsilonNumworks/Upsilon'}}
run: |
cp -r output/release/device/bootloader/binpack/* binfiles/binaries/dev/n110
cd binfiles
git add -A
git config --global user.email "ci@github.com"
git config --global user.name "GitHub Upsilon CI"
git pull
git commit -m "Update from CI"
git push
windows:
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- uses: msys2/setup-msys2@v2
- uses: actions/checkout@v5
with:
submodules: 'recursive'
- run: pacman -S --noconfirm mingw-w64-x86_64-gcc mingw-w64-x86_64-freetype mingw-w64-x86_64-pkg-config make mingw-w64-x86_64-python3 mingw-w64-x86_64-libjpeg-turbo mingw-w64-x86_64-libpng git
- run: make -j2 PLATFORM=simulator
- run: make -j2 PLATFORM=simulator test.exe
- run: cmd /c output\release\simulator\windows\test.exe --headless
- id: 'auth'
if: ${{ github.event_name == 'push' && github.ref_name == 'upsilon-dev' && github.repository == 'UpsilonNumworks/Upsilon' }}
uses: 'google-github-actions/auth@v0'
with:
credentials_json: '${{secrets.GOOGLE_CREDENTIALS}}'
- id: 'upload-file'
if: ${{ github.event_name == 'push' && github.ref_name == 'upsilon-dev' && github.repository == 'UpsilonNumworks/Upsilon' }}
uses: 'google-github-actions/upload-cloud-storage@v0'
with:
path: 'output/release/simulator/windows/epsilon.exe'
destination: 'upsilon-binfiles.appspot.com/dev/simulator/'
parent: false
- if: ${{ github.event_name == 'push' && github.ref_name == 'upsilon-dev' && github.repository == 'UpsilonNumworks/Upsilon' }}
uses: actions/checkout@v5
with:
repository: Yaya-Cout/Upsilon-binfiles
ref: 'main'
token: ${{ secrets.PAT_UPSILON_BINFILES }}
path: 'binfiles'
# TODO: Handle git conflicts using rebase
- name: Upload binary files to website
if: ${{ github.event_name == 'push' && github.ref_name == 'upsilon-dev' && github.repository == 'UpsilonNumworks/Upsilon'}}
run: |
cp -r output/release/simulator/windows/epsilon.exe binfiles/binaries/dev/simulator
cd binfiles
git add -A
git config --global user.email "ci@github.com"
git config --global user.name "GitHub Upsilon CI"
git pull
git commit -m "Update from CI"
git push
- uses: actions/upload-artifact@v4
with:
name: epsilon-windows.exe
path: output/release/simulator/windows/epsilon.exe
web:
runs-on: ubuntu-latest
steps:
- uses: numworks/setup-emscripten@v2
- uses: numworks/setup-emscripten@master
with:
sdk: latest-upstream
- uses: actions/checkout@v1
sdk: latest
- uses: actions/checkout@v4
with:
submodules: true
submodules: 'recursive'
# Install the Linux toolchin to avoid dependancies issues, but maybe only libpng is needed
- run: |
sudo apt-get update
sudo apt-get install build-essential imagemagick libfreetype6-dev libjpeg-dev libpng-dev pkg-config libxtst-dev
- run: make -j2 PLATFORM=simulator TARGET=web
- uses: actions/upload-artifact@master
- run: make -j2 PLATFORM=simulator TARGET=web test.js
- run: node output/release/simulator/web/test.js --headless
- id: 'auth'
if: ${{ github.event_name == 'push' && github.ref_name == 'upsilon-dev' && github.repository == 'UpsilonNumworks/Upsilon' }}
uses: 'google-github-actions/auth@v0'
with:
credentials_json: '${{secrets.GOOGLE_CREDENTIALS}}'
- id: 'upload-file'
if: ${{ github.event_name == 'push' && github.ref_name == 'upsilon-dev' && github.repository == 'UpsilonNumworks/Upsilon' }}
uses: 'google-github-actions/upload-cloud-storage@v0'
with:
path: 'output/release/simulator/web/epsilon.js'
destination: 'upsilon-binfiles.appspot.com/dev/simulator/'
parent: false
- if: ${{ github.event_name == 'push' && github.ref_name == 'upsilon-dev' && github.repository == 'UpsilonNumworks/Upsilon' }}
uses: actions/checkout@v5
with:
repository: Yaya-Cout/Upsilon-binfiles
ref: 'main'
token: ${{ secrets.PAT_UPSILON_BINFILES }}
path: 'binfiles'
# TODO: Handle git conflicts using rebase
- name: Upload binary files to website
if: ${{ github.event_name == 'push' && github.ref_name == 'upsilon-dev' && github.repository == 'UpsilonNumworks/Upsilon'}}
run: |
cp -r output/release/simulator/web/epsilon.zip binfiles/binaries/dev/simulator
cd binfiles
git add -A
git config --global user.email "ci@github.com"
git config --global user.name "GitHub Upsilon CI"
git pull
git commit -m "Update from CI"
git push
- uses: actions/upload-artifact@v4
with:
name: epsilon-web.zip
path: output/release/simulator/web/epsilon.zip
linux:
runs-on: ubuntu-latest
steps:
- run: sudo apt-get install build-essential imagemagick libfreetype6-dev libjpeg-dev libpng-dev pkg-config
- uses: actions/checkout@v1
- run: |
sudo apt-get update
sudo apt-get install build-essential imagemagick libfreetype6-dev libjpeg-dev libpng-dev pkg-config libxtst-dev
- uses: actions/checkout@v5
with:
submodules: true
submodules: 'recursive'
- run: make -j2 PLATFORM=simulator
- uses: actions/upload-artifact@master
- run: make -j2 PLATFORM=simulator test.bin
- run: output/release/simulator/linux/test.bin --headless
- id: 'auth'
if: ${{ github.event_name == 'push' && github.ref_name == 'upsilon-dev' && github.repository == 'UpsilonNumworks/Upsilon' }}
uses: 'google-github-actions/auth@v0'
with:
credentials_json: '${{secrets.GOOGLE_CREDENTIALS}}'
- id: 'upload-file'
if: ${{ github.event_name == 'push' && github.ref_name == 'upsilon-dev' && github.repository == 'UpsilonNumworks/Upsilon' }}
uses: 'google-github-actions/upload-cloud-storage@v0'
with:
path: 'output/release/simulator/linux/epsilon.bin'
destination: 'upsilon-binfiles.appspot.com/dev/simulator/'
parent: false
- if: ${{ github.event_name == 'push' && github.ref_name == 'upsilon-dev' && github.repository == 'UpsilonNumworks/Upsilon' }}
uses: actions/checkout@v5
with:
repository: Yaya-Cout/Upsilon-binfiles
ref: 'main'
token: ${{ secrets.PAT_UPSILON_BINFILES }}
path: 'binfiles'
# TODO: Handle git conflicts using rebase
- name: Upload binary files to website
if: ${{ github.event_name == 'push' && github.ref_name == 'upsilon-dev' && github.repository == 'UpsilonNumworks/Upsilon'}}
run: |
cp -r output/release/simulator/linux/epsilon.bin binfiles/binaries/dev/simulator
cd binfiles
git add -A
git config --global user.email "ci@github.com"
git config --global user.name "GitHub Upsilon CI"
git pull
git commit -m "Update from CI"
git push
- uses: actions/upload-artifact@v4
with:
name: epsilon-linux.bin
path: output/release/simulator/linux/epsilon.bin
- run: make -j2 PLATFORM=simulator test.headless.bin
macos:
if: github.event.inputs.triggerMacos == 'yes' || github.event.inputs.triggerMacos == ''
runs-on: macOS-latest
steps:
- run: brew install python-setuptools
- run: brew install numworks/tap/epsilon-sdk
- uses: actions/checkout@v5
with:
submodules: 'recursive'
- run: make -j2 PLATFORM=simulator
- run: make -j2 PLATFORM=simulator ARCH=x86_64 test.bin
- run: output/release/simulator/macos/x86_64/test.bin --headless
- uses: actions/upload-artifact@v4
with:
name: epsilon-macos.zip
path: output/release/simulator/macos/epsilon.app
- if: ${{ github.event_name == 'push' && github.ref_name == 'upsilon-dev' && github.repository == 'UpsilonNumworks/Upsilon' }}
uses: actions/checkout@v5
with:
repository: Yaya-Cout/Upsilon-binfiles
ref: 'main'
token: ${{ secrets.PAT_UPSILON_BINFILES }}
path: 'binfiles'
# TODO: Handle git conflicts using rebase
- name: Upload binary files to website
if: ${{ github.event_name == 'push' && github.ref_name == 'upsilon-dev' && github.repository == 'UpsilonNumworks/Upsilon'}}
run: |
cp -r output/release/simulator/macos/epsilon.app binfiles/binaries/dev/simulator
cd binfiles
git add -A
git config --global user.email "ci@github.com"
git config --global user.name "GitHub Upsilon CI"
git pull
git commit -m "Update from CI"
git push
ios:
if: github.event.inputs.triggerIos == 'yes' || github.event.inputs.triggerIos == ''
runs-on: macos-14
steps:
- run: brew install python-setuptools
- run: brew install numworks/tap/epsilon-sdk
- uses: actions/checkout@v5
with:
submodules: 'recursive'
- run: make -j2 PLATFORM=simulator TARGET=ios EPSILON_TELEMETRY=0
- run: make -j2 PLATFORM=simulator TARGET=ios EPSILON_TELEMETRY=0 APPLE_PLATFORM=ios-simulator
- uses: actions/upload-artifact@v4
with:
name: epsilon-ios.ipa
path: output/release/simulator/ios/epsilon.ipa
- if: ${{ github.event_name == 'push' && github.ref_name == 'upsilon-dev' && github.repository == 'UpsilonNumworks/Upsilon' }}
uses: actions/checkout@v5
with:
repository: Yaya-Cout/Upsilon-binfiles
ref: 'main'
token: ${{ secrets.PAT_UPSILON_BINFILES }}
path: 'binfiles'
# TODO: Handle git conflicts using rebase
- name: Upload binary files to website
if: ${{ github.event_name == 'push' && github.ref_name == 'upsilon-dev' && github.repository == 'UpsilonNumworks/Upsilon'}}
run: |
cp -r output/release/simulator/ios/epsilon.ipa binfiles/binaries/dev/simulator
cd binfiles
git add -A
git config --global user.email "ci@github.com"
git config --global user.name "GitHub Upsilon CI"
git pull
git commit -m "Update from CI"
git push
env:
ACCEPT_OFFICIAL_TOS: 1

View File

@@ -1,38 +1,45 @@
name: Metrics
on: [pull_request]
on: [pull_request_target]
jobs:
binary-size:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04-arm
steps:
- name: Install dependencies
run: sudo apt-get install build-essential imagemagick libfreetype6-dev libjpeg-dev libpng-dev pkg-config
- name: Install ARM toolchain
uses: numworks/setup-arm-toolchain@v1
run: sudo apt-get install gcc-arm-none-eabi binutils-arm-none-eabi
- name: Checkout PR base
uses: actions/checkout@v2
uses: actions/checkout@v5
with:
submodules: recursive
ref: ${{ github.event.pull_request.base.sha }}
path: base
- name: Build base
run: make -j2 -C base epsilon.elf
run: make -j2 -C base MODEL=n0110 epsilon.elf
- name: Checkout PR head
uses: actions/checkout@v2
uses: actions/checkout@v5
with:
submodules: recursive
ref: ${{ github.event.pull_request.head.sha }}
path: head
- name: Build head
run: make -j2 -C head epsilon.elf
run: make -j2 -C head MODEL=n0110 epsilon.elf
- name: Retrieve binary size analysis
id: binary_size
run: echo "::set-output name=table::$(python3 head/build/metrics/binary_size.py base/output/release/device/n0110/epsilon.elf head/output/release/device/n0110/epsilon.elf --labels Base Head --sections .text .rodata .bss .data --custom 'Total (RAM)' .data .bss --custom 'Total (ROM)' .text .rodata .data --escape)"
- name: Prepare comment auth
run: echo "::set-env name=GITHUB_TOKEN::$(echo YjgxYTk1YTQ4YzYxNjU4ZTA3YWQzNDYwNTk3ZTI2MTlkODU5MThlOQo= | base64 --decode)"
run: |
table="$(python3 head/build/metrics/binary_size.py base/output/release/device/n0110/epsilon.elf head/output/release/device/n0110/epsilon.elf --labels Base Head --sections .text .rodata .bss .data --custom 'Total (RAM)' .data .bss --custom 'Total (ROM)' .text .rodata .data --escape)"
{
echo 'table<<EOF'
echo "${table//%0A/$'\n'}"
echo EOF
} >> "$GITHUB_ENV"
- name: Add comment
uses: actions/github@v1.0.0
env:
GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }}
uses: actions/github-script@v8
with:
args: comment ${{ steps.binary_size.outputs.table }}
script: |
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number,
body: `${{ env.table }}`,
});

4
.gitignore vendored
View File

@@ -6,3 +6,7 @@ epsilon.map
.vscode
.DS_Store
.gradle
.idea/
.vs
.cache/
compile_commands.json

View File

@@ -1,26 +0,0 @@
image: gcc
stages:
- build
job:build:
stage: build
before_script:
- "echo 'deb http://httpredir.debian.org/debian jessie main contrib \n deb-src http://httpredir.debian.org/debian jessie main contrib \n deb http://httpredir.debian.org/debian jessie-updates main contrib \n deb-src http://httpredir.debian.org/debian jessie-updates main contrib \n deb http://security.debian.org/ jessie/updates main contrib \n deb-src http://security.debian.org/ jessie/updates main contrib ' > /etc/apt/source.list"
- "apt-get update"
- "apt -y install build-essential git imagemagick libx11-dev libxext-dev libfreetype6-dev libpng-dev libjpeg-dev pkg-config fltk1.3-dev gcc-arm-none-eabi nodejs npm"
- "git submodule update --init --recursive"
- "git clone https://github.com/RedGl0w/omega-auto-increment"
- "cd omega-auto-increment"
- "npm i request exeq"
- "PrivateToken=$PrivateToken node index.js"
- "cd .."
script:
- make clean
- make MODEL=n0100 epsilon.bin
artifacts:
paths:
- output/release/device/n0100/epsilon.bin
- omega-auto-increment/version.txt
name: artifact:build:simulator

11
.gitmodules vendored
View File

@@ -1,9 +1,6 @@
[submodule "apps/rpn"]
path = apps/rpn
url = https://github.com/Omega-Numworks/Omega-RPN.git
[submodule "apps/atom"]
path = apps/atom
url = https://github.com/Omega-Numworks/Omega-Atom.git
[submodule "themes"]
path = themes
url = https://github.com/Omega-Numworks/Omega-Themes.git
url = https://github.com/UpsilonNumworks/Upsilon-RPN.git
[submodule "apps/atomic"]
path = apps/atomic
url = https://github.com/UpsilonNumworks/atomic

View File

@@ -12,16 +12,40 @@ include build/toolchain.$(TOOLCHAIN).mak
include build/variants.mak
include build/helpers.mk
ifeq (${MODEL}, n0110)
apps_list = ${EPSILON_APPS}
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 ($(filter reader,$(apps_list)),)
HAS_READER := 1
endif
# Remove the external apps for the n0100
ifeq (${MODEL}, n0100)
apps_list = $(foreach i, ${EPSILON_APPS}, $(if $(filter external, $(i)),,$(i)))
else
apps_list = $(foreach i, ${EPSILON_APPS}, $(if $(filter external, $(i)),,$(i)))
apps_list = ${EPSILON_APPS}
endif
ifdef FORCE_EXTERNAL
apps_list = ${EPSILON_APPS}
endif
ifeq ($(INCLUDE_ULAB), 1)
SFLAGS += -DINCLUDE_ULAB
endif
ifdef HOME_DISPLAY_EXTERNALS
ifneq ($(filter external,$(apps_list)),)
SFLAGS += -DHOME_DISPLAY_EXTERNALS
@@ -69,6 +93,7 @@ help:
@echo " make PLATFORM=simulator TARGET=web"
@echo " make PLATFORM=simulator TARGET=windows"
@echo " make PLATFORM=simulator TARGET=3ds"
@echo " make PLATFORM=simulator TARGET=fxcg"
.PHONY: doc
doc:
@@ -82,7 +107,7 @@ print-%:
@echo $*\'s origin is $(origin $*)
# Since we're building out-of-tree, we need to make sure the output directories
# are created, otherwise the receipes will fail (e.g. gcc will fail to create
# are created, otherwise the recipes will fail (e.g. gcc will fail to create
# "output/foo/bar.o" because the directory "output/foo" doesn't exist).
# We need to mark those directories as precious, otherwise Make will try to get
# rid of them upon completion (and fail, since those folders won't be empty).
@@ -103,6 +128,7 @@ ifndef USE_LIBA
endif
ifeq ($(USE_LIBA),0)
include liba/Makefile.bridge
include libaxx/Makefile.bridge
else
SFLAGS += -ffreestanding -nostdinc -nostdlib
include liba/Makefile
@@ -114,6 +140,7 @@ include poincare/Makefile
include python/Makefile
include escher/Makefile
# Executable Makefiles
include bootloader/Makefile
include apps/Makefile
include build/struct_layout/Makefile
include build/scenario/Makefile
@@ -186,3 +213,13 @@ clean_run: cleanandcompile
.PHONY: run
run: compile
${MAKE} start
.PHONY: translations
translations:
@echo "TRANSLATIONS"
$(Q) ${PYTHON} build/utilities/translate.py
.PHONY: translations_clean
translations_clean:
@echo "TRANSLATIONS CLEAN"
$(Q) ${PYTHON} build/utilities/translations_clean.py

507
README.fr.md Normal file
View File

@@ -0,0 +1,507 @@
<p align="center"><img src="https://github.com/Laporte12974/UpsilonDesign/blob/89a15953ae128aef8aa7d066dcaaf8d5c70f02a5/UPSILogo.png" /></p>
<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://github.com/UpsilonNumworks/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/>
<a href="https://discord.gg/sbGvhWETAd"><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>
> Don't understand French ? Speak English ? here's the [english README](./README.md) !
## À propos
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éés par les utilisateurs pour NumWorks, même après l'arrêt du projet initial.
### Quelques fonctionnalités supplémentaires
- Un module Python Kandinsky amélioré
- Un support pour fonds d'écrans personnalisés
- Des applications externes
- Un thème Upsilon
- La surcharge des opérateurs en Python
- Un tableau périodique légèrement amélioré
- 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
### Site web
Rendez-vous sur le [site d'Upsilon](https://getupsilon.web.app/) à la section "Installer".
Si votre calculatrice est reconnue, qu'elle contient une version d'Epsilon inférieure à 16 et que votre navigateur accepte WebUSB, la page vous proposera d'installer Upsilon.
Ne débranchez votre calculatrice qu'une fois l'installation terminée.
### Manuelle
*Vous pouvez vous référer à ce [site internet](https://www.numworks.com/resources/engineering/software/build/) pour la première étape si vous avez des erreurs*
### 1. Installation du SDK
<br>
<details>
<summary><b>1.1 Linux</b></summary>
<br>
<details>
<summary>Debian ou Ubuntu</summary>
<br>
Il suffit juste d'installer les dépendances en tapant ces commandes dans un terminal en mode super-utilisateur.
```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
```
C'est fait ! Vous pouvez aller à l'étape 2.
<br>
</details>
<details>
<summary>Fedora</summary>
<br>
Installez toutes les dépendances grâce à cette commande :
```bash
dnf install make automake gcc gcc-c++ kernel-devel git ImageMagick libX11-devel libXext-devel freetype-devel libpng-devel libjpeg-devel pkg-config arm-none-eabi-gcc-cs arm-none-eabi-gcc-cs-c++
```
<br>
</details>
<details>
<summary>Nix/Nixos</summary>
<br>
Installez toutes les dépendances grâce à cette commande :
```bash
nix-env -p gcc libpng libjpeg xorg.libX11 pkg-config freetype xorg.libXext python3 imagemagick python310Packages.lz4 python310Packages.pypng python310Packages.pypng gcc-arm-embedded
```
<br>
</details>
</details>
<details>
<summary><b>1.2 Mac</b></summary>
<br>
Il est recommandé d'utiliser [Homebrew](https://brew.sh/). Une fois installé, utilisez :
```bash
brew install numworks/tap/epsilon-sdk
```
Et toutes les dépendances seront installées.
<br>
Vous pouvez aller à l'étape 2.
<br>
</details>
<details>
<summary><b>1.3 Windows</b></summary>
[Git](http://git-scm.com) doit être installé.
<br>
<details>
<summary>Avec Msys2/Mingw (Supportés par NumWorks bien qu'il y ait beaucoup de bugs)</summary>
L'environnement de compilation [Msys2](https://www.msys2.org/) est recommandé par NumWorks pour obtenir la plupart des outils requis facilement. C'est ici que vous allez copier-coller toutes les commandes de ce tutoriel. Une fois installé, copiez-collez ces deux commandes dans le 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
```
Ensuite, vous devrez installer [GCC toolchain for ARM](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads). Quand il vous est demandé de choisir un dossier d'installation, choisissez `C:\msys64\home\User\gcc-arm\`. Il vous faudra ensuite ajouter ce dossier à votre $PATH. Tapez juste:
```bash
echo "export PATH=$PATH:$HOME/gcc-arm/bin" >> .bashrc
```
Redémarrez votre terminal et vous pouvez aller à l'étape 2!
</details>
<details>
<summary>Avec WSL 2</summary>
WSL est un système qui virtualise un environnement GNU/Linux dans Windows.
Votre version de Windows doit être >= 1903.
#### Installation de WSL
1. Apuyez simultanément sur les touches "Windows" et "X" puis cliquez sur "PowerShell Administrateur". Entrez ensuite ceci dans la nouvelle fenêtre:
```powershell
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
```
Cette commande active WSL
```powershell
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
```
Cette commande permet d'autoriser le démarrage des machines signées par Microsoft.
2. Redémarrez votre ordinateur.
3. Téléchargez [ce fichier](https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi) et suivez les instructions d'installation.
4. Ouvrez votre fenêtre PowerShell comme avant et tapez:
```powershell
wsl --set-default-version 2
```
5. Téléchargez [Ubuntu](https://www.microsoft.com/store/apps/9n6svws3rx71) depuis le Microsoft store. Vous pouvez aussi installer [Debian](https://www.microsoft.com/store/productI9MSVKQC78PK6) à la place.
WSL est maintenant installé.
6. Installez maintenant la version pour ARM de GCC.
```bash
sudo apt-get update
sudo 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
```
### Installation d'usbipd pour connecter la calculatrice à WSL (facultatif)
Pour connecter la calculatrice, il faut installer cet [outil](hthttps://github.com/dorssel/usbipd-win/releases/download/v5.0.0/usbipd-win_5.0.0_x64.msi). Il permet de connecter des périphériques par Internet. Suivez les instructions pour l'installer.
#### Ubuntu
1. Dans un terminal WSL Ubuntu, tapez :
```bash
sudo apt install linux-tools-generic hwdata
```
<!-- 2. Editez /etc/sudoers pour que l'on puisse utiliser la commande usbip. Sur Ubuntu, cela est fait de cette manière :
```bash
sudo visudo
```
3. Ajoutez `/usr/lib/linux-tools/5.4.0-77-generic` au début du secure_path. Après édition, la ligne devrait ressembler à:
`Defaults secure_path="/usr/lib/linux-tools/5.4.0-77-generic:/usr/local/sbin:..."` -->
#### Debian
1.Si vous utilisez Debian, lancez cette commande:
```bash
sudo apt install usbip hwdata usbutils
```
### Pour connecter la calculatrice à WSL
1. Ouvrez à nouveau un PowerShell en mode administrateur et tapez :
```powershell
usbipd list
```
Ceci va lister les périphériques USB connectés à l'ordinateur. Regardez le BUSID de votre "Numworks Calculator".
2. Maintenant, lancez cette commande en remplaçant <BUSID> par celui de votre calculatrice :
```powershell
usbipd bind --busid <BUSID>
usbipd attach --wsl --busid <BUSID>
```
Le mot de passe de votre machine WSL vous sera demandé.
Vous pouvez aller à l'étape 2.
</details>
</details>
<br>
### 2. Récupérer le code source
Le code source est disponible dans une repository git. Récupérez-le de cette manière :
```bash
git clone --recursive https://github.com/UpsilonNumworks/Upsilon.git
cd Upsilon
git checkout upsilon-dev
```
<br>
### 3. Choisissez le système à compiler
<details>
<summary><b>Model n0100</b></summary>
(note: vous pouvez changer l'argument `EPSILON_I18N=en` avec `fr`, `nl`, `pt`, `it`, `de`, `es` or `hu`).
```bash
make MODEL=n0100 clean
make MODEL=n0100 EPSILON_I18N=en OMEGA_USERNAME="{Votre nom, maximum 15 caractères}" -j4
```
Maintenant, lancez soit:
```bash
make MODEL=n0100 epsilon_flash
```
pour directement flasher la calculatrice après avoir appuyé simultanément sur `reset` et `6` et avoir branché la calculatrice à l'ordinateur.
<br>
soit:
```bash
make MODEL=n0100 OMEGA_USERNAME="" binpack -j4
```
pour compiler les binpacks que vous pouvez distribuer et flasher depuis le [WebDFU de TI-Planet](https://ti-planet.github.io/webdfu_numworks/n0100/).
</details>
<details>
<summary><b>Model n0110</b></summary>
Le bootloader vous permet d'installer 2 firmwares dans des "slots" séparés. Dans ce cas les applications externes ne pourront pas utiliser toute la mémoire mais la moitié. Si un seul slot est utilisé, le bootloader permettra d'utiliser toute la mémoire. Sans bootloader, les apps externes peuvent utiliser toute la mémoire.
<details>
<summary>Bootloader</summary>
Votre calculatrice doit être flashé avec le bootloader d'[Upsilon](https://getupsilon.web.app) ou d'[Omega](https://getomega.dev).
Compilez avec:
```bash
make clean
make OMEGA_USERNAME="{Votre nom, max 15 caractères}" -j4
```
Ensuite lancez soit:
```bash
make epsilon.A_flash
```
pour flasher le slot actuel ou pour flasher par le flasher du booloader avec RESET, puis 4 (flash) et 1 (flash slots) pour flasher n'importe quel slot.
<br>
soit:
```bash
make OMEGA_USERNAME="{Votre nom, max 15 caractères}" binpack -j4
```
pour compiler les binpacks que vous pouvez distribuer et flasher depuis le [WebDFU de TI-Planet](https://ti-planet.github.io/webdfu_numworks/n0100/). Vous les trouverez dans `output/release/device/bootloader/`.
</details>
<details>
<summary>Model n0110 sans bootloader (obsolète, utilisez le bootloader à la place pour la protection contre Epsilon)</summary>
Compilez avec:
```bash
make MODEL=n0110 clean
make MODEL=n0110 OMEGA_USERNAME="{Votre nom, max 15 caractères}" -j4
```
Ensuite lancez soit:
```bash
make MODEL=n0110 epsilon_flash
```
pour directement flasher la calculatrice après avoir appuyé simultanément sur `RESET` et `6` et avoir branché la calculatrice à l'ordinateur.
<br>
soit:
```bash
make MODEL=n0110 OMEGA_USERNAME="{Votre nom, max 15 caractères}" binpack -j4
```
pour compiler les binpacks que vous pouvez distribuer et flasher depuis le [WebDFU de TI-Planet](https://ti-planet.github.io/webdfu_numworks/n0100/). Vous les trouverez dans `output/release/device/n0110/`.
</details>
</details>
<details>
<summary><b>Simulateur Natif</b></summary>
Lancez cette commande:
```bash
make clean
```
Vous pouvez soit choisir d'utiliser la commmande qui détectera automatiquement votre plateforme:
```bash
make PLATFORM=simulator
```
Ou choisir une commande qui correspond à votre plateforme:
```bash
make PLATFORM=simulator TARGET=android
make PLATFORM=simulator TARGET=ios
make PLATFORM=simulator TARGET=macos
make PLATFORM=simulator TARGET=web
make PLATFORM=simulator TARGET=windows
make PLATFORM=simulator TARGET=3ds
```
Vous trouverez les fichiers du simulateur dans `output/release/simulator/`.
</details>
<details>
<summary><b>Simulateur web</b></summary>
D'abord, installez emsdk :
```bash
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install 1.40.1
./emsdk activate 1.40.1
source emsdk_env.sh
```
Puis, compilez Upsilon :
```bash
make clean
make PLATFORM=simulator TARGET=web OMEGA_USERNAME="{Votre nom, maximum 15 caractères}" -j4
```
Le simulateur se trouve dans `output/release/simulator/web/simulator.zip`
</details>
<details>
<summary><b>Simulateur Android</b></summary>
Assurez-vous d'avoir JDK 25 d'installé.
Ensuite, téléchargez la toolchain Android version r21e comme suit :
```
export ANDROID_HOME=$PWD/android-sdk
wget -nv https://gitlab.com/fdroid/sdkmanager/-/raw/master/sdkmanager.py
python3 sdkmanager.py --licenses
python3 sdkmanager.py --install "ndk-bundle;r21e"
```
Il ne vous reste plus qu'à lancer cette commande pour compiler Upsilon.
```
make -j$(nproc) PLATFORM=simulator TARGET=android
```
Le fichier compilé nommé `epsilon.apk` sera celui à installer sur le téléphone depuis votre gestionnaire de fichier. Fonctionne normalement à partir de Android 4.
</details>
<details>
<summary><b>Simulateur pour 3DS</b></summary>
Il vous faut devkitPro et devkitARM installés et dans votre path (les instructions sont [ici](https://devkitpro.org/wiki/Getting_Started))
```bash
git clone --recursive https://github.com/UpsilonNumworks/Upsilon.git
cd Upsilon
git checkout --recursive upsilon-dev
make PLATFORM=simulator TARGET=3ds -j
```
Vous pouvez ensuite mettre epsilon.3dsx sur une carte SD pour le lancer depuis le HBC ou utilisez 3dslink pour le lancer via le réseau:
```bash
3dslink output/release/simulator/3ds/epsilon.3dsx -a <3DS' IP ADDRESS>
```
</details>
<br>
Important: n'oubliez pas l'argument `--recursive` parce qu'Upsilon dépend de submodules.
Aussi, vous pouvez changer le nombre de processus de compilation en parallèles en changeant le nombre après l'argument `-j`.
N'oubliez pas de mettre votre nom à la place `{Votre nom, maximum 15 caractères}`. Si vous n'en voulez pas, enlevez l'argument `OMEGA_USERNAME`.
Si vous avez besoin d'aide, n'hésitez pas à rejoindre notre serveur Discord : <https://discord.gg/Q9buEMduXG>
<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://upsilonnumworks.github.io/Upsilon-External/)
- [Documentation d'Ulab](https://micropython-ulab.readthedocs.io/en/latest/)
## Contribution
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.
## 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 Website](https://github.com/Omega-Numworks/Omega-Website)
- [Omega RPN `APP`](https://github.com/Omega-Numworks/Omega-RPN)
- [Omega Atomic `APP`](https://github.com/Omega-Numworks/Omega-Atomic)
- [Omega Design](https://github.com/Omega-Numworks/Omega-Design)
- [Omega Discord Bot](https://github.com/Omega-Numworks/Omega-Discord-Bot)
- [Omega App Template `BETA`](https://github.com/Omega-Numworks/Omega-App-Template)
- [External Apps](https://github.com/Omega-Numworks/External-Apps)
## À 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érieures.
Vous pouvez essayer Epsilon depuis votre navigateur sur le [simulateur en ligne](https://www.numworks.com/simulator/).
## Licence
NumWorks est une marque déposée de NumWorks SAS, 24 Rue Godot de Mauroy, 75009 Paris, France.
Nintendo et Nintendo 3DS sont des marques déposées de Nintendo of America Inc, 4600 150th Ave NE, Redmond, WA 98052, Etats-Unis.
NumWorks SAS et Nintendo of America Inc ne sont en aucun cas associés avec ce projet.
- NumWorks Epsilon est disponible sous [licence CC BY-NC-SA](https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode.fr).
- Omega est disponible sous [licence CC BY-NC-SA](https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode.fr).
- Upsilon est disponible sous [licence CC BY-NC-SA](https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode.fr).

535
README.md
View File

@@ -1,166 +1,521 @@
<p align="center"><img src="https://user-images.githubusercontent.com/12123721/87953533-75a22380-caab-11ea-8cde-c40291c4a9ae.png" /></p>
<p align="center"><img src="https://github.com/Laporte12974/UpsilonDesign/blob/89a15953ae128aef8aa7d066dcaaf8d5c70f02a5/UPSILogo.png" /></p>
<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://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/UpsilonNumworks/Upsilon/issues"><img alt="Issues" src="https://img.shields.io/github/issues/UpsilonNumworks/Upsilon.svg?labelColor=292929&logo=git&style=for-the-badge" /></a>
<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/hnEqPzAJzn"><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>
> 🇫🇷 Vous ne comprenez pas l'anglais ? Vous êtes francophone ? Regardez le [*LISEZ-MOI* français](./README.fr.md) ! 🇫🇷
## 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!).
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
- Adding symbolic calculation back into the calculator
- An app for RPN
- A periodic table app + all of the molar masses for the elements in the toolbox
- More steps for brightness (16 instead of 5)
- ~~32 KB Python heap instead of 16 KB~~ Now available on Epsilon `>=13.2.0`!
- And more...
### Some new features
The main new features are listed [here](https://github.com/Omega-Numworks/Omega/wiki/Main-features), and the complete changelog can be found [here](https://github.com/Omega-Numworks/Omega/wiki/Changelog).
- Enhancements for the Kandinsky python module
- Support for wallpapers
- External apps
- A custom theme
- Operator overload for python
- Improvements for the Periodic table application
- *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
### Automatic
### Installer
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>
Go to the [Upsilon website](https://getupsilon.web.app/) to the "Install" section.
If your calculator is recognized, contains a version of Epsilon lower than 16 and your browser accepts WebUSB, the page will suggest you to install Upsilon.
Do not disconnect your calculator until the installation is complete.
### Manual
First of all, follow **step 1** [here](https://www.numworks.com/resources/engineering/software/build/). Then:
*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>Model n0100</b></summary>
<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>
To install all dependencies:
```bash
dnf install make automake gcc gcc-c++ kernel-devel git ImageMagick libX11-devel libXext-devel freetype-devel libpng-devel libjpeg-devel pkg-config arm-none-eabi-gcc-cs arm-none-eabi-gcc-cs-c++
```
<br>
</details>
<details>
<summary>Nix or Nixos</summary>
<br>
To install all dependencies:
```bash
nix-shell -p gcc libpng libjpeg xorg.libX11 pkg-config freetype xorg.libXext python3 imagemagick python310Packages.lz4 python310Packages.pypng python310Packages.pypng gcc-arm-embedded
```
<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>
<details>
<summary>With Msys2/Mingw (officialized by NumWorks but with a lot of bugs)</summary>
[Msys2](https://www.msys2.org/) environment is recommended by NumWorks 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 terminal and you can go to step 2!
</details>
<details>
<summary>With WSL 2</summary>
You need a Windows version >= 1903.
#### WSL Installation
1. Use simultaneously Win + X keys and then click on "admin powershell".
```powershell
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
```
This command activate WSL functionalities.
```powershell
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
```
This one allows virtual machines developed by Microsoft.
2. Restart your computer.
3. Download [this file](https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi) and follow instructions.
4. Now open powershell admin like before and type:
```powershell
wsl --set-default-version 2
```
5. Download [Ubuntu](https://www.microsoft.com/store/apps/9n6svws3rx71) from Microsoft store.
WSL is now installed.
6. Then Install GCC cross compiler for ARM. In your Ubuntu teminal, run:
<!-- TODO: Test if `wsl --install` works better, and if WSL2 has not became the
default -->
```bash
sudo apt-get update
sudo 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
```
### Usbipd installation to connect your calculator
If you want to connect to the calculator, you have to connect to install this
[tool](https://github.com/dorssel/usbipd-win/releases/download/v5.0.0/usbipd-win_5.0.0_x64.msi).
This will allow you to connect WSL to the calculator through internet. Follow
the on screen information to install.
#### Ubuntu
1. In a WSL Ubuntu command prompt, type:
```bash
sudo apt install linux-tools-generic hwdata
```
<!-- 2. Edit /etc/sudoers so that root can find the usbip command. On Ubuntu, run this command.
```bash
sudo visudo
```
3. Add `/usr/lib/linux-tools/5.4.0-77-generic` to the beginning of secure_path. After editing, the line should look similar to this.
`Defaults secure_path="/usr/lib/linux-tools/5.4.0-77-generic:/usr/local/sbin:..."` -->
#### Debian
1. If you use Debian for your WSL distro, use this command instead:
```bash
sudo apt install usbip hwdata usbutils
```
And that's all for installation and set up.
### To connect your calculator
1. Open an admin PowerShell and type:
```powershell
usbipd list
```
This will list your USB devices connected. Look at the BUSID column and remember the one for your calculator (it should be called "Numworks Calculator").
2. Now run this command replacing `<BUSID>` by your calculator's USB port id:
```powershell
usbipd bind --busid <BUSID>
usbipd attach --wsl --busid <BUSID>
```
git clone --recursive https://github.com/Omega-Numworks/Omega.git
cd Omega
git checkout omega-master
It will ask you to type your WSL's password and will connect your calculator to WSL.
You can now go to step 2!
</details>
</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/UpsilonNumworks/Upsilon.git
cd Upsilon
git checkout upsilon-dev
```
<br>
### 3. Choose the target
<details>
<summary><b>Model n0100</b></summary>
(note: you can change the `EPSILON_I18N=en` flag to `fr`, `nl`, `pt`, `it`, `de`, `es` or `hu`).
```bash
make MODEL=n0100 clean
make MODEL=n0100 OMEGA_USERNAME="{Your name, max 15 characters}" -j4
make MODEL=n0100 EPSILON_I18N=en OMEGA_USERNAME="{Your name, max 15 characters}" -j$(nproc)
```
Now, run either:
```bash
make MODEL=n0100 epsilon_flash
```
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.
to directly flash the calculator after pressing simultaneously `reset` and `6` buttons and plugging in.
<br>
or:
```bash
make MODEL=n0100 OMEGA_USERNAME="" binpack -j$(nproc)
```
to make binpack which you can flash to the calculator 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>
<summary><b>Model n0110</b></summary>
```
git clone --recursive https://github.com/Omega-Numworks/Omega.git
cd Omega
git checkout omega-master
<summary><b>Model n0110</b></summary>
The bootloader allows you to install 2 firmwares in separated "slots". If so, external apps won't have all the space but half. Bootloader will allow use of all of the memory if only one slot is flashed. In legacy mode, external apps use all the space available.
<details>
<summary>Bootloader</summary>
Your calculator must already have been flashed with [Upsilon](https://getupsilon.web.app)'s or [Omega](https://getomega.dev)'s bootloader.
Then, build with:
```bash
make clean
make OMEGA_USERNAME="{Your name, max 15 characters}" -j4
make epsilon_flash
make OMEGA_USERNAME="{Your name, max 15 characters}" -j$(nproc)
```
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.
Now, run either:
```bash
make epsilon.A_flash
```
to directly flash the calculator into the current slot, or thought bootloader's slot flasher with RESET, then 4 (flash), and 1 (flash slots) for other slots.
<br>
or:
```bash
make OMEGA_USERNAME="" binpack -j$(nproc)
```
to make binpack which you can flash to the calculator from [TI-Planet's webDFU](https://ti-planet.github.io/webdfu_numworks/n0110/). You'll find them at `output/release/device/bootloader/`. Binpacks are a great way to share a custom build of Upsilon to friends.
</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/)).
<details>
<summary>Model N0110 legacy (deprecated, use bootloader instead for Epsilon protection)</summary>
```bash
make MODEL=n0110 clean
make MODEL=n0110 OMEGA_USERNAME="{Your name, max 15 characters}" -j$(nproc)
```
git clone --recursive https://github.com/Omega-Numworks/Omega.git
cd Omega
git checkout omega-master
Now, run either:
```bash
make MODEL=n0110 epsilon_flash
```
to directly flash the calculator after pressing simultaneously `reset` and `6` buttons and plugging in.
<br>
or:
```bash
make MODEL=n0110 OMEGA_USERNAME="" binpack -j$(nproc)
```
to make binpack which you can flash to the calculator from [Ti-Planet's WebDFU](https://ti-planet.github.io/webdfu_numworks/n0110/). You'll find them at `output/release/device/bootloader/`. Binpacks are a great way to share a custom build of Upsilon to friends.
</details>
</details>
<details>
<summary><b>Native simulator</b></summary>
Run this command:
```bash
make clean
make MODEL=n0100 OMEGA_USERNAME="" -j8
make MODEL=n0100 OMEGA_USERNAME="" binpack -j8
make OMEGA_USERNAME="" -j8
make OMEGA_USERNAME="" binpack -j8
```
You can either build using the following command that will automatically detect your platform:
```bash
make PLATFORM=simulator
```
or, choose the command corresponding to your platform:
```bash
make PLATFORM=simulator TARGET=android
make PLATFORM=simulator TARGET=ios
make PLATFORM=simulator TARGET=macos
make PLATFORM=simulator TARGET=web
make PLATFORM=simulator TARGET=windows
make PLATFORM=simulator TARGET=3ds
```
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.
You'll find simulator files in `output/release/simulator/`.
</details>
<details>
<summary><b>Web simulator</b></summary>
<summary><b>Web simulator</b></summary>
First, install emsdk :
```
```bash
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install latest-fastcomp
./emsdk activate latest-fastcomp
./emsdk install 1.40.1
./emsdk activate 1.40.1
source emsdk_env.sh
```
Then, compile Omega :
Then, compile Upsilon :
```
git clone --recursive https://github.com/Omega-Numworks/Omega.git
cd Omega
git checkout omega-master
```bash
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}" -j$(nproc)
```
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>
<summary><b>3DS Simulator</b></summary>
<summary><b>3DS Simulator</b></summary>
You need devkitPro and devkitARM installed and in your path (instructions [here](https://devkitpro.org/wiki/Getting_Started))
```bash
git clone --recursive https://github.com/UpsilonNumworks/Upsilon.git
cd Upsilon
git checkout upsilon-dev
make PLATFORM=simulator TARGET=3ds -j$(nproc)
```
git clone --recursive https://github.com/Omega-Numworks/Omega.git
cd Omega
git checkout --recursive omega-dev
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:
```
```bash
3dslink output/release/simulator/3ds/epsilon.3dsx -a <3DS' IP ADDRESS>
```
</details>
If you need help, you can join our Discord server here : https://discord.gg/X2TWhh9
<details>
<summary><b>Android Simulator</b></summary>
Make sure you have JDK 25 installed.
Then, download the Android toolchain r21e as following :
```
export ANDROID_HOME=$PWD/android-sdk
wget -nv https://gitlab.com/fdroid/sdkmanager/-/raw/master/sdkmanager.py
python3 sdkmanager.py --licenses
python3 sdkmanager.py --install "ndk-bundle;r21e"
```
All you have to do is run this command to compile Upsilon.
```
make -j$(nproc) PLATFORM=simulator TARGET=android
```
The compiled file named `epsilon.apk` will be the one to install on the phone from your file manager. Shoudl work on Android 4.1+.
</details>
<details>
<summary><b>Casio fx-CG-series Port</b></summary>
First, install gint and fxsdk along with a cross compiler for the calculator. There are instructions for this (in French, but Google Translate works well enough) [here](https://www.planet-casio.com/Fr/forums/topic16614-last-giteapc-installer-et-mettre-a-jour-automatiquement-des-projets-gitea.html).
Next:
```bash
git clone --recursive https://github.com/UpsilonNumworks/Upsilon.git
cd Omega
git checkout upsilon-dev
make PLATFORM=simulator TARGET=fxcg -j$(nproc)
```
Then copy the file at `./output/release/simulator/fxcg/epsilon.g3a` to the calculator over USB.
</details>
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>
<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>
---
## Useful links
- [Upsilon external (to install additional apps and wallpapers)](https://upsilonnumworks.github.io/Upsilon-External/)
- [Ulab documentation](https://micropython-ulab.readthedocs.io/en/latest/)
## Contributing
To contribute, please refer to the [Wiki](https://github.com/Omega-Numworks/Omega/wiki/Contributing)
## Branches
* `omega-master` : stable releases
* `omega-dev` : beta releases
* `omega-hotfix` : developers only, branch to fix issues
To contribute, please refer to [Omega's Wiki](https://github.com/Omega-Numworks/Omega/wiki/Contributing), the same rules apply here.
## Related repositories
* [Omega Themes](https://github.com/Omega-Numworks/Omega-Themes)
* [Omega Website](https://github.com/Omega-Numworks/Omega-Website)
* [Omega RPN `APP`](https://github.com/Omega-Numworks/Omega-RPN)
* [Omega Atom `APP`](https://github.com/Omega-Numworks/Omega-Atom)
* [Omega Design](https://github.com/Omega-Numworks/Omega-Design)
* [Omega App Template `BETA`](https://github.com/Omega-Numworks/Omega-App-Template)
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 Website](https://github.com/Omega-Numworks/Omega-Website)
- [Omega RPN `APP`](https://github.com/Omega-Numworks/Omega-RPN)
- [Omega Atomic `APP`](https://github.com/Omega-Numworks/Omega-Atomic)
- [Omega Design](https://github.com/Omega-Numworks/Omega-Design)
- [Omega Discord Bot](https://github.com/Omega-Numworks/Omega-Discord-Bot)
- [Omega App Template `BETA`](https://github.com/Omega-Numworks/Omega-App-Template)
- [External Apps](https://github.com/Omega-Numworks/External-Apps)
## 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.
You can try Epsilon straight from your browser in the [online simulator](https://www.numworks.com/simulator/).
@@ -169,7 +524,9 @@ You can try Epsilon straight from your browser in the [online simulator](https:/
NumWorks is a registered trademark of NumWorks SAS, 24 Rue Godot de Mauroy, 75009 Paris, France.
Nintendo and Nintendo 3DS are registered trademarks of Nintendo of America Inc, 4600 150th Ave NE, Redmond, WA 98052, USA.
NumWorks SAS and Nintendo of America Inc aren't associated in any shape or form with this project.
Casio is a registered trademark of Casio Computer Co., Ltd. CORPORATION JAPAN 6-2, Hon-machi 1-chome Shibuya-ku, Tokyo JAPAN 151-8543.
NumWorks SAS, Nintendo of America Inc and Casio aren't associated in any shape or form with this project.
* 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).
- 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).
- Upsilon is released under a [CC BY-NC-SA License](https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode).

View File

@@ -11,6 +11,25 @@ apps =
# (path to the apps header).
$(foreach i,${apps_list},${eval include apps/$(i)/Makefile})
app_equals = $(and $(findstring $(1),$(2)),$(findstring $(2),$(1)))
# We list all the apps that are missing
apps_missing = $(foreach i, ${apps_list}, $(if $(call app_equals, apps/$(i)/Makefile, $(wildcard apps/$(i)/Makefile)),, $(i) ) )
# If the two doesn't match, we got an error.
ifneq ($(strip $(apps_missing)),)
miss_modules = 0
# Check if the missing apps are one that are supposed to be submodules
$(foreach i, $(SUBMODULES_APPS), $(if $(call app_equals, $(filter $(i), $(apps_missing)), $(i)), $(eval miss_modules=1)))
ifeq ($(miss_modules), 1)
PLS_IGNORE := $(shell >&2 printf "\nSome submodules apps seem to be missing. To download them, assuming you git clone'd the repo, do\n")
PLS_IGNORE := $(shell >&2 printf " git submodule init\n")
PLS_IGNORE := $(shell >&2 printf " git submodule update\n\n")
endif
$(error Missing apps: $(strip $(apps_missing)))
endif
apps_src += $(addprefix apps/,\
alternate_empty_nested_menu_controller.cpp \
apps_container.cpp \
@@ -25,11 +44,13 @@ apps_src += $(addprefix apps/,\
backlight_dimming_timer.cpp \
battery_timer.cpp \
battery_view.cpp \
clock_timer.cpp \
empty_battery_window.cpp \
exam_pop_up_controller.cpp \
exam_mode_configuration_official.cpp:+official \
exam_mode_configuration_non_official.cpp:-official \
global_preferences.cpp \
host_filemanager.cpp \
i18n.py \
lock_view.cpp \
main.cpp \
@@ -38,10 +59,15 @@ apps_src += $(addprefix apps/,\
math_variable_box_empty_controller.cpp \
shift_alpha_lock_view.cpp \
suspend_timer.cpp \
timer_manager.cpp \
title_bar_view.cpp \
xnt_loop.cpp \
)
tests_src += $(addprefix apps/,\
exam_mode_configuration_non_official.cpp \
)
tests_src += apps/exam_mode_configuration_non_official.cpp
snapshots_declaration = $(foreach i,$(apps),$(i)::Snapshot m_snapshot$(subst :,,$(i))Snapshot;)
apps_declaration = $(foreach i,$(apps),$(i) m_$(subst :,,$(i));)
@@ -55,23 +81,23 @@ $(call object_for,apps/apps_container_storage.cpp apps/apps_container.cpp apps/m
# I18n file generation
# The header is refered to as <apps/i18n.h> so make sure it's findable this way
country_preferences = apps/country_preferences.csv
language_preferences = apps/language_preferences.csv
# The header is referred to as <apps/i18n.h> so make sure it's findable this way
SFLAGS += -I$(BUILD_DIR)
i18n_files += $(addprefix apps/language_,$(addsuffix .universal.i18n, $(EPSILON_I18N)))
ifeq ($(EPSILON_GETOPT),1)
i18n_files += $(addprefix apps/language_,$(addsuffix _iso6391.universal.i18n, $(EPSILON_I18N)))
endif
i18n_files += $(call i18n_with_universal_for,shared)
i18n_files += $(call i18n_without_universal_for,toolbox)
i18n_files += $(call i18n_with_universal_for,toolbox)
i18n_files += $(call i18n_without_universal_for,variables)
$(eval $(call rule_for, \
I18N, \
apps/i18n.cpp, \
$(i18n_files), \
$$(PYTHON) apps/i18n.py --codepoints $(code_points) --header $$(subst .cpp,.h,$$@) --implementation $$@ --locales $$(EPSILON_I18N) --files $$^ --generateISO6391locales $$(EPSILON_GETOPT), \
$$(PYTHON) apps/i18n.py --codepoints $(code_points) --countrypreferences $(country_preferences) --languagepreferences $(language_preferences) --header $$(subst .cpp,.h,$$@) --implementation $$@ --locales $$(EPSILON_I18N) --countries $$(EPSILON_COUNTRIES) --files $$^, \
global \
))
@@ -84,13 +110,17 @@ $(BUILD_DIR)/apps/i18n.h: $(BUILD_DIR)/apps/i18n.cpp
$(eval $(call depends_on_image,apps/title_bar_view.cpp,apps/exam_icon.png))
$(call object_for,$(apps_src) $(tests_src)): $(BUILD_DIR)/apps/i18n.h
$(call object_for,$(apps_src) $(tests_src)): $(BUILD_DIR)/apps/home/apps_layout.h
$(call object_for,$(apps_src) $(tests_src)): $(BUILD_DIR)/python/port/genhdr/qstrdefs.generated.h
apps_tests_src = $(app_calculation_test_src) $(app_code_test_src) $(app_probability_test_src) $(app_regression_test_src) $(app_sequence_test_src) $(app_shared_test_src) $(app_statistics_test_src) $(app_settings_test_src) $(app_solver_test_src)
$(call object_for,$(apps_src)): $(BUILD_DIR)/apps/home/apps_layout.h
apps_tests_src = $(app_calculation_test_src) $(app_code_test_src) $(app_graph_test_src) $(app_probability_test_src) $(app_regression_test_src) $(app_sequence_test_src) $(app_shared_test_src) $(app_statistics_test_src) $(app_settings_test_src) $(app_solver_test_src)
apps_tests_src += $(addprefix apps/,\
alternate_empty_nested_menu_controller.cpp \
global_preferences.cpp \
dummy_timer_manager.cpp \
)
ifeq ($(THEME_REPO),local)

View File

@@ -8,6 +8,8 @@
#include <ion/backlight.h>
#include <poincare/preferences.h>
#include <algorithm>
extern "C" {
#include <assert.h>
}
@@ -27,14 +29,16 @@ AppsContainer::AppsContainer() :
m_globalContext(),
m_variableBoxController(),
m_examPopUpController(this),
m_promptController(k_promptMessages, k_promptColors, k_promptNumberOfMessages),
m_promptController(k_promptMessages, k_promptFGColors, k_promptBGColors, k_promptNumberOfMessages),
m_batteryTimer(),
m_suspendTimer(),
m_backlightDimmingTimer(),
m_clockTimer(ClockTimer(this)),
m_homeSnapshot(),
m_onBoardingSnapshot(),
m_hardwareTestSnapshot(),
m_usbConnectedSnapshot()
m_usbConnectedSnapshot(),
m_startAppSnapshot()
{
m_emptyBatteryWindow.setFrame(KDRect(0, 0, Ion::Display::Width, Ion::Display::Height), false);
// #if __EMSCRIPTEN__
@@ -44,7 +48,7 @@ AppsContainer::AppsContainer() :
* poincareCircuitBreaker is run. This means either whitelisting all Epsilon
* (which makes bigger files to download and slower execution), or
* whitelisting all the symbols (that's a big amount of symbols to find and
* quite painy to maintain).
* quite paint to maintain).
* We just remove the circuit breaker for now.
* TODO: Put the Poincare circuit breaker back on epsilon's web emulator */
@@ -55,11 +59,31 @@ AppsContainer::AppsContainer() :
Poincare::Expression::SetCircuitBreaker(AppsContainer::poincareCircuitBreaker);
// #endif
Ion::Storage::sharedStorage()->setDelegate(this);
addTimer(&m_batteryTimer);
addTimer(&m_suspendTimer);
addTimer(&m_backlightDimmingTimer);
addTimer(&m_clockTimer);
}
bool AppsContainer::poincareCircuitBreaker() {
constexpr uint64_t minimalPressDuration = 20;
static uint64_t beginningOfInterruption = 0;
Ion::Keyboard::State state = Ion::Keyboard::scan();
return state.keyDown(Ion::Keyboard::Key::Back);
bool interrupt = state.keyDown(Ion::Keyboard::Key::Back) || state.keyDown(Ion::Keyboard::Key::Home) || state.keyDown(Ion::Keyboard::Key::OnOff);
if (!interrupt) {
beginningOfInterruption = 0;
return false;
}
if (beginningOfInterruption == 0) {
beginningOfInterruption = Ion::Timing::millis();
return false;
}
if (Ion::Timing::millis() - beginningOfInterruption > minimalPressDuration) {
beginningOfInterruption = 0;
return true;
}
return false;
}
App::Snapshot * AppsContainer::hardwareTestAppSnapshot() {
@@ -128,8 +152,11 @@ bool AppsContainer::dispatchEvent(Ion::Events::Event event) {
* We do it before switching to USB application to redraw the battery
* pictogram. */
updateBatteryState();
if (switchTo(usbConnectedAppSnapshot())) {
Ion::USB::DFU();
if (GlobalPreferences::sharedGlobalPreferences()->isInExamMode()) {
// If we are in exam mode, we don't switch to usb connected app
didProcessEvent = true;
} else if (switchTo(usbConnectedAppSnapshot())) {
Ion::USB::DFU(true);
// Update LED when exiting DFU mode
Ion::LED::updateColorWithPlugAndCharge();
bool switched = switchTo(activeSnapshot);
@@ -202,43 +229,91 @@ bool AppsContainer::dispatchEvent(Ion::Events::Event event) {
return didProcessEvent || alphaLockWantsRedraw;
}
// List of keys that are used to switch between apps, in order of app to go (eg. 0 : First App, 1 : Second App, 2 : Third App, ...)
static constexpr Ion::Events::Event switch_events[] = {
Ion::Events::ShiftSeven, Ion::Events::ShiftEight, Ion::Events::ShiftNine,
Ion::Events::ShiftFour, Ion::Events::ShiftFive, Ion::Events::ShiftSix,
Ion::Events::ShiftOne, Ion::Events::ShiftTwo, Ion::Events::ShiftThree,
Ion::Events::ShiftZero, Ion::Events::ShiftDot, Ion::Events::ShiftEE
};
bool AppsContainer::processEvent(Ion::Events::Event event) {
// Warning: if the window is dirtied, you need to call window()->redraw()
if (event == Ion::Events::USBPlug) {
if (Ion::USB::isPlugged()) {
// If the exam mode is enabled, we ask to disable it, else, we enable USB
if (GlobalPreferences::sharedGlobalPreferences()->isInExamMode()) {
displayExamModePopUp(GlobalPreferences::ExamMode::Off);
window()->redraw();
} else {
Ion::USB::enable();
}
// Update brightness when USB is plugged
Ion::Backlight::setBrightness(GlobalPreferences::sharedGlobalPreferences()->brightnessLevel());
} else {
// If the USB isn't plugged in USBPlug event, we disable USB
Ion::USB::disable();
}
return true;
}
// If key home or key back is pressed, we switch to the home app.
if (event == Ion::Events::Home || event == Ion::Events::Back) {
switchTo(appSnapshotAtIndex(0));
return true;
}
// If shift + Home are pressed, we switch to the first app.
if (event == Ion::Events::ShiftHome) {
switchTo(appSnapshotAtIndex(1));
return true;
}
// Iterate through the switch events to find the one that matches the event, if one match, switch to the app at the index of the switch event.
for(int i = 0; i < std::min((int) (sizeof(switch_events) / sizeof(Ion::Events::Event)), APPS_CONTAINER_SNAPSHOT_COUNT); i++) {
if (event == switch_events[i]) {
m_window.redraw(true);
switchTo(appSnapshotAtIndex(i+1));
return true;
}
}
// Add EE shortcut to go to the settings (app number 12)
if (event == Ion::Events::EE) {
switchTo(appSnapshotAtIndex(12));
return true;
}
// Add Shift + Ans shortcut to go to the previous app
if (event == Ion::Events::ShiftAns) {
switchTo(appSnapshotAtIndex(m_lastAppIndex));
return true;
}
// If the event is the OnOff key, we suspend the calculator.
if (event == Ion::Events::OnOff) {
suspend(true);
return true;
}
// If the event is a brightness event, we update the brightness according to the event.
if (event == Ion::Events::BrightnessPlus || event == Ion::Events::BrightnessMinus) {
int delta = Ion::Backlight::MaxBrightness/GlobalPreferences::NumberOfBrightnessStates;
int direction = (event == Ion::Events::BrightnessPlus) ? Ion::Backlight::NumberOfStepsPerShortcut*delta : -delta*Ion::Backlight::NumberOfStepsPerShortcut;
int NumberOfStepsPerShortcut = GlobalPreferences::sharedGlobalPreferences()->brightnessShortcut();
int direction = (event == Ion::Events::BrightnessPlus) ? NumberOfStepsPerShortcut*delta : -delta*NumberOfStepsPerShortcut;
GlobalPreferences::sharedGlobalPreferences()->setBrightnessLevel(GlobalPreferences::sharedGlobalPreferences()->brightnessLevel()+direction);
}
// Else, the event was not processed.
return false;
}
bool AppsContainer::switchTo(App::Snapshot * snapshot) {
// Get app index of the snapshot
int m_appIndexToSwitch = appIndexFromSnapshot(snapshot);
// If the app is home, skip app index saving
if (m_appIndexToSwitch != 0) {
// Save last app index
m_lastAppIndex = m_currentAppIndex;
// Save current app index
m_currentAppIndex = m_appIndexToSwitch;
}
if (s_activeApp && snapshot != s_activeApp->snapshot()) {
resetShiftAlphaStatus();
}
@@ -275,7 +350,13 @@ void AppsContainer::run() {
/* Normal execution. The exception checkpoint must be created before
* switching to the first app, because the first app might create nodes on
* the pool. */
bool switched = switchTo(initialAppSnapshot());
bool switched;
if (m_startAppSnapshot != nullptr) {
switched = switchTo(m_startAppSnapshot);
} else {
switched = switchTo(initialAppSnapshot());
}
assert(switched);
(void) switched; // Silence compilation warning about unused variable.
} else {
@@ -285,7 +366,7 @@ void AppsContainer::run() {
* destroyed from the pool. To avoid using them before packing the app
* (in App::willBecomeInactive for instance), we tidy them early on. */
s_activeApp->snapshot()->tidy();
/* When an app encoutered an exception due to a full pool, the next time
/* When an app encountered an exception due to a full pool, the next time
* the user enters the app, the same exception could happen again which
* would prevent from reopening the app. To avoid being stuck outside the
* app causing the issue, we reset its snapshot when leaving it due to
@@ -304,6 +385,10 @@ void AppsContainer::run() {
switchTo(nullptr);
}
bool AppsContainer::updateClock() {
return m_window.updateClock();
}
bool AppsContainer::updateBatteryState() {
bool batteryLevelUpdated = m_window.updateBatteryLevel();
bool pluggedStateUpdated = m_window.updatePluggedState();
@@ -315,6 +400,8 @@ bool AppsContainer::updateBatteryState() {
}
void AppsContainer::refreshPreferences() {
m_suspendTimer.reset(GlobalPreferences::sharedGlobalPreferences()->idleBeforeSuspendSeconds()*1000/Timer::TickDuration);
m_backlightDimmingTimer.reset(GlobalPreferences::sharedGlobalPreferences()->idleBeforeDimmingSeconds()*1000/Timer::TickDuration);
m_window.refreshPreferences();
}
@@ -336,7 +423,7 @@ void AppsContainer::shutdownDueToLowBattery() {
* case. */
return;
}
while (Ion::Battery::level() == Ion::Battery::Charge::EMPTY) {
while (Ion::Battery::level() == Ion::Battery::Charge::EMPTY && !Ion::USB::isPlugged()) {
Ion::Backlight::setBrightness(0);
if (!GlobalPreferences::sharedGlobalPreferences()->isInExamMode()) {
/* Unless the LED is lit up for the exam mode, switch off the LED. IF the
@@ -360,7 +447,7 @@ bool AppsContainer::updateAlphaLock() {
return m_window.updateAlphaLock();
}
OnBoarding::PopUpController * AppsContainer::promptController() {
OnBoarding::PromptController * AppsContainer::promptController() {
if (k_promptNumberOfMessages == 0) {
return nullptr;
}
@@ -408,15 +495,6 @@ Window * AppsContainer::window() {
return &m_window;
}
int AppsContainer::numberOfContainerTimers() {
return 3;
}
Timer * AppsContainer::containerTimerAtIndex(int i) {
Timer * timers[3] = {&m_batteryTimer, &m_suspendTimer, &m_backlightDimmingTimer};
return timers[i];
}
void AppsContainer::resetShiftAlphaStatus() {
Ion::Events::setShiftAlphaStatus(Ion::Events::ShiftAlphaStatus::Default);
updateAlphaLock();

View File

@@ -16,7 +16,9 @@
#include "global_preferences.h"
#include "backlight_dimming_timer.h"
#include "shared/global_context.h"
#include "on_boarding/pop_up_controller.h"
#include "clock_timer.h"
#include "on_boarding/prompt_controller.h"
#include "xnt_loop.h"
#include <ion/events.h>
@@ -27,6 +29,7 @@ public:
static bool poincareCircuitBreaker();
virtual int numberOfApps() = 0;
virtual App::Snapshot * appSnapshotAtIndex(int index) = 0;
virtual int appIndexFromSnapshot(App::Snapshot * snapshot) = 0;
App::Snapshot * initialAppSnapshot();
App::Snapshot * hardwareTestAppSnapshot();
App::Snapshot * onBoardingAppSnapshot();
@@ -39,13 +42,16 @@ public:
bool dispatchEvent(Ion::Events::Event event) override;
bool switchTo(App::Snapshot * snapshot) override;
void run() override;
bool updateClock();
bool updateBatteryState();
void refreshPreferences();
void reloadTitleBarView();
void displayExamModePopUp(GlobalPreferences::ExamMode mode);
void shutdownDueToLowBattery();
void setShiftAlphaStatus(Ion::Events::ShiftAlphaStatus newStatus);
OnBoarding::PopUpController * promptController();
CodePoint XNT(CodePoint defaultXNT, bool * shouldRemoveLastCharacter) { return m_XNTLoop.XNT(defaultXNT, shouldRemoveLastCharacter); }
void resetXNT() { m_XNTLoop.reset(); }
OnBoarding::PromptController * promptController();
void redrawWindow(bool force = false);
void activateExamMode(GlobalPreferences::ExamMode examMode);
// Exam pop-up controller delegate
@@ -53,33 +59,42 @@ public:
// Ion::StorageDelegate
void storageDidChangeForRecord(const Ion::Storage::Record record) override;
void storageIsFull() override;
#ifdef EPSILON_GETOPT
void setStartApp(App::Snapshot * snapshot) { m_startAppSnapshot = snapshot; }
#endif
protected:
Home::App::Snapshot * homeAppSnapshot() { return &m_homeSnapshot; }
private:
Window * window() override;
int numberOfContainerTimers() override;
Timer * containerTimerAtIndex(int i) override;
bool processEvent(Ion::Events::Event event);
void resetShiftAlphaStatus();
bool updateAlphaLock();
static I18n::Message k_promptMessages[];
static KDColor k_promptColors[];
static KDColor k_promptFGColors[];
static KDColor k_promptBGColors[];
static int k_promptNumberOfMessages;
int m_currentAppIndex; // Home isn't included after the second app switching
int m_lastAppIndex;
AppsWindow m_window;
EmptyBatteryWindow m_emptyBatteryWindow;
Shared::GlobalContext m_globalContext;
MathToolbox m_mathToolbox;
MathVariableBoxController m_variableBoxController;
ExamPopUpController m_examPopUpController;
OnBoarding::PopUpController m_promptController;
OnBoarding::PromptController m_promptController;
BatteryTimer m_batteryTimer;
SuspendTimer m_suspendTimer;
BacklightDimmingTimer m_backlightDimmingTimer;
ClockTimer m_clockTimer;
Home::App::Snapshot m_homeSnapshot;
OnBoarding::App::Snapshot m_onBoardingSnapshot;
HardwareTest::App::Snapshot m_hardwareTestSnapshot;
USB::App::Snapshot m_usbConnectedSnapshot;
XNTLoop m_XNTLoop;
#ifdef EPSILON_GETOPT
App::Snapshot * m_startAppSnapshot;
#endif
};
#endif

View File

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

View File

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

View File

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

View File

@@ -34,5 +34,25 @@ App::Snapshot * AppsContainerStorage::appSnapshotAtIndex(int index) {
};
assert(sizeof(snapshots)/sizeof(snapshots[0]) == k_numberOfCommonApps);
assert(index >= 0 && index < k_numberOfCommonApps);
// To avoid crashes, we return the home app snapshot if the index is out of
// bounds. (no crash in release mode, but an assert in debug mode)
if (index >= k_numberOfCommonApps) {
return snapshots[0];
}
return snapshots[index];
}
// Get the index of the app from its snapshot
int AppsContainerStorage::appIndexFromSnapshot(App::Snapshot * snapshot) {
App::Snapshot * snapshots[] = {
homeAppSnapshot()
APPS_CONTAINER_SNAPSHOT_LIST
};
assert(sizeof(snapshots)/sizeof(snapshots[0]) == k_numberOfCommonApps);
for (int i = 0; i < k_numberOfCommonApps; i++) {
if (snapshots[i] == snapshot) {
return i;
}
}
return NULL;
}

View File

@@ -12,6 +12,7 @@ public:
AppsContainerStorage();
int numberOfApps() override;
App::Snapshot * appSnapshotAtIndex(int index) override;
int appIndexFromSnapshot(App::Snapshot * snapshot) override;
void * currentAppBuffer() override { return &m_apps; };
private:
union Apps {

View File

@@ -3,6 +3,7 @@
extern "C" {
#include <assert.h>
}
#include <ion/rtc.h>
AppsWindow::AppsWindow() :
Window(),
@@ -19,6 +20,11 @@ bool AppsWindow::updateBatteryLevel() {
return m_titleBarView.setChargeState(Ion::Battery::level());
}
bool AppsWindow::updateClock() {
Ion::RTC::DateTime dateTime = Ion::RTC::dateTime();
return m_titleBarView.setClock(dateTime.tm_hour, dateTime.tm_min, Ion::RTC::mode() != Ion::RTC::Mode::Disabled);
}
bool AppsWindow::updateIsChargingState() {
return m_titleBarView.setIsCharging(Ion::Battery::isCharging());
}

View File

@@ -9,6 +9,7 @@ public:
AppsWindow();
void setTitle(I18n::Message title);
bool updateBatteryLevel();
bool updateClock();
bool updateIsChargingState();
bool updatePluggedState();
void refreshPreferences();

Submodule apps/atom deleted from 8f710a9d3f

1
apps/atomic Submodule

Submodule apps/atomic added at 5f7063d447

View File

@@ -1,11 +1,26 @@
#include "backlight_dimming_timer.h"
#include "global_preferences.h"
#include <ion/backlight.h>
#include <ion/events.h>
#include <apps/apps_container.h>
BacklightDimmingTimer::BacklightDimmingTimer() :
Timer(k_idleBeforeDimmingDuration/Timer::TickDuration)
Timer(GlobalPreferences::sharedGlobalPreferences()->idleBeforeDimmingSeconds()*1000/Timer::TickDuration)
{
}
bool BacklightDimmingTimer::fire() {
Ion::Backlight::setBrightness(k_dimBacklightBrightness);
bool BacklightDimmingTimer::fire(){
int i = Ion::Backlight::brightness();
while (i > 0){
int t = 20;
Ion::Events::Event e = Ion::Events::getEvent(&t);
AppsContainer::sharedAppsContainer()->dispatchEvent(e);
if (e.isKeyboardEvent()){
return false;
}
Ion::Backlight::setBrightness(i);
i -= 15;
}
return false;
}

View File

@@ -7,8 +7,6 @@ class BacklightDimmingTimer : public Timer {
public:
BacklightDimmingTimer();
private:
constexpr static int k_idleBeforeDimmingDuration = 30*1000; // In miliseconds
constexpr static int k_dimBacklightBrightness = 0;
bool fire() override;
};

View File

@@ -9,7 +9,7 @@ BatteryTimer::BatteryTimer() :
bool BatteryTimer::fire() {
AppsContainer * container = AppsContainer::sharedAppsContainer();
bool needRedrawing = container->updateBatteryState();
if (Ion::Battery::level() == Ion::Battery::Charge::EMPTY) {
if (Ion::Battery::level() == Ion::Battery::Charge::EMPTY && !Ion::USB::isPlugged()) {
container->shutdownDueToLowBattery();
}
return needRedrawing;

View File

@@ -60,32 +60,36 @@ void BatteryView::drawRect(KDContext * ctx, KDRect rect) const {
*'content' depends on the charge */
// Draw the left part
ctx->fillRect(KDRect(0, 0, k_elementWidth, k_batteryHeight), Palette::Battery);
ctx->fillRect(KDRect(0, 1, k_elementWidth, k_batteryHeight - 2), Palette::Battery);
// Draw top and bottom part
ctx->fillRect(KDRect(1, 0, k_batteryWidth-3, 1), Palette::Battery);
ctx->fillRect(KDRect(1, k_batteryHeight-1, k_batteryWidth-3, 1), Palette::Battery);
// Draw the middle part
constexpr KDCoordinate batteryInsideX = k_elementWidth+k_separatorThickness;
constexpr KDCoordinate batteryInsideWidth = k_batteryWidth-3*k_elementWidth-2*k_separatorThickness;
if (m_isCharging) {
// Charging: Yellow background with flash
ctx->fillRect(KDRect(batteryInsideX, 0, batteryInsideWidth, k_batteryHeight), Palette::BatteryInCharge);
ctx->fillRect(KDRect(batteryInsideX, 2, batteryInsideWidth, k_batteryHeight-4), Palette::BatteryInCharge);
KDRect frame((k_batteryWidth-k_flashWidth)/2, 0, k_flashWidth, k_flashHeight);
KDColor flashWorkingBuffer[BatteryView::k_flashHeight*BatteryView::k_flashWidth];
ctx->blendRectWithMask(frame, Palette::Battery, (const uint8_t *)flashMask, flashWorkingBuffer);
} else if (m_chargeState == Ion::Battery::Charge::LOW) {
assert(!m_isPlugged);
// Low: Quite empty battery
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(batteryInsideX, 2, 2*k_elementWidth, k_batteryHeight-4), Palette::BatteryLow);
ctx->fillRect(KDRect(3*k_elementWidth+k_separatorThickness, 2, k_batteryWidth-5*k_elementWidth-2*k_separatorThickness, k_batteryHeight-4), KDColor::blend(Palette::Toolbar, Palette::Battery, 128));
} else if (m_chargeState == Ion::Battery::Charge::SOMEWHERE_INBETWEEN) {
assert(!m_isPlugged);
// Middle: Half full battery
constexpr KDCoordinate middleChargeWidth = batteryInsideWidth/2;
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, 2, middleChargeWidth, k_batteryHeight-4), Palette::Battery);
ctx->fillRect(KDRect(batteryInsideX+middleChargeWidth, 2, middleChargeWidth+1, k_batteryHeight-4), KDColor::blend(Palette::Toolbar, Palette::Battery, 128));
} else {
assert(m_chargeState == Ion::Battery::Charge::FULL);
// Full but not plugged: Full battery
ctx->fillRect(KDRect(batteryInsideX, 0, batteryInsideWidth, k_batteryHeight), Palette::Battery);
ctx->fillRect(KDRect(batteryInsideX, 2, batteryInsideWidth, k_batteryHeight-4), Palette::Battery);
if (m_isPlugged) {
// Plugged and full: Full battery with tick
KDRect frame((k_batteryWidth-k_tickWidth)/2, (k_batteryHeight-k_tickHeight)/2, k_tickWidth, k_tickHeight);
@@ -95,7 +99,7 @@ void BatteryView::drawRect(KDContext * ctx, KDRect rect) const {
}
// Draw the right part
ctx->fillRect(KDRect(k_batteryWidth-2*k_elementWidth, 0, k_elementWidth, k_batteryHeight), Palette::Battery);
ctx->fillRect(KDRect(k_batteryWidth-2*k_elementWidth, 1, k_elementWidth, k_batteryHeight-2), Palette::Battery);
ctx->fillRect(KDRect(k_batteryWidth-k_elementWidth, (k_batteryHeight-k_capHeight)/2, k_elementWidth, k_capHeight), Palette::Battery);
}

View File

@@ -20,10 +20,10 @@ public:
constexpr static int k_tickHeight = 6;
constexpr static int k_tickWidth = 8;
private:
constexpr static KDCoordinate k_batteryHeight = 8;
constexpr static KDCoordinate k_batteryWidth = 15;
constexpr static KDCoordinate k_batteryHeight = 9;
constexpr static KDCoordinate k_batteryWidth = 16;
constexpr static KDCoordinate k_elementWidth = 1;
constexpr static KDCoordinate k_capHeight = 4;
constexpr static KDCoordinate k_capHeight = 3;
constexpr static KDCoordinate k_separatorThickness = Metric::CellSeparatorThickness;
Ion::Battery::Charge m_chargeState;
bool m_isCharging;

View File

@@ -17,7 +17,9 @@ app_calculation_src = $(addprefix apps/calculation/,\
additional_outputs/integer_list_controller.cpp \
additional_outputs/scrollable_three_expressions_cell.cpp \
additional_outputs/list_controller.cpp \
additional_outputs/matrix_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_list_controller.cpp \
additional_outputs/trigonometry_model.cpp \

View File

@@ -11,7 +11,7 @@ ExpressionsListController::ExpressionsListController(EditExpressionController *
ListController(editExpressionController),
m_cells{}
{
for (int i = 0; i < k_maxNumberOfCells; i++) {
for (int i = 0; i < k_maxNumberOfRows; i++) {
m_cells[i].setParentResponder(m_listController.selectableTableView());
}
}
@@ -21,15 +21,20 @@ void ExpressionsListController::didEnterResponderChain(Responder * previousFirst
}
int ExpressionsListController::reusableCellCount(int type) {
return k_maxNumberOfCells;
return k_maxNumberOfRows;
}
void ExpressionsListController::viewDidDisappear() {
ListController::viewDidDisappear();
// Reset cell memoization to avoid taking extra space in the pool
for (int i = 0; i < k_maxNumberOfCells; i++) {
// Reset layout and cell memoization to avoid taking extra space in the pool
for (int i = 0; i < k_maxNumberOfRows; i++) {
m_cells[i].setLayout(Layout());
/* By reseting m_layouts, numberOfRow will go down to 0, and the highlighted
* cells won't be unselected. Therefore we unselect them here. */
m_cells[i].setHighlighted(false);
m_layouts[i] = Layout();
}
m_expression = Expression();
}
HighlightCell * ExpressionsListController::reusableCell(int index, int type) {
@@ -43,24 +48,34 @@ KDCoordinate ExpressionsListController::rowHeight(int j) {
}
void ExpressionsListController::willDisplayCellForIndex(HighlightCell * cell, int index) {
/* Note : To further optimize memoization space in the pool, layout
* serialization could be memoized instead, and layout would be recomputed
* here, when setting cell's layout. */
ExpressionTableCellWithPointer * myCell = static_cast<ExpressionTableCellWithPointer *>(cell);
myCell->setLayout(layoutAtIndex(index));
myCell->setAccessoryMessage(messageAtIndex(index));
myCell->reloadScroll();
}
int ExpressionsListController::numberOfRows() const {
int nbOfRows = 0;
for (size_t i = 0; i < k_maxNumberOfRows; i++) {
if (!m_layouts[i].isUninitialized()) {
nbOfRows++;
}
}
return nbOfRows;
}
void ExpressionsListController::setExpression(Poincare::Expression e) {
// Reinitialize memoization
for (int i = 0; i < k_maxNumberOfCells; i++) {
for (int i = 0; i < k_maxNumberOfRows; i++) {
m_layouts[i] = Layout();
}
m_expression = e;
}
Poincare::Layout ExpressionsListController::layoutAtIndex(int index) {
if (m_layouts[index].isUninitialized()) {
computeLayoutAtIndex(index);
}
assert(!m_layouts[index].isUninitialized());
return m_layouts[index];
}

View File

@@ -22,22 +22,22 @@ public:
KDCoordinate rowHeight(int j) override;
int typeAtLocation(int i, int j) override { return 0; }
void willDisplayCellForIndex(HighlightCell * cell, int index) override;
int numberOfRows() const override;
// IllustratedListController
void setExpression(Poincare::Expression e) override;
protected:
constexpr static int k_maxNumberOfCells = 4;
constexpr static int k_maxNumberOfRows = 5;
int textAtIndex(char * buffer, size_t bufferSize, int index) override;
Poincare::Expression m_expression;
// Memoization of layouts
mutable Poincare::Layout m_layouts[k_maxNumberOfCells];
mutable Poincare::Layout m_layouts[k_maxNumberOfRows];
private:
Poincare::Layout layoutAtIndex(int index);
virtual void computeLayoutAtIndex(int index) = 0;
virtual I18n::Message messageAtIndex(int index) = 0;
// Cells
ExpressionTableCellWithPointer m_cells[k_maxNumberOfCells];
ExpressionTableCellWithPointer m_cells[k_maxNumberOfRows];
};
}

View File

@@ -11,6 +11,7 @@ namespace Calculation {
IllustratedListController::IllustratedListController(EditExpressionController * editExpressionController) :
ListController(editExpressionController, this),
m_calculationStore(m_calculationStoreBuffer, k_calculationStoreBufferSize),
m_additionalCalculationCells{}
{
for (int i = 0; i < k_maxNumberOfAdditionalCalculations; i++) {

View File

@@ -39,7 +39,10 @@ protected:
private:
int textAtIndex(char * buffer, size_t bufferSize, int index) override;
virtual CodePoint expressionSymbol() const = 0;
// Set the size of the buffer needed to store the additional calculation
constexpr static int k_maxNumberOfAdditionalCalculations = 4;
constexpr static int k_calculationStoreBufferSize = k_maxNumberOfAdditionalCalculations * (sizeof(Calculation) + Calculation::k_numberOfExpressions * Constant::MaxSerializedExpressionSize + sizeof(Calculation *));
char m_calculationStoreBuffer[k_calculationStoreBufferSize];
// Cells
virtual HighlightCell * illustrationCell() = 0;
ScrollableThreeExpressionsCell m_additionalCalculationCells[k_maxNumberOfAdditionalCalculations];

View File

@@ -1,6 +1,8 @@
#include "integer_list_controller.h"
#include <poincare/based_integer.h>
#include <poincare/opposite.h>
#include <poincare/integer.h>
#include <poincare/logarithm.h>
#include <poincare/empty_layout.h>
#include <poincare/factor.h>
#include "../app.h"
@@ -11,10 +13,6 @@ using namespace Shared;
namespace Calculation {
int IntegerListController::numberOfRows() const {
return 3 + factorExpressionIsComputable();
}
Integer::Base baseAtIndex(int index) {
switch (index) {
case 0:
@@ -27,12 +25,40 @@ Integer::Base baseAtIndex(int index) {
}
}
void IntegerListController::computeLayoutAtIndex(int index) {
assert(m_expression.type() == ExpressionNode::Type::BasedInteger);
// For index = k_indexOfFactorExpression, the layout is assumed to be alreday memoized because it is needed to compute the numberOfRows
assert(index < k_indexOfFactorExpression);
Integer i = static_cast<BasedInteger &>(m_expression).integer();
m_layouts[index] = i.createLayout(baseAtIndex(index));
void IntegerListController::setExpression(Poincare::Expression e) {
ExpressionsListController::setExpression(e);
static_assert(k_maxNumberOfRows >= k_indexOfFactorExpression + 1, "k_maxNumberOfRows must be greater than k_indexOfFactorExpression");
assert(!m_expression.isUninitialized() && m_expression.type() == ExpressionNode::Type::BasedInteger || (m_expression.type() == ExpressionNode::Type::Opposite && m_expression.childAtIndex(0).type() == ExpressionNode::Type::BasedInteger));
assert(!m_expression.isUninitialized());
if (m_expression.type() == ExpressionNode::Type::BasedInteger) {
Integer integer = static_cast<BasedInteger &>(m_expression).integer();
for (int index = 0; index < k_indexOfFactorExpression; ++index) {
m_layouts[index] = integer.createLayout(baseAtIndex(index));
}
}
else
{
Opposite b = static_cast<Opposite &>(m_expression);
Expression e = b.childAtIndex(0);
Integer childInt = static_cast<BasedInteger &>(e).integer();
childInt.setNegative(true);
Integer num_bits = Integer::CeilingLog2(childInt);
Integer integer = Integer::TwosComplementToBits(childInt, num_bits);
for (int index = 0; index < k_indexOfFactorExpression; ++index) {
if(baseAtIndex(index) == Integer::Base::Decimal) {
m_layouts[index] = childInt.createLayout(baseAtIndex(index));
} else {
m_layouts[index] = integer.createLayout(baseAtIndex(index));
}
}
}
// Computing factorExpression
Expression factor = Factor::Builder(m_expression.clone());
PoincareHelpers::Simplify(&factor, App::app()->localContext(), ExpressionNode::ReductionTarget::User);
if (!factor.isUndefined()) {
m_layouts[k_indexOfFactorExpression] = PoincareHelpers::CreateLayout(factor);
}
}
I18n::Message IntegerListController::messageAtIndex(int index) {
@@ -48,20 +74,4 @@ I18n::Message IntegerListController::messageAtIndex(int index) {
}
}
bool IntegerListController::factorExpressionIsComputable() const {
if (!m_layouts[k_indexOfFactorExpression].isUninitialized()) {
// The factor expression is already memoized
return !m_layouts[k_indexOfFactorExpression].isEmpty();
}
Poincare::Context * context = App::app()->localContext();
Expression factor = Factor::Builder(m_expression.clone());
PoincareHelpers::Simplify(&factor, context, ExpressionNode::ReductionTarget::User);
if (!factor.isUndefined()) {
m_layouts[k_indexOfFactorExpression] = PoincareHelpers::CreateLayout(factor);
return true;
}
m_layouts[k_indexOfFactorExpression] = EmptyLayout::Builder();
return false;
}
}

View File

@@ -10,13 +10,11 @@ public:
IntegerListController(EditExpressionController * editExpressionController) :
ExpressionsListController(editExpressionController) {}
//ListViewDataSource
int numberOfRows() const override;
void setExpression(Poincare::Expression e) override;
private:
static constexpr int k_indexOfFactorExpression = 3;
void computeLayoutAtIndex(int index) override;
I18n::Message messageAtIndex(int index) override;
bool factorExpressionIsComputable() const;
};
}

View File

@@ -0,0 +1,106 @@
#include "matrix_list_controller.h"
#include "../app.h"
#include "../../shared/poincare_helpers.h"
#include <apps/global_preferences.h>
#include <poincare_nodes.h>
#include <poincare/matrix.h>
#include <string.h>
using namespace Poincare;
using namespace Shared;
namespace Calculation {
void MatrixListController::setExpression(Poincare::Expression e) {
ExpressionsListController::setExpression(e);
assert(!m_expression.isUninitialized());
static_assert(k_maxNumberOfRows >= k_maxNumberOfOutputRows, "k_maxNumberOfRows must be greater than k_maxNumberOfOutputRows");
Poincare::Preferences * preferences = Poincare::Preferences::sharedPreferences();
Poincare::Preferences::ComplexFormat currentComplexFormat = preferences->complexFormat();
if (currentComplexFormat == Poincare::Preferences::ComplexFormat::Real) {
/* Temporary change complex format to avoid all additional expressions to be
* "unreal" (with [i] for instance). As additional results are computed from
* the output, which is built taking ComplexFormat into account, there are
* no risks of displaying additional results on an unreal output. */
preferences->setComplexFormat(Poincare::Preferences::ComplexFormat::Cartesian);
}
Context * context = App::app()->localContext();
ExpressionNode::ReductionContext reductionContext(
context,
preferences->complexFormat(),
preferences->angleUnit(),
GlobalPreferences::sharedGlobalPreferences()->unitFormat(),
ExpressionNode::ReductionTarget::SystemForApproximation,
ExpressionNode::SymbolicComputation::ReplaceAllSymbolsWithDefinitionsOrUndefined);
// The expression must be reduced to call methods such as determinant or trace
assert(m_expression.type() == ExpressionNode::Type::Matrix);
bool mIsSquared = (static_cast<Matrix &>(m_expression).numberOfRows() == static_cast<Matrix &>(m_expression).numberOfColumns());
size_t index = 0;
size_t messageIndex = 0;
// 1. Matrix determinant if square matrix
if (mIsSquared) {
/* Determinant is reduced so that a null determinant can be detected.
* However, some exceptions remain such as cos(x)^2+sin(x)^2-1 which will
* not be reduced to a rational, but will be null in theory. */
Expression determinant = Determinant::Builder(m_expression.clone()).reduce(reductionContext);
m_indexMessageMap[index] = messageIndex++;
m_layouts[index++] = getLayoutFromExpression(determinant, context, preferences);
// 2. Matrix inverse if invertible matrix
// A squared matrix is invertible if and only if determinant is non null
if (!determinant.isUndefined() && determinant.nullStatus(context) != ExpressionNode::NullStatus::Null) {
// TODO: Handle ExpressionNode::NullStatus::Unknown
m_indexMessageMap[index] = messageIndex++;
m_layouts[index++] = getLayoutFromExpression(MatrixInverse::Builder(m_expression.clone()), context, preferences);
}
}
// 3. Matrix row echelon form
messageIndex = 2;
Expression rowEchelonForm = MatrixRowEchelonForm::Builder(m_expression.clone());
m_indexMessageMap[index] = messageIndex++;
m_layouts[index++] = getLayoutFromExpression(rowEchelonForm, context, preferences);
/* 4. Matrix reduced row echelon form
* it can be computed from row echelon form to save computation time.*/
m_indexMessageMap[index] = messageIndex++;
m_layouts[index++] = getLayoutFromExpression(MatrixReducedRowEchelonForm::Builder(rowEchelonForm), context, preferences);
// 5. Matrix trace if square matrix
if (mIsSquared) {
m_indexMessageMap[index] = messageIndex++;
m_layouts[index++] = getLayoutFromExpression(MatrixTrace::Builder(m_expression.clone()), context, preferences);
}
// Reset complex format as before
preferences->setComplexFormat(currentComplexFormat);
}
Poincare::Layout MatrixListController::getLayoutFromExpression(Expression e, Context * context, Poincare::Preferences * preferences) {
assert(!e.isUninitialized());
// Simplify or approximate expression
Expression approximateExpression;
Expression simplifiedExpression;
e.simplifyAndApproximate(&simplifiedExpression, &approximateExpression, context,
preferences->complexFormat(), preferences->angleUnit(), GlobalPreferences::sharedGlobalPreferences()->unitFormat(),
ExpressionNode::SymbolicComputation::ReplaceAllSymbolsWithDefinitionsOrUndefined);
// simplify might have been interrupted, in which case we use approximate
if (simplifiedExpression.isUninitialized()) {
assert(!approximateExpression.isUninitialized());
return Shared::PoincareHelpers::CreateLayout(approximateExpression);
}
return Shared::PoincareHelpers::CreateLayout(simplifiedExpression);
}
I18n::Message MatrixListController::messageAtIndex(int index) {
// Message index is mapped in setExpression because it depends on the Matrix.
assert(index < k_maxNumberOfOutputRows && index >=0);
I18n::Message messages[k_maxNumberOfOutputRows] = {
I18n::Message::AdditionalDeterminant,
I18n::Message::AdditionalInverse,
I18n::Message::AdditionalRowEchelonForm,
I18n::Message::AdditionalReducedRowEchelonForm,
I18n::Message::AdditionalTrace};
return messages[m_indexMessageMap[index]];
}
}

View File

@@ -0,0 +1,27 @@
#ifndef CALCULATION_ADDITIONAL_OUTPUTS_MATRIX_LIST_CONTROLLER_H
#define CALCULATION_ADDITIONAL_OUTPUTS_MATRIX_LIST_CONTROLLER_H
#include "expressions_list_controller.h"
namespace Calculation {
class MatrixListController : public ExpressionsListController {
public:
MatrixListController(EditExpressionController * editExpressionController) :
ExpressionsListController(editExpressionController) {}
void setExpression(Poincare::Expression e) override;
private:
I18n::Message messageAtIndex(int index) override;
Poincare::Layout getLayoutFromExpression(Poincare::Expression e, Poincare::Context * context, Poincare::Preferences * preferences);
// Map from cell index to message index
constexpr static int k_maxNumberOfOutputRows = 5;
int m_indexMessageMap[k_maxNumberOfOutputRows];
};
}
#endif

View File

@@ -9,34 +9,31 @@ using namespace Shared;
namespace Calculation {
int RationalListController::numberOfRows() const {
return 2;
}
Integer extractInteger(const Expression e) {
assert(e.type() == ExpressionNode::Type::BasedInteger);
return static_cast<const BasedInteger &>(e).integer();
}
void RationalListController::computeLayoutAtIndex(int index) {
void RationalListController::setExpression(Poincare::Expression e) {
ExpressionsListController::setExpression(e);
assert(!m_expression.isUninitialized());
static_assert(k_maxNumberOfRows >= 2, "k_maxNumberOfRows must be greater than 2");
bool negative = false;
Expression div = m_expression;
if (m_expression.type() == ExpressionNode::Type::Opposite) {
negative = true;
div = m_expression.childAtIndex(0);
}
assert(div.type() == ExpressionNode::Type::Division);
Integer numerator = extractInteger(div.childAtIndex(0));
numerator.setNegative(negative);
Integer denominator = extractInteger(div.childAtIndex(1));
Expression e;
if (index == 0) {
e = Integer::CreateMixedFraction(numerator, denominator);
} else {
assert(index == 1);
e = Integer::CreateEuclideanDivision(numerator, denominator);
}
m_layouts[index] = PoincareHelpers::CreateLayout(e);
int index = 0;
m_layouts[index++] = PoincareHelpers::CreateLayout(Integer::CreateMixedFraction(numerator, denominator));
m_layouts[index++] = PoincareHelpers::CreateLayout(Integer::CreateEuclideanDivision(numerator, denominator));
}
I18n::Message RationalListController::messageAtIndex(int index) {

View File

@@ -10,10 +10,9 @@ public:
RationalListController(EditExpressionController * editExpressionController) :
ExpressionsListController(editExpressionController) {}
//ListViewDataSource
int numberOfRows() const override;
void setExpression(Poincare::Expression e) override;
private:
void computeLayoutAtIndex(int index) override;
I18n::Message messageAtIndex(int index) override;
int textAtIndex(char * buffer, size_t bufferSize, int index) override;
};

View File

@@ -0,0 +1,320 @@
#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 = Opposite::Builder(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;
PoincareHelpers::Simplify(&minusBeta, context, ExpressionNode::ReductionTarget::User);
Expression beta = getOppositeIfExists(minusBeta, &reductionContext);
if (beta.isUninitialized()) {
if (minusBeta.type() == ExpressionNode::Type::Addition || minusBeta.type() == ExpressionNode::Type::Subtraction) {
canonized = Subtraction::Builder(xMinusAlphaPowerTwoWithFactor, Parenthesis::Builder(minusBeta));
} else {
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);
if (x0.type() == ExpressionNode::Type::Addition || x0.type() == ExpressionNode::Type::Subtraction) {
firstFactor = Subtraction::Builder(Symbol::Builder("x", strlen("x")), Parenthesis::Builder(x0.clone()));
} else {
firstFactor = Subtraction::Builder(Symbol::Builder("x", strlen("x")), x0.clone());
}
} else {
if (x0Opposite.type() == ExpressionNode::Type::Addition || x0Opposite.type() == ExpressionNode::Type::Subtraction) {
x0Opposite = Parenthesis::Builder(x0Opposite.clone());
}
firstFactor = Addition::Builder(Symbol::Builder("x", strlen("x")), x0Opposite.clone());
}
Expression x1Opposite = getOppositeIfExists(x1, &reductionContext);
if (x1Opposite.isUninitialized()) {
PoincareHelpers::Simplify(&x1, context, ExpressionNode::ReductionTarget::User);
if (x1.type() == ExpressionNode::Type::Addition || x1.type() == ExpressionNode::Type::Subtraction) {
secondFactor = Subtraction::Builder(Symbol::Builder("x", strlen("x")), Parenthesis::Builder(x1.clone()));
} else {
secondFactor = Subtraction::Builder(Symbol::Builder("x", strlen("x")), x1.clone());
}
} else {
PoincareHelpers::Simplify(&x1Opposite, context, ExpressionNode::ReductionTarget::User);
if (x1Opposite.type() == ExpressionNode::Type::Addition || x1Opposite.type() == ExpressionNode::Type::Subtraction) {
x1Opposite = Parenthesis::Builder(x1Opposite.clone());
}
secondFactor = Addition::Builder(Symbol::Builder("x", strlen("x")), x1Opposite.clone());
}
Expression solutionProduct = Multiplication::Builder(Parenthesis::Builder(firstFactor), Parenthesis::Builder(secondFactor));
switch (multiplicationTypeForA)
{
case MultiplicationTypeForA::Nothing:
factorized = solutionProduct;
break;
case MultiplicationTypeForA::Minus:
factorized = Opposite::Builder(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);
if (x0.type() == ExpressionNode::Type::Addition || x0.type() == ExpressionNode::Type::Subtraction) {
factor = Subtraction::Builder(Symbol::Builder("x", strlen("x")), Parenthesis::Builder(x0.clone()));
} else {
factor = Subtraction::Builder(Symbol::Builder("x", strlen("x")), x0.clone());
}
} else {
PoincareHelpers::Simplify(&x0Opposite, context, ExpressionNode::ReductionTarget::User);
factor = Addition::Builder(Symbol::Builder("x", strlen("x")), x0Opposite.clone());
}
Expression solutionProduct = Power::Builder(Parenthesis::Builder(factor), Rational::Builder(2));
switch (multiplicationTypeForA)
{
case MultiplicationTypeForA::Nothing:
factorized = solutionProduct;
break;
case MultiplicationTypeForA::Minus:
factorized = Opposite::Builder(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::Opposite) {
return std::move(e.childAtIndex(0).clone());
} 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

@@ -8,7 +8,8 @@ namespace Calculation {
TrigonometryGraphView::TrigonometryGraphView(TrigonometryModel * model) :
CurveView(model),
m_model(model)
m_model(model),
m_shouldDisplayTan(false)
{
}
@@ -22,17 +23,33 @@ void TrigonometryGraphView::drawRect(KDContext * ctx, KDRect rect) const {
drawCurve(ctx, rect, 0.0f, 2.0f*M_PI, M_PI/180.0f, [](float t, void * model, void * context) {
return Poincare::Coordinate2D<float>(std::cos(t), std::sin(t));
}, nullptr, nullptr, true, Palette::SecondaryText, false);
// Draw dashed segment to indicate sine and cosine
drawHorizontalOrVerticalSegment(ctx, rect, Axis::Vertical, c, 0.0f, s, Palette::CalculationTrigoAndComplexForeground, 1, 3);
drawHorizontalOrVerticalSegment(ctx, rect, Axis::Horizontal, s, 0.0f, c, Palette::CalculationTrigoAndComplexForeground, 1, 3);
if (!m_shouldDisplayTan) {
// Draw dashed segment to indicate sine and cosine
drawHorizontalOrVerticalSegment(ctx, rect, Axis::Vertical, c, 0.0f, s, Palette::CalculationTrigoAndComplexForeground, 1, 3);
drawHorizontalOrVerticalSegment(ctx, rect, Axis::Horizontal, s, 0.0f, c, Palette::CalculationTrigoAndComplexForeground, 1, 3);
}
if (m_shouldDisplayTan) {
float t = std::tan(m_model->angle());
drawHorizontalOrVerticalSegment(ctx, rect, Axis::Vertical, 1.0f, m_model->yMin(), m_model->yMax(), Palette::SecondaryText, 2);
drawSegment(ctx, rect, 0.0f, 0.0f, 1.0f, t, Palette::SecondaryText, false);
drawDot(ctx, rect, 1.0f, t, Palette::CalculationTrigoAndComplexForeground, Size::Large);
drawLabel(ctx, rect, 0.0f, t, "tan(θ)", Palette::CalculationTrigoAndComplexForeground, CurveView::RelativePosition::Before, CurveView::RelativePosition::None);
drawHorizontalOrVerticalSegment(ctx, rect, Axis::Horizontal, t, 0.0f, 1.0f, Palette::CalculationTrigoAndComplexForeground, 1, 3);
}
// Draw angle position on the circle
drawDot(ctx, rect, c, s, Palette::CalculationTrigoAndComplexForeground, Size::Large);
drawDot(ctx, rect, c, s, m_shouldDisplayTan ? Palette::SecondaryText : Palette::CalculationTrigoAndComplexForeground, m_shouldDisplayTan ? Size::Tiny : Size::Large);
// Draw graduations
drawLabelsAndGraduations(ctx, rect, Axis::Vertical, false, true);
drawLabelsAndGraduations(ctx, rect, Axis::Horizontal, false, true);
// Draw labels
drawLabel(ctx, rect, 0.0f, s, "sin(θ)", Palette::CalculationTrigoAndComplexForeground, c >= 0.0f ? CurveView::RelativePosition::Before : CurveView::RelativePosition::After, CurveView::RelativePosition::None);
drawLabel(ctx, rect, c, 0.0f, "cos(θ)", Palette::CalculationTrigoAndComplexForeground, CurveView::RelativePosition::None, s >= 0.0f ? CurveView::RelativePosition::Before : CurveView::RelativePosition::After);
if (!m_shouldDisplayTan) {
// Draw labels
drawLabel(ctx, rect, 0.0f, s, "sin(θ)", Palette::CalculationTrigoAndComplexForeground, c >= 0.0f ? CurveView::RelativePosition::Before : CurveView::RelativePosition::After, CurveView::RelativePosition::None);
drawLabel(ctx, rect, c, 0.0f, "cos(θ)", Palette::CalculationTrigoAndComplexForeground, CurveView::RelativePosition::None, s >= 0.0f ? CurveView::RelativePosition::Before : CurveView::RelativePosition::After);
}
}
}

View File

@@ -11,13 +11,16 @@ class TrigonometryGraphView : public Shared::CurveView {
public:
TrigonometryGraphView(TrigonometryModel * model);
void drawRect(KDContext * ctx, KDRect rect) const override;
void setShouldDisplayTan(bool shouldDisplayTan) { m_shouldDisplayTan = shouldDisplayTan; };
private:
TrigonometryModel * m_model;
bool m_shouldDisplayTan;
};
class TrigonometryGraphCell : public IllustrationCell {
public:
TrigonometryGraphCell(TrigonometryModel * model) : m_view(model) {}
void setShouldDisplayTan(bool shouldDisplayTan) { m_view.setShouldDisplayTan(shouldDisplayTan); };
private:
View * view() override { return &m_view; }
TrigonometryGraphView m_view;

View File

@@ -1,16 +1,67 @@
#include "trigonometry_list_controller.h"
#include "../app.h"
#include <poincare_nodes.h>
#include "../../shared/poincare_helpers.h"
using namespace Poincare;
namespace Calculation {
void TrigonometryListController::setExpression(Poincare::Expression e) {
assert(e.type() == ExpressionNode::Type::Cosine || e.type() == ExpressionNode::Type::Sine);
IllustratedListController::setExpression(e.childAtIndex(0));
static constexpr int s_fullCircle[] = {
360,
2,
400
};
Poincare::Constant toConstant(Expression e) {
return static_cast<Poincare::Constant &>(e);
}
void TrigonometryListController::setExpression(Expression e) {
assert(e.type() == ExpressionNode::Type::Cosine || e.type() == ExpressionNode::Type::Sine || e.type() == ExpressionNode::Type::Tangent);
bool shouldDisplayTan = e.type() == ExpressionNode::Type::Tangent;
m_graphCell.setShouldDisplayTan(shouldDisplayTan);
m_model.setShouldDisplayTan(shouldDisplayTan);
Poincare::Context * context = App::app()->localContext();
Poincare::Preferences * preferences = Poincare::Preferences::sharedPreferences();
Preferences::AngleUnit angleUnit = preferences->angleUnit();
Expression angleExpression = e.childAtIndex(0);
Shared::PoincareHelpers::Reduce(&angleExpression, context, Poincare::ExpressionNode::ReductionTarget::SystemForAnalysis);
if ((angleUnit == Preferences::AngleUnit::Radian
&& angleExpression.type() == ExpressionNode::Type::Multiplication
&& angleExpression.numberOfChildren() == 2
&& angleExpression.childAtIndex(1).type() == ExpressionNode::Type::Constant
&& toConstant(angleExpression.childAtIndex(1)).isPi()
&& angleExpression.childAtIndex(0).type() == ExpressionNode::Type::Rational)
|| ((angleUnit == Preferences::AngleUnit::Degree || angleUnit == Preferences::AngleUnit::Gradian)
&& angleExpression.type() == ExpressionNode::Type::Rational)) {
Expression extracted = angleUnit == Preferences::AngleUnit::Radian ? angleExpression.childAtIndex(0) : angleExpression;
Rational r = static_cast<Rational &>(extracted);
Integer denominator = Integer::Multiplication(r.integerDenominator(), Integer(s_fullCircle[(int) angleUnit]));
IntegerDivision division = Integer::Division(r.signedIntegerNumerator(), denominator);
Integer remainder = division.remainder;
Expression newAngle;
Integer rDenominator = r.integerDenominator();
Rational newCoefficient = Rational::Builder(remainder, rDenominator);
if (angleUnit == Preferences::AngleUnit::Radian) {
angleExpression = Multiplication::Builder(newCoefficient, angleExpression.childAtIndex(1));
} else {
angleExpression = newCoefficient;
}
}
IllustratedListController::setExpression(angleExpression);
// Fill calculation store
Poincare::Context * context = App::app()->localContext();
m_calculationStore.push("tan(θ)", context, CalculationHeight);
m_calculationStore.push("sin(θ)", context, CalculationHeight);
m_calculationStore.push("cos(θ)", context, CalculationHeight);
m_calculationStore.push("θ", context, CalculationHeight);

View File

@@ -8,4 +8,22 @@ TrigonometryModel::TrigonometryModel() :
{
}
float TrigonometryModel::yMin() const {
if (m_shouldDisplayTan) {
return -1.1f;
}
return yCenter() - yHalfRange();
}
float TrigonometryModel::yMax() const {
if (m_shouldDisplayTan) {
float t = std::tan(angle());
if (t <= 1.2f) {
return 1.2f;
}
return 1.2f * std::tan(angle());
}
return yCenter() + yHalfRange();
}
}

View File

@@ -14,11 +14,12 @@ public:
// CurveViewRange
float xMin() const override { return -k_xHalfRange; }
float xMax() const override { return k_xHalfRange; }
float yMin() const override { return yCenter() - yHalfRange(); }
float yMax() const override { return yCenter() + yHalfRange(); }
float yMin() const override;
float yMax() const override;
void setAngle(float f) { m_angle = f; }
float angle() const { return m_angle*(float)M_PI/(float)Poincare::Trigonometry::PiInAngleUnit(Poincare::Preferences::sharedPreferences()->angleUnit()); }
void setShouldDisplayTan(bool shouldDisplayTan) { m_shouldDisplayTan = shouldDisplayTan; }
private:
constexpr static float k_xHalfRange = 2.1f;
// We center the yRange around the semi-circle where the angle is
@@ -33,6 +34,7 @@ private:
float yHalfRange() const { return IllustratedListController::k_illustrationHeight*k_xHalfRange/(Ion::Display::Width - Metric::PopUpRightMargin - Metric::PopUpLeftMargin); }
float m_angle;
bool m_shouldDisplayTan;
};
}

View File

@@ -12,115 +12,86 @@ using namespace Shared;
namespace Calculation {
UnitListController::UnitListController(EditExpressionController * editExpressionController) :
ExpressionsListController(editExpressionController),
m_dimensionMessage(I18n::Message::Default)
{
m_dimensionCell.setMessageFont(KDFont::LargeFont);
}
bool UnitListController::handleEvent(Ion::Events::Event event) {
if (selectedRow() == 0 && (event == Ion::Events::OK || event == Ion::Events::EXE)) {
return true;
}
// HACK: Change the selected row (prevent some bugs when OK is pressed)
selectRow(selectedRow() - 1);
bool value = ListController::handleEvent(event);
selectRow(selectedRow() + 1);
return value;
}
void UnitListController::setExpression(Poincare::Expression e) {
ExpressionsListController::setExpression(e);
assert(!m_expression.isUninitialized());
// Reinitialize m_memoizedExpressions
for (size_t i = 0; i < k_maxNumberOfCells; i++) {
m_memoizedExpressions[i] = Expression();
}
static_assert(k_maxNumberOfRows >= 3, "k_maxNumberOfRows must be greater than 3");
size_t numberOfMemoizedExpressions = 0;
// 1. First rows: miscellaneous classic units for some dimensions
Poincare::Expression expressions[k_maxNumberOfRows];
// Initialize expressions
for (size_t i = 0; i < k_maxNumberOfRows; i++) {
expressions[i] = Expression();
}
m_dimensionMessage = I18n::Message::Default;
/* 1. First rows: miscellaneous classic units for some dimensions, in both
* metric and imperial units. */
Expression copy = m_expression.clone();
Expression units;
// Reduce to be able to recognize units
PoincareHelpers::Reduce(&copy, App::app()->localContext(), ExpressionNode::ReductionTarget::User);
copy = copy.removeUnit(&units);
bool requireSimplification = false;
bool canChangeUnitPrefix = false;
PoincareHelpers::ReduceAndRemoveUnit(&copy, App::app()->localContext(), ExpressionNode::ReductionTarget::User, &units);
double value = Shared::PoincareHelpers::ApproximateToScalar<double>(copy, App::app()->localContext());
ExpressionNode::ReductionContext reductionContext(
App::app()->localContext(),
Preferences::sharedPreferences()->complexFormat(),
Preferences::sharedPreferences()->angleUnit(),
GlobalPreferences::sharedGlobalPreferences()->unitFormat(),
ExpressionNode::ReductionTarget::User,
ExpressionNode::SymbolicComputation::ReplaceAllSymbolsWithDefinitionsOrUndefined);
int numberOfExpressions = Unit::SetAdditionalExpressionsAndMessage(units, value, expressions, k_maxNumberOfRows, reductionContext, &m_dimensionMessage);
if (Unit::IsSISpeed(units)) {
// 1.a. Turn speed into km/h
m_memoizedExpressions[numberOfMemoizedExpressions++] = UnitConvert::Builder(
m_expression.clone(),
Multiplication::Builder(
Unit::Kilometer(),
Power::Builder(
Unit::Hour(),
Rational::Builder(-1)
)
)
);
requireSimplification = true; // Simplify the conversion
} else if (Unit::IsSIVolume(units)) {
// 1.b. Turn volume into L
m_memoizedExpressions[numberOfMemoizedExpressions++] = UnitConvert::Builder(
m_expression.clone(),
Unit::Liter()
);
requireSimplification = true; // Simplify the conversion
canChangeUnitPrefix = true; // Pick best prefix (mL)
} else if (Unit::IsSIEnergy(units)) {
// 1.c. Turn energy into Wh
m_memoizedExpressions[numberOfMemoizedExpressions++] = UnitConvert::Builder(
m_expression.clone(),
Multiplication::Builder(
Unit::Watt(),
Unit::Hour()
)
);
m_memoizedExpressions[numberOfMemoizedExpressions++] = UnitConvert::Builder(
m_expression.clone(),
Unit::ElectronVolt()
);
requireSimplification = true; // Simplify the conversion
canChangeUnitPrefix = true; // Pick best prefix (kWh)
} else if (Unit::IsSITime(units)) {
// Turn time into ? year + ? month + ? day + ? h + ? min + ? s
double value = Shared::PoincareHelpers::ApproximateToScalar<double>(copy, App::app()->localContext());
m_memoizedExpressions[numberOfMemoizedExpressions++] = Unit::BuildTimeSplit(value, App::app()->localContext(), Preferences::sharedPreferences()->complexFormat(), Preferences::sharedPreferences()->angleUnit());
}
// 1.d. Simplify and tune prefix of all computed expressions
size_t currentExpressionIndex = 0;
while (currentExpressionIndex < numberOfMemoizedExpressions) {
assert(!m_memoizedExpressions[currentExpressionIndex].isUninitialized());
if (requireSimplification) {
Shared::PoincareHelpers::Simplify(&m_memoizedExpressions[currentExpressionIndex], App::app()->localContext(), ExpressionNode::ReductionTarget::User);
}
if (canChangeUnitPrefix) {
Expression newUnits;
// Reduce to be able to removeUnit
PoincareHelpers::Reduce(&m_memoizedExpressions[currentExpressionIndex], App::app()->localContext(), ExpressionNode::ReductionTarget::User);
m_memoizedExpressions[currentExpressionIndex] = m_memoizedExpressions[currentExpressionIndex].removeUnit(&newUnits);
double value = Shared::PoincareHelpers::ApproximateToScalar<double>(m_memoizedExpressions[currentExpressionIndex], App::app()->localContext());
ExpressionNode::ReductionContext reductionContext(
App::app()->localContext(),
Preferences::sharedPreferences()->complexFormat(),
Preferences::sharedPreferences()->angleUnit(),
ExpressionNode::ReductionTarget::User,
ExpressionNode::SymbolicComputation::ReplaceAllSymbolsWithDefinitionsOrUndefined);
Unit::ChooseBestPrefixForValue(&newUnits, &value, reductionContext);
m_memoizedExpressions[currentExpressionIndex] = Multiplication::Builder(Number::FloatNumber(value), newUnits);
}
currentExpressionIndex++;
}
// 2. SI units only
assert(numberOfExpressions < k_maxNumberOfRows - 1);
expressions[numberOfExpressions] = m_expression.clone();
Shared::PoincareHelpers::Simplify(&expressions[numberOfExpressions], App::app()->localContext(), ExpressionNode::ReductionTarget::User, Poincare::ExpressionNode::SymbolicComputation::ReplaceAllDefinedSymbolsWithDefinition, Poincare::ExpressionNode::UnitConversion::InternationalSystem);
numberOfExpressions++;
// 2. IS units only
assert(numberOfMemoizedExpressions < k_maxNumberOfCells - 1);
m_memoizedExpressions[numberOfMemoizedExpressions] = m_expression.clone();
Shared::PoincareHelpers::Simplify(&m_memoizedExpressions[numberOfMemoizedExpressions], App::app()->localContext(), ExpressionNode::ReductionTarget::User, Poincare::ExpressionNode::SymbolicComputation::ReplaceAllDefinedSymbolsWithDefinition, Poincare::ExpressionNode::UnitConversion::InternationalSystem);
numberOfMemoizedExpressions++;
// 3. Get rid of duplicates
/* 3. Get rid of duplicates
* We find duplicates by comparing the serializations, to eliminate
* expressions that only differ by the types of their number nodes. */
Expression reduceExpression = m_expression.clone();
// Make m_expression compareable to m_memoizedExpressions (turn BasedInteger into Rational for instance)
// Make m_expression comparable to expressions (turn BasedInteger into Rational for instance)
Shared::PoincareHelpers::Simplify(&reduceExpression, App::app()->localContext(), ExpressionNode::ReductionTarget::User, Poincare::ExpressionNode::SymbolicComputation::ReplaceAllDefinedSymbolsWithDefinition, Poincare::ExpressionNode::UnitConversion::None);
currentExpressionIndex = 1;
while (currentExpressionIndex < numberOfMemoizedExpressions) {
int currentExpressionIndex = 0;
while (currentExpressionIndex < numberOfExpressions) {
bool duplicateFound = false;
for (size_t i = 0; i < currentExpressionIndex + 1; i++) {
// Compare the currentExpression to all previous memoized expressions and to m_expression
Expression comparedExpression = i == currentExpressionIndex ? reduceExpression : m_memoizedExpressions[i];
constexpr int buffersSize = Constant::MaxSerializedExpressionSize;
char buffer1[buffersSize];
int size1 = PoincareHelpers::Serialize(expressions[currentExpressionIndex], buffer1, buffersSize);
for (int i = 0; i < currentExpressionIndex + 1; i++) {
// Compare the currentExpression to all previous expressions and to m_expression
Expression comparedExpression = i == currentExpressionIndex ? reduceExpression : expressions[i];
assert(!comparedExpression.isUninitialized());
if (comparedExpression.isIdenticalTo(m_memoizedExpressions[currentExpressionIndex])) {
numberOfMemoizedExpressions--;
char buffer2[buffersSize];
int size2 = PoincareHelpers::Serialize(comparedExpression, buffer2, buffersSize);
if (size1 == size2 && strcmp(buffer1, buffer2) == 0) {
numberOfExpressions--;
// Shift next expressions
for (size_t j = currentExpressionIndex; j < numberOfMemoizedExpressions; j++) {
m_memoizedExpressions[j] = m_memoizedExpressions[j+1];
for (int j = currentExpressionIndex; j < numberOfExpressions; j++) {
expressions[j] = expressions[j+1];
}
// Remove last expression
m_memoizedExpressions[numberOfMemoizedExpressions] = Expression();
expressions[numberOfExpressions] = Expression();
// The current expression has been discarded, no need to increment the current index
duplicateFound = true;
break;
@@ -131,21 +102,50 @@ void UnitListController::setExpression(Poincare::Expression e) {
currentExpressionIndex++;
}
}
// Memoize layouts
for (size_t i = 0; i < k_maxNumberOfRows; i++) {
if (!expressions[i].isUninitialized()) {
m_layouts[i] = Shared::PoincareHelpers::CreateLayout(expressions[i]);
}
}
}
int UnitListController::numberOfRows() const {
int nbOfRows = 0;
for (size_t i = 0; i < k_maxNumberOfCells; i++) {
if (!m_memoizedExpressions[i].isUninitialized()) {
nbOfRows++;
}
}
return nbOfRows;
int messageRow = m_dimensionMessage != I18n::Message::Default ? 1 : 0;
return ExpressionsListController::numberOfRows() + messageRow;
}
void UnitListController::computeLayoutAtIndex(int index) {
assert(!m_memoizedExpressions[index].isUninitialized());
m_layouts[index] = Shared::PoincareHelpers::CreateLayout(m_memoizedExpressions[index]);
void UnitListController::willDisplayCellForIndex(HighlightCell * cell, int index) {
if (index == 0) {
MessageTableCell<> * messageTableCell = (MessageTableCell<> *)cell;
messageTableCell->setMessage(m_dimensionMessage);
} else {
ExpressionsListController::willDisplayCellForIndex(cell, index - 1);
}
}
KDCoordinate UnitListController::rowHeight(int index) {
if (index == 0) {
return 35;
} else {
return ExpressionsListController::rowHeight(index - 1);
}
}
HighlightCell * UnitListController::reusableCell(int index, int type) {
if (type == 0) {
return ExpressionsListController::reusableCell(index, type);
} else {
return &m_dimensionCell;
}
}
int UnitListController::typeAtLocation(int i, int j) {
if (j == 0) {
return 1;
} else {
return ExpressionsListController::typeAtLocation(i, j - 1);
}
}
I18n::Message UnitListController::messageAtIndex(int index) {

View File

@@ -7,18 +7,23 @@ namespace Calculation {
class UnitListController : public ExpressionsListController {
public:
UnitListController(EditExpressionController * editExpressionController) :
ExpressionsListController(editExpressionController) {}
UnitListController(EditExpressionController * editExpressionController);
/* Responder */
bool handleEvent(Ion::Events::Event event) override;
void setExpression(Poincare::Expression e) override;
//ListViewDataSource
int reusableCellCount(int type) override { return type == 0 ? ExpressionsListController::reusableCellCount(type) : 1; }
HighlightCell * reusableCell(int index, int type) override;
KDCoordinate rowHeight(int j) override;
int typeAtLocation(int i, int j) override;
void willDisplayCellForIndex(HighlightCell * cell, int index) override;
int numberOfRows() const override;
private:
void computeLayoutAtIndex(int index) override;
I18n::Message messageAtIndex(int index) override;
// Memoization of expressions
mutable Poincare::Expression m_memoizedExpressions[k_maxNumberOfCells];
I18n::Message m_dimensionMessage;
MessageTableCell<> m_dimensionCell;
};
}

View File

@@ -31,6 +31,8 @@ App * App::Snapshot::unpack(Container * container) {
void App::Snapshot::reset() {
m_calculationStore.deleteAll();
m_cacheBuffer[0] = 0;
m_cacheBufferInformation = 0;
}
App::Descriptor * App::Snapshot::descriptor() {
@@ -38,14 +40,14 @@ App::Descriptor * App::Snapshot::descriptor() {
return &descriptor;
}
void App::Snapshot::tidy() {
m_calculationStore.tidy();
App::Snapshot::Snapshot() : m_calculationStore(m_calculationBuffer, k_calculationBufferSize)
{
}
App::App(Snapshot * snapshot) :
ExpressionFieldDelegateApp(snapshot, &m_editExpressionController),
m_historyController(&m_editExpressionController, snapshot->calculationStore()),
m_editExpressionController(&m_modalViewController, this, &m_historyController, snapshot->calculationStore())
m_editExpressionController(&m_modalViewController, this, snapshot->cacheBuffer(), snapshot->cacheBufferInformationAddress(), &m_historyController, snapshot->calculationStore())
{
}
@@ -73,4 +75,14 @@ bool App::isAcceptableExpression(const Poincare::Expression expression) {
return !expression.isUninitialized();
}
void App::didBecomeActive(Window * window) {
m_editExpressionController.restoreInput();
Shared::ExpressionFieldDelegateApp::didBecomeActive(window);
}
void App::willBecomeInactive() {
m_editExpressionController.memoizeInput();
Shared::ExpressionFieldDelegateApp::willBecomeInactive();
}
}

View File

@@ -6,6 +6,7 @@
#include "history_controller.h"
#include "../shared/text_field_delegate_app.h"
#include <escher.h>
#include "../shared/shared_app.h"
namespace Calculation {
@@ -18,15 +19,22 @@ public:
App::Descriptor::ExaminationLevel examinationLevel() override;
const Image * icon() override;
};
class Snapshot : public ::App::Snapshot {
class Snapshot : public ::SharedApp::Snapshot {
public:
Snapshot();
App * unpack(Container * container) override;
void reset() override;
Descriptor * descriptor() override;
CalculationStore * calculationStore() { return &m_calculationStore; }
char * cacheBuffer() { return m_cacheBuffer; }
size_t * cacheBufferInformationAddress() { return &m_cacheBufferInformation; }
private:
void tidy() override;
CalculationStore m_calculationStore;
// Set the size of the buffer needed to store the calculations
static constexpr int k_calculationBufferSize = 10 * (sizeof(Calculation) + Calculation::k_numberOfExpressions * Constant::MaxSerializedExpressionSize + sizeof(Calculation *));
char m_calculationBuffer[k_calculationBufferSize];
char m_cacheBuffer[EditExpressionController::k_cacheBufferSize];
size_t m_cacheBufferInformation;
};
static App * app() {
return static_cast<App *>(Container::activeApp());
@@ -36,9 +44,12 @@ public:
bool layoutFieldDidReceiveEvent(::LayoutField * layoutField, Ion::Events::Event event) override;
// TextFieldDelegateApp
bool isAcceptableExpression(const Poincare::Expression expression) override;
private:
App(Snapshot * snapshot);
HistoryController m_historyController;
void didBecomeActive(Window * window) override;
void willBecomeInactive() override;
EditExpressionController m_editExpressionController;
};

View File

@@ -7,3 +7,14 @@ BinaryBase = "Binär"
PrimeFactors = "Primfaktoren"
MixedFraction = "Gemischte Zahl"
EuclideanDivision = "Division mit Rest"
AdditionalDeterminant = "Determinante"
AdditionalInverse = "Inverse"
AdditionalRowEchelonForm = "Stufenform"
AdditionalReducedRowEchelonForm = "Reduzierte Stufenform"
AdditionalTrace = "Spur"
CanonicalForm = "Kanonische Form"
FactorizedForm = "Factorisierte Form"
Discriminant = "Diskriminante"
OnlyRoot = "Wurzel"
FirstRoot = "Erste Wurzel"
SecondRoot = "Zweite Wurzel"

View File

@@ -7,3 +7,14 @@ BinaryBase = "Binary"
PrimeFactors = "Prime factors"
MixedFraction = "Mixed fraction"
EuclideanDivision = "Euclidean division"
AdditionalDeterminant = "Determinant"
AdditionalInverse = "Inverse"
AdditionalRowEchelonForm = "Row echelon form"
AdditionalReducedRowEchelonForm = "Reduced row echelon form"
AdditionalTrace = "Trace"
CanonicalForm = "Canonical form"
FactorizedForm = "Factorized form"
Discriminant = "Discriminant"
OnlyRoot = "Root"
FirstRoot = "First root"
SecondRoot = "Second root"

View File

@@ -7,3 +7,14 @@ BinaryBase = "Binario"
PrimeFactors = "Factores primos"
MixedFraction = "Fracción mixta"
EuclideanDivision = "División euclidiana"
AdditionalDeterminant = "Determinante"
AdditionalInverse = "Inversa"
AdditionalRowEchelonForm = "Matriz escalonada"
AdditionalReducedRowEchelonForm = "Matriz escalonada reducida"
AdditionalTrace = "Traza"
CanonicalForm = "Forma canónica"
FactorizedForm = "Forma factorizada"
Discriminant = "Discriminante"
OnlyRoot = "Raíz"
FirstRoot = "Primera raíz"
SecondRoot = "Segunda raíz"

View File

@@ -7,3 +7,14 @@ BinaryBase = "Binaire"
PrimeFactors = "Facteurs premiers"
MixedFraction = "Fraction mixte"
EuclideanDivision = "Division euclidienne"
AdditionalDeterminant = "Déterminant"
AdditionalInverse = "Inverse"
AdditionalRowEchelonForm = "Forme échelonnée"
AdditionalReducedRowEchelonForm = "Forme échelonnée réduite"
AdditionalTrace = "Trace"
CanonicalForm = "Forme canonique"
FactorizedForm = "Forme factorisée"
Discriminant = "Discriminant"
OnlyRoot = "Racine"
FirstRoot = "Première racine"
SecondRoot = "Seconde racine"

View File

@@ -1,9 +1,20 @@
CalculApp = "Számolás"
CalculAppCapital = "SZÁMOLÁS"
AdditionalResults = "További eredmények"
DecimalBase = "Decimális"
HexadecimalBase = "Hexadecimális"
BinaryBase = "Kétkomponensü"
PrimeFactors = "Alapvetö tényezök"
MixedFraction = "Vegyes frakció"
EuclideanDivision = "Euklideszi osztás"
CalculApp = "Számolás"
CalculAppCapital = "SZÁMOLÁS"
AdditionalResults = "További eredmények"
DecimalBase = "Decimális"
HexadecimalBase = "Hexadecimális"
BinaryBase = "Bináris"
PrimeFactors = "Alapvetö tényezök"
MixedFraction = "Vegyes frakció"
EuclideanDivision = "Euklideszi osztás"
AdditionalDeterminant = "Meghatározó"
AdditionalInverse = "inverz"
AdditionalRowEchelonForm = "Sor echelon forma"
AdditionalReducedRowEchelonForm = "Csökkentett sorú Echelon forma"
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

@@ -4,6 +4,17 @@ AdditionalResults = "Risultati complementari"
DecimalBase = "Decimale"
HexadecimalBase = "Esadecimale"
BinaryBase = "Binario"
PrimeFactors = "Fattori primi"
PrimeFactors = "Fattorizzazione"
MixedFraction = "Frazione mista"
EuclideanDivision = "Divisione euclidea"
AdditionalDeterminant = "Determinante"
AdditionalInverse = "Inversa"
AdditionalRowEchelonForm = "Matrice a scalini"
AdditionalReducedRowEchelonForm = "Matrice ridotta a scalini"
AdditionalTrace = "Traccia"
CanonicalForm = "Forma canonica"
FactorizedForm = "Forma fattorizzata"
Discriminant = "Discriminante"
OnlyRoot = "Radice"
FirstRoot = "Prima radice"
SecondRoot = "Seconda radice"

View File

@@ -1,9 +1,20 @@
CalculApp = "Calculatie"
CalculAppCapital = "CALCULATIE"
AdditionalResults = "Bijkomende resultaten"
CalculApp = "Rekenen"
CalculAppCapital = "REKENEN"
AdditionalResults = "Aanvullende resultaten"
DecimalBase = "Decimaal"
HexadecimalBase = "Hexadecimaal"
BinaryBase = "Binaire"
PrimeFactors = "Priemfactoren"
BinaryBase = "Binair"
PrimeFactors = "Ontbinding"
MixedFraction = "Gemengde breuk"
EuclideanDivision = "Geheeltallige deling"
AdditionalDeterminant = "Determinant"
AdditionalInverse = "Inverse"
AdditionalRowEchelonForm = "Echelonvorm"
AdditionalReducedRowEchelonForm = "Gereduceerde echelonvorm"
AdditionalTrace = "Spoor"
CanonicalForm = "Canonische vorm"
FactorizedForm = "Factorized vorm"
Discriminant = "Discriminant"
OnlyRoot = "Wortel"
FirstRoot = "Eerste wortel"
SecondRoot = "Tweede wortel"

View File

@@ -4,6 +4,17 @@ AdditionalResults = "Resultados adicionais"
DecimalBase = "Decimal"
HexadecimalBase = "Hexadecimal"
BinaryBase = "Binário"
PrimeFactors = "Fatores primos"
PrimeFactors = "Fatorização"
MixedFraction = "Fração mista"
EuclideanDivision = "Divisão euclidiana"
AdditionalDeterminant = "Determinante"
AdditionalInverse = "Matriz inversa"
AdditionalRowEchelonForm = "Matriz escalonada"
AdditionalReducedRowEchelonForm = "Matriz escalonada reduzida"
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/unit.h>
#include <poincare/unreal.h>
#include <poincare/symbol_abstract.h>
#include <string.h>
#include <cmath>
#include <algorithm>
@@ -169,7 +170,8 @@ Calculation::DisplayOutput Calculation::displayOutput(Context * context) {
ExpressionNode::Type::Sum,
ExpressionNode::Type::Derivative,
ExpressionNode::Type::ConfidenceInterval,
ExpressionNode::Type::PredictionInterval
ExpressionNode::Type::PredictionInterval,
ExpressionNode::Type::Sequence
};
return e.isOfType(approximateOnlyTypes, sizeof(approximateOnlyTypes)/sizeof(ExpressionNode::Type));
}, context)
@@ -218,7 +220,7 @@ Calculation::EqualSign Calculation::exactAndApproximateDisplayedOutputsAreEqual(
Preferences * preferences = Preferences::sharedPreferences();
// TODO: complex format should not be needed here (as it is not used to create layouts)
Preferences::ComplexFormat complexFormat = Expression::UpdatedComplexFormatWithTextInput(preferences->complexFormat(), m_inputText);
m_equalSign = Expression::ParsedExpressionsAreEqual(exactOutputText(), approximateOutputText(NumberOfSignificantDigits::UserDefined), context, complexFormat, preferences->angleUnit()) ? EqualSign::Equal : EqualSign::Approximation;
m_equalSign = Expression::ParsedExpressionsAreEqual(exactOutputText(), approximateOutputText(NumberOfSignificantDigits::UserDefined), context, complexFormat, preferences->angleUnit(), GlobalPreferences::sharedGlobalPreferences()->unitFormat()) ? EqualSign::Equal : EqualSign::Approximation;
return m_equalSign;
} else {
/* Do not override m_equalSign in case there is enough room in the pool
@@ -249,37 +251,18 @@ Calculation::AdditionalInformationType Calculation::additionalInformationType(Co
* - > input: 2cos(2) - cos(2)
* > output: cos(2)
*/
if (input().isDefinedCosineOrSine(context, complexFormat, preferences->angleUnit()) || o.isDefinedCosineOrSine(context, complexFormat, preferences->angleUnit())) {
return AdditionalInformationType::Trigonometry;
if (i.isDefinedCosineOrSineOrTangent(context, complexFormat, preferences->angleUnit())) {
return AdditionalInformationType::TrigonometryInput;
}
if (o.isDefinedCosineOrSineOrTangent(context, complexFormat, preferences->angleUnit())) {
return AdditionalInformationType::TrigonometryOutput;
}
if (o.hasUnit()) {
Expression unit;
PoincareHelpers::Reduce(&o,
App::app()->localContext(),
ExpressionNode::ReductionTarget::User,
ExpressionNode::SymbolicComputation::ReplaceAllSymbolsWithDefinitionsOrUndefined,
ExpressionNode::UnitConversion::None);
o = o.removeUnit(&unit);
// There might be no unit in the end, if the reduction was interrupted.
if (!unit.isUninitialized()) {
if (Unit::IsSI(unit)) {
if (Unit::IsSISpeed(unit) || Unit::IsSIVolume(unit) || Unit::IsSIEnergy(unit)) {
/* All these units will provide misc. classic representatives in
* addition to the SI unit in additional information. */
return AdditionalInformationType::Unit;
}
if (Unit::IsSITime(unit)) {
/* If the number of seconds is above 60s, we can write it in the form
* of an addition: 23_min + 12_s for instance. */
double value = Shared::PoincareHelpers::ApproximateToScalar<double>(o, App::app()->localContext());
if (value > Unit::SecondsPerMinute) {
return AdditionalInformationType::Unit;
}
}
return AdditionalInformationType::None;
}
return AdditionalInformationType::Unit;
}
PoincareHelpers::ReduceAndRemoveUnit(&o, App::app()->localContext(), ExpressionNode::ReductionTarget::User, &unit, ExpressionNode::SymbolicComputation::ReplaceAllSymbolsWithDefinitionsOrUndefined, ExpressionNode::UnitConversion::None);
UnitNode::Vector<int> vector = UnitNode::Vector<int>::FromBaseUnits(unit);
const Unit::Representative * representative = Unit::Representative::RepresentativeForDimension(vector);
return representative != nullptr ? AdditionalInformationType::Unit : AdditionalInformationType::None;
}
if (o.isBasedIntegerCappedBy(k_maximalIntegerWithAdditionalInformation)) {
return AdditionalInformationType::Integer;
@@ -291,6 +274,12 @@ Calculation::AdditionalInformationType Calculation::additionalInformationType(Co
if (o.hasDefinedComplexApproximation(context, complexFormat, preferences->angleUnit())) {
return AdditionalInformationType::Complex;
}
if (o.type() == ExpressionNode::Type::Matrix) {
return AdditionalInformationType::Matrix;
}
if (o.polynomialDegree(context, "x") == 2) {
return AdditionalInformationType::SecondDegree;
}
return AdditionalInformationType::None;
}

View File

@@ -21,6 +21,7 @@ class CalculationStore;
class Calculation {
friend CalculationStore;
public:
static constexpr int k_numberOfExpressions = 4;
enum class EqualSign : uint8_t {
Unknown,
Approximation,
@@ -38,8 +39,11 @@ public:
None = 0,
Integer,
Rational,
Trigonometry,
SecondDegree,
TrigonometryInput,
TrigonometryOutput,
Unit,
Matrix,
Complex
};
static bool DisplaysExact(DisplayOutput d) { return d != DisplayOutput::ApproximateOnly; }
@@ -48,7 +52,7 @@ public:
* calculations instead of clearing less space, then fail to serialize, clear
* more space, fail to serialize, clear more space, etc., until reaching
* sufficient free space. */
static int MinimalSize() { return sizeof(uint8_t) + 2*sizeof(KDCoordinate) + sizeof(uint8_t) + 3*Constant::MaxSerializedExpressionSize; }
static int MinimalSize() { return sizeof(uint8_t) + 2*sizeof(KDCoordinate) + sizeof(uint8_t) + 3*Constant::MaxSerializedExpressionSize + sizeof(Calculation *); }
Calculation() :
m_displayOutput(DisplayOutput::Unknown),
@@ -93,10 +97,8 @@ public:
// Additional Information
AdditionalInformationType additionalInformationType(Poincare::Context * context);
private:
static constexpr int maxWidth = 314;
static constexpr int k_numberOfExpressions = 4;
static constexpr KDCoordinate k_heightComputationFailureHeight = 50;
static constexpr const char * k_maximalIntegerWithAdditionalInformation = "10000000000000000";
static constexpr const char * k_maximalIntegerWithAdditionalInformation = "18446744073709551617"; // 2^64 + 1
void setHeights(KDCoordinate height, KDCoordinate expandedHeight);

View File

@@ -7,63 +7,125 @@
#include "../exam_mode_configuration.h"
#include <assert.h>
#if defined _FXCG || defined NSPIRE_NEWLIB
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <dirent.h>
#include <apps/shared/global_context.h>
static KDCoordinate dummyHeight(::Calculation::Calculation * c, bool expanded) {
bool b;
Poincare::Layout l = c->createExactOutputLayout(&b);
if (!b) {
l=c->createInputLayout();
}
KDSize s = l.layoutSize();
const int bordersize = 10;
int h = s.height() + bordersize;
const int maxheight = 64;
if (h > maxheight) {
return maxheight;
}
return h;
}
extern void * last_calculation_history;
void * last_calculation_history = 0;
const char * retrieve_calc_history();
#endif
using namespace Poincare;
using namespace Shared;
namespace Calculation {
CalculationStore::CalculationStore() :
m_bufferEnd(m_buffer),
CalculationStore::CalculationStore(char * buffer, int size) :
m_buffer(buffer),
m_bufferSize(size),
m_calculationAreaEnd(m_buffer),
m_numberOfCalculations(0),
m_slidedBuffer(false),
m_indexOfFirstMemoizedCalculationPointer(0)
m_trashIndex(-1)
{
resetMemoizedModelsAfterCalculationIndex(-1);
}
ExpiringPointer<Calculation> CalculationStore::calculationAtIndex(int i) {
assert(!m_slidedBuffer);
assert(i >= 0 && i < m_numberOfCalculations);
assert(m_indexOfFirstMemoizedCalculationPointer >= 0);
if (i >= m_indexOfFirstMemoizedCalculationPointer && i < m_indexOfFirstMemoizedCalculationPointer + k_numberOfMemoizedCalculationPointers) {
// The calculation is within the range of memoized calculations
Calculation * c = m_memoizedCalculationPointers[i-m_indexOfFirstMemoizedCalculationPointer];
if (c != nullptr) {
// The pointer was memoized
return ExpiringPointer<Calculation>(c);
assert(m_buffer != nullptr);
assert(m_bufferSize > 0);
#if defined _FXCG || defined NSPIRE_NEWLIB
if (last_calculation_history == 0){
// Restore from scriptstore
const char * buf=retrieve_calc_history();
if (buf) {
Shared::GlobalContext globalContext;
char * ptr=(char *)buf;
for (;*ptr;) {
for (;*ptr;++ptr) {
if (*ptr=='\n') {
break;
}
}
char c = *ptr;
*ptr=0;
if (ptr > buf) {
push(buf,&globalContext, dummyHeight);
}
*ptr = c;
++ptr;
buf = ptr;
}
}
c = bufferCalculationAtIndex(i);
m_memoizedCalculationPointers[i-m_indexOfFirstMemoizedCalculationPointer] = c;
return c;
last_calculation_history = (void *) this;
}
// Slide the memoization buffer
if (i >= m_indexOfFirstMemoizedCalculationPointer) {
// Slide the memoization buffer to the left
memmove(m_memoizedCalculationPointers, m_memoizedCalculationPointers+1, (k_numberOfMemoizedCalculationPointers - 1) * sizeof(Calculation *));
m_memoizedCalculationPointers[k_numberOfMemoizedCalculationPointers - 1] = nullptr;
m_indexOfFirstMemoizedCalculationPointer++;
} else {
// Slide the memoization buffer to the right
memmove(m_memoizedCalculationPointers+1, m_memoizedCalculationPointers, (k_numberOfMemoizedCalculationPointers - 1) * sizeof(Calculation *));
m_memoizedCalculationPointers[0] = nullptr;
m_indexOfFirstMemoizedCalculationPointer--;
}
return calculationAtIndex(i);
#endif
}
// Returns an expiring pointer to the calculation of index i, and ignore the trash
ExpiringPointer<Calculation> CalculationStore::calculationAtIndex(int i) {
#if defined _FXCG || defined NSPIRE_NEWLIB
last_calculation_history = (void *) this;
#endif
if (m_trashIndex == -1 || i < m_trashIndex) {
return realCalculationAtIndex(i);
} else {
return realCalculationAtIndex(i + 1);
}
}
// Returns an expiring pointer to the real calculation of index i
ExpiringPointer<Calculation> CalculationStore::realCalculationAtIndex(int i) {
assert(i >= 0 && i < m_numberOfCalculations);
// m_buffer is the address of the oldest calculation in calculation store
Calculation * c = (Calculation *) m_buffer;
if (i != m_numberOfCalculations-1) {
// The calculation we want is not the oldest one so we get its pointer
c = *reinterpret_cast<Calculation**>(addressOfPointerToCalculationOfIndex(i+1));
}
return ExpiringPointer<Calculation>(c);
}
// Pushes an expression in the store
ExpiringPointer<Calculation> CalculationStore::push(const char * text, Context * context, HeightComputer heightComputer) {
/* Compute ans now, before the buffer is slided and before the calculation
emptyTrash();
/* Compute ans now, before the buffer is updated and before the calculation
* might be deleted */
Expression ans = ansExpression(context);
// Prepare the buffer for the new calculation
int minSize = Calculation::MinimalSize();
assert(k_bufferSize > minSize);
while (remainingBufferSize() < minSize || m_numberOfCalculations > k_maxNumberOfCalculations) {
deleteLastCalculation();
/* Prepare the buffer for the new calculation
* The minimal size to store the new calculation is the minimal size of a calculation plus the pointer to its end */
int minSize = Calculation::MinimalSize() + sizeof(Calculation *);
assert(m_bufferSize > minSize);
while (remainingBufferSize() < minSize) {
// If there is no more space to store a calculation, we delete the oldest one
deleteOldestCalculation();
}
char * newCalculationsLocation = slideCalculationsToEndOfBuffer();
char * nextSerializationLocation = m_buffer;
// Getting the adresses of the limits of the free space
char * beginingOfFreeSpace = (char *)m_calculationAreaEnd;
char * endOfFreeSpace = beginingOfMemoizationArea();
char * previousCalc = beginingOfFreeSpace;
// Add the beginning of the calculation
{
@@ -71,23 +133,23 @@ ExpiringPointer<Calculation> CalculationStore::push(const char * text, Context *
* available, so this memmove will not overide anything. */
Calculation newCalc = Calculation();
size_t calcSize = sizeof(newCalc);
memmove(nextSerializationLocation, &newCalc, calcSize);
nextSerializationLocation += calcSize;
memcpy(beginingOfFreeSpace, &newCalc, calcSize);
beginingOfFreeSpace += calcSize;
}
/* Add the input expression.
* We do not store directly the text entered by the user because we do not
* want to keep Ans symbol in the calculation store. */
const char * inputSerialization = nextSerializationLocation;
const char * inputSerialization = beginingOfFreeSpace;
{
Expression input = Expression::Parse(text, context).replaceSymbolWithExpression(Symbol::Ans(), ans);
if (!pushSerializeExpression(input, nextSerializationLocation, &newCalculationsLocation)) {
if (!pushSerializeExpression(input, beginingOfFreeSpace, &endOfFreeSpace)) {
/* If the input does not fit in the store (event if the current
* calculation is the only calculation), just replace the calculation with
* undef. */
return emptyStoreAndPushUndef(context, heightComputer);
}
nextSerializationLocation += strlen(nextSerializationLocation) + 1;
beginingOfFreeSpace += strlen(beginingOfFreeSpace) + 1;
}
// Compute and serialize the outputs
@@ -110,30 +172,27 @@ ExpiringPointer<Calculation> CalculationStore::push(const char * text, Context *
if (i == numberOfOutputs - 1) {
numberOfSignificantDigits = Poincare::Preferences::sharedPreferences()->numberOfSignificantDigits();
}
if (!pushSerializeExpression(outputs[i], nextSerializationLocation, &newCalculationsLocation, numberOfSignificantDigits)) {
/* If the exat/approximate output does not fit in the store (event if the
if (!pushSerializeExpression(outputs[i], beginingOfFreeSpace, &endOfFreeSpace, numberOfSignificantDigits)) {
/* If the exact/approximate output does not fit in the store (event if the
* current calculation is the only calculation), replace the output with
* undef if it fits, else replace the whole calcualtion with undef. */
* undef if it fits, else replace the whole calculation with undef. */
Expression undef = Undefined::Builder();
if (!pushSerializeExpression(undef, nextSerializationLocation, &newCalculationsLocation)) {
if (!pushSerializeExpression(undef, beginingOfFreeSpace, &endOfFreeSpace)) {
return emptyStoreAndPushUndef(context, heightComputer);
}
}
nextSerializationLocation += strlen(nextSerializationLocation) + 1;
beginingOfFreeSpace += strlen(beginingOfFreeSpace) + 1;
}
}
// Storing the pointer of the end of the new calculation
memcpy(endOfFreeSpace-sizeof(Calculation*),&beginingOfFreeSpace,sizeof(beginingOfFreeSpace));
// Restore the other calculations
size_t slideSize = m_buffer + k_bufferSize - newCalculationsLocation;
memcpy(nextSerializationLocation, newCalculationsLocation, slideSize);
m_slidedBuffer = false;
// The new calculation is now stored
m_numberOfCalculations++;
m_bufferEnd+= nextSerializationLocation - m_buffer;
// Clean the memoization
resetMemoizedModelsAfterCalculationIndex(-1);
ExpiringPointer<Calculation> calculation = ExpiringPointer<Calculation>(reinterpret_cast<Calculation *>(m_buffer));
// The end of the calculation storage area is updated
m_calculationAreaEnd += beginingOfFreeSpace - previousCalc;
ExpiringPointer<Calculation> calculation = ExpiringPointer<Calculation>(reinterpret_cast<Calculation *>(previousCalc));
/* Heights are computed now to make sure that the display output is decided
* accordingly to the remaining size in the Poincare pool. Once it is, it
* can't change anymore: the calculation heights are fixed which ensures that
@@ -144,36 +203,51 @@ ExpiringPointer<Calculation> CalculationStore::push(const char * text, Context *
return calculation;
}
// Delete the calculation of index i
void CalculationStore::deleteCalculationAtIndex(int i) {
if (m_trashIndex != -1) {
emptyTrash();
}
m_trashIndex = i;
}
// Delete the calculation of index i, internal algorithm
void CalculationStore::realDeleteCalculationAtIndex(int i) {
assert(i >= 0 && i < m_numberOfCalculations);
assert(!m_slidedBuffer);
ExpiringPointer<Calculation> calcI = calculationAtIndex(i);
char * nextCalc = reinterpret_cast<char *>(calcI->next());
assert(m_bufferEnd >= nextCalc);
size_t slidingSize = m_bufferEnd - nextCalc;
memmove((char *)(calcI.pointer()), nextCalc, slidingSize);
m_bufferEnd -= (nextCalc - (char *)(calcI.pointer()));
m_numberOfCalculations--;
resetMemoizedModelsAfterCalculationIndex(i);
}
void CalculationStore::deleteAll() {
/* We might call deleteAll because the app closed due to a pool allocation
* failure, so we cannot assert that m_slidedBuffer is false. */
m_slidedBuffer = false;
m_bufferEnd = m_buffer;
m_numberOfCalculations = 0;
resetMemoizedModelsAfterCalculationIndex(-1);
}
void CalculationStore::tidy() {
if (m_slidedBuffer) {
deleteAll();
if (i == 0) {
ExpiringPointer<Calculation> lastCalculationPointer = realCalculationAtIndex(0);
m_calculationAreaEnd = (char *)(lastCalculationPointer.pointer());
m_numberOfCalculations--;
return;
}
resetMemoizedModelsAfterCalculationIndex(-1);
char * calcI = (char *)realCalculationAtIndex(i).pointer();
char * nextCalc = (char *) realCalculationAtIndex(i-1).pointer();
assert(m_calculationAreaEnd >= nextCalc);
size_t slidingSize = m_calculationAreaEnd - nextCalc;
// Slide the i-1 most recent calculations right after the i+1'th
memmove(calcI, nextCalc, slidingSize);
m_calculationAreaEnd -= nextCalc - calcI;
// Recompute pointer to calculations after the i'th
recomputeMemoizedPointersAfterCalculationIndex(i);
m_numberOfCalculations--;
}
// Delete the oldest calculation in the store and returns the amount of space freed by the operation
size_t CalculationStore::deleteOldestCalculation() {
char * oldBufferEnd = (char *) m_calculationAreaEnd;
realDeleteCalculationAtIndex(numberOfCalculations()-1);
char * newBufferEnd = (char *) m_calculationAreaEnd;
return oldBufferEnd - newBufferEnd;
}
// Delete all calculations
void CalculationStore::deleteAll() {
m_trashIndex = -1;
m_calculationAreaEnd = m_buffer;
m_numberOfCalculations = 0;
}
// Replace "Ans" by its expression
Expression CalculationStore::ansExpression(Context * context) {
if (numberOfCalculations() == 0) {
return Rational::Builder(0);
@@ -185,99 +259,55 @@ Expression CalculationStore::ansExpression(Context * context) {
* parsed), ans is replaced by the approximation output when any Store or
* Equal expression appears. */
Expression e = mostRecentCalculation->exactOutput();
bool exactOuptutInvolvesStoreEqual = e.type() == ExpressionNode::Type::Store || e.type() == ExpressionNode::Type::Equal;
if (mostRecentCalculation->input().recursivelyMatches(Expression::IsApproximate, context) || exactOuptutInvolvesStoreEqual) {
bool exactOutputInvolvesStoreEqual = e.type() == ExpressionNode::Type::Store || e.type() == ExpressionNode::Type::Equal;
if (mostRecentCalculation->input().recursivelyMatches(Expression::IsApproximate, context) || exactOutputInvolvesStoreEqual) {
return mostRecentCalculation->approximateOutput(context, Calculation::NumberOfSignificantDigits::Maximal);
}
return mostRecentCalculation->exactOutput();
}
Calculation * CalculationStore::bufferCalculationAtIndex(int i) {
int currentIndex = 0;
for (Calculation * c : *this) {
if (currentIndex == i) {
return c;
}
currentIndex++;
}
assert(false);
return nullptr;
}
// Push converted expression in the buffer
bool CalculationStore::pushSerializeExpression(Expression e, char * location, char * * newCalculationsLocation, int numberOfSignificantDigits) {
assert(m_slidedBuffer);
assert(*newCalculationsLocation <= m_buffer + k_bufferSize);
assert(*newCalculationsLocation <= m_buffer + m_bufferSize);
bool expressionIsPushed = false;
while (true) {
size_t locationSize = *newCalculationsLocation - location;
expressionIsPushed = (PoincareHelpers::Serialize(e, location, locationSize, numberOfSignificantDigits) < (int)locationSize-1);
if (expressionIsPushed || *newCalculationsLocation >= m_buffer + k_bufferSize) {
if (expressionIsPushed || *newCalculationsLocation >= m_buffer + m_bufferSize) {
break;
}
*newCalculationsLocation = *newCalculationsLocation + deleteLastCalculation();
assert(*newCalculationsLocation <= m_buffer + k_bufferSize);
*newCalculationsLocation = *newCalculationsLocation + deleteOldestCalculation();
assert(*newCalculationsLocation <= m_buffer + m_bufferSize);
}
return expressionIsPushed;
}
char * CalculationStore::slideCalculationsToEndOfBuffer() {
int calculationsSize = m_bufferEnd - m_buffer;
char * calculationsNewPosition = m_buffer + k_bufferSize - calculationsSize;
memmove(calculationsNewPosition, m_buffer, calculationsSize);
m_slidedBuffer = true;
return calculationsNewPosition;
void CalculationStore::emptyTrash() {
if (m_trashIndex != -1) {
realDeleteCalculationAtIndex(m_trashIndex);
m_trashIndex = -1;
}
}
size_t CalculationStore::deleteLastCalculation(const char * calculationsStart) {
assert(m_numberOfCalculations > 0);
size_t result;
if (!m_slidedBuffer) {
assert(calculationsStart == nullptr);
const char * previousBufferEnd = m_bufferEnd;
m_bufferEnd = lastCalculationPosition(m_buffer);
assert(previousBufferEnd > m_bufferEnd);
result = previousBufferEnd - m_bufferEnd;
} else {
assert(calculationsStart != nullptr);
const char * lastCalc = lastCalculationPosition(calculationsStart);
assert(*lastCalc == 0);
result = m_buffer + k_bufferSize - lastCalc;
memmove(const_cast<char *>(calculationsStart + result), calculationsStart, m_buffer + k_bufferSize - calculationsStart - result);
}
m_numberOfCalculations--;
resetMemoizedModelsAfterCalculationIndex(-1);
return result;
}
const char * CalculationStore::lastCalculationPosition(const char * calculationsStart) const {
assert(calculationsStart >= m_buffer && calculationsStart < m_buffer + k_bufferSize);
Calculation * c = reinterpret_cast<Calculation *>(const_cast<char *>(calculationsStart));
int calculationIndex = 0;
while (calculationIndex < m_numberOfCalculations - 1) {
c = c->next();
calculationIndex++;
}
return reinterpret_cast<const char *>(c);
}
Shared::ExpiringPointer<Calculation> CalculationStore::emptyStoreAndPushUndef(Context * context, HeightComputer heightComputer) {
/* We end up here as a result of a failed calculation push. The store
* attributes are not necessarily clean, so we need to reset them. */
m_slidedBuffer = false;
deleteAll();
return push(Undefined::Name(), context, heightComputer);
}
void CalculationStore::resetMemoizedModelsAfterCalculationIndex(int index) {
if (index < m_indexOfFirstMemoizedCalculationPointer) {
memset(&m_memoizedCalculationPointers, 0, k_numberOfMemoizedCalculationPointers * sizeof(Calculation *));
return;
}
if (index >= m_indexOfFirstMemoizedCalculationPointer + k_numberOfMemoizedCalculationPointers) {
return;
}
for (int i = index - m_indexOfFirstMemoizedCalculationPointer; i < k_numberOfMemoizedCalculationPointers; i++) {
m_memoizedCalculationPointers[i] = nullptr;
// Recompute memoized pointers to the calculations after index i
void CalculationStore::recomputeMemoizedPointersAfterCalculationIndex(int index) {
assert(index < m_numberOfCalculations);
// Clear pointer and recompute new ones
Calculation * c = realCalculationAtIndex(index).pointer();
Calculation * nextCalc;
while (index != 0) {
nextCalc = c->next();
memcpy(addressOfPointerToCalculationOfIndex(index), &nextCalc, sizeof(Calculation *));
c = nextCalc;
index--;
}
}

View File

@@ -7,37 +7,49 @@
namespace Calculation {
/* To optimize the storage space, we use one big buffer for all calculations.
*
* The previous solution was to keep 10 calculations, each containing 3 buffers
* (for input and outputs). To optimize the storage, we then wanted to put all
* outputs in a cache where they could be deleted to add a new entry, and
* recomputed on cache miss. However, the computation depends too much on the
* state of the memory for this to be possible. For instance:
* 6->a
* a+1
* Perform some big computations that remove a+1 from the cache
* Delete a from the variable box.
* Scroll up to display a+1 : a does not exist anymore so the outputs won't be
* recomputed correctly.
*
* Now we do not cap the number of calculations and just delete the oldests to
* create space for a new calculation. */
/*
To optimize the storage space, we use one big buffer for all calculations.
The calculations are stored one after another while pointers to the end of each
calculation are stored at the end of the buffer, in the opposite direction.
By doing so, we can memoize every calculation entered while not limiting
the number of calculation stored in the buffer.
If the remaining space is too small for storing a new calculation, we
delete the oldest one.
Memory layout :
<- Available space for new calculations ->
+--------------------------------------------------------------------------------------------------------------------+
| | | | | | | | | |
| Calculation 3 | Calculation 2 | Calculation 1 | Calculation O | |p0|p1|p2|p3|
| Oldest | | | | | | | | |
+--------------------------------------------------------------------------------------------------------------------+
^ ^ ^ ^ ^ ^
m_buffer p3 p2 p1 p0 a
m_calculationAreaEnd = p0
a = addressOfPointerToCalculation(0)
*/
class CalculationStore {
public:
CalculationStore();
CalculationStore(char * buffer, int size);
Shared::ExpiringPointer<Calculation> calculationAtIndex(int i);
typedef KDCoordinate (*HeightComputer)(Calculation * c, bool expanded);
Shared::ExpiringPointer<Calculation> push(const char * text, Poincare::Context * context, HeightComputer heightComputer);
void deleteCalculationAtIndex(int i);
void deleteAll();
int numberOfCalculations() const { return m_numberOfCalculations; }
int remainingBufferSize() const { assert(m_calculationAreaEnd >= m_buffer); return m_bufferSize - (m_calculationAreaEnd - m_buffer) - m_numberOfCalculations*sizeof(Calculation*); }
int numberOfCalculations() const { return m_numberOfCalculations - (m_trashIndex != -1); }
Poincare::Expression ansExpression(Poincare::Context * context);
void tidy();
int bufferSize() { return m_bufferSize; }
void reinsertTrash() { m_trashIndex = -1; }
private:
static constexpr int k_maxNumberOfCalculations = 25;
static constexpr int k_bufferSize = 10 * Calculation::k_numberOfExpressions * Constant::MaxSerializedExpressionSize;
void emptyTrash();
Shared::ExpiringPointer<Calculation> realCalculationAtIndex(int i);
void realDeleteCalculationAtIndex(int i);
class CalculationIterator {
public:
@@ -53,26 +65,23 @@ private:
};
CalculationIterator begin() const { return CalculationIterator(m_buffer); }
CalculationIterator end() const { return CalculationIterator(m_bufferEnd); }
CalculationIterator end() const { return CalculationIterator(m_calculationAreaEnd); }
Calculation * bufferCalculationAtIndex(int i);
int remainingBufferSize() const { assert(m_bufferEnd >= m_buffer); return k_bufferSize - (m_bufferEnd - m_buffer); }
bool pushSerializeExpression(Poincare::Expression e, char * location, char * * newCalculationsLocation, int numberOfSignificantDigits = Poincare::PrintFloat::k_numberOfStoredSignificantDigits);
char * slideCalculationsToEndOfBuffer(); // returns the new position of the calculations
size_t deleteLastCalculation(const char * calculationsStart = nullptr);
const char * lastCalculationPosition(const char * calculationsStart) const;
Shared::ExpiringPointer<Calculation> emptyStoreAndPushUndef(Poincare::Context * context, HeightComputer heightComputer);
char m_buffer[k_bufferSize];
const char * m_bufferEnd;
char * m_buffer;
int m_bufferSize;
const char * m_calculationAreaEnd;
int m_numberOfCalculations;
bool m_slidedBuffer;
int m_trashIndex;
size_t deleteOldestCalculation();
char * addressOfPointerToCalculationOfIndex(int i) {return m_buffer + m_bufferSize - (m_numberOfCalculations - i)*sizeof(Calculation *);}
// Memoization
static constexpr int k_numberOfMemoizedCalculationPointers = 10;
void resetMemoizedModelsAfterCalculationIndex(int index);
int m_indexOfFirstMemoizedCalculationPointer;
mutable Calculation * m_memoizedCalculationPointers[k_numberOfMemoizedCalculationPointers];
char * beginingOfMemoizationArea() {return addressOfPointerToCalculationOfIndex(0);};
void recomputeMemoizedPointersAfterCalculationIndex(int index);
};
}

View File

@@ -38,13 +38,14 @@ void EditExpressionController::ContentView::reload() {
markRectAsDirty(bounds());
}
EditExpressionController::EditExpressionController(Responder * parentResponder, InputEventHandlerDelegate * inputEventHandlerDelegate, HistoryController * historyController, CalculationStore * calculationStore) :
EditExpressionController::EditExpressionController(Responder * parentResponder, InputEventHandlerDelegate * inputEventHandlerDelegate, char * cacheBuffer, size_t * cacheBufferInformation, HistoryController * historyController, CalculationStore * calculationStore) :
ViewController(parentResponder),
m_cacheBuffer(cacheBuffer),
m_cacheBufferInformation(cacheBufferInformation),
m_historyController(historyController),
m_calculationStore(calculationStore),
m_contentView(this, static_cast<CalculationSelectableTableView *>(m_historyController->view()), inputEventHandlerDelegate, this, this)
{
m_cacheBuffer[0] = 0;
}
void EditExpressionController::insertTextBody(const char * text) {
@@ -58,6 +59,24 @@ void EditExpressionController::didBecomeFirstResponder() {
Container::activeApp()->setFirstResponder(m_contentView.expressionField());
}
void EditExpressionController::restoreInput() {
m_contentView.expressionField()->restoreContent(m_cacheBuffer, *m_cacheBufferInformation);
clearCacheBuffer();
}
void EditExpressionController::memoizeInput() {
*m_cacheBufferInformation = m_contentView.expressionField()->moveCursorAndDumpContent(m_cacheBuffer, k_cacheBufferSize);
}
bool EditExpressionController::handleEvent(Ion::Events::Event event) {
if (event == Ion::Events::ShiftBack) {
m_historyController->reinsertTrash();
m_historyController->reload();
return true;
}
return false;
}
void EditExpressionController::viewWillAppear() {
m_historyController->viewWillAppear();
}
@@ -128,7 +147,7 @@ bool EditExpressionController::inputViewDidReceiveEvent(Ion::Events::Event event
}
if (event == Ion::Events::Up) {
if (m_calculationStore->numberOfCalculations() > 0) {
m_cacheBuffer[0] = 0;
clearCacheBuffer();
m_contentView.expressionField()->setEditing(false, false);
Container::activeApp()->setFirstResponder(m_historyController);
}

View File

@@ -7,7 +7,6 @@
#include "../shared/text_field_delegate.h"
#include "../shared/layout_field_delegate.h"
#include "history_controller.h"
#include "calculation_store.h"
#include "selectable_table_view.h"
namespace Calculation {
@@ -15,11 +14,24 @@ namespace Calculation {
/* TODO: implement a split view */
class EditExpressionController : public ViewController, public Shared::TextFieldDelegate, public Shared::LayoutFieldDelegate {
public:
EditExpressionController(Responder * parentResponder, InputEventHandlerDelegate * inputEventHandlerDelegate, HistoryController * historyController, CalculationStore * calculationStore);
EditExpressionController(Responder * parentResponder, InputEventHandlerDelegate * inputEventHandlerDelegate, char * cacheBuffer, size_t * cacheBufferInformation, HistoryController * historyController, CalculationStore * calculationStore);
/* k_layoutBufferMaxSize dictates the size under which the expression being
* edited can be remembered when the user leaves Calculation. */
static constexpr int k_layoutBufferMaxSize = 1024;
/* k_cacheBufferSize is the size of the array to which m_cacheBuffer points.
* It is used both as a way to buffer expression when pushing them the
* CalculationStore, and as a storage for the current input when leaving the
* application. */
static constexpr int k_cacheBufferSize = (k_layoutBufferMaxSize < Constant::MaxSerializedExpressionSize) ? Constant::MaxSerializedExpressionSize : k_layoutBufferMaxSize;
View * view() override { return &m_contentView; }
void didBecomeFirstResponder() override;
void viewWillAppear() override;
void insertTextBody(const char * text);
void restoreInput();
void memoizeInput();
bool handleEvent(Ion::Events::Event event) override;
/* TextFieldDelegate */
bool textFieldDidReceiveEvent(::TextField * textField, Ion::Events::Event event) override;
@@ -47,11 +59,12 @@ private:
ExpressionField m_expressionField;
};
void reloadView();
void clearCacheBuffer() { m_cacheBuffer[0] = 0; *m_cacheBufferInformation = 0; }
bool inputViewDidReceiveEvent(Ion::Events::Event event, bool shouldDuplicateLastCalculation);
bool inputViewDidFinishEditing(const char * text, Poincare::Layout layoutR);
bool inputViewDidAbortEditing(const char * text);
static constexpr int k_cacheBufferSize = Constant::MaxSerializedExpressionSize;
char m_cacheBuffer[k_cacheBufferSize];
char * m_cacheBuffer;
size_t * m_cacheBufferInformation;
HistoryController * m_historyController;
CalculationStore * m_calculationStore;
ContentView m_contentView;

View File

@@ -1,6 +1,9 @@
#include "expression_field.h"
#include <poincare/symbol.h>
#include <poincare/horizontal_layout.h>
#include <poincare/code_point_layout.h>
using namespace Poincare;
namespace Calculation {
bool ExpressionField::handleEvent(Ion::Events::Event event) {
@@ -17,10 +20,34 @@ bool ExpressionField::handleEvent(Ion::Events::Event event) {
event == Ion::Events::Power ||
event == Ion::Events::Square ||
event == Ion::Events::Division ||
event == Ion::Events::Sto)) {
event == Ion::Events::Sto ||
event == Ion::Events::EE)) {
handleEventWithText(Poincare::Symbol::k_ans);
}
return(::ExpressionField::handleEvent(event));
if (event == Ion::Events::Minus
&& isEditing()
&& fieldHasOnlyAMinus()) {
setText(Poincare::Symbol::k_ans);
}
return (::ExpressionField::handleEvent(event));
}
bool ExpressionField::fieldHasOnlyAMinus() const {
if (editionIsInTextField()) {
const char *inputBuffer = m_textField.draftTextBuffer();
return (inputBuffer[0] == '-' && inputBuffer[1] == '\0');
}
Layout layout = m_layoutField.layout();
if (layout.type() == LayoutNode::Type::HorizontalLayout && layout.numberOfChildren() == 1) {
Layout child = layout.childAtIndex(0);
if (child.type() == LayoutNode::Type::CodePointLayout) {
CodePointLayout &codePointLayout = static_cast<CodePointLayout &>(child);
if (codePointLayout.codePoint() == '-'){
return true;
}
}
}
return false;
}
}

View File

@@ -13,6 +13,8 @@ public:
}
protected:
bool handleEvent(Ion::Events::Event event) override;
private:
bool fieldHasOnlyAMinus() const;
};
}

View File

@@ -16,8 +16,10 @@ HistoryController::HistoryController(EditExpressionController * editExpressionCo
m_complexController(editExpressionController),
m_integerController(editExpressionController),
m_rationalController(editExpressionController),
m_secondDegreeController(editExpressionController),
m_trigonometryController(editExpressionController),
m_unitController(editExpressionController)
m_unitController(editExpressionController),
m_matrixController(editExpressionController)
{
for (int i = 0; i < k_maxNumberOfDisplayedRows; i++) {
m_calculationHistory[i].setParentResponder(&m_selectableTableView);
@@ -99,17 +101,21 @@ bool HistoryController::handleEvent(Ion::Events::Event event) {
Expression e = calculationAtIndex(focusRow)->exactOutput();
if (additionalInfoType == Calculation::AdditionalInformationType::Complex) {
vc = &m_complexController;
} else if (additionalInfoType == Calculation::AdditionalInformationType::Trigonometry) {
} else if (additionalInfoType == Calculation::AdditionalInformationType::SecondDegree) {
vc = &m_secondDegreeController;
} else if (additionalInfoType == Calculation::AdditionalInformationType::TrigonometryInput) {
vc = &m_trigonometryController;
// Find which of the input or output is the cosine/sine
ExpressionNode::Type t = e.type();
e = t == ExpressionNode::Type::Cosine || t == ExpressionNode::Type::Sine ? e : calculationAtIndex(focusRow)->input();
} else if (additionalInfoType == Calculation::AdditionalInformationType::Integer) {
e = calculationAtIndex(focusRow)->input();
} else if (additionalInfoType == Calculation::AdditionalInformationType::TrigonometryOutput) {
vc = &m_trigonometryController;
} else if (additionalInfoType == Calculation::AdditionalInformationType::Integer) {
vc = &m_integerController;
} else if (additionalInfoType == Calculation::AdditionalInformationType::Rational) {
vc = &m_rationalController;
} else if (additionalInfoType == Calculation::AdditionalInformationType::Unit) {
vc = &m_unitController;
} else if (additionalInfoType == Calculation::AdditionalInformationType::Matrix) {
vc = &m_matrixController;
}
if (vc) {
vc->setExpression(e);

View File

@@ -8,8 +8,10 @@
#include "additional_outputs/complex_list_controller.h"
#include "additional_outputs/integer_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/unit_list_controller.h"
#include "additional_outputs/matrix_list_controller.h"
namespace Calculation {
@@ -33,6 +35,7 @@ public:
int typeAtLocation(int i, int j) override;
void setSelectedSubviewType(SubviewType subviewType, bool sameCell, int previousSelectedX = -1, int previousSelectedY = -1) override;
void tableViewDidChangeSelectionAndDidScroll(SelectableTableView * t, int previousSelectedCellX, int previousSelectedCellY, bool withinTemporarySelection = false) override;
void reinsertTrash() { m_calculationStore->reinsertTrash(); }
private:
int storeIndex(int i) { return numberOfRows() - i - 1; }
Shared::ExpiringPointer<Calculation> calculationAtIndex(int i);
@@ -46,8 +49,10 @@ private:
ComplexListController m_complexController;
IntegerListController m_integerController;
RationalListController m_rationalController;
SecondDegreeListController m_secondDegreeController;
TrigonometryListController m_trigonometryController;
UnitListController m_unitController;
MatrixListController m_matrixController;
};
}

View File

@@ -81,7 +81,7 @@ void HistoryViewCell::reloadSubviewHighlight() {
m_ellipsis.setHighlighted(false);
if (isHighlighted()) {
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) {
m_scrollableOutputView.evenOddCell()->setHighlighted(true);
} else {
@@ -299,6 +299,7 @@ void HistoryViewCell::setCalculation(Calculation * calculation, bool expanded, b
m_calculationDisplayOutput = calculation->displayOutput(context);
// We must set which subviews are displayed before setLayouts to mark the right rectangle as dirty
m_scrollableOutputView.setDisplayableCenter(m_calculationDisplayOutput == Calculation::DisplayOutput::ExactAndApproximate || m_calculationDisplayOutput == Calculation::DisplayOutput::ExactAndApproximateToggle);
m_scrollableOutputView.setDisplayCenter(m_calculationDisplayOutput == Calculation::DisplayOutput::ExactAndApproximate || m_calculationExpanded);
m_scrollableOutputView.setLayouts(Poincare::Layout(), exactOutputLayout, approximateOutputLayout);
I18n::Message equalMessage = calculation->exactAndApproximateDisplayedOutputsAreEqual(context) == Calculation::EqualSign::Equal ? I18n::Message::Equal : I18n::Message::AlmostEqual;

View File

@@ -5,9 +5,17 @@
#include <assert.h>
#include "../calculation_store.h"
typedef ::Calculation::Calculation::DisplayOutput DisplayOutput;
typedef ::Calculation::Calculation::EqualSign EqualSign ;
typedef ::Calculation::Calculation::NumberOfSignificantDigits NumberOfSignificantDigits;
using namespace Poincare;
using namespace Calculation;
static constexpr int calculationBufferSize = 10 * (sizeof(::Calculation::Calculation) + ::Calculation::Calculation::k_numberOfExpressions * ::Constant::MaxSerializedExpressionSize + sizeof(::Calculation::Calculation *));
char calculationBuffer[calculationBufferSize];
void assert_store_is(CalculationStore * store, const char * * result) {
for (int i = 0; i < store->numberOfCalculations(); i++) {
quiz_assert(strcmp(store->calculationAtIndex(i)->inputText(), result[i]) == 0);
@@ -18,7 +26,7 @@ KDCoordinate dummyHeight(::Calculation::Calculation * c, bool expanded) { return
QUIZ_CASE(calculation_store) {
Shared::GlobalContext globalContext;
CalculationStore store;
CalculationStore store(calculationBuffer,calculationBufferSize);
// Store is now {9, 8, 7, 6, 5, 4, 3, 2, 1, 0}
const char * result[] = {"9", "8", "7", "6", "5", "4", "3", "2", "1", "0"};
for (int i = 0; i < 10; i++) {
@@ -29,101 +37,117 @@ QUIZ_CASE(calculation_store) {
assert_store_is(&store, result);
for (int i = 9; i > 0; i = i-2) {
store.deleteCalculationAtIndex(i);
store.deleteCalculationAtIndex(i);
}
// Store is now {9, 7, 5, 3, 1}
const char * result2[] = {"9", "7", "5", "3", "1"};
assert_store_is(&store, result2);
store.deleteAll();
// Checking if the store handles correctly the delete of the oldest calculation when full
static int minSize = ::Calculation::Calculation::MinimalSize();
char text[2] = {'0', 0};
while (store.remainingBufferSize() > minSize) {
store.push(text, &globalContext, dummyHeight);
}
int numberOfCalculations1 = store.numberOfCalculations();
/* The buffer is now to full to push a new calculation.
* Trying to push a new one should delete the oldest one*/
store.push(text, &globalContext, dummyHeight);
int numberOfCalculations2 = store.numberOfCalculations();
// The numberOfCalculations should be the same
quiz_assert(numberOfCalculations1 == numberOfCalculations2);
store.deleteAll();
quiz_assert(store.remainingBufferSize() == store.bufferSize());
}
QUIZ_CASE(calculation_ans) {
Shared::GlobalContext globalContext;
CalculationStore store;
CalculationStore store(calculationBuffer,calculationBufferSize);
store.push("1+3/4", &globalContext, dummyHeight);
store.push("ans+2/3", &globalContext, dummyHeight);
Shared::ExpiringPointer<::Calculation::Calculation> lastCalculation = store.calculationAtIndex(0);
quiz_assert(lastCalculation->displayOutput(&globalContext) == ::Calculation::Calculation::DisplayOutput::ExactAndApproximate);
quiz_assert(lastCalculation->displayOutput(&globalContext) == DisplayOutput::ExactAndApproximate);
quiz_assert(strcmp(lastCalculation->exactOutputText(),"29/12") == 0);
store.push("ans+0.22", &globalContext, dummyHeight);
lastCalculation = store.calculationAtIndex(0);
quiz_assert(lastCalculation->displayOutput(&globalContext) == ::Calculation::Calculation::DisplayOutput::ExactAndApproximateToggle);
quiz_assert(strcmp(lastCalculation->approximateOutputText(::Calculation::Calculation::NumberOfSignificantDigits::Maximal),"2.6366666666667") == 0);
quiz_assert(lastCalculation->displayOutput(&globalContext) == DisplayOutput::ExactAndApproximateToggle);
quiz_assert(strcmp(lastCalculation->approximateOutputText(NumberOfSignificantDigits::Maximal),"2.6366666666667") == 0);
store.deleteAll();
}
void assertCalculationIs(const char * input, ::Calculation::Calculation::DisplayOutput display, ::Calculation::Calculation::EqualSign sign, const char * exactOutput, const char * displayedApproximateOutput, const char * storedApproximateOutput, Context * context, CalculationStore * store) {
void assertCalculationIs(const char * input, DisplayOutput display, EqualSign sign, const char * exactOutput, const char * displayedApproximateOutput, const char * storedApproximateOutput, Context * context, CalculationStore * store) {
store->push(input, context, dummyHeight);
Shared::ExpiringPointer<::Calculation::Calculation> lastCalculation = store->calculationAtIndex(0);
quiz_assert(lastCalculation->displayOutput(context) == display);
if (sign != ::Calculation::Calculation::EqualSign::Unknown) {
if (sign != EqualSign::Unknown) {
quiz_assert(lastCalculation->exactAndApproximateDisplayedOutputsAreEqual(context) == sign);
}
if (exactOutput) {
quiz_assert_print_if_failure(strcmp(lastCalculation->exactOutputText(), exactOutput) == 0, input);
}
if (displayedApproximateOutput) {
quiz_assert_print_if_failure(strcmp(lastCalculation->approximateOutputText(::Calculation::Calculation::NumberOfSignificantDigits::UserDefined), displayedApproximateOutput) == 0, input);
quiz_assert_print_if_failure(strcmp(lastCalculation->approximateOutputText(NumberOfSignificantDigits::UserDefined), displayedApproximateOutput) == 0, input);
}
if (storedApproximateOutput) {
quiz_assert_print_if_failure(strcmp(lastCalculation->approximateOutputText(::Calculation::Calculation::NumberOfSignificantDigits::Maximal), storedApproximateOutput) == 0, input);
quiz_assert_print_if_failure(strcmp(lastCalculation->approximateOutputText(NumberOfSignificantDigits::Maximal), storedApproximateOutput) == 0, input);
}
store->deleteAll();
}
QUIZ_CASE(calculation_significant_digits) {
Shared::GlobalContext globalContext;
CalculationStore store;
CalculationStore store(calculationBuffer,calculationBufferSize);
assertCalculationIs("123456789", ::Calculation::Calculation::DisplayOutput::ExactAndApproximate, ::Calculation::Calculation::EqualSign::Approximation, "123456789", "1.234568ᴇ8", "123456789", &globalContext, &store);
assertCalculationIs("1234567", ::Calculation::Calculation::DisplayOutput::ApproximateOnly, ::Calculation::Calculation::EqualSign::Equal, "1234567", "1234567", "1234567", &globalContext, &store);
assertCalculationIs("123456789", DisplayOutput::ExactAndApproximate, EqualSign::Approximation, "123456789", "1.234568ᴇ8", "123456789", &globalContext, &store);
assertCalculationIs("1234567", DisplayOutput::ApproximateOnly, EqualSign::Equal, "1234567", "1234567", "1234567", &globalContext, &store);
}
QUIZ_CASE(calculation_display_exact_approximate) {
Shared::GlobalContext globalContext;
CalculationStore store;
CalculationStore store(calculationBuffer,calculationBufferSize);
assertCalculationIs("1/2", ::Calculation::Calculation::DisplayOutput::ExactAndApproximate, ::Calculation::Calculation::EqualSign::Equal, nullptr, nullptr, nullptr, &globalContext, &store);
assertCalculationIs("1/3", ::Calculation::Calculation::DisplayOutput::ExactAndApproximate, ::Calculation::Calculation::EqualSign::Approximation, nullptr, nullptr, nullptr, &globalContext, &store);
assertCalculationIs("1/0", ::Calculation::Calculation::DisplayOutput::ApproximateOnly, ::Calculation::Calculation::EqualSign::Unknown, "undef", "undef", "undef", &globalContext, &store);
assertCalculationIs("2x-x", ::Calculation::Calculation::DisplayOutput::ApproximateOnly, ::Calculation::Calculation::EqualSign::Unknown, "undef", "undef", "undef", &globalContext, &store);
assertCalculationIs("[[1,2,3]]", ::Calculation::Calculation::DisplayOutput::ApproximateOnly, ::Calculation::Calculation::EqualSign::Unknown, nullptr, nullptr, nullptr, &globalContext, &store);
assertCalculationIs("[[1,x,3]]", ::Calculation::Calculation::DisplayOutput::ApproximateOnly, ::Calculation::Calculation::EqualSign::Unknown, nullptr, "undef", "undef", &globalContext, &store);
assertCalculationIs("28^7", ::Calculation::Calculation::DisplayOutput::ExactAndApproximate, ::Calculation::Calculation::EqualSign::Unknown, nullptr, nullptr, nullptr, &globalContext, &store);
assertCalculationIs("3+√(2)→a", ::Calculation::Calculation::DisplayOutput::ExactAndApproximate, ::Calculation::Calculation::EqualSign::Approximation, "√(2)+3", nullptr, nullptr, &globalContext, &store);
assertCalculationIs("1/2", DisplayOutput::ExactAndApproximate, EqualSign::Equal, nullptr, nullptr, nullptr, &globalContext, &store);
assertCalculationIs("1/3", DisplayOutput::ExactAndApproximate, EqualSign::Approximation, nullptr, nullptr, nullptr, &globalContext, &store);
assertCalculationIs("1/0", DisplayOutput::ExactOnly, EqualSign::Unknown, "undef", "undef", "undef", &globalContext, &store);
assertCalculationIs("2x-x", DisplayOutput::ExactOnly, EqualSign::Unknown, "x", "undef", "undef", &globalContext, &store);
assertCalculationIs("[[1,2,3]]", DisplayOutput::ApproximateOnly, EqualSign::Unknown, nullptr, nullptr, nullptr, &globalContext, &store);
assertCalculationIs("[[1,x,3]]", DisplayOutput::ExactAndApproximate, EqualSign::Unknown, nullptr, "[[1,undef,3]]", "[[1,undef,3]]", &globalContext, &store);
assertCalculationIs("28^7", DisplayOutput::ExactAndApproximate, EqualSign::Unknown, nullptr, nullptr, nullptr, &globalContext, &store);
assertCalculationIs("3+√(2)→a", DisplayOutput::ExactAndApproximate, EqualSign::Approximation, "√(2)+3", nullptr, nullptr, &globalContext, &store);
Ion::Storage::sharedStorage()->recordNamed("a.exp").destroy();
assertCalculationIs("3+2→a", ::Calculation::Calculation::DisplayOutput::ApproximateOnly, ::Calculation::Calculation::EqualSign::Equal, "5", "5", "5", &globalContext, &store);
assertCalculationIs("3+2→a", DisplayOutput::ApproximateOnly, EqualSign::Equal, "5", "5", "5", &globalContext, &store);
Ion::Storage::sharedStorage()->recordNamed("a.exp").destroy();
assertCalculationIs("3→a", ::Calculation::Calculation::DisplayOutput::ApproximateOnly, ::Calculation::Calculation::EqualSign::Equal, "3", "3", "3", &globalContext, &store);
assertCalculationIs("3→a", DisplayOutput::ApproximateOnly, EqualSign::Equal, "3", "3", "3", &globalContext, &store);
Ion::Storage::sharedStorage()->recordNamed("a.exp").destroy();
assertCalculationIs("3+x→f(x)", ::Calculation::Calculation::DisplayOutput::ExactOnly, ::Calculation::Calculation::EqualSign::Unknown, "x+3", nullptr, nullptr, &globalContext, &store);
assertCalculationIs("3+x→f(x)", DisplayOutput::ExactOnly, EqualSign::Unknown, "x+3", nullptr, nullptr, &globalContext, &store);
Ion::Storage::sharedStorage()->recordNamed("f.func").destroy();
assertCalculationIs("1+1+random()", ::Calculation::Calculation::DisplayOutput::ApproximateOnly, ::Calculation::Calculation::EqualSign::Unknown, nullptr, nullptr, nullptr, &globalContext, &store);
assertCalculationIs("1+1+round(1.343,2)", ::Calculation::Calculation::DisplayOutput::ApproximateOnly, ::Calculation::Calculation::EqualSign::Unknown, nullptr, "3.34", "3.34", &globalContext, &store);
assertCalculationIs("randint(2,2)+3", ::Calculation::Calculation::DisplayOutput::ApproximateOnly, ::Calculation::Calculation::EqualSign::Unknown, "5", "5", "5", &globalContext, &store);
assertCalculationIs("confidence(0.5,2)+3", ::Calculation::Calculation::DisplayOutput::ApproximateOnly, ::Calculation::Calculation::EqualSign::Unknown, nullptr, nullptr, nullptr, &globalContext, &store);
assertCalculationIs("prediction(0.5,2)+3", ::Calculation::Calculation::DisplayOutput::ApproximateOnly, ::Calculation::Calculation::EqualSign::Unknown, nullptr, nullptr, nullptr, &globalContext, &store);
assertCalculationIs("prediction95(0.5,2)+3", ::Calculation::Calculation::DisplayOutput::ApproximateOnly, ::Calculation::Calculation::EqualSign::Unknown, nullptr, nullptr, nullptr, &globalContext, &store);
assertCalculationIs("1+1+random()", DisplayOutput::ApproximateOnly, EqualSign::Unknown, nullptr, nullptr, nullptr, &globalContext, &store);
assertCalculationIs("1+1+round(1.343,2)", DisplayOutput::ApproximateOnly, EqualSign::Unknown, nullptr, "3.34", "3.34", &globalContext, &store);
assertCalculationIs("randint(2,2)+3", DisplayOutput::ApproximateOnly, EqualSign::Unknown, "5", "5", "5", &globalContext, &store);
assertCalculationIs("confidence(0.5,2)+3", DisplayOutput::ExactOnly, EqualSign::Unknown, nullptr, nullptr, nullptr, &globalContext, &store);
assertCalculationIs("prediction(0.5,2)+3", DisplayOutput::ExactOnly, EqualSign::Unknown, nullptr, nullptr, nullptr, &globalContext, &store);
assertCalculationIs("prediction95(0.5,2)+3", DisplayOutput::ExactOnly, EqualSign::Unknown, nullptr, nullptr, nullptr, &globalContext, &store);
}
QUIZ_CASE(calculation_symbolic_computation) {
Shared::GlobalContext globalContext;
CalculationStore store;
CalculationStore store(calculationBuffer,calculationBufferSize);
assertCalculationIs("x+x+1+3+√(π)", ::Calculation::Calculation::DisplayOutput::ApproximateOnly, ::Calculation::Calculation::EqualSign::Unknown, "undef", "undef", "undef", &globalContext, &store);
assertCalculationIs("f(x)", ::Calculation::Calculation::DisplayOutput::ApproximateOnly, ::Calculation::Calculation::EqualSign::Unknown, "undef", "undef", "undef", &globalContext, &store);
assertCalculationIs("1+x→f(x)", ::Calculation::Calculation::DisplayOutput::ExactOnly, ::Calculation::Calculation::EqualSign::Unknown, "x+1", nullptr, nullptr, &globalContext, &store);
assertCalculationIs("f(x)", ::Calculation::Calculation::DisplayOutput::ApproximateOnly, ::Calculation::Calculation::EqualSign::Unknown, "undef", "undef", "undef", &globalContext, &store);
assertCalculationIs("f(2)", ::Calculation::Calculation::DisplayOutput::ApproximateOnly, ::Calculation::Calculation::EqualSign::Equal, "3", "3", "3", &globalContext, &store);
assertCalculationIs("2→x", ::Calculation::Calculation::DisplayOutput::ApproximateOnly, ::Calculation::Calculation::EqualSign::Equal, "2", nullptr, nullptr, &globalContext, &store);
assertCalculationIs("f(x)", ::Calculation::Calculation::DisplayOutput::ApproximateOnly, ::Calculation::Calculation::EqualSign::Equal, "3", nullptr, nullptr, &globalContext, &store);
assertCalculationIs("x+x+1+3+√(π)", ::Calculation::Calculation::DisplayOutput::ExactAndApproximate, ::Calculation::Calculation::EqualSign::Approximation, "√(π)+8", nullptr, nullptr, &globalContext, &store);
assertCalculationIs("x+x+1+3+√(π)", DisplayOutput::ExactOnly, EqualSign::Unknown, "2×x+√(π)+4", "undef", "undef", &globalContext, &store);
assertCalculationIs("f(x)", DisplayOutput::ExactOnly, EqualSign::Unknown, "f×x", "undef", "undef", &globalContext, &store);
assertCalculationIs("1+x→f(x)", DisplayOutput::ExactOnly, EqualSign::Unknown, "x+1", nullptr, nullptr, &globalContext, &store);
assertCalculationIs("f(x)", DisplayOutput::ExactOnly, EqualSign::Unknown, "x+1", "undef", "undef", &globalContext, &store);
assertCalculationIs("f(2)", DisplayOutput::ApproximateOnly, EqualSign::Equal, "3", "3", "3", &globalContext, &store);
assertCalculationIs("2→x", DisplayOutput::ApproximateOnly, EqualSign::Equal, "2", nullptr, nullptr, &globalContext, &store);
assertCalculationIs("f(x)", DisplayOutput::ApproximateOnly, EqualSign::Equal, "3", nullptr, nullptr, &globalContext, &store);
assertCalculationIs("x+x+1+3+√(π)", DisplayOutput::ExactAndApproximate, EqualSign::Approximation, "√(π)+8", nullptr, nullptr, &globalContext, &store);
Ion::Storage::sharedStorage()->recordNamed("f.func").destroy();
Ion::Storage::sharedStorage()->recordNamed("x.exp").destroy();
@@ -131,18 +155,18 @@ QUIZ_CASE(calculation_symbolic_computation) {
QUIZ_CASE(calculation_symbolic_computation_and_parametered_expressions) {
Shared::GlobalContext globalContext;
CalculationStore store;
CalculationStore store(calculationBuffer,calculationBufferSize);
assertCalculationIs("int((^(-x))-x^(0.5), x, 0, 3)", ::Calculation::Calculation::DisplayOutput::ApproximateOnly, ::Calculation::Calculation::EqualSign::Unknown, nullptr, nullptr, nullptr, &globalContext, &store); // Tests a bug with symbolic computation
assertCalculationIs("int(x,x,0,2)", ::Calculation::Calculation::DisplayOutput::ApproximateOnly, ::Calculation::Calculation::EqualSign::Unknown, nullptr, "2", "2", &globalContext, &store);
assertCalculationIs("sum(x,x,0,2)", ::Calculation::Calculation::DisplayOutput::ApproximateOnly, ::Calculation::Calculation::EqualSign::Unknown, nullptr, "3", "3", &globalContext, &store);
assertCalculationIs("product(x,x,1,2)", ::Calculation::Calculation::DisplayOutput::ApproximateOnly, ::Calculation::Calculation::EqualSign::Unknown, nullptr, "2", "2", &globalContext, &store);
assertCalculationIs("diff(x^2,x,3)", ::Calculation::Calculation::DisplayOutput::ApproximateOnly, ::Calculation::Calculation::EqualSign::Unknown, nullptr, "6", "6", &globalContext, &store);
assertCalculationIs("2→x", ::Calculation::Calculation::DisplayOutput::ApproximateOnly, ::Calculation::Calculation::EqualSign::Unknown, nullptr, nullptr, nullptr, &globalContext, &store);
assertCalculationIs("int(x,x,0,2)", ::Calculation::Calculation::DisplayOutput::ApproximateOnly, ::Calculation::Calculation::EqualSign::Unknown, nullptr, "2", "2", &globalContext, &store);
assertCalculationIs("sum(x,x,0,2)", ::Calculation::Calculation::DisplayOutput::ApproximateOnly, ::Calculation::Calculation::EqualSign::Unknown, nullptr, "3", "3", &globalContext, &store);
assertCalculationIs("product(x,x,1,2)", ::Calculation::Calculation::DisplayOutput::ApproximateOnly, ::Calculation::Calculation::EqualSign::Unknown, nullptr, "2", "2", &globalContext, &store);
assertCalculationIs("diff(x^2,x,3)", ::Calculation::Calculation::DisplayOutput::ApproximateOnly, ::Calculation::Calculation::EqualSign::Unknown, nullptr, "6", "6", &globalContext, &store);
assertCalculationIs("int((^(-x))-x^(0.5), x, 0, 3)", DisplayOutput::ApproximateOnly, EqualSign::Unknown, nullptr, nullptr, nullptr, &globalContext, &store); // Tests a bug with symbolic computation
assertCalculationIs("int(x,x,0,2)", DisplayOutput::ApproximateOnly, EqualSign::Unknown, nullptr, "2", "2", &globalContext, &store);
assertCalculationIs("sum(x,x,0,2)", DisplayOutput::ApproximateOnly, EqualSign::Unknown, nullptr, "3", "3", &globalContext, &store);
assertCalculationIs("product(x,x,1,2)", DisplayOutput::ApproximateOnly, EqualSign::Unknown, nullptr, "2", "2", &globalContext, &store);
assertCalculationIs("diff(x^2,x,3)", DisplayOutput::ApproximateOnly, EqualSign::Unknown, nullptr, "6", "6", &globalContext, &store);
assertCalculationIs("2→x", DisplayOutput::ApproximateOnly, EqualSign::Unknown, nullptr, nullptr, nullptr, &globalContext, &store);
assertCalculationIs("int(x,x,0,2)", DisplayOutput::ApproximateOnly, EqualSign::Unknown, nullptr, "2", "2", &globalContext, &store);
assertCalculationIs("sum(x,x,0,2)", DisplayOutput::ApproximateOnly, EqualSign::Unknown, nullptr, "3", "3", &globalContext, &store);
assertCalculationIs("product(x,x,1,2)", DisplayOutput::ApproximateOnly, EqualSign::Unknown, nullptr, "2", "2", &globalContext, &store);
assertCalculationIs("diff(x^2,x,3)", DisplayOutput::ApproximateOnly, EqualSign::Unknown, nullptr, "6", "6", &globalContext, &store);
Ion::Storage::sharedStorage()->recordNamed("x.exp").destroy();
}
@@ -150,34 +174,34 @@ QUIZ_CASE(calculation_symbolic_computation_and_parametered_expressions) {
QUIZ_CASE(calculation_complex_format) {
Shared::GlobalContext globalContext;
CalculationStore store;
CalculationStore store(calculationBuffer,calculationBufferSize);
Poincare::Preferences::sharedPreferences()->setComplexFormat(Poincare::Preferences::ComplexFormat::Real);
assertCalculationIs("1+𝐢", ::Calculation::Calculation::DisplayOutput::ApproximateOnly, ::Calculation::Calculation::EqualSign::Unknown, nullptr, "1+𝐢", "1+𝐢", &globalContext, &store);
assertCalculationIs("√(-1)", ::Calculation::Calculation::DisplayOutput::ApproximateOnly, ::Calculation::Calculation::EqualSign::Unknown, "unreal", nullptr, nullptr, &globalContext, &store);
assertCalculationIs("ln(-2)", ::Calculation::Calculation::DisplayOutput::ApproximateOnly, ::Calculation::Calculation::EqualSign::Unknown, nullptr, "unreal", "unreal", &globalContext, &store);
assertCalculationIs("√(-1)×√(-1)", ::Calculation::Calculation::DisplayOutput::ApproximateOnly, ::Calculation::Calculation::EqualSign::Unknown, nullptr, "unreal", "unreal", &globalContext, &store);
assertCalculationIs("(-8)^(1/3)", ::Calculation::Calculation::DisplayOutput::ApproximateOnly, ::Calculation::Calculation::EqualSign::Unknown, nullptr, "-2", "-2", &globalContext, &store);
assertCalculationIs("(-8)^(2/3)", ::Calculation::Calculation::DisplayOutput::ApproximateOnly, ::Calculation::Calculation::EqualSign::Unknown, nullptr, "4", "4", &globalContext, &store);
assertCalculationIs("(-2)^(1/4)", ::Calculation::Calculation::DisplayOutput::ApproximateOnly, ::Calculation::Calculation::EqualSign::Unknown, nullptr, "unreal", "unreal", &globalContext, &store);
assertCalculationIs("1+𝐢", DisplayOutput::ApproximateOnly, EqualSign::Unknown, nullptr, "1+𝐢", "1+𝐢", &globalContext, &store);
assertCalculationIs("√(-1)", DisplayOutput::ApproximateOnly, EqualSign::Unknown, "unreal", nullptr, nullptr, &globalContext, &store);
assertCalculationIs("ln(-2)", DisplayOutput::ApproximateOnly, EqualSign::Unknown, nullptr, "unreal", "unreal", &globalContext, &store);
assertCalculationIs("√(-1)×√(-1)", DisplayOutput::ApproximateOnly, EqualSign::Unknown, nullptr, "unreal", "unreal", &globalContext, &store);
assertCalculationIs("(-8)^(1/3)", DisplayOutput::ApproximateOnly, EqualSign::Unknown, nullptr, "-2", "-2", &globalContext, &store);
assertCalculationIs("(-8)^(2/3)", DisplayOutput::ApproximateOnly, EqualSign::Unknown, nullptr, "4", "4", &globalContext, &store);
assertCalculationIs("(-2)^(1/4)", DisplayOutput::ApproximateOnly, EqualSign::Unknown, nullptr, "unreal", "unreal", &globalContext, &store);
Poincare::Preferences::sharedPreferences()->setComplexFormat(Poincare::Preferences::ComplexFormat::Cartesian);
assertCalculationIs("1+𝐢", ::Calculation::Calculation::DisplayOutput::ApproximateOnly, ::Calculation::Calculation::EqualSign::Unknown, nullptr, "1+𝐢", "1+𝐢", &globalContext, &store);
assertCalculationIs("√(-1)", ::Calculation::Calculation::DisplayOutput::ApproximateOnly, ::Calculation::Calculation::EqualSign::Unknown, nullptr, "𝐢", "𝐢", &globalContext, &store);
assertCalculationIs("ln(-2)", ::Calculation::Calculation::DisplayOutput::ExactAndApproximate, ::Calculation::Calculation::EqualSign::Approximation, "ln(-2)", nullptr, nullptr, &globalContext, &store);
assertCalculationIs("√(-1)×√(-1)", ::Calculation::Calculation::DisplayOutput::ApproximateOnly, ::Calculation::Calculation::EqualSign::Unknown, nullptr, "-1", "-1", &globalContext, &store);
assertCalculationIs("(-8)^(1/3)", ::Calculation::Calculation::DisplayOutput::ExactAndApproximate, ::Calculation::Calculation::EqualSign::Approximation, "1+√(3)×𝐢", nullptr, nullptr, &globalContext, &store);
assertCalculationIs("(-8)^(2/3)", ::Calculation::Calculation::DisplayOutput::ExactAndApproximate, ::Calculation::Calculation::EqualSign::Approximation, "-2+2×√(3)×𝐢", nullptr, nullptr, &globalContext, &store);
assertCalculationIs("(-2)^(1/4)", ::Calculation::Calculation::DisplayOutput::ExactAndApproximate, ::Calculation::Calculation::EqualSign::Approximation, "root(8,4)/2+root(8,4)/2×𝐢", nullptr, nullptr, &globalContext, &store);
assertCalculationIs("1+𝐢", DisplayOutput::ApproximateOnly, EqualSign::Unknown, nullptr, "1+𝐢", "1+𝐢", &globalContext, &store);
assertCalculationIs("√(-1)", DisplayOutput::ApproximateOnly, EqualSign::Unknown, nullptr, "𝐢", "𝐢", &globalContext, &store);
assertCalculationIs("ln(-2)", DisplayOutput::ExactAndApproximate, EqualSign::Approximation, "ln(-2)", nullptr, nullptr, &globalContext, &store);
assertCalculationIs("√(-1)×√(-1)", DisplayOutput::ApproximateOnly, EqualSign::Unknown, nullptr, "-1", "-1", &globalContext, &store);
assertCalculationIs("(-8)^(1/3)", DisplayOutput::ExactAndApproximate, EqualSign::Approximation, "1+√(3)×𝐢", nullptr, nullptr, &globalContext, &store);
assertCalculationIs("(-8)^(2/3)", DisplayOutput::ExactAndApproximate, EqualSign::Approximation, "-2+2×√(3)×𝐢", nullptr, nullptr, &globalContext, &store);
assertCalculationIs("(-2)^(1/4)", DisplayOutput::ExactAndApproximate, EqualSign::Approximation, "root(8,4)/2+root(8,4)/2×𝐢", nullptr, nullptr, &globalContext, &store);
Poincare::Preferences::sharedPreferences()->setComplexFormat(Poincare::Preferences::ComplexFormat::Polar);
assertCalculationIs("1+𝐢", ::Calculation::Calculation::DisplayOutput::ExactAndApproximate, ::Calculation::Calculation::EqualSign::Approximation, "√(2)×^\u0012π/4×𝐢\u0013", nullptr, nullptr, &globalContext, &store);
assertCalculationIs("√(-1)", ::Calculation::Calculation::DisplayOutput::ExactAndApproximate, ::Calculation::Calculation::EqualSign::Approximation, "^\u0012π/2×𝐢\u0013", nullptr, nullptr, &globalContext, &store);
assertCalculationIs("ln(-2)", ::Calculation::Calculation::DisplayOutput::ExactAndApproximate, ::Calculation::Calculation::EqualSign::Approximation, "ln(-2)", nullptr, nullptr, &globalContext, &store);
assertCalculationIs("√(-1)×√(-1)", ::Calculation::Calculation::DisplayOutput::ExactAndApproximate, ::Calculation::Calculation::EqualSign::Unknown, nullptr, "^\u00123.141593×𝐢\u0013", "^\u00123.1415926535898×𝐢\u0013", &globalContext, &store);
assertCalculationIs("(-8)^(1/3)", ::Calculation::Calculation::DisplayOutput::ExactAndApproximate, ::Calculation::Calculation::EqualSign::Approximation, "2×^\u0012π/3×𝐢\u0013", nullptr, nullptr, &globalContext, &store);
assertCalculationIs("(-8)^(2/3)", ::Calculation::Calculation::DisplayOutput::ExactAndApproximate, ::Calculation::Calculation::EqualSign::Approximation, "4×^\u0012\u00122×π\u0013/3×𝐢\u0013", nullptr, nullptr, &globalContext, &store);
assertCalculationIs("(-2)^(1/4)", ::Calculation::Calculation::DisplayOutput::ExactAndApproximate, ::Calculation::Calculation::EqualSign::Approximation, "root(2,4)×^\u0012π/4×𝐢\u0013", nullptr, nullptr, &globalContext, &store);
assertCalculationIs("1+𝐢", DisplayOutput::ExactAndApproximate, EqualSign::Approximation, "√(2)×^\u0012π/4×𝐢\u0013", nullptr, nullptr, &globalContext, &store);
assertCalculationIs("√(-1)", DisplayOutput::ExactAndApproximate, EqualSign::Approximation, "^\u0012π/2×𝐢\u0013", nullptr, nullptr, &globalContext, &store);
assertCalculationIs("ln(-2)", DisplayOutput::ExactAndApproximate, EqualSign::Approximation, "ln(-2)", nullptr, nullptr, &globalContext, &store);
assertCalculationIs("√(-1)×√(-1)", DisplayOutput::ExactAndApproximate, EqualSign::Unknown, nullptr, "^\u00123.141593×𝐢\u0013", "^\u00123.1415926535898×𝐢\u0013", &globalContext, &store);
assertCalculationIs("(-8)^(1/3)", DisplayOutput::ExactAndApproximate, EqualSign::Approximation, "2×^\u0012π/3×𝐢\u0013", nullptr, nullptr, &globalContext, &store);
assertCalculationIs("(-8)^(2/3)", DisplayOutput::ExactAndApproximate, EqualSign::Approximation, "4×^\u0012\u00122×π\u0013/3×𝐢\u0013", nullptr, nullptr, &globalContext, &store);
assertCalculationIs("(-2)^(1/4)", DisplayOutput::ExactAndApproximate, EqualSign::Approximation, "root(2,4)×^\u0012π/4×𝐢\u0013", nullptr, nullptr, &globalContext, &store);
Poincare::Preferences::sharedPreferences()->setComplexFormat(Poincare::Preferences::ComplexFormat::Cartesian);
}

12
apps/clock_timer.cpp Normal file
View File

@@ -0,0 +1,12 @@
#include "clock_timer.h"
#include "apps_container.h"
ClockTimer::ClockTimer(AppsContainer * container) :
Timer(1),
m_container(container)
{
}
bool ClockTimer::fire() {
return m_container->updateClock();
}

16
apps/clock_timer.h Normal file
View File

@@ -0,0 +1,16 @@
#ifndef APPS_CLOCK_TIMER_H
#define APPS_CLOCK_TIMER_H
#include <escher.h>
class AppsContainer;
class ClockTimer : public Timer {
public:
ClockTimer(AppsContainer * container);
private:
bool fire() override;
AppsContainer * m_container;
};
#endif

View File

@@ -1,6 +1,8 @@
apps += Code::App
app_headers += apps/code/app.h
SFLAGS += -DHAS_CODE
app_code_src = $(addprefix apps/code/,\
app.cpp \
console_controller.cpp \
@@ -15,6 +17,7 @@ app_code_src = $(addprefix apps/code/,\
sandbox_controller.cpp \
script_name_cell.cpp \
script_parameter_controller.cpp \
toolbox_ion_keys.cpp \
)
app_code_test_src = $(addprefix apps/code/,\
@@ -29,6 +32,7 @@ app_code_test_src = $(addprefix apps/code/,\
tests_src += $(addprefix apps/code/test/,\
variable_box_controller.cpp\
toolbox_ion_keys_dummy.cpp \
)
app_code_src += $(app_code_test_src)

View File

@@ -3,6 +3,13 @@
#include <apps/i18n.h>
#include "helpers.h"
#include <ion/unicode/utf8_helper.h>
#include <apps/apps_container.h>
#if defined _FXCG || defined NSPIRE_NEWLIB
extern "C" int calculator;
extern "C" const int prizm_heap_size;
extern "C" char prizm_heap[];
#endif
namespace Code {
@@ -89,16 +96,18 @@ App::App(Snapshot * snapshot) :
, snapshot->lockOnConsole()
#endif
),
m_listFooter(&m_codeStackViewController, &m_menuController, &m_menuController, ButtonRowController::Position::Bottom, ButtonRowController::Style::EmbossedGrey, ButtonRowController::Size::Large),
m_listFooter(&m_codeStackViewController, &m_menuController, &m_menuController, ButtonRowController::Position::Bottom, ButtonRowController::Style::EmbossedGray, ButtonRowController::Size::Large),
m_menuController(&m_listFooter, this, snapshot->scriptStore(), &m_listFooter),
m_codeStackViewController(&m_modalViewController, &m_listFooter),
m_variableBoxController(snapshot->scriptStore())
{
Clipboard::sharedClipboard()->enterPython();
}
App::~App() {
assert(!m_consoleController.inputRunLoopActive());
deinitPython();
Clipboard::sharedClipboard()->exitPython();
}
bool App::handleEvent(Ion::Events::Event event) {
@@ -127,6 +136,16 @@ VariableBoxController * App::variableBoxForInputEventHandler(InputEventHandler *
}
bool App::textInputDidReceiveEvent(InputEventHandler * textInput, Ion::Events::Event event) {
if (event == Ion::Events::XNT) {
int bufferSize = CodePoint::MaxCodePointCharLength + 1;
char buffer[bufferSize];
bool shouldRemoveLastCharacter = false;
CodePoint codePoint = AppsContainer::sharedAppsContainer()->XNT('x', &shouldRemoveLastCharacter);
UTF8Decoder::CodePointToChars(codePoint, buffer, bufferSize);
buffer[UTF8Decoder::CharSizeOfCodePoint(codePoint)] = 0;
textInput->handleEventWithText(const_cast<char *>(buffer), false, false, shouldRemoveLastCharacter);
return true;
}
const char * pythonText = Helpers::PythonTextForEvent(event);
if (pythonText != nullptr) {
textInput->handleEventWithText(pythonText);
@@ -137,7 +156,17 @@ bool App::textInputDidReceiveEvent(InputEventHandler * textInput, Ion::Events::E
void App::initPythonWithUser(const void * pythonUser) {
if (!m_pythonUser) {
MicroPython::init(m_pythonHeap, m_pythonHeap + k_pythonHeapSize);
#if defined _FXCG || defined NSPIRE_NEWLIB
if (calculator == 1) { // fxcg50
MicroPython::init( (void *) 0x8c200000, (void *)(0x8c200000+ 0x2e0000));
} else if (calculator >= 1 && calculator <=4 ) {
MicroPython::init( prizm_heap, prizm_heap+prizm_heap_size);
} else {
#endif
MicroPython::init(m_pythonHeap, m_pythonHeap + k_pythonHeapSize);
#if defined _FXCG || defined NSPIRE_NEWLIB
}
#endif
}
m_pythonUser = pythonUser;
}

View File

@@ -9,6 +9,7 @@
#include "script_store.h"
#include "python_toolbox.h"
#include "variable_box_controller.h"
#include "../shared/shared_app.h"
namespace Code {
@@ -21,7 +22,7 @@ public:
App::Descriptor::ExaminationLevel examinationLevel() override;
const Image * icon() override;
};
class Snapshot : public ::App::Snapshot {
class Snapshot : public SharedApp::Snapshot {
public:
Snapshot();
App * unpack(Container * container) override;
@@ -74,7 +75,7 @@ public:
VariableBoxController * variableBoxController() { return &m_variableBoxController; }
static constexpr int k_pythonHeapSize = 32768;
static constexpr int k_pythonHeapSize = 69500;
private:
/* Python delegate:

View File

@@ -1,15 +1,15 @@
AddScript = "Skript hinzufügen"
AllowedCharactersaz09 = "Erlaubte Zeichen: a-z, 0-9, _"
Autocomplete = "Autovervollständigung"
AutoImportScript = "Automatischer Import in Konsole"
BuiltinsAndKeywords = "Native Funktionen und Schlüsselwörter"
AutoImportScript = "Automatischer Import in die Konsole"
BuiltinsAndKeywords = "Native Funktionen & Schlüsselwörter"
Console = "Interaktive Konsole"
DeleteScript = "Skript löschen"
DuplicateScript = "Skript duplizieren"
ExecuteScript = "Skript ausführen"
FunctionsAndVariables = "Funktionen und Variablen"
ImportedModulesAndScripts = "Importierte Module und Skripte"
NoWordAvailableHere = "Kein Wort ist hier verfübar."
ScriptInProgress = "Aktuelle Skript"
NoWordAvailableHere = "Hier ist kein Wort verfügbar."
ScriptInProgress = "Aktuelles Skript"
ScriptOptions = "Skriptoptionen"
ScriptSize = "Script size"
ScriptSize = "Skriptgröße"

View File

@@ -12,4 +12,4 @@ ImportedModulesAndScripts = "Módulos y archivos importados"
NoWordAvailableHere = "No hay ninguna palabra disponible aquí."
ScriptInProgress = "Archivo en curso"
ScriptOptions = "Opciones del archivo"
ScriptSize = "Script size"
ScriptSize = "Tamaño del script"

View File

@@ -12,4 +12,4 @@ ImportedModulesAndScripts = "Modules et scripts importés"
NoWordAvailableHere = "Aucun mot disponible à cet endroit."
ScriptInProgress = "Script en cours"
ScriptOptions = "Options de script"
ScriptSize = "Script size"
ScriptSize = "Taille du script"

View File

@@ -1,15 +1,15 @@
AddScript = "Script hozzadáadása"
AddScript = "Script hozzáadása"
AllowedCharactersaz09 = "Engedélyezett karakterek: a-z, 0-9, _"
Autocomplete = "Autocomplete"
Autocomplete = "Önkiegészítés"
AutoImportScript = "Script automata importálása"
BuiltinsAndKeywords = "Builtins and keywords"
BuiltinsAndKeywords = "Beépített fonkciók és szókincs"
Console = "Konzol"
DeleteScript = "Script törlése"
DuplicateScript = "Script másolása"
ExecuteScript = "Script indítása"
FunctionsAndVariables = "Függvények és változók"
ImportedModulesAndScripts = "Imported modules and scripts"
NoWordAvailableHere = "No word available here."
ScriptInProgress = "Script in progress"
FunctionsAndVariables = "Fonktiók és változók"
ImportedModulesAndScripts = "Importált scriptek és modulok"
NoWordAvailableHere = "Nincs rendelkezésre álló szó."
ScriptInProgress = "Script müködésben"
ScriptOptions = "Script beállítások"
ScriptSize = "Script size"
ScriptSize = "Script mérete"

View File

@@ -1,3 +1,2 @@
CodeAppCapital = "PYTHON"
ConsolePrompt = ">>> "
ScriptParameters = "..."

View File

@@ -1,222 +1,265 @@
PythonPound = "Kommentar"
PythonPercent = "Modulo"
PythonColon = "Doppelpunkt"
PythonSemicon = "Semikolon"
PythonExclamationMark = "Ausrufezeichen"
PythonLessThan = "Kleiner als"
PythonGreaterThan = "Größer als"
PythonQuestionMark = "Fragezeichen"
Python1J = "Imaginäres i"
PythonLF = "Zeilenvorschub"
PythonTab = "Tabulator"
PythonAmpersand = "Bitweise und"
PythonSymbolExp = "Bitweise exklusiv oder"
PythonVerticalBar = "Bitweise oder"
PythonAmpersand = "Bitweises und"
PythonSymbolExp = "Bitweises exklusives oder"
PythonVerticalBar = "Bitweises oder"
PythonImag = "Imaginärteil von z"
PythonReal = "Realteil von z"
PythonSingleQuote = "Einfaches Anführungszeichen"
PythonAbs = "Absolute/r Wert/Größe"
PythonAcos = "Arkuskosinus"
PythonAcosh = "Hyperbelkosinus"
PythonAppend = "Hängt x an das Ende der Liste"
PythonArrow = "Arrow from (x,y) to (x+dx,y+dy)"
PythonAsin = "Arkussinus"
PythonAsinh = "Hyperbelsinus"
PythonAbs = "Absoluter Wert/Absolute Größe"
PythonAcos = "Bogenkosinus"
PythonAcosh = "Bogenhyperbolischer Kosinus"
PythonAppend = "x an das Ende der Liste anfügen"
PythonArrow = "Pfeil von (x,y) nach (x+dx,y+dy)"
PythonAsin = "Sinusbogen"
PythonAsinh = "Kreisbogen hyperbolischer Sinus"
PythonAtan = "Arkustangens"
PythonAtan2 = "Gib atan(y/x)"
PythonAtan2 = "Rückgabe atan(y/x)"
PythonAtanh = "Hyperbeltangens"
PythonAxis = "Set axes to (xmin,xmax,ymin,ymax)"
PythonBar = "Draw a bar plot with x values"
PythonBin = "Ganzzahl nach binär konvertieren"
PythonCeil = "Aufrundung"
PythonChoice = "Zufallszahl aus der Liste"
PythonClear = "Leere die Liste"
PythonAxis = "Achsen auf (xmin,xmax,ymin,ymax)"
PythonBar = "Balkendiagramm mit x-Werten"
PythonBin = "Ganzzahl in Binärwert umwandeln"
PythonCeil = "Aufrunden"
PythonChoice = "Zufällige Zahl in der Liste"
PythonClear = "Liste leeren"
PythonCmathFunction = "cmath-Modul-Funktionspräfix"
PythonColor = "Definiere eine RGB-Farbe"
PythonColorBlack = "Black color"
PythonColorBlue = "Blue color"
PythonColorBrown = "Brown color"
PythonColorGreen = "Green color"
PythonColorGrey = "Grey color"
PythonColorOrange = "Orange color"
PythonColorPink = "Pink color"
PythonColorPurple = "Purple color"
PythonColorRed = "Red color"
PythonColorWhite = "White color"
PythonColorYellow = "Yellow color"
PythonComplex = "a+ib zurückgeben"
PythonCopySign = "x mit dem Vorzeichen von y"
PythonColor = "Eine RGB-Farbe definieren"
PythonColorBlack = "Farbe Schwarz"
PythonColorBlue = "Farbe Blau"
PythonColorBrown = "Farbe Braun"
PythonColorGray = "Farbe Grau"
PythonColorGreen = "Farbe Grün"
PythonColorOrange = "Farbe Orange"
PythonColorPink = "Farbe Rosa"
PythonColorPurple = "Farbe Violett"
PythonColorRed = "Farbe Rot"
PythonColorWhite = "Farbe Weiß"
PythonColorYellow = "Farbe Gelb"
PythonComplex = "Gib a+ib zurück"
PythonCopySign = "Gib x mit Vorzeichen von y zurück"
PythonCos = "Kosinus"
PythonCosh = "Hyperbolic cosine"
PythonCount = "Zählt wie oft x vorkommt"
PythonDegrees = "x von Radian zu Grad umwandeln"
PythonCosh = "Hyperbolischer Kosinus"
PythonCount = "Zählt die Vorkommen von x"
PythonDegrees = "x von Bogenmaß in Grad umrechnen"
PythonDivMod = "Quotient und Rest"
PythonDrawString = "Schreibt Text bei (x,y)"
PythonDrawCircle = "Zeichne einen Kreis"
PythonDrawLine = "Eine Linie zeichnen"
PythonDrawString = "Text bei Pixel (x,y) darstellen"
PythonErf = "Fehlerfunktion"
PythonErfc = "Complementary error function"
PythonEval = "Return the evaluated expression"
PythonErfc = "Komplementäre Fehlerfunktion"
PythonEval = "Rückgabe ausgewerteter Ausdruck"
PythonExp = "Exponentialfunktion"
PythonExpm1 = "Berechne exp(x)-1"
PythonFactorial = "Fakultät von x"
PythonFabs = "Absoluter Wert"
PythonFillRect = "Malt ein Rechteck bei Pixel (x,y)"
PythonFloat = "Wandelt x zu float um"
PythonFloor = "Floor"
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"
PythonFloor = "Abrunden"
PythonFmod = "a modulo b"
PythonFrExp = "Mantissa and exponent of x: (m,e)"
PythonGamma = "Gamma function"
PythonGetPixel = "Return pixel (x,y) color"
PythonGetrandbits = "Integer with k random bits"
PythonGrid = "Toggle the visibility of the grid"
PythonHex = "Ganzzahl zu Hexadecimal"
PythonHist = "Draw the histogram of x"
PythonImportCmath = "cmath Modul importieren"
PythonImportIon = "ion Modul importieren"
PythonImportKandinsky = "kandinsky Modul importieren"
PythonImportRandom = "random Modul importieren"
PythonImportMath = "math Modul importieren"
PythonImportMatplotlibPyplot = "Import matplotlib.pyplot module"
PythonImportOs = "os Modul importieren"
PythonOsUname = "Informieren Sie sich über das System"
PythonFrExp = "Mantisse und Exponent von x: (m,e)"
PythonGamma = "Gamma-Funktion"
PythonGetKeys = "Gedrückte Tasten erhalten"
PythonGetPalette = "Themenpalette erhalten"
PythonGetPixel = "Farbe von Pixel (x,y) zurückgeben"
PythonGetrandbits = "Ganzzahl mit k Zufallsbits"
PythonGrid = "Sichtbarkeit des Gitters umschalten"
PythonHex = "Ganzzahl in Hexadezimal umwandeln"
PythonHist = "Zeichnet das Histogramm von x"
PythonImportCmath = "cmath-Modul importieren"
PythonImportIon = "Ion-Modul importieren"
PythonImportKandinsky = "Kandinsky-Modul importieren"
PythonImportRandom = "Random-Modul importieren"
PythonImportMath = "Math-Modul importieren"
PythonImportMatplotlibPyplot = "Matplotlib.pyplot-Modul importieren"
PythonImportNumpy = "Ulab.numpy-Modul importieren"
PythonImportScipy = "Ulab.scipy-Modul importieren"
PythonImportOs = "OS-Modul importieren"
PythonImportSys = "SYS-Modul importieren"
PythonOsUname = "Informationen über das System holen"
PythonOsGetlogin = "Benutzernamen holen"
PythonOsRemove = "Datei namens Dateiname entfernen"
PythonOsRename = "Datei mit altem Namen in neuen Namen umbenennen"
PythonOsRename = "Datei umbenennen von Alt nach Neu"
PythonOsListdir = "Dateien im Speicher auflisten"
PythonImportTime = "time Modul importieren"
PythonImportTurtle = "turtle Modul importieren"
PythonIndex = "Index, bei dem x zuerst vorkommt"
PythonInput = "Eingabeaufforderung"
PythonInsert = "x bei index i in der Liste einsetzen"
PythonInt = "x zu Ganzzahl"
PythonIonFunction = "ion module function prefix"
PythonIsFinite = "Prüft ob x endlich ist"
PythonIsInfinite = "Prüft ob x unendlich ist"
PythonIsNaN = "Prüft ob x NaN ist"
PythonIsKeyDown = "true wenn k gedrückt ist"
PythonKandinskyFunction = "kandinsky module function prefix"
PythonKeyLeft = "Linke Pfeiltaste"
PythonKeyUp = "Pfeiltaste nach oben"
PythonKeyDown = "Pfeiltaste nach unten"
PythonKeyRight = "Rechte Pfeiltaste"
PythonKeyOk = "OK Taste"
PythonKeyBack = "ZURÜCK Taste"
PythonKeyHome = "HOME Taste"
PythonKeyOnOff = "AN/AUS Taste"
PythonKeyShift = "SHIFT Taste"
PythonKeyAlpha = "ALPHA Taste"
PythonKeyXnt = "X,N,T Taste"
PythonKeyVar = "VAR Taste"
PythonKeyToolbox = "WERKZEUGBOX Taste"
PythonKeyBackspace = "LÖSCHEN Taste"
PythonKeyExp = "EXPONENTIAL Taste"
PythonKeyLn = "NATURAL LOGARITHM Taste"
PythonKeyLog = "DECIMAL LOGARITHM Taste"
PythonKeyImaginary = "IMAGINÄRES I Taste"
PythonKeyComma = "KOMMA Taste"
PythonKeyPower = "HOCH Taste"
PythonKeySine = "SINUS Taste"
PythonKeyCosine = "COSINUS Taste"
PythonKeyTangent = "TANGENZ Taste"
PythonKeyPi = "PI Taste"
PythonKeySqrt = "WURZEL Taste"
PythonKeySquare = "QUADRAT Taste"
PythonKeySeven = "7 Taste"
PythonKeyEight = "8 Taste"
PythonKeyNine = "9 Taste"
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"
PythonImportTurtle = "Turtle-Modul importieren"
PythonIndex = "Index des ersten x-Vorkommens"
PythonInput = "Einen Wert abfragen"
PythonInsert = "x an Index i in die Liste einfügen"
PythonInt = "x in eine ganze Zahl umwandeln"
PythonIonFunction = "Ion-Modul-Funktionspräfix"
PythonIsFinite = "Prüfen, ob x endlich ist"
PythonIsInfinite = "Prüfen, ob x unendlich ist"
PythonIsNaN = "Prüfen, ob x keine Zahl ist"
PythonIsKeyDown = "Wahr, wenn die Taste k gedrückt ist"
PythonBattery = "Rückgabe der Batteriespannung"
PythonBatteryLevel = "Gibt den Batteriestand zurück"
PythonBatteryIscharging = "Gibt zurück, ob die Batterie geladen wird"
PythonSetBrightness = "Helligkeitsstufe festlegen"
PythonGetBrightness = "Helligkeitsstufe abrufen"
PythonKandinskyFunction = "Kandinsky-Modul Funktionspräfix"
PythonKeyLeft = "LEFT ARROW key"
PythonKeyUp = "UP ARROW key"
PythonKeyDown = "DOWN ARROW key"
PythonKeyRight = "RIGHT ARROW key"
PythonKeyOk = "OK key"
PythonKeyBack = "BACK key"
PythonKeyHome = "HOME key"
PythonKeyOnOff = "ON/OFF key"
PythonKeyShift = "SHIFT key"
PythonKeyAlpha = "ALPHA key"
PythonKeyXnt = "X,N,T key"
PythonKeyVar = "VAR key"
PythonKeyToolbox = "TOOLBOX key"
PythonKeyBackspace = "BACKSPACE key"
PythonKeyExp = "EXPONENTIAL key"
PythonKeyLn = "NATURAL LOGARITHM key"
PythonKeyLog = "DECIMAL LOGARITHM key"
PythonKeyImaginary = "IMAGINARY I key"
PythonKeyComma = "COMMA key"
PythonKeyPower = "POWER key"
PythonKeySine = "SINE key"
PythonKeyCosine = "COSINE key"
PythonKeyTangent = "TANGENT key"
PythonKeyPi = "PI key"
PythonKeySqrt = "SQUARE ROOT key"
PythonKeySquare = "SQUARE key"
PythonKeySeven = "7 key"
PythonKeyEight = "8 key"
PythonKeyNine = "9 key"
PythonKeyLeftParenthesis = "LEFT PARENTHESIS key"
PythonKeyRightParenthesis = "RIGHT PARENTHESIS key"
PythonKeyFour = "4 Taste"
PythonKeyFive = "5 Taste"
PythonKeySix = "6 Taste"
PythonKeyMultiplication = "MULTIPLIKATIONSTASTE"
PythonKeyDivision = "DIVISIONSTASTE"
PythonKeyOne = "1 Taste"
PythonKeyTwo = "2 Taste"
PythonKeyThree = "3 Taste"
PythonKeyPlus = "PLUS Taste"
PythonKeyMinus = "MINUS Taste"
PythonKeyZero = "0 Taste"
PythonKeyDot = "PUNKT Taste"
PythonKeyEe = "10 HOCH X Taste"
PythonKeyAns = "ANS Taste"
PythonKeyExe = "EXE Taste"
PythonLdexp = "Return x*(2**i), inverse of frexp"
PythonLength = "Length of an object"
PythonLgamma = "Log-gamma function"
PythonLog = "Logarithm to base a"
PythonLog10 = "Logarithm to base 10"
PythonLog2 = "Logarithm to base 2"
PythonMathFunction = "math module function prefix"
PythonMatplotlibPyplotFunction = "matplotlib.pyplot module prefix"
PythonKeyFour = "4 key"
PythonKeyFive = "5 key"
PythonKeySix = "6 key"
PythonKeyMultiplication = "MULTIPLICATION key"
PythonKeyDivision = "DIVISION key"
PythonKeyOne = "1 key"
PythonKeyTwo = "2 key"
PythonKeyThree = "3 key"
PythonKeyPlus = "PLUS key"
PythonKeyMinus = "MINUS key"
PythonKeyZero = "0 key"
PythonKeyDot = "DOT key"
PythonKeyEe = "10 POWER X key"
PythonKeyAns = "ANS key"
PythonKeyExe = "EXE key"
PythonLdexp = "Liefert x*(2**i), Inverse von frexp"
PythonLength = "Länge eines Objekts"
PythonLgamma = "Log-Gamma-Funktion"
PythonLog = "Logarithmus zur Basis a"
PythonLog10 = "Logarithmus zur Basis 10"
PythonLog2 = "Logarithmus zur Basis 2"
PythonMathFunction = "Funktionspräfix des Math-Moduls"
PythonMatplotlibPyplotFunction = "matplotlib.pyplot Modul-Präfix"
PythonMax = "Maximum"
PythonMin = "Minimum"
PythonModf = "Fractional and integer parts of x"
PythonMonotonic = "Value of a monotonic clock"
PythonOct = "Convert integer to octal"
PythonPhase = "Phase of z"
PythonPlot = "Plot y versus x as lines"
PythonPolar = "z in polar coordinates"
PythonPop = "Remove and return the last item"
PythonPower = "x raised to the power y"
PythonPrint = "Print object"
PythonRadians = "Convert x from degrees to radians"
PythonRandint = "Random integer in [a,b]"
PythonRandom = "Floating point number in [0,1["
PythonRandomFunction = "random module function prefix"
PythonRandrange = "Random number in range(start,stop)"
PythonRangeStartStop = "List from start to stop-1"
PythonRangeStop = "List from 0 to stop-1"
PythonRect = "Convert to cartesian coordinates"
PythonRemove = "Remove the first occurrence of x"
PythonReverse = "Reverse the elements of the list"
PythonRound = "Round to n digits"
PythonScatter = "Draw a scatter plot of y versus x"
PythonSeed = "Initialize random number generator"
PythonSetPixel = "Color pixel (x,y)"
PythonShow = "Display the figure"
PythonSin = "Sine"
PythonSinh = "Hyperbolic sine"
PythonSleep = "Suspend the execution for t seconds"
PythonSort = "Sort the list"
PythonSqrt = "Wurzel"
PythonSum = "Sum the items of a list"
PythonModf = "Bruch- und Ganzzahl-Anteile von x"
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"
PythonPhase = "Phase von z"
PythonPlot = "Plotten von y gegen x als Linien"
PythonPolar = "z in Polarkoordinaten"
PythonPop = "Letztes Element abnehmen"
PythonPower = "x erhöht mit der Potenz y"
PythonPrint = "Objekt drucken"
PythonRadians = "x von Grad in Bogenmaß umrechnen"
PythonRandint = "Zufällige Ganzzahl in [a,b]"
PythonRandom = "Fließkommazahl in [0,1]"
PythonRandomFunction = "Random-Modul Funktionspräfix"
PythonRandrange = "Zufallszahl im Bereich(start,stop)"
PythonRangeStartStop = "Liste von Start bis Stop-1"
PythonRangeStop = "Liste von 0 bis Stop-1"
PythonRect = "In kartesische Koordinaten"
PythonRemove = "Entferne das erste Vorkommen von x"
PythonReverse = "Kehrt die Elemente der Liste um"
PythonRound = "Runden auf n Stellen"
PythonScatter = "Streudiagramm von y gg. x zeichnen"
PythonSeed = "Zufallszahlengenerator initiieren"
PythonSetPixel = "Pixel (x,y) einfärben"
PythonShow = "Figur anzeigen"
PythonSin = "Sinus"
PythonSinh = "Hyperbolischer Sinus"
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"
PythonSqrt = "Quadratwurzel"
PythonSum = "Summe der Elemente einer Liste"
PythonTan = "Tangens"
PythonTanh = "Hyperbolic tangent"
PythonText = "Display a text at (x,y) coordinates"
PythonTimeFunction = "time module function prefix"
PythonTrunc = "x truncated to an integer"
PythonTurtleBackward = "Move backward by x pixels"
PythonTurtleCircle = "Circle of radius r pixels"
PythonTurtleColor = "Stiftfarbe setzen"
PythonTurtleColorMode = "Set the color mode to 1.0 or 255"
PythonTurtleForward = "Move forward by x pixels"
PythonTurtleFunction = "turtle module function prefix"
PythonTurtleGoto = "Move to (x,y) coordinates"
PythonTurtleHeading = "Return the current heading"
PythonTurtleHideturtle = "Hide the turtle"
PythonTurtleIsdown = "Return True if the pen is down"
PythonTurtleLeft = "Turn left by a degrees"
PythonTurtlePendown = "Pull the pen down"
PythonTurtlePensize = "Set the line thickness to x pixels"
PythonTurtlePenup = "Pull the pen up"
PythonTurtlePosition = "Return the current (x,y) location"
PythonTurtleReset = "Reset the drawing"
PythonTurtleRight = "Turn right by a degrees"
PythonTurtleSetheading = "Set the orientation to a degrees"
PythonTurtleSetposition = "Positionne la tortue"
PythonTurtleShowturtle = "Show the turtle"
PythonTurtleSpeed = "Drawing speed between 0 and 10"
PythonTurtleWrite = "Display a text"
PythonUniform = "Floating point number in [a,b]"
PythonImportTime = "Import time module"
PythonTimePrefix = "time module function prefix"
PythonTimeSleep = "Wait for n second"
PythonMonotonic = "Return monotonic time"
PythonTanh = "Hyperbolischer Tangens"
PythonText = "Text an (x,y) Koordinaten anzeigen"
PythonTimeFunction = "Time-Modul-Funktionspräfix"
PythonTrunc = "x abgeschnitten auf eine ganze Zahl"
PythonTurtleBackward = "Um x Pixel rückwärts bewegen"
PythonTurtleCircle = "Kreis mit Radius r Pixel"
PythonTurtleColor = "Setzt die Stiftfarbe"
PythonTurtleColorMode = "Setzt Farbmodus auf 1.0 oder 255"
PythonTurtleForward = "Um x Pixel vorwärts bewegen"
PythonTurtleFunction = "Turtle-Modul-Funktionspräfix"
PythonTurtleGoto = "Bewegen zu (x,y) Koordinaten"
PythonTurtleHeading = "Liefert den aktuellen Kurs"
PythonTurtleHideturtle = "Versteckt den Igel"
PythonTurtleIsdown = "Wahr, wenn der Stift unten ist"
PythonTurtleLeft = "Nach links um ein Grad drehen"
PythonTurtlePendown = "Den Stift nach unten ziehen"
PythonTurtlePensize = "Linienstärke auf x Pixel setzen"
PythonTurtlePenup = "Den Stift nach oben ziehen"
PythonTurtlePosition = "Aktuelle (x,y) Position zurückgeben"
PythonTurtleReset = "Die Zeichnung zurücksetzen"
PythonTurtleRight = "Um ein Grad nach rechts drehen"
PythonTurtleSetheading = "Ausrichtung auf einen Grad setzen"
PythonTurtleShowturtle = "Den Igel anzeigen"
PythonTurtleSpeed = "Zeichengeschwindigkeit von 0 bis 10"
PythonTurtleWrite = "Einen Text anzeigen"
PythonUniform = "Fließkommazahl in [a,b]"
PythonImportTime = "Time-Modul importieren"
PythonMonotonic = "Monotone Zeit zurückgeben"
PythonFileOpen = "Öffnet eine Datei"
PythonFileSeekable = "Ist eine Datei durchsuchbar?"
PythonFileSeek = "Dateicursor verschieben"
PythonFileTell = "Cursorposition der Datei abrufen"
PythonFileSeekable = "Kann Datei durchsucht werden?"
PythonFileSeek = "Bewegt den Cursor einer Datei"
PythonFileTell = "Position des Cursors ermitteln"
PythonFileClose = "Schließt eine Datei"
PythonFileClosed = "Wenn Datei geschlossen wurde"
PythonFileRead = "Bis zu size Bytes lesen"
PythonFileWrite = "Schreibe b in die Datei"
PythonFileReadline = "Lies eine Zeile"
PythonFileClosed = "Wahr, wenn Datei geschlossen wurde"
PythonFileRead = "Lesen bis zu einer Größe von Bytes"
PythonFileWrite = "Schreibe b in Datei"
PythonFileReadline = "Liest Zeile oder Anzahl Bytes"
PythonFileReadlines = "Liest eine Liste von Zeilen"
PythonFileTruncate = "Größe der Datei ändern"
PythonFileTruncate = "Verkleinert die Datei auf Größe"
PythonFileWritelines = "Schreibt eine Liste von Zeilen"
PythonFileName = "Dateiname"
PythonFileMode = "Dateiöffnungsmodus"
PythonFileReadable = "Ist die Datei lesbar?"
PythonFileWritable = "Ist die Datei beschreibbar?"
PythonFileName = "Enthält den Namen der Datei"
PythonFileMode = "Enthält den Öffnungsmodus der Datei"
PythonFileReadable = "Kann Datei gelesen werden?"
PythonFileWritable = "Kann Datei geschrieben werden?"
PythonImportUtils = "Importieren von ulab.utils"
PythonUtilsFunction = "Funktionspräfix des utils-Moduls"
PythonTurtleBgcolor = "Ändern Sie die Hintergrundfarbe"

View File

@@ -1,7 +1,13 @@
PythonPound = "Comment"
PythonPercent = "Modulo"
PythonColon = "Colon"
PythonSemicon = "Semicolon"
PythonExclamationMark = "Exclamation mark"
PythonLessThan = "Less than"
PythonGreaterThan = "Greater than"
PythonQuestionMark = "Question mark"
Python1J = "Imaginary i"
PythonLF = "line feed"
PythonLF = "Line feed"
PythonTab = "Tabulation"
PythonAmpersand = "Bitwise and"
PythonSymbolExp = "Bitwise exclusive or"
@@ -30,8 +36,8 @@ PythonColor = "Define a rgb color"
PythonColorBlack = "Black color"
PythonColorBlue = "Blue color"
PythonColorBrown = "Brown color"
PythonColorGray = "Gray color"
PythonColorGreen = "Green color"
PythonColorGrey = "Grey color"
PythonColorOrange = "Orange color"
PythonColorPink = "Pink color"
PythonColorPurple = "Purple color"
@@ -45,19 +51,26 @@ PythonCosh = "Hyperbolic cosine"
PythonCount = "Count the occurrences of x"
PythonDegrees = "Convert x from radians to degrees"
PythonDivMod = "Quotient and remainder"
PythonDrawCircle = "Draw a circle"
PythonDrawLine = "Draw a line"
PythonDrawString = "Display a text from pixel (x,y)"
PythonErf = "Error function"
PythonErfc = "Complementary error function"
PythonEval = "Return the evaluated expression"
PythonExp = "Exponential function"
PythonExpm1 = "Compute exp(x)-1"
PythonFactorial = "Factorial of x"
PythonFabs = "Absolute value"
PythonFillCircle = "Fill a circle"
PythonFillPolygon = "Fill a polygon"
PythonFillRect = "Fill a rectangle at pixel (x,y)"
PythonFloat = "Convert x to a float"
PythonFloor = "Floor"
PythonFmod = "a modulo b"
PythonFrExp = "Mantissa and exponent of x: (m,e)"
PythonGamma = "Gamma function"
PythonGetKeys = "Get keys pressed"
PythonGetPalette = "Get theme palette"
PythonGetPixel = "Return pixel (x,y) color"
PythonGetrandbits = "Integer with k random bits"
PythonGrid = "Toggle the visibility of the grid"
@@ -69,6 +82,8 @@ PythonImportKandinsky = "Import kandinsky module"
PythonImportRandom = "Import random module"
PythonImportMath = "Import math module"
PythonImportMatplotlibPyplot = "Import matplotlib.pyplot module"
PythonImportNumpy = "Import ulab.numpy module"
PythonImportScipy = "Import ulab.scipy module"
PythonImportTime = "Import time module"
PythonImportTurtle = "Import turtle module"
PythonIndex = "Index of the first x occurrence"
@@ -79,6 +94,11 @@ PythonIonFunction = "ion module function prefix"
PythonIsFinite = "Check if x is finite"
PythonIsInfinite = "Check if x is infinity"
PythonIsKeyDown = "Return True if the k key is down"
PythonBattery = "Return battery voltage"
PythonBatteryLevel = "Return battery level"
PythonBatteryIscharging = "Return if battery is charging"
PythonSetBrightness = "Set brightness level"
PythonGetBrightness = "Get brightness level"
PythonIsNaN = "Check if x is a NaN"
PythonKandinskyFunction = "kandinsky module function prefix"
PythonKeyLeft = "LEFT ARROW key"
@@ -139,6 +159,14 @@ PythonMax = "Maximum"
PythonMin = "Minimum"
PythonModf = "Fractional and integer parts of x"
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"
PythonPhase = "Phase of z"
PythonPlot = "Plot y versus x as lines"
@@ -148,7 +176,7 @@ PythonPower = "x raised to the power y"
PythonPrint = "Print object"
PythonRadians = "Convert x from degrees to radians"
PythonRandint = "Random integer in [a,b]"
PythonRandom = "Floating point number in [0,1["
PythonRandom = "Floating point number in [0,1]"
PythonRandomFunction = "random module function prefix"
PythonRandrange = "Random number in range(start,stop)"
PythonRangeStartStop = "List from start to stop-1"
@@ -164,6 +192,12 @@ PythonShow = "Display the figure"
PythonSin = "Sine"
PythonSinh = "Hyperbolic sine"
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"
PythonSqrt = "Square root"
PythonSum = "Sum the items of a list"
@@ -190,19 +224,25 @@ PythonTurtlePosition = "Return the current (x,y) location"
PythonTurtleReset = "Reset the drawing"
PythonTurtleRight = "Turn right by a degrees"
PythonTurtleSetheading = "Set the orientation to a degrees"
PythonTurtleSetposition = "Positionne la tortue"
PythonTurtleShowturtle = "Show the turtle"
PythonTurtleSpeed = "Drawing speed between 0 and 10"
PythonTurtleWrite = "Display a text"
PythonUniform = "Floating point number in [a,b]"
PythonImportTime = "Import time module"
PythonImportOs = "Import os module"
PythonImportSys = "Import sys module"
PythonOsUname = "Get infos about the system"
PythonOsGetlogin = "Get username"
PythonOsRemove = "Remove file named filename"
PythonOsRename = "Rename file oldname to newname"
PythonOsListdir = "List files in memory"
PythonTimePrefix = "time module function prefix"
PythonTimeSleep = "Wait for n second"
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)"
PythonMonotonic = "Return monotonic time"
PythonFileOpen = "Opens a file"
PythonFileSeekable = "Tells if seek can be used on a file"
@@ -220,3 +260,6 @@ PythonFileName = "Contains file's name"
PythonFileMode = "Contains file's open mode"
PythonFileReadable = "Tells if read can be used on a file"
PythonFileWritable = "Tells if write can be used on a file"
PythonImportUtils = "Importing ulab.utils"
PythonUtilsFunction = "utils module function prefix"
PythonTurtleBgcolor = "Change the background color"

View File

@@ -1,5 +1,11 @@
PythonPound = "Comment"
PythonPercent = "Modulo"
PythonColon = "Colon"
PythonSemicon = "Semicolon"
PythonExclamationMark = "Exclamation mark"
PythonLessThan = "Less than"
PythonGreaterThan = "Greater than"
PythonQuestionMark = "Question mark"
Python1J = "Imaginary i"
PythonLF = "Line feed"
PythonTab = "Tabulation"
@@ -30,8 +36,8 @@ PythonColor = "Define a rgb color"
PythonColorBlack = "Black color"
PythonColorBlue = "Blue color"
PythonColorBrown = "Brown color"
PythonColorGray = "Gray color"
PythonColorGreen = "Green color"
PythonColorGrey = "Grey color"
PythonColorOrange = "Orange color"
PythonColorPink = "Pink color"
PythonColorPurple = "Purple color"
@@ -45,19 +51,26 @@ PythonCosh = "Hyperbolic cosine"
PythonCount = "Count the occurrences of x"
PythonDegrees = "Convert x from radians to degrees"
PythonDivMod = "Quotient and remainder"
PythonDrawCircle = "Draw a circle"
PythonDrawLine = "Draw a line"
PythonDrawString = "Display a text from pixel (x,y)"
PythonErf = "Error function"
PythonErfc = "Complementary error function"
PythonEval = "Return the evaluated expression"
PythonExp = "Exponential function"
PythonExpm1 = "Compute exp(x)-1"
PythonFactorial = "factorial de x"
PythonFabs = "Absolute value"
PythonFillCircle = "Fill a circle"
PythonFillPolygon = "Fill a polygon"
PythonFillRect = "Fill a rectangle at pixel (x,y)"
PythonFloat = "Convert x to a float"
PythonFloor = "Floor"
PythonFmod = "a modulo b"
PythonFrExp = "Mantissa and exponent of x: (m,e)"
PythonGamma = "Gamma function"
PythonGetKeys = "Obtener teclas presionadas"
PythonGetPalette = "Get theme palette"
PythonGetPixel = "Return pixel (x,y) color"
PythonGetrandbits = "Integer with k random bits"
PythonGrid = "Toggle the visibility of the grid"
@@ -69,6 +82,8 @@ PythonImportKandinsky = "Import kandinsky module"
PythonImportRandom = "Import random module"
PythonImportMath = "Import math module"
PythonImportMatplotlibPyplot = "Import matplotlib.pyplot module"
PythonImportNumpy = "Import ulab.numpy module"
PythonImportScipy = "Import ulab.scipy module"
PythonImportTime = "Import time module"
PythonImportTurtle = "Import turtle module"
PythonIndex = "Index of the first x occurrence"
@@ -79,6 +94,11 @@ PythonIonFunction = "ion module function prefix"
PythonIsFinite = "Check if x is finite"
PythonIsInfinite = "Check if x is infinity"
PythonIsKeyDown = "Return True if the k key is down"
PythonBattery = "Rückgabe der Batteriespannung"
PythonBatteryLevel = "Gibt den Batteriestand zurück"
PythonBatteryIscharging = "Gibt zurück, ob die Batterie geladen wird"
PythonSetBrightness = "Establecer nivel de brillo"
PythonGetBrightness = "Obtener nivel de brillo"
PythonIsNaN = "Check if x is a NaN"
PythonKandinskyFunction = "kandinsky module function prefix"
PythonKeyLeft = "LEFT ARROW key"
@@ -139,6 +159,14 @@ PythonMax = "Maximum"
PythonMin = "Minimum"
PythonModf = "Fractional and integer parts of x"
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"
PythonPhase = "Phase of z"
PythonPlot = "Plot y versus x as lines"
@@ -164,6 +192,12 @@ PythonShow = "Display the figure"
PythonSin = "Sine"
PythonSinh = "Hyperbolic sine"
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"
PythonSqrt = "Square root"
PythonSum = "Sum the items of a list"
@@ -190,19 +224,25 @@ PythonTurtlePosition = "Return the current (x,y) location"
PythonTurtleReset = "Reset the drawing"
PythonTurtleRight = "Turn right by a degrees"
PythonTurtleSetheading = "Set the orientation to a degrees"
PythonTurtleSetposition = "Positionne la tortue"
PythonTurtleShowturtle = "Show the turtle"
PythonTurtleSpeed = "Drawing speed between 0 and 10"
PythonTurtleWrite = "Display a text"
PythonUniform = "Floating point number in [a,b]"
PythonImportTime = "Import time module"
PythonImportOs = "Import os module"
PythonImportSys = "Import sys module"
PythonOsUname = " Información del sistema "
PythonOsGetlogin = "Get username"
PythonOsRemove = "Eliminar un archivo"
PythonOsRename = "Renombrar archivo"
PythonOsListdir = "Archivos de la lista"
PythonTimePrefix = "time module function prefix"
PythonTimeSleep = "Esperar n segundos"
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)"
PythonMonotonic = "Tiempo monótono de retorno"
PythonFileOpen = "Opens a file"
PythonFileSeekable = "Tells if seek can be used on a file"
@@ -220,3 +260,6 @@ PythonFileName = "Contains file's name"
PythonFileMode = "Contains file's open mode"
PythonFileReadable = "Tells if read can be used on a file"
PythonFileWritable = "Tells if write can be used on a file"
PythonImportUtils = "Importando ulab.utils"
PythonUtilsFunction = "prefijo de función del módulo utils"
PythonTurtleBgcolor = "Cambiar el color de fondo"

View File

@@ -1,5 +1,11 @@
PythonPound = "Commentaire"
PythonPercent = "Modulo"
PythonColon = "Deux-points"
PythonSemicon = "Point-virgule"
PythonExclamationMark = "Point d'exclamation"
PythonLessThan = "Inférieur à"
PythonGreaterThan = "Supérieur à"
PythonQuestionMark = "Point d'interrogation"
Python1J = "i complexe"
PythonLF = "Saut à la ligne"
PythonTab = "Tabulation"
@@ -30,8 +36,8 @@ PythonColor = "Définit une couleur rvb"
PythonColorBlack = "Couleur noire"
PythonColorBlue = "Couleur bleue"
PythonColorBrown = "Couleur marron"
PythonColorGray = "Couleur grise"
PythonColorGreen = "Couleur verte"
PythonColorGrey = "Couleur grise"
PythonColorOrange = "Couleur orange"
PythonColorPink = "Couleur rose"
PythonColorPurple = "Couleur violette"
@@ -45,19 +51,26 @@ PythonCosh = "Cosinus hyperbolique"
PythonCount = "Compte les occurrences de x"
PythonDegrees = "Conversion de radians en degrés"
PythonDivMod = "Quotient et reste"
PythonDrawCircle = "Trace un cercle"
PythonDrawLine = "Trace une ligne"
PythonDrawString = "Affiche un texte au pixel (x,y)"
PythonErf = "Fonction d'erreur"
PythonErfc = "Fonction d'erreur complémentaire"
PythonEval = "Evalue l'expression en argument "
PythonExp = "Fonction exponentielle"
PythonExpm1 = "Calcul de exp(x)-1"
PythonFactorial = "Factorielle de x"
PythonFabs = "Valeur absolue"
PythonFillCircle = "Remplit un cercle"
PythonFillPolygon = "Remplit un polygone"
PythonFillRect = "Remplit un rectangle"
PythonFloat = "Conversion en flottant"
PythonFloor = "Partie entière"
PythonFmod = "a modulo b"
PythonFrExp = "Mantisse et exposant de x : (m,e)"
PythonGamma = "Fonction gamma"
PythonGetKeys = "Obtenir les touches pressées"
PythonGetPalette = "Obtient la palette du thème"
PythonGetPixel = "Renvoie la couleur du pixel (x,y)"
PythonGetrandbits = "Nombre aléatoire sur k bits"
PythonGrid = "Affiche ou masque la grille"
@@ -69,6 +82,9 @@ PythonImportKandinsky = "Importation du module kandinsky"
PythonImportRandom = "Importation du module random"
PythonImportMath = "Importation du module math"
PythonImportMatplotlibPyplot = "Importation de matplotlib.pyplot"
PythonImportNumpy = "Importation de ulab.numpy"
PythonImportScipy = "Importation de ulab.scipy"
PythonImportUtils = "Importation de ulab.utils"
PythonImportTurtle = "Importation du module turtle"
PythonImportTime = "Importation du module time"
PythonIndex = "Indice première occurrence de x"
@@ -79,6 +95,11 @@ PythonIonFunction = "Préfixe fonction module ion"
PythonIsFinite = "Teste si x est fini"
PythonIsInfinite = "Teste si x est infini"
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"
PythonSetBrightness = "Définir le niveau de luminosité"
PythonGetBrightness = "Obtenir le niveau de luminosité"
PythonIsNaN = "Teste si x est NaN"
PythonKandinskyFunction = "Préfixe fonction module kandinsky"
PythonKeyLeft = "Touche FLECHE GAUCHE"
@@ -139,6 +160,15 @@ PythonMax = "Maximum"
PythonMin = "Minimum"
PythonModf = "Parties fractionnaire et entière"
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"
PythonUtilsFunction = "Préfixe fonction du module utils"
PythonOct = "Conversion en octal"
PythonPhase = "Argument de z"
PythonPlot = "Trace y en fonction de x"
@@ -154,7 +184,7 @@ PythonRandrange = "Nombre dans range(start,stop)"
PythonRangeStartStop = "Liste de start à stop-1"
PythonRangeStop = "Liste de 0 à stop-1"
PythonRect = "Conversion en algébrique"
PythonRemove = "Supprime le premier x de la liste"
PythonRemove = "Supprime le premier x de la liste"
PythonReverse = "Inverse les éléments de la liste"
PythonRound = "Arrondi à n décimales"
PythonScatter = "Nuage des points (x,y)"
@@ -164,6 +194,12 @@ PythonShow = "Affiche la figure"
PythonSin = "Sinus"
PythonSinh = "Sinus hyperbolique"
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"
PythonSqrt = "Racine carrée"
PythonSum = "Somme des éléments de la liste"
@@ -176,6 +212,7 @@ PythonTurtleBackward = "Recule de x pixels"
PythonTurtleCircle = "Cercle de rayon r pixels"
PythonTurtleColor = "Modifie la couleur du tracé"
PythonTurtleColorMode = "Met le mode de couleur à 1.0 ou 255"
PythonTurtleBgcolor = "Modifie la couleur du fond"
PythonTurtleForward = "Avance de x pixels"
PythonTurtleFunction = "Préfixe fonction du module turtle"
PythonTurtleGoto = "Va au point de coordonnées (x,y)"
@@ -190,32 +227,38 @@ PythonTurtlePosition = "Renvoie la position (x,y)"
PythonTurtleReset = "Réinitialise le dessin"
PythonTurtleRight = "Pivote de a degrés vers la droite"
PythonTurtleSetheading = "Met un cap de a degrés"
PythonTurtleSetposition = "Positionne la tortue"
PythonTurtleShowturtle = "Affiche la tortue"
PythonTurtleSpeed = "Vitesse du tracé entre 0 et 10"
PythonTurtleWrite = "Affiche un texte"
PythonUniform = "Nombre décimal dans [a,b]"
PythonImportTime = "Importation du module temps"
PythonImportOs = "Importation du module os"
PythonImportSys = "Importation du module sys"
PythonOsUname = "Donne des infos sur le système"
PythonOsGetlogin = "Donne le nom d'utilisateur"
PythonOsRemove = "Supprime le fichier nommé filename"
PythonOsRename = "Renomme oldname en newname"
PythonOsListdir = "Liste les fichiers"
PythonTimePrefix = "Préfixe fonction du module temps"
PythonTimeSleep = "Attendre n secondes"
PythonMonotonic = "Retourne le temps monotonic"
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)"
PythonMonotonic = "Retourne le temps monotone"
PythonFileOpen = "Ouvre un fichier"
PythonFileSeekable = "Indique si seek peut être utilisé"
PythonFileSeek = "Déplace le curseur interne"
PythonFileTell = "Donne la posititon du curseur"
PythonFileClose = "Ferme un fichier"
PythonFileClosed = "True si le fichier a été fermé"
PythonFileRead = "Lis jusqu'à size bytes"
PythonFileWrite = "Écris b dans le fichier"
PythonFileReadline = "Lis une ligne ou jusqu'à size bytes"
PythonFileReadlines = "Lis une liste de lignes"
PythonFileRead = "Lit jusqu'à size bytes"
PythonFileWrite = "Écrit b dans le fichier"
PythonFileReadline = "Lit une ligne ou jusqu'à size bytes"
PythonFileReadlines = "Lit une liste de lignes"
PythonFileTruncate = "Redimensionne le fichier"
PythonFileWritelines = "Écris une liste de lignes"
PythonFileWritelines = "Écrit une liste de lignes"
PythonFileName = "Nom du fichier"
PythonFileMode = "Mode d'ouverture du fichier"
PythonFileReadable = "Indique si read peut être utilisé"

View File

@@ -1,222 +1,265 @@
PythonPound = "Megjegyzés"
PythonPercent = "Modulo"
Python1J = "Képzeletbeli i"
PythonLF = "Line feed"
PythonTab = "Táblázat"
PythonAmpersand = "Bitwise és"
PythonSymbolExp = "Bitwise exkluzív vagy"
PythonVerticalBar = "Bitwise vagy"
PythonImag = "z képzeletbeli része"
PythonReal = "z valódi része"
PythonSingleQuote = "Egyetlen idézet"
PythonAbs = "Abszolút érték / nagyság"
PythonAcos = "Arc koszinusz"
PythonAcosh = "Íves hiperbolikus koszinusz"
PythonAppend = "x hozzáadása a lista végéhez"
PythonArrow = "Arrow from (x,y) to (x+dx,y+dy)"
PythonAsin = "Arc szinusz"
PythonAsinh = "Íves hiperbolikus szinusz"
PythonAtan = "Arc érintö"
PythonAtan2 = "Visszatérés atan (y / x)"
PythonAtanh = "Arc hiperbolikus érintö"
PythonAxis = "Set axes to (xmin,xmax,ymin,ymax)"
PythonBar = "Draw a bar plot with x values"
PythonBin = "Egész szám konvertálása binárisra"
PythonCeil = "Mennyezet"
PythonChoice = "Véletlenszerü szám a listában"
PythonClear = "A lista ürítése"
PythonCmathFunction = "cmath modul funkció elötag"
PythonColor = "Rgb szín meghatározása"
PythonColorBlack = "Fekete szín"
PythonColorBlue = "Kék szín"
PythonColorBrown = "Barna szín"
PythonColorGreen = "Zöld szín"
PythonColorGrey = "Szürke szín"
PythonColorOrange = "Narancssárga szín"
PythonColorPink = "Rózsaszín szín"
PythonColorPurple = "Lila szín"
PythonColorRed = "Piros szín"
PythonColorWhite = "White color"
PythonColorYellow = "Sárga szín"
PythonComplex = "A + ib visszaadása"
PythonCopySign = "Visszatérés x-val y jelével"
PythonCos = "Koszinusz"
PythonCosh = "Hiperbolikus koszinusz"
PythonCount = "Számolja az x elöfordulását"
PythonDegrees = "x konvertálása x-röl radiánokra fokokra"
PythonDivMod = "Hányados és maradék"
PythonDrawString = "Szöveg megjelenítése pixelböl (x, y)"
PythonErf = "Hiba funkció"
PythonErfc = "Kiegészítö hibafunkció"
PythonEval = "Visszaadja az értékelt kifejezést"
PythonExp = "Exponenciális függvény"
PythonExpm1 = "Számítsuk ki az exp (x) -1-et"
PythonFabs = "Abszolút érték"
PythonFillRect = "Töltsön meg egy téglalapot pixelnél (x, y)"
PythonFloat = "x konvertálása float-ra"
PythonFloor = "Emelet"
PythonFmod = "a modulo b"
PythonFrExp = "Mantissa és az x exponense"
PythonGamma = "Gamma funkció"
PythonGetPixel = "Visszatérési pixel (x, y) szín"
PythonGetrandbits = "Egész szám k véletlen bittel"
PythonGrid = "Toggle the visibility of the grid"
PythonHex = "Egész szám konvertálása hexadecimálisra"
PythonHist = "Draw the histogram of x"
PythonImportCmath = "cmath modul importálása"
PythonImportIon = "Ion modul importálása"
PythonImportKandinsky = "Kandinsky modul importálása"
PythonImportRandom = "Véletlenszerü modul importálása"
PythonImportMath = "Import matematikai modul"
PythonImportMatplotlibPyplot = "Import matplotlib.pyplot module"
PythonImportTime = "Idömodul importálása"
PythonImportOs = "Os modul importálása"
PythonOsUname = "Információ a rendszerről"
PythonOsRemove = "Fájl eltávolítása"
PythonOsRename = "Fájl átnevezése"
PythonOsListdir = "Fájlok listázása"
PythonImportTurtle = "Import teknös modul"
PythonIndex = "Az elsö x esemény indexe"
PythonInput = "Érték kérése"
PythonInsert = "Helyezzen x-t az i indexbe a listában"
PythonInt = "x konvertálása egész számra"
PythonIonFunction = "ion modul funkció elötag"
PythonIsFinite = "Ellenörizze, hogy x véges-e"
PythonIsInfinite = "Ellenörizze, hogy x végtelen-e"
PythonIsKeyDown = "True true, ha a k gomb le van nyomva"
PythonIsNaN = "Ellenörizze, hogy x nem NaN"
PythonKandinskyFunction = "kandinsky modul function prefix"
PythonKeyLeft = "Balra nyíl gomb"
PythonKeyUp = "FEL NYÍL gomb"
PythonKeyDown = "LE nyíl gomb"
PythonKeyRight = "JOBB NYÍL gomb"
PythonKeyOk = "OK gomb"
PythonKeyBack = "VISSZA kulcs"
PythonKeyHome = "HOME kulcs"
PythonKeyOnOff = "BE / KI gomb"
PythonKeyShift = "SHIFT kulcs"
PythonKeyAlpha = "ALPHA kulcs"
PythonKeyXnt = "X, N, T kulcs"
PythonKeyVar = "VAR kulcs"
PythonKeyToolbox = "TOOLBOX kulcs"
PythonKeyBackspace = "BACKSPACE kulcs"
PythonKeyExp = "EXPONENTIAL kulcs"
PythonKeyLn = "NATURAL LOGARITHM kulcs"
PythonKeyLog = "DECIMAL LOGARITHM kulcs"
PythonKeyImaginary = "IMAGINÁRIS I kulcs"
PythonKeyComma = "COMMA kulcs"
PythonKeyPower = "POWER kulcs"
PythonKeySine = "SINE kulcs"
PythonKeyCosine = "KOSZIN kulcs"
PythonKeyTangent = "TANGENT kulcs"
PythonKeyPi = "PI kulcs"
PythonKeySqrt = "SQUARE ROOT kulcs"
PythonKeySquare = "SQUARE kulcs"
PythonKeySeven = "7 kulcs"
PythonKeyEight = "8 kulcs"
PythonKeyNine = "9 kulcs"
PythonKeyLeftParenthesis = "Bal oldali PARENTHESIS kulcs"
PythonKeyRightParenthesis = "JOGOS SZÜLETÉS kulcs"
PythonKeyFour = "4 kulcs"
PythonKeyFive = "5 kulcs"
PythonKeySix = "6 kulcs"
PythonKeyMultiplication = "TÖBB MüKÖDÉS kulcs"
PythonKeyDivision = "DIVISION kulcs"
PythonKeyOne = "1 kulcs"
PythonKeyTwo = "2 kulcs"
PythonKeyThree = "3 kulcs"
PythonKeyPlus = "PLUS kulcs"
PythonKeyMinus = "MINUS kulcs"
PythonKeyZero = "0 kulcs"
PythonKeyDot = "DOT kulcs"
PythonKeyEe = "10 POWER X kulcs"
PythonKeyAns = "ANS kulcs"
PythonKeyExe = "EXE kulcs"
PythonLdexp = "Visszatérés x * (2 ** i), inverz a frexp értékhez"
PythonLength = "Objektum hossza"
PythonLgamma = "Log-gamma funkció"
PythonLog = "Logaritmus az alap"
PythonLog10 = "Logaritmus az alaphoz 10"
PythonLog2 = "Logaritmus az alaphoz 2"
PythonMathFunction = "matematikai modul funkció elötag"
PythonMatplotlibPyplotFunction = "matplotlib.pyplot module prefix"
PythonMax = "Maximum"
PythonMin = "Minimum"
PythonModf = "Az x tört és egész részei"
PythonMonotonic = "A monoton óra értéke"
PythonOct = "Egész szám konvertálása oktális értékre"
PythonPhase = "z fázis"
PythonPlot = "Plot y versus x as lines"
PythonPolar = "z poláris koordinátákban"
PythonPop = "Az utolsó elem eltávolítása és visszaküldése"
PythonPower = "x emelve az y teljesítményre"
PythonPrint = "Objektum nyomtatása"
PythonRadians = "x konvertálása x fokról radiánra"
PythonRandint = "Véletlen egész szám [a, b] -ben"
PythonRandom = "Lebegöpontos szám [0,1-ben ["
PythonRandomFunction = "véletlenszerü modul funkció elötag"
PythonRandrange = "Véletlen szám a tartományban (start, stop)"
PythonRangeStartStop = "Lista az elejétöl a stop-1-ig"
PythonRangeStop = "Lista 0-tól stop-1-ig"
PythonRect = "z derékszögü koordinátákban"
PythonRemove = "Távolítsa el az x elsö elöfordulását"
PythonReverse = "A lista elemeinek megfordítása"
PythonRound = "N számjegyre kerekítve"
PythonScatter = "Draw a scatter plot of y versus x"
PythonSeed = "Inicializálja a véletlenszám-generátort"
PythonSetPixel = "Színes pixel (x, y)"
PythonShow = "Display the figure"
PythonSin = "Sine"
PythonSinh = "Hiperbolikus szinusz"
PythonSleep = "A végrehajtás felfüggesztése t másodpercre"
PythonSort = "A lista rendezése"
PythonSqrt = "Négyzetgyök"
PythonSum = "Összegzi a lista elemeit"
PythonTan = "Érintö"
PythonTanh = "Hiperbolikus érintö"
PythonText = "Display a text at (x,y) coordinates"
PythonTimeFunction = "idömodul funkció elötag"
PythonTrunc = "x egészre csonkítva"
PythonTurtleBackward = "Visszalépés x pixelrel"
PythonTurtleCircle = "r pixel sugarú kör"
PythonTurtleColor = "Állítsa be az toll színét"
PythonTurtleColorMode = "Set the color mode to 1.0 or 255"
PythonTurtleForward = "Ugrás x pixelrel"
PythonTurtleFunction = "teknös modul funkció elötag"
PythonTurtleGoto = "Mozgatás (x, y) koordinátákra"
PythonTurtleHeading = "Visszaadja az aktuális címsort"
PythonTurtleHideturtle = "A teknös elrejtése"
PythonTurtleIsdown = "Visszatérés igazhoz, ha az toll lefelé"
PythonTurtleLeft = "Forduljon fokkal balra"
PythonTurtlePendown = "Húzza le a tollat"
PythonTurtlePensize = "Állítsa a vonalvastagságot x pixelre"
PythonTurtlePenup = "Húzza fel a tollat"
PythonTurtlePosition = "Az aktuális (x, y) hely visszaadása"
PythonTurtleReset = "A rajz visszaállítása"
PythonTurtleRight = "Forduljon fokkal jobbra"
PythonTurtleSetheading = "Állítsa be a tájolást fokokra"
PythonTurtleSetposition = "A helymeghatározás"
PythonTurtleShowturtle = "Mutasd a teknösöt"
PythonTurtleSpeed = "Rajzolási sebesség 0 és 10 között"
PythonTurtleWrite = "Display a text"
PythonUniform = "Lebegöpontos szám [a, b] -ben"
PythonImportTime = "Idömodul importálása"
PythonTimePrefix = "idömodul funkció elötag"
PythonTimeSleep = "Várj n másodpercet"
PythonMonotonic = "Vissza a monoton idö"
PythonFileOpen = "Fájl megnyitása"
PythonFileSeekable = "A fájl kereshető?"
PythonFileSeek = "A fájl kurzorának áthelyezése"
PythonFileTell = "A fájl kurzorának helye"
PythonFileClose = "Bezár egy fájlt"
PythonFileClosed = "Igaz, ha a fájl bezárt"
PythonFileRead = "Olvasson méretbájtig"
PythonFileWrite = "B beírása fájlba"
PythonFileReadline = "Olvas egy sort"
PythonFileReadlines = "Olvassa a sorok listáját"
PythonFileTruncate = "A fájl átméretezése méretre"
PythonFileWritelines = "Sorok listáját írja"
PythonFileName = "a fájl neve"
PythonFileMode = "a fájl nyitott módja"
PythonFileReadable = "A fájl olvasható?"
PythonFileWritable = "A fájl írható?"
PythonPound = "Megjegyzés"
PythonPercent = "Modulo"
PythonColon = "Kettőspont"
PythonSemicon = "Pontosvessző"
PythonExclamationMark = "Felkiáltójel"
PythonLessThan = "Kisebb mint"
PythonGreaterThan = "Nagyobb mint"
PythonQuestionMark = "Kérdőjel"
Python1J = "Képzeletbeli i"
PythonLF = "Enter"
PythonTab = "Táblázat"
PythonAmpersand = "Logikus és"
PythonSymbolExp = "logikus exkluzív vagy pedig"
PythonVerticalBar = "logikus vagy pedig"
PythonImag = "z képzeletbeli része"
PythonReal = "z valódi része"
PythonSingleQuote = "apostróf"
PythonAbs = "Abszolút érték/nagyság"
PythonAcos = "Ív (arc) koszinusz"
PythonAcosh = "Hiperbolikus arc koszinusz"
PythonAppend = "Lista végére hozzáadni x-et"
PythonArrow = "(x,y) nyíla (x+dx,y+dy) nyílához"
PythonAsin = "Ív (arc) szinusz"
PythonAsinh = "Hiperbolikus ív (arc) szinusz"
PythonAtan = "Ív (arc) érintö (tan)"
PythonAtan2 = "atan(y/x) sámolása"
PythonAtanh = "Hiperbolikus ív (arc) érintö (atan)"
PythonAxis = "Tengelyeket (xmin,xmax,ymin,ymax)-ra állitani"
PythonBar = "Az x lista oszlopdiagramja"
PythonBin = "Egész szám konvertálása binárisra"
PythonCeil = "Mennyezet"
PythonChoice = "Véletlenszerü szám a listában"
PythonClear = "A lista ürítése"
PythonCmathFunction = "cmath modul funkció elötag"
PythonColor = "Rgb (pzk) szín allítása"
PythonColorBlack = "Fekete szín"
PythonColorBlue = "Kék szín"
PythonColorBrown = "Barna szín"
PythonColorGreen = "Zöld szín"
PythonColorGray = "Szürke szín"
PythonColorOrange = "Narancssárga szín"
PythonColorPink = "Rózsaszín szín"
PythonColorPurple = "Lila szín"
PythonColorRed = "Piros szín"
PythonColorWhite = "Fehér szín"
PythonColorYellow = "Sárga szín"
PythonComplex = "A + ib visszaadása"
PythonCopySign = "X visszaadása y jelével"
PythonCos = "Koszinusz"
PythonCosh = "Hiperbolikus koszinusz"
PythonCount = "Számolja az x elöfordulását"
PythonDegrees = "x konvertálása radiánokrol fokokra"
PythonDivMod = "Hányados és maradék"
PythonDrawCircle = "Rajzolj egy kört"
PythonDrawLine = "Húzzon egy vonalat "
PythonDrawString = "Szöveg megjelenítése (x, y)-en"
PythonErf = "Hiba funkció"
PythonErfc = "Kiegészítö hiba funkció"
PythonEval = "Visszaadja az értékelt kifejezést"
PythonExp = "Exponenciális függvény"
PythonExpm1 = "exp(x)-1 sámitása"
PythonFactorial = "x faktorál"
PythonFabs = "Abszolút érték"
PythonFillRect = "Téglalap töltése"
PythonFillCircle = "Kitölti a kört"
PythonFillPolygon = "Kitölti a poligont"
PythonFloat = "Konvertálása tizedes számra"
PythonFloor = "Egész része"
PythonFmod = "a modulo b"
PythonFrExp = "X mantissája és kiállítója"
PythonGamma = "Gamma funkció"
PythonGetKeys = "Billentyűk lenyomva"
PythonGetPalette = "Téma paletta beszerzése"
PythonGetPixel = "Visszatéríti (x,y) színét"
PythonGetrandbits = "Váletlenszám visszatérítése k biten"
PythonGrid = "Rács megjelenítése/elrejtése"
PythonHex = "Decimális szám konvertálása hexadecimális számra"
PythonHist = "x hisztográmiája"
PythonImportCmath = "cmath modul importálása"
PythonImportIon = "Ion modul importálása"
PythonImportKandinsky = "Kandinsky modul importálása"
PythonImportRandom = "Véletlenszerü modul importálása"
PythonImportMath = "math 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"
PythonImportTime = "time modul importálása"
PythonIndex = "Az elsö x esemény indexe"
PythonInput = "Irjon egy értéket (számot)"
PythonInsert = "x-et i. pozícióra helyezze a listában"
PythonInt = "egész számra konvertálás"
PythonIonFunction = "ion modul funkció elötag"
PythonIsFinite = "x véges-e"
PythonIsInfinite = "x végtelen-e"
PythonIsKeyDown = "True-t válaszol ha a k gomb le van nyomva"
PythonBattery = "Az akkumulátor feszültségének visszaadása"
PythonBatteryLevel = "Az akkumulátor töltöttségi szintjének visszaadása"
PythonBatteryIscharging = "Visszaadja, ha az akkumulátor töltődik"
PythonSetBrightness = "Fényerőszint beállítása"
PythonGetBrightness = "Get brightness level"
PythonIsNaN = "Ellenörizze hogy x nem NaN"
PythonKandinskyFunction = "kandinsky modul funkció elötag"
PythonLdexp = "frexp ellentéte : x*(2**i)"
PythonLength = "Egy targy hossza"
PythonLgamma = "Gamma funkció logaritmusa"
PythonLog = "a alapú logaritmus"
PythonLog10 = "Decimális logaritmus"
PythonLog2 = "Bináris logaritmus"
PythonMathFunction = "math modul funkció elötag"
PythonMatplotlibPyplotFunction = "matplotlib.pyplot elötag"
PythonMax = "Maximum"
PythonMin = "Minimum"
PythonModf = "x-nek tört és egész részei"
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"
PythonPhase = "z fázisa"
PythonPlot = "y-t jelöli x függvényében"
PythonPolar = "Verctorizálni"
PythonPop = "Az utolsó elemet el törölni"
PythonPower = "x y. kitevö"
PythonPrint = "Ki irni a elemeket"
PythonRadians = "Fokról radiánra konvertálni"
PythonRandint = "Véletlen egész szám [a;b] -ban"
PythonRandom = "Decimális szám [0;1] -ban"
PythonRandomFunction = "random modul funkció elötag"
PythonRandrange = "Véletlen szám range(start,stop)-ban"
PythonRangeStartStop = "start-tol stop-ig listája"
PythonRangeStop = "0 tol stop-ig lista"
PythonRect = "Algebrai számra konvertálni"
PythonRemove = "Elsö x elöfordulását törolni"
PythonReverse = "A lista elemeit megfordítani (másik irány)"
PythonRound = "N számjegyre kerekítni"
PythonScatter = "(x,y) halmaza"
PythonSeed = "Inicializálni a véletlenszám-választót"
PythonSetPixel = "Az (x,y) pixel-t ki szinezni"
PythonShow = "Mutassa az ábrát"
PythonSin = "Szinusz"
PythonSinh = "Hiperbolikus szinusz"
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"
PythonSqrt = "Négyzetgyök"
PythonSum = "Összeadni a lista elemeit"
PythonTan = "Érintö (tan)"
PythonTanh = "Hiperbolikus érintö (tan)"
PythonText = "(x,y) nél egy szöveget irni"
PythonTimeFunction = "time funkció elötag"
PythonTrunc = "Egész csonka (?)"
PythonTurtleBackward = "x pixelt hátra"
PythonTurtleCircle = "r pixel sugarú kört rajzolni"
PythonTurtleColor = "Toll szinét beállitani"
PythonTurtleColorMode = "Szin módot 1.0-ra vagy 255-ra állitani"
PythonTurtleForward = "x pixelt elölre"
PythonTurtleFunction = "turtle modul funkció elötag"
PythonTurtleGoto = "Menjen a (x,y) koordinátákra"
PythonTurtleHeading = "Visszaadja az aktuális irányt"
PythonTurtleHideturtle = "A teknös elrejtése"
PythonTurtleIsdown = "True-t válaszol ha a toll irás pozícióban van"
PythonTurtleLeft = "a fokkot forduljon balra"
PythonTurtlePendown = "Húzza le a tollat"
PythonTurtlePensize = "Állítsa a vonalvastagságot x pixelre"
PythonTurtlePenup = "Húzza fel a tollat"
PythonTurtlePosition = "Az aktuális (x,y) pozíciót visszaadása"
PythonTurtleReset = "Visszaállitani a rajzot (torléssel)"
PythonTurtleRight = "a fokkot forduljon jobbra"
PythonTurtleSetheading = "a fokokra állítja be az irányt"
PythonTurtleShowturtle = "A teknöst meg mutatni"
PythonTurtleSpeed = "Rajzolási sebesség 0 és 10 között"
PythonTurtleWrite = "Szöveg irás"
PythonUniform = "Lebegöpontos szám [a,b] -ban"
PythonImportTime = "time modul importálása"
PythonMonotonic = "Meg fordítani a monoton idö"
PythonFileOpen = "Fájl megnyitása"
PythonFileSeekable = "Seek-et lehete használni"
PythonFileSeek = "A kurzort áthelyezni"
PythonFileTell = "Visszaadja a kurzor helye"
PythonFileClose = "Bezárni egy fájlt"
PythonFileClosed = "True ha a fájl bezárva"
PythonFileRead = "Olvas 16 bájtig"
PythonFileWrite = "b-t irjon a fájlba"
PythonFileReadline = "Olvas egy sort vagy 16 bájtig"
PythonFileReadlines = "Olvas több sort"
PythonFileTruncate = "A fájl átméretezése"
PythonFileWritelines = "Irjon több sort"
PythonFileName = "A fájl neve"
PythonFileMode = "A fájl nyitott módja"
PythonFileReadable = "read-et lehete használni"
PythonFileWritable = "write-ot lehete használni"
PythonImportOs = "os modul importálása"
PythonOsUname = "Rendszer informaciók"
PythonOsGetlogin = "Get username"
PythonOsRemove = "Fájl törlése"
PythonOsRename = "Fájl átnevezése"
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)"
PythonKeyLeft = "BALRA NYÍL billentyű"
PythonKeyUp = "FEL NYÍL billentyű"
PythonKeyDown = "LE NYÍL billentyű"
PythonKeyRight = "JOBBRA NYÍL billentyű"
PythonKeyOk = "OK gomb"
PythonKeyBack = "VISSZA gomb"
PythonKeyHome = "Lakáskulcs"
PythonKeyOnOff = "BE/KI gomb"
PythonKeyShift = "SHIFT billentyű"
PythonKeyAlpha = "ALPHA kulcs"
PythonKeyXnt = "X,N,T gomb"
PythonKeyVar = "VAR gomb"
PythonKeyToolbox = "TOOLBOX gomb"
PythonKeyBackspace = "BACKSPACE billentyű"
PythonKeyExp = "EXPONENTIÁLIS kulcs"
PythonKeyLn = "TERMÉSZETES LOGARITMUS kulcs"
PythonKeyLog = "DECIMÁLIS LOGARITMUS billentyű"
PythonKeyImaginary = "KÉPZELETES I kulcs"
PythonKeyComma = "VESZSŰ gomb"
PythonKeyPower = "POWER gomb"
PythonKeySine = "SINE gomb"
PythonKeyCosine = "KOSINUS kulcs"
PythonKeyTangent = "ÉRINTŐ gomb"
PythonKeyPi = "PI kulcs"
PythonKeySqrt = "NÉGYGYÖK kulcs"
PythonKeySquare = "SZÖGZET billentyű"
PythonKeySeven = "7 kulcs"
PythonKeyEight = "8 kulcs"
PythonKeyNine = "9 kulcs"
PythonKeyLeftParenthesis = "BAL ZÁRÓZELŐ gomb"
PythonKeyRightParenthesis = "JOBB ZÁRÓZELŐ billentyű"
PythonKeyFour = "4 kulcs"
PythonKeyFive = "5 kulcs"
PythonKeySix = "6 kulcs"
PythonKeyMultiplication = "SZORZAT gomb"
PythonKeyDivision = "OSZTÁS kulcs"
PythonKeyOne = "1 kulcs"
PythonKeyTwo = "2 kulcs"
PythonKeyThree = "3 kulcs"
PythonKeyPlus = "PLUSZ kulcs"
PythonKeyMinus = "MÍNUS gomb"
PythonKeyZero = "0 kulcs"
PythonKeyDot = "DOT gomb"
PythonKeyEe = "10 POWER X gomb"
PythonKeyAns = "ANS kulcs"
PythonKeyExe = "EXE kulcs"
PythonImportUtils = "Az ulab.utils importálása"
PythonUtilsFunction = "utils modul függvény előtagja"
PythonTurtleBgcolor = "Módosítsa a háttérszínt"

View File

@@ -1,5 +1,11 @@
PythonPound = "Commento"
PythonPercent = "Modulo"
PythonColon = "Due punti"
PythonSemicon = "Punto e virgola"
PythonExclamationMark = "Punto esclamativo"
PythonLessThan = "Minore di"
PythonGreaterThan = "Maggiore di"
PythonQuestionMark = "Punto interrogativo"
Python1J = "Unità immaginaria"
PythonLF = "Nuova riga"
PythonTab = "Tabulazione"
@@ -25,13 +31,13 @@ PythonBin = "Converte un intero in binario"
PythonCeil = "Parte intera superiore"
PythonChoice = "Numero aleatorio nella lista"
PythonClear = "Svuota la lista"
PythonCmathFunction = "Funz. prefissata modulo cmath"
PythonCmathFunction = "Prefisso funzione del modulo cmath"
PythonColor = "Definisci un colore rvb"
PythonColorBlack = "Colore nero"
PythonColorBlue = "Colore blu"
PythonColorBrown = "Colore marrone"
PythonColorGray = "Colore grigio"
PythonColorGreen = "Colore verde"
PythonColorGrey = "Colore grigio"
PythonColorOrange = "Colore arancione"
PythonColorPink = "Colore rosa"
PythonColorPurple = "Colore viola"
@@ -45,19 +51,26 @@ PythonCosh = "Coseno iperbolico"
PythonCount = "Conta le ricorrenze di x"
PythonDegrees = "Conversione di radianti in gradi"
PythonDivMod = "Quoziente e resto"
PythonDrawCircle = "Disegnare un cerchio"
PythonDrawLine = "Disegna una linea"
PythonDrawString = "Visualizza il testo dal pixel x,y"
PythonErf = "Funzione d'errore"
PythonErfc = "Funzione d'errore complementare"
PythonEval = "Valuta l'espressione nell'argomento "
PythonExp = "Funzione esponenziale"
PythonExpm1 = "Calcola exp(x)-1"
PythonFactorial = "Fattoriale di x"
PythonFabs = "Valore assoluto"
PythonFillCircle = "Riempire un cerchio"
PythonFillPolygon = "Riempire un poligono"
PythonFillRect = "Riempie un rettangolo"
PythonFloat = "Conversione in flottanti"
PythonFloor = "Parte intera"
PythonFmod = "a modulo b"
PythonFrExp = "Mantissa ed esponente di x : (m,e)"
PythonGamma = "Funzione gamma"
PythonGetKeys = "Ottieni i tasti premuti"
PythonGetPalette = "Ottieni la tavolozza del tema"
PythonGetPixel = "Restituisce colore del pixel(x,y)"
PythonGetrandbits = "Numero aleatorio con k bit"
PythonGrid = "Attiva la visibilità della griglia"
@@ -69,21 +82,37 @@ PythonImportKandinsky = "Importa modulo kandinsky"
PythonImportRandom = "Importa modulo random"
PythonImportMath = "Importa modulo math"
PythonImportMatplotlibPyplot = "Importa modulo matplotlib.pyplot"
PythonImportNumpy = "Importa modulo ulab.numpy"
PythonImportScipy = "Importa modulo ulab.scipy"
PythonImportTurtle = "Importa del modulo turtle"
PythonImportTime = "Importa del modulo time"
PythonImportOs = "Importa modulo os"
PythonOsUname = "Ottieni informazioni sul sistema"
PythonOsGetlogin = "Ottieni username"
PythonOsRemove = "Rimuovere un file"
PythonOsRename = "Rinomina file"
PythonOsListdir = "Elenca file"
PythonImportSys = "Importa modulo sys"
PythonSysExit = "Termina programma corrente"
PythonSysPrintexception = "Stampa eccezione"
PythonSysByteorder = "Ordine di byte del sistema"
PythonSysImplementation = "Informazioni su Python"
PythonSysModules = "Dizionario dei moduli caricati"
PythonSysVersion = "Versione linguaggio Python (stringa)"
PythonSysVersioninfo = "Versione linguaggio Python (tupla)"
PythonIndex = "Indice prima occorrenza di x"
PythonInput = "Inserire un valore"
PythonInsert = "Inserire x in posizione i-esima"
PythonInt = "Conversione in intero"
PythonIonFunction = "Prefisso di funzione modulo ion"
PythonIsFinite = "Testa se x è finito"
PythonIsInfinite = "Testa se x est infinito"
PythonIsInfinite = "Testa se x è infinito"
PythonIsKeyDown = "Restituisce True premendo tasto k"
PythonBattery = "Restituisce la tensione della batteria"
PythonBatteryLevel = "Restituisce il livello della batteria"
PythonBatteryIscharging = "Restituisce se la batteria è in carica"
PythonSetBrightness = "Imposta livello di luminosità"
PythonGetBrightness = "Ottieni livello di luminosità"
PythonIsNaN = "Testa se x è NaN"
PythonKandinskyFunction = "Prefisso funzione modulo kandinsky"
PythonKeyLeft = "Tasto FRECCIA SINISTRA"
@@ -144,6 +173,14 @@ PythonMax = "Massimo"
PythonMin = "Minimo"
PythonModf = "Parti frazionarie e intere"
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"
PythonPhase = "Argomento di z"
PythonPlot = "Disegna y in f. di x come linee"
@@ -159,7 +196,7 @@ PythonRandrange = "Numero dentro il range(start, stop)"
PythonRangeStartStop = "Lista da start a stop-1"
PythonRangeStop = "Lista da 0 a stop-1"
PythonRect = "Converte in coordinate algebriche"
PythonRemove = "Cancella la prima x dalla lista"
PythonRemove = "Cancella la prima x dalla lista"
PythonReverse = "Inverte gli elementi della lista"
PythonRound = "Arrotondato a n cifre decimali"
PythonScatter = "Diagramma dispersione y in f. di x"
@@ -169,6 +206,12 @@ PythonShow = "Mostra la figura"
PythonSin = "Seno"
PythonSinh = "Seno iperbolico"
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"
PythonSqrt = "Radice quadrata"
PythonSum = "Somma degli elementi della lista"
@@ -195,28 +238,28 @@ PythonTurtlePosition = "Fornisce posizione corrente (x,y)"
PythonTurtleReset = "Azzera il disegno"
PythonTurtleRight = "Ruota di a gradi a destra"
PythonTurtleSetheading = "Imposta l'orientamento per a gradi"
PythonTurtleSetposition = "Posiziona la tartaruga"
PythonTurtleShowturtle = "Mostra la tartaruga"
PythonTurtleSpeed = "Velocità di disegno (x tra 0 e 10)"
PythonTurtleWrite = "Mostra un testo"
PythonUniform = "Numero decimale tra [a,b]"
PythonImportTime = "Import time module"
PythonTimePrefix = "time module function prefix"
PythonTimeSleep = "Wait for n second"
PythonMonotonic = "Return monotonic time"
PythonFileOpen = "Opens a file"
PythonFileSeekable = "Tells if seek can be used on a file"
PythonFileSeek = "Move file's cursor"
PythonFileTell = "Get file's cursor location"
PythonFileClose = "Closes a file"
PythonFileClosed = "True if file was closed"
PythonFileRead = "Read up to size bytes"
PythonFileWrite = "Write b into file"
PythonFileReadline = "Reads a line or up to size bytes"
PythonFileReadlines = "Reads a list of lines"
PythonFileTruncate = "Resize the file to size"
PythonFileWritelines = "Writes a list of lines"
PythonFileName = "Contains file's name"
PythonFileMode = "Contains file's open mode"
PythonFileReadable = "Tells if read can be used on a file"
PythonFileWritable = "Tells if write can be used on a file"
PythonImportTime = "Importa modulo time"
PythonMonotonic = "Restituisce tempo monotonico"
PythonFileOpen = "Apre un file"
PythonFileSeekable = "Dice se si può usare il cursore su un file"
PythonFileSeek = "Sposta cursore di un file"
PythonFileTell = "Ottieni posizione del cursore del file"
PythonFileClose = "Chiude un file"
PythonFileClosed = "True se un file è stato chiuso"
PythonFileRead = "Legge fino ai byte di un file"
PythonFileWrite = "Scrive b in un file"
PythonFileReadline = "Legge una riga o fino ai byte di un file"
PythonFileReadlines = "Legge una lista di linee di un file"
PythonFileTruncate = "Ridimensiona il file"
PythonFileWritelines = "Scrive una lista di linee su file"
PythonFileName = "Contiene il nome del file"
PythonFileMode = "Contiene la modalità di apertura del file"
PythonFileReadable = "Dice se si può leggere sul file"
PythonFileWritable = "Dice se si può scrivere sul file"
PythonImportUtils = "Importazione di ulab.utils"
PythonUtilsFunction = "Prefisso funzione del modulo utils"
PythonTurtleBgcolor = "Cambia il colore dello sfondo"

View File

@@ -1,5 +1,11 @@
PythonPound = "Opmerkingen"
PythonPercent = "Modulo"
PythonColon = "Dubbele punt"
PythonSemicon = "Puntkomma"
PythonExclamationMark = "Uitroepteken"
PythonLessThan = "Kleiner dan"
PythonGreaterThan = "Groter dan"
PythonQuestionMark = "Vraagteken"
Python1J = "Imaginaire i"
PythonLF = "Nieuwe regel"
PythonTab = "Tabulatie"
@@ -13,14 +19,14 @@ PythonAbs = "Absolute waarde"
PythonAcos = "Arccosinus"
PythonAcosh = "Arccosinus hyperbolicus"
PythonAppend = "Voeg x toe aan het eind van je lijst"
PythonArrow = "Arrow from (x,y) to (x+dx,y+dy)"
PythonArrow = "Pijl van (x,y) naar (x+dx,y+dy)"
PythonAsin = "Arcsinus"
PythonAsinh = "Arcsinus hyperbolicus"
PythonAtan = "Arctangens"
PythonAtan2 = "Geeft atan(y/x)"
PythonAtanh = "Arctangens hyperbolicus"
PythonAxis = "Set the axes to (xmin,xmax,ymin,ymax)"
PythonBar = "Draw a bar plot with x values"
PythonAxis = "Stel de assen in (xmin,xmax,ymin,ymax)"
PythonBar = "Teken staafdiagram met x-waarden"
PythonBin = "Zet integer om in een binair getal"
PythonCeil = "Plafond"
PythonChoice = "Geeft willek. getal van de lijst"
@@ -30,8 +36,8 @@ PythonColor = "Definieer een rgb kleur"
PythonColorBlack = "Zwarte kleur"
PythonColorBlue = "Blauwe kleur"
PythonColorBrown = "Bruine kleur"
PythonColorGray = "Grijze kleur"
PythonColorGreen = "Groene kleur"
PythonColorGrey = "Grijze kleur"
PythonColorOrange = "Oranje kleur"
PythonColorPink = "Roze kleur"
PythonColorPurple = "Paarse kleur"
@@ -45,36 +51,55 @@ PythonCosh = "Cosinus hyperbolicus"
PythonCount = "Tel voorkomen van x"
PythonDegrees = "Zet x om van radialen naar graden"
PythonDivMod = "Quotiënt en rest"
PythonDrawCircle = "Teken een cirkel"
PythonDrawLine = "Teken een lijn"
PythonDrawString = "Geef een tekst weer van pixel (x,y)"
PythonErf = "Error functie"
PythonErfc = "Complementaire error functie"
PythonEval = "Geef de geëvalueerde uitdrukking"
PythonExp = "Exponentiële functie"
PythonExpm1 = "Bereken exp(x)-1"
PythonFactorial = "faculteit van x"
PythonFabs = "Absolute waarde"
PythonFillCircle = "Vul een cirkel"
PythonFillPolygon = "Vul een veelhoek"
PythonFillRect = "Vul een rechthoek bij pixel (x,y)"
PythonFloat = "Zet x om in een float"
PythonFloor = "Vloer"
PythonFmod = "a modulo b"
PythonFrExp = "Mantisse en exponent van x: (m,e)"
PythonGamma = "Gammafunctie"
PythonGetKeys = "Get toetsen ingedrukt"
PythonGetPalette = "Thema palet krijgen"
PythonGetPixel = "Geef pixel (x,y) kleur (rgb)"
PythonGetrandbits = "Integer met k willekeurige bits"
PythonGrid = "Toggle the visibility of the grid"
PythonGrid = "Verander zichtbaarheid raster"
PythonHex = "Zet integer om in hexadecimaal"
PythonHist = "Draw the histogram of x"
PythonHist = "Teken het histogram van x"
PythonImportCmath = "Importeer cmath module"
PythonImportIon = "Importeer ion module"
PythonImportKandinsky = "Importeer kandinsky module"
PythonImportRandom = "Importeer random module"
PythonImportMath = "Importeer math module"
PythonImportMatplotlibPyplot = "Import matplotlib.pyplot module"
PythonImportMatplotlibPyplot = "Importeer matplotlib.pyplot module"
PythonImportNumpy = "Importeer ulab.numpy module"
PythonImportScipy = "Importeer ulab.scipy module"
PythonImportTime = "Importeer time module"
PythonImportOs = "Importeer os module"
PythonOsUname = " Krijg systeeminfo"
PythonOsGetlogin = "Get username"
PythonOsRemove = "Een bestand verwijderen"
PythonOsRename = "Hernoem bestand"
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"
PythonIndex = "Index van de eerste x aanwezigheden"
PythonInput = "Wijs een waarde toe"
@@ -84,7 +109,12 @@ PythonIonFunction = "ion module voorvoegsel"
PythonIsFinite = "Controleer of x eindig is"
PythonIsInfinite = "Controleer of x oneindig is"
PythonIsKeyDown = "Geef True als k toets omlaag is"
PythonIsNaN = "Controleer of x geen nummer is"
PythonBattery = "Return batterijspanning"
PythonBatteryLevel = "Batterijniveau teruggeven"
PythonBatteryIscharging = "Keer terug als de batterij wordt opgeladen"
PythonSetBrightness = "Set brightness level"
PythonGetBrightness = "Get brightness level"
PythonIsNaN = "Controleer of x geen getal is"
PythonKandinskyFunction = "kandinsky module voorvoegsel"
PythonKeyLeft = "PIJL NAAR LINKS toets"
PythonKeyUp = "PIJL OMHOOG toets"
@@ -144,16 +174,24 @@ PythonMax = "Maximum"
PythonMin = "Minimum"
PythonModf = "Fractionele en gehele delen van x"
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"
PythonPhase = "Fase van z in radialen"
PythonPlot = "Plot y versus x as lines"
PythonPlot = "Plot y versus x als lijnen"
PythonPolar = "z in poolcoördinaten"
PythonPop = "Verwijder en breng het laatste item terug"
PythonPower = "x tot de macht y"
PythonPrint = "Print object"
PythonRadians = "Zet x om van graden naar radialen"
PythonRandint = "Geeft willek. integer in [a,b]"
PythonRandom = "Een willekeurig getal in [0,1["
PythonRandom = "Een willekeurig getal in [0,1)"
PythonRandomFunction = "random module voorvoegsel"
PythonRandrange = "Willek. getal in range(start, stop)"
PythonRangeStartStop = "Lijst van start tot stop-1"
@@ -162,19 +200,25 @@ PythonRect = "z in cartesiaanse coördinaten"
PythonRemove = "Verwijder het eerste voorkomen van x"
PythonReverse = "Keer de elementen van de lijst om"
PythonRound = "Rond af op n cijfers"
PythonScatter = "Draw a scatter plot of y versus x"
PythonScatter = "Teken scatterplot van y versus x"
PythonSeed = "Start willek. getallengenerator"
PythonSetPixel = "Kleur pixel (x,y)"
PythonShow = "Display the figure"
PythonSin= "Sinus"
PythonShow = "Figuur weergeven"
PythonSin = "Sinus"
PythonSinh = "Sinus hyperbolicus"
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"
PythonSqrt = "Vierkantswortel"
PythonSum = "Sommeer de items van een lijst"
PythonTan = "Tangens"
PythonTanh = "Tangens hyperbolicus"
PythonText = "Display a text at (x,y) coordinates"
PythonText = "Geef tekst weer op coördinaten (x,y)"
PythonTimeFunction = "time module voorvoegsel"
PythonTrunc = "x afgeknot tot een integer"
PythonTurtleBackward = "Ga achterwaarts met x pixels"
@@ -195,14 +239,11 @@ PythonTurtlePosition = "Zet huidige (x,y) locatie terug"
PythonTurtleReset = "Reset de tekening"
PythonTurtleRight = "Ga rechtsaf met a graden"
PythonTurtleSetheading = "Zet de oriëntatie op a graden"
PythonTurtleSetposition = "Plaats de schildpad"
PythonTurtleShowturtle = "Laat de schildpad zien"
PythonTurtleSpeed = "Tekensnelheid tussen 0 and 10"
PythonTurtleWrite = "Display a text"
PythonUniform = "Zwevendekommagetal in [a,b]"
PythonUniform = "Decimaal getal in [a,b]"
PythonImportTime = "Import time module"
PythonTimePrefix = "time module function prefix"
PythonTimeSleep = "Wait for n second"
PythonMonotonic = "Return monotonic time"
PythonFileOpen = "Opens a file"
PythonFileSeekable = "Tells if seek can be used on a file"
@@ -220,3 +261,6 @@ PythonFileName = "Contains file's name"
PythonFileMode = "Contains file's open mode"
PythonFileReadable = "Tells if read can be used on a file"
PythonFileWritable = "Tells if write can be used on a file"
PythonImportUtils = "Ulab.utils importeren"
PythonUtilsFunction = "utils module functie prefix"
PythonTurtleBgcolor = "Verander de achtergrondkleur"

View File

@@ -1,5 +1,11 @@
PythonPound = "Comentário"
PythonPercent = "Módulo"
PythonColon = "Dois pontos"
PythonSemicon = "Ponto e vírgula"
PythonExclamationMark = "Ponto de exclamação"
PythonLessThan = "Menor que"
PythonGreaterThan = "Maior que"
PythonQuestionMark = "Ponto de interrogação"
Python1J = "i Complexo"
PythonLF = "Nova linha"
PythonTab = "Tabulação"
@@ -30,8 +36,8 @@ PythonColor = "Define uma cor rgb"
PythonColorBlack = "Cor preta"
PythonColorBlue = "Cor azul"
PythonColorBrown = "Cor castanha"
PythonColorGray = "Cor cinzenta"
PythonColorGreen = "Cor verde"
PythonColorGrey = "Cor cinzenta"
PythonColorOrange = "Cor laranja"
PythonColorPink = "Cor rosa"
PythonColorPurple = "Cor roxa"
@@ -45,19 +51,26 @@ PythonCosh = "Cosseno hiperbólico"
PythonCount = "Contar as ocorrências de x"
PythonDegrees = "Converter x de radianos para graus"
PythonDivMod = "Quociente e resto"
PythonDrawCircle = "Desenha um círculo"
PythonDrawLine = "Desenhe uma linha"
PythonDrawString = "Mostrar o texto do pixel (x,y)"
PythonErf = "Função erro"
PythonErfc = "Função erro complementar"
PythonEval = "Devolve a expressão avaliada"
PythonExp = "Função exponencial"
PythonExpm1 = "Calcular exp(x)-1"
PythonFactorial = "Fatorial de x"
PythonFabs = "Valor absoluto"
PythonFillCircle = "Preencher um círculo"
PythonFillPolygon = "Preencher um polígono"
PythonFillRect = "Preencher um retângulo em (x,y)"
PythonFloat = "Converter x num flutuante"
PythonFloor = "Parte inteira"
PythonFmod = "a módulo b"
PythonFrExp = "Coeficiente e expoente de x: (m, e)"
PythonGamma = "Função gama"
PythonGetKeys = "Obter teclas pressionadas"
PythonGetPalette = "Obter paleta temática"
PythonGetPixel = "Devolve a cor do pixel (x,y)"
PythonGetrandbits = "Número inteiro aleatório com k bits"
PythonGrid = "Alterar visibilidade da grelha"
@@ -69,6 +82,8 @@ PythonImportKandinsky = "Importar módulo kandinsky"
PythonImportRandom = "Importar módulo random"
PythonImportMath = "Importar módulo math"
PythonImportMatplotlibPyplot = "Importar módulo matplotlib.pyplot"
PythonImportNumpy = "Importar módulo ulab.numpy"
PythonImportScipy = "Importar módulo ulab.scipy"
PythonImportTime = "Importar módulo time"
PythonImportTurtle = "Importar módulo turtle"
PythonIndex = "Índice da primeira ocorrência de x"
@@ -79,6 +94,11 @@ PythonIonFunction = "Prefixo da função do módulo ion"
PythonIsFinite = "Verificar se x é finito"
PythonIsInfinite = "Verificar se x é infinito"
PythonIsKeyDown = "Devolve True se tecla k pressionada"
PythonBattery = "Retornar a voltagem da bateria"
PythonBatteryLevel = "Retornar nível de bateria"
PythonBatteryIscharging = "Retorne se a bateria estiver carregando"
PythonSetBrightness = "Definir nível de brilho"
PythonGetBrightness = "Obter nível de brilho"
PythonIsNaN = "Verificar se x é um NaN"
PythonKandinskyFunction = "Prefixo da função do módulo kandinsky"
PythonKeyLeft = "tecla SETA ESQUERDA"
@@ -139,6 +159,14 @@ PythonMax = "Máximo"
PythonMin = "Mínimo"
PythonModf = "Partes inteira e frácionária de x"
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"
PythonPhase = "Argumento de z"
PythonPlot = "Desenhar y em função de x"
@@ -164,6 +192,12 @@ PythonShow = "Mostrar a figura"
PythonSin = "Seno"
PythonSinh = "Seno hiperbólico"
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"
PythonSqrt = "Raiz quadrada"
PythonSum = "Soma dos itens da lista"
@@ -190,7 +224,6 @@ PythonTurtlePosition = "Devolve a posição atual (x,y)"
PythonTurtleReset = "Reiniciar o desenho"
PythonTurtleRight = "Virar à esquerda por a graus"
PythonTurtleSetheading = "Definir a orientação por a graus"
PythonTurtleSetposition = "Positionne la tortue"
PythonTurtleShowturtle = "Mostrar o turtle"
PythonTurtleSpeed = "Velocidade do desenho entre 0 e 10"
PythonTurtleWrite = "Mostrar um texto"
@@ -198,11 +231,18 @@ PythonUniform = "Número decimal em [a,b]"
PythonImportTime = "Import time module"
PythonImportOs = "Import os module"
PythonOsUname = " Obter informações do sistema"
PythonOsGetlogin = "Get username"
PythonOsRemove = "Remover um ficheiro"
PythonOsRename = "Renomear ficheiro"
PythonOsListdir = "Listar ficheiros"
PythonTimePrefix = "time module function prefix"
PythonTimeSleep = "Wait for n second"
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)"
PythonMonotonic = "Return monotonic time"
PythonFileOpen = "Opens a file"
PythonFileSeekable = "Tells if seek can be used on a file"
@@ -220,3 +260,6 @@ PythonFileName = "Contains file's name"
PythonFileMode = "Contains file's open mode"
PythonFileReadable = "Tells if read can be used on a file"
PythonFileWritable = "Tells if write can be used on a file"
PythonImportUtils = "Importando ulab.utils"
PythonUtilsFunction = "prefixo de função do módulo utils"
PythonTurtleBgcolor = "Alterar a cor de fundo"

View File

@@ -1,6 +1,12 @@
PythonCommandAmpersand = "&"
PythonCommandLF = "\\n"
PythonCommandPercent = "%"
PythonCommandColon = ":"
PythonCommandSemicon = ";"
PythonCommandExclamationMark = "!"
PythonCommandLessThan = "<"
PythonCommandGreaterThan = ">"
PythonCommandQuestionMark = "?"
PythonCommandPound = "#"
PythonCommandSingleQuote = "'x'"
PythonCommandSymbolExp = "^"
@@ -32,8 +38,8 @@ PythonCommandColor = "color(r,g,b)"
PythonCommandColorBlack = "'black'"
PythonCommandColorBlue = "'blue'"
PythonCommandColorBrown = "'brown'"
PythonCommandColorGray = "'gray'"
PythonCommandColorGreen = "'green'"
PythonCommandColorGrey = "'grey'"
PythonCommandColorOrange = "'orange'"
PythonCommandColorPink = "'pink'"
PythonCommandColorPurple = "'purple'"
@@ -50,6 +56,8 @@ PythonCommandCount = "list.count(x)"
PythonCommandCountWithoutArg = ".count(\x11)"
PythonCommandDegrees = "degrees(x)"
PythonCommandDivMod = "divmod(a,b)"
PythonCommandDrawCircle = "draw_circle(x,y,r,color)"
PythonCommandDrawLine = "draw_line(x1,y1,x2,y2,color)"
PythonCommandDrawString = "draw_string(\"text\",x,y)"
PythonCommandConstantE = "e"
PythonCommandErf = "erf(x)"
@@ -58,13 +66,18 @@ PythonCommandEval = "eval(\"expression\")"
PythonCommandExp = "exp(x)"
PythonCommandExpComplex = "exp(z)"
PythonCommandExpm1 = "expm1(x)"
PythonCommandFactorial = "factorial(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)"
PythonCommandFloat = "float(x)"
PythonCommandFloor = "floor(x)"
PythonCommandFmod = "fmod(a,b)"
PythonCommandFrExp = "frexp(x)"
PythonCommandGamma = "gamma(x)"
PythonCommandGetKeys = "get_keys()"
PythonCommandGetPalette = "get_palette()"
PythonCommandGetPixel = "get_pixel(x,y)"
PythonCommandGetrandbits = "getrandbits(k)"
PythonCommandGrid = "grid()"
@@ -85,9 +98,13 @@ PythonCommandImportIon = "import ion"
PythonCommandImportKandinsky = "import kandinsky"
PythonCommandImportMath = "import math"
PythonCommandImportMatplotlibPyplot = "import matplotlib.pyplot"
PythonCommandImportFromNumpy = "from ulab import numpy as np"
PythonCommandImportFromScipy = "from ulab import scipy as spy"
PythonCommandImportRandom = "import random"
PythonCommandImportOs = "import os"
PythonCommandImportFromOs = "from os import *"
PythonCommandImportSys = "import sys"
PythonCommandImportFromSys = "from sys import *"
PythonCommandImportTime = "import time"
PythonCommandImportTurtle = "import turtle"
PythonCommandIndex = "list.index(x)"
@@ -150,6 +167,11 @@ PythonCommandKeyEe = "KEY_EE"
PythonCommandKeyAns = "KEY_ANS"
PythonCommandKeyExe = "KEY_EXE"
PythonCommandIsKeyDown = "keydown(k)"
PythonCommandBattery = "battery()"
PythonCommandBatteryLevel = "battery_level()"
PythonCommandBatteryIscharging = "battery_ischarging()"
PythonCommandSetBrightness = "set_brightness()"
PythonCommandGetBrightness = "get_brightness()"
PythonCommandLdexp = "ldexp(x,i)"
PythonCommandLength = "len(object)"
PythonCommandLgamma = "lgamma(x)"
@@ -165,6 +187,128 @@ PythonCommandMax = "max(list)"
PythonCommandMin = "min(list)"
PythonCommandModf = "modf(x)"
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"
PythonCommandImportFromUtils = "from ulab import utils"
PythonCommandUtilsFunction = "utils.function"
PythonCommandUtilsFunctionWithoutArg = "utils.\x11"
PythonCommandUtilsSpectrogram = "spectrogram(a)"
PythonCommandUtilsFromInt16Buffer = "from_int16_buffer(b)"
PythonCommandUtilsFromUint16Buffer = "from_uint16_buffer(b)"
PythonCommandUtilsFromInt32Buffer = "from_int32_buffer(b)"
PythonCommandUtilsFromUint32Buffer = "from_uint32_buffer(b)"
PythonCommandOct = "oct(x)"
PythonCommandPhase = "phase(z)"
PythonCommandPlot = "plot(x,y,color)"
@@ -191,12 +335,39 @@ PythonCommandReverseWithoutArg = ".reverse()"
PythonCommandRound = "round(x,n)"
PythonCommandScatter = "scatter(x,y)"
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)"
PythonCommandShow = "show()"
PythonCommandSin = "sin(x)"
PythonCommandSinComplex = "sin(z)"
PythonCommandSinh = "sinh(x)"
PythonCommandSleep = "sleep(t)"
PythonCommandLocalTime = "localtime([timestamp])"
PythonCommandMktime = "mktime(tm)"
PythonCommandTime = "time()"
PythonCommandSetLocaltime = "setlocaltime(tm)"
PythonCommandRTCmode = "rtcmode()"
PythonCommandSetRTCmode = "setrtcmode(mode)"
PythonCommandSort = "list.sort()"
PythonCommandSortWithoutArg = ".sort()"
PythonCommandSorted = "sorted(list)"
@@ -215,15 +386,25 @@ PythonCommandUniform = "uniform(a,b)"
PythonConstantE = "2.718281828459045"
PythonConstantPi = "3.141592653589793"
PythonOsCommandUname = "uname()"
PythonOsCommandGetlogin = "getlogin()"
PythonOsCommandRemove = "remove(filename)"
PythonOsCommandRename = "rename(oldname, newname)"
PythonOsCommandRemoveWithoutArg = "remove(\x11)"
PythonOsCommandRenameWithoutArg = "rename(\x11,)"
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)"
PythonTurtleCommandCircle = "circle(r)"
PythonTurtleCommandColor = "color('c')"
PythonTurtleCommandColorMode = "colormode(x)"
PythonTurtleCommandBgcolor = "bgcolor('c')"
PythonTurtleCommandForward = "forward(x)"
PythonTurtleCommandGoto = "goto(x,y)"
PythonTurtleCommandHeading = "heading()"
@@ -237,16 +418,8 @@ PythonTurtleCommandPosition = "position()"
PythonTurtleCommandReset = "reset()"
PythonTurtleCommandRight = "right(a)"
PythonTurtleCommandSetheading = "setheading(a)"
PythonTurtleCommandSetposition = "setposition(x,[y])"
PythonTurtleCommandShowturtle = "showturtle()"
PythonTurtleCommandSpeed = "speed(x)"
PythonTurtleCommandWhite = "'white'"
PythonTurtleCommandYellow = "'yellow'"
PythonTimeModule = "time"
PythonTimeCommandImportFrom = "from time import *"
PythonTimeCommandSleep = "sleep()"
PythonTimeCommandSleepDemo = "sleep(n)"
PythonTimeCommandMonotonic = "monotonic()"
PythonCommandFileOpen = "open(name, [mode])"
PythonCommandFileOpenWithoutArg = "open(\x11)"
PythonCommandFileSeek = "file.seek(offset, [whence])"

View File

@@ -451,30 +451,6 @@ void ConsoleController::printText(const char * text, size_t length) {
flushOutputAccumulationBufferToStore();
micropython_port_vm_hook_refresh_print();
}
// #if __EMSCRIPTEN__
/* If we called micropython_port_interrupt_if_needed here, we would need to
* put in the WHITELIST all the methods that call
* ConsoleController::printText, which means all the MicroPython methods that
* call print... This is a lot of work + might reduce the performance as
* emterpreted code is slower.
*
* We thus do not allow print interruption on the web simulator. It would be
* better to allow it, but the biggest problem was on the device anyways
* -> It is much quicker to interrupt Python on the web simulator than on the
* device.
*
* TODO: Allow print interrpution on emscripten -> maybe by using WASM=1 ? */
/*
* This can be run in Omega, since it uses WebASM.
*/
// #else
/* micropython_port_vm_hook_loop is not enough to detect user interruptions,
* because it calls micropython_port_interrupt_if_needed every 20000
* operations, and a print operation is quite long. We thus explicitely call
* micropython_port_interrupt_if_needed here. */
micropython_port_interrupt_if_needed();
// #endif
}
void ConsoleController::autoImportScript(Script script, bool force) {

View File

@@ -19,7 +19,7 @@ void ConsoleLineCell::ScrollableConsoleLineView::ConsoleLineView::setLine(Consol
void ConsoleLineCell::ScrollableConsoleLineView::ConsoleLineView::drawRect(KDContext * ctx, KDRect rect) const {
ctx->fillRect(bounds(), Palette::CodeBackground);
ctx->drawString(m_line->text(), KDPointZero, GlobalPreferences::sharedGlobalPreferences()->font(), textColor(m_line), isHighlighted()? Palette::Select : Palette::BackgroundApps);
ctx->drawString(m_line->text(), KDPointZero, GlobalPreferences::sharedGlobalPreferences()->font(), textColor(m_line), isHighlighted()? Palette::Select : Palette::CodeBackground);
}
KDSize ConsoleLineCell::ScrollableConsoleLineView::ConsoleLineView::minimalSizeForOptimalDisplay() const {

View File

@@ -4,6 +4,8 @@
#include "app.h"
#include <escher/metric.h>
#include <ion.h>
#include "../global_preferences.h"
#include <apps/apps_container.h>
using namespace Shared;
@@ -23,7 +25,7 @@ void EditorController::setScript(Script script, int scriptIndex) {
m_script = script;
m_scriptIndex = scriptIndex;
/* We edit the script direclty in the storage buffer. We thus put all the
/* We edit the script directly in the storage buffer. We thus put all the
* storage available space at the end of the current edited script and we set
* its size.
*
@@ -36,8 +38,8 @@ void EditorController::setScript(Script script, int scriptIndex) {
*
* */
size_t newScriptSize = Ion::Storage::sharedStorage()->putAvailableSpaceAtEndOfRecord(m_script);
m_editorView.setText(const_cast<char *>(m_script.content()), newScriptSize - Script::StatusSize());
Ion::Storage::sharedStorage()->putAvailableSpaceAtEndOfRecord(m_script);
m_editorView.setText(const_cast<char *>(m_script.content()), m_script.contentSize());
}
void EditorController::willExitApp() {
@@ -71,6 +73,10 @@ void EditorController::viewDidDisappear() {
m_menuController->scriptContentEditionDidFinish();
}
void EditorController::textAreaDidReceiveNoneXNTEvent() {
AppsContainer::sharedAppsContainer()->resetXNT();
}
bool EditorController::textAreaDidReceiveEvent(TextArea * textArea, Ion::Events::Event event) {
if (App::app()->textInputDidReceiveEvent(textArea, event)) {
return true;
@@ -80,7 +86,6 @@ bool EditorController::textAreaDidReceiveEvent(TextArea * textArea, Ion::Events:
return true;
}
if (event == Ion::Events::Backspace && textArea->selectionIsEmpty()) {
/* If the cursor is on the left of the text of a line, backspace one
* indentation space at a time. */

View File

@@ -30,6 +30,7 @@ public:
TELEMETRY_ID("Editor");
/* TextAreaDelegate */
void textAreaDidReceiveNoneXNTEvent() override;
bool textAreaDidReceiveEvent(TextArea * textArea, Ion::Events::Event event) override;
/* InputEventHandlerDelegate */

View File

@@ -26,7 +26,9 @@ void EditorView::resetSelection() {
}
void EditorView::scrollViewDidChangeOffset(ScrollViewDataSource * scrollViewDataSource) {
m_gutterView.setOffset(scrollViewDataSource->offset().y());
if (m_gutterView.setOffsetAndNeedResize(scrollViewDataSource->offset().y())) {
internalLayoutSubviews(true);
}
}
View * EditorView::subviewAtIndex(int index) {
@@ -42,8 +44,12 @@ void EditorView::didBecomeFirstResponder() {
}
void EditorView::layoutSubviews(bool force) {
m_gutterView.setOffset(0);
KDCoordinate gutterWidth = m_gutterView.minimalSizeForOptimalDisplay().width();
m_gutterView.setOffsetAndNeedResize(0); // Whatever the return is, we layout the editor view
internalLayoutSubviews(force);
}
void EditorView::internalLayoutSubviews(bool force) {
KDCoordinate gutterWidth = m_gutterView.computeWidth();
m_gutterView.setFrame(KDRect(0, 0, gutterWidth, bounds().height()), force);
m_textArea.setFrame(KDRect(
@@ -67,15 +73,23 @@ void EditorView::GutterView::drawRect(KDContext * ctx, KDRect rect) const {
KDCoordinate firstLine = m_offset / glyphSize.height();
KDCoordinate firstLinePixelOffset = m_offset - firstLine * glyphSize.height();
char lineNumber[4];
char lineNumberBuffer[m_numberOfDigits + 1];
int numberOfLines = bounds().height() / glyphSize.height() + 1;
for (int i=0; i<numberOfLines; i++) {
Poincare::Integer line(i + firstLine + 1);
line.serialize(lineNumber, 4);
KDCoordinate leftPadding = (2 - strlen(lineNumber)) * glyphSize.width();
int lineNumberValue = (i + firstLine + 1);
Poincare::Integer line(lineNumberValue);
int lineDigits = computeNumberOfDigitsFor(lineNumberValue);
for (int j=0; j < m_numberOfDigits - lineDigits; j++) {
lineNumberBuffer[j] = ' ';
}
line.serialize(lineNumberBuffer + (m_numberOfDigits - lineDigits), m_numberOfDigits + 1);
ctx->drawString(
lineNumber,
KDPoint(k_margin + leftPadding, i*glyphSize.height() - firstLinePixelOffset),
lineNumberBuffer,
KDPoint(k_margin, i*glyphSize.height() - firstLinePixelOffset),
m_font,
textColor,
backgroundColor
@@ -83,18 +97,36 @@ void EditorView::GutterView::drawRect(KDContext * ctx, KDRect rect) const {
}
}
void EditorView::GutterView::setOffset(KDCoordinate offset) {
bool EditorView::GutterView::setOffsetAndNeedResize(KDCoordinate offset) {
if (m_offset == offset) {
return;
return false;
}
m_offset = offset;
int numberOfDigits = computeMaxNumberOfDigits();
if (numberOfDigits != m_numberOfDigits) {
m_numberOfDigits = numberOfDigits;
return true;
}
markRectAsDirty(bounds());
return false;
}
int EditorView::GutterView::computeWidth() {
return 2 * k_margin + (m_numberOfDigits) * m_font->glyphSize().width();
}
KDSize EditorView::GutterView::minimalSizeForOptimalDisplay() const {
int numberOfChars = 2; // TODO: Could be computed
return KDSize(2 * k_margin + numberOfChars * Poincare::Preferences::sharedPreferences()->KDPythonFont()->glyphSize().width(), 0);
int EditorView::GutterView::computeMaxNumberOfDigits() {
return computeNumberOfDigitsFor((bounds().height() / m_font->glyphSize().height() + 1) + (m_offset / m_font->glyphSize().height()));
}
int EditorView::GutterView::computeNumberOfDigitsFor(int value) {
int digits = 1;
while (value >= pow(10, digits)) {
digits++;
}
return digits;
}
}

View File

@@ -29,6 +29,7 @@ public:
void unloadSyntaxHighlighter() { m_textArea.unloadSyntaxHighlighter(); };
void scrollViewDidChangeOffset(ScrollViewDataSource * scrollViewDataSource) override;
void didBecomeFirstResponder() override;
void internalLayoutSubviews(bool force);
private:
int numberOfSubviews() const override { return 2; }
View * subviewAtIndex(int index) override;
@@ -36,14 +37,21 @@ private:
class GutterView : public View {
public:
GutterView(const KDFont * font) : View(), m_font(font), m_offset(0) {}
GutterView(const KDFont * font) : View(), m_font(font), m_offset(0), m_numberOfDigits(2) {}
void drawRect(KDContext * ctx, KDRect rect) const override;
void setOffset(KDCoordinate offset);
KDSize minimalSizeForOptimalDisplay() const override;
bool setOffsetAndNeedResize(KDCoordinate offset); // Return true if the gutter view need to be resized
int computeWidth();
int computeMaxNumberOfDigits();
static int computeNumberOfDigitsFor(int value);
private:
static constexpr KDCoordinate k_margin = 2;
const KDFont * m_font;
KDCoordinate m_offset;
int m_numberOfDigits;
};
PythonTextArea m_textArea;

View File

@@ -1,44 +1,17 @@
#include "helpers.h"
#include <string.h>
#include <ion/unicode/code_point.h>
#include <ion.h>
#include <escher/clipboard.h>
namespace Code {
namespace Helpers {
class EventTextPair {
public:
constexpr EventTextPair(Ion::Events::Event event, const char * text) : m_event(event), m_text(text) {}
Ion::Events::Event event() const { return m_event; }
const char * text() const { return m_text; }
private:
const Ion::Events::Event m_event;
const char * m_text;
};
static_assert('\x11' == UCodePointEmpty, "Unicode error");
static constexpr EventTextPair sEventTextMap[] = {
EventTextPair(Ion::Events::XNT, "x"),
EventTextPair(Ion::Events::Exp, "exp(\x11)"),
EventTextPair(Ion::Events::Ln, "log(\x11)"),
EventTextPair(Ion::Events::Log, "log10(\x11)"),
EventTextPair(Ion::Events::Imaginary, "1j"),
EventTextPair(Ion::Events::Power, "**"),
EventTextPair(Ion::Events::Pi, "pi"),
EventTextPair(Ion::Events::Sqrt, "sqrt(\x11)"),
EventTextPair(Ion::Events::Square, "**2"),
EventTextPair(Ion::Events::Multiplication, "*"),
EventTextPair(Ion::Events::EE, "e"),
};
const char * PythonTextForEvent(Ion::Events::Event event) {
for (size_t i=0; i<sizeof(sEventTextMap)/sizeof(sEventTextMap[0]); i++) {
if (event == sEventTextMap[i].event()) {
return sEventTextMap[i].text();
for (size_t i=0; i<NumberOfPythonTextPairs; i++) {
UTF8Helper::TextPair pair = PythonTextPairs[i];
if (event.text() == pair.firstString()) {
return pair.secondString();
}
}
return nullptr;
}
}
}

View File

@@ -90,6 +90,11 @@ bool MenuController::handleEvent(Ion::Events::Event event) {
footer()->setSelectedButton(0);
return true;
}
if (event == Ion::Events::ShiftBack) {
Ion::Storage::sharedStorage()->reinsertTrash("py");
m_selectableTableView.reloadData();
return true;
}
if (event == Ion::Events::Up) {
if (footer()->selectedButton() == 0) {
footer()->setSelectedButton(-1);

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