Switch to using the built-in data files by default, and extending them
with teh configuration file.
The `ShowBuiltinConstants`, `ShowBuiltinCharacters` and
`ShowBuiltinUnits` are not on by default. The size of the
corresponding `config/*.csv` files are reduced to a really simple
example.
Fixes: #1052
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
Some constant values from the HP50G advanced reference manual do not match the
latest data from CODATA.
Fixes: #1045
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
In order to better match the unit layout on the HP50, rename the `Eng`
menu to `Elec`, and move `P` and `St` units to the `Visc` menu.
Fixes: #960
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
Add operations on algebra variables and configuration to `AlgebraMenu`
Also add the corresponding characters to the menus for testing purpose
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
Add support for mathematical characters, to be able to parse things
like `ℝ→ℂ` or `sin⁻¹`.
Fixes: #908
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
The `Boxes` menu is a replication of the `Blocks` menu.
Replace it with a `Music` menu.
Add four missing music glyphs to the font.
Also add the reference file for `chars-menu.png`, which was missing.
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
Add the characters used as a prefix for constants, equations and
library items in the RPL menu, which required some reorganization.
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
Add tests for all character menu as loaded from characters.csv.
Add tests for the character catalog feature.
Also fix the reading of the quote character from the file.
We want to be able to have adjusted (short) labels, yet get a
full-precision value, so base the lookup on the name of the constant
instead of its value.
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
There was a prefix in the editor in the first iteration of the
implementation for constants. This was actually a good idea, since it
lets us distinguish if you really want a constant or a normal symbol.
One of the main benefits is that there is no namespace clash. For
example, you can again use the `g` name, since the g constant will
actually be (cst) g. This was breaking the part in the Demo that used
`g` as a value for the level of green.
Visually, added three characters that show as (cst), (eq) and (lib) in
the text editor, in order to know what kind of name we are dealing
with.
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
These are two catalogs that behave much like the constants catalog,
and inherit most of the code.
The equations library is intended to store standard equations.
The library is for standard objects and various useful objects or
programs.
Both can be organized by topics.
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
Instead of identifying a constant using a name, use an index in the
constants list, which takes less space and is more efficient at
runtime.
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
Add character catalog when inside text.
Define character menus with various languages and shapes.
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
Organize the Greek characters menu so that uppercase letters are
shifted and diacritical show up above in the same menu page.
Also add some missing glyphs in Greek font.
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
Add support for the `InfinityValue` (-22) flag, described in the
HP50G as the "Infinite result exception" flag.
When the flag is set, infinite results are returned either as symbolic
constant infinity `∞` or as its value, currently defined as
`9.99999E999999`.
Whether the infinity value is returned symbolically or numerially
depends on the `NumericalConstants` (-2) and `NumericalResults` (-3)
flags.
Fixes: #835
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
Dynamic constants menu, similar to units menu, which is populated
either from an internal table, or from `config/constants.csv`
Fixes: #497
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
Add the `dms` unit to angles menu, with value "one degree" so that we
can convert between DMS and decimal degrees using the normal units
menu.
Fixes: #818
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
After the introduction of `_dms` and the parsing of degrees symbols in
numbers, degrees could not be parsed correctly as a unit.
Fixes: #809Fixes: #810
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
The units file can contain a section beginning with `"=Cycle"`, which
specifies how `Cycle` should convert specific units. For example:
```
"=Cycle"
"in", "mm",
"mm", "cm"
"cm", "in"
"USD", "EUR"
"EUR", "CHF"
"CHF", "USD"
```
This enables quick unit conversions with a single key.
Fixes: #534
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
This implementation does not require to allocate > 5K of memory
for the default units menu.
The new approach is to load the units from the file every time. Some
initial timing on the DM42 showed that it took about 80ms to parse the
file.
Fixes: #544
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>