[Kst] branches/work/kst/portto4/kst

Barth Netterfield netterfield at astro.utoronto.ca
Tue Dec 15 03:31:59 CET 2009


SVN commit 1062534 by netterfield:

Fix an update bug in which fixed-range plots were not being re-drawn.
Don't create a datasource when validating it.

CCBUG: 215931



 M  +9 -8      devel-docs/Kst2Specs/Bugs  
 M  +5 -0      devel-docs/Kst2Specs/Wishlist  
 M  +1 -1      src/libkst/dataprimitive.h  
 M  +13 -5     src/libkst/datasource.cpp  
 M  +1 -1      src/libkst/datasource.h  
 M  +2 -2      src/libkstapp/applicationsettings.cpp  
 M  +2 -2      src/libkstapp/changedatasampledialog.cpp  
 M  +3 -3      src/libkstapp/circleitem.cpp  
 M  +1 -1      src/libkstapp/datawizard.cpp  
 M  +3 -1      src/libkstapp/plotitem.cpp  
 M  +5 -5      src/widgets/scalarselector.cpp  
 M  +1 -1      src/widgets/scalarselector.h  


--- branches/work/kst/portto4/kst/devel-docs/Kst2Specs/Bugs #1062533:1062534
@@ -40,17 +40,18 @@
 
 --------------------
 
-With the live data, the UI is sluggish.  I have the plot update timer
-set to 200ms, but clearly the data only updates at about 2Hz (and it's
-kinda random), and between updates drawing things on the plots (like
-zoom rectangles) is choppy (updating when the data does).  The dialog
-boxes are also sluggish.  kst2 must not be multi-threaded.
-
---------------------
-
 Windows MEMleak
 
 --------------------
 
 Windows ascii performance
 
+-------------------
+
+Change data sample range dialog: add all note enabled at first.
+
+------------------
+
+Cleanup layout totally sucks!
+
+
--- branches/work/kst/portto4/kst/devel-docs/Kst2Specs/Wishlist #1062533:1062534
@@ -89,3 +89,8 @@
 Perhaps unrelated to kst, but the new symbolic link name in defile
 (replacing the defile.cur indirect file) is retarded.  It slows me down
 and the double extension is pointless.  
+
+--------------------
+
+Thread kst2
+
--- branches/work/kst/portto4/kst/src/libkst/dataprimitive.h #1062533:1062534
@@ -31,7 +31,7 @@
 {
 public:
     DataPrimitive();
-    ~DataPrimitive();
+    virtual ~DataPrimitive();
 
     /** return the name of the file */
     QString filename() const;
--- branches/work/kst/portto4/kst/src/libkst/datasource.cpp #1062533:1062534
@@ -312,11 +312,18 @@
     return false;
   }
 
-  // Use a local version of the store, we don't want to save this.
-  ObjectStore store;
-  if (DataSourcePtr dataSource = findPluginFor(&store, fn, QString::null)) {
-    return true;
+  DataSource::init();
+
+  PluginList info = _pluginList;
+
+  for (PluginList::Iterator it = info.begin(); it != info.end(); ++it) {
+    if (DataSourcePluginInterface *p = dynamic_cast<DataSourcePluginInterface*>((*it).data())) {
+      if ((p->understands(settingsObject, filename)) > 0) {
+        return true;
+      }
+    }
   }
+
   return false;
 }
 
@@ -462,7 +469,7 @@
   return rc;
 }
 
