nameList* tellstdfunc::stdSIN::callingConv(const telldata::typeMAP*)
{
   nameList* argtypes = DEBUG_NEW nameList();
   argtypes->push_back("real");
   argtypes->push_back("real");
   return argtypes;
}
void
CBSearchTextDialog::SearchFiles()
	const
{
	JString searchStr, replaceStr;
	JBoolean searchIsRegex, caseSensitive, entireWord, wrapSearch;
	JBoolean replaceIsRegex, preserveCase;
	JRegex* regex;

	JPtrArray<JString> fileList(JPtrArrayT::kDeleteAll),
					   nameList(JPtrArrayT::kDeleteAll);

	if (GetSearchParameters(
			&searchStr, &searchIsRegex, &caseSensitive, &entireWord, &wrapSearch,
			&replaceStr, &replaceIsRegex, &preserveCase,
			&regex) &&
		BuildSearchFileList(&fileList, &nameList))
		{
		const JError err =
			CBSearchDocument::Create(fileList, nameList,
									 searchStr, itsOnlyListFilesFlag,
									 itsListFilesWithoutMatchFlag);
		err.ReportIfError();
		}
}
nameList* tellstdfunc::lstLENGTH::callingConv(const telldata::typeMAP*)
{
   nameList* argtypes = DEBUG_NEW nameList();
   argtypes->push_back("int");
   argtypes->push_back("<...anything...> list");
   return argtypes;
}
Exemple #4
0
bool RemoveButtonsFromGroupCommand::init(const ButtonList &bl)
{
    if (bl.empty())
        return false;
    QButtonGroup *group = bl.front()->group();
    if (!group)
        return false;
    if (bl.size() >= group->buttons().size())
        return false;
    initialize(bl, group);
    //: Command description for removing buttons from a QButtonGroup
    setText(QApplication::translate("Command", "Remove '%1' from '%2'").arg(nameList(bl), group->objectName()));
    return true;
}
Exemple #5
0
void AddButtonsToGroupCommand::init(const ButtonList &bl, QButtonGroup *group)
{
    initialize(bl, group);
    //: Command description for adding buttons to a QButtonGroup
    setText(QApplication::translate("Command", "Add '%1' to '%2'").arg(nameList(bl), group->objectName()));
}
void 
JobTransforms::initAndReconfig()
{
	int rval;

	// Setup xform_utils hashtable, and record a ckpt
	mset.clear();
	mset.init();
	mset_ckpt = mset.save_state();

	// Clear out any previously configured transforms.
	clear_transforms_list();

	// Now setup our transforms_list from info in the config file.
	std::string jobtransNames;
	if( !param( jobtransNames, "JOB_TRANSFORM_NAMES" ) ) {
		// No job transforms requested in the config, no more work to do
		return;
	}
	StringList nameList( jobtransNames.c_str() );
	nameList.rewind();
	const char * name = NULL;
	MacroStreamXFormSource *xfm = NULL;
	while( (name = nameList.next()) != NULL ) {

		if( strcasecmp( name, "NAMES" ) == 0 ) { continue; }  // prevent recursion!
		std::string attributeName;
		formatstr( attributeName, "JOB_TRANSFORM_%s", name );

		// fetch unexpanded param, we will only expand it now for the old (classad) style transforms.
		// this pointer does not need to be freed.
		const char * raw_transform_text = param_unexpanded( attributeName.c_str() );
		if( !raw_transform_text ) {
			dprintf( D_ALWAYS, "JOB_TRANSFORM_%s not defined, ignoring.\n", name );
			continue;
		}
		// skip leading whitespace (I think the param code does this, but...)
		while (isspace(*raw_transform_text)) { ++raw_transform_text; }
		if ( !raw_transform_text[0] ) {
			dprintf( D_ALWAYS, "JOB_TRANSFORM_%s definition is empty, ignoring.\n", name );
			continue;
		}

		// Create a fresh new xfm object, since not sure if the state of
		// this object is clean if errors were encountered instantiating a 
		// previous transform rule.
		if (xfm) delete xfm;
		xfm = new MacroStreamXFormSource(NULL);
		ASSERT(xfm);

		// Set the name of this xfm based on the config knob name
		xfm->setName( name );

		// Load transform rule from the config param into the xfm object.  If
		// the config param starts with a '[' (after trimming out leading whitespace above)
		// then assume the rule is in the form of a new classad.
		if ( raw_transform_text[0] == '[' ) {
			// Fetch transform with macro expansion
			std::string transform;
			param( transform, attributeName.c_str() );

			// Transform rule is in the form of a job_router style ClassAd, so
			// call the helper XFormLoadFromJobRouterRoute() to convert it.
			std::string empty;
			int offset=0;
			classad::ClassAdParser parser;
			ClassAd transformAd;
			rval = 0;
			if ( (!parser.ParseClassAd(transform, transformAd, offset)) ||
				 ((rval=XFormLoadFromJobRouterRoute(*xfm,empty,offset,transformAd,0)) < 0) )
			{
				dprintf( D_ALWAYS, "JOB_TRANSFORM_%s classad malformed, ignoring. (err=%d)\n",
					name, rval );
				continue;
			}
		} else {
			// Transform rule is in the native xform macro stream style, so load it
			// in that way without macro expanding at this time.
			const MACRO_SOURCE ArgumentMacro = { true, false, 2, -2, -1, -2 };
			StringList statements( raw_transform_text, "\n\r" );
			std::string errmsg = "";
			if ( (rval=xfm->open(statements, ArgumentMacro, errmsg)) < 0 ) {
				dprintf( D_ALWAYS, "JOB_TRANSFORM_%s macro stream malformed, ignoring. (err=%d) %s\n",
					name, rval, errmsg.c_str() );
				continue;
			}
		}

		// Perform a smoke test of the transform rule in an attempt to weed out
		// broken transform rules at reconfig time, so that we don't attempt to 
		// apply a broken rule over and over on each job submit.  
		// TODO

		// Finally, append the xfm to the end our list (order is important here!)
		transforms_list.Append(xfm);
		std::string xfm_text;
		dprintf(D_ALWAYS, 
			"JOB_TRANSFORM_%s setup as transform rule #%d :\n%s\n",
			name, transforms_list.Number(), xfm->getFormattedText(xfm_text, "\t") );
		xfm = NULL;  // we handed the xfm pointer off to our list

	} // end of while loop thru job transform names	
	if (xfm) delete xfm; 
}
nameList* tellstdfunc::stdECHO::callingConv(const telldata::typeMAP*) {
   nameList* argtypes = DEBUG_NEW nameList();
   argtypes->push_back("void");
   argtypes->push_back("<...anything...>");
   return argtypes;
}
void vtkDataMeshInteractor::setupParameters()
{
    d->parameters << this->opacityParameter();

    if(!(d->metaDataSet->GetType() != vtkMetaDataSet::VTK_META_SURFACE_MESH &&
         d->metaDataSet->GetType() != vtkMetaDataSet::VTK_META_VOLUME_MESH))
    {
        d->LUTParam = new medStringListParameter("LUT", this);
        d->LUTParam->addItem("Default");
        // TODO some LUT are missing for some attribute - RDE
        connect(d->LUTParam, SIGNAL(valueChanged(QString)), this, SLOT(setLut(QString)));
        d->LUTParam->setValue("Default");
        d->parameters << d->LUTParam;

        d->attributesParam = new medStringListParameter("Attributes", this);
        QStringList nameList("Default");

        for (int i = 0; i < d->metaDataSet->GetDataSet()->GetPointData()->GetNumberOfArrays(); i++)
            nameList << QString::fromUtf8(d->metaDataSet->GetDataSet()->GetPointData()->GetArrayName(i));

        for (int i = 0;  i < d->metaDataSet->GetDataSet()->GetCellData()->GetNumberOfArrays(); i++)
            nameList << QString::fromUtf8(d->metaDataSet->GetDataSet()->GetCellData()->GetArrayName(i));

        for (int i = 0;  i < d->metaDataSet->GetDataSet()->GetFieldData()->GetNumberOfArrays(); i++)
            nameList << QString::fromUtf8(d->metaDataSet->GetDataSet()->GetFieldData()->GetArrayName(i));

        foreach(QString name, nameList)
            d->attributesParam->addItem(name);

        connect(d->attributesParam, SIGNAL(valueChanged(QString)), this, SLOT(setAttribute(QString)));
        d->attributesParam->setValue("Default");
        d->parameters << d->attributesParam;
    }

    d->edgeVisibleParam = new medBoolParameter("Edge Visible", this);
    connect(d->edgeVisibleParam, SIGNAL(valueChanged(bool)), this, SLOT(setEdgeVisibility(bool)));
    d->edgeVisibleParam->setValue(false);
    d->parameters << d->edgeVisibleParam;

    d->colorParam = new medStringListParameter("Color", this);
    QStringList colors;

    colors << "#FFFFFF";
    colors << "#808080";
    colors << "#800000";
    colors << "#804040";
    colors << "#FF8080";
    colors << "#FF0000";
    colors << "#FFFF80";
    colors << "#FFFF00";
    colors << "#FF8040";
    colors << "#FF8000";
    colors << "#80FF80";
    colors << "#80FF00";
    colors << "#00FF00";
    colors << "#80FFFF";
    colors << "#00FFFF";
    colors << "#004080";
    colors << "#0000FF";
    colors << "#0080FF";
    colors << "#0080C0";

    foreach(QString color, colors)
        d->colorParam->addItem(color, medStringListParameter::createIconFromColor(color));

    connect(d->colorParam, SIGNAL(valueChanged(QString)), this, SLOT(setColor(QString)));
    d->colorParam->setValue("#FFFFFF");
    d->parameters << d->colorParam;

    d->renderingParam = new medStringListParameter("Rendering", this);
    d->renderingParam->addItem("WireFrame");
    d->renderingParam->addItem("Surface");
    d->renderingParam->addItem("Points");
    connect(d->renderingParam, SIGNAL(valueChanged(QString)), this, SLOT(setRenderingType(QString)));
    d->renderingParam->setValue("Surface");
    d->parameters << d->renderingParam;

    d->slicingParameter = new medIntParameter("Slicing", this);
    connect(d->slicingParameter, SIGNAL(valueChanged(int)), this, SLOT(moveToSlice(int)));
    connect(d->view->positionBeingViewedParameter(), SIGNAL(valueChanged(QVector3D)), this, SLOT(updateSlicingParam()));

    d->parameters << this->visibiltyParameter();

    this->updateWidgets();
}