Skip to content
Snippets Groups Projects
Commit 11277d66 authored by Milan Prica's avatar Milan Prica :skier:
Browse files

Modificiations to read/write permissions of a few attributes.

parent b2a72c06
No related branches found
No related tags found
No related merge requests found
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
## along with Tango. If not, see <http://www.gnu.org/licenses/>. ## along with Tango. If not, see <http://www.gnu.org/licenses/>.
## ##
## ##
## $Author : sci.comp@elettra.eu ## $Author : SPE - www.elettra.eu
## ##
## $Revision : $ ## $Revision : $
## ##
...@@ -546,7 +546,7 @@ class Smaract_mcs2 (PyTango.Device_4Impl): ...@@ -546,7 +546,7 @@ class Smaract_mcs2 (PyTango.Device_4Impl):
self.move_steps(data - self.attr_Position_read) self.move_steps(data - self.attr_Position_read)
def is_Position_allowed(self, req_type): def is_Position_allowed(self, req_type):
return self.get_state() in (PyTango.DevState.ON,PyTango.DevState.MOVING,) return self.get_state() in (PyTango.DevState.ON, PyTango.DevState.MOVING,)
def read_Acceleration(self, attr): def read_Acceleration(self, attr):
...@@ -574,7 +574,7 @@ class Smaract_mcs2 (PyTango.Device_4Impl): ...@@ -574,7 +574,7 @@ class Smaract_mcs2 (PyTango.Device_4Impl):
self.socket_write(cmd_str) self.socket_write(cmd_str)
def is_Acceleration_allowed(self, req_type): def is_Acceleration_allowed(self, req_type):
return req_type is PyTango.AttReqType.READ_REQ or (self.get_state() in (PyTango.DevState.ON, ) and self.sensor_present) return req_type is PyTango.AttReqType.READ_REQ or (self.get_state() not in (PyTango.DevState.MOVING, ) and self.sensor_present)
def read_Velocity(self, attr): def read_Velocity(self, attr):
# self.debug_stream("In read_Velocity()") # self.debug_stream("In read_Velocity()")
...@@ -600,7 +600,7 @@ class Smaract_mcs2 (PyTango.Device_4Impl): ...@@ -600,7 +600,7 @@ class Smaract_mcs2 (PyTango.Device_4Impl):
self.socket_write(cmd_str) self.socket_write(cmd_str)
def is_Velocity_allowed(self, req_type): def is_Velocity_allowed(self, req_type):
return req_type is PyTango.AttReqType.READ_REQ or (self.get_state() in (PyTango.DevState.ON, ) and self.sensor_present) return req_type is PyTango.AttReqType.READ_REQ or (self.get_state() not in (PyTango.DevState.MOVING, ) and self.sensor_present)
def read_HoldTime(self, attr): def read_HoldTime(self, attr):
# self.debug_stream("In read_HoldTime()") # self.debug_stream("In read_HoldTime()")
...@@ -678,7 +678,7 @@ class Smaract_mcs2 (PyTango.Device_4Impl): ...@@ -678,7 +678,7 @@ class Smaract_mcs2 (PyTango.Device_4Impl):
self.socket_write(cmd_str) self.socket_write(cmd_str)
def is_LSOffset_allowed(self, req_type): def is_LSOffset_allowed(self, req_type):
return req_type is PyTango.AttReqType.READ_REQ or (self.get_state() in (PyTango.DevState.ON, ) and self.sensor_present) return req_type is PyTango.AttReqType.READ_REQ or (self.get_state() not in (PyTango.DevState.MOVING, ) and self.sensor_present)
def read_HighLimitPosition(self, attr): def read_HighLimitPosition(self, attr):
# self.debug_stream("In read_HighLimitPosition()") # self.debug_stream("In read_HighLimitPosition()")
...@@ -702,7 +702,7 @@ class Smaract_mcs2 (PyTango.Device_4Impl): ...@@ -702,7 +702,7 @@ class Smaract_mcs2 (PyTango.Device_4Impl):
self.socket_write(cmd_str) self.socket_write(cmd_str)
def is_HighLimitPosition_allowed(self, req_type): def is_HighLimitPosition_allowed(self, req_type):
return req_type is PyTango.AttReqType.READ_REQ or (self.get_state() in (PyTango.DevState.ON, PyTango.DevState.ALARM,) and self.sensor_present) return req_type is PyTango.AttReqType.READ_REQ or (self.get_state() not in (PyTango.DevState.MOVING, ) and self.sensor_present)
def read_LowLimitPosition(self, attr): def read_LowLimitPosition(self, attr):
# self.debug_stream("In read_LowLimitPosition()") # self.debug_stream("In read_LowLimitPosition()")
...@@ -726,7 +726,7 @@ class Smaract_mcs2 (PyTango.Device_4Impl): ...@@ -726,7 +726,7 @@ class Smaract_mcs2 (PyTango.Device_4Impl):
self.socket_write(cmd_str) self.socket_write(cmd_str)
def is_LowLimitPosition_allowed(self, req_type): def is_LowLimitPosition_allowed(self, req_type):
return req_type is PyTango.AttReqType.READ_REQ or (self.get_state() in (PyTango.DevState.ON, PyTango.DevState.ALARM,) and self.sensor_present) return req_type is PyTango.AttReqType.READ_REQ or (self.get_state() not in (PyTango.DevState.MOVING, ) and self.sensor_present)
def read_Amplitude(self, attr): def read_Amplitude(self, attr):
# self.debug_stream("In read_Amplitude()") # self.debug_stream("In read_Amplitude()")
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment