-
Notifications
You must be signed in to change notification settings - Fork 0
/
FBQ_xcvr.py
executable file
·2530 lines (2225 loc) · 133 KB
/
FBQ_xcvr.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# SPDX-License-Identifier: GPL-3.0
#
# GNU Radio Python Flow Graph
# Title: SM6FBQ VHF transceiver
# Author: Christer Bernérus, SM6FBQ
# Copyright: This design is free to use under GPL2
# Description: VHF-UHF transceiver with CW and SSB
# GNU Radio version: 3.10.2.0
from packaging.version import Version as StrictVersion
if __name__ == '__main__':
import ctypes
import sys
if sys.platform.startswith('linux'):
try:
x11 = ctypes.cdll.LoadLibrary('libX11.so')
x11.XInitThreads()
except:
print("Warning: failed to XInitThreads()")
from PyQt5 import Qt
from PyQt5.QtCore import QObject, pyqtSlot
from gnuradio import eng_notation
from gnuradio import qtgui
from gnuradio.filter import firdes
import sip
from gnuradio import analog
from gnuradio import audio
from gnuradio import blocks
from gnuradio import filter
from gnuradio import gr
from gnuradio.fft import window
import sys
import signal
from argparse import ArgumentParser
from gnuradio.eng_arg import eng_float, intx
from gnuradio import soapy
from gnuradio import zeromq
from gnuradio.filter import pfb
from gnuradio.qtgui import Range, RangeWidget
from PyQt5 import QtCore
import FBQ_xcvr_epy_block_0_0 as epy_block_0_0 # embedded python block
import FBQ_xcvr_epy_block_1 as epy_block_1 # embedded python block
import FBQ_xcvr_epy_block_1_0 as epy_block_1_0 # embedded python block
import FBQ_xcvr_epy_block_2 as epy_block_2 # embedded python block
import FBQ_xcvr_msg_formatter as msg_formatter # embedded python block
import FBQ_xcvr_msg_formatter_0 as msg_formatter_0 # embedded python block
import FBQ_xcvr_msg_formatter_0_0 as msg_formatter_0_0 # embedded python block
import FBQ_xcvr_msg_formatter_0_0_0 as msg_formatter_0_0_0 # embedded python block
import FBQ_xcvr_msg_formatter_1 as msg_formatter_1 # embedded python block
import FBQ_xcvr_rx_distancer as rx_distancer # embedded python block
import FBQ_xcvr_tx_fq_sync as tx_fq_sync # embedded python block
import os
import time
import threading
def snipfcn_after_start(self):
self._band_selector_combo_box.removeItem(0)
for _label in self._band_selector_labels:
self._band_selector_combo_box.addItem(_label)
self._band_selector_callback = lambda i: Qt.QMetaObject.invokeMethod(self._band_selector_combo_box, "setCurrentIndex", Qt.Q_ARG("int", self._band_selector_options.index(i)))
self._band_selector_combo_box.currentIndexChanged.connect(
lambda i: self.set_band_selector(self._band_selector_options[i])
)
self._band_selector_combo_box.setCurrentIndex(22)
self.rx_distancer.desired_fq=self.ham_bands['144-FT8'][2]
def snipfcn_band_plan(self):
self.ham_bands = {
'50-CW': (50000000, 50100000, 50090000, 500, ['CW']),
'50-SSB': (50100000, 50300000, 50150000, 2700, ['CW', 'USB','LSB']),
'50-FT8': (50300000, 50400000, 50313000, 2700, ['MGM','FT8','USB']),
'50-PSK': (50300000, 50400000, 50305000, 2700, ['MGM','PSK','USB']),
'50-MSK': (50300000, 50400000, 50350000, 2700, ['MGM','MSK','USB']),
'50-B': (50400000, 50500000, 50450000, 1000, ['None']), # Beacons only
'50-FM': (50500000, 52000000, 51510000, 12000, ['FM', 'CW', 'SSB']),
'87-WBFM': (87500000, 108000000, 89300000, 200000, ['WBFM']), # FM broadcast
'LAV-VOR': (108000000, 137000000, 114600000, 4000,['AM']), # Air traffic
'LAV-ATIS': (108000000, 137000000, 118375000, 4000,['AM']), # Air traffic
'LAV-Ground-1': (108000000, 137000000, 121600000, 4000,['AM']), # Air traffic
'LAV-Ground-2': (108000000, 137000000, 121900000, 4000,['AM']), # Air traffic
'LAV-Tower-1': (108000000, 137000000, 118600000, 4000,['AM']), # Air traffic
'LAV-Tower-2': (108000000, 137000000, 123100000, 4000,['AM']), # Air traffic
'LAV-Approach-2': (108000000, 137000000, 123300000, 4000,['AM']), # Air traffic
'LAV-Approach-3': (108000000, 137000000, 124200000, 4000,['AM']), # Air traffic
'LAV-Approach-4': (108000000, 137000000, 124675000, 4000,['AM']), # Air traffic
'144-SAT': (144000000, 144025000, 144010000, 2700, ['None']), # Sat downlink,
'144-CW': (144025000, 144100000, 144050000, 500, ['CW']),
'144-MGM': (144100000, 144150000, 144116000, 500, ['CW', 'Q65', 'JT65'],'USB'),
'144-Q65': (144100000, 144150000, 144125000, 500, ['MGM','Q65','USB']),
'144-JT65': (144100000, 144150000, 144120000, 500, ['MGM','JT65','USB']),
'144-FT8': (144150000, 144400000, 144174000, 2700, ['MGM','USB']),
'144-SSB': (144150000, 144400000, 144300000, 2700, ['USB', 'CW', 'FT8', 'JT65', 'Q65','LSB']),
'144-MSK': (144150000, 144400000, 144360000, 2700, ['MGM','MSK','USB']),
'144-SK6VHF': (144400000, 144490000, 144406000,500, ['CW']), # Beacons
'144-SK4MPI': (144400000, 144490000, 144412000, 500, ['CW']), # Beacons
'144-SK1VHF': (144400000, 144490000, 144447000, 500, ['CW']), # Beacons
'144-LA8VHF': (144400000, 144490000, 144480000, 500, ['CW']), # Beacons
'144-OZ7IGY': (144400000, 144490000, 144471000, 500, ['CW']), # Beacons
'144-PB': (144491000, 144493000, 144492000, 500, ['CW', 'FT8']), # Personal beacons
'432-EME': (432000000, 432025000, 432010000, 500, ['CW']),
'432-CW': (432025000, 432100000, 432050000, 500, ['CW','PSK']),
'432-FT8': (432150000, 432400000, 432174000, 2700, ['MGM','FT8','USB']),
'432-SSB': (432100000, 432400000, 432200000, 2700, ['CW', 'USB']),
'432-FSK': (432100000, 432400000, 432370000, 2700, ['CW', 'USB', 'FSK441','LSB']),
'432-B': (432400000, 432490000, 432412170, 500, ['CW']), # Beacons 70cm / SK6UHF
'1296-B': (1296800000, 1296994000,1296811000, 500, ['CW']), # Beacons 23cm
}
self.ham_bands_keys = list(self.ham_bands)
self._band_selector_options = self.ham_bands_keys
self._band_selector_labels = self.ham_bands_keys
self._band_selector_combo_box.setMinimumContentsLength(10)
def find_valid_mode(self, valid_modes):
available_modes = self.mode.labels
print(available_modes)
print(valid_modes)
for mode in valid_modes:
if mode in available_modes:
return available_modes.index(mode)
return 0
def snippets_main_after_init(tb):
snipfcn_band_plan(tb)
def snippets_main_after_start(tb):
snipfcn_after_start(tb)
from gnuradio import qtgui
class FBQ_xcvr(gr.top_block, Qt.QWidget):
def __init__(self):
gr.top_block.__init__(self, "SM6FBQ VHF transceiver", catch_exceptions=True)
Qt.QWidget.__init__(self)
self.setWindowTitle("SM6FBQ VHF transceiver")
qtgui.util.check_set_qss()
try:
self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc'))
except:
pass
self.top_scroll_layout = Qt.QVBoxLayout()
self.setLayout(self.top_scroll_layout)
self.top_scroll = Qt.QScrollArea()
self.top_scroll.setFrameStyle(Qt.QFrame.NoFrame)
self.top_scroll_layout.addWidget(self.top_scroll)
self.top_scroll.setWidgetResizable(True)
self.top_widget = Qt.QWidget()
self.top_scroll.setWidget(self.top_widget)
self.top_layout = Qt.QVBoxLayout(self.top_widget)
self.top_grid_layout = Qt.QGridLayout()
self.top_layout.addLayout(self.top_grid_layout)
self.settings = Qt.QSettings("GNU Radio", "FBQ_xcvr")
try:
if StrictVersion(Qt.qVersion()) < StrictVersion("5.0.0"):
self.restoreGeometry(self.settings.value("geometry").toByteArray())
else:
self.restoreGeometry(self.settings.value("geometry"))
except:
pass
##################################################
# Variables
##################################################
self.ham_bands = ham_bands = {' ':(30e6,6e9,0,0,['CW'])}
self.band_selector = band_selector = ' '
self.rx_samp_rate = rx_samp_rate = 4000000
self.mode_labels = mode_labels = {'None':0 , 'USB':1, 'LSB':2, 'CW': 3, 'CW Stereo':4, 'MGM':5, 'WBFM':6,'NBFM':7, 'AM':8}
self.current_allowed_modes = current_allowed_modes = ham_bands[band_selector][4]
self.mode_default_option = mode_default_option = mode_labels[(list(set(mode_labels) & set(current_allowed_modes))[0])]
self.if0_samp_rate = if0_samp_rate = rx_samp_rate
self.current_min_fq = current_min_fq = ham_bands[band_selector][0]
self.current_max_fq = current_max_fq = ham_bands[band_selector][1]
self.mode_to_sb_rx = mode_to_sb_rx = [3,1,2,3,4,1,5,6,7]
self.mode = mode = mode_default_option
self.fft_bw_desired = fft_bw_desired = min(if0_samp_rate, 100+abs(current_max_fq-current_min_fq))
self.current_default_fq = current_default_fq = ham_bands[band_selector][2]
self.tx_gain = tx_gain = 47
self.tx_fq = tx_fq = 0
self.tx_center_fq = tx_center_fq = current_default_fq
self.tx_bw_opts = tx_bw_opts = 1
self.tx_bw = tx_bw = [5000.0,3500.0,2500.0,1750.0,500.0]
self.ssb_txing = ssb_txing = 0
self.side_band_rx = side_band_rx = mode_to_sb_rx[mode]
self.rx_hw_fq = rx_hw_fq = 0
self.pi = pi = 3.14159265358979323846264338327950288419716939937511
self.mode_to_sb_tx = mode_to_sb_tx = [0,1,1,3,3,1,0,2,0]
self.mic_gain = mic_gain = 0.2
self.mgm_input_gain = mgm_input_gain = 1.4
self.loop_fq_trk_hz = loop_fq_trk_hz = 300
self.loop_bw_hz = loop_bw_hz = 300
self.freq = freq = 0
self.filter_fq = filter_fq = 0
self.fft_decim = fft_decim = rx_samp_rate/fft_bw_desired
self.fft_corr = fft_corr = 0,0,0,880,0,0,0,0
self.f0 = f0 = current_min_fq + (current_max_fq - current_min_fq)/2.0
self.cw_txing = cw_txing = 0
self.audio_samp_rate = audio_samp_rate = 48000
self.wf_gain = wf_gain = 75
self.wf_fq = wf_fq = freq+rx_hw_fq
self.wbfm_if2_samp_rate = wbfm_if2_samp_rate = 1000000
self.wbfm_chain_gain = wbfm_chain_gain = 0,0,0,0,0,1,0,0
self.vox_threshold = vox_threshold = [10000,0.6,0.6,0.4,0.4,0.4,10000,0.6, 10000]
self.vox_sensitivity = vox_sensitivity = 20
self.vox_delay = vox_delay = [0,1.5,1.5,0.7,0.7,0.5,0.5,1.5,0]
self.vox_attack = vox_attack = [10000,10,10,1,1,1,1,1,1]
self.vga_gain = vga_gain = 53
self.variable_qtgui_entry_0 = variable_qtgui_entry_0 = side_band_rx
self.variable_function_probe_0 = variable_function_probe_0 = 0
self.usb_chain_gain = usb_chain_gain = 1,1,0,1,1,0,0,0
self.txing = txing = cw_txing or ssb_txing
self.tx_samp_rate = tx_samp_rate = 2000000
self.tx_rprt = tx_rprt = ''
self.tx_mode_offset = tx_mode_offset = [0, tx_bw[tx_bw_opts]/2, -tx_bw[tx_bw_opts]/2, 0, 0, tx_bw[tx_bw_opts]/2,tx_bw[tx_bw_opts]/2]
self.tx_fq_win = tx_fq_win = tx_center_fq
self.tx_fq_q = tx_fq_q = int(tx_fq)
self.tc_vga = tc_vga = tx_gain
self.symbol_rate = symbol_rate = 20
self.ssb_txing_btn = ssb_txing_btn = 0
self.ssb_tx_bandwidth = ssb_tx_bandwidth = tx_bw[tx_bw_opts]
self.sq = sq = -110
self.split_fq = split_fq = True
self.spkr_gain = spkr_gain = 35
self.side_band_tx = side_band_tx = mode_to_sb_tx[mode]
self.side_band_dislay = side_band_dislay = side_band_rx
self.sb_t = sb_t = [1,-1,1,1]
self.sb_r = sb_r = [-1,1,1,-1]
self.rx_preamp = rx_preamp = 0
self.rx_fq_win = rx_fq_win = current_default_fq
self.rx_fq = rx_fq = 0
self.rx_ctr_fq_0 = rx_ctr_fq_0 = int(filter_fq)
self.rx_ctr_fq = rx_ctr_fq = int(rx_hw_fq)
self.rx_center_fq = rx_center_fq = f0-100e3
self.rx_bw = rx_bw = 2
self.rf_mix_matrices = rf_mix_matrices = [((0,0,0),), ((1,0,0),), ((0,1,0),), ((0,0,1),)]
self.nbfm_chain_gain = nbfm_chain_gain = 0,0,0,0,0,0,1,0
self.morse_speed = morse_speed = 120
self.monitor = monitor = 25
self.mode_to_audio_input = mode_to_audio_input = [0,2,2,0,0,1,0,2,0]
self.mode_options = mode_options = [0, 1, 2, 3, 4, 5,6]
self.mode_labels_values = mode_labels_values = list(mode_labels.values())
self.mode_labels_keys = mode_labels_keys = list(mode_labels.keys())
self.mode_display = mode_display = mode
self.mic_inpt_gain_0 = mic_inpt_gain_0 = mic_gain
self.mgm_output_gain = mgm_output_gain = 2
self.mgm_inpt_gain = mgm_inpt_gain = mgm_input_gain
self.lsb_chain_gain = lsb_chain_gain = 0,0,1,0,1,0,0,0
self.loop_fq_trk_rad = loop_fq_trk_rad = loop_fq_trk_hz * 2 * pi / audio_samp_rate
self.loop_bw_rad = loop_bw_rad = loop_bw_hz*2*3.14159265359/audio_samp_rate
self.lna_gain = lna_gain = 39
self.if_samp_rate = if_samp_rate = 1000e3
self.if2_samp_rate = if2_samp_rate = 50000
self.ham_bands_keys = ham_bands_keys = [' ']
self.fq_calibration = fq_calibration = 26
self.fm_gain = fm_gain = 1.2
self.fft_center_fq = fft_center_fq = rx_hw_fq + filter_fq + fft_corr[side_band_rx]
self.f0_min = f0_min = ham_bands[band_selector][0]
self.dx_call = dx_call = ''
self.debug_side_band_rx = debug_side_band_rx = side_band_rx
self.debug_fft_decim = debug_fft_decim = fft_decim
self.debug_desired_fft_bw = debug_desired_fft_bw = fft_bw_desired
self.cw_samp_rate = cw_samp_rate = 50e3
self.cw_midear_beat = cw_midear_beat = 0,0,0,880,880,0,0,0
self.cw_level = cw_level = 0.8
self.current_op_tab = current_op_tab = 'op_tab.currentIndex'
self.current_allowed_tx_bandwidth = current_allowed_tx_bandwidth = ham_bands[band_selector][3]
self.cq_flavor = cq_flavor = ''
self.channel_separation = channel_separation = [100,100,10,10,1000,1000]
self.bpf_low = bpf_low = 100, 100,100,100,230,630,780, 855
self.bpf_high = bpf_high = 5000,4000,3300,2800,1530,1130,1080, 905
self.am_chain_gain = am_chain_gain = 0,0,0,0,0,0,0,1
self.agc_decay = agc_decay = 8e-7
self.agc_attack = agc_attack = 0.01
self.af_right = af_right = 0.5
self.af_mix_matrices = af_mix_matrices = [((1,0,0,0,0,0),(1,0,0,0,0,0)), ((1,0,0,0,0,0),(1,0,0,0,0,0)), ((0,1,0,0,0,0),(0,1,0,0,0,0)), ((1,0,0,0,0,0),(1,0,0,0,0,0)), ((1,0,0,0,0,0),(0,1,0,0,0,0)), ((0,0,1,0,0,0),(0,0,0,1,0,0)), ((0,0,0,0,1,0),(0,0,0,0,1,0)), ((0,0,0,0,0,1),(0,0,0,0,0,1))]
self.RX_power_offset_dB = RX_power_offset_dB = -104
##################################################
# Blocks
##################################################
self.settings_tab = Qt.QTabWidget()
self.settings_tab_widget_0 = Qt.QWidget()
self.settings_tab_layout_0 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.settings_tab_widget_0)
self.settings_tab_grid_layout_0 = Qt.QGridLayout()
self.settings_tab_layout_0.addLayout(self.settings_tab_grid_layout_0)
self.settings_tab.addTab(self.settings_tab_widget_0, 'RX_settings')
self.settings_tab_widget_1 = Qt.QWidget()
self.settings_tab_layout_1 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.settings_tab_widget_1)
self.settings_tab_grid_layout_1 = Qt.QGridLayout()
self.settings_tab_layout_1.addLayout(self.settings_tab_grid_layout_1)
self.settings_tab.addTab(self.settings_tab_widget_1, 'TX_settings')
self.settings_tab_widget_2 = Qt.QWidget()
self.settings_tab_layout_2 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.settings_tab_widget_2)
self.settings_tab_grid_layout_2 = Qt.QGridLayout()
self.settings_tab_layout_2.addLayout(self.settings_tab_grid_layout_2)
self.settings_tab.addTab(self.settings_tab_widget_2, 'Debug')
self.settings_tab_widget_3 = Qt.QWidget()
self.settings_tab_layout_3 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.settings_tab_widget_3)
self.settings_tab_grid_layout_3 = Qt.QGridLayout()
self.settings_tab_layout_3.addLayout(self.settings_tab_grid_layout_3)
self.settings_tab.addTab(self.settings_tab_widget_3, 'AGC')
self.top_layout.addWidget(self.settings_tab)
self.op_tab = Qt.QTabWidget()
self.op_tab_widget_0 = Qt.QWidget()
self.op_tab_layout_0 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.op_tab_widget_0)
self.op_tab_grid_layout_0 = Qt.QGridLayout()
self.op_tab_layout_0.addLayout(self.op_tab_grid_layout_0)
self.op_tab.addTab(self.op_tab_widget_0, 'SSB')
self.op_tab_widget_1 = Qt.QWidget()
self.op_tab_layout_1 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.op_tab_widget_1)
self.op_tab_grid_layout_1 = Qt.QGridLayout()
self.op_tab_layout_1.addLayout(self.op_tab_grid_layout_1)
self.op_tab.addTab(self.op_tab_widget_1, 'MGM')
self.op_tab_widget_2 = Qt.QWidget()
self.op_tab_layout_2 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.op_tab_widget_2)
self.op_tab_grid_layout_2 = Qt.QGridLayout()
self.op_tab_layout_2.addLayout(self.op_tab_grid_layout_2)
self.op_tab.addTab(self.op_tab_widget_2, 'CW')
self.top_grid_layout.addWidget(self.op_tab, 4, 4, 3, 2)
for r in range(4, 7):
self.top_grid_layout.setRowStretch(r, 1)
for c in range(4, 6):
self.top_grid_layout.setColumnStretch(c, 1)
self.blocks_probe_signal_x_0 = blocks.probe_signal_f()
if "int" == "int":
isFloat = False
scaleFactor = 1
else:
isFloat = True
scaleFactor = 1
_vox_sensitivity_dial_control = qtgui.GrDialControl('VOX SENS', self, 0,200,20,"teal",self.set_vox_sensitivity,isFloat, scaleFactor, 50, True, "'value'")
self.vox_sensitivity = _vox_sensitivity_dial_control
self.op_tab_grid_layout_0.addWidget(_vox_sensitivity_dial_control, 4, 6, 1, 1)
for r in range(4, 5):
self.op_tab_grid_layout_0.setRowStretch(r, 1)
for c in range(6, 7):
self.op_tab_grid_layout_0.setColumnStretch(c, 1)
if "int" == "int":
isFloat = False
scaleFactor = 1
else:
isFloat = True
scaleFactor = 1
_vga_gain_dial_control = qtgui.GrDialControl('RX VGA Gain', self, 0,61,53,"teal",self.set_vga_gain,isFloat, scaleFactor, 50, True, "'value'")
self.vga_gain = _vga_gain_dial_control
self.settings_tab_grid_layout_0.addWidget(_vga_gain_dial_control, 5, 2, 1, 1)
for r in range(5, 6):
self.settings_tab_grid_layout_0.setRowStretch(r, 1)
for c in range(2, 3):
self.settings_tab_grid_layout_0.setColumnStretch(c, 1)
def _variable_function_probe_0_probe():
while True:
val = self.blocks_probe_signal_x_0.level()
try:
try:
self.doc.add_next_tick_callback(functools.partial(self.set_variable_function_probe_0,val))
except AttributeError:
self.set_variable_function_probe_0(val)
except AttributeError:
pass
time.sleep(1.0 / (20))
_variable_function_probe_0_thread = threading.Thread(target=_variable_function_probe_0_probe)
_variable_function_probe_0_thread.daemon = True
_variable_function_probe_0_thread.start()
self._tx_rprt_tool_bar = Qt.QToolBar(self)
self._tx_rprt_tool_bar.addWidget(Qt.QLabel("TX report" + ": "))
self._tx_rprt_line_edit = Qt.QLineEdit(str(self.tx_rprt))
self._tx_rprt_tool_bar.addWidget(self._tx_rprt_line_edit)
self._tx_rprt_line_edit.returnPressed.connect(
lambda: self.set_tx_rprt(str(str(self._tx_rprt_line_edit.text()))))
self.op_tab_grid_layout_2.addWidget(self._tx_rprt_tool_bar, 3, 1, 1, 1)
for r in range(3, 4):
self.op_tab_grid_layout_2.setRowStretch(r, 1)
for c in range(1, 2):
self.op_tab_grid_layout_2.setColumnStretch(c, 1)
if "int" == "int":
isFloat = False
scaleFactor = 1
else:
isFloat = True
scaleFactor = 1
_tx_gain_dial_control = qtgui.GrDialControl('TX GAIN', self, 1,47,47,"orange",self.set_tx_gain,isFloat, scaleFactor, 50, True, "'value'")
self.tx_gain = _tx_gain_dial_control
self.settings_tab_grid_layout_1.addWidget(_tx_gain_dial_control, 3, 5, 1, 1)
for r in range(3, 4):
self.settings_tab_grid_layout_1.setRowStretch(r, 1)
for c in range(5, 6):
self.settings_tab_grid_layout_1.setColumnStretch(c, 1)
# Create the options list
self._tx_bw_opts_options = [0, 1, 2, 3, 4]
# Create the labels list
self._tx_bw_opts_labels = ['5', '3.5', '2.5', '1.75', '0.5']
# Create the combo box
# Create the radio buttons
self._tx_bw_opts_group_box = Qt.QGroupBox("TX BW - kHz" + ": ")
self._tx_bw_opts_box = Qt.QVBoxLayout()
class variable_chooser_button_group(Qt.QButtonGroup):
def __init__(self, parent=None):
Qt.QButtonGroup.__init__(self, parent)
@pyqtSlot(int)
def updateButtonChecked(self, button_id):
self.button(button_id).setChecked(True)
self._tx_bw_opts_button_group = variable_chooser_button_group()
self._tx_bw_opts_group_box.setLayout(self._tx_bw_opts_box)
for i, _label in enumerate(self._tx_bw_opts_labels):
radio_button = Qt.QRadioButton(_label)
self._tx_bw_opts_box.addWidget(radio_button)
self._tx_bw_opts_button_group.addButton(radio_button, i)
self._tx_bw_opts_callback = lambda i: Qt.QMetaObject.invokeMethod(self._tx_bw_opts_button_group, "updateButtonChecked", Qt.Q_ARG("int", self._tx_bw_opts_options.index(i)))
self._tx_bw_opts_callback(self.tx_bw_opts)
self._tx_bw_opts_button_group.buttonClicked[int].connect(
lambda i: self.set_tx_bw_opts(self._tx_bw_opts_options[i]))
self.top_grid_layout.addWidget(self._tx_bw_opts_group_box, 3, 4, 1, 1)
for r in range(3, 4):
self.top_grid_layout.setRowStretch(r, 1)
for c in range(4, 5):
self.top_grid_layout.setColumnStretch(c, 1)
_ssb_txing_btn_push_button = Qt.QPushButton('PTT')
_ssb_txing_btn_push_button = Qt.QPushButton('PTT')
self._ssb_txing_btn_choices = {'Pressed': 1, 'Released': 0}
_ssb_txing_btn_push_button.pressed.connect(lambda: self.set_ssb_txing_btn(self._ssb_txing_btn_choices['Pressed']))
_ssb_txing_btn_push_button.released.connect(lambda: self.set_ssb_txing_btn(self._ssb_txing_btn_choices['Released']))
self.top_grid_layout.addWidget(_ssb_txing_btn_push_button, 2, 5, 1, 1)
for r in range(2, 3):
self.top_grid_layout.setRowStretch(r, 1)
for c in range(5, 6):
self.top_grid_layout.setColumnStretch(c, 1)
self._sq_range = Range(-110, 0, 1, -110, 50)
self._sq_win = RangeWidget(self._sq_range, self.set_sq, "SQUELCH", "dial", float, QtCore.Qt.Horizontal)
self.top_grid_layout.addWidget(self._sq_win, 2, 0, 1, 1)
for r in range(2, 3):
self.top_grid_layout.setRowStretch(r, 1)
for c in range(0, 1):
self.top_grid_layout.setColumnStretch(c, 1)
_split_fq_check_box = Qt.QCheckBox("Split freq")
self._split_fq_choices = {True: False, False: True}
self._split_fq_choices_inv = dict((v,k) for k,v in self._split_fq_choices.items())
self._split_fq_callback = lambda i: Qt.QMetaObject.invokeMethod(_split_fq_check_box, "setChecked", Qt.Q_ARG("bool", self._split_fq_choices_inv[i]))
self._split_fq_callback(self.split_fq)
_split_fq_check_box.stateChanged.connect(lambda i: self.set_split_fq(self._split_fq_choices[bool(i)]))
self.top_grid_layout.addWidget(_split_fq_check_box, 2, 3, 1, 1)
for r in range(2, 3):
self.top_grid_layout.setRowStretch(r, 1)
for c in range(3, 4):
self.top_grid_layout.setColumnStretch(c, 1)
self._spkr_gain_range = Range(0, 200, 1, 35, 50)
self._spkr_gain_win = RangeWidget(self._spkr_gain_range, self.set_spkr_gain, " AF VOL", "dial", float, QtCore.Qt.Horizontal)
self.top_grid_layout.addWidget(self._spkr_gain_win, 1, 0, 1, 1)
for r in range(1, 2):
self.top_grid_layout.setRowStretch(r, 1)
for c in range(0, 1):
self.top_grid_layout.setColumnStretch(c, 1)
# Create the options list
self._rx_samp_rate_options = [1000000, 2000000, 3000000, 4000000, 5000000, 6000000, 7000000, 8000000]
# Create the labels list
self._rx_samp_rate_labels = ['1 MHz', '2 MHz', '3 MHz', '4 MHz', '5 MHz', '6 MHz', '7 MHz', '8 MHz']
# Create the combo box
# Create the radio buttons
self._rx_samp_rate_group_box = Qt.QGroupBox("'rx_samp_rate'" + ": ")
self._rx_samp_rate_box = Qt.QHBoxLayout()
class variable_chooser_button_group(Qt.QButtonGroup):
def __init__(self, parent=None):
Qt.QButtonGroup.__init__(self, parent)
@pyqtSlot(int)
def updateButtonChecked(self, button_id):
self.button(button_id).setChecked(True)
self._rx_samp_rate_button_group = variable_chooser_button_group()
self._rx_samp_rate_group_box.setLayout(self._rx_samp_rate_box)
for i, _label in enumerate(self._rx_samp_rate_labels):
radio_button = Qt.QRadioButton(_label)
self._rx_samp_rate_box.addWidget(radio_button)
self._rx_samp_rate_button_group.addButton(radio_button, i)
self._rx_samp_rate_callback = lambda i: Qt.QMetaObject.invokeMethod(self._rx_samp_rate_button_group, "updateButtonChecked", Qt.Q_ARG("int", self._rx_samp_rate_options.index(i)))
self._rx_samp_rate_callback(self.rx_samp_rate)
self._rx_samp_rate_button_group.buttonClicked[int].connect(
lambda i: self.set_rx_samp_rate(self._rx_samp_rate_options[i]))
self.top_layout.addWidget(self._rx_samp_rate_group_box)
# Create the options list
self._rx_preamp_options = [0, 1]
# Create the labels list
self._rx_preamp_labels = ['OFF', 'ON']
# Create the combo box
# Create the radio buttons
self._rx_preamp_group_box = Qt.QGroupBox("RX Preamp" + ": ")
self._rx_preamp_box = Qt.QVBoxLayout()
class variable_chooser_button_group(Qt.QButtonGroup):
def __init__(self, parent=None):
Qt.QButtonGroup.__init__(self, parent)
@pyqtSlot(int)
def updateButtonChecked(self, button_id):
self.button(button_id).setChecked(True)
self._rx_preamp_button_group = variable_chooser_button_group()
self._rx_preamp_group_box.setLayout(self._rx_preamp_box)
for i, _label in enumerate(self._rx_preamp_labels):
radio_button = Qt.QRadioButton(_label)
self._rx_preamp_box.addWidget(radio_button)
self._rx_preamp_button_group.addButton(radio_button, i)
self._rx_preamp_callback = lambda i: Qt.QMetaObject.invokeMethod(self._rx_preamp_button_group, "updateButtonChecked", Qt.Q_ARG("int", self._rx_preamp_options.index(i)))
self._rx_preamp_callback(self.rx_preamp)
self._rx_preamp_button_group.buttonClicked[int].connect(
lambda i: self.set_rx_preamp(self._rx_preamp_options[i]))
self.settings_tab_grid_layout_0.addWidget(self._rx_preamp_group_box, 4, 1, 1, 1)
for r in range(4, 5):
self.settings_tab_grid_layout_0.setRowStretch(r, 1)
for c in range(1, 2):
self.settings_tab_grid_layout_0.setColumnStretch(c, 1)
# Create the options list
self._rx_bw_options = [0, 1, 2, 3, 4, 5, 6, 7]
# Create the labels list
self._rx_bw_labels = ['5', '3.9', '3.2', '2.7', '1.3', '0.5', '0.2', '0.05']
# Create the combo box
# Create the radio buttons
self._rx_bw_group_box = Qt.QGroupBox("RX BW - kHz" + ": ")
self._rx_bw_box = Qt.QVBoxLayout()
class variable_chooser_button_group(Qt.QButtonGroup):
def __init__(self, parent=None):
Qt.QButtonGroup.__init__(self, parent)
@pyqtSlot(int)
def updateButtonChecked(self, button_id):
self.button(button_id).setChecked(True)
self._rx_bw_button_group = variable_chooser_button_group()
self._rx_bw_group_box.setLayout(self._rx_bw_box)
for i, _label in enumerate(self._rx_bw_labels):
radio_button = Qt.QRadioButton(_label)
self._rx_bw_box.addWidget(radio_button)
self._rx_bw_button_group.addButton(radio_button, i)
self._rx_bw_callback = lambda i: Qt.QMetaObject.invokeMethod(self._rx_bw_button_group, "updateButtonChecked", Qt.Q_ARG("int", self._rx_bw_options.index(i)))
self._rx_bw_callback(self.rx_bw)
self._rx_bw_button_group.buttonClicked[int].connect(
lambda i: self.set_rx_bw(self._rx_bw_options[i]))
self.top_grid_layout.addWidget(self._rx_bw_group_box, 3, 2, 1, 1)
for r in range(3, 4):
self.top_grid_layout.setRowStretch(r, 1)
for c in range(2, 3):
self.top_grid_layout.setColumnStretch(c, 1)
if "real" == "int":
isFloat = False
scaleFactor = 1
else:
isFloat = True
scaleFactor = 1
_morse_speed_dial_control = qtgui.GrDialControl('MORSE SPEED [CPM]', self, 40,200,120,"navy",self.set_morse_speed,isFloat, scaleFactor, 50, True, "'value'")
self.morse_speed = _morse_speed_dial_control
self.op_tab_grid_layout_2.addWidget(_morse_speed_dial_control, 0, 1, 1, 1)
for r in range(0, 1):
self.op_tab_grid_layout_2.setRowStretch(r, 1)
for c in range(1, 2):
self.op_tab_grid_layout_2.setColumnStretch(c, 1)
if "real" == "int":
isFloat = False
scaleFactor = 1
else:
isFloat = True
scaleFactor = 1
_monitor_dial_control = qtgui.GrDialControl('CW feedback', self, 0,100,25,"teal",self.set_monitor,isFloat, scaleFactor, 100, True, "'value'")
self.monitor = _monitor_dial_control
self.op_tab_grid_layout_2.addWidget(_monitor_dial_control, 0, 2, 1, 1)
for r in range(0, 1):
self.op_tab_grid_layout_2.setRowStretch(r, 1)
for c in range(2, 3):
self.op_tab_grid_layout_2.setColumnStretch(c, 1)
# Create the options list
self._mode_options = [0, 1, 2, 3, 4, 5, 6, 7, 8]
# Create the labels list
self._mode_labels = ['None', 'USB', 'LSB', 'CW', 'CW Stereo', 'MGM', 'WBFM', 'NBFM', 'AM']
# Create the combo box
# Create the radio buttons
self._mode_group_box = Qt.QGroupBox("TX MODE" + ": ")
self._mode_box = Qt.QVBoxLayout()
class variable_chooser_button_group(Qt.QButtonGroup):
def __init__(self, parent=None):
Qt.QButtonGroup.__init__(self, parent)
@pyqtSlot(int)
def updateButtonChecked(self, button_id):
self.button(button_id).setChecked(True)
self._mode_button_group = variable_chooser_button_group()
self._mode_group_box.setLayout(self._mode_box)
for i, _label in enumerate(self._mode_labels):
radio_button = Qt.QRadioButton(_label)
self._mode_box.addWidget(radio_button)
self._mode_button_group.addButton(radio_button, i)
self._mode_callback = lambda i: Qt.QMetaObject.invokeMethod(self._mode_button_group, "updateButtonChecked", Qt.Q_ARG("int", self._mode_options.index(i)))
self._mode_callback(self.mode)
self._mode_button_group.buttonClicked[int].connect(
lambda i: self.set_mode(self._mode_options[i]))
self.top_grid_layout.addWidget(self._mode_group_box, 3, 3, 1, 1)
for r in range(3, 4):
self.top_grid_layout.setRowStretch(r, 1)
for c in range(3, 4):
self.top_grid_layout.setColumnStretch(c, 1)
if "real" == "int":
isFloat = False
scaleFactor = 1
else:
isFloat = True
scaleFactor = 0.001
_mic_gain_dial_control = qtgui.GrDialControl('MIC GAIN', self, 0,995,0.2,"silver",self.set_mic_gain,isFloat, scaleFactor, 50, True, "'value'")
self.mic_gain = _mic_gain_dial_control
self.op_tab_grid_layout_0.addWidget(_mic_gain_dial_control, 3, 6, 1, 1)
for r in range(3, 4):
self.op_tab_grid_layout_0.setRowStretch(r, 1)
for c in range(6, 7):
self.op_tab_grid_layout_0.setColumnStretch(c, 1)
self._mgm_output_gain_range = Range(0, 20, 0.1, 2, 50)
self._mgm_output_gain_win = RangeWidget(self._mgm_output_gain_range, self.set_mgm_output_gain, " MGM VOL", "dial", float, QtCore.Qt.Horizontal)
self.op_tab_grid_layout_1.addWidget(self._mgm_output_gain_win, 0, 1, 1, 1)
for r in range(0, 1):
self.op_tab_grid_layout_1.setRowStretch(r, 1)
for c in range(1, 2):
self.op_tab_grid_layout_1.setColumnStretch(c, 1)
if "real" == "int":
isFloat = False
scaleFactor = 1
else:
isFloat = True
scaleFactor = 0.001
_mgm_input_gain_dial_control = qtgui.GrDialControl('MGM INPUT GAIN', self, 0,1995,1.4,"silver",self.set_mgm_input_gain,isFloat, scaleFactor, 50, True, "'value'")
self.mgm_input_gain = _mgm_input_gain_dial_control
self.op_tab_grid_layout_1.addWidget(_mgm_input_gain_dial_control, 0, 0, 1, 1)
for r in range(0, 1):
self.op_tab_grid_layout_1.setRowStretch(r, 1)
for c in range(0, 1):
self.op_tab_grid_layout_1.setColumnStretch(c, 1)
self._lna_gain_range = Range(0, 39, 1, 39, 100)
self._lna_gain_win = RangeWidget(self._lna_gain_range, self.set_lna_gain, "RX LNA GAIN", "dial", float, QtCore.Qt.Horizontal)
self.settings_tab_grid_layout_0.addWidget(self._lna_gain_win, 5, 1, 1, 1)
for r in range(5, 6):
self.settings_tab_grid_layout_0.setRowStretch(r, 1)
for c in range(1, 2):
self.settings_tab_grid_layout_0.setColumnStretch(c, 1)
self._fq_calibration_range = Range(-50, 50, 1, 26, 100)
self._fq_calibration_win = RangeWidget(self._fq_calibration_range, self.set_fq_calibration, "FQ CAL", "counter_slider", float, QtCore.Qt.Horizontal)
self.settings_tab_grid_layout_0.addWidget(self._fq_calibration_win, 11, 1, 1, 2)
for r in range(11, 12):
self.settings_tab_grid_layout_0.setRowStretch(r, 1)
for c in range(1, 3):
self.settings_tab_grid_layout_0.setColumnStretch(c, 1)
self._dx_call_tool_bar = Qt.QToolBar(self)
self._dx_call_tool_bar.addWidget(Qt.QLabel("DX call" + ": "))
self._dx_call_line_edit = Qt.QLineEdit(str(self.dx_call))
self._dx_call_tool_bar.addWidget(self._dx_call_line_edit)
self._dx_call_line_edit.returnPressed.connect(
lambda: self.set_dx_call(str(str(self._dx_call_line_edit.text()))))
self.op_tab_grid_layout_2.addWidget(self._dx_call_tool_bar, 3, 0, 1, 1)
for r in range(3, 4):
self.op_tab_grid_layout_2.setRowStretch(r, 1)
for c in range(0, 1):
self.op_tab_grid_layout_2.setColumnStretch(c, 1)
if "real" == "int":
isFloat = False
scaleFactor = 1
else:
isFloat = True
scaleFactor = 0.01
_cw_level_dial_control = qtgui.GrDialControl('CW TX LEVEL', self, 0,95,0.8,"lime",self.set_cw_level,isFloat, scaleFactor, 50, True, "'value'")
self.cw_level = _cw_level_dial_control
self.op_tab_grid_layout_2.addWidget(_cw_level_dial_control, 0, 0, 1, 1)
for r in range(0, 1):
self.op_tab_grid_layout_2.setRowStretch(r, 1)
for c in range(0, 1):
self.op_tab_grid_layout_2.setColumnStretch(c, 1)
self._current_min_fq_tool_bar = Qt.QToolBar(self)
self._current_min_fq_tool_bar.addWidget(Qt.QLabel("Min-fq" + ": "))
self._current_min_fq_line_edit = Qt.QLineEdit(str(self.current_min_fq))
self._current_min_fq_tool_bar.addWidget(self._current_min_fq_line_edit)
self._current_min_fq_line_edit.returnPressed.connect(
lambda: self.set_current_min_fq(eng_notation.str_to_num(str(self._current_min_fq_line_edit.text()))))
self.settings_tab_grid_layout_2.addWidget(self._current_min_fq_tool_bar, 0, 0, 1, 1)
for r in range(0, 1):
self.settings_tab_grid_layout_2.setRowStretch(r, 1)
for c in range(0, 1):
self.settings_tab_grid_layout_2.setColumnStretch(c, 1)
self._current_max_fq_tool_bar = Qt.QToolBar(self)
self._current_max_fq_tool_bar.addWidget(Qt.QLabel("Max-fq" + ": "))
self._current_max_fq_line_edit = Qt.QLineEdit(str(self.current_max_fq))
self._current_max_fq_tool_bar.addWidget(self._current_max_fq_line_edit)
self._current_max_fq_line_edit.returnPressed.connect(
lambda: self.set_current_max_fq(eng_notation.str_to_num(str(self._current_max_fq_line_edit.text()))))
self.settings_tab_grid_layout_2.addWidget(self._current_max_fq_tool_bar, 0, 1, 1, 1)
for r in range(0, 1):
self.settings_tab_grid_layout_2.setRowStretch(r, 1)
for c in range(1, 2):
self.settings_tab_grid_layout_2.setColumnStretch(c, 1)
self._current_default_fq_tool_bar = Qt.QToolBar(self)
self._current_default_fq_tool_bar.addWidget(Qt.QLabel("Def-fq" + ": "))
self._current_default_fq_line_edit = Qt.QLineEdit(str(self.current_default_fq))
self._current_default_fq_tool_bar.addWidget(self._current_default_fq_line_edit)
self._current_default_fq_line_edit.returnPressed.connect(
lambda: self.set_current_default_fq(eng_notation.str_to_num(str(self._current_default_fq_line_edit.text()))))
self.settings_tab_grid_layout_2.addWidget(self._current_default_fq_tool_bar, 0, 2, 1, 1)
for r in range(0, 1):
self.settings_tab_grid_layout_2.setRowStretch(r, 1)
for c in range(2, 3):
self.settings_tab_grid_layout_2.setColumnStretch(c, 1)
self._current_allowed_tx_bandwidth_tool_bar = Qt.QToolBar(self)
self._current_allowed_tx_bandwidth_tool_bar.addWidget(Qt.QLabel("Bw" + ": "))
self._current_allowed_tx_bandwidth_line_edit = Qt.QLineEdit(str(self.current_allowed_tx_bandwidth))
self._current_allowed_tx_bandwidth_tool_bar.addWidget(self._current_allowed_tx_bandwidth_line_edit)
self._current_allowed_tx_bandwidth_line_edit.returnPressed.connect(
lambda: self.set_current_allowed_tx_bandwidth(eng_notation.str_to_num(str(self._current_allowed_tx_bandwidth_line_edit.text()))))
self.settings_tab_grid_layout_2.addWidget(self._current_allowed_tx_bandwidth_tool_bar, 0, 4, 1, 1)
for r in range(0, 1):
self.settings_tab_grid_layout_2.setRowStretch(r, 1)
for c in range(4, 5):
self.settings_tab_grid_layout_2.setColumnStretch(c, 1)
self._cq_flavor_tool_bar = Qt.QToolBar(self)
self._cq_flavor_tool_bar.addWidget(Qt.QLabel("CQ Flavor" + ": "))
self._cq_flavor_line_edit = Qt.QLineEdit(str(self.cq_flavor))
self._cq_flavor_tool_bar.addWidget(self._cq_flavor_line_edit)
self._cq_flavor_line_edit.returnPressed.connect(
lambda: self.set_cq_flavor(str(str(self._cq_flavor_line_edit.text()))))
self.op_tab_grid_layout_2.addWidget(self._cq_flavor_tool_bar, 1, 0, 1, 1)
for r in range(1, 2):
self.op_tab_grid_layout_2.setRowStretch(r, 1)
for c in range(0, 1):
self.op_tab_grid_layout_2.setColumnStretch(c, 1)
self._agc_decay_range = Range(0, 50e-7, 3e-7, 8e-7, 100)
self._agc_decay_win = RangeWidget(self._agc_decay_range, self.set_agc_decay, "AGC decay", "counter_slider", float, QtCore.Qt.Horizontal)
self.settings_tab_grid_layout_3.addWidget(self._agc_decay_win, 13, 1, 1, 2)
for r in range(13, 14):
self.settings_tab_grid_layout_3.setRowStretch(r, 1)
for c in range(1, 3):
self.settings_tab_grid_layout_3.setColumnStretch(c, 1)
self._agc_attack_range = Range(0.0, 3, 0.01, 0.01, 100)
self._agc_attack_win = RangeWidget(self._agc_attack_range, self.set_agc_attack, "AGC attack", "counter_slider", float, QtCore.Qt.Horizontal)
self.settings_tab_grid_layout_3.addWidget(self._agc_attack_win, 12, 1, 1, 2)
for r in range(12, 13):
self.settings_tab_grid_layout_3.setRowStretch(r, 1)
for c in range(1, 3):
self.settings_tab_grid_layout_3.setColumnStretch(c, 1)
self._af_right_range = Range(0, 1, 0.01, 0.5, 100)
self._af_right_win = RangeWidget(self._af_right_range, self.set_af_right, "AF BAL", "slider", float, QtCore.Qt.Horizontal)
self.settings_tab_grid_layout_0.addWidget(self._af_right_win, 10, 1, 1, 2)
for r in range(10, 11):
self.settings_tab_grid_layout_0.setRowStretch(r, 1)
for c in range(1, 3):
self.settings_tab_grid_layout_0.setColumnStretch(c, 1)
self.zeromq_pull_msg_source_0 = zeromq.pull_msg_source('tcp://127.0.0.1:8755', 100, False)
self._wf_gain_range = Range(0, 100, 1, 75, 100)
self._wf_gain_win = RangeWidget(self._wf_gain_range, self.set_wf_gain, "Waterfall gain", "dial", float, QtCore.Qt.Horizontal)
self.top_grid_layout.addWidget(self._wf_gain_win, 8, 2, 1, 1)
for r in range(8, 9):
self.top_grid_layout.setRowStretch(r, 1)
for c in range(2, 3):
self.top_grid_layout.setColumnStretch(c, 1)
self.variable_qtgui_msg_push_button_0_0_0_0_0_0 = _variable_qtgui_msg_push_button_0_0_0_0_0_0_toggle_button = qtgui.MsgPushButton('Send RR 73', '','%s de SM6FBQ RR FB 73 Hej e e',"white","black")
self.variable_qtgui_msg_push_button_0_0_0_0_0_0 = _variable_qtgui_msg_push_button_0_0_0_0_0_0_toggle_button
self.op_tab_grid_layout_2.addWidget(_variable_qtgui_msg_push_button_0_0_0_0_0_0_toggle_button, 7, 0, 1, 1)
for r in range(7, 8):
self.op_tab_grid_layout_2.setRowStretch(r, 1)
for c in range(0, 1):
self.op_tab_grid_layout_2.setColumnStretch(c, 1)
self.variable_qtgui_msg_push_button_0_0_0_0_0 = _variable_qtgui_msg_push_button_0_0_0_0_0_toggle_button = qtgui.MsgPushButton('Send R & report', '','%s de SM6FBQ R FB %s %s %s/ JO67BQ JO67BQ HW? bk',"white","black")
self.variable_qtgui_msg_push_button_0_0_0_0_0 = _variable_qtgui_msg_push_button_0_0_0_0_0_toggle_button
self.op_tab_grid_layout_2.addWidget(_variable_qtgui_msg_push_button_0_0_0_0_0_toggle_button, 6, 0, 1, 1)
for r in range(6, 7):
self.op_tab_grid_layout_2.setRowStretch(r, 1)
for c in range(0, 1):
self.op_tab_grid_layout_2.setColumnStretch(c, 1)
self.variable_qtgui_msg_push_button_0_0_0_0 = _variable_qtgui_msg_push_button_0_0_0_0_toggle_button = qtgui.MsgPushButton('Send report', '','%s de SM6FBQ UR %s %s %s/ JO67BQ JO67BQ HW? %s de SM6FBQ k',"white","black")
self.variable_qtgui_msg_push_button_0_0_0_0 = _variable_qtgui_msg_push_button_0_0_0_0_toggle_button
self.op_tab_grid_layout_2.addWidget(_variable_qtgui_msg_push_button_0_0_0_0_toggle_button, 5, 0, 1, 1)
for r in range(5, 6):
self.op_tab_grid_layout_2.setRowStretch(r, 1)
for c in range(0, 1):
self.op_tab_grid_layout_2.setColumnStretch(c, 1)
self.variable_qtgui_msg_push_button_0_0_0 = _variable_qtgui_msg_push_button_0_0_0_toggle_button = qtgui.MsgPushButton('Call DX', '','%s de SM6FBQ',"white","black")
self.variable_qtgui_msg_push_button_0_0_0 = _variable_qtgui_msg_push_button_0_0_0_toggle_button
self.op_tab_grid_layout_2.addWidget(_variable_qtgui_msg_push_button_0_0_0_toggle_button, 4, 0, 1, 1)
for r in range(4, 5):
self.op_tab_grid_layout_2.setRowStretch(r, 1)
for c in range(0, 1):
self.op_tab_grid_layout_2.setColumnStretch(c, 1)
self.variable_qtgui_msg_push_button_0_0 = _variable_qtgui_msg_push_button_0_0_toggle_button = qtgui.MsgPushButton('CALL CQ', '','CQ%s CQ%s CQ%s DE SM6FBQ SM6FBQ SM6FBQ %sk',"white","black")
self.variable_qtgui_msg_push_button_0_0 = _variable_qtgui_msg_push_button_0_0_toggle_button
self.op_tab_grid_layout_2.addWidget(_variable_qtgui_msg_push_button_0_0_toggle_button, 1, 1, 1, 1)
for r in range(1, 2):
self.op_tab_grid_layout_2.setRowStretch(r, 1)
for c in range(1, 2):
self.op_tab_grid_layout_2.setColumnStretch(c, 1)
self._variable_qtgui_entry_0_tool_bar = Qt.QToolBar(self)
self._variable_qtgui_entry_0_tool_bar.addWidget(Qt.QLabel("Selector" + ": "))
self._variable_qtgui_entry_0_line_edit = Qt.QLineEdit(str(self.variable_qtgui_entry_0))
self._variable_qtgui_entry_0_tool_bar.addWidget(self._variable_qtgui_entry_0_line_edit)
self._variable_qtgui_entry_0_line_edit.returnPressed.connect(
lambda: self.set_variable_qtgui_entry_0(int(str(self._variable_qtgui_entry_0_line_edit.text()))))
self.top_layout.addWidget(self._variable_qtgui_entry_0_tool_bar)
self._tx_fq_win_msgdigctl_win = qtgui.MsgDigitalNumberControl(lbl = 'TX FQ', min_freq_hz = current_min_fq + current_allowed_tx_bandwidth - 29e6, max_freq_hz=current_max_fq - current_allowed_tx_bandwidth, parent=self, thousands_separator=".",background_color="black",fontColor="red", var_callback=self.set_tx_fq_win,outputmsgname="'freq'".replace("'",""))
self._tx_fq_win_msgdigctl_win.setValue(tx_center_fq)
self._tx_fq_win_msgdigctl_win.setReadOnly((not split_fq))
self.tx_fq_win = self._tx_fq_win_msgdigctl_win
self.top_grid_layout.addWidget(self._tx_fq_win_msgdigctl_win, 2, 4, 1, 1)
for r in range(2, 3):
self.top_grid_layout.setRowStretch(r, 1)
for c in range(4, 5):
self.top_grid_layout.setColumnStretch(c, 1)
self.tx_fq_sync = tx_fq_sync.blk(gate_control=split_fq, resync=True, repeat=2)
self._tx_fq_q_tool_bar = Qt.QToolBar(self)
self._tx_fq_q_tool_bar.addWidget(Qt.QLabel("TX fq" + ": "))
self._tx_fq_q_line_edit = Qt.QLineEdit(str(self.tx_fq_q))
self._tx_fq_q_tool_bar.addWidget(self._tx_fq_q_line_edit)
self._tx_fq_q_line_edit.returnPressed.connect(
lambda: self.set_tx_fq_q(int(str(self._tx_fq_q_line_edit.text()))))
self.settings_tab_grid_layout_2.addWidget(self._tx_fq_q_tool_bar, 2, 0, 1, 1)
for r in range(2, 3):
self.settings_tab_grid_layout_2.setRowStretch(r, 1)
for c in range(0, 1):
self.settings_tab_grid_layout_2.setColumnStretch(c, 1)
self._tc_vga_tool_bar = Qt.QToolBar(self)
self._tc_vga_tool_bar.addWidget(Qt.QLabel("TX VGA" + ": "))
self._tc_vga_line_edit = Qt.QLineEdit(str(self.tc_vga))
self._tc_vga_tool_bar.addWidget(self._tc_vga_line_edit)
self._tc_vga_line_edit.returnPressed.connect(
lambda: self.set_tc_vga(eng_notation.str_to_num(str(self._tc_vga_line_edit.text()))))
self.settings_tab_grid_layout_2.addWidget(self._tc_vga_tool_bar, 2, 3, 1, 1)
for r in range(2, 3):
self.settings_tab_grid_layout_2.setRowStretch(r, 1)
for c in range(3, 4):
self.settings_tab_grid_layout_2.setColumnStretch(c, 1)
self.soapy_hackrf_source_0 = None
dev = 'driver=hackrf'
stream_args = ''
tune_args = ['']
settings = ['']
self.soapy_hackrf_source_0 = soapy.source(dev, "fc32", 1, 'driver=remote,remote=tcp://192.168.1.125:1234,remote:type=hackrf',
stream_args, tune_args, settings)
self.soapy_hackrf_source_0.set_sample_rate(0, rx_samp_rate)
self.soapy_hackrf_source_0.set_bandwidth(0, 0)
self.soapy_hackrf_source_0.set_frequency(0, rx_hw_fq + fq_calibration)
self.soapy_hackrf_source_0.set_gain(0, 'AMP', rx_preamp)
self.soapy_hackrf_source_0.set_gain(0, 'LNA', min(max(lna_gain, 0.0), 40.0))
self.soapy_hackrf_source_0.set_gain(0, 'VGA', min(max(vga_gain, 0.0), 62.0))
self.soapy_hackrf_sink_0 = None
dev = 'driver=hackrf'
stream_args = ''
tune_args = ['']
settings = ['']
self.soapy_hackrf_sink_0 = soapy.sink(dev, "fc32", 1, 'driver=remote,remote=tcp://192.168.1.125:1234,remote:type=hackrf',
stream_args, tune_args, settings)
self.soapy_hackrf_sink_0.set_sample_rate(0, tx_samp_rate)
self.soapy_hackrf_sink_0.set_bandwidth(0, tx_bw[tx_bw_opts])
self.soapy_hackrf_sink_0.set_frequency(0, tx_fq+tx_mode_offset[side_band_tx] + fq_calibration)
self.soapy_hackrf_sink_0.set_gain(0, 'AMP', True)
self.soapy_hackrf_sink_0.set_gain(0, 'VGA', min(max(tx_gain, 0.0), 47.0))
self._side_band_dislay_tool_bar = Qt.QToolBar(self)
self._side_band_dislay_tool_bar.addWidget(Qt.QLabel("Side-band" + ": "))
self._side_band_dislay_line_edit = Qt.QLineEdit(str(self.side_band_dislay))
self._side_band_dislay_tool_bar.addWidget(self._side_band_dislay_line_edit)
self._side_band_dislay_line_edit.returnPressed.connect(
lambda: self.set_side_band_dislay(int(str(self._side_band_dislay_line_edit.text()))))
self.settings_tab_grid_layout_2.addWidget(self._side_band_dislay_tool_bar, 2, 2, 1, 1)
for r in range(2, 3):
self.settings_tab_grid_layout_2.setRowStretch(r, 1)
for c in range(2, 3):
self.settings_tab_grid_layout_2.setColumnStretch(c, 1)
self._rx_fq_win_msgdigctl_win = qtgui.MsgDigitalNumberControl(lbl = 'RX FQ', min_freq_hz = current_min_fq - 29e6, max_freq_hz=current_max_fq, parent=self, thousands_separator=".",background_color="black",fontColor="green", var_callback=self.set_rx_fq_win,outputmsgname="'freq'".replace("'",""))
self._rx_fq_win_msgdigctl_win.setValue(current_default_fq)
self._rx_fq_win_msgdigctl_win.setReadOnly(False)
self.rx_fq_win = self._rx_fq_win_msgdigctl_win
self.top_grid_layout.addWidget(self._rx_fq_win_msgdigctl_win, 2, 2, 1, 1)
for r in range(2, 3):
self.top_grid_layout.setRowStretch(r, 1)
for c in range(2, 3):
self.top_grid_layout.setColumnStretch(c, 1)
self.rx_distancer = rx_distancer.blk(desired_fq=current_default_fq, min_distance=100e3, max_distance=rx_samp_rate/2.0, hw_var=rx_hw_fq, filter_var=filter_fq)
self._rx_ctr_fq_0_tool_bar = Qt.QToolBar(self)
self._rx_ctr_fq_0_tool_bar.addWidget(Qt.QLabel("Rx filter fq" + ": "))
self._rx_ctr_fq_0_line_edit = Qt.QLineEdit(str(self.rx_ctr_fq_0))
self._rx_ctr_fq_0_tool_bar.addWidget(self._rx_ctr_fq_0_line_edit)
self._rx_ctr_fq_0_line_edit.returnPressed.connect(
lambda: self.set_rx_ctr_fq_0(int(str(self._rx_ctr_fq_0_line_edit.text()))))
self.settings_tab_grid_layout_2.addWidget(self._rx_ctr_fq_0_tool_bar, 1, 1, 1, 1)
for r in range(1, 2):
self.settings_tab_grid_layout_2.setRowStretch(r, 1)
for c in range(1, 2):
self.settings_tab_grid_layout_2.setColumnStretch(c, 1)
self._rx_ctr_fq_tool_bar = Qt.QToolBar(self)
self._rx_ctr_fq_tool_bar.addWidget(Qt.QLabel("Rx center fq" + ": "))
self._rx_ctr_fq_line_edit = Qt.QLineEdit(str(self.rx_ctr_fq))
self._rx_ctr_fq_tool_bar.addWidget(self._rx_ctr_fq_line_edit)
self._rx_ctr_fq_line_edit.returnPressed.connect(
lambda: self.set_rx_ctr_fq(int(str(self._rx_ctr_fq_line_edit.text()))))
self.settings_tab_grid_layout_2.addWidget(self._rx_ctr_fq_tool_bar, 1, 0, 1, 1)
for r in range(1, 2):
self.settings_tab_grid_layout_2.setRowStretch(r, 1)
for c in range(0, 1):
self.settings_tab_grid_layout_2.setColumnStretch(c, 1)
self.root_raised_cosine_filter_0_0 = filter.fir_filter_fff(
1,
firdes.root_raised_cosine(
cw_level,
cw_samp_rate,
symbol_rate,
0.35,
200))
self.root_raised_cosine_filter_0 = filter.fir_filter_fff(
1,
firdes.root_raised_cosine(
1,
cw_samp_rate,
symbol_rate,
0.35,
200))
self.rational_resampler_xxx_4_0_0 = filter.rational_resampler_ccc(
interpolation=int(tx_samp_rate/4000),
decimation=int(audio_samp_rate/1000),
taps=[],
fractional_bw=0)
self.rational_resampler_xxx_4_0 = filter.rational_resampler_ccc(
interpolation=int(2*tx_samp_rate/audio_samp_rate),
decimation=1,
taps=[],
fractional_bw=0)
self.rational_resampler_xxx_1 = filter.rational_resampler_fff(
interpolation=int(audio_samp_rate/1000),
decimation=int(cw_samp_rate/1000),
taps=[],
fractional_bw=0.4)
self.rational_resampler_xxx_0_0_0_1 = filter.rational_resampler_ccc(
interpolation=int(audio_samp_rate/1000),
decimation=int(if2_samp_rate/1000),
taps=[],
fractional_bw=0.4)
self.rational_resampler_xxx_0_0_0_0_0 = filter.rational_resampler_ccc(
interpolation=int(audio_samp_rate/1000),
decimation=int(wbfm_if2_samp_rate/10000),
taps=[],
fractional_bw=0.4)
self.rational_resampler_xxx_0_0_0_0 = filter.rational_resampler_ccc(
interpolation=int(audio_samp_rate/1000),
decimation=int(wbfm_if2_samp_rate/10000),
taps=[],
fractional_bw=0.4)
self.rational_resampler_xxx_0_0_0 = filter.rational_resampler_ccc(
interpolation=int(audio_samp_rate/1000),
decimation=int(if2_samp_rate/1000),
taps=[],
fractional_bw=0.4)
self.rational_resampler_xxx_0 = filter.rational_resampler_ccc(
interpolation=int(audio_samp_rate/1000),
decimation=int(if2_samp_rate/1000),
taps=[],
fractional_bw=0.4)
self.qtgui_sink_x_0 = qtgui.sink_c(
4096, #fftsize
window.WIN_HANN, #wintype
fft_center_fq, #fc
fft_bw_desired, #bw
"", #name
True, #plotfreq
True, #plotwaterfall
False, #plottime
False, #plotconst
None # parent
)
self.qtgui_sink_x_0.set_update_time(1.0/10)
self._qtgui_sink_x_0_win = sip.wrapinstance(self.qtgui_sink_x_0.qwidget(), Qt.QWidget)