|
|
|
@ -72,7 +72,7 @@ class rds_parser_table_qt(gr.sync_block): |
|
|
|
#print("4st block:"+str(array[6])+","+str(array[7])) |
|
|
|
#print("4st block:"+str(array[6])+","+str(array[7])) |
|
|
|
if (groupType == "0A"):#AF PSN |
|
|
|
if (groupType == "0A"):#AF PSN |
|
|
|
adr=array[3]&0b00000011 |
|
|
|
adr=array[3]&0b00000011 |
|
|
|
segment=chr(array[6])+chr(array[7]) |
|
|
|
segment=self.decode_chars(chr(array[6])+chr(array[7])) |
|
|
|
if(not self.PSNdict.has_key(PI)):#initialize dict |
|
|
|
if(not self.PSNdict.has_key(PI)):#initialize dict |
|
|
|
self.PSNdict[PI]="_"*8 |
|
|
|
self.PSNdict[PI]="_"*8 |
|
|
|
self.PSNvalid[PI]=[False]*8 |
|
|
|
self.PSNvalid[PI]=[False]*8 |
|
|
|
@ -120,7 +120,7 @@ class rds_parser_table_qt(gr.sync_block): |
|
|
|
self.RTvalid[PI]=[False]*64 |
|
|
|
self.RTvalid[PI]=[False]*64 |
|
|
|
else: |
|
|
|
else: |
|
|
|
adr=array[3]&0b00001111 |
|
|
|
adr=array[3]&0b00001111 |
|
|
|
segment=chr(array[4])+chr(array[5])+chr(array[6])+chr(array[7]) |
|
|
|
segment=self.decode_chars(chr(array[4])+chr(array[5])+chr(array[6])+chr(array[7])) |
|
|
|
#print("RT:adress: %d, segment:%s"%(adr,segment)) |
|
|
|
#print("RT:adress: %d, segment:%s"%(adr,segment)) |
|
|
|
#self.signals.DataUpdateEvent.emit({'col':5,'row':port,'PI':PI,'groupType':groupType,'adress':adr,'segment':segment}) |
|
|
|
#self.signals.DataUpdateEvent.emit({'col':5,'row':port,'PI':PI,'groupType':groupType,'adress':adr,'segment':segment}) |
|
|
|
text_list=list(self.RTdict[PI]) |
|
|
|
text_list=list(self.RTdict[PI]) |
|
|
|
@ -194,25 +194,28 @@ class rds_parser_table_qt(gr.sync_block): |
|
|
|
pp.pprint(self.blockcounts) |
|
|
|
pp.pprint(self.blockcounts) |
|
|
|
self.printcounter=0 |
|
|
|
self.printcounter=0 |
|
|
|
#print("group of type %s not decoded on station %s"% (groupType,PI)) |
|
|
|
#print("group of type %s not decoded on station %s"% (groupType,PI)) |
|
|
|
def decode_chars(self,charlist): |
|
|
|
def decode_chars(self,charstring): |
|
|
|
alphabet={ |
|
|
|
alphabet={ |
|
|
|
0b1000:u"áàéèíìóòúùÑÇŞßiIJ", |
|
|
|
0b1000:u"áàéèíìóòúùÑÇŞßiIJ", |
|
|
|
0b1001:u"âäêëîïôöûüñçş??ij", |
|
|
|
0b1001:u"âäêëîïôöûüñçş??ij", |
|
|
|
0b1100:u"ÁÀÉÈÍÌÓÒÚÙŘČŠŽĐĿ", |
|
|
|
0b1100:u"ÁÀÉÈÍÌÓÒÚÙŘČŠŽĐĿ", |
|
|
|
0b1101:u"áàéèíìóòúùřčšžđŀ"} |
|
|
|
0b1101:u"áàéèíìóòúùřčšžđŀ"} |
|
|
|
for i,char in enumerate(charlist): |
|
|
|
charlist=list(charstring) |
|
|
|
if char<= 0b01111111: |
|
|
|
for i,char in enumerate(charstring): |
|
|
|
|
|
|
|
#code.interact(local=locals()) |
|
|
|
|
|
|
|
if ord(char)<= 0b01111111: |
|
|
|
charlist[i]=char #use ascii |
|
|
|
charlist[i]=char #use ascii |
|
|
|
else: |
|
|
|
else: |
|
|
|
#split byte |
|
|
|
#split byte |
|
|
|
alnr=(ord(char)&0xF0 )>>4 #upper 4 bit |
|
|
|
alnr=(ord(char)&0xF0 )>>4 #upper 4 bit |
|
|
|
index=ord(char)&0x0F #lower 4 bit |
|
|
|
index=ord(char)&0x0F #lower 4 bit |
|
|
|
|
|
|
|
#code.interact(local=locals()) |
|
|
|
try: |
|
|
|
try: |
|
|
|
charlist[i]=alphabet[alnr][index] |
|
|
|
charlist[i]=alphabet[alnr][index] |
|
|
|
except KeyError: |
|
|
|
except KeyError: |
|
|
|
charlist[i]=char |
|
|
|
charlist[i]=char |
|
|
|
pass |
|
|
|
pass |
|
|
|
return charlist |
|
|
|
return "".join(charlist) |
|
|
|
def color_text(self, text, start,end,textcolor,segmentcolor): |
|
|
|
def color_text(self, text, start,end,textcolor,segmentcolor): |
|
|
|
formatted_text="<font face='Courier New' color='%s'>%s</font><font face='Courier New' color='%s'>%s</font><font face='Courier New' color='%s'>%s</font>"% (textcolor,text[:start],segmentcolor,text[start:end],textcolor,text[end:]) |
|
|
|
formatted_text="<font face='Courier New' color='%s'>%s</font><font face='Courier New' color='%s'>%s</font><font face='Courier New' color='%s'>%s</font>"% (textcolor,text[:start],segmentcolor,text[start:end],textcolor,text[end:]) |
|
|
|
return formatted_text |
|
|
|
return formatted_text |
|
|
|
@ -234,6 +237,7 @@ class rds_parser_table_qt_Widget(QtGui.QWidget): |
|
|
|
#Data |
|
|
|
#Data |
|
|
|
empty_text32='________________________________' |
|
|
|
empty_text32='________________________________' |
|
|
|
empty_text64='________________________________________________________________' |
|
|
|
empty_text64='________________________________________________________________' |
|
|
|
|
|
|
|
#empty_text64='\xe4'*64 |
|
|
|
self.data = {'ID':range(1,6), |
|
|
|
self.data = {'ID':range(1,6), |
|
|
|
'freq':['','','',''], |
|
|
|
'freq':['','','',''], |
|
|
|
'name':[], |
|
|
|
'name':[], |
|
|
|
|