mistic-lab / gr-flex

An Out of tree GNU Radio block for communicating with the Flex radio
MIT License
13 stars 2 forks source link

All existing panadapters are destroyed when the block initializes #16

Closed nsbruce closed 6 years ago

nsbruce commented 6 years ago

See a comment in FlexSource.py which starts with "TODO"

nsbruce commented 6 years ago

We have a few ways of approaching this. The Flex which we're using can have up to 8 panadapters running so I think we should set it so that the priorities are:

  1. If there are less than 8 panadapters active, add one
  2. If there are 8 panadapters active, destroy the oldest (assumed to be pan1) and add an 8th (pan8) since I think that they cascade.

This is the best case scenario (that they cascade) since we would be removing from the front of the list and adding to the end, so if we need to have multiple panadapters in one flowgraph, our second pan doesn't destroy our first.

If they do not cascade, we're going to have to figure out a way to record which pans were initialized from GR so that we can destroy only the others.

nsbruce commented 6 years ago

We also need to check for number of dax_iq_streams in use. We need one per pan the way things are currently setup.

cjam commented 6 years ago

Something to keep in mind here is that the FlexLibMono API has the notion of a client, which is a particular machine/session that is currently connected to the flex. I believe the reason I destroyed everything and recreated it is because the API wouldn't (without refactoring) return back any panadapters that weren't created by the current client. Will need to test it out, but I believe that's why I was destroying them on start.

nsbruce commented 6 years ago

Yea so I think that it would be a cool improvement in the future to check which pans are active and avoid destroying them if necessary.

For now, I'm going to destroy all panadapters on start and 'claim' the Flex. I'll move panadapter management into radio.cs (probably?) and try to set it up such that FlexSource.py is only used once for each panadapter. That way multiple blocks or channels per flow graph can later become a thing (ref. Issue #3)

cjam commented 6 years ago

Radio.cs already manages the panadapters internally. It manages a list of them as it parses status messages from the radio. You will likely just want to move the clearing of panadapters into the Flex.py so that it is only done once when a flowgraph is spun up.