Omaha #3214 fixed cache object usage in lightning resource

pulse and cloud flashes were not updated properly in the cache

Change-Id: Idf17aeb444f93c73901c26da9640f0a8f4a6a486

Former-commit-id: ac8f861112 [formerly 206fd1556b6b7bdfcf432b0c13af9b38d1f1d393]
Former-commit-id: 994226e82b
This commit is contained in:
Brian Clements 2014-07-09 14:13:47 -05:00
parent 011089ab35
commit dba1fb3fc1

View file

@ -102,6 +102,7 @@ import com.raytheon.uf.viz.core.rsc.capabilities.MagnificationCapability;
* Jun 05, 2014 3226 bclement reference datarecords by LightningConstants
* Jun 06, 2014 DR 17367 D. Friedman Fix cache object usage.
* Jun 19, 2014 3214 bclement added pulse and could flash support
* Jul 09, 2014 3214 bclement fixed cache object usage for pulse and cloud flash
*
* </pre>
*
@ -207,18 +208,28 @@ public class LightningResource extends
int doubleCount = 0;
if (object != null) {
synchronized (object) {
for (double[] arr : object.posLatLonList) {
doubleCount += arr.length;
}
for (double[] arr : object.negLatLonList) {
doubleCount += arr.length;
}
doubleCount += getSize(object.posLatLonList);
doubleCount += getSize(object.negLatLonList);
doubleCount += getSize(object.cloudLatLonList);
doubleCount += getSize(object.pulseLatLonList);
}
}
// 8 bytes per double
return doubleCount * 8;
}
/**
* @param lonLatList
* @return total number of doubles in list
*/
private static int getSize(List<double[]> lonLatList) {
int rval = 0;
for (double[] arr : lonLatList) {
rval += arr.length;
}
return rval;
}
/*
* (non-Javadoc)
*
@ -642,6 +653,8 @@ public class LightningResource extends
.retrieveObject(frame);
existing.posLatLonList.addAll(newBundle.posLatLonList);
existing.negLatLonList.addAll(newBundle.negLatLonList);
existing.cloudLatLonList.addAll(newBundle.cloudLatLonList);
existing.pulseLatLonList.addAll(newBundle.pulseLatLonList);
}
}
}