Issue #2830 sort TAF dataTimes so latest are retrieved
Former-commit-id:230b8bf117
[formerly8a00a419a1
] [formerlyf353c44cc0
[formerly 04db02beec9d77e568c76541448bce0cd2f6c2d0]] Former-commit-id:f353c44cc0
Former-commit-id:74329bcb89
This commit is contained in:
parent
d6e9cb73f5
commit
a97f5b5ff7
1 changed files with 13 additions and 5 deletions
|
@ -45,12 +45,14 @@ import com.raytheon.uf.viz.core.exception.VizException;
|
||||||
* SOFTWARE HISTORY
|
* SOFTWARE HISTORY
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Sep 4, 2009 njensen Initial creation
|
* Sep 4, 2009 njensen Initial creation
|
||||||
* Jul 6, 2010 5792 rferrel getLatestTafs now returns tafs
|
* Jul 6, 2010 5792 rferrel getLatestTafs now returns tafs
|
||||||
* sorted by issue date newest at
|
* sorted by issue date newest at
|
||||||
* the start of the array.
|
* the start of the array.
|
||||||
* 08AUG2012 15613 zhao Modified safeFormatTaf()
|
* 08AUG2012 15613 zhao Modified safeFormatTaf()
|
||||||
* Sep 11, 2013 2277 mschenke Got rid of ScriptCreator references
|
* Sep 11, 2013 2277 mschenke Got rid of ScriptCreator references
|
||||||
|
* Feb 24, 2014 2830 njensen Sort dataTimes in getLatestTafs()
|
||||||
|
* so it works correctly
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -97,6 +99,11 @@ public class TafUtil {
|
||||||
TafRecord.PLUGIN_NAME));
|
TafRecord.PLUGIN_NAME));
|
||||||
map.put("stationId", new RequestConstraint(siteID));
|
map.put("stationId", new RequestConstraint(siteID));
|
||||||
|
|
||||||
|
/*
|
||||||
|
* even if only requesting one, cannot pass in true because that
|
||||||
|
* will return a DataTime with only refTime set and tafs need to
|
||||||
|
* have fcstTime, validPeriod, etc set
|
||||||
|
*/
|
||||||
DataTime[] dt = DataCubeContainer.performTimeQuery(map, false);
|
DataTime[] dt = DataCubeContainer.performTimeQuery(map, false);
|
||||||
if (dt.length == 0) {
|
if (dt.length == 0) {
|
||||||
return null;
|
return null;
|
||||||
|
@ -105,6 +112,7 @@ public class TafUtil {
|
||||||
if (size > dt.length) {
|
if (size > dt.length) {
|
||||||
size = dt.length;
|
size = dt.length;
|
||||||
}
|
}
|
||||||
|
Arrays.sort(dt);
|
||||||
DataTime[] requestedTimes = new DataTime[size];
|
DataTime[] requestedTimes = new DataTime[size];
|
||||||
int k = 0;
|
int k = 0;
|
||||||
for (int i = dt.length - 1; i > -1; i--) {
|
for (int i = dt.length - 1; i > -1; i--) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue