DirectoryIterator::DirectoryIterator()
    : mIter(mFileList)
{
    setName("DirectoryIterator");
    setDesc(QObject::tr("Iterates through a directory and outputs all files that fit the filter"));
    setGroup("input");

    mNameOut.setName("fileName");
    mNameOut.setDesc(QObject::tr("The file name only, without the path"));
    addOutputPort(mNameOut);

    mOut.setName("filePath");
    mOut.setDesc(QObject::tr("The full file path"));

    addOutputPort(mOut);
    mFilter.setName("nameFilter");
    mFilter.setMode(OptionalPortMode);
    mFilter.setDesc(QObject::tr("File extension filter, separated by space. example: *.png *.jpg *.xpm"));
    addInputPort(mFilter);

    mIn.setName("dir");
    mIn.setDesc(QObject::tr("Directory to iterate"));
    addInputPort(mIn);

    mRepeat.setName("repeat");
    mRepeat.setDefault(false);
    mRepeat.setDesc(QObject::tr("Repeat from beginning of the list if finished"));
    mRepeat.setIcon(QImage(":/SimpleNodes/repeat.png"));
    addInputPort(mRepeat);
}
예제 #2
0
ShowFaceNormal::ShowFaceNormal(int argc, char *argv[]) // this info appears in the module setup window
    : coSimpleModule(argc, argv, "Show the normals of surfaces")
{
    port_inPort = addInputPort("inPort", "Polygons|TriangleStrips", "surface consisting of polygons or triangle strips");
    point_outport = addOutputPort("points", "Points", "startpoints for normals (typically polygon center)");
    normal_outport = addOutputPort("vectors", "Vec3", "normals of the polygon or of the first triangle in tristrip");
}
예제 #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
파일: Clock.cpp 프로젝트: zangel/uquad
 Clock::Clock()
     : Block()
     , m_OSTime("time", 0.0f)
     , m_OSDT("dT", 0.0f)
 {
     intrusive_ptr_add_ref(&m_OSTime); addOutputPort(&m_OSTime);
     intrusive_ptr_add_ref(&m_OSDT); addOutputPort(&m_OSDT);
 }
예제 #5
0
void StarCD::createOutPorts()
{
    int i;
    char buf[32], buf1[32];

    // the switch contains all output possibilities
    const char *switchName[MAX_SCALARS + 19] =

        //  1        2         3    4   5   6   7   8    9    --- Choice results
        {
          "---", "Velocity", "V-Mag", "U", "V", "W", "P", "TE", "ED",
          //  10    11  12     13      14    15                 --- Choice results
          "Tvis", "T", "Dens", "LamVis", "CP", "Conductivity",
          //  16    17     18                                   --- Choice results
          "Flux", "Void", "Volume"

        };

    for (i = 0; i < MAX_SCALARS; i++) // Scalar values in loop   --- result-19 = scalar
    {
        sprintf(buf, "Scalar %d", i + 1);
        switchName[i + 18] = strcpy(new char[strlen(buf) + 1], buf);
    }

    // mesh output port
    p_mesh = addOutputPort("mesh", "UnstructuredGrid", "Simulation grid");

    // Create one switch above the output port switches to get rid of them
    paraSwitch("output", "Show output selectors");
    paraCase("Hide output selectors");

    for (i = 0; i < NUM_OUT_DATA; i++)
    {
        // create description and name
        sprintf(buf, "Species for data port %d", i);
        sprintf(buf1, "out_%d", i);

        // the choice parameter
        p_value[i] = addChoiceParam(buf1, buf);
        p_value[i]->setValue(MAX_SCALARS + 18, switchName, 0);

        // the data port
        sprintf(buf, "data_%d", i);
        p_data[i] = addOutputPort(buf,
                                  "Float|Vec3",
                                  "Data output port");
    }
    paraEndCase();
    paraEndSwitch();

    // and the port for the residuals
    p_residual = addOutputPort("residual", "StepData|Float", "Residuals");

    // and the port for the feedback
    p_feedback = addOutputPort("feedback", "Polygons", "Feedback patches");
}
예제 #6
0
MergeAndNormals::MergeAndNormals(int argc, char *argv[])
    : coSimpleModule(argc, argv, "partial node merging and normal generation")
{
    p_inGeom_ = addInputPort("InGeometry", "coDoPolygons|coDoLines", "input geometry");
    p_inNormals_ = addInputPort("InNormals", "coDoVec3", "input normals");
    p_inNormals_->setRequired(0);
    p_text_ = addInputPort("Text", "coDoText", "where to merge");
    p_outGeom_ = addOutputPort("OutGeometry", "coDoPolygons|coDoLines", "output geometry");
    p_Normals_ = addOutputPort("OutNormals", "coDoVec3|DO_Unstructured_V3D_Normals", "output normals");
}
예제 #7
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.);
}
예제 #8
0
/*******************************************************************
* Function Name: Demux
* Description: constructor
********************************************************************/
Dispatcher::Dispatcher( const string &name )
: Atomic( name )
, msg_in( addInputPort( "msg_in" ) )
, peer_id( addOutputPort( "peer_id" ) )
, query_id( addOutputPort( "query_id" ) )

{
	//initialising these values... not indispensable but always safer
	id_counter=0;
	nextOutput_p= 0;
	nextOutput_q=0;

}
예제 #9
0
파일: Gen3D.cpp 프로젝트: dwickeroth/covise
Gen3D::Gen3D()
:coModule("Make a 3D grid out of a 2")
{
   p_inPoly = addInputPort("2D_Grid","Polygons","2D grid polygons");
   p_inVelo = addInputPort("velocity","Vec3","velocity");
   p_inPoly->setRequired(1);
   p_inVelo->setRequired(0);
   p_outGrid = addOutputPort("outGrid","UnstructuredGrid","unstructured Grid");
                                                  // 0 is as many as velocities set
   p_outVelo = addOutputPort("outVelo","Vec3","velocity");
   p_thick = addFloatParam("thick","thickness of 3D-grid");
   p_thick->setValue(0.05);
};
예제 #10
0
ReadStarDrop::ReadStarDrop(int argc, char *argv[])
    : coModule(argc, argv, "Star Droplet file reader")
{
#ifdef VERBOSE
    debug = fopen("DEBUG", "w");
#endif

    // the LoopThrough data
    p_grid_out = addOutputPort("grid_out", "UnstructuredGrid", "multiplexed grid");
    p_grid_in = addInputPort("grid_in", "UnstructuredGrid", "grid set with REALTIME attribute");

    int i;
    char buf[16];
    for (i = 0; i < NUM_DATA_PORTS; i++)
    {
        sprintf(buf, "dataOut_%d", i);
        p_dataOut[i] = addOutputPort(buf, "Vec3|Float|Polygons|Lines|IntArr|Geometry", "data set to multiplex");
        sprintf(buf, "dataIn_%d", i);
        p_dataIn[i] = addInputPort(buf, "Vec3|Float|Polygons|Lines|IntArr|Geometry", "data set to multiplex");
        p_dataIn[i]->setRequired(0);
        p_dataOut[i]->setDependencyPort(p_dataIn[i]);
    }

    // the output ports
    p_dropOut[LOCA] = addOutputPort("location", "Points", "Droplet Location");
    p_dropOut[VELO] = addOutputPort("velocity", "Vec3", "Droplet velocity");
    p_dropOut[TEMP] = addOutputPort("temp", "Float", "Droplet Temperature");
    p_dropOut[DIAM] = addOutputPort("diameter", "Float", "Droplet Diameter");
    p_dropOut[MASS] = addOutputPort("mass", "Float", "Droplet Mass");
    p_dropOut[COUN] = addOutputPort("count", "Float", "Droplet Count");

    // hand out the mapping for additional loop-thru multiplier modules
    p_mapping = addOutputPort("mapping", "IntArr", "Grid multiplication mapping");

    // select the Droplet file name with a file browser
    p_filename = addFileBrowserParam("filename", "Droplet File");
    p_filename->setValue("data/track.trk", "*.trk;*.33");

    // how often to multiply the input data
    p_maxDrops = addInt32Param("maxPart", "Max. no. of Particles to show, 0=all");
    p_maxDrops->setValue(0);

    // how often to multiply the input data
    p_numSteps = addInt32Param("numSteps", "Number of steps to use, 0=auto");
    p_numSteps->setValue(0);

    // whether to do artificial termination or not
    p_stickHandling = addChoiceParam("stickHandling", "How to handle sticked droplets");
    static const char *labels[] = { "No stuck Droplets", "Both", "Only stuck" };
    p_stickHandling->setValue(3, labels, 0);

    // init local data
    d_lastFileName = NULL;
    d_dropArr = NULL;
    d_numDrops = 0;
}
예제 #11
0
/*******************************************************************
* Function Name: Gnutella
* Description: constructor
********************************************************************/
Gnutella::Gnutella( const string &name )
: Atomic( name )
, route_in( addInputPort( "route_in" ) )
, route_out( addOutputPort( "route_out" ) )
, in_n( addInputPort( "in_n" ) )
, out_n( addOutputPort( "out_n" ) )

{
	//initialising these values... not indispensable but always useful
	routing = false;
	hitting = false;
	nextOutputDB = 0.0f;
	nextOutputR= 0.0f;
}
예제 #12
0
SimpleCameraInput::SimpleCameraInput()
{
    setName("Webcam");
    setDesc(QObject::tr("Reads a the default webcam with the default setup"));
    setGroup("input");

    mOut.setName("imageOut");
    mOut.setDesc(QObject::tr("Image output"));
    addOutputPort(mOut);

    mFps.setName("fps");
    mFps.setDesc(QObject::tr("Camera fps. Must be connected to a minimum fps core to avoid sending the same image multiple times"));
    addOutputPort(mFps);
}
예제 #13
0
파일: ReadN3s_alt.cpp 프로젝트: nixz/covise
ReadN3s::ReadN3s(int argc, char *argv[])
{
    char buf[255], buf1[255];
    char buf2[255];
    int i;
    char *geo_data_path;
    char *res_data_path;
    set_module_description("Generic ASCII-File Reader for N3S 3.2");

    // the output port
    unsgridPort = addOutputPort("mesh", "coDoUnstructuredGrid", "geometry ");

    for (i = 0; i < MAX_PORTS_N3S; i++)
    {
        sprintf(buf, "dataport%d", i + 1);
        dataPort[i] = addOutputPort(buf, "coDoVec3 | coDoFloat | DO_Unstructured_V2D_Data | coDoVec2", buf);
    }
    // select the OBJ file name with a file browser
    geoFileParam = addFileBrowserParam("n3s geofile", "N3S geofile");
    resFileParam = addFileBrowserParam("n3s result file", "N3S result file");
    char *cov_path = getenv("COVISEDIR");
    geo_data_path = new char[255];
    res_data_path = new char[255];
    if (cov_path)
    {
        sprintf(geo_data_path, "%s/data/n3s/* ", cov_path);
        sprintf(res_data_path, "%s/data/n3s/* ", cov_path);
    }
    else
    {
        sprintf(geo_data_path, "./* ");
        sprintf(res_data_path, "./* ");
    }
    cerr << "buf: " << geo_data_path << endl;
    geoFileParam->setValue(geo_data_path, "geom");
    resFileParam->setValue(res_data_path, "post.res");
    //    resFileParam->setValue("post.res result", buf);

    return;

    choice_of_data[0] = new char[10]; // die gibt's immer
    strcpy(choice_of_data[0], "(none)\n");
    for (i = 0; i < MAX_PORTS_N3S; i++)
    {
        sprintf(buf1, "data%d", i);
        sprintf(buf2, "select data%d", i);
        choiceData[i] = addChoiceParam(buf1, buf2);
        choiceData[i]->setValue(1, choice_of_data, 1);
    }
}
예제 #14
0
ModifyAddPart::ModifyAddPart()
{
    int i;

    // no. of attached vents to cabin
    numVents = 0;

    // no. of read directories for vent description
    // default nothing
    numVentDirs = 1;

    for (i = 0; i < MAX_NAMES; i++)
        ventdirs[i] = NULL;

    // init some defaults
    for (i = 0; i < MAX_VENTS; i++)
    {
        fileid[i] = 0;
        exist[i] = 0;
    }

    // declare the name of our module
    set_module_description("Add parts to the Cabin");

    // paramter for vent directory structure
    p_ventDir = addStringParam("ventPath", "Path for vent descriptions");
    p_ventDir->setValue("data/visit/icem/test");
    ventFilePath = "data/visit/icem/test";

    // get the directory structure for all vents in given path
    getVentDirs();

    // create the COVISE parameter
    // user can set a subdirectory for vents
    createVentParam();

    // what do you want to calculate
    p_action = addChoiceParam("Set Action", "select the action");
    p_action->setValue(nAction, action, currAction);

    // tetin object describing the cabin
    inTetin = addInputPort("tetinObj", "DO_Tetin", "coTetin object");
    inTetin->setRequired(1);

    // output objects for transfer directory and vent polygons
    solverText = addOutputPort("solverText", "coDoText", "Command for StarCD");
    outPolygon = addOutputPort("polygon_set", "coDoPolygons", "Geometry output");
    prostarData = addOutputPort("prostarData", "coDoText", "Part data for Prostar");
}
예제 #15
0
파일: ReadGromacs.cpp 프로젝트: nixz/covise
ReadGromacs::ReadGromacs(int argc, char *argv[])
    : coModule(argc, argv, "Gromacs File Reader")
{
    // Output- Ports
    pointsOutput = addOutputPort("outPort", "Points", "Points output");
    elementout = addOutputPort("outP", "Int", "Ordnungszahl output");
    // pointsAnimationOutput = addOutputPort("outAnimation","Points","Animationoutput");

    // Parameters
    groFileParam = addFileBrowserParam("grofile", "Gromacs sturcture file");
    groFileParam->setValue("data/gromacs", "*.gro");

    // xtcFileParam=addFileBrowserParam("xtcfile","Gromacs tractory file");
    // xtcFileParam->setValue("data/gromacs","*.xtc");
}
예제 #16
0
파일: Cube.cpp 프로젝트: nixz/covise
Cube::Cube(int argc, char *argv[]) // vvvv --- this info appears in the module setup window
    : coModule(argc, argv, "Simple Cube Generation Module")
{
    // output port
    // parameters:
    //   port name
    //   string to indicate connections, convention: name of the data type
    //   description
    p_polyOut = addOutputPort("polygons", "Polygons", "polygons which form the cubes");

    // input parameters
    // parameters:
    //   parameter name
    //   parameter type
    //   description
    p_center = addFloatVectorParam("center", "Center of the cube");
    cx = cy = cz = 0.0;
    p_center->setValue(cx, cy, cz);

    p_cusize = addFloatSliderParam("size", "Size of the cube");
    sMin = 1.0;
    sMax = 100.0;
    sVal = 10.0;
    p_cusize->setValue(sMin, sMax, sVal);
}
예제 #17
0
파일: JKTrigger.cpp 프로젝트: mhyhre/SEELIB
JKTrigger::JKTrigger(QString name, QWidget *parent) : UmElement(name, parent)
{
    this->setGeometry(this->x(),this->y(), 80 , 110);

    label = new QLabel(this);
    label->setText(name);
    label->setAlignment(Qt::AlignCenter);
    label->setGeometry(2, 2, this->width()-4, 16);

    addInputPort("J");
    addInputPort("CLK");
    addInputPort("K");

    addOutputPort("Q", false);
    addOutputPort("!Q", true);
}
예제 #18
0
BrighnessContrast::BrighnessContrast()
{
    setName("BrightnessContrast");
    setDesc(QObject::tr("Adjusts brightness and contrast"));
    setGroup("image/color");

    mIn.setName("imageIn");
    mIn.setDesc(QObject::tr("Image input"));
    addInputPort(mIn);

    mOut.setName("imageOut");
    mOut.setDesc(QObject::tr("Image output"));
    addOutputPort(mOut);

    mBrighness.setName("brightnessFactor");
    mBrighness.setDesc(QObject::tr("Adjust the brightness"));
    mBrighness.setDefault(0);
    mBrighness.setRange(-100, 100);
    addInputPort(mBrighness);

    mContrast.setName("contrastFactor");
    mContrast.setDesc(QObject::tr("Adjust the contrast"));
    mContrast.setDefault(0);
    mContrast.setRange(-100, 100);
    addInputPort(mContrast);
}
예제 #19
0
/*******************************************************************
* Function Name: Demux
* Description: constructor
********************************************************************/
Server::Server( const string &name )
: Atomic( name )
, query_in( addInputPort( "query_in" ) )
, peer_in( addInputPort( "peer_in" ) )
//, publish( addInputPort( "publish"))
, queryhit( addOutputPort( "queryhit" ) )


