Commit Graph

26 Commits

Author SHA1 Message Date
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
Gabriel Ozouf
625a89e610 [poincare/zoom] RefinedYRangeForDisplay signature 2020-12-10 13:45: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
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
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
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
d2b36be846 [poincare/zoom] Move automatic zoom to Poincare
Change-Id: I7a70ab54b33b9150682cc4f999ff4999a8288b7f
2020-11-04 15:58:07 +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
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
Hugo Saint-Vignes
8688fd5b95 [apps/shared] Add template for privateEvaluateXYAtParameter
Change-Id: I97b4165307f57e52924e321cb85154cb32ba1008
2020-11-04 15:11:43 +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
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
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
Romain Goyet
84768472bd Explicit std::min/max template usage
This is unfortunately required in several cases:
 - Sometimes when we use either float and double (this should be changed)
 - Because KDCoordinate is not an int, so any arithmemtic promotes it to
an int
 - Because we mix pointer differences and ints
2020-04-14 09:31:02 -04:00
Romain Goyet
950862f8d0 Use std::min and std::max 2020-04-14 09:31:02 -04:00
Émilie Feral
886fc98350 [escher] Palette: factorize data color iteration 2020-04-01 10:18:08 +02:00
Léa Saviot
a3a1f86f8d [apps] Add context parameter to fix tests 2020-02-12 15:13:21 +01:00
Léa Saviot
756eeeb2d8 [poincare/parser] Add context 2020-02-12 15:13:21 +01:00
Ruben Dashyan
c3cf5c1ef4 Rename UCodePointUnknownX to UCodePointUnknown 2020-02-12 15:13:15 +01:00
Ruben Dashyan
34aa27ea08 [apps/shared/continuous_function] Simplify templatedApproximateAtParameter 2020-02-12 15:13:15 +01:00
Ruben Dashyan
5750d00574 [apps/shared] Remove redundant call to isCircularlyDefined
ExpressionModel::expressionReduced does already call isCircularlyDefined
and returns undef if true.
The isCircularlyDefined method is then made private.
2020-02-12 15:13:15 +01:00
Ruben Dashyan
5f9464a548 [apps] In Shared, move cartesian_function.* to continuous_function.* 2019-09-20 17:11:42 +02:00