Exemplo n.º 1
0
 def createCTElement(self, ctrl_obj, name, axis):
     e_cfg = createElemConf(self.pool, axis, name)
     elem_obj = createPoolCounterTimer(self.pool, ctrl_obj, e_cfg)
     ctrl_obj.add_element(elem_obj)
     # CT elements
     self.cts[name] = elem_obj
     self.pool.add_element(elem_obj)
     return elem_obj
Exemplo n.º 2
0
 def createCTElement(self, ctrl_obj, name, axis):
     e_cfg = createElemConf(self.pool, axis, name)
     elem_obj = createPoolCounterTimer(self.pool, ctrl_obj, e_cfg)
     ctrl_obj.add_element(elem_obj)
     # CT elements
     self.cts[name] = elem_obj
     self.pool.add_element(elem_obj)
     return elem_obj
Exemplo n.º 3
0
    def setUp(self):
        """Setup:
        - Use resources for Controller, CounterTimer and MeasurementGroup
        features.
        - Create Controller, CounterTimer and MeasurementGroup.
        """
        pool = FakePool()

        pc = createPoolController(pool, dummyPoolCTCtrlConf01)
        pct = createPoolCounterTimer(pool, pc, dummyCounterTimerConf01)

        pc.add_element(pct)
        pool.add_element(pc)
        pool.add_element(pct)

        self.pmg = createPoolMeasurementGroup(pool, dummyMeasurementGroupConf01)
        self._pct = pct # keep a reference to use it in test_acquisition
Exemplo n.º 4
0
    def setUp(self):
        """Setup:
        - Use resources for Controller, CounterTimer and MeasurementGroup
        features.
        - Create Controller, CounterTimer and MeasurementGroup.
        """
        pool = FakePool()

        pc = createPoolController(pool, dummyPoolCTCtrlConf01)
        pct = createPoolCounterTimer(pool, pc, dummyCounterTimerConf01)

        pc.add_element(pct)
        pool.add_element(pc)
        pool.add_element(pct)

        self.pmg = createPoolMeasurementGroup(pool, dummyMeasurementGroupConf01)
        self._pct = pct  # keep a reference to use it in test_acquisition
Exemplo n.º 5
0
def test_state(monkeypatch, mock_StateOne):
    """Test variants of StateOne return value:
    - state
    - state, status
    """
    pool = FakePool()
    # when SEP19 gets implemented it should be possible to mock directly
    # the imported class
    DummyCounterTimerController = pool.ctrl_manager.getControllerClass(
        "DummyCounterTimerController")
    monkeypatch.setattr(DummyCounterTimerController, "StateOne",
                        mock_StateOne)
    ct_ctrl = createPoolController(pool, dummyPoolCTCtrlConf01)
    ct = createPoolCounterTimer(pool, ct_ctrl, dummyCounterTimerConf01)
    ct_ctrl.add_element(ct)
    pool.add_element(ct_ctrl)
    pool.add_element(ct)
    assert ct.state == State.On
    assert type(ct.status) == str
Exemplo n.º 6
0
    def setUp(self):
        """Create a Controller and a CounterTimer element"""
        pool = FakePool()

        pc = createPoolController(pool, dummyPoolCTCtrlConf01)
        self.pct = createPoolCounterTimer(pool, pc, dummyCounterTimerConf01)
Exemplo n.º 7
0
    def setUp(self):
        """Create a Controller and a CounterTimer element"""
        pool = FakePool()

        pc = createPoolController(pool, dummyPoolCTCtrlConf01)
        self.pct = createPoolCounterTimer(pool, pc, dummyCounterTimerConf01)