def get_archive_trend(models=None, length=4 * 3600, show=False): # This method is to be added to # PyTangoArchiving.widgets.trend in next releases #class PressureTrend(TaurusTrend): #def showEvent(self,event): #if not getattr(self,'_tuned',False): #setup_pressure_trend(self) #setattr(self,'_tuned',True) #TaurusTrend.showEvent(self,event) from taurus.external.qt import Qwt5 tt = TaurusTrend() try: tt.setXDynScale(True) tt.setUseArchiving(True) tt.setModelInConfig(False) tt.disconnect(tt.axisWidget(tt.xBottom), Qt.SIGNAL("scaleDivChanged ()"), tt._scaleChangeWarning) xMax = time.time() #tt.axisScaleDiv(Qwt5.QwtPlot.xBottom).upperBound() rg = length #abs(self.str2deltatime(str(self.ui.xRangeCB.currentText()))) xMin = xMax - rg tt.setAxisScale(Qwt5.QwtPlot.xBottom, xMin, xMax) if models: tt.setModel(models) if show: tt.show() tt.setWindowTitle('Trend') except: print 'Exception in set_pressure_trend(%s)' % tt print traceback.format_exc() return tt
def get_archive_trend(models=None,length=4*3600,show=False): # This method is to be added to PyTangoArchiving.widgets.trend in next releases #class PressureTrend(TaurusTrend): #def showEvent(self,event): #if not getattr(self,'_tuned',False): #setup_pressure_trend(self) #setattr(self,'_tuned',True) #TaurusTrend.showEvent(self,event) from PyQt4 import Qwt5 tt = TaurusTrend() try: tt.setXDynScale(True) tt.setUseArchiving(True) tt.setModelInConfig(False) tt.disconnect(tt.axisWidget(tt.xBottom), Qt.SIGNAL("scaleDivChanged ()"), tt._scaleChangeWarning) xMax = time.time() #tt.axisScaleDiv(Qwt5.QwtPlot.xBottom).upperBound() rg = length #abs(self.str2deltatime(str(self.ui.xRangeCB.currentText()))) xMin=xMax-rg tt.setAxisScale(Qwt5.QwtPlot.xBottom,xMin, xMax) if models: tt.setModel(models) if show: tt.show() tt.setWindowTitle('Trend') except: print 'Exception in set_pressure_trend(%s)'%tt print traceback.format_exc() return tt
def open_new_trend(self): from taurus.qt.qtgui.plot import TaurusTrend tt = TaurusTrend() tt.show() self.extras.append(tt) tt.setUseArchiving(True) tt.showLegend(True) return tt
def open_new_trend(self): from taurus.qt.qtgui.plot import TaurusTrend tt = TaurusTrend() tt.show() self.extras.append(tt) tt.setUseArchiving(True) tt.showLegend(True) return tt