Broken plugin into microscope plugin and API endpoints
This commit is contained in:
parent
5ef9215051
commit
9a2c585046
3 changed files with 39 additions and 34 deletions
|
|
@ -1,34 +1,2 @@
|
||||||
from openflexure_microscope.plugins import MicroscopePlugin
|
from .plugin import PLUGINS
|
||||||
|
from .api import ENDPOINTS
|
||||||
|
|
||||||
class FirstPlugin(MicroscopePlugin):
|
|
||||||
"""
|
|
||||||
An example Microscope plugin.
|
|
||||||
"""
|
|
||||||
def run(self):
|
|
||||||
"""
|
|
||||||
Demonstrate access to Microscope.camera, and Microscope.stage
|
|
||||||
"""
|
|
||||||
print("Parent camera:")
|
|
||||||
print(self.camera)
|
|
||||||
|
|
||||||
print("Parent stage:")
|
|
||||||
print(self.stage)
|
|
||||||
|
|
||||||
|
|
||||||
class OtherPlugin(MicroscopePlugin):
|
|
||||||
"""
|
|
||||||
An example of a second Microscope plugin, loaded from the same plugin file.
|
|
||||||
"""
|
|
||||||
def run(self):
|
|
||||||
"""
|
|
||||||
Demonstrate access to Microscope.camera, and Microscope.stage
|
|
||||||
"""
|
|
||||||
print("Stage plugin parent stage:")
|
|
||||||
print(self.stage)
|
|
||||||
|
|
||||||
|
|
||||||
PLUGINS = {
|
|
||||||
'test1': FirstPlugin,
|
|
||||||
'test2': OtherPlugin,
|
|
||||||
} #: dict: Dictionary describing the plugins. Keys are the names of the plugin's namescape, with a value corresponding to the class of that plugin.
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
from openflexure_microscope.api.v1.views import MicroscopeView
|
||||||
|
|
||||||
|
ENDPOINTS = {}
|
||||||
34
openflexure_microscope/plugins/default/test_plugin/plugin.py
Normal file
34
openflexure_microscope/plugins/default/test_plugin/plugin.py
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
from openflexure_microscope.plugins import MicroscopePlugin
|
||||||
|
|
||||||
|
|
||||||
|
class FirstPlugin(MicroscopePlugin):
|
||||||
|
"""
|
||||||
|
An example Microscope plugin.
|
||||||
|
"""
|
||||||
|
def run(self):
|
||||||
|
"""
|
||||||
|
Demonstrate access to Microscope.camera, and Microscope.stage
|
||||||
|
"""
|
||||||
|
print("Parent camera:")
|
||||||
|
print(self.microscope.camera)
|
||||||
|
|
||||||
|
print("Parent stage:")
|
||||||
|
print(self.microscope.stage)
|
||||||
|
|
||||||
|
|
||||||
|
class OtherPlugin(MicroscopePlugin):
|
||||||
|
"""
|
||||||
|
An example of a second Microscope plugin, loaded from the same plugin file.
|
||||||
|
"""
|
||||||
|
def run(self):
|
||||||
|
"""
|
||||||
|
Demonstrate access to Microscope.camera, and Microscope.stage
|
||||||
|
"""
|
||||||
|
print("Stage plugin parent stage:")
|
||||||
|
print(self.microscope.stage)
|
||||||
|
|
||||||
|
|
||||||
|
PLUGINS = {
|
||||||
|
'test1': FirstPlugin,
|
||||||
|
'test2': OtherPlugin,
|
||||||
|
} #: dict: Dictionary describing the plugins. Keys are the names of the plugin's namescape, with a value corresponding to the class of that plugin.
|
||||||
Loading…
Add table
Add a link
Reference in a new issue