Skip to content

Commit 68439b7

Browse files
committed
reorder logical functions; update translations
Signed-off-by: Martin <[email protected]>
1 parent e15ed3a commit 68439b7

File tree

13 files changed

+271
-267
lines changed

13 files changed

+271
-267
lines changed

CHANGELOG

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
2025-06-22 (3c44189): Added XOR function to the MathChannel module.
1+
2025-09-02 (c73f7de): reorder logical functions
2+
2025-06-22 (e15ed3a): Added XOR function to the MathChannel module.
23
2025-09-01 (ef3f244): Back to GO, disable MinGW build until a volunteer fixes it for Qt6
34
2025-09-01 (8b3dd27): mingw-w64-x86_64-clang-libs: for lupdate
45
2025-09-01 (3c4cc90): MinGW fix - step by step ...

openhantek/src/hantekdso/mathchannel.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,6 @@ void MathChannel::calculate( DSOsamples &result ) {
6666
? 1.0
6767
: 0.0 );
6868
break;
69-
case Dso::MathMode::XOR_CH1_CH2:
70-
// logic values: above / below trigger level
71-
for ( auto it = mathChannel.begin(), end = mathChannel.end(); it != end; ++it, ++ch1Iterator, ++ch2Iterator )
72-
*it = ( ( *ch1Iterator >= scope->voltage[ CH1 ].trigger ) ^ ( *ch2Iterator >= scope->voltage[ CH2 ].trigger )
73-
? 1.0
74-
: 0.0 );
75-
break;
7669
case Dso::MathMode::AND_NOT_CH1_CH2:
7770
// logic values: above / below trigger level
7871
for ( auto it = mathChannel.begin(), end = mathChannel.end(); it != end; ++it, ++ch1Iterator, ++ch2Iterator )
@@ -94,6 +87,13 @@ void MathChannel::calculate( DSOsamples &result ) {
9487
? 1.0
9588
: 0.0 );
9689
break;
90+
case Dso::MathMode::XOR_CH1_CH2:
91+
// logic values: above / below trigger level
92+
for ( auto it = mathChannel.begin(), end = mathChannel.end(); it != end; ++it, ++ch1Iterator, ++ch2Iterator )
93+
*it = ( ( *ch1Iterator >= scope->voltage[ CH1 ].trigger ) ^ ( *ch2Iterator >= scope->voltage[ CH2 ].trigger )
94+
? 1.0
95+
: 0.0 );
96+
break;
9797
case Dso::MathMode::EQU_CH1_CH2:
9898
// logic values: above / below trigger level
9999
for ( auto it = mathChannel.begin(), end = mathChannel.end(); it != end; ++it, ++ch1Iterator, ++ch2Iterator )

