Commit Graph

1530 Commits

Author SHA1 Message Date
Gabriel Ozouf
8ce9f363ad [interactive_curve_view_range] Force equal axes
Added a tolerance when checking orthonormality, so that ranges that are
nearly orthonormal will be made orthonormal.

Change-Id: Ie3bf076086561e3ff6374e7daa9dd1a884c52d5a
2020-11-04 15:58:19 +01:00
Gabriel Ozouf
190568ea84 [interactive_curve_view_controller] Fix Cursor
Restore the permanence of the cursor between accesses to the graph
window.
The cursor used to be reset when the models had been modified. As there
is no longer a system in place to track these modifications, we manually
check if there is a curve beneath the cursor before reseting it.

Change-Id: I6f71fc17744b5bf1ee552c82126bb4a08b823629
2020-11-04 15:58:19 +01:00
Gabriel Ozouf
6be5e7d62c [apps/shared] Change Zoom API
Moved some code around to decrease redundancy and put more of the logic
into Poincare::Zoom

Change-Id: I4804cf39493ac7f2f0b3c4eb554e5c15c3cef1c9
2020-11-04 15:58:18 +01:00
Gabriel Ozouf
09c061e871 [poincare/zoom] Method RangeFromSingleValue
This method adds margins to a range whose bounds are equal.

Change-Id: I2b2fe26fe431deda112389060d401f738a75b1ae
2020-11-04 15:58:17 +01:00
Gabriel Ozouf
a525c35ebb [poincare/zoom] Factor constants
The mantissas {1, 2, 5} used in CurveViewRange to compute the grid units
can be factored in Zoom.

Change-Id: I2bcc9b9df1ff6b6df82092a5d78ed3db132bf63a
2020-11-04 15:58:17 +01:00
Gabriel Ozouf
43f50b7b2d [interactive_curve_view_range] Missing refresh
The normalized status would not be refreshed after a call to setDefault
triggered by InteractiveCurveViewController::viewWillAppear.

Change-Id: I923ef3ca0585dbcc1f32b992d7dd1f4a3a206532
2020-11-04 15:58:16 +01:00
Gabriel Ozouf
bcb4b3095b [function_graph_controller] Fix Y range expansion
The method FunctionGraphController::yRangeForCursorFirstMove expands the
Y range to include the values of the first cursor moves on the left and
the right of the center. It has been modified to preserve
orthonormality.

Change-Id: I898ab9721e45e2acde261f8b94b80cab81b39a92
2020-11-04 15:58:16 +01:00
Gabriel Ozouf
f54b15b9c8 [interactive_curve_view_range] Preserve ratio
Preserve orthonormality when adding margins to a default range.

Change-Id: Iaa1da8d36812e2dad1be3894198ee0fabcd3020f
2020-11-04 15:58:16 +01:00
Gabriel Ozouf
5d9c7b0c1f [interactive_curve_view_range] isOrthonormal
Change-Id: I154487908d1a2a11e01b2a4e51ef867e235babab
2020-11-04 15:58:15 +01:00
Gabriel Ozouf
29714b401e [shared/function] Create an orthonormal range
When the function does not have any points of interest, fall back to an
orthonormal range.

Change-Id: I90e4bcfae80ebd37f95d404a4a63121c93cf7cff
2020-11-04 15:58:15 +01:00
Gabriel Ozouf
d642339963 [interactive_curve_view_range] Normal ratio
The method NormaRatio returns the screen ratio for an orthonormal
range.

Change-Id: Ib834f9934232866646da16c78447782cdbdc0af2
2020-11-04 15:58:15 +01:00
Gabriel Ozouf
08c96c5107 [poincare/zoom] Method SetToRatio
Added a method to Zoom to set a range to a specific ratio. This method
is used by InteractiveCurveViewRange::normalize.

Change-Id: Id3029439294ece02ea19fb6c6de90b9edc85d771
2020-11-04 15:58:14 +01:00
Gabriel Ozouf
ad6edffc07 [poincare/zoom] Remove tuneXRange argument
The ability to perform a range search without changing the X range was
only there to accomodate the Yauto feature.

Change-Id: I8c2b61b447fbd3dc1f4e303dff06d1a8d6e7a4f2
2020-11-04 15:58:14 +01:00
Gabriel Ozouf
07c52139b9 [apps/shared] InteractiveCurveViewRangeDelegate
Clean up the class by removing some unused methods and structures.

Change-Id: Ife38a9a0ed4bfb84986227d1f57fe3f5d2c4ff2a
2020-11-04 15:58:13 +01:00
Gabriel Ozouf
26754a3230 [graph] Force same grid unit on orthonormal graphs
Change-Id: I2abca9eb1c4a14057323ee97e1044715f89620ff
2020-11-04 15:58:13 +01:00
Gabriel Ozouf
1d4d56a7dd [apps/range_parameter_controller] Change margins
Reduce the top and bottom margin of the table view to better see the
Confirm button.

Change-Id: I71df479400c44a10fe75b8beaae1c81be305cdfd
2020-11-04 15:58:12 +01:00
Gabriel Ozouf
f0cd0694a6 [apps/shared] Activating Auto zoom resets cursor
Change-Id: Ib815286e1316e20f72b31d3d9206aa032b06eff4
2020-11-04 15:58:11 +01:00
Gabriel Ozouf
bf76b56f90 [apps/shared] Change Zoom button in curves
Zoom is now called navigate, and its button is placed before the Axes
button.

Change-Id: Ied194c20438e573a237ce36f221b9be87cfd4bab
2020-11-04 15:58:11 +01:00
Gabriel Ozouf
43d21180bc [apps/shared] Deactivate zoomAuto on pan and zoom
The Auto mode for curve ranges must be deactivated when moving the
cursor outside the screen and when activating navigation (formerly
Zoom).

Change-Id: I281a1d069c2ebcc30e7ead469c4f48438054d7c2
2020-11-04 15:58:11 +01:00
Gabriel Ozouf
5c67f92d18 [apps/interactive_curve_view_controller] Buttons
Add two new buttons to toggle Auto and Normalized modes for curves.

Change-Id: Ib583d087ce5ae779d24f6a8bbc72ab7140752dd5
2020-11-04 15:58:10 +01:00
Gabriel Ozouf
cc22b0d298 [apps/shared] Reset curve range to default in Auto
When the range is set to ZoomAuto, the range is recomputed before
displaying the curve.
2020-11-04 15:58:10 +01:00
Gabriel Ozouf
e2725c8e61 [apps/interactive_curve_view_range] Status markers
Add member variable m_zoomAuto and m_zoomNormalized to remember the
interactive range's status.

Change-Id: I77c43ddd683d3c6011742801139d23f5e20c99fe
2020-11-04 15:58:10 +01:00
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
Gabriel Ozouf
d2b36be846 [poincare/zoom] Move automatic zoom to Poincare
Change-Id: I7a70ab54b33b9150682cc4f999ff4999a8288b7f
2020-11-04 15:58:07 +01:00
Hugo Saint-Vignes
5339d9e7b4 [apps/shared] Add static assert for cache steps
Change-Id: I77498775b4caf3d97522219d2a7c979601b985e8
2020-11-04 15:58:07 +01:00
Hugo Saint-Vignes
4acbf3346b [apps/shared] Add comments and minimize threshold
Change-Id: Ieb56513ea0a7fab35acf15531277aec5cd6071ca
2020-11-04 15:58:03 +01:00
Hugo Saint-Vignes
ebe207d67d [apps/shared] Fix cache overlap when plotting polar curves
Change-Id: I4b1d6dccdedc5b3cea455e2ad2038336b4b48064
2020-11-04 15:55:40 +01:00
Arthur Camouseigt
b567a09103 [VariableBox] Allowing sequences to display their type
Change-Id: I2929f7d9f3a266fbff81100a39f793fe6200da1d
2020-11-04 15:33:05 +01:00
Hugo Saint-Vignes
697f727429 [apps/shared] Add discard confirmation on range parameters
Change-Id: I609acbd136cb0bc84899777810f4c1497832952f
2020-11-04 15:33:05 +01:00
Hugo Saint-Vignes
150a5bfa5a [apps/shared] Add discard confirmation on table intervals
Change-Id: Id152577c570febf06b4d829fd2723c2a30c3ccd9
2020-11-04 15:33:04 +01:00
Hugo Saint-Vignes
bd23135198 [apps/shared] Add Discard confirmation pop-up
Change-Id: Ida3878894090ecfa99145618b8e1ff0bbcb4743a
2020-11-04 15:33:04 +01:00
Arthur Camouseigt
91dc5eb5ec [Sequence Graph] Fixing the banner to display u(n)
The banner used to display u(n+1)/u(n+2) if the sequences were not
explicit. This was incorrect and fixed

Change-Id: I59100942b51f4170d9662a6fd7b82d0f7e50ae6f
2020-11-04 15:33:04 +01:00
Arthur Camouseigt
bf95b460c3 [Sequence] Fixed computation error and asan fails
Change-Id: Ib3a619d29bee5cc6f10b939ee066459a5b135c5d
2020-11-04 15:33:04 +01:00
Arthur Camouseigt
86d0c19293 [ok view] Fixing the grey tone of the ok symbol
Change-Id: Id65a4e37c41e1b675178d3220c15ebfe26b1e71e
2020-11-04 15:33:04 +01:00
Arthur Camouseigt
bf0f6c7a33 [Global Context] Fixed rank approximation error for sequences
Change-Id: I29c0a55956aee8764e50650b229a49aa8a0f9336
2020-11-04 15:33:04 +01:00
Gabriel Ozouf
25ab4b2a52 [shared/localization_controller] Table cropping
Forced the top cell of the country table to be cropped in the middle,
cutting the text, to avoid the cell looking squashed.

Change-Id: I4d126ed19249f47652bd7f2001384b2491cfe6f8
2020-11-04 15:33:03 +01:00
Émilie Feral
64ff5b4c70 [app/shared] CurveView: simplify implementation of
pixelLengthToFloatLength (avoid avoidable overflows)
2020-11-04 15:33:03 +01:00
Émilie Feral
5b4fc6ff84 [apps/shared] CurveView: implement CurveView::pixelLength(Axis) 2020-11-04 15:33:03 +01:00
Émilie Feral
d6751e6e03 [apps/shared] CurveView: improve floatLengthToPixelLength to avoid
useless computations (and potential overflowing)

This fixes the drawing of arrow(100,100,0.1,3) in matplotlib module of
python
2020-11-04 15:33:02 +01:00
Arthur Camouseigt
3019609946 [Sequence] Fixing display issue in sequence graphs
Change-Id: I1b914c31cf2e7a84329e86486e30f3a7244f235d
2020-11-04 15:33:00 +01:00
Gabriel Ozouf
64e7057d50 [apps/on_boarding] Remember language choice
When choosing a language and then pressing back from the country menu to
get back to the language menu, the previously selected language remains
selected.

Change-Id: I018c51cce09d47b15bb4864c135d381a94b2a72f
2020-11-04 15:33:00 +01:00
Arthur Camouseigt
6a84ba2523 [global_context.cpp] Fixing sequence bug
u(n+2) = u(n+1) + u(n) + u(2)
u(0) = 2
u(1) = 2
Crashed because the global context was not checking if the sequence was
badly referencing itself

Change-Id: I97f694955e15518bb088db50deb761d7ee09d75f
2020-11-04 15:33:00 +01:00
Gabriel Ozouf
bd068312d9 [apps/continuous_function_cache] Clear on bad step
Cache did not check that the step was the same before panning, causing
old values to remains cached.
e.g. :
  - Type f(x) = x, and plot it.
  - Go to Axes, and set Xmax = 0.
  - Confirm

Change-Id: Ie8ed10c336cf517a65f19b05bd14866daf8128c2
2020-11-04 15:33:00 +01:00
Arthur Camouseigt
4274b558b6 [Sequences] Changing the name of CacheContext to SequenceCacheContext
Change-Id: If2d542748f6f7b2363d6c1443f88c058475945eb
2020-11-04 15:32:59 +01:00
Arthur Camouseigt
960335c330 [Sequences] Fixed a few crashes
Change-Id: Ib929bbae0f9ca06409706336ff799075e1288694
2020-11-04 15:32:59 +01:00
Gabriel Ozouf
26bbdead7d [apps/shared] Allow movement from undef curve
Fix a bug preventing the cursor from moving to other curves using UP and
DOWN when the y value was undef.
To reproduce :
  - In Graph, define f(x) = 1 and g(x) = ln(x), then draw the curves
  - Press DOWN to select g
  - Press LEFT until g is not defined anymore
--> Pressing UP or DOWN won't allow you to select f

Change-Id: I79ed4a57b78ac0b8dac3f66e722e358bd4be18d9
2020-11-04 15:32:59 +01:00
Hugo Saint-Vignes
c130f8e881 [apps/shared] Prevent KDPoint overlfowed translation on cursorFrame
Change-Id: Ifc32eefaf4241d59d7567cadb9b2962ba5efb4d9
2020-11-04 15:32:59 +01:00