-
Notifications
You must be signed in to change notification settings - Fork 44
Features/daqmove improvements #26
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
c21a1bf
Corrected typos in NotImplementedError
astroloba 13c1ab3
Corrected indent in .stop_motion()
astroloba 8166723
Explicit unit specification in DataActuator instances
astroloba 62cdef5
Switch to new implementation of master/slave declaration
astroloba d56df09
Added new master/slave declaration to .close()
astroloba File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -87,12 +87,14 @@ def ini_detector(self, controller=None): | |
| False if initialization failed otherwise True | ||
| """ | ||
|
|
||
| raise NotImplemented # TODO when writing your own plugin remove this line and modify the one below | ||
| self.ini_detector_init(slave_controller=controller) | ||
|
|
||
| raise NotImplementedError # TODO when writing your own plugin remove this line and modify the one below | ||
| if self.is_master: | ||
| self.controller = PythonWrapperOfYourInstrument() #instantiate you driver with whatever arguments are needed | ||
| self.controller.open_communication() # call eventual methods | ||
| initialized = self.controller.a_method_or_atttribute_to_check_if_init() # TODO | ||
| else: | ||
| self.controller = controller | ||
| initialized = True | ||
|
|
||
| ## TODO for your custom plugin | ||
| # get the x_axis (you may want to to this also in the commit settings if x_axis may have changed | ||
|
|
@@ -108,14 +110,15 @@ def ini_detector(self, controller=None): | |
| axes=[self.x_axis])])) | ||
|
|
||
| info = "Whatever info you want to log" | ||
| initialized = True | ||
| return info, initialized | ||
|
|
||
| def close(self): | ||
| """Terminate the communication protocol""" | ||
| ## TODO for your custom plugin | ||
| raise NotImplemented # when writing your own plugin remove this line | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. see my other comment |
||
| # self.controller.your_method_to_terminate_the_communication() # when writing your own plugin replace this line | ||
| raise NotImplementedError # when writing your own plugin remove this line | ||
| if self.is_master: | ||
| # self.controller.your_method_to_terminate_the_communication() # when writing your own plugin replace this line | ||
| ... | ||
|
|
||
| def grab_data(self, Naverage=1, **kwargs): | ||
| """Start a grab from the detector | ||
|
|
@@ -152,7 +155,7 @@ def callback(self): | |
| def stop(self): | ||
| """Stop the current grab hardware wise if necessary""" | ||
| ## TODO for your custom plugin | ||
| raise NotImplemented # when writing your own plugin remove this line | ||
| raise NotImplementedError # when writing your own plugin remove this line | ||
| self.controller.your_method_to_stop_acquisition() # when writing your own plugin replace this line | ||
| self.emit_status(ThreadCommand('Update_Status', ['Some info you want to log'])) | ||
| ############################## | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -82,12 +82,14 @@ def ini_detector(self, controller=None): | |
| initialized: bool | ||
| False if initialization failed otherwise True | ||
| """ | ||
| raise NotImplemented # TODO when writing your own plugin remove this line and modify the one below | ||
| self.ini_detector_init(slave_controller=controller) | ||
|
|
||
| raise NotImplementedError # TODO when writing your own plugin remove this line and modify the one below | ||
| if self.is_master: | ||
| self.controller = PythonWrapperOfYourInstrument() #instantiate you driver with whatever arguments are needed | ||
| self.controller.open_communication() # call eventual methods | ||
| initialized = self.controller.a_method_or_atttribute_to_check_if_init() # TODO | ||
| else: | ||
| self.controller = controller | ||
| initialized = True | ||
|
|
||
| ## TODO for your custom plugin | ||
| # get the x_axis (you may want to to this also in the commit settings if x_axis may have changed | ||
|
|
@@ -105,14 +107,15 @@ def ini_detector(self, controller=None): | |
| axes=[self.x_axis, self.y_axis]), ])) | ||
|
|
||
| info = "Whatever info you want to log" | ||
| initialized = True | ||
| return info, initialized | ||
|
|
||
| def close(self): | ||
| """Terminate the communication protocol""" | ||
| ## TODO for your custom plugin | ||
| raise NotImplemented # when writing your own plugin remove this line | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. see my other comment |
||
| # self.controller.your_method_to_terminate_the_communication() # when writing your own plugin replace this line | ||
| raise NotImplementedError # when writing your own plugin remove this line | ||
| if self.is_master: | ||
| # self.controller.your_method_to_terminate_the_communication() # when writing your own plugin replace this line | ||
| ... | ||
|
|
||
| def grab_data(self, Naverage=1, **kwargs): | ||
| """Start a grab from the detector | ||
|
|
@@ -150,7 +153,7 @@ def callback(self): | |
| def stop(self): | ||
| """Stop the current grab hardware wise if necessary""" | ||
| ## TODO for your custom plugin | ||
| raise NotImplemented # when writing your own plugin remove this line | ||
| raise NotImplementedError # when writing your own plugin remove this line | ||
| self.controller.your_method_to_stop_acquisition() # when writing your own plugin replace this line | ||
| self.emit_status(ThreadCommand('Update_Status', ['Some info you want to log'])) | ||
| ############################## | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we should add a self.is_master clause??