Merge "Omaha #5073 - Fixed issue with Time Series Display." into omaha_16.2.2

Former-commit-id: d6253dcd4150602c1eba05b4de1db7098c686e70
This commit is contained in:
Lee Venable 2015-12-07 13:20:09 -06:00 committed by Gerrit Code Review
commit 39c325b8e0
2 changed files with 21 additions and 14 deletions

View file

@ -141,6 +141,8 @@ import com.raytheon.viz.hydrocommon.util.DbUtils;
* 29 May 2013 2016 mpduff Fix TS Toggle Traces.
* 05 Sep 2013 #2332 lvenable Fixed memory leaks.
* 24 Jan 2013 15959 lbousaidi Swap the corner points of the bounding box when zooming.
* Nov 18 2015 5073 skorolev Fixed drawing PP time series.
*
* @author lvenable
* @version 1.0
*
@ -841,7 +843,8 @@ public class TimeSeriesDisplayCanvas extends TimeSeriesGraphCanvas implements
}
/* Precipitation physical element */
if (td.getPe().equalsIgnoreCase(HydroConstants.PP)) {
if (td.getPe().equalsIgnoreCase(HydroConstants.PP)
&& td.isTraceOn()) {
precipPE = true;
setBackgroundColor(td, j, gc);
int[] ia = new int[8];

View file

@ -70,6 +70,7 @@ import com.raytheon.viz.hydrocommon.HydroConstants;
* 06 Nov 2012 15399 wkwock Fix refine the plot algorithm and sampling algorithm
* May 06, 2013 1976 mpduff Code cleanup
* 05Sep2013 #2332 lvenable Fixed memory leaks.
* Nov 18, 2015 5073 skorolev Fixed y2pixel.
* </pre>
*
* @author mpduff
@ -624,9 +625,12 @@ public class TimeSeriesGraphCanvas extends Canvas {
}
double yDiff = gd.getYmax() - gd.getYmin();
double yValue = (graphAreaHeight / yDiff) * (y - gd.getYmin());
if (yValue < 0) {
return graphAreaHeight;
} else {
return (int) (graphAreaHeight - Math.round(yValue));
}
}
/**
* convert pixel value to real Y value