powermodel.py 文件源码

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

项目:siren 作者: ozsolarwind 项目源码 文件源码
def initUI(self):
        self.chosen = []
        self.grid = QtGui.QGridLayout()
        self.checkbox = []
        self.checkbox.append(QtGui.QCheckBox('Check / Uncheck all', self))
        self.grid.addWidget(self.checkbox[-1], 0, 0)
        i = 0
        c = 0
        icons = Icons()
        for stn in sorted(self.stations, key=lambda station: station.name):
            if stn.technology[:6] == 'Fossil' and not self.actual:
                continue
            if stn.technology == 'Rooftop PV' and stn.scenario == 'Existing' and not self.gross_load:
                continue
            self.checkbox.append(QtGui.QCheckBox(stn.name, self))
            icon = icons.getIcon(stn.technology)
            if icon != '':
                self.checkbox[-1].setIcon(QtGui.QIcon(icon))
            i += 1
            self.grid.addWidget(self.checkbox[-1], i, c)
            if i > 25:
                i = 0
                c += 1
        self.grid.connect(self.checkbox[0], QtCore.SIGNAL('stateChanged(int)'), self.check_all)
        show = QtGui.QPushButton('Choose', self)
        self.grid.addWidget(show, i + 1, c)
        show.clicked.connect(self.showClicked)
        self.setLayout(self.grid)
        self.setWindowTitle('SIREN - Power Stations dialog')
        QtGui.QShortcut(QtGui.QKeySequence('q'), self, self.quitClicked)
        self.show_them = False
        self.show()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号