1 / 16

Development of Tango Client Applications in Python

Development of Tango Client Applications in Python. Tiago Coutinho and Josep Ribas. Outline. PyTauico Goals of PyTauico Software Architecture PyTauiwi Custom tango widgets in QtDesigner Application development Example Current Status Future Work Conclusions. Goals of PyTauico.

rosina
Download Presentation

Development of Tango Client Applications in Python

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Development of Tango Client Applications in Python Tiago Coutinho and Josep Ribas Tango Meeting

  2. Outline • PyTauico • Goals of PyTauico • Software Architecture • PyTauiwi • Custom tango widgets in QtDesigner • Application development • Example • Current Status • Future Work • Conclusions Tango Meeting

  3. 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 Tango Meeting

  4. Architecture WxPython IPython PyQT4 'WxTango' 'IPyTauico' PyTauiwi CORBA Tango PyTango PyTauico Tango Meeting

  5. Architecture (II) • Device and Attribute Factories • PyTango accessed through DeviceProxy • Model and Listener • Polling management Tango Meeting

  6. Listeners Device Server Motor <<sup>> Tango PyTauico Listener <<CheckBoxSim>> Listener <<LineEditPos>> Listener <<LineEditAcc>> Listener <<LineEditSim>> Device <<sup>> Attribute <<Position>> Attribute <<Acceleration>> Attribute <<Simulation>> DeviceFactory AttributeFactory Tango Meeting

  7. 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 CORBA Tango PyTango PyQT4 PyTauico PyTauiwi Tango Meeting

  8. 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. Tango Meeting

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

  10. 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) Tango Meeting

  11. Application Development • Design your application design using QtDesigner using the PyTauwi widgets. • Covert yout application to python code. • Implement extra functionalities like widget interconnection. • Enjoy it. Tango Meeting

  12. Example. Libera UI Tango Meeting

  13. 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. Tango Meeting

  14. 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. Tango Meeting

  15. 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, …) Tango Meeting

  16. Acknowledgments • Fulvio Becheri Tango Meeting

More Related