Commit 90696c4a44673934fbe11d7d8ba80445baa93f89

Authored by swkim01
Committed by David Gräff
1 parent 4f02d089

support software triggering and others for 6022be (#59)

* Fix spectrum display: The loop was controlled with a different variable than the previous loops.
* Update control.cpp
* Update Readme (OSX information added)
* Support for software trigger (for 6022be)
* Samplerate support for 6022be
* Add install information for 6022be
* Utilizing enums count value to make code easier to maintain
* Beautifying
* 6022BE: Make samplerate adjust to chosen timebase.

The product of samplerate and timebase (x10) specifies the number of samples
needed to fill up the screen horizontally.
Based on the record length, the system was able to configure a timebase
when the samplerate was changed.

Code exist indicating this should also work in the opposite direction. I.e.
when changing timebase, the samplerate should adjust.

This has been fixed to also work now for 6022BE

* Fix bug that displays thick lines for printing due to non default cosmetic pen
* Add color settings for printing
firmware/90-hantek.rules
... ... @@ -18,3 +18,7 @@ ATTRS{idVendor}=="04b5", ATTRS{idProduct}=="5200", MODE="0660", GROUP="plugdev"
18 18 # Hantek DSO-5200A
19 19 SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", ENV{PRODUCT}=="4b4/520a/*", RUN+="/sbin/fxload -t fx2 -I /usr/local/share/hantek/dso5200ax86-firmware.hex -s /usr/local/share/hantek/dso5200ax86-loader.hex -D $env{DEVNAME}"
20 20 ATTRS{idVendor}=="04b5", ATTRS{idProduct}=="520a", MODE="0660", GROUP="plugdev"
  21 +
  22 +# Hantek DSO-6022BE
  23 +SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", ENV{PRODUCT}=="4b4/6022/*", RUN+="/sbin/fxload -t fx2 -I /usr/local/share/hantek/dso6022be-firmware.hex -s /usr/local/share/hantek/dso6022be-loader.hex -D $env{DEVNAME}"
  24 +ATTRS{idVendor}=="04b5", ATTRS{idProduct}=="6022", MODE="0660", GROUP="plugdev"
... ...
firmware/dso6022be-firmware.hex 0 → 100644
  1 +:02095e00c105d1
  2 +:100cb80090e6007410f0120f1800000090e612740d
  3 +:100cc800a0f0000000e490e613f000000090e614a5
  4 +:100cd80074e0f0000000e490e615f000000090e6f3
  5 +:100ce800047480f00000007402f00000007406f044
  6 +:100cf800000000e4f000000090e61804f000000096
  7 +:100d08007411f000000090e61a7409f000000090d9
  8 +:100d1800e6d27402f000000090e6e214f000000051
  9 +:100d2800e490e671f075b4ff90e670f075b280c299
  10 +:100d3800a4c2a3c2a2c2a7c2a6c2a5f51df51a12d3
  11 +:0a0d4800130990e67ae04401f0225e
  12 +:100b7b00e51d64017031751d0290e6f574fff09070
  13 +:100b8b00e6047480f00000007402f00000007406ac
  14 +:100b9b00f0000000e4f0000000fffe000fbf0001ba
  15 +:100bab000ebe03f7bfe8f4e5bb30e72590e6f4e0b3
  16 +:100bbb0030e01ee5ac20e019e5bb30e7fb90e6d05a
  17 +:100bcb007428f0000000e490e6d1f000000075bb43
  18 +:010bdb000613
  19 +:010bdc0022f6
  20 +:02002800d322e1
  21 +:02004000d322c9
  22 +:02004600d322c3
  23 +:10104c0090e680e030e71800000090e6247402f08f
  24 +:10105c00000000e490e625f0000000d205801600a8
  25 +:10106c000000e490e624f000000090e6257440f0c7
  26 +:0d107c00000000c20590e6bae0f51bd3228b
  27 +:1012dd0090e740e51bf0e490e68af090e68b04f091
  28 +:0212ed00d3220a
  29 +:0813010090e6bae0f518d322d2
  30 +:1012ef0090e740e518f0e490e68af090e68b04f082
  31 +:0212ff00d322f8
  32 +:02004800d322c1
  33 +:02004e00d322bb
  34 +:02005000d322b9
  35 +:1000560090e678e05410ffc4540f4450f51913e4a9
  36 +:1000660033f51cd20290e6b9e0245e605024f060bd
  37 +:100076003024d2b4080040030204d590008f75f0f6
  38 +:1000860003a4c58325f0c5837302024b02029602c0
  39 +:1000960002dc0204460204d50204d50204d5020499
  40 +:1000a60065a205e43390e740f0e490e68af090e636
  41 +:1000b6008b04f090e6a0e04480f00204d790e6ba04
  42 +:1000c600e0752d00f52ea3e0fee4ee422d90e6be8f
  43 +:1000d600e0752f00f530a3e0fee4ee422f90e6b87f
  44 +:1000e600e064c060030201b3e530452f70030204eb
  45 +:1000f600d790e6a0e020e1f9c3e5309440e52f94df
  46 +:10010600005008852f3185303280067531007532f2
  47 +:100116004090e6b9e0b4a335e4f533f534c3e534ed
  48 +:100126009532e53395315060e52e2534f582e52d7f
  49 +:100136003533f583e0ff74402534f582e434e7f582
  50 +:1001460083eff00534e5347002053380d0e4f533ef
  51 +:10015600f534c3e5349532e53395315018744025ae
  52 +:1001660034f582e434e7f58374cdf00534e5347074
  53 +:1001760002053380ddad327ae779407ee77f40ab1a
  54 +:1001860007af2eae2d120fbde490e68af090e68bf7
  55 +:10019600e532f0252ef52ee531352df52dc3e5306a
  56 +:1001a6009532f530e52f9531f52f0200ee90e6b841
  57 +:1001b600e0644060030204d7e530452f7003020473
  58 +:1001c600d7e490e68af090e68bf090e6a0e020e196
  59 +:1001d600f990e68be0753100f53290e6b9e0b4a30c
  60 +:1001e60035e4f533f534c3e5349532e533953150ce
  61 +:1001f6003874402534f582e434e7f583e0ffe52ed4
  62 +:100206002534f582e52d3533f583eff00534e534f5
  63 +:100216007002053380d0ad327ae779407ee77f40c1
  64 +:10022600ab07af2eae2d12112de532252ef52ee59c
  65 +:1002360031352df52dc3e5309532f530e52f953165
  66 +:10024600f52f0201bee490e68af090e68bf090e688
  67 +:10025600a0e020e1f990e740e0f53514602914604c
  68 +:100266001d24fd601024fb60030204d7c2a4d2a3a0
  69 +:10027600d2a20204d7c2a4c2a3c2a20204d7c2a4b5
  70 +:10028600c2a3d2a20204d7c2a4d2a3c2a20204d796
  71 +:10029600e490e68af090e68bf090e6a0e020e1f9a3
  72 +:1002a60090e740e0f53524fe601a24fd600d24fb3e
  73 +:1002b600701bc2a7d2a6d2a50204d7c2a7c2a6c2e5
  74 +:1002c600a50204d7c2a7c2a6d2a50204d7c2a7d246
  75 +:1002d600a6c2a50204d7e490e68af090e68bf090d9
  76 +:1002e600e6a0e020e1f990e740e0f535120ef203d2
  77 +:1002f600880103740403600803c20a034d1003afa8
  78 +:1003060014033b1803291e031730039c3200000315
  79 +:10031600d390e60174eaf090e05074fff0751a018c
  80 +:100326000203d390e60174aaf090e05074fff075d2
  81 +:100336001a010203d390e60174caf090e05074fbf0
  82 +:10034600f0751a010203d390e60174caf090e040fa
  83 +:100356007401f0a3f0e4f51a807390e60174caf014
  84 +:1003660090e0407402f0a304f0e4f51a805f90e692
  85 +:100376000174caf090e0407405f0a304f0e4f51aa5
  86 +:10038600804b90e60174caf090e0407417f0a30425
  87 +:10039600f0e4f51a803790e60174caf090e04074f4
  88 +:1003a60030f0a3f0e4f51a802490e60174caf090c8
  89 +:1003b600e0407478f0a3f0e4f51a801190e6017439
  90 +:1003c600caf090e04074f0f0a3f0e4f51a90e6f578
  91 +:1003d60074fff090e080e090e6f3f090e081e0902a
  92 +:1003e600e6c3f090e082e090e6c1f090e083e09012
  93 +:1003f600e6c2f090e085e090e6c0f090e086e090fe
  94 +:10040600e6f4f075af07e51ab4010a74e0f59a74dc
  95 +:1004160087f59b800874e0f59a7400f59b759de45a
  96 +:10042600e4f59ef533f53490e67be090e67cf00546
  97 +:1004360034e534700205336480453370ea0204d72c
  98 +:10044600e490e68af090e68bf090e6a0e020e1f9f1
  99 +:1004560090e740e0f53564017077751d0180729074
  100 +:10046600e6bae0752d00f52ea3e0fee4ee422d90ef
  101 +:10047600e6bee0752f00f530a3e0fee4ee422fe580
  102 +:1004860030452f604c90e6a0e020e1f9c3e53094ba
  103 +:1004960040e52f94005008852f318530328006754f
  104 +:1004a600310075324090e7407401f0e490e68af03e
  105 +:1004b60090e68be532f0252ef52ee531352df52d1e
  106 +:1004c600c3e5309532f530e52f9531f52f80b0d361
  107 +:0204d60022c33f
  108 +:0104d8002201
  109 +:10128100c0e0c083c082d2015391ef90e65d74014a
  110 +:08129100f0d082d083d0e032de
  111 +:1012b100c0e0c083c0825391ef90e65d7404f0d02a
  112 +:0612c10082d083d0e03270
  113 +:1012c700c0e0c083c0825391ef90e65d7402f0d016
  114 +:0612d70082d083d0e0325a
  115 +:10108900c0e0c083c08290e680e030e70e850a0e9a
  116 +:10109900850b0f851210851311800c85120e85138f
  117 +:1010a9000f850a10850b115391ef90e65d7410f0ce
  118 +:0710b900d082d083d0e032a9
  119 +:10129900c0e0c083c082d2045391ef90e65d740828
  120 +:0812a900f0d082d083d0e032c6
  121 +:1010c000c0e0c083c08290e680e030e70e850a0e63
  122 +:1010d000850b0f851210851311800c85120e851358
  123 +:1010e0000f850a10850b115391ef90e65d7420f087
  124 +:0710f000d082d083d0e03272
  125 +:01002a0032a3
  126 +:01003200329b
  127 +:01004200328b
  128 +:01004a003283
  129 +:01005200327b
  130 +:010bf90032c9
  131 +:010bfa0032c8
  132 +:010bfb0032c7
  133 +:010bfc0032c6
  134 +:010bfd0032c5
  135 +:010bfe0032c4
  136 +:010bff0032c3
  137 +:010dfa0032c6
  138 +:010dfb0032c5
  139 +:010dfc0032c4
  140 +:010dfd0032c3
  141 +:010dfe0032c2
  142 +:010dff0032c1
  143 +:0113110032a9
  144 +:0113120032a8
  145 +:0113130032a7
  146 +:0113140032a6
  147 +:0113150032a5
  148 +:0113160032a4
  149 +:0113170032a3
  150 +:0113180032a2
  151 +:0113190032a1
  152 +:01131a0032a0
  153 +:01131b00329f
  154 +:01131c00329e
  155 +:01131d00329d
  156 +:01131e00329c
  157 +:01131f00329b
  158 +:01132000329a
  159 +:011321003299
  160 +:011322003298
  161 +:060f7300ab07aa06ac0565
  162 +:100f7900e4fde51c6010ea7e000dee2407f582e42d
  163 +:100f890034e1f583eaf0ebae050d74072ef582e442
  164 +:100f990034e1f583ebf0af050d74072ff582e434e6
  165 +:100fa900e1f583ecf07ae17b07af19120ddeaf1999
  166 +:030fb9001210f71c
  167 +:010fbc002212
  168 +:0a112d008e368f378d388a398b3ae1
  169 +:10113700e4f53be53bc3953850200537e537ae3638
  170 +:101147007002053614ffe53a253bf582e43539f59b
  171 +:0a11570083e0fd120f73053b80d901
  172 +:01116100226b
  173 +:0a0fbd008e368f378d388a398b3a53
  174 +:100fc700e4fde51c6012e536ff7e000dee2407f513
  175 +:100fd70082e434e1f583eff0e537ae050d74072eb3
  176 +:100fe700f582e434e1f583e537f07ae17b07af1961
  177 +:0e0ff700120ddeab3aaa39ad38af19120bdd80
  178 +:0110050022c8
  179 +:100960006080e0000e030111010130070100020167
  180 +:1009700000001100fffefffefffeffff0009121244
  181 +:10098000002d123f080301010101010701020401ca
  182 +:1009900000000000fffcfffefffeffff090912122e
  183 +:1009a000002d363f17180101010101070002010067
  184 +:1009b00000001000fffbfffbfbfbfbfb000912121a
  185 +:1009c000002d123f0803013f010101070102000150
  186 +:1009d00000000000fffdffffffffffff09091212eb
  187 +:1009e000002d363f6080e087010201013f010107d1
  188 +:1009f00000000200010000000702020707070707c6
  189 +:100a0000000000003f00003f03013f01010101071a
  190 +:100a10000202050000000000050707070707070797
  191 +:100a200000003f000000003f010180010101bf07fd
  192 +:100a30000202030202021100ffffffffffffffffa0
  193 +:100a400000091212002d123f0101010101010107ed
  194 +:100a5000000000000000000007070707070707075e
  195 +:100a6000000000000000003f47e080c000000fca07
  196 +:020a70001e0066
  197 +:100f180090e60174caf090e6f574fff090e080e086
  198 +:100f280090e6f3f090e081e090e6c3f090e082e094
  199 +:100f380090e6c1f090e083e090e6c2f090e085e0b2
  200 +:100f480090e6c0f090e086e090e6f4f075af0774a4
  201 +:100f5800e0f59a7400f59b759de4e4f59eff90e634
  202 +:0a0f68007be090e67cf00fbf80f400
  203 +:010f7200225c
  204 +:0a00360000010202030304040505a3
  205 +:10077300c204c200c203c201c20275080875090798
  206 +:10078300120cb8c2c975cdf875cc40d2cad2adc26d
  207 +:1007930087c2a0d2a17e0e7f008e0c8f0d75140e22
  208 +:1007a300751512750a0e750b1c75120e75133c75b3
  209 +:1007b300160e75175c90e680e030e70e850a0e850d
  210 +:1007c3000b0f851210851311800c85120e85130fe4
  211 +:1007d300850a10850b11ee54e070030208f77529a2
  212 +:1007e30000752a807e0e7f008e2b8f2cc374909f02
  213 +:1007f300ff740e9ecf2402cf3400fee48f288e2791
  214 +:10080300f526f525f524f523f522f521af28ae27a6
  215 +:10081300ad26ac25ab24aa23a922a821c3120ee13d
  216 +:10082300502ae52a2524f582e5293523f58374cd5d
  217 +:10083300f0e4faf9f8e5242401f524ea3523f52355
  218 +:10084300e93522f522e83521f52180c0e4f524f5c8
  219 +:1008530023f522f521af28ae27ad26ac25ab24aa7c
  220 +:1008630023a922a821c3120ee15037e52c2524f534
  221 +:1008730082e52b3523f583e0ffe52a2524f582e580
  222 +:10088300293523f583eff0e4faf9f8e5242401f59b
  223 +:1008930024ea3523f523e93522f522e83521f5212c
  224 +:1008a30080b385290c852a0d74002480ff740e34cf
  225 +:1008b300fffec3e5159ff515e5149ef514c3e50f7b
  226 +:1008c3009ff50fe50e9ef50ec3e5119ff511e5109b
  227 +:1008d3009ef510c3e50b9ff50be50a9ef50ac3e5ec
  228 +:1008e300139ff513e5129ef512c3e5179ff517e560
  229 +:1008f300169ef516d2e843d82090e668e04409f046
  230 +:1009030090e65ce0443df0d2af90e680e020e10564
  231 +:10091300d2061211fa90e680e054f7f0538ef8c233
  232 +:10092300043001051204d9c20130042912002850f1
  233 +:1009330024c20412000320001690e682e030e7048c
  234 +:10094300e020e1ef90e682e030e604e020e0e4120c
  235 +:0a0953001229120040120b7b80c72e
  236 +:01095d002277
  237 +:1004d90090e6b9e070030205b514700302065e24c4
  238 +:1004e900fe70030206f324fb70030205af147003c8
  239 +:1004f9000205a914700302059d1470030205a324c3
  240 +:1005090005600302075f120046400302076b90e68d
  241 +:10051900bbe024fe602c14604724fd601614603192
  242 +:1005290024067066e50c90e6b3f0e50d90e6b4f0ac
  243 +:1005390002076be51490e6b3f0e51590e6b4f00216
  244 +:10054900076be50e90e6b3f0e50f90e6b4f002070d
  245 +:100559006be51090e6b3f0e51190e6b4f002076b95
  246 +:1005690090e6bae0ff121255aa06a9077b01ea49eb
  247 +:100579004b600dee90e6b3f0ef90e6b4f002076b36
  248 +:1005890090e6a0e04401f002076b90e6a0e0440188
  249 +:10059900f002076b1212ef02076b12130102076bcd
  250 +:1005a90012104c02076b1212dd02076b1200484051
  251 +:1005b9000302076b90e6b8e0247f602b14603c24ab
  252 +:1005c900026003020654a200e433ff25e0ffa20300
  253 +:1005d900e4334f90e740f0e4a3f090e68af090e628
  254 +:1005e9008b7402f002076be490e740f0a3f090e609
  255 +:1005f9008af090e68b7402f002076b90e6bce05437
  256 +:100609007eff7e00e0d3948040067c007d0180045b
  257 +:100619007c007d00ec4efeed4f2436f58274003ee1
  258 +:10062900f583e493ff3395e0feef24a1ffee34e672
  259 +:100639008f82f583e0540190e740f0e4a3f090e65f
  260 +:100649008af090e68b7402f002076b90e6a0e04412
  261 +:1006590001f002076b12004e400302076b90e6b8e7
  262 +:10066900e024fe601d2402600302076b90e6bae0f5
  263 +:10067900b40105c20002076b90e6a0e04401f00254
  264 +:10068900076b90e6bae0705990e6bce0547eff7eb5
  265 +:1006990000e0d3948040067c007d0180047c007dcd
  266 +:1006a90000ec4efeed4f2436f58274003ef583e4ee
  267 +:1006b90093ff3395e0feef24a1ffee34e68f82f538
  268 +:1006c90083e054fef090e6bce05480ff131313540a
  269 +:1006d9001fffe0540f2f90e683f0e04420f002075b
  270 +:1006e9006b90e6a0e04401f08078120050507390be
  271 +:1006f900e6b8e024fe60202402706790e6bae0b410
  272 +:100709000104d200805c90e6bae06402605490e68d
  273 +:10071900a0e04401f0804b90e6bce0547eff7e00ef
  274 +:10072900e0d3948040067c007d0180047c007d003c
  275 +:10073900ec4efeed4f2436f58274003ef583e493ca
  276 +:10074900ff3395e0feef24a1ffee34e68f82f583b7
  277 +:10075900e04401f0800c120056500790e6a0e044f6
  278 +:0907690001f090e6a0e04480f0ec
  279 +:010772002264
  280 +:0300330002002e9a
  281 +:04002e0053d8ef3282
  282 +:03002b0002119629
  283 +:10119600c0e0b287e509150970021508e50945089a
  284 +:1011a600701575080475091f300206b2a1d2a08019
  285 +:1011b60004b2a0d2a1c20275cdf875cc40c2cfd080
  286 +:0211c600e03215
  287 +:100e00001201000200000040b5042260000001024f
  288 +:100e100000010a0600020000004001000902200053
  289 +:100e200001010080320904000002ff0000000705f4
  290 +:100e300002020002000705860200020009022000eb
  291 +:100e400001010080320904000004ff0000000705d2
  292 +:100e50000202400000070586024000000403090466
  293 +:100e60000e034f0044004d0020002000200022030c
  294 +:100e7000480061006e00740065006b004400530080
  295 +:100e80004f003600300032003200420045002000a2
  296 +:020e9000000060
  297 +:1012290090e682e030e004e020e60b90e682e030d0
  298 +:10123900e119e030e71590e680e04401f07f147e83
  299 +:0c1249000012100690e680e054fef02237
  300 +:1000030090e682e044c0f090e681f043870100006f
  301 +:0400130000000022c7
  302 +:1011fa0030060990e680e0440af0800790e680e035
  303 +:10120a004408f07fdc7e0512100690e65d74fff05c
  304 +:0f121a0090e65ff05391ef90e680e054f7f022fa
  305 +:08130900e4f541d2e9d2af2264
  306 +:1010f70090e678e020e6f9c2e990e678e04480f0ef
  307 +:10110700ef25e090e679f090e678e030e0f990e6b8
  308 +:1011170078e04440f090e678e020e6f990e678e061
  309 +:0611270030e1d6d2e922fe
  310 +:1011c800a90790e678e020e6f9e541702390e678f3
  311 +:1011d800e04480f0e925e090e679f08d3caf03a982
  312 +:1011e80007753d018a3e893fe4f540754101d322e8
  313 +:0211f800c32210
  314 +:10116200a90790e678e020e6f9e541702590e67857
  315 +:10117200e04480f0e925e0440190e679f08d3caf4f
  316 +:1011820003a907753d018a3e893fe4f54075410395
  317 +:04119200d322c3227f
  318 +:03004b00020a7333
  319 +:100a7300c0e0c083c082c085c084c086758600c0c4
  320 +:100a8300d075d000c000c001c002c003c006c007bb
  321 +:100a930090e678e030e206754106020b5d90e67859
  322 +:100aa300e020e10ce54164026006754107020b5d3d
  323 +:100ab300e54124fe605f14603624fe7003020b4e92
  324 +:100ac30024fc7003020b5a24086003020b5dab3d48
  325 +:100ad300aa3ea93faf4005408f82758300120e9254
  326 +:100ae30090e679f0e540653c7070754105806b9048
  327 +:100af300e679e0ab3daa3ea93fae408e8275830006
  328 +:100b0300120ebf754102e53c6401704e90e678e039
  329 +:100b13004420f08045e53c24feb5400790e678e0ac
  330 +:100b23004420f0e53c14b5400a90e678e04440f0f8
  331 +:100b330075410090e679e0ab3daa3ea93fae408ef9
  332 +:100b430082758300120ebf0540800f90e678e04463
  333 +:100b530040f075410080037541005391dfd007d009
  334 +:100b630006d003d002d001d000d0d0d086d084d01c
  335 +:080b730085d082d083d0e0326e
  336 +:02125500a907e7
  337 +:10125700ae16af178f828e83a3e064037017ad01bc
  338 +:1012670019ed7001228f828e83e07c002ffdec3e0a
  339 +:09127700feaf0580df7e007f0060
  340 +:01128000224b
  341 +:100bdd00121162e54124fa600e146006240770f3c9
  342 +:0c0bed00d322e4f541d322e4f541d322e9
  343 +:100dde001211c8e54124fa600e146006240770f360
  344 +:0c0dee00d322e4f541d322e4f541d322e6
  345 +:101006008e2d8f2e90e600e054187012e52e2401e6
  346 +:10101600ffe4352dc313f52def13f52e801590e65d
  347 +:1010260000e05418ffbf100be52e25e0f52ee52d48
  348 +:1010360033f52de52e152eae2d7002152d4e6005bd
  349 +:0610460012001780ee22eb
  350 +:100017007400f58690fda57c05a3e582458370f9fc
  351 +:0100270022b6
  352 +:03004300020c00ac
  353 +:03005300020c009c
  354 +:100c0000021281000212c7000212b1000212990002
  355 +:100c1000021089000210c00002002a000200320007
  356 +:100c20000200420002004a0002005200020bf900da
  357 +:100c3000020bfa00020bfb00020bfc00020bfd0092
  358 +:100c4000020bfe0002003200020bff00020dfa0050
  359 +:100c5000020dfb00020dfc00020dfd00020dfe0066
  360 +:100c6000020dff00020032000200320002003200da
  361 +:100c700002131100021312000213130002131400d6
  362 +:100c800002131500021316000213170002131800b6
  363 +:100c90000213190002131a0002131b0002131c0096
  364 +:100ca00002131d0002131e0002131f000213200076
  365 +:080cb0000213210002132200cf
  366 +:03000000020d529c
  367 +:0c0d5200787fe4f6d8fd758141020d9910
  368 +:100e9200bb010ce58229f582e5833af583e0225015
  369 +:100ea20006e92582f8e622bbfe06e92582f8e2225f
  370 +:0d0eb200e58229f582e5833af583e4932279
  371 +:100ebf00f8bb010de58229f582e5833af583e8f069
  372 +:100ecf00225006e92582c8f622bbfe05e92582c815
  373 +:020edf00f222fd
  374 +:100ee100eb9ff5f0ea9e42f0e99d42f0e89c45f067
  375 +:010ef10022de
  376 +:100ef200d083d082f8e4937012740193700da3a38f
  377 +:100f020093f8740193f5828883e4737402936860a2
  378 +:060f1200efa3a3a380dfa2
  379 +:100d5e00020773e493a3f8e493a34003f68001f231
  380 +:100d6e0008dff48029e493a3f85407240cc8c33396
  381 +:100d7e00c4540f4420c8834004f456800146f6df65
  382 +:100d8e00e4800b010204081020408090095ee47e8e
  383 +:100d9e00019360bca3ff543f30e509541ffee4935a
  384 +:100dae00a360010ecf54c025e060a840b8e493a321
  385 +:100dbe00fae493a3f8e493a3c8c582c8cac583ca4c
  386 +:100dce00f0a3c8c582c8cac583cadfe9dee780be04
  387 +:010a72000083
  388 +:03009b0002038cd1
  389 +:1002f50003580103500203480403400803700a032e
  390 +:10030500380c03301003681403281803211e031d3d
  391 +:0e03150030036032000003d374ea800274aa41
  392 +:0f032300751a01805e79017a017b0980467901a4
  393 +:100332007a017b01803e79017a027b018036790263
  394 +:100342007a037b01802e79057a067b018026790b60
  395 +:100352007a0c7b01801e79177a187b018016792f1f
  396 +:100362007a307b01800e79777a787b01800679ef8b
  397 +:100372007af07b0190e040e9f0a3eaf0a3ebf0e42d
  398 +:0f038200f51a74ca90e601f08047e490e68af01d
  399 +:0f03910090e68bf090e6a0e020e1f990e740e0e5
  400 +:0f03a000600a94035006240a90e61af00204d76c
  401 +:010b940082de
  402 +:010b9a0086d4
  403 +:010cf0008281
  404 +:010cf6008677
  405 +:00000001ff
... ...
firmware/dso6022be-loader.hex 0 → 100644
  1 +:1003680090E668E0FF74FFF0E0B40B04EFF0D322EE
  2 +:0603780090E668EFF0C3FF
  3 +:01037E00225C
  4 +:1001B500907FE9E064A360030202C5A3E07508002F
  5 +:1001C500F509A3E0FEE4EE4208907FEEE0750A0033
  6 +:1001D500F50BA3E0FEE4EE420A907FE8E064407090
  7 +:1001E50064E50B450A70030202D6E4907FC5F090E2
  8 +:1001F5007FB4E020E3F9907FC5E0750C00F50DE4D0
  9 +:10020500FCFDC3ED950DEC950C501F74C02DF582CA
  10 +:10021500E4347EF583E0FFE5092DF582E5083CF53C
  11 +:1002250083EFF00DBD00010C80D8E50D2509F5091A
  12 +:10023500E50C3508F508C3E50B950DF50BE50A95B5
  13 +:100245000CF50A809C907FE8E064C060030202D64A
  14 +:10025500E50B450A607BC3E50B9440E50A94005025
  15 +:1002650008850A0C850B0D8006750C00750D40E49C
  16 +:10027500FCFDC3ED950DEC950C501FE5092DF582A0
  17 +:10028500E5083CF583E0FF74002DF582E4347FF545
  18 +:1002950083EFF00DBD00010C80D8907FB5E50DF022
  19 +:1002A5002509F509E50C3508F508C3E50B950DF5A8
  20 +:1002B5000BE50A950CF50A907FB4E030E29280F7E1
  21 +:1002C500907FE9E0B4AC0AE4907F00F0907FB5043C
  22 +:0802D500F0907FB4E04402F058
  23 +:0102DD0022FE
  24 +:1000800090E6B9E064A36003020198A3E07508005C
  25 +:10009000F509A3E0FEE4EE420890E6BEE0750A0032
  26 +:1000A000F50BA3E0FEE4EE420A90E6B8E06440708F
  27 +:1000B00066E50B450A70030201ADE490E68AF0A301
  28 +:1000C000F090E6A0E020E1F990E68BE0750C00F5F9
  29 +:1000D0000DE4FCFDC3ED950DEC950C501F74402D07
  30 +:1000E000F582E434E7F583E0FFE5092DF582E508C4
  31 +:1000F0003CF583EFF00DBD00010C80D8E50D25091E
  32 +:10010000F509E50C3508F508C3E50B950DF50BE58C
  33 +:100110000A950CF50A809A90E6B8E064C060030284
  34 +:1001200001ADE50B450A70030201ADC3E50B944038
  35 +:10013000E50A94005008850A0C850B0D8006750CA5
  36 +:1001400000750D40E4FCFDC3ED950DEC950C501FC2
  37 +:10015000E5092DF582E5083CF583E0FF74402DF5B7
  38 +:1001600082E434E7F583EFF00DBD00010C80D8E4A4
  39 +:1001700090E68AF0A3E50DF02509F509E50C3508B0
  40 +:10018000F508C3E50B950DF50BE50A950CF50A90FE
  41 +:10019000E6A0E030E18C80F790E6B9E0B4AC0E90D8
  42 +:1001A000E7407401F0E490E68AF0A304F090E6A042
  43 +:0401B000E04480F0B7
  44 +:0101B4002228
  45 +:1002DE00C2011203689200907F95E044C0F0D2E80C
  46 +:1002EE0030000890E65D74FFF08006907FAB74FFDF
  47 +:1002FE00F030000890E6687408F08007907FAFE059
  48 +:10030E004401F030000890E65C7401F08006907FA6
  49 +:10031E00AE7401F0D2AF3001FD30000512008080C6
  50 +:08032E00031201B5C20180EECB
  51 +:03000300020336BF
  52 +:10033600C0E0C083C082C085C084C086758600D2F6
  53 +:10034600015391EF30000890E65D7401F08006904D
  54 +:100356007FAB7401F0D086D084D085D082D083D094
  55 +:02036600E03283
  56 +:03004300020400B4
  57 +:0404000002033600BD
  58 +:0300000002037F79
  59 +:0C037F00787FE4F6D8FD7581200202DED4
  60 +:00000001FF
... ...
openhantek/src/configpages.cpp
... ... @@ -165,6 +165,39 @@ DsoConfigColorsPage::DsoConfigColorsPage(DsoSettings *settings, QWidget *parent)
165 165 this->screenGroup = new QGroupBox(tr("Screen"));
166 166 this->screenGroup->setLayout(this->screenLayout);
167 167  
  168 + // Print category
  169 + this->printAxesLabel = new QLabel(tr("Axes"));
  170 + this->printAxesColorBox = new ColorBox(this->settings->view.color.print.axes);
  171 + this->printBackgroundLabel = new QLabel(tr("Background"));
  172 + this->printBackgroundColorBox = new ColorBox(this->settings->view.color.print.background);
  173 + this->printBorderLabel = new QLabel(tr("Border"));
  174 + this->printBorderColorBox = new ColorBox(this->settings->view.color.print.border);
  175 + this->printGridLabel = new QLabel(tr("Grid"));
  176 + this->printGridColorBox = new ColorBox(this->settings->view.color.print.grid);
  177 + this->printMarkersLabel = new QLabel(tr("Markers"));
  178 + this->printMarkersColorBox = new ColorBox(this->settings->view.color.print.markers);
  179 + this->printTextLabel = new QLabel(tr("Text"));
  180 + this->printTextColorBox = new ColorBox(this->settings->view.color.print.text);
  181 +
  182 + this->printLayout = new QGridLayout();
  183 + this->printLayout->setColumnStretch(0, 1);
  184 + this->printLayout->setColumnMinimumWidth(1, 80);
  185 + this->printLayout->addWidget(this->printBackgroundLabel, 0, 0);
  186 + this->printLayout->addWidget(this->printBackgroundColorBox, 0, 1);
  187 + this->printLayout->addWidget(this->printGridLabel, 1, 0);
  188 + this->printLayout->addWidget(this->printGridColorBox, 1, 1);
  189 + this->printLayout->addWidget(this->printAxesLabel, 2, 0);
  190 + this->printLayout->addWidget(this->printAxesColorBox, 2, 1);
  191 + this->printLayout->addWidget(this->printBorderLabel, 3, 0);
  192 + this->printLayout->addWidget(this->printBorderColorBox, 3, 1);
  193 + this->printLayout->addWidget(this->printMarkersLabel, 4, 0);
  194 + this->printLayout->addWidget(this->printMarkersColorBox, 4, 1);
  195 + this->printLayout->addWidget(this->printTextLabel, 5, 0);
  196 + this->printLayout->addWidget(this->printTextColorBox, 5, 1);
  197 +
  198 + this->printGroup = new QGroupBox(tr("Print"));
  199 + this->printGroup->setLayout(this->printLayout);
  200 +
168 201 // Graph category
169 202 this->channelLabel = new QLabel(tr("Channel"));
170 203 this->channelLabel->setAlignment(Qt::AlignHCenter);
... ... @@ -194,6 +227,7 @@ DsoConfigColorsPage::DsoConfigColorsPage(DsoSettings *settings, QWidget *parent)
194 227 // Main layout
195 228 this->mainLayout = new QVBoxLayout();
196 229 this->mainLayout->addWidget(this->screenGroup);
  230 + this->mainLayout->addWidget(this->printGroup);
197 231 this->mainLayout->addWidget(this->graphGroup);
198 232 this->mainLayout->addStretch(1);
199 233  
... ... @@ -214,6 +248,14 @@ void DsoConfigColorsPage::saveSettings() {
214 248 this->settings->view.color.screen.markers = this->markersColorBox->getColor();
215 249 this->settings->view.color.screen.text = this->textColorBox->getColor();
216 250  
  251 + // Print category
  252 + this->settings->view.color.print.axes = this->printAxesColorBox->getColor();
  253 + this->settings->view.color.print.background = this->printBackgroundColorBox->getColor();
  254 + this->settings->view.color.print.border = this->printBorderColorBox->getColor();
  255 + this->settings->view.color.print.grid = this->printGridColorBox->getColor();
  256 + this->settings->view.color.print.markers = this->printMarkersColorBox->getColor();
  257 + this->settings->view.color.print.text = this->printTextColorBox->getColor();
  258 +
217 259 // Graph category
218 260 for(int channel = 0; channel < this->settings->scope.voltage.count(); ++channel) {
219 261 this->settings->view.color.screen.voltage[channel] = this->channelColorBox[channel]->getColor();
... ...
openhantek/src/configpages.h
... ... @@ -102,6 +102,11 @@ class DsoConfigColorsPage : public QWidget {
102 102 QGridLayout *screenLayout;
103 103 QLabel *axesLabel, *backgroundLabel, *borderLabel, *gridLabel, *markersLabel, *textLabel;
104 104 ColorBox *axesColorBox, *backgroundColorBox, *borderColorBox, *gridColorBox, *markersColorBox, *textColorBox;
  105 +
  106 + QGroupBox *printGroup;
  107 + QGridLayout *printLayout;
  108 + QLabel *printAxesLabel, *printBackgroundLabel, *printBorderLabel, *printGridLabel, *printMarkersLabel, *printTextLabel;
  109 + ColorBox *printAxesColorBox, *printBackgroundColorBox, *printBorderColorBox, *printGridColorBox, *printMarkersColorBox, *printTextColorBox;
105 110  
106 111 QGroupBox *graphGroup;
107 112 QGridLayout *graphLayout;
... ...
openhantek/src/dockwindows.cpp
... ... @@ -210,6 +210,16 @@ void HorizontalDock::samplerateLimitsChanged(double minimum, double maximum) {
210 210 this->suppressSignals = false;
211 211 }
212 212  
  213 +/// \brief Updates the mode and steps of the samplerate spin box.
  214 +/// \param mode The mode value the spin box should accept.
  215 +/// \param steps The steps value the spin box should accept.
  216 +void HorizontalDock::samplerateSet(int mode, QList<double> steps) {
  217 + this->suppressSignals = true;
  218 + this->samplerateSiSpinBox->setMode(mode);
  219 + this->samplerateSiSpinBox->setSteps(steps);
  220 + this->suppressSignals = false;
  221 +}
  222 +
213 223 /// \brief Called when the frequencybase spinbox changes its value.
214 224 /// \param frequencybase The frequencybase in hertz.
215 225 void HorizontalDock::frequencybaseSelected(double frequencybase) {
... ... @@ -329,7 +339,7 @@ void TriggerDock::closeEvent(QCloseEvent *event) {
329 339 /// \param mode The trigger mode.
330 340 /// \return Index of mode-value, -1 on error.
331 341 int TriggerDock::setMode(Dso::TriggerMode mode) {
332   - if(mode >= Dso::TRIGGERMODE_AUTO && mode <=Dso:: TRIGGERMODE_SINGLE) {
  342 + if(mode >= Dso::TRIGGERMODE_AUTO && mode < Dso::TRIGGERMODE_COUNT) {
333 343 this->modeComboBox->setCurrentIndex(mode);
334 344 return mode;
335 345 }
... ...
openhantek/src/dockwindows.h
... ... @@ -84,6 +84,7 @@ class HorizontalDock : public QDockWidget {
84 84 public slots:
85 85 void availableRecordLengthsChanged(const QList<unsigned int> &recordLengths);
86 86 void samplerateLimitsChanged(double minimum, double maximum);
  87 + void samplerateSet(int mode, QList<double> sampleSteps);
87 88  
88 89 protected slots:
89 90 void frequencybaseSelected(double frequencybase);
... ...
openhantek/src/dso.cpp
... ... @@ -100,6 +100,8 @@ namespace Dso {
100 100 return QApplication::tr("Normal");
101 101 case TRIGGERMODE_SINGLE:
102 102 return QApplication::tr("Single");
  103 + case TRIGGERMODE_SOFTWARE:
  104 + return QApplication::tr("Software");
103 105 default:
104 106 return QString();
105 107 }
... ...
openhantek/src/dso.h
... ... @@ -92,6 +92,7 @@ namespace Dso {
92 92 TRIGGERMODE_AUTO, ///< Automatic without trigger event
93 93 TRIGGERMODE_NORMAL, ///< Normal mode
94 94 TRIGGERMODE_SINGLE, ///< Stop after the first trigger event
  95 + TRIGGERMODE_SOFTWARE, ///< Software trigger mode
95 96 TRIGGERMODE_COUNT ///< The total number of modes
96 97 };
97 98  
... ...
openhantek/src/dsocontrol.h
... ... @@ -73,6 +73,7 @@ class DsoControl : public QThread {
73 73 void recordLengthChanged(unsigned long duration); ///< The record length has changed
74 74 void recordTimeChanged(double duration); ///< The record time duration has changed
75 75 void samplerateChanged(double samplerate); ///< The samplerate has changed
  76 + void samplerateSet(int mode, QList<double> sampleSteps); ///< The samplerate has changed
76 77  
77 78 public slots:
78 79 virtual void connectDevice();
... ...
openhantek/src/exporter.cpp
... ... @@ -216,7 +216,7 @@ bool Exporter::doExport() {
216 216 // Add graphs for channels
217 217 for(int channel = 0 ; channel < this->settings->scope.voltage.count(); ++channel) {
218 218 if(this->settings->scope.voltage[channel].used && this->dataAnalyzer->data(channel)) {
219   - painter.setPen(colorValues->voltage[channel]);
  219 + painter.setPen(QPen(colorValues->voltage[channel], 0));
220 220  
221 221 // What's the horizontal distance between sampling points?
222 222 double horizontalFactor = this->dataAnalyzer->data(channel)->samples.voltage.interval / this->settings->scope.horizontal.timebase;
... ... @@ -247,7 +247,7 @@ bool Exporter::doExport() {
247 247 // Add spectrum graphs
248 248 for (int channel = 0; channel < this->settings->scope.spectrum.count(); ++channel) {
249 249 if(this->settings->scope.spectrum[channel].used && this->dataAnalyzer->data(channel)) {
250   - painter.setPen(colorValues->spectrum[channel]);
  250 + painter.setPen(QPen(colorValues->spectrum[channel], 0));
251 251  
252 252 // What's the horizontal distance between sampling points?
253 253 double horizontalFactor = this->dataAnalyzer->data(channel)->samples.spectrum.interval / this->settings->scope.horizontal.frequencybase;
... ... @@ -296,7 +296,7 @@ bool Exporter::doExport() {
296 296 painter.setMatrix(QMatrix((paintDevice->width() - 1) / DIVS_TIME, 0, 0, -(scopeHeight - 1) / DIVS_VOLTAGE, (double) (paintDevice->width() - 1) / 2, (scopeHeight - 1) * (zoomed + 0.5) + lineHeight * 1.5 + lineHeight * 2.5 * zoomed), false);
297 297  
298 298 // Grid lines
299   - painter.setPen(colorValues->grid);
  299 + painter.setPen(QPen(colorValues->grid, 0));
300 300  
301 301 if(this->format < EXPORT_FORMAT_IMAGE) {
302 302 // Draw vertical lines
... ... @@ -342,7 +342,7 @@ bool Exporter::doExport() {
342 342 }
343 343  
344 344 // Axes
345   - painter.setPen(colorValues->axes);
  345 + painter.setPen(QPen(colorValues->axes, 0));
346 346 painter.drawLine(QPointF(-DIVS_TIME / 2, 0), QPointF(DIVS_TIME / 2, 0));
347 347 painter.drawLine(QPointF(0, -DIVS_VOLTAGE / 2), QPointF(0, DIVS_VOLTAGE / 2));
348 348 for(double div = 0.2; div <= DIVS_TIME / 2; div += 0.2) {
... ... @@ -355,7 +355,7 @@ bool Exporter::doExport() {
355 355 }
356 356  
357 357 // Borders
358   - painter.setPen(colorValues->border);
  358 + painter.setPen(QPen(colorValues->border, 0));
359 359 painter.drawRect(QRectF(-DIVS_TIME / 2, -DIVS_VOLTAGE / 2, DIVS_TIME, DIVS_VOLTAGE));
360 360 }
361 361  
... ...
openhantek/src/glgenerator.cpp
... ... @@ -87,9 +87,87 @@ void GlGenerator::generateGraphs() {
87 87 }
88 88  
89 89 this->dataAnalyzer->mutex()->lock();
90   -
  90 +
  91 + unsigned int preTrigSamples = 0;
  92 + unsigned int postTrigSamples = 0;
91 93 switch(this->settings->scope.horizontal.format) {
92 94 case Dso::GRAPHFORMAT_TY:
  95 + {
  96 + unsigned int swTriggerStart = 0;
  97 + // check trigger point for software trigger
  98 + if (this->settings->scope.trigger.mode == Dso::TRIGGERMODE_SOFTWARE && this->settings->scope.trigger.source <= 1) {
  99 + int channel = this->settings->scope.trigger.source;
  100 + if(this->settings->scope.voltage[channel].used && this->dataAnalyzer->data(channel) && !this->dataAnalyzer->data(channel)->samples.voltage.sample.empty()) {
  101 + double value;
  102 + double level = this->settings->scope.voltage[channel].trigger;
  103 + unsigned int sampleCount = this->dataAnalyzer->data(channel)->samples.voltage.sample.size();
  104 + double timeDisplay = this->settings->scope.horizontal.timebase*10;
  105 + double samplesDisplay = timeDisplay * this->settings->scope.horizontal.samplerate;
  106 + if (samplesDisplay >= sampleCount) {
  107 + // For sure not enough samples to adjust for jitter.
  108 + // Following options exist:
  109 + // 1: Decrease sample rate
  110 + // 2: Change trigger mode to auto
  111 + // 3: Ignore samples
  112 + // For now #3 is chosen
  113 +#ifdef DEBUG
  114 + Helper::timestampDebug(QString("Too few samples to make a steady picture. Decrease sample rate"));
  115 +#endif
  116 + this->dataAnalyzer->mutex()->unlock();
  117 + return;
  118 + }
  119 + preTrigSamples = (this->settings->scope.trigger.position * samplesDisplay);
  120 + postTrigSamples = sampleCount - (samplesDisplay - preTrigSamples);
  121 + //std::vector<double>::const_iterator dataIterator = this->dataAnalyzer->data(channel)->samples.voltage.sample.begin();
  122 +
  123 + if (this->settings->scope.trigger.slope == Dso::SLOPE_POSITIVE) {
  124 + double prev = INT_MAX;
  125 + for (unsigned int i = preTrigSamples; i < postTrigSamples; i++) {
  126 + value = this->dataAnalyzer->data(channel)->samples.voltage.sample[i];
  127 + if (value > level && prev <= level) {
  128 + int rising = 0;
  129 + for (unsigned int k = i + 1; k < i + 11 && k < sampleCount; k++) {
  130 + if (this->dataAnalyzer->data(channel)->samples.voltage.sample[k] >= value) {
  131 + rising++;
  132 + }
  133 + }
  134 + if (rising > 7) {
  135 + swTriggerStart = i;
  136 + break;
  137 + }
  138 + }
  139 + prev = value;
  140 + }
  141 + }
  142 + else if (this->settings->scope.trigger.slope == Dso::SLOPE_NEGATIVE) {
  143 + double prev = INT_MIN;
  144 + for (unsigned int i = preTrigSamples; i < postTrigSamples; i++) {
  145 + value = this->dataAnalyzer->data(channel)->samples.voltage.sample[i];
  146 + if (value < level && prev >= level) {
  147 + int falling = 0;
  148 + for (unsigned int k = i + 1; k < i + 11 && k < sampleCount; k++) {
  149 + if (this->dataAnalyzer->data(channel)->samples.voltage.sample[k] < value) {
  150 + falling++;
  151 + }
  152 + }
  153 + if (falling > 7) {
  154 + swTriggerStart = i;
  155 + break;
  156 + }
  157 + }
  158 + prev = value;
  159 + }
  160 + }
  161 + }
  162 + if (swTriggerStart == 0) {
  163 +#ifdef DEBUG
  164 + Helper::timestampDebug(QString("Trigger not asserted. Data ignored"));
  165 +#endif
  166 + this->dataAnalyzer->mutex()->unlock();
  167 + return;
  168 + }
  169 + }
  170 +
93 171 // Add graphs for channels
94 172 for(int mode = Dso::CHANNELMODE_VOLTAGE; mode < Dso::CHANNELMODE_COUNT; ++mode) {
95 173 for(int channel = 0; channel < this->settings->scope.voltage.size(); ++channel) {
... ... @@ -97,11 +175,16 @@ void GlGenerator::generateGraphs() {
97 175 if(((mode == Dso::CHANNELMODE_VOLTAGE) ? this->settings->scope.voltage[channel].used : this->settings->scope.spectrum[channel].used) && this->dataAnalyzer->data(channel) && !this->dataAnalyzer->data(channel)->samples.voltage.sample.empty()) {
98 176 // Check if the sample count has changed
99 177 unsigned int sampleCount = (mode == Dso::CHANNELMODE_VOLTAGE) ? this->dataAnalyzer->data(channel)->samples.voltage.sample.size() : this->dataAnalyzer->data(channel)->samples.spectrum.sample.size();
  178 + if(mode == Dso::CHANNELMODE_VOLTAGE)
  179 + sampleCount -= (swTriggerStart - preTrigSamples);
100 180 unsigned int neededSize = sampleCount * 2;
  181 +
  182 +#if 0
101 183 for(unsigned int index = 0; index < this->digitalPhosphorDepth; ++index) {
102 184 if(this->vaChannel[mode][channel][index].size() != neededSize)
103 185 this->vaChannel[mode][channel][index].clear(); // Something was changed, drop old traces
104 186 }
  187 +#endif
105 188  
106 189 // Set size directly to avoid reallocations
107 190 this->vaChannel[mode][channel].front().resize(neededSize);
... ... @@ -122,6 +205,8 @@ void GlGenerator::generateGraphs() {
122 205 const double gain = this->settings->scope.voltage[channel].gain;
123 206 const double offset = this->settings->scope.voltage[channel].offset;
124 207  
  208 + std::advance(dataIterator, swTriggerStart-preTrigSamples);
  209 +
125 210 for(unsigned int position = 0; position < sampleCount; ++position) {
126 211 *(glIterator++) = position * horizontalFactor - DIVS_TIME / 2;
127 212 *(glIterator++) = *(dataIterator++) / gain + offset;
... ... @@ -145,6 +230,7 @@ void GlGenerator::generateGraphs() {
145 230 }
146 231 }
147 232 }
  233 + }
148 234 break;
149 235  
150 236 case Dso::GRAPHFORMAT_XY:
... ...
openhantek/src/hantek/control.cpp
... ... @@ -351,6 +351,9 @@ namespace Hantek {
351 351 else {
352 352 // Normal mode, channels are using their separate buffers
353 353 sampleCount = totalSampleCount / HANTEK_CHANNELS;
  354 + // if device is 6022BE, drop first 1000 samples
  355 + if (this->device->getModel() == MODEL_DSO6022BE)
  356 + sampleCount -= 1000;
354 357 for(int channel = 0; channel < HANTEK_CHANNELS; ++channel) {
355 358 if(this->settings.voltage[channel].used) {
356 359 // Resize sample vector
... ... @@ -372,8 +375,11 @@ namespace Hantek {
372 375 }
373 376 }
374 377 else {
375   - if (this->device->getModel() == MODEL_DSO6022BE)
  378 + if (this->device->getModel() == MODEL_DSO6022BE) {
376 379 bufferPosition += channel;
  380 + // if device is 6022BE, offset 1000 incrementally
  381 + bufferPosition += 1000 * 2;
  382 + }
377 383 else
378 384 bufferPosition += HANTEK_CHANNELS - 1 - channel;
379 385  
... ... @@ -857,12 +863,12 @@ namespace Hantek {
857 863 for(int control = 0; control <= lastControlIndex; ++control)
858 864 this->controlPending[control] = true;
859 865  
860   - // Disable controls not supported by 6022BE
861   - if (this->device->getModel() == MODEL_DSO6022BE) {
862   - this->controlPending[CONTROLINDEX_SETOFFSET] = false;
863   - this->controlPending[CONTROLINDEX_SETRELAYS] = false;
864   - }
865   -
  866 + // Disable controls not supported by 6022BE
  867 + if (this->device->getModel() == MODEL_DSO6022BE) {
  868 + this->controlPending[CONTROLINDEX_SETOFFSET] = false;
  869 + this->controlPending[CONTROLINDEX_SETRELAYS] = false;
  870 + }
  871 +
866 872 // Maximum possible samplerate for a single channel and dividers for record lengths
867 873 this->specification.bufferDividers.clear();
868 874 this->specification.samplerate.single.recordLengths.clear();
... ... @@ -935,13 +941,13 @@ namespace Hantek {
935 941 break;
936 942  
937 943 case MODEL_DSO6022BE:
938   - this->specification.samplerate.single.base = 48e6;
  944 + this->specification.samplerate.single.base = 1e6;
939 945 this->specification.samplerate.single.max = 48e6;
940   - this->specification.samplerate.single.maxDownsampler = 1;
  946 + this->specification.samplerate.single.maxDownsampler = 10;
941 947 this->specification.samplerate.single.recordLengths << UINT_MAX << 10240 << 32768;
942   - this->specification.samplerate.multi.base = 48e6;
  948 + this->specification.samplerate.multi.base = 1e6;
943 949 this->specification.samplerate.multi.max = 48e6;
944   - this->specification.samplerate.multi.maxDownsampler = 1;
  950 + this->specification.samplerate.multi.maxDownsampler = 10;
945 951 this->specification.samplerate.multi.recordLengths << UINT_MAX << 20480 << 65536;
946 952 this->specification.bufferDividers << 1000 << 1 << 1;
947 953 this->specification.gainSteps
... ... @@ -951,8 +957,12 @@ namespace Hantek {
951 957 this->specification.voltageLimit[channel]
952 958 << 25 << 51 << 103 << 206 << 412 << 196 << 392 << 784 << 1000;
953 959 // Divider. Tested and calculated results are different!
954   - //this->specification.gainDiv
955   - // << 10 << 10 << 10 << 10 << 10 << 2 << 2 << 2 << 1;
  960 + this->specification.gainDiv
  961 + << 10 << 10 << 10 << 10 << 10 << 2 << 2 << 2 << 1;
  962 + this->specification.sampleSteps
  963 + << 1e5 << 2e5 << 5e5 << 1e6 << 2e6 << 4e6 << 8e6 << 16e6 << 24e6 << 48e6;
  964 + this->specification.sampleDiv
  965 + << 10 << 20 << 50 << 1 << 2 << 4 << 8 << 16 << 24 << 48;
956 966 this->specification.sampleSize = 8;
957 967 break;
958 968  
... ... @@ -996,6 +1006,12 @@ namespace Hantek {
996 1006 if(this->settings.samplerate.limits->recordLengths[this->settings.recordLengthId] != UINT_MAX)
997 1007 emit recordTimeChanged((double) this->settings.samplerate.limits->recordLengths[this->settings.recordLengthId] / this->settings.samplerate.current);
998 1008 emit samplerateChanged(this->settings.samplerate.current);
  1009 +
  1010 + if(this->device->getModel() == MODEL_DSO6022BE) {
  1011 + QList<double> sampleSteps;
  1012 + sampleSteps << 1.0 << 2.0 << 5.0 << 10.0 << 20.0 << 40.0 << 80.0 << 160.0 << 240.0 << 480.0;
  1013 + emit samplerateSet(1, sampleSteps);
  1014 + }
999 1015  
1000 1016 DsoControl::connectDevice();
1001 1017 }
... ... @@ -1032,18 +1048,36 @@ namespace Hantek {
1032 1048 this->settings.samplerate.target.samplerateSet = true;
1033 1049 }
1034 1050  
1035   - // When possible, enable fast rate if it is required to reach the requested samplerate
1036   - bool fastRate = (this->settings.usedChannels <= 1) && (samplerate > this->specification.samplerate.single.max / this->specification.bufferDividers[this->settings.recordLengthId]);
1037   -
1038   - // What is the nearest, at least as high samplerate the scope can provide?
1039   - unsigned int downsampler = 0;
1040   - double bestSamplerate = getBestSamplerate(samplerate, fastRate, false, &(downsampler));
1041   -
1042   - // Set the calculated samplerate
1043   - if(this->updateSamplerate(downsampler, fastRate) == UINT_MAX)
1044   - return 0.0;
1045   - else {
1046   - return bestSamplerate;
  1051 + if (this->device->getModel() != MODEL_DSO6022BE) {
  1052 + // When possible, enable fast rate if it is required to reach the requested samplerate
  1053 + bool fastRate = (this->settings.usedChannels <= 1) && (samplerate > this->specification.samplerate.single.max / this->specification.bufferDividers[this->settings.recordLengthId]);
  1054 +
  1055 + // What is the nearest, at least as high samplerate the scope can provide?
  1056 + unsigned int downsampler = 0;
  1057 + double bestSamplerate = getBestSamplerate(samplerate, fastRate, false, &(downsampler));
  1058 +
  1059 + // Set the calculated samplerate
  1060 + if(this->updateSamplerate(downsampler, fastRate) == UINT_MAX)
  1061 + return 0.0;
  1062 + else {
  1063 + return bestSamplerate;
  1064 + }
  1065 + } else {
  1066 + int sampleId;
  1067 + for(sampleId = 0; sampleId < this->specification.sampleSteps.count() - 1; ++sampleId)
  1068 + if(this->specification.sampleSteps[sampleId] == samplerate)
  1069 + break;
  1070 + this->controlCode[CONTROLINDEX_SETTIMEDIV] = CONTROL_SETTIMEDIV;
  1071 + static_cast<ControlSetTimeDIV *>(this->control[CONTROLINDEX_SETTIMEDIV])->setDiv(this->specification.sampleDiv[sampleId]);
  1072 + this->controlPending[CONTROLINDEX_SETTIMEDIV] = true;
  1073 + this->settings.samplerate.current = samplerate;
  1074 +
  1075 + // Check for Roll mode
  1076 + if(this->settings.samplerate.limits->recordLengths[this->settings.recordLengthId] != UINT_MAX)
  1077 + emit recordTimeChanged((double) this->settings.samplerate.limits->recordLengths[this->settings.recordLengthId] / this->settings.samplerate.current);
  1078 + emit samplerateChanged(this->settings.samplerate.current);
  1079 +
  1080 + return samplerate;
1047 1081 }
1048 1082 }
1049 1083  
... ... @@ -1062,21 +1096,44 @@ namespace Hantek {
1062 1096 this->settings.samplerate.target.samplerateSet = false;
1063 1097 }
1064 1098  
1065   - // Calculate the maximum samplerate that would still provide the requested duration
1066   - double maxSamplerate = (double) this->specification.samplerate.single.recordLengths[this->settings.recordLengthId] / duration;
1067   -
1068   - // When possible, enable fast rate if the record time can't be set that low to improve resolution
1069   - bool fastRate = (this->settings.usedChannels <= 1) && (maxSamplerate >= this->specification.samplerate.multi.base / this->specification.bufferDividers[this->settings.recordLengthId]);
1070   -
1071   - // What is the nearest, at most as high samplerate the scope can provide?
1072   - unsigned int downsampler = 0;
1073   - double bestSamplerate = getBestSamplerate(maxSamplerate, fastRate, true, &(downsampler));
1074   -
1075   - // Set the calculated samplerate
1076   - if(this->updateSamplerate(downsampler, fastRate) == UINT_MAX)
1077   - return 0.0;
1078   - else {
1079   - return (double) this->settings.samplerate.limits->recordLengths[this->settings.recordLengthId] / bestSamplerate;
  1099 + if (this->device->getModel() != MODEL_DSO6022BE) {
  1100 + // Calculate the maximum samplerate that would still provide the requested duration
  1101 + double maxSamplerate = (double) this->specification.samplerate.single.recordLengths[this->settings.recordLengthId] / duration;
  1102 +
  1103 + // When possible, enable fast rate if the record time can't be set that low to improve resolution
  1104 + bool fastRate = (this->settings.usedChannels <= 1) && (maxSamplerate >= this->specification.samplerate.multi.base / this->specification.bufferDividers[this->settings.recordLengthId]);
  1105 +
  1106 + // What is the nearest, at most as high samplerate the scope can provide?
  1107 + unsigned int downsampler = 0;
  1108 + double bestSamplerate = getBestSamplerate(maxSamplerate, fastRate, true, &(downsampler));
  1109 +
  1110 + // Set the calculated samplerate
  1111 + if(this->updateSamplerate(downsampler, fastRate) == UINT_MAX)
  1112 + return 0.0;
  1113 + else {
  1114 + return (double) this->settings.samplerate.limits->recordLengths[this->settings.recordLengthId] / bestSamplerate;
  1115 + }
  1116 + } else {
  1117 + // For now - we go for the 10240 size sampling - the other seems not to be supported
  1118 + // Find highest samplerate using less than 10240 samples to obtain our duration.
  1119 + // Better add some margin for our SW trigger
  1120 + unsigned int sampleMargin = 2000;
  1121 + unsigned int sampleCount = 10240;
  1122 + int bestId = 0;
  1123 + int sampleId;
  1124 + for(sampleId = 0; sampleId < this->specification.sampleSteps.count(); ++sampleId) {
  1125 + if (this->specification.sampleSteps[sampleId] * duration < (sampleCount - sampleMargin))
  1126 + bestId = sampleId;
  1127 + }
  1128 + sampleId = bestId;
  1129 + // Usable sample value
  1130 + this->controlCode[CONTROLINDEX_SETTIMEDIV] = CONTROL_SETTIMEDIV;
  1131 + static_cast<ControlSetTimeDIV *>(this->control[CONTROLINDEX_SETTIMEDIV])->setDiv(this->specification.sampleDiv[sampleId]);
  1132 + this->controlPending[CONTROLINDEX_SETTIMEDIV] = true;
  1133 + this->settings.samplerate.current = this->specification.sampleSteps[sampleId];
  1134 +
  1135 + emit samplerateChanged(this->settings.samplerate.current);
  1136 + return this->settings.samplerate.current;
1080 1137 }
1081 1138 }
1082 1139  
... ... @@ -1164,8 +1221,10 @@ namespace Hantek {
1164 1221 // Dso::ERROR_NONE;
1165 1222  
1166 1223 // SetRelays control command for coupling relays
1167   - static_cast<ControlSetRelays *>(this->control[CONTROLINDEX_SETRELAYS])->setCoupling(channel, coupling != Dso::COUPLING_AC);
1168   - this->controlPending[CONTROLINDEX_SETRELAYS] = true;
  1224 + if (this->device->getModel() != MODEL_DSO6022BE) {
  1225 + static_cast<ControlSetRelays *>(this->control[CONTROLINDEX_SETRELAYS])->setCoupling(channel, coupling != Dso::COUPLING_AC);
  1226 + this->controlPending[CONTROLINDEX_SETRELAYS] = true;
  1227 + }
1169 1228  
1170 1229 return Dso::ERROR_NONE;
1171 1230 }
... ... @@ -1186,17 +1245,29 @@ namespace Hantek {
1186 1245 for(gainId = 0; gainId < this->specification.gainSteps.count() - 1; ++gainId)
1187 1246 if(this->specification.gainSteps[gainId] >= gain)
1188 1247 break;
1189   -
1190   - // SetGain bulk command for gain
1191   - static_cast<BulkSetGain *>(this->command[BULK_SETGAIN])->setGain(channel, this->specification.gainIndex[gainId]);
1192   - this->commandPending[BULK_SETGAIN] = true;
1193   -
1194   - // SetRelays control command for gain relays
1195   - ControlSetRelays *controlSetRelays = static_cast<ControlSetRelays *>(this->control[CONTROLINDEX_SETRELAYS]);
1196   - controlSetRelays->setBelow1V(channel, gainId < 3);
1197   - controlSetRelays->setBelow100mV(channel, gainId < 6);
1198   - this->controlPending[CONTROLINDEX_SETRELAYS] = true;
1199   -
  1248 +
  1249 + // Fixme, shoulb be some kind of protocol check instead of model check.
  1250 + if (this->device->getModel() == MODEL_DSO6022BE) {
  1251 + if (channel == 0) {
  1252 + static_cast<ControlSetVoltDIV_CH1 *>(this->control[CONTROLINDEX_SETVOLTDIV_CH1])->setDiv(this->specification.gainDiv[gainId]);
  1253 + this->controlPending[CONTROLINDEX_SETVOLTDIV_CH1] = true;
  1254 + } else if (channel == 1) {
  1255 + static_cast<ControlSetVoltDIV_CH2 *>(this->control[CONTROLINDEX_SETVOLTDIV_CH2])->setDiv(this->specification.gainDiv[gainId]);
  1256 + this->controlPending[CONTROLINDEX_SETVOLTDIV_CH2] = true;
  1257 + } else
  1258 + qDebug("%s: Unsuported channel: %i\n", __func__, channel);
  1259 + } else {
  1260 + // SetGain bulk command for gain
  1261 + static_cast<BulkSetGain *>(this->command[BULK_SETGAIN])->setGain(channel, this->specification.gainIndex[gainId]);
  1262 + this->commandPending[BULK_SETGAIN] = true;
  1263 +
  1264 + // SetRelays control command for gain relays
  1265 + ControlSetRelays *controlSetRelays = static_cast<ControlSetRelays *>(this->control[CONTROLINDEX_SETRELAYS]);
  1266 + controlSetRelays->setBelow1V(channel, gainId < 3);
  1267 + controlSetRelays->setBelow100mV(channel, gainId < 6);
  1268 + this->controlPending[CONTROLINDEX_SETRELAYS] = true;
  1269 + }
  1270 +
1200 1271 this->settings.voltage[channel].gain = gainId;
1201 1272  
1202 1273 this->setOffset(channel, this->settings.voltage[channel].offset);
... ... @@ -1223,8 +1294,12 @@ namespace Hantek {
1223 1294 double offsetReal = (double) (offsetValue - minimum) / (maximum - minimum);
1224 1295  
1225 1296 // SetOffset control command for channel offset
1226   - static_cast<ControlSetOffset *>(this->control[CONTROLINDEX_SETOFFSET])->setChannel(channel, offsetValue);
1227   - this->controlPending[CONTROLINDEX_SETOFFSET] = true;
  1297 + // Don't set control command if 6022be.
  1298 + // Otherwise, pipe error messages will be appeared.
  1299 + if (this->device->getModel() != MODEL_DSO6022BE) {
  1300 + static_cast<ControlSetOffset *>(this->control[CONTROLINDEX_SETOFFSET])->setChannel(channel, offsetValue);
  1301 + this->controlPending[CONTROLINDEX_SETOFFSET] = true;
  1302 + }
1228 1303  
1229 1304 this->settings.voltage[channel].offset = offset;
1230 1305 this->settings.voltage[channel].offsetReal = offsetReal;
... ... @@ -1240,7 +1315,7 @@ namespace Hantek {
1240 1315 if(!this->device->isConnected())
1241 1316 return Dso::ERROR_CONNECTION;
1242 1317  
1243   - if(mode < Dso::TRIGGERMODE_AUTO || mode > Dso::TRIGGERMODE_SINGLE)
  1318 + if(mode < Dso::TRIGGERMODE_AUTO || mode >= Dso::TRIGGERMODE_COUNT)
1244 1319 return Dso::ERROR_PARAMETER;
1245 1320  
1246 1321 this->settings.trigger.mode = mode;
... ... @@ -1335,7 +1410,8 @@ namespace Hantek {
1335 1410 unsigned short int levelValue = qBound((long int) minimum, (long int) ((this->settings.voltage[channel].offsetReal + level / this->specification.gainSteps[this->settings.voltage[channel].gain]) * (maximum - minimum) + 0.5) + minimum, (long int) maximum);
1336 1411  
1337 1412 // Check if the set channel is the trigger source
1338   - if(!this->settings.trigger.special && channel == this->settings.trigger.source) {
  1413 + if(!this->settings.trigger.special && channel == this->settings.trigger.source
  1414 + && this->device->getModel() != MODEL_DSO6022BE) {
1339 1415 // SetOffset control command for trigger level
1340 1416 static_cast<ControlSetOffset *>(this->control[CONTROLINDEX_SETOFFSET])->setTrigger(levelValue);
1341 1417 this->controlPending[CONTROLINDEX_SETOFFSET] = true;
... ...
openhantek/src/hantek/control.h
... ... @@ -143,6 +143,9 @@ namespace Hantek {
143 143 QList<unsigned short int> voltageLimit[HANTEK_CHANNELS];
144 144 /// The index of the selected gain on the hardware
145 145 QList<unsigned char> gainIndex;
  146 + QList<unsigned char> gainDiv;
  147 + QList<double> sampleSteps; ///< Available samplerate steps in s
  148 + QList<unsigned char> sampleDiv;
146 149 /// Calibration data for the channel offsets \todo Should probably be a QList too
147 150 unsigned short int offsetLimit[HANTEK_CHANNELS][9][OFFSET_COUNT];
148 151 };
... ...
openhantek/src/hantek/device.cpp
... ... @@ -249,7 +249,11 @@ namespace Hantek {
249 249 int Device::bulkCommand(Helper::DataArray<unsigned char> *command, int attempts) {
250 250 if(!this->handle)
251 251 return LIBUSB_ERROR_NO_DEVICE;
252   -
  252 +
  253 + // don't send bulk command if dso6022be
  254 + if (this->getModel() == MODEL_DSO6022BE)
  255 + return 0;
  256 +
253 257 // Send BeginCommand control command
254 258 int errorCode = this->controlWrite(CONTROL_BEGINCOMMAND, this->beginCommandControl->data(), this->beginCommandControl->getSize());
255 259 if(errorCode < 0)
... ...
openhantek/src/hantek/types.cpp
... ... @@ -1057,11 +1057,11 @@ namespace Hantek {
1057 1057 // class ControlSetTimeDIV
1058 1058 /// \brief Sets the data array to the default values.
1059 1059 ControlSetTimeDIV::ControlSetTimeDIV() : Helper::DataArray<uint8_t>(1) {
1060   - this->init();
  1060 + this->setDiv(1);
1061 1061 }
1062 1062  
1063   - void ControlSetTimeDIV::init() {
1064   - this->array[0] = 0x01;
  1063 + void ControlSetTimeDIV::setDiv(uint8_t val) {
  1064 + this->array[0] = val;
1065 1065 }
1066 1066  
1067 1067 //////////////////////////////////////////////////////////////////////////////
... ...
openhantek/src/hantek/types.h
... ... @@ -39,7 +39,7 @@
39 39 #define HANTEK_EP_OUT 0x02 ///< OUT Endpoint for bulk transfers
40 40 #define HANTEK_EP_IN 0x86 ///< IN Endpoint for bulk transfers
41 41 #define HANTEK_TIMEOUT 500 ///< Timeout for USB transfers in ms
42   -#define HANTEK_TIMEOUT_MULTI 10 ///< Timeout for multi packet USB transfers in ms
  42 +#define HANTEK_TIMEOUT_MULTI 100 ///< Timeout for multi packet USB transfers in ms
43 43 #define HANTEK_ATTEMPTS 3 ///< The number of transfer attempts
44 44 #define HANTEK_ATTEMPTS_MULTI 1 ///< The number of multi packet transfer attempts
45 45  
... ... @@ -1186,8 +1186,7 @@ namespace Hantek {
1186 1186 class ControlSetTimeDIV : public Helper::DataArray<uint8_t> {
1187 1187 public:
1188 1188 ControlSetTimeDIV();
1189   - private:
1190   - void init();
  1189 + void setDiv(uint8_t val);
1191 1190 };
1192 1191  
1193 1192 //////////////////////////////////////////////////////////////////////////////
... ...
openhantek/src/helper.cpp
... ... @@ -192,7 +192,7 @@ namespace Helper {
192 192 switch(unit) {
193 193 case UNIT_VOLTS: {
194 194 // Voltage string decoding
195   - if(unitString.startsWith('\265'))
  195 + if(unitString.startsWith("µ"))
196 196 return value * 1e-6;
197 197 else if(unitString.startsWith('m'))
198 198 return value * 1e-3;
... ...
openhantek/src/openhantek.cpp
... ... @@ -317,6 +317,7 @@ void OpenHantekMainWindow::connectSignals() {
317 317  
318 318 connect(this->dsoControl, SIGNAL(availableRecordLengthsChanged(QList<unsigned int>)), this->horizontalDock, SLOT(availableRecordLengthsChanged(QList<unsigned int>)));
319 319 connect(this->dsoControl, SIGNAL(samplerateLimitsChanged(double, double)), this->horizontalDock, SLOT(samplerateLimitsChanged(double, double)));
  320 + connect(this->dsoControl, SIGNAL(samplerateSet(int, QList<double>)), this->horizontalDock, SLOT(samplerateSet(int, QList<double>)));
320 321 }
321 322  
322 323 /// \brief Initialize the device with the current settings.
... ...
openhantek/src/sispinbox.cpp
... ... @@ -112,9 +112,9 @@ void SiSpinBox::stepBy(int steps) {
112 112  
113 113 if(!this->steppedTo) { // No step done directly before this one, so we need to check where we are
114 114 // Get how often the steps have to be fully ran through
115   - int stepsFully = (int) floor(log(this->value() / this->steps.first()) / log(stepsSpan));
  115 + int stepsFully = (this->mode == 0) ? (int) floor(log(this->value() / this->steps.first()) / log(stepsSpan)) : 0;
116 116 // And now the remaining multiple
117   - double stepMultiple = this->value() / pow(stepsSpan, stepsFully);
  117 + double stepMultiple = (this->mode == 0) ? this->value() / pow(stepsSpan, stepsFully) : this->value() / this->minimum();
118 118 // Now get the neighbours of the current value from our steps list
119 119 int remainingSteps = 0;
120 120 for(; remainingSteps <= stepsCount; ++remainingSteps) {
... ... @@ -132,10 +132,14 @@ void SiSpinBox::stepBy(int steps) {
132 132 int subStep = steps / abs(steps);
133 133 for (int i = 0; i != steps; i += subStep) {
134 134 this->stepId += subStep;
  135 + if (!this->mode) {
135 136 int stepsId = this->stepId % stepsCount;
136 137 if(stepsId < 0)
137 138 stepsId += stepsCount;
138 139 value = pow(stepsSpan, floor((double) this->stepId / stepsCount)) * this->steps[stepsId];
  140 + } else {
  141 + value = this->minimum() * this->steps[stepId];
  142 + }
139 143 if (value <= this->minimum() || value >= this->maximum())
140 144 break;
141 145 }
... ... @@ -167,6 +171,12 @@ void SiSpinBox::setSteps(const QList&lt;double&gt; &amp;steps) {
167 171 this->steps = steps;
168 172 }
169 173  
  174 +/// \brief Set the mode.
  175 +/// \param mode The mode, the value 0 will have fixed interval, otherwise the value will have interval within steps itself.
  176 +void SiSpinBox::setMode(const int mode) {
  177 + this->mode = mode;
  178 +}
  179 +
170 180 /// \brief Generic initializations.
171 181 void SiSpinBox::init() {
172 182 this->setMinimum(1e-12);
... ... @@ -178,6 +188,7 @@ void SiSpinBox::init() {
178 188  
179 189 this->steppedTo = false;
180 190 this->stepId = 0;
  191 + this->mode = 0;
181 192  
182 193 connect(this, SIGNAL(valueChanged(double)), this, SLOT(resetSteppedTo()));
183 194 }
... ...
openhantek/src/sispinbox.h
... ... @@ -56,6 +56,7 @@ class SiSpinBox : public QDoubleSpinBox
56 56 bool setUnit(Helper::Unit unit);
57 57 void setUnitPostfix(const QString &postfix);
58 58 void setSteps(const QList<double> &steps);
  59 + void setMode(const int mode);
59 60  
60 61 private:
61 62 void init();
... ... @@ -63,6 +64,8 @@ class SiSpinBox : public QDoubleSpinBox
63 64 Helper::Unit unit; ///< The SI unit used for this spin box
64 65 QString unitPostfix; ///< Shown after the unit
65 66 QList<double> steps; ///< The steps, begins from start after last element
  67 + int mode; ///< The mode, fixed or constant
  68 +
66 69  
67 70 bool steppedTo; ///< true, if the current value was reached using stepBy
68 71 int stepId; ///< The index of the last step reached using stepBy
... ...
readme.md
... ... @@ -18,16 +18,16 @@ Navigate to the [Releases](https://github.com/OpenHantek/openhantek/releases) pa
18 18  
19 19 ## Building OpenHantek from source
20 20 You need the following packages, to build OpenHantek from source:
21   -* CMake 3.0+
  21 +* CMake 3.5+
22 22 * Qt 5.3+
23 23 * FFTW 3+ (prebuild files will be downloaded on windows)
24   -* libusb 1.x (prebuild files will be downloaded on windows)
  24 +* libusb 1.x (prebuild files will be used on windows)
25 25  
26 26 For debian based systems (Ubuntu, Mint) install named requirements like this:
27   -> apt-get install cmake qttools5-dev qttools5-dev-tools libfftw3-dev binutils-dev libusb-1.0-0-dev
  27 +> apt-get install g++ cmake qttools5-dev qttools5-dev-tools libfftw3-dev binutils-dev libusb-1.0-0-dev
28 28  
29 29 For rpm based distributions (Fedora) use this command:
30   -> dnf install cmake qt5-qtbase-gui qt5-qttools-devel qt5-qttranslations fftw-devel binutils-devel libusb-devel
  30 +> dnf install cmake gcc-c++ qt5-qtbase-gui qt5-qttools-devel qt5-qttranslations fftw-devel binutils-devel libusb-devel
31 31  
32 32 For MacOSX use homebrew
33 33 > brew update <br>
... ... @@ -53,11 +53,28 @@ Your DSO does not store its firmware permanently -- the firmware has to be sent
53 53  
54 54 * You need binutils-dev autoconf automake fxload
55 55 * Install the `firmware/*.hex` files into `/usr/local/share/hantek/`.
  56 +
  57 +> mkdir -p /usr/local/share/hantek <br>
  58 +> cp -r firmware/*.hex /usr/local/share/hantek/
  59 +
56 60 * Install the `firmware/90-hantek.rules` file into `/etc/udev/rules.d/`.
57   -* install fxload (fxload is a program which downloads firmware to USB devices based on
58   - AnchorChips EZ-USB, Cypress EZ-USB FX, or Cypress EZ-USB FX2 microcontrollers.)
  61 +
  62 +> cp firmware/90-hantek.rules /etc/udev/rules.d/
  63 +
  64 +* install fxload (fxload is a program which downloads firmware to USB devices based on AnchorChips EZ-USB, Cypress EZ-USB FX, or Cypress EZ-USB FX2 microcontrollers.)
  65 +
  66 +> apt-get install fxload
  67 +
59 68 * Add your current user to the **plugdev** group.
60 69  
  70 +> usermod -a -G plugdev {user id}
  71 +
  72 +## For 6022BE
  73 +You can adjust samplerate and use software triggering for 6022BE.
  74 + - Support 48, 24, 16, 8, 4, 2, 1 M and 500, 200, 100 k Hz samplerates with modded firmware by [jhoenicke](https://github.com/rpcope1/Hantek6022API)
  75 + - Support software trigger by detecting rising or falling edge of signal. Use software trigger item on the trigger menu. For trigger level, adjust left arrow on the right-side of the graph.
  76 + - Note that I dropped first 1000 samples due to unstable/unusual reading.
  77 +
61 78 ## Contribute
62 79 Please use Github Issues to report any problems or enhancements or send us pull requests. Some random notes:
63 80 - Read [how to properly contribute to open source projects on GitHub][10].
... ...