OpenHantek
mathmodes.h
Go to the documentation of this file.
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 
3 #pragma once
4 
5 #include "utils/enumclass.h"
6 #include "utils/printutils.h"
7 
8 #include <QMetaType>
9 
10 namespace Dso {
11 
14 enum class MathMode : unsigned {
15  // binary arithmetical functions
20  // binary logical functions
28  // unary arithmetical functions
29  LP10_CH1,
30  LP10_CH2,
31  LP100_CH1,
32  LP100_CH2,
33  SQ_CH1,
34  SQ_CH2,
35  AC_CH1,
36  AC_CH2,
37  DC_CH1,
38  DC_CH2,
39  ABS_CH1,
40  ABS_CH2,
41  SIGN_CH1,
42  SIGN_CH2,
45  // unary logical functions
46  TRIG_CH1,
47  TRIG_CH2
48 };
49 // this "extern" declaration must match the Enum definition in "mathchannel.cpp"
51 
54 
55 Unit mathModeUnit( MathMode mode );
56 
57 QString mathModeString( MathMode mode );
58 
59 unsigned mathChannelsUsed( MathMode mode );
60 
61 template < class T > inline MathMode getMathMode( T &t ) { return MathMode( t.couplingOrMathIndex ); }
62 
63 
64 } // namespace Dso
65 
66 Q_DECLARE_METATYPE( Dso::MathMode )
MathMode getMathMode(T &t)
Definition: mathmodes.h:61
Enum< Dso::MathMode, Dso::MathMode::ADD_CH1_CH2, Dso::MathMode::TRIG_CH2 > MathModeEnum
Definition: mathmodes.cpp:7
MathMode
The different math modes for the math-channel.
Definition: mathmodes.h:14
QString mathModeString(MathMode mode)
Return string representation of the given math mode.
Definition: mathmodes.cpp:32
Unit mathModeUnit(MathMode mode)
Definition: mathmodes.cpp:9
const auto LastMathMode
Definition: mathmodes.h:53
const auto LastBinaryMathMode
Definition: mathmodes.h:52
Unit
The various units supported by valueToString.
Definition: printutils.h:12
Definition: enumclass.h:5
Definition: TriggerDock.h:15
unsigned mathChannelsUsed(MathMode mode)
Definition: mathmodes.cpp:22