Commit Graph

634 Commits

Author SHA1 Message Date
Quentin Guidée
1039b22260 Symbolic computation 2020-02-13 20:07:38 +01:00
Quentin Guidée
9212b24626 Fixed some errors with E13 2020-02-12 19:52:24 +01:00
Quentin Guidée
31cdd5bcc8 Fixed some conflicts 2020-02-12 18:24:13 +01:00
Quentin Guidée
ab8f731515 Fixed some conflicts 2020-02-12 17:42:58 +01:00
Émilie Feral
e17ae9024e [apps] Gather all code regarding exam mode in ExamModeCOnfiguration file 2020-02-12 15:13:26 +01:00
Ruben Dashyan
81d755927c [apps/calculation/calculation] Fix array length computation 2020-02-12 15:13:25 +01:00
Ruben Dashyan
2ae435a628 [apps/calculation/calculation] Remove redundancy
When each Calculation had its own text buffer, the Expression of an
overflowing output text was Undefined. Hence that Expression could have
been Undefined without the corresponding text being 'undef'. That situation
may not happen anymore since Calculation are stored in a shared buffer.
2020-02-12 15:13:24 +01:00
Ruben Dashyan
1393e5e973 [apps/calculation/calculation] Rearrange the conditions forcing DisplayOutput::ApproximateOnly 2020-02-12 15:13:24 +01:00
Ruben Dashyan
46a5a7cf5c [apps/calculation/calculation] Force DisplayOutput::ApproximateOnly when there is Unit
The most common case where only the approximate output is displayed
happens when the exact and the approximate outputs are equal, more
precisely when the exact output is equal to the approximate output with
the number of significant digits taken from user settings. That
clarification matters for the Poincare::Integers which have more digits than
the number of significant digits set by the user.

Besides, an Expression containing Units is simplified as
Multiplication(Float, Unit...) recorded identically into the exact and
the approximate outputs (except perhaps the number of significant
digits). Generally, the case where the number of digits in the output is
smaller or equal to the user setting would be matched by the condition,
stated above, that exact and approximate output are equal. But that
should also be the case whatever the number of significant digits. That
is why the presence of Units is matched specifically.
2020-02-12 15:13:24 +01:00
Léa Saviot
424ee9fa15 [poincare] Add SymbolicComputation parameter to the reduction context
This way, in solver, we can reduce expression without expanding symbols
2020-02-12 15:13:24 +01:00
Émilie Feral
bbb9e83703 [apps/calculation] Fix and add tests 2020-02-12 15:13:23 +01:00
Émilie Feral
551e4998f4 [apps/calculation][apps/solver][poincare] Simplify sign =/≈ computation
between outputs in Calculation/Solver
2020-02-12 15:13:23 +01:00
Émilie Feral
c2540a1d8a [apps/calculation] Calculations now hold 4 texts: input, exact output
and 2 approximate outputs - one with the maximal number of significant
digits and one with the number of significant digits asked by the user.
This enables to find the approximate output without going through the
approximation routine again.
2020-02-12 15:13:23 +01:00
Ruben Dashyan
c4f112e5aa [apps/calculation/calculation] Do not approximate approximateOutput again 2020-02-12 15:13:23 +01:00
Émilie Feral
a82ff2b703 [apps/calculation] HistoryController: in historyViewCellDidChangeSelection,
limit the whole table reloading to cases where the cell height did
actually change to avoid useless blinking
2020-02-12 15:13:22 +01:00
Émilie Feral
71de56f87a [apps/calculation] HistoryViewCell: fix setHighlighted to reload
subviews highlight
2020-02-12 15:13:22 +01:00
Émilie Feral
b39b8da036 [apps/calculation] HistoryViewCell: prevent from selecting ellipsis
suview if it not visible
2020-02-12 15:13:22 +01:00
Émilie Feral
a39ca58470 [apps/calculation] HistoryViewCell: fix first responder. The first
responder is the HistoryViewCell when the ellipsis subview is selected
2020-02-12 15:13:22 +01:00
Émilie Feral
767d1654cc [apps/calculation] HistoryViewCell: select the right expression of
output when coming from ellipsis subview
2020-02-12 15:13:22 +01:00
Émilie Feral
39dbb7d68c [apps/calculation] Fix relayouting when highlighted cell changed
This fixes the following scenario: add "1.2" 5 times, go up three times,
and down three times, the last cell was not correctly relayout.
2020-02-12 15:13:22 +01:00
Émilie Feral
bbe39aac14 [apps/calculation] HistoryController: display additional results pop-up
when handling OK/exe on the ellipsis view
2020-02-12 15:13:22 +01:00
Émilie Feral
7d0a1cd0b2 [apps/calculation] HistoryViewCell: enable selecting the ellipsis 2020-02-12 15:13:22 +01:00
Émilie Feral
9a97fc01b2 [apps/calculation] HistoryViewCell: m_expandedCalculation memoizes true
only when the calculation is actually expanded (when the output is
selected and the display output is ExactApproximateToggle)

