diff --git a/cave/com.raytheon.uf.viz.acarssounding/META-INF/MANIFEST.MF b/cave/com.raytheon.uf.viz.acarssounding/META-INF/MANIFEST.MF
index 0d11b931ce..368d2be29f 100644
--- a/cave/com.raytheon.uf.viz.acarssounding/META-INF/MANIFEST.MF
+++ b/cave/com.raytheon.uf.viz.acarssounding/META-INF/MANIFEST.MF
@@ -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",
diff --git a/cave/com.raytheon.uf.viz.acarssounding/plugin.xml b/cave/com.raytheon.uf.viz.acarssounding/plugin.xml
deleted file mode 100644
index 7b63413bba..0000000000
--- a/cave/com.raytheon.uf.viz.acarssounding/plugin.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
- * - * SOFTWARE HISTORY - * Date Ticket# Engineer Description - * ------------ ---------- ----------- -------------------------- - * Dec 01, 2008 1747 jkorman Initial creation - * Aug 14, 2013 2262 dgilling Use new wxmath method for ztopsa. - * - *- * - * @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
- * - * SOFTWARE HISTORY - * - * Date Ticket# Engineer Description - * ------------ ---------- ----------- -------------------------- - * Aug 31, 2012 bsteffen Initial creation - * - *- * - * @author bsteffen - * @version 1.0 - */ - -public class D2DNSharpDescriptor extends NsharpSkewTPaneDescriptor { - -} diff --git a/cave/com.raytheon.uf.viz.d2d.nsharp/src/com/raytheon/uf/viz/d2d/nsharp/display/D2DNSharpDisplay.java b/cave/com.raytheon.uf.viz.d2d.nsharp/src/com/raytheon/uf/viz/d2d/nsharp/display/D2DNSharpDisplay.java deleted file mode 100644 index fa32696825..0000000000 --- a/cave/com.raytheon.uf.viz.d2d.nsharp/src/com/raytheon/uf/viz/d2d/nsharp/display/D2DNSharpDisplay.java +++ /dev/null @@ -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. - * - *
- * - * SOFTWARE HISTORY - * - * Date Ticket# Engineer Description - * ------------ ---------- ----------- -------------------------- - * Aug 31, 2012 bsteffen Initial creation - * - *- * - * @author bsteffen - * @version 1.0 - */ -@XmlRootElement -public class D2DNSharpDisplay extends NsharpSkewTPaneDisplay { - -} diff --git a/cave/com.raytheon.uf.viz.d2d.skewt.feature/feature.xml b/cave/com.raytheon.uf.viz.d2d.skewt.feature/feature.xml index 1616f31998..4ece90827e 100644 --- a/cave/com.raytheon.uf.viz.d2d.skewt.feature/feature.xml +++ b/cave/com.raytheon.uf.viz.d2d.skewt.feature/feature.xml @@ -36,12 +36,6 @@ install-size="0" version="0.0.0"/> -
- * - * SOFTWARE HISTORY - * Date Ticket# Engineer Description - * ------------ ---------- ----------- -------------------------- - * Oct 5, 2009 randerso Initial creation - * - *- * - * @author randerso - * @version 1.0 - */ - -public class SoundingParams { - private VerticalSounding interleavedData; - - private VerticalSounding analysisData; - - private float[] _pressure; - - private float[] _height; - - private float[] _temp; - - private float[] _dewPoint; - - private double[] _wetbulbs; - - private float[] _uComp; - - private float[] _vComp; - - private int _hour; - - private float[] _virtTemp; - - private float[] _parcelP; - - private float[] _parcelZ; - - private float[] _parcelT; - - private float[] _parcelVirtT; - - private float[] _envVirtTemp; - - private float[] _environTemp; - - private int _numParLvls; - - private int _gustPotential; - - private float _precipWater; - - private float _LIdx; - - private float _KIndex; - - private float _Totals; - - private float _sweatIdx; - - private float _convTemp; - - private float _maxTemp; - - private float _frzgLvlZ; - - private float _frzgLvlP; - - private float _pressWBZ; - - private float _tempWBZ; - - private float _hgtWBZ; - - private float _soarIndex; - - private float _triggerTemp_C; - - private float _pLFC1; - - private float _zLFC1; - - private float _tLFC1; - - private float _pLFC2; - - private float _zLFC2; - - private float _tLFC2; - - private float _pEqLvl; - - private float _zEqLvl; - - private float _tEqLvl; - - private float _maxVVel; - - private float _hailSize; - - private float _hgtCldTop; - - private float _posBuoy; - - private float _negBuoy; - - private float _CINfrmCAPE; - - private float _richNum; - - private float _mdpi; - - private float _windex; - - private WindComp avgWind; - - private WindComp helicity; - - private float _meanMixRatio; - - private float _initParT_C; - - private float _initParTd_C; - - private float _initParP; - - private float _pressLCL; - - private float _hgtLCL; - - private float _tempLCL; - - private float _mixLCL; - - private float _thetaLCL; - - private float _theta_eLCL; - - private float _temp500; - - private float _pressCCL; - - private float _tempCCL; - - private float _hgtCCL; - - private PARCEL_TYPE _liftingMethod = PARCEL_TYPE.SURFACE; - - private boolean _restoreSkewT; - - private boolean _isInitialDisplay = true; - - private boolean _useFcstMax = true; - - private float _userLevel = 0f; - - private boolean _is12ZTime = false; - - private float _ghx = 0; - - private float _ghy = 0; - - private static final UnitConverter kelvinToCelsius = SI.KELVIN - .getConverterTo(SI.CELSIUS); - - private static final UnitConverter celciusToKelvin = SI.CELSIUS - .getConverterTo(SI.KELVIN); - - private float _hgtHelLyr = 3000.0f; // hgt of the layer for determining - - // helicity - - /** - * Constructor for the sounding parameters. Used for RaobOA - */ - public SoundingParams(VerticalSounding vs, float[] levels) { - interleavedData = vs; - fillOutHeights(interleavedData, false); - - analysisData = down_interp(interleavedData, levels); - } - - /** - * Constructor for the sounding parameters. Used for SkewT - */ - public SoundingParams(VerticalSounding vs) { - interleavedData = vs; - - // interpolate the current raob data - int hgtDiff = 50; - fillOutHeights(interleavedData, false); - interleavedData.invalidate(); - analysisData = rebuildDataInHgt(vs, hgtDiff); - - _temp500 = transDataStyle(); - - _hour = vs.getDataTime().getValidTime().get(Calendar.HOUR_OF_DAY); - - // _temp500 = interleavedData.getLayerNearest(500).getTemperature(); - - clearIndices(); - - // calculate the preliminary parcel info - if (_temp.length > 3) { - _maxTemp = computeFcstMaxTemp(); - - // calculate the convective temperature; essential for - // determining other parameters - computeConvTemp(); - - // determine the parcel temp/pressures needed for buoyancy - // calculations - computeParcelInfo(); - } - } - - /** - * @return the _pressure - */ - public float[] getPressures() { - return _pressure; - } - - /** - * @return the _height - */ - public float[] getHeights() { - return _height; - } - - /** - * @return the _temp - */ - public float[] getTemperatures() { - return _temp; - } - - /** - * @return the _wetbulbs in Celcius - */ - public double[] getWetbulbs() { - return _wetbulbs; - } - - /** - * @return the _dewPoint - */ - public float[] getDewPoints() { - return _dewPoint; - } - - /** - * @return the _uComp - */ - public float[] getWindUs() { - return _uComp; - } - - /** - * @return the _vComp - */ - public float[] getWindVs() { - return _vComp; - } - - private void clearIndices() { - _gustPotential = (int) MISSING; - _precipWater = MISSING; - _LIdx = MISSING; - _KIndex = MISSING; - _Totals = MISSING; - _sweatIdx = MISSING; - _convTemp = MISSING; - _maxTemp = MISSING; - _frzgLvlZ = MISSING; - _frzgLvlP = MISSING; - _pressWBZ = MISSING; - _tempWBZ = MISSING; - _hgtWBZ = MISSING; - _soarIndex = MISSING; - _triggerTemp_C = MISSING; - _pLFC1 = MISSING; - _zLFC1 = MISSING; - _tLFC1 = MISSING; - _pLFC2 = MISSING; - _zLFC2 = MISSING; - _tLFC2 = MISSING; - _pEqLvl = MISSING; - _zEqLvl = MISSING; - _tEqLvl = MISSING; - _maxVVel = MISSING; - _hailSize = MISSING; - _hgtCldTop = MISSING; - _posBuoy = MISSING; - _negBuoy = MISSING; - _CINfrmCAPE = MISSING; - _richNum = MISSING; - _mdpi = MISSING; - _windex = MISSING; - _meanMixRatio = MISSING; - _initParT_C = MISSING; - _initParTd_C = MISSING; - _initParP = MISSING; - _pressLCL = MISSING; - _hgtLCL = MISSING; - _tempLCL = MISSING; - _mixLCL = MISSING; - _thetaLCL = MISSING; - _theta_eLCL = MISSING; - _pressCCL = MISSING; - _tempCCL = MISSING; - _hgtCCL = MISSING; - } - - private float computeFcstMaxTemp() { - float elev = analysisData.get(0).getGeoHeight(); - float maxTemp; - - // do nothing if no data or not a sounding between 06Z & 17Z - if (elev >= MISSING || _hour < 6 || _hour >= 18 || _temp[0] >= MISSING) { - // maxTemp = 999.0f; - maxTemp = MISSING; - return maxTemp; - } - - maxTemp = computeFcstMaxTemp(_pressure, _height, _temp, _dewPoint, - interleavedData.getStationId(), interleavedData.getDataTime(), - (float) interleavedData.getLatitude(), - (float) interleavedData.getLongitude()); - return maxTemp; - } - - private void computeConvTemp() { - int n = _temp.length; - - float levelDewPt; - float e = 0.0f; - // morning soundings are between 6Z and 18Z - if (_hour >= 6 && _hour < 18) { - // calculate the mean mixing ratio in lowest 50 mb of sounding. - // Used for later parcel and parameter calculations. - int j = 0; - while (j < n && _temp[j] >= MISSING) { - j++; - } - int i = j; - _meanMixRatio = 0.0f; - while (++i < n && _pressure[0] - _pressure[i] <= 50) { - levelDewPt = _dewPoint[i]; - e = Controller.esat(levelDewPt); - _meanMixRatio += (0.622 * e) / (_pressure[i] - e); - } - levelDewPt = _dewPoint[i]; - e = Controller.esat(levelDewPt); - _meanMixRatio += (0.622 * e) / (_pressure[i] - e); - _meanMixRatio /= (i - j); - } else // at other times compute the mixing ratio at the surface - // dewpoint - { - levelDewPt = _dewPoint[0]; - e = Controller.esat(levelDewPt); - _meanMixRatio = (0.622f * e) / (_pressure[0] - e); - } - - computeConvTemp(_pressure, _height, _temp, _meanMixRatio); - } - - private void computeParcelInfo() { - int n = _temp.length; - // lack of data, so no need to continue - if (n < 3) { - return; - } - // if 06Z - 17Z sounding, use the calculated max temp as a sfctemp - if (_hour >= 6 && _hour < 18) { - _is12ZTime = true; - } - - if (_liftingMethod != PARCEL_TYPE.USERSELECT) { - _initParP = MISSING; - _initParT_C = MISSING; - _initParTd_C = MISSING; - _numParLvls = 0; - } - - if (_restoreSkewT) { - _liftingMethod = PARCEL_TYPE.SURFACE; - } - - switch (_liftingMethod) { - - case PMAX: // pmax method of lifting - computePmaxLifting(_initParP, _initParT_C, _initParTd_C); - break; - - case MEANTEMP: // mean thermal lifting - computeMeanTLifting(_initParP, _initParT_C, _initParTd_C); - break; - - case USERSELECT: // user-selected level - _initParP = _userLevel; - computeUserLifting(_initParP, _initParT_C, _initParTd_C); - break; - - case SURFACE: // lift from the surface - default: - computeSurfaceLifting(_initParP, _initParT_C, _initParTd_C); - break; - } - - // compute buoyancy and hailsize - hailSize(); - // compute the Wetbulb profile - computeWBS(_pressure, _temp, _dewPoint); - } - - /** - * Based upon the surface values, compute the associated LCL and parcel - * track trajectory. - * - * @param parTd_C - * @param parT_C - * @param parP - * - */ - private void computeSurfaceLifting(float parP, float parT_C, float parTd_C) { - float parcelTd_C = 0.0f; - float newParcelT = 0f; - float newParcelP = 0f; - float testNewParcelT = 0f; - - // find first occurrance in the array of valid temps and assign - // accordingly - for (int i = 0; i < _temp.length; i++) { - if (_temp[i] > SoundingLayer.NODATA) { - continue; - } - newParcelP = _pressure[i]; - newParcelT = (float) kelvinToCelsius.convert(_temp[i]); - parcelTd_C = (float) kelvinToCelsius.convert(_dewPoint[i]); - testNewParcelT = _temp[i]; - if (testNewParcelT > _maxTemp) { - _maxTemp = computeFcstMaxTemp(); - } - break; - } - - if (!_is12ZTime) { - _useFcstMax = false; - _maxTemp = SoundingLayer.NODATA; - } - if (_isInitialDisplay) { - if (_is12ZTime) { - _maxTemp = computeFcstMaxTemp(); - newParcelT = (float) kelvinToCelsius.convert(_maxTemp); - } - _isInitialDisplay = false; - } - - if (!_restoreSkewT) { - // use the forecast max temp for parcel temp - if (_useFcstMax) { - newParcelT = (float) kelvinToCelsius.convert(_maxTemp); - } - - } - _initParT_C = newParcelT; - _initParP = newParcelP; - _initParTd_C = parcelTd_C; - float sfcTemp = MISSING; - - if (_initParT_C != MISSING) { - sfcTemp = (float) celciusToKelvin.convert(_initParT_C); - } - // compute the LCL - computeLCL(_pressure, _height, _temp, _dewPoint, sfcTemp, _meanMixRatio); - _meanMixRatio = _mixLCL; - - // compute the Wetbulb profile - computeWBS(_pressure, _temp, _dewPoint); - - // compute parcel characteristics at each sounding level; - computeParcelLvls(_pressure, _height, _temp, _dewPoint, newParcelP, - newParcelT, _pressLCL, _hgtLCL, _tempLCL, _thetaLCL, - _theta_eLCL, _mixLCL); - - } - - /** - * - */ - private void computeUserLifting(float newParcelP, float parcelT, - float parcelTd) { - float parcelT_K = 0f; - float parcelTd_K = 0f; - float ParcelP = newParcelP; - float[] parcelVals = { ParcelP, parcelT_K, parcelTd_K }; - selectLevel(parcelVals); - ParcelP = parcelVals[0]; - parcelT_K = parcelVals[1]; - parcelTd_K = parcelVals[2]; - parcelT = (float) kelvinToCelsius.convert(parcelT_K); - parcelTd = (float) kelvinToCelsius.convert(parcelTd_K); - float newParcelT = parcelT; - - // compute the LCL - computeLCL(_pressure, _height, _temp, _dewPoint, parcelT_K, - _meanMixRatio); - _meanMixRatio = _mixLCL; - - _initParP = ParcelP; - _initParT_C = parcelT; - _initParTd_C = parcelTd; - - // compute the Wetbulb profile - computeWBS(_pressure, _temp, _dewPoint); - - if (_hgtLCL < MISSING) { - // compute parcel characteristics at each sounding level; - computeParcelLvls(_pressure, _height, _temp, _dewPoint, newParcelP, - newParcelT, _pressLCL, _hgtLCL, _tempLCL, _thetaLCL, - _theta_eLCL, _meanMixRatio); - } - - } - - /** - * @param parcelVals - */ - private void selectLevel(float[] parcelVals) { - float parcelT = MISSING; - float parcelTd = MISSING; - - float newParcelP = parcelVals[0]; - int index = 0; - // An invalid pressure level below the observed surface value - if (newParcelP > _pressure[0]) { - return; - } - // loop thru each level, finding the closest pressure and calculate - // it's index pointer to that level - while ((newParcelP <= _pressure[index]) && index < _pressure.length) { - index++; - } - - if (_pressure[index - 1] == newParcelP) { - parcelT = _temp[index - 1]; - parcelTd = _dewPoint[index - 1]; - } else // interpolate new parcel values - { - float logNewP = (float) Math.log(newParcelP); - float logP1 = (float) Math.log(_pressure[index - 1]); - float logP2 = (float) Math.log(_pressure[index]); - parcelT = _temp[index] - + ((_temp[index - 1] - _temp[index]) * ((logNewP - logP2) / (logP1 - logP2))); - parcelTd = _dewPoint[index] - + ((_dewPoint[index - 1] - _dewPoint[index]) * ((parcelT - _temp[index]) / (_temp[index - 1] - _temp[index]))); - } - parcelVals[1] = parcelT; - parcelVals[2] = parcelTd; - } - - /** - * - */ - private void computeMeanTLifting(float parcelP, float parcelT, - float parcelTd) { - float parcelT_K = 0f; - float parcelTd_K = 0f; - float ParcelP = parcelP; - float[] parcelVals = { ParcelP, parcelT_K, parcelTd_K }; - meanThermalParams(parcelVals); - ParcelP = parcelVals[0]; - parcelT_K = parcelVals[1]; - parcelTd_K = parcelVals[2]; - parcelT = (float) kelvinToCelsius.convert(parcelT_K); - parcelTd = (float) kelvinToCelsius.convert(parcelTd_K); - float newParcelT = parcelT; - float newParcelP = parcelP; - float[] newP = new float[_pressure.length]; - float[] newT = new float[_pressure.length]; - float[] newTd = new float[_pressure.length]; - float[] newZ = new float[_pressure.length]; - int i = 0; - int j = 0; - for (i = 0; i < _pressure.length; i++) { - if (_pressure[i] > parcelP) { - continue; - } - newP[j] = _pressure[i]; - newZ[j] = _height[i]; - newT[j] = _temp[i]; - newTd[j] = _dewPoint[i]; - j++; - } - int newn = j; - j = 0; - float levelDewPt; - float e = 0.0f; - while (j < newn && newT[j] > 99998.0) { - j++; - } - i = j; - float meanMixRatio = 0.0f; - while (++i < newn && newP[0] - newP[i] <= 100) { - levelDewPt = newTd[i]; - e = Controller.esat(levelDewPt); - meanMixRatio += (0.622 * e) / (newP[i] - e); - } - levelDewPt = newTd[i]; - e = Controller.esat(levelDewPt); - meanMixRatio /= (i - j); - _meanMixRatio = meanMixRatio; - - // compute the LCL - computeLCL(_pressure, _height, _temp, _dewPoint, parcelT_K, - _meanMixRatio); - _mixLCL = _meanMixRatio; - - _initParP = ParcelP; - _initParT_C = parcelT; - _initParTd_C = parcelTd; - - // compute the Wetbulb profile - computeWBS(_pressure, _temp, _dewPoint); - - if (_hgtLCL < MISSING) { - // compute parcel characteristics at each sounding level; - computeParcelLvls(newP, newZ, newT, newTd, newParcelP, newParcelT, - _pressLCL, _hgtLCL, _tempLCL, _thetaLCL, _theta_eLCL, - _mixLCL); - } - - } - - /** - * @param parcelVals - */ - private void meanThermalParams(float[] vals) { - // initialize variables - float sumTheta = 0.0f; // sum of potential temps - float meanTP = 0.0f; // mean potential temp - int index = 0; // count of levels in lowest 100 mb - boolean foundSurfaceP = false; - float sfcPressure = MISSING; - float parcelP = MISSING; - float parcelT = MISSING; - float parcelTd = MISSING; - - // loop thru each level, summing up the potential temperatures - // until we are 100 mb above the surface - while ((_pressure[0] - _pressure[index + 1] <= 100) - && index < _pressure.length) { - if (!foundSurfaceP && _temp[index] > -99999.0) { - sfcPressure = _pressure[index]; - foundSurfaceP = true; - } - // don't want to sum up missing values, so skip if missing - if (_temp[index] <= -99998.0) { - continue; - } - - sumTheta += _temp[index] - * Math.pow((1000.0 / _pressure[index]), 0.286); - index++; - } - - // compute the mean potential temp in the layer (sfc+100mb) - float pTop = (float) (sfcPressure - 100.0); - meanTP = (float) ((sumTheta + (_temp[index] * Math.pow((1000.0 / pTop), - 0.286))) / (index + 1)); - - float thetaFirst, thetaSecond; - - // iterate thru the layer and determine mean parcel characteristics - // by comparing mean pot temp with adjacent sounding levels - for (int i = 0; i < index; i++) { - thetaFirst = (float) (_temp[i] * Math.pow((1000.0 / _pressure[i]), - 0.286)); - thetaSecond = (float) (_temp[i + 1] * Math.pow( - (1000.0 / _pressure[i + 1]), 0.286)); - // determine if level representative of the mean pot temp... - if ((thetaFirst <= meanTP && meanTP < thetaSecond) - || (thetaSecond <= meanTP && meanTP < thetaFirst)) { - // ...it is, so interpolate to find P, T, & Td - parcelT = _temp[i + 1] - + ((_temp[i] - _temp[i + 1]) * ((meanTP - thetaSecond) / (thetaFirst - thetaSecond))); - parcelTd = _dewPoint[i + 1] - + ((_dewPoint[i] - _dewPoint[i + 1]) * ((meanTP - thetaSecond) / (thetaFirst - thetaSecond))); - float logP1 = (float) Math.log(_pressure[i]); - float logP2 = (float) Math.log(_pressure[i + 1]); - parcelP = (float) Math - .exp(logP2 - + ((logP1 - logP2) * ((meanTP - thetaSecond) / (thetaFirst - thetaSecond)))); - break; - } - } - vals[0] = parcelP; - vals[1] = parcelT; - vals[2] = parcelTd; - } - - /** - * Based upon the pmax values, compute the associated LCL and parcel track. - * - * @param parTd_C - * @param parT_C - * @param parP - * - */ - private void computePmaxLifting(float parcelP, float parcelT, float parcelTd) { - float parcelT_K = 0f; - float parcelTd_K = 0f; - float ParcelP = parcelP; - float[] parcelVals = { ParcelP, parcelT_K, parcelTd_K }; - pmax(parcelVals); - ParcelP = parcelVals[0]; - parcelT_K = parcelVals[1]; - parcelTd_K = parcelVals[2]; - parcelT = (float) kelvinToCelsius.convert(parcelT_K); - parcelTd = (float) kelvinToCelsius.convert(parcelTd_K); - float newParcelT = parcelT; - float newParcelP = parcelP; - - // compute the LCL - computeLCL(_pressure, _height, _temp, _dewPoint, parcelT_K, - _meanMixRatio); - _meanMixRatio = _mixLCL; - - _initParP = ParcelP; - _initParT_C = parcelT; - _initParTd_C = parcelTd; - - // compute the Wetbulb profile - computeWBS(_pressure, _temp, _dewPoint); - - if (_hgtLCL < MISSING) { - // compute parcel characteristics at each sounding level; - computeParcelLvls(_pressure, _height, _temp, _dewPoint, newParcelP, - newParcelT, _pressLCL, _hgtLCL, _tempLCL, _thetaLCL, - _theta_eLCL, _mixLCL); - } - - } - - /** - * @param parcelP - * @param parcelT_K - * @param parcelTd_K - */ - private void pmax(float[] vals) { - Float theta_e = 0f; - Float twTest = 0f; - Float parcelTw = 0f; - Float temp = 0f; - Float dewPoint = 0f; - Float pressure = 0f; - int i = 0; - float parcelTd = -MISSING; - float parcelP = -MISSING; - float parcelT = -MISSING; - parcelTw = -MISSING; - - // loop thru each level, testing it's wet bulb potential temp against - // the max value. - while (((_pressure[0] - _pressure[++i]) <= 50) && (i < _temp.length)) { - temp = _temp[i]; - dewPoint = _dewPoint[i]; - pressure = _pressure[i]; - theta_e = Controller.ept(temp, dewPoint, pressure); - twTest = Controller.tsa(theta_e, pressure); - if (twTest > parcelTw) { - parcelTw = twTest; - parcelP = _pressure[i]; - parcelT = _temp[i]; - parcelTd = _dewPoint[i]; - } - } - vals[0] = parcelP; - vals[1] = parcelT; - vals[2] = parcelTd; - } - - public VerticalSounding getAnalysisData() { - return analysisData; - } - - public void recomputeSoundingParams(VerticalSounding vs) { - interleavedData = vs; - - // interpolate the current raob data - int hgtDiff = 50; - fillOutHeights(interleavedData, false); - interleavedData.invalidate(); - analysisData = rebuildDataInHgt(vs, hgtDiff); - - _temp500 = transDataStyle(); - - _hour = vs.getDataTime().getValidTime().get(Calendar.HOUR_OF_DAY); - - // _temp500 = interleavedData.getLayerNearest(500).getTemperature(); - - clearIndices(); - - // calculate the preliminary parcel info - if (_temp.length > 3) { - _maxTemp = computeFcstMaxTemp(); - - // calculate the convective temperature; essential for - // determining other parameters - computeConvTemp(); - - // determine the parcel temp/pressures needed for buoyancy - // calculations - computeParcelInfo(); - } - } - - public void recomputeParcelInfo() { - this.computeParcelInfo(); - } - - public VerticalSounding getInterleavedData() { - return interleavedData; - } - - public WindComp avgWind() { - if (avgWind == null) { - int n = _uComp.length; - if (n <= 3) { - return avgWind; - } - float elev = analysisData.get(0).getGeoHeight(); - - if (elev >= MISSING - || analysisData.get(n - 1).getGeoHeight() < (elev + 6000.0f)) { - return avgWind; - } - if (_height.length > 0 && _pressure.length > 0 && _temp.length > 0 - && _uComp.length > 0 && _vComp.length > 0) { - compute0_6kmAvgWind(_height, _pressure, _temp, _uComp, _vComp, - elev); - } - } - return avgWind; - } - - /** - * @return the _hgtHelLyr - */ - public float get_hgtHelLyr() { - return _hgtHelLyr; - } - - public WindComp helicity() { - if (helicity == null) { - int n = _uComp.length; - float elev = _height[0]; - WindComp avgWind = avgWind(); - // _SRelHelicity = 99999.0; - // _helicity = 99999.0; - - // don't calculate anything if no data or only data below 6 km AGL - if (elev >= MISSING || avgWind == null - || avgWind.getWindDirection() >= MISSING - || (analysisData.get(n - 1).getGeoHeight() < elev + 6000.0)) { - return helicity; - } - - computeSHelicity(_pressure, _height, _uComp, _vComp, elev, - avgWind.getWindDirection(), avgWind.getWindSpeed()); - } - - return helicity; - } - - public int gustPotential() { - if (_gustPotential == (int) MISSING) { - computeGustPot(_pressure, _temp, _dewPoint); - } - return _gustPotential; - } - - public float precipWater() { - if (_precipWater == MISSING) { - computePrecipWater(_pressure, _dewPoint); - } - return _precipWater; - } - - public float liftedI() { - if (_LIdx == MISSING) { - int n = _temp.length; - if (_temp500 >= MISSING - || analysisData.get(0).getPressure() - - analysisData.get(n - 1).getPressure() < 100) { - return _LIdx; - } - - float T0, meanTd, p0; - - if (_hour >= 6 && _hour < 18) { - // calculate the mean Td of the lowest 50 mb & use the fcst max - // temp - int j = 0; - while (j < n && _temp[j] >= MISSING) { - j++; - } - p0 = _pressure[j]; - T0 = _maxTemp; - meanTd = _dewPoint[j] / 2; - int i = j; - while (i < n && (_pressure[0] - _pressure[++i] <= 50)) { - meanTd += _dewPoint[i]; - } - meanTd += _dewPoint[i] / 2; - meanTd /= (i - j); - } else // use the sfc temp and sfc Td - { - int j = 0; - while (j < n && _temp[j] >= MISSING) { - j++; - } - T0 = _temp[j]; - meanTd = _dewPoint[j]; - p0 = _pressure[j]; - } - - computeLiftIdx(T0, meanTd, p0, _temp500); - } - return _LIdx; - } - - public float KIndex() { - if (_KIndex == MISSING) { - int n = _temp.length; - if (n < 1) { - return _KIndex; - } - if (analysisData.get(n - 1).getPressure() > 500 - || analysisData.get(0).getPressure() < 800 - || _temp[1] >= MISSING) { - return _KIndex; - } - computeKandTotal(_pressure, _temp, _dewPoint, _temp500); - } - return _KIndex; - } - - public float Totals() { - if (_Totals == MISSING) { - int n = _temp.length; - if (n < 1) { - return _Totals; - } - if (analysisData.get(n - 1).getPressure() > 500 - || analysisData.get(0).getPressure() < 800 - || _temp[1] >= MISSING) { - KIndex(); - } - } - return _Totals; - } - - public float sweatIdx() { - if (_sweatIdx == MISSING) { - int nTemp = _temp.length; - int nWind = _uComp.length; - float elev = analysisData.get(0).getGeoHeight(); - - if (nTemp == 0 || nWind == 0 || elev >= MISSING - || _temp[1] >= MISSING) { - return _sweatIdx; - } - - computeSweatIndex(_pressure, _temp, _dewPoint, _uComp, _vComp); - } - return _sweatIdx; - } - - public float convTemp() { - return _convTemp; - } - - public float maxtemp() { - return _maxTemp; - } - - public float frzgLvlZ() { - if (_frzgLvlZ == MISSING) { - int n = _temp.length; - float elev = analysisData.get(0).getGeoHeight(); - - if (n == 0 || elev >= MISSING || _temp.length < 2 - || _temp[0] >= MISSING) { - return _frzgLvlZ; - } - - computeFrzgLvl(_pressure, _temp, _height); - } - return _frzgLvlZ; - } - - public float frzgLvlP() { - if (_frzgLvlP == MISSING) { - frzgLvlZ(); - } - return _frzgLvlP; - } - - public float pressWBZ() { - if (_pressWBZ == MISSING) { - float elev = analysisData.get(0).getGeoHeight(); - - if (elev >= MISSING || _temp.length < 2 || _temp[0] >= MISSING) { - return _pressWBZ; - } - - computeWetbulbZero(_pressure, _temp, _height, _dewPoint); - } - return _pressWBZ; - } - - public float tempWBZ() { - if (_tempWBZ == MISSING) { - pressWBZ(); - } - return _tempWBZ; - } - - public float hgtWBZ() { - if (_hgtWBZ == MISSING) { - pressWBZ(); - } - return _hgtWBZ; - } - - public float soarIndex() { - if (_hour != 12) { - return MISSING; - } - if (_soarIndex >= MISSING) { - triggerTemp_C(); - } - return _soarIndex; - } - - public float triggerTemp_C() { - if (_triggerTemp_C >= MISSING) { - float elev = analysisData.get(0).getGeoHeight(); - - if (elev >= MISSING || _temp.length < 2 || _temp[0] >= MISSING) { - return _triggerTemp_C; - } - - computeSoaringIdx(_pressure, _height, _temp, _maxTemp); - } - return _triggerTemp_C; - } - - public float pEqLvl() { - return _pEqLvl; - } - - public float zEqLvl() { - return _zEqLvl; - } - - public float tEqLvl() { - return _tEqLvl; - } - - public float zLFC1() { - return _zLFC1; - } - - public float pLFC1() { - return _pLFC1; - } - - public float tLFC1() { - return _tLFC1; - } - - public float zLFC2() { - return _zLFC2; - } - - public float pLFC2() { - return _pLFC2; - } - - public float tLFC2() { - return _tLFC2; - } - - public float maxVVel() { - if (_maxVVel >= MISSING) { - hailSize(); - } - return _maxVVel; - } - - public float hailSize() { - int n = _temp.length; - if (n <= 3 || _uComp.length <= 3) { - return _hailSize; - } - if (_hailSize >= MISSING) { - float elev = analysisData.get(0).getGeoHeight(); - - if (elev >= MISSING || _initParT_C >= MISSING - || _pressLCL >= MISSING || _hgtLCL >= MISSING - || _tempLCL >= MISSING || _temp.length < 2 - || _temp[0] >= MISSING) { - return _hailSize; - } - // if no LFC or equilibrium level return with no values to compute - if (zLFC1() >= MISSING || pEqLvl() == 99999.0) { - return _hailSize; - } - - // compute buoyancies, hailsize, cloud top, and Bulk Richardson - // Number - buoyancyProcess(_pressure, _height, _uComp, _vComp, n, _pressLCL, - _hgtLCL, _tempLCL, _mixLCL, _thetaLCL, _theta_eLCL); - } - return _hailSize; - } - - public float hgtCldTop() { - if (_hgtCldTop >= MISSING) { - hailSize(); - } - return _hgtCldTop; - } - - public float posBuoy() { - if (_posBuoy >= MISSING) { - hailSize(); - } - return _posBuoy; - } - - public float negBuoy() { - if (_negBuoy >= MISSING) { - hailSize(); - } - return _negBuoy; - } - - public float richNum() { - if (_richNum >= MISSING) { - hailSize(); - } - return _richNum; - } - - public float mdpi() { - if (_mdpi >= MISSING) { - computeMDPIwindex(_pressure, _height, _temp, _dewPoint); - } - return _mdpi; - } - - public float windex() { - if (_windex >= MISSING) { - mdpi(); - } - return _windex; - } - - public float initParT_C() { - return _initParT_C; - } - - public float initParTd_C() { - return _initParTd_C; - } - - public float initParP() { - return _initParP; - } - - public float pressLCL() { - return _pressLCL; - } - - public float hgtLCL() { - return _hgtLCL; - } - - public float tempLCL() { - return _tempLCL; - } - - public float pressCCL() { - return _pressCCL; - } - - public float tempCCL() { - return _tempCCL; - } - - public float hgtCCL() { - return _hgtCCL; - } - - /** - * @param method - * the _liftingMethod to set - */ - public void set_liftingMethod(PARCEL_TYPE method) { - _liftingMethod = method; - this.computeParcelInfo(); - } - - /** - * @return the _ghx - */ - public float get_ghx() { - return _ghx; - } - - /** - * @return the _ghy - */ - public float get_ghy() { - return _ghy; - } - - /** - * @param level - * the _userLevel to set - */ - public void set_userLevel(float level) { - _userLevel = level; - } - - /** - * @param fcstMax - * the _useFcstMax to set - */ - public void set_useFcstMax(boolean fcstMax) { - _useFcstMax = fcstMax; - } - - /** - * @return the _useFcstMax - */ - public boolean is_useFcstMax() { - return _useFcstMax; - } - - /** - * calculate the amount of total precipitable water - * - * @param pressure - * millibars - * @param dewPoint - * Kelvin - */ - public void computePrecipWater(float[] pressure, float[] dewPoint) { - int ni = _temp.length; - float[] mixRatio = new float[ni]; - if (ni < 1) { - return; - } - - mixRatio = Controller.spechum2(pressure, dewPoint); - - _precipWater = 0.0f; - - int i; - for (i = 1; i < ni; i++) { - if (mixRatio[i - 1] < SoundingLayer.NODATA - && mixRatio[i] < SoundingLayer.NODATA) { - _precipWater += ((mixRatio[i - 1] + mixRatio[i]) * 0.5 * (pressure[i - 1] - pressure[i])); - } - } - _precipWater = _precipWater / (float) (2.54 * 980.7); // in inch - } - - /** - * calculate the lifted index
- * - * SOFTWARE HISTORY - * Date Ticket# Engineer Description - * ------------ ---------- ----------- -------------------------- - * Dec 1, 2008 1747 jkorman Initial creation - * - *- * - * @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
- * - * SOFTWARE HISTORY - * Date Ticket# Engineer Description - * ------------ ---------- ----------- -------------------------- - * Dec 01, 2008 1747 jkorman Initial creation - * May 15, 2013 1869 bsteffen Remove DataURI from goes/poes soundings. - * - *- * - * @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
- * - * 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 - * - *- * - * @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
- * - * SOFTWARE HISTORY - * Date Ticket# Engineer Description - * ------------ ---------- ----------- -------------------------- - * Dec 16, 2009 mschenke Initial creation - * - *- * - * @author mschenke - * @version 1.0 - */ - -public interface IPointSounding { - - public Coordinate getCoordinate(); - - public String getPointName(); - -} diff --git a/cave/com.raytheon.uf.viz.sounding/src/com/raytheon/uf/viz/sounding/adapters/IVerticalSoundingAdapter.java b/cave/com.raytheon.uf.viz.sounding/src/com/raytheon/uf/viz/sounding/adapters/IVerticalSoundingAdapter.java deleted file mode 100644 index 6189ae8e40..0000000000 --- a/cave/com.raytheon.uf.viz.sounding/src/com/raytheon/uf/viz/sounding/adapters/IVerticalSoundingAdapter.java +++ /dev/null @@ -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(); -} diff --git a/cave/com.raytheon.uf.viz.sounding/src/com/raytheon/uf/viz/sounding/adapters/POESSoundingAdapter.java b/cave/com.raytheon.uf.viz.sounding/src/com/raytheon/uf/viz/sounding/adapters/POESSoundingAdapter.java deleted file mode 100644 index 39e5de7aa0..0000000000 --- a/cave/com.raytheon.uf.viz.sounding/src/com/raytheon/uf/viz/sounding/adapters/POESSoundingAdapter.java +++ /dev/null @@ -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; - -/** - * - * - *
- * - * SOFTWARE HISTORY - * Date Ticket# Engineer Description - * ------------ ---------- ----------- -------------------------- - * Dec 01, 2008 1747 jkorman Initial creation - * May 15, 2013 1869 bsteffen Remove DataURI from goes/poes soundings. - * - *- * - * @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
- * - * SOFTWARE HISTORY - * Date Ticket# Engineer Description - * ------------ ---------- ----------- -------------------------- - * Dec 11, 2009 3953 jelkins Initial creation - * - *- * - * @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
- * - * SOFTWARE HISTORY - * Date Ticket# Engineer Descriptio - * ------------ ---------- ----------- -------------------------- - * Jan 4, 2010 bsteffen Initial creation - * - *- * - * @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
- * SOFTWARE HISTORY - * Date Ticket# Engineer Description - * ------------ ---------- ----------- -------------------------- - * Dec 19, 2007 njensen Initial creation - * - *- * - * @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()); - } - -} diff --git a/cave/com.raytheon.viz.skewT/src/com/raytheon/viz/skewt/SkewTEditor.java b/cave/com.raytheon.viz.skewT/src/com/raytheon/viz/skewt/SkewTEditor.java deleted file mode 100644 index 08ad316dc2..0000000000 --- a/cave/com.raytheon.viz.skewT/src/com/raytheon/viz/skewt/SkewTEditor.java +++ /dev/null @@ -1,1373 +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 java.util.ArrayList; -import java.util.List; - -import javax.measure.converter.UnitConverter; -import javax.measure.unit.NonSI; -import javax.measure.unit.SI; - -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.SashForm; -import org.eclipse.swt.events.FocusAdapter; -import org.eclipse.swt.events.FocusEvent; -import org.eclipse.swt.events.MouseEvent; -import org.eclipse.swt.events.MouseTrackAdapter; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.graphics.Rectangle; -import org.eclipse.swt.layout.FormAttachment; -import org.eclipse.swt.layout.FormData; -import org.eclipse.swt.layout.FormLayout; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Menu; -import org.eclipse.swt.widgets.MenuItem; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Table; -import org.eclipse.swt.widgets.TableColumn; -import org.eclipse.swt.widgets.TableItem; -import org.eclipse.ui.IEditorInput; -import org.eclipse.ui.IEditorSite; -import org.eclipse.ui.PartInitException; - -import com.raytheon.edex.meteoLib.WindComp; -import com.raytheon.uf.common.sounding.SoundingLayer; -import com.raytheon.uf.common.sounding.VerticalSounding; -import com.raytheon.uf.common.status.IUFStatusHandler; -import com.raytheon.uf.common.status.UFStatus; -import com.raytheon.uf.common.status.UFStatus.Priority; -import com.raytheon.uf.common.time.DataTime; -import com.raytheon.uf.viz.core.IDisplayPane; -import com.raytheon.uf.viz.core.IRenderableDisplayChangedListener; -import com.raytheon.uf.viz.core.VizApp; -import com.raytheon.uf.viz.core.drawables.IRenderableDisplay; -import com.raytheon.uf.viz.core.drawables.ResourcePair; -import com.raytheon.uf.viz.core.exception.VizException; -import com.raytheon.uf.viz.core.rsc.IInputHandler; -import com.raytheon.uf.viz.core.rsc.IInputHandler.InputPriority; -import com.raytheon.uf.viz.core.rsc.ResourceList; -import com.raytheon.uf.viz.core.rsc.ResourceList.AddListener; -import com.raytheon.uf.viz.core.rsc.ResourceList.RemoveListener; -import com.raytheon.uf.viz.sounding.SoundingParams; -import com.raytheon.uf.viz.xy.map.IInsetMapContainer; -import com.raytheon.uf.viz.xy.map.IInsetMapContainer.InsetMapUtil; -import com.raytheon.uf.viz.xy.map.IInsetMapDisplayPaneContainer; -import com.raytheon.viz.skewt.mouse.SkewtMouseInspectAdapter; -import com.raytheon.viz.skewt.rsc.InteractiveSkewTResource; -import com.raytheon.viz.skewt.rsc.SkewTResource; -import com.raytheon.viz.skewt.rsc.SkewTResource.ISkewTDataChangedListener; -import com.raytheon.viz.skewt.ui.SkewtControlsDialog; -import com.raytheon.viz.ui.editor.AbstractEditor; -import com.raytheon.viz.ui.input.InputManager; -import com.raytheon.viz.ui.panes.PaneManager; -import com.raytheon.viz.ui.panes.VizDisplayPane; -import com.vividsolutions.jts.geom.Coordinate; - -/** - * - * This class was merged with AbstractXyEditor so that AbstractXyEditor could go - * IMultiPaneEditor without affecting SkewT. - * - * SkewTEditor , 3 frames, SkewT, Hodo, and 24 Hour TempChange - * - *
- * SOFTWARE HISTORY - * Date Ticket# Engineer Description - * ------------ ---------- ----------- -------------------------- - * Sep 29, 2008 dhladky Initial creation - * Dec 07, 2008 dhladky Got rid of problematic View window, consolidated. - *- * - * @author dhladky - * @version 1.0 - */ -public class SkewTEditor extends AbstractEditor implements AddListener, - RemoveListener, ISkewTDataChangedListener, - IRenderableDisplayChangedListener, IInsetMapDisplayPaneContainer { - private static final transient IUFStatusHandler statusHandler = UFStatus - .getHandler(SkewTEditor.class); - - public static final String EDITOR_ID = "com.raytheon.viz.skewt.SkewTEditor"; - - private static UnitConverter metersToFeet = javax.measure.unit.SI.METER - .getConverterTo(NonSI.FOOT); - - private static UnitConverter metersPerSecondToKnots = SI.METERS_PER_SECOND - .getConverterTo(NonSI.KNOT); - - private static UnitConverter kelvinToCelsius = SI.KELVIN - .getConverterTo(SI.CELSIUS); - - private static UnitConverter kelvinToFahrenheit = SI.KELVIN - .getConverterTo(NonSI.FAHRENHEIT); - - private static UnitConverter celsiusToFahrenheit = SI.CELSIUS - .getConverterTo(NonSI.FAHRENHEIT); - - private static UnitConverter centimetersToInches = SI.CENTIMETER - .getConverterTo(NonSI.INCH); - - private static final char degree = '\u00B0'; - - private static final char squared = '\u00B2'; - - private Table paramTable = null; - - // private Composite paramComp = null; - - private TableColumn paramLabelColumn = null; - - private TableColumn paramValueColumn = null; - - private static List
- * 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. - * - *- * - * @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
- * SOFTWARE HISTORY - * - * Date Ticket# Engineer Description - * ------------ ---------- ----------- -------------------------- - * 06 Nov 2006 jkorman Initial Coding - *- * - * @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
- * 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. - * - *- * - * @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); - } - } - } - } -} \ No newline at end of file diff --git a/cave/com.raytheon.viz.skewT/src/com/raytheon/viz/skewt/rsc/InteractiveSkewTResource.java b/cave/com.raytheon.viz.skewT/src/com/raytheon/viz/skewt/rsc/InteractiveSkewTResource.java deleted file mode 100644 index b875b4d1c0..0000000000 --- a/cave/com.raytheon.viz.skewT/src/com/raytheon/viz/skewt/rsc/InteractiveSkewTResource.java +++ /dev/null @@ -1,1398 +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 java.io.BufferedInputStream; -import java.io.BufferedOutputStream; -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Date; -import java.util.Hashtable; -import java.util.Iterator; -import java.util.List; - -import javax.measure.converter.UnitConverter; -import javax.measure.unit.NonSI; -import javax.measure.unit.SI; - -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.action.IMenuManager; -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.RGB; -import org.eclipse.swt.widgets.MessageBox; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.PlatformUI; - -import com.raytheon.uf.common.geospatial.ReferencedCoordinate; -import com.raytheon.uf.common.sounding.ParcelLift.PARCEL_TYPE; -import com.raytheon.uf.common.sounding.SoundingLayer; -import com.raytheon.uf.common.sounding.SoundingLayer.DATA_TYPE; -import com.raytheon.uf.common.sounding.VerticalSounding; -import com.raytheon.uf.common.sounding.WxMath; -import com.raytheon.uf.common.sounding.util.Equations; -import com.raytheon.uf.common.sounding.util.UAPoint; -import com.raytheon.uf.common.status.IUFStatusHandler; -import com.raytheon.uf.common.status.UFStatus; -import com.raytheon.uf.common.status.UFStatus.Priority; -import com.raytheon.uf.common.time.DataTime; -import com.raytheon.uf.viz.core.IGraphicsTarget; -import com.raytheon.uf.viz.core.IGraphicsTarget.LineStyle; -import com.raytheon.uf.viz.core.PixelExtent; -import com.raytheon.uf.viz.core.drawables.IFont; -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.capabilities.ColorableCapability; -import com.raytheon.uf.viz.core.rsc.capabilities.OutlineCapability; -import com.raytheon.uf.viz.sounding.SoundingParams; -import com.raytheon.viz.core.graphing.WGraphics; -import com.raytheon.viz.skewt.ui.SkewTConstants; -import com.raytheon.viz.skewt.ui.SkewtControlsDialog; -import com.raytheon.viz.ui.cmenu.AbstractRightClickAction; -import com.raytheon.viz.ui.cmenu.IContextMenuContributor; -import com.vividsolutions.jts.geom.Coordinate; - -/** - * SkewT Interactive resource to perform edit functions on soundings. - * - *
- * - * SOFTWARE HISTORY - * Date Ticket# Engineer Description - * ------------ ---------- ----------- -------------------------- - * Sep 22, 2009 randerso Initial creation - * Feb 15, 2013 1638 mschenke Moved Equations/UAPoint from edex.common util - * to common.sounding - * - *- * - * @author randerso - * @version 1.0 - */ - -public class InteractiveSkewTResource extends SkewTResource implements - IContextMenuContributor { - private static final transient IUFStatusHandler statusHandler = UFStatus - .getHandler(InteractiveSkewTResource.class); - - Shell shell = PlatformUI.getWorkbench().getDisplay().getActiveShell(); - - protected IFont smallFont; - - private VerticalSounding sounding; - - private static enum editMode { - HODO, SKEWT, TEMPCHG - }; - - private static editMode emode; - - private static final UnitConverter kelvinToCelsius = SI.KELVIN - .getConverterTo(SI.CELSIUS); - - private static final UnitConverter celciusToFahrenheit = SI.CELSIUS - .getConverterTo(NonSI.FAHRENHEIT); - - private static final UnitConverter metersPerSecondToKnots = SI.METERS_PER_SECOND - .getConverterTo(NonSI.KNOT); - - private static final UnitConverter celciusToKelvin = SI.CELSIUS - .getConverterTo(SI.KELVIN); - - private static final UnitConverter metersToFeet = SI.METER - .getConverterTo(NonSI.FOOT); - - private Hashtable
- * - * SOFTWARE HISTORY - * Date Ticket# Engineer Description - * ------------ ---------- ----------- -------------------------- - * Sep 22, 2009 randerso Initial creation - * - *- * - * @author randerso - * @version 1.0 - */ - -public class SkewTBackgroundResource extends - AbstractVizResource
- * - * SOFTWARE HISTORY - * Date Ticket# Engineer Description - * ------------ ---------- ----------- -------------------------- - * Sep 10, 2009 randerso Initial creation - * Jul 05, 2013 1869 bsteffen Fix goes sounding updates. - * - *- * - * @author randerso - * @version 1.0 - */ - -public class SkewTResource extends - AbstractVizResource
- * - * SOFTWARE HISTORY - * Date Ticket# Engineer Description - * ------------ ---------- ----------- -------------------------- - * Feb 20, 2009 chammack Initial creation - * - *- * - * @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; - } - -} diff --git a/cave/com.raytheon.viz.skewT/src/com/raytheon/viz/skewt/rscdata/GribSoundingSkewTResourceData.java b/cave/com.raytheon.viz.skewT/src/com/raytheon/viz/skewt/rscdata/GribSoundingSkewTResourceData.java deleted file mode 100644 index be723e3e91..0000000000 --- a/cave/com.raytheon.viz.skewT/src/com/raytheon/viz/skewt/rscdata/GribSoundingSkewTResourceData.java +++ /dev/null @@ -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 - * - *
- * - * SOFTWARE HISTORY - * Date Ticket# Engineer Description - * ------------ ---------- ----------- -------------------------- - * Feb 20, 2009 chammack Initial creation - * - *- * - * @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(); - } - -} diff --git a/cave/com.raytheon.viz.skewT/src/com/raytheon/viz/skewt/rscdata/SkewTBkgResourceData.java b/cave/com.raytheon.viz.skewT/src/com/raytheon/viz/skewt/rscdata/SkewTBkgResourceData.java deleted file mode 100644 index 32a60e76df..0000000000 --- a/cave/com.raytheon.viz.skewT/src/com/raytheon/viz/skewt/rscdata/SkewTBkgResourceData.java +++ /dev/null @@ -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 - * - *
- * - * SOFTWARE HISTORY - * Date Ticket# Engineer Description - * ------------ ---------- ----------- -------------------------- - * Oct 7, 2009 randerso Initial creation - * - *- * - * @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) { - - } - -} diff --git a/cave/com.raytheon.viz.skewT/src/com/raytheon/viz/skewt/rscdata/SkewTResourceData.java b/cave/com.raytheon.viz.skewT/src/com/raytheon/viz/skewt/rscdata/SkewTResourceData.java deleted file mode 100644 index 0f8340ba3d..0000000000 --- a/cave/com.raytheon.viz.skewT/src/com/raytheon/viz/skewt/rscdata/SkewTResourceData.java +++ /dev/null @@ -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 - * - *
- * - * SOFTWARE HISTORY - * Date Ticket# Engineer Description - * ------------ ---------- ----------- -------------------------- - * Sep 23, 2009 randerso Initial creation - * Jul 05, 2013 1869 bsteffen Fix goes sounding updates. - * - *- * - * @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
- * SOFTWARE HISTORY - * - * Date Ticket# Engineer Description - * ------------ ---------- ----------- -------------------------- - * 28Sept2008 #1529 dhladky separate and improve. - * - *- * - * @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; - } - -} diff --git a/cave/com.raytheon.viz.skewT/src/com/raytheon/viz/skewt/ui/SkewTConstants.java b/cave/com.raytheon.viz.skewT/src/com/raytheon/viz/skewt/ui/SkewTConstants.java deleted file mode 100644 index d8ac9f1de6..0000000000 --- a/cave/com.raytheon.viz.skewT/src/com/raytheon/viz/skewt/ui/SkewTConstants.java +++ /dev/null @@ -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. - * - *
- * 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 - * - *- * - * @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
- * 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 - * - *- * - * @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
- * 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. - * - *- * - * @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; - } - -} diff --git a/cave/com.raytheon.viz.skewT/src/com/raytheon/viz/skewt/ui/TempChangeBackground.java b/cave/com.raytheon.viz.skewT/src/com/raytheon/viz/skewt/ui/TempChangeBackground.java deleted file mode 100644 index 3ffffa16f8..0000000000 --- a/cave/com.raytheon.viz.skewT/src/com/raytheon/viz/skewt/ui/TempChangeBackground.java +++ /dev/null @@ -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. - * - *
- * SOFTWARE HISTORY - * - * Date Ticket# Engineer Description - * ------------ ---------- ----------- -------------------------- - * 28sep2008 #1529 dhladky redone. - * - *- * - * @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; - } - -} diff --git a/cave/com.raytheon.viz.volumebrowser/META-INF/MANIFEST.MF b/cave/com.raytheon.viz.volumebrowser/META-INF/MANIFEST.MF index fbc2bf5fb3..4f0d682202 100644 --- a/cave/com.raytheon.viz.volumebrowser/META-INF/MANIFEST.MF +++ b/cave/com.raytheon.viz.volumebrowser/META-INF/MANIFEST.MF @@ -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 diff --git a/cave/com.raytheon.viz.volumebrowser/src/com/raytheon/viz/volumebrowser/catalog/GridDataCatalog.java b/cave/com.raytheon.viz.volumebrowser/src/com/raytheon/viz/volumebrowser/catalog/GridDataCatalog.java deleted file mode 100644 index 200a5bc4c2..0000000000 --- a/cave/com.raytheon.viz.volumebrowser/src/com/raytheon/viz/volumebrowser/catalog/GridDataCatalog.java +++ /dev/null @@ -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. - * - *
- * - * 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 - * - *- * - * @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
- * - * SOFTWARE HISTORY - * - * Date Ticket# Engineer Description - * ------------ ---------- ----------- -------------------------- - * 11/29/2006 #7 brockwoo Initial creation - * - *- * - * @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
- * - * 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 - * - *- * - * @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
- * - * SOFTWARE HISTORY - * - * Date Ticket# Engineer Description - * ------------ ---------- ----------- -------------------------- - * 11/29/2006 #7 brockwoo Initial creation - * - *- * - * @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
- * - * SOFTWARE HISTORY - * - * Date Ticket# Engineer Description - * ------------ ---------- ----------- -------------------------- - * 05/29/2008 brockwoo Initial creation - * - *- * - * @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
- * - * 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 - *- * - * @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
- * SOFTWARE HISTORY - * Date Ticket# Engineer Description - * ------------ ---------- ----------- -------------------------- - * 28 Sept 2008 dhladky new class. - * - *- * - * @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; - } - -} diff --git a/edexOsgi/com.raytheon.uf.common.sounding/src/com/raytheon/uf/common/sounding/WxMath.java b/edexOsgi/com.raytheon.uf.common.sounding/src/com/raytheon/uf/common/sounding/WxMath.java index 691619a5dc..84ba78e510 100644 --- a/edexOsgi/com.raytheon.uf.common.sounding/src/com/raytheon/uf/common/sounding/WxMath.java +++ b/edexOsgi/com.raytheon.uf.common.sounding/src/com/raytheon/uf/common/sounding/WxMath.java @@ -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. * * * @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. diff --git a/edexOsgi/com.raytheon.uf.common.sounding/src/com/raytheon/uf/common/sounding/util/SoundingPrefs.java b/edexOsgi/com.raytheon.uf.common.sounding/src/com/raytheon/uf/common/sounding/util/SoundingPrefs.java deleted file mode 100644 index 3cd3493d7c..0000000000 --- a/edexOsgi/com.raytheon.uf.common.sounding/src/com/raytheon/uf/common/sounding/util/SoundingPrefs.java +++ /dev/null @@ -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 - * - *
- * - * SOFTWARE HISTORY - * - * Date Ticket# Engineer Description - * ------------ ---------- ----------- -------------------------- - * Jun 15, 2011 bsteffen Initial creation - * - *- * - * @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; - - } - -} diff --git a/edexOsgi/com.raytheon.uf.common.sounding/utility/common_static/base/sounding/soundingPrefs.xml b/edexOsgi/com.raytheon.uf.common.sounding/utility/common_static/base/sounding/soundingPrefs.xml deleted file mode 100644 index 2719b27052..0000000000 --- a/edexOsgi/com.raytheon.uf.common.sounding/utility/common_static/base/sounding/soundingPrefs.xml +++ /dev/null @@ -1,3 +0,0 @@ -