Skip to content

Commit

Permalink
reset min/max to default if 0/0
Browse files Browse the repository at this point in the history
  • Loading branch information
Laurent Claustre committed Nov 28, 2019
1 parent 2c6cdff commit e4c1fdd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion plugins/Bpm.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,10 @@ def write_min_max(self, attr):
data = attr.get_write_value()
max = 2**(self.ImageType2Bpp[_control_ref().image().getImageType()])
range = [0, max]
#reset asked to default
if data[0] == 0 and data[1] == 0:
data[1] = max

if data[0] > data[1]:
PyTango.Except.throw_exception('WrongData',\
f'Wrong values min_max: {data}, max < min',
Expand All @@ -466,7 +470,7 @@ def write_return_bpm_profiles(self,attr):
data = attr.get_write_value()
self.return_bpm_profiles = data
#update the property
prop = {'return_bpm_profiles': data}
prop = {'return_bpmpylon/PylonBase.h_profiles': data}
PyTango.Database().put_device_property(self.get_name(), prop)

def is_return_bpm_profiles_allowed(self,mode) :
Expand Down

0 comments on commit e4c1fdd

Please sign in to comment.