Skip to content

Commit

Permalink
Merge pull request #1137 from clintonroy/count
Browse files Browse the repository at this point in the history
ENH: pass the count parameter along, as already documented.
  • Loading branch information
mrakitin authored Oct 13, 2023
2 parents 61af375 + 1fa6916 commit 9a0bf3f
Showing 1 changed file with 29 additions and 4 deletions.
33 changes: 29 additions & 4 deletions ophyd/signal.py
Original file line number Diff line number Diff line change
Expand Up @@ -1283,7 +1283,14 @@ def limits(self):
return (self._metadata["lower_ctrl_limit"], self._metadata["upper_ctrl_limit"])

def _get_with_timeout(
self, pv, timeout, connection_timeout, as_string, form, use_monitor
self,
pv,
timeout,
connection_timeout,
count,
as_string,
form,
use_monitor,
):
"""
Utility method implementing a retry loop for get and get_setpoint
Expand Down Expand Up @@ -1316,7 +1323,11 @@ def _get_with_timeout(
timeout,
)
info = pv.get_with_metadata(
as_string=as_string, form=form, timeout=timeout, use_monitor=use_monitor
as_string=as_string,
count=count,
form=form,
timeout=timeout,
use_monitor=use_monitor,
)
self.control_layer_log.debug(
"pv[%s].get_with_metadata(...) returned", pv.pvname
Expand All @@ -1332,6 +1343,7 @@ def _get_with_timeout(
def get(
self,
*,
count=None,
as_string=None,
timeout=DEFAULT_TIMEOUT,
connection_timeout=DEFAULT_CONNECTION_TIMEOUT,
Expand Down Expand Up @@ -1376,7 +1388,13 @@ def get(
use_monitor = self._auto_monitor

info = self._get_with_timeout(
self._read_pv, timeout, connection_timeout, as_string, form, use_monitor
self._read_pv,
timeout,
connection_timeout,
count,
as_string,
form,
use_monitor,
)

value = info.pop("value")
Expand Down Expand Up @@ -1866,6 +1884,7 @@ def check_value(self, value):
def get_setpoint(
self,
*,
count=None,
as_string=None,
timeout=DEFAULT_TIMEOUT,
connection_timeout=DEFAULT_CONNECTION_TIMEOUT,
Expand Down Expand Up @@ -1909,7 +1928,13 @@ def get_setpoint(
use_monitor = self._auto_monitor

info = self._get_with_timeout(
self._write_pv, timeout, connection_timeout, as_string, form, use_monitor
self._write_pv,
timeout,
connection_timeout,
count,
as_string,
form,
use_monitor,
)

value = info.pop("value")
Expand Down

0 comments on commit 9a0bf3f

Please sign in to comment.