Skip to content

Python: Is there a way to detect if a plot window has been closed? #173

Description

@lemerchand

Hi, I've scoured the docs and and github issues but haven't been able to solve my issue. TL;DR I'd like to know how I can tell if a GR window is open or closed. If you want some more details I've provided them below.

I'm working on an oscilloscope program that can look at units such as db/rms/volts/amplitude of a microphone that can be toggled by a button. As of right now the process looks like this:

  1. Run program
  2. Enable a microphone input
  3. Press 'Plot oscilloscope'
  4. Read measurements, and possibly:
    i. stop and save the audio
    ii. change the unit of measurement

As of right now, if I want to (b) change the unit of measurement I either have to (A):

  1. Disable the mic to stop input to the GR view port
  2. Close the GR window
  3. Modify the settings for the axis
  4. Repeat steps (3-4)

Or (B), set the program up to just always run the GR code when the mic enabled button is on. This works well as it allows me to change the units in realtime, or even leave the oscilloscope window up even when the mic is toggled off. However....

The issue with (B) is that I would like to have the option to enable the microphone without opening the oscilloscope window. If I could query the visibility of the plot window things would be simple as pie.

Does anyone have any suggestions?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions