[Kst] [Bug 145289] Equations do not always update

Andrew Walker arwalker at sumusltd.com
Wed Jul 4 01:36:09 CEST 2007


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=145289         
arwalker sumusltd com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From arwalker sumusltd com  2007-07-04 01:36 -------
SVN commit 683027 by arwalker:

BUG:145289 Ensure that equations always update by avoiding optimisation when necessary

 M  +9 -5      kstequation.cpp  
 M  +9 -12     kstequation.h  


--- branches/work/kst/1.5/kst/src/libkstmath/kstequation.cpp #683026:683027
 @ -219,7 +219,7  @
 
   KstObject::UpdateType rc = NO_CHANGE; // if force, rc = UPDATE anyway.
   if (force || xUpdated || usedUpdated) {
-    _isValid = FillY(force);
+    _isValid = FillY(force, usedUpdated);
     rc = UPDATE;
   }
   v = *_yOutVector;
 @ -381,9 +381,10  @
 /*                      Fill Y: Evaluates the equation                  */
 /*                                                                      */
 /************************************************************************/
-bool KstEquation::FillY(bool force) {
-  int v_shift=0, v_new;
-  int i0=0;
+bool KstEquation::FillY(bool force, bool usedUpdated) {
+  int v_shift = 0;
+  int v_new;
+  int i0 = 0;
   int ns;
 
   writeLockInputsAndOutputs();
 @ -409,7 +410,7  @
     if (!xv->resize(_ns)) {
       // FIXME: handle error?
       unlockInputsAndOutputs();
-      return false;    
+      return false;
     }
     if (!yv->resize(_ns)) {
       // FIXME: handle error?
 @ -419,6 +420,9  @
     yv->zero();
     i0 = 0; // other vectors may have diffent lengths, so start over
     v_shift = _ns;
+  } else if (usedUpdated) {
+    i0 = 0;
+    v_shift = _ns;
   } else {
     // calculate shift and new samples
     // only do shift optimization if all used vectors are same size and shift
--- branches/work/kst/1.5/kst/src/libkstmath/kstequation.h #683026:683027
 @ -67,9 +67,9  @
     virtual QString yVTag() const { return (*_yOutVector)->tagName(); }
 
     const KstCurveHintList *curveHints() const;
-    
+
     virtual KstDataObjectPtr makeDuplicate(KstDataObjectDataObjectMap& duplicatedMap);
-    
+
     virtual void replaceDependency(KstDataObjectPtr oldObject, KstDataObjectPtr newObject);
 
     virtual void replaceDependency(KstVectorPtr oldVector, KstVectorPtr newVector);
 @ -81,25 +81,22  @
     void reParse();
 
   private:
-    QString _equation;
-
+    KstVectorMap::Iterator _xInVector, _xOutVector, _yOutVector;
+    Equation::Node *_pe;
     KstVectorMap VectorsUsed;
     KstScalarMap ScalarsUsed;
-    void setupConnections();
-
-    void commonConstructor(const QString& in_tag, const QString& equation);
-
-    bool FillY(bool force = false);
+    QString _equation;
     bool _isValid : 1;
     bool _doInterp : 1;
-
     int _numNew, _numShifted, _interp, _ns;
 
+    void setupConnections();
+    void commonConstructor(const QString& in_tag, const QString& equation);
+    bool FillY(bool force, bool usedUpdated);
+
     static const QString XINVECTOR;
     static const QString XOUTVECTOR;
     static const QString YOUTVECTOR;
-    KstVectorMap::Iterator _xInVector, _xOutVector, _yOutVector;
-    Equation::Node *_pe;
 };
 
 typedef KstSharedPtr<KstEquation> KstEquationPtr;


More information about the Kst mailing list