Issue #2277 Switched DataCubeContainer calls to not use ScriptCreator
Amend: Added comments as requested Change-Id: Ib787d43638f20babfc7f89ce2eac958e31d21c3c Former-commit-id:3509baaa74
[formerly8a500677d3
] [formerlyb633f9987a
] [formerly3509baaa74
[formerly8a500677d3
] [formerlyb633f9987a
] [formerly2d1db7d0e2
[formerlyb633f9987a
[formerly efb402d2835f715143cddffeec2bd7c20d0a65f6]]]] Former-commit-id:2d1db7d0e2
Former-commit-id:70c91ed24b
[formerly1bdef4ddd3
] [formerly c6fb597995ca49d9e40c0fe52f6d3e660affe671 [formerly61e6dd1316
]] Former-commit-id: c7d9f743abf7aa67f2754beecdece51254dec003 [formerly66d023227d
] Former-commit-id:1a466db041
This commit is contained in:
parent
9ceee65bea
commit
76be1e8862
62 changed files with 501 additions and 1123 deletions
|
@ -29,6 +29,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
||||
import com.raytheon.uf.common.dataplugin.acarssounding.ACARSSoundingLayer;
|
||||
import com.raytheon.uf.common.dataplugin.acarssounding.ACARSSoundingRecord;
|
||||
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
|
||||
|
@ -42,8 +43,6 @@ 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.wxmath.ZToPsa;
|
||||
import com.raytheon.uf.viz.core.catalog.ScriptCreator;
|
||||
import com.raytheon.uf.viz.core.comm.Loader;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.derivparam.library.DerivedParameterGenerator;
|
||||
import com.raytheon.viz.pointdata.util.AbstractPointDataInventory;
|
||||
|
@ -64,6 +63,7 @@ import com.raytheon.viz.pointdata.util.PointDataCubeAdapter;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Sep 26, 2012 bsteffen Initial javadoc
|
||||
* Aug 14, 2013 2262 dgilling Use new wxmath method for ztopsa.
|
||||
* Sep 9, 2013 2277 mschenke Got rid of ScriptCreator references
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -143,36 +143,34 @@ public class ACARSSoundingDataCubeAdapter extends PointDataCubeAdapter {
|
|||
public PointDataContainer getBaseRecords(Collection<String> baseParameters,
|
||||
Map<String, RequestConstraint> queryParams) throws VizException {
|
||||
List<String> baseParams = new ArrayList<String>(baseParameters);
|
||||
String script = ScriptCreator.createScript(queryParams, 1000, "select");
|
||||
List<Object> respList = Loader.loadData(script, 60000);
|
||||
ACARSSoundingRecord[] records = new ACARSSoundingRecord[respList.size()];
|
||||
for (int i = 0; i < records.length; i++) {
|
||||
records[i] = (ACARSSoundingRecord) respList.get(i);
|
||||
}
|
||||
|
||||
PluginDataObject[] pdos = getData(queryParams, null);
|
||||
int numRecords = pdos.length;
|
||||
|
||||
Object[] vals = new Object[baseParams.size()];
|
||||
for (int i = 0; i < baseParams.size(); i++) {
|
||||
String parameter = baseParams.get(i);
|
||||
if (REFTIME.equals(parameter)) {
|
||||
vals[i] = new long[records.length];
|
||||
vals[i] = new long[numRecords];
|
||||
} else if (FORECASTHR.equals(parameter)) {
|
||||
vals[i] = new int[records.length];
|
||||
vals[i] = new int[numRecords];
|
||||
} else if (NUMLEVELS.equals(parameter)) {
|
||||
vals[i] = new int[records.length];
|
||||
vals[i] = new int[numRecords];
|
||||
} else if (STATIONID.equals(parameter)) {
|
||||
vals[i] = new String[records.length];
|
||||
vals[i] = new String[numRecords];
|
||||
} else if (DATAURI.equals(parameter)) {
|
||||
vals[i] = new String[records.length];
|
||||
vals[i] = new String[numRecords];
|
||||
} else if (TAILNUMBER.equals(parameter)) {
|
||||
vals[i] = new String[records.length];
|
||||
vals[i] = new String[numRecords];
|
||||
} else {
|
||||
vals[i] = new float[records.length][];
|
||||
vals[i] = new float[numRecords][];
|
||||
}
|
||||
}
|
||||
int[] ids = new int[records.length];
|
||||
float[] latitudes = new float[records.length];
|
||||
float[] longitudes = new float[records.length];
|
||||
for (int i = 0; i < records.length; i++) {
|
||||
ACARSSoundingRecord record = records[i];
|
||||
int[] ids = new int[numRecords];
|
||||
float[] latitudes = new float[numRecords];
|
||||
float[] longitudes = new float[numRecords];
|
||||
for (int i = 0; i < numRecords; i++) {
|
||||
ACARSSoundingRecord record = (ACARSSoundingRecord) pdos[i];
|
||||
latitudes[i] = record.getLocation().getLatitude().floatValue();
|
||||
longitudes[i] = record.getLocation().getLongitude().floatValue();
|
||||
ids[i] = record.getId();
|
||||
|
@ -189,19 +187,19 @@ public class ACARSSoundingDataCubeAdapter extends PointDataCubeAdapter {
|
|||
if (baseParams.contains(STATIONID)) {
|
||||
int j = baseParams.indexOf(STATIONID);
|
||||
String[] data = (String[]) vals[j];
|
||||
data[i] = records[i].getLocation().getStationId();
|
||||
data[i] = record.getLocation().getStationId();
|
||||
}
|
||||
if (baseParams.contains(DATAURI)) {
|
||||
int j = baseParams.indexOf(DATAURI);
|
||||
String[] data = (String[]) vals[j];
|
||||
data[i] = records[i].getDataURI();
|
||||
data[i] = record.getDataURI();
|
||||
}
|
||||
// TODO currently it is necessary to remove duplicate flight levels
|
||||
// and pressure values to avoid errors in interpolation when
|
||||
// calculating values at rounded numbers(500mb) however it is not
|
||||
// good to be discarding random data
|
||||
Set<ACARSSoundingLayer> uniqueLayers = new HashSet<ACARSSoundingLayer>();
|
||||
Set<ACARSSoundingLayer> allLayers = records[i].getLevels();
|
||||
Set<ACARSSoundingLayer> allLayers = record.getLevels();
|
||||
List<Integer> levels = new ArrayList<Integer>();
|
||||
List<Integer> pressures = new ArrayList<Integer>();
|
||||
for (ACARSSoundingLayer layer : allLayers) {
|
||||
|
@ -298,8 +296,8 @@ public class ACARSSoundingDataCubeAdapter extends PointDataCubeAdapter {
|
|||
maxLength = val[j].length;
|
||||
}
|
||||
}
|
||||
float[] newValues = new float[maxLength * records.length];
|
||||
for (int j = 0; j < records.length; j++) {
|
||||
float[] newValues = new float[maxLength * numRecords];
|
||||
for (int j = 0; j < numRecords; j++) {
|
||||
for (int k = 0; k < maxLength; k++) {
|
||||
if (val[j] != null && val[j].length > k) {
|
||||
newValues[j * maxLength + k] = val[j][k];
|
||||
|
@ -309,7 +307,7 @@ public class ACARSSoundingDataCubeAdapter extends PointDataCubeAdapter {
|
|||
}
|
||||
}
|
||||
dataRecords[i] = new FloatDataRecord(baseParams.get(i), "",
|
||||
newValues, 2, new long[] { maxLength, records.length });
|
||||
newValues, 2, new long[] { maxLength, numRecords });
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -43,7 +43,6 @@ import com.raytheon.uf.common.pointdata.PointDataView;
|
|||
import com.raytheon.uf.common.time.BinOffset;
|
||||
import com.raytheon.uf.common.time.DataTime;
|
||||
import com.raytheon.uf.viz.core.catalog.DirectDbQuery;
|
||||
import com.raytheon.uf.viz.core.catalog.LayerProperty;
|
||||
import com.raytheon.uf.viz.core.datastructure.IDataCubeAdapter;
|
||||
import com.raytheon.uf.viz.core.datastructure.VizDataCubeException;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
|
@ -54,7 +53,7 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
|
||||
/**
|
||||
*
|
||||
* TODO Add Description
|
||||
* {@link IDataCubeAdapter} for coop precip data
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
|
@ -65,6 +64,7 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
* Dec 3, 2010 bsteffen Initial creation
|
||||
* Aug 14,2012 #1055 dgilling Fix getData regression from
|
||||
* fxatext schema changes.
|
||||
* Sep 9, 2013 #2277 mschenke Got rid of ScriptCreator references
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -388,40 +388,35 @@ public class CoopPrecipDataCubeAdapter implements IDataCubeAdapter {
|
|||
@Override
|
||||
public IDataRecord[] getRecord(PluginDataObject obj)
|
||||
throws VizDataCubeException {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IDataRecord[] getRecord(PluginDataObject obj, Request req,
|
||||
String dataset) throws VizDataCubeException {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getRecords(List<PluginDataObject> objs, Request req,
|
||||
String dataset) throws VizDataCubeException {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Object> getData(LayerProperty property, int timeOut)
|
||||
public PluginDataObject[] getData(
|
||||
Map<String, RequestConstraint> constraints, DataTime[] selectedTimes)
|
||||
throws VizException {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initInventory() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getInventory() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
@ -40,7 +40,6 @@ import com.raytheon.uf.common.datastorage.records.IDataRecord;
|
|||
import com.raytheon.uf.common.pointdata.PointDataContainer;
|
||||
import com.raytheon.uf.common.time.BinOffset;
|
||||
import com.raytheon.uf.common.time.DataTime;
|
||||
import com.raytheon.uf.viz.core.catalog.LayerProperty;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
|
||||
/**
|
||||
|
@ -55,6 +54,7 @@ import com.raytheon.uf.viz.core.exception.VizException;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jul 22, 2008 brockwoo Initial creation
|
||||
* Sep 9, 2013 2277 mschenke Got rid of ScriptCreator references
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -323,24 +323,46 @@ public class DataCubeContainer {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns a list of responses for the requested layer property. If a
|
||||
* derived parameter, this will piece together the base parameteters.
|
||||
* Returns {@link PluginDataObject}s for the specified request constraints
|
||||
*
|
||||
* @param property
|
||||
* The layer property to request
|
||||
* @param timeOut
|
||||
* A timeout period for the request to EDEX
|
||||
* @return A list of responses
|
||||
* @param constraints
|
||||
* @return
|
||||
* @throws VizException
|
||||
*/
|
||||
public static List<Object> getData(LayerProperty property, int timeOut)
|
||||
public static PluginDataObject[] getData(
|
||||
Map<String, RequestConstraint> constraints) throws VizException {
|
||||
return getData(constraints, (DataTime[]) null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns {@link PluginDataObject}s for the specified request constraints
|
||||
* and selected time
|
||||
*
|
||||
* @param constraints
|
||||
* @return
|
||||
* @throws VizException
|
||||
*/
|
||||
public static PluginDataObject[] getData(
|
||||
Map<String, RequestConstraint> constraints, DataTime time)
|
||||
throws VizException {
|
||||
// Regular layer
|
||||
HashMap<String, RequestConstraint> originalQuery = property
|
||||
.getEntryQueryParameters(false);
|
||||
String pluginName = originalQuery.get("pluginName")
|
||||
return getData(constraints, time != null ? new DataTime[] { time }
|
||||
: null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns {@link PluginDataObject}s for the specified request constraints
|
||||
* and selected times
|
||||
*
|
||||
* @param constraints
|
||||
* @return
|
||||
* @throws VizException
|
||||
*/
|
||||
public static PluginDataObject[] getData(
|
||||
Map<String, RequestConstraint> constraints, DataTime[] times)
|
||||
throws VizException {
|
||||
String pluginName = constraints.get(PluginDataObject.PLUGIN_NAME_ID)
|
||||
.getConstraintValue();
|
||||
return getInstance(pluginName).adapter.getData(property, timeOut);
|
||||
return getInstance(pluginName).adapter.getData(constraints, times);
|
||||
}
|
||||
|
||||
public static Object getInventory(String plugin) {
|
||||
|
@ -349,7 +371,8 @@ public class DataCubeContainer {
|
|||
|
||||
public static List<Map<String, RequestConstraint>> getBaseUpdateConstraints(
|
||||
Map<String, RequestConstraint> constraints) {
|
||||
RequestConstraint pluginRC = constraints.get("pluginName");
|
||||
RequestConstraint pluginRC = constraints
|
||||
.get(PluginDataObject.PLUGIN_NAME_ID);
|
||||
String plugin = null;
|
||||
if (pluginRC != null
|
||||
&& pluginRC.getConstraintType() == ConstraintType.EQUALS) {
|
||||
|
|
|
@ -24,16 +24,16 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
|
||||
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.requests.RequestConstraint.ConstraintType;
|
||||
import com.raytheon.uf.common.dataquery.requests.TimeQueryRequest;
|
||||
import com.raytheon.uf.common.dataquery.requests.TimeQueryRequestSet;
|
||||
import com.raytheon.uf.common.dataquery.responses.DbQueryResponse;
|
||||
import com.raytheon.uf.common.datastorage.Request;
|
||||
import com.raytheon.uf.common.datastorage.records.IDataRecord;
|
||||
import com.raytheon.uf.common.pointdata.PointDataContainer;
|
||||
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.Loader;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.requests.ThriftClient;
|
||||
|
||||
|
@ -47,8 +47,8 @@ import com.raytheon.uf.viz.core.requests.ThriftClient;
|
|||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Dec 7, 2011 mschenke Initial creation
|
||||
*
|
||||
* Dec 7, 2011 mschenke Initial creation
|
||||
* Sep 9, 2013 2277 mschenke Got rid of ScriptCreator references
|
||||
* </pre>
|
||||
*
|
||||
* @author mschenke
|
||||
|
@ -188,14 +188,32 @@ public class DefaultDataCubeAdapter implements IDataCubeAdapter {
|
|||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.uf.viz.core.datastructure.IDataCubeAdapter#getData(com.raytheon
|
||||
* .uf.viz.core.catalog.LayerProperty, int)
|
||||
* com.raytheon.uf.viz.core.datastructure.IDataCubeAdapter#getData(java.
|
||||
* util.Map, com.raytheon.uf.common.time.DataTime[])
|
||||
*/
|
||||
@Override
|
||||
public List<Object> getData(LayerProperty property, int timeOut)
|
||||
public PluginDataObject[] getData(
|
||||
Map<String, RequestConstraint> constraints, DataTime[] selectedTimes)
|
||||
throws VizException {
|
||||
String scriptToExecute = ScriptCreator.createScript(property);
|
||||
return Loader.loadScripts(new String[] { scriptToExecute }, timeOut);
|
||||
DbQueryRequest request = new DbQueryRequest(constraints);
|
||||
if (selectedTimes != null && selectedTimes.length > 0) {
|
||||
RequestConstraint timeConstraint = new RequestConstraint();
|
||||
if (selectedTimes.length == 1) {
|
||||
timeConstraint.setConstraintType(ConstraintType.EQUALS);
|
||||
timeConstraint.setConstraintValue(selectedTimes[0].toString());
|
||||
} else {
|
||||
timeConstraint.setConstraintType(ConstraintType.IN);
|
||||
String[] times = new String[selectedTimes.length];
|
||||
for (int i = 0; i < times.length; ++i) {
|
||||
times[i] = selectedTimes[i].toString();
|
||||
}
|
||||
timeConstraint.setConstraintValueList(times);
|
||||
}
|
||||
request.addConstraint(PluginDataObject.DATATIME_ID, timeConstraint);
|
||||
}
|
||||
DbQueryResponse response = (DbQueryResponse) ThriftClient
|
||||
.sendRequest(request);
|
||||
return response.getEntityObjects(PluginDataObject.class);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -206,7 +224,6 @@ public class DefaultDataCubeAdapter implements IDataCubeAdapter {
|
|||
*/
|
||||
@Override
|
||||
public void initInventory() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
|
@ -218,7 +235,6 @@ public class DefaultDataCubeAdapter implements IDataCubeAdapter {
|
|||
*/
|
||||
@Override
|
||||
public Object getInventory() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,6 @@ import com.raytheon.uf.common.datastorage.Request;
|
|||
import com.raytheon.uf.common.datastorage.records.IDataRecord;
|
||||
import com.raytheon.uf.common.pointdata.PointDataContainer;
|
||||
import com.raytheon.uf.common.time.DataTime;
|
||||
import com.raytheon.uf.viz.core.catalog.LayerProperty;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
|
||||
/**
|
||||
|
@ -131,18 +130,19 @@ public interface IDataCubeAdapter {
|
|||
String dataset) throws VizDataCubeException;
|
||||
|
||||
/**
|
||||
* Builds a list of responses for the specified LayerPropterty. This
|
||||
* includes looking at the derived parameter library and determining if any
|
||||
* derived parameter satisfies the request. The list should contain the
|
||||
* record type the is expected by the resource. For example, a GribRecord
|
||||
* would be returned from a GRIB IDataCubeAdapter instance.
|
||||
* Builds an array of {@link PluginDataObject}s for the specified metadata
|
||||
* map and times. This includes looking at the derived parameter library and
|
||||
* determining if any derived parameter satisfies the request. The list
|
||||
* should contain the record type the is expected by the resource. For
|
||||
* example, a GribRecord would be returned from a GRIB IDataCubeAdapter
|
||||
* instance.
|
||||
*
|
||||
* @param property
|
||||
* the layer property
|
||||
* @return A list of records that are expected by the resource
|
||||
* @param request
|
||||
* @return
|
||||
* @throws VizException
|
||||
*/
|
||||
public List<Object> getData(LayerProperty property, int timeOut)
|
||||
public PluginDataObject[] getData(
|
||||
Map<String, RequestConstraint> constraints, DataTime[] selectedTimes)
|
||||
throws VizException;
|
||||
|
||||
/**
|
||||
|
|
|
@ -23,6 +23,7 @@ import java.lang.reflect.Array;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
|
@ -41,6 +42,7 @@ import com.raytheon.uf.common.dataplugin.PluginException;
|
|||
import com.raytheon.uf.common.dataplugin.annotations.DataURIUtil;
|
||||
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
|
||||
import com.raytheon.uf.common.dataquery.requests.RequestableMetadataMarshaller;
|
||||
import com.raytheon.uf.common.dataquery.requests.TimeQueryRequest;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
|
@ -49,13 +51,13 @@ import com.raytheon.uf.common.time.DataTime;
|
|||
import com.raytheon.uf.viz.core.RecordFactory;
|
||||
import com.raytheon.uf.viz.core.alerts.AbstractAlertMessageParser;
|
||||
import com.raytheon.uf.viz.core.alerts.AlertMessage;
|
||||
import com.raytheon.uf.viz.core.catalog.LayerProperty;
|
||||
import com.raytheon.uf.viz.core.comm.Loader;
|
||||
import com.raytheon.uf.viz.core.datastructure.DataCubeContainer;
|
||||
import com.raytheon.uf.viz.core.drawables.IDescriptor;
|
||||
import com.raytheon.uf.viz.core.exception.NoDataAvailableException;
|
||||
import com.raytheon.uf.viz.core.exception.NoMatchingTimesException;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.requests.ThriftClient;
|
||||
import com.raytheon.uf.viz.core.rsc.IResourceDataChanged.ChangeType;
|
||||
|
||||
/**
|
||||
|
@ -492,10 +494,7 @@ public abstract class AbstractRequestableResourceData extends
|
|||
*/
|
||||
protected PluginDataObject[] requestPluginDataObjects(
|
||||
Collection<DataTime> loadSet) throws VizException {
|
||||
LayerProperty property = new LayerProperty();
|
||||
// TODO fix?
|
||||
property.setDesiredProduct(ResourceType.PLAN_VIEW);
|
||||
// property.setDesiredProduct("Imagery");
|
||||
Map<String, RequestConstraint> constraints = getMetadataMap();
|
||||
|
||||
BinOffset binOffset = getBinOffset();
|
||||
|
||||
|
@ -503,14 +502,12 @@ public abstract class AbstractRequestableResourceData extends
|
|||
|
||||
if (binOffset == null) {
|
||||
// Just ask for the data
|
||||
property.setEntryQueryParameters(getMetadataMap(), false);
|
||||
property.setNumberOfImages(9999);
|
||||
selectedEntryTimes = new ArrayList<DataTime>(loadSet);
|
||||
} else {
|
||||
property.setEntryQueryParameters(getMetadataMap(), true);
|
||||
property.setNumberOfImages(9999);
|
||||
// Find all the actual datatimes for the bins
|
||||
DataTime[] allDataTimes = property.getAllEntryTimes();
|
||||
// Find all the actual datatimes for the bins. TODO: Better way to
|
||||
// do this? Construct time range for each datatime in loadSet and
|
||||
// request data in that range?
|
||||
DataTime[] allDataTimes = getAvailableTimes(constraints, null);
|
||||
List<DataTime> trueDataTimes = new ArrayList<DataTime>();
|
||||
|
||||
for (DataTime realDataTime : allDataTimes) {
|
||||
|
@ -526,8 +523,6 @@ public abstract class AbstractRequestableResourceData extends
|
|||
selectedEntryTimes = trueDataTimes;
|
||||
}
|
||||
|
||||
Object[] resp = null;
|
||||
|
||||
ArrayList<PluginDataObject> responses = new ArrayList<PluginDataObject>(
|
||||
selectedEntryTimes.size());
|
||||
|
||||
|
@ -539,21 +534,13 @@ public abstract class AbstractRequestableResourceData extends
|
|||
}
|
||||
List<DataTime> slice = selectedEntryTimes.subList(start, end);
|
||||
|
||||
property.setSelectedEntryTimes(slice.toArray(new DataTime[slice
|
||||
.size()]));
|
||||
|
||||
resp = DataCubeContainer.getData(property, 60000).toArray(
|
||||
new Object[] {});
|
||||
for (Object o : resp) {
|
||||
responses.add((PluginDataObject) o);
|
||||
}
|
||||
PluginDataObject[] pdos = DataCubeContainer.getData(
|
||||
getMetadataMap(), slice.toArray(new DataTime[0]));
|
||||
responses.addAll(Arrays.asList(pdos));
|
||||
}
|
||||
|
||||
PluginDataObject[] arr = responses
|
||||
.toArray(new PluginDataObject[responses.size()]);
|
||||
|
||||
Arrays.sort(arr, layerComparator);
|
||||
return arr;
|
||||
Collections.sort(responses, layerComparator);
|
||||
return responses.toArray(new PluginDataObject[0]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -601,12 +588,8 @@ public abstract class AbstractRequestableResourceData extends
|
|||
Map<String, RequestConstraint> constraintMap, BinOffset binOffset)
|
||||
throws VizException {
|
||||
Validate.notNull(constraintMap);
|
||||
LayerProperty property = new LayerProperty();
|
||||
|
||||
property.setDesiredProduct(ResourceType.PLAN_VIEW);
|
||||
property.setEntryQueryParameters(constraintMap, true, binOffset);
|
||||
DataTime[] availableTimes = property.getEntryTimes();
|
||||
return availableTimes;
|
||||
return DataCubeContainer.performTimeQuery(constraintMap, false,
|
||||
binOffset);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -28,13 +28,6 @@
|
|||
renderingOrderId="IMAGE_LOCAL"
|
||||
resourceType="PLAN_VIEW"/>
|
||||
</extension>
|
||||
<extension
|
||||
point="com.raytheon.uf.viz.core.scriptTemplate">
|
||||
<scriptTemplate
|
||||
pluginName="cwat"
|
||||
scriptLibrary="BaseRequest">
|
||||
</scriptTemplate>
|
||||
</extension>
|
||||
|
||||
<!-- for making CWAT available on Localization Perspective in CAVE: 2012-05-14 from DHladky -->
|
||||
|
||||
|
|
|
@ -46,10 +46,8 @@ import com.raytheon.uf.common.geospatial.MapUtil;
|
|||
import com.raytheon.uf.common.geospatial.PointUtil;
|
||||
import com.raytheon.uf.common.gridcoverage.GridCoverage;
|
||||
import com.raytheon.uf.common.time.DataTime;
|
||||
import com.raytheon.uf.viz.core.catalog.LayerProperty;
|
||||
import com.raytheon.uf.viz.core.datastructure.DataCubeContainer;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.rsc.ResourceType;
|
||||
import com.raytheon.uf.viz.xy.InterpUtils;
|
||||
import com.raytheon.uf.viz.xy.crosssection.adapter.AbstractCrossSectionAdapter;
|
||||
import com.raytheon.uf.viz.xy.crosssection.display.CrossSectionDescriptor;
|
||||
|
@ -72,7 +70,8 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
* in the data array for anything
|
||||
* below 300MB for RUC80.
|
||||
* Oct 2, 2012 DR 15259 M.Porricelli Allow plotting when 3 levels
|
||||
* available (DGEX)
|
||||
* available (DGEX)
|
||||
* Sep 9, 2013 2277 mschenke Got rid of ScriptCreator references
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -362,17 +361,11 @@ public class GridCSAdapter extends AbstractCrossSectionAdapter<GridRecord> {
|
|||
new RequestConstraint(descriptor.getHeightScale()
|
||||
.getParameter()));
|
||||
|
||||
LayerProperty property = new LayerProperty();
|
||||
property.setDesiredProduct(ResourceType.PLAN_VIEW);
|
||||
|
||||
property.setEntryQueryParameters(metadataMap, false);
|
||||
property.setNumberOfImages(9999);
|
||||
property.setSelectedEntryTimes(new DataTime[] { time });
|
||||
|
||||
List<Object> recs = DataCubeContainer.getData(property, 60000);
|
||||
yRecords = new HashSet<GridRecord>(recs.size());
|
||||
for (Object obj : recs) {
|
||||
yRecords.add((GridRecord) obj);
|
||||
PluginDataObject[] pdos = DataCubeContainer.getData(metadataMap,
|
||||
time);
|
||||
yRecords = new HashSet<GridRecord>(pdos.length);
|
||||
for (PluginDataObject pdo : pdos) {
|
||||
yRecords.add((GridRecord) pdo);
|
||||
}
|
||||
this.yRecords.put(time, yRecords);
|
||||
if (yRecords.isEmpty()) {
|
||||
|
|
|
@ -46,10 +46,8 @@ 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.datastructure.DataCubeContainer;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.rsc.ResourceType;
|
||||
import com.raytheon.uf.viz.xy.InterpUtils;
|
||||
import com.raytheon.uf.viz.xy.varheight.adapter.AbstractVarHeightAdapter;
|
||||
import com.raytheon.viz.core.graphing.xy.XYData;
|
||||
|
@ -66,7 +64,8 @@ import com.raytheon.viz.grid.inv.GridInventory;
|
|||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* May 7, 2010 bsteffen Initial creation
|
||||
* May 7, 2010 bsteffen Initial creation
|
||||
* Sep 9, 2013 2277 mschenke Got rid of ScriptCreator references
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -373,24 +372,16 @@ public class GridVarHeightAdapter extends AbstractVarHeightAdapter<GridRecord> {
|
|||
}
|
||||
}
|
||||
|
||||
if (times.size() > 0) {
|
||||
if (times.isEmpty() == false) {
|
||||
Map<String, RequestConstraint> metadataMap = new HashMap<String, RequestConstraint>(
|
||||
resourceData.getMetadataMap());
|
||||
metadataMap.put(GridInventory.PARAMETER_QUERY,
|
||||
new RequestConstraint(heightScale.getParameter()));
|
||||
|
||||
LayerProperty property = new LayerProperty();
|
||||
property.setDesiredProduct(ResourceType.PLAN_VIEW);
|
||||
|
||||
property.setEntryQueryParameters(metadataMap, false);
|
||||
property.setNumberOfImages(9999);
|
||||
property.setSelectedEntryTimes(times.toArray(new DataTime[times
|
||||
.size()]));
|
||||
|
||||
List<Object> recs = DataCubeContainer.getData(property, 60000);
|
||||
|
||||
for (Object obj : recs) {
|
||||
GridRecord gRecord = (GridRecord) obj;
|
||||
PluginDataObject[] pdos = DataCubeContainer.getData(metadataMap,
|
||||
times.toArray(new DataTime[0]));
|
||||
for (PluginDataObject pdo : pdos) {
|
||||
GridRecord gRecord = (GridRecord) pdo;
|
||||
Set<GridRecord> recordSet = yRecordMap.get(gRecord
|
||||
.getDataTime());
|
||||
if (recordSet != null) {
|
||||
|
|
|
@ -37,10 +37,8 @@ import com.raytheon.uf.common.dataquery.responses.DbQueryResponse;
|
|||
import com.raytheon.uf.common.dataquery.responses.DbQueryResponseSet;
|
||||
import com.raytheon.uf.common.datastorage.Request;
|
||||
import com.raytheon.uf.common.datastorage.records.IDataRecord;
|
||||
import com.raytheon.uf.common.pointdata.PointDataContainer;
|
||||
import com.raytheon.uf.common.time.DataTime;
|
||||
import com.raytheon.uf.viz.core.catalog.LayerProperty;
|
||||
import com.raytheon.uf.viz.core.datastructure.IDataCubeAdapter;
|
||||
import com.raytheon.uf.viz.core.datastructure.DefaultDataCubeAdapter;
|
||||
import com.raytheon.uf.viz.core.datastructure.VizDataCubeException;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.requests.ThriftClient;
|
||||
|
@ -69,11 +67,12 @@ import com.raytheon.uf.viz.derivparam.tree.AbstractRequestableNode;
|
|||
* @version 1.0
|
||||
*/
|
||||
|
||||
public abstract class AbstractDataCubeAdapter implements IDataCubeAdapter {
|
||||
public abstract class AbstractDataCubeAdapter extends DefaultDataCubeAdapter {
|
||||
|
||||
private String[] supportedPlugins;
|
||||
|
||||
protected AbstractDataCubeAdapter(String[] supportedPlugins) {
|
||||
super(null);
|
||||
this.supportedPlugins = supportedPlugins;
|
||||
}
|
||||
|
||||
|
@ -181,49 +180,19 @@ public abstract class AbstractDataCubeAdapter implements IDataCubeAdapter {
|
|||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.uf.viz.core.datastructure.IDataCubeAdapter#getPoints(java
|
||||
* .lang.String, java.lang.String[], java.util.Map)
|
||||
* com.raytheon.uf.viz.core.datastructure.IDataCubeAdapter#getData(java.
|
||||
* util.Map, com.raytheon.uf.common.time.DataTime[])
|
||||
*/
|
||||
@Override
|
||||
public PointDataContainer getPoints(String plugin, String[] parameters,
|
||||
Map<String, RequestConstraint> queryParams) throws VizException {
|
||||
// TODO Someday we should put objective analysis code
|
||||
// into this area
|
||||
return null;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.uf.viz.core.datastructure.IDataCubeAdapter#getPoints(java
|
||||
* .lang.String, java.lang.String[], java.lang.String, java.util.Map)
|
||||
*/
|
||||
@Override
|
||||
public PointDataContainer getPoints(String plugin, String[] parameters,
|
||||
String levelKey, Map<String, RequestConstraint> queryParams)
|
||||
public PluginDataObject[] getData(
|
||||
Map<String, RequestConstraint> constraints, DataTime[] selectedTimes)
|
||||
throws VizException {
|
||||
// TODO Someday we should put objective analysis code
|
||||
// into this area
|
||||
return null;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.uf.viz.core.datastructure.IDataCubeAdapter#getData(com.raytheon
|
||||
* .uf.viz.core.catalog.LayerProperty, int)
|
||||
*/
|
||||
@Override
|
||||
public List<Object> getData(LayerProperty property, int timeOut)
|
||||
throws VizException {
|
||||
List<AbstractRequestableNode> requests = evaluateRequestConstraints(property
|
||||
.getEntryQueryParameters(false));
|
||||
List<AbstractRequestableNode> requests = evaluateRequestConstraints(new HashMap<String, RequestConstraint>(
|
||||
constraints));
|
||||
Set<TimeAndSpace> availability = null;
|
||||
if (property.getSelectedEntryTime() != null) {
|
||||
if (selectedTimes != null) {
|
||||
availability = new HashSet<TimeAndSpace>();
|
||||
for (DataTime time : property.getSelectedEntryTime()) {
|
||||
for (DataTime time : selectedTimes) {
|
||||
availability.add(new TimeAndSpace(time));
|
||||
}
|
||||
} else {
|
||||
|
@ -232,8 +201,8 @@ public abstract class AbstractDataCubeAdapter implements IDataCubeAdapter {
|
|||
|
||||
// pull the actual results from the cache
|
||||
List<AbstractRequestableData> requesters = new ArrayList<AbstractRequestableData>();
|
||||
MetadataContainer container = createMetadataContainer(property
|
||||
.getEntryQueryParameters(false));
|
||||
MetadataContainer container = createMetadataContainer(new HashMap<String, RequestConstraint>(
|
||||
constraints));
|
||||
for (AbstractRequestableNode request : requests) {
|
||||
container.prepareRequests(request, availability);
|
||||
}
|
||||
|
@ -241,7 +210,8 @@ public abstract class AbstractDataCubeAdapter implements IDataCubeAdapter {
|
|||
requesters.addAll(container.getData(request, availability));
|
||||
}
|
||||
|
||||
return getData(property, requesters);
|
||||
return getData(constraints, selectedTimes, requesters).toArray(
|
||||
new PluginDataObject[0]);
|
||||
}
|
||||
|
||||
protected MetadataContainer createMetadataContainer(
|
||||
|
@ -255,21 +225,6 @@ public abstract class AbstractDataCubeAdapter implements IDataCubeAdapter {
|
|||
return new AvailabilityContainer(constraints);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.uf.viz.core.datastructure.IDataCubeAdapter#
|
||||
* getBaseUpdateConstraints(java.util.Map)
|
||||
*/
|
||||
@Override
|
||||
public List<Map<String, RequestConstraint>> getBaseUpdateConstraints(
|
||||
Map<String, RequestConstraint> constraints) {
|
||||
List<Map<String, RequestConstraint>> result = new ArrayList<Map<String, RequestConstraint>>(
|
||||
1);
|
||||
result.add(constraints);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
|
@ -321,6 +276,8 @@ public abstract class AbstractDataCubeAdapter implements IDataCubeAdapter {
|
|||
* @param requesters
|
||||
* @return
|
||||
*/
|
||||
protected abstract List<Object> getData(LayerProperty property,
|
||||
List<AbstractRequestableData> requesters) throws VizException;
|
||||
protected abstract List<PluginDataObject> getData(
|
||||
Map<String, RequestConstraint> constraints,
|
||||
DataTime[] selectedTimes, List<AbstractRequestableData> requesters)
|
||||
throws VizException;
|
||||
}
|
||||
|
|
|
@ -33,7 +33,6 @@ import com.raytheon.uf.common.datastorage.records.IDataRecord;
|
|||
import com.raytheon.uf.common.pointdata.PointDataContainer;
|
||||
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.datastructure.CubeUtil;
|
||||
import com.raytheon.uf.viz.core.datastructure.VizDataCubeException;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
|
@ -196,13 +195,16 @@ public class VIIRSDataCubeAdapter extends AbstractDataCubeAdapter {
|
|||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.uf.viz.derivparam.data.AbstractDataCubeAdapter#getData(com
|
||||
* .raytheon.uf.viz.core.catalog.LayerProperty, java.util.List)
|
||||
* com.raytheon.uf.viz.derivparam.data.AbstractDataCubeAdapter#getData(java
|
||||
* .util.Map, com.raytheon.uf.common.time.DataTime[], java.util.List)
|
||||
*/
|
||||
@Override
|
||||
protected List<Object> getData(LayerProperty property,
|
||||
List<AbstractRequestableData> requesters) throws VizException {
|
||||
List<Object> results = new ArrayList<Object>(requesters.size());
|
||||
protected List<PluginDataObject> getData(
|
||||
Map<String, RequestConstraint> constraints,
|
||||
DataTime[] selectedTimes, List<AbstractRequestableData> requesters)
|
||||
throws VizException {
|
||||
List<PluginDataObject> results = new ArrayList<PluginDataObject>(
|
||||
requesters.size());
|
||||
for (AbstractRequestableData requester : requesters) {
|
||||
List<VIIRSDataRecord> baseRecords = new ArrayList<VIIRSDataRecord>();
|
||||
findBaseRecords(requester, baseRecords);
|
||||
|
@ -258,7 +260,8 @@ public class VIIRSDataCubeAdapter extends AbstractDataCubeAdapter {
|
|||
getBaseUpdateConstraints(baseConstraints, d.node);
|
||||
}
|
||||
} else if (!node.isConstant()) {
|
||||
// If everything is working correctly than this is dead code, but it is here just in case I missed something.
|
||||
// If everything is working correctly than this is dead code, but it
|
||||
// is here just in case I missed something.
|
||||
Activator.statusHandler.handle(Priority.WARN, this.getClass()
|
||||
.getSimpleName()
|
||||
+ " cannot determine base constraints for "
|
||||
|
|
|
@ -35,11 +35,9 @@ import javax.xml.bind.annotation.XmlElement;
|
|||
|
||||
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
||||
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 com.raytheon.uf.common.time.TimeRange;
|
||||
import com.raytheon.uf.common.time.util.TimeUtil;
|
||||
import com.raytheon.uf.viz.core.catalog.LayerProperty;
|
||||
import com.raytheon.uf.viz.core.datastructure.DataCubeContainer;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.rsc.AbstractRequestableResourceData;
|
||||
|
@ -100,23 +98,15 @@ public abstract class AbstractNppResourceData extends
|
|||
DataTime last = timesToLoad.get(timesToLoad.size() - 1);
|
||||
Map<String, RequestConstraint> requestMap = new HashMap<String, RequestConstraint>(
|
||||
getMetadataMap());
|
||||
RequestConstraint timeConst = new RequestConstraint();
|
||||
timeConst.setConstraintType(ConstraintType.BETWEEN);
|
||||
timeConst
|
||||
.setBetweenValueList(new String[] {
|
||||
TimeUtil.formatToSqlTimestamp(first.getValidPeriod()
|
||||
.getStart()),
|
||||
TimeUtil.formatToSqlTimestamp(last.getValidPeriod()
|
||||
.getEnd()) });
|
||||
requestMap.put("dataTime.refTime", timeConst);
|
||||
requestMap.put(
|
||||
"dataTime.refTime",
|
||||
new RequestConstraint(TimeUtil.formatToSqlTimestamp(first
|
||||
.getValidPeriod().getStart()), TimeUtil
|
||||
.formatToSqlTimestamp(last.getValidPeriod().getEnd())));
|
||||
|
||||
LayerProperty property = new LayerProperty();
|
||||
property.setEntryQueryParameters(requestMap, false);
|
||||
property.setNumberOfImages(Integer.MAX_VALUE);
|
||||
|
||||
List<Object> pdos = DataCubeContainer.getData(property, 60000);
|
||||
PluginDataObject[] pdos = DataCubeContainer.getData(requestMap);
|
||||
List<PluginDataObject> finalList = new ArrayList<PluginDataObject>(
|
||||
pdos != null ? pdos.size() : 0);
|
||||
pdos != null ? pdos.length : 0);
|
||||
|
||||
if (pdos != null) {
|
||||
for (Object obj : pdos) {
|
||||
|
|
|
@ -27,13 +27,6 @@
|
|||
recordClass="com.raytheon.uf.common.dataplugin.preciprate.PrecipRateRecord"
|
||||
renderingOrderId="IMAGE_LOCAL"
|
||||
resourceType="PLAN_VIEW"/>
|
||||
</extension>
|
||||
<extension
|
||||
point="com.raytheon.uf.viz.core.scriptTemplate">
|
||||
<scriptTemplate
|
||||
pluginName="preciprate"
|
||||
scriptLibrary="BaseRequest">
|
||||
</scriptTemplate>
|
||||
</extension>
|
||||
<extension
|
||||
point="com.raytheon.uf.viz.productbrowser.dataDefinition">
|
||||
|
|
|
@ -28,14 +28,7 @@
|
|||
renderingOrderId="CONTOUR"
|
||||
resourceType="PLAN_VIEW"/>
|
||||
</extension>
|
||||
<extension
|
||||
point="com.raytheon.uf.viz.core.scriptTemplate">
|
||||
<scriptTemplate
|
||||
pluginName="qpf"
|
||||
scriptLibrary="BaseRequest">
|
||||
</scriptTemplate>
|
||||
</extension>
|
||||
|
||||
|
||||
<extension
|
||||
point="com.raytheon.uf.viz.productbrowser.dataDefinition">
|
||||
<dataDefinition
|
||||
|
|
|
@ -1,71 +0,0 @@
|
|||
/**
|
||||
* This software was developed and / or modified by Raytheon Company,
|
||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
*
|
||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
* This software product contains export-restricted data whose
|
||||
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
* to non-U.S. persons whether in the United States or abroad requires
|
||||
* an export license or other authorization.
|
||||
*
|
||||
* Contractor Name: Raytheon Company
|
||||
* Contractor Address: 6825 Pine Street, Suite 340
|
||||
* Mail Stop B8
|
||||
* Omaha, NE 68106
|
||||
* 402.291.0100
|
||||
*
|
||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.uf.viz.sounding.providers;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
||||
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
|
||||
import com.raytheon.uf.common.sounding.adapter.IVerticalSoundingProvider;
|
||||
import com.raytheon.uf.common.time.DataTime;
|
||||
import com.raytheon.uf.viz.core.catalog.LayerProperty;
|
||||
import com.raytheon.uf.viz.core.datastructure.DataCubeContainer;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
|
||||
/**
|
||||
* Abstract {@link IVerticalSoundingProvider} that uses {@link PluginDataObject}
|
||||
* s for sounding creation
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jul 26, 2013 2190 mschenke Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author mschenke
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public abstract class AbstractPDOVerticalSoundingProvider extends
|
||||
AbstractVerticalSoundingProvider<PluginDataObject[]> {
|
||||
|
||||
@Override
|
||||
protected PluginDataObject[] queryForData(
|
||||
Map<String, RequestConstraint> constraints, DataTime time,
|
||||
Coordinate location) {
|
||||
try {
|
||||
LayerProperty props = new LayerProperty();
|
||||
props.setEntryTimes(new DataTime[] { time });
|
||||
props.setSelectedEntryTimes(new DataTime[] { time });
|
||||
props.setEntryQueryParameters(constraints, false);
|
||||
return DataCubeContainer.getData(props, Integer.MAX_VALUE).toArray(
|
||||
new PluginDataObject[0]);
|
||||
} catch (VizException e) {
|
||||
throw new RuntimeException("Error querying for sounding records: "
|
||||
+ constraints, e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -30,15 +30,18 @@ import org.opengis.referencing.operation.TransformException;
|
|||
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
||||
import com.raytheon.uf.common.dataplugin.bufrua.UAObs;
|
||||
import com.raytheon.uf.common.dataplugin.bufrua.UAObsAdapter;
|
||||
import com.raytheon.uf.common.dataplugin.bufrua.dao.BufrUAPointDataTransform;
|
||||
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
|
||||
import com.raytheon.uf.common.dataquery.requests.TimeQueryRequest;
|
||||
import com.raytheon.uf.common.geospatial.MapUtil;
|
||||
import com.raytheon.uf.common.pointdata.PointDataContainer;
|
||||
import com.raytheon.uf.common.sounding.SoundingLayer;
|
||||
import com.raytheon.uf.common.sounding.VerticalSounding;
|
||||
import com.raytheon.uf.common.sounding.adapter.IVerticalSoundingProvider;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
import com.raytheon.uf.common.time.BinOffset;
|
||||
import com.raytheon.uf.common.time.DataTime;
|
||||
import com.raytheon.uf.viz.core.datastructure.DataCubeContainer;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.requests.ThriftClient;
|
||||
import com.raytheon.uf.viz.sounding.Activator;
|
||||
|
@ -55,7 +58,8 @@ import com.vividsolutions.jts.index.strtree.STRtree;
|
|||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jul 22, 2013 2190 mschenke Initial creation
|
||||
* Jul 22, 2013 2190 mschenke Initial creation
|
||||
* Sep 9, 2013 2277 mschenke Got rid of ScriptCreator references
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -63,7 +67,8 @@ import com.vividsolutions.jts.index.strtree.STRtree;
|
|||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class BufruaSoundingProvider extends AbstractPDOVerticalSoundingProvider {
|
||||
public class BufruaSoundingProvider extends
|
||||
AbstractVerticalSoundingProvider<PluginDataObject[]> {
|
||||
|
||||
private static final double MAX_MOUSE_DISTANCE_DEG = 5.0;
|
||||
|
||||
|
@ -73,7 +78,7 @@ public class BufruaSoundingProvider extends AbstractPDOVerticalSoundingProvider
|
|||
protected DataTime[] queryForSoundingTimes(
|
||||
Map<String, RequestConstraint> constraints) {
|
||||
TimeQueryRequest request = new TimeQueryRequest();
|
||||
request.setPluginName("bufrua");
|
||||
request.setPluginName(UAObs.PLUGIN_NAME);
|
||||
request.setBinOffset(new BinOffset(3600, 3600));
|
||||
request.setQueryTerms(constraints);
|
||||
try {
|
||||
|
@ -85,6 +90,31 @@ public class BufruaSoundingProvider extends AbstractPDOVerticalSoundingProvider
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.uf.viz.sounding.providers.AbstractVerticalSoundingProvider
|
||||
* #queryForData(java.util.Map, com.raytheon.uf.common.time.DataTime,
|
||||
* com.vividsolutions.jts.geom.Coordinate)
|
||||
*/
|
||||
@Override
|
||||
protected PluginDataObject[] queryForData(
|
||||
Map<String, RequestConstraint> constraints, DataTime time,
|
||||
Coordinate location) {
|
||||
try {
|
||||
constraints.put(PluginDataObject.DATATIME_ID,
|
||||
new RequestConstraint(time.toString()));
|
||||
PointDataContainer pdc = DataCubeContainer.getPointData(
|
||||
UAObs.PLUGIN_NAME, BufrUAPointDataTransform.MAN_PARAMS,
|
||||
constraints);
|
||||
return BufrUAPointDataTransform.toUAObsRecords(pdc);
|
||||
} catch (VizException e) {
|
||||
throw new RuntimeException("Error querying for sounding records: "
|
||||
+ constraints, e);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
|
|
|
@ -49,6 +49,7 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
|
|||
import com.raytheon.uf.common.time.DataTime;
|
||||
import com.raytheon.uf.viz.core.datastructure.DataCubeContainer;
|
||||
import com.raytheon.uf.viz.core.datastructure.VizDataCubeException;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.viz.core.map.GeoUtil;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
|
||||
|
@ -69,7 +70,8 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class GridSoundingProvider extends AbstractPDOVerticalSoundingProvider {
|
||||
public class GridSoundingProvider extends
|
||||
AbstractVerticalSoundingProvider<PluginDataObject[]> {
|
||||
|
||||
private static final String PARAM_TEMP = "T";
|
||||
|
||||
|
@ -172,6 +174,26 @@ public class GridSoundingProvider extends AbstractPDOVerticalSoundingProvider {
|
|||
new RequestConstraint(Level.getInvalidLevelValueAsString()));
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.uf.viz.sounding.providers.AbstractVerticalSoundingProvider
|
||||
* #queryForData(java.util.Map, com.raytheon.uf.common.time.DataTime,
|
||||
* com.vividsolutions.jts.geom.Coordinate)
|
||||
*/
|
||||
@Override
|
||||
protected PluginDataObject[] queryForData(
|
||||
Map<String, RequestConstraint> constraints, DataTime time,
|
||||
Coordinate location) {
|
||||
try {
|
||||
return DataCubeContainer.getData(constraints, time);
|
||||
} catch (VizException e) {
|
||||
throw new RuntimeException("Error querying for sounding records: "
|
||||
+ constraints, e);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
|
|
|
@ -24,7 +24,6 @@ import java.util.Collection;
|
|||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.TimeZone;
|
||||
|
@ -39,7 +38,6 @@ import com.raytheon.uf.common.time.msgs.GetServerTimeRequest;
|
|||
import com.raytheon.uf.common.time.msgs.GetServerTimeResponse;
|
||||
import com.raytheon.uf.viz.core.RecordFactory;
|
||||
import com.raytheon.uf.viz.core.alerts.AlertMessage;
|
||||
import com.raytheon.uf.viz.core.catalog.LayerProperty;
|
||||
import com.raytheon.uf.viz.core.datastructure.DataCubeContainer;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.requests.ThriftClient;
|
||||
|
@ -103,22 +101,14 @@ public class ThinClientDataUpdateTree extends DataUpdateTree {
|
|||
metadata = new HashMap<String, RequestConstraint>(metadata);
|
||||
metadata.put("insertTime", new RequestConstraint(time,
|
||||
ConstraintType.GREATER_THAN));
|
||||
LayerProperty property = new LayerProperty();
|
||||
try {
|
||||
property.setEntryQueryParameters(metadata, false);
|
||||
List<Object> records = DataCubeContainer.getData(property,
|
||||
60000);
|
||||
if (records != null && !records.isEmpty()) {
|
||||
for (Object record : records) {
|
||||
if (record instanceof PluginDataObject) {
|
||||
PluginDataObject pdo = (PluginDataObject) record;
|
||||
AlertMessage am = new AlertMessage();
|
||||
am.dataURI = pdo.getDataURI();
|
||||
am.decodedAlert = RecordFactory.getInstance()
|
||||
.loadMapFromUri(am.dataURI);
|
||||
messages.add(am);
|
||||
}
|
||||
}
|
||||
PluginDataObject[] pdos = DataCubeContainer.getData(metadata);
|
||||
for (PluginDataObject pdo : pdos) {
|
||||
AlertMessage am = new AlertMessage();
|
||||
am.dataURI = pdo.getDataURI();
|
||||
am.decodedAlert = RecordFactory.getInstance()
|
||||
.loadMapFromUri(am.dataURI);
|
||||
messages.add(am);
|
||||
}
|
||||
} catch (VizException e) {
|
||||
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(),
|
||||
|
|
|
@ -28,11 +28,4 @@
|
|||
renderingOrderId="IMAGE_LOCAL"
|
||||
resourceType="PLAN_VIEW"/>
|
||||
</extension>
|
||||
<extension
|
||||
point="com.raytheon.uf.viz.core.scriptTemplate">
|
||||
<scriptTemplate
|
||||
pluginName="vil"
|
||||
scriptLibrary="BaseRequest">
|
||||
</scriptTemplate>
|
||||
</extension>
|
||||
</plugin>
|
|
@ -62,13 +62,6 @@
|
|||
commandId="com.raytheon.viz.aviation.openavnconfig">
|
||||
</handler>
|
||||
</extension>
|
||||
<extension
|
||||
point="com.raytheon.uf.viz.core.scriptTemplate">
|
||||
<scriptTemplate
|
||||
pluginName="ccfp"
|
||||
scriptLibrary="BaseRequest">
|
||||
</scriptTemplate>
|
||||
</extension>
|
||||
<extension
|
||||
point="com.raytheon.uf.viz.core.component">
|
||||
<component key="avnmenu" class="com.raytheon.viz.aviation.AviationComponent"/>
|
||||
|
|
|
@ -22,10 +22,12 @@ package com.raytheon.viz.awipstools.ui.dialog;
|
|||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang.ArrayUtils;
|
||||
import org.eclipse.core.runtime.Status;
|
||||
import org.eclipse.jface.dialogs.ErrorDialog;
|
||||
import org.eclipse.swt.SWT;
|
||||
|
@ -49,11 +51,13 @@ import org.eclipse.swt.widgets.Listener;
|
|||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.swt.widgets.Text;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
||||
import com.raytheon.uf.common.dataplugin.radar.RadarRecord;
|
||||
import com.raytheon.uf.common.dataplugin.radar.util.RadarDataRetriever;
|
||||
import com.raytheon.uf.common.dataplugin.radar.util.RadarRecordUtil;
|
||||
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.datastorage.DataStoreFactory;
|
||||
import com.raytheon.uf.common.datastorage.IDataStore;
|
||||
import com.raytheon.uf.common.pointdata.spatial.ObStation;
|
||||
|
@ -64,13 +68,10 @@ import com.raytheon.uf.common.time.DataTime;
|
|||
import com.raytheon.uf.viz.core.HDF5Util;
|
||||
import com.raytheon.uf.viz.core.VizApp;
|
||||
import com.raytheon.uf.viz.core.VizConstants;
|
||||
import com.raytheon.uf.viz.core.catalog.LayerProperty;
|
||||
import com.raytheon.uf.viz.core.catalog.ScriptCreator;
|
||||
import com.raytheon.uf.viz.core.comm.Loader;
|
||||
import com.raytheon.uf.viz.core.datastructure.DataCubeContainer;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.globals.VizGlobalsManager;
|
||||
import com.raytheon.uf.viz.core.rsc.ResourceType;
|
||||
import com.raytheon.uf.viz.core.requests.ThriftClient;
|
||||
import com.raytheon.uf.viz.points.IPointChangedListener;
|
||||
import com.raytheon.uf.viz.points.PointsDataManager;
|
||||
import com.raytheon.viz.awipstools.IToolChangedListener;
|
||||
|
@ -95,6 +96,7 @@ import com.vividsolutions.jts.geom.GeometryFactory;
|
|||
* Sep 03, 2013 2310 bsteffen Use IPointChangedListener and
|
||||
* IToolChangedListener instead of
|
||||
* IResourceDataChanged.
|
||||
* Sep 9, 2013 2277 mschenke Got rid of ScriptCreator references
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -114,7 +116,7 @@ public class ChooseByIdDialog extends CaveSWTDialog implements
|
|||
private Button pointsRdo, baselinesRdo, homeRdo;
|
||||
|
||||
private final List<ChooseByIdKeyListener> changeListeners = new ArrayList<ChooseByIdKeyListener>();
|
||||
|
||||
|
||||
private final List<Text> pointStationIdTextFields;
|
||||
|
||||
private final List<Text> baselineStationIdTextFields;
|
||||
|
@ -343,28 +345,14 @@ public class ChooseByIdDialog extends CaveSWTDialog implements
|
|||
Coordinate c = null;
|
||||
RadarRecord rr = null;
|
||||
|
||||
LayerProperty property = new LayerProperty();
|
||||
HashMap<String, RequestConstraint> metadataMap = new HashMap<String, RequestConstraint>();
|
||||
RequestConstraint requestConstraint = null;
|
||||
|
||||
Object[] resp = null;
|
||||
DataTime[] availableDataTimes = null;
|
||||
DataTime[] selectedDataTimes = null;
|
||||
Collection<DataTime> selectedDataTimes = new LinkedHashSet<DataTime>();
|
||||
|
||||
requestConstraint = new RequestConstraint();
|
||||
requestConstraint.setConstraintType(ConstraintType.EQUALS);
|
||||
requestConstraint.setConstraintValue("149");
|
||||
metadataMap.put("productCode", requestConstraint);
|
||||
|
||||
requestConstraint = new RequestConstraint();
|
||||
requestConstraint.setConstraintType(ConstraintType.EQUALS);
|
||||
requestConstraint.setConstraintValue("radar");
|
||||
metadataMap.put("pluginName", requestConstraint);
|
||||
|
||||
requestConstraint = new RequestConstraint();
|
||||
requestConstraint.setConstraintType(ConstraintType.EQUALS);
|
||||
requestConstraint.setConstraintValue("Graphic");
|
||||
metadataMap.put("format", requestConstraint);
|
||||
metadataMap.put("productCode", new RequestConstraint("149"));
|
||||
metadataMap.put("pluginName", new RequestConstraint("radar"));
|
||||
metadataMap.put("format", new RequestConstraint("Graphic"));
|
||||
|
||||
try {
|
||||
availableDataTimes = DataCubeContainer.performTimeQuery(
|
||||
|
@ -379,70 +367,52 @@ public class ChooseByIdDialog extends CaveSWTDialog implements
|
|||
}
|
||||
|
||||
if (availableDataTimes != null && availableDataTimes.length > 0) {
|
||||
Arrays.sort(availableDataTimes);
|
||||
ArrayUtils.reverse(availableDataTimes);
|
||||
Arrays.sort(availableDataTimes, Collections.reverseOrder());
|
||||
|
||||
selectedDataTimes = new DataTime[frameCount];
|
||||
int count = 0;
|
||||
int numElements = availableDataTimes.length;
|
||||
int indx = 0;
|
||||
while (count < frameCount && indx < numElements) {
|
||||
boolean found = false;
|
||||
DataTime dt = availableDataTimes[indx];
|
||||
if (dt == null) {
|
||||
++indx;
|
||||
continue;
|
||||
for (int i = 0; i < availableDataTimes.length
|
||||
&& selectedDataTimes.size() < frameCount; ++i) {
|
||||
DataTime dt = availableDataTimes[i];
|
||||
if (dt != null) {
|
||||
selectedDataTimes.add(dt);
|
||||
}
|
||||
|
||||
for (DataTime t : selectedDataTimes) {
|
||||
if (dt.equals(t)) {
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!found) {
|
||||
selectedDataTimes[count] = dt;
|
||||
++count;
|
||||
}
|
||||
++indx;
|
||||
}
|
||||
}
|
||||
|
||||
property.setDesiredProduct(ResourceType.PLAN_VIEW);
|
||||
property.setNumberOfImages(9999);
|
||||
property.setSelectedEntryTimes(selectedDataTimes);
|
||||
|
||||
try {
|
||||
property.setEntryQueryParameters(metadataMap, false);
|
||||
resp = DataCubeContainer.getData(property, 60000).toArray(
|
||||
new Object[] {});
|
||||
} catch (Exception e) {
|
||||
Status s = new Status(Status.INFO, UiPlugin.PLUGIN_ID,
|
||||
"The query for the entered Mesocyclone ID has failed.");
|
||||
ErrorDialog.openError(Display.getCurrent().getActiveShell(),
|
||||
"Error Finding Mesocyclone ID",
|
||||
"Error Finding Mesocyclone ID", s);
|
||||
return null;
|
||||
}
|
||||
|
||||
for (int i = 0; i < resp.length; i++) {
|
||||
rr = (RadarRecord) resp[i];
|
||||
File loc = HDF5Util.findHDF5Location(rr);
|
||||
|
||||
IDataStore dataStore = DataStoreFactory.getDataStore(loc);
|
||||
if (selectedDataTimes.isEmpty() == false) {
|
||||
PluginDataObject[] resp = null;
|
||||
|
||||
try {
|
||||
RadarDataRetriever.populateRadarRecord(dataStore, rr);
|
||||
resp = DataCubeContainer.getData(metadataMap,
|
||||
selectedDataTimes.toArray(new DataTime[0]));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
Status s = new Status(Status.INFO, UiPlugin.PLUGIN_ID,
|
||||
"The query for the entered Mesocyclone ID has failed.");
|
||||
ErrorDialog.openError(
|
||||
Display.getCurrent().getActiveShell(),
|
||||
"Error Finding Mesocyclone ID",
|
||||
"Error Finding Mesocyclone ID", s);
|
||||
return null;
|
||||
}
|
||||
|
||||
List<String> ids = RadarRecordUtil.getDMDFeatureIDs(rr);
|
||||
if (!ids.contains(mesoId)) {
|
||||
continue;
|
||||
for (int i = 0; i < resp.length; i++) {
|
||||
rr = (RadarRecord) resp[i];
|
||||
File loc = HDF5Util.findHDF5Location(rr);
|
||||
|
||||
IDataStore dataStore = DataStoreFactory.getDataStore(loc);
|
||||
|
||||
try {
|
||||
RadarDataRetriever.populateRadarRecord(dataStore, rr);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
List<String> ids = RadarRecordUtil.getDMDFeatureIDs(rr);
|
||||
if (!ids.contains(mesoId)) {
|
||||
continue;
|
||||
}
|
||||
c = RadarRecordUtil.getDMDLonLatFromFeatureID(rr, mesoId);
|
||||
break;
|
||||
}
|
||||
c = RadarRecordUtil.getDMDLonLatFromFeatureID(rr, mesoId);
|
||||
break;
|
||||
}
|
||||
|
||||
return c;
|
||||
|
@ -454,33 +424,26 @@ public class ChooseByIdDialog extends CaveSWTDialog implements
|
|||
* @return the ObStation with the given stationID
|
||||
*/
|
||||
private ObStation getObStation(String stationID) {
|
||||
ObStation obStation = null;
|
||||
DbQueryRequest request = new DbQueryRequest();
|
||||
request.addConstraint(
|
||||
"gid",
|
||||
new RequestConstraint(ObStation.createGID(
|
||||
ObStation.CAT_TYPE_ICAO, stationID)));
|
||||
request.setEntityClass(ObStation.class);
|
||||
request.setLimit(1);
|
||||
|
||||
HashMap<String, RequestConstraint> query = new HashMap<String, RequestConstraint>();
|
||||
query.put("pluginName", new RequestConstraint("table"));
|
||||
query.put("databasename", new RequestConstraint("metadata"));
|
||||
query.put("classname",
|
||||
new RequestConstraint(ObStation.class.getCanonicalName()));
|
||||
String gid = ObStation
|
||||
.createGID(ObStation.CAT_TYPE_ICAO, stationID);
|
||||
query.put("gid", new RequestConstraint(gid));
|
||||
|
||||
LayerProperty lpParm = new LayerProperty();
|
||||
|
||||
List<Object> list = null;
|
||||
try {
|
||||
lpParm.setEntryQueryParameters(query, false);
|
||||
String tableScript = ScriptCreator.createScript(lpParm);
|
||||
list = Loader.loadData(tableScript, 10000);
|
||||
DbQueryResponse response = (DbQueryResponse) ThriftClient
|
||||
.sendRequest(request);
|
||||
if (response.getNumResults() == 1) {
|
||||
obStation = response.getEntityObjects(ObStation.class)[0];
|
||||
}
|
||||
} catch (VizException e) {
|
||||
statusHandler.handle(Priority.WARN,
|
||||
"Error querying for points", e);
|
||||
}
|
||||
|
||||
ObStation obStation = null;
|
||||
if (list != null && list.size() != 0) {
|
||||
obStation = ((ObStation) (list.get(0)));
|
||||
}
|
||||
|
||||
return obStation;
|
||||
}
|
||||
|
||||
|
|
|
@ -4,12 +4,9 @@ bin.includes = META-INF/,\
|
|||
plugin.xml,\
|
||||
T.bin,\
|
||||
Td.bin,\
|
||||
scriptTemplates/,\
|
||||
icons/,\
|
||||
config.xml,\
|
||||
localization/,\
|
||||
images/,\
|
||||
help/,\
|
||||
OSGI-INF/component.xml,\
|
||||
res/
|
||||
source.. = src/
|
||||
|
|
|
@ -1789,13 +1789,6 @@
|
|||
</command>
|
||||
</menuContribution>
|
||||
</extension>
|
||||
<extension point="com.raytheon.uf.viz.core.scriptTemplate">
|
||||
<scriptTemplate pluginName="gfe"
|
||||
scriptLibrary="BaseRequest"
|
||||
scriptTemplateFile="scriptTemplates/gfeTemplate.vm">
|
||||
</scriptTemplate>
|
||||
</extension>
|
||||
|
||||
|
||||
<extension id="com.raytheon.viz.ui.bindings" point="org.eclipse.ui.bindings">
|
||||
<key commandId="com.raytheon.viz.gfe.toggleLegend"
|
||||
|
|
|
@ -1,56 +0,0 @@
|
|||
#macro(gfeTask $scriptMetadata $taskName)
|
||||
import GfeTask
|
||||
from com.raytheon.edex.uengine.tasks.gfe.rpc import $taskName
|
||||
task = $taskName()
|
||||
pyTask = GfeTask.GfeTask("$scriptMetadata.get("wsId").constraintValue", task)
|
||||
#foreach (${key} in ${scriptMetadata.keySet()})
|
||||
#if(${key})
|
||||
#if(${key} != "task" && ${key} != "pluginName" && ${key} != "wsId")
|
||||
#set($constraint = $scriptMetadata.get($key))
|
||||
pyTask.addArgument("${constraint.constraintValue}")
|
||||
#end
|
||||
#end
|
||||
#end
|
||||
return pyTask.execute()
|
||||
#end
|
||||
|
||||
|
||||
#if($mode=="saveGrids")
|
||||
#gfeTask($scriptMetadata "SaveGfeGridTask")
|
||||
#elseif($mode=="gridInventory")
|
||||
#gfeTask($scriptMetadata "GetGridInventoryTask")
|
||||
#elseif($mode=="commitGrid")
|
||||
#gfeTask($scriptMetadata "CommitGridTask")
|
||||
#elseif($mode=="parmList")
|
||||
#gfeTask($scriptMetadata "GetParmListTask")
|
||||
#elseif($mode=="parmInfo")
|
||||
#gfeTask($scriptMetadata "GetGridParmInfoTask")
|
||||
#elseif($mode=="dbInventory")
|
||||
#gfeTask($scriptMetadata "GetDbInventoryTask")
|
||||
#elseif($mode=="lockTables")
|
||||
#gfeTask($scriptMetadata "GetLockTablesTask")
|
||||
#elseif($mode=="requestGloc")
|
||||
#gfeTask($scriptMetadata "GridLocRequestTask")
|
||||
#elseif($mode=="changeLock")
|
||||
#gfeTask($scriptMetadata "RequestLockChangeTask")
|
||||
#elseif($mode=="getSiteID")
|
||||
#gfeTask($scriptMetadata "GetSiteIdTask")
|
||||
#elseif($mode=="discreteDef")
|
||||
#gfeTask($scriptMetadata "GetDiscreteDefinitionTask")
|
||||
#elseif($mode=="weatherVisibilities")
|
||||
#gfeTask($scriptMetadata "GetWeatherVisibilities")
|
||||
#elseif($mode=="wxDefinition")
|
||||
#gfeTask($scriptMetadata "GetWXDefinitionTask")
|
||||
#elseif($mode=="getOfficialDb")
|
||||
#gfeTask($scriptMetadata "GetOfficialDbNameTask")
|
||||
#elseif($mode=="sendNotifications")
|
||||
#gfeTask($scriptMetadata "SendNotifications")
|
||||
#elseif($mode=="stageD2DGridData")
|
||||
#gfeTask($scriptMetadata "StageD2DGridData")
|
||||
#elseif($mode == "catalog")
|
||||
#standardCatalog($scriptLibrary $scriptMetadata)
|
||||
#elseif($mode == "select")
|
||||
#standardSelect($scriptLibrary $maxRecords $scriptMetadata false)
|
||||
#end
|
||||
|
||||
|
|
@ -30,13 +30,6 @@
|
|||
resourceType="PLAN_VIEW">
|
||||
</resource>
|
||||
</extension>
|
||||
<extension
|
||||
point="com.raytheon.uf.viz.core.scriptTemplate">
|
||||
<scriptTemplate
|
||||
pluginName="grib"
|
||||
scriptLibrary="GridRequest">
|
||||
</scriptTemplate>
|
||||
</extension>
|
||||
<extension
|
||||
point="com.raytheon.uf.viz.core.units">
|
||||
<units
|
||||
|
|
|
@ -35,7 +35,6 @@ import java.util.Map.Entry;
|
|||
import java.util.Set;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
||||
import com.raytheon.uf.common.dataplugin.PluginException;
|
||||
import com.raytheon.uf.common.dataplugin.grid.GridConstants;
|
||||
import com.raytheon.uf.common.dataplugin.grid.GridPathProvider;
|
||||
import com.raytheon.uf.common.dataplugin.grid.GridRecord;
|
||||
|
@ -53,7 +52,6 @@ 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.HDF5Util;
|
||||
import com.raytheon.uf.viz.core.catalog.LayerProperty;
|
||||
import com.raytheon.uf.viz.core.datastructure.CubeUtil;
|
||||
import com.raytheon.uf.viz.core.datastructure.VizDataCubeException;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
|
@ -411,17 +409,20 @@ public class GridDataCubeAdapter extends AbstractDataCubeAdapter {
|
|||
*
|
||||
* @see
|
||||
* com.raytheon.uf.viz.derivparam.data.AbstractDataCubeAdapter#getData(java
|
||||
* .util.List)
|
||||
* .util.Map, com.raytheon.uf.common.time.DataTime[], java.util.List)
|
||||
*/
|
||||
@Override
|
||||
protected List<Object> getData(LayerProperty property,
|
||||
List<AbstractRequestableData> requesters) throws VizException {
|
||||
List<Object> results = new ArrayList<Object>(requesters.size());
|
||||
protected List<PluginDataObject> getData(
|
||||
Map<String, RequestConstraint> constraints,
|
||||
DataTime[] selectedTimes, List<AbstractRequestableData> requesters)
|
||||
throws VizException {
|
||||
List<PluginDataObject> results = new ArrayList<PluginDataObject>(
|
||||
requesters.size());
|
||||
for (AbstractRequestableData requester : requesters) {
|
||||
List<RequestableDataRecord> records = new ArrayList<RequestableDataRecord>();
|
||||
if (requester.getDataTime() == null
|
||||
|| requester.getTimeAndSpace().isTimeAgnostic()) {
|
||||
DataTime[] entryTime = property.getSelectedEntryTime();
|
||||
DataTime[] entryTime = selectedTimes;
|
||||
if (entryTime != null && entryTime.length > 0) {
|
||||
List<DataTime> entryTimes = new ArrayList<DataTime>(
|
||||
Arrays.asList(entryTime));
|
||||
|
@ -429,21 +430,15 @@ public class GridDataCubeAdapter extends AbstractDataCubeAdapter {
|
|||
RequestableDataRecord rec = new RequestableDataRecord(
|
||||
requester);
|
||||
rec.setDataTime(time.clone());
|
||||
try {
|
||||
rec.setDataURI(null);
|
||||
rec.constructDataURI();
|
||||
} catch (PluginException e) {
|
||||
throw new VizException(e);
|
||||
}
|
||||
boolean n = true;
|
||||
for (Object result : results) {
|
||||
if (((GridRecord) result).getDataURI().equals(
|
||||
rec.getDataURI())) {
|
||||
n = false;
|
||||
rec.setDataURI(null);
|
||||
boolean newRecord = true;
|
||||
for (PluginDataObject result : results) {
|
||||
if (result.getDataURI().equals(rec.getDataURI())) {
|
||||
newRecord = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (n) {
|
||||
if (newRecord) {
|
||||
records.add(rec);
|
||||
}
|
||||
}
|
||||
|
@ -467,12 +462,7 @@ public class GridDataCubeAdapter extends AbstractDataCubeAdapter {
|
|||
for (GridCoverage coverage : coverages) {
|
||||
record = new RequestableDataRecord(record);
|
||||
record.setLocation(coverage);
|
||||
try {
|
||||
record.setDataURI(null);
|
||||
record.constructDataURI();
|
||||
} catch (PluginException e) {
|
||||
throw new VizException(e);
|
||||
}
|
||||
record.setDataURI(null);
|
||||
spaceRecords.add(record);
|
||||
}
|
||||
}
|
||||
|
@ -481,10 +471,9 @@ public class GridDataCubeAdapter extends AbstractDataCubeAdapter {
|
|||
}
|
||||
results.addAll(records);
|
||||
}
|
||||
if (property.getEntryQueryParameters(false).containsKey(
|
||||
GridInventory.ENSEMBLE_QUERY)) {
|
||||
String ensemble = property.getEntryQueryParameters(false)
|
||||
.get(GridInventory.ENSEMBLE_QUERY).getConstraintValue();
|
||||
if (constraints.containsKey(GridInventory.ENSEMBLE_QUERY)) {
|
||||
String ensemble = constraints.get(GridInventory.ENSEMBLE_QUERY)
|
||||
.getConstraintValue();
|
||||
if (ensemble != null) {
|
||||
for (Object rec : results) {
|
||||
((GridRecord) rec).setEnsembleId(ensemble);
|
||||
|
|
|
@ -45,7 +45,6 @@ import com.raytheon.uf.common.mpe.util.XmrgFile;
|
|||
import com.raytheon.uf.common.ohd.AppsDefaults;
|
||||
import com.raytheon.uf.common.util.FileUtil;
|
||||
import com.raytheon.uf.viz.core.IDisplayPane;
|
||||
import com.raytheon.uf.viz.core.catalog.LayerProperty;
|
||||
import com.raytheon.uf.viz.core.datastructure.DataCubeContainer;
|
||||
import com.raytheon.uf.viz.core.datastructure.LoopProperties;
|
||||
import com.raytheon.uf.viz.core.drawables.IDescriptor;
|
||||
|
@ -309,20 +308,14 @@ public class HydroDisplayManager {
|
|||
+ rfc));
|
||||
|
||||
try {
|
||||
LayerProperty lp = new LayerProperty();
|
||||
lp.setNumberOfImages(9999);
|
||||
lp.setEntryQueryParameters(reqMap, false);
|
||||
|
||||
List<Object> dataList = DataCubeContainer.getData(lp, 30);
|
||||
PluginDataObject[] pdos = DataCubeContainer.getData(reqMap);
|
||||
GridRecord gr = null;
|
||||
int i = 0;
|
||||
for (Object o : dataList) {
|
||||
gr = (GridRecord) o;
|
||||
IDataRecord[] recArr = DataCubeContainer
|
||||
.getDataRecord((PluginDataObject) o);
|
||||
for (PluginDataObject pdo : pdos) {
|
||||
gr = (GridRecord) pdo;
|
||||
IDataRecord[] recArr = DataCubeContainer.getDataRecord(gr);
|
||||
gr.setMessageData(((FloatDataRecord) recArr[0])
|
||||
.getFloatData());
|
||||
++i;
|
||||
break;
|
||||
}
|
||||
|
||||
FFGGridResourceData resourceData = new FFGGridResourceData(
|
||||
|
@ -477,20 +470,14 @@ public class HydroDisplayManager {
|
|||
+ rfc));
|
||||
|
||||
try {
|
||||
LayerProperty lp = new LayerProperty();
|
||||
lp.setNumberOfImages(9999);
|
||||
lp.setEntryQueryParameters(reqMap, false);
|
||||
|
||||
List<Object> dataList = DataCubeContainer.getData(lp, 30);
|
||||
PluginDataObject[] pdos = DataCubeContainer.getData(reqMap);
|
||||
GridRecord gr = null;
|
||||
int i = 0;
|
||||
for (Object o : dataList) {
|
||||
gr = (GridRecord) o;
|
||||
IDataRecord[] recArr = DataCubeContainer
|
||||
.getDataRecord((PluginDataObject) o);
|
||||
for (PluginDataObject pdo : pdos) {
|
||||
gr = (GridRecord) pdo;
|
||||
IDataRecord[] recArr = DataCubeContainer.getDataRecord(gr);
|
||||
gr.setMessageData(((FloatDataRecord) recArr[0])
|
||||
.getFloatData());
|
||||
++i;
|
||||
break;
|
||||
}
|
||||
|
||||
RFCGriddedBasinFFGResourceData resourceData = new RFCGriddedBasinFFGResourceData(
|
||||
|
|
|
@ -30,14 +30,7 @@
|
|||
resourceType="PLAN_VIEW">
|
||||
</resource>
|
||||
</extension>
|
||||
|
||||
<extension
|
||||
point="com.raytheon.uf.viz.core.scriptTemplate">
|
||||
<scriptTemplate
|
||||
pluginName="binlightning"
|
||||
scriptLibrary="BaseRequest">
|
||||
</scriptTemplate>
|
||||
</extension>
|
||||
|
||||
<extension
|
||||
point="com.raytheon.uf.viz.productbrowser.dataDefinition">
|
||||
<dataDefinition
|
||||
|
|
|
@ -84,38 +84,6 @@
|
|||
pluginName="bufrua"
|
||||
scriptLibrary="UARequest">
|
||||
</scriptTemplate>
|
||||
<scriptTemplate
|
||||
pluginName="bufrssmi"
|
||||
scriptLibrary="BaseRequest">
|
||||
</scriptTemplate>
|
||||
<scriptTemplate
|
||||
pluginName="goessounding"
|
||||
scriptLibrary="BaseRequest">
|
||||
</scriptTemplate>
|
||||
<scriptTemplate
|
||||
pluginName="poessounding"
|
||||
scriptLibrary="BaseRequest">
|
||||
</scriptTemplate>
|
||||
<scriptTemplate
|
||||
pluginName="acarssounding"
|
||||
scriptLibrary="BaseRequest">
|
||||
</scriptTemplate>
|
||||
<scriptTemplate
|
||||
pluginName="pirep"
|
||||
scriptLibrary="BaseRequest">
|
||||
</scriptTemplate>
|
||||
<scriptTemplate
|
||||
pluginName="bufrhdw"
|
||||
scriptLibrary="BaseRequest">
|
||||
</scriptTemplate>
|
||||
<scriptTemplate
|
||||
pluginName="airep"
|
||||
scriptLibrary="BaseRequest">
|
||||
</scriptTemplate>
|
||||
<scriptTemplate
|
||||
pluginName="acars"
|
||||
scriptLibrary="BaseRequest">
|
||||
</scriptTemplate>
|
||||
<scriptTemplate
|
||||
pluginName="profiler"
|
||||
scriptLibrary="ProfilerRequest">
|
||||
|
|
|
@ -22,7 +22,6 @@ package com.raytheon.viz.pointdata;
|
|||
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||
|
@ -34,18 +33,18 @@ import org.eclipse.core.runtime.jobs.Job;
|
|||
import org.eclipse.swt.graphics.RGB;
|
||||
|
||||
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.requests.RequestConstraint.ConstraintType;
|
||||
import com.raytheon.uf.common.dataquery.responses.DbQueryResponse;
|
||||
import com.raytheon.uf.viz.core.IGraphicsTarget;
|
||||
import com.raytheon.uf.viz.core.IGraphicsTarget.LineStyle;
|
||||
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.data.prep.IODataPreparer;
|
||||
import com.raytheon.uf.viz.core.drawables.IImage;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.map.IMapDescriptor;
|
||||
import com.raytheon.uf.viz.core.rsc.ResourceType;
|
||||
import com.raytheon.uf.viz.core.requests.ThriftClient;
|
||||
|
||||
/**
|
||||
* A Eclipse Job thread that will listen for new stations on a queue and request
|
||||
|
@ -177,11 +176,9 @@ public class PlotModelGenerator extends Job {
|
|||
|
||||
if (stationQuery.size() > 0) {
|
||||
try {
|
||||
String script = createActionASCII(stationQuery);
|
||||
Object[] obs = asciiConnection.connect(script, null, 60000);
|
||||
|
||||
for (Object plugindo : obs) {
|
||||
PluginDataObject ob = (PluginDataObject) plugindo;
|
||||
PluginDataObject[] obs = requestPluginDataObjects(stationQuery
|
||||
.toArray(new String[0]));
|
||||
for (PluginDataObject ob : obs) {
|
||||
ImageContainer ic = icaoImageMap.get(ob.getDataURI());
|
||||
if (ic != null) {
|
||||
ic.record = ob;
|
||||
|
@ -368,28 +365,19 @@ public class PlotModelGenerator extends Job {
|
|||
}
|
||||
}
|
||||
|
||||
private String createActionASCII(ArrayList<String> stationQuery)
|
||||
private PluginDataObject[] requestPluginDataObjects(String[] uris)
|
||||
throws VizException {
|
||||
|
||||
LayerProperty prop = new LayerProperty();
|
||||
|
||||
HashMap<String, RequestConstraint> params = new HashMap<String, RequestConstraint>();
|
||||
|
||||
RequestConstraint pluginName = new RequestConstraint();
|
||||
pluginName.setConstraintValue(this.plugin);
|
||||
params.put("pluginName", pluginName);
|
||||
|
||||
DbQueryRequest request = new DbQueryRequest();
|
||||
request.addConstraint("pluginName", new RequestConstraint(plugin));
|
||||
RequestConstraint ids = new RequestConstraint();
|
||||
ids.setConstraintType(ConstraintType.IN);
|
||||
ids.setConstraintValueList(stationQuery.toArray(new String[stationQuery
|
||||
.size()]));
|
||||
params.put("dataURI", ids);
|
||||
ids.setConstraintValueList(uris);
|
||||
request.addConstraint("dataURI", ids);
|
||||
request.setLimit(uris.length);
|
||||
|
||||
prop.setDesiredProduct(ResourceType.PLAN_VIEW);
|
||||
prop.setEntryQueryParameters(params, false);
|
||||
prop.setNumberOfImages(stationQuery.size());
|
||||
|
||||
return ScriptCreator.createScript(prop, "plot");
|
||||
DbQueryResponse response = (DbQueryResponse) ThriftClient
|
||||
.sendRequest(request);
|
||||
return response.getEntityObjects(PluginDataObject.class);
|
||||
}
|
||||
|
||||
public void setPlotModelLineStyle(LineStyle lineStyle) {
|
||||
|
|
|
@ -21,7 +21,6 @@ package com.raytheon.viz.pointdata.util;
|
|||
|
||||
import java.awt.Point;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.measure.unit.SI;
|
||||
|
@ -42,7 +41,6 @@ import com.raytheon.uf.common.geospatial.MapUtil;
|
|||
import com.raytheon.uf.common.geospatial.PointUtil;
|
||||
import com.raytheon.uf.common.time.DataTime;
|
||||
import com.raytheon.uf.common.wxmath.PToZsa;
|
||||
import com.raytheon.uf.viz.core.catalog.LayerProperty;
|
||||
import com.raytheon.uf.viz.core.datastructure.DataCubeContainer;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.derivparam.data.AbstractRequestableData;
|
||||
|
@ -211,18 +209,12 @@ public class HeightOfRequestableData extends AbstractRequestableData {
|
|||
*/
|
||||
private PluginDataObject loadPressureLevel(DataTime time)
|
||||
throws VizException {
|
||||
|
||||
LayerProperty lp = new LayerProperty();
|
||||
lp.setNumberOfImages(1);
|
||||
lp.setEntryQueryParameters(getConstraints(), false);
|
||||
if (time != null) {
|
||||
lp.setSelectedEntryTimes(new DataTime[] { time });
|
||||
}
|
||||
List<Object> resp = DataCubeContainer.getData(lp, 60000);
|
||||
if (resp.isEmpty()) {
|
||||
PluginDataObject[] pdos = DataCubeContainer.getData(getConstraints(),
|
||||
time);
|
||||
if (pdos == null || pdos.length == 0) {
|
||||
return null;
|
||||
}
|
||||
PluginDataObject gribRec = (PluginDataObject) resp.get(0);
|
||||
PluginDataObject gribRec = pdos[0];
|
||||
IDataRecord[] dr = DataCubeContainer.getDataRecord(gribRec);
|
||||
if (dr != null) {
|
||||
float[] data = (float[]) dr[0].getDataObject();
|
||||
|
|
|
@ -26,30 +26,19 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
|
||||
import com.raytheon.uf.common.comm.CommunicationException;
|
||||
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
||||
import com.raytheon.uf.common.dataplugin.level.Level;
|
||||
import com.raytheon.uf.common.dataplugin.level.mapping.LevelMappingFactory;
|
||||
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
|
||||
import com.raytheon.uf.common.dataquery.requests.TimeQueryRequest;
|
||||
import com.raytheon.uf.common.dataquery.requests.TimeQueryRequestSet;
|
||||
import com.raytheon.uf.common.datastorage.Request;
|
||||
import com.raytheon.uf.common.datastorage.records.FloatDataRecord;
|
||||
import com.raytheon.uf.common.datastorage.records.IDataRecord;
|
||||
import com.raytheon.uf.common.pointdata.PointDataContainer;
|
||||
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.RecordFactory;
|
||||
import com.raytheon.uf.viz.core.catalog.LayerProperty;
|
||||
import com.raytheon.uf.viz.core.catalog.ScriptCreator;
|
||||
import com.raytheon.uf.viz.core.comm.Loader;
|
||||
import com.raytheon.uf.viz.core.datastructure.CubeUtil;
|
||||
import com.raytheon.uf.viz.core.datastructure.IDataCubeAdapter;
|
||||
import com.raytheon.uf.viz.core.datastructure.VizDataCubeException;
|
||||
import com.raytheon.uf.viz.core.datastructure.DefaultDataCubeAdapter;
|
||||
import com.raytheon.uf.viz.core.exception.VizCommunicationException;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.requests.ThriftClient;
|
||||
import com.raytheon.uf.viz.derivparam.data.AbstractRequestableData;
|
||||
import com.raytheon.uf.viz.derivparam.inv.AvailabilityContainer;
|
||||
import com.raytheon.uf.viz.derivparam.library.DerivedParameterGenerator;
|
||||
|
@ -78,33 +67,23 @@ import com.raytheon.viz.pointdata.PointDataRequest;
|
|||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class PointDataCubeAdapter implements IDataCubeAdapter {
|
||||
public class PointDataCubeAdapter extends DefaultDataCubeAdapter {
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(PointDataCubeAdapter.class);
|
||||
|
||||
public static String PLUGIN_NAME = PointDataInventory.PLUGIN_NAME;
|
||||
|
||||
private static String[] supportedPlugins = { "obs", "madis", "modelsounding",
|
||||
"bufrssmi", "bufrquikscat", "lsr", "sfcobs", "goessounding",
|
||||
"bufrascat", "poessounding", "profiler", "bufrua", "ldadmesonet",
|
||||
"ldadhydro", "qc", "fssobs", "bufrmosAVN", "bufrmosETA",
|
||||
"bufrmosGFS", "bufrmosHPC", "bufrmosLAMP", "bufrmosMRF",
|
||||
"bufrmosNGM" };
|
||||
private static String[] supportedPlugins = { "obs", "madis",
|
||||
"modelsounding", "bufrssmi", "bufrquikscat", "lsr", "sfcobs",
|
||||
"goessounding", "bufrascat", "poessounding", "profiler", "bufrua",
|
||||
"ldadmesonet", "ldadhydro", "qc", "fssobs", "bufrmosAVN",
|
||||
"bufrmosETA", "bufrmosGFS", "bufrmosHPC", "bufrmosLAMP",
|
||||
"bufrmosMRF", "bufrmosNGM" };
|
||||
|
||||
protected AbstractPointDataInventory inventory;
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.uf.viz.core.datastructure.IDataCubeAdapter#getData(com.raytheon
|
||||
* .uf.viz.core.catalog.LayerProperty, java.util.Map)
|
||||
*/
|
||||
@Override
|
||||
public List<Object> getData(LayerProperty property, int timeOut)
|
||||
throws VizException {
|
||||
String scriptToExecute = ScriptCreator.createScript(property);
|
||||
return Loader.loadScripts(new String[] { scriptToExecute }, timeOut);
|
||||
public PointDataCubeAdapter() {
|
||||
super(PLUGIN_NAME);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -239,31 +218,6 @@ public class PointDataCubeAdapter implements IDataCubeAdapter {
|
|||
baseParams.toArray(new String[] {}), null, queryParams);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.uf.viz.core.datastructure.IDataCubeAdapter#getRecord(com
|
||||
* .raytheon.uf.common.dataplugin.PluginDataObject)
|
||||
*/
|
||||
@Override
|
||||
public IDataRecord[] getRecord(PluginDataObject obj)
|
||||
throws VizDataCubeException {
|
||||
if (obj.getMessageData() == null) {
|
||||
IDataRecord record = null;
|
||||
try {
|
||||
record = CubeUtil.retrieveData(obj, obj.getPluginName());
|
||||
} catch (VizException e) {
|
||||
throw new VizDataCubeException(
|
||||
"Error retrieving point data record.", e);
|
||||
}
|
||||
|
||||
return new IDataRecord[] { record };
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
|
@ -299,59 +253,4 @@ public class PointDataCubeAdapter implements IDataCubeAdapter {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IDataRecord[] getRecord(PluginDataObject obj, Request req,
|
||||
String dataset) throws VizDataCubeException {
|
||||
if (obj.getMessageData() == null) {
|
||||
IDataRecord record = null;
|
||||
try {
|
||||
record = CubeUtil.retrieveData(obj, obj.getPluginName(), req,
|
||||
dataset);
|
||||
} catch (VizException e) {
|
||||
throw new VizDataCubeException(
|
||||
"Error retrieving point data record.", e);
|
||||
}
|
||||
|
||||
return new IDataRecord[] { record };
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.uf.viz.core.datastructure.IDataCubeAdapter#getRecords(java
|
||||
* .util.List, com.raytheon.uf.common.datastorage.Request, java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public void getRecords(List<PluginDataObject> objs, Request req,
|
||||
String dataset) throws VizDataCubeException {
|
||||
for (PluginDataObject obj : objs) {
|
||||
IDataRecord[] records = getRecord(obj, req, dataset);
|
||||
obj.setMessageData(records);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, RequestConstraint>> getBaseUpdateConstraints(
|
||||
Map<String, RequestConstraint> constraints) {
|
||||
List<Map<String, RequestConstraint>> result = new ArrayList<Map<String, RequestConstraint>>(
|
||||
1);
|
||||
result.add(constraints);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<List<DataTime>> timeQuery(List<TimeQueryRequest> requests)
|
||||
throws VizException {
|
||||
TimeQueryRequestSet set = new TimeQueryRequestSet();
|
||||
set.setRequests(requests.toArray(new TimeQueryRequest[0]));
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
List<List<DataTime>> result = (List<List<DataTime>>) ThriftClient
|
||||
.sendRequest(set);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,13 +55,6 @@
|
|||
commandId="com.raytheon.viz.radar.ui.RadarDisplayControls">
|
||||
</handler>
|
||||
</extension>
|
||||
<extension
|
||||
point="com.raytheon.uf.viz.core.scriptTemplate">
|
||||
<scriptTemplate
|
||||
pluginName="radar"
|
||||
scriptLibrary="BaseRequest">
|
||||
</scriptTemplate>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.ui.editors">
|
||||
<editor
|
||||
|
|
|
@ -37,13 +37,6 @@
|
|||
resourceType="PLAN_VIEW">
|
||||
</resource>
|
||||
</extension>
|
||||
<extension
|
||||
point="com.raytheon.uf.viz.core.scriptTemplate">
|
||||
<scriptTemplate
|
||||
pluginName="redbook"
|
||||
scriptLibrary="BaseRequest">
|
||||
</scriptTemplate>
|
||||
</extension>
|
||||
<extension
|
||||
point="com.raytheon.uf.viz.productbrowser.dataDefinition">
|
||||
<dataDefinition
|
||||
|
|
|
@ -32,13 +32,6 @@
|
|||
name="satBlendedResource"
|
||||
renderingOrderId="IMAGE_COUNTRY"/>
|
||||
</extension>
|
||||
<extension
|
||||
point="com.raytheon.uf.viz.core.scriptTemplate">
|
||||
<scriptTemplate
|
||||
pluginName="satellite"
|
||||
scriptLibrary="BaseRequest">
|
||||
</scriptTemplate>
|
||||
</extension>
|
||||
|
||||
<extension
|
||||
point="com.raytheon.uf.viz.productbrowser.dataDefinition">
|
||||
|
|
|
@ -44,7 +44,6 @@ import org.geotools.coverage.grid.GridCoverageFactory;
|
|||
import org.geotools.coverage.grid.GridGeometry2D;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
||||
import com.raytheon.uf.common.dataplugin.PluginException;
|
||||
import com.raytheon.uf.common.dataplugin.satellite.SatelliteRecord;
|
||||
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
|
||||
import com.raytheon.uf.common.dataquery.requests.RequestConstraint.ConstraintType;
|
||||
|
@ -56,15 +55,11 @@ import com.raytheon.uf.common.datastorage.Request;
|
|||
import com.raytheon.uf.common.datastorage.records.ByteDataRecord;
|
||||
import com.raytheon.uf.common.datastorage.records.IDataRecord;
|
||||
import com.raytheon.uf.common.geospatial.MapUtil;
|
||||
import com.raytheon.uf.common.pointdata.PointDataContainer;
|
||||
import com.raytheon.uf.common.time.BinOffset;
|
||||
import com.raytheon.uf.common.time.DataTime;
|
||||
import com.raytheon.uf.viz.core.HDF5Util;
|
||||
import com.raytheon.uf.viz.core.catalog.CatalogQuery;
|
||||
import com.raytheon.uf.viz.core.catalog.LayerProperty;
|
||||
import com.raytheon.uf.viz.core.catalog.ScriptCreator;
|
||||
import com.raytheon.uf.viz.core.comm.Loader;
|
||||
import com.raytheon.uf.viz.core.datastructure.CubeUtil;
|
||||
import com.raytheon.uf.viz.core.datastructure.DefaultDataCubeAdapter;
|
||||
import com.raytheon.uf.viz.core.datastructure.IDataCubeAdapter;
|
||||
import com.raytheon.uf.viz.core.datastructure.VizDataCubeException;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
|
@ -77,7 +72,7 @@ import com.raytheon.uf.viz.derivparam.library.DerivedParameterRequest;
|
|||
import com.raytheon.uf.viz.derivparam.library.IDerivParamField;
|
||||
|
||||
/**
|
||||
* TODO Add Description
|
||||
* {@link IDataCubeAdapter} for satellite plugin data
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
|
@ -91,13 +86,14 @@ import com.raytheon.uf.viz.derivparam.library.IDerivParamField;
|
|||
* Apr 08, 2013 1293 bkowal Removed references to hdffileid.
|
||||
* Jun 04, 2013 2041 bsteffen Switch derived parameters to use
|
||||
* concurrent python for threading.
|
||||
* Sep 9, 2013 2277 mschenke Got rid of ScriptCreator references
|
||||
* </pre>
|
||||
*
|
||||
* @author jsanchez
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class SatelliteDataCubeAdapter implements IDataCubeAdapter {
|
||||
public class SatelliteDataCubeAdapter extends DefaultDataCubeAdapter {
|
||||
|
||||
private static final String PE = "physicalElement";
|
||||
|
||||
|
@ -105,21 +101,27 @@ public class SatelliteDataCubeAdapter implements IDataCubeAdapter {
|
|||
|
||||
private Map<String, DerivParamDesc> derParLibrary;
|
||||
|
||||
/**
|
||||
* @param pluginName
|
||||
*/
|
||||
public SatelliteDataCubeAdapter() {
|
||||
super(SatelliteRecord.PLUGIN_ID);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Object> getData(LayerProperty property, int timeOut)
|
||||
public PluginDataObject[] getData(
|
||||
Map<String, RequestConstraint> constraints, DataTime[] selectedTimes)
|
||||
throws VizException {
|
||||
if (!property.getEntryQueryParameters(false).containsKey("DERIVED")) {
|
||||
String scriptToExecute = ScriptCreator.createScript(property);
|
||||
return Loader
|
||||
.loadScripts(new String[] { scriptToExecute }, timeOut);
|
||||
Map<String, RequestConstraint> originalQuery = constraints;
|
||||
if (originalQuery.containsKey(DERIVED) == false) {
|
||||
return super.getData(originalQuery, selectedTimes);
|
||||
}
|
||||
|
||||
String requestedParam;
|
||||
ArrayList<Object> initResponses = new ArrayList<Object>();
|
||||
HashMap<String, RequestConstraint> originalQuery = property
|
||||
.getEntryQueryParameters(false);
|
||||
ArrayList<DerivedParameterRequest> listOfRequests = new ArrayList<DerivedParameterRequest>();
|
||||
HashMap<String, RequestConstraint> modifiedQuery = property
|
||||
.getEntryQueryParameters(false);
|
||||
List<PluginDataObject> initResponses = new ArrayList<PluginDataObject>();
|
||||
List<DerivedParameterRequest> listOfRequests = new ArrayList<DerivedParameterRequest>();
|
||||
Map<String, RequestConstraint> modifiedQuery = new HashMap<String, RequestConstraint>(
|
||||
originalQuery);
|
||||
modifiedQuery.remove(DERIVED);
|
||||
modifiedQuery.remove(PE);
|
||||
|
||||
|
@ -148,12 +150,9 @@ public class SatelliteDataCubeAdapter implements IDataCubeAdapter {
|
|||
Map<String, RequestConstraint> query = modifyQuery(
|
||||
modifiedQuery, field);
|
||||
|
||||
property.setEntryQueryParameters(query, false);
|
||||
String scriptToExecute = ScriptCreator.createScript(property);
|
||||
List<Object> responses = Loader.loadScripts(
|
||||
new String[] { scriptToExecute }, timeOut);
|
||||
for (int i = 0; i < responses.size(); i++) {
|
||||
SatelliteRecord record = (SatelliteRecord) responses.get(i);
|
||||
PluginDataObject[] pdos = super.getData(query, selectedTimes);
|
||||
for (PluginDataObject pdo : pdos) {
|
||||
SatelliteRecord record = (SatelliteRecord) pdo;
|
||||
if (requestInitialized) {
|
||||
for (DerivedParameterRequest definedRequest : listOfRequests) {
|
||||
if (record.getDataTime().compareTo(
|
||||
|
@ -173,20 +172,16 @@ public class SatelliteDataCubeAdapter implements IDataCubeAdapter {
|
|||
SatelliteRecord derivedRecord = new SatelliteRecord(
|
||||
record.getDataURI());
|
||||
// Make sure to get the number of interpolation levels!
|
||||
derivedRecord.setInterpolationLevels(record.getInterpolationLevels());
|
||||
|
||||
derivedRecord.setInterpolationLevels(record
|
||||
.getInterpolationLevels());
|
||||
|
||||
derivedRecord.setPhysicalElement(originalQuery.get(PE)
|
||||
.getConstraintValue());
|
||||
derivedRecord.setMessageData(request);
|
||||
derivedRecord.setCoverage(record.getCoverage());
|
||||
// This should not be necessary but file based tile set
|
||||
// expects it.
|
||||
try {
|
||||
derivedRecord.setDataURI(null);
|
||||
derivedRecord.constructDataURI();
|
||||
} catch (PluginException e) {
|
||||
throw new VizException(e);
|
||||
}
|
||||
// Reset dataURI after setting fields
|
||||
derivedRecord.setDataURI(null);
|
||||
|
||||
initResponses.add(derivedRecord);
|
||||
}
|
||||
}
|
||||
|
@ -204,31 +199,17 @@ public class SatelliteDataCubeAdapter implements IDataCubeAdapter {
|
|||
}
|
||||
}
|
||||
}
|
||||
return initResponses;
|
||||
return initResponses.toArray(new PluginDataObject[0]);
|
||||
} else {
|
||||
String scriptToExecute = ScriptCreator.createScript(property);
|
||||
return Loader
|
||||
.loadScripts(new String[] { scriptToExecute }, timeOut);
|
||||
return super.getData(originalQuery, selectedTimes);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public String recordKeyGenerator(PluginDataObject pdo) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IDataRecord[] getRecord(PluginDataObject obj)
|
||||
throws VizDataCubeException {
|
||||
if (obj.getMessageData() == null) {
|
||||
IDataRecord record = null;
|
||||
try {
|
||||
record = CubeUtil.retrieveData(obj, obj.getPluginName());
|
||||
} catch (VizException e) {
|
||||
throw new VizDataCubeException(
|
||||
"Error retrieving satellite record.", e);
|
||||
}
|
||||
return new IDataRecord[] { record };
|
||||
return super.getRecord(obj);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
@ -238,15 +219,7 @@ public class SatelliteDataCubeAdapter implements IDataCubeAdapter {
|
|||
public IDataRecord[] getRecord(PluginDataObject obj, Request req,
|
||||
String dataset) throws VizDataCubeException {
|
||||
if (obj.getMessageData() == null) {
|
||||
IDataRecord record = null;
|
||||
try {
|
||||
record = CubeUtil.retrieveData(obj, obj.getPluginName(), req,
|
||||
dataset);
|
||||
} catch (VizException e) {
|
||||
throw new VizDataCubeException(
|
||||
"Error retrieving satellite record.", e);
|
||||
}
|
||||
return new IDataRecord[] { record };
|
||||
return super.getRecord(obj, req, dataset);
|
||||
}
|
||||
|
||||
boolean interpolate = false;
|
||||
|
@ -344,34 +317,11 @@ public class SatelliteDataCubeAdapter implements IDataCubeAdapter {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getSupportedPlugins() {
|
||||
return new String[] { "satellite" };
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getInventory() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initInventory() {
|
||||
derParLibrary = DerivedParameterGenerator.getDerParLibrary();
|
||||
}
|
||||
|
||||
@Override
|
||||
public PointDataContainer getPoints(String plugin, String[] parameters,
|
||||
Map<String, RequestConstraint> queryParams) throws VizException {
|
||||
return getPoints(plugin, parameters, null, queryParams);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PointDataContainer getPoints(String plugin, String[] parameters,
|
||||
String levelKey, Map<String, RequestConstraint> queryParams)
|
||||
throws VizException {
|
||||
return null;
|
||||
}
|
||||
|
||||
private String getDataset(String dataUri, String dataset) {
|
||||
return "/" + dataUri + "/" + dataset;
|
||||
}
|
||||
|
@ -457,10 +407,7 @@ public class SatelliteDataCubeAdapter implements IDataCubeAdapter {
|
|||
}
|
||||
constraints.put(PE, pe);
|
||||
}
|
||||
List<Map<String, RequestConstraint>> result = new ArrayList<Map<String, RequestConstraint>>(
|
||||
1);
|
||||
result.add(constraints);
|
||||
return result;
|
||||
return super.getBaseUpdateConstraints(constraints);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -41,18 +41,7 @@
|
|||
name="AWIPS" description="Command category for AWIPS">
|
||||
</category>
|
||||
</extension>
|
||||
|
||||
<extension
|
||||
point="com.raytheon.uf.viz.core.scriptTemplate">
|
||||
<scriptTemplate
|
||||
pluginName="bufr"
|
||||
scriptLibrary="BaseRequest">
|
||||
</scriptTemplate>
|
||||
<scriptTemplate
|
||||
pluginName="taf"
|
||||
scriptLibrary="BaseRequest">
|
||||
</scriptTemplate>
|
||||
</extension>
|
||||
|
||||
<extension
|
||||
point="com.raytheon.uf.viz.core.component">
|
||||
<component key="viz" class="com.raytheon.viz.ui.personalities.awips.CAVE"/>
|
||||
|
|
|
@ -89,13 +89,6 @@
|
|||
</command>
|
||||
</menuContribution>
|
||||
</extension>
|
||||
<extension
|
||||
point="com.raytheon.uf.viz.core.scriptTemplate">
|
||||
<scriptTemplate
|
||||
pluginName="warngen"
|
||||
scriptTemplateFile="scriptTemplates/warngenRequestTemplate.vm">
|
||||
</scriptTemplate>
|
||||
</extension>
|
||||
<extension
|
||||
point="com.raytheon.uf.viz.localization.localizationpath">
|
||||
<path
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
|
||||
#if($mode == "select")
|
||||
#set($office = $scriptMetadata.get("office").constraintValue)
|
||||
#set($phenomena = $scriptMetadata.get("phenomena").constraintValue)
|
||||
#set($significance = $scriptMetadata.get("significance").constraintValue)
|
||||
import VtecEventRetrieval
|
||||
runner = VtecEventRetrieval.VtecEventRetrieval()
|
||||
runner.setClientID('VTEC Retrieval')
|
||||
runner.setFields('${office}','${phenomena}','${significance}')
|
||||
return runner.execute()
|
||||
#elseif($mode == "update")
|
||||
#set($office = $scriptMetadata.get("office").constraintValue)
|
||||
#set($phenomena = $scriptMetadata.get("phenomena").constraintValue)
|
||||
#set($significance = $scriptMetadata.get("significance").constraintValue)
|
||||
#set($sequence = $scriptMetadata.get("sequence").constraintValue)
|
||||
import VtecEventUpdate
|
||||
runner = VtecEventUpdate.VtecEventUpdate()
|
||||
runner.setClientID('VTEC Update')
|
||||
runner.setFields('${office}','${phenomena}','${significance}','${sequence}')
|
||||
return runner.execute()
|
||||
#end
|
|
@ -37,11 +37,4 @@
|
|||
name="Warnings">
|
||||
</command>
|
||||
</extension>
|
||||
<extension
|
||||
point="com.raytheon.uf.viz.core.scriptTemplate">
|
||||
<scriptTemplate
|
||||
pluginName="warning"
|
||||
scriptLibrary="BaseRequest">
|
||||
</scriptTemplate>
|
||||
</extension>
|
||||
</plugin>
|
||||
|
|
|
@ -32,7 +32,6 @@ 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.VizApp;
|
||||
import com.raytheon.uf.viz.core.catalog.LayerProperty;
|
||||
import com.raytheon.uf.viz.core.datastructure.DataCubeContainer;
|
||||
import com.raytheon.uf.viz.core.drawables.IDescriptor.FramesInfo;
|
||||
import com.raytheon.uf.viz.core.drawables.IFont;
|
||||
|
@ -44,7 +43,6 @@ import com.raytheon.uf.viz.core.map.MapDescriptor;
|
|||
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;
|
||||
import com.raytheon.uf.viz.core.rsc.capabilities.ColorableCapability;
|
||||
import com.raytheon.uf.viz.core.rsc.capabilities.MagnificationCapability;
|
||||
import com.raytheon.uf.viz.core.rsc.capabilities.OutlineCapability;
|
||||
|
@ -568,21 +566,8 @@ public abstract class AbstractWWAResource extends
|
|||
|
||||
earliestRequested = earliest;
|
||||
|
||||
LayerProperty property = new LayerProperty();
|
||||
property.setDesiredProduct(ResourceType.PLAN_VIEW);
|
||||
property.setEntryQueryParameters(map, false);
|
||||
property.setNumberOfImages(9999);
|
||||
|
||||
Object[] resp = null;
|
||||
resp = DataCubeContainer.getData(property, 60000).toArray(
|
||||
new Object[] {});
|
||||
PluginDataObject[] arr = new PluginDataObject[resp.length];
|
||||
int i = 0;
|
||||
for (Object o : resp) {
|
||||
arr[i] = (PluginDataObject) o;
|
||||
i++;
|
||||
}
|
||||
addRecord(sort(arr));
|
||||
PluginDataObject[] pdos = DataCubeContainer.getData(map);
|
||||
addRecord(sort(pdos));
|
||||
}
|
||||
|
||||
protected String[] getText(AbstractWarningRecord record, double mapWidth) {
|
||||
|
|
|
@ -108,7 +108,7 @@ import com.vividsolutions.jts.geom.Geometry;
|
|||
* Both refTime and forecastTime are included in the refTimeIndex since
|
||||
* forecastTime is unlikely to be used.
|
||||
*/
|
||||
@org.hibernate.annotations.Table(appliesTo = "bufrua", indexes = { @Index(name = "bufrua_refTimeIndex", columnNames = {
|
||||
@org.hibernate.annotations.Table(appliesTo = UAObs.PLUGIN_NAME, indexes = { @Index(name = "bufrua_refTimeIndex", columnNames = {
|
||||
"refTime", "forecastTime" }) })
|
||||
@XmlRootElement
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
|
@ -137,6 +137,8 @@ public class UAObs extends PersistablePluginDataObject implements
|
|||
}
|
||||
};
|
||||
|
||||
public static final String PLUGIN_NAME = "bufrua";
|
||||
|
||||
public static final Unit<Length> DISTANCE_UNIT = SI.METER;
|
||||
|
||||
public static final Unit<Temperature> TEMPERATURE_UNIT = SI.KELVIN;
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
package com.raytheon.uf.common.dataplugin.bufrua.dao;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
|
@ -46,6 +47,7 @@ import com.raytheon.uf.edex.decodertools.time.TimeTools;
|
|||
* Aug 19, 2009 jkorman Initial creation
|
||||
* Jul 19, 2013 1992 bsteffen Remove redundant time columns from
|
||||
* bufrua.
|
||||
* Sep 9, 2013 2277 mschenke Got rid of ScriptCreator references
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -56,61 +58,44 @@ import com.raytheon.uf.edex.decodertools.time.TimeTools;
|
|||
public class BufrUAPointDataTransform {
|
||||
|
||||
/** The logger */
|
||||
private static Log logger = LogFactory.getLog(BufrUAPointDataTransform.class);
|
||||
private static Log logger = LogFactory
|
||||
.getLog(BufrUAPointDataTransform.class);
|
||||
|
||||
public static final String[] HDR_PARAMS = new String[] { "wmoStaNum",
|
||||
"staName", "validTime", "relTime", "staElev", "latitude",
|
||||
"longitude", "dataURI", "sfcPressure", "rptType" };
|
||||
|
||||
public static final String HDR_PARAMS_LIST;
|
||||
static {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
|
||||
sb.append("wmoStaNum,");
|
||||
sb.append("staName,");
|
||||
sb.append("validTime,");
|
||||
sb.append("relTime,");
|
||||
sb.append("staElev,");
|
||||
sb.append("latitude,");
|
||||
sb.append("longitude,");
|
||||
sb.append("dataURI,");
|
||||
sb.append("sfcPressure,");
|
||||
sb.append("rptType,");
|
||||
|
||||
|
||||
for (int i = 0; i < HDR_PARAMS.length - 1; ++i) {
|
||||
sb.append(HDR_PARAMS[i]).append(",");
|
||||
}
|
||||
sb.append(HDR_PARAMS[HDR_PARAMS.length - 1]);
|
||||
HDR_PARAMS_LIST = sb.toString();
|
||||
}
|
||||
|
||||
|
||||
private static final String[] OTHER_PARAMS = new String[] { "numMand",
|
||||
"prMan", "htMan", "tpMan", "tdMan", "wdMan", "wsMan", "numTrop",
|
||||
"prTrop", "tpTrop", "tdTrop", "wdTrop", "wsTrop", "numMwnd",
|
||||
"prMaxW", "wdMaxW", "wsMaxW", "numSigT", "prSigT", "tpSigT",
|
||||
"tdSigT", "numSigW", "htSigW", "wdSigW", "wsSigW" };
|
||||
|
||||
public static final String[] MAN_PARAMS = Arrays.copyOf(HDR_PARAMS,
|
||||
HDR_PARAMS.length + OTHER_PARAMS.length);
|
||||
|
||||
public static final String MAN_PARAMS_LIST;
|
||||
static {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
sb.append(HDR_PARAMS_LIST);
|
||||
sb.append("numMand,");
|
||||
sb.append("prMan,");
|
||||
sb.append("htMan,");
|
||||
sb.append("tpMan,");
|
||||
sb.append("tdMan,");
|
||||
sb.append("wdMan,");
|
||||
sb.append("wsMan,");
|
||||
//-------------------------
|
||||
sb.append("numTrop,");
|
||||
sb.append("prTrop,");
|
||||
sb.append("tpTrop,");
|
||||
sb.append("tdTrop,");
|
||||
sb.append("wdTrop,");
|
||||
sb.append("wsTrop,");
|
||||
//-------------------------
|
||||
sb.append("numMwnd,");
|
||||
sb.append("prMaxW,");
|
||||
sb.append("wdMaxW,");
|
||||
sb.append("wsMaxW,");
|
||||
//-------------------------
|
||||
sb.append("numSigT,");
|
||||
sb.append("prSigT,");
|
||||
sb.append("tpSigT,");
|
||||
sb.append("tdSigT,");
|
||||
//-------------------------
|
||||
sb.append("numSigW,");
|
||||
sb.append("htSigW,");
|
||||
sb.append("wdSigW,");
|
||||
sb.append("wsSigW");
|
||||
//-------------------------
|
||||
sb.append(HDR_PARAMS_LIST).append(",");
|
||||
|
||||
for (int i = 0; i < OTHER_PARAMS.length - 1; ++i) {
|
||||
sb.append(OTHER_PARAMS[i]).append(",");
|
||||
MAN_PARAMS[HDR_PARAMS.length + i] = OTHER_PARAMS[i];
|
||||
}
|
||||
sb.append(OTHER_PARAMS[OTHER_PARAMS.length - 1]);
|
||||
MAN_PARAMS[MAN_PARAMS.length - 1] = OTHER_PARAMS[OTHER_PARAMS.length - 1];
|
||||
|
||||
MAN_PARAMS_LIST = sb.toString();
|
||||
}
|
||||
|
||||
|
@ -138,14 +123,14 @@ public class BufrUAPointDataTransform {
|
|||
obs.setLocation(location);
|
||||
Integer sfcpres = pdv.getNumber("sfcPressure").intValue();
|
||||
obs.setPressure_station(sfcpres);
|
||||
|
||||
|
||||
obs.setStationName(pdv.getString("staName"));
|
||||
}
|
||||
return obs;
|
||||
}
|
||||
|
||||
|
||||
private static UAObs getManUAObsRecord(PointDataView pdv, UAObs obs) {
|
||||
if(obs != null) {
|
||||
if (obs != null) {
|
||||
Number numLvls = pdv.getNumber("numMand");
|
||||
Number[] pr = pdv.getNumberAllLevels("prMan");
|
||||
Number[] ht = pdv.getNumberAllLevels("htMan");
|
||||
|
@ -154,7 +139,7 @@ public class BufrUAPointDataTransform {
|
|||
Number[] wd = pdv.getNumberAllLevels("wdMan");
|
||||
Number[] ws = pdv.getNumberAllLevels("wsMan");
|
||||
|
||||
if ((numLvls != null)&&(numLvls.intValue() > 0)) {
|
||||
if ((numLvls != null) && (numLvls.intValue() > 0)) {
|
||||
for (int i = 0; i < numLvls.intValue(); i++) {
|
||||
if (pr[i] != null) {
|
||||
if ((pr[i].intValue() > 120000)
|
||||
|
@ -163,7 +148,7 @@ public class BufrUAPointDataTransform {
|
|||
}
|
||||
}
|
||||
UAObsLevel lvl = new UAObsLevel();
|
||||
if(pr[i].intValue() == obs.getPressure_station()) {
|
||||
if (pr[i].intValue() == obs.getPressure_station()) {
|
||||
lvl.setVertSig(LayerTools.SFC_LEVEL);
|
||||
lvl.setGeoHeight(obs.getElevation());
|
||||
} else {
|
||||
|
@ -186,7 +171,7 @@ public class BufrUAPointDataTransform {
|
|||
wd = pdv.getNumberAllLevels("wdTrop");
|
||||
ws = pdv.getNumberAllLevels("wsTrop");
|
||||
|
||||
if ((numLvls != null)&&(numLvls.intValue() > 0)) {
|
||||
if ((numLvls != null) && (numLvls.intValue() > 0)) {
|
||||
for (int i = 0; i < numLvls.intValue(); i++) {
|
||||
if (pr[i] != null) {
|
||||
if ((pr[i].intValue() > 120000)
|
||||
|
@ -210,7 +195,7 @@ public class BufrUAPointDataTransform {
|
|||
wd = pdv.getNumberAllLevels("wdMaxW");
|
||||
ws = pdv.getNumberAllLevels("wsMaxW");
|
||||
|
||||
if ((numLvls != null)&&(numLvls.intValue() > 0)) {
|
||||
if ((numLvls != null) && (numLvls.intValue() > 0)) {
|
||||
for (int i = 0; i < numLvls.intValue(); i++) {
|
||||
if (pr[i] != null) {
|
||||
if ((pr[i].intValue() > 120000)
|
||||
|
@ -262,7 +247,7 @@ public class BufrUAPointDataTransform {
|
|||
}
|
||||
return obs;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param pdv
|
||||
|
@ -296,41 +281,41 @@ public class BufrUAPointDataTransform {
|
|||
}
|
||||
return obs;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param container
|
||||
* @return
|
||||
*/
|
||||
public static UAObs [] toUAObsRecords(PointDataContainer container) {
|
||||
public static UAObs[] toUAObsRecords(PointDataContainer container) {
|
||||
List<UAObs> records = new ArrayList<UAObs>();
|
||||
container.setCurrentSz(container.getAllocatedSz());
|
||||
for (int i = 0; i < container.getCurrentSz(); i++) {
|
||||
PointDataView pdv = container.readRandom(i);
|
||||
|
||||
|
||||
UAObs obs = getUAObsHdr(pdv);
|
||||
if(obs != null) {
|
||||
|
||||
switch(obs.getReportType()) {
|
||||
|
||||
case LayerTools.MANLVL_LO :
|
||||
case LayerTools.MANLVL_HI : {
|
||||
obs = getManUAObsRecord(pdv,obs);
|
||||
if (obs != null) {
|
||||
|
||||
switch (obs.getReportType()) {
|
||||
|
||||
case LayerTools.MANLVL_LO:
|
||||
case LayerTools.MANLVL_HI: {
|
||||
obs = getManUAObsRecord(pdv, obs);
|
||||
break;
|
||||
}
|
||||
|
||||
case LayerTools.SIGTLVL_LO :
|
||||
case LayerTools.SIGTLVL_HI : {
|
||||
obs = getObsSigTLevelData(pdv,obs);
|
||||
|
||||
case LayerTools.SIGTLVL_LO:
|
||||
case LayerTools.SIGTLVL_HI: {
|
||||
obs = getObsSigTLevelData(pdv, obs);
|
||||
break;
|
||||
}
|
||||
|
||||
case LayerTools.SIGWLVL_LO :
|
||||
case LayerTools.SIGWLVL_HI : {
|
||||
obs = getObsSigWLevelData(pdv,obs);
|
||||
|
||||
case LayerTools.SIGWLVL_LO:
|
||||
case LayerTools.SIGWLVL_HI: {
|
||||
obs = getObsSigWLevelData(pdv, obs);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
records.add(obs);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -118,6 +118,10 @@ public abstract class PluginDataObject extends PersistableDataObject implements
|
|||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final String PLUGIN_NAME_ID = "pluginName";
|
||||
|
||||
public static final String DATATIME_ID = "dataTime";
|
||||
|
||||
public static final String ID_GEN = "idgen";
|
||||
|
||||
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = ID_GEN)
|
||||
|
|
|
@ -148,6 +148,14 @@ public class DbQueryRequest implements IServerRequest {
|
|||
@DynamicSerializeElement
|
||||
private Integer limit;
|
||||
|
||||
public DbQueryRequest() {
|
||||
// For serialization
|
||||
}
|
||||
|
||||
public DbQueryRequest(Map<String, RequestConstraint> constraints) {
|
||||
setConstraints(new HashMap<String, RequestConstraint>(constraints));
|
||||
}
|
||||
|
||||
public String getDatabase() {
|
||||
return database;
|
||||
}
|
||||
|
|
|
@ -120,7 +120,11 @@ public class RequestConstraint implements ISerializableObject, Cloneable {
|
|||
* Constructor
|
||||
*/
|
||||
public RequestConstraint() {
|
||||
this.constraintType = ConstraintType.EQUALS;
|
||||
this(ConstraintType.EQUALS);
|
||||
}
|
||||
|
||||
public RequestConstraint(ConstraintType constraintType) {
|
||||
this.constraintType = constraintType;
|
||||
this.asMap = new HashMap<Class<?>, Object>();
|
||||
}
|
||||
|
||||
|
@ -146,6 +150,39 @@ public class RequestConstraint implements ISerializableObject, Cloneable {
|
|||
this.constraintType = type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a {@link RequestConstraint} with {@link ConstraintType#IN} with
|
||||
* inConstraints set as the {@link #setConstraintValueList(Collection)}
|
||||
*
|
||||
* @param inConstraints
|
||||
*/
|
||||
public RequestConstraint(Collection<String> inConstraints) {
|
||||
this(ConstraintType.IN);
|
||||
setConstraintValueList(inConstraints);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a {@link RequestConstraint} with {@link ConstraintType#IN} with
|
||||
* inConstraints set as the {@link #setConstraintValueList(String[])}
|
||||
*
|
||||
* @param inConstraints
|
||||
*/
|
||||
public RequestConstraint(String[] inConstraints) {
|
||||
this(ConstraintType.IN);
|
||||
setConstraintValueList(inConstraints);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a {@link RequestConstraint} with {@link ConstraintType#BETWEEN}
|
||||
*
|
||||
* @param low
|
||||
* @param high
|
||||
*/
|
||||
public RequestConstraint(String low, String high) {
|
||||
this(ConstraintType.BETWEEN);
|
||||
setBetweenValueList(new String[] { low, high });
|
||||
}
|
||||
|
||||
@Override
|
||||
public RequestConstraint clone() {
|
||||
return new RequestConstraint(constraintValue, constraintType);
|
||||
|
|
|
@ -10,13 +10,6 @@
|
|||
renderingOrderId="PLOT"
|
||||
resourceType="PLAN_VIEW"/>
|
||||
</extension>
|
||||
<extension
|
||||
point="com.raytheon.uf.viz.core.scriptTemplate">
|
||||
<scriptTemplate
|
||||
pluginName="airmet"
|
||||
scriptLibrary="BaseRequest">
|
||||
</scriptTemplate>
|
||||
</extension>
|
||||
<extension
|
||||
point="gov.noaa.nws.ncep.viz.resources.NC-Resource">
|
||||
<nc-resource
|
||||
|
|
|
@ -10,13 +10,6 @@
|
|||
renderingOrderId="PLOT"
|
||||
resourceType="PLAN_VIEW">
|
||||
</resource>
|
||||
</extension>
|
||||
<extension
|
||||
point="com.raytheon.uf.viz.core.scriptTemplate">
|
||||
<scriptTemplate
|
||||
pluginName="atcf"
|
||||
scriptLibrary="BaseRequest">
|
||||
</scriptTemplate>
|
||||
</extension>
|
||||
<extension
|
||||
point="gov.noaa.nws.ncep.viz.resources.NC-Resource">
|
||||
|
|
|
@ -10,13 +10,6 @@
|
|||
renderingOrderId="PLOT"
|
||||
resourceType="PLAN_VIEW"/>
|
||||
</extension>
|
||||
<extension
|
||||
point="com.raytheon.uf.viz.core.scriptTemplate">
|
||||
<scriptTemplate
|
||||
pluginName="convsigmet"
|
||||
scriptLibrary="BaseRequest">
|
||||
</scriptTemplate>
|
||||
</extension>
|
||||
<extension
|
||||
point="gov.noaa.nws.ncep.viz.resources.NC-Resource">
|
||||
<nc-resource
|
||||
|
|
|
@ -10,13 +10,6 @@
|
|||
renderingOrderId="PLOT"
|
||||
resourceType="PLAN_VIEW"/>
|
||||
</extension>
|
||||
<extension
|
||||
point="com.raytheon.uf.viz.core.scriptTemplate">
|
||||
<scriptTemplate
|
||||
pluginName="ffg"
|
||||
scriptLibrary="BaseRequest">
|
||||
</scriptTemplate>
|
||||
</extension>
|
||||
<extension
|
||||
point="gov.noaa.nws.ncep.viz.resources.NC-Resource">
|
||||
<nc-resource
|
||||
|
|
|
@ -10,13 +10,6 @@
|
|||
renderingOrderId="PLOT"
|
||||
resourceType="PLAN_VIEW"/>
|
||||
</extension>
|
||||
<extension
|
||||
point="com.raytheon.uf.viz.core.scriptTemplate">
|
||||
<scriptTemplate
|
||||
pluginName="tcm"
|
||||
scriptLibrary="BaseRequest">
|
||||
</scriptTemplate>
|
||||
</extension>
|
||||
<extension
|
||||
point="gov.noaa.nws.ncep.viz.resources.NC-Resource">
|
||||
<nc-resource
|
||||
|
|
|
@ -11,13 +11,6 @@
|
|||
renderingOrderId="PLOT"
|
||||
resourceType="PLAN_VIEW"/>
|
||||
</extension>
|
||||
<extension
|
||||
point="com.raytheon.uf.viz.core.scriptTemplate">
|
||||
<scriptTemplate
|
||||
pluginName="idft"
|
||||
scriptLibrary="BaseRequest">
|
||||
</scriptTemplate>
|
||||
</extension>
|
||||
<extension
|
||||
point="gov.noaa.nws.ncep.viz.resources.NC-Resource">
|
||||
<nc-resource
|
||||
|
|
|
@ -11,13 +11,6 @@
|
|||
resourceType="PLAN_VIEW">
|
||||
</resource>
|
||||
</extension>
|
||||
<extension
|
||||
point="com.raytheon.uf.viz.core.scriptTemplate">
|
||||
<scriptTemplate
|
||||
pluginName="intlsigmet"
|
||||
scriptLibrary="BaseRequest">
|
||||
</scriptTemplate>
|
||||
</extension>
|
||||
<extension
|
||||
point="gov.noaa.nws.ncep.viz.resources.NC-Resource">
|
||||
<nc-resource
|
||||
|
|
|
@ -10,15 +10,6 @@
|
|||
renderingOrderId="PLOT"
|
||||
resourceType="PLAN_VIEW"/>
|
||||
</extension>
|
||||
<!-- already extended by raytheon's lightning resource
|
||||
<extension
|
||||
point="com.raytheon.uf.viz.core.scriptTemplate">
|
||||
<scriptTemplate
|
||||
pluginName="binlightning"
|
||||
scriptLibrary="BaseRequest">
|
||||
</scriptTemplate>
|
||||
</extension>
|
||||
-->
|
||||
<extension
|
||||
point="gov.noaa.nws.ncep.viz.resources.NC-Resource">
|
||||
<nc-resource
|
||||
|
|
|
@ -19,13 +19,6 @@
|
|||
</units>
|
||||
</extension>
|
||||
-->
|
||||
<extension
|
||||
point="com.raytheon.uf.viz.core.scriptTemplate">
|
||||
<scriptTemplate
|
||||
pluginName="mosaic"
|
||||
scriptLibrary="BaseRequest">
|
||||
</scriptTemplate>
|
||||
</extension>
|
||||
<extension
|
||||
point="gov.noaa.nws.ncep.viz.resources.NC-Resource">
|
||||
<nc-resource
|
||||
|
|
|
@ -10,13 +10,6 @@
|
|||
renderingOrderId="PLOT"
|
||||
resourceType="PLAN_VIEW"/>
|
||||
</extension>
|
||||
<extension
|
||||
point="com.raytheon.uf.viz.core.scriptTemplate">
|
||||
<scriptTemplate
|
||||
pluginName="ncscat"
|
||||
scriptLibrary="BaseRequest">
|
||||
</scriptTemplate>
|
||||
</extension>
|
||||
<extension
|
||||
point="gov.noaa.nws.ncep.viz.resources.NC-Resource">
|
||||
<nc-resource
|
||||
|
|
|
@ -10,13 +10,6 @@
|
|||
renderingOrderId="PLOT"
|
||||
resourceType="PLAN_VIEW"/>
|
||||
</extension>
|
||||
<extension
|
||||
point="com.raytheon.uf.viz.core.scriptTemplate">
|
||||
<scriptTemplate
|
||||
pluginName="nonconvsigmet"
|
||||
scriptLibrary="BaseRequest">
|
||||
</scriptTemplate>
|
||||
</extension>
|
||||
<extension
|
||||
point="gov.noaa.nws.ncep.viz.resources.NC-Resource">
|
||||
<nc-resource
|
||||
|
|
|
@ -10,13 +10,6 @@
|
|||
renderingOrderId="PLOT"
|
||||
resourceType="PLAN_VIEW"/>
|
||||
</extension>
|
||||
<extension
|
||||
point="com.raytheon.uf.viz.core.scriptTemplate">
|
||||
<scriptTemplate
|
||||
pluginName="ntrans"
|
||||
scriptLibrary="BaseRequest">
|
||||
</scriptTemplate>
|
||||
</extension>
|
||||
<extension
|
||||
point="gov.noaa.nws.ncep.viz.resources.NC-Resource">
|
||||
<nc-resource
|
||||
|
|
|
@ -17,13 +17,6 @@
|
|||
resourceType="PLAN_VIEW">
|
||||
</resource>
|
||||
</extension>
|
||||
<extension
|
||||
point="com.raytheon.uf.viz.core.scriptTemplate">
|
||||
<scriptTemplate
|
||||
pluginName="mcidas"
|
||||
scriptLibrary="BaseRequest">
|
||||
</scriptTemplate>
|
||||
</extension>
|
||||
<extension
|
||||
point="gov.noaa.nws.ncep.viz.resources.NC-Resource">
|
||||
<nc-resource
|
||||
|
|
|
@ -10,13 +10,6 @@
|
|||
renderingOrderId="PLOT"
|
||||
resourceType="PLAN_VIEW">
|
||||
</resource>
|
||||
</extension>
|
||||
<extension
|
||||
point="com.raytheon.uf.viz.core.scriptTemplate">
|
||||
<scriptTemplate
|
||||
pluginName="stormtrack"
|
||||
scriptLibrary="BaseRequest">
|
||||
</scriptTemplate>
|
||||
</extension>
|
||||
<extension
|
||||
point="gov.noaa.nws.ncep.viz.resources.NC-Resource">
|
||||
|
|
|
@ -11,13 +11,6 @@
|
|||
renderingOrderId="PLOT"
|
||||
resourceType="PLAN_VIEW"/>
|
||||
</extension>
|
||||
<extension
|
||||
point="com.raytheon.uf.viz.core.scriptTemplate">
|
||||
<scriptTemplate
|
||||
pluginName="sgwh"
|
||||
scriptLibrary="BaseRequest">
|
||||
</scriptTemplate>
|
||||
</extension>
|
||||
<extension
|
||||
point="gov.noaa.nws.ncep.viz.resources.NC-Resource">
|
||||
<nc-resource
|
||||
|
|
|
@ -10,13 +10,6 @@
|
|||
renderingOrderId="PLOT"
|
||||
resourceType="PLAN_VIEW"/>
|
||||
</extension>
|
||||
<extension
|
||||
point="com.raytheon.uf.viz.core.scriptTemplate">
|
||||
<scriptTemplate
|
||||
pluginName="wcp"
|
||||
scriptLibrary="BaseRequest">
|
||||
</scriptTemplate>
|
||||
</extension>
|
||||
<extension
|
||||
point="gov.noaa.nws.ncep.viz.resources.NC-Resource">
|
||||
<nc-resource
|
||||
|
|
Loading…
Add table
Reference in a new issue