master: remove simple parameter history

This commit is contained in:
Sebastien Bourdeauducq 2015-07-09 13:54:38 +02:00
parent 96a5d73c81
commit 9d4073ef36
2 changed files with 1 additions and 20 deletions

View File

@ -7,7 +7,7 @@ import os
from artiq.protocols.pc_rpc import Server from artiq.protocols.pc_rpc import Server
from artiq.protocols.sync_struct import Publisher 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.scheduler import Scheduler
from artiq.master.results import RTResults, get_last_rid from artiq.master.results import RTResults, get_last_rid
from artiq.master.repository import Repository from artiq.master.repository import Repository
@ -36,8 +36,6 @@ def main():
init_logger(args) init_logger(args)
ddb = FlatFileDB("ddb.pyon") ddb = FlatFileDB("ddb.pyon")
pdb = FlatFileDB("pdb.pyon") pdb = FlatFileDB("pdb.pyon")
simplephist = SimpleHistory(30)
pdb.hooks.append(simplephist)
rtr = RTResults() rtr = RTResults()
repository = Repository() repository = Repository()
@ -74,7 +72,6 @@ def main():
"schedule": scheduler.notifier, "schedule": scheduler.notifier,
"devices": ddb.data, "devices": ddb.data,
"parameters": pdb.data, "parameters": pdb.data,
"parameters_simplehist": simplephist.history,
"rt_results": rtr.groups, "rt_results": rtr.groups,
"explist": repository.explist "explist": repository.explist
}) })

View File

@ -36,19 +36,3 @@ class FlatFileDB:
timestamp = time() timestamp = time()
for hook in self.hooks: for hook in self.hooks:
hook.delete(timestamp, name) 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))