[Kst] kdeextragear-2/kst/kst/datasources (silent)

George Staikos staikos at kde.org
Wed Dec 8 05:46:16 CET 2004


CVS commit by staikos: 

CVS_SILENT ignores


  M +2 -0      ascii/.cvsignore   1.3
  M +2 -0      cdf/.cvsignore   1.2
  M +13 -16    cdf/cdf.cpp   1.14
  M +2 -0      dirfile/.cvsignore   1.2
  M +2 -0      frame/.cvsignore   1.2
  M +2 -0      indirect/.cvsignore   1.2
  M +2 -0      lfiio/.cvsignore   1.2
  M +2 -0      planck/.cvsignore   1.2


--- kdeextragear-2/kst/kst/datasources/ascii/.cvsignore  #1.2:1.3
@@ -3,2 +3,4 @@
 asciiconfig.h
 asciiconfig.cpp
+*.bb
+*.bbg

--- kdeextragear-2/kst/kst/datasources/cdf/.cvsignore  #1.1:1.2
@@ -1,2 +1,4 @@
 Makefile.in
 Makefile
+*.bb
+*.bbg

--- kdeextragear-2/kst/kst/datasources/cdf/cdf.cpp  #1.13:1.14
@@ -16,7 +16,7 @@
  ***************************************************************************/
 
-#include "cdf_source.h" // Local header for the kst CDF datasource
-#include <cdf.h>
-#include "cdfdefs.h" // Macros to handle rVars and zVars transparently
+#include "cdf.h" // Local header for the kst CDF datasource
+#include <cdf.h> // Main CDF header (not sure it is a good idea for it to have the same name as the local one, but that one should not be changed as it's the official CDF distribution !)
+#include <cdfdist.h> // Macros to handle rVars and zVars transparently
 
 #include <kdebug.h>
@@ -28,6 +28,6 @@
 #include <stdlib.h>
 
-CdfSource::CdfSource(KConfig *cfg, const QString& filename, const QString& type)
-: KstDataSource(cfg, filename, type) {
+CdfSource::CdfSource(const QString& filename, const QString& type)
+  : KstDataSource(filename, type) {
     if (!type.isEmpty() && type != "CDF") {
       return;
@@ -127,4 +127,5 @@ int CdfSource::readField(double *v, cons
   CDFstatus status;
   CDFid id;
+  double time_conversion = 1.0;
   long dataType;          /* CDF data type */
   long maxRec;            /* max number of values for this var */
@@ -136,9 +137,5 @@ int CdfSource::readField(double *v, cons
   // Handle the special case where we query INDEX
   if (field.lower() == "index") {
-    if (n < 0) {
-      v[0] = double(s);
-      return 1;
-    }
-    for (int i = 0; i < n; ++i) {
+    for (i = 0; i < n; i++) {
       v[i] = double(s + i);
     }
@@ -156,4 +153,5 @@ int CdfSource::readField(double *v, cons
   QString ftmp = field;
   ftmp.truncate(CDF_VAR_NAME_LEN);
+  if (ftmp.contains("_CYCLE") > 0) time_conversion = 0.00199997;
   // Variable selection
   strcpy(varName, ftmp.latin1());
@@ -213,4 +211,6 @@ int CdfSource::readField(double *v, cons
         break;
     }
+    // Hack for DLR's CDF files so that cycle times appear in s not cycle numbers
+    v[i-s] = v[i-s] * time_conversion;
     // Uncomment following to see that it DOES read the values successfully
     //kdDebug() << field << "[" << i << "]=" << v[i] << endl;
@@ -255,5 +255,4 @@ QString CdfSource::fileType() const {
 
 void CdfSource::save(QTextStream &ts, const QString& indent) {
-  // FIXME (copied from ascii.cpp !)
   KstDataSource::save(ts, indent);
 }
@@ -266,6 +265,6 @@ bool CdfSource::isEmpty() const {
 
 extern "C" {
-KstDataSource *create_cdf(KConfig *cfg, const QString& filename, const QString& type) {
-  return new CdfSource(cfg, filename, type);
+KstDataSource *create_cdf(const QString& filename, const QString& type) {
+  return new CdfSource(filename, type);
 }
 
@@ -280,5 +279,5 @@ QStringList provides_cdf() {
     - the file has a .cdf extension (required by the cdf lib)
     - CDFopen does not complain (currently disabled) **/
-int understands_cdf(KConfig*, const QString& filename) {
+int understands_cdf(const QString& filename) {
   QFile f(filename);
   QFileInfo fInfo(f);
@@ -311,6 +310,4 @@ int understands_cdf(KConfig*, const QStr
 }
 
-// FIXME: implement fieldlist accelerator static here for better performance?
-
 }
 

--- kdeextragear-2/kst/kst/datasources/dirfile/.cvsignore  #1.1:1.2
@@ -1,2 +1,4 @@
 Makefile
 Makefile.in
+*.bb
+*.bbg

--- kdeextragear-2/kst/kst/datasources/frame/.cvsignore  #1.1:1.2
@@ -1,2 +1,4 @@
 Makefile
 Makefile.in
+*.bb
+*.bbg

--- kdeextragear-2/kst/kst/datasources/indirect/.cvsignore  #1.1:1.2
@@ -1,2 +1,4 @@
 Makefile
 Makefile.in
+*.bb
+*.bbg

--- kdeextragear-2/kst/kst/datasources/lfiio/.cvsignore  #1.1:1.2
@@ -1,2 +1,4 @@
 Makefile
 Makefile.in
+*.bb
+*.bbg

--- kdeextragear-2/kst/kst/datasources/planck/.cvsignore  #1.1:1.2
@@ -1,2 +1,4 @@
 Makefile
 Makefile.in
+*.bb
+*.bbg





More information about the Kst mailing list