followup change: fix dummy webserver
the dummy server was no longer working after server rework
This commit is contained in:
29
dummy.py
29
dummy.py
@ -2,12 +2,18 @@ import time
|
||||
import math
|
||||
import io
|
||||
from colors import assign_colors_to_curves
|
||||
from secop import SecopInstrument, SecopClient
|
||||
from base import get_abs_time
|
||||
from secop import SecopClient
|
||||
from base import get_abs_time, HandlerBase
|
||||
|
||||
|
||||
class DummyGraph:
|
||||
def __init__(self):
|
||||
class DummyGraph(HandlerBase):
|
||||
def __init__(self, server, instrument, device, tags):
|
||||
super().__init__() # put methods w_... to handlers
|
||||
self.handlers['graphpoll'] = self.graphpoll
|
||||
self.server = server
|
||||
self.instrument = instrument
|
||||
self.device = device
|
||||
self.tags = tags
|
||||
self.blocks = []
|
||||
self.phase = {}
|
||||
self.end_time = 0
|
||||
@ -158,11 +164,7 @@ class DummyGraph:
|
||||
return None
|
||||
|
||||
|
||||
class SecopDummyClient(SecopClient, DummyGraph):
|
||||
def __init__(self, instrument):
|
||||
SecopClient.__init__(self, instrument)
|
||||
DummyGraph.__init__(self)
|
||||
|
||||
class SecopDummyClient(SecopClient):
|
||||
def poll(self):
|
||||
messages = super().poll()
|
||||
msg = self.graphpoll()
|
||||
@ -171,8 +173,9 @@ class SecopDummyClient(SecopClient, DummyGraph):
|
||||
return messages
|
||||
|
||||
|
||||
class SecopDummyInstrument(SecopInstrument):
|
||||
|
||||
def new_client(self):
|
||||
return self.register(SecopDummyClient(self))
|
||||
class DummyHistory:
|
||||
def __init__(self, stream):
|
||||
self.stream = stream
|
||||
|
||||
def get_streams(self, instrument=None, **kwds):
|
||||
return {self.stream: {'device': 'dummy'}}
|
||||
|
Reference in New Issue
Block a user