openhantek/src/hantekdso/mathmodes.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@ Enum< Dso::MathMode, Dso::MathMode::ADD_CH1_CH2, Dso::MathMode::TRIG_CH2 > MathM
99
Unit mathModeUnit( MathMode mode ) {
1010
if ( mode == MathMode::MUL_CH1_CH2 || mode == MathMode::SQ_CH1 || mode == MathMode::SQ_CH2 )
1111
return UNIT_VOLTSQUARE;
12-
else if ( mode == MathMode::AND_CH1_CH2 || mode == MathMode::XOR_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::GREAT_CH1_CH2 ||
14-
mode == MathMode::GREAT_CH2_CH1 || mode == MathMode::SIGN_AC_CH1 || mode == MathMode::SIGN_AC_CH2 ||
15-
mode == MathMode::SIGN_CH1 || mode == MathMode::SIGN_CH2 || mode == MathMode::TRIG_CH2 ||
12+
else if ( mode == MathMode::AND_CH1_CH2 || mode == MathMode::AND_NOT_CH1_CH2 ||
13+
mode == MathMode::AND_CH1_NOT_CH2 || mode == MathMode::AND_NOT_CH1_NOT_CH2 ||
14+
mode == MathMode::XOR_CH1_CH2 || mode == MathMode::EQU_CH1_CH2 ||
15+
mode == MathMode::GREAT_CH1_CH2 || mode == MathMode::GREAT_CH2_CH1 ||
16+
mode == MathMode::SIGN_AC_CH1 || mode == MathMode::SIGN_AC_CH2 ||
17+
mode == MathMode::SIGN_CH1 || mode == MathMode::SIGN_CH2 ||
1618
mode == MathMode::TRIG_CH1 || mode == MathMode::TRIG_CH2 )
1719
return UNIT_NONE; // logic values 0 or 1
1820
else
@@ -41,14 +43,14 @@ QString mathModeString( MathMode mode ) {
4143
return QCoreApplication::tr( "CH1 * CH2" );
4244
case MathMode::AND_CH1_CH2:
4345
return QCoreApplication::tr( "CH1 & CH2" );
44-
case MathMode::XOR_CH1_CH2:
45-
return QCoreApplication::tr( "CH1 ^ CH2" );
4646
case MathMode::AND_NOT_CH1_NOT_CH2:
4747
return QCoreApplication::tr( "/CH1 & /CH2" );
4848
case MathMode::AND_NOT_CH1_CH2:
4949
return QCoreApplication::tr( "/CH1 & CH2" );
5050
case MathMode::AND_CH1_NOT_CH2:
5151
return QCoreApplication::tr( "CH1 & /CH2" );
52+
case MathMode::XOR_CH1_CH2:
53+
return QCoreApplication::tr( "CH1 ^ CH2" );
5254
case MathMode::EQU_CH1_CH2:
5355
return QCoreApplication::tr( "CH1 ≡ CH2" );
5456
case MathMode::GREAT_CH1_CH2:

openhantek/src/hantekdso/mathmodes.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ enum class MathMode : unsigned {
1919
MUL_CH1_CH2,
2020
// binary logical functions
2121
AND_CH1_CH2,
22-
XOR_CH1_CH2,
2322
AND_NOT_CH1_NOT_CH2,
2423
AND_NOT_CH1_CH2,
2524
AND_CH1_NOT_CH2,
25+
XOR_CH1_CH2,
2626
EQU_CH1_CH2,
2727
GREAT_CH1_CH2,
2828
GREAT_CH2_CH1,

openhantek/translations/openhantek_de.ts

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2197,22 +2197,22 @@
21972197
<translation type="vanished">Benutze OpenGL ES anstelle von OpenGL</translation>
21982198
</message>
21992199
<message>
2200-
<location filename="../src/hantekdso/mathmodes.cpp" line="35"/>
2200+
<location filename="../src/hantekdso/mathmodes.cpp" line="37"/>
22012201
<source>CH1 + CH2</source>
22022202
<translation>CH1 + CH2</translation>
22032203
</message>
22042204
<message>
2205-
<location filename="../src/hantekdso/mathmodes.cpp" line="37"/>
2205+
<location filename="../src/hantekdso/mathmodes.cpp" line="39"/>
22062206
<source>CH1 - CH2</source>
22072207
<translation>CH1 - CH2</translation>
22082208
</message>
22092209
<message>
2210-
<location filename="../src/hantekdso/mathmodes.cpp" line="39"/>
2210+
<location filename="../src/hantekdso/mathmodes.cpp" line="41"/>
22112211
<source>CH2 - CH1</source>
22122212
<translation>CH2 - CH1</translation>
22132213
</message>
22142214
<message>
2215-
<location filename="../src/hantekdso/mathmodes.cpp" line="41"/>
2215+
<location filename="../src/hantekdso/mathmodes.cpp" line="43"/>
22162216
<source>CH1 * CH2</source>
22172217
<translation>CH1 * CH2</translation>
22182218
</message>
@@ -2225,14 +2225,14 @@
22252225
<translation type="vanished">CH2 ^2</translation>
22262226
</message>
22272227
<message>
2228-
<location filename="../src/hantekdso/mathmodes.cpp" line="43"/>
2228+
<location filename="../src/hantekdso/mathmodes.cpp" line="45"/>
22292229
<source>CH1 &amp; CH2</source>
22302230
<translation>CH1 &amp; CH2</translation>
22312231
</message>
22322232
<message>
2233-
<location filename="../src/hantekdso/mathmodes.cpp" line="45"/>
2233+
<location filename="../src/hantekdso/mathmodes.cpp" line="53"/>
22342234
<source>CH1 ^ CH2</source>
2235-
<translation type="unfinished"></translation>
2235+
<translation>CH1 ^ CH2</translation>
22362236
</message>
22372237
<message>
22382238
<location filename="../src/hantekdso/mathmodes.cpp" line="47"/>
@@ -2254,7 +2254,7 @@
22542254
<translation type="vanished">CH1 == CH2</translation>
22552255
</message>
22562256
<message>
2257-
<location filename="../src/hantekdso/mathmodes.cpp" line="55"/>
2257+
<location filename="../src/hantekdso/mathmodes.cpp" line="57"/>
22582258
<source>CH1 &gt; CH2</source>
22592259
<translation>CH1 &gt; CH2</translation>
22602260
</message>
@@ -2263,102 +2263,102 @@
22632263
<translation type="vanished">CH2 &gt; CH1</translation>
22642264
</message>
22652265
<message>
2266-
<location filename="../src/hantekdso/mathmodes.cpp" line="53"/>
2266+
<location filename="../src/hantekdso/mathmodes.cpp" line="55"/>
22672267
<source>CH1 ≡ CH2</source>
22682268
<translation>CH1 ≡ CH2</translation>
22692269
</message>
22702270
<message>
2271-
<location filename="../src/hantekdso/mathmodes.cpp" line="57"/>
2271+
<location filename="../src/hantekdso/mathmodes.cpp" line="59"/>
22722272
<source>CH1 &lt; CH2</source>
22732273
<translation>CH1 &lt; CH2</translation>
22742274
</message>
22752275
<message>
2276-
<location filename="../src/hantekdso/mathmodes.cpp" line="59"/>
2276+
<location filename="../src/hantekdso/mathmodes.cpp" line="61"/>
22772277
<source>CH1 LP10</source>
22782278
<translation>CH1 LP10</translation>
22792279
</message>
22802280
<message>
2281-
<location filename="../src/hantekdso/mathmodes.cpp" line="61"/>
2281+
<location filename="../src/hantekdso/mathmodes.cpp" line="63"/>
22822282
<source>CH2 LP10</source>
22832283
<translation>CH2 LP10</translation>
22842284
</message>
22852285
<message>
2286-
<location filename="../src/hantekdso/mathmodes.cpp" line="63"/>
2286+
<location filename="../src/hantekdso/mathmodes.cpp" line="65"/>
22872287
<source>CH1 LP100</source>
22882288
<translation>CH1 LP100</translation>
22892289
</message>
22902290
<message>
2291-
<location filename="../src/hantekdso/mathmodes.cpp" line="65"/>
2291+
<location filename="../src/hantekdso/mathmodes.cpp" line="67"/>
22922292
<source>CH2 LP100</source>
22932293
<translation>CH2 LP100</translation>
22942294
</message>
22952295
<message>
2296-
<location filename="../src/hantekdso/mathmodes.cpp" line="67"/>
2296+
<location filename="../src/hantekdso/mathmodes.cpp" line="69"/>
22972297
<source>CH1²</source>
22982298
<translation>CH1²</translation>
22992299
</message>
23002300
<message>
2301-
<location filename="../src/hantekdso/mathmodes.cpp" line="69"/>
2301+
<location filename="../src/hantekdso/mathmodes.cpp" line="71"/>
23022302
<source>CH2²</source>
23032303
<translation>CH2²</translation>
23042304
</message>
23052305
<message>
2306-
<location filename="../src/hantekdso/mathmodes.cpp" line="71"/>
2306+
<location filename="../src/hantekdso/mathmodes.cpp" line="73"/>
23072307
<source>CH1 AC</source>
23082308
<translation>CH1 AC</translation>
23092309
</message>
23102310
<message>
2311-
<location filename="../src/hantekdso/mathmodes.cpp" line="73"/>
2311+
<location filename="../src/hantekdso/mathmodes.cpp" line="75"/>
23122312
<source>CH2 AC</source>
23132313
<translation>CH2 AC</translation>
23142314
</message>
23152315
<message>
2316-
<location filename="../src/hantekdso/mathmodes.cpp" line="75"/>
2316+
<location filename="../src/hantekdso/mathmodes.cpp" line="77"/>
23172317
<source>CH1 DC</source>
23182318
<translation>CH1 DC</translation>
23192319
</message>
23202320
<message>
2321-
<location filename="../src/hantekdso/mathmodes.cpp" line="77"/>
2321+
<location filename="../src/hantekdso/mathmodes.cpp" line="79"/>
23222322
<source>CH2 DC</source>
23232323
<translation>CH2 DC</translation>
23242324
</message>
23252325
<message>
2326-
<location filename="../src/hantekdso/mathmodes.cpp" line="79"/>
2326+
<location filename="../src/hantekdso/mathmodes.cpp" line="81"/>
23272327
<source>CH1 Abs</source>
23282328
<translation>CH1 Abs</translation>
23292329
</message>
23302330
<message>
2331-
<location filename="../src/hantekdso/mathmodes.cpp" line="81"/>
2331+
<location filename="../src/hantekdso/mathmodes.cpp" line="83"/>
23322332
<source>CH2 Abs</source>
23332333
<translation>CH2 Abs</translation>
23342334
</message>
23352335
<message>
2336-
<location filename="../src/hantekdso/mathmodes.cpp" line="83"/>
2336+
<location filename="../src/hantekdso/mathmodes.cpp" line="85"/>
23372337
<source>CH1 Sign</source>
23382338
<translation>CH1 Sign</translation>
23392339
</message>
23402340
<message>
2341-
<location filename="../src/hantekdso/mathmodes.cpp" line="85"/>
2341+
<location filename="../src/hantekdso/mathmodes.cpp" line="87"/>
23422342
<source>CH2 Sign</source>
23432343
<translation>CH2 Sign</translation>
23442344
</message>
23452345
<message>
2346-
<location filename="../src/hantekdso/mathmodes.cpp" line="87"/>
2346+
<location filename="../src/hantekdso/mathmodes.cpp" line="89"/>
23472347
<source>CH1 AC Sign</source>
23482348
<translation>CH1 AC Sign</translation>
23492349
</message>
23502350
<message>
2351-
<location filename="../src/hantekdso/mathmodes.cpp" line="89"/>
2351+
<location filename="../src/hantekdso/mathmodes.cpp" line="91"/>
23522352
<source>CH2 AC Sign</source>
23532353
<translation>CH2 AC Sign</translation>
23542354
</message>
23552355
<message>
2356-
<location filename="../src/hantekdso/mathmodes.cpp" line="91"/>
2356+
<location filename="../src/hantekdso/mathmodes.cpp" line="93"/>
23572357
<source>CH1 Trigger</source>
23582358
<translation>CH1 Trigger</translation>
23592359
</message>
23602360
<message>
2361-
<location filename="../src/hantekdso/mathmodes.cpp" line="93"/>
2361+
<location filename="../src/hantekdso/mathmodes.cpp" line="95"/>
23622362
<source>CH2 Trigger</source>
23632363
<translation>CH2 Trigger</translation>
23642364
</message>

0 commit comments

Comments
 (0)