150 likes | 337 Views
PyTango release 3. Two new features: New installation procedure Tango device server Bug fixes, speed improvements, new methods…. PyTango release 3. New installation procedure You install the source tree where you want Still uses Bjam (the Boost make system)
E N D
PyTango release 3 • Two new features: • New installation procedure • Tango device server • Bug fixes, speed improvements, new methods…
PyTango release 3 • New installation procedure • You install the source tree where you want • Still uses Bjam (the Boost make system) • Some Bjam related scripts have to be modified according to your disk files structures • It is now a Python package • Installation procedure documented in the ReadMe files (Unix and Windows)
PyTango release 3 • Python device server is a wrapping of the C++ API. It is not a new package coming from the IDL file (like Java DS) • Uses Boost.Python • It needs Tango C++ API V5.5 (or older) • Management of the Python GIL • Per thread data to handle data type conversion • Python not needed to compile Tango
PyTango release 3 • All the commands are managed by one C++ command class (PyCmd) • One instance of this class per command • Command name is a data member of this class (Tango feature) • All the attributes are managed by three C++ attribute class (PyScaAttr, PySpecAttr and PyIma Attr) • One instance of one of these classes per attribute • Attribute name is a data member
PyTango release 3 • Command • They are defined in a Python dictionary called cmd_list data member of the xxxClass (PowerSupplyClass class) • cmd_list dictionary : • ‘cmd_name’:[[in_type,<“In desc”>],[out_type,<“Out desc”>],<{Opt parameters}>] cmd_list = {‘IOLong’,[[PyTango.DevLong,”Number”], [PyTango.DevLong,”Number * 2”], {“polling period”:2000, “display type”: PyTango.DispLevel.EXPERT}]}
PyTango release 3 • Command simple data types
PyTango release 3 • Command array data types
PyTango release 3 • Attribute • They are defined in a Python dictionary called attr_list data member of the xxxClass (PowerSupplyClass class) • attr_list dictionary : • ‘attr_name’:[[attr data type, attr data format, attr data R/W type],<{opt parameters}>] attr_list = {‘Long_attr’:[[PyTango.DevLong,PyTango.SCALAR, PyTango.READ], {“label”: “A dummy attribute”, “min alarm”: 1000, “max alarm”: 1500}]}
PyTango release 3 • General methods • init_device() • delete_device() • always_executed_hook() • read_attr_hardware() • signal_handler() • State and Status can be re-defined if needed
PyTango release 3 • Coding difference related to C++ • Command’s is_allowed methods does not have argument • No class_factory file/method. Replaced by the add_TgClass() and add_Cpp_TgClass() methods of the Python PyUtil class • No device_factory() method
PyTango release 3 • Some timing measurement (2 CPU Xeon 3.2 Ghz Suse 9.3, 2 GB mem) • In = One Long, Out = One long • In = Void, Out = 100000 double (Python list)
PyTango release 3 • Several Tango classes within the same interpreter • All Python Tango classes • No problem, use the client part of PyTango • Mixing Python and C++ Tango classes • Within the same Device Server process, you can have C++ Tango class and Python Tango class. • The C++ Tango classes are dynamically loaded
PyTango release 3 • Pogo (4.5.4 and above) now generates : • A small “C” function to create the xxxClass singleton of the Tango class (in the xxxClass.cpp file) • A new Make dependency called “shlib” in the Makefile • A new method (not a command) of the admin device • Load the shared library • Retrieve the symbol associated with the new small C function • Execute this function
PyTango release 3 • Developed and tested with Linux Suse 9.3 and Windows XP using VC8 • Python 2.4 and 2.4.1 • Boost.Python 1.33.1 • Solaris ?
PyTango release 3 • What is not done • Device logging, • Management of large data number with NumPy • Pogo could be modified to support Python device server • Same property management than C++ or Java DS • Wizard initialization • HTML doc generation