{
	//initialising these values... not indispensable but always safer


	serverdoc = new SGraph();
	datadoc = new SGraph();

	string datafile = MainSimulator::Instance().getParameter( description(), "datafile" );

	ifstream fis;
	fis.open(datafile.c_str()); // open stream to file


	serverdoc->read(fis); //reading serverdoc from file!
	fis.close();


	if(VERBOSE) {
		cout<<"data file read"<<endl;
		//querydoc->write(cout);
	}





}
예제 #20
0
Threshold::Threshold()
{
    setName("Threshold");
    setDesc(QObject::tr("Thresholds an image"));
    setGroup("image/color");

    mOut.setName("imageOut");
    mOut.setDesc(QObject::tr("Image output"));
    addOutputPort(mOut);

    mIn.setName("imageIn");
    mIn.setDesc(QObject::tr("Image input"));
    addInputPort(mIn);

    mThreshold.setName("threshold");
    mThreshold.setDesc(QObject::tr("Threshold value"));
    mThreshold.setDefault(128);
    mThreshold.setRange(0, 255);
    addInputPort(mThreshold);

    mMode.setName("mode");
    mMode.setDesc(QObject::tr("Thresholding mode"));
    mMode.addChoice(cv::THRESH_BINARY, tr("Binary (value = value > threshold ? max_value : 0 )"));
    mMode.addChoice(cv::THRESH_BINARY_INV, tr("Binary inverted (value = value > threshold ? 0 : max_value)"));
    mMode.addChoice(cv::THRESH_TOZERO, tr("To zero (value = value > threshold ? value : 0)"));
    mMode.addChoice(cv::THRESH_TOZERO_INV, tr("To zero inverted (value = value > threshold ? 0 : value)"));
    mMode.addChoice(cv::THRESH_TRUNC, tr("Truncate (value = value > threshold ? threshold : value)"));
    mMode.addChoice(cv::THRESH_OTSU, tr("Otsu’s Algorithm (threshold automatically determined)"));
    mMode.addChoice(cv::THRESH_OTSU+1, tr("Otsu’s Algorithm inverted (threshold automatically determined)"));
    mMode.addChoice(cv::THRESH_TRIANGLE, tr("Triangle algorithm (threshold automatically determined)"));
    mMode.addChoice(cv::THRESH_TRIANGLE+1, tr("Triangle algorithm inverted (threshold automatically determined)"));
    mMode.setDefault(cv::THRESH_BINARY);
    addInputPort(mMode);
}
예제 #21
0
파일: PlaneBorder.cpp 프로젝트: nixz/covise
PlaneBorder::PlaneBorder()
    : coModule("cut something out of an object")
{
    // ports
    p_geo_in = addInputPort("geo_in", "Set_Polygons|Set_TriangleStrips", "geometry");
    p_geo_out = addOutputPort("geo_out", "Set_Points", "geometry");
}
예제 #22
0
파일: Summator.cpp 프로젝트: mhyhre/SEELIB
Summator::Summator(QString name, QWidget *parent) : UmElement(name, parent)
{
    this->setGeometry(this->x(),this->y(), 80 , 110);

    label = new QLabel(this);
    label->setText(name);
    label->setAlignment(Qt::AlignCenter);
    label->setGeometry(2, 2, this->width()-4, 16);

    addInputPort("A");
    addInputPort("B");
    addInputPort("P");

    addOutputPort("S", false);
    addOutputPort("P+", true);
}
예제 #23
0
const vpz::AtomicModel*
Executive::createModel(const std::string& name,
                       const std::vector<std::string>& inputs,
                       const std::vector<std::string>& outputs,
                       const std::string& dynamics,
                       const std::vector<std::string>& conds,
                       const std::string& observable,
                       bool debug)
{
    auto model = new vpz::AtomicModel(name, cpled());
    if (debug) {
        model->setDebug();
    }
    std::vector<std::string>::const_iterator it;

    for (it = inputs.begin(); it != inputs.end(); ++it) {
        model->addInputPort(*it);
    }

    for (it = outputs.begin(); it != outputs.end(); ++it) {
        model->addOutputPort(*it);
    }

    m_coordinator.createModel(
      model, conditions(), dynamics, conds, observable);

    return model;
}
예제 #24
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);
}
예제 #25
0
CorrectPyramids::CorrectPyramids()
    : coSimpleModule("Correct pyramids")
{
    _p_in_grid = addInputPort("meshIn", "coDoUnstructuredGrid", "input mesh");
    _p_out_grid = addOutputPort("meshOut", "coDoUnstructuredGrid", "output mesh");
    _p_volume = addFloatParam("relative_volume", "relative volume");
    _p_volume->setValue(0.05);
}
예제 #26
0
/// Constructor
RandomNormals::RandomNormals(int argc, char *argv[])
    : coSimpleModule(argc, argv, "Generate random normals for input grid")
{

    // Create ports:
    piGrid = addInputPort("GridIn0", "UniformGrid|RectilinearGrid|StructuredGrid|UnstructuredGrid|Polygons|Points", "grid or points");
    poData = addOutputPort("DataOut0", "Vec3", "data");
}
예제 #27
0
/*******************************************************************
* Function Name: LTSNetwork
* Description: constructor
********************************************************************/
LTSNetwork::LTSNetwork( const string &name )
: Atomic( name )
, peer_online( addInputPort( "peer_online" ) )
, peer_offline( addInputPort( "peer_offline" ) )
, peer_connect( addInputPort( "peer_connect" ) )
, peer_disconnect( addInputPort( "peer_disconnect" ) )
, inroute( addInputPort( "inroute" ) )
, route_out( addOutputPort( "route_out" ) )
, out_connect( addOutputPort( "out_connect" ) )
, out_disconnect( addOutputPort( "out_disconnect" ) )

