Summary: | Option for markers to be shared between plots | ||
---|---|---|---|
Product: | [Applications] kst | Reporter: | Nicolas Brisset <nicolas.brisset> |
Component: | general | Assignee: | kst |
Status: | RESOLVED FIXED | ||
Severity: | wishlist | ||
Priority: | NOR | ||
Version: | 1.x | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Solaris | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Nicolas Brisset
2004-08-04 18:03:09 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. 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. 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 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 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? 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); 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). 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. 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 :-) 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 |