Browse Source

added display of decim-mode to table

dev
Clemens Richter 9 years ago
parent
commit
2d8e4a6501
  1. 2
      apps/fft-multi-decoder_fixed_hackrf.grc
  2. 6
      apps/ifft-RDS-decoder_hier-block.grc
  3. 6
      apps/read_fmdec.grc
  4. 5
      grc/multirds_sync_decim.xml
  5. 2
      lib/rds_decoder_redsea_impl.cc
  6. 23
      lib/sync_decim_impl.cc
  7. 15
      python/rds_parser_table_qt.py

2
apps/fft-multi-decoder_fixed_hackrf.grc

@ -3244,7 +3244,7 @@ class blk(gr.sync_block): # other base classes are basic_block, decim_block, in
</param>
<param>
<key>_enabled</key>
<value>1</value>
<value>0</value>
</param>
<param>
<key>_coordinate</key>

6
apps/ifft-RDS-decoder_hier-block.grc

@ -3488,6 +3488,12 @@
<source_key>out</source_key>
<sink_key>in</sink_key>
</connection>
<connection>
<source_block_id>multirds_sync_decim_0</source_block_id>
<sink_block_id>pad_sink_0_0</sink_block_id>
<source_key>ctrl</source_key>
<sink_key>in</sink_key>
</connection>
<connection>
<source_block_id>multirds_sync_decim_0</source_block_id>
<sink_block_id>blocks_file_sink_0_0_0</sink_block_id>

6
apps/read_fmdec.grc

@ -2692,6 +2692,12 @@ class blk(gr.sync_block): # other base classes are basic_block, decim_block, in
<source_key>tmc_raw</source_key>
<sink_key>in</sink_key>
</connection>
<connection>
<source_block_id>multirds_sync_decim_0</source_block_id>
<sink_block_id>multirds_rds_parser_table_qt_0</sink_block_id>
<source_key>ctrl</source_key>
<sink_key>in</sink_key>
</connection>
<connection>
<source_block_id>multirds_sync_decim_0</source_block_id>
<sink_block_id>digital_binary_slicer_fb_0</sink_block_id>

5
grc/multirds_sync_decim.xml

@ -58,6 +58,11 @@
* type
* vlen
* optional (set to 1 for optional inputs) -->
<source>
<name>ctrl</name>
<type>message</type>
<optional>1</optional>
</source>
<source>
<name>out</name>
<type>float</type>

2
lib/rds_decoder_redsea_impl.cc

@ -187,7 +187,7 @@ uint32_t rds_decoder_redsea_impl::correctBurstErrors(uint32_t block, char offset
if (kErrorLookup.count({syndrome, offset}) > 0) {
uint32_t err = kErrorLookup.at({syndrome, offset});
//dout << "correcting"<<std::endl;
//err=0;//correction disabled
err=0;//correction disabled
corrected_block ^= err;
}

23
lib/sync_decim_impl.cc

@ -53,6 +53,7 @@ namespace gr {
{
message_port_register_in(pmt::mp("ctrl"));
set_msg_handler(pmt::mp("ctrl"), boost::bind(&sync_decim_impl::parse_ctrl_msg, this, _1));
message_port_register_out(pmt::mp("ctrl"));
//init persistant vars
last_input=0;
mode=COPY;
@ -74,10 +75,16 @@ namespace gr {
pmt::pmt_t meta = pmt::car(pdu); // meta declares type 0:RDS, 1:sync/nosync
pmt::pmt_t sync = pmt::cdr(pdu);
if(1L==pmt::to_long(meta) && pmt::eqv(sync,pmt::PMT_F)){
lout<< "switched to copy"<<std::endl;
if (mode != COPY){
pmt::pmt_t meta(pmt::from_long(4));
pmt::pmt_t data(pmt::from_long(COPY));
pmt::pmt_t pdu(pmt::cons(meta, data)); // make PDU: (metadata, data) pair
message_port_pub(pmt::mp("ctrl"), pdu);
lout<< "switched to copy"<<std::endl;
}
//lout<<"mode: "<<mode<<std::endl;
mode=COPY;
lout<<"mode: "<<mode<<std::endl;
//lout<<"mode: "<<mode<<std::endl;
//lout<<"weakout_counter:"<<weakout_counter<<std::endl;
//weakout_counter=0;
//outbit_counter=0;
@ -92,7 +99,7 @@ namespace gr {
{
const float *in = (const float *) input_items[0];
float *out = (float *) output_items[0];
if(outbit_counter>1000){
if(outbit_counter>4000){
outbit_counter=0;
weakout_counter=0;
lout<<"mode: "<<mode<<std::endl;
@ -117,7 +124,7 @@ namespace gr {
}
}
last_input=in[(noutput_items-1)*DECIM+1];//to use for next iteration of work
//lout<<noutput_items<<std::endl;
lout<<noutput_items<<std::endl;
/*synchronize:*/
if(mode==COPY and dosync_counter>=SYNC_COUNTER_MAX){
@ -147,9 +154,17 @@ namespace gr {
}
if (skip_is_better_counter>3){//2017-05-02 lowered from 6
mode=SKIP;
pmt::pmt_t meta(pmt::from_long(4));
pmt::pmt_t data(pmt::from_long(mode));
pmt::pmt_t pdu(pmt::cons(meta, data)); // make PDU: (metadata, data) pair
message_port_pub(pmt::mp("ctrl"), pdu);
lout<<"switched to skip"<< std::endl;
}
else if (skip_is_better_counter<-3){
pmt::pmt_t meta(pmt::from_long(4));
pmt::pmt_t data(pmt::from_long(mode));
pmt::pmt_t pdu(pmt::cons(meta, data)); // make PDU: (metadata, data) pair
message_port_pub(pmt::mp("ctrl"), pdu);
mode=NOSKIP;
lout<<"switched to noskip"<< std::endl;
}

15
python/rds_parser_table_qt.py

@ -90,7 +90,7 @@ class rds_parser_table_qt(gr.sync_block):#START
self.decoder_frequencies={}
self.decoders=[]
for i in range(nPorts):
self.decoders.append({'synced':False,'freq':None,'PI':"",'pilot_SNR':0})
self.decoders.append({'synced':False,'freq':None,'PI':"",'pilot_SNR':0,'decim_mode':0})
#self.decoder_synced={}
#self.colorder=['ID','freq','name','PTY','AF','time','text','quality','buttons']
self.colorder=['ID','freq','name','buttons','PTY','AF','time','text','quality','pilot_SNR','RT+']
@ -180,12 +180,13 @@ class rds_parser_table_qt(gr.sync_block):#START
for num in self.decoder_frequencies:
freq=self.decoder_frequencies[num]
pilot_SNR=self.decoders[num]['pilot_SNR']
decim_mode=self.decoders[num]['decim_mode']
if self.decoders[num]['synced']:
message_string+="<span style='color:green'>&emsp; %i:%0.1fM (%i dB)</span>"% (num,freq/1e6,pilot_SNR)
message_string+="<span style='color:green'>&emsp; %i:%0.1fM (%i dB, %i)</span>"% (num,freq/1e6,pilot_SNR,decim_mode)
#print("'color:green'>%i:%0.1fM</span>"% (num,freq/1e6))
else:#elif self.decoders[num]['synced']==False:
#print("'color:red'>%i:%0.1fM</span>"% (num,freq/1e6))
message_string+="<span style='color:red'>&emsp; %i:%0.1fM (%i dB)</span>"% (num,freq/1e6,pilot_SNR)
message_string+="<span style='color:red'>&emsp; %i:%0.1fM (%i dB, %i)</span>"% (num,freq/1e6,pilot_SNR,decim_mode)
message_string+="<br>tuned frequency:%0.1fM"%(self.tuning_frequency/1e6)
self.signals.DataUpdateEvent.emit({'decoder_frequencies':message_string})
#print(message_string)
@ -239,7 +240,7 @@ class rds_parser_table_qt(gr.sync_block):#START
self.RDS_data[PI]["time"]={"timestring":"88:88","datestring":"00-00-0000","datetime":None}
self.RDS_data[PI]["wrong_block_ratio"]=1#100%
def handle_msg(self, msg, port):#port from 0 to 3
if pmt.to_long(pmt.car(msg))==1L:
if pmt.to_long(pmt.car(msg))==1L:#sync/desync messages from RDS decoder
synced=pmt.to_python(pmt.cdr(msg))
#print("port:%i, data: %s"%(port,data))
self.decoders[port]['synced']=synced
@ -250,7 +251,7 @@ class rds_parser_table_qt(gr.sync_block):#START
wrong_block_ratio=1#100%
self.RDS_data[PI]["wrong_block_ratio"]=wrong_block_ratio
self.signals.DataUpdateEvent.emit({'PI':PI,'wrong_block_ratio':wrong_block_ratio,'dots':dots})
elif pmt.to_long(pmt.car(msg))==2L:
elif pmt.to_long(pmt.car(msg))==2L:#wrong_block_ratio messages from RDS decoder
wrong_block_ratio=pmt.to_python(pmt.cdr(msg))
PI=self.decoders[port]['PI']
if self.RDS_data.has_key(PI):
@ -264,6 +265,10 @@ class rds_parser_table_qt(gr.sync_block):#START
PI=self.decoders[port]['PI']
if self.RDS_data.has_key(PI):
self.signals.DataUpdateEvent.emit({'PI':PI,'pilot_SNR':pilot_SNR})
elif pmt.to_long(pmt.car(msg))==4L:#mode messages from RDS sync_decim
mode=pmt.to_python(pmt.cdr(msg))
self.decoders[port]['decim_mode']=mode
self.update_freq()
else: #elif pmt.to_long(pmt.car(msg))==0L
array=pmt.to_python(msg)[1]

Loading…
Cancel
Save