{
	//create a new Graph. Nothing else... ?
	thegraph= new GraphInt();


}
예제 #28
0
/*******************************************************************
* Function Name: Transducer2
* Description: Constructor
********************************************************************/
Transducer2::Transducer2( const string &name )
	: Atomic( name ) 
	, arrived( addInputPort( "arrived" ) )
	, solved( addInputPort( "solved" ) )
	, throughput( addOutputPort( "throughput" ) )
	, cpuUsage( addOutputPort( "cpuusage" ) )
	, responsetime(addOutputPort( "responsetime"))
{
	frec = "0:1:0:0" ;
	tUnit = "0:1:0:0" ;

	if( ParallelMainSimulator::Instance().existsParameter( description(), "frecuence" ) )
		frec = ParallelMainSimulator::Instance().getParameter( description(), "frecuence" ) ;

	if( ParallelMainSimulator::Instance().existsParameter( description(), "timeUnit" ) )
		tUnit = ParallelMainSimulator::Instance().getParameter( description(), "timeUnit" ) ;
}
예제 #29
0
Constant::Constant()
:FUDescription(TYPE){
	addOutputPort(OUT, 32);
	addParameter(PARAM, 32);
    Function* function = new Function(Constant::FUNC_NAME,0);
	addFUFunction(function);
	function->addFunctionArg(PARAM);
}
예제 #30
0
파일: Timer.cpp 프로젝트: ylliac/qcircuit
Timer::Timer()
: timer(NULL)
{
    setObjectName(metaObject()->className());
    
    addOutputPort("TIME");
    setSelfStarting(true);
}