The widget package is a PyQt based library of widgets designed to represent Tango data. The widget library provides not only basic widgets like labels, text fields and combo boxes, but also containers like frames, group boxes or graphics and synoptics.
The TauValueLabel is a tau widget designed to display the read value of an attribute.
The simplest example of TauValueLabel
code:
import sys
from PyQt4 import Qt
import tau.widget
app = Qt.QApplication(sys.argv)
w = tau.widget.TauValueLabel()
w.setModel('sys/tautest/1/position')
panel.setVisible(True)
sys.exit(app.exec_())
Demonstrates how to use the showQuality and useParentModel with TauValueLabel being inside another tau container: the TauWidget
code:
import sys
from PyQt4 import Qt
import tau.widget
app = Qt.QApplication(sys.argv)
panel = tau.widget.TauWidget()
layout = Qt.QVBoxLayout()
panel.setLayout(layout)
panel.setModel('sys/tautest/1')
w1 = tau.widget.TauValueLabel()
w2 = tau.widget.TauValueLabel()
w3 = tau.widget.TauValueLabel()
w1.setUseParentModel(True)
w2.setUseParentModel(True)
w3.setUseParentModel(True)
w1.setModel('/state')
w2.setModel('/position')
w3.setModel('/simulationmode')
w1.setShowQuality(False)
layout.addWidget(w1)
layout.addWidget(w2)
layout.addWidget(w3)
panel.setVisible(True)
sys.exit(app.exec_())
The TauStateLabel is a tau widget designed to display the state of a device both with the background color.
Because TauStateLabel inherits from TauValueLabel, all TauValueLabel properties are available.
The simplest example of TauStateLabel
code:
import sys
from PyQt4 import Qt
import tau.widget
app = Qt.QApplication(sys.argv)
panel = Qt.QWidget()
layout = Qt.QHBoxLayout()
panel.setLayout(layout)
w = tau.widget.TauStateLabel()
w.setModel('sys/tautest/1/state')
layout.addWidget(w)
panel.setVisible(True)
sys.exit(app.exec_())
This example shows how to display multiple device states using a small area of the GUI. This example assumes there are 8 devices running with names: ‘sys/tautest/<1-8>’
code:
import sys
from PyQt4 import Qt
import tau.widget
app = Qt.QApplication(sys.argv)
panel = Qt.QWidget()
layout = Qt.QGridLayout()
panel.setLayout(layout)
for y in range(4):
for x in range(2):
w = tau.widget.TauStateLabel()
w.setModel('sys/tautest/%d/state' % ((y+1)+4*x))
w.setShowText(False)
layout.addWidget(w,x,y)
panel.setVisible(True)
sys.exit(app.exec_())
@TODO