Browse Source

external tmc decoder: basic printing; table:fixed indenting (tabs -> spaces), xubdesk-hackrf-flowgraph: set gains/filterbw, now decoding 9 stations 90.8..1077, 270groups in 3 seconds

master
Clemens Richter 9 years ago
parent
commit
44db8a218d
  1. 3
      grc/CMakeLists.txt
  2. 10
      grc/crfa_rds_parser_table_qt.xml
  3. 100
      grc/crfa_tmc_parser.xml
  4. 3
      python/CMakeLists.txt
  5. 1
      python/__init__.py
  6. 2349
      python/rds_parser_table_qt.py
  7. 1346
      python/rds_parser_table_qt.py.bak
  8. 77
      python/tmc_parser.py

3
grc/CMakeLists.txt

@ -31,5 +31,6 @@ install(FILES
crfa_sync_decim.xml
crfa_rds_decoder_redsea.xml
crfa_qtgui_range.xml
crfa_variable_setter.xml DESTINATION share/gnuradio/grc/blocks
crfa_variable_setter.xml
crfa_tmc_parser.xml DESTINATION share/gnuradio/grc/blocks
)

10
grc/crfa_rds_parser_table_qt.xml

@ -5,7 +5,9 @@
<category>[crfa]</category>
<import>import crfa</import>
<import>from crfa.rds_parser_table_qt import rds_parser_table_qt, rds_parser_table_qt_Widget,rds_parser_table_qt_Signals</import>
<!--
<var_make>self.$(id) = $(id) = $value</var_make>
-->
<make>#set $win = 'self._%s_win'%$id
#set $signals = 'self._%s_signals'%$id
#if not $label()
@ -108,7 +110,7 @@ $(gui_hint()($win))</make>
</option>
</param>
<!--
<!--
check if pty list file exists
check directory doesnt work:
<check>os.path.isdir($workdir)</check>
@ -135,7 +137,11 @@ check if pty list file exists
<type>message</type>
<optional>1</optional>
</source>
<source>
<name>tmc_raw</name>
<type>message</type>
<optional>1</optional>
</source>
<doc>show RDS data from multiple stations in QT table \
input: raw group data (array of ints) \
4x2 raw block data, 4x1 offset chars, 1x1 number of valid blocks (of last 50) \

100
grc/crfa_tmc_parser.xml

@ -0,0 +1,100 @@
<?xml version="1.0"?>
<block>
<name>tmc_parser</name>
<key>crfa_tmc_parser</key>
<category>crfa</category>
<import>import crfa</import>
<make>#set $win = 'self._%s_win'%$id
#set $parser = 'self.%s_parser'%$id
#if not $label()
#set $label = '"%s"'%$id
#end if
$(parser) = crfa.tmc_parser($workdir, $log, $debug, $writeDB)
$(win) = $(parser).getqtwidget()
$(gui_hint()($win))
</make>
<!--
crfa.tmc_parser($workdir, $log, $debug, $writeDB)
-->
<param>
<name>work directory</name>
<key>workdir</key>
<value></value>
<type>string</type>
<hide>part</hide>
</param>
<param>
<name>Label</name>
<key>label</key>
<value></value>
<type>string</type>
<hide>#if $label() then 'none' else 'part'#</hide>
</param>
<param>
<name>Log</name>
<key>log</key>
<value>False</value>
<type>bool</type>
<option>
<name>Enable</name>
<key>True</key>
</option>
<option>
<name>Disable</name>
<key>False</key>
</option>
</param>
<param>
<name>Debug</name>
<key>debug</key>
<value>False</value>
<type>bool</type>
<option>
<name>Enable</name>
<key>True</key>
</option>
<option>
<name>Disable</name>
<key>False</key>
</option>
</param>
<param>
<name>write Database</name>
<key>writeDB</key>
<value>False</value>
<type>bool</type>
<!--<hide>part</hide>-->
<option>
<name>Enable</name>
<key>True</key>
</option>
<option>
<name>Disable</name>
<key>False</key>
</option>
</param>
<param>
<name>GUI Hint</name>
<key>gui_hint</key>
<value></value>
<type>gui_hint</type>
<hide>part</hide>
</param>
<!--
check if event-list file exists
check directory doesnt work:
<check>os.path.isdir($workdir)</check>
-->
<check>open($workdir+"event-list_with_forecast_sort.csv").close() or True</check>
<!--
check if workdir is writable
-->
<check>open($workdir+"directory_writable","w").close() or True</check>
<sink>
<name>in</name>
<type>message</type>
<optional>1</optional>
</sink>
</block>

3
python/CMakeLists.txt

@ -43,7 +43,8 @@ GR_PYTHON_INSTALL(
decoder_compare.py
qtgui_range.py
variable_setter.py
tmc_classes.py DESTINATION ${GR_PYTHON_DIR}/crfa
tmc_classes.py
tmc_parser.py DESTINATION ${GR_PYTHON_DIR}/crfa
)
########################################################################

1
python/__init__.py

@ -43,4 +43,5 @@ from vector_cutter import vector_cutter
from decoder_compare import decoder_compare
from qtgui_range import qtgui_range
from variable_setter import variable_setter
from tmc_parser import tmc_parser
#

2349
python/rds_parser_table_qt.py

File diff suppressed because it is too large Load Diff

1346
python/rds_parser_table_qt.py.bak

File diff suppressed because it is too large Load Diff

77
python/tmc_parser.py

@ -0,0 +1,77 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2017 <+YOU OR YOUR COMPANY+>.
#
# This is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this software; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
#
import numpy
from gnuradio import gr
import pmt
from PyQt4 import Qt, QtCore, QtGui
class tmc_parser(gr.sync_block):
"""
docstring for block tmc_parser
"""
def __init__(self, workdir,log,debug,writeDB):
gr.sync_block.__init__(self,
name="tmc_parser",
in_sig=None,
out_sig=None)
self.message_port_register_in(pmt.intern('in'))
self.set_msg_handler(pmt.intern('in'), self.handle_msg)
self.qtwidget=tmc_parser_Widget(self)
def handle_msg(self,msg):
m=pmt.to_python(msg)
self.qtwidget.updateui()
print(m)
def getqtwidget(self):
return self.qtwidget
class tmc_parser_Widget(QtGui.QWidget):
def updateui(self):
print("updating ui")
def filterChanged(self):
print("filter changed")
def __init__(self, parser):
QtGui.QWidget.__init__(self)
layout = Qt.QVBoxLayout()
self.setLayout(layout)
self.parser=parser
self.tmc_message_label=QtGui.QLabel("TMC messages:")
self.event_filter=QtGui.QLineEdit()#QPlainTextEdit ?
self.location_filter=QtGui.QLineEdit(u"Baden-Württemberg")
self.event_filter.returnPressed.connect(self.filterChanged)
self.location_filter.returnPressed.connect(self.filterChanged)
filter_layout = Qt.QHBoxLayout()
filter_layout.addWidget(QtGui.QLabel("event filter:"))
filter_layout.addWidget(self.event_filter)
filter_layout.addWidget(QtGui.QLabel("location filter:"))
filter_layout.addWidget(self.location_filter)
layout.addLayout(filter_layout)
layout.addWidget(self.tmc_message_label)
self.logOutput = Qt.QTextEdit()
self.logOutput.setReadOnly(True)
self.logOutput.setLineWrapMode(Qt.QTextEdit.NoWrap)
self.logOutput.setMaximumHeight(150)
font = self.logOutput.font()
font.setFamily("Courier")
font.setPointSize(10)
layout.addWidget(self.logOutput)
self.clip = QtGui.QApplication.clipboard()
Loading…
Cancel
Save