Skip to content

Commit

Permalink
Merge pull request #15 from ISISComputingGroup/Ticket7562_scale_min_t…
Browse files Browse the repository at this point in the history
…ime_lag

fix minimum time lag stripping, add prec to min time lag
  • Loading branch information
Tom-Willemsen authored Jan 16, 2023
2 parents d013636 + 9da3ac6 commit 96c92ce
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion correlator_pcaspy.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
from pvdb import STATIC_PV_DATABASE, Records
from config import Constants, PV, LSiPVSeverity, Macro, Defaults

NANOSECONDS_TO_SECONDS = 1e9

def get_base_pv(reason: str) -> str:
"""
Expand Down Expand Up @@ -276,7 +277,9 @@ def take_data(self) -> None:
no_repetitions = self.get_converted_pv_value(Records.REPETITIONS.name)
wait_in_seconds = self.get_converted_pv_value(Records.WAIT.name)
wait_at_start = self.get_converted_pv_value(Records.WAIT_AT_START.name)
min_time_lag = self.get_converted_pv_value(Records.MIN_TIME_LAG.name)
min_time_lag_ns = self.get_converted_pv_value(Records.MIN_TIME_LAG.name)
# Convert min time lag to seconds for comparison against lag data
min_time_lag = min_time_lag_ns / NANOSECONDS_TO_SECONDS
self.already_started = True
first_repetition = 1

Expand Down
2 changes: 1 addition & 1 deletion record.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def float_pv_with_unit(unit: str):
pv_definition (Dict): Contains the fields which define the PV
"""

return {'type': 'float', 'unit': unit, 'info_field': {'archive': 'VAL', 'INTEREST': 'HIGH'}}
return {'type': 'float', 'unit': unit, 'info_field': {'archive': 'VAL', 'INTEREST': 'HIGH'}, 'prec': 3}

# pylint: disable=unused-argument
def null_device_setter(*args, **kwargs):
Expand Down

0 comments on commit 96c92ce

Please sign in to comment.