Commit Graph

149 Commits

Author SHA1 Message Date
Hugo Saint-Vignes
e09bd0a18c [poincare] Factorize reduce and removeUnit methods 2020-12-22 17:32:40 +01:00
Hugo Saint-Vignes
6ba88921b9 [apps/calculation] Add Unknown NullStatus Todo
Change-Id: Ic67eca0b95350c72167057c40f18ae969793ef18
2020-11-04 15:58:34 +01:00
Hugo Saint-Vignes
4a3f749cc6 [poincare] Add NullStatus for expressions
Change-Id: Ibaba72e3e3589ba259c7b22d402e2b27937f27c1
2020-11-04 15:58:34 +01:00
Hugo Saint-Vignes
98499f6c9f [poincare] Rename isRationalZero to isNumberZero
Change-Id: I554dd5e9b9ab3af4364ca23cde590f9e0a458ef8
2020-11-04 15:58:33 +01:00
Gabriel Ozouf
4ba0603e0c [apps/calculation] Duplicate additional result
Fix duplicate additional results on units by comparing serialization.

Change-Id: Ia360ae7846716a801253b60fcf000240834528bc
2020-11-04 15:33:01 +01:00
Gabriel Ozouf
52dcd8e749 [poincare/unit] Restructure Unit
1. Information about a unit's dimension now uses inheritance.
   _m is an instance of DistanceAlias, which is derived from Alias.
   A UnitNode now keeps a pointer to an Alias and one to a Prefix.
   All aliases are still defined as constexpr.
   This cleans up a lot of the code used namely for computing the
   additional outputs in Calculation.

2. Instead of being defined with a string, each unit is described by its
   ratio with the base SI unit (ex: _L is 0.001 instead of "0.001_m^3").
   This greatly speeds up the calculations using units, as the algorithm
   to find the best unit used to parse the definition.

Change-Id: I4d6ed6ad4cb967026a3f01a335aec270066e2b9f
2020-11-04 15:11:45 +01:00
Gabriel Ozouf
fad375c11c [poincare] Add unitFormat to ReductionContext
Change-Id: I1d3fcd2f47c973c041e1be84e9a902dd58de3562
2020-11-04 15:11:44 +01:00
Gabriel Ozouf
6c676782aa [apps/calculation] New additional results on units
The additional results on units now include conversions into both unit
systems (metric and imperial).

Change-Id: Ie0f12eb3735e775560b66c2cbd78bc9a659145bb
2020-11-04 15:11:44 +01:00
Hugo Saint-Vignes
d027d99597 [apps/calculation] Reset highlighted cells in additional results
Change-Id: I517e7d3dd025413f405fed605631dad830540e76
2020-11-04 15:07:20 +01:00
Hugo Saint-Vignes
e27c668c40 [apps,escher,kandinsky,poincare,python] Replace every "grey" with "gray"
Change-Id: I60a232849dce90f70e6977b6024d6e9b1ce1b731
2020-11-04 15:07:20 +01:00
Hugo Saint-Vignes
4331686818 [apps/toolbox] Update toolbox and additional result text for matrices
Change-Id: I59e1561dcb97c75e57f0c24cfe1953ff594daf92
2020-11-04 15:07:20 +01:00
Hugo Saint-Vignes
3bfc0c83d8 [poincare] Factorize Echelon Form classes
Change-Id: I7ec7290a4d94b9bd1224ad4c53be8b4662bd32d5
2020-11-04 15:07:20 +01:00
Hugo Saint-Vignes
f00c135b69 [apps/calculation] Add additional outputs for matrix
Change-Id: Ia4b285eb0f28eaed838d32a1fdfb785d13664f65
2020-11-04 15:07:20 +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
É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
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
Émilie Feral
a26dc4be79 [apps/calculation/additional_outputs] Expression::removeUnit can be
called on reduced expression only
2020-06-11 12:02:48 +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
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
Émilie Feral
0d0a37c02a [apps/calculation] additional_outputs: improve unit_list_controller to
compute all expressions before being displayed
2020-06-04 14:50:03 +02:00
Émilie Feral
785d7a0a62 [apps] additional_outputs: misc. clean-up on unit additional results 2020-06-04 14:50:03 +02:00
Émilie Feral
1a9014645c [apps] additional_outputs: fill unit additional results 2020-06-04 14:50:03 +02:00
Ruben Dashyan
266482ef99 [apps/calculation] Additional outputs for Unit 2020-06-04 14:50:01 +02:00
Ruben Dashyan
8365735f98 [apps/calculation/additional_outputs/expression_list_controller] Computed Layouts must not be uninitialized 2020-06-04 14:50:01 +02:00
Ruben Dashyan
63ab8710b9 [apps/calculation] Factor EditExpressionController::insertTextBody 2020-06-04 14:50:01 +02:00
Ruben Dashyan
145381ad4b [apps/calculation/additional_outputs] Remove parentResponder parameter from ListControllers' constructor
which was always set to nullptr
2020-06-04 14:50:01 +02:00
Léa Saviot
93d687abc2 [apps/calculation] Fix height computation in additional results 2020-06-04 05:47:55 -07:00
Léa Saviot
a56a73b0ba [apps/calculation] Fix calculation height computation
It was done in two places before, which created inconsistencies
2020-05-28 04:44:27 -07:00
Léa Saviot
11c39b6206 [apps/calculation] Calculation::height has two types of margin arguments
One for the margin between layouts and on top / at the bottom of the
cell, the other for the margin surrounding each layout.
2020-05-28 04:44:27 -07:00
Léa Saviot
78cac6ddae [apps/calculation] Calculation::height has CanBeSingleLine argument 2020-05-28 04:44:27 -07:00
Léa Saviot
525290427a [apps/calculation] Calculation::height takes verticalMargin argument 2020-05-28 04:44:27 -07:00
Neven Sajko
dd6a729f65 Better usage of some floating point constants 2020-04-09 13:58:56 +02:00
Neven Sajko
c92b770112 Performance fixes relating to floating point constants
This replaces unnecessary double-precision soft-float operations with
single-precision floating-point operations, mainly by casting.

In a couple places I also replace a function call with a constant.
2020-04-09 13:58:56 +02:00
Émilie Feral
068325d151 Coding style: remove unecessary 'virtual' keyword when 'override' is
present 2/2
2020-04-09 11:36:51 +02:00
Émilie Feral
e6516ae0e7 [apps/calculation] Fix typo 2020-04-03 10:39:05 +02:00
Émilie Feral
bc8dc0c59c [apps] Use drawSegment when drawing lines instead of drawCurve or
drawCartesianCurve
2020-04-01 10:18:08 +02:00
Émilie Feral
aaf71328ba [apps/shared] CurveView: resolve name conflict -
drawHorizontalOrVerticalSegment & drawSegment -
2020-04-01 10:18:08 +02: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
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
É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