13.3.1-1 baseline
Former-commit-id:e0406d3183
[formerly8ae397085e
] [formerly71e8990021
] [formerlye0406d3183
[formerly8ae397085e
] [formerly71e8990021
] [formerlyd2a654625f
[formerly71e8990021
[formerly 34684c71436ce4c395ea523eb34ded6792476816]]]] Former-commit-id:d2a654625f
Former-commit-id:db712e1fcf
[formerlye4435815c9
] [formerly 42269f8019656ea35c9d11244f51d5ae9ac18ac0 [formerly46d28be4a4
]] Former-commit-id: 30806b31de967d82824f245a2f6cb89f081cfd19 [formerlyb3b56830b0
] Former-commit-id:8c828dbd75
This commit is contained in:
parent
7ed1b244e4
commit
fac2d20002
112 changed files with 1188 additions and 514 deletions
|
@ -30,9 +30,29 @@ import com.raytheon.rcm.products.ProductInfo.Selector;
|
|||
import com.raytheon.rcm.products.RadarProduct;
|
||||
import com.raytheon.rcm.products.RadarProduct.Param;
|
||||
|
||||
/**
|
||||
* Representation of an RPS list
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 2009-04-22 #1693 D. Friedman Initial checkin
|
||||
* ...
|
||||
* 2013-01-31 DR 15458 D. Friedman Define UNSPECIFIED_VCP
|
||||
* </pre>
|
||||
*
|
||||
*/
|
||||
@XmlRootElement
|
||||
@XmlAccessorType(XmlAccessType.PROPERTY)
|
||||
public class RpsList implements Cloneable {
|
||||
/**
|
||||
* Indicates an a list that is appropriate for any VCP or an unspecified
|
||||
* VCP.
|
||||
*/
|
||||
public static final int UNSPECIFIED_VCP = -1;
|
||||
|
||||
/* just a guess of what will be useful... */
|
||||
protected int opMode;
|
||||
protected int vcp;
|
||||
|
|
|
@ -58,6 +58,20 @@ import com.raytheon.rcm.server.StatusManager.RadarStatus;
|
|||
/* TODO: Log PRR messages for requests the mgr sent? (RPSHandler::handlePRR)
|
||||
*/
|
||||
|
||||
/**
|
||||
* Manages current RPS lists and requests for changes to RPS lists.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 2009-04-22 #1693 D. Friedman Initial checkin
|
||||
* ...
|
||||
* 2013-01-31 DR 15458 D. Friedman Explicitly handle UNSPECIFIED_VCP.
|
||||
* </pre>
|
||||
*
|
||||
*/
|
||||
public class RPSListManager extends RadarEventAdapter {
|
||||
|
||||
// All RPS list requests will use this for the sequence number.
|
||||
|
@ -149,7 +163,7 @@ public class RPSListManager extends RadarEventAdapter {
|
|||
RadarStatus status = radarServer.getStatusManager().getRadarStatus(
|
||||
radarID);
|
||||
int opMode;
|
||||
int vcp;
|
||||
int currentVCP;
|
||||
int[] gsmCuts;
|
||||
try {
|
||||
byte[] msg = status.getCurrentGSM();
|
||||
|
@ -157,7 +171,7 @@ public class RPSListManager extends RadarEventAdapter {
|
|||
return "Not connected or no status information received yet";
|
||||
GSM gsm = GSM.decode(msg);
|
||||
opMode = gsm.opMode;
|
||||
vcp = gsm.vcp;
|
||||
currentVCP = gsm.vcp;
|
||||
gsmCuts = gsm.cuts;
|
||||
} catch (RuntimeException e) {
|
||||
Log.errorf("Error reading GSM: %s", e);
|
||||
|
@ -165,23 +179,22 @@ public class RPSListManager extends RadarEventAdapter {
|
|||
return "Error getting radar status";
|
||||
}
|
||||
|
||||
int[] cuts = ElevationInfo.getInstance().getScanElevations(radarID, vcp);
|
||||
int[] cuts = ElevationInfo.getInstance().getScanElevations(radarID, currentVCP);
|
||||
if (cuts == null && Util.getRadarType(rc) == RadarType.WSR)
|
||||
cuts = gsmCuts;
|
||||
|
||||
// TODO: INVALID_VCP
|
||||
if (list.getVcp() > 0 && list.getVcp() != vcp) {
|
||||
if (list.getVcp() != RpsList.UNSPECIFIED_VCP && list.getVcp() != currentVCP) {
|
||||
if (store)
|
||||
return null; // TODO: Should warn instead.
|
||||
else
|
||||
return String.format("RPS list for VCP %d. Current VCP is %d",
|
||||
list.getVcp(), vcp);
|
||||
list.getVcp(), currentVCP);
|
||||
}
|
||||
|
||||
list = (RpsList) list.clone();
|
||||
list.setVcp(vcp);
|
||||
list.setVcp(currentVCP);
|
||||
|
||||
list = getMergedRpsListForRadar(rc, opMode, vcp, cuts, list);
|
||||
list = getMergedRpsListForRadar(rc, opMode, currentVCP, cuts, list);
|
||||
if (list != null) {
|
||||
// TODO: Should persist this
|
||||
currentRpsLists.put(rc.getRadarID(), (RpsList) list.clone());
|
||||
|
|
|
@ -32,6 +32,13 @@
|
|||
# 2005/07/29 - Version 0.1 - updated grid database structure
|
||||
# 2006/11/06 - Version 1.0 - no changes - just part of BOIVerify upgrade
|
||||
# 2007/10/25 - Version 2.0 - no changes - just part of BOIVerify upgrade
|
||||
#
|
||||
# SOFTWARE HISTORY
|
||||
#
|
||||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# 1/30/13 15536 ryu Made necessary changes to get tool to run
|
||||
#
|
||||
# ----------------------------------------------------------------------------
|
||||
ToolType = "numeric"
|
||||
WeatherElementEdited = "None"
|
||||
|
@ -75,10 +82,11 @@ class Tool (SmartScript.SmartScript):
|
|||
processVarList=ProcessVariableList.ProcessVariableList(
|
||||
"Pick Model",VList,varReturn)
|
||||
status=processVarList.status()
|
||||
if status != "Ok":
|
||||
if status.lower() != "ok":
|
||||
self.docancel=1
|
||||
return
|
||||
self.modelName=varReturn["Model:"]
|
||||
|
||||
#
|
||||
# Remove any current VER grids from gridManager
|
||||
#
|
||||
|
@ -86,7 +94,7 @@ class Tool (SmartScript.SmartScript):
|
|||
parmList = self._dbss.getParmManager().getDisplayedParms()
|
||||
for parm in parmList:
|
||||
pid=parm.getParmID()
|
||||
pmodel = pid.getDbID().getModelId()
|
||||
pmodel = pid.getDbId().getModelId()
|
||||
name=pid.getParmName()
|
||||
level=pid.getParmLevel()
|
||||
if pmodel == "Ver":
|
||||
|
@ -102,7 +110,7 @@ class Tool (SmartScript.SmartScript):
|
|||
def execute(self,WEname,GridTimeRange):
|
||||
"Show history of grids over time"
|
||||
self.VU.logMsg(" executing for time:%s"%GridTimeRange)
|
||||
mutableModel=self.mutableID().model()
|
||||
mutableModel=self.mutableID().modelName()
|
||||
tomorrow=time.time()+86400
|
||||
parm=WEname
|
||||
self.VU.logMsg(" running for parm:%s"%parm)
|
||||
|
@ -111,7 +119,7 @@ class Tool (SmartScript.SmartScript):
|
|||
# Get the color table and range for the parm
|
||||
#
|
||||
(self.parmUnits,self.parmPrecision,self.parmMinval,self.parmMaxval,
|
||||
self.parmColorTable,self.parmDisplayMinval,
|
||||
self.parmRateFlag,self.parmColorTable,self.parmDisplayMinval,
|
||||
self.parmDisplayMaxval)=self.getParmInfo(mutableModel,WEname)
|
||||
#
|
||||
# Get start/end of current timerange and get verification
|
||||
|
@ -124,6 +132,7 @@ class Tool (SmartScript.SmartScript):
|
|||
# Loop over verification model records
|
||||
#
|
||||
for rec in recs:
|
||||
rec = int(rec)
|
||||
self.VU.logMsg("rec=%d"%rec)
|
||||
#
|
||||
# read grid - clip to min/max for this parm
|
||||
|
@ -159,16 +168,19 @@ class Tool (SmartScript.SmartScript):
|
|||
self.parmMaxval,self.parmUnits)
|
||||
|
||||
self.setActiveElement("Ver",parmname,"SFC",GridTimeRange,
|
||||
self.parmColorTable,(self.parmDisplayMinval,
|
||||
self.parmDisplayMaxval),0)
|
||||
self.parmColorTable,(float(self.parmDisplayMinval),
|
||||
float(self.parmDisplayMaxval)),0)
|
||||
return
|
||||
#==================================================================
|
||||
#
|
||||
# getParmInfo - get information on a parm (units, precision, minval,
|
||||
# maxval, colortablename, displayminval, displaymaxval)
|
||||
# from the database specified
|
||||
#
|
||||
|
||||
def getParmInfo(self,mutableModel,parm):
|
||||
units="units"
|
||||
precision=0
|
||||
minval=0
|
||||
maxval=100
|
||||
rateflag=0
|
||||
colorTable="Gridded Data"
|
||||
displayMinval=0
|
||||
displayMaxval=100
|
||||
parm=self.getParm(mutableModel,parm,"SFC")
|
||||
if parm is not None:
|
||||
parmInfo = parm.getGridInfo()
|
||||
|
@ -176,15 +188,11 @@ class Tool (SmartScript.SmartScript):
|
|||
precision=parmInfo.getPrecision()
|
||||
minval=parmInfo.getMinValue()
|
||||
maxval=parmInfo.getMaxValue()
|
||||
|
||||
colorTable="Gridded Data"
|
||||
displayMinval=0
|
||||
displayMaxval=100
|
||||
rateflag=parmInfo.isRateParm()
|
||||
from com.raytheon.viz.gfe.rsc import DiscreteDisplayUtil
|
||||
ctInfo = DiscreteDisplayUtil.buildColorMapParameters(parm)
|
||||
if ctInfo is not None:
|
||||
colorTable = ctInfo.getColorMapName()
|
||||
displayMinval = ctInfo.getColorMapMin()
|
||||
displayMaxVal = ctInfo.getColorMapMax()
|
||||
|
||||
return(units,precision,minval,maxval,colorTable,displayMinval,displayMaxval)
|
||||
colorTable = ctInfo.getColorMapName()
|
||||
displayMinval = ctInfo.getColorMapMin()
|
||||
displayMaxval = ctInfo.getColorMapMax()
|
||||
return(units,precision,minval,maxval,rateflag,colorTable,displayMinval,displayMaxval)
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
@ -175,7 +175,7 @@ class TextUtils:
|
|||
# Return 1 if any of the searchKeys are found in subkeys
|
||||
wxSize = len(subkeys)
|
||||
wxStr = ""
|
||||
for x in range(wxSize):
|
||||
for x in range(wxSize):
|
||||
wxStr += str(subkeys[x])
|
||||
if x < wxSize - 1:
|
||||
wxStr += '^'
|
||||
|
@ -253,7 +253,7 @@ class TextUtils:
|
|||
return 0.0
|
||||
countAbove = 0
|
||||
|
||||
for histSample in parmHisto.histoSamples():
|
||||
for histSample in parmHisto.histoSamples():
|
||||
for histPair in histSample.histogram():
|
||||
if histPair.value().scalar() > value:
|
||||
countAbove = countAbove + histPair.count()
|
||||
|
@ -418,7 +418,7 @@ class TextUtils:
|
|||
if index == -1:
|
||||
name = parmNameAndLevel
|
||||
level = "SFC"
|
||||
parm = ParmID(name,databaseID,level)
|
||||
parm = ParmID(name,databaseID,level)
|
||||
else:
|
||||
name = parmNameAndLevel[0:index]
|
||||
level = parmNameAndLevel[index+1:]
|
||||
|
@ -674,11 +674,11 @@ class TextUtils:
|
|||
|
||||
def getPreviousProduct(self, productID, searchString="", version=0):
|
||||
# gets a previous product from the AWIPS database
|
||||
|
||||
from com.raytheon.viz.gfe.core import DataManager
|
||||
|
||||
from com.raytheon.viz.gfe.product import TextDBUtil
|
||||
|
||||
opMode = DataManager.getCurrentInstance().getOpMode().name() == "OPERATIONAL"
|
||||
|
||||
# DR 15703 - always retrieve operational products
|
||||
opMode = True
|
||||
previousProduct = TextDBUtil.retrieveProduct(productID, version, opMode)
|
||||
previousProduct = string.strip(previousProduct)
|
||||
|
||||
|
|
|
@ -17,7 +17,8 @@ Require-Bundle: org.eclipse.ui,
|
|||
com.raytheon.uf.common.pointdata;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.viz.productbrowser;bundle-version="1.12.1152",
|
||||
com.raytheon.uf.viz.core.rsc;bundle-version="1.0.0",
|
||||
com.raytheon.uf.viz.ui.menus;bundle-version="1.12.1174"
|
||||
com.raytheon.uf.viz.ui.menus;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.viz.localization;bundle-version="1.12.1174"
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Eclipse-RegisterBuddy: com.raytheon.uf.viz.core
|
||||
|
|
|
@ -100,4 +100,14 @@
|
|||
</contextId>
|
||||
</classContext>
|
||||
</extension>
|
||||
<extension
|
||||
point="com.raytheon.uf.viz.localization.localizationpath">
|
||||
<path
|
||||
application="CAVE"
|
||||
localizationType="CAVE_STATIC"
|
||||
name="Map Styles"
|
||||
recursive="false"
|
||||
value="mapStyles">
|
||||
</path>
|
||||
</extension>
|
||||
</plugin>
|
||||
|
|
|
@ -29,11 +29,14 @@ import javax.xml.bind.annotation.XmlAccessorType;
|
|||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.XmlTransient;
|
||||
|
||||
import com.raytheon.uf.common.localization.FileUpdatedMessage;
|
||||
import com.raytheon.uf.common.localization.ILocalizationFileObserver;
|
||||
import com.raytheon.uf.common.localization.IPathManager;
|
||||
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
|
||||
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
|
||||
import com.raytheon.uf.common.localization.LocalizationFile;
|
||||
import com.raytheon.uf.common.localization.PathManagerFactory;
|
||||
import com.raytheon.uf.common.localization.exception.LocalizationException;
|
||||
import com.raytheon.uf.common.serialization.ISerializableObject;
|
||||
import com.raytheon.uf.common.serialization.SerializationException;
|
||||
import com.raytheon.uf.common.serialization.SerializationUtil;
|
||||
|
@ -51,6 +54,9 @@ import com.raytheon.uf.viz.core.rsc.capabilities.Capabilities;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* May 7, 2010 randerso Initial creation
|
||||
* Jan 25, 2013 DR 15649 D. Friedman Clone capabilities in get/put.
|
||||
* Stored preferences in a sub-directory
|
||||
* and observe changes.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -64,7 +70,9 @@ public class MapStylePreferenceStore implements ISerializableObject {
|
|||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(MapStylePreferenceStore.class);
|
||||
|
||||
private static final String MAPSTYLE_FILENAME = "mapstylepreferences.xml";
|
||||
private static final String MAPSTYLE_FILENAME = "mapStyles/mapstylepreferences.xml";
|
||||
|
||||
private static final String OLD_MAPSTYLE_FILENAME = "mapstylepreferences.xml";
|
||||
|
||||
private static class MapStylePreferenceKey {
|
||||
private String perspective;
|
||||
|
@ -166,21 +174,72 @@ public class MapStylePreferenceStore implements ISerializableObject {
|
|||
|
||||
private Map<MapStylePreferenceKey, Capabilities> preferences;
|
||||
|
||||
@XmlTransient
|
||||
LocalizationFile siteLf, userLf;
|
||||
|
||||
@XmlTransient
|
||||
boolean needToLoad = true;
|
||||
|
||||
public static MapStylePreferenceStore load() {
|
||||
MapStylePreferenceStore store = new MapStylePreferenceStore();
|
||||
store.loadFiles();
|
||||
return store;
|
||||
}
|
||||
|
||||
private synchronized void loadFiles() {
|
||||
if (needToLoad)
|
||||
needToLoad = false;
|
||||
else
|
||||
return;
|
||||
|
||||
IPathManager pathMgr = PathManagerFactory.getPathManager();
|
||||
|
||||
LocalizationFile siteLf = pathMgr.getLocalizationFile(pathMgr
|
||||
.getContext(LocalizationType.CAVE_STATIC,
|
||||
LocalizationLevel.SITE), MAPSTYLE_FILENAME);
|
||||
if (siteLf == null) {
|
||||
siteLf = pathMgr.getLocalizationFile(pathMgr
|
||||
.getContext(LocalizationType.CAVE_STATIC,
|
||||
LocalizationLevel.SITE), MAPSTYLE_FILENAME);
|
||||
|
||||
LocalizationFile userLf = pathMgr.getLocalizationFile(pathMgr
|
||||
.getContext(LocalizationType.CAVE_STATIC,
|
||||
LocalizationLevel.USER), MAPSTYLE_FILENAME);
|
||||
userLf = pathMgr.getLocalizationFile(pathMgr
|
||||
.getContext(LocalizationType.CAVE_STATIC,
|
||||
LocalizationLevel.USER), MAPSTYLE_FILENAME);
|
||||
|
||||
ILocalizationFileObserver obs = new ILocalizationFileObserver() {
|
||||
@Override
|
||||
public void fileUpdated(FileUpdatedMessage message) {
|
||||
synchronized (MapStylePreferenceStore.this) {
|
||||
needToLoad = true;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
siteLf.addFileUpdatedObserver(obs);
|
||||
userLf.addFileUpdatedObserver(obs);
|
||||
|
||||
/* DR 15649 for OB 13.3.1: If the map style preferences are in the
|
||||
* old location, move it to the correct place. This code can be
|
||||
* removed in the future.
|
||||
*/
|
||||
if (! userLf.exists()) {
|
||||
LocalizationFile oldUserLf = pathMgr.getLocalizationFile(pathMgr
|
||||
.getContext(LocalizationType.CAVE_STATIC,
|
||||
LocalizationLevel.USER), OLD_MAPSTYLE_FILENAME);
|
||||
|
||||
if (oldUserLf.exists()) {
|
||||
try {
|
||||
userLf.write(oldUserLf.read());
|
||||
oldUserLf.delete();
|
||||
statusHandler.handle(Priority.INFO, "Moved user map style preferences to new location");
|
||||
} catch (LocalizationException e) {
|
||||
statusHandler.handle(Priority.PROBLEM, "Unable to move map style preferences", e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MapStylePreferenceStore store = new MapStylePreferenceStore();
|
||||
if (siteLf.exists()) {
|
||||
try {
|
||||
store.combinedPreferences = ((MapStylePreferenceStore) SerializationUtil
|
||||
combinedPreferences = ((MapStylePreferenceStore) SerializationUtil
|
||||
.jaxbUnmarshalFromXmlFile(siteLf.getFile())).preferences;
|
||||
} catch (SerializationException e) {
|
||||
statusHandler
|
||||
|
@ -189,18 +248,18 @@ public class MapStylePreferenceStore implements ISerializableObject {
|
|||
e);
|
||||
}
|
||||
} else {
|
||||
store.combinedPreferences = new HashMap<MapStylePreferenceKey, Capabilities>();
|
||||
combinedPreferences = new HashMap<MapStylePreferenceKey, Capabilities>();
|
||||
}
|
||||
|
||||
if (userLf.exists()) {
|
||||
try {
|
||||
store.preferences = ((MapStylePreferenceStore) SerializationUtil
|
||||
preferences = ((MapStylePreferenceStore) SerializationUtil
|
||||
.jaxbUnmarshalFromXmlFile(userLf.getFile())).preferences;
|
||||
|
||||
// merge user into site
|
||||
for (Entry<MapStylePreferenceKey, Capabilities> entry : store.preferences
|
||||
for (Entry<MapStylePreferenceKey, Capabilities> entry : preferences
|
||||
.entrySet()) {
|
||||
store.combinedPreferences.put(entry.getKey(),
|
||||
combinedPreferences.put(entry.getKey(),
|
||||
entry.getValue());
|
||||
}
|
||||
|
||||
|
@ -211,31 +270,34 @@ public class MapStylePreferenceStore implements ISerializableObject {
|
|||
e);
|
||||
}
|
||||
} else {
|
||||
store.preferences = new HashMap<MapStylePreferenceKey, Capabilities>();
|
||||
preferences = new HashMap<MapStylePreferenceKey, Capabilities>();
|
||||
}
|
||||
|
||||
return store;
|
||||
}
|
||||
|
||||
private MapStylePreferenceStore() {
|
||||
}
|
||||
|
||||
public Capabilities get(String perspective, String mapName) {
|
||||
public synchronized Capabilities get(String perspective, String mapName) {
|
||||
MapStylePreferenceKey key = new MapStylePreferenceKey(perspective,
|
||||
mapName);
|
||||
|
||||
loadFiles();
|
||||
|
||||
Capabilities value = combinedPreferences.get(key);
|
||||
if (value == null) {
|
||||
value = new Capabilities();
|
||||
}
|
||||
} else
|
||||
value = value.clone();
|
||||
return value;
|
||||
}
|
||||
|
||||
public Capabilities put(String perspective, String mapName,
|
||||
public synchronized Capabilities put(String perspective, String mapName,
|
||||
Capabilities value) {
|
||||
MapStylePreferenceKey key = new MapStylePreferenceKey(perspective,
|
||||
mapName);
|
||||
|
||||
value = value.clone();
|
||||
|
||||
Capabilities oldValue = combinedPreferences.put(key, value);
|
||||
preferences.put(key, value);
|
||||
|
||||
|
|
|
@ -29,6 +29,22 @@ import com.raytheon.uf.viz.core.rsc.sampling.LatLonReadoutResource;
|
|||
import com.raytheon.uf.viz.core.sampling.ISamplingResource;
|
||||
import com.raytheon.viz.ui.cmenu.AbstractRightClickAction;
|
||||
|
||||
/**
|
||||
*
|
||||
* Enable or Disable Lat/Lon display on an editor
|
||||
*
|
||||
* <pre>
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jun 1, 2007 chammack Initial Creation.
|
||||
* Jan 28, 2013 14465 snaples Updated run() method to set sampling false when disabling readout.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author chammack
|
||||
* @version 1.0
|
||||
*/
|
||||
public class LatLonReadoutAction extends AbstractRightClickAction {
|
||||
|
||||
/*
|
||||
|
@ -36,7 +52,9 @@ public class LatLonReadoutAction extends AbstractRightClickAction {
|
|||
*
|
||||
* @see org.eclipse.jface.action.Action#run()
|
||||
*/
|
||||
private String actionText;
|
||||
private final String actionText;
|
||||
|
||||
private boolean sampled = false;
|
||||
|
||||
private boolean hasLatLonReadout = false;
|
||||
|
||||
|
@ -64,9 +82,20 @@ public class LatLonReadoutAction extends AbstractRightClickAction {
|
|||
for (LatLonReadoutResource rsc : rscs) {
|
||||
pane.getDescriptor().getResourceList().removeRsc(rsc);
|
||||
}
|
||||
List<ISamplingResource> samplers = pane.getDescriptor()
|
||||
.getResourceList()
|
||||
.getResourcesByTypeAsType(ISamplingResource.class);
|
||||
for (ISamplingResource sampler : samplers) {
|
||||
if (sampled) {
|
||||
break;
|
||||
} else {
|
||||
sampler.setSampling(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// add resource
|
||||
sampled = false;
|
||||
for (IDisplayPane pane : container.getDisplayPanes()) {
|
||||
pane.getDescriptor()
|
||||
.getResourceList()
|
||||
|
@ -79,7 +108,12 @@ public class LatLonReadoutAction extends AbstractRightClickAction {
|
|||
.getResourceList()
|
||||
.getResourcesByTypeAsType(ISamplingResource.class);
|
||||
for (ISamplingResource sampler : samplers) {
|
||||
sampler.setSampling(true);
|
||||
if (sampler.isSampling()) {
|
||||
sampled = true;
|
||||
break;
|
||||
} else {
|
||||
sampler.setSampling(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -984,7 +984,7 @@ PVU |1e5| 0.0 | 4 | | |..|8000F0FF| |16| \
|
|||
<parameter>MpV</parameter>
|
||||
</paramLevelMatches>
|
||||
<contourStyle>
|
||||
<displayUnits label="PVU">K/hPa/s</displayUnits>
|
||||
<displayUnits label="PVU">K/hPa/s*1.0E-5</displayUnits>
|
||||
<contourLabeling labelSpacing="4">
|
||||
<values>-1 -.5 -.1 0 1 1.5 2 3 4 5 6 8 10 12 15 20</values>
|
||||
</contourLabeling>
|
||||
|
|
|
@ -36,8 +36,6 @@ import org.eclipse.swt.events.MouseAdapter;
|
|||
import org.eclipse.swt.events.MouseEvent;
|
||||
import org.eclipse.swt.events.SelectionAdapter;
|
||||
import org.eclipse.swt.events.SelectionEvent;
|
||||
import org.eclipse.swt.events.ShellAdapter;
|
||||
import org.eclipse.swt.events.ShellEvent;
|
||||
import org.eclipse.swt.graphics.Font;
|
||||
import org.eclipse.swt.graphics.Point;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
|
@ -46,10 +44,11 @@ import org.eclipse.swt.layout.RowData;
|
|||
import org.eclipse.swt.layout.RowLayout;
|
||||
import org.eclipse.swt.widgets.Button;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.eclipse.swt.widgets.Event;
|
||||
import org.eclipse.swt.widgets.Label;
|
||||
import org.eclipse.swt.widgets.Layout;
|
||||
import org.eclipse.swt.widgets.List;
|
||||
import org.eclipse.swt.widgets.Listener;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
import com.raytheon.uf.common.localization.IPathManager;
|
||||
|
@ -99,6 +98,8 @@ import com.raytheon.viz.ui.editor.AbstractEditor;
|
|||
* Oct 16, 2012 1229 rferrel Changes for non-blocking AlterBundleDlg.
|
||||
* Oct 16, 2012 1229 rferrel Changes to have displayDialog method.
|
||||
* Oct 16, 2012 1229 rferrel Changes for non-blocking ProcedureListDlg.
|
||||
* Jan 15, 2013 DR 15699 D. Friedman Prompt for save when close button clicked.
|
||||
* Jan 16, 2013 DR 15367 D. Friedman Enable save button for Up/Down changes.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -217,6 +218,15 @@ public class ProcedureDlg extends CaveSWTDialog {
|
|||
this.bundles.add(bp);
|
||||
}
|
||||
}
|
||||
|
||||
addListener(SWT.Close, new Listener() {
|
||||
|
||||
@Override
|
||||
public void handleEvent(Event event) {
|
||||
handleCloseRequest();
|
||||
event.doit = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -335,16 +345,13 @@ public class ProcedureDlg extends CaveSWTDialog {
|
|||
|
||||
ProcedureComm.getInstance().addCopyOutListener(copyOutListener);
|
||||
|
||||
shell.addShellListener(new ShellAdapter() {
|
||||
|
||||
addListener(SWT.Dispose, new Listener() {
|
||||
@Override
|
||||
public void shellClosed(ShellEvent arg0) {
|
||||
public void handleEvent(Event event) {
|
||||
ProcedureComm.getInstance().removeCopyOutListener(
|
||||
copyOutListener);
|
||||
ProcedureComm.getInstance().removeCopyOutStateListener(
|
||||
changeListener);
|
||||
|
||||
font.dispose();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -393,7 +400,7 @@ public class ProcedureDlg extends CaveSWTDialog {
|
|||
|
||||
}
|
||||
|
||||
private void saveProcedure() {
|
||||
private void saveProcedure(boolean closeAfterSave) {
|
||||
try {
|
||||
IPathManager pm = PathManagerFactory.getPathManager();
|
||||
|
||||
|
@ -437,6 +444,9 @@ public class ProcedureDlg extends CaveSWTDialog {
|
|||
shell.setText("Procedure - " + fileName);
|
||||
saved = true;
|
||||
saveBtn.setEnabled(false);
|
||||
|
||||
if (closeAfterSave)
|
||||
close();
|
||||
} catch (Exception e) {
|
||||
final String errMsg = "Error occurred during procedure save.";
|
||||
statusHandler.handle(Priority.PROBLEM, errMsg, e);
|
||||
|
@ -497,6 +507,8 @@ public class ProcedureDlg extends CaveSWTDialog {
|
|||
bundles.add(idx - 1, b);
|
||||
dataList.setSelection(idx - 1);
|
||||
resyncProcedureAndList();
|
||||
saved = false;
|
||||
saveBtn.setEnabled(true);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -520,6 +532,8 @@ public class ProcedureDlg extends CaveSWTDialog {
|
|||
bundles.add(idx + 1, b);
|
||||
dataList.setSelection(idx + 1);
|
||||
resyncProcedureAndList();
|
||||
saved = false;
|
||||
saveBtn.setEnabled(true);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -779,11 +793,7 @@ public class ProcedureDlg extends CaveSWTDialog {
|
|||
saveBtn.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
if (fileName == null) {
|
||||
showSaveAsDlg();
|
||||
} else {
|
||||
saveProcedure();
|
||||
}
|
||||
handleSaveRequest(false);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -795,7 +805,7 @@ public class ProcedureDlg extends CaveSWTDialog {
|
|||
saveAsBtn.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
showSaveAsDlg();
|
||||
showSaveAsDlg(false);
|
||||
}
|
||||
});
|
||||
gd = new GridData(SWT.CENTER, SWT.DEFAULT, true, false);
|
||||
|
@ -806,11 +816,7 @@ public class ProcedureDlg extends CaveSWTDialog {
|
|||
closeBtn.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
if (saved) {
|
||||
shell.close();
|
||||
} else {
|
||||
showConfirmSaveDlg();
|
||||
}
|
||||
handleCloseRequest();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -902,7 +908,7 @@ public class ProcedureDlg extends CaveSWTDialog {
|
|||
try {
|
||||
// Load was issued in alterBundleDlg
|
||||
bp.xml = b.toXML();
|
||||
saveProcedure();
|
||||
saveProcedure(false);
|
||||
load(b);
|
||||
} catch (VizException e) {
|
||||
final String err = "Error altering bundle";
|
||||
|
@ -921,7 +927,15 @@ public class ProcedureDlg extends CaveSWTDialog {
|
|||
}
|
||||
}
|
||||
|
||||
private void showSaveAsDlg() {
|
||||
private void handleSaveRequest(boolean closeAfterSave) {
|
||||
if (fileName == null) {
|
||||
showSaveAsDlg(closeAfterSave);
|
||||
} else {
|
||||
saveProcedure(closeAfterSave);
|
||||
}
|
||||
}
|
||||
|
||||
private void showSaveAsDlg(final boolean closeAfterSave) {
|
||||
if (mustCreate(saveAsDlg)) {
|
||||
saveAsDlg = new ProcedureListDlg("Save Procedure As...", shell,
|
||||
ProcedureListDlg.Mode.SAVE);
|
||||
|
@ -946,7 +960,7 @@ public class ProcedureDlg extends CaveSWTDialog {
|
|||
|
||||
frozen = saveAsDlg.isFrozen();
|
||||
fileName = fn;
|
||||
saveProcedure();
|
||||
saveProcedure(closeAfterSave);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -956,15 +970,25 @@ public class ProcedureDlg extends CaveSWTDialog {
|
|||
}
|
||||
}
|
||||
|
||||
private void handleCloseRequest()
|
||||
{
|
||||
if (saved) {
|
||||
close();
|
||||
} else {
|
||||
showConfirmSaveDlg();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Confirm save dialog, for if the user hasn't saved the procedure but tries
|
||||
* to close it
|
||||
*/
|
||||
private void showConfirmSaveDlg() {
|
||||
CaveSWTDialog dlg = new CaveSWTDialog(shell, SWT.DIALOG_TRIM, CAVE.NONE) {
|
||||
CaveSWTDialog dlg = new CaveSWTDialog(shell, SWT.DIALOG_TRIM | SWT.PRIMARY_MODAL, CAVE.DO_NOT_BLOCK) {
|
||||
|
||||
@Override
|
||||
protected void initializeComponents(Shell shell) {
|
||||
final CaveSWTDialog self = this;
|
||||
shell.setText("Confirm Save");
|
||||
|
||||
/*
|
||||
|
@ -983,10 +1007,8 @@ public class ProcedureDlg extends CaveSWTDialog {
|
|||
|
||||
Label label = new Label(imageLblComp, SWT.NONE);
|
||||
|
||||
if (fileName == null) {
|
||||
fileName = "untitled";
|
||||
}
|
||||
label.setText("The procedure \"(" + fileName
|
||||
label.setText("The procedure \"("
|
||||
+ (fileName != null ? fileName : "untitled")
|
||||
+ ")\"\ncontains unsaved data.\nSave before closing?");
|
||||
label.setData(gridData);
|
||||
|
||||
|
@ -1011,8 +1033,8 @@ public class ProcedureDlg extends CaveSWTDialog {
|
|||
yes.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
Display.getCurrent().getActiveShell().dispose();
|
||||
showSaveAsDlg();
|
||||
self.close();
|
||||
handleSaveRequest(true);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -1026,15 +1048,7 @@ public class ProcedureDlg extends CaveSWTDialog {
|
|||
no.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
Composite composite = Display.getCurrent()
|
||||
.getActiveShell().getParent();
|
||||
if (composite instanceof Shell) {
|
||||
Shell shell = (Shell) composite;
|
||||
shell.close();
|
||||
} else {
|
||||
Display.getCurrent().getActiveShell().getParent()
|
||||
.dispose();
|
||||
}
|
||||
ProcedureDlg.this.close();
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -1048,7 +1062,7 @@ public class ProcedureDlg extends CaveSWTDialog {
|
|||
cancel.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
Display.getCurrent().getActiveShell().dispose();
|
||||
self.close();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -16,6 +16,15 @@
|
|||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
#
|
||||
# Software History
|
||||
#
|
||||
# 2013/1/17 DR 15655 Melissa Porricelli Modified final 'result'
|
||||
# calculation to remove multiplication
|
||||
# by 0.5. Displayed values were
|
||||
# off by a factor of this amount
|
||||
# in comparison to A1.
|
||||
# A1 calc in pvpres.f.
|
||||
###
|
||||
|
||||
from numpy import zeros
|
||||
|
@ -72,7 +81,7 @@ def execute(t_up, t_lo, p_up, p_lo, vector_up, vector_lo, dx, dy, coriolis):
|
|||
dtdy = dtdy1 + dtdy2
|
||||
av = avort1 + avort2
|
||||
|
||||
result = (-0.5 * (av*dt + (du*dtdy - dv*dtdx)) / dp)*.5
|
||||
result = (-0.5 * (av*dt + (du*dtdy - dv*dtdx)) / dp)
|
||||
|
||||
return result
|
||||
|
||||
|
|
|
@ -19,9 +19,29 @@
|
|||
further_licensing_information.
|
||||
-->
|
||||
<DerivedParameter name="Precip Type" abbreviation="PTyp" xmlns:ns2="group">
|
||||
<Method levels="Surface" name="Alias">
|
||||
<Field abbreviation="SPT"/>
|
||||
</Method>
|
||||
<Method name="Mapping" levels="Surface">
|
||||
<Field level="Surface" abbreviation="SPT" />
|
||||
<ConstantField value="1" />
|
||||
<ConstantField value="79" />
|
||||
|
||||
<ConstantField value="2" />
|
||||
<ConstantField value="89" />
|
||||
|
||||
<ConstantField value="3" />
|
||||
<ConstantField value="71" />
|
||||
|
||||
<ConstantField value="4" />
|
||||
<ConstantField value="77" />
|
||||
|
||||
<ConstantField value="5" />
|
||||
<ConstantField value="80" />
|
||||
|
||||
<ConstantField value="6" />
|
||||
<ConstantField value="67" />
|
||||
|
||||
<ConstantField value="7" />
|
||||
<ConstantField value="69" />
|
||||
</Method>
|
||||
<Method levels="Surface" name="PTyp.execute1">
|
||||
<Field level="Station" abbreviation="precipType"/>
|
||||
<Field level="Station" abbreviation="POP_hour_bestCat"/>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
|
||||
further_licensing_information.
|
||||
-->
|
||||
<DerivedParameter unit="K/hPa/s*1.0E5" name="Equiv Pot Vort" abbreviation="pVeq" xmlns:ns2="group">
|
||||
<DerivedParameter unit="K/hPa/s" name="Equiv Pot Vort" abbreviation="pVeq" xmlns:ns2="group">
|
||||
<Method levels="S,MB,K" name="PotVortMB">
|
||||
<Field level="upper" abbreviation="EPT"/>
|
||||
<Field abbreviation="EPT"/>
|
||||
|
@ -41,4 +41,4 @@
|
|||
<Field abbreviation="dy"/>
|
||||
<Field abbreviation="coriolis"/>
|
||||
</Method>
|
||||
</DerivedParameter>
|
||||
</DerivedParameter>
|
|
@ -32,5 +32,6 @@
|
|||
<Method levels="Layer" name="Multiply">
|
||||
<Field level="0-3kmAgl" abbreviation="RH"/>
|
||||
<Field abbreviation="PW"/>
|
||||
<ConstantField value="0.01" />
|
||||
</Method>
|
||||
</DerivedParameter>
|
||||
|
|
|
@ -105,7 +105,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
|||
* Changes for non-blocking AttributesDlg.
|
||||
* Changes for non-blocking AttributeThresholdDlg.
|
||||
* Changes for non-blocking LoadSaveConfigDlg.
|
||||
*
|
||||
* Jan 23, 2013 14907 gzhang GUID not in Thresholds menu even ColorCell true
|
||||
* </pre>
|
||||
*
|
||||
* @author lvenable
|
||||
|
@ -1038,7 +1038,7 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
|
|||
|
||||
// Loop over enum from config singleton to create menu items
|
||||
for (ThreshColNames colName : ThreshColNames.values()) {
|
||||
if (ffmpConfig.isColorCell(colName)) {
|
||||
if (ffmpConfig.isColorCell(colName) && (colName != ThreshColNames.GUID)) {// DR 14907
|
||||
// only add a menu item if colorCell is true
|
||||
MenuItem mi = new MenuItem(popupMenu, SWT.NONE);
|
||||
mi.setText(colName.name());
|
||||
|
|
|
@ -51,6 +51,7 @@ import com.raytheon.uf.viz.monitor.thresholds.AbstractThresholdMgr;
|
|||
* Dec 24, 2009 3424 zhao added getTrendDataSet() that returns ObTrendDataSet object
|
||||
* Jan 25, 2010 4281, 3888, 3877 wkwock/zhao added getHistTableData method
|
||||
* Oct.31, 2012 1297 skorolev Clean code.
|
||||
* Jan. 29, 2013 15654 zhao add Wind Chill calculation for SNOW
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -146,6 +147,16 @@ public class ObMultiHrsReports {
|
|||
report.setDewpointDepr(report.getTemperature()
|
||||
- report.getDewpoint());
|
||||
}
|
||||
/**
|
||||
* DR15654: set Wind Chill for SNOW
|
||||
*/
|
||||
if ( appName == AppName.SNOW ) {
|
||||
if ( report.getTemperature() != ObConst.MISSING && report.getWindSpeed() != ObConst.MISSING ) {
|
||||
report.setWindChill(calcWindChill( report.getTemperature(), report.getWindSpeed() ));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (multiHrsReports.containsKey(nominalTime)) {
|
||||
multiHrsReports.get(nominalTime).addReport(report);
|
||||
} else {
|
||||
|
@ -161,7 +172,28 @@ public class ObMultiHrsReports {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* DR 15654:
|
||||
* Wind Chill calculation formula based on
|
||||
* http://www.nws.noaa.gov/om/windchill/
|
||||
* as of Jan. 29, 2013
|
||||
*
|
||||
* @param temperature in degree F
|
||||
* @param windSpeed in knots
|
||||
* @return wind chill in degree F
|
||||
*/
|
||||
private float calcWindChill(float temp, float windSpd) {
|
||||
if ( temp > 50.0 || windSpd < 3.0 ) {
|
||||
return ObConst.MISSING;
|
||||
}
|
||||
/**
|
||||
* 1 knots = 1.15078 mph
|
||||
*/
|
||||
float spd = (float) Math.pow(1.15078*windSpd, 0.16);
|
||||
return 35.74f + 0.6215f*temp - 35.75f*spd + 0.4275f*temp*spd;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a zone TableData object of the latest nominal time. If no data
|
||||
* available (the map is empty), returns an empty zone TableData object
|
||||
* (table cells filled with "N/A").
|
||||
|
|
|
@ -98,6 +98,21 @@ import com.raytheon.uf.viz.radarapps.client.RcmWaiter;
|
|||
import com.raytheon.uf.viz.radarapps.core.RadarApps;
|
||||
import com.raytheon.uf.viz.radarapps.products.ui.RadarProductUI;
|
||||
|
||||
/**
|
||||
* RPS List Editor window
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 2009-04-22 #2286 D. Friedman Initial checkin
|
||||
* ...
|
||||
* 2013-01-31 DR 15458 D. Friedman Send RPS list so that it will be
|
||||
* accepted for any VCP.
|
||||
* </pre>
|
||||
*
|
||||
*/
|
||||
public class ListEditorWindow {
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(ListEditorWindow.class);
|
||||
|
@ -463,7 +478,10 @@ public class ListEditorWindow {
|
|||
SendRpsList msg = new SendRpsList();
|
||||
msg.radarIDs = Arrays.asList(rpg);
|
||||
msg.requests = Arrays.asList(listEditor.getRpsList().getRequests());
|
||||
msg.vcp = listEditor.getVcp();
|
||||
/* Specify that the RadarServer should accept this list no matter
|
||||
* what VCP the RPG is currently using.
|
||||
*/
|
||||
msg.vcp = RpsList.UNSPECIFIED_VCP;
|
||||
String error = null;
|
||||
try {
|
||||
error = client.sendRequest(msg, 2000).error;
|
||||
|
@ -831,7 +849,7 @@ public class ListEditorWindow {
|
|||
RpsList newList = null;
|
||||
Exception exc = null;
|
||||
int opMode = -1;
|
||||
int vcp = -1;
|
||||
int vcp = RpsList.UNSPECIFIED_VCP;
|
||||
Selector sel = null;
|
||||
try {
|
||||
sel = Awips1RpsListUtil.parseName(f.getName());
|
||||
|
@ -864,7 +882,7 @@ public class ListEditorWindow {
|
|||
return;
|
||||
}
|
||||
|
||||
if (newList.getVcp() < 0) {
|
||||
if (newList.getVcp() == RpsList.UNSPECIFIED_VCP) {
|
||||
VCPInfo vcpInfo = chooseVcp("Could not determine VCP from the file. Please select a VCP.");
|
||||
if (vcpInfo == null)
|
||||
return;
|
||||
|
|
|
@ -63,12 +63,14 @@ import com.raytheon.viz.ui.widgets.ToggleSelectList;
|
|||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Mar 7, 2008 Eric Babin Initial Creation
|
||||
* Mar 7, 2008 Eric Babin Initial Creation
|
||||
* Oct 27, 2012 1287 rferrel Code cleanup for non-blocking dialog.
|
||||
* Oct 25, 2012 1287 rferrel Code changes for non-blocking PublishDialog.
|
||||
* Nov 30, 2012 15575 ryu Added variable replacement for SelectedStart,
|
||||
* SelectedEnd, and home
|
||||
* Nov 13, 2012 1298 rferrel Code changes for non-blocking UserEntryDialog.
|
||||
* Jan 9, 2013 15635 jdynina Allowed to mix and match entry dialogs. Changed order
|
||||
* of dialogs to match A1 displaying entry fields first.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -153,7 +155,9 @@ public class ProductScriptsDialog extends CaveJFACEDialog {
|
|||
|
||||
for (int idx : idxs) {
|
||||
try {
|
||||
Boolean run = true;
|
||||
Boolean run = false;
|
||||
List<FieldDefinition> fieldDefs = new ArrayList<FieldDefinition>();
|
||||
int start = 0;
|
||||
|
||||
String name = scriptsList.getItem(idx);
|
||||
String cmd = scriptDict.get(name);
|
||||
|
@ -215,14 +219,51 @@ public class ProductScriptsDialog extends CaveJFACEDialog {
|
|||
// {startTime}
|
||||
// {endTime}
|
||||
|
||||
|
||||
// The user is prompted for a named variable, same as the
|
||||
// user-supplied variables above, but for non-standard
|
||||
// variables.
|
||||
int entryIdx = cmd.indexOf("{entry:");
|
||||
if (entryIdx >= 0) {
|
||||
run = true;
|
||||
int endEntryIdx = cmd.indexOf("}", entryIdx);
|
||||
String[] entry = cmd.substring(entryIdx + 1, endEntryIdx)
|
||||
.split(":");
|
||||
String [] configFile = new String [] { entry[2] };
|
||||
|
||||
// The dialog being opened is modal to the parent dialog.
|
||||
// This will prevent the launching of another dialog until
|
||||
// the modal dialog is closed.
|
||||
|
||||
// Keep this a blocking dialog so the loop will only display
|
||||
// one dialog at a time.
|
||||
fieldDefs
|
||||
.add(new FieldDefinition(
|
||||
(Object) entry[1],
|
||||
entry[1],
|
||||
FieldType.ALPHANUMERIC,
|
||||
(Object) entry[2],
|
||||
Arrays.asList(Arrays
|
||||
.asList(configFile)
|
||||
.toArray(
|
||||
new Object[configFile.length])),
|
||||
(float) 1.0, (int) 3));
|
||||
|
||||
if (start == 0) {
|
||||
start = entryIdx;
|
||||
} else if ((start > 0) && (start > entryIdx)) {
|
||||
start = entryIdx;
|
||||
}
|
||||
}
|
||||
|
||||
// The user is prompted for a list of radio button values.
|
||||
// {entryButtons: <name of variable>: <list of values separated
|
||||
// by
|
||||
// commas>}
|
||||
// by commas>}
|
||||
int count = cmd.split("entryButtons").length - 1;
|
||||
if (count > 0) {
|
||||
int entryIdx = 0, i = 0, start = 0;
|
||||
List<FieldDefinition> fieldDefs = new ArrayList<FieldDefinition>();
|
||||
entryIdx = 0;
|
||||
int i = 0;
|
||||
run = true;
|
||||
|
||||
while (entryIdx != -1) {
|
||||
entryIdx = cmd.indexOf("{entryButtons:", entryIdx);
|
||||
|
@ -243,33 +284,14 @@ public class ProductScriptsDialog extends CaveJFACEDialog {
|
|||
.toArray(
|
||||
new Object[fields.length])),
|
||||
(float) 1.0, (int) 3));
|
||||
if (i == 0) {
|
||||
if (start == 0) {
|
||||
start = entryIdx;
|
||||
} else if ((start > 0) && (start > entryIdx) && (i == 0)) {
|
||||
start = entryIdx;
|
||||
}
|
||||
entryIdx = endEntryIdx + 1;
|
||||
i++;
|
||||
}
|
||||
|
||||
if (entryIdx == -1) {
|
||||
ValuesDialog buttonDlg = new ValuesDialog(name,
|
||||
fieldDefs, dataManager);
|
||||
if (buttonDlg.open() > 0) {
|
||||
run = false;
|
||||
continue;
|
||||
}
|
||||
|
||||
Map<Object, Object> map = buttonDlg.getValues();
|
||||
String returnMsg = "";
|
||||
|
||||
for (Map.Entry<Object, Object> entry : map
|
||||
.entrySet()) {
|
||||
returnMsg = returnMsg
|
||||
+ entry.getValue().toString() + " ";
|
||||
}
|
||||
|
||||
start = start - 3;
|
||||
cmd = cmd.substring(0, start) + returnMsg;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -279,8 +301,9 @@ public class ProductScriptsDialog extends CaveJFACEDialog {
|
|||
// commas>}
|
||||
count = cmd.split("entryChecks").length - 1;
|
||||
if (count > 0) {
|
||||
int entryIdx = 0, i = 0, start = 0;
|
||||
List<FieldDefinition> fieldDefs = new ArrayList<FieldDefinition>();
|
||||
entryIdx = 0;
|
||||
int i = 0;
|
||||
run = true;
|
||||
|
||||
while (entryIdx != -1) {
|
||||
entryIdx = cmd.indexOf("{entryChecks:", entryIdx);
|
||||
|
@ -301,68 +324,38 @@ public class ProductScriptsDialog extends CaveJFACEDialog {
|
|||
.toArray(
|
||||
new Object[fields.length])),
|
||||
(float) 1.0, (int) 3));
|
||||
if (i == 0) {
|
||||
if (start == 0) {
|
||||
start = entryIdx;
|
||||
} else if ((start > 0) && (start > entryIdx) && (i == 0)) {
|
||||
start = entryIdx;
|
||||
}
|
||||
entryIdx = endEntryIdx + 1;
|
||||
i++;
|
||||
}
|
||||
|
||||
if (entryIdx == -1) {
|
||||
ValuesDialog buttonDlg = new ValuesDialog(name,
|
||||
fieldDefs, dataManager);
|
||||
if (buttonDlg.open() > 0) {
|
||||
run = false;
|
||||
continue;
|
||||
}
|
||||
|
||||
Map<Object, Object> map = buttonDlg.getValues();
|
||||
String returnMsg = "";
|
||||
|
||||
for (Map.Entry<Object, Object> entry : map
|
||||
.entrySet()) {
|
||||
returnMsg = returnMsg
|
||||
+ entry.getValue().toString() + " ";
|
||||
}
|
||||
|
||||
start = start - 3;
|
||||
cmd = cmd.substring(0, start) + returnMsg;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// The user is prompted for a named variable, same as the
|
||||
// user-supplied variables above, but for non-standard
|
||||
// variables.
|
||||
int entryIdx = cmd.indexOf("{entry:");
|
||||
if (entryIdx >= 0) {
|
||||
int endEntryIdx = cmd.indexOf("}", entryIdx);
|
||||
String[] entry = cmd.substring(entryIdx + 1, endEntryIdx)
|
||||
.split(":");
|
||||
String configFile = entry[2];
|
||||
// The dialog being opened is modal to the parent dialog.
|
||||
// This will prevent the launching of another dialog until
|
||||
// the modal dialog is closed.
|
||||
|
||||
// Keep this a blocking dialog so the loop will only display
|
||||
// one dialog at a time.
|
||||
UserEntryDialog entryDlg = new UserEntryDialog(
|
||||
this.getShell(), entry[1] + " Entry", entry[1]
|
||||
+ ":", entry[2]);
|
||||
Object returnMsg = entryDlg.open();
|
||||
if (returnMsg == null) {
|
||||
// cancel pressed
|
||||
run = false;
|
||||
continue;
|
||||
}
|
||||
configFile = returnMsg.toString();
|
||||
|
||||
cmd = cmd.substring(0, entryIdx) + configFile
|
||||
+ cmd.substring(endEntryIdx + 1);
|
||||
}
|
||||
|
||||
// Open the script dialog to allow the user to make selections;
|
||||
// then run the script using dialog selections as script arguments
|
||||
if (run) {
|
||||
TaskManager.getInstance().createScriptTask(name, cmd);
|
||||
ValuesDialog scriptDlg = new ValuesDialog(name,
|
||||
fieldDefs, dataManager);
|
||||
|
||||
int dlgOpen = scriptDlg.open();
|
||||
|
||||
if (dlgOpen <= 0) {
|
||||
Map<Object, Object> map = scriptDlg.getValues();
|
||||
String returnMsg = "";
|
||||
|
||||
for (Map.Entry<Object, Object> entry : map.entrySet()) {
|
||||
returnMsg = returnMsg + entry.getValue().toString() + " ";
|
||||
}
|
||||
|
||||
start = start - 3;
|
||||
cmd = cmd.substring(0, start) + returnMsg;
|
||||
|
||||
TaskManager.getInstance().createScriptTask(name, cmd);
|
||||
}
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
|
|
|
@ -59,6 +59,8 @@ import org.eclipse.swt.custom.StyleRange;
|
|||
import org.eclipse.swt.custom.StyledText;
|
||||
import org.eclipse.swt.events.DisposeEvent;
|
||||
import org.eclipse.swt.events.DisposeListener;
|
||||
import org.eclipse.swt.events.MouseAdapter;
|
||||
import org.eclipse.swt.events.MouseEvent;
|
||||
import org.eclipse.swt.events.SelectionAdapter;
|
||||
import org.eclipse.swt.events.SelectionEvent;
|
||||
import org.eclipse.swt.graphics.Color;
|
||||
|
@ -143,6 +145,9 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
|||
* Changes for non-blocking FindReplaceDlg.
|
||||
* Changes for non-blocking StoreTransmitDlg.
|
||||
* Changes for non-blocking WrapLengthDialog.
|
||||
* 08 Feb 2013 12851 jzeng Add menuToAddTo in create*Menu
|
||||
* Create createEditorPopupMenu()
|
||||
* Add mouselistener in createTextControl() for StyledText
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -166,6 +171,11 @@ public class ProductEditorComp extends Composite implements
|
|||
* Toolbar used to mimic a menu bar.
|
||||
*/
|
||||
private ToolBar toolbar;
|
||||
|
||||
/**
|
||||
* Pop-up Menu
|
||||
*/
|
||||
private Menu popupMenu;
|
||||
|
||||
/**
|
||||
* File menu.
|
||||
|
@ -504,7 +514,8 @@ public class ProductEditorComp extends Composite implements
|
|||
transDisabledImg = getImageRegistry().get("transmitDisabled");
|
||||
transLiveImg = getImageRegistry().get("transmitLive");
|
||||
checkImg = getImageRegistry().get("checkmark");
|
||||
|
||||
menuItems = new ArrayList<MenuItem>();
|
||||
|
||||
GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
|
||||
GridLayout gl = new GridLayout(1, false);
|
||||
gl.marginHeight = 1;
|
||||
|
@ -565,11 +576,15 @@ public class ProductEditorComp extends Composite implements
|
|||
*/
|
||||
private void createToolbar() {
|
||||
toolbar = new ToolBar(this, SWT.NONE);
|
||||
|
||||
createFileMenu();
|
||||
createEditMenu();
|
||||
createOptionsMenu();
|
||||
createCallToActionsMenu();
|
||||
|
||||
fileMenu = new Menu(parent.getShell(), SWT.POP_UP);
|
||||
createFileMenu(fileMenu);
|
||||
editMenu = new Menu(parent.getShell(), SWT.POP_UP);
|
||||
createEditMenu(editMenu);
|
||||
optionsMenu = new Menu(parent.getShell(), SWT.POP_UP);
|
||||
createOptionsMenu(optionsMenu);
|
||||
callToActionsMenu = new Menu(parent.getShell(), SWT.POP_UP);
|
||||
createCallToActionsMenu(callToActionsMenu);
|
||||
|
||||
fileTI = new ToolItem(toolbar, SWT.DROP_DOWN);
|
||||
fileTI.setText("File");
|
||||
|
@ -627,12 +642,9 @@ public class ProductEditorComp extends Composite implements
|
|||
/**
|
||||
* Create the file menu.
|
||||
*/
|
||||
private void createFileMenu() {
|
||||
fileMenu = new Menu(parent.getShell(), SWT.POP_UP);
|
||||
|
||||
menuItems = new ArrayList<MenuItem>();
|
||||
|
||||
MenuItem saveFileMI = new MenuItem(fileMenu, SWT.PUSH);
|
||||
private void createFileMenu(Menu menuToAddTo) {
|
||||
|
||||
MenuItem saveFileMI = new MenuItem(menuToAddTo, SWT.PUSH);
|
||||
saveFileMI.setText("Save File...");
|
||||
saveFileMI.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
|
@ -641,7 +653,7 @@ public class ProductEditorComp extends Composite implements
|
|||
}
|
||||
});
|
||||
|
||||
MenuItem storeMI = new MenuItem(fileMenu, SWT.PUSH);
|
||||
MenuItem storeMI = new MenuItem(menuToAddTo, SWT.PUSH);
|
||||
storeMI.setText("Store...");
|
||||
storeMI.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
|
@ -650,10 +662,10 @@ public class ProductEditorComp extends Composite implements
|
|||
}
|
||||
});
|
||||
menuItems.add(storeMI);
|
||||
|
||||
|
||||
// we can't color the background of the menu item so
|
||||
// we use an image like the tab folder.
|
||||
transmitMI = new MenuItem(fileMenu, SWT.PUSH);
|
||||
transmitMI = new MenuItem(menuToAddTo, SWT.PUSH);
|
||||
transmitMI.setText("Transmit...");
|
||||
transmitMI.setImage(transLiveImg);
|
||||
transmitMI.addSelectionListener(new SelectionAdapter() {
|
||||
|
@ -663,11 +675,11 @@ public class ProductEditorComp extends Composite implements
|
|||
}
|
||||
});
|
||||
menuItems.add(transmitMI);
|
||||
|
||||
|
||||
// Menu Separator
|
||||
new MenuItem(fileMenu, SWT.SEPARATOR);
|
||||
new MenuItem(menuToAddTo, SWT.SEPARATOR);
|
||||
|
||||
MenuItem printMI = new MenuItem(fileMenu, SWT.PUSH);
|
||||
MenuItem printMI = new MenuItem(menuToAddTo, SWT.PUSH);
|
||||
printMI.setText("Print");
|
||||
printMI.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
|
@ -698,10 +710,10 @@ public class ProductEditorComp extends Composite implements
|
|||
});
|
||||
|
||||
// Menu Separator
|
||||
new MenuItem(fileMenu, SWT.SEPARATOR);
|
||||
new MenuItem(menuToAddTo, SWT.SEPARATOR);
|
||||
|
||||
if (editorCorrectionMode) {
|
||||
MenuItem loadDraftMI = new MenuItem(fileMenu, SWT.PUSH);
|
||||
MenuItem loadDraftMI = new MenuItem(menuToAddTo, SWT.PUSH);
|
||||
loadDraftMI.setText("Open File...");
|
||||
loadDraftMI.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
|
@ -710,7 +722,7 @@ public class ProductEditorComp extends Composite implements
|
|||
}
|
||||
});
|
||||
|
||||
MenuItem saveDraftMI = new MenuItem(fileMenu, SWT.PUSH);
|
||||
MenuItem saveDraftMI = new MenuItem(menuToAddTo, SWT.PUSH);
|
||||
saveDraftMI.setText("Load Product / Make Correction...");
|
||||
saveDraftMI.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
|
@ -719,7 +731,7 @@ public class ProductEditorComp extends Composite implements
|
|||
}
|
||||
});
|
||||
} else {
|
||||
MenuItem loadDraftMI = new MenuItem(fileMenu, SWT.PUSH);
|
||||
MenuItem loadDraftMI = new MenuItem(menuToAddTo, SWT.PUSH);
|
||||
loadDraftMI.setText("Load Draft");
|
||||
loadDraftMI.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
|
@ -729,7 +741,7 @@ public class ProductEditorComp extends Composite implements
|
|||
});
|
||||
menuItems.add(loadDraftMI);
|
||||
|
||||
MenuItem saveDraftMI = new MenuItem(fileMenu, SWT.PUSH);
|
||||
MenuItem saveDraftMI = new MenuItem(menuToAddTo, SWT.PUSH);
|
||||
saveDraftMI.setText("Save Draft");
|
||||
saveDraftMI.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
|
@ -744,21 +756,20 @@ public class ProductEditorComp extends Composite implements
|
|||
/**
|
||||
* Create the edit menu.
|
||||
*/
|
||||
private void createEditMenu() {
|
||||
editMenu = new Menu(parent.getShell(), SWT.POP_UP);
|
||||
|
||||
MenuItem undoMI = new MenuItem(editMenu, SWT.PUSH);
|
||||
private void createEditMenu(Menu menuToAddTo) {
|
||||
|
||||
MenuItem undoMI = new MenuItem(menuToAddTo, SWT.PUSH);
|
||||
undoMI.setText("Undo");
|
||||
undoMI.setEnabled(false);
|
||||
|
||||
MenuItem redoMI = new MenuItem(editMenu, SWT.PUSH);
|
||||
MenuItem redoMI = new MenuItem(menuToAddTo, SWT.PUSH);
|
||||
redoMI.setText("Redo");
|
||||
redoMI.setEnabled(false);
|
||||
|
||||
// Menu Separator
|
||||
new MenuItem(editMenu, SWT.SEPARATOR);
|
||||
new MenuItem(menuToAddTo, SWT.SEPARATOR);
|
||||
|
||||
MenuItem cutMI = new MenuItem(editMenu, SWT.PUSH);
|
||||
MenuItem cutMI = new MenuItem(menuToAddTo, SWT.PUSH);
|
||||
cutMI.setText("Cut");
|
||||
cutMI.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
|
@ -767,7 +778,7 @@ public class ProductEditorComp extends Composite implements
|
|||
}
|
||||
});
|
||||
|
||||
MenuItem copyMI = new MenuItem(editMenu, SWT.PUSH);
|
||||
MenuItem copyMI = new MenuItem(menuToAddTo, SWT.PUSH);
|
||||
copyMI.setText("Copy");
|
||||
copyMI.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
|
@ -776,7 +787,7 @@ public class ProductEditorComp extends Composite implements
|
|||
}
|
||||
});
|
||||
|
||||
MenuItem pasteMI = new MenuItem(editMenu, SWT.PUSH);
|
||||
MenuItem pasteMI = new MenuItem(menuToAddTo, SWT.PUSH);
|
||||
pasteMI.setText("Paste");
|
||||
pasteMI.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
|
@ -786,9 +797,9 @@ public class ProductEditorComp extends Composite implements
|
|||
});
|
||||
|
||||
// Menu Separator
|
||||
new MenuItem(editMenu, SWT.SEPARATOR);
|
||||
new MenuItem(menuToAddTo, SWT.SEPARATOR);
|
||||
|
||||
MenuItem findMI = new MenuItem(editMenu, SWT.PUSH);
|
||||
MenuItem findMI = new MenuItem(menuToAddTo, SWT.PUSH);
|
||||
findMI.setText("Find...");
|
||||
findMI.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
|
@ -797,7 +808,7 @@ public class ProductEditorComp extends Composite implements
|
|||
}
|
||||
});
|
||||
|
||||
MenuItem replaceMI = new MenuItem(editMenu, SWT.PUSH);
|
||||
MenuItem replaceMI = new MenuItem(menuToAddTo, SWT.PUSH);
|
||||
replaceMI.setText("Replace...");
|
||||
replaceMI.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
|
@ -806,7 +817,7 @@ public class ProductEditorComp extends Composite implements
|
|||
}
|
||||
});
|
||||
|
||||
MenuItem spellCheckMI = new MenuItem(editMenu, SWT.PUSH);
|
||||
MenuItem spellCheckMI = new MenuItem(menuToAddTo, SWT.PUSH);
|
||||
spellCheckMI.setText("Spell Check...");
|
||||
spellCheckMI.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
|
@ -820,9 +831,9 @@ public class ProductEditorComp extends Composite implements
|
|||
});
|
||||
|
||||
// Menu Separator
|
||||
new MenuItem(editMenu, SWT.SEPARATOR);
|
||||
new MenuItem(menuToAddTo, SWT.SEPARATOR);
|
||||
|
||||
MenuItem wrapSelectedMI = new MenuItem(editMenu, SWT.PUSH);
|
||||
MenuItem wrapSelectedMI = new MenuItem(menuToAddTo, SWT.PUSH);
|
||||
wrapSelectedMI.setText("Wrap Selected");
|
||||
wrapSelectedMI.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
|
@ -835,10 +846,8 @@ public class ProductEditorComp extends Composite implements
|
|||
/**
|
||||
* Create the options menu.
|
||||
*/
|
||||
private void createOptionsMenu() {
|
||||
optionsMenu = new Menu(parent.getShell(), SWT.POP_UP);
|
||||
|
||||
autoWrapMI = new MenuItem(optionsMenu, SWT.CHECK);
|
||||
private void createOptionsMenu(Menu menuToAddTo) {
|
||||
autoWrapMI = new MenuItem(menuToAddTo, SWT.CHECK);
|
||||
autoWrapMI.setText("Auto Wrap");
|
||||
autoWrapMI.setSelection(wrapMode);
|
||||
autoWrapMI.addSelectionListener(new SelectionAdapter() {
|
||||
|
@ -848,7 +857,7 @@ public class ProductEditorComp extends Composite implements
|
|||
}
|
||||
});
|
||||
|
||||
framingCodeMI = new MenuItem(optionsMenu, SWT.CHECK);
|
||||
framingCodeMI = new MenuItem(menuToAddTo, SWT.CHECK);
|
||||
framingCodeMI.setText("Highlight Framing Codes");
|
||||
framingCodeMI.setSelection(Activator.getDefault().getPreferenceStore()
|
||||
.getBoolean("HighlightFramingCodes"));
|
||||
|
@ -862,7 +871,7 @@ public class ProductEditorComp extends Composite implements
|
|||
|
||||
});
|
||||
|
||||
MenuItem wrapLengthMI = new MenuItem(optionsMenu, SWT.PUSH);
|
||||
MenuItem wrapLengthMI = new MenuItem(menuToAddTo, SWT.PUSH);
|
||||
wrapLengthMI.setText("Wrap Length...");
|
||||
wrapLengthMI.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
|
@ -895,10 +904,8 @@ public class ProductEditorComp extends Composite implements
|
|||
/**
|
||||
* Create the call to actions menu.
|
||||
*/
|
||||
private void createCallToActionsMenu() {
|
||||
callToActionsMenu = new Menu(parent.getShell(), SWT.POP_UP);
|
||||
|
||||
MenuItem hazardMI = new MenuItem(callToActionsMenu, SWT.PUSH);
|
||||
private void createCallToActionsMenu(Menu menuToAddTo) {
|
||||
MenuItem hazardMI = new MenuItem(menuToAddTo, SWT.PUSH);
|
||||
hazardMI.setText("Hazard...");
|
||||
hazardMI.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
|
@ -907,7 +914,7 @@ public class ProductEditorComp extends Composite implements
|
|||
}
|
||||
});
|
||||
|
||||
MenuItem productMI = new MenuItem(callToActionsMenu, SWT.PUSH);
|
||||
MenuItem productMI = new MenuItem(menuToAddTo, SWT.PUSH);
|
||||
productMI.setText("Product...");
|
||||
productMI.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
|
@ -916,7 +923,7 @@ public class ProductEditorComp extends Composite implements
|
|||
}
|
||||
});
|
||||
|
||||
MenuItem genericMI = new MenuItem(callToActionsMenu, SWT.PUSH);
|
||||
MenuItem genericMI = new MenuItem(menuToAddTo, SWT.PUSH);
|
||||
genericMI.setText("Generic...");
|
||||
genericMI.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
|
@ -935,6 +942,17 @@ public class ProductEditorComp extends Composite implements
|
|||
textComp.setWrapColumn(wrapColumn);
|
||||
|
||||
textComp.setAutoWrapMode(wrapMode);
|
||||
|
||||
createEditorPopupMenu();
|
||||
|
||||
textComp.getTextEditorST().addMouseListener(new MouseAdapter(){
|
||||
@Override
|
||||
public void mouseDown(MouseEvent e) {
|
||||
if (e.button == 3){
|
||||
popupMenu.setVisible(true);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -2997,4 +3015,36 @@ public class ProductEditorComp extends Composite implements
|
|||
|
||||
return str;
|
||||
}
|
||||
|
||||
/*
|
||||
* Add Pop-up GUI for File, Edit, Options, and CallToActions
|
||||
* at the location of mouse, when right click the mouse
|
||||
*/
|
||||
private void createEditorPopupMenu(){
|
||||
popupMenu = new Menu(textComp);
|
||||
|
||||
MenuItem fileMI = new MenuItem(popupMenu, SWT.CASCADE);
|
||||
fileMI.setText("File");
|
||||
Menu fileSubMenu = new Menu(popupMenu);
|
||||
fileMI.setMenu(fileSubMenu);
|
||||
createFileMenu(fileSubMenu);
|
||||
|
||||
MenuItem editMI = new MenuItem(popupMenu, SWT.CASCADE);
|
||||
editMI.setText("Edit");
|
||||
Menu editSubMenu = new Menu(popupMenu);
|
||||
editMI.setMenu(editSubMenu);
|
||||
createEditMenu(editSubMenu);
|
||||
|
||||
MenuItem optionsMI = new MenuItem(popupMenu, SWT.CASCADE);
|
||||
optionsMI.setText("Options");
|
||||
Menu optionsSubMenu = new Menu(popupMenu);
|
||||
optionsMI.setMenu(optionsSubMenu);
|
||||
createOptionsMenu(optionsSubMenu);
|
||||
|
||||
MenuItem callToActionsMI = new MenuItem(popupMenu, SWT.CASCADE);
|
||||
callToActionsMI.setText("CallToActions");
|
||||
Menu callToActionsSubMenu = new Menu(popupMenu);
|
||||
callToActionsMI.setMenu(callToActionsSubMenu);
|
||||
createCallToActionsMenu(callToActionsSubMenu);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1719,7 +1719,7 @@
|
|||
<parameter>MpV</parameter>
|
||||
</paramLevelMatches>
|
||||
<imageStyle>
|
||||
<displayUnits label="PVU">K/hPa/s</displayUnits>
|
||||
<displayUnits label="PVU">K/hPa/s*1.0E-5</displayUnits>
|
||||
<range scale="LOG" mirror="true" adaptive="true" />
|
||||
<defaultColormap>Grid/gridded data</defaultColormap>
|
||||
</imageStyle>
|
||||
|
|
|
@ -21,7 +21,6 @@ package com.raytheon.viz.hydro.resource;
|
|||
|
||||
import java.awt.image.RenderedImage;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.core.commands.ExecutionException;
|
||||
|
@ -61,7 +60,7 @@ import com.vividsolutions.jts.geom.Envelope;
|
|||
import com.vividsolutions.jts.index.strtree.STRtree;
|
||||
|
||||
/**
|
||||
* Resource to dislpay the DamCrest icons.
|
||||
* Resource to display the DamCrest icons.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
|
@ -70,6 +69,7 @@ import com.vividsolutions.jts.index.strtree.STRtree;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Apr 20, 2009 mpduff Initial creation
|
||||
* Sep 23, 2009 3069 mpduff Changed the parent class to HydroPointResource.
|
||||
* Jan 22, 2013 15553 wkwock Correct DamCrest selection algorithm
|
||||
* </pre>
|
||||
*
|
||||
* @author mpduff
|
||||
|
@ -310,16 +310,24 @@ public class DamLocationResource extends
|
|||
Coordinate coord = container.translateClick(x, y);
|
||||
Envelope env = new Envelope(coord);
|
||||
List<?> elements = damStrTree.query(env);
|
||||
double curDist=Double.MAX_VALUE;
|
||||
DamMaster foundDam = null;
|
||||
if (elements.size() > 0) {
|
||||
Iterator<?> iter = elements.iterator();
|
||||
if (iter.hasNext()) {
|
||||
DamMaster dam = (DamMaster) iter.next();
|
||||
try {
|
||||
AppLauncherHandler alh = new AppLauncherHandler();
|
||||
alh.execute(DC_BUNDLE_LOC, dam.getNidid());
|
||||
} catch (ExecutionException e) {
|
||||
e.printStackTrace();
|
||||
//find the closest one
|
||||
for (Object obj : elements) {
|
||||
DamMaster dam = (DamMaster) obj;
|
||||
double distance=Math.pow((dam.getLatitudeDam()-coord.y),2) + Math.pow((dam.getLongitudeDam()-coord.x), 2);
|
||||
if (distance<curDist) {
|
||||
curDist=distance;
|
||||
foundDam=dam;
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
AppLauncherHandler alh = new AppLauncherHandler();
|
||||
alh.execute(DC_BUNDLE_LOC, foundDam.getNidid());
|
||||
} catch (ExecutionException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
Shell shell = PlatformUI.getWorkbench()
|
||||
|
|
|
@ -125,6 +125,7 @@ import com.vividsolutions.jts.index.strtree.STRtree;
|
|||
*
|
||||
* May 16, 2011 9356 djingtao When timeseries is disposed, launch a new timesereis after double click
|
||||
* or right click to select TimeSeries
|
||||
* Jan 30, 2013 15646 wkwock Fix middle button drag map incorrect
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -1583,9 +1584,6 @@ public class MultiPointResource extends
|
|||
*/
|
||||
@Override
|
||||
public boolean handleMouseDown(int x, int y, int mouseButton) {
|
||||
if (mouseButton == 2) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -50,13 +50,12 @@ import org.eclipse.swt.graphics.Point;
|
|||
import org.eclipse.swt.graphics.Rectangle;
|
||||
import org.eclipse.swt.graphics.Region;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.widgets.Button;
|
||||
import org.eclipse.swt.widgets.Canvas;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.eclipse.swt.widgets.Event;
|
||||
import org.eclipse.swt.widgets.Listener;
|
||||
import org.eclipse.swt.widgets.Menu;
|
||||
import org.eclipse.swt.widgets.MenuItem;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.shef.tables.Fcstheight;
|
||||
|
@ -133,7 +132,8 @@ import com.raytheon.viz.hydrocommon.util.DbUtils;
|
|||
* stage and discharge.
|
||||
* 13 Nov 2012 15416 lbousaidi added a check when the colorname is null and a call to
|
||||
* getGroupModeColor
|
||||
* 09 Jan 2012 15493 lbousaidi added code to delete data while zooming when you draw a box
|
||||
* 09 Jan 2012 15493 lbousaidi added code to delete data while zooming when you draw a box
|
||||
* 16 Jan 2013 15695 wkwock Fix popup menu
|
||||
* @author lvenable
|
||||
* @version 1.0
|
||||
*
|
||||
|
@ -360,6 +360,8 @@ public class TimeSeriesDisplayCanvas extends TimeSeriesGraphCanvas implements
|
|||
private TimeSeriesDataJobManager tsDataJobManager = null;
|
||||
|
||||
private boolean zoomed = false;
|
||||
|
||||
ToggleTimeSeriesDlg ttsd =null;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
|
@ -1506,7 +1508,7 @@ public class TimeSeriesDisplayCanvas extends TimeSeriesGraphCanvas implements
|
|||
.size()]));
|
||||
}
|
||||
|
||||
private String getFcstPEDTSE(TraceData td) {
|
||||
protected String getFcstPEDTSE(TraceData td) {
|
||||
String fcst = getPEDTSE(td);
|
||||
if (td.getBasistime() != null) {
|
||||
fcst = fcst.concat(" " + dateFormat.format(td.getBasistime()));
|
||||
|
@ -1521,7 +1523,7 @@ public class TimeSeriesDisplayCanvas extends TimeSeriesGraphCanvas implements
|
|||
* The Trace Data
|
||||
* @return The PEDTSE String
|
||||
*/
|
||||
private String getPEDTSE(TraceData td) {
|
||||
protected String getPEDTSE(TraceData td) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (td.getPe() != null) {
|
||||
sb.append(td.getPe() + " ");
|
||||
|
@ -1545,41 +1547,12 @@ public class TimeSeriesDisplayCanvas extends TimeSeriesGraphCanvas implements
|
|||
* Display the right click popup menu.
|
||||
*/
|
||||
private void popupMenu() {
|
||||
List<TraceData> traceList = getTraceList();
|
||||
Menu m = new Menu(parentComp.getShell(), SWT.POP_UP);
|
||||
|
||||
for (int i = 0; i < traceList.size(); i++) {
|
||||
TraceData td = traceList.get(i);
|
||||
String s = null;
|
||||
if (td.isForecast()) {
|
||||
s = getFcstPEDTSE(td);
|
||||
} else {
|
||||
s = getPEDTSE(td);
|
||||
}
|
||||
MenuItem mi = new MenuItem(m, SWT.CHECK);
|
||||
if (td.getLineData()!=null && td.getLineData().length>0) {
|
||||
if (td.isTraceOn())
|
||||
mi.setSelection(true);
|
||||
else
|
||||
mi.setSelection(false);
|
||||
} else {
|
||||
mi.setSelection(false);
|
||||
s = s.concat("" + "NO DATA");
|
||||
}
|
||||
mi.setText(s);
|
||||
mi.setData(td);
|
||||
mi.addListener(SWT.Selection, new Listener() {
|
||||
public void handleEvent(Event event) {
|
||||
handleSelection(event);
|
||||
}
|
||||
});
|
||||
}
|
||||
// We need to make the menu visible
|
||||
m.setVisible(true);
|
||||
ttsd = ToggleTimeSeriesDlg.getInstance(getShell(),getTraceList(),this);
|
||||
ttsd.open();
|
||||
}
|
||||
|
||||
private void handleSelection(Event event) {
|
||||
MenuItem item = (MenuItem) event.widget;
|
||||
protected void handleSelection(Event event) {
|
||||
Button item = (Button) event.widget;
|
||||
TraceData trace = (TraceData) item.getData();
|
||||
trace.setTraceOn(!trace.isTraceOn());
|
||||
if (trace.isTraceOn()) {
|
||||
|
|
|
@ -88,7 +88,8 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
|||
* 04 Mar 2011 7644 lbousaid fixed Zoom in feature
|
||||
* 30 May 2012 14967 wkwock fix insert deleted data to rejecteddata table
|
||||
* 23 Jul 2012 15195 mpduff Fix dates for displaying groups
|
||||
* 06 Dec 2012 15066 wkwock Fix "ctrl+r" not work in group mode
|
||||
* 06 Dec 2012 15066 wkwock Fix "ctrl+r" not work in group mode
|
||||
* 22 Jan 2013 14903 lbousaidi Fix display error after save to DB.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -875,18 +876,7 @@ public class TimeSeriesDisplayDlg extends CaveSWTDialog {
|
|||
insertList.clear();
|
||||
editList.clear();
|
||||
deleteList.clear();
|
||||
|
||||
for (TimeSeriesDisplayCanvas canvas : canvasList) {
|
||||
if (canvas.getTraceArray() != null) {
|
||||
for (TraceData td : canvas.getTraceArray()) {
|
||||
/* Reset the selection */
|
||||
td.setSelected(false);
|
||||
}
|
||||
}
|
||||
canvas.setGetAgain(true);
|
||||
canvas.redraw();
|
||||
canvas.update();
|
||||
}
|
||||
displayCanvas.redraw();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -117,7 +117,8 @@ import com.raytheon.viz.hydrocommon.util.StnClassSyncUtil;
|
|||
* 08 Aug 2012 657 mpduff Fix error when selecting a TS while no selection has been made
|
||||
* in the Station List.
|
||||
* 27 Sep 2012 15302 wkwock TimeSeries start mode should depends on token timeseries_mode
|
||||
* despite start up in CAVE or standalone.
|
||||
* despite start up in CAVE or standalone.
|
||||
* 30 Jan 2013 15264 wkwock Fix the missing group_definition.cfg file crash
|
||||
* </pre>
|
||||
*
|
||||
* @author lvenable
|
||||
|
@ -604,15 +605,15 @@ public class TimeSeriesDlg extends CaveHydroSWTDialog {
|
|||
|
||||
this.standaloneMode = true;
|
||||
// Ensure That The Group Configuration File Exists.
|
||||
if (!groupConfigFile.exists()) {
|
||||
if (groupConfigFile==null || !groupConfigFile.exists()) {
|
||||
// if it does not, check localization for the file
|
||||
IPathManager pm = PathManagerFactory.getPathManager();
|
||||
groupConfigFile = pm.getStaticFile(HydroConstants.GROUP_DEFINITION);
|
||||
|
||||
if (!groupConfigFile.exists()) {
|
||||
if (groupConfigFile==null || !groupConfigFile.exists()) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Unable to locate group configuration file - "
|
||||
+ groupConfigFile.getAbsolutePath());
|
||||
+ HydroConstants.GROUP_DEFINITION);
|
||||
this.groupConfigFilePath = null;
|
||||
} else {
|
||||
this.groupConfigFilePath = groupConfigFile.getAbsolutePath();
|
||||
|
|
|
@ -11,6 +11,10 @@ import org.eclipse.core.commands.ExecutionException;
|
|||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
|
||||
import com.raytheon.uf.common.localization.IPathManager;
|
||||
import com.raytheon.uf.common.localization.PathManagerFactory;
|
||||
import com.raytheon.viz.hydrocommon.HydroConstants;
|
||||
|
||||
/**
|
||||
* Action for Time Series Configuration Plug-in
|
||||
*
|
||||
|
@ -19,6 +23,7 @@ import org.eclipse.ui.PlatformUI;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jan 24, 2011 7797 bkowal Initial creation.
|
||||
* Jan 30, 2013 15264 wkwock Get the correct group_definition.cfg file.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -28,10 +33,6 @@ import org.eclipse.ui.PlatformUI;
|
|||
public class TimeSeriesconfigAction extends AbstractHandler {
|
||||
private TimeSeriesDlg timeSeriesDialog;
|
||||
|
||||
private static final String ENV_WHFS_CONFIG_DIR = "whfs_config_dir";
|
||||
|
||||
private static final String GROUP_DEFINITION_FILE_NAME = "group_definition.cfg";
|
||||
|
||||
@Override
|
||||
public Object execute(ExecutionEvent event) throws ExecutionException {
|
||||
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||
|
@ -52,13 +53,8 @@ public class TimeSeriesconfigAction extends AbstractHandler {
|
|||
}
|
||||
|
||||
protected static File locateGroupDefinitionFile() {
|
||||
String configDir = System
|
||||
.getenv(TimeSeriesconfigAction.ENV_WHFS_CONFIG_DIR);
|
||||
if (!configDir.endsWith("/")) {
|
||||
configDir = configDir + "/";
|
||||
}
|
||||
File file = new File(configDir
|
||||
+ TimeSeriesconfigAction.GROUP_DEFINITION_FILE_NAME);
|
||||
IPathManager pm = PathManagerFactory.getPathManager();
|
||||
File file = pm.getStaticFile(HydroConstants.GROUP_DEFINITION);
|
||||
|
||||
return file;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,117 @@
|
|||
/**
|
||||
* 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.hydro.timeseries;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.layout.RowLayout;
|
||||
import org.eclipse.swt.widgets.Button;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Event;
|
||||
import org.eclipse.swt.widgets.Listener;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
import com.raytheon.viz.hydro.CaveHydroSWTDialog;
|
||||
import com.raytheon.viz.hydro.timeseries.util.TraceData;
|
||||
|
||||
/**
|
||||
* This class is the popup menu when right/middle click on the Time Series Display.
|
||||
* There should be only one toggle time series dialog at a time.
|
||||
*
|
||||
* <pre>
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ---------- ------- ----------- --------------------------
|
||||
* 1/16/2013 15695 wkwock Initial
|
||||
* @author wkwock
|
||||
* @version 1.0
|
||||
*
|
||||
*/
|
||||
public class ToggleTimeSeriesDlg extends CaveHydroSWTDialog {
|
||||
private static final String DLG_TITLE="Toggle Time Series";
|
||||
private List<TraceData> traceList=null;
|
||||
private TimeSeriesDisplayCanvas tsDisCanvas=null;
|
||||
private static ToggleTimeSeriesDlg oneTTSD=null; //singleton
|
||||
|
||||
public static ToggleTimeSeriesDlg getInstance(Shell parentShell,List<TraceData> traceLst, TimeSeriesDisplayCanvas tsdc) {
|
||||
if (oneTTSD!=null){
|
||||
oneTTSD.close();
|
||||
oneTTSD.disposed();
|
||||
}
|
||||
oneTTSD = new ToggleTimeSeriesDlg(parentShell, traceLst, tsdc) ;
|
||||
return oneTTSD;
|
||||
}
|
||||
|
||||
private ToggleTimeSeriesDlg(Shell parentShell,List<TraceData> traceLst, TimeSeriesDisplayCanvas tsdc) {
|
||||
super(parentShell);
|
||||
this.setText(DLG_TITLE);
|
||||
|
||||
this.traceList=traceLst;
|
||||
this.tsDisCanvas=tsdc;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initializeComponents(Shell shell) {
|
||||
Composite beginningTimeComp = new Composite(shell, SWT.NONE);
|
||||
RowLayout topLabelCompRl = new RowLayout();
|
||||
beginningTimeComp.setLayout(topLabelCompRl);
|
||||
|
||||
Button[] checkBtns = new Button[traceList.size()];
|
||||
|
||||
for (int i = 0; i < traceList.size(); i++) {
|
||||
TraceData td = traceList.get(i);
|
||||
checkBtns[i] = new Button(shell, SWT.CHECK);
|
||||
String s = null;
|
||||
if (td.isForecast()) {
|
||||
s = this.tsDisCanvas.getFcstPEDTSE(td);
|
||||
} else {
|
||||
s = this.tsDisCanvas.getPEDTSE(td);
|
||||
}
|
||||
if (td.getLineData()!=null && td.getLineData().length>0) {
|
||||
if (td.isTraceOn())
|
||||
checkBtns[i].setSelection(true);
|
||||
else
|
||||
checkBtns[i].setSelection(false);
|
||||
} else {
|
||||
checkBtns[i].setSelection(false);
|
||||
s = s.concat("" + "NO DATA");
|
||||
}
|
||||
|
||||
checkBtns[i].setText(s);
|
||||
checkBtns[i].setLocation(50*i,250);
|
||||
checkBtns[i].pack();
|
||||
checkBtns[i].setData(td);
|
||||
|
||||
|
||||
checkBtns[i].addListener(SWT.Selection, new Listener() {
|
||||
public void handleEvent(Event event) {
|
||||
handleSelection(event);
|
||||
}
|
||||
});
|
||||
}
|
||||
// We need to make the menu visible
|
||||
beginningTimeComp.setVisible(true);
|
||||
}
|
||||
|
||||
private void handleSelection(Event event) {
|
||||
this.tsDisCanvas.handleSelection(event);
|
||||
}
|
||||
}
|
|
@ -54,6 +54,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Sep 10, 2008 lvenable Initial creation
|
||||
* Feb 13, 2013 15794 wkwock Make Sequence number goes up to 99
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -260,7 +261,7 @@ public class ContactsDlg extends CaveSWTDialog {
|
|||
seqNumSpnr.setPageIncrement(1);
|
||||
seqNumSpnr.setSelection(1);
|
||||
seqNumSpnr.setMinimum(1);
|
||||
seqNumSpnr.setMaximum(9);
|
||||
seqNumSpnr.setMaximum(99);
|
||||
seqNumSpnr.setLayoutData(gd);
|
||||
|
||||
gd = new GridData(275, SWT.DEFAULT);
|
||||
|
|
|
@ -52,6 +52,7 @@ import org.eclipse.swt.widgets.MessageBox;
|
|||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.swt.widgets.Text;
|
||||
|
||||
import com.raytheon.uf.common.ohd.AppsDefaults;
|
||||
import com.raytheon.uf.viz.core.VizApp;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.viz.hydrocommon.data.RiverDataPoint;
|
||||
|
@ -73,6 +74,8 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
|||
* 21 Feb 2010 4167 mpduff Added TimeZone to SimpleDateFormat.
|
||||
* 29 Apr 2010 4993 mpduff Fixed date format in error message.
|
||||
* 26 Jul 2012 14711/963 mpduff Fix problems adding/removing shift points
|
||||
* 22 Jan 2013 15682 lbousaidi fix openfile problem and changed the path to
|
||||
* whfs_import_dir for "Import Curve" button.
|
||||
* </pre>
|
||||
*
|
||||
* @author lvenable
|
||||
|
@ -517,16 +520,19 @@ public class RatingCurveDlg extends CaveSWTDialog {
|
|||
curveImportBtn.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
final String tokenizedDir = "whfs_import_dir";
|
||||
String importRating= AppsDefaults.getInstance().getToken(tokenizedDir);
|
||||
FileDialog fd = new FileDialog(shell, SWT.OPEN);
|
||||
fd.setText("Open");
|
||||
fd.setFilterPath("$HOME");
|
||||
fd.setFilterPath(importRating);
|
||||
String[] filterExt = { "*." + extension };
|
||||
fd.setFilterExtensions(filterExt);
|
||||
|
||||
String file = fd.open();
|
||||
if (file != null) {
|
||||
importCurveData(importRatingCurve(fd.open()));
|
||||
}
|
||||
String filename = fd.open();
|
||||
if (filename == null) {
|
||||
return;
|
||||
} else {
|
||||
importCurveData(importRatingCurve(filename));
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -47,6 +47,7 @@ import com.raytheon.viz.hydrocommon.whfslib.GeoUtil;
|
|||
* Sep 18, 2009 2260 mpduff Initial creation
|
||||
* Apr 25, 2012 14499 wkwock Refine format, query, etc
|
||||
* Oct 14, 2012 15454 wkwock Fix can not generate e19 if damage filed is empty
|
||||
* Jan 23, 2013 15443 lbousaidi added NP form feed foe all the pages.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -268,7 +269,7 @@ public class E19Report extends TextReport {
|
|||
StringBuilder buffer = new StringBuilder();
|
||||
|
||||
TextReportData data = TextReportDataManager.getInstance().getDataForReports(lid, 0);
|
||||
|
||||
buffer.append("\f");
|
||||
buffer.append(TextReportConstants.E19_HDR_MAPPAGE);
|
||||
buffer.append("\n\n");
|
||||
|
||||
|
@ -296,6 +297,7 @@ public class E19Report extends TextReport {
|
|||
int numCols = 74;
|
||||
int leftMargin = 24;
|
||||
|
||||
buffer.append("\f");
|
||||
buffer.append(TextReportConstants.E19_HDR_BENCHMARKS);
|
||||
buffer.append("\n\n");
|
||||
|
||||
|
@ -428,7 +430,7 @@ public class E19Report extends TextReport {
|
|||
String[] crit2 = null;
|
||||
|
||||
TextReportData data = TextReportDataManager.getInstance().getDataForReports(lid, 2);
|
||||
|
||||
buffer.append("\f");
|
||||
buffer.append(TextReportConstants.E19_HDR_GAGES + "\n\n");
|
||||
buffer.append(" DCP TELEM\n\n");
|
||||
|
||||
|
@ -589,6 +591,7 @@ public class E19Report extends TextReport {
|
|||
*/
|
||||
private String E19History() {
|
||||
StringBuilder buffer = new StringBuilder();
|
||||
buffer.append("\f");
|
||||
buffer.append(TextReportConstants.E19_HDR_HISTORY + "\n\n");
|
||||
|
||||
int count1 = countNewlines(buffer.toString());
|
||||
|
@ -767,7 +770,7 @@ public class E19Report extends TextReport {
|
|||
for (int i = 0; i < leftMargin; i++) {
|
||||
indent = indent.concat(" ");
|
||||
}
|
||||
|
||||
buffer.append("\f");
|
||||
buffer.append(TextReportConstants.E19_HDR_CRESTS + "\n\n");
|
||||
|
||||
if (data.getRiverstat() != null) {
|
||||
|
@ -917,7 +920,7 @@ public class E19Report extends TextReport {
|
|||
String tmp2 = " ";
|
||||
String tmp3 = " ";
|
||||
String tmp4 = " ";
|
||||
|
||||
buffer.append("\f");
|
||||
buffer.append(TextReportConstants.E19_HDR_LOWWATER + "\n\n");
|
||||
|
||||
int count1 = countNewlines(buffer.toString());
|
||||
|
@ -1034,7 +1037,7 @@ public class E19Report extends TextReport {
|
|||
for (int i = 0; i < leftMargin; i++) {
|
||||
indent = indent.concat(" ");
|
||||
}
|
||||
|
||||
buffer.append("\f");
|
||||
buffer.append(TextReportConstants.E19_HDR_CONDITIONS + "\n\n");
|
||||
|
||||
TextReportData data = TextReportDataManager.getInstance().getDataForReports(lid, 0);
|
||||
|
@ -1178,7 +1181,7 @@ public class E19Report extends TextReport {
|
|||
for (int i = 0; i < leftMargin; i++) {
|
||||
indent = indent.concat(" ");
|
||||
}
|
||||
|
||||
buffer.append("\f");
|
||||
buffer.append(TextReportConstants.E19_HDR_DAMAGE + "\n\n");
|
||||
|
||||
TextReportData data = TextReportDataManager.getInstance().getCrestData(lid);
|
||||
|
@ -1291,7 +1294,7 @@ public class E19Report extends TextReport {
|
|||
for (int i = 0; i < leftMargin; i++) {
|
||||
indent = indent.concat(" ");
|
||||
}
|
||||
|
||||
buffer.append("\f");
|
||||
buffer.append(TextReportConstants.E19_HDR_STAFFGAGE + "\n\n");
|
||||
|
||||
TextReportData data = TextReportDataManager.getInstance().getStaffGageData(lid);
|
||||
|
@ -1518,7 +1521,7 @@ public class E19Report extends TextReport {
|
|||
String tmp1 = " ";
|
||||
String tmp2 = " ";
|
||||
String tmp3 = " ";
|
||||
|
||||
buffer.append("\f");
|
||||
buffer.append(TextReportConstants.E19_HDR_CONTACTS + "\n\n");
|
||||
|
||||
TextReportData data = TextReportDataManager.getInstance().getDataForReports(lid, 6);
|
||||
|
|
|
@ -307,7 +307,10 @@ import com.raytheon.viz.ui.dialogs.SWTMessageBox;
|
|||
* 28Nov2012 14842 M.Gamazaychikov Re-wrote processPopup method
|
||||
* 13Dec2012 1353 rferrel Change to make edit cancel message not
|
||||
* dispaly the red had kill job message.
|
||||
* 10JAN2012 15704 M.Gamazaychikov Added setting userKeyPressed to false in verifyText method
|
||||
* 31Dec2012 15651 M.Gamazaychikov Added an argument to re-factored PrintDisplay.print
|
||||
* 10JAN2012 15704 M.Gamazaychikov Added setting userKeyPressed to false in verifyText method.
|
||||
* 31JAN2013 14247 D. Friedman Make spell check dialog child of editor window.
|
||||
* 31JAN2013 15580 D. Friedman Prevent errors when window is disposed.
|
||||
* </pre>
|
||||
*
|
||||
* @author lvenable
|
||||
|
@ -4191,7 +4194,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
|||
*/
|
||||
private void printAllText() {
|
||||
FontData fontData = textEditor.getFont().getFontData()[0];
|
||||
PrintDisplay.print(textEditor.getText(), fontData, statusHandler);
|
||||
PrintDisplay.print(textEditor.getText(), fontData, charWrapCol, statusHandler);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -4214,7 +4217,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
|||
String tmpText = textEditor.getText();
|
||||
Point point = textEditor.getSelection();
|
||||
FontData fontData = textEditor.getFont().getFontData()[0];
|
||||
PrintDisplay.print(textEditor.getSelectionText(), fontData,
|
||||
PrintDisplay.print(textEditor.getSelectionText(), fontData, charWrapCol,
|
||||
statusHandler);
|
||||
textEditor.setText(tmpText);
|
||||
textEditor.setSelection(point);
|
||||
|
@ -5831,7 +5834,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
|||
* Displays the spell checker dialog to initiate spell checking.
|
||||
*/
|
||||
private void checkSpelling() {
|
||||
SpellCheckDlg spellCheckDlg = new SpellCheckDlg(getParent(),
|
||||
SpellCheckDlg spellCheckDlg = new SpellCheckDlg(shell,
|
||||
textEditor, StatusConstants.CATEGORY_WORKSTATION,
|
||||
StatusConstants.SUBCATEGORY_CONNECTIVITY);
|
||||
spellCheckDlg.open();
|
||||
|
@ -6837,6 +6840,9 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
|||
|
||||
@Override
|
||||
protected void disposed() {
|
||||
textEditor.setFont(shell.getFont());
|
||||
headerTF.setFont(shell.getFont());
|
||||
|
||||
if (smlFont != null) {
|
||||
smlFont.dispose();
|
||||
}
|
||||
|
|
|
@ -90,6 +90,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
|||
* 26Sep2012 1196 lvenable Dialog refactor to not block.
|
||||
* 02Oct2012 1229 rferrel Option to allow blocking when top dialog.
|
||||
* 13Dec2012 1353 rferrel Fix bug introduced in the Show all dialogs.
|
||||
* 30Jan2013 DR 14736 D. Friedman Display local time.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -217,7 +218,9 @@ public class TextWorkstationDlg extends CaveSWTDialog implements
|
|||
|
||||
private void initializeComponents() {
|
||||
sdfUTC.setTimeZone(TimeZone.getTimeZone("UTC"));
|
||||
sdfLocal.setTimeZone(Calendar.getInstance().getTimeZone());
|
||||
String localTZName = System.getenv("FXA_LOCAL_TZ");
|
||||
sdfLocal.setTimeZone(localTZName != null ?
|
||||
TimeZone.getTimeZone(localTZName) : TimeZone.getDefault());
|
||||
|
||||
createMenus();
|
||||
new Label(shell, SWT.NONE).setText("host: "
|
||||
|
|
|
@ -88,7 +88,7 @@ import com.raytheon.viz.core.slice.request.VerticalPointRequest.TimeDirection;
|
|||
import com.raytheon.viz.skewt.SkewtDisplay;
|
||||
import com.raytheon.viz.skewt.rscdata.SkewTResourceData;
|
||||
import com.raytheon.viz.ui.EditorUtil;
|
||||
import com.raytheon.viz.ui.BundleProductLoader;
|
||||
import com.raytheon.viz.ui.MenuLoader;
|
||||
import com.raytheon.viz.ui.UiUtil;
|
||||
import com.raytheon.viz.ui.editor.AbstractEditor;
|
||||
import com.raytheon.viz.ui.editor.IMultiPaneEditor;
|
||||
|
@ -114,7 +114,8 @@ import com.vividsolutions.jts.geom.LineString;
|
|||
* Jun 8, 2009 #2161 lvenable Initial creation
|
||||
* Mar 27, 2012 #14506 Qinglu Lin For cross section plot along a line of
|
||||
* latitude, swap xStart and xEnd.
|
||||
*
|
||||
* Jan 25, 2013 #15529 kshresth Fixed cross section "Unhandled event loop exception"
|
||||
* when loading contours and Image combo
|
||||
* </pre>
|
||||
*
|
||||
* @author lvenable
|
||||
|
@ -900,6 +901,8 @@ public class ProductTableComp extends Composite {
|
|||
CrossSectionDescriptor csDesc = csDisplay.getDescriptor();
|
||||
csDesc.setRenderableDisplay(csDisplay);
|
||||
|
||||
selectNewTableItem();
|
||||
|
||||
IDataCatalogEntry catalogEntry = getSelectedData().get(0)
|
||||
.getCatalogEntry();
|
||||
VBMenuBarItemsMgr.SpaceTimeMenu currentSpaceTime = dialogSettings
|
||||
|
@ -1078,7 +1081,7 @@ public class ProductTableComp extends Composite {
|
|||
|
||||
Bundle b = new Bundle();
|
||||
b.setDisplays(new AbstractRenderableDisplay[] { display });
|
||||
Job j = new BundleProductLoader(editor, b);
|
||||
Job j = new MenuLoader(b, editor);
|
||||
j.schedule();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -61,6 +61,8 @@ import com.vividsolutions.jts.geom.Polygon;
|
|||
* May 7, 2010 mschenke Initial creation
|
||||
* Jan 29, 2013 15723 Qinglu Lin Called warngenLayer.initRemovedGids() in move() and in run() of
|
||||
* AddVertexAction, DeleteVertextAction and MoveElementAction inner classes.
|
||||
* Jan 30, 2013 15439 Qinglu Lin Code were added to prevent nullPointException from occurring
|
||||
* when c2 is null for "case SINGLE_POINT" in move().
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -374,17 +376,19 @@ public class WarngenUIManager extends InputAdapter {
|
|||
break;
|
||||
}
|
||||
case SINGLE_POINT: {
|
||||
PolygonUtil.truncate(c2, 2);
|
||||
if (warngenLayer.isModifiedVertexNeedsToBeUpdated()) {
|
||||
int i = StormTrackUIManager.getCoordinateIndex(warngenLayer,
|
||||
state.getWarningPolygon().getCoordinates(), c2);
|
||||
if (i != -1) {
|
||||
this.movePointIndex = i;
|
||||
if (c2 != null) {
|
||||
PolygonUtil.truncate(c2, 2);
|
||||
if (warngenLayer.isModifiedVertexNeedsToBeUpdated()) {
|
||||
int i = StormTrackUIManager.getCoordinateIndex(warngenLayer,
|
||||
state.getWarningPolygon().getCoordinates(), c2);
|
||||
if (i != -1) {
|
||||
this.movePointIndex = i;
|
||||
}
|
||||
warngenLayer.setModifiedVertexNeedsToBeUpdated(false);
|
||||
}
|
||||
warngenLayer.setModifiedVertexNeedsToBeUpdated(false);
|
||||
movePointIndex = warngenLayer.translatePolygonVertex(
|
||||
this.movePointIndex, c2, false);
|
||||
}
|
||||
movePointIndex = warngenLayer.translatePolygonVertex(
|
||||
this.movePointIndex, c2, false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
0
cots/com.sun.xml.bind/com.sun.xml.bind.ecl
Normal file
0
cots/com.sun.xml.bind/com.sun.xml.bind.ecl
Normal file
0
cots/edu.uci.ics.crawler4j/edu.uci.ics.crawler4j.ecl
Normal file
0
cots/edu.uci.ics.crawler4j/edu.uci.ics.crawler4j.ecl
Normal file
0
cots/it.geosolutions/it.geosolutions.ecl
Normal file
0
cots/it.geosolutions/it.geosolutions.ecl
Normal file
0
cots/net.dods/net.dods.ecl
Normal file
0
cots/net.dods/net.dods.ecl
Normal file
0
cots/net.opengis/net.opengis.ecl
Normal file
0
cots/net.opengis/net.opengis.ecl
Normal file
0
cots/ogc.tools.gml/ogc.tools.gml.ecl
Normal file
0
cots/ogc.tools.gml/ogc.tools.gml.ecl
Normal file
0
cots/org.apache.commons.cxf/org.apache.commons.cxf.ecl
Normal file
0
cots/org.apache.commons.cxf/org.apache.commons.cxf.ecl
Normal file
0
cots/org.apache.ws.security/org.apache.ws.security.ecl
Normal file
0
cots/org.apache.ws.security/org.apache.ws.security.ecl
Normal file
0
cots/org.codehaus.jackson/org.codehaus.jackson.ecl
Normal file
0
cots/org.codehaus.jackson/org.codehaus.jackson.ecl
Normal file
|
@ -22,6 +22,8 @@ purge.cron=0+0/1+*+*+*+?
|
|||
purge.outgoing.cron=0+30+*+*+*+?
|
||||
# Interval at which the logs are purged
|
||||
purge.logs.cron=0+30+0+*+*+?
|
||||
# Interval at which the service backup logs are purged
|
||||
purge.svcbu.logs.cron=0+30+0+*+*+?
|
||||
|
||||
# Master switch to enable and disable purging
|
||||
purge.enabled=true
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
## VERSION AWIPS II 1.5 -- MAR 2 2012 OB12.2.1-4 ##
|
||||
## BY QINGLU LIN 7-31-2012 DR 15217 use roundAndPad ##
|
||||
## BY QINGLU LIN 8-14-2012 DR 14493 use TMLtime ##
|
||||
## BY QINGLU LIN 2-04-2013 DR 15198 Added <L></L> to ${area.name} for NEW. ##
|
||||
################################################################
|
||||
## Added Volcano Information in version 1.3 for sites where
|
||||
## Volcanoes affect their marine zones. If sites wish to hide
|
||||
|
@ -69,7 +70,7 @@ SPECIAL MARINE WARNING FOR...
|
|||
#end
|
||||
#foreach (${area} in ${areas})
|
||||
##
|
||||
${area.name}...
|
||||
<L>${area.name}...</L>
|
||||
#end
|
||||
##
|
||||
##
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
## VERSION AWIPS II 1.5 -- MAR 2 2012 OB12.2.1-4 ##
|
||||
## BY MGAMAZAYCHIKOV -- JUL 20 2012 DR15006 ##
|
||||
## BY QINGLU LIN 7-31-2012 DR 15217 use roundAndPad ##
|
||||
## BY QINGLU LIN 2-04-2013 DR 15198 Added <L></L> to ${area.name} for CON/CAN/(CON/CAN)/COR/EXP ##
|
||||
#####################################################
|
||||
## Added Volcano Information in version 1.3 for sites where
|
||||
## Volcanoes affect their marine zones. If sites wish to hide
|
||||
|
@ -87,7 +88,7 @@ THIS IS A TEST MESSAGE.##
|
|||
|
||||
THE AFFECTED AREAS WERE...
|
||||
#foreach (${area} in ${areas})
|
||||
${area.name}...
|
||||
<L>${area.name}...</L>
|
||||
#end
|
||||
|
||||
######################################################################
|
||||
|
@ -361,7 +362,7 @@ THIS IS A TEST MESSAGE.##
|
|||
|
||||
FOR THE FOLLOWING AREAS...
|
||||
#foreach (${area} in ${areas})
|
||||
${area.name}...
|
||||
<L>${area.name}...</L>
|
||||
#end
|
||||
|
||||
## Storm current location description
|
||||
|
@ -515,7 +516,7 @@ THIS IS A TEST MESSAGE.##
|
|||
|
||||
THE AFFECTED AREAS WERE...
|
||||
#foreach (${area} in ${cancelareas})
|
||||
${area.name}...
|
||||
<L>${area.name}...</L>
|
||||
#end
|
||||
|
||||
######################################################################
|
||||
|
@ -777,7 +778,7 @@ THIS IS A TEST MESSAGE.##
|
|||
|
||||
FOR THE FOLLOWING AREAS...
|
||||
#foreach (${area} in ${areas})
|
||||
${area.name}...
|
||||
<L>${area.name}...</L>
|
||||
#end
|
||||
|
||||
#if(${productClass}=="T")
|
||||
|
@ -1190,7 +1191,7 @@ THIS IS A TEST MESSAGE.##
|
|||
|
||||
FOR THE FOLLOWING AREAS...
|
||||
#foreach (${area} in ${areas})
|
||||
${area.name}...
|
||||
<L>${area.name}...</L>
|
||||
#end
|
||||
|
||||
#if(${productClass}=="T")
|
||||
|
@ -1330,7 +1331,7 @@ WILL EXPIRE AT ${dateUtil.format(${expire}, ${timeFormat.clock}, 15, ${localtime
|
|||
|
||||
THE AFFECTED AREAS WERE...
|
||||
#foreach (${area} in ${areas})
|
||||
${area.name}...
|
||||
<L>${area.name}...</L>
|
||||
#end
|
||||
|
||||
######################################################################
|
||||
|
|
|
@ -350,6 +350,14 @@
|
|||
<constructor-arg ref="CheckPermissionsRequestHandler" />
|
||||
</bean>
|
||||
|
||||
<bean id="CleanupSvcBuLogRequestHandler"
|
||||
class="com.raytheon.edex.plugin.gfe.server.handler.svcbu.CleanupSvcBuLogRequestHandler" />
|
||||
<bean factory-bean="handlerRegistry" factory-method="register">
|
||||
<constructor-arg
|
||||
value="com.raytheon.uf.common.dataplugin.gfe.request.CleaunpSvcBuLogRequest" />
|
||||
<constructor-arg ref="CleanupSvcBuLogRequestHandler" />
|
||||
</bean>
|
||||
|
||||
<bean id="NcCheckRequestHandler"
|
||||
class="com.raytheon.edex.plugin.gfe.server.handler.svcbu.NcCheckRequestHandler" />
|
||||
<bean factory-bean="handlerRegistry" factory-method="register">
|
||||
|
@ -489,6 +497,8 @@
|
|||
uri="clusteredquartz://gfe/exportDigitalData/?cron=${gfe.cron}" />
|
||||
<endpoint id="gfeLogPurgeCron"
|
||||
uri="clusteredquartz://gfe/purgeGfeLogs/?cron=${purge.logs.cron}" />
|
||||
<endpoint id="svcbuLogPurgeCron"
|
||||
uri="clusteredquartz://gfe/purgeSvcbuLogs/?cron=${purge.svcbu.logs.cron}" />
|
||||
|
||||
<route id="exportDigitalData">
|
||||
<from uri="exportDigitalDataCron" />
|
||||
|
@ -528,6 +538,22 @@
|
|||
</doTry>
|
||||
</route>
|
||||
|
||||
<route id="purgeSvcbuLogs">
|
||||
<from uri="svcbuLogPurgeCron" />
|
||||
<to uri="jms-generic:queue:purgeSvcbuLogWork" />
|
||||
</route>
|
||||
<route id="purgeSvcbuLogWork">
|
||||
<from uri="jms-generic:queue:purgeSvcbuLogWork" />
|
||||
<doTry>
|
||||
<bean ref="CleanupSvcBuLogRequestHandler" method="svcbuLogCleanupCron" />
|
||||
<doCatch>
|
||||
<exception>java.lang.Throwable</exception>
|
||||
<to
|
||||
uri="log:svcBackup?level=ERROR&showBody=false&showCaughtException=true&showStackTrace=true" />
|
||||
</doCatch>
|
||||
</doTry>
|
||||
</route>
|
||||
|
||||
<!-- ISC Data Receive route -->
|
||||
<route id="iscReceiveRoute">
|
||||
<from uri="jms-iscrec:queue:gfeIscDataReceive?concurrentConsumers=2&destinationResolver=#qpidDurableResolver" />
|
||||
|
|
|
@ -0,0 +1,78 @@
|
|||
/**
|
||||
* This software was developed and / or modified by Raytheon Company,
|
||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
*
|
||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
* This software product contains export-restricted data whose
|
||||
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
* to non-U.S. persons whether in the United States or abroad requires
|
||||
* an export license or other authorization.
|
||||
*
|
||||
* Contractor Name: Raytheon Company
|
||||
* Contractor Address: 6825 Pine Street, Suite 340
|
||||
* Mail Stop B8
|
||||
* Omaha, NE 68106
|
||||
* 402.291.0100
|
||||
*
|
||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.edex.plugin.gfe.server.handler.svcbu;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Random;
|
||||
import java.util.Timer;
|
||||
|
||||
import com.raytheon.edex.plugin.gfe.svcbackup.ServiceBackupNotificationManager;
|
||||
import com.raytheon.edex.plugin.gfe.svcbackup.SvcbuCleanupLogsTask;
|
||||
import com.raytheon.edex.plugin.gfe.svcbackup.SvcBackupUtil;
|
||||
import com.raytheon.uf.common.dataplugin.gfe.request.CleanupSvcBuLogRequest;
|
||||
import com.raytheon.uf.common.dataplugin.gfe.server.message.ServerResponse;
|
||||
import com.raytheon.uf.common.serialization.comm.IRequestHandler;
|
||||
|
||||
/**
|
||||
* TODO Add Description
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jan 3, 2013 jdynina Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author jdynina
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class CleanupSvcBuLogRequestHandler implements
|
||||
IRequestHandler<CleanupSvcBuLogRequest> {
|
||||
|
||||
private static Timer svcbuLogCleanTimer = new Timer(true);
|
||||
|
||||
@Override
|
||||
public Object handleRequest(CleanupSvcBuLogRequest request) {
|
||||
|
||||
ServerResponse<String> sr = new ServerResponse<String>();
|
||||
|
||||
try {
|
||||
ServiceBackupNotificationManager
|
||||
.sendMessageNotification("Running service backup log cleanup script");
|
||||
SvcBackupUtil.execute("cleanup_svcbu_logs");
|
||||
} catch (Exception e) {
|
||||
sr.addMessage("Error executing service backup log cleanup script! "
|
||||
+ e.getLocalizedMessage());
|
||||
}
|
||||
return sr;
|
||||
}
|
||||
|
||||
public void svcbuLogCleanupCron() throws Exception {
|
||||
Random rand = new Random(System.currentTimeMillis());
|
||||
Date executionDate = new Date(System.currentTimeMillis()
|
||||
+ Math.abs(rand.nextInt() % 45) * 60 * 1000);
|
||||
svcbuLogCleanTimer.schedule(new SvcbuCleanupLogsTask(executionDate),
|
||||
executionDate);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,72 @@
|
|||
/**
|
||||
* This software was developed and / or modified by Raytheon Company,
|
||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
*
|
||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
* This software product contains export-restricted data whose
|
||||
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
* to non-U.S. persons whether in the United States or abroad requires
|
||||
* an export license or other authorization.
|
||||
*
|
||||
* Contractor Name: Raytheon Company
|
||||
* Contractor Address: 6825 Pine Street, Suite 340
|
||||
* Mail Stop B8
|
||||
* Omaha, NE 68106
|
||||
* 402.291.0100
|
||||
*
|
||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.edex.plugin.gfe.svcbackup;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.TimerTask;
|
||||
|
||||
import com.raytheon.edex.plugin.gfe.server.handler.svcbu.CleanupSvcBuLogRequestHandler;
|
||||
import com.raytheon.uf.common.dataplugin.gfe.request.CleanupSvcBuLogRequest;
|
||||
|
||||
/**
|
||||
* TODO Add Description
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jan 3, 2013 jdynina Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author jdynina
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class SvcbuCleanupLogsTask extends TimerTask {
|
||||
|
||||
public SvcbuCleanupLogsTask(Date executionTime) {
|
||||
ServiceBackupNotificationManager
|
||||
.sendMessageNotification("Service backup log cleanup cron scheduled for execution at: "
|
||||
+ executionTime);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see java.util.TimerTask#run()
|
||||
*/
|
||||
@Override
|
||||
public void run() {
|
||||
ServiceBackupNotificationManager
|
||||
.sendMessageNotification("Cleanup service configuration logs cron started.");
|
||||
try {
|
||||
new CleanupSvcBuLogRequestHandler()
|
||||
.handleRequest(new CleanupSvcBuLogRequest());
|
||||
} catch (Exception e) {
|
||||
ServiceBackupNotificationManager
|
||||
.sendErrorMessageNotification(
|
||||
"Cleanup service backup logs cron failed to execute.",
|
||||
e);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -72,7 +72,7 @@ from com.raytheon.uf.edex.database.cluster import ClusterTask
|
|||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# 07/06/09 1995 bphillip Initial Creation.
|
||||
#
|
||||
# 01/17/13 15588 jdynina Fixed Publish history removal
|
||||
#
|
||||
#
|
||||
|
||||
|
@ -82,9 +82,8 @@ BATCH_DELAY = 0.0
|
|||
|
||||
ISC_USER="isc"
|
||||
|
||||
|
||||
class WECache(object):
|
||||
def __init__(self, we, tr=None):
|
||||
def __init__(self, we, tr=None):
|
||||
self._grids = []
|
||||
self._hist = []
|
||||
self._we = we
|
||||
|
@ -156,12 +155,17 @@ class WECache(object):
|
|||
index = bisect.bisect_left(map(lambda x : x[0], self._inv), tr[0])
|
||||
self._inv.insert(index, tr)
|
||||
history = ArrayList()
|
||||
|
||||
for h in hist:
|
||||
#strip out grid history to allow for publishing correctly
|
||||
#when merging Fcst/Official out of A1
|
||||
hh = GridDataHistory(h)
|
||||
hh.setPublishTime(None)
|
||||
history.add(hh)
|
||||
dbName = self._we.getParmid().getDbId().toString()
|
||||
if dbName.find('Fcst') != -1:
|
||||
#strip out publish time to allow for publishing correctly
|
||||
#when merging Fcst out of A1
|
||||
hh = GridDataHistory(h)
|
||||
hh.setPublishTime(None)
|
||||
history.add(hh)
|
||||
else:
|
||||
history.add(GridDataHistory(h))
|
||||
if gridType == 'SCALAR':
|
||||
self._we.setItemScalar(timeRange, grid.astype(numpy.float32), history)
|
||||
elif gridType == 'VECTOR':
|
||||
|
@ -321,7 +325,6 @@ class IscMosaic:
|
|||
"-n and -a altMask switches not compatible")
|
||||
raise Exception, "Bad command line"
|
||||
|
||||
|
||||
self.__inFiles = JUtil.pyValToJavaObj(self.__inFiles)
|
||||
self.__processTimePeriod = (startTime, endTime)
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
</levels>
|
||||
</gridParameterInfo>
|
||||
<gridParameterInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="parameterInfo">
|
||||
<short_name>tp</short_name>
|
||||
<short_name>tpHPCndfd</short_name>
|
||||
<long_name>6 hr Total Precip</long_name>
|
||||
<units>mm</units>
|
||||
<udunits>millimeter</udunits>
|
||||
|
|
|
@ -0,0 +1,48 @@
|
|||
/**
|
||||
* This software was developed and / or modified by Raytheon Company,
|
||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
*
|
||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
* This software product contains export-restricted data whose
|
||||
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
* to non-U.S. persons whether in the United States or abroad requires
|
||||
* an export license or other authorization.
|
||||
*
|
||||
* Contractor Name: Raytheon Company
|
||||
* Contractor Address: 6825 Pine Street, Suite 340
|
||||
* Mail Stop B8
|
||||
* Omaha, NE 68106
|
||||
* 402.291.0100
|
||||
*
|
||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.uf.common.dataplugin.gfe.request;
|
||||
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
||||
|
||||
/**
|
||||
* TODO Add Description
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jan 3, 2013 jdynina Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author jdynina
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
@DynamicSerialize
|
||||
public class CleanupSvcBuLogRequest extends AbstractGfeRequest {
|
||||
|
||||
public CleanupSvcBuLogRequest() {
|
||||
|
||||
}
|
||||
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue