Exemple #1
0
def newReportError():
    return ReportError

errorreportermenu = mainmenu.OOF.Help.addItem(oofmenu.OOFMenuItem(
    'Report_Error',
    callback= openReportError,
    params=[
        filenameparam.WriteFileNameParameter(
            'filename',tip="Name of the report file."),
        parameter.BooleanParameter(
            'pythonlog', True), 
        parameter.BooleanParameter(
            'pythonlogandoutputs', True),
        parameter.BooleanParameter(
            'installationlog', True),
        parameter.ListOfStringsParameter(
            'inputfiles', tip="Names of input files"),
        parameter.ListOfStringsParameter(
            'outputfiles', tip="Names of output files"),
        parameter.ListOfStringsParameter(
            'deletedfiles',
            tip="Names of input/output files no longer on the system"),
        parameter.StringParameter('comments')],
    no_log=1,
    help ="Choose information to send as an error report"))   

def addInputFile(menuitem, reporter, filename):
    if filename is not None and filename not in infiles:
       filenamePath = os.path.basename(filename)
       infiles.append(filename)
       reporter.update()
    
Exemple #2
0
        labeltree.makePath(skeleton) + [name],
        femesh,
        parent=skeletoncontext.skeletonContexts[skeleton],
        skeleton=skel,
        elementdict=edict,
        materialfactory=skeletonelement.SkeletonElement.realmaterial)
    meshctxt.createDefaultSubProblem()


meshmenu.addItem(
    OOFMenuItem(
        'New',
        callback=_newMesh,
        params=[
            parameter.StringParameter('name', tip="Name for the Mesh."),
            parameter.ListOfStringsParameter('masterelems',
                                             tip="Names of Master Elements."),
            whoville.WhoParameter('skeleton',
                                  skeletoncontext.skeletonContexts,
                                  tip=parameter.emptyTipString)
        ],
        help="Load a Mesh. Used internally in Mesh data files.",
        discussion="<para>Load a &mesh; from a datafile.</para>"))


def _newSubProblem(menuitem, mesh, name, subproblem):
    meshcontext = ooflib.engine.mesh.meshes[mesh]
    meshcontext.reserve()
    meshcontext.begin_writing()
    try:
        subpobj = subproblem.create()
        meshcontext.newSubProblem(subpobj, subproblem,
Exemple #3
0
    for name in active_areas:
        aa_dict[name].add_pixels(px_dict[name])


# This item is a sub-item of OOF.LoadData.Microstructure.DefineCategory.
microstructureIO.categorymenu.addItem(
    oofmenu.OOFMenuItem(
        'NamedActiveArea',
        callback=_namedactivearea,
        params=[
            whoville.WhoParameter('microstructure',
                                  ms_module.microStructures,
                                  tip=parameter.emptyTipString),
            parameter.IntParameter('category', tip=parameter.emptyTipString),
            parameter.ListOfStringsParameter('active_areas',
                                             tip=parameter.emptyTipString)
        ],
        help="Create a named active area in a microstructure",
        discussion="""<para> Creates a named active area when
    loading a microstructure from
    a file.  This menu item is only used in data files.</para>"""))


def _newactivearea(menuitem, microstructure, name):
    ms_obj = ms_module.getMicrostructure(microstructure)
    new_aa = activearea.ActiveArea(ms_obj.sizeInPixels(), ms_obj.size(),
                                   ms_obj)
    new_aa.rename(name)
    ms_obj.namedActiveAreas.append(new_aa)
    switchboard.notify('stored active areas changed', name)
Exemple #4
0
    props = [
        AllProperties[propname]()  # create instances
        for propname in properties
    ]
    materialmanager.materialmanager.new_material(name, MATERIALTYPE_BULK,
                                                 *props)


mainmenu.OOF.LoadData.addItem(
    oofmenu.OOFMenuItem('Material',
                        callback=loadMaterial,
                        params=[
                            parameter.StringParameter(
                                'name', tip="Name of the material."),
                            parameter.ListOfStringsParameter(
                                'properties',
                                tip="Properties for the material.")
                        ],
                        help="Load Materials from a data file.",
                        discussion=xmlmenudump.loadFile(
                            'DISCUSSIONS/engine/menu/loadmaterial.xml')))


#Interface branch.
def loadMaterialandType(menuitem, name, properties, materialtype):
    props = [
        AllProperties[propname]()  # create instances
        for propname in properties
    ]
    if materialtype is None:
        materialtype = MATERIALTYPE_BULK
Exemple #5
0
            (grp, newness) = ms.getGroup(groupname)
            grp.addPixels(pixels)
            all_group_dict[grp] = 1
            if newness:
                new_group_list.append(grp)
    finally:
        mscontext.end_writing()

    for g in all_group_dict.keys():
        switchboard.notify("changed pixel group", g, microstructure)
    for g in new_group_list:
        switchboard.notify("new pixel group", g)


microstructureIO.categorymenu.addItem(
    OOFMenuItem(
        pixelgroup.attributeReg.name(),
        callback=_readPixelGroups,
        params=[
            whoville.WhoParameter('microstructure',
                                  ooflib.common.microstructure.microStructures,
                                  tip=parameter.emptyTipString),
            parameter.IntParameter('category', tip="Pixel category."),
            parameter.ListOfStringsParameter(
                'groups', tip="List of names of pixel groups.")
        ],
        help=
        "Assign pixel groups to pixel categories. Used internally in data files.",
        discussion=xmlmenudump.loadFile(
            'DISCUSSIONS/common/menu/pgroupcategory.xml')))