Ejemplo n.º 1
0
 def propertyUpdated(self, pname, value):
     if pname == 'dev':
         if value:
             self.key = value + '.value'
     elif pname == 'key' and self._designMode:
         self.setText('(%s)' % value)
     NicosWidget.propertyUpdated(self, pname, value)
Ejemplo n.º 2
0
 def propertyUpdated(self, pname, value):
     if pname == 'dev':
         if value:
             self.key = value + '.value'
             self.statuskey = value + '.status'
     elif pname == 'width':
         if value < 0:
             self.reinitLayout()
         else:
             onechar = QFontMetrics(self.valueFont).width('0')
             self.valuelabel.setMinimumSize(QSize(onechar * (value + .5), 0))
     elif pname == 'istext':
         self.valuelabel.setFont(value and self.font() or self.valueFont)
         self.width = self.width
     elif pname == 'valueFont':
         self.valuelabel.setFont(self.valueFont)
         self.width = self.width  # update char width calculation
     elif pname == 'showName':
         self.namelabel.setVisible(value)
     elif pname == 'showStatus':
         if not value:
             setBothColors(self.valuelabel,
                           (self._colorscheme['fore'][UNKNOWN],
                            self._colorscheme['back'][UNKNOWN]))
     elif pname == 'horizontal':
         self.reinitLayout()
     if pname in ('dev', 'name', 'unit'):
         self.update_namelabel()
     NicosWidget.propertyUpdated(self, pname, value)
Ejemplo n.º 3
0
 def propertyUpdated(self, pname, value):
     if pname == 'plotwindow':
         self._showdate = value > 24 * 3600
         self._showsecs = value < 300
     elif pname in ('width', 'height'):
         self.setMinimumSize(
             QSize(self._scale * (self.props['width'] + .5),
                   self._scale * (self.props['height'] + .5)))
     elif pname == 'legend':
         self.plot.setLegend(value)
     NicosWidget.propertyUpdated(self, pname, value)
Ejemplo n.º 4
0
 def propertyUpdated(self, pname, value):
     NicosWidget.propertyUpdated(self, pname, value)
     if pname == 'filepath':
         self._filePath = findResource(value)
         self.setPicture()
     elif pname == 'name':
         layout = QVBoxLayout()
         if value:
             layout.addWidget(self.namelabel)
             layout.addSpacing(5)
         layout.addWidget(self.piclabel, 1)
         sip.delete(self.layout())
         self.setLayout(layout)
         self.namelabel.setText(value)
     elif pname in ('width', 'height'):
         self.setPicture()
     elif pname == 'refresh':
         if value:
             self._refreshTimer = QTimer()
             self._refreshTimer.setInterval(value * 1000)
             self._refreshTimer.timeout.connect(self.updatePicture)
             self._refreshTimer.start()
Ejemplo n.º 5
0
 def propertyUpdated(self, pname, value):
     if pname == 'uifile':
         self.clear()
     NicosWidget.propertyUpdated(self, pname, value)
Ejemplo n.º 6
0
 def propertyUpdated(self, pname, value):
     if pname == 'dev':
         self._reinit()
     NicosWidget.propertyUpdated(self, pname, value)
Ejemplo n.º 7
0
 def propertyUpdated(self, pname, value):
     if pname in ('dev', 'param'):
         self._reinit()
     NicosWidget.propertyUpdated(self, pname, value)
Ejemplo n.º 8
0
 def propertyUpdated(self, pname, value):
     if pname == 'showparams':
         self._showparams = value
     NicosWidget.propertyUpdated(self, pname, value)
Ejemplo n.º 9
0
 def propertyUpdated(self, pname, value):
     self._refresh()
     NicosWidget.propertyUpdated(self, pname, value)