File: MandatoryPropertyServer.py

package info (click to toggle)
pytango 10.1.4-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,304 kB
  • sloc: python: 27,795; cpp: 16,150; sql: 252; sh: 152; makefile: 43
file content (24 lines) | stat: -rw-r--r-- 687 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# SPDX-FileCopyrightText: All Contributors to the PyTango project
# SPDX-License-Identifier: LGPL-3.0-or-later
from tango import DevState
from tango.server import Device, device_property


class MandatoryPropertyServer(Device):
    Hostname = device_property(
        dtype="str", mandatory=True, doc="The controller host address"
    )

    Port = device_property(
        dtype="int", default_value=3456, doc="The controller port number"
    )

    def init_device(self):
        Device.init_device(self)
        print("Port: ", self.Port)
        print("Host: ", self.Hostname)
        self.set_state(DevState.ON)


if __name__ == "__main__":
    MandatoryPropertyServer.run_server()