Skip to content

Commit 7e384e4

Browse files
committed
Merge branch 'spacejoey86-greater_math_modes'
2 parents 37cc223 + 7fd84d8 commit 7e384e4

File tree

4 files changed

+21
-2
lines changed

4 files changed

+21
-2
lines changed

docs/OpenHantek6022_User_Manual.odt

-24.2 KB
Binary file not shown.

openhantek/src/hantekdso/mathchannel.cpp

+12
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,18 @@ void MathChannel::calculate( DSOsamples &result ) {
9595
? 1.0
9696
: 0.0 );
9797
break;
98+
case Dso::MathMode::GREAT_CH1_CH2:
99+
for ( auto it = mathChannel.begin(), end = mathChannel.end(); it != end; ++it, ++ch1Iterator, ++ch2Iterator )
100+
*it = ( ( *ch1Iterator ) > ( *ch2Iterator )
101+
? 1.0
102+
: 0.0 );
103+
break;
104+
case Dso::MathMode::GREAT_CH2_CH1:
105+
for ( auto it = mathChannel.begin(), end = mathChannel.end(); it != end; ++it, ++ch1Iterator, ++ch2Iterator )
106+
*it = ( ( *ch2Iterator ) > ( *ch1Iterator )
107+
? 1.0
108+
: 0.0 );
109+
break;
98110
default:
99111
for ( auto it = mathChannel.begin(), end = mathChannel.end(); it != end; ++it )
100112
*it = 0.0;

openhantek/src/hantekdso/mathmodes.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ Unit mathModeUnit( MathMode mode ) {
1010
if ( mode == MathMode::MUL_CH1_CH2 || mode == MathMode::SQ_CH1 || mode == MathMode::SQ_CH2 )
1111
return UNIT_VOLTSQUARE;
1212
else if ( mode == MathMode::AND_CH1_CH2 || mode == MathMode::AND_NOT_CH1_CH2 || mode == MathMode::AND_CH1_NOT_CH2 ||
13-
mode == MathMode::AND_NOT_CH1_NOT_CH2 || mode == MathMode::EQU_CH1_CH2 || mode == MathMode::SIGN_AC_CH1 ||
13+
mode == MathMode::AND_NOT_CH1_NOT_CH2 || mode == MathMode::EQU_CH1_CH2 || mode == MathMode::GREAT_CH1_CH2 ||
14+
mode == MathMode::GREAT_CH2_CH1 || mode == MathMode::SIGN_AC_CH1 ||
1415
mode == MathMode::SIGN_AC_CH2 || mode == MathMode::SIGN_CH1 || mode == MathMode::SIGN_CH2 ||
1516
mode == MathMode::TRIG_CH2 || mode == MathMode::TRIG_CH1 || mode == MathMode::TRIG_CH2 )
1617
return UNIT_NONE; // logic values 0 or 1
@@ -48,6 +49,10 @@ QString mathModeString( MathMode mode ) {
4849
return QCoreApplication::tr( "CH1 & /CH2" );
4950
case MathMode::EQU_CH1_CH2:
5051
return QCoreApplication::tr( "CH1 == CH2" );
52+
case MathMode::GREAT_CH1_CH2:
53+
return QCoreApplication::tr( "CH1 > CH2" );
54+
case MathMode::GREAT_CH2_CH1:
55+
return QCoreApplication::tr( "CH2 > CH1" );
5156
case MathMode::LP10_CH1:
5257
return QCoreApplication::tr( "CH1 LP10" );
5358
case MathMode::LP10_CH2:

openhantek/src/hantekdso/mathmodes.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ enum class MathMode : unsigned {
2323
AND_NOT_CH1_CH2,
2424
AND_CH1_NOT_CH2,
2525
EQU_CH1_CH2,
26+
GREAT_CH1_CH2,
27+
GREAT_CH2_CH1,
2628
// unary arithmetical functions
2729
LP10_CH1,
2830
LP10_CH2,
@@ -47,7 +49,7 @@ enum class MathMode : unsigned {
4749
// this "extern" declaration must match the Enum definition in "mathchannel.cpp"
4850
extern Enum< Dso::MathMode, Dso::MathMode::ADD_CH1_CH2, Dso::MathMode::TRIG_CH2 > MathModeEnum;
4951

50-
const auto LastBinaryMathMode = MathMode::EQU_CH1_CH2;
52+
const auto LastBinaryMathMode = MathMode::GREAT_CH2_CH1;
5153
const auto LastMathMode = MathMode::TRIG_CH2;
5254

5355
Unit mathModeUnit( MathMode mode );

0 commit comments

Comments
 (0)