def _getWidget(self): file = quickui.createWidget(type="QFileChooser", quickid="mshfile", description="Select .msh file", action="fileopen", validator=self._validFile, filefilter=(".msh", "*.msh","*.msh.gz", "*.msh.GZ")) bcfile = quickui.createWidget(type="QFileChooser", quickid="bcfile", description="Select boundary condition", action="fileopen", validator=None) pname = project.getNewProjectName("New_Project") projectname = quickui.createWidget(type="String", quickid="projectname", description="Project Name", value= pname, validator=self._validName) zipopt = quickui.createWidget(type="Boolean",quickid="zip",description="Zip Output", value=False) return quickui.createWidget(type="Group",quickid=self.pageid, components=[projectname, file, bcfile, zipopt])
def preprocess(self, state): cellzones = ['Porous Zone', 'Rotating Zone'] zones = [z[0] for z in state['fluidbcs']] clist = quickui.createWidget(type="ListPair", quickid="cellzone", description="Cellzone Options Assignment", list1=zones, list2=cellzones, name1="Zone List", name2="Options", selection="multi") self.pagecontents = quickui.createWidget(type="Group", quickid= self.pageid, components=[clist]) self.compose()
def preprocess(self, state): ilist = [] list = state['bcs'] for i in list: if i[1] == "Interface" or i[1] == "interface": ilist.append(i[0]) plist = quickui.createWidget(type="PairingInterface",quickid="IList",description="Interface List",options=ilist) self.pagecontents = quickui.createWidget(type="Group", quickid= self.pageid, components=[plist]) self.compose()
def openProject(): value=project.getRepository() file = quickui.createWidget(quickid="projectpath", description="Open Project", type = "QFileChooser", action="diropen",value=value) f = quickui.showDialog(file, parent=tool.getToolWindow()) if not f: return project.openProject(f)
def chooseAndEditRun(project=None): project = projectutils.getActiveProject() runnames = project.getRunNames() r = {} for name in runnames: r[name] = name c = quickui.createWidget(quickid="runname", description="Choose Run", type="Enum", value=project.activerun, options=r) runname = quickui.showDialog(c) print runname if runname: editRun(project=project, runname=runname)
def preprocess(self, state): zonelist = state['bcs'] bcs = ['Farfield Riemann', 'Interface', 'Interior', 'Internal', 'Pressure Inlet', 'Pressure Outlet', 'Supersonic Inflow', 'Supersonic Outflow', 'Symmetry', 'Wall'] def validate(v): if v in bcs: return v return None if state['mshval']: zones = [z[0] for z in zonelist] values = [validate(z[1]) for z in zonelist] else: zones = [item[0] for item in zonelist] values = [None for item in zonelist] tlist = quickui.createWidget(type="ListPair", quickid="bcs", description="Boundary Condition Assignment", list1=zones, list2=bcs, name1="Zone List", name2="Options") self.pagecontents = quickui.createWidget(type="Group", quickid= self.pageid, components=[tlist]) self.compose()
def createRun(project=None): p = project or projectutils.getActiveProject() if p.runs: i = 1 name = "Default_Run" + str(i) while name in p.runs: i = i + 1 name = "Default_Run" + str(i) else: name = "Default_Run" runname = quickui.createWidget(quickid="run", description="Name of Run", type="String", value=name) subdomains = quickui.createWidget(type="Integer", quickid="subdomains", value=2, description="Number of Subdomains") group=quickui.createWidget(type="Group", quickid="rundetails" ,components=[runname,subdomains]) v = quickui.showDialog(group, parent=tool.getToolWindow()) if not v: return preprocess.executeParallelPreprocessor(p,v['subdomains']) p.createRun(runname=v['run'], subdomains = v['subdomains']) p.save() return v['run']
def createPropWidget(node, properties): items = [item for item in properties.keys() if item!="name"] args = dict([(item, properties[item]) for item in items]) name = properties['name'] return quickui.createWidget(quickid = name, value=node.getProperty(name), **args)
def _getWidget(self): c1 = quickui.createWidget(quickid="Way",type="String",value="Right", description="Name") return quickui.createWidget(quickid=self.pageid, type="Group", components=[c1])
def _getWidget(self): c1 = quickui.createWidget(quickid="name",type="String",value="Vikrant", description="Name") c2 = quickui.createWidget(quickid="company",type="String",value="Freelance",description="Company") c3 = quickui.createWidget(quickid="whichway",type="Enum",description="Which way?", value="Left", options = ["Left", "Right"]) return quickui.createWidget(quickid=self.pageid,type="Group", components=[c1,c2,c3])
def _getWidget(self): s = quickui.createWidget(type="Float", quickid="scale", value=1.0, description="Scale") return quickui.createWidget(type="Group", quickid=self.pageid, components=[s])