Tango meeting Py Tango release 3 n Two

  • Slides: 15
Download presentation
Tango meeting Py. Tango release 3 n Two new features: ¨ New installation procedure

Tango meeting Py. Tango release 3 n Two new features: ¨ New installation procedure ¨ Tango device server n Bug fixes, speed improvements, new methods… 05 -Sep-06 1

Tango meeting Py. Tango release 3 n New installation procedure ¨ You install the

Tango meeting Py. Tango release 3 n New installation procedure ¨ You install the source tree where you want ¨ Still uses Bjam (the Boost make system) n 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 Read. Me files (Unix and Windows) 05 -Sep-06 2

Tango meeting Py. Tango release 3 n n n Python device server is a

Tango meeting Py. Tango release 3 n n n 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 V 5. 5 (or older) ¨ Management of the Python GIL ¨ Per thread data to handle data type conversion ¨ Python not needed to compile Tango 05 -Sep-06 3

Tango meeting Py. Tango release 3 n All the commands are managed by one

Tango meeting Py. Tango release 3 n All the commands are managed by one C++ command class (Py. Cmd) ¨ One instance of this class per command ¨ Command name is a data member of this class (Tango feature) n All the attributes are managed by three C++ attribute class (Py. Sca. Attr, Py. Spec. Attr and Py. Ima Attr) ¨ One instance of one of these classes per attribute ¨ Attribute name is a data member 05 -Sep-06 4

Tango meeting Py. Tango release 3 n Command ¨ They are defined in a

Tango meeting Py. Tango release 3 n Command ¨ They are defined in a Python dictionary called cmd_list data member of the xxx. Class (Power. Supply. Class class) ¨ cmd_list dictionary : n ‘cmd_name’: [[in_type, <“In desc”>], [out_type, <“Out desc”>], <{Opt parameters}>] cmd_list = {‘IOLong’, [[Py. Tango. Dev. Long, ”Number”], [Py. Tango. Dev. Long, ”Number * 2”], {“polling period”: 2000, “display type”: Py. Tango. Disp. Level. EXPERT}]} 05 -Sep-06 5

Tango meeting Py. Tango release 3 n Command simple data types 05 -Sep-06 Tango

Tango meeting Py. Tango release 3 n Command simple data types 05 -Sep-06 Tango data type Python type Void Nothing Boolean Python boolean Short, Long, Unsigned short, Unsigned long Python integer Float, Double Python float String Python string 6

Tango meeting Py. Tango release 3 n Command array data types Tango data type

Tango meeting Py. Tango release 3 n Command array data types Tango data type Python type Char, Short, Long, unsigned Python list of Python integer short, unsigned long array Float and Double array Python list of Python float String array Long and String Double and String 05 -Sep-06 Python list of Python string Python tuple with a Python list of integer and a Python list of string Idem (integer -> float) 7

Tango meeting Py. Tango release 3 n Attribute ¨ They are defined in a

Tango meeting Py. Tango release 3 n Attribute ¨ They are defined in a Python dictionary called attr_list data member of the xxx. Class (Power. Supply. Class class) ¨ attr_list dictionary : n ‘attr_name’: [[attr data type, attr data format, attr data R/W type], <{opt parameters}>] attr_list = {‘Long_attr’: [[Py. Tango. Dev. Long, Py. Tango. SCALAR, Py. Tango. READ], {“label”: “A dummy attribute”, “min alarm”: 1000, “max alarm”: 1500}]} 05 -Sep-06 8

Tango meeting Py. Tango release 3 n General methods ¨ init_device() ¨ delete_device() ¨

Tango meeting Py. Tango release 3 n General methods ¨ init_device() ¨ delete_device() ¨ always_executed_hook() ¨ read_attr_hardware() ¨ signal_handler() n State and Status can be re-defined if needed 05 -Sep-06 9

Tango meeting Py. Tango release 3 n Coding difference related to C++ ¨ Command’s

Tango meeting Py. Tango release 3 n Coding difference related to C++ ¨ Command’s is_allowed methods does not have argument ¨ No class_factory file/method. Replaced by the add_Tg. Class() and add_Cpp_Tg. Class() methods of the Python Py. Util class ¨ No device_factory() method 05 -Sep-06 10

Tango meeting Py. Tango release 3 n Some timing measurement (2 CPU Xeon 3.

Tango meeting Py. Tango release 3 n 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) ¨ Python server 120 us Python client 36 m. S C++ client 05 -Sep-06 100 us 25 m. S C++ server 108 us 16 m. S 85 us 5 m. S 11

Tango meeting Py. Tango release 3 n Several Tango classes within the same interpreter

Tango meeting Py. Tango release 3 n Several Tango classes within the same interpreter ¨ All n Python Tango classes No problem, use the client part of Py. Tango ¨ Mixing n n 05 -Sep-06 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 12

Tango meeting Py. Tango release 3 n Pogo (4. 5. 4 and above) now

Tango meeting Py. Tango release 3 n Pogo (4. 5. 4 and above) now generates : ¨A small “C” function to create the xxx. Class singleton of the Tango class (in the xxx. Class. cpp file) ¨ A new Make dependency called “shlib” in the Makefile n 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 05 -Sep-06 13

Tango meeting Py. Tango release 3 n Developed and tested with Linux Suse 9.

Tango meeting Py. Tango release 3 n Developed and tested with Linux Suse 9. 3 and Windows XP using VC 8 ¨ Python 2. 4 and 2. 4. 1 ¨ Boost. Python 1. 33. 1 ¨ Solaris ? 05 -Sep-06 14

Tango meeting Py. Tango release 3 n What is not done ¨ Device logging,

Tango meeting Py. Tango release 3 n What is not done ¨ Device logging, ¨ Management of large data number with Num. Py n Pogo could be modified to support Python device server ¨ Same property management than C++ or Java DS ¨ Wizard initialization ¨ HTML doc generation 05 -Sep-06 15