Hi all,

I have a flowgraph that is reconfigured using a QTgui chooser.
Essentially I generated a simple grc file with all the appropriate blocks
and then edited the python file to change the "set" function of the chooser
to something like:

    def set_onoff(self, onoff):
        if self.onoff==1 and onoff==0:
            self.onoff = onoff
            self._onoff_callback(self.onoff)
            self.lock()
            print('ON-->OFF')
            self.disconnect(self.blocks_throttle2_1,
self.interp_fir_filter_xxx_0)
            self.disconnect(self.interp_fir_filter_xxx_0,
self.qtgui_freq_sink_x_0)
            self.connect(self.blocks_throttle2_1, self.qtgui_freq_sink_x_0)
            self.unlock()
        elif self.onoff==0 and onoff==1:
            self.onoff = onoff
            self._onoff_callback(self.onoff)
            self.lock()
            print('OFF-->ON')
            self.disconnect(self.blocks_throttle2_1,
self.qtgui_freq_sink_x_0)
            self.connect(self.blocks_throttle2_1,
self.interp_fir_filter_xxx_0)
            self.connect(self.interp_fir_filter_xxx_0,
self.qtgui_freq_sink_x_0)
            self.unlock()


this seems to be working fine.

Now I want to accomplish something similar with an embedded python block
that receives a message and makes this change in the flowgraph.
The message handler function of this block should do the reconfiguration.
However, the message handling function does not have access to the
flowgraph...

Is there a way this can be done?

thanks
Achilleas

Reply via email to