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
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
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
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
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
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
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
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
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
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
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
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
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
-No more limit to the number of calculations
-All calculations are memoized
-Added tests to test/calculation_store.cpp
Change-Id: Ia10e2b009576eaf4496ba44a0c88f6e7e76f6cef
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
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.
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
If an expression hasUnits and is then reduced, it might not have units
anymore for instance if it was replaced with undefined).
Scenario: Enter "[5000000000000000]^20 _s" in the calculation app