Bug 86582 - Option for markers to be shared between plots
Summary: Option for markers to be shared between plots
Status: RESOLVED FIXED
Alias: None
Product: kst
Classification: Applications
Component: general (show other bugs)
Version: 1.x
Platform: unspecified Solaris
: NOR wishlist
Target Milestone: ---
Assignee: kst
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-08-04 18:03 UTC by Nicolas Brisset
Modified: 2004-10-26 22:11 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas Brisset 2004-08-04 18:03:09 UTC
Version:           0.99-devel (using KDE 3.2.1, compiled sources)
Compiler:          gcc version 3.3.2
OS:                SunOS (sun4u) release 5.8

I find markers very useful, and I also like the way they can be created from the values in another curve. Great job !
One thing I lack, though, is the ability to define markers that apply to all plots in a window (or all windows ?). This would be very useful when the effect of some "event" has influence on many variables shown in different plots.
Comment 1 Netterfield 2004-08-10 16:18:45 UTC
How does this relate to the tied zoom status?
It should be the same thing since moving between events is a 'zoom' operation- so perhaps the markers appear on all plots which are tied to the plot with the markers.
Comment 2 Rick Chern 2004-08-10 18:37:32 UTC
Currently in tied zoom, jumping to a marker performs the same operation on all tied plots (so all plots in the tied group will jump to their own next/previous markers, if they have one), much like "zoom maximum" or scrolling in tied zoom.  
Comment 3 Netterfield 2004-08-11 21:47:06 UTC
not for 0.99 unless it is *really* easy.

cbn

On August 11, 2004 03:44 pm, Rick Chern wrote:
> ------- 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=86582
> rchern interchange ubc ca changed:
>
>            What    |Removed                     |Added
> ---------------------------------------------------------------------------
>- AssignedTo|kst kde org                 |rchern interchange ubc ca
> Status|UNCONFIRMED                 |ASSIGNED
>       everconfirmed|0                           |1
> _______________________________________________
> Kst mailing list
> Kst@kde.org
> https://mail.kde.org/mailman/listinfo/kst

Comment 4 Rick Chern 2004-08-11 21:52:14 UTC
netterfield@astro.utoronto.ca wrote:

>------- Additional Comments From netterfield astro utoronto ca  2004-08-11 21:47 -------
>not for 0.99 unless it is *really* easy.
>
>cbn
>
>  
>
I am not clear how this should be implemented yet (in tied zoom-how?, or 
use a modifier key to create markers on all plots...?) so I will leave 
it for after 0.99

Comment 5 Rick Chern 2004-08-17 20:36:48 UTC
How should this be implemented?  Should the marker-jumping behaviour in tied zoom mode be changed so that x axis scales are simply matched to one plot (instead of the current behaviour of jumping each plot to its own markers)?  Or should there be a way to simultaneously create plot markers on multiple plots?  
Comment 6 Rick Chern 2004-08-19 22:55:39 UTC
CVS commit by rchern: 

Plot marker jumping behaviour in tied zoom mode has been changed.  Main differences:
- jumping to a marker will cause all other tied plots to center on the same x value.  The x zoom level is not changed, consistent with scrolling behaviour
- if a tied plot (that is not the active plot) is in log mode, it will not jump at all if asked to jump to a non-positive center, but all other tied plots will try to jump (if they can)
- if the active plot is unable to jump (no marker available, or negative plot marker in xLog mode) then other tied plots will not jump either, even if they are able to.

The last two points make it possible to have unsynchronized jumps when in tied zoom mode.

This should be like "sharing" plot markers (the markers themselves are not shared, however). 

CCMAIL:  86582-done@bugs.kde.org


  M +71 -41    kst2dplot.cpp   1.235
  M +1 -1      kst2dplot.h   1.94


