12.6.1-9 baseline
Former-commit-id:32fdf6ed3b
[formerly7c064b6868
] [formerly2c0ff851ca
] [formerly32fdf6ed3b
[formerly7c064b6868
] [formerly2c0ff851ca
] [formerly27afa60345
[formerly2c0ff851ca
[formerly 8f93efb93ec2d244fe599c16b3af5b33784c0232]]]] Former-commit-id:27afa60345
Former-commit-id:e528bb0df2
[formerlydc50bc8443
] [formerly 39c28d347eb5aeecbc48481fe6871268a89c0c2d [formerly4f7bb90bb0
]] Former-commit-id: 38b944b7b39fc0e1e6c5f5e0171cfa20b64068e4 [formerlyd5fa61041b
] Former-commit-id:37f2b6e138
This commit is contained in:
parent
9a598e011f
commit
c74431ba29
400 changed files with 23465 additions and 13403 deletions
|
@ -30,4 +30,6 @@
|
|||
<request> <productCode>34</productCode> <pdw20>16</pdw20> </request>
|
||||
<request> <productCode>34</productCode> <pdw20>32</pdw20> </request>
|
||||
</cronOTR>
|
||||
<cronOTR cron="0 0 * * * ?" productCode="173" randomWait="600" hoursBack="3" wmo="SDUS8" nnn="DU3"/>
|
||||
<cronOTR cron="0 0 12 * * ?" productCode="173" randomWait="600" hoursBack="24" wmo="SDUS8" nnn="DU6"/>
|
||||
</cronOTRConfiguration>
|
File diff suppressed because it is too large
Load diff
|
@ -485,18 +485,16 @@ class Procedure (SmartScript.SmartScript):
|
|||
#
|
||||
# get History of last time this grid was modified
|
||||
#
|
||||
username = ""
|
||||
updtime = None
|
||||
historyList=self.getGridHistory(dbid,parm,"SFC",gridTR)
|
||||
for hists in historyList:
|
||||
for hist in hists:
|
||||
if hist[4] not in [None, "None"]:
|
||||
username=hist[4].split(':')[1]
|
||||
else:
|
||||
username=""
|
||||
|
||||
if hist[5] is not None:
|
||||
updtime=hist[5].unixTime()
|
||||
else:
|
||||
updtime = None
|
||||
|
||||
if self.VU.getDebug()>=1:
|
||||
t2=self.gstring1(time.gmtime(updtime))
|
||||
|
@ -830,6 +828,7 @@ class Procedure (SmartScript.SmartScript):
|
|||
# different values from getComposite after IFPS16.
|
||||
#
|
||||
def getBetterComposite(self,parmName, timeRange):
|
||||
from com.raytheon.uf.common.dataplugin.gfe.db.objects import GFERecord_GridType as GridType
|
||||
#
|
||||
# Get the type, rateParm flag, and limits
|
||||
# for the parameter name passed in.
|
||||
|
@ -864,7 +863,7 @@ class Procedure (SmartScript.SmartScript):
|
|||
sum=self._empty+150.0
|
||||
else:
|
||||
sum=self._empty
|
||||
if (wxType==1):
|
||||
if GridType.VECTOR.equals(wxType):
|
||||
sumv=self._empty
|
||||
cnt = zeros_like(self._empty)
|
||||
all = ones_like(self._empty)
|
||||
|
@ -880,7 +879,7 @@ class Procedure (SmartScript.SmartScript):
|
|||
#
|
||||
# Add to sums, or min/max
|
||||
#
|
||||
if wxType==0: # SCALAR
|
||||
if GridType.SCALAR.equals(wxType): # SCALAR
|
||||
bits,isc=comp
|
||||
#isc=self.getGrids("ISC",parmName,"SFC",tr)
|
||||
#
|
||||
|
@ -904,14 +903,14 @@ class Procedure (SmartScript.SmartScript):
|
|||
else:
|
||||
sum=where(bits,sum+isc,sum)
|
||||
cnt[bits] += 1
|
||||
if wxType==1: # VECTOR
|
||||
if GridType.VECTOR.equals(wxType): # VECTOR
|
||||
bits,mag,direc=comp
|
||||
#(mag,dir)=self.getGrids("ISC",parmName,"SFC",tr)
|
||||
(u,v)=self.MagDirToUV(mag,direc)
|
||||
sum=where(bits,sum+u,sum)
|
||||
sumv=where(bits,sumv+v,sumv)
|
||||
cnt[bits] += 1
|
||||
if wxType==2: # WEATHER
|
||||
if GridType.WEATHER.equals(wxType): # WEATHER
|
||||
bits,keys,strings=comp
|
||||
#(keys,strings)=self.getGrids("ISC",parmName,"SFC",tr)
|
||||
#
|
||||
|
@ -920,9 +919,9 @@ class Procedure (SmartScript.SmartScript):
|
|||
#
|
||||
noISC=less(cnt,0.5)
|
||||
bits=greater(cnt,0.5)
|
||||
if ((wxType==0)or(wxType==1)):
|
||||
if GridType.SCALAR.equals(wxType) or GridType.VECTOR.equals(wxType):
|
||||
cnt[less(cnt,1)] = 1
|
||||
if (wxType==1):
|
||||
if GridType.VECTOR.equals(wxType):
|
||||
sum=where(noISC,minlimit,sum/cnt)
|
||||
sumv=where(noISC,minlimit,sumv/cnt)
|
||||
(mag,direc)=self.UVToMagDir(sum,sumv)
|
||||
|
|
|
@ -97,8 +97,8 @@ class Procedure (SmartScript.SmartScript):
|
|||
|
||||
trList = []
|
||||
for g in gridInfo:
|
||||
start = g.gridTime().startTime().unixTime()
|
||||
end = g.gridTime().endTime().unixTime()
|
||||
start = g.gridTime().startTime().unixTime() * 1000
|
||||
end = g.gridTime().endTime().unixTime() * 1000
|
||||
tr = TimeRange.TimeRange(start,end)
|
||||
if tr.overlaps(timeRange):
|
||||
trList.append(tr)
|
||||
|
@ -243,7 +243,8 @@ class Procedure (SmartScript.SmartScript):
|
|||
modelTR_cum = self.getModelTimeRange(modelID, "prob34", weNames)
|
||||
weNames = ["pwsD34", "pwsD64", "pwsN34", "pwsN64"]
|
||||
modelTR_inc = self.getModelTimeRange(modelID, "pws34", weNames)
|
||||
|
||||
if modelTR_cum is None or len(modelTR_cum) < 3:
|
||||
return
|
||||
timeRange = modelTR_cum[0]
|
||||
minTime = modelTR_cum[1]
|
||||
maxTime = modelTR_cum[2]
|
||||
|
|
|
@ -4367,13 +4367,13 @@ class BOIVerifyUtility(SmartScript.SmartScript):
|
|||
recmatch=logical_and(recbase,recfit)
|
||||
recnumbers=compress(recmatch,self.fncRecs)
|
||||
recList=list(recnumbers)
|
||||
recList.sort(lambda x,y: cmp(self.fncStime[x],self.fncStime[y]))
|
||||
recList.sort(lambda x,y: cmp(self.fncStime[int(x)],self.fncStime[int(y)]))
|
||||
else:
|
||||
recmatch=logical_and(greater(self.oncEtime,stime),
|
||||
less(self.oncStime,etime))
|
||||
recnumbers=compress(recmatch,self.oncRecs)
|
||||
recList=list(recnumbers)
|
||||
recList.sort(lambda x,y: cmp(self.oncStime[x],self.oncStime[y]))
|
||||
recList.sort(lambda x,y: cmp(self.oncStime[int(x)],self.oncStime[int(y)]))
|
||||
self.logMsg("number of intersecting grids:%d"%len(recList),10)
|
||||
if len(recList)<1:
|
||||
return retVal
|
||||
|
|
|
@ -54,10 +54,9 @@ class ProcessVariableList:
|
|||
## The following arguments are no longer used but remain part of the signature for compatibility reasons
|
||||
## * parent - not needed
|
||||
## * modal - similar functionality is achieved by setting or not setting a callback
|
||||
## * dbSubsystem - not needed, see TODO
|
||||
## * dataMgr - required for model and D2D_model widgets
|
||||
## * cmdLineVarDict - not needed, see TODO
|
||||
##
|
||||
## TODO evaluate cmdLineVarDict and determine if it is really not needed
|
||||
## TODO dbSubsytem may be needed when implementing the model and D2D_model widgets
|
||||
##
|
||||
## @param title: str() of the title of the dialog that will appear
|
||||
|
@ -68,7 +67,7 @@ class ProcessVariableList:
|
|||
## @param argList: list() of arguments to pass to the callback function
|
||||
##
|
||||
def __init__(self, title, varList, varDict=None, parent=None,
|
||||
dbSubsystem=None, modal=1, runCB=None, argList=[],
|
||||
dataMgr=None, modal=1, runCB=None, argList=[],
|
||||
cmdLineVarDict=None):
|
||||
|
||||
self.__varDict = varDict
|
||||
|
@ -80,7 +79,7 @@ class ProcessVariableList:
|
|||
widgetList = buildWidgetList(varList)
|
||||
|
||||
# Construct the dialog
|
||||
self.__dialog = ValuesDialog.openDialog(title, widgetList)
|
||||
self.__dialog = ValuesDialog.openDialog(title, widgetList, dataMgr)
|
||||
#self.__dialog = ValuesDialog(title,widgetList)
|
||||
|
||||
# since ValuesDialog blocks on open() we can set status and varDict here
|
||||
|
|
|
@ -1838,12 +1838,8 @@ class SmartScript(BaseTool.BaseTool):
|
|||
# @rtype: list of strings
|
||||
def getDiscreteKeys(self, elementName):
|
||||
parm = self.getParm("Fcst", elementName, "SFC")
|
||||
keyList = []
|
||||
inventory = parm.getGridInventory()
|
||||
for gridData in inventory:
|
||||
slice = gridData.getGridSlice()
|
||||
for discreteKey in slice.getKey():
|
||||
keyList.append(discreteKey.toString())
|
||||
keyList = parm.getGridInfo().getDiscreteKeys()
|
||||
keyList = JUtil.javaStringListToPylist(keyList)
|
||||
return keyList
|
||||
|
||||
#########################################################################
|
||||
|
|
|
@ -107,7 +107,7 @@
|
|||
<contribute xsi:type="bundleItem" file="bundles/UpperAirRaob.xml"
|
||||
menuText="New Orleans, LA (KLIX)" id="raobNewOrleans_LA"
|
||||
editorType="gov.noaa.nws.ncep.ui.nsharp.skewt.NsharpSkewTEditor">
|
||||
<substitute key="stationId" value="72231"/>
|
||||
<substitute key="stationId" value="72233"/>
|
||||
</contribute>
|
||||
<contribute xsi:type="bundleItem" file="bundles/UpperAirRaob.xml"
|
||||
menuText="Wash-Dulles, VA (KIAD)" id="raobWash-Dulles"
|
||||
|
|
|
@ -89,6 +89,11 @@
|
|||
editorType="gov.noaa.nws.ncep.ui.nsharp.skewt.NsharpSkewTEditor">
|
||||
<substitute key="stationId" value="72582"/>
|
||||
</contribute>
|
||||
<contribute xsi:type="bundleItem" file="bundles/UpperAirRaob.xml"
|
||||
menuText="Las Vegas, NV (KVEF)" id="raobLasVegas_NV"
|
||||
editorType="gov.noaa.nws.ncep.ui.nsharp.skewt.NsharpSkewTEditor">
|
||||
<substitute key="stationId" value="72388"/>
|
||||
</contribute>
|
||||
<contribute xsi:type="bundleItem" file="bundles/UpperAirRaob.xml"
|
||||
menuText="Medford, OR (KMFR)" id="raobMedford_OR"
|
||||
editorType="gov.noaa.nws.ncep.ui.nsharp.skewt.NsharpSkewTEditor">
|
||||
|
|
|
@ -25,9 +25,9 @@ import java.io.IOException;
|
|||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.WeakHashMap;
|
||||
|
||||
import org.eclipse.core.runtime.FileLocator;
|
||||
import org.eclipse.core.runtime.IConfigurationElement;
|
||||
|
@ -48,7 +48,6 @@ import com.raytheon.uf.common.util.FileUtil;
|
|||
import com.raytheon.uf.viz.core.Activator;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.localization.LocalizationManager;
|
||||
import com.raytheon.uf.viz.core.status.StatusConstants;
|
||||
|
||||
/**
|
||||
* Creates uEngine scripts on the fly.
|
||||
|
@ -75,7 +74,8 @@ import com.raytheon.uf.viz.core.status.StatusConstants;
|
|||
* @version 1
|
||||
*/
|
||||
public class ScriptCreator {
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus.getHandler(ScriptCreator.class);
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(ScriptCreator.class);
|
||||
|
||||
private static final String DEFAULT_SCRIPT_LIBRARY = "BaseRequest";
|
||||
|
||||
|
@ -99,10 +99,10 @@ public class ScriptCreator {
|
|||
new Path("scriptTemplates/standardTemplate.vm"),
|
||||
null)).getPath());
|
||||
} catch (IOException e) {
|
||||
statusHandler.handle(
|
||||
Priority.CRITICAL,
|
||||
"Unable to load the standard script template. Requesting products will not work until this is fixed.",
|
||||
e);
|
||||
statusHandler
|
||||
.handle(Priority.CRITICAL,
|
||||
"Unable to load the standard script template. Requesting products will not work until this is fixed.",
|
||||
e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -148,7 +148,7 @@ public class ScriptCreator {
|
|||
return;
|
||||
}
|
||||
|
||||
pluginToLibraryMap = new WeakHashMap<String, ScriptProperties>();
|
||||
pluginToLibraryMap = new HashMap<String, ScriptProperties>();
|
||||
IExtensionRegistry registry = Platform.getExtensionRegistry();
|
||||
|
||||
IExtensionPoint point = registry.getExtensionPoint(RESOURCE_EXTENSION);
|
||||
|
|
|
@ -938,7 +938,7 @@ public class ColorMapParameters implements Cloneable, ISerializableObject {
|
|||
index = 1.0f;
|
||||
}
|
||||
return colorToRGB(colorMap.getColors().get(
|
||||
(int) (index * colorMap.getSize())));
|
||||
(int) (index * (colorMap.getSize()-1))));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -954,7 +954,7 @@ public class ColorMapParameters implements Cloneable, ISerializableObject {
|
|||
} else if (index > 1.0f) {
|
||||
index = 1.0f;
|
||||
}
|
||||
return colorMap.getColors().get((int) (index * colorMap.getSize()));
|
||||
return colorMap.getColors().get((int) (index * (colorMap.getSize()-1)));
|
||||
}
|
||||
|
||||
public static RGB colorToRGB(Color c) {
|
||||
|
|
|
@ -19,6 +19,9 @@
|
|||
**/
|
||||
package com.raytheon.uf.viz.core.rsc.capabilities;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlAttribute;
|
||||
|
@ -46,6 +49,8 @@ public class DisplayTypeCapability extends AbstractCapability {
|
|||
@XmlAttribute
|
||||
private DisplayType displayType = DisplayType.CONTOUR;
|
||||
|
||||
private transient List<DisplayType> alternativeDisplayTypes;
|
||||
|
||||
public DisplayType getDisplayType() {
|
||||
return displayType;
|
||||
}
|
||||
|
@ -54,6 +59,18 @@ public class DisplayTypeCapability extends AbstractCapability {
|
|||
this.displayType = displayType;
|
||||
}
|
||||
|
||||
public List<DisplayType> getAlternativeDisplayTypes() {
|
||||
if (alternativeDisplayTypes == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return alternativeDisplayTypes;
|
||||
}
|
||||
|
||||
public void setAlternativeDisplayTypes(
|
||||
List<DisplayType> alternativeDisplayTypes) {
|
||||
this.alternativeDisplayTypes = alternativeDisplayTypes;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
|
|
|
@ -41,7 +41,7 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Sep 24, 2007 njensen Initial creation
|
||||
*
|
||||
* May 21, 2012 DR 14833 gzhang Adding a getter for StyleRuleset
|
||||
* </pre>
|
||||
*
|
||||
* @author njensen
|
||||
|
@ -149,5 +149,24 @@ public class StyleManager {
|
|||
return new double[] { vmin, vmax };
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**2012-05-21
|
||||
* DR 14833: FFMP uses this getter to find the color
|
||||
* map if a user modified ffmpImageryStlyeRules.xml
|
||||
* incorrectly.
|
||||
*
|
||||
* @param st: StyleType
|
||||
* @return: StyleRuleset related to the StyleType
|
||||
*/
|
||||
public StyleRuleset getStyleRuleSet(StyleType st){
|
||||
|
||||
synchronized(st){
|
||||
|
||||
if( ! rules.containsKey(st)){
|
||||
loadRules(st);
|
||||
}
|
||||
}
|
||||
|
||||
return rules.get(st);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,4 +35,17 @@
|
|||
scriptLibrary="BaseRequest">
|
||||
</scriptTemplate>
|
||||
</extension>
|
||||
|
||||
<!-- for making CWAT available on Localization Perspective in CAVE: 2012-05-14 from DHladky -->
|
||||
|
||||
<extension
|
||||
point="com.raytheon.uf.viz.localization.localizationpath">
|
||||
<path
|
||||
application="D2D"
|
||||
localizationType="common_static"
|
||||
name="CWAT"
|
||||
recursive="true"
|
||||
value="cwat">
|
||||
</path>
|
||||
</extension>
|
||||
</plugin>
|
||||
|
|
|
@ -140,7 +140,6 @@ public class D2DSamplingResource extends SamplingResource implements
|
|||
inspectForced = false;
|
||||
setSampling(false);
|
||||
issueRefresh();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -102,7 +102,18 @@ public class D2DNSharpDescriptor extends NsharpSkewTDescriptor {
|
|||
IDescriptor.FrameChangeMode dmode = IDescriptor.FrameChangeMode
|
||||
.valueOf(mode.name());
|
||||
// Just hand this off to the resource.
|
||||
getSkewtResource().setSteppingTimeLine(dop, dmode);
|
||||
switch (dmode) {
|
||||
case TIME_ONLY:
|
||||
getSkewtResource().setSteppingTimeLine(dop, dmode /*ignored*/);
|
||||
break;
|
||||
case SPACE_ONLY:
|
||||
// noop for now
|
||||
break;
|
||||
case TIME_AND_SPACE:
|
||||
// same as TIME_ONLY for now
|
||||
getSkewtResource().setSteppingTimeLine(dop, dmode /*ignored*/);
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
@ -152,10 +152,25 @@ public class D2DNSharpResource extends
|
|||
skewRsc.addRsc(myDataMap, stnInfo);
|
||||
// Adding to nsharp changes the frame but in D2D we like to keep the
|
||||
// current frame.
|
||||
while (picked != null
|
||||
backToPicked : while (picked != null
|
||||
&& !skewRsc.getPickedStnInfoStr().equals(picked)) {
|
||||
skewRsc.setSteppingTimeLine(FrameChangeOperation.NEXT,
|
||||
FrameChangeMode.TIME_AND_SPACE);
|
||||
String initStn = skewRsc.getPickedStnInfoStr().substring(0, 4);
|
||||
do { // for each station...
|
||||
String initTimePickedStnInfoStr = skewRsc.getPickedStnInfoStr();
|
||||
do { // ...for each time
|
||||
skewRsc.setSteppingTimeLine(FrameChangeOperation.NEXT, FrameChangeMode.TIME_ONLY);
|
||||
// see if we're back home; if so, success
|
||||
if (skewRsc.getPickedStnInfoStr().equals(picked)) {
|
||||
break backToPicked;
|
||||
}
|
||||
// if we've cycled through all times for this station...
|
||||
} while (!skewRsc.getPickedStnInfoStr().equals(initTimePickedStnInfoStr));
|
||||
// ...then go to the next station
|
||||
skewRsc.setSteppingStnIdList(FrameChangeOperation.NEXT);
|
||||
// if we've cycled through all stations without a station/time match...
|
||||
} while (!skewRsc.getPickedStnInfoStr().substring(0, 4).equals(initStn));
|
||||
// ...then something is wrong
|
||||
//TODO: consider logging internal error here? -- original "picked" station/time not found
|
||||
}
|
||||
issueRefresh();
|
||||
}
|
||||
|
|
|
@ -178,8 +178,8 @@ public abstract class D2DNSharpResourceData extends
|
|||
stnInfo.setRangestarttime(fcstTime);
|
||||
}
|
||||
if (coordinate != null) {
|
||||
stnInfo.setLongitude((float) coordinate.x);
|
||||
stnInfo.setLatitude((float) coordinate.y);
|
||||
stnInfo.setLongitude(coordinate.x);
|
||||
stnInfo.setLatitude(coordinate.y);
|
||||
}
|
||||
if (pointName != null) {
|
||||
stnInfo.setStnDisplayInfo(pointName + " "
|
||||
|
|
|
@ -108,6 +108,7 @@
|
|||
<styleRule>
|
||||
<paramLevelMatches>
|
||||
<parameter>Wind</parameter>
|
||||
<parameter>Gust</parameter>
|
||||
</paramLevelMatches>
|
||||
<arrowStyle>
|
||||
<displayUnits>kts</displayUnits>
|
||||
|
|
|
@ -32,6 +32,7 @@ import javax.measure.unit.Unit;
|
|||
|
||||
import org.geotools.coverage.grid.GridGeometry2D;
|
||||
import org.geotools.geometry.DirectPosition2D;
|
||||
import org.opengis.referencing.crs.CoordinateReferenceSystem;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
||||
import com.raytheon.uf.common.dataplugin.grib.GribModel;
|
||||
|
@ -87,6 +88,8 @@ public class GribCSAdapter extends AbstractCrossSectionAdapter<GribRecord> {
|
|||
|
||||
private Unit<?> unit;
|
||||
|
||||
private CoordinateReferenceSystem crs;
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
|
@ -250,21 +253,6 @@ public class GribCSAdapter extends AbstractCrossSectionAdapter<GribRecord> {
|
|||
if (xVal <= -9999) {
|
||||
continue;
|
||||
}
|
||||
// these cases handle rotating a vector to be oriented
|
||||
// towards the north pole rather than the up direction of a
|
||||
// grid.
|
||||
if (c == 0) {
|
||||
speed = xVal;
|
||||
} else if (c == 1) {
|
||||
direction = xVal - 180
|
||||
+ MapUtil.rotation(coordinates[i], area);
|
||||
xVal = (float) direction;
|
||||
direction = Math.toRadians(direction);
|
||||
} else if (c == 2) {
|
||||
xVal = (float) (-speed * Math.sin(direction));
|
||||
} else if (c == 3) {
|
||||
xVal = (float) (-speed * Math.cos(direction));
|
||||
}
|
||||
dataLists.get(c).add(new XYData(xVal, yVal));
|
||||
}
|
||||
}
|
||||
|
@ -292,6 +280,7 @@ public class GribCSAdapter extends AbstractCrossSectionAdapter<GribRecord> {
|
|||
super.addRecord(pdo);
|
||||
if (pdo != null && pdo instanceof GribRecord) {
|
||||
unit = ((GribRecord) pdo).getModelInfo().getParameterUnitObject();
|
||||
crs = ((GribRecord) pdo).getSpatialObject().getCrs();
|
||||
}
|
||||
yRecords.remove(pdo.getDataTime());
|
||||
}
|
||||
|
@ -355,4 +344,12 @@ public class GribCSAdapter extends AbstractCrossSectionAdapter<GribRecord> {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public CoordinateReferenceSystem getDataCoordinateReferenceSystem() {
|
||||
if (crs == null) {
|
||||
return super.getDataCoordinateReferenceSystem();
|
||||
}
|
||||
return crs;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,27 +1,27 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<DerivedParameter unit="kn" name="Wind Gust" abbreviation="Gust" xmlns:ns2="group">
|
||||
<DerivedParameter unit="m/s" name="Wind Gust" abbreviation="Gust" xmlns:ns2="group">
|
||||
<Method name="Vector" levels="Surface" models="obs">
|
||||
<Field level="Station" abbreviation="windGust"/>
|
||||
<Field abbreviation="WD"/>
|
||||
<ConstantField value="1.0"/>
|
||||
</Method>
|
||||
<Method name="Vector">
|
||||
<Field abbreviation="uGust"/>
|
||||
<Field abbreviation="vGust"/>
|
||||
<Field abbreviation="uGust" unit="m/s"/>
|
||||
<Field abbreviation="vGust" unit="m/s"/>
|
||||
</Method>
|
||||
<Method name="Vector">
|
||||
<Field abbreviation="WGS"/>
|
||||
<Field abbreviation="WGS" unit="m/s"/>
|
||||
<Field abbreviation="WGD"/>
|
||||
<ConstantField value="1.0"/>
|
||||
</Method>
|
||||
<Method name="Vector">
|
||||
<Field abbreviation="WGS"/>
|
||||
<Field abbreviation="WGS" unit="m/s"/>
|
||||
<Field abbreviation="WD"/>
|
||||
<ConstantField value="1.0"/>
|
||||
</Method>
|
||||
<Method name="Vector">
|
||||
<Field abbreviation="uW"/>
|
||||
<Field abbreviation="vW"/>
|
||||
<Field abbreviation="WGS"/>
|
||||
<Field abbreviation="WGS" unit="m/s"/>
|
||||
</Method>
|
||||
</DerivedParameter>
|
||||
|
|
|
@ -18,4 +18,8 @@
|
|||
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
|
||||
further_licensing_information.
|
||||
-->
|
||||
<DerivedParameter abbreviation="TPCSG" name="Probabilistic Storm Surge height w/10% chance of being exceeded" unit="ft"/>
|
||||
<DerivedParameter abbreviation="TPCSG" name="Probabilistic Storm Surge height w/10% chance of being exceeded" unit="ft">
|
||||
<Method models="TPCSurgeProb" name="Alias">
|
||||
<Field abbreviation="Surge10Pct"/>
|
||||
</Method>
|
||||
</DerivedParameter>
|
|
@ -18,7 +18,7 @@
|
|||
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
|
||||
further_licensing_information.
|
||||
-->
|
||||
<DerivedParameter abbreviation="TPCSG_518E2" name="Probabilistic Storm Surge probability > 17 feet" unit="%">
|
||||
<DerivedParameter abbreviation="TPCSG-518E2" name="Probabilistic Storm Surge probability > 17 feet" unit="%">
|
||||
<Method models="TPCSurgeProb" name="Alias">
|
||||
<Field abbreviation="PSurge17Ft"/>
|
||||
</Method>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
|
||||
further_licensing_information.
|
||||
-->
|
||||
<DerivedParameter abbreviation="TPCSG_549E2" name="Probabilistic Storm Surge probability > 18 feet" unit="%">
|
||||
<DerivedParameter abbreviation="TPCSG-549E2" name="Probabilistic Storm Surge probability > 18 feet" unit="%">
|
||||
<Method models="TPCSurgeProb" name="Alias">
|
||||
<Field abbreviation="PSurge18Ft"/>
|
||||
</Method>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
|
||||
further_licensing_information.
|
||||
-->
|
||||
<DerivedParameter abbreviation="TPCSG_579E2" name="Probabilistic Storm Surge probability > 19 feet" unit="%">
|
||||
<DerivedParameter abbreviation="TPCSG-579E2" name="Probabilistic Storm Surge probability > 19 feet" unit="%">
|
||||
<Method models="TPCSurgeProb" name="Alias">
|
||||
<Field abbreviation="PSurge19Ft"/>
|
||||
</Method>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
|
||||
further_licensing_information.
|
||||
-->
|
||||
<DerivedParameter abbreviation="TPCSG_122E2" name="Probabilistic Storm Surge probability > 4 feet" unit="%">
|
||||
<DerivedParameter abbreviation="TPCSG-122E2" name="Probabilistic Storm Surge probability > 4 feet" unit="%">
|
||||
<Method models="TPCSurgeProb" name="Alias">
|
||||
<Field abbreviation="PSurge4Ft"/>
|
||||
</Method>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
|
||||
further_licensing_information.
|
||||
-->
|
||||
<DerivedParameter abbreviation="TPCSG_152E2" name="Probabilistic Storm Surge probability > 5 feet" unit="%">
|
||||
<DerivedParameter abbreviation="TPCSG-152E2" name="Probabilistic Storm Surge probability > 5 feet" unit="%">
|
||||
<Method models="TPCSurgeProb" name="Alias">
|
||||
<Field abbreviation="PSurge5Ft"/>
|
||||
</Method>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
|
||||
further_licensing_information.
|
||||
-->
|
||||
<DerivedParameter abbreviation="TPCSG_183E2" name="Probabilistic Storm Surge probability > 6 feet" unit="%">
|
||||
<DerivedParameter abbreviation="TPCSG-183E2" name="Probabilistic Storm Surge probability > 6 feet" unit="%">
|
||||
<Method models="TPCSurgeProb" name="Alias">
|
||||
<Field abbreviation="PSurge6Ft"/>
|
||||
</Method>
|
||||
|
|
|
@ -18,4 +18,8 @@
|
|||
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
|
||||
further_licensing_information.
|
||||
-->
|
||||
<DerivedParameter abbreviation="TPCSG_20" name="Probabilistic Storm Surge height w/20% chance of being exceeded" unit="ft"/>
|
||||
<DerivedParameter abbreviation="TPCSG-20" name="Probabilistic Storm Surge height w/20% chance of being exceeded" unit="ft">
|
||||
<Method models="TPCSurgeProb" name="Alias">
|
||||
<Field abbreviation="Surge20Pct"/>
|
||||
</Method>
|
||||
</DerivedParameter>
|
|
@ -18,7 +18,7 @@
|
|||
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
|
||||
further_licensing_information.
|
||||
-->
|
||||
<DerivedParameter abbreviation="TPCSG_213E2" name="Probabilistic Storm Surge probability > 7 feet" unit="%">
|
||||
<DerivedParameter abbreviation="TPCSG-213E2" name="Probabilistic Storm Surge probability > 7 feet" unit="%">
|
||||
<Method models="TPCSurgeProb" name="Alias">
|
||||
<Field abbreviation="PSurge7Ft"/>
|
||||
</Method>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
|
||||
further_licensing_information.
|
||||
-->
|
||||
<DerivedParameter abbreviation="TPCSG_244E2" name="Probabilistic Storm Surge probability > 8 feet" unit="%">
|
||||
<DerivedParameter abbreviation="TPCSG-244E2" name="Probabilistic Storm Surge probability > 8 feet" unit="%">
|
||||
<Method models="TPCSurgeProb" name="Alias">
|
||||
<Field abbreviation="PSurge8Ft"/>
|
||||
</Method>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
|
||||
further_licensing_information.
|
||||
-->
|
||||
<DerivedParameter abbreviation="TPCSG_274E2" name="Probabilistic Storm Surge probability > 9 feet" unit="%">
|
||||
<DerivedParameter abbreviation="TPCSG-274E2" name="Probabilistic Storm Surge probability > 9 feet" unit="%">
|
||||
<Method models="TPCSurgeProb" name="Alias">
|
||||
<Field abbreviation="PSurge9Ft"/>
|
||||
</Method>
|
||||
|
|
|
@ -18,4 +18,8 @@
|
|||
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
|
||||
further_licensing_information.
|
||||
-->
|
||||
<DerivedParameter abbreviation="TPCSG_30" name="Probabilistic Storm Surge height w/30% chance of being exceeded" unit="ft"/>
|
||||
<DerivedParameter abbreviation="TPCSG-30" name="Probabilistic Storm Surge height w/30% chance of being exceeded" unit="ft">
|
||||
<Method models="TPCSurgeProb" name="Alias">
|
||||
<Field abbreviation="Surge30Pct"/>
|
||||
</Method>
|
||||
</DerivedParameter>
|
|
@ -18,7 +18,7 @@
|
|||
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
|
||||
further_licensing_information.
|
||||
-->
|
||||
<DerivedParameter abbreviation="TPCSG_305E2" name="Probabilistic Storm Surge probability > 10 feet" unit="%">
|
||||
<DerivedParameter abbreviation="TPCSG-305E2" name="Probabilistic Storm Surge probability > 10 feet" unit="%">
|
||||
<Method models="TPCSurgeProb" name="Alias">
|
||||
<Field abbreviation="PSurge10Ft"/>
|
||||
</Method>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
|
||||
further_licensing_information.
|
||||
-->
|
||||
<DerivedParameter abbreviation="TPCSG_335E2" name="Probabilistic Storm Surge probability > 11 feet" unit="%">
|
||||
<DerivedParameter abbreviation="TPCSG-335E2" name="Probabilistic Storm Surge probability > 11 feet" unit="%">
|
||||
<Method models="TPCSurgeProb" name="Alias">
|
||||
<Field abbreviation="PSurge11Ft"/>
|
||||
</Method>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
|
||||
further_licensing_information.
|
||||
-->
|
||||
<DerivedParameter abbreviation="TPCSG_366E2" name="Probabilistic Storm Surge probability > 12 feet" unit="%">
|
||||
<DerivedParameter abbreviation="TPCSG-366E2" name="Probabilistic Storm Surge probability > 12 feet" unit="%">
|
||||
<Method models="TPCSurgeProb" name="Alias">
|
||||
<Field abbreviation="PSurge12Ft"/>
|
||||
</Method>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
|
||||
further_licensing_information.
|
||||
-->
|
||||
<DerivedParameter abbreviation="TPCSG_396E2" name="Probabilistic Storm Surge probability > 13 feet" unit="%">
|
||||
<DerivedParameter abbreviation="TPCSG-396E2" name="Probabilistic Storm Surge probability > 13 feet" unit="%">
|
||||
<Method models="TPCSurgeProb" name="Alias">
|
||||
<Field abbreviation="PSurge13Ft"/>
|
||||
</Method>
|
||||
|
|
|
@ -18,4 +18,8 @@
|
|||
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
|
||||
further_licensing_information.
|
||||
-->
|
||||
<DerivedParameter abbreviation="TPCSG_40" name="Probabilistic Storm Surge height w/40% chance of being exceeded" unit="ft"/>
|
||||
<DerivedParameter abbreviation="TPCSG-40" name="Probabilistic Storm Surge height w/40% chance of being exceeded" unit="ft">
|
||||
<Method models="TPCSurgeProb" name="Alias">
|
||||
<Field abbreviation="Surge40Pct"/>
|
||||
</Method>
|
||||
</DerivedParameter>
|
|
@ -18,7 +18,7 @@
|
|||
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
|
||||
further_licensing_information.
|
||||
-->
|
||||
<DerivedParameter abbreviation="TPCSG_427E2" name="Probabilistic Storm Surge probability > 14 feet" unit="%">
|
||||
<DerivedParameter abbreviation="TPCSG-427E2" name="Probabilistic Storm Surge probability > 14 feet" unit="%">
|
||||
<Method models="TPCSurgeProb" name="Alias">
|
||||
<Field abbreviation="PSurge14Ft"/>
|
||||
</Method>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
|
||||
further_licensing_information.
|
||||
-->
|
||||
<DerivedParameter abbreviation="TPCSG_457E2" name="Probabilistic Storm Surge probability > 15 feet" unit="%">
|
||||
<DerivedParameter abbreviation="TPCSG-457E2" name="Probabilistic Storm Surge probability > 15 feet" unit="%">
|
||||
<Method models="TPCSurgeProb" name="Alias">
|
||||
<Field abbreviation="PSurge15Ft"/>
|
||||
</Method>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
|
||||
further_licensing_information.
|
||||
-->
|
||||
<DerivedParameter abbreviation="TPCSG_488E2" name="Probabilistic Storm Surge probability > 16 feet" unit="%">
|
||||
<DerivedParameter abbreviation="TPCSG-488E2" name="Probabilistic Storm Surge probability > 16 feet" unit="%">
|
||||
<Method models="TPCSurgeProb" name="Alias">
|
||||
<Field abbreviation="PSurge16Ft"/>
|
||||
</Method>
|
||||
|
|
|
@ -18,4 +18,8 @@
|
|||
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
|
||||
further_licensing_information.
|
||||
-->
|
||||
<DerivedParameter abbreviation="TPCSG_50" name="Probabilistic Storm Surge height w/50% chance of being exceeded" unit="ft"/>
|
||||
<DerivedParameter abbreviation="TPCSG-50" name="Probabilistic Storm Surge height w/50% chance of being exceeded" unit="ft">
|
||||
<Method models="TPCSurgeProb" name="Alias">
|
||||
<Field abbreviation="Surge50Pct"/>
|
||||
</Method>
|
||||
</DerivedParameter>
|
|
@ -18,4 +18,8 @@
|
|||
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
|
||||
further_licensing_information.
|
||||
-->
|
||||
<DerivedParameter abbreviation="TPCSG_60" name="Probabilistic Storm Surge height w/60% chance of being exceeded" unit="ft"/>
|
||||
<DerivedParameter abbreviation="TPCSG-60" name="Probabilistic Storm Surge height w/60% chance of being exceeded" unit="ft">
|
||||
<Method models="TPCSurgeProb" name="Alias">
|
||||
<Field abbreviation="Surge60Pct"/>
|
||||
</Method>
|
||||
</DerivedParameter>
|
|
@ -18,7 +18,7 @@
|
|||
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
|
||||
further_licensing_information.
|
||||
-->
|
||||
<DerivedParameter abbreviation="TPCSG_610E2" name="Probabilistic Storm Surge probability > 20 feet" unit="%">
|
||||
<DerivedParameter abbreviation="TPCSG-610E2" name="Probabilistic Storm Surge probability > 20 feet" unit="%">
|
||||
<Method models="TPCSurgeProb" name="Alias">
|
||||
<Field abbreviation="PSurge20Ft"/>
|
||||
</Method>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
|
||||
further_licensing_information.
|
||||
-->
|
||||
<DerivedParameter abbreviation="TPCSG_61E2" name="Probabilistic Storm Surge probability > 2 feet" unit="%">
|
||||
<DerivedParameter abbreviation="TPCSG-61E2" name="Probabilistic Storm Surge probability > 2 feet" unit="%">
|
||||
<Method models="TPCSurgeProb" name="Alias">
|
||||
<Field abbreviation="PSurge2Ft"/>
|
||||
</Method>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
|
||||
further_licensing_information.
|
||||
-->
|
||||
<DerivedParameter abbreviation="TPCSG_640E2" name="Probabilistic Storm Surge probability > 21 feet" unit="%">
|
||||
<DerivedParameter abbreviation="TPCSG-640E2" name="Probabilistic Storm Surge probability > 21 feet" unit="%">
|
||||
<Method models="TPCSurgeProb" name="Alias">
|
||||
<Field abbreviation="PSurge21Ft"/>
|
||||
</Method>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
|
||||
further_licensing_information.
|
||||
-->
|
||||
<DerivedParameter abbreviation="TPCSG_671E2" name="Probabilistic Storm Surge probability > 22 feet" unit="%">
|
||||
<DerivedParameter abbreviation="TPCSG-671E2" name="Probabilistic Storm Surge probability > 22 feet" unit="%">
|
||||
<Method models="TPCSurgeProb" name="Alias">
|
||||
<Field abbreviation="PSurge22Ft"/>
|
||||
</Method>
|
||||
|
|
|
@ -18,4 +18,8 @@
|
|||
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
|
||||
further_licensing_information.
|
||||
-->
|
||||
<DerivedParameter abbreviation="TPCSG_70" name="Probabilistic Storm Surge height w/70% chance of being exceeded" unit="ft"/>
|
||||
<DerivedParameter abbreviation="TPCSG-70" name="Probabilistic Storm Surge height w/70% chance of being exceeded" unit="ft">
|
||||
<Method models="TPCSurgeProb" name="Alias">
|
||||
<Field abbreviation="Surge70Pct"/>
|
||||
</Method>
|
||||
</DerivedParameter>
|
|
@ -18,7 +18,7 @@
|
|||
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
|
||||
further_licensing_information.
|
||||
-->
|
||||
<DerivedParameter abbreviation="TPCSG_701E2" name="Probabilistic Storm Surge probability > 23 feet" unit="%">
|
||||
<DerivedParameter abbreviation="TPCSG-701E2" name="Probabilistic Storm Surge probability > 23 feet" unit="%">
|
||||
<Method models="TPCSurgeProb" name="Alias">
|
||||
<Field abbreviation="PSurge23Ft"/>
|
||||
</Method>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
|
||||
further_licensing_information.
|
||||
-->
|
||||
<DerivedParameter abbreviation="TPCSG_732E2" name="Probabilistic Storm Surge probability > 24 feet" unit="%">
|
||||
<DerivedParameter abbreviation="TPCSG-732E2" name="Probabilistic Storm Surge probability > 24 feet" unit="%">
|
||||
<Method models="TPCSurgeProb" name="Alias">
|
||||
<Field abbreviation="PSurge24Ft"/>
|
||||
</Method>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
|
||||
further_licensing_information.
|
||||
-->
|
||||
<DerivedParameter abbreviation="TPCSG_762E2" name="Probabilistic Storm Surge probability > 25 feet" unit="%">
|
||||
<DerivedParameter abbreviation="TPCSG-762E2" name="Probabilistic Storm Surge probability > 25 feet" unit="%">
|
||||
<Method models="TPCSurgeProb" name="Alias">
|
||||
<Field abbreviation="PSurge25Ft"/>
|
||||
</Method>
|
||||
|
|
|
@ -18,4 +18,8 @@
|
|||
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
|
||||
further_licensing_information.
|
||||
-->
|
||||
<DerivedParameter abbreviation="TPCSG_80" name="Probabilistic Storm Surge height w/80% chance of being exceeded" unit="ft"/>
|
||||
<DerivedParameter abbreviation="TPCSG-80" name="Probabilistic Storm Surge height w/80% chance of being exceeded" unit="ft">
|
||||
<Method models="TPCSurgeProb" name="Alias">
|
||||
<Field abbreviation="Surge80Pct"/>
|
||||
</Method>
|
||||
</DerivedParameter>
|
|
@ -18,4 +18,8 @@
|
|||
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
|
||||
further_licensing_information.
|
||||
-->
|
||||
<DerivedParameter abbreviation="TPCSG_90" name="Probabilistic Storm Surge height w/90% chance of being exceeded" unit="ft"/>
|
||||
<DerivedParameter abbreviation="TPCSG-90" name="Probabilistic Storm Surge height w/90% chance of being exceeded" unit="ft">
|
||||
<Method models="TPCSurgeProb" name="Alias">
|
||||
<Field abbreviation="Surge90Pct"/>
|
||||
</Method>
|
||||
</DerivedParameter>
|
|
@ -18,7 +18,7 @@
|
|||
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
|
||||
further_licensing_information.
|
||||
-->
|
||||
<DerivedParameter abbreviation="TPCSG_91E2" name="Probabilistic Storm Surge probability > 3 feet" unit="%">
|
||||
<DerivedParameter abbreviation="TPCSG-91E2" name="Probabilistic Storm Surge probability > 3 feet" unit="%">
|
||||
<Method models="TPCSurgeProb" name="Alias">
|
||||
<Field abbreviation="PSurge3Ft"/>
|
||||
</Method>
|
||||
|
|
|
@ -19,7 +19,8 @@ Require-Bundle: org.eclipse.ui,
|
|||
com.raytheon.uf.viz.d2d.core;bundle-version="1.11.15",
|
||||
com.raytheon.uf.viz.localization,
|
||||
javax.measure;bundle-version="1.0.0",
|
||||
com.raytheon.uf.common.ohd;bundle-version="1.12.1174"
|
||||
com.raytheon.uf.common.ohd;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.cache;bundle-version="1.12.1174"
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Import-Package: com.raytheon.uf.common.colormap,
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -176,9 +176,9 @@ public class FFMPTableCellData {
|
|||
if (displayAsInt == true) {
|
||||
tmpVal = Math.rint(value);
|
||||
} else {
|
||||
if (!value.isNaN()) {
|
||||
tmpVal = (double) (((int) ((value + 0.005) * 100))) / 100;
|
||||
}
|
||||
if (!value.isNaN()) {
|
||||
tmpVal = (double) ((Math.round(value * 100.0))/100.0);
|
||||
}
|
||||
}
|
||||
|
||||
if ((columnName == FIELDS.GUIDANCE) && this.guidForcedFlag) {
|
||||
|
|
|
@ -1186,7 +1186,7 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
|
|||
shell.setCursor(getDisplay().getSystemCursor(SWT.CURSOR_WAIT));
|
||||
updateTimeDurationLabel(val, split);
|
||||
if (dialogInitialized) {
|
||||
fireTimeChangedEvent(val, split);
|
||||
fireTimeChangedEvent(val, split, false);
|
||||
}
|
||||
updateD2DRefresh();
|
||||
}
|
||||
|
@ -1260,18 +1260,28 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
|
|||
this.ffmpConfig.setVisibleColumns(attrData);
|
||||
this.ffmpConfig.setAttrData(attrData);
|
||||
this.ffmpTable.showHideTableColumns();
|
||||
boolean changeSplit = false;
|
||||
|
||||
if (timeDurScale.split != ffmpConfig.isSplit()) {
|
||||
changeSplit = true;
|
||||
}
|
||||
|
||||
timeDurScale.setSplit(ffmpConfig.isSplit());
|
||||
|
||||
updateTimeDurationLabel(timeDurScale.getSelectedHoursValue(),
|
||||
ffmpConfig.isSplit());
|
||||
|
||||
if (updateData) {
|
||||
resource.clearTables();
|
||||
resource.getDrawable(resource.getPaintTime()).setDirty(true);
|
||||
FFMPMonitor monitor = FFMPMonitor.getInstance();
|
||||
monitor.fireMonitorEvent(this.getClass().getName());
|
||||
}
|
||||
if (updateData) {
|
||||
|
||||
if (changeSplit) {
|
||||
fireTimeChangedEvent(timeDurScale.getSelectedHoursValue(),
|
||||
ffmpConfig.isSplit(), true);
|
||||
}
|
||||
resource.clearTables();
|
||||
resource.getDrawable(resource.getPaintTime()).setDirty(true);
|
||||
FFMPMonitor.getInstance().fireMonitorEvent(
|
||||
this.getClass().getName());
|
||||
|
||||
}
|
||||
|
||||
ffmpTable.calculateTableSize();
|
||||
shell.pack();
|
||||
|
@ -1314,7 +1324,7 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
|
|||
ffmpListeners.remove(fl);
|
||||
}
|
||||
|
||||
public void fireTimeChangedEvent(double newTime, boolean split) {
|
||||
public void fireTimeChangedEvent(double newTime, boolean split, boolean override) {
|
||||
|
||||
FFMPRecord.FIELDS field = FFMPRecord.FIELDS.QPE;
|
||||
|
||||
|
@ -1325,7 +1335,7 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
|
|||
}
|
||||
}
|
||||
|
||||
if (time != newTime) {
|
||||
if ((time != newTime) || override) {
|
||||
FFMPTimeChangeEvent ftce = new FFMPTimeChangeEvent(newTime, split);
|
||||
Iterator<FFMPListener> iter = ffmpListeners.iterator();
|
||||
while (iter.hasNext()) {
|
||||
|
@ -1756,7 +1766,7 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
|
|||
*/
|
||||
timeDurScale.setTimeDurationAndUpdate(ffmpConfig.getFFMPConfigData()
|
||||
.getTimeFrame());
|
||||
fireTimeChangedEvent(ffmpConfig.getFFMPConfigData().getTimeFrame(), false);
|
||||
fireTimeChangedEvent(ffmpConfig.getFFMPConfigData().getTimeFrame(), false, false);
|
||||
|
||||
/*
|
||||
* Layer
|
||||
|
@ -2006,6 +2016,8 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
|
|||
dataLoadComp.setVisible(false);
|
||||
shell.pack();
|
||||
}
|
||||
|
||||
resource.manageLoaders(status);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -2053,7 +2065,7 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
|
|||
public void tableDataUpdateComplete(FFMPTableDataUpdate updateData) {
|
||||
|
||||
final FFMPTableDataUpdate fupdateData = updateData;
|
||||
|
||||
|
||||
if (!this.isDisposed()) {
|
||||
|
||||
Display.getDefault().asyncExec(new Runnable() {
|
||||
|
@ -2078,9 +2090,9 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
|
|||
resetCursor();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* used to blank the group label when channging HUC
|
||||
* while in an aggregate.
|
||||
|
|
|
@ -111,7 +111,7 @@ public class TimeDurScaleComp extends Composite {
|
|||
/**
|
||||
* Split flag.
|
||||
*/
|
||||
private boolean split = false;
|
||||
public boolean split = false;
|
||||
|
||||
/**
|
||||
* Display numbers for the range.
|
||||
|
|
|
@ -49,7 +49,7 @@ import com.raytheon.viz.core.style.image.ImagePreferences;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 08/29/09 2152 D. Hladky Initial release
|
||||
*
|
||||
* 05/21/12 DR 14833 G. Zhang Error handling for invalid cmap
|
||||
* </pre>
|
||||
*
|
||||
* @author dhladky
|
||||
|
@ -68,7 +68,16 @@ public class FFMPColorUtils {
|
|||
|
||||
private ArrayList<String> fileArray = new ArrayList<String>();
|
||||
|
||||
private TreeMap<Double, String> hourColorMapMap = new TreeMap<Double, String>();
|
||||
private TreeMap<Double, String> hourColorMapMap = new TreeMap<Double, String>();
|
||||
|
||||
// DR 14833: replacing the one in the constructor
|
||||
private StyleRule sr = null;
|
||||
|
||||
// DR 14833: used when no colormap found
|
||||
private static final String DEFAULT_COLORMAP = "ffmp/qpe";
|
||||
|
||||
// DR 14833: used when paramname not matching colormap name found
|
||||
private static final String DEFAULT_PARAMNAME = "qpe";
|
||||
|
||||
/**
|
||||
* Set up FFMP Color maps
|
||||
|
@ -84,7 +93,18 @@ public class FFMPColorUtils {
|
|||
this.tableLoad = tableLoad;
|
||||
this.colormapparams = null;
|
||||
|
||||
StyleRule sr = null;
|
||||
// LocalizationFile[] files = ColorMapLoader.listColorMapFiles();
|
||||
// for (LocalizationFile file : files) {
|
||||
// String fn = file.getName();
|
||||
// if (fn.startsWith("colormaps/ffmp/qpe"))
|
||||
// {
|
||||
// System.out.println(file.getName());
|
||||
// String hour = fn.s
|
||||
// }
|
||||
//
|
||||
// }
|
||||
|
||||
// StyleRule sr = null;// DR 14833 replaced by a instance field
|
||||
try {
|
||||
sr = StyleManager.getInstance().getStyleRule(
|
||||
StyleManager.StyleType.IMAGERY, getMatchCriteria());
|
||||
|
@ -102,6 +122,7 @@ public class FFMPColorUtils {
|
|||
e.printStackTrace();
|
||||
}
|
||||
|
||||
if(cxml == null) cxml = getDefaultColorMap(); // DR 14833: load the default map
|
||||
ColorMap colorMap = new ColorMap(colormapfile, (ColorMap) cxml);
|
||||
colormapparams = new ColorMapParameters();
|
||||
colormapparams.setColorMap(colorMap);
|
||||
|
@ -167,8 +188,8 @@ public class FFMPColorUtils {
|
|||
|
||||
double val2 = (Math.round(valueArg * 100.0)) / 100.0;
|
||||
Double value = val2;
|
||||
|
||||
if (value < 0.01 && field != FIELDS.DIFF) {
|
||||
|
||||
if (value < 0.005 && field != FIELDS.DIFF) {
|
||||
ret = 0;
|
||||
} else if (field == FIELDS.DIFF) {
|
||||
|
||||
|
@ -320,5 +341,72 @@ public class FFMPColorUtils {
|
|||
fileArray.add(fn);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* DR 14833: Error handling for the following:
|
||||
* when a user modified the ffmpImageryStyleRules.xml file
|
||||
* without adding the related qpeX.cmap and for a user made
|
||||
* error like: qpe6/qpe4.cmap then default qpe/qpe.cmap used.
|
||||
*
|
||||
*/
|
||||
public IColorMap getDefaultColorMap(){
|
||||
IColorMap cxml = null;
|
||||
|
||||
/*see parseFileNames(): colormap_name is "0.0" or qpe+key+".cmap"
|
||||
double hour = hourColorMapMap.firstKey();
|
||||
String cmapHour = ( hour==0.0 ? "" : String.valueOf(hour) );
|
||||
System.out.println("FFMPColorUtils.getDefaultColorMap() cmapHour: "+cmapHour );*/
|
||||
|
||||
/* Loop through all StyleRules to get the default.
|
||||
* In StyleManager.loadRules(StyleType), all levels(not only USER)
|
||||
* StyleRule loaded. So it is guaranteed the default can be loaded.
|
||||
*/
|
||||
|
||||
com.raytheon.uf.viz.core.style.StyleRuleset srs =
|
||||
StyleManager.getInstance().getStyleRuleSet(StyleManager.StyleType.IMAGERY);
|
||||
|
||||
for(StyleRule srl : srs.getStyleRules()){
|
||||
String pn="", cm="";
|
||||
try{
|
||||
pn = ((ParamLevelMatchCriteria)srl.getMatchCriteria()).getParameterNames().get(0);
|
||||
cm = ((ImagePreferences)srl.getPreferences()).getDefaultColormap();
|
||||
}catch(Exception e){ continue; }
|
||||
|
||||
if(DEFAULT_PARAMNAME.equalsIgnoreCase(pn) && DEFAULT_COLORMAP.equalsIgnoreCase(cm)){
|
||||
sr = srl;
|
||||
System.out.println("FFMPColorUtils.getDefaultColorMap(): StyleRule pn-cm value: "+pn+"-"+cm);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
/*
|
||||
if(sr == null){
|
||||
//get the MatchCriteria
|
||||
ParamLevelMatchCriteria match = new ParamLevelMatchCriteria();
|
||||
ArrayList<String> paramList = new ArrayList<String>();
|
||||
paramList.add( FIELDS.QPE.getFieldName()+cmapHour );
|
||||
match.setParameterName(paramList);
|
||||
|
||||
//get the StyleRule
|
||||
try {
|
||||
sr=StyleManager.getInstance().getStyleRule(StyleManager.StyleType.IMAGERY, match);
|
||||
} catch (VizStyleException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
*/
|
||||
//get the colormapfile name
|
||||
String colormapfile = ((ImagePreferences) sr.getPreferences()).getDefaultColormap();
|
||||
|
||||
//load the colormap
|
||||
try {
|
||||
cxml = ColorMapLoader.loadColorMap(colormapfile);
|
||||
} catch (VizException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return cxml;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,9 +26,9 @@ import java.util.HashMap;
|
|||
import com.raytheon.uf.common.dataplugin.ffmp.FFMPBasin;
|
||||
import com.raytheon.uf.common.dataplugin.ffmp.FFMPBasinData;
|
||||
import com.raytheon.uf.common.dataplugin.ffmp.FFMPBasinMetaData;
|
||||
import com.raytheon.uf.common.dataplugin.ffmp.FFMPCacheRecord;
|
||||
import com.raytheon.uf.common.dataplugin.ffmp.FFMPGuidanceBasin;
|
||||
import com.raytheon.uf.common.dataplugin.ffmp.FFMPGuidanceInterpolation;
|
||||
import com.raytheon.uf.common.dataplugin.ffmp.FFMPRecord;
|
||||
import com.raytheon.uf.common.dataplugin.ffmp.FFMPRecord.FIELDS;
|
||||
import com.raytheon.uf.common.dataplugin.ffmp.FFMPTemplates;
|
||||
import com.raytheon.uf.common.dataplugin.ffmp.FFMPUtils;
|
||||
|
@ -94,17 +94,17 @@ public class FFMPDataGenerator {
|
|||
|
||||
FFMPBasinData virtualBasin = null;
|
||||
|
||||
FFMPRecord rateRecord = null;
|
||||
FFMPCacheRecord rateRecord = null;
|
||||
|
||||
FFMPRecord qpeRecord = null;
|
||||
FFMPCacheRecord qpeRecord = null;
|
||||
|
||||
FFMPRecord qpfRecord = null;
|
||||
FFMPCacheRecord qpfRecord = null;
|
||||
|
||||
HashMap<String, FFMPRecord> guidRecords = null;
|
||||
HashMap<String, FFMPCacheRecord> guidRecords = null;
|
||||
|
||||
FFMPRecord virtualRecord = null;
|
||||
FFMPCacheRecord virtualRecord = null;
|
||||
|
||||
FFMPRecord baseRec = null;
|
||||
FFMPCacheRecord baseRec = null;
|
||||
|
||||
// Date time = null;
|
||||
|
||||
|
@ -374,7 +374,7 @@ public class FFMPDataGenerator {
|
|||
|
||||
if ((qpfBasin != null)
|
||||
&& (qpfBasin.get(parentBasinPfaf) != null)) {
|
||||
qpf = qpfBasin.get(parentBasinPfaf).getValue(
|
||||
qpf = qpfBasin.get(parentBasinPfaf).getAverageValue(
|
||||
monitor.getQpfWindow().getAfterTime(),
|
||||
monitor.getQpfWindow().getBeforeTime());
|
||||
trd.setTableCellData(3, new FFMPTableCellData(
|
||||
|
@ -557,7 +557,7 @@ public class FFMPDataGenerator {
|
|||
if ((qpfBasin != null)
|
||||
&& (qpfBasin.get(cBasin.getPfaf()) != null)) {
|
||||
|
||||
qpf = qpfBasin.get(cBasin.getPfaf()).getValue(
|
||||
qpf = qpfBasin.get(cBasin.getPfaf()).getAverageValue(
|
||||
monitor.getQpfWindow().getAfterTime(),
|
||||
monitor.getQpfWindow().getBeforeTime());
|
||||
// qpf = getQPFValue(false, cBasin.getPfaf(),
|
||||
|
@ -872,7 +872,7 @@ public class FFMPDataGenerator {
|
|||
trd.setTableCellData(
|
||||
3,
|
||||
new FFMPTableCellData(FIELDS.QPF, new Float(
|
||||
qpeBasin.get(cBasin.getPfaf()).getValue(
|
||||
qpfBasin.get(cBasin.getPfaf()).getMaxValue(
|
||||
monitor.getQpfWindow()
|
||||
.getAfterTime(),
|
||||
monitor.getQpfWindow()
|
||||
|
@ -960,7 +960,7 @@ public class FFMPDataGenerator {
|
|||
Float.NaN));
|
||||
}
|
||||
if (qpfBasin != null) {
|
||||
qpf = qpfBasin.getMaxValue(pfafs, monitor.getQpfWindow()
|
||||
qpf = qpfBasin.getAverageMaxValue(pfafs, monitor.getQpfWindow()
|
||||
.getAfterTime(), monitor.getQpfWindow()
|
||||
.getBeforeTime());
|
||||
|
||||
|
@ -1103,7 +1103,7 @@ public class FFMPDataGenerator {
|
|||
trd.setTableCellData(
|
||||
3,
|
||||
new FFMPTableCellData(FIELDS.QPF, new Float(
|
||||
qpeBasin.get(cBasin.getPfaf()).getValue(
|
||||
qpfBasin.get(cBasin.getPfaf()).getMaxValue(
|
||||
monitor.getQpfWindow()
|
||||
.getAfterTime(),
|
||||
monitor.getQpfWindow()
|
||||
|
@ -1266,7 +1266,9 @@ public class FFMPDataGenerator {
|
|||
qpeBasin = qpeRecord.getBasinData(huc);
|
||||
if (qpeBasin.getBasins().size() > 0) {
|
||||
field = FIELDS.QPE;
|
||||
baseRec = qpeRecord;
|
||||
if (baseRec == null) {
|
||||
baseRec = qpeRecord;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (qpfRecord != null) {
|
||||
|
|
|
@ -102,7 +102,7 @@ public class FFMPDataLoader extends Thread {
|
|||
sharePath = AppsDefaults.getInstance().getToken("apps_dir")
|
||||
+ File.separator + "ffmp" + File.separator;
|
||||
//sharePath = "/awips2/edex/data/share/hydroapps/ffmp/";
|
||||
|
||||
|
||||
this.product = resourceData.getProduct();
|
||||
this.siteKey = resourceData.siteKey;
|
||||
this.dataKey = resourceData.dataKey;
|
||||
|
@ -151,7 +151,9 @@ public class FFMPDataLoader extends Thread {
|
|||
long time = System.currentTimeMillis();
|
||||
|
||||
try {
|
||||
|
||||
resourceData.setLoader(loadType);
|
||||
System.out.println("Starting Loader: "+loadType.getLoaderType());
|
||||
|
||||
ProductRunXML productRun = runner.getProduct(siteKey);
|
||||
ArrayList<String> qpfSources = new ArrayList<String>();
|
||||
|
||||
|
@ -162,8 +164,8 @@ public class FFMPDataLoader extends Thread {
|
|||
|| (loadType == LOADER_TYPE.GENERAL)) {
|
||||
rateURI = getMonitor().getAvailableUri(siteKey, dataKey,
|
||||
product.getRate(), mostRecentTime);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
NavigableMap<Date, List<String>> qpeURIs = getMonitor()
|
||||
.getAvailableUris(siteKey, dataKey, product.getQpe(),
|
||||
timeBack);
|
||||
|
@ -185,7 +187,7 @@ public class FFMPDataLoader extends Thread {
|
|||
qpfURIs = getMonitor().getAvailableUris(siteKey, dataKey,
|
||||
qpfSource.getSourceName(), qpfTime);
|
||||
|
||||
if (qpfURIs != null) {
|
||||
if (qpfURIs != null && !qpfURIs.isEmpty()) {
|
||||
qpfs.add(qpfURIs);
|
||||
qpfSources.add(qpfSource.getSourceName());
|
||||
}
|
||||
|
@ -213,11 +215,16 @@ public class FFMPDataLoader extends Thread {
|
|||
iguidURIs = getMonitor().getAvailableUris(siteKey, dataKey,
|
||||
guidSource.getSourceName(), guidTime);
|
||||
|
||||
if (iguidURIs != null) {
|
||||
if (iguidURIs != null && !iguidURIs.isEmpty()) {
|
||||
guids.put(guidSource.getSourceName(), iguidURIs);
|
||||
}
|
||||
}
|
||||
}
|
||||
// We only load all for long range data, all + layer for medium range
|
||||
if (loadType == LOADER_TYPE.TERTIARY) {
|
||||
hucsToLoad.clear();
|
||||
hucsToLoad.add("ALL");
|
||||
}
|
||||
|
||||
for (String phuc : hucsToLoad) {
|
||||
|
||||
|
@ -231,8 +238,9 @@ public class FFMPDataLoader extends Thread {
|
|||
} else {
|
||||
// rate
|
||||
if (rateURI != null) {
|
||||
System.out.println("Processing " + loadType
|
||||
+ " Rate: huc = " + phuc);
|
||||
fireLoaderEvent(loadType, "Processing "+product.getRate() + "/" + phuc,
|
||||
isDone);
|
||||
|
||||
getMonitor().processUri(isProductLoad, rateURI,
|
||||
siteKey, product.getRate(), timeBack, phuc);
|
||||
fireLoaderEvent(loadType, product.getRate() + "/"
|
||||
|
@ -240,8 +248,8 @@ public class FFMPDataLoader extends Thread {
|
|||
}
|
||||
|
||||
// qpes
|
||||
System.out.println("Processing " + loadType
|
||||
+ " QPE: huc = " + phuc);
|
||||
fireLoaderEvent(loadType, "Processing "+product.getQpe() + "/" + phuc,
|
||||
isDone);
|
||||
FFMPBasinData qpeData = null;
|
||||
|
||||
if ((loadType == LOADER_TYPE.INITIAL)
|
||||
|
@ -258,10 +266,10 @@ public class FFMPDataLoader extends Thread {
|
|||
getMonitor().insertFFMPData(qpeData, siteKey,
|
||||
product.getQpe(), phuc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!qpeURIs.isEmpty()) {
|
||||
if (phuc.equals(config.getFFMPConfigData().getLayer())) {
|
||||
if (!qpeURIs.isEmpty() && qpeData == null) {
|
||||
if (phuc.equals(config.getFFMPConfigData().getLayer()) || phuc.equals("ALL")) {
|
||||
getMonitor().processUris(qpeURIs, isProductLoad,
|
||||
siteKey, product.getQpe(), timeBack, phuc,
|
||||
loadType);
|
||||
|
@ -274,8 +282,8 @@ public class FFMPDataLoader extends Thread {
|
|||
int i = 0;
|
||||
for (NavigableMap<Date, List<String>> qpfURIs : qpfs) {
|
||||
// qpf
|
||||
System.out.println("Processing " + loadType
|
||||
+ " QPF: huc = " + phuc);
|
||||
fireLoaderEvent(loadType, "Processing "+product.getQpf(i) + "/" + phuc,
|
||||
isDone);
|
||||
FFMPBasinData qpfData = null;
|
||||
if ((loadType == LOADER_TYPE.INITIAL)
|
||||
|| (loadType == LOADER_TYPE.SECONDARY)) {
|
||||
|
@ -289,8 +297,8 @@ public class FFMPDataLoader extends Thread {
|
|||
|
||||
if (qpfData != null) {
|
||||
|
||||
if (phuc.equals(config.getFFMPConfigData()
|
||||
.getLayer())
|
||||
if ((phuc.equals(config.getFFMPConfigData()
|
||||
.getLayer()) || phuc.equals("ALL"))
|
||||
&& loadType == LOADER_TYPE.INITIAL
|
||||
&& source.getSourceName().equals(
|
||||
config.getFFMPConfigData()
|
||||
|
@ -311,7 +319,7 @@ public class FFMPDataLoader extends Thread {
|
|||
//if (isUrisProcessNeeded(qpfData,qpfURIs)) {/*DR13839*/
|
||||
if ((qpfData == null) && !qpfURIs.isEmpty()) {
|
||||
if (phuc.equals(config.getFFMPConfigData()
|
||||
.getLayer())) { //old code: keep for reference*/
|
||||
.getLayer()) || phuc.equals("ALL")) { //old code: keep for reference*/
|
||||
//if (isHucProcessNeeded(phuc)) {/*DR13839*/
|
||||
getMonitor().processUris(qpfURIs,
|
||||
isProductLoad, siteKey,
|
||||
|
@ -329,9 +337,8 @@ public class FFMPDataLoader extends Thread {
|
|||
}
|
||||
// virtuals only have data for ALL
|
||||
if (phuc.equals("ALL")) {
|
||||
System.out.println("Processing " + loadType
|
||||
+ " VGB: huc = " + phuc);
|
||||
|
||||
fireLoaderEvent(loadType, "Processing "+product.getVirtual() + "/" + phuc,
|
||||
isDone);
|
||||
FFMPBasinData vgbData = null;
|
||||
|
||||
if ((loadType == LOADER_TYPE.INITIAL)
|
||||
|
@ -361,16 +368,17 @@ public class FFMPDataLoader extends Thread {
|
|||
}
|
||||
|
||||
// process guidance all at once
|
||||
System.out.println("Processing " + loadType
|
||||
+ " GUIDANCE: huc = " + phuc);
|
||||
|
||||
for (String type : productRun.getGuidanceTypes(product)) {
|
||||
|
||||
|
||||
ArrayList<SourceXML> guidSources = productRun
|
||||
.getGuidanceSources(product, type);
|
||||
for (SourceXML guidSource : guidSources) {
|
||||
|
||||
NavigableMap<Date, List<String>> iguidURIs = guids
|
||||
.get(guidSource.getSourceName());
|
||||
|
||||
fireLoaderEvent(loadType, "Processing "+guidSource.getSourceName() + "/" + phuc,
|
||||
isDone);
|
||||
|
||||
getMonitor().processUris(iguidURIs, isProductLoad,
|
||||
siteKey, guidSource.getSourceName(), timeBack,
|
||||
|
@ -386,11 +394,10 @@ public class FFMPDataLoader extends Thread {
|
|||
}
|
||||
} catch (Exception e) {
|
||||
isDone = true;
|
||||
statusHandler.error("FFMP Data Loader terminated...."
|
||||
System.err.println("FFMP Data Loader terminated...."
|
||||
+ e.getMessage());
|
||||
} finally {
|
||||
isDone = true;
|
||||
resourceData.setLoader(loadType);
|
||||
}
|
||||
|
||||
String message = null;
|
||||
|
@ -471,26 +478,35 @@ public class FFMPDataLoader extends Thread {
|
|||
String sourceName = source.getSourceName();
|
||||
File file = new File(sharePath + wfo + File.separator + sourceName
|
||||
+ "-" + siteKey + "-" + pdataKey + "-" + huc + ".bin");
|
||||
System.out.println("Buddy File path: " + file.getAbsolutePath());
|
||||
|
||||
FFMPBasinData basinData = null;
|
||||
FFMPBasinData basinData = null;
|
||||
|
||||
if (file.exists()) {
|
||||
if (file.exists()) {
|
||||
|
||||
System.out.println("Last mod: " + new Date(file.lastModified()));
|
||||
//System.out.println("6 hour mod: " + new Date((System.currentTimeMillis() - (6 * 1000 * 3600))));
|
||||
//System.out.println("DIFF: "+(file.lastModified() - (System.currentTimeMillis() - (6 * 1000 * 3600))));
|
||||
|
||||
System.out.println("File path: " + file.getName());
|
||||
if (file.lastModified() > (System.currentTimeMillis() - (6 * 1000 * 3600))) {
|
||||
|
||||
System.out.println("Buddy File path: " + file.getName());
|
||||
|
||||
try {
|
||||
basinData = (FFMPBasinData) SerializationUtil
|
||||
.transformFromThrift(FileUtil.file2bytes(file,
|
||||
false));
|
||||
} catch (SerializationException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
basinData = (FFMPBasinData) SerializationUtil
|
||||
.transformFromThrift(FileUtil.file2bytes(file, false));
|
||||
} catch (SerializationException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return basinData;
|
||||
|
||||
return basinData;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the home datakey identifier for QPF sources
|
||||
|
|
|
@ -52,6 +52,7 @@ import org.opengis.referencing.operation.TransformException;
|
|||
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
||||
import com.raytheon.uf.common.dataplugin.ffmp.FFMPBasin;
|
||||
import com.raytheon.uf.common.dataplugin.ffmp.FFMPBasinMetaData;
|
||||
import com.raytheon.uf.common.dataplugin.ffmp.FFMPCacheRecord;
|
||||
import com.raytheon.uf.common.dataplugin.ffmp.FFMPGap;
|
||||
import com.raytheon.uf.common.dataplugin.ffmp.FFMPGuidanceBasin;
|
||||
import com.raytheon.uf.common.dataplugin.ffmp.FFMPGuidanceInterpolation;
|
||||
|
@ -65,9 +66,17 @@ import com.raytheon.uf.common.dataplugin.ffmp.FFMPVirtualGageBasinMetaData;
|
|||
import com.raytheon.uf.common.dataplugin.ffmp.HucLevelGeometriesFactory;
|
||||
import com.raytheon.uf.common.geospatial.MapUtil;
|
||||
import com.raytheon.uf.common.geospatial.ReferencedCoordinate;
|
||||
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.PathManagerFactory;
|
||||
import com.raytheon.uf.common.monitor.config.FFFGDataMgr;
|
||||
import com.raytheon.uf.common.monitor.config.FFMPRunConfigurationManager;
|
||||
import com.raytheon.uf.common.monitor.config.FFMPSourceConfigurationManager;
|
||||
import com.raytheon.uf.common.monitor.xml.DomainXML;
|
||||
import com.raytheon.uf.common.monitor.xml.ProductRunXML;
|
||||
import com.raytheon.uf.common.monitor.xml.ProductXML;
|
||||
import com.raytheon.uf.common.monitor.xml.SourceXML;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
|
@ -108,6 +117,7 @@ import com.raytheon.uf.viz.monitor.ffmp.FFMPMonitor;
|
|||
import com.raytheon.uf.viz.monitor.ffmp.ui.dialogs.FFMPConfig;
|
||||
import com.raytheon.uf.viz.monitor.ffmp.ui.dialogs.FfmpBasinTableDlg;
|
||||
import com.raytheon.uf.viz.monitor.ffmp.ui.dialogs.FfmpTableConfig;
|
||||
import com.raytheon.uf.viz.monitor.ffmp.ui.dialogs.FfmpTableConfigData;
|
||||
import com.raytheon.uf.viz.monitor.ffmp.ui.listeners.FFMPAutoRefreshEvent;
|
||||
import com.raytheon.uf.viz.monitor.ffmp.ui.listeners.FFMPCWAChangeEvent;
|
||||
import com.raytheon.uf.viz.monitor.ffmp.ui.listeners.FFMPFieldChangeEvent;
|
||||
|
@ -249,23 +259,23 @@ public class FFMPResource extends
|
|||
|
||||
};
|
||||
|
||||
private FFMPRecord rateRecord = null;
|
||||
private FFMPCacheRecord rateRecord = null;
|
||||
|
||||
private boolean isNewRate = true;
|
||||
|
||||
private FFMPRecord qpeRecord = null;
|
||||
private FFMPCacheRecord qpeRecord = null;
|
||||
|
||||
private boolean isNewQpe = true;
|
||||
|
||||
private FFMPRecord guidRecord = null;
|
||||
private FFMPCacheRecord guidRecord = null;
|
||||
|
||||
private boolean isNewGuid = true;
|
||||
|
||||
private FFMPRecord qpfRecord = null;
|
||||
private FFMPCacheRecord qpfRecord = null;
|
||||
|
||||
private boolean isNewQpf = true;
|
||||
|
||||
private FFMPRecord virtualRecord = null;
|
||||
private FFMPCacheRecord virtualRecord = null;
|
||||
|
||||
private boolean isNewVirtual = true;
|
||||
|
||||
|
@ -309,7 +319,7 @@ public class FFMPResource extends
|
|||
|
||||
/** table slider time **/
|
||||
private Date tableTime = null;
|
||||
|
||||
|
||||
// complete reset
|
||||
public boolean isQuery = true;
|
||||
|
||||
|
@ -332,6 +342,9 @@ public class FFMPResource extends
|
|||
|
||||
/** guidance source expiration **/
|
||||
public long guidSourceExpiration = 0l;
|
||||
|
||||
/** QPF source expiration **/
|
||||
public long qpfSourceExpiration = 0l;
|
||||
|
||||
/** is this a rate load **/
|
||||
public Boolean isRate = null;
|
||||
|
@ -622,7 +635,7 @@ public class FFMPResource extends
|
|||
}
|
||||
case QPF: {
|
||||
value = getQpfRecord(recentTime).getBasinData("ALL")
|
||||
.getMaxValue(pfafs, recentTime);
|
||||
.getAverageMaxValue(pfafs, recentTime, getQpfSourceExpiration());
|
||||
break;
|
||||
}
|
||||
case GUIDANCE: {
|
||||
|
@ -673,7 +686,7 @@ public class FFMPResource extends
|
|||
case RATE:// fall through
|
||||
case QPF: {
|
||||
value = getBasin(key, field, recentTime, aggregate)
|
||||
.getValue(recentTime);
|
||||
.getAverageValue(recentTime, getQpfSourceExpiration());
|
||||
break;
|
||||
}
|
||||
case GUIDANCE: {
|
||||
|
@ -700,7 +713,7 @@ public class FFMPResource extends
|
|||
switch (field) {
|
||||
case QPF: {
|
||||
value = getBasin(key, field, recentTime, aggregate)
|
||||
.getValue(recentTime);
|
||||
.getAverageValue(recentTime, getQpfSourceExpiration());
|
||||
break;
|
||||
}
|
||||
case GUIDANCE: {
|
||||
|
@ -1262,18 +1275,6 @@ public class FFMPResource extends
|
|||
}
|
||||
}
|
||||
|
||||
if (getResourceData().isSecondaryLoad) {
|
||||
// kick in tertiary loader
|
||||
if (!getResourceData().isTertiaryLoad) {
|
||||
if ((loader == null) || !loader.isAlive()) {
|
||||
Date backDate = new Date(getMostRecentTime()
|
||||
.getTime() - (24 * 1000 * 3600));
|
||||
startLoader(getOldestTime(), backDate,
|
||||
LOADER_TYPE.TERTIARY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// the product string
|
||||
if (isFfmpDataToggle() && fieldDescString != null) {
|
||||
paintProductString(aTarget, paintProps);
|
||||
|
@ -1568,13 +1569,13 @@ public class FFMPResource extends
|
|||
buf.append("County: " + metaBasin.getState() + ", "
|
||||
+ metaBasin.getCounty() + "\n");
|
||||
String valst = null;
|
||||
Float val = getBasinValue(pfaf, paintTime.getRefTime(),
|
||||
Float val = getBasinValue(pfaf, getPaintTime().getRefTime(),
|
||||
aggregate);
|
||||
if (val.isNaN() || (val == FFMPUtils.MISSING)) {
|
||||
valst = "NO DATA";
|
||||
} else {
|
||||
valst = df.format(getBasinValue(pfaf,
|
||||
paintTime.getRefTime(), aggregate));
|
||||
getPaintTime().getRefTime(), aggregate));
|
||||
}
|
||||
|
||||
if (!valst.equals("NO DATA")) {
|
||||
|
@ -2233,7 +2234,7 @@ public class FFMPResource extends
|
|||
public DataTime getPaintTime() {
|
||||
return paintTime;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Add a value to worst case hash
|
||||
*
|
||||
|
@ -3026,7 +3027,7 @@ public class FFMPResource extends
|
|||
if (ffmpTime.getTime() != time || isSplit != ffmpTime.isSplit()) {
|
||||
|
||||
isSplit = ffmpTime.isSplit();
|
||||
setTime(ffmpTime.getTime());
|
||||
setTime(ffmpTime.getTime());
|
||||
setTableTime();
|
||||
if (interpolationMap != null) {
|
||||
interpolationMap.clear();
|
||||
|
@ -3916,7 +3917,7 @@ public class FFMPResource extends
|
|||
private void purge(Date pdate) {
|
||||
|
||||
long time = pdate.getTime();
|
||||
time = time - (3600 * 1000 * 24);
|
||||
time = time - getPurgePeriod();
|
||||
Date ndate = new Date(time);
|
||||
|
||||
ArrayList<Date> removes = new ArrayList<Date>();
|
||||
|
@ -3965,6 +3966,30 @@ public class FFMPResource extends
|
|||
}
|
||||
return qpeSourceExpiration;
|
||||
}
|
||||
|
||||
/**
|
||||
* source expiration value as a long
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public long getQpfSourceExpiration() {
|
||||
if (qpfSourceExpiration == 0l) {
|
||||
SourceXML source = null;
|
||||
if (getProduct() != null) {
|
||||
FfmpTableConfigData ffmpTableCfgData = FfmpTableConfig
|
||||
.getInstance().getTableConfigData(getSiteKey());
|
||||
String qpfType = ffmpTableCfgData.getQpfType();
|
||||
|
||||
source = getProduct().getQpfSourcesByType(qpfType).get(0);
|
||||
} else {
|
||||
source = FFMPSourceConfigurationManager.getInstance()
|
||||
.getSource(getResourceData().sourceName);
|
||||
}
|
||||
qpfSourceExpiration = source.getExpirationMinutes(getSiteKey()) * 60 * 1000;
|
||||
}
|
||||
return qpfSourceExpiration;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the guidance source expiration
|
||||
|
@ -4130,7 +4155,9 @@ public class FFMPResource extends
|
|||
ArrayList<String> hucsToLoad = new ArrayList<String>();
|
||||
|
||||
if (isWorstCase) {
|
||||
hucsToLoad.add("ALL");
|
||||
if (!hucsToLoad.contains("ALL")) {
|
||||
hucsToLoad.add("ALL");
|
||||
}
|
||||
}
|
||||
|
||||
// tertiary loader only loads ALL
|
||||
|
@ -4163,5 +4190,62 @@ public class FFMPResource extends
|
|||
loader.removeListener(this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the purge file time
|
||||
*/
|
||||
public long getPurgePeriod() {
|
||||
|
||||
IPathManager pm = PathManagerFactory.getPathManager();
|
||||
LocalizationContext lc = pm.getContext(
|
||||
LocalizationType.COMMON_STATIC, LocalizationLevel.SITE);
|
||||
LocalizationFile lfFile = pm.getLocalizationFile(lc,
|
||||
"purge/ffmpPurgeRules.xml");
|
||||
|
||||
if (lfFile.exists()) {
|
||||
|
||||
//TODO Need to figure out why we can't read in the purgeRules!
|
||||
/*try {
|
||||
PurgeRuleSet prs = (PurgeRuleSet) SerializationUtil
|
||||
.jaxbUnmarshalFromXmlFile(lfFile.getFile().getAbsolutePath());
|
||||
|
||||
for (PurgeRule rule: prs.getRules()) {
|
||||
if (rule.getId().equals("ffmp")) {
|
||||
return rule.getPeriodInMillis();
|
||||
}
|
||||
}
|
||||
|
||||
} catch (SerializationException e) {
|
||||
e.printStackTrace();
|
||||
return 3600*24*1000;
|
||||
} */
|
||||
|
||||
}
|
||||
|
||||
return 3600*24*1000;
|
||||
}
|
||||
|
||||
/**
|
||||
* Kicks off additional loaders that need to be fired off
|
||||
* @param loader
|
||||
* @param isDone
|
||||
*/
|
||||
public void manageLoaders(FFMPLoaderStatus status) {
|
||||
|
||||
if (status.getLoaderType() == LOADER_TYPE.SECONDARY) {
|
||||
if (status.isDone() && !this.getResourceData().isTertiaryLoad) {
|
||||
try {
|
||||
Date startDate = new Date(getMostRecentTime().getTime() - 12 * 3600 * 1000);
|
||||
FFMPMonitor.getInstance().startLoad(this, startDate,
|
||||
LOADER_TYPE.TERTIARY);
|
||||
} catch (VizException e) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Secondary Data Load failure", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// We don't really care about status of tertiary and general loaders
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -40,6 +40,7 @@ import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
|
|||
import com.raytheon.uf.common.localization.PathManagerFactory;
|
||||
import com.raytheon.uf.common.monitor.config.FFMPRunConfigurationManager;
|
||||
import com.raytheon.uf.common.monitor.config.FFMPSourceConfigurationManager.SOURCE_TYPE;
|
||||
import com.raytheon.uf.common.monitor.config.FFMPTemplateConfigurationManager;
|
||||
import com.raytheon.uf.common.monitor.xml.DomainXML;
|
||||
import com.raytheon.uf.common.monitor.xml.ProductRunXML;
|
||||
import com.raytheon.uf.common.monitor.xml.ProductXML;
|
||||
|
@ -229,41 +230,18 @@ public class FFMPResourceData extends AbstractRequestableResourceData {
|
|||
this.timeBack = new Date(
|
||||
(long) (mostRecentTime.getRefTime().getTime() - (cfgBasinXML
|
||||
.getTimeFrame() * 3600 * 1000)));
|
||||
ArrayList<String> hucsToLoad = new ArrayList<String>();
|
||||
hucsToLoad.add(ffmpConfig.getFFMPConfigData().getLayer());
|
||||
if (!ffmpConfig.getFFMPConfigData().getLayer().equals("ALL")) {
|
||||
hucsToLoad.add("ALL");
|
||||
}
|
||||
|
||||
ArrayList<String> hucsToLoad = FFMPTemplateConfigurationManager.getInstance().getHucLevels();
|
||||
// goes back X hours and pre populates the Data Hashes
|
||||
FFMPDataLoader loader = new FFMPDataLoader(this, timeBack,
|
||||
mostRecentTime.getRefTime(), LOADER_TYPE.INITIAL,
|
||||
hucsToLoad);
|
||||
loader.start();
|
||||
|
||||
int i = 0;
|
||||
// make the table load wait for finish of initial data load
|
||||
while (!loader.isDone) {
|
||||
try {
|
||||
// give it 120 or so seconds
|
||||
if (i > 12000) {
|
||||
statusHandler
|
||||
.handle(Priority.WARN,
|
||||
"Didn't load initial data in allotted time, releasing table");
|
||||
break;
|
||||
}
|
||||
Thread.sleep(30);
|
||||
i++;
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
SourceXML source = getPrimarySourceXML();
|
||||
this.domains = monitor.getRunConfig().getDomains();
|
||||
|
||||
|
||||
for (int i = 0; i < objects.length; i++) {
|
||||
FFMPRecord rec = (FFMPRecord) objects[i];
|
||||
rec.setExpiration(source.getExpirationMinutes(siteKey));
|
||||
|
|
|
@ -48,6 +48,7 @@ import com.raytheon.uf.viz.monitor.util.MonitorConfigConstants;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Dec. 3, 2009 3424 zhao Initial creation.
|
||||
* Jan 25, 2010 4281 wkwock/Zhao Added history-table-row-data related modules
|
||||
* May 23, 2012 14410 zhao Modified getCellTypeForBlizWarn and getCellTypeForHsnowWarn modules
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -750,23 +751,39 @@ public final class TableUtil {
|
|||
CellType type = CellType.NotAvailable; // default; assuming no observation available
|
||||
|
||||
String presentWx = report.getPresentWx();
|
||||
|
||||
CellType windSpeed = tm.getThresholdValueCellType(DataUsageKey.DISPLAY, zone, MonitorConfigConstants.SnowDisplay.SNOW_DISP_PROD_BLIZZ_WIND_SPEED.getXmlKey(), report.getWindSpeed());
|
||||
|
||||
CellType windSpeed = tm.getThresholdValueCellType(DataUsageKey.DISPLAY, zone, MonitorConfigConstants.SnowDisplay.SNOW_DISP_WIND_WIND_SPEED.getXmlKey(), report.getWindSpeed());
|
||||
CellType peakWind = tm.getThresholdValueCellType(DataUsageKey.DISPLAY, zone, MonitorConfigConstants.SnowDisplay.SNOW_DISP_PROD_BLIZZ_PEAK_WIND.getXmlKey(), report.getMaxWindSpeed());
|
||||
|
||||
CellType peakWind = tm.getThresholdValueCellType(DataUsageKey.DISPLAY, zone, MonitorConfigConstants.SnowDisplay.SNOW_DISP_WIND_PEAK_WIND.getXmlKey(), report.getMaxWindSpeed());
|
||||
CellType windGust = tm.getThresholdValueCellType(DataUsageKey.DISPLAY, zone, MonitorConfigConstants.SnowDisplay.SNOW_DISP_PROD_BLIZZ_GUST_SPEED.getXmlKey(), report.getWindGust());
|
||||
|
||||
CellType windGust = tm.getThresholdValueCellType(DataUsageKey.DISPLAY, zone, MonitorConfigConstants.SnowDisplay.SNOW_DISP_WIND_GUST_SPEED.getXmlKey(), report.getWindGust());
|
||||
|
||||
CellType visibility = tm.getThresholdValueCellType(DataUsageKey.DISPLAY, zone, MonitorConfigConstants.SnowDisplay.SNOW_DISP_METEO_VIS.getXmlKey(), report.getVisibility());
|
||||
CellType visibility = tm.getThresholdValueCellType(DataUsageKey.DISPLAY, zone, MonitorConfigConstants.SnowDisplay.SNOW_DISP_PROD_BLIZZ_VIS.getXmlKey(), report.getVisibility());
|
||||
|
||||
if ( presentWx.contains("SN") || presentWx.contains("BLSN") ) {
|
||||
// snow or blowing snow observed
|
||||
if ( windSpeed.equals(CellType.R) || peakWind.equals(CellType.R) || windGust.equals(CellType.R) || visibility.equals(CellType.R) ) {
|
||||
type = CellType.R;
|
||||
} else if ( windSpeed.equals(CellType.Y) || peakWind.equals(CellType.Y) || windGust.equals(CellType.Y) || visibility.equals(CellType.Y) ) {
|
||||
type = CellType.Y;
|
||||
} else if ( windSpeed.equals(CellType.G) || peakWind.equals(CellType.G) || windGust.equals(CellType.G) || visibility.equals(CellType.G) ) {
|
||||
type = CellType.G;
|
||||
if ( windSpeed.equals(CellType.R) || peakWind.equals(CellType.R) || windGust.equals(CellType.R) ) {
|
||||
if ( visibility.equals(CellType.R) ) {
|
||||
type = CellType.R;
|
||||
} else {
|
||||
type = CellType.Y;
|
||||
}
|
||||
} else if ( windSpeed.equals(CellType.Y) || peakWind.equals(CellType.Y) || windGust.equals(CellType.Y) ) {
|
||||
type = CellType.Y;
|
||||
} else if ( windSpeed.equals(CellType.G) || peakWind.equals(CellType.G) || windGust.equals(CellType.G) ) {
|
||||
if ( visibility.equals(CellType.R) || visibility.equals(CellType.Y) ) {
|
||||
type = CellType.Y;
|
||||
} else if ( visibility.equals(CellType.G) ) {
|
||||
type = CellType.G;
|
||||
} else {
|
||||
type = CellType.NotAvailable;
|
||||
}
|
||||
} else {
|
||||
if ( visibility.equals(CellType.R) || visibility.equals(CellType.Y) ) {
|
||||
type = CellType.Y;
|
||||
} else {
|
||||
type = CellType.NotAvailable;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// snow or blowing snow not observed
|
||||
|
@ -836,12 +853,12 @@ public final class TableUtil {
|
|||
public static CellType getCellTypeForHsnowWarn(String zone, ObReport report, AbstractThresholdMgr tm) {
|
||||
|
||||
CellType type = CellType.NotAvailable; // default, assuming no observation available
|
||||
|
||||
CellType snowDepth = tm.getThresholdValueCellType(DataUsageKey.DISPLAY, zone, MonitorConfigConstants.SnowDisplay.SNOW_DISP_PROD_HSW_SNOW_DEPTH.getXmlKey(), report.getSnowDepth());
|
||||
|
||||
CellType snowDepth = tm.getThresholdValueCellType(DataUsageKey.DISPLAY, zone, MonitorConfigConstants.SnowDisplay.SNOW_DISP_METEO_TEMP.getXmlKey(), report.getSnowDepth());
|
||||
CellType snincrHourly = tm.getThresholdValueCellType(DataUsageKey.DISPLAY, zone, MonitorConfigConstants.SnowDisplay.SNOW_DISP_PROD_HSW_SNINCR_HOURLY.getXmlKey(), report.getSnincrHourly());
|
||||
|
||||
CellType snincrHourly = tm.getThresholdValueCellType(DataUsageKey.DISPLAY, zone, MonitorConfigConstants.SnowDisplay.SNOW_DISP_METEO_TEMP.getXmlKey(), report.getSnincrHourly());
|
||||
|
||||
CellType snincrTotal = tm.getThresholdValueCellType(DataUsageKey.DISPLAY, zone, MonitorConfigConstants.SnowDisplay.SNOW_DISP_METEO_TEMP.getXmlKey(), report.getSnincrTotal());
|
||||
CellType snincrTotal = tm.getThresholdValueCellType(DataUsageKey.DISPLAY, zone, MonitorConfigConstants.SnowDisplay.SNOW_DISP_PROD_HSW_SNINCR_TOTAL.getXmlKey(), report.getSnincrTotal());
|
||||
|
||||
if ( snowDepth.equals(CellType.R) || snincrHourly.equals(CellType.R) || snincrTotal.equals(CellType.R) ) {
|
||||
type = CellType.R;
|
||||
|
|
|
@ -77,14 +77,12 @@ import com.raytheon.uf.viz.core.style.StyleManager;
|
|||
import com.raytheon.uf.viz.core.style.StyleRule;
|
||||
import com.raytheon.uf.viz.core.style.VizStyleException;
|
||||
import com.raytheon.uf.viz.core.style.level.SingleLevel;
|
||||
import com.raytheon.viz.core.contours.ILoadableAsImage;
|
||||
import com.raytheon.viz.core.contours.rsc.displays.GriddedContourDisplay;
|
||||
import com.raytheon.viz.core.contours.rsc.displays.GriddedVectorDisplay;
|
||||
import com.raytheon.viz.core.drawables.ColorMapParameterFactory;
|
||||
import com.raytheon.viz.core.rsc.displays.GriddedImageDisplay;
|
||||
import com.raytheon.viz.core.rsc.displays.GriddedImageDisplay.GriddedImagePaintProperties;
|
||||
import com.raytheon.viz.core.style.contour.ContourPreferences;
|
||||
import com.raytheon.viz.grid.rsc.GridLoadProperties;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
|
||||
/**
|
||||
|
@ -106,7 +104,7 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
|
||||
public class OAResource extends
|
||||
AbstractVizResource<OAResourceData, MapDescriptor> implements
|
||||
IResourceDataChanged, ILoadableAsImage {
|
||||
IResourceDataChanged {
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(OAResource.class);
|
||||
|
||||
|
@ -178,6 +176,8 @@ public class OAResource extends
|
|||
|
||||
this.displayType = getCapability(DisplayTypeCapability.class)
|
||||
.getDisplayType();
|
||||
getCapability(DisplayTypeCapability.class).setAlternativeDisplayTypes(
|
||||
Arrays.asList(DisplayType.IMAGE));
|
||||
resourceData.addChangeListener(this);
|
||||
if (this.displayType == DisplayType.IMAGE) {
|
||||
this.getCapability(ImagingCapability.class);
|
||||
|
@ -694,17 +694,6 @@ public class OAResource extends
|
|||
disposeRenderable(renderableMap.remove(dataTime));
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.viz.core.contours.ILoadableAsImage#getImageryResource()
|
||||
*/
|
||||
@Override
|
||||
public AbstractVizResource<?, ?> getImageryResource() throws VizException {
|
||||
return this.resourceData.construct(new GridLoadProperties(
|
||||
DisplayType.IMAGE), descriptor);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
|
@ -720,13 +709,4 @@ public class OAResource extends
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.viz.core.contours.ILoadableAsImage#isLoadableAsImage()
|
||||
*/
|
||||
@Override
|
||||
public boolean isLoadableAsImage() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -86,21 +86,21 @@ public class DialogAreaComposite extends ScrolledComposite {
|
|||
Composite rowOfButtons = new Composite(composite, style);
|
||||
GridLayout gridLayout = new GridLayout(1, false);
|
||||
rowOfButtons.setLayout(gridLayout);
|
||||
widget.buildComposite(rowOfButtons, style);
|
||||
widget.buildComposite(rowOfButtons);
|
||||
|
||||
while (wIterator.hasNext()) {
|
||||
widget = wIterator.next();
|
||||
if (widget instanceof ButtonWidget) {
|
||||
gridLayout.numColumns++;
|
||||
widget.buildComposite(rowOfButtons, style);
|
||||
widget.buildComposite(rowOfButtons);
|
||||
} else {
|
||||
widget.buildComposite(composite, style);
|
||||
widget.buildComposite(composite);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
widget.buildComposite(composite, style);
|
||||
widget.buildComposite(composite);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ import java.util.ArrayList;
|
|||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.SelectionListener;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.layout.RowLayout;
|
||||
import org.eclipse.swt.layout.GridLayout;
|
||||
import org.eclipse.swt.widgets.Button;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Group;
|
||||
|
@ -56,22 +56,26 @@ public abstract class ButtonWidget extends Widget {
|
|||
* .swt.widgets.Composite, int)
|
||||
*/
|
||||
@Override
|
||||
public Composite buildComposite(Composite parent, int style) {
|
||||
public Composite buildComposite(Composite parent) {
|
||||
|
||||
Group group = new Group(parent, style);
|
||||
Group group = new Group(parent, SWT.NONE);
|
||||
group.setText(makeGuiLabel(getLabel()));
|
||||
GridData layoutData = new GridData(SWT.DEFAULT, SWT.FILL, false, true);
|
||||
group.setLayoutData(layoutData);
|
||||
|
||||
RowLayout rowLayout = new RowLayout(SWT.VERTICAL);
|
||||
rowLayout.pack = false;
|
||||
group.setLayout(rowLayout);
|
||||
GridLayout layout = new GridLayout(1, false);
|
||||
layout.marginHeight = 0;
|
||||
layout.verticalSpacing = 0;
|
||||
group.setLayout(layout);
|
||||
|
||||
buttons = new ArrayList<Button>();
|
||||
|
||||
if (getOptions() != null) {
|
||||
for (Object option : getOptions()) {
|
||||
Button button = new Button(group, setStyle());
|
||||
layoutData = new GridData(SWT.DEFAULT, SWT.DEFAULT, false,
|
||||
false);
|
||||
button.setLayoutData(layoutData);
|
||||
button.setData(option);
|
||||
String text = option.toString() != null ? option.toString()
|
||||
: "";
|
||||
|
|
|
@ -19,9 +19,11 @@
|
|||
**/
|
||||
package com.raytheon.uf.viz.python.swt.widgets;
|
||||
|
||||
import org.eclipse.jface.dialogs.Dialog;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.ControlEvent;
|
||||
import org.eclipse.swt.events.ControlListener;
|
||||
import org.eclipse.swt.graphics.GC;
|
||||
import org.eclipse.swt.graphics.Point;
|
||||
import org.eclipse.swt.graphics.Rectangle;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
|
@ -29,6 +31,7 @@ import org.eclipse.swt.layout.GridLayout;
|
|||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.eclipse.swt.widgets.Event;
|
||||
import org.eclipse.swt.widgets.Group;
|
||||
import org.eclipse.swt.widgets.Label;
|
||||
import org.eclipse.swt.widgets.Listener;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
@ -66,7 +69,7 @@ public abstract class InputWidget extends Widget implements Listener {
|
|||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class helpRepositioner implements ControlListener {
|
||||
public class HelpRepositioner implements ControlListener {
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
|
@ -112,20 +115,37 @@ public abstract class InputWidget extends Widget implements Listener {
|
|||
* .swt.widgets.Composite, int)
|
||||
*/
|
||||
@Override
|
||||
public Composite buildComposite(Composite parent, int style) {
|
||||
public Composite buildComposite(Composite parent) {
|
||||
|
||||
Composite composite = new Composite(parent, style);
|
||||
Group group = new Group(parent, SWT.NONE);
|
||||
|
||||
GridLayout gridLayout = new GridLayout();
|
||||
gridLayout.numColumns = 2;
|
||||
composite.setLayout(gridLayout);
|
||||
composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||
gridLayout.marginHeight = 0;
|
||||
group.setLayout(gridLayout);
|
||||
group.setLayoutData(new GridData(SWT.DEFAULT, SWT.DEFAULT, false, false));
|
||||
|
||||
Label label = new Label(composite, style);
|
||||
Label label = new Label(group, SWT.LEFT);
|
||||
label.setText(makeGuiLabel(getLabel()));
|
||||
|
||||
text = new Text(composite, SWT.BORDER);
|
||||
text.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||
String s = "";
|
||||
if (getValue() != null) {
|
||||
s = getValue().toString();
|
||||
}
|
||||
|
||||
int width = 30;
|
||||
if (s.length() > 20) {
|
||||
width = s.length() + 10;
|
||||
}
|
||||
GC gc = new GC(parent);
|
||||
width = Dialog.convertWidthInCharsToPixels(gc.getFontMetrics(), width);
|
||||
gc.dispose();
|
||||
|
||||
text = new Text(group, SWT.BORDER);
|
||||
GridData layoutData = new GridData(SWT.DEFAULT, SWT.DEFAULT, true,
|
||||
false);
|
||||
layoutData.widthHint = width;
|
||||
text.setLayoutData(layoutData);
|
||||
text.addListener(SWT.Verify, this);
|
||||
text.addListener(SWT.Modify, new Listener() {
|
||||
|
||||
|
@ -143,16 +163,14 @@ public abstract class InputWidget extends Widget implements Listener {
|
|||
}
|
||||
});
|
||||
|
||||
if (getValue() != null) {
|
||||
text.setText(getValue().toString());
|
||||
}
|
||||
text.setText(s);
|
||||
|
||||
this.composite = composite;
|
||||
this.composite = group;
|
||||
|
||||
composite.getShell().addControlListener(new helpRepositioner());
|
||||
composite.addControlListener(new helpRepositioner());
|
||||
group.getShell().addControlListener(new HelpRepositioner());
|
||||
group.addControlListener(new HelpRepositioner());
|
||||
|
||||
return composite;
|
||||
return group;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
**/
|
||||
package com.raytheon.uf.viz.python.swt.widgets;
|
||||
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.layout.GridLayout;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
|
@ -61,12 +62,14 @@ public class LabelWidget extends Widget {
|
|||
* .swt.widgets.Composite, int)
|
||||
*/
|
||||
@Override
|
||||
public Composite buildComposite(Composite parent, int style) {
|
||||
Group group = new Group(parent, style);
|
||||
group.setLayout(new GridLayout());
|
||||
group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||
public Composite buildComposite(Composite parent) {
|
||||
Group group = new Group(parent, SWT.NONE);
|
||||
GridLayout layout = new GridLayout();
|
||||
layout.marginHeight = 4;
|
||||
group.setLayout(layout);
|
||||
group.setLayoutData(new GridData(SWT.DEFAULT, SWT.DEFAULT, false, false));
|
||||
|
||||
Label label = new Label(group, style);
|
||||
Label label = new Label(group, SWT.LEFT);
|
||||
label.setText(makeGuiLabel(getLabel()));
|
||||
Object value = getValue();
|
||||
if (value != null) {
|
||||
|
|
|
@ -32,7 +32,7 @@ import org.eclipse.swt.widgets.Composite;
|
|||
import org.eclipse.swt.widgets.Group;
|
||||
|
||||
/**
|
||||
* TODO Add Description
|
||||
* List widget
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
|
@ -68,20 +68,21 @@ public class ListWidget extends Widget {
|
|||
* .swt.widgets.Composite, int)
|
||||
*/
|
||||
@Override
|
||||
public Composite buildComposite(Composite parent, int style) {
|
||||
Group group = new Group(parent, style);
|
||||
public Composite buildComposite(Composite parent) {
|
||||
Group group = new Group(parent, SWT.NONE);
|
||||
group.setText(makeGuiLabel(getLabel()));
|
||||
GridLayout layout = new GridLayout(1, false);
|
||||
group.setLayout(layout);
|
||||
GridData layoutData = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
|
||||
GridData layoutData = new GridData(SWT.DEFAULT, SWT.FILL, false, true);
|
||||
group.setLayoutData(layoutData);
|
||||
|
||||
// TODO: change to ToggleSelectList
|
||||
org.eclipse.swt.widgets.List list = new org.eclipse.swt.widgets.List(
|
||||
group, SWT.BORDER | SWT.V_SCROLL
|
||||
| (this.isMultiSelect ? SWT.MULTI : SWT.SINGLE));
|
||||
layoutData = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
|
||||
layoutData.heightHint = list.getItemHeight() * 30;
|
||||
layoutData = new GridData(SWT.DEFAULT, SWT.FILL, false, true);
|
||||
if (getOptions().size() > 30) {
|
||||
layoutData.heightHint = list.getItemHeight() * 30;
|
||||
}
|
||||
list.setLayoutData(layoutData);
|
||||
|
||||
List<Object> values = getValues();
|
||||
|
@ -113,7 +114,7 @@ public class ListWidget extends Widget {
|
|||
}
|
||||
});
|
||||
|
||||
return null;
|
||||
return group;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
|
|
|
@ -96,12 +96,13 @@ public class PushButtonWidget extends Widget {
|
|||
* .swt.widgets.Composite, int)
|
||||
*/
|
||||
@Override
|
||||
public Composite buildComposite(Composite parent, int style) {
|
||||
public Composite buildComposite(Composite parent) {
|
||||
Composite composite = new Composite(parent, SWT.NONE);
|
||||
composite.setLayout(new GridLayout());
|
||||
composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||
composite
|
||||
.setLayoutData(new GridData(SWT.FILL, SWT.DEFAULT, true, false));
|
||||
button = new Button(composite, SWT.PUSH);
|
||||
button.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||
button.setLayoutData(new GridData(SWT.FILL, SWT.DEFAULT, true, false));
|
||||
if (this.text != null) {
|
||||
button.setText(makeGuiLabel(this.text));
|
||||
}
|
||||
|
|
|
@ -22,6 +22,7 @@ package com.raytheon.uf.viz.python.swt.widgets;
|
|||
import java.text.DecimalFormat;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.SelectionAdapter;
|
||||
import org.eclipse.swt.events.SelectionEvent;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
|
@ -97,24 +98,25 @@ public class ScaleWidget extends Widget {
|
|||
* .swt.widgets.Composite, int)
|
||||
*/
|
||||
@Override
|
||||
public Composite buildComposite(Composite parent, int style) {
|
||||
public Composite buildComposite(Composite parent) {
|
||||
|
||||
Group group = new Group(parent, style);
|
||||
Group group = new Group(parent, SWT.NONE);
|
||||
group.setText(makeGuiLabel(getLabel()));
|
||||
|
||||
group.setLayout(new GridLayout());
|
||||
group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||
group.setLayoutData(new GridData(SWT.FILL, SWT.DEFAULT, true, false));
|
||||
|
||||
label = new Label(group, style);
|
||||
label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||
scale = new Scale(group, style);
|
||||
scale.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||
label = new Label(group, SWT.CENTER);
|
||||
label.setLayoutData(new GridData(SWT.FILL, SWT.DEFAULT, true, false));
|
||||
scale = new Scale(group, SWT.HORIZONTAL);
|
||||
GridData layoutData = new GridData(300, SWT.DEFAULT);
|
||||
scale.setLayoutData(layoutData);
|
||||
|
||||
minValue = ((Number) (getOptions().get(0))).floatValue();
|
||||
maxValue = ((Number) (getOptions().get(1))).floatValue();
|
||||
|
||||
range = Math.round((maxValue - minValue) / getResolution());
|
||||
|
||||
|
||||
format = new DecimalFormat();
|
||||
format.setMaximumFractionDigits(precision);
|
||||
|
||||
|
@ -191,7 +193,7 @@ public class ScaleWidget extends Widget {
|
|||
}
|
||||
|
||||
public int getPrecision() {
|
||||
return precision;
|
||||
return precision;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -235,8 +237,8 @@ public class ScaleWidget extends Widget {
|
|||
super.setOptions(options);
|
||||
}
|
||||
|
||||
public void setPrecision(int precision) {
|
||||
this.precision = precision;
|
||||
}
|
||||
public void setPrecision(int precision) {
|
||||
this.precision = precision;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ public class ScrollbarWidget extends Widget {
|
|||
* .swt.widgets.Composite, int)
|
||||
*/
|
||||
@Override
|
||||
public Composite buildComposite(Composite parent, int style) {
|
||||
public Composite buildComposite(Composite parent) {
|
||||
parent.getShell().pack();
|
||||
Point size = parent.getShell().getSize();
|
||||
parent.getShell().setSize(size.x, ((Number) (getValue())).intValue());
|
||||
|
|
|
@ -59,7 +59,7 @@ public abstract class Widget {
|
|||
* Class constructor
|
||||
*/
|
||||
protected Widget() {
|
||||
options = new ArrayList<Object>();
|
||||
this.options = new ArrayList<Object>();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -154,10 +154,9 @@ public abstract class Widget {
|
|||
* Builds a composite for the widget attached to the given parent.
|
||||
*
|
||||
* @param parent
|
||||
* @param style
|
||||
* @return Composite capable of being placed into an SWT container.
|
||||
*/
|
||||
public abstract Composite buildComposite(Composite parent, int style);
|
||||
public abstract Composite buildComposite(Composite parent);
|
||||
|
||||
/**
|
||||
* @param variable
|
||||
|
|
|
@ -202,36 +202,6 @@ public class QPFResource extends AbstractMapVectorResource implements
|
|||
descriptor);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public AbstractVizResource<AbstractRequestableResourceData, MapDescriptor> getStreamlineResource()
|
||||
throws VizException {
|
||||
return (AbstractVizResource<AbstractRequestableResourceData, MapDescriptor>) this.resourceData
|
||||
.construct(new GridLoadProperties(
|
||||
com.raytheon.uf.viz.core.rsc.DisplayType.STREAMLINE),
|
||||
descriptor);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public AbstractVizResource<AbstractRequestableResourceData, MapDescriptor> getWindBarbResource()
|
||||
throws VizException {
|
||||
return (AbstractVizResource<AbstractRequestableResourceData, MapDescriptor>) this.resourceData
|
||||
.construct(new GridLoadProperties(
|
||||
com.raytheon.uf.viz.core.rsc.DisplayType.BARB),
|
||||
descriptor);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public AbstractVizResource<AbstractRequestableResourceData, MapDescriptor> getArrowResource()
|
||||
throws VizException {
|
||||
return (AbstractVizResource<AbstractRequestableResourceData, MapDescriptor>) this.resourceData
|
||||
.construct(new GridLoadProperties(
|
||||
com.raytheon.uf.viz.core.rsc.DisplayType.ARROW),
|
||||
descriptor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resourceChanged(ChangeType type, Object object) {
|
||||
if (type.equals(ChangeType.DATA_UPDATE)) {
|
||||
|
@ -254,31 +224,4 @@ public class QPFResource extends AbstractMapVectorResource implements
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isStreamlineVector() {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isWindVector() {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isArrowVector() {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.viz.core.contours.ILoadableAsImage#isLoadableAsImage()
|
||||
*/
|
||||
@Override
|
||||
public boolean isLoadableAsImage() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -173,13 +173,13 @@ public class TearOffMenuListener implements IMenuListener2 {
|
|||
longest = check;
|
||||
}
|
||||
}
|
||||
byte[] bytes = new byte[longest.length() * 2];
|
||||
Arrays.fill(bytes, (byte) '|');
|
||||
// String filled = new String(bytes);
|
||||
String filled = "- - - - - - TEAR-OFF : "
|
||||
+ menu.getParentItem().getText() + " - - - - - -";
|
||||
// String filled = "-" * bytes.length
|
||||
|
||||
int length = longest.length();
|
||||
if (length == 0) {
|
||||
length = 10;
|
||||
}
|
||||
byte[] bytes = new byte[length];
|
||||
Arrays.fill(bytes, (byte) '-');
|
||||
String filled = new String(bytes);
|
||||
new ActionContributionItem(new TearOffAction(filled, manager, menu))
|
||||
.fill(menu, index);
|
||||
}
|
||||
|
|
|
@ -19,11 +19,19 @@
|
|||
**/
|
||||
package com.raytheon.uf.viz.xy.crosssection;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.geotools.geometry.DirectPosition2D;
|
||||
import org.geotools.referencing.GeodeticCalculator;
|
||||
import org.opengis.referencing.crs.CoordinateReferenceSystem;
|
||||
import org.opengis.referencing.operation.MathTransform;
|
||||
|
||||
import com.raytheon.uf.common.geospatial.MapUtil;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
import com.raytheon.uf.viz.xy.crosssection.CrossSectionRotationsFile.RotationMode;
|
||||
import com.raytheon.viz.core.slice.request.HeightScale;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
|
@ -46,10 +54,13 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
*/
|
||||
|
||||
public class CrossSectionRotation {
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(CrossSectionRotation.class);
|
||||
|
||||
public static List<float[]> rotateVector(String parameter,
|
||||
List<Coordinate> linePoints, List<float[]> floatData,
|
||||
int lineLengthInMeters, HeightScale heightScale) {
|
||||
int lineLengthInMeters, HeightScale heightScale,
|
||||
CoordinateReferenceSystem dataCRS) {
|
||||
if (floatData.size() < 4) {
|
||||
return floatData;
|
||||
}
|
||||
|
@ -73,7 +84,7 @@ public class CrossSectionRotation {
|
|||
int height = result.length / width;
|
||||
float[] cosRot = new float[width];
|
||||
float[] sinRot = new float[width];
|
||||
getRotationCoefs(linePoints, cosRot, sinRot);
|
||||
getRotationCoefs(linePoints, cosRot, sinRot, dataCRS);
|
||||
switch (mode) {
|
||||
case VR_NO_ROTATION: {
|
||||
return floatData;
|
||||
|
@ -166,18 +177,31 @@ public class CrossSectionRotation {
|
|||
}
|
||||
|
||||
private static void getRotationCoefs(List<Coordinate> linePoints,
|
||||
float[] cosRot, float[] sinRot) {
|
||||
for (int i = 0; i < linePoints.size() - 1; i++) {
|
||||
Coordinate c1 = linePoints.get(i);
|
||||
Coordinate c2 = linePoints.get(i + 1);
|
||||
float[] cosRot, float[] sinRot, CoordinateReferenceSystem crs) {
|
||||
List<Coordinate> convertedPoints = new ArrayList<Coordinate>();
|
||||
try {
|
||||
MathTransform transform = MapUtil.getTransformFromLatLon(crs);
|
||||
for (Coordinate c : linePoints) {
|
||||
DirectPosition2D dp = new DirectPosition2D(c.x, c.y);
|
||||
transform.transform(dp, dp);
|
||||
convertedPoints.add(new Coordinate(dp.x, dp.y));
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
statusHandler.handle(Priority.VERBOSE,
|
||||
"Error reprojecting points for cross section rotation", e);
|
||||
convertedPoints = linePoints;
|
||||
}
|
||||
for (int i = 0; i < convertedPoints.size() - 1; i++) {
|
||||
Coordinate c1 = convertedPoints.get(i);
|
||||
Coordinate c2 = convertedPoints.get(i + 1);
|
||||
double x = c2.x - c1.x;
|
||||
double y = c2.y - c1.y;
|
||||
double m = Math.sqrt(x * x + y * y);
|
||||
cosRot[i] = (float) (x / m);
|
||||
sinRot[i] = (float) (y / m);
|
||||
}
|
||||
|
||||
cosRot[cosRot.length - 1] = Float.NaN;
|
||||
sinRot[sinRot.length - 1] = Float.NaN;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,8 +29,10 @@ import java.util.List;
|
|||
import javax.measure.unit.Unit;
|
||||
|
||||
import org.geotools.coverage.grid.GridGeometry2D;
|
||||
import org.opengis.referencing.crs.CoordinateReferenceSystem;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
||||
import com.raytheon.uf.common.geospatial.MapUtil;
|
||||
import com.raytheon.uf.common.time.DataTime;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.xy.crosssection.display.CrossSectionDescriptor;
|
||||
|
@ -116,4 +118,8 @@ public abstract class AbstractCrossSectionAdapter<T extends PluginDataObject>
|
|||
});
|
||||
}
|
||||
|
||||
public CoordinateReferenceSystem getDataCoordinateReferenceSystem() {
|
||||
return MapUtil.LATLON_PROJECTION;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -92,7 +92,7 @@ import com.vividsolutions.jts.geom.LineString;
|
|||
* Dec 4, 2007 njensen Initial creation
|
||||
* 02/17/09 njensen Refactored to new rsc architecture
|
||||
* 02/27/12 14490 kshresth Fixed cross sections not loading as images
|
||||
*
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author njensen
|
||||
|
@ -258,7 +258,8 @@ public abstract class AbstractCrossSectionResource extends
|
|||
.getExtent().getMaxX(), 0)[0];
|
||||
floatData = CrossSectionRotation.rotateVector(
|
||||
resourceData.getParameter(), Arrays.asList(lineData),
|
||||
floatData, lineLengthInMeters, descriptor.getHeightScale());
|
||||
floatData, lineLengthInMeters, descriptor.getHeightScale(),
|
||||
adapter.getDataCoordinateReferenceSystem());
|
||||
if (adapter.getUnit().isCompatible(getUnit())) {
|
||||
UnitConverter converter = adapter.getUnit().getConverterTo(
|
||||
getUnit());
|
||||
|
|
|
@ -45,11 +45,9 @@ import com.raytheon.uf.viz.core.PixelExtent;
|
|||
import com.raytheon.uf.viz.core.drawables.IFont;
|
||||
import com.raytheon.uf.viz.core.drawables.PaintProperties;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
|
||||
import com.raytheon.uf.viz.core.rsc.DisplayType;
|
||||
import com.raytheon.uf.viz.core.rsc.IResourceDataChanged;
|
||||
import com.raytheon.uf.viz.core.rsc.LoadProperties;
|
||||
import com.raytheon.uf.viz.core.rsc.ResourceType;
|
||||
import com.raytheon.uf.viz.core.rsc.capabilities.ColorableCapability;
|
||||
import com.raytheon.uf.viz.core.rsc.capabilities.DensityCapability;
|
||||
import com.raytheon.uf.viz.core.rsc.capabilities.DisplayTypeCapability;
|
||||
|
@ -63,9 +61,7 @@ import com.raytheon.uf.viz.xy.crosssection.adapter.AbstractCrossSectionAdapter;
|
|||
import com.raytheon.uf.viz.xy.crosssection.display.CrossSectionDescriptor;
|
||||
import com.raytheon.viz.core.contours.ContourSupport;
|
||||
import com.raytheon.viz.core.contours.ContourSupport.ContourGroup;
|
||||
import com.raytheon.viz.core.contours.ILoadableAsImage;
|
||||
import com.raytheon.viz.core.style.contour.ContourPreferences;
|
||||
import com.raytheon.viz.grid.rsc.GridLoadProperties;
|
||||
import com.vividsolutions.jts.geom.Envelope;
|
||||
|
||||
/**
|
||||
|
@ -86,7 +82,7 @@ import com.vividsolutions.jts.geom.Envelope;
|
|||
*/
|
||||
|
||||
public class CrossSectionContourResource extends AbstractCrossSectionResource
|
||||
implements ILoadableAsImage, IResourceDataChanged {
|
||||
implements IResourceDataChanged {
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(CrossSectionContourResource.class);
|
||||
|
||||
|
@ -129,6 +125,8 @@ public class CrossSectionContourResource extends AbstractCrossSectionResource
|
|||
if (sr != null) {
|
||||
prefs = contourPrefs = (ContourPreferences) sr.getPreferences();
|
||||
}
|
||||
getCapability(DisplayTypeCapability.class).setAlternativeDisplayTypes(
|
||||
Arrays.asList(DisplayType.IMAGE));
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -334,15 +332,6 @@ public class CrossSectionContourResource extends AbstractCrossSectionResource
|
|||
contours.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AbstractVizResource<?, ?> getImageryResource() throws VizException {
|
||||
GridLoadProperties props = new GridLoadProperties(DisplayType.IMAGE);
|
||||
props.setResourceType(ResourceType.CROSS_SECTION);
|
||||
AbstractVizResource<?, ?> rsc2 = resourceData.construct(props,
|
||||
getDescriptor());
|
||||
return rsc2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resourceChanged(ChangeType type, Object object) {
|
||||
if (type.equals(ChangeType.CAPABILITY)) {
|
||||
|
@ -352,16 +341,6 @@ public class CrossSectionContourResource extends AbstractCrossSectionResource
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.viz.core.contours.ILoadableAsImage#isLoadableAsImage()
|
||||
*/
|
||||
@Override
|
||||
public boolean isLoadableAsImage() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disposeTimeData(DataTime dataTime) {
|
||||
super.disposeTimeData(dataTime);
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
package com.raytheon.uf.viz.xy.timeheight.rsc;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
||||
import org.eclipse.swt.graphics.RGB;
|
||||
import org.geotools.coverage.grid.GeneralGridGeometry;
|
||||
|
@ -30,11 +31,11 @@ import com.raytheon.uf.viz.core.VizApp;
|
|||
import com.raytheon.uf.viz.core.drawables.IFont;
|
||||
import com.raytheon.uf.viz.core.drawables.PaintProperties;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
|
||||
import com.raytheon.uf.viz.core.rsc.DisplayType;
|
||||
import com.raytheon.uf.viz.core.rsc.LoadProperties;
|
||||
import com.raytheon.uf.viz.core.rsc.capabilities.ColorableCapability;
|
||||
import com.raytheon.uf.viz.core.rsc.capabilities.DensityCapability;
|
||||
import com.raytheon.uf.viz.core.rsc.capabilities.DisplayTypeCapability;
|
||||
import com.raytheon.uf.viz.core.rsc.capabilities.MagnificationCapability;
|
||||
import com.raytheon.uf.viz.core.rsc.capabilities.OutlineCapability;
|
||||
import com.raytheon.uf.viz.core.style.ParamLevelMatchCriteria;
|
||||
|
@ -45,10 +46,8 @@ import com.raytheon.uf.viz.xy.timeheight.display.TimeHeightDescriptor;
|
|||
import com.raytheon.uf.viz.xy.varheight.adapter.AbstractVarHeightAdapter;
|
||||
import com.raytheon.viz.core.contours.ContourSupport;
|
||||
import com.raytheon.viz.core.contours.ContourSupport.ContourGroup;
|
||||
import com.raytheon.viz.core.contours.ILoadableAsImage;
|
||||
import com.raytheon.viz.core.rsc.ICombinedResourceData.CombineOperation;
|
||||
import com.raytheon.viz.core.style.contour.ContourPreferences;
|
||||
import com.raytheon.viz.grid.rsc.GridLoadProperties;
|
||||
|
||||
/**
|
||||
* Resource for displaying cross sections as contours
|
||||
|
@ -67,8 +66,7 @@ import com.raytheon.viz.grid.rsc.GridLoadProperties;
|
|||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class TimeHeightContourResource extends AbstractTimeHeightResource
|
||||
implements ILoadableAsImage {
|
||||
public class TimeHeightContourResource extends AbstractTimeHeightResource {
|
||||
|
||||
private static final double ZOOM_REACTION_FACTOR = .45;
|
||||
|
||||
|
@ -110,6 +108,8 @@ public class TimeHeightContourResource extends AbstractTimeHeightResource
|
|||
if (sr != null) {
|
||||
prefs = contourPrefs = (ContourPreferences) sr.getPreferences();
|
||||
}
|
||||
getCapability(DisplayTypeCapability.class).setAlternativeDisplayTypes(
|
||||
Arrays.asList(DisplayType.IMAGE));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -219,33 +219,6 @@ public class TimeHeightContourResource extends AbstractTimeHeightResource
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AbstractVizResource<?, ?> getImageryResource() throws VizException {
|
||||
GridLoadProperties props = new GridLoadProperties(DisplayType.IMAGE);
|
||||
// TimeHeightImageResource rsc = new
|
||||
// TimeHeightImageResource(resourceData,
|
||||
// props, adapter);
|
||||
// rsc.geometry = geometry;
|
||||
// rsc.interpolatedData = interpolatedData;
|
||||
|
||||
// use resource data to construct so that everything gets set up
|
||||
// properly
|
||||
AbstractVizResource<?, ?> rsc = this.getResourceData().construct(props,
|
||||
this.getDescriptor());
|
||||
|
||||
return rsc;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.viz.core.contours.ILoadableAsImage#isLoadableAsImage()
|
||||
*/
|
||||
@Override
|
||||
public boolean isLoadableAsImage() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
package com.raytheon.uf.viz.xy.timeheight.rsc;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
@ -35,7 +36,6 @@ import com.raytheon.uf.viz.core.IGraphicsTarget;
|
|||
import com.raytheon.uf.viz.core.drawables.IImage;
|
||||
import com.raytheon.uf.viz.core.drawables.PaintProperties;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
|
||||
import com.raytheon.uf.viz.core.rsc.DisplayType;
|
||||
import com.raytheon.uf.viz.core.rsc.IResourceDataChanged;
|
||||
import com.raytheon.uf.viz.core.rsc.LoadProperties;
|
||||
|
@ -52,13 +52,11 @@ import com.raytheon.uf.viz.xy.InterpUtils;
|
|||
import com.raytheon.uf.viz.xy.graph.IGraph;
|
||||
import com.raytheon.uf.viz.xy.timeheight.display.TimeHeightDescriptor;
|
||||
import com.raytheon.uf.viz.xy.varheight.adapter.AbstractVarHeightAdapter;
|
||||
import com.raytheon.viz.core.contours.ILoadableAsImage;
|
||||
import com.raytheon.viz.core.contours.util.VectorGraphicsRenderable;
|
||||
import com.raytheon.viz.core.graphing.xy.XYData;
|
||||
import com.raytheon.viz.core.graphing.xy.XYWindImageData;
|
||||
import com.raytheon.viz.core.slice.request.VerticalPointRequest.TimeDirection;
|
||||
import com.raytheon.viz.core.style.arrow.ArrowPreferences;
|
||||
import com.raytheon.viz.grid.rsc.GridLoadProperties;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
|
||||
/**
|
||||
|
@ -81,7 +79,7 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
*/
|
||||
|
||||
public class TimeHeightVectorResource extends AbstractTimeHeightResource
|
||||
implements ILoadableAsImage, IResourceDataChanged {
|
||||
implements IResourceDataChanged {
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(TimeHeightVectorResource.class);
|
||||
|
||||
|
@ -114,6 +112,8 @@ public class TimeHeightVectorResource extends AbstractTimeHeightResource
|
|||
prefs = arrowPrefs = (ArrowPreferences) sr.getPreferences();
|
||||
}
|
||||
this.getResourceData().addChangeListener(this);
|
||||
getCapability(DisplayTypeCapability.class).setAlternativeDisplayTypes(
|
||||
Arrays.asList(DisplayType.IMAGE));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -275,25 +275,6 @@ public class TimeHeightVectorResource extends AbstractTimeHeightResource
|
|||
vgr.dispose();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AbstractVizResource<?, ?> getImageryResource() throws VizException {
|
||||
GridLoadProperties props = new GridLoadProperties(DisplayType.IMAGE);
|
||||
TimeHeightImageResource rsc = new TimeHeightImageResource(resourceData,
|
||||
props, adapter);
|
||||
rsc.interpolatedData = interpolatedData;
|
||||
return rsc;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.viz.core.contours.ILoadableAsImage#isLoadableAsImage()
|
||||
*/
|
||||
@Override
|
||||
public boolean isLoadableAsImage() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
|
|
|
@ -13,9 +13,9 @@ Require-Bundle: org.eclipse.ui,
|
|||
com.raytheon.viz.texteditor,
|
||||
org.geotools,
|
||||
com.raytheon.edex.plugin.ccfp,
|
||||
com.raytheon.edex.plugin.taf,
|
||||
com.raytheon.uf.common.pointdata;bundle-version="1.11.7",
|
||||
com.raytheon.uf.common.serialization,
|
||||
com.raytheon.edex.plugin.taf;bundle-version="1.12.1174",
|
||||
com.raytheon.viz.pointdata;bundle-version="1.11.7",
|
||||
com.raytheon.uf.common.python;bundle-version="1.11.7",
|
||||
org.jep;bundle-version="1.0.0",
|
||||
|
@ -23,7 +23,8 @@ Require-Bundle: org.eclipse.ui,
|
|||
com.raytheon.uf.common.dataplugin.binlightning;bundle-version="1.0.0",
|
||||
com.raytheon.uf.common.site,
|
||||
com.raytheon.viz.ui.personalities.awips;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.viz.application;bundle-version="1.0.0"
|
||||
com.raytheon.uf.viz.application;bundle-version="1.0.0",
|
||||
com.raytheon.uf.common.tafqueue;bundle-version="1.0.0"
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Eclipse-RegisterBuddy: com.raytheon.uf.common.serialization
|
||||
Export-Package: com.raytheon.viz.aviation,
|
||||
|
|
|
@ -49,8 +49,6 @@ import com.raytheon.uf.common.localization.LocalizationFile;
|
|||
import com.raytheon.viz.aviation.monitor.TafUtil;
|
||||
import com.raytheon.viz.aviation.resource.ResourceConfigMgr;
|
||||
import com.raytheon.viz.aviation.resource.ResourceConfigMgr.ResourceTag;
|
||||
import com.raytheon.viz.aviation.utility.TafMessageData;
|
||||
import com.raytheon.viz.aviation.utility.TransmissionQueue;
|
||||
import com.raytheon.viz.avnconfig.ITafSiteConfig;
|
||||
import com.raytheon.viz.avnconfig.TafSiteConfigFactory;
|
||||
import com.raytheon.viz.avnconfig.TafSiteData;
|
||||
|
@ -502,138 +500,89 @@ public class LoaderDialog extends CaveSWTDialog {
|
|||
String issueTime = "";
|
||||
String bbb = tagToBBB();
|
||||
String siteId = "";
|
||||
boolean removePendingTags = false;
|
||||
|
||||
for (int i = 0; i < selected.length; i++) {
|
||||
String ident = selected[i];
|
||||
sb.append(TafUtil.LINE_BREAK);
|
||||
sb.append(TafUtil.LINE_BREAK);
|
||||
// Always retrieve pending TAF from the queue
|
||||
TafMessageData pendingTaf = TransmissionQueue.getInstance()
|
||||
.getPendingBySiteId(ident);
|
||||
if (pendingTaf != null) {
|
||||
// Only ask one time if pending TAF(s) should be removed.
|
||||
if (removePendingTags == false) {
|
||||
String tafType = "Routine";
|
||||
String pbbb = pendingTaf.getBBB();
|
||||
if (pbbb.startsWith("A")) {
|
||||
tafType = "Amended";
|
||||
} else if (pbbb.startsWith("C")) {
|
||||
tafType = "Correctetd";
|
||||
} else if (pbbb.startsWith("R")) {
|
||||
tafType = "Delayed";
|
||||
}
|
||||
String msg = tafType
|
||||
+ " TAF(s) in pending queue will be removed!\n"
|
||||
+ "Is this what you want to do? If not, press \'No\' and re-check\n"
|
||||
+ "TAF forecast type for editing.";
|
||||
MessageBox msgBox = new MessageBox(getParent(), SWT.YES
|
||||
| SWT.NO);
|
||||
msgBox.setMessage(msg);
|
||||
msgBox.setText("Pending TAF");
|
||||
if (SWT.YES == msgBox.open()) {
|
||||
removePendingTags = true;
|
||||
} else {
|
||||
TafRecord taf = null;
|
||||
if (order.equals("template") == false) {
|
||||
taf = TafUtil.getLatestTaf(ident);
|
||||
if (taf == null) {
|
||||
if (i == 0) {
|
||||
tveDlg.setMessageStatusError("No TAF for site " + ident);
|
||||
return;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
String text = pendingTaf.getTafText();
|
||||
sb.append(text);
|
||||
TransmissionQueue.getInstance().remove(pendingTaf.getInfo());
|
||||
|
||||
if (i == 0) {
|
||||
wmoId = pendingTaf.getWmoId();
|
||||
siteId = pendingTaf.getSiteId();
|
||||
bbb = pendingTaf.getBBB();
|
||||
}
|
||||
if (taf != null && order.equals("merge") == false) {
|
||||
sb.append(TafUtil.safeFormatTaf(taf, false));
|
||||
} else {
|
||||
TafRecord taf = null;
|
||||
if (order.equals("template") == false) {
|
||||
taf = TafUtil.getLatestTaf(ident);
|
||||
if (taf == null) {
|
||||
if (i == 0) {
|
||||
tveDlg.setMessageStatusError("No TAF for site "
|
||||
+ ident);
|
||||
return;
|
||||
}
|
||||
continue;
|
||||
// } else {
|
||||
// // TODO the TafEditDialog.py __getForecast line: 1538
|
||||
// -
|
||||
// // 1540
|
||||
}
|
||||
String[] results = getTafTemplate(ident, bbb);
|
||||
String tmpl = results[0];
|
||||
if (tmpl == null) {
|
||||
MessageBox msgBox = new MessageBox(getParent(), SWT.OK);
|
||||
msgBox.setMessage(ident + ": " + results[1]);
|
||||
msgBox.setText("Problem with template");
|
||||
msgBox.open();
|
||||
return;
|
||||
}
|
||||
|
||||
if (taf != null && order.equals("merge") == false) {
|
||||
sb.append(TafUtil.safeFormatTaf(taf, false));
|
||||
if (taf != null && order.equals("merge") == true) {
|
||||
// TODO merge taf and template here
|
||||
String[] tmp = tmpl.split(TafUtil.LINE_BREAK);
|
||||
String sTmpl = tmp[1];
|
||||
Pattern rexp_tmp = Pattern.compile("^" + ident
|
||||
+ "\\s+\\d{6}Z\\s+(\\d{4}/\\d{4}|\\d{6})\\s+");
|
||||
sTmpl = rexp_tmp.matcher(sTmpl).replaceFirst("");
|
||||
String fmtTaf = TafUtil.safeFormatTaf(taf, false)
|
||||
.split("=")[0];
|
||||
Pattern rexp_ramd = Pattern
|
||||
.compile("\\s+AMD\\s(NOT\\sSKED|LTD\\sTO)([\\s\\w/]+)?");
|
||||
fmtTaf = rexp_ramd.matcher(fmtTaf).replaceAll("").trim();
|
||||
StringBuilder contents = new StringBuilder(fmtTaf);
|
||||
contents.append(" ").append(sTmpl);
|
||||
for (int index = 2; index < tmp.length; ++index) {
|
||||
contents.append(TafUtil.LINE_BREAK).append(tmp[index]);
|
||||
}
|
||||
sb.append(contents);
|
||||
} else {
|
||||
String[] results = getTafTemplate(ident, bbb);
|
||||
String tmpl = results[0];
|
||||
if (tmpl == null) {
|
||||
MessageBox msgBox = new MessageBox(getParent(), SWT.OK);
|
||||
msgBox.setMessage(ident + ": " + results[1]);
|
||||
msgBox.setText("Problem with template");
|
||||
msgBox.open();
|
||||
return;
|
||||
}
|
||||
if (taf != null && order.equals("merge") == true) {
|
||||
// TODO merge taf and template here
|
||||
String[] tmp = tmpl.split(TafUtil.LINE_BREAK);
|
||||
String sTmpl = tmp[1];
|
||||
Pattern rexp_tmp = Pattern.compile("^" + ident
|
||||
+ "\\s+\\d{6}Z\\s+(\\d{4}/\\d{4}|\\d{6})\\s+");
|
||||
sTmpl = rexp_tmp.matcher(sTmpl).replaceFirst("");
|
||||
String fmtTaf = TafUtil.safeFormatTaf(taf, false)
|
||||
.split("=")[0];
|
||||
Pattern rexp_ramd = Pattern
|
||||
.compile("\\s+AMD\\s(NOT\\sSKED|LTD\\sTO)([\\s\\w/]+)?");
|
||||
fmtTaf = rexp_ramd.matcher(fmtTaf).replaceAll("")
|
||||
.trim();
|
||||
StringBuilder contents = new StringBuilder(fmtTaf);
|
||||
contents.append(" ").append(sTmpl);
|
||||
for (int index = 2; index < tmp.length; ++index) {
|
||||
contents.append(TafUtil.LINE_BREAK).append(
|
||||
tmp[index]);
|
||||
}
|
||||
sb.append(contents);
|
||||
} else {
|
||||
sb.append(tmpl);
|
||||
if (i == 0) {
|
||||
String itime = tmpl.split("\n")[1].split(" +")[1];
|
||||
issueTime = itime.substring(0, 4) + "00";
|
||||
}
|
||||
sb.append(tmpl);
|
||||
if (i == 0) {
|
||||
String itime = tmpl.split("\n")[1].split(" +")[1];
|
||||
issueTime = itime.substring(0, 4) + "00";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (i == 0) {
|
||||
if (taf != null) {
|
||||
String[] header = taf.getWmoHeader().split(" ");
|
||||
issueTime = header[2];
|
||||
}
|
||||
|
||||
/**
|
||||
* DR #5062: It appears that using the header that comes
|
||||
* with the TAF gives a wrong wmoId and siteId; here, it is
|
||||
* changed to use the header from TafSiteConfig; may need
|
||||
* further investigation on this...
|
||||
*/
|
||||
try {
|
||||
ITafSiteConfig config = TafSiteConfigFactory
|
||||
.getInstance();
|
||||
TafSiteData siteData = config.getSite(ident);
|
||||
wmoId = siteData.wmo.split(" ")[0];
|
||||
siteId = siteData.wmo.split(" ")[1];
|
||||
} catch (FileNotFoundException e) {
|
||||
tveDlg.setSendCollective(false);
|
||||
} catch (ConfigurationException e) {
|
||||
tveDlg.setSendCollective(false);
|
||||
} catch (IOException e) {
|
||||
tveDlg.setSendCollective(false);
|
||||
}
|
||||
|
||||
bbb = tagToBBB();
|
||||
if (i == 0) {
|
||||
if (taf != null) {
|
||||
String[] header = taf.getWmoHeader().split(" ");
|
||||
issueTime = header[2];
|
||||
}
|
||||
|
||||
/**
|
||||
* DR #5062: It appears that using the header that comes with
|
||||
* the TAF gives a wrong wmoId and siteId; here, it is changed
|
||||
* to use the header from TafSiteConfig; may need further
|
||||
* investigation on this...
|
||||
*/
|
||||
try {
|
||||
ITafSiteConfig config = TafSiteConfigFactory.getInstance();
|
||||
TafSiteData siteData = config.getSite(ident);
|
||||
wmoId = siteData.wmo.split(" ")[0];
|
||||
siteId = siteData.wmo.split(" ")[1];
|
||||
} catch (FileNotFoundException e) {
|
||||
tveDlg.setSendCollective(false);
|
||||
} catch (ConfigurationException e) {
|
||||
tveDlg.setSendCollective(false);
|
||||
} catch (IOException e) {
|
||||
tveDlg.setSendCollective(false);
|
||||
}
|
||||
|
||||
bbb = tagToBBB();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -42,11 +42,15 @@ import org.eclipse.swt.widgets.Spinner;
|
|||
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.tafqueue.ServerResponse;
|
||||
import com.raytheon.uf.common.tafqueue.TafQueueRecord;
|
||||
import com.raytheon.uf.common.tafqueue.TafQueueRequest;
|
||||
import com.raytheon.uf.common.tafqueue.TafQueueRequest.Type;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.requests.ThriftClient;
|
||||
import com.raytheon.viz.aviation.AviationDialog;
|
||||
import com.raytheon.viz.aviation.editor.EditorTafTabComp;
|
||||
import com.raytheon.viz.aviation.resource.ResourceConfigMgr;
|
||||
import com.raytheon.viz.aviation.utility.TafMessageData;
|
||||
import com.raytheon.viz.aviation.utility.TransmissionQueue;
|
||||
import com.raytheon.viz.aviation.xml.ForecasterConfig;
|
||||
import com.raytheon.viz.avnconfig.IStatusSettable;
|
||||
import com.raytheon.viz.avnconfig.ITafSiteConfig;
|
||||
|
@ -321,104 +325,7 @@ public class SendDialog extends CaveSWTDialog {
|
|||
okBtn.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
TransmissionQueue queue = TransmissionQueue.getInstance();
|
||||
// Forecaster ID
|
||||
int forecasterId = forecasterArray.get(
|
||||
personList.getSelectionIndex()).getId();
|
||||
// Transmit time
|
||||
long now = System.currentTimeMillis();
|
||||
Calendar xmitTime = Calendar.getInstance();
|
||||
xmitTime.setTimeInMillis(now);
|
||||
xmitTime.setTimeZone(TimeZone.getTimeZone("GMT"));
|
||||
xmitTime.set(Calendar.HOUR_OF_DAY, hourSpnr.getSelection());
|
||||
xmitTime.set(Calendar.MINUTE, minuteSpnr.getSelection());
|
||||
xmitTime.set(Calendar.SECOND, secondSpnr.getSelection());
|
||||
|
||||
String xmitTimestamp = String.format(TIMESTAMP_FORMAT,
|
||||
xmitTime.get(Calendar.DAY_OF_MONTH),
|
||||
xmitTime.get(Calendar.HOUR_OF_DAY),
|
||||
xmitTime.get(Calendar.MINUTE));
|
||||
// BBB
|
||||
String in = tabComp.getTextEditorControl().getText();
|
||||
String bbb = tabComp.getBBB();
|
||||
// WMO ID
|
||||
String siteWmoId = tabComp.getWmoId();
|
||||
// WMO Site
|
||||
String siteNode = tabComp.getWmoSiteId();
|
||||
|
||||
ArrayList<String> tafs = new ArrayList<String>();
|
||||
ArrayList<String> updatedTafs = new ArrayList<String>();
|
||||
|
||||
// Split the text into individual TAFs if necessary
|
||||
if (sendCollective) {
|
||||
tafs.add(in.trim());
|
||||
} else {
|
||||
int idx = 0;
|
||||
int idx2 = 0;
|
||||
|
||||
while (idx > -1 && idx2 > -1) {
|
||||
idx = in.indexOf("TAF", idx);
|
||||
idx2 = in.indexOf("TAF", (idx + 3));
|
||||
String tafStr;
|
||||
|
||||
if (idx > -1 && idx2 > -1) {
|
||||
tafStr = in.substring(idx, idx2);
|
||||
idx += 3;
|
||||
} else {
|
||||
tafStr = in.substring(idx);
|
||||
}
|
||||
|
||||
tafs.add(tafStr.trim());
|
||||
}
|
||||
}
|
||||
|
||||
for (String tafText : tafs) {
|
||||
String fourLetterId = tafText.substring(
|
||||
tafText.indexOf('\n') + 1,
|
||||
tafText.indexOf(' ', tafText.indexOf('\n')));
|
||||
|
||||
// Site ID
|
||||
String siteId = fourLetterId.substring(1);
|
||||
// Type
|
||||
String type = tafText.substring(0, 3);
|
||||
|
||||
// Update Header Time to transmission time.
|
||||
tafText = TIMESTAMP_PATTERN.matcher(tafText).replaceFirst(
|
||||
xmitTimestamp);
|
||||
updatedTafs.add(tafText);
|
||||
try {
|
||||
ITafSiteConfig config = TafSiteConfigFactory
|
||||
.getInstance();
|
||||
TafSiteData siteData = config.getSite(fourLetterId);
|
||||
siteWmoId = siteData.wmo.split(" ")[0];
|
||||
siteNode = siteData.wmo.split(" ")[1];
|
||||
} catch (Exception e) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Error reading site configuration for "
|
||||
+ siteId
|
||||
+ ", attempting to proceed anyway", e);
|
||||
}
|
||||
|
||||
// Enqueue TAF for transmission
|
||||
queue.enqueue(new TafMessageData(forecasterId, xmitTime,
|
||||
tafText, bbb, siteId, siteWmoId, siteNode, type,
|
||||
xmitTime));
|
||||
}
|
||||
tabComp.setTafSent(true);
|
||||
|
||||
// Update the TAF display with transmission time.
|
||||
StringBuilder sb = new StringBuilder();
|
||||
String prefix = "";
|
||||
for (String taf : updatedTafs) {
|
||||
sb.append(prefix).append(taf);
|
||||
prefix = "\n\n";
|
||||
}
|
||||
tabComp.getTextEditorControl().setText(sb.toString());
|
||||
msgStatComp.setMessageText(
|
||||
"The TAF has been sent to the transmission queue.",
|
||||
shell.getDisplay().getSystemColor(SWT.COLOR_GREEN)
|
||||
.getRGB());
|
||||
shell.dispose();
|
||||
sendAction();
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -432,4 +339,120 @@ public class SendDialog extends CaveSWTDialog {
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private void sendAction() {
|
||||
TafQueueRequest request = new TafQueueRequest();
|
||||
request.setType(Type.CREATE);
|
||||
|
||||
// Forecaster ID
|
||||
int forecasterId = forecasterArray.get(personList.getSelectionIndex())
|
||||
.getId();
|
||||
Calendar xmitTime = Calendar.getInstance();
|
||||
xmitTime.setTimeZone(TimeZone.getTimeZone("GMT"));
|
||||
xmitTime.set(Calendar.HOUR_OF_DAY, hourSpnr.getSelection());
|
||||
xmitTime.set(Calendar.MINUTE, minuteSpnr.getSelection());
|
||||
xmitTime.set(Calendar.SECOND, secondSpnr.getSelection());
|
||||
String xmitTimestamp = String.format(TIMESTAMP_FORMAT,
|
||||
xmitTime.get(Calendar.DAY_OF_MONTH),
|
||||
xmitTime.get(Calendar.HOUR_OF_DAY),
|
||||
xmitTime.get(Calendar.MINUTE));
|
||||
// BBB
|
||||
String in = tabComp.getTextEditorControl().getText();
|
||||
String bbb = tabComp.getBBB();
|
||||
// WMO ID
|
||||
String siteWmoId = tabComp.getWmoId();
|
||||
// WMO Site
|
||||
String siteNode = null;
|
||||
java.util.List<String> stationIds = new ArrayList<String>();
|
||||
|
||||
ArrayList<String> tafs = new ArrayList<String>();
|
||||
ArrayList<String> updatedTafs = new ArrayList<String>();
|
||||
|
||||
// Split the text into individual TAFs if necessary
|
||||
if (sendCollective) {
|
||||
tafs.add(in.trim());
|
||||
} else {
|
||||
int idx = 0;
|
||||
int idx2 = 0;
|
||||
|
||||
while (idx > -1 && idx2 > -1) {
|
||||
idx = in.indexOf("TAF", idx);
|
||||
idx2 = in.indexOf("TAF", (idx + 3));
|
||||
String tafStr;
|
||||
|
||||
if (idx > -1 && idx2 > -1) {
|
||||
tafStr = in.substring(idx, idx2);
|
||||
idx += 3;
|
||||
} else {
|
||||
tafStr = in.substring(idx);
|
||||
}
|
||||
|
||||
tafs.add(tafStr.trim());
|
||||
}
|
||||
}
|
||||
|
||||
boolean tafsQeueued = true;
|
||||
java.util.List<TafQueueRecord> records = new ArrayList<TafQueueRecord>();
|
||||
|
||||
for (String tafText : tafs) {
|
||||
String fourLetterId = tafText.substring(tafText.indexOf('\n') + 1,
|
||||
tafText.indexOf(' ', tafText.indexOf('\n')));
|
||||
|
||||
// Site ID
|
||||
String siteId = fourLetterId.substring(1);
|
||||
|
||||
// Update Header Time to transmission time.
|
||||
tafText = TIMESTAMP_PATTERN.matcher(tafText).replaceFirst(
|
||||
xmitTimestamp);
|
||||
updatedTafs.add(tafText);
|
||||
try {
|
||||
ITafSiteConfig config = TafSiteConfigFactory.getInstance();
|
||||
TafSiteData siteData = config.getSite(fourLetterId);
|
||||
siteWmoId = siteData.wmo.split(" ")[0];
|
||||
siteNode = siteData.wmo.split(" ")[1];
|
||||
} catch (Exception e) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Error reading site configuration for " + siteId
|
||||
+ ", attempting to proceed anyway", e);
|
||||
}
|
||||
|
||||
TafQueueRecord record = new TafQueueRecord(forecasterId,
|
||||
xmitTime.getTime(), tafText, bbb, siteId, siteWmoId,
|
||||
siteNode, xmitTime.getTime());
|
||||
records.add(record);
|
||||
}
|
||||
|
||||
try {
|
||||
// Enqueue TAFs for transmission
|
||||
request.setRecords(records);
|
||||
ServerResponse<String> response = (ServerResponse<String>) ThriftClient
|
||||
.sendRequest(request);
|
||||
if (response.isError()) {
|
||||
statusHandler.handle(Priority.PROBLEM, response.toString());
|
||||
tafsQeueued = false;
|
||||
}
|
||||
} catch (VizException e) {
|
||||
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
|
||||
msgStatComp.setMessageText(e.getMessage(), shell.getDisplay()
|
||||
.getSystemColor(SWT.COLOR_RED).getRGB());
|
||||
}
|
||||
|
||||
if (tafsQeueued) {
|
||||
// Update the TAF display with transmission time.
|
||||
StringBuilder sb = new StringBuilder();
|
||||
String prefix = "";
|
||||
for (String taf : updatedTafs) {
|
||||
sb.append(prefix).append(taf);
|
||||
prefix = "\n\n";
|
||||
}
|
||||
tabComp.getTextEditorControl().setText(sb.toString());
|
||||
msgStatComp.setMessageText(
|
||||
"The TAF has been sent to the transmission queue.", shell
|
||||
.getDisplay().getSystemColor(SWT.COLOR_GREEN)
|
||||
.getRGB());
|
||||
}
|
||||
tabComp.setTafSent(tafsQeueued);
|
||||
shell.dispose();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,130 +0,0 @@
|
|||
/**
|
||||
* This software was developed and / or modified by Raytheon Company,
|
||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
*
|
||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
* This software product contains export-restricted data whose
|
||||
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
* to non-U.S. persons whether in the United States or abroad requires
|
||||
* an export license or other authorization.
|
||||
*
|
||||
* Contractor Name: Raytheon Company
|
||||
* Contractor Address: 6825 Pine Street, Suite 340
|
||||
* Mail Stop B8
|
||||
* Omaha, NE 68106
|
||||
* 402.291.0100
|
||||
*
|
||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.viz.aviation.utility;
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.TimeZone;
|
||||
|
||||
/**
|
||||
* TODO Add Description
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Aug 27, 2009 avarani Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author avarani
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class TafMessageData implements Comparable<TafMessageData> {
|
||||
private int forecasterId;
|
||||
|
||||
private Calendar xmitTime;
|
||||
|
||||
private String tafText;
|
||||
|
||||
private String bbb;
|
||||
|
||||
private String siteId;
|
||||
|
||||
private String siteWmoId;
|
||||
|
||||
private String siteNode;
|
||||
|
||||
private String type;
|
||||
|
||||
private Calendar headerTime;
|
||||
|
||||
public TafMessageData(int forecasterId, Calendar xmitTime, String tafText,
|
||||
String bbb, String siteId, String siteWmoId, String siteNode,
|
||||
String type, Calendar headerTime) {
|
||||
this.forecasterId = forecasterId;
|
||||
this.xmitTime = xmitTime;
|
||||
this.tafText = tafText;
|
||||
this.bbb = bbb;
|
||||
this.siteId = siteId;
|
||||
this.siteWmoId = siteWmoId;
|
||||
this.siteNode = siteNode;
|
||||
this.type = type;
|
||||
this.headerTime = headerTime;
|
||||
}
|
||||
|
||||
public String getInfo() {
|
||||
return String
|
||||
.format(
|
||||
"%1$03d-%7$s%8$s%5$s-%6$s-%7$s-%2$ty%2$tm%2$td%2$tH%2$tM-%4$s-%9$d",
|
||||
forecasterId, headerTime, tafText, bbb, siteId,
|
||||
siteWmoId, siteNode, type,
|
||||
(xmitTime.getTimeInMillis() / 1000));
|
||||
}
|
||||
|
||||
// Update the xmitTime to the current time.
|
||||
public void updateTime() {
|
||||
xmitTime = Calendar.getInstance();
|
||||
xmitTime.setTimeInMillis(System.currentTimeMillis());
|
||||
xmitTime.setTimeZone(TimeZone.getTimeZone("GMT"));
|
||||
}
|
||||
|
||||
public long getXmitTime() {
|
||||
return xmitTime.getTimeInMillis();
|
||||
}
|
||||
|
||||
public String getTafText() {
|
||||
return tafText;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see java.lang.Comparable#compareTo(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public int compareTo(TafMessageData o) {
|
||||
if (o.xmitTime.before(this.xmitTime)) {
|
||||
return -1;
|
||||
} else if (this.xmitTime.before(o.xmitTime)) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public String getSiteId() {
|
||||
return siteId;
|
||||
}
|
||||
|
||||
public String getWmoId() {
|
||||
return siteWmoId;
|
||||
}
|
||||
|
||||
public String getBBB() {
|
||||
return bbb;
|
||||
}
|
||||
|
||||
public void setSiteId(String siteId) {
|
||||
this.siteId = siteId;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,191 +0,0 @@
|
|||
/**
|
||||
* This software was developed and / or modified by Raytheon Company,
|
||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
*
|
||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
* This software product contains export-restricted data whose
|
||||
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
* to non-U.S. persons whether in the United States or abroad requires
|
||||
* an export license or other authorization.
|
||||
*
|
||||
* Contractor Name: Raytheon Company
|
||||
* Contractor Address: 6825 Pine Street, Suite 340
|
||||
* Mail Stop B8
|
||||
* Omaha, NE 68106
|
||||
* 402.291.0100
|
||||
*
|
||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.viz.aviation.utility;
|
||||
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.util.Calendar;
|
||||
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
import org.eclipse.core.runtime.Status;
|
||||
import org.eclipse.core.runtime.jobs.Job;
|
||||
|
||||
import com.raytheon.uf.common.dissemination.OUPRequest;
|
||||
import com.raytheon.uf.common.dissemination.OUPResponse;
|
||||
import com.raytheon.uf.common.dissemination.OfficialUserProduct;
|
||||
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.PathManagerFactory;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.requests.ThriftClient;
|
||||
|
||||
/**
|
||||
* This job handles the actual transmission of the TAF.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Aug 31, 2009 avarani Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author avarani
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class TafTransmissionJob extends Job {
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(TafTransmissionJob.class);
|
||||
|
||||
/**
|
||||
* The TafMessageData to be sent out by this job.
|
||||
*/
|
||||
private TafMessageData data;
|
||||
|
||||
/**
|
||||
* @param name
|
||||
*/
|
||||
public TafTransmissionJob(String name, TafMessageData data) {
|
||||
super(name);
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @seeorg.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.
|
||||
* IProgressMonitor)
|
||||
*/
|
||||
@Override
|
||||
protected IStatus run(IProgressMonitor monitor) {
|
||||
OfficialUserProduct oup = new OfficialUserProduct();
|
||||
String name = data.getInfo();
|
||||
String[] words = name.split("-");
|
||||
String awips = words[1];
|
||||
String tstamp = words[4].substring(4);
|
||||
String bbb = words[5].substring(words[5].length() - 3);
|
||||
oup.setFilename(name);
|
||||
oup.setProductText(data.getTafText());
|
||||
oup.setAwipsWanPil(awips);
|
||||
oup.setUserDateTimeStamp(tstamp);
|
||||
oup.setSource("AvnFPS");
|
||||
if (!bbb.equals("___")) {
|
||||
oup.setWmoType(bbb);
|
||||
}
|
||||
|
||||
OUPRequest req = new OUPRequest();
|
||||
req.setProduct(oup);
|
||||
OUPResponse resp;
|
||||
boolean success = false;
|
||||
String additionalInfo = "";
|
||||
try {
|
||||
resp = (OUPResponse) ThriftClient.sendRequest(req);
|
||||
success = resp.isSendLocalSuccess();
|
||||
if (resp.hasFailure()) {
|
||||
// check which kind of failure
|
||||
Priority p = Priority.EVENTA;
|
||||
if (!resp.isAttempted()) {
|
||||
// if was never attempted to send or store even locally
|
||||
p = Priority.CRITICAL;
|
||||
additionalInfo = " ERROR local store never attempted";
|
||||
} else if (!resp.isSendLocalSuccess()) {
|
||||
// if send/store locally failed
|
||||
p = Priority.CRITICAL;
|
||||
additionalInfo = " ERROR store locally failed";
|
||||
} else if (!resp.isSendWANSuccess()) {
|
||||
// if send to WAN failed
|
||||
if (resp.getNeedAcknowledgment()) {
|
||||
// if ack was needed, if it never sent then no ack
|
||||
// was received
|
||||
p = Priority.CRITICAL;
|
||||
additionalInfo = " ERROR send to WAN failed and no acknowledgment received";
|
||||
} else {
|
||||
// if no ack was needed
|
||||
p = Priority.EVENTA;
|
||||
additionalInfo = " WARNING send to WAN failed";
|
||||
}
|
||||
} else if (resp.getNeedAcknowledgment()
|
||||
&& !resp.isAcknowledged()) {
|
||||
// if sent but not acknowledged when acknowledgment is
|
||||
// needed
|
||||
p = Priority.CRITICAL;
|
||||
additionalInfo = " ERROR no acknowledgment received";
|
||||
}
|
||||
statusHandler.handle(p, resp.getMessage());
|
||||
}
|
||||
} catch (VizException e1) {
|
||||
// TODO Auto-generated catch block
|
||||
e1.printStackTrace();
|
||||
}
|
||||
|
||||
TransmissionQueue queue = TransmissionQueue.getInstance();
|
||||
queue.updateMessageStatus(data, success);
|
||||
|
||||
String logMessage;
|
||||
if (success) {
|
||||
logMessage = "SUCCESS " + data.getInfo() + additionalInfo;
|
||||
} else {
|
||||
logMessage = "FAILURE " + data.getInfo() + additionalInfo;
|
||||
}
|
||||
|
||||
String tempTafPath = "aviation/transmissionLogs/";
|
||||
IPathManager pm = PathManagerFactory.getPathManager();
|
||||
LocalizationContext context = pm.getContext(
|
||||
LocalizationType.CAVE_STATIC, LocalizationLevel.SITE);
|
||||
String path = pm.getFile(context, tempTafPath).getAbsolutePath();
|
||||
|
||||
File tmp = new File(path);
|
||||
if (!(tmp.exists())) {
|
||||
tmp.mkdirs();
|
||||
}
|
||||
|
||||
String fname = "AviationTransmissionLog.txt";
|
||||
LocalizationFile lFile = pm.getLocalizationFile(context, tempTafPath
|
||||
+ fname);
|
||||
File file = lFile.getFile();
|
||||
try {
|
||||
FileWriter writer = new FileWriter(file, true);
|
||||
BufferedWriter output = new BufferedWriter(writer);
|
||||
Calendar c = Calendar.getInstance();
|
||||
String year = Integer.toString(c.get(Calendar.YEAR));
|
||||
String month = Integer.toString(c.get(Calendar.MONTH) + 1);
|
||||
String day = Integer.toString(c.get(Calendar.DAY_OF_MONTH));
|
||||
|
||||
output.write(year + month + day + "," + logMessage + "\n");
|
||||
output.close();
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return Status.OK_STATUS;
|
||||
}
|
||||
}
|
|
@ -1,349 +0,0 @@
|
|||
/**
|
||||
* This software was developed and / or modified by Raytheon Company,
|
||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
*
|
||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
* This software product contains export-restricted data whose
|
||||
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
* to non-U.S. persons whether in the United States or abroad requires
|
||||
* an export license or other authorization.
|
||||
*
|
||||
* Contractor Name: Raytheon Company
|
||||
* Contractor Address: 6825 Pine Street, Suite 340
|
||||
* Mail Stop B8
|
||||
* Omaha, NE 68106
|
||||
* 402.291.0100
|
||||
*
|
||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.viz.aviation.utility;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Set;
|
||||
|
||||
import com.raytheon.uf.common.localization.IPathManager;
|
||||
import com.raytheon.uf.common.localization.LocalizationContext;
|
||||
import com.raytheon.uf.common.localization.LocalizationFile;
|
||||
import com.raytheon.uf.common.localization.PathManagerFactory;
|
||||
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
|
||||
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
|
||||
|
||||
/**
|
||||
* The TransmissionQueue class manages the transmission queue for AvnFPS. It
|
||||
* stores a list of TAFs that are pending and sent as well as a list of TAFs
|
||||
* that failed to transmit.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Aug 27, 2009 avarani Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author avarani
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class TransmissionQueue {
|
||||
private static TransmissionQueue xmitQueueInstance = null;
|
||||
|
||||
private HashMap<TafMessageData, TafTransmissionJob> pendingList;
|
||||
|
||||
private ArrayList<TafMessageData> sentList;
|
||||
|
||||
private ArrayList<TafMessageData> errorList;
|
||||
|
||||
/**
|
||||
* private constructor
|
||||
*/
|
||||
private TransmissionQueue() {
|
||||
pendingList = new HashMap<TafMessageData, TafTransmissionJob>();
|
||||
sentList = new ArrayList<TafMessageData>();
|
||||
errorList = new ArrayList<TafMessageData>();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return a reference to the TransmissionQueue instance
|
||||
*/
|
||||
public static synchronized TransmissionQueue getInstance() {
|
||||
if (xmitQueueInstance == null) {
|
||||
xmitQueueInstance = new TransmissionQueue();
|
||||
}
|
||||
|
||||
return xmitQueueInstance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a TafMessageData object to the pending queue.
|
||||
*
|
||||
* @param data
|
||||
* TafMessageData object
|
||||
*/
|
||||
public void enqueue(TafMessageData data) {
|
||||
long now = System.currentTimeMillis();
|
||||
long xmitTime = data.getXmitTime();
|
||||
long delay = xmitTime - now;
|
||||
|
||||
if (delay < 0) {
|
||||
delay = 0;
|
||||
}
|
||||
|
||||
TafTransmissionJob job = new TafTransmissionJob(
|
||||
"AvnFPS TAF transmission job", data);
|
||||
job.setSystem(true);
|
||||
job.schedule(delay);
|
||||
pendingList.put(data, job);
|
||||
}
|
||||
|
||||
/**
|
||||
* Prohibit cloning
|
||||
*/
|
||||
@Override
|
||||
public Object clone() throws CloneNotSupportedException {
|
||||
throw new CloneNotSupportedException();
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a list of the pending TAFs.
|
||||
*
|
||||
* @return an ArrayList containing the info strings of the pending TAFs.
|
||||
*/
|
||||
public ArrayList<String> getPending() {
|
||||
ArrayList<String> out = new ArrayList<String>();
|
||||
Set<TafMessageData> keys = pendingList.keySet();
|
||||
|
||||
for (TafMessageData data : keys) {
|
||||
out.add(data.getInfo());
|
||||
}
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
public TafMessageData getPendingBySiteId(String siteId) {
|
||||
Set<TafMessageData> keys = pendingList.keySet();
|
||||
|
||||
TafMessageData found = null;
|
||||
for (TafMessageData data : keys) {
|
||||
if (data.getSiteId().equals(siteId)) {
|
||||
found = data;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return found;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a list of the TAFs that have been successfuly sent.
|
||||
*
|
||||
* @return an ArrayLsit containing the info strings of the TAFs that have
|
||||
* been successfuly sent.
|
||||
*/
|
||||
public ArrayList<String> getSent() {
|
||||
ArrayList<String> out = new ArrayList<String>();
|
||||
|
||||
for (TafMessageData data : sentList) {
|
||||
out.add(data.getInfo());
|
||||
}
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a list of the TAFs that failed to send.
|
||||
*
|
||||
* @return an ArrayList containing the info string of the TAFs that failed
|
||||
* to send.
|
||||
*/
|
||||
public ArrayList<String> getErrors() {
|
||||
ArrayList<String> out = new ArrayList<String>();
|
||||
|
||||
for (TafMessageData data : errorList) {
|
||||
out.add(data.getInfo());
|
||||
}
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the text of a specified TAF in the pending list
|
||||
*
|
||||
* @param tafInfo
|
||||
* TAF info string for the desired TAF
|
||||
* @return The text of the TAF
|
||||
*/
|
||||
public String getPendingText(String tafInfo) {
|
||||
Set<TafMessageData> keys = pendingList.keySet();
|
||||
String text = null;
|
||||
|
||||
for (TafMessageData data : keys) {
|
||||
if (tafInfo.equals(data.getInfo())) {
|
||||
text = data.getTafText();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the text of a specified TAF in the sent list
|
||||
*
|
||||
* @param tafInfo
|
||||
* TAF info string for the desired TAF
|
||||
* @return The text of the TAF
|
||||
*/
|
||||
public String getSentText(String tafInfo) {
|
||||
String text = null;
|
||||
|
||||
for (TafMessageData data : sentList) {
|
||||
if (tafInfo.equals(data.getInfo())) {
|
||||
text = data.getTafText();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the text of a specified TAF in the error list
|
||||
*
|
||||
* @param tafInfo
|
||||
* TAF info string for the desired TAF
|
||||
* @return The text of the TAF
|
||||
*/
|
||||
public String getErrorText(String tafInfo) {
|
||||
String text = null;
|
||||
|
||||
for (TafMessageData data : errorList) {
|
||||
if (tafInfo.equals(data.getInfo())) {
|
||||
text = data.getTafText();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrive a log of all transmission attempts for the current day.
|
||||
*
|
||||
* @return an ArrayList containing the status of all transmission attempts
|
||||
* for the current day.
|
||||
*/
|
||||
public ArrayList<String> getLog() {
|
||||
ArrayList<String> logList = new ArrayList<String>();
|
||||
|
||||
try {
|
||||
String tempTafPath = "aviation/transmissionLogs/";
|
||||
IPathManager pm = PathManagerFactory.getPathManager();
|
||||
LocalizationContext context = pm.getContext(
|
||||
LocalizationType.CAVE_STATIC, LocalizationLevel.SITE);
|
||||
String fname = "AviationTransmissionLog.txt";
|
||||
LocalizationFile lFile = pm.getLocalizationFile(context,
|
||||
tempTafPath + fname);
|
||||
File file = lFile.getFile();
|
||||
FileReader reader = new FileReader(file);
|
||||
BufferedReader input = new BufferedReader(reader);
|
||||
String line = null;
|
||||
|
||||
while ((line = input.readLine()) != null) {
|
||||
logList.add(line);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
logList.add("Error, log file not found.");
|
||||
}
|
||||
|
||||
return logList;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a TAF from the list of pending TAFs.
|
||||
*
|
||||
* @param tafInfo
|
||||
* the TafMessageData info string for the TAF to be removed from
|
||||
* the pending queue.
|
||||
*/
|
||||
public void remove(String tafInfo) {
|
||||
Set<TafMessageData> keys = pendingList.keySet();
|
||||
|
||||
for (TafMessageData data : keys) {
|
||||
if (tafInfo.equals(data.getInfo())) {
|
||||
TafTransmissionJob job = pendingList.remove(data);
|
||||
job.cancel();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Attempt to retransmit a TAF.
|
||||
*
|
||||
* @param tafInfo
|
||||
* the TafMessageData info string for the TAF to retransmit.
|
||||
* @param bad
|
||||
* flag that determines which list to look in for the TAF to
|
||||
* retransmit. True indicates the TAF should come from the error
|
||||
* list, false indicates the sent list.
|
||||
*/
|
||||
public void retransmit(String tafInfo, boolean bad) {
|
||||
TafMessageData retrans = null;
|
||||
ArrayList<TafMessageData> list = null;
|
||||
|
||||
// If bad flag is set, check the bad list for the taf to retransmit,
|
||||
// otherwise check the sent list.
|
||||
if (bad) {
|
||||
list = errorList;
|
||||
} else {
|
||||
list = sentList;
|
||||
}
|
||||
|
||||
for (TafMessageData data : list) {
|
||||
if (tafInfo.equals(data.getInfo())) {
|
||||
list.remove(data);
|
||||
retrans = data;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
retrans.updateTime();
|
||||
|
||||
enqueue(retrans);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the status of a pending TAF by moving it either to the sent or the
|
||||
* error list. This method should only be called by the TafTransmissionJob's
|
||||
* run method.
|
||||
*
|
||||
* @param taf
|
||||
* the TafMessageData object to update
|
||||
* @param success
|
||||
* boolean
|
||||
*/
|
||||
public void updateMessageStatus(TafMessageData taf, boolean success) {
|
||||
String tafInfo = taf.getInfo();
|
||||
Set<TafMessageData> keys = pendingList.keySet();
|
||||
|
||||
for (TafMessageData data : keys) {
|
||||
if (tafInfo.equals(data.getInfo())) {
|
||||
pendingList.remove(data);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (success) {
|
||||
sentList.add(taf);
|
||||
} else {
|
||||
errorList.add(taf);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -21,8 +21,8 @@ package com.raytheon.viz.aviation.utility;
|
|||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.custom.StyledText;
|
||||
|
@ -35,14 +35,21 @@ import org.eclipse.swt.widgets.Composite;
|
|||
import org.eclipse.swt.widgets.Group;
|
||||
import org.eclipse.swt.widgets.Label;
|
||||
import org.eclipse.swt.widgets.Layout;
|
||||
import org.eclipse.swt.widgets.List;
|
||||
import org.eclipse.swt.widgets.MessageBox;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
import com.raytheon.uf.common.tafqueue.ServerResponse;
|
||||
import com.raytheon.uf.common.tafqueue.TafQueueRecord.TafQueueState;
|
||||
import com.raytheon.uf.common.tafqueue.TafQueueRequest;
|
||||
import com.raytheon.uf.common.tafqueue.TafQueueRequest.Type;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.requests.ThriftClient;
|
||||
import com.raytheon.viz.aviation.resource.ResourceConfigMgr;
|
||||
import com.raytheon.viz.avnconfig.HelpUsageDlg;
|
||||
import com.raytheon.viz.avnconfig.IStatusSettable;
|
||||
import com.raytheon.viz.avnconfig.MessageStatusComp;
|
||||
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||
import com.raytheon.viz.ui.widgets.ToggleSelectList;
|
||||
|
||||
/**
|
||||
* TransmissionQueueDlg class displays the Transmission Queue dialog for AvnFPS.
|
||||
|
@ -52,6 +59,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 28 FEB 2008 938 lvenable Initial creation
|
||||
* 14 MAY 2012 14715 rferrel Use EDEX to perform requests.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -60,6 +68,26 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
|||
*
|
||||
*/
|
||||
public class TransmissionQueueDlg extends CaveSWTDialog {
|
||||
private static String helpText = "This dialog is used to manage transmission and transmission log files.\n\n"
|
||||
+ "The top area manages the forecast files written by the forecast editor.\n"
|
||||
+ "The 'Files' scrolled list window lists files in one of 'pending', 'sent'\n"
|
||||
+ "and 'bad' directories. The time is when the file was written. The file\n"
|
||||
+ "name is \n"
|
||||
+ " xxx-CCCCNNNXXX-yymmddHHMM-BBB\n"
|
||||
+ "where xxx is the forecaster number. The transmission program \n"
|
||||
+ "avnxmitserv uses NNN to determine the transmission window for regular\n"
|
||||
+ "forecasts.\n\n"
|
||||
+ "The bottom area is used to view transmission log files. There is one\n"
|
||||
+ "file for each day of the week. By default, log files for the current day\n"
|
||||
+ "are shown.\n\nButtons:\n"
|
||||
+ " Refresh: refreshes both the directory list and log file windows.\n"
|
||||
+ " View: allows to view selected transmission file(s)\n"
|
||||
+ " Remove: deletes transmission files\n"
|
||||
+ " Retransmit: forces the transmission program to send selected files.\n"
|
||||
+ " If the file is in the 'bad' or 'sent' directory, it is \n"
|
||||
+ " moved back to 'pending'. The transmission time (the last\n"
|
||||
+ " part of the file name) is updated to the current time.\n"
|
||||
+ " Help: displays this window";
|
||||
|
||||
/**
|
||||
* Pending radio button.
|
||||
|
@ -76,10 +104,17 @@ public class TransmissionQueueDlg extends CaveSWTDialog {
|
|||
*/
|
||||
private Button badRdo;
|
||||
|
||||
/**
|
||||
* Button to retransmit selected sent or bad records.
|
||||
*/
|
||||
private Button retransmitBtn;
|
||||
|
||||
/**
|
||||
* Transmission list control.
|
||||
*/
|
||||
private List transList;
|
||||
private ToggleSelectList transList;
|
||||
|
||||
private java.util.List<String> transListId;
|
||||
|
||||
/**
|
||||
* Transmission day control.
|
||||
|
@ -100,15 +135,20 @@ public class TransmissionQueueDlg extends CaveSWTDialog {
|
|||
"Wednesday", "Thursday", "Friday", "Saturday" };
|
||||
|
||||
/**
|
||||
* Selected day of the week.
|
||||
* The Selected day of the week Calendar day of the week value.
|
||||
*/
|
||||
private String selectedDay;
|
||||
private int selectedDay;
|
||||
|
||||
/**
|
||||
* Main composite.
|
||||
*/
|
||||
private Composite mainComp;
|
||||
|
||||
/**
|
||||
* Message status composite.
|
||||
*/
|
||||
private IStatusSettable msgStatComp;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
|
@ -136,6 +176,8 @@ public class TransmissionQueueDlg extends CaveSWTDialog {
|
|||
GridLayout gl = new GridLayout(1, true);
|
||||
mainComp = new Composite(shell, SWT.NONE);
|
||||
mainComp.setLayout(gl);
|
||||
GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
|
||||
mainComp.setLayoutData(gd);
|
||||
|
||||
// Initialize all of the controls and layouts
|
||||
initializeComponents();
|
||||
|
@ -145,8 +187,7 @@ public class TransmissionQueueDlg extends CaveSWTDialog {
|
|||
* Initialize the components on the display.
|
||||
*/
|
||||
private void initializeComponents() {
|
||||
int dayInt = Calendar.getInstance().get(Calendar.DAY_OF_WEEK);
|
||||
selectedDay = dayOfWeek[dayInt - 1];
|
||||
selectedDay = Calendar.getInstance().get(Calendar.DAY_OF_WEEK);
|
||||
|
||||
ResourceConfigMgr configMgr = ResourceConfigMgr.getInstance();
|
||||
configMgr.setDefaultColors(mainComp);
|
||||
|
@ -162,6 +203,7 @@ public class TransmissionQueueDlg extends CaveSWTDialog {
|
|||
createMessageControl(configMgr);
|
||||
|
||||
populateData();
|
||||
updateDayTransList();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -198,6 +240,7 @@ public class TransmissionQueueDlg extends CaveSWTDialog {
|
|||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
populateData();
|
||||
updateDayTransList();
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -209,25 +252,7 @@ public class TransmissionQueueDlg extends CaveSWTDialog {
|
|||
viewBtn.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
int idx = transList.getSelectionIndex();
|
||||
|
||||
if (idx >= 0) {
|
||||
String tafInfo = transList.getItem(idx);
|
||||
TransmissionQueue queue = TransmissionQueue.getInstance();
|
||||
String tafText = null;
|
||||
|
||||
if (pendingRdo.getSelection()) {
|
||||
tafText = queue.getPendingText(tafInfo);
|
||||
} else if (sentRdo.getSelection()) {
|
||||
tafText = queue.getSentText(tafInfo);
|
||||
} else if (badRdo.getSelection()) {
|
||||
tafText = queue.getErrorText(tafInfo);
|
||||
}
|
||||
|
||||
TransmissionViewerDlg tvd = new TransmissionViewerDlg(
|
||||
shell, tafText, tafInfo);
|
||||
tvd.open();
|
||||
}
|
||||
viewTafs();
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -235,42 +260,33 @@ public class TransmissionQueueDlg extends CaveSWTDialog {
|
|||
Button removeBtn = new Button(buttonComp, SWT.PUSH);
|
||||
removeBtn.setLayoutData(gd);
|
||||
removeBtn.setText("Remove");
|
||||
removeBtn.setToolTipText("Delete selected forecast");
|
||||
configMgr.setDefaultFontAndColors(removeBtn);
|
||||
removeBtn.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
TransmissionQueue queue = TransmissionQueue.getInstance();
|
||||
MessageBox questionMB = new MessageBox(shell, SWT.ICON_WARNING
|
||||
| SWT.YES | SWT.NO);
|
||||
questionMB.setText("Remove Pending Transmission");
|
||||
questionMB
|
||||
.setMessage("Are you sure you want to remove this pending transmission from the queue?");
|
||||
int result = questionMB.open();
|
||||
|
||||
if (pendingRdo.getSelection()) {
|
||||
MessageBox questionMB = new MessageBox(shell,
|
||||
SWT.ICON_WARNING | SWT.YES | SWT.NO);
|
||||
questionMB.setText("Remove Pending Transmission");
|
||||
questionMB
|
||||
.setMessage("Are you sure you want to remove this pending transmission from the queue?");
|
||||
int result = questionMB.open();
|
||||
|
||||
if (result == SWT.YES) {
|
||||
queue.remove(transList.getItem(transList
|
||||
.getSelectionIndex()));
|
||||
populateData();
|
||||
}
|
||||
if (result == SWT.YES) {
|
||||
removeSelected();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
|
||||
Button retransmitBtn = new Button(buttonComp, SWT.PUSH);
|
||||
retransmitBtn = new Button(buttonComp, SWT.PUSH);
|
||||
retransmitBtn.setLayoutData(gd);
|
||||
retransmitBtn.setText("Retransmit");
|
||||
configMgr.setDefaultFontAndColors(retransmitBtn);
|
||||
retransmitBtn.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
TransmissionQueue queue = TransmissionQueue.getInstance();
|
||||
queue.retransmit(
|
||||
transList.getItem(transList.getSelectionIndex()),
|
||||
badRdo.getSelection());
|
||||
populateData();
|
||||
retransmit();
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -282,15 +298,140 @@ public class TransmissionQueueDlg extends CaveSWTDialog {
|
|||
helpBtn.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
String text = "This dialog is used to manage transmission and to transmission log files.\n\nThe top area is to manage forecast files written by the forecast editor.\nThe 'Files' scrolled list window lists files in one of 'pending', 'sent'\nand 'bad' directories. The time is when the file was written. The file\nname is \n xxx-CCCCNNNXXX-yymmddHHMM-BBB\nwhere xxx is the forecaster number. The transmission program \navnxmitserv uses NNN to determine the transmission window for regular \nforecasts.\n\nThe bottom area is used to view transmission log files. There is one \nfile for each day of the week. By default, log files for the current day \nare shown.\n\nButtons:\n Refresh: refreshes both the directory list and log file windows.\n View: allows to view selected transmission file(s)\n Remove: deletes transmission files\n Retransmit: forces the transmission program to send selected files.\n If the file is in the 'bad' or 'sent' directory, it is \n moved back to 'pending'. The transmission time (the last\n part of the file name) is updated to the current time.\n Help: displays this window";
|
||||
String description = "Help";
|
||||
HelpUsageDlg usageDlg = new HelpUsageDlg(shell, description,
|
||||
text);
|
||||
helpText);
|
||||
usageDlg.open();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Action method to request the selected records be immediately transmitted.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
private void retransmit() {
|
||||
int[] indices = transList.getSelectionIndices();
|
||||
if (indices.length == 0) {
|
||||
return;
|
||||
}
|
||||
java.util.List<String> idList = new ArrayList<String>(indices.length);
|
||||
for (int index : indices) {
|
||||
idList.add(transListId.get(index));
|
||||
}
|
||||
TafQueueRequest request = new TafQueueRequest();
|
||||
request.setType(Type.RETRANSMIT);
|
||||
request.setState(getDisplayState());
|
||||
request.setArgument(idList);
|
||||
|
||||
try {
|
||||
ServerResponse<java.util.List<String>> response = (ServerResponse<java.util.List<String>>) ThriftClient
|
||||
.sendRequest(request);
|
||||
int color = SWT.COLOR_GREEN;
|
||||
if (response.isError()) {
|
||||
color = SWT.COLOR_RED;
|
||||
}
|
||||
msgStatComp.setMessageText(response.getMessages().get(0),
|
||||
getParent().getDisplay().getSystemColor(color).getRGB());
|
||||
populateTransList(response.getPayload());
|
||||
} catch (VizException e) {
|
||||
msgStatComp.setMessageText(e.getMessage(), getParent().getDisplay()
|
||||
.getSystemColor(SWT.COLOR_RED).getRGB());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine the state of the records being viewed.
|
||||
*
|
||||
* @return state
|
||||
*/
|
||||
private TafQueueState getDisplayState() {
|
||||
TafQueueState state = TafQueueState.PENDING;
|
||||
if (sentRdo.getSelection()) {
|
||||
state = TafQueueState.SENT;
|
||||
} else if (badRdo.getSelection()) {
|
||||
state = TafQueueState.BAD;
|
||||
}
|
||||
return state;
|
||||
}
|
||||
|
||||
/**
|
||||
* This brings up the TAF viewer and populates it with the selected records.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
private void viewTafs() {
|
||||
int[] indices = transList.getSelectionIndices();
|
||||
if (indices.length == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
java.util.List<String> idList = new ArrayList<String>(indices.length);
|
||||
for (int index : indices) {
|
||||
idList.add(transListId.get(index));
|
||||
}
|
||||
|
||||
TafQueueRequest request = new TafQueueRequest();
|
||||
request.setType(Type.GET_TAFS);
|
||||
request.setArgument(idList);
|
||||
ServerResponse<String> response = null;
|
||||
try {
|
||||
response = (ServerResponse<String>) ThriftClient
|
||||
.sendRequest(request);
|
||||
String tafText = response.getPayload();
|
||||
|
||||
String tafInfo = null;
|
||||
if (indices.length == 1) {
|
||||
tafInfo = transList.getItem(indices[0]);
|
||||
} else {
|
||||
tafInfo = "Viewing multiple forecasts";
|
||||
}
|
||||
|
||||
TransmissionViewerDlg tvd = new TransmissionViewerDlg(shell,
|
||||
tafText, tafInfo);
|
||||
tvd.open();
|
||||
} catch (VizException e) {
|
||||
msgStatComp.setMessageText(e.getMessage(), getParent().getDisplay()
|
||||
.getSystemColor(SWT.COLOR_RED).getRGB());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Action to perform to remove the selected records from being displayed.
|
||||
* This updates the database and repopulates the list.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
private void removeSelected() {
|
||||
int[] indices = transList.getSelectionIndices();
|
||||
if (indices.length == 0) {
|
||||
return;
|
||||
}
|
||||
java.util.List<String> idList = new ArrayList<String>(indices.length);
|
||||
for (int index : indices) {
|
||||
idList.add(transListId.get(index));
|
||||
}
|
||||
TafQueueRequest request = new TafQueueRequest();
|
||||
request.setType(Type.REMOVE_SELECTED);
|
||||
request.setState(getDisplayState());
|
||||
request.setArgument(idList);
|
||||
|
||||
try {
|
||||
ServerResponse<java.util.List<String>> response = (ServerResponse<java.util.List<String>>) ThriftClient
|
||||
.sendRequest(request);
|
||||
populateTransList(response.getPayload());
|
||||
int color = SWT.COLOR_GREEN;
|
||||
if (response.isError()) {
|
||||
color = SWT.COLOR_RED;
|
||||
}
|
||||
msgStatComp.setMessageText(response.getMessages().get(0),
|
||||
getParent().getDisplay().getSystemColor(color).getRGB());
|
||||
} catch (VizException e) {
|
||||
msgStatComp.setMessageText(e.getMessage(), getParent().getDisplay()
|
||||
.getSystemColor(SWT.COLOR_RED).getRGB());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the file transmission controls.
|
||||
*/
|
||||
|
@ -316,36 +457,36 @@ public class TransmissionQueueDlg extends CaveSWTDialog {
|
|||
directoryGroup.setLayoutData(gd);
|
||||
configMgr.setDefaultFontAndColors(directoryGroup);
|
||||
|
||||
SelectionAdapter adapter = new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
Button button = (Button) event.getSource();
|
||||
if (button.getSelection()) {
|
||||
retransmitBtn.setEnabled((Boolean) button.getData());
|
||||
populateData();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
gd = new GridData(85, SWT.DEFAULT);
|
||||
pendingRdo = new Button(directoryGroup, SWT.RADIO);
|
||||
configMgr.setDefaultFontAndColors(pendingRdo, "pending", gd);
|
||||
pendingRdo.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
populateData();
|
||||
}
|
||||
});
|
||||
pendingRdo.addSelectionListener(adapter);
|
||||
pendingRdo.setData(false);
|
||||
|
||||
gd = new GridData(85, SWT.DEFAULT);
|
||||
sentRdo = new Button(directoryGroup, SWT.RADIO);
|
||||
sentRdo.setSelection(true);
|
||||
retransmitBtn.setEnabled(true);
|
||||
configMgr.setDefaultFontAndColors(sentRdo, "sent", gd);
|
||||
sentRdo.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
populateData();
|
||||
}
|
||||
});
|
||||
sentRdo.addSelectionListener(adapter);
|
||||
sentRdo.setData(true);
|
||||
|
||||
gd = new GridData(85, SWT.DEFAULT);
|
||||
badRdo = new Button(directoryGroup, SWT.RADIO);
|
||||
configMgr.setDefaultFontAndColors(badRdo, "bad", gd);
|
||||
badRdo.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
populateData();
|
||||
}
|
||||
});
|
||||
badRdo.addSelectionListener(adapter);
|
||||
badRdo.setData(true);
|
||||
|
||||
// -------------------------------------------------
|
||||
// Create right side label and transmission list
|
||||
|
@ -367,10 +508,11 @@ public class TransmissionQueueDlg extends CaveSWTDialog {
|
|||
gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
|
||||
gd.widthHint = 600;
|
||||
gd.heightHint = 150;
|
||||
transList = new List(transListComp, SWT.BORDER | SWT.SINGLE
|
||||
transList = new ToggleSelectList(transListComp, SWT.BORDER | SWT.MULTI
|
||||
| SWT.V_SCROLL | SWT.H_SCROLL);
|
||||
transList.setLayoutData(gd);
|
||||
configMgr.setListBoxFont(transList);
|
||||
transListId = new ArrayList<String>();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -384,22 +526,29 @@ public class TransmissionQueueDlg extends CaveSWTDialog {
|
|||
dayOfWeekComp.setLayoutData(gd);
|
||||
configMgr.setDefaultColors(dayOfWeekComp);
|
||||
|
||||
for (String day : dayOfWeek) {
|
||||
gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
|
||||
final Button dayRdo = new Button(dayOfWeekComp, SWT.RADIO);
|
||||
dayRdo.setText(day);
|
||||
dayRdo.setData(day);
|
||||
dayRdo.setLayoutData(gd);
|
||||
configMgr.setDefaultFontAndColors(dayRdo);
|
||||
dayRdo.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
selectedDay = (String) dayRdo.getData();
|
||||
SelectionAdapter adapter = new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
Button dayRdo = (Button) event.getSource();
|
||||
if (dayRdo.getSelection()) {
|
||||
selectedDay = (Integer) dayRdo.getData();
|
||||
updateDayTransList();
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
if (day.compareTo(selectedDay) == 0) {
|
||||
for (int index = 0; index < dayOfWeek.length; ++index) {
|
||||
String day = dayOfWeek[index];
|
||||
gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
|
||||
Button dayRdo = new Button(dayOfWeekComp, SWT.RADIO);
|
||||
dayRdo.setText(day);
|
||||
// The Calendar.SUNDAY, MONDAY, etc.
|
||||
dayRdo.setData(index + 1);
|
||||
dayRdo.setLayoutData(gd);
|
||||
configMgr.setDefaultFontAndColors(dayRdo);
|
||||
dayRdo.addSelectionListener(adapter);
|
||||
|
||||
if (day.compareTo(dayOfWeek[selectedDay - 1]) == 0) {
|
||||
dayRdo.setSelection(true);
|
||||
}
|
||||
}
|
||||
|
@ -418,7 +567,7 @@ public class TransmissionQueueDlg extends CaveSWTDialog {
|
|||
|
||||
gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
|
||||
dayLbl = new Label(transAttemptComp, SWT.CENTER);
|
||||
dayLbl.setText(selectedDay);
|
||||
dayLbl.setText(dayOfWeek[selectedDay - 1]);
|
||||
dayLbl.setLayoutData(gd);
|
||||
configMgr.setDefaultFontAndColors(dayLbl);
|
||||
|
||||
|
@ -431,83 +580,104 @@ public class TransmissionQueueDlg extends CaveSWTDialog {
|
|||
transStText.setEditable(false);
|
||||
transStText.setLayoutData(gd);
|
||||
configMgr.setTextEditorFontAndColors(transStText);
|
||||
updateDayTransList();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the message status composite.
|
||||
*/
|
||||
private void createMessageControl(ResourceConfigMgr configMgr) {
|
||||
new MessageStatusComp(mainComp, configMgr.getDefaultBackgroundRGB(),
|
||||
msgStatComp = new MessageStatusComp(mainComp,
|
||||
configMgr.getDefaultBackgroundRGB(),
|
||||
configMgr.getMsgBarBackground());
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the transmission day list.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
private void updateDayTransList() {
|
||||
TransmissionQueue queue = TransmissionQueue.getInstance();
|
||||
ArrayList<String> display = null;
|
||||
Calendar c = Calendar.getInstance();
|
||||
HashMap<String, String> calendar = new HashMap<String, String>();
|
||||
String year = Integer.toString(c.get(Calendar.YEAR));
|
||||
String month = Integer.toString(c.get(Calendar.MONTH) + 1);
|
||||
String day = Integer.toString(c.get(Calendar.DATE));
|
||||
String date = year + month + day;
|
||||
calendar.put(dayOfWeek[c.get(Calendar.DAY_OF_WEEK) - 1], date);
|
||||
TafQueueRequest request = new TafQueueRequest();
|
||||
request.setType(Type.GET_LOG);
|
||||
List<Date> dateList = new ArrayList<Date>(2);
|
||||
|
||||
for (int i = 1; i < 7; i++) {
|
||||
c.add(Calendar.DATE, -1);
|
||||
year = Integer.toString(c.get(Calendar.YEAR));
|
||||
month = Integer.toString(c.get(Calendar.MONTH) + 1);
|
||||
day = Integer.toString(c.get(Calendar.DATE));
|
||||
date = year + month + day;
|
||||
calendar.put(dayOfWeek[c.get(Calendar.DAY_OF_WEEK) - 1], date);
|
||||
dayLbl.setText(dayOfWeek[selectedDay - 1]);
|
||||
// Adjust currentDay to start of the day
|
||||
Calendar currentDay = Calendar.getInstance();
|
||||
currentDay.set(Calendar.HOUR_OF_DAY, 0);
|
||||
currentDay.set(Calendar.MINUTE, 0);
|
||||
currentDay.set(Calendar.SECOND, 0);
|
||||
currentDay.set(Calendar.MILLISECOND, 0);
|
||||
|
||||
// Adjust selected day to current or previous week.
|
||||
Calendar selectedDayStart = Calendar.getInstance();
|
||||
selectedDayStart.setTime(currentDay.getTime());
|
||||
selectedDayStart.set(Calendar.DAY_OF_WEEK, selectedDay);
|
||||
if (currentDay.compareTo(selectedDayStart) < 0) {
|
||||
selectedDayStart.add(Calendar.DAY_OF_MONTH, -7);
|
||||
}
|
||||
dateList.add(selectedDayStart.getTime());
|
||||
|
||||
dayLbl.setText(selectedDay);
|
||||
System.out.println(selectedDay);
|
||||
// Determine start of next day.
|
||||
Calendar selectedDayEnd = Calendar.getInstance();
|
||||
selectedDayEnd.setTime(selectedDayStart.getTime());
|
||||
selectedDayEnd.add(Calendar.DAY_OF_MONTH, 1);
|
||||
dateList.add(selectedDayEnd.getTime());
|
||||
request.setArgument(dateList);
|
||||
|
||||
display = queue.getLog();
|
||||
String txt = "";
|
||||
|
||||
if (display.size() == 1 && display.get(0).startsWith("Error")) {
|
||||
txt = display.get(0);
|
||||
} else {
|
||||
for (String str : display) {
|
||||
String today = calendar.get(selectedDay);
|
||||
String[] bits = str.split(",");
|
||||
|
||||
if (today.equals(bits[0])) {
|
||||
txt += bits[1] + "\n";
|
||||
}
|
||||
}
|
||||
try {
|
||||
ServerResponse<String> response = (ServerResponse<String>) ThriftClient
|
||||
.sendRequest(request);
|
||||
String text = response.getPayload();
|
||||
transStText.setText(text);
|
||||
} catch (VizException e) {
|
||||
msgStatComp.setMessageText(e.getMessage(), getParent().getDisplay()
|
||||
.getSystemColor(SWT.COLOR_RED).getRGB());
|
||||
}
|
||||
|
||||
transStText.setText(txt);
|
||||
}
|
||||
|
||||
/**
|
||||
* Populate the top text area with a list of TAF messages that have been
|
||||
* successfuly sent, are pending transmission, or have failed.
|
||||
* successfully sent, are pending transmission, or have failed.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
private void populateData() {
|
||||
TransmissionQueue queue = TransmissionQueue.getInstance();
|
||||
transList.removeAll();
|
||||
ArrayList<String> display = null;
|
||||
transListId.clear();
|
||||
|
||||
if (pendingRdo.getSelection()) {
|
||||
display = queue.getPending();
|
||||
} else if (sentRdo.getSelection()) {
|
||||
display = queue.getSent();
|
||||
} else if (badRdo.getSelection()) {
|
||||
display = queue.getErrors();
|
||||
try {
|
||||
TafQueueRequest request = new TafQueueRequest();
|
||||
request.setType(Type.GET_LIST);
|
||||
|
||||
request.setState(getDisplayState());
|
||||
|
||||
ServerResponse<java.util.List<String>> response = (ServerResponse<java.util.List<String>>) ThriftClient
|
||||
.sendRequest(request);
|
||||
if (response.isError()) {
|
||||
msgStatComp.setMessageText(response.getMessages().get(0),
|
||||
getParent().getDisplay().getSystemColor(SWT.COLOR_RED)
|
||||
.getRGB());
|
||||
}
|
||||
populateTransList(response.getPayload());
|
||||
} catch (VizException e) {
|
||||
msgStatComp.setMessageText(e.getMessage(), getParent().getDisplay()
|
||||
.getSystemColor(SWT.COLOR_RED).getRGB());
|
||||
}
|
||||
}
|
||||
|
||||
Collections.sort(display);
|
||||
|
||||
for (String str : display) {
|
||||
transList.add(str);
|
||||
/**
|
||||
* This takes the payload list of strings and splits them up into the
|
||||
* display list and a hidden list of record ids. Assumes each entry is of
|
||||
* the format: record_id,record_info.
|
||||
*
|
||||
* @param payload
|
||||
*/
|
||||
private void populateTransList(java.util.List<String> payload) {
|
||||
transList.removeAll();
|
||||
transListId.clear();
|
||||
for (String record : payload) {
|
||||
String[] bits = record.split(",");
|
||||
transListId.add(bits[0]);
|
||||
transList.add(bits[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -79,6 +79,8 @@ public class TransmissionViewerDlg extends CaveSWTDialog {
|
|||
protected void initializeComponents(Shell shell) {
|
||||
mainComp = new Composite(shell, SWT.NONE);
|
||||
mainComp.setLayout(new GridLayout(1, false));
|
||||
GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
|
||||
mainComp.setLayoutData(gd);
|
||||
|
||||
// Initialize all of the controls and layouts
|
||||
initializeComponents();
|
||||
|
|
|
@ -130,8 +130,8 @@ public class HelpUsageDlg extends CaveSWTDialog {
|
|||
*/
|
||||
private void createHelpTextControl() {
|
||||
GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
|
||||
gd.heightHint = 300;
|
||||
gd.widthHint = 475;
|
||||
gd.heightHint = 420;
|
||||
gd.widthHint = 600;
|
||||
helpStTxt = new StyledText(shell, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL
|
||||
| SWT.H_SCROLL);
|
||||
helpStTxt.setWordWrap(false);
|
||||
|
|
|
@ -50,4 +50,11 @@
|
|||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="com.raytheon.uf.common.tafqueue"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
</feature>
|
||||
|
|
|
@ -31,6 +31,7 @@ import org.eclipse.ui.IWorkbenchPart;
|
|||
|
||||
import com.raytheon.uf.viz.core.IDisplayPane;
|
||||
import com.raytheon.uf.viz.core.IDisplayPaneContainer;
|
||||
import com.raytheon.uf.viz.core.VizApp;
|
||||
import com.raytheon.uf.viz.core.drawables.IDescriptor.FramesInfo;
|
||||
import com.raytheon.viz.awipstools.common.stormtrack.StormTrackState.DisplayType;
|
||||
import com.raytheon.viz.awipstools.common.stormtrack.StormTrackState.Mode;
|
||||
|
@ -102,11 +103,17 @@ public class StormTrackUIManager extends InputAdapter {
|
|||
container.registerMouseHandler(this);
|
||||
}
|
||||
|
||||
Display display = Display.getCurrent();
|
||||
VizApp.runAsync(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
Display display = getShell().getDisplay();
|
||||
movePolygon = display.getSystemCursor(SWT.CURSOR_SIZEALL);
|
||||
movePoint = display.getSystemCursor(SWT.CURSOR_HAND);
|
||||
arrow = display.getSystemCursor(SWT.CURSOR_ARROW);
|
||||
}
|
||||
});
|
||||
|
||||
movePolygon = new Cursor(display, SWT.CURSOR_SIZEALL);
|
||||
movePoint = new Cursor(display, SWT.CURSOR_HAND);
|
||||
arrow = new Cursor(display, SWT.CURSOR_ARROW);
|
||||
}
|
||||
|
||||
public void dispose() {
|
||||
|
@ -115,9 +122,6 @@ public class StormTrackUIManager extends InputAdapter {
|
|||
container.unregisterMouseHandler(this);
|
||||
}
|
||||
|
||||
movePolygon.dispose();
|
||||
movePoint.dispose();
|
||||
arrow.dispose();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -559,7 +559,8 @@ public class TimeOfArrivalLayer extends AbstractStormTrackResource {
|
|||
*/
|
||||
public void reopenDialog() {
|
||||
// Open the dialog
|
||||
if (dialog == null || dialog.getShell().isDisposed()) {
|
||||
if (dialog == null || dialog.getShell() == null
|
||||
|| dialog.getShell().isDisposed()) {
|
||||
VizApp.runAsync(new Runnable() {
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,51 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
This_software_was_developed_and_/_or_modified_by_Raytheon_Company,
|
||||
pursuant_to_Contract_DG133W-05-CQ-1067_with_the_US_Government.
|
||||
|
||||
U.S._EXPORT_CONTROLLED_TECHNICAL_DATA
|
||||
This_software_product_contains_export-restricted_data_whose
|
||||
export/transfer/disclosure_is_restricted_by_U.S._law._Dissemination
|
||||
to_non-U.S._persons_whether_in_the_United_States_or_abroad_requires
|
||||
an_export_license_or_other_authorization.
|
||||
|
||||
Contractor_Name:________Raytheon_Company
|
||||
Contractor_Address:_____6825_Pine_Street,_Suite_340
|
||||
________________________Mail_Stop_B8
|
||||
________________________Omaha,_NE_68106
|
||||
________________________402.291.0100
|
||||
|
||||
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
|
||||
further_licensing_information.
|
||||
-->
|
||||
<?eclipse version="3.2"?>
|
||||
<plugin>
|
||||
<extension
|
||||
point="com.raytheon.viz.ui.contextualMenu">
|
||||
<contextualMenu
|
||||
actionClass="com.raytheon.viz.core.contours.cmenu.ConvertToImagery"
|
||||
capabilityInterface="com.raytheon.viz.core.contours.ILoadableAsImage"
|
||||
name="Load as Image"
|
||||
sortID="110">
|
||||
</contextualMenu>
|
||||
<contextualMenu
|
||||
actionClass="com.raytheon.viz.core.contours.cmenu.ConvertToStreamlines"
|
||||
capabilityInterface="com.raytheon.viz.core.contours.ILoadableAsStreamline"
|
||||
name="Load as Streamlines"
|
||||
sortID="111">
|
||||
</contextualMenu>
|
||||
<contextualMenu
|
||||
actionClass="com.raytheon.viz.core.contours.cmenu.ConvertToWindBarbs"
|
||||
capabilityInterface="com.raytheon.viz.core.contours.ILoadableAsWindBarbs"
|
||||
name="Load as Wind Barbs"
|
||||
sortID="112">
|
||||
</contextualMenu>
|
||||
<contextualMenu
|
||||
actionClass="com.raytheon.viz.core.contours.cmenu.ConvertToArrows"
|
||||
capabilityInterface="com.raytheon.viz.core.contours.ILoadableAsArrows"
|
||||
name="Load as Arrows"
|
||||
sortID="113">
|
||||
</contextualMenu>
|
||||
</extension>
|
||||
|
||||
</plugin>
|
|
@ -1,52 +0,0 @@
|
|||
/**
|
||||
* This software was developed and / or modified by Raytheon Company,
|
||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
*
|
||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
* This software product contains export-restricted data whose
|
||||
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
* to non-U.S. persons whether in the United States or abroad requires
|
||||
* an export license or other authorization.
|
||||
*
|
||||
* Contractor Name: Raytheon Company
|
||||
* Contractor Address: 6825 Pine Street, Suite 340
|
||||
* Mail Stop B8
|
||||
* Omaha, NE 68106
|
||||
* 402.291.0100
|
||||
*
|
||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.viz.core.contours;
|
||||
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
|
||||
|
||||
/**
|
||||
* TODO Add Description
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jan 6, 2009 mschenke Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author mschenke
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public interface ILoadableAsArrows {
|
||||
/**
|
||||
* Return the corresponding imagery resource
|
||||
*
|
||||
* @return an imagery resource
|
||||
* @throws VizException
|
||||
*/
|
||||
public abstract AbstractVizResource<?, ?> getArrowResource()
|
||||
throws VizException;
|
||||
|
||||
public abstract boolean isArrowVector();
|
||||
}
|
|
@ -1,58 +0,0 @@
|
|||
/**
|
||||
* This software was developed and / or modified by Raytheon Company,
|
||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
*
|
||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
* This software product contains export-restricted data whose
|
||||
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
* to non-U.S. persons whether in the United States or abroad requires
|
||||
* an export license or other authorization.
|
||||
*
|
||||
* Contractor Name: Raytheon Company
|
||||
* Contractor Address: 6825 Pine Street, Suite 340
|
||||
* Mail Stop B8
|
||||
* Omaha, NE 68106
|
||||
* 402.291.0100
|
||||
*
|
||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.viz.core.contours;
|
||||
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
|
||||
|
||||
/**
|
||||
* ILoadableAsImage
|
||||
*
|
||||
* Interface that specifies an imagery resource can be created from an existing
|
||||
* resource
|
||||
*
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Oct 25, 2007 chammack Initial Creation.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author chammack
|
||||
* @version 1
|
||||
*/
|
||||
public interface ILoadableAsImage {
|
||||
|
||||
/**
|
||||
* Return the corresponding imagery resource
|
||||
*
|
||||
* @return an imagery resource
|
||||
* @throws VizException
|
||||
*/
|
||||
public abstract AbstractVizResource<?, ?> getImageryResource()
|
||||
throws VizException;
|
||||
|
||||
public abstract boolean isLoadableAsImage();
|
||||
|
||||
}
|
|
@ -1,58 +0,0 @@
|
|||
/**
|
||||
* This software was developed and / or modified by Raytheon Company,
|
||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
*
|
||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
* This software product contains export-restricted data whose
|
||||
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
* to non-U.S. persons whether in the United States or abroad requires
|
||||
* an export license or other authorization.
|
||||
*
|
||||
* Contractor Name: Raytheon Company
|
||||
* Contractor Address: 6825 Pine Street, Suite 340
|
||||
* Mail Stop B8
|
||||
* Omaha, NE 68106
|
||||
* 402.291.0100
|
||||
*
|
||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.viz.core.contours;
|
||||
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
|
||||
|
||||
/**
|
||||
* ILoadableAsStreamline
|
||||
*
|
||||
* Interface that specifies a streamline resource can be created from an
|
||||
* existing resource
|
||||
*
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Aug 04, 2008 brockwoo Initial Creation.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author brockwoo
|
||||
* @version 1
|
||||
*/
|
||||
public interface ILoadableAsStreamline {
|
||||
|
||||
/**
|
||||
* Return the corresponding imagery resource
|
||||
*
|
||||
* @return an imagery resource
|
||||
* @throws VizException
|
||||
*/
|
||||
public abstract AbstractVizResource<?, ?> getStreamlineResource()
|
||||
throws VizException;
|
||||
|
||||
public abstract boolean isStreamlineVector();
|
||||
|
||||
}
|
|
@ -1,52 +0,0 @@
|
|||
/**
|
||||
* This software was developed and / or modified by Raytheon Company,
|
||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
*
|
||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
* This software product contains export-restricted data whose
|
||||
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
* to non-U.S. persons whether in the United States or abroad requires
|
||||
* an export license or other authorization.
|
||||
*
|
||||
* Contractor Name: Raytheon Company
|
||||
* Contractor Address: 6825 Pine Street, Suite 340
|
||||
* Mail Stop B8
|
||||
* Omaha, NE 68106
|
||||
* 402.291.0100
|
||||
*
|
||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.viz.core.contours;
|
||||
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
|
||||
|
||||
/**
|
||||
* TODO Add Description
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jan 6, 2009 mschenke Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author mschenke
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public interface ILoadableAsWindBarbs {
|
||||
/**
|
||||
* Return the corresponding imagery resource
|
||||
*
|
||||
* @return an imagery resource
|
||||
* @throws VizException
|
||||
*/
|
||||
public abstract AbstractVizResource<?, ?> getWindBarbResource()
|
||||
throws VizException;
|
||||
|
||||
public abstract boolean isWindVector();
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue