New deduced units and FPS system documentation added

This commit is contained in:
Mateusz Pusz
2020-06-16 19:36:49 +02:00
parent fb3ab79401
commit a8508f124c
20 changed files with 115 additions and 3 deletions

View File

@@ -86,12 +86,13 @@ add_custom_command(OUTPUT "${SPHINX_INDEX_FILE}"
"${CMAKE_CURRENT_SOURCE_DIR}/examples/capacitor_time_curve.rst"
"${CMAKE_CURRENT_SOURCE_DIR}/examples/clcpp_response.rst"
"${CMAKE_CURRENT_SOURCE_DIR}/examples/conversion_factor.rst"
"${CMAKE_CURRENT_SOURCE_DIR}/examples/foot_pound_second.rst"
"${CMAKE_CURRENT_SOURCE_DIR}/examples/hello_units.rst"
"${CMAKE_CURRENT_SOURCE_DIR}/examples/kalman_filter-alpha_beta_filter_example2.rst"
"${CMAKE_CURRENT_SOURCE_DIR}/examples/linear_algebra.rst"
"${CMAKE_CURRENT_SOURCE_DIR}/examples/measurement.rst"
"${CMAKE_CURRENT_SOURCE_DIR}/examples/total_energy.rst"
"${CMAKE_CURRENT_SOURCE_DIR}/faq.rst"
"${CMAKE_CURRENT_SOURCE_DIR}/framework.rst"
@@ -151,6 +152,21 @@ add_custom_command(OUTPUT "${SPHINX_INDEX_FILE}"
"${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/dimensions_and_concepts.rst"
"${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/fps.rst"
"${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/fps/length.rst"
"${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/fps/acceleration.rst"
"${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/fps/area.rst"
"${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/fps/density.rst"
"${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/fps/energy.rst"
"${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/fps/force.rst"
"${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/fps/length.rst"
"${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/fps/mass.rst"
"${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/fps/power.rst"
"${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/fps/pressure.rst"
"${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/fps/speed.rst"
"${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/fps/time.rst"
"${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/fps/volume.rst"
"${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/iau.rst"
"${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/iau/length.rst"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 74 KiB

View File

@@ -10,6 +10,7 @@ Examples
examples/unknown_dimension
examples/measurement
examples/linear_algebra
examples/foot_pound_second
examples/capacitor_time_curve
examples/clcpp_response

View File

@@ -0,0 +1,7 @@
foot_pound_second
=================
.. literalinclude:: ../../example/foot_pound_second.cpp
:caption: foot_pound_second.cpp
:start-at: #include
:linenos:

View File

@@ -300,8 +300,21 @@ does not exist at all. With it `si::kilometre_per_hour` can be defined as::
}
Please note that this is the only unit-related class template that takes
a dimension as its parameter. This derived dimension provides a :term:`recipe`
In case the deduced unit should served as a named one we can use ether a
`named_deduced_unit` where the user is able to provide a symbol for the unit
by him/her-self or `noble_deduced_unit` where the symbol is the deduced name
based on the ingredients::
namespace fps {
struct nautical_mile_per_hour : named_deduced_unit<nautical_mile_per_hour, dim_speed,
"knot", no_prefix, nautical_mile, hour>{};
struct foot_pound_force : noble_deduced_unit<foot_pound_force, dim_energy, pound_force, foot> {};
}
Please note that deduced units are the only unit-related class template that
take a dimension as its parameter. This derived dimension provides a :term:`recipe`
used for its definition. Based on the information stored in the recipe
(order, type, and exponents of composite dimensions) and the ratios of units
provided in the template parameter list after the derived dimension parameter,
@@ -353,6 +366,8 @@ of a `scaled_unit` class template:
[scaled_unit<UnitRatio, Unit>]<:-[named_scaled_unit<Child, Symbol, PrefixFamily, Ratio, Unit>]
[scaled_unit<UnitRatio, Unit>]<:-[prefixed_unit<Child, Prefix, Unit>]
[scaled_unit<UnitRatio, Unit>]<:-[deduced_unit<Child, Dimension, Unit, Unit...>]
[scaled_unit<UnitRatio, Unit>]<:-[noble_deduced_unit<Child, Dimension, Unit, Unit...>]
[scaled_unit<UnitRatio, Unit>]<:-[named_deduced_unit<Child, Dimension, Symbol, PrefixFamily, Unit, Unit...>]
[scaled_unit<UnitRatio, Unit>]<:-[alias_unit<Unit, Symbol, PrefixFamily>]
[scaled_unit<UnitRatio, Unit>]<:-[prefixed_alias_unit<Unit, Prefix, AliasUnit>]

View File

@@ -19,6 +19,12 @@ Units
.. doxygenstruct:: units::deduced_unit
:members:
.. doxygenstruct:: units::noble_deduced_unit
:members:
.. doxygenstruct:: units::named_deduced_unit
:members:
.. doxygenstruct:: units::alias_unit
:members:

View File

@@ -10,6 +10,7 @@ Physical
physical/international
physical/us
physical/imperial
physical/fps
physical/iau
physical/typographic
physical/natural

View File

@@ -0,0 +1,18 @@
FPS
===
.. toctree::
:maxdepth: 2
fps/acceleration
fps/area
fps/density
fps/energy
fps/force
fps/length
fps/mass
fps/power
fps/pressure
fps/speed
fps/time
fps/volume

View File

@@ -0,0 +1,4 @@
Acceleration
============
.. doxygenfile:: fps/acceleration.h

View File

@@ -0,0 +1,4 @@
Area
====
.. doxygenfile:: fps/area.h

View File

@@ -0,0 +1,4 @@
Density
=======
.. doxygenfile:: fps/density.h

View File

@@ -0,0 +1,4 @@
Energy
======
.. doxygenfile:: fps/energy.h

View File

@@ -0,0 +1,4 @@
Force
=====
.. doxygenfile:: fps/force.h

View File

@@ -0,0 +1,4 @@
Length
======
.. doxygenfile:: fps/length.h

View File

@@ -0,0 +1,4 @@
Mass
====
.. doxygenfile:: fps/mass.h

View File

@@ -0,0 +1,4 @@
Power
=====
.. doxygenfile:: fps/power.h

View File

@@ -0,0 +1,4 @@
Pressure
========
.. doxygenfile:: fps/pressure.h

View File

@@ -0,0 +1,4 @@
Speed
=====
.. doxygenfile:: fps/speed.h

View File

@@ -0,0 +1,4 @@
Time
====
.. doxygenfile:: fps/time.h

View File

@@ -0,0 +1,4 @@
Volume
======
.. doxygenfile:: fps/volume.h