예제 #1
0
파일: ReadMeteo.cpp 프로젝트: nixz/covise
/// Constructor
coReadMeteo::coReadMeteo(int argc, char *argv[])
    : coModule(argc, argv, "Read files to create a list of points (stars) and scalar parameters.")
    , lineBuf(NULL)
    , lineBufSize(0)
{

    // Create ports:
    poData = addOutputPort("Data", "StructuredGrid|Float", "Height Field or data");
    poData->setInfo("Height field or data");

    // Create parameters:
    pbrFile = addFileBrowserParam("FilePath", "First file of sequence or single file");
    pbrFile->setValue("data/", "*");

    pDimX = addInt32Param("DimX", "X Dimension");
    pDimX->setValue(40);

    pDimY = addInt32Param("DimY", "Y Dimension");
    pDimY->setValue(40);

    pDimZ = addInt32Param("DimZ", "Z Dimension");
    pDimZ->setValue(16);

    pScale = addFloatParam("Scale", "Scale factor");
    pScale->setValue(0.001f);

    pboDataMode = addBooleanParam("DataMode", "Read files as data (instead of height information)");
    pboDataMode->setValue(true);

    pboWarnings = addBooleanParam("Warnings", "Display warnings when reading files");
    pboWarnings->setValue(true);
}
예제 #2
0
ComputeTrace::ComputeTrace(int argc, char *argv[])
    : coSimpleModule(argc, argv, "Creates traces from points timestep dependent")
    , m_firsttime(true)
{
    //the timesteps shall NOT be handled automatically by the coSimpleModule class
    setComputeTimesteps(1);

    /*Fed in points*/
    p_pointsIn = addInputPort("GridIn0", "Points|Spheres", "a set of points or spheres containing the particle/s to be traced over time");
    p_dataIn = addInputPort("DataIn0", "Float|Byte|Int|Vec2|Vec3|RGBA|Mat3|Tensor", "data mapped associated with spheres");
    p_dataIn->setRequired(false);
    p_IDIn = addInputPort("IDIn0", "Int", "ID of each atom");
    p_IDIn->setRequired(false);
    /*Boolean that specifies if a particle should be traced or not*/
    p_traceParticle = addBooleanParam("traceParticle", "set if particle should be traced");
    p_traceParticle->setValue(1);
    /*Integer that specifies the particle to be traced in Module Parameter window*/
    p_particle = addStringParam("selection", "ranges of selected set elements");
    p_particle->setValue("1-1");
    p_maxParticleNumber = addInt32Param("maxParticleNum", "maximum number of particles to trace");
    p_maxParticleNumber->setValue(100);
    /*Integer that specifies the starting point*/
    p_start = addIntSliderParam("start", "Timestep at which the tracing should be started");
    p_start->setValue(0, 0, 0);
    /*Integer that specifies the ending point*/
    p_stop = addIntSliderParam("stop", "Timestep at which the tracing should be stopped");
    p_stop->setValue(0, 0, 0);
    /* Boolean that specifies if the bounding box leaving should be regarded */
    p_regardInterrupt = addBooleanParam("LeavingBoundingBox", "set if leaving bounding box should be taken into account");
    p_regardInterrupt->setValue(0);
    p_animate = addBooleanParam("animate", "disable for static trace");
    p_animate->setValue(1);
    /* 3 values specifying the x, y and z dimension of the bounding box */
    p_boundingBoxDimensions = addFloatVectorParam("BoundingBoxDimensions", "x, y, z dimensions of the bounding box");
    p_boundingBoxDimensions->setValue(0, 0, 0);
    /*Output should be a line*/
    p_traceOut = addOutputPort("GridOut0", "Lines", "Trace of a specified particle");
    /*unique index per line mappable as color attribute*/
    p_indexOut = addOutputPort("DataOut0", "Float", "unique index for every specified particle");
    /*fade out value per timestep mappable as color attribute*/
    p_fadingOut = addOutputPort("DataOut1", "Float", "fade out value for per vertex coloring of lines over time");
    p_dataOut = addOutputPort("DataOut2", "Float|Byte|Int|Vec2|Vec3|RGBA|Mat3|Tensor", "data mapped to lines");

    p_dataOut->setDependencyPort(p_dataIn);
    IDs = NULL;

    assert(sizeof(animValues) / sizeof(animValues[0]) == AnimNumValues);
    p_animateViewer = addChoiceParam("animateViewer", "Animate Viewer");
    p_animateViewer->setValue(AnimNumValues, animValues, AnimOff);

    p_animLookAt = addFloatVectorParam("animLookAt", "Animated viewer looks at this point");
    p_animLookAt->setValue(0., 0., 0.);
}
예제 #3
0
ReadHyperMesh::ReadHyperMesh(int argc, char **argv)
    : coSimpleModule(argc, argv, "Read Altair HyperMesh files")
{
    // module parameters

    fileName = addFileBrowserParam("MeshFileName", "dummy");
    fileName->setValue("./", "*.hm*");
    resultsFileName = addFileBrowserParam("ReslutFileName", "dummy");
    resultsFileName->setValue("./", "*.hm*;*.fma");

    subdivideParam = addBooleanParam("subdivide", "Subdivide tet10 and hex20 elements");
    subdivideParam->setValue(true);

    p_numt = addInt32Param("numt", "Nuber of Timesteps to read");
    p_numt->setValue(1000);
    p_skip = addInt32Param("skip", "Nuber of Timesteps to skip");
    p_skip->setValue(0);

    p_Selection = addStringParam("Selection", "Parts to load");
    p_Selection->setValue("0-9999999");

    // Output ports
    mesh = addOutputPort("mesh", "UnstructuredGrid", "Unstructured Grid");
    mesh->setInfo("Unstructured Grid");
    char buf[1000];
    int i;
    for (i = 0; i < NUMRES; i++)
    {
        sprintf(buf, "data%d", i);
        dataPort[i] = addOutputPort(buf, "Float|Vec3", buf);
        dataPort[i]->setInfo(buf);
    }
}
예제 #4
0
/*! \brief constructor
 *
 * create In/Output Ports and module parameters here
 */
LoadCadData::LoadCadData(int argc, char **argv)
    : coModule(argc, argv, "Read CAD data")
{

    p_pointName = addOutputPort("model", "Points", "Model");
    p_modelPath = addFileBrowserParam("modelPath", "modelPath");
    p_scale = addFloatParam("scale", "global Scale factor used for OpenCover session");
    p_resize = addFloatVectorParam("resize", "Resize factor");
    p_rotangle = addFloatParam("rotangle", "angle for rotation");
    p_tansvec = addFloatVectorParam("transvec", "Vector for translation");
    p_rotvec = addFloatVectorParam("rotsvec", "Vector for rotation");
    p_backface = addBooleanParam("backface", "Backface Culling");
    p_orientation_iv = addBooleanParam("orientation_iv", "Orientation of iv models like in Inventor Renderer");
    p_convert_xforms_iv = addBooleanParam("convert_xforms_iv", "create LoadCadData DCS nodes");

    p_scale->setValue(-1.0);
    p_rotangle->setValue(0);
    p_resize->setValue(1, 1, 1);
}
예제 #5
0
파일: ReadPLUTO.cpp 프로젝트: nixz/covise
ReadPLUTO::ReadPLUTO(int argc, char **argv)
    : coSimpleModule(argc, argv,
                     "Read PLUTO")
{
    // ports
    p_mesh = addOutputPort("mesh", "StructuredGrid", "structured grid");
    p_rho = addOutputPort("rho", "Float", "density");
    p_rholog = addOutputPort("rholog", "Float", "logarithmic density");
    p_pressure = addOutputPort("pressure", "Float", "pressure");
    p_pressurelog = addOutputPort("pressurelog", "Float", "logarithmic pressure");
    p_velocity = addOutputPort("velocity", "Vec3", "velocity");
    p_magfield = addOutputPort("magfield", "Vec3", "magnetic field");
    p_velocity_cart = addOutputPort("velocity_cart", "Vec3", "velocity in cartesian coordinates");
    p_magfield_cart = addOutputPort("magfield_cart", "Vec3", "magnetic field in cartesian coordinates");

    // choice arrays
    const char *precisionChoice[] = { "single", "double" };
    const char *fileFormatChoice[] = { "single", "multiple" };

    // parameter
    p_path = addFileBrowserParam("path", "Data file path");
    p_path->setValue("$PLUTO_DIR/Torus_3D/", "grid.out");

    p_precision = addChoiceParam("format", "single or double precision");
    p_precision->setValue(2, precisionChoice, 0);

    p_file_format = addChoiceParam("single", "single file or multiple files");
    p_file_format->setValue(2, fileFormatChoice, 1);

    p_tbeg = addInt32Param("t_beg", "First timestep to read");
    p_tbeg->setValue(1);

    p_tend = addInt32Param("t_end", "Last timestep to read");
    p_tend->setValue(1);

    p_skip = addInt32Param("skip", "Number of timesteps to skip");
    p_skip->setValue(0);

    p_axisymm = addBooleanParam("axisymm", "Is the data spherical 2D axisammetric?");
    p_axisymm->setValue(0); // 0 == False

    p_n_axisymm = addInt32Param("n_axisymm", "Expand phi-coordinate with n cells");
    p_skip->setValue(20);

    mesh = NULL;
}
예제 #6
0
파일: Hello.cpp 프로젝트: nixz/covise
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// ++++
// ++++  Constructor : This will set up module port structure
// ++++
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Hello::Hello(int argc, char *argv[])
    : coModule(argc, argv, "Hello, world! program")
{
#ifdef E1
    stringParam = addStringParam("Output Text", "Text that should be sent to COVISE");
#endif
#ifdef E2
    boolParam = addBooleanParam("Show String", "Show the text parameter in the Control Panel");
#endif

#if defined(E3) || defined(E5)
    geoOutPort = addOutputPort("geometries", "Lines|Polygons", "Output geometries");
#endif
#ifdef E4
    dataOutPort = addOutputPort("data", "Unstructured_S3D_Data", "Output data");
#endif

}
예제 #7
0
ReadITT::ReadITT(int argc, char *argv[])
    : coSimLib(argc, argv, "ReadITT", "This is the ReadITT module transformed into interface to simulation")
{
    // module parameters
    char *pDataPath = getenv("COVISE_DATA_ITT");

    m_pParamFile = addFileBrowserParam("Filename", "dummy");
    if (pDataPath != NULL)
    {
        m_pParamFile->setValue(pDataPath, "*.via;*.vim;*.vis/*.via/*.vim/*.vis/*");
    }
    else
    {
        m_pParamFile->setValue("./", "*.via;*.vim;*.vis/*.via/*.vim/*.vis/*");
    }

    m_pLookAhead = addBooleanParam("Lookahead", "lookahead");
    m_pLookAhead->setValue(0);

    m_pLookAheadValue = addInt32Param("LookaheadValue", "test");
    m_pLookAheadValue->setValue(0);

    m_pSleepSeconds = addInt32Param("SleepSeconds", "seconds to sleep");
    m_pSleepSeconds->setValue(10);

    // Output ports
    m_portPoints = addOutputPort("points", "Points", "points Output");
    m_portPoints->setInfo("points Output");

    m_portRadii = addOutputPort("radii", "Float", "Atom Radii Output");
    m_portRadii->setInfo("Radii Output");

    m_portColors = addOutputPort("colors", "RGBA", "Atom Colors Output");
    m_portColors->setInfo("Colors Output");

    m_portVolumeBox = addOutputPort("Boundingbox", "Lines", "Bounding Box Output");
    m_portVolumeBox->setInfo("BoundingBox Output");

    m_bDoSelfExec = false;
}
예제 #8
0
파일: ReadSTP3.cpp 프로젝트: nixz/covise
/// Constructor
coReadSTP3::coReadSTP3(int argc, char *argv[])
    : coModule(argc, argv, "Read STP3 volume files.")
{
    // Create ports:
    poGrid = addOutputPort("grid", "UniformGrid", "Grid for volume data");
    poGrid->setInfo("Grid for volume data");

    poVolume = addOutputPort("data", "Float", "Scalar volume data");
    poVolume->setInfo("Scalar volume data (range 0-1)");

    // Create parameters:
    pbrVolumeFile = addFileBrowserParam("FilePath", "STP3 file");
    pbrVolumeFile->setValue("data", "*.img");

    pboUseVoi = addBooleanParam("UseVoi", "Map data outside of volume of interest to constant value");
    pboUseVoi->setValue(false);

    pisVoiNo = addInt32Param("NoVoi", "Number of volume of interest to use");
    pisVoiNo->setValue(1);

    pfsIgnoreValue = addFloatParam("IgnoreValue", "Value data not within the volume of interest is mapped to");
    pfsIgnoreValue->setValue(0.0);

    for (int i = 0; i < NO_VOIS; i++)
    {
        char buf1[1024], buf2[1024];
        sprintf(buf1, "Volume%dFromVoi", i + 1);
        sprintf(buf2, "Number of volume of interest to use for volume %d", i + 1);
        pisVolumeFromVoi[i] = addInt32Param(buf1, buf2);
        pisVolumeFromVoi[i]->setValue(i + 2);

        sprintf(buf1, "voi%d", i + 1);
        sprintf(buf2, "Volume of interest no. %d", i + 1);
        poVoi[i] = addOutputPort(buf1, "Float", buf2);
    }
}
예제 #9
0
파일: ReadMPAPDB.cpp 프로젝트: xyuan/covise
ReadMPAPDB::ReadMPAPDB(int argc, char *argv[])
    : coModule(argc, argv, "Reader for MPA PDB files")
{

    m_pParamFile = addFileBrowserParam("filename", "name of first PDB file to read");
    m_pParamFile->setValue("", "*.pdb;*.rasmol/*");

    m_pUseIDFromFile = addBooleanParam("use_ID_from_file", "use atom ID from file (otherwise use atom name)");
    m_pUseIDFromFile->setValue(true);

    m_pNTimesteps = addInt32Param("n_timesteps", "number of timesteps to read");
    m_pNTimesteps->setValue(1);

    m_pStepTimesteps = addInt32Param("Step_timesteps", "read every n-th timestep (Step)");
    m_pStepTimesteps->setValue(1);

    m_portPoints = addOutputPort("points", "Points", "points Output");
    m_portPoints->setInfo("points Output");

    m_portAtomType = addOutputPort("AtomType", "Int", "atom type");
    m_portAtomType->setInfo("Atom type");

    m_portAtomID = addOutputPort("AtomID", "Int", "ID of each atom");
    m_portAtomID->setInfo("Atom ID");

    // try to add local atommapping.xml to current coviseconfig
    m_mapConfig = new coConfigGroup("Module.AtomColors");
    m_mapConfig->addConfig(coConfigDefaultPaths::getDefaultLocalConfigFilePath() + "atommapping.xml", "local", true);
    coConfig::getInstance()->addConfig(m_mapConfig);

    coCoviseConfig::ScopeEntries mappingEntries = coCoviseConfig::getScopeEntries("Module.AtomMapping");
    if (mappingEntries.getValue() == NULL)
    {
        // add global atommapping.xml to current coviseconfig
        m_mapConfig->addConfig(coConfigDefaultPaths::getDefaultGlobalConfigFilePath() + "atommapping.xml", "global", true);
        coConfig::getInstance()->addConfig(m_mapConfig);
        // retrieve the values of atommapping.xml and build the GUI
    }
    coCoviseConfig::ScopeEntries mappingEntries2 = coCoviseConfig::getScopeEntries("Module.AtomMapping");

    const char **mapEntry = mappingEntries2.getValue();
    if (mapEntry == NULL)
        std::cout << "AtomMapping is NULL" << std::endl;
    int iNrCurrent = 0;
    float radius;
    char cAtomName[256];
    char cAtomType[TYPELENGTH];

    if (mapEntry == NULL || *mapEntry == NULL)
        std::cout << "The scope Module.AtomMapping is not available in your covise.config file!" << std::endl;

    const char **curEntry = mapEntry;
    while (curEntry && *curEntry)
    {
        AtomColor ac;
        int iScanResult = sscanf(curEntry[1], "%3s %s %f %f %f %f %f", cAtomType, cAtomName, &radius, &ac.color[0], &ac.color[1], &ac.color[2], &ac.color[3]);

        if (iScanResult == 7)
        {
            m_rgb.push_back(ac);
            if (radius < 0.)
                radius = 0.;
            m_radius.push_back(radius);
            m_atomtype.push_back(ac.type);

            // convert to lower case (we want to be case-insensitive)
            for (int i = 0; i < TYPELENGTH; i++)
            {
                cAtomType[i] = tolower(cAtomType[i]);
            }
            AtomID[cAtomType] = iNrCurrent;

            //fprintf(stderr, "%d: name=%s (%s)\n", iNrCurrent+1, cAtomName, ac.type);
            if (iNrCurrent + 1 != atoi(curEntry[0]))
            {
                std::cout << "Your atommapping.xml is garbled" << std::endl;
            }
        }
        iNrCurrent++;
        curEntry += 2;
    }
}
예제 #10
0
파일: Rechenraum.cpp 프로젝트: nixz/covise
void rechenraum::CreateUserMenu(void)
{
    //   fprintf(stderr, "Entering CreateUserMenu()\n");

    char *tmp;
    int i;
    char path[512];

    p_makeGrid = addBooleanParam("make_grid", "make grid?");
    p_makeGrid->setValue(0);

    p_lockmakeGrid = addBooleanParam("lock_make_grid_button", "lock make grid button?");
    p_lockmakeGrid->setValue(0);

    p_createGeoRbFile = addBooleanParam("create_geo_or_rb_file", "create geo/rb file?");
    p_createGeoRbFile->setValue(0);

    p_gridSpacing = addFloatParam("spacing", "elements per floor square");
    p_gridSpacing->setValue(4.);

    p_model_size = addFloatVectorParam("model_size", "model size");
    p_model_size->setValue(36.54, 22.54, 3.20);

    p_nobjects = addInt32Param("n_objects", "make grid?");
    p_nobjects->setValue(MAX_CUBES);

    p_Q_total = addFloatParam("Q_inlet_m3_h", "total flow rate in m3/h");
    p_Q_total->setValue(320000.);

    p_v_SX9 = addFloatParam("v_SX9", "flow velocity at SX9 inlet and outlet in m/s");
    p_v_SX9->setValue(0.84);

    sprintf(path, "%s/racks.txt", coCoviseConfig::getEntry("value", "Module.Rechenraum.GeorbPath", "/data/rechenraum").c_str());
    p_BCFile = addStringParam("BCFile", "BCFile");
    p_BCFile->setValue(path);

    sprintf(path, "%s/geofile.geo", coCoviseConfig::getEntry("value", "Module.Rechenraum.GeorbPath", "/data/rechenraum").c_str());
    p_geofile = addStringParam("GeofilePath", "geofile path");
    p_geofile->setValue(path);

    sprintf(path, "%s/rbfile.geo", coCoviseConfig::getEntry("value", "Module.Rechenraum.GeorbPath", "/data/rechenraum").c_str());
    p_rbfile = addStringParam("RbfilePath", "rbfile path");
    p_rbfile->setValue(path);

    m_Geometry = paraSwitch("Geometry", "Select Rack");
    geo_labels = (char **)calloc(MAX_CUBES, sizeof(char *));

    for (i = 0; i < MAX_CUBES; i++)
    {
        // create description and name
        geo_labels[i] = IndexedParameterName(GEO_SEC, i);
        paraCase(geo_labels[i]); // Geometry section

        tmp = IndexedParameterName("pos_rack", i);
        p_cubes_pos[i] = addFloatVectorParam(tmp, tmp);
        p_cubes_pos[i]->setValue(0.0, 0.0, 0.0);

        tmp = IndexedParameterName("size_rack", i);
        p_cubes_size[i] = addFloatVectorParam(tmp, tmp);
        p_cubes_size[i]->setValue(0.0, 0.0, 0.0);
        free(tmp);

        paraEndCase(); // Geometry section
    }
    paraEndSwitch(); // "GeCross section", "Select GeCross section"

    m_FlowRate = paraSwitch("FlowRate", "Select Rack");
    flow_labels = (char **)calloc(MAX_CUBES - 1, sizeof(char *)); // racks without escalator and cold house

    float flowrate_racks[MAX_CUBES - 4] = {
        5., //  0 Infrastruktur
        5., //  1 Phoenix
        4., //  2 NAS
        3., //  3 DDN
        3., //  4 Strider
        5., //  5 Blech
        5., //  6 Sx8R
        5., //  7 IBM_BW_Grid
        5., //  8 Disk_Rack_1 (5 Stueck)
        5., //  9 Disk_Rack_2 (5 Stueck)
        5., // 10 Disk_Rack_3 (5 Stueck)
        5., // 11 Disk_Rack_4 (5 Stueck)
        5., // 12 Disk_Rack_5 (4 Stueck)
        5., // 13 Netz1
        5., // 14 Disk_Rack_6 (5 Stueck)
        5., // 15 IOX
        5., // 16 Netz2
        5., // 17 FC_Netz
        5., // 18 Asama
        5., // 19 Disk_Rack_7 (4 Stueck)
        5., // 20 SX9
        5., // 21 Neu1
        5. // 22 Neu2
    };

    for (i = 0; i < MAX_CUBES - 4; i++)
    {
        // create description and name
        flow_labels[i] = IndexedParameterName(FLOW_SEC, i);
        paraCase(flow_labels[i]);

        tmp = IndexedParameterName("flowrate_rack", i);
        p_flowrate[i] = addFloatParam(tmp, tmp);
        p_flowrate[i]->setValue(flowrate_racks[i]);

        paraEndCase(); // FlowRate section
    }

    paraEndSwitch(); // Flowrate section

#ifndef USE_STARTFILE
    setGeoParamsStandardForRechenRaum();
#endif
}
예제 #11
0
파일: ParamTest.cpp 프로젝트: nixz/covise
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// ++++
// ++++  Constructor : This will set up module port structure
/// ++++
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ParamTest::ParamTest(int argc, char *argv[])
    : coSimpleModule(argc, argv, "Param Program: Show all parameter types")
{
    //autoInitParam(0);

    // Immediate-mode String parameter
    stringImm = addStringParam("stringImm", "Immediate string");
    stringImm->setValue("This is an immediate String Parameter");

    // Immediate-mode Boolean parameter, pre-set to FALSE
    boolImm = addBooleanParam("boolImm", "Immediate coBooleanParam");
    boolImm->setValue(0);

    iScalImm = addInt32Param("iScalImm", "Immediate coIntScalarParam");
    iScalImm->setValue(123);

    fScalImm = addFloatParam("fScalImm", "Immediate coFloatParam");
    fScalImm->setValue(-12.56f);

    // integer sliders: immediate and non-immediate
    iSlidImm = addIntSliderParam("iSlidImm", "Immediate coIntSliderParam");
    iSlidImm->setValue(1, 27, 16);

    // float sliders: immediate and non-immediate
    fSlidImm = addFloatSliderParam("fSlidImm", "Immediate coFloatSliderParam");
    fSlidImm->setValue(-10.0, 30.0, 0.0);

    // float vector: use default size of 3 and set with 3D setValue function
    fVectImm = addFloatVectorParam("fVectImm", "Immediate coFloatVectorParam");
    fVectImm->setValue(1.34f, 1.889f, -99.87f);

    // it makes no sense to put a file selector in the switch, since
    // it is not displayed in the control panel
    browseImm = addFileBrowserParam("myFile", "a file browser");
    browseImm->setValue("/var/tmp/whatever.txt", "*.txt");
    browseImm->show();

    browse = addFileBrowserParam("my2File", "a file browser");
    browse->setValue("/var/tmp/whatever2.txt", "*.txt");
    browse->show();

    // Now this is a choice : we have the choice between 6 values
    const char *choiceVal[] = {
        "left lower inlet", "left upper inlet",
        "left center inlet", "right center inlet",
        "right lower Inlet", "right upper Inlet"
    };
    choImm = addChoiceParam("choImm", "Nun auch noch Choices");
    choImm->setValue(6, choiceVal, 1);

    // add an input port for 'coDoUnstructuredGrid' objects
    inPortReq = addInputPort("inputReq", "StructuredGrid", "Required input port");

    // add another input port for 'coDoUnstructuredGrid' objects
    inPortNoReq = addInputPort("inputNoReq", "UnstructuredGrid", "Not required input port");

    // tell that this port does not have to be connected
    inPortNoReq->setRequired(0);

    // add an output port for this type
    outPort = addOutputPort("outPort", "coDoUnstructuredGrid", "Output Port");

    // and that's all ... no init() or anything else ... that's done in the lib
}
예제 #12
0
void StarCD::createParam()
{
    char buf[MAXPATHLEN];
    /// ----- create all common parameter ports

    /// --- create all output ports
    createOutPorts();

    // give the file for the grid -> we'll need some more info from file 16
    // create a valid starting directory
    p_setup = addFileBrowserParam("setup", "Setup file");

    // the user may have a StarCD config dir
    const char *starconfig = getenv("STARCONFIG");
    if (starconfig)
    {
        strcpy(buf, starconfig);
        strcat(buf, "/dummy");
    }
    else
    {
        const char *covisedir = getenv("COVISEDIR");
        if (covisedir)
        {
            strcpy(buf, covisedir);
            strcat(buf, "/data/dummy");
        }
        else
            strcpy(buf, "./dummy");
    }

    p_setup->setValue(buf, "*.starconfig");

    /// the number of steps to go
    p_steps = addInt32Param("step", "Number of steps to go");
    p_steps->setValue(1);

    /// the boolean parameter decides if the simulation should re-exec
    p_freeRun = addBooleanParam("freeRun", "Execute again automagically");
    p_freeRun->setValue(0);

    /// the boolean parameter decides if the simulation should re-exec
    p_runSim = addBooleanParam("run_Simulation", "Simulation running now");
    p_runSim->setValue(0);

    /// the boolean parameter decides if the simulation should re-exec
    p_quitSim = addBooleanParam("quit_Simulation", "shut down simulation");
    p_quitSim->setValue(0);

    /// the number processors to use
    p_numProc = addInt32Param("numProc", "Number of Processors to use");
    p_numProc->setValue(4);

    /// --- create region parameter ports
    createRegionParam();

    /// --- we don't need input here: if we get anything, we set up a new case
    p_configObj = addInputPort("configObj", "Text",
                               "Configuration lines replace starconfig file");
    p_configObj->setRequired(0);

    /// --- we don't need input here: if we get anything, add it to script params
    p_commObj = addInputPort("scriptPara", "Text",
                             "Additional parameters for startup script");
    p_commObj->setRequired(0);
}