diff --git a/cave/com.raytheon.uf.viz.coopprecip/src/com/raytheon/uf/viz/coopprecip/CoopPrecipDataCubeAdapter.java b/cave/com.raytheon.uf.viz.coopprecip/src/com/raytheon/uf/viz/coopprecip/CoopPrecipDataCubeAdapter.java index 854a2afb51..88823e4813 100644 --- a/cave/com.raytheon.uf.viz.coopprecip/src/com/raytheon/uf/viz/coopprecip/CoopPrecipDataCubeAdapter.java +++ b/cave/com.raytheon.uf.viz.coopprecip/src/com/raytheon/uf/viz/coopprecip/CoopPrecipDataCubeAdapter.java @@ -82,7 +82,7 @@ public class CoopPrecipDataCubeAdapter implements IDataCubeAdapter { private static final PointDataDescription rtpDescription = new PointDataDescription(); static { - ffgDescription.parameters = new ParameterDescription[8]; + ffgDescription.parameters = new ParameterDescription[9]; ffgDescription.parameters[0] = new ParameterDescription("time", Type.LONG); ffgDescription.parameters[1] = new ParameterDescription("latitude", @@ -98,8 +98,9 @@ public class CoopPrecipDataCubeAdapter implements IDataCubeAdapter { ffgDescription.parameters[6] = new ParameterDescription("stationId", Type.STRING); ffgDescription.parameters[7] = new ParameterDescription("id", Type.INT); + ffgDescription.parameters[8] = new ParameterDescription("dataURI", Type.STRING); - rtpDescription.parameters = new ParameterDescription[6]; + rtpDescription.parameters = new ParameterDescription[7]; rtpDescription.parameters[0] = new ParameterDescription("time", Type.LONG); rtpDescription.parameters[1] = new ParameterDescription("latitude", @@ -111,6 +112,8 @@ public class CoopPrecipDataCubeAdapter implements IDataCubeAdapter { rtpDescription.parameters[4] = new ParameterDescription("stationId", Type.STRING); rtpDescription.parameters[5] = new ParameterDescription("id", Type.INT); + rtpDescription.parameters[6] = new ParameterDescription("dataURI", Type.STRING); + } @Override @@ -238,6 +241,7 @@ public class CoopPrecipDataCubeAdapter implements IDataCubeAdapter { pdv.setFloat("3hr", Float.valueOf(parts[1])); pdv.setFloat("6hr", Float.valueOf(parts[2])); pdv.setString("stationId", station); + pdv.setString("dataURI", "/textPoints/" + station + "/" + time); // TODO this id is not really guaranteed to be unique pdv.setInt("id", ((int) time) + station.hashCode()); } @@ -315,6 +319,7 @@ public class CoopPrecipDataCubeAdapter implements IDataCubeAdapter { pdv.setFloat("latitude", (float) coord.latlon.y); pdv.setFloat("precip", precip); pdv.setString("stationId", station); + pdv.setString("dataURI", "/textPoints/" + station + "/" + time); // TODO this id is not really guaranteed to be unique pdv.setInt("id", ((int) time) + station.hashCode()); } diff --git a/cave/com.raytheon.uf.viz.coopprecip/src/com/raytheon/uf/viz/coopprecip/CoopPrecipPlotInfoRetriever.java b/cave/com.raytheon.uf.viz.coopprecip/src/com/raytheon/uf/viz/coopprecip/CoopPrecipPlotInfoRetriever.java index 9c87024166..41b3400cf1 100644 --- a/cave/com.raytheon.uf.viz.coopprecip/src/com/raytheon/uf/viz/coopprecip/CoopPrecipPlotInfoRetriever.java +++ b/cave/com.raytheon.uf.viz.coopprecip/src/com/raytheon/uf/viz/coopprecip/CoopPrecipPlotInfoRetriever.java @@ -69,7 +69,6 @@ public class CoopPrecipPlotInfoRetriever extends AbstractPlotInfoRetriever { for (int uriCounter = 0; uriCounter < pdc.getCurrentSz(); uriCounter++) { PointDataView pdv = pdc.readRandom(uriCounter); PlotInfo stationInfo = new PlotInfo(); - stationInfo.id = pdv.getInt("id"); stationInfo.latitude = pdv.getNumber("latitude").doubleValue(); stationInfo.longitude = pdv.getNumber("longitude") .doubleValue(); @@ -80,6 +79,7 @@ public class CoopPrecipPlotInfoRetriever extends AbstractPlotInfoRetriever { stationInfo.pdv = new PlotData(); } stationInfo.pdv.addData(pdv); + stationInfo.dataURI = pdv.getString("dataURI"); info.add(stationInfo); } } diff --git a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/alerts/AlertMessage.java b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/alerts/AlertMessage.java index ac40526860..2828694d7c 100644 --- a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/alerts/AlertMessage.java +++ b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/alerts/AlertMessage.java @@ -1,19 +1,19 @@ /** * 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 + * 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 - * + * 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. **/ @@ -38,8 +38,6 @@ import java.util.Map; */ public class AlertMessage { - /** The id of the alert */ - public Integer id; /** The raw string dataURI */ public String dataURI; diff --git a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/datastructure/DecisionTree.java b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/datastructure/DecisionTree.java index 66904c0467..2277a48f69 100644 --- a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/datastructure/DecisionTree.java +++ b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/datastructure/DecisionTree.java @@ -383,7 +383,7 @@ public class DecisionTree { } protected List getDataPairs() { - return dataPairs; + return new ArrayList.DataPair>(dataPairs); } private static double calcEntropy(int numExamples, Integer[] values) { diff --git a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/rsc/URICatalog.java b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/rsc/URICatalog.java index 93f5e0edfd..7adfe28169 100644 --- a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/rsc/URICatalog.java +++ b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/rsc/URICatalog.java @@ -83,7 +83,12 @@ public class URICatalog extends DecisionTree> { } protected static synchronized void setCustomInstance(URICatalog catalog) { - // TODO what to do if there already is an isntance. + if (instance != null) { + for (DataPair pair : instance.getDataPairs()) { + catalog.insertCriteria(pair.metadata, pair.data, false); + } + catalog.rebuildTree(); + } instance = catalog; } diff --git a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/rsc/updater/DataUpdateTree.java b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/rsc/updater/DataUpdateTree.java index d5826f08d7..080c3fe413 100644 --- a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/rsc/updater/DataUpdateTree.java +++ b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/rsc/updater/DataUpdateTree.java @@ -1,19 +1,19 @@ /** * 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 + * 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 - * + * 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. **/ @@ -50,7 +50,17 @@ public class DataUpdateTree extends DecisionTree> { return instance; } - public DataUpdateTree() { + protected static synchronized void setCustomInstance(DataUpdateTree tree) { + if (instance != null) { + for (DataPair pair : instance.getDataPairs()) { + tree.insertCriteria(pair.metadata, pair.data, false); + } + tree.rebuildTree(); + } + instance = tree; + } + + protected DataUpdateTree() { super(); } diff --git a/cave/com.raytheon.uf.viz.derivparam/src/com/raytheon/uf/viz/derivparam/tree/DerivedLevelNode.java b/cave/com.raytheon.uf.viz.derivparam/src/com/raytheon/uf/viz/derivparam/tree/DerivedLevelNode.java index cd831997bc..7a5caf5eb4 100644 --- a/cave/com.raytheon.uf.viz.derivparam/src/com/raytheon/uf/viz/derivparam/tree/DerivedLevelNode.java +++ b/cave/com.raytheon.uf.viz.derivparam/src/com/raytheon/uf/viz/derivparam/tree/DerivedLevelNode.java @@ -65,6 +65,8 @@ import com.raytheon.uf.viz.derivparam.library.IDerivParamField; public class DerivedLevelNode extends AbstractDerivedLevelNode { + private static final int TIME_QUERY_CACHE_TIME = 30000; + private Map fieldStaticData = null; private Map fields = null; @@ -75,6 +77,8 @@ public class DerivedLevelNode extends AbstractDerivedLevelNode { */ private Map> timeCache = null; + private long lastTimeQuery = 0; + private int dt; public DerivedLevelNode(Level level, DerivParamDesc desc, @@ -149,6 +153,7 @@ public class DerivedLevelNode extends AbstractDerivedLevelNode { Map> cache, Map> latestOnlyCache) throws VizException { + this.lastTimeQuery = System.currentTimeMillis(); Map> timeCache = new HashMap>(); // We have a derived parameter for the requested grid Set availableDataTimes = null; @@ -277,7 +282,9 @@ public class DerivedLevelNode extends AbstractDerivedLevelNode { int timeOut, Map> cache) throws VizException { - if (this.timeCache == null) { + if (this.timeCache == null + || this.lastTimeQuery + TIME_QUERY_CACHE_TIME < System + .currentTimeMillis()) { this.timeQuery(false); } diff --git a/cave/com.raytheon.uf.viz.thinclient.cave/src/com/raytheon/uf/viz/thinclient/cave/refresh/DataRefreshTask.java b/cave/com.raytheon.uf.viz.thinclient.cave/src/com/raytheon/uf/viz/thinclient/cave/refresh/DataRefreshTask.java index 75e27ca1d1..a07089df10 100644 --- a/cave/com.raytheon.uf.viz.thinclient.cave/src/com/raytheon/uf/viz/thinclient/cave/refresh/DataRefreshTask.java +++ b/cave/com.raytheon.uf.viz.thinclient.cave/src/com/raytheon/uf/viz/thinclient/cave/refresh/DataRefreshTask.java @@ -20,23 +20,11 @@ package com.raytheon.uf.viz.thinclient.cave.refresh; import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PlatformUI; -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.viz.core.AbstractTimeMatcher; -import com.raytheon.uf.viz.core.IDisplayPane; -import com.raytheon.uf.viz.core.exception.VizException; -import com.raytheon.uf.viz.core.rsc.AbstractVizResource; import com.raytheon.uf.viz.thinclient.Activator; import com.raytheon.uf.viz.thinclient.preferences.ThinClientPreferenceConstants; import com.raytheon.uf.viz.thinclient.refresh.TimedRefresher.RefreshTimerTask; import com.raytheon.viz.alerts.jobs.AutoUpdater; -import com.raytheon.viz.ui.editor.AbstractEditor; -import com.raytheon.viz.ui.perspectives.AbstractVizPerspectiveManager; -import com.raytheon.viz.ui.perspectives.VizPerspectiveListener; /** * Timer task responsible for refreshing IEditorParts that implement @@ -59,11 +47,6 @@ import com.raytheon.viz.ui.perspectives.VizPerspectiveListener; public class DataRefreshTask implements RefreshTimerTask { - private IUFStatusHandler statusHandler = UFStatus - .getHandler(DataRefreshTask.class); - - private AutoUpdater autoUpdater = new AutoUpdater(); - /* * (non-Javadoc) * @@ -72,48 +55,9 @@ public class DataRefreshTask implements RefreshTimerTask { @Override public void run() { IPreferenceStore store = Activator.getDefault().getPreferenceStore(); - if (!store.getBoolean(ThinClientPreferenceConstants.P_DISABLE_JMS)) { - return; - } - // For every window open, redo time matching on every descriptor on - // every editor for the window. A bit D2D specific, but it is how the - // AutoUpdater works which is what we are mimicking. - for (IWorkbenchWindow window : PlatformUI.getWorkbench() - .getWorkbenchWindows()) { - // Find listener for window - VizPerspectiveListener listener = VizPerspectiveListener - .getInstance(window); - if (listener != null) { - // Find active perspective manager for listener - AbstractVizPerspectiveManager manager = listener - .getActivePerspectiveManager(); - if (manager != null) { - // Process each editor - for (AbstractEditor editor : manager - .getPerspectiveEditors()) { - for (IDisplayPane pane : editor.getDisplayPanes()) { - // Get the time matcher - AbstractTimeMatcher atm = pane.getDescriptor() - .getTimeMatcher(); - if (atm != null) { - try { - // Redo time matching. This will trigger - // updates and removal of old data - AbstractVizResource tmb = atm - .getTimeMatchBasis(); - if (tmb != null) { - atm.redoTimeMatching(tmb); - } - atm.redoTimeMatching(pane.getDescriptor()); - } catch (VizException e) { - statusHandler.handle(Priority.PROBLEM, - e.getLocalizedMessage(), e); - } - } - } - } - } - } + if (store.getBoolean(ThinClientPreferenceConstants.P_DISABLE_JMS)) { + new AutoUpdater().alertArrived(ThinClientDataUpdateTree + .getInstance().updateAllData()); } } diff --git a/cave/com.raytheon.uf.viz.thinclient.cave/src/com/raytheon/uf/viz/thinclient/cave/refresh/ThinClientDataUpdateTree.java b/cave/com.raytheon.uf.viz.thinclient.cave/src/com/raytheon/uf/viz/thinclient/cave/refresh/ThinClientDataUpdateTree.java new file mode 100644 index 0000000000..f4cc3a5ef6 --- /dev/null +++ b/cave/com.raytheon.uf.viz.thinclient.cave/src/com/raytheon/uf/viz/thinclient/cave/refresh/ThinClientDataUpdateTree.java @@ -0,0 +1,126 @@ +/** + * 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.thinclient.cave.refresh; + +import java.text.SimpleDateFormat; +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; + +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.status.IUFStatusHandler; +import com.raytheon.uf.common.status.UFStatus; +import com.raytheon.uf.common.status.UFStatus.Priority; +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.rsc.AbstractRequestableResourceData; +import com.raytheon.uf.viz.core.rsc.AbstractResourceData; +import com.raytheon.uf.viz.core.rsc.updater.DataUpdateTree; + +/** + * TODO Add Description + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Dec 13, 2011            bsteffen     Initial creation
+ * 
+ * 
+ * + * @author bsteffen + * @version 1.0 + */ + +public class ThinClientDataUpdateTree extends DataUpdateTree { + private IUFStatusHandler statusHandler = UFStatus + .getHandler(ThinClientDataUpdateTree.class); + + private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat( + "yyyy-MM-dd HH:mm:ss.SSS"); + + private long lastQuery = 0l; + + public static synchronized ThinClientDataUpdateTree getInstance() { + DataUpdateTree instance = DataUpdateTree.getInstance(); + if (!(instance instanceof ThinClientDataUpdateTree)) { + instance = new ThinClientDataUpdateTree(); + setCustomInstance(instance); + } + return (ThinClientDataUpdateTree) instance; + } + + private ThinClientDataUpdateTree() { + DATE_FORMAT.setTimeZone(TimeZone.getTimeZone("GMT")); + lastQuery = System.currentTimeMillis(); + } + + public Collection updateAllData() { + String time = DATE_FORMAT.format(new Date(lastQuery)); + // put in a 1 second overlap in case insert time is a bit off. + lastQuery = System.currentTimeMillis() - 1000; + Set messages = new HashSet(); + for (DataPair pair : getDataPairs()) { + AbstractResourceData resourceData = pair.data.getResourceData(); + if (!(resourceData instanceof AbstractRequestableResourceData) + || resourceData.isFrozen()) + continue; + Map metadata = pair.metadata; + metadata = new HashMap(metadata); + metadata.put("insertTime", new RequestConstraint(time, + ConstraintType.GREATER_THAN)); + LayerProperty property = new LayerProperty(); + try { + property.setEntryQueryParameters(metadata, false); + List 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); + } + } + } + } catch (VizException e) { + statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), + e); + } + } + return messages; + } + +} diff --git a/cave/com.raytheon.viz.alerts/src/com/raytheon/viz/alerts/observers/ProductAlertObserver.java b/cave/com.raytheon.viz.alerts/src/com/raytheon/viz/alerts/observers/ProductAlertObserver.java index 12ad3ca272..c83bf232d9 100644 --- a/cave/com.raytheon.viz.alerts/src/com/raytheon/viz/alerts/observers/ProductAlertObserver.java +++ b/cave/com.raytheon.viz.alerts/src/com/raytheon/viz/alerts/observers/ProductAlertObserver.java @@ -299,20 +299,16 @@ public class ProductAlertObserver implements INotificationObserver { if ((payLoad instanceof DataURINotificationMessage) || (CAVEMode.getMode().equals(CAVEMode.PRACTICE) && payLoad instanceof PracticeDataURINotificationMessage)) { String[] dataURIs = null; - int[] ids = null; if (payLoad instanceof DataURINotificationMessage) { DataURINotificationMessage uriMsg = (DataURINotificationMessage) payLoad; dataURIs = uriMsg.getDataURIs(); - ids = uriMsg.getIds(); } else { PracticeDataURINotificationMessage uriMsg = (PracticeDataURINotificationMessage) payLoad; dataURIs = uriMsg.getDataURIs(); - ids = uriMsg.getIds(); } for (int i = 0; i < dataURIs.length; ++i) { String str = dataURIs[i]; - Integer id = ids[i]; - processDataURI(str, id); + processDataURI(str); } startWrappers(); @@ -338,12 +334,12 @@ public class ProductAlertObserver implements INotificationObserver { public static void processDerivedAlerts(Collection datauris) { for (String datauri : datauris) { - getInstance().processDataURI(datauri, 0); + getInstance().processDataURI(datauri); } getInstance().startWrappers(); } - private void processDataURI(String datauri, int id) { + private void processDataURI(String datauri) { if (datauri == null) return; try { @@ -363,7 +359,6 @@ public class ProductAlertObserver implements INotificationObserver { } AlertMessage am = new AlertMessage(); - am.id = id; am.dataURI = datauri; am.decodedAlert = Collections.unmodifiableMap(attribs); List obsList = observers.get(NO_FILTER_CONSTANT); diff --git a/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/IPlotModelGeneratorCaller.java b/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/IPlotModelGeneratorCaller.java index 4aa34375ae..db1ebce4d0 100644 --- a/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/IPlotModelGeneratorCaller.java +++ b/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/IPlotModelGeneratorCaller.java @@ -42,5 +42,5 @@ public interface IPlotModelGeneratorCaller { public void clearImages(); - public void messageGenerated(int id, String message); + public void messageGenerated(String dataURI, String message); } diff --git a/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/PlotAlertParser.java b/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/PlotAlertParser.java index 89f7551497..00a582d0ea 100644 --- a/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/PlotAlertParser.java +++ b/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/PlotAlertParser.java @@ -1,19 +1,19 @@ /** * 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 + * 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 - * + * 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. **/ @@ -54,7 +54,7 @@ public class PlotAlertParser extends AbstractAlertMessageParser { Double lat = (Double) message.decodedAlert.get("location.latitude"); Double lon = (Double) message.decodedAlert.get("location.longitude"); DataTime dataTime = (DataTime) message.decodedAlert.get("dataTime"); - return new PlotInfo(message.id, stationId, lat, lon, dataTime, + return new PlotInfo(stationId, lat, lon, dataTime, message.dataURI); } } diff --git a/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/PlotInfo.java b/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/PlotInfo.java index 9ad6e8d29b..196ec90e15 100644 --- a/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/PlotInfo.java +++ b/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/PlotInfo.java @@ -39,8 +39,6 @@ import com.raytheon.uf.common.time.DataTime; public class PlotInfo { - public Integer id; - public String stationId; public Double latitude; @@ -68,9 +66,8 @@ public class PlotInfo { } - public PlotInfo(Integer id, String stationId, Double latitude, + public PlotInfo(String stationId, Double latitude, Double longitude, DataTime dataTime, String dataURI) { - this.id = id; this.stationId = stationId; this.latitude = latitude; this.longitude = longitude; diff --git a/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/PlotModelDataRequestJob.java b/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/PlotModelDataRequestJob.java index 03cd2352d4..6203e1cfc5 100644 --- a/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/PlotModelDataRequestJob.java +++ b/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/PlotModelDataRequestJob.java @@ -166,14 +166,6 @@ public class PlotModelDataRequestJob extends Job { } } - // cleanup - for (PlotInfo[] plotInfoArray : stationQuery) { - for (int i = 0; i < plotInfoArray.length; i++) { - // currently the dataUris are never used again, clear - // them to free up as much memory as possible - plotInfoArray[i].dataURI = null; - } - } } // end of while !stationQueue.isEmpty() return Status.OK_STATUS; @@ -181,7 +173,7 @@ public class PlotModelDataRequestJob extends Job { private void requestData(List stationQuery, List pme) { - Map plotMap = new HashMap(); + Map plotMap = new HashMap(); List params = new ArrayList(); for (PlotModelElement p : pme) { @@ -194,6 +186,10 @@ public class PlotModelDataRequestJob extends Job { } } } + + if(!params.contains("dataURI")){ + params.add("dataURI"); + } Map map = new HashMap(); map.putAll(this.constraintMap); @@ -202,8 +198,8 @@ public class PlotModelDataRequestJob extends Job { List str = new ArrayList(stationQuery.size()); for (PlotInfo[] infos : stationQuery) { for (PlotInfo info : infos) { - str.add(Integer.toString(info.id)); - plotMap.put(info.id, info); + str.add(info.dataURI); + plotMap.put(info.dataURI, info); } } @@ -217,7 +213,7 @@ public class PlotModelDataRequestJob extends Job { index++; j++; } - map.put("id", rc); + map.put("dataURI", rc); try { // Try and get data from datacube long t0 = System.currentTimeMillis(); @@ -241,8 +237,8 @@ public class PlotModelDataRequestJob extends Job { for (int uriCounter = 0; uriCounter < pdc.getAllocatedSz(); uriCounter++) { PointDataView pdv = pdc.readRandom(uriCounter); if (pdv != null) { - int id = pdv.getInt("id"); - PlotInfo info = plotMap.get(id); + String dataURI = pdv.getString("dataURI"); + PlotInfo info = plotMap.get(dataURI); // If the id doesn't match, try to match by // location if (info == null) { @@ -255,8 +251,6 @@ public class PlotModelDataRequestJob extends Job { - pdv.getFloat("longitude")); if (diffLat < 0.01 && diffLon < 0.01) { info = pi; - pdv.setInt("id", pi.id); - id = pi.id; } } } diff --git a/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/PlotModelFactory2.java b/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/PlotModelFactory2.java index a5ae602663..ce0ac0a77e 100644 --- a/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/PlotModelFactory2.java +++ b/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/PlotModelFactory2.java @@ -569,7 +569,7 @@ public class PlotModelFactory2 { * @return A buffered image representing the station data */ public synchronized BufferedImage getStationPlot(PlotData stationData, - int id, double latitude, double longitude) { + double latitude, double longitude) { double[] stationLocation = { longitude, latitude }; double[] stationPixelLocation = this.mapDescriptor .worldToPixel(stationLocation); @@ -701,7 +701,7 @@ public class PlotModelFactory2 { return null; } - public synchronized String getStationMessage(PlotData stationData, int id) { + public synchronized String getStationMessage(PlotData stationData, String dataURI) { PlotPythonScript script = null; StringBuilder sampleMessage = new StringBuilder(); try { diff --git a/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/PlotModelGeneratorJob.java b/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/PlotModelGeneratorJob.java index 80917adc72..f71bb2deba 100644 --- a/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/PlotModelGeneratorJob.java +++ b/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/PlotModelGeneratorJob.java @@ -90,7 +90,7 @@ public class PlotModelGeneratorJob extends Job { try { PlotInfo[] infos = taskQueue.poll(); BufferedImage bImage = plotCreator.getStationPlot(infos[0].pdv, - infos[0].id, infos[0].latitude, infos[0].longitude); + infos[0].latitude, infos[0].longitude); IImage image = null; if (bImage != null) { if (imageCache.containsKey(bImage)) { diff --git a/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/rsc/PlotResource2.java b/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/rsc/PlotResource2.java index c80ec30d93..01e6447833 100644 --- a/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/rsc/PlotResource2.java +++ b/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/rsc/PlotResource2.java @@ -123,7 +123,7 @@ public class PlotResource2 extends private JobPool frameRetrievalPool = new JobPool("Retrieving plot frame", 8, true); - private TreeMap rawMessageMap = new TreeMap(); + private TreeMap rawMessageMap = new TreeMap(); private class FrameRetriever implements Runnable { @@ -342,7 +342,8 @@ public class PlotResource2 extends } boolean dup = false; for (int i = 0; i < existingStation.info.length; i++) { - if (existingStation.info[i].id.equals(plot.id)) { + if (existingStation.info[i].dataURI + .equals(plot.dataURI)) { // existingStation.info[i] = plot; dup = true; break; @@ -501,15 +502,15 @@ public class PlotResource2 extends } if (inspectPlot != null) { - int id = inspectPlot[0].id; - if (rawMessageMap.containsKey(id)) { - if (rawMessageMap.get(id) != null) { - message = rawMessageMap.get(id); + String dataURI = inspectPlot[0].dataURI; + if (rawMessageMap.containsKey(dataURI)) { + if (rawMessageMap.get(dataURI) != null) { + message = rawMessageMap.get(dataURI); } } else { message = "Generating..."; synchronized (rawMessageMap) { - rawMessageMap.put(id, message); + rawMessageMap.put(dataURI, message); } List list = new ArrayList(); list.add(inspectPlot); @@ -711,9 +712,9 @@ public class PlotResource2 extends } @Override - public void messageGenerated(int id, String message) { + public void messageGenerated(String dataURI, String message) { synchronized (rawMessageMap) { - rawMessageMap.put(id, message); + rawMessageMap.put(dataURI, message); } issueRefresh(); } diff --git a/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/rsc/retrieve/FullDataPlotInfoRetriever.java b/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/rsc/retrieve/FullDataPlotInfoRetriever.java index 0089edf5ad..2398054438 100644 --- a/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/rsc/retrieve/FullDataPlotInfoRetriever.java +++ b/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/rsc/retrieve/FullDataPlotInfoRetriever.java @@ -56,9 +56,6 @@ public class FullDataPlotInfoRetriever extends AbstractPlotInfoRetriever { @XmlAttribute private String parameters; - @XmlAttribute - private String id = "id"; - @XmlAttribute private String stationId = null; @@ -77,7 +74,6 @@ public class FullDataPlotInfoRetriever extends AbstractPlotInfoRetriever { private String[] getParameters() { List parameters = new ArrayList(); parameters.addAll(Arrays.asList(this.parameters.split(","))); - parameters.add(id); if (stationId != null) { parameters.add(stationId); } @@ -86,7 +82,6 @@ public class FullDataPlotInfoRetriever extends AbstractPlotInfoRetriever { parameters.add(validTime); if (fcstTime != null) { parameters.add(fcstTime); - ; } parameters.add("dataURI"); return parameters.toArray(new String[0]); @@ -122,7 +117,6 @@ public class FullDataPlotInfoRetriever extends AbstractPlotInfoRetriever { PointDataView pdv = pdc.readRandom(uriCounter); PlotInfo info = new PlotInfo(); info.pdv.addData(pdv); - info.id = pdv.getInt(id); if (stationId != null) { info.stationId = pdv.getString(stationId); } diff --git a/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/rsc/retrieve/PointDataPlotInfoRetriever.java b/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/rsc/retrieve/PointDataPlotInfoRetriever.java index efb535ddb6..600c3861a3 100644 --- a/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/rsc/retrieve/PointDataPlotInfoRetriever.java +++ b/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/rsc/retrieve/PointDataPlotInfoRetriever.java @@ -66,7 +66,7 @@ public class PointDataPlotInfoRetriever extends AbstractDbPlotInfoRetriever { @Override protected void addColumns(DbQuery dq) { - dq.addColumn("id"); + dq.addColumn("dataURI"); dq.addColumn("location.latitude"); dq.addColumn("location.longitude"); dq.addColumn("location.stationId"); @@ -81,7 +81,7 @@ public class PointDataPlotInfoRetriever extends AbstractDbPlotInfoRetriever { @Override protected PlotInfo getPlotInfo(Object[] data) { PlotInfo stationInfo = new PlotInfo(); - stationInfo.id = (Integer) data[0]; + stationInfo.dataURI = (String) data[0]; stationInfo.latitude = (Double) data[1]; stationInfo.longitude = (Double) data[2]; stationInfo.stationId = (String) data[3]; diff --git a/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/rsc/retrieve/ScatterometerPlotInfoRetriever.java b/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/rsc/retrieve/ScatterometerPlotInfoRetriever.java index 4b4fe77183..4907bfda2a 100644 --- a/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/rsc/retrieve/ScatterometerPlotInfoRetriever.java +++ b/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/rsc/retrieve/ScatterometerPlotInfoRetriever.java @@ -139,8 +139,9 @@ public class ScatterometerPlotInfoRetriever extends PointDataPlotInfoRetriever { } if (stations != null && stations.size() == MAX_RESULT_SIZE) { for (PlotInfo station : stations) { - if (station.id < request.maxId) { - request.maxId = station.id; + int id = Integer.parseInt(station.stationId); + if (id < request.maxId) { + request.maxId = id; } } synchronized (screenQueue) { @@ -197,7 +198,22 @@ public class ScatterometerPlotInfoRetriever extends PointDataPlotInfoRetriever { dq.setOrderAscending(ResultOrder.DESC); dq.addOrderBy("id"); super.addColumns(dq); + dq.addColumn("id"); } + + + + /* (non-Javadoc) + * @see com.raytheon.viz.pointdata.rsc.retrieve.PointDataPlotInfoRetriever#getPlotInfo(java.lang.Object[]) + */ + @Override + protected PlotInfo getPlotInfo(Object[] data) { + PlotInfo info = super.getPlotInfo(data); + info.stationId = data[data.length - 1].toString(); + return info; + } + + public void getStations(IResourceDataChanged listener, DataTime time, HashMap metadataMap) throws VizException { diff --git a/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/thread/PlotSampleGeneratorJob.java b/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/thread/PlotSampleGeneratorJob.java index 677639c4bf..a1b8a02a1c 100644 --- a/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/thread/PlotSampleGeneratorJob.java +++ b/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/thread/PlotSampleGeneratorJob.java @@ -80,9 +80,9 @@ public class PlotSampleGeneratorJob extends Job { try { PlotInfo[] infos = queue.poll(); String message = plotFactory.getStationMessage(infos[0].pdv, - infos[0].id); + infos[0].dataURI); - caller.messageGenerated(infos[0].id, message); + caller.messageGenerated(infos[0].dataURI, message); } catch (Exception e) { statusHandler.error("Error creating plot", e); } diff --git a/cave/com.raytheon.viz.radar/src/com/raytheon/viz/radar/util/RadarPlotInfoRetriever.java b/cave/com.raytheon.viz.radar/src/com/raytheon/viz/radar/util/RadarPlotInfoRetriever.java index e3546535f3..388d54cf8c 100644 --- a/cave/com.raytheon.viz.radar/src/com/raytheon/viz/radar/util/RadarPlotInfoRetriever.java +++ b/cave/com.raytheon.viz.radar/src/com/raytheon/viz/radar/util/RadarPlotInfoRetriever.java @@ -1,19 +1,19 @@ /** * 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 + * 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 - * + * 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. **/ @@ -48,7 +48,6 @@ public class RadarPlotInfoRetriever extends AbstractDbPlotInfoRetriever { @Override protected void addColumns(DbQuery dq) { - dq.addColumn("id"); dq.addColumn("location.lat"); dq.addColumn("location.lon"); dq.addColumn("icao"); @@ -59,15 +58,14 @@ public class RadarPlotInfoRetriever extends AbstractDbPlotInfoRetriever { @Override protected PlotInfo getPlotInfo(Object[] data) { PlotInfo stationInfo = new PlotInfo(); - stationInfo.id = (Integer) data[0]; - stationInfo.latitude = ((Float) data[1]).doubleValue(); - stationInfo.longitude = ((Float) data[2]).doubleValue(); - stationInfo.stationId = (String) data[3]; + stationInfo.latitude = ((Float) data[0]).doubleValue(); + stationInfo.longitude = ((Float) data[1]).doubleValue(); + stationInfo.stationId = (String) data[2]; if (stationInfo.stationId == null) { - stationInfo.stationId = "" + data[1] + "#" + data[2]; + stationInfo.stationId = "" + data[0] + "#" + data[1]; } - stationInfo.dataTime = (DataTime) data[4]; - stationInfo.dataURI = (String) data[5]; + stationInfo.dataTime = (DataTime) data[3]; + stationInfo.dataURI = (String) data[4]; return stationInfo; } diff --git a/cave/com.raytheon.viz.redbook/src/com/raytheon/viz/redbookua/rsc/RedbookUpperAirResource.java b/cave/com.raytheon.viz.redbook/src/com/raytheon/viz/redbookua/rsc/RedbookUpperAirResource.java index ee5c148f1f..29ed4f61f7 100644 --- a/cave/com.raytheon.viz.redbook/src/com/raytheon/viz/redbookua/rsc/RedbookUpperAirResource.java +++ b/cave/com.raytheon.viz.redbook/src/com/raytheon/viz/redbookua/rsc/RedbookUpperAirResource.java @@ -398,7 +398,7 @@ public class RedbookUpperAirResource extends float lon = pdv.getFloat(RedbookUpperAirDecoder.P_LONGITUDE); PlotData pd = new PlotData(); pd.addData(pdv); - BufferedImage bImage = pmf.getStationPlot(pd, -1, lat, lon); + BufferedImage bImage = pmf.getStationPlot(pd, lat, lon); IImage image = null; if (bImage != null) image = target.initializeRaster(new IODataPreparer(bImage, diff --git a/ncep/gov.noaa.nws.ncep.viz.rsc.plotdata/src/gov/noaa/nws/ncep/viz/rsc/plotdata/plotModels/PlotModelGenerator2.java b/ncep/gov.noaa.nws.ncep.viz.rsc.plotdata/src/gov/noaa/nws/ncep/viz/rsc/plotdata/plotModels/PlotModelGenerator2.java index 709f0a47cc..e2a409855d 100644 --- a/ncep/gov.noaa.nws.ncep.viz.rsc.plotdata/src/gov/noaa/nws/ncep/viz/rsc/plotdata/plotModels/PlotModelGenerator2.java +++ b/ncep/gov.noaa.nws.ncep.viz.rsc.plotdata/src/gov/noaa/nws/ncep/viz/rsc/plotdata/plotModels/PlotModelGenerator2.java @@ -20,36 +20,59 @@ package gov.noaa.nws.ncep.viz.rsc.plotdata.plotModels; +import gov.noaa.nws.ncep.edex.common.sounding.NcSoundingCube; +import gov.noaa.nws.ncep.edex.common.sounding.NcSoundingCube.QueryStatus; +import gov.noaa.nws.ncep.edex.common.sounding.NcSoundingLayer; +import gov.noaa.nws.ncep.edex.common.sounding.NcSoundingLayer.DataType; +import gov.noaa.nws.ncep.edex.common.sounding.NcSoundingProfile; +import gov.noaa.nws.ncep.metParameters.parameterConversion.NcUnits; +import gov.noaa.nws.ncep.metparameters.AbstractMetParameter; +import gov.noaa.nws.ncep.metparameters.AirTemperature; +import gov.noaa.nws.ncep.metparameters.Amount; +import gov.noaa.nws.ncep.metparameters.DewPointTemp; +import gov.noaa.nws.ncep.metparameters.HeightAboveSeaLevel; +import gov.noaa.nws.ncep.metparameters.MetParameterFactory; +import gov.noaa.nws.ncep.metparameters.MetParameterFactory.NotDerivableException; +import gov.noaa.nws.ncep.metparameters.PressureLevel; +import gov.noaa.nws.ncep.metparameters.RelativeHumidity; +import gov.noaa.nws.ncep.metparameters.StationElevation; +import gov.noaa.nws.ncep.metparameters.StationID; +import gov.noaa.nws.ncep.metparameters.StationLatitude; +import gov.noaa.nws.ncep.metparameters.StationLongitude; +import gov.noaa.nws.ncep.metparameters.StationName; +import gov.noaa.nws.ncep.metparameters.WindDirection; +import gov.noaa.nws.ncep.metparameters.WindDirectionUComp; +import gov.noaa.nws.ncep.metparameters.WindDirectionVComp; +import gov.noaa.nws.ncep.metparameters.WindSpeed; +import gov.noaa.nws.ncep.viz.common.soundingQuery.NcSoundingQuery; +import gov.noaa.nws.ncep.viz.rsc.plotdata.parameters.PlotParameterDefn; +import gov.noaa.nws.ncep.viz.rsc.plotdata.parameters.PlotParameterDefnsMngr; +import gov.noaa.nws.ncep.viz.rsc.plotdata.plotModels.elements.PlotModel; + import java.awt.image.BufferedImage; -import java.text.ParseException; -import java.text.ParsePosition; import java.util.ArrayList; -import java.util.Arrays; -import java.util.Date; import java.util.HashMap; import java.util.List; -import java.util.Set; import java.util.Map; -import java.util.UUID; import java.util.Map.Entry; +import java.util.UUID; import java.util.concurrent.ConcurrentLinkedQueue; import javax.measure.unit.NonSI; import javax.measure.unit.SI; import javax.measure.unit.Unit; -import javax.measure.unit.UnitFormat; -import javax.sound.midi.MidiDevice.Info; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.Job; -import org.eclipse.swt.graphics.RGB; import com.raytheon.uf.common.dataquery.requests.RequestConstraint; import com.raytheon.uf.common.dataquery.requests.RequestConstraint.ConstraintType; import com.raytheon.uf.common.pointdata.PointDataContainer; +import com.raytheon.uf.common.pointdata.PointDataDescription.Type; import com.raytheon.uf.common.pointdata.PointDataView; +import com.raytheon.uf.common.time.DataTime; import com.raytheon.uf.viz.core.IGraphicsTarget; import com.raytheon.uf.viz.core.data.prep.IODataPreparer; import com.raytheon.uf.viz.core.datastructure.DataCubeContainer; @@ -59,40 +82,8 @@ import com.raytheon.uf.viz.core.map.IMapDescriptor; import com.raytheon.viz.pointdata.IPlotModelGeneratorCaller; import com.raytheon.viz.pointdata.PlotInfo; import com.raytheon.viz.pointdata.PointDataRequest; - -import gov.noaa.nws.ncep.viz.common.soundingQuery.NcSoundingQuery; -import gov.noaa.nws.ncep.viz.rsc.plotdata.parameters.PlotParameterDefn; -import gov.noaa.nws.ncep.viz.rsc.plotdata.parameters.PlotParameterDefnsMngr; -import gov.noaa.nws.ncep.viz.rsc.plotdata.plotModels.PlotModelFactory2.PlotElement; -import gov.noaa.nws.ncep.viz.rsc.plotdata.plotModels.elements.PlotModel; -import gov.noaa.nws.ncep.edex.common.sounding.NcSoundingCube; -import gov.noaa.nws.ncep.edex.common.sounding.NcSoundingLayer; -import gov.noaa.nws.ncep.edex.common.sounding.NcSoundingLayer.DataType; -import gov.noaa.nws.ncep.edex.common.sounding.NcSoundingProfile; -import gov.noaa.nws.ncep.edex.common.sounding.NcSoundingCube.QueryStatus; -import gov.noaa.nws.ncep.metParameters.parameterConversion.NcUnits; -import gov.noaa.nws.ncep.metparameters.AbstractMetParameter; -import gov.noaa.nws.ncep.metparameters.Amount; -import gov.noaa.nws.ncep.metparameters.DewPointTemp; -import gov.noaa.nws.ncep.metparameters.MetParameterFactory; -import gov.noaa.nws.ncep.metparameters.MetParameterFactory.NotDerivableException; -import gov.noaa.nws.ncep.metparameters.RelativeHumidity; -import gov.noaa.nws.ncep.metparameters.StationElevation; -import gov.noaa.nws.ncep.metparameters.StationID; -import gov.noaa.nws.ncep.metparameters.StationLatitude; -import gov.noaa.nws.ncep.metparameters.StationLongitude; -import gov.noaa.nws.ncep.metparameters.StationName; -import gov.noaa.nws.ncep.metparameters.AirTemperature; -import gov.noaa.nws.ncep.metparameters.PressureLevel; -import gov.noaa.nws.ncep.metparameters.HeightAboveSeaLevel; -import gov.noaa.nws.ncep.metparameters.WindDirectionUComp; -import gov.noaa.nws.ncep.metparameters.WindDirectionVComp; -import gov.noaa.nws.ncep.metparameters.WindDirection; -import gov.noaa.nws.ncep.metparameters.WindSpeed; - -import com.raytheon.uf.common.pointdata.PointDataDescription.Type; -import com.raytheon.uf.common.time.DataTime; import com.vividsolutions.jts.geom.Coordinate; + /** * A Eclipse Job thread that will listen for new stations on a queue and request * the data to create the plots. @@ -122,13 +113,13 @@ public class PlotModelGenerator2 extends Job { private final ConcurrentLinkedQueue stationQueue; private final PlotParameterDefnsMngr plotParamDefns; - + private final PlotModelFactory2 plotCreator; private final IGraphicsTarget target; private final String plugin; - + private final String levelStr; private final Map constraintMap; @@ -137,33 +128,37 @@ public class PlotModelGenerator2 extends Job { // map from the metParam name to an abstractMetParameter. The met parameter // will have a value set either from the pointDataContainer query or derived - // from the db pointData. This map is passed to the PlotModelFactory. All the - // AbstractMetParameter are references to objects in either the dbParamsMap or - // the derivedParamsList. - // - private HashMap paramsToPlot = null; - - // a map from the dbParam name to a list of AbstractMetParameter objects used - // to hold the values from the pointDataContainer. This map is used to - // derive parameter values to be plotted. + // from the db pointData. This map is passed to the PlotModelFactory. All + // the + // AbstractMetParameter are references to objects in either the dbParamsMap + // or + // the derivedParamsList. // - private HashMap dbParamsMap = null; + private HashMap paramsToPlot = null; + + // a map from the dbParam name to a list of AbstractMetParameter objects + // used + // to hold the values from the pointDataContainer. This map is used to + // derive parameter values to be plotted. + // + private HashMap dbParamsMap = null; // A list of derivedParameters that need to be derived from the dbParamsMap. // private ArrayList derivedParamsList = null; - // a map for those parameters that determine their value from an - // array of values from the DB. (this implements functionality previously done + // a map for those parameters that determine their value from an + // array of values from the DB. (this implements functionality previously + // done // in the PlotModelFactory for the plotFunctionTable tag and now done with // the arrayIndex tag in the plotParameterDefn) - // + // private HashMap prioritySelectionsMap = null; - - // + + // private String latDbName = "latitude"; + private String lonDbName = "longitude"; - /** * Initializes the thread with the station's reference time and the target @@ -181,7 +176,7 @@ public class PlotModelGenerator2 extends Job { */ public PlotModelGenerator2(IGraphicsTarget aTarget, IMapDescriptor mapDescriptor, PlotModel plotModel, - String level, //String plugin, + String level, // String plugin, Map constraintMap, IPlotModelGeneratorCaller caller) throws VizException { super("Creating Plots..."); @@ -193,234 +188,277 @@ public class PlotModelGenerator2 extends Job { this.constraintMap = constraintMap; this.caller = caller; - paramsToPlot = new HashMap(); + paramsToPlot = new HashMap(); derivedParamsList = new ArrayList(); - dbParamsMap = new HashMap(); - prioritySelectionsMap = new HashMap(); - + dbParamsMap = new HashMap(); + prioritySelectionsMap = new HashMap(); + // TODO : if we change the h5uair decoder to decode the station - // location and elevation data like raytheon does then we won't + // location and elevation data like raytheon does then we won't // need to do this. - latDbName = (plugin.equals("h5uair") ? "SLAT" : "latitude" ); - lonDbName = (plugin.equals("h5uair") ? "SLON" : "longitude" ); + latDbName = (plugin.equals("h5uair") ? "SLAT" : "latitude"); + lonDbName = (plugin.equals("h5uair") ? "SLON" : "longitude"); - // get the parameter definitions for this plugin. - // the definitions give the list of available nmap parameters as well - // as a mapping to the db param name an plot mode, units... - // - plotParamDefns = new PlotParameterDefnsMngr( plotModel.getPlugin() ); + // get the parameter definitions for this plugin. + // the definitions give the list of available nmap parameters as well + // as a mapping to the db param name an plot mode, units... + // + plotParamDefns = new PlotParameterDefnsMngr(plotModel.getPlugin()); - for( PlotParameterDefn plotPrmDefn : plotParamDefns.getPlotParamDefns() ) { - - // if this is a 'vector' parameter (ie windBarb or arrow) then get the 2 - // component metParameters and make sure they exist. - if( plotPrmDefn.isVectorParameter() ) { - String[] vectParamNames = plotPrmDefn.getMetParamNamesForVectorPlot(); - - if( vectParamNames == null ) { - throw new VizException("Error plotting WindBarb or Arrow: Can't get components metParameters for "+ - plotPrmDefn.getPlotParamName() ); - } - - for( String vectParam : vectParamNames ) { -// PlotParameterDefn vectPrmDefn = plotParamDefns.getPlotParamDefn( vectParam ); + for (PlotParameterDefn plotPrmDefn : plotParamDefns.getPlotParamDefns()) { -// if( vectPrmDefn == null ) { -// throw new VizException("Error plotting WindBarb or Arrow: Can't find parameter "+vectParam ); -// } -// else if( vectPrmDefn.getDbParamName().equals( "derived" ) ) { -// throw new VizException("Error plotting WindBarb or Arrow: Can't plot derived vector parameter "+vectParam ); -// } - // check that this metParam is - if( plotParamDefns.getPlotParamDefnsForMetParam( vectParam ).isEmpty() ) { - throw new VizException("Error plotting WindBarb or Arrow : Can't find definition for component metParameter "+ - vectParam ); - } - } - } - else { // if not a vector parameter - String dbPrmName = plotPrmDefn.getDbParamName(); - String[] deriveArgs = plotPrmDefn.getDeriveParams(); - - if( dbPrmName == null ) { // derived - //System.out.println("sanity check: can't find plotPrmDefn for :"+dbPrmName ); - continue; - } - // if there is already a plot param mapped to this dbParam - else if( dbParamsMap.containsKey( dbPrmName ) ) { - continue; - } - else { //if( !dbPrmName.equals("derived" ) ) { + // if this is a 'vector' parameter (ie windBarb or arrow) then get + // the 2 + // component metParameters and make sure they exist. + if (plotPrmDefn.isVectorParameter()) { + String[] vectParamNames = plotPrmDefn + .getMetParamNamesForVectorPlot(); - // alias the db param name to the ncep param name. - // (This eliminates the need to have a direct mapping from the db name to - // the ncep param name.) - MetParameterFactory.getInstance().alias( plotPrmDefn.getMetParamName(), plotPrmDefn.getDbParamName() ); + if (vectParamNames == null) { + throw new VizException( + "Error plotting WindBarb or Arrow: Can't get components metParameters for " + + plotPrmDefn.getPlotParamName()); + } - // create a metParam that will hold the value from the db and which will - // be used to plot the plotParameter and possibly derive other parameter values. - // - AbstractMetParameter dbParam = MetParameterFactory.getInstance(). - createParameter( plotPrmDefn.getMetParamName(), plotPrmDefn.getPlotUnit() ); - if( dbParam == null ) { - System.out.println("Error creating metParameter "+ plotPrmDefn.getMetParamName() ); - } - else { - // add this prm to a map to tell us which db params are needed - // when querying the db - dbParamsMap.put( plotPrmDefn.getDbParamName(), dbParam ); + for (String vectParam : vectParamNames) { + // PlotParameterDefn vectPrmDefn = + // plotParamDefns.getPlotParamDefn( vectParam ); - // for parameters that need to lookup their value from an - // array of values based on a priority. (ie for skyCover to - // determine the highest level of cloud cover at any level) - // - if( plotPrmDefn.getPrioritySelectTable() != null ) { - S2N priorSel = S2N.readS2NFile( - plotPrmDefn.getPrioritySelectTable() ); - prioritySelectionsMap.put( dbPrmName, priorSel ); - } - // else TODO : check for arrayIndex - } - } - } + // if( vectPrmDefn == null ) { + // throw new + // VizException("Error plotting WindBarb or Arrow: Can't find parameter "+vectParam + // ); + // } + // else if( vectPrmDefn.getDbParamName().equals( "derived" ) + // ) { + // throw new + // VizException("Error plotting WindBarb or Arrow: Can't plot derived vector parameter "+vectParam + // ); + // } + // check that this metParam is + if (plotParamDefns.getPlotParamDefnsForMetParam(vectParam) + .isEmpty()) { + throw new VizException( + "Error plotting WindBarb or Arrow : Can't find definition for component metParameter " + + vectParam); + } + } + } else { // if not a vector parameter + String dbPrmName = plotPrmDefn.getDbParamName(); + String[] deriveArgs = plotPrmDefn.getDeriveParams(); + + if (dbPrmName == null) { // derived + // System.out.println("sanity check: can't find plotPrmDefn for :"+dbPrmName + // ); + continue; + } + // if there is already a plot param mapped to this dbParam + else if (dbParamsMap.containsKey(dbPrmName)) { + continue; + } else { // if( !dbPrmName.equals("derived" ) ) { + + // alias the db param name to the ncep param name. + // (This eliminates the need to have a direct mapping from + // the db name to + // the ncep param name.) + MetParameterFactory.getInstance().alias( + plotPrmDefn.getMetParamName(), + plotPrmDefn.getDbParamName()); + + // create a metParam that will hold the value from the db + // and which will + // be used to plot the plotParameter and possibly derive + // other parameter values. + // + AbstractMetParameter dbParam = MetParameterFactory + .getInstance().createParameter( + plotPrmDefn.getMetParamName(), + plotPrmDefn.getPlotUnit()); + if (dbParam == null) { + System.out.println("Error creating metParameter " + + plotPrmDefn.getMetParamName()); + } else { + // add this prm to a map to tell us which db params are + // needed + // when querying the db + dbParamsMap.put(plotPrmDefn.getDbParamName(), dbParam); + + // for parameters that need to lookup their value from + // an + // array of values based on a priority. (ie for skyCover + // to + // determine the highest level of cloud cover at any + // level) + // + if (plotPrmDefn.getPrioritySelectTable() != null) { + S2N priorSel = S2N.readS2NFile(plotPrmDefn + .getPrioritySelectTable()); + prioritySelectionsMap.put(dbPrmName, priorSel); + } + // else TODO : check for arrayIndex + } + } + } } - - // if the station lat/long is not in the defns file, add them here since they + + // if the station lat/long is not in the defns file, add them here since + // they // are needed to plot the data // - if( !dbParamsMap.containsKey( latDbName ) ) { - MetParameterFactory.getInstance().alias( StationLatitude.class.getSimpleName(), latDbName ); - AbstractMetParameter latPrm = MetParameterFactory.getInstance(). - createParameter( StationLatitude.class.getSimpleName(), Unit.ONE ); - dbParamsMap.put( latDbName, latPrm ); - } - - if( !dbParamsMap.containsKey( lonDbName ) ) { - MetParameterFactory.getInstance().alias( StationLongitude.class.getSimpleName(), lonDbName ); - - AbstractMetParameter longPrm = MetParameterFactory.getInstance(). - createParameter( StationLongitude.class.getSimpleName(), Unit.ONE ); - - dbParamsMap.put( lonDbName, longPrm ); + if (!dbParamsMap.containsKey(latDbName)) { + MetParameterFactory.getInstance().alias( + StationLatitude.class.getSimpleName(), latDbName); + AbstractMetParameter latPrm = MetParameterFactory.getInstance() + .createParameter(StationLatitude.class.getSimpleName(), + Unit.ONE); + dbParamsMap.put(latDbName, latPrm); } - paramsToPlot.put( StationLatitude.class.getSimpleName(), - dbParamsMap.get( latDbName ) ); - + if (!dbParamsMap.containsKey(lonDbName)) { + MetParameterFactory.getInstance().alias( + StationLongitude.class.getSimpleName(), lonDbName); + + AbstractMetParameter longPrm = MetParameterFactory.getInstance() + .createParameter(StationLongitude.class.getSimpleName(), + Unit.ONE); + + dbParamsMap.put(lonDbName, longPrm); + } + + paramsToPlot.put(StationLatitude.class.getSimpleName(), + dbParamsMap.get(latDbName)); + paramsToPlot.put(StationLongitude.class.getSimpleName(), - dbParamsMap.get( lonDbName ) ); - - // loop thru the non-vector (ie center position windBarb) plotParameters in the plotModel and - // - // Once created this map will be (re)used to create each station plot. - // The parameter values will be either set or derived from the database parameters. + dbParamsMap.get(lonDbName)); + + // loop thru the non-vector (ie center position windBarb) plotParameters + // in the plotModel and // - for( String pltPrmName : plotModel.getPlotParamNames( true ) ) { // don't include vector(ie windBarb) params - - // get the dbParamName and determine if derived parameter - // - PlotParameterDefn plotPrmDefn = plotParamDefns.getPlotParamDefn( pltPrmName ); - - if( plotPrmDefn == null ) { - throw new VizException("Error creating plot metParameter "+ pltPrmName ); - } - else if( plotPrmDefn.isVectorParameter() ) { - // 'Vector' parameters for windBarbs and arrows are required to be in the center (WD) position - // Also, no plotDefns should have a plotMode of barb or arrow if not in the center position. + // Once created this map will be (re)used to create each station plot. + // The parameter values will be either set or derived from the database + // parameters. + // + for (String pltPrmName : plotModel.getPlotParamNames(true)) { // don't + // include + // vector(ie + // windBarb) + // params - // add the 2 metParameters to paramsToPlot. - String[] vectParamNames = plotPrmDefn.getMetParamNamesForVectorPlot(); + // get the dbParamName and determine if derived parameter + // + PlotParameterDefn plotPrmDefn = plotParamDefns + .getPlotParamDefn(pltPrmName); - for( String vectParam : vectParamNames ) { - // already sanity checked this... - PlotParameterDefn vectPrmDefn = plotParamDefns.getPlotParamDefnsForMetParam( vectParam ).get(0); - addToParamsToPlot( vectPrmDefn ); - } - } - else { - addToParamsToPlot( plotPrmDefn ); - } + if (plotPrmDefn == null) { + throw new VizException("Error creating plot metParameter " + + pltPrmName); + } else if (plotPrmDefn.isVectorParameter()) { + // 'Vector' parameters for windBarbs and arrows are required to + // be in the center (WD) position + // Also, no plotDefns should have a plotMode of barb or arrow if + // not in the center position. + + // add the 2 metParameters to paramsToPlot. + String[] vectParamNames = plotPrmDefn + .getMetParamNamesForVectorPlot(); + + for (String vectParam : vectParamNames) { + // already sanity checked this... + PlotParameterDefn vectPrmDefn = plotParamDefns + .getPlotParamDefnsForMetParam(vectParam).get(0); + addToParamsToPlot(vectPrmDefn); + } + } else { + addToParamsToPlot(plotPrmDefn); + } } - - plotCreator = new PlotModelFactory2( mapDescriptor, plotModel, - plotParamDefns, levelStr ); + + plotCreator = new PlotModelFactory2(mapDescriptor, plotModel, + plotParamDefns, levelStr); } - private void addToParamsToPlot( PlotParameterDefn plotPrmDefn ) { - String dbParamName = plotPrmDefn.getDbParamName(); - String metParamName = plotPrmDefn.getMetParamName(); - String[] deriveParams = plotPrmDefn.getDeriveParams();// the input args to derive() - - // if this is a derived parameter, create a metParameter to hold the derived - // value to be computed and plotted. - // - if( deriveParams != null ) { //dbParamName.equals( "derived" ) ) { - - AbstractMetParameter derivedMetParam = MetParameterFactory.getInstance(). - createParameter( plotPrmDefn.getMetParamName(), plotPrmDefn.getPlotUnit() ); + private void addToParamsToPlot(PlotParameterDefn plotPrmDefn) { + String dbParamName = plotPrmDefn.getDbParamName(); + String metParamName = plotPrmDefn.getMetParamName(); + String[] deriveParams = plotPrmDefn.getDeriveParams();// the input args + // to derive() - if( derivedMetParam == null ) { - System.out.println("Error creating derived metParameter "+ - plotPrmDefn.getMetParamName() ); - return; - } - else { - // If all is set then all of the - // available metParameters from the db query are used - // when attempting to derive the parameter. - // Otherwise, we are expecting a comma separated list of parameters - // - if( //deriveParams.length > 1 && - !deriveParams[0].equalsIgnoreCase("all") ) { - - ArrayList preferedDeriveParameterNames = new ArrayList(); - ArrayList preferedDeriveParameters = new ArrayList(); - - for( String dPrm : deriveParams ) { - AbstractMetParameter deriveInputParam = - MetParameterFactory.getInstance().createParameter( dPrm ); + // if this is a derived parameter, create a metParameter to hold the + // derived + // value to be computed and plotted. + // + if (deriveParams != null) { // dbParamName.equals( "derived" ) ) { - if( deriveInputParam != null ) { -// MetParameterFactory.getInstance().isValidMetParameterName( dPrm ) ) { - preferedDeriveParameters.add( deriveInputParam ); - preferedDeriveParameterNames.add( dPrm ); - } - else { - System.out.println("Warning : '"+dPrm+" is not a valid metParameter name"); - return; - } - } + AbstractMetParameter derivedMetParam = MetParameterFactory + .getInstance().createParameter( + plotPrmDefn.getMetParamName(), + plotPrmDefn.getPlotUnit()); - derivedMetParam.setPreferedDeriveParameters( preferedDeriveParameterNames ); - } + if (derivedMetParam == null) { + System.out.println("Error creating derived metParameter " + + plotPrmDefn.getMetParamName()); + return; + } else { + // If all is set then all of the + // available metParameters from the db query are used + // when attempting to derive the parameter. + // Otherwise, we are expecting a comma separated list of + // parameters + // + if ( // deriveParams.length > 1 && + !deriveParams[0].equalsIgnoreCase("all")) { - if( derivedMetParam.getDeriveMethod( dbParamsMap.values() ) == null ) { - System.out.println("Unable to derive "+ derivedMetParam.getMetParamName() +" from available parameters."); - return; - } + ArrayList preferedDeriveParameterNames = new ArrayList(); + ArrayList preferedDeriveParameters = new ArrayList(); - derivedParamsList.add( derivedMetParam ); + for (String dPrm : deriveParams) { + AbstractMetParameter deriveInputParam = MetParameterFactory + .getInstance().createParameter(dPrm); + + if (deriveInputParam != null) { + // MetParameterFactory.getInstance().isValidMetParameterName( + // dPrm ) ) { + preferedDeriveParameters.add(deriveInputParam); + preferedDeriveParameterNames.add(dPrm); + } else { + System.out.println("Warning : '" + dPrm + + " is not a valid metParameter name"); + return; + } + } + + derivedMetParam + .setPreferedDeriveParameters(preferedDeriveParameterNames); + } + + if (derivedMetParam.getDeriveMethod(dbParamsMap.values()) == null) { + System.out.println("Unable to derive " + + derivedMetParam.getMetParamName() + + " from available parameters."); + return; + } + + derivedParamsList.add(derivedMetParam); + + paramsToPlot.put(metParamName, derivedMetParam); + } + } + // if this is a dbParameter then save the metParameter from the + // dbParamsMap + // in the paramsToPlot map. + // + else if (dbParamName != null && dbParamsMap.containsKey(dbParamName)) { + + // if it is already in the map then we don't need to save it twice. + if (!paramsToPlot.containsKey(dbParamName)) { + paramsToPlot.put(metParamName, dbParamsMap.get(dbParamName)); + } + } else { + System.out + .println("Sanity check : dbParamName is not in dbParamsMap"); + } + } - paramsToPlot.put( metParamName, derivedMetParam ); - } - } - // if this is a dbParameter then save the metParameter from the dbParamsMap - // in the paramsToPlot map. - // - else if( dbParamName != null && - dbParamsMap.containsKey( dbParamName ) ) { - - // if it is already in the map then we don't need to save it twice. - if( !paramsToPlot.containsKey( dbParamName ) ) { - paramsToPlot.put( metParamName, - dbParamsMap.get( dbParamName ) ); - } - } - else { - System.out.println("Sanity check : dbParamName is not in dbParamsMap"); - } - } - public int getPlotModelWidth() { return this.plotCreator.getDefinedPlotModelWidth(); } @@ -431,59 +469,65 @@ public class PlotModelGenerator2 extends Job { } @Override - protected IStatus run( IProgressMonitor monitor) { - if( levelStr != null ) { - return plotUpperAirData(); - } - else { - return plotSurfaceData(); - } + protected IStatus run(IProgressMonitor monitor) { + if (levelStr != null) { + return plotUpperAirData(); + } else { + return plotSurfaceData(); + } } - + private IStatus plotSurfaceData() { - while (stationQueue.size() > 0) { + while (stationQueue.size() > 0) { List stationQuery = new ArrayList(); - + // key is a formatted lat/lon string Map plotMap = new HashMap(); - - for( PlotInfo info : stationQueue ) { - plotMap.put( - formatLatLonKey(info.latitude, info.longitude ), info); - stationQuery.add(info); + + for (PlotInfo info : stationQueue) { + plotMap.put(formatLatLonKey(info.latitude, info.longitude), + info); + stationQuery.add(info); } - IImage image = null; // TODO : change to get all of the available prms for the plugin. - // OR call method on DerivedParams to determine which prms are needed to + // OR call method on DerivedParams to determine which prms are + // needed to // compute the set of params - // + // List params = new ArrayList(); - params.add( latDbName ); // create MetParameter for dbParamsMap?? - params.add( lonDbName ); - - // TODO : is there a way to just tell the request to get all the parameters??? - // OR, we can determine the list of all the base parameters needed to - // compute all the derived parameters. Or we can specify the parameters needed + params.add(latDbName); // create MetParameter for dbParamsMap?? + params.add(lonDbName); + + // TODO : is there a way to just tell the request to get all the + // parameters??? + // OR, we can determine the list of all the base parameters needed + // to + // compute all the derived parameters. Or we can specify the + // parameters needed // to compute the derived parameter in the plotParameterDefn. - // Currently, besides likely requesting more data than is needed, this - // means that if a parameter is needed to derive another then the deriving - // parameter must also be in the PlotParamDefns (and available for display itself) + // Currently, besides likely requesting more data than is needed, + // this + // means that if a parameter is needed to derive another then the + // deriving + // parameter must also be in the PlotParamDefns (and available for + // display itself) // (seems reasonable though) - for( String dbParam : dbParamsMap.keySet() ) { //plotParamDefns.getPlotParamDefns() ) { - params.add( dbParam ); + for (String dbParam : dbParamsMap.keySet()) { // plotParamDefns.getPlotParamDefns() + // ) { + params.add(dbParam); } Map map = new HashMap(); setMapConstraints(map); RequestConstraint rc = new RequestConstraint(); - rc.setConstraintType( ConstraintType.IN ); + rc.setConstraintType(ConstraintType.IN); String[] str = new String[stationQuery.size()]; - + for (int z = 0; z < str.length; z++) { - str[z] = "" + stationQuery.get(z).id; + str[z] = "" + stationQuery.get(z).dataURI; } int index = 0; @@ -501,25 +545,25 @@ public class PlotModelGenerator2 extends Job { index++; j++; } - - map.put("id", rc); - + + map.put("dataURI", rc); + try { // Try and get data from datacube PointDataContainer tempPdc = DataCubeContainer - .getPointData(this.plugin, params - .toArray(new String[params.size()]), - null, map); //levelKey + .getPointData(this.plugin, + params.toArray(new String[params.size()]), + null, map); // levelKey if (tempPdc == null) { // Datacube didn't have proper plugin; going directly // to the data store tempPdc = PointDataRequest.requestPointDataAllLevels( - null, this.plugin, - params.toArray( new String[params.size()] ), - null, map ); + null, this.plugin, + params.toArray(new String[params.size()]), + null, map); } - + if (pdc == null) { pdc = new PointDataContainer(); pdc.setAllocatedSz(tempPdc.getAllocatedSz()); @@ -531,105 +575,113 @@ public class PlotModelGenerator2 extends Job { e1.printStackTrace(); return Status.OK_STATUS; } - + j = 0; - map.clear(); + map.clear(); setMapConstraints(map); - - if( pdc != null ) { - pdc.setCurrentSz(pdc.getAllocatedSz()); + + if (pdc != null) { + pdc.setCurrentSz(pdc.getAllocatedSz()); } } - + int counter = 0; - - for( int uriCounter = 0; uriCounter < pdc.getAllocatedSz(); uriCounter++ ) { + + for (int uriCounter = 0; uriCounter < pdc.getAllocatedSz(); uriCounter++) { PointDataView pdv = pdc.readRandom(uriCounter); - if( pdv == null ) { // ??? - continue; + if (pdv == null) { // ??? + continue; } - - // set all the paramsToPlot values to missing. (All the + + // set all the paramsToPlot values to missing. (All the // metParams in the paramsToPlot map are references into the // derivedParamsMap and the dbParamsMap.) // - for( AbstractMetParameter metPrm : derivedParamsList ) {//derivedParamsMap.values() ) { - metPrm.setValueToMissing(); + for (AbstractMetParameter metPrm : derivedParamsList) {// derivedParamsMap.values() + // ) { + metPrm.setValueToMissing(); } - - for( AbstractMetParameter metPrm : dbParamsMap.values() ) { - metPrm.setValueToMissing(); + + for (AbstractMetParameter metPrm : dbParamsMap.values()) { + metPrm.setValueToMissing(); } // loop thru the dbparams from the point query // - for( String dbParam : pdc.getParameters() ) { + for (String dbParam : pdc.getParameters()) { - // find a metParam to hold the value for this dbParam - // - if( dbParamsMap.containsKey( dbParam ) ) { // id, lat, and longitude are not in the map. - AbstractMetParameter metPrm = dbParamsMap.get( dbParam ); - - Type pType = pdv.getType(dbParam); + // find a metParam to hold the value for this dbParam + // + if (dbParamsMap.containsKey(dbParam)) { // id, lat, and + // longitude are not + // in the map. + AbstractMetParameter metPrm = dbParamsMap.get(dbParam); - // if this is an array then attempt to determine which - // value in the array to use to set the metParameter. - // - if( pdv.getDimensions( dbParam ) > 1 ) { + Type pType = pdv.getType(dbParam); - // if there is a priority ranking for this parameter - // - if( prioritySelectionsMap.containsKey( dbParam ) ) { - - // S2N only for string lookups - if( metPrm.hasStringValue() ) { + // if this is an array then attempt to determine which + // value in the array to use to set the metParameter. + // + if (pdv.getDimensions(dbParam) > 1) { - S2N priortySelection = prioritySelectionsMap.get( dbParam ); + // if there is a priority ranking for this parameter + // + if (prioritySelectionsMap.containsKey(dbParam)) { - String dbVals[] = pdv.getStringAllLevels( dbParam ); + // S2N only for string lookups + if (metPrm.hasStringValue()) { - String rankedValue = priortySelection.getRankedField( dbVals ); + S2N priortySelection = prioritySelectionsMap + .get(dbParam); - metPrm.setStringValue( rankedValue ); - } - } - // TODO : implement arrayIndex (old plotIndex) - // else if( arrayIndex... ) - } - else { - setMetParamFromPDV( metPrm, pdv, dbParam ); - } - } + String dbVals[] = pdv + .getStringAllLevels(dbParam); + + String rankedValue = priortySelection + .getRankedField(dbVals); + + metPrm.setStringValue(rankedValue); + } + } + // TODO : implement arrayIndex (old plotIndex) + // else if( arrayIndex... ) + } else { + setMetParamFromPDV(metPrm, pdv, dbParam); + } + } } - - // loop thru the derived params, and derive the values using value in - // the dbParamsMap + + // loop thru the derived params, and derive the values using + // value in + // the dbParamsMap // - for( AbstractMetParameter derivedParam : derivedParamsList ) { - - try { - derivedParam.derive( dbParamsMap.values() ); + for (AbstractMetParameter derivedParam : derivedParamsList) { - } catch( NotDerivableException e ) { - e.printStackTrace(); - } - } - - String latLonKey = formatLatLonKey( pdv.getFloat( latDbName ), - pdv.getFloat( lonDbName ) ); - PlotInfo pltInfo = plotMap.get( latLonKey ); - - if( pltInfo == null ) { // ??? - System.out.println("Error looking up plotInfo for map key:"+ latLonKey ); - } - else { - BufferedImage bImage = plotCreator.getStationPlot( paramsToPlot ); // don't need this anymore, id); + try { + derivedParam.derive(dbParamsMap.values()); - if (bImage != null ) { - image = target.initializeRaster(new IODataPreparer( - bImage, UUID.randomUUID().toString(), 0), null); - caller.modelGenerated(new PlotInfo[] {pltInfo}, image); - } + } catch (NotDerivableException e) { + e.printStackTrace(); + } + } + + String latLonKey = formatLatLonKey(pdv.getFloat(latDbName), + pdv.getFloat(lonDbName)); + PlotInfo pltInfo = plotMap.get(latLonKey); + + if (pltInfo == null) { // ??? + System.out.println("Error looking up plotInfo for map key:" + + latLonKey); + } else { + BufferedImage bImage = plotCreator + .getStationPlot(paramsToPlot); // don't need this + // anymore, id); + + if (bImage != null) { + image = target.initializeRaster(new IODataPreparer( + bImage, UUID.randomUUID().toString(), 0), null); + caller.modelGenerated(new PlotInfo[] { pltInfo }, image); + } } counter++; @@ -639,229 +691,258 @@ public class PlotModelGenerator2 extends Job { return Status.OK_STATUS; } - - private IStatus plotUpperAirData() { - - while (stationQueue.size() > 0) { - List stationQuery = new ArrayList(); - - // Get the SoundingType from the plugin. - // TODO : Why not just pass in the plugin instead of a 'SoundingType' - // - String soundingType=null; - if( plugin.equals("h5uair") ) { - soundingType = "H5UAIR"; + private IStatus plotUpperAirData() { + + while (stationQueue.size() > 0) { + List stationQuery = new ArrayList(); + + // Get the SoundingType from the plugin. + // TODO : Why not just pass in the plugin instead of a + // 'SoundingType' + // + String soundingType = null; + + if (plugin.equals("h5uair")) { + soundingType = "H5UAIR"; } // TODO : fill these in when implementing the Fcst - else if( plugin.equals("???")) { - soundingType = "RUC2SND"; - } - else { - System.out.println("Unable to determine SoundingType for plugin: "+plugin ); - continue; -// throw new VizException("Unable to determine SoundingType for plugin: "+plugin ); + else if (plugin.equals("???")) { + soundingType = "RUC2SND"; + } else { + System.out + .println("Unable to determine SoundingType for plugin: " + + plugin); + continue; + // throw new + // VizException("Unable to determine SoundingType for plugin: "+plugin + // ); } long beginTime = 0; - long endTime = Long.MAX_VALUE; - ArrayList latLonCoords = new ArrayList( stationQueue.size() ); + long endTime = Long.MAX_VALUE; + ArrayList latLonCoords = new ArrayList( + stationQueue.size()); Map plotMap = new HashMap(); // get the start and end time for the query. And get a list of // coordinates for the query. - for( PlotInfo stnInfo : stationQueue ) { - - plotMap.put( - formatLatLonKey(stnInfo.latitude, stnInfo.longitude ), stnInfo ); - stationQuery.add( stnInfo ); - - long stnTime = stnInfo.dataTime.getValidTime().getTimeInMillis(); - beginTime = ( beginTime < stnTime ? stnTime : beginTime ); - endTime = ( endTime > stnTime ? stnTime : endTime ); + for (PlotInfo stnInfo : stationQueue) { + + plotMap.put( + formatLatLonKey(stnInfo.latitude, stnInfo.longitude), + stnInfo); + stationQuery.add(stnInfo); + + long stnTime = stnInfo.dataTime.getValidTime() + .getTimeInMillis(); + beginTime = (beginTime < stnTime ? stnTime : beginTime); + endTime = (endTime > stnTime ? stnTime : endTime); DataTime fcstTime = null; // for forecast model plotResources // Can query by lat/lon or stnNum or stnId. // String[] stnIds = new String[stationQuery.size()]; - // - latLonCoords.add( new Coordinate( stnInfo.longitude, stnInfo.latitude ) ); + // + latLonCoords.add(new Coordinate(stnInfo.longitude, + stnInfo.latitude)); } - // TODO if this is an UpperAir FcstPlotResource then we will need to - // get the validTime and query for it. - List sndingLayers = new ArrayList(0); + // TODO if this is an UpperAir FcstPlotResource then we will need to + // get the validTime and query for it. + List sndingLayers = new ArrayList( + 0); NcSoundingCube sndingCube = NcSoundingQuery.soundingQueryByLatLon( - beginTime, endTime, latLonCoords, - soundingType, DataType.ALLDATA, true, levelStr ); + beginTime, endTime, latLonCoords, soundingType, + DataType.ALLDATA, true, levelStr); - if( sndingCube != null && sndingCube.getRtnStatus() == QueryStatus.OK ) { + if (sndingCube != null + && sndingCube.getRtnStatus() == QueryStatus.OK) { // Has to be just one Layer. - for(NcSoundingProfile sndingProfile : sndingCube.getSoundingProfileList() ) { - if( sndingProfile.getSoundingLyLst().size() != 1 ) { - System.out.println("Sanity Check : SoundingQuery return Profile with != 1 Layer " ); - if( sndingProfile.getSoundingLyLst().isEmpty() ) { - continue; - } - } - - NcSoundingLayer sndingLayer = sndingProfile.getSoundingLyLst().get(0); + for (NcSoundingProfile sndingProfile : sndingCube + .getSoundingProfileList()) { + if (sndingProfile.getSoundingLyLst().size() != 1) { + System.out + .println("Sanity Check : SoundingQuery return Profile with != 1 Layer "); + if (sndingProfile.getSoundingLyLst().isEmpty()) { + continue; + } + } -// if( sndingProfile.getStationLatitude() != -9999 || -// sndingProfile.getStationLongitude() != -9999 ) { -// System.out.println("Station latlon is "+ sndingProfile.getStationLatitude() + -// "/"+ sndingProfile.getStationLongitude() ); -// } - - // set all the paramsToPlot values to missing. (All the + NcSoundingLayer sndingLayer = sndingProfile + .getSoundingLyLst().get(0); + + // if( sndingProfile.getStationLatitude() != -9999 || + // sndingProfile.getStationLongitude() != -9999 ) { + // System.out.println("Station latlon is "+ + // sndingProfile.getStationLatitude() + + // "/"+ sndingProfile.getStationLongitude() ); + // } + + // set all the paramsToPlot values to missing. (All the // metParams in the paramsToPlot map are references into the // derivedParamsMap and the dbParamsMap.) // - for( AbstractMetParameter metPrm : derivedParamsList ) { - metPrm.setValueToMissing(); + for (AbstractMetParameter metPrm : derivedParamsList) { + metPrm.setValueToMissing(); } - + // loop thru all of the db params and set the values from // the sounding layer. // - for( AbstractMetParameter metPrm : dbParamsMap.values() ) { - metPrm.setValueToMissing(); + for (AbstractMetParameter metPrm : dbParamsMap.values()) { + metPrm.setValueToMissing(); - // TODO : the station lat/lon, elev, name and id should be set in the sounding profile - // but currently isn't. So instead we will get the lat/lon and id from the DBQuery. - if( metPrm.getMetParamName().equals( StationLatitude.class.getSimpleName() ) ) { - metPrm.setValue( new Amount( - sndingProfile.getStationLatitude(), Unit.ONE ) ); - } - else if( metPrm.getMetParamName().equals( StationLongitude.class.getSimpleName() ) ) { - metPrm.setValue( new Amount( - sndingProfile.getStationLongitude(), Unit.ONE ) ); - } - else if( metPrm.getMetParamName().equals( StationElevation.class.getSimpleName() ) ) { -// metPrm.setValue( new Amount( -// sndingProfile.getStationElevation(), SI.METER ) ); - } - else if( metPrm.getMetParamName().equals( StationID.class.getSimpleName() ) ) { - if( sndingProfile.getStationId().isEmpty() ) { - metPrm.setStringValue( sndingProfile.getStationId() ); - } - else { - metPrm.setValueToMissing(); - } -// if( stnInfo.stationId != null && !stnInfo.stationId.isEmpty() ) { -// metPrm.setStringValue( stnInfo.stationId ); -// } - } - else if( metPrm.getMetParamName().equals( StationName.class.getSimpleName() ) ) { -// metPrm.setStringValue( Integer.toString( sndingProfile.getStationNum() ) ); - } - else if( metPrm.getMetParamName().equals( AirTemperature.class.getSimpleName() ) ) { - metPrm.setValue( new Amount( - sndingLayer.getTemperature(), SI.CELSIUS ) ); - } - else if( metPrm.getMetParamName().equals( PressureLevel.class.getSimpleName() ) ) { - metPrm.setValue( new Amount( - sndingLayer.getPressure(), NcUnits.MILLIBAR ) ); - } - else if( metPrm.getMetParamName().equals( RelativeHumidity.class.getSimpleName() ) ) { - metPrm.setValue( new Amount( - sndingLayer.getRelativeHumidity(), Unit.ONE ) ); - } - else if( metPrm.getMetParamName().equals( DewPointTemp.class.getSimpleName() ) ) { - metPrm.setValue( new Amount( - sndingLayer.getDewpoint(), SI.CELSIUS ) ); - } - else if( metPrm.getMetParamName().equals( WindSpeed.class.getSimpleName() ) ) { - metPrm.setValue( new Amount( - sndingLayer.getWindSpeed(), NonSI.KNOT ) ); - } - else if( metPrm.getMetParamName().equals( WindDirection.class.getSimpleName() ) ) { - metPrm.setValue( new Amount( - sndingLayer.getWindDirection(), NonSI.DEGREE_ANGLE ) ); - } - else if( metPrm.getMetParamName().equals( HeightAboveSeaLevel.class.getSimpleName() ) ) { - metPrm.setValue( new Amount( - sndingLayer.getGeoHeight(), SI.METER ) ); - } - else if( metPrm.getMetParamName().equals( WindDirectionUComp.class.getSimpleName() ) ) { - metPrm.setValue( new Amount( - sndingLayer.getWindU(), NonSI.KNOT ) ); - } - else if( metPrm.getMetParamName().equals( WindDirectionVComp.class.getSimpleName() ) ) { - metPrm.setValue( new Amount( - sndingLayer.getWindV(), NonSI.KNOT ) ); - } - // TODO : for modelsoundings. what are the units? -// else if( metPrm.getMetParamName().equals( VerticalVelocity.class.getSimpleName() ) ) { -// metPrm.setValue( new Amount( -// sndingLayer.getOmega(), ) ); -// } -// else if( metPrm.getMetParamName().equals( SpecificHumidity.class.getSimpleName() ) ) { -// metPrm.setValue( new Amount( -// sndingLayer.getSpecHumidity(), NonSI. ) ); -// } + // TODO : the station lat/lon, elev, name and id should + // be set in the sounding profile + // but currently isn't. So instead we will get the + // lat/lon and id from the DBQuery. + if (metPrm.getMetParamName().equals( + StationLatitude.class.getSimpleName())) { + metPrm.setValue(new Amount(sndingProfile + .getStationLatitude(), Unit.ONE)); + } else if (metPrm.getMetParamName().equals( + StationLongitude.class.getSimpleName())) { + metPrm.setValue(new Amount(sndingProfile + .getStationLongitude(), Unit.ONE)); + } else if (metPrm.getMetParamName().equals( + StationElevation.class.getSimpleName())) { + // metPrm.setValue( new Amount( + // sndingProfile.getStationElevation(), SI.METER ) + // ); + } else if (metPrm.getMetParamName().equals( + StationID.class.getSimpleName())) { + if (sndingProfile.getStationId().isEmpty()) { + metPrm.setStringValue(sndingProfile + .getStationId()); + } else { + metPrm.setValueToMissing(); + } + // if( stnInfo.stationId != null && + // !stnInfo.stationId.isEmpty() ) { + // metPrm.setStringValue( stnInfo.stationId ); + // } + } else if (metPrm.getMetParamName().equals( + StationName.class.getSimpleName())) { + // metPrm.setStringValue( Integer.toString( + // sndingProfile.getStationNum() ) ); + } else if (metPrm.getMetParamName().equals( + AirTemperature.class.getSimpleName())) { + metPrm.setValue(new Amount(sndingLayer + .getTemperature(), SI.CELSIUS)); + } else if (metPrm.getMetParamName().equals( + PressureLevel.class.getSimpleName())) { + metPrm.setValue(new Amount(sndingLayer + .getPressure(), NcUnits.MILLIBAR)); + } else if (metPrm.getMetParamName().equals( + RelativeHumidity.class.getSimpleName())) { + metPrm.setValue(new Amount(sndingLayer + .getRelativeHumidity(), Unit.ONE)); + } else if (metPrm.getMetParamName().equals( + DewPointTemp.class.getSimpleName())) { + metPrm.setValue(new Amount(sndingLayer + .getDewpoint(), SI.CELSIUS)); + } else if (metPrm.getMetParamName().equals( + WindSpeed.class.getSimpleName())) { + metPrm.setValue(new Amount(sndingLayer + .getWindSpeed(), NonSI.KNOT)); + } else if (metPrm.getMetParamName().equals( + WindDirection.class.getSimpleName())) { + metPrm.setValue(new Amount(sndingLayer + .getWindDirection(), NonSI.DEGREE_ANGLE)); + } else if (metPrm.getMetParamName().equals( + HeightAboveSeaLevel.class.getSimpleName())) { + metPrm.setValue(new Amount(sndingLayer + .getGeoHeight(), SI.METER)); + } else if (metPrm.getMetParamName().equals( + WindDirectionUComp.class.getSimpleName())) { + metPrm.setValue(new Amount(sndingLayer.getWindU(), + NonSI.KNOT)); + } else if (metPrm.getMetParamName().equals( + WindDirectionVComp.class.getSimpleName())) { + metPrm.setValue(new Amount(sndingLayer.getWindV(), + NonSI.KNOT)); + } + // TODO : for modelsoundings. what are the units? + // else if( metPrm.getMetParamName().equals( + // VerticalVelocity.class.getSimpleName() ) ) { + // metPrm.setValue( new Amount( + // sndingLayer.getOmega(), ) ); + // } + // else if( metPrm.getMetParamName().equals( + // SpecificHumidity.class.getSimpleName() ) ) { + // metPrm.setValue( new Amount( + // sndingLayer.getSpecHumidity(), NonSI. ) ); + // } } - - // loop thru the derived params, and derive the values using value in - // the dbParamsMap + + // loop thru the derived params, and derive the values using + // value in + // the dbParamsMap // - for( AbstractMetParameter derivedParam : derivedParamsList ) { - try { - derivedParam.derive( dbParamsMap.values() ); + for (AbstractMetParameter derivedParam : derivedParamsList) { + try { + derivedParam.derive(dbParamsMap.values()); - } catch( NotDerivableException e ) { - e.printStackTrace(); - } + } catch (NotDerivableException e) { + e.printStackTrace(); + } } - String latLonKey = formatLatLonKey( sndingProfile.getStationLatitude(), - sndingProfile.getStationLongitude() ); - PlotInfo pltInfo = plotMap.get( latLonKey ); + String latLonKey = formatLatLonKey( + sndingProfile.getStationLatitude(), + sndingProfile.getStationLongitude()); + PlotInfo pltInfo = plotMap.get(latLonKey); - if( pltInfo == null ) { - System.out.println("Error looking up plotInfo for map key:"+ latLonKey ); + if (pltInfo == null) { + System.out + .println("Error looking up plotInfo for map key:" + + latLonKey); + } else { + IImage image = null; + BufferedImage bImage = plotCreator + .getStationPlot(paramsToPlot); // don't need + // this anymore, + // id); + + if (bImage != null) { + image = target.initializeRaster(new IODataPreparer( + bImage, UUID.randomUUID().toString(), 0), + null); + caller.modelGenerated(new PlotInfo[] { pltInfo }, + image); + } } - else { - IImage image = null; - BufferedImage bImage = plotCreator.getStationPlot( paramsToPlot ); // don't need this anymore, id); - - if (bImage != null ) { - image = target.initializeRaster(new IODataPreparer( - bImage, UUID.randomUUID().toString(), 0), null); - caller.modelGenerated(new PlotInfo[] {pltInfo}, image); - } - } } // end loop thru returned profiles } // end loop thru stationQueue this.stationQueue.removeAll(stationQuery); - } + } return Status.OK_STATUS; } - private void setMetParamFromPDV( AbstractMetParameter metPrm, PointDataView pdv, String dbParam) { - Type pType = pdv.getType(dbParam); + private void setMetParamFromPDV(AbstractMetParameter metPrm, + PointDataView pdv, String dbParam) { + Type pType = pdv.getType(dbParam); - if( metPrm.hasStringValue() && pType != Type.STRING || - !metPrm.hasStringValue() && pType == Type.STRING ) { - System.out.println("type for DB parameter "+dbParam+" is not compatible with "+ - "metParameter "+metPrm.getClass().getSimpleName() ); - return; - } - else if( metPrm.hasStringValue() ) { - metPrm.setStringValue( pdv.getString( dbParam ) ); - } - else { - metPrm.setValue( pdv.getNumber( dbParam ), - pdv.getUnit( dbParam ) ); - } + if (metPrm.hasStringValue() && pType != Type.STRING + || !metPrm.hasStringValue() && pType == Type.STRING) { + System.out.println("type for DB parameter " + dbParam + + " is not compatible with " + "metParameter " + + metPrm.getClass().getSimpleName()); + return; + } else if (metPrm.hasStringValue()) { + metPrm.setStringValue(pdv.getString(dbParam)); + } else { + metPrm.setValue(pdv.getNumber(dbParam), pdv.getUnit(dbParam)); + } } - - private void setMapConstraints(Map map){ - for (Entry constraint : - this.constraintMap.entrySet()) { + + private void setMapConstraints(Map map) { + for (Entry constraint : this.constraintMap + .entrySet()) { map.put(constraint.getKey(), constraint.getValue()); } } @@ -899,23 +980,23 @@ public class PlotModelGenerator2 extends Job { this.plotCreator.setPlotMissingData(b); } - // use - private String formatLatLonKey( Number lat, Number lon ) { -// Double dlat = lat.doubleValue(); -// Double dlon = lon.doubleValue(); -// - return new String( ""+Math.round(lat.doubleValue()*1000.0) + ","+ - Math.round(lon.doubleValue()*1000.0) ); + // use + private String formatLatLonKey(Number lat, Number lon) { + // Double dlat = lat.doubleValue(); + // Double dlon = lon.doubleValue(); + // + return new String("" + Math.round(lat.doubleValue() * 1000.0) + "," + + Math.round(lon.doubleValue() * 1000.0)); } - -// public String getStationMessage(int id) { -// String message = null; -// if (plotCreator.rawMessageMap.containsKey(id) -// && plotCreator.rawMessageMap.get(id) != null) { -// message = plotCreator.rawMessageMap.get(id); -// } else { -// message = "No Data Available"; -// } -// return message; -// } + + // public String getStationMessage(int id) { + // String message = null; + // if (plotCreator.rawMessageMap.containsKey(id) + // && plotCreator.rawMessageMap.get(id) != null) { + // message = plotCreator.rawMessageMap.get(id); + // } else { + // message = "No Data Available"; + // } + // return message; + // } } diff --git a/ncep/gov.noaa.nws.ncep.viz.rsc.plotdata/src/gov/noaa/nws/ncep/viz/rsc/plotdata/rsc/H5UairPlotInfoRetriever.java b/ncep/gov.noaa.nws.ncep.viz.rsc.plotdata/src/gov/noaa/nws/ncep/viz/rsc/plotdata/rsc/H5UairPlotInfoRetriever.java index 373a836b9b..b68b79cad9 100644 --- a/ncep/gov.noaa.nws.ncep.viz.rsc.plotdata/src/gov/noaa/nws/ncep/viz/rsc/plotdata/rsc/H5UairPlotInfoRetriever.java +++ b/ncep/gov.noaa.nws.ncep.viz.rsc.plotdata/src/gov/noaa/nws/ncep/viz/rsc/plotdata/rsc/H5UairPlotInfoRetriever.java @@ -30,7 +30,7 @@ public class H5UairPlotInfoRetriever extends PointDataPlotInfoRetriever { @Override protected void addColumns(DbQuery dq) { - dq.addColumn("id"); + dq.addColumn("dataURI"); dq.addColumn("slat"); dq.addColumn("slon"); dq.addColumn("stid"); @@ -41,7 +41,7 @@ public class H5UairPlotInfoRetriever extends PointDataPlotInfoRetriever { @Override protected PlotInfo getPlotInfo(Object[] data) { PlotInfo stationInfo = new PlotInfo(); - stationInfo.id = (Integer) data[0]; + stationInfo.dataURI = (String) data[0]; stationInfo.latitude = ((Float)data[1]).doubleValue(); stationInfo.longitude = ((Float)data[2]).doubleValue(); stationInfo.stationId = (String)data[3]; diff --git a/ncep/gov.noaa.nws.ncep.viz.rsc.plotdata/src/gov/noaa/nws/ncep/viz/rsc/plotdata/rsc/PlotResource2.java b/ncep/gov.noaa.nws.ncep.viz.rsc.plotdata/src/gov/noaa/nws/ncep/viz/rsc/plotdata/rsc/PlotResource2.java index 4b3b93f93a..e05d80f5aa 100644 --- a/ncep/gov.noaa.nws.ncep.viz.rsc.plotdata/src/gov/noaa/nws/ncep/viz/rsc/plotdata/rsc/PlotResource2.java +++ b/ncep/gov.noaa.nws.ncep.viz.rsc.plotdata/src/gov/noaa/nws/ncep/viz/rsc/plotdata/rsc/PlotResource2.java @@ -1074,7 +1074,7 @@ public class PlotResource2 extends AbstractNatlCntrsResource