Exemple #1
0
 def on_interface_assign(self, button):
     menuitem=OOF.Material.Interface.Assign
     params = filter(lambda x: x.name != 'material', menuitem.params)
     materialname = self.currentMaterialName()
     if parameterwidgets.getParameters(
         title="Assign material %s to an interface" % materialname, *params):
         menuitem.callWithDefaults(material=materialname)
Exemple #2
0
 def save_skeletonCB(self, button):
     menuitem = mainmenu.OOF.File.Save.Skeleton
     skelname = self.skelwidget.get_value()
     params = filter(lambda x: x.name!="skeleton", menuitem.params)
     if parameterwidgets.getParameters(title='Save Skeleton "%s"' % skelname,
                                       *params):
         menuitem.callWithDefaults(skeleton=skelname)
Exemple #3
0
 def copyeqstateCB(self, gtkobj): # Button callback
     menuitem = subpmenu.Copy_Equation_State
     targetparam = menuitem.get_arg("target")
     targetparam.set(self.currentFullSubProblemName())
     if parameterwidgets.getParameters(targetparam,
                                       title="Select a target subproblem"):
         menuitem.callWithDefaults(source=self.currentFullSubProblemName())
Exemple #4
0
def fakeFileSelector(mode, ident=None, title=None, filename=None, params=None):
    nameparam = parameter.StringParameter('filename')
    parameters = [nameparam]
    if params:
        parameters.extend(params)
    if parameterwidgets.getParameters(title='Fake FileSelector', *parameters):
        return nameparam.value
Exemple #5
0
 def newCB(self, *args):             # gtk callback
     menuitem = meshmenu.csmenu.New
     if parameterwidgets.getParameters(menuitem.get_arg("name"),
                                       menuitem.get_arg("cross_section"),
                                       title="New cross section",
                                       scope=self.scope):
         menuitem.callWithDefaults(mesh=self.meshwidget.get_value())
Exemple #6
0
 def copyCB(self, button):
     menuitem = mainmenu.OOF.Image.Copy
     nameparam = menuitem.get_arg('name')
     msparam = menuitem.get_arg('microstructure')
     if parameterwidgets.getParameters(msparam, nameparam,
                                       title="Copy Image"):
         menuitem.callWithDefaults(image=self.imagewidget.get_value())
Exemple #7
0
 def autoCB(self, gtkobj):           # gtk callback for "Auto..." button
     paramset = filter(lambda x: x.name!='microstructure',
                       skeletonmenu.Auto.params)
     if parameterwidgets.getParameters(title='Automatic skeleton',
                                       *paramset):
         skeletonmenu.Auto.callWithDefaults(
             microstructure=self.currentMSName())
 def newBoundaryCB(self, gtkobj):    # button callback
     menuitem = boundarymenu.boundarymenu.Construct
     nameparam =  menuitem.get_arg('name')
     builderparam = menuitem.get_arg('constructor')
     if parameterwidgets.getParameters(
         nameparam, builderparam, title="New Boundary",scope=self):
         menuitem.callWithDefaults(skeleton=self.skelwidget.get_value())
    def modifyBoundaryCB(self, *args): # button callback
        # The parameter widget needs to know what types of modifiers to
        # present -- this can be passed through via the "parameter",
        # which should have its ".modifiertype" attribute set to the
        # same as the current boundary object.

        menuitem = boundarymenu.boundarymenu.Modify
        modparam = menuitem.get_arg('modifier')

        skelctxt = skeletoncontext.skeletonContexts[
            self.skelwidget.get_value()]
        bdyobj = skelctxt.getBoundary(self.boundarylist.get_value())

        # Hang the extra data we need on the parameter dialog box --
        # it's a widgetscope, so the enclosed widgets can navigate to
        # it easily, and it has the same lifetime as the data in
        # question.  The price of this is that we have to do the
        # dialog operations ourselves.

        dialog_extra = {'modifiertype' : bdyobj.modifiertype,
                       'boundaryname' : self.boundarylist.get_value() }
        
        
        if parameterwidgets.getParameters(
            modparam, title="Boundary modifier", scope=self,
            dialog_data=dialog_extra):
            menuitem.callWithDefaults(skeleton=self.skelwidget.get_value(),
                                      boundary=self.boundarylist.get_value())
 def deleteCB(self, gtkobj):
     menuitem = meshbdymenu.bdyanalysismenu.Delete
     if parameterwidgets.getParameters(
         menuitem.get_arg('name'),
         title='Delete a named boundary analysis',
         scope=self):
         menuitem.callWithDefaults()
 def savenamedCB(self, gtkobj):
     menuitem = meshbdymenu.bdyanalysismenu.SaveAnalysisDefs
     if parameterwidgets.getParameters(
         title="Save Boundary Analysis Definitions",
         ident="SaveAnalysis",
         *menuitem.params):
         menuitem.callWithDefaults()
