Skip to content

Commit c90cd39

Browse files
authored
Merge pull request #33 from quantumm/feature/replace_todo_import_wrapper
Replace first TODO instruction to import the wrapper of the instrument
2 parents 76aa9e2 + ecade77 commit c90cd39

4 files changed

Lines changed: 30 additions & 22 deletions

File tree

src/pymodaq_plugins_template/daq_move_plugins/daq_move_Template.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,19 @@
66
from pymodaq_utils.utils import ThreadCommand # object used to send info back to the main thread
77
from pymodaq_gui.parameter import Parameter
88

9-
10-
class PythonWrapperOfYourInstrument:
11-
# TODO Replace this fake class with the import of the real python wrapper of your instrument
12-
pass
9+
# TODO:
10+
# Replace the following fake import with the import of the real Python wrapper of your instrument. Here we suppose that
11+
# the wrapper is in the hardware directory, but it could come from an external librairy like pylablib or pymeasure.
12+
from pymodaq_plugins_template.hardware.python_wrapper_file_of_your_instrument import PythonWrapperObjectOfYourInstrument
1313

1414
# TODO:
1515
# (1) change the name of the following class to DAQ_Move_TheNameOfYourChoice
1616
# (2) change the name of this file to daq_move_TheNameOfYourChoice ("TheNameOfYourChoice" should be the SAME
1717
# for the class name and the file name.)
1818
# (3) this file should then be put into the right folder, namely IN THE FOLDER OF THE PLUGIN YOU ARE DEVELOPING:
1919
# pymodaq_plugins_my_plugin/daq_move_plugins
20+
21+
2022
class DAQ_Move_Template(DAQ_Move_base):
2123
""" Instrument plugin class for an actuator.
2224
@@ -56,7 +58,7 @@ class DAQ_Move_Template(DAQ_Move_base):
5658
def ini_attributes(self):
5759
# TODO declare the type of the wrapper (and assign it to self.controller) you're going to use for easy
5860
# autocompletion
59-
self.controller: PythonWrapperOfYourInstrument = None
61+
self.controller: PythonWrapperObjectOfYourInstrument = None
6062

6163
#TODO declare here attributes you want/need to init with a default value
6264
pass
@@ -133,7 +135,7 @@ def ini_stage(self, controller=None):
133135
"""
134136
raise NotImplementedError # TODO when writing your own plugin remove this line and modify the ones below
135137
if self.is_master: # is needed when controller is master
136-
self.controller = PythonWrapperOfYourInstrument(arg1, arg2, ...) # arguments for instantiation!)
138+
self.controller = PythonWrapperObjectOfYourInstrument(arg1, arg2, ...) # arguments for instantiation!)
137139
initialized = self.controller.a_method_or_atttribute_to_check_if_init() # todo
138140
# todo: enter here whatever is needed for your controller initialization and eventual
139141
# opening of the communication channel

src/pymodaq_plugins_template/daq_viewer_plugins/plugins_0D/daq_0Dviewer_Template.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77
from pymodaq.control_modules.viewer_utility_classes import DAQ_Viewer_base, comon_parameters, main
88
from pymodaq.utils.data import DataFromPlugins
99

10-
class PythonWrapperOfYourInstrument:
11-
# TODO Replace this fake class with the import of the real python wrapper of your instrument
12-
pass
10+
# TODO:
11+
# Replace the following fake import with the import of the real Python wrapper of your instrument. Here we suppose that
12+
# the wrapper is in the hardware directory, but it could come from an external librairy like pylablib or pymeasure.
13+
from pymodaq_plugins_template.hardware.python_wrapper_file_of_your_instrument import PythonWrapperObjectOfYourInstrument
1314

1415
# TODO:
1516
# (1) change the name of the following class to DAQ_0DViewer_TheNameOfYourChoice
@@ -18,6 +19,7 @@ class PythonWrapperOfYourInstrument:
1819
# (3) this file should then be put into the right folder, namely IN THE FOLDER OF THE PLUGIN YOU ARE DEVELOPING:
1920
# pymodaq_plugins_my_plugin/daq_viewer_plugins/plugins_0D
2021

