Issue #2259 Delete old skewt plugin.
Change-Id: I41bd0e2268c5024ea88215683c4ecb12530ebd0d Former-commit-id:d28018c5ce
[formerlye66bf7ce93
] [formerlyd28018c5ce
[formerlye66bf7ce93
] [formerly3741068984
[formerly 6f28d04b100001530afd17df69b87a6ac5a6407d]]] Former-commit-id:3741068984
Former-commit-id:3679a4526c
[formerly8eaa12c9db
] Former-commit-id:796b2e8e6c
This commit is contained in:
parent
a72c02725d
commit
a148790927
67 changed files with 96 additions and 14865 deletions
|
@ -15,11 +15,8 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="3.8.0",
|
|||
com.raytheon.uf.common.pointdata;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.dataplugin;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.datastorage;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.dataquery;bundle-version="1.0.0",
|
||||
com.raytheon.uf.common.status;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.derivparam;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.dataplugin.level;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.sounding;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.viz.core;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.viz.derivparam;bundle-version="1.12.1174",
|
||||
com.raytheon.viz.pointdata;bundle-version="1.12.1174",
|
||||
|
|
|
@ -1,31 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
<?eclipse version="3.2"?>
|
||||
<plugin>
|
||||
<extension
|
||||
point="com.raytheon.uf.viz.sounding.verticalSoundingAdapter">
|
||||
<verticalSoundingAdapter
|
||||
adapter="com.raytheon.uf.viz.acarssounding.AcarsSoundingAdapter"
|
||||
class="com.raytheon.uf.common.dataplugin.acarssounding.ACARSSoundingRecord"
|
||||
name="ACARSSoundingAdapter">
|
||||
</verticalSoundingAdapter>
|
||||
</extension>
|
||||
</plugin>
|
|
@ -1,122 +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.acarssounding;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
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.pointdata.spatial.SurfaceObsLocation;
|
||||
import com.raytheon.uf.common.sounding.SoundingLayer;
|
||||
import com.raytheon.uf.common.sounding.VerticalSounding;
|
||||
import com.raytheon.uf.common.sounding.adapter.AbstractVerticalSoundingAdapter;
|
||||
import com.raytheon.uf.common.wxmath.ZToPsa;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Dec 01, 2008 1747 jkorman Initial creation
|
||||
* Aug 14, 2013 2262 dgilling Use new wxmath method for ztopsa.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author jkorman
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class AcarsSoundingAdapter extends AbstractVerticalSoundingAdapter {
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.uf.viz.sounding.AbstractVerticalSoundingAdapter#createSoundings
|
||||
* ()
|
||||
*/
|
||||
@Override
|
||||
public VerticalSounding[] createSoundings() {
|
||||
ArrayList<VerticalSounding> soundings = new ArrayList<VerticalSounding>();
|
||||
for (PluginDataObject obj : objects) {
|
||||
ACARSSoundingRecord obs = (ACARSSoundingRecord) obj;
|
||||
VerticalSounding sounding = createVerticalSounding(obs);
|
||||
if (sounding != null) {
|
||||
soundings.add(sounding);
|
||||
}
|
||||
}
|
||||
return soundings.toArray(new VerticalSounding[soundings.size()]);
|
||||
}
|
||||
|
||||
private VerticalSounding createVerticalSounding(ACARSSoundingRecord record) {
|
||||
VerticalSounding sounding = null;
|
||||
|
||||
if (record != null) {
|
||||
sounding = new VerticalSounding();
|
||||
SurfaceObsLocation location = record.getLocation();
|
||||
sounding.setSpatialInfo(location);
|
||||
|
||||
sounding.setElevation(location.getElevation());
|
||||
sounding.setStationId(location.getStationId());
|
||||
sounding.setObsTime(record.getDataTime().getRefTimeAsCalendar());
|
||||
sounding.setDataTime(record.getDataTime());
|
||||
|
||||
sounding.setName(String.format("ACARS %.1f%c %.1f%c %s", Math
|
||||
.abs(location.getLatitude()),
|
||||
(location.getLatitude() >= 0 ? 'N' : 'S'), Math
|
||||
.abs(location.getLongitude()), (location
|
||||
.getLongitude() >= 0 ? 'E' : 'W'), record
|
||||
.getLocation().getStationId()));
|
||||
for (ACARSSoundingLayer layer : record.getLevels()) {
|
||||
SoundingLayer sndLayer = new SoundingLayer();
|
||||
if (layer.getDwpt() != null) {
|
||||
sndLayer.setDewpoint(layer.getDwpt().floatValue());
|
||||
}
|
||||
if (layer.getTemp() != null) {
|
||||
sndLayer.setTemperature(layer.getTemp().floatValue());
|
||||
}
|
||||
if (layer.getWindDirection() != null) {
|
||||
|
||||
sndLayer.setWindDirection(layer.getWindDirection()
|
||||
.floatValue());
|
||||
}
|
||||
if (layer.getWindSpeed() != null) {
|
||||
sndLayer.setWindSpeed(layer.getWindSpeed().floatValue());
|
||||
}
|
||||
if (layer.getPressure() != null) {
|
||||
sndLayer.setPressure(layer.getPressure().floatValue() / 100);
|
||||
} else if (layer.getFlightLevel() != null) {
|
||||
sndLayer.setPressure(ZToPsa.ztopsa(layer.getFlightLevel()));
|
||||
}
|
||||
if (layer.getFlightLevel() != null) {
|
||||
sndLayer.setGeoHeight(layer.getFlightLevel().floatValue());
|
||||
}
|
||||
sounding.addLayer(sndLayer);
|
||||
}
|
||||
|
||||
}
|
||||
return sounding;
|
||||
}
|
||||
|
||||
}
|
|
@ -9,21 +9,15 @@ Eclipse-RegisterBuddy: com.raytheon.uf.common.serialization
|
|||
Require-Bundle: org.eclipse.core.runtime,
|
||||
com.raytheon.uf.common.serialization;bundle-version="1.12.1174",
|
||||
gov.noaa.nws.ncep.ui.nsharp;bundle-version="1.0.0",
|
||||
org.eclipse.core.commands;bundle-version="3.6.0",
|
||||
com.raytheon.uf.viz.core;bundle-version="1.12.1174",
|
||||
com.raytheon.viz.ui;bundle-version="1.12.1174",
|
||||
org.eclipse.swt;bundle-version="3.6.1",
|
||||
org.eclipse.ui;bundle-version="3.6.1",
|
||||
org.geotools;bundle-version="2.6.4",
|
||||
gov.noaa.nws.ncep.viz.common;bundle-version="1.0.0",
|
||||
gov.noaa.nws.ncep.edex.common;bundle-version="1.0.0",
|
||||
com.raytheon.uf.common.dataplugin;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.time;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.viz.d2d.core;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.topo;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.geospatial;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.viz.d2d.ui;bundle-version="1.12.1174",
|
||||
com.raytheon.viz.core.graphing;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.pointdata;bundle-version="1.12.1174",
|
||||
com.raytheon.viz.pointdata;bundle-version="1.12.1174",
|
||||
javax.measure;bundle-version="1.0.0",
|
||||
|
|
|
@ -3,5 +3,3 @@ com.raytheon.uf.viz.d2d.nsharp.rsc.GribNSharpResourceData
|
|||
com.raytheon.uf.viz.d2d.nsharp.rsc.MdlSndNSharpResourceData
|
||||
com.raytheon.uf.viz.d2d.nsharp.rsc.PoesSndNSharpResourceData
|
||||
com.raytheon.uf.viz.d2d.nsharp.rsc.GoesSndNSharpResourceData
|
||||
com.raytheon.uf.viz.d2d.nsharp.display.D2DNSharpDescriptor
|
||||
com.raytheon.uf.viz.d2d.nsharp.display.D2DNSharpDisplay
|
|
@ -1,45 +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.d2d.nsharp.display;
|
||||
|
||||
import gov.noaa.nws.ncep.ui.nsharp.display.NsharpSkewTPaneDescriptor;
|
||||
|
||||
/**
|
||||
* This class only exists for backwards compatibility with serialized displayed,
|
||||
* once all serialized procedures/bundles have been modified then this can be
|
||||
* deleted.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Aug 31, 2012 bsteffen Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author bsteffen
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class D2DNSharpDescriptor extends NsharpSkewTPaneDescriptor {
|
||||
|
||||
}
|
|
@ -1,47 +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.d2d.nsharp.display;
|
||||
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
import gov.noaa.nws.ncep.ui.nsharp.display.NsharpSkewTPaneDisplay;
|
||||
|
||||
/**
|
||||
* This class only exists for backwards compatibility with serialized displayed,
|
||||
* once all serialized procedures/bundles have been modified then this can be
|
||||
* deleted.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Aug 31, 2012 bsteffen Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author bsteffen
|
||||
* @version 1.0
|
||||
*/
|
||||
@XmlRootElement
|
||||
public class D2DNSharpDisplay extends NsharpSkewTPaneDisplay {
|
||||
|
||||
}
|
|
@ -36,12 +36,6 @@
|
|||
install-size="0"
|
||||
version="0.0.0"/>
|
||||
|
||||
<plugin
|
||||
id="com.raytheon.viz.skewt"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"/>
|
||||
|
||||
<plugin
|
||||
id="com.raytheon.uf.viz.ui.popupskewt"
|
||||
download-size="0"
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
package com.raytheon.uf.viz.npp.crimss;
|
||||
|
||||
import gov.noaa.nws.ncep.ui.nsharp.display.NsharpEditor;
|
||||
import gov.noaa.nws.ncep.ui.nsharp.display.NsharpSkewTPaneDescriptor;
|
||||
import gov.noaa.nws.ncep.ui.nsharp.display.NsharpSkewTPaneDisplay;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
@ -42,8 +44,6 @@ import com.raytheon.uf.viz.core.requests.ThriftClient;
|
|||
import com.raytheon.uf.viz.core.rsc.AbstractRequestableResourceData;
|
||||
import com.raytheon.uf.viz.core.rsc.LoadProperties;
|
||||
import com.raytheon.uf.viz.core.rsc.ResourceType;
|
||||
import com.raytheon.uf.viz.d2d.nsharp.display.D2DNSharpDescriptor;
|
||||
import com.raytheon.uf.viz.d2d.nsharp.display.D2DNSharpDisplay;
|
||||
import com.raytheon.uf.viz.npp.sounding.rsc.NPPSoundingMapResourceData;
|
||||
import com.raytheon.uf.viz.points.PointsDataManager;
|
||||
import com.raytheon.uf.viz.productbrowser.AbstractRequestableProductBrowserDataDefinition;
|
||||
|
@ -60,9 +60,10 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Dec 6, 2011 bsteffen Initial creation
|
||||
* Dec 06, 2011 bsteffen Initial creation
|
||||
* May 02, 2013 1949 bsteffen Switch Product Browser from uengine to
|
||||
* DbQueryRequest.
|
||||
* Aug 20, 2013 2259 bsteffen Delete old skewt plugin.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -198,7 +199,7 @@ public class CrimssDataDefinition
|
|||
@Override
|
||||
protected Class<? extends IDescriptor> getDescriptorClass() {
|
||||
if (resourceData instanceof CrimssNSharpResourceData) {
|
||||
return D2DNSharpDescriptor.class;
|
||||
return NsharpSkewTPaneDescriptor.class;
|
||||
} else {
|
||||
return super.getDescriptorClass();
|
||||
}
|
||||
|
@ -214,7 +215,7 @@ public class CrimssDataDefinition
|
|||
@Override
|
||||
protected IDisplayPaneContainer openNewEditor(String editorId) {
|
||||
if (NsharpEditor.EDITOR_ID.equals(editorId)) {
|
||||
return UiUtil.createEditor(editorId, new D2DNSharpDisplay());
|
||||
return UiUtil.createEditor(editorId, new NsharpSkewTPaneDisplay());
|
||||
} else {
|
||||
return super.openNewEditor(editorId);
|
||||
}
|
||||
|
|
|
@ -7,27 +7,16 @@ Bundle-Activator: com.raytheon.uf.viz.sounding.Activator
|
|||
Bundle-Vendor: RAYTHEON
|
||||
Require-Bundle: org.eclipse.core.runtime,
|
||||
com.raytheon.uf.common.sounding;bundle-version="1.12.1174";visibility:=reexport,
|
||||
com.raytheon.uf.common.status;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.dataplugin;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.pointdata;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.geospatial;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.datastorage;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.dataquery;bundle-version="1.0.0",
|
||||
com.raytheon.uf.common.dataplugin.grid;bundle-version="1.0.0",
|
||||
com.raytheon.uf.common.dataplugin.bufrua;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.dataplugin.goessounding;bundle-version="1.0.0",
|
||||
com.raytheon.uf.common.dataplugin.poessounding;bundle-version="1.0.0",
|
||||
com.raytheon.uf.common.dataplugin.profiler;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.topo;bundle-version="1.12.1174",
|
||||
com.raytheon.viz.pointdata;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.viz.core;bundle-version="1.12.1174",
|
||||
com.raytheon.edex.meteolib;bundle-version="1.12.1174",
|
||||
com.raytheon.edex.plugin.modelsounding;bundle-version="1.12.1174",
|
||||
javax.measure;bundle-version="1.0.0"
|
||||
com.raytheon.viz.core;bundle-version="1.12.1174"
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Eclipse-BuddyPolicy: registered
|
||||
Export-Package: com.raytheon.uf.viz.sounding,
|
||||
com.raytheon.uf.viz.sounding.adapters,
|
||||
com.raytheon.uf.viz.sounding.providers
|
||||
Import-Package: com.raytheon.viz.core.map
|
||||
|
|
|
@ -20,43 +20,8 @@
|
|||
-->
|
||||
<?eclipse version="3.2"?>
|
||||
<plugin>
|
||||
<extension-point id="com.raytheon.uf.viz.sounding.verticalSoundingAdapter" name="VerticalSoundingAdapter" schema="schema/verticalSoundingAdapter.exsd"/>
|
||||
<extension-point id="com.raytheon.uf.viz.sounding.verticalSoundingProvider" name="VerticalSoundingProvider" schema="schema/verticalSoundingProvider.exsd"/>
|
||||
|
||||
<extension
|
||||
point="com.raytheon.uf.viz.sounding.verticalSoundingAdapter">
|
||||
<verticalSoundingAdapter
|
||||
adapter="com.raytheon.uf.viz.sounding.adapters.POESSoundingAdapter"
|
||||
class="com.raytheon.uf.common.dataplugin.poessounding.POESSounding"
|
||||
name="PoesSoundingAdapter">
|
||||
</verticalSoundingAdapter>
|
||||
<verticalSoundingAdapter
|
||||
adapter="com.raytheon.uf.viz.sounding.adapters.GOESSoundingAdapter"
|
||||
class="com.raytheon.uf.common.dataplugin.goessounding.GOESSounding"
|
||||
name="GoesSoundingAdapter">
|
||||
</verticalSoundingAdapter>
|
||||
<verticalSoundingAdapter
|
||||
adapter="com.raytheon.uf.common.dataplugin.bufrua.UAObsAdapter"
|
||||
class="com.raytheon.uf.common.dataplugin.bufrua.UAObs"
|
||||
name="UAObsAdapter">
|
||||
</verticalSoundingAdapter>
|
||||
<verticalSoundingAdapter
|
||||
adapter="com.raytheon.uf.viz.sounding.adapters.BufrSoundingAdapter"
|
||||
class="com.raytheon.edex.plugin.modelsounding.common.SoundingSite"
|
||||
name="BufrAdapter">
|
||||
</verticalSoundingAdapter>
|
||||
<verticalSoundingAdapter
|
||||
adapter="com.raytheon.uf.viz.sounding.adapters.ProfilerSoundingAdapter"
|
||||
class="com.raytheon.uf.common.dataplugin.profiler.ProfilerObs"
|
||||
name="ProfilerSoundingAdapter">
|
||||
</verticalSoundingAdapter>
|
||||
<verticalSoundingAdapter
|
||||
adapter="com.raytheon.uf.viz.sounding.adapters.VwpSoundingAdapter"
|
||||
class="com.raytheon.uf.common.dataplugin.radar.RadarRecord"
|
||||
name="VwpSoundingAdapter">
|
||||
</verticalSoundingAdapter>
|
||||
</extension>
|
||||
|
||||
<extension
|
||||
point="com.raytheon.uf.viz.sounding.verticalSoundingProvider">
|
||||
<verticalSoundingProvider
|
||||
|
|
|
@ -1,119 +0,0 @@
|
|||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<!-- Schema file written by PDE -->
|
||||
<schema targetNamespace="com.raytheon.uf.viz.sounding" xmlns="http://www.w3.org/2001/XMLSchema">
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.schema plugin="com.raytheon.uf.viz.sounding" id="com.raytheon.uf.viz.sounding.verticalSoundingAdapter" name="VerticalSoundingAdapter"/>
|
||||
</appinfo>
|
||||
<documentation>
|
||||
[Enter description of this extension point.]
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
<element name="extension">
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.element />
|
||||
</appinfo>
|
||||
</annotation>
|
||||
<complexType>
|
||||
<sequence minOccurs="1" maxOccurs="unbounded">
|
||||
<element ref="verticalSoundingAdapter"/>
|
||||
</sequence>
|
||||
<attribute name="point" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="id" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="name" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
<appinfo>
|
||||
<meta.attribute translatable="true"/>
|
||||
</appinfo>
|
||||
</annotation>
|
||||
</attribute>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<element name="verticalSoundingAdapter">
|
||||
<complexType>
|
||||
<attribute name="name" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="class" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
<appinfo>
|
||||
<meta.attribute kind="java" basedOn="com.raytheon.uf.common.dataplugin.PluginDataObject:"/>
|
||||
</appinfo>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="adapter" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
<appinfo>
|
||||
<meta.attribute kind="java" basedOn="com.raytheon.uf.common.sounding.adapter.AbstractVerticalSoundingAdapter:"/>
|
||||
</appinfo>
|
||||
</annotation>
|
||||
</attribute>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.section type="since"/>
|
||||
</appinfo>
|
||||
<documentation>
|
||||
[Enter the first release in which this extension point appears.]
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.section type="examples"/>
|
||||
</appinfo>
|
||||
<documentation>
|
||||
[Enter extension point usage example here.]
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.section type="apiinfo"/>
|
||||
</appinfo>
|
||||
<documentation>
|
||||
[Enter API information here.]
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.section type="implementation"/>
|
||||
</appinfo>
|
||||
<documentation>
|
||||
[Enter information about supplied implementation of this extension point.]
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
|
||||
</schema>
|
File diff suppressed because it is too large
Load diff
|
@ -1,164 +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.adapters;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.raytheon.edex.plugin.modelsounding.common.SoundingSite;
|
||||
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
||||
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
|
||||
import com.raytheon.uf.common.pointdata.PointDataContainer;
|
||||
import com.raytheon.uf.common.pointdata.PointDataView;
|
||||
import com.raytheon.uf.common.pointdata.spatial.SurfaceObsLocation;
|
||||
import com.raytheon.uf.common.sounding.SoundingLayer;
|
||||
import com.raytheon.uf.common.sounding.VerticalSounding;
|
||||
import com.raytheon.uf.common.sounding.adapter.AbstractVerticalSoundingAdapter;
|
||||
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.datastructure.DataCubeContainer;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.status.StatusConstants;
|
||||
import com.raytheon.uf.viz.sounding.Activator;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Dec 1, 2008 1747 jkorman Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author jkorman
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class BufrSoundingAdapter extends AbstractVerticalSoundingAdapter {
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus.getHandler(BufrSoundingAdapter.class);
|
||||
|
||||
private static final String[] requiredParameters = new String[] { "P", "T",
|
||||
"DpT", "wSp", "WD" };
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.uf.viz.sounding.AbstractVerticalSoundingAdapter#createSoundings
|
||||
* ()
|
||||
*/
|
||||
@Override
|
||||
public VerticalSounding[] createSoundings() {
|
||||
ArrayList<VerticalSounding> soundings = new ArrayList<VerticalSounding>();
|
||||
for (PluginDataObject obj : objects) {
|
||||
SoundingSite obs = (SoundingSite) obj;
|
||||
VerticalSounding sounding = createVerticalSounding(obs);
|
||||
if (sounding != null) {
|
||||
soundings.add(sounding);
|
||||
}
|
||||
}
|
||||
return soundings.toArray(new VerticalSounding[soundings.size()]);
|
||||
}
|
||||
|
||||
private VerticalSounding createVerticalSounding(SoundingSite sndngSite) {
|
||||
VerticalSounding sounding = null;
|
||||
|
||||
if (sndngSite != null) {
|
||||
|
||||
Map<String, RequestConstraint> rcMap = new HashMap<String, RequestConstraint>();
|
||||
rcMap.put("dataURI", new RequestConstraint(""
|
||||
+ sndngSite.getDataURI()));
|
||||
PointDataContainer container;
|
||||
try {
|
||||
container = DataCubeContainer.getPointData(sndngSite
|
||||
.getPluginName(), requiredParameters, rcMap);
|
||||
} catch (VizException e1) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Error retrieving sounding", e1);
|
||||
return sounding;
|
||||
}
|
||||
|
||||
if (container == null || container.getAllocatedSz() == 0) {
|
||||
return sounding;
|
||||
}
|
||||
PointDataView pdv = container.readRandom(0);
|
||||
|
||||
Number[] p = pdv.getNumberAllLevels("P");
|
||||
Number[] temp = pdv.getNumberAllLevels("T");
|
||||
Number[] dpt = pdv.getNumberAllLevels("DpT");
|
||||
Number[] windSpd = pdv.getNumberAllLevels("wSp");
|
||||
Number[] windDir = pdv.getNumberAllLevels("WD");
|
||||
|
||||
if (p != null && p.length != 0) {
|
||||
sounding = new VerticalSounding();
|
||||
SurfaceObsLocation location = sndngSite.getLocation();
|
||||
sounding.setSpatialInfo(location);
|
||||
|
||||
sounding.setElevation(sndngSite.getElevation());
|
||||
sounding.setStationId(sndngSite.getStationId());
|
||||
sounding.setObsTime(sndngSite.getDataTime()
|
||||
.getRefTimeAsCalendar());
|
||||
sounding.setDataTime(sndngSite.getDataTime());
|
||||
|
||||
String type = sndngSite.getReportType();
|
||||
|
||||
type = ("ETA".equals(type)) ? "NAM" : "GFS";
|
||||
|
||||
sounding.setDisplayFormat(String.format("%sBUFR{$pointId$}%s ",
|
||||
type, sndngSite.getStationId()));
|
||||
|
||||
sounding.setName(sndngSite.getStationId());
|
||||
|
||||
for (int i = 0; i < p.length; i++) {
|
||||
Number level = p[i];
|
||||
if (level != null && level.intValue() != -9999) {
|
||||
SoundingLayer layer = new SoundingLayer();
|
||||
|
||||
layer.setPressure((level.floatValue() != -9999) ? level
|
||||
.floatValue() : SoundingLayer.MISSING);
|
||||
float t = temp[i].floatValue();
|
||||
layer.setTemperature((t != -9999) ? t
|
||||
: SoundingLayer.MISSING);
|
||||
|
||||
Float d = dpt[i].floatValue();
|
||||
layer.setDewpoint((d != -9999) ? d
|
||||
: SoundingLayer.MISSING);
|
||||
|
||||
Float s = windSpd[i].floatValue();
|
||||
layer.setWindSpeed((s != -9999) ? s
|
||||
: SoundingLayer.MISSING);
|
||||
|
||||
Float w = windDir[i].floatValue();
|
||||
layer.setWindDirection((w != -9999) ? w
|
||||
: SoundingLayer.MISSING);
|
||||
|
||||
sounding.addLayer(layer);
|
||||
}
|
||||
} // for
|
||||
}
|
||||
}
|
||||
return sounding;
|
||||
}
|
||||
}
|
|
@ -1,171 +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.adapters;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.measure.converter.UnitConverter;
|
||||
import javax.measure.unit.SI;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
||||
import com.raytheon.uf.common.dataplugin.goessounding.GOESSounding;
|
||||
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
|
||||
import com.raytheon.uf.common.pointdata.PointDataContainer;
|
||||
import com.raytheon.uf.common.pointdata.PointDataView;
|
||||
import com.raytheon.uf.common.pointdata.spatial.SurfaceObsLocation;
|
||||
import com.raytheon.uf.common.sounding.SoundingLayer;
|
||||
import com.raytheon.uf.common.sounding.VerticalSounding;
|
||||
import com.raytheon.uf.common.sounding.adapter.AbstractVerticalSoundingAdapter;
|
||||
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.util.TimeUtil;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.viz.pointdata.PointDataRequest;
|
||||
|
||||
/**
|
||||
* TODO Add Description
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Dec 01, 2008 1747 jkorman Initial creation
|
||||
* May 15, 2013 1869 bsteffen Remove DataURI from goes/poes soundings.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author jkorman
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class GOESSoundingAdapter extends AbstractVerticalSoundingAdapter {
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus.getHandler(GOESSoundingAdapter.class);
|
||||
|
||||
private static UnitConverter pascalsToHectoPascals = SI.PASCAL
|
||||
.getConverterTo(SI.HECTO(SI.PASCAL));
|
||||
|
||||
private static final String[] requiredParameters = new String[] {
|
||||
"pressure", "height", "temperature", "dewPoint" };
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.uf.viz.sounding.AbstractVerticalSoundingAdapter#createSoundings
|
||||
* ()
|
||||
*/
|
||||
@Override
|
||||
public VerticalSounding[] createSoundings() {
|
||||
ArrayList<VerticalSounding> soundings = new ArrayList<VerticalSounding>();
|
||||
for (PluginDataObject obj : objects) {
|
||||
GOESSounding obs = (GOESSounding) obj;
|
||||
VerticalSounding sounding = createVerticalSounding(obs);
|
||||
if (sounding != null) {
|
||||
soundings.add(sounding);
|
||||
}
|
||||
}
|
||||
return soundings.toArray(new VerticalSounding[soundings.size()]);
|
||||
}
|
||||
|
||||
private VerticalSounding createVerticalSounding(GOESSounding obsData) {
|
||||
VerticalSounding sounding = null;
|
||||
|
||||
if (obsData != null) {
|
||||
|
||||
Map<String, RequestConstraint> rcMap = new HashMap<String, RequestConstraint>();
|
||||
rcMap.put("location.stationId", new RequestConstraint(obsData
|
||||
.getLocation().getStationId()));
|
||||
rcMap.put(
|
||||
"dataTime.refTime",
|
||||
new RequestConstraint(TimeUtil.formatToSqlTimestamp(obsData
|
||||
.getDataTime().getRefTime())));
|
||||
PointDataContainer container;
|
||||
try {
|
||||
container = PointDataRequest.requestPointDataAllLevels(null,
|
||||
obsData.getPluginName(), requiredParameters, null,
|
||||
rcMap);
|
||||
} catch (VizException e1) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Error retrieving sounding", e1);
|
||||
return sounding;
|
||||
}
|
||||
PointDataView pdv;
|
||||
if (container == null || container.getAllocatedSz() == 0) {
|
||||
return sounding;
|
||||
}
|
||||
|
||||
pdv = container.readRandom(0);
|
||||
Number[] p = pdv.getNumberAllLevels("pressure");
|
||||
Number[] gh = pdv.getNumberAllLevels("height");
|
||||
Number[] temp = pdv.getNumberAllLevels("temperature");
|
||||
Number[] dp = pdv.getNumberAllLevels("dewPoint");
|
||||
|
||||
if (p != null) {
|
||||
sounding = new VerticalSounding();
|
||||
SurfaceObsLocation location = obsData.getLocation();
|
||||
sounding.setSpatialInfo(location);
|
||||
|
||||
sounding.setElevation(obsData.getElevation());
|
||||
sounding.setStationId(obsData.getStationId());
|
||||
sounding.setObsTime(obsData.getTimeObs());
|
||||
sounding.setDataTime(obsData.getDataTime());
|
||||
|
||||
sounding.setName(String.format("GoesBufr %.1f%c %.1f%c %s",
|
||||
Math.abs(location.getLatitude()), (location
|
||||
.getLatitude() >= 0 ? 'N' : 'S'), Math
|
||||
.abs(location.getLongitude()), (location
|
||||
.getLongitude() >= 0 ? 'E' : 'W'), obsData
|
||||
.getStationId()));
|
||||
|
||||
for (int i = 0; i < p.length; i++) {
|
||||
Number level = p[i];
|
||||
if (level != null && level.intValue() != -9999) {
|
||||
SoundingLayer layer = new SoundingLayer();
|
||||
|
||||
Integer n = level.intValue();
|
||||
layer
|
||||
.setPressure((n != -9999) ? (float) (pascalsToHectoPascals
|
||||
.convert(n.doubleValue()))
|
||||
: SoundingLayer.MISSING);
|
||||
|
||||
n = gh[i].intValue();
|
||||
layer.setGeoHeight((n != -9999) ? n.floatValue()
|
||||
: SoundingLayer.MISSING);
|
||||
|
||||
float t = temp[i].floatValue();
|
||||
layer.setTemperature((t != -9999) ? t
|
||||
: SoundingLayer.MISSING);
|
||||
|
||||
t = dp[i].floatValue();
|
||||
layer.setDewpoint((t != -9999) ? t
|
||||
: SoundingLayer.MISSING);
|
||||
|
||||
sounding.addLayer(layer);
|
||||
}
|
||||
} // for
|
||||
}
|
||||
}
|
||||
return sounding;
|
||||
}
|
||||
}
|
|
@ -1,233 +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.adapters;
|
||||
|
||||
import java.awt.Point;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
||||
import com.raytheon.uf.common.dataplugin.grid.GridRecord;
|
||||
import com.raytheon.uf.common.datastorage.Request;
|
||||
import com.raytheon.uf.common.datastorage.records.IDataRecord;
|
||||
import com.raytheon.uf.common.geospatial.ISpatialObject;
|
||||
import com.raytheon.uf.common.geospatial.MapUtil;
|
||||
import com.raytheon.uf.common.geospatial.PointUtil;
|
||||
import com.raytheon.uf.common.pointdata.spatial.SurfaceObsLocation;
|
||||
import com.raytheon.uf.common.sounding.SoundingLayer;
|
||||
import com.raytheon.uf.common.sounding.VerticalSounding;
|
||||
import com.raytheon.uf.common.sounding.adapter.AbstractVerticalSoundingAdapter;
|
||||
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.common.topo.TopoQuery;
|
||||
import com.raytheon.uf.viz.core.datastructure.DataCubeContainer;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.sounding.SoundingParams;
|
||||
import com.raytheon.viz.core.map.GeoUtil;
|
||||
import com.vividsolutions.jts.geom.GeometryFactory;
|
||||
|
||||
/**
|
||||
* Sounding adapter for grid data, used for cloud height sampling
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Dec 15, 2009 mschenke Initial creation
|
||||
* Feb 15, 2013 1638 mschenke Got rid of viz/edex topo classes
|
||||
* and moved into common
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author mschenke
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class GridSoundingAdapter extends AbstractVerticalSoundingAdapter {
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(GridSoundingAdapter.class);
|
||||
|
||||
/** Interface for getting point information */
|
||||
private IPointSounding pointSounding;
|
||||
|
||||
/** Map used for skewt sounding generation */
|
||||
private Map<DataTime, Map<Double, SoundingLayer>> soundingMap;
|
||||
|
||||
/** The SurfaceObsLocation used for skewt */
|
||||
private SurfaceObsLocation location;
|
||||
|
||||
/**
|
||||
* Skewt constructor
|
||||
*
|
||||
* @param pointSounding
|
||||
* Object which will provide information on point location and
|
||||
* name
|
||||
*/
|
||||
public GridSoundingAdapter(IPointSounding pointSounding) {
|
||||
this.pointSounding = pointSounding;
|
||||
soundingMap = new HashMap<DataTime, Map<Double, SoundingLayer>>();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.uf.viz.sounding.adapters.AbstractVerticalSoundingAdapter
|
||||
* #createSoundings()
|
||||
*/
|
||||
@Override
|
||||
public VerticalSounding[] createSoundings() {
|
||||
long t0 = System.currentTimeMillis();
|
||||
List<VerticalSounding> soundings = new ArrayList<VerticalSounding>();
|
||||
try {
|
||||
GridRecord sampleRecord = (GridRecord) objects[0];
|
||||
ISpatialObject spatial = sampleRecord.getSpatialObject();
|
||||
Point point = PointUtil.determineIndex(
|
||||
pointSounding.getCoordinate(), spatial.getCrs(),
|
||||
MapUtil.getGridGeometry(spatial));
|
||||
if (point.y < 0 || point.y >= spatial.getNy() || point.x < 0
|
||||
|| point.x >= spatial.getNx()) {
|
||||
statusHandler.handle(Priority.SIGNIFICANT,
|
||||
"Point is outside bounds of grid", new VizException(
|
||||
"Point is outside bounds of grid"));
|
||||
return new VerticalSounding[0];
|
||||
}
|
||||
String name = String.format("%s pt%s %s",
|
||||
sampleRecord.getDatasetId(), pointSounding.getPointName(),
|
||||
GeoUtil.formatCoordinate(pointSounding.getCoordinate()));
|
||||
location = new SurfaceObsLocation(name);
|
||||
location.setGeometry(new GeometryFactory()
|
||||
.createPoint(pointSounding.getCoordinate()));
|
||||
location.setLatitude(pointSounding.getCoordinate().y);
|
||||
location.setLongitude(pointSounding.getCoordinate().x);
|
||||
location.setElevation(new Double(TopoQuery.getInstance().getHeight(
|
||||
pointSounding.getCoordinate())).intValue());
|
||||
|
||||
// TODO: Request data for a single point for all records, which is
|
||||
// the fastest way to get data from the data cube.
|
||||
DataCubeContainer.getDataRecords(Arrays.asList(objects),
|
||||
Request.buildPointRequest(point), null);
|
||||
for (PluginDataObject pdo : objects) {
|
||||
IDataRecord[] rec = (IDataRecord[]) pdo.getMessageData();
|
||||
if (rec != null && rec.length > 0) {
|
||||
float[] data = (float[]) rec[0].getDataObject();
|
||||
float val = data[0];
|
||||
addToSoundingMap((GridRecord) pdo, val);
|
||||
}
|
||||
}
|
||||
for (DataTime time : soundingMap.keySet()) {
|
||||
VerticalSounding sounding = new VerticalSounding();
|
||||
sounding.setDataTime(time);
|
||||
sounding.setElevation(location.getElevation());
|
||||
sounding.setName(name);
|
||||
sounding.setObsTime(time.getValidTime());
|
||||
sounding.setSpatialInfo((SurfaceObsLocation) location.clone());
|
||||
sounding.setStationId(location.getStationId());
|
||||
Map<Double, SoundingLayer> layerMap = soundingMap.get(time);
|
||||
for (SoundingLayer layer : layerMap.values()) {
|
||||
sounding.addLayer(layer);
|
||||
}
|
||||
|
||||
SoundingParams params = new SoundingParams(sounding);
|
||||
sounding = params.getAnalysisData();
|
||||
sounding.checkSfcLayer();
|
||||
sounding.removeBelowSfcLayers();
|
||||
// Make sure that the surface layer is defined and all values
|
||||
// are set to a value other than MISSING before adding it to the
|
||||
// soundings list
|
||||
SoundingLayer abv = sounding.get(1);
|
||||
if (sounding.get(0).getTemperature() > SoundingLayer.NODATA
|
||||
&& abv.getTemperature() < SoundingLayer.NODATA) {
|
||||
sounding.get(0).setTemperature(
|
||||
(float) (Math.pow(sounding.get(0).getPressure()
|
||||
/ abv.getPressure(), 0.286) * abv
|
||||
.getTemperature()));
|
||||
}
|
||||
if (sounding.get(0).getDewpoint() > SoundingLayer.NODATA
|
||||
&& abv.getDewpoint() < SoundingLayer.NODATA) {
|
||||
sounding.get(0).setDewpoint(abv.getDewpoint());
|
||||
}
|
||||
if (sounding.get(0).getWindU() > SoundingLayer.NODATA
|
||||
&& abv.getWindU() < SoundingLayer.NODATA) {
|
||||
sounding.get(0).setWindU(abv.getWindU());
|
||||
}
|
||||
if (sounding.get(0).getWindV() > SoundingLayer.NODATA
|
||||
&& abv.getWindV() < SoundingLayer.NODATA) {
|
||||
sounding.get(0).setWindV(abv.getWindV());
|
||||
}
|
||||
params = new SoundingParams(sounding);
|
||||
sounding = params.getAnalysisData();
|
||||
sounding.checkSfcLayer();
|
||||
soundings.add(sounding);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Error creating grib soundings", e);
|
||||
}
|
||||
System.out.println("Time to createSoundings = "
|
||||
+ (System.currentTimeMillis() - t0));
|
||||
return soundings.toArray(new VerticalSounding[soundings.size()]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add record to the skewt sounding map
|
||||
*
|
||||
* @param record
|
||||
* @param dataVal
|
||||
* @throws VizException
|
||||
*/
|
||||
private void addToSoundingMap(GridRecord record, float dataVal)
|
||||
throws VizException {
|
||||
DataTime dt = record.getDataTime();
|
||||
Map<Double, SoundingLayer> layerMap = soundingMap.get(dt);
|
||||
if (layerMap == null) {
|
||||
layerMap = new HashMap<Double, SoundingLayer>();
|
||||
soundingMap.put(dt, layerMap);
|
||||
}
|
||||
|
||||
Double l1val = record.getLevel().getLevelonevalue();
|
||||
SoundingLayer layer = layerMap.get(l1val);
|
||||
if (layer == null) {
|
||||
layer = new SoundingLayer();
|
||||
layer.setPressure(l1val.floatValue());
|
||||
layerMap.put(l1val, layer);
|
||||
}
|
||||
String param = record.getParameter().getAbbreviation();
|
||||
|
||||
if ("T".equals(param)) {
|
||||
layer.setTemperature(dataVal);
|
||||
} else if ("GH".equals(param)) {
|
||||
layer.setGeoHeight(dataVal);
|
||||
} else if ("uW".equals(param)) {
|
||||
layer.setWindU(dataVal);
|
||||
} else if ("vW".equals(param)) {
|
||||
layer.setWindV(dataVal);
|
||||
} else if ("DpT".equals(param)) {
|
||||
layer.setDewpoint(dataVal);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,46 +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.adapters;
|
||||
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
|
||||
/**
|
||||
* TODO Add Description
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Dec 16, 2009 mschenke Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author mschenke
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public interface IPointSounding {
|
||||
|
||||
public Coordinate getCoordinate();
|
||||
|
||||
public String getPointName();
|
||||
|
||||
}
|
|
@ -1,31 +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.adapters;
|
||||
|
||||
import com.raytheon.uf.common.sounding.VerticalSounding;
|
||||
|
||||
public interface IVerticalSoundingAdapter {
|
||||
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
VerticalSounding createVerticalSounding();
|
||||
}
|
|
@ -1,180 +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.adapters;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.measure.converter.UnitConverter;
|
||||
import javax.measure.unit.SI;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
||||
import com.raytheon.uf.common.dataplugin.poessounding.POESSounding;
|
||||
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
|
||||
import com.raytheon.uf.common.pointdata.PointDataContainer;
|
||||
import com.raytheon.uf.common.pointdata.PointDataView;
|
||||
import com.raytheon.uf.common.pointdata.spatial.SurfaceObsLocation;
|
||||
import com.raytheon.uf.common.sounding.SoundingLayer;
|
||||
import com.raytheon.uf.common.sounding.VerticalSounding;
|
||||
import com.raytheon.uf.common.sounding.WxMath;
|
||||
import com.raytheon.uf.common.sounding.adapter.AbstractVerticalSoundingAdapter;
|
||||
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.util.TimeUtil;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.viz.pointdata.PointDataRequest;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Dec 01, 2008 1747 jkorman Initial creation
|
||||
* May 15, 2013 1869 bsteffen Remove DataURI from goes/poes soundings.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author jkorman
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class POESSoundingAdapter extends AbstractVerticalSoundingAdapter {
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus.getHandler(POESSoundingAdapter.class);
|
||||
|
||||
private static UnitConverter pascalsToHectoPascals = SI.PASCAL
|
||||
.getConverterTo(SI.HECTO(SI.PASCAL));
|
||||
|
||||
private static final String[] requiredParameters = new String[] {
|
||||
"pressure", "temperature", "mixingRatio" };
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.uf.viz.sounding.AbstractVerticalSoundingAdapter#createSoundings
|
||||
* ()
|
||||
*/
|
||||
@Override
|
||||
public VerticalSounding[] createSoundings() {
|
||||
ArrayList<VerticalSounding> soundings = new ArrayList<VerticalSounding>();
|
||||
for (PluginDataObject obj : objects) {
|
||||
POESSounding obs = (POESSounding) obj;
|
||||
VerticalSounding sounding = createVerticalSounding(obs);
|
||||
if (sounding != null) {
|
||||
soundings.add(sounding);
|
||||
}
|
||||
}
|
||||
return soundings.toArray(new VerticalSounding[soundings.size()]);
|
||||
}
|
||||
|
||||
private VerticalSounding createVerticalSounding(POESSounding obsData) {
|
||||
VerticalSounding sounding = null;
|
||||
|
||||
if (obsData != null) {
|
||||
|
||||
Map<String, RequestConstraint> rcMap = new HashMap<String, RequestConstraint>();
|
||||
rcMap.put("location.stationId", new RequestConstraint(obsData
|
||||
.getLocation().getStationId()));
|
||||
rcMap.put(
|
||||
"dataTime.refTime",
|
||||
new RequestConstraint(TimeUtil.formatToSqlTimestamp(obsData
|
||||
.getDataTime().getRefTime())));
|
||||
PointDataContainer container;
|
||||
try {
|
||||
container = PointDataRequest.requestPointDataAllLevels(null,
|
||||
obsData.getPluginName(), requiredParameters, null,
|
||||
rcMap);
|
||||
} catch (VizException e1) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Error retrieving sounding", e1);
|
||||
return sounding;
|
||||
}
|
||||
|
||||
if (container == null || container.getAllocatedSz() == 0) {
|
||||
return sounding;
|
||||
}
|
||||
PointDataView pdv = container.readRandom(0);
|
||||
|
||||
Number[] p = pdv.getNumberAllLevels("pressure");
|
||||
Number[] temp = pdv.getNumberAllLevels("temperature");
|
||||
Number[] mr = pdv.getNumberAllLevels("mixingRatio");
|
||||
|
||||
if (p != null) {
|
||||
sounding = new VerticalSounding();
|
||||
SurfaceObsLocation location = obsData.getLocation();
|
||||
sounding.setSpatialInfo(location);
|
||||
|
||||
sounding.setElevation(obsData.getElevation());
|
||||
sounding.setStationId(obsData.getStationId());
|
||||
sounding.setObsTime(obsData.getDataTime()
|
||||
.getRefTimeAsCalendar());
|
||||
sounding.setDataTime(obsData.getDataTime());
|
||||
|
||||
sounding.setName(String.format("PoesBufr %.1f%c %.1f%c %s",
|
||||
Math.abs(location.getLatitude()), (location
|
||||
.getLatitude() >= 0 ? 'N' : 'S'), Math
|
||||
.abs(location.getLongitude()), (location
|
||||
.getLongitude() >= 0 ? 'E' : 'W'), obsData
|
||||
.getStationId()));
|
||||
|
||||
for (int i = 0; i < p.length; i++) {
|
||||
Number level = p[i];
|
||||
if (level != null && level.intValue() != -9999) {
|
||||
SoundingLayer layer = new SoundingLayer();
|
||||
|
||||
Integer n = level.intValue();
|
||||
layer
|
||||
.setPressure((n != -9999) ? (float) pascalsToHectoPascals
|
||||
.convert(n.doubleValue())
|
||||
: SoundingLayer.MISSING);
|
||||
|
||||
float t = temp[i].floatValue();
|
||||
layer.setTemperature((t != -9999) ? t
|
||||
: SoundingLayer.MISSING);
|
||||
|
||||
// POES data doesn't contain dewpoint, but does have
|
||||
// mixing ratio so
|
||||
// we need to calculate the dewpoint from available
|
||||
// data.
|
||||
Double m = mr[i].doubleValue();
|
||||
if ((n != -9999) && (t != -9999) && (m != -9999)) {
|
||||
|
||||
double dewPoint = WxMath.tempAtMixingRatio(
|
||||
pascalsToHectoPascals.convert(n
|
||||
.doubleValue()), m * 1000);
|
||||
|
||||
layer.setDewpoint((float) dewPoint);
|
||||
} else {
|
||||
layer.setDewpoint(SoundingLayer.MISSING);
|
||||
}
|
||||
sounding.addLayer(layer);
|
||||
}
|
||||
} // for
|
||||
}
|
||||
}
|
||||
return sounding;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,178 +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.adapters;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
||||
import com.raytheon.uf.common.dataplugin.profiler.ProfilerObs;
|
||||
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
|
||||
import com.raytheon.uf.common.pointdata.PointDataContainer;
|
||||
import com.raytheon.uf.common.pointdata.PointDataView;
|
||||
import com.raytheon.uf.common.pointdata.spatial.SurfaceObsLocation;
|
||||
import com.raytheon.uf.common.sounding.SoundingLayer;
|
||||
import com.raytheon.uf.common.sounding.VerticalSounding;
|
||||
import com.raytheon.uf.common.sounding.adapter.AbstractVerticalSoundingAdapter;
|
||||
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.datastructure.DataCubeContainer;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.status.StatusConstants;
|
||||
import com.raytheon.uf.viz.sounding.Activator;
|
||||
|
||||
/**
|
||||
*
|
||||
* Profiler sounding adapter
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Dec 11, 2009 3953 jelkins Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author jelkins
|
||||
* @version 1.0
|
||||
*/
|
||||
public class ProfilerSoundingAdapter extends AbstractVerticalSoundingAdapter {
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus.getHandler(ProfilerSoundingAdapter.class);
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.uf.viz.sounding.AbstractVerticalSoundingAdapter#createSoundings
|
||||
* ()
|
||||
*/
|
||||
@Override
|
||||
public VerticalSounding[] createSoundings() {
|
||||
ArrayList<VerticalSounding> soundings = new ArrayList<VerticalSounding>();
|
||||
for (PluginDataObject obj : objects) {
|
||||
ProfilerObs obs = (ProfilerObs) obj;
|
||||
VerticalSounding sounding = createVerticalSounding(obs);
|
||||
if (sounding != null) {
|
||||
soundings.add(sounding);
|
||||
}
|
||||
}
|
||||
return soundings.toArray(new VerticalSounding[soundings.size()]);
|
||||
}
|
||||
|
||||
private VerticalSounding createVerticalSounding(ProfilerObs record) {
|
||||
VerticalSounding sounding = null;
|
||||
|
||||
String[] requiredParameters = new String[] { "P", "height",
|
||||
"uComponent", "vComponent" };
|
||||
|
||||
if (record != null) {
|
||||
|
||||
Map<String, Number[]> numbers = getParameterNumberMap(
|
||||
requiredParameters, record);
|
||||
if (numbers == null) {
|
||||
return sounding;
|
||||
}
|
||||
|
||||
if (numbers.get("P") != null) {
|
||||
sounding = new VerticalSounding();
|
||||
SurfaceObsLocation location = record.getLocation();
|
||||
sounding.setSpatialInfo(location);
|
||||
|
||||
sounding.setElevation(record.getElevation());
|
||||
sounding.setStationId(record.getStationId());
|
||||
sounding
|
||||
.setObsTime(record.getDataTime().getRefTimeAsCalendar());
|
||||
sounding.setDataTime(record.getDataTime());
|
||||
|
||||
sounding.setName(String.format("Profiler %.1f%c %.1f%c %s",
|
||||
Math.abs(location.getLatitude()), (location
|
||||
.getLatitude() >= 0 ? 'N' : 'S'), Math
|
||||
.abs(location.getLongitude()), (location
|
||||
.getLongitude() >= 0 ? 'E' : 'W'), record
|
||||
.getStationId()));
|
||||
|
||||
for (int i = 0; i < numbers.get("P").length; i++) {
|
||||
Number level = numbers.get("P")[i];
|
||||
if (level != null && level.intValue() != -9999) {
|
||||
SoundingLayer layer = new SoundingLayer();
|
||||
|
||||
layer.setGeoHeight(getSoundingLayerValue(numbers
|
||||
.get("height")[i]));
|
||||
layer.setWindU(getSoundingLayerValue(numbers
|
||||
.get("uComponent")[i]));
|
||||
layer.setWindV(getSoundingLayerValue(numbers
|
||||
.get("vComponent")[i]));
|
||||
layer.setPressure(getSoundingLayerValue(numbers
|
||||
.get("P")[i]));
|
||||
|
||||
sounding.addLayer(layer);
|
||||
}
|
||||
} // for
|
||||
}
|
||||
}
|
||||
return sounding;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param h
|
||||
* @return
|
||||
*/
|
||||
private float getSoundingLayerValue(Number number) {
|
||||
float value = number.floatValue();
|
||||
return (value != -9999) ? value : SoundingLayer.MISSING;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param requiredParameters2
|
||||
* @return
|
||||
*/
|
||||
private Map<String, Number[]> getParameterNumberMap(
|
||||
String[] requiredParameters, ProfilerObs record) {
|
||||
|
||||
Map<String, RequestConstraint> rcMap = new HashMap<String, RequestConstraint>();
|
||||
rcMap.put("dataURI", new RequestConstraint("" + record.getDataURI()));
|
||||
PointDataContainer container;
|
||||
try {
|
||||
container = DataCubeContainer.getPointData(record.getPluginName(),
|
||||
requiredParameters, rcMap);
|
||||
} catch (VizException e1) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Error retrieving sounding", e1);
|
||||
return null;
|
||||
}
|
||||
|
||||
if (container == null || container.getAllocatedSz() == 0) {
|
||||
return null;
|
||||
}
|
||||
PointDataView pdv = container.readRandom(0);
|
||||
|
||||
Map<String, Number[]> parameterNumberMap = new HashMap<String, Number[]>();
|
||||
|
||||
for (String parameter : requiredParameters) {
|
||||
parameterNumberMap
|
||||
.put(parameter, pdv.getNumberAllLevels(parameter));
|
||||
}
|
||||
|
||||
return parameterNumberMap;
|
||||
}
|
||||
}
|
|
@ -1,147 +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.adapters;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
||||
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
|
||||
import com.raytheon.uf.common.pointdata.PointDataContainer;
|
||||
import com.raytheon.uf.common.pointdata.PointDataView;
|
||||
import com.raytheon.uf.common.pointdata.spatial.SurfaceObsLocation;
|
||||
import com.raytheon.uf.common.sounding.SoundingLayer;
|
||||
import com.raytheon.uf.common.sounding.VerticalSounding;
|
||||
import com.raytheon.uf.common.sounding.adapter.AbstractVerticalSoundingAdapter;
|
||||
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.datastructure.DataCubeContainer;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.status.StatusConstants;
|
||||
import com.raytheon.uf.viz.sounding.Activator;
|
||||
|
||||
/**
|
||||
*
|
||||
* TODO Add Description
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Descriptio
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jan 4, 2010 bsteffen Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author bsteffen
|
||||
* @version 1.0
|
||||
*/
|
||||
public class VwpSoundingAdapter extends AbstractVerticalSoundingAdapter {
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus.getHandler(VwpSoundingAdapter.class);
|
||||
|
||||
private static final String[] requiredParameters = new String[] { "P",
|
||||
"uW", "vW", "GH", "latitude", "longitude", "stationId" };
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.uf.viz.sounding.AbstractVerticalSoundingAdapter#createSoundings
|
||||
* ()
|
||||
*/
|
||||
@Override
|
||||
public VerticalSounding[] createSoundings() {
|
||||
ArrayList<VerticalSounding> soundings = new ArrayList<VerticalSounding>();
|
||||
for (PluginDataObject obj : objects) {
|
||||
VerticalSounding sounding = createVerticalSounding(obj);
|
||||
if (sounding != null && sounding.size() >= 5) {
|
||||
soundings.add(sounding);
|
||||
}
|
||||
}
|
||||
return soundings.toArray(new VerticalSounding[soundings.size()]);
|
||||
}
|
||||
|
||||
private VerticalSounding createVerticalSounding(PluginDataObject pdo) {
|
||||
VerticalSounding sounding = null;
|
||||
|
||||
if (pdo != null) {
|
||||
Map<String, RequestConstraint> rcMap = new HashMap<String, RequestConstraint>();
|
||||
rcMap.put("dataURI", new RequestConstraint("" + pdo.getDataURI()));
|
||||
PointDataContainer container;
|
||||
try {
|
||||
container = DataCubeContainer.getPointData(pdo.getPluginName(),
|
||||
requiredParameters, rcMap);
|
||||
} catch (VizException e1) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Error retrieving sounding", e1);
|
||||
return sounding;
|
||||
}
|
||||
|
||||
if (container == null || container.getAllocatedSz() == 0) {
|
||||
return sounding;
|
||||
}
|
||||
PointDataView pdv = container.readRandom(0);
|
||||
|
||||
Number[] p = pdv.getNumberAllLevels("P");
|
||||
Number[] uWind = pdv.getNumberAllLevels("uW");
|
||||
Number[] vWind = pdv.getNumberAllLevels("vW");
|
||||
Number[] gh = pdv.getNumberAllLevels("GH");
|
||||
Number lat = pdv.getNumber("latitude");
|
||||
Number lon = pdv.getNumber("longitude");
|
||||
String stationId = pdv.getString("stationId");
|
||||
if (p != null && p.length != 0) {
|
||||
sounding = new VerticalSounding();
|
||||
sounding.setName("VWP " + stationId.toUpperCase());
|
||||
sounding.setObsTime(pdo.getDataTime().getRefTimeAsCalendar());
|
||||
sounding.setDataTime(pdo.getDataTime());
|
||||
SurfaceObsLocation obs = new SurfaceObsLocation(stationId);
|
||||
obs.setLatitude(lat.doubleValue());
|
||||
obs.setLongitude(lon.doubleValue());
|
||||
sounding.setSpatialInfo(obs);
|
||||
for (int i = 0; i < p.length; i++) {
|
||||
Number level = p[i];
|
||||
if (level != null && level.intValue() != -9999) {
|
||||
SoundingLayer layer = new SoundingLayer();
|
||||
Float g = gh[i].floatValue();
|
||||
layer.setGeoHeight((g != -9999) ? g * 30.48f
|
||||
: SoundingLayer.MISSING);
|
||||
layer.setPressure((level.floatValue() != -9999) ? level
|
||||
.floatValue() : SoundingLayer.MISSING);
|
||||
Float s = uWind[i].floatValue();
|
||||
layer
|
||||
.setWindU((s != -9999) ? s
|
||||
: SoundingLayer.MISSING);
|
||||
|
||||
Float w = vWind[i].floatValue();
|
||||
layer
|
||||
.setWindV((w != -9999) ? w
|
||||
: SoundingLayer.MISSING);
|
||||
// layer.setDewpoint(0);
|
||||
// layer.setTemperature(0);
|
||||
sounding.addLayer(layer);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return sounding;
|
||||
}
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
|
@ -1,28 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>com.raytheon.viz.skewt</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.ManifestBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.SchemaBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.pde.PluginNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
|
@ -1,7 +0,0 @@
|
|||
#Thu Mar 26 10:53:12 CDT 2009
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
|
||||
org.eclipse.jdt.core.compiler.compliance=1.6
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.source=1.6
|
|
@ -1,32 +0,0 @@
|
|||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: SkewT Plug-in
|
||||
Bundle-SymbolicName: com.raytheon.viz.skewt;singleton:=true
|
||||
Bundle-Version: 1.12.1174.qualifier
|
||||
Bundle-Activator: com.raytheon.viz.skewt.Activator
|
||||
Bundle-Vendor: Raytheon
|
||||
Eclipse-RegisterBuddy: com.raytheon.uf.common.serialization
|
||||
Require-Bundle: org.eclipse.ui,
|
||||
org.eclipse.core.runtime,
|
||||
com.raytheon.uf.common.geospatial;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.serialization;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.dataplugin;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.status;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.localization;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.viz.core;bundle-version="1.12.1174",
|
||||
com.raytheon.viz.ui;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.viz.sounding;bundle-version="1.12.1174",
|
||||
com.raytheon.viz.core.graphing;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.viz.d2d.core;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.viz.xy;bundle-version="1.12.1174",
|
||||
com.raytheon.edex.meteolib;bundle-version="1.12.1174",
|
||||
javax.measure;bundle-version="1.0.0"
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Export-Package: com.raytheon.viz.skewt,
|
||||
com.raytheon.viz.skewt.mockdata,
|
||||
com.raytheon.viz.skewt.mouse,
|
||||
com.raytheon.viz.skewt.rsc,
|
||||
com.raytheon.viz.skewt.rscdata,
|
||||
com.raytheon.viz.skewt.ui
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Import-Package: com.raytheon.viz.core
|
|
@ -1,5 +0,0 @@
|
|||
com.raytheon.viz.skewt.rscdata.SkewTResourceData
|
||||
com.raytheon.viz.skewt.rscdata.SkewTBkgResourceData
|
||||
com.raytheon.viz.skewt.rscdata.GribSoundingSkewTResourceData
|
||||
com.raytheon.viz.skewt.SkewTDescriptor
|
||||
com.raytheon.viz.skewt.SkewtDisplay
|
|
@ -1,7 +0,0 @@
|
|||
source.. = src/
|
||||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
.,\
|
||||
plugin.xml,\
|
||||
icons/,\
|
||||
config.xml
|
|
@ -1,33 +0,0 @@
|
|||
<?xml version="1.0" encoding="IsO-8859-1" standalone="no"?>
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
<configuration>
|
||||
<windRange>
|
||||
<umin>-50.0</umin>
|
||||
<umax>90.0</umax>
|
||||
<vmin>-60.0</vmin>
|
||||
<vmax>60.0</vmax>
|
||||
</windRange>
|
||||
<tempChange>
|
||||
<deltaT>15.0</deltaT>
|
||||
<pmin>300.0</pmin>
|
||||
<pmax>1050.0</pmax>
|
||||
</tempChange>
|
||||
</configuration>
|
Binary file not shown.
Before Width: | Height: | Size: 137 B |
|
@ -1,53 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
<?eclipse version="3.2"?>
|
||||
<plugin>
|
||||
<extension
|
||||
point="com.raytheon.uf.viz.core.resource">
|
||||
<resource
|
||||
class="com.raytheon.viz.skewt.rsc.SkewTResource"
|
||||
name="SkewT Data"
|
||||
renderingOrderId="PLOT"
|
||||
resourceType="SOUNDING"/>
|
||||
<resource
|
||||
class="com.raytheon.viz.skewt.rsc.SkewTBackgroundResource"
|
||||
name="SkewT Background"
|
||||
renderingOrderId="MAP_OUTLINE" />
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.ui.editors">
|
||||
<editor
|
||||
class="com.raytheon.viz.skewt.SkewTEditor"
|
||||
default="true"
|
||||
icon="icons/skewt.gif"
|
||||
id="com.raytheon.viz.skewt.SkewTEditor"
|
||||
name="Skewt">
|
||||
</editor>
|
||||
</extension>
|
||||
<extension
|
||||
point="com.raytheon.uf.viz.core.descriptor">
|
||||
<descriptor
|
||||
class="com.raytheon.viz.skewt.SkewTDescriptor"
|
||||
editor="com.raytheon.viz.skewt.SkewTEditor"
|
||||
name="com.raytheon.viz.skewt.SkewTDescriptor">
|
||||
</descriptor>
|
||||
</extension>
|
||||
</plugin>
|
|
@ -1,105 +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.viz.skewt;
|
||||
|
||||
import org.eclipse.ui.plugin.AbstractUIPlugin;
|
||||
import org.osgi.framework.BundleContext;
|
||||
|
||||
import com.raytheon.uf.common.localization.exception.LocalizationException;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
import com.raytheon.uf.viz.core.localization.HierarchicalPreferenceStore;
|
||||
|
||||
/**
|
||||
* The activator class controls the plug-in life cycle
|
||||
*/
|
||||
public class Activator extends AbstractUIPlugin {
|
||||
|
||||
// The plug-in ID
|
||||
public static final String PLUGIN_ID = "com.raytheon.viz.skewt";
|
||||
|
||||
// The shared instance
|
||||
private static Activator plugin;
|
||||
|
||||
private HierarchicalPreferenceStore prefs;
|
||||
|
||||
/**
|
||||
* The constructor
|
||||
*/
|
||||
public Activator() {
|
||||
plugin = this;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext
|
||||
* )
|
||||
*/
|
||||
@Override
|
||||
public void start(BundleContext context) throws Exception {
|
||||
super.start(context);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext
|
||||
* )
|
||||
*/
|
||||
@Override
|
||||
public void stop(BundleContext context) throws Exception {
|
||||
plugin = null;
|
||||
super.stop(context);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the shared instance
|
||||
*
|
||||
* @return the shared instance
|
||||
*/
|
||||
public static Activator getDefault() {
|
||||
return plugin;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.ui.plugin.AbstractUIPlugin#getPreferenceStore()
|
||||
*/
|
||||
@Override
|
||||
public HierarchicalPreferenceStore getPreferenceStore() {
|
||||
try {
|
||||
if (prefs == null) {
|
||||
prefs = new HierarchicalPreferenceStore(this);
|
||||
}
|
||||
} catch (LocalizationException e) {
|
||||
UFStatus.getHandler().handle(
|
||||
Priority.PROBLEM,
|
||||
"Error reading preference store: "
|
||||
+ e.getLocalizedMessage(), e);
|
||||
}
|
||||
|
||||
return prefs;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,58 +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.viz.skewt;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
import com.raytheon.uf.viz.core.PixelExtent;
|
||||
import com.raytheon.uf.viz.d2d.core.time.D2DTimeMatcher;
|
||||
import com.raytheon.viz.core.graphing.GraphDescriptor;
|
||||
import com.raytheon.viz.skewt.ui.SkewTConstants;
|
||||
|
||||
/**
|
||||
* Descriptor for SkewTs
|
||||
*
|
||||
* <pre>
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Dec 19, 2007 njensen Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author njensen
|
||||
* @version 1.0
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
@XmlType(name = "skewTDescriptor")
|
||||
public class SkewTDescriptor extends GraphDescriptor {
|
||||
|
||||
public SkewTDescriptor() {
|
||||
this(new PixelExtent(SkewTConstants.skewTRectangle));
|
||||
}
|
||||
|
||||
public SkewTDescriptor(PixelExtent pe) {
|
||||
super(pe);
|
||||
setTimeMatcher(new D2DTimeMatcher());
|
||||
}
|
||||
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,371 +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.viz.skewt;
|
||||
|
||||
/**
|
||||
* SkewTGraph plot the skewt temperature, dewpoint in addition to all background
|
||||
* lines and wind data.
|
||||
*
|
||||
* Used extensive work from SkewTGraph and associated codebase.
|
||||
*
|
||||
* <pre>
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 15 Nov 2007 #371 ebabin Initial Coding
|
||||
* 27 Nov 2007 #371 ebabin Updates from initial code.
|
||||
* 04Jan2007 #670 ebabin Updated to include sounding location on inset map.
|
||||
* 07Jan2007 #673 ebabin Fix moving of hodograph points.
|
||||
* 09Jan2007 #672 ebabin Fix for w parameter on sampling.
|
||||
* 09Jan2007 #729 ebabin Update for CAVE crashing on SkewT zoom.
|
||||
* 14Jan2007 #682 ebabin Update for sampling bug.
|
||||
* 15Jan2008 682 ebabin Updated to remove non calculated parameters.
|
||||
* 16Jan2008 682 ebabin Updates for grib model traps on multiple loads.
|
||||
* 28sep2008 #1529 dhladky redone.
|
||||
* 12May2010 #1952 snaples Cleaned up again after refactor.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author ebabin
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlAttribute;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
import org.eclipse.swt.layout.FormAttachment;
|
||||
import org.eclipse.swt.layout.FormData;
|
||||
import org.eclipse.ui.IWorkbenchPage;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
|
||||
import com.raytheon.uf.common.serialization.ISerializableObject;
|
||||
import com.raytheon.uf.viz.core.IGraphicsTarget;
|
||||
import com.raytheon.uf.viz.core.PixelExtent;
|
||||
import com.raytheon.uf.viz.core.VizConstants;
|
||||
import com.raytheon.uf.viz.core.datastructure.LoopProperties;
|
||||
import com.raytheon.uf.viz.core.drawables.AbstractRenderableDisplay;
|
||||
import com.raytheon.uf.viz.core.drawables.IDescriptor;
|
||||
import com.raytheon.uf.viz.core.drawables.PaintProperties;
|
||||
import com.raytheon.uf.viz.core.drawables.ResourcePair;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.globals.VizGlobalsManager;
|
||||
import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
|
||||
import com.raytheon.uf.viz.core.rsc.IResourceGroup;
|
||||
import com.raytheon.uf.viz.core.rsc.LoadProperties;
|
||||
import com.raytheon.uf.viz.core.rsc.ResourceList;
|
||||
import com.raytheon.uf.viz.core.rsc.ResourceProperties;
|
||||
import com.raytheon.uf.viz.core.rsc.capabilities.ColorableCapability;
|
||||
import com.raytheon.uf.viz.core.rsc.capabilities.DensityCapability;
|
||||
import com.raytheon.uf.viz.core.rsc.capabilities.MagnificationCapability;
|
||||
import com.raytheon.uf.viz.d2d.core.ID2DRenderableDisplay;
|
||||
import com.raytheon.uf.viz.d2d.core.time.D2DTimeMatcher;
|
||||
import com.raytheon.uf.viz.xy.map.IInsetMapContainer;
|
||||
import com.raytheon.viz.core.graphing.WGraphics;
|
||||
import com.raytheon.viz.skewt.rsc.SkewTBackgroundResource;
|
||||
import com.raytheon.viz.skewt.rsc.SkewTResource;
|
||||
import com.raytheon.viz.skewt.rscdata.SkewTBkgResourceData;
|
||||
import com.raytheon.viz.skewt.ui.HodoBackground;
|
||||
import com.raytheon.viz.skewt.ui.SkewTConstants;
|
||||
import com.raytheon.viz.skewt.ui.SkewtBackground;
|
||||
import com.raytheon.viz.skewt.ui.TempChangeBackground;
|
||||
import com.raytheon.viz.ui.EditorUtil;
|
||||
import com.vividsolutions.jts.geom.GeometryFactory;
|
||||
|
||||
@XmlRootElement
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
public class SkewtDisplay extends AbstractRenderableDisplay implements
|
||||
ID2DRenderableDisplay, IInsetMapContainer, ISerializableObject {
|
||||
|
||||
/** The magnification */
|
||||
@XmlAttribute
|
||||
protected double magnification = ((Double) VizGlobalsManager
|
||||
.getCurrentInstance().getPropery(VizConstants.MAGNIFICATION_ID))
|
||||
.doubleValue();
|
||||
|
||||
/** The density */
|
||||
@XmlAttribute
|
||||
protected double density = ((Double) VizGlobalsManager.getCurrentInstance()
|
||||
.getPropery(VizConstants.DENSITY_ID)).doubleValue();
|
||||
|
||||
/** The current display scale */
|
||||
@XmlAttribute
|
||||
protected String scale = (String) VizGlobalsManager.getCurrentInstance()
|
||||
.getPropery(VizConstants.SCALE_ID);
|
||||
|
||||
private static GeometryFactory gf = new GeometryFactory();
|
||||
|
||||
private PaintProperties paintProps = null;
|
||||
|
||||
private IGraphicsTarget target = null;
|
||||
|
||||
private SkewTBackgroundResource bkgRsc;
|
||||
|
||||
private AbstractVizResource<?, ?> rsc;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public SkewtDisplay() {
|
||||
this(new PixelExtent(SkewTConstants.skewTRectangle));
|
||||
}
|
||||
|
||||
private SkewtDisplay(PixelExtent pixelExtent) {
|
||||
super(pixelExtent, new SkewTDescriptor(pixelExtent));
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.viz.core.drawables.AbstractRenderableDisplay#setDescriptor
|
||||
* (com.raytheon.uf.viz.core.drawables.IDescriptor)
|
||||
*/
|
||||
@Override
|
||||
public void setDescriptor(IDescriptor desc) {
|
||||
super.setDescriptor(desc);
|
||||
|
||||
if (!(desc.getTimeMatcher() instanceof D2DTimeMatcher)) {
|
||||
desc.setTimeMatcher(new D2DTimeMatcher());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paint(IGraphicsTarget target, PaintProperties paintProps)
|
||||
throws VizException {
|
||||
super.paint(target, paintProps);
|
||||
|
||||
this.target = target;
|
||||
this.paintProps = paintProps;
|
||||
|
||||
// If no loop properties, use the default values
|
||||
LoopProperties loopProperties = paintProps.getLoopProperties();
|
||||
if (loopProperties == null) {
|
||||
loopProperties = new LoopProperties();
|
||||
}
|
||||
|
||||
drawTheData(target, paintProps);
|
||||
}
|
||||
|
||||
/**
|
||||
* Draws the data on the screen.
|
||||
*
|
||||
* @throws VizException
|
||||
*/
|
||||
protected void drawTheData(IGraphicsTarget target,
|
||||
PaintProperties paintProps) throws VizException {
|
||||
ArrayList<ResourcePair> resourceList = new ArrayList<ResourcePair>(
|
||||
descriptor.getResourceList());
|
||||
PaintProperties myProps = new PaintProperties(paintProps);
|
||||
|
||||
for (ResourcePair pair : resourceList) {
|
||||
if (pair.getProperties().isVisible()) {
|
||||
rsc = pair.getResource();
|
||||
if (rsc != null) {
|
||||
myProps = calcPaintDataTime(myProps, rsc);
|
||||
|
||||
if (rsc instanceof SkewTResource) {
|
||||
((SkewTResource) rsc).setDisplay(this);
|
||||
}
|
||||
rsc.paint(target, myProps);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the rsc
|
||||
*/
|
||||
public AbstractVizResource<?, ?> getRsc() {
|
||||
return rsc;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.viz.skewt.AbstractSkewTDisplay#getHodoWorld()
|
||||
*/
|
||||
public WGraphics getHodoWorld() {
|
||||
return getHodoBackground().getWorld();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.viz.skewt.AbstractSkewTDisplay#getSkewTWorld()
|
||||
*/
|
||||
public WGraphics getSkewTWorld() {
|
||||
return getSkewTBackground().getWorld();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.viz.skewt.AbstractSkewTDisplay#getTempChangeWorld()
|
||||
*/
|
||||
public WGraphics getTempChangeWorld() {
|
||||
return getTempChangeBackground().getWorld();
|
||||
}
|
||||
|
||||
public GeometryFactory getGeometry() {
|
||||
return gf;
|
||||
}
|
||||
|
||||
public IGraphicsTarget getTarget() {
|
||||
return target;
|
||||
}
|
||||
|
||||
public PaintProperties getPaintProperties() {
|
||||
return paintProps;
|
||||
}
|
||||
|
||||
public SkewtBackground getSkewTBackground() {
|
||||
return bkgRsc.getSkewTBackground();
|
||||
}
|
||||
|
||||
public HodoBackground getHodoBackground() {
|
||||
return bkgRsc.getHodoBackground();
|
||||
}
|
||||
|
||||
public TempChangeBackground getTempChangeBackground() {
|
||||
return bkgRsc.getTempChangeBackground();
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getDensity() {
|
||||
return density;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMagnification() {
|
||||
return magnification;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getScale() {
|
||||
return scale;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDensity(double density) {
|
||||
target.setNeedsRefresh(true);
|
||||
this.density = density;
|
||||
List<ResourcePair> rps = new ArrayList<ResourcePair>(
|
||||
descriptor.getResourceList());
|
||||
for (int i = 0; i < rps.size(); i++) {
|
||||
AbstractVizResource<?, ?> resource = rps.get(i).getResource();
|
||||
if (resource != null) {
|
||||
if (resource instanceof IResourceGroup) {
|
||||
rps.addAll(((IResourceGroup) resource).getResourceList());
|
||||
}
|
||||
if (resource.hasCapability(DensityCapability.class)) {
|
||||
resource.getCapability(DensityCapability.class).setDensity(
|
||||
density);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMagnification(double magnification) {
|
||||
target.setNeedsRefresh(true);
|
||||
this.magnification = magnification;
|
||||
List<ResourcePair> rps = new ArrayList<ResourcePair>(
|
||||
descriptor.getResourceList());
|
||||
for (int i = 0; i < rps.size(); i++) {
|
||||
AbstractVizResource<?, ?> resource = rps.get(i).getResource();
|
||||
if (resource != null) {
|
||||
if (resource instanceof IResourceGroup) {
|
||||
rps.addAll(((IResourceGroup) resource).getResourceList());
|
||||
}
|
||||
if (resource.hasCapability(MagnificationCapability.class)) {
|
||||
resource.getCapability(MagnificationCapability.class)
|
||||
.setMagnification(magnification);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setScale(String scale) {
|
||||
this.scale = scale;
|
||||
}
|
||||
|
||||
public SkewTEditor getEditor() {
|
||||
try {
|
||||
return (SkewTEditor) EditorUtil.getActiveEditor();
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
super.clear();
|
||||
IWorkbenchPage page = PlatformUI.getWorkbench()
|
||||
.getActiveWorkbenchWindow().getActivePage();
|
||||
page.closeEditor(getEditor(), false);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.uf.viz.xy.map.IInsetMapContainer#getInsetMapLocation()
|
||||
*/
|
||||
@Override
|
||||
public FormData getInsetMapLocation() {
|
||||
FormData fd = new FormData();
|
||||
fd.right = new FormAttachment(15, 0);
|
||||
fd.left = new FormAttachment(0, 0);
|
||||
fd.top = new FormAttachment(0, 0);
|
||||
fd.bottom = new FormAttachment(10, 0);
|
||||
return fd;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void customizeResourceList(ResourceList resourceList) {
|
||||
resourceList.add(ResourcePair
|
||||
.constructSystemResourcePair(legendRscData));
|
||||
resourceList.add(ResourcePair
|
||||
.constructSystemResourcePair(samplingRscData));
|
||||
|
||||
LoadProperties loadProperties = new LoadProperties();
|
||||
ColorableCapability colorable = new ColorableCapability();
|
||||
colorable.setColor(SkewTConstants.backgroundColor);
|
||||
loadProperties.getCapabilities().addCapability(colorable);
|
||||
bkgRsc = new SkewTBackgroundResource(new SkewTBkgResourceData(),
|
||||
loadProperties);
|
||||
ResourceProperties props = new ResourceProperties();
|
||||
props.setVisible(true);
|
||||
props.setMapLayer(true);
|
||||
ResourcePair rp = new ResourcePair();
|
||||
rp.setResource(bkgRsc);
|
||||
rp.setProperties(props);
|
||||
rp.setLoadProperties(bkgRsc.getLoadProperties());
|
||||
resourceList.add(rp);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,230 +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.viz.skewt.mockdata;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.raytheon.uf.common.sounding.VerticalSounding;
|
||||
|
||||
/**
|
||||
* This class implements an Upper Air sounding repository for test and demo
|
||||
* purposes. Current data includes soundings for Valley, Nebraska and Jackson,
|
||||
* Mississippi for Sept. 22, 2006 at 12Z.
|
||||
*
|
||||
* <pre>
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 06 Nov 2006 jkorman Initial Coding
|
||||
* </pre>
|
||||
*
|
||||
* @author jkorman
|
||||
* @version 1.0
|
||||
*/
|
||||
public class UpperAirRepository {
|
||||
// private static final int SFC = LayerType.SURFACE.ordinal();
|
||||
|
||||
// private static final int MANP = LayerType.MAN_PRESSURE.ordinal();
|
||||
|
||||
// private static final int SIGP = LayerType.SIG_PRESSURE.ordinal();
|
||||
|
||||
// private static final int SIGW = LayerType.SIG_WIND.ordinal();
|
||||
|
||||
// private static final int TROP = LayerType.TROPOPAUSE.ordinal();
|
||||
|
||||
// private static final int MAXW = LayerType.MAX_WIND.ordinal();
|
||||
|
||||
public static final double INVALID = -9999;
|
||||
|
||||
public static final double MISSING = -9998;
|
||||
|
||||
// No reported value for this type of layer
|
||||
public static final double NREPORT = -9997;
|
||||
|
||||
public static final double FENCE = -9900;
|
||||
|
||||
/**
|
||||
* Source data for KJAN, 72235 20060922:12Z
|
||||
*
|
||||
* Currently the pilot data is not part of the sounding.
|
||||
*
|
||||
* USUS44 KJAN 221223 MANJAN 72235 TTAA 72121 72235 99000 24416 18006 00089
|
||||
* ///// ///// 92772 21205 20540 85503 17218 22044 70136 09040 23538 50584
|
||||
* 07191 24532 40754 183// 25532 30962 35377 25047 25086 43772 24560 20232
|
||||
* 54767 24069 15412 65563 25567 10653 71161 24543 88125 71361 25061 77182
|
||||
* 25075 41112 51515 10164 00051 10194 20036 22041=
|
||||
*
|
||||
* UMUS44 KJAN 221226 SGLJAN 72235 TTBB 72120 72235 00000 24416 11985 23605
|
||||
* 22889 20018 33779 13049 44764 12864 55739 10660 66734 10222 77725 09213
|
||||
* 88716 09656 99706 09024 11689 08858 22663 06658 33652 06069 44643 05461
|
||||
* 55618 02656 66589 00260 77585 00156 88582 00360 99579 00556 11569 01756
|
||||
* 22550 03158 33528 04590 44500 07191 55397 18787 66324 31579 77230 48969
|
||||
* 88120 71561 99100 71161 31313 05102 81103 41414 66400=
|
||||
*
|
||||
* PPBB 72120 72235 90012 18006 19033 20037 90346 21042 21544 22042 90789
|
||||
* 22042 22042 22539 91124 24036 24031 23532 916// 23038 9205/ 24535 25532
|
||||
* 93035 25031 25053 24559 9425/ 24574 25569 9504/ 25061 25046=
|
||||
*
|
||||
*/
|
||||
// private static final String icaoKJAN = "KJAN";
|
||||
// private static final String bsnKJAN = "72235";
|
||||
// private static double[][] dataKJAN = {
|
||||
// { SFC, 1000, 101, 244, 16, 180, 06, },
|
||||
// { SIGP, 985, NREPORT, 236, 5, NREPORT, NREPORT, },
|
||||
// { MANP, 925, 772, 212, 5, 205, 40, },
|
||||
// { SIGP, 889, NREPORT, 200, 18, NREPORT, NREPORT, },
|
||||
// { MANP, 850, 1503, 172, 18, 220, 44, },
|
||||
// { SIGP, 779, NREPORT, 130, 49, NREPORT, NREPORT, },
|
||||
// { SIGP, 764, NREPORT, 128, 64, NREPORT, NREPORT, },
|
||||
// { SIGP, 739, NREPORT, 106, 60, NREPORT, NREPORT, },
|
||||
// { SIGP, 734, NREPORT, 102, 22, NREPORT, NREPORT, },
|
||||
// { SIGP, 725, NREPORT, 92, 13, NREPORT, NREPORT, },
|
||||
// { SIGP, 716, NREPORT, 96, 56, NREPORT, NREPORT, },
|
||||
// { SIGP, 706, NREPORT, 90, 24, NREPORT, NREPORT, },
|
||||
// { MANP, 700, 3136, 90, 40, 235, 38, },
|
||||
// { SIGP, 689, NREPORT, 88, 58, NREPORT, NREPORT, },
|
||||
// { SIGP, 663, NREPORT, 66, 58, NREPORT, NREPORT, },
|
||||
// { SIGP, 652, NREPORT, 60, 69, NREPORT, NREPORT, },
|
||||
// { SIGP, 643, NREPORT, 54, 61, NREPORT, NREPORT, },
|
||||
// { SIGP, 618, NREPORT, 26, 56, NREPORT, NREPORT, },
|
||||
// { SIGP, 589, NREPORT, 2, 60, NREPORT, NREPORT, },
|
||||
// { SIGP, 585, NREPORT, -1, 56, NREPORT, NREPORT, },
|
||||
// { SIGP, 582, NREPORT, -3, 60, NREPORT, NREPORT, },
|
||||
// { SIGP, 579, NREPORT, -5, 56, NREPORT, NREPORT, },
|
||||
// { SIGP, 569, NREPORT, -17, 56, NREPORT, NREPORT, },
|
||||
// { SIGP, 550, NREPORT, -31, 58, NREPORT, NREPORT, },
|
||||
// { SIGP, 528, NREPORT, -45, 90, NREPORT, NREPORT, },
|
||||
// { MANP, 500, 5840, -71, 91, 245, 32, },
|
||||
// { MANP, 400, 7540, -183, MISSING, 255, 32, },
|
||||
// { SIGP, 397, NREPORT, -187, 87, NREPORT, NREPORT, },
|
||||
// { SIGP, 324, NREPORT, -315, 79, NREPORT, NREPORT, },
|
||||
// { MANP, 300, 9620, -353, 77, 250, 47, },
|
||||
// { MANP, 250, 10860, -437, 72, 245, 60, },
|
||||
// { SIGP, 230, NREPORT, -489, 69, NREPORT, NREPORT, },
|
||||
// { MANP, 200, 12320, -547, 67, 240, 69, },
|
||||
// { MANP, 150, 14120, -655, 63, 255, 67, },
|
||||
// { TROP, 125, NREPORT, -713, 61, 250, 61, },
|
||||
// { SIGP, 120, NREPORT, -715, 61, NREPORT, NREPORT, },
|
||||
// { MANP, 100, 16530, -711, 61, 245, 43, } };
|
||||
/**
|
||||
* Source data for KOAX, 72558 20060922:12Z
|
||||
*
|
||||
* Currently the pilot data is not part of the sounding.
|
||||
*
|
||||
* USUS43 KOAX 221214 MANOAX 72558 TTAA 72121 72558 99951 14016 22512 00578
|
||||
* ///// ///// 92583 12412 23524 85288 08610 26028 70874 00208 25031 50551
|
||||
* 14557 24545 40716 27158 23537 30917 43141 21526 25037 53128 22522 20183
|
||||
* 48972 24043 15371 50176 23538 10633 53775 23025 88245 54128 23026 77999
|
||||
* 51515 10164 00004 10194 25026 25027=
|
||||
*
|
||||
* UMUS43 KOAX 221215 SGLOAX 72558 TTBB 72120 72558 00951 14016 11850 08610
|
||||
* 22792 06434 33676 01903 44670 00915 55612 03925 66597 04156 77512 13924
|
||||
* 88508 14156 99474 17159 11458 19350 22441 21356 33354 33962 44343 35556
|
||||
* 55319 39958 66281 46518 77245 54128 88228 48160 99209 49569 11172 50376
|
||||
* 22122 51175 33110 55974 44100 53775 31313 45202 81107 41414 855//=
|
||||
*
|
||||
* PPBB 72120 72558 90023 22512 24530 25530 90467 26028 25023 24525 9089/
|
||||
* 24527 25029 91246 25538 25045 24543 92056 23544 23534 23533 93013 21526
|
||||
* 21525 22018 9357/ 23032 23042 9402/ 24538 23039 9503/ 23025 22523=
|
||||
*/
|
||||
// private static final String icaoKOAX = "KOAX";
|
||||
// private static final String bsnKOAX = "72558";
|
||||
// private static double[][] dataKOAX = {
|
||||
// { SFC, 951, 350, 140, 16, 225, 12, },
|
||||
// { MANP, 1000, 578, MISSING, MISSING, MISSING, MISSING, },
|
||||
// { SIGP, 951, NREPORT, 140, 16, NREPORT, NREPORT, },
|
||||
// { MANP, 925, 583, 124, 12, 235, 24, },
|
||||
// { MANP, 850, 1288, 86, 10, 260, 28, },
|
||||
// { SIGP, 792, NREPORT, 64, 34, NREPORT, NREPORT, },
|
||||
// { MANP, 700, 2874, 2, 8, 250, 31, },
|
||||
// { SIGP, 676, NREPORT, -19, 3, NREPORT, NREPORT, },
|
||||
// { SIGP, 670, NREPORT, -9, 15, NREPORT, NREPORT, },
|
||||
// { SIGP, 612, NREPORT, -39, 25, NREPORT, NREPORT, },
|
||||
// { SIGP, 597, NREPORT, -41, 56, NREPORT, NREPORT, },
|
||||
// { SIGP, 512, NREPORT, -139, 24, NREPORT, NREPORT, },
|
||||
// { SIGP, 508, NREPORT, -141, 56, NREPORT, NREPORT, },
|
||||
// { MANP, 500, 5510, -145, 57, 245, 45, },
|
||||
// { SIGP, 474, NREPORT, -171, 59, NREPORT, NREPORT, },
|
||||
// { SIGP, 458, NREPORT, -193, 50, NREPORT, NREPORT, },
|
||||
// { SIGP, 441, NREPORT, -213, 56, NREPORT, NREPORT, },
|
||||
// { MANP, 400, 7160, -271, 58, 235, 37, },
|
||||
// { SIGP, 354, NREPORT, -339, 62, NREPORT, NREPORT, },
|
||||
// { SIGP, 343, NREPORT, -355, 56, NREPORT, NREPORT, },
|
||||
// { SIGP, 319, NREPORT, -399, 58, NREPORT, NREPORT, },
|
||||
// { MANP, 300, 9170, -431, 41, 215, 26, },
|
||||
// { SIGP, 281, NREPORT, -465, 18, NREPORT, NREPORT, },
|
||||
// { MANP, 250, 10370, -531, 28, 225, 22, },
|
||||
// { TROP, 245, NREPORT, -541, 28, 230, 26, },
|
||||
// { SIGP, 228, NREPORT, -481, 60, NREPORT, NREPORT, },
|
||||
// { SIGP, 209, NREPORT, -495, 69, NREPORT, NREPORT, },
|
||||
// { MANP, 200, 11830, -489, 72, 240, 43, },
|
||||
// { SIGP, 172, NREPORT, -503, 76, NREPORT, NREPORT, },
|
||||
// { MANP, 150, 13710, -501, 76, 235, 38, },
|
||||
// { SIGP, 122, NREPORT, -511, 75, NREPORT, NREPORT, },
|
||||
// { SIGP, 110, NREPORT, -559, 74, NREPORT, NREPORT, },
|
||||
// { MANP, 100, 16330, -537, 75, 230, 25, }, };
|
||||
private static Map<String, VerticalSounding> soundings = null;
|
||||
|
||||
/**
|
||||
* Retrieve a VerticalSounding instance corresponding to the specified
|
||||
* station id. Returns a null reference if no data is available to the
|
||||
* requested data.
|
||||
*
|
||||
* @param stationId
|
||||
* A station identifier. The identifier may be either an ICAO
|
||||
* (KJAN) or WMO Block Station Number (72235).
|
||||
* @return The VerticalSounding instance, or null if not found.
|
||||
*/
|
||||
public static VerticalSounding getSounding(String stationId) {
|
||||
if (soundings == null) {
|
||||
createSoundingData();
|
||||
}
|
||||
|
||||
VerticalSounding sounding = null;
|
||||
|
||||
if (soundings.containsKey(stationId)) {
|
||||
sounding = soundings.get(stationId);
|
||||
}
|
||||
return sounding;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the mock sounding data.
|
||||
*/
|
||||
private static void createSoundingData() {
|
||||
VerticalSounding s = null;
|
||||
soundings = new HashMap<String, VerticalSounding>();
|
||||
|
||||
s = new VerticalSounding();
|
||||
|
||||
s.setStationId("72558");
|
||||
// s = new VerticalSounding(icaoKJAN, dataKJAN, Calendar.getInstance()
|
||||
// .getTime(), 32.31972, -90.0775);
|
||||
// soundings.put(bsnKJAN, s);
|
||||
// soundings.put(icaoKJAN, s);
|
||||
|
||||
// s = new VerticalSounding(icaoKOAX, dataKOAX, Calendar.getInstance()
|
||||
// .getTime(), 41.3166, -96.366);
|
||||
// soundings.put(bsnKOAX, s);
|
||||
// soundings.put(icaoKOAX, s);
|
||||
}
|
||||
}
|
|
@ -1,305 +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.viz.skewt.mouse;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.graphics.Cursor;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.eclipse.ui.IWorkbenchPart;
|
||||
import org.eclipse.ui.IWorkbenchPartSite;
|
||||
|
||||
import com.raytheon.uf.viz.core.IDisplayPaneContainer;
|
||||
import com.raytheon.uf.viz.core.drawables.ResourcePair;
|
||||
import com.raytheon.uf.viz.core.rsc.ResourceList;
|
||||
import com.raytheon.viz.skewt.SkewTDescriptor;
|
||||
import com.raytheon.viz.skewt.SkewtDisplay;
|
||||
import com.raytheon.viz.skewt.rsc.InteractiveSkewTResource;
|
||||
import com.raytheon.viz.ui.EditorUtil;
|
||||
import com.raytheon.viz.ui.input.InputAdapter;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
|
||||
/**
|
||||
* Mouse inspect adapter for graphs
|
||||
*
|
||||
* <pre>
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Oct 18, 2007 njensen Initial creation
|
||||
* 20Nov2007 ebabin Added support for middle click resource (editable)
|
||||
* 30Sept2008 dhladky Re-worked some.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author njensen
|
||||
*/
|
||||
public class SkewtMouseInspectAdapter extends InputAdapter {
|
||||
|
||||
public enum Mode {
|
||||
CREATE, MOVE_LINE, MOVE_POINT, PAN, HOVER
|
||||
};
|
||||
|
||||
private Display display;
|
||||
|
||||
private Cursor cross;
|
||||
|
||||
private Cursor hand;
|
||||
|
||||
private Cursor arrow;
|
||||
|
||||
private Coordinate coordinateFound = null;
|
||||
|
||||
private Mode mode = Mode.CREATE;
|
||||
|
||||
/** The last mouse position - x */
|
||||
private int lastMouseX = -1;
|
||||
|
||||
/** The last mouse position - y */
|
||||
private int lastMouseY = -1;
|
||||
|
||||
private int zoomIndex = 0;
|
||||
|
||||
private SkewtDisplay st = null;
|
||||
|
||||
private InteractiveSkewTResource rsc = null;
|
||||
|
||||
public SkewtMouseInspectAdapter() {
|
||||
display = Display.getCurrent();
|
||||
cross = display.getSystemCursor(SWT.CURSOR_SIZEALL);
|
||||
hand = display.getSystemCursor(SWT.CURSOR_HAND);
|
||||
arrow = display.getSystemCursor(SWT.CURSOR_ARROW);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handleMouseDown(int x, int y, int mouseButton) {
|
||||
IDisplayPaneContainer editor = EditorUtil.getActiveVizContainer();
|
||||
if (editor == null) {
|
||||
return false;
|
||||
}
|
||||
Coordinate c = editor.translateClick(x, y);
|
||||
if (getSkewtDisplay() == null) {
|
||||
return false;
|
||||
}
|
||||
st = getSkewtDisplay();
|
||||
ResourceList rl = st.getDescriptor().getResourceList();
|
||||
Iterator<?> it = rl.iterator();
|
||||
while (it.hasNext()) {
|
||||
ResourcePair rp = (ResourcePair) it.next();
|
||||
if (rp.getResource() instanceof InteractiveSkewTResource) {
|
||||
rsc = (InteractiveSkewTResource) rp.getResource();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (mouseButton == 2) {
|
||||
// notifyResourceMiddleClicked(x, y);
|
||||
if (rsc != null && rsc.isEditable() == true
|
||||
&& rsc.isPoint(c) == true) {
|
||||
rsc.removeLayer(rsc.getEp());
|
||||
}
|
||||
}
|
||||
|
||||
else if (mouseButton == 1) {
|
||||
if (rsc != null && rsc.isEditable() == true
|
||||
&& rsc.isPoint(c) == true) {
|
||||
mode = Mode.MOVE_POINT;
|
||||
rsc.getSelectedPoint(c);
|
||||
} else {
|
||||
mode = Mode.PAN;
|
||||
}
|
||||
changeMouse(mode);
|
||||
} else {
|
||||
if (rsc != null && rsc.isEditable() == true
|
||||
&& rsc.isPoint(c) == true) {
|
||||
mode = Mode.MOVE_POINT;
|
||||
} else if (rsc != null && rsc.isEditable() == true
|
||||
&& rsc.isPoint(c) == false) {
|
||||
rsc.addLayer(c);
|
||||
mode = Mode.CREATE;
|
||||
}
|
||||
changeMouse(mode);
|
||||
return false;
|
||||
}
|
||||
editor.refresh();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean handleMouseDownMove(int x, int y, int button) {
|
||||
IDisplayPaneContainer editor = EditorUtil.getActiveVizContainer();
|
||||
if (editor == null) {
|
||||
return false;
|
||||
}
|
||||
boolean mouse = false;
|
||||
|
||||
if (getSkewtDisplay() == null) {
|
||||
mouse = false;
|
||||
} else {
|
||||
st = getSkewtDisplay();
|
||||
ResourceList rl = st.getDescriptor().getResourceList();
|
||||
Iterator<?> it = rl.iterator();
|
||||
while (it.hasNext()) {
|
||||
ResourcePair rp = (ResourcePair) it.next();
|
||||
if (rp.getResource() instanceof InteractiveSkewTResource) {
|
||||
rsc = (InteractiveSkewTResource) rp.getResource();
|
||||
break;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (button != 1) {
|
||||
mouse = false;
|
||||
}
|
||||
|
||||
if (mode == Mode.PAN) {
|
||||
changeMouse(mode);
|
||||
mouse = false;
|
||||
}
|
||||
|
||||
if (mode == Mode.MOVE_POINT) {
|
||||
Coordinate c = editor.translateClick(x, y);
|
||||
changeMouse(mode);
|
||||
rsc.moveMousePoint(c);
|
||||
lastMouseX = x;
|
||||
lastMouseY = y;
|
||||
editor.refresh();
|
||||
mouse = true;
|
||||
}
|
||||
|
||||
return mouse;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handleMouseHover(int x, int y) {
|
||||
// try {
|
||||
// if (!mode.name().equals(Mode.MOVE_POINT)) {
|
||||
// if (getSkewtDisplay().isInsideEndpoint(lastMouseX, lastMouseY) !=
|
||||
// null) {
|
||||
// coordinateFound = getSkewtDisplay().isInsideEndpoint(
|
||||
// lastMouseX, lastMouseY);
|
||||
// this.mode = Mode.HOVER;
|
||||
// } else {
|
||||
// this.mode = Mode.CREATE;
|
||||
//
|
||||
// }
|
||||
// }
|
||||
// } catch (NullPointerException npe) {
|
||||
mode = Mode.CREATE;
|
||||
// }
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handleMouseUp(int x, int y, int mouseButton) {
|
||||
IDisplayPaneContainer editor = EditorUtil.getActiveVizContainer();
|
||||
if (editor == null) {
|
||||
return false;
|
||||
}
|
||||
boolean mouse = false;
|
||||
if (getSkewtDisplay() == null) {
|
||||
mouse = false;
|
||||
} else {
|
||||
st = getSkewtDisplay();
|
||||
ResourceList rl = st.getDescriptor().getResourceList();
|
||||
Iterator<?> it = rl.iterator();
|
||||
while (it.hasNext()) {
|
||||
ResourcePair rp = (ResourcePair) it.next();
|
||||
if (rp.getResource() instanceof InteractiveSkewTResource) {
|
||||
rsc = (InteractiveSkewTResource) rp.getResource();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (mouseButton == 1) {
|
||||
// getSkewtDisplay().handleMouseUp();
|
||||
} else if (mouseButton == 2) {
|
||||
|
||||
double[] grid = editor.getActiveDisplayPane().screenToGrid(x, y, 0);
|
||||
lastMouseX = (int) grid[0];
|
||||
lastMouseY = (int) grid[1];
|
||||
|
||||
// if (getSkewtDisplay().isInsideEndpoint(lastMouseX, lastMouseY) !=
|
||||
// null) {
|
||||
// getSkewtDisplay().deleteLayer();
|
||||
// }
|
||||
}
|
||||
|
||||
mode = Mode.CREATE;
|
||||
changeMouse(mode);
|
||||
// editor.refresh();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the display you are using
|
||||
*
|
||||
* @return SkewTDisplay
|
||||
*/
|
||||
private SkewtDisplay getSkewtDisplay() {
|
||||
IDisplayPaneContainer editor = EditorUtil.getActiveVizContainer();
|
||||
if (editor == null) {
|
||||
return null;
|
||||
}
|
||||
if (editor.getActiveDisplayPane().getDescriptor() instanceof SkewTDescriptor) {
|
||||
// the ordering in the editor is paramount here!!!!!
|
||||
if (editor.getActiveDisplayPane().getRenderableDisplay() instanceof SkewtDisplay) {
|
||||
return ((SkewtDisplay) (editor.getActiveDisplayPane()
|
||||
.getRenderableDisplay()));
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Swap out out mouse pointers
|
||||
*
|
||||
* @param mode
|
||||
*/
|
||||
public void changeMouse(Mode mode) {
|
||||
IDisplayPaneContainer editor = EditorUtil.getActiveVizContainer();
|
||||
if (editor == null) {
|
||||
return;
|
||||
}
|
||||
if (editor instanceof IWorkbenchPart) {
|
||||
IWorkbenchPartSite site = ((IWorkbenchPart) editor).getSite();
|
||||
Cursor cursor = site.getShell().getCursor();
|
||||
if (mode == Mode.HOVER) {
|
||||
if (!hand.equals(cursor)) {
|
||||
site.getShell().setCursor(hand);
|
||||
}
|
||||
} else if (mode == Mode.MOVE_POINT) {
|
||||
if (!cross.equals(cursor)) {
|
||||
site.getShell().setCursor(cross);
|
||||
}
|
||||
} else {
|
||||
if (!arrow.equals(cursor)) {
|
||||
site.getShell().setCursor(arrow);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,382 +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.viz.skewt.rsc;
|
||||
|
||||
import javax.measure.converter.UnitConverter;
|
||||
import javax.measure.unit.NonSI;
|
||||
import javax.measure.unit.SI;
|
||||
|
||||
import org.eclipse.jface.action.Action;
|
||||
import org.eclipse.jface.action.ActionContributionItem;
|
||||
import org.eclipse.jface.action.IAction;
|
||||
import org.eclipse.jface.action.IMenuCreator;
|
||||
import org.eclipse.jface.action.IMenuManager;
|
||||
import org.eclipse.swt.widgets.Control;
|
||||
import org.eclipse.swt.widgets.Menu;
|
||||
|
||||
import com.raytheon.uf.common.geospatial.ReferencedCoordinate;
|
||||
import com.raytheon.uf.common.sounding.WxMath;
|
||||
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.IGraphicsTarget;
|
||||
import com.raytheon.uf.viz.core.drawables.PaintProperties;
|
||||
import com.raytheon.uf.viz.core.drawables.ResourcePair;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.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.ResourceList;
|
||||
import com.raytheon.uf.viz.core.rsc.ResourceProperties;
|
||||
import com.raytheon.uf.viz.core.rsc.capabilities.MagnificationCapability;
|
||||
import com.raytheon.viz.skewt.SkewTDescriptor;
|
||||
import com.raytheon.viz.skewt.rscdata.SkewTBkgResourceData;
|
||||
import com.raytheon.viz.skewt.ui.HodoBackground;
|
||||
import com.raytheon.viz.skewt.ui.SkewTConstants;
|
||||
import com.raytheon.viz.skewt.ui.SkewtBackground;
|
||||
import com.raytheon.viz.skewt.ui.TempChangeBackground;
|
||||
import com.raytheon.viz.ui.cmenu.AbstractRightClickAction;
|
||||
import com.raytheon.viz.ui.cmenu.IContextMenuContributor;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
|
||||
/**
|
||||
* TODO Add Description
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Sep 22, 2009 randerso Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author randerso
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class SkewTBackgroundResource extends
|
||||
AbstractVizResource<SkewTBkgResourceData, SkewTDescriptor> implements
|
||||
IContextMenuContributor {
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(SkewTBackgroundResource.class);
|
||||
|
||||
private static final UnitConverter celciusToFahrenheit = SI.CELSIUS
|
||||
.getConverterTo(NonSI.FAHRENHEIT);
|
||||
|
||||
private static final UnitConverter celciusToKelvin = SI.CELSIUS
|
||||
.getConverterTo(SI.KELVIN);
|
||||
|
||||
private static final UnitConverter metersPerSecondToKnots = SI.METERS_PER_SECOND
|
||||
.getConverterTo(NonSI.KNOT);
|
||||
|
||||
private SkewtBackground skewTBackground;
|
||||
|
||||
/**
|
||||
* @return the skewTBackground
|
||||
*/
|
||||
public SkewtBackground getSkewTBackground() {
|
||||
return skewTBackground;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the hodoBackground
|
||||
*/
|
||||
public HodoBackground getHodoBackground() {
|
||||
return hodoBackground;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the tempChangeBackground
|
||||
*/
|
||||
public TempChangeBackground getTempChangeBackground() {
|
||||
return tempChangeBackground;
|
||||
}
|
||||
|
||||
private HodoBackground hodoBackground;
|
||||
|
||||
private TempChangeBackground tempChangeBackground;
|
||||
|
||||
public SkewTBackgroundResource(SkewTBkgResourceData rscData,
|
||||
LoadProperties loadProperties) {
|
||||
super(rscData, loadProperties);
|
||||
double mag = getCapability(MagnificationCapability.class)
|
||||
.getMagnification();
|
||||
skewTBackground = new SkewtBackground();
|
||||
skewTBackground.setMagnification(mag);
|
||||
hodoBackground = new HodoBackground();
|
||||
hodoBackground.setMagnification(mag);
|
||||
tempChangeBackground = new TempChangeBackground();
|
||||
tempChangeBackground.setMagnification(mag);
|
||||
resourceData.addChangeListener(new IResourceDataChanged() {
|
||||
@Override
|
||||
public void resourceChanged(ChangeType type, Object object) {
|
||||
if (type == ChangeType.CAPABILITY) {
|
||||
if (object instanceof MagnificationCapability) {
|
||||
double mag = ((MagnificationCapability) object)
|
||||
.getMagnification();
|
||||
skewTBackground.setMagnification(mag);
|
||||
hodoBackground.setMagnification(mag);
|
||||
tempChangeBackground.setMagnification(mag);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void disposeInternal() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initInternal(IGraphicsTarget target) throws VizException {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void paintInternal(IGraphicsTarget target,
|
||||
PaintProperties paintProps) throws VizException {
|
||||
skewTBackground.paint(target, paintProps);
|
||||
hodoBackground.paint(target, paintProps);
|
||||
tempChangeBackground.paint(target, paintProps);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String inspect(ReferencedCoordinate rCoord) throws VizException {
|
||||
String s = "NO DATA";
|
||||
|
||||
Coordinate c;
|
||||
try {
|
||||
c = rCoord.getObject();
|
||||
if (getSkewTBackground().contains(c)) {
|
||||
c = WxMath.reverseSkewTXY(getSkewTBackground().getWorld()
|
||||
.unMap(c.x, c.y));
|
||||
double p_mb = c.y;
|
||||
double t_C = c.x; // Celsius
|
||||
double t_F = celciusToFahrenheit.convert(c.x);
|
||||
double theta = celciusToKelvin.convert(WxMath.theta(p_mb, t_C,
|
||||
1000));
|
||||
double thetaE = celciusToKelvin.convert(WxMath.thetae(p_mb,
|
||||
t_C, t_C));
|
||||
double w = WxMath.mixingRatio(p_mb, t_C);
|
||||
s = String
|
||||
.format("P=%.0f mb T=%.0f%cC/%.0f%cF Theta=%.0fK Theta-e=%.0fK w=%.1f",
|
||||
p_mb, t_C, SkewTConstants.DEGREE_SYMBOL, t_F,
|
||||
SkewTConstants.DEGREE_SYMBOL, theta, thetaE, w);
|
||||
} else if (getHodoBackground().contains(c)) {
|
||||
c = getHodoBackground().getWorld().unMap(c.x, c.y);
|
||||
c = WxMath.speedDir((float) c.x, (float) c.y);
|
||||
s = String.format("%.0f%c at %.0f kts", c.y,
|
||||
SkewTConstants.DEGREE_SYMBOL,
|
||||
metersPerSecondToKnots.convert(c.x));
|
||||
} else if (getTempChangeBackground().contains(c)) {
|
||||
c = getTempChangeBackground().getWorld().unMap(c.x, c.y);
|
||||
c.y = WxMath.reverseSkewTXY(c).y;
|
||||
double p_mb = c.y;
|
||||
double deltaT_C = c.x;
|
||||
double deltaT_F = 1.8 * deltaT_C;
|
||||
s = String.format("P=%.0f mb T=%+.0f%cC/%+.0f%cF", p_mb,
|
||||
deltaT_C, SkewTConstants.DEGREE_SYMBOL, deltaT_F,
|
||||
SkewTConstants.DEGREE_SYMBOL);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Exception translating coordinate", e);
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addContextMenuItems(IMenuManager menuManager, int x, int y) {
|
||||
for (ResourcePair rp : getDescriptor().getResourceList()) {
|
||||
if (rp.getResource() instanceof SkewTResource
|
||||
&& !(rp.getResource() instanceof InteractiveSkewTResource)) {
|
||||
InteractiveSkewTMenuAction action = new InteractiveSkewTMenuAction();
|
||||
ResourcePair rscPair = new ResourcePair();
|
||||
rscPair.setLoadProperties(getLoadProperties());
|
||||
rscPair.setProperties(descriptor.getResourceList()
|
||||
.getProperties(this));
|
||||
rscPair.setResource(this);
|
||||
rscPair.setResourceData(resourceData);
|
||||
action.setSelectedRsc(rscPair);
|
||||
menuManager.add(action);
|
||||
return;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
private static class InteractiveSkewTMenuAction extends
|
||||
AbstractRightClickAction implements IMenuCreator {
|
||||
|
||||
private Menu menu;
|
||||
|
||||
private InteractiveSkewTMenuAction() {
|
||||
super("Interactive Skew-T", IAction.AS_DROP_DOWN_MENU);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.jface.action.Action#getMenuCreator()
|
||||
*/
|
||||
@Override
|
||||
public IMenuCreator getMenuCreator() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispose() {
|
||||
if (menu != null) {
|
||||
menu.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Menu getMenu(Control parent) {
|
||||
|
||||
if (menu != null) {
|
||||
menu.dispose();
|
||||
}
|
||||
|
||||
menu = new Menu(parent);
|
||||
|
||||
fillMenu(menu);
|
||||
|
||||
return menu;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Menu getMenu(Menu parent) {
|
||||
|
||||
if (menu != null) {
|
||||
menu.dispose();
|
||||
}
|
||||
|
||||
menu = new Menu(parent);
|
||||
|
||||
fillMenu(menu);
|
||||
|
||||
return menu;
|
||||
}
|
||||
|
||||
private void fillMenu(Menu menu) {
|
||||
ResourceList list = getSelectedRsc().getDescriptor()
|
||||
.getResourceList();
|
||||
synchronized (list) {
|
||||
InteractiveSkewTResource activeRsc = null;
|
||||
String activeIcao = null;
|
||||
for (ResourcePair rp : list) {
|
||||
if (rp.getResource() instanceof InteractiveSkewTResource) {
|
||||
activeRsc = (InteractiveSkewTResource) rp.getResource();
|
||||
activeIcao = activeRsc.getSoundingParameters()
|
||||
.getInterleavedData().getName();
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (ResourcePair rp : list) {
|
||||
if (rp.getResource() != activeRsc
|
||||
&& rp.getResource() instanceof SkewTResource) {
|
||||
SkewTResource rsc = (SkewTResource) rp.getResource();
|
||||
String icao = rsc.getSoundingParameters()
|
||||
.getInterleavedData().getName();
|
||||
ActionContributionItem aci = new ActionContributionItem(
|
||||
new InteractiveSkewTInternalAction(rsc,
|
||||
activeRsc));
|
||||
|
||||
aci.getAction().setChecked(icao.equals(activeIcao));
|
||||
aci.fill(menu, -1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static class InteractiveSkewTInternalAction extends Action {
|
||||
|
||||
private SkewTResource rsc;
|
||||
|
||||
private SkewTResource activeRsc;
|
||||
|
||||
public InteractiveSkewTInternalAction(SkewTResource rsc,
|
||||
SkewTResource activeRsc) {
|
||||
super(rsc.getSoundingParameters().getInterleavedData().getName(),
|
||||
IAction.AS_RADIO_BUTTON);
|
||||
this.rsc = rsc;
|
||||
this.activeRsc = activeRsc;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.jface.action.Action#run()
|
||||
*/
|
||||
@Override
|
||||
public void run() {
|
||||
if (!this.isChecked()) {
|
||||
return;
|
||||
}
|
||||
System.out.println(this.getText() + " selected");
|
||||
|
||||
SkewTDescriptor descriptor = this.rsc.getDescriptor();
|
||||
ResourceList list = descriptor.getResourceList();
|
||||
synchronized (list) {
|
||||
|
||||
// remove the currently active resource if any
|
||||
if (activeRsc != null) {
|
||||
list.removeRsc(activeRsc);
|
||||
}
|
||||
|
||||
// hide all but the selected resource
|
||||
for (ResourcePair rp : list) {
|
||||
AbstractVizResource<?, ?> r = rp.getResource();
|
||||
if (r instanceof SkewTResource && r != rsc) {
|
||||
rp.getProperties().setVisible(false);
|
||||
}
|
||||
}
|
||||
|
||||
ResourceProperties props = new ResourceProperties();
|
||||
InteractiveSkewTResource activeRsc = new InteractiveSkewTResource(
|
||||
rsc);
|
||||
list.add(activeRsc, props);
|
||||
try {
|
||||
descriptor.getTimeMatcher().redoTimeMatching(descriptor);
|
||||
} catch (VizException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.uf.viz.core.rsc.AbstractVizResource#getName()
|
||||
*/
|
||||
@Override
|
||||
public String getName() {
|
||||
return "SkewT Background";
|
||||
}
|
||||
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,126 +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.viz.skewt.rscdata;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
||||
import com.raytheon.uf.common.sounding.VerticalSounding;
|
||||
import com.raytheon.uf.common.time.DataTime;
|
||||
import com.raytheon.uf.viz.core.rsc.AbstractRequestableResourceData;
|
||||
import com.raytheon.uf.viz.core.rsc.LoadProperties;
|
||||
import com.raytheon.viz.skewt.rsc.SkewTResource;
|
||||
|
||||
/**
|
||||
* TODO Add Description
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Feb 20, 2009 chammack Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author chammack
|
||||
* @version 1.0
|
||||
*/
|
||||
@Deprecated
|
||||
public abstract class AbstractSkewTResourceData extends
|
||||
AbstractRequestableResourceData {
|
||||
|
||||
protected String sourceName;
|
||||
|
||||
protected void addSounding(DataTime dataTime, VerticalSounding sounding,
|
||||
SkewTResource rsc) {
|
||||
rsc.addSounding(dataTime, sounding);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the sourceName
|
||||
*/
|
||||
public String getSourceName() {
|
||||
return sourceName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param sourceName
|
||||
* the sourceName to set
|
||||
*/
|
||||
public void setSourceName(String sourceName) {
|
||||
this.sourceName = sourceName;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @seecom.raytheon.uf.viz.core.rsc.AbstractRequestableResourceData#
|
||||
* constructResource(com.raytheon.uf.viz.core.comm.LoadProperties,
|
||||
* com.raytheon.uf.common.dataplugin.PluginDataObject[])
|
||||
*/
|
||||
@Override
|
||||
protected SkewTResource constructResource(LoadProperties loadProperties,
|
||||
PluginDataObject[] objects) {
|
||||
SkewTResource rsc = null;
|
||||
// rsc = new SkewTResource(this, loadProperties);
|
||||
return rsc;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = super.hashCode();
|
||||
result = prime * result
|
||||
+ ((sourceName == null) ? 0 : sourceName.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (!super.equals(obj)) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
AbstractSkewTResourceData other = (AbstractSkewTResourceData) obj;
|
||||
if (sourceName == null) {
|
||||
if (other.sourceName != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!sourceName.equals(other.sourceName)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,97 +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.viz.skewt.rscdata;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAttribute;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
||||
import com.raytheon.uf.common.sounding.adapter.AbstractVerticalSoundingAdapter;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.rsc.LoadProperties;
|
||||
import com.raytheon.uf.viz.sounding.adapters.GridSoundingAdapter;
|
||||
import com.raytheon.uf.viz.sounding.adapters.IPointSounding;
|
||||
import com.raytheon.viz.skewt.rsc.SkewTResource;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
|
||||
/**
|
||||
* Creates soundings from Grib
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Feb 20, 2009 chammack Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author chammack
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class GribSoundingSkewTResourceData extends SkewTResourceData implements
|
||||
IPointSounding {
|
||||
|
||||
@XmlAttribute
|
||||
private String point;
|
||||
|
||||
@XmlElement
|
||||
private Coordinate coordinate;
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @seecom.raytheon.uf.viz.core.rsc.AbstractRequestableResourceData#
|
||||
* constructResource(com.raytheon.uf.viz.core.rsc.LoadProperties,
|
||||
* com.raytheon.uf.common.dataplugin.PluginDataObject[])
|
||||
*/
|
||||
@Override
|
||||
protected SkewTResource constructResource(LoadProperties loadProperties,
|
||||
PluginDataObject[] objects) throws VizException {
|
||||
AbstractVerticalSoundingAdapter adapter = new GridSoundingAdapter(this);
|
||||
adapter.setObjects(objects);
|
||||
this.soundings = adapter.createSoundings();
|
||||
SkewTResource rsc = new SkewTResource(this, loadProperties);
|
||||
return rsc;
|
||||
}
|
||||
|
||||
public String getPoint() {
|
||||
return point;
|
||||
}
|
||||
|
||||
public void setPoint(String point) {
|
||||
this.point = point;
|
||||
}
|
||||
|
||||
public Coordinate getCoordinate() {
|
||||
return coordinate;
|
||||
}
|
||||
|
||||
public void setCoordinate(Coordinate coordinate) {
|
||||
this.coordinate = coordinate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPointName() {
|
||||
return getPoint();
|
||||
}
|
||||
|
||||
}
|
|
@ -1,89 +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.viz.skewt.rscdata;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
|
||||
import com.raytheon.uf.viz.core.drawables.IDescriptor;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.rsc.AbstractResourceData;
|
||||
import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
|
||||
import com.raytheon.uf.viz.core.rsc.LoadProperties;
|
||||
import com.raytheon.viz.skewt.rsc.SkewTBackgroundResource;
|
||||
|
||||
/**
|
||||
* TODO Add Description
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Oct 7, 2009 randerso Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author randerso
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
public class SkewTBkgResourceData extends AbstractResourceData {
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.uf.viz.core.rsc.AbstractResourceData#construct(com.raytheon
|
||||
* .uf.viz.core.rsc.LoadProperties,
|
||||
* com.raytheon.uf.viz.core.drawables.IDescriptor)
|
||||
*/
|
||||
@Override
|
||||
public AbstractVizResource<?, ?> construct(LoadProperties loadProperties,
|
||||
IDescriptor descriptor) throws VizException {
|
||||
return new SkewTBackgroundResource(this, loadProperties);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.uf.viz.core.rsc.AbstractResourceData#equals(java.lang.Object
|
||||
* )
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
return getClass() == this.getClass();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.uf.viz.core.rsc.AbstractResourceData#update(java.lang.Object
|
||||
* )
|
||||
*/
|
||||
@Override
|
||||
public void update(Object updateData) {
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -1,222 +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.viz.skewt.rscdata;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
|
||||
import org.eclipse.core.runtime.IConfigurationElement;
|
||||
import org.eclipse.core.runtime.IExtension;
|
||||
import org.eclipse.core.runtime.IExtensionPoint;
|
||||
import org.eclipse.core.runtime.IExtensionRegistry;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
import org.eclipse.core.runtime.Status;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
||||
import com.raytheon.uf.common.sounding.VerticalSounding;
|
||||
import com.raytheon.uf.common.sounding.adapter.AbstractVerticalSoundingAdapter;
|
||||
import com.raytheon.uf.viz.core.Activator;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.rsc.AbstractRequestableResourceData;
|
||||
import com.raytheon.uf.viz.core.rsc.LoadProperties;
|
||||
import com.raytheon.viz.skewt.rsc.SkewTResource;
|
||||
|
||||
/**
|
||||
* TODO Add Description
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Sep 23, 2009 randerso Initial creation
|
||||
* Jul 05, 2013 1869 bsteffen Fix goes sounding updates.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author randerso
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
public class SkewTResourceData extends AbstractRequestableResourceData {
|
||||
private static final String VERTICAL_SOUNDING_ADAPTER_EXTENSION = "com.raytheon.uf.viz.sounding.verticalSoundingAdapter";
|
||||
|
||||
private static Map<String, IConfigurationElement> adapterMap = null;
|
||||
|
||||
private String pointLetter;
|
||||
|
||||
protected VerticalSounding[] soundings;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public SkewTResourceData() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the soundings
|
||||
*/
|
||||
public VerticalSounding[] getSoundings() {
|
||||
return soundings;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @seecom.raytheon.uf.viz.core.rsc.AbstractRequestableResourceData#
|
||||
* constructResource(com.raytheon.uf.viz.core.rsc.LoadProperties,
|
||||
* com.raytheon.uf.common.dataplugin.PluginDataObject[])
|
||||
*/
|
||||
@Override
|
||||
protected SkewTResource constructResource(LoadProperties loadProperties,
|
||||
PluginDataObject[] objects) throws VizException {
|
||||
|
||||
soundings = convertToSounding(objects);
|
||||
|
||||
return new SkewTResource(this, loadProperties);
|
||||
}
|
||||
|
||||
public VerticalSounding[] convertToSounding(PluginDataObject[] objects)
|
||||
throws VizException {
|
||||
if (objects != null && objects.length > 0) {
|
||||
AbstractVerticalSoundingAdapter adapter = getAdapter(objects[0]);
|
||||
adapter.setObjects(objects);
|
||||
return adapter.createSoundings();
|
||||
} else {
|
||||
return new VerticalSounding[0];
|
||||
}
|
||||
}
|
||||
|
||||
protected AbstractVerticalSoundingAdapter getAdapter(PluginDataObject object)
|
||||
throws VizException {
|
||||
synchronized (SkewTResourceData.class) {
|
||||
if (adapterMap == null) {
|
||||
adapterMap = new HashMap<String, IConfigurationElement>();
|
||||
IExtensionRegistry registry = Platform.getExtensionRegistry();
|
||||
if (registry != null) {
|
||||
IExtensionPoint point = registry
|
||||
.getExtensionPoint(VERTICAL_SOUNDING_ADAPTER_EXTENSION);
|
||||
if (point != null) {
|
||||
IExtension[] extensions = point.getExtensions();
|
||||
|
||||
for (IExtension ext : extensions) {
|
||||
IConfigurationElement[] config = ext
|
||||
.getConfigurationElements();
|
||||
|
||||
for (IConfigurationElement cfg : config) {
|
||||
String record = cfg.getAttribute("class");
|
||||
|
||||
if (adapterMap.put(record, cfg) != null) {
|
||||
Activator
|
||||
.getDefault()
|
||||
.getLog()
|
||||
.log(
|
||||
new Status(
|
||||
Status.ERROR,
|
||||
Activator.PLUGIN_ID,
|
||||
"Duplicate VerticalSoundingAdapter for: \""
|
||||
+ record
|
||||
+ "\" defined in "
|
||||
+ ext
|
||||
.getNamespaceIdentifier()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
String className = object.getClass().getName();
|
||||
IConfigurationElement cfg = adapterMap.get(className);
|
||||
if (cfg == null) {
|
||||
throw new VizException("No VerticalSoundingAdapter registered for "
|
||||
+ className);
|
||||
}
|
||||
try {
|
||||
AbstractVerticalSoundingAdapter adapter = (AbstractVerticalSoundingAdapter) cfg
|
||||
.createExecutableExtension("adapter");
|
||||
|
||||
return adapter;
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
throw new VizException(
|
||||
"Exception while getting VerticalSoundingAdapter for "
|
||||
+ className, e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getPointLetter() {
|
||||
return pointLetter;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param pointLetter
|
||||
*/
|
||||
public void setPointLetter(String pointLetter) {
|
||||
this.pointLetter = pointLetter;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = super.hashCode();
|
||||
result = prime * result + Arrays.hashCode(soundings);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (!super.equals(obj)) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
SkewTResourceData other = (SkewTResourceData) obj;
|
||||
if (soundings != other.soundings) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -1,98 +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.viz.skewt.ui;
|
||||
|
||||
import org.eclipse.swt.graphics.Rectangle;
|
||||
|
||||
import com.raytheon.uf.viz.core.IGraphicsTarget;
|
||||
import com.raytheon.uf.viz.core.drawables.IFont;
|
||||
import com.raytheon.uf.viz.core.drawables.IRenderable;
|
||||
import com.raytheon.uf.viz.core.drawables.PaintProperties;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.viz.core.graphing.WGraphics;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
|
||||
public abstract class AbstractSkewTBackground implements IRenderable {
|
||||
protected Rectangle rectangle;
|
||||
|
||||
private WGraphics world;
|
||||
|
||||
protected IFont smallFont;
|
||||
|
||||
protected double magnification;
|
||||
|
||||
/**
|
||||
* Determine if a point is contained in this background area
|
||||
*
|
||||
* @param c
|
||||
* point of interest
|
||||
* @return true if point is contained
|
||||
*/
|
||||
public boolean contains(Coordinate c) {
|
||||
return this.rectangle.contains((int) c.x, (int) c.y);
|
||||
}
|
||||
|
||||
public Rectangle getRectangle() {
|
||||
return this.rectangle;
|
||||
}
|
||||
|
||||
public WGraphics getWorld() {
|
||||
synchronized (AbstractSkewTBackground.class) {
|
||||
if (this.world == null) {
|
||||
this.world = computeWorld();
|
||||
}
|
||||
}
|
||||
return this.world;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param magnification
|
||||
* the magnification to set
|
||||
*/
|
||||
public void setMagnification(double magnification) {
|
||||
this.magnification = magnification;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.uf.viz.core.drawables.IRenderable#paint(com.raytheon.uf.
|
||||
* viz.core.IGraphicsTarget,
|
||||
* com.raytheon.uf.viz.core.drawables.PaintProperties)
|
||||
*/
|
||||
@Override
|
||||
public void paint(IGraphicsTarget target, PaintProperties paintProps)
|
||||
throws VizException {
|
||||
|
||||
smallFont = target.initializeFont(
|
||||
target.getDefaultFont().getFontName(),
|
||||
(float) (10 * magnification), null);
|
||||
|
||||
paintInternal(target, paintProps);
|
||||
|
||||
smallFont.dispose();
|
||||
}
|
||||
|
||||
protected abstract void paintInternal(IGraphicsTarget target,
|
||||
PaintProperties paintProps) throws VizException;
|
||||
|
||||
protected abstract WGraphics computeWorld();
|
||||
}
|
|
@ -1,215 +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.viz.skewt.ui;
|
||||
|
||||
import org.eclipse.swt.graphics.Rectangle;
|
||||
|
||||
import com.raytheon.uf.common.sounding.WxMath;
|
||||
import com.raytheon.uf.viz.core.IGraphicsTarget;
|
||||
import com.raytheon.uf.viz.core.PixelExtent;
|
||||
import com.raytheon.uf.viz.core.IGraphicsTarget.HorizontalAlignment;
|
||||
import com.raytheon.uf.viz.core.IGraphicsTarget.LineStyle;
|
||||
import com.raytheon.uf.viz.core.IGraphicsTarget.TextStyle;
|
||||
import com.raytheon.uf.viz.core.IGraphicsTarget.VerticalAlignment;
|
||||
import com.raytheon.uf.viz.core.drawables.PaintProperties;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.localization.HierarchicalPreferenceStore;
|
||||
import com.raytheon.viz.core.graphing.WGraphics;
|
||||
import com.raytheon.viz.skewt.Activator;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
|
||||
/**
|
||||
*
|
||||
* Draw the hodograph.
|
||||
*
|
||||
* <pre>
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 28Sept2008 #1529 dhladky separate and improve.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author dhladky
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class HodoBackground extends AbstractSkewTBackground {
|
||||
|
||||
private double uMin;
|
||||
|
||||
private double uMax;
|
||||
|
||||
private double vMin;
|
||||
|
||||
private double vMax;
|
||||
|
||||
private PixelExtent pixExt;
|
||||
|
||||
/**
|
||||
* Public constructor
|
||||
*
|
||||
* @param target
|
||||
* @param world
|
||||
* @param paintProps
|
||||
* @throws VizException
|
||||
*/
|
||||
public HodoBackground() {
|
||||
super();
|
||||
|
||||
rectangle = new Rectangle(10, 730, 560, 480);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintInternal(IGraphicsTarget target, PaintProperties paintProps)
|
||||
throws VizException {
|
||||
|
||||
float zoomLevel = paintProps.getZoomLevel();
|
||||
|
||||
pixExt = new PixelExtent(rectangle);
|
||||
|
||||
// rings are offset to left of center of hodograph.
|
||||
// in D2-D this is offset so the 50 m/s ring touches the
|
||||
// left side of the display and the 90 m/s touches the right side of
|
||||
// the display. We adjust our display to mimic this.
|
||||
|
||||
target.setupClippingPlane(pixExt);
|
||||
|
||||
// draw the spokes.
|
||||
Coordinate c = new Coordinate(getWorld().mapX(0), getWorld().mapY(0));
|
||||
for (double angle = 0; angle < 2 * Math.PI; angle += Math.PI / 6) {
|
||||
double x = 200 * Math.cos(angle);
|
||||
double y = 200 * Math.sin(angle);
|
||||
target.drawLine(c.x, c.y, 0.0, getWorld().mapX(x), getWorld().mapY(
|
||||
y), 0.0, SkewTConstants.moistAdiabatColor, 1,
|
||||
LineStyle.SOLID);
|
||||
}
|
||||
// label the spokes
|
||||
|
||||
target.drawString(smallFont, "180" + SkewTConstants.DEGREE_SYMBOL, c.x,
|
||||
rectangle.y, 0.0, TextStyle.BLANKED, SkewTConstants.labelColor,
|
||||
HorizontalAlignment.CENTER, VerticalAlignment.TOP, null);
|
||||
|
||||
target.drawString(smallFont, "360" + SkewTConstants.DEGREE_SYMBOL, c.x,
|
||||
rectangle.y + rectangle.height, 0.0, TextStyle.BLANKED,
|
||||
SkewTConstants.labelColor, HorizontalAlignment.CENTER,
|
||||
VerticalAlignment.BOTTOM, null);
|
||||
|
||||
target.drawString(smallFont, "90" + SkewTConstants.DEGREE_SYMBOL,
|
||||
rectangle.x + (2 * zoomLevel), rectangle.y + rectangle.height
|
||||
/ 2, 0.0, TextStyle.BLANKED, SkewTConstants.labelColor,
|
||||
HorizontalAlignment.LEFT, VerticalAlignment.MIDDLE, null);
|
||||
|
||||
target.drawString(smallFont, "270" + SkewTConstants.DEGREE_SYMBOL,
|
||||
rectangle.x + rectangle.width - 10 * zoomLevel, rectangle.y
|
||||
+ rectangle.height / 2, 0.0, TextStyle.BLANKED,
|
||||
SkewTConstants.labelColor, HorizontalAlignment.RIGHT,
|
||||
VerticalAlignment.MIDDLE, null);
|
||||
|
||||
for (int spd = 10; spd <= 100; spd += 10) {
|
||||
|
||||
Coordinate c0, c1;
|
||||
c0 = WxMath.uvComp(spd, 0);
|
||||
for (int dir = 1; dir <= 360; dir += 1) {
|
||||
c1 = WxMath.uvComp(spd, dir);
|
||||
target.drawLine(getWorld().mapX(c0.x), getWorld().mapY(c0.y),
|
||||
0.0, getWorld().mapX(c1.x), getWorld().mapY(c1.y), 0.0,
|
||||
SkewTConstants.backgroundColor, 1);
|
||||
c0 = c1;
|
||||
}
|
||||
|
||||
Coordinate uv = WxMath.uvComp(spd, 240);
|
||||
if (spd != 0) {
|
||||
target.drawString(smallFont, "" + spd, getWorld().mapX(uv.x),
|
||||
getWorld().mapY(uv.y), 0.0, TextStyle.NORMAL,
|
||||
SkewTConstants.labelColor, HorizontalAlignment.CENTER,
|
||||
VerticalAlignment.MIDDLE, null);
|
||||
}
|
||||
}
|
||||
|
||||
target.drawRect(pixExt, SkewTConstants.backgroundColor, 1.0f, 1.0f);
|
||||
|
||||
target.clearClippingPlane();
|
||||
String label = "HODOGRAPH SPEED IN m/s";
|
||||
target.drawString(smallFont, label, rectangle.x + rectangle.width / 2,
|
||||
rectangle.y, 0.0, TextStyle.BLANKED, SkewTConstants.labelColor,
|
||||
HorizontalAlignment.CENTER, VerticalAlignment.BOTTOM, null);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.viz.skewt.ui.AbstractSkewTBackground#computeWorld()
|
||||
*/
|
||||
@Override
|
||||
protected WGraphics computeWorld() {
|
||||
|
||||
HierarchicalPreferenceStore prefs = Activator.getDefault()
|
||||
.getPreferenceStore();
|
||||
|
||||
double d;
|
||||
uMin = ((d = prefs.getDouble("windRange.umin")) == 0.0 ? -50.0 : d);
|
||||
uMax = ((d = prefs.getDouble("windRange.umax")) == 0.0 ? 50.0 : d);
|
||||
vMin = ((d = prefs.getDouble("windRange.vmin")) == 0.0 ? -50.0 : d);
|
||||
vMax = ((d = prefs.getDouble("windRange.vmax")) == 0.0 ? 50.0 : d);
|
||||
|
||||
WGraphics world = new WGraphics(rectangle);
|
||||
world.setWorldCoordinates(uMin, vMax, uMax, vMin);
|
||||
return world;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the uMin
|
||||
*/
|
||||
public double getUMin() {
|
||||
return uMin;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the uMax
|
||||
*/
|
||||
public double getUMax() {
|
||||
return uMax;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the vMin
|
||||
*/
|
||||
public double getVMin() {
|
||||
return vMin;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the vMax
|
||||
*/
|
||||
public double getVMax() {
|
||||
return vMax;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the pixExt
|
||||
*/
|
||||
public PixelExtent getPixExt() {
|
||||
return pixExt;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,162 +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.viz.skewt.ui;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.swt.graphics.RGB;
|
||||
import org.eclipse.swt.graphics.Rectangle;
|
||||
|
||||
import com.raytheon.uf.common.sounding.WxMath;
|
||||
import com.raytheon.uf.common.sounding.util.Equations;
|
||||
import com.raytheon.uf.common.sounding.util.UAPoint;
|
||||
|
||||
/**
|
||||
*
|
||||
* Used extensive work from SkewT and associated codebase.
|
||||
*
|
||||
* <pre>
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 28Sept2008 #1529 dhladky initial.
|
||||
* Feb 15, 2013 1638 mschenke Moved Equations/UAPoint from edex.common util
|
||||
* to common.sounding
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author dhladky
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class SkewTConstants {
|
||||
|
||||
public static Rectangle skewTRectangle = new Rectangle(0, 0, 860, 1240);
|
||||
|
||||
public static double TEMPERATURE_MIN = -115.0;
|
||||
|
||||
public static double TEMPERATURE_MAX = 45.0;
|
||||
|
||||
public static double WIND_SPEED_MIN = 0.0;
|
||||
|
||||
public static double WIND_SPEED_MAX = 250.0;
|
||||
|
||||
public static double WIND_DIR_MIN = 0.0;
|
||||
|
||||
public static double WIND_DIR_MAX = 360.0;
|
||||
|
||||
public static double PRESSURE_MIN = 100.0;
|
||||
|
||||
public static double PRESSURE_MAX = 973.0;
|
||||
|
||||
// horizontal pressure line that will be drawn.
|
||||
public static final double[] MAN_LEVELS = { 1050, 1000, 950, 900, 850, 800,
|
||||
750, 700, 650, 600, 550, 500, 450, 400, 350, 300, 250, 200, 150,
|
||||
100 };
|
||||
|
||||
public static List<List<UAPoint>> saturatedPoints = Equations
|
||||
.getSaturatedAdiabats(1000, 100, 20, -60, 60, 5);
|
||||
|
||||
public static List<List<UAPoint>> dryPoints = Equations.getDryAdiabats(
|
||||
1000, 100, 20, -40, 273, 10);
|
||||
|
||||
// lightGray.
|
||||
public static final RGB backgroundColor = new RGB(191, 191, 191);
|
||||
|
||||
/**
|
||||
* Color for moist adiabat lines
|
||||
*/
|
||||
public static final RGB moistAdiabatColor = new RGB(0, 127, 255);
|
||||
|
||||
/**
|
||||
* Color for dry adiabat lines
|
||||
*/
|
||||
public static final RGB dryAdiabatColor = new RGB(0, 0, 255);
|
||||
|
||||
/**
|
||||
* Color for mixing ratio lines
|
||||
*/
|
||||
public static final RGB mixingRatioColor = new RGB(23, 255, 23);
|
||||
|
||||
/**
|
||||
* Color for temperature lines
|
||||
*/
|
||||
public static final RGB temperatureColor = new RGB(210, 180, 140);
|
||||
|
||||
/**
|
||||
* Color for pressure lines
|
||||
*/
|
||||
public static final RGB pressureColor = new RGB(191, 191, 191);
|
||||
|
||||
/**
|
||||
* Color for wetbulb lines
|
||||
*/
|
||||
public static final RGB wetBulbColor = new RGB(0, 255, 255);
|
||||
|
||||
public static final int wetBulbLineWidth = 1;
|
||||
|
||||
/**
|
||||
* parameter and label color
|
||||
*/
|
||||
public static final RGB labelColor = new RGB(191, 191, 191);
|
||||
|
||||
public static final RGB editColor = new RGB(255, 165, 0);
|
||||
|
||||
public static final RGB pointEditColor = new RGB(255, 0, 0);
|
||||
|
||||
public static final int editLineWidth = 2;
|
||||
|
||||
public static final RGB parcelColor = new RGB(132, 112, 255);
|
||||
|
||||
public static final int parcelLineWidth = 2;
|
||||
|
||||
public static final int moistAdiabaticIncrement = 5;
|
||||
|
||||
// lightGray.
|
||||
public static final RGB pointColor = new RGB(255, 255, 0);
|
||||
|
||||
public static DecimalFormat pressFormat = new DecimalFormat("####.#");
|
||||
|
||||
public static DecimalFormat tempFormat = new DecimalFormat("###.#");
|
||||
|
||||
public static DecimalFormat windFormat = new DecimalFormat("###.#");
|
||||
|
||||
public static char DEGREE_SYMBOL = '\u00B0';
|
||||
|
||||
public static double endpointRadius = 4;
|
||||
|
||||
public static final int LABEL_PADDING = 5;
|
||||
|
||||
public static double bottom = WxMath.getSkewTXY(1050, 0).y;
|
||||
|
||||
public static double top = WxMath.getSkewTXY(100, 0).y;
|
||||
|
||||
public static double height = top - bottom;
|
||||
|
||||
public static double left = (-height / 2) - 1;
|
||||
|
||||
public static double right = (height / 2) + 1;
|
||||
|
||||
public static double center = (left + right) / 2;
|
||||
|
||||
}
|
|
@ -1,374 +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.viz.skewt.ui;
|
||||
|
||||
import java.awt.geom.Line2D;
|
||||
import java.awt.geom.Point2D;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import javax.measure.converter.UnitConverter;
|
||||
import javax.measure.unit.SI;
|
||||
|
||||
import org.eclipse.swt.graphics.Rectangle;
|
||||
|
||||
import com.raytheon.uf.common.sounding.util.Equations;
|
||||
import com.raytheon.uf.common.sounding.util.UAPoint;
|
||||
import com.raytheon.uf.common.sounding.WxMath;
|
||||
import com.raytheon.uf.viz.core.IGraphicsTarget;
|
||||
import com.raytheon.uf.viz.core.PixelExtent;
|
||||
import com.raytheon.uf.viz.core.drawables.IRenderable;
|
||||
import com.raytheon.uf.viz.core.drawables.PaintProperties;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.viz.core.graphing.WGraphics;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
|
||||
/**
|
||||
*
|
||||
* Used extensive work from SkewTGraph and associated codebase.
|
||||
*
|
||||
* <pre>
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 14Jan2007 #682 ebabin Update for sampling bug.
|
||||
* 28Sept2008 #1529 dhladky separate and improve.
|
||||
* Feb 15, 2013 1638 mschenke Moved Equations/UAPoint from edex.common util
|
||||
* to common.sounding
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author dhladky
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class SkewtBackground extends AbstractSkewTBackground implements
|
||||
IRenderable {
|
||||
|
||||
private static final UnitConverter kelvinToCelsius = SI.KELVIN
|
||||
.getConverterTo(SI.CELSIUS);
|
||||
|
||||
public SkewtBackground() {
|
||||
super();
|
||||
|
||||
this.rectangle = new Rectangle(10, 10, 690, 690);
|
||||
}
|
||||
|
||||
/**
|
||||
* Draws the adiabat lines.
|
||||
*
|
||||
* @throws VizException
|
||||
*/
|
||||
private void drawAdiabats(IGraphicsTarget target) throws VizException {
|
||||
|
||||
for (Iterator<List<UAPoint>> iterator = SkewTConstants.saturatedPoints
|
||||
.iterator(); iterator.hasNext();) {
|
||||
List<UAPoint> points = iterator.next();
|
||||
UAPoint firstPoint = points.get(0);
|
||||
Coordinate coor1 = WxMath.getSkewTXY(firstPoint.pressure,
|
||||
kelvinToCelsius.convert(firstPoint.temperature));
|
||||
for (Iterator<UAPoint> iter = points.iterator(); iter.hasNext();) {
|
||||
UAPoint p = iter.next();
|
||||
Coordinate coor2 = WxMath.getSkewTXY(p.pressure,
|
||||
kelvinToCelsius.convert(p.temperature));
|
||||
target.drawLine(getWorld().mapX(coor1.x), getWorld().mapY(
|
||||
coor1.y), 0.0, getWorld().mapX(coor2.x), getWorld()
|
||||
.mapY(coor2.y), 0.0, SkewTConstants.moistAdiabatColor,
|
||||
1, IGraphicsTarget.LineStyle.DOTTED);
|
||||
coor1 = coor2;
|
||||
}
|
||||
}
|
||||
for (Iterator<List<UAPoint>> iterator = SkewTConstants.dryPoints
|
||||
.iterator(); iterator.hasNext();) {
|
||||
List<UAPoint> points = iterator.next();
|
||||
UAPoint firstPoint = points.get(0);
|
||||
Coordinate startCoor = WxMath.getSkewTXY(firstPoint.pressure,
|
||||
kelvinToCelsius.convert(firstPoint.temperature));
|
||||
for (Iterator<UAPoint> iter = points.iterator(); iter.hasNext();) {
|
||||
UAPoint p = iter.next();
|
||||
Coordinate endCoor = WxMath.getSkewTXY(p.pressure,
|
||||
kelvinToCelsius.convert(p.temperature));
|
||||
target.drawLine(getWorld().mapX(startCoor.x), getWorld().mapY(
|
||||
startCoor.y), 0.0, getWorld().mapX(endCoor.x),
|
||||
getWorld().mapY(endCoor.y), 0.0,
|
||||
SkewTConstants.dryAdiabatColor, 1);
|
||||
startCoor = endCoor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Draws the temperature lines.
|
||||
*
|
||||
* @throws VizException
|
||||
*/
|
||||
private void drawTempLines(IGraphicsTarget target) throws VizException {
|
||||
|
||||
Line2D.Double rightClipLine = new Line2D.Double(getWorld()
|
||||
.getViewXmax() - 20, getWorld().getViewYmin(), getWorld()
|
||||
.getViewXmax() - 20, getWorld().getViewYmax());
|
||||
|
||||
Line2D.Double topClipLine = new Line2D.Double(getWorld().getViewXmin(),
|
||||
getWorld().getViewYmin() + 60, getWorld().getViewXmax(),
|
||||
getWorld().getViewYmin() + 60);
|
||||
|
||||
for (int i = 70; i > -200; i -= 10) {
|
||||
Coordinate coorStart = WxMath.getSkewTXY(1050, i);
|
||||
Coordinate coorEnd = WxMath.getSkewTXY(100, i);
|
||||
|
||||
target.drawLine(getWorld().mapX(coorStart.x), getWorld().mapY(
|
||||
coorStart.y), 0.0, getWorld().mapX(coorEnd.x), getWorld()
|
||||
.mapY(coorEnd.y), 0.0, SkewTConstants.temperatureColor, 1);
|
||||
|
||||
double startX = getWorld().mapX(coorStart.x);
|
||||
double startY = getWorld().mapY(coorStart.y);
|
||||
|
||||
double endX = getWorld().mapX(coorEnd.x);
|
||||
double endY = getWorld().mapY(coorEnd.y);
|
||||
|
||||
Line2D.Double tempLine = new Line2D.Double(startX, startY, endX,
|
||||
endY);
|
||||
|
||||
drawLabelAtLineIntersections(target, tempLine, rightClipLine,
|
||||
Integer.toString(i));
|
||||
drawLabelAtLineIntersections(target, tempLine, topClipLine, Integer
|
||||
.toString(i));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Draws the presssure lines.
|
||||
*
|
||||
* @throws VizException
|
||||
*/
|
||||
private void drawPressureLines(IGraphicsTarget target) throws VizException {
|
||||
String s = null;
|
||||
|
||||
for (int i = 0; i < SkewTConstants.MAN_LEVELS.length; i++) {
|
||||
Coordinate coor = WxMath.getSkewTXY(SkewTConstants.MAN_LEVELS[i],
|
||||
-50);
|
||||
coor.x = getWorld().unMap(getWorld().getViewXmin(), 0).x;
|
||||
Coordinate coorEnd = WxMath.getSkewTXY(
|
||||
SkewTConstants.MAN_LEVELS[i], 60);
|
||||
coorEnd.x = getWorld().unMap(740, 0).x;
|
||||
target.drawLine(getWorld().mapX(coor.x), getWorld().mapY(coor.y),
|
||||
0.0, getWorld().mapX(coorEnd.x),
|
||||
getWorld().mapY(coorEnd.y), 0.0,
|
||||
SkewTConstants.pressureColor, 1);
|
||||
s = SkewTConstants.pressFormat.format(SkewTConstants.MAN_LEVELS[i]);
|
||||
if (i != 0 && (SkewTConstants.MAN_LEVELS[i] % 100 == 0)) {
|
||||
target.drawString(smallFont, s, getWorld().mapX(
|
||||
SkewTConstants.center),
|
||||
getWorld().mapY(
|
||||
WxMath.getSkewTXY(SkewTConstants.MAN_LEVELS[i],
|
||||
-35).y), 0.0,
|
||||
IGraphicsTarget.TextStyle.BLANKED,
|
||||
SkewTConstants.pressureColor,
|
||||
IGraphicsTarget.HorizontalAlignment.CENTER,
|
||||
IGraphicsTarget.VerticalAlignment.MIDDLE, null);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* draw side bar lines
|
||||
*/
|
||||
private void drawSideLines(IGraphicsTarget target) {
|
||||
|
||||
try {
|
||||
target.drawLine(getWorld().mapX(SkewTConstants.left), getWorld()
|
||||
.mapY(SkewTConstants.bottom), 0.0, getWorld().mapX(
|
||||
SkewTConstants.left), getWorld().mapY(SkewTConstants.top),
|
||||
0.0, SkewTConstants.pressureColor, 1);
|
||||
|
||||
target.drawLine(getWorld().mapX(SkewTConstants.right), getWorld()
|
||||
.mapY(SkewTConstants.bottom), 0.0, getWorld().mapX(
|
||||
SkewTConstants.right), getWorld().mapY(SkewTConstants.top),
|
||||
0.0, SkewTConstants.pressureColor, 1);
|
||||
|
||||
} catch (VizException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Draws a particular line at the intersection of two lines.
|
||||
*
|
||||
* @param line1
|
||||
* @param line2
|
||||
* @param s
|
||||
* @throws VizException
|
||||
*/
|
||||
private void drawLabelAtLineIntersections(IGraphicsTarget target,
|
||||
Line2D.Double line1, Line2D.Double line2, String s)
|
||||
throws VizException {
|
||||
Point2D.Double point = null;
|
||||
if ((point = getLineIntersection(line1, line2)) != null) {
|
||||
target.drawString(smallFont, s, point.x, point.y, 0.0,
|
||||
IGraphicsTarget.TextStyle.BLANKED,
|
||||
SkewTConstants.labelColor,
|
||||
IGraphicsTarget.HorizontalAlignment.CENTER, null);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the point that two lines instersect, or null if they do not.
|
||||
*
|
||||
* @param l1
|
||||
* @param l2
|
||||
* @return
|
||||
*/
|
||||
private Point2D.Double getLineIntersection(Line2D.Double l1,
|
||||
Line2D.Double l2) {
|
||||
if (!l1.intersectsLine(l2)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Point2D.Double intersection = new Point2D.Double();
|
||||
double x1 = l1.getX1(), y1 = l1.getY1(), x2 = l1.getX2(), y2 = l1
|
||||
.getY2(), x3 = l2.getX1(), y3 = l2.getY1(), x4 = l2.getX2(), y4 = l2
|
||||
.getY2();
|
||||
|
||||
intersection.x = det(det(x1, y1, x2, y2), x1 - x2, det(x3, y3, x4, y4),
|
||||
x3 - x4)
|
||||
/ det(x1 - x2, y1 - y2, x3 - x4, y3 - y4);
|
||||
intersection.y = det(det(x1, y1, x2, y2), y1 - y2, det(x3, y3, x4, y4),
|
||||
y3 - y4)
|
||||
/ det(x1 - x2, y1 - y2, x3 - x4, y3 - y4);
|
||||
|
||||
return intersection;
|
||||
}
|
||||
|
||||
private double det(double a, double b, double c, double d) {
|
||||
return a * d - b * c;
|
||||
}
|
||||
|
||||
/**
|
||||
* Draws the mixing ratio lines.
|
||||
*
|
||||
* @throws VizException
|
||||
*/
|
||||
private void drawMixingRatios(IGraphicsTarget target,
|
||||
PaintProperties paintProperties) throws VizException {
|
||||
// get the location of the 825 pressure line...
|
||||
Coordinate coorStart = WxMath.getSkewTXY(850, -50);
|
||||
Coordinate coorEnd = WxMath.getSkewTXY(850, 50);
|
||||
|
||||
double startX = getWorld().mapX(coorStart.x);
|
||||
double startY = getWorld().mapY(coorStart.y);
|
||||
|
||||
double endX = getWorld().mapX(coorEnd.x);
|
||||
double endY = getWorld().mapY(coorEnd.y);
|
||||
|
||||
Line2D.Double line = new Line2D.Double(startX, startY, endX, endY);
|
||||
|
||||
double zoomLevel = paintProperties.getZoomLevel();
|
||||
double[] mixingRatios = getMixingRatios(zoomLevel);
|
||||
for (double ratio : mixingRatios) {
|
||||
UAPoint p1 = new UAPoint();
|
||||
p1.pressure = 1000;
|
||||
p1.temperature = Equations
|
||||
.invMixingRatio(p1.pressure, ratio / 1000);
|
||||
|
||||
UAPoint p2 = new UAPoint();
|
||||
p2.pressure = 400;
|
||||
p2.temperature = Equations
|
||||
.invMixingRatio(p2.pressure, ratio / 1000);
|
||||
Coordinate coor1 = WxMath.getSkewTXY(p1.pressure,
|
||||
p1.temperature - 273.15);
|
||||
Coordinate coor2 = WxMath.getSkewTXY(p2.pressure,
|
||||
p2.temperature - 273.15);
|
||||
target.drawLine(getWorld().mapX(coor1.x), getWorld().mapY(coor1.y),
|
||||
0.0, getWorld().mapX(coor2.x), getWorld().mapY(coor2.y),
|
||||
0.0, SkewTConstants.mixingRatioColor, 1,
|
||||
IGraphicsTarget.LineStyle.DASHED);
|
||||
|
||||
drawLabelAtLineIntersections(target, line, new Line2D.Double(
|
||||
getWorld().mapX(coor1.x), getWorld().mapY(coor1.y),
|
||||
getWorld().mapX(coor2.x), getWorld().mapY(coor2.y)), Double
|
||||
.toString((ratio)));
|
||||
}
|
||||
}
|
||||
|
||||
private double[] getMixingRatios(double zoomLevel) {
|
||||
|
||||
double[][] ratios = {
|
||||
{ .5, 1, 2, 5, 10, 20, 50 },
|
||||
{ .3, .5, 1, 2, 3, 5, 8, 12, 20, 30, 50 },
|
||||
|
||||
{ 2, 2.5, 3, 3.5, 4, 4.5, 5, 5.5, 6, 7, 8, 9, 10, 11, 12, 14,
|
||||
16, 18, 20, 24, 28, 32, 36, 40, 45, 50 },
|
||||
{ 1.4, 1.6, 1.8, 2, 2.4, 2.8, 3.2, 3.6, 4, 4.5, 5, 5.5, 6, 7,
|
||||
8, 9, 10, 11, 12, 14, 16, 18 },
|
||||
{ .1, .2, .3, .4, .5, .6, .8, .7, .8, .9, 1, 1.1, 1.2, 1.4,
|
||||
1.6, 1.8, 2, 2.4, 2.8, 3.2, 3.6, 4, 4.5, 5, 5.5, 6 },
|
||||
{ .1, .2, .3, .4, .5, .6, .8, 1, 1.2, 1.6, 2, 2.5, 3, 4, 5, 6,
|
||||
8, 10, 12, 16, 20, 25, 30, 40, 50 },
|
||||
{ .1, .2, .3, .5, .7, 1, 1.5, 2, 3, 5, 7, 10, 15, 20, 30, 50 },
|
||||
|
||||
{ .3, 1, 3, 10, 30 }, { .1, 1, 10 } };
|
||||
|
||||
if (zoomLevel == 1) {
|
||||
return ratios[0];
|
||||
}
|
||||
if (zoomLevel >= .70) {
|
||||
return ratios[1];
|
||||
}
|
||||
return ratios[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintInternal(IGraphicsTarget target, PaintProperties paintProps)
|
||||
throws VizException {
|
||||
|
||||
PixelExtent pe = new PixelExtent(this.rectangle);
|
||||
|
||||
target.setupClippingPlane(pe);
|
||||
|
||||
drawAdiabats(target);
|
||||
drawTempLines(target);
|
||||
drawPressureLines(target);
|
||||
drawMixingRatios(target, paintProps);
|
||||
drawSideLines(target);
|
||||
|
||||
target.clearClippingPlane();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.viz.skewt.ui.AbstractSkewTBackground#computeWorld()
|
||||
*/
|
||||
@Override
|
||||
protected WGraphics computeWorld() {
|
||||
|
||||
WGraphics world = new WGraphics(this.rectangle);
|
||||
|
||||
world.setWorldCoordinates(SkewTConstants.left, SkewTConstants.top,
|
||||
SkewTConstants.right, SkewTConstants.bottom);
|
||||
|
||||
return world;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,933 +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.viz.skewt.ui;
|
||||
|
||||
/**
|
||||
* SkewTControlsDlg.java Nov 28, 2007
|
||||
*
|
||||
* <pre>
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Nov 28, 2007 Lee Venable Initial Creation
|
||||
* Nov 29, 2007 Eric Babin Updated for D2D look and feel.
|
||||
* Tied in fuctions back to SkewtDisplay.
|
||||
* 09Sept2008 dhladky Made interactive.
|
||||
* 09Jan2009 dhladky hardened it for release.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author ebabin
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
import javax.measure.converter.UnitConverter;
|
||||
import javax.measure.unit.NonSI;
|
||||
import javax.measure.unit.SI;
|
||||
|
||||
import org.eclipse.jface.dialogs.MessageDialog;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.SelectionAdapter;
|
||||
import org.eclipse.swt.events.SelectionEvent;
|
||||
import org.eclipse.swt.graphics.Point;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.layout.GridLayout;
|
||||
import org.eclipse.swt.widgets.Button;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Control;
|
||||
import org.eclipse.swt.widgets.FileDialog;
|
||||
import org.eclipse.swt.widgets.Group;
|
||||
import org.eclipse.swt.widgets.Label;
|
||||
import org.eclipse.swt.widgets.Menu;
|
||||
import org.eclipse.swt.widgets.MenuItem;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.swt.widgets.Text;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
|
||||
import com.raytheon.uf.common.sounding.SoundingLayer;
|
||||
import com.raytheon.uf.common.sounding.ParcelLift.PARCEL_TYPE;
|
||||
import com.raytheon.uf.viz.core.drawables.ResourcePair;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.rsc.ResourceList;
|
||||
import com.raytheon.viz.skewt.SkewTDescriptor;
|
||||
import com.raytheon.viz.skewt.SkewtDisplay;
|
||||
import com.raytheon.viz.skewt.rsc.InteractiveSkewTResource;
|
||||
import com.raytheon.viz.ui.dialogs.CaveJFACEDialog;
|
||||
import com.raytheon.viz.ui.editor.AbstractEditor;
|
||||
|
||||
public class SkewtControlsDialog extends CaveJFACEDialog {
|
||||
|
||||
private static final UnitConverter celciusToFahrenheit = SI.CELSIUS
|
||||
.getConverterTo(NonSI.FAHRENHEIT);
|
||||
|
||||
private static final UnitConverter celciusToKelvin = SI.CELSIUS
|
||||
.getConverterTo(SI.KELVIN);
|
||||
|
||||
private static final UnitConverter metersPerSecondToKnots = SI.METERS_PER_SECOND
|
||||
.getConverterTo(NonSI.KNOT);
|
||||
|
||||
protected static final UnitConverter fahrenheitToCelcius = NonSI.FAHRENHEIT
|
||||
.getConverterTo(SI.CELSIUS);
|
||||
|
||||
protected static final UnitConverter knotsToMetersPerSecond = NonSI.KNOT
|
||||
.getConverterTo(SI.METERS_PER_SECOND);
|
||||
|
||||
public String dialogTitle;
|
||||
|
||||
private Composite top = null;
|
||||
|
||||
private String modelName;
|
||||
|
||||
private Button pmaxRdo;
|
||||
|
||||
private Button surfaceRdo;
|
||||
|
||||
private Button meanTempRdo;
|
||||
|
||||
private Button userSelectRdo;
|
||||
|
||||
private Button useFcstMaxChk;
|
||||
|
||||
private Text userSelectTF;
|
||||
|
||||
private Button liftParcelBtn;
|
||||
|
||||
private Text pTempTF;
|
||||
|
||||
private Text tTempTF;
|
||||
|
||||
private Text tdTempTF;
|
||||
|
||||
private Button celsiusRdo;
|
||||
|
||||
private Button fahrenheitRdo;
|
||||
|
||||
private Button addPntSkewtBtn;
|
||||
|
||||
private Text pSpdTF;
|
||||
|
||||
private Text dirSpdTF;
|
||||
|
||||
private Text spdSpdTF;
|
||||
|
||||
private Button ktsRdo;
|
||||
|
||||
private Button msRdo;
|
||||
|
||||
private Button addPntHodoBtn;
|
||||
|
||||
private Button helicityStormChk;
|
||||
|
||||
private Button wetBulbChk;
|
||||
|
||||
private Button resetHodoSkewtBtn;
|
||||
|
||||
private boolean isParcel = false;
|
||||
|
||||
private String pressureError = "Pressure must be between 973 mb && 100 mb";
|
||||
|
||||
private String tempDwptError = "Temp && dewpoint must be between -115 && 45 deg C (-175 && 113 deg F)";
|
||||
|
||||
private String windDirectionError = "Wind direction must be between 0 && 360 deg";
|
||||
|
||||
private String windSpeedError = "Wind speed must be between 0 && 250 kts (0 & 129 m/s)";
|
||||
|
||||
private SkewtDisplay theDisplay = null;
|
||||
|
||||
static private SkewtControlsDialog instance = null;
|
||||
|
||||
private static Double PRESSURE_MAX = 973.0;
|
||||
|
||||
private static Double PRESSURE_MIN = 100.0;
|
||||
|
||||
private static PARCEL_TYPE ptype;
|
||||
|
||||
private Shell shell = null;
|
||||
|
||||
InteractiveSkewTResource rsc = null;
|
||||
|
||||
AbstractEditor editor = null;
|
||||
|
||||
// make it a singleton
|
||||
public static SkewtControlsDialog getInstance(Shell parShell,
|
||||
String modelName) {
|
||||
if (instance == null) {
|
||||
try {
|
||||
instance = new SkewtControlsDialog(parShell, modelName); // ,
|
||||
// display);
|
||||
} catch (VizException ve) {
|
||||
ve.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
return instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Skew-T control default constructor.
|
||||
*
|
||||
* @param parShell
|
||||
* @param modelName
|
||||
* @param SkewtDisplay
|
||||
* @throws VizException
|
||||
*/
|
||||
private SkewtControlsDialog(Shell parShell, String modelName)
|
||||
throws VizException {
|
||||
super(parShell);
|
||||
shell = parShell;
|
||||
this.setShellStyle(SWT.TITLE | SWT.MODELESS | SWT.CLOSE);
|
||||
this.modelName = modelName;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets
|
||||
* .Composite)
|
||||
*/
|
||||
@Override
|
||||
public Control createDialogArea(Composite parent) {
|
||||
top = (Composite) super.createDialogArea(parent);
|
||||
|
||||
// Create the main layout for the shell.
|
||||
GridLayout mainLayout = new GridLayout(1, false);
|
||||
mainLayout.marginHeight = 3;
|
||||
mainLayout.marginWidth = 3;
|
||||
top.setLayout(mainLayout);
|
||||
|
||||
// Initialize all of the menus, controls, and layouts
|
||||
initializeComponents();
|
||||
|
||||
return top;
|
||||
}
|
||||
|
||||
private void initializeComponents() {
|
||||
|
||||
createMenus();
|
||||
createModelName();
|
||||
createLiftingMethod();
|
||||
createAddChangePointSkewT();
|
||||
createAddChangePointHodograph();
|
||||
createAdditionalInformation();
|
||||
createRestoreOriginalData();
|
||||
getRsc();
|
||||
ptype = rsc.getPtype();
|
||||
switch (ptype) {
|
||||
case PMAX:
|
||||
pmaxRdo.setSelection(true);
|
||||
break;
|
||||
case USERSELECT:
|
||||
userSelectRdo.setSelection(true);
|
||||
break;
|
||||
case SURFACE:
|
||||
surfaceRdo.setSelection(true);
|
||||
useFcstMaxChk.setEnabled(true);
|
||||
useFcstMaxChk.setSelection(rsc.getFcstMax());
|
||||
break;
|
||||
case MEANTEMP:
|
||||
meanTempRdo.setSelection(true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* create the Menu bar
|
||||
*/
|
||||
private void createMenus() {
|
||||
Menu menuBar = new Menu(this.getShell(), SWT.BAR);
|
||||
createFileMenu(menuBar);
|
||||
this.getShell().setMenuBar(menuBar);
|
||||
}
|
||||
|
||||
/**
|
||||
* file operations menu
|
||||
*/
|
||||
private void createFileMenu(Menu menuBar) {
|
||||
MenuItem fileI = new MenuItem(menuBar, SWT.CASCADE);
|
||||
fileI.setText("File");
|
||||
|
||||
Menu fileMenu = new Menu(menuBar);
|
||||
fileI.setMenu(fileMenu);
|
||||
|
||||
// Open file menu item
|
||||
MenuItem openMI = new MenuItem(fileMenu, SWT.NONE);
|
||||
openMI.setText("&Open\tCtrl+O");
|
||||
openMI.setAccelerator(SWT.CTRL + 'O');
|
||||
openMI.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
FileDialog fd = new FileDialog(shell, SWT.OPEN);
|
||||
String path = fd.open();
|
||||
if (path == null) {
|
||||
return;
|
||||
}
|
||||
rsc.loadSounding(path);
|
||||
}
|
||||
});
|
||||
|
||||
// Save file menu item
|
||||
MenuItem saveMI = new MenuItem(fileMenu, SWT.NONE);
|
||||
saveMI.setText("&Save\tCtrl+S");
|
||||
saveMI.setAccelerator(SWT.CTRL + 'S');
|
||||
saveMI.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
FileDialog fd = new FileDialog(shell, SWT.SAVE);
|
||||
String path = fd.open();
|
||||
if (path == null) {
|
||||
return;
|
||||
}
|
||||
rsc.saveSounding(path);
|
||||
}
|
||||
});
|
||||
|
||||
// Save as... file menu item
|
||||
MenuItem saveasMI = new MenuItem(fileMenu, SWT.NONE);
|
||||
saveasMI.setText("Save &As...");
|
||||
saveasMI.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
FileDialog fd = new FileDialog(shell, SWT.SAVE);
|
||||
String path = fd.open();
|
||||
if (path == null) {
|
||||
return;
|
||||
}
|
||||
rsc.saveSounding(path);
|
||||
}
|
||||
});
|
||||
|
||||
// Exit menu item
|
||||
MenuItem exitMI = new MenuItem(fileMenu, SWT.NONE);
|
||||
exitMI.setText("E&xit\tCtrl+X");
|
||||
exitMI.setAccelerator(SWT.CTRL + 'X');
|
||||
exitMI.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
close();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* create model name.
|
||||
*/
|
||||
private void createModelName() {
|
||||
Composite labelComp = new Composite(top, SWT.NONE);
|
||||
GridLayout gl = new GridLayout(2, false);
|
||||
labelComp.setLayout(gl);
|
||||
|
||||
createCenteredLabel(labelComp, 2, modelName);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.jface.dialogs.Dialog#createButtonsForButtonBar(org.eclipse
|
||||
* .swt.widgets.Composite)
|
||||
*/
|
||||
@Override
|
||||
protected void createButtonsForButtonBar(Composite parent) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
/**
|
||||
* Create centered Label.
|
||||
*
|
||||
* @param c
|
||||
* @param numCols
|
||||
* @param text
|
||||
* @return Label
|
||||
*/
|
||||
private Label createCenteredLabel(Composite c, int numCols, String text) {
|
||||
Label label = new Label(c, SWT.NONE | SWT.CENTER);
|
||||
label.setText(text);
|
||||
|
||||
GridData gridData = new GridData();
|
||||
gridData.grabExcessHorizontalSpace = true;
|
||||
gridData.grabExcessVerticalSpace = true;
|
||||
gridData.horizontalSpan = numCols;
|
||||
gridData.horizontalAlignment = GridData.FILL;
|
||||
gridData.verticalAlignment = GridData.FILL;
|
||||
label.setLayoutData(gridData);
|
||||
|
||||
return label;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the lifting method.
|
||||
*/
|
||||
private void createLiftingMethod() {
|
||||
GridData gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
|
||||
Group liftingGroup = new Group(top, SWT.NONE);
|
||||
|
||||
GridLayout gl = new GridLayout(2, false);
|
||||
gl.horizontalSpacing = 10;
|
||||
liftingGroup.setLayout(gl);
|
||||
liftingGroup.setLayoutData(gd);
|
||||
|
||||
createCenteredLabel(liftingGroup, 2, "Lifting Method");
|
||||
|
||||
pmaxRdo = new Button(liftingGroup, SWT.RADIO);
|
||||
pmaxRdo.setText("PMAX");
|
||||
pmaxRdo.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
if (pmaxRdo.getSelection() == true) {
|
||||
ptype = PARCEL_TYPE.PMAX;
|
||||
useFcstMaxChk.setSelection(false);
|
||||
useFcstMaxChk.setEnabled(false);
|
||||
rsc.setFcstMax(false);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// filler
|
||||
new Label(liftingGroup, SWT.NONE);
|
||||
|
||||
surfaceRdo = new Button(liftingGroup, SWT.RADIO);
|
||||
surfaceRdo.setText("Surface");
|
||||
surfaceRdo.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
if (surfaceRdo.getSelection() == true) {
|
||||
ptype = PARCEL_TYPE.SURFACE;
|
||||
useFcstMaxChk.setEnabled(true);
|
||||
useFcstMaxChk.setSelection(rsc.getFcstMax());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
useFcstMaxChk = new Button(liftingGroup, SWT.CHECK);
|
||||
useFcstMaxChk.setText("Use Fcst Max Temp");
|
||||
useFcstMaxChk.setEnabled(false);
|
||||
useFcstMaxChk.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
if (useFcstMaxChk.getSelection() == true) {
|
||||
rsc.setFcstMax(true);
|
||||
} else {
|
||||
rsc.setFcstMax(false);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
meanTempRdo = new Button(liftingGroup, SWT.RADIO);
|
||||
meanTempRdo.setText("Mean Temp");
|
||||
meanTempRdo.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
if (meanTempRdo.getSelection() == true) {
|
||||
ptype = PARCEL_TYPE.MEANTEMP;
|
||||
useFcstMaxChk.setSelection(false);
|
||||
useFcstMaxChk.setEnabled(false);
|
||||
rsc.setFcstMax(false);
|
||||
}
|
||||
}
|
||||
});
|
||||
// filler
|
||||
new Label(liftingGroup, SWT.NONE);
|
||||
|
||||
userSelectRdo = new Button(liftingGroup, SWT.RADIO);
|
||||
userSelectRdo.setText("User Select");
|
||||
userSelectRdo.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
if (userSelectRdo.getSelection() == true) {
|
||||
userSelectTF.setEnabled(true);
|
||||
ptype = PARCEL_TYPE.USERSELECT;
|
||||
useFcstMaxChk.setSelection(false);
|
||||
useFcstMaxChk.setEnabled(false);
|
||||
rsc.setFcstMax(false);
|
||||
} else {
|
||||
userSelectTF.setEnabled(false);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
gd = new GridData(80, SWT.DEFAULT);
|
||||
userSelectTF = new Text(liftingGroup, SWT.BORDER);
|
||||
userSelectTF.setLayoutData(gd);
|
||||
userSelectTF.setEnabled(false);
|
||||
|
||||
gd = new GridData(SWT.CENTER, SWT.DEFAULT, true, false);
|
||||
gd.horizontalSpan = 2;
|
||||
gd.widthHint = 150;
|
||||
liftParcelBtn = new Button(liftingGroup, SWT.PUSH);
|
||||
liftParcelBtn.setText("Lift Parcel");
|
||||
liftParcelBtn.setLayoutData(gd);
|
||||
|
||||
liftParcelBtn.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
isParcel = true;
|
||||
if (!ptype.equals(PARCEL_TYPE.USERSELECT)) {
|
||||
rsc.changeParcel(ptype, 0);
|
||||
} else {
|
||||
rsc.changeParcel(ptype, Float.parseFloat(userSelectTF
|
||||
.getText()));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void createAddChangePointSkewT() {
|
||||
GridData gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
|
||||
Group addChangeGroup = new Group(top, SWT.NONE);
|
||||
GridLayout gl = new GridLayout(3, false);
|
||||
gl.horizontalSpacing = 10;
|
||||
addChangeGroup.setLayout(gl);
|
||||
addChangeGroup.setLayoutData(gd);
|
||||
|
||||
int lblTextWidth = 75;
|
||||
|
||||
createCenteredLabel(addChangeGroup, 3, "Add/Change Point to Skew-T");
|
||||
gd = new GridData(lblTextWidth, SWT.DEFAULT);
|
||||
Label pLbl = new Label(addChangeGroup, SWT.CENTER);
|
||||
pLbl.setText("P:");
|
||||
pLbl.setLayoutData(gd);
|
||||
|
||||
gd = new GridData(lblTextWidth, SWT.DEFAULT);
|
||||
Label tLbl = new Label(addChangeGroup, SWT.CENTER);
|
||||
tLbl.setText("T:");
|
||||
tLbl.setLayoutData(gd);
|
||||
|
||||
gd = new GridData(lblTextWidth, SWT.DEFAULT);
|
||||
Label tdLbl = new Label(addChangeGroup, SWT.CENTER);
|
||||
tdLbl.setText("Td:");
|
||||
tdLbl.setLayoutData(gd);
|
||||
|
||||
gd = new GridData(lblTextWidth, SWT.DEFAULT);
|
||||
pTempTF = new Text(addChangeGroup, SWT.BORDER);
|
||||
pTempTF.setLayoutData(gd);
|
||||
|
||||
gd = new GridData(lblTextWidth, SWT.DEFAULT);
|
||||
tTempTF = new Text(addChangeGroup, SWT.BORDER);
|
||||
tTempTF.setLayoutData(gd);
|
||||
|
||||
gd = new GridData(lblTextWidth, SWT.DEFAULT);
|
||||
tdTempTF = new Text(addChangeGroup, SWT.BORDER);
|
||||
tdTempTF.setLayoutData(gd);
|
||||
|
||||
gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
|
||||
gd.horizontalSpan = 3;
|
||||
Label tempsLbl = new Label(addChangeGroup, SWT.CENTER);
|
||||
tempsLbl.setText("Temps Entered As:");
|
||||
tempsLbl.setLayoutData(gd);
|
||||
|
||||
gd = new GridData(SWT.CENTER, SWT.DEFAULT, true, false);
|
||||
gd.horizontalSpan = 3;
|
||||
gd.widthHint = 100;
|
||||
celsiusRdo = new Button(addChangeGroup, SWT.RADIO);
|
||||
celsiusRdo.setText("Celsius");
|
||||
celsiusRdo.setLayoutData(gd);
|
||||
celsiusRdo.setSelection(true);
|
||||
|
||||
gd = new GridData(SWT.CENTER, SWT.DEFAULT, true, false);
|
||||
gd.horizontalSpan = 3;
|
||||
gd.widthHint = 100;
|
||||
fahrenheitRdo = new Button(addChangeGroup, SWT.RADIO);
|
||||
fahrenheitRdo.setText("Fahrenheit");
|
||||
fahrenheitRdo.setLayoutData(gd);
|
||||
|
||||
gd = new GridData(SWT.CENTER, SWT.DEFAULT, true, false);
|
||||
gd.horizontalSpan = 3;
|
||||
gd.widthHint = 175;
|
||||
addPntSkewtBtn = new Button(addChangeGroup, SWT.PUSH);
|
||||
addPntSkewtBtn.setText("Add Point to Skew-T");
|
||||
addPntSkewtBtn.setLayoutData(gd);
|
||||
addPntSkewtBtn.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
|
||||
double min = SkewTConstants.TEMPERATURE_MIN;
|
||||
double max = SkewTConstants.TEMPERATURE_MAX;
|
||||
|
||||
double press = SoundingLayer.MISSING;
|
||||
double temp = SoundingLayer.MISSING;
|
||||
double dwpt = SoundingLayer.MISSING;
|
||||
|
||||
if (fahrenheitRdo.getSelection() == true) {
|
||||
min = celciusToFahrenheit
|
||||
.convert(SkewTConstants.TEMPERATURE_MIN);
|
||||
max = celciusToFahrenheit
|
||||
.convert(SkewTConstants.TEMPERATURE_MAX);
|
||||
}
|
||||
|
||||
press = fieldIsValid(pTempTF, PRESSURE_MIN, PRESSURE_MAX,
|
||||
pressureError);
|
||||
temp = fieldIsValid(tTempTF, min, max, tempDwptError);
|
||||
dwpt = fieldIsValid(tdTempTF, min, max, tempDwptError);
|
||||
|
||||
if ((press != SoundingLayer.MISSING
|
||||
&& temp != SoundingLayer.MISSING && dwpt != SoundingLayer.MISSING)) {
|
||||
|
||||
if (fahrenheitRdo.getSelection() == true) {
|
||||
dwpt = fahrenheitToCelcius.convert(dwpt);
|
||||
temp = fahrenheitToCelcius.convert(temp);
|
||||
}
|
||||
// Layer values need to be in Kelvin
|
||||
dwpt = celciusToKelvin.convert(dwpt);
|
||||
temp = celciusToKelvin.convert(temp);
|
||||
|
||||
// can't happen
|
||||
if (dwpt > temp) {
|
||||
MessageDialog.openError(new Shell(), "Error on field",
|
||||
"Dewpoint can't exceed Temperature");
|
||||
tdTempTF.setFocus();
|
||||
} else {
|
||||
rsc.addSkewtPointAction(press, temp, dwpt);
|
||||
resetFields();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Changing a point on the Hodo.
|
||||
*/
|
||||
private void createAddChangePointHodograph() {
|
||||
GridData gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
|
||||
Group addChangeGroup = new Group(top, SWT.NONE);
|
||||
|
||||
GridLayout gl = new GridLayout(3, false);
|
||||
gl.horizontalSpacing = 10;
|
||||
addChangeGroup.setLayout(gl);
|
||||
addChangeGroup.setLayoutData(gd);
|
||||
|
||||
createCenteredLabel(addChangeGroup, 3, "Add/Change Point to Hodograph");
|
||||
|
||||
int lblTextWidth = 75;
|
||||
|
||||
gd = new GridData(lblTextWidth, SWT.DEFAULT);
|
||||
Label pLbl = new Label(addChangeGroup, SWT.CENTER);
|
||||
pLbl.setText("P:");
|
||||
pLbl.setLayoutData(gd);
|
||||
|
||||
gd = new GridData(lblTextWidth, SWT.DEFAULT);
|
||||
Label dirLbl = new Label(addChangeGroup, SWT.CENTER);
|
||||
dirLbl.setText("Dir:");
|
||||
dirLbl.setLayoutData(gd);
|
||||
|
||||
gd = new GridData(lblTextWidth, SWT.DEFAULT);
|
||||
Label speedLbl = new Label(addChangeGroup, SWT.CENTER);
|
||||
speedLbl.setText("Spd:");
|
||||
speedLbl.setLayoutData(gd);
|
||||
|
||||
gd = new GridData(lblTextWidth, SWT.DEFAULT);
|
||||
pSpdTF = new Text(addChangeGroup, SWT.BORDER);
|
||||
pSpdTF.setLayoutData(gd);
|
||||
|
||||
gd = new GridData(lblTextWidth, SWT.DEFAULT);
|
||||
dirSpdTF = new Text(addChangeGroup, SWT.BORDER);
|
||||
dirSpdTF.setLayoutData(gd);
|
||||
|
||||
gd = new GridData(lblTextWidth, SWT.DEFAULT);
|
||||
spdSpdTF = new Text(addChangeGroup, SWT.BORDER);
|
||||
spdSpdTF.setLayoutData(gd);
|
||||
|
||||
gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
|
||||
gd.horizontalSpan = 3;
|
||||
Label tempsLbl = new Label(addChangeGroup, SWT.CENTER);
|
||||
tempsLbl.setText("Speed Entered As:");
|
||||
tempsLbl.setLayoutData(gd);
|
||||
|
||||
gd = new GridData(SWT.CENTER, SWT.DEFAULT, true, false);
|
||||
gd.horizontalSpan = 3;
|
||||
gd.widthHint = 100;
|
||||
ktsRdo = new Button(addChangeGroup, SWT.RADIO);
|
||||
ktsRdo.setText("kts");
|
||||
ktsRdo.setLayoutData(gd);
|
||||
ktsRdo.setSelection(true);
|
||||
|
||||
gd = new GridData(SWT.CENTER, SWT.DEFAULT, true, false);
|
||||
gd.horizontalSpan = 3;
|
||||
gd.widthHint = 100;
|
||||
msRdo = new Button(addChangeGroup, SWT.RADIO);
|
||||
msRdo.setText("m/s");
|
||||
msRdo.setLayoutData(gd);
|
||||
|
||||
gd = new GridData(SWT.CENTER, SWT.DEFAULT, true, false);
|
||||
gd.horizontalSpan = 3;
|
||||
gd.widthHint = 200;
|
||||
addPntHodoBtn = new Button(addChangeGroup, SWT.PUSH);
|
||||
addPntHodoBtn.setText("Add Point to Hodograph");
|
||||
addPntHodoBtn.setLayoutData(gd);
|
||||
|
||||
addPntHodoBtn.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
|
||||
double max = SkewTConstants.WIND_SPEED_MAX;
|
||||
double min = SkewTConstants.WIND_SPEED_MIN;
|
||||
|
||||
double press = SoundingLayer.MISSING;
|
||||
double spd = SoundingLayer.MISSING;
|
||||
double dir = SoundingLayer.MISSING;
|
||||
|
||||
if (msRdo.getSelection()) {
|
||||
max = knotsToMetersPerSecond
|
||||
.convert(SkewTConstants.WIND_SPEED_MAX);
|
||||
}
|
||||
|
||||
press = fieldIsValid(pSpdTF, PRESSURE_MIN, PRESSURE_MAX,
|
||||
pressureError);
|
||||
dir = fieldIsValid(dirSpdTF, SkewTConstants.WIND_DIR_MIN,
|
||||
SkewTConstants.WIND_DIR_MAX, windDirectionError);
|
||||
spd = fieldIsValid(spdSpdTF, min, max, windSpeedError);
|
||||
|
||||
if ((press != SoundingLayer.MISSING
|
||||
&& spd != SoundingLayer.MISSING && dir != SoundingLayer.MISSING)) {
|
||||
|
||||
if (ktsRdo.getSelection()) {
|
||||
// Speed must be in m/s to add new layer
|
||||
spd = knotsToMetersPerSecond.convert(spd);
|
||||
}
|
||||
rsc.addChangePointAction(press, spd, dir);
|
||||
resetFields();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Is the field valid?
|
||||
*
|
||||
* @param theField
|
||||
* @param minimum
|
||||
* @param max
|
||||
* @param errorMsg
|
||||
* @return double
|
||||
*/
|
||||
private double fieldIsValid(Text theField, double minimum, double max,
|
||||
String errorMsg) {
|
||||
double value = SoundingLayer.MISSING;
|
||||
|
||||
try {
|
||||
value = Integer.parseInt(theField.getText());
|
||||
if ((value < minimum) || value > max) {
|
||||
MessageDialog
|
||||
.openError(new Shell(), "Error on field", errorMsg);
|
||||
theField.setFocus();
|
||||
return SoundingLayer.MISSING;
|
||||
}
|
||||
} catch (NumberFormatException nfe) {
|
||||
MessageDialog.openError(new Shell(), "Error on field", errorMsg);
|
||||
|
||||
return SoundingLayer.MISSING;
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create additional information
|
||||
*/
|
||||
private void createAdditionalInformation() {
|
||||
GridData gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
|
||||
Group addInfoGroup = new Group(top, SWT.NONE);
|
||||
|
||||
GridLayout gl = new GridLayout(1, false);
|
||||
addInfoGroup.setLayout(gl);
|
||||
addInfoGroup.setLayoutData(gd);
|
||||
|
||||
createCenteredLabel(addInfoGroup, 3,
|
||||
"Additional Hodo/Skew-T Information");
|
||||
|
||||
gd = new GridData(SWT.CENTER, SWT.DEFAULT, true, false);
|
||||
gd.widthHint = 180;
|
||||
helicityStormChk = new Button(addInfoGroup, SWT.CHECK);
|
||||
helicityStormChk.setText("Helicity/Storm Inflow");
|
||||
helicityStormChk.setLayoutData(gd);
|
||||
helicityStormChk.setSelection(false);
|
||||
helicityStormChk.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
setStormInflow(((Button) e.getSource()).getSelection());
|
||||
}
|
||||
});
|
||||
|
||||
gd = new GridData(SWT.CENTER, SWT.DEFAULT, true, false);
|
||||
gd.widthHint = 180;
|
||||
wetBulbChk = new Button(addInfoGroup, SWT.CHECK);
|
||||
wetBulbChk.setText("Wet-bulb Temp Profile");
|
||||
wetBulbChk.setLayoutData(gd);
|
||||
wetBulbChk.setSelection(false);
|
||||
wetBulbChk.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
setWetBulb(((Button) e.getSource()).getSelection());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Create and restore original data.
|
||||
*/
|
||||
private void createRestoreOriginalData() {
|
||||
GridData gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
|
||||
Group restoreGroup = new Group(top, SWT.NONE);
|
||||
GridLayout gl = new GridLayout(2, true);
|
||||
restoreGroup.setLayout(gl);
|
||||
restoreGroup.setLayoutData(gd);
|
||||
|
||||
createCenteredLabel(restoreGroup, 2, "Restore to Original Data Profile");
|
||||
|
||||
gd = new GridData(SWT.CENTER, SWT.DEFAULT, true, false);
|
||||
gd.horizontalSpan = 2;
|
||||
gd.widthHint = 200;
|
||||
resetHodoSkewtBtn = new Button(restoreGroup, SWT.PUSH);
|
||||
resetHodoSkewtBtn.setText("Reset Data");
|
||||
resetHodoSkewtBtn.setLayoutData(gd);
|
||||
resetHodoSkewtBtn.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
resetSkewtAction();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets
|
||||
* .Shell)
|
||||
*/
|
||||
@Override
|
||||
protected void configureShell(Shell shell) {
|
||||
super.configureShell(shell);
|
||||
shell.setText("Skew-T Controls");
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.jface.dialogs.Dialog#getInitialSize()
|
||||
*/
|
||||
@Override
|
||||
protected Point getInitialSize() {
|
||||
return new Point(320, 835);
|
||||
}
|
||||
|
||||
/**
|
||||
* reset
|
||||
*/
|
||||
private void resetSkewtAction() {
|
||||
rsc.resetSounding();
|
||||
// if (this.theDisplay.getTheEditableSkewtResource().isEditable()) {
|
||||
// this.theDisplay.getTheEditableSkewtResource().getSounding().reset();
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
* reset the fields
|
||||
*/
|
||||
private void resetFields() {
|
||||
pTempTF.setText("");
|
||||
tTempTF.setText("");
|
||||
tdTempTF.setText("");
|
||||
pSpdTF.setText("");
|
||||
dirSpdTF.setText("");
|
||||
spdSpdTF.setText("");
|
||||
}
|
||||
|
||||
/**
|
||||
* wet bulb line draw
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public void setWetBulb(boolean wetBulb) {
|
||||
rsc.setWb(wetBulb);
|
||||
editor.refresh();
|
||||
}
|
||||
|
||||
/**
|
||||
* storm relative inflow line draw
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public void setStormInflow(boolean storm) {
|
||||
rsc.set_plotStorm(storm);
|
||||
editor.refresh();
|
||||
}
|
||||
|
||||
/**
|
||||
* override of close method
|
||||
*/
|
||||
@Override
|
||||
public boolean close() {
|
||||
if (rsc.isEditable() == true) {
|
||||
rsc.setEditable(false);
|
||||
isParcel = false;
|
||||
}
|
||||
return super.close();
|
||||
}
|
||||
|
||||
/**
|
||||
* A hard normal exit
|
||||
*/
|
||||
public void exit() {
|
||||
super.close();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the display you are using
|
||||
*
|
||||
* @return SkewTDisplay
|
||||
*/
|
||||
private SkewtDisplay getSkewtDisplay() {
|
||||
|
||||
editor = (AbstractEditor) PlatformUI.getWorkbench()
|
||||
.getActiveWorkbenchWindow().getActivePage().getActiveEditor();
|
||||
if (editor.getActiveDisplayPane().getDescriptor() instanceof SkewTDescriptor) {
|
||||
// the ordering in the editor is paramount here!!!!!
|
||||
if (editor.getActiveDisplayPane().getRenderableDisplay() instanceof SkewtDisplay) {
|
||||
return ((SkewtDisplay) (editor.getActiveDisplayPane()
|
||||
.getRenderableDisplay()));
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private InteractiveSkewTResource getRsc() {
|
||||
SkewtDisplay st = getSkewtDisplay();
|
||||
if (st == null) {
|
||||
return null;
|
||||
}
|
||||
ResourceList rl = st.getDescriptor().getResourceList();
|
||||
Iterator<?> it = rl.iterator();
|
||||
while (it.hasNext()) {
|
||||
ResourcePair rp = (ResourcePair) it.next();
|
||||
if (rp.getResource() instanceof InteractiveSkewTResource) {
|
||||
rsc = (InteractiveSkewTResource) rp.getResource();
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rsc;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,180 +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.viz.skewt.ui;
|
||||
|
||||
import org.eclipse.swt.graphics.Rectangle;
|
||||
|
||||
import com.raytheon.uf.common.sounding.WxMath;
|
||||
import com.raytheon.uf.viz.core.IGraphicsTarget;
|
||||
import com.raytheon.uf.viz.core.IGraphicsTarget.HorizontalAlignment;
|
||||
import com.raytheon.uf.viz.core.IGraphicsTarget.LineStyle;
|
||||
import com.raytheon.uf.viz.core.IGraphicsTarget.TextStyle;
|
||||
import com.raytheon.uf.viz.core.IGraphicsTarget.VerticalAlignment;
|
||||
import com.raytheon.uf.viz.core.drawables.IRenderable;
|
||||
import com.raytheon.uf.viz.core.drawables.PaintProperties;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.localization.HierarchicalPreferenceStore;
|
||||
import com.raytheon.viz.core.graphing.WGraphics;
|
||||
import com.raytheon.viz.skewt.Activator;
|
||||
|
||||
/**
|
||||
* Used to draw the temp change background.
|
||||
*
|
||||
* <pre>
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 28sep2008 #1529 dhladky redone.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author dhladky
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class TempChangeBackground extends AbstractSkewTBackground implements
|
||||
IRenderable {
|
||||
|
||||
private double pMin;
|
||||
|
||||
private double pMax;
|
||||
|
||||
private double deltaT;
|
||||
|
||||
/**
|
||||
* Public constructor
|
||||
*
|
||||
* @param target
|
||||
* @param world
|
||||
* @param paintProps
|
||||
* @throws VizException
|
||||
*/
|
||||
public TempChangeBackground() {
|
||||
super();
|
||||
|
||||
this.rectangle = new Rectangle(600, 730, 250, 480);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintInternal(IGraphicsTarget target, PaintProperties paintProps)
|
||||
throws VizException {
|
||||
|
||||
double left = getWorld().getViewXmin();
|
||||
double right = getWorld().getViewXmax();
|
||||
double top = getWorld().getViewYmin();
|
||||
double bottom = getWorld().getViewYmax();
|
||||
|
||||
double d = Math.pow(10, Math.ceil(Math.log10(deltaT))) - 1;
|
||||
String s = "- " + SkewTConstants.tempFormat.format(d);
|
||||
double labelWidth = target.getStringBounds(smallFont, s).getWidth()
|
||||
* paintProps.getZoomLevel();
|
||||
double dT = 1;
|
||||
while ((deltaT % dT != 0)
|
||||
|| (labelWidth > ((right - left) / 2 / deltaT * dT))) {
|
||||
dT++;
|
||||
}
|
||||
|
||||
for (double t = 0.0; t <= deltaT - dT; t += dT) {
|
||||
double x = getWorld().mapX(t);
|
||||
target.drawLine(x, bottom, 0.0, x, top, 0.0,
|
||||
SkewTConstants.backgroundColor, 1, LineStyle.DOTTED);
|
||||
target.drawString(smallFont, SkewTConstants.tempFormat.format(t),
|
||||
x, bottom, 0.0, TextStyle.NORMAL,
|
||||
SkewTConstants.labelColor, HorizontalAlignment.CENTER,
|
||||
VerticalAlignment.TOP, null);
|
||||
|
||||
if (t == 0) {
|
||||
continue;
|
||||
}
|
||||
x = getWorld().mapX(-t);
|
||||
target.drawLine(x, bottom, 0.0, x, top, 0.0,
|
||||
SkewTConstants.backgroundColor, 1, LineStyle.DOTTED);
|
||||
target.drawString(smallFont, SkewTConstants.tempFormat.format(-t),
|
||||
x, bottom, 0.0, TextStyle.NORMAL,
|
||||
SkewTConstants.labelColor, HorizontalAlignment.CENTER,
|
||||
VerticalAlignment.TOP, null);
|
||||
}
|
||||
double x = getWorld().mapX(-deltaT);
|
||||
target.drawLine(x, bottom, 0.0, x, top, 0.0,
|
||||
SkewTConstants.backgroundColor, 1, LineStyle.SOLID);
|
||||
target.drawString(smallFont, SkewTConstants.tempFormat.format(-deltaT),
|
||||
x, bottom, 0.0, TextStyle.NORMAL, SkewTConstants.labelColor,
|
||||
HorizontalAlignment.CENTER, VerticalAlignment.TOP, null);
|
||||
|
||||
x = getWorld().mapX(deltaT);
|
||||
target.drawLine(x, bottom, 0.0, x, top, 0.0,
|
||||
SkewTConstants.backgroundColor, 1, LineStyle.SOLID);
|
||||
target.drawString(smallFont, SkewTConstants.tempFormat.format(deltaT),
|
||||
x, bottom, 0.0, TextStyle.NORMAL, SkewTConstants.labelColor,
|
||||
HorizontalAlignment.CENTER, VerticalAlignment.TOP, null);
|
||||
|
||||
// draw pressure lines.
|
||||
double centerX = (left + right) / 2;
|
||||
for (double pressure : SkewTConstants.MAN_LEVELS) {
|
||||
if (pressure >= pMin && pressure <= pMax) {
|
||||
double y = getWorld().mapY(WxMath.getSkewTXY(pressure, 0).y);
|
||||
target.drawLine(left, y, 0.0, right, y, 0.0,
|
||||
SkewTConstants.pressureColor, 1);
|
||||
|
||||
if (pressure % 100 == 0) {
|
||||
target.drawString(smallFont, SkewTConstants.pressFormat
|
||||
.format(pressure), centerX, getWorld().mapY(
|
||||
WxMath.getSkewTXY(pressure, 0).y), 0.0,
|
||||
TextStyle.BLANKED, SkewTConstants.labelColor,
|
||||
HorizontalAlignment.CENTER,
|
||||
VerticalAlignment.MIDDLE, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
String label = "24 HR TEMP CHANGE";
|
||||
|
||||
target.drawString(smallFont, label, centerX, top, 0.0,
|
||||
TextStyle.NORMAL, SkewTConstants.labelColor,
|
||||
HorizontalAlignment.CENTER, VerticalAlignment.BOTTOM, null);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.viz.skewt.ui.AbstractSkewTBackground#computeWorld()
|
||||
*/
|
||||
@Override
|
||||
protected WGraphics computeWorld() {
|
||||
|
||||
HierarchicalPreferenceStore prefs = Activator.getDefault()
|
||||
.getPreferenceStore();
|
||||
|
||||
double d;
|
||||
pMin = ((d = prefs.getDouble("tempChange.pmin")) == 0.0 ? 300.0 : d);
|
||||
pMax = ((d = prefs.getDouble("tempChange.pmax")) == 0.0 ? 1050.0 : d);
|
||||
deltaT = ((d = prefs.getDouble("tempChange.deltaT")) == 0.0 ? 15.0 : d);
|
||||
|
||||
WGraphics world = new WGraphics(this.rectangle);
|
||||
|
||||
world.setWorldCoordinates(-deltaT, WxMath.getSkewTXY(pMin, 0).y,
|
||||
deltaT, WxMath.getSkewTXY(pMax, 0).y);
|
||||
|
||||
return world;
|
||||
}
|
||||
|
||||
}
|
|
@ -14,41 +14,27 @@ Require-Bundle: org.eclipse.ui,
|
|||
com.raytheon.uf.viz.xy.crosssection,
|
||||
com.raytheon.uf.viz.xy.timeheight,
|
||||
com.raytheon.uf.viz.xy.varheight,
|
||||
com.raytheon.viz.skewt,
|
||||
com.raytheon.viz.redbook,
|
||||
com.raytheon.viz.awipstools,
|
||||
com.raytheon.viz.grid,
|
||||
com.raytheon.viz.satellite,
|
||||
com.raytheon.viz.radar,
|
||||
com.raytheon.uf.viz.xy.timeseries,
|
||||
com.raytheon.uf.viz.xy,
|
||||
com.raytheon.uf.viz.objectiveanalysis,
|
||||
com.raytheon.uf.common.pointdata,
|
||||
com.raytheon.uf.common.serialization,
|
||||
net.sf.swtaddons;bundle-version="1.0.0",
|
||||
com.raytheon.uf.common.dataplugin.radar;bundle-version="1.0.0",
|
||||
com.raytheon.uf.viz.points;bundle-version="1.0.0",
|
||||
com.raytheon.uf.viz.d2d.nsharp;bundle-version="1.0.0",
|
||||
gov.noaa.nws.ncep.ui.nsharp;bundle-version="1.0.0",
|
||||
com.raytheon.uf.common.message;bundle-version="1.12.1174",
|
||||
com.raytheon.viz.core.graphing;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.dataplugin.level;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.comm;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.viz.core.maps;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.viz.d2d.core;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.viz.d2d.ui;bundle-version="1.12.1174"
|
||||
com.raytheon.uf.viz.d2d.ui;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.viz.derivparam;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.dataplugin.grid;bundle-version="1.0.0",
|
||||
com.raytheon.uf.viz.ui.menus;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.viz.xy;bundle-version="1.12.1174",
|
||||
com.raytheon.viz.core.graphing;bundle-version="1.12.1174"
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Export-Package: com.raytheon.viz.volumebrowser,
|
||||
com.raytheon.viz.volumebrowser.catalog,
|
||||
com.raytheon.viz.volumebrowser.datacatalog,
|
||||
com.raytheon.viz.volumebrowser.vbui,
|
||||
com.raytheon.viz.volumebrowser.xml
|
||||
Import-Package: com.raytheon.uf.common.comm,
|
||||
com.raytheon.uf.common.dataplugin.grid,
|
||||
com.raytheon.uf.common.dataplugin.grid.dataset,
|
||||
com.raytheon.uf.common.gridcoverage,
|
||||
com.raytheon.uf.common.menus.xml,
|
||||
com.raytheon.uf.viz.derivparam.inv,
|
||||
com.raytheon.uf.viz.ui.menus.xml,
|
||||
com.vividsolutions.jts.geom
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
|
|
|
@ -1,459 +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.viz.volumebrowser.catalog;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.BlockingQueue;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
|
||||
import org.eclipse.jface.viewers.ISelectionChangedListener;
|
||||
import org.eclipse.jface.viewers.IStructuredContentProvider;
|
||||
import org.eclipse.jface.viewers.LabelProvider;
|
||||
import org.eclipse.jface.viewers.ListViewer;
|
||||
import org.eclipse.jface.viewers.SelectionChangedEvent;
|
||||
import org.eclipse.jface.viewers.StructuredSelection;
|
||||
import org.eclipse.jface.viewers.Viewer;
|
||||
import org.eclipse.jface.viewers.ViewerComparator;
|
||||
import org.eclipse.swt.graphics.Image;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.widgets.Button;
|
||||
import org.eclipse.swt.widgets.Label;
|
||||
|
||||
import com.raytheon.uf.common.comm.CommunicationException;
|
||||
import com.raytheon.uf.common.dataplugin.grid.GridConstants;
|
||||
import com.raytheon.uf.common.dataplugin.grid.dataset.DatasetInfo;
|
||||
import com.raytheon.uf.common.dataplugin.grid.dataset.DatasetInfoLookup;
|
||||
import com.raytheon.uf.common.dataplugin.level.Level;
|
||||
import com.raytheon.uf.common.dataplugin.level.LevelFactory;
|
||||
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
|
||||
import com.raytheon.uf.viz.core.datastructure.DataCubeContainer;
|
||||
import com.raytheon.uf.viz.core.maps.display.VizMapEditor;
|
||||
import com.raytheon.uf.viz.core.rsc.AbstractRequestableResourceData;
|
||||
import com.raytheon.viz.grid.inv.GridInventory;
|
||||
import com.raytheon.viz.grid.rsc.GridResourceData;
|
||||
|
||||
/**
|
||||
*
|
||||
* An interface to the grid datacatalog made available for the various grid
|
||||
* parameters.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 11/29/2006 #7 brockwoo Initial creation
|
||||
* 12/05/2006 #98 brockwoo Fix for the grid parameter list not
|
||||
* updating when only the model time
|
||||
* changes
|
||||
* Aug 27, 2008 1502 dglazesk Updated to use JAXB marshalling
|
||||
* Switched to DatasetInfo from plugin-grib
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author brockwoo
|
||||
* @version 1.0
|
||||
*/
|
||||
public class GridDataCatalog implements IDataCatalog {
|
||||
|
||||
private ListViewer list1;
|
||||
|
||||
private ListViewer list2;
|
||||
|
||||
private ListViewer list3;
|
||||
|
||||
private Button addDataButton;
|
||||
|
||||
private String modelName;
|
||||
|
||||
private GridInventory inventory;
|
||||
|
||||
private String parameter;
|
||||
|
||||
private String level;
|
||||
|
||||
private ModelSelectionListener modelListener;
|
||||
|
||||
private ParameterSelectionListener parameterListener;
|
||||
|
||||
private LevelSelectionListener levelListener;
|
||||
|
||||
private static final String PLUGIN = GridConstants.GRID;
|
||||
|
||||
public GridDataCatalog() {
|
||||
}
|
||||
|
||||
private HashMap<String, Level> levelList;
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.viz.core.catalog.IDataCatalog#getDataType()
|
||||
*/
|
||||
public String getDataType() {
|
||||
return "Grid";
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.viz.core.catalog.IDataCatalog#initDataCatalog(org.eclipse
|
||||
* .swt.widgets.Label, org.eclipse.swt.widgets.Label,
|
||||
* org.eclipse.swt.widgets.Label, org.eclipse.jface.viewers.ListViewer,
|
||||
* org.eclipse.jface.viewers.ListViewer,
|
||||
* org.eclipse.jface.viewers.ListViewer, org.eclipse.swt.widgets.Button)
|
||||
*/
|
||||
public void initDataCatalog(Label label1, Label label2, Label label3,
|
||||
ListViewer list1, ListViewer list2, ListViewer list3,
|
||||
Button addButton) {
|
||||
inventory = (GridInventory) DataCubeContainer
|
||||
.getInventory(GridConstants.GRID);
|
||||
|
||||
label1.setText("Model");
|
||||
label2.setText("Parameter");
|
||||
label3.setText("Level");
|
||||
|
||||
this.list1 = list1;
|
||||
this.list2 = list2;
|
||||
this.list3 = list3;
|
||||
|
||||
this.list1.getList().setVisible(true);
|
||||
this.list2.getList().setVisible(true);
|
||||
this.list3.getList().setVisible(true);
|
||||
|
||||
this.list1.getList().setLayoutData(
|
||||
new GridData(IDataCatalog.THREEPANEWIDTH,
|
||||
IDataCatalog.DEFAULTPANEHEIGHT));
|
||||
this.list2.getList().setLayoutData(
|
||||
new GridData(IDataCatalog.THREEPANEWIDTH,
|
||||
IDataCatalog.DEFAULTPANEHEIGHT));
|
||||
this.list3.getList().setLayoutData(
|
||||
new GridData(IDataCatalog.THREEPANEWIDTH,
|
||||
IDataCatalog.DEFAULTPANEHEIGHT));
|
||||
|
||||
this.list1.setComparator(new ViewerComparator() {
|
||||
@Override
|
||||
public int compare(Viewer viewer, Object e1, Object e2) {
|
||||
return super.compare(viewer, e1, e2);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
this.list1.setContentProvider(new ModelContentProvider());
|
||||
this.list1.setLabelProvider(new ModelLabelProvider());
|
||||
|
||||
this.list2.setContentProvider(new ParamContentProvider());
|
||||
this.list2.setLabelProvider(new ParamLabelProvider());
|
||||
|
||||
this.list3.setContentProvider(new LevelContentProvider());
|
||||
this.list3.setLabelProvider(new LevelLabelProvider());
|
||||
|
||||
modelListener = new ModelSelectionListener();
|
||||
this.list1.addSelectionChangedListener(modelListener);
|
||||
|
||||
parameterListener = new ParameterSelectionListener();
|
||||
this.list2.addSelectionChangedListener(parameterListener);
|
||||
|
||||
levelListener = new LevelSelectionListener();
|
||||
this.list3.addSelectionChangedListener(levelListener);
|
||||
|
||||
addDataButton = addButton;
|
||||
modelName = "";
|
||||
parameter = "";
|
||||
level = "";
|
||||
|
||||
populateModelList();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.viz.core.catalog.IDataCatalog#dispose()
|
||||
*/
|
||||
public void dispose() {
|
||||
addDataButton.setEnabled(false);
|
||||
this.list1.setInput(EMPTYLIST);
|
||||
this.list2.setInput(EMPTYLIST);
|
||||
this.list3.setInput(EMPTYLIST);
|
||||
this.list1.refresh();
|
||||
this.list2.refresh();
|
||||
this.list3.refresh();
|
||||
this.list1.removeSelectionChangedListener(modelListener);
|
||||
this.list2.removeSelectionChangedListener(parameterListener);
|
||||
this.list3.removeSelectionChangedListener(levelListener);
|
||||
}
|
||||
|
||||
private void populateModelList() {
|
||||
ArrayList<DatasetInfo> modelTimes = new ArrayList<DatasetInfo>();
|
||||
if (inventory == null) {
|
||||
DatasetInfo[] empty = new DatasetInfo[1];
|
||||
empty[0] = new DatasetInfo();
|
||||
list1.setInput(empty);
|
||||
} else {
|
||||
DatasetInfoLookup modelLookup = DatasetInfoLookup.getInstance();
|
||||
|
||||
BlockingQueue<String> returnQueue = new LinkedBlockingQueue<String>();
|
||||
try {
|
||||
inventory.checkSources(null, null, null, returnQueue);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
for (String modelName : returnQueue) {
|
||||
DatasetInfo theGribData = modelLookup.getInfo(modelName);
|
||||
|
||||
if (theGribData != null) {
|
||||
modelTimes.add(theGribData);
|
||||
} else {
|
||||
// TODO: generate false entry
|
||||
theGribData = new DatasetInfo();
|
||||
theGribData.setDatasetId(modelName);
|
||||
}
|
||||
}
|
||||
|
||||
if (modelTimes.size() > 0) {
|
||||
this.list1.setInput(modelTimes.toArray(new DatasetInfo[] {}));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void populateModelParameters() {
|
||||
BlockingQueue<String> returnQueue = new LinkedBlockingQueue<String>();
|
||||
try {
|
||||
inventory.checkParameters(Arrays.asList(modelName), null, null,
|
||||
false, returnQueue);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
String[] parameters = returnQueue.toArray(new String[0]);
|
||||
// this should be sorted by the parameter name
|
||||
// tree.getParameterNode(modelName, param).getParameterName();
|
||||
Arrays.sort(parameters);
|
||||
list2.setInput(parameters);
|
||||
}
|
||||
|
||||
private void populateModelLevel() {
|
||||
this.levelList = new HashMap<String, Level>();
|
||||
|
||||
BlockingQueue<String> returnQueue = new LinkedBlockingQueue<String>();
|
||||
try {
|
||||
inventory.checkLevels(Arrays.asList(modelName),
|
||||
Arrays.asList(parameter), null, returnQueue);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
String[] levelIds = returnQueue.toArray(new String[0]);
|
||||
String[] levelNames = new String[levelIds.length];
|
||||
LevelFactory lf = LevelFactory.getInstance();
|
||||
|
||||
for (int i = 0; i < levelIds.length; i++) {
|
||||
try {
|
||||
Level level = lf.getLevel(levelIds[i]);
|
||||
levelNames[i] = level.getMasterLevel().getName()
|
||||
+ level.getLevelInfo();
|
||||
this.levelList.put(levelNames[i], level);
|
||||
} catch (CommunicationException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
Arrays.sort(levelNames);
|
||||
list3.getList().removeAll();
|
||||
list3.add(levelNames);
|
||||
}
|
||||
|
||||
class ModelContentProvider implements IStructuredContentProvider {
|
||||
public Object[] getElements(Object inputElement) {
|
||||
DatasetInfo[] models = (DatasetInfo[]) inputElement;
|
||||
String[] modelNames = new String[models.length];
|
||||
for (int i = 0; i < models.length; i++) {
|
||||
modelNames[i] = models[i].getTitle();
|
||||
}
|
||||
return models;
|
||||
}
|
||||
|
||||
public void dispose() {
|
||||
}
|
||||
|
||||
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
|
||||
}
|
||||
}
|
||||
|
||||
class ParamContentProvider implements IStructuredContentProvider {
|
||||
public Object[] getElements(Object inputElement) {
|
||||
String[] params = (String[]) inputElement;
|
||||
return params;
|
||||
}
|
||||
|
||||
public void dispose() {
|
||||
}
|
||||
|
||||
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
|
||||
}
|
||||
}
|
||||
|
||||
class LevelContentProvider implements IStructuredContentProvider {
|
||||
public Object[] getElements(Object inputElement) {
|
||||
String[] params = (String[]) inputElement;
|
||||
return params;
|
||||
}
|
||||
|
||||
public void dispose() {
|
||||
}
|
||||
|
||||
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
|
||||
}
|
||||
}
|
||||
|
||||
class ModelLabelProvider extends LabelProvider {
|
||||
@Override
|
||||
public Image getImage(Object element) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText(Object element) {
|
||||
DatasetInfo model = (DatasetInfo) element;
|
||||
// return (String) element;
|
||||
return model.getTitle();
|
||||
}
|
||||
}
|
||||
|
||||
class ParamLabelProvider extends LabelProvider {
|
||||
@Override
|
||||
public Image getImage(Object element) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText(Object element) {
|
||||
String param = (String) element;
|
||||
return inventory.getParameterName(modelName, param);
|
||||
}
|
||||
}
|
||||
|
||||
class LevelLabelProvider extends LabelProvider {
|
||||
@Override
|
||||
public Image getImage(Object element) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText(Object element) {
|
||||
Level level = levelList.get((String) element);
|
||||
String returnValue = level.getMasterLevel().getDescription() + " "
|
||||
+ level.getLevelInfo();
|
||||
return returnValue;
|
||||
}
|
||||
}
|
||||
|
||||
class ModelSelectionListener implements ISelectionChangedListener {
|
||||
public void selectionChanged(SelectionChangedEvent event) {
|
||||
|
||||
StructuredSelection selectedModel = (StructuredSelection) event
|
||||
.getSelection();
|
||||
DatasetInfo modelInfo = (DatasetInfo) selectedModel
|
||||
.getFirstElement();
|
||||
if (modelInfo != null && modelInfo.getDatasetId() != null
|
||||
&& !modelInfo.getDatasetId().equals(modelName)) {
|
||||
modelName = modelInfo.getDatasetId();
|
||||
addDataButton.setEnabled(false);
|
||||
populateModelParameters();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class ParameterSelectionListener implements ISelectionChangedListener {
|
||||
public void selectionChanged(SelectionChangedEvent event) {
|
||||
StructuredSelection selectedParameter = (StructuredSelection) event
|
||||
.getSelection();
|
||||
String selParameter = (String) selectedParameter.getFirstElement();
|
||||
if (selParameter != null && !selParameter.matches(parameter)) {
|
||||
parameter = selParameter;
|
||||
addDataButton.setEnabled(false);
|
||||
populateModelLevel();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class LevelSelectionListener implements ISelectionChangedListener {
|
||||
public void selectionChanged(SelectionChangedEvent event) {
|
||||
StructuredSelection selectedParameter = (StructuredSelection) event
|
||||
.getSelection();
|
||||
String selectedLevel = (String) selectedParameter.getFirstElement();
|
||||
if (selectedLevel != null && !selectedLevel.matches(level)) {
|
||||
addDataButton.setEnabled(true);
|
||||
level = (String) selectedParameter.getFirstElement();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.viz.core.catalog.IDataCatalog#getProductParameters()
|
||||
*/
|
||||
public HashMap<String, RequestConstraint> getProductParameters() {
|
||||
HashMap<String, RequestConstraint> parameters = new HashMap<String, RequestConstraint>();
|
||||
parameters
|
||||
.put(GridConstants.PLUGIN_NAME, new RequestConstraint(PLUGIN));
|
||||
parameters.put(GridConstants.DATASET_ID, new RequestConstraint(
|
||||
modelName));
|
||||
parameters.put(GridConstants.PARAMETER_ABBREVIATION,
|
||||
new RequestConstraint(parameter));
|
||||
|
||||
Level level = this.levelList.get(this.level);
|
||||
parameters.put(GridConstants.MASTER_LEVEL_NAME, new RequestConstraint(
|
||||
level.getMasterLevel().getName()));
|
||||
parameters
|
||||
.put(GridConstants.LEVEL_ONE,
|
||||
new RequestConstraint(Double.toString(level
|
||||
.getLevelonevalue())));
|
||||
parameters
|
||||
.put(GridConstants.LEVEL_TWO,
|
||||
new RequestConstraint(Double.toString(level
|
||||
.getLeveltwovalue())));
|
||||
|
||||
return parameters;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AbstractRequestableResourceData getResourceData() {
|
||||
GridResourceData grd = new GridResourceData();
|
||||
grd.setMetadataMap(getProductParameters());
|
||||
return grd;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String> getEditorConfig() {
|
||||
Map<String, String> config = new HashMap<String, String>();
|
||||
|
||||
config.put("editor", VizMapEditor.EDITOR_ID);
|
||||
config.put("editorInput",
|
||||
"com.raytheon.uf.viz.d2d.core.map.D2DMapRenderableDisplay");
|
||||
|
||||
return config;
|
||||
}
|
||||
}
|
|
@ -1,143 +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.viz.volumebrowser.catalog;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.jface.viewers.ListViewer;
|
||||
import org.eclipse.swt.widgets.Button;
|
||||
import org.eclipse.swt.widgets.Label;
|
||||
|
||||
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
|
||||
import com.raytheon.uf.viz.core.rsc.AbstractRequestableResourceData;
|
||||
|
||||
/**
|
||||
*
|
||||
* An interface to the catalog made available for the various data types. It
|
||||
* defines the methods required to properly get data into the volume browser and
|
||||
* on to the list of products to be displayed.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 11/29/2006 #7 brockwoo Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author brockwoo
|
||||
* @version 1.0
|
||||
*/
|
||||
public interface IDataCatalog {
|
||||
|
||||
/**
|
||||
* An empty string to reset the list boxes to empty.
|
||||
*/
|
||||
public static final String EMPTYLIST = null;
|
||||
|
||||
/**
|
||||
* The default height for a selection list box.
|
||||
*/
|
||||
public static final int DEFAULTPANEHEIGHT = 180;
|
||||
|
||||
/**
|
||||
* The default width for a single list box.
|
||||
*/
|
||||
public static final int ONEPANEWIDTH = 725;
|
||||
|
||||
/**
|
||||
* The default width for dual list boxes.
|
||||
*/
|
||||
public static final int TWOPANEWIDTH = 349;
|
||||
|
||||
/**
|
||||
* The default width for three list boxes.
|
||||
*/
|
||||
public static final int THREEPANEWIDTH = 222;
|
||||
|
||||
/**
|
||||
* String array to notify the user that the catalog is empty.
|
||||
*/
|
||||
public static final String[] NODATA = { "No Data" };
|
||||
|
||||
/**
|
||||
* Will return a string that identifies the data type of the catalog (i.e.
|
||||
* Radar, Satellite). This is used to populate the drop down at top of the
|
||||
* volume browser.
|
||||
*
|
||||
* @return The string of the type of catalog
|
||||
*/
|
||||
public abstract String getDataType();
|
||||
|
||||
/**
|
||||
* Will return a map with a string that identifies the editor and a string
|
||||
* for the editor input type of the catalog (i.e. Radar, Satellite). This is
|
||||
* used to create the correct type of editor for a given product.
|
||||
*
|
||||
* @return The string of the type of editor
|
||||
*/
|
||||
public abstract Map<String, String> getEditorConfig();
|
||||
|
||||
/**
|
||||
* Initializes the catalog with the proper labels and list boxes for the
|
||||
* volume browser. Will then set the controls as needed for the parameters
|
||||
* that are available for that data type.
|
||||
*
|
||||
* @param label1
|
||||
* The label above the left most list box
|
||||
* @param label2
|
||||
* The label above the center list box
|
||||
* @param label3
|
||||
* The label above the right most list box
|
||||
* @param list1
|
||||
* The list box at the left
|
||||
* @param list2
|
||||
* The list box in the center
|
||||
* @param list3
|
||||
* The list box at the right
|
||||
* @param addButton
|
||||
* The 'Add' button in the volume browser which can be
|
||||
* enabled/disabled from the catalog
|
||||
*/
|
||||
public abstract void initDataCatalog(Label label1, Label label2,
|
||||
Label label3, ListViewer list1, ListViewer list2, ListViewer list3,
|
||||
Button addButton);
|
||||
|
||||
/**
|
||||
* The parameters for the product being added to the list of products to
|
||||
* display.
|
||||
*
|
||||
* @return A hash map containing all parameters that will allow the layer to
|
||||
* retrieve that specific product
|
||||
*/
|
||||
public abstract Map<String, RequestConstraint> getProductParameters();
|
||||
|
||||
public abstract AbstractRequestableResourceData getResourceData();
|
||||
|
||||
/**
|
||||
* A call to dispose will clean up the controls for the present catalog and
|
||||
* empty out any data contained within.
|
||||
*/
|
||||
public abstract void dispose();
|
||||
|
||||
}
|
|
@ -1,218 +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.viz.volumebrowser.catalog;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.jface.viewers.ISelectionChangedListener;
|
||||
import org.eclipse.jface.viewers.IStructuredContentProvider;
|
||||
import org.eclipse.jface.viewers.LabelProvider;
|
||||
import org.eclipse.jface.viewers.ListViewer;
|
||||
import org.eclipse.jface.viewers.SelectionChangedEvent;
|
||||
import org.eclipse.jface.viewers.StructuredSelection;
|
||||
import org.eclipse.jface.viewers.Viewer;
|
||||
import org.eclipse.swt.graphics.Image;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.widgets.Button;
|
||||
import org.eclipse.swt.widgets.Label;
|
||||
|
||||
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
|
||||
import com.raytheon.uf.common.time.BinOffset;
|
||||
import com.raytheon.uf.viz.core.catalog.CatalogQuery;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.maps.display.VizMapEditor;
|
||||
import com.raytheon.uf.viz.core.rsc.AbstractRequestableResourceData;
|
||||
import com.raytheon.viz.pointdata.rsc.PlotResourceData;
|
||||
|
||||
/**
|
||||
*
|
||||
* An interface to the surface data catalog made available for the various
|
||||
* surface parameters.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 11/29/2006 #7 brockwoo Initial creation
|
||||
* 05/11/2007 #273 brockwoo Changed the plugin name from 'metar'
|
||||
* to 'obs' for JavaScript support
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author brockwoo
|
||||
* @version 1.0
|
||||
*/
|
||||
public class ObservationDataCatalog implements IDataCatalog {
|
||||
|
||||
private ListViewer list1;
|
||||
|
||||
private Button addDataButton;
|
||||
|
||||
private CatalogQuery obsQuery;
|
||||
|
||||
private TypeSelectionListener typeListener;
|
||||
|
||||
private static final String PLUGIN = "obs";
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.viz.core.catalog.IDataCatalog#getDataType()
|
||||
*/
|
||||
public String getDataType() {
|
||||
return "Observations";
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.viz.core.catalog.IDataCatalog#dispose()
|
||||
*/
|
||||
public void dispose() {
|
||||
addDataButton.setEnabled(false);
|
||||
this.list1.setInput(EMPTYLIST);
|
||||
this.list1.refresh();
|
||||
this.list1.removeSelectionChangedListener(typeListener);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.viz.core.catalog.IDataCatalog#initDataCatalog(org.eclipse
|
||||
* .swt.widgets.Label, org.eclipse.swt.widgets.Label,
|
||||
* org.eclipse.swt.widgets.Label, org.eclipse.jface.viewers.ListViewer,
|
||||
* org.eclipse.jface.viewers.ListViewer,
|
||||
* org.eclipse.jface.viewers.ListViewer, org.eclipse.swt.widgets.Button)
|
||||
*/
|
||||
public void initDataCatalog(Label label1, Label label2, Label label3,
|
||||
ListViewer list1, ListViewer list2, ListViewer list3,
|
||||
Button addButton) {
|
||||
label1.setText("Data Type");
|
||||
label2.setText(" ");
|
||||
label3.setText(" ");
|
||||
obsQuery = new CatalogQuery();
|
||||
this.list1 = list1;
|
||||
this.list1.getList().setLayoutData(
|
||||
new GridData(ONEPANEWIDTH, DEFAULTPANEHEIGHT));
|
||||
typeListener = new TypeSelectionListener();
|
||||
this.list1.addSelectionChangedListener(typeListener);
|
||||
this.list1.setContentProvider(new ObservationContentProvider());
|
||||
this.list1.setLabelProvider(new ObservationLabelProvider());
|
||||
this.list1.getList().setEnabled(true);
|
||||
list2.getList().setVisible(false);
|
||||
list3.getList().setVisible(false);
|
||||
addDataButton = addButton;
|
||||
populateTypeParameters();
|
||||
}
|
||||
|
||||
private void populateTypeParameters() {
|
||||
HashMap<String, RequestConstraint> queryList = new HashMap<String, RequestConstraint>();
|
||||
queryList.put("pluginName", new RequestConstraint(PLUGIN));
|
||||
queryList.put("reportType", new RequestConstraint("METAR"));
|
||||
try {
|
||||
String[] parameters = CatalogQuery.performQuery("dataTime",
|
||||
queryList);
|
||||
if (parameters != null && parameters.length > 0) {
|
||||
String[] obsList = { "Observations (METARS)" };
|
||||
list1.setInput(obsList);
|
||||
} else {
|
||||
list1.setInput(NODATA);
|
||||
}
|
||||
} catch (VizException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
class ObservationContentProvider implements IStructuredContentProvider {
|
||||
public Object[] getElements(Object inputElement) {
|
||||
return (String[]) inputElement;
|
||||
}
|
||||
|
||||
public void dispose() {
|
||||
}
|
||||
|
||||
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
|
||||
}
|
||||
}
|
||||
|
||||
class ObservationLabelProvider extends LabelProvider {
|
||||
@Override
|
||||
public Image getImage(Object element) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText(Object element) {
|
||||
return (String) element;
|
||||
}
|
||||
}
|
||||
|
||||
class TypeSelectionListener implements ISelectionChangedListener {
|
||||
public void selectionChanged(SelectionChangedEvent event) {
|
||||
StructuredSelection selectedParameter = (StructuredSelection) event
|
||||
.getSelection();
|
||||
String selectedType = (String) selectedParameter.getFirstElement();
|
||||
if (selectedType != null && !selectedType.matches(NODATA[0])) {
|
||||
addDataButton.setEnabled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.viz.core.catalog.IDataCatalog#getProductParameters()
|
||||
*/
|
||||
public HashMap<String, RequestConstraint> getProductParameters() {
|
||||
HashMap<String, RequestConstraint> parameters = new HashMap<String, RequestConstraint>();
|
||||
parameters.put("pluginName", new RequestConstraint(PLUGIN));
|
||||
parameters.put("reportType", new RequestConstraint("METAR"));
|
||||
return parameters;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AbstractRequestableResourceData getResourceData() {
|
||||
PlotResourceData prd = new PlotResourceData();
|
||||
prd.setRetrieveData(false);
|
||||
prd.setUpdatingOnMetadataOnly(true);
|
||||
prd.setRequeryNecessaryOnTimeMatch(true);
|
||||
BinOffset binOffset = new BinOffset(1800, 1800);
|
||||
prd.setBinOffset(binOffset);
|
||||
prd.setPlotSource("METAR Plot");
|
||||
prd.setMetadataMap(getProductParameters());
|
||||
return prd;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String> getEditorConfig() {
|
||||
Map<String, String> config = new HashMap<String, String>();
|
||||
|
||||
config.put("editor", VizMapEditor.EDITOR_ID);
|
||||
config.put("editorInput",
|
||||
"com.raytheon.uf.viz.d2d.core.map.D2DMapRenderableDisplay");
|
||||
|
||||
return config;
|
||||
}
|
||||
}
|
|
@ -1,406 +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.viz.volumebrowser.catalog;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.jface.viewers.ISelectionChangedListener;
|
||||
import org.eclipse.jface.viewers.IStructuredContentProvider;
|
||||
import org.eclipse.jface.viewers.LabelProvider;
|
||||
import org.eclipse.jface.viewers.ListViewer;
|
||||
import org.eclipse.jface.viewers.SelectionChangedEvent;
|
||||
import org.eclipse.jface.viewers.StructuredSelection;
|
||||
import org.eclipse.jface.viewers.Viewer;
|
||||
import org.eclipse.swt.graphics.Image;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.widgets.Button;
|
||||
import org.eclipse.swt.widgets.Label;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.radar.util.RadarInfo;
|
||||
import com.raytheon.uf.common.dataplugin.radar.util.RadarInfoDict;
|
||||
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
|
||||
import com.raytheon.uf.common.localization.PathManagerFactory;
|
||||
import com.raytheon.uf.viz.core.catalog.CatalogQuery;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.maps.display.VizMapEditor;
|
||||
import com.raytheon.uf.viz.core.rsc.AbstractRequestableResourceData;
|
||||
import com.raytheon.uf.viz.xy.VizXyEditor;
|
||||
import com.raytheon.viz.radar.rsc.RadarResourceData;
|
||||
import com.raytheon.viz.radar.ui.xy.RadarGraphDisplay;
|
||||
import com.raytheon.viz.radar.ui.xy.RadarXYDisplay;
|
||||
|
||||
/**
|
||||
*
|
||||
* An interface to the radar data catalog made available for the various radar
|
||||
* parameters.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 11/29/2006 #7 brockwoo Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author brockwoo
|
||||
* @version 1.0
|
||||
*/
|
||||
public class RadarDataCatalog implements IDataCatalog {
|
||||
|
||||
private ListViewer list1;
|
||||
|
||||
private ListViewer list2;
|
||||
|
||||
private ListViewer list3;
|
||||
|
||||
private Button addDataButton;
|
||||
|
||||
private TypeSelectionListener typeListener;
|
||||
|
||||
private ElevationSelectionListener elevationListener;
|
||||
|
||||
private LocationSelectionListener locationListener;
|
||||
|
||||
// private static HashMap<String, String> radarTypes;
|
||||
|
||||
private CatalogQuery radarQuery;
|
||||
|
||||
private String type;
|
||||
|
||||
private String elevation;
|
||||
|
||||
private String location;
|
||||
|
||||
private Map<String, String> editorConfig = new HashMap<String, String>();
|
||||
|
||||
private final RadarInfoDict infoDict;
|
||||
|
||||
private static final String PLUGIN = "radar";
|
||||
|
||||
public RadarDataCatalog() {
|
||||
File file = PathManagerFactory.getPathManager().getStaticFile(
|
||||
"radarInfo.txt");
|
||||
infoDict = RadarInfoDict.getInstance(file.getParent());
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.viz.core.catalog.IDataCatalog#getDataType()
|
||||
*/
|
||||
public String getDataType() {
|
||||
return "Radar";
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.viz.core.catalog.IDataCatalog#dispose()
|
||||
*/
|
||||
public void dispose() {
|
||||
addDataButton.setEnabled(false);
|
||||
this.list1.setInput(EMPTYLIST);
|
||||
this.list2.setInput(EMPTYLIST);
|
||||
this.list3.setInput(EMPTYLIST);
|
||||
this.list1.refresh();
|
||||
this.list2.refresh();
|
||||
this.list3.refresh();
|
||||
this.list1.removeSelectionChangedListener(typeListener);
|
||||
this.list2.removeSelectionChangedListener(elevationListener);
|
||||
this.list3.removeSelectionChangedListener(locationListener);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.viz.core.catalog.IDataCatalog#initDataCatalog(org.eclipse
|
||||
* .swt.widgets.Label, org.eclipse.swt.widgets.Label,
|
||||
* org.eclipse.swt.widgets.Label, org.eclipse.jface.viewers.ListViewer,
|
||||
* org.eclipse.jface.viewers.ListViewer,
|
||||
* org.eclipse.jface.viewers.ListViewer, org.eclipse.swt.widgets.Button)
|
||||
*/
|
||||
public void initDataCatalog(Label label1, Label label2, Label label3,
|
||||
ListViewer list1, ListViewer list2, ListViewer list3,
|
||||
Button addButton) {
|
||||
label1.setText("Data Type");
|
||||
label2.setText("Elevation");
|
||||
label3.setText("Location");
|
||||
radarQuery = new CatalogQuery();
|
||||
this.list1 = list1;
|
||||
this.list2 = list2;
|
||||
this.list3 = list3;
|
||||
this.list1.getList().setVisible(true);
|
||||
this.list2.getList().setVisible(true);
|
||||
this.list3.getList().setVisible(true);
|
||||
this.list1.getList().setLayoutData(
|
||||
new GridData(THREEPANEWIDTH, DEFAULTPANEHEIGHT));
|
||||
this.list2.getList().setLayoutData(
|
||||
new GridData(THREEPANEWIDTH, DEFAULTPANEHEIGHT));
|
||||
this.list3.getList().setLayoutData(
|
||||
new GridData(THREEPANEWIDTH, DEFAULTPANEHEIGHT));
|
||||
// typeListener = new TypeSelectionListener();
|
||||
// this.list2.addSelectionChangedListener(typeListener);
|
||||
this.list1.setContentProvider(new RadarContentProvider());
|
||||
this.list1.setLabelProvider(new RadarTypeLabelProvider());
|
||||
typeListener = new TypeSelectionListener();
|
||||
this.list1.addSelectionChangedListener(typeListener);
|
||||
|
||||
this.list2.setContentProvider(new RadarContentProvider());
|
||||
this.list2.setLabelProvider(new RadarElevationLabelProvider());
|
||||
elevationListener = new ElevationSelectionListener();
|
||||
this.list2.addSelectionChangedListener(elevationListener);
|
||||
|
||||
this.list3.setContentProvider(new RadarContentProvider());
|
||||
this.list3.setLabelProvider(new RadarLabelProvider());
|
||||
locationListener = new LocationSelectionListener();
|
||||
this.list3.addSelectionChangedListener(locationListener);
|
||||
addDataButton = addButton;
|
||||
type = " ";
|
||||
elevation = " ";
|
||||
location = " ";
|
||||
populateTypeParameters();
|
||||
|
||||
}
|
||||
|
||||
private void populateTypeParameters() {
|
||||
HashMap<String, RequestConstraint> queryList = new HashMap<String, RequestConstraint>();
|
||||
queryList.put("pluginName", new RequestConstraint(PLUGIN));
|
||||
try {
|
||||
String[] parameters = CatalogQuery.performQuery("productCode",
|
||||
queryList);
|
||||
if (parameters != null && parameters.length > 0) {
|
||||
Arrays.sort(parameters);
|
||||
list1.setInput(parameters);
|
||||
} else {
|
||||
list1.setInput(NODATA);
|
||||
}
|
||||
} catch (VizException e) {
|
||||
// TODO Put a pop up dialog box here to notify user the query failed
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private void populateElevationParameters() {
|
||||
HashMap<String, RequestConstraint> queryList = new HashMap<String, RequestConstraint>();
|
||||
queryList.put("pluginName", new RequestConstraint(PLUGIN));
|
||||
queryList.put("productCode", new RequestConstraint(type));
|
||||
try {
|
||||
String[] parameters = CatalogQuery.performQuery(
|
||||
"primaryElevationAngle", queryList);
|
||||
Arrays.sort(parameters);
|
||||
list2.setInput(parameters);
|
||||
} catch (VizException e) {
|
||||
// TODO Put a pop up dialog box here to notify user the query failed
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private void populateLocationParameters() {
|
||||
HashMap<String, RequestConstraint> queryList = new HashMap<String, RequestConstraint>();
|
||||
queryList.put("pluginName", new RequestConstraint(PLUGIN));
|
||||
queryList.put("productCode", new RequestConstraint(type));
|
||||
queryList
|
||||
.put("primaryElevationAngle", new RequestConstraint(elevation));
|
||||
try {
|
||||
String[] parameters = CatalogQuery.performQuery("icao", queryList);
|
||||
Arrays.sort(parameters);
|
||||
list3.setInput(parameters);
|
||||
} catch (VizException e) {
|
||||
// TODO Put a pop up dialog box here to notify user the query failed
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
class TypeSelectionListener implements ISelectionChangedListener {
|
||||
public void selectionChanged(SelectionChangedEvent event) {
|
||||
StructuredSelection selectedModel = (StructuredSelection) event
|
||||
.getSelection();
|
||||
String typeInfo = (String) selectedModel.getFirstElement();
|
||||
if (typeInfo != null && !typeInfo.matches(type)
|
||||
&& !typeInfo.matches(NODATA[0])) {
|
||||
addDataButton.setEnabled(false);
|
||||
type = typeInfo;
|
||||
populateElevationParameters();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class ElevationSelectionListener implements ISelectionChangedListener {
|
||||
public void selectionChanged(SelectionChangedEvent event) {
|
||||
StructuredSelection selectedElevation = (StructuredSelection) event
|
||||
.getSelection();
|
||||
String elevationInfo = (String) selectedElevation.getFirstElement();
|
||||
if (elevationInfo != null && !elevationInfo.matches(elevation)) {
|
||||
addDataButton.setEnabled(false);
|
||||
elevation = elevationInfo;
|
||||
populateLocationParameters();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class LocationSelectionListener implements ISelectionChangedListener {
|
||||
public void selectionChanged(SelectionChangedEvent event) {
|
||||
StructuredSelection selectedParameter = (StructuredSelection) event
|
||||
.getSelection();
|
||||
String selectedLocation = (String) selectedParameter
|
||||
.getFirstElement();
|
||||
if (selectedLocation != null && !selectedLocation.matches(location)) {
|
||||
addDataButton.setEnabled(true);
|
||||
location = selectedLocation;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class RadarContentProvider implements IStructuredContentProvider {
|
||||
public Object[] getElements(Object inputElement) {
|
||||
return (String[]) inputElement;
|
||||
}
|
||||
|
||||
public void dispose() {
|
||||
}
|
||||
|
||||
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
|
||||
}
|
||||
}
|
||||
|
||||
class RadarLabelProvider extends LabelProvider {
|
||||
@Override
|
||||
public Image getImage(Object element) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText(Object element) {
|
||||
return (String) element;
|
||||
}
|
||||
}
|
||||
|
||||
class RadarTypeLabelProvider extends LabelProvider {
|
||||
@Override
|
||||
public Image getImage(Object element) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText(Object element) {
|
||||
return getNameFromDictionary(element);
|
||||
}
|
||||
}
|
||||
|
||||
protected String getNameFromDictionary(Object element) {
|
||||
try {
|
||||
int productCode = Integer.parseInt((String) element);
|
||||
RadarInfo info = infoDict.getInfo(productCode);
|
||||
if (info != null) {
|
||||
String name = info.getDescription();
|
||||
if (name == null) {
|
||||
name = "Product Code " + type;
|
||||
}
|
||||
return name;
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
}
|
||||
return (String) element;
|
||||
}
|
||||
|
||||
class RadarElevationLabelProvider extends LabelProvider {
|
||||
@Override
|
||||
public Image getImage(Object element) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText(Object element) {
|
||||
String type = (String) element;
|
||||
return type + "°";
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.viz.core.catalog.IDataCatalog#getProductParameters()
|
||||
*/
|
||||
public HashMap<String, RequestConstraint> getProductParameters() {
|
||||
HashMap<String, RequestConstraint> parameters = new HashMap<String, RequestConstraint>();
|
||||
parameters.put("pluginName", new RequestConstraint(PLUGIN));
|
||||
parameters.put("productCode", new RequestConstraint(type));
|
||||
parameters.put("primaryElevationAngle",
|
||||
new RequestConstraint(elevation));
|
||||
parameters.put("icao", new RequestConstraint(location));
|
||||
return parameters;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AbstractRequestableResourceData getResourceData() {
|
||||
RadarResourceData rrd = new RadarResourceData();
|
||||
rrd.setMetadataMap(getProductParameters());
|
||||
|
||||
// Need to set the type of editor
|
||||
RadarInfo info = infoDict.getInfo(Integer.parseInt(type));
|
||||
String format = null;
|
||||
if (info != null) {
|
||||
format = info.getFormat();
|
||||
}
|
||||
if ("Graph".equals(format)) {
|
||||
// Handles radar products that are displayed on a nonMap display
|
||||
// with a graph
|
||||
|
||||
// Radar XY plot editor
|
||||
setEditorConfig(VizXyEditor.class.getName(),
|
||||
RadarGraphDisplay.class.getName());
|
||||
} else if ("XY".equals(format)) {
|
||||
// Handles radar products that are displayed on a nonMap display
|
||||
// without a graph
|
||||
|
||||
// Radar XY plot editor
|
||||
setEditorConfig(VizXyEditor.class.getName(),
|
||||
RadarXYDisplay.class.getName());
|
||||
} else {
|
||||
// Standard GL Map editor
|
||||
setEditorConfig(VizMapEditor.EDITOR_ID, VizMapEditor.EDITOR_ID);
|
||||
}
|
||||
|
||||
// Set the product name
|
||||
// rrd.setProductName(getNameFromDictionary(type));
|
||||
|
||||
return rrd;
|
||||
}
|
||||
|
||||
private void setEditorConfig(String editor, String editorInput) {
|
||||
editorConfig.put("editor", editor);
|
||||
editorConfig.put("editorInput", editorInput);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String> getEditorConfig() {
|
||||
return editorConfig;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,251 +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.viz.volumebrowser.catalog;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.core.runtime.Status;
|
||||
import org.eclipse.jface.viewers.ISelectionChangedListener;
|
||||
import org.eclipse.jface.viewers.IStructuredContentProvider;
|
||||
import org.eclipse.jface.viewers.LabelProvider;
|
||||
import org.eclipse.jface.viewers.ListViewer;
|
||||
import org.eclipse.jface.viewers.SelectionChangedEvent;
|
||||
import org.eclipse.jface.viewers.StructuredSelection;
|
||||
import org.eclipse.jface.viewers.Viewer;
|
||||
import org.eclipse.jface.viewers.ViewerComparator;
|
||||
import org.eclipse.swt.graphics.Image;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.widgets.Button;
|
||||
import org.eclipse.swt.widgets.Label;
|
||||
|
||||
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
|
||||
import com.raytheon.uf.viz.core.VizApp;
|
||||
import com.raytheon.uf.viz.core.catalog.CatalogQuery;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.maps.display.VizMapEditor;
|
||||
import com.raytheon.uf.viz.core.rsc.AbstractRequestableResourceData;
|
||||
import com.raytheon.viz.redbook.Activator;
|
||||
import com.raytheon.viz.redbook.RedbookWMOMap;
|
||||
import com.raytheon.viz.redbook.rsc.RedbookResourceData;
|
||||
|
||||
/**
|
||||
*
|
||||
* An interface to the redbook data catalog made available for the various
|
||||
* redbook product ids.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 05/29/2008 brockwoo Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author brockwoo
|
||||
* @version 1.0
|
||||
*/
|
||||
public class RedbookDataCatalog implements IDataCatalog {
|
||||
|
||||
private ListViewer list1;
|
||||
|
||||
private Button addDataButton;
|
||||
|
||||
private TypeSelectionListener typeListener;
|
||||
|
||||
private String wmoHeader;
|
||||
|
||||
private static final String PLUGIN = "redbook";
|
||||
|
||||
private RedbookWMOMap mapping;
|
||||
|
||||
public RedbookDataCatalog() {
|
||||
try {
|
||||
mapping = RedbookWMOMap.load();
|
||||
} catch (Exception e) {
|
||||
VizApp.logAndAlert(Status.ERROR, e,
|
||||
"Error loading redbook mapping",
|
||||
"Redbook mapping could not be loaded",
|
||||
Activator.getDefault(), Activator.PLUGIN_ID);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.viz.core.catalog.IDataCatalog#getDataType()
|
||||
*/
|
||||
public String getDataType() {
|
||||
return "Redbook";
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.viz.core.catalog.IDataCatalog#dispose()
|
||||
*/
|
||||
public void dispose() {
|
||||
addDataButton.setEnabled(false);
|
||||
this.list1.setInput(EMPTYLIST);
|
||||
this.list1.refresh();
|
||||
this.list1.removeSelectionChangedListener(typeListener);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.viz.core.catalog.IDataCatalog#initDataCatalog(org.eclipse
|
||||
* .swt.widgets.Label, org.eclipse.swt.widgets.Label,
|
||||
* org.eclipse.swt.widgets.Label, org.eclipse.jface.viewers.ListViewer,
|
||||
* org.eclipse.jface.viewers.ListViewer,
|
||||
* org.eclipse.jface.viewers.ListViewer, org.eclipse.swt.widgets.Button)
|
||||
*/
|
||||
public void initDataCatalog(Label label1, Label label2, Label label3,
|
||||
ListViewer list1, ListViewer list2, ListViewer list3,
|
||||
Button addButton) {
|
||||
label1.setText("Redbook Product ID");
|
||||
label2.setText(" ");
|
||||
label3.setText(" ");
|
||||
this.list1 = list1;
|
||||
this.list1.getList().setLayoutData(
|
||||
new GridData(ONEPANEWIDTH, DEFAULTPANEHEIGHT));
|
||||
typeListener = new TypeSelectionListener();
|
||||
this.list1.addSelectionChangedListener(typeListener);
|
||||
this.list1.setContentProvider(new ObservationContentProvider());
|
||||
this.list1.setLabelProvider(new RedbookLabelProvider());
|
||||
this.list1.setComparator(new ViewerComparator() {
|
||||
@Override
|
||||
public int compare(Viewer viewer, Object e1, Object e2) {
|
||||
return super.compare(viewer, descriptiveName((String) e1),
|
||||
descriptiveName((String) e2));
|
||||
}
|
||||
|
||||
});
|
||||
this.list1.getList().setEnabled(true);
|
||||
list2.getList().setVisible(false);
|
||||
list3.getList().setVisible(false);
|
||||
addDataButton = addButton;
|
||||
this.wmoHeader = " ";
|
||||
populateTypeParameters();
|
||||
}
|
||||
|
||||
private String descriptiveName(String in) {
|
||||
RedbookWMOMap.Info info = mapping.mapping.get(in);
|
||||
if (info != null)
|
||||
return info.name + " (" + in + ")";
|
||||
|
||||
return in;
|
||||
|
||||
}
|
||||
|
||||
private void populateTypeParameters() {
|
||||
HashMap<String, RequestConstraint> queryList = new HashMap<String, RequestConstraint>();
|
||||
queryList.put("pluginName", new RequestConstraint(PLUGIN));
|
||||
try {
|
||||
String[] parameters = CatalogQuery.performQuery("wmoTTAAii",
|
||||
queryList);
|
||||
Arrays.sort(parameters);
|
||||
if (parameters != null && parameters.length > 0) {
|
||||
list1.setInput(parameters);
|
||||
} else {
|
||||
list1.setInput(NODATA);
|
||||
}
|
||||
} catch (VizException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
class ObservationContentProvider implements IStructuredContentProvider {
|
||||
public Object[] getElements(Object inputElement) {
|
||||
return (String[]) inputElement;
|
||||
}
|
||||
|
||||
public void dispose() {
|
||||
}
|
||||
|
||||
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
|
||||
}
|
||||
}
|
||||
|
||||
class RedbookLabelProvider extends LabelProvider {
|
||||
@Override
|
||||
public Image getImage(Object element) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText(Object element) {
|
||||
return descriptiveName((String) element);
|
||||
}
|
||||
}
|
||||
|
||||
class TypeSelectionListener implements ISelectionChangedListener {
|
||||
public void selectionChanged(SelectionChangedEvent event) {
|
||||
StructuredSelection selectedParameter = (StructuredSelection) event
|
||||
.getSelection();
|
||||
String selectedType = (String) selectedParameter.getFirstElement();
|
||||
wmoHeader = selectedType;
|
||||
if (selectedType != null && !selectedType.matches(NODATA[0])) {
|
||||
addDataButton.setEnabled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.viz.core.catalog.IDataCatalog#getProductParameters()
|
||||
*/
|
||||
public HashMap<String, RequestConstraint> getProductParameters() {
|
||||
HashMap<String, RequestConstraint> parameters = new HashMap<String, RequestConstraint>();
|
||||
parameters.put("pluginName", new RequestConstraint(PLUGIN));
|
||||
parameters.put("wmoTTAAii", new RequestConstraint(this.wmoHeader));
|
||||
return parameters;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.viz.volumebrowser.catalog.IDataCatalog#getResourceData()
|
||||
*/
|
||||
@Override
|
||||
public AbstractRequestableResourceData getResourceData() {
|
||||
RedbookResourceData lrd = new RedbookResourceData();
|
||||
lrd.setMetadataMap(getProductParameters());
|
||||
return lrd;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String> getEditorConfig() {
|
||||
Map<String, String> config = new HashMap<String, String>();
|
||||
|
||||
config.put("editor", VizMapEditor.EDITOR_ID);
|
||||
config.put("editorInput",
|
||||
"com.raytheon.uf.viz.d2d.core.map.D2DMapRenderableDisplay");
|
||||
|
||||
return config;
|
||||
}
|
||||
}
|
|
@ -1,314 +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.viz.volumebrowser.catalog;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.jface.viewers.ISelectionChangedListener;
|
||||
import org.eclipse.jface.viewers.IStructuredContentProvider;
|
||||
import org.eclipse.jface.viewers.LabelProvider;
|
||||
import org.eclipse.jface.viewers.ListViewer;
|
||||
import org.eclipse.jface.viewers.SelectionChangedEvent;
|
||||
import org.eclipse.jface.viewers.StructuredSelection;
|
||||
import org.eclipse.jface.viewers.Viewer;
|
||||
import org.eclipse.swt.graphics.Image;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.widgets.Button;
|
||||
import org.eclipse.swt.widgets.Label;
|
||||
|
||||
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
|
||||
import com.raytheon.uf.viz.core.catalog.CatalogQuery;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.maps.display.VizMapEditor;
|
||||
import com.raytheon.uf.viz.core.rsc.AbstractRequestableResourceData;
|
||||
import com.raytheon.viz.satellite.rsc.SatResourceData;
|
||||
|
||||
/**
|
||||
*
|
||||
* An interface to the satellite data catalog made available for the various
|
||||
* satellite parameters.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 11/29/2006 #7 brockwoo Initial creation
|
||||
* 12/07/2006 #111 brockwoo Put in a filter to remove visible imagery
|
||||
* </pre>
|
||||
*
|
||||
* @author brockwoo
|
||||
* @version 1.0
|
||||
*/
|
||||
public class SatelliteDataCatalog implements IDataCatalog {
|
||||
|
||||
private ListViewer list1;
|
||||
|
||||
private ListViewer list2;
|
||||
|
||||
private ListViewer list3;
|
||||
|
||||
private Button addDataButton;
|
||||
|
||||
private String source;
|
||||
|
||||
private String region;
|
||||
|
||||
private String type;
|
||||
|
||||
private SourceSelectionListener sourceListener;
|
||||
|
||||
private RegionSelectionListener regionListener;
|
||||
|
||||
private TypeSelectionListener typeListener;
|
||||
|
||||
private static final String PLUGIN = "satellite";
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.viz.core.catalog.IDataCatalog#getDataType()
|
||||
*/
|
||||
public String getDataType() {
|
||||
return "Satellite";
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.viz.core.catalog.IDataCatalog#dispose()
|
||||
*/
|
||||
public void dispose() {
|
||||
addDataButton.setEnabled(false);
|
||||
this.list1.setInput(EMPTYLIST);
|
||||
this.list2.setInput(EMPTYLIST);
|
||||
this.list3.setInput(EMPTYLIST);
|
||||
this.list1.refresh();
|
||||
this.list2.refresh();
|
||||
this.list3.refresh();
|
||||
this.list1.removeSelectionChangedListener(sourceListener);
|
||||
this.list2.removeSelectionChangedListener(regionListener);
|
||||
this.list3.removeSelectionChangedListener(typeListener);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.viz.core.catalog.IDataCatalog#initDataCatalog(org.eclipse
|
||||
* .swt.widgets.Label, org.eclipse.swt.widgets.Label,
|
||||
* org.eclipse.swt.widgets.Label, org.eclipse.jface.viewers.ListViewer,
|
||||
* org.eclipse.jface.viewers.ListViewer,
|
||||
* org.eclipse.jface.viewers.ListViewer, org.eclipse.swt.widgets.Button)
|
||||
*/
|
||||
public void initDataCatalog(Label label1, Label label2, Label label3,
|
||||
ListViewer list1, ListViewer list2, ListViewer list3,
|
||||
Button addButton) {
|
||||
label1.setText("Source");
|
||||
label2.setText("Region");
|
||||
label3.setText("Type");
|
||||
this.list1 = list1;
|
||||
this.list2 = list2;
|
||||
this.list3 = list3;
|
||||
this.list1.getList().setVisible(true);
|
||||
this.list2.getList().setVisible(true);
|
||||
this.list3.getList().setVisible(true);
|
||||
this.list1.getList().setLayoutData(
|
||||
new GridData(IDataCatalog.THREEPANEWIDTH,
|
||||
IDataCatalog.DEFAULTPANEHEIGHT));
|
||||
this.list2.getList().setLayoutData(
|
||||
new GridData(IDataCatalog.THREEPANEWIDTH,
|
||||
IDataCatalog.DEFAULTPANEHEIGHT));
|
||||
this.list3.getList().setLayoutData(
|
||||
new GridData(IDataCatalog.THREEPANEWIDTH,
|
||||
IDataCatalog.DEFAULTPANEHEIGHT));
|
||||
this.list1.setContentProvider(new SatelliteContentProvider());
|
||||
this.list1.setLabelProvider(new SatelliteLabelProvider());
|
||||
this.list2.setContentProvider(new SatelliteContentProvider());
|
||||
this.list2.setLabelProvider(new SatelliteLabelProvider());
|
||||
this.list3.setContentProvider(new SatelliteContentProvider());
|
||||
this.list3.setLabelProvider(new SatelliteLabelProvider());
|
||||
sourceListener = new SourceSelectionListener();
|
||||
this.list1.addSelectionChangedListener(sourceListener);
|
||||
regionListener = new RegionSelectionListener();
|
||||
this.list2.addSelectionChangedListener(regionListener);
|
||||
typeListener = new TypeSelectionListener();
|
||||
this.list3.addSelectionChangedListener(typeListener);
|
||||
addDataButton = addButton;
|
||||
source = "";
|
||||
region = "";
|
||||
type = "";
|
||||
populateSourceParameters();
|
||||
}
|
||||
|
||||
private void populateSourceParameters() {
|
||||
HashMap<String, RequestConstraint> queryList = new HashMap<String, RequestConstraint>();
|
||||
queryList.put("pluginName", new RequestConstraint(PLUGIN));
|
||||
try {
|
||||
String[] parameters = CatalogQuery.performQuery("creatingEntity",
|
||||
queryList);
|
||||
if (parameters != null && parameters.length > 0) {
|
||||
Arrays.sort(parameters);
|
||||
list1.setInput(parameters);
|
||||
} else {
|
||||
list1.setInput(NODATA);
|
||||
}
|
||||
} catch (VizException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private void populateRegionParameters() {
|
||||
HashMap<String, RequestConstraint> queryList = new HashMap<String, RequestConstraint>();
|
||||
queryList.put("pluginName", new RequestConstraint(PLUGIN));
|
||||
queryList.put("creatingEntity", new RequestConstraint(source));
|
||||
try {
|
||||
String[] parameters = CatalogQuery.performQuery("sectorID",
|
||||
queryList);
|
||||
Arrays.sort(parameters);
|
||||
list2.setInput(parameters);
|
||||
} catch (VizException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private void populateTypeParameters() {
|
||||
HashMap<String, RequestConstraint> queryList = new HashMap<String, RequestConstraint>();
|
||||
queryList.put("pluginName", new RequestConstraint(PLUGIN));
|
||||
queryList.put("creatingEntity", new RequestConstraint(source));
|
||||
queryList.put("sectorID", new RequestConstraint(region));
|
||||
try {
|
||||
String[] parameters = CatalogQuery.performQuery("physicalElement",
|
||||
queryList);
|
||||
Arrays.sort(parameters);
|
||||
ArrayList<String> goodParameters = new ArrayList<String>();
|
||||
for (int i = 0; i < parameters.length; i++) {
|
||||
goodParameters.add(parameters[i]);
|
||||
}
|
||||
list3.setInput(goodParameters.toArray(new String[] {}));
|
||||
} catch (VizException e) {
|
||||
// TODO Put in a popup to alert the user that the query failed
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
class SatelliteContentProvider implements IStructuredContentProvider {
|
||||
public Object[] getElements(Object inputElement) {
|
||||
return (String[]) inputElement;
|
||||
}
|
||||
|
||||
public void dispose() {
|
||||
}
|
||||
|
||||
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
|
||||
}
|
||||
}
|
||||
|
||||
class SatelliteLabelProvider extends LabelProvider {
|
||||
public Image getImage(Object element) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getText(Object element) {
|
||||
return (String) element;
|
||||
}
|
||||
}
|
||||
|
||||
class SourceSelectionListener implements ISelectionChangedListener {
|
||||
public void selectionChanged(SelectionChangedEvent event) {
|
||||
StructuredSelection selectedModel = (StructuredSelection) event
|
||||
.getSelection();
|
||||
String sourceInfo = (String) selectedModel.getFirstElement();
|
||||
if (sourceInfo != null && !sourceInfo.matches(source)
|
||||
&& !sourceInfo.matches(NODATA[0])) {
|
||||
addDataButton.setEnabled(false);
|
||||
source = sourceInfo;
|
||||
populateRegionParameters();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class RegionSelectionListener implements ISelectionChangedListener {
|
||||
public void selectionChanged(SelectionChangedEvent event) {
|
||||
StructuredSelection selectedParameter = (StructuredSelection) event
|
||||
.getSelection();
|
||||
String selectedRegion = (String) selectedParameter
|
||||
.getFirstElement();
|
||||
if (selectedRegion != null && !selectedRegion.matches(region)) {
|
||||
type = "";
|
||||
addDataButton.setEnabled(false);
|
||||
region = selectedRegion;
|
||||
populateTypeParameters();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class TypeSelectionListener implements ISelectionChangedListener {
|
||||
public void selectionChanged(SelectionChangedEvent event) {
|
||||
StructuredSelection selectedParameter = (StructuredSelection) event
|
||||
.getSelection();
|
||||
String selectedType = (String) selectedParameter.getFirstElement();
|
||||
if (selectedType != null && !selectedType.matches(type)) {
|
||||
addDataButton.setEnabled(true);
|
||||
type = selectedType;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.viz.core.catalog.IDataCatalog#getProductParameters()
|
||||
*/
|
||||
public HashMap<String, RequestConstraint> getProductParameters() {
|
||||
HashMap<String, RequestConstraint> parameters = new HashMap<String, RequestConstraint>();
|
||||
parameters.put("pluginName", new RequestConstraint(PLUGIN));
|
||||
parameters.put("creatingEntity", new RequestConstraint(source));
|
||||
parameters.put("sectorID", new RequestConstraint(region));
|
||||
parameters.put("physicalElement", new RequestConstraint(type));
|
||||
return parameters;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AbstractRequestableResourceData getResourceData() {
|
||||
SatResourceData srd = new SatResourceData();
|
||||
srd.setMetadataMap(getProductParameters());
|
||||
return srd;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String> getEditorConfig() {
|
||||
Map<String, String> config = new HashMap<String, String>();
|
||||
|
||||
config.put("editor", VizMapEditor.EDITOR_ID);
|
||||
config.put("editorInput",
|
||||
"com.raytheon.uf.viz.d2d.core.map.D2DMapRenderableDisplay");
|
||||
|
||||
return config;
|
||||
}
|
||||
}
|
|
@ -58,7 +58,6 @@ import com.raytheon.uf.viz.xy.varheight.rsc.VarHeightResourceData;
|
|||
import com.raytheon.viz.awipstools.ToolsDataManager;
|
||||
import com.raytheon.viz.grid.GridLevelTranslator;
|
||||
import com.raytheon.viz.grid.rsc.GridLoadProperties;
|
||||
import com.raytheon.viz.skewt.rscdata.SkewTResourceData;
|
||||
import com.raytheon.viz.volumebrowser.vbui.VBMenuBarItemsMgr.ViewMenu;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
|
||||
|
@ -71,13 +70,15 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Oct 6, 2009 2987 jelkins Initial creation
|
||||
* 10-21-09 #1711 bsteffen Updated Baseline and Points to use new ToolsDataManager
|
||||
* 01/30/2012 DR 14308 D.Friedman Use correct style for arrow types.
|
||||
* 07/31/2012 #875 rferrel Now uses points.
|
||||
* Oct 06, 2009 2987 jelkins Initial creation
|
||||
* Oct 21, 2009 1711 bsteffen Updated Baseline and Points to use new
|
||||
* ToolsDataManager
|
||||
* Jan 30, 2012 14308 D.Friedman Use correct style for arrow types.
|
||||
* Jul 31, 2012 875 rferrel Now uses points.
|
||||
* Feb 21, 2013 1617 bsteffen fixed vb sounding point selection for
|
||||
* points which contain the word Point
|
||||
* May 03, 2013 DR14824 mgamazaychikov Added alterProductParameters method
|
||||
* Aug 20, 2013 2259 bsteffen Delete old skewt plugin.
|
||||
*
|
||||
*
|
||||
* </pre>
|
||||
|
@ -193,14 +194,6 @@ public abstract class AbstractDataCatalog implements IDataCatalog {
|
|||
thData.setSource(catalogEntry.getSelectedData().getSourcesText());
|
||||
resourceData = thData;
|
||||
break;
|
||||
case SOUNDING:
|
||||
resourceData = inputResourceData;
|
||||
if ((catalogEntry != null)
|
||||
&& (resourceData instanceof SkewTResourceData)) {
|
||||
((SkewTResourceData) resourceData)
|
||||
.setPointLetter(getPointLetter(catalogEntry));
|
||||
}
|
||||
break;
|
||||
default: // PLAN_VIEW
|
||||
resourceData = null;
|
||||
break;
|
||||
|
@ -241,10 +234,6 @@ public abstract class AbstractDataCatalog implements IDataCatalog {
|
|||
resourceData = getResourceData(catalogEntry, resourceType,
|
||||
new TimeHeightResourceData());
|
||||
break;
|
||||
case SOUNDING:
|
||||
resourceData = getResourceData(catalogEntry, resourceType,
|
||||
new SkewTResourceData());
|
||||
break;
|
||||
default: // PLAN_VIEW
|
||||
resourceData = null;
|
||||
break;
|
||||
|
|
|
@ -87,8 +87,6 @@ import com.raytheon.viz.awipstools.ToolsDataManager;
|
|||
import com.raytheon.viz.core.rsc.ICombinedResourceData;
|
||||
import com.raytheon.viz.core.rsc.ICombinedResourceData.CombineOperation;
|
||||
import com.raytheon.viz.core.slice.request.HeightScales;
|
||||
import com.raytheon.viz.skewt.SkewtDisplay;
|
||||
import com.raytheon.viz.skewt.rscdata.SkewTResourceData;
|
||||
import com.raytheon.viz.ui.BundleProductLoader;
|
||||
import com.raytheon.viz.ui.EditorUtil;
|
||||
import com.raytheon.viz.ui.UiUtil;
|
||||
|
@ -114,12 +112,14 @@ import com.vividsolutions.jts.geom.LineString;
|
|||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jun 8, 2009 #2161 lvenable Initial creation
|
||||
* Mar 27, 2012 #14506 Qinglu Lin For cross section plot along a line of
|
||||
* Jun 08, 2009 2161 lvenable Initial creation
|
||||
* Mar 27, 2012 14506 Qinglu Lin For cross section plot along a line of
|
||||
* latitude, swap xStart and xEnd.
|
||||
* Jan 16, 2013 #1492 rferrel Changes for non-blocking InventoryDlg.
|
||||
* Jan 25, 2013 #15529 kshresth Fixed cross section "Unhandled event loop exception"
|
||||
* when loading contours and Image combo
|
||||
* Jan 16, 2013 1492 rferrel Changes for non-blocking InventoryDlg.
|
||||
* Jan 25, 2013 15529 kshresth Fixed cross section "Unhandled event loop
|
||||
* exception" when loading contours and
|
||||
* Image combo
|
||||
* Aug 20, 2013 2259 bsteffen Delete old skewt plugin.
|
||||
* </pre>
|
||||
*
|
||||
* @author lvenable
|
||||
|
@ -1022,13 +1022,10 @@ public class ProductTableComp extends Composite {
|
|||
// need to handle both legacy skeqwT and nsharp skewT at the same
|
||||
// time.
|
||||
List<ResourcePair> varheightSkewtResources = new ArrayList<ResourcePair>();
|
||||
List<ResourcePair> legacySkewtResources = new ArrayList<ResourcePair>();
|
||||
List<ResourcePair> nsharpSkewtResources = new ArrayList<ResourcePair>();
|
||||
for (ResourcePair pair : resourceList) {
|
||||
if (pair.getResourceData() instanceof D2DNSharpResourceData) {
|
||||
nsharpSkewtResources.add(pair);
|
||||
} else if (pair.getResourceData() instanceof SkewTResourceData) {
|
||||
legacySkewtResources.add(pair);
|
||||
} else if (pair.getResourceData() instanceof VarHeightResourceData) {
|
||||
varheightSkewtResources.add(pair);
|
||||
}
|
||||
|
@ -1036,16 +1033,6 @@ public class ProductTableComp extends Composite {
|
|||
if (!nsharpSkewtResources.isEmpty()) {
|
||||
display = new NsharpSkewTPaneDisplay();
|
||||
display.setDescriptor(new NsharpSkewTPaneDescriptor());
|
||||
if (!legacySkewtResources.isEmpty()) {
|
||||
resourceList.removeAll(legacySkewtResources);
|
||||
loadResources(difference, legacySkewtResources);
|
||||
}
|
||||
if (!varheightSkewtResources.isEmpty()) {
|
||||
resourceList.removeAll(varheightSkewtResources);
|
||||
loadResources(difference, varheightSkewtResources);
|
||||
}
|
||||
} else if (!legacySkewtResources.isEmpty()) {
|
||||
display = new SkewtDisplay();
|
||||
if (!varheightSkewtResources.isEmpty()) {
|
||||
resourceList.removeAll(varheightSkewtResources);
|
||||
loadResources(difference, varheightSkewtResources);
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
#!/usr/bin/python
|
||||
# This script will update any saved displays which use older skewT displays to
|
||||
# use Nsharp.
|
||||
#
|
||||
# This update only needs to be run if there are saved displays being stored
|
||||
# outside of localization, for procedures saved in localization,
|
||||
# updateSkewtProcedures.sh will automatically call this.
|
||||
|
||||
|
||||
import sys
|
||||
import xml.etree.ElementTree as ET
|
||||
|
||||
|
@ -29,7 +38,7 @@ def upgradeBundle(bundleFile):
|
|||
display.set(xsitype,'nsharpSkewTPaneDisplay')
|
||||
descriptor = display.find('descriptor')
|
||||
descriptor.set(xsitype,'nsharpSkewTPaneDescriptor')
|
||||
tree.write(bundleFile.replace('.xml','-converted.xml'))
|
||||
tree.write(bundleFile)
|
||||
|
||||
def getPlugins(xmlDisplay):
|
||||
plugins = set()
|
||||
|
@ -54,16 +63,64 @@ def getConstraintValue(resourceData, key):
|
|||
|
||||
def isNsharp(plugin):
|
||||
return plugin == 'grib' or plugin == 'bufrua' or\
|
||||
plugin == 'goes' or plugin == 'poes' or\
|
||||
plugin == 'acarssounding' or\
|
||||
plugin == 'NAM' or plugin == 'GFS'
|
||||
plugin == 'goessounding' or plugin == 'poessounding' or\
|
||||
plugin == 'acarssounding' or plugin == 'modelsounding'
|
||||
|
||||
def isHodoVarHeight(plugin):
|
||||
return plugin == 'radar' or plugin == 'profiler'
|
||||
|
||||
def convertDisplayToNsharp(xmlDisplay):
|
||||
# TODO this will be written when all the nsharp types are converted.
|
||||
pass
|
||||
xmlDisplay.set(xsitype,'nsharpSkewTPaneDisplay')
|
||||
descriptor = xmlDisplay.find('descriptor')
|
||||
descriptor.set(xsitype,'nsharpSkewTPaneDescriptor')
|
||||
toRemove = []
|
||||
for resource in descriptor.iterfind('resource'):
|
||||
resourceData = resource.find('resourceData')
|
||||
type = resourceData.get(xsitype)
|
||||
if type == 'skewTBkgResourceData':
|
||||
toRemove.append(resource)
|
||||
elif type == 'gribSoundingSkewTResourceData':
|
||||
convertResourceToNsharp(resource)
|
||||
elif type == 'skewTResourceData':
|
||||
convertResourceToNsharp(resource)
|
||||
else:
|
||||
print "Removing unrecognized resource of type: " + type
|
||||
toRemove.append(resource)
|
||||
for resource in toRemove:
|
||||
descriptor.remove(resource)
|
||||
|
||||
def convertResourceToNsharp(xmlResource):
|
||||
resourceData = xmlResource.find('resourceData')
|
||||
plugin = getPluginName(resourceData)
|
||||
if(plugin == 'grib'):
|
||||
resourceData.set(xsitype,'gribNSharpResourceData')
|
||||
resourceData.set('soundingType', getConstraintValue(resourceData, 'info.datasetId'))
|
||||
resourceData.set('pointName', 'Point' + resourceData.get('point'))
|
||||
resourceData.attrib.pop('point')
|
||||
elif(plugin == 'bufrua'):
|
||||
resourceData.set(xsitype,'bufruaNSharpResourceData')
|
||||
resourceData.set('soundingType', 'BUFRUA')
|
||||
elif(plugin == 'modelsounding'):
|
||||
reportType = getConstraintValue(resourceData, 'reportType')
|
||||
if reportType == 'ETA':
|
||||
reportType = 'NAM'
|
||||
resourceData.set('soundingType', reportType + 'SND')
|
||||
resourceData.set(xsitype,'mdlSndNSharpResourceData')
|
||||
elif(plugin == 'goessounding'):
|
||||
resourceData.set('soundingType', 'GOES')
|
||||
resourceData.set(xsitype,'goesSndNSharpResourceData')
|
||||
elif(plugin == 'poessounding'):
|
||||
resourceData.set('soundingType', 'POES')
|
||||
resourceData.set(xsitype,'poesSndNSharpResourceData')
|
||||
elif(plugin == 'acarssounding'):
|
||||
resourceData.set('soundingType', 'MDCRS')
|
||||
resourceData.set(xsitype,'acarsSndNSharpResourceData')
|
||||
loadProperties = xmlResource.find('loadProperties')
|
||||
if loadProperties is not None:
|
||||
# since nsharp doesn't use any capabilities just drop them all.
|
||||
capabilities = loadProperties.find('capabilities')
|
||||
if capabilities is not None:
|
||||
loadProperties.remove(capabilities)
|
||||
|
||||
def convertDisplayToHodoVarHeight(xmlDisplay):
|
||||
xmlDisplay.set(xsitype,'varHeightRenderableDisplay')
|
||||
|
|
|
@ -4,14 +4,10 @@ Bundle-Name: Sounding Plug-in
|
|||
Bundle-SymbolicName: com.raytheon.uf.common.sounding
|
||||
Bundle-Version: 1.12.1174.qualifier
|
||||
Bundle-Vendor: RAYTHEON
|
||||
Eclipse-RegisterBuddy: com.raytheon.uf.common.serialization
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Require-Bundle: com.raytheon.uf.common.pointdata;bundle-version="1.11.31",
|
||||
com.raytheon.uf.common.dataplugin;bundle-version="1.11.31",
|
||||
com.raytheon.uf.common.geospatial;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.serialization;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.status;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.localization;bundle-version="1.12.1174",
|
||||
com.raytheon.edex.meteolib;bundle-version="1.12.1174",
|
||||
javax.measure;bundle-version="1.0.0"
|
||||
Export-Package: com.raytheon.uf.common.sounding,
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
com.raytheon.uf.common.sounding.util.SoundingPrefs
|
|
@ -1,126 +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.common.sounding;
|
||||
|
||||
/**
|
||||
* ParcelLift.java Sept 28, 2008
|
||||
*
|
||||
* <pre>
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 28 Sept 2008 dhladky new class.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author dhladky
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class ParcelLift {
|
||||
|
||||
private Double startPressure = null;
|
||||
private boolean maxTemp = false;
|
||||
private String name = null;
|
||||
|
||||
public enum PARCEL_TYPE {
|
||||
PMAX("PMAX"), SURFACE("Surface"),
|
||||
MEANTEMP("Mean Temp"), USERSELECT("User Select");
|
||||
|
||||
private final String dataName;
|
||||
|
||||
private PARCEL_TYPE(String dataName) {
|
||||
this.dataName = dataName;
|
||||
}
|
||||
|
||||
public String getDataName() {
|
||||
return dataName;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* public constructor
|
||||
* @param name
|
||||
* @param startpressure
|
||||
*/
|
||||
public ParcelLift(PARCEL_TYPE type, Double startPressure, boolean maxTemp) {
|
||||
|
||||
if (startPressure != null) {
|
||||
setStartPressure(startPressure);
|
||||
setMaxTemp(maxTemp);
|
||||
}
|
||||
|
||||
for (PARCEL_TYPE pt: PARCEL_TYPE.values()) {
|
||||
if (pt.getDataName().equals(type.getDataName())) {
|
||||
setName(type.getDataName());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Set start presure when needed.
|
||||
* @param startPressure
|
||||
*/
|
||||
private void setStartPressure(Double startPressure) {
|
||||
this.startPressure = startPressure;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set use fcst mac temp
|
||||
* @param startPressure
|
||||
*/
|
||||
private void setMaxTemp(boolean maxTemp) {
|
||||
this.maxTemp = maxTemp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the starting pressure when needed.
|
||||
* @return double
|
||||
*/
|
||||
public Double getStartPressure() {
|
||||
return startPressure;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the starting pressure when needed.
|
||||
* @return double
|
||||
*/
|
||||
public boolean getMaxTemp() {
|
||||
return maxTemp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the name.
|
||||
* @param name
|
||||
*/
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the name
|
||||
* @return
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
}
|
|
@ -20,7 +20,6 @@
|
|||
package com.raytheon.uf.common.sounding;
|
||||
|
||||
import com.raytheon.edex.meteoLib.Controller;
|
||||
import com.raytheon.uf.common.sounding.util.SoundingPrefs;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
|
||||
/**
|
||||
|
@ -34,8 +33,9 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* 06 Nov 2006 jkorman Initial Coding
|
||||
* 29 Sept 2008 dhladky Added more stuff to finish SkewT.
|
||||
* 25 Jul 2013 2190 mschenke Moved common sounding calculation
|
||||
* from PopupSkewTDialog to here
|
||||
* 25 Jul 2013 2190 mschenke Moved common sounding calculation from
|
||||
* PopupSkewTDialog to here
|
||||
* Aug 20, 2013 2259 bsteffen Delete old skewt plugin.
|
||||
* </pre>
|
||||
*
|
||||
* @author jkorman
|
||||
|
@ -205,46 +205,6 @@ public class WxMath {
|
|||
return new Coordinate(spd, dir);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a pressure and temperature to a skew-t x,y coordinate in
|
||||
* centimeters where 0,0 occurs at 1000 hPa and 0 degrees Celsius.
|
||||
*
|
||||
* @param pressure
|
||||
* The pressure in hectoPascals (millibars).
|
||||
* @param temperature
|
||||
* The temperature in degrees Celsius.
|
||||
* @return The calculated coordinate in centimeters.
|
||||
*/
|
||||
public static final Coordinate getSkewTXY(double pressure,
|
||||
double temperature) {
|
||||
temperature -= SoundingPrefs.getSoundingPrefs().getTemperatureOffset();
|
||||
Coordinate point = new Coordinate();
|
||||
|
||||
point.y = 132.182 - 44.061 * Math.log10(pressure);
|
||||
point.x = (0.54 * temperature) + (0.90692 * point.y);
|
||||
|
||||
return point;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse a skewT coordinate (in centimeters) to the corresponding
|
||||
* temperature and pressure.
|
||||
*
|
||||
* @param point
|
||||
* @return The temperature and pressure. coordinate.x = temperature in
|
||||
* Celsius, coordinate.y = the pressure in hectoPascals (millibars).
|
||||
*/
|
||||
public static final Coordinate reverseSkewTXY(Coordinate point) {
|
||||
Coordinate tempPressure = new Coordinate();
|
||||
tempPressure.y = Math.pow(10, ((point.y - 132.182) / -44.061));
|
||||
tempPressure.x = (point.x - (0.90692 * point.y)) / 0.54;
|
||||
|
||||
tempPressure.x += SoundingPrefs.getSoundingPrefs()
|
||||
.getTemperatureOffset();
|
||||
|
||||
return tempPressure;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compute the final temperature of a parcel moved dry adiabatically from
|
||||
* its initial pressure and temperature to a final pressure.
|
||||
|
|
|
@ -1,100 +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.common.sounding.util;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
import com.raytheon.uf.common.localization.IPathManager;
|
||||
import com.raytheon.uf.common.localization.LocalizationContext;
|
||||
import com.raytheon.uf.common.localization.PathManagerFactory;
|
||||
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
|
||||
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
|
||||
import com.raytheon.uf.common.serialization.SerializationException;
|
||||
import com.raytheon.uf.common.serialization.SerializationUtil;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
|
||||
/**
|
||||
*
|
||||
* TODO Add Description
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jun 15, 2011 bsteffen Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author bsteffen
|
||||
* @version 1.0
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
@XmlRootElement
|
||||
public class SoundingPrefs {
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(SoundingPrefs.class);
|
||||
|
||||
private static final String SOUNDING_PREFS_FILE = "sounding/soundingPrefs.xml";
|
||||
|
||||
@XmlElement
|
||||
private double temperatureOffset = 0.0;
|
||||
|
||||
public double getTemperatureOffset() {
|
||||
return temperatureOffset;
|
||||
}
|
||||
|
||||
public void setTemperatureOffset(double temperatureOffset) {
|
||||
this.temperatureOffset = temperatureOffset;
|
||||
}
|
||||
|
||||
private static SoundingPrefs soundingPrefs;
|
||||
|
||||
public static SoundingPrefs getSoundingPrefs() {
|
||||
if(soundingPrefs == null) {
|
||||
IPathManager pathMgr = PathManagerFactory.getPathManager();
|
||||
LocalizationContext lc = pathMgr.getContext(
|
||||
LocalizationType.COMMON_STATIC, LocalizationLevel.SITE);
|
||||
File file = pathMgr.getFile(lc, SOUNDING_PREFS_FILE);
|
||||
if(file == null || !file.exists()) {
|
||||
lc = pathMgr.getContext(
|
||||
LocalizationType.COMMON_STATIC, LocalizationLevel.BASE);
|
||||
file = pathMgr.getFile(lc, SOUNDING_PREFS_FILE);
|
||||
}
|
||||
try {
|
||||
soundingPrefs = (SoundingPrefs) SerializationUtil.jaxbUnmarshalFromXmlFile(file);
|
||||
} catch (SerializationException e) {
|
||||
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
|
||||
soundingPrefs = new SoundingPrefs();
|
||||
}
|
||||
}
|
||||
return soundingPrefs;
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
<soundingPrefs>
|
||||
<temperatureOffset>0</temperatureOffset>
|
||||
</soundingPrefs>
|
|
@ -11,6 +11,7 @@
|
|||
* Date Ticket# Engineer Description
|
||||
* ------- ------- -------- -----------
|
||||
* 04/30/2012 229 Chin Chen Initial coding
|
||||
* 08/20/2013 2259 bsteffen Delete old skewt plugin.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -40,7 +41,6 @@ import gov.noaa.nws.ncep.ui.nsharp.view.NsharpPaletteWindow;
|
|||
import gov.noaa.nws.ncep.ui.nsharp.view.NsharpParcelDialog;
|
||||
import gov.noaa.nws.ncep.ui.nsharp.view.NsharpShowTextDialog;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
import java.text.DateFormatSymbols;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
|
@ -56,7 +56,6 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.StringTokenizer;
|
||||
import java.util.TimeZone;
|
||||
|
||||
import org.eclipse.core.runtime.ListenerList;
|
||||
import org.eclipse.swt.graphics.GC;
|
||||
|
@ -70,7 +69,6 @@ import com.raytheon.uf.viz.core.drawables.IRenderableDisplay;
|
|||
import com.raytheon.uf.viz.core.drawables.IWireframeShape;
|
||||
import com.raytheon.uf.viz.core.drawables.ResourcePair;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.sounding.SoundingParams;
|
||||
import com.raytheon.viz.core.graphing.LineStroke;
|
||||
import com.raytheon.viz.core.graphing.WGraphics;
|
||||
import com.raytheon.viz.core.graphing.WindBarbFactory;
|
||||
|
@ -135,8 +133,6 @@ public class NsharpResourceHandler {
|
|||
protected static final double BARB_LENGTH = 3.5;
|
||||
private String soundingType= null;
|
||||
|
||||
protected Map<Date, SoundingParams> soundingMap;
|
||||
|
||||
protected DataTime displayedSounding;
|
||||
|
||||
private int currentGraphMode= NsharpConstants.GRAPH_SKEWT;
|
||||
|
@ -2425,7 +2421,6 @@ public class NsharpResourceHandler {
|
|||
public NsharpResourceHandler(IRenderableDisplay[] displayArray, NsharpEditor editor) {
|
||||
//System.out.println("NsharpResourceHandler constructed");
|
||||
//myNsharpEditor = editor;
|
||||
this.soundingMap = new HashMap<Date, SoundingParams>();
|
||||
elementColorMap.put(NsharpConstants.ActState.CURRENT.name(),NsharpConstants.color_green);
|
||||
elementColorMap.put(NsharpConstants.ActState.ACTIVE.name(),NsharpConstants.color_yellow);
|
||||
elementColorMap.put(NsharpConstants.ActState.INACTIVE.name(),NsharpConstants.color_white);
|
||||
|
@ -2465,7 +2460,6 @@ public class NsharpResourceHandler {
|
|||
}
|
||||
public void disposeInternal() {
|
||||
//System.out.println("NsharpResourceHandler disposeInternal called");
|
||||
soundingMap= null;
|
||||
listenerList=null;
|
||||
soundingLys = null;
|
||||
previousSoundingLys = null;
|
||||
|
|
Loading…
Add table
Reference in a new issue