Esempio n. 1
0
//===============================================================//
QStringList cdfDataReader::getZVariableList()
{
    QStringList returnVal;

    CDFstatus status;
    long numVars;

    //get the number of variables
    status = CDFgetNumzVars(this->fileId, &numVars);

    if(this->CDFstatusOK(status))
    {
        for(int x = 0; x < numVars; x++)
        {
            char text[CDF_VAR_NAME_LEN256 + 1];
            status = CDFgetzVarName(this->fileId, x, text);
            //make sure we actual got a name
            if(this->CDFstatusOK(status))
            {
                //add the name to the list
                returnVal.push_back(QString(text));
            }
        }
    }

    return returnVal;
}
Esempio n. 2
0
	/**
	 * Helper method to initialize a variable names map. This solves some issues with
	 * threaded operations on CDF files.
	 */
	void CDFFileReader::initializeVariableNames()
	{
		int numVariables = this->getNumberOfVariables();
		//cout << "numVariables: " << numVariables << endl;
		char variableName[512];
		for (int i = 0; i < numVariables; i++)
		{
			CDFgetzVarName(current_file_id, i, variableName);
			std::string variableNameString = variableName;
			variableNames[(long)i] = variableNameString;

		}
	}