[Kst] Re: My idea of 2.0.3

Peter Kümmel syntheticpp at gmx.net
Wed Jan 19 19:36:18 CET 2011


On 19.01.2011 18:19, Brisset, Nicolas wrote:
>> "make -j4" ;)
> Yes, I always do that. But I have the feeling that plugins are done in
> sequence nonetheless...

To test you could measure the time:

time make -j1/j4

>
>> Maybe it is possible to make one shared library for all plugins.
>> I don't know if Qt's register code could manage this. This
>> would be a nice feature, but I think, I've invested enough time
>> for cmake the last days.
> Yes, cmake does not matter much to the end-user:-)
>
> So, I tested with the file at
> http://www.unidata.ucar.edu/software/netcdf/examples/GOTEX.C130_N130AR.L
> RT.RF06.PNI.nc
>
> It's close, but not quite: there are strings in the scalars view, and
> scalars in the strings view!
> Note: you can use ncdump -h [file.cdf] to get a list of metadata. You
> have them under each var name for the vars, and file-global attributes
> at the very end. In the end, string data should all be in the view
> strings dialog and scalar data in the view scalar dialog.

OK, attached a patch which shows the relevant function, it parses the complete
object list for items to add. With the patch it is better, but I assume the String
not part of a datasource will show up. We have to check better at this place.
Below the old code, now the logig is inverted.

Peter



void ScalarModel::createTree() {
   QMap<QString, ObjectPtr> objectMap;
   foreach(DataVector* vector, _store->getObjects<DataVector>()) {
     objectMap.insert(vector->Name(), vector);
   }
   foreach(GeneratedVector* vector, _store->getObjects<GeneratedVector>()) {
     objectMap.insert(vector->Name(), vector);
   }
   foreach(DataMatrix* matrix, _store->getObjects<DataMatrix>()) {
     objectMap.insert(matrix->Name(), matrix);
   }
   foreach(GeneratedMatrix* matrix, _store->getObjects<GeneratedMatrix>()) {
     objectMap.insert(matrix->Name(), matrix);
   }
   foreach(DataObjectPtr dataObject, _store->getObjects<DataObject>()) {
     objectMap.insert(dataObject->Name(), dataObject);
   }
   foreach(Scalar* scalar, _store->getObjects<Scalar>()) {
     if (scalar->orphan()) {
       objectMap.insert(scalar->Name(), scalar);
     }
   }
   foreach(DataSource* ds, _store->dataSourceList()) {
     if (!ds->scalar().list().isEmpty()) {
       objectMap.insert(ds->shortName(), ds);
     }
   }

   QMapIterator<QString, ObjectPtr> iObject(objectMap);
   while (iObject.hasNext()) {
     iObject.next();
     if (VectorPtr vector = kst_cast<Vector>(iObject.value())) {
       addVector(vector);
     } else if (MatrixPtr matrix = kst_cast<Matrix>(iObject.value())) {
       addMatrix(matrix);
     } else if (DataObjectPtr dataObject = kst_cast<DataObject>(iObject.value())) {
       addDataObject(dataObject);
     } else if (ScalarPtr scalar = kst_cast<Scalar>(iObject.value())) {
       addScalar(scalar);
     } else if (DataSourcePtr dataSource = kst_cast<DataSource>(iObject.value())) {
       addDataSource(dataSource);
     }
   }
}




-------------- next part --------------
A non-text attachment was scrubbed...
Name: view_string.patch
Type: text/x-patch
Size: 1078 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kst/attachments/20110119/8695836d/attachment-0001.patch 


More information about the Kst mailing list