Tuesday, August 27, 2024

GNURadio Flowgraph Properties Pages

 
Have you noticed that when you run a GNURadio Flowgraph and resize the QT GUI window, that on the next run of that Flowgraph the window returns to that last set size?

That’s commonly called a “Window Size Property”. programs have used a variety of methods of saving and recalling properties over the decades. QT, the base graphics GUI engine used in the GNURadio Flowgraphs is no different.

If you look at the Python program produced by a Flowgraph you will see right up at the top in the __init__() method a few lines of code as shown in figure 1.

 

Figure 1 - A generated Python Flowgraph file contains an __init__() method that contains these few lines that recall the last set window geometry, or size using standard QT method calls. The Base Key is named: "GNU Radio", the Flowgraph name in this case was called "themes_1", the property recalled is named: "geometry".


Where’s Waldo?

But where is this property called “geometry” saved? Usually, the directory “%APPDATA%” is used to save standard Windows properties, then it stores them in a folder named after the App, and finally, it saves the properties themselves in some file, such as an “INI” file.

Again, with GNURadio running on Windows [1], this resting place of the Properties is not in the standard Windows location and is rather hard to figure out.

After searching the QT Documentation for the QSettings() method (for an hour), I found out that the default place to save the settings on Windows is in the Registry of all places (figure 2)!

Figure 2 - If you want to find the Flowgraph Properties Settings storage location, you will have to look into the registry. The path shows here, "HKEY_CURRENT_USER\Software\GNU Radio". There you see some of the many Flowgraphs that I have run. This list will be added to every time you run a Flowgraph with a new name!

 

What This Means

The registry will create a property Settings entry every time you run a Flowgraph with a new name to save the last set window size (geometry). You can’t do anything directly with this value as it is in binary and not human readable, but it is there.

If you are like me, where you make a lot of small Flowgraphs to just see how this or that block works, you will quickly end up with a lot of Registry entries.

You can delete the unused entries by hand, naturally, but this seems like a poor design decision (to me).

It is what it is, and at least you know where they are stored now.

 

References

[1] How to set an external code editor in GNURadio running Windows -https://gnuradio-cookbook.blogspot.com/2024/07/how-to-configure-external-editor-for.html

 

No comments:

Post a Comment