-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathimplementation.py
More file actions
34 lines (25 loc) · 1.08 KB
/
implementation.py
File metadata and controls
34 lines (25 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
from zope.interface import implements
from twisted.internet import defer
from smac.amqp.models import Address
from smac.api.session import SessionListener
from smac.api.recorder import Recorder
from smac.modules import base
from recorder import IVCRecorder
class IVCRecorderModule(base.ModuleBase):
"""
A recorder implementation for the IVC-4300 acquisition card and the custom
developed C extension module.
"""
implements(Recorder.Iface)
def __init__(self, *args, **kwargs):
super(IVCRecorderModule, self).__init__(*args, **kwargs)
self.sessions = {}
"""A dictionary holding all currently configured acquisition sessions."""
@defer.inlineCallbacks
def configure_session(self, session):
print "Configuring module for session {0}".format(session.id)
self.sessions[session.id] = handler = IVCRecorder(self, session)
address = Address(routing_key=session.id)
yield self.amq_server(address, SessionListener, handler, IVCRecorder.queues)
def acquisition_devices(self):
return []