From fc1dace26d41e46ad188473bf2074d5c6e07579a Mon Sep 17 00:00:00 2001 From: Christophe de Dinechin Date: Mon, 29 Jul 2024 00:39:48 +0200 Subject: [PATCH] documentation: Show the correct index for constants and equations For constant and equations menus, match the index in the help file. Fixes: #1039 Fixes: #1048 Signed-off-by: Christophe de Dinechin --- doc/calc-help/constants.md | 12 ++++++------ doc/calc-help/equations.md | 6 ++++++ help/db48x.md | 18 ++++++++++++------ help/db50x.md | 18 ++++++++++++------ src/constants.cc | 16 ++++++++-------- src/equations.cc | 5 ++--- 6 files changed, 46 insertions(+), 29 deletions(-) diff --git a/doc/calc-help/constants.md b/doc/calc-help/constants.md index 4f7faedc..7ec58bb5 100644 --- a/doc/calc-help/constants.md +++ b/doc/calc-help/constants.md @@ -4,7 +4,7 @@ The DB48X calculator features a library of constants covering mathematics, physics, chemistry and computer science. The built-in constants can be extended using the `config/constants.csv` configuration file. -## Mathematical constants +## Mathematics constants ### π constant @@ -345,26 +345,26 @@ logarithmic quantity, most often expressed in decibels dB. I0 is the sound intensity used as a reference, corresponding to 0dB. -## Dates +## Dates Constants -### BastilleDay +### BastilleDay constant French national day -### MartinLutherKingDeath +### MartinLutherKingDeath constant Martin Luther King Jr., an African-American clergyman and civil rights movement leader, was fatally shot at the Lorraine Motel in Memphis, Tennessee, on April 4, 1968, at 6:01 p.m. -### IndependenceDay +### IndependenceDay constant Independence Day, known colloquially as the Fourth of July, is a federal holiday in the United States which commemorates the ratification of the Declaration of Independence by the Second Continental Congress on July 4, 1776, establishing the United States of America. -## Computing-related constants +## Computing constants ### No constant diff --git a/doc/calc-help/equations.md b/doc/calc-help/equations.md index 088bf0fe..c54f37a0 100644 --- a/doc/calc-help/equations.md +++ b/doc/calc-help/equations.md @@ -42,6 +42,12 @@ relative to the loads. * Internal bending moment is positive counterclockwise on the left-hand part. * Shear force is positive downward on the left-hand part. +### Elastic Buckling + +These equations apply to a slender column (`K·L/r>100`) with length factor `K`. + +![Elastic Buckling](img/ElasticBuckling.bmp) + ## Electricity diff --git a/help/db48x.md b/help/db48x.md index 9c83e8d6..1d0068c7 100644 --- a/help/db48x.md +++ b/help/db48x.md @@ -4564,7 +4564,7 @@ The DB48X calculator features a library of constants covering mathematics, physics, chemistry and computer science. The built-in constants can be extended using the `config/constants.csv` configuration file. -## Mathematical constants +## Mathematics constants ### π constant @@ -4905,26 +4905,26 @@ logarithmic quantity, most often expressed in decibels dB. I0 is the sound intensity used as a reference, corresponding to 0dB. -## Dates +## Dates Constants -### BastilleDay +### BastilleDay constant French national day -### MartinLutherKingDeath +### MartinLutherKingDeath constant Martin Luther King Jr., an African-American clergyman and civil rights movement leader, was fatally shot at the Lorraine Motel in Memphis, Tennessee, on April 4, 1968, at 6:01 p.m. -### IndependenceDay +### IndependenceDay constant Independence Day, known colloquially as the Fourth of July, is a federal holiday in the United States which commemorates the ratification of the Declaration of Independence by the Second Continental Congress on July 4, 1776, establishing the United States of America. -## Computing-related constants +## Computing constants ### No constant @@ -4997,6 +4997,12 @@ relative to the loads. * Internal bending moment is positive counterclockwise on the left-hand part. * Shear force is positive downward on the left-hand part. +### Elastic Buckling + +These equations apply to a slender column (`K·L/r>100`) with length factor `K`. + +![Elastic Buckling](img/ElasticBuckling.bmp) + ## Electricity diff --git a/help/db50x.md b/help/db50x.md index 8c7136d3..76079d55 100644 --- a/help/db50x.md +++ b/help/db50x.md @@ -4564,7 +4564,7 @@ The DB50X calculator features a library of constants covering mathematics, physics, chemistry and computer science. The built-in constants can be extended using the `config/constants.csv` configuration file. -## Mathematical constants +## Mathematics constants ### π constant @@ -4905,26 +4905,26 @@ logarithmic quantity, most often expressed in decibels dB. I0 is the sound intensity used as a reference, corresponding to 0dB. -## Dates +## Dates Constants -### BastilleDay +### BastilleDay constant French national day -### MartinLutherKingDeath +### MartinLutherKingDeath constant Martin Luther King Jr., an African-American clergyman and civil rights movement leader, was fatally shot at the Lorraine Motel in Memphis, Tennessee, on April 4, 1968, at 6:01 p.m. -### IndependenceDay +### IndependenceDay constant Independence Day, known colloquially as the Fourth of July, is a federal holiday in the United States which commemorates the ratification of the Declaration of Independence by the Second Continental Congress on July 4, 1776, establishing the United States of America. -## Computing-related constants +## Computing constants ### No constant @@ -4997,6 +4997,12 @@ relative to the loads. * Internal bending moment is positive counterclockwise on the left-hand part. * Shear force is positive downward on the left-hand part. +### Elastic Buckling + +These equations apply to a slender column (`K·L/r>100`) with length factor `K`. + +![Elastic Buckling](img/ElasticBuckling.bmp) + ## Electricity diff --git a/src/constants.cc b/src/constants.cc index b18c66e1..23e1c747 100644 --- a/src/constants.cc +++ b/src/constants.cc @@ -276,7 +276,7 @@ static const cstring basic_constants[] = // ------------------------------------------------------------------------ // MATH CONSTANTS MENU // ------------------------------------------------------------------------ - "Math", nullptr, + "Mathematics", nullptr, "π", "3.14159", // Evaluated specially (decimal-pi.h) "e", "2.71828", // Evaluated specially (decimal-e.h) @@ -289,7 +289,7 @@ static const cstring basic_constants[] = // Chemistry // ------------------------------------------------------------------------ - "Chem", nullptr, + "Chemistry", nullptr, "NA", "6.0221367E23_mol⁻¹", // Avogradro's number "k", "1.380658E-23_J/K", // Boltzmann @@ -303,7 +303,7 @@ static const cstring basic_constants[] = // Physics // ------------------------------------------------------------------------ - "Phys", nullptr, + "Physics", nullptr, "ⅉ", "0+ⅈ1", // Imaginary unit in physics "c", "299792458_m/s", // Speed of light @@ -342,7 +342,7 @@ static const cstring basic_constants[] = // ------------------------------------------------------------------------ // Computing // ------------------------------------------------------------------------ - "Comp", nullptr, + "Computing", nullptr, "No", "False", // No value = false "Yes", "True", // Yes value = true @@ -368,8 +368,8 @@ const constant::config constant::constants = // Define the configuration for the constants // ---------------------------------------------------------------------------- { - .menu_help = "Constants", - .help = "Constant", + .menu_help = " Constants", + .help = " Constant", .prefix = L'Ⓒ', .type = ID_constant, .first_menu = ID_ConstantsMenu00, @@ -610,7 +610,7 @@ utf8 constant::do_instance_help(constant::config_r cfg) const static char buf[64]; size_t len = 0; utf8 base = do_name(cfg, &len); - snprintf(buf, sizeof(buf), "%.*s %s", int(len), base, cfg.help); + snprintf(buf, sizeof(buf), "%.*s%s", int(len), base, cfg.help); return utf8(buf); } @@ -799,7 +799,7 @@ utf8 constant_menu::do_menu_help(constant::config_r cfg, static char buf[64]; size_t len = 0; utf8 base = do_name(cfg, cst->type(), len); - snprintf(buf, sizeof(buf), "%.*s %s", int(len), base, cfg.menu_help); + snprintf(buf, sizeof(buf), "%.*s%s", int(len), base, cfg.menu_help); return utf8(buf); } diff --git a/src/equations.cc b/src/equations.cc index 00437066..2976b525 100644 --- a/src/equations.cc +++ b/src/equations.cc @@ -72,7 +72,6 @@ static const cstring basic_equations[] = "RelativityMassEnergy", "'(E_J)=(m_kg)*Ⓒc^2'", "IdealGas", "'(P_Pa)*(V_m^3)=(n_mol)*ⒸR*(T_K)'" - }; // clang-format on @@ -110,8 +109,8 @@ const equation::config equation::equations = // Define the configuration for the equations // ---------------------------------------------------------------------------- { - .menu_help = "Equations", - .help = "Equation", + .menu_help = "", + .help = "", .prefix = L'Ⓔ', .type = ID_equation, .first_menu = ID_EquationsMenu00,