From 9b68bea7c37e05f108f8e977e3e3aa21e5c93059 Mon Sep 17 00:00:00 2001 From: Zihou Wang Date: Wed, 20 Aug 2014 12:59:36 +0000 Subject: [PATCH 01/25] VLab Issue #3990 - DR_17356 Enhancement to Radar Display of SAILS 0.5 degree products; fixes #3990 Change-Id: Ib6be85a3fb40649a093c8cd5d9278f324edb3a7f Former-commit-id: 3d305bffddf34d38b65176280e40709549f09ee5 --- .../utility/common_static/base/styleRules/RadarUpperText.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.radar/utility/common_static/base/styleRules/RadarUpperText.xml b/edexOsgi/com.raytheon.uf.common.dataplugin.radar/utility/common_static/base/styleRules/RadarUpperText.xml index d48a1bad0b..37550bdaa8 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.radar/utility/common_static/base/styleRules/RadarUpperText.xml +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.radar/utility/common_static/base/styleRules/RadarUpperText.xml @@ -67,9 +67,9 @@ - + From 179031d9b48e1598b8c4e29910c4a83db6d877cc Mon Sep 17 00:00:00 2001 From: "steve.naples" Date: Wed, 20 Aug 2014 17:17:14 +0000 Subject: [PATCH 02/25] ASM #14807 Updated snow file parser in ReadSnowData to fix parsing issues. Change-Id: I5182f2640baebbb0f5c6d66e5a3d81da7461af69 Former-commit-id: 67e36d96d0acaa8dfdf61164a5c66fbda9dd753b --- .../raytheon/viz/mpe/util/ReadSnowData.java | 56 ++++++++++--------- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/cave/com.raytheon.viz.mpe/src/com/raytheon/viz/mpe/util/ReadSnowData.java b/cave/com.raytheon.viz.mpe/src/com/raytheon/viz/mpe/util/ReadSnowData.java index f37a617a7f..de3ced14f1 100644 --- a/cave/com.raytheon.viz.mpe/src/com/raytheon/viz/mpe/util/ReadSnowData.java +++ b/cave/com.raytheon.viz.mpe/src/com/raytheon/viz/mpe/util/ReadSnowData.java @@ -38,7 +38,8 @@ import com.raytheon.viz.mpe.util.DailyQcUtils.Station; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Mar 5, 2009 snaples Initial creation - * + * Aug 20, 2014 17094 snaples Fixed issue when reading snow data file, did not parse properly. + * * * * @author snaples @@ -49,19 +50,19 @@ public class ReadSnowData { int j, k, ier, m, qual; - char cbuf[] = new char[100]; + String cbuf = ""; char p, q; - char buf[] = new char[100]; + String buf = ""; String hb5 = ""; char pc; - char datbuf[] = new char[50]; + String datbuf = ""; - char parmbuf[] = new char[50]; + String parmbuf = ""; int maxk, startk; @@ -73,6 +74,8 @@ public class ReadSnowData { try { + in = new BufferedReader(new FileReader(prece)); + for (k = 0; k < numPstations; k++) { for (int m = 0; m < 5; m++) { pdata[i].stn[k].srain[m].data = -99; @@ -80,16 +83,15 @@ public class ReadSnowData { pdata[i].stn[k].sflag[m] = -1; } } - in = new BufferedReader(new FileReader(prece)); + bad: while (in.ready()) { - int p = 1; - String sn = cbuf.toString(); - Scanner s = new Scanner(sn); - bad: while (p != -1) { + cbuf = in.readLine().trim(); + if (cbuf.length() < 1) { + break; + } + Scanner s = new Scanner(cbuf); - in.read(cbuf, 0, 100); - - if (cbuf[0] == ':') { + if (cbuf.charAt(0) == ':') { continue; } @@ -97,19 +99,20 @@ public class ReadSnowData { if (s.hasNext() == false) { continue; } + s.next(); hb5 = s.next(); - datbuf = s.next().toCharArray(); - parmbuf = s.next().toCharArray(); + datbuf = s.next(); + parmbuf = s.next(); int q = parmbuf.toString().indexOf('/'); char c = ' '; if (q >= 0) { - c = parmbuf[q]; + c = parmbuf.charAt(q); } if (c < 0) { continue; } - char pc = parmbuf[q + 5]; + char pc = parmbuf.charAt(q + 5); for (j = 0; j < numPstations; j++) { if ((precip_stations.get(j).hb5.equals(hb5) && (pc == precip_stations @@ -120,12 +123,12 @@ public class ReadSnowData { if (j == numPstations) { continue; } - int u = cbuf.toString().indexOf('/'); + int u = cbuf.indexOf('/'); if (u < 0) { continue; } - q = cbuf.toString().indexOf(' ', u); + q = cbuf.indexOf(' ', u); if (q < 0) { continue; } @@ -135,19 +138,19 @@ public class ReadSnowData { pdata[i].stn[j].srain[k].qual = 0; - if ((cbuf.toString().indexOf('/', q)) < 0 - && (cbuf.toString().indexOf('\n', q)) < 0) { + if ((cbuf.indexOf('/', q)) < 0 + && (cbuf.indexOf('\n', q)) < 0) { continue bad; } u = 0; - buf = cbuf.toString().substring(q).toCharArray(); + buf = cbuf.substring(q); - if ((buf.toString().indexOf('.')) < 0) { + if ((buf.indexOf('.')) < 0) { - if ((buf.toString().indexOf('m')) < 0 - && (buf.toString().indexOf('M')) < 0) { + if ((buf.indexOf('m')) < 0 + && (buf.indexOf('M')) < 0) { pdata[i].stn[j].srain[k].data = -1; pdata[i].stn[j].srain[k].qual = -1; @@ -166,9 +169,8 @@ public class ReadSnowData { } } - + s.close(); } - in.close(); } catch (FileNotFoundException e) { // TODO Auto-generated catch block From 3ffac397db75d7609113e1cb84be69725a5b4443 Mon Sep 17 00:00:00 2001 From: Zihou Wang Date: Wed, 20 Aug 2014 14:31:21 +0000 Subject: [PATCH 03/25] VLab Issue #4464 - DR_17214 RADAR: NEXRAD Unit Status display problem due to the GSM change; fixes #4464 Change-Id: I0ca330e385000e04ef21142e75adfc55d4615a89 Former-commit-id: 288dc7c439995a8ab48680832b63f7d6974885b4 --- .../com/raytheon/viz/radar/RadarHelper.java | 6 +- .../viz/radar/ui/xy/RadarGSMResource.java | 81 ++++++++++++------- 2 files changed, 58 insertions(+), 29 deletions(-) diff --git a/cave/com.raytheon.viz.radar/src/com/raytheon/viz/radar/RadarHelper.java b/cave/com.raytheon.viz.radar/src/com/raytheon/viz/radar/RadarHelper.java index f74b87a4ad..4d059921c6 100644 --- a/cave/com.raytheon.viz.radar/src/com/raytheon/viz/radar/RadarHelper.java +++ b/cave/com.raytheon.viz.radar/src/com/raytheon/viz/radar/RadarHelper.java @@ -71,7 +71,9 @@ import com.raytheon.viz.awipstools.common.StormTrackData; * Feb 16, 2009 mnash Initial creation * 03/07/2012 DR 14660 D. Friedman Added time-based getSTIData* functions. * 03/01/2013 DR 15496 zwang Handle the expanded GSM - * Correct some status according to B14 ICD + * Correct some status according to B14 ICD + * 08/20/2014 DR17214 zwang Report more status for VCP supplemental Info + * according to RPG B16 ICD * * * @@ -178,7 +180,7 @@ public class RadarHelper { "RDA 1", "RDA 2" }; public static final String[] vcpInfoStr = { "AVSET", - "SAILS", "Site-Specific VCP" }; + " SAILS", " Site-Specific VCP", " RxRN", " CBT" }; /** * The default maximimum difference in time used when retrieving STI data (15 minutes.) diff --git a/cave/com.raytheon.viz.radar/src/com/raytheon/viz/radar/ui/xy/RadarGSMResource.java b/cave/com.raytheon.viz.radar/src/com/raytheon/viz/radar/ui/xy/RadarGSMResource.java index f36e4ca821..11208779f9 100644 --- a/cave/com.raytheon.viz.radar/src/com/raytheon/viz/radar/ui/xy/RadarGSMResource.java +++ b/cave/com.raytheon.viz.radar/src/com/raytheon/viz/radar/ui/xy/RadarGSMResource.java @@ -54,7 +54,8 @@ import com.raytheon.viz.radar.rsc.RadarResourceData; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * May 13, 2010 mnash Initial creation - * 03/01/2013 DR 15496 zwang Handled expanded GSM, display more status + * 03/01/2013 DR 15496 zwang Handled expanded GSM, display more status + * 07/16/2014 DR 17214 zwang Handled B15 GSM change about super res flag * * * @@ -282,49 +283,75 @@ public class RadarGSMResource extends AbstractRadarResource { } // Plot elevations - double[] elevations = message.getElevation().clone(); + double[] elev = message.getElevation().clone(); char[] charArray = Integer.toBinaryString( message.getSuperResolutionCuts()).toCharArray(); - elevations = Arrays.copyOf(elevations, message.getNumCuts()); - Arrays.sort(elevations); + // Find the index of the SAILS elevation + int sailsIndex = -1; + for (int i = 1; i < elev.length; i++) { + if (elev[i] == elev[0]) { + sailsIndex = i; + break; + } + } + + //Ignore the super res flag for SAILS + if (sailsIndex != -1 && sailsIndex < charArray.length) { + charArray[charArray.length - sailsIndex - 1] = '0'; + } + + // Remove elevation 0 and duplicate elevations + Arrays.sort(elev); + int j = 0; + int k = 1; + while (k < elev.length){ + if (elev[j] == 0) { + elev[j] = elev[k]; + k++; + } + else if (elev[k] == elev[j]) { + k++; + } + else { + j++; + elev[j] = elev[k]; + k++; + } + } + + double[] elevations = Arrays.copyOf(elev, j+1); + for (int left = 0, right = elevations.length - 1; left < right; left++, right--) { double tmp = elevations[left]; elevations[left] = elevations[right]; elevations[right] = tmp; } - int count = 0; - for (int i = 0; i < elevations.length; i++) { - if (elevations[i] == 0) { - count++; - } - } - + // Handle the super res flag boolean[] superResElev = new boolean[elevations.length]; + // Initiate all flags to non super res + for (int i = 0; i < elevations.length; i++) { + superResElev[i] = false; + } + + // Ignore the flag for SAILS for (int i = 0; i < charArray.length; i++) { - if (charArray[i] == '1') { - superResElev[i] = true; - } else { - superResElev[i] = false; - } + if (charArray[charArray.length - i - 1] == '1') { + superResElev[elevations.length - i - 1] = true; + } } List theTemp = new ArrayList(); for (int i = 0; i < elevations.length; i++) { - if (elevations[i] != 0) { - String s = ""; - if (superResElev[elevations.length - i - count - 1] == true) { - s = "S"; - } else { - s = ""; - } - theTemp.add(Double.toString(elevations[i] / 10) + " " - + s); + + String s = ""; + if (superResElev[i] == true) { + s = "S"; } else { - theTemp.add(Double.toString(elevations[i] / 10)); - break; + s = ""; } + theTemp.add(Double.toString(elevations[i] / 10) + " " + s); } int height = 780; From d62db22874b4b28cfec4525f6ee5df7b2c6bc853 Mon Sep 17 00:00:00 2001 From: Brian Clements Date: Thu, 21 Aug 2014 15:48:30 -0500 Subject: [PATCH 04/25] Issue #3500 remove locking on osgi internals, rework gfe client startup fixed error handling in loadConfig.py added python to path in GfePyIncludeUtil moved ProcedureXMLManager to overridable method in AbstractCaveComponent Change-Id: Ie7dff55657ba216c47f7a56b3506cbed3a3f6ab2 Former-commit-id: b0ea9a2a04cf043fe1a9e4dbf4d4498b0d3f4684 --- .../viz/core/reflect/BundleLoaderGetter.java | 83 ---------------- .../viz/core/reflect/BundleReflections.java | 13 +-- .../core/reflect/BundleRepositoryGetter.java | 83 ---------------- .../viz/core/reflect/BundleSynchronizer.java | 96 ------------------- .../uf/viz/core/reflect/SubClassLocator.java | 13 +-- .../python/utility/loadConfig.py | 5 +- .../src/com/raytheon/viz/gfe/GfeClient.java | 14 +++ .../awips/AbstractCAVEComponent.java | 11 ++- .../gfe/python/GfePyIncludeUtil.java | 7 +- 9 files changed, 39 insertions(+), 286 deletions(-) delete mode 100644 cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/reflect/BundleLoaderGetter.java delete mode 100644 cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/reflect/BundleRepositoryGetter.java delete mode 100644 cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/reflect/BundleSynchronizer.java diff --git a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/reflect/BundleLoaderGetter.java b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/reflect/BundleLoaderGetter.java deleted file mode 100644 index 74d9c3df01..0000000000 --- a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/reflect/BundleLoaderGetter.java +++ /dev/null @@ -1,83 +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.core.reflect; - -import org.eclipse.osgi.framework.internal.core.AbstractBundle; -import org.eclipse.osgi.framework.internal.core.BundleHost; -import org.eclipse.osgi.internal.loader.BundleLoader; -import org.eclipse.osgi.internal.loader.BundleLoaderProxy; -import org.eclipse.osgi.service.resolver.BundleDescription; -import org.osgi.framework.Bundle; -import org.osgi.framework.BundleReference; - -/** - * Utility class to get the BundleLoader object associated with a Bundle, to - * potentially synchronize against that object. - * - *
- * 
- * SOFTWARE HISTORY
- * 
- * Date         Ticket#    Engineer    Description
- * ------------ ---------- ----------- --------------------------
- * Aug 13, 2014 3500       bclement     Initial creation
- * 
- * 
- * - * @author bclement - * @version 1.0 - * @see BundleSynchronizer - */ -public class BundleLoaderGetter { - - private BundleLoaderGetter() { - } - - /** - * Attempts to retrieve the BundleLoader associated with the bundle. Returns - * the BundleLoader or null if it could not be retrieved. - * - * @param bundle - * the bundle to retrieve the associated BundleLoader for - * @return the BundleLoader or null - */ - @SuppressWarnings("restriction") - protected static BundleLoader getBundleLoader(Bundle bundle) { - BundleLoader rval = null; - if (bundle instanceof AbstractBundle) { - BundleDescription bundleDesc = ((AbstractBundle) bundle) - .getBundleDescription(); - if (bundleDesc != null) { - Object o = bundleDesc.getUserObject(); - if (!(o instanceof BundleLoaderProxy)) { - if (o instanceof BundleReference) - o = ((BundleReference) o).getBundle(); - if (o instanceof BundleHost) - o = ((BundleHost) o).getLoaderProxy(); - } - if (o instanceof BundleLoaderProxy) { - rval = ((BundleLoaderProxy) o).getBundleLoader(); - } - } - } - return rval; - } - -} diff --git a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/reflect/BundleReflections.java b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/reflect/BundleReflections.java index a39a53ddad..d965f88f5b 100644 --- a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/reflect/BundleReflections.java +++ b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/reflect/BundleReflections.java @@ -49,6 +49,7 @@ import org.reflections.util.ConfigurationBuilder; * Jan 22, 2014 2062 bsteffen Handle bundles with no wiring. * Apr 16, 2014 3018 njensen Synchronize against BundleRepository * Aug 13, 2014 3500 bclement uses BundleSynchronizer + * Aug 22, 2014 3500 bclement removed sync on OSGi internals * * * @@ -61,17 +62,11 @@ public class BundleReflections { private final Reflections reflections; public BundleReflections(Bundle bundle, Scanner scanner) throws IOException { - final ConfigurationBuilder cb = new ConfigurationBuilder(); - final BundleWiring bundleWiring = bundle.adapt(BundleWiring.class); + ConfigurationBuilder cb = new ConfigurationBuilder(); + BundleWiring bundleWiring = bundle.adapt(BundleWiring.class); if (bundleWiring != null) { - BundleSynchronizer.runSynchedWithBundle(new Runnable() { - @Override - public void run() { - cb.addClassLoader(bundleWiring.getClassLoader()); - - } - }, bundle); + cb.addClassLoader(bundleWiring.getClassLoader()); cb.addUrls(FileLocator.getBundleFile(bundle).toURI().toURL()); cb.setScanners(scanner); diff --git a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/reflect/BundleRepositoryGetter.java b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/reflect/BundleRepositoryGetter.java deleted file mode 100644 index 36262c6311..0000000000 --- a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/reflect/BundleRepositoryGetter.java +++ /dev/null @@ -1,83 +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.core.reflect; - -import java.lang.reflect.Field; - -import org.eclipse.osgi.framework.internal.core.AbstractBundle; -import org.eclipse.osgi.framework.internal.core.BundleRepository; -import org.eclipse.osgi.framework.internal.core.Framework; -import org.osgi.framework.Bundle; - -/** - * Utility class to get the BundleRepository object associated with a Bundle, to - * potentially synchronize against that object. - * - * - *
- * 
- * SOFTWARE HISTORY
- * 
- * Date         Ticket#    Engineer    Description
- * ------------ ---------- ----------- --------------------------
- * Apr 17, 2014            njensen     Initial creation
- * Aug 13, 2014 3500       bclement    moved documentation over to BundleSynchronizer
- * 
- * 
- * - * @author njensen - * @version 1.0 - * @see BundleSynchronizer - */ -public class BundleRepositoryGetter { - - private BundleRepositoryGetter() { - - } - - /** - * Attempts to retrieve the BundleRepository associated with the bundle's - * framework. Returns the BundleRepository or null if it could not be - * retrieved. - * - * @param bundle - * the bundle to retrieve the associated BundleRepository for - * @return the BundleRepository or null - */ - @SuppressWarnings("restriction") - protected static BundleRepository getFrameworkBundleRepository(Bundle bundle) { - BundleRepository bundleRepo = null; - if (bundle instanceof AbstractBundle) { - try { - AbstractBundle ab = (AbstractBundle) bundle; - Field bundleRepoField = Framework.getField(Framework.class, - BundleRepository.class, true); - bundleRepo = (BundleRepository) bundleRepoField.get(ab - .getFramework()); - } catch (Throwable t) { - // intentionally log to console and proceed anyway - t.printStackTrace(); - } - } - - return bundleRepo; - } - -} diff --git a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/reflect/BundleSynchronizer.java b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/reflect/BundleSynchronizer.java deleted file mode 100644 index 9f1db071c0..0000000000 --- a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/reflect/BundleSynchronizer.java +++ /dev/null @@ -1,96 +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.core.reflect; - -import org.eclipse.osgi.framework.internal.core.BundleRepository; -import org.eclipse.osgi.internal.loader.BundleLoader; -import org.osgi.framework.Bundle; - -/** - * If a call to BundleWiring.getClassLoader() is invoked on a thread other than - * main/UI thread, then there is a possible deadlock if the application shuts - * down while the BundleWiring.getClassLoader() call is still going. The - * BundleLoader and BundleRepository of the Framework are the primary resources - * that are in contention in this deadlock scenario, due to the BundleRepository - * being used as a synchronization lock both deep in - * bundleWiring.getClassloader() and in Framework shutdown code. The other - * resource used as a synchronization lock and causing the deadlock is the - * BundleLoader associated with the bundle. When BundleLoader.findClass() is - * called, it results in a lock on the BundleLoader and then a lock on the - * BundleRepository. This happens when the DefaultClassLoader loads a class. - * - * Therefore to avoid this deadlock, if you are going to call - * BundleWiring.getClassLoader() you should attempt synchronize against the - * BundleLoader and the BundleRepository. This will ensure the call to - * getClassLoader() can finish and then release synchronization locks of both - * the BundleRepository and BundleLoader. - * - * If we fail to get the BundleLoader or BundleRepository, then you should - * proceed onwards anyway because the odds of the application shutting down at - * the same time as the call to BundleWiring.getClassLoader() is still running - * is low. Even if that occurs, the odds are further reduced that the two - * threads will synchronize against the BundleLoader and the BundleRepository at - * the same time and deadlock. - * - *
- * 
- * SOFTWARE HISTORY
- * 
- * Date         Ticket#    Engineer    Description
- * ------------ ---------- ----------- --------------------------
- * Aug 13, 2014 3500       bclement     Initial creation
- * 
- * 
- * - * @author bclement - * @version 1.0 - */ -public class BundleSynchronizer { - - private BundleSynchronizer() { - } - - /** - * Attempts to synchronize with the bundle's BundleLoader and - * BundleRepository objects before running the runner. If either the - * BundleLoader or the BundleRepository are unable to be retrieved from the - * bundle, the runner is ran anyway since the likelihood of a deadlock is - * relatively small. - * - * @param runner - * @param bundle - * @see BundleLoaderGetter#getBundleLoader(Bundle) - * @see BundleRepositoryGetter#getFrameworkBundleRepository(Bundle) - */ - protected static void runSynchedWithBundle(Runnable runner, Bundle bundle) { - BundleRepository repo = BundleRepositoryGetter - .getFrameworkBundleRepository(bundle); - BundleLoader loader = BundleLoaderGetter.getBundleLoader(bundle); - if (repo != null && loader != null) { - synchronized (loader) { - synchronized (repo) { - runner.run(); - } - } - } else { - runner.run(); - } - } -} diff --git a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/reflect/SubClassLocator.java b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/reflect/SubClassLocator.java index a6c40caf79..e02f2dad87 100644 --- a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/reflect/SubClassLocator.java +++ b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/reflect/SubClassLocator.java @@ -58,6 +58,7 @@ import com.raytheon.uf.viz.core.Activator; * Feb 03, 2013 2764 bsteffen Use OSGi API to get dependencies. * Apr 17, 2014 3018 njensen Synchronize against BundleRepository * Aug 13, 2014 3500 bclement uses BundleSynchronizer + * Aug 22, 2014 3500 bclement removed sync on OSGi internals * * * @@ -265,20 +266,12 @@ public class SubClassLocator implements ISubClassLocator { */ private Set> loadClassesFromCache(Bundle bundle, Collection classNames) { - final BundleWiring bundleWiring = bundle.adapt(BundleWiring.class); + BundleWiring bundleWiring = bundle.adapt(BundleWiring.class); if (bundleWiring == null) { return Collections.emptySet(); } - final ClassLoader[] loaderHolder = new ClassLoader[1]; - BundleSynchronizer.runSynchedWithBundle(new Runnable() { - @Override - public void run() { - loaderHolder[0] = bundleWiring.getClassLoader(); - } - }, bundle); - - ClassLoader loader = loaderHolder[0]; + ClassLoader loader = bundleWiring.getClassLoader(); if (loader == null) { return Collections.emptySet(); } diff --git a/cave/com.raytheon.viz.gfe/python/utility/loadConfig.py b/cave/com.raytheon.viz.gfe/python/utility/loadConfig.py index a81999cea6..8316ba36d8 100644 --- a/cave/com.raytheon.viz.gfe/python/utility/loadConfig.py +++ b/cave/com.raytheon.viz.gfe/python/utility/loadConfig.py @@ -27,11 +27,13 @@ # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 12/11/09 njensen Initial Creation. +# 08/21/14 3500 bclement fixed loadPreferences except block # # # import types +import LogStream from java.util import HashMap, ArrayList from java.lang import String, Float, Integer, Boolean @@ -48,8 +50,7 @@ def loadPreferences(config): Activator.getDefault().setPreferenceStore(prefs) return prefs except Exception, e: - LogStream.logProblem("Unknown or improper config file: ", - configFile, " for user: ", userName) + LogStream.logProblem("Unknown or improper config file: ", config) raise Exception, e diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/GfeClient.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/GfeClient.java index a5f28611f8..d68778ffbe 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/GfeClient.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/GfeClient.java @@ -62,6 +62,7 @@ import com.raytheon.viz.ui.personalities.awips.AbstractCAVEComponent; * which was adding an empty string into the * python path causing python to look in user's * current default directory for modules. + * Aug 22, 2014 3500 bclement override postStartupActions() * * * @@ -196,4 +197,17 @@ public class GfeClient extends AbstractCAVEComponent { return new HashSet(Arrays.asList("-site", "-server", "-mode", "-time")); } + + + /* (non-Javadoc) + * @see com.raytheon.viz.ui.personalities.awips.AbstractCAVEComponent#postStartupActions() + */ + @Override + protected void postStartupActions() { + /* + * GFE client does not require the default post startup actions (ie + * ProcedureXMLManager being initialized) + */ + } + } diff --git a/cave/com.raytheon.viz.ui.personalities.awips/src/com/raytheon/viz/ui/personalities/awips/AbstractCAVEComponent.java b/cave/com.raytheon.viz.ui.personalities.awips/src/com/raytheon/viz/ui/personalities/awips/AbstractCAVEComponent.java index ffba76fc63..c2056fcca9 100644 --- a/cave/com.raytheon.viz.ui.personalities.awips/src/com/raytheon/viz/ui/personalities/awips/AbstractCAVEComponent.java +++ b/cave/com.raytheon.viz.ui.personalities.awips/src/com/raytheon/viz/ui/personalities/awips/AbstractCAVEComponent.java @@ -99,6 +99,7 @@ import com.raytheon.viz.core.units.UnitRegistrar; * startup * Dec 10, 2013 2602 bsteffen Start loading ProcedureXmlManager in * startComponent. + * Aug 22, 2014 3500 bclement moved ProcedureXMLManager initialization to postStartupActions() * * * @@ -259,7 +260,7 @@ public abstract class AbstractCAVEComponent implements IStandaloneComponent { startInternal(componentName); } - ProcedureXmlManager.inititializeAsync(); + postStartupActions(); if (workbenchAdvisor != null) { returnCode = PlatformUI.createAndRunWorkbench(display, @@ -303,6 +304,14 @@ public abstract class AbstractCAVEComponent implements IStandaloneComponent { return IApplication.EXIT_OK; } + /** + * perform any additional initialization after the component has been + * started + */ + protected void postStartupActions() { + ProcedureXmlManager.inititializeAsync(); + } + /** * Get the workbench advisor for the application * diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/python/GfePyIncludeUtil.java b/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/python/GfePyIncludeUtil.java index 0c5e24fbd5..516fed06d6 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/python/GfePyIncludeUtil.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/python/GfePyIncludeUtil.java @@ -39,6 +39,7 @@ import com.raytheon.uf.common.util.FileUtil; * Feb 27, 2013 #1447 dgilling Re-factor based on PythonPathIncludeUtil. * Mar 11, 2013 #1759 dgilling Add method getGfeConfigLF(). * Sep 16, 2013 #1759 dgilling Move tests and autotests to GfeCavePyIncludeUtil. + * Aug 22, 2014 3500 bclement added python path in getConfigIncludePath() * * * @author njensen @@ -287,6 +288,7 @@ public class GfePyIncludeUtil extends PythonIncludePathUtil { } public static String getConfigIncludePath(boolean includeUser) { + String pythonPath = GfePyIncludeUtil.getCommonPythonIncludePath(); String baseDir = getPath(PATH_MANAGER.getContext( LocalizationType.CAVE_STATIC, LocalizationLevel.BASE), CONFIG); String siteDir = getPath(PATH_MANAGER.getContext( @@ -295,9 +297,10 @@ public class GfePyIncludeUtil extends PythonIncludePathUtil { String userDir = getPath(PATH_MANAGER.getContext( LocalizationType.CAVE_STATIC, LocalizationLevel.USER), CONFIG); - return PyUtil.buildJepIncludePath(userDir, siteDir, baseDir); + return PyUtil.buildJepIncludePath(userDir, siteDir, baseDir, + pythonPath); } else { - return PyUtil.buildJepIncludePath(siteDir, baseDir); + return PyUtil.buildJepIncludePath(siteDir, baseDir, pythonPath); } } From c2bb43944ca383d50dd1111e2b9d5ac65a293756 Mon Sep 17 00:00:00 2001 From: "steve.naples" Date: Fri, 22 Aug 2014 15:21:35 +0000 Subject: [PATCH 05/25] ASM #15664 Fixed issue with Tear Off menus not closing when perspective is closed, which caused an error. Change-Id: If5fd120b7b34074686492d4cab9268ec1ac51a41 Former-commit-id: e719245823220d7b583ffdb0adc88c8b71321369 --- .../widgets/tearoff/MenuItemComposite.java | 25 ++++++++++--------- .../widgets/tearoff/TearOffMenuDialog.java | 5 +++- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/cave/com.raytheon.uf.viz.ui.menus/src/com/raytheon/uf/viz/ui/menus/widgets/tearoff/MenuItemComposite.java b/cave/com.raytheon.uf.viz.ui.menus/src/com/raytheon/uf/viz/ui/menus/widgets/tearoff/MenuItemComposite.java index 8a07838533..b992c01b09 100644 --- a/cave/com.raytheon.uf.viz.ui.menus/src/com/raytheon/uf/viz/ui/menus/widgets/tearoff/MenuItemComposite.java +++ b/cave/com.raytheon.uf.viz.ui.menus/src/com/raytheon/uf/viz/ui/menus/widgets/tearoff/MenuItemComposite.java @@ -65,7 +65,8 @@ import com.raytheon.uf.viz.ui.menus.widgets.tearoff.TearOffMenuDialog.MenuPathEl * ------------ ---------- ----------- -------------------------- * Sep 15, 2011 mnash Initial creation * Apr 10, 2013 DR 15185 D. Friedman Preserve tear-offs over perspective switches. - * Jev 26, 2014 2842 mpduff Utilize the command listener. + * Jev 26, 2014 2842 mpduff Utilize the command listener. + * Aug 21, 2014 15664 snaples Updated dispose method to fix issue when closing perspecitive with tear offs open. * * * @@ -559,27 +560,27 @@ public class MenuItemComposite extends Composite { highlightedArrow.dispose(); } - if (item != null) { - if (updateListener != null && !item.isDisposed()) { + if (item != null && !item.isDisposed()) { + if (updateListener != null) { item.removeListener(SWT.Modify, updateListener); } - if (radioListener != null && !item.isDisposed()) { + if (radioListener != null) { item.removeSelectionListener(radioListener); } - } - if (item.getData() instanceof CommandContributionItem) { - ICommandService service = (ICommandService) PlatformUI - .getWorkbench().getService(ICommandService.class); - Command c = service.getCommand(((CommandContributionItem) item - .getData()).getCommand().getId()); - c.removeCommandListener(commandListener); + if (item.getData() instanceof CommandContributionItem) { + ICommandService service = (ICommandService) PlatformUI + .getWorkbench().getService(ICommandService.class); + Command c = service.getCommand(((CommandContributionItem) item + .getData()).getCommand().getId()); + c.removeCommandListener(commandListener); + } } - super.dispose(); } + public void setSelection(boolean selection) { if (firstItem instanceof Button) { ((Button) firstItem).setSelection(selection); diff --git a/cave/com.raytheon.uf.viz.ui.menus/src/com/raytheon/uf/viz/ui/menus/widgets/tearoff/TearOffMenuDialog.java b/cave/com.raytheon.uf.viz.ui.menus/src/com/raytheon/uf/viz/ui/menus/widgets/tearoff/TearOffMenuDialog.java index 11a49f7f63..9f77b981bc 100644 --- a/cave/com.raytheon.uf.viz.ui.menus/src/com/raytheon/uf/viz/ui/menus/widgets/tearoff/TearOffMenuDialog.java +++ b/cave/com.raytheon.uf.viz.ui.menus/src/com/raytheon/uf/viz/ui/menus/widgets/tearoff/TearOffMenuDialog.java @@ -60,6 +60,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog; * Sep 14, 2011 mnash Initial creation * Jan 09, 2013 1442 rferrel Add Simulated Time Change Listener. * Apr 10, 2013 DR 15185 D. Friedman Preserve tear-offs over perspective switches. + * Aug 21, 2014 15664 snaples Updated dispose method to fix issue when closing perspecitive with tear offs open. * * * @@ -215,7 +216,9 @@ public class TearOffMenuDialog extends CaveSWTDialog { } shell.removeListener(SWT.Show, swtListener); - menu.removeListener(SWT.Show, swtListener); + if (!menu.isDisposed()) { + menu.removeListener(SWT.Show, swtListener); + } super.disposed(); } From c7a604079280219953ac209a8668579e7b3d1a13 Mon Sep 17 00:00:00 2001 From: Roger Ferrel Date: Mon, 25 Aug 2014 13:22:38 -0500 Subject: [PATCH 06/25] Issue #3537 Fixed dirPattern in category Local. Former-commit-id: d40736ed992300be32ed4a62511fa436e9d167af --- .../utility/common_static/base/archiver/purger/RAW_DATA.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/edexOsgi/com.raytheon.uf.edex.archive/utility/common_static/base/archiver/purger/RAW_DATA.xml b/edexOsgi/com.raytheon.uf.edex.archive/utility/common_static/base/archiver/purger/RAW_DATA.xml index c4d5c145f8..c5a7c71224 100644 --- a/edexOsgi/com.raytheon.uf.edex.archive/utility/common_static/base/archiver/purger/RAW_DATA.xml +++ b/edexOsgi/com.raytheon.uf.edex.archive/utility/common_static/base/archiver/purger/RAW_DATA.xml @@ -28,6 +28,7 @@ * Oct 01, 2013 2147 rferrel Date time stamp no longer requires an hour field. * Dec 12, 2013 2624 rferrel Document Julian time stamp. * May 14, 2014 2881 rferrel Change retention times and data set modifications. + * Aug 25, 2014 3537 rferrel Fixed dirPattern in Category Local. * * @author rferrel * @version 1.0 @@ -142,7 +143,7 @@ Local 168 - (manual)/grib/(\d{4})(\d{2})(\d{2})/\d{2}/ + (manual)/grib/(\d{4})(\d{2})(\d{2})/(\d{2}) .*(LAPS|MSAS).* Date {1}-LAPS/MSAS From 4314f71387f3227396e9125422dc55c52771a856 Mon Sep 17 00:00:00 2001 From: Brian Clements Date: Mon, 25 Aug 2014 13:34:36 -0500 Subject: [PATCH 07/25] Issue #3500 back port of loadConfig.py to fix gfe starup issue Change-Id: I841af0ac81b86e499c0b52dedab64431e7f1ecd7 Former-commit-id: 2a0af03242692708b3e752417ca7d60d28520768 --- .../python/utility/loadConfig.py | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/cave/com.raytheon.viz.gfe/python/utility/loadConfig.py b/cave/com.raytheon.viz.gfe/python/utility/loadConfig.py index 8316ba36d8..775b9b90c8 100644 --- a/cave/com.raytheon.viz.gfe/python/utility/loadConfig.py +++ b/cave/com.raytheon.viz.gfe/python/utility/loadConfig.py @@ -26,31 +26,35 @@ # # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- -# 12/11/09 njensen Initial Creation. -# 08/21/14 3500 bclement fixed loadPreferences except block -# +# 12/11/09 njensen Initial Creation. +# 04/02/2014 #2729 randerso Fixed error handling in loadPreferences # # import types -import LogStream from java.util import HashMap, ArrayList from java.lang import String, Float, Integer, Boolean def loadPreferences(config): try: # import the config file - if type(config) is types.StringType: - globals = loadConfig(config) - elif type(config) is types.ModuleType: - globals = getGlobals(config) + if type(config) is types.StringType: + configName = config + mod = __import__(config) + elif type(config) is types.ModuleType: + configName = config.__name__ + mod = config + + globals = getGlobals(mod) from com.raytheon.viz.gfe import Activator, PythonPreferenceStore prefs = PythonPreferenceStore(globals) Activator.getDefault().setPreferenceStore(prefs) return prefs except Exception, e: - LogStream.logProblem("Unknown or improper config file: ", config) + import LogStream + import traceback + LogStream.logProblem("Unknown or invalid config file: %s\n%s" % (configName, traceback.format_exc())) raise Exception, e From 8962a069be7fd9a5ec772bed8837a09ddb6c9272 Mon Sep 17 00:00:00 2001 From: "Daniel.Huffman" Date: Tue, 26 Aug 2014 13:24:09 +0000 Subject: [PATCH 08/25] ASM #16715 - Reverted and augmented Cities.xml Change-Id: Ib83fab6854b68f11b72ef41104805b3f1431b8f0 Former-commit-id: 2107976bd25c429521d4df7a92a3726a38806ba3 --- .../localization/bundles/maps/Cities.xml | 56 +++++-------------- 1 file changed, 13 insertions(+), 43 deletions(-) diff --git a/cave/com.raytheon.uf.viz.core.maps/localization/bundles/maps/Cities.xml b/cave/com.raytheon.uf.viz.core.maps/localization/bundles/maps/Cities.xml index a6c0b21089..525d44f264 100644 --- a/cave/com.raytheon.uf.viz.core.maps/localization/bundles/maps/Cities.xml +++ b/cave/com.raytheon.uf.viz.core.maps/localization/bundles/maps/Cities.xml @@ -2,19 +2,19 @@ @@ -26,50 +26,20 @@ - - - - + + PLAN_VIEW - - - - - - - - - PLAN_VIEW - - - - - - cities.lpi - Cities - - + + + + + prog_disc + mapdata.city
Cities - - - - - - outlineWidth="1" /> - - PLAN_VIEW - - - - - - mapdata.city
- Cities -
-
From a2dfe8e8f6beae5a1a623b534576a14a5d657b18 Mon Sep 17 00:00:00 2001 From: David Friedman Date: Thu, 28 Aug 2014 15:43:32 +0000 Subject: [PATCH 09/25] ASM #15658 - WarnGen: inclusion of watch information in marine products Change-Id: I9f99e6136027f1a6419800f87e5a5709fe5be6b9 Former-commit-id: 6bfa1d6662b00925814be7126592bbe340651649 --- .../gis/MarineWordingConfiguration.java | 99 ++++++++++++++ .../com/raytheon/viz/warngen/gis/Watch.java | 11 ++ .../raytheon/viz/warngen/gis/WatchUtil.java | 121 +++++++++++++++--- .../warning/config/WarngenConfiguration.java | 12 ++ .../base/warngen/VM_global_library.vm | 30 ++++- .../base/warngen/marineWeatherStatement.xml | 3 + .../base/warngen/marineZoneWording.xml | 24 ++++ .../base/warngen/specialMarineWarning.xml | 3 + .../warngen/specialMarineWarningFollowup.xml | 3 + 9 files changed, 288 insertions(+), 18 deletions(-) create mode 100644 cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gis/MarineWordingConfiguration.java create mode 100644 edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/marineZoneWording.xml diff --git a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gis/MarineWordingConfiguration.java b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gis/MarineWordingConfiguration.java new file mode 100644 index 0000000000..36f0b7cc41 --- /dev/null +++ b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gis/MarineWordingConfiguration.java @@ -0,0 +1,99 @@ +package com.raytheon.viz.warngen.gis; + +import java.util.ArrayList; +import java.util.List; +import java.util.regex.Pattern; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +import com.raytheon.uf.common.dataplugin.warning.util.WarnFileUtil; +import com.raytheon.uf.common.serialization.SingleTypeJAXBManager; +import com.raytheon.uf.viz.core.localization.LocalizationManager; +import com.raytheon.viz.warngen.gui.WarngenLayer; + +/** + * WarngenWordingConfiguration + * + *
+ *    SOFTWARE HISTORY
+ *
+ *    Date         Ticket#     Engineer       Description
+ *    ------------ ----------  -------------- --------------------------
+ *    2014-08-28   ASM #15658  D. Friedman    Initial Creation.
+ */
+@XmlAccessorType(XmlAccessType.NONE)
+@XmlRootElement(name = "zoneWordingConfig")
+public class MarineWordingConfiguration {
+
+    private static final String FILE_NAME = "marineZoneWording.xml";
+
+    @XmlElement(name = "entry")
+    private List entries = new ArrayList();
+
+    public List getEntries() {
+        return entries;
+    }
+
+    public void setEntries(List entries) {
+        this.entries = entries;
+    }
+
+    @XmlAccessorType(XmlAccessType.NONE)
+    public static class MarineWordingEntry {
+        @XmlAttribute(name = "match")
+        private String matchText;
+        @XmlAttribute(name = "replace")
+        private String replacementText;
+
+        private Pattern ugcPattern;
+
+        public String getMatchText() {
+            return matchText;
+        }
+
+        public void setMatchText(String matchText) {
+            this.matchText = matchText;
+            this.ugcPattern = null;
+        }
+
+        public String getReplacementText() {
+            return replacementText;
+        }
+
+        public void setReplacementText(String replacementText) {
+            this.replacementText = replacementText;
+        }
+
+        public Pattern getUgcPattern() {
+            if (ugcPattern == null) {
+                if (matchText != null) {
+                    ugcPattern = Pattern.compile(matchText);
+                }
+            }
+            return ugcPattern;
+        }
+    }
+
+    private static final SingleTypeJAXBManager jaxb = SingleTypeJAXBManager
+            .createWithoutException(MarineWordingConfiguration.class);
+
+
+    public static MarineWordingConfiguration load(WarngenLayer forLayer) throws Exception {
+        String xmlText = WarnFileUtil.convertFileContentsToString(FILE_NAME,
+                LocalizationManager.getInstance().getCurrentSite(),
+                forLayer.getLocalizedSite());
+
+        MarineWordingConfiguration config = (MarineWordingConfiguration)
+                jaxb.unmarshalFromXml(xmlText);
+        for (MarineWordingEntry entry : config.getEntries()) {
+            // Validate patterns by compiling now.
+            entry.getUgcPattern();
+        }
+        return config;
+    }
+
+}
diff --git a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gis/Watch.java b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gis/Watch.java
index 78c1630ca5..c3707a34b5 100644
--- a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gis/Watch.java
+++ b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gis/Watch.java
@@ -33,6 +33,7 @@ import java.util.List;
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * Jul 16, 2014 3419       jsanchez     Initial creation
+ * Aug 28, 2014 ASM #15658 D. Friedman  Add marine zone list.
  * 
  * 
* @@ -58,6 +59,8 @@ public class Watch { private List partOfState; + private List marineAreas; + public Watch(String state, String action, String phenSig, String etn, Date startTime, Date endTime) { this.state = state; @@ -132,6 +135,14 @@ public class Watch { this.etn = etn; } + public List getMarineAreas() { + return marineAreas; + } + + public void setMarineAreas(List marineAreas) { + this.marineAreas = marineAreas; + } + @Override public int hashCode() { final int prime = 31; diff --git a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gis/WatchUtil.java b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gis/WatchUtil.java index 029717e702..59b08b19cc 100644 --- a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gis/WatchUtil.java +++ b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gis/WatchUtil.java @@ -54,8 +54,11 @@ 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.common.util.Pair; +import com.raytheon.uf.viz.core.exception.VizException; import com.raytheon.uf.viz.core.requests.ThriftClient; import com.raytheon.viz.core.mode.CAVEMode; +import com.raytheon.viz.warngen.gis.MarineWordingConfiguration.MarineWordingEntry; import com.raytheon.viz.warngen.gui.WarngenLayer; import com.raytheon.viz.warngen.gui.WarngenLayer.GeoFeatureType; import com.vividsolutions.jts.geom.Geometry; @@ -72,6 +75,7 @@ import com.vividsolutions.jts.geom.Polygon; * ------------ ---------- ----------- -------------------------- * Jul 17, 2014 3419 jsanchez Initial creation * Aug 20, 2014 ASM #16703 D. Friedman Ensure watches have a state attribute. + * Aug 28, 2014 ASM #15658 D. Friedman Add marine zones. * * * @@ -106,10 +110,16 @@ public class WatchUtil { private static final String COUNTY_FE_AREA_FIELD = "FE_AREA"; + private static final Object MARINE_ZONE_UGC_FIELD = "ID"; + + private static final Object MARINE_ZONE_NAME_FIELD = "NAME"; + private static final String STATE_FIELD = "STATE"; private static final String COUNTY_TABLE = "County"; + private static final String MARINE_ZONE_TABLE = "MarineZones"; + private static final String PARENT_NAME_FIELD = "NAME"; private static final String[] REQUEST_FIELDS = new String[] { @@ -118,8 +128,12 @@ public class WatchUtil { private GeospatialData[] countyGeoData; + private GeospatialData[] marineGeoData; + private WarngenLayer warngenLayer; + private MarineWordingConfiguration marineWordingConfig; + public WatchUtil(WarngenLayer warngenLayer) throws InstantiationException { countyGeoData = warngenLayer.getGeodataFeatures(COUNTY_TABLE, warngenLayer.getLocalizedSite()); @@ -155,6 +169,17 @@ public class WatchUtil { Validate.isTrue(watchAreaBuffer >= 0, "'includedWatchAreaBuffer' can not be negative in .xml file"); + if (config.isIncludeMarineAreasInWatches()) { + marineGeoData = warngenLayer.getGeodataFeatures(MARINE_ZONE_TABLE, + warngenLayer.getLocalizedSite()); + if (marineGeoData == null) { + throw new VizException("Cannot get geospatial data for " + + MARINE_ZONE_TABLE + "-based watches"); + } + + marineWordingConfig = MarineWordingConfiguration.load(warngenLayer); + } + String[] includedWatches = config.getIncludedWatches(); if ((includedWatches != null) && (includedWatches.length > 0)) { @@ -174,10 +199,16 @@ public class WatchUtil { entityClass = PracticeActiveTableRecord.class; } + HashSet allUgcs = new HashSet( + warngenLayer.getAllUgcs(GeoFeatureType.COUNTY)); + Set marineUgcs = null; + if (config.isIncludeMarineAreasInWatches()) { + marineUgcs = warngenLayer.getAllUgcs(GeoFeatureType.MARINE); + allUgcs.addAll(marineUgcs); + } + DbQueryRequest request = buildRequest(simulatedTime, - phenSigConstraint.toString(), - warngenLayer.getAllUgcs(GeoFeatureType.COUNTY), - entityClass); + phenSigConstraint.toString(), allUgcs, entityClass); DbQueryResponse response = (DbQueryResponse) ThriftClient .sendRequest(request); @@ -192,9 +223,14 @@ public class WatchUtil { / KmToDegrees); System.out.println("create watch area buffer time: " + (System.currentTimeMillis() - t0)); - Set validUgcZones = warngenLayer - .getUgcsForWatches(watchArea, GeoFeatureType.COUNTY); - watches = processRecords(records, validUgcZones); + HashSet validUgcZones = new HashSet( + warngenLayer.getUgcsForWatches(watchArea, + GeoFeatureType.COUNTY)); + if (config.isIncludeMarineAreasInWatches()) { + validUgcZones.addAll(warngenLayer.getUgcsForWatches( + watchArea, GeoFeatureType.MARINE)); + } + watches = processRecords(records, validUgcZones, marineUgcs); } catch (RuntimeException e) { statusHandler .handle(Priority.ERROR, @@ -302,12 +338,13 @@ public class WatchUtil { * * @param activeTableRecords * @param validUgcZones + * @param marineUgcs * * @return */ private List processRecords( List activeTableRecords, - Set validUgcZones) { + Set validUgcZones, Set marineUgcs) { List watches = new ArrayList(); /* @@ -329,14 +366,16 @@ public class WatchUtil { * validUgcZones here. */ String ugcZone = ar.getUgcZone(); - String state = getStateName(ugcZone.substring(0, 2)); + String state = null; - /* - * Temporary fix for SS DR #16703. Remove when marine watch wording - * is fixed. - */ - if (state == null) - continue; + if (marineUgcs != null && marineUgcs.contains(ugcZone)) { + // Just leave state == null + } else { + state = getStateName(ugcZone.substring(0, 2)); + if (state == null) { + continue; + } + } String action = ar.getAct(); String phenSig = ar.getPhensig(); @@ -360,9 +399,13 @@ public class WatchUtil { for (Entry> entry : map.entrySet()) { Watch watch = entry.getKey(); watch.setAreas(entry.getValue()); - List partOfState = new ArrayList( - determineAffectedPortions(watch.getAreas())); - watch.setPartOfState(partOfState); + if (watch.getState() != null) { + List partOfState = new ArrayList( + determineAffectedPortions(watch.getAreas())); + watch.setPartOfState(partOfState); + } else { + watch.setMarineAreas(determineMarineAreas(watch.getAreas())); + } watches.add(watch); } @@ -412,6 +455,40 @@ public class WatchUtil { return affectedPortions; } + private List determineMarineAreas(List areas) { + HashSet> groupedAreas = new HashSet>(); + for (String area : areas) { + int entryIndex = 0; + for (MarineWordingEntry entry : marineWordingConfig.getEntries()) { + if (entry.getUgcPattern().matcher(area).matches()) { + String replacement = entry.getReplacementText(); + if (replacement != null) { + if (replacement.length() > 0) { + groupedAreas.add(new Pair( + entryIndex, entry.getReplacementText())); + } + } else { + groupedAreas.add(new Pair(entryIndex, + getMarineZoneName(area))); + } + } + entryIndex++; + } + } + ArrayList> sorted = new ArrayList>(groupedAreas); + Collections.sort(sorted, new Comparator>() { + public int compare(Pair o1, Pair o2) { + int r = o1.getFirst().compareTo(o2.getFirst()); + return r != 0 ? r : o1.getSecond().compareTo(o2.getSecond()); + }; + }); + ArrayList result = new ArrayList(sorted.size()); + for (Pair value : sorted) { + result.add(value.getSecond()); + } + return result; + } + /** * Returns the full state name from the state abbreviation. * @@ -446,6 +523,16 @@ public class WatchUtil { return null; } + private String getMarineZoneName(String ugc) { + for (GeospatialData g : marineGeoData) { + if (((String) g.attributes.get(MARINE_ZONE_UGC_FIELD)) + .endsWith(ugc)) { + return (String) g.attributes.get(MARINE_ZONE_NAME_FIELD); + } + } + return null; + } + // Based on AWIPS 1 SELSparagraphs.C SELSparagraphs::processWOU(). private String mungeFeAreas(Set feAreas) { String abrev = ""; diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/config/WarngenConfiguration.java b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/config/WarngenConfiguration.java index b6c6aff962..8259893bc7 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/config/WarngenConfiguration.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/config/WarngenConfiguration.java @@ -61,6 +61,7 @@ import com.raytheon.uf.common.status.UFStatus.Priority; * Apr 24, 2013 1943 jsanchez Marked areaConfig as Deprecated. * Oct 22, 2013 2361 njensen Removed ISerializableObject * Apr 28, 2014 3033 jsanchez Properly handled back up configuration (*.xml) files. + * Aug 28, 2014 ASM #15658 D. Friedman Add marine zone watch wording option. * * * @author chammack @@ -103,6 +104,9 @@ public class WarngenConfiguration { @XmlElement(name = "includedWatch") private String[] includedWatches; + @XmlElement + private boolean includeMarineAreasInWatches; + @XmlElementWrapper(name = "durations") @XmlElement(name = "duration") private int[] durations; @@ -392,6 +396,14 @@ public class WarngenConfiguration { return includedWatches; } + public boolean isIncludeMarineAreasInWatches() { + return includeMarineAreasInWatches; + } + + public void setIncludeMarineAreasInWatches(boolean includeMarineAreasInWatches) { + this.includeMarineAreasInWatches = includeMarineAreasInWatches; + } + public boolean getEnableRestart() { return enableRestart; } diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/VM_global_library.vm b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/VM_global_library.vm index 370ca5642e..135c9cb058 100755 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/VM_global_library.vm +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/VM_global_library.vm @@ -11,7 +11,8 @@ ##### Evan Bookbinder 05-05-2013 handleClosesPoints and 3rd bullet changes (OVER & now) ##### Evan Bookbinder 09-20-2013 Fixed rural area otherPoints in pathcast section, added rural phrase ##### Qinglu Lin 03-17-2014 DR 16309. Updated inserttorwatches and insertsvrwatches. -##### Qinglu Lin 05-21-2014 DR 16309. Updated inserttorwatches and insertsvrwatches by changing 'FOR##' to 'FOR ##'. +##### Qinglu Lin 05-21-2014 DR 16309. Updated inserttorwatches and insertsvrwatches by changing 'FOR##' to 'FOR ##'. +##### D. Friedman 08-28-2014 ASM #15658. Add marine watch wording. #################################################################################################### #* Mile Marker Test Code @@ -218,7 +219,11 @@ ${dateUtil.period(${tornadoWatch.endTime},${timeFormat.plain}, 15, ${localtimezo #set($count = 0) #foreach(${watch} in ${tornadoWatches}) #set($count = $count + 1) +#if(!${watch.marineAreas}) #areaFormat(${watch.partOfState} true false true)${watch.state}## +#else +#formatMarineAreas(${watch.marineAreas}) +#end #if($count == $numPortions - 1) AND ## #elseif($count < $numPortions) @@ -263,7 +268,11 @@ ${dateUtil.period(${svrWatch.endTime},${timeFormat.plain}, 15, ${localtimezone}) #set($count = 0) #foreach(${watch} in ${severeWatches}) #set($count = $count + 1) +#if(!${watch.marineAreas}) #areaFormat(${watch.partOfState} true false true)${watch.state}## +#else +#formatMarineAreas(${watch.marineAreas}) +#end #if($count == $numPortions - 1) AND ## #elseif($count < $numPortions) @@ -278,6 +287,25 @@ ${dateUtil.period(${svrWatch.endTime},${timeFormat.plain}, 15, ${localtimezone}) #end ########END +#macro(formatMarineAreas $marineAreas) +#set($macount = 0) +#set($numMarineAreas = ${list.size(${marineAreas})}) +#foreach(${marineArea} in ${marineAreas}) +#set($macount = $macount + 1) +#if(${marineArea}=="THE ADJACENT COASTAL WATERS" && $macount > 1) +OTHER ADJACENT COASTAL WATERS## +#else +${marineArea}## +#end +#if($macount == $numMarineAreas - 1) + AND ## +#elseif($macount < $numMarineAreas) +...## +#end +#end +#end +########END MACRO + #macro(printcoords $coordinates $list) #set($count = 0) LAT...LON ## diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/marineWeatherStatement.xml b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/marineWeatherStatement.xml index 1b741dadd6..8e3877eb75 100755 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/marineWeatherStatement.xml +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/marineWeatherStatement.xml @@ -58,6 +58,9 @@ turned on unless the corresponding .vm file is turned on in a given template's . SV.A + + true + 60 diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/marineZoneWording.xml b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/marineZoneWording.xml new file mode 100644 index 0000000000..a61fd52788 --- /dev/null +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/marineZoneWording.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/specialMarineWarning.xml b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/specialMarineWarning.xml index a34a8dfd89..fd651f94e2 100755 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/specialMarineWarning.xml +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/specialMarineWarning.xml @@ -61,6 +61,9 @@ turned on unless the corresponding .vm file is turned on in a given template's . SV.A + + true + 30 diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/specialMarineWarningFollowup.xml b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/specialMarineWarningFollowup.xml index cffaf9a764..dc4c01d0cd 100755 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/specialMarineWarningFollowup.xml +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/specialMarineWarningFollowup.xml @@ -63,6 +63,9 @@ turned on unless the corresponding .vm file is turned on in a given template's . SV.A + + true + 30 From 1856a05319c01b932c9378cb79a93bdd261d1c5d Mon Sep 17 00:00:00 2001 From: "steve.naples" Date: Thu, 28 Aug 2014 16:08:17 +0000 Subject: [PATCH 10/25] ASM #14578 - Added Hydrologic date field ti Choose Hour dialog for Daily QC Change-Id: I954833e37c579ab1eaddf95347ba53d73909b138 Former-commit-id: 2e8fb864f410b9b08ccc6de6c0d75666931da3a2 --- .../mpe/ui/actions/OtherPrecipOptions.java | 11 +-- .../ui/dialogs/ChooseDataPeriodDialog.java | 98 ++++++++++++++++++- .../mpe/ui/dialogs/QcFreezeOptionsDialog.java | 5 +- .../mpe/ui/dialogs/QcPrecipOptionsDialog.java | 5 +- .../mpe/ui/dialogs/QcTempOptionsDialog.java | 5 +- .../viz/mpe/util/InitPrecipClimo.java | 2 +- .../raytheon/viz/mpe/util/ReadPrecipA.java | 1 + 7 files changed, 112 insertions(+), 15 deletions(-) diff --git a/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/actions/OtherPrecipOptions.java b/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/actions/OtherPrecipOptions.java index adb13351c5..aeea6dbde8 100644 --- a/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/actions/OtherPrecipOptions.java +++ b/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/actions/OtherPrecipOptions.java @@ -455,12 +455,9 @@ public class OtherPrecipOptions { // // do nothing // } - if (clientdata == 1) { - // do nothing - } - + /* Rendering the grids and MAPs. */ - else if (clientdata == 0) { + if (clientdata == 0) { BadValues bv = new BadValues(); bv.update_bad_values(DailyQcUtils.pcpn_day); @@ -472,16 +469,18 @@ public class OtherPrecipOptions { if (DailyQcUtils.pcpn_day == 0 && (DailyQcUtils.curHr00_06 == 1 || DailyQcUtils.curHr06_12 == 1 || DailyQcUtils.curHr18_00 == 1)) { + System.out.println("Not estimating partial point or daily stations."); // don't estimate } else { EstDailyStations ed = new EstDailyStations(); ed.estimate_daily_stations(DailyQcUtils.pcpn_day, DailyQcUtils.precip_stations, num_stations); - + System.out.println("Estimating daily stations."); EstPartStations ep = new EstPartStations(); ep.estimate_partial_stations(DailyQcUtils.pcpn_day, DailyQcUtils.precip_stations, num_stations); + System.out.println("Estimating partial stations."); } QCStations qs = new QCStations(); diff --git a/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/dialogs/ChooseDataPeriodDialog.java b/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/dialogs/ChooseDataPeriodDialog.java index 20bae8b075..996d988f80 100644 --- a/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/dialogs/ChooseDataPeriodDialog.java +++ b/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/dialogs/ChooseDataPeriodDialog.java @@ -64,6 +64,7 @@ import com.raytheon.viz.ui.editor.IMultiPaneEditor; * Sep 23, 2008 randerso Initial creation * Apr 30, 2013 lbousaidi made seconds in the date/Time * fields visible. + * Aug 26, 2014 14578 snaples Added Ending Hydrologic Date selection. * * * @author randerso @@ -79,8 +80,12 @@ public class ChooseDataPeriodDialog extends CaveJFACEDialog { } private Calendar cal; + + private Calendar hydroCal; public static Date prevDate; + + public static Date prevHydDate; public static String prevArea; @@ -93,6 +98,12 @@ public class ChooseDataPeriodDialog extends CaveJFACEDialog { private Spinner hourSpinner; private Spinner daysSpinner; + + private Text hydyearText; + + private Text hydmonthText; + + private Spinner hyddaySpinner; private Map dateMap; @@ -118,6 +129,8 @@ public class ChooseDataPeriodDialog extends CaveJFACEDialog { private Combo areaCombo; + private static Date currentHydroEndingDate; + public ChooseDataPeriodDialog(Shell parentShell) { super(parentShell); setBlockOnOpen(false); @@ -144,8 +157,13 @@ public class ChooseDataPeriodDialog extends CaveJFACEDialog { dateMap = dataMgr.getDateMap(false); qcEnable = MPEDisplayManager.isMpeQcOptionEnabled(); cal = Calendar.getInstance(TimeZone.getTimeZone("GMT")); + hydroCal = Calendar.getInstance(TimeZone.getTimeZone("GMT")); prevDate = displayMgr.getCurrentEditDate(); cal.setTime(prevDate); + if(prevHydDate == null){ + prevHydDate = prevDate; + } + hydroCal.setTime(prevHydDate); } /* @@ -313,8 +331,59 @@ public class ChooseDataPeriodDialog extends CaveJFACEDialog { gageOptionsGroup.setLayout(layout); gageOptionsGroup.setText("6/24 hr gage edit options"); - new Label(gageOptionsGroup, SWT.NONE); + // create ending hydro date area + + Label hydrodateLabel = new Label(gageOptionsGroup, SWT.NONE); + hydrodateLabel.setText("Ending Hydrologic Date: "); + new Label(gageOptionsGroup, SWT.None); + Composite hydrodateComp = new Composite(gageOptionsGroup, SWT.NONE); + GridData hydrodata = new GridData(SWT.FILL, SWT.DEFAULT, true, false); + hydrodateComp.setLayoutData(hydrodata); + GridLayout hydlayout = new GridLayout(3, false); + hydrodateComp.setLayout(hydlayout); + + Label hydyearLabel = new Label(hydrodateComp, SWT.NONE); + hydyearLabel.setText("Ending Year"); + + Label hydmonthLabel = new Label(hydrodateComp, SWT.NONE); + hydmonthLabel.setText("Month"); + + Label hyddayLabel = new Label(hydrodateComp, SWT.NONE); + hyddayLabel.setText("Day"); + + hydyearText = new Text(hydrodateComp, SWT.BORDER | SWT.READ_ONLY); + hydrodata = new GridData(SWT.DEFAULT, SWT.DEFAULT, false, false); + hydrodata.widthHint = 100; + hydyearText.setLayoutData(hydrodata); + + hydmonthText = new Text(hydrodateComp, SWT.BORDER | SWT.READ_ONLY); + hydrodata = new GridData(SWT.DEFAULT, SWT.DEFAULT, false, false); + hydrodata.widthHint = 50; + hydmonthText.setLayoutData(hydrodata); + + hyddaySpinner = new Spinner(hydrodateComp, SWT.BORDER | SWT.READ_ONLY); + hydrodata = new GridData(SWT.DEFAULT, SWT.DEFAULT, false, false); + hydrodata.widthHint = 50; + hyddaySpinner.setLayoutData(data); + hyddaySpinner.setMinimum(0); + hyddaySpinner.setMaximum(32); + hyddaySpinner.addSelectionListener(new SelectionAdapter() { + + @Override + public void widgetSelected(SelectionEvent e) { + int day = hyddaySpinner.getSelection(); + + hydroCal.set(Calendar.DAY_OF_MONTH, day); + + updateTimeControls(); + } + + }); + + + new Label(gageOptionsGroup, SWT.None); + new Label(gageOptionsGroup, SWT.None); Label selectAreaLabel = new Label(gageOptionsGroup, SWT.NONE); selectAreaLabel.setText("Select Area"); data = new GridData(SWT.CENTER, SWT.DEFAULT, false, false); @@ -373,6 +442,8 @@ public class ChooseDataPeriodDialog extends CaveJFACEDialog { public void widgetSelected(SelectionEvent e) { displayMgr.setDqcDays(daysSpinner.getSelection()); prevArea = areaCombo.getItem(areaCombo.getSelectionIndex()); + setCurrentHydroEditDate(getHydroTime()); + if (QcPrecipOptionsDialog.isFinished() == false) { QcPrecipOptionsDialog.destroy(false); } @@ -400,6 +471,8 @@ public class ChooseDataPeriodDialog extends CaveJFACEDialog { public void widgetSelected(SelectionEvent e) { displayMgr.setDqcDays(daysSpinner.getSelection()); prevArea = areaCombo.getItem(areaCombo.getSelectionIndex()); + setCurrentHydroEditDate(getHydroTime()); + if (QcTempOptionsDialog.isFinished() == false) { QcTempOptionsDialog.destroy(false); } @@ -427,6 +500,8 @@ public class ChooseDataPeriodDialog extends CaveJFACEDialog { public void widgetSelected(SelectionEvent e) { displayMgr.setDqcDays(daysSpinner.getSelection()); prevArea = areaCombo.getItem(areaCombo.getSelectionIndex()); + setCurrentHydroEditDate(getHydroTime()); + if (QcFreezeOptionsDialog.isFinished() == false) { QcFreezeOptionsDialog.destroy(false); } @@ -454,13 +529,19 @@ public class ChooseDataPeriodDialog extends CaveJFACEDialog { if (cal.getTime().before(dataMgr.getEarliestDate()) || cal.getTime().after(dataMgr.getLatestDate())) { cal.setTime(prevDate); + hydroCal.setTime(prevHydDate); } prevDate = cal.getTime(); + prevHydDate = hydroCal.getTime(); yearText.setText(Integer.toString(cal.get(Calendar.YEAR))); monthText.setText(Integer.toString(cal.get(Calendar.MONTH) + 1)); daySpinner.setSelection(cal.get(Calendar.DAY_OF_MONTH)); - + + hydyearText.setText(Integer.toString(hydroCal.get(Calendar.YEAR))); + hydmonthText.setText(Integer.toString(hydroCal.get(Calendar.MONTH) + 1)); + hyddaySpinner.setSelection(hydroCal.get(Calendar.DAY_OF_MONTH)); + hourSpinner.setSelection(cal.get(Calendar.HOUR_OF_DAY)); if (dateMap.containsKey(cal.getTime()) == false) { @@ -502,6 +583,19 @@ public class ChooseDataPeriodDialog extends CaveJFACEDialog { public Date getTime() { return cal.getTime(); } + + public Date getHydroTime(){ + return hydroCal.getTime(); + } + + private void setCurrentHydroEditDate(Date hydroTime) { + currentHydroEndingDate = hydroTime; + } + + public static Date getCurrentHydroEditDate(){ + return currentHydroEndingDate; + } + /** * Get the selected year; diff --git a/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/dialogs/QcFreezeOptionsDialog.java b/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/dialogs/QcFreezeOptionsDialog.java index 50408b17df..947e5bc9d7 100644 --- a/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/dialogs/QcFreezeOptionsDialog.java +++ b/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/dialogs/QcFreezeOptionsDialog.java @@ -67,6 +67,7 @@ import com.raytheon.viz.ui.perspectives.VizPerspectiveListener; * ------------ ---------- ----------- -------------------------- * Jul, 7 2009 snaples Initial creation * Sep 11, 2013 #2353 lvenable Fixed cursor memory leak. + * Aug 26, 2014 14578 snaples Changed the way we get current data to use new ending hydologic date. * * * @@ -195,8 +196,8 @@ public class QcFreezeOptionsDialog extends AbstractMPEDialog { Shell parent = this.getParent(); Display display = parent.getDisplay(); MPEDisplayManager displayMgr = MPEDisplayManager.getCurrent(); - Date prevDate = displayMgr.getCurrentEditDate(); - Date currDate = ChooseDataPeriodDialog.prevDate; + Date prevDate = ChooseDataPeriodDialog.getCurrentHydroEditDate(); + Date currDate = ChooseDataPeriodDialog.prevHydDate; String QcArea = ChooseDataPeriodDialog.prevArea; AppsDefaults appDefaults = AppsDefaults.getInstance(); DisplayFieldData df = displayMgr.getDisplayFieldType(); diff --git a/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/dialogs/QcPrecipOptionsDialog.java b/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/dialogs/QcPrecipOptionsDialog.java index fa30c3fbed..a5aa4a231e 100644 --- a/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/dialogs/QcPrecipOptionsDialog.java +++ b/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/dialogs/QcPrecipOptionsDialog.java @@ -67,6 +67,7 @@ import com.raytheon.viz.mpe.util.DailyQcUtils.Ts; * Mar 7, 2013 15657 lbousaidi fixed DQC slider and added listener to the Keys * when pressed. * Sep 11, 2013 #2353 lvenable Fixed cursor memory leak. + * Aug 26, 2014 14578 snaples Changed the way we get the date, to use new ending hydro date field. * * * @author snaples @@ -207,8 +208,8 @@ public class QcPrecipOptionsDialog extends AbstractMPEDialog { Shell parent = this.getParent(); Display display = parent.getDisplay(); MPEDisplayManager displayMgr = MPEDisplayManager.getCurrent(); - Date prevDate = displayMgr.getCurrentEditDate(); - Date currDate = ChooseDataPeriodDialog.prevDate; + Date prevDate = ChooseDataPeriodDialog.getCurrentHydroEditDate(); + Date currDate = ChooseDataPeriodDialog.prevHydDate; String QcArea = ChooseDataPeriodDialog.prevArea; AppsDefaults appDefaults = AppsDefaults.getInstance(); DisplayFieldData df = displayMgr.getDisplayFieldType(); diff --git a/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/dialogs/QcTempOptionsDialog.java b/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/dialogs/QcTempOptionsDialog.java index 377555e8c0..7cab504bba 100644 --- a/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/dialogs/QcTempOptionsDialog.java +++ b/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/dialogs/QcTempOptionsDialog.java @@ -64,6 +64,7 @@ import com.raytheon.viz.mpe.util.DailyQcUtils.Ts; * ------------ ---------- ----------- -------------------------- * Nov 12, 2008 snaples Initial creation * Sep 11, 2013 #2353 lvenable Fixed cursor memory leak. + * Aug 26, 2014 14578 snaples Changed the way we get current data to use new ending hydologic date. * * * @@ -196,8 +197,8 @@ public class QcTempOptionsDialog extends AbstractMPEDialog { Shell parent = this.getParent(); Display display = parent.getDisplay(); MPEDisplayManager displayMgr = MPEDisplayManager.getCurrent(); - Date prevDate = displayMgr.getCurrentEditDate(); - Date currDate = ChooseDataPeriodDialog.prevDate; + Date prevDate = ChooseDataPeriodDialog.getCurrentHydroEditDate(); + Date currDate = ChooseDataPeriodDialog.prevHydDate; String QcArea = ChooseDataPeriodDialog.prevArea; AppsDefaults appDefaults = AppsDefaults.getInstance(); DisplayFieldData df = displayMgr.getDisplayFieldType(); diff --git a/cave/com.raytheon.viz.mpe/src/com/raytheon/viz/mpe/util/InitPrecipClimo.java b/cave/com.raytheon.viz.mpe/src/com/raytheon/viz/mpe/util/InitPrecipClimo.java index f5ac2a8d74..87e8e69b6b 100644 --- a/cave/com.raytheon.viz.mpe/src/com/raytheon/viz/mpe/util/InitPrecipClimo.java +++ b/cave/com.raytheon.viz.mpe/src/com/raytheon/viz/mpe/util/InitPrecipClimo.java @@ -184,8 +184,8 @@ public class InitPrecipClimo { precip_stations.set(index, nstation); nstation = null; } - ++index; } + ++index; } in.close(); diff --git a/cave/com.raytheon.viz.mpe/src/com/raytheon/viz/mpe/util/ReadPrecipA.java b/cave/com.raytheon.viz.mpe/src/com/raytheon/viz/mpe/util/ReadPrecipA.java index 5403010be7..e576ae8800 100644 --- a/cave/com.raytheon.viz.mpe/src/com/raytheon/viz/mpe/util/ReadPrecipA.java +++ b/cave/com.raytheon.viz.mpe/src/com/raytheon/viz/mpe/util/ReadPrecipA.java @@ -84,6 +84,7 @@ public class ReadPrecipA { try { in = new BufferedReader(new FileReader(preca)); + System.out.println("Reading point file: " + preca); for (j = 0; j < 5; j++) { number_found[j] = 0; From c89a7169b04d5e1dc70d61a3bbe30d1aeb2c81e4 Mon Sep 17 00:00:00 2001 From: "Daniel.Huffman" Date: Thu, 28 Aug 2014 17:20:30 +0000 Subject: [PATCH 11/25] ASM #16715 - Reverted and augmented Airports.xml and Fix.xml Change-Id: Icd15e1947ec7d71b22d621b452d9e1c74767898e Former-commit-id: 09e0b79b25ec4f8854dde331469b0e7d6c4ffa1f --- .../bundles/maps/FAA/Airports.xml | 32 ----------------- .../localization/bundles/maps/FAA/Fix.xml | 34 ------------------- 2 files changed, 66 deletions(-) diff --git a/cave/com.raytheon.uf.viz.core.maps/localization/bundles/maps/FAA/Airports.xml b/cave/com.raytheon.uf.viz.core.maps/localization/bundles/maps/FAA/Airports.xml index f76d3207ae..579e5ccbcc 100644 --- a/cave/com.raytheon.uf.viz.core.maps/localization/bundles/maps/FAA/Airports.xml +++ b/cave/com.raytheon.uf.viz.core.maps/localization/bundles/maps/FAA/Airports.xml @@ -22,35 +22,6 @@ - - - - - - - PLAN_VIEW - - - - - - - - - - - PLAN_VIEW - - - - - - mapdata.airport
- Airports -
-
@@ -66,9 +37,6 @@ airport.lpi Airports - - - Airports
diff --git a/cave/com.raytheon.uf.viz.core.maps/localization/bundles/maps/FAA/Fix.xml b/cave/com.raytheon.uf.viz.core.maps/localization/bundles/maps/FAA/Fix.xml index b4cab44690..9db555024b 100644 --- a/cave/com.raytheon.uf.viz.core.maps/localization/bundles/maps/FAA/Fix.xml +++ b/cave/com.raytheon.uf.viz.core.maps/localization/bundles/maps/FAA/Fix.xml @@ -22,37 +22,6 @@ - - - - - - - PLAN_VIEW - - - - - - - - - - - - PLAN_VIEW - - - - - - mapdata.fix
- Fixes/Intersections - type != 'NU' -
-
@@ -70,9 +39,6 @@ Fixes/Intersections
- Fixes/Intersections -
- From de6e79f9e381e7f2cda70104216b5729dabaa507 Mon Sep 17 00:00:00 2001 From: David Friedman Date: Thu, 28 Aug 2014 18:08:23 +0000 Subject: [PATCH 12/25] ASM #15682 - D-2D: SPC Watches display: Watches do not disappear when expired Change-Id: I3a29b5b0bb5c75dd5ac5f508391f5806cabf47fa Former-commit-id: aca832a81bc18d954eadb51755ce04597cd264df --- .../bundles/ncepHydro/ConvectiveWatchPlot.xml | 29 ++ .../menus/ncepHydro/spc/baseSPC.xml | 4 +- .../viz/warnings/rsc/WWAResourceData.java | 17 +- .../viz/warnings/rsc/WatchesResource.java | 2 +- .../warnings/rsc/WouWcnWatchesResource.java | 429 ++++++++++++++++++ .../rsc/WouWcnWatchesResourceData.java | 56 +++ 6 files changed, 530 insertions(+), 7 deletions(-) create mode 100644 cave/com.raytheon.uf.viz.d2d.ui.ncephydro/localization/bundles/ncepHydro/ConvectiveWatchPlot.xml create mode 100644 cave/com.raytheon.viz.warnings/src/com/raytheon/viz/warnings/rsc/WouWcnWatchesResource.java create mode 100644 cave/com.raytheon.viz.warnings/src/com/raytheon/viz/warnings/rsc/WouWcnWatchesResourceData.java diff --git a/cave/com.raytheon.uf.viz.d2d.ui.ncephydro/localization/bundles/ncepHydro/ConvectiveWatchPlot.xml b/cave/com.raytheon.uf.viz.d2d.ui.ncephydro/localization/bundles/ncepHydro/ConvectiveWatchPlot.xml new file mode 100644 index 0000000000..01d6f48442 --- /dev/null +++ b/cave/com.raytheon.uf.viz.d2d.ui.ncephydro/localization/bundles/ncepHydro/ConvectiveWatchPlot.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/cave/com.raytheon.uf.viz.d2d.ui.ncephydro/localization/menus/ncepHydro/spc/baseSPC.xml b/cave/com.raytheon.uf.viz.d2d.ui.ncephydro/localization/menus/ncepHydro/spc/baseSPC.xml index 535f7795f2..b3ed96c9c5 100644 --- a/cave/com.raytheon.uf.viz.d2d.ui.ncephydro/localization/menus/ncepHydro/spc/baseSPC.xml +++ b/cave/com.raytheon.uf.viz.d2d.ui.ncephydro/localization/menus/ncepHydro/spc/baseSPC.xml @@ -20,8 +20,8 @@ --> - + diff --git a/cave/com.raytheon.viz.warnings/src/com/raytheon/viz/warnings/rsc/WWAResourceData.java b/cave/com.raytheon.viz.warnings/src/com/raytheon/viz/warnings/rsc/WWAResourceData.java index ac3b495abc..ade59795fd 100644 --- a/cave/com.raytheon.viz.warnings/src/com/raytheon/viz/warnings/rsc/WWAResourceData.java +++ b/cave/com.raytheon.viz.warnings/src/com/raytheon/viz/warnings/rsc/WWAResourceData.java @@ -42,6 +42,7 @@ import com.raytheon.viz.core.mode.CAVEMode; * May 3, 2011 jsanchez Initial creation * Oct 25, 2013 2249 rferrel getAvailableTimes always returns a non-empty list. * Apr 28, 2014 DR 17310 D. Friedman Handle null VTEC fields. + * Aug 28, 2014 ASM #15682 D. Friedman Refactor for WouWcnWatchesResourceData. * * * @@ -98,13 +99,13 @@ public class WWAResourceData extends AbstractRequestableResourceData { @Override public DataTime[] getAvailableTimes() throws VizException { - DataTime[] available = getAvailableTimes(getMetadataMap(), + DataTime[] available = getAvailableWarningTimes(getMetadataMap(), getBinOffset()); return available; } - public static DataTime[] getAvailableTimes( + public DataTime[] getAvailableWarningTimes( Map constraintMap, BinOffset binOffset) throws VizException { DbQueryResponse response = null; @@ -116,8 +117,9 @@ public class WWAResourceData extends AbstractRequestableResourceData { String etn = "etn"; String phensig = "phensig"; String act = "act"; + String pil = "pil"; request.addFields(new String[] { startTimeField, endTimeField, act, - etn, phensig }); + etn, phensig, pil }); response = (DbQueryResponse) ThriftClient.sendRequest(request); if (response.getResults() == null) { @@ -137,7 +139,10 @@ public class WWAResourceData extends AbstractRequestableResourceData { warnRec.setAct((String) map.get(act)); warnRec.setPhensig((String) map.get(phensig)); warnRec.setEtn((String) map.get(etn)); - warnings.add(warnRec); + warnRec.setPil((String) map.get(pil)); + if (isRecordTimeImportant(warnRec)) { + warnings.add(warnRec); + } } RequestConstraint phenSig = constraintMap.get("phensig"); @@ -165,6 +170,10 @@ public class WWAResourceData extends AbstractRequestableResourceData { return availableTimes; } + protected boolean isRecordTimeImportant(AbstractWarningRecord warnRec) { + return true; + } + private static TreeSet getWarningStartTimes( ArrayList warnings) { /* diff --git a/cave/com.raytheon.viz.warnings/src/com/raytheon/viz/warnings/rsc/WatchesResource.java b/cave/com.raytheon.viz.warnings/src/com/raytheon/viz/warnings/rsc/WatchesResource.java index 1494ac5034..85d5bf47b2 100644 --- a/cave/com.raytheon.viz.warnings/src/com/raytheon/viz/warnings/rsc/WatchesResource.java +++ b/cave/com.raytheon.viz.warnings/src/com/raytheon/viz/warnings/rsc/WatchesResource.java @@ -290,7 +290,7 @@ public class WatchesResource extends AbstractWWAResource { } } - private void setGeometry(AbstractWarningRecord record) { + protected void setGeometry(AbstractWarningRecord record) { List county = new ArrayList(); List marinezone = new ArrayList(); List geometries = new ArrayList(); diff --git a/cave/com.raytheon.viz.warnings/src/com/raytheon/viz/warnings/rsc/WouWcnWatchesResource.java b/cave/com.raytheon.viz.warnings/src/com/raytheon/viz/warnings/rsc/WouWcnWatchesResource.java new file mode 100644 index 0000000000..a6374b1e0d --- /dev/null +++ b/cave/com.raytheon.viz.warnings/src/com/raytheon/viz/warnings/rsc/WouWcnWatchesResource.java @@ -0,0 +1,429 @@ +package com.raytheon.viz.warnings.rsc; + +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Timer; +import java.util.TimerTask; + +import com.raytheon.uf.common.dataplugin.warning.AbstractWarningRecord; +import com.raytheon.uf.common.dataplugin.warning.WarningRecord.WarningAction; +import com.raytheon.uf.common.time.ISimulatedTimeChangeListener; +import com.raytheon.uf.common.time.SimulatedTime; +import com.raytheon.uf.viz.core.IGraphicsTarget; +import com.raytheon.uf.viz.core.drawables.FillPatterns; +import com.raytheon.uf.viz.core.drawables.IShadedShape; +import com.raytheon.uf.viz.core.exception.VizException; +import com.raytheon.uf.viz.core.rsc.LoadProperties; +import com.raytheon.viz.core.rsc.jts.JTSCompiler; +import com.raytheon.viz.core.rsc.jts.JTSCompiler.PointStyle; +import com.vividsolutions.jts.geom.Geometry; + +/** + * Displays WOUs updated by WCNs + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * 2014-08-28   ASM #15682 D. Friemdan Initial creation
+ * 
+ * + */ +public class WouWcnWatchesResource extends WatchesResource implements ISimulatedTimeChangeListener { + + private static Timer timer; + + private TimerTask timerTask; + + // If this is changed to use the maps database, could probably be static + private Map> cwaUgcMap = new HashMap>(); + + static final ThreadLocal sdf = new ThreadLocal() { + @Override protected SimpleDateFormat initialValue() { + return new SimpleDateFormat("yyyyMMddHHmm"); + } + }; + + public WouWcnWatchesResource(WWAResourceData data, LoadProperties props) { + super(data, props); + comparator = WouWcnWatchesComparator.getInstance(); + resourceName = "Watches"; + } + + private AbstractWarningRecord getPreviousRecordForEvent(AbstractWarningRecord rec) { + String phenSig = rec.getPhensig(); + String etn = rec.getEtn(); + if (phenSig == null || etn == null) + return null; + AbstractWarningRecord best = null; + for (WarningEntry e : entryMap.values()) { + if (!phenSig.equals(e.record.getPhensig()) || + !etn.equals(e.record.getEtn())) + continue; + + if (best == null || WouWcnWatchesComparator.getInstance(). + compare(best, e.record) < 0) { + best = e.record; + } + } + return best; + } + + private Set maskCwaUgcs(Set ugcs, AbstractWarningRecord rec) { + Set cwaUgcs = getUgcsForCwa(rec.getXxxid()); + if (cwaUgcs != null) { + HashSet result = new HashSet(ugcs); + result.removeAll(cwaUgcs); + return result; + } else { + return ugcs; + } + } + + private Set getUgcsForCwa(String cwa) { + return cwaUgcMap.get(cwa.toUpperCase()); + } + + private Set safe(Set set) { + return set != null ? set : new HashSet(); + } + + @Override + protected void updateDisplay(IGraphicsTarget target) throws VizException { + if (recordsToLoad.isEmpty()) + return; + + List mergedWatches = mergeWatches(recordsToLoad); + for (AbstractWarningRecord watchRec : mergedWatches) { + /* If these things are missing, we can't do anything with the warning. */ + if (watchRec.getPhensig() == null || watchRec.getEtn() == null || + watchRec.getIssueTime() == null || watchRec.getStartTime() == null || + watchRec.getEndTime() == null || watchRec.getXxxid() == null || + watchRec.getWmoid() == null || watchRec.getAct() == null) { + continue; + } + + WarningAction watchAct = WarningAction.valueOf(watchRec.getAct()); + + AbstractWarningRecord createShape = null; + boolean isWOU = "WOU".equals(watchRec.getPil()); + + AbstractWarningRecord prevRec = getPreviousRecordForEvent(watchRec); + Set prevUgcs = new HashSet(safe( + prevRec != null ? prevRec.getUgcZones() : null)); + Set newUgcs = null; + + if (watchAct == WarningAction.NEW) { + if (isWOU) { + createShape = watchRec; + } else { + noteCwaUgcs(watchRec); + // As per requirements, we do not create frames for these. + } + } else if (watchAct == WarningAction.CON && isWOU) { + // As per requirements, we do not create frames for these. + } else if (watchAct == WarningAction.CON) { + /* No need to do anything because we really only care about + * the segments paired with the CON. + */ + } else if (watchAct == WarningAction.CAN) { + /* Not really expecting this for a WOU, but shouldn't cause + * a problem if there is one. + */ + newUgcs = prevUgcs; + newUgcs.removeAll(safe(watchRec.getUgcZones())); + createShape = watchRec; + } else if (watchAct == WarningAction.EXA || watchAct == WarningAction.EXB) { + if (!isWOU) { + noteCwaUgcs(watchRec); + } + newUgcs = prevUgcs; + newUgcs.addAll(safe(watchRec.getUgcZones())); + createShape = watchRec; + } else if (watchAct == WarningAction.EXP) { + if (isWOU) { + if (prevRec != null) { + if (! prevRec.getEndTime().equals(watchRec.getEndTime())) { + prevRec.setEndTime(watchRec.getEndTime()); + } + } + /* + * Ideally we do not need to create a shape, but if we do + * not and time matching creates a frame for an EXP that is + * issued before the expiration time, the warning would show + * as still active on that frame. + */ + newUgcs = new HashSet(); + createShape = watchRec; + } else { + newUgcs = maskCwaUgcs(prevUgcs, watchRec); + createShape = watchRec; + } + } + if (watchAct == WarningAction.EXT || watchAct == WarningAction.EXB) { + /* This resource does not handle different expiration times + * for different UGCs. + * + * Also assuming this does not add/remove UGCs. + */ + if (prevRec != null && watchRec.getEndTime() != null) { + if (isWOU && watchRec.getUgcZones() != null && watchRec.getUgcZones().isEmpty()) { + /* + * This probably does not actually happen, but this + * is the only way we can support shortening the + * expiration time with the current design. + */ + prevRec.setEndTime(watchRec.getEndTime()); + } else { + if (prevRec.getEndTime().before(watchRec.getEndTime())) { + prevRec.setEndTime(watchRec.getEndTime()); + } + } + } + } + + if (createShape != null) { + if (newUgcs != null) + createShape.setUgcZones(newUgcs); + else if (createShape.getUgcZones() == null) + createShape.setUgcZones(new HashSet()); + insertShape(target, createShape); + } + } + + recordsToLoad.clear(); + scheduleNextTime(); + } + + + @Override + protected void initShape(IGraphicsTarget target, + AbstractWarningRecord record) throws VizException { + String key = getEntryMapKey(record); + WarningEntry entry = entryMap.get(key); + if (entry != null) { + createShape(target, entry); + } + } + + protected void insertShape(IGraphicsTarget target, AbstractWarningRecord record) throws VizException { + String key = getEntryMapKey(record); + WarningEntry entry = entryMap.get(key); + if (entry == null) { + entry = new WarningEntry(); + entryMap.put(key, entry); + } + entry.record = record; // ...possibly replacing an existing record + if (! record.getUgcZones().isEmpty()) { + setGeometry(record); + } else { + entry.record.setGeometry(null); + } + createShape(target, entry); + } + + protected void createShape(IGraphicsTarget target, WarningEntry entry) throws VizException { + if (entry.shadedShape != null) { + entry.shadedShape.dispose(); + entry.shadedShape = null; + } + AbstractWarningRecord record = entry.record; + if (record.getGeometry() != null) { + IShadedShape ss = target.createShadedShape(false, + descriptor.getGridGeometry(), false); + Geometry geo = (Geometry) record.getGeometry().clone(); + JTSCompiler jtsCompiler = new JTSCompiler(ss, null, + this.descriptor, PointStyle.CROSS); + jtsCompiler.handle(geo, color); + ss.setFillPattern(FillPatterns.getGLPattern(record.getPhen() + .equals("TO") ? "VERTICAL" : "HORIZONTAL")); + ss.compile(); + entry.shadedShape = ss; + } + } + + /** + * Groups all the ugc zones with the same action, phensig, ETN, site, and + * issuance time. + */ + protected List mergeWatches( + List watchrecs) { + SimpleDateFormat sdfi = sdf.get(); + + Map watches = new HashMap(); + for (AbstractWarningRecord watchrec : watchrecs) { + if (watchrec.getIssueTime() == null) + continue; + + String key = watchrec.getAct() + '.' + watchrec.getPhensig() + '.' + + watchrec.getEtn() + '.' + watchrec.getOfficeid() + '.' + + sdfi.format(watchrec.getIssueTime().getTime()); + AbstractWarningRecord watch = watches.get(key); + if (watch == null) { + watch = watchrec; + watches.put(key, watch); + } else { + Set ugcZones = watch.getUgcZones(); + if (ugcZones != null) { + ugcZones.addAll(watchrec.getUgcZones()); + } + } + } + + ArrayList mergedWatches = new ArrayList( + watches.values()); + Collections.sort(mergedWatches, comparator); + + return mergedWatches; + } + + protected String getEntryMapKey(AbstractWarningRecord rec) { + return sdf.get().format(rec.getIssueTime().getTime()) + '.' + + rec.getWmoid() + '.' + rec.getPhensig() + '.' + rec.getEtn(); + } + + @Override + protected String getEventKey(WarningEntry entry) { + AbstractWarningRecord r = entry.record; + return r.getPhensig() + '.' + r.getEtn(); + } + + private void noteCwaUgcs(AbstractWarningRecord watchRec) { + String siteKey = watchRec.getXxxid(); + Set recUgcs = watchRec.getUgcZones(); + if (siteKey == null || recUgcs == null) + return; + + synchronized (cwaUgcMap) { + Set ugcs = cwaUgcMap.get(siteKey); + if (ugcs == null) { + ugcs = new HashSet(); + cwaUgcMap.put(siteKey, ugcs); + } + ugcs.addAll(recUgcs); + } + } + + @Override + protected void disposeInternal() { + synchronized(this) { + if (timerTask != null) + timerTask.cancel(); + } + super.disposeInternal(); + } + + private void scheduleNextTime() { + /* TODO: This is a race condition. Need the last frame time, + * but getLastFrameTimeRange() is also a race condition. So really need + * last drawn last frame time, but LAST_FRAME_ADJ is an hour ahead??! + */ + long vnow = SimulatedTime.getSystemTime().getMillis(); + AbstractWarningRecord best = null; + for (WarningEntry entry : entryMap.values()) { + AbstractWarningRecord rec = entry.record; + if (rec.getEndTime().getTimeInMillis() >= vnow && + (best == null || rec.getEndTime().before(best.getEndTime()))) { + best = rec; + } + } + if (best != null) { + scheduleTimer(best.getEndTime().getTimeInMillis() - vnow); + } else { + scheduleTimer(-1); + } + } + + private synchronized void scheduleTimer(long delay) { + if (timerTask != null) { + timerTask.cancel(); + } + if (delay >= 0) { + timerTask = new WatchesTimerTask(); + getTimer().schedule(timerTask, delay); + } else { + timerTask = null; + } + } + + private Timer getTimer() { + if (timer == null) { + synchronized (WouWcnWatchesResource.class) { + if (timer == null) { + timer = new Timer(WouWcnWatchesResource.class.getName() + " Timer"); + } + } + } + return timer; + } + + @Override + public void timechanged() { + issueRefresh(); + scheduleNextTime(); + } + + protected class WatchesTimerTask extends TimerTask { + + @Override + public void run() { + timechanged(); + } + } + + protected static class WouWcnWatchesComparator implements Comparator { + + static final WouWcnWatchesComparator instance = new WouWcnWatchesComparator(); + + public static Comparator getInstance() { + return instance; + } + + @Override + public int compare(AbstractWarningRecord a, AbstractWarningRecord b) { + int r; + Calendar ca = a.getIssueTime(); + Calendar cb = b.getIssueTime(); + if (ca == null) { + if (cb == null) + r = 0; + else + return 1; + } else if (cb == null) + return -1; + else + r = ca.compareTo(cb); + if (r != 0) + return r; + + // The point of this is to handle the BBB field, but it makes the TTAAii part significant too... + String sa = safeWmo(a); + String sb = safeWmo(b); + r = sa.compareTo(sb); + if (r != 0) + return r; + + r = a.getSeg() - b.getSeg(); + if (r != 0) + return r; + + return 0; + } + } + + private static String safeWmo(AbstractWarningRecord record) { + String wmo = record.getWmoid(); + return wmo != null ? wmo : "TTAA00 CCCC 000000"; + } + +} diff --git a/cave/com.raytheon.viz.warnings/src/com/raytheon/viz/warnings/rsc/WouWcnWatchesResourceData.java b/cave/com.raytheon.viz.warnings/src/com/raytheon/viz/warnings/rsc/WouWcnWatchesResourceData.java new file mode 100644 index 0000000000..b90996953a --- /dev/null +++ b/cave/com.raytheon.viz.warnings/src/com/raytheon/viz/warnings/rsc/WouWcnWatchesResourceData.java @@ -0,0 +1,56 @@ +package com.raytheon.viz.warnings.rsc; + +import java.util.ArrayList; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; + +import com.raytheon.uf.common.dataplugin.PluginDataObject; +import com.raytheon.uf.common.dataplugin.warning.AbstractWarningRecord; +import com.raytheon.uf.common.dataplugin.warning.WarningRecord.WarningAction; +import com.raytheon.uf.viz.core.exception.VizException; +import com.raytheon.uf.viz.core.rsc.AbstractVizResource; +import com.raytheon.uf.viz.core.rsc.LoadProperties; + +/** + * Displays WOUs updated by WCNs + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * 2014-08-28   ASM #15682 D. Friemdan Initial creation
+ * 
+ * + */ +@XmlAccessorType(XmlAccessType.NONE) +public class WouWcnWatchesResourceData extends WWAResourceData { + + @Override + protected AbstractVizResource constructResource( + LoadProperties loadProperties, PluginDataObject[] objects) + throws VizException { + // add records + records = new ArrayList(objects.length); + for (int i = 0; i < objects.length; i++) { + AbstractWarningRecord r = (AbstractWarningRecord) objects[i]; + records.add(r); + } + + return new WouWcnWatchesResource(this, loadProperties); + } + + @Override + protected boolean isRecordTimeImportant(AbstractWarningRecord warnRec) { + WarningAction act = WarningAction.valueOf(warnRec.getAct()); + if (("WOU".equals(warnRec.getPil()) && WarningAction.CON == act) || + ("WCN".equals(warnRec.getPil()) && WarningAction.NEW == act)) { + return false; + } else { + return super.isRecordTimeImportant(warnRec); + } + } +} + From 6f8c6d6aa156115ff73b24aa5f591a5761f733a8 Mon Sep 17 00:00:00 2001 From: Roger Ferrel Date: Tue, 26 Aug 2014 10:24:25 -0500 Subject: [PATCH 13/25] Issue #3553 - Force redisplay of data set table after all labels are generated. Change-Id: Ie8c0195414102d046e5348e778ba8d5e1053e5ec Former-commit-id: bcc9b0a6352151dfdf3ba75063bb87308cb162b4 --- .../raytheon/uf/viz/archive/data/SizeJob.java | 7 ++-- .../uf/viz/archive/ui/AbstractArchiveDlg.java | 42 ++++++++++++++++--- .../viz/archive/ui/ArchiveRetentionDlg.java | 6 +-- .../uf/viz/archive/ui/CaseCreationDlg.java | 7 +--- 4 files changed, 44 insertions(+), 18 deletions(-) diff --git a/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/data/SizeJob.java b/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/data/SizeJob.java index a9735621ce..c73e9d5910 100644 --- a/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/data/SizeJob.java +++ b/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/data/SizeJob.java @@ -53,6 +53,7 @@ import com.raytheon.uf.common.time.util.TimeUtil; * Dec 11, 2013 #2624 rferrel Clear display variables when recomputing sizes. * Mar 27, 2014 #2879 rferrel Loading Case no longer changes Start/End times. * Apr 23, 2014 #3045 rferrel Changes to prevent race condition while getting labels. + * Aug 26, 2014 #3553 rferrel Option to force update of table's display data. * * * @@ -157,7 +158,7 @@ public class SizeJob extends Job { private boolean stopComputeSize; /** - * Priority queue for getting display data all archive/category tables. + * Priority queue for getting display data for all archive/category tables. */ // Do not use a PriorityBlockingQueue since the load select and change // display methods need to be notified when the display data is available. @@ -473,11 +474,11 @@ public class SizeJob extends Job { * @return displayData */ public List changeDisplay(String archiveName, - String categoryName, AtomicBoolean shutdown) { + String categoryName, AtomicBoolean shutdown, boolean forceUpdate) { List displayDatas = null; // Only get data when the display really needs to be changed. - if (!archiveName.equals(displayArchive) + if (forceUpdate || !archiveName.equals(displayArchive) || !categoryName.equals(displayCategory)) { // Update visible status of current display. diff --git a/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/AbstractArchiveDlg.java b/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/AbstractArchiveDlg.java index a095803415..1b2c576996 100644 --- a/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/AbstractArchiveDlg.java +++ b/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/AbstractArchiveDlg.java @@ -82,6 +82,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog; * Apr 15, 2014 3034 lvenable Added dispose checks in runAsync calls. * Apr 10, 2014 3023 rferrel Added setTotalSelectedSize method. * Apr 23, 2014 3045 rferrel Changes to prevent race condition while getting labels. + * Aug 26, 2014 3553 rferrel Force redisplay of table after getting all display labels. * * * @@ -146,6 +147,9 @@ public abstract class AbstractArchiveDlg extends CaveSWTDialog implements /** Job running to populate the currently selected archive/category. */ private Job populateTableJob = null; + /** Flag to indicate all labels for all tables are loaded. */ + protected volatile boolean haveAllLabels = false; + /** * @param parentShell */ @@ -360,6 +364,9 @@ public abstract class AbstractArchiveDlg extends CaveSWTDialog implements */ protected void createTable() { tableComp = new ArchiveTableComp(shell, type, this, sizeJob); + // Indicate loading the table labels. + tableComp + .setCursor(shell.getDisplay().getSystemCursor(SWT.CURSOR_WAIT)); sizeJob.addUpdateListener(this); } @@ -491,6 +498,13 @@ public abstract class AbstractArchiveDlg extends CaveSWTDialog implements * adjust sizes on the display table. */ protected void populateTableComp() { + populateTableComp(false); + } + + /** + * @param forceUpdate + */ + protected void populateTableComp(final boolean forceUpdate) { final String archiveName = getSelectedArchiveName(); final String categoryName = getSelectedCategoryName(); @@ -508,7 +522,8 @@ public abstract class AbstractArchiveDlg extends CaveSWTDialog implements @Override protected IStatus run(IProgressMonitor monitor) { - getCategoryTableData(archiveName, categoryName, shutdown); + getCategoryTableData(archiveName, categoryName, shutdown, + forceUpdate); // Just populated the current table update cursor. if (!shutdown.get()) { @@ -543,7 +558,8 @@ public abstract class AbstractArchiveDlg extends CaveSWTDialog implements * @param shutdown */ private void getCategoryTableData(final String archiveName, - final String categoryName, final AtomicBoolean shutdown) { + final String categoryName, final AtomicBoolean shutdown, + boolean forceUpdate) { if (!sizeJob.isCurrentDisplay(archiveName, categoryName)) { VizApp.runAsync(new Runnable() { @@ -558,7 +574,7 @@ public abstract class AbstractArchiveDlg extends CaveSWTDialog implements } final List displayDatas = sizeJob.changeDisplay( - archiveName, categoryName, shutdown); + archiveName, categoryName, shutdown, forceUpdate); VizApp.runAsync(new Runnable() { @@ -695,6 +711,8 @@ public abstract class AbstractArchiveDlg extends CaveSWTDialog implements .setToolTipText("Change display to show all case selections"); } } + } else { + showingSelected = false; } } @@ -838,9 +856,23 @@ public abstract class AbstractArchiveDlg extends CaveSWTDialog implements } /** - * Allows sub-class to perform updates once all the display data is loaded. + * Perform updates once all the display data is loaded. */ - abstract public void loadedAllDisplayData(); + public void loadedAllDisplayData() { + VizApp.runAsync(new Runnable() { + + @Override + public void run() { + haveAllLabels = true; + if (showingSelected) { + populateSelectAllTable(); + } else { + populateTableComp(true); + } + tableComp.setCursor(null); + } + }); + } /** * When unsaved modifications this asks the user to verify the close. diff --git a/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/ArchiveRetentionDlg.java b/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/ArchiveRetentionDlg.java index 9f8214bcca..f8bb63956b 100644 --- a/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/ArchiveRetentionDlg.java +++ b/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/ArchiveRetentionDlg.java @@ -59,6 +59,7 @@ import com.raytheon.uf.common.time.util.TimeUtil; * Apr 14, 2014 #3023 rferrel Code clean up. * Apr 24, 2014 #3045 rferrel Implement loadedAllDsipalyData. * May 28, 2014 #3171 rferrel Change retention labels. + * Aug 26, 2014 #3553 rferrel No longer need to override loadedAllDisplayData. * * * @@ -423,9 +424,4 @@ public class ArchiveRetentionDlg extends AbstractArchiveDlg { archiveComboSelection(); categoryComboSelection(); } - - @Override - public void loadedAllDisplayData() { - // nothing to update. - } } diff --git a/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/CaseCreationDlg.java b/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/CaseCreationDlg.java index 073216d7e8..910228e597 100644 --- a/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/CaseCreationDlg.java +++ b/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/CaseCreationDlg.java @@ -78,6 +78,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback; * Mar 26, 2014 32880 rferrerl Implement case compression and split. * Apr 23, 2014 #3045 rferrel To prevent race condition only allow a case * load after all labels are loaded. + * Aug 26, 2014 #3553 rferrel loadedAllDisplayData must now call its super. * * * @@ -171,9 +172,6 @@ public class CaseCreationDlg extends AbstractArchiveDlg { /** Manager for configurable values for the dialog. */ private final CaseCreationManager ccManager; - /** Flag to indicate all labels for all tables are loaded. */ - private volatile boolean haveAllLabels = false; - /** * Constructor. * @@ -1112,8 +1110,6 @@ public class CaseCreationDlg extends AbstractArchiveDlg { */ @Override public void loadedAllDisplayData() { - haveAllLabels = true; - /* * Restore the buttons' default background color and tooltip text. The * buttons color is not the system standard and the tool tip text @@ -1133,6 +1129,7 @@ public class CaseCreationDlg extends AbstractArchiveDlg { } } }); + super.loadedAllDisplayData(); } @Override From 160dabc4d118b3a04a90f79bcb468f05a06837e5 Mon Sep 17 00:00:00 2001 From: Ana Rivera Date: Thu, 28 Aug 2014 16:26:13 +0000 Subject: [PATCH 14/25] VLab Issue #3617 - RMDR_16720 Updates to HRRR DCS_266; fixes #3617 Change-Id: I159cbaed918fc48c31d115314e29ad9c2128a7f1 Former-commit-id: 2df117a7aec644e6964da6c36326ab3b29b9f378 --- .../derivedParameters/definitions/BLI.xml | 26 ++ .../derivedParameters/definitions/LTNG.xml | 22 ++ .../derivedParameters/definitions/MAXDVV.xml | 26 ++ .../derivedParameters/definitions/MAXUVV.xml | 26 ++ .../derivedParameters/definitions/MXREF.xml | 26 ++ .../derivedParameters/definitions/MXUPHL.xml | 26 ++ .../definitions/MaxWHRRR.xml | 7 + .../derivedParameters/definitions/TP.xml | 2 +- .../derivedParameters/definitions/WGS1hr.xml | 13 + .../localization/bundles/volume/HRRR.xml | 260 ++++++++++++++++++ .../menus/volume/baseFamilies.xml | 6 + .../menus/volume/baseSurfaceFamilies.xml | 6 + .../localization/menus/xml/fieldsMenus.xml | 20 ++ .../menus/xml/planesMenusPlanView.xml | 1 + .../volumebrowser/LevelMappingFile.xml | 16 +- .../base/grid/master_grib2_lookup.txt | 3 + .../base/grib/models/gribModels_NCEP-7.xml | 1 + .../base/grib/tables/7/0/4.2.0.16.table | 1 + .../base/styleRules/d2dContourStyleRules.xml | 29 ++ .../base/styleRules/gridImageryStyleRules.xml | 36 +++ .../base/colormaps/HRRR Reflectivity.cmap | 260 ++++++++++++++++++ 21 files changed, 804 insertions(+), 9 deletions(-) create mode 100644 cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/BLI.xml create mode 100644 cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/LTNG.xml create mode 100644 cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/MAXDVV.xml create mode 100644 cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/MAXUVV.xml create mode 100644 cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/MXREF.xml create mode 100644 cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/MXUPHL.xml create mode 100644 cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/MaxWHRRR.xml create mode 100644 cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/WGS1hr.xml create mode 100644 cave/com.raytheon.viz.volumebrowser/localization/bundles/volume/HRRR.xml create mode 100755 edexOsgi/com.raytheon.uf.common.dataplugin.radar/utility/common_static/base/colormaps/HRRR Reflectivity.cmap diff --git a/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/BLI.xml b/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/BLI.xml new file mode 100644 index 0000000000..c4a6710c1a --- /dev/null +++ b/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/BLI.xml @@ -0,0 +1,26 @@ + + + + + + + + diff --git a/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/LTNG.xml b/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/LTNG.xml new file mode 100644 index 0000000000..ee4144d376 --- /dev/null +++ b/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/LTNG.xml @@ -0,0 +1,22 @@ + + + + diff --git a/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/MAXDVV.xml b/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/MAXDVV.xml new file mode 100644 index 0000000000..cdd0fb9419 --- /dev/null +++ b/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/MAXDVV.xml @@ -0,0 +1,26 @@ + + + + + + + + diff --git a/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/MAXUVV.xml b/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/MAXUVV.xml new file mode 100644 index 0000000000..431f6e2fc2 --- /dev/null +++ b/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/MAXUVV.xml @@ -0,0 +1,26 @@ + + + + + + + + diff --git a/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/MXREF.xml b/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/MXREF.xml new file mode 100644 index 0000000000..b0d7bcd510 --- /dev/null +++ b/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/MXREF.xml @@ -0,0 +1,26 @@ + + + + + + + + diff --git a/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/MXUPHL.xml b/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/MXUPHL.xml new file mode 100644 index 0000000000..fc076df656 --- /dev/null +++ b/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/MXUPHL.xml @@ -0,0 +1,26 @@ + + + + + + + + diff --git a/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/MaxWHRRR.xml b/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/MaxWHRRR.xml new file mode 100644 index 0000000000..2c6594b32e --- /dev/null +++ b/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/MaxWHRRR.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/TP.xml b/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/TP.xml index 40a84f773b..d1931e999e 100644 --- a/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/TP.xml +++ b/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/TP.xml @@ -35,7 +35,7 @@ - + diff --git a/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/WGS1hr.xml b/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/WGS1hr.xml new file mode 100644 index 0000000000..c86c8edbb4 --- /dev/null +++ b/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/WGS1hr.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/cave/com.raytheon.viz.volumebrowser/localization/bundles/volume/HRRR.xml b/cave/com.raytheon.viz.volumebrowser/localization/bundles/volume/HRRR.xml new file mode 100644 index 0000000000..ef77757169 --- /dev/null +++ b/cave/com.raytheon.viz.volumebrowser/localization/bundles/volume/HRRR.xml @@ -0,0 +1,260 @@ + + + + + + + PLAN_VIEW + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + PLAN_VIEW + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + PLAN_VIEW + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + PLAN_VIEW + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + PLAN_VIEW + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + PLAN_VIEW + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + PLAN_VIEW + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 16 + + + + diff --git a/cave/com.raytheon.viz.volumebrowser/localization/menus/volume/baseFamilies.xml b/cave/com.raytheon.viz.volumebrowser/localization/menus/volume/baseFamilies.xml index 7a33e15b3c..c494620049 100644 --- a/cave/com.raytheon.viz.volumebrowser/localization/menus/volume/baseFamilies.xml +++ b/cave/com.raytheon.viz.volumebrowser/localization/menus/volume/baseFamilies.xml @@ -69,6 +69,12 @@
+ + + + + diff --git a/cave/com.raytheon.viz.volumebrowser/localization/menus/volume/baseSurfaceFamilies.xml b/cave/com.raytheon.viz.volumebrowser/localization/menus/volume/baseSurfaceFamilies.xml index 9a819801e3..2e68e932cc 100644 --- a/cave/com.raytheon.viz.volumebrowser/localization/menus/volume/baseSurfaceFamilies.xml +++ b/cave/com.raytheon.viz.volumebrowser/localization/menus/volume/baseSurfaceFamilies.xml @@ -44,6 +44,12 @@ + + + + + diff --git a/cave/com.raytheon.viz.volumebrowser/localization/menus/xml/fieldsMenus.xml b/cave/com.raytheon.viz.volumebrowser/localization/menus/xml/fieldsMenus.xml index 58f0d85aad..93a4245313 100644 --- a/cave/com.raytheon.viz.volumebrowser/localization/menus/xml/fieldsMenus.xml +++ b/cave/com.raytheon.viz.volumebrowser/localization/menus/xml/fieldsMenus.xml @@ -110,6 +110,8 @@ indentText="false" /> + + + + + + @@ -1358,6 +1370,14 @@ key="VILIQ" indentText="true" /> + + + + + + + MaxWHRRR + + + kts + + 10 + + + + + + HRRR + CPOFP + + + % + + 0 10 20 30 40 50 60 70 80 90 100 + + + + + + + MaxWHRRR + + + kts + Grid/gridded data + + + + + HRRR + CPOFP + + + false + % + + -50 + 100 + + Grid/gridded data + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From b352bd3944c95b5984ce928dd4ee4bb2c4ed2707 Mon Sep 17 00:00:00 2001 From: Brian Clements Date: Fri, 29 Aug 2014 08:39:59 -0500 Subject: [PATCH 15/25] Issue #3500 moved ProcedureXMLManager initialization to CAVE component subclass Change-Id: Ie8a509a5f5b6b0a358460f0218925458106fd040 Former-commit-id: b3482522860408c2d052261e845899cf73c2ce96 --- .../src/com/raytheon/viz/gfe/GfeClient.java | 14 ++------------ .../personalities/awips/AbstractCAVEComponent.java | 3 +-- .../raytheon/viz/ui/personalities/awips/CAVE.java | 8 ++++++++ 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/GfeClient.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/GfeClient.java index d68778ffbe..d3e8d11c10 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/GfeClient.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/GfeClient.java @@ -63,6 +63,8 @@ import com.raytheon.viz.ui.personalities.awips.AbstractCAVEComponent; * python path causing python to look in user's * current default directory for modules. * Aug 22, 2014 3500 bclement override postStartupActions() + * Aug 29, 2014 3500 bclement removed override of postStartupActions() + * since ProcedureXMLManager startup was moved to the CAVE subclass * * * @@ -198,16 +200,4 @@ public class GfeClient extends AbstractCAVEComponent { "-time")); } - - /* (non-Javadoc) - * @see com.raytheon.viz.ui.personalities.awips.AbstractCAVEComponent#postStartupActions() - */ - @Override - protected void postStartupActions() { - /* - * GFE client does not require the default post startup actions (ie - * ProcedureXMLManager being initialized) - */ - } - } diff --git a/cave/com.raytheon.viz.ui.personalities.awips/src/com/raytheon/viz/ui/personalities/awips/AbstractCAVEComponent.java b/cave/com.raytheon.viz.ui.personalities.awips/src/com/raytheon/viz/ui/personalities/awips/AbstractCAVEComponent.java index c2056fcca9..0f2a807ce2 100644 --- a/cave/com.raytheon.viz.ui.personalities.awips/src/com/raytheon/viz/ui/personalities/awips/AbstractCAVEComponent.java +++ b/cave/com.raytheon.viz.ui.personalities.awips/src/com/raytheon/viz/ui/personalities/awips/AbstractCAVEComponent.java @@ -58,7 +58,6 @@ import com.raytheon.uf.viz.core.localization.LocalizationConstants; import com.raytheon.uf.viz.core.localization.LocalizationInitializer; import com.raytheon.uf.viz.core.localization.LocalizationManager; import com.raytheon.uf.viz.core.notification.jobs.NotificationManagerJob; -import com.raytheon.uf.viz.core.procedures.ProcedureXmlManager; import com.raytheon.uf.viz.core.status.VizStatusHandlerFactory; import com.raytheon.uf.viz.personalities.cave.workbench.VizWorkbenchAdvisor; import com.raytheon.viz.alerts.jobs.AutoUpdater; @@ -100,6 +99,7 @@ import com.raytheon.viz.core.units.UnitRegistrar; * Dec 10, 2013 2602 bsteffen Start loading ProcedureXmlManager in * startComponent. * Aug 22, 2014 3500 bclement moved ProcedureXMLManager initialization to postStartupActions() + * Aug 29, 2014 3500 bclement moved ProcedureXMLManager initialization to CAVE subclass * * * @@ -309,7 +309,6 @@ public abstract class AbstractCAVEComponent implements IStandaloneComponent { * started */ protected void postStartupActions() { - ProcedureXmlManager.inititializeAsync(); } /** diff --git a/cave/com.raytheon.viz.ui.personalities.awips/src/com/raytheon/viz/ui/personalities/awips/CAVE.java b/cave/com.raytheon.viz.ui.personalities.awips/src/com/raytheon/viz/ui/personalities/awips/CAVE.java index 486dfa997d..29a424927c 100644 --- a/cave/com.raytheon.viz.ui.personalities.awips/src/com/raytheon/viz/ui/personalities/awips/CAVE.java +++ b/cave/com.raytheon.viz.ui.personalities.awips/src/com/raytheon/viz/ui/personalities/awips/CAVE.java @@ -19,6 +19,8 @@ **/ package com.raytheon.viz.ui.personalities.awips; +import com.raytheon.uf.viz.core.procedures.ProcedureXmlManager; + /** * This is the default component for CAVE that is the standard workbench with * all the perspectives. @@ -31,6 +33,7 @@ package com.raytheon.viz.ui.personalities.awips; * Aug 09, 2010 mschenke Initial creation * Jul 01, 2013 2139 jsanchez Loaded map tree at cave start up. * Oct 22, 2013 2361 njensen Undid 2139 fix since 2158 fixes it more efficiently + * Aug 29, 2014 3500 bclement added postStartupActions() * * * @@ -56,4 +59,9 @@ public class CAVE extends AbstractCAVEComponent { } + @Override + protected void postStartupActions() { + ProcedureXmlManager.inititializeAsync(); + } + } From a285439c08292ab0036ec155b39fd468e55bfacf Mon Sep 17 00:00:00 2001 From: "Kiran.Shrestha" Date: Fri, 29 Aug 2014 13:50:55 -0400 Subject: [PATCH 16/25] ASM #506 - TextWS: Unable to save unofficial text products from text editor. Change-Id: I969cd9ddaa9adc83d5e65571fbb4f45ea89002a6 Former-commit-id: 1681bea10870df58b3f2cc0d0a59f21c596e9e95 --- .../com/raytheon/viz/texteditor/dialogs/TextEditorDialog.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/dialogs/TextEditorDialog.java b/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/dialogs/TextEditorDialog.java index c1333b969f..a0cf68cd3f 100644 --- a/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/dialogs/TextEditorDialog.java +++ b/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/dialogs/TextEditorDialog.java @@ -4398,7 +4398,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, .getProductCategory(token) + tdm.getProductDesignator(token); // Set the header text field. - if (bbbid.equals("NOR") || tdm.getAfosPil(token) != null) { + if (bbbid.equals("NOR") || (bbbid.isEmpty() && tdm.getAfosPil(token) != null)) { String wmoId = tdm.getWmoId(token); wmoId = (wmoId.length() > 0 ? wmoId : "-"); String siteId = tdm.getSiteId(token); From 9c3b002990b18335df1ebbf277b612f2f8f482ed Mon Sep 17 00:00:00 2001 From: Dave Hladky Date: Tue, 2 Sep 2014 09:20:49 -0500 Subject: [PATCH 17/25] Issue #3564 Allow for un-authenicated WFS HTTPS connections. Change-Id: Ib144a570b2206b336aac0b9e8ebc00c9f096775a Former-commit-id: 7afe5332fcf41bbc8bb2411944584405f3ba686a --- .../uf/edex/datadelivery/retrieval/util/WfsConnectionUtil.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery.retrieval/src/com/raytheon/uf/edex/datadelivery/retrieval/util/WfsConnectionUtil.java b/edexOsgi/com.raytheon.uf.edex.datadelivery.retrieval/src/com/raytheon/uf/edex/datadelivery/retrieval/util/WfsConnectionUtil.java index 88e242cb85..e7af257b4f 100644 --- a/edexOsgi/com.raytheon.uf.edex.datadelivery.retrieval/src/com/raytheon/uf/edex/datadelivery/retrieval/util/WfsConnectionUtil.java +++ b/edexOsgi/com.raytheon.uf.edex.datadelivery.retrieval/src/com/raytheon/uf/edex/datadelivery/retrieval/util/WfsConnectionUtil.java @@ -36,6 +36,7 @@ import com.raytheon.uf.common.status.UFStatus.Priority; * Aug 06, 2013 2097 dhladky WFS 2.0 compliance upgrade and switched to POST * Nov 20, 2013 2554 dhladky Added GZIP capability to WFS requests. * Jan 13, 2014 2697 dhladky Added util to strip unique Id field from URL. + * Aub 20, 2014 3564 dhladky Allow for un-authenicated HTTPS * * * @@ -80,6 +81,7 @@ public class WfsConnectionUtil { ProviderCredentials creds = ProviderCredentialsUtil .retrieveCredentials(providerName); Connection localConnection = creds.getConnection(); + http.setHttpsConfiguration(new WfsHttpsConfiguration(uri)); if (localConnection != null && localConnection.getProviderKey() != null) { @@ -91,7 +93,6 @@ public class WfsConnectionUtil { String password = localConnection.getUnencryptedPassword(); http.setHandler(new WfsCredentialsHandler(userName, password)); - http.setHttpsConfiguration(new WfsHttpsConfiguration(uri)); http.setCredentials(uri.getHost(), uri.getPort(), providerName, userName, password); } From ab8b2ef4739779cd0cae3d9849a7cd2b63997391 Mon Sep 17 00:00:00 2001 From: Benjamin Phillippe Date: Tue, 2 Sep 2014 10:00:35 -0500 Subject: [PATCH 18/25] Issue #3560 Fix for registry memory issue Former-commit-id: a6e4a2cac4d6f9390c5181439a6c834db56a95c6 --- edexOsgi/build.edex/esb/conf/wrapper.conf | 1 + edexOsgi/build.edex/esb/etc/centralRegistry.sh | 2 ++ edexOsgi/build.edex/esb/etc/default.sh | 2 ++ edexOsgi/build.edex/esb/etc/devRegistry.sh | 2 ++ edexOsgi/build.edex/esb/etc/registry.sh | 2 ++ 5 files changed, 9 insertions(+) diff --git a/edexOsgi/build.edex/esb/conf/wrapper.conf b/edexOsgi/build.edex/esb/conf/wrapper.conf index fcccb8e844..bbd19207f0 100644 --- a/edexOsgi/build.edex/esb/conf/wrapper.conf +++ b/edexOsgi/build.edex/esb/conf/wrapper.conf @@ -101,6 +101,7 @@ wrapper.java.additional.gc.1=-XX:+UseConcMarkSweepGC wrapper.java.additional.gc.2=-XX:+CMSIncrementalMode wrapper.java.additional.gc.3=-XX:+HeapDumpOnOutOfMemoryError wrapper.java.additional.gc.4=-XX:HeapDumpPath=/data/fxa/cave/${SHORT_HOSTNAME}/ +wrapper.java.additional.gc.5=-XX:SoftRefLRUPolicyMSPerMB=${SOFT_REF_LRU_POLICY_MS_PER_MB} # use qpid binding URL instead of default address string format wrapper.java.additional.qpid.1=-Dqpid.dest_syntax=BURL diff --git a/edexOsgi/build.edex/esb/etc/centralRegistry.sh b/edexOsgi/build.edex/esb/etc/centralRegistry.sh index c6edad4b3c..cd8749e46b 100644 --- a/edexOsgi/build.edex/esb/etc/centralRegistry.sh +++ b/edexOsgi/build.edex/esb/etc/centralRegistry.sh @@ -30,3 +30,5 @@ export METADATA_POOL_MIN=10 export METADATA_POOL_MAX=25 export METADATA_POOL_TIMEOUT=60 export CLUSTER_ID=NCF + +export SOFT_REF_LRU_POLICY_MS_PER_MB=50 diff --git a/edexOsgi/build.edex/esb/etc/default.sh b/edexOsgi/build.edex/esb/etc/default.sh index 7d2a181151..e6bc9127c5 100644 --- a/edexOsgi/build.edex/esb/etc/default.sh +++ b/edexOsgi/build.edex/esb/etc/default.sh @@ -48,3 +48,5 @@ export WRAPPER_DEADLOCK_ACTION=RESTART export WRAPPER_ON_EXIT_ACTION=RESTART export WRAPPER_TRIGGER_ACTION=RESTART export WRAPPER_USE_SYSTEM_JAVA=false + +export SOFT_REF_LRU_POLICY_MS_PER_MB=1000 diff --git a/edexOsgi/build.edex/esb/etc/devRegistry.sh b/edexOsgi/build.edex/esb/etc/devRegistry.sh index 86b41aaf4c..62c2e47b27 100644 --- a/edexOsgi/build.edex/esb/etc/devRegistry.sh +++ b/edexOsgi/build.edex/esb/etc/devRegistry.sh @@ -30,3 +30,5 @@ export EBXML_REGISTRY_FEDERATION_ENABLED=false export NCF_HOST=${DATADELIVERY_HOST} export NCF_ADDRESS=http://${NCF_HOST}:${EBXML_REGISTRY_WEBSERVER_PORT} export NCF_BANDWIDTH_MANAGER_SERVICE=http://${NCF_HOST}:${EBXML_THRIFT_SERVICE_PORT}/services + +export SOFT_REF_LRU_POLICY_MS_PER_MB=50 diff --git a/edexOsgi/build.edex/esb/etc/registry.sh b/edexOsgi/build.edex/esb/etc/registry.sh index 9797f22d08..69002eae13 100644 --- a/edexOsgi/build.edex/esb/etc/registry.sh +++ b/edexOsgi/build.edex/esb/etc/registry.sh @@ -29,3 +29,5 @@ export MGMT_PORT=9605 export METADATA_POOL_MIN=5 export METADATA_POOL_MAX=20 export METADATA_POOL_TIMEOUT=60 + +export SOFT_REF_LRU_POLICY_MS_PER_MB=50 \ No newline at end of file From 46c62a1db62b2e5536d7ba6d71fd24f888e03fe9 Mon Sep 17 00:00:00 2001 From: Ron Anderson Date: Tue, 2 Sep 2014 12:21:42 -0500 Subject: [PATCH 19/25] Issue #3572 Fixed getNumpy errors for Grid2DFloat Change-Id: I6caf979c1d531a842f77d23dbd7f8e0865afecce Former-commit-id: e2ecb91569c2f622d45f7301c1eb4e058a2ab641 --- .../python/query/DBSSClient.py | 10 +- .../raytheon/viz/gfe/core/IISCDataAccess.java | 15 +- .../viz/gfe/core/internal/ISCDataAccess.java | 49 +- .../uf/common/dataplugin/gfe/grid/Grid2D.java | 3 +- .../common/dataplugin/gfe/grid/Grid2DBit.java | 18 + .../dataplugin/gfe/grid/Grid2DBoolean.java | 449 ------------------ .../dataplugin/gfe/grid/Grid2DByte.java | 10 +- .../dataplugin/gfe/grid/Grid2DFloat.java | 10 +- 8 files changed, 48 insertions(+), 516 deletions(-) delete mode 100644 edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/grid/Grid2DBoolean.java diff --git a/cave/com.raytheon.viz.gfe/python/query/DBSSClient.py b/cave/com.raytheon.viz.gfe/python/query/DBSSClient.py index fa95809a08..e0a161ce84 100644 --- a/cave/com.raytheon.viz.gfe/python/query/DBSSClient.py +++ b/cave/com.raytheon.viz.gfe/python/query/DBSSClient.py @@ -17,6 +17,14 @@ # See the AWIPS II Master Rights File ("Master Rights File.pdf") for # further licensing information. ## +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# Sep 01, 2014 3572 randerso Fix getTopo +# +######################################################################## import DatabaseID, AbsTime, JUtil from com.raytheon.uf.common.dataplugin.gfe.db.objects import DatabaseID as JavaDatabaseID @@ -116,4 +124,4 @@ class DBSSClient: return self._dataMgr.getOpMode().name() def getTopo(self): - return self._tmgr.getCompositeTopo().getScalarGrid().__numpy__[0] + return self._tmgr.getCompositeTopo().__numpy__[0] diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/core/IISCDataAccess.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/core/IISCDataAccess.java index e12fc8541b..1accb9e486 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/core/IISCDataAccess.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/core/IISCDataAccess.java @@ -44,6 +44,7 @@ import com.vividsolutions.jts.geom.Coordinate; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * 07/14/09 1995 bphillip Initial release + * 09/01/2014 3572 randerso Removed unused inOurSite method * * * @@ -98,20 +99,6 @@ public interface IISCDataAccess { */ public String getISCSite(Point coord, GridID gid); - /** - * Returns true if the coordinate (and grid id) is in our own domain. The - * officeType for the parm and our officeType must be the same to be - * considered "inOurSite". - * - * @param loc - * The coordinate to check - * @param gid - * The gridID associated with the coordinate - * @return true if coordinate is in our domain and the parm and office type - * match - */ - public boolean inOurSite(Point loc, GridID gid); - /** * Returns the data point for the gridid. Will return either the data point * from the specified grid, or its corresponding isc grid, depending upon diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/core/internal/ISCDataAccess.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/core/internal/ISCDataAccess.java index e1104df6bf..b35c715a6a 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/core/internal/ISCDataAccess.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/core/internal/ISCDataAccess.java @@ -36,7 +36,6 @@ import com.raytheon.uf.common.dataplugin.gfe.db.objects.ParmID; import com.raytheon.uf.common.dataplugin.gfe.discrete.DiscreteKey; import com.raytheon.uf.common.dataplugin.gfe.grid.Grid2D; import com.raytheon.uf.common.dataplugin.gfe.grid.Grid2DBit; -import com.raytheon.uf.common.dataplugin.gfe.grid.Grid2DBoolean; import com.raytheon.uf.common.dataplugin.gfe.grid.Grid2DByte; import com.raytheon.uf.common.dataplugin.gfe.grid.Grid2DFloat; import com.raytheon.uf.common.dataplugin.gfe.reference.ReferenceData; @@ -75,6 +74,8 @@ import com.vividsolutions.jts.geom.Coordinate; * ------------ ---------- ----------- -------------------------- * 07/14/09 1995 bphillip Initial release * 10/31/2013 2508 randerso Change to use DiscreteGridSlice.getKeys() + * 09/01/2014 3572 randerso Removed ourSiteMap as it was unused and the only + * thing that used Grid2DBoolean * * * @@ -90,10 +91,6 @@ public class ISCDataAccess implements IISCDataAccess { private Map> siteGridMap; - // private Map> siteIdentifiers; - - private Grid2DBoolean ourSiteMap; - /** * Constructs a new ISCDataAccess object * @@ -207,21 +204,6 @@ public class ISCDataAccess implements IISCDataAccess { } } - @Override - public boolean inOurSite(Point loc, GridID gid) { - // must be our office type to be inOurSite - if (!dataMgr.getOfficeType().equals(gid.getParm().getOfficeType())) { - return false; - } - - if (this.ourSiteMap.isValid(loc.x, loc.y)) { - return this.ourSiteMap.get(loc.x, loc.y); - } else { - return false; - } - - } - @Override public WxValue getDataPoint(GridID gridID, Coordinate worldLoc) throws GFEServerException { @@ -511,7 +493,7 @@ public class ISCDataAccess implements IISCDataAccess { "getCompositeGrid called on non-discrete parm"); slice.setDiscreteGrid(new Grid2DByte()); - slice.setKey(new DiscreteKey[0]); + slice.setKeys(new DiscreteKey[0]); return new Grid2DBit(); } @@ -519,7 +501,7 @@ public class ISCDataAccess implements IISCDataAccess { Grid2DBit ourSiteMask = null; if (primary == null) { slice.setDiscreteGrid(new Grid2DByte(nx, ny)); - slice.setKey(new DiscreteKey[0]); + slice.setKeys(new DiscreteKey[0]); primary = new DiscreteGridData(gid.getParm(), slice); ourSiteMask = new Grid2DBit(nx, ny); } else { @@ -536,7 +518,7 @@ public class ISCDataAccess implements IISCDataAccess { keys[i] = new DiscreteKey(primary.getDiscreteSlice().getKeys()[i]); } - slice.setKey(keys); + slice.setKeys(keys); keys = null; // don't use this copy any more // isc grid @@ -580,7 +562,7 @@ public class ISCDataAccess implements IISCDataAccess { newKeyList[key.getValue().intValue()] = key.getKey(); } - slice.setKey(newKeyList); + slice.setKeys(newKeyList); return siteMask.or(ourSiteMask); } @@ -590,10 +572,6 @@ public class ISCDataAccess implements IISCDataAccess { protected void createSiteMask() { GridLocation gloc = dataMgr.getParmManager().compositeGridLocation(); - // reinitialize data to empty - ourSiteMap = new Grid2DBoolean(gloc.gridSize().x, gloc.gridSize().y); - // siteIdentifiers = new HashMap>(); - siteGridMap = new HashMap>(); // get list of known sites from server -- ignore any errors @@ -624,7 +602,6 @@ public class ISCDataAccess implements IISCDataAccess { // point. Grid2D sites = new Grid2D(gloc.gridSize().x, gloc.gridSize().y); - // List siteIdentifiers = new ArrayList(); for (String iscea : iscEAs) { @@ -642,7 +619,6 @@ public class ISCDataAccess implements IISCDataAccess { Grid2DBit bits = refDat.getGrid(); if (bits.isAnyBitsSet()) { - // siteIdentifiers.add(iscea); for (int y = 0; y < bits.getYdim(); y++) { for (int x = 0; x < bits.getXdim(); x++) { @@ -652,22 +628,9 @@ public class ISCDataAccess implements IISCDataAccess { } } } - - // special mapping for our site map - if (iscea.equals(dataMgr.getSiteID())) { - for (int y = 0; y < bits.getYdim(); y++) { - for (int x = 0; x < bits.getXdim(); x++) { - if (bits.get(x, y) > 0) { - ourSiteMap.set(x, y, true); - } - } - } - } - } // store result in maps - // this.siteIdentifiers.put(officeType, siteIdentifiers); this.siteGridMap.put(officeType, sites); } } diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/grid/Grid2D.java b/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/grid/Grid2D.java index 4740cf71ca..458d7be516 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/grid/Grid2D.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/grid/Grid2D.java @@ -34,6 +34,8 @@ import java.nio.Buffer; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * 5/7/08 875 bphillip Initial Creation. + * Sep 01, 2014 3572 randerso Removed unnecessary @SuppressWarnings + * to eliminate Java Warning * * * @@ -60,7 +62,6 @@ public class Grid2D implements IGrid2D, Cloneable { * @param yDim * The height of the grid */ - @SuppressWarnings("unchecked") public Grid2D(int xDim, int yDim) { this.xDim = xDim; this.yDim = yDim; diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/grid/Grid2DBit.java b/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/grid/Grid2DBit.java index fbb008d033..36206bf66a 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/grid/Grid2DBit.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/grid/Grid2DBit.java @@ -76,6 +76,7 @@ import java.nio.ByteBuffer; * ------------ ---------- ----------- -------------------------- * Jan 29, 2008 879 rbell Initial Creation. * Oct 22, 2008 1624 wdougherty Speed up translate method + * Sep 01, 2014 3572 randerso Added clear(x,y) method * * * @@ -217,6 +218,23 @@ public class Grid2DBit extends Grid2DByte implements Cloneable { buffer.put(yDim * this.xdim + xDim, (byte) 1); } + /** + * + * Sets a bit to 0. + * + * @param xDim + * xDim x coordinate of bit to set + * @param yDim + * yDim y coordinate of bit to set + */ + @Override + public void clear(int xDim, int yDim) { + if (!isValid(xDim, yDim)) { + throw new IllegalArgumentException("Dimensions are invalid"); + } + buffer.put(yDim * this.xdim + xDim, (byte) 0); + } + /** * * Sets all bits to the given value. diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/grid/Grid2DBoolean.java b/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/grid/Grid2DBoolean.java deleted file mode 100644 index 769e32dea0..0000000000 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/grid/Grid2DBoolean.java +++ /dev/null @@ -1,449 +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.dataplugin.gfe.grid; - -import java.awt.Point; -import java.nio.IntBuffer; - -import jep.INumpyable; - -import com.raytheon.uf.common.serialization.ISerializableObject; -import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; - -/** - * Grid2D implementation for the boolean type - * - *
- * 
- * SOFTWARE HISTORY
- * 
- * Date         Ticket#     Engineer    Description
- * ------------ ----------  ----------- --------------------------
- * 07/14/09      1995       bphillip    Initial release
- * 
- * 
- * - * @author bphillip - * @version 1 - */ -public class Grid2DBoolean implements IGrid2D, Cloneable, INumpyable, - ISerializableObject { - - /** - * The data buffer, holding the grid's contents - */ - @DynamicSerializeElement - protected IntBuffer buffer; - - /** - * Width of the grid. - */ - @DynamicSerializeElement - protected int xdim; - - /** - * Height of the grid. - */ - @DynamicSerializeElement - protected int ydim; - - /** - * Constructor for serialization only. - */ - public Grid2DBoolean() { - - } - - /** - * Constructor for creating a two-dimensional grid containing ints. xDim and - * yDim specify the size of the grid. - * - * @param xDim - * @param yDim - */ - public Grid2DBoolean(int xDim, int yDim) { - this(xDim, yDim, IntBuffer.allocate(xDim * yDim)); - } - - /** - * Constructor for creating an initialized two-dimensional grid containing - * ints. - * - * xDim and yDim specify the size of the grid. - * - * aValue is the initial value - * - * @param xDim - * @param yDim - * @param aValue - */ - public Grid2DBoolean(int xDim, int yDim, boolean aValue) { - this(xDim, yDim); - setAllValues(aValue); - } - - /** - * Constructor for creating a two-dimensional grid containing ints. xDim and - * yDim specify the size of the grid. data is an array of initialization - * data. - * - * @param xDim - * @param yDim - * @param data - * array of initialization data - */ - public Grid2DBoolean(int xDim, int yDim, boolean[] data) { - this(xDim, yDim); - if (xDim * yDim != data.length) { - throw new IllegalArgumentException( - "Dimensions do not match data length (" + xDim + "," + yDim - + ") " + data.length); - } - int[] intData = new int[data.length]; - for (int i = 0; i < data.length; i++) { - if (data[i]) { - intData[i] = 1; - } else { - intData[i] = 0; - } - } - this.buffer.put(intData, 0, data.length); - } - - /** - * Constructor for creating a two-dimensional grid containing ints. xDim and - * yDim specify the size of the grid. data is a IntBuffer containing - * initialization data. - * - * @param xDim - * @param yDim - * @param data - * IntBuffer of initialization data - */ - public Grid2DBoolean(int xDim, int yDim, IntBuffer data) { - if (xDim * yDim != data.limit()) { - throw new IllegalArgumentException( - "Dimensions do not match data length (" + xDim + "," + yDim - + ") " + data.limit()); - } - this.xdim = xDim; - this.ydim = yDim; - this.buffer = data; - } - - /** - * - * Copy constructor - * - * @param rhs - * Grid2DBoolean to copy - */ - public Grid2DBoolean(Grid2DBoolean rhs) { - this(rhs.xdim, rhs.ydim); - this.buffer.put(rhs.buffer.array()); - } - - /** - * @param xDim - * x coordinate of boolean to retrieve - * @param yDim - * y coordinate of boolean to retrieve - * @return the retrieved boolean - */ - public boolean get(int xDim, int yDim) { - if (!isValid(xDim, yDim)) { - throw new IllegalArgumentException("Dimensions not valid"); - } - return buffer.get(yDim * this.xdim + xDim) > 0; - } - - /** - * @param xDim - * x coordinate of boolean to set - * @param yDim - * y coordinate of boolean to set - * @param aValue - * value of boolean to set - */ - public void set(int xDim, int yDim, boolean aValue) { - if (!isValid(xDim, yDim)) { - throw new IllegalArgumentException("Dimensions not valid"); - } - if (aValue) { - buffer.put(yDim * this.xdim + xDim, 1); - } else { - buffer.put(yDim * this.xdim + xDim, 0); - } - } - - /** - * - * Sets all booleans to the given value. - * - * @param aValue - * value to set all booleans to. - */ - public void setAllValues(boolean aValue) { - for (int i = 0; i < buffer.limit(); i++) { - if (aValue) { - buffer.put(i, 1); - } else { - buffer.put(i, 0); - } - } - } - - @Override - public boolean isValid() { - return this.xdim > 0; - } - - @Override - public boolean isValid(int x, int y) { - return (x < xdim && y < ydim && x >= 0 && y >= 0); - } - - /** - * The data buffer is cleared. - */ - public void clear() { - for (int i = 0; i < buffer.limit(); i++) { - buffer.put(i, 0); - } - } - - /** - * Set a particular coordinate to 0 - * - * @param x - * x coordinate to clear - * @param y - * y coordinate to clear - */ - public void clear(int x, int y) { - buffer.put(y * xdim + x, 0); - } - - /** - * - * Translates the set booleans in this object by the amount specified in - * deltaCoord and returns a new Grid2DBoolean. - * - * @param deltaCoord - * coordinate representing the translation from each boolean's - * origin - * @return the resulting translation - */ - public Grid2DBoolean translate(Point deltaCoord) { - // make another Grid2DBoolean - Grid2DBoolean rVal = new Grid2DBoolean(this.xdim, this.ydim); - - for (int x = 0; x < this.xdim; x++) { - for (int y = 0; y < this.ydim; y++) { - if (rVal.isValid(x + deltaCoord.x, y + deltaCoord.y)) { - rVal.set(x + deltaCoord.x, y + deltaCoord.y, this.get(x, y)); - } - } - } - - return rVal; - } - - /** - * - * Translates this Grid2DBoolean by the amount specified. Returns a - * reference to this object. - * - * Uses translate() to translate the booleans, and then assigns the result - * to this object using the assignment operator. - * - * @param deltaCoord - * coordinate representing the translation from each boolean's - * origin - * @return this Grid2DBoolean after the translation - */ - public Grid2DBoolean translateMe(Point deltaCoord) { - Grid2DBoolean t = translate(deltaCoord); - this.buffer = t.buffer; - return this; - } - - public IntBuffer getBuffer() { - return buffer; - } - - @Override - public int getXdim() { - return xdim; - } - - @Override - public int getYdim() { - return ydim; - } - - @Override - public Point getGridSize() { - return new Point(xdim, ydim); - } - - @Override - public Grid2DBoolean subGrid(int minX, int minY, int maxX, int maxY) { - Grid2DBoolean rVal = new Grid2DBoolean(maxX + 1 - minX, maxY + 1 - minY); - for (int y = minY; y < maxY + 1; y++) { - for (int x = minX; x < maxX + 1; x++) { - boolean val = this.get(x, y); - if (val) { - rVal.buffer.put(1); - } else { - rVal.buffer.put(0); - } - } - } - return rVal; - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof Grid2DBoolean)) { - return false; - } - - Grid2DBoolean rhs = (Grid2DBoolean) obj; - - if (rhs == this) { - return true; - } - - boolean rVal = true; - - if (this.xdim == rhs.xdim && this.ydim == rhs.ydim) { - for (int i = 0; i < this.buffer.limit(); i++) { - if (this.buffer.get(i) != rhs.buffer.get(i)) { - rVal = false; - break; - } - } - } else { - rVal = false; - } - - return rVal; - } - - @Override - public Grid2DBoolean clone() throws CloneNotSupportedException { - Grid2DBoolean rVal = new Grid2DBoolean(this); - return rVal; - } - - @Override - public void copyWithMask(IGrid2D sourceGrid, Grid2DBit maskGrid) { - if (!(sourceGrid instanceof Grid2DBoolean)) { - throw new IllegalArgumentException( - "The input source grid must be of type Grid2DBoolean"); - } - - Grid2DBoolean sourceGrid2DBoolean = (Grid2DBoolean) sourceGrid; - - if (this.xdim != sourceGrid2DBoolean.xdim || this.xdim != maskGrid.xdim - || this.ydim != sourceGrid2DBoolean.ydim - || this.ydim != maskGrid.ydim) { - throw new IllegalArgumentException( - "This grid, the input grid, and the input mask grid must have equal dimensions"); - } - - for (int i = 0; i < this.buffer.limit(); i++) { - if (maskGrid.buffer.get(i) != 0) { - this.buffer.put(i, sourceGrid2DBoolean.buffer.get(i)); - } - } - } - - public void setAllOfValue(boolean oldValue, boolean newValue) { - for (int i = 0; i < buffer.limit(); i++) { - if ((this.buffer.get(i) > 0 && oldValue) - || (this.buffer.get(i) == 0 && !oldValue)) { - if (newValue) { - this.buffer.put(i, 1); - } else { - this.buffer.put(i, 0); - } - } - } - } - - @Override - public String toString() { - String rVal = ""; - - rVal += xdim + "X" + ydim + "\n[\n"; - for (int y = 0; y < ydim; y++) { - for (int x = 0; x < xdim; x++) { - rVal += this.get(x, y) + (x + 1 == xdim ? "" : ","); - } - rVal += "\n"; - } - rVal += "]"; - - return rVal; - } - - @Override - public Object[] getNumpy() { - return new Object[] { buffer.array() }; - } - - @Override - public int getNumpyX() { - return xdim; - } - - @Override - public int getNumpyY() { - return ydim; - } - - /** - * @param dim - * the xDim to set - */ - public void setXdim(int dim) { - xdim = dim; - } - - /** - * @param dim - * the yDim to set - */ - public void setYdim(int dim) { - ydim = dim; - } - - /** - * @param buffer - * the buffer to set - */ - public void setBuffer(IntBuffer buffer) { - this.buffer = buffer; - } - -} diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/grid/Grid2DByte.java b/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/grid/Grid2DByte.java index bc563797e6..7c70f5f2eb 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/grid/Grid2DByte.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/grid/Grid2DByte.java @@ -26,7 +26,6 @@ import java.util.Arrays; import jep.INumpyable; -import com.raytheon.uf.common.serialization.ISerializableObject; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; import com.vividsolutions.jts.geom.Coordinate; @@ -41,6 +40,7 @@ import com.vividsolutions.jts.geom.Coordinate; * ------------ ---------- ----------- -------------------------- * Jan 30, 2008 879 rbell Initial Creation. * Oct 22, 2008 1624 wdougherty Speed up translate method + * Sep 01, 2014 3572 randerso Changed getNumpy to use getBytes() * * * @@ -48,8 +48,7 @@ import com.vividsolutions.jts.geom.Coordinate; * @version 1.0 */ @DynamicSerialize -public class Grid2DByte implements IGrid2D, Cloneable, INumpyable, - ISerializableObject { +public class Grid2DByte implements IGrid2D, Cloneable, INumpyable { /** * The data buffer, holding the grid's contents @@ -311,14 +310,17 @@ public class Grid2DByte implements IGrid2D, Cloneable, INumpyable, return buffer; } + @Override public int getXdim() { return xdim; } + @Override public int getYdim() { return ydim; } + @Override public Point getGridSize() { return new Point(xdim, ydim); } @@ -415,7 +417,7 @@ public class Grid2DByte implements IGrid2D, Cloneable, INumpyable, @Override public Object[] getNumpy() { - return new Object[] { buffer.array() }; + return new Object[] { getBytes() }; } @Override diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/grid/Grid2DFloat.java b/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/grid/Grid2DFloat.java index 29d3015818..6ff763f712 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/grid/Grid2DFloat.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/grid/Grid2DFloat.java @@ -25,7 +25,6 @@ import java.nio.FloatBuffer; import jep.INumpyable; -import com.raytheon.uf.common.serialization.ISerializableObject; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -38,6 +37,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Jan 30, 2008 879 rbell Initial Creation. + * Sep 01, 2014 3572 randerso Changed getNumpy to use getFloats() * * * @@ -45,8 +45,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * @version 1.0 */ @DynamicSerialize -public class Grid2DFloat implements IGrid2D, Cloneable, INumpyable, - ISerializableObject { +public class Grid2DFloat implements IGrid2D, Cloneable, INumpyable { /** * The data buffer, holding the grid's contents @@ -321,14 +320,17 @@ public class Grid2DFloat implements IGrid2D, Cloneable, INumpyable, this.buffer.put(other.getBuffer()); } + @Override public int getXdim() { return xdim; } + @Override public int getYdim() { return ydim; } + @Override public Point getGridSize() { return new Point(xdim, ydim); } @@ -426,7 +428,7 @@ public class Grid2DFloat implements IGrid2D, Cloneable, INumpyable, @Override public Object[] getNumpy() { - return new Object[] { buffer.array() }; + return new Object[] { getFloats() }; } @Override From 2374673f8d7f3bb3b78a104e1031429da4a9ad84 Mon Sep 17 00:00:00 2001 From: "Qinglu.Lin" Date: Tue, 2 Sep 2014 14:33:11 -0400 Subject: [PATCH 20/25] ASM #15551 - WarnGen: only WCN should be used while including TOR/SVR watches in WarnGen products Change-Id: I286bc4cc809fcc9257f72051f1bb74f8acc24c05 Former-commit-id: 59890eef397f3282ef26f259ca85ffea3db7b710 --- .../raytheon/viz/warngen/gis/WatchUtil.java | 22 ++++ .../viz/warngen/template/TemplateRunner.java | 34 +++++- .../base/warngen/VM_global_library.vm | 115 ++++++++---------- 3 files changed, 108 insertions(+), 63 deletions(-) diff --git a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gis/WatchUtil.java b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gis/WatchUtil.java index 59b08b19cc..2e737b386a 100644 --- a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gis/WatchUtil.java +++ b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gis/WatchUtil.java @@ -76,6 +76,7 @@ import com.vividsolutions.jts.geom.Polygon; * Jul 17, 2014 3419 jsanchez Initial creation * Aug 20, 2014 ASM #16703 D. Friedman Ensure watches have a state attribute. * Aug 28, 2014 ASM #15658 D. Friedman Add marine zones. + * Aug 29, 2014 ASM #15551 Qinglu Lin Sorting watches by ETN in processRecords(). * * * @@ -409,6 +410,8 @@ public class WatchUtil { watches.add(watch); } + // keep the code for their use in the future + /* // Sorts the watches based on state name. Collections.sort(watches, new Comparator() { @@ -426,6 +429,25 @@ public class WatchUtil { return state1.compareTo(state2); } }); + */ + + // Sorts the watches based on ETN. + Collections.sort(watches, new Comparator() { + + @Override + public int compare(Watch watch1, Watch watch2) { + String etn1 = watch1.getEtn(); + String etn2 = watch2.getEtn(); + if (etn1 == etn2) + return 0; + else if (etn1 == null) + return 1; + else if (etn2 == null) + return -1; + else + return etn1.compareTo(etn2); + } + }); return watches; } diff --git a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/template/TemplateRunner.java b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/template/TemplateRunner.java index 069853bc96..9373221c0b 100644 --- a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/template/TemplateRunner.java +++ b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/template/TemplateRunner.java @@ -141,6 +141,8 @@ import com.vividsolutions.jts.io.WKTReader; * added determineAffectedMarinePortions(). * Jul 21, 2014 3419 jsanchez Refactored WatchUtil. * Aug 15, 2014 DR15701 mgamazaychikov Removed static field watchUtil. + * Aug 28, 2014 ASM #15551 Qinglu Lin Replaced 1200 PM/1200 AM by NOON/MIDNIGHT, removed days in + * included tornado/severe thunderstorm watch message. * * * @author njensen @@ -872,7 +874,37 @@ public class TemplateRunner { System.out.println("velocity time: " + (System.currentTimeMillis() - tz0)); - String text = script.toString(); + String watches[] = {"TORNADO WATCH", "SEVERE THUNDERSTORM WATCH"}; + int index1 = -1, index2 = -1, index1ToUse = -1; + String doubleDollar = "$$"; + boolean firstTime = true; + for (String s: watches) { + index1 = script.indexOf(s, 0); + if (index1 > 0) { + index2 = script.indexOf(doubleDollar, index1); + } + if (firstTime && index1 > -1) { + index1ToUse = index1; + firstTime = false; + } + } + String days[] = {"SUNDAY", "MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY"}; + String substring = "", text; + if (index1ToUse > -1 && index2 > -1) { + substring = script.substring(index1ToUse, index2).toUpperCase(); + // remove day + for (String day: days) { + substring = substring.replaceAll(day + " ", ""); + } + // replace 1200 PM/1200 AM with NOON/MIDNIGHT + substring = substring.replaceAll("1200 PM", "NOON"); + substring = substring.replaceAll("1200 AM", "MIDNIGHT"); + // concatenate strings + text = script.substring(0, index1ToUse - 1); + text = text + " " + substring + script.substring(index2, script.length()); + } else { + text = script.toString(); + } WarningTextHandler handler = WarningTextHandlerFactory.getHandler( selectedAction, text, config.getAutoLockText()); String handledText = handler.handle(text, areas, cancelareas, diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/VM_global_library.vm b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/VM_global_library.vm index 135c9cb058..baed0cfbbd 100755 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/VM_global_library.vm +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/VM_global_library.vm @@ -13,6 +13,7 @@ ##### Qinglu Lin 03-17-2014 DR 16309. Updated inserttorwatches and insertsvrwatches. ##### Qinglu Lin 05-21-2014 DR 16309. Updated inserttorwatches and insertsvrwatches by changing 'FOR##' to 'FOR ##'. ##### D. Friedman 08-28-2014 ASM #15658. Add marine watch wording. +##### Qinglu Lin 08-29-2014 ASM #15551. Overhauled inserttorwatches and insertsvrwatches. #################################################################################################### #* Mile Marker Test Code @@ -190,102 +191,92 @@ ${drainage.name}## ########END MACRO #macro(inserttorwatches $watches $list $secondtimezone $dateUtil $timeFormat) -#set($keys = []) -#set($mymap = {}) +#set($tornadoWatches = []) +#set($ALSO = "") + #foreach(${watch} in ${watches}) #if(${watch.getPhenSig()} == 'TO.A') -#set($key = ${watch.action} + ${watch.etn} + ${watch.startTime} + ${watch.endTime}) -#if (${list.contains(${keys}, $key)}) -#set($value = ${mymap.get($key)}) +#set($success = $tornadoWatches.add($watch)) +#end +#end + +#set($lastEtn = "") +#set($lastEndTime = "") +#foreach(${watch} in ${tornadoWatches}) +#if($lastEtn != "" && ${watch.etn} != ${lastEtn}) +. ## +#end +#set($endTime = ${watch.endTime}) +#if(${watch.etn} == ${lastEtn}) +#if(${endTime} == ${lastEndTime}) +...## #else -#set($value = []) -#set($success = $keys.add($key)) +...UNTIL ${dateUtil.format(${endTime}, ${timeFormat.plain}, 15, ${localtimezone})} FOR ## #end -#set($success = $value.add($watch)) -#set($success = ${mymap.put($key,$value)}) +#else +A TORNADO WATCH${ALSO} REMAINS IN EFFECT UNTIL ${dateUtil.format(${endTime}, ${timeFormat.plain}, 15, ${localtimezone})} FOR ## +#set($ALSO = " ALSO") #end -#end -#set($torWatchAlso = "") -#foreach(${key} in ${keys}) -#set($tornadoWatches = ${mymap.get($key)}) -#set($tornadoWatch = ${tornadoWatches.get(0)}) -A TORNADO WATCH ${torWatchAlso}REMAINS IN EFFECT UNTIL ${dateUtil.format(${tornadoWatch.endTime}, ${timeFormat.plain}, 15, ${localtimezone})}## -${dateUtil.period(${tornadoWatch.endTime},${timeFormat.plain}, 15, ${localtimezone})}## #if(${secondtimezone}) /${dateUtil.format(${watch.getEndTime()}, ${timeFormat.plain}, 15, ${secondtimezone})}/## #end - FOR ## -#set($numPortions = ${list.size(${tornadoWatches})}) -#set($count = 0) -#foreach(${watch} in ${tornadoWatches}) -#set($count = $count + 1) #if(!${watch.marineAreas}) #areaFormat(${watch.partOfState} true false true)${watch.state}## #else #formatMarineAreas(${watch.marineAreas}) #end -#if($count == $numPortions - 1) - AND ## -#elseif($count < $numPortions) -...## +#set($lastEtn = ${watch.etn}) +#set($lastEndTime = ${watch.endTime}) #end +#if(${lastEtn} != "") +. #end -#set($torWatchAlso = "ALSO ") -. ## -#end - - #end ########END MACRO #macro(insertsvrwatches $watches $list $secondtimezone $dateUtil $timeFormat) -#set($keys = []) -#set($mymap = {}) +#set($svrWatches = []) +#set($ALSO = "") + #foreach(${watch} in ${watches}) #if(${watch.getPhenSig()} == 'SV.A') -#set($key = ${watch.action} + ${watch.etn} + ${watch.startTime} + ${watch.endTime}) -#if (${list.contains(${keys}, $key)}) -#set($value = ${mymap.get($key)}) +#set($success = $svrWatches.add($watch)) +#end +#end + +#set($lastEtn = "") +#set($lastEndTime = "") +#foreach(${watch} in ${svrWatches}) +#if($lastEtn != "" && ${watch.etn} != ${lastEtn}) +. ## +#end +#set($endTime = ${watch.endTime}) +#if(${watch.etn} == ${lastEtn}) +#if(${endTime} == ${lastEndTime}) +...## #else -#set($value = []) -#set($success = $keys.add($key)) +...UNTIL ${dateUtil.format(${endTime}, ${timeFormat.plain}, 15, ${localtimezone})} FOR ## #end -#set($success = $value.add($watch)) -#set($success = ${mymap.put($key,$value)}) +#else +A SEVERE THUNDERSTORM WATCH${ALSO} REMAINS IN EFFECT UNTIL ${dateUtil.format(${endTime}, ${timeFormat.plain}, 15, ${localtimezone})} FOR ## +#set($ALSO = " ALSO") #end -#end -#set($svrWatchAlso = "") -#foreach(${key} in ${keys}) -#set($severeWatches = ${mymap.get($key)}) -#set($svrWatch = ${severeWatches.get(0)}) -A SEVERE THUNDERSTORM WATCH ${svrWatchAlso}REMAINS IN EFFECT UNTIL ${dateUtil.format(${svrWatch.endTime}, ${timeFormat.plain}, 15, ${localtimezone})}## -${dateUtil.period(${svrWatch.endTime},${timeFormat.plain}, 15, ${localtimezone})}## #if(${secondtimezone}) /${dateUtil.format(${watch.getEndTime()}, ${timeFormat.plain}, 15, ${secondtimezone})}/## #end - FOR ## -#set($numPortions = ${list.size(${severeWatches})}) -#set($count = 0) -#foreach(${watch} in ${severeWatches}) -#set($count = $count + 1) #if(!${watch.marineAreas}) #areaFormat(${watch.partOfState} true false true)${watch.state}## #else #formatMarineAreas(${watch.marineAreas}) #end -#if($count == $numPortions - 1) - AND ## -#elseif($count < $numPortions) -...## +#set($lastEtn = ${watch.etn}) +#set($lastEndTime = ${watch.endTime}) +#end +#if(${lastEtn} != "") +. #end #end -#set($svrWatchAlso = "ALSO ") -. ## -#end - - -#end -########END +########END MACRO #macro(formatMarineAreas $marineAreas) #set($macount = 0) From 7265bf54c78c71561a1f027c1a5dba1fd7fe4f10 Mon Sep 17 00:00:00 2001 From: Benjamin Phillippe Date: Tue, 2 Sep 2014 10:22:59 -0500 Subject: [PATCH 21/25] Issue #3560 Registry objects not re-sent after fully sync Change-Id: Id38989cf953aacb985d627422c043f8768df2ed0 Former-commit-id: 15e57fc58bee1045c5574e4d66a727a672ac83cb --- .../registry/web/IRegistryFederationManager.java | 6 ++++++ .../registry/dao/ReplicationEventDao.java | 16 +++++++++++++--- .../federation/RegistryFederationManager.java | 16 +++++++++++++++- 3 files changed, 34 insertions(+), 4 deletions(-) diff --git a/edexOsgi/com.raytheon.uf.common.datadelivery.registry/src/com/raytheon/uf/common/datadelivery/registry/web/IRegistryFederationManager.java b/edexOsgi/com.raytheon.uf.common.datadelivery.registry/src/com/raytheon/uf/common/datadelivery/registry/web/IRegistryFederationManager.java index 460c40fe65..29ba1ad3c3 100644 --- a/edexOsgi/com.raytheon.uf.common.datadelivery.registry/src/com/raytheon/uf/common/datadelivery/registry/web/IRegistryFederationManager.java +++ b/edexOsgi/com.raytheon.uf.common.datadelivery.registry/src/com/raytheon/uf/common/datadelivery/registry/web/IRegistryFederationManager.java @@ -36,6 +36,7 @@ import javax.ws.rs.PathParam; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * 2/27/2014 2769 bphillip Initial Creation + * 8/27/2014 3560 bphillip Added updateRegistryEvents method * * * @author bphillip @@ -105,5 +106,10 @@ public interface IRegistryFederationManager { @Path("synchronizeWithRegistry/{registryId}") public void synchronizeWithRegistry( @PathParam("registryId") String registryId) throws Exception; + + @GET + @Path("updateRegistryEvents/{registryId}/{time}") + public void updateRegistryEvents( + @PathParam("registryId") String registryId, @PathParam("time") String time); } diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery.registry/src/com/raytheon/uf/edex/datadelivery/registry/dao/ReplicationEventDao.java b/edexOsgi/com.raytheon.uf.edex.datadelivery.registry/src/com/raytheon/uf/edex/datadelivery/registry/dao/ReplicationEventDao.java index 05e5bfab7e..2d8d1f3b26 100644 --- a/edexOsgi/com.raytheon.uf.edex.datadelivery.registry/src/com/raytheon/uf/edex/datadelivery/registry/dao/ReplicationEventDao.java +++ b/edexOsgi/com.raytheon.uf.edex.datadelivery.registry/src/com/raytheon/uf/edex/datadelivery/registry/dao/ReplicationEventDao.java @@ -37,6 +37,7 @@ import com.raytheon.uf.edex.datadelivery.registry.federation.ReplicationEvent; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * 2/19/2014 2769 bphillip Initial Creation + * 8/27/2014 3560 bphillip Added query by event time method * * * @author bphillip @@ -45,7 +46,12 @@ import com.raytheon.uf.edex.datadelivery.registry.federation.ReplicationEvent; public class ReplicationEventDao extends SessionManagedDao { - private static final String GET_REPLICATION_EVENT_QUERY = "from ReplicationEvent event where (event.source is null or event.source != '%s') and (event.replicatedTo is null or event.replicatedTo not like '%%%s%%') order by event.eventTime asc"; + private static final String GET_REPLICATION_EVENT_QUERY = "from ReplicationEvent event " + + "where (event.source is null or event.source != :source) " + + "and (event.replicatedTo is null or event.replicatedTo not like :registry) " + + "order by event.eventTime asc"; + + private static final String GET_EVENTS_BY_TIME = "from ReplicationEvent event where event.eventTime < :eventTime"; @Override protected Class getEntityClass() { @@ -54,7 +60,11 @@ public class ReplicationEventDao extends @Transactional(propagation = Propagation.MANDATORY, readOnly = true) public List getReplicationEvents(String remoteRegistry, int batchSize) { - return this.executeHQLQuery(String.format(GET_REPLICATION_EVENT_QUERY, - remoteRegistry, remoteRegistry),batchSize); + return this.executeHQLQuery(GET_REPLICATION_EVENT_QUERY,batchSize, + "source", remoteRegistry, "registry", "%"+remoteRegistry+"%"); + } + + public List getEventsBeforeTime(String time){ + return this.executeHQLQuery(GET_EVENTS_BY_TIME, "eventTime", time); } } diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery.registry/src/com/raytheon/uf/edex/datadelivery/registry/federation/RegistryFederationManager.java b/edexOsgi/com.raytheon.uf.edex.datadelivery.registry/src/com/raytheon/uf/edex/datadelivery/registry/federation/RegistryFederationManager.java index 1e3fe9ca8a..d95d2b0309 100644 --- a/edexOsgi/com.raytheon.uf.edex.datadelivery.registry/src/com/raytheon/uf/edex/datadelivery/registry/federation/RegistryFederationManager.java +++ b/edexOsgi/com.raytheon.uf.edex.datadelivery.registry/src/com/raytheon/uf/edex/datadelivery/registry/federation/RegistryFederationManager.java @@ -93,6 +93,7 @@ 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.common.util.ClusterIdUtil; import com.raytheon.uf.common.util.CollectionUtil; import com.raytheon.uf.common.util.StringUtil; import com.raytheon.uf.edex.core.EDEXUtil; @@ -156,6 +157,7 @@ import com.raytheon.uf.edex.registry.events.CreateAuditTrailEvent; * 2/13/2014 2769 bphillip Refactored registry sync. Created quartz tasks to monitor registry uptime as well as subscription integrity * 4/11/2014 3011 bphillip Removed automatic registry sync check on startup * 4/15/2014 3012 dhladky Merge fixes. + * 8/27/2014 3560 bphillip Added updateRegistryEvents method * * * @author bphillip @@ -535,6 +537,16 @@ public class RegistryFederationManager implements IRegistryFederationManager, } } + + @Transactional + @GET + @Path("updateRegistryEvents/{registryId}/{time}") + public void updateRegistryEvents(@PathParam("registryId") String registryId, @PathParam("time") String time) { + for(ReplicationEvent event: replicationEventDao.getEventsBeforeTime(time)){ + event.addReplicatedTo(registryId); + replicationEventDao.update(event); + } + } /** * Synchronizes this registry's data with the registry at the specified URL @@ -581,6 +593,9 @@ public class RegistryFederationManager implements IRegistryFederationManager, } federatedRegistryMonitor.updateTime(); StringBuilder syncMsg = new StringBuilder(); + + // Update the registry events table on the remote registry so duplicate data is not sent again + dataDeliveryRestClient.getRegistryFederationManager(remoteRegistryUrl).updateRegistryEvents(ClusterIdUtil.getId(), String.valueOf(start)); syncMsg.append("Registry synchronization using [") .append(remoteRegistryUrl) @@ -1256,5 +1271,4 @@ public class RegistryFederationManager implements IRegistryFederationManager, public NotificationServers getServers() { return servers; } - } From 121a2d100f56b3b6fb3e5aa14e8bfa45321c60a2 Mon Sep 17 00:00:00 2001 From: "Brian.Dyke" Date: Wed, 3 Sep 2014 21:10:16 -0400 Subject: [PATCH 22/25] ASM #15697 - Fix Hydro Perspective Issue Former-commit-id: 82d7bbe6bf005e543e1ad6772c6a18024f1b0764 --- .../edex/plugin/shef/database/PostShef.java | 34 +++---- .../edex/plugin/shef/database/PostTables.java | 90 ++++++------------- 2 files changed, 44 insertions(+), 80 deletions(-) diff --git a/edexOsgi/com.raytheon.edex.plugin.shef/src/com/raytheon/edex/plugin/shef/database/PostShef.java b/edexOsgi/com.raytheon.edex.plugin.shef/src/com/raytheon/edex/plugin/shef/database/PostShef.java index 2d58dd79d6..7e5eabec05 100644 --- a/edexOsgi/com.raytheon.edex.plugin.shef/src/com/raytheon/edex/plugin/shef/database/PostShef.java +++ b/edexOsgi/com.raytheon.edex.plugin.shef/src/com/raytheon/edex/plugin/shef/database/PostShef.java @@ -126,6 +126,7 @@ import com.raytheon.uf.edex.decodertools.time.TimeTools; * 07/10/2014 3370 mpduff Fix update/insert issue for riverstatus * 07/14/2014 mpduff Fix data range checks * 08/05/2014 15671 snaples Fixed check for posting when not found in ingestfilter and token is set for load_shef_ingest + * 09/03/2014 mpduff Fixed river status table updates. * * * @author mduff @@ -1054,24 +1055,24 @@ public class PostShef { + "] to commentValue table"); } } - - /* - * if we just received some forecast height or discharge data, - * then update the riverstatus table for those reports - */ - if ((DataType.FORECAST.equals(dataType)) - && loadMaxFcst - && (data.getPhysicalElement().getCode().startsWith("H") || data - .getPhysicalElement().getCode().startsWith("Q"))) { - postRiverStatus(data, locId); - if (!same_lid_product) { - log.info("Update RiverStatus for: " + locId + " " + pe); - } - } } // for postTables.executeBatchUpdates(); - } catch (Exception e) { + + if (!dataValues.isEmpty()) { + ShefData data = dataValues.get(0); + DataType dataType = ParameterCode.DataType.getDataType( + data.getTypeSource(), procObs); + if ((DataType.FORECAST.equals(dataType)) + && loadMaxFcst + && (data.getPhysicalElement().getCode().startsWith("H") || data + .getPhysicalElement().getCode().startsWith("Q"))) { + postRiverStatus(data, locId); + log.info("Update RiverStatus for: " + locId + " " + + data.getPhysicalElement().getCode()); + } + } + } catch (Exception e) { log.error("An error occurred posting shef data.", e); } @@ -1675,7 +1676,8 @@ public class PostShef { private void convertDur(short dur, ShefData data) { String value = null; String durationCode = null; - value = DURATION_MAP.get(dur); + Integer durInt = new Integer(dur); + value = DURATION_MAP.get(durInt); if (value == null) { // Anything not in the DURATION_MAP is // probably a variable duration. diff --git a/edexOsgi/com.raytheon.edex.plugin.shef/src/com/raytheon/edex/plugin/shef/database/PostTables.java b/edexOsgi/com.raytheon.edex.plugin.shef/src/com/raytheon/edex/plugin/shef/database/PostTables.java index 722399b77a..b457660cff 100644 --- a/edexOsgi/com.raytheon.edex.plugin.shef/src/com/raytheon/edex/plugin/shef/database/PostTables.java +++ b/edexOsgi/com.raytheon.edex.plugin.shef/src/com/raytheon/edex/plugin/shef/database/PostTables.java @@ -86,6 +86,7 @@ import com.raytheon.uf.edex.database.dao.DaoConfig; * 09/19/2013 16515 w. Kwock Fix the excessive digits in rawpp,lake,height...tables * 04/29/2014 3088 mpduff Change logging class, clean up/optimization. * More performance fixes. + * 09/03/2014 mpduff postRiverStatus() writes directly, not via batch * * * @@ -123,10 +124,6 @@ public class PostTables { private Map statementMap = new HashMap(); - private PreparedStatement riverStatusUpdateStatement = null; - - private PreparedStatement riverStatusInsertStatement = null; - static { gagePPSetup(); } @@ -1222,10 +1219,11 @@ public class PostTables { String ts = null; float probability = -9999; int status = -1; - + PreparedStatement ps = null; + try { conn = getConnection(); - PreparedStatement ps = getRiverStatusPreparedStatement(updateFlag); + ps = getRiverStatusPreparedStatement(updateFlag); lid = shefDataValue.getLocationId(); ps.setString(1, lid); @@ -1258,7 +1256,6 @@ public class PostTables { timeStamp2 = new java.sql.Timestamp(basisDate.getTime()); ps.setTimestamp(8, timeStamp2); - // ps.setFloat(9, Float.parseFloat(shefDataValue.getStringValue())); ps.setDouble(9, shefDataValue.getValue().floatValue()); if (updateFlag) { @@ -1266,7 +1263,8 @@ public class PostTables { ps.setString(11, pe); ps.setString(12, ts); } - ps.addBatch(); + ps.execute(); + conn.commit(); } catch (Exception e) { if (updateFlag) { log.error(String.format( @@ -1276,26 +1274,32 @@ public class PostTables { "Error inserting into RiverStatus with [%s]", record), e); } - } + } finally { + if (ps != null) { + try { + ps.close(); + } catch (SQLException e) { + log.error( + "Error closing prepared statement for RiverStatus", + e); + } + } + } return status; } private PreparedStatement getRiverStatusPreparedStatement(boolean updateFlag) throws SQLException { - if (updateFlag) { - if (riverStatusUpdateStatement == null) { - riverStatusUpdateStatement = conn - .prepareCall(RIVER_STATUS_UPDATE_STATEMENT); - } - return riverStatusUpdateStatement; - } else { - if (riverStatusInsertStatement == null) { - riverStatusInsertStatement = conn - .prepareCall(RIVER_STATUS_INSERT_STATEMENT); - } - return riverStatusInsertStatement; - } + if (updateFlag) { + PreparedStatement riverStatusUpdateStatement = conn + .prepareCall(RIVER_STATUS_UPDATE_STATEMENT); + return riverStatusUpdateStatement; + } else { + PreparedStatement riverStatusInsertStatement = conn + .prepareCall(RIVER_STATUS_INSERT_STATEMENT); + return riverStatusInsertStatement; + } } private Connection getConnection() { @@ -1314,26 +1318,6 @@ public class PostTables { * Close the connections and statements */ public void close() { - if (riverStatusInsertStatement != null) { - try { - riverStatusInsertStatement.close(); - } catch (SQLException e) { - log.error( - "Error closing river status insert prepared statement", - e); - } - } - - if (riverStatusUpdateStatement != null) { - try { - riverStatusUpdateStatement.close(); - } catch (SQLException e) { - log.error( - "Error closing river status update prepared statement", - e); - } - } - for (String functionName : statementMap.keySet()) { CallableStatement cs = statementMap.get(functionName); try { @@ -1356,28 +1340,6 @@ public class PostTables { * */ public void executeBatchUpdates() { - try { - if (riverStatusUpdateStatement != null) { - riverStatusUpdateStatement.execute(); - conn.commit(); - riverStatusUpdateStatement.close(); - riverStatusUpdateStatement = null; - } - } catch (SQLException e) { - log.error("An error occurred storing river status updates", e); - } - - try { - if (riverStatusInsertStatement != null) { - riverStatusInsertStatement.execute(); - conn.commit(); - riverStatusInsertStatement.close(); - riverStatusInsertStatement = null; - } - } catch (SQLException e) { - log.error("An error occurred inserting river status values", e); - } - for (String key : statementMap.keySet()) { CallableStatement cs = statementMap.get(key); try { From 2cfbfc1dc46491711ee795d74e54971216fdee06 Mon Sep 17 00:00:00 2001 From: Nate Jensen Date: Wed, 3 Sep 2014 17:10:08 -0500 Subject: [PATCH 23/25] Issue #3574 Properly dispose radar graphics graphics objects. Change-Id: Ica8c630325bada6fd508eeb6b1b4d881a5169320 Former-commit-id: 78172a4ac0b9ece26cdc07da3a8f9a70bbc11782 --- .../rsc/graphic/RadarGraphicsDisplay.java | 93 ++++++++++++------- .../radar/rsc/graphic/RadarGraphicsPage.java | 16 ++++ 2 files changed, 74 insertions(+), 35 deletions(-) diff --git a/cave/com.raytheon.viz.radar/src/com/raytheon/viz/radar/rsc/graphic/RadarGraphicsDisplay.java b/cave/com.raytheon.viz.radar/src/com/raytheon/viz/radar/rsc/graphic/RadarGraphicsDisplay.java index 069615f012..11809b4597 100644 --- a/cave/com.raytheon.viz.radar/src/com/raytheon/viz/radar/rsc/graphic/RadarGraphicsDisplay.java +++ b/cave/com.raytheon.viz.radar/src/com/raytheon/viz/radar/rsc/graphic/RadarGraphicsDisplay.java @@ -37,7 +37,6 @@ import org.opengis.referencing.crs.ProjectedCRS; import com.raytheon.uf.common.dataplugin.radar.RadarDataKey; import com.raytheon.uf.common.dataplugin.radar.RadarDataPoint; -import com.raytheon.uf.common.dataplugin.radar.RadarDataPoint.RadarProductType; import com.raytheon.uf.common.dataplugin.radar.RadarRecord; import com.raytheon.uf.common.dataplugin.radar.level3.GraphicBlock; import com.raytheon.uf.common.dataplugin.radar.level3.Layer; @@ -70,6 +69,7 @@ import com.vividsolutions.jts.geom.Coordinate; * ------------ ---------- ----------- -------------------------- * Jan 13, 2009 chammack Initial creation * 03/04/2013 DCS51 zwang Handle GFM product + * Sep 03, 2014 3574 njensen Properly dispose objects * * * @@ -79,11 +79,11 @@ import com.vividsolutions.jts.geom.Coordinate; public class RadarGraphicsDisplay implements IRenderable { - private Map pageMap; + private final Map pageMap; - private ArrayList symbologyPages; + private final ArrayList symbologyPages; - private Map symbologyData; + private final Map symbologyData; private int currentPage; @@ -108,9 +108,9 @@ public class RadarGraphicsDisplay implements IRenderable { this.currentPage = 0; // Only retrieve if this record has not been retrieved. - if ((radarRecord.getSymbologyData() == null || radarRecord + if (((radarRecord.getSymbologyData() == null) || radarRecord .getSymbologyData().isEmpty()) - && radarRecord.getGraphicBlock() == null) { + && (radarRecord.getGraphicBlock() == null)) { File loc = HDF5Util.findHDF5Location(radarRecord); IDataStore dataStore = DataStoreFactory.getDataStore(loc); @@ -135,9 +135,10 @@ public class RadarGraphicsDisplay implements IRenderable { new GeneralGridEnvelope(new int[] { 0, 0 }, new int[] { 4096, 4096 }, false), generalEnvelope); IWireframeShape ws = target.createWireframeShape(true, mapDescriptor); - + // Used for GFM forecast positions - IWireframeShape gfmWs = target.createWireframeShape(true, mapDescriptor); + IWireframeShape gfmWs = target + .createWireframeShape(true, mapDescriptor); symbologyData = radarRecord.getSymbologyData(); if (symbologyData != null) { @@ -162,8 +163,8 @@ public class RadarGraphicsDisplay implements IRenderable { // logic in createSymbologyImages() rgp.addImages(currStorm, CoordinateSystem.LOCAL); - //Handle DMD table data - if (radarRecord.getProductCode() == 149) { + // Handle DMD table data + if (radarRecord.getProductCode() == 149) { // Handle the tabular display data in the Generic Packet String data = GraphicDataUtil.getDMDGraphicDataValue( tableModifier, radarRecord, @@ -175,7 +176,7 @@ public class RadarGraphicsDisplay implements IRenderable { addTableRow(tableData, featureData); processTableData = true; } - + } } @@ -211,7 +212,7 @@ public class RadarGraphicsDisplay implements IRenderable { } // handle GFM product else { - this.currentPage = pageNum; + this.currentPage = pageNum; RadarGraphicsPage gab = this.pageMap.get(pageNum); if (gab == null) { @@ -223,7 +224,7 @@ public class RadarGraphicsDisplay implements IRenderable { this.currentPage = 0; } - + // Graphic block is organized into pages for display. The data for each // page is contained in packets. GraphicBlock gb = radarRecord.getGraphicBlock(); @@ -249,7 +250,8 @@ public class RadarGraphicsDisplay implements IRenderable { } } - if ((symbologyData == null || symbologyData.isEmpty()) && gb == null) { + if (((symbologyData == null) || symbologyData.isEmpty()) + && (gb == null)) { String nullLegend = null; switch (radarRecord.getProductCode()) { case 139: @@ -295,7 +297,7 @@ public class RadarGraphicsDisplay implements IRenderable { String[] values = sortValues.trim().split("\\s+"); - if (values.length > 0 && values[0].length() > 1) { + if ((values.length > 0) && (values[0].length() > 1)) { try { strengthRank = Integer.parseInt(values[0].substring(1, values[0].length())); @@ -340,11 +342,15 @@ public class RadarGraphicsDisplay implements IRenderable { } public void setMagnification(double magnification) { - for (RadarGraphicsPage page : symbologyPages) { - page.setMagnification(magnification); + synchronized (symbologyPages) { + for (RadarGraphicsPage page : symbologyPages) { + page.setMagnification(magnification); + } } - for (RadarGraphicsPage page : pageMap.values()) { - page.setMagnification(magnification); + synchronized (pageMap) { + for (RadarGraphicsPage page : pageMap.values()) { + page.setMagnification(magnification); + } } } @@ -358,32 +364,49 @@ public class RadarGraphicsDisplay implements IRenderable { @Override public void paint(IGraphicsTarget target, PaintProperties paintProps) throws VizException { - if (currentPage < 0 || currentPage >= this.pageMap.size()) { - return; - } - - RadarGraphicsPage page = pageMap.get(currentPage); - if (page == null) { - return; - } - page.paint(target, paintProps); - - for (RadarGraphicsPage currPage : symbologyPages) { - if (currPage == null) { + synchronized (pageMap) { + if ((currentPage < 0) || (currentPage >= this.pageMap.size())) { return; } - currPage.paint(target, paintProps); + RadarGraphicsPage page = pageMap.get(currentPage); + if (page == null) { + return; + } + + page.paint(target, paintProps); + } + + synchronized (symbologyPages) { + for (RadarGraphicsPage currPage : symbologyPages) { + if (currPage == null) { + return; + } + + currPage.paint(target, paintProps); + } } } public int getNumPages() { - return this.pageMap.size() > 0 ? this.pageMap.size() : 1; + synchronized (pageMap) { + return this.pageMap.size() > 0 ? this.pageMap.size() : 1; + } } public void dispose() { - for (RadarGraphicsPage page : pageMap.values()) { - page.dispose(); + synchronized (pageMap) { + for (RadarGraphicsPage page : pageMap.values()) { + page.dispose(); + } + pageMap.clear(); + } + + synchronized (symbologyPages) { + for (RadarGraphicsPage page : symbologyPages) { + page.dispose(); + } + symbologyPages.clear(); } } diff --git a/cave/com.raytheon.viz.radar/src/com/raytheon/viz/radar/rsc/graphic/RadarGraphicsPage.java b/cave/com.raytheon.viz.radar/src/com/raytheon/viz/radar/rsc/graphic/RadarGraphicsPage.java index 364bf592ec..d6e0e0f361 100644 --- a/cave/com.raytheon.viz.radar/src/com/raytheon/viz/radar/rsc/graphic/RadarGraphicsPage.java +++ b/cave/com.raytheon.viz.radar/src/com/raytheon/viz/radar/rsc/graphic/RadarGraphicsPage.java @@ -120,6 +120,7 @@ import com.vividsolutions.jts.geom.LineString; * 03/05/2013 DCS51 zwang Handle GFM product * 06/24/2013 DR16162 zwang Remove "wind behind" * 11/20/2013 2488 randerso Removed use of VeraMono font file + * Sep 03, 2014 3574 njensen Properly dispose objects * * * @@ -1456,6 +1457,21 @@ public class RadarGraphicsPage implements IRenderable { this.wireframeShape = null; } + if (this.gfmFcstWireframeShape != null) { + this.gfmFcstWireframeShape.dispose(); + this.gfmFcstWireframeShape = null; + } + + if (plotObjects != null) { + for (PlotObject po : plotObjects) { + if (po != null) { + po.image.dispose(); + po.image = null; + } + } + plotObjects.clear(); + } + if (this.font != null) { this.font.dispose(); } From 8c28597210e9ee365d56bb1d50656aa74cf708ff Mon Sep 17 00:00:00 2001 From: "Qinglu.Lin" Date: Thu, 4 Sep 2014 14:09:24 -0400 Subject: [PATCH 24/25] ASM #15551 - WarnGen: only WCN should be used while including TOR/SVR watches in WarnGen products Change-Id: I0438af111b0db290373c7553006002edec2b2110 Former-commit-id: 33adaf353c6a4b7dc418dc86428257dae260c4c5 --- .../src/com/raytheon/viz/warngen/gis/WatchUtil.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gis/WatchUtil.java b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gis/WatchUtil.java index 2e737b386a..8f700283b7 100644 --- a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gis/WatchUtil.java +++ b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gis/WatchUtil.java @@ -76,7 +76,8 @@ import com.vividsolutions.jts.geom.Polygon; * Jul 17, 2014 3419 jsanchez Initial creation * Aug 20, 2014 ASM #16703 D. Friedman Ensure watches have a state attribute. * Aug 28, 2014 ASM #15658 D. Friedman Add marine zones. - * Aug 29, 2014 ASM #15551 Qinglu Lin Sorting watches by ETN in processRecords(). + * Aug 29, 2014 ASM #15551 Qinglu Lin Sort watches by ETN and filter out ActiveTableRecord + * with act of CAN and EXP in processRecords(). * * * @@ -360,6 +361,9 @@ public class WatchUtil { Map> map = new HashMap>(); // For each watch event, get the end time and list of active zones for (ActiveTableRecord ar : activeTableRecords) { + if (ar.getAct().equals("CAN") || ar.getAct().equals("EXP")) { + continue; + } /* * Currently reports all zones in the watch even if a given zone is * not in the warning polygon. If the logic is changed to only show From 6d485769302814a1e1ef9c40e030e9db8b93eca7 Mon Sep 17 00:00:00 2001 From: Ana Rivera Date: Wed, 3 Sep 2014 20:16:47 +0000 Subject: [PATCH 25/25] VLab Issue #4601 - Update to SMS DR #16720; Remove HRRR entries in master_grib2_lookup.txt; fixes #4601 Change-Id: I0dfe0991503e6d87ce2db9713bb016d68cd1c152 Former-commit-id: 084970f8445dbb6b76bbad84b5dc986d961d2383 --- .../utility/common_static/base/grid/master_grib2_lookup.txt | 3 --- 1 file changed, 3 deletions(-) diff --git a/edexOsgi/com.raytheon.edex.plugin.grib/utility/common_static/base/grid/master_grib2_lookup.txt b/edexOsgi/com.raytheon.edex.plugin.grib/utility/common_static/base/grid/master_grib2_lookup.txt index 28a23bc166..c8cbdec2c1 100644 --- a/edexOsgi/com.raytheon.edex.plugin.grib/utility/common_static/base/grid/master_grib2_lookup.txt +++ b/edexOsgi/com.raytheon.edex.plugin.grib/utility/common_static/base/grid/master_grib2_lookup.txt @@ -43,9 +43,6 @@ // 5km CONUS MOSGuide precip probability TP0.254mm_T170L42A-NCEP-MDL_1073x689_21600-0 POP6hr TP0.254mm_T170L42A-NCEP-MDL_1073x689_43200-0 POP12hr -// Added for DCS_266 HRRR, removes F00 precip from any model if it arrives -TP_0-0 PWS64 -WEASD_0-0 PWS64 // 5km CONUS MOSGuide cumulative precip // these are unnessecary since A2 always appends duration TP_T170L42A-NCEP-MDL_1073x689_21600-0 TP6hr