16 #ifndef LARDATAALG_UTILITIES_QUANTITIES_ELECTRONICS_H
17 #define LARDATAALG_UTILITIES_QUANTITIES_ELECTRONICS_H
24 #include <string_view>
30 namespace util::quantities {
34 using namespace std::string_view_literals;
37 static constexpr
auto symbol =
"#"sv;
38 static constexpr
auto name =
"tick"sv;
42 static constexpr
auto symbol =
"#"sv;
43 static constexpr
auto name =
"counts"sv;
67 template <
typename T = std::ptrdiff_t>
112 template <
typename T =
signed short int>
140 namespace electronics_literals {
144 constexpr
tick operator""_tick (
long double v)
146 constexpr
tick operator""_tick (
unsigned long long int v)
152 constexpr
tick_d operator""_tickd (
long double v)
154 constexpr
tick_d operator""_tickd (
unsigned long long int v)
160 constexpr
counts operator""_ADC (
long double v)
161 {
return counts{
static_cast<signed short int>(v) }; }
162 constexpr
counts operator""_ADC (
unsigned long long int v)
163 {
return counts{
static_cast<signed short int>(v) }; }
169 {
return counts_f{
static_cast<float>(v) }; }
170 constexpr
counts_f operator""_ADCf (
unsigned long long int v)
171 {
return counts_f{
static_cast<float>(v) }; }
180 namespace intervals {
232 #endif // LARDATAALG_UTILITIES_QUANTITIES_ELECTRONICS_H
value_t
the JSON type enumeration
static constexpr quantity_t castFrom(U value)
Returns a new quantity initialized with the specified value.
tick_as< double > tick_d
Tick number, represented by double.
Defines point and interval variables based on quantities.
A value measured in the specified unit.
tick_as<> tick
Tick number, represented by std::ptrdiff_t.
An interval (duration, length, distance) between two quantity points.
T value_t
Type of the stored value.
Numeric variable proxies with embedded unit of measurement.
tick_as< float > tick_f
Tick number, represented by float.