--- kdeextragear-2/kst/kst/kst2dplot.cpp  #1.234:1.235
@@ -3033,21 +3033,5 @@ void Kst2DPlot::moveDown(KstViewWidget *
 void Kst2DPlot::moveToNextMarker(KstViewWidget *view) {
   Q_UNUSED(view)
-  moveSelfToMarker(true);
-  updateTiedPlots(&Kst2DPlot::moveSelfToMarker, true);
-  pushScale();
-  setDirty();
-  view->paint();
-}
-
-void Kst2DPlot::moveToPrevMarker(KstViewWidget *view) {
-  Q_UNUSED(view)
-  moveSelfToMarker(false);
-  updateTiedPlots(&Kst2DPlot::moveSelfToMarker, false);
-  pushScale();
-  setDirty();
-  view->paint();
-}
-
-void Kst2DPlot::moveSelfToMarker(bool next) {
+  //do the moving
   double newCenter, currCenter;
   double xmin, xmax, ymin, ymax;
@@ -3055,5 +3039,4 @@ void Kst2DPlot::moveSelfToMarker(bool ne
 
   getLScale(xmin, ymin, xmax, ymax);
-  if (next) {
     currCenter = ((xmax + xmin) / 2.0) + (xmax - xmin)/MARKER_NUM_SEGS;
     if (_xLog) {
@@ -3068,6 +3051,24 @@ void Kst2DPlot::moveSelfToMarker(bool ne
        setXScaleMode(FIXED);
        setLXScale(new_xmin, new_xmax);
+
+    //now move all all the other tied plots to the same center
+    if (_xLog) {
+      newCenter = pow(10, newCenter);
     }
-  } else {
+    updateTiedPlots(&Kst2DPlot::moveSelfToCenter, newCenter);
+    pushScale();
+    setDirty();
+    view->paint();
+  }
+}
+
+void Kst2DPlot::moveToPrevMarker(KstViewWidget *view) {
+  Q_UNUSED(view)
+  //do the moving
+  double newCenter, currCenter;
+  double xmin, xmax, ymin, ymax;
+  double new_xmin, new_xmax;
+
+  getLScale(xmin, ymin, xmax, ymax);
     currCenter = ((xmax + xmin) / 2.0) - (xmax - xmin)/MARKER_NUM_SEGS;
     if (_xLog) {
@@ -3086,6 +3087,34 @@ void Kst2DPlot::moveSelfToMarker(bool ne
        setXScaleMode(FIXED);
        setLXScale(new_xmin, new_xmax);
+
+    //now move all the other tied plots to the same center
+    if (_xLog) {
+      newCenter = pow(10, newCenter);
+    }
+    updateTiedPlots(&Kst2DPlot::moveSelfToCenter, newCenter);
+    pushScale();
+    setDirty();
+    view->paint();
+  }
+}
+
+void Kst2DPlot::moveSelfToCenter(double center) {
+  //log the center if necessary
+  if (_xLog) {
+    center = logX(center);
     }
+
+  //refuse to move if it's not possible
+  if (_xLog && center <= -350) {
+    return;
   }
+
+  double xmin, xmax, ymin, ymax;
+  getLScale(xmin, ymin, xmax, ymax);
+
+  double new_xmin = center - (xmax - xmin)/2.0;
+  double new_xmax = center + (xmax - xmin)/2.0;
+  setXScaleMode(FIXED);
+  setLXScale(new_xmin, new_xmax);
 }
 

--- kdeextragear-2/kst/kst/kst2dplot.h  #1.93:1.94
@@ -213,5 +213,5 @@ public:
   void moveToNextMarker(KstViewWidget *);
   void moveToPrevMarker(KstViewWidget *);
-  void moveSelfToMarker(bool next);
+  void moveSelfToCenter(double center);
   //curve related Plot Marker functions
   void setCurveToMarkers(KstBaseCurvePtr curve, bool risingDetect, bool fallingDetect);


Comment 7 Nicolas Brisset 2004-08-31 11:32:46 UTC
I'm starting to feel bad, reopening a second fixed bug today :-( I hope this is not too bad a practice, but the new suggestions I want to make are really related to the original report.

I think the tied jumping behavior implemented is a nice feature, but I has in mind something I consider simpler and hence easier to use and visually more clear. I would just add options in the Plot dialog/Markers tab to change the behavior of the "Add" and "Remove" buttons: add somewhere a "Also change markers in" groupbox with radiobuttons None/All plots in this window/All plots (possibly resulting in attempts to remove non-existing markers in some plots, which could just quietly fail).
Comment 8 Andrew Walker 2004-10-18 23:29:18 UTC
The markers are updated in one shot when the Apply button is pressed, so it would be tricky to also add and remove markers from other plots. 

The only realistic alternative (without modifying the current behaviour) would be to set the markers for the other plots to be the same as the markers in the plot being edited. Thus markers could be both removed and added from the other plots when the Apply button is pressed. Is this useful/desirable?

In the absence of any comments I'll implement this, as it at least makes the Apply to consistent with the other tabs.
Comment 9 Nicolas Brisset 2004-10-19 09:37:01 UTC
Yes, I like your last suggestion. The behavior is indeed consistent with other tabs with respect to the "Also apply to" feature, which is obvisouly good, and I think in most cases the user will either want to have shared markers (i.e. look at specific events in all plots) or per-plot markers if the contents of plots are very different. Your idea would answer both needs. Just go ahead :-)
Comment 10 Andrew Walker 2004-10-26 22:11:21 UTC
CVS commit by arwalker: 

Allow the user to apply marker settings to other plots in windows or all other plots.

CCMAIL: 86582-done@bugs.kde.org


  M +36 -17    kstplotdialog_i.cpp   1.111
  M +104 -50   plotdialog.ui   1.66