diff --git a/cave/com.raytheon.uf.viz.alertviz/src/com/raytheon/uf/viz/alertviz/ConfigContext.java b/cave/com.raytheon.uf.viz.alertviz/src/com/raytheon/uf/viz/alertviz/ConfigContext.java index 30c7ed8129..8842f8fc9b 100644 --- a/cave/com.raytheon.uf.viz.alertviz/src/com/raytheon/uf/viz/alertviz/ConfigContext.java +++ b/cave/com.raytheon.uf.viz.alertviz/src/com/raytheon/uf/viz/alertviz/ConfigContext.java @@ -1,14 +1,52 @@ +/** + * 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.alertviz; -import java.io.File; - +import com.raytheon.uf.common.localization.IPathManager; import com.raytheon.uf.common.localization.LocalizationContext; import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel; +/** + * Class for managing configuration context. + * + *
+ * 
+ * SOFTWARE HISTORY
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Apr 09 2015  4346       rferrel     Added {@link #ALERTVIZ_DIR} and {@link #XML_EXT}.
+ * 
+ * 
+ * + * @author + * @version 1.0 + */ public class ConfigContext implements Comparable { - private static final String DEFAULT_NAME = "Default"; - private static final String DEFAULT_SUBDIR = "configurations"; + protected static final String ALERTVIZ_DIR = "alertViz"; + + protected static final String XML_EXT = ".xml"; + + protected static final String DEFAULT_NAME = "Default"; + + protected static final String DEFAULT_SUBDIR = "configurations"; private final String name; @@ -22,11 +60,11 @@ public class ConfigContext implements Comparable { : name; this.level = level; String newName = name; - if (newName.endsWith(".xml") == false) { - newName += ".xml"; + if (newName.endsWith(XML_EXT) == false) { + newName += XML_EXT; } - this.localizationFileName = "alertViz" + File.separator + subDirectory - + File.separator + newName; + this.localizationFileName = ALERTVIZ_DIR + IPathManager.SEPARATOR + + subDirectory + IPathManager.SEPARATOR + newName; } diff --git a/cave/com.raytheon.uf.viz.alertviz/src/com/raytheon/uf/viz/alertviz/ConfigurationManager.java b/cave/com.raytheon.uf.viz.alertviz/src/com/raytheon/uf/viz/alertviz/ConfigurationManager.java index 0b2e880502..2f1bf163b9 100644 --- a/cave/com.raytheon.uf.viz.alertviz/src/com/raytheon/uf/viz/alertviz/ConfigurationManager.java +++ b/cave/com.raytheon.uf.viz.alertviz/src/com/raytheon/uf/viz/alertviz/ConfigurationManager.java @@ -61,9 +61,10 @@ import com.raytheon.uf.viz.alertviz.config.Source; * Apr 7, 2010 mschenke Initial creation * Mar 16, 2011 6531 rferrel Start up loads host dependent * configuration file. - * Aug 28 2012 13528 Xiaochuan Using setNewConfiguration() to - * re-set configuration data and - * run notifyListeners(). + * Aug 28 2012 13528 Xiaochuan Using setNewConfiguration() to + * re-set configuration data and + * run notifyListeners(). + * Apr 07 2015 4346 rferrel Created {@link #retrieveBaseConfiguration()}. * * * @@ -75,13 +76,18 @@ public class ConfigurationManager { .getHandler(ConfigurationManager.class, "GDN_ADMIN", "GDN_ADMIN"); public static final ConfigContext DEFAULT_BASE_CONFIG = new ConfigContext( - "Default", LocalizationLevel.BASE); + ConfigContext.DEFAULT_NAME, LocalizationLevel.BASE); public static final ConfigContext DEFAULT_SITE_CONFIG = new ConfigContext( - "Default", LocalizationLevel.SITE); + ConfigContext.DEFAULT_NAME, LocalizationLevel.SITE); public static final ConfigContext DEFAULT_WORKSTATION_CONFIG = new ConfigContext( - "Default", LocalizationLevel.WORKSTATION); + ConfigContext.DEFAULT_NAME, LocalizationLevel.WORKSTATION); + + private static final String CONFIG_DIR = ConfigContext.ALERTVIZ_DIR + + IPathManager.SEPARATOR + ConfigContext.DEFAULT_SUBDIR; + + private static final String[] EXTENSIONS = { ConfigContext.XML_EXT }; private static ConfigurationManager instance = new ConfigurationManager(); @@ -147,7 +153,7 @@ public class ConfigurationManager { unmarshaller = null; } loadFromLocalization(); - baseConfiguration = retrieveConfiguration(DEFAULT_BASE_CONFIG); + baseConfiguration = retrieveBaseConfiguration(); } /** @@ -202,20 +208,20 @@ public class ConfigurationManager { Configuration custom = getCustomConfiguration(); if (custom != null) { - if (baseConfiguration == null) { - statusHandler.error("The base configuration " - + DEFAULT_BASE_CONFIG.getLocalizationFileName() - + " was not loaded. Check your configuration."); - } - else { - /* - * merge custom over base then overlay the current config on - * that result. preserve locking from the base configuration. - */ - Configuration baseCustom = baseConfiguration.mergeUnder(custom, - true); - currentConfig = baseCustom.overlayWith(currentConfig, true); - } + if (baseConfiguration == null) { + statusHandler.error("The base configuration " + + DEFAULT_BASE_CONFIG.getLocalizationFileName() + + " was not loaded. Check your configuration."); + } else { + /* + * merge custom over base then overlay the current config on + * that result. preserve locking from the base + * configuration. + */ + Configuration baseCustom = baseConfiguration.mergeUnder( + custom, true); + currentConfig = baseCustom.overlayWith(currentConfig, true); + } } configurationMap.put(current, currentConfig); } else if (DEFAULT_BASE_CONFIG.equals(current) == false) { @@ -232,11 +238,11 @@ public class ConfigurationManager { */ public boolean saveCurrentConfiguration(ConfigContext context, Configuration toSave) { - - if (saveToFile(context, toSave)) { - setNewConfiguration(context, toSave); - - return true; + + if (saveToFile(context, toSave)) { + setNewConfiguration(context, toSave); + + return true; } return false; } @@ -247,11 +253,12 @@ public class ConfigurationManager { */ public void setNewConfiguration(ConfigContext context, Configuration configData) { - configurationMap.put(context, configData); - current = context; + configurationMap.put(context, configData); + current = context; notifyListeners(); - + } + /** * Delete the configuration passed in * @@ -299,21 +306,34 @@ public class ConfigurationManager { listeners.remove(listener); } + /** + * Get files to display in the dialog. + */ private void loadFromLocalization() { IPathManager pm = PathManagerFactory.getPathManager(); LocalizationContext[] contexts = pm .getLocalSearchHierarchy(LocalizationType.CAVE_STATIC); - String[] extensions = { "xml" }; - LocalizationFile[] files = pm.listFiles(contexts, "alertViz" + "/" - + "configurations", extensions, true, true); // Win32 + LocalizationFile[] files = pm.listFiles(contexts, CONFIG_DIR, + EXTENSIONS, true, true); // Win32 + for (LocalizationFile file : files) { - String fileName = file.getName(); - LocalizationContext locContext = file.getContext(); - String name = fileName.substring( -fileName.lastIndexOf("/") + 1, // win32 - fileName.lastIndexOf(".")); - ConfigContext context = new ConfigContext(name, locContext); - configurationMap.put(context, null); + LocalizationContext fileContext = file.getContext(); + + /* + * Do not display BASE xml files that get merged into the + * baseConfiguration. + */ + if ((fileContext.getLocalizationLevel() != LocalizationLevel.BASE) + || ((fileContext.getLocalizationLevel() == LocalizationLevel.BASE) && DEFAULT_BASE_CONFIG + .getLocalizationFileName().equals(file.getName()))) { + String fileName = file.getName(); + LocalizationContext locContext = file.getContext(); + String name = fileName.substring( + fileName.lastIndexOf(IPathManager.SEPARATOR) + 1, // win32 + fileName.lastIndexOf(".")); + ConfigContext context = new ConfigContext(name, locContext); + configurationMap.put(context, null); + } } } @@ -339,9 +359,42 @@ fileName.lastIndexOf("/") + 1, // win32 public Configuration retrieveConfiguration(ConfigContext configContext) { LocalizationFile file = getLocalizationFile(configContext); + if (DEFAULT_BASE_CONFIG.equals(configContext)) { + if (baseConfiguration == null) { + baseConfiguration = retrieveBaseConfiguration(); + } + return baseConfiguration; + } + return retrieveConfiguration(file); } + /** + * Get base Default.xml and merge with any other base xml files. + * + * @return configuration + */ + private Configuration retrieveBaseConfiguration() { + LocalizationFile file = getLocalizationFile(DEFAULT_BASE_CONFIG); + Configuration configuration = retrieveConfiguration(file); + IPathManager pm = PathManagerFactory.getPathManager(); + LocalizationContext context = pm.getContext( + LocalizationType.CAVE_STATIC, LocalizationLevel.BASE); + LocalizationFile[] files = pm.listFiles(context, CONFIG_DIR, + EXTENSIONS, false, true); + for (LocalizationFile f : files) { + // Merge other base files with the default. + if (!DEFAULT_BASE_CONFIG.getLocalizationFileName().equals( + f.getName())) { + Configuration fileConfig = retrieveConfiguration(f); + Configuration mergeConfig = configuration.mergeUnder( + fileConfig, true); + configuration = mergeConfig.overlayWith(configuration, true); + } + } + return configuration; + } + public Configuration retrieveConfiguration(LocalizationFile file) { Configuration config = null; if (file != null) { @@ -397,7 +450,7 @@ fileName.lastIndexOf("/") + 1, // win32 private void notifyListeners() { for (IConfigurationChangedListener listener : listeners) { - listener.configurationChanged(); + listener.configurationChanged(); } } @@ -464,8 +517,9 @@ fileName.lastIndexOf("/") + 1, // win32 IPathManager pm = PathManagerFactory.getPathManager(); LocalizationContext ctx = pm.getContext(LocalizationType.CAVE_STATIC, LocalizationLevel.SITE); - LocalizationFile file = pm.getLocalizationFile(ctx, "alertViz" - + File.separator + "AlertVizForced.xml"); + LocalizationFile file = pm.getLocalizationFile(ctx, + ConfigContext.ALERTVIZ_DIR + IPathManager.SEPARATOR + + "AlertVizForced.xml"); File actualFile = file.getFile(); // Win32: JHB put in check for length if (actualFile != null && actualFile.exists() @@ -536,7 +590,7 @@ fileName.lastIndexOf("/") + 1, // win32 } public void resetCustomLocalization() { - reloadCustomConfiguration = true; + reloadCustomConfiguration = true; } public static boolean isDefaultConfig(ConfigContext context) { diff --git a/cave/com.raytheon.uf.viz.npp.viirs/localization/bundles/npp/viirs/viirsDayNightBandImagery.xml b/cave/com.raytheon.uf.viz.npp.viirs/localization/bundles/npp/viirs/viirsDayNightBandImagery.xml new file mode 100644 index 0000000000..bbe460b591 --- /dev/null +++ b/cave/com.raytheon.uf.viz.npp.viirs/localization/bundles/npp/viirs/viirsDayNightBandImagery.xml @@ -0,0 +1,51 @@ + + + + + + + + + + + ${groupTimeRange;30} + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/cave/com.raytheon.uf.viz.npp.viirs/localization/menus/npp/viirs/viirsBundleItems.xml b/cave/com.raytheon.uf.viz.npp.viirs/localization/menus/npp/viirs/viirsBundleItems.xml index 8eb6972ab0..35ca85d9a4 100644 --- a/cave/com.raytheon.uf.viz.npp.viirs/localization/menus/npp/viirs/viirsBundleItems.xml +++ b/cave/com.raytheon.uf.viz.npp.viirs/localization/menus/npp/viirs/viirsBundleItems.xml @@ -59,10 +59,14 @@ menuText="Moderate Band 16 (12.013u)" id="Mod12.013"> - - + + + + Generate Products @@ -36,7 +36,7 @@ ## Fire Period Table for Feb 29 00 17:00:00 GMT - Mar 01 00 11:00:00 GMT. -## Edit Area Sky (%) LAL RelHum (%) MaxT MinT FreeWind(mph) Haines TransWind(mph) MixHgt(ft agl) +## Edit Area Sky (%) LAL RelHum (%) MaxT MinT FreeWind(mph) Haines TransWind(mph) MixHgt(ft AGL) ## COAdams 36-23 46 26 ## COArapahoe 34-24 46 26 @@ -102,7 +102,7 @@ Definition = { "vectorRange", "range2Value", "Vector", 1, "ktToMph"), - ("MixHgt", "MixHgt(ft agl)", + ("MixHgt", "MixHgt(ft AGL)", "minMax", "range2Value", "Scalar",10,None), diff --git a/cave/com.raytheon.viz.gfe/python/testFormatters/RecreationFcst.py b/cave/com.raytheon.viz.gfe/python/testFormatters/RecreationFcst.py index 06d9fd1b65..8f630e382c 100644 --- a/cave/com.raytheon.viz.gfe/python/testFormatters/RecreationFcst.py +++ b/cave/com.raytheon.viz.gfe/python/testFormatters/RecreationFcst.py @@ -297,7 +297,7 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis): if digit > 3 or digit <= 9: RH1 = ten + 5 RH2 = RH1 + 10 - words = `RH1` + " TO " + `RH2` + " PERCENT" + words = `RH1` + " to " + `RH2` + " percent" return self.setWords(node, words) def _windChill_heatIndex_compoundPhrase(self): @@ -316,7 +316,7 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis): if words is None: return if words == "": - words = "NOT A FACTOR" + words = "not a factor" node.set("descriptor", "") statsWC = tree.stats.get("WindChill", node.getTimeRange(), node.getAreaLabel(), mergeMethod="Min") @@ -364,11 +364,11 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis): maxWind, dir = self.getValue(stats, "Max", self.VECTOR()) chopphrase = "" if maxWind >= 26.1: - chopphrase = "HEAVY CHOP EXPECTED ON AREA RIVERS AND LAKES" + chopphrase = "Heavy chop expected on area rivers and lakes" elif maxWind >= 21.7: - chopphrase = "MODERATE CHOP EXPECTED ON AREA RIVERS AND LAKES" + chopphrase = "Moderate chop expected on area rivers and lakes" elif maxWind >= 17.4: - chopphrase = "LIGHT CHOP EXPECTED ON AREA RIVERS AND LAKES" + chopphrase = "Light chop expected on area rivers and lakes" if chopphrase != "": words = words + ". " + chopphrase return self.setWords(node, words) @@ -408,10 +408,10 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis): QPFwords = "\n" words = WXwords elif (QPFrange0 == "0.0"): - QPFwords = "AMOUNTS UP TO " + QPFrange1 + " OF AN INCH" + QPFwords = "Amounts up to " + QPFrange1 + " of an inch" words = WXwords + ". " + QPFwords else: - QPFwords = "AMOUNTS BETWEEN " + QPFrange0 + " AND " + QPFrange1 + " OF AN INCH" + QPFwords = "Amounts between " + QPFrange0 + " and " + QPFrange1 + " of an inch" words = WXwords + ". " + QPFwords return self.setWords(node, words) @@ -441,15 +441,15 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis): if wxType == "T": cov = subkey.coverage() if cov in ["Num", "Wide", "Ocnl", "Brf", "Frq", "Pds", "Inter", "Lkly", "Def"]: - words = "LIKELY" - elif cov in ["Sct", "Chc"] and words not in ["LIKELY"]: - words = "SCATTERED" - elif cov in ["Iso", "SChc"] and words not in ["LIKELY", "SCATTERED"]: - words = "ISOLATED" - elif words not in ["LIKELY", "SCATTERED", "ISOLATED"]: - words = "POSSIBLE" - elif words not in ["LIKELY", "SCATTERED", "ISOLATED", "POSSIBLE"]: - words = "NONE" + words = "likely" + elif cov in ["Sct", "Chc"] and words not in ["likely"]: + words = "scattered" + elif cov in ["Iso", "SChc"] and words not in ["likely", "scattered"]: + words = "isolated" + elif words not in ["likely", "scattered", "isolated"]: + words = "possible" + elif words not in ["likely", "scattered", "isolated", "possible"]: + words = "none" #print words return self.setWords(node, words) diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/cave_static/user/GFETEST/gfe/userPython/textProducts/tp008_Local.py b/cave/com.raytheon.viz.gfe/python/testFormatters/tp008_Local.py similarity index 100% rename from edexOsgi/com.raytheon.edex.plugin.gfe/utility/cave_static/user/GFETEST/gfe/userPython/textProducts/tp008_Local.py rename to cave/com.raytheon.viz.gfe/python/testFormatters/tp008_Local.py 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 9ce1489a36..530a5c6588 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 @@ -98,8 +98,8 @@ public class GfeClient extends AbstractAWIPSComponent { } } - if (gfeClientArgStartIndex == -1 - || gfeClientArgStartIndex == args.length) { + if ((gfeClientArgStartIndex == -1) + || (gfeClientArgStartIndex == args.length)) { System.err.println("No python script specified to run - exiting"); return; } @@ -130,7 +130,6 @@ public class GfeClient extends AbstractAWIPSComponent { GfeCavePyIncludeUtil.getAutotestIncludePath(), GfeCavePyIncludeUtil.getTextUtilitiesIncludePath(includeUser), GfeCavePyIncludeUtil.getTextProductsIncludePath(includeUser), - GfeCavePyIncludeUtil.getTextProductsTemplatesIncludePath(), GfeCavePyIncludeUtil.getCombinationsIncludePath(includeUser), GfeCavePyIncludeUtil.getTestsIncludePath(), GfeCavePyIncludeUtil.getProceduresIncludePath(includeUser)); diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/core/DataManager.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/core/DataManager.java index 190ba519cb..7f5c9126a3 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/core/DataManager.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/core/DataManager.java @@ -103,6 +103,7 @@ import com.raytheon.viz.gfe.textformatter.TextProductManager; * 05/22/2014 3110 randerso Attach router to edex.alerts.gfe earlier * 09/09/2014 3592 randerso Added call to SampleSetManager.dispose() * 10/30/2014 3775 randerso Added parmCacheInit to initStatus + * 04/20/2015 4027 randerso Let TextProductManager know we are not running in a GUI * * * @@ -213,6 +214,8 @@ public class DataManager { * * @param factory * @param discriminator + * used as key for this instance of DataManager in the factory's + * instance map. Normally this is the window GFE is running in. * @throws GFEServerException */ DataManager(DataManagerFactory factory, Object discriminator) @@ -236,7 +239,7 @@ public class DataManager { strInitJob.setSystem(true); strInitJob.schedule(); - initializeScriptControllers(); + initializeScriptControllers(discriminator); procJobPool = new ProcedureJobPool(4, 4, this); toolJobPool = new SmartToolJobPool(3, 3, this); @@ -510,7 +513,7 @@ public class DataManager { this.gridManager = gridManager; } - private void initializeScriptControllers() { + private void initializeScriptControllers(final Object discriminator) { // it would be really nice to be able to spawn the construction of these // two heavy objects into another thread. Unfortunately, Jep requires // creation and all subsequent access to happen on the same thread. So @@ -539,7 +542,8 @@ public class DataManager { "Error initializing smart tool interface", e); } - DataManager.this.textProductMgr = new TextProductManager(); + DataManager.this.textProductMgr = new TextProductManager( + discriminator != null); } }); } diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/FormatterLauncherDialog.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/FormatterLauncherDialog.java index 81761361f2..8113ed2d0c 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/FormatterLauncherDialog.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/FormatterLauncherDialog.java @@ -690,7 +690,7 @@ public class FormatterLauncherDialog extends CaveJFACEDialog implements TabItem newTab = new TabItem(tabFolder, SWT.NONE); newTab.setText(tabName); - setTabImage(newTab, ConfigData.productStateEnum.New); + setTabImage(newTab, ConfigData.ProductStateEnum.New); newTab.setImage(newTabImg); ProductAreaComp comp = new ProductAreaComp(tabFolder, this, @@ -874,7 +874,7 @@ public class FormatterLauncherDialog extends CaveJFACEDialog implements * Name of the tab. */ @Override - public void setTabState(ConfigData.productStateEnum state, String tabName) { + public void setTabState(ConfigData.ProductStateEnum state, String tabName) { TabItem[] items = tabFolder.getItems(); for (int i = 0; i < items.length; i++) { @@ -893,18 +893,18 @@ public class FormatterLauncherDialog extends CaveJFACEDialog implements * @param state * Product state. */ - private void setTabImage(TabItem ti, ConfigData.productStateEnum state) { - if (state == ConfigData.productStateEnum.New) { + private void setTabImage(TabItem ti, ConfigData.ProductStateEnum state) { + if (state == ConfigData.ProductStateEnum.New) { ti.setImage(newTabImg); - } else if (state == ConfigData.productStateEnum.Queued) { + } else if (state == ConfigData.ProductStateEnum.Queued) { ti.setImage(queuedImg); - } else if (state == ConfigData.productStateEnum.Running) { + } else if (state == ConfigData.ProductStateEnum.Running) { ti.setImage(runningImg); - } else if (state == ConfigData.productStateEnum.Finished) { + } else if (state == ConfigData.ProductStateEnum.Finished) { ti.setImage(finishedImg); - } else if (state == ConfigData.productStateEnum.Transmitted) { + } else if (state == ConfigData.ProductStateEnum.Transmitted) { ti.setImage(transmittedImg); - } else if (state == ConfigData.productStateEnum.Failed) { + } else if (state == ConfigData.ProductStateEnum.Failed) { ti.setImage(failedImg); } } diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/ConfigData.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/ConfigData.java index 5eadd4af8e..54efef2132 100755 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/ConfigData.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/ConfigData.java @@ -27,6 +27,7 @@ package com.raytheon.viz.gfe.dialogs.formatterlauncher; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * 18 APR 2008 ### lvenable Initial creation + * 20 APR 2015 4027 randerso Added a flag to the enum's to indicate which are final states * * * @@ -46,8 +47,19 @@ public final class ConfigData { * @author lvenable * */ - public enum productStateEnum { - New, Queued, Running, Finished, Transmitted, Failed; + public enum ProductStateEnum { + New(false), Queued(false), Running(false), Finished(true), Transmitted( + true), Failed(true); + + private boolean complete; + + private ProductStateEnum(boolean complete) { + this.complete = complete; + } + + public boolean isComplete() { + return complete; + } } /** diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/IProductTab.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/IProductTab.java index 7dd727b4cc..3623ca973f 100755 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/IProductTab.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/IProductTab.java @@ -27,6 +27,7 @@ package com.raytheon.viz.gfe.dialogs.formatterlauncher; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * 18 APR 2008 ### lvenable Initial creation + * 20 APR 2015 4027 randerso Renamed ProductStateEnum with an initial capital * * * @@ -50,7 +51,7 @@ public interface IProductTab { * Product state. * @param productName */ - void setTabState(ConfigData.productStateEnum state, String productName); + void setTabState(ConfigData.ProductStateEnum state, String productName); /** * Update the status from the component. diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/ITransmissionState.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/ITransmissionState.java index e53b75d055..2a305bf8b4 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/ITransmissionState.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/ITransmissionState.java @@ -28,7 +28,8 @@ package com.raytheon.viz.gfe.dialogs.formatterlauncher; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Feb 22, 2010 #2861 lvenable Initial creation + * Feb 22, 2010 #2861 lvenable Initial creation + * Apr 20, 2015 #4027 randerso Renamed ProductStateEnum with an initial capital * * * @@ -36,5 +37,5 @@ package com.raytheon.viz.gfe.dialogs.formatterlauncher; * @version 1.0 */ public interface ITransmissionState { - void setTransmissionState(ConfigData.productStateEnum state); + void setTransmissionState(ConfigData.ProductStateEnum state); } diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/ProductAreaComp.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/ProductAreaComp.java index 2f16d0d691..d34b4a5f82 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/ProductAreaComp.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/ProductAreaComp.java @@ -38,7 +38,7 @@ import com.raytheon.uf.common.dataplugin.gfe.db.objects.DatabaseID; import com.raytheon.viz.gfe.Activator; import com.raytheon.viz.gfe.core.DataManager; import com.raytheon.viz.gfe.dialogs.FormatterLauncherDialog; -import com.raytheon.viz.gfe.dialogs.formatterlauncher.ConfigData.productStateEnum; +import com.raytheon.viz.gfe.dialogs.formatterlauncher.ConfigData.ProductStateEnum; import com.raytheon.viz.gfe.tasks.AbstractGfeTask; import com.raytheon.viz.gfe.tasks.TaskManager; import com.raytheon.viz.gfe.textformatter.FormatterUtil; @@ -67,6 +67,7 @@ import com.raytheon.viz.gfe.textformatter.TextProductManager; * 05 FEB 2014 2591 randerso Added dataManager to ZoneCombinerComp constructor * Passed dataMgr instance to FormatterUtil.runFormatterScript * 12 FEB 2014 2801 randerso Added prompting if formatter is run against non-normal database + * 20 APR 2015 4027 randerso Fixes for GFE formatter auto tests to support mixed case WA * * * @@ -380,6 +381,15 @@ public class ProductAreaComp extends Composite implements if (formattingCbo.isVisible()) { vtecMode = formattingCbo.getText(); } else { + // TODO: part of fix for SS RM DR #14813 + // String pil = (String) textProductMgr + // .getDefinitionValue(productName, "pil"); + // if (pil != null) { + // pil = pil.substring(0, 3); + // vtecMode = textProductMgr + // .getVtecMessageType(pil); + // } + int hazIndex = productName.indexOf("Hazard_"); if (hazIndex > -1) { String category = productName.substring( @@ -640,14 +650,13 @@ public class ProductAreaComp extends Composite implements } @Override - public void textProductQueued() { - productTabCB.setTabState(ConfigData.productStateEnum.Queued, - productName); + public void textProductQueued(ConfigData.ProductStateEnum state) { + productTabCB.setTabState(state, productName); } @Override public void textProductFinished(String productText, - ConfigData.productStateEnum state) { + ConfigData.ProductStateEnum state) { if (isTabClosed == true) { return; @@ -657,7 +666,7 @@ public class ProductAreaComp extends Composite implements runFormatterBtn.setEnabled(true); // closeTabBtn.setEnabled(true); outputLogBtn.setEnabled(true); - if (state == ConfigData.productStateEnum.Finished) { + if (state == ConfigData.ProductStateEnum.Finished) { if (productText != null) { productEditorComp.retrieveActiveVTEC(); productEditorComp.setProductText(productText); @@ -668,14 +677,14 @@ public class ProductAreaComp extends Composite implements productEditorBtn.setSelection(true); productEditorBtnSelected(); - } else if (state == ConfigData.productStateEnum.Failed) { + } else if (state == ConfigData.ProductStateEnum.Failed) { outputLogBtn.setSelection(true); outputLogBtnSelected(); } } @Override - public void startProgressBar(ConfigData.productStateEnum state) { + public void startProgressBar(ConfigData.ProductStateEnum state) { if (isTabClosed == true) { return; } @@ -685,7 +694,7 @@ public class ProductAreaComp extends Composite implements } @Override - public void stopProgressBar(ConfigData.productStateEnum state) { + public void stopProgressBar(ConfigData.ProductStateEnum state) { if (isTabClosed == true) { return; } @@ -695,7 +704,7 @@ public class ProductAreaComp extends Composite implements } @Override - public void setTransmissionState(productStateEnum state) { + public void setTransmissionState(ProductStateEnum state) { productTabCB.setTabState(state, productName); } diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/ProductEditorComp.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/ProductEditorComp.java index 43d7dd5bf2..91000b7068 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/ProductEditorComp.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/ProductEditorComp.java @@ -115,7 +115,7 @@ import com.raytheon.viz.gfe.Activator; import com.raytheon.viz.gfe.GFEPreference; import com.raytheon.viz.gfe.constants.StatusConstants; import com.raytheon.viz.gfe.core.DataManager; -import com.raytheon.viz.gfe.dialogs.formatterlauncher.ConfigData.productStateEnum; +import com.raytheon.viz.gfe.dialogs.formatterlauncher.ConfigData.ProductStateEnum; import com.raytheon.viz.gfe.product.ProductFileUtil; import com.raytheon.viz.gfe.product.TextDBUtil; import com.raytheon.viz.ui.dialogs.ICloseCallback; @@ -165,6 +165,8 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback; * for the local time zones for each segment. * 01/28/2015 #4018 randerso Code cleanup. * 02/04/2014 17039 ryu Removed menu item related to the HighlighFramingCodes feature. + * 04/20/2015 4027 randerso Renamed ProductStateEnum with an initial capital + * Expunged Calendar from ActiveTableRecord * * * @author lvenable @@ -1387,7 +1389,7 @@ public class ProductEditorComp extends Composite implements // check if the segment is still valid int started = 0; for (ActiveTableRecord atr : activeRecs) { - if (atr.getStartTime().getTimeInMillis() <= transmissionTime + if (atr.getStartTime().getTime() <= transmissionTime .getTime()) { started++; } @@ -1419,7 +1421,7 @@ public class ProductEditorComp extends Composite implements for (ActiveTableRecord r : activeRecs) { // need to change the action to CON if // the end time did not change - if (r.getEndTime().getTimeInMillis() == vtecEnd + if (r.getEndTime().getTime() == vtecEnd .getTime()) { if (!newActions.contains("CON")) { newActions.add("CON"); @@ -1499,7 +1501,7 @@ public class ProductEditorComp extends Composite implements // Check start and ending time for end later than start if ((vtecStart != null) && (vtecEnd != null) && (vtecStart.getTime() >= vtecEnd.getTime())) { - setTabColorFunc(productStateEnum.New); + setTabColorFunc(ProductStateEnum.New); String msg = "VTEC ending time is before " + "starting time. Product is invalid and must" + " be regenerated."; @@ -1516,7 +1518,7 @@ public class ProductEditorComp extends Composite implements if ((vtecEnd != null) && (vtecEnd.getTime() <= transmissionTime.getTime())) { - setTabColorFunc(productStateEnum.New); + setTabColorFunc(ProductStateEnum.New); String msg = "VTEC ends before current time." + " Product is invalid and must be regenerated."; throw new VizException(msg); @@ -2426,7 +2428,7 @@ public class ProductEditorComp extends Composite implements clearProductText(); setProductText(draft.getProductText()); - setTabColorFunc(productStateEnum.Finished); + setTabColorFunc(ProductStateEnum.Finished); setStatusText('R', productId + " draft loaded."); if (productDefinition.get("brain") != null) { @@ -2437,7 +2439,7 @@ public class ProductEditorComp extends Composite implements + "after the draft was originally saved.\nThis causes VTEC to " + "be suspect. You must re-run the formatter."; setStatusText('U', msg); - setTabColorFunc(productStateEnum.New); + setTabColorFunc(ProductStateEnum.New); } else { revive(); retrieveActiveVTEC(); @@ -2827,13 +2829,13 @@ public class ProductEditorComp extends Composite implements setStatusText('U', msg1); // set tab back to gray - setTabColorFunc(productStateEnum.New); + setTabColorFunc(ProductStateEnum.New); // special *ALL* case } else if (allFound) { brain(); // set tab back to gray - setTabColorFunc(productStateEnum.New); + setTabColorFunc(ProductStateEnum.New); } } @@ -2900,7 +2902,7 @@ public class ProductEditorComp extends Composite implements /** * @param string */ - private void setTabColorFunc(productStateEnum state) { + private void setTabColorFunc(ProductStateEnum state) { transmissionCB.setTransmissionState(state); } diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/StoreTransmitDlg.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/StoreTransmitDlg.java index e7dd32a952..0485f26f6c 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/StoreTransmitDlg.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/StoreTransmitDlg.java @@ -88,6 +88,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog; * Nov 14, 2014 4953 randerso Cleaned up practice product requests * Feb 26, 2015 4126 randerso Ensure transmit/store is properly cancelled if dialog is closed * Code cleanup + * Apr 20, 2015 4027 randerso Renamed ProductStateEnum with an initial capital * * * @@ -441,7 +442,7 @@ public class StoreTransmitDlg extends CaveSWTDialog { } catch (VizException e) { statusHandler.handle(Priority.CRITICAL, "Error preparing product for transmission.", e); - sendTransmissionStatus(ConfigData.productStateEnum.Failed); + sendTransmissionStatus(ConfigData.ProductStateEnum.Failed); StoreTransmitDlg.this.parentEditor.revive(); } } @@ -578,14 +579,14 @@ public class StoreTransmitDlg extends CaveSWTDialog { Priority p = null; if (!resp.hasFailure()) { p = Priority.EVENTA; - sendTransmissionStatus(ConfigData.productStateEnum.Transmitted); + sendTransmissionStatus(ConfigData.ProductStateEnum.Transmitted); } else { // determine the failure type and priority - ConfigData.productStateEnum state = null; + ConfigData.ProductStateEnum state = null; if (resp.isSendLocalSuccess()) { - state = ConfigData.productStateEnum.Transmitted; + state = ConfigData.ProductStateEnum.Transmitted; } else { - state = ConfigData.productStateEnum.Failed; + state = ConfigData.ProductStateEnum.Failed; } p = Priority.EVENTA; if (!resp.isAttempted()) { @@ -619,14 +620,14 @@ public class StoreTransmitDlg extends CaveSWTDialog { this.parentEditor.brain(); } catch (VizException e) { statusHandler.handle(Priority.CRITICAL, "Error sending product", e); - sendTransmissionStatus(ConfigData.productStateEnum.Failed); + sendTransmissionStatus(ConfigData.ProductStateEnum.Failed); this.parentEditor.revive(); } SEQ_NUMBER++; } - private void sendTransmissionStatus(ConfigData.productStateEnum status) { + private void sendTransmissionStatus(ConfigData.ProductStateEnum status) { if (!isStoreDialog) { transmissionCB.setTransmissionState(status); } diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/smarttool/TextFileUtil.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/smarttool/TextFileUtil.java index 62815667f9..cc08bd2b7b 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/smarttool/TextFileUtil.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/smarttool/TextFileUtil.java @@ -20,11 +20,11 @@ package com.raytheon.viz.gfe.smarttool; import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.nio.file.Files; +import java.nio.file.Paths; import com.raytheon.uf.common.dataplugin.gfe.python.GfePyIncludeUtil; import com.raytheon.uf.common.localization.IPathManager; @@ -33,6 +33,7 @@ import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType; import com.raytheon.uf.common.localization.LocalizationFile; import com.raytheon.uf.common.localization.PathManagerFactory; +import com.raytheon.uf.common.localization.exception.LocalizationException; import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException; import com.raytheon.uf.common.python.PythonFileFilter; import com.raytheon.viz.gfe.GFEOperationFailedException; @@ -46,6 +47,7 @@ import com.raytheon.viz.gfe.GFEOperationFailedException; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Apr 28, 2009 njensen Initial creation + * Apr 20, 2015 4027 randerso Changes to support GFE formatter auto tests * * * @@ -87,6 +89,14 @@ public class TextFileUtil { return file; } + public static LocalizationFile getUserTextFile(LocalizationFile source) { + LocalizationContext ctx = PATH_MGR.getContext(source.getContext() + .getLocalizationType(), LocalizationLevel.USER); + + LocalizationFile destLf = getTextFile(ctx, source.getName()); + return destLf; + } + private static String getPathFromType(String filename, String fileType) { String name = null; if (fileType.equalsIgnoreCase("TextUtility")) { @@ -102,7 +112,8 @@ public class TextFileUtil { name = "gfe" + File.separator + "editAreaGroups" + File.separator + filename + ".txt"; } else if (fileType.equalsIgnoreCase("Reference")) { - name = "editAreas" + File.separator + filename + ".xml"; + name = "gfe" + File.separator + "editAreas" + File.separator + + filename + ".xml"; } return name; } @@ -115,63 +126,75 @@ public class TextFileUtil { public static void makeWritableCopy(String source, String fileType, String dest, boolean deleteFlag) throws IOException, GFEOperationFailedException { - LocalizationFile lf = getTextFile(source, fileType); - if (lf.getContext().getLocalizationLevel() == LocalizationLevel.BASE - || lf.getContext().getLocalizationLevel() == LocalizationLevel.SITE) { - File srcFile = lf.getFile(); + LocalizationFile srcLf = getTextFile(source, fileType); + if ((srcLf.getContext().getLocalizationLevel() == LocalizationLevel.BASE) + || (srcLf.getContext().getLocalizationLevel() == LocalizationLevel.CONFIGURED) + || (srcLf.getContext().getLocalizationLevel() == LocalizationLevel.SITE)) { IPathManager pathMgr = PathManagerFactory.getPathManager(); - LocalizationContext ctx = pathMgr.getContext(lf.getContext() + LocalizationContext ctx = pathMgr.getContext(srcLf.getContext() .getLocalizationType(), LocalizationLevel.USER); LocalizationFile destLf = getTextFile(ctx, getPathFromType(dest, fileType)); - File destFile = destLf.getFile(); - copy(srcFile, destFile); try { + copy(srcLf, destLf); destLf.save(); } catch (Exception e) { throw new GFEOperationFailedException( "Unable to save localization file", e); } - } else if (lf.getContext().getLocalizationLevel() == LocalizationLevel.USER) { + } else if (srcLf.getContext().getLocalizationLevel() == LocalizationLevel.USER) { if (deleteFlag) { try { - lf.delete(); + srcLf.delete(); } catch (Exception e) { throw new GFEOperationFailedException( "Unable to delete localization file " - + lf.toString(), e); + + srcLf.toString(), e); } } else { System.out.println("USER version already exists " + source); } } else { throw new GFEOperationFailedException( - "No file found at base or site level for " + source + " " - + fileType); + "No file found at base, configured or site level for " + + source + " " + fileType); } } - private static void copy(File src, File dest) throws IOException { - File dir = new File(dest.getParent()); - dir.mkdir(); - InputStream in = new FileInputStream(src); - OutputStream out = new FileOutputStream(dest); + private static void copy(LocalizationFile srcLf, LocalizationFile destLf) + throws IOException, LocalizationException { + File dir = destLf.getFile(false).getParentFile(); + Files.createDirectories(dir.toPath()); - // Transfer bytes from in to out - byte[] buf = new byte[1024]; - int len; - while ((len = in.read(buf)) > 0) { - out.write(buf, 0, len); + try (InputStream in = srcLf.openInputStream(); + OutputStream out = destLf.openOutputStream()) { + + // Transfer bytes from in to out + byte[] buf = new byte[1024]; + int len; + while ((len = in.read(buf)) > 0) { + out.write(buf, 0, len); + } } - in.close(); - out.close(); } public static void deleteTextFile(LocalizationFile lf) - throws LocalizationOpFailedException { - lf.delete(); + throws LocalizationOpFailedException, IOException { + if (lf.getContext().getLocalizationLevel() + .equals(LocalizationLevel.USER) + && lf.getContext().getContextName().equals("GFETEST")) { + lf.delete(); + String path = lf.getFile().getAbsolutePath(); + if (path.endsWith(".py")) { + path = path + "o"; + Files.deleteIfExists(Paths.get(path)); + } + } else { + throw new IllegalArgumentException( + "Can only delete USER level files owned by GFETEST: " + lf); + } } } diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/textformatter/FormatterScriptFactory.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/textformatter/FormatterScriptFactory.java index f632c1bd70..16dc0dc958 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/textformatter/FormatterScriptFactory.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/textformatter/FormatterScriptFactory.java @@ -30,15 +30,18 @@ import com.raytheon.uf.common.localization.PathManagerFactory; import com.raytheon.uf.common.python.PyUtil; import com.raytheon.uf.common.util.FileUtil; import com.raytheon.uf.viz.core.exception.VizException; +import com.raytheon.viz.gfe.python.GfeCavePyIncludeUtil; /** * Builds text formatter script objects * *
  * SOFTWARE HISTORY
- * Date			Ticket#		Engineer	Description
- * ------------	----------	-----------	--------------------------
- * Jun 2, 2008				njensen	    Initial creation
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Jun 02, 2008            njensen     Initial creation
+ * Apr 20, 2015  4027      randerso    Remove unused TextProductsTemplates path and added 
+ *                                     Tests path for GFE formatter auto tests
  * 
  * 
* @@ -67,9 +70,9 @@ public class FormatterScriptFactory { GfePyIncludeUtil.getHeadlineIncludePath(), GfePyIncludeUtil.getTextUtilitiesIncludePath(), GfePyIncludeUtil.getTextProductsIncludePath(), - GfePyIncludeUtil.getTextProductsTemplatesIncludePath(), GfePyIncludeUtil.getUtilitiesIncludePath(), - GfePyIncludeUtil.getCombinationsIncludePath()); + GfePyIncludeUtil.getCombinationsIncludePath(), + GfeCavePyIncludeUtil.getTestsIncludePath()); return new FormatterScript(runnerPath, include, FormatterScript.class.getClassLoader()); diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/textformatter/FormatterUtil.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/textformatter/FormatterUtil.java index 9cb65090f9..74e651fa61 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/textformatter/FormatterUtil.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/textformatter/FormatterUtil.java @@ -22,6 +22,7 @@ package com.raytheon.viz.gfe.textformatter; import java.text.SimpleDateFormat; import java.util.TimeZone; +import com.raytheon.uf.common.activetable.ActiveTableMode; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.time.SimulatedTime; @@ -36,13 +37,15 @@ import com.raytheon.viz.gfe.tasks.TaskManager; * *
  * SOFTWARE HISTORY
- * Date			Ticket#		Engineer	Description
- * ------------	----------	-----------	--------------------------
- * Sep 8, 2008				njensen     Initial creation
- * Jan 15, 2010  3395       ryu         Fix "issued by" functionality
- * Sep 05, 2013  2329       randerso    Removed save of combinations file
- * Feb 12, 2014  2591       randerso    Passed dataMgr instance to FormatterUtil.runFormatterScript
- *                                      Removed call to TextProductManager.reloadModule
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Sep 8, 2008             njensen     Initial creation 
+ * Jan 15, 2010  3395      ryu         Fix "issued by" functionality
+ * Sep 05, 2013  2329      randerso    Removed save of combinations file
+ * Feb 12, 2014  2591      randerso    Passed dataMgr instance to FormatterUtil.runFormatterScript
+ *                                     Removed call to TextProductManager.reloadModule
+ * Apr 20, 2015  4027      randerso    Renamed ProductStateEnum with an initial capital
+ *                                     Fixed hard coded active table mode in runFormatterScript
  * 
  * 
* @@ -79,8 +82,12 @@ public class FormatterUtil { String vtecMode, TextProductFinishListener finish) { int testMode = 0; - if (dataMgr.getOpMode().equals(CAVEMode.TEST)) { + ActiveTableMode atMode = ActiveTableMode.OPERATIONAL; + CAVEMode caveMode = dataMgr.getOpMode(); + if (caveMode.equals(CAVEMode.TEST)) { testMode = 1; + } else if (caveMode.equals(CAVEMode.PRACTICE)) { + atMode = ActiveTableMode.PRACTICE; } String shortVtec = null; @@ -103,7 +110,6 @@ public class FormatterUtil { String varDict = productMgr.getVarDict(productName, dataMgr, dbId); if (varDict != null) { - // run the formatter with the normal active table String time = null; if (!SimulatedTime.getSystemTime().isRealTime()) { SimpleDateFormat gmtFormatter = new SimpleDateFormat( @@ -113,11 +119,11 @@ public class FormatterUtil { time = gmtFormatter.format(SimulatedTime.getSystemTime() .getTime()); } - runFormatterScript(name, shortVtec, dbId, varDict, "Operational", + runFormatterScript(name, shortVtec, dbId, varDict, atMode.name(), time, testMode, finish); } else { finish.textProductFinished("Formatter canceled", - ConfigData.productStateEnum.Finished); + ConfigData.ProductStateEnum.Finished); } } @@ -128,7 +134,7 @@ public class FormatterUtil { varDict, vtecActiveTable, drtTime, testMode, finish); // Thread thread = new Thread(formatter); // thread.start(); - finish.textProductQueued(); + finish.textProductQueued(ConfigData.ProductStateEnum.Queued); TaskManager.getInstance().queueFormatter(formatter); } diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/textformatter/TextFormatter.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/textformatter/TextFormatter.java index fb0b91ff11..b7b5bddabc 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/textformatter/TextFormatter.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/textformatter/TextFormatter.java @@ -35,7 +35,7 @@ import com.raytheon.uf.common.time.util.TimeUtil; import com.raytheon.uf.viz.core.VizApp; import com.raytheon.viz.gfe.core.DataManager; import com.raytheon.viz.gfe.dialogs.formatterlauncher.ConfigData; -import com.raytheon.viz.gfe.dialogs.formatterlauncher.ConfigData.productStateEnum; +import com.raytheon.viz.gfe.dialogs.formatterlauncher.ConfigData.ProductStateEnum; import com.raytheon.viz.gfe.sampler.SamplerGridSliceCache; import com.raytheon.viz.gfe.tasks.AbstractGfeTask; @@ -46,13 +46,14 @@ import com.raytheon.viz.gfe.tasks.AbstractGfeTask; * *
  * SOFTWARE HISTORY
- * Date         Ticket#     Engineer    Description
- * ------------ ----------  ----------- --------------------------
- * May 29, 2008             njensen     Initial creation
- * Oct 15, 2008             njensen     Split python running to
- *                                      non-UI thread
- * Dec 1, 2010    6130      ryu         Set proper state and invoke callback
- * May 29, 2014   2841      randerso    Handle failure to queue due to pending limit
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * May 29, 2008            njensen     Initial creation
+ * Oct 15, 2008            njensen     Split python running to
+ *                                     non-UI thread
+ * Dec 1, 2010    6130     ryu         Set proper state and invoke callback
+ * May 29, 2014   2841     randerso    Handle failure to queue due to pending limit
+ * Apr 20, 2015  4027      randerso    Renamed ProductStateEnum with an initial capital
  * 
  * 
* @@ -73,7 +74,7 @@ public class TextFormatter extends AbstractGfeTask { private HashMap argMap; - private ConfigData.productStateEnum state; + private ConfigData.ProductStateEnum state; /** * Constructor @@ -103,7 +104,7 @@ public class TextFormatter extends AbstractGfeTask { argMap.put(ArgDictConstants.VTEC_ACTIVE_TABLE, vtecActiveTable); argMap.put("drtTime", drtTime); listener = finish; - this.state = ConfigData.productStateEnum.Queued; + this.state = ConfigData.ProductStateEnum.Queued; } @Override @@ -114,7 +115,7 @@ public class TextFormatter extends AbstractGfeTask { VizApp.runSyncIfWorkbench(new Runnable() { @Override public void run() { - state = ConfigData.productStateEnum.Running; + state = ConfigData.ProductStateEnum.Running; listener.startProgressBar(state); } }); @@ -130,11 +131,11 @@ public class TextFormatter extends AbstractGfeTask { perfLog.logDuration("Text Formatter " + productName, timer.getElapsedTime()); - state = ConfigData.productStateEnum.Finished; + state = ConfigData.ProductStateEnum.Finished; } catch (Throwable t) { statusHandler.handle(Priority.PROBLEM, "Error generating text product", t); - state = ConfigData.productStateEnum.Failed; + state = ConfigData.ProductStateEnum.Failed; } finally { SamplerGridSliceCache.remove(this.getId()); SamplerGridSliceCache.remove(UI_THREAD_ID); @@ -149,8 +150,8 @@ public class TextFormatter extends AbstractGfeTask { VizApp.runSyncIfWorkbench(new Runnable() { @Override public void run() { - listener.textProductFinished(text, state); listener.stopProgressBar(state); + listener.textProductFinished(text, state); } }); } @@ -167,9 +168,9 @@ public class TextFormatter extends AbstractGfeTask { // TODO: this is deprecated and probably not a good thing to do. // we really need to get formatters running in their own process // so we can kill them safely - if (this.state.equals(productStateEnum.Queued) - || this.state.equals(productStateEnum.New)) { - state = ConfigData.productStateEnum.Failed; + if (this.state.equals(ProductStateEnum.Queued) + || this.state.equals(ProductStateEnum.New)) { + state = ConfigData.ProductStateEnum.Failed; cleanUp(null); this.finishedTime = SimulatedTime.getSystemTime().getTime(); diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/textformatter/TextProductFinishListener.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/textformatter/TextProductFinishListener.java index d2ed1317ca..e59b400600 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/textformatter/TextProductFinishListener.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/textformatter/TextProductFinishListener.java @@ -29,6 +29,8 @@ import com.raytheon.viz.gfe.dialogs.formatterlauncher.ConfigData; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Oct 15, 2008 njensen Initial creation + * Apr 20, 2015 4027 randerso Renamed ProductStateEnum with an initial capital + * * * * @author njensen @@ -38,12 +40,12 @@ import com.raytheon.viz.gfe.dialogs.formatterlauncher.ConfigData; public interface TextProductFinishListener { public void textProductFinished(String productText, - ConfigData.productStateEnum state); + ConfigData.ProductStateEnum state); - public void startProgressBar(ConfigData.productStateEnum state); + public void startProgressBar(ConfigData.ProductStateEnum state); - public void stopProgressBar(ConfigData.productStateEnum state); + public void stopProgressBar(ConfigData.ProductStateEnum state); - public void textProductQueued(); + public void textProductQueued(ConfigData.ProductStateEnum state); } diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/textformatter/TextProductFinishWaiter.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/textformatter/TextProductFinishWaiter.java index 876d610913..d7444a6603 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/textformatter/TextProductFinishWaiter.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/textformatter/TextProductFinishWaiter.java @@ -20,6 +20,7 @@ package com.raytheon.viz.gfe.textformatter; import com.raytheon.viz.gfe.dialogs.formatterlauncher.ConfigData; +import com.raytheon.viz.gfe.dialogs.formatterlauncher.ConfigData.ProductStateEnum; /** * Listens for a text product to finish and then returns the product with @@ -32,6 +33,7 @@ import com.raytheon.viz.gfe.dialogs.formatterlauncher.ConfigData; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Apr 30, 2009 njensen Initial creation + * Apr 20, 2015 4027 randerso Renamed ProductStateEnum with an initial capital * * * @@ -43,7 +45,7 @@ public class TextProductFinishWaiter implements TextProductFinishListener { private String product; - private boolean wait = true; + private ProductStateEnum state; /* * (non-Javadoc) @@ -53,8 +55,8 @@ public class TextProductFinishWaiter implements TextProductFinishListener { * () */ @Override - public void startProgressBar(ConfigData.productStateEnum state) { - wait = true; + public void startProgressBar(ConfigData.ProductStateEnum state) { + this.state = state; } /* @@ -65,8 +67,8 @@ public class TextProductFinishWaiter implements TextProductFinishListener { * () */ @Override - public void stopProgressBar(ConfigData.productStateEnum state) { - wait = false; + public void stopProgressBar(ConfigData.ProductStateEnum state) { + this.state = state; } /* @@ -76,8 +78,8 @@ public class TextProductFinishWaiter implements TextProductFinishListener { * textProductQueued() */ @Override - public void textProductQueued() { - wait = true; + public void textProductQueued(ConfigData.ProductStateEnum state) { + this.state = state; } /* @@ -88,16 +90,22 @@ public class TextProductFinishWaiter implements TextProductFinishListener { */ @Override public void textProductFinished(String productText, - ConfigData.productStateEnum state) { + ConfigData.ProductStateEnum state) { this.product = productText; - wait = false; + this.state = state; } public String waitAndGetProduct() throws InterruptedException { - while (wait) { - Thread.sleep(50); + while (!state.isComplete()) { + Thread.sleep(100); + } + if (state == ConfigData.ProductStateEnum.Failed) { + product = ""; } return product; } + public ConfigData.ProductStateEnum getState() { + return this.state; + } } diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/textformatter/TextProductManager.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/textformatter/TextProductManager.java index 3b94e08a17..a5ce7ed3f7 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/textformatter/TextProductManager.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/textformatter/TextProductManager.java @@ -62,6 +62,8 @@ import com.raytheon.viz.gfe.core.DataManager; * Apr 24, 2013 1936 dgilling Remove unused imports. * Feb 12, 2014 2591 randerso Removed reloadModule method * Dec 15, 2014 #14946 ryu Add getTimeZones() method. + * Apr 20, 2015 4027 randerso Made fileObservers conditional as they are not needed + * in a non-GUI environment like GFE formatter auto-tests * * * @@ -89,9 +91,9 @@ public class TextProductManager { private TextProductListener listener; - public TextProductManager() { + public TextProductManager(boolean startListener) { try { - init(); + init(startListener); } catch (VizException e) { statusHandler.handle(Priority.PROBLEM, "Exception initializing TextProductManager", e); @@ -101,7 +103,7 @@ public class TextProductManager { } } - private void init() throws VizException, JepException { + private void init(boolean startListener) throws VizException, JepException { IPathManager pm = PathManagerFactory.getPathManager(); LocalizationContext configContext = pm.getContext( LocalizationType.CAVE_STATIC, LocalizationLevel.CONFIGURED); @@ -116,10 +118,12 @@ public class TextProductManager { GfePyIncludeUtil.TEXT_PRODUCTS); lfUserDir = pm.getLocalizationFile(userContext, GfePyIncludeUtil.TEXT_PRODUCTS); - listener = new TextProductListener(); - lfConfigDir.addFileUpdatedObserver(listener); - lfSiteDir.addFileUpdatedObserver(listener); - lfUserDir.addFileUpdatedObserver(listener); + if (startListener) { + listener = new TextProductListener(); + lfConfigDir.addFileUpdatedObserver(listener); + lfSiteDir.addFileUpdatedObserver(listener); + lfUserDir.addFileUpdatedObserver(listener); + } script = FormatterScriptFactory.buildFormatterScript(); @@ -136,10 +140,10 @@ public class TextProductManager { HashMap map = new HashMap(); String paths = configDir.getPath(); - if (siteDir != null && siteDir.exists()) { + if ((siteDir != null) && siteDir.exists()) { paths = siteDir + ":" + paths; } - if (userDir != null && userDir.exists()) { + if ((userDir != null) && userDir.exists()) { paths = userDir + ":" + paths; } map.put("paths", paths); @@ -170,7 +174,7 @@ public class TextProductManager { public String getCombinationsFileName(String productName) { String filename = null; Object obj = getDefinitionValue(productName, "defaultEditAreas"); - if (obj != null && obj instanceof String) { + if ((obj != null) && (obj instanceof String)) { filename = (String) obj; } else { filename = "NONE"; @@ -181,7 +185,7 @@ public class TextProductManager { public boolean isSingleZoneSelect(String productName) { boolean isSingle = false; Object obj = getDefinitionValue(productName, "singleComboOnly"); - if (obj != null && obj instanceof Integer) { + if ((obj != null) && (obj instanceof Integer)) { if ((Integer) obj == 1) { isSingle = true; } @@ -245,12 +249,13 @@ public class TextProductManager { statusHandler.handle(Priority.PROBLEM, "Exception getting VTECMessageType", e); } + if (vtec == null) { + vtec = ""; + } return vtec; } - - public List getTimeZones(List zones, - String officeTimeZone) { + public List getTimeZones(List zones, String officeTimeZone) { List timeZones = Collections.emptyList(); HashMap map = new HashMap(2); map.put("zones", zones); @@ -259,7 +264,7 @@ public class TextProductManager { timeZones = (List) script.execute("getTimeZones", map); } catch (JepException e) { statusHandler.handle(Priority.PROBLEM, - "Exception getting time zones", e); + "Exception getting time zones", e); } return timeZones; } diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/vtec/GFEVtecUtil.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/vtec/GFEVtecUtil.java index 69d0cc4d77..a4abce70bd 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/vtec/GFEVtecUtil.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/vtec/GFEVtecUtil.java @@ -29,6 +29,7 @@ import java.util.Map; import java.util.regex.Matcher; import com.google.common.collect.ImmutableSet; +import com.raytheon.uf.common.activetable.ActiveTableMode; import com.raytheon.uf.common.activetable.response.GetNextEtnResponse; import com.raytheon.uf.common.time.TimeRange; import com.raytheon.uf.common.util.StringUtil; @@ -63,6 +64,7 @@ import com.raytheon.viz.texteditor.util.VtecUtil; * Dec 18, 2013 #2641 dgilling Force ordering of items returned by * getVtecLinesThatNeedEtn(). * Feb 05, 2014 #2774 dgilling Additional correction to previous fix. + * Apr 28, 2015 #4027 randerso Added getNextEtn parameter to specify ActiveTableMode * * * @@ -134,6 +136,33 @@ public class GFEVtecUtil { return getNextEtn(office, phensig, lockEtn, false, false, null); } + /** + * Gets the next available ETN for a specific product and office. + * + * @param office + * The 4-character site ID of the office. + * @param phensig + * The phenomenon and significance of the hazard concatenated + * with a '.' (e.g., TO.W or DU.Y) + * @param lockEtn + * Whether or not to request an exclusive ETN--if true, this will + * cause the server to increment its running ETN sequence to the + * next number after determining the next ETN for this request. + * If false, the next ETN will be returned, but it will not + * increment the server's running sequence, so the ETN return + * could be used by another client that makes a + * GetNextEtnRequest. + * @param mode + * Indicates which active table to query + * @return The next ETN in sequence, given the office and phensig. + * @throws VizException + * If an error occurred sending the request to the server. + */ + public static GetNextEtnResponse getNextEtn(String office, String phensig, + boolean lockEtn, ActiveTableMode mode) throws VizException { + return getNextEtn(office, phensig, lockEtn, false, false, null, mode); + } + /** * Gets the next available ETN for a specific product and office. * @@ -206,6 +235,50 @@ public class GFEVtecUtil { reportOnlyConflict, etnOverride); } + /** + * Gets the next available ETN for a specific product and office. + * + * @param office + * The 4-character site ID of the office. + * @param phensig + * The phenomenon and significance of the hazard concatenated + * with a '.' (e.g., TO.W or DU.Y) + * @param lockEtn + * Whether or not to request an exclusive ETN--if true, this will + * cause the server to increment its running ETN sequence to the + * next number after determining the next ETN for this request. + * If false, the next ETN will be returned, but it will not + * increment the server's running sequence, so the ETN return + * could be used by another client that makes a + * GetNextEtnRequest. + * @param performISC + * Whether or not to collaborate with neighboring sites to + * determine the next ETN. See {@link + * GetNextEtnUtil#getNextEtnFromPartners(String, ActiveTableMode, + * String, Calendar, List)} for more information. + * @param reportOnlyConflict + * Affects which kinds of errors get reported back to the + * requestor. If true, only cases where the value of + * etnOverride is less than or equal to the last ETN + * used by this site or any of its partners will be reported. + * Else, all significant errors will be reported back. + * @param etnOverride + * Allows the user to influence the next ETN assigned by using + * this value unless it is less than or equal to the last ETN + * used by this site or one of its partners. + * @param mode + * Indicates which active table to query + * @return The next ETN in sequence, given the office and phensig. + * @throws VizException + * If an error occurred sending the request to the server. + */ + public static GetNextEtnResponse getNextEtn(String office, String phensig, + boolean lockEtn, boolean performISC, boolean reportOnlyConflict, + Integer etnOverride, ActiveTableMode mode) throws VizException { + return VtecUtil.getNextEtn(office, phensig, lockEtn, performISC, + reportOnlyConflict, etnOverride, mode); + } + /** * Reads through a GFE VTEC product and returns VTEC lines with NEW action * codes that need to be assigned an ETN. diff --git a/cave/com.raytheon.viz.ghg/src/com/raytheon/viz/ghg/monitor/data/GhgData.java b/cave/com.raytheon.viz.ghg/src/com/raytheon/viz/ghg/monitor/data/GhgData.java index d2bcada5b8..a991e4ecf9 100644 --- a/cave/com.raytheon.viz.ghg/src/com/raytheon/viz/ghg/monitor/data/GhgData.java +++ b/cave/com.raytheon.viz.ghg/src/com/raytheon/viz/ghg/monitor/data/GhgData.java @@ -48,6 +48,7 @@ import com.raytheon.viz.ghg.monitor.data.GhgConfigData.SelectionEnum; * ------------ ---------- ----------- -------------------------- * 25 MAR 2008 N/A lvenable Initial creation * 30 JUL 2010 6721 mpduff WFO now from officeid column. + * 28 APR 2015 4027 randerso Expunged Calendar from ActiveTableRecord * * * @@ -234,13 +235,13 @@ public class GhgData implements Comparable { sig = warning.getSig(); hazard = getHazardDescription(getPhenSig()); try { - startDate = warning.getStartTime().getTime(); + startDate = warning.getStartTime(); } catch (Exception e) { startDate = now; } - endDate = warning.getEndTime().getTime(); - purgeDate = warning.getPurgeTime().getTime(); - issueTime = warning.getIssueTime().getTime(); + endDate = warning.getEndTime(); + purgeDate = warning.getPurgeTime(); + issueTime = warning.getIssueTime(); pil = warning.getPil(); segNum = String.valueOf(warning.getSeg()); wfo = warning.getOfficeid(); @@ -933,7 +934,7 @@ public class GhgData implements Comparable { @Override public int hashCode() { int hash = 1; - hash = hash * 31 + hazard.hashCode(); + hash = (hash * 31) + hazard.hashCode(); return hash; } diff --git a/cave/com.raytheon.viz.satellite/src/com/raytheon/viz/satellite/inventory/DerivedSatelliteRecord.java b/cave/com.raytheon.viz.satellite/src/com/raytheon/viz/satellite/inventory/DerivedSatelliteRecord.java index 713a6a4694..e88290e887 100644 --- a/cave/com.raytheon.viz.satellite/src/com/raytheon/viz/satellite/inventory/DerivedSatelliteRecord.java +++ b/cave/com.raytheon.viz.satellite/src/com/raytheon/viz/satellite/inventory/DerivedSatelliteRecord.java @@ -19,11 +19,15 @@ **/ package com.raytheon.viz.satellite.inventory; +import java.awt.Point; import java.awt.Rectangle; import java.util.Collections; +import java.util.HashMap; import java.util.HashSet; +import java.util.Map; import java.util.Set; +import javax.measure.unit.Unit; import javax.measure.unit.UnitFormat; import org.geotools.coverage.grid.GridEnvelope2D; @@ -33,11 +37,15 @@ import org.opengis.referencing.operation.TransformException; import com.raytheon.uf.common.dataplugin.satellite.SatMapCoverage; import com.raytheon.uf.common.dataplugin.satellite.SatelliteRecord; +import com.raytheon.uf.common.dataplugin.satellite.units.generic.GenericPixel; import com.raytheon.uf.common.datastorage.DataStoreFactory; import com.raytheon.uf.common.datastorage.Request; +import com.raytheon.uf.common.datastorage.records.ByteDataRecord; +import com.raytheon.uf.common.datastorage.records.IDataRecord; import com.raytheon.uf.common.geospatial.interpolation.GridDownscaler; import com.raytheon.uf.common.inventory.data.AbstractRequestableData; import com.raytheon.uf.common.inventory.exception.DataCubeException; +import com.raytheon.viz.satellite.tileset.SatDataRetriever; /** * Satellite record which performs derived parameter calculations to get data @@ -50,6 +58,7 @@ import com.raytheon.uf.common.inventory.exception.DataCubeException; * Date Ticket# Engineer Description * ------------- -------- ----------- -------------------------- * Apr 09, 2014 2947 bsteffen Initial creation + * Apr 15, 2014 4388 bsteffen Set Fill Value. * * * @@ -134,15 +143,56 @@ public class DerivedSatelliteRecord extends SatelliteRecord { throw new DataCubeException(e); } gridGeometry = new GridGeometry2D(range, env); + } else if (req.getType() == Request.Type.POINT + && req.getPoints().length == 1) { + Point p = req.getPoints()[0]; + GridEnvelope2D range = new GridEnvelope2D(p.x, p.y, 1, 1); + Envelope env; + try { + env = gridGeometry.gridToWorld(range); + } catch (TransformException e) { + throw new DataCubeException(e); + } + gridGeometry = new GridGeometry2D(range, env); } else if (req.getType() != Request.Type.ALL) { throw new DataCubeException( "Unsupported request type for derived satellite data: " + req.getType()); } Object dataValue = requestableData.getDataValue(gridGeometry); + setDerivedFillValue(dataValue); setMessageData(dataValue); } + /** + * Set a fill value on the dataValue if applicable. Some derived parameters + * operate on unsigned byte data and return signed byte data and need a fill + * value set to composite properly. + */ + private void setDerivedFillValue(Object dataValue) { + IDataRecord dataRecord = null; + if (dataValue instanceof IDataRecord[]) { + IDataRecord[] dataRecords = (IDataRecord[]) dataValue; + if (dataRecords.length == 1) { + dataRecord = dataRecords[0]; + } + } else if (dataValue instanceof IDataRecord) { + dataRecord = (IDataRecord) dataValue; + } + if (dataRecord instanceof ByteDataRecord) { + Unit unit = SatDataRetriever.getRecordUnit(this); + if (unit instanceof GenericPixel) { + dataRecord.setFillValue(Byte.MIN_VALUE); + Map attributes = dataRecord.getDataAttributes(); + if (attributes == null) { + attributes = new HashMap(); + } + attributes.put(SatelliteRecord.SAT_SIGNED_FLAG, Boolean.TRUE); + dataRecord.setDataAttributes(attributes); + } + } + } + private static Set findBaseRecords( AbstractRequestableData data) { if (data instanceof SatelliteRequestableData) { diff --git a/cave/com.raytheon.viz.satellite/src/com/raytheon/viz/satellite/inventory/SatelliteRequestableData.java b/cave/com.raytheon.viz.satellite/src/com/raytheon/viz/satellite/inventory/SatelliteRequestableData.java index bf1754d39d..8246dce879 100644 --- a/cave/com.raytheon.viz.satellite/src/com/raytheon/viz/satellite/inventory/SatelliteRequestableData.java +++ b/cave/com.raytheon.viz.satellite/src/com/raytheon/viz/satellite/inventory/SatelliteRequestableData.java @@ -21,7 +21,6 @@ package com.raytheon.viz.satellite.inventory; import java.awt.Point; import java.awt.Rectangle; -import java.util.Map; import javax.measure.unit.Unit; @@ -61,6 +60,7 @@ import com.raytheon.viz.satellite.tileset.SatDataRetriever; * Date Ticket# Engineer Description * ------------- -------- ----------- -------------------------- * Apr 09, 2014 2947 bsteffen Initial creation + * Apr 15, 2014 4388 bsteffen Set Fill Value. * * * @@ -153,20 +153,13 @@ public class SatelliteRequestableData extends AbstractRequestableData { } catch (FactoryException e) { throw new DataCubeException(e); } - Map attrs = dataRecord.getDataAttributes(); + Number fillValue = dataRecord.getFillValue(); dataRecord = DataStoreFactory.createStorageRecord( dataRecord.getName(), dataRecord.getGroup(), dest.getArray(), 2, new long[] { requestRange.width, requestRange.height }); - dataRecord.setFillValue(0); - if (attrs != null) { - Number fill = (Number) attrs - .get(SatelliteRecord.SAT_FILL_VALUE); - if (fill != null) { - dataRecord.setFillValue(fill); - } - } + dataRecord.setFillValue(fillValue); return dataRecord; } else { return CubeUtil.retrieveData(record, record.getPluginName(), diff --git a/cave/com.raytheon.viz.satellite/src/com/raytheon/viz/satellite/rsc/SatResource.java b/cave/com.raytheon.viz.satellite/src/com/raytheon/viz/satellite/rsc/SatResource.java index f3ecae6399..9bdb9578f2 100644 --- a/cave/com.raytheon.viz.satellite/src/com/raytheon/viz/satellite/rsc/SatResource.java +++ b/cave/com.raytheon.viz.satellite/src/com/raytheon/viz/satellite/rsc/SatResource.java @@ -38,6 +38,8 @@ import org.opengis.referencing.FactoryException; import org.opengis.referencing.crs.CoordinateReferenceSystem; import org.opengis.referencing.operation.TransformException; +import com.raytheon.uf.common.colormap.ColorMapException; +import com.raytheon.uf.common.colormap.ColorMapLoader; import com.raytheon.uf.common.colormap.IColorMap; import com.raytheon.uf.common.colormap.prefs.ColorMapParameters; import com.raytheon.uf.common.colormap.prefs.ColorMapParameters.PersistedParameters; @@ -45,10 +47,16 @@ import com.raytheon.uf.common.colormap.prefs.DataMappingPreferences; import com.raytheon.uf.common.dataplugin.PluginDataObject; import com.raytheon.uf.common.dataplugin.satellite.SatMapCoverage; import com.raytheon.uf.common.dataplugin.satellite.SatelliteRecord; -import com.raytheon.uf.common.dataplugin.satellite.units.generic.GenericPixel; +import com.raytheon.uf.common.datastorage.DataStoreFactory; +import com.raytheon.uf.common.datastorage.Request; +import com.raytheon.uf.common.datastorage.records.ByteDataRecord; +import com.raytheon.uf.common.datastorage.records.IDataRecord; +import com.raytheon.uf.common.datastorage.records.ShortDataRecord; import com.raytheon.uf.common.geospatial.IGridGeometryProvider; import com.raytheon.uf.common.geospatial.ReferencedCoordinate; import com.raytheon.uf.common.geospatial.data.GeographicDataSource; +import com.raytheon.uf.common.inventory.exception.DataCubeException; +import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.common.style.ParamLevelMatchCriteria; import com.raytheon.uf.common.style.StyleException; import com.raytheon.uf.common.style.StyleManager; @@ -62,7 +70,6 @@ import com.raytheon.uf.common.style.level.SingleLevel; import com.raytheon.uf.common.time.DataTime; import com.raytheon.uf.viz.core.DrawableImage; import com.raytheon.uf.viz.core.IGraphicsTarget; -import com.raytheon.uf.viz.core.drawables.ColorMapLoader; import com.raytheon.uf.viz.core.drawables.IRenderable; import com.raytheon.uf.viz.core.drawables.PaintProperties; import com.raytheon.uf.viz.core.drawables.ext.IImagingExtension.ImageProvider; @@ -79,6 +86,7 @@ import com.raytheon.uf.viz.core.rsc.interrogation.InterrogateMap; import com.raytheon.uf.viz.core.rsc.interrogation.InterrogationKey; import com.raytheon.uf.viz.core.rsc.interrogation.Interrogator; import com.raytheon.uf.viz.core.rsc.interrogation.StringInterrogationKey; +import com.raytheon.uf.viz.datacube.DataCubeContainer; import com.raytheon.viz.satellite.SatelliteConstants; import com.raytheon.viz.satellite.inventory.DerivedSatelliteRecord; import com.raytheon.viz.satellite.tileset.SatDataRetriever; @@ -127,7 +135,7 @@ import com.raytheon.viz.awipstools.IToolChangedListener; * Oct 15, 2014 3681 bsteffen create renderable in interrogate if necessary. * Feb 17, 2015 4135 bsteffen Set no data value for derived products. * Mar 3, 2015 DCS 14960 jgerth Retrieve legend from style rules if available - * + * Apr 15, 2014 4388 bsteffen Use fill value from record. * * * @@ -333,6 +341,57 @@ public class SatResource extends cmName = colorMapParameters.getColorMapName(); } } + Unit unit = SatDataRetriever.getRecordUnit(record); + + + /* + * TODO default to NaN instead of 0. 0 is the default to support older + * data(before the gini decoder set a fill value), when all decoders and + * all decoded data has a proper fill value this should be changed to + * Double.NaN. + */ + double fillValue = 0; + double defaultMin = 0; + double defaultMax = 0xff; + try { + String dataSetName = DataStoreFactory.createDataSetName(null, + SatelliteRecord.SAT_DATASET_NAME, 0); + IDataRecord dataRecord = DataCubeContainer.getDataRecord(record, + Request.buildPointRequest(new java.awt.Point(0, 0)), + dataSetName)[0]; + Number fillObj = dataRecord.getFillValue(); + if (fillObj != null) { + fillValue = fillObj.doubleValue(); + } + if (dataRecord instanceof ShortDataRecord) { + if (SatDataRetriever.isSigned(dataRecord)) { + defaultMin = Short.MIN_VALUE; + defaultMax = Short.MAX_VALUE; + } else { + defaultMin = 0; + defaultMax = 0xFFFF; + fillValue = ((int) fillValue) & 0xFFFF; + } + } else if (dataRecord instanceof ByteDataRecord) { + if (SatDataRetriever.isSigned(dataRecord)) { + defaultMin = Byte.MIN_VALUE; + defaultMax = Byte.MAX_VALUE; + } else { + defaultMin = 0; + defaultMax = 0xFF; + fillValue = ((int) fillValue) & 0xFF; + } + } + Unit dataUnit = SatDataRetriever.getDataUnit(unit, dataRecord); + if (dataUnit != null && unit != null && dataUnit.isCompatible(unit)) { + UnitConverter converter = dataUnit.getConverterTo(unit); + defaultMin = converter.convert(defaultMin); + defaultMax = converter.convert(defaultMax); + } + } catch (DataCubeException e) { + statusHandler.handle(Priority.WARN, + "Unable to request sample record", e); + } SingleLevel level = new SingleLevel(Level.LevelType.SURFACE); String physicalElement = record.getPhysicalElement(); @@ -342,7 +401,6 @@ public class SatResource extends match.setParameterName(Arrays.asList(physicalElement)); match.setLevels(Arrays.asList((Level) level)); match.setCreatingEntityNames(Arrays.asList(record.getCreatingEntity())); - Unit unit = SatDataRetriever.getRecordUnit(record); String lg = null; try { StyleRule sr = StyleManager.getInstance().getStyleRule( @@ -360,8 +418,8 @@ public class SatResource extends } DataScale range = new DataScale(); range.setScaleType(DataScale.Type.LINEAR); - range.setMinValue(0.0); - range.setMaxValue(255.0); + range.setMinValue(defaultMin); + range.setMaxValue(defaultMax); preferences.setDataScale(range); } else { preferences = (ImagePreferences) sr.getPreferences(); @@ -392,7 +450,11 @@ public class SatResource extends if (cmName == null) { cmName = "Sat/VIS/ZA (Vis Default)"; } - colorMap = ColorMapLoader.loadColorMap(cmName); + try { + colorMap = ColorMapLoader.loadColorMap(cmName); + } catch (ColorMapException e) { + throw new VizException("Unable to load clormap: " + cmName, e); + } } if (colorMap != null) { @@ -402,18 +464,9 @@ public class SatResource extends if (persisted != null) { colorMapParameters.applyPersistedParameters(persisted); } - if (colorMapParameters.getDataMapping() == null) { - if (unit instanceof GenericPixel) { - /** - * Generic Pixel only comes from derived parameter which used - * signed data so 0 is valid but -128 is used as a no data - * value. - */ - colorMapParameters.setNoDataValue(Byte.MIN_VALUE); - } else { - colorMapParameters.setNoDataValue(0); - } + if (colorMapParameters.getDataMapping() == null) { + colorMapParameters.setNoDataValue(fillValue); } getCapability(ColorMapCapability.class).setColorMapParameters( diff --git a/cave/com.raytheon.viz.satellite/src/com/raytheon/viz/satellite/tileset/SatDataRetriever.java b/cave/com.raytheon.viz.satellite/src/com/raytheon/viz/satellite/tileset/SatDataRetriever.java index 3b6d20dd7e..68818c28ae 100644 --- a/cave/com.raytheon.viz.satellite/src/com/raytheon/viz/satellite/tileset/SatDataRetriever.java +++ b/cave/com.raytheon.viz.satellite/src/com/raytheon/viz/satellite/tileset/SatDataRetriever.java @@ -34,7 +34,6 @@ import javax.measure.unit.UnitFormat; import com.raytheon.uf.common.colormap.image.ColorMapData; import com.raytheon.uf.common.colormap.image.ColorMapData.ColorMapDataType; import com.raytheon.uf.common.dataplugin.satellite.SatelliteRecord; -import com.raytheon.uf.common.dataplugin.satellite.units.generic.GenericPixel; import com.raytheon.uf.common.dataplugin.satellite.units.goes.PolarPrecipWaterPixel; import com.raytheon.uf.common.dataplugin.satellite.units.water.BlendedTPWPixel; import com.raytheon.uf.common.datastorage.DataStoreFactory; @@ -66,6 +65,7 @@ import com.raytheon.viz.satellite.SatelliteConstants; * data record attributes for unit * Apr 09, 2014 2947 bsteffen Improve flexibility of sat derived * parameters. + * Apr 15, 2014 4388 bsteffen Add method to get signed vs. unsigned from data record. * * * @@ -118,7 +118,7 @@ public class SatDataRetriever implements IColorMapDataRetrievalCallback { data = FloatBuffer.wrap((float[]) record.getDataObject()); } Unit recordUnit = getRecordUnit(this.record); - signed = recordUnit instanceof GenericPixel; + signed = isSigned(record); dataUnit = getDataUnit(recordUnit, record); } } catch (DataCubeException e) { @@ -209,6 +209,18 @@ public class SatDataRetriever implements IColorMapDataRetrievalCallback { return units; } + public static boolean isSigned(IDataRecord record) { + Map attrs = record.getDataAttributes(); + if (attrs != null) { + Boolean signed = (Boolean) attrs + .get(SatelliteRecord.SAT_SIGNED_FLAG); + if (signed != null && signed) { + return true; + } + } + return false; + } + /* * (non-Javadoc) * diff --git a/cave/com.raytheon.viz.satellite/src/com/raytheon/viz/satellite/tileset/SatTileSetRenderable.java b/cave/com.raytheon.viz.satellite/src/com/raytheon/viz/satellite/tileset/SatTileSetRenderable.java index 093245393d..a681489ce5 100644 --- a/cave/com.raytheon.viz.satellite/src/com/raytheon/viz/satellite/tileset/SatTileSetRenderable.java +++ b/cave/com.raytheon.viz.satellite/src/com/raytheon/viz/satellite/tileset/SatTileSetRenderable.java @@ -35,10 +35,14 @@ import org.opengis.coverage.grid.GridEnvelope; import org.opengis.referencing.operation.TransformException; import com.raytheon.uf.common.colormap.image.ColorMapData; +import com.raytheon.uf.common.colormap.image.ColorMapData.ColorMapDataType; import com.raytheon.uf.common.colormap.prefs.ColorMapParameters; import com.raytheon.uf.common.dataplugin.satellite.SatelliteRecord; import com.raytheon.uf.common.geospatial.data.GeographicDataSource; import com.raytheon.uf.common.numeric.buffer.BufferWrapper; +import com.raytheon.uf.common.numeric.buffer.ByteBufferWrapper; +import com.raytheon.uf.common.numeric.buffer.ShortBufferWrapper; +import com.raytheon.uf.common.numeric.filter.UnsignedFilter; import com.raytheon.uf.common.numeric.source.DataSource; import com.raytheon.uf.viz.core.DrawableImage; import com.raytheon.uf.viz.core.IGraphicsTarget; @@ -60,12 +64,13 @@ import com.vividsolutions.jts.geom.Coordinate; * * SOFTWARE HISTORY * - * Date Ticket# Engineer Description - * ------------ ---------- ----------- -------------------------- - * Jun 19, 2013 mschenke Initial creation - * Jun 19, 2014 3238 bsteffen Add method to create a DataSource for - * a tile level. - * Oct 15, 2014 3681 bsteffen Allow asynchronous interrogation. + * Date Ticket# Engineer Description + * ------------- -------- ----------- -------------------------- + * Jun 19, 2013 mschenke Initial creation + * Jun 19, 2014 3238 bsteffen Add method to create a DataSource for + * a tile level. + * Oct 15, 2014 3681 bsteffen Allow asynchronous interrogation. + * May 04, 2015 4426 bsteffen Fix unsigned interrogation. * * * @@ -248,6 +253,11 @@ public class SatTileSetRenderable extends RecordTileSetRenderable { Rectangle rect = tile.getRectangle(); DataSource source = BufferWrapper.wrap(data.getBuffer(), rect.width, rect.height); + if (data.getDataType() == ColorMapDataType.BYTE) { + source = UnsignedFilter.apply((ByteBufferWrapper) source); + } else if (data.getDataType() == ColorMapDataType.UNSIGNED_SHORT) { + source = UnsignedFilter.apply((ShortBufferWrapper) source); + } dataValue = source.getDataValue(tilex, tiley); dataUnit = data.getDataUnit(); } diff --git a/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/notify/NotifyExpirationTask.java b/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/notify/NotifyExpirationTask.java index ae6544d3eb..a454384204 100644 --- a/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/notify/NotifyExpirationTask.java +++ b/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/notify/NotifyExpirationTask.java @@ -33,6 +33,7 @@ import com.raytheon.uf.common.activetable.GetActiveTableResponse; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus.Priority; +import com.raytheon.uf.common.time.util.TimeUtil; import com.raytheon.uf.viz.core.exception.VizException; import com.raytheon.uf.viz.core.requests.ThriftClient; import com.raytheon.viz.core.mode.CAVEMode; @@ -52,6 +53,7 @@ import com.raytheon.viz.ui.dialogs.SWTMessageBox; * tables names. * Dec 20, 2010 7210 cjeanbap Added non-blocking dialog. * Apr 25, 2014 DR 16668 D. Friedman Handle partial cancellations + * Apr 28, 2015 4027 randerso Expunged Calendar from ActiveTableRecord * * * @author jsanchez @@ -65,7 +67,7 @@ public class NotifyExpirationTask extends TimerTask { /** * Miliseconds in two days */ - private static final long TWO_DAYS = 48 * 60 * 60 * 1000; + private static final long TWO_DAYS = 2 * TimeUtil.MILLIS_PER_DAY; private String office; @@ -90,9 +92,11 @@ public class NotifyExpirationTask extends TimerTask { + dateFormat.format(vtecObject.getEndTime().getTime()); } + @Override public void run() { if (!isCanceled()) { parentShell.getDisplay().asyncExec(new Runnable() { + @Override public void run() { SWTMessageBox mb = new SWTMessageBox( NotifyExpirationTask.this.parentShell, @@ -126,8 +130,8 @@ public class NotifyExpirationTask extends TimerTask { activeTable = resp.getActiveTable(); } catch (VizException e) { statusHandler.handle(Priority.ERROR, - "Error querying active table for " + office + "." - + phenSig + "." + etn, e); + "Error querying active table for " + office + "." + phenSig + + "." + etn, e); } if (activeTable != null) { @@ -135,16 +139,17 @@ public class NotifyExpirationTask extends TimerTask { for (ActiveTableRecord record : activeTable) { if (record != null) { /* - * textNotifyExpiration.tcl ln 106: If any of the found products are - * less than 48 hours old,return true. + * textNotifyExpiration.tcl ln 106: If any of the found + * products are less than 48 hours old,return true. */ if ("CAN".equals(record.getAct()) - && (System.currentTimeMillis() - - record.getIssueTime().getTimeInMillis() < TWO_DAYS)) { + && ((System.currentTimeMillis() - record + .getIssueTime().getTime()) < TWO_DAYS)) { haveCAN = true; } else if ("CON".equals(record.getAct())) { - /* If there CANs and the event is still active, there - * should be some CONs. Thus, it is not necessary to + /* + * If there CANs and the event is still active, there + * should be some CONs. Thus, it is not necessary to * check for every other kind of non-terminal action. */ return false; @@ -160,7 +165,7 @@ public class NotifyExpirationTask extends TimerTask { private String pad(int value) { String rval = ""; String str = Integer.toString(value); - for (int i = 0; i < 4 - str.length(); i++) { + for (int i = 0; i < (4 - str.length()); i++) { rval += "0"; } diff --git a/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/util/VtecUtil.java b/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/util/VtecUtil.java index e684f77051..653d6f6a36 100644 --- a/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/util/VtecUtil.java +++ b/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/util/VtecUtil.java @@ -20,6 +20,7 @@ package com.raytheon.viz.texteditor.util; import java.util.Calendar; +import java.util.Date; import java.util.GregorianCalendar; import java.util.TimeZone; import java.util.regex.Matcher; @@ -46,6 +47,9 @@ import com.raytheon.viz.core.mode.CAVEMode; * May 08, 2013 #1842 dgilling Code cleanup. * Aug 29, 2013 #1843 dgilling Use new GetNextEtnRequest constructor. * Oct 21, 2013 #1843 dgilling Use new GetNextEtnResponse. + * Apr 28, 2015 #4027 randerso Expunged Calendar from ActiveTableRecord + * Added getNextEtn method with parameter to specify + * activeTableMode * * * @@ -103,7 +107,7 @@ public class VtecUtil { return message; } VtecObject vtec = parseMessage(message); - if (vtec == null || vtec.getAction() == null) { + if ((vtec == null) || (vtec.getAction() == null)) { return message; } @@ -181,13 +185,57 @@ public class VtecUtil { public static GetNextEtnResponse getNextEtn(String office, String phensig, boolean lockEtn, boolean performISC, boolean reportOnlyConflict, Integer etnOverride) throws VizException { - Calendar currentTime = Calendar.getInstance(); - currentTime.setTime(SimulatedTime.getSystemTime().getTime()); - ActiveTableMode activeTable = (CAVEMode.getMode() - .equals(CAVEMode.PRACTICE)) ? ActiveTableMode.PRACTICE + ActiveTableMode mode = (CAVEMode.getMode().equals(CAVEMode.PRACTICE)) ? ActiveTableMode.PRACTICE : ActiveTableMode.OPERATIONAL; - GetNextEtnRequest req = new GetNextEtnRequest(office, activeTable, - phensig, currentTime, lockEtn, performISC, reportOnlyConflict, + + return getNextEtn(office, phensig, lockEtn, performISC, + reportOnlyConflict, etnOverride, mode); + } + + /** + * Gets the next available ETN for a specific product and office. + * + * @param office + * The 4-character site ID of the office. + * @param phensig + * The phenomenon and significance of the hazard concatenated + * with a '.' (e.g., TO.W or DU.Y) + * @param lockEtn + * Whether or not to request an exclusive ETN--if true, this will + * cause the server to increment its running ETN sequence to the + * next number after determining the next ETN for this request. + * If false, the next ETN will be returned, but it will not + * increment the server's running sequence, so the ETN return + * could be used by another client that makes a + * GetNextEtnRequest. + * @param performISC + * Whether or not to collaborate with neighboring sites to + * determine the next ETN. See {@link + * GetNextEtnUtil#getNextEtnFromPartners(String, ActiveTableMode, + * String, Calendar, List)} for more information. + * @param reportOnlyConflict + * Affects which kinds of errors get reported back to the + * requestor. If true, only cases where the value of + * etnOverride is less than or equal to the last ETN + * used by this site or any of its partners will be reported. + * Else, all significant errors will be reported back. + * @param etnOverride + * Allows the user to influence the next ETN assigned by using + * this value unless it is less than or equal to the last ETN + * used by this site or one of its partners. + * @param mode + * Indicates which active table to query + * @return The next ETN in sequence, given the office and phensig. + * @throws VizException + * If an error occurs while submitting or processing the remote + * request. + */ + public static GetNextEtnResponse getNextEtn(String office, String phensig, + boolean lockEtn, boolean performISC, boolean reportOnlyConflict, + Integer etnOverride, ActiveTableMode mode) throws VizException { + Date currentTime = SimulatedTime.getSystemTime().getTime(); + GetNextEtnRequest req = new GetNextEtnRequest(office, mode, phensig, + currentTime, lockEtn, performISC, reportOnlyConflict, etnOverride); GetNextEtnResponse resp = (GetNextEtnResponse) ThriftClient @@ -197,6 +245,13 @@ public class VtecUtil { return rval; } + /** + * Parse a VTEC message + * + * @param message + * the message + * @return the parsed VtecObject + */ public static VtecObject parseMessage(String message) { VtecObject rval = null; Matcher m = VTEC_REGEX.matcher(message); @@ -215,7 +270,7 @@ public class VtecUtil { * * @param message * the message to modify - * @param obj + * @param vtec * new VTEC for the message * * @return the modified message 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 757367d682..eeb8e77e25 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 @@ -85,6 +85,7 @@ import com.vividsolutions.jts.geom.Polygon; * /missing (part of state, state abbreviation) which resulted from * extension of a watch to counties which are of same/different fe_area. * Sep 25, 2014 ASM #16783 D. Friedman Do not use VTEC action to determine Watch uniqueness. + * Apr 28, 2015 RODO #4027 randerso Expunged Calendar from ActiveTableRecord * * * @author jsanchez @@ -324,12 +325,12 @@ public class WatchUtil { * fixed the underlying system. request.addConstraint("act", new * RequestConstraint("CAN", ConstraintType.NOT_EQUALS)); */ - if (action != WarningAction.CAN && action != WarningAction.EXP) { + if ((action != WarningAction.CAN) && (action != WarningAction.EXP)) { ActiveTableRecord record = entityClass.newInstance(); - record.setIssueTime((Calendar) result.get(ISSUE_TIME_FIELD)); - record.setStartTime((Calendar) result.get(START_TIME_FIELD)); - record.setEndTime((Calendar) result.get(END_TIME_FIELD)); - record.setEndTime((Calendar) result.get(END_TIME_FIELD)); + record.setIssueTime((Date) result.get(ISSUE_TIME_FIELD)); + record.setStartTime((Date) result.get(START_TIME_FIELD)); + record.setEndTime((Date) result.get(END_TIME_FIELD)); + record.setEndTime((Date) result.get(END_TIME_FIELD)); record.setUgcZone(String.valueOf(result.get(UGC_ZONE_FIELD))); record.setPhensig(String.valueOf(result.get(PHEN_SIG_FIELD))); record.setEtn(String.valueOf(result.get(ETN))); @@ -348,10 +349,12 @@ public class WatchUtil { } } - // remove ActiveTableRecord from records whose etn, ugcZone, and phensig is same as - // canceled or expired. + /* + * remove ActiveTableRecord from records whose etn, ugcZone, and phensig + * is same as canceled or expired. + */ String etn, ugczone, phensig; - for (Pair etnPhensig: removedUgczones.keySet()) { + for (Pair etnPhensig : removedUgczones.keySet()) { ugczones = removedUgczones.get(etnPhensig); etn = etnPhensig.getFirst(); phensig = etnPhensig.getSecond(); @@ -361,8 +364,9 @@ public class WatchUtil { Iterator iterator = records.iterator(); while (iterator.hasNext()) { ActiveTableRecord atr = iterator.next(); - if (atr.getEtn().equals(etn) && atr.getUgcZone().equals(ugczone) && - atr.getPhensig().equals(phensig)) { + if (atr.getEtn().equals(etn) + && atr.getUgcZone().equals(ugczone) + && atr.getPhensig().equals(phensig)) { iterator.remove(); } } @@ -371,9 +375,12 @@ public class WatchUtil { Collections.sort(records, PEUI); - // Filters out extra ActiveTableRecords that have same phenSig, etn, and ugcZone. + /* + * Filters out extra ActiveTableRecords that have same phenSig, etn, and + * ugcZone. + */ Map atrMap = new LinkedHashMap(); - for (ActiveTableRecord atr: records) { + for (ActiveTableRecord atr : records) { String key = atr.getPhensig() + atr.getEtn() + atr.getUgcZone(); atrMap.put(key, atr); } @@ -419,7 +426,7 @@ public class WatchUtil { String ugcZone = ar.getUgcZone(); String state = null; - if (marineUgcs != null && marineUgcs.contains(ugcZone)) { + if ((marineUgcs != null) && marineUgcs.contains(ugcZone)) { // Just leave state == null } else { state = getStateName(ugcZone.substring(0, 2)); @@ -430,12 +437,11 @@ public class WatchUtil { String phenSig = ar.getPhensig(); String etn = ar.getEtn(); - Date startTime = ar.getStartTime().getTime(); - Date endTime = ar.getEndTime().getTime(); + Date startTime = ar.getStartTime(); + Date endTime = ar.getEndTime(); if (validUgcZones.contains(ugcZone)) { - Watch watch = new Watch(state, phenSig, etn, startTime, - endTime); + Watch watch = new Watch(state, phenSig, etn, startTime, endTime); List areas = map.get(watch); if (areas == null) { areas = new ArrayList(); @@ -460,9 +466,9 @@ public class WatchUtil { } } - /* Sorts the watches based on ETN, then state. Marine areas - * have a null state value so they appear at the end of each - * watch. + /* + * Sorts the watches based on ETN, then state. Marine areas have a null + * state value so they appear at the end of each watch. */ Collections.sort(watches, new Comparator() { @@ -471,37 +477,44 @@ public class WatchUtil { String etn1 = watch1.getEtn(); String etn2 = watch2.getEtn(); int c; - if (etn1 == etn2) + if (etn1 == etn2) { c = 0; - else if (etn1 == null) + } else if (etn1 == null) { return 1; - else if (etn2 == null) + } else if (etn2 == null) { return -1; - else + } else { c = etn1.compareTo(etn2); - if (c != 0) + } + if (c != 0) { return c; + } String state1 = watch1.getState(); String state2 = watch2.getState(); - if (state1 == state2) + if (state1 == state2) { return 0; - else if (state1 == null) + } else if (state1 == null) { return 1; // null state is greater; put at end - else if (state2 == null) + } else if (state2 == null) { return -1; - else + } else { return state1.compareTo(state2); + } } }); - // Filters out extra Watches that have different startTime but same phenSig, etn, state, partOfState, endTime, and marineArea. + /* + * Filters out extra Watches that have different startTime but same + * phenSig, etn, state, partOfState, endTime, and marineArea. + */ Map watchMap = new LinkedHashMap(); - for (Watch w: watches) { - List pos = w.getPartOfState() != null ? - new ArrayList(w.getPartOfState()) : null; - if (pos != null) + for (Watch w : watches) { + List pos = w.getPartOfState() != null ? new ArrayList( + w.getPartOfState()) : null; + if (pos != null) { Collections.sort(pos); + } String key = String.valueOf(w.getPhenSig()) + String.valueOf(w.getEtn()) + String.valueOf(w.getState()) + String.valueOf(pos) + String.valueOf(w.getEndTime()); @@ -540,9 +553,10 @@ public class WatchUtil { return affectedPortions; } - private List generateMarineWatchItems(Watch template, List areas) { + private List generateMarineWatchItems(Watch template, + List areas) { ArrayList result = new ArrayList(); - for (String area: areas) { + for (String area : areas) { Watch watch = new Watch(template.getState(), template.getPhenSig(), template.getEtn(), template.getStartTime(), template.getEndTime()); @@ -553,7 +567,7 @@ public class WatchUtil { } private List determineMarineAreas(List areas) { - HashSet> groupedAreas = new HashSet>(); + HashSet> groupedAreas = new HashSet>(); for (String area : areas) { int entryIndex = 0; for (MarineWordingEntry entry : marineWordingConfig.getEntries()) { @@ -573,9 +587,12 @@ public class WatchUtil { entryIndex++; } } - ArrayList> sorted = new ArrayList>(groupedAreas); + ArrayList> sorted = new ArrayList>( + groupedAreas); Collections.sort(sorted, new Comparator>() { - public int compare(Pair o1, Pair o2) { + @Override + public int compare(Pair o1, + Pair o2) { int r = o1.getFirst().compareTo(o2.getFirst()); return r != 0 ? r : o1.getSecond().compareTo(o2.getSecond()); }; @@ -702,7 +719,7 @@ public class WatchUtil { if (((nn > 0) && (ss > 0)) || ((ee > 0) && (ww > 0))) { return abrev; } - if (nnn + sss + eee + www == 3) { + if ((nnn + sss + eee + www) == 3) { if (www == 0) { abrev = "e"; } else if (eee == 0) { @@ -724,7 +741,7 @@ public class WatchUtil { return abrev; } } - if (m == 1 + cc) { + if (m == (1 + cc)) { abrev += partAbrev + " "; return abrev; } diff --git a/deltaScripts/15.1.1/DR4260/changeDefaultModel.sh b/deltaScripts/15.1.1/DR4260/changeDefaultModel.sh new file mode 100644 index 0000000000..6f8fbcfb36 --- /dev/null +++ b/deltaScripts/15.1.1/DR4260/changeDefaultModel.sh @@ -0,0 +1,23 @@ +#!/bin/sh +# sed/changeword +# changes one model to another model for SCANRunSiteConfig.xml files +# + +files=$(find /awips2/edex/data/utility/common_static | grep SCANRunSiteConfig.xml) +echo "Updating all SCANRunSiteConfig.xml files to use HRRR instead of RUC130." + +old=RUC130 +new=HRRR + +for f in $files +do +echo "Processing file: " $f + if test -f "$f" + then + sed "s/$old/$new/g" $f > $f.new + mv $f $f.orig + mv $f.new $f + rm $f.orig + echo $f done + fi +done diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/config/IFPServerConfig.java b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/config/IFPServerConfig.java index 8246ed3629..aa95b55244 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/config/IFPServerConfig.java +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/config/IFPServerConfig.java @@ -20,8 +20,10 @@ package com.raytheon.edex.plugin.gfe.config; import java.util.ArrayList; +import java.util.Collection; import java.util.Collections; import java.util.HashMap; +import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Map.Entry; @@ -56,6 +58,7 @@ import com.raytheon.uf.common.dataplugin.gfe.weather.WxDefinition; * 06/24/13 #2044 randerso Renamed satdirs to satdata to match serverConfig.py * 08/14/2013 #1571 randerso Changed to use ProjectionType enum * 03/05/2015 #4169 randerso Changed model name mappings to return null if no mapping + * 04/09/2015 #4383 dgilling Support FireWx ISC. * * * @@ -164,6 +167,8 @@ public class IFPServerConfig { private long _protocolVersion = 20080905; + private Collection iscRoutingConfig; + private String convertToString(final DatabaseID id) { return id.getModelId(); } @@ -194,6 +199,7 @@ public class IFPServerConfig { _desiredDbVersions = new HashMap(); _gridPurgeAge = new HashMap(); _gridDbConfig = new HashMap(); + iscRoutingConfig = Collections.emptyList(); } protected IFPServerConfig(final SimpleServerConfig config) { @@ -554,6 +560,8 @@ public class IFPServerConfig { DatabaseID.NO_MODEL_TIME); setDesiredDbVersions(dbid, versions); } + + iscRoutingConfig = config.iscRoutingConfig; } /** @@ -844,4 +852,12 @@ public class IFPServerConfig { + _officialDatabases + "\n" + "Sites: " + _siteID + "\n" + "TimeZones: " + _timeZones + "\n"; } + + public Collection alternateISCEditAreaMasks() { + Collection retVal = new HashSet<>(); + for (ISCRoutingConfig entry : iscRoutingConfig) { + retVal.add(entry.getEditAreaPrefix()); + } + return retVal; + } } \ No newline at end of file diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/config/ISCRoutingConfig.java b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/config/ISCRoutingConfig.java new file mode 100644 index 0000000000..a816f9c246 --- /dev/null +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/config/ISCRoutingConfig.java @@ -0,0 +1,69 @@ +/** + * 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.edex.plugin.gfe.config; + +import java.util.Collection; + +/** + * Routing configuration data objection for supplemental ISC databases. Allows + * the list of defined weather elements to be additional mosaicked into the + * specified database name using the specified edit area type. + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Apr 09, 2015  #4383     dgilling    Initial creation
+ * 
+ * 
+ * + * @author dgilling + * @version 1.0 + */ + +public final class ISCRoutingConfig { + + private final Collection parmNames; + + private final String dbName; + + private final String editAreaPrefix; + + public ISCRoutingConfig(Collection parmNames, String dbName, + String editAreaPrefix) { + this.parmNames = parmNames; + this.dbName = dbName; + this.editAreaPrefix = editAreaPrefix; + } + + public Collection getParmNames() { + return parmNames; + } + + public String getDbName() { + return dbName; + } + + public String getEditAreaPrefix() { + return editAreaPrefix; + } +} diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/config/SimpleServerConfig.java b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/config/SimpleServerConfig.java index 2b9d317226..d98405ff15 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/config/SimpleServerConfig.java +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/config/SimpleServerConfig.java @@ -20,6 +20,7 @@ package com.raytheon.edex.plugin.gfe.config; import java.util.ArrayList; +import java.util.Collection; import java.util.List; import java.util.Map; @@ -34,6 +35,7 @@ import com.raytheon.uf.common.dataplugin.gfe.config.ProjectionData; * ------------ ---------- ----------- -------------------------- * 03/13/08 #1030 randerso Initial port * 06/24/13 #2044 randerso Renamed satdirs to satdata to match serverConfig.py + * 04/09/15 #4383 dgilling Added addedISCRoutingConfig. * * * @@ -110,6 +112,8 @@ public class SimpleServerConfig { public List officeTypes; + public Collection iscRoutingConfig; + public SimpleServerConfig() { allowedNodes = new ArrayList(); rpcPort = 0; diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/reference/MapManager.java b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/reference/MapManager.java index 4f6bd314e8..b0097815f1 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/reference/MapManager.java +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/reference/MapManager.java @@ -32,6 +32,7 @@ import java.net.InetAddress; import java.net.UnknownHostException; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collection; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; @@ -61,6 +62,7 @@ import com.raytheon.uf.common.dataplugin.gfe.reference.ReferenceData.CoordinateT import com.raytheon.uf.common.dataplugin.gfe.reference.ReferenceID; import com.raytheon.uf.common.dataplugin.gfe.sample.SampleData; import com.raytheon.uf.common.dataplugin.gfe.sample.SampleId; +import com.raytheon.uf.common.dataplugin.gfe.server.message.ServerResponse; import com.raytheon.uf.common.geospatial.MapUtil; import com.raytheon.uf.common.localization.IPathManager; import com.raytheon.uf.common.localization.LocalizationContext; @@ -113,6 +115,8 @@ import com.vividsolutions.jts.simplify.TopologyPreservingSimplifier; * Oct 20, 2014 #3685 randerso Changed structure of editAreaAttrs to keep zones from different maps separated * Feb 19, 2015 #4125 rjpeter Fix jaxb performance issue * Apr 01, 2015 #4353 dgilling Improve logging of Geometry validation errors. + * Apr 08, 2015 #4383 dgilling Change ISC_Send_Area to be union of + * areas ISC_XXX and FireWxAOR_XXX. * * * @@ -422,6 +426,7 @@ public class MapManager { i++; } writeISCMarker(); + writeSpecialISCEditAreas(); long t1 = System.currentTimeMillis(); statusHandler.info("EditArea generation time: " + (t1 - t0) + " ms"); @@ -485,6 +490,65 @@ public class MapManager { } } + private void writeSpecialISCEditAreas() { + statusHandler.debug("Creating: ISC_Tool_Area and ISC_Send_Area."); + + ReferenceMgr refDataMgr = new ReferenceMgr(_config); + String thisSite = _config.getSiteID().get(0); + + List areas = new ArrayList<>(); + List editAreaNames = new ArrayList<>(); + + ReferenceData iscSendArea = null; + ReferenceID iscAreaName = new ReferenceID("ISC_" + thisSite); + ServerResponse> sr = refDataMgr.getData(Arrays + .asList(iscAreaName)); + if (sr.isOkay()) { + iscSendArea = new ReferenceData(sr.getPayload().get(0)); + iscSendArea.setId(new ReferenceID("ISC_Send_Area")); + areas.add(iscSendArea); + editAreaNames.add(iscSendArea.getId().getName()); + + ReferenceData toolArea = createSwathArea("ISC_Tool_Area", + iscSendArea, 4); + if (toolArea != null) { + areas.add(toolArea); + editAreaNames.add(toolArea.getId().getName()); + } + } else { + String errorMsg = String.format( + "Could not retrieve ISC edit area for site %s: %s", + thisSite, sr.message()); + statusHandler.error(errorMsg); + return; + } + + Collection altISCEditAreas = _config + .alternateISCEditAreaMasks(); + for (String altISCEditArea : altISCEditAreas) { + ReferenceID editAreaName = new ReferenceID(altISCEditArea + + thisSite); + sr = refDataMgr.getData(Arrays.asList(editAreaName)); + if (sr.isOkay()) { + ReferenceData refData = sr.getPayload().get(0); + iscSendArea.orEquals(refData); + } else { + String errorMsg = String + .format("Could not retrieve additional ISC edit area %s for site %s: %s. It will not be included in ISC_Send_Area defintion.", + editAreaName.getName(), thisSite, sr.message()); + statusHandler.warn(errorMsg); + } + } + + ReferenceData swath = createSwathArea("ISC_Swath", iscSendArea, 4); + if (swath != null) { + iscSendArea.orEquals(swath); + } + + saveEditAreas(areas); + saveGroupList("ISC", editAreaNames); + } + /** * Based on the supplied map configuration, creates edit areas, saves them, * and updates group names. Handles special creation for ISC edit areas, @@ -522,36 +586,10 @@ public class MapManager { List knownSites = _config.allSites(); boolean anySites = false; if (groupName.equals("ISC")) { - String thisSite = _config.getSiteID().get(0); for (int i = 0; i < data.size(); i++) { String n = data.get(i).getId().getName(); if ((n.length() == 7) && n.startsWith("ISC_")) { String cwa = n.substring(4, 7); - if (cwa.equals(thisSite)) { - statusHandler - .debug("creating: ISC_Tool_Area and ISC_Send_Area" - + " from " - + data.get(i).getId().getName()); - - List areas = new ArrayList(); - ReferenceData swath = createSwathArea( - "ISC_Tool_Area", data.get(i), 4); - if (swath != null) { - areas.add(swath); - list.add(swath.getId().getName()); - } - - ReferenceData extend = new ReferenceData( - data.get(i)); - extend.setId(new ReferenceID("ISC_Send_Area")); - if (swath != null) { - extend.orEquals(swath); - } - areas.add(extend); - list.add(extend.getId().getName()); - - saveEditAreas(areas); - } // Need some special sample sets for ISC // Create ISC_Marker_Set if any CWA, use ISC_cwa areas diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/reference/ReferenceMgr.java b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/reference/ReferenceMgr.java index 911101da8f..eb69d259a5 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/reference/ReferenceMgr.java +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/reference/ReferenceMgr.java @@ -29,10 +29,13 @@ import com.raytheon.uf.common.dataplugin.gfe.reference.ReferenceData; import com.raytheon.uf.common.dataplugin.gfe.reference.ReferenceID; import com.raytheon.uf.common.dataplugin.gfe.server.message.ServerResponse; import com.raytheon.uf.common.localization.IPathManager; +import com.raytheon.uf.common.localization.LocalizationContext; +import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel; import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType; import com.raytheon.uf.common.localization.LocalizationFile; import com.raytheon.uf.common.localization.LocalizationUtil; import com.raytheon.uf.common.localization.PathManagerFactory; +import com.raytheon.uf.common.localization.region.RegionLookup; import com.raytheon.uf.common.serialization.SingleTypeJAXBManager; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; @@ -52,6 +55,9 @@ import com.raytheon.uf.common.util.FileUtil; * Sep 30, 2013 2361 njensen Use JAXBManager for XML * Sep 08, 2104 3592 randerso Changed to use new pm listStaticFiles() * Feb 19, 2015 4125 rjpeter Fix jaxb performance issue + * Apr 10, 2015 4383 dgilling Fix getData so it searches correct localization + * directories for secondary sites. + * * * * @author dgilling @@ -82,9 +88,8 @@ public class ReferenceMgr { */ public ServerResponse> getInventory() { List refIDs = new ArrayList(); - IPathManager pm = PathManagerFactory.getPathManager(); - LocalizationFile[] contents = pm.listStaticFiles( - LocalizationType.COMMON_STATIC, EDIT_AREAS_DIR, + LocalizationFile[] contents = pathMgr.listStaticFiles( + getSiteSearchContexts(), EDIT_AREAS_DIR, new String[] { ".xml" }, false, true); if (contents != null) { for (LocalizationFile lf : contents) { @@ -121,7 +126,7 @@ public class ReferenceMgr { for (ReferenceID id : ids) { String path = FileUtil.join(EDIT_AREAS_DIR, id.getName() + ".xml"); LocalizationFile lf = pathMgr.getStaticLocalizationFile( - LocalizationType.COMMON_STATIC, path); + getSiteSearchContexts(), path); // does it exist? if (lf == null) { @@ -167,4 +172,38 @@ public class ReferenceMgr { public String toString() { return "ReferenceMgr [" + dbGridLocation.getSiteId() + "]"; } -} + + private LocalizationContext[] getSiteSearchContexts() { + String siteId = dbGridLocation.getSiteId(); + /* + * regionName could be returned as null, and if so, we will not add it + * to the final list of LocalizationContexts. + */ + String regionName = RegionLookup.getWfoRegion(siteId); + + LocalizationContext[] searchContexts = pathMgr + .getLocalSearchHierarchy(LocalizationType.COMMON_STATIC); + List fixedContexts = new ArrayList<>( + searchContexts.length); + for (LocalizationContext ctx : searchContexts) { + if (((ctx.getLocalizationLevel().equals(LocalizationLevel.SITE)) || (ctx + .getLocalizationLevel() + .equals(LocalizationLevel.CONFIGURED))) + && (!ctx.getContextName().equals(siteId))) { + ctx.setContextName(siteId); + } else if (ctx.getLocalizationLevel().equals( + LocalizationLevel.REGION)) { + if (regionName == null) { + continue; + } else if (!ctx.getContextName().equals(regionName)) { + ctx.setContextName(regionName); + } + } + + fixedContexts.add(ctx); + } + + return fixedContexts.toArray(new LocalizationContext[fixedContexts + .size()]); + } +} \ No newline at end of file diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/cave_static/user/GFETEST/gfe/userPython/textProducts/MultipleElementTable_Local.py b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/cave_static/user/GFETEST/gfe/userPython/textProducts/MultipleElementTable_Local.py index 777f4c19a4..2cac4daa15 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/cave_static/user/GFETEST/gfe/userPython/textProducts/MultipleElementTable_Local.py +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/cave_static/user/GFETEST/gfe/userPython/textProducts/MultipleElementTable_Local.py @@ -35,17 +35,16 @@ class TextProduct(MultipleElementTable.TextProduct): Definition = copy.deepcopy(MultipleElementTable.TextProduct.Definition) Definition["displayName"] = "MultipleElementTable" - Definition["database"] = "Official" #Definition["outputFile"] = "/awips/GFESuite/products/TEXT/MultipleElementTable.txt" - #Definition["defaultEditAreas"] = [ + #Definition["regionList"] = [ # ("area1","AREA 1"), # ("area2","AREA 2"), # ("area3","AREA 3"), - # ] + # ], #Definition["regionList"] = [ # ("/33",["AREA 1","AREA 2"]), # ("/19",["AREA 3"]) - # ] + # ], #Definition["elementList"] = ["Temp", "PoP"] # Default #Definition["elementList"] = ["Temp", "Humidity"] diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/cave_static/user/GFETEST/gfe/userPython/textProducts/RDFcst.py b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/cave_static/user/GFETEST/gfe/userPython/textProducts/RDFcst.py deleted file mode 100644 index 43840b181c..0000000000 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/cave_static/user/GFETEST/gfe/userPython/textProducts/RDFcst.py +++ /dev/null @@ -1,206 +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. -## -######################################################################## -# RDFcst -# -######################################################################## -## EXAMPLE OUTPUT: -## -## 24 Hour Tabular Forecast for Boulder for 12 AM MST Mar 21 TO 12 PM MST Mar 21. -## -## Weather Element 12 AM 3 AM 6 AM 9 AM -## -## Temperature 30 28 29 -## Dew Point 25 23 25 -## Wind (mph) NW 4 NW 5 NW 6 -## Sky Cover(%) MOSTLY MOSTLY MOSTLY -## CLOUDY CLOUDY CLOUDY -## Rainfall Amount(in.) 0.00 0.00 0.00 0.00 -## Weather RAIN RAIN -## Snowfall(in.) 0 0 0 0 -## -## This forecast was generated from a gridded database. - - -# Forecast Definition -RDFcst = { - - ## General Set-Up - - "type": "table", - "displayName": "RDFcst", # for Product Generation Menu - "database": "Official", - - # Output file for product results - "outputFile": "/home/ifp/release/products/TEXT/RDFcst.txt", # default output file - "runTimeOutputFile": "no", # If yes, ask user at run time - - # Language - "language": "english", # default - "runTimeLanguage": "no", # If yes, ask user at run time - - # Line Length for resulting Product - "lineLength": 79, # default - "runTimeLineLength": "no", # If yes, ask user at run time - - # Text to preceed and follow the text product. - # Remember to add spacing lines backslash n. - # The variables: %TimePeriod, %EditArea, and %WeatherElement - # can be included to be filled in with constant variables. - # For phrase and combo, only %EditArea and %TimePeriod - # can be filled in. - "timePeriodMethod": "localTRLabel", ## localRangeLabel - "editAreaLoopBegText": "24 Hour Tabular Forecast for %EditArea for %TimePeriod. \n\n", - "editAreaLoopEndText": "\n", - "endingText": "\nThis forecast was generated from a gridded database.\n\n\n", - - ## Table Layout - # A table is a combination of three variables: - # edit areas, weather elements, and time periods - # One of these variables is held constant, - # one is assigned to rows and the other to columns. - - "constantVariable": "EditArea", ## "TimePeriod", - "rowVariable": "WeatherElement", ## "EditArea", - "columnVariable": "TimePeriod", ## "WeatherElement", - "columnJustification":"Right", - - ## Edit Areas - # If the edit area is the constant variable, specify - # one area and whether to ask user at run time. - # runTimeEditArea can be a list of areas and/or edit area - # groups (groups will be expanded into areas) from which - # the user will be able to choose. - "defaultEditAreas": [ - ("area1", "Area1"), - ("area2", "Area2"), - ("area3", "Area3"), - ("area4", "Area4")], - "runTimeEditAreas": "yes", - "areaType" : "Edit Area", # E.g. City, County, Basin, etc. - - # Time Ranges - "defaultRanges": ["Today"], - "runTimeRanges" : "no", # if yes, ask user at run time - - ## Weather Elements - # elementList: List of Weather Element tuples: - # Weather Element Name - # Weather Element Label - # If you want the label to appear on multiple lines, - # use vertical bars as separators e.g. Maximum|Temperature - # Analysis method -- Method to produce statistics from the data - # ReportAs Method -- Method to format the analyzed value(s) - # DataType: Scalar or Vector or Weather - # Rounding increment e.g. 5 = round final value to - # nearest multiple of 5 - # Conversion method - # e.g. "mphToKt" converts from mph to knots - # - # If the weather element is the constant variable, only one - # should be given. - - # Name , Label , Analysis Method , ReportAs Method , - # DataType , Rounding , Conversion - - "elementList": [ - ("T","Temperature", - "avg", - "singleValue", - "Scalar", 1, None), - ("Td","Dew Point", - "avg", - "singleValue", - "Scalar", 1, None), - ("RH","Relative Humidity(%)", - "avg", - "singleValue", - "Scalar", 1, None), - ("WindChill","Wind Chill(F)", - "avg", - "singleValue", - "Scalar", 1, None), - ("Wind","Wind (mph)", - "vectorRange", - "avgValue", - "Vector", 1, "ktToMph"), - ("Sky","Sky Cover(%)", - "avg", - "cloudCover", - "Scalar", 5, None), - ("QPF","Rainfall Amount(in.)", - "avg", - "singleValue", - "Scalar", .01, None), - ("Wx","Weather ", - "dominantWx", - "short_weather_phrase", - "Scalar", 1, None), - ("SnowAmt","Snowfall(in.)", - "avg", - "singleValue", - "Scalar", 1, None), - ("PoP", "Precip (%)", - "avg", - "singleValue", - "Scalar", 1, None), - ], - - ## Time Period (If rows or columns vary with TimePeriod - # timePeriod: This is the interval in hours for sampling the data - # e.g. every 3 hours. - # (Can be floating point e.g. 1.5 hour TimePeriods) - "timePeriod": 3, - # timeSpan: This is the amount of data to sample at each - # interval. - # If you want the data analyzed (e.g averaged) over the - # entire period, the timeSpan should be set to "timePeriod". - # If you only want data for the beginning of each timePeriod, - # the timeSpan should be set to number of hours over which - # to analyze the data e.g. 1 hour - "timeSpan": 1, - "runTimePeriod": "no", # If yes, ask user at run time for period - # Method to label periods given a time range - # periodLabel -- GMT time hourZ/day e.g. 15Z/4 - # localTimeLabel -- local time e.g. 6 AM - # localRangeLabel -- local time range e.g. 6AM-9AM - "periodLabelMethod": "localTimeLabel", - - ## User-supplied Methods - # loopMethod: Method to be called for each row. - # Such a method might keep ongoing statistics about table data. - # Arguments: (rowLabel, rowEntries, userDict, argDict) - # Returns: nothing - # "rowEntries" is a list of (colValue, value) tuples - # describing the entries in this row. - # "userDict" is a dictionary set up for user-defined - # callback methods so they can keep ongoing data as - # the table is being produced. - # It is not modified by the TextFormatter code. - "loopMethod": None, - - # endMethod: Method to be called after table is complete. - # Arguments: (table, userDict, argDict) - # Returns: table (could be modified) - # The table can be modified to report summary statistics - # gathered in userDict. - # - "endMethod": None, - } diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/cave_static/user/GFETEST/gfe/userPython/textProducts/SmartElementTable.py b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/cave_static/user/GFETEST/gfe/userPython/textProducts/SmartElementTable.py deleted file mode 100644 index 6d96ec9f2c..0000000000 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/cave_static/user/GFETEST/gfe/userPython/textProducts/SmartElementTable.py +++ /dev/null @@ -1,311 +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. -## -#------------------------------------------------------------------------- -# Description: This product creates a Smart Element Table. -# The possible elements are Temperature (MaxT, MinT), Humidity (MinRH, MaxRH), and PoP -#------------------------------------------------------------------------- -# Copying: -# This software is in the public domain, furnished "as is", without technical -# support, and with no warranty, express or implied, as to its usefulness for -# any purpose. -#------------------------------------------------------------------------- -# Standard and Local file names and Locations: -# MultipleElementTableTable, MultipleElementTable_Local, MultipleElementTable_Aux_Local -#------------------------------------------------------------------------- -# User Configurable Variables: -#------------------------------------------------------------------------- -# Weather Elements Needed: -#------------------------------------------------------------------------- -# Edit Areas Needed: -#------------------------------------------------------------------------- -# Associated Utilities Files e.g. Combinations file: -#------------------------------------------------------------------------- -# Component Products: -#------------------------------------------------------------------------- -# Programmers and Support including product team leader's email: -#------------------------------------------------------------------------- -# Development tasks that are identified and in progress: -#------------------------------------------------------------------------- -# Additional Information: -#------------------------------------------------------------------------- - -import TextRules -import SampleAnalysis -import string, time, types - -class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis): - VariableList = [ - ("Forecast Product" , "Morning", "radio", - ["Morning","Afternoon"]), - ] - Definition = { - "type": "smart", - "displayName": "None", - "database": "Official", - "outputFile": "/awips/GFESuite/products/TEXT/SmartElementTable.txt", - "defaultEditAreas": [ - ("area1","AREA 1"), - ("area2","AREA 2"), - ("area3","AREA 3"), - ], - # Product-specific variables - "regionList" : [ - ("/33",["AREA 1","AREA 2"]), - ("/19",["AREA 3"]) - ], - # Possible elements are: - # "Temp" -- lists MaxT for daytime, MinT for nighttime - # "PoP" - # "Humidity" -- lists MinRH for daytime, MaxRH for nighttime - "elementList" : ["Temp", "PoP"], - # If set to 1, only one value for each element is listed - "includeTitle": 1, - "introLetters": ".<", - } - - def __init__(self): - TextRules.TextRules.__init__(self) - SampleAnalysis.SampleAnalysis.__init__(self) - - def generateForecast(self, argDict): - # Generate formatted product for a list of edit areas - - # Get variables from varDict and Definition - self._getVariables(argDict) - - # Get the areaList -- derived from defaultEditAreas and - # may be solicited at run-time from the user if desired - self._areaList = self.getAreaList(argDict) - - # Determine time ranges for which the data will be sampled - self._determineTimeRanges(argDict) - - # Sample the data - self._sampleData(argDict) - - # Initialize the output string - fcst = "" - fcst = self._preProcessProduct(fcst, argDict) - - # Generate the product for each edit area in the list - for editArea, areaLabel in self._areaList: - fcst = self._preProcessArea(fcst, editArea, areaLabel, argDict) - fcst = self._makeProduct(fcst, editArea, areaLabel, argDict) - fcst = self._postProcessArea(fcst, editArea, areaLabel, argDict) - - fcst = self._postProcessProduct(fcst, argDict) - return fcst - - def _getVariables(self, argDict): - # Determine whether Morning or Afternoon product type - varDict = argDict["varDict"] - self._productType = varDict["Forecast Product"] - - # Make argDict accessible - self.__argDict = argDict - - # Set up any other product-specific variables from the Definition - self._definition = argDict["forecastDef"] - for key in self._definition.keys(): - exec "self._" + key + "= self._definition[key]" - - self._currentRegion = None - - # The analysisList tells which weather elements and statistics - # are desired for the product. - self._analysisList = self._getAnalysisList() - - def _determineTimeRanges(self, argDict): - # Determine time ranges for product - # Sets up self._timeRangeList - - if self._productType == "Morning": - timeRange = self.getTimeRange("Today", argDict) - numPeriods = 3 - else: - timeRange = self.getTimeRange("Tonight", argDict) - numPeriods = 4 - - self._timeRangeList = self.getPeriods(timeRange, 12, 12, numPeriods) - return - - def _sampleData(self, argDict): - # Sample the data - self._sampler = self.getSampler(argDict, - (self._analysisList, self._timeRangeList, self._areaList)) - return - - def _preProcessProduct(self, fcst, argDict): - # Set up format spacing and title line spacing - - numElements = len(self._elementList) - if numElements > 2: - self._spaceStr = "" - else: - self._spaceStr = " " - if self._includeTitle == 0: - return fcst - - self._titles = self._titleDict() - if numElements > 2: - if self._productType == "Morning": - self._headingLen = 15 - else: - self._headingLen = 19 - else: - if self._productType == "Morning": - self._headingLen = 21 - else: - self._headingLen = 28 - - # Create title line - title = self._introLetters + " " - index = 0 - for element in self._elementList: - title = title + string.center( - self._titles[element], self._headingLen) - if index < len(self._elementList)-1: - title = title + "/" - index += 1 - return fcst + title + "\n" - - def _preProcessArea(self, fcst, editArea, areaLabel, argDict): - # If we are in a new region, add region header - for region, areaList in self._regionList: - if areaLabel in areaList: - break - if region != self._currentRegion: - if self._currentRegion is not None: - # End the Region - fcst = fcst + "\n$$\n\n" - self._currentRegion = region - fcst = fcst + region - - return fcst + "\n" + string.ljust(areaLabel, 10) - - def _makeProduct(self, fcst, editArea, areaLabel, argDict): - # Get the Statistics - statList = self.getStatList(self._sampler, self._analysisList, - self._timeRangeList, editArea) - - numElements = len(self._elementList) - index = 0 - for element in self._elementList: - exec "fcst = fcst + self._get" + element + \ - "Values(statList, argDict)" - if index < numElements-1: - fcst = fcst + " /" - index += 1 - - return fcst - - def _postProcessArea(self, fcst, editArea, areaLabel, argDict): - return fcst - - def _postProcessProduct(self, fcst, argDict): - fcst = fcst + "\n" - return fcst - - ######################################################################## - # PRODUCT-SPECIFIC METHODS - ######################################################################## - - def _getAnalysisList(self): - return [ - ("MinT", self.avg), - ("MaxT", self.avg), - ("MinRH", self.avg), - ("MaxRH", self.avg), - ("PoP", self.stdDevMaxAvg), - ] - - def _titleDict(self): - return { - "Temp": "TEMPERATURE", - "PoP": "PRECIPITATION", - "Humidity":"HUMIDITY", - } - - def _getTempValues(self, statList, argDict): - # Return a string of Temperature values given statList - stats1 = statList[0] - if self._productType == "Morning": - stats2 = statList[1] - stats3 = statList[2] - t1 = self.getScalarVal(stats1["MaxT"]) - t2 = self.getScalarVal(stats2["MinT"]) - t3 = self.getScalarVal(stats3["MaxT"]) - str = " " + t1+ self._spaceStr +t2+ self._spaceStr +t3 - return str - else: - stats2 = statList[1] - stats3 = statList[2] - stats4 = statList[3] - t1 = self.getScalarVal(stats1["MinT"]) - t2 = self.getScalarVal(stats2["MaxT"]) - t3 = self.getScalarVal(stats3["MinT"]) - t4 = self.getScalarVal(stats4["MaxT"]) - str = " " +t1+ self._spaceStr +t2+ self._spaceStr +t3+ \ - self._spaceStr+t4 - return str - - def _getHumidityValues(self, statList, argDict): - # Return a string of Humidity values given statList - stats1 = statList[0] - if self._productType == "Morning": - stats2 = statList[1] - stats3 = statList[2] - t1 = self.getScalarVal(stats1["MinRH"]) - t2 = self.getScalarVal(stats2["MaxRH"]) - t3 = self.getScalarVal(stats3["MinRH"]) - return " " +t1+ self._spaceStr +t2+ self._spaceStr+t3 - else: - stats2 = statList[1] - stats3 = statList[2] - stats4 = statList[3] - t1 = self.getScalarVal(stats1["MaxRH"]) - t2 = self.getScalarVal(stats2["MinRH"]) - t3 = self.getScalarVal(stats3["MaxRH"]) - t4 = self.getScalarVal(stats4["MinRH"]) - return " " +t1+ self._spaceStr +t2+ self._spaceStr +t3+ self._spaceStr +t4 - - def _getPoPValues(self, statList, argDict): - # Return a string of PoP values in the statList - pop = [] - popStr = "" - index = 0 - for stats in statList: - val = self._getPoPValue(stats) - if index < len(statList)-1: - popStr = popStr + val + self._spaceStr - else: - popStr = popStr + val - index += 1 - popStr = popStr + " " - return popStr - - def _getPoPValue(self, stats): - pop = self.getStats(stats,"PoP") - if pop is None: - val = " " - else: - max = self.round(pop, "Nearest", 10) - val = self.getScalarVal(max) - return val diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/cave_static/user/GFETEST/gfe/userPython/textProducts/SmartElementTable_Local.py b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/cave_static/user/GFETEST/gfe/userPython/textProducts/SmartElementTable_Local.py deleted file mode 100644 index 7ff12d36d1..0000000000 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/cave_static/user/GFETEST/gfe/userPython/textProducts/SmartElementTable_Local.py +++ /dev/null @@ -1,59 +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. -## -######################################################################## -# SmartElementTable_Local -# -# Type: smart -# Local product: -# SmartElementTable_Local(type: smart) -# To customize this product for your site: -# Set up SmartElementTable_Local (see template below) -# to override variables, definitions, thresholds, and methods -## -########################################################################## -import SmartElementTable -import string, time, re, os, types, copy - -class TextProduct(SmartElementTable.TextProduct): - Definition = copy.deepcopy(SmartElementTable.TextProduct.Definition) - - Definition["displayName"] = "TEST_SmartElementTable" - #Definition["outputFile"] = "/awips/GFESuite/products/TEXT/SmartElementTable.txt" - #Definition["defaultEditAreas"] = [ - # ("area1","AREA 1"), - # ("area2","AREA 2"), - # ("area3","AREA 3"), - # ] - #Definition["regionList"] = [ - # ("/33",["AREA 1","AREA 2"]), - # ("/19",["AREA 3"]) - # ] - - #Definition["elementList"] = ["Temp", "PoP"] # Default - #Definition["elementList"] = ["Temp", "Humidity"] - #Definition["elementList"] = ["Temp", "Humidity", "PoP"] - #Definition["elementList"] = ["Temp", "PoP", "Humidity"] - #Definition["elementList"] = ["PoP", "Humidity", "Temp"] - #Definition["introLetters"] = ".<" - - def __init__(self): - SmartElementTable.TextProduct.__init__(self) - - diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/config/gfe/doConfig.py b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/config/gfe/doConfig.py index 8031d7800f..4f767a2597 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/config/gfe/doConfig.py +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/config/gfe/doConfig.py @@ -32,7 +32,8 @@ # ProjectionType enumeration # 07/09/2014 #3146 randerso Added check for duplicate smartInit # rferrel Corrected log to alertviz. -# 11/18/2014 #4953 randerso Added check for empty unit string +# 11/18/2014 #4953 randerso Added check for empty unit string +# 04/09/2015 #4383 dgilling Added support for FireWx ISC. # ######################################################################## import types @@ -521,3 +522,22 @@ def otherParse(serverhost, mhsid, port, autoConfigureNotifyTextProd, \ iscRoutingTableAddress, reqISCsites, requestISC, sendiscOnSave, \ sendiscOnPublish, reqISCparms, transmitScript + +def parseAdditionalISCRouting(iscRoutingData): + from com.raytheon.edex.plugin.gfe.config import ISCRoutingConfig + + retVal = ArrayList() + if iscRoutingData: + try: + iter(iscRoutingData) + except TypeError: + raise TypeError("AdditionalISCRouting should be a list or tuple.") + + for entry in iscRoutingData: + (pyParms, dbName, editAreaPrefix) = check(entry, (list, str, str), "AdditionalISCRouting entry not in correct format.") + javaParms = ArrayList() + for parm in pyParms: + javaParms.add(str(parm[0])) + retVal.add(ISCRoutingConfig(javaParms, dbName, editAreaPrefix)) + + return retVal diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/config/gfe/serverConfig.py b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/config/gfe/serverConfig.py index 0e8495d171..a0a3962be4 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/config/gfe/serverConfig.py +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/config/gfe/serverConfig.py @@ -55,9 +55,11 @@ # 02/24/2015 #16692 byin Added RTMA. Removed gfsLR and GWW233 # 03/19/2015 #4300 randerso Remove GUMa as it is obsolete (per Shannon White) # 03/30/2015 #17288 bhunder Added Guam-RTMA to D2D models -# 03/31/2015 #17288 bhunder Added Weather Params for RTMA # 03/30/2015 #17206 yteng Changed some parameters that are not rate parameters +# 03/31/2015 #17288 bhunder Added Weather Params for RTMA # 04/03/2015 #4367 dgilling Change WindGust's time constraints back to TC1 +# 04/08/2015 #4383 dgilling Define FireWX ISC configuration parameters. +# # for Fcst/Official. # ######################################################################## @@ -994,8 +996,8 @@ def localTC(start,repeat,duration,dst): timezone = SITES[GFESUITE_SITEID][3] import dateutil.tz, datetime tz = dateutil.tz.gettz(timezone) - dt = datetime.datetime.utcnow() - delta = tz.utcoffset(dt) + tz.dst(dt) + local = datetime.datetime.now(tz) + delta = tz.utcoffset(local) - tz.dst(local) offset = delta.days*86400 + delta.seconds start = start - offset if dst == 1: @@ -1817,6 +1819,13 @@ localISCExtraParms = [] myOfficeType = SITES[GFESUITE_SITEID][5] +AdditionalISCRouting = [ + # Configure by adding entries to this list in the form of: + # ([WeatherElements], ModelName, EditAreaPrefix) + # Example: + # ([Hazards, LAL, CWR], "ISCFire", "FireWxAOR_"), +] + if not BASELINE and siteImport('localConfig'): #ensure office type is set properly in localConfig SITES[] if len(SITES[GFESUITE_SITEID]) == 5: @@ -2192,6 +2201,14 @@ ISCPARMS.append(([Topo], Persistent)) DATABASES.append((Restore, RESTOREPARMS)) DATABASES.append((ISC, ISCPARMS)) +for entry in AdditionalISCRouting: + (parmList, dbName, editAreaPrefix) = entry + parmList = list(parmList) + addedIscDbDefinition = (dbName, ) + ISC[1:] + addedIscParms = [(parmList, TC1)] + DATABASES.append((addedIscDbDefinition, addedIscParms)) + + #--------------------------------------------------------------------------- # # General server configuration section @@ -2272,5 +2289,6 @@ def doIt(): IFPConfigServer.sendiscOnPublish = sendiscOnPublish IFPConfigServer.requestedISCparms = requestedISCparms IFPConfigServer.transmitScript = transmitScript + IFPConfigServer.iscRoutingConfig = doConfig.parseAdditionalISCRouting(AdditionalISCRouting) doIt() diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/gfe/createAreaDictionary.py b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/gfe/createAreaDictionary.py index b2eea1b0e0..636c61ae7a 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/gfe/createAreaDictionary.py +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/gfe/createAreaDictionary.py @@ -390,17 +390,17 @@ def createTCVAreaDictionary(outputDir, mapDict, siteID): # # "We ended the other list and are back at tab level 0 now", # # ] # 'infoSection': [ -# "LOCAL EVACUATION AND SHELTERING: MIAMI-DADE COUNTY EMERGENCY MANAGEMENT", +# "Local evacuation and sheltering: Miami-Dade County Emergency Management", # [ -# "HTTP://WWW.MIAMIDADE.GOV/EMERGENCY/", +# "http://www.miamidade.gov/emergency/", # ], -# "FAMILY EMERGENCY PLANS: FEDERAL EMERGENCY MANAGEMENT AGENCY", +# "Family emergency plans: Federal Emergency Management Agency", # [ -# "HTTP://READY.GOV/", +# "http://ready.gov/", # ], -# "LOCAL WEATHER CONDITIONS AND FORECASTS: NWS MIAMI FLORIDA", +# "Local weather conditions and forecasts: NWS Miami Florida", # [ -# "HTTP://WWW.SRH.NOAA.GOV/MFL/", +# "http://www.srh.noaa.gov/mfl/", # ], # ], # }, diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/gfe/isc/iscDataRec.py b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/gfe/isc/iscDataRec.py index 2aa1a7c784..85ce4d43de 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/gfe/isc/iscDataRec.py +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/gfe/isc/iscDataRec.py @@ -22,7 +22,7 @@ ## import iscMosaic,iscUtil -import os, stat, sys, re, string, traceback, types +import os, stat, sys, re, string, types import time, xml, LogStream, IrtAccess import IrtServer from xml.etree import ElementTree @@ -45,6 +45,8 @@ from java.util import ArrayList # 01/24/14 2504 randerso removed obsolete A1 comments # 12/08/2014 4953 randerso Added support for sending/receiving TCV files # Additional code cleanup +# 04/08/2015 4383 dgilling Support FireWx ISC. +# 04/23/2015 4383 randerso Fixed exception logging # ## @@ -77,7 +79,7 @@ def purgeFiles(msgid, files): try: os.remove(file) except: - logEvent("iscDataRec Failed to remove: ",file) + logException("iscDataRec Failed to remove file %s: ", str(file)) def execIscDataRec(MSGID,SUBJECT,FILES): @@ -108,7 +110,7 @@ def execIscDataRec(MSGID,SUBJECT,FILES): destTree = ElementTree.ElementTree(ElementTree.XML(xmlFileBuf)) iscE = destTree.getroot() except: - logProblem("Malformed XML received") + logException("Malformed XML received") return #no XML destination information. Default to dx4f,px3 98000000, 98000001 @@ -198,29 +200,12 @@ def execIscDataRec(MSGID,SUBJECT,FILES): elif SUBJECT == 'GET_ACTIVE_TABLE2': IrtServer.getVTECActiveTable(dataFile, xmlFileBuf) elif SUBJECT in ['ISCGRIDS', 'ISCGRIDS2']: - args = {"siteID": siteConfig.GFESUITE_SITEID, - "userID": 'SITE', - "databaseID": siteConfig.GFESUITE_SITEID+"_GRID__ISC_00000000_0000", - "parmsToProcess": [], - "blankOtherPeriods": True, - "startTime": None, - "endTime": None, - "altMask": None, - "replaceOnly": False, - "eraseFirst": False, - "announce": "ISC: ", - "renameWE": True, - "iscSends": False, - "inFiles": [dataFile], - "ignoreMask": False, - "adjustTranslate": True, - "deleteInput": True, - "parmsToIgnore": [], - "gridDelay": 0.0, - "logFileName": None} - mosaic = iscMosaic.IscMosaic(args) - mosaic.execute() - + import localConfig + + additionalISCRouting = [] + if localConfig.AdditionalISCRouting: + additionalISCRouting = localConfig.AdditionalISCRouting + putISCGrids(dataFile, siteConfig.GFESUITE_SITEID, srcServer.get('site'), additionalISCRouting) elif SUBJECT == 'ISCREQUEST': IrtServer.serviceISCRequest(dataFile) elif SUBJECT == 'PUT_TCV_FILES': @@ -236,11 +221,48 @@ def execIscDataRec(MSGID,SUBJECT,FILES): logEvent('Sent to:', irt.printServerInfo(destServer), "connectT=", delta1, "xmtT=", delta2) except: - logProblem("iscDataRec failed!",traceback.format_exc()) + logException("iscDataRec failed!") + finally: # cleanup purgeFiles(MSGID, FILES) +def putISCGrids(dataFile, destSite, srcSite, additionalISCRouting): + # iscMosaic now executes multiple times--once for the primary ISC database, + # and once more for each additional ISC database defined in the localConfig + args = {"siteID": destSite, + "userID": 'SITE', + "databaseID": destSite+"_GRID__ISC_00000000_0000", + "parmsToProcess": [], + "blankOtherPeriods": True, + "startTime": None, + "endTime": None, + "altMask": None, + "replaceOnly": False, + "eraseFirst": False, + "announce": "ISC: ", + "renameWE": True, + "iscSends": False, + "inFiles": [dataFile], + "ignoreMask": False, + "adjustTranslate": True, + "deleteInput": False, + "parmsToIgnore": [], + "gridDelay": 0.0, + "logFileName": None} + mosaic = iscMosaic.IscMosaic(args) + mosaic.execute() + + for entry in additionalISCRouting: + (parms, dbName, editAreaPrefix) = entry + parmNameList = [parm[0] + "_SFC" for parm in parms] + args['parmsToProcess'] = parmNameList + args['databaseID'] = destSite + "_GRID__" + dbName + "_00000000_0000" + args['altMask'] = editAreaPrefix + srcSite + mosaic = iscMosaic.IscMosaic(args) + mosaic.execute() + + #-------------------------------------------------------------------- # Main Routine #-------------------------------------------------------------------- @@ -283,8 +305,8 @@ def main(argv): execIscDataRec(MSGID,SUBJECT,FILES) except: - logProblem('Failure:', traceback.format_exc()) + logException('Failure:') except: - logProblem("FAIL: ", traceback.format_exc()) + logException("FAIL: ") diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/gfe/isc/iscMosaic.py b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/gfe/isc/iscMosaic.py index 3e23e9b0e7..fed2a91e67 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/gfe/isc/iscMosaic.py +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/gfe/isc/iscMosaic.py @@ -23,6 +23,7 @@ # ------------ ---------- ----------- -------------------------- # 02/17/2015 4139 randerso Replaced call to iscTime.timeFromComponents # with call to calendar.timegm +# 04/23/2015 4383 randerso Changed to log arguments to aid in troubleshooting ## @@ -521,9 +522,9 @@ class IscMosaic: self.__processTimePeriod = (startTime, endTime) initLogger(self.__logFile) + logger.info("iscMosaic Starting args: %s", str(args)) def execute(self): - logger.info("iscMosaic Starting") # get the WxDefinition and DiscreteDefinition config = IFPServerConfigManager.getServerConfig(self.__mysite) diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/AreaFcst.py b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/AreaFcst.py index fd6e6d1dd1..e9aae8baf6 100755 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/AreaFcst.py +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/AreaFcst.py @@ -355,9 +355,9 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis): # set this variable to zero for proper labeling. def splitDay24HourLabel_flag(self, tree, node): # Return 0 to have the TimeDescriptor module label 24 hour periods - # with simply the weekday name (e.g. SATURDAY) + # with simply the weekday name (e.g. Saturday) # instead of including the day and night periods - # (e.g. SATURDAY AND SATURDAY NIGHT) + # (e.g. Saturday and Saturday night) return 1 def gust_wind_difference_nlValue(self, tree, node): @@ -1162,7 +1162,7 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis): def _preProcessProduct(self, fcst, argDict): # Product header if self._areaName != "": - productName = self._productName.strip() + " FOR " + \ + productName = self._productName.strip() + " for " + \ self._areaName.strip() else: productName = self._productName.strip() @@ -1171,11 +1171,12 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis): issuedByString = self.getIssuedByString() - fcst = fcst + self._wmoID + " " + self._fullStationID + " " + \ + s = self._wmoID + " " + self._fullStationID + " " + \ self._ddhhmmTime + "\n" + self._pil + "\n\n" +\ productName + "\n" +\ "National Weather Service " + self._wfoCityState + \ "\n" + issuedByString + self._timeLabel + "\n\n" + fcst = fcst + s.upper() # The following lines insert a statement # at the top of the forecast that describes the time periods @@ -1404,7 +1405,7 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis): for myTimeRange, label in myTimeRanges: # Add it on to the header if periodNum == numPeriods: - header = header + "AND " + header = header + "and " header = header + label periodNum = periodNum + 1 diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/CCF.py b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/CCF.py index 765d8cbfad..f9f3f89dd5 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/CCF.py +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/CCF.py @@ -303,8 +303,10 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis): def _preProcessProduct(self, fcst, argDict): # Add product heading to fcst string - return fcst + self._wmoID + " " + self._fullStationID + " " + \ + s = self._wmoID + " " + self._fullStationID + " " + \ self._ddhhmmTime + "\n" + self._pil + "\n\n" + fcst = fcst + s.upper() + return fcst def _preProcessArea(self, fcst, editArea, areaLabel, argDict): return fcst + areaLabel + " " diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/CWF.py b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/CWF.py index 71e4797b49..fd77f0e76d 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/CWF.py +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/CWF.py @@ -802,7 +802,7 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis): def _preProcessProduct(self, fcst, argDict): if self._areaName != "": - productName = self._productName.strip() + " FOR " + \ + productName = self._productName.strip() + " for " + \ self._areaName.strip() else: productName = self._productName.strip() @@ -811,11 +811,13 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis): productName = self.checkTestMode(argDict, productName) - fcst = fcst + self._wmoID + " " + self._fullStationID + " " + \ + s = self._wmoID + " " + self._fullStationID + " " + \ self._ddhhmmTime + "\n" + self._pil + "\n\n" +\ productName + "\n" +\ "National Weather Service " + self._wfoCityState + \ "\n" + issuedByString + self._timeLabel + "\n\n" + fcst = fcst + s.upper() + fcst = fcst + self._Text1() try: text2 = self._Text2(argDict) @@ -831,7 +833,7 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis): print "Generating Forecast for", areaLabel areaHeader = self.makeAreaHeader( argDict, areaLabel, self._issueTime, self._expireTime, - self._areaDictionary, self._defaultEditAreas) + self._areaDictionary, self._defaultEditAreas, upperCase=True) fcst = fcst + areaHeader # get the hazards text @@ -1125,14 +1127,14 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis): def splitDay24HourLabel_flag(self, tree, node): # Return 0 to have the TimeDescriptor module label 24 hour periods - # with simply the weekday name (e.g. SATURDAY) + # with simply the weekday name (e.g. Saturday) # instead of including the day and night periods - # (e.g. SATURDAY AND SATURDAY NIGHT) + # (e.g. Saturday and Saturday night) # NOTE: If you set this flag to 1, make sure the "nextDay24HourLabel_flag" # is set to zero. # NOTE: This applied only to periods that are exactly 24-hours in length. # Periods longer than that will always be split into day and night labels - # (e.g. SUNDAY THROUGH MONDAY NIGHT) + # (e.g. Sunday through Monday night) compName = node.getComponentName() if compName == "CWFExtended": return 0 diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/CWF_Pacific.py b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/CWF_Pacific.py index 6d00433ddc..ac0c4cc12b 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/CWF_Pacific.py +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/CWF_Pacific.py @@ -417,7 +417,7 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis): def combinedSeas_threshold(self, tree, node): # See wave_phrase # If waves and swells are above this threshold, - # combined seas will be reported AND no Swell phrase will be reported. + # combined seas will be reported and no Swell phrase will be reported. # Units: feet return 7 @@ -1105,7 +1105,7 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis): def _preProcessProduct(self, fcst, argDict): if self._areaName != "": - productName = self._productName.strip() + " FOR " + \ + productName = self._productName.strip() + " for " + \ self._areaName.strip() else: productName = self._productName.strip() @@ -1113,11 +1113,12 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis): issuedByString = self.getIssuedByString() productName = self.checkTestMode(argDict, productName) - fcst = fcst + self._wmoID + " " + self._fullStationID + " " + \ + s = self._wmoID + " " + self._fullStationID + " " + \ self._ddhhmmTime + "\n" + self._pil + "\n\n" +\ productName + "\n" +\ "National Weather Service " + self._wfoCityState + \ "\n" + issuedByString + self._timeLabel + "\n\n" + fcst = fcst + s.upper() fcst = fcst + self._Text1() try: text2 = self._Text2(argDict) @@ -1131,7 +1132,7 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis): print "Generating Forecast for", areaLabel areaHeader = self.makeAreaHeader( argDict, areaLabel, self._issueTime, self._expireTime, - self._areaDictionary, self._defaultEditAreas) + self._areaDictionary, self._defaultEditAreas, upperCase=True) fcst = fcst + areaHeader # get the hazards text @@ -1270,7 +1271,7 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis): ## # expirationHour -- hour when the product expires (in local time) ## # This is relitive to midnight local time of the ## # current day. -## # period1 Label -- the label for the first period. e.g. ".Today...", ".REST OF Today..." +## # period1 Label -- the label for the first period. e.g. ".Today...", ".Rest of Today..." ## # period1 lateNight phrase -- phrase to use if the hours of 3am to 6am must be qualified ## # e.g. "Partly cloudy in the early morning." ## # period1 lateDay phrase -- phrase to use if the hours of 3pm to 6pm must be qualified @@ -1314,9 +1315,9 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis): def splitDay24HourLabel_flag(self, tree, node): # Return 0 to have the TimeDescriptor module label 24 hour periods - # with simply the weekday name (e.g. SATURDAY) + # with simply the weekday name (e.g. Saturday) # instead of including the day and night periods - # (e.g. SATURDAY AND SATURDAY NIGHT) + # (e.g. Saturday and Saturday night) # NOTE: If you set this flag to 1, make sure the "nextDay24HourLabel_flag" # is set to zero. # NOTE: This applied only to periods that are exactly 24-hours in length. diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/CivilEmerg_EQR_MultiPil_Local.py b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/CivilEmerg_EQR_MultiPil_Local.py index 16982a952c..efac52cc90 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/CivilEmerg_EQR_MultiPil_Local.py +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/CivilEmerg_EQR_MultiPil_Local.py @@ -90,8 +90,8 @@ class TextProduct(CivilEmerg.TextProduct): label, variable = key exec "self._" + variable + "= varDict[key]" - fcst = fcst + "An earthquake has been felt " + self._felt + " BY " +\ - self._extent + " " + "IN THE |*enter area*| AREA. " + \ + fcst = fcst + "An earthquake has been felt " + self._felt + " by " +\ + self._extent + " " + "in the |*enter area*| area. " + \ self._damage + " damage has been reported. " if self._damage != "No": diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/FWF.py b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/FWF.py index 89e04c7cb6..2e4cc93f44 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/FWF.py +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/FWF.py @@ -851,7 +851,7 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis): def _preProcessProduct(self, fcst, argDict): # Product header if self._areaName != "": - productName = self._productName.strip() + " FOR " + \ + productName = self._productName.strip() + " for " + \ self._areaName.strip() else: productName = self._productName.strip() @@ -859,11 +859,12 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis): issuedByString = self.getIssuedByString() productName = self.checkTestMode(argDict, productName) - fcst = fcst + self._wmoID + " " + self._fullStationID + " " + \ + s = self._wmoID + " " + self._fullStationID + " " + \ self._ddhhmmTime + "\n" + self._pil + "\n\n" +\ productName + "\n" +\ "National Weather Service " + self._wfoCityState + \ "\n" + issuedByString + self._timeLabel + "\n\n" + fcst = fcst + s.upper() # Put in a place holder for the headlines to be substituted in # "postProcessProduct" diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/FWFTable.py b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/FWFTable.py index 747d9dc3dd..785623cf1b 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/FWFTable.py +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/FWFTable.py @@ -627,7 +627,7 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis): def _preProcessProduct(self, fcst, argDict): # Add product heading to fcst string if self._areaName != "": - productName = self._productName.strip() + " FOR " + \ + productName = self._productName.strip() + " for " + \ self._areaName.strip() else: productName = self._productName.strip() @@ -635,11 +635,12 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis): issuedByString = self.getIssuedByString() productName = self.checkTestMode(argDict, productName) - fcst = fcst + self._wmoID + " " + self._fullStationID + " " + \ + s = self._wmoID + " " + self._fullStationID + " " + \ self._ddhhmmTime + "\n" + self._pil + "\n\n" +\ productName + "\n" +\ - "National Weahter Service " + self._wfoCityState + \ + "National Weather Service " + self._wfoCityState + \ "\n" + issuedByString + self._timeLabel + "\n\n" + fcst = fcst + s.upper() # Put in a place holder for the headlines to be substituted in # "postProcessProduct" diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/FWM.py b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/FWM.py index 2a9ac96b03..92f582f9ce 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/FWM.py +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/FWM.py @@ -267,8 +267,9 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis): def _preProcessProduct(self, fcst, argDict): # This is the header for the overall product - fcst = fcst + self._wmoID + " " + self._fullStationID + " " + \ + s = self._wmoID + " " + self._fullStationID + " " + \ self._ddhhmmTime + "\n" + self._pil + "\n\n" + fcst = fcst + s.upper() return fcst def _preProcessArea(self, fcst, editArea, areaLabel, argDict): diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/GLF.py b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/GLF.py index 0d0e35dda6..b6acd653f3 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/GLF.py +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/GLF.py @@ -431,46 +431,43 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis): return 1 def marine_abbreviateText(self, fcst): - fcst = " " + fcst - fcst = re.sub(r'\n', r' ',fcst) - fcst = re.sub(r'(?i)(\W)NORTH(?!WARD|ERN|WESTWARD|EASTWARD|WESTERN|EASTERN)(\W)', r'\1N\2', fcst) - fcst = re.sub(r'(?i)(\W)SOUTH(?!WARD|ERN|WESTWARD|EASTWARD|WESTERN|EASTERN)(\W)', r'\1S\2', fcst) - fcst = re.sub(r'(?i)(\W)EAST(?!WARD|ERN)(\W)', r'\1E\2', fcst) - fcst = re.sub(r'(?i)(\W)WEST(?!WARD|ERN)(\W)', r'\1W\2', fcst) - fcst = re.sub(r'(?i)(\W)KNOTS?(\W)', r'\1KT\2', fcst) - fcst = re.sub(r'(?i)(\W)MILLIBARS?(\W)', r'\1MB\2', fcst) - fcst = re.sub(r'(?i)(\W)FATHOMS?(\W)', r'\1FM\2', fcst) - fcst = re.sub(r'(?i)(\W)NAUTICAL MILES?(\W)', r'\1NM\2', fcst) - fcst = re.sub(r'(?i)(\W)FOOT|FEET(\W)', r'\1FT\2', fcst) - fcst = re.sub(r'(?i)(\W)POSITION(\W)', r'\1PSN\2', fcst) - fcst = re.sub(r'(?i)(\W)VISIBILITY(\W)', r'\1VSBY\2', fcst) - fcst = re.sub(r'(?i)(\W)THUNDERSTORM(\W)', r'\1TSTM\2', fcst) - fcst = re.sub(r'(?i)(\W)AVERAGE(\W)', r'\1AVG\2', fcst) - fcst = re.sub(r'(?i)(\W)ATLANTIC(\W)', r'\1ATLC\2', fcst) - fcst = re.sub(r'(?i)(\W)LONGITUDE(\W)', r'\1LONG\2', fcst) - fcst = re.sub(r'(?i)(\W)PACIFIC(\W)', r'\1PAC\2', fcst) - fcst = re.sub(r'(?i)(\W)DEGREE(\W)', r'\1DEG\2', fcst) - fcst = re.sub(r'(?i)(\W)PRESSURE(\W)', r'\1PRES\2', fcst) - fcst = re.sub(r'(?i)(\W)SUNDAY(\W)', r'\1SUN\2', fcst) - fcst = re.sub(r'(?i)(\W)MONDAY(\W)', r'\1MON\2', fcst) - fcst = re.sub(r'(?i)(\W)TUESDAY(\W)', r'\1TUE\2', fcst) - fcst = re.sub(r'(?i)(\W)WEDNESDAY(\W)', r'\1WED\2', fcst) - fcst = re.sub(r'(?i)(\W)THURSDAY(\W)', r'\1THU\2', fcst) - fcst = re.sub(r'(?i)(\W)FRIDAY(\W)', r'\1FRI\2', fcst) - fcst = re.sub(r'(?i)(\W)SATURDAY(\W)', r'\1SAT\2', fcst) - fcst = re.sub(r'(?i)(\W)W HALF(\W)', r'\1WEST HALF\2', fcst) - fcst = re.sub(r'(?i)(\W)E HALF(\W)', r'\1EAST HALF\2', fcst) - fcst = re.sub(r'(?i)(\W)N HALF(\W)', r'\1NORTH HALF\2', fcst) - fcst = re.sub(r'(?i)(\W)S HALF(\W)', r'\1SOUTH HALF\2', fcst) - fcst = re.sub(r'(?i)(\W)W THIRD(\W)', r'\1WEST THIRD\2', fcst) - fcst = re.sub(r'(?i)(\W)E THIRD(\W)', r'\1EAST THIRD\2', fcst) - fcst = re.sub(r'(?i)(\W)N THIRD(\W)', r'\1NORTH THIRD\2', fcst) - fcst = re.sub(r'(?i)(\W)S THIRD(\W)', r'\1SOUTH THIRD\2', fcst) - fcst = re.sub(r'(?i)(\W)W TWO(\W)', r'\1WEST TWO\2', fcst) - fcst = re.sub(r'(?i)(\W)E TWO(\W)', r'\1EAST TWO\2', fcst) - fcst = re.sub(r'(?i)(\W)N TWO(\W)', r'\1NORTH TWO\2', fcst) - fcst = re.sub(r'(?i)(\W)S TWO(\W)', r'\1SOUTH TWO\2', fcst) - fcst = re.sub(r'^ ', r'',fcst) + fcst = re.sub(r'(?i)(\W|^)NORTH(?!WARD|ERN|WESTWARD|EASTWARD|WESTERN|EASTERN)(?=\W|$)', r'\1N', fcst) + fcst = re.sub(r'(?i)(\W|^)SOUTH(?!WARD|ERN|WESTWARD|EASTWARD|WESTERN|EASTERN)(?=\W|$)', r'\1S', fcst) + fcst = re.sub(r'(?i)(\W|^)EAST(?!WARD|ERN)(?=\W|$)', r'\1E', fcst) + fcst = re.sub(r'(?i)(\W|^)WEST(?!WARD|ERN)(?=\W|$)', r'\1W', fcst) + fcst = re.sub(r'(?i)(\W|^)KNOTS?(?=\W|$)', r'\1kt', fcst) + fcst = re.sub(r'(?i)(\W|^)MILLIBARS?(?=\W|$)', r'\1mb', fcst) + fcst = re.sub(r'(?i)(\W|^)FATHOMS?(?=\W|$)', r'\1fm', fcst) + fcst = re.sub(r'(?i)(\W|^)NAUTICAL MILES?(?=\W|$)', r'\1nm', fcst) + fcst = re.sub(r'(?i)(\W|^)(?:FOOT|FEET)(?=\W|$)', r'\1ft', fcst) + fcst = re.sub(r'(?i)(\W|^)POSITION(?=\W|$)', r'\1PSN', fcst) + fcst = re.sub(r'(?i)(\W|^)VISIBILITY(?=\W|$)', r'\1VSBY', fcst) + fcst = re.sub(r'(?i)(\W|^)THUNDERSTORM(?=\W|$)', r'\1TSTM', fcst) + fcst = re.sub(r'(?i)(\W|^)AVERAGE(?=\W|$)', r'\1AVG', fcst) + fcst = re.sub(r'(?i)(\W|^)ATLANTIC(?=\W|$)', r'\1ATLC', fcst) + fcst = re.sub(r'(?i)(\W|^)LONGITUDE(?=\W|$)', r'\1LONG', fcst) + fcst = re.sub(r'(?i)(\W|^)PACIFIC(?=\W|$)', r'\1PAC', fcst) + fcst = re.sub(r'(?i)(\W|^)DEGREE(?=\W|$)', r'\1deg', fcst) + fcst = re.sub(r'(?i)(\W|^)PRESSURE(?=\W|$)', r'\1PRES', fcst) + fcst = re.sub(r'(?i)(\W|^)SUNDAY(?=\W|$)', r'\1Sun', fcst) + fcst = re.sub(r'(?i)(\W|^)MONDAY(?=\W|$)', r'\1Mon', fcst) + fcst = re.sub(r'(?i)(\W|^)TUESDAY(?=\W|$)', r'\1Tue', fcst) + fcst = re.sub(r'(?i)(\W|^)WEDNESDAY(?=\W|$)', r'\1Wed', fcst) + fcst = re.sub(r'(?i)(\W|^)THURSDAY(?=\W|$)', r'\1Thu', fcst) + fcst = re.sub(r'(?i)(\W|^)FRIDAY(?=\W|$)', r'\1Fri', fcst) + fcst = re.sub(r'(?i)(\W|^)SATURDAY(?=\W|$)', r'\1Sat', fcst) + fcst = re.sub(r'(?i)(\W|^)W HALF(?=\W|$)', r'\1West half', fcst) + fcst = re.sub(r'(?i)(\W|^)E HALF(?=\W|$)', r'\1east half', fcst) + fcst = re.sub(r'(?i)(\W|^)N HALF(?=\W|$)', r'\1north half', fcst) + fcst = re.sub(r'(?i)(\W|^)S HALF(?=\W|$)', r'\1soutH half', fcst) + fcst = re.sub(r'(?i)(\W|^)W THIRD(?=\W|$)', r'\1west third', fcst) + fcst = re.sub(r'(?i)(\W|^)E THIRD(?=\W|$)', r'\1east third', fcst) + fcst = re.sub(r'(?i)(\W|^)N THIRD(?=\W|$)', r'\1north third', fcst) + fcst = re.sub(r'(?i)(\W|^)S THIRD(?=\W|$)', r'\1south third', fcst) + fcst = re.sub(r'(?i)(\W|^)W TWO(?=\W|$)', r'\1west two', fcst) + fcst = re.sub(r'(?i)(\W|^)E TWO(?=\W|$)', r'\1east two', fcst) + fcst = re.sub(r'(?i)(\W|^)N TWO(?=\W|$)', r'\1north two', fcst) + fcst = re.sub(r'(?i)(\W|^)S TWO(?=\W|$)', r'\1south two', fcst) return fcst def rounding_method_dict(self, tree, node): @@ -608,7 +605,7 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis): # Get the edit areas try: - if self._groupings == "West 1/3:East 2/3": + if self._groupings == "West 1/3:east 2/3": self._areaList = [("west_one_third", "WEST THIRD"), ("east_two_thirds", "EAST TWO THIRDS")] elif self._groupings == "West 2/3:East 1/3": @@ -782,7 +779,7 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis): def _preProcessProduct(self, fcst, argDict): if self._areaName != "": - productName = self._productName.strip() + " FOR " + \ + productName = self._productName.strip() + " for " + \ self._areaName.strip() else: productName = self._productName.strip() @@ -790,13 +787,15 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis): issuedByString = self.getIssuedByString() productName = self.checkTestMode(argDict, productName) - fcst = fcst + self._wmoID + " " + self._fullStationID + " " + \ + s = self._wmoID + " " + self._fullStationID + " " + \ self._ddhhmmTime + "\n" + self._pil + '\n' + \ self._lakezone + "-" + self._expireTimeDDHHMM + "-\n\n" +\ productName + "\n" +\ "National Weather Service " + self._wfoCityState + \ - "\n" + issuedByString + self._timeLabel + "\n\n" + \ - self._headerphrase + "\n\n" + ".SYNOPSIS..." + "\n\n" + "\n" + issuedByString + self._timeLabel + "\n\n" + fcst = fcst + s.upper() + + fcst = fcst + self._headerphrase + "\n\n" + ".SYNOPSIS..." + "\n\n" # Set up hazards self.getHazards(argDict, self._areaList) @@ -855,12 +854,12 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis): # Adjust some phrases to local requirements # ======================================== - fcst = string.replace(fcst,"WIDESPREAD RAIN", "OCCASIONAL RAIN") - fcst = string.replace(fcst,"WIDESPREAD SHOWERS", "SHOWERS") - fcst = string.replace(fcst,"WIDESPREAD THUNDERSTORMS", "THUNDERSTORMS") + fcst = string.replace(fcst,"widespread rain", "occasional rain") + fcst = string.replace(fcst,"widespread showers", "showers") + fcst = string.replace(fcst,"widespread thunderstorms", "thunderstorms") - fcst = string.replace(fcst, "RAIN SHOWERS", "SHOWERS") - fcst = string.replace(fcst, "THUNDERSTORMS AND SHOWERS", "SHOWERS AND THUNDERSTORMS") + fcst = string.replace(fcst, "rain showers", "showers") + fcst = string.replace(fcst, "thunderstorms and showers", "showers and thunderstorms") #phrase = string.replace(phrase, "widespread", "") # This is the footer for an edit area combination @@ -870,9 +869,9 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis): fcst = fcst + "$$\n\n" - if string.find(fcst, "STORM FORCE") > 0 or\ - string.find(fcst, "STORM WARNING") > 0 or\ - string.find(fcst, "HURRICANE") > 0: + if string.find(fcst, "storm force") > 0 or\ + string.find(fcst, "storm warning") > 0 or\ + string.find(fcst, "hurricane") > 0: fcst = fcst + "&&STORM\n\n" if self._processmafor == 1: @@ -965,9 +964,9 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis): def splitDay24HourLabel_flag(self, tree, node): # Return 0 to have the TimeDescriptor module label 24 hour periods - # with simply the weekday name (e.g. SATURDAY) + # with simply the weekday name (e.g. Saturday) # instead of including the day and night periods - # (e.g. SATURDAY AND SATURDAY NIGHT) + # (e.g. Saturday and Saturday night) # NOTE: If you set this flag to 1, make sure the "nextDay24HourLabel_flag" # is set to zero. # NOTE: This applied only to periods that are exactly 24-hours in length. diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/GenericHazards.py b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/GenericHazards.py index 2f68b454d2..e0e8e1173e 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/GenericHazards.py +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/GenericHazards.py @@ -273,7 +273,7 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis, def _preProcessProduct(self, fcst, argDict): # Product header if self._areaName != "": - self._areaName = " FOR " + self._areaName + self._areaName = " for " + self._areaName issuedByString = self.getIssuedByString() productName = self.checkTestMode(argDict, self._productName + self._areaName) @@ -283,11 +283,12 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis, else: eas = '' - fcst = fcst + self._wmoID + " " + self._fullStationID + " " + \ + s = self._wmoID + " " + self._fullStationID + " " + \ self._ddhhmmTime + "\n" + self._pil + "\n\n" +\ eas + productName + "\n" +\ "National Weather Service " + self._wfoCityState + \ - "\n" + issuedByString + self._timeLabel + "\n\n" + "\n" + issuedByString + self._timeLabel + "\n\n" + fcst = fcst + s.upper() fcst = fcst + "Default overview section\n" return fcst @@ -503,9 +504,9 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis, continue #no defined headline, skip phrase endTimePhrase = self.hazardTimePhrases(eachHazard, argDict) hazNameA = self.hazardName(eachHazard['hdln'], argDict, True) + hazNameACap = self.sentence(hazNameA, addPeriod=False) hazName = self.hazardName(eachHazard['hdln'], argDict, False) -# if hazName == "Winter Weather Advisory" or hazName == "Winter Storm Warning": if hazName in ["Winter Weather Advisory", "Winter Storm Warning", "Beach Hazards Statement"]: forPhrase = " for |* Enter hazard type *|" else: @@ -527,18 +528,18 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis, phraseCount = 2 if hdln != lastHdln: if eachHazard['phen'] in ['HU', 'TR', 'TY']: - hazardBodyPhrase = hazardBodyPhrase + hazNameA + \ + hazardBodyPhrase = hazardBodyPhrase + hazNameACap + \ " has also been issued." else: - hazardBodyPhrase = hazardBodyPhrase + hazNameA + \ + hazardBodyPhrase = hazardBodyPhrase + hazNameACap + \ " has also been issued. This " + hazName + forPhrase + \ " is in effect" + endTimePhrase + ". " else: if eachHazard['phen'] in ['HU', 'TR', 'TY']: - hazardBodyPhrase = hazardBodyPhrase + hazNameA + \ + hazardBodyPhrase = hazardBodyPhrase + hazNameACap + \ " has also been issued." else: - hazardBodyPhrase = hazardBodyPhrase + hazNameA + forPhrase + \ + hazardBodyPhrase = hazardBodyPhrase + hazNameACap + forPhrase + \ " has also been issued" + endTimePhrase + ". " else: if eachHazard['phen'] in ['HU', 'TR', 'TY']: @@ -564,7 +565,7 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis, hazardBodyPhrase = hazardBodyPhrase + \ " has cancelled the " + hazName + ". " else: - hazardBodyPhrase = hazardBodyPhrase + "THE " + hazName + \ + hazardBodyPhrase = hazardBodyPhrase + "The " + hazName + \ " has been cancelled. " # @@ -579,13 +580,13 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis, continue # No attribution for this case if it is a bullet product hazName = self.hazardName(eachHazard['hdln'], argDict, False) if eachHazard['endTime'] <= argDict['creationTime']: - hazardBodyPhrase = hazardBodyPhrase + "THE " + hazName + \ + hazardBodyPhrase = hazardBodyPhrase + "The " + hazName + \ " is no longer in effect. " else: expTimeCurrent = argDict['creationTime'] timeWords = self.getTimingPhrase(eachHazard, expTimeCurrent) - hazardBodyPhrase = hazardBodyPhrase + "THE " + hazName + \ + hazardBodyPhrase = hazardBodyPhrase + "The " + hazName + \ " will expire " + timeWords + ". " # @@ -600,7 +601,7 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis, endTimePhrase = self.hazardTimePhrases(eachHazard, argDict) hazName = self.hazardName(eachHazard['hdln'], argDict, False) - hazardBodyPhrase = hazardBodyPhrase + "THE " + hazName + \ + hazardBodyPhrase = hazardBodyPhrase + "The " + hazName + \ " is now in effect" + endTimePhrase + ". " # @@ -611,7 +612,7 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis, if len(eachHazard['hdln']) == 0: continue #no defined headline, skip phrase hazName = self.hazardName(eachHazard['hdln'], argDict, False) - hazardBodyPhrase = hazardBodyPhrase + "THE " + hazName + \ + hazardBodyPhrase = hazardBodyPhrase + "The " + hazName + \ " is no longer in effect. " # @@ -670,6 +671,7 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis, startPara = 1 else: startPara = 2 + segmentText, foundCTAs = self.cleanCapturedText(prevText, startPara, addFramingCodes = False, skipCTAs = skipCTAs) diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/GenericReport.py b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/GenericReport.py index 5fc1dbd00e..f55ea65009 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/GenericReport.py +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/GenericReport.py @@ -251,7 +251,7 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis): def _preProcessProduct(self, fcst, argDict): # Product header if self._areaName != "": - productName = self._productName.strip() + " FOR " + \ + productName = self._productName.strip() + " for " + \ self._areaName.strip() else: productName = self._productName.strip() diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/HLS.py b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/HLS.py index 5a6b8623ac..0934fd3ec1 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/HLS.py +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/HLS.py @@ -2120,10 +2120,10 @@ class TextProduct(HLSTCV_Common.TextProduct): return direction def _dirInEnglish(self, direction): - dirList = ["North", "North-Northeast", "Northeast", "East-Northeast", - "East", "East-Southeast", "Southeast", "South-Southeast", - "South", "South-Southwest", "Southwest", "West-Southwest", - "West", "West-Northwest", "Northwest", "North-NorthWest"] + dirList = ["north", "north-northeast", "northeast", "east-northeast", + "east", "east-southeast", "southeast", "south-southeast", + "south", "south-southwest", "southwest", "west-southwest", + "west", "west-northwest", "northwest", "north-northwest"] dirIndex = int((direction + 11.25) / 22.5) if dirIndex > 15: dirIndex = dirIndex - 16 diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/Hazard_AQA_MultiPil.py b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/Hazard_AQA_MultiPil.py index bb98f57be7..127ba91c7d 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/Hazard_AQA_MultiPil.py +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/Hazard_AQA_MultiPil.py @@ -24,6 +24,7 @@ # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # Oct 20, 2014 #3685 randerso Changed to support mixed case +# Apr 28, 2015 #4027 randerso Additional changes for mixed case # ## @@ -90,14 +91,14 @@ class TextProduct(GenericHazards.TextProduct): "name": "Forsyth County Environmental Affairs Department Winston-Salem NC", "declaration": "The Forsyth County Environmental Affairs Department has issued an Air Quality Action Day...", "zones": ["FLZ039"], - "text": "A Code @ALERTCODE Air Quality Alert for Ozone has been issued. Ground level ozone concentrations within the region may approach or exceed unhealthy standards. @ALERTCTA For additional information...please visit the Forsyth County Environmental Affairs Department Web site at http://www.co.forsyth.nc.us/envaffairs.", + "text": "A Code @ALERTCODE Air Quality Alert for Ozone has been issued. Ground level ozone concentrations within the region may approach or exceed unhealthy standards. @ALERTCTA For additional information...please visit the Forsyth County Environmental Affairs Department web site at http://www.co.forsyth.nc.us/envaffairs.", }, "NC": { "name": "North Carolina Department of Environmental and Natural Resources Raleigh NC", "declaration": "The North Carolina Department of Environmental and Natural Resources has issued an Air Quality Action Day...", "zones" : ["FLZ042", "FLZ043","FLZ048"], - "text": "A Code @ALERTCODE Air Quality Alert for Ozone has been issued. Ground level ozone concentrations within the region may approach or exceed unhealthy standards. @ALERTCTA For additional information...please visit the North Carolina Division of Air Quality Web site at http://daq.state.nc.us/airaware/forecast/.", + "text": "A Code @ALERTCODE Air Quality Alert for Ozone has been issued. Ground level ozone concentrations within the region may approach or exceed unhealthy standards. @ALERTCTA For additional information...please visit the North Carolina Division of Air Quality web site at http://daq.state.nc.us/airaware/forecast/.", }, } @@ -150,19 +151,19 @@ class TextProduct(GenericHazards.TextProduct): # Product header if self._areaName != "": - productName = self._productName.strip() + " FOR " + \ + productName = self._productName.strip() + " for " + \ self._areaName.strip() else: productName = self._productName.strip() issuedByString = self.getIssuedByString() productName = self.checkTestMode(argDict, productName) - fcst = fcst + self._wmoID + " " + self._fullStationID + " " +\ + s = self._wmoID + " " + self._fullStationID + " " +\ self._ddhhmmTime + "\n" + self._pil + "\n\n" + productName + "\n" # Placeholder for Agency Names to be filled in in _postProcessProduct - #fcst = fcst + "@AGENCYNAMES" + "\n" - s = "Relayed by National Weather Service " + self._wfoCityState + "\n" +\ + #s = s + "@AGENCYNAMES" + "\n" + s = s + "Relayed by National Weather Service " + self._wfoCityState + "\n" +\ issuedByString + self._timeLabel + "\n\n" fcst = fcst + s.upper() diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/Hazard_CFW_MultiPil.py b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/Hazard_CFW_MultiPil.py index fd972a1565..4efe67c687 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/Hazard_CFW_MultiPil.py +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/Hazard_CFW_MultiPil.py @@ -203,7 +203,7 @@ class TextProduct(GenericHazards.TextProduct): for each in fullKeyList: if each in ['LS.W', 'LS.A', 'LS.Y', 'LS.S']: productName = "Lakeshore Hazard Message" - fcst = fcst.replace(self._productName, productName, 1) + fcst = fcst.replace(self._productName.upper(), productName.upper(), 1) break # Added to place line feeds in the CAP tags to keep separate from CTAs diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/Hazard_FFA_MultiPil.py b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/Hazard_FFA_MultiPil.py index 7e170e38c9..18e7cfd582 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/Hazard_FFA_MultiPil.py +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/Hazard_FFA_MultiPil.py @@ -133,7 +133,7 @@ class TextProduct(GenericHazards.TextProduct): # if self._areaName != "": - self._areaName = " FOR " + self._areaName + self._areaName = " for " + self._areaName if useEAS == 1: easPhrase = "URGENT - IMMEDIATE BROADCAST REQUESTED\n" else: @@ -142,12 +142,14 @@ class TextProduct(GenericHazards.TextProduct): issuedByString = self.getIssuedByString() productName = self.checkTestMode(argDict, self._productName) - fcst = fcst + self._wmoID + " " + self._fullStationID + " " + \ + s = self._wmoID + " " + self._fullStationID + " " + \ self._ddhhmmTime + "\n" + self._pil + "\n\n" + easPhrase +\ productName + "\n" +\ "National Weather Service " + self._wfoCityState + \ "\n" + issuedByString + self._timeLabel + "\n" + \ self._easPhrase + "\n\n" + fcst = fcst + s.upper() + fcst = fcst + "Default overview section\n" return fcst @@ -293,9 +295,9 @@ class TextProduct(GenericHazards.TextProduct): #period. areaGroupLen = len(areaGroups) if areaGroupLen == 1: - areaPhrase = "A portion of " + areaPhrase = "a portion of " else: - areaPhrase = "Portions of " + areaPhrase = "portions of " #parts of the states areaGroupCount = 0 @@ -304,7 +306,7 @@ class TextProduct(GenericHazards.TextProduct): if areaGroupCount == 1: conn = "" elif areaGroupCount == areaGroupLen: - conn = " AND " + conn = " and " else: conn = "..." @@ -324,39 +326,39 @@ class TextProduct(GenericHazards.TextProduct): countyCnt = 0 for state, partOfState, names in areaGroups: for name,nameType in names: - if nameType == "Zone": + if nameType == "zone": zoneCnt = zoneCnt + 1 - elif nameType == "County": + elif nameType == "county": countyCnt = countyCnt + 1 - elif nameType == "Independent city": + elif nameType == "independent city": icCnt = icCnt + 1 - elif nameType == "Parish": + elif nameType == "parish": parishCnt = parishCnt + 1 incPhrases = [] if zoneCnt == 1: - incPhrases.append("Area") + incPhrases.append("area") elif zoneCnt > 1: - incPhrases.append("Areas") + incPhrases.append("areas") if countyCnt == 1: - incPhrases.append("County") + incPhrases.append("county") elif countyCnt > 1: - incPhrases.append("Counties") + incPhrases.append("counties") if icCnt == 1: - incPhrases.append("Independent city") + incPhrases.append("independent city") elif icCnt > 1: - incPhrases.append("Independent cities") + incPhrases.append("independent cities") if parishCnt == 1: - incPhrases.append("Parish") + incPhrases.append("parish") elif parishCnt > 1: - incPhrases.append("Parishes") - incPhrase = " AND ".join(incPhrases) + incPhrases.append("parishes") + incPhrase = " and ".join(incPhrases) if generalOnly: return areaPhrase - areaPhrase = areaPhrase + "...Including the following " + \ + areaPhrase = areaPhrase + "...including the following " + \ incPhrase + "..." #list of the specific areas @@ -375,7 +377,10 @@ class TextProduct(GenericHazards.TextProduct): phrase = "...".join(snames[0:-1]) # complex phrasing (state, partOfState, and names) else: - phrase = "IN " + if i == 0: + phrase = "in " + else: + phrase = "In " if partOfState != '' and partOfState != ' ': phrase = phrase + partOfState + ' ' phrase = phrase + state + "..." + "...".join(snames[0:-1]) @@ -383,7 +388,7 @@ class TextProduct(GenericHazards.TextProduct): if len(snames) == 1: phrase = phrase + snames[-1] else: - phrase = phrase + " AND " + snames[-1] + phrase = phrase + " and " + snames[-1] areaPhrase = areaPhrase + phrase if i != len(areaGroups) - 1: areaPhrase = areaPhrase + '. ' #another one coming, add period @@ -413,7 +418,7 @@ class TextProduct(GenericHazards.TextProduct): if hazard['act'] == 'NEW' and len(hazard['hdln']): attribution = nwsPhrase + "issued a" - headPhrase = "* " + hazName + " FOR " + areaPhrase + "." + headPhrase = "* " + hazName + " for " + areaPhrase + "." elif hazard['act'] == 'CON' and len(hazard['hdln']): attribution = "The " + hazName + " continues for" diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/Hazard_HLS.py b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/Hazard_HLS.py index 313742caa5..74d4451c21 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/Hazard_HLS.py +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/Hazard_HLS.py @@ -1040,7 +1040,7 @@ class TextProduct(GenericHazards.TextProduct): # Product header if self._areaName != "": - self._areaName = " FOR " + self._areaName + self._areaName = " for " + self._areaName issuedByString = self.getIssuedByString() productName = self.checkTestMode(argDict, actualProductName + self._areaName) @@ -1049,11 +1049,12 @@ class TextProduct(GenericHazards.TextProduct): else: eas = '' - fcst = fcst + self._wmoID + " " + self._fullStationID + " " + \ + s = self._wmoID + " " + self._fullStationID + " " + \ self._ddhhmmTime + "\n" + self._pil + "\n\n" +\ eas + productName + "\n" +\ "National Weather Service " + self._wfoCityState + \ "\n" + issuedByString + self._timeLabel + "\n\n" + fcst = fcst + s.upper() # Main Headline mh = self._MainHeadline @@ -2833,10 +2834,10 @@ class TextProduct(GenericHazards.TextProduct): def _dirInEnglish(self, direction): - dirList = ["North", "North-Northeast", "Northeast", "East-Northeast", - "East", "East-Southeast", "Southeast", "South-Southeast", - "South", "South-Southwest", "Southwest", "West-Southwest", - "West", "West-Northwest", "Northwest", "North-NorthWest"] + dirList = ["north", "north-northeast", "northeast", "east-northeast", + "east", "east-southeast", "southeast", "south-southeast", + "south", "south-southwest", "southwest", "west-southwest", + "west", "west-northwest", "northwest", "north-northwest"] dirIndex = int((direction + 11.25) / 22.5) if dirIndex > 15: dirIndex = dirIndex - 16 @@ -2873,7 +2874,7 @@ class TextProduct(GenericHazards.TextProduct): if act in self._ignoreActions(): continue if hdlns.index(hazardHdln) > 0: - t+= " AND " + t+= " and " t+= "A " + hdln reported += 1 if reported > 0: @@ -2936,7 +2937,7 @@ class TextProduct(GenericHazards.TextProduct): if areaCount == 1: conn = "" elif areaCount == areaLen: - conn = " AND " + conn = " and " else: conn = "..." if generalArea[1] != "": @@ -3384,9 +3385,9 @@ class TextProduct(GenericHazards.TextProduct): # Skip HU.S headines if (phen =='HU' and sig =='S'): continue - if hdln[0] in ["A","I"]:a='AN ' - elif hdln.find("FOR") == 0: a = ' ' - else: a ='A ' + if hdln[0] in ["A","I"]:a='an ' + elif hdln.find("for") == 0: a = ' ' + else: a ='a ' #print "\n Headline", hdln, phen if areaWordMethod is not None: @@ -3443,7 +3444,7 @@ class TextProduct(GenericHazards.TextProduct): # t+="but will continue to be monitored until it no longer threatens the area. " # # else: - t+="AT "+ self._stormTime + "...the center of " + t+="At "+ self._stormTime + "...the center of " # Fix the grammar if dealing with "remnants" if re.search("(?i)remnants", self._stormTypeName) is not None: @@ -3504,7 +3505,7 @@ class TextProduct(GenericHazards.TextProduct): if act in self._ignoreActions(): continue if hdlns.index(hazardHdln) > 0: - t+= " AND " + t+= " and " t+= "A " + hdln reported += 1 if reported > 0: @@ -4052,7 +4053,7 @@ remain in port until this storm passes. if act in self._ignoreActions(): continue if hdlns.index(hazardHdln) > 0: - t+= " AND " + t+= " and " t+= "A " + hdln reported += 1 if reported > 0: @@ -4710,7 +4711,7 @@ remain in port until this storm passes. "marine":self._frame("Small craft should remain in port or safe harbor until winds and seas subside. For any small craft who are in distress...or if you see someone else in distress...radio your situation according to maritime protocol. If appropriate...deploy your emergency distress beacon.")+"\n", }, "NoImpact": { - "general": self._frame("THIS EVENT IS NO LONGER EXPECTED TO HAVE AN IMPACT ACROSS THE AREA AT THIS TIME. USE THE OPPORTUNITY TO REVISE PREPAREDNESS PLANS AND REMAIN PREPARED FOR FUTURE EVENTS.\n\nAdd other wrap-up wording here.")+"\n", + "general": self._frame("This event is no longer expected to have an impact across the area at this time. Use the opportunity to revise preparedness plans and remain prepared for future events.\n\nAdd other wrap-up wording here.")+"\n", }, "LongTerm": { "land": self._frame("Continue to listen to NOAA weather radio and other local news media for the latest information on storm impacts.\n\nIf you are using a portable generator...observe all safety precautions to avoid carbon monoxide poisoning...electrocution...or fires. Portable generators should be operated outdoors...in a dry and well ventilated place. Do not store fuel inside your home or garage.\n\nChain saws can be very helpful when removing fallen trees and large branches. Yet...operating a chain saw is dangerous work. Be sure to review operating procedures for safe cutting. To reduce the chance of mishap or injury...work with another person who has experience.\n\nDo not go sight seeing into areas which have been hardest hit as you may hinder ongoing rescue and recovery operations.\n\nStay out of flooded areas as the water may be contaminated or the road might have been washed away. Test drinking water before using...particularly from wells. Stay away from downed power lines too.")+"\n\n", @@ -4723,13 +4724,13 @@ remain in port until this storm passes. return { "InProgress": self._frame( """ -although the system is losing its tropical characteristics...the +Although the system is losing its tropical characteristics...the potential impacts are similar to those previously indicated regardless of its nature. Continue with readiness actions as recommended."""), "Completed": self._frame( """ -although the system has become non-tropical...the potential +Although the system has become non-tropical...the potential impacts are similar to those previously indicated. Continue with readiness actions as recommended."""), } diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/Hazard_HWO_MultiPil.py b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/Hazard_HWO_MultiPil.py index 7bcd928c52..201eb335b9 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/Hazard_HWO_MultiPil.py +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/Hazard_HWO_MultiPil.py @@ -144,7 +144,7 @@ class TextProduct(GenericReport.TextProduct): if areaCount == 1: conn = "" elif areaCount == areaLen: - conn = " AND " + conn = " and " else: conn = "..." if eachGeneralArea[1] != "": diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/Hazard_RFW_MultiPil.py b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/Hazard_RFW_MultiPil.py index b25de033e1..2c45bb0d7d 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/Hazard_RFW_MultiPil.py +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/Hazard_RFW_MultiPil.py @@ -480,7 +480,7 @@ class TextProduct(GenericHazards.TextProduct): if self._elevationSource == "Grids": ### initialize the phrase - le = " FOR " + le = " for " ### Set the phrase from the forecaster selections if len(self._rfwType) > 0: ### add the event type @@ -489,7 +489,7 @@ class TextProduct(GenericHazards.TextProduct): le = le + phraseDict.get(t)[0] ### add zone numbers or generic location description to headline if self._numInHeadline == 0: - le = le + "For |* location description *|" + le = le + "for |* location description *|" else: le = le + self._headlineNumbers(hazard['id']) else: @@ -577,9 +577,9 @@ class TextProduct(GenericHazards.TextProduct): numList.sort() ### initialize the zone number list if len(numList) > 1: - numStr = "For fire weather zones " + numStr = "for fire weather zones " else: - numStr = "For fire weather zone " + numStr = "for fire weather zone " i = 0 for i in range (len(numList)): @@ -588,7 +588,7 @@ class TextProduct(GenericHazards.TextProduct): elif (len(numList) - i) > 2: ### more than three zones, and/or last zone in list numStr = numStr + numList[i] + "..." elif (len(numList) - i) > 1: ### next to last zone in list - numStr = numStr + numList[i] + " AND " + numStr = numStr + numList[i] + " and " return numStr @@ -657,7 +657,7 @@ class TextProduct(GenericHazards.TextProduct): ### include state name if self._includeStateName == 1: - nameString = nameString + "IN " + stateList[0] + "..." + nameString = nameString + "In " + stateList[0] + "..." ### sort based on zone number ugcList = sorted(ugcList, key=lambda ugc: ugc[2]) @@ -680,14 +680,14 @@ class TextProduct(GenericHazards.TextProduct): elif (len(ugcList) - i) > 2: ### more than three zones, and/or last zone in list nameString = nameString + ugcList[i][2] + " " + "..." elif (len(ugcList) - i) == 2: ### next to last zone in list - nameString = nameString + ugcList[i][2] + " " + " AND " + nameString = nameString + ugcList[i][2] + " " + " and " else: ### more than one state for state in stateList: ### include state name if self._includeStateName == 1: - nameString = nameString + "IN " + state + "..." + nameString = nameString + "In " + state + "..." newList = [] ### split up ugcList for each state. for st, name, num in ugcList: @@ -715,7 +715,7 @@ class TextProduct(GenericHazards.TextProduct): elif (len(newList) - i) > 2: ### more than three zones, and/or last zone in list nameString = nameString+ newList[i][0] + " " + "..." elif (len(newList) - i) == 2: ### next to last zone in list - nameString = nameString + newList[i][0] + " " + " AND " + nameString = nameString + newList[i][0] + " " + " and " ### get rid of any spaces in the ellipses nameString = nameString.replace("... ","...") @@ -810,7 +810,7 @@ class TextProduct(GenericHazards.TextProduct): else: hazardTypeForWeather = "" - forPhrase = " FOR " + hazardTypeForWeather + forPhrase = " for " + hazardTypeForWeather return forPhrase diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/Hazard_TCV.py b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/Hazard_TCV.py index 2adf1e7105..c1d6ebabb9 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/Hazard_TCV.py +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/Hazard_TCV.py @@ -641,21 +641,21 @@ class TextProduct(HLSTCV_Common.TextProduct): phen, sig = phenSig.split('.') headline = VTECTable.VTECTable[phenSig]["hdln"] - definition = "A " + headline + " MEANS " + definition = "A " + headline + " means " if phen == "HU": - definition += "HURRICANE WIND CONDITIONS" + definition += "Hurricane wind conditions" elif phen == "TR": - definition += "TROPICAL STORM WIND CONDITIONS" + definition += "Tropical storm wind conditions" elif phen == "SS": - definition += "LIFE THREATENING INUNDATION LEVELS" + definition += "Life threatening inundation levels" else: return "" if sig == "W": # Warning - definition += " ARE EXPECTED SOMEWHERE WITHIN THIS AREA AND WITHIN THE NEXT 36 HOURS" + definition += " are expected somewhere within this area and within the next 36 hours" elif sig == "A": # Watch - definition += " ARE POSSIBLE SOMEWHERE WITHIN THIS AREA AND WITHIN THE NEXT 48 HOURS" + definition += " are possible somewhere within this area and within the next 48 hours" return definition @@ -1940,7 +1940,7 @@ class FloodingRainSection(SectionCommon): self._setProductPartValue(segmentDict, 'forecastSubsection', subsectionDict) def _latestForecastSummary(self, segmentDict, productSegmentGroup, productSegment): - summary = "" # was "No flood watch is in effect" + summary = "" # was "No Flood Watch is in effect" segment, vtecRecords = productSegment headlines, _ = self._textProduct._getAdditionalHazards() diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/Hazard_WCN_MultiPil.py b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/Hazard_WCN_MultiPil.py index d721fb3d67..d5169bdc71 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/Hazard_WCN_MultiPil.py +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/Hazard_WCN_MultiPil.py @@ -112,7 +112,7 @@ class TextProduct(GenericHazards.TextProduct): # if self._areaName != "": - self._areaName = " FOR " + self._areaName + self._areaName = " for " + self._areaName issuedByString = self.getIssuedByString() productName = self.checkTestMode(argDict, self._productName + watchPhrase) @@ -375,16 +375,16 @@ class TextProduct(GenericHazards.TextProduct): county2 = "In {area} this allows to expire {number} {placeTypes}" indepCity1 = "In {area} this allows to expire {number} " +\ "independent city" - indepCity2 = "IN {area} THIS ALLOWS TO EXPIRE {number} " +\ + indepCity2 = "In {area} this allows to expire {number} " +\ "independent cities" marine = "This allows to expire the following adjacent coastal waters" elif phraseType == "REPLACE": - county1 = "IN {area} THE NEW WATCH INCLUDES {number} {placeType}" - county2 = "IN {area} THE NEW WATCH INCLUDES {number} {placeTypes}" - indepCity1 = "IN {area} THE NEW WATCH INCLUDES {number} " + \ + county1 = "In {area} the new watch includes {number} {placeType}" + county2 = "In {area} the new watch includes {number} {placeTypes}" + indepCity1 = "In {area} the new watch includes {number} " + \ "independent city" - indepCity2 = "IN {area} THE NEW WATCH INCLUDES {number} " + \ + indepCity2 = "In {area} the new watch includes {number} " + \ "independent cities" marine = "The new watch includes the following adjacent coastal waters" @@ -559,7 +559,7 @@ class TextProduct(GenericHazards.TextProduct): def _makeTextFromCountyTuple(self, countyTuple, lineLength=66, colWidth=22, mainFormatSingular="In {area} this watch includes {number} {placeType}", mainFormatPlural="In {area} this watch includes {number} {placeTypes}", - subFormat="IN {area}", mode="byState"): + subFormat="In {area}", mode="byState"): #countyTuple: (state, partOfStateAndState, name) #The type of text depends upon the mode: "byState" or "byPart" diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/MVF.py b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/MVF.py index 9f20f8dd06..05151b8b67 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/MVF.py +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/MVF.py @@ -259,8 +259,9 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis): (self._getAnalysisList(), self._timeRangeList, self._areaList)) def _preProcessProduct(self, fcst, argDict): - fcst = fcst + self._wmoID + " " + self._fullStationID + " " + \ - self._ddhhmmTime + "\n" + self._pil + "\n\n" + s = self._wmoID + " " + self._fullStationID + " " + \ + self._ddhhmmTime + "\n" + self._pil + "\n\n" + fcst = fcst + s.upper() return fcst def _preProcessArea(self, fcst, editArea, areaLabel, argDict): diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/NSH.py b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/NSH.py index 0b9fdaed08..05986d31fc 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/NSH.py +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/NSH.py @@ -69,7 +69,7 @@ # in the AWIPS text database. # This value is also used for the default GUI entry for # storage. -# awipsWANPil Defines the awips product identifier +# awipsWANPil Defines the AWIPS product identifier # (e.g., KBOUCCFDEN) that is used to transmit the # product to the AWIPS WAN. # This value is also used for the default GUI @@ -78,7 +78,7 @@ # grid points in a zone that must contain the hazard # in order for it to be considered. Tuple (percent, points) # -# periodCombining If 1, compnents an attempt will be made to combine components +# periodCombining If 1, components an attempt will be made to combine components # or time periods into one. Otherwise no period combining will # will be done. # useAbbreviations @@ -329,7 +329,6 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis): def postProcessPhrases(self, tree, node): words = node.get("words") if words is not None: - words = string.lower(words) words = string.replace(words, "thunderstorms and rain showers", "showers and thunderstorms") words = string.replace(words, "snow showers and rain showers", "rain and snow showers") @@ -574,7 +573,7 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis): def _preProcessProduct(self, fcst, argDict): if self._areaName != "": - productName = self._productName.strip() + " FOR " + \ + productName = self._productName.strip() + " for " + \ self._areaName.strip() else: productName = self._productName.strip() @@ -582,19 +581,21 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis): issuedByString = self.getIssuedByString() productName = self.checkTestMode(argDict, productName) - fcst = fcst + self._wmoID + " " + self._fullStationID + " " + \ + s = self._wmoID + " " + self._fullStationID + " " + \ self._ddhhmmTime + "\n" + self._pil + "\n\n" +\ productName + "\n" +\ "National Weather Service " + self._wfoCityState + \ - "\n" + issuedByString + self._timeLabel + "\n\n" + \ - self._lakeStmt(argDict) + "\n\n" + "\n" + issuedByString + self._timeLabel + "\n\n" + fcst = fcst + s.upper() + + fcst = fcst + self._lakeStmt(argDict) + "\n\n" fcst = fcst + self._Text1() return fcst def _preProcessArea(self, fcst, editArea, areaLabel, argDict): areaHeader = self.makeAreaHeader( argDict, areaLabel, self._issueTime, self._expireTime, - self._areaDictionary, self._defaultEditAreas) + self._areaDictionary, self._defaultEditAreas, upperCase=True) fcst = fcst + areaHeader # get the hazards text @@ -694,9 +695,9 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis): def splitDay24HourLabel_flag(self, tree, node): # Return 0 to have the TimeDescriptor module label 24 hour periods - # with simply the weekday name (e.g. SATURDAY) + # with simply the weekday name (e.g. Saturday) # instead of including the day and night periods - # (e.g. SATURDAY AND SATURDAY NIGHT) + # (e.g. Saturday and Saturday night) # NOTE: If you set this flag to 1, make sure the "nextDay24HourLabel_flag" # is set to zero. # NOTE: This applied only to periods that are exactly 24-hours in length. diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/OFF.py b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/OFF.py index c9a63fd475..74313da2ed 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/OFF.py +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/OFF.py @@ -514,9 +514,9 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis): def splitDay24HourLabel_flag(self, tree, node): # Return 0 to have the TimeDescriptor module label 24 hour periods - # with simply the weekday name (e.g. SATURDAY) + # with simply the weekday name (e.g. Saturday) # instead of including the day and night periods - # (e.g. SATURDAY AND SATURDAY NIGHT) + # (e.g. Saturday and Saturday night) # NOTE: If you set this flag to 1, make sure the "nextDay24HourLabel_flag" # is set to zero. # NOTE: This applied only to periods that are exactly 24-hours in length. @@ -920,18 +920,20 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis): def _preProcessProduct(self, fcst, argDict): if self._areaName != "": - productName = self._productName.strip() + " FOR " + \ + productName = self._productName.strip() + " for " + \ self._areaName.strip() else: productName = self._productName.strip() issuedByString = self.getIssuedByString() - fcst = fcst + self._wmoID + " " + self._fullStationID + " " + \ + s = self._wmoID + " " + self._fullStationID + " " + \ self._ddhhmmTime + "\n" + self._pil + "\n\n" +\ productName + "\n" +\ "National Weather Service " + self._wfoCityState + \ - "\n" + issuedByString + self._timeLabel + "\n\n" + "\n" + issuedByString + self._timeLabel + "\n\n" + fcst = fcst + s.upper() + fcst = fcst + self._Text1() try: text2 = self._Text2(argDict["host"]) diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/PFM.py b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/PFM.py index cd6d8934d8..f5d65fcf11 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/PFM.py +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/PFM.py @@ -419,7 +419,7 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis): zoneTZ = localTZ tzid = localTZid LogStream.logProblem("WARNING: Entry " + area + - " missing from AreaDictionary. Using default time zone.") + " missing from AreaDictionary. Using default time zone.", LogStream.exc()) if (zoneTZ, tzid) not in tzs: tzs.append((zoneTZ, tzid)) @@ -674,14 +674,15 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis): productName = self.checkTestMode(argDict, productDescription) - fcst = fcst + self._pil + "\n\n" - fcst = fcst + productName + "\n" - fcst = fcst + "National Weather Service " - fcst = fcst + self._wfoCityState +"\n" - fcst = fcst + issuedByString - fcst = fcst + self._mndTimeLabel + "\n\n" + s = self._pil + "\n\n" + \ + productName + "\n" + \ + "National Weather Service " + \ + self._wfoCityState +"\n" + \ + issuedByString + \ + self._mndTimeLabel + "\n\n" + fcst = fcst + s.upper() - return fcst + return fcst def _preProcessArea(self, fcst, editArea, areaLabel, argDict, timeLabel): # extract out the ugc codes and the area descriptors diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/SFT.py b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/SFT.py index 2619282957..9b52a6add2 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/SFT.py +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/SFT.py @@ -41,8 +41,8 @@ # names in one of two formats, depending upon whether # you are supporting regional headers. Choose one and # use it throughout the product. -# (editAreaName, "REGIONLABEL\nCITYLABEL") -# (editAreaName, "CITYLABEL") +# (editAreaName, "Regionlabel\nCitylabel") +# (editAreaName, "Citylabel") # # productName defines name of product e.g. "Tabular State Forecast" # @@ -158,9 +158,9 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis): "outputFile": "{prddir}/TEXT/SFT_.txt", "debug": 0, - "defaultEditAreas": [("area1", "REGION1\nCITY1"), - ("area2", "REGION1\nCITY2"), - ("area3", "REGION2\nCITY3"), + "defaultEditAreas": [("area1", "Region1\nCity1"), + ("area2", "Region1\nCity2"), + ("area3", "Region2\nCity3"), ], # product identifiers @@ -354,15 +354,18 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis): # Add product heading to fcst string issuedByString = self.getIssuedByString() - productName = self._productName + " FOR " + self._stateName + productName = self._productName + " for " + self._stateName productName = self.checkTestMode(argDict, productName) - return fcst + self._wmoID + " " + self._fullStationID + " " + \ + + s = self._wmoID + " " + self._fullStationID + " " + \ self._ddhhmmTime + "\n" + self._pil + "\n" +\ self._zoneCode + "-" + self._ddhhmmTimeExpire + "-\n\n" +\ productName + "\n" +\ "National Weather Service " + self._wfoCityState + \ - "\n" + issuedByString + self._timeLabel + "\n\n" + \ - self._rowDescription() + "\n\n" + self._tableHeader() + "\n\n" + "\n" + issuedByString + self._timeLabel + "\n\n" + fcst = fcst + s.upper() + + return fcst + self._rowDescription() + "\n\n" + self._tableHeader() + "\n\n" def _preProcessArea(self, fcst, editArea, areaLabel, argDict): # determine the region and area names, separated by a new line @@ -582,7 +585,7 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis): def _popTimeLabel(self): # Returns the valid time for the daily POP field - return " NIGHTTIME 6PM-6AM/DAYTIME 6AM-6PM" + return " nighttime 6PM-6AM/daytime 6AM-6PM" def _qpfTimeLabel(self): # Returns the valid time for the daily qpf field @@ -595,30 +598,30 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis): ident = " " # s is the built-up string containing the description - s = "ROWS INCLUDE...\n" + s = "Rows include...\n" # Weather - s = s + ident + "DAILY PREDOMINANT DAYTIME WEATHER 6AM-6PM" + s = s + ident + "Daily predominant daytime weather 6AM-6PM" # Temps s = s + "\n" + ident + \ - "FORECAST TEMPERATURES...EARLY MORNING LOW/DAYTIME HIGH" + "Forecast temperatures...early morning low/daytime high" # PoP if self._alwaysIncludePoP: s = s + "\n" + ident + ident + ident + \ - "PROBABILITY OF PRECIPITATION" + self._popTimeLabel() + "Probability of precipitation" + self._popTimeLabel() # other stuff s = s + "\n" + \ - ident + ident + ident + " - INDICATES TEMPERATURES BELOW ZERO\n" + \ - ident + ident + ident + "MM INDICATES MISSING DATA" + ident + ident + ident + " - indicates temperatures below zero\n" + \ + ident + ident + ident + "MM indicates missing data" #QPF if self._alwaysIncludeQPF: s = s + "\n" + ident + \ - "QUANTITATIVE PRECIPITATION - INCHES -" + \ + "Quantitative precipitation - inches -" + \ self._qpfTimeLabel() diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/SRF.py b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/SRF.py index db69d93481..8235cae90e 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/SRF.py +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/product/SRF.py @@ -59,7 +59,7 @@ # You can copy the information from the AreaDictionary as a starting point. # Then add the following information for each zone: # -# "landSeaArea": An edit area you need to create which contians grid +# "landSeaArea": An edit area you need to create which contains grid # points along the coast, including both land and sea. # "marineArea": Typically, the coastal waters area. # "surfAreas": The surfAreas entry is an optional list of edit areas and labels @@ -67,18 +67,18 @@ # For example, If you have: # # surfAreas: [ -# ("WestCoast", "Surf along west facing reefs.............."), -# ("NorthCoast", "Surf along north facing reefs............."), -# ("EastCoast", "Surf along east facing reefs.............."), -# ("SouthCoast", "Surf along south facing reefs............."), +# ("WestCoast", "SURF ALONG WEST FACING REEFS.............."), +# ("NorthCoast", "SURF ALONG NORTH FACING REEFS............."), +# ("EastCoast", "SURF ALONG EAST FACING REEFS.............."), +# ("SouthCoast", "SURF ALONG SOUTH FACING REEFS............."), # ] # # You would get a surfHeight report for each surfArea listed: # -# Surf along west facing reefs................10 TO 12 feet. -# Surf along north facing reefs...............4 TO 6 feet. -# Surf along east facing reefs................2 TO 3 feet. -# Surf along south facing reefs...............4 TO 6 feet. +# SURF ALONG WEST FACING REEFS................10 TO 12 feet. +# SURF ALONG NORTH FACING REEFS...............4 TO 6 feet. +# SURF ALONG EAST FACING REEFS................2 TO 3 feet. +# SURF ALONG SOUTH FACING REEFS...............4 TO 6 feet. # # If the list is empty, you will simply get surfHeight reported # for the current value of the WaveHeight Grid sampled from the @@ -281,7 +281,7 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis): "ripGrid": "", # Use grid for rip_phrase "waterSpoutGrid": "", # Use grid for waterSpout_phrase "includeOutlook": 0, # If 1, OUTLOOK section included - "outLookText": "\n.OUTLOOK...",# Text for OUTLOOK section + "outLookText": "\n.Outlook...",# Text for OUTLOOK section "tideFiles": { # For each tide table, list the file where it can # be found "Venice Inlet": "/data/local/localapps/tides/VeniceInlet.txt", @@ -313,7 +313,7 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis): "areaDictionary": "SurfAreaDictionary", "language": "english", "synopsisUGC": "", # UGC code for synopsis - "synopsisHeading": ".SYNOPSIS...",# Heading for synopsis + "synopsisHeading": ".Synopsis...",# Heading for synopsis # If individualExtended == 1, an extended forecast will be # generated for each individual area # If extendedLabel == 1, a label will be included for each @@ -355,34 +355,34 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis): # If a method, it will be called with arguments: # tree, node, key, element return { - "WaveHeight" : "surf................", + "WaveHeight" : "SURF................", "Swell": "swell", "Swell2": "swell", - "LabelSwell": "swell...............", - "LabelSwell2": "secondary swell.....", - "Period": "period..............", - "Period2":"secondary period....", - "chop" : "water condition.....", - "rip" : "rip current risk....", - "HeatIndex": "heat index..........", - "20-foot winds......." : "beach winds.........", - "MaxT_FireWx":"max temperature.....", - "Sky/weather.........": "sky/weather.........", - "sst" : "water temperature...", - "uvi" : "UVI index...........", - "LAL" : "lightning threat....", - "WaterSpout" : "waterspout threat...", - "PoP" : "chance of...........", + "LabelSwell": "SWELL...............", + "LabelSwell2": "SECONDARY SWELL.....", + "Period": "PERIOD..............", + "Period2":"SECONDARY PERIOD....", + "chop" : "WATER CONDITION.....", + "rip" : "RIP CURRENT RISK....", + "HeatIndex": "HEAT INDEX..........", + "20-FOOT WINDS......." : "BEACH WINDS.........", + "MaxT_FireWx":"MAX TEMPERATURE.....", + "SKY/WEATHER.........": "SKY/WEATHER.........", + "sst" : "WATER TEMPERATURE...", + "uvi" : "UVI INDEX...........", + "LAL" : "LIGHTNING THREAT....", + "WaterSpout" : "WATERSPOUT THREAT...", + "PoP" : "CHANCE OF...........", "MinT":"lows", "MaxT":"highs", "Wind": "winds", # Used for Headlines - "Expected" : "expected", - "In effect" : "in effect", + "EXPECTED" : "expected", + "IN EFFECT" : "in effect", # Used for single values "around": "around ", - " valleys/lwr slopes...": " inland...............", - " ridges/upr slopes....": " coastal..............", + " VALLEYS/LWR SLOPES...": " INLAND...............", + " RIDGES/UPR SLOPES....": " COASTAL..............", } ############################################################################ @@ -857,7 +857,7 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis): def _preProcessProduct(self, fcst, argDict,): # Product header if self._areaName != "": - productName = self._productName.strip() + " FOR " + \ + productName = self._productName.strip() + " for " + \ self._areaName.strip() else: productName = self._productName.strip() @@ -865,11 +865,12 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis): issuedByString = self.getIssuedByString() productName = self.checkTestMode(argDict, productName) - fcst = fcst + self._wmoID + " " + self._fullStationID + " " + \ + s = self._wmoID + " " + self._fullStationID + " " + \ self._ddhhmmTime + "\n" + self._pil + "\n\n" +\ productName + "\n" +\ "National Weather Service " + self._wfoCityState + \ "\n" + issuedByString + self._timeLabel + "\n\n" + fcst = fcst + s.upper() # Try to get Synopsis from previous SRF srfPil = self._statePil + self._srfPil @@ -937,8 +938,8 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis): # "landSeaArea": "Extra0", # "marineArea": "Extra1", # "surfAreas": [ - # ('NorthCoast', 'Surf along north facing reefs.............'), - # ('SouthCoast', 'Surf along south facing reefs.............') + # ('NorthCoast', 'SURF ALONG NORTH FACING REEFS.............'), + # ('SouthCoast', 'SURF ALONG SOUTH FACING REEFS.............') # ], # "tideTables": ["Cedar Key", "Venice Inlet"], # }, @@ -1228,7 +1229,7 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis): return self.setWords(node, "") self.setWords(node, "") node.set("descriptor", "") - node.set("indentLabel", "20-foot winds.......") + node.set("indentLabel", "20-FOOT WINDS.......") return self.DONE() def fireRidgeValleyWind_setUp(self, tree, node): @@ -1538,7 +1539,7 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis): tokens = line.split() # Look for the city for token in tokens: - if token == uviCity: + if token.upper() == uviCity.upper(): index = tokens.index(token) state = tokens[index + 1] if state == uviState: @@ -1597,7 +1598,7 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis): # Add error message to fcst fcst = fcst + tideTable continue - fcst = fcst + "\nAT " + label + "...\n\n" + fcst = fcst + "\nAt " + label + "...\n\n" for line in tideTable: if line.find(currentDate) == 0: # Get the tide info @@ -1704,7 +1705,7 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis): if words is None: return if words == "": - words = "Missing" + words = "MISSING" node.set("descriptor", "") node.set("indentLabel", "Label"+elementName) node.set("compound", 1) diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/utility/SAF_Site_MultiPil_Definition.py b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/utility/SAF_Site_MultiPil_Definition.py index de5c1b3016..b0e33c8842 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/utility/SAF_Site_MultiPil_Definition.py +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/textproducts/templates/utility/SAF_Site_MultiPil_Definition.py @@ -118,7 +118,7 @@ Definition["autoWrite"] = 0 #set to 1 to write product to file Definition["lacList"] = ["VAC910c", "NCC940c"] Definition["defaultEditAreas"] = [ - ("area1","Southwest mountains including yourTown"), + ("area1","Southwest Mountains including YourTown"), ("area2","Eastern Virginia"), ("area3","Northern North Carolina"), ] diff --git a/edexOsgi/com.raytheon.edex.plugin.satellite/src/com/raytheon/edex/plugin/satellite/dao/SatelliteDao.java b/edexOsgi/com.raytheon.edex.plugin.satellite/src/com/raytheon/edex/plugin/satellite/dao/SatelliteDao.java index a1fcaf0276..2d9b90daa2 100644 --- a/edexOsgi/com.raytheon.edex.plugin.satellite/src/com/raytheon/edex/plugin/satellite/dao/SatelliteDao.java +++ b/edexOsgi/com.raytheon.edex.plugin.satellite/src/com/raytheon/edex/plugin/satellite/dao/SatelliteDao.java @@ -29,7 +29,6 @@ import com.raytheon.uf.common.dataplugin.PluginDataObject; import com.raytheon.uf.common.dataplugin.PluginException; import com.raytheon.uf.common.dataplugin.persist.IPersistable; import com.raytheon.uf.common.dataplugin.satellite.SatMapCoverage; -import com.raytheon.uf.common.dataplugin.satellite.SatelliteMessageData; import com.raytheon.uf.common.dataplugin.satellite.SatelliteRecord; import com.raytheon.uf.common.datastorage.DataStoreFactory; import com.raytheon.uf.common.datastorage.IDataStore; @@ -67,6 +66,8 @@ import com.raytheon.uf.edex.database.query.DatabaseQuery; * Mar 07, 2014 2791 bsteffen Move Data Source/Destination to numeric * plugin. * Nov 04, 2014 2714 bclement removed GINI specific DAOs + * Apr 15, 2014 4388 bsteffen Preserve fill value across interpolation levels. + * * * * @author bphillip @@ -113,8 +114,12 @@ public class SatelliteDao extends PluginDao { storageRecord.setCorrelationObject(satRecord); final Map attributes = storageRecord .getDataAttributes(); - final Float fillValue = getAttribute(attributes, - SatelliteRecord.SAT_FILL_VALUE, 0.0f); + if (storageRecord.getFillValue() == null) { + Number fillValue = getAttribute(attributes, + SatelliteRecord.SAT_FILL_VALUE, 0.0f); + storageRecord.setFillValue(fillValue); + } + final Number fillValue = storageRecord.getFillValue(); // Store the base record. dataStore.addDataRecord(storageRecord); @@ -142,13 +147,14 @@ public class SatelliteDao extends PluginDao { // data. dr.setDataAttributes(attributes); dr.setProperties(props); + dr.setFillValue(fillValue); return dr; } @Override public double getFillValue() { // always the same fill value - return fillValue; + return fillValue.doubleValue(); } @Override @@ -381,10 +387,10 @@ public class SatelliteDao extends PluginDao { */ private IDataRecord createDataRecord(SatelliteRecord satRec, Object data, int downscaleLevel, Rectangle size) { - SatelliteMessageData msgData = null; - msgData = new SatelliteMessageData(data, size.width, size.height); - IDataRecord rec = msgData.getStorageRecord(satRec, - String.valueOf(downscaleLevel)); + long[] sizes = new long[] { size.width, size.height }; + IDataRecord rec = DataStoreFactory.createStorageRecord( + String.valueOf(downscaleLevel), + satRec.getDataURI(), data, 2, sizes); rec.setCorrelationObject(satRec); rec.setGroup(DataStoreFactory.createGroupName(satRec.getDataURI(), SatelliteRecord.SAT_DATASET_NAME, true)); @@ -403,11 +409,11 @@ public class SatelliteDao extends PluginDao { * A default value. * @return */ - public static Float getAttribute(Map attrs, + public static Number getAttribute(Map attrs, String attrName, Float defValue) { - Float retValue = defValue; + Number retValue = defValue; if ((attrs != null) && (attrName != null)) { - retValue = (Float) attrs.get(attrName); + retValue = (Number) attrs.get(attrName); } return retValue; } diff --git a/edexOsgi/com.raytheon.uf.common.activetable/src/com/raytheon/uf/common/activetable/ActiveTableRecord.java b/edexOsgi/com.raytheon.uf.common.activetable/src/com/raytheon/uf/common/activetable/ActiveTableRecord.java index 583f8b6dd1..8c60f6e2e6 100644 --- a/edexOsgi/com.raytheon.uf.common.activetable/src/com/raytheon/uf/common/activetable/ActiveTableRecord.java +++ b/edexOsgi/com.raytheon.uf.common.activetable/src/com/raytheon/uf/common/activetable/ActiveTableRecord.java @@ -21,6 +21,7 @@ package com.raytheon.uf.common.activetable; import java.util.ArrayList; import java.util.Calendar; +import java.util.Date; import java.util.List; import javax.persistence.Column; @@ -56,6 +57,7 @@ import com.vividsolutions.jts.geom.Geometry; * Jul 16, 2013 2181 bsteffen Convert geometry types to use hibernate- * spatial * 10/16/2014 3454 bphillip Upgrading to Hibernate 4 + * 04/28/2015 4027 randerso Expunged Calendar from ActiveTableRecord * * * @author njensen @@ -126,19 +128,19 @@ public abstract class ActiveTableRecord extends PersistableDataObject { /** vtec start time */ @DynamicSerializeElement - protected Calendar startTime; + protected Date startTime; @Column @DynamicSerializeElement - protected Calendar endTime; + protected Date endTime; @Column @DynamicSerializeElement - protected Calendar issueTime; + protected Date issueTime; @Column @DynamicSerializeElement - protected Calendar purgeTime; + protected Date purgeTime; @Column(length = 8) @DynamicSerializeElement @@ -209,15 +211,15 @@ public abstract class ActiveTableRecord extends PersistableDataObject { @Column @DynamicSerializeElement - protected Calendar floodBegin; + protected Date floodBegin; @Column @DynamicSerializeElement - protected Calendar floodCrest; + protected Date floodCrest; @Column @DynamicSerializeElement - protected Calendar floodEnd; + protected Date floodEnd; @Override public abstract Object clone(); @@ -657,7 +659,7 @@ public abstract class ActiveTableRecord extends PersistableDataObject { /** * @return the startTime */ - public Calendar getStartTime() { + public Date getStartTime() { return startTime; } @@ -665,14 +667,14 @@ public abstract class ActiveTableRecord extends PersistableDataObject { * @param startTime * the startTime to set */ - public void setStartTime(Calendar startTime) { + public void setStartTime(Date startTime) { this.startTime = startTime; } /** * @return the endTime */ - public Calendar getEndTime() { + public Date getEndTime() { return endTime; } @@ -680,14 +682,14 @@ public abstract class ActiveTableRecord extends PersistableDataObject { * @param endTime * the endTime to set */ - public void setEndTime(Calendar endTime) { + public void setEndTime(Date endTime) { this.endTime = endTime; } /** * @return the issueTime */ - public Calendar getIssueTime() { + public Date getIssueTime() { return issueTime; } @@ -695,14 +697,14 @@ public abstract class ActiveTableRecord extends PersistableDataObject { * @param issueTime * the issueTime to set */ - public void setIssueTime(Calendar issueTime) { + public void setIssueTime(Date issueTime) { this.issueTime = issueTime; } /** * @return the purgeTime */ - public Calendar getPurgeTime() { + public Date getPurgeTime() { return purgeTime; } @@ -710,7 +712,7 @@ public abstract class ActiveTableRecord extends PersistableDataObject { * @param purgeTime * the purgeTime to set */ - public void setPurgeTime(Calendar purgeTime) { + public void setPurgeTime(Date purgeTime) { this.purgeTime = purgeTime; } @@ -957,7 +959,7 @@ public abstract class ActiveTableRecord extends PersistableDataObject { /** * @return the floodBegin */ - public Calendar getFloodBegin() { + public Date getFloodBegin() { return floodBegin; } @@ -965,14 +967,14 @@ public abstract class ActiveTableRecord extends PersistableDataObject { * @param floodBegin * the floodBegin to set */ - public void setFloodBegin(Calendar floodBegin) { + public void setFloodBegin(Date floodBegin) { this.floodBegin = floodBegin; } /** * @return the floodCrest */ - public Calendar getFloodCrest() { + public Date getFloodCrest() { return floodCrest; } @@ -980,14 +982,14 @@ public abstract class ActiveTableRecord extends PersistableDataObject { * @param floodCrest * the floodCrest to set */ - public void setFloodCrest(Calendar floodCrest) { + public void setFloodCrest(Date floodCrest) { this.floodCrest = floodCrest; } /** * @return the floodEnd */ - public Calendar getFloodEnd() { + public Date getFloodEnd() { return floodEnd; } @@ -995,7 +997,7 @@ public abstract class ActiveTableRecord extends PersistableDataObject { * @param floodEnd * the floodEnd to set */ - public void setFloodEnd(Calendar floodEnd) { + public void setFloodEnd(Date floodEnd) { this.floodEnd = floodEnd; } @@ -1050,17 +1052,17 @@ public abstract class ActiveTableRecord extends PersistableDataObject { } atr.setAct(wr.getAct()); atr.setCountyheader(wr.getCountyheader()); - atr.setEndTime(wr.getEndTime()); + atr.setEndTime(calendarToDate(wr.getEndTime())); atr.setEtn(wr.getEtn()); - atr.setFloodBegin(wr.getFloodBegin()); - atr.setFloodCrest(wr.getFloodCrest()); - atr.setFloodEnd(wr.getFloodEnd()); + atr.setFloodBegin(calendarToDate(wr.getFloodBegin())); + atr.setFloodCrest(calendarToDate(wr.getFloodCrest())); + atr.setFloodEnd(calendarToDate(wr.getFloodEnd())); atr.setFloodRecordStatus(wr.getFloodRecordStatus()); atr.setFloodSeverity(wr.getFloodSeverity()); atr.setForecaster(wr.getForecaster()); atr.setGeometry(wr.getGeometry()); atr.setImmediateCause(wr.getImmediateCause()); - atr.setIssueTime(wr.getIssueTime()); + atr.setIssueTime(calendarToDate(wr.getIssueTime())); atr.setLoc(wr.getLoc()); atr.setLocationID(wr.getLocationID()); atr.setMotdir(wr.getMotdir()); @@ -1071,13 +1073,13 @@ public abstract class ActiveTableRecord extends PersistableDataObject { atr.setPhensig(wr.getPhensig()); atr.setPil(wr.getPil()); atr.setProductClass(wr.getProductClass()); - atr.setPurgeTime(wr.getPurgeTime()); + atr.setPurgeTime(calendarToDate(wr.getPurgeTime())); atr.setRawmessage(wr.getRawmessage()); atr.setRegion(wr.getRegion()); atr.setSeg(wr.getSeg()); atr.setSegText(wr.getSegText()); atr.setSig(wr.getSig()); - atr.setStartTime(wr.getStartTime()); + atr.setStartTime(calendarToDate(wr.getStartTime())); atr.setUfn(wr.isUfn()); atr.setVtecstr(wr.getVtecstr()); atr.setWmoid(wr.getWmoid()); @@ -1093,4 +1095,11 @@ public abstract class ActiveTableRecord extends PersistableDataObject { return list; } + private static Date calendarToDate(Calendar calendar) { + Date date = null; + if (calendar != null) { + date = calendar.getTime(); + } + return date; + } } diff --git a/edexOsgi/com.raytheon.uf.common.activetable/src/com/raytheon/uf/common/activetable/ActiveTableUtil.java b/edexOsgi/com.raytheon.uf.common.activetable/src/com/raytheon/uf/common/activetable/ActiveTableUtil.java index 92776aa31f..b956314e2e 100644 --- a/edexOsgi/com.raytheon.uf.common.activetable/src/com/raytheon/uf/common/activetable/ActiveTableUtil.java +++ b/edexOsgi/com.raytheon.uf.common.activetable/src/com/raytheon/uf/common/activetable/ActiveTableUtil.java @@ -20,7 +20,7 @@ package com.raytheon.uf.common.activetable; import java.util.ArrayList; -import java.util.Calendar; +import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -37,7 +37,8 @@ import com.vividsolutions.jts.geom.Geometry; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Mar 4, 2013 dgilling Initial creation + * Mar 4, 2013 dgilling Initial creation + * Apr 28, 2015 #4027 randerso Expunged Calendar from ActiveTableRecord * * * @@ -84,15 +85,12 @@ public class ActiveTableUtil { template.put("phensig", atr.getPhensig()); template.put("act", atr.getAct()); template.put("seg", atr.getSeg()); - template.put("startTime", - atr.getStartTime().getTimeInMillis() / 1000); - template.put("endTime", atr.getEndTime().getTimeInMillis() / 1000); + template.put("startTime", atr.getStartTime().getTime() / 1000); + template.put("endTime", atr.getEndTime().getTime() / 1000); template.put("ufn", atr.isUfn()); template.put("officeid", atr.getOfficeid()); - template.put("purgeTime", - atr.getPurgeTime().getTimeInMillis() / 1000); - template.put("issueTime", - atr.getIssueTime().getTimeInMillis() / 1000); + template.put("purgeTime", atr.getPurgeTime().getTime() / 1000); + template.put("issueTime", atr.getIssueTime().getTime() / 1000); template.put("state", "Decoded"); template.put("xxxid", atr.getXxxid()); @@ -104,9 +102,9 @@ public class ActiveTableUtil { template.put("rawMessage", atr.getRawmessage()); template.put("countyheader", atr.getCountyheader()); - Calendar floodBegin = atr.getFloodBegin(); + Date floodBegin = atr.getFloodBegin(); if (floodBegin != null) { - long floodBeginMillis = floodBegin.getTimeInMillis(); + long floodBeginMillis = floodBegin.getTime(); if (floodBeginMillis != 0) { template.put("floodBegin", floodBeginMillis / 1000); } @@ -114,31 +112,31 @@ public class ActiveTableUtil { template.put("wmoid", atr.getWmoid()); // Warngen fields - Calendar floodCrest = atr.getFloodCrest(); + Date floodCrest = atr.getFloodCrest(); if (floodCrest != null) { - long floodCrestMillis = floodCrest.getTimeInMillis(); + long floodCrestMillis = floodCrest.getTime(); if (floodCrestMillis != 0) { template.put("floodCrest", floodCrestMillis / 1000); } } - Calendar floodEnd = atr.getFloodEnd(); + Date floodEnd = atr.getFloodEnd(); if (floodEnd != null) { - long floodEndMillis = floodEnd.getTimeInMillis(); + long floodEndMillis = floodEnd.getTime(); if (floodEndMillis != 0) { template.put("floodBegin", floodEndMillis / 1000); } } String floodStatus = atr.getFloodRecordStatus(); - if (floodStatus != null && !"".equals(floodStatus.trim())) { + if ((floodStatus != null) && !"".equals(floodStatus.trim())) { template.put("floodrecordstatus", floodStatus); } String floodSeverity = atr.getFloodSeverity(); - if (floodSeverity != null && !"".equals(floodSeverity.trim())) { + if ((floodSeverity != null) && !"".equals(floodSeverity.trim())) { template.put("floodseverity", floodSeverity); } Geometry geometry = atr.getGeometry(); - if (geometry != null && !geometry.isEmpty()) { + if ((geometry != null) && !geometry.isEmpty()) { StringBuilder sb = new StringBuilder(); String sep = ""; long lat; @@ -154,17 +152,17 @@ public class ActiveTableUtil { } String immediateCause = atr.getImmediateCause(); - if (immediateCause != null && !"".equals(immediateCause.trim())) { + if ((immediateCause != null) && !"".equals(immediateCause.trim())) { template.put("immediateCause", immediateCause); } String loc = atr.getLoc(); - if (loc != null && !"".equals(loc.trim())) { + if ((loc != null) && !"".equals(loc.trim())) { template.put("loc", loc); } String locationId = atr.getLocationID(); - if (locationId != null && !"".equals(locationId.trim())) { + if ((locationId != null) && !"".equals(locationId.trim())) { template.put("locationId", locationId); } diff --git a/edexOsgi/com.raytheon.uf.common.activetable/src/com/raytheon/uf/common/activetable/GetNextEtnRequest.java b/edexOsgi/com.raytheon.uf.common.activetable/src/com/raytheon/uf/common/activetable/GetNextEtnRequest.java index 1298d32a2b..3e21dd4f07 100644 --- a/edexOsgi/com.raytheon.uf.common.activetable/src/com/raytheon/uf/common/activetable/GetNextEtnRequest.java +++ b/edexOsgi/com.raytheon.uf.common.activetable/src/com/raytheon/uf/common/activetable/GetNextEtnRequest.java @@ -19,14 +19,14 @@ **/ package com.raytheon.uf.common.activetable; -import java.util.Calendar; +import java.util.Date; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; import com.raytheon.uf.common.serialization.comm.IServerRequest; /** - * TODO Add Description + * Request for next ETN in the sequence * *
  * 
@@ -36,6 +36,7 @@ import com.raytheon.uf.common.serialization.comm.IServerRequest;
  * Feb 14, 2011            rjpeter     Initial creation
  * Oct 21, 2013  #1843     dgilling    Add performISC and reportConflictOnly
  *                                     fields, proper constructors.
+ * Apr 28, 2015  #4027     randerso    Expunged Calendar from ActiveTableRecord
  * 
  * 
* @@ -55,7 +56,7 @@ public class GetNextEtnRequest implements IServerRequest { private String phensig; @DynamicSerializeElement - private Calendar currentTime; + private Date currentTime; @DynamicSerializeElement private boolean lockEtn; @@ -84,7 +85,7 @@ public class GetNextEtnRequest implements IServerRequest { * The phenomenon and significance of the hazard concatenated * with a '.' (e.g., TO.W or DU.Y) * @param currentTime - * Calendar representing time (needed for DRT mode). + * Date representing time (needed for DRT mode). * @param lockEtn * Whether or not to request an exclusive ETN--if true, this will * cause the server to increment its running ETN sequence to the @@ -95,7 +96,7 @@ public class GetNextEtnRequest implements IServerRequest { * GetNextEtnRequest. */ public GetNextEtnRequest(String siteID, ActiveTableMode mode, - String phensig, Calendar currentTime, boolean lockEtn) { + String phensig, Date currentTime, boolean lockEtn) { this(siteID, mode, phensig, currentTime, lockEtn, false, false, null); } @@ -110,7 +111,7 @@ public class GetNextEtnRequest implements IServerRequest { * The phenomenon and significance of the hazard concatenated * with a '.' (e.g., TO.W or DU.Y) * @param currentTime - * Calendar representing time (needed for DRT mode). + * Date representing time (needed for DRT mode). * @param lockEtn * Whether or not to request an exclusive ETN--if true, this will * cause the server to increment its running ETN sequence to the @@ -123,7 +124,7 @@ public class GetNextEtnRequest implements IServerRequest { * Whether or not to collaborate with neighboring sites to * determine the next ETN. See {@link * GetNextEtnUtil#getNextEtnFromPartners(String, ActiveTableMode, - * String, Calendar, List)} for more information. + * String, Date, List)} for more information. * @param reportConflictOnly * Affects which kinds of errors get reported back to the * requestor. If true, only cases where the value of @@ -136,7 +137,7 @@ public class GetNextEtnRequest implements IServerRequest { * used by this site or one of its partners. */ public GetNextEtnRequest(String siteID, ActiveTableMode mode, - String phensig, Calendar currentTime, boolean lockEtn, + String phensig, Date currentTime, boolean lockEtn, boolean performISC, boolean reportConflictOnly, Integer etnOverride) { this.siteID = siteID; this.mode = mode; @@ -180,11 +181,11 @@ public class GetNextEtnRequest implements IServerRequest { this.lockEtn = lockEtn; } - public Calendar getCurrentTime() { + public Date getCurrentTime() { return currentTime; } - public void setCurrentTime(Calendar currentTime) { + public void setCurrentTime(Date currentTime) { this.currentTime = currentTime; } diff --git a/edexOsgi/com.raytheon.uf.common.activetable/src/com/raytheon/uf/common/activetable/request/LockAndGetNextEtnRequest.java b/edexOsgi/com.raytheon.uf.common.activetable/src/com/raytheon/uf/common/activetable/request/LockAndGetNextEtnRequest.java index c756c091fd..dca6eb5317 100644 --- a/edexOsgi/com.raytheon.uf.common.activetable/src/com/raytheon/uf/common/activetable/request/LockAndGetNextEtnRequest.java +++ b/edexOsgi/com.raytheon.uf.common.activetable/src/com/raytheon/uf/common/activetable/request/LockAndGetNextEtnRequest.java @@ -19,7 +19,7 @@ **/ package com.raytheon.uf.common.activetable.request; -import java.util.Calendar; +import java.util.Date; import com.raytheon.uf.common.activetable.ActiveTableMode; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; @@ -37,6 +37,7 @@ import com.raytheon.uf.common.serialization.comm.IServerRequest; * ------------ ---------- ----------- -------------------------- * Aug 19, 2013 #1843 dgilling Initial creation * Oct 21, 2013 #1843 dgilling Add ETN override field. + * Apr 28, 2015 #4027 randerso Expunged Calendar from ActiveTableRecord * * * @@ -60,7 +61,7 @@ public class LockAndGetNextEtnRequest implements IServerRequest { private String phensig; @DynamicSerializeElement - private Calendar currentTime; + private Date currentTime; @DynamicSerializeElement private Integer etnOverride; @@ -70,12 +71,12 @@ public class LockAndGetNextEtnRequest implements IServerRequest { } public LockAndGetNextEtnRequest(String siteID, String requestorSiteID, - ActiveTableMode mode, String phensig, Calendar currentTime) { + ActiveTableMode mode, String phensig, Date currentTime) { this(siteID, requestorSiteID, mode, phensig, currentTime, null); } public LockAndGetNextEtnRequest(String siteID, String requestorSiteID, - ActiveTableMode mode, String phensig, Calendar currentTime, + ActiveTableMode mode, String phensig, Date currentTime, Integer etnOverride) { this.siteID = siteID; this.requestorSiteID = requestorSiteID; @@ -117,11 +118,11 @@ public class LockAndGetNextEtnRequest implements IServerRequest { this.phensig = phensig; } - public Calendar getCurrentTime() { + public Date getCurrentTime() { return currentTime; } - public void setCurrentTime(Calendar currentTime) { + public void setCurrentTime(Date currentTime) { this.currentTime = currentTime; } diff --git a/edexOsgi/com.raytheon.uf.common.activetable/src/com/raytheon/uf/common/activetable/request/UnlockAndSetNextEtnRequest.java b/edexOsgi/com.raytheon.uf.common.activetable/src/com/raytheon/uf/common/activetable/request/UnlockAndSetNextEtnRequest.java index 6824a5ffa5..af462f1b79 100644 --- a/edexOsgi/com.raytheon.uf.common.activetable/src/com/raytheon/uf/common/activetable/request/UnlockAndSetNextEtnRequest.java +++ b/edexOsgi/com.raytheon.uf.common.activetable/src/com/raytheon/uf/common/activetable/request/UnlockAndSetNextEtnRequest.java @@ -19,6 +19,8 @@ **/ package com.raytheon.uf.common.activetable.request; +import java.util.Date; + import com.raytheon.uf.common.activetable.ActiveTableMode; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -34,6 +36,7 @@ import com.raytheon.uf.common.serialization.comm.IServerRequest; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Aug 19, 2013 #1843 dgilling Initial creation + * Apr 28, 2015 #4027 randerso Expunged Calendar from ActiveTableRecord * * * @@ -54,7 +57,7 @@ public class UnlockAndSetNextEtnRequest implements IServerRequest { private ActiveTableMode mode; @DynamicSerializeElement - private int year; + private Date currentTime; @DynamicSerializeElement private String phensig; @@ -67,11 +70,11 @@ public class UnlockAndSetNextEtnRequest implements IServerRequest { } public UnlockAndSetNextEtnRequest(String siteID, String requestorSiteID, - ActiveTableMode mode, int year, String phensig, int newEtn) { + ActiveTableMode mode, Date currentTime, String phensig, int newEtn) { this.siteID = siteID; this.requestorSiteID = requestorSiteID; this.mode = mode; - this.year = year; + this.currentTime = currentTime; this.phensig = phensig; this.newEtn = newEtn; } @@ -100,12 +103,12 @@ public class UnlockAndSetNextEtnRequest implements IServerRequest { this.mode = mode; } - public int getYear() { - return year; + public Date getCurrentTime() { + return currentTime; } - public void setYear(int year) { - this.year = year; + public void setCurrentTime(Date currentTime) { + this.currentTime = currentTime; } public String getPhensig() { 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 dcd19bb080..e4c0c8b1be 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 @@ -136,11 +136,6 @@ public class GfePyIncludeUtil extends PythonIncludePathUtil { return PATH_MANAGER.getLocalizationFile(ctx, HEADLINE); } - public static LocalizationFile getTextProductsTemplatesLF( - LocalizationContext ctx) { - return PATH_MANAGER.getLocalizationFile(ctx, TEXT_PRODUCTS); - } - public static LocalizationFile getCombinationsLF(LocalizationContext ctx) { return PATH_MANAGER.getLocalizationFile(ctx, COMBINATIONS); } @@ -324,11 +319,6 @@ public class GfePyIncludeUtil extends PythonIncludePathUtil { LocalizationLevel.BASE), HEADLINE); } - public static String getTextProductsTemplatesIncludePath() { - return getPath(PATH_MANAGER.getContext(LocalizationType.CAVE_STATIC, - LocalizationLevel.BASE), TEXT_PRODUCTS); - } - public static String getCombinationsIncludePath() { return getCombinationsIncludePath(true); } diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.satellite/src/com/raytheon/uf/common/dataplugin/satellite/SatelliteMessageData.java b/edexOsgi/com.raytheon.uf.common.dataplugin.satellite/src/com/raytheon/uf/common/dataplugin/satellite/SatelliteMessageData.java index 0d2d55c149..9d5d222232 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.satellite/src/com/raytheon/uf/common/dataplugin/satellite/SatelliteMessageData.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.satellite/src/com/raytheon/uf/common/dataplugin/satellite/SatelliteMessageData.java @@ -28,11 +28,13 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; /** - * Encapsulate satellite image data as well as the dimensions of the image grid. - * Attributes about the data may also be added. As an example these attributes - * could include "scale factor" and/or "fill_value". + * @Deprecated this class is not providing anything unique enough to justify + * its existence, wherever it is used an IDataRecord of the + * appropriate type can be used instead. * - *
+ *             TODO this class can be deleted when no decoders are using it.
+ * 
+ *             
  * 
  * SOFTWARE HISTORY
  * 
@@ -41,6 +43,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
  * Jun 27, 2012        798     jkorman Initial creation
  * Nov 14, 2013  2393       bclement   use datastore factory in
  *                                     getStorageRecord()
+ * Apr 15, 2014  4388     bsteffen    Deprecate
  * 
  * 
* @@ -48,6 +51,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * @version 1.0 */ @DynamicSerialize +@Deprecated public class SatelliteMessageData { private static final int DATA_DIMS = 2; diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.satellite/src/com/raytheon/uf/common/dataplugin/satellite/SatelliteRecord.java b/edexOsgi/com.raytheon.uf.common.dataplugin.satellite/src/com/raytheon/uf/common/dataplugin/satellite/SatelliteRecord.java index 6820f642cf..feab6943a7 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.satellite/src/com/raytheon/uf/common/dataplugin/satellite/SatelliteRecord.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.satellite/src/com/raytheon/uf/common/dataplugin/satellite/SatelliteRecord.java @@ -74,6 +74,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * PluginDataObject. * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * Jun 11, 2014 2061 bsteffen Remove IDecoderGettable + * Apr 15, 2014 4388 bsteffen Deprecate SAT_FILL_VALUE * *
* @@ -105,9 +106,10 @@ public class SatelliteRecord extends PersistablePluginDataObject implements public static final String SAT_DATASET_NAME = DataStoreFactory.DEF_DATASET_NAME; /** - * The attribute name for a value that will be used to "fill" undefined - * data. + * @deprecated {@link IDataRecord#setFillValue(Number)} should be used to + * store the fill value. */ + @Deprecated public static final String SAT_FILL_VALUE = "_FillValue"; /** @@ -116,10 +118,17 @@ public class SatelliteRecord extends PersistablePluginDataObject implements public static final String SAT_ADD_OFFSET = "add_offset"; /** - * The attribute name for the data scale factor value.. + * The attribute name for the data scale factor value. */ public static final String SAT_SCALE_FACTOR = "scale_factor"; + /** + * Byte/Short/Int satellite data is assumed to be unsigned. If this + * attribute is present on the {@link IDataRecord} and the value is + * {@link Boolean#TRUE} then the data is treated as signed data. + */ + public static final String SAT_SIGNED_FLAG = "signed"; + /** * The source of the data - NESDIS */ diff --git a/edexOsgi/com.raytheon.uf.edex.activetable/src/com/raytheon/uf/edex/activetable/ActiveTable.java b/edexOsgi/com.raytheon.uf.edex.activetable/src/com/raytheon/uf/edex/activetable/ActiveTable.java index a4347cf47c..774b3514b8 100644 --- a/edexOsgi/com.raytheon.uf.edex.activetable/src/com/raytheon/uf/edex/activetable/ActiveTable.java +++ b/edexOsgi/com.raytheon.uf.edex.activetable/src/com/raytheon/uf/edex/activetable/ActiveTable.java @@ -28,6 +28,7 @@ import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Set; +import java.util.TimeZone; import jep.JepException; @@ -108,6 +109,8 @@ import com.raytheon.uf.edex.database.query.DatabaseQuery; * Feb 23, 2015 4127 dgilling Use cluster locking to only allow 1 active * table write at a time. * Mar 04, 2015 4129 randerso Pass active table change logger to ingestAt and/or MergeVTEC + * Apr 28, 2015 #4027 randerso Expunged Calendar from ActiveTableRecord, + * fixed next ETN query to query for >= Jan 1 * * * @@ -447,7 +450,7 @@ public class ActiveTable { @SuppressWarnings("unchecked") private static List queryTable(String siteId, ActiveTableMode mode, String phensigList, String action, - String etn, Calendar currentTime, boolean requestValidTimes, + String etn, Date currentTime, boolean requestValidTimes, boolean latestEtn) { DatabaseQuery query = null; CoreDao dao = null; @@ -472,27 +475,18 @@ public class ActiveTable { query.addQueryParam("etn", etn, "in"); } - if (requestValidTimes && (currentTime != null)) { - // Current Time - query.addQueryParam("endTime", currentTime, "greater_than"); - } - if (latestEtn && (currentTime != null)) { - Calendar yearStart = Calendar.getInstance(); - yearStart.set(currentTime.get(Calendar.YEAR), Calendar.JANUARY, - 0, 0, 0); - query.addQueryParam("startTime", yearStart, "greater_than"); - query.addOrder("etn", false); - query.setMaxResults(1); - } - if (requestValidTimes && currentTime != null) { + if (requestValidTimes && (currentTime != null)) { // Current Time - query.addQueryParam("endTime", currentTime, "greater_than"); + query.addQueryParam("endTime", currentTime, ">"); } - if (latestEtn && currentTime != null) { - Calendar yearStart = Calendar.getInstance(); - yearStart.set(currentTime.get(Calendar.YEAR), Calendar.JANUARY, 1, + if (latestEtn && (currentTime != null)) { + Calendar yearStart = Calendar.getInstance(TimeZone + .getTimeZone("GMT")); + yearStart.setTime(currentTime); + yearStart.set(yearStart.get(Calendar.YEAR), Calendar.JANUARY, 1, 0, 0, 0); - query.addQueryParam("issueTime", yearStart, "greater_than"); + yearStart.set(Calendar.MILLISECOND, 0); + query.addQueryParam("issueTime", yearStart.getTime(), ">="); query.addOrder("etn", false); query.setMaxResults(1); } @@ -713,14 +707,14 @@ public class ActiveTable { * @param phensig * The phenomenon and significance combination to search for. * @param currentTime - * Calendar representing time to perform search from + * Date representing time to perform search from * (needed for DRT mode). * @return The last ETN assigned to the particular site and phensig * combination, or null if no ETNs have been assigned * to this combination. */ public static Integer getLastUsedEtn(String siteId, ActiveTableMode mode, - String phensig, Calendar currentTime) { + String phensig, Date currentTime) { Integer lastEtn = null; List records = ActiveTable.queryTable(siteId, mode, phensig, null, null, currentTime, false, true); diff --git a/edexOsgi/com.raytheon.uf.edex.activetable/src/com/raytheon/uf/edex/activetable/GetNextEtnUtil.java b/edexOsgi/com.raytheon.uf.edex.activetable/src/com/raytheon/uf/edex/activetable/GetNextEtnUtil.java index f3e4930851..bcb2b24e81 100644 --- a/edexOsgi/com.raytheon.uf.edex.activetable/src/com/raytheon/uf/edex/activetable/GetNextEtnUtil.java +++ b/edexOsgi/com.raytheon.uf.edex.activetable/src/com/raytheon/uf/edex/activetable/GetNextEtnUtil.java @@ -26,11 +26,12 @@ import java.io.IOException; import java.net.InetAddress; import java.net.UnknownHostException; import java.rmi.RemoteException; +import java.text.SimpleDateFormat; import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Arrays; -import java.util.Calendar; import java.util.Collections; +import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -38,6 +39,7 @@ import java.util.Map.Entry; import java.util.Properties; import java.util.Queue; import java.util.SortedMap; +import java.util.TimeZone; import java.util.TreeMap; import com.raytheon.edex.site.SiteUtil; @@ -75,6 +77,7 @@ import com.raytheon.uf.edex.requestsrv.router.RemoteServerRequestRouter; * ------------ ---------- ----------- -------------------------- * Aug 29, 2013 #1843 dgilling Initial creation * Dec 18, 2013 #2641 dgilling Fix ClusterTask locking. + * Apr 28, 2015 #4027 randerso Expunged Calendar from ActiveTableRecord * * * @@ -118,7 +121,7 @@ public final class GetNextEtnUtil { * The phenomenon and significance combination (e.g., TO.W or * DU.Y). * @param currentTime - * Calendar representing time (needed for DRT mode). + * Date representing time (needed for DRT mode). * @param isLock * Whether or not to return a unique ETN--one that has not and * cannot be used by any other requestor. @@ -142,7 +145,7 @@ public final class GetNextEtnUtil { * and any hosts that couldn't be contacted during this process. */ public static GetNextEtnResponse getNextEtn(String siteId, - ActiveTableMode mode, String phensig, Calendar currentTime, + ActiveTableMode mode, String phensig, Date currentTime, boolean isLock, boolean performISC, boolean reportConflictOnly, Integer etnOverride) { SortedMap hostsToQuery = new TreeMap(); @@ -271,7 +274,7 @@ public final class GetNextEtnUtil { * The phenomenon and significance combination (e.g., TO.W or * DU.Y). * @param currentTime - * Calendar representing time (needed for DRT mode). + * Date representing time (needed for DRT mode). * @param isLock * Whether or not to actually obtain the cluster task lock. Not * needed if only determining a preliminary ETN. Required to be @@ -284,7 +287,7 @@ public final class GetNextEtnUtil { * @return The next ETN to be used in sequence. */ public static int lockAndGetNextEtn(String siteId, ActiveTableMode mode, - String phensig, Calendar currentTime, boolean isLock, + String phensig, Date currentTime, boolean isLock, Integer etnOverride) { String lockName = getEtnClusterLockName(siteId, mode); ClusterTask ct = null; @@ -306,7 +309,9 @@ public final class GetNextEtnUtil { int sysNextEtn = -1; if (etnOverride == null) { - String year = Integer.toString(currentTime.get(Calendar.YEAR)); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy"); + sdf.setTimeZone(TimeZone.getTimeZone("GMT")); + String year = sdf.format(currentTime); String eInfo = ct.getExtraInfo(); statusHandler.info("ClusterTask Lock info: " + eInfo); @@ -342,16 +347,20 @@ public final class GetNextEtnUtil { * @param phensig * The phenomenon and significance combination (e.g., TO.W or * DU.Y). - * @param year - * Year the next ETN is effective for. + * @param currentTime + * Date used to determine year for ETN. * @param nextEtn * The ETN to persist. */ public static void setNextEtnAndUnlock(String siteId, ActiveTableMode mode, - String phensig, int year, int nextEtn) { + String phensig, Date currentTime, int nextEtn) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy"); + sdf.setTimeZone(TimeZone.getTimeZone("GMT")); + String year = sdf.format(currentTime); + String lockName = getEtnClusterLockName(siteId, mode); - ClusterLockUtils.updateExtraInfo(lockName, phensig, - Integer.toString(year) + ":" + nextEtn); + ClusterLockUtils.updateExtraInfo(lockName, phensig, year + ":" + + nextEtn); ClusterLockUtils.unlock(lockName, phensig); statusHandler.info("Unlocking::[nextEtn = " + nextEtn + "]"); } @@ -369,20 +378,19 @@ public final class GetNextEtnUtil { * The phenomenon and significance combination (e.g., TO.W or * DU.Y). * @param currentTime - * Calendar representing time (needed for DRT mode). + * Date representing time (needed for DRT mode). * @param isLock * Whether or not to return a unique ETN--one that has not and * cannot be used by any other requestor. * @return The next ETN to be used in sequence. */ public static Integer getNextEtnFromLocal(String siteId, - ActiveTableMode mode, String phensig, Calendar currentTime, + ActiveTableMode mode, String phensig, Date currentTime, boolean isLock) { int nextEtn = lockAndGetNextEtn(siteId, mode, phensig, currentTime, isLock, null); if (isLock) { - setNextEtnAndUnlock(siteId, mode, phensig, - currentTime.get(Calendar.YEAR), nextEtn); + setNextEtnAndUnlock(siteId, mode, phensig, currentTime, nextEtn); } return nextEtn; } @@ -405,7 +413,7 @@ public final class GetNextEtnUtil { * The phenomenon and significance combination (e.g., TO.W or * DU.Y). * @param currentTime - * Calendar representing time (needed for DRT mode). + * Date representing time (needed for DRT mode). * @param hostsToQuery * The remote hosts to query. This should also include the local * EDEX instance initiating this operation. @@ -424,7 +432,7 @@ public final class GetNextEtnUtil { * @throws UnknownHostException */ public static GetNextEtnResponse getNextEtnFromPartners(String siteId, - ActiveTableMode mode, String phensig, Calendar currentTime, + ActiveTableMode mode, String phensig, Date currentTime, SortedMap hostsToQuery, boolean reportConflictOnly, Integer etnOverride) { Queue> unlockQueue = Collections @@ -474,8 +482,7 @@ public final class GetNextEtnUtil { } IServerRequest unlockReq = new UnlockAndSetNextEtnRequest(siteId, - mySiteId, mode, currentTime.get(Calendar.YEAR), phensig, - nextEtn); + mySiteId, mode, currentTime, phensig, nextEtn); for (Entry host : unlockQueue) { IRequestRouter router = host.getValue(); try { diff --git a/edexOsgi/com.raytheon.uf.edex.activetable/src/com/raytheon/uf/edex/activetable/handler/ClearPracticeVTECTableHandler.java b/edexOsgi/com.raytheon.uf.edex.activetable/src/com/raytheon/uf/edex/activetable/handler/ClearPracticeVTECTableHandler.java index f6d392725b..816a1f0046 100644 --- a/edexOsgi/com.raytheon.uf.edex.activetable/src/com/raytheon/uf/edex/activetable/handler/ClearPracticeVTECTableHandler.java +++ b/edexOsgi/com.raytheon.uf.edex.activetable/src/com/raytheon/uf/edex/activetable/handler/ClearPracticeVTECTableHandler.java @@ -25,6 +25,8 @@ import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.edex.activetable.ActiveTable; import com.raytheon.uf.edex.database.DataAccessLayerException; +import com.raytheon.uf.edex.database.plugin.PluginDao; +import com.raytheon.uf.edex.database.plugin.PluginFactory; /** * Request handler for clearing the practice VTEC active table. @@ -38,6 +40,7 @@ import com.raytheon.uf.edex.database.DataAccessLayerException; * Apr 23, 2010 wkwock Initial creation * Apr 09, 2014 #3004 dgilling Move to activetable plugin, remove GFE * dependencies. + * Apr 28, 2015 #4027 randerso Added clearing of practice warning table * * * @@ -55,6 +58,10 @@ public class ClearPracticeVTECTableHandler implements throws Exception { try { ActiveTable.clearPracticeTable(request.getSiteID()); + PluginDao dao = PluginFactory.getInstance().getPluginDao( + "practicewarning"); + dao.purgeAllData(); + } catch (DataAccessLayerException e) { statusHandler.error("Error failed to clear practice VTEC table", e); throw new Exception("Unable to clear practice VTEC table.", e); diff --git a/edexOsgi/com.raytheon.uf.edex.activetable/src/com/raytheon/uf/edex/activetable/handler/MergeActiveTableHandler.java b/edexOsgi/com.raytheon.uf.edex.activetable/src/com/raytheon/uf/edex/activetable/handler/MergeActiveTableHandler.java index 5127636dc4..4477f5f4bf 100644 --- a/edexOsgi/com.raytheon.uf.edex.activetable/src/com/raytheon/uf/edex/activetable/handler/MergeActiveTableHandler.java +++ b/edexOsgi/com.raytheon.uf.edex.activetable/src/com/raytheon/uf/edex/activetable/handler/MergeActiveTableHandler.java @@ -21,8 +21,7 @@ package com.raytheon.uf.edex.activetable.handler; import java.text.DecimalFormat; import java.util.ArrayList; -import java.util.Calendar; -import java.util.GregorianCalendar; +import java.util.Date; import java.util.List; import java.util.Map; @@ -60,6 +59,7 @@ import com.vividsolutions.jts.io.WKTReader; * and use MergeVTEC.py to perform merge. * Jul 23, 2013 #2212 dgilling Fix ClassCastExceptions on flood * fields. + * Apr 28, 2015 #4027 randerso Expunged Calendar from ActiveTableRecord * * * @@ -160,21 +160,17 @@ public class MergeActiveTableHandler implements atr.setPhensig(template.get("phensig").toString()); atr.setAct(template.get("act").toString()); atr.setSeg((Integer) template.get("seg")); - Calendar start = GregorianCalendar.getInstance(); - start.setTimeInMillis(((Number) template.get("startTime")) - .longValue() * 1000L); + Date start = new Date( + ((Number) template.get("startTime")).longValue() * 1000L); atr.setStartTime(start); - Calendar end = GregorianCalendar.getInstance(); - end.setTimeInMillis(((Number) template.get("endTime")) - .longValue() * 1000L); + Date end = new Date( + ((Number) template.get("endTime")).longValue() * 1000L); atr.setEndTime(end); - Calendar purge = GregorianCalendar.getInstance(); - purge.setTimeInMillis(((Number) template.get("purgeTime")) - .longValue() * 1000L); + Date purge = new Date( + ((Number) template.get("purgeTime")).longValue() * 1000L); atr.setPurgeTime(purge); - Calendar issue = GregorianCalendar.getInstance(); - issue.setTimeInMillis(((Number) template.get("issueTime")) - .longValue() * 1000L); + Date issue = new Date( + ((Number) template.get("issueTime")).longValue() * 1000L); atr.setIssueTime(issue); atr.setUfn((Boolean) template.get("ufn")); atr.setOfficeid(template.get("officeid").toString()); @@ -187,22 +183,20 @@ public class MergeActiveTableHandler implements Number floodBeginTime = (Number) template.get("floodBegin"); if (floodBeginTime != null) { - Calendar floodBegin = GregorianCalendar.getInstance(); - floodBegin - .setTimeInMillis(floodBeginTime.longValue() * 1000L); + Date floodBegin = new Date( + floodBeginTime.longValue() * 1000L); atr.setFloodBegin(floodBegin); } Number floodCrestTime = (Number) template.get("floodCrest"); if (floodCrestTime != null) { - Calendar floodCrest = GregorianCalendar.getInstance(); - floodCrest - .setTimeInMillis(floodCrestTime.longValue() * 1000L); + Date floodCrest = new Date( + floodCrestTime.longValue() * 1000L); atr.setFloodCrest(floodCrest); } Number floodEndTime = (Number) template.get("floodEnd"); if (floodEndTime != null) { - Calendar floodEnd = GregorianCalendar.getInstance(); - floodEnd.setTimeInMillis(floodEndTime.longValue() * 1000L); + Date floodEnd = new Date( + floodEndTime.longValue() * 1000L); atr.setFloodEnd(floodEnd); } atr.setFloodRecordStatus((String) template diff --git a/edexOsgi/com.raytheon.uf.edex.activetable/src/com/raytheon/uf/edex/activetable/handler/UnlockActiveTablePhenSigHandler.java b/edexOsgi/com.raytheon.uf.edex.activetable/src/com/raytheon/uf/edex/activetable/handler/UnlockActiveTablePhenSigHandler.java index 61f1005822..fccdf63c2c 100644 --- a/edexOsgi/com.raytheon.uf.edex.activetable/src/com/raytheon/uf/edex/activetable/handler/UnlockActiveTablePhenSigHandler.java +++ b/edexOsgi/com.raytheon.uf.edex.activetable/src/com/raytheon/uf/edex/activetable/handler/UnlockActiveTablePhenSigHandler.java @@ -37,6 +37,7 @@ import com.raytheon.uf.edex.activetable.GetNextEtnUtil; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Aug 19, 2013 #1843 dgilling Initial creation + * Apr 28, 2015 #4027 randerso Expunged Calendar from ActiveTableRecord * * * @@ -65,8 +66,8 @@ public class UnlockActiveTablePhenSigHandler implements + request.getSiteID() + "]: phensig= " + request.getPhensig() + ", nextETN= " + request.getNewEtn()); GetNextEtnUtil.setNextEtnAndUnlock(request.getSiteID(), - request.getMode(), request.getPhensig(), request.getYear(), - request.getNewEtn()); + request.getMode(), request.getPhensig(), + request.getCurrentTime(), request.getNewEtn()); return Boolean.TRUE; } } diff --git a/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/ActiveTableRecord.py b/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/ActiveTableRecord.py index a44e367158..d516cb6809 100644 --- a/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/ActiveTableRecord.py +++ b/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/ActiveTableRecord.py @@ -30,6 +30,7 @@ # 02/26/13 1447 dgilling Implement __eq__() and # __ne__(). # 07/23/13 2212 dgilling Fix typo in __eq__(). +# 04/28/2015 4027 randerso Expunged Calendar from ActiveTableRecord # # @@ -65,17 +66,17 @@ class ActiveTableRecord(object): elif key == 'seg': return self.atr.getSeg() elif key == 'startTime': - return self.atr.getStartTime().getTimeInMillis() / 1000 + return self.atr.getStartTime().getTime() / 1000 elif key == 'endTime': - return self.atr.getEndTime().getTimeInMillis() / 1000 + return self.atr.getEndTime().getTime() / 1000 elif key == 'ufn': return self.atr.isUfn() elif key == 'officeid': return self.atr.getOfficeid() elif key == 'purgeTime': - return self.atr.getPurgeTime().getTimeInMillis() / 1000 + return self.atr.getPurgeTime().getTime() / 1000 elif key == 'issueTime': - return self.atr.getIssueTime().getTimeInMillis() / 1000 + return self.atr.getIssueTime().getTime() / 1000 elif key == 'state': return self.state elif key == 'xxxid': diff --git a/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/ActiveTableVtec.py b/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/ActiveTableVtec.py index c0db4813e8..099a7e3cf1 100644 --- a/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/ActiveTableVtec.py +++ b/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/ActiveTableVtec.py @@ -29,7 +29,8 @@ import copy # # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- -# 09/19/08 njensen Initial Creation. +# 09/19/08 njensen Initial Creation. +# 04/28/2015 #4027 randerso Expunged Calendar from ActiveTableRecord # # # @@ -64,12 +65,12 @@ def transformActiveTableToPython(table): template['phensig'] = atr.getPhensig() template['act'] = atr.getAct() template['seg'] = atr.getSeg() - template['startTime'] = atr.getStartTime().getTimeInMillis() / 1000 - template['endTime'] = atr.getEndTime().getTimeInMillis() / 1000 + template['startTime'] = atr.getStartTime().getTime() / 1000 + template['endTime'] = atr.getEndTime().getTime() / 1000 template['ufn'] = atr.isUfn() template['officeid'] = atr.getOfficeid() - template['purgeTime'] = atr.getPurgeTime().getTimeInMillis() / 1000 - template['issueTime'] = atr.getIssueTime().getTimeInMillis() / 1000 + template['purgeTime'] = atr.getPurgeTime().getTime() / 1000 + template['issueTime'] = atr.getIssueTime().getTime() / 1000 template['state'] = "Decoded" template['xxxid'] = atr.getXxxid() @@ -98,7 +99,7 @@ def transfomActiveTableToThrift(table, mode='PRACTICE'): from dynamicserialize.dstypes.com.raytheon.uf.common.activetable.OperationalActiveTableRecord \ import OperationalActiveTableRecord # TODO: Eliminate use of Calendar - from dynamicserialize.dstypes.java.util import GregorianCalendar + from dynamicserialize.dstypes.java.util import Date tableList = [] if mode.upper()=='PRACTICE': @@ -120,17 +121,13 @@ def transfomActiveTableToThrift(table, mode='PRACTICE'): atr.setAct(template['act']) atr.setSeg(template['seg']) - start = GregorianCalendar.getInstance() - start.setTimeInMillis(template['startTime'] * 1000) + start = Date(template['startTime'] * 1000) atr.setStartTime(start) - end = GregorianCalendar.getInstance() - end.setTimeInMillis(template['endTime'] * 1000) + end = Date(template['endTime'] * 1000) atr.setEndTime(end) - purge = GregorianCalendar.getInstance() - purge.setTimeInMillis(template['purgeTime'] * 1000) + purge = Date(template['purgeTime'] * 1000) atr.setPurgeTime(purge) - issue = GregorianCalendar.getInstance() - issue.setTimeInMillis(template['issueTime'] * 1000) + issue = Date(template['issueTime'] * 1000) atr.setIssueTime(issue) atr.setUfn(template['ufn']) diff --git a/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/VTECTable.py b/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/VTECTable.py old mode 100755 new mode 100644 index ae184d40d5..324d0156a2 --- a/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/VTECTable.py +++ b/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/VTECTable.py @@ -31,298 +31,298 @@ VTECTable = { 'AF.W' : {'phen': 'AF', 'sig': 'W', - 'hdln': 'ASHFALL WARNING'}, + 'hdln': 'Ashfall Warning'}, 'AF.Y' : {'phen': 'AF', 'sig': 'Y', - 'hdln': 'ASHFALL ADVISORY'}, + 'hdln': 'Ashfall Advisory'}, 'AQ.Y' : {'phen': 'AQ', 'sig': 'Y', - 'hdln': 'AIR QUALITY ALERT'}, + 'hdln': 'Air Quality Alert'}, 'AS.O' : {'phen': 'AS', 'sig': 'O', - 'hdln': 'AIR STAGNATION OUTLOOK'}, + 'hdln': 'Air Stagnation Outlook'}, 'AS.Y' : {'phen': 'AS', 'sig': 'Y', - 'hdln': 'AIR STAGNATION ADVISORY'}, + 'hdln': 'Air Stagnation Advisory'}, 'BH.S' : {'phen': 'BH', 'sig': 'S', - 'hdln': 'BEACH HAZARDS STATEMENT'}, + 'hdln': 'Beach Hazards Statement'}, 'BW.Y' : {'phen': 'BW', 'sig': 'Y', - 'hdln': 'BRISK WIND ADVISORY'}, + 'hdln': 'Brisk Wind Advisory'}, 'BZ.A' : {'phen' : 'BZ', 'sig' : 'A', - 'hdln' : 'BLIZZARD WATCH'}, + 'hdln' : 'Blizzard Watch'}, 'BZ.W' : {'phen' : 'BZ', 'sig' : 'W', - 'hdln' : 'BLIZZARD WARNING'}, + 'hdln' : 'Blizzard Warning'}, 'CF.A' : {'phen': 'CF', 'sig': 'A', - 'hdln': 'COASTAL FLOOD WATCH'}, + 'hdln': 'Coastal Flood Watch'}, 'CF.W' : {'phen': 'CF', 'sig': 'W', - 'hdln': 'COASTAL FLOOD WARNING'}, + 'hdln': 'Coastal Flood Warning'}, 'CF.Y' : {'phen': 'CF', 'sig': 'Y', - 'hdln': 'COASTAL FLOOD ADVISORY'}, + 'hdln': 'Coastal Flood Advisory'}, 'CF.S' : {'phen': 'CF', 'sig': 'S', 'hdln': ''}, #No headline for this VTEC 'DS.W' : {'phen': 'DS', 'sig': 'W', - 'hdln': 'DUST STORM WARNING'}, + 'hdln': 'Dust Storm Warning'}, 'DU.Y' : {'phen': 'DU', 'sig': 'Y', - 'hdln': 'BLOWING DUST ADVISORY'}, + 'hdln': 'Blowing Dust Advisory'}, 'EC.A' : {'phen': 'EC', 'sig': 'A', - 'hdln': 'EXTREME COLD WATCH'}, + 'hdln': 'Extreme Cold Watch'}, 'EC.W' : {'phen': 'EC', 'sig': 'W', - 'hdln': 'EXTREME COLD WARNING'}, + 'hdln': 'Extreme Cold Warning'}, 'EH.A' : {'phen': 'EH', 'sig': 'A', - 'hdln': 'EXCESSIVE HEAT WATCH'}, + 'hdln': 'Excessive Heat Watch'}, 'EH.W' : {'phen': 'EH', 'sig': 'W', - 'hdln': 'EXCESSIVE HEAT WARNING'}, + 'hdln': 'Excessive Heat Warning'}, 'EW.W' : {'phen': 'EW', 'sig': 'W', - 'hdln': 'EXCESSIVE WIND WARNING'}, + 'hdln': 'Excessive Wind Warning'}, 'FA.A' : {'phen': 'FA', 'sig': 'A', - 'hdln': 'FLOOD WATCH'}, + 'hdln': 'Flood Watch'}, 'FA.W' : {'phen': 'FA', 'sig': 'W', - 'hdln': 'AREAL FLOOD WARNING'}, + 'hdln': 'Areal Flood Warning'}, 'FA.Y' : {'phen': 'FA', 'sig': 'Y', - 'hdln': 'AREAL FLOOD ADVISORY'}, + 'hdln': 'Areal Flood Advisory'}, 'FF.A' : {'phen': 'FF', 'sig': 'A', - 'hdln': 'FLASH FLOOD WATCH'}, + 'hdln': 'Flash Flood Watch'}, 'FF.W' : {'phen': 'FF', 'sig': 'W', - 'hdln': 'FLASH FLOOD WARNING'}, + 'hdln': 'Flash Flood Warning'}, 'FG.Y' : {'phen': 'FG', 'sig': 'Y', - 'hdln': 'DENSE FOG ADVISORY'}, + 'hdln': 'Dense Fog Advisory'}, 'FL.A' : {'phen': 'FL', 'sig': 'A', - 'hdln': 'FLOOD WATCH'}, + 'hdln': 'Flood Watch'}, 'FL.W' : {'phen': 'FL', 'sig': 'W', - 'hdln': 'FLOOD WARNING'}, + 'hdln': 'Flood Warning'}, 'FL.Y' : {'phen': 'FL', 'sig': 'Y', - 'hdln': 'FLOOD ADVISORY'}, + 'hdln': 'Flood Advisory'}, 'FR.Y' : {'phen': 'FR', 'sig': 'Y', - 'hdln': 'FROST ADVISORY'}, + 'hdln': 'Frost Advisory'}, 'FW.A' : {'phen': 'FW', 'sig': 'A', - 'hdln': 'FIRE WEATHER WATCH'}, + 'hdln': 'Fire Weather Watch'}, 'FW.W' : {'phen': 'FW', 'sig': 'W', - 'hdln': 'RED FLAG WARNING'}, + 'hdln': 'Red Flag Warning'}, 'FZ.A' : {'phen': 'FZ', 'sig': 'A', - 'hdln': 'FREEZE WATCH'}, + 'hdln': 'Freeze Watch'}, 'FZ.W' : {'phen': 'FZ', 'sig': 'W', - 'hdln': 'FREEZE WARNING'}, + 'hdln': 'Freeze Warning'}, 'GL.A' : {'phen': 'GL', 'sig': 'A', - 'hdln': 'GALE WATCH'}, + 'hdln': 'Gale Watch'}, 'GL.W' : {'phen': 'GL', 'sig': 'W', - 'hdln': 'GALE WARNING'}, + 'hdln': 'Gale Warning'}, 'HF.A' : {'phen': 'HF', 'sig': 'A', - 'hdln': 'HURRICANE FORCE WIND WATCH'}, + 'hdln': 'Hurricane Force Wind Watch'}, 'HF.W' : {'phen': 'HF', 'sig': 'W', - 'hdln': 'HURRICANE FORCE WIND WARNING'}, + 'hdln': 'Hurricane Force Wind Warning'}, 'HT.Y' : {'phen': 'HT', 'sig': 'Y', - 'hdln': 'HEAT ADVISORY'}, + 'hdln': 'Heat Advisory'}, 'HU.A' : {'phen': 'HU', 'sig': 'A', - 'hdln': 'HURRICANE WATCH'}, + 'hdln': 'Hurricane Watch'}, 'HU.S' : {'phen': 'HU', 'sig': 'S', 'hdln': ''}, #No headline for this VTEC 'HU.W' : {'phen': 'HU', 'sig': 'W', - 'hdln': 'HURRICANE WARNING'}, + 'hdln': 'Hurricane Warning'}, 'HW.A' : {'phen': 'HW', 'sig': 'A', - 'hdln': 'HIGH WIND WATCH'}, + 'hdln': 'High Wind Watch'}, 'HW.W' : {'phen': 'HW', 'sig': 'W', - 'hdln': 'HIGH WIND WARNING'}, + 'hdln': 'High Wind Warning'}, 'HZ.A' : {'phen': 'HZ', 'sig': 'A', - 'hdln': 'HARD FREEZE WATCH'}, + 'hdln': 'Hard Freeze Watch'}, 'HZ.W' : {'phen': 'HZ', 'sig': 'W', - 'hdln': 'HARD FREEZE WARNING'}, + 'hdln': 'Hard Freeze Warning'}, 'IS.W' : {'phen': 'IS', 'sig': 'W', - 'hdln': 'ICE STORM WARNING'}, + 'hdln': 'Ice Storm Warning'}, 'LE.A' : {'phen': 'LE', 'sig': 'A', - 'hdln': 'LAKE EFFECT SNOW WATCH'}, + 'hdln': 'Lake Effect Snow Watch'}, 'LE.W' : {'phen': 'LE', 'sig': 'W', - 'hdln': 'LAKE EFFECT SNOW WARNING'}, + 'hdln': 'Lake Effect Snow Warning'}, 'LE.Y' : {'phen': 'LE', 'sig': 'Y', - 'hdln': 'LAKE EFFECT SNOW ADVISORY'}, + 'hdln': 'Lake Effect Snow Advisory'}, 'LO.Y' : {'phen': 'LO', 'sig': 'Y', - 'hdln': 'LOW WATER ADVISORY'}, + 'hdln': 'Low Water Advisory'}, 'LS.A' : {'phen': 'LS', 'sig': 'A', - 'hdln': 'LAKESHORE FLOOD WATCH'}, + 'hdln': 'Lakeshore Flood Watch'}, 'LS.S' : {'phen': 'LS', 'sig': 'S', 'hdln': ''}, #No headline for this VTEC 'LS.W' : {'phen': 'LS', 'sig': 'W', - 'hdln': 'LAKESHORE FLOOD WARNING'}, + 'hdln': 'Lakeshore Flood Warning'}, 'LS.Y' : {'phen': 'LS', 'sig': 'Y', - 'hdln': 'LAKESHORE FLOOD ADVISORY'}, + 'hdln': 'Lakeshore Flood Advisory'}, 'LW.Y' : {'phen': 'LW', 'sig': 'Y', - 'hdln': 'LAKE WIND ADVISORY'}, + 'hdln': 'Lake Wind Advisory'}, 'MA.S' : {'phen': 'MA', 'sig': 'S', 'hdln': ''}, #No headline for this VTEC 'MA.W' : {'phen': 'MA', 'sig': 'W', - 'hdln': 'SPECIAL MARINE WARNING'}, + 'hdln': 'Special Marine Warning'}, 'MF.Y' : {'phen': 'MF', 'sig': 'Y', - 'hdln': 'DENSE FOG ADVISORY'}, # Marine Fog + 'hdln': 'Dense Fog Advisory'}, # Marine Fog 'MH.W' : {'phen': 'MH', 'sig': 'W', - 'hdln': 'ASHFALL WARNING'}, # Marine Ashfall + 'hdln': 'Ashfall Warning'}, # Marine Ashfall 'MH.Y' : {'phen': 'MH', 'sig': 'Y', - 'hdln': 'ASHFALL ADVISORY'}, # Marine Ashfall + 'hdln': 'Ashfall Advisory'}, # Marine Ashfall 'MS.Y' : {'phen': 'MS', 'sig': 'Y', - 'hdln': 'DENSE SMOKE ADVISORY'}, # Marine Smoke + 'hdln': 'Dense Smoke Advisory'}, # Marine Smoke 'RB.Y' : {'phen': 'RB', 'sig': 'Y', - 'hdln': 'SMALL CRAFT ADVISORY FOR ROUGH BAR'}, + 'hdln': 'Small Craft Advisory for rough bar'}, 'RP.S' : {'phen': 'RP', 'sig' : 'S', - 'hdln': 'HIGH RIP CURRENT RISK'}, #DR 21037 change + 'hdln': 'High Rip Current Risk'}, #DR 21037 change 'SC.Y' : {'phen': 'SC', 'sig': 'Y', - 'hdln': 'SMALL CRAFT ADVISORY'}, + 'hdln': 'Small Craft Advisory'}, 'SE.A' : {'phen': 'SE', 'sig': 'A', - 'hdln': 'HAZARDOUS SEAS WATCH'}, + 'hdln': 'Hazardous Seas Watch'}, 'SE.W' : {'phen': 'SE', 'sig': 'W', - 'hdln': 'HAZARDOUS SEAS WARNING'}, + 'hdln': 'Hazardous Seas Warning'}, 'SI.Y' : {'phen': 'SI', 'sig': 'Y', - 'hdln': 'SMALL CRAFT ADVISORY FOR WINDS'}, + 'hdln': 'Small Craft Advisory for winds'}, 'SM.Y' : {'phen': 'SM', 'sig': 'Y', - 'hdln': 'DENSE SMOKE ADVISORY'}, + 'hdln': 'Dense Smoke Advisory'}, 'SR.A' : {'phen': 'SR', 'sig': 'A', - 'hdln': 'STORM WATCH'}, + 'hdln': 'Storm Watch'}, 'SR.W' : {'phen': 'SR', 'sig': 'W', - 'hdln': 'STORM WARNING'}, + 'hdln': 'Storm Warning'}, 'SS.A' : {'phen': 'SS', 'sig': 'A', - 'hdln': 'STORM SURGE WATCH'}, + 'hdln': 'Storm Surge Watch'}, 'SS.W' : {'phen': 'SS', 'sig': 'W', - 'hdln': 'STORM SURGE WARNING'}, + 'hdln': 'Storm Surge Warning'}, 'SU.W' : {'phen': 'SU', 'sig': 'W', - 'hdln': 'HIGH SURF WARNING'}, + 'hdln': 'High Surf Warning'}, 'SU.Y' : {'phen': 'SU', 'sig': 'Y', - 'hdln': 'HIGH SURF ADVISORY'}, + 'hdln': 'High Surf Advisory'}, 'SV.A' : {'phen': 'SV', 'sig': 'A', - 'hdln': 'SEVERE THUNDERSTORM WATCH'}, + 'hdln': 'Severe Thunderstorm Watch'}, 'SV.W' : {'phen': 'SV', 'sig': 'W', - 'hdln': 'SEVERE THUNDERSTORM WARNING'}, + 'hdln': 'Severe Thunderstorm Warning'}, 'SW.Y' : {'phen': 'SW', 'sig': 'Y', - 'hdln': 'SMALL CRAFT ADVISORY FOR HAZARDOUS SEAS'}, + 'hdln': 'Small Craft Advisory for hazardous seas'}, 'TO.A' : {'phen': 'TO', 'sig': 'A', - 'hdln': 'TORNADO WATCH'}, + 'hdln': 'Tornado Watch'}, 'TO.W' : {'phen': 'TO', 'sig': 'W', - 'hdln': 'TORNADO WARNING'}, + 'hdln': 'Tornado Warning'}, 'TR.A' : {'phen': 'TR', 'sig': 'A', - 'hdln': 'TROPICAL STORM WATCH'}, + 'hdln': 'Tropical Storm Watch'}, 'TR.W' : {'phen': 'TR', 'sig': 'W', - 'hdln': 'TROPICAL STORM WARNING'}, + 'hdln': 'Tropical Storm Warning'}, 'TS.A' : {'phen': 'TS', 'sig': 'A', - 'hdln': 'TSUNAMI WATCH'}, + 'hdln': 'Tsunami Watch'}, 'TS.W' : {'phen': 'TS', 'sig': 'W', - 'hdln': 'TSUNAMI WARNING'}, + 'hdln': 'Tsunami Warning'}, 'TY.A' : {'phen': 'TY', 'sig': 'A', - 'hdln': 'TYPHOON WATCH'}, + 'hdln': 'Typhoon Watch'}, 'TY.W' : {'phen': 'TY', 'sig': 'W', - 'hdln': 'TYPHOON WARNING'}, + 'hdln': 'Typhoon Warning'}, 'UP.A' : {'phen': 'UP', 'sig': 'A', - 'hdln': 'HEAVY FREEZING SPRAY WATCH'}, + 'hdln': 'Heavy Freezing Spray Watch'}, 'UP.W' : {'phen': 'UP', 'sig': 'W', - 'hdln': 'HEAVY FREEZING SPRAY WARNING'}, + 'hdln': 'Heavy Freezing Spray Warning'}, 'UP.Y' : {'phen': 'UP', 'sig': 'Y', - 'hdln': 'FREEZING SPRAY ADVISORY'}, + 'hdln': 'Freezing Spray Advisory'}, 'WC.A' : {'phen': 'WC', 'sig': 'A', - 'hdln': 'WIND CHILL WATCH'}, + 'hdln': 'Wind Chill Watch'}, 'WC.W' : {'phen': 'WC', 'sig': 'W', - 'hdln': 'WIND CHILL WARNING'}, + 'hdln': 'Wind Chill Warning'}, 'WC.Y' : {'phen': 'WC', 'sig': 'Y', - 'hdln': 'WIND CHILL ADVISORY'}, + 'hdln': 'Wind Chill Advisory'}, 'WI.Y' : {'phen': 'WI', 'sig': 'Y', - 'hdln': 'WIND ADVISORY'}, + 'hdln': 'Wind Advisory'}, 'WS.A' : {'phen': 'WS', 'sig': 'A', - 'hdln': 'WINTER STORM WATCH'}, + 'hdln': 'Winter Storm Watch'}, 'WS.W' : {'phen': 'WS', 'sig': 'W', - 'hdln': 'WINTER STORM WARNING'}, + 'hdln': 'Winter Storm Warning'}, 'WW.Y' : {'phen': 'WW', 'sig': 'Y', - 'hdln': 'WINTER WEATHER ADVISORY'}, + 'hdln': 'Winter Weather Advisory'}, 'ZF.Y' : {'phen': 'ZF', 'sig': 'Y', - 'hdln': 'FREEZING FOG ADVISORY'}, + 'hdln': 'Freezing Fog Advisory'}, 'ZR.Y' : {'phen': 'ZR', 'sig': 'Y', - 'hdln': 'FREEZING RAIN ADVISORY'}, + 'hdln': 'Freezing Rain Advisory'}, } # diff --git a/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/requestAT.py b/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/requestAT.py index e1b9da894a..0c0de2347e 100644 --- a/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/requestAT.py +++ b/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/requestAT.py @@ -30,6 +30,7 @@ # 01/24/14 2504 randerso change to use iscUtil.getLogger for consistency # 05/15/14 #3157 dgilling Support multiple TPC and SPC sites. # 03/10/2015 #4129 randerso Refactored server selection code into a reusable method +# 04/28/2015 #4027 randerso Expunged Calendar from ActiveTableRecord # # @@ -100,7 +101,7 @@ def execute_request_at(serverHost, serverPort, serverProtocol, mhsid, siteID, an rec.getOfficeid() not in otherSites: continue - recIssueTime = float(rec.getIssueTime().getTimeInMillis() / TimeUtil.MILLIS_PER_SECOND) + recIssueTime = float(rec.getIssueTime().getTime() / TimeUtil.MILLIS_PER_SECOND) #track latest issueTime = max(recIssueTime, issueTime) diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.npp.viirs/utility/edex_static/base/viirs/viirsHeaderMapping.xml b/edexOsgi/com.raytheon.uf.edex.plugin.npp.viirs/utility/edex_static/base/viirs/viirsHeaderMapping.xml index 0d560db7c9..9e13cb5279 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.npp.viirs/utility/edex_static/base/viirs/viirsHeaderMapping.xml +++ b/edexOsgi/com.raytheon.uf.edex.plugin.npp.viirs/utility/edex_static/base/viirs/viirsHeaderMapping.xml @@ -25,6 +25,18 @@ Alaska + + CONUS + + + + Pacific + + + + Puerto Rico + + Imagery @@ -66,6 +78,14 @@ K 375.0 + + + + NCC + 0.7 + 0 + 750.0 + diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.satellite.gini/src/com/raytheon/uf/edex/plugin/satellite/gini/GiniSatelliteDecoder.java b/edexOsgi/com.raytheon.uf.edex.plugin.satellite.gini/src/com/raytheon/uf/edex/plugin/satellite/gini/GiniSatelliteDecoder.java index 49fc601ad1..d24c83e1e8 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.satellite.gini/src/com/raytheon/uf/edex/plugin/satellite/gini/GiniSatelliteDecoder.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.satellite.gini/src/com/raytheon/uf/edex/plugin/satellite/gini/GiniSatelliteDecoder.java @@ -37,8 +37,8 @@ import com.raytheon.edex.util.satellite.SatSpatialFactory; import com.raytheon.uf.common.dataplugin.PluginDataObject; import com.raytheon.uf.common.dataplugin.exception.UnrecognizedDataException; import com.raytheon.uf.common.dataplugin.satellite.SatMapCoverage; -import com.raytheon.uf.common.dataplugin.satellite.SatelliteMessageData; import com.raytheon.uf.common.dataplugin.satellite.SatelliteRecord; +import com.raytheon.uf.common.datastorage.DataStoreFactory; import com.raytheon.uf.common.datastorage.records.IDataRecord; import com.raytheon.uf.common.localization.IPathManager; import com.raytheon.uf.common.localization.LocalizationFile; @@ -97,6 +97,7 @@ import com.raytheon.uf.edex.plugin.satellite.gini.lookup.NumericLookupTable; * Nov 04, 2014 2714 bclement moved from satellite to satellite.gini * renamed from SatelliteDecoder to GiniDecoder * replaced database lookups with in memory tables + * Apr 15, 2014 4388 bsteffen Set Fill Value. * * * @@ -447,8 +448,6 @@ public class GiniSatelliteDecoder { default: break; } - SatelliteMessageData messageData = new SatelliteMessageData( - tempBytes, nx, ny); // get the latitude of the first point byteBuffer.position(20); @@ -537,8 +536,11 @@ public class GiniSatelliteDecoder { record.setTraceId(traceId); record.setCoverage(mapCoverage); // Create the data record. - IDataRecord dataRec = messageData.getStorageRecord(record, - SatelliteRecord.SAT_DATASET_NAME); + long[] sizes = new long[] { nx, ny }; + IDataRecord dataRec = DataStoreFactory.createStorageRecord( + SatelliteRecord.SAT_DATASET_NAME, record.getDataURI(), + tempBytes, 2, sizes); + dataRec.setFillValue(0); record.setMessageData(dataRec); } timer.stop(); diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.scan/src/com/raytheon/uf/edex/plugin/scan/process/GridProduct.java b/edexOsgi/com.raytheon.uf.edex.plugin.scan/src/com/raytheon/uf/edex/plugin/scan/process/GridProduct.java index 7fe81debf6..d9db6dd2be 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.scan/src/com/raytheon/uf/edex/plugin/scan/process/GridProduct.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.scan/src/com/raytheon/uf/edex/plugin/scan/process/GridProduct.java @@ -47,6 +47,7 @@ import com.raytheon.uf.edex.plugin.scan.ScanURIFilter; * Mar 2, 2012 bsteffen Initial creation * Jun 21, 2013 7613 zhao Modified getGridSQL() * Apr 24, 2014 2060 njensen Updates for removal of grid dataURI column + * Apr 17, 2015 4260 dhladky Update default SCAN models to HRRR * * * @@ -81,7 +82,7 @@ public abstract class GridProduct extends ScanProduct { protected static Pattern getGridPattern(String dataset, String parameter, String levelName, String levelOne, String levelTwo) { // Format = - // /pluginName/time/datasetId/secondaryId/locationName/parameterAbbr/levelName/levelOne/levelTwo/perturbation + // /pluginName/time/datasetId/secondaryId/ensembleID/gridID/parameterAbbr/levelName/levelOne/levelTwo StringBuilder pattern = new StringBuilder("^"); // pluginName pattern.append(uriSeparator); @@ -95,7 +96,10 @@ public abstract class GridProduct extends ScanProduct { // secondaryId pattern.append(uriSeparator); pattern.append(".*"); - // locationName + // ensemble ID + pattern.append(uriSeparator); + pattern.append(".*"); + // grid ID pattern.append(uriSeparator); pattern.append(".*"); // parameterAbbr @@ -110,9 +114,7 @@ public abstract class GridProduct extends ScanProduct { // levelTwo pattern.append(uriSeparator); pattern.append(levelTwo); - // perturbation - pattern.append(uriSeparator); - pattern.append("null"); + return Pattern.compile(pattern.toString()); } diff --git a/edexOsgi/com.raytheon.uf.tools.gfesuite.servicebackup/svcBackup/ServiceBackup/scripts/iscDataRec b/edexOsgi/com.raytheon.uf.tools.gfesuite.servicebackup/svcBackup/bin/iscDataRec similarity index 100% rename from edexOsgi/com.raytheon.uf.tools.gfesuite.servicebackup/svcBackup/ServiceBackup/scripts/iscDataRec rename to edexOsgi/com.raytheon.uf.tools.gfesuite.servicebackup/svcBackup/bin/iscDataRec diff --git a/pythonPackages/.settings/org.eclipse.core.resources.prefs b/pythonPackages/.settings/org.eclipse.core.resources.prefs index 72f02d7c46..9cd5508567 100644 --- a/pythonPackages/.settings/org.eclipse.core.resources.prefs +++ b/pythonPackages/.settings/org.eclipse.core.resources.prefs @@ -1,3 +1,3 @@ -#Sun Mar 20 15:17:07 CDT 2011 eclipse.preferences.version=1 encoding//werkzeug/examples/plnt/__init__.py=utf-8 +encoding//werkzeug/werkzeug/http.py=utf-8 diff --git a/pythonPackages/dynamicserialize/dstypes/java/util/Date.py b/pythonPackages/dynamicserialize/dstypes/java/util/Date.py index 5f436cff5f..733d8fb659 100644 --- a/pythonPackages/dynamicserialize/dstypes/java/util/Date.py +++ b/pythonPackages/dynamicserialize/dstypes/java/util/Date.py @@ -17,12 +17,20 @@ # See the AWIPS II Master Rights File ("Master Rights File.pdf") for # further licensing information. ## +# ---------------------------------------------------------------------------- +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# 04/28/2016 4027 randerso Added optional construction parameter to set the time +# +## -# File auto-generated against equivalent DynamicSerialize Java class class Date(object): - def __init__(self): + def __init__(self, timeInMillis=None): self.time = None def getTime(self):