Skip to content

Commit 7155cd8

Browse files
committed
directly calling the extension opens the dashboard, set the right preset from config and load extension
1 parent 5316f3f commit 7155cd8

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

src/pymodaq_plugins_teaching/extensions/gen_ext.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@
1010
from typing import Optional
1111
from pymodaq.extensions.utils import CustomExt
1212

13+
14+
from pymodaq_plugins_teaching.utils import Config as PluginConfig
15+
16+
plugin_config = PluginConfig()
17+
18+
19+
20+
1321
EXTENSION_NAME = 'Generator' # the name that will be displayed in the extension list in the
1422
# dashboard
1523
CLASS_NAME = 'GenExt' # this should be the name of your class defined below
@@ -86,3 +94,19 @@ def get_dwa_and_show(self, dte: DataToExport):
8694
self.dwa_ftt = self.dwa_raw.ft()
8795
self.viewer1D_fft.show_data(self.dwa_ftt.abs())
8896

97+
98+
def main():
99+
from pymodaq_gui.utils.utils import mkQApp
100+
from pymodaq.utils.gui_utils.loader_utils import load_dashboard_with_preset
101+
102+
app = mkQApp('GenExt')
103+
104+
preset_file_name = plugin_config('preset')
105+
dashboard, extension, win = load_dashboard_with_preset(preset_file_name, EXTENSION_NAME)
106+
app.exec()
107+
108+
return dashboard, extension, win
109+
110+
111+
if __name__ == '__main__':
112+
main()

0 commit comments

Comments
 (0)