Merge "ASM #18090 fixed the best estimate qpe column display" into asm_16.1.1

Former-commit-id: 6db50e605f33584bf46675ef8d1183c3b14873c5
This commit is contained in:
Matthew Howard 2015-10-21 09:19:36 -05:00 committed by Gerrit Code Review
commit 344194438e
2 changed files with 25 additions and 3 deletions

View file

@ -74,6 +74,7 @@ import com.raytheon.viz.mpe.ui.dialogs.polygon.PolygonEditManager;
* Apr29, 2014 16308 lbousaidi transmit RFC Bias when an hour
* MPE is saved via the GUI.
* Mar 10, 2015 14554 snaples Added check to remove Best Estimate polygons after saving.
* Oct 19, 2015 18090 lbousaidi Added date format when the token st3_date_form token is set to Ymd.
* </pre>
*
* @author mschenke
@ -106,6 +107,8 @@ public class SaveBestEstimate {
if ((date_form == null) || date_form.isEmpty()
|| date_form.equals("mdY")) {
ST3_FORMAT_STRING = MPEDateFormatter.MMddyyyyHH;
} else if (date_form.equals("Ymd")){
ST3_FORMAT_STRING = MPEDateFormatter.yyyyMMddHH;
}
/*----------------------------------------------------------*/
/* create date in desired format for use in xmrg filename */

View file

@ -42,6 +42,7 @@ import com.raytheon.uf.viz.core.catalog.DirectDbQuery;
import com.raytheon.uf.viz.core.catalog.DirectDbQuery.QueryLanguage;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.viz.hydrocommon.HydroConstants;
import com.raytheon.viz.mpe.MPEDateFormatter;
import com.raytheon.viz.mpe.core.MPEDataManager;
import com.raytheon.viz.mpe.core.MPEDataManager.MPEGageData;
import com.raytheon.viz.mpe.ui.DisplayFieldData;
@ -60,9 +61,10 @@ import com.vividsolutions.jts.geom.Coordinate;
* Jan 28, 2010 4415 mpduff Fixed problem with column
* header creation.
* May 20, 2013 15962 lbousaidi Added a new routine getRadarIdsTrue()
* for Radar Sites dialog.
* for Radar Sites dialog.
* Mar 05, 2014 17114 lbousaidi display PC data in gage table.
* Sep 04, 2014 16699 cgobs Fixed 14.3.1 issue with reading MPE field data.
* Oct 19, 2015 18090 lbousaidi fixed best estimate qpe display.
* </pre>
*
* @author mpduff
@ -1135,12 +1137,29 @@ public class GageTableDataManager {
.getInstance();
MPEDisplayManager displayManager = MPEDisplayManager.getCurrent();
double returnValue = -999.0;
String ST3_FORMAT_STRING = MPEDateFormatter.yyyyMMddHH;
String date_form = appsDefaults.getToken("st3_date_form");// non need just change format of sdf
if ((date_form == null) || date_form.isEmpty()
|| date_form.equals("mdY")) {
ST3_FORMAT_STRING = MPEDateFormatter.MMddyyyyHH;
} else if (date_form.equals("Ymd")){
ST3_FORMAT_STRING = MPEDateFormatter.yyyyMMddHH;
}
try {
String dirname = appsDefaults.getToken(dataType.getDirToken());
String fname = FileUtil.join(dirname,
String fname= null;
if (dataType.getFileNamePrefix().contains("XMRG")) {
String cdate = MPEDateFormatter.format(displayManager.getCurrentEditDate(), ST3_FORMAT_STRING);
fname= FileUtil.join(dirname,
dataType.getFileNamePrefix().toLowerCase() + cdate + "z");
//System.out.println(" in gageTable Datamanager.java fname= "+fname );
}else {
fname = FileUtil.join(dirname,
dataType.getFileNamePrefix() + sdf.format(displayManager.getCurrentEditDate()) + "z");
}
Rectangle extent = dataManager.getHRAPExtent();
short[][] data = gageTableDataManager.getXmrgData(fname, prodType,
@ -1158,7 +1177,7 @@ public class GageTableDataManager {
// Needed to flip the grid
int gridY = extent.height - (y - extent.y) - 1;
short value = data[gridY][gridX];
// Any value < 0 is considered missing
if ((value == -899.0) || (value == -999.0) || (value < 0)) {
returnValue = -999.0;