Commit Graph

729 Commits

Author SHA1 Message Date
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
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
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
Hugo Saint-Vignes
0b683b6994 [apps/shared] Handle identical layout in MinimalSizeForOptimalDisplay
Change-Id: I99a523e9e88ea9c3064e4367d96b01edb0020df9
2020-08-11 17:06:07 +02:00
Léa Saviot
b885098963 [apps/calculation] Fix additionalInformationType
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
2020-07-29 10:13:19 +02:00
Émilie Feral
22549d4d50 [apps/calculation] CalculationStore: change name CalculationHeight -->
HeightComputer
2020-07-16 14:37:38 +02:00
Émilie Feral
83ecefda00 [apps/calculation] Fix tests 2020-07-16 14:37:38 +02:00
Émilie Feral
1fb8c09714 [apps/calculation] Remove old TODOs 2020-07-16 14:37:38 +02:00
Émilie Feral
df74c2c551 [apps/calculation] The heights (common and expanded) of calculation cells are
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.
2020-07-16 14:37:38 +02:00
Émilie Feral
c2db00cc88 [apps/calculation] When leaving calculation app, do not invalid
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).
2020-07-16 14:37:38 +02:00
Émilie Feral
c92b3d49e9 [apps/calculation] HistoryController: reload the subview selection when
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.
2020-07-16 09:48:22 +02:00
Charlotte THOMAS
b5f9deb169 Update calculation.cpp
removed white
2020-07-15 10:28:15 +02:00
Charlotte THOMAS
f1dab081e1 Fix: CI test 2020-07-15 10:28:15 +02:00
Charlotte THOMAS
9d8b62894f Fix: Changed "IS" to "SI" because even in english the short for "International System of Units" is "SI" 2020-07-15 10:28:15 +02:00
Léa Saviot
d8f17da04e [apps/calculation] Add TODO comments about factorization 2020-07-07 09:55:20 +02:00
Léa Saviot
cc4ff3d40d [apps/calculation] Apply fix about Height computation
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.
2020-07-07 09:55:20 +02:00
Léa Saviot
982b467268 [apps/calculation] Fix scrolling
If the last cell is too big to fit entirely, we would scroll to the top
of the calculation, instead of the bottom
2020-07-07 09:46:26 +02:00
Léa Saviot
1128134c37 [apps/calculation] Raise exception if row height miscomputed
Scenario:
Put the complex mode to exponential, then go back to Calculation and:
Toolbox, Down, Down, Down, Down, OK, OK, Two, Plus, Imaginary,
Toolbox, Down, Down, Down, Down, OK, Down, OK, Two, Plus,
Imaginary, OK, Toolbox, Down, Down, Down, Down, Down, OK,
Down, OK, Up, OK, Right, Zero, OK, OK, Toolbox, Down,
Down, OK, Toolbox, Back, Up, Zero, Up, OK, Zero, Up, Up, Up
2020-07-07 09:46:26 +02:00
Léa Saviot
924e235ba8 [apps/calculation] Factorize some code 2020-07-06 17:16:22 +02:00
Léa Saviot
35f20c4312 [apps/calculation] Comment possible failed height computation 2020-07-06 16:35:35 +02:00
Gabriel Ozouf
e78c5c02d3 [apps/calculation] Fixed history scroll
Fixed a bug involving mishandled negative offsets in
CalculationSelectableTableView::scrollToSubviewOfTypeOfCellAtLocation
and cleaned up the function.

Change-Id: I4394ca9dc9748e8b761e7f722e41014d71d3373f
2020-06-30 15:41:56 +02:00
Émilie Feral
96c7d84633 [apps/calculation] Factorize code to avoid selecting ellipsis on cell
where ellipsis is not displayed
2020-06-26 17:48:31 +02:00
Émilie Feral
1281a4a508 [apps/calculation] HistoryController: avoid duplicate code when handling
backspace event. Keep the same selected subview.
2020-06-26 17:48:31 +02:00
Émilie Feral
94d3ac9828 [apps/calculation] HistoryController: fix order of actions in Backspace
handle event

