forked from M-Labs/artiq
master: remove simple parameter history
This commit is contained in:
parent
96a5d73c81
commit
9d4073ef36
|
@ -7,7 +7,7 @@ import os
|
|||
|
||||
from artiq.protocols.pc_rpc import Server
|
||||
from artiq.protocols.sync_struct import Publisher
|
||||
from artiq.protocols.file_db import FlatFileDB, SimpleHistory
|
||||
from artiq.protocols.file_db import FlatFileDB
|
||||
from artiq.master.scheduler import Scheduler
|
||||
from artiq.master.results import RTResults, get_last_rid
|
||||
from artiq.master.repository import Repository
|
||||
|
@ -36,8 +36,6 @@ def main():
|
|||
init_logger(args)
|
||||
ddb = FlatFileDB("ddb.pyon")
|
||||
pdb = FlatFileDB("pdb.pyon")
|
||||
simplephist = SimpleHistory(30)
|
||||
pdb.hooks.append(simplephist)
|
||||
rtr = RTResults()
|
||||
repository = Repository()
|
||||
|
||||
|
@ -74,7 +72,6 @@ def main():
|
|||
"schedule": scheduler.notifier,
|
||||
"devices": ddb.data,
|
||||
"parameters": pdb.data,
|
||||
"parameters_simplehist": simplephist.history,
|
||||
"rt_results": rtr.groups,
|
||||
"explist": repository.explist
|
||||
})
|
||||
|
|
|
@ -36,19 +36,3 @@ class FlatFileDB:
|
|||
timestamp = time()
|
||||
for hook in self.hooks:
|
||||
hook.delete(timestamp, name)
|
||||
|
||||
|
||||
class SimpleHistory:
|
||||
def __init__(self, depth):
|
||||
self.depth = depth
|
||||
self.history = Notifier([])
|
||||
|
||||
def set(self, timestamp, name, value):
|
||||
if len(self.history.read) >= self.depth:
|
||||
del self.history[0]
|
||||
self.history.append((timestamp, name, value))
|
||||
|
||||
def delete(self, timestamp, name):
|
||||
if len(self.history.read) >= self.depth:
|
||||
del self.history[0]
|
||||
self.history.append((timestamp, name))
|
||||
|
|
Loading…
Reference in New Issue