Exemple #12
0
 def on_assignment(self, button):    # gtk callback
     menuitem = OOF.Material.Assign
     params = filter(lambda x: x.name != 'material', menuitem.params)
     materialname = self.currentMaterialName()
     if parameterwidgets.getParameters(
         title="Assign material %s to %ss" % (materialname,pixstring), *params):
         menuitem.callWithDefaults(material=materialname)
Exemple #13
0
 def editCB(self, *args):            # gtk callback
     menuitem = meshmenu.csmenu.Edit
     csname = self.chooser.get_value()
     csparam = menuitem.get_arg('cross_section')
     csparam.value = self.meshobj.getCrossSection(csname)
     if parameterwidgets.getParameters(menuitem.get_arg('cross_section'),
                                       title="Edit cross section " + csname):
         menuitem.callWithDefaults(mesh=self.meshobj.path(), name=csname)
Exemple #14
0
 def subprobRenameCB(self, gtkobj):
     menuitem = mainmenu.OOF.Subproblem.Rename
     namearg = menuitem.get_arg('name')
     cursubprob = self.currentFullSubProblemName()
     namearg.value = labeltree.makePath(cursubprob)[-1]
     if parameterwidgets.getParameters(
         namearg, title="Rename subproblem " + namearg.value):
         menuitem.callWithDefaults(subproblem=cursubprob)
Exemple #15
0
 def saveCB(self, *args):
     menuitem = mainmenu.OOF.File.Save.Mesh
     meshname = self.meshwidget.get_value()
     params = filter(lambda x: x.name!="mesh", menuitem.params)
     if parameterwidgets.getParameters(ident='SaveMeshFromPage',
                                       title='Save Mesh "%s"' % meshname,
                                       *params):
         menuitem.callWithDefaults(mesh=meshname)
Exemple #16
0
 def renameCB(self, *args):          # gtk button callback
     menuitem = meshmenu.Rename
     namearg = menuitem.get_arg('name')
     curmeshpath = self.currentFullMeshName()
     namearg.value = labeltree.makePath(curmeshpath)[-1]
     if parameterwidgets.getParameters(namearg,
                                       title='Rename mesh '+namearg.value):
         menuitem.callWithDefaults(mesh=curmeshpath)
Exemple #17
0
 def copyCB(self, *args):
     menuitem = meshmenu.csmenu.Copy
     csname = self.chooser.get_value()
     if parameterwidgets.getParameters(menuitem.get_arg('mesh'),
                                       menuitem.get_arg('name'),
                                       title="Copy cross section " + csname):
         menuitem.callWithDefaults(current=self.meshobj.path(),
                                   cross_section=csname)
Exemple #18
0
 def on_copy_property(self, button): # gtk callback
     menuitem = OOF.Property.Copy
     newnameparam = menuitem.get_arg('new_name')
     if parameterwidgets.getParameters(
         newnameparam,
         title='Copy property ' + self.current_property[0]):
         if newnameparam.nontrivial():
             menuitem.callWithDefaults(property=self.current_property[0])
Exemple #19
0
 def copyinitCB(self, button):  # gtk callback, copy field initializers
     menuitem = meshmenu.Copy_Field_Initializers
     targetparam = menuitem.get_arg("target")
     targetparam.set(self.currentFullMeshName())
     if parameterwidgets.getParameters(targetparam,
                                       parentwindow=guitop.top().gtk,
                                       title="Select a target Mesh"):
         menuitem.callWithDefaults(source=self.currentFullMeshName())
Exemple #20
0
    def copyfstateCB(self, gtkobj):  # Button callback.
        menuitem = subpmenu.Copy_Field_State
        targetparam = menuitem.get_arg("target")

        targetparam.set(self.currentFullSubProblemName())
        if parameterwidgets.getParameters(targetparam,
                                          title="Select a target Subproblem"):
            menuitem.callWithDefaults(source=self.currentFullSubProblemName())
Exemple #21
0
 def renameMSCB(self, button):
     menuitem = mainmenu.OOF.Microstructure.Rename
     namearg = menuitem.get_arg('name')
     namearg.value = self.currentMSName()
     if parameterwidgets.getParameters(
         namearg,
         title='Rename Microstructure '+self.currentMSName()):
         menuitem.callWithDefaults(microstructure=self.currentMSName())
Exemple #22
0
 def copyGroupButtonCB(self, button):
     menuitem = mainmenu.OOF.PixelGroup.Copy
     nameparam = menuitem.get_arg('name')
     if parameterwidgets.getParameters(
         nameparam,
         title='Copy group '+self.currentGroup().name()):
         menuitem.callWithDefaults(microstructure=self.currentMSName(),
                                   group=self.currentGroupName())
Exemple #23
0
 def copySolverCB(self, *args): # gtk callback
     menuitem = subpmenu.Copy_Solver
     targetparam = menuitem.get_arg("target")
     targetparam.set(self.currentFullSubProblemName())
     if parameterwidgets.getParameters(
         targetparam,
         title="Copy a Solver to a Subproblem"):
         menuitem.callWithDefaults(source=self.currentFullSubProblemName())
Exemple #24
0
 def copyinitCB(self, button): # gtk callback, copy field initializer
     menuitem = meshmenu.Copy_Field_Initializers
     targetparam = menuitem.get_arg("target")
     targetparam.set(self.currentFullMeshName())
     if parameterwidgets.getParameters(targetparam,
                                       parentwindow=guitop.top().gtk,
                                       title="Select a target Mesh"):
         menuitem.callWithDefaults(source=self.currentFullMeshName())
Exemple #25
0
 def copyAllSolversCB(self, *args):
     menuitem = meshmenu.Copy_All_Solvers
     targetparam = menuitem.get_arg("target")
     targetparam.set(self.currentFullMeshName())
     if parameterwidgets.getParameters(
         targetparam,
         title="Copy all Solvers to a Mesh"):
         menuitem.callWithDefaults(source=self.currentFullMeshName())
 def createCB(self, gtkobj): # create a named analysis
     menuitem = meshbdymenu.bdyanalysismenu.Create
     if parameterwidgets.getParameters(menuitem.get_arg('name'),
                                       title='Name an analysis operation',
                                       scope=self):
         menuitem.callWithDefaults(
             boundary=self.bdylist.get_value(),
             analyzer=self.analysisWidget.get_value())
 def newGroupCB(self, gtkobj):
     skelpath = self.parent.getCurrentSkeletonName()
     menuitem = self.activemode().getGroupMenu().New_Group
     group_param = menuitem.get_arg('name')
     if parameterwidgets.getParameters(
         group_param,
         title='Create a new %s group' % self.activemode().name()):
         menuitem.callWithDefaults(skeleton=skelpath)
 def addMaterialCB(self, gtkobj):
     skelpath = self.parent.getCurrentSkeletonName()
     current_group = self.grouplist.get_value()
     menuitem = self.activemode().getGroupMenu().Assign_Material
     if parameterwidgets.getParameters(
         menuitem.get_arg('material'),
         title="Assign a material to a %s group" % self.activemode().name()):
         menuitem.callWithDefaults(skeleton=skelpath, group=current_group)