This fixes the following bug: input 1/2/3/4/5/6/7/8, OK, OK, input 1,
OK, up, backspace. The selection disappeared.
2020-06-26 17:48:31 +02:00
Émilie Feral
aef804d149 [apps/calculation] HistoryController: avoid 2 calls to
setSelectedSubviewType in tableViewDidChangeSelectionAndDidScroll
2020-06-26 17:48:31 +02:00
Émilie Feral
457fa6a925 [apps/calculation] When EditExpressionController becomes the first
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.
2020-06-26 17:48:31 +02:00
Émilie Feral
9508a89a1b [apps/calculation] Missing inclusion 2020-06-26 10:47:14 +02:00
Émilie Feral
0b74dd005d [apps/calculation] SelectableTableView: fix scrollToSubviewOfTypeOfCellAtLocation
When scrolling, the table layout is likely to change and the selected
cell might not been the same.
2020-06-26 10:45:55 +02:00
Gabriel Ozouf
123d5f9076 [apps/calculation] Fixed tall calculation scroll
When displaying a calculation taller than the screen, the output could
be displayed above the screen.
  - type 1/2/3/4/5/6/7/8/9 (the main fraction between the 1 and 2)
  - press UP to select the output
==> The output is still offscreen.

Change-Id: Ic3ed7664ae693d22486f8b2f9f3a8f2324c3d7c9
2020-06-26 09:50:10 +02:00
Gabriel Ozouf
363bf4a620 [apps/calculation] Fixed ellipsis scrolling
When scrolling to a calculation without additional outputs from a
calculation with additional outputs, the ellipsis, though invisible,
would remain selected.

Change-Id: I7408ae004b9374e432ac58361616fa2ecf1550d8
2020-06-25 18:03:29 +02:00
Émilie Feral
bac2949a5e [escher][apps] SelectableTableViewDelegate: add
tableViewDidChangeSelectionAndDidScroll method and implement it for
Calculation::HistoryController

This fixes the following bug: In the calculation application, input 1,
OK, 1/2/3/4/5/6/7/8, OK, up, up, left, down, up. The selection failed.
2020-06-25 13:48:47 +02:00
Léa Saviot
cf4eaa3d1f [apps/poincare] Use symbolicComputation in recursivelyMatches
This fixes a failed assertion for the scenario:
[3]->x then, in the Equation app, solve x+1->0
2020-06-15 16:20:09 +02:00
Émilie Feral
a26dc4be79 [apps/calculation/additional_outputs] Expression::removeUnit can be
called on reduced expression only
2020-06-11 12:02:48 +02:00
Léa Saviot
84e8ac5bec [apps/calculation/i18n] Fix typo 2020-06-05 15:58:28 +02:00
Émilie Feral
7b150deaeb [apps/calculation] Hide additional outputs for Dutch exam mode 2020-06-04 14:50:10 +02:00
Émilie Feral
90fb9b4ea2 [apps/calculation] Hide calculations involving units in Dutch exam mode 2020-06-04 14:50:10 +02:00
Léa Saviot
8412087cc8 [apps/calculaiton] Fix cursor bug
Scenario:
1 EXE MATRIX MATRIX Down Down 1 Up Up -> it crashed
2020-06-04 14:50:10 +02:00
Émilie Feral
e24de79a9e [apps/calculation] HistoryController: avoid dereferencing nullptr 2020-06-04 14:50:10 +02:00
Émilie Feral
5aaa6723d0 [apps/calculation] Fix duplicate removal in unit additional results
This fixes the following bug: input _ns, go to additional results -->
crash
2020-06-04 14:50:08 +02:00
Émilie Feral
a4c591dea6 [apps/calculation] additional_outputs: fix complex range for infinite
values
2020-06-04 14:50:08 +02:00
Émilie Feral
6a0d65b049 [apps/calculation] additional_outputs: the complex illustration chose
its range to be orthornomal
2020-06-04 14:50:08 +02:00
Émilie Feral
7bb4a2ae98 [apps/calculation] Additional outputs: do not display identical unit as
the outpu
2020-06-04 14:50:07 +02:00
Émilie Feral
05a42cd2eb [apps/shared] PoincareHelpers: implement Reduce static inline function 2020-06-04 14:50:07 +02:00
Émilie Feral
1f9cdc5648 [apps] Calculation: do not offer additional results on units if there
will be only one identical to the output
2020-06-04 14:50:07 +02:00
Émilie Feral
b6ee72bc21 [poincare] Clean tests on Unit 2020-06-04 14:50:07 +02:00
Émilie Feral
5fa50ec79d [poincare] Unit::BuildTimeSplit can split negative time 2020-06-04 14:50:03 +02:00
Émilie Feral
115ae59b5a [apps/calculation] additional_outputs: reorder unit addition outputs 2020-06-04 14:50:03 +02:00
Émilie Feral
73a598e023 [poincare] Unit: enable to tune both the prefix and the Representant or
just the prefix on a given Unit
2020-06-04 14:50:03 +02:00
Émilie Feral
e063c0a913 [apps/calculation] additional_outputs: add electronVolt row to
additional results on energy units
2020-06-04 14:50:03 +02:00