moved DummyAdjustable to core/adjustable
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
from .adjustable import Adjustable
|
||||
|
||||
|
||||
class DummyAdjustable(Adjustable):
|
||||
|
||||
def __init__(self, initial_value=0, name="Dummy"):
|
||||
self.name = name
|
||||
self._current_value = initial_value
|
||||
|
||||
def get_current_value(self):
|
||||
return self._current_value
|
||||
|
||||
def set_target_value(self, value, hold=False):
|
||||
def changer():
|
||||
self._current_value = value
|
||||
return Task(changer, hold=hold)
|
||||
|
||||
def __repr__(self):
|
||||
name = self.name
|
||||
value = self.get_current_value()
|
||||
return f"{name} at {value}"
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import numpy as np
|
||||
|
||||
from slic.devices.general.adjustable import DummyAdjustable
|
||||
from slic.core.adjustable import DummyAdjustable
|
||||
from slic.utils import typename
|
||||
|
||||
from .scanbackend import ScanBackend
|
||||
@@ -127,8 +127,8 @@ class Scanner:
|
||||
|
||||
|
||||
def acquire(self, n_intervals, *args, **kwargs):
|
||||
adjustable = DummyAdjustable()
|
||||
adjustables = [adjustable]
|
||||
dummy = DummyAdjustable()
|
||||
adjustables = [dummy]
|
||||
|
||||
positions = range(n_intervals)
|
||||
positions = transpose(positions)
|
||||
|
||||
Reference in New Issue
Block a user