File indexing completed on 2024-12-22 04:17:44

0001 /***************************************************************************
0002  *                                                                         *
0003  *   copyright : (C) 2007 The University of Toronto                        *
0004  *                   netterfield@astro.utoronto.ca                         *
0005  *                                                                         *
0006  *   This program is free software; you can redistribute it and/or modify  *
0007  *   it under the terms of the GNU General Public License as published by  *
0008  *   the Free Software Foundation; either version 2 of the License, or     *
0009  *   (at your option) any later version.                                   *
0010  *                                                                         *
0011  ***************************************************************************/
0012 
0013 #include "scalarmodel.h"
0014 
0015 #include <assert.h>
0016 #include <objectstore.h>
0017 #include <dataobject.h>
0018 #include <datavector.h>
0019 #include <generatedvector.h>
0020 #include <datamatrix.h>
0021 #include <generatedmatrix.h>
0022 #include <datasource.h>
0023 
0024 #include <QFileInfo>
0025 
0026 namespace Kst {
0027 
0028 
0029 void ScalarModel::addDataSourcesMetas(DataSourcePtr dataSource, PrimitiveTreeItem* parent) {
0030 
0031   QStringList scalars = dataSource->scalar().list();
0032   if (scalars.isEmpty()) {
0033     return;
0034   }
0035 
0036   PrimitiveTreeItem* item = addPrimitiveTreeItem(QList<QVariant>() << dataSource->descriptiveName(), parent);
0037 
0038   scalars.sort();
0039   foreach(const QString& scalar, scalars) {
0040     double value;
0041     DataScalar::ReadInfo readInfo(&value);
0042     dataSource->scalar().read(scalar, readInfo);
0043     new PrimitiveTreeItem(QList<QVariant>() << scalar << value, item);
0044   }
0045 }
0046 
0047 
0048 
0049 }
0050 
0051 // vim: ts=2 sw=2 et