Closed nsbruce closed 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:
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.
We also need to check for number of dax_iq_streams in use. We need one per pan the way things are currently setup.
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.
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)
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.
See a comment in FlexSource.py which starts with "TODO"