Issue #449. Fixed problem with simulated time for trend plots in FSS
monitors. Former-commit-id:f02da69ff5
[formerly 79b81f2a734142d212d7bc0ad3686c7b64f433c5] Former-commit-id:8d29726365
This commit is contained in:
parent
21ff4bf657
commit
bf5cf6a903
3 changed files with 19 additions and 3 deletions
|
@ -46,6 +46,7 @@ import com.raytheon.uf.common.monitor.data.CommonConfig.AppName;
|
||||||
import com.raytheon.uf.common.monitor.data.ObConst;
|
import com.raytheon.uf.common.monitor.data.ObConst;
|
||||||
import com.raytheon.uf.viz.monitor.data.ObMultiHrsReports;
|
import com.raytheon.uf.viz.monitor.data.ObMultiHrsReports;
|
||||||
import com.raytheon.uf.viz.monitor.data.ObTrendDataSet;
|
import com.raytheon.uf.viz.monitor.data.ObTrendDataSet;
|
||||||
|
import com.raytheon.uf.viz.monitor.util.ObUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Trend Canvas
|
* The Trend Canvas
|
||||||
|
@ -75,7 +76,7 @@ public class TrendPlotCanvas {
|
||||||
|
|
||||||
private Canvas canvas;
|
private Canvas canvas;
|
||||||
|
|
||||||
Calendar curdate;
|
private Calendar curdate;
|
||||||
|
|
||||||
private SortedMap<Date, Float> trendData;
|
private SortedMap<Date, Float> trendData;
|
||||||
|
|
||||||
|
@ -200,7 +201,8 @@ public class TrendPlotCanvas {
|
||||||
if (!Float.isNaN(thresholds[1])) {
|
if (!Float.isNaN(thresholds[1])) {
|
||||||
yellowThreshold = thresholds[1];
|
yellowThreshold = thresholds[1];
|
||||||
}
|
}
|
||||||
curdate = Calendar.getInstance();
|
curdate = ObUtil.getTimeNow(); // Calendar.getInstance();
|
||||||
|
|
||||||
if (trendDataSet.getYAxisMinMaxIncrement() != null) {
|
if (trendDataSet.getYAxisMinMaxIncrement() != null) {
|
||||||
float[] minMaxIncr = trendDataSet.getYAxisMinMaxIncrement();
|
float[] minMaxIncr = trendDataSet.getYAxisMinMaxIncrement();
|
||||||
if (!Float.isNaN(minMaxIncr[0])) {
|
if (!Float.isNaN(minMaxIncr[0])) {
|
||||||
|
|
|
@ -68,6 +68,7 @@ import com.raytheon.uf.viz.monitor.listeners.IMonitorListener;
|
||||||
import com.raytheon.uf.viz.monitor.trendplot.TrendPlotDlg;
|
import com.raytheon.uf.viz.monitor.trendplot.TrendPlotDlg;
|
||||||
import com.raytheon.uf.viz.monitor.util.MonitorConfigConstants;
|
import com.raytheon.uf.viz.monitor.util.MonitorConfigConstants;
|
||||||
import com.raytheon.viz.ui.EditorUtil;
|
import com.raytheon.viz.ui.EditorUtil;
|
||||||
|
import com.raytheon.uf.viz.monitor.util.ObUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Abstrct Zone table dialog that is the foundation for all Zone dialogs.
|
* Abstrct Zone table dialog that is the foundation for all Zone dialogs.
|
||||||
|
@ -760,7 +761,7 @@ public abstract class ZoneTableDlg extends Dialog implements IMonitorListener,
|
||||||
HodographDlg hodographDlg = new HodographDlg(shell,
|
HodographDlg hodographDlg = new HodographDlg(shell,
|
||||||
varName.name(), station, "METAR");
|
varName.name(), station, "METAR");
|
||||||
|
|
||||||
hodographDlg.setCurrentTime(Calendar.getInstance());
|
hodographDlg.setCurrentTime(ObUtil.getTimeNow()); //Calendar.getInstance());
|
||||||
if (thresholds[0] == Float.NaN || thresholds[1] == Float.NaN
|
if (thresholds[0] == Float.NaN || thresholds[1] == Float.NaN
|
||||||
|| thresholds[2] == Float.NaN
|
|| thresholds[2] == Float.NaN
|
||||||
|| thresholds[3] == Float.NaN) {
|
|| thresholds[3] == Float.NaN) {
|
||||||
|
|
|
@ -83,6 +83,19 @@ public final class ObUtil {
|
||||||
return dropTime.getTime();
|
return dropTime.getTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method that gets the current time.
|
||||||
|
*
|
||||||
|
* @return current time.
|
||||||
|
*/
|
||||||
|
public static Calendar getTimeNow() {
|
||||||
|
Date now = SimulatedTime.getSystemTime().getTime();
|
||||||
|
Calendar nowTime = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
|
||||||
|
nowTime.setTime(now);
|
||||||
|
|
||||||
|
return nowTime;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks for the existence of a localization-created flag file which
|
* Checks for the existence of a localization-created flag file which
|
||||||
* indicates that SAFESEAS should rank swell periods high to low. This
|
* indicates that SAFESEAS should rank swell periods high to low. This
|
||||||
|
|
Loading…
Add table
Reference in a new issue