Presentation is loading. Please wait.

Presentation is loading. Please wait.

Dessy, 17 september 2007 Tango Meeting Development of Tango Client Applications in Python Tiago Coutinho and Josep Ribas.

Similar presentations


Presentation on theme: "Dessy, 17 september 2007 Tango Meeting Development of Tango Client Applications in Python Tiago Coutinho and Josep Ribas."— Presentation transcript:

1 Dessy, 17 september 2007 Tango Meeting Development of Tango Client Applications in Python Tiago Coutinho and Josep Ribas

2 Tango Meeting Dessy, 17 september 2007 Outline PyTauico  Goals of PyTauico  Software Architecture PyTauiwi  Custom tango widgets in QtDesigner  Application development  Example Current Status Future Work Conclusions

3 Tango Meeting Dessy, 17 september 2007 Goals of PyTauico PyTauico = Python Tango User Interface Core Add Python and PyTango as an option for client applications Abstraction layer for PyTango Client Applications  Simplify the application development using PyTango  Reduce development time in Python  Standarize PyTango client applications  Improve performance of applications Efficient management of Devices and Attributes

4 Tango Meeting Dessy, 17 september 2007 PyTango Tango PyTauico 'IPyTauico' IPython PyTauiwi PyQT4 'WxTango' WxPython CORBA Architecture

5 Tango Meeting Dessy, 17 september 2007 Architecture (II) Device and Attribute Factories PyTango accessed through DeviceProxy Model and Listener Polling management

6 Tango Meeting Dessy, 17 september 2007 PyTauico Device > Attribute > Attribute > Attribute > Listener > Listener > Listener > Listener > AttributeFactoryDeviceFactory Tango Device Server Motor > Listeners

7 Tango Meeting Dessy, 17 september 2007 PyTauiwi Python Tango User Interface Widgets PyQt4 layer for PyTauico QtDesigner as a main tool. Provide a set of widgets for application development Standarize the look and feel Extensible  Easy development of new widgets  Complex widgets as a subset of basic widgets PyTango Tango PyTauico CORBA PyTauiwi PyQT4

8 Tango Meeting Dessy, 17 september 2007 Custom Widgets for PyTango PyQt4.2  Full range of standard Qt widgets  All the power of Qt, but exploit it with the simplicity of Python.  QtDesigner. Graphical User Interface Designer.  Own pure Python custom widgets  All the signals, slots and properties defined in Python are accessible in Designer's user interface.

9 Tango Meeting Dessy, 17 september 2007 Custom Widget Development 1. Design the widget using QtDesigner 2. Convert Design into Python Code using pyuic4 3. Implement widget functionality 1. Inherit from tauico model 2. Add Widget Properties, Signals and Slots 3. Implement the connection with PyTauico. 4. Defining the Widget's Plugin Interface Describes our custom widget and tells Qt Designer how to instantiate it.

10 Tango Meeting Dessy, 17 september 2007 Custom Widget development (II) Our widget is a Listener in the PyTauico Layer.  Widget Code must include. A property defining the Tango attribute or device name. Subscription management to PyTauico Device or attribute objects. Implementation of the eventReceived() function defined in the TauicoListener abstract class.  How the widget shows to the user the received events. Add signals and slots to the widget.  Define the interaction of the widget with the other components. from PyQt4 import QtCore, QtGui, Qt import PyTauico class PyStateLabel(QtGui.QLabel, PyTauico.TauicoListener):... def getDevice(self): return self._device @QtCore.pyqtSignature("setDevice(QString)") def setDevice(self, devname): self.dev = devfactory.getDevice(self._device) self.attr = self.dev.subscribeAttribute(self._device+"/State", self) self.setState(str(self.attr.read().value)) Device = QtCore.pyqtProperty("QString", getDevice, setDevice) def eventReceived(self, EventSource, EventType, EventValue): self.emit(QtCore.SIGNAL('changeText(QString)'), str(EventValue.value)) @QtCore.pyqtSignature("setState(QString)") def setState(self, value): self.setText(value) self.changeColor(value)

11 Tango Meeting Dessy, 17 september 2007 Application Development 1. Design your application design using QtDesigner using the PyTauwi widgets. 2. Covert yout application to python code. 3. Implement extra functionalities like widget interconnection. 4. Enjoy it.

12 Tango Meeting Dessy, 17 september 2007 Example. Libera UI

13 Tango Meeting Dessy, 17 september 2007 Current Status PyTauico Layer  Basic support for devices and attributes.  Events for attributes  Basic polling  Core factory components Efficient object management (Devices and Attributes)  Basic widget interface defined. PyTauwi Layer  Basic widgets for testing.

14 Tango Meeting Dessy, 17 september 2007 Future work Documentation  Guidelines for developing widgets Define widgets interface Error tracking  Deal with tango exceptions Polling lists  Widget for choosing polling periods for attributes Commnads  Polling for Void commands Properties Multiple DB connection.  Add the DB on the device name. Extend the widget library.

15 Tango Meeting Dessy, 17 september 2007 Conclusions PyTango and PyQt4.  Mixing the power of Qt with the Python simplicity A good use for PyTango  Abstraction layer Fast and easy development of python client applications Extensible.  Possibility to create more complex and dedicated widgets. (A widget that represents a motor)  Use other Python GUI technologies. (wxPython, …)

16 Tango Meeting Dessy, 17 september 2007 Acknowledgments Fulvio Becheri

17 Tango Meeting Dessy, 17 september 2007 PyTauico Attribute > Attribute > Attribute > Listener > Listener > Listener > AttributeFactory PollingTimer > PollingTimer > T2T1


Download ppt "Dessy, 17 september 2007 Tango Meeting Development of Tango Client Applications in Python Tiago Coutinho and Josep Ribas."

Similar presentations


Ads by Google