Joulescope_ui customization

Hello, I’m going to customize the awesome joulescope’s GUI by adding my widget, available from sidebar menu. The question is… Is there some step-by-step guide which describes what exactly need to do? Thank you.

Hi @airspan - Great to hear you are looking to customize the Joulescope UI!

You have two choices: plugin or directly modifying the source code. A plugin for a new widget is relatively straightforward, and the widget will become availble under the Widgets menu.

I also see that the __init__.py incorrectly shows up as init.py in the plugin documentation markdown since the double underscores are markdown emphasis. I will have to fix that…

Most features within the Joulescope UI are accessible through Publish-Subscribe. The Joulescope UI includes tools to explore internals. Within the UI, check WidgetsSettingsUIdeveloper. You can then add WidgetsPublish Spy and WidgetsPubSub Explorer.

You can access the sidebar instance through registry/SideBar/instance, so it is possible to hack the sidebar from a plugin. However, the sidebar does not have official support for registering a new button & widget from a plugin. Here is how we register widgets today. The button icon is also an SVG that is rendered with the theme colors. See the styles subdirectory. While you can certainly hack this, too, it may just be easier to modify the source code.

If you want to describe what you want to accomplish with your widget, I am happy to provide some guidance for how to make it happen.

What do you think? Does this give you a good enough starting point?

Hi Matt, thank you for responce. Currently I’m just trying to call ExampleWidget from …\widgets\example folder. I managed to add my button to the sidebar menu. The registration looks like the following self._add_button(‘cma’, _CMA_TOOLTIP, ‘ExampleWidget’, ‘cma’). But unfortunately, clicking on the button throws an error File “…\Python\joulescope\joulescope_ui\pubsub.py”, line 609, in _topic_get
return self._topic_by_name[topic]
~~~~~~~~~~~~~~~~~~~^^^^^^^
KeyError: ‘registry/ExampleWidget/instance’ . Could you please point me how to fix it?

Hi @airspan - The problem is that the ExampleWidget is not registered in the production code. If you uncomment its entry in joulescope_ui/widgets/__init__.py, it should work.