22+
2123
class DAQ_0DViewer_Template(DAQ_Viewer_base):
2224
""" Instrument plugin class for a OD viewer.
2325
@@ -47,7 +49,7 @@ class DAQ_0DViewer_Template(DAQ_Viewer_base):
4749
def ini_attributes(self):
4850
# TODO declare the type of the wrapper (and assign it to self.controller) you're going to use for easy
4951
# autocompletion
50-
self.controller: PythonWrapperOfYourInstrument = None
52+
self.controller: PythonWrapperObjectOfYourInstrument = None
5153

5254
#TODO declare here attributes you want/need to init with a default value
5355
pass
@@ -84,7 +86,7 @@ def ini_detector(self, controller=None):
8486

8587
raise NotImplementedError # TODO when writing your own plugin remove this line and modify the one below
8688
if self.is_master:
87-
self.controller = PythonWrapperOfYourInstrument() #instantiate you driver with whatever arguments are needed
89+
self.controller = PythonWrapperObjectOfYourInstrument() #instantiate you driver with whatever arguments are needed
8890
self.controller.open_communication() # call eventual methods
8991
initialized = self.controller.a_method_or_atttribute_to_check_if_init() # TODO
9092
else:

src/pymodaq_plugins_template/daq_viewer_plugins/plugins_1D/daq_1Dviewer_Template.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
from pymodaq.control_modules.viewer_utility_classes import DAQ_Viewer_base, comon_parameters, main
88
from pymodaq.utils.data import DataFromPlugins
99

10-
11-
class PythonWrapperOfYourInstrument:
12-
# TODO Replace this fake class with the import of the real python wrapper of your instrument
13-
pass
10+
# TODO:
11+
# Replace the following fake import with the import of the real Python wrapper of your instrument. Here we suppose that
12+
# the wrapper is in the hardware directory, but it could come from an external librairy like pylablib or pymeasure.
13+
from pymodaq_plugins_template.hardware.python_wrapper_file_of_your_instrument import PythonWrapperObjectOfYourInstrument
1414

1515
# TODO:
1616
# (1) change the name of the following class to DAQ_1DViewer_TheNameOfYourChoice
@@ -51,7 +51,7 @@ class DAQ_1DViewer_Template(DAQ_Viewer_base):
5151
def ini_attributes(self):
5252
# TODO declare the type of the wrapper (and assign it to self.controller) you're going to use for easy
5353
# autocompletion
54-
self.controller: PythonWrapperOfYourInstrument = None
54+
self.controller: PythonWrapperObjectOfYourInstrument = None
5555

5656
# TODO declare here attributes you want/need to init with a default value
5757

@@ -89,7 +89,7 @@ def ini_detector(self, controller=None):
8989

9090
raise NotImplementedError # TODO when writing your own plugin remove this line and modify the one below
9191
if self.is_master:
92-
self.controller = PythonWrapperOfYourInstrument() #instantiate you driver with whatever arguments are needed
92+
self.controller = PythonWrapperObjectOfYourInstrument() #instantiate you driver with whatever arguments are needed
9393
self.controller.open_communication() # call eventual methods
9494
initialized = self.controller.a_method_or_atttribute_to_check_if_init() # TODO
9595
else:

src/pymodaq_plugins_template/daq_viewer_plugins/plugins_2D/daq_2Dviewer_Template.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,20 @@
66

77
from pymodaq.control_modules.viewer_utility_classes import DAQ_Viewer_base, comon_parameters, main
88
from pymodaq.utils.data import DataFromPlugins
9-
class PythonWrapperOfYourInstrument:
10-
# TODO Replace this fake class with the import of the real python wrapper of your instrument
11-
pass
9+
10+
# TODO:
11+
# Replace the following fake import with the import of the real Python wrapper of your instrument. Here we suppose that
12+
# the wrapper is in the hardware directory, but it could come from an external librairy like pylablib or pymeasure.
13+
from pymodaq_plugins_template.hardware.python_wrapper_file_of_your_instrument import PythonWrapperObjectOfYourInstrument
1214

1315
# TODO:
1416
# (1) change the name of the following class to DAQ_2DViewer_TheNameOfYourChoice
1517
# (2) change the name of this file to daq_2Dviewer_TheNameOfYourChoice ("TheNameOfYourChoice" should be the SAME
1618
# for the class name and the file name.)
1719
# (3) this file should then be put into the right folder, namely IN THE FOLDER OF THE PLUGIN YOU ARE DEVELOPING:
1820
# pymodaq_plugins_my_plugin/daq_viewer_plugins/plugins_2D
21+
22+
1923
class DAQ_2DViewer_Template(DAQ_Viewer_base):
2024
""" Instrument plugin class for a 2D viewer.
2125
@@ -47,7 +51,7 @@ class DAQ_2DViewer_Template(DAQ_Viewer_base):
4751
def ini_attributes(self):
4852
# TODO declare the type of the wrapper (and assign it to self.controller) you're going to use for easy
4953
# autocompletion
50-
self.controller: PythonWrapperOfYourInstrument = None
54+
self.controller: PythonWrapperObjectOfYourInstrument = None
5155

5256
# TODO declare here attributes you want/need to init with a default value
5357

@@ -84,7 +88,7 @@ def ini_detector(self, controller=None):
8488
"""
8589
raise NotImplementedError # TODO when writing your own plugin remove this line and modify the one below
8690
if self.is_master:
87-
self.controller = PythonWrapperOfYourInstrument() #instantiate you driver with whatever arguments are needed
91+
self.controller = PythonWrapperObjectOfYourInstrument() #instantiate you driver with whatever arguments are needed
8892
self.controller.open_communication() # call eventual methods
8993
initialized = self.controller.a_method_or_atttribute_to_check_if_init() # TODO
9094
else:

0 commit comments

Comments
 (0)