... | ... | @@ -29,6 +29,7 @@ beamline control workstation. The bliss session accesses the card through a tang |
|
|
|
|
|
### tango server code
|
|
|
* should be placed in `bliss/tango/servers`
|
|
|
* should have the suffix `_ds.py`
|
|
|
* logic should be implemented in bliss; tango classes should have a minimum of logic
|
|
|
* if tango class is developed to provide access to spec:
|
|
|
* provide minimum attributes & commands to make it happen
|
... | ... | @@ -40,8 +41,8 @@ beamline control workstation. The bliss session accesses the card through a tang |
|
|
|
|
|
### Example
|
|
|
|
|
|
*write a device class Potentiostat exposing bliss biologic potentiostat.
|
|
|
Also provide an executable capable of running a DS with class Potentiostat*
|
|
|
*write a device class BiologicPotentiostat exposing bliss biologic potentiostat.
|
|
|
Also provide an executable capable of running a DS with class BiologicPotentiostat*
|
|
|
|
|
|
**bliss/controllers/potentiostat/biologic.py**
|
|
|
|
... | ... | @@ -53,13 +54,13 @@ class Potentiostat: |
|
|
...
|
|
|
```
|
|
|
|
|
|
**bliss/tango/servers/potentiostat/biologic.py** module
|
|
|
**bliss/tango/servers/biologic_ds.py** module
|
|
|
```python
|
|
|
from PyTango.server import Device, DeviceMeta
|
|
|
|
|
|
from bliss.controllers.potentiostat import biologic
|
|
|
|
|
|
class Potentiostat(Device):
|
|
|
class BiologicPotentiostat(Device):
|
|
|
__metaclass__ = DeviceMeta
|
|
|
|
|
|
def init_device(self):
|
... | ... | @@ -78,17 +79,17 @@ class Potentiostat(Device): |
|
|
def main():
|
|
|
from PyTango import GreenMode
|
|
|
from PyTango.server import run
|
|
|
run([Potentiostat,], green_mode=GreenMode.Gevent)
|
|
|
run([BiologicPotentiostat,], green_mode=GreenMode.Gevent)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
main()
|
|
|
```
|
|
|
|
|
|
**tango/Potentiostat** executable
|
|
|
**tango/BiologicPotentiostat** executable
|
|
|
```python
|
|
|
#!/usr/bin/env python
|
|
|
|
|
|
from bliss.tango.servers.biologic.potentiostat import main()
|
|
|
from bliss.tango.servers.biologic_ds import main()
|
|
|
main()
|
|
|
```
|
|
|
|
... | ... | @@ -97,12 +98,12 @@ With this approach it becomes simple to create a new server with multiple classe |
|
|
**my_server**
|
|
|
```python
|
|
|
#!/usr/bin/env python
|
|
|
from bliss.tango.servers.biologic.potentiostat import Potentiostat
|
|
|
from bliss.tango.servers.biologic_ds import BiologicPotentiostat
|
|
|
from bliss.tango.servers.musst import Musst
|
|
|
|
|
|
from PyTango import GreenMode
|
|
|
from PyTango.server import run
|
|
|
run([Potentiostat, Musst], green_mode=GreenMode.Gevent)
|
|
|
run([BiologicPotentiostat, Musst], green_mode=GreenMode.Gevent)
|
|
|
```
|
|
|
|
|
|
We can even invent a **Bliss** server which can expose all known bliss classes :-)
|