Merge branch 'development' of ssh://lightning.omaha.us.ray.com:29418/AWIPS2_baseline into development
Former-commit-id:615042859f
[formerlye38fc1e5c9
[formerly 16bfc9f7e68cc45b44867fc41cf62cd12f323390]] Former-commit-id:e38fc1e5c9
Former-commit-id:a2d9207ebc
This commit is contained in:
commit
cf9207bf91
9 changed files with 143 additions and 62 deletions
|
@ -35,6 +35,7 @@ import com.raytheon.viz.ui.tools.AbstractTool;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Apr 8, 2009 bgonzale Initial creation
|
* Apr 8, 2009 bgonzale Initial creation
|
||||||
|
* Oct 15, 2012 1229 rferrel Changes for non-blocking DisplayPropertiesDialog.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -57,13 +58,12 @@ public class DisplayPropertiesAction extends AbstractTool {
|
||||||
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
||||||
super.execute(arg0);
|
super.execute(arg0);
|
||||||
|
|
||||||
if (dialog == null) {
|
if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
|
||||||
dialog = new DisplayPropertiesDialog(VizWorkbenchManager
|
dialog = new DisplayPropertiesDialog(VizWorkbenchManager
|
||||||
.getInstance().getCurrentWindow().getShell());
|
.getInstance().getCurrentWindow().getShell());
|
||||||
dialog.open();
|
dialog.open();
|
||||||
dialog = null;
|
|
||||||
} else {
|
} else {
|
||||||
dialog.open();
|
dialog.bringToTop();
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -54,11 +54,9 @@ import com.raytheon.uf.viz.core.rsc.IResourceGroup;
|
||||||
import com.raytheon.uf.viz.core.rsc.ResourceList;
|
import com.raytheon.uf.viz.core.rsc.ResourceList;
|
||||||
import com.raytheon.uf.viz.core.rsc.capabilities.AbstractCapability;
|
import com.raytheon.uf.viz.core.rsc.capabilities.AbstractCapability;
|
||||||
import com.raytheon.uf.viz.core.rsc.capabilities.OutlineCapability;
|
import com.raytheon.uf.viz.core.rsc.capabilities.OutlineCapability;
|
||||||
import com.raytheon.uf.viz.core.status.StatusConstants;
|
|
||||||
import com.raytheon.uf.viz.d2d.core.map.MapScales;
|
import com.raytheon.uf.viz.d2d.core.map.MapScales;
|
||||||
import com.raytheon.uf.viz.d2d.core.map.MapScales.MapScale;
|
import com.raytheon.uf.viz.d2d.core.map.MapScales.MapScale;
|
||||||
import com.raytheon.uf.viz.d2d.core.time.LoadMode;
|
import com.raytheon.uf.viz.d2d.core.time.LoadMode;
|
||||||
import com.raytheon.uf.viz.d2d.ui.Activator;
|
|
||||||
import com.raytheon.uf.viz.d2d.ui.DensityPopulator;
|
import com.raytheon.uf.viz.d2d.ui.DensityPopulator;
|
||||||
import com.raytheon.uf.viz.d2d.ui.MagnificationPopulator;
|
import com.raytheon.uf.viz.d2d.ui.MagnificationPopulator;
|
||||||
import com.raytheon.uf.viz.d2d.ui.actions.DensityHandler;
|
import com.raytheon.uf.viz.d2d.ui.actions.DensityHandler;
|
||||||
|
@ -78,6 +76,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Apr 8, 2009 bgonzale Initial creation
|
* Apr 8, 2009 bgonzale Initial creation
|
||||||
|
* Oct 16, 2012 1229 rferrel Made dialog non-blocking.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -86,7 +85,8 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class DisplayPropertiesDialog extends CaveSWTDialog {
|
public class DisplayPropertiesDialog extends CaveSWTDialog {
|
||||||
private static final transient IUFStatusHandler statusHandler = UFStatus.getHandler(DisplayPropertiesDialog.class);
|
private final transient IUFStatusHandler statusHandler = UFStatus
|
||||||
|
.getHandler(DisplayPropertiesDialog.class);
|
||||||
|
|
||||||
private Combo scale;
|
private Combo scale;
|
||||||
|
|
||||||
|
@ -171,7 +171,8 @@ public class DisplayPropertiesDialog extends CaveSWTDialog {
|
||||||
* @param editor
|
* @param editor
|
||||||
*/
|
*/
|
||||||
public DisplayPropertiesDialog(Shell parentShell) {
|
public DisplayPropertiesDialog(Shell parentShell) {
|
||||||
super(parentShell, SWT.DIALOG_TRIM | SWT.MIN, CAVE.INDEPENDENT_SHELL);
|
super(parentShell, SWT.DIALOG_TRIM | SWT.MIN, CAVE.INDEPENDENT_SHELL
|
||||||
|
| CAVE.DO_NOT_BLOCK);
|
||||||
setText("Display Properties");
|
setText("Display Properties");
|
||||||
|
|
||||||
this.sHandler = new ScaleHandler();
|
this.sHandler = new ScaleHandler();
|
||||||
|
|
|
@ -28,12 +28,32 @@ import org.eclipse.ui.PlatformUI;
|
||||||
import com.raytheon.uf.viz.d2d.ui.dialogs.CreateProjectionDialog;
|
import com.raytheon.uf.viz.d2d.ui.dialogs.CreateProjectionDialog;
|
||||||
import com.raytheon.viz.ui.tools.AbstractTool;
|
import com.raytheon.viz.ui.tools.AbstractTool;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handler class for controlling the Create Projection dialog.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
*
|
||||||
|
* SOFTWARE HISTORY
|
||||||
|
*
|
||||||
|
* Date Ticket# Engineer Description
|
||||||
|
* ------------ ---------- ----------- --------------------------
|
||||||
|
* Initial creation
|
||||||
|
* Oct 16, 2012 1229 rferrel Made dialog non-blocking.
|
||||||
|
*
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* @author rferrel
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
public class CreateProjectionHandler extends AbstractTool implements IHandler {
|
public class CreateProjectionHandler extends AbstractTool implements IHandler {
|
||||||
|
private CreateProjectionDialog dlg;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
*
|
||||||
* @see com.raytheon.viz.ui.tools.AbstractTool#execute(org.eclipse.core.commands.ExecutionEvent)
|
* @see
|
||||||
|
* com.raytheon.viz.ui.tools.AbstractTool#execute(org.eclipse.core.commands
|
||||||
|
* .ExecutionEvent)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
||||||
|
@ -42,9 +62,13 @@ public class CreateProjectionHandler extends AbstractTool implements IHandler {
|
||||||
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||||
.getShell();
|
.getShell();
|
||||||
|
|
||||||
CreateProjectionDialog dlg = new CreateProjectionDialog(shell);
|
if (dlg == null || dlg.getShell() == null || dlg.isDisposed()) {
|
||||||
|
dlg = new CreateProjectionDialog(shell);
|
||||||
dlg.open();
|
dlg.setBlockOnOpen(false);
|
||||||
|
dlg.open();
|
||||||
|
} else {
|
||||||
|
dlg.bringToTop();
|
||||||
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -173,14 +173,15 @@ public class D2DGridDatabase extends VGridDatabase {
|
||||||
- subdomain.height;
|
- subdomain.height;
|
||||||
|
|
||||||
if (subdomain.isEmpty()) {
|
if (subdomain.isEmpty()) {
|
||||||
valid = false;
|
statusHandler.warn(this.dbId
|
||||||
throw new GfeException("Unable to create " + this.dbId
|
+ ": GFE domain does not overlap dataset domain.");
|
||||||
+ ". GFE domain does not overlap dataset domain.");
|
this.remap = null;
|
||||||
|
} else {
|
||||||
|
this.remap = new RemapGrid(NetCDFUtils.subGridGL(
|
||||||
|
dbId.toString(), this.inputLoc, subdomain),
|
||||||
|
this.outputLoc);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.remap = new RemapGrid(NetCDFUtils.subGridGL(dbId.toString(),
|
|
||||||
this.inputLoc, subdomain), this.outputLoc);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -475,7 +476,14 @@ public class D2DGridDatabase extends VGridDatabase {
|
||||||
|
|
||||||
switch (gpi.getGridType()) {
|
switch (gpi.getGridType()) {
|
||||||
case SCALAR:
|
case SCALAR:
|
||||||
Grid2DFloat data = getGrid(parmId, time, gpi, convertUnit);
|
Grid2DFloat data = null;
|
||||||
|
if (this.remap == null) {
|
||||||
|
// GFE domain does not overlap D2D grid, return default grid
|
||||||
|
data = new Grid2DFloat(gpi.getGridLoc().getNx(), gpi
|
||||||
|
.getGridLoc().getNy(), gpi.getMinValue());
|
||||||
|
} else {
|
||||||
|
data = getGrid(parmId, time, gpi, convertUnit);
|
||||||
|
}
|
||||||
gs = new ScalarGridSlice(time, gpi, gdh, data);
|
gs = new ScalarGridSlice(time, gpi, gdh, data);
|
||||||
break;
|
break;
|
||||||
case VECTOR:
|
case VECTOR:
|
||||||
|
@ -483,7 +491,14 @@ public class D2DGridDatabase extends VGridDatabase {
|
||||||
.getGridLoc().getNy());
|
.getGridLoc().getNy());
|
||||||
Grid2DFloat dir = new Grid2DFloat(gpi.getGridLoc().getNx(), gpi
|
Grid2DFloat dir = new Grid2DFloat(gpi.getGridLoc().getNx(), gpi
|
||||||
.getGridLoc().getNy());
|
.getGridLoc().getNy());
|
||||||
getWindGrid(parmId, time, gpi, mag, dir);
|
|
||||||
|
if (this.remap == null) {
|
||||||
|
// GFE domain does not overlap D2D grid, return default grid
|
||||||
|
mag.setAllValues(gpi.getMinValue());
|
||||||
|
dir.setAllValues(0.0f);
|
||||||
|
} else {
|
||||||
|
getWindGrid(parmId, time, gpi, mag, dir);
|
||||||
|
}
|
||||||
gs = new VectorGridSlice(time, gpi, gdh, mag, dir);
|
gs = new VectorGridSlice(time, gpi, gdh, mag, dir);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -511,6 +526,7 @@ public class D2DGridDatabase extends VGridDatabase {
|
||||||
*/
|
*/
|
||||||
private Grid2DFloat getGrid(ParmID parmId, TimeRange time,
|
private Grid2DFloat getGrid(ParmID parmId, TimeRange time,
|
||||||
GridParmInfo gpi, boolean convertUnit) throws GfeException {
|
GridParmInfo gpi, boolean convertUnit) throws GfeException {
|
||||||
|
|
||||||
Grid2DFloat bdata = null;
|
Grid2DFloat bdata = null;
|
||||||
GribRecord d2dRecord = null;
|
GribRecord d2dRecord = null;
|
||||||
|
|
||||||
|
@ -628,6 +644,7 @@ public class D2DGridDatabase extends VGridDatabase {
|
||||||
*/
|
*/
|
||||||
private void getWindGrid(ParmID parmId, TimeRange time, GridParmInfo gpi,
|
private void getWindGrid(ParmID parmId, TimeRange time, GridParmInfo gpi,
|
||||||
Grid2DFloat mag, Grid2DFloat dir) throws GfeException {
|
Grid2DFloat mag, Grid2DFloat dir) throws GfeException {
|
||||||
|
|
||||||
GFEDao dao = null;
|
GFEDao dao = null;
|
||||||
try {
|
try {
|
||||||
dao = (GFEDao) PluginFactory.getInstance().getPluginDao("gfe");
|
dao = (GFEDao) PluginFactory.getInstance().getPluginDao("gfe");
|
||||||
|
|
|
@ -201,14 +201,14 @@ public class NetCDFGridDatabase extends VGridDatabase {
|
||||||
this.outputGloc);
|
this.outputGloc);
|
||||||
|
|
||||||
if (this.subdomain.isEmpty()) {
|
if (this.subdomain.isEmpty()) {
|
||||||
valid = false;
|
statusHandler.warn(this.dbId
|
||||||
throw new GfeException("Unable to create " + this.dbId
|
+ ": GFE domain does not overlap dataset domain.");
|
||||||
+ ". GFE domain does not overlap dataset domain.");
|
this.remap = null;
|
||||||
|
} else {
|
||||||
|
this.remap = new RemapGrid(NetCDFUtils.subGridGL(
|
||||||
|
this.dbId.toString(), this.inputGloc, this.subdomain),
|
||||||
|
this.outputGloc);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.remap = new RemapGrid(NetCDFUtils.subGridGL(
|
|
||||||
this.dbId.toString(), this.inputGloc, this.subdomain),
|
|
||||||
this.outputGloc);
|
|
||||||
loadParms();
|
loadParms();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -584,35 +584,51 @@ public class NetCDFGridDatabase extends VGridDatabase {
|
||||||
GridDataHistory gdh = new GridDataHistory(OriginType.INITIALIZED,
|
GridDataHistory gdh = new GridDataHistory(OriginType.INITIALIZED,
|
||||||
p.getPid(), p.getInv().get(index));
|
p.getPid(), p.getInv().get(index));
|
||||||
|
|
||||||
switch (p.getGpi().getGridType()) {
|
GridParmInfo gpi = p.getGpi();
|
||||||
|
GridLocation gloc = gpi.getGridLoc();
|
||||||
|
|
||||||
|
switch (gpi.getGridType()) {
|
||||||
case SCALAR: {
|
case SCALAR: {
|
||||||
Grid2DFloat data = new Grid2DFloat(getGrid(p.getVarName(),
|
Grid2DFloat data = null;
|
||||||
p.getIndices()[index], p.getLevel(), p.getGpi()
|
if (this.remap == null) {
|
||||||
.getMinValue(), p.getGpi().getMaxValue()));
|
// GFE domain does not overlap D2D grid, return default grid
|
||||||
|
data = new Grid2DFloat(gloc.getNx(), gloc.getNy(),
|
||||||
|
gpi.getMinValue());
|
||||||
|
|
||||||
|
} else {
|
||||||
|
data = new Grid2DFloat(getGrid(p.getVarName(),
|
||||||
|
p.getIndices()[index], p.getLevel(), gpi.getMinValue(),
|
||||||
|
gpi.getMaxValue()));
|
||||||
|
}
|
||||||
if (!data.isValid()) {
|
if (!data.isValid()) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
gs = new ScalarGridSlice(p.getInv().get(index), p.getGpi(),
|
gs = new ScalarGridSlice(p.getInv().get(index), gpi,
|
||||||
Arrays.asList(gdh), data);
|
Arrays.asList(gdh), data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case VECTOR: {
|
case VECTOR: {
|
||||||
Grid2DFloat mag = new Grid2DFloat(p.getGpi().getGridLoc().getNx(),
|
Grid2DFloat mag = new Grid2DFloat(gloc.getNx(), gloc.getNy());
|
||||||
p.getGpi().getGridLoc().getNy());
|
Grid2DFloat dir = new Grid2DFloat(gloc.getNx(), gloc.getNy());
|
||||||
Grid2DFloat dir = new Grid2DFloat(p.getGpi().getGridLoc().getNx(),
|
|
||||||
p.getGpi().getGridLoc().getNy());
|
if (this.remap == null) {
|
||||||
getWindGrid(p.getIndices()[index], p.getLevel(), p.getGpi()
|
// GFE domain does not overlap D2D grid, return default grid
|
||||||
.getMinValue(), p.getGpi().getMaxValue(), mag, dir);
|
mag.setAllValues(gpi.getMinValue());
|
||||||
|
dir.setAllValues(0.0f);
|
||||||
|
} else {
|
||||||
|
getWindGrid(p.getIndices()[index], p.getLevel(),
|
||||||
|
gpi.getMinValue(), gpi.getMaxValue(), mag, dir);
|
||||||
|
}
|
||||||
if (!mag.isValid() || !dir.isValid()) {
|
if (!mag.isValid() || !dir.isValid()) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
gs = new VectorGridSlice(p.getInv().get(index), p.getGpi(),
|
gs = new VectorGridSlice(p.getInv().get(index), gpi,
|
||||||
Arrays.asList(gdh), mag, dir);
|
Arrays.asList(gdh), mag, dir);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
statusHandler.handle(Priority.PROBLEM,
|
statusHandler.handle(Priority.PROBLEM,
|
||||||
"unsupported parm type for: " + p.getGpi());
|
"unsupported parm type for: " + gpi);
|
||||||
}
|
}
|
||||||
|
|
||||||
return gs;
|
return gs;
|
||||||
|
|
|
@ -4,5 +4,9 @@
|
||||||
<key>modelInfo.modelName</key>
|
<key>modelInfo.modelName</key>
|
||||||
<order>0</order>
|
<order>0</order>
|
||||||
</pathKey>
|
</pathKey>
|
||||||
|
<pathKey>
|
||||||
|
<key>modelInfo.level</key>
|
||||||
|
<order>1</order>
|
||||||
|
</pathKey>
|
||||||
</pathKeySet>
|
</pathKeySet>
|
||||||
|
|
||||||
|
|
|
@ -109,20 +109,22 @@ public class HttpClient {
|
||||||
|
|
||||||
private ThreadSafeClientConnManager connManager = null;
|
private ThreadSafeClientConnManager connManager = null;
|
||||||
|
|
||||||
private NetworkStatistics stats = new NetworkStatistics();
|
private final NetworkStatistics stats = new NetworkStatistics();
|
||||||
|
|
||||||
private boolean gzipRequests = false;
|
private boolean gzipRequests = false;
|
||||||
|
|
||||||
private boolean handlingGzipResponses = false;
|
private boolean handlingGzipResponses = false;
|
||||||
|
|
||||||
/** number of requests currently in process by the application per host */
|
/** number of requests currently in process by the application per host */
|
||||||
private Map<String, AtomicInteger> currentRequestsCount = new ConcurrentHashMap<String, AtomicInteger>();
|
private final Map<String, AtomicInteger> currentRequestsCount = new ConcurrentHashMap<String, AtomicInteger>();
|
||||||
|
|
||||||
private HttpClient() {
|
private HttpClient() {
|
||||||
connManager = new ThreadSafeClientConnManager();
|
connManager = new ThreadSafeClientConnManager();
|
||||||
DefaultHttpClient client = new DefaultHttpClient(connManager);
|
DefaultHttpClient client = new DefaultHttpClient(connManager);
|
||||||
|
|
||||||
client.addRequestInterceptor(new HttpRequestInterceptor() {
|
client.addRequestInterceptor(new HttpRequestInterceptor() {
|
||||||
|
|
||||||
|
@Override
|
||||||
public void process(final HttpRequest request,
|
public void process(final HttpRequest request,
|
||||||
final HttpContext context) throws HttpException,
|
final HttpContext context) throws HttpException,
|
||||||
IOException {
|
IOException {
|
||||||
|
@ -138,6 +140,7 @@ public class HttpClient {
|
||||||
});
|
});
|
||||||
|
|
||||||
client.addResponseInterceptor(new HttpResponseInterceptor() {
|
client.addResponseInterceptor(new HttpResponseInterceptor() {
|
||||||
|
@Override
|
||||||
public void process(final HttpResponse response,
|
public void process(final HttpResponse response,
|
||||||
final HttpContext context) throws HttpException,
|
final HttpContext context) throws HttpException,
|
||||||
IOException {
|
IOException {
|
||||||
|
@ -148,6 +151,8 @@ public class HttpClient {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
HttpConnectionParams.setTcpNoDelay(client.getParams(), true);
|
||||||
|
|
||||||
this.client = client;
|
this.client = client;
|
||||||
previousConnectionFailed = false;
|
previousConnectionFailed = false;
|
||||||
}
|
}
|
||||||
|
@ -304,7 +309,7 @@ public class HttpClient {
|
||||||
exc = e;
|
exc = e;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (errorMsg != null && exc != null) {
|
if ((errorMsg != null) && (exc != null)) {
|
||||||
if (tries > retryCount) {
|
if (tries > retryCount) {
|
||||||
previousConnectionFailed = true;
|
previousConnectionFailed = true;
|
||||||
// close/abort connection
|
// close/abort connection
|
||||||
|
@ -350,7 +355,7 @@ public class HttpClient {
|
||||||
private void processResponse(HttpResponse resp,
|
private void processResponse(HttpResponse resp,
|
||||||
IStreamHandler handlerCallback) throws CommunicationException {
|
IStreamHandler handlerCallback) throws CommunicationException {
|
||||||
InputStream is = null;
|
InputStream is = null;
|
||||||
if (resp != null && resp.getEntity() != null) {
|
if ((resp != null) && (resp.getEntity() != null)) {
|
||||||
try {
|
try {
|
||||||
is = resp.getEntity().getContent();
|
is = resp.getEntity().getContent();
|
||||||
handlerCallback.handleStream(is);
|
handlerCallback.handleStream(is);
|
||||||
|
@ -668,8 +673,8 @@ public class HttpClient {
|
||||||
Header ceheader = entity.getContentEncoding();
|
Header ceheader = entity.getContentEncoding();
|
||||||
if (ceheader != null) {
|
if (ceheader != null) {
|
||||||
HeaderElement[] codecs = ceheader.getElements();
|
HeaderElement[] codecs = ceheader.getElements();
|
||||||
for (int i = 0; i < codecs.length; i++) {
|
for (HeaderElement codec : codecs) {
|
||||||
if (codecs[i].getName().equalsIgnoreCase("gzip")) {
|
if (codec.getName().equalsIgnoreCase("gzip")) {
|
||||||
response.setEntity(new GzipDecompressingEntity(response
|
response.setEntity(new GzipDecompressingEntity(response
|
||||||
.getEntity()));
|
.getEntity()));
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -22,6 +22,7 @@ package gov.noaa.nws.ncep.edex.uengine.tasks.profile;
|
||||||
|
|
||||||
import java.awt.Point;
|
import java.awt.Point;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
@ -206,13 +207,15 @@ public class PointIn {// extends ScriptTask {
|
||||||
// arbitrary list of IPersistable could be in any number of data stores
|
// arbitrary list of IPersistable could be in any number of data stores
|
||||||
Map<IDataStore, List<IPersistable>> dataStoreMap = dao
|
Map<IDataStore, List<IPersistable>> dataStoreMap = dao
|
||||||
.getDataStoreMap(objList);
|
.getDataStoreMap(objList);
|
||||||
int rvalIndex = 0;
|
|
||||||
int totalRec = 0;
|
int totalRec = 0;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// list for data records retrieved
|
// map of IPersistable to its IDataRecord. Since objects not
|
||||||
List<IDataRecord> dataRecords = new ArrayList<IDataRecord>(
|
// guaranteed to be in file order have to recreate order after
|
||||||
objects.length);
|
// retrievals done
|
||||||
|
Map<IPersistable, IDataRecord> dataRecords = new HashMap<IPersistable, IDataRecord>(
|
||||||
|
(int) (objects.length * 1.25) + 1);
|
||||||
|
|
||||||
for (Map.Entry<IDataStore, List<IPersistable>> entry : dataStoreMap
|
for (Map.Entry<IDataStore, List<IPersistable>> entry : dataStoreMap
|
||||||
.entrySet()) {
|
.entrySet()) {
|
||||||
|
@ -229,8 +232,13 @@ public class PointIn {// extends ScriptTask {
|
||||||
// retrieve data from this data store
|
// retrieve data from this data store
|
||||||
IDataRecord[] records = dataStore.retrieveGroups(groups,
|
IDataRecord[] records = dataStore.retrieveGroups(groups,
|
||||||
pointRequest);
|
pointRequest);
|
||||||
for (IDataRecord rec : records) {
|
int index = 0;
|
||||||
dataRecords.add(rec);
|
for (IPersistable persist : persistList) {
|
||||||
|
if (index < records.length) {
|
||||||
|
dataRecords.put(persist, records[index++]);
|
||||||
|
} else {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -240,16 +248,19 @@ public class PointIn {// extends ScriptTask {
|
||||||
}
|
}
|
||||||
|
|
||||||
int recordIndex = 0;
|
int recordIndex = 0;
|
||||||
for (IDataRecord record : dataRecords) {
|
for (IPersistable persist : objList) {
|
||||||
float[] data = (float[]) record.getDataObject();
|
IDataRecord record = dataRecords.get(persist);
|
||||||
// note; data.length should be the same as points.size()
|
if (record != null) {
|
||||||
// if(k==0)
|
float[] data = (float[]) record.getDataObject();
|
||||||
// System.out.println("data[] szie="+data.length+
|
// note; data.length should be the same as points.size()
|
||||||
// " parameter group size="+dr.length);
|
// if(k==0)
|
||||||
totalRec += data.length;
|
// System.out.println("data[] szie="+data.length+
|
||||||
for (int pointIndex = 0; pointIndex < data.length; pointIndex++) {
|
// " parameter group size="+dr.length);
|
||||||
float[] pData = rval.get(pointIndex);
|
totalRec += data.length;
|
||||||
pData[recordIndex] = data[pointIndex];
|
for (int pointIndex = 0; pointIndex < data.length; pointIndex++) {
|
||||||
|
float[] pData = rval.get(pointIndex);
|
||||||
|
pData[recordIndex++] = data[pointIndex];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
System.out.println("total points = " + points.size()
|
System.out.println("total points = " + points.size()
|
||||||
|
|
|
@ -662,7 +662,10 @@ class H5pyDataStore(IDataStore.IDataStore):
|
||||||
grp = f['/']
|
grp = f['/']
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
grp = f[name]
|
group=name
|
||||||
|
if not group.startswith('/'):
|
||||||
|
group = '/' + group
|
||||||
|
grp = f[group]
|
||||||
except:
|
except:
|
||||||
raise StorageException("No group " + name + " found")
|
raise StorageException("No group " + name + " found")
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue