discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: QT Chooser build error


From: Marcus Müller
Subject: Re: QT Chooser build error
Date: Fri, 21 May 2021 15:06:48 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1

Hi Richard!

It's super cool that the first thing you do to get to know GNU Radio is fix our 
stuff :)
Regarding fixing the yml file not helping: Make sure you've deleted the GRC 
block cache;
on most platforms it's under ~/.cache/grc_gnuradio .

Other than that: if you could share a flow graph, e.g. by putting it on 
pastebin or
gist.github.com, then we could try to reproduce. We'd only need to know the 
exact version
of GNU Radio you're using, too!

Best regards, and thank you!
Marcus

On 21.05.21 12:50, R.P. Merrell wrote:
> Hi,
> 
> I am very new to this and somewhat unfamiliar with Python so I have been
> getting my head around GNU radio via the GNU Companion interface (which I
> like).
> 
> I am trying to get a NB/WB switch arrangement working using the QT Chooser
> block and the selector block. Without the chooser block and hard setting the
> selector block for each output in turn I can get the Rx path to be either NB
> or WB FM so I know the select block is working fine, when I add the Chooser
> block I get the following build error:
> 
> Generate Error: (NameError("'i' is not defined"), '<%\n    all_options = [
> value, option1, option2, option3, option4 ][:int(num_opts)]\n    all_labels
> = [ label0, label1, label2, label3, label4 ][:int(num_opts)]\n%>\\\n# Create
> the options list\n% if int(num_opts):\nself._${id}_options = (\\\n% for ch
> in all_options:\n${ch}, \\\n% endfor\n)\n% else:\nself._${id}_options =
> ${options}\n% endif\n# Create the labels list\n% if
> int(num_opts):\nself._${id}_labels = (\\\n% for lbl in all_labels:\n% if
> lbl:\n${lbl}, \\\n% else:\nself._${id}_options[${i}], \\\n% endif\n%
> endfor\n)\n% elif labels:\nself._${id}_labels = ${labels}\n%
> else:\nself._${id}_map(str, self._${id}_options)\n% endif\n# Create the
> combo box\n% if widget == \'combo_box\':\n<%\n    win =
> \'self._%s_tool_bar\'%id\n%>\\\n${win} =
> Qt.QToolBar(self)\n${win}.addWidget(Qt.QLabel(${(label if (len(label) - 2 >
> 0) else repr(id))} + ": "))\nself._${id}_combo_box =
> Qt.QComboBox()\n${win}.addWidget(self._${id}_combo_box)\nfor _label in
> self._${id}_labels:
> self._${id}_combo_box.addItem(_label)\nself._${id}_callback = lambda i:
> Qt.QMetaObject.invokeMethod(self._${id}_combo_box, "setCurrentIndex",
> Qt.Q_ARG("int",
> self._${id}_options.index(i)))\nself._${id}_callback(self.${id})\nself._${id
> }_combo_box.currentIndexChanged.connect(\n    lambda i:
> self.set_${id}(self._${id}_options[i]))\n% endif\n# Create the radio
> buttons\n% if widget == \'radio_buttons\':\n<%\n    win =
> \'self._%s_group_box\'%id\n%>\\\n${win} = Qt.QGroupBox(${(label if
> (len(label) - 2 > 0) else repr(id))} + ": ")\nself._${id}_box =
> ${orient}()\nclass variable_chooser_button_group(Qt.QButtonGroup):\n    def
> __init__(self, parent=None):\n        Qt.QButtonGroup.__init__(self,
> parent)\n    @pyqtSlot(int)\n    def updateButtonChecked(self, button_id):\n
> self.button(button_id).setChecked(True)\nself._${id}_button_group =
> variable_chooser_button_group()\n${win}.setLayout(self._${id}_box)\nfor i,
> _label in enumerate(self._${id}_labels):\n    radio_button =
> Qt.QRadioButton(_label)\n    self._${id}_box.addWidget(radio_button)\n
> self._${id}_button_group.addButton(radio_button, i)\nself._${id}_callback =
> lambda i: Qt.QMetaObject.invokeMethod(self._${id}_button_group,
> "updateButtonChecked", Qt.Q_ARG("int",
> self._${id}_options.index(i)))\nself._${id}_callback(self.${id})\nself._${id
> }_button_group.buttonClicked[int].connect(\n    lambda i:
> self.set_${id}(self._${id}_options[i]))\n% endif\n${gui_hint() % win}')
>>>> Failure
> 
> I think I found the error in the qtgui_chooser.block.yml file in line 146
> but when I attempt to correct it I still get the same error.
> 
> Do I need to do something else for the companion interface to pick up the
> corrected block? Or is that not the error and I am missing something else
> more fundamental??
> 
> Richard.
> 
> 

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]