VLab Issue #5749 - Replace uE with Thrift Client for ScriptCreator. Added target release.

commit 70b126baaf27a245771db06f716b0dd9e5486de1
Author: Bingfan Yin <Bingfan.Yin@noaa.gov>
Date:   Mon Dec 22 08:05:32 2014 -0500

    Replaced ScriptCreator with ThriftClient.

Change-Id: Id6c9d2f2162e71fffc06a33d95cb38058740170a

Former-commit-id: ee78f3c66c [formerly 70d2508f38 [formerly 68191b07db819d43cfd57cd7091afe1a6447ecf2]]
Former-commit-id: 70d2508f38
Former-commit-id: c0826b6320
This commit is contained in:
Bingfan Yin 2014-12-22 10:44:38 -05:00
parent 07c28f7ed8
commit 3b4cabc53a
15 changed files with 295 additions and 386 deletions

View file

@ -19,17 +19,20 @@ import java.util.GregorianCalendar;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TimeZone;
import com.raytheon.uf.common.dataquery.requests.DbQueryRequest;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint.ConstraintType;
import com.raytheon.uf.common.dataquery.responses.DbQueryResponse;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.common.time.DataTime;
import com.raytheon.uf.viz.core.catalog.LayerProperty;
import com.raytheon.uf.viz.core.catalog.ScriptCreator;
import com.raytheon.uf.viz.core.comm.Connector;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.rsc.ResourceType;
import com.raytheon.uf.viz.core.requests.ThriftClient;
/**
*
@ -40,6 +43,7 @@ import com.raytheon.uf.viz.core.rsc.ResourceType;
* 08/12 #770 Q. Zhou Initial Creation.
* 09/12 #770 Q. Zhou Clean up and change selectedWatch to a collection
* 08/13 #1028 G. Hull rm dependency on viz.rsc.wtch project
* 12/14 ? B. Yin Remove ScriptCreator, use Thrift Client.
* </pre>
*
* @author Q. Zhou
@ -47,6 +51,9 @@ import com.raytheon.uf.viz.core.rsc.ResourceType;
public class ContinuingWatch {
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(ContinuingWatch.class);
/*
* WtchRscDataObj class
*/
@ -147,25 +154,26 @@ public class ContinuingWatch {
metadataMap.put( "reportType",ids );
metadataMap.put( "pluginName", new RequestConstraint("aww") );
HashMap<String, RequestConstraint> queryList = new HashMap<String, RequestConstraint>(metadataMap);
DbQueryRequest request = new DbQueryRequest();
request.setConstraints(metadataMap);
LayerProperty prop = new LayerProperty();
prop.setDesiredProduct(ResourceType.PLAN_VIEW);
prop.setEntryQueryParameters(queryList, false);
prop.setNumberOfImages(15000); // TODO: max # records ?? should we cap this ?
try {
DbQueryResponse response = (DbQueryResponse) ThriftClient.sendRequest(request);
String script = null;
script = ScriptCreator.createScript(prop);
if (script == null)
return null;
for (Map<String, Object> result : response.getResults()) {
Object[] pdoList = Connector.getInstance().connect(script, null, 60000);
for (Object pdo : pdoList) {
for (Object pdo : result.values()) {
awwRecord = (AwwRecord) pdo;
Collection<String> num = getAwwRecord( awwRecord );
if (num != null && !num.isEmpty())
contWatch.addAll( num );
}
}
}
catch (VizException e) {
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(),
e);
}
//Retrieving unique items from the list
Set<String> set = new HashSet<String>(contWatch);

View file

@ -13,28 +13,28 @@ import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import java.util.concurrent.ConcurrentLinkedQueue;
import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.dataquery.requests.DbQueryRequest;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
import com.raytheon.uf.common.dataquery.responses.DbQueryResponse;
import com.raytheon.uf.common.time.DataTime;
import com.raytheon.uf.common.time.TimeRange;
import com.raytheon.uf.viz.core.IDisplayPane;
import com.raytheon.uf.viz.core.IGraphicsTarget;
import com.raytheon.uf.viz.core.IRenderableDisplayChangedListener;
import com.raytheon.uf.viz.core.catalog.LayerProperty;
import com.raytheon.uf.viz.core.catalog.ScriptCreator;
import com.raytheon.uf.viz.core.comm.Connector;
import com.raytheon.uf.viz.core.drawables.IDescriptor;
import com.raytheon.uf.viz.core.drawables.IFrameCoordinator;
import com.raytheon.uf.viz.core.drawables.IRenderableDisplay;
import com.raytheon.uf.viz.core.drawables.PaintProperties;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.requests.ThriftClient;
import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
import com.raytheon.uf.viz.core.rsc.IResourceDataChanged;
import com.raytheon.uf.viz.core.rsc.LoadProperties;
import com.raytheon.uf.viz.core.rsc.ResourceType;
/**
* <pre>
@ -54,6 +54,7 @@ import com.raytheon.uf.viz.core.rsc.ResourceType;
* set frame to LAST and issueRefresh() to force paint (per legacy; TTR 520).
* 06 Feb 2013 #972 G. Hull define on IDescriptor instead of IMapDescriptor
* 06/16/2014 #1136 qzhou remove final for paintInternal, since paintFrame does not work for Graph
* 12/14 ? B. Yin Remove ScriptCreator, use Thrift Client.
* </pre>
*
* @author ghull
@ -754,26 +755,19 @@ public abstract class AbstractNatlCntrsResource<T extends AbstractNatlCntrsReque
HashMap<String, RequestConstraint> queryList = new HashMap<String, RequestConstraint>(
resourceData.getMetadataMap());
LayerProperty prop = new LayerProperty();
prop.setDesiredProduct(ResourceType.PLAN_VIEW);
prop.setEntryQueryParameters(queryList, false);
prop.setNumberOfImages(15000); // TODO: max # records ?? should we cap
// this ?
String script = null;
script = ScriptCreator.createScript(prop);
DbQueryRequest request = new DbQueryRequest();
request.setConstraints(queryList);
if (script == null)
return;
DbQueryResponse response = (DbQueryResponse) ThriftClient.sendRequest(request);
Object[] pdoList = Connector.getInstance().connect(script, null, 60000);
for (Object pdo : pdoList) {
for (Map<String, Object> result : response.getResults()) {
for (Object pdo : result.values()) {
for (IRscDataObject dataObject : processRecord(pdo)) {
newRscDataObjsQueue.add(dataObject);
}
}
}
//
setAllFramesAsPopulated();
}

View file

@ -42,6 +42,8 @@ import org.eclipse.swt.graphics.RGB;
import org.geotools.geometry.jts.ReferencedEnvelope;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
import com.raytheon.uf.common.dataquery.requests.DbQueryRequest;
import com.raytheon.uf.common.dataquery.responses.DbQueryResponse;
import com.raytheon.uf.common.geospatial.MapUtil;
import com.raytheon.uf.common.time.DataTime;
import com.raytheon.uf.common.time.TimeRange;
@ -61,6 +63,7 @@ import com.raytheon.uf.viz.core.drawables.IWireframeShape;
import com.raytheon.uf.viz.core.drawables.PaintProperties;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.map.IMapDescriptor;
import com.raytheon.uf.viz.core.requests.ThriftClient;
import com.raytheon.uf.viz.core.rsc.LoadProperties;
import com.raytheon.viz.core.rsc.jts.JTSCompiler;
import com.raytheon.viz.core.rsc.jts.JTSCompiler.PointStyle;
@ -88,7 +91,7 @@ import com.vividsolutions.jts.io.WKBReader;
* 09/11/12 852 Q. Zhou Modified time string and alignment in drawLabel().
* 02/01/13 972 G. Hull define on NcMapDescriptor instead of IMapDescriptor
* 08/14/13 1028 G. Hull Move to aww project. Use AwwReportType enum.
*
* 12/14 ? B. Yin Remove ScriptCreator, use Thrift Client.
* </pre>
*
* @author mgao
@ -1164,28 +1167,22 @@ public class FFAResource extends AbstractNatlCntrsResource<FFAResourceData, NCMa
HashMap<String, com.raytheon.uf.common.dataquery.requests.RequestConstraint> queryList =
new HashMap<String, com.raytheon.uf.common.dataquery.requests.RequestConstraint>(resourceData.getMetadataMap());
com.raytheon.uf.viz.core.catalog.LayerProperty prop = new com.raytheon.uf.viz.core.catalog.LayerProperty();
prop.setDesiredProduct(com.raytheon.uf.viz.core.rsc.ResourceType.PLAN_VIEW);
prop.setEntryQueryParameters(queryList, false);
prop.setNumberOfImages(15000); // TODO: max # records ?? should we cap this ?
String script = null;
script = com.raytheon.uf.viz.core.catalog.ScriptCreator.createScript(prop);
DbQueryRequest request = new DbQueryRequest();
request.setConstraints(queryList);
if (script == null)
return;
Object[] pdoList = com.raytheon.uf.viz.core.comm.Connector.getInstance().connect(script, null, 60000);
DbQueryResponse response = (DbQueryResponse) ThriftClient.sendRequest(request);
queryResult = new FfaZoneQueryResult();
for (Object pdo : pdoList) {
for (Map<String, Object> result : response.getResults()) {
for (Object pdo : result.values()) {
for( IRscDataObject dataObject : processRecord( pdo ) ) {
newRscDataObjsQueue.add(dataObject);
//FfaRscDataObj frdo=(FfaRscDataObj)dataObject; System.out.println("_______^^^ queryRecords(): action: "+frdo.actionType+ " vtec: "+frdo.vtecline);
queryResult.buildQueryPart2(dataObject);
}
}
}
//TODO: handle EXA, EXB here: add newly extended areas

View file

@ -13,6 +13,7 @@ package gov.noaa.nws.ncep.viz.rsc.aww.svrl;
* 27 May 2010 Uma Josyula Initial creation.
* 01/10/11 Uma Josyula Made changes to preprocess update and event date
* 02/16/2012 555 S. Gurung Added call to setAllFramesAsPopulated() in queryRecords().
* 12/14 ? B. Yin Remove ScriptCreator, use Thrift Client.
* </pre>
*
* @author ujosyula
@ -24,6 +25,7 @@ import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.StringTokenizer;
@ -31,7 +33,9 @@ import org.eclipse.swt.graphics.RGB;
import org.geotools.geometry.jts.ReferencedEnvelope;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
import com.raytheon.uf.common.dataquery.requests.DbQueryRequest;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
import com.raytheon.uf.common.dataquery.responses.DbQueryResponse;
import com.raytheon.uf.common.geospatial.MapUtil;
import com.raytheon.uf.common.time.DataTime;
import com.raytheon.uf.common.time.TimeRange;
@ -41,6 +45,7 @@ import com.raytheon.uf.viz.core.IGraphicsTarget.HorizontalAlignment;
import com.raytheon.uf.viz.core.IGraphicsTarget.LineStyle;
import com.raytheon.uf.viz.core.IGraphicsTarget.TextStyle;
import com.raytheon.uf.viz.core.IGraphicsTarget.VerticalAlignment;
import com.raytheon.uf.viz.core.requests.ThriftClient;
import com.raytheon.uf.viz.core.rsc.LoadProperties;
import com.raytheon.uf.viz.core.catalog.DirectDbQuery;
import com.raytheon.uf.viz.core.catalog.DirectDbQuery.QueryLanguage;
@ -649,26 +654,19 @@ implements INatlCntrsResource, IStationField {
HashMap<String, RequestConstraint> queryList = new HashMap<String, RequestConstraint>(
resourceData.getMetadataMap());
com.raytheon.uf.viz.core.catalog.LayerProperty prop = new com.raytheon.uf.viz.core.catalog.LayerProperty();
prop.setDesiredProduct(com.raytheon.uf.viz.core.rsc.ResourceType.PLAN_VIEW);
prop.setEntryQueryParameters(queryList, false);
prop.setNumberOfImages(15000); // TODO: max # records ?? should we cap
// this ?
String script = null;
script = com.raytheon.uf.viz.core.catalog.ScriptCreator.createScript(prop);
DbQueryRequest request = new DbQueryRequest();
request.setConstraints(queryList);
if (script == null)
return;
DbQueryResponse response = (DbQueryResponse) ThriftClient.sendRequest(request);
Object[] pdoList = com.raytheon.uf.viz.core.comm.Connector.getInstance().connect(script, null, 60000);
for (Object pdo : pdoList) {
for (Map<String, Object> result : response.getResults()) {
for (Object pdo : result.values()) {
for( IRscDataObject dataObject : processRecord( pdo ) ) {
newRscDataObjsQueue.add(dataObject);
scqr.buildeQueryPart(dataObject);
}
}
}
scqr.populateMap();
setAllFramesAsPopulated();

View file

@ -40,7 +40,9 @@ import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.swt.graphics.RGB;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
import com.raytheon.uf.common.dataquery.requests.DbQueryRequest;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
import com.raytheon.uf.common.dataquery.responses.DbQueryResponse;
import com.raytheon.uf.common.time.DataTime;
import com.raytheon.uf.common.time.TimeRange;
import com.raytheon.uf.edex.decodertools.core.LatLonPoint;
@ -58,6 +60,7 @@ import com.raytheon.uf.viz.core.drawables.IWireframeShape;
import com.raytheon.uf.viz.core.drawables.PaintProperties;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.map.IMapDescriptor;
import com.raytheon.uf.viz.core.requests.ThriftClient;
import com.raytheon.uf.viz.core.rsc.LoadProperties;
import com.raytheon.uf.viz.core.rsc.ResourceType;
import com.raytheon.viz.core.rsc.jts.JTSCompiler;
@ -89,6 +92,7 @@ import com.vividsolutions.jts.io.WKBReader;
* 08/12/2013 1021 G. Hull rm CountyResultJob; change to save map of wireframes for each
* county/fips instead of collection for each unique warning/uri.
* 08/14/2013 1028 G. Hull Move to aww project. Use AwwReportType enum.
* 12/14 ? B. Yin Remove ScriptCreator, use Thrift Client.
*
* </pre>
*
@ -435,30 +439,22 @@ public class WarnResource extends
HashMap<String, RequestConstraint> queryList = new HashMap<String, RequestConstraint>(
resourceData.getMetadataMap());
DbQueryRequest request = new DbQueryRequest();
request.setConstraints(queryList);
LayerProperty prop = new LayerProperty();
prop.setDesiredProduct(ResourceType.PLAN_VIEW);
prop.setEntryQueryParameters(queryList, false);
prop.setNumberOfImages(15000); // TODO: max # records ?? should we cap
// this ?
String script = null;
script = ScriptCreator.createScript(prop);
if (script == null)
return;
Object[] pdoList = Connector.getInstance().connect(script, null, 60000);
DbQueryResponse response = (DbQueryResponse) ThriftClient.sendRequest(request);
countyResult = new WarnCountyResult();
for (Object pdo : pdoList) {
for (Map<String, Object> result : response.getResults()) {
for (Object pdo : result.values()) {
for (IRscDataObject dataObject : processRecord(pdo)) {
newRscDataObjsQueue.add(dataObject);
countyResult
.buildQueryPart2(((WarnRscDataObj) dataObject).countyFips);
}
}
}
countyResult.populateMap();
setAllFramesAsPopulated();
}

View file

@ -7,47 +7,6 @@
*/
package gov.noaa.nws.ncep.viz.rsc.aww.wstm;
import java.awt.geom.Rectangle2D;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.Calendar;
import java.util.TimeZone;
import java.awt.Color;
import org.eclipse.swt.graphics.RGB;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
import com.raytheon.uf.viz.core.DrawableString;
import com.raytheon.uf.viz.core.IGraphicsTarget;
import com.raytheon.uf.viz.core.IGraphicsTarget.HorizontalAlignment;
import com.raytheon.uf.viz.core.IGraphicsTarget.LineStyle;
import com.raytheon.uf.viz.core.IGraphicsTarget.TextStyle;
import com.raytheon.uf.viz.core.IGraphicsTarget.VerticalAlignment;
import com.raytheon.uf.viz.core.catalog.DirectDbQuery;
import com.raytheon.uf.viz.core.catalog.LayerProperty;
import com.raytheon.uf.viz.core.catalog.ScriptCreator;
import com.raytheon.uf.viz.core.catalog.DirectDbQuery.QueryLanguage;
import com.raytheon.uf.viz.core.comm.Connector;
import com.raytheon.uf.viz.core.drawables.IFont;
import com.raytheon.uf.viz.core.drawables.IRenderableDisplay;
import com.raytheon.uf.viz.core.drawables.IShadedShape;
import com.raytheon.uf.viz.core.drawables.IWireframeShape;
import com.raytheon.uf.viz.core.drawables.PaintProperties;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.geom.PixelCoordinate;
import com.raytheon.uf.viz.core.map.IMapDescriptor;
import com.raytheon.uf.viz.core.map.MapDescriptor;
import com.raytheon.uf.viz.core.rsc.LoadProperties;
import com.raytheon.uf.viz.core.rsc.ResourceType;
import com.raytheon.uf.edex.decodertools.core.LatLonPoint;
import gov.noaa.nws.ncep.common.dataplugin.aww.AwwFips;
import gov.noaa.nws.ncep.common.dataplugin.aww.AwwRecord;
import gov.noaa.nws.ncep.common.dataplugin.aww.AwwUgc;
@ -62,17 +21,56 @@ import gov.noaa.nws.ncep.viz.rsc.aww.query.WstmQueryResult;
import gov.noaa.nws.ncep.viz.ui.display.NCMapDescriptor;
import gov.noaa.nws.ncep.viz.ui.display.NcDisplayMngr;
import java.awt.Color;
import java.awt.geom.Rectangle2D;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TimeZone;
import org.eclipse.swt.graphics.RGB;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
import com.raytheon.uf.common.dataquery.requests.DbQueryRequest;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
import com.raytheon.uf.common.dataquery.responses.DbQueryResponse;
import com.raytheon.uf.common.time.DataTime;
import com.raytheon.uf.common.time.TimeRange;
import com.raytheon.uf.edex.decodertools.core.LatLonPoint;
import com.raytheon.uf.viz.core.DrawableString;
import com.raytheon.uf.viz.core.IGraphicsTarget;
import com.raytheon.uf.viz.core.IGraphicsTarget.HorizontalAlignment;
import com.raytheon.uf.viz.core.IGraphicsTarget.LineStyle;
import com.raytheon.uf.viz.core.IGraphicsTarget.TextStyle;
import com.raytheon.uf.viz.core.IGraphicsTarget.VerticalAlignment;
import com.raytheon.uf.viz.core.catalog.DirectDbQuery;
import com.raytheon.uf.viz.core.catalog.DirectDbQuery.QueryLanguage;
import com.raytheon.uf.viz.core.comm.Connector;
import com.raytheon.uf.viz.core.drawables.IFont;
import com.raytheon.uf.viz.core.drawables.IShadedShape;
import com.raytheon.uf.viz.core.drawables.IWireframeShape;
import com.raytheon.uf.viz.core.drawables.PaintProperties;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.geom.PixelCoordinate;
import com.raytheon.uf.viz.core.map.IMapDescriptor;
import com.raytheon.uf.viz.core.requests.ThriftClient;
import com.raytheon.uf.viz.core.rsc.LoadProperties;
import com.raytheon.uf.viz.core.rsc.ResourceType;
import com.raytheon.viz.core.rsc.jts.JTSCompiler;
import com.raytheon.viz.core.rsc.jts.JTSCompiler.PointStyle;
import com.raytheon.viz.ui.editor.AbstractEditor;
import com.vividsolutions.jts.geom.Coordinate;
import com.vividsolutions.jts.geom.Geometry;
import com.vividsolutions.jts.geom.Point;
import com.vividsolutions.jts.io.WKBReader;
import com.vividsolutions.jts.io.ParseException;
import com.vividsolutions.jts.io.WKBReader;
/**
@ -90,6 +88,8 @@ import com.vividsolutions.jts.io.ParseException;
* 17 Aug 2012 655 B. Hebbard Added paintProps as parameter to IDisplayable draw
* 31-Jan-2013 976 Archana Updated paintFrame() to not render any null strings
* Replaced the depreciated target.drawString() method with target.drawStrings().
* 12/14 ? B. Yin Remove ScriptCreator, use Thrift Client.
*
* </pre>
*
* @author archana
@ -1206,23 +1206,17 @@ wqr.buildQueryPart(aSetOfAwwFips); wstmRscDataObject.aListOfFipsInfoObjects=crea
HashMap<String, RequestConstraint> queryList = new HashMap<String, RequestConstraint>(
resourceData.getMetadataMap());
LayerProperty prop = new LayerProperty();
prop.setDesiredProduct(ResourceType.PLAN_VIEW);
prop.setEntryQueryParameters(queryList, false);
prop.setNumberOfImages(15000); // TODO: max # records ?? should we cap
// this ?
String script = null;
script = ScriptCreator.createScript(prop);
DbQueryRequest request = new DbQueryRequest();
request.setConstraints(queryList);
if (script == null)
return;
DbQueryResponse response = (DbQueryResponse) ThriftClient.sendRequest(request);
Object[] pdoList = Connector.getInstance().connect(script, null, 60000);
for (Object pdo : pdoList) {
for (Map<String, Object> result : response.getResults()) {
for (Object pdo : result.values()) {
for( IRscDataObject dataObject : processRecord( pdo ) ) {
newRscDataObjsQueue.add(dataObject);
}
}
}
wqr.populateFipsMap();

View file

@ -19,6 +19,7 @@ import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TimeZone;
import java.util.logging.Level;
@ -26,6 +27,8 @@ import java.util.logging.Logger;
import org.eclipse.swt.graphics.RGB;
import com.raytheon.uf.common.dataquery.requests.DbQueryRequest;
import com.raytheon.uf.common.dataquery.responses.DbQueryResponse;
import com.raytheon.uf.common.time.DataTime;
import com.raytheon.uf.common.time.TimeRange;
import com.raytheon.uf.viz.core.IExtent;
@ -38,6 +41,7 @@ import com.raytheon.uf.viz.core.drawables.IFont;
import com.raytheon.uf.viz.core.drawables.IWireframeShape;
import com.raytheon.uf.viz.core.drawables.PaintProperties;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.requests.ThriftClient;
import com.raytheon.uf.viz.core.rsc.LoadProperties;
import com.vividsolutions.jts.geom.Coordinate;
@ -56,6 +60,7 @@ import com.vividsolutions.jts.geom.Coordinate;
* Fixed label colorCode not change problem. Fixed colorCode not change back problem.
* 08/14/13 1028 G. Hull Move to aww project. Use AwwReportType enum.
* 06/27/14 ??? D. Sushon fix endTime selection issue, investigating why watches never display
* 12/14 ? B. Yin Remove ScriptCreator, use Thrift Client.
*
* </pre>
*
@ -742,27 +747,19 @@ public class WtchResource extends
HashMap<String, com.raytheon.uf.common.dataquery.requests.RequestConstraint> queryList = new HashMap<String, com.raytheon.uf.common.dataquery.requests.RequestConstraint>(
resourceData.getMetadataMap());
com.raytheon.uf.viz.core.catalog.LayerProperty prop = new com.raytheon.uf.viz.core.catalog.LayerProperty();
prop.setDesiredProduct(com.raytheon.uf.viz.core.rsc.ResourceType.PLAN_VIEW);
prop.setEntryQueryParameters(queryList, false);
prop.setNumberOfImages(15000);
String script = null;
script = com.raytheon.uf.viz.core.catalog.ScriptCreator
.createScript(prop);
DbQueryRequest request = new DbQueryRequest();
request.setConstraints(queryList);
if (script == null) {
return; // notify something??
}
DbQueryResponse response = (DbQueryResponse) ThriftClient.sendRequest(request);
Object[] pdoList = com.raytheon.uf.viz.core.comm.Connector
.getInstance().connect(script, null, 60000);
for (Object pdo : pdoList) {
for (Map<String, Object> result : response.getResults()) {
for (Object pdo : result.values()) {
for (IRscDataObject dataObject : processRecord(pdo)) {
newRscDataObjsQueue.add(dataObject);
}
}
}
setAllFramesAsPopulated();
}

View file

@ -14,12 +14,15 @@ import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.raytheon.uf.common.dataplugin.HDF5Util;
import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.dataplugin.binlightning.BinLightningRecord;
import com.raytheon.uf.common.dataplugin.binlightning.LightningConstants;
import com.raytheon.uf.common.dataquery.requests.DbQueryRequest;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
import com.raytheon.uf.common.dataquery.responses.DbQueryResponse;
import com.raytheon.uf.common.datastorage.DataStoreFactory;
import com.raytheon.uf.common.datastorage.IDataStore;
import com.raytheon.uf.common.datastorage.Request;
@ -36,13 +39,12 @@ import com.raytheon.uf.common.time.TimeRange;
import com.raytheon.uf.viz.core.IExtent;
import com.raytheon.uf.viz.core.IGraphicsTarget;
import com.raytheon.uf.viz.core.PixelExtent;
import com.raytheon.uf.viz.core.catalog.LayerProperty;
import com.raytheon.uf.viz.core.catalog.ScriptCreator;
import com.raytheon.uf.viz.core.comm.Connector;
import com.raytheon.uf.viz.core.drawables.IWireframeShape;
import com.raytheon.uf.viz.core.drawables.PaintProperties;
import com.raytheon.uf.viz.core.drawables.ResourcePair;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.requests.ThriftClient;
import com.raytheon.uf.viz.core.rsc.LoadProperties;
import com.raytheon.uf.viz.core.rsc.ResourceProperties;
import com.raytheon.uf.viz.core.rsc.ResourceType;
@ -66,7 +68,7 @@ import com.raytheon.uf.viz.core.rsc.ResourceType;
* 12/19/2012 #960 Greg Hull override propertiesChanged() to update colorBar.
* 05/07/2013 #993 Greg Hull change key for strikeMap from URI to the HDF5 group
* Jun 05, 2014 3226 bclement reference datarecords by LightningConstants
*
* 12/19/2014 ? B. Yin Remove ScriptCreator, use Thrift Client.
* </pre>
*
* @author ghull
@ -236,32 +238,15 @@ public class LightningResource extends AbstractNatlCntrsResource<LightningResour
HashMap<String, RequestConstraint> requestConstraints = new HashMap<String, RequestConstraint>(
ltngRscData.getMetadataMap() );
if( queryTimes != null ) {
// This doesn't work because the dataTimes in the DB are time Ranges
// RequestConstraint timeConstraint = new RequestConstraint();
// String[] constraintList = {
// new DataTime( queryTimes.getStart() ).toString(),
// new DataTime( queryTimes.getEnd() ).toString() };
// timeConstraint.setBetweenValueList(constraintList);
// timeConstraint.setConstraintType(RequestConstraint.ConstraintType.BETWEEN);
// requestConstraints.put("dataTime", timeConstraint);
}
DbQueryRequest request = new DbQueryRequest();
request.setConstraints(requestConstraints);
LayerProperty prop = new LayerProperty();
prop.setDesiredProduct(ResourceType.PLAN_VIEW);
prop.setEntryQueryParameters(requestConstraints, false);
prop.setNumberOfImages(15000); // TODO: max # records ?? should we cap this
DbQueryResponse response = (DbQueryResponse) ThriftClient.sendRequest(request);
String script = null;
script = ScriptCreator.createScript(prop);
if (script == null)
return;
Object[] pdoList = Connector.getInstance().connect(script, null, 90000);
ArrayList<Object> pdoArray = new ArrayList<Object>();
for( Object pdo : pdoList ) {
for (Map<String, Object> result : response.getResults()) {
for (Object pdo : result.values()) {
if( !(pdo instanceof PluginDataObject) ) { // ???
continue;
}
@ -273,6 +258,7 @@ public class LightningResource extends AbstractNatlCntrsResource<LightningResour
queryTimes.contains( pdoDataTime.getValidPeriod().getEnd() ) ) {
pdoArray.add( pdo );
}
}
}
List<LtngStrikeDataObj> strikeList = getStrikeDataFromHDF( pdoArray.toArray() );

View file

@ -15,7 +15,9 @@ import java.util.HashMap;
import java.util.Map;
import com.raytheon.uf.common.dataplugin.grid.GridRecord;
import com.raytheon.uf.common.dataquery.requests.DbQueryRequest;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
import com.raytheon.uf.common.dataquery.responses.DbQueryResponse;
import com.raytheon.uf.common.datastorage.DataStoreFactory;
import com.raytheon.uf.common.datastorage.IDataStore;
import com.raytheon.uf.common.datastorage.Request;
@ -27,10 +29,9 @@ import com.raytheon.uf.common.gridcoverage.LatLonGridCoverage;
import com.raytheon.uf.common.gridcoverage.MercatorGridCoverage;
import com.raytheon.uf.common.gridcoverage.PolarStereoGridCoverage;
import com.raytheon.uf.common.time.DataTime;
import com.raytheon.uf.viz.core.catalog.LayerProperty;
import com.raytheon.uf.viz.core.catalog.ScriptCreator;
import com.raytheon.uf.viz.core.comm.Connector;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.requests.ThriftClient;
import com.raytheon.uf.viz.core.rsc.ResourceType;
import com.sun.jna.Native;
import com.sun.jna.ptr.FloatByReference;
@ -79,6 +80,8 @@ import com.sun.jna.ptr.IntByReference;
* made changes for ensemble functionality.
* 10/2011 168 mgamazaychikov added methods to removed dependency on datatype.tbl
* 10/2011 X. Guo Added grib inventory
* 12/14 ? B. Yin Remove ScriptCreator, use Thrift Client.
*
* </pre>
*
* @author tlee
@ -1313,26 +1316,15 @@ public class TestDgdriv {
String fcstTime = Integer
.toString(((Integer.parseInt(fcstTimeg)) * 3600));
if (queryList == null)
return null;
queryList.put("dataTime.refTime", new RequestConstraint(refTime));
queryList.put("dataTime.fcstTime", new RequestConstraint(fcstTime));
LayerProperty prop = new LayerProperty();
prop.setDesiredProduct(ResourceType.PLAN_VIEW);
prop.setEntryQueryParameters(queryList, false);
prop.setNumberOfImages(1);
DbQueryRequest request = new DbQueryRequest();
request.setConstraints(queryList);
String script = null;
script = ScriptCreator.createScript(prop);
DbQueryResponse response = (DbQueryResponse) ThriftClient.sendRequest(request);
if (script == null)
return null;
Object[] pdoList = Connector.getInstance().connect(script, null, 60000);
GridRecord rec = (GridRecord) pdoList[0];
GridRecord rec = (GridRecord) ((Map<String, Object>)response.getResults().get(0)).values().iterator().next();
long t1 = System.currentTimeMillis();
System.out.println("\tgetDataURI took: " + (t1 - t0));
// logger.info("getDataURI took: " + (t1-t0));

View file

@ -15,6 +15,7 @@ import java.io.File;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import javax.measure.Measure;
import javax.measure.quantity.Length;
@ -23,17 +24,18 @@ import javax.measure.unit.NonSI;
import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.dataplugin.radar.RadarRecord;
import com.raytheon.uf.common.dataplugin.radar.util.RadarInfoDict;
import com.raytheon.uf.common.dataquery.requests.DbQueryRequest;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
import com.raytheon.uf.common.dataquery.responses.DbQueryResponse;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.common.time.DataTime;
import com.raytheon.uf.viz.core.catalog.LayerProperty;
import com.raytheon.uf.viz.core.catalog.ScriptCreator;
import com.raytheon.uf.viz.core.comm.Connector;
import com.raytheon.uf.viz.core.drawables.IDescriptor;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.requests.ThriftClient;
import com.raytheon.uf.viz.core.rsc.IResourceDataChanged;
import com.raytheon.uf.viz.core.rsc.LoadProperties;
import com.raytheon.uf.viz.core.rsc.ResourceType;
@ -65,6 +67,7 @@ import com.vividsolutions.jts.geom.Coordinate;
* 06/10/2013 #999 G. Hull rm IDataScaleResource
* 06/16/2014 #2061 bsteffen update IRangeableResource
* 06/18/2014 TTR1026 J. Wu (/bh) Fixed potential exceptions for loading local radar data.
* 12/14 ? B. Yin Remove ScriptCreator, use Thrift Client.
*
* </pre>
*
@ -157,24 +160,18 @@ public abstract class AbstractRadarResource<D extends IDescriptor> extends
queryList.put("dataTime.refTime", reqConstr);
LayerProperty prop = new LayerProperty();
prop.setDesiredProduct(ResourceType.PLAN_VIEW);
prop.setEntryQueryParameters(queryList, false);
prop.setNumberOfImages(15000); // TODO: max # records ?? should we cap
// this ?
String script = null;
script = ScriptCreator.createScript(prop);
DbQueryRequest request = new DbQueryRequest();
request.setConstraints(queryList);
if (script == null)
return;
DbQueryResponse response = (DbQueryResponse) ThriftClient.sendRequest(request);
Object[] pdoList = Connector.getInstance().connect(script, null, 60000);
for (Object pdo : pdoList) {
for (Map<String, Object> result : response.getResults()) {
for (Object pdo : result.values()) {
for (IRscDataObject dataObject : processRecord(pdo)) {
newRscDataObjsQueue.add(dataObject);
}
}
}
// preProcess
}

View file

@ -16,12 +16,15 @@ import java.io.File;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import com.raytheon.uf.common.dataplugin.HDF5Util;
import com.raytheon.uf.common.dataquery.requests.DbQueryRequest;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
import com.raytheon.uf.common.dataquery.responses.DbQueryResponse;
import com.raytheon.uf.common.datastorage.DataStoreFactory;
import com.raytheon.uf.common.datastorage.IDataStore;
import com.raytheon.uf.common.datastorage.Request;
@ -29,13 +32,10 @@ import com.raytheon.uf.common.datastorage.StorageException;
import com.raytheon.uf.common.datastorage.records.IDataRecord;
import com.raytheon.uf.common.time.DataTime;
import com.raytheon.uf.viz.core.IGraphicsTarget;
import com.raytheon.uf.viz.core.catalog.LayerProperty;
import com.raytheon.uf.viz.core.catalog.ScriptCreator;
import com.raytheon.uf.viz.core.comm.Connector;
import com.raytheon.uf.viz.core.drawables.PaintProperties;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.requests.ThriftClient;
import com.raytheon.uf.viz.core.rsc.LoadProperties;
import com.raytheon.uf.viz.core.rsc.ResourceType;
/**
* NtransResource - Resource for Display of NTRANS Metafiles.
@ -57,7 +57,7 @@ import com.raytheon.uf.viz.core.rsc.ResourceType;
* (1) user sees "Initializing..." and (2) GUI doesn't lock up
* 29 Aug 2014 B. Hebbard Remove time string and "/" separator from legend
* 12 Sep 2014 B. Hebbard Refactor to avoid regenerating paintables from CGM on each paint.
*
* 19 Dec 2014 ? B. Yin Remove ScriptCreator, use Thrift Client.
* </pre>
*
* @author bhebbard
@ -307,30 +307,23 @@ public class NtransResource extends
RequestConstraint timeConstraint = new RequestConstraint(cycleTimeStr);
reqConstraintsMap.put("dataTime.refTime", timeConstraint);
LayerProperty prop = new LayerProperty();
prop.setDesiredProduct(ResourceType.PLAN_VIEW);
prop.setEntryQueryParameters(reqConstraintsMap, false);
prop.setNumberOfImages(15000); // TODO: max # records ??
// Should we cap this ?
String script = null;
script = ScriptCreator.createScript(prop);
if (script == null) {
return;
}
DbQueryRequest request = new DbQueryRequest();
request.setConstraints(reqConstraintsMap);
long t0 = System.currentTimeMillis();
Object[] pdoList = Connector.getInstance().connect(script, null, 60000);
DbQueryResponse response = (DbQueryResponse) ThriftClient.sendRequest(request);
long t1 = System.currentTimeMillis();
logger.info("Metadata records for " + this.newRscDataObjsQueue.size()
+ " images retrieved from DB in " + (t1 - t0) + " ms");
for (Object pdo : pdoList) {
for (Map<String, Object> result : response.getResults()) {
for (Object pdo : result.values()) {
for (IRscDataObject dataObject : processRecord(pdo)) {
newRscDataObjsQueue.add(dataObject);
}
}
}
// TODO -- why is this here? Still needed?
setAllFramesAsPopulated();

View file

@ -17,9 +17,6 @@ import com.raytheon.uf.common.dataplugin.satellite.SatelliteRecord;
import com.raytheon.uf.common.dataquery.requests.DbQueryRequest;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
import com.raytheon.uf.common.dataquery.responses.DbQueryResponse;
import com.raytheon.uf.common.geospatial.MapUtil;
import com.raytheon.uf.viz.core.catalog.LayerProperty;
import com.raytheon.uf.viz.core.catalog.ScriptCreator;
import com.raytheon.uf.viz.core.comm.Connector;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.requests.ThriftClient;
@ -56,14 +53,12 @@ public class GiniAreaProviderFactory implements INcAreaProviderFactory {
reqConstraints.put( "creatingEntity", new RequestConstraint( satAndArea[0]) );
reqConstraints.put( "sectorID", new RequestConstraint( satAndArea[1]) );
LayerProperty prop = new LayerProperty();
prop.setDesiredProduct(ResourceType.PLAN_VIEW);
prop.setEntryQueryParameters( reqConstraints, false);
prop.setNumberOfImages(1); // just need 1 record to get the coverage
DbQueryRequest request = new DbQueryRequest();
request.setConstraints(reqConstraints);
String script = ScriptCreator.createScript(prop);
DbQueryResponse response = (DbQueryResponse) ThriftClient.sendRequest(request);
Object[] satRecList = Connector.getInstance().connect( script, null, 10000 );
Object[] satRecList = ((Map<String, Object>)response.getResults().get(0)).values().toArray();
// NOTE: It would be nice to query the mcidas_area_names and/or mcidas_spatial
// directly so that we don't have to depend on data being in the db, but

View file

@ -1,45 +1,31 @@
package gov.noaa.nws.ncep.viz.rsc.satellite.area;
import gov.noaa.nws.ncep.common.dataplugin.mcidas.McidasMapCoverage;
import gov.noaa.nws.ncep.common.dataplugin.mcidas.McidasRecord;
import gov.noaa.nws.ncep.viz.common.area.AreaName;
import gov.noaa.nws.ncep.viz.common.area.AreaName.AreaSource;
import gov.noaa.nws.ncep.viz.common.area.IGridGeometryProvider;
import gov.noaa.nws.ncep.viz.common.area.INcAreaProviderFactory;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.geotools.coverage.grid.GeneralGridEnvelope;
import org.geotools.coverage.grid.GeneralGridGeometry;
import org.geotools.coverage.grid.GridGeometry2D;
import org.geotools.geometry.GeneralEnvelope;
import org.geotools.referencing.CRS;
import org.geotools.referencing.operation.transform.ConcatenatedTransform;
import org.opengis.referencing.operation.MathTransform;
import com.raytheon.uf.common.dataplugin.satellite.SatelliteRecord;
import com.raytheon.uf.common.dataquery.requests.DbQueryRequest;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
import com.raytheon.uf.common.dataquery.responses.DbQueryResponse;
import com.raytheon.uf.common.geospatial.BoundaryTool;
import com.raytheon.uf.common.geospatial.ISpatialObject;
import com.raytheon.uf.common.geospatial.MapUtil;
import com.raytheon.uf.viz.core.catalog.LayerProperty;
import com.raytheon.uf.viz.core.catalog.ScriptCreator;
import com.raytheon.uf.viz.core.comm.Connector;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.requests.ThriftClient;
import com.raytheon.uf.viz.core.rsc.AbstractRequestableResourceData;
import com.raytheon.uf.viz.core.rsc.ResourceType;
import com.vividsolutions.jts.geom.Polygon;
import gov.noaa.nws.ncep.common.dataplugin.mcidas.McidasMapCoverage;
import gov.noaa.nws.ncep.common.dataplugin.mcidas.McidasRecord;
import gov.noaa.nws.ncep.viz.common.area.AreaName.AreaSource;
import gov.noaa.nws.ncep.viz.common.area.AreaName;
import gov.noaa.nws.ncep.viz.common.area.IGridGeometryProvider;
import gov.noaa.nws.ncep.viz.common.area.INcAreaProviderFactory;
import gov.noaa.nws.ncep.viz.common.area.PredefinedAreaFactory;
import gov.noaa.nws.ncep.viz.common.display.NcDisplayType;
public class McIdasAreaProviderFactory implements INcAreaProviderFactory {
@ -72,14 +58,12 @@ public class McIdasAreaProviderFactory implements INcAreaProviderFactory {
reqConstraints.put( "satelliteName", new RequestConstraint( satAndArea[0]) );
reqConstraints.put( "areaName", new RequestConstraint( satAndArea[1]) );
LayerProperty prop = new LayerProperty();
prop.setDesiredProduct(ResourceType.PLAN_VIEW);
prop.setEntryQueryParameters( reqConstraints, false);
prop.setNumberOfImages(1); // just need 1 record to get the coverage
DbQueryRequest request = new DbQueryRequest();
request.setConstraints(reqConstraints);
String script = ScriptCreator.createScript(prop);
DbQueryResponse response = (DbQueryResponse) ThriftClient.sendRequest(request);
Object[] satRecList = Connector.getInstance().connect( script, null, 10000 );
Object[] satRecList = ((Map<String, Object>)response.getResults().get(0)).values().toArray();
// NOTE: It would be nice to query the mcidas_area_names and/or mcidas_spatial
// directly so that we don't have to depend on data being in the db, but

View file

@ -7,37 +7,10 @@
*/
package gov.noaa.nws.ncep.viz.rsc.stormtrack.rsc;
import java.awt.geom.Rectangle2D;
import java.text.SimpleDateFormat;
import java.util.HashMap;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collection;
import java.util.Collections;
import java.util.Date;
import java.util.EnumMap;
import java.util.List;
import java.util.Map;
import java.util.TimeZone;
import java.util.TreeSet;
import javax.measure.unit.NonSI;
import gov.noaa.nws.ncep.common.dataplugin.stormtrack.StormTrackRecord;
import gov.noaa.nws.ncep.gempak.parameters.colorbar.ColorBarAnchorLocation;
import gov.noaa.nws.ncep.gempak.parameters.colorbar.ColorBarOrientation;
import gov.noaa.nws.ncep.viz.common.ui.NmapCommon;
import gov.noaa.nws.ncep.viz.resources.AbstractNatlCntrsResource;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint.ConstraintType;
import com.raytheon.uf.common.time.DataTime;
import gov.noaa.nws.ncep.viz.resources.AbstractNatlCntrsRequestableResourceData.TimeMatchMethod;
import gov.noaa.nws.ncep.viz.resources.AbstractNatlCntrsResource;
import gov.noaa.nws.ncep.viz.resources.INatlCntrsResource;
import gov.noaa.nws.ncep.viz.resources.AbstractNatlCntrsResource.IRscDataObject;
import gov.noaa.nws.ncep.viz.resources.colorBar.ColorBarResource;
import gov.noaa.nws.ncep.viz.resources.colorBar.ColorBarResourceData;
import gov.noaa.nws.ncep.viz.resources.manager.ResourceName;
@ -45,14 +18,32 @@ import gov.noaa.nws.ncep.viz.rsc.stormtrack.rsc.StormTrackResourceData.ModelDisp
import gov.noaa.nws.ncep.viz.ui.display.ColorBar;
import gov.noaa.nws.ncep.viz.ui.display.NCMapDescriptor;
import java.awt.geom.Rectangle2D;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.TreeSet;
import javax.measure.unit.NonSI;
import org.eclipse.swt.graphics.RGB;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
import com.raytheon.uf.common.dataquery.requests.DbQueryRequest;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint.ConstraintType;
import com.raytheon.uf.common.dataquery.responses.DbQueryResponse;
import com.raytheon.uf.common.time.DataTime;
import com.raytheon.uf.edex.decodertools.core.LatLonPoint;
import com.raytheon.uf.viz.core.IExtent;
import com.raytheon.uf.viz.core.IGraphicsTarget;
import com.raytheon.uf.viz.core.PixelExtent;
import com.raytheon.uf.viz.core.IGraphicsTarget.HorizontalAlignment;
import com.raytheon.uf.viz.core.IGraphicsTarget.TextStyle;
import com.raytheon.uf.viz.core.IGraphicsTarget.VerticalAlignment;
import com.raytheon.uf.viz.core.catalog.LayerProperty;
import com.raytheon.uf.viz.core.catalog.ScriptCreator;
import com.raytheon.uf.viz.core.PixelExtent;
import com.raytheon.uf.viz.core.comm.Connector;
import com.raytheon.uf.viz.core.drawables.IFont;
import com.raytheon.uf.viz.core.drawables.IWireframeShape;
@ -60,15 +51,10 @@ import com.raytheon.uf.viz.core.drawables.PaintProperties;
import com.raytheon.uf.viz.core.drawables.ResourcePair;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.geom.PixelCoordinate;
import com.raytheon.uf.viz.core.map.IMapDescriptor;
import com.raytheon.uf.viz.core.requests.ThriftClient;
import com.raytheon.uf.viz.core.rsc.LoadProperties;
import com.raytheon.uf.viz.core.rsc.ResourceProperties;
import com.raytheon.uf.viz.core.rsc.ResourceType;
import com.raytheon.uf.edex.decodertools.core.LatLonPoint;
import org.eclipse.swt.graphics.RGB;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
import com.vividsolutions.jts.geom.Coordinate;
import com.vividsolutions.jts.geom.CoordinateList;
@ -95,6 +81,7 @@ import com.vividsolutions.jts.geom.CoordinateList;
* 10/15/2012 858 Greg Hull add options to display forecastHour, modelName, windSpeed and cycloneId
* 10/20/2012 858 Greg Hull change query to handle the ENS_CYC_FCST version of this resource
* 12/19/2012 #960 Greg Hull override propertiesChanged() to update colorBar.
* 12/19/2014 ? B. Yin Remove ScriptCreator, use Thrift Client.
*
* @author sgilbert
*</pre>
@ -274,19 +261,12 @@ implements INatlCntrsResource{
metadataMap.put( "model", reqConstr );
LayerProperty prop = new LayerProperty();
prop.setDesiredProduct( ResourceType.PLAN_VIEW);
DbQueryRequest request = new DbQueryRequest();
request.setConstraints(metadataMap);
prop.setEntryQueryParameters( metadataMap, false );
prop.setNumberOfImages(100000); // TODO: max # records ?? should we cap
// this ?
String script = null;
script = ScriptCreator.createScript(prop);
DbQueryResponse response = (DbQueryResponse) ThriftClient.sendRequest(request);
if (script == null)
return;
Object[] pdoList = Connector.getInstance().connect(script, null, 120000);
Object[] pdoList = ((Map<String, Object>)response.getResults().get(0)).values().toArray();
// This could really be considered an error. If the limit is reached then this probably
// took too long and the calling resource should be making its own query for data.

View file

@ -47,6 +47,7 @@ import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TimeZone;
import java.util.TreeSet;
@ -61,7 +62,9 @@ import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.dataquery.requests.DbQueryRequest;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
import com.raytheon.uf.common.dataquery.responses.DbQueryResponse;
import com.raytheon.uf.common.geospatial.ReferencedCoordinate;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
@ -74,11 +77,10 @@ import com.raytheon.uf.viz.core.IGraphicsTarget;
import com.raytheon.uf.viz.core.PixelCoverage;
import com.raytheon.uf.viz.core.PixelExtent;
import com.raytheon.uf.viz.core.RGBColors;
import com.raytheon.uf.viz.core.catalog.LayerProperty;
import com.raytheon.uf.viz.core.catalog.ScriptCreator;
import com.raytheon.uf.viz.core.comm.Connector;
import com.raytheon.uf.viz.core.drawables.PaintProperties;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.requests.ThriftClient;
import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
import com.raytheon.uf.viz.core.rsc.IInputHandler;
import com.raytheon.uf.viz.core.rsc.IInputHandler.InputPriority;
@ -117,6 +119,7 @@ import com.vividsolutions.jts.geom.Coordinate;
* 07/03/2014 R4079 qzhou Added k-index view.
* 07/10/2014 R4079 qzhou Added SamplingView and Sampling related classes.
* 07/28/2014 R4078 sgurung Added code changes to support loading GeoMagResource in a new window.
* 12/19/2014 ? B. Yin Remove ScriptCreator, use Thrift Client.
* </pre>
*
* @author qzhou
@ -446,21 +449,15 @@ public class GeoMagResource extends
queryList.put("dataTime.refTime", reqConstr);
LayerProperty prop = new LayerProperty();
prop.setDesiredProduct(ResourceType.PLAN_VIEW);
prop.setEntryQueryParameters(queryList, false);
prop.setNumberOfImages(100000);
DbQueryRequest request = new DbQueryRequest();
request.setConstraints(queryList);
String script = null;
script = ScriptCreator.createScript(prop);
if (script == null)
return;
DbQueryResponse response = (DbQueryResponse) ThriftClient.sendRequest(request);
magRecords = new ArrayList<GeoMagRecord>();
Object[] pdoList = Connector.getInstance().connect(script, null, 60000);
for (Object pdo : pdoList) {
for (Map<String, Object> result : response.getResults()) {
for (Object pdo : result.values()) {
for (IRscDataObject dataObject : processRecord(pdo)) {
newRscDataObjsQueue.add(dataObject);
magRecords
@ -468,6 +465,7 @@ public class GeoMagResource extends
.getPDO());
}
}
}
sortRecord();
data = loadInternal(magRecords);