Commit 4c728ea2 authored by Matias Guijarro's avatar Matias Guijarro

session instead of static.get_config

parent 9f079ee0
......@@ -15,7 +15,6 @@ The alias serves the following purposes:
import weakref
from tabulate import tabulate
from bliss.config import static
from bliss import setup_globals
from bliss.common import session
from bliss.common.utils import get_counters_iter
......@@ -162,7 +161,7 @@ class Alias(object):
raise RuntimeError(
f"Alias '{alias_name}' for '{original_name}' can not be set! There is alreadey an Object or Alias with this name"
)
elif alias_name in static.get_config().names_list:
elif alias_name in session.get_current().config.names_list:
raise RuntimeError(
f"Alias '{alias_name}' for '{original_name}' can not be set! {alias_name} already used as name-key in config"
)
......
......@@ -7,7 +7,6 @@
from bliss.config import channels
from bliss.common.utils import Null
from bliss.config.static import get_config
def _get_config():
......
......@@ -72,7 +72,7 @@ import gevent.lock
from bliss.comm.util import get_comm
from bliss.common.measurement import SamplingCounter
from bliss.common import mapping
from bliss.common import session
from bliss.common.logtools import LogMixin
......@@ -422,7 +422,7 @@ class PressureTransmitter(LogMixin):
self.comm = get_comm(config, baudrate=9600)
self.echo = config.get("echo", 1)
self.expected_serial_nb = config.get("serial_nb", None)
mapping.register(self, children_list=[self.comm])
session.get_current().map.register(self, children_list=[self.comm])
# Create counters
for counter_config in self.config.get("counters", []):
......
......@@ -19,8 +19,8 @@ from bliss.common.motor_group import Group, TrajectoryGroup
from bliss.common import event
from bliss.physics import trajectory
from bliss.common.utils import set_custom_members, object_method
from bliss.common import mapping
from bliss.common.logtools import LogMixin
from bliss.common import session
from bliss.config.channels import Cache, Channel
from bliss.config import settings
from gevent import lock
......@@ -88,7 +88,9 @@ class Controller(LogMixin):
raise ValueError("Missing **class** for '%s`" % obj_name)
object_dict[obj_name] = obj_class(obj_name, self, obj_config)
mapping_name = config.get("name") or self.__class__.__name__.lower()
mapping.register(self, parents_list=["controllers"], tag=mapping_name)
session.get_current().map.register(
self, parents_list=["controllers"], tag=mapping_name
)
def _init(self):
for axis in self.axes.values():
......
......@@ -35,7 +35,7 @@ controller:
from bliss.common.temperature import *
from bliss.common.utils import set_custom_members
from bliss.common import mapping
from bliss.common import session
from bliss.common.logtools import LogMixin
......@@ -46,7 +46,9 @@ class Controller(LogMixin):
def __init__(self, config, inputs, outputs, loops):
mapping_name = config.get("name") or self.__class__.__name__.lower()
mapping.register(self, parents_list=["controllers"], tag=mapping_name)
session.get_current().map.register(
self, parents_list=["controllers"], tag=mapping_name
)
# self._logger.info("on Controller")
self.__config = config
self._objects = dict()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment