Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin Tabs #27

Open
philipstarkey opened this issue Aug 21, 2017 · 5 comments
Open

Plugin Tabs #27

philipstarkey opened this issue Aug 21, 2017 · 5 comments
Labels
enhancement New feature or request minor

Comments

@philipstarkey
Copy link
Member

Original report (archived issue) by Jan Werkmann (Bitbucket: PhyNerd, GitHub: PhyNerd).


Plugins should be able to spawn tabs to easily display information along with that of devices.

I've already played around with this a bit in a branch of my repo. Before I continue development of this feature I'd like to get some opinions on the following questions:

Should a Plugin be able to spawn more than one Tab?

I think one Tab for each Plugin should be enough. It wouldn't be hard to implement more though.

Should a Plugin need to implement a Worker for the tab to work?

The current implementation of Tab in BLACS is very device centered and has lot's of device specific stuff stored in it. One problem with this among others is that each tab needs to have a worker to function properly. It would be a lot of work to separate the device specific stuff out of tabs and move it to DeviceTab. Is this something we should do or do we stick to the base class and make adjustments in a PluginTab class like my brach does?

@philipstarkey
Copy link
Member Author

Original comment by Philip Starkey (Bitbucket: pstarkey, GitHub: philipstarkey).


I'm not sure if anything so complicated is necessary. I would advocate for following the model of the menu and notifications in plugins where the plugin just returns a list of classes to be instantiated by BLACS. It could be assumed these classes will be passed a reference to a notebook (in the same way the device tabs are) and a settings dictionary when they are instantiated by BLACS in __main__.py during plugin setup (like we do with the notification classes).

Whether these tab classes add one or more tabs to the notebook, is up to them. As is the form they take; I cant foresee the need for plugin tabs having a worker process, but the above does not preclude that.

In short, the less prescription here, the better!


One possible issue that needs cleaning up is the communication between notifications/menus/settings/tab classes defined in a plugin. Because BLACS handles the instantiation of those classes, they don't always have a clean way of communicating. I did some hacks (e.g. Plugin.set_notification_instances and plugin_setup_complete) but with tabs as well, that may need to be revisited so it makes sense.

@philipstarkey
Copy link
Member Author

Original comment by Jan Werkmann (Bitbucket: PhyNerd, GitHub: PhyNerd).


Yeah that idea is better then mine but I'll make the list of classes a dict to that we can name the tabs.

@philipstarkey
Copy link
Member Author

Original comment by Jan Werkmann (Bitbucket: PhyNerd, GitHub: PhyNerd).


  • Edited issue description

@philipstarkey
Copy link
Member Author

Original comment by Jan Werkmann (Bitbucket: PhyNerd, GitHub: PhyNerd).


As for the issue of communication we could pass the tabs in plugin_setup_complete maybe? For more high level communication each plugin could think of something itself as this can become very application specific. Some plugins might not even need communication and just implement a mainloop doing whatever.

@philipstarkey
Copy link
Member Author

Original comment by Philip Starkey (Bitbucket: pstarkey, GitHub: philipstarkey).


Well we can leave the communication for now. Likely you just need a way to connect Qt signals between the objects for the different parts of the plugins, but the implementation of this can be deferred until there is a specific use case.

@philipstarkey philipstarkey added minor enhancement New feature or request labels Apr 5, 2020
Loki27182 pushed a commit to Loki27182/blacs that referenced this issue Oct 9, 2023
Bugfix to use python 2 configparser syntax in getting config keys
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request minor
Projects
None yet
Development

No branches or pull requests

1 participant