|
|
|
@ -197,12 +197,21 @@ class rds_parser_table_qt(gr.sync_block):#START |
|
|
|
freq=self.decoder_frequencies[num] |
|
|
|
freq=self.decoder_frequencies[num] |
|
|
|
pilot_SNR=self.decoders[num]['pilot_SNR'] |
|
|
|
pilot_SNR=self.decoders[num]['pilot_SNR'] |
|
|
|
decim_mode=self.decoders[num]['decim_mode'] |
|
|
|
decim_mode=self.decoders[num]['decim_mode'] |
|
|
|
|
|
|
|
if decim_mode==0:#copy |
|
|
|
|
|
|
|
underline="" |
|
|
|
|
|
|
|
#underline="text-decoration-line: underline;text-decoration-style: wavy;text-decoration-color: red;" |
|
|
|
|
|
|
|
elif decim_mode==1:#skip (merges with left value) |
|
|
|
|
|
|
|
underline="text-decoration:overline" |
|
|
|
|
|
|
|
elif decim_mode==2:#noskip (merges with right value) |
|
|
|
|
|
|
|
underline="text-decoration:underline" |
|
|
|
|
|
|
|
else: |
|
|
|
|
|
|
|
underline="" |
|
|
|
if self.decoders[num]['synced']: |
|
|
|
if self.decoders[num]['synced']: |
|
|
|
message_string+="<span style='color:green'>  %i:%0.1fM (%i dB, %i)</span>"% (num,freq/1e6,pilot_SNR,decim_mode) |
|
|
|
message_string+="<span style='color:green;%s'>  %i:%0.1fM (%i dB)</span>"% (underline,num,freq/1e6,pilot_SNR) |
|
|
|
#print("'color:green'>%i:%0.1fM</span>"% (num,freq/1e6)) |
|
|
|
#print("'color:green'>%i:%0.1fM</span>"% (num,freq/1e6)) |
|
|
|
else:#elif self.decoders[num]['synced']==False: |
|
|
|
else:#elif self.decoders[num]['synced']==False: |
|
|
|
#print("'color:red'>%i:%0.1fM</span>"% (num,freq/1e6)) |
|
|
|
#print("'color:red'>%i:%0.1fM</span>"% (num,freq/1e6)) |
|
|
|
message_string+="<span style='color:red'>  %i:%0.1fM (%i dB, %i)</span>"% (num,freq/1e6,pilot_SNR,decim_mode) |
|
|
|
message_string+="<span style='color:red;%s'>  %i:%0.1fM (%i dB)</span>"% (underline,num,freq/1e6,pilot_SNR) |
|
|
|
message_string+="<br>tuned frequency:%0.1fM"%(self.tuning_frequency/1e6) |
|
|
|
message_string+="<br>tuned frequency:%0.1fM"%(self.tuning_frequency/1e6) |
|
|
|
self.signals.DataUpdateEvent.emit({'decoder_frequencies':message_string}) |
|
|
|
self.signals.DataUpdateEvent.emit({'decoder_frequencies':message_string}) |
|
|
|
#print(message_string) |
|
|
|
#print(message_string) |
|
|
|
@ -1095,8 +1104,7 @@ class rds_parser_table_qt_Widget(QtGui.QWidget): |
|
|
|
self.freq_label.setWordWrap(True) |
|
|
|
self.freq_label.setWordWrap(True) |
|
|
|
self.freq_label.setSizePolicy(QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, |
|
|
|
self.freq_label.setSizePolicy(QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, |
|
|
|
QtGui.QSizePolicy.Ignored))#expand in horizontal direction and only wrap if window too small |
|
|
|
QtGui.QSizePolicy.Ignored))#expand in horizontal direction and only wrap if window too small |
|
|
|
#self.freq_label.setTextFormat(QtCore.Qt.RichText) |
|
|
|
self.freq_label.setTextFormat(QtCore.Qt.RichText)#instead of AutoText |
|
|
|
#self.freq_label.setTextFormat(QtCore.Qt.PlainText) |
|
|
|
|
|
|
|
self.count_label=QtGui.QLabel("count:") |
|
|
|
self.count_label=QtGui.QLabel("count:") |
|
|
|
self.count_label.setAlignment(QtCore.Qt.AlignRight) |
|
|
|
self.count_label.setAlignment(QtCore.Qt.AlignRight) |
|
|
|
label_layout.addWidget(self.freq_label) |
|
|
|
label_layout.addWidget(self.freq_label) |
|
|
|
@ -1315,20 +1323,33 @@ class rds_parser_table_qt_Widget(QtGui.QWidget): |
|
|
|
view.setWindowTitle(self.tableobj.RDS_data[PI]["PSN"]) |
|
|
|
view.setWindowTitle(self.tableobj.RDS_data[PI]["PSN"]) |
|
|
|
view.exec_() |
|
|
|
view.exec_() |
|
|
|
def onCLick(self): |
|
|
|
def onCLick(self): |
|
|
|
|
|
|
|
from thread import start_new_thread |
|
|
|
print("button clicked") |
|
|
|
print("button clicked") |
|
|
|
code.interact(local=locals()) |
|
|
|
#code.interact(local=locals()) |
|
|
|
|
|
|
|
start_new_thread(self.interact,()) |
|
|
|
|
|
|
|
def interact(self): |
|
|
|
|
|
|
|
code.interact(local=dict(globals(), **locals())) |
|
|
|
if __name__ == "__main__": |
|
|
|
if __name__ == "__main__": |
|
|
|
from PyQt4 import Qt |
|
|
|
from PyQt4 import Qt |
|
|
|
import sys |
|
|
|
import sys |
|
|
|
|
|
|
|
from thread import start_new_thread |
|
|
|
|
|
|
|
class dummy: |
|
|
|
app = Qt.QApplication(sys.argv) |
|
|
|
def __init__(self): |
|
|
|
mainobj= rds_parser_table_qt_Signals() |
|
|
|
self.colorder=['ID','freq','name','buttons','PTY','AF', |
|
|
|
#mainobj=None |
|
|
|
'time','text','quality','pilot_SNR','RT+'] |
|
|
|
widget = rds_parser_table_qt_Widget(mainobj,"TestLabel") |
|
|
|
self.nPorts=4 |
|
|
|
|
|
|
|
qapp = Qt.QApplication(sys.argv) |
|
|
|
|
|
|
|
signals= rds_parser_table_qt_Signals() |
|
|
|
|
|
|
|
mainobj=dummy() |
|
|
|
|
|
|
|
widget = rds_parser_table_qt_Widget(signals,"TestLabel",mainobj) |
|
|
|
widget.show() |
|
|
|
widget.show() |
|
|
|
widget.setWindowTitle("Test Qt gui") |
|
|
|
widget.setWindowTitle("Test Qt gui") |
|
|
|
widget.setGeometry(200,200,600,300) |
|
|
|
widget.setGeometry(200,200,600,300) |
|
|
|
sys.exit(app.exec_()) |
|
|
|
def quitting(): |
|
|
|
|
|
|
|
print("quitting") |
|
|
|
|
|
|
|
sys.exit() |
|
|
|
|
|
|
|
qapp.connect(qapp, Qt.SIGNAL("aboutToQuit()"), quitting) |
|
|
|
|
|
|
|
qapp.exec_() |
|
|
|
|
|
|
|
#sys.exit(app.exec_()) |
|
|
|
|
|
|
|
|
|
|
|
widget = None |
|
|
|
widget = None |
|
|
|
|