Exemple #29
0
 def renameGroupButtonCB(self, button):
     menuitem = mainmenu.OOF.PixelGroup.Rename
     nameparam = menuitem.get_arg('new_name')
     nameparam.value = self.currentGroupName()
     if parameterwidgets.getParameters(nameparam,
                                       title='Rename %sgroup ' % pixstring +
                                       self.currentGroupName()):
         menuitem.callWithDefaults(microstructure=self.currentMSName(),
                                   group=self.currentGroupName())
Exemple #30
0
 def newOutputCB(self, gtkbutton):
     # Create a new scheduled output
     menuitem = outputmenu.New
     params = filter(lambda a: a.name != 'mesh', menuitem.params)
     if parameterwidgets.getParameters(title='Define a new Output',
                                       scope=self,
                                       parentwindow=guitop.top().gtk,
                                       *params):
         menuitem.callWithDefaults(mesh=self.currentFullMeshName())
Exemple #31
0
 def copyCB(self, *args):            # gtk button callback
     menuitem = mainmenu.OOF.Mesh.Copy
     nameparam = menuitem.get_arg("name")
     fieldparam = menuitem.get_arg("copy_field")
     eqnparam = menuitem.get_arg("copy_equation")
     bcparam = menuitem.get_arg("copy_bc")
     if parameterwidgets.getParameters(nameparam, fieldparam, eqnparam,
                                       bcparam, title='Copy a mesh'):
         menuitem.callWithDefaults(mesh=self.currentFullMeshName())
 def copyGroupCB(self, gtkobj):
     skelpath = self.parent.getCurrentSkeletonName()
     current_group = self.grouplist.get_value()
     menuitem = self.activemode().getGroupMenu().Copy_Group
     new_group_param = menuitem.get_arg('new_name')
     if parameterwidgets.getParameters(new_group_param,
                                       title='Copy group %s' %
                                       current_group):
         menuitem.callWithDefaults(skeleton=skelpath, group=current_group)
Exemple #33
0
 def saveMSCB(self, button):
     menuitem = mainmenu.OOF.File.Save.Microstructure
     msname = self.currentMSName()
     if parameterwidgets.getParameters(menuitem.get_arg('filename'),
                                       menuitem.get_arg('mode'),
                                       menuitem.get_arg('format'),
                                       title="Save Microstructure '%s'" %
                                       msname):
         menuitem.callWithDefaults(microstructure=msname)
Exemple #34
0
 def newOutputCB(self, gtkbutton):
     # Create a new scheduled output
     menuitem = outputmenu.New
     params = filter(lambda a: a.name != 'mesh', menuitem.params)
     if parameterwidgets.getParameters(title='Define a new Output',
                                       scope=self,
                                       parentwindow=guitop.top().gtk,
                                       *params):
         menuitem.callWithDefaults(mesh=self.currentFullMeshName())
Exemple #35
0
 def bcCopyAll_CB(self, gtkobj):
     currentmesh = self.currentFullMeshName()
     if currentmesh:
         menuitem = boundaryconditionmenu.bcmenu.Copy_All
         meshnameparam = menuitem.get_arg("mesh")
         if parameterwidgets.getParameters(
             meshnameparam,
             title="Choose the target mesh.", scope=self):
             menuitem.callWithDefaults(current=currentmesh)
