Commit Graph

4484 Commits

Author SHA1 Message Date
Léa Saviot
e828491171 [apps/probability] Test on finite integral computations 2020-03-16 11:40:40 +01:00
Léa Saviot
29b4c75227 [apps/probability] Assert discrete distributions override evaluation 2020-03-16 11:40:40 +01:00
Léa Saviot
5c70fdc7a6 [apps/probability] Handle a == b case in finite integral computation
For non continuous distributions, P(a <= X <= a) is not necessarily
null.
2020-03-16 11:40:40 +01:00
Léa Saviot
8168a125e6 [apps/statistics] Remove unused variable in HistogramView
It is unused as HistogramView now inherits Shared::HorizontallyLabeledCurveView
2020-03-11 13:58:41 +01:00
Léa Saviot
702772a7c9 [apps/reg] Store::m_seriesChecksum is Snapshot::m_prevModelsVersions
Share these objects instead of duplicating them
2020-03-11 11:43:36 +01:00
Léa Saviot
53705fb333 [apps/graph_ctrlr] Reload range if no previous model is present
We memoize the checksum of the x first models, and we check that one of
these models is still present when the graph view appears. If so, we do
not reload the range, other wise we reload it.

Scenario:
f(t) = [t^2  t+1] in parametric
Display the graph
f(x) = 1 on ]-inf;0]
g(x) = 2 on [0;inf[
Display the graph -> the range did not change
2020-03-11 11:43:36 +01:00
Léa Saviot
aab8974934 [apps] Memoize five model checksums 2020-03-11 11:43:36 +01:00
Romain Goyet
2bf83c43a8 [apps/shared] Factorize CurveView::label
There was a lot of code duplication.
I removed the initialization of xLabel{} and yLabels{} because those are
scratch buffers that shouldn't be accessed before being written to
anyway.
2020-03-11 09:51:33 +01:00
Ruben Dashyan
1ca902c129 [apps/shared/round_cursor_view] Comment about markRectAsDirty 2020-03-10 11:11:57 +01:00
Ruben Dashyan
8337e36f46 [apps/shared/*_cursor_view] CursorView inherits from TransparentView
so that CursorView tells its superview to redrawn in the background,
except the RoundCursorView.
2020-03-10 11:11:57 +01:00
Ruben Dashyan
afb1d18d65 [apps/shared/sum_graph_controller] Factor constexpr 2020-03-10 10:33:30 +01:00
Ruben Dashyan
f0ef84b3bc [apps/shared/sum_graph_controller] In LegendView::setSumLayout, factor Layout building 2020-03-10 10:33:30 +01:00
Ruben Dashyan
55bb3f677a [apps/shared/sum_graph_controller] In LegendView::setSumLayout, simplify equal sign 2020-03-10 10:33:30 +01:00
Ruben Dashyan
0a92579571 [apps/shared/sum_graph_controller] Fix variable type 2020-03-10 10:33:30 +01:00
Ruben Dashyan
04794dd26f [apps/shared/sum_graph_controller] Uniformize number of significant digits 2020-03-10 10:33:30 +01:00
Ruben Dashyan
7ee8c31c70 [apps/shared/sum_graph_controller] In LegendView::setSumLayout, factor sum symbol layout 2020-03-10 10:33:30 +01:00
Ruben Dashyan
24fa8b28a9 [apps/shared/sum_graph_controller] In LegendView::setSumLayout, factor m_sum.setAlignment 2020-03-10 10:33:30 +01:00
Ruben Dashyan
6b527d3b00 [apps/shared/sum_graph_controller] Rename setSumSymbol to setSumLayout 2020-03-10 10:33:30 +01:00
Ruben Dashyan
e1624c79aa [apps/shared/sum_graph_controller] Class doesn't need to hold m_sumLayout 2020-03-10 10:33:30 +01:00
Ruben Dashyan
7a633b1e75 [apps/sequence/sequence] SequenceModel's name method need not be virtual 2020-03-10 10:33:30 +01:00
Ruben Dashyan
fccd72b757 [apps/sequence/sequence] Do not memoize nameLayout
Fixes the following bug:
In the graph tab of the Sequence app, compute the sum of the terms of
a sequence from 1 to 9 and then from 1 to 10. The Layout is memoized
after the first time and mispositioned the second time since it is
not recomputed.
2020-03-10 10:33:30 +01:00
Léa Saviot
4f76e4418f [apps/console_edit_cell] Fix input result copying 2020-03-02 17:24:54 +01:00
Neven Sajko
aae5e49c01 Remove useless uses of const for return types
An integer or float value can not be assigned to, so there is no point
in qualifying it as const.
2020-03-02 09:48:23 +01:00
Léa Saviot
f12c53b3f2 [apps/code] printText should not be asynchronous in emscripten
Otherwise, we need to put in the whitelist all methods that might call
printText, which are a lot.
2020-02-27 11:32:26 +01:00
Ruben Dashyan
bdb29b9bf9 [apps/regression/graph_controller] Remove setRoundCrossCursorView's parameter
Get it directly from model
2020-02-26 09:50:43 +01:00
Ruben Dashyan
b8b6e4b5b8 [apps/regression/graph_controller] Update model before setting cursor view 2020-02-26 09:50:43 +01:00
Ruben Dashyan
4f279f15da [apps/regression/graph_controller] Inline selectRegressionCurve in header 2020-02-26 09:50:43 +01:00
Ruben Dashyan
436b934f76 [apps/regression/graph_controller] selectRegressionCurve does not update the cursor view
selectRegressionCurve is only called from GoToParameterController and is
part of the GraphController's API for updating the model. It should not
update the view. viewWillAppear does.
2020-02-26 09:50:43 +01:00
Ruben Dashyan
7e6a601af0 [apps/regression/graph_controller] Inline selectRegressionCurve in moveCursorVertically
In the graph controller, selectRegressionCurve is only called at one
place (in moveCursorVertically). In general, setRoundCrossCursorView is
called and *m_selectedDotIndex is updated. There is no reason at all to
do things differently.

Though selectRegressionCurve is called from GoToParameterController.
2020-02-26 09:50:43 +01:00
Ruben Dashyan
d13c243876 [apps/regression/graph_controller] Simplify viewWillAppear 2020-02-26 09:50:43 +01:00
Ruben Dashyan
7b00072ccf [apps/regression/graph_controller] Factor m_roundCursorView.setColor in setRoundCrossCursorView 2020-02-26 09:50:43 +01:00
Émilie Feral
38d02663b4 [build] epsilon_src & epsilon_official_src have to be defined because
they're used by target.simulator.web.mak
2020-02-25 17:37:29 -05:00
Léa Saviot
02e79ad595 [apps/code] Do not refresh the print if the sandbox is displayed
Otherwise the first responder becomes the console edit line, and events
(such as Toolbox) are not intercepted by the sandbox anymore.
2020-02-25 15:31:25 +01:00
Léa Saviot
22afe4df2d [apps/statistics] EXE should open the histogram param controller
The OK button already does it.
2020-02-25 15:15:03 +01:00
Léa Saviot
e5a2208b27 [apps/interactive_curve_view_range] Recompute yRange after setDefault
Scenario : f(x)=8x, scroll to the right until the window range has
changed, then set the preadjustment to default -> the x change had no
impact on the yRange because we did not set the yAuto before doing the
changes.
2020-02-25 15:07:16 +01:00
Léa Saviot
c8537df3b4 [apps/calc] Do not forget to call parent method
Scenario: Open several times the additional outputs menu, there are
drawing problems (multiple stack headers)
2020-02-21 17:04:19 +01:00
Léa Saviot
686e25ec43 [apps/variable_box_controller] Fix expressionLayoutForRecord 2020-02-21 17:03:56 +01:00
Léa Saviot
0a3ce4cade [apps/settings_message_tree] Remove .cpp file 2020-02-21 16:03:07 +01:00
Léa Saviot
750f655b2f [apps] Move SettingsMessageTree in Shared
It is needed in exam_mode_configuration. This way, we can build one app
only
2020-02-21 16:03:07 +01:00
Neven Sajko
f5e53e03e3 [apps/code] Deduplicate definitions of pi and e
Merge the language-specific definitions of these mathematical constants
into one definition. Note that the definitions were in fact inconsistent
across languages.
2020-02-21 15:36:21 +01:00
Léa Saviot
9bc0776a6a [apps/code] Allow interruption of infinite print loops
while (True):
  print("hello")
is now interruptible when the user presses Back
2020-02-20 10:59:01 +01:00
Émilie Feral
c3d8e09ceb [apps/calculation] Calculation: invalid heights memoization when forcing the
display output
2020-02-20 10:56:11 +01:00
Émilie Feral
a2a47bb8ae [apps/calculation] Additional outputs: dismiss the pop-up before doing
any Poincare computations to optimize the available space in the
Poincare pool
2020-02-20 10:56:11 +01:00
Émilie Feral
99e88df284 [apps/calculation] Additional outputs: Clean cells when the pop-up
disappears to avoid uselessly overloading the Poincare pool
2020-02-20 10:56:11 +01:00
Émilie Feral
94daf465c4 [escher][apps/calculation] Improve ScrollView::scrollToContentRect to
scroll "smartly" when scrolling to a too-big-to-be-displayed rect

This fixes calculation history navigation on big cells (that are bigger
than the displayed table)
2020-02-20 10:56:11 +01:00
Émilie Feral
24d9f37205 [apps/calculation] Clean how cell subtype is selected/
This fixes crashes: indeed, in the way it was done before, we called
scrollToSubviewOfTypeOfCellAtLocation after setting the new selected subtype
and before reloading the data. However, selecting a new subtype might expand
the selected cell which can temper with the cell repartition. If so, we need to
reload the data to be able to call 'selectedCell' for instance.
2020-02-20 10:56:11 +01:00
Léa Saviot
cf37e5c45a [apps/code] Fix input(), that did not return the input 2020-02-20 10:52:19 +01:00
Léa Saviot
f7c38979a1 [apps/var_box] Create dummy layout when the real layout makes pool error 2020-02-20 10:44:19 +01:00
Léa Saviot
52ae25a04c [apps] Use willExitApp parameter in dismissModalViewController
This prevents relayouting and thus accessing to expressions/ayotus
possibly deleted by a pool exception
2020-02-20 10:44:19 +01:00
Émilie Feral
2a03583fe0 [apps/calculation] Reset history cell memoization when reloading the
table. Otherwise, the Poincare pool store useless layouts for cells that
aren't displayed.

This fixes the following issue: input "(transpose([1 2 3 4 5 6][1 2 3 4 5
6])^8", the computation works, clear the history, input the same
calculation again, it fails with a memory error.
2020-02-19 10:34:28 +01:00