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
26  // unary arithmetical functions
27  LP10_CH1,
28  LP10_CH2,
29  LP100_CH1,
30  LP100_CH2,
31  SQ_CH1,
32  SQ_CH2,
33  AC_CH1,
34  AC_CH2,
35  DC_CH1,
36  DC_CH2,
37  ABS_CH1,
38  ABS_CH2,
39  SIGN_CH1,
40  SIGN_CH2,
43  // unary logical functions
44  TRIG_CH1,
45  TRIG_CH2
46 };
47 // this "extern" declaration must match the Enum definition in "mathchannel.cpp"
49 
52 
53 Unit mathModeUnit( MathMode mode );
54 
55 QString mathModeString( MathMode mode );
56 
57 unsigned mathChannelsUsed( MathMode mode );
58 
59 template < class T > inline MathMode getMathMode( T &t ) { return MathMode( t.couplingOrMathIndex ); }
60 
61 
62 } // namespace Dso
63 
64 Q_DECLARE_METATYPE( Dso::MathMode )
MathMode getMathMode(T &t)
Definition: mathmodes.h:59
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:31
Unit mathModeUnit(MathMode mode)
Definition: mathmodes.cpp:9
const auto LastMathMode
Definition: mathmodes.h:51
const auto LastBinaryMathMode
Definition: mathmodes.h:50
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:21