def createDefaultDetailPage(self): page = QtGui.QWizardPage() layout = QtGui.QVBoxLayout() layout.addWidget(QtGui.QLabel('Construction Default Details')) layout.addWidget(QtGui.QLabel('Default Wall Construction')) ashraewallidf = idfread.idfRead('/usr/local/EnergyPlus-3-1-0/datasets/ASHRAE_2005_HOF_Materials.idf') compositewallidf = idfread.idfRead('/usr/local/EnergyPlus-3-1-0/datasets/CompositeWallConstructions.idf') windowidf = idfread.idfRead('/usr/local/EnergyPlus-3-1-0/datasets/WindowConstructs.idf') walls = ashraewallidf.getFilteredList('Construction') + compositewallidf.getFilteredList('Construction') windows = windowidf.getFilteredList('Construction') wallnames = [] windownames = [] for w in walls: wallnames.append(w.getName()) for w in windows: windownames.append(w.getName()) self.defaultwall = QtGui.QComboBox() self.defaultwall.addItems(wallnames) layout.addWidget(self.defaultwall) self.defaultwindow = QtGui.QComboBox() self.defaultwindow.addItems(windownames) layout.addWidget(QtGui.QLabel('Default Window Construction')) layout.addWidget(self.defaultwindow) page.setLayout(layout) return page
def __init__(self, parent=None): projectwidget.projectWidget.__init__(self, parent) # self.idfScene = GGraphicsScene() # self.idfView = QtGui.QGraphicsView(self.idfScene) self.horizontallayout = QtGui.QHBoxLayout() self.verticallayout = QtGui.QVBoxLayout(self) self.activeobjectlist = QtGui.QTreeView() self.horizontallayout.addWidget(self.activeobjectlist) # self.horizontallayout.addWidget(self.idfView) self.verticallayout.addLayout(self.horizontallayout) f = idfread.idfRead('Singlezonetemplate.idf') self.activemodel = idftreemodel.TreeModel(f.getActivelist()) idfglobals.referencedict = f.getActiveReferences() self.activeobjectlist.setModel(self.activemodel) self.activeobjectedit = None self.connect(self.activeobjectlist, QtCore.SIGNAL('activated (const QModelIndex&)'), self.activeObjectChanged)
def openIdf(self,filename): idf = idfread.idfRead(filename) if idf.success == False: msgBox = QtGui.QMessageBox() msgBox.setText("An Error Occurred when Loading the IDF file. Ok to continue with created objects") msgBox.setInformativeText(idf.errormsg) msgBox.setStandardButtons(QtGui.QMessageBox.Ok | QtGui.QMessageBox.Cancel) msgBox.setDefaultButton(QtGui.QMessageBox.Cancel) if msgBox.exec_() == 1: return if len(self.idflist) > 0: self.idflist = idf.getActiveList() else: self.idflist = self.idflist + idf.getActiveList() self.comments = self.comments + '\n' + idf.comment self.idfreadlist.append(idf) self.populateTree(self.idflist) self.buildDependsTree()
if len(newremaining) == len(remaininglines) : ignoredepends = True if len(newremaining) == 0: number = 1 remaininglines = newremaining[:] if len(remaininglines) > 0 : unconnected = TreeItem(['Unconnected',''],0,parent) for v in remaininglines: tlist = [] tlist.append(v.getClassnameIDD()) tlist.append(v.getName()) unconnected.appendChild(TreeItem(tlist,v,unconnected)) parent.appendChild(unconnected) if __name__ == "__main__": app = QtGui.QApplication(sys.argv) try: fname = sys.argv[1] except KeyError: fname = 'Singlezonetemplate.idf' f = idfread.idfRead(fname) model = TreeModel(f.getActivelist()) view = QtGui.QTreeView() view.setModel(model) view.setWindowTitle("Simple Tree Model") view.show() sys.exit(app.exec_())