discuss-gnuradio
[Top][All Lists]
Advanced

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

QT Chooser build error


From: R.P. Merrell
Subject: QT Chooser build error
Date: Fri, 21 May 2021 11:50:26 +0100

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.




reply via email to

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