mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-02 20:04:27 +02:00
New deduced units and FPS system documentation added
This commit is contained in:
@@ -86,6 +86,7 @@ add_custom_command(OUTPUT "${SPHINX_INDEX_FILE}"
|
|||||||
"${CMAKE_CURRENT_SOURCE_DIR}/examples/capacitor_time_curve.rst"
|
"${CMAKE_CURRENT_SOURCE_DIR}/examples/capacitor_time_curve.rst"
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/examples/clcpp_response.rst"
|
"${CMAKE_CURRENT_SOURCE_DIR}/examples/clcpp_response.rst"
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/examples/conversion_factor.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/hello_units.rst"
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/examples/kalman_filter-alpha_beta_filter_example2.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/linear_algebra.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/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.rst"
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/iau/length.rst"
|
"${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/iau/length.rst"
|
||||||
|
|
||||||
|
BIN
docs/_static/img/units.png
vendored
BIN
docs/_static/img/units.png
vendored
Binary file not shown.
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 74 KiB |
@@ -10,6 +10,7 @@ Examples
|
|||||||
examples/unknown_dimension
|
examples/unknown_dimension
|
||||||
examples/measurement
|
examples/measurement
|
||||||
examples/linear_algebra
|
examples/linear_algebra
|
||||||
|
examples/foot_pound_second
|
||||||
|
|
||||||
examples/capacitor_time_curve
|
examples/capacitor_time_curve
|
||||||
examples/clcpp_response
|
examples/clcpp_response
|
||||||
|
7
docs/examples/foot_pound_second.rst
Normal file
7
docs/examples/foot_pound_second.rst
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
foot_pound_second
|
||||||
|
=================
|
||||||
|
|
||||||
|
.. literalinclude:: ../../example/foot_pound_second.cpp
|
||||||
|
:caption: foot_pound_second.cpp
|
||||||
|
:start-at: #include
|
||||||
|
:linenos:
|
@@ -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
|
In case the deduced unit should served as a named one we can use ether a
|
||||||
a dimension as its parameter. This derived dimension provides a :term:`recipe`
|
`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
|
used for its definition. Based on the information stored in the recipe
|
||||||
(order, type, and exponents of composite dimensions) and the ratios of units
|
(order, type, and exponents of composite dimensions) and the ratios of units
|
||||||
provided in the template parameter list after the derived dimension parameter,
|
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>]<:-[named_scaled_unit<Child, Symbol, PrefixFamily, Ratio, Unit>]
|
||||||
[scaled_unit<UnitRatio, Unit>]<:-[prefixed_unit<Child, Prefix, Unit>]
|
[scaled_unit<UnitRatio, Unit>]<:-[prefixed_unit<Child, Prefix, Unit>]
|
||||||
[scaled_unit<UnitRatio, Unit>]<:-[deduced_unit<Child, Dimension, Unit, 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>]<:-[alias_unit<Unit, Symbol, PrefixFamily>]
|
||||||
[scaled_unit<UnitRatio, Unit>]<:-[prefixed_alias_unit<Unit, Prefix, AliasUnit>]
|
[scaled_unit<UnitRatio, Unit>]<:-[prefixed_alias_unit<Unit, Prefix, AliasUnit>]
|
||||||
|
|
||||||
|
@@ -19,6 +19,12 @@ Units
|
|||||||
.. doxygenstruct:: units::deduced_unit
|
.. doxygenstruct:: units::deduced_unit
|
||||||
:members:
|
:members:
|
||||||
|
|
||||||
|
.. doxygenstruct:: units::noble_deduced_unit
|
||||||
|
:members:
|
||||||
|
|
||||||
|
.. doxygenstruct:: units::named_deduced_unit
|
||||||
|
:members:
|
||||||
|
|
||||||
.. doxygenstruct:: units::alias_unit
|
.. doxygenstruct:: units::alias_unit
|
||||||
:members:
|
:members:
|
||||||
|
|
||||||
|
@@ -10,6 +10,7 @@ Physical
|
|||||||
physical/international
|
physical/international
|
||||||
physical/us
|
physical/us
|
||||||
physical/imperial
|
physical/imperial
|
||||||
|
physical/fps
|
||||||
physical/iau
|
physical/iau
|
||||||
physical/typographic
|
physical/typographic
|
||||||
physical/natural
|
physical/natural
|
||||||
|
18
docs/reference/systems/physical/fps.rst
Normal file
18
docs/reference/systems/physical/fps.rst
Normal 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
|
4
docs/reference/systems/physical/fps/acceleration.rst
Normal file
4
docs/reference/systems/physical/fps/acceleration.rst
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
Acceleration
|
||||||
|
============
|
||||||
|
|
||||||
|
.. doxygenfile:: fps/acceleration.h
|
4
docs/reference/systems/physical/fps/area.rst
Normal file
4
docs/reference/systems/physical/fps/area.rst
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
Area
|
||||||
|
====
|
||||||
|
|
||||||
|
.. doxygenfile:: fps/area.h
|
4
docs/reference/systems/physical/fps/density.rst
Normal file
4
docs/reference/systems/physical/fps/density.rst
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
Density
|
||||||
|
=======
|
||||||
|
|
||||||
|
.. doxygenfile:: fps/density.h
|
4
docs/reference/systems/physical/fps/energy.rst
Normal file
4
docs/reference/systems/physical/fps/energy.rst
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
Energy
|
||||||
|
======
|
||||||
|
|
||||||
|
.. doxygenfile:: fps/energy.h
|
4
docs/reference/systems/physical/fps/force.rst
Normal file
4
docs/reference/systems/physical/fps/force.rst
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
Force
|
||||||
|
=====
|
||||||
|
|
||||||
|
.. doxygenfile:: fps/force.h
|
4
docs/reference/systems/physical/fps/length.rst
Normal file
4
docs/reference/systems/physical/fps/length.rst
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
Length
|
||||||
|
======
|
||||||
|
|
||||||
|
.. doxygenfile:: fps/length.h
|
4
docs/reference/systems/physical/fps/mass.rst
Normal file
4
docs/reference/systems/physical/fps/mass.rst
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
Mass
|
||||||
|
====
|
||||||
|
|
||||||
|
.. doxygenfile:: fps/mass.h
|
4
docs/reference/systems/physical/fps/power.rst
Normal file
4
docs/reference/systems/physical/fps/power.rst
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
Power
|
||||||
|
=====
|
||||||
|
|
||||||
|
.. doxygenfile:: fps/power.h
|
4
docs/reference/systems/physical/fps/pressure.rst
Normal file
4
docs/reference/systems/physical/fps/pressure.rst
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
Pressure
|
||||||
|
========
|
||||||
|
|
||||||
|
.. doxygenfile:: fps/pressure.h
|
4
docs/reference/systems/physical/fps/speed.rst
Normal file
4
docs/reference/systems/physical/fps/speed.rst
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
Speed
|
||||||
|
=====
|
||||||
|
|
||||||
|
.. doxygenfile:: fps/speed.h
|
4
docs/reference/systems/physical/fps/time.rst
Normal file
4
docs/reference/systems/physical/fps/time.rst
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
Time
|
||||||
|
====
|
||||||
|
|
||||||
|
.. doxygenfile:: fps/time.h
|
4
docs/reference/systems/physical/fps/volume.rst
Normal file
4
docs/reference/systems/physical/fps/volume.rst
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
Volume
|
||||||
|
======
|
||||||
|
|
||||||
|
.. doxygenfile:: fps/volume.h
|
Reference in New Issue
Block a user