full.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:GUI-for-EWBF 作者: K4P11 项目源码 文件源码
def __init__(self, parent=None):

        super(Second, self).__init__(parent)
        self.T=[]
        self.P=[]
        self.sp=[]
        self.dt=[]
        self.eff=[]
        url=setter.url

        try:
            url=setter.url
            l= requests.get(url).json()
            for i in range(0,len(l['result'])):
                self.T.append([])
                self.P.append([])
                self.sp.append([])
                self.eff.append([])
        except requests.exceptions.RequestException as e:
                i=0

        self.resize(1000,800)
        self.setWindowTitle('Performance monitor')
        pg.setConfigOptions(antialias=True)

        self.p1 = self.addPlot(title="GPUs speed", axisItems={'bottom': TimeAxisItem(orientation='bottom')})
        self.curve = []
        #self.p1.addLegend()
        vb = self.addViewBox()#
        vb.setMaximumWidth(100)
        legend = pg.LegendItem()
        legend.setParentItem(vb)
        legend.anchor((0,0), (0,0))#

        self.nextRow()
        self.p2= self.addPlot(title="Temperature", axisItems={'bottom': TimeAxisItem(orientation='bottom')})
        #self.p2.addLegend()
        self.curve1=[]
        self.nextRow()
        self.p3= self.addPlot(title="Power", axisItems={'bottom': TimeAxisItem(orientation='bottom')})
        #self.p3.addLegend()
        self.curve2=[]
        self.nextRow()
        self.p4= self.addPlot(title="Effiency", axisItems={'bottom': TimeAxisItem(orientation='bottom')})
        #self.p4.addLegend()
        self.curve3=[]
        colors=[[255,0,0],[0,255,0],[0,0,255],[0,255,255],[255,0,255],[255,255,0],[125,125,0],[125,0,125],[0,125,125],[255,150,50],[255,50,150]]
        for i in range(0,len(self.T)):
            self.curve.append(self.p1.plot(pen='y',symbolBrush=(colors[i][0],colors[i][1],colors[i][2]), symbolPen='w',name='n GPU '+str(i)))                    
            self.curve1.append(self.p2.plot(pen='y',symbolBrush=(colors[i][0],colors[i][1],colors[i][2]), symbolPen='w',name='GPU '+str(i)))
            self.curve2.append(self.p3.plot(pen='y',symbolBrush=(colors[i][0],colors[i][1],colors[i][2]), symbolPen='w',name='GPU '+str(i)))
            self.curve3.append(self.p4.plot(pen='y',symbolBrush=(colors[i][0],colors[i][1],colors[i][2]), symbolPen='w',name='GPU '+str(i)))
            legend.addItem(self.curve[i],name=self.curve[i].name())        
        self.update()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号