This avoid blinking when changing input/output selection
2020-02-12 15:13:22 +01:00
Émilie Feral
f276a88e79 [apps/calculation] HistoryViewCell: display ellipsis view when
highlighted
2020-02-12 15:13:22 +01:00
Émilie Feral
251db5b60e [apps/shared][apps/calculation] Change class names:
ScrollableInputExactApproximateExpressionsCell -->
ScrollableThreeExpressionsCell
AbstractScrollableExactApproximateExpressionsView -->
AbstractScrollableMultipleExpressionsView
ScrollableExactApproximateExpressionsView -->
ScrollableTwoExpressionsView
ScrollableInputExactApproximateExpressionsView -->
ScrollableTwoExpressionsCell
2020-02-12 15:13:22 +01:00
Émilie Feral
87e4836196 [apps/calculation][apps/shared]
AbstractScrollableExactApproximateExpressionsView children classes
reload scroll after reloading the subview selection when entering the
responder chain and when cell becomes first responder. We don't reload
scroll when setting content of cells as this is done every time we
relayout - when scrolling in the table for instance.
2020-02-12 15:13:22 +01:00
Émilie Feral
56319ef275 [apps/shared] AbstractScrollableExactApproximateExpressionsView can hold up to
three expressions but no more BurgerMenuView.
ScrollableExactApproximateExpressionsView and
ScrollableInputExactApproximateExpressionsView inherit from it.
2020-02-12 15:13:22 +01:00
Émilie Feral
3de0ee7f98 [apps/calculation] ExpressionWithEqualSignView inherits from
ExpressionView instead of composing

This is useful for future change on
ScrollableExactApproximateExpressionView
2020-02-12 15:13:22 +01:00
Léa Saviot
88ab0e686c [apps] Less operations in willExitResponderChain if exiting app
If nextFirstResponder is nullptr, it means we are exiting the app, so
there is no need to relayout, reselect, ...
We did it bbefore because a long time ago, we used to keep all apps side
by side so they had to be thouroughly cleaned when exiting
2020-02-12 15:13:22 +01:00
Émilie Feral
c629cb66ba [apps/calculation] Calculation: don't memoize the display in height
computation. It has to be updated everytime an exception is raised and
this was forgotten.
2020-02-12 15:13:22 +01:00
Émilie Feral
8deb81b8c2 [apps/calculation] CalculationStore: Equal and Store node are always at
the root, no need to recursively check their presence
2020-02-12 15:13:22 +01:00
Émilie Feral
0c19b54365 [apps/calculation] Do not display additional results for Equal or Store
expressions
2020-02-12 15:13:22 +01:00
Émilie Feral
2a37fa4447 [apps/calculation] ComplexListController: change the way the
Complex model parameters are computed.

Sometimes, approximation without simplification doesn't not give the
same results as approximation after simplification. As we decided to
display the additional results from an approximation without
simplifcation (done in Expression::hasDefinedComplexApproximation), we
compute the model parameters the same way (to ensure that both
parameters are defined)
2020-02-12 15:13:21 +01:00
Émilie Feral
8d7eebbf0e [apps/calculation] Calculation: fix variable confusion 2020-02-12 15:13:21 +01:00
Léa Saviot
756eeeb2d8 [poincare/parser] Add context 2020-02-12 15:13:21 +01:00
Émilie Feral
d61336936e [apps/shared] Create a class Dots to share dots masks between CurveView
and RoundCursorView. Use the same dot for illustrations of additional
results in Calculation app and Function app
2020-02-12 15:13:21 +01:00
Émilie Feral
ba159de21d [apps/calculation] Trigonometry additional results are displayed if the
input OR the output is a cosine/sine
2020-02-12 15:13:21 +01:00
Émilie Feral
3fa4e0838a [escher] Create a class Bordered instead of BorderedCell: this enable
non-cell view to use it as well
2020-02-12 15:13:21 +01:00
Émilie Feral
398b529811 [apps/calculation][poincare] AdditionalInformationType is determined
from both input and output expressions of a Calculation
2020-02-12 15:13:21 +01:00
Émilie Feral
be6f11208f [apps/calculation] additional_outputs: make a parent class to
TrigonometryGraphCell and ComplexGraphCell inheriting from
BorderedCell
2020-02-12 15:13:21 +01:00
Émilie Feral
404c0945f9 [apps/calculation] additional_outputs: ComplexGraphView: simplify
computation of ellipsis equation (avoid computational errors for real =
-6 and imaginary = 1E-8 for instance)
2020-02-12 15:13:21 +01:00
Émilie Feral
06fa3bba5b [apps/shared][apps/calculation] CurveView: enable to personalize the
maximal glyph length of graduation labels. Shorten them in
ComplexGraphView
2020-02-12 15:13:21 +01:00
Léa Saviot
97c5ef79af [apps/calc] Display ApproximateOnly if approximate layout cannot be created 2020-02-12 15:13:21 +01:00
Léa Saviot
1af28d4310 [apps/calc] Display ApproximateOnly if exact layout cannot be created 2020-02-12 15:13:21 +01:00
Émilie Feral
8e407bd01e [apps/calculation] additional_outputs: fix assertion which checks that
both real and imaginary are well defined in ComplexGraphView
2020-02-12 15:13:21 +01:00
Émilie Feral
71a968ec05 [apps/calculation] Clean Unicode character treated as a whitespace 2020-02-12 15:13:21 +01:00
Émilie Feral
2b18f585d0 [poincare] additionalInformationType returns "Complex" only when both
real and imaginary parts are defined (not NAN or INFINITY)
2020-02-12 15:13:21 +01:00
Émilie Feral
a4d630ace0 [apps/calculation] additional_outputs: IllustratedListController:
textAtIndex depends on the selected subview
2020-02-12 15:13:21 +01:00
Émilie Feral
9d540ca16c [apps/calculation] additional_outputs: In RationalListController,
special case for textAtIndex of the Euclidean division: copy only the
right part of the equality
2020-02-12 15:13:21 +01:00
Émilie Feral
685f030f83 [apps/calculation] Fix ScrollableInputExactApproximateExpressionCell and
ScrollableExactAppromiateExpressionsCell layout (layout of cells can be
asked at any moment - when handling copy/cut events)
2020-02-12 15:13:21 +01:00