Exemple #36
0
 def createCB(self, gtkobj):  # create a named analysis
     menuitem = analyzemenu.namedanalysismenu.Create
     if parameterwidgets.getParameters(menuitem.get_arg('name'),
                                       title='Name an analysis operation',
                                       scope=self):
         menuitem.callWithDefaults(operation=self.op_obj.get_value(),
                                   data=self.output_obj.get_value(),
                                   domain=self.domain_obj.get_value(),
                                   sampling=self.sample_obj.get_value())
 def addMaterialCB(self, gtkobj):
     skelpath = self.parent.getCurrentSkeletonName()
     current_group = self.grouplist.get_value()
     menuitem = self.activemode().getGroupMenu().Assign_Material
     if parameterwidgets.getParameters(
             menuitem.get_arg('material'),
             title="Assign a material to a %s group" %
             self.activemode().name()):
         menuitem.callWithDefaults(skeleton=skelpath, group=current_group)
Exemple #38
0
 def renameCB(self, *args):  # gtk button callback
     menuitem = meshmenu.Rename
     namearg = menuitem.get_arg('name')
     curmeshpath = self.currentFullMeshName()
     namearg.value = labeltree.makePath(curmeshpath)[-1]
     if parameterwidgets.getParameters(namearg,
                                       title='Rename mesh ' +
                                       namearg.value):
         menuitem.callWithDefaults(mesh=curmeshpath)
Exemple #39
0
 def subprobRenameCB(self, gtkobj):
     menuitem = mainmenu.OOF.Subproblem.Rename
     namearg = menuitem.get_arg('name')
     cursubprob = self.currentFullSubProblemName()
     namearg.value = labeltree.makePath(cursubprob)[-1]
     if parameterwidgets.getParameters(namearg,
                                       title="Rename subproblem " +
                                       namearg.value):
         menuitem.callWithDefaults(subproblem=cursubprob)
Exemple #40
0
 def saveMSCB(self, button):
     menuitem = mainmenu.OOF.File.Save.Microstructure
     msname = self.currentMSName()
     if parameterwidgets.getParameters(
         menuitem.get_arg('filename'),
         menuitem.get_arg('mode'),
         menuitem.get_arg('format'),
         title="Save Microstructure '%s'" % msname):
         menuitem.callWithDefaults(microstructure=msname)
Exemple #41
0
 def copyCB(self, *args):            # gtk button callback
     menuitem = mainmenu.OOF.Mesh.Copy
     nameparam = menuitem.get_arg("name")
     fieldparam = menuitem.get_arg("copy_field")
     eqnparam = menuitem.get_arg("copy_equation")
     bcparam = menuitem.get_arg("copy_bc")
     if parameterwidgets.getParameters(nameparam, fieldparam, eqnparam,
                                       bcparam, title='Copy a mesh'):
         menuitem.callWithDefaults(mesh=self.currentFullMeshName())
Exemple #42
0
 def bcCopyAll_CB(self, gtkobj):
     currentmesh = self.currentFullMeshName()
     if currentmesh:
         menuitem = boundaryconditionmenu.bcmenu.Copy_All
         meshnameparam = menuitem.get_arg("mesh")
         if parameterwidgets.getParameters(meshnameparam,
                                           title="Choose the target mesh.",
                                           scope=self):
             menuitem.callWithDefaults(current=currentmesh)
Exemple #43
0
 def on_copy(self, button):  # gtk callback
     oldname = self.currentMaterialName()
     if oldname is not None:
         menuitem = OOF.Material.Copy
         newnameparam = menuitem.get_arg('new_name')
         if parameterwidgets.getParameters(
                 newnameparam, title="Name for the new material."):
             if newnameparam.nontrivial():
                 menuitem.callWithDefaults(name=oldname)
Exemple #44
0
 def newBoundaryCB(self, gtkobj):  # button callback
     menuitem = boundarymenu.boundarymenu.Construct
     nameparam = menuitem.get_arg('name')
     builderparam = menuitem.get_arg('constructor')
     if parameterwidgets.getParameters(nameparam,
                                       builderparam,
                                       title="New Boundary",
                                       scope=self):
         menuitem.callWithDefaults(skeleton=self.skelwidget.get_value())
Exemple #45
0
 def renameBoundaryCB(self, gtkobj):  # button callback
     menuitem = boundarymenu.boundarymenu.Rename
     newname = menuitem.get_arg('name')
     oldname = self.boundarylist.get_value()
     newname.set(oldname)
     if parameterwidgets.getParameters(newname,
                                       title="New name for this boundary"):
         menuitem.callWithDefaults(skeleton=self.skelwidget.get_value(),
                                   boundary=self.boundarylist.get_value())
Exemple #46
0
 def editCB(self, *args):  # gtk callback
     menuitem = meshmenu.csmenu.Edit
     csname = self.chooser.get_value()
     csparam = menuitem.get_arg('cross_section')
     csparam.value = self.meshobj.getCrossSection(csname)
     if parameterwidgets.getParameters(menuitem.get_arg('cross_section'),
                                       title="Edit cross section " +
                                       csname):
         menuitem.callWithDefaults(mesh=self.meshobj.path(), name=csname)
Exemple #47
0
 def copyCB(self, *args):
     menuitem = meshmenu.csmenu.Copy
     csname = self.chooser.get_value()
     if parameterwidgets.getParameters(menuitem.get_arg('mesh'),
                                       menuitem.get_arg('name'),
                                       title="Copy cross section " +
                                       csname):
         menuitem.callWithDefaults(current=self.meshobj.path(),
                                   cross_section=csname)
Exemple #48
0
 def on_rename(self, button):  # gtk callback
     oldname = self.currentMaterialName()
     if oldname is not None:
         menuitem = OOF.Material.Rename
         newnameparam = menuitem.get_arg("name")
         if parameterwidgets.getParameters(
                 newnameparam, title="New name for the material."):
             if newnameparam.nontrivial():
                 menuitem.callWithDefaults(material=oldname)
Exemple #49
0
 def newdirCB(self, button):
     dirnameparam = parameter.StringParameter('directory name')
     if parameterwidgets.getParameters(dirnameparam, title="New Directory"):
         if dirnameparam.value[0] != os.sep:
             dirname = os.path.join(self.cwd(), dirnameparam.value)
         else:
             dirname = dirnameparam.value
         os.mkdir(dirname)  # raises exception if file exists
         self.dirHistory.push(dirname)
         self.switchDir(dirname)
Exemple #50
0
 def renameInterfaceCB(self, gtkobj):
     menuitem = mainmenu.OOF.Microstructure.Interface.Rename
     newname = menuitem.get_arg('name')
     oldname = self.interfacelist.get_value()
     newname.set(oldname)
     if parameterwidgets.getParameters(newname,
                                       title="New name for this interface"):
         menuitem.callWithDefaults(
             microstructure=self.skelwidget.get_value(depth=1),
             interface=self.interfacelist.get_value())
Exemple #51
0
 def renameCB(self, button):
     menuitem = mainmenu.OOF.ActiveArea.Rename
     namearg = menuitem.get_arg('newname')
     namearg.value = self.getCurrentActiveArea()
     oldname = self.getCurrentActiveArea()
     if parameterwidgets.getParameters(menuitem.get_arg('newname'),
                                       title="Rename active%s '%s'"
                                            % (spacestring,oldname)):
         menuitem.callWithDefaults(microstructure=self.getCurrentMSName(),
                                   oldname=oldname)
Exemple #52
0
 def doubleClickMethodCB(self, method):
     menuitem = self.menu.LayerSet.Replace_Method
     methodarg = menuitem.get_arg('method')
     methodarg.value = method
     if parameterwidgets.getParameters(methodarg,
                                       parentwindow=self.gtk,
                                       title=self.methodDialogTitle(),
                                       scope=self):
         layernumber = self.methodList.get_index()
         menuitem.callWithDefaults(layer_number=layernumber)
Exemple #53
0
 def renameCB(self, *args):  # gtk callback
     menuitem = meshmenu.csmenu.Rename
     oldname = self.chooser.get_value()
     namearg = menuitem.get_arg('name')
     namearg.value = oldname
     if parameterwidgets.getParameters(namearg,
                                       title='Rename cross section "%s"' %
                                       oldname):
         menuitem.callWithDefaults(mesh=self.meshwidget.get_value(),
                                   cross_section=oldname)
Exemple #54
0
 def on_save(self, button):  # gtk callback
     # Save a single material
     menuitem = OOF.File.Save.Materials
     materialname = self.currentMaterialName()
     params = filter(lambda x: x.name != "materials", menuitem.params)
     if parameterwidgets.getParameters(title='Save Material "%s"' %
                                       materialname,
                                       ident='SaveMat',
                                       *params):
         menuitem.callWithDefaults(materials=[materialname])
Exemple #55
0
 def renameCB(self, gtkbutton):
     menuitem = outputmenu.Rename
     nameparam = menuitem.get_arg('name')
     name = self.currentOutputName()
     nameparam.set(name)
     if parameterwidgets.getParameters(nameparam,
                                       title='Rename output "%s"' % name,
                                       scope=self,
                                       parentwindow=guitop.top().gtk):
         menuitem.callWithDefaults(mesh=self.currentFullMeshName(),
                                   output=self.currentOutputName())
Exemple #56
0
 def assignmatCB(self, gtkobj):
     menuitem = mainmenu.OOF.Material.Interface.Assign
     matparam = menuitem.get_arg('material')
     interfacename = self.interfacelist.get_value()
     if parameterwidgets.getParameters(
             matparam,
             title="Assign material to interface %s" % interfacename):
         menuitem.callWithDefaults(
             microstructure=self.skelwidget.get_value(depth=1),
             interfaces=[interfacename],
             skeleton=None)
Exemple #57
0
 def newInterfaceCB(self, gtkobj):
     #self.skelwidget.get_value() returns the skeletonpath,
     #e.g. "msname:skelname". Pass depth=1 to get "msname"
     msname = self.skelwidget.get_value(depth=1)
     menuitem = mainmenu.OOF.Microstructure.Interface.New
     params = filter(lambda x: x.name != 'microstructure', menuitem.params)
     if parameterwidgets.getParameters(
             title="Create interface in microstructure %s" % msname,
             scope=self,
             *params):
         menuitem.callWithDefaults(microstructure=msname)
Exemple #58
0
def _save_prop(menuitem):
    global materialspage
    propname = materialspage.current_property_name()
    if propname:
        params = filter(lambda x: x.name != "property", menuitem.params)
        if parameterwidgets.getParameters(ident='PropMenu',
                                          title='Save Property',
                                          *params):
            menuitem.callWithDefaults(property=propname)
    else:
        reporter.report("No property selected for saving.")
Exemple #59
0
 def bcRename_CB(self, gtkobj):
     meshname = self.currentFullMeshName()
     bcname = self.bclist.getBCName()
     if meshname and bcname:
         menuitem = boundaryconditionmenu.bcmenu.Rename
         newnameparam = menuitem.get_arg('name')
         newnameparam.value = bcname
         if parameterwidgets.getParameters(
                 newnameparam,
                 title="Rename the boundary condition '%s'" % bcname):
             menuitem.callWithDefaults(mesh=meshname, bc=bcname)
Exemple #60
0
 def setSolverCB(self, *args): # gtk callback
     menuitem = subpmenu.Set_Solver
     subp = self.currentSubProblemContext()
     mode_arg = menuitem.get_arg('solver_mode')
     mode_arg.set(subp.solver_mode)
     if parameterwidgets.getParameters(mode_arg,
                                       title='Specify Solver',
                                       parentwindow=guitop.top().gtk,
                                       scope=self):
         menuitem.callWithDefaults(
             subproblem=self.currentFullSubProblemName())