-
+# if 0
 QStringList DataSource::matrixListForSource(const QString& filename, const QString& type, QString *outType, bool *complete) {
   if (filename == "stdin" || filename == "-") {
     return QStringList();
@@ -492,6 +499,7 @@
 
   return rc;
 }
+#endif
 
 QStringList DataSource::scalarListForSource(const QString& filename, const QString& type, QString *outType, bool *complete) {
   if (filename == "stdin" || filename == "-") {
--- branches/work/kst/portto4/kst/src/libkst/datasource.h #1062533:1062534
@@ -257,7 +257,7 @@
     /************************************************************/
     /* Methods for Matrixes                                     */
     /************************************************************/
-    static QStringList matrixListForSource(const QString& filename, const QString& type = QString(), QString *outType = 0L, bool *complete = 0L);
+    //static QStringList matrixListForSource(const QString& filename, const QString& type = QString(), QString *outType = 0L, bool *complete = 0L);
 
     /** Returns the list of fields that support readMatrix **/
     virtual QStringList matrixList() const;
--- branches/work/kst/portto4/kst/src/libkstapp/applicationsettings.cpp #1062533:1062534
@@ -114,7 +114,7 @@
 #ifdef Q_WS_X11
     dpiScale = QX11Info::appDpiX();
 #endif
-  return (_refViewWidth * dpiScale * 0.3937008);
+  return int(_refViewWidth * dpiScale * 0.3937008);
 }
 
 
@@ -135,7 +135,7 @@
 #ifdef Q_WS_X11
     dpiScale = QX11Info::appDpiY();
 #endif
-  return (_refViewHeight * dpiScale * 0.3937008);
+  return int(_refViewHeight * dpiScale * 0.3937008);
 }
 
 
--- branches/work/kst/portto4/kst/src/libkstapp/changedatasampledialog.cpp #1062533:1062534
@@ -193,8 +193,8 @@
   for (int i = 0; i < selectedItems.size(); ++i) {
     if (DataVectorPtr vector = kst_cast<DataVector>(_store->retrieveObject(selectedItems.at(i)->text()))) {
       vector->writeLock();
-      vector->changeFrames( (_dataRange->countFromEnd() ? -1 : _dataRange->start()),
-                            (_dataRange->readToEnd() ? -1 : _dataRange->range()),
+      vector->changeFrames( (_dataRange->countFromEnd() ? -1 : int(_dataRange->start())),
+                            (_dataRange->readToEnd() ? -1 : int(_dataRange->range())),
                             _dataRange->skip(),
                             _dataRange->doSkip(),
                             _dataRange->doFilter());
--- branches/work/kst/portto4/kst/src/libkstapp/circleitem.cpp #1062533:1062534
@@ -62,9 +62,9 @@
 
   if (event == View::MouseMove) {
     const QPolygonF poly = mapFromScene(parentView()->creationPolygon(View::MouseMove));
-    qreal size = (abs(poly.last().x() - rect().x()) < abs(poly.last().y() - rect().y())) ? abs(poly.last().x() - rect().x()) : abs(poly.last().y() - rect().y());
-    qreal width = (poly.last().x() - rect().x()) < 0 ? size * -1 : size;
-    qreal height = (poly.last().y() - rect().y()) < 0 ? size * -1 : size;
+    qreal size = (fabs(poly.last().x() - rect().x()) < fabs(poly.last().y() - rect().y())) ? fabs(poly.last().x() - rect().x()) : fabs(poly.last().y() - rect().y());
+    qreal width = (poly.last().x() - rect().x()) < 0 ? size * -1.0 : size;
+    qreal height = (poly.last().y() - rect().y()) < 0 ? size * -1.0 : size;
     QRectF newRect(rect().x(), rect().y(),
                    width,
                    height);
--- branches/work/kst/portto4/kst/src/libkstapp/datawizard.cpp #1062533:1062534
@@ -581,7 +581,7 @@
 
   // check for sufficient memory
   unsigned long memoryRequested = 0, memoryAvailable = 1024*1024*1024; // 1GB
-  unsigned long frames;
+  double frames;
 #ifdef __linux__
   meminfo();
   memoryAvailable = S(kb_main_free + kb_main_buffers + kb_main_cached);
--- branches/work/kst/portto4/kst/src/libkstapp/plotitem.cpp #1062533:1062534
@@ -758,6 +758,8 @@
             compute.y(),
             projectionRect().width(),
             compute.height()));
+    } else {
+      update();
     }
   }
   setLabelsDirty();
@@ -2525,7 +2527,7 @@
 
 
 void PlotItem::setProjectionRect(const QRectF &rect, bool forceAxisUpdate) {
-  if (!(_projectionRect == rect || rect.isEmpty() || !rect.isValid())) {
+  if (!(/*_projectionRect == rect ||*/ rect.isEmpty() || !rect.isValid())) {
 #if DEBUG_ZOOM
     qDebug() << "=== setProjectionRect() ======================>\n"
       << "before:" << _projectionRect << "\n"
--- branches/work/kst/portto4/kst/src/widgets/scalarselector.cpp #1062533:1062534
@@ -63,11 +63,11 @@
 }
 
 
-void ScalarSelector::setDefaultValue(double value) {
-  QString string = QString::number(value);
-  _scalar->addItem(string, qVariantFromValue(NULL));
-  _scalar->setCurrentIndex(_scalar->findText(string));
-}
+//void ScalarSelector::setDefaultValue(double value) {
+//  QString string = QString::number(value);
+//  _scalar->addItem(string, qVariantFromValue(NULL));
+//  _scalar->setCurrentIndex(_scalar->findText(string));
+//}
 
 
 ScalarPtr ScalarSelector::selectedScalar() {
--- branches/work/kst/portto4/kst/src/widgets/scalarselector.h #1062533:1062534
@@ -40,7 +40,7 @@
 
     QString selectedScalarString();
 
-    void setDefaultValue(double value);
+    //void setDefaultValue(double value);
 
     virtual bool event(QEvent * event);
 


More information about the Kst mailing list