def __init__(self, plot, depth, reader, cpu): self.__curveCpuHist__ = plotobjects.niceCurve("CPU History", 1 , QtGui.QColor(0,255,0),QtGui.QColor(0,170,0), plot) self.__curveCpuSystemHist__ = plotobjects.niceCurve("CPU Kernel History", 1, QtGui.QColor(255,0,0),QtGui.QColor(170,0,0), plot) self.__curveIoWaitHist__ = plotobjects.niceCurve("CPU IO wait history", 1, QtGui.QColor(0,0,255),QtGui.QColor(0,0,127), plot) self.__curveIrqHist__ = plotobjects.niceCurve("CPU irq history", 1, QtGui.QColor(0,255,255),QtGui.QColor(0,127,127), plot) scale = plotobjects.scaleObject() scale.min = 0 scale.max = 100 self.__adaptedplot__ = plotobjects.procExpPlot(plot, scale) self.__plot__ = plot self.__depth__ = depth self.__reader__ = reader self.__cpu__ = cpu self.__cpuUsageHistory__ = [0] * int(self.__depth__) self.__cpuUsageSystemHistory__ = [0] * int(self.__depth__) self.__cpuUsageIoWaitHistory__ = [0] * int(self.__depth__) self.__cpuUsageIrqHistory__ = [0] * int(self.__depth__)
def update(self, values): if self.__first__ == False: self.__first__ = True scale = plotobjects.scaleObject() scale.min = 0 scale.max = values[0] self.__adaptedmemoryplot = plotobjects.procExpPlot(self.__plot__, scale) self.__memoryUsageHistory__.append(values[0]-values[1]) self.__memoryUsageHistory__ = self.__memoryUsageHistory__[1:] self.__curveMemHist__.setData(range(self.__depth__), self.__memoryUsageHistory__) self.__plot__.replot()
def prepareUI(mainUi): """ prepare the main UI, setup plots and menu triggers """ global g_timer mainUi.processTreeWidget.setColumnCount(len(g_treeViewcolumns)) mainUi.processTreeWidget.setHeaderLabels(g_treeViewcolumns) mainUi.processTreeWidget.header().setContextMenuPolicy(QtCore.Qt.CustomContextMenu) mainUi.processTreeWidget.header().customContextMenuRequested.connect(onHeaderContextMenu) #create a timer which triggers the process explorer to update its contents g_timer = QtCore.QTimer(mainUi.processTreeWidget) QtCore.QObject.connect(g_timer, QtCore.SIGNAL("timeout()"), updateUI) QtCore.QObject.connect(mainUi.processTreeWidget, QtCore.SIGNAL('customContextMenuRequested(const QPoint&)'), onContextMenu) QtCore.QObject.connect(mainUi.menuFile, QtCore.SIGNAL('triggered(QAction*)'), performMenuAction) QtCore.QObject.connect(mainUi.menuProcess, QtCore.SIGNAL('triggered(QAction*)'), performMenuAction) QtCore.QObject.connect(mainUi.menuOptions, QtCore.SIGNAL('triggered(QAction*)'), performMenuAction) QtCore.QObject.connect(mainUi.menuSettings, QtCore.SIGNAL('triggered(QAction*)'), performMenuAction) QtCore.QObject.connect(mainUi.menuView, QtCore.SIGNAL('triggered(QAction*)'), performMenuAction) QtCore.QObject.connect(mainUi.menuHelp, QtCore.SIGNAL('triggered(QAction*)'), performMenuAction) #prepare the plot global g_curveCpuHist global g_curveCpuSystemHist global g_curveIoWaitHist global g_curveIrqHist global g_curveCpuPlotGrid g_curveCpuHist = plotobjects.niceCurve("CPU History", 1 , QtGui.QColor(0,255,0),QtGui.QColor(0,170,0), mainUi.qwtPlotOverallCpuHist) g_curveCpuSystemHist = plotobjects.niceCurve("CPU Kernel History", 1, QtGui.QColor(255,0,0),QtGui.QColor(170,0,0), mainUi.qwtPlotOverallCpuHist) g_curveIoWaitHist = plotobjects.niceCurve("CPU IO wait history", 1, QtGui.QColor(0,0,255),QtGui.QColor(0,0,127), mainUi.qwtPlotOverallCpuHist) g_curveIrqHist = plotobjects.niceCurve("CPU irq history", 1, QtGui.QColor(0,255,255),QtGui.QColor(0,127,127), mainUi.qwtPlotOverallCpuHist) scale = plotobjects.scaleObject() scale.min = 0 scale.max = 100 _ = plotobjects.procExpPlot(mainUi.qwtPlotOverallCpuHist, scale, hasGrid=False)
def prepareUI(mainUi): global timer mainUi.processTreeWidget.setColumnCount(len(treeViewcolumns)) mainUi.processTreeWidget.setHeaderLabels(treeViewcolumns) mainUi.processTreeWidget.header().setContextMenuPolicy( QtCore.Qt.CustomContextMenu) mainUi.processTreeWidget.header().customContextMenuRequested.connect( onHeaderContextMenu) #create a timer timer = QtCore.QTimer(mainUi.processTreeWidget) QtCore.QObject.connect(timer, QtCore.SIGNAL("timeout()"), updateUI) QtCore.QObject.connect( mainUi.processTreeWidget, QtCore.SIGNAL('customContextMenuRequested(const QPoint&)'), onContextMenu) QtCore.QObject.connect(mainUi.menuFile, QtCore.SIGNAL('triggered(QAction*)'), performMenuAction) QtCore.QObject.connect(mainUi.menuProcess, QtCore.SIGNAL('triggered(QAction*)'), performMenuAction) QtCore.QObject.connect(mainUi.menuOptions, QtCore.SIGNAL('triggered(QAction*)'), performMenuAction) QtCore.QObject.connect(mainUi.menuSettings, QtCore.SIGNAL('triggered(QAction*)'), performMenuAction) QtCore.QObject.connect(mainUi.menuView, QtCore.SIGNAL('triggered(QAction*)'), performMenuAction) QtCore.QObject.connect(mainUi.menuHelp, QtCore.SIGNAL('triggered(QAction*)'), performMenuAction) #prepare the plot global curveCpuHist global curveCpuSystemHist global curveIoWaitHist global curveIrqHist global curveCpuPlotGrid curveCpuHist = plotobjects.niceCurve("CPU History", 1, QtGui.QColor(0, 255, 0), QtGui.QColor(0, 170, 0), mainUi.qwtPlotOverallCpuHist) curveCpuSystemHist = plotobjects.niceCurve("CPU Kernel History", 1, QtGui.QColor(255, 0, 0), QtGui.QColor(170, 0, 0), mainUi.qwtPlotOverallCpuHist) curveIoWaitHist = plotobjects.niceCurve("CPU IO wait history", 1, QtGui.QColor(0, 0, 255), QtGui.QColor(0, 0, 127), mainUi.qwtPlotOverallCpuHist) curveIrqHist = plotobjects.niceCurve("CPU irq history", 1, QtGui.QColor(0, 255, 255), QtGui.QColor(0, 127, 127), mainUi.qwtPlotOverallCpuHist) scale = plotobjects.scaleObject() scale.min = 0 scale.max = 100 _ = plotobjects.procExpPlot(mainUi.qwtPlotOverallCpuHist, scale, hasGrid=False)
def __init__(self, networkCards, depth, reader): self.__reader__ = reader self.__depth__ = depth self.__dialog__ = QtGui.QDialog() self.__ui__ = ui.networkinformation.Ui_Dialog() self.__ui__.setupUi(self.__dialog__) self.__networkCards__ = networkCards self.__netPlotArray = [] self.__netPlotArray += [[ self.__ui__.groupBoxNetworkCard_00, self.__ui__.qwtPlotNetworkCardHistory_00 ]] self.__netPlotArray += [[ self.__ui__.groupBoxNetworkCard_01, self.__ui__.qwtPlotNetworkCardHistory_01 ]] self.__netPlotArray += [[ self.__ui__.groupBoxNetworkCard_02, self.__ui__.qwtPlotNetworkCardHistory_02 ]] self.__netPlotArray += [[ self.__ui__.groupBoxNetworkCard_03, self.__ui__.qwtPlotNetworkCardHistory_03 ]] self.__netPlotArray += [[ self.__ui__.groupBoxNetworkCard_04, self.__ui__.qwtPlotNetworkCardHistory_04 ]] self.__netPlotArray += [[ self.__ui__.groupBoxNetworkCard_05, self.__ui__.qwtPlotNetworkCardHistory_05 ]] self.__netPlotArray += [[ self.__ui__.groupBoxNetworkCard_06, self.__ui__.qwtPlotNetworkCardHistory_06 ]] self.__netPlotArray += [[ self.__ui__.groupBoxNetworkCard_07, self.__ui__.qwtPlotNetworkCardHistory_07 ]] self.__netPlotArray += [[ self.__ui__.groupBoxNetworkCard_08, self.__ui__.qwtPlotNetworkCardHistory_08 ]] self.__netPlotArray += [[ self.__ui__.groupBoxNetworkCard_09, self.__ui__.qwtPlotNetworkCardHistory_09 ]] self.__netPlotArray += [[ self.__ui__.groupBoxNetworkCard_10, self.__ui__.qwtPlotNetworkCardHistory_10 ]] self.__netPlotArray += [[ self.__ui__.groupBoxNetworkCard_11, self.__ui__.qwtPlotNetworkCardHistory_11 ]] self.__netPlotArray += [[ self.__ui__.groupBoxNetworkCard_12, self.__ui__.qwtPlotNetworkCardHistory_12 ]] self.__netPlotArray += [[ self.__ui__.groupBoxNetworkCard_13, self.__ui__.qwtPlotNetworkCardHistory_13 ]] self.__netPlotArray += [[ self.__ui__.groupBoxNetworkCard_14, self.__ui__.qwtPlotNetworkCardHistory_14 ]] self.__netPlotArray += [[ self.__ui__.groupBoxNetworkCard_15, self.__ui__.qwtPlotNetworkCardHistory_15 ]] self.__netPlotArray += [[ self.__ui__.groupBoxNetworkCard_16, self.__ui__.qwtPlotNetworkCardHistory_16 ]] self.__netPlotArray += [[ self.__ui__.groupBoxNetworkCard_17, self.__ui__.qwtPlotNetworkCardHistory_17 ]] self.__netPlotArray += [[ self.__ui__.groupBoxNetworkCard_18, self.__ui__.qwtPlotNetworkCardHistory_18 ]] self.__netPlotArray += [[ self.__ui__.groupBoxNetworkCard_19, self.__ui__.qwtPlotNetworkCardHistory_19 ]] self.__netPlotArray += [[ self.__ui__.groupBoxNetworkCard_20, self.__ui__.qwtPlotNetworkCardHistory_20 ]] self.__netPlotArray += [[ self.__ui__.groupBoxNetworkCard_21, self.__ui__.qwtPlotNetworkCardHistory_21 ]] self.__netPlotArray += [[ self.__ui__.groupBoxNetworkCard_22, self.__ui__.qwtPlotNetworkCardHistory_22 ]] self.__netPlotArray += [[ self.__ui__.groupBoxNetworkCard_23, self.__ui__.qwtPlotNetworkCardHistory_23 ]] self.__netPlotArray += [[ self.__ui__.groupBoxNetworkCard_24, self.__ui__.qwtPlotNetworkCardHistory_24 ]] self.__netPlotArray += [[ self.__ui__.groupBoxNetworkCard_25, self.__ui__.qwtPlotNetworkCardHistory_25 ]] self.__netPlotArray += [[ self.__ui__.groupBoxNetworkCard_26, self.__ui__.qwtPlotNetworkCardHistory_26 ]] self.__netPlotArray += [[ self.__ui__.groupBoxNetworkCard_27, self.__ui__.qwtPlotNetworkCardHistory_27 ]] self.__netPlotArray += [[ self.__ui__.groupBoxNetworkCard_28, self.__ui__.qwtPlotNetworkCardHistory_28 ]] self.__netPlotArray += [[ self.__ui__.groupBoxNetworkCard_29, self.__ui__.qwtPlotNetworkCardHistory_29 ]] self.__netPlotArray += [[ self.__ui__.groupBoxNetworkCard_30, self.__ui__.qwtPlotNetworkCardHistory_30 ]] self.__netPlotArray += [[ self.__ui__.groupBoxNetworkCard_31, self.__ui__.qwtPlotNetworkCardHistory_31 ]] self.__tabs__ = {} for card in xrange(32): if card + 1 > len(self.__networkCards__): self.__netPlotArray[card][0].setVisible(False) self.__netPlotArray[card].append(False) else: self.__netPlotArray[card].append(True) idx = 0 for cardName in self.__networkCards__: if self.__netPlotArray[idx][2] == True: speed = self.__networkCards__[cardName]["speed"] if speed is not None: scale = plotobjects.scaleObject() scale.min = 0 scale.max = ( speed / 8.0 ) * 1024.0 * 1024.0 * 0.8 #Speed in Mbit/s, rule of thumb 80% achievable of max theoretical bandwidth.. else: scale = None #leads to autoscaling in graphs... self.__netPlotArray[idx].append( networkPlotObject(self.__netPlotArray[idx][1], self.__depth__, self.__reader__, cardName, scale)) if speed is None: self.__netPlotArray[idx][0].setTitle(cardName + " / " + "??" + " MB/s") else: self.__netPlotArray[idx][0].setTitle( cardName + ", ~" + str(round(scale.max / (1024.0 * 1024.0))) + " MB/s") idx += 1 #create tab per network card for card in self.__networkCards__: tab = QtGui.QWidget() self.__tabs__[card] = [ tab, [ QtGui.QLabel(tab), QtGui.QLabel(tab), QtGui.QLabel(tab), QtGui.QLabel(tab), QtGui.QLabel(tab), QtGui.QLabel(tab), QtGui.QLabel(tab), QtGui.QLabel(tab), QtGui.QLabel(tab), QtGui.QLabel(tab), QtGui.QLabel(tab), QtGui.QLabel(tab), QtGui.QLabel(tab) ], [ QtGui.QLabel(tab), QtGui.QLabel(tab), QtGui.QLabel(tab), QtGui.QLabel(tab), QtGui.QLabel(tab), QtGui.QLabel(tab), QtGui.QLabel(tab), QtGui.QLabel(tab), QtGui.QLabel(tab), QtGui.QLabel(tab), QtGui.QLabel(tab), QtGui.QLabel(tab), QtGui.QLabel(tab) ] ] self.__ui__.tabWidget.addTab(tab, "") self.__ui__.tabWidget.setTabText( self.__ui__.tabWidget.indexOf(tab), card) ymargin = 20 y = 10 xoffs = 20 for label in self.__tabs__[card][1][0:7]: label.setGeometry(QtCore.QRect(20, y, 130, 18)) y += ymargin y = 10 for label in self.__tabs__[card][1][7:13]: label.setGeometry(QtCore.QRect(280, y, 130, 18)) y += ymargin self.__tabs__[card][1][0].setText("Rec Errors") self.__tabs__[card][1][1].setText("Rec Drops") self.__tabs__[card][1][2].setText("Send Errors") self.__tabs__[card][1][3].setText("Send Drops") self.__tabs__[card][1][4].setText("Send Coll") self.__tabs__[card][1][5].setText("Rec bytes") self.__tabs__[card][1][6].setText("Send bytes") self.__tabs__[card][1][7].setText("Rec packets") self.__tabs__[card][1][8].setText("Send packets") self.__tabs__[card][1][9].setText("Rec bytes/s") self.__tabs__[card][1][10].setText("Send bytes/s") self.__tabs__[card][1][11].setText("Avg rec packet size") self.__tabs__[card][1][12].setText("Avg snd packet size") y = 10 for label in self.__tabs__[card][2][0:7]: label.setGeometry(QtCore.QRect(150, y, 80, 18)) y += ymargin label.setText("0") y = 10 for label in self.__tabs__[card][2][7:13]: label.setGeometry(QtCore.QRect(410, y, 80, 18)) y += ymargin label.setText("0")
def __init__(self, networkCards, depth, reader): self.__reader__ = reader self.__depth__ = depth self.__dialog__ = QtWidgets.QDialog() self.__ui__ = uic.loadUi(os.path.join(os.path.dirname(__file__), "./ui/networkinformation.ui"), baseinstance=self.__dialog__) self.__networkCards__ = networkCards self.__netPlotArray = [] for _i in range(_MAX_NOOFNETWORKCARDS): self.__netPlotArray += [[ getattr(self.__ui__, "groupBoxNetworkCard_%02d" % _i), getattr(self.__ui__, "qwtPlotNetworkCardHistory_%02d" % _i) ]] self.__tabs__ = {} for card in range(_MAX_NOOFNETWORKCARDS): if card + 1 > len(self.__networkCards__): self.__netPlotArray[card][0].setVisible(False) self.__netPlotArray[card].append(False) else: self.__netPlotArray[card].append(True) idx = 0 for cardName in self.__networkCards__: if self.__netPlotArray[idx][2] == True: speed = self.__networkCards__[cardName]["speed"] if speed is not None: scale = plotobjects.scaleObject() scale.min = 0 scale.max = ( speed / 8.0 ) * 1024.0 * 1024.0 * 0.8 #Speed in Mbit/s, rule of thumb 80% achievable of max theoretical bandwidth.. else: scale = None #leads to autoscaling in graphs... self.__netPlotArray[idx].append( networkPlotObject(self.__netPlotArray[idx][1], self.__depth__, self.__reader__, cardName, scale)) if speed is None: self.__netPlotArray[idx][0].setTitle(cardName + " / " + "??" + " MB/s") else: self.__netPlotArray[idx][0].setTitle( cardName + ", ~" + str(round(scale.max / (1024.0 * 1024.0))) + " MB/s") idx += 1 #create tab per network card for card in self.__networkCards__: tab = QtWidgets.QWidget() self.__tabs__[card] = [ tab, [QtWidgets.QLabel(tab) for _ in range(13)], [QtWidgets.QLabel(tab) for _ in range(13)] ] self.__ui__.tabWidget.addTab(tab, "") self.__ui__.tabWidget.setTabText( self.__ui__.tabWidget.indexOf(tab), card) ymargin = 20 y = 10 xoffs = 20 for label in self.__tabs__[card][1][0:7]: label.setGeometry(QtCore.QRect(20, y, 130, 18)) y += ymargin y = 10 for label in self.__tabs__[card][1][7:13]: label.setGeometry(QtCore.QRect(280, y, 130, 18)) y += ymargin self.__tabs__[card][1][0].setText("Rec Errors") self.__tabs__[card][1][1].setText("Rec Drops") self.__tabs__[card][1][2].setText("Send Errors") self.__tabs__[card][1][3].setText("Send Drops") self.__tabs__[card][1][4].setText("Send Coll") self.__tabs__[card][1][5].setText("Rec bytes") self.__tabs__[card][1][6].setText("Send bytes") self.__tabs__[card][1][7].setText("Rec packets") self.__tabs__[card][1][8].setText("Send packets") self.__tabs__[card][1][9].setText("Rec bytes/s") self.__tabs__[card][1][10].setText("Send bytes/s") self.__tabs__[card][1][11].setText("Avg rec packet size") self.__tabs__[card][1][12].setText("Avg snd packet size") y = 10 for label in self.__tabs__[card][2][0:7]: label.setGeometry(QtCore.QRect(150, y, 80, 18)) y += ymargin label.setText("0") y = 10 for label in self.__tabs__[card][2][7:13]: label.setGeometry(QtCore.QRect(410, y, 80, 18)) y += ymargin label.setText("0")
def __init__(self, networkCards, depth, reader): self.__reader__ = reader self.__depth__ = depth self.__dialog__ = QtGui.QDialog() self.__ui__ = ui.networkinformation.Ui_Dialog() self.__ui__.setupUi(self.__dialog__) self.__networkCards__ = networkCards self.__netPlotArray = [] self.__netPlotArray += [[self.__ui__.groupBoxNetworkCard_00, self.__ui__.qwtPlotNetworkCardHistory_00]] self.__netPlotArray += [[self.__ui__.groupBoxNetworkCard_01, self.__ui__.qwtPlotNetworkCardHistory_01]] self.__netPlotArray += [[self.__ui__.groupBoxNetworkCard_02, self.__ui__.qwtPlotNetworkCardHistory_02]] self.__netPlotArray += [[self.__ui__.groupBoxNetworkCard_03, self.__ui__.qwtPlotNetworkCardHistory_03]] self.__netPlotArray += [[self.__ui__.groupBoxNetworkCard_04, self.__ui__.qwtPlotNetworkCardHistory_04]] self.__netPlotArray += [[self.__ui__.groupBoxNetworkCard_05, self.__ui__.qwtPlotNetworkCardHistory_05]] self.__netPlotArray += [[self.__ui__.groupBoxNetworkCard_06, self.__ui__.qwtPlotNetworkCardHistory_06]] self.__netPlotArray += [[self.__ui__.groupBoxNetworkCard_07, self.__ui__.qwtPlotNetworkCardHistory_07]] self.__netPlotArray += [[self.__ui__.groupBoxNetworkCard_08, self.__ui__.qwtPlotNetworkCardHistory_08]] self.__netPlotArray += [[self.__ui__.groupBoxNetworkCard_09, self.__ui__.qwtPlotNetworkCardHistory_09]] self.__netPlotArray += [[self.__ui__.groupBoxNetworkCard_10, self.__ui__.qwtPlotNetworkCardHistory_10]] self.__netPlotArray += [[self.__ui__.groupBoxNetworkCard_11, self.__ui__.qwtPlotNetworkCardHistory_11]] self.__netPlotArray += [[self.__ui__.groupBoxNetworkCard_12, self.__ui__.qwtPlotNetworkCardHistory_12]] self.__netPlotArray += [[self.__ui__.groupBoxNetworkCard_13, self.__ui__.qwtPlotNetworkCardHistory_13]] self.__netPlotArray += [[self.__ui__.groupBoxNetworkCard_14, self.__ui__.qwtPlotNetworkCardHistory_14]] self.__netPlotArray += [[self.__ui__.groupBoxNetworkCard_15, self.__ui__.qwtPlotNetworkCardHistory_15]] self.__netPlotArray += [[self.__ui__.groupBoxNetworkCard_16, self.__ui__.qwtPlotNetworkCardHistory_16]] self.__netPlotArray += [[self.__ui__.groupBoxNetworkCard_17, self.__ui__.qwtPlotNetworkCardHistory_17]] self.__netPlotArray += [[self.__ui__.groupBoxNetworkCard_18, self.__ui__.qwtPlotNetworkCardHistory_18]] self.__netPlotArray += [[self.__ui__.groupBoxNetworkCard_19, self.__ui__.qwtPlotNetworkCardHistory_19]] self.__netPlotArray += [[self.__ui__.groupBoxNetworkCard_20, self.__ui__.qwtPlotNetworkCardHistory_20]] self.__netPlotArray += [[self.__ui__.groupBoxNetworkCard_21, self.__ui__.qwtPlotNetworkCardHistory_21]] self.__netPlotArray += [[self.__ui__.groupBoxNetworkCard_22, self.__ui__.qwtPlotNetworkCardHistory_22]] self.__netPlotArray += [[self.__ui__.groupBoxNetworkCard_23, self.__ui__.qwtPlotNetworkCardHistory_23]] self.__netPlotArray += [[self.__ui__.groupBoxNetworkCard_24, self.__ui__.qwtPlotNetworkCardHistory_24]] self.__netPlotArray += [[self.__ui__.groupBoxNetworkCard_25, self.__ui__.qwtPlotNetworkCardHistory_25]] self.__netPlotArray += [[self.__ui__.groupBoxNetworkCard_26, self.__ui__.qwtPlotNetworkCardHistory_26]] self.__netPlotArray += [[self.__ui__.groupBoxNetworkCard_27, self.__ui__.qwtPlotNetworkCardHistory_27]] self.__netPlotArray += [[self.__ui__.groupBoxNetworkCard_28, self.__ui__.qwtPlotNetworkCardHistory_28]] self.__netPlotArray += [[self.__ui__.groupBoxNetworkCard_29, self.__ui__.qwtPlotNetworkCardHistory_29]] self.__netPlotArray += [[self.__ui__.groupBoxNetworkCard_30, self.__ui__.qwtPlotNetworkCardHistory_30]] self.__netPlotArray += [[self.__ui__.groupBoxNetworkCard_31, self.__ui__.qwtPlotNetworkCardHistory_31]] self.__tabs__ = {} for card in xrange(32): if card+1 > len(self.__networkCards__): self.__netPlotArray[card][0].setVisible(False) self.__netPlotArray[card].append(False) else: self.__netPlotArray[card].append(True) idx = 0 for cardName in self.__networkCards__: if self.__netPlotArray[idx][2] == True: speed = self.__networkCards__[cardName]["speed"] if speed is not None: scale = plotobjects.scaleObject() scale.min = 0 scale.max = (speed / 8.0) * 1024.0 * 1024.0 * 0.8 #Speed in Mbit/s, rule of thumb 80% achievable of max theoretical bandwidth.. else: scale = None #leads to autoscaling in graphs... self.__netPlotArray[idx].append(networkPlotObject(self.__netPlotArray[idx][1], self.__depth__, self.__reader__, cardName, scale)) if speed is None: self.__netPlotArray[idx][0].setTitle(cardName+" / " + "??" + " MB/s") else: self.__netPlotArray[idx][0].setTitle(cardName+", ~" + str(round(scale.max / (1024.0*1024.0))) + " MB/s") idx +=1 #create tab per network card for card in self.__networkCards__: tab = QtGui.QWidget() self.__tabs__[card] = [tab, [QtGui.QLabel(tab), QtGui.QLabel(tab), QtGui.QLabel(tab), QtGui.QLabel(tab), QtGui.QLabel(tab), QtGui.QLabel(tab), QtGui.QLabel(tab), QtGui.QLabel(tab), QtGui.QLabel(tab), QtGui.QLabel(tab), QtGui.QLabel(tab), QtGui.QLabel(tab), QtGui.QLabel(tab)], [QtGui.QLabel(tab), QtGui.QLabel(tab), QtGui.QLabel(tab), QtGui.QLabel(tab), QtGui.QLabel(tab), QtGui.QLabel(tab), QtGui.QLabel(tab), QtGui.QLabel(tab), QtGui.QLabel(tab), QtGui.QLabel(tab), QtGui.QLabel(tab), QtGui.QLabel(tab), QtGui.QLabel(tab)]] self.__ui__.tabWidget.addTab(tab, "") self.__ui__.tabWidget.setTabText(self.__ui__.tabWidget.indexOf(tab), card) ymargin=20 y = 10 xoffs = 20 for label in self.__tabs__[card][1][0:7]: label.setGeometry(QtCore.QRect(20, y, 130, 18)) y += ymargin y=10 for label in self.__tabs__[card][1][7:13]: label.setGeometry(QtCore.QRect(280, y, 130, 18)) y += ymargin self.__tabs__[card][1][0].setText("Rec Errors") self.__tabs__[card][1][1].setText("Rec Drops") self.__tabs__[card][1][2].setText("Send Errors") self.__tabs__[card][1][3].setText("Send Drops") self.__tabs__[card][1][4].setText("Send Coll") self.__tabs__[card][1][5].setText("Rec bytes") self.__tabs__[card][1][6].setText("Send bytes") self.__tabs__[card][1][7].setText("Rec packets") self.__tabs__[card][1][8].setText("Send packets") self.__tabs__[card][1][9].setText("Rec bytes/s") self.__tabs__[card][1][10].setText("Send bytes/s") self.__tabs__[card][1][11].setText("Avg rec packet size") self.__tabs__[card][1][12].setText("Avg snd packet size") y = 10 for label in self.__tabs__[card][2][0:7]: label.setGeometry(QtCore.QRect(150, y, 80, 18)) y += ymargin label.setText("0") y=10 for label in self.__tabs__[card][2][7:13]: label.setGeometry(QtCore.QRect(410, y, 80, 18)) y += ymargin label.setText("0")