fix: update timestamp upon reading of non computed readback signal
This commit is contained in:
parent
f818ff0234
commit
17e8cd9234
@ -294,6 +294,7 @@ class SimulatedPositioner(SimulatedDataBase):
|
||||
The position is updated by the parent device, and readback/setpoint values
|
||||
have a jitter/tolerance introduced directly in the parent class (SimPositioner).
|
||||
"""
|
||||
self.sim_state[signal_name].update({"timestamp": ttime.time()})
|
||||
if compute_readback:
|
||||
method = None
|
||||
value = self.execute_simulation_method(method=method, signal_name=signal_name)
|
||||
|
@ -433,3 +433,15 @@ def test_async_mon_send_data_to_bec(async_monitor):
|
||||
]
|
||||
assert mock_xadd.mock_calls == call
|
||||
assert async_monitor.data_buffer["value"] == []
|
||||
|
||||
|
||||
def test_positioner_updated_timestamp(positioner):
|
||||
"""Test the updated_timestamp method of SimPositioner."""
|
||||
positioner.sim.sim_state[positioner.name]["value"] = 1
|
||||
readback = positioner.read()[positioner.name]
|
||||
timestamp = readback["timestamp"]
|
||||
assert readback["value"] == 1
|
||||
positioner.sim.sim_state[positioner.name]["value"] = 5
|
||||
readback = positioner.read()[positioner.name]
|
||||
assert readback["value"] == 5
|
||||
assert readback["timestamp"] > timestamp
|
||||
|
Loading…
x
Reference in New Issue
Block a user