Commit Graph

143 Commits

Author SHA1 Message Date
Gabriel Ozouf
13d1b7077c [apps/shared] Removed method computeYRange
This method of InteractiveCurveViewRangeDelegate was only used to
compute the Y range when Yauto was on.

Change-Id: I9b688a87e16fc58c7d2b00eb071076b98f945df6
2020-11-04 15:58:09 +01:00
Gabriel Ozouf
8970e294aa [apps] Remove modelVersion from curves apps
The graph range used to be reset to default whenever all functions were
modified. As we no longer want to reset the range without the user's
input, we do not need to track whether the functions changed at all.

/!\ As of this commit, there is no longer a way to restore the default
zoom, until a new automatic zoom button is added.

Change-Id: Ie74e8fd61e13055fa6ce2b2d1e883182d4ecffce
2020-11-04 15:58:09 +01:00
Gabriel Ozouf
1a5661fd4c [apps/range_parameter_controller] Remove YAuto
This allows for a great deal of simplifications in the class
RangeParamterController.

Change-Id: I5de55d4e8e1f598eb13b08fb8f042907f55b2fa8
2020-11-04 15:58:08 +01:00
Gabriel Ozouf
5a07db3452 [apps] Remove "Preadjustments" menu for curves
Change-Id: I1a30efd502c5db36325d87fa0f1dffacc37a4f1c
2020-11-04 15:58:08 +01:00
Hugo Saint-Vignes
bd2609bcba [apps/graph] Remove horizontal margins when panning on some graph calculations
Change-Id: I1a28555c5b4f04986b223617ab15110711a74841
2020-11-04 15:07:20 +01:00
Gabriel Ozouf
4007f4d452 [apps] Tweaked panning for better cache alignement
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
2020-11-04 14:45:35 +01:00
Hugo Saint-Vignes
b60c67ff88 [apps] Factorize scrolling speed for long repetition
Change-Id: I5fcfaf04e418942664641c4b1cd044cda7f5aebb
2020-11-04 14:45:34 +01:00
Hugo Saint-Vignes
241a217f58 [apps/graph] Add fast scroll for regression and sequence graph views
Change-Id: I6b36e929234ec5dc161b0eefb20eb84aa360fe3b
2020-11-04 14:45:34 +01:00
Hugo Saint-Vignes
db69f6a6f5 [regression] Implement R2 computation using evaluated values
Change-Id: Iecf8cb84f092c2ec8a9bc17bc0265d7dddaac36c
2020-11-04 14:45:34 +01:00
Léa Saviot
588533fadf [apps/regression] Remove r and r2 for Proportional regression 2020-05-13 15:25:33 +02:00
Léa Saviot
2e5e2a3258 [apps/regression] Rename Affine -> Linear and Linear -> Proportional 2020-05-13 15:25:33 +02:00
Joachim LF
833f6ec778 [Regression] Add affine regression 2020-05-13 15:25:33 +02:00
Romain Goyet
84768472bd Explicit std::min/max template usage
This is unfortunately required in several cases:
 - Sometimes when we use either float and double (this should be changed)
 - Because KDCoordinate is not an int, so any arithmemtic promotes it to
an int
 - Because we mix pointer differences and ints
2020-04-14 09:31:02 -04:00
Romain Goyet
950862f8d0 Use std::min and std::max 2020-04-14 09:31:02 -04:00
Émilie Feral
e1d7b6bb04 [apps] Avoid unsigned/signed comparison: storeChecksumAtIndex takes an
int as parameter
2020-04-07 09:51:39 +02:00
Émilie Feral
886fc98350 [escher] Palette: factorize data color iteration 2020-04-01 10:18:08 +02: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
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
Léa Saviot
e0bbc73b8b [apps/regression] Fix code cleaning 2020-02-12 15:13:17 +01:00
Émilie Feral
3a19939a64 [apps/regression] Missing ; 2020-02-12 15:13:16 +01:00
Ruben Dashyan
89aa0ac302 [apps/regression/graph_controller] Clean moveCursorHorizontally 2020-02-12 15:13:16 +01:00
Léa Saviot
1434158bee [apps/graph] Faster curve navigation after some time
If the user presses the LEft/Right keys for a long time, the cursor will
move faster.
2020-02-12 15:13:15 +01:00
Léa Saviot
19921ec125 [apps/regression/graph] Fix roundCursorView drawing glitch
Scenario:
f(x)=cos(x)
CalculateZeroes -> drawing glitch
Right, Back -> drawing glitch
2019-10-04 09:38:23 +02:00
Léa Saviot
2dee8f2b1f [apps/regression] Fix cursor redrawing when changing cursor type
Scenario:
double x[numberOfPoints] = {0.0, 0.975, 1.97, 2.945, 3.971, 4.887, 5.924, 6.964, 7.979, 8.974, 9.998};
double y[numberOfPoints] = {-23.784, -23.322, -28.322, -18.422, -4.813206, 7.146241, 16.631, 16.632, 9.209189, -6.050863, -19.659};
Quadratic regression, navigate on the points then go on the
regressioncurve -> there is a drawing glitch
2019-09-30 17:05:17 +02:00
Émilie Feral
4d593a6149 [poincare] PrintFloat: take into account the distinction between char
and glyph length in ConvertFloatToText
2019-09-26 11:26:48 +02:00
Léa Saviot
e67160b878 [apps/graph] Faster cursor scrolling on device
This commit is quite dirty but works well
2019-09-09 16:56:32 +02:00
Émilie Feral
0f43a04225 [apps/graph] Implement move cursor vertically on graph with
parametric/polar curves
2019-08-30 17:15:12 +02:00
Léa Saviot
28a721e96e [apps] Start fixing apps as cursor has new member variable 2019-08-29 11:07:22 +02:00
Léa Saviot
0840ca7a1e [apps/poincare] Move NormalDistribution to Poincare 2019-08-23 13:47:52 +02:00
Léa Saviot
c2b4d2b760 [strlcpy] Assertions on len parameter 2019-08-08 17:22:06 +02:00
Léa Saviot
b0b10f184e [poincare/print_float] convertFloatToText -> ConvertFloatToText 2019-08-08 17:22:06 +02:00
Ruben Dashyan
3489a1a644 [apps/regression] The GraphView does not need a pointer to the GraphController anymore 2019-07-19 15:06:25 +02:00
Ruben Dashyan
eb3da7f395 [apps] Substitute "app()->container()" by "AppsContainer::sharedAppsContainer()" 2019-07-19 15:06:25 +02:00
Émilie Feral
0222509850 [regression] GraphController: add missing banner view reload 2019-06-17 15:33:10 -04:00
Léa Saviot
bedc09f9f1 [apps/graph_controller] Clean code 2019-06-14 09:31:46 -04:00
Léa Saviot
3de7e4daab [apps/regression] Fix bannerView
For data
0 0
1 2
2 6
3 12
4 20
5 30
6 42
7 56
and square regression, the coefficient c is not fully displayed
2019-06-14 09:31:46 -04:00
Émilie Feral
a0a93a1287 [regression] GraphController: reinitialize the selected series when
displaying graph if the current selected series has been removed
2019-05-09 16:28:36 +02:00
Ruben Dashyan
3d71397949 [apps/shared] XYBannerView contains a TextField 2019-05-03 15:54:22 +02:00
Ruben Dashyan
5ff19a2506 [apps] Define Font, Text/BackgroundColor BannerView static methods 2019-05-03 15:54:21 +02:00
Ruben Dashyan
4d640e2916 [apps] XYBannerView: prepare constructor so the class may contain TextField 2019-05-03 15:54:21 +02:00
Ruben Dashyan
ba6282be45 [apps/shared] Remove InteractiveCurveViewController::didEnterResponderChain
In order to avoid reloading after Ion::Events::Toolbox/Var, but only in
viewWillAppear.
The previous behavior was masking a bug in
Regression::GraphController::viewWillAppear where the cursor could be
moved after reloading the bannerView.
2019-05-03 15:54:21 +02:00
Ruben Dashyan
94cf542ba3 [apps] Factorize InteractiveCurveViewController::moveCursorVertically 2019-05-03 15:54:21 +02:00