Menu

#110 device property with auto update in database

closed
None
PyTango
5
2015-04-17
2015-04-17
No

It would be nice to have in new style PyTango servers a way to say that setting a new value to a property should automatically update the value in the database.

Proposed solution example:

from PyTango.server import Device, DeviceMeta, command, device_property

class MyDevice(Device):
    __metaclass__ = DeviceMeta

    port = device_property(dtype='uint16', update_db=True)

    def init_device(self):
        Device.init_device(self)
        print("Using port: {0}".format(self.port))

    @command(dtype_in='uint16')
    def change_port(self, port):
        # this will update the device property port in the database !
        self.port = port

Discussion

  • Tiago Coutinho

    Tiago Coutinho - 2015-04-17
    • status: open --> accepted
     
  • Tiago Coutinho

    Tiago Coutinho - 2015-04-17

    Will be implemented in next PyTango 8.1.7

     
  • Tiago Coutinho

    Tiago Coutinho - 2015-04-17
    • status: accepted --> closed
     
MongoDB Logo MongoDB