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
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
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
The additional results on units now include conversions into both unit
systems (metric and imperial).
Change-Id: Ie0f12eb3735e775560b66c2cbd78bc9a659145bb
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
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
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
-No more limit to the number of calculations
-All calculations are memoized
-Added tests to test/calculation_store.cpp
Change-Id: Ia10e2b009576eaf4496ba44a0c88f6e7e76f6cef
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
computed when the calculation is added to the store and don't change afterwards.
Otherwise, if their heights change when scrolling (due to a modification of the
display output type - ExactOnly, ApproximateOnly...), it generates crashes.
calculation height memoization. They're computed from the layouts which
don't depend on the complex format (or any other settings parameters
which could have changed).
deleting row
This fixes the following bug: input 1, OK, 1.2 OK, delete the row whose
input is '1' with the selection on the output view. The output of 1.2
does not toggle and it should.
There was a problem with the way of computing Height, see
Calculation::HistoryViewCell. We did not encounter a problemeatic
scenario here, but there is no reason it would have been safe before.
Fixed a bug involving mishandled negative offsets in
CalculationSelectableTableView::scrollToSubviewOfTypeOfCellAtLocation
and cleaned up the function.
Change-Id: I4394ca9dc9748e8b761e7f722e41014d71d3373f
responder, scroll to the bottom of the table (and not the last cell).
Indeed, the last cell might be to big to be displayed and scroll to it
might scroll to its top.
This fixes the following bug: input 1/2/3/4/5/6/7/8, OK, up, down. We
did not scroll to the bottom of the table.