//!
//! Constructor of the TextDelimiterSourceNode class.
//!
//! \param name The name to give the new mesh node.
//! \param parameterRoot A copy of the parameter tree specific for the type of the node.
//!
TextDelimiterSourceNode::TextDelimiterSourceNode ( const QString &name, ParameterGroup *parameterRoot ) :
    VTKTableNode (name, parameterRoot, "VTKTable"),
		m_dtxt(0)
{
    // set affections and functions
    setChangeFunction("Source File", SLOT(sourceFileChanged()));
    setCommandFunction("Source File", SLOT(sourceFileChanged()));

	setChangeFunction("Field Delimiter Characters", SLOT(fieldDelimiterChanged()));
    setCommandFunction("Field Delimiter Characters", SLOT(fieldDelimiterChanged()));

	setChangeFunction("String Delimiter", SLOT(stringDelimiterChanged()));
    setCommandFunction("String Delimiter", SLOT(stringDelimiterChanged()));

	setChangeFunction("Use String Delimiter", SLOT(useStringDelimiterChanged()));
    setCommandFunction("Use String Delimiter", SLOT(useStringDelimiterChanged()));

	setChangeFunction("Have Header", SLOT(haveHeaderChanged()));
    setCommandFunction("Have Header", SLOT(haveHeaderChanged()));

	setChangeFunction("Merge Consecutive Delimiters", SLOT(mergeConsecutiveDelimitersChanged()));
    setCommandFunction("Merge Consecutive Delimiters", SLOT(mergeConsecutiveDelimitersChanged()));

	setChangeFunction("MaxRecords", SLOT(maxRecordsChanged()));
    setCommandFunction("MaxRecords", SLOT(maxRecordsChanged()));

	setChangeFunction("Detect Numeric Columns", SLOT(detectNumericColumnsChanged()));
    setCommandFunction("Detect Numeric Columns", SLOT(detectNumericColumnsChanged()));

	setTypeName("TextDelimiterSourceNode");

    INC_INSTANCE_COUNTER
}
Esempio n. 2
0
//!
//! Constructor of the XmlTreeReaderNode class.
//!
//! \param name The name for the new node.
//! \param parameterRoot A copy of the parameter tree specific for the type of the node.
//!
XmlTreeReaderNode::XmlTreeReaderNode ( const QString &name, ParameterGroup *parameterRoot ) :
    VTKTreeNode (name, parameterRoot, "VTKTree"),
		m_xmltree(0)
{
    // set affections and functions
    setChangeFunction("Source File", SLOT(sourceFileChanged()));
    setCommandFunction("Source File", SLOT(sourceFileChanged()));

	connect(this, SIGNAL(frameChanged(int)), SLOT(updateAll()));

	setTypeName("XmlTreeReaderNode");

    INC_INSTANCE_COUNTER
}
const char *LH_DataViewerConnector::userInit(){
    LH_QtInstance::userInit();
    hide();

    setup_feedback_ = new LH_Qt_QString(this, "Feedback", "", LH_FLAG_READONLY | LH_FLAG_NOSAVE | LH_FLAG_NOSINK | LH_FLAG_NOSOURCE);
    QStringList langs = listLanguages();
    qDebug() << "languages: " << langs.count() << ": " << langs.join(",");
    setup_language_ = new LH_Qt_QStringList(this,"Language",langs, LH_FLAG_AUTORENDER | LH_FLAG_NOSINK | LH_FLAG_NOSOURCE);
    setup_language_->setHelp("To add a new language copy the \"[List:<name>]\" blocks from the data map into a new file called lists.XX.txt (where XX is the language code, e.g. Spanish lists would go in a file called lists.ES.txt, French in lists.FR.txt) and translate the text values into the desired language.");
    setup_language_->setFlag(LH_FLAG_HIDDEN, langs.length()<=1);
    connect( setup_language_, SIGNAL(changed()), this, SLOT(languageFileChanged()) );

    setup_map_file_ = new LH_Qt_QFileInfo(this,"Data Map",QFileInfo(), LH_FLAG_AUTORENDER | LH_FLAG_NOSINK | LH_FLAG_NOSOURCE );
    setup_map_file_->setHelp("The data map file contains information needed to understand and parse the data source.<br><br>"
                             "(Unlike text files, XML data sources do not require a map file, although they do support them if advanced data parsing or data-expiriation is required.)");
    connect( setup_map_file_, SIGNAL(changed()), this, SLOT(mapFileChanged()) );

    setup_data_file_ = new LH_Qt_QFileInfo(this,"Data Source",QFileInfo(), LH_FLAG_AUTORENDER | LH_FLAG_NOSINK | LH_FLAG_NOSOURCE );
    setup_data_file_ ->setHelp("The data source. Only XML data sources can be understood without a data map. If the datamap specifies \"MEM\" as the type then no source file is required.");
    connect( setup_data_file_, SIGNAL(changed()), this, SLOT(sourceFileChanged()) );

    sourceWatcher_ = new QFileSystemWatcher(this);
    connect( sourceWatcher_, SIGNAL(fileChanged(const QString)), this, SLOT(sourceFileUpdated(const QString)) );

    rootNode = new dataNode();
    sharedData = new sharedCollection();

    connect( this, SIGNAL(initialized()), this, SLOT(sourceFileUpdated()) );

    return NULL;
}