Merge tag 'OB_15.1.1-32' into master_16.1.1
15.1.1-32 Conflicts: cave/com.raytheon.uf.viz.d2d.core/src/com/raytheon/uf/viz/d2d/core/time/D2DTimeMatcher.java cave/com.raytheon.viz.gfe/localization/gfe/userPython/procedures/MakeHazard.py cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/ProductEditorComp.java cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/template/TemplateRunner.java cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/text/AbstractLockingBehavior.java edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/VM_global_library.vm edexOsgi/com.raytheon.uf.edex.plugin.text/src/com/raytheon/uf/edex/plugin/text/fax/FaxSender.java Former-commit-id: f925ff11b783389e5ca32a2d7cd1ec5edfa835db
This commit is contained in:
commit
5759470634
30 changed files with 676 additions and 181 deletions
|
@ -38,9 +38,9 @@
|
|||
6 | 0 | 0 | 0.0 | 0 | AAP | Alert Adaptation Parms (AAP) | AAP | | | | | | | | | |22 | |
|
||||
8 | 0 | 0 | 0.0 | 0 | PTL | Product List (PTL) | PTL | | | | | | | | | |66 | |
|
||||
9 | 0 | 0 | 0.0 | 0 | AM | Alert Message (AM) | AM | | | | | | | | | |38 | |
|
||||
180| 256| 0 | 0.15 | 90 | Z | Reflectivity (Z) | Radial | y | | | | Z | | | | | 0 | |
|
||||
180| 256| 0 | 0.15 | 90 | Z | Reflectivity (Z) | Radial | y | | | | Z | | | | | 0 | | y
|
||||
181| 16 | 0 | 0.15 | 90 | Z | Reflectivity (Z) | Radial | y | | | | Z | | | | | 0 | |
|
||||
186| 256| 0 | 0.30 | 460 | Z | Long Range Refl (Z) | Radial | y | | | | Z | | | | | 0 | |
|
||||
186| 256| 0 | 0.30 | 460 | Z | Long Range Refl (Z) | Radial | y | | | | Z | | | | | 0 | | y
|
||||
187| 16 | 0 | 0.30 | 460 | Z | Long Range Refl (Z) | Radial | y | | | | Z | | | | | 0 | |
|
||||
94 |256 | 0 | 1.0 | 460 | Z | 8-bit Refl Array (Z) | Radial | y | | | | Z | | | | | 0 | | y
|
||||
153|256 | 0 | 0.25 | 460 | HZ | Super Res Reflectivity (Z) | Radial | y | | | | Z | | | | | 0 | 0.5 | y
|
||||
|
@ -52,7 +52,7 @@
|
|||
21 | 16 | 0 | 4.0 | 460 | Z | Reflectivity (Z) | Radial | y | | | | Z | | | | | 0 | |
|
||||
99 |256 | 0 | 0.25 | 300 | V | 8-bit Velocity Array (V) | Radial | y | | | | Vm| | | | | 1 | | y
|
||||
154|256 | 0 | 0.25 | 300 | HV | Super Res Velocity (V) | Radial | y | | | | Vm| | | | | 1 | 0.5 | y
|
||||
182| 256| 0 | 0.15 | 90 | V | Velocity (V) | Radial | y | | | | Vm| | | | | 1 | |
|
||||
182| 256| 0 | 0.15 | 90 | V | Velocity (V) | Radial | y | | | | Vm| | | | | 1 | | y
|
||||
183| 16 | 0 | 0.15 | 90 | V | Velocity (V) | Radial | y | | | | V | | | | | 1 | |
|
||||
22 | 8 | 0 | 0.25 | 60 | V | Velocity (V) | Radial | y | | | | V | | | | | 1 | |
|
||||
23 | 8 | 0 | 0.50 | 115 | V | Velocity (V) | Radial | y | | | | V | | | | | 1 | |
|
||||
|
|
|
@ -85,6 +85,9 @@ import com.raytheon.uf.viz.d2d.core.D2DLoadProperties;
|
|||
* FrameCoordinator.
|
||||
* Jul 14, 2015 DR 13900 D. Friedman Validate descriptor of time match basis
|
||||
* before time matching it.
|
||||
* Jul 30, 2015 17761 D. Friedman Allow resources to return data times based
|
||||
* on base frame times.
|
||||
*
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -352,7 +355,7 @@ public class D2DTimeMatcher extends AbstractTimeMatcher {
|
|||
config = config.clone();
|
||||
if ((config.getDataTimes() == null)
|
||||
|| (config.getDataTimes().length < 1)) {
|
||||
config.setDataTimes(getLatestTimes(rsc));
|
||||
config.setDataTimes(getLatestTimes(rsc, timeSteps));
|
||||
}
|
||||
populateConfiguration(config);
|
||||
TimeMatcher tm = new TimeMatcher();
|
||||
|
@ -514,7 +517,7 @@ public class D2DTimeMatcher extends AbstractTimeMatcher {
|
|||
rsc.getLoadProperties()).clone();
|
||||
if ((config.getDataTimes() == null)
|
||||
|| (config.getDataTimes().length < 1)) {
|
||||
config.setDataTimes(getLatestTimes(rsc));
|
||||
config.setDataTimes(getLatestTimes(rsc, null));
|
||||
if ((config.getDataTimes() == null)
|
||||
|| (config.getDataTimes().length < 1)) {
|
||||
return null;
|
||||
|
@ -635,10 +638,11 @@ public class D2DTimeMatcher extends AbstractTimeMatcher {
|
|||
* product times.
|
||||
*
|
||||
* @param rsc
|
||||
* @param timeSteps
|
||||
* @return
|
||||
* @throws VizException
|
||||
*/
|
||||
protected DataTime[] getLatestTimes(AbstractVizResource<?, ?> rsc)
|
||||
protected DataTime[] getLatestTimes(AbstractVizResource<?, ?> rsc, DataTime[] timeSteps)
|
||||
throws VizException {
|
||||
DataTime[] availableTimes = null;
|
||||
|
||||
|
@ -655,7 +659,7 @@ public class D2DTimeMatcher extends AbstractTimeMatcher {
|
|||
}
|
||||
|
||||
if (availableTimes == null) {
|
||||
availableTimes = rsc.getDataTimes();
|
||||
availableTimes = rsc.getMatchedDataTimes(timeSteps);
|
||||
Arrays.sort(availableTimes);
|
||||
}
|
||||
|
||||
|
|
|
@ -70,6 +70,7 @@ import com.raytheon.viz.ui.input.EditableManager;
|
|||
* adjustAngle to protected.
|
||||
* Mar 15, 2013 15693 mgamazaychikov Added magnification to display state.
|
||||
* Jun 10, 2014 3263 bsteffen Synchronize dataTimes
|
||||
* Jul 30, 2015 17761 D. Friedman Fix time matching.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -123,7 +124,7 @@ public abstract class AbstractStormTrackResource extends
|
|||
}
|
||||
|
||||
@Override
|
||||
public DataTime[] getDataTimes() {
|
||||
public DataTime[] getMatchedDataTimes(DataTime[] timeSteps) {
|
||||
synchronized (this.dataTimes) {
|
||||
|
||||
if (timeMatchBasis) {
|
||||
|
@ -142,12 +143,11 @@ public abstract class AbstractStormTrackResource extends
|
|||
this.fillDataTimeArray(earliestTime, variance);
|
||||
}
|
||||
} else {
|
||||
FramesInfo info = descriptor.getFramesInfo();
|
||||
dataTimes.clear();
|
||||
this.maximumFrameCount = this.descriptor.getNumberOfFrames();
|
||||
// First time called
|
||||
if (info.getFrameTimes() != null) {
|
||||
for (DataTime dt : info.getFrameTimes()) {
|
||||
if (timeSteps != null) {
|
||||
for (DataTime dt : timeSteps) {
|
||||
dataTimes.add(dt);
|
||||
}
|
||||
}
|
||||
|
@ -258,10 +258,6 @@ public abstract class AbstractStormTrackResource extends
|
|||
|
||||
@Override
|
||||
public String getName() {
|
||||
DataTime[] frameTimes = descriptor.getFramesInfo().getFrameTimes();
|
||||
if (frameTimes != null) {
|
||||
descriptor.getTimeMatchingMap().put(this, frameTimes);
|
||||
}
|
||||
return getResourceName();
|
||||
}
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
# Apr 09,2012 436 randerso Merged RNK's MakeHazards_Elevation procedure
|
||||
# Feb 12,2014 17058 ryu Extend converter for Collections$EmptyList objects.
|
||||
# Apr 23, 2015 4259 njensen Updated for new JEP API
|
||||
# Jul 29,2015 17770 lshi Added TY.A TY.W to tropicalHaz
|
||||
#
|
||||
# Author: randerso
|
||||
# ----------------------------------------------------------------------------
|
||||
|
@ -38,7 +39,7 @@ class Procedure (SmartScript.SmartScript):
|
|||
self._dataManager = dbss
|
||||
self._afterInit = 0 #flag indicating init is done.
|
||||
|
||||
self._tropicalHaz = ['HU.W','HU.A','HU.S','TR.W','TR.A']
|
||||
self._tropicalHaz = ['HU.W','HU.A','HU.S','TR.W','TR.A','TY.W','TY.A']
|
||||
self._natlBaseETN = 1001
|
||||
|
||||
|
||||
|
|
|
@ -1082,7 +1082,7 @@ FORECASTER STEWART"""
|
|||
|
||||
# We need to reverse the order of the advisories so the latest
|
||||
# advisories come first in this list
|
||||
stormAdvisories.reverse()
|
||||
stormAdvisories.sort(reverse=True)
|
||||
|
||||
lastTwoAdvisories = []
|
||||
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
# Updated 3/27/09 Shannon for tropical and AF.W
|
||||
# Updated 3/29/10 Shannon for tropical
|
||||
# Updated 1/12/11 Shannon to remove HI/TI hazards and fix typos
|
||||
# Updated 7/28/15 yteng to change Red Flag Warning CTA language for DR 17777
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
class CallToActions:
|
||||
|
@ -377,7 +378,7 @@ Listen to NOAA Weather Radio or local media for further information.""",
|
|||
|
||||
def ctaFWW(self):
|
||||
return [
|
||||
"""A Red Flag Warning means that critical fire weather conditions are either occurring now....or will shortly.""",
|
||||
"""A Red Flag Warning means that critical fire weather conditions are either occurring now....or will shortly. A combination of strong winds...low relative humidity...and warm temperatures can contribute to extreme fire behavior.""",
|
||||
]
|
||||
|
||||
def ctaFZA(self):
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
# ------------ ---------- ----------- --------------------------
|
||||
# Jul 10,2012 436 randerso Separated configuration data from the
|
||||
# MakeHazard procedure
|
||||
# Jul 29, 2015 17770 lshi Add tcmList template for WP basin
|
||||
#
|
||||
# Author: randerso
|
||||
# ----------------------------------------------------------------------------
|
||||
|
@ -144,6 +145,9 @@ tcmList = [] # Comment out for HLS sites
|
|||
# Uncomment line below for CPac basin sites
|
||||
#tcmList = ["TCMCP1", "TCMCP2", "TCMCP3", "TCMCP4", "TCMCP5"]
|
||||
|
||||
# Uncomment line below for WPac basin sites
|
||||
#tcmList = ["TCPPQ1", "TCPPQ2", "TCPPQ3", "TCPPQ4", "TCPPQ5"]
|
||||
|
||||
# Dictionary mapping Hazard Types to applicable local effect areas
|
||||
# that can be intersected with the zone edit areas.
|
||||
# You should not define localEffectAreas entries for Tropical Cyclone
|
||||
|
|
|
@ -26,6 +26,8 @@
|
|||
<value>TR.W</value>
|
||||
<value>SS.A</value>
|
||||
<value>SS.W</value>
|
||||
<value>TY.A</value>
|
||||
<value>TY.W</value>
|
||||
</set>
|
||||
</property>
|
||||
<property name="tropicalEtnPhensigs">
|
||||
|
@ -37,6 +39,8 @@
|
|||
<value>TR.W</value>
|
||||
<value>SS.A</value>
|
||||
<value>SS.W</value>
|
||||
<value>TY.A</value>
|
||||
<value>TY.W</value>
|
||||
</set>
|
||||
</property>
|
||||
</bean>
|
||||
|
@ -51,4 +55,4 @@
|
|||
<!-- <property name="sizeMemCacheMap" value="150"/>
|
||||
</bean> -->
|
||||
|
||||
</beans>
|
||||
</beans>
|
||||
|
|
|
@ -170,6 +170,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
|||
* 07/02/2015 13753 lshi Update times for products in Product Editor
|
||||
* 07/22/2015 13753 lshi Keeps issue time unchanged
|
||||
* 08/06/2015 13753 lshi removed updateTime flag, undo the change of updateIssueExpireTimes, etc.
|
||||
* 08/10/2015 4721 randerso Changed getNNNid() to use the productID field (not textdbPil)
|
||||
* </pre>
|
||||
*
|
||||
* @author lvenable
|
||||
|
@ -2718,7 +2719,7 @@ public class ProductEditorComp extends Composite implements
|
|||
}
|
||||
|
||||
public String getNNNid() {
|
||||
return textdbPil.substring(3, 6);
|
||||
return productId.substring(4, 7);
|
||||
}
|
||||
|
||||
public String getProductName() {
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
/**
|
||||
* This software was developed and / or modified by Raytheon Company,
|
||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
*
|
||||
*
|
||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
* 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.
|
||||
**/
|
||||
|
@ -67,6 +67,7 @@ import org.eclipse.ui.progress.UIJob;
|
|||
import org.opengis.referencing.FactoryException;
|
||||
import org.opengis.referencing.operation.TransformException;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.raytheon.uf.common.dataplugin.gfe.db.objects.GridLocation;
|
||||
import com.raytheon.uf.common.dataplugin.gfe.discrete.DiscreteDefinition;
|
||||
import com.raytheon.uf.common.dataplugin.gfe.discrete.DiscreteKey;
|
||||
|
@ -102,7 +103,7 @@ import com.raytheon.viz.ui.statusline.StatusStore;
|
|||
|
||||
/**
|
||||
* Make Hazard Dialog
|
||||
*
|
||||
*
|
||||
* <pre>
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
|
@ -114,9 +115,10 @@ import com.raytheon.viz.ui.statusline.StatusStore;
|
|||
* Apr 09,2012 436 randerso Merged RNK's MakeHazards_Elevation procedure
|
||||
* May 30,2012 2028 randerso Cleaned up dialog layout
|
||||
* Nov 13,2014 646 lshi Fixed hard coded endTimeSlider's Max value
|
||||
*
|
||||
* Jul 30,2015 17770 lshi Add handling for AT, EP, CP and WP basins
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* @author ebabin
|
||||
* @version 1.0
|
||||
*/
|
||||
|
@ -136,20 +138,20 @@ public class MakeHazardDialog extends CaveSWTDialog implements
|
|||
|
||||
private static final String EDIT_AREA_MSG = "USING ACTIVE EDIT AREA";
|
||||
|
||||
private List<String> tropicalHaz;
|
||||
private final List<String> tropicalHaz;
|
||||
|
||||
private int natlBaseETN;
|
||||
private final int natlBaseETN;
|
||||
|
||||
private Map<String, List<String>> localEffectAreas;
|
||||
private final Map<String, List<String>> localEffectAreas;
|
||||
|
||||
private Map<String, List<Object>> localAreaData;
|
||||
private final Map<String, List<Object>> localAreaData;
|
||||
|
||||
/**
|
||||
* Zoom step size.
|
||||
*/
|
||||
private static final double ZOOM_STEP = 0.75;
|
||||
|
||||
private Map<String, List<String>> hazardDict;
|
||||
private final Map<String, List<String>> hazardDict;
|
||||
|
||||
private Text etnSegNumberField;
|
||||
|
||||
|
@ -157,15 +159,15 @@ public class MakeHazardDialog extends CaveSWTDialog implements
|
|||
|
||||
private Label startTimeLabel, endTimeLabel;
|
||||
|
||||
private String gmtPattern = "HH:mm'Z' EEE dd-MMM-yy";
|
||||
private final String gmtPattern = "HH:mm'Z' EEE dd-MMM-yy";
|
||||
|
||||
private SimpleDateFormat dateFormatter;
|
||||
private final SimpleDateFormat dateFormatter;
|
||||
|
||||
private ZoneSelector zoneSelector;
|
||||
|
||||
/**
|
||||
* Used by hazard start and end Time.
|
||||
*
|
||||
*
|
||||
*/
|
||||
private int toHours = 96;
|
||||
|
||||
|
@ -180,9 +182,9 @@ public class MakeHazardDialog extends CaveSWTDialog implements
|
|||
/**
|
||||
* The Python script to load and run methods from.
|
||||
*/
|
||||
private String defaultHazardType;
|
||||
private final String defaultHazardType;
|
||||
|
||||
private Map<String, List<String>> mapNames;
|
||||
private final Map<String, List<String>> mapNames;
|
||||
|
||||
private Group hazardTypeGroup;
|
||||
|
||||
|
@ -194,11 +196,11 @@ public class MakeHazardDialog extends CaveSWTDialog implements
|
|||
|
||||
private Label usingLabel;
|
||||
|
||||
private int defaultMapWidth;
|
||||
private final int defaultMapWidth;
|
||||
|
||||
private RGB mapColor;
|
||||
|
||||
private int timeScaleEndTime;
|
||||
private final int timeScaleEndTime;
|
||||
|
||||
private double areaThreshold = DEFAULT_AREA_THRESHOLD;
|
||||
|
||||
|
@ -210,9 +212,9 @@ public class MakeHazardDialog extends CaveSWTDialog implements
|
|||
|
||||
private String defaultSegment;
|
||||
|
||||
private DataManager dataManager;
|
||||
private final DataManager dataManager;
|
||||
|
||||
private List<String> tcmList;
|
||||
private final List<String> tcmList;
|
||||
|
||||
private String tcmProduct = null;
|
||||
|
||||
|
@ -232,6 +234,14 @@ public class MakeHazardDialog extends CaveSWTDialog implements
|
|||
|
||||
private org.eclipse.swt.widgets.List hazardGroupList;
|
||||
|
||||
private static final String[] WMO_TITLES = {
|
||||
"NATIONAL HURRICANE CENTER", //NHC
|
||||
"NATIONAL WEATHER SERVICE TIYAN", //GUM
|
||||
"CENTRAL PACIFIC HURRICANE CENTER" //CPHC
|
||||
};
|
||||
|
||||
private static final Map<String, String> BASINS = ImmutableMap.of("AT", "10", "EP", "20", "CP", "30", "WP", "40");
|
||||
|
||||
public MakeHazardDialog(Shell parent, DataManager dataManager,
|
||||
String colorName, int defaultMapWidth, int timeScaleEndTime,
|
||||
float areaThreshold, String defaultHazardType,
|
||||
|
@ -465,7 +475,7 @@ public class MakeHazardDialog extends CaveSWTDialog implements
|
|||
* preview() process. Currently, we don't implement preview(), but we
|
||||
* probably will at some point in the future. When we do, we can get rid of
|
||||
* this method and let preview() do this for us like AWIPS I did.
|
||||
*
|
||||
*
|
||||
* @param parm
|
||||
* @return
|
||||
*/
|
||||
|
@ -512,7 +522,7 @@ public class MakeHazardDialog extends CaveSWTDialog implements
|
|||
* Figure out the hazard type (i.e., "Winter Weather") and db tables to use,
|
||||
* based on phen_sig. The same phensig sometimes appears in multiple hazard
|
||||
* types, so pick the one that draws from the most db tables.
|
||||
*
|
||||
*
|
||||
* @param phen_sig
|
||||
*/
|
||||
protected void pickDefaultCategory(String phen_sig) {
|
||||
|
@ -568,7 +578,7 @@ public class MakeHazardDialog extends CaveSWTDialog implements
|
|||
* Create the hazard in response to the run or run/dismiss button. Indicate
|
||||
* whether the run succeeded so run/dismiss knows whether it's OK to close
|
||||
* the dialog.
|
||||
*
|
||||
*
|
||||
* @return true if the hazard was created, false otherwise.
|
||||
*/
|
||||
private boolean doRunInternal(boolean dismiss) {
|
||||
|
@ -605,8 +615,7 @@ public class MakeHazardDialog extends CaveSWTDialog implements
|
|||
int segNum = getSegment();
|
||||
String segmentNumber = "";
|
||||
// Validate the segment number
|
||||
if ((this.tropicalHaz.contains(phenSig))
|
||||
&& !(this.dataManager.getSiteID().equals("GUM"))) {
|
||||
if ((this.tropicalHaz.contains(phenSig))) {
|
||||
// if ETN is already correctly assigned, use it
|
||||
if (segNum >= this.natlBaseETN) {
|
||||
segmentNumber = Integer.toString(segNum);
|
||||
|
@ -682,16 +691,18 @@ public class MakeHazardDialog extends CaveSWTDialog implements
|
|||
return null;
|
||||
} else {
|
||||
String altFileName = getAltInfoFilename(tcmProduct);
|
||||
String stormNum = altFileName.substring(2, 4);
|
||||
|
||||
System.out.println("storm number is " + stormNum);
|
||||
|
||||
String nationalBase = "10";
|
||||
tropicalETN = nationalBase + stormNum;
|
||||
|
||||
System.out.println("Tropical ETN is: " + tropicalETN);
|
||||
System.out.println("length of tropical ETN is: "
|
||||
+ tropicalETN.length());
|
||||
if (altFileName != null) {
|
||||
String nationalBase = BASINS.get("AT");
|
||||
String baseETN = altFileName.substring(0, 2);
|
||||
String baseEtnCode = BASINS.get(baseETN);
|
||||
if (baseEtnCode != null) {
|
||||
nationalBase = baseEtnCode;
|
||||
} else {
|
||||
statusHandler.warn("Undefined basin ID: " + baseETN + ", defaulting to AT");
|
||||
}
|
||||
String stormNum = altFileName.substring(2, 4);
|
||||
tropicalETN = nationalBase + stormNum;
|
||||
}
|
||||
}
|
||||
return tropicalETN;
|
||||
}
|
||||
|
@ -699,10 +710,12 @@ public class MakeHazardDialog extends CaveSWTDialog implements
|
|||
private String getAltInfoFilename(String[] tcmProduct) {
|
||||
String altFilename = null;
|
||||
for (int i = 0; i < tcmProduct.length; i++) {
|
||||
if (tcmProduct[i].contains("NATIONAL HURRICANE CENTER")) {
|
||||
String[] parts = tcmProduct[i].split("\\s");
|
||||
altFilename = parts[parts.length - 1];
|
||||
break;
|
||||
for (String title : WMO_TITLES) {
|
||||
if (tcmProduct[i].contains(title)) {
|
||||
String[] parts = tcmProduct[i].split("\\s");
|
||||
altFilename = parts[parts.length - 1];
|
||||
return altFilename;
|
||||
}
|
||||
}
|
||||
}
|
||||
return altFilename;
|
||||
|
@ -1120,7 +1133,7 @@ public class MakeHazardDialog extends CaveSWTDialog implements
|
|||
* Event handler for when the user moves the slider. This updates
|
||||
* the slider label and changes the end time slider if the end time
|
||||
* is before the start time.
|
||||
*
|
||||
*
|
||||
* @param e
|
||||
* The event that caused this handler to be called.
|
||||
*/
|
||||
|
@ -1185,7 +1198,7 @@ public class MakeHazardDialog extends CaveSWTDialog implements
|
|||
* Event handler for when the user moves the slider. This updates
|
||||
* the slider label and changes the start time slider if the end
|
||||
* time is before the start time.
|
||||
*
|
||||
*
|
||||
* @param e
|
||||
* The event that caused this handler to be called.
|
||||
*/
|
||||
|
@ -1302,7 +1315,7 @@ public class MakeHazardDialog extends CaveSWTDialog implements
|
|||
* Add <code>selection</code> hours to <code>hazardStartTime</code> (that
|
||||
* is, the default starting time), and set the text of <code>label</code> to
|
||||
* the result, formatted by <code>dateFormatter</code>.
|
||||
*
|
||||
*
|
||||
* @param selection
|
||||
* The integer slider value selected by the user.
|
||||
* @param label
|
||||
|
@ -1335,7 +1348,7 @@ public class MakeHazardDialog extends CaveSWTDialog implements
|
|||
* Set the hazard type in the radio button control. If the hazard type is
|
||||
* changed, the radio button selection listener will fire, changing and
|
||||
* clearing selectedHazardList as a side effect.
|
||||
*
|
||||
*
|
||||
* @param hazardType
|
||||
* the hazard type to select.
|
||||
*/
|
||||
|
@ -1384,7 +1397,7 @@ public class MakeHazardDialog extends CaveSWTDialog implements
|
|||
* Set the selection in selectedHazardList to the first item that starts
|
||||
* with phen_sig. If phen_sig is null or an empty string, clears all
|
||||
* selections.
|
||||
*
|
||||
*
|
||||
* @param phen_sig
|
||||
* The phen_sig to select
|
||||
*/
|
||||
|
@ -1487,7 +1500,7 @@ public class MakeHazardDialog extends CaveSWTDialog implements
|
|||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.viz.gfe.ui.zoneselector.ZoneSelector.IZoneSelectionListener
|
||||
* #zonesSelected()
|
||||
|
|
|
@ -49,6 +49,7 @@ import com.raytheon.uf.common.time.DataTime;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- --------------------------
|
||||
* Apr 09, 2014 2947 bsteffen Initial creation
|
||||
* Aug 04, 2015 4701 njensen Check time agnosticism in getDataRequest()
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -67,7 +68,6 @@ public class SatelliteRequestableLevelNode extends AbstractBaseDataNode {
|
|||
this.requestConstraints = requestConstraints;
|
||||
}
|
||||
|
||||
|
||||
public Map<String, RequestConstraint> getRequestConstraintMap() {
|
||||
return requestConstraints;
|
||||
}
|
||||
|
@ -101,10 +101,17 @@ public class SatelliteRequestableLevelNode extends AbstractBaseDataNode {
|
|||
DbQueryRequest request = getBaseRequest(originalConstraints);
|
||||
RequestConstraint timeRc = new RequestConstraint();
|
||||
timeRc.setConstraintType(ConstraintType.IN);
|
||||
boolean timeAgnostic = false;
|
||||
for (TimeAndSpace time : availability) {
|
||||
timeRc.addToConstraintValueList(time.getTime().toString());
|
||||
if (!time.isTimeAgnostic()) {
|
||||
timeRc.addToConstraintValueList(time.getTime().toString());
|
||||
} else {
|
||||
timeAgnostic = true;
|
||||
}
|
||||
}
|
||||
if (!timeAgnostic) {
|
||||
request.addConstraint(PluginDataObject.DATATIME_ID, timeRc);
|
||||
}
|
||||
request.addConstraint(PluginDataObject.DATATIME_ID, timeRc);
|
||||
return request;
|
||||
}
|
||||
|
||||
|
@ -124,7 +131,6 @@ public class SatelliteRequestableLevelNode extends AbstractBaseDataNode {
|
|||
return result;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Set<AbstractRequestableData> getData(
|
||||
Map<String, RequestConstraint> orignalConstraints,
|
||||
|
|
|
@ -22,6 +22,7 @@ import com.raytheon.viz.volumebrowser.vbui.VBMenuBarItemsMgr.ViewMenu;
|
|||
* Dec 11, 2013 2602 bsteffen Remove ISerializableObject.
|
||||
* Aug 14, 2014 3506 mapeters Added remove field and equals
|
||||
* and hashCode functions.
|
||||
* Jul 10, 2015 4641 mapeters Added toString().
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -142,7 +143,6 @@ public class VbSource {
|
|||
|
||||
@Override
|
||||
public boolean equals(Object that) {
|
||||
|
||||
if (that instanceof VbSource) {
|
||||
if ((this.key.equals(((VbSource) that).getKey()) && (this
|
||||
.getCategory().compareTo(((VbSource) that).getCategory()) == 0))) {
|
||||
|
@ -156,6 +156,20 @@ public class VbSource {
|
|||
public int hashCode() {
|
||||
String newKey = key.concat(category);
|
||||
return newKey.hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sourceString = new StringBuilder("VbSource[");
|
||||
sourceString.append("key=").append(key);
|
||||
sourceString.append(", ");
|
||||
sourceString.append("name=").append(name);
|
||||
sourceString.append(", ");
|
||||
sourceString.append("category=").append(category);
|
||||
sourceString.append(", ");
|
||||
sourceString.append("subCategory=").append(subCategory);
|
||||
sourceString.append("]");
|
||||
|
||||
return sourceString.toString();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ import java.util.Collections;
|
|||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
@ -32,6 +33,9 @@ import com.raytheon.uf.common.menus.xml.CommonMenuContribution;
|
|||
import com.raytheon.uf.common.menus.xml.CommonTitleImgContribution;
|
||||
import com.raytheon.uf.common.menus.xml.CommonToolBarContribution;
|
||||
import com.raytheon.uf.common.menus.xml.CommonToolbarSubmenuContribution;
|
||||
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.viz.volumebrowser.vbui.VBMenuBarItemsMgr.ViewMenu;
|
||||
|
||||
/**
|
||||
|
@ -51,6 +55,8 @@ import com.raytheon.viz.volumebrowser.vbui.VBMenuBarItemsMgr.ViewMenu;
|
|||
* Aug 19, 2014 3506 mapeters Populate toolbar contributions from directory of
|
||||
* source files instead of one file, merge sources from
|
||||
* different localization levels instead of overriding.
|
||||
* Jul 07, 2015 4641 mapeters Fix/improve comparators for VbSource sorting.
|
||||
* Jul 10, 2015 4641 mapeters Added check for sources with null key/category fields.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -61,30 +67,88 @@ import com.raytheon.viz.volumebrowser.vbui.VBMenuBarItemsMgr.ViewMenu;
|
|||
@XmlRootElement
|
||||
public class VbSourceList {
|
||||
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(VbSourceList.class);
|
||||
|
||||
private final static IPathManager pm = PathManagerFactory.getPathManager();
|
||||
|
||||
/** The sources categories in order */
|
||||
private static final String[] CATEGORIES = new String[] { "Volume",
|
||||
"SfcGrid", "Local", "Point" };
|
||||
|
||||
/**
|
||||
* Comparator for sorting sources (compares category, then subcategory, then
|
||||
* name).
|
||||
*/
|
||||
private static Comparator<VbSource> comparator = new Comparator<VbSource>() {
|
||||
/*
|
||||
* For sorting sources, compare subcategories first. If they are the
|
||||
* same or either source doesn't have one, compare display names.
|
||||
*/
|
||||
@Override
|
||||
public int compare(VbSource source1, VbSource source2) {
|
||||
String cat1 = source1.getCategory();
|
||||
String cat2 = source2.getCategory();
|
||||
if (!cat1.equals(cat2)) {
|
||||
/*
|
||||
* Categories are in the format
|
||||
* "DropDownMenu/SubMenu/SubMenu/..."
|
||||
*/
|
||||
String[] cat1Parts = cat1.split("/");
|
||||
String[] cat2Parts = cat2.split("/");
|
||||
int minParts = Math.min(cat1Parts.length, cat2Parts.length);
|
||||
for (int i = 0; i < minParts; i++) {
|
||||
if (!cat1Parts[i].equals(cat2Parts[i])) {
|
||||
/*
|
||||
* Compare the drop down menu names differently to keep
|
||||
* them in the order the NWS is used to.
|
||||
*/
|
||||
Comparator<String> comparator = (i == 0) ? categoryComparator
|
||||
: stringComparator;
|
||||
return comparator.compare(cat1Parts[i], cat2Parts[i]);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* At this point, categories must match up to the end of the
|
||||
* smaller of the two (e.g. SfcGrid and SfcGrid/RTOFS/forecast).
|
||||
* Return the comparison of sourceWithShorterCategory's name and
|
||||
* otherSource's next submenu level (RTOFS in the example).
|
||||
*/
|
||||
if (cat1Parts.length > minParts) {
|
||||
return stringComparator.compare(cat1Parts[minParts],
|
||||
source2.getName());
|
||||
} else {
|
||||
return stringComparator.compare(source1.getName(),
|
||||
cat2Parts[minParts]);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Compare subcategories next. If one source has a subcategory and
|
||||
* another doesn't, return the source with a subcategory as being
|
||||
* larger (later in the list).
|
||||
*/
|
||||
String subCat1 = source1.getSubCategory();
|
||||
String subCat2 = source2.getSubCategory();
|
||||
if (subCat1 != null && subCat2 != null && !subCat1.equals(subCat2)) {
|
||||
return comparatorString.compare(subCat1, subCat2);
|
||||
if (subCat1 != null && subCat2 != null) {
|
||||
if (!subCat1.equals(subCat2)) {
|
||||
return stringComparator.compare(subCat1, subCat2);
|
||||
}
|
||||
} else if (subCat1 != null) {
|
||||
return 1;
|
||||
} else if (subCat2 != null) {
|
||||
return -1;
|
||||
}
|
||||
return comparatorString.compare(source1.getName(),
|
||||
|
||||
// Compare names if categories and subcategories match.
|
||||
return stringComparator.compare(source1.getName(),
|
||||
source2.getName());
|
||||
}
|
||||
};
|
||||
|
||||
private static Comparator<String> comparatorString = new Comparator<String>() {
|
||||
/*
|
||||
* Compares two strings, ignoring capitalization and comparing numeric
|
||||
* values.
|
||||
*/
|
||||
/**
|
||||
* Comparator for comparing two strings, ignoring capitalization and
|
||||
* comparing numeric values (assumes there are no leading zeros in the
|
||||
* numeric values).
|
||||
*/
|
||||
private static Comparator<String> stringComparator = new Comparator<String>() {
|
||||
@Override
|
||||
public int compare(String s1, String s2) {
|
||||
int n1 = s1.length();
|
||||
|
@ -95,47 +159,54 @@ public class VbSourceList {
|
|||
for (int i = 0; i < min; i++) {
|
||||
char c1 = s1.charAt(i);
|
||||
char c2 = s2.charAt(i);
|
||||
if (c1 != c2) {
|
||||
if (Character.isDigit(c1) && Character.isDigit(c2)) {
|
||||
// Store aligned numeric values as strings
|
||||
number1 += c1;
|
||||
number2 += c2;
|
||||
} else if (!number1.equals(number2)) {
|
||||
if (Character.isDigit(c1)) {
|
||||
/*
|
||||
* Return first string as larger if it has
|
||||
* longer/larger numeric value.
|
||||
*/
|
||||
return 1;
|
||||
} else if (Character.isDigit(c2)) {
|
||||
/*
|
||||
* Return second string as larger if it has
|
||||
* longer/larger numeric value.
|
||||
*/
|
||||
return -1;
|
||||
} else {
|
||||
/*
|
||||
* Compare stored numeric values.
|
||||
*/
|
||||
return number1.charAt(0) - number2.charAt(0);
|
||||
}
|
||||
if (Character.isDigit(c1) && Character.isDigit(c2)) {
|
||||
/*
|
||||
* If aligned characters are both digits, store them as
|
||||
* strings and proceed to next pair of aligned characters.
|
||||
*/
|
||||
number1 += c1;
|
||||
number2 += c2;
|
||||
continue;
|
||||
} else if (!(Character.isDigit(c1) || Character.isDigit(c2))) {
|
||||
/*
|
||||
* If neither aligned character is a digit, return
|
||||
* difference in stored numbers if they aren't equal,
|
||||
* otherwise reset numbers if they aren't already empty.
|
||||
*/
|
||||
if (!number1.equals(number2)) {
|
||||
return Integer.valueOf(number1)
|
||||
- Integer.valueOf(number2);
|
||||
} else if (!number1.isEmpty()) {
|
||||
number1 = "";
|
||||
number2 = "";
|
||||
}
|
||||
} else if (!number1.isEmpty()) {
|
||||
/*
|
||||
* Exactly one of the two characters must be a digit to
|
||||
* reach here. If the numbers aren't empty, whichever string
|
||||
* has the extra digit is larger as its number is larger.
|
||||
*/
|
||||
if (Character.isDigit(c1)) {
|
||||
return 1;
|
||||
} else {
|
||||
c1 = Character.toUpperCase(c1);
|
||||
c2 = Character.toUpperCase(c2);
|
||||
if (c1 != c2) {
|
||||
c1 = Character.toLowerCase(c1);
|
||||
c2 = Character.toLowerCase(c2);
|
||||
if (c1 != c2) {
|
||||
// No overflow because of numeric promotion
|
||||
return c1 - c2;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
c1 = Character.toUpperCase(c1);
|
||||
c2 = Character.toUpperCase(c2);
|
||||
if (c1 != c2) {
|
||||
c1 = Character.toLowerCase(c1);
|
||||
c2 = Character.toLowerCase(c2);
|
||||
if (c1 != c2) {
|
||||
// No overflow because of numeric promotion
|
||||
return c1 - c2;
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
* If two strings end with numeric values after for loop, check for
|
||||
* additional digits beyond minimum length to determine order.
|
||||
* If two strings end with unequal numeric values after for loop,
|
||||
* check for additional digits beyond minimum length to determine
|
||||
* order.
|
||||
*/
|
||||
if (!number1.equals(number2)) {
|
||||
if (n1 > n2 && Character.isDigit(s1.charAt(n2))) {
|
||||
|
@ -143,16 +214,49 @@ public class VbSourceList {
|
|||
} else if (n2 > n1 && Character.isDigit(s2.charAt(n1))) {
|
||||
return -1;
|
||||
} else
|
||||
return number1.charAt(0) - number2.charAt(0);
|
||||
return Integer.valueOf(number1) - Integer.valueOf(number2);
|
||||
}
|
||||
return n1 - n2;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Comparator for comparing the drop down menu names of the sources.
|
||||
* Determines order based on {@link #CATEGORIES}.
|
||||
*/
|
||||
private static Comparator<String> categoryComparator = new Comparator<String>() {
|
||||
@Override
|
||||
public int compare(String cat1, String cat2) {
|
||||
if (cat1.equals(cat2)) {
|
||||
return 0;
|
||||
}
|
||||
for (String category : CATEGORIES) {
|
||||
/*
|
||||
* The categories aren't equal (checked for above), so whichever
|
||||
* one appears first in the ordered categories list (CATEGORIES)
|
||||
* should be returned as being smaller (making it also appear
|
||||
* earlier in the sorted list of VbSources).
|
||||
*/
|
||||
if (cat1.equals(category)) {
|
||||
return -1;
|
||||
} else if (cat2.equals(category)) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* If neither category is in the ordered list of expected
|
||||
* categories, compare them alphabetically.
|
||||
*/
|
||||
return stringComparator.compare(cat1, cat2);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @deprecated This file path string exists only to support legacy overrides
|
||||
* and should eventually be removed.
|
||||
*/
|
||||
@Deprecated
|
||||
private final static String VB_SOURCE_FILE = "volumebrowser/VbSources.xml";
|
||||
|
||||
private final static char SUB_MENU_SPLIT = '/';
|
||||
|
@ -257,6 +361,18 @@ public class VbSourceList {
|
|||
List<VbSource> sources = JAXB.unmarshal(locFile.getFile(),
|
||||
VbSourceList.class).getEntries();
|
||||
if (sources != null) {
|
||||
Iterator<VbSource> itr = sources.iterator();
|
||||
while (itr.hasNext()) {
|
||||
VbSource source = itr.next();
|
||||
if (source.getCategory() == null
|
||||
|| source.getKey() == null) {
|
||||
statusHandler
|
||||
.handle(Priority.WARN,
|
||||
source
|
||||
+ " was excluded from sources menu due to null key and/or category field.");
|
||||
itr.remove();
|
||||
}
|
||||
}
|
||||
allSources.addAll(sources);
|
||||
}
|
||||
}
|
||||
|
@ -267,8 +383,11 @@ public class VbSourceList {
|
|||
DatasetInfo info;
|
||||
// Set containing sources to not be added to lists
|
||||
Set<VbSource> removes = new HashSet<VbSource>();
|
||||
for (int i = 0; i < allSources.size(); i++) {
|
||||
VbSource source = allSources.get(i);
|
||||
Iterator<VbSource> itr = allSources.iterator();
|
||||
// The current index in allSources
|
||||
int i = 0;
|
||||
while (itr.hasNext()) {
|
||||
VbSource source = itr.next();
|
||||
// Set display names for sources
|
||||
if (source.getName() == null) {
|
||||
info = lookup.getInfo(source.getKey());
|
||||
|
@ -277,11 +396,14 @@ public class VbSourceList {
|
|||
if (source.getRemove()) {
|
||||
// Add sources with remove tags to removal set and remove them.
|
||||
removes.add(source);
|
||||
allSources.remove(i--);
|
||||
itr.remove();
|
||||
} else if (removes.contains(source)
|
||||
|| allSources.subList(0, i).contains(source)) {
|
||||
// Remove sources in removal set and repeats
|
||||
allSources.remove(i--);
|
||||
itr.remove();
|
||||
} else {
|
||||
// Increment index in allSources if source wasn't removed
|
||||
i++;
|
||||
}
|
||||
}
|
||||
Collections.sort(allSources, comparator);
|
||||
|
|
|
@ -100,6 +100,7 @@ import com.raytheon.viz.warnings.DateUtil;
|
|||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
import com.vividsolutions.jts.geom.Geometry;
|
||||
import com.vividsolutions.jts.geom.Polygon;
|
||||
import com.vividsolutions.jts.geom.TopologyException;
|
||||
import com.vividsolutions.jts.io.WKTReader;
|
||||
|
||||
/**
|
||||
|
@ -149,6 +150,7 @@ import com.vividsolutions.jts.io.WKTReader;
|
|||
* Sep 18, 2014 ASM #15465 Qinglu Lin For backup, get officeShort and officeLoc from backup WFO's config.xml.
|
||||
* May 7, 2015 ASM #17438 D. Friedman Clean up debug and performance logging.
|
||||
* May 29, 2015 4440 randerso Fix resource leak (file not closed)
|
||||
* Jul 15, 2015 DR17716 mgamazaychikov Change to Geometry class in total intersection calculations.
|
||||
* </pre>
|
||||
*
|
||||
* @author njensen
|
||||
|
@ -330,7 +332,7 @@ public class TemplateRunner {
|
|||
} else {
|
||||
// Determine if one letter timezone is going to be
|
||||
// put into timeZones.
|
||||
Polygon[] poly1, poly2;
|
||||
Geometry[] poly1, poly2;
|
||||
int n1, n2;
|
||||
double size, totalSize;
|
||||
for (int i = 0; i < oneLetterTimeZones.length(); i++) {
|
||||
|
@ -350,25 +352,32 @@ public class TemplateRunner {
|
|||
if (intersectSize.get(oneLetterTZ[i]) != null) {
|
||||
continue;
|
||||
}
|
||||
poly1 = new Polygon[warningArea
|
||||
poly1 = new Geometry[warningArea
|
||||
.getNumGeometries()];
|
||||
n1 = warningArea.getNumGeometries();
|
||||
for (int j = 0; j < n1; j++) {
|
||||
poly1[j] = (Polygon) warningArea
|
||||
poly1[j] = warningArea
|
||||
.getGeometryN(j);
|
||||
}
|
||||
poly2 = new Polygon[timezoneGeom
|
||||
poly2 = new Geometry[timezoneGeom
|
||||
.getNumGeometries()];
|
||||
n2 = timezoneGeom.getNumGeometries();
|
||||
for (int j = 0; j < n2; j++) {
|
||||
poly2[j] = (Polygon) timezoneGeom
|
||||
poly2[j] = timezoneGeom
|
||||
.getGeometryN(j);
|
||||
}
|
||||
// Calculate the total size of intersection
|
||||
for (Polygon p1 : poly1) {
|
||||
for (Polygon p2 : poly2) {
|
||||
size = p1.intersection(p2)
|
||||
.getArea();
|
||||
for (Geometry p1 : poly1) {
|
||||
for (Geometry p2 : poly2) {
|
||||
try {
|
||||
size = p1.intersection(p2)
|
||||
.getArea();
|
||||
} catch (TopologyException e) {
|
||||
statusHandler
|
||||
.handle(Priority.VERBOSE,
|
||||
"Geometry error calculating the total size of intersection.",
|
||||
e);
|
||||
}
|
||||
if (size > 0.0) {
|
||||
totalSize += size;
|
||||
}
|
||||
|
|
|
@ -59,6 +59,7 @@ import com.raytheon.viz.warngen.gis.AffectedAreas;
|
|||
* May 13, 2014 DR 17177 Qinglu Lin Updated secondBullet().
|
||||
* May 29, 2015 4442 randerso Fixed WarnGen text locking to work with mixed case
|
||||
* Jul 10, 2015 DR 17314 Qinglu Lin Updated firstBullet().
|
||||
* Jul 15, 2015 DR17716 mgamazaychikov Remove all nulls from the affectedAreas to avoid TimSort NPE in initialize.
|
||||
* Jul 17, 2015 DR 17314 D. Friedman Fix string replacement in firstBullet().
|
||||
* Aug 5, 2015 DR 17865 Qinglu Lin Updated firstBullet() for issue brought in by mixed case DCS.
|
||||
*
|
||||
|
@ -348,6 +349,8 @@ abstract public class AbstractLockingBehavior {
|
|||
if (canceledAreas != null) {
|
||||
this.affectedAreas.addAll(Arrays.asList(canceledAreas));
|
||||
}
|
||||
// remove all nulls from the collection to avoid TimSort NPE
|
||||
this.affectedAreas.removeAll(Collections.singleton(null));
|
||||
Collections.sort(this.affectedAreas, comparator);
|
||||
}
|
||||
|
||||
|
|
|
@ -231,6 +231,11 @@
|
|||
<constructor-arg value="com.raytheon.uf.common.dataplugin.gfe.request.GetTopoDataRequest"/>
|
||||
<constructor-arg ref="getTopoDataHandler"/>
|
||||
</bean>
|
||||
<bean id="rsyncGridsToCWFHandler" class="com.raytheon.edex.plugin.gfe.server.handler.RsyncGridsToCWFHandler"/>
|
||||
<bean factory-bean="handlerRegistry" factory-method="register">
|
||||
<constructor-arg value="com.raytheon.uf.common.dataplugin.gfe.request.RsyncGridsToCWFRequest"/>
|
||||
<constructor-arg ref="rsyncGridsToCWFHandler"/>
|
||||
</bean>
|
||||
<bean id="ClearGfeOrphanedLocks" class="com.raytheon.edex.plugin.gfe.server.lock.ClearGfeOrphanedLocks">
|
||||
<property name="provider" ref="brokerConnectionsProvider" />
|
||||
</bean>
|
||||
|
|
|
@ -0,0 +1,76 @@
|
|||
/**
|
||||
* 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.server.handler;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.gfe.request.RsyncGridsToCWFRequest;
|
||||
import com.raytheon.uf.common.serialization.comm.IRequestHandler;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.util.RunProcess;
|
||||
|
||||
/**
|
||||
* rsync GFE grids to CWF handler
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jul 15, 2015 #4013 randerso Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author randerso
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class RsyncGridsToCWFHandler implements
|
||||
IRequestHandler<RsyncGridsToCWFRequest> {
|
||||
protected static final IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(RsyncGridsToCWFHandler.class);
|
||||
|
||||
@Override
|
||||
public Object handleRequest(RsyncGridsToCWFRequest request)
|
||||
throws Exception {
|
||||
|
||||
String command = "/awips2/GFESuite/bin/rsyncGridsToCWF.sh "
|
||||
+ request.getSiteID();
|
||||
statusHandler.info("Running: \"" + command + "\"");
|
||||
RunProcess proc;
|
||||
try {
|
||||
proc = RunProcess.getRunProcess().exec(command);
|
||||
} catch (IOException e) {
|
||||
statusHandler.error("Error executing " + command, e);
|
||||
return null;
|
||||
}
|
||||
|
||||
int exitCode = proc.waitFor();
|
||||
if (exitCode != 0) {
|
||||
statusHandler.error(command
|
||||
+ " terminated abnormally with exit code: " + exitCode);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
# Version 2015.6.16-0
|
||||
# Version 2015.7.22-0
|
||||
|
||||
import GenericHazards
|
||||
import string, time, os, re, types, copy, LogStream, collections
|
||||
|
@ -23,7 +23,7 @@ class TextProduct(HLSTCV_Common.TextProduct):
|
|||
Definition["database"] = "Official" # Source database
|
||||
Definition["debug"] = 1
|
||||
Definition["mapNameForCombinations"] = "Zones_<site>"
|
||||
Definition["defaultEditAreas"] = ""
|
||||
Definition["defaultEditAreas"] = []
|
||||
Definition["showZoneCombiner"] = 0 # 1 to cause zone combiner to display
|
||||
|
||||
Definition["productName"] = "Local Statement"
|
||||
|
@ -1137,6 +1137,8 @@ class TextProduct(HLSTCV_Common.TextProduct):
|
|||
statDict = statList[period]
|
||||
for threatName in ['WindThreat', 'FloodingRainThreat', 'TornadoThreat']:
|
||||
self._sampleRankedDiscreteValue(threatName, statDict)
|
||||
# TODO: Investigate if this sampling method is still really needed. The JSON files may
|
||||
# have all the needed information now
|
||||
self._sampleMostSignificantDiscreteValue(threatName, statDict)
|
||||
|
||||
qpfToFfgRatio = self._getStatValue(statDict, "QPFtoFFGRatio", "Max")
|
||||
|
@ -1183,7 +1185,6 @@ class TextProduct(HLSTCV_Common.TextProduct):
|
|||
for period in range(len(statList)):
|
||||
statDict = statList[period]
|
||||
self._sampleRankedDiscreteValue('StormSurgeThreat', statDict)
|
||||
self._sampleMostSignificantDiscreteValue('StormSurgeThreat', statDict)
|
||||
|
||||
inundationMax = self._getStatValue(statDict, "InundationMax", "Max")
|
||||
decidingField = self._samplingDict['StormSurgeThreat']['decidingField']
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Version 2015.5.22-0
|
||||
# Version 2015.7.23-0
|
||||
|
||||
import GenericHazards
|
||||
import JsonSupport
|
||||
|
@ -433,7 +433,6 @@ class TextProduct(HLSTCV_Common.TextProduct):
|
|||
analysisList = [
|
||||
("InundationMax", self.moderatedMax, [6]),
|
||||
("InundationTiming", self.moderatedMax, [6]),
|
||||
("StormSurgeThreat", self.mostSignificantDiscreteValue),
|
||||
]
|
||||
|
||||
return analysisList
|
||||
|
@ -1774,16 +1773,36 @@ class StormSurgeSection(SectionCommon):
|
|||
summary + " storm surge possible")
|
||||
|
||||
def _peakSurge(self, segmentDict, productSegmentGroup, productSegment):
|
||||
self._textProduct.debug_print("_peakSurge _inundationMax = %s" % (self._stats._inundationMax), 1)
|
||||
|
||||
if self._stats._inundationMax is not None and self._stats._inundationMax >= 1:
|
||||
max = self._stats._inundationMax
|
||||
max = round(self._stats._inundationMax)
|
||||
self._stats._maxThreat = "None"
|
||||
if max > 10:
|
||||
maxRange = 4
|
||||
self._stats._maxThreat = "Extreme"
|
||||
elif max > 6:
|
||||
maxRange = 3
|
||||
elif max > 2:
|
||||
if max >= 10:
|
||||
self._stats._maxThreat = "Extreme"
|
||||
else:
|
||||
self._stats._maxThreat = "High"
|
||||
elif max >= 3:
|
||||
maxRange = 2
|
||||
if max >= 4:
|
||||
self._stats._maxThreat = "Mod"
|
||||
else:
|
||||
self._stats._maxThreat = "Elevated"
|
||||
else:
|
||||
maxRange = None
|
||||
if max > 0:
|
||||
self._stats._maxThreat = "Elevated"
|
||||
|
||||
self._textProduct.debug_print("_peakSurge maxRange = %s" % (maxRange), 1)
|
||||
self._textProduct.debug_print("_peakSurge _maxThreat = %s" % (self._stats._maxThreat), 1)
|
||||
|
||||
# Save off the surge threat to the advisory
|
||||
self._textProduct._currentAdvisory['ZoneData'][self._segment]["StormSurgeThreat"] = self._stats._maxThreat
|
||||
|
||||
if maxRange is not None:
|
||||
words = str(int(max - maxRange)) + "-" + str(int(max)) + " feet above ground"
|
||||
|
@ -2680,8 +2699,7 @@ class StormSurgeSectionStats(SectionCommonStats):
|
|||
|
||||
if phishEndTime is None:
|
||||
phishEndTime = tr.startTime()
|
||||
|
||||
self._updateThreatStats(tr, statDict, "StormSurgeThreat")
|
||||
|
||||
|
||||
self._windowSurge = "Window of concern: "
|
||||
|
||||
|
@ -2720,7 +2738,6 @@ class StormSurgeSectionStats(SectionCommonStats):
|
|||
else:
|
||||
self._windowSurge += "through " + endTimeDescriptor
|
||||
|
||||
self._currentAdvisory["StormSurgeThreat"] = self._maxThreat
|
||||
if self._inundationMax is not None:
|
||||
# Round so we don't store values like 1.600000023841858
|
||||
self._currentAdvisory["StormSurgeForecast"] = \
|
||||
|
@ -2751,10 +2768,6 @@ class StormSurgeSectionStats(SectionCommonStats):
|
|||
# Inundation timing - only applies if any inundation forecast
|
||||
if self._inundationMax >= 1 and self._onsetSurgeHour is None:
|
||||
missingGridsList.append("InundationTiming")
|
||||
|
||||
# Threat grid
|
||||
if self._maxThreat is None:
|
||||
missingGridsList.append("StormSurgeThreat")
|
||||
|
||||
# If there are any missing grids - let the user know
|
||||
if len(missingGridsList) > 0:
|
||||
|
|
|
@ -43,9 +43,9 @@
|
|||
6 |0 |0 |0.0 |0 |AAP |Alert Adaptation Parms |Alert Adaptation Parms |AAP |AAP | | | | | | | | | |22 | |
|
||||
8 |0 |0 |0.0 |0 |PTL |Product List |Product List |PTL |PTL | | | | | | | | | |66 | |
|
||||
9 |0 |0 |0.0 |0 |AM |Alert Message |Alert Message |AM |AM | | | | | | | | | |38 | |
|
||||
180|256 |0 |0.15 |90 |Z |Reflectivity |{S} {T} Reflectivity ({U}) {B}bit |{S} {T} Z {B}bit |Radial |y | | | |Z | | | | |0 |dBZ/10 |
|
||||
180|256 |0 |0.15 |90 |Z |Reflectivity |{S} {T} Reflectivity ({U}) {B}bit |{S} {T} Z {B}bit |Radial |y | | | |Z | | | | |0 |dBZ/10 | y
|
||||
181|16 |0 |0.15 |90 |Z |Reflectivity |{S} {T} Reflectivity ({U}) {B}bit |{S} {T} Z {B}bit |Radial |y | | | |Z | | | | |0 |dBZ |
|
||||
186|256 |0 |0.30 |460 |Z |Long Range Refl |{S} Long Rng Refl ({U}) {B}bit |{S} {T} TDWR LR Z {B}bit |Radial |y | | | |Z | | | | |0 |dBZ/10 |
|
||||
186|256 |0 |0.30 |460 |Z |Long Range Refl |{S} Long Rng Refl ({U}) {B}bit |{S} {T} TDWR LR Z {B}bit |Radial |y | | | |Z | | | | |0 |dBZ/10 | y
|
||||
187|16 |0 |0.30 |460 |Z |Long Range Refl |{S} Long Rng Refl ({U}) {B}bit |{S} {T} TDWR LR Z {B}bit |Radial |y | | | |Z | | | | |0 |dBZ |
|
||||
94 |256 |0 |1.0 |460 |Z |Reflectivity |{S} {T} Reflectivity ({U}) {B}bit |{S} {T} Z {B}bit |Radial |y | | | |Z | | | | |0 |dBZ/10 | y
|
||||
153|256 |0 |0.25 |460 |HZ |Reflectivity |{S} {T} Reflectivity ({U}) {B}bit |{S} {T} Z {B}bit |Radial |y | | | |Z | | | | |0 |dBZ/10 | y
|
||||
|
@ -57,7 +57,7 @@
|
|||
21 |16 |0 |4.0 |460 |Z |Reflectivity |{S} {T} Reflectivity {B}bit ({U}) |{S} {T} Refl {B} |Radial |y | | | |Z | | | | |0 |dBZ |
|
||||
99 |256 |0 |0.25 |300 |V |Velocity |MODE=V:{S} {T} Velocity ({U}) {B}bit;MODE=SRM8:{S} {T} Storm Rel Vel {B}bit ({U}) |MODE=V:{S} {T} V {B}bit;MODE=SRM8:{S} {T} SRM |Radial |y | | | |Vm | | | | |1 |(m/s)/10| y
|
||||
154|256 |0 |0.25 |300 |HV |Velocity |MODE=V:{S} {T} Velocity ({U}) {B}bit;MODE=SRM8:{S} {T} Storm Rel Vel {B}bit ({U}) |MODE=V:{S} {T} V {B}bit;MODE=SRM8:{S} {T} SRM |Radial |y | | | |Vm | | | | |1 |(m/s)/10| y
|
||||
182|256 |0 |0.15 |90 |V |Velocity |MODE=V:{S} {T} Velocity ({U}) {B}bit;MODE=SRM8:{S} {T} Storm Rel Vel {B}bit ({U}) |MODE=V:{S} {T} V {B}bit;MODE=SRM8:{S} {T} SRM |Radial |y | | | |Vm | | | | |1 |(m/s)/10|
|
||||
182|256 |0 |0.15 |90 |V |Velocity |MODE=V:{S} {T} Velocity ({U}) {B}bit;MODE=SRM8:{S} {T} Storm Rel Vel {B}bit ({U}) |MODE=V:{S} {T} V {B}bit;MODE=SRM8:{S} {T} SRM |Radial |y | | | |Vm | | | | |1 |(m/s)/10| y
|
||||
183|16 |0 |0.15 |90 |V |Velocity |{S} {T} Velocity ({U}) |{S} {T} V |Radial |y | | | |V | | | | |1 |kts |
|
||||
22 |8 |0 |0.25 |60 |V |Velocity |{S} {T} Vel {B}bit ({U}) |{S} {T} Vel {B} |Radial |y | | | |V | | | | |1 |kts |
|
||||
23 |8 |0 |0.50 |115 |V |Velocity |{S} {T} Vel {B}bit ({U}) |{S} {T} Vel {B} |Radial |y | | | |V | | | | |1 |kts |
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
/**
|
||||
* This software was developed and / or modified by Raytheon Company,
|
||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
*
|
||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
* This software product contains export-restricted data whose
|
||||
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
* to non-U.S. persons whether in the United States or abroad requires
|
||||
* an export license or other authorization.
|
||||
*
|
||||
* Contractor Name: Raytheon Company
|
||||
* Contractor Address: 6825 Pine Street, Suite 340
|
||||
* Mail Stop B8
|
||||
* Omaha, NE 68106
|
||||
* 402.291.0100
|
||||
*
|
||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.uf.common.dataplugin.gfe.request;
|
||||
|
||||
/**
|
||||
* rsync GFE grids to CWF request
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jul 15, 2015 #4013 randerso Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author randerso
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class RsyncGridsToCWFRequest extends AbstractGfeRequest {
|
||||
|
||||
}
|
|
@ -22,6 +22,12 @@
|
|||
<Method model="HPCWWD" name="Alias">
|
||||
<Field abbreviation="TOTSN6hr" />
|
||||
</Method>
|
||||
<Method dtime="true" name="LinTrans" models="GFS215 GFS217 GFS20-PAC GFS20-PRICO">
|
||||
<Field abbreviation="TP6hr" timeShift="0" />
|
||||
<Field abbreviation="snoRatOv2" timeShift="0" />
|
||||
<Field abbreviation="TP6hr" timeShift="0" />
|
||||
<Field abbreviation="snoRatOv2" timeShift="-21600" />
|
||||
</Method>
|
||||
<Method dtime="true" name="Add">
|
||||
<Field abbreviation="SA3hr" timeShift="0" />
|
||||
<Field abbreviation="SA3hr" timeShift="-10800" />
|
||||
|
|
|
@ -19,6 +19,9 @@
|
|||
further_licensing_information.
|
||||
-->
|
||||
<DerivedParameter unit="mm" name="Model Run Snow via Thickness" abbreviation="SAmodel" internal="true">
|
||||
<Method name="ModelRun" models="GFS215 GFS217 GFS20-PAC GFS20-PRICO">
|
||||
<Field abbreviation="SAcc"/>
|
||||
</Method>
|
||||
<Method name="ModelRun">
|
||||
<Field abbreviation="SA1hr"/>
|
||||
</Method>
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
##### Evan Bookbinder 3-30-2015 Fixed wording for Independent Cities not in VA
|
||||
##### Fixed dupCounties.vm not working due a variable switch in HeadlineLocList and ZoneHeadlineLocList
|
||||
##### Evan Bookbinder 3-23/24-2015 Changes for mixed case (including new capitalize function)
|
||||
##### D. Friedman 08-11-2015 ASM #17841. Handle possibly duplicate second time zone time.
|
||||
####################################################################################################
|
||||
#*
|
||||
Mile Marker Test Code
|
||||
|
@ -249,11 +250,9 @@ ${currTime}##
|
|||
########END MACRO
|
||||
|
||||
#macro(until $endTime $timeFormat $secondtimezone $watch)
|
||||
until ${dateUtil.formatUseNoonMidnight(${endTime}, ${timeFormat.clock}, 15, ${localtimezone})}##
|
||||
#if(${secondtimezone})
|
||||
/${dateUtil.formatUseNoonMidnight(${watch.getEndTime()}, ${timeFormat.clock}, 15, ${secondtimezone})}/##
|
||||
#end
|
||||
for ##
|
||||
#set($time1 = ${dateUtil.formatUseNoonMidnight(${endTime}, ${timeFormat.clock}, 15, ${localtimezone})})
|
||||
#set($time2 = ${dateUtil.formatUseNoonMidnight(${watch.getEndTime()}, ${timeFormat.clock}, 15, ${secondtimezone})})
|
||||
until #formatTwoTimes($time1, $time2) for ##
|
||||
#end
|
||||
|
||||
#macro(insertsvrwatches $watches $list $secondtimezone $dateUtil $timeFormat)
|
||||
|
@ -1248,17 +1247,16 @@ ${partOfArea}${area.name}...
|
|||
######### MACRO TO GENERATE SECOND BULLET (* Until XXXX AMPM TZ [DAY]) IN WARNINGS ##########
|
||||
#macro(secondBullet $dateUtil $expire $timeFormat $localtimezone $secondtimezone $duration)
|
||||
#if(${duration} >= 360)
|
||||
Until ${dateUtil.formatUseNoonMidnight(${expire}, ${timeFormat.plain}, 15, ${localtimezone})}##
|
||||
#set($time1 = ${dateUtil.formatUseNoonMidnight(${expire}, ${timeFormat.plain}, 15, ${localtimezone})})
|
||||
#else
|
||||
Until ${dateUtil.formatUseNoonMidnight(${expire}, ${timeFormat.clock}, 15, ${localtimezone})}##
|
||||
#set($time1 = ${dateUtil.formatUseNoonMidnight(${expire}, ${timeFormat.clock}, 15, ${localtimezone})})
|
||||
#end
|
||||
#if(${secondtimezone})
|
||||
#if(${duration} >= 360)
|
||||
/${dateUtil.formatUseNoonMidnight(${expire}, ${timeFormat.plain}, 15, ${secondtimezone})}/##
|
||||
#set($time2 = ${dateUtil.formatUseNoonMidnight(${expire}, ${timeFormat.plain}, 15, ${secondtimezone})})
|
||||
#else
|
||||
/${dateUtil.formatUseNoonMidnight(${expire}, ${timeFormat.clock}, 15, ${secondtimezone})}/##
|
||||
#end
|
||||
#set($time2 = ${dateUtil.formatUseNoonMidnight(${expire}, ${timeFormat.clock}, 15, ${secondtimezone})})
|
||||
#end
|
||||
Until #formatTwoTimes($time1, $time2)##
|
||||
#end
|
||||
########END MACRO
|
||||
|
||||
|
@ -1297,10 +1295,9 @@ Until ${dateUtil.formatUseNoonMidnight(${expire}, ${timeFormat.clock}, 15, ${loc
|
|||
####overload eventTime with global corEventTime variable
|
||||
###set($time = ${corEventTime})
|
||||
###end
|
||||
At ${dateUtil.format(${time}, ${timeFormat.clock}, ${localtimezone})}##
|
||||
#if(${secondtimezone})
|
||||
/${dateUtil.format(${time}, ${timeFormat.clock}, ${secondtimezone})}/##
|
||||
#end
|
||||
#set($time1=${dateUtil.format(${time}, ${timeFormat.clock}, ${localtimezone})})
|
||||
#set($time2=${dateUtil.format(${time}, ${timeFormat.clock}, ${secondtimezone})})
|
||||
At #formatTwoTimes($time1 $time2)##
|
||||
#end
|
||||
########END MACRO
|
||||
|
||||
|
@ -1629,3 +1626,12 @@ ${location}.
|
|||
#end
|
||||
#end
|
||||
#end
|
||||
|
||||
## formatTwoTimes - If one non-null string is given, output that string. If
|
||||
## two distinct non-null strings are given, output time1/time2/.
|
||||
#macro(formatTwoTimes $time1 $time2)
|
||||
${time1}##
|
||||
#if($time2 && $time1 != $time2)
|
||||
/${time2}/##
|
||||
#end
|
||||
#end
|
||||
|
|
|
@ -142,7 +142,7 @@ public class FaxSender {
|
|||
faxWriter.write("\n");
|
||||
faxWriter.close();
|
||||
StringBuilder faxDataCommand = new StringBuilder();
|
||||
faxDataCommand.append("scp ");
|
||||
faxDataCommand.append("scp -q ");
|
||||
faxDataCommand.append(faxDataFilename);
|
||||
faxDataCommand.append(" ldad@ls1:");
|
||||
faxDataCommand.append(ldadDataFilename);
|
||||
|
@ -157,7 +157,7 @@ public class FaxSender {
|
|||
return retval;
|
||||
}
|
||||
StringBuilder ldadDataCommand = new StringBuilder();
|
||||
ldadDataCommand.append("scp ");
|
||||
ldadDataCommand.append("scp -q ");
|
||||
ldadDataCommand.append(faxScriptFilename);
|
||||
ldadDataCommand.append(" ldad@ls1:");
|
||||
ldadDataCommand.append(ldadScriptFilename);
|
||||
|
@ -177,12 +177,12 @@ public class FaxSender {
|
|||
* DR4550 - the sshCommand should be: ssh -n ls1 -l ldad
|
||||
* $LDAD_EXTERNAL_HOME/bin/faxSender.csh filename
|
||||
*/
|
||||
sshCommand.append("ssh -q -n ls1 -l ldad ");
|
||||
String ldadHome = manager.getenv(LDAD_EXTERNAL_HOME);
|
||||
if (ldadHome == null) {
|
||||
retval = String.format(ENV_ERROR_FMT, LDAD_EXTERNAL_HOME);
|
||||
return retval;
|
||||
}
|
||||
sshCommand.append("ssh -n ls1 -l ldad ");
|
||||
sshCommand.append(ldadHome);
|
||||
sshCommand.append("/bin/faxSender.csh ");
|
||||
sshCommand.append(ldadScriptFilename);
|
||||
|
|
|
@ -1,6 +1,26 @@
|
|||
#!/bin/sh
|
||||
################################################################################
|
||||
#
|
||||
##
|
||||
# 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.
|
||||
##
|
||||
##############################################################################
|
||||
# Program name: rsyncGridsToCWF_client.sh
|
||||
#
|
||||
# Executes rsynceGridsToCWF.sh locally or remotely as needed
|
||||
|
@ -11,15 +31,29 @@
|
|||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- -------------------------------
|
||||
# 04/25/2012 jdynina Created Script
|
||||
# 01/13/2015 #4013 randerso Changed to work on any EDEX
|
||||
# cluster server
|
||||
# 07/15/2015 #4013 randerso Changed to use a thrift request that can
|
||||
# be handled on any EDEX cluster server to
|
||||
# run rsyncGridsToCWF.sh
|
||||
#
|
||||
################################################################################
|
||||
if [ $# -lt 1 ] ;then
|
||||
echo Invalid number of arguments.
|
||||
echo Script stopped.
|
||||
echo ./rsyncGridsToCWF_client.sh wfo
|
||||
exit
|
||||
fi
|
||||
|
||||
# ssh to ec which will actually go to one of the servers in the EDEX cluster
|
||||
ssh ec "/awips2/GFESuite/bin/rsyncGridsToCWF.sh ${1}"
|
||||
# this allows you to run this script from outside of ./bin
|
||||
path_to_script=`readlink -f $0`
|
||||
RUN_FROM_DIR=`dirname $path_to_script`
|
||||
|
||||
BASE_AWIPS_DIR=`dirname $RUN_FROM_DIR`
|
||||
|
||||
# get the base environment
|
||||
source ${RUN_FROM_DIR}/setup.env
|
||||
|
||||
# setup the environment needed to run the the Python
|
||||
export LD_LIBRARY_PATH=${BASE_AWIPS_DIR}/src/lib:${PYTHON_INSTALL}/lib
|
||||
export PYTHONPATH=${RUN_FROM_DIR}/src:$PYTHONPATH
|
||||
|
||||
# execute the rsyncGridsToCWF Python module
|
||||
_PYTHON="${PYTHON_INSTALL}/bin/python"
|
||||
_MODULE="${RUN_FROM_DIR}/src/rsyncGridsToCWF/rsyncGridsToCWF.py"
|
||||
|
||||
# quoting of '$@' is used to prevent command line interpretation
|
||||
$_PYTHON $_MODULE "$@"
|
||||
|
||||
|
|
|
@ -0,0 +1,85 @@
|
|||
##
|
||||
# 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.
|
||||
##
|
||||
#
|
||||
# Revisions:
|
||||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- -------------------------------
|
||||
# 07/15/2015 #4013 randerso Initial creation
|
||||
#
|
||||
##
|
||||
|
||||
from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.gfe.request import RsyncGridsToCWFRequest
|
||||
from dynamicserialize.dstypes.com.raytheon.uf.common.message import WsId
|
||||
|
||||
from ufpy import ThriftClient
|
||||
from ufpy import UsageArgumentParser
|
||||
|
||||
import os
|
||||
|
||||
def main():
|
||||
args = validateArgs()
|
||||
|
||||
request = createRequest(args.site)
|
||||
thriftClient = ThriftClient.ThriftClient(args.host, args.port, "/services")
|
||||
|
||||
try:
|
||||
thriftClient.sendRequest(request)
|
||||
except Exception, ex:
|
||||
print "Caught exception submitting RsyncGridsToCWFRequest: ", str(ex)
|
||||
return 1
|
||||
|
||||
def validateArgs():
|
||||
parser = UsageArgumentParser.UsageArgumentParser(conflict_handler="resolve", prog='ifpInit')
|
||||
parser.add_argument("-h", action="store", dest="host",
|
||||
help="ifpServer host name",
|
||||
metavar="hostname")
|
||||
parser.add_argument("-p", action="store", type=int, dest="port",
|
||||
help="rpc port number of ifpServer",
|
||||
metavar="port")
|
||||
parser.add_argument("site", action="store",
|
||||
help="site to rsync grids for",
|
||||
metavar="site")
|
||||
args = parser.parse_args()
|
||||
|
||||
if args.host is None and "CDSHOST" in os.environ:
|
||||
args.host = os.environ["CDSHOST"]
|
||||
|
||||
if args.port is None and "CDSPORT" in os.environ:
|
||||
args.port = int(os.environ["CDSPORT"])
|
||||
|
||||
if args.host is None:
|
||||
args.host = str(os.getenv("DEFAULT_HOST", "localhost"))
|
||||
|
||||
if args.port is None:
|
||||
args.port = int(os.getenv("DEFAULT_PORT", "9581"))
|
||||
return args
|
||||
|
||||
|
||||
def createRequest(site):
|
||||
request = RsyncGridsToCWFRequest(site)
|
||||
|
||||
wsId = WsId(progName="rsyncGridsToCWF")
|
||||
|
||||
request.setWorkstationID(wsId)
|
||||
|
||||
return request
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
|
@ -0,0 +1,37 @@
|
|||
##
|
||||
# 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.
|
||||
##
|
||||
#
|
||||
# SOFTWARE HISTORY
|
||||
#
|
||||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# Jul 15, 2015 #4013 randerso Initial creation (hand generated)
|
||||
#
|
||||
#
|
||||
|
||||
from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.gfe.request import AbstractGfeRequest
|
||||
|
||||
|
||||
class RsyncGridsToCWFRequest(AbstractGfeRequest):
|
||||
|
||||
def __init__(self, siteId=None):
|
||||
super(RsyncGridsToCWFRequest, self).__init__()
|
||||
if siteId is not None:
|
||||
self.siteID = str(siteId)
|
|
@ -17,8 +17,13 @@
|
|||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
||||
# File auto-generated by PythonFileGenerator
|
||||
#
|
||||
# SOFTWARE HISTORY
|
||||
#
|
||||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# Jul 15, 2015 #4013 randerso Added RsyncGridsToCWFRequest
|
||||
#
|
||||
|
||||
__all__ = [
|
||||
'AbstractGfeRequest',
|
||||
|
@ -45,7 +50,8 @@ __all__ = [
|
|||
'ProcessReceivedDigitalDataRequest',
|
||||
'PurgeGfeGridsRequest',
|
||||
'SaveASCIIGridsRequest',
|
||||
'SmartInitRequest'
|
||||
'SmartInitRequest',
|
||||
'RsyncGridsToCWFRequest',
|
||||
]
|
||||
|
||||
from AbstractGfeRequest import AbstractGfeRequest
|
||||
|
@ -73,4 +79,5 @@ from ProcessReceivedDigitalDataRequest import ProcessReceivedDigitalDataRequest
|
|||
from PurgeGfeGridsRequest import PurgeGfeGridsRequest
|
||||
from SaveASCIIGridsRequest import SaveASCIIGridsRequest
|
||||
from SmartInitRequest import SmartInitRequest
|
||||
from RsyncGridsToCWFRequest import RsyncGridsToCWFRequest
|
||||
|
||||
|
|
|
@ -810,7 +810,9 @@ class H5pyDataStore(IDataStore.IDataStore):
|
|||
if outDir is None:
|
||||
os.remove(filepath)
|
||||
os.rename(repackedFullPath, filepath)
|
||||
os.chmod(filepath, stat.S_IWUSR | stat.S_IWGRP | stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)
|
||||
self.__doMakeReadable(filepath)
|
||||
else :
|
||||
self.__doMakeReadable(repackedFullPath)
|
||||
else:
|
||||
# remove failed new file if there was one
|
||||
if os.path.exists(repackedFullPath):
|
||||
|
@ -819,6 +821,7 @@ class H5pyDataStore(IDataStore.IDataStore):
|
|||
# repack failed, but they wanted the data in a different
|
||||
# directory, so just copy the original data without the repack
|
||||
shutil.copy(filepath, repackedFullPath)
|
||||
self.__doMakeReadable(repackedFullPath)
|
||||
t1=time.time()
|
||||
if timeMap.has_key('repack'):
|
||||
timeMap['repack']+=t1-t0
|
||||
|
|
Loading…
Add table
Reference in a new issue