Merge branch 'development_on_ss_builds' (with 12.9.1-5) into development

Conflicts:
	cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/rsc/general/D2DGribGridResource.java
	cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/PlotModelDataRequestJob.java
	cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/PlotModelGeneratorJob.java
	cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/config/DbPointSourceDataAdaptor.java
	cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/template/TemplateRunner.java
	cave/com.raytheon.viz.warnings/src/com/raytheon/viz/warnings/rsc/AbstractWarningResource.java
	edexOsgi/com.raytheon.uf.common.geospatial/src/com/raytheon/uf/common/geospatial/interpolation/data/UnsignedByteArrayWrapper.java

Former-commit-id: b9db13cf5bff60511d815f92f0239a4313498265
This commit is contained in:
Steve Harris 2012-08-27 09:52:41 -05:00
commit a71dac6cad
446 changed files with 21205 additions and 12977 deletions

View file

@ -30,6 +30,6 @@
<request> <productCode>34</productCode> <pdw20>16</pdw20> </request>
<request> <productCode>34</productCode> <pdw20>32</pdw20> </request>
</cronOTR>
<cronOTR cron="0 0 * * * ?" productCode="173" randomWait="600" hoursBack="3" wmo="SDUS8" nnn="DU3"/>
<cronOTR cron="0 0 12 * * ?" productCode="173" randomWait="600" hoursBack="24" wmo="SDUS8" nnn="DU6"/>
<cronOTR cron="0 10 * * * ?" productCode="173" randomWait="300" hoursBack="3" wmo="SDUS8" nnn="DU3"/>
<cronOTR cron="0 10 12 * * ?" productCode="173" randomWait="300" hoursBack="24" wmo="SDUS8" nnn="DU6"/>
</cronOTRConfiguration>

View file

@ -21,14 +21,18 @@ package com.raytheon.rcm.server;
import java.io.File;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Scanner;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadFactory;
import com.raytheon.rcm.event.RadarEvent;
import com.raytheon.rcm.event.RadarEventAdapter;
/**
* TODO Add Description
* Send AlertViz notifications
*
* <pre>
*
@ -37,6 +41,7 @@ import com.raytheon.rcm.event.RadarEventAdapter;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Nov 9, 2011 mnash Initial creation
* 2012-07-27 DR 14896 D. Friedman Handle multiple RPGs.
*
* </pre>
*
@ -46,13 +51,15 @@ import com.raytheon.rcm.event.RadarEventAdapter;
public class RadarServerAvailable extends RadarEventAdapter {
private static boolean attempted = false;
private static final String CONNECTION_DOWN_MESSAGE = "RPG connection is down.";
private static final String CONNECTION_UP_MESSAGE = "RPG connection is back up.";
private static final String AWIPS2_FXA_PROPERTY = "awips2_fxa";
private static final String DEFAULT_AWIPS2_FXA = "/awips2/fxa";
private static final String ANNOUNCER_PATH = "bin" + File.separator + "fxaAnnounce";
private ProcessBuilder builder;
private HashSet<String> knownFailures = new HashSet<String>();
/**
*
*/
public RadarServerAvailable(RadarServer server) {
}
@ -65,64 +72,73 @@ public class RadarServerAvailable extends RadarEventAdapter {
*/
@Override
public void handleRadarEvent(RadarEvent event) {
Process proc = null;
String home = System.getProperty("awips2_fxa");
if (home != null && !home.endsWith(File.separator)) {
home += File.separator;
} else if (home == null) {
Log.event("Cannot find awips2_fxa system variable");
return;
}
List<String> values = new ArrayList<String>();
values.add(home + "bin" + File.separator + "fxaAnnounce");
try {
if (event.getType() == RadarEvent.CONNECTION_ATTEMPT_FAILED) {
if (!attempted) {
Log.event("Executing " + values.get(0));
values.add(event.getRadarID() + " rpg connection is down.");
values.add("RADAR");
values.add("URGENT");
builder = new ProcessBuilder(values);
builder.redirectErrorStream(true);
proc = builder.start();
StringBuilder output = new StringBuilder();
Scanner s = new Scanner(proc.getInputStream());
while (s.hasNextLine()) {
if (output.length() > 0)
output.append('\n');
output.append(s.nextLine());
}
proc.waitFor();
attempted = true;
}
} else if (event.getType() == RadarEvent.CONNECTION_UP) {
if (attempted) {
Log.event("Executing " + values.get(0));
values.add(event.getRadarID()
+ " rpg connection is back up.");
values.add("RADAR");
values.add("URGENT");
builder = new ProcessBuilder(values);
builder.redirectErrorStream(true);
proc = builder.start();
StringBuilder output = new StringBuilder();
Scanner s = new Scanner(proc.getInputStream());
while (s.hasNextLine()) {
if (output.length() > 0)
output.append('\n');
output.append(s.nextLine());
}
proc.waitFor();
attempted = false;
}
final String radarId = event.getRadarID();
if (event.getType() == RadarEvent.CONNECTION_ATTEMPT_FAILED) {
if (! knownFailures.contains(radarId)) {
knownFailures.add(radarId);
sendNotification(radarId, CONNECTION_DOWN_MESSAGE);
}
} else if (event.getType() == RadarEvent.CONNECTION_UP) {
if (knownFailures.contains(radarId)) {
knownFailures.remove(radarId);
sendNotification(radarId, CONNECTION_UP_MESSAGE);
}
}
}
private void sendNotification(final String radarId, final String message) {
getExecutorService().submit(new Runnable() {
@Override
public void run() {
sendNotification2(radarId, message);
}
});
}
private void sendNotification2(String radarId, String message) {
ProcessBuilder builder;
Process proc = null;
String fxaDir = System.getProperty(AWIPS2_FXA_PROPERTY);
if (fxaDir == null)
fxaDir = DEFAULT_AWIPS2_FXA;
List<String> values = new ArrayList<String>();
values.add(fxaDir + File.separator + ANNOUNCER_PATH);
Log.event("Executing " + values.get(0));
values.add(radarId + ' ' + message);
values.add("RADAR");
values.add("URGENT");
builder = new ProcessBuilder(values);
builder.redirectErrorStream(true);
try {
proc = builder.start();
Scanner s = new Scanner(proc.getInputStream());
while (s.hasNextLine())
s.nextLine();
proc.waitFor();
} catch (Exception e) {
e.printStackTrace();
Log.errorf("Error running fxaAnnounce: %s", e);
} finally {
if (proc != null) {
proc.destroy();
}
}
}
// TODO: has to be daemon until there is a shutdown notification
private static ExecutorService executorService = Executors
.newSingleThreadExecutor(new ThreadFactory() {
@Override
public Thread newThread(Runnable r) {
Thread t = new Thread(r);
t.setDaemon(true);
return t;
}
});
private static ExecutorService getExecutorService() {
return executorService;
}
}

View file

@ -178,10 +178,6 @@
<param name="feature"
value="com.raytheon.uf.viz.localization.perspective.feature" />
</antcall>
<antcall target="p2.build.repo">
<param name="feature"
value="com.raytheon.uf.viz.alertviz.localization.feature" />
</antcall>
<antcall target="p2.build.repo">
<param name="feature"
value="com.raytheon.viz.radar.feature" />

View file

@ -21,10 +21,11 @@
<!--
Date DR# Engineer Description
03/26/2012 12864 zhao Changed CigVisTrendTimeout from 300 to 1800
07/27/2012 15169 zhao Changed WindRoseTimeout from 20 to 120
-->
<ClimateTimeouts>
<ClimateMetarTimeout>20</ClimateMetarTimeout>
<WindRoseTimeout>20</WindRoseTimeout>
<WindRoseTimeout>120</WindRoseTimeout>
<CigVisDistTimeout>90</CigVisDistTimeout>
<CigVisTrendTimeout>1800</CigVisTrendTimeout>
</ClimateTimeouts>

View file

@ -26,6 +26,10 @@
# DELIVERED
#
# History:
# Revision 17
# Created: 10-AUG-2012 15:00:00 GZHANG
# DR 14702: Added fix for PyTables in Gui().trend()
#
# Revision 16 (DELIVERED)
# Created: 06-MAR-2008 17:01:20 OBERFIEL
# Added fix for leap-years.
@ -661,7 +665,7 @@ class Gui():
n1 = max(0, n-2*int((t-t1)//3600.0)-1) # small enough
n2 = n1 + 5*self.MaxHours # big enough
data = [(row['date_time'], row['cig'], row['vis']) for row in \
table.where('(t1<=date_time) & (date_time<t2)')]
table.where('(t1<=date_time) & (date_time<t2)', start=n1, stop=n2)]
process_data(count, data, t1, self.MaxHours, table)
# calculate frequencies
args = count.keys()

View file

@ -94,7 +94,7 @@
#
#
import logging, re, time
import Avn, AvnLib, Busy, TafDecoder, AvnParser
import Avn, AvnLib, TafDecoder, AvnParser
_Logger = logging.getLogger(Avn.CATEGORY)
_AmdPat = re.compile(r'(AFT|TIL)\s+(\d{6})|(\d{4}/\d{4})')
@ -175,8 +175,7 @@ def updateTafs(bbb, fcsts):
badidents.append(ident)
if badidents:
Busy.showwarning('Could not update times for %s' % ' '.join(badidents),
master)
_Logger.warning('Could not update times for %s' % ' '.join(badidents))
return fcsts

View file

@ -78,7 +78,7 @@
#
#
import logging, time
import Avn, AvnLib, AvnParser, Busy, Globals, TafDecoder
import Avn, AvnLib, AvnParser, TafDecoder
import MetarData
@ -120,7 +120,6 @@ def updateTafs(bbb, fcsts):
badidents.append(ident)
if badidents:
Busy.showwarning('Could not update TAFs for %s' % ' '.join(badidents),
master)
_Logger.warning('Could not update TAFs for %s' % ' '.join(badidents))
return fcsts

View file

@ -354,10 +354,10 @@ MaxMenuItemsBeforeCascade = 30
# Defines the percent that the office domain will be expanded for the
# spatial editor full-screen view. The user can specify the expansion
# for each of the four directions. If not specified, the default is 10%.
OfficeDomain_expandLeft = 10 # ifpIMAGE only
OfficeDomain_expandRight = 10 # ifpIMAGE only
OfficeDomain_expandTop = 10 # ifpIMAGE only
OfficeDomain_expandBottom = 10 # ifpIMAGE only
OfficeDomain_expandLeft = 10
OfficeDomain_expandRight = 10
OfficeDomain_expandTop = 10
OfficeDomain_expandBottom = 10
# Initial location of Edit Action Dialog
# These are absolute screen coordinates (not relative to GFE window)

View file

@ -1,207 +1,99 @@
##
# 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.
##
# ----------------------------------------------------------------------------
# This software is in the public domain, furnished "as is", without technical
# support, and with no warranty, express or implied, as to its usefulness for
# any purpose.
#
#
# QPF_SmartTool.py
# This is an example of a more complicated tool.
# It determines a QPF value based on the current QPF value,
# the Wind value, and surrounding Topography
# information.
#
# It has sub-methods that are called by the main method.
# These sub-methods calculate Vertical Motion and translate
# it into a QPF term.
#
# Author: wier (translated to Python by hansen)
# Updated by hansen 1/00 based on suggestions from Rusty Billingsley
# Updated by njensen for AWIPS-II
# ----------------------------------------------------------------------------
WeatherElementEdited = "QPF"
ToolType = "numeric"
WeatherElementEdited = "QPF"
from numpy import *
import MetLib, time
HideTool = 0
# You can screen the elements for which your tool will appear by using
# a ScreenList. For example:
#
VariableList = [
("Vertical Motion Influence" , 50, "scale", [0,100]),
("Vertical Motion Influence" , 50, "scale", [0,100]),
]
# This allows us to use the sin and cos functions
from math import *
from numpy import *
AVG_GRID_SPACE = 10000
RAD_TO_DEG = 57.2958
####################
# QPF Smart Tool
# Set up Class
import SmartScript
# For available commands, see SmartScript
class Tool (SmartScript.SmartScript):
def __init__(self, dbss):
SmartScript.SmartScript.__init__(self, dbss)
def execute(self, QPF, Wind, Topo, varDict):
"Sets QPF within Active Edit Area based on Wind and Topo."
# Smooths the specified grid by the specified factor
# With factor == 3, 3x3 smooth, factor == 5 5x5 smooth, etc.
# Even factors (4, 6, 8,...) round up to the next odd value
# If factors <3 are specified, the unmodified grid is returned.
def smoothGrid(self, grid, factor):
# factors of less than 3 are useless or dangerous
if factor < 3:
return grid
st = time.time()
half = int(factor)/ 2
sg = zeros(grid.shape,float64)
count = zeros(grid.shape,float64)
gridOfOnes = ones(grid.shape,float64)
for y in xrange(-half, half + 1):
for x in xrange(-half, half + 1):
if y < 0:
yTargetSlice = slice(-y, None, None)
ySrcSlice = slice(0, y, None)
if y == 0:
yTargetSlice = slice(0, None, None)
ySrcSlice = slice(0, None, None)
if y > 0:
yTargetSlice = slice(0, -y, None)
ySrcSlice = slice(y, None, None)
if x < 0:
xTargetSlice = slice(-x, None, None)
xSrcSlice = slice(0, x, None)
if x == 0:
xTargetSlice = slice(0, None, None)
xSrcSlice = slice(0, None, None)
if x > 0:
xTargetSlice = slice(0, -x, None)
xSrcSlice = slice(x, None, None)
VerticalMotion_Grid = self.VerticalMotionGrid(Wind, Topo)
scale = varDict["Vertical Motion Influence"] / 50.0
value = QPF * (1.0 + scale * VerticalMotion_Grid)
return value.astype('float32')
def VerticalMotionGrid(self, Wind_Grid, Topo_Grid):
# Create Vertical Motion grid from Wind Grid and Topography
# The Topo_Grid is a 2-D array where
# each entry is a scalar elevation, for example:
# x = 0
# y = 0
# elevation = Topo_Grid[x][y]
# The Wind_Grid is 2-D array where
# each entry is a 2-tuple of magnitude and direction,
# for example:
# wind_tuple = Wind_Grid[x][y]
# magnitude = wind_tuple[0]
# direction = wind_tuple[1]
# Create a VerticalMotion_Grid that is
# a 2-D array
xGridSize = len(Topo_Grid)
yGridSize = len(Topo_Grid[0])
vmArray = []
first = 1
for x in range(xGridSize):
# Add a new column
vmArray = zeros(Topo_Grid.shape)
for y in range(yGridSize):
# Calculate the value for this point
wind_tuple = (Wind_Grid[0][x][y], Wind_Grid[1][x][y])
vmValue = self.VerticalMotion(wind_tuple,Topo_Grid,x,y)
# Set the value
vmArray[x][y] = vmValue
# Keep track of min/max values
if first:
first = 0
min = vmValue
max = vmValue
else:
if vmValue < min:
min = vmValue
if vmValue > max:
max = vmValue
# Now normalize the grid to values between -1 and 1
factor1 = (max + min) / 2
factor2 = (max-min) / 2
for x in range(xGridSize):
for y in range(yGridSize):
vmArray[x][y] = (vmArray[x][y] - factor1) / factor2
return vmArray
def VerticalMotion(self, Wind, Topo_Grid, x,y):
# wind is a 2-tuple: wind[0] is magnitude, wind[1] is direction
magnitude = Wind[0]
direction = Wind[1]
# Determine wind u and v components.
# First compute wind vector angle from north, in radians.
rads = (direction - 180) / RAD_TO_DEG
# u and v components
# (convert from knots to meters per second 1.94384 knots / m/s )
uw = sin(rads) * magnitude / 1.94384
vw = cos(rads) * magnitude / 1.94384
# find slope vector components (svx, svy) at this point (x, y).
# Direction is that of maximum slope and magnitude is the
# slope = rise/run, unitless.
svx, svy = self.findSlopeVector(x, y, Topo_Grid)
# multiply (dot product) wind vector by slope vector
# to get the value of the vertical air motion.
vertAirSpeed = uw * svx + vw * svy
return vertAirSpeed
def findSlopeVector(self, x,y, Topo_Grid):
# the Topo_Grid of the center grid point at x,y.
# Topo_Grid is a tuple of tuples representing a 2-D grid.
sumxcomp = sumycomp = count = 0
centerh = Topo_Grid[x][y]
gridSizeX = len(Topo_Grid)
gridSizeY = len(Topo_Grid[0])
for i in range(x-1, x+2):
for j in range(y-1, y+2):
# skip indices beyond limits of grid
if i < 0 or j < 0 or i >= gridSizeX or j >= gridSizeY:
continue
# components of vector pointing from the center xc,yc
# to the grid point (i,j)
xcomp = i-x
ycomp = j-y
# if at center point; distance is 0, do not compute
if i == x and j == y:
continue
# distance between pair of grid points
dist = AVG_GRID_SPACE * sqrt(xcomp*xcomp + ycomp*ycomp)
# error trap to avoid 0 divide; should never occur
if dist == 0.0:
continue
# slope from center to the other grid point; + if up from center
# (dist and _Topo_Grid values must be in same units)
slope = (Topo_Grid[i][j] - centerh) / dist
# multiply original components by slope to get the slope vector
# components from (xc,yc) to (i,j),
# and add into summation of all x and y components
sumxcomp += xcomp * slope
sumycomp += ycomp * slope
count += 1
# average all slope vectors to neighbor points
svx = sumxcomp / count
svy = sumycomp / count
# ensure "reasonable" values - less than 45 degrees
if abs(svx) > 1.0:
svx /= abs(svx)
if abs(svy) > 1.0:
svy /= abs(svy)
return svx, svy
target = [yTargetSlice, xTargetSlice]
src = [ySrcSlice, xSrcSlice]
sg[target] += grid[src]
count[target] += gridOfOnes[src]
return sg / count
# Required Method: Execute
# %comment
# Fill in the arguments you want to use -- WeatherElement1, WeatherElement2...
def execute(self, QPF, Wind, varDict):
# get the scale value
scale = float(varDict["Vertical Motion Influence"]) / 50.0
# Calculate the gridient of the topoGrid
topoGrid = self.getTopo()
d_dx, d_dy = MetLib.gradient(topoGrid)
# Convert wind to u and v components
u, v = self.MagDirToUV(Wind[0], Wind[1])
# Calculate the dot product which is positive when wind blows
# upslope and negative when it blows downslope
dotGrid = MetLib.dot((d_dx, d_dy), (u, -v)) / 5000.0
dotGrid = self.smoothGrid(dotGrid, 9)
# adjust the existing QPF grid using the scale and dot product
QPF = QPF * (1 + scale * dotGrid)
return QPF

View file

@ -122,8 +122,6 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis):
if type(key) is types.TupleType:
label, variable = key
exec "self._" + variable + "= varDict[key]"
else:
exec "self._" + key + "= varDict[key]"
# Make argDict accessible
self.__argDict = argDict

View file

@ -18,6 +18,7 @@
# further licensing information.
##
import TimeRange, AbsTime
import logging
import TextFormatter
import time, os, string, inspect, sys
@ -288,6 +289,17 @@ def runFormatter(databaseID, site, forecastList, cmdLineVarDict, vtecMode,
logger.info("Text Formatter Finished")
return forecasts
def getAbsTime(timeStr):
"Create an AbsTime from a string: YYYYMMDD_HHMM"
year = int(timeStr[0:4])
month = int(timeStr[4:6])
day = int(timeStr[6:8])
hour = int(timeStr[9:11])
minute = int(timeStr[11:13])
return AbsTime.absTimeYMD(year, month, day, hour, minute)
def writeToFile(forecasts, outputFile, mode):
if not outputFile is None and outputFile != "":
outfile = open(outputFile, mode)
@ -427,4 +439,4 @@ def reloadModule(moduleName):
except:
logger.exception("Import Failed " + moduleName)

View file

@ -796,7 +796,7 @@ class SmartScript(BaseTool.BaseTool):
if "A" == status:
importance = Priority.PROBLEM
elif "R" == status:
importance = Priority.EVENTA
importance = Priority.EVENTB
elif "U" == status:
importance = Priority.CRITICAL
else:

View file

0
cave/build/static/linux/cave/caveEnvironment/bin/tmcp Executable file → Normal file
View file

View file

@ -1,17 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>com.raytheon.uf.viz.alertviz.localization.feature</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.pde.FeatureBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.FeatureNature</nature>
</natures>
</projectDescription>

View file

@ -1 +0,0 @@
bin.includes = feature.xml

View file

@ -1,33 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<feature
id="com.raytheon.uf.viz.alertviz.localization.feature"
label="Alertviz Localization Feature"
version="1.0.0.qualifier"
provider-name="RAYTHEON">
<description url="http://www.example.com/description">
[Enter Feature Description here.]
</description>
<copyright url="http://www.example.com/copyright">
[Enter Copyright Description here.]
</copyright>
<license url="http://www.example.com/license">
[Enter License Description here.]
</license>
<requires>
<import feature="com.raytheon.uf.viz.common.core.feature" version="1.0.0.qualifier"/>
<import feature="com.raytheon.uf.viz.core.feature" version="1.0.0.qualifier"/>
<import feature="com.raytheon.uf.viz.eclipse.feature" version="1.0.0.qualifier"/>
</requires>
<plugin
id="com.raytheon.uf.viz.alertviz.localization"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
</feature>

View file

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View file

@ -1,28 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>com.raytheon.uf.viz.alertviz.localization</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View file

@ -1,7 +0,0 @@
#Mon Apr 04 17:11:52 CDT 2011
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6

View file

@ -1,25 +0,0 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Ui Plug-in
Bundle-SymbolicName: com.raytheon.uf.viz.alertviz.localization;singleton:=true
Bundle-Version: 1.12.1174.qualifier
Bundle-Activator: com.raytheon.uf.viz.alertviz.Activator
Bundle-Vendor: Raytheon
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
com.raytheon.uf.common.localization,
com.raytheon.uf.common.message;bundle-version="1.11.11",
com.raytheon.uf.viz.alertviz;bundle-version="1.11.11"
Bundle-ActivationPolicy: lazy
Eclipse-RegisterBuddy: com.raytheon.uf.common.serialization
Export-Package: com.raytheon.uf.viz.alertviz.localization,
com.raytheon.uf.viz.alertviz.localization.actions
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Import-Package: com.raytheon.uf.common.alertmonitor,
com.raytheon.uf.common.util,
com.raytheon.uf.viz.localization,
com.raytheon.uf.viz.localization.adapter,
com.raytheon.uf.viz.localization.filetreeview,
com.raytheon.uf.viz.localization.service,
com.raytheon.viz.ui,
com.raytheon.viz.ui.dialogs

View file

@ -1,5 +0,0 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
plugin.xml

View file

@ -1,102 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
This_software_was_developed_and_/_or_modified_by_Raytheon_Company,
pursuant_to_Contract_DG133W-05-CQ-1067_with_the_US_Government.
U.S._EXPORT_CONTROLLED_TECHNICAL_DATA
This_software_product_contains_export-restricted_data_whose
export/transfer/disclosure_is_restricted_by_U.S._law._Dissemination
to_non-U.S._persons_whether_in_the_United_States_or_abroad_requires
an_export_license_or_other_authorization.
Contractor_Name:________Raytheon_Company
Contractor_Address:_____6825_Pine_Street,_Suite_340
________________________Mail_Stop_B8
________________________Omaha,_NE_68106
________________________402.291.0100
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
further_licensing_information.
-->
<?eclipse version="3.2"?>
<plugin>
<extension
point="com.raytheon.uf.viz.localization.localizationpath">
<path
application="Alertviz"
localizationType="CAVE_STATIC"
name="Configurations"
value="alertViz/configurations"
recursive="false"
localizationAdapter="com.raytheon.uf.viz.alertviz.localization.AlertVizLocalizationAdapter"
extensionFilter=".xml">
</path>
</extension>
<extension
point="com.raytheon.uf.viz.localization.localizationpath">
<path
application="Alertviz"
localizationType="CAVE_STATIC"
name="Python"
value="alertViz/python"
recursive="false"
localizationAdapter="com.raytheon.uf.viz.alertviz.localization.AlertVizLocalizationAdapter"
extensionFilter=".py">
</path>
</extension>
<extension
point="com.raytheon.uf.viz.localization.localizationpath">
<path
application="Alertviz"
localizationType="CAVE_STATIC"
name="Audio"
value="alertVizAudio"
recursive="false"
localizationAdapter="com.raytheon.uf.viz.alertviz.localization.AlertVizLocalizationAdapter"
extensionFilter=".wav">
</path>
</extension>
<extension
point="com.raytheon.uf.viz.localization.localizationpath">
<path
application="Alertviz"
localizationType="CAVE_STATIC"
name="Monitor Icons"
value="monitorIcons"
recursive="false"
localizationAdapter="com.raytheon.uf.viz.alertviz.localization.AlertVizLocalizationAdapter"
extensionFilter=".png">
</path>
</extension>
<extension
point="com.raytheon.uf.viz.localization.localizationpath">
<path
application="Alertviz"
localizationType="CAVE_STATIC"
name="Forced configuration"
value="alertViz"
recursive="false"
extensionFilter=".xml">
</path>
</extension>
<extension
point="com.raytheon.uf.viz.localization.localizationpath">
<path
application="Alertviz"
localizationType="CAVE_STATIC"
name="Custom Repository"
value="alertViz/customizations"
recursive="false"
extensionFilter=".xml">
</path>
</extension>
<!--extension
point="org.eclipse.ui.editors">
<editor
default="true"
id="com.raytheon.viz.alertviz.ui.configuration.editor"
name="AlertViz Configuration Editor" extensions="xml"
class="com.raytheon.uf.viz.alertviz.localization.editor.AlertVizConfigurationEditorPart">
</editor>
</extension-->
</plugin>

View file

@ -1,78 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.viz.alertviz.localization;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.jface.action.IMenuManager;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
import com.raytheon.uf.viz.alertviz.localization.actions.AlertVizFileImportAction;
import com.raytheon.uf.viz.localization.adapter.LocalizationPerspectiveAdapter;
import com.raytheon.uf.viz.localization.filetreeview.FileTreeEntryData;
/**
* Localization perspective adapter for AlertViz.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Apr 04, 2011 5853 bgonzale Initial creation
*
* </pre>
*
* @author bgonzale
* @version 1.0
*/
public class AlertVizLocalizationAdapter extends LocalizationPerspectiveAdapter {
private static final Map<String, LocalizationLevel> localizationMap = getLocalizationMap();
@Override
public boolean addContextMenuItems(IMenuManager menuMgr,
FileTreeEntryData[] selectedData) {
if (selectedData.length == 1) {
FileTreeEntryData selected = selectedData[0];
if (selected.getClass() == FileTreeEntryData.class) {
LocalizationLevel level = localizationMap.get(selected
.getName());
menuMgr.add(new AlertVizFileImportAction(
(FileTreeEntryData) selected, level));
return true;
}
}
return false;
}
private static Map<String, LocalizationLevel> getLocalizationMap() {
Map<String, LocalizationLevel> map = new HashMap<String, LocalizationLevel>();
map.put("Audio", LocalizationLevel.SITE);
map.put("Configurations", LocalizationLevel.USER);
map.put("Scripts", LocalizationLevel.SITE);
map.put("Python", LocalizationLevel.SITE);
return map;
}
}

View file

@ -1,161 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.viz.alertviz.localization.actions;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import org.eclipse.jface.action.Action;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Shell;
import com.raytheon.uf.common.localization.IPathManager;
import com.raytheon.uf.common.localization.LocalizationContext;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.viz.localization.filetreeview.FileTreeEntryData;
import com.raytheon.viz.ui.VizWorkbenchManager;
/**
* Opens a file dialog for importing files.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Apr 04, 2011 5853 bgonzale Initial creation
*
* </pre>
*
* @author bgonzale
* @version 1.0
*/
public class AlertVizFileImportAction extends Action {
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(AlertVizFileImportAction.class, "GDN_ADMIN",
"GDN_ADMIN");
private static final String PLUGIN_ID = "com.raytheon.uf.viz.alertviz.ui";
private static final String ASTERISK = "*";
private static final String ALL_FILES = "*.*";
private LocalizationLevel level;
private String[] extensions;
private String path;
/**
* @param fileEntry
*
*/
public AlertVizFileImportAction(FileTreeEntryData fileEntry) {
this(fileEntry, LocalizationLevel.USER);
}
/**
* @param fileEntry
* @param level
*
*/
public AlertVizFileImportAction(FileTreeEntryData fileEntry,
LocalizationLevel level) {
super("Import");
this.level = level == null ? LocalizationLevel.USER : level;
this.path = fileEntry.getPath();
String[] fileEntryExtensions = fileEntry.getPathData().getFilter();
this.extensions = new String[fileEntryExtensions.length + 1];
for (int i = 0; i < fileEntryExtensions.length; ++i) {
this.extensions[i] = ASTERISK + fileEntryExtensions[i];
}
this.extensions[this.extensions.length - 1] = ALL_FILES;
}
@Override
public void run() {
Shell shell = VizWorkbenchManager.getInstance().getCurrentWindow()
.getShell();
FileDialog fd = new FileDialog(shell, SWT.OPEN | SWT.MULTI);
fd.setText("Import " + level + " File");
fd.setFilterExtensions(extensions);
fd.setFilterPath(System.getProperty("user.home"));
String fileName = fd.open();
if (fileName != null) {
File file = new File(fileName);
if (file.exists() && file.isFile()) {
IPathManager pm = PathManagerFactory.getPathManager();
LocalizationContext ctx = pm.getContext(
LocalizationType.CAVE_STATIC, level);
LocalizationFile locFile = pm.getLocalizationFile(ctx, path
+ File.separator + file.getName());
try {
saveToLocalizationFile(file, locFile);
} catch (FileNotFoundException e) {
statusHandler.handle(Priority.PROBLEM,
e.getLocalizedMessage(), e);
} catch (IOException e) {
statusHandler.handle(Priority.PROBLEM,
e.getLocalizedMessage(), e);
} catch (LocalizationOpFailedException e) {
statusHandler.handle(Priority.CRITICAL,
"Error Importing file " + fileName, e);
}
}
}
}
private void saveToLocalizationFile(File file, LocalizationFile locFile)
throws IOException, LocalizationOpFailedException {
File newFile = locFile.getFile();
InputStream in = new FileInputStream(file);
OutputStream out = new FileOutputStream(newFile);
byte[] buff = new byte[1024];
int len;
while ((len = in.read(buff)) > 0) {
out.write(buff, 0, len);
}
in.close();
out.close();
locFile.save();
}
}

View file

@ -341,7 +341,7 @@ public class FileSelectDlg extends Dialog {
importNewBtn1.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
FileDialog newFileDlg = new FileDialog(shell, SWT.OPEN
| SWT.MULTI);
| SWT.SINGLE);
newFileDlg.setFilterExtensions(fileExtensions);
String newFileName = newFileDlg.open();
if (newFileName != null) {

View file

@ -27,5 +27,79 @@
id="com.raytheon.viz.notification.statusHandler">
</statusHandler>
</extension>
<extension
point="com.raytheon.uf.viz.localization.localizationpath">
<path
application="Alertviz"
localizationType="CAVE_STATIC"
name="Configurations"
value="alertViz/configurations"
recursive="false"
extensionFilter=".xml">
</path>
</extension>
<extension
point="com.raytheon.uf.viz.localization.localizationpath">
<path
application="Alertviz"
localizationType="CAVE_STATIC"
name="Python"
value="alertViz/python"
recursive="false"
extensionFilter=".py">
</path>
</extension>
<extension
point="com.raytheon.uf.viz.localization.localizationpath">
<path
application="Alertviz"
localizationType="CAVE_STATIC"
name="Audio"
value="alertVizAudio"
recursive="false"
extensionFilter=".wav">
</path>
</extension>
<extension
point="com.raytheon.uf.viz.localization.localizationpath">
<path
application="Alertviz"
localizationType="CAVE_STATIC"
name="Monitor Icons"
value="monitorIcons"
recursive="false"
extensionFilter=".png">
</path>
</extension>
<extension
point="com.raytheon.uf.viz.localization.localizationpath">
<path
application="Alertviz"
localizationType="CAVE_STATIC"
name="Forced configuration"
value="alertViz"
recursive="false"
extensionFilter=".xml">
</path>
</extension>
<extension
point="com.raytheon.uf.viz.localization.localizationpath">
<path
application="Alertviz"
localizationType="CAVE_STATIC"
name="Custom Repository"
value="alertViz/customizations"
recursive="false"
extensionFilter=".xml">
</path>
</extension>
<!--extension
point="org.eclipse.ui.editors">
<editor
default="true"
id="com.raytheon.viz.alertviz.ui.configuration.editor"
name="AlertViz Configuration Editor" extensions="xml"
class="com.raytheon.uf.viz.alertviz.localization.editor.AlertVizConfigurationEditorPart">
</editor>
</extension-->
</plugin>

View file

@ -22,7 +22,7 @@
</bean>
<!-- FIXME: Uncomment to re-enable cache at CAVE startup
<bean id="gfeDiskCache" class="com.raytheon.uf.common.cache.DiskCache" init-method="activateCache">
<bean id="gfeDiskCache" class="com.raytheon.uf.common.cache.disk.DiskCache" init-method="activateCache">
<property name="name" value="GFE"/> -->
<!-- TODO: Make this an envionment variable that's passed in -->
<!-- Cache directory relative to caveData/etc/workstation/${host} default is diskCache, will be followed by ${NAME}/${PID} -->

View file

@ -50,7 +50,10 @@ import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.localization.LocalizationManager;
/**
* Creates uEngine scripts on the fly.
* Creates uEngine scripts on the fly. DEPRECATED: Requests from viz should go
* through ThriftClient to the thrift service instead of using ScriptCreator and
* then going to the uengine service. The thrift service performs faster and is
* more maintainable. Use ThriftClient.
*
* <pre>
*
@ -73,6 +76,7 @@ import com.raytheon.uf.viz.core.localization.LocalizationManager;
* @author brockwoo
* @version 1
*/
@Deprecated
public class ScriptCreator {
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(ScriptCreator.class);

View file

@ -34,7 +34,7 @@ import org.eclipse.core.runtime.jobs.Job;
* if you have dozens or hundreds of tasks that each take a short time. Creating
* a job for each task can result in more threads than is useful. If you instead
* use a JobPool it reduces the number of threads by limiting the number of
* eclipse jobs tBhat are created. For many tasks a JobPool may perform faster
* eclipse jobs that are created. For many tasks a JobPool may perform faster
* than using eclipse Jobs directly because thread creation and context
* switching are reduced.
*
@ -59,6 +59,12 @@ public class JobPool {
protected List<Job> jobList;
protected boolean cancel = false;
protected Object cancelLock = new Object();
protected Object joinLock = new Object();
public JobPool(String name, int size) {
this(name, size, null, null);
}
@ -82,46 +88,75 @@ public class JobPool {
}
}
public synchronized void schedule(Runnable runnable) {
workQueue.offer(runnable);
Job job = jobQueue.poll();
if (job != null) {
job.schedule();
public void schedule(Runnable runnable) {
// do not schedule while canceling(cancel should be fast).
synchronized (cancelLock) {
if (cancel) {
return;
}
// do not schedule while joining, join might be slow but the javaDoc
// warns others.
synchronized (joinLock) {
workQueue.offer(runnable);
Job job = jobQueue.poll();
if (job != null) {
job.schedule();
}
}
}
}
/**
* Join on the Runnables in the pool. Attempting to schedule other Runnables
* will block until join as returned so be careful when calling
* will block until join has returned so be careful when calling
*/
public synchronized void join() {
for (Job j : jobList) {
try {
j.join();
} catch (InterruptedException e) {
// Ignore interupt
public void join() {
synchronized (joinLock) {
for (Job j : jobList) {
try {
j.join();
} catch (InterruptedException e) {
// Ignore interupt
}
}
}
}
/**
* Cancel the job pool, will clear out the workQueue then join on all jobs
* running
* running. Once canceled all future calls to schedule will be ignored.
*/
public synchronized void cancel() {
workQueue.clear();
join();
public void cancel() {
cancel(true);
}
/**
* Cancel the job pool, will clear out the workQueue and optionally join
* runnning jobs. Once canceled all future calls to schedule will be
* ignored.
*
* @param join
* true if you want to join before returning.
*/
public void cancel(boolean join) {
synchronized (cancelLock) {
cancel = true;
workQueue.clear();
}
if (join) {
join();
}
}
/**
* Cancels the specified runnable. Returns true if the provided runnable was
* waiting to be run but now is now. Returns false if the provided runnable
* waiting to be run but now is not. Returns false if the provided runnable
* is already running or if it was not enqueued to begin with.
*
* @param runnable
* @return
*/
public synchronized boolean cancel(Runnable runnable) {
public boolean cancel(Runnable runnable) {
return workQueue.remove(runnable);
}

View file

@ -4,6 +4,7 @@ import java.io.IOException;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.UUID;
import javax.jws.WebService;
@ -20,6 +21,7 @@ import com.raytheon.uf.common.serialization.SerializationException;
import com.raytheon.uf.common.serialization.SerializationUtil;
import com.raytheon.uf.common.serialization.comm.IServerRequest;
import com.raytheon.uf.common.serialization.comm.RemoteServiceRequest;
import com.raytheon.uf.common.serialization.comm.RequestWrapper;
import com.raytheon.uf.common.serialization.comm.ServiceException;
import com.raytheon.uf.common.serialization.comm.response.ServerErrorResponse;
import com.raytheon.uf.common.serialization.comm.util.ExceptionWrapper;
@ -50,9 +52,9 @@ import com.raytheon.uf.viz.core.localization.LocalizationManager;
**/
/**
* The thrift client. used to send requests to the RemoteReqeustServer. Make
* The thrift client. used to send requests to the RemoteRequestServer. Make
* sure request type has registered a handler to handle the request on the
* server
* server.
*
* <pre>
*
@ -60,6 +62,7 @@ import com.raytheon.uf.viz.core.localization.LocalizationManager;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Aug 3, 2009 mschenke Initial creation
* Jul 24, 2012 njensen Enhanced logging
*
* </pre>
*
@ -273,9 +276,12 @@ public class ThriftClient {
private static Object sendRequest(IServerRequest request,
String httpAddress, String uri) throws VizException {
httpAddress += uri;
String uniqueId = UUID.randomUUID().toString();
RequestWrapper wrapper = new RequestWrapper(request, VizApp.getWsId(),
uniqueId);
byte[] message;
try {
message = SerializationUtil.transformToThrift(request);
message = SerializationUtil.transformToThrift(wrapper);
} catch (SerializationException e) {
throw new VizException("unable to serialize request object", e);
}
@ -287,9 +293,8 @@ public class ThriftClient {
.postBinary(httpAddress, message);
long time = System.currentTimeMillis() - t0;
if (time >= SIMPLE_LOG_TIME) {
System.out.println("Time to execute " + request);
System.out.println("Took " + time + "ms");
System.out.println("Took " + time + "ms to run request id["
+ uniqueId + "] " + request.toString());
}
if (time >= BAD_LOG_TIME) {
new Exception() {

View file

@ -80,9 +80,9 @@
<arrowStyle>
<!--
<displayUnits>K/(km * 1000)</displayUnits>
-->
<displayUnits label="K/(km*1000)">K/m*1.0E6</displayUnits>
-->
<displayUnits label="C/m">K/m*1.0E6</displayUnits>
</arrowStyle>
</styleRule>

View file

@ -4084,4 +4084,13 @@ in | .03937 | 0 | 4 | | |..|8000F0FF| | 16 | \
</contourStyle>
</styleRule>
<styleRule>
<paramLevelMatches>
<parameter>Wind</parameter>
<parameter>Gust</parameter>
</paramLevelMatches>
<contourStyle>
<displayUnits>kts</displayUnits>
</contourStyle>
</styleRule>
</styleRuleset>

View file

@ -498,4 +498,13 @@
</graphStyle>
</styleRule>
<styleRule>
<paramLevelMatches>
<parameter>MTV</parameter>
</paramLevelMatches>
<graphStyle>
<displayUnits label="gm/kgs">g*m/(kg*s)</displayUnits>
</graphStyle>
</styleRule>
</styleRuleset>

View file

@ -1568,7 +1568,7 @@
</key>
<key
contextId="com.raytheon.uf.viz.d2d.ui"
commandId="com.raytheon.viz.ui.actions.printScreenAction"
commandId="com.raytheon.uf.viz.d2d.ui.actions.showPrintDialog"
schemeId="com.raytheon.viz.ui.awips.scheme"
sequence="M1+P">
</key>

View file

@ -57,7 +57,7 @@ public class AddAWIPSProcedure extends AbstractHandler {
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
Procedure procedure = new Procedure();
ProcedureDlg dlg = new ProcedureDlg(null, procedure,
ProcedureDlg dlg = ProcedureDlg.getOrCreateDialog(null, procedure,
HandlerUtil.getActiveShell(event));
dlg.open();

View file

@ -24,6 +24,8 @@ import java.io.File;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.handlers.HandlerUtil;
import com.raytheon.uf.common.localization.LocalizationFile;
@ -53,6 +55,8 @@ import com.raytheon.viz.ui.actions.LoadSerializedXml;
*/
public class OpenAWIPSProcedure extends AbstractHandler {
private OpenProcedureListDlg dialog;
/*
* (non-Javadoc)
*
@ -62,16 +66,21 @@ public class OpenAWIPSProcedure extends AbstractHandler {
*/
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
ProcedureListDlg listDlg = new OpenProcedureListDlg(
if(dialog != null){
dialog.open();
return null;
}
dialog = new OpenProcedureListDlg(
HandlerUtil.getActiveShell(event));
listDlg.open();
LocalizationFile selectedFile = listDlg.getSelectedFile();
dialog.open();
LocalizationFile selectedFile = dialog.getSelectedFile();
dialog = null;
if (selectedFile != null) {
File f = selectedFile.getFile();
Procedure p = (Procedure) LoadSerializedXml.deserialize(f);
ProcedureDlg dlg = new ProcedureDlg(
ProcedureDlg dlg = ProcedureDlg.getOrCreateDialog(
LocalizationUtil.extractName(selectedFile.getName()), p,
VizWorkbenchManager.getInstance().getCurrentWindow()
.getShell());

View file

@ -23,6 +23,7 @@ package com.raytheon.uf.viz.d2d.ui.dialogs.procedures;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.Map;
import java.util.Map.Entry;
@ -83,6 +84,22 @@ import com.raytheon.viz.ui.actions.SaveBundle;
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
import com.raytheon.viz.ui.editor.AbstractEditor;
/**
*
* Dialog for loading or modifying procedures.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
*
* </pre>
*
* @author unknown
* @version 1.0
*/
public class ProcedureDlg extends CaveSWTDialog {
private static final transient IUFStatusHandler statusHandler = UFStatus
@ -94,6 +111,8 @@ public class ProcedureDlg extends CaveSWTDialog {
public static final String PROCEDURES_DIR = "/procedures";
private static Collection<ProcedureDlg> openDialogs = new ArrayList<ProcedureDlg>();
private Font font;
private List dataList;
@ -148,7 +167,7 @@ public class ProcedureDlg extends CaveSWTDialog {
private final java.util.List<BundlePair> bundles;
public ProcedureDlg(String fileName, Procedure p, Shell parent) {
private ProcedureDlg(String fileName, Procedure p, Shell parent) {
// Win32
super(parent, SWT.DIALOG_TRIM | SWT.RESIZE, CAVE.INDEPENDENT_SHELL
| CAVE.DO_NOT_BLOCK);
@ -203,6 +222,9 @@ public class ProcedureDlg extends CaveSWTDialog {
@Override
protected void disposed() {
font.dispose();
synchronized (openDialogs) {
openDialogs.remove(this);
}
}
@Override
@ -989,4 +1011,44 @@ public class ProcedureDlg extends CaveSWTDialog {
};
dlg.open();
}
/**
* If there is a procedure dialog open for the given filename, return it,
* otherwise null.
*
* @param fileName
* @return
*/
public static ProcedureDlg getDialog(String fileName) {
synchronized (openDialogs) {
if (fileName != null) {
for (ProcedureDlg dialog : openDialogs) {
if (fileName.equals(dialog.fileName)) {
return dialog;
}
}
}
return null;
}
}
/**
* Get the ProcedureDlg for the given fileName. If the fileName is null or if there is no open dialog, create a new ProcedureDlg.
*
* @param fileName
* @param p
* @param parent
* @return
*/
public static ProcedureDlg getOrCreateDialog(String fileName, Procedure p,
Shell parent) {
synchronized (openDialogs) {
ProcedureDlg dialog = getDialog(fileName);
if (dialog == null) {
dialog = new ProcedureDlg(fileName, p, parent);
openDialogs.add(dialog);
}
return dialog;
}
}
}

View file

@ -54,6 +54,24 @@ import com.raytheon.uf.common.localization.LocalizationUtil;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
/**
*
* A dialog which displays a list of procedures for opening, saving, or deleting.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* ??? Initial creation
* 07/31/2012 DR 15036 D. Friedman Ensure current user's procedures
* are visible.
* </pre>
*
* @author unknown
* @version 1.0
*/
public class ProcedureListDlg extends CaveSWTDialog {
protected boolean oneLevel = true;
@ -317,10 +335,18 @@ public class ProcedureListDlg extends CaveSWTDialog {
if (treeViewer.getContentProvider() instanceof ProcedureTreeContentProvider) {
ProcedureTreeContentProvider content = (ProcedureTreeContentProvider) treeViewer
.getContentProvider();
Object find = content.findItem(user);
final Object find = content.findItem(user);
if (find != null) {
treeViewer.setExpandedElements(new Object[] { find });
treeViewer.reveal(find);
treeViewer.getTree().getDisplay().asyncExec(new Runnable() {
@Override
public void run() {
TreeItem[] items = treeViewer.getTree().getItems();
if (items != null && items.length > 0)
treeViewer.getTree().showItem(items[items.length - 1]);
treeViewer.reveal(find);
}
});
}
}
}
@ -449,14 +475,25 @@ public class ProcedureListDlg extends CaveSWTDialog {
procedureTF.setText(procedureTF.getText().concat(".xml"));
}
if (dataListContains(procedureTF.getText())) {
// Pop up a warning
boolean result = MessageDialog.openQuestion(shell,
"Confirm Overwrite",
"The procedure " + procedureTF.getText()
+ " already exists. Overwrite anyways?");
if (result == true) {
fileName = procedureTF.getText();
shell.dispose();
if (ProcedureDlg.getDialog(procedureTF.getText()) != null) {
// User cannot save if dialog is open.
MessageDialog
.openError(
shell,
"Cannot Save Procedure",
"The procedure "
+ procedureTF.getText()
+ " is currently open. It cannot be overwritten until it is closed or saved under another name.");
} else {
// Pop up a warning
boolean result = MessageDialog.openQuestion(shell,
"Confirm Overwrite",
"The procedure " + procedureTF.getText()
+ " already exists. Overwrite anyways?");
if (result == true) {
fileName = procedureTF.getText();
shell.dispose();
}
}
} else {
fileName = procedureTF.getText();

View file

@ -24,15 +24,15 @@
</Method>
<Method models="HPCGuide" displayName="Total Cloud Cover" name="Multiply">
<Field abbreviation="TCC"/>
<ConstantField value="0.01"/>
<ConstantField value="100.0"/>
</Method>
<Method models="RTMA" displayName="GOES Effective Cloud Amount" name="Multiply">
<Field abbreviation="TCC"/>
<ConstantField value="0.01"/>
<ConstantField value="100.0"/>
</Method>
<Method name="Multiply">
<Field abbreviation="TCC"/>
<ConstantField value="0.01"/>
<ConstantField value="100.0"/>
</Method>
<Method levels="Surface" name="Mapping">
<Field level="Station" abbreviation="clouds_bestCat"/>

View file

@ -18,4 +18,9 @@
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
further_licensing_information.
-->
<DerivedParameter abbreviation="MnT12hr" name="12-hr Minimum Temperature" unit="K"/>
<DerivedParameter abbreviation="MnT12hr" name="12-hr Minimum Temperature" unit="K">
<Method name="Alias" levels="Surface"
models="MOSGuide" displayName="Minimum Temperature">
<Field abbreviation="MnT12hr" level="2FHAG"/>
</Method>
</DerivedParameter>

View file

@ -18,4 +18,9 @@
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
further_licensing_information.
-->
<DerivedParameter abbreviation="MxT12hr" name="12-hr Maximum Temperature" unit="K"/>
<DerivedParameter abbreviation="MxT12hr" name="12-hr Maximum Temperature" unit="K">
<Method name="Alias" levels="Surface"
models="MOSGuide" displayName="Maximum Temperature">
<Field abbreviation="MxT12hr" level="2FHAG"/>
</Method>
</DerivedParameter>

View file

@ -18,7 +18,7 @@
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
further_licensing_information.
-->
<DerivedParameter unit="m/s" name="Total Wind (Vector)" abbreviation="Wind">
<DerivedParameter unit="m/s" name="Wind" abbreviation="Wind">
<Method name="Vector">
<Field abbreviation="uW"/>
<Field abbreviation="vW"/>

View file

@ -819,7 +819,7 @@ public class FileTreeView extends ViewPart implements IPartListener2,
// We can import into true directories, not group datas
mgr.add(new Separator());
mgr.add(new ImportFileAction(fdata.getPathData().getType(),
fdata.getPath()));
fdata.getPath(), fdata.getPathData().getFilter()));
}
}
}

View file

@ -67,17 +67,36 @@ public class ImportFileAction extends Action {
private static final String FORMAT_STRING = "The file '%s' already exists at the %s level and "
+ "will be deleted. Proceed?";
private static final String ASTERISK = "*";
private String directoryPath;
private LocalizationType contextType;
private String[] fileExtensionFilterArr;
public ImportFileAction(LocalizationType contextType, String directoryPath) {
super("Import File...");
this.contextType = contextType;
this.directoryPath = directoryPath;
}
/*
public ImportFileAction(LocalizationType contextType, String directoryPath, String[] filter) {
this(contextType, directoryPath);
if (filter != null) {
this.fileExtensionFilterArr = new String[filter.length];
for (int i = 0; i < filter.length; ++i) {
if (filter[i] != null && filter[i].startsWith(".")) {
// prepend an asterisk as required by FileDialog.
this.fileExtensionFilterArr[i] = ASTERISK + filter[i];
} else {
this.fileExtensionFilterArr[i] = filter[i];
}
}
}
}
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.action.Action#run()
@ -87,6 +106,9 @@ public class ImportFileAction extends Action {
Shell parent = VizWorkbenchManager.getInstance().getCurrentWindow()
.getShell();
FileDialog dialog = new FileDialog(parent);
if (fileExtensionFilterArr != null) {
dialog.setFilterExtensions(fileExtensionFilterArr);
}
String fileToImport = dialog.open();
if (fileToImport != null) {
File importFile = new File(fileToImport);

View file

@ -69,7 +69,6 @@ import com.raytheon.uf.viz.monitor.ffmp.ui.dialogs.FFMPTableData;
import com.raytheon.uf.viz.monitor.ffmp.ui.dialogs.FfmpBasinTableDlg;
import com.raytheon.uf.viz.monitor.ffmp.ui.dialogs.FfmpTableConfig;
import com.raytheon.uf.viz.monitor.ffmp.ui.dialogs.FfmpTableConfigData;
import com.raytheon.uf.viz.monitor.ffmp.ui.listeners.IFFMPMonitorListener;
import com.raytheon.uf.viz.monitor.ffmp.ui.listeners.IFFMPResourceListener;
import com.raytheon.uf.viz.monitor.ffmp.ui.rsc.FFMPDataLoader;
import com.raytheon.uf.viz.monitor.ffmp.ui.rsc.FFMPDataLoader.LOADER_TYPE;
@ -95,8 +94,7 @@ import com.raytheon.uf.viz.monitor.listeners.IMonitorListener;
* @version 1
*/
public class FFMPMonitor extends ResourceMonitor implements
IFFMPMonitorListener {
public class FFMPMonitor extends ResourceMonitor {
private static long SECONDS_PER_HOUR = 60 * 60;
/** boolean for initialization **/
@ -517,11 +515,13 @@ public class FFMPMonitor extends ResourceMonitor implements
fsource, fhuc);
if (!uris.containsKey(fdataUri)) {
try {
FFMPRecord ffmpRec = loadRecordFromDatabase(fdataUri);
SourceXML sourceXML = fscm.getSource(fsource);
FFMPCacheRecord ffmpRec = populateFFMPRecord(true,
fdataUri, fsiteKey, fsource, fhuc);
//FFMPRecord ffmpRec = loadRecordFromDatabase(fdataUri);
File loc = HDF5Util.findHDF5Location(ffmpRec);
IDataStore dataStore = DataStoreFactory
.getDataStore(loc);
SourceXML sourceXML = fscm.getSource(fsource);
if (sourceXML.getSourceType().equals(
SOURCE_TYPE.GAGE.getSourceType())
@ -820,20 +820,15 @@ public class FFMPMonitor extends ResourceMonitor implements
populateFFMPRecord(product, siteKey, dataKey, sourceName,
ptime, phuc, retrieveNew);
}
} else {
// special case where FFG is the primary source
// check for special case with dual stand alone and table
// display loaded
SourceXML sourcexml = getSourceConfig().getSource(sourceName);
} else {
// special case where FFG is the primary source
// check for special case with dual stand alone and table
// display loaded
if (sourcexml.getSourceType().equals(
SOURCE_TYPE.GUIDANCE.getSourceType())) {
sourceName = sourcexml.getDisplayName();
} else {
populateFFMPRecord(product, siteKey, dataKey, sourceName,
ptime, phuc, retrieveNew);
}
}
populateFFMPRecord(product, siteKey, dataKey, sourceName,
ptime, phuc, retrieveNew);
}
record = ffmpData.get(siteKey).get(sourceName);
}
@ -918,16 +913,11 @@ public class FFMPMonitor extends ResourceMonitor implements
if (loadType == LOADER_TYPE.SECONDARY) {
//hucsToLoad.remove("ALL");
//hucsToLoad.remove(getConfig().getFFMPConfigData().getLayer());
timeBack = new Date(
(long) (resource.getMostRecentTime().getTime() - ((getConfig()
.getFFMPConfigData().getTimeFrame() * 3) * 3600 * 1000)));
timeBack = new Date(resource.getMostRecentTime().getTime() - (6 * 1000 * 24));
frd.timeBack = timeBack;
} else if (loadType == LOADER_TYPE.TERTIARY) {
hucsToLoad.clear();
hucsToLoad.add("ALL");
startTime = new Date(resource.getMostRecentTime().getTime() - (3600 * 1000 * 6));
timeBack = new Date(resource.getMostRecentTime().getTime() - (3600 * 1000 * 24));
}
@ -1114,24 +1104,8 @@ public class FFMPMonitor extends ResourceMonitor implements
}
resourceListeners.remove(listener);
}
@Override
public void updateDialogTime(DataTime tableTime) {
for (IFFMPResourceListener listener : getResourceListenerList()) {
if (listener instanceof FFMPResource) {
FFMPResource res = (FFMPResource) listener;
if (res.isLinkToFrame()) {
res.setTableTime(tableTime.getRefTime());
if (res.basinTableDlg != null) {
updateDialog(res);
}
}
}
}
// clean up if we can
System.gc();
}
public ArrayList<IFFMPResourceListener> getResourceListenerList() {
@ -1885,7 +1859,7 @@ public class FFMPMonitor extends ResourceMonitor implements
public void run() {
SourceXML source = getSourceConfig().getSource(fsourceName);
if (furiMap != null) {
for (List<String> uris : furiMap.descendingMap()
.values()) {
@ -2451,7 +2425,7 @@ public class FFMPMonitor extends ResourceMonitor implements
curRecord = ffmpData.get(fsiteKey).get(mySource);
if (curRecord == null) {
curRecord = new FFMPCacheRecord(fffmpRec,
mySource);
mySource, getRunConfig().getRunner(wfo).getCacheDir());
ffmpData.get(fsiteKey).put(mySource, curRecord);
}
}
@ -2489,7 +2463,6 @@ public class FFMPMonitor extends ResourceMonitor implements
statusHandler.handle(Priority.PROBLEM,
"FFMP Can't retrieve FFMP URI, " + dataUri,
e);
e.printStackTrace();
}
}

View file

@ -279,8 +279,11 @@ public class FFTIControlDlg extends Dialog {
&& (thisItem.getQpeDurHr() == nextItem.getQpeDurHr())
&& (thisItem.getGuidDurHr() == nextItem.getGuidDurHr())
&& (thisItem.getQpfDurHr() == nextItem.getQpfDurHr())
&& (thisItem.getTotalDurHr() == nextItem.getTotalDurHr())) {
&& (thisItem.getTotalDurHr() == nextItem.getTotalDurHr())
&& (thisItem.getQpeSrc().length > 0 && nextItem.getQpeSrc().length > 0 && thisItem.getQpeSrc()[0].equals(nextItem.getQpeSrc()[0]))
&& (thisItem.getQpfSrc().length > 0 && nextItem.getQpfSrc().length > 0 && thisItem.getQpfSrc()[0].equals(nextItem.getQpfSrc()[0]))
&& (thisItem.getGuidSrc().length > 0 && nextItem.getGuidSrc().length > 0 && thisItem.getGuidSrc()[0].equals(nextItem.getGuidSrc()[0]))) {
duplicateLst.add(i + 1);
duplicateLst.add(j + 1);
}
@ -295,8 +298,14 @@ public class FFTIControlDlg extends Dialog {
HashSet<Integer> duplicates = getDuplicates();
if (duplicates.size() > 0) {
String setsStr = "";
for (Integer setIndex : duplicates)
setsStr += setIndex + "/";
int i = 0;
for (Integer setIndex : duplicates) {
setsStr += setIndex;
if (i != duplicates.size()-1) {
setsStr = setsStr + "/";
}
i++;
}
MessageBox messageBox = new MessageBox(shell, SWT.OK);
messageBox.setText("Warning: Duplicate Setting(s)!");
messageBox

View file

@ -20,6 +20,7 @@
package com.raytheon.uf.viz.monitor.ffmp.ffti;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import org.eclipse.swt.SWT;
@ -45,6 +46,17 @@ import com.raytheon.uf.common.monitor.xml.ProductRunXML;
import com.raytheon.uf.common.monitor.xml.ProductXML;
import com.raytheon.uf.common.monitor.xml.SourceXML;
/**
* FFTI Setting Composite.
*
* <pre>
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 08/07/2012 578 mpduff FFTI now only a single selection and populates
* correctly.
* </pre>
*/
public class SettingComp extends Composite implements DurationInterface {
/**
* Parent tab folder.
@ -102,6 +114,8 @@ public class SettingComp extends Composite implements DurationInterface {
// temporary storage for qpf
private String selectedQpfVal = "0";
private FFTISettingXML fftiSetting;
public SettingComp(TabFolder parent) {
super(parent, 0);
@ -115,7 +129,8 @@ public class SettingComp extends Composite implements DurationInterface {
super(parent, 0);
this.parent = parent;
this.fftiSetting = fftiSetting;
init();
// set the attributes
@ -217,6 +232,8 @@ public class SettingComp extends Composite implements DurationInterface {
accumRdo.setEnabled(true);
accumAction(accumAttrib);
setSettings();
}
private void createAttributeControls() {
@ -318,7 +335,7 @@ public class SettingComp extends Composite implements DurationInterface {
gd = new GridData(SWT.CENTER, SWT.DEFAULT, true, false);
gd.widthHint = listWidth;
gd.heightHint = listHeight;
qpeList = new List(precipSrcComp, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL);
qpeList = new List(precipSrcComp, SWT.BORDER | SWT.V_SCROLL);
qpeList.setLayoutData(gd);
fillQpeList();
@ -327,8 +344,7 @@ public class SettingComp extends Composite implements DurationInterface {
gd.horizontalSpan = 2;
gd.widthHint = listWidth - 75;
gd.heightHint = listHeight;
guidList = new List(precipSrcComp, SWT.BORDER | SWT.MULTI
| SWT.V_SCROLL);
guidList = new List(precipSrcComp, SWT.BORDER | SWT.V_SCROLL);
guidList.setLayoutData(gd);
fillGuidList();
@ -337,7 +353,7 @@ public class SettingComp extends Composite implements DurationInterface {
gd.horizontalSpan = 2;
gd.widthHint = listWidth;
gd.heightHint = listHeight;
qpfList = new List(precipSrcComp, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL);
qpfList = new List(precipSrcComp, SWT.BORDER | SWT.V_SCROLL);
qpfList.setLayoutData(gd);
fillQpfList();
@ -393,9 +409,6 @@ public class SettingComp extends Composite implements DurationInterface {
guidSet.add(sourceName);
guidList.add(sourceName);
}
if (guidList.getItemCount() > 0) {
guidList.setSelection(0);
}
guidList.addSelectionListener(new SelectionListener() {
@ -438,9 +451,10 @@ public class SettingComp extends Composite implements DurationInterface {
if (source.isMosaic()) {
if (!qpeSet.contains(product.getProductKey())) {
if (!qpeSet.contains(source.getDisplayName())) {
qpeSet.add(source.getDisplayName());
qpeList.add(source.getDisplayName());
String displayName = source.getDisplayName();
if (!qpeSet.contains(displayName)) {
qpeSet.add(displayName);
qpeList.add(displayName);
}
break;
}
@ -460,10 +474,6 @@ public class SettingComp extends Composite implements DurationInterface {
}
}
}
if (qpeList.getItemCount() > 0) {
qpeList.setSelection(0);
}
}
/**
@ -516,10 +526,6 @@ public class SettingComp extends Composite implements DurationInterface {
}
}
}
if (qpfList.getItemCount() > 0) {
qpfList.setSelection(0);
}
}
/**
@ -598,6 +604,55 @@ public class SettingComp extends Composite implements DurationInterface {
SWT.COLOR_WHITE));
attrLbl.setLayoutData(gd);
}
/**
* Set the dialog to reflect the saved configuration.
*/
private void setSettings() {
// Select the configured items, otherwise select the first
if (this.fftiSetting != null) {
// QPE
if (fftiSetting.getQpeSource().getDisplayNameList() == null ||
fftiSetting.getQpeSource().getDisplayNameList().isEmpty()) {
qpeList.setSelection(0);
} else {
// Only using the first one in the list to match A1
java.util.List<String> items = Arrays.asList(qpeList.getItems());
String name = fftiSetting.getQpeSource().getDisplayNameList().get(0);
int idx = items.indexOf(name);
qpeList.select(idx);
qpeList.showSelection();
}
// GUID
if (fftiSetting.getGuidSource().getDisplayNameList() == null ||
fftiSetting.getGuidSource().getDisplayNameList().isEmpty()) {
guidList.setSelection(0);
} else {
// Only using the first one in the list to match A1
java.util.List<String> items = Arrays.asList(guidList.getItems());
String name = fftiSetting.getGuidSource().getDisplayNameList().get(0);
int idx = items.indexOf(name);
guidList.select(idx);
guidList.showSelection();
}
// QPF
if (fftiSetting.getQpfSource().getDisplayNameList() == null ||
fftiSetting.getQpfSource().getDisplayNameList().isEmpty()) {
qpfList.setSelection(0);
} else {
// Only using the first one in the list to match A1
java.util.List<String> items = Arrays.asList(qpfList.getItems());
String name = fftiSetting.getQpfSource().getDisplayNameList().get(0);
int idx = items.indexOf(name);
qpfList.select(idx);
qpfList.showSelection();
}
}
}
private void accumAction(FFTIAttribute attribVal) {
// change attribute values

View file

@ -45,6 +45,22 @@ import com.raytheon.uf.viz.monitor.ffmp.ui.dialogs.FfmpTableConfigData.COLUMN_NA
import com.raytheon.uf.viz.monitor.ffmp.xml.FFMPConfigBasinXML;
import com.raytheon.uf.viz.monitor.ffmp.xml.FFMPTableColumnXML;
/**
* FFMP GUI Config Object.
*
* <pre>
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Aug 01, 2012 14168 mpduff Add convenience methods for
* getting ColorCell and ReverseFilter
*
* </pre>
*
* @author lvenable
* @version 1.0
*/
public class FFMPConfig {
private static FFMPConfig classInstance = new FFMPConfig();
@ -97,9 +113,9 @@ public class FFMPConfig {
private HashMap<ThreshColNames, ThresholdManager> threshMgrMap;
private HashMap<String, ThreshColNames> thresholdLookup;
private AttributesDlgData attrData = null;
private boolean reReadAttrData = false;
private FFMPConfig() {
@ -357,7 +373,7 @@ public class FFMPConfig {
return null;
}
public void createAttributesDlgData(String siteKey) {
ArrayList<FFMPTableColumnXML> columnData = ffmpCfgBasin
.getTableColumnData();
@ -371,7 +387,7 @@ public class FFMPConfig {
for (int i = 0; i < columns.length; i++) {
String column = columns[i];
String displayName = null;
for (FFMPTableColumnXML tcXML : columnData) {
if (column.contains("_")) {
String[] parts = column.split("_");
@ -380,10 +396,14 @@ public class FFMPConfig {
}
if (column.equalsIgnoreCase(tcXML.getColumnName())) {
boolean includedInTable = false;
if (column.equalsIgnoreCase(COLUMN_NAME.GUID.getColumnName()) ||
column.equalsIgnoreCase(COLUMN_NAME.RATIO.getColumnName()) ||
column.equalsIgnoreCase(COLUMN_NAME.DIFF.getColumnName())) {
if (ffmpCfgBasin.getIncludedGuids().contains(displayName)) {
if (column.equalsIgnoreCase(COLUMN_NAME.GUID
.getColumnName())
|| column.equalsIgnoreCase(COLUMN_NAME.RATIO
.getColumnName())
|| column.equalsIgnoreCase(COLUMN_NAME.DIFF
.getColumnName())) {
if (ffmpCfgBasin.getIncludedGuids().contains(
displayName)) {
includedInTable = true;
attrData.setGuidColumnIncluded(displayName,
includedInTable);
@ -397,8 +417,9 @@ public class FFMPConfig {
}
}
}
public AttributesDlgData getVisibleColumns(String siteKey, boolean reReadAttrData) {
public AttributesDlgData getVisibleColumns(String siteKey,
boolean reReadAttrData) {
this.reReadAttrData = reReadAttrData;
return getVisibleColumns(siteKey);
}
@ -413,33 +434,46 @@ public class FFMPConfig {
public void setVisibleColumns(AttributesDlgData attrData) {
this.attrData = attrData;
ArrayList<FFMPTableColumnXML> columnData = ffmpCfgBasin
.getTableColumnData();
for (FFMPTableColumnXML tcXML : columnData) {
if (tcXML.getColumnName().equalsIgnoreCase(COLUMN_NAME.RATE.getColumnName())) {
tcXML.setDisplayedInTable(attrData.isColumnVisible(COLUMN_NAME.RATE.getColumnName()));
} else if (tcXML.getColumnName().equalsIgnoreCase(COLUMN_NAME.NAME.getColumnName())) {
tcXML.setDisplayedInTable(attrData.isColumnVisible(COLUMN_NAME.NAME.getColumnName()));
} else if (tcXML.getColumnName().equalsIgnoreCase(COLUMN_NAME.QPE.getColumnName())) {
tcXML.setDisplayedInTable(attrData.isColumnVisible(COLUMN_NAME.QPE.getColumnName()));
} else if (tcXML.getColumnName().equalsIgnoreCase(COLUMN_NAME.QPF.getColumnName())) {
tcXML.setDisplayedInTable(attrData.isColumnVisible(COLUMN_NAME.QPF.getColumnName()));
} else if (tcXML.getColumnName().equalsIgnoreCase(COLUMN_NAME.GUID.getColumnName())) {
tcXML.setDisplayedInTable(attrData.isColumnVisible(COLUMN_NAME.GUID.getColumnName()));
} else if (tcXML.getColumnName().equalsIgnoreCase(COLUMN_NAME.RATIO.getColumnName())) {
tcXML.setDisplayedInTable(attrData.isColumnVisible(COLUMN_NAME.RATIO.getColumnName()));
} else if (tcXML.getColumnName().equalsIgnoreCase(COLUMN_NAME.DIFF.getColumnName())) {
tcXML.setDisplayedInTable(attrData.isColumnVisible(COLUMN_NAME.DIFF.getColumnName()));
if (tcXML.getColumnName().equalsIgnoreCase(
COLUMN_NAME.RATE.getColumnName())) {
tcXML.setDisplayedInTable(attrData
.isColumnVisible(COLUMN_NAME.RATE.getColumnName()));
} else if (tcXML.getColumnName().equalsIgnoreCase(
COLUMN_NAME.NAME.getColumnName())) {
tcXML.setDisplayedInTable(attrData
.isColumnVisible(COLUMN_NAME.NAME.getColumnName()));
} else if (tcXML.getColumnName().equalsIgnoreCase(
COLUMN_NAME.QPE.getColumnName())) {
tcXML.setDisplayedInTable(attrData
.isColumnVisible(COLUMN_NAME.QPE.getColumnName()));
} else if (tcXML.getColumnName().equalsIgnoreCase(
COLUMN_NAME.QPF.getColumnName())) {
tcXML.setDisplayedInTable(attrData
.isColumnVisible(COLUMN_NAME.QPF.getColumnName()));
} else if (tcXML.getColumnName().equalsIgnoreCase(
COLUMN_NAME.GUID.getColumnName())) {
tcXML.setDisplayedInTable(attrData
.isColumnVisible(COLUMN_NAME.GUID.getColumnName()));
} else if (tcXML.getColumnName().equalsIgnoreCase(
COLUMN_NAME.RATIO.getColumnName())) {
tcXML.setDisplayedInTable(attrData
.isColumnVisible(COLUMN_NAME.RATIO.getColumnName()));
} else if (tcXML.getColumnName().equalsIgnoreCase(
COLUMN_NAME.DIFF.getColumnName())) {
tcXML.setDisplayedInTable(attrData
.isColumnVisible(COLUMN_NAME.DIFF.getColumnName()));
}
}
HashMap<String, Boolean> guidanceMap = attrData.getGuidanceList();
String list = "";
boolean first = true;
for (String key: guidanceMap.keySet()) {
for (String key : guidanceMap.keySet()) {
if (first == false) {
list.concat(",");
}
@ -496,7 +530,8 @@ public class FFMPConfig {
* starts. If the column is not visible then default the sort column to be
* the name column.
*
* @param siteKey The siteKey being used
* @param siteKey
* The siteKey being used
* @return Column index.
*/
public int getStartSortIndex(String siteKey) {
@ -506,7 +541,7 @@ public class FFMPConfig {
FfmpTableConfig tableCfg = FfmpTableConfig.getInstance();
FFMPSourceConfigurationManager sourceConfigManager = FFMPSourceConfigurationManager
.getInstance();
FFMPRunXML runner = configManager.getRunner(monitor.getWfo());
ProductRunXML prodRunXml = runner.getProduct(siteKey);
String name = prodRunXml.getProductName();
@ -514,7 +549,7 @@ public class FFMPConfig {
ProductXML productXml = sourceConfigManager.getProduct(name);
ArrayList<String> guidTypes = productXml.getAvailableGuidanceTypes();
String guidRankSource = null;
if (guidTypes.size() > 1) {
String colSorted = ffmpCfgBasin.getColumnSorted();
@ -523,7 +558,7 @@ public class FFMPConfig {
guidRankSource = parts[1];
}
}
FfmpTableConfigData tableCfgData = tableCfg.getTableConfigData(siteKey);
String[] tableColumns = tableCfgData.getTableColumnKeys();
String sortedColName = ffmpCfgBasin.getColumnSorted();
@ -539,7 +574,7 @@ public class FFMPConfig {
column = parts[1];
guidType = parts[0];
}
if (column.equalsIgnoreCase(sortedColName)) {
if ((guidType != null) && (guidRankSource != null)) {
if (guidType.equalsIgnoreCase(guidRankSource)) {
@ -554,7 +589,7 @@ public class FFMPConfig {
}
}
}
return 0;
}
@ -562,10 +597,16 @@ public class FFMPConfig {
if (columnName.contains("_")) {
return true;
}
return false;
}
/**
* Get the filter value for this column.
*
* @param threshColName
* @return The filter value
*/
public double getFilterValue(ThreshColNames threshColName) {
ArrayList<FFMPTableColumnXML> columnData = ffmpCfgBasin
.getTableColumnData();
@ -575,6 +616,36 @@ public class FFMPConfig {
return data.getFilter();
}
/**
* Get the ColorCell value for this column.
*
* @param threshColName
* @return The ColorCell value
*/
public boolean isColorCell(ThreshColNames threshColName) {
ArrayList<FFMPTableColumnXML> columnData = ffmpCfgBasin
.getTableColumnData();
FFMPTableColumnXML data = columnData.get(threshColName.getColIndex());
return data.getColorCell();
}
/**
* Get the reverse filter value for this column.
*
* @param threshColName
* @return The Reverse Filter value
*/
public boolean isReverseFilter(ThreshColNames threshColName) {
ArrayList<FFMPTableColumnXML> columnData = ffmpCfgBasin
.getTableColumnData();
FFMPTableColumnXML data = columnData.get(threshColName.getColIndex());
return data.getReverseFilter();
}
/**
* @return the attrData
*/
@ -583,7 +654,8 @@ public class FFMPConfig {
}
/**
* @param attrData the attrData to set
* @param attrData
* the attrData to set
*/
public void setAttrData(AttributesDlgData attrData) {
this.attrData = attrData;
@ -597,12 +669,13 @@ public class FFMPConfig {
}
/**
* @param reReadAttrData the reReadAttrData to set
* @param reReadAttrData
* the reReadAttrData to set
*/
public void setReReadAttrData(boolean reReadAttrData) {
this.reReadAttrData = reReadAttrData;
}
public String getIncludedGuids() {
return ffmpCfgBasin.getIncludedGuids();
}

View file

@ -52,6 +52,7 @@ import com.raytheon.uf.common.monitor.data.CommonConfig;
import com.raytheon.uf.common.monitor.data.CommonConfig.AppName;
import com.raytheon.uf.viz.monitor.ffmp.ui.dialogs.FFMPConfig.ThreshColNames;
import com.raytheon.uf.viz.monitor.ffmp.ui.dialogs.FfmpTableConfigData.COLUMN_NAME;
import com.raytheon.uf.viz.monitor.ffmp.xml.FFMPConfigBasinXML;
import com.raytheon.uf.viz.monitor.ffmp.xml.FFMPTableColumnXML;
/**
@ -67,17 +68,22 @@ import com.raytheon.uf.viz.monitor.ffmp.xml.FFMPTableColumnXML;
* Apr 7, 2009 lvenable Initial creation
* Mar 15,2012 DR 14406 gzhang Fixing QPF Column Title Missing
* Mar 20,2012 DR 14250 gzhang Eliminating column Missing values
* Aug 01, 2012 14168 mpduff Only allow filtering if ColorCell is true
* </pre>
*
* @author lvenable
* @version 1.0
*/
public abstract class FFMPTable extends Composite {
/** Default column width */
protected static final int DEFAULT_COLUMN_WIDTH = 95;//DR14406: old value: 75 too small
protected static final int DEFAULT_COLUMN_WIDTH = 95;// DR14406: old value:
// 75 too small
/** DR14406: For columns with more words */
/** DR14406: For columns with more words */
protected static final int EXTRA_COLUMN_WIDTH = 28;
protected String currentPfaf = null;
/**
* Main table control.
*/
@ -325,6 +331,9 @@ public abstract class FFMPTable extends Composite {
cols[j].setWidth(defaultColWidth);
}
// reset the tableIndex
tableIndex = -1;
/*
* Check of the column is sortable.
*/
@ -372,17 +381,36 @@ public abstract class FFMPTable extends Composite {
int sortColIndex = table.indexOf(sortedTableColumn);
boolean isAFilterCol = false;
ThreshColNames sortedThreshCol = null;
boolean reverseFilter = false;
double filterNum = Double.NaN;
String columnName = getColumnKeys()[sortColIndex];
String sortedColumnName = getColumnKeys()[sortColIndex];
FFMPConfigBasinXML ffmpCfgBasin = FFMPConfig.getInstance()
.getFFMPConfigData();
ArrayList<FFMPTableColumnXML> ffmpTableCols = ffmpCfgBasin
.getTableColumnData();
for (ThreshColNames threshColName : ThreshColNames.values()) {
if (sortedColumnName.contains(threshColName.name())) {
sortedThreshCol = threshColName;
break;
}
}
// Check if the sorted column is a column that will contain a filter.
if (!columnName.equalsIgnoreCase("NAME")) {
isAFilterCol = true;
for (ThreshColNames threshColName : ThreshColNames.values()) {
if (columnName.contains(threshColName.name())) {
sortedThreshCol = threshColName;
filterNum = ffmpConfig.getFilterValue(threshColName);
// Check the gui config to see if colorCell is true. If false then do
// not apply filter
for (FFMPTableColumnXML xml : ffmpTableCols) {
if (xml.getColumnName().contains(sortedThreshCol.name())) {
if (ffmpConfig.isColorCell(sortedThreshCol)) {
// Only filter if colorCell is true
isAFilterCol = true;
filterNum = ffmpConfig.getFilterValue(sortedThreshCol);
reverseFilter = ffmpConfig.isReverseFilter(sortedThreshCol);
}
break;
}
}
@ -409,38 +437,16 @@ public abstract class FFMPTable extends Composite {
extent.x);
/*
* Check if the sorted column is a filter column.
* Check if the data value is Not A Number.
*/
if (isAFilterCol == true) {
/*
* Check if the data value is Not A Number.
*/
float dataVal = cellData[sortColIndex]
.getValueAsFloat();
//DR 14250 fix: any value not a number will be omitted
if (/*sortedThreshCol.name().equalsIgnoreCase("RATIO") &&*/ Float.isNaN(dataVal)) {
continue;
}
// if (sortedThreshCol.name().equalsIgnoreCase("RATIO") == false) {
// If the data value is less/more than the filter value
// continue
// so we don't put the data in the table. Less for normal
// filtering,
// more for reverse filtering
ArrayList<FFMPTableColumnXML> tcList = ffmpConfig
.getFFMPConfigData().getTableColumnData();
boolean reverseFilter = false;
for (FFMPTableColumnXML tc : tcList) {
if (tc.getColumnName().equalsIgnoreCase(
sortedThreshCol.name())) {
reverseFilter = tc.getReverseFilter();
break;
}
}
// }
float dataVal = cellData[sortColIndex].getValueAsFloat();
// DR 14250 fix: any value not a number will be omitted
if (/* sortedThreshCol.name().equalsIgnoreCase("RATIO") && */Float
.isNaN(dataVal)) {
continue;
}
if (isAFilterCol) {
if (reverseFilter) {
if (dataVal > filterNum) {
continue;
@ -453,6 +459,11 @@ public abstract class FFMPTable extends Composite {
}
indexArray.add(t);
// Check to see if this is the selected row
if (rowData.getPfaf().equals(currentPfaf)) {
tableIndex = indexArray.indexOf(t);
}
}
/*
* VIRTUAL TABLE
@ -657,7 +668,10 @@ public abstract class FFMPTable extends Composite {
}
}
imageWidth = maxTextLength * textWidth + EXTRA_COLUMN_WIDTH;//DR14406: old value 6 too small
imageWidth = maxTextLength * textWidth + EXTRA_COLUMN_WIDTH;// DR14406:
// old value
// 6 too
// small
imageHeight = textHeight * 2;
gc.dispose();
@ -712,25 +726,34 @@ public abstract class FFMPTable extends Composite {
String[] tmpArray = colName.split("\n");
for (int j = 0; j < tmpArray.length; j++) {
// if (tmpArray[j].length() > maxTextLen) {
// maxTextLen = tmpArray[j].length();
// }
// }
// if (tmpArray[j].length() > maxTextLen) {
// maxTextLen = tmpArray[j].length();
// }
// }
xCoord = Math.round((imageWidth / 2)- (tmpArray[j].length() /*DR14406: old value: maxTextLen*/* textWidth / 2));
yCoord = j*(textHeight+1);//DR14406: old value 0 is only for the 1st line
gc.drawText(tmpArray[j], xCoord, yCoord, true);//DR14406: draw each line separately
xCoord = Math.round((imageWidth / 2)
- (tmpArray[j].length() /*
* DR14406: old value:
* maxTextLen
*/* textWidth / 2));
yCoord = j * (textHeight + 1);// DR14406: old value 0 is
// only for the 1st line
gc.drawText(tmpArray[j], xCoord, yCoord, true);// DR14406:
// draw each
// line
// separately
}
} else {
xCoord = Math.round((imageWidth / 2)
- (colName.length() * textWidth / 2));
yCoord = imageHeight / 2 - textHeight / 2 - 1;
gc.drawText(colName, xCoord, yCoord, true);//DR14406: draw text with a single line
gc.drawText(colName, xCoord, yCoord, true);// DR14406: draw text
// with a single line
}
// System.out.println("Column name = " + colName);
//DR14406: move the below text drawing code into the if-else blocks
//gc.drawText(colName, xCoord, yCoord, true);
// System.out.println("Column name = " + colName);
// DR14406: move the below text drawing code into the if-else blocks
// gc.drawText(colName, xCoord, yCoord, true);
gc.dispose();
tc.setImage(img);
@ -784,9 +807,10 @@ public abstract class FFMPTable extends Composite {
tCols[i].setWidth(table.getColumn(i).getWidth());
} else {
tCols[i].setWidth(defaultColWidth);
}
setQPFColName(tCols[i], col);//DR14406: set QPF title with quicker response
}
setQPFColName(tCols[i], col);// DR14406: set QPF title with
// quicker response
} else {
tCols[i].setWidth(0);
}
@ -866,27 +890,24 @@ public abstract class FFMPTable extends Composite {
*/
protected abstract int getColumnIndex(String sortCol);
/**
* DR14406 code: QPF column's name should be re-set
* when a user choose another type of QPF from the
* Attributes... button.
* DR14406 code: QPF column's name should be re-set when a user choose
* another type of QPF from the Attributes... button.
*
* See FfmpTableConfigData.setQpfType() with ColumnAttribData
*
* @param tCols: TableColumn
* @param col: Column name
* @param tCols
* : TableColumn
* @param col
* : Column name
*/
private void setQPFColName(TableColumn tCols, String col){
if(COLUMN_NAME.QPF.getColumnName().equalsIgnoreCase(col)){
setColumnImages();
tCols.setWidth(defaultColWidth+EXTRA_COLUMN_WIDTH);//38);
}
private void setQPFColName(TableColumn tCols, String col) {
if (COLUMN_NAME.QPF.getColumnName().equalsIgnoreCase(col)) {
setColumnImages();
tCols.setWidth(defaultColWidth + EXTRA_COLUMN_WIDTH);// 38);
}
}
}

View file

@ -33,8 +33,6 @@ import com.raytheon.uf.viz.monitor.ffmp.ui.dialogs.FFMPConfig.ThreshColNames;
public class FFMPTableComp extends FFMPTable {
private FfmpTableConfig tableConfig;
private String currentPfaf = null;
/**
* Table selection callback.
*/

View file

@ -23,6 +23,7 @@ import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.TimeZone;
import org.eclipse.swt.SWT;
@ -83,6 +84,8 @@ import com.raytheon.uf.viz.monitor.ffmp.ui.rsc.FFMPLoaderStatus;
import com.raytheon.uf.viz.monitor.ffmp.ui.rsc.FFMPResource;
import com.raytheon.uf.viz.monitor.ffmp.ui.rsc.FFMPTableDataLoader;
import com.raytheon.uf.viz.monitor.ffmp.ui.rsc.FFMPTableDataUpdate;
import com.raytheon.uf.viz.monitor.ffmp.xml.FFMPConfigBasinXML;
import com.raytheon.uf.viz.monitor.ffmp.xml.FFMPTableColumnXML;
import com.raytheon.uf.viz.monitor.listeners.IMonitorListener;
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
@ -95,6 +98,10 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Sep 30, 2009 lvenable Initial creation
* Jul 31, 2012 14517 mpduff Fix map blanking on updates and table updates
* for rapid slider changes.
* Aug 01, 2012 14168 mpduff Only allow items into the Thresholds menu if
* ColorCell is true.
*
* </pre>
*
@ -108,6 +115,8 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(FfmpBasinTableDlg.class);
private List<FFMPTableDataLoader> retrievalQueue = new ArrayList<FFMPTableDataLoader>();
private MenuItem linkToFrameMI;
private MenuItem worstCaseMI;
@ -216,8 +225,10 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
private Composite tableComp;
private Thread dataRetrieveThread = null;
private FFMPTableDataLoader dataRetrieveThread = null;
private boolean sweet = true;
public FfmpBasinTableDlg(Shell parent, FFMPTableData tData,
FFMPResource resource) {
super(parent, SWT.DIALOG_TRIM | SWT.RESIZE, CAVE.INDEPENDENT_SHELL
@ -491,10 +502,11 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
mi.setSelection(true);
break;
}
}
}
} else {
sourceMenuItems.get(0).setSelection(true);
ffmpConfig.getFFMPConfigData().setGuidSrc(sourceMenuItems.get(0).getText());
ffmpConfig.getFFMPConfigData().setGuidSrc(
sourceMenuItems.get(0).getText());
}
fireFieldChangedEvent(FFMPRecord.FIELDS.RATIO, false);
@ -556,7 +568,8 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
for (int i = 0; i < sourceMenuItems.size(); i++) {
String rdo = sourceMenuItems.get(i).getText();
if (rdo.equals(guidSrc)) {
ffmpConfig.getFFMPConfigData().setGuidSrc(guidSrc);
ffmpConfig.getFFMPConfigData().setGuidSrc(
guidSrc);
fireConfigUpdateEvent();
break;
}
@ -1018,18 +1031,21 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
// Loop over enum from config singleton to create menu items
for (ThreshColNames colName : ThreshColNames.values()) {
MenuItem mi = new MenuItem(popupMenu, SWT.NONE);
mi.setText(colName.name());
mi.setData(colName);
mi.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
MenuItem mi = (MenuItem) e.getSource();
ThreshColNames colName = (ThreshColNames) mi.getData();
if (ffmpConfig.isColorCell(colName)) {
// only add a menu item if colorCell is true
MenuItem mi = new MenuItem(popupMenu, SWT.NONE);
mi.setText(colName.name());
mi.setData(colName);
mi.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
MenuItem mi = (MenuItem) e.getSource();
ThreshColNames colName = (ThreshColNames) mi.getData();
displayThresholdsDialog(colName);
}
});
displayThresholdsDialog(colName);
}
});
}
}
// Set the pop-up menu as the pop-up for the shell
@ -1184,6 +1200,7 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
@Override
public void timeDurationUpdated(double val, boolean split) {
shell.setCursor(getDisplay().getSystemCursor(SWT.CURSOR_WAIT));
updateTimeDurationLabel(val, split);
if (dialogInitialized) {
fireTimeChangedEvent(val, split, false);
@ -1261,27 +1278,27 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
this.ffmpConfig.setAttrData(attrData);
this.ffmpTable.showHideTableColumns();
boolean changeSplit = false;
if (timeDurScale.split != ffmpConfig.isSplit()) {
changeSplit = true;
changeSplit = true;
}
timeDurScale.setSplit(ffmpConfig.isSplit());
updateTimeDurationLabel(timeDurScale.getSelectedHoursValue(),
ffmpConfig.isSplit());
if (updateData) {
if (updateData) {
if (changeSplit) {
fireTimeChangedEvent(timeDurScale.getSelectedHoursValue(),
ffmpConfig.isSplit(), true);
}
resource.clearTables();
resource.getDrawable(resource.getPaintTime()).setDirty(true);
FFMPMonitor.getInstance().fireMonitorEvent(
this.getClass().getName());
if (changeSplit) {
fireTimeChangedEvent(timeDurScale.getSelectedHoursValue(),
ffmpConfig.isSplit(), true);
}
resource.clearTables();
resource.getDrawable(resource.getPaintTime()).setDirty(true);
FFMPMonitor.getInstance().fireMonitorEvent(
this.getClass().getName());
}
}
ffmpTable.calculateTableSize();
shell.pack();
@ -1324,7 +1341,8 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
ffmpListeners.remove(fl);
}
public void fireTimeChangedEvent(double newTime, boolean split, boolean override) {
public void fireTimeChangedEvent(double newTime, boolean split,
boolean override) {
FFMPRecord.FIELDS field = FFMPRecord.FIELDS.QPE;
@ -1414,9 +1432,9 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
if (!selected) {
cwas.remove(cwa);
} else {
if (!cwas.contains(cwa)) {
cwas.add(cwa);
}
if (!cwas.contains(cwa)) {
cwas.add(cwa);
}
}
FFMPCWAChangeEvent fcce = new FFMPCWAChangeEvent(cwas);
@ -1653,28 +1671,31 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
* @param tData
*/
public void resetData(FFMPTableData tData) {
if (!ffmpTable.isDisposed()) {
this.mainTableData = tData;
//System.out.println("---" + tData.getTableRows().size());
// System.out.println("---" + tData.getTableRows().size());
ffmpTable.clearTableSelection();
//long time = System.currentTimeMillis();
// long time = System.currentTimeMillis();
ffmpTable
.setCenteredAggregationKey(resource.centeredAggregationKey);
ffmpTable.setTableData(mainTableData);
//long time1 = System.currentTimeMillis();
// long time1 = System.currentTimeMillis();
resetCursor();
shell.pack();
shell.redraw();
//System.out
// .println("Time to load Data into table " + (time1 - time));
// System.out
// .println("Time to load Data into table " + (time1 - time));
}
}
@Override
public void tableSelection(String pfaf, String name) {
if (groupLbl.getText().length() > 0) {
sweet = false;
}
if ((groupLbl.getText().length() == 0)
|| allOnlySmallBasinsMI.getSelection()) {
groupLbl.setText(name);
@ -1766,7 +1787,8 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
*/
timeDurScale.setTimeDurationAndUpdate(ffmpConfig.getFFMPConfigData()
.getTimeFrame());
fireTimeChangedEvent(ffmpConfig.getFFMPConfigData().getTimeFrame(), false, false);
fireTimeChangedEvent(ffmpConfig.getFFMPConfigData().getTimeFrame(),
false, false);
/*
* Layer
@ -1837,7 +1859,7 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
}
fireAutoRefreshEvent(false);
/*
* CWAs
*
@ -2028,13 +2050,30 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
FFMPTableDataLoader tableLoader = new FFMPTableDataLoader(me,
resource, basinTrendDlg, allowNewTableUpdate, sourceUpdate,
date, this);
if (dataRetrieveThread != null) {
dataRetrieveThread.interrupt();
dataRetrieveThread = null;
}
dataRetrieveThread = new Thread(tableLoader);
dataRetrieveThread.start();
synchronized (retrievalQueue) {
if (dataRetrieveThread == null || dataRetrieveThread.isDone()) {
retrievalQueue.clear();
dataRetrieveThread = tableLoader;
dataRetrieveThread.start();
} else {
retrievalQueue.add(tableLoader);
}
}
}
}
/**
* Get the latest TableDataLoader and clear all previous loaders
*
* @return
*/
private FFMPTableDataLoader getLoader() {
synchronized (retrievalQueue) {
FFMPTableDataLoader loader = retrievalQueue.get(retrievalQueue
.size() - 1);
retrievalQueue.clear();
return loader;
}
}
@ -2065,40 +2104,54 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
public void tableDataUpdateComplete(FFMPTableDataUpdate updateData) {
final FFMPTableDataUpdate fupdateData = updateData;
if (!this.isDisposed()) {
Display.getDefault().asyncExec(new Runnable() {
@Override
public void run() {
allowNewTableUpdate = fupdateData.isAllowNewTableUpdate();
sourceUpdate = fupdateData.isSourceUpdate();
if (fupdateData.getTableData() != null) {
resetData(fupdateData.getTableData());
}
if (fupdateData.isFireGraph()) {
fireGraphDataEvent(fupdateData.getGraphPfaf(), false,
fupdateData.getGraphTime());
}
setValidTime(fupdateData.getValidTime());
updateGapValueLabel(fupdateData.getGapValueLabel());
resetCursor();
processUpdate(fupdateData);
}
});
}
}
/**
* used to blank the group label when channging HUC
* while in an aggregate.
* Process the update
*/
private void processUpdate(FFMPTableDataUpdate fupdateData) {
allowNewTableUpdate = fupdateData.isAllowNewTableUpdate();
sourceUpdate = fupdateData.isSourceUpdate();
if (retrievalQueue.size() > 0) {
dataRetrieveThread = getLoader();
dataRetrieveThread.start();
return;
} else {
}
if (fupdateData.getTableData() != null && sweet) {
resetData(fupdateData.getTableData());
}
if (fupdateData.isFireGraph()) {
fireGraphDataEvent(fupdateData.getGraphPfaf(), false,
fupdateData.getGraphTime());
}
setValidTime(fupdateData.getValidTime());
updateGapValueLabel(fupdateData.getGapValueLabel());
resetCursor();
sweet = true;
}
/**
* used to blank the group label when channging HUC while in an aggregate.
*/
public void blankGroupLabel() {
if (groupLbl != null) {
groupLbl.setText("");
}
if (groupLbl != null) {
groupLbl.setText("");
}
}
}

View file

@ -1,9 +0,0 @@
package com.raytheon.uf.viz.monitor.ffmp.ui.listeners;
import com.raytheon.uf.common.time.DataTime;
public interface IFFMPMonitorListener {
public void updateDialogTime(DataTime time);
}

View file

@ -950,8 +950,8 @@ public class FFMPDataGenerator {
}
if (qpeBasin != null) {
qpe = qpeBasin.getAccumMaxValue(pfafs, monitor
.getQpeWindow().getAfterTime(), monitor
.getQpeWindow().getBeforeTime(), expirationTime,
.getQpeWindow().getBeforeTime(), monitor
.getQpeWindow().getAfterTime(), expirationTime,
isRate);
trd.setTableCellData(2, new FFMPTableCellData(FIELDS.QPE,
qpe));
@ -1223,7 +1223,6 @@ public class FFMPDataGenerator {
if (resource.isWorstCase() || (resource.centeredAggregationKey != null)) {
// make sure that "ALL" is loaded
huc = "ALL";
rateRecord = monitor.getRateRecord(product, siteKey, dataKey,
product.getRate(), resource.getPaintTime().getRefTime(),
huc, true);

View file

@ -19,7 +19,9 @@
**/
package com.raytheon.uf.viz.monitor.ffmp.ui.rsc;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
@ -35,12 +37,10 @@ import com.raytheon.uf.common.monitor.xml.ProductRunXML;
import com.raytheon.uf.common.monitor.xml.ProductXML;
import com.raytheon.uf.common.monitor.xml.SourceXML;
import com.raytheon.uf.common.ohd.AppsDefaults;
import com.raytheon.uf.common.serialization.DynamicSerializationManager;
import com.raytheon.uf.common.serialization.DynamicSerializationManager.SerializationType;
import com.raytheon.uf.common.serialization.SerializationException;
import com.raytheon.uf.common.serialization.SerializationUtil;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.time.SimulatedTime;
import com.raytheon.uf.common.util.FileUtil;
import com.raytheon.uf.viz.core.VizApp;
import com.raytheon.uf.viz.monitor.ffmp.FFMPMonitor;
import com.raytheon.uf.viz.monitor.ffmp.ui.dialogs.FFMPConfig;
@ -65,8 +65,8 @@ import com.raytheon.uf.viz.monitor.ffmp.ui.listeners.FFMPLoaderEvent;
*/
public class FFMPDataLoader extends Thread {
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(FFMPDataLoader.class);
//private static final transient IUFStatusHandler statusHandler = UFStatus
// .getHandler(FFMPDataLoader.class);
private String sharePath = null;
@ -102,7 +102,6 @@ public class FFMPDataLoader extends Thread {
sharePath = AppsDefaults.getInstance().getToken("apps_dir")
+ File.separator + "ffmp" + File.separator;
//sharePath = "/awips2/edex/data/share/hydroapps/ffmp/";
this.product = resourceData.getProduct();
this.siteKey = resourceData.siteKey;
@ -207,7 +206,7 @@ public class FFMPDataLoader extends Thread {
NavigableMap<Date, List<String>> iguidURIs = null;
Date guidTime = timeBack;
if (loadType == LOADER_TYPE.GENERAL) {
guidTime = getMonitor().getPreviousQueryTime(siteKey,
guidSource.getSourceName());
@ -253,8 +252,7 @@ public class FFMPDataLoader extends Thread {
isDone);
FFMPBasinData qpeData = null;
if ((loadType == LOADER_TYPE.INITIAL)
|| (loadType == LOADER_TYPE.SECONDARY)) {
if (loadType == LOADER_TYPE.INITIAL) {
SourceXML source = getMonitor().getSourceConfig()
.getSource(product.getQpe());
@ -286,8 +284,7 @@ public class FFMPDataLoader extends Thread {
fireLoaderEvent(loadType, "Processing "+product.getQpf(i) + "/" + phuc,
isDone);
FFMPBasinData qpfData = null;
if ((loadType == LOADER_TYPE.INITIAL)
|| (loadType == LOADER_TYPE.SECONDARY)) {
if (loadType == LOADER_TYPE.INITIAL) {
SourceXML source = getMonitor().getSourceConfig()
.getSource(qpfSources.get(i));
@ -342,8 +339,7 @@ public class FFMPDataLoader extends Thread {
isDone);
FFMPBasinData vgbData = null;
if ((loadType == LOADER_TYPE.INITIAL)
|| (loadType == LOADER_TYPE.SECONDARY)) {
if (loadType == LOADER_TYPE.INITIAL) {
SourceXML source = getMonitor().getSourceConfig()
.getSource(product.getVirtual());
@ -479,28 +475,67 @@ public class FFMPDataLoader extends Thread {
String sourceName = source.getSourceName();
File file = new File(sharePath + wfo + File.separator + sourceName
+ "-" + siteKey + "-" + pdataKey + "-" + huc + ".bin");
System.out.println("Buddy File path: " + file.getAbsolutePath());
File lockFile = new File(sharePath + wfo + File.separator + sourceName
+ "-" + siteKey + "-" + pdataKey + ".lock");
while (lockFile.exists()) {
for (int i = 0; i < 4; i++) {
try {
sleep(100);
i++;
} catch (InterruptedException e) {
e.printStackTrace();
}
}
break;
}
System.out.println("Buddy File expected path: " + file.getAbsolutePath());
FFMPBasinData basinData = null;
if (file.exists()) {
System.out.println("Last mod: " + new Date(file.lastModified()));
//System.out.println("6 hour mod: " + new Date((System.currentTimeMillis() - (6 * 1000 * 3600))));
//System.out.println("DIFF: "+(file.lastModified() - (System.currentTimeMillis() - (6 * 1000 * 3600))));
if (file.lastModified() > (System.currentTimeMillis() - (6 * 1000 * 3600))) {
System.out.println("Buddy File path: " + file.getName());
while (lockFile.exists()) {
for (int i = 0; i < 4; i++) {
try {
System.out.println("Waiting for new file: " + file.getAbsolutePath());
sleep(100);
i++;
} catch (InterruptedException e) {
e.printStackTrace();
}
}
break;
}
BufferedInputStream is = null;
try {
basinData = (FFMPBasinData) SerializationUtil
.transformFromThrift(FileUtil.file2bytes(file,
false));
System.out.println("Loading file: " + file.getName());
is = new BufferedInputStream(
new FileInputStream(file));
DynamicSerializationManager dsm = DynamicSerializationManager
.getManager(SerializationType.Thrift);
basinData = (FFMPBasinData) dsm.deserialize(is);
} catch (SerializationException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
if (is != null) {
try {
is.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
}

View file

@ -73,10 +73,8 @@ import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.monitor.config.FFFGDataMgr;
import com.raytheon.uf.common.monitor.config.FFMPRunConfigurationManager;
import com.raytheon.uf.common.monitor.config.FFMPSourceConfigurationManager;
import com.raytheon.uf.common.monitor.xml.DomainXML;
import com.raytheon.uf.common.monitor.xml.ProductRunXML;
import com.raytheon.uf.common.monitor.xml.ProductXML;
import com.raytheon.uf.common.monitor.xml.SourceXML;
import com.raytheon.uf.common.status.IUFStatusHandler;
@ -151,6 +149,8 @@ import com.vividsolutions.jts.geom.Point;
* ------------ ---------- ----------- --------------------------
* 29 June, 2009 2521 dhladky Initial creation
* 11 Apr. 2012 DR 14522 gzhang Fixing invalid thread error.
* 31 July 2012 14517 mpduff Fix for blanking map on update.
*
* </pre>
* @author dhladky
* @version 1.0
@ -236,7 +236,7 @@ public class FFMPResource extends
// time used by the resource
private DataTime paintTime = null;
/** mouse handler **/
private final IInputHandler inspectAdapter = new InputAdapter() {
@ -378,6 +378,9 @@ public class FFMPResource extends
/** force utility **/
private FFFGForceUtil forceUtil = null;
/** Restore Table flag */
private boolean restoreTable = false;
/**
* FFMP resource
*
@ -409,6 +412,7 @@ public class FFMPResource extends
FFFGDataMgr.getUpdatedInstance();
PluginDataObject[] pdos = (PluginDataObject[]) object;
FFMPRecord ffmpRec = (FFMPRecord) pdos[pdos.length - 1];
// only care about the most recent one
try {
if (ffmpRec.getSourceName()
@ -432,23 +436,35 @@ public class FFMPResource extends
+ previousMostRecentTime + " New: "
+ ffmpRec.getDataTime().getRefTime());
if (getResourceData().tableLoad) {
if (getResourceData().tableLoad) {
startLoader(previousMostRecentTime, ffmpRec
.getDataTime().getRefTime(),
LOADER_TYPE.GENERAL);
if (loader == null) {
startLoader(previousMostRecentTime, ffmpRec
.getDataTime().getRefTime(),
LOADER_TYPE.GENERAL);
} else {
while (!loader.isDone) {
try {
Thread.sleep(10);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
startLoader(previousMostRecentTime, ffmpRec
.getDataTime().getRefTime(),
LOADER_TYPE.GENERAL);
}
while (!loader.isDone) {
try {
Thread.sleep(10);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
while (!loader.isDone) {
try {
Thread.sleep(10);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
setTableTime();
purge(ffmpRec.getDataTime().getRefTime());
}
purge(ffmpRec.getDataTime().getRefTime());
}
qpeRecord = null;
isNewQpe = true;
@ -463,19 +479,17 @@ public class FFMPResource extends
isNewQpf = true;
}
if (getResourceData().tableLoad) {
isFirst = true;
allowNewTableUpdate();
monitor.updateDialog(this);
}
} catch (VizException ve) {
statusHandler.handle(Priority.PROBLEM, "Error updating record",
ve);
}
}
if (getResourceData().tableLoad) {
allowNewTableUpdate();
isFirst = true;
}
refresh();
}
@ -579,7 +593,7 @@ public class FFMPResource extends
return getColorUtil().colorByValue(value);
} else {
if (getCenteredAggregatePfafs().contains(key) && isParent()) {
// this is for a reason
} else {
if (!isMaintainLayer() && isParent()) {
return getColorUtil().colorByValue(value);
@ -652,8 +666,8 @@ public class FFMPResource extends
value = getQpeRecord().getBasinData("ALL")
.getAccumMaxValue(
pfafs,
getTableTime(),
recentTime,
getTableTime(),
getQpeSourceExpiration(),
getResourceData().getPrimarySourceXML()
.isRate());
@ -683,7 +697,9 @@ public class FFMPResource extends
pfafs);
break;
}
case RATE:// fall through
case RATE:
value = getBasin(key, field, recentTime, aggregate).getValue(recentTime);
break;
case QPF: {
value = getBasin(key, field, recentTime, aggregate)
.getAverageValue(recentTime, getQpfSourceExpiration());
@ -780,7 +796,13 @@ public class FFMPResource extends
sfield = FFMPRecord.FIELDS.QPE;
}
PluginDataObject pdo = getRecord(sfield, paintTime.getRefTime());
PluginDataObject pdo = null;
try {
pdo = getRecord(sfield, paintTime.getRefTime());
} catch (NullPointerException npe) {
return "No Data Available";
}
if (pdo == null) {
return "No Data Available";
@ -817,9 +839,9 @@ public class FFMPResource extends
/**
* Gets the record currently used
*
* @return FFMPRecord
* @return FFMPCacheRecord
*/
public FFMPRecord getRateRecord(Date recentTime) {
public FFMPCacheRecord getRateRecord(Date recentTime) {
if ((rateRecord == null) && isNewRate) {
try {
@ -847,9 +869,9 @@ public class FFMPResource extends
/**
* Gets the record currently used
*
* @return FFMPRecord
* @return FFMPCacheRecord
*/
public FFMPRecord getQpeRecord() {
public FFMPCacheRecord getQpeRecord() {
try {
if ((qpeRecord == null) && (getTableTime() != null) && isNewQpe) {
@ -876,9 +898,9 @@ public class FFMPResource extends
/**
* Gets the record currently used
*
* @return FFMPRecord
* @return FFMPCacheRecord
*/
public FFMPRecord getGuidanceRecord() {
public FFMPCacheRecord getGuidanceRecord() {
try {
if ((guidRecord == null) || isNewGuid) {
Date date = null;
@ -915,9 +937,9 @@ public class FFMPResource extends
/**
* Gets the record currently used
*
* @return FFMPRecord
* @return FFMPReFFMPCacheRecordcord
*/
public FFMPRecord getQpfRecord(Date recentTime) {
public FFMPCacheRecord getQpfRecord(Date recentTime) {
try {
if ((qpfRecord == null) && isNewQpf) {
Date date = null;
@ -951,9 +973,9 @@ public class FFMPResource extends
/**
* Gets the record currently used
*
* @return FFMPRecord
* @return FFMPCacheRecord
*/
public FFMPRecord getVirtualRecord() {
public FFMPCacheRecord getVirtualRecord() {
try {
if ((virtualRecord == null) && isNewVirtual) {
virtualRecord = monitor.getVirtualRecord(getProduct(),
@ -973,9 +995,9 @@ public class FFMPResource extends
* General get record call
*
* @param pfield
* @return FFMPRecord
* @return FFMPCacheRecord
*/
public FFMPRecord getRecord(FIELDS pfield, Date recentTime) {
public FFMPCacheRecord getRecord(FIELDS pfield, Date recentTime) {
if (pfield == FIELDS.GUIDANCE) {
return getGuidanceRecord();
} else if (pfield == FIELDS.RATIO) {
@ -1174,10 +1196,11 @@ public class FFMPResource extends
if (getResourceData().tableLoad
&& !paintTime.getRefTime().equals(getMostRecentTime())) {
setMostRecentTime(paintTime.getRefTime());
setTableTime();
monitor.updateDialog(this);
if (isLinkToFrame) {
updateDialog();
}
}
} else {
if (getResourceData().getMonitor().ffmpSplash != null) {
@ -1469,6 +1492,20 @@ public class FFMPResource extends
shadedShapes.clear();
}
if (streamShadedShape != null) {
streamShadedShape.dispose();
streamShadedShape = null;
}
if (streamOutlineShape != null) {
streamOutlineShape.dispose();
streamOutlineShape = null;
}
if (smallBasinOverlayShape != null) {
smallBasinOverlayShape.dispose();
smallBasinOverlayShape = null;
}
setQuery(true);
refresh();
}
@ -1731,12 +1768,12 @@ public class FFMPResource extends
if (getResourceData().tableLoad) {
if (isUpdateDialog) {
monitor.updateDialog(this);
updateDialog();
}
// stops the annoying wait cursor every time you re-center
if (getHuc().equals("ALL")
&& (lowestCenter == FFMPRecord.ZOOM.BASIN)) {
|| (lowestCenter == FFMPRecord.ZOOM.BASIN)) {
basinTableDlg.getShell().setCursor(null);
}
}
@ -2242,9 +2279,9 @@ public class FFMPResource extends
* @param value
*/
private void addWorstCase(Long aggPfaf, Date recentTime, Float value) {
if (drawables.get(new DataTime(recentTime)) != null) {
drawables.get(new DataTime(recentTime)).worstCaseHash.put(aggPfaf,
value);
FFMPDrawable drawable = drawables.get(new DataTime(recentTime));
if (drawable != null && drawable.worstCaseHash != null) {
drawable.worstCaseHash.put(aggPfaf, value);
}
}
@ -2409,7 +2446,8 @@ public class FFMPResource extends
}
if ((cwaBasins.size() == 0)
|| !req.extent.equals(drawable.getExt())
|| !phuc.equals(drawable.getHuc())) {
|| !phuc.equals(drawable.getHuc())
|| restoreTable) {
Envelope env = null;
try {
Envelope e = req.descriptor.pixelToWorld(req.extent,
@ -2434,7 +2472,7 @@ public class FFMPResource extends
templates, getSiteKey(), cwa, phuc);
for (Entry<Long, Envelope> entry : envMap.entrySet()) {
if (env.intersects(entry.getValue())) {
if (env.intersects(entry.getValue()) || env.contains(entry.getValue())) {
// add the individual basins
cwaBasins.add(entry.getKey());
}
@ -2535,7 +2573,6 @@ public class FFMPResource extends
} else {
// center selected, determine center key
if (!phuc.equals("ALL")) {
if (centeredAggregationKey instanceof String) {
if (lowestCenter != ZOOM.BASIN) {
@ -2546,6 +2583,10 @@ public class FFMPResource extends
} else {
centeredAggr = (Long) drawable
.getCenterAggrKey();
// this is a fall back for VGB's
if (centeredAggr == null) {
centeredAggr = templates.findAggregatedVGB((String) centeredAggregationKey, getSiteKey(), phuc);
}
}
} else {
@ -2554,6 +2595,9 @@ public class FFMPResource extends
} else {
centeredAggr = (Long) drawable
.getCenterAggrKey();
if (centeredAggr == null) {
centeredAggr = templates.getAggregatedPfaf((Long)centeredAggregationKey, getSiteKey(), phuc);
}
}
}
@ -2728,6 +2772,10 @@ public class FFMPResource extends
}
}
if (restoreTable) {
restoreTable = false;
}
drawable.setTime(req.time);
if (lowestCenter != ZOOM.BASIN) {
drawable.setCenterAggrKey(centeredAggregationKey);
@ -2782,6 +2830,11 @@ public class FFMPResource extends
// check whether or not the dialog needs to be dumped
monitor.splashDisposeAndDataLoad(getResource());
if (getResourceData().tableLoad && isFirst) {
isFirst = false;
updateDialog();
}
}
});
@ -3112,6 +3165,7 @@ public class FFMPResource extends
}
refresh();
updateDialog();
}
@ -3145,7 +3199,8 @@ public class FFMPResource extends
public void restoreTable() {
centeredAggregationKey = null;
centeredAggregatePfafList = null;
restoreTable = true;
lowestCenter = FFMPRecord.ZOOM.WFO;
getDescriptor().getRenderableDisplay().getExtent().reset();
zoom(1.0f);
@ -3796,7 +3851,7 @@ public class FFMPResource extends
long fips = monitor.getTemplates(getSiteKey()).getCountyFipsByPfaf(
basin.getPfaf());
basin.setCountyFips(fips);
if (getResourceData().tableLoad) {
// interpolating
if (getGuidanceInterpolation(guidType).isInterpolate()) {
@ -4235,7 +4290,7 @@ public class FFMPResource extends
if (status.getLoaderType() == LOADER_TYPE.SECONDARY) {
if (status.isDone() && !this.getResourceData().isTertiaryLoad) {
try {
Date startDate = new Date(getMostRecentTime().getTime() - 12 * 3600 * 1000);
Date startDate = new Date(getMostRecentTime().getTime() - (6 * 3600 * 1000));
FFMPMonitor.getInstance().startLoad(this, startDate,
LOADER_TYPE.TERTIARY);
} catch (VizException e) {

View file

@ -40,7 +40,6 @@ import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.monitor.config.FFMPRunConfigurationManager;
import com.raytheon.uf.common.monitor.config.FFMPSourceConfigurationManager.SOURCE_TYPE;
import com.raytheon.uf.common.monitor.config.FFMPTemplateConfigurationManager;
import com.raytheon.uf.common.monitor.xml.DomainXML;
import com.raytheon.uf.common.monitor.xml.ProductRunXML;
import com.raytheon.uf.common.monitor.xml.ProductXML;
@ -230,18 +229,39 @@ public class FFMPResourceData extends AbstractRequestableResourceData {
this.timeBack = new Date(
(long) (mostRecentTime.getRefTime().getTime() - (cfgBasinXML
.getTimeFrame() * 3600 * 1000)));
ArrayList<String> hucsToLoad = FFMPTemplateConfigurationManager.getInstance().getHucLevels();
ArrayList<String> hucsToLoad = monitor.getTemplates(siteKey).getTemplateMgr().getHucLevels();
//ArrayList<String> hucsToLoad = new ArrayList<String>();
//hucsToLoad.add(cfgBasinXML.getLayer());
//hucsToLoad.add("ALL");
// goes back X hours and pre populates the Data Hashes
FFMPDataLoader loader = new FFMPDataLoader(this, timeBack,
mostRecentTime.getRefTime(), LOADER_TYPE.INITIAL,
hucsToLoad);
loader.start();
int i = 0;
// make the table load wait for finish of initial data load
while (!loader.isDone) {
try {
// give it 120 or so seconds
if (i > 4000) {
statusHandler
.handle(Priority.WARN,
"Didn't load initial data in allotted time, releasing table");
break;
}
Thread.sleep(30);
i++;
} catch (InterruptedException e) {
e.printStackTrace();
}
}
} else {
SourceXML source = getPrimarySourceXML();
this.domains = monitor.getRunConfig().getDomains();
for (int i = 0; i < objects.length; i++) {
FFMPRecord rec = (FFMPRecord) objects[i];
rec.setExpiration(source.getExpirationMinutes(siteKey));

View file

@ -41,7 +41,8 @@ import com.raytheon.uf.viz.monitor.ffmp.ui.dialogs.FfmpBasinTableDlg;
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Oct 13, 2011 dhladky Initial creation
* Oct 13, 2011 dhladky Initial creation.
* Jul 31, 2012 14517 mpduff Fix for Rapid slider changes
*
* </pre>
*
@ -49,7 +50,7 @@ import com.raytheon.uf.viz.monitor.ffmp.ui.dialogs.FfmpBasinTableDlg;
* @version 1.0
*/
public class FFMPTableDataLoader implements Runnable {
public class FFMPTableDataLoader extends Thread {
private IMonitorEvent fme = null;
@ -64,6 +65,8 @@ public class FFMPTableDataLoader implements Runnable {
private Date date = null;
private FfmpBasinTableDlg callback = null;
private boolean isDone = false;
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(FFMPTableDataLoader.class);
@ -96,7 +99,6 @@ public class FFMPTableDataLoader implements Runnable {
public void run() {
if (fme.getSource() instanceof FFMPMonitor) {
FFMPTableDataUpdate tableDataUpdate = new FFMPTableDataUpdate();
FFMPMonitor ffmp = (FFMPMonitor) fme.getSource();
@ -109,12 +111,12 @@ public class FFMPTableDataLoader implements Runnable {
FFMPTableData tData = null;
try {
FFMPDrawable drawable = resource.getDrawable(resource
.getPaintTime());
if ((drawable != null)
try {
FFMPDrawable drawable = resource.getDrawable(resource
.getPaintTime());
if ((drawable != null)
&& (drawable.getDrawTime() == resource
.getTime())) {
String iHuc = null;
@ -124,8 +126,7 @@ public class FFMPTableDataLoader implements Runnable {
iHuc = "ALL";
}
if (drawable.getTableData(iHuc) != null) {
//System.out.println(" Cache HITTTTTTTTT!!!!!");
// System.out.println(" Cache HITTTTTTTTT!!!!!");
tData = drawable.getTableData(iHuc);
}
}
@ -140,13 +141,15 @@ public class FFMPTableDataLoader implements Runnable {
iHuc = "ALL";
}
//System.out
// .println(" Cache MISSSSSSSSSSSS!!!!!");
// System.out
// .println(" Cache MISSSSSSSSSSSS!!!!!");
double origDrawTime = resource.getTime();
FFMPDataGenerator dg = new FFMPDataGenerator(
ffmp, resource);
tData = dg.generateFFMPData();
drawable.setTableData(iHuc, tData);
drawable.setDrawTime(resource.getTime());
drawable.setDrawTime(origDrawTime);
}
}
} catch (Exception e) {
@ -174,8 +177,7 @@ public class FFMPTableDataLoader implements Runnable {
tableDataUpdate.setFireGraph(true);
tableDataUpdate.setGraphPfaf(basinTrendDlg
.getPfaf());
tableDataUpdate.setGraphTime(resource
.getTableTime());
tableDataUpdate.setGraphTime(resource.getMostRecentTime());
}
sourceUpdate = false;
@ -204,8 +206,14 @@ public class FFMPTableDataLoader implements Runnable {
tableDataUpdate.setGapValueLabel(gapVal);
tableDataUpdate.setAllowNewTableUpdate(allowNewTableUpdate);
tableDataUpdate.setSourceUpdate(sourceUpdate);
isDone = true;
callback.tableDataUpdateComplete(tableDataUpdate);
}
}
public boolean isDone() {
return isDone;
}
}

View file

@ -79,6 +79,8 @@ import com.vividsolutions.jts.geom.Coordinate;
* ------------ ---------- ----------- --------------------------
* Oct 13, 2009 dhladky Initial creation
*
* Jul 24 2012 12996 Xiaochuan Compare with MidVal()
*
* </pre>
*
* @author dhladky
@ -359,7 +361,7 @@ public class ScanResource extends
d = Double.valueOf(rank);
}
if (d >= getScanDrawer().ddfc.getLowerVal()) {
if (d >= getScanDrawer().ddfc.getMidVal()) {
if (!getScanDrawer().ddfc.isOverlap()) {
if ((dtdr != null) && !dtdr.getOverlap()) {
isOverlap = false;

View file

@ -902,192 +902,232 @@ public final class TableUtil {
return null;
}
private static TableRowData getSnowMetarHistTableRowData(ObReport report) {
TableRowData tblRowData = new TableRowData(8);
tblRowData.setTableCellData(0, new TableCellData(report.getObservationTime(),"HH:mm MMM dd",CellType.ObsHist));
tblRowData.setTableCellData(1,
new TableCellData(Math.round(new Float(report.getWindDir())),
CellType.ObsHist, true));
tblRowData.setTableCellData(2,
new TableCellData(Math.round(new Float(report.getWindSpeed())),
CellType.ObsHist, true));
tblRowData.setTableCellData(3,
new TableCellData(Math.round(new Float(report.getWindGust())),
CellType.ObsHist, true));
tblRowData.setTableCellData(4, new TableCellData(report.getPressure(), CellType.ObsHist, CommonTableConfig.obsHistCols.P));
tblRowData.setTableCellData(
5,
new TableCellData(
Math.round(new Float(report.getTemperature())),
CellType.ObsHist, true));
tblRowData.setTableCellData(6,
new TableCellData(Math.round(new Float(report.getDewpoint())),
CellType.ObsHist, true));
tblRowData.setTableCellData(7, new TableCellData(report.getPressureChange(), CellType.ObsHist, CommonTableConfig.obsHistCols.PTend));
return tblRowData;
}
private static TableRowData getSnowMetarHistTableRowData(ObReport report) {
TableRowData tblRowData = new TableRowData(10);
tblRowData.setTableCellData(0,
new TableCellData(report.getObservationTime(), "HH:mm MMM dd",
CellType.ObsHist));
tblRowData.setTableCellData(1,
new TableCellData(new Float(report.getLatitude()),
CellType.ObsHist, true));
tblRowData.setTableCellData(2,
new TableCellData(new Float(report.getLongitude()),
CellType.ObsHist, true));
tblRowData.setTableCellData(3,
new TableCellData(Math.round(new Float(report.getWindDir())),
CellType.ObsHist, true));
tblRowData.setTableCellData(4,
new TableCellData(Math.round(new Float(report.getWindSpeed())),
CellType.ObsHist, true));
tblRowData.setTableCellData(5,
new TableCellData(Math.round(new Float(report.getWindGust())),
CellType.ObsHist, true));
tblRowData.setTableCellData(6, new TableCellData(report.getPressure(),
CellType.ObsHist, CommonTableConfig.obsHistCols.P));
tblRowData.setTableCellData(7,
new TableCellData(
Math.round(new Float(report.getTemperature())),
CellType.ObsHist, true));
tblRowData.setTableCellData(8,
new TableCellData(Math.round(new Float(report.getDewpoint())),
CellType.ObsHist, true));
tblRowData.setTableCellData(9,
new TableCellData(report.getPressureChange(), CellType.ObsHist,
CommonTableConfig.obsHistCols.PTend));
return tblRowData;
}
private static TableRowData getSafeSeasMetarHistTableRowData(ObReport report) {
// same as getSnowHistTableRowData
return getSnowMetarHistTableRowData(report);
}
private static TableRowData getSafeseasMaritimeHistTableRowData(ObReport report) {
TableRowData tblRowData = new TableRowData(15);
tblRowData.setTableCellData(0, new TableCellData(report.getObservationTime(),"HH:mm MMM dd",CellType.ObsHist));
tblRowData.setTableCellData(1,
new TableCellData(Math.round(new Float(report.getWindSpeed())),
CellType.ObsHist, true));
tblRowData.setTableCellData(
2,
new TableCellData(
Math.round(new Float(report.getMaxWindSpeed())),
CellType.ObsHist, true));
tblRowData.setTableCellData(3,
new TableCellData(Math.round(new Float(report.getWindGust())),
CellType.ObsHist, true));
tblRowData.setTableCellData(4,
new TableCellData(
Math.round(new Float(report.getVisibility())),
CellType.ObsHist, true));
tblRowData.setTableCellData(5, new TableCellData(report.getPressure(), CellType.ObsHist, CommonTableConfig.obsHistCols.P));
tblRowData.setTableCellData(
6,
new TableCellData(Math.round(new Float(report
.getPressureChange())), CellType.ObsHist, true));
tblRowData.setTableCellData(
7,
new TableCellData(
Math.round(new Float(report.getTemperature())),
CellType.ObsHist, true));
tblRowData.setTableCellData(8,
new TableCellData(Math.round(new Float(report.getDewpoint())),
CellType.ObsHist, true));
tblRowData.setTableCellData(
9,
new TableCellData(Math.round(new Float(report
.getSeaSurfaceTemp())), CellType.ObsHist, true));
tblRowData.setTableCellData(
10,
new TableCellData(Math.round(new Float(report
.getHighResWaveHeight())), CellType.ObsHist, true));
tblRowData.setTableCellData(
11,
new TableCellData(Math.round(new Float(report
.getWaveSteepness())), CellType.ObsHist, true));
tblRowData.setTableCellData(
12,
new TableCellData(
Math.round(new Float(report.getPSwellHeight())),
CellType.ObsHist, true));
tblRowData.setTableCellData(
13,
new TableCellData(
Math.round(new Float(report.getPSwellPeriod())),
CellType.ObsHist, true));
tblRowData.setTableCellData(14,
new TableCellData(Math.round(new Float(report.getPSwellDir())),
CellType.ObsHist, true));
return tblRowData;
}
private static TableRowData getSafeseasMaritimeHistTableRowData(
ObReport report) {
TableRowData tblRowData = new TableRowData(17);
tblRowData.setTableCellData(0,
new TableCellData(report.getObservationTime(), "HH:mm MMM dd",
CellType.ObsHist));
tblRowData.setTableCellData(1,
new TableCellData(new Float(report.getLatitude()),
CellType.ObsHist, true));
tblRowData.setTableCellData(2,
new TableCellData(new Float(report.getLongitude()),
CellType.ObsHist, true));
tblRowData.setTableCellData(3,
new TableCellData(Math.round(new Float(report.getWindSpeed())),
CellType.ObsHist, true));
tblRowData.setTableCellData(
4,
new TableCellData(
Math.round(new Float(report.getMaxWindSpeed())),
CellType.ObsHist, true));
tblRowData.setTableCellData(5,
new TableCellData(Math.round(new Float(report.getWindGust())),
CellType.ObsHist, true));
tblRowData.setTableCellData(6,
new TableCellData(
Math.round(new Float(report.getVisibility())),
CellType.ObsHist, true));
tblRowData.setTableCellData(7, new TableCellData(report.getPressure(),
CellType.ObsHist, CommonTableConfig.obsHistCols.P));
tblRowData.setTableCellData(
8,
new TableCellData(Math.round(new Float(report
.getPressureChange())), CellType.ObsHist, true));
tblRowData.setTableCellData(
9,
new TableCellData(
Math.round(new Float(report.getTemperature())),
CellType.ObsHist, true));
tblRowData.setTableCellData(10,
new TableCellData(Math.round(new Float(report.getDewpoint())),
CellType.ObsHist, true));
tblRowData.setTableCellData(
11,
new TableCellData(Math.round(new Float(report
.getSeaSurfaceTemp())), CellType.ObsHist, true));
tblRowData.setTableCellData(
12,
new TableCellData(Math.round(new Float(report
.getHighResWaveHeight())), CellType.ObsHist, true));
tblRowData.setTableCellData(
13,
new TableCellData(Math.round(new Float(report
.getWaveSteepness())), CellType.ObsHist, true));
tblRowData.setTableCellData(
14,
new TableCellData(
Math.round(new Float(report.getPSwellHeight())),
CellType.ObsHist, true));
tblRowData.setTableCellData(
15,
new TableCellData(
Math.round(new Float(report.getPSwellPeriod())),
CellType.ObsHist, true));
tblRowData.setTableCellData(16,
new TableCellData(Math.round(new Float(report.getPSwellDir())),
CellType.ObsHist, true));
return tblRowData;
}
private static TableRowData getFogMaritimeHistTableRowData(ObReport report) {
TableRowData tblRowData = new TableRowData(16);
tblRowData.setTableCellData(0, new TableCellData(report.getObservationTime(),"HH:mm MMM dd",CellType.ObsHist));
tblRowData.setTableCellData(1,
new TableCellData(Math.round(new Float(report.getWindSpeed())),
CellType.ObsHist, true));
tblRowData.setTableCellData(
2,
new TableCellData(
Math.round(new Float(report.getMaxWindSpeed())),
CellType.ObsHist, true));
tblRowData.setTableCellData(3,
new TableCellData(Math.round(new Float(report.getWindGust())),
CellType.ObsHist, true));
tblRowData.setTableCellData(4,
new TableCellData(
Math.round(new Float(report.getVisibility())),
CellType.ObsHist, true));
tblRowData.setTableCellData(5, new TableCellData(report.getPressure(), CellType.ObsHist, CommonTableConfig.obsHistCols.P));
tblRowData.setTableCellData(
6,
new TableCellData(Math.round(new Float(report
.getPressureChange())), CellType.ObsHist, true));
tblRowData.setTableCellData(
7,
new TableCellData(
Math.round(new Float(report.getTemperature())),
CellType.ObsHist, true));
tblRowData.setTableCellData(8,
new TableCellData(Math.round(new Float(report.getDewpoint())),
CellType.ObsHist, true));
tblRowData.setTableCellData(
9,
new TableCellData(Math.round(new Float(report
.getSeaSurfaceTemp())), CellType.ObsHist, true));
tblRowData.setTableCellData(
10,
new TableCellData(Math.round(new Float(report
.getHighResWaveHeight())), CellType.ObsHist, true));
tblRowData.setTableCellData(
11,
new TableCellData(Math.round(new Float(report
.getWaveSteepness())), CellType.ObsHist, true));
tblRowData.setTableCellData(
12,
new TableCellData(
Math.round(new Float(report.getPSwellHeight())),
CellType.ObsHist, true));
tblRowData.setTableCellData(
13,
new TableCellData(
Math.round(new Float(report.getPSwellPeriod())),
CellType.ObsHist, true));
tblRowData.setTableCellData(14,
new TableCellData(Math.round(new Float(report.getPSwellDir())),
CellType.ObsHist, true));
tblRowData.setTableCellData(
15,
new TableCellData(Math.round(new Float(report
.getRelativeHumidity())), CellType.ObsHist, true));
return tblRowData;
}
private static TableRowData getFogMaritimeHistTableRowData(ObReport report) {
TableRowData tblRowData = new TableRowData(18);
tblRowData.setTableCellData(0,
new TableCellData(report.getObservationTime(), "HH:mm MMM dd",
CellType.ObsHist));
tblRowData.setTableCellData(1,
new TableCellData(new Float(report.getLatitude()),
CellType.ObsHist, true));
tblRowData.setTableCellData(2,
new TableCellData(new Float(report.getLongitude()),
CellType.ObsHist, true));
tblRowData.setTableCellData(3,
new TableCellData(Math.round(new Float(report.getWindSpeed())),
CellType.ObsHist, true));
tblRowData.setTableCellData(
4,
new TableCellData(
Math.round(new Float(report.getMaxWindSpeed())),
CellType.ObsHist, true));
tblRowData.setTableCellData(5,
new TableCellData(Math.round(new Float(report.getWindGust())),
CellType.ObsHist, true));
tblRowData.setTableCellData(6,
new TableCellData(
Math.round(new Float(report.getVisibility())),
CellType.ObsHist, true));
tblRowData.setTableCellData(7, new TableCellData(report.getPressure(),
CellType.ObsHist, CommonTableConfig.obsHistCols.P));
tblRowData.setTableCellData(
8,
new TableCellData(Math.round(new Float(report
.getPressureChange())), CellType.ObsHist, true));
tblRowData.setTableCellData(
9,
new TableCellData(
Math.round(new Float(report.getTemperature())),
CellType.ObsHist, true));
tblRowData.setTableCellData(10,
new TableCellData(Math.round(new Float(report.getDewpoint())),
CellType.ObsHist, true));
tblRowData.setTableCellData(
11,
new TableCellData(Math.round(new Float(report
.getSeaSurfaceTemp())), CellType.ObsHist, true));
tblRowData.setTableCellData(
12,
new TableCellData(Math.round(new Float(report
.getHighResWaveHeight())), CellType.ObsHist, true));
tblRowData.setTableCellData(
13,
new TableCellData(Math.round(new Float(report
.getWaveSteepness())), CellType.ObsHist, true));
tblRowData.setTableCellData(
14,
new TableCellData(
Math.round(new Float(report.getPSwellHeight())),
CellType.ObsHist, true));
tblRowData.setTableCellData(
15,
new TableCellData(
Math.round(new Float(report.getPSwellPeriod())),
CellType.ObsHist, true));
tblRowData.setTableCellData(16,
new TableCellData(Math.round(new Float(report.getPSwellDir())),
CellType.ObsHist, true));
tblRowData.setTableCellData(
17,
new TableCellData(Math.round(new Float(report
.getRelativeHumidity())), CellType.ObsHist, true));
return tblRowData;
}
private static TableRowData getFogMetarHistTableRowData(ObReport report) {
TableRowData tblRowData = new TableRowData(12);
tblRowData.setTableCellData(0, new TableCellData(report.getObservationTime(),"HH:mm MMM dd",CellType.ObsHist));
tblRowData.setTableCellData(
1,
new TableCellData(Math.round(new Float(report
.getRelativeHumidity())), CellType.ObsHist, true));
tblRowData.setTableCellData(2,
new TableCellData(
Math.round(new Float(report.getVisibility())),
CellType.ObsHist, true));
tblRowData.setTableCellData(3,
new TableCellData(Math.round(new Float(report.getCeiling())),
CellType.ObsHist, true));
tblRowData.setTableCellData(4,
new TableCellData(Math.round(new Float(report.getWindDir())),
CellType.ObsHist, true));
tblRowData.setTableCellData(5,
new TableCellData(Math.round(new Float(report.getWindSpeed())),
CellType.ObsHist, true));
tblRowData.setTableCellData(6,
new TableCellData(Math.round(new Float(report.getWindGust())),
CellType.ObsHist, true));
tblRowData.setTableCellData(7, new TableCellData(report.getPressure(), CellType.ObsHist, CommonTableConfig.obsHistCols.P));
int tmph = Math.round(new Float(report.getTemperature()));
int dpth = Math.round(new Float(report.getDewpoint()));
tblRowData.setTableCellData(8, new TableCellData(tmph,
CellType.ObsHist, true));
tblRowData.setTableCellData(9, new TableCellData(dpth,
CellType.ObsHist, true));
tblRowData.setTableCellData(10, new TableCellData(tmph - dpth,
CellType.ObsHist, true));
tblRowData.setTableCellData(11, new TableCellData(report.getPressureChange(), CellType.ObsHist, CommonTableConfig.obsHistCols.PTend));
return tblRowData;
}
private static TableRowData getFogMetarHistTableRowData(ObReport report) {
TableRowData tblRowData = new TableRowData(14);
tblRowData.setTableCellData(0,
new TableCellData(report.getObservationTime(), "HH:mm MMM dd",
CellType.ObsHist));
tblRowData.setTableCellData(1,
new TableCellData(new Float(report.getLatitude()),
CellType.ObsHist, true));
tblRowData.setTableCellData(2,
new TableCellData(new Float(report.getLongitude()),
CellType.ObsHist, true));
tblRowData.setTableCellData(
3,
new TableCellData(Math.round(new Float(report
.getRelativeHumidity())), CellType.ObsHist, true));
tblRowData.setTableCellData(4,
new TableCellData(
Math.round(new Float(report.getVisibility())),
CellType.ObsHist, true));
tblRowData.setTableCellData(5,
new TableCellData(Math.round(new Float(report.getCeiling())),
CellType.ObsHist, true));
tblRowData.setTableCellData(6,
new TableCellData(Math.round(new Float(report.getWindDir())),
CellType.ObsHist, true));
tblRowData.setTableCellData(7,
new TableCellData(Math.round(new Float(report.getWindSpeed())),
CellType.ObsHist, true));
tblRowData.setTableCellData(8,
new TableCellData(Math.round(new Float(report.getWindGust())),
CellType.ObsHist, true));
tblRowData.setTableCellData(9, new TableCellData(report.getPressure(),
CellType.ObsHist, CommonTableConfig.obsHistCols.P));
int tmph = Math.round(new Float(report.getTemperature()));
int dpth = Math.round(new Float(report.getDewpoint()));
tblRowData.setTableCellData(10, new TableCellData(tmph,
CellType.ObsHist, true));
tblRowData.setTableCellData(11, new TableCellData(dpth,
CellType.ObsHist, true));
tblRowData.setTableCellData(12, new TableCellData(tmph - dpth,
CellType.ObsHist, true));
tblRowData.setTableCellData(13,
new TableCellData(report.getPressureChange(), CellType.ObsHist,
CommonTableConfig.obsHistCols.PTend));
return tblRowData;
}
}

View file

@ -301,7 +301,7 @@ public class StationTableComp extends TableComp {
* @param name
*/
public void setIdLabel(String name) {
idLbl.setText("Zone/County: " + name);
idLbl.setText("Zone/County: "+ this.id +" - "+ name);
controlComp.layout();
}

View file

@ -67,9 +67,12 @@ import com.vividsolutions.jts.geom.Coordinate;
* replaced deprecated function calls
* replaced deprecated function calls
* Feb 10, 2011 8030 bkowal access to the plots ArrayList is now synchronized
* Feb 15, 2011 8036 bkowal magnification only affects the x-axis, wind bards, and
* Feb 15, 2011 8036 bkowal magnification only affects the x-axis, wind barbs, and
* the color bar.
*
* ======================================
* AWIPS2 DR Work
* 08/10/2012 1035 jkorman Changed number of 'staffs' from 12 to 13 and changed time
* display to match AWIPS I.
* </pre>
*
* @author dhladky
@ -81,6 +84,8 @@ public class ProfilerResource extends
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(ProfilerResource.class);
private static final int NUM_PROFILE_STAFFS = 13;
/* Graphic target */
private IGraphicsTarget target = null;
@ -137,7 +142,7 @@ public class ProfilerResource extends
protected void initInternal(IGraphicsTarget target) throws VizException {
this.target = target;
dataTimes = new ArrayList<DataTime>();
incX = (ProfilerUtils.profilerRectangle.width / 12);
incX = (ProfilerUtils.profilerRectangle.width / NUM_PROFILE_STAFFS);
incYheight = ProfilerUtils.profilerRectangle.height / maxY;
@ -222,7 +227,7 @@ public class ProfilerResource extends
earliestTime = Math.min(earliestTime, validTime);
latestTime = Math.max(latestTime, validTime);
}
long earliestRequestTime = earliestTime - 12 * 3600000;
long earliestRequestTime = earliestTime - NUM_PROFILE_STAFFS * 3600000;
List<DataTime> requestTimes = new ArrayList<DataTime>();
for (DataTime time : resourceData.getAvailableTimes()) {
long validTime = time.getValidTime().getTimeInMillis();
@ -343,7 +348,7 @@ public class ProfilerResource extends
if (x < 0) {
continue;
}
if (x >= 12) {
if (x >= NUM_PROFILE_STAFFS) {
continue;
}
ArrayList<PlotObject> plots = entry.getValue();
@ -463,9 +468,10 @@ public class ProfilerResource extends
}
Calendar c = paintProps.getDataTime().getValidTime();
for (int i = 0; i < 12; i++) {
for (int i = 0; i < NUM_PROFILE_STAFFS; i++) {
String d = String.format("%1$tH:%1$tM", c);
// String d = String.format("%1$tH:%1$tM", c);
String d = String.format("%1$tH", c);
parameters.setText(d, ProfilerUtils.GRAPH_COLOR);
parameters.basics.x = ProfilerUtils.profilerRectangle.x
+ (i * incX) + (incX / 2);

View file

@ -61,7 +61,6 @@ import com.raytheon.rcm.mqsrvr.ReqObj;
import com.raytheon.rcm.rmr.RmrEvent;
import com.raytheon.uf.common.dataplugin.radar.request.RadarServerConnectionRequest;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.preferences.JMSPreferences;
import com.raytheon.uf.viz.core.requests.ThriftClient;
// TODO: use of queueSession outside synchronized(stateLock) could cause
@ -69,6 +68,23 @@ import com.raytheon.uf.viz.core.requests.ThriftClient;
// TODO: conflicts over setting fatalMsg
/**
* Manages client connection to RadarServer
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ------------ --------------------------
* ???? D. Friedman Initial version
* 2012-07-27 DR 14896 D. Friedman Fix even topic name
*
* </pre>
*
* @author dfriedma
* @version 1.0
*/
public class RcmClient implements MessageListener, ExceptionListener {
private String connectionURL;
@ -211,6 +227,11 @@ public class RcmClient implements MessageListener, ExceptionListener {
return;
}
/*
* TODO: ActiveMQ is hard-coded. If switching to Qpid or another
* service, it may be necessary to use JMSPreferences.getPolicyString on
* the topic name below.
*/
ActiveMQConnectionFactory connFac = new ActiveMQConnectionFactory(uri);
// This stuff can block...
try {
@ -238,8 +259,7 @@ public class RcmClient implements MessageListener, ExceptionListener {
topicConn.setExceptionListener(this);
topicSession = topicConn.createTopicSession(false,
Session.AUTO_ACKNOWLEDGE);
topic = topicSession.createTopic(JMSPreferences
.getPolicyString("RadarEvents"));
topic = topicSession.createTopic("RadarEvents");
queueConn.start();
topicConn.start();

View file

@ -231,11 +231,13 @@ public abstract class AbstractCrossSectionResource extends
time = time.clone();
time.setLevelValue((double) i);
times.add(time);
sliceMap.put(time, null);
dataRetrievalJob.times.add(time);
}
}
dataTimes = new ArrayList<DataTime>(times);
Collections.sort(dataTimes);
sliceMap.clear();
dataRetrievalJob.schedule();
}
protected void loadSlice(DataTime time) throws VizException {

View file

@ -138,10 +138,12 @@ public class CrossSectionImageResource extends AbstractCrossSectionResource
super.initInternal(target);
// defaults
ImagingCapability imageCap = getCapability(ImagingCapability.class);
imageCap.setInterpolationState(true);
imageCap.setBrightness(1.0f);
imageCap.setContrast(1.0f);
if (!hasCapability(ImagingCapability.class)) {
ImagingCapability imageCap = getCapability(ImagingCapability.class);
imageCap.setInterpolationState(true);
imageCap.setBrightness(1.0f);
imageCap.setContrast(1.0f);
}
}
private IImage constructImage(float[] floatData, IGraphicsTarget target)

View file

@ -450,6 +450,7 @@ public abstract class AbstractTimeHeightResource extends
secondaryResource.setDescriptor(descriptor);
}
super.setDescriptor(descriptor);
interpolatedData = null;
loadDataJob.schedule();
}

View file

@ -26,6 +26,7 @@ import java.util.Calendar;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.ListIterator;
import java.util.Set;
import java.util.TimeZone;
import java.util.TreeSet;
@ -76,6 +77,7 @@ import com.raytheon.viz.core.graphing.util.GraphPrefsFactory;
import com.raytheon.viz.core.graphing.xy.XYData;
import com.raytheon.viz.core.graphing.xy.XYDataList;
import com.raytheon.viz.core.graphing.xy.XYImageData;
import com.raytheon.viz.core.graphing.xy.XYWindImageData;
import com.raytheon.viz.core.rsc.ICombinedResourceData;
import com.raytheon.viz.core.rsc.ICombinedResourceData.CombineOperation;
import com.raytheon.viz.core.style.graph.GraphPreferences;
@ -157,10 +159,22 @@ public class TimeSeriesResource extends
if (currentUnit.isCompatible(prefs.getDisplayUnits())) {
UnitConverter conv = currentUnit.getConverterTo(prefs
.getDisplayUnits());
for (XYData d : data.getData()) {
double converted = conv.convert(((Number) d.getY())
.doubleValue());
d.setY(converted);
ListIterator<XYData> it = data.getData().listIterator();
while(it.hasNext()) {
XYData d = it.next();
if(d instanceof XYWindImageData){
XYWindImageData wind = (XYWindImageData) d;
double converted = conv.convert(wind.getWindSpd());
it.remove();
if(wind.getImage() != null){
wind.getImage().dispose();
}
it.add(new XYWindImageData(wind.getX(), wind.getY(), converted, wind.getWindDir()));
}else{
double converted = conv.convert(((Number) d.getY())
.doubleValue());
d.setY(converted);
}
}
units = prefs.getDisplayUnitLabel();
} else {
@ -457,13 +471,6 @@ public class TimeSeriesResource extends
String lat = nf.format(Math.abs(y));
String stnID = "";
String source = resourceData.getSource();
String unit = "";
if (prefs != null && prefs.getDisplayUnits() != null) {
unit = prefs.getDisplayUnitLabel();
} else {
unit = adapter.getDataUnit().toString();
}
if (resourceData.getMetadataMap().get("location.stationId") != null) {
stnID = resourceData.getMetadataMap().get("location.stationId")
@ -488,7 +495,7 @@ public class TimeSeriesResource extends
sb.append(" ").append(resourceData.getLevelKey());
}
sb.append(String.format(" %s %s %s", adapter.getParameterName(),
"TSer", unit != null && unit.equals("") == false ? "(" + unit
"TSer", units != null && units.equals("") == false ? "(" + units
+ ")" : ""));
if (secondaryResource != null) {

View file

@ -26,6 +26,7 @@ import org.eclipse.core.commands.ExecutionException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.commands.ICommandService;
import com.raytheon.uf.viz.core.IDisplayPane;
import com.raytheon.uf.viz.core.IDisplayPaneContainer;
import com.raytheon.uf.viz.core.globals.VizGlobalsManager;
import com.raytheon.uf.viz.d2d.core.ID2DRenderableDisplay;
@ -75,30 +76,29 @@ public class ScaleHandler extends AbstractHandler {
* @param scale
*/
static void setScale(IDisplayPaneContainer editor, String scale) {
if (editor.getActiveDisplayPane().getRenderableDisplay() instanceof ID2DRenderableDisplay) {
ID2DRenderableDisplay disp = (ID2DRenderableDisplay) editor
.getActiveDisplayPane().getRenderableDisplay();
for (IDisplayPane pane : editor.getDisplayPanes()) {
if (pane.getRenderableDisplay() instanceof ID2DRenderableDisplay) {
ID2DRenderableDisplay disp = (ID2DRenderableDisplay) pane
.getRenderableDisplay();
if (scale.equals(disp.getScale())) {
// don't set the scale if it is the same as the display's
// current scale
return;
}
if (scale.equals(disp.getScale())) {
// don't set the scale if it is the same as the display's
// current
// scale
return;
disp.setScale(scale);
if (pane == editor.getActiveDisplayPane()) {
VizGlobalsManager.getCurrentInstance().updateChanges(
editor.getActiveDisplayPane()
.getRenderableDisplay().getGlobalsMap());
}
}
disp.setScale(scale);
// update the scale button
final ICommandService service = (ICommandService) PlatformUI
.getWorkbench().getService(ICommandService.class);
VizGlobalsManager.getCurrentInstance().updateChanges(
editor.getActiveDisplayPane().getRenderableDisplay()
.getGlobalsMap());
service.refreshElements(
"com.raytheon.uf.viz.xy.height.scalebutton", null);
}
ICommandService service = (ICommandService) PlatformUI.getWorkbench()
.getService(ICommandService.class);
service.refreshElements("com.raytheon.uf.viz.xy.height.scalebutton",
null);
}
}

View file

@ -87,5 +87,12 @@
value="aviation/config"
recursive="true">
</path>
<path
application="AvnFPS"
localizationType="CAVE_STATIC"
name="Avnwatch"
value="aviation/avnwatch"
recursive="true">
</path>
</extension>
</plugin>

View file

@ -55,7 +55,6 @@ import org.eclipse.swt.widgets.MenuItem;
import org.eclipse.swt.widgets.MessageBox;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Spinner;
import com.raytheon.viz.avncommon.AvnMessageMgr.StatusMessageType;
import com.raytheon.viz.avnconfig.HelpUsageDlg;
import com.raytheon.viz.avnconfig.ITafSiteConfig;
@ -80,6 +79,8 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
* 9/12/2008 1444 grichard Accommodate separate message logs.
* 3/31/2011 8774 rferrel killProcess when doing a disposed
* 4/14/2011 8861 rferrel Use SaveImageDlg class
* 23JUL2012 15169 zhao Use Combo for 'Month' and 'Number of Months'
* & disabled site controls while drawing
*
* </pre>
*
@ -101,14 +102,14 @@ public class WindRosePlotDlg extends CaveSWTDialog {
private List siteList;
/**
* Month spinner.
* Month
*/
private Spinner monthSpnr;
private Combo monthCbo;
/**
* Number of months.
*/
private Spinner numMonthsSpnr;
private Combo numMonthsCbo;
/**
* Hours spinner.
@ -427,20 +428,19 @@ public class WindRosePlotDlg extends CaveSWTDialog {
Label monthLbl = new Label(monthHourComp, SWT.NONE);
monthLbl.setText("Month:");
gd = new GridData(40, SWT.DEFAULT);
monthSpnr = new Spinner(monthHourComp, SWT.BORDER);
monthSpnr.setDigits(0);
monthSpnr.setIncrement(1);
monthSpnr.setPageIncrement(3);
monthSpnr.setMinimum(1);
monthSpnr.setMaximum(12);
monthSpnr.setSelection(cal.get(Calendar.MONTH) + 1);
monthSpnr.setLayoutData(gd);
monthSpnr.addSelectionListener(new SelectionAdapter() {
gd = new GridData(66, SWT.DEFAULT);
monthCbo = new Combo(monthHourComp, SWT.DROP_DOWN | SWT.READ_ONLY);
monthCbo.setLayoutData(gd);
for ( int i = 1; i <= 12; i++ ) {
monthCbo.add(""+i, i-1);
}
monthCbo.select(cal.get(Calendar.MONTH));
monthCbo.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
//System.out.println(" *************** monthsCbo.getText() = " + monthCbo.getText() );
if (autoRedrawChk.getSelection()) {
redrawWindRose();
redrawWindRose();
}
}
});
@ -448,20 +448,19 @@ public class WindRosePlotDlg extends CaveSWTDialog {
Label numMonthLbl = new Label(monthHourComp, SWT.NONE);
numMonthLbl.setText("Num Months:");
gd = new GridData(40, SWT.DEFAULT);
numMonthsSpnr = new Spinner(monthHourComp, SWT.BORDER);
numMonthsSpnr.setDigits(0);
numMonthsSpnr.setIncrement(1);
numMonthsSpnr.setPageIncrement(3);
numMonthsSpnr.setMinimum(1);
numMonthsSpnr.setMaximum(12);
numMonthsSpnr.setSelection(1);
numMonthsSpnr.setLayoutData(gd);
numMonthsSpnr.addSelectionListener(new SelectionAdapter() {
gd = new GridData(66, SWT.DEFAULT);
numMonthsCbo = new Combo(monthHourComp, SWT.DROP_DOWN | SWT.READ_ONLY);
numMonthsCbo.setLayoutData(gd);
for ( int i = 1; i <= 12; i++ ) {
numMonthsCbo.add(""+i, i-1);
}
numMonthsCbo.select(0);
numMonthsCbo.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
//System.out.println(" *************** numMonthsCbo.getText() = " + numMonthsCbo.getText() );
if (autoRedrawChk.getSelection()) {
redrawWindRose();
redrawWindRose();
}
}
});
@ -586,8 +585,10 @@ public class WindRosePlotDlg extends CaveSWTDialog {
generateWindRoseHeader();
windRoseCanvasComp.updateAndRedraw(windRoseConfigData.cloneData(),
windRoseHeader, monthSpnr.getText(),
numMonthsSpnr.getText(), hourSpnr.getText(),
windRoseHeader,
monthCbo.getText(),
numMonthsCbo.getText(),
hourSpnr.getText(),
numHoursSpnr.getText(), flightCatCbo.getSelectionIndex(),
siteList.getItem(siteList.getSelectionIndex()), this);
}
@ -599,11 +600,21 @@ public class WindRosePlotDlg extends CaveSWTDialog {
if (state == true) {
++busyCount;
shell.setCursor(waitCursor);
monthCbo.setEnabled(false);
numMonthsCbo.setEnabled(false);
hourSpnr.setEnabled(false);
numHoursSpnr.setEnabled(false);
flightCatCbo.setEnabled(false);
drawBtn.setEnabled(false);
} else {
--busyCount;
if (busyCount == 0) {
shell.setCursor(defaultCursor);
monthCbo.setEnabled(true);
numMonthsCbo.setEnabled(true);
hourSpnr.setEnabled(true);
numHoursSpnr.setEnabled(true);
flightCatCbo.setEnabled(true);
drawBtn.setEnabled(true);
}
}
@ -634,23 +645,21 @@ public class WindRosePlotDlg extends CaveSWTDialog {
header.append(siteList.getItem(siteList.getSelectionIndex()));
header.append(" ");
header.append(MONTHS[monthSpnr.getSelection() - 1]);
header.append(MONTHS[monthCbo.getSelectionIndex()]);
if (numMonthsSpnr.getSelection() == 1) {
if ( numMonthsCbo.getSelectionIndex() == 0 ) {
header.append(" ");
} else {
header.append("-");
int endMonth = 0;
if (((numMonthsSpnr.getSelection() - 1) + monthSpnr.getSelection()) > 12) {
endMonth = (numMonthsSpnr.getSelection() - 1)
+ monthSpnr.getSelection() - 12;
header.append(MONTHS[endMonth - 1]);
if ( ( numMonthsCbo.getSelectionIndex() + monthCbo.getSelectionIndex() ) > 11 ) {
endMonth = numMonthsCbo.getSelectionIndex() + monthCbo.getSelectionIndex() - 12;
header.append(MONTHS[endMonth]);
} else {
endMonth = (numMonthsSpnr.getSelection() - 1)
+ monthSpnr.getSelection();
header.append(MONTHS[endMonth - 1]);
endMonth = numMonthsCbo.getSelectionIndex() + monthCbo.getSelectionIndex();
header.append(MONTHS[endMonth]);
}
header.append(" ");
}

View file

@ -212,6 +212,9 @@ import com.raytheon.viz.texteditor.msgs.IAviationObserver;
* 06/27/2011 9940 rferrel sendTafToEditor now loads just the latest TAF.
* 08/12/2011 10612 rferrel saveFile will now always push file back to the server.
* 11/29/2011 11612 rferrel Added getViewerTabList.
* 20JUL2012 14570 gzhang/zhao Highlight correct time groups in TAF Viewer
* 08AGU2012 15613 zhao Modified highlightTAF()
*
* </pre>
*
* @author lvenable
@ -3643,7 +3646,7 @@ public class TafViewerEditorDlg extends Dialog implements ITafSettable,
sb.append(TafUtil.safeFormatTaf(t, showHeaders));
sb.append("\n");
}
}
}//System.out.println("TEMPO "+sb.toString().indexOf("TEMPO")+"/"+sb.toString().indexOf("\n",72));
tafViewerStTxt.setText(sb.toString());
hightlightTAF();
@ -3672,50 +3675,101 @@ public class TafViewerEditorDlg extends Dialog implements ITafSettable,
}
ResourceConfigMgr configMgr = ResourceConfigMgr.getInstance();
String taf = tafViewerStTxt.getText();
String taf = tafViewerStTxt.getText();
int offset = taf.indexOf("TAF");
if ( showHeadersChk.getSelection() ) {
offset = taf.indexOf("TAF", offset + 3);
}
try {
int end = taf.indexOf("TAF", offset + 3);
if (end > 0) {
taf = taf.substring(offset, end);
} else {
taf = taf.substring(offset);
}
}
} catch (IndexOutOfBoundsException ex) {
// Assume no TAF in the viewer
return;
}
Map<String,String> alertTimeMap=TafMonitorDlg.getCurrentAlertTimeMap(stationName);// DR 14570
// 20120712 for TEMPO
String TEMPO_TXT = "TEMPO";
if(taf.contains(TEMPO_TXT)){
Map<String,String[]> tempoMap = TafMonitorDlg.getCurrentTempoMap(stationName);//20120711
if(tempoMap != null){
int tempoStart = taf.indexOf(TEMPO_TXT);
int tempoEnd = taf.indexOf(TafUtil.LINE_BREAK, tempoStart);//end of the TEMPO line
StringBuilder str = new StringBuilder(" ");
for (String alertKey : tempoMap.keySet()) {
//System.out.println("2___alertKey: "+ alertKey);
for (String value : tempoMap.get(alertKey)) {
//System.out.println("3___value: "+ value);
str.setLength(1);
str.append(value);
int len = str.length();
str.append(" ");
int startIndex = taf.indexOf(str.toString(),tempoStart);// for tempo only
if (startIndex < 0) {
str.setLength(len);
str.append("\n");
startIndex = taf.indexOf(str.toString());
}
if (startIndex >= 0 /*within tempo line*/&& startIndex<tempoEnd) {
StyleRange sr = new StyleRange(offset + startIndex + 1,
len - 1, null, configMgr.getViwerAlertColor());
tafViewerStTxt.setStyleRange(sr);
}
}
}
}
}// END 20120712 for TEMPO
StringBuilder str = new StringBuilder(" ");
for (String alertKey : alertMap.keySet()) {
for (String value : alertMap.get(alertKey)) {
str.setLength(1);
str.append(value);
int len = str.length();
str.append(" ");
int startIndex = taf.indexOf(str.toString());
for (String value : alertMap.get(alertKey)) {
str.setLength(1);
str.append(value);
int len = str.length();
str.append(" ");
String time = alertTimeMap.get(alertKey);// DR 14570
int idx=taf.indexOf(time);// DR 14570
int startIndex = taf.indexOf(str.toString(),idx);// DR 14570: highlight after the correct time group
int endIndex = taf.indexOf(TafUtil.LINE_BREAK, idx);// DR 14570: a line ends with a line_break
if (startIndex < 0) {
str.setLength(len);
str.append("\n");
startIndex = taf.indexOf(str.toString());
if (startIndex < 0) {
str.setLength(len);
str.append("=");
startIndex = taf.indexOf(str.toString());
}
}
if (startIndex < 0) {
str.setLength(len);
str.append("\n");
startIndex = taf.indexOf(str.toString());
}
if (startIndex >= 0 /*within the same line*/&& startIndex < endIndex) {
StyleRange sr = new StyleRange(offset + startIndex + 1,
len - 1, null, configMgr.getViwerAlertColor());
if (startIndex >= 0) {
StyleRange sr = new StyleRange(offset + startIndex + 1,
len - 1, null, configMgr.getViwerAlertColor());
tafViewerStTxt.setStyleRange(sr);
} else {
// Should not get here. The first TAF in the viewer and the
// values in the alertMap should both be from the latest
// TAF. This indicates a program bug.
System.out.println("highlightTAF unable to find: \""
+ str.toString() + "\" in the first TAF");
}
tafViewerStTxt.setStyleRange(sr);
} else {
// Should not get here. The first TAF in the viewer and the
// values in the alertMap should both be from the latest
// TAF. This indicates a program bug.
System.out.println("highlightTAF unable to find: \""
+ str.toString() + "\" in the first TAF");
}
}
}
}
}
@ -3938,11 +3992,11 @@ public class TafViewerEditorDlg extends Dialog implements ITafSettable,
// Only load the latest TAF, and assume it is the first one in
// the Viewer.
sb.append(TafUtil.safeFormatTaf(tafsInViewer[0], false));
String bbb = "";
String originalBbb = "";
String[] header = tafsInViewer[0].getWmoHeader().split(" ");
if (header.length > 3) {
bbb = header[3];
originalBbb = header[3];
}
ITafSiteConfig config = TafSiteConfigFactory.getInstance();
@ -3952,6 +4006,7 @@ public class TafViewerEditorDlg extends Dialog implements ITafSettable,
String stationId = siteData.wmo.split(" ")[1];
String issueTime = header[2];
String bbb = "";
if (type == null) {
// Do nothing
} else if (type == TafSettings.OPEN_AMD) {

View file

@ -63,6 +63,7 @@ import com.raytheon.viz.aviation.resource.ResourceConfigMgr.ResourceTag;
* and set default value for check hours.
* 04/28/2011 8065 rferrel Add flag to indicate display is current
* and implement data caching
* 31JUL2012 14570 zhao Highlight Metar alert for case of 'cat'
*
* </pre>
*
@ -126,6 +127,8 @@ public class MetarViewer extends ViewerTab implements
*/
private static final HashMap<String, String[]> alertMap = new HashMap<String, String[]>();
static {
//alertMap.put("cat", new String[] { "<vsby>", "</vsby>", "<sky>", "</sky>" }); // 14570
alertMap.put("tempo", new String[] { "<vsby>", "</vsby>", "<wind>", "</wind>", "<wx>", "</wx>", "<sky>", "</sky>" }); // 14570
alertMap.put("vsby", new String[] { "<vsby>", "</vsby>" });
alertMap.put("wind", new String[] { "<wind>", "</wind>" });
alertMap.put("wx", new String[] { "<wx>", "</wx>" });
@ -408,7 +411,12 @@ public class MetarViewer extends ViewerTab implements
if (alertMap != null && alertMap.size() > 0) {
for (String key : alertMap.keySet()) {
colorViewerAlert(key, configMgr);
if ( key.equals("cat") ) { // "cat" involves "visibility" and "sky condition"
colorViewerAlert("vsby", configMgr);
colorViewerAlert("sky", configMgr);
} else {
colorViewerAlert(key, configMgr);
}
}
}
}

View file

@ -62,7 +62,8 @@ import com.raytheon.viz.aviation.xml.MonitorCfg;
* Nov 4, 2010 6866 rferrel Impact statements no longer malformed.
* May 13, 2011 8611 rferrel Added type to help determine blink state.
* Apr 30, 2012 14717 zhao Indicators turn gray when Metar is outdated
*
* 20JUL2012 14570 gzhang/zhao Modified for highlighting correct time groups in TAF Viewer
* 11AUG2012 14570 zhao Added 'cat' to alert_key_map
* </pre>
*
* @author lvenable
@ -125,6 +126,8 @@ public class SiteMonitor implements IRequestCompleteListener<Map<?, ?>> {
*/
private static final Map<String, String[]> ALERT_KEY_MAP = new HashMap<String, String[]>();
{
ALERT_KEY_MAP.put("cat", new String[] { "vsby", "sky" }); // 14570
//ALERT_KEY_MAP.put("tempo", new String[] { "wind", "vsby", "pcp", "obv", "vcnty", "sky" } ); // 14570
ALERT_KEY_MAP.put("vsby", new String[] { "vsby" });
ALERT_KEY_MAP.put("wind", new String[] { "wind" });
ALERT_KEY_MAP.put("wx", new String[] { "pcp", "obv", "vcnty" });
@ -139,12 +142,13 @@ public class SiteMonitor implements IRequestCompleteListener<Map<?, ?>> {
* @param stationName
*/
public SiteMonitor(Composite parent, TafSiteComp parentSiteComp,
MonitorCfg config, Map<String, String[]> alertMap) {
MonitorCfg config, Map<String, String[]> alertMap, Map<String,String> alertTimeMap/* DR 14570 */,Map<String,String[]> tempoMap) {
this.parent = parent;
this.parentSiteComp = parentSiteComp;
this.cfg = config;
this.alertMap = alertMap;
this.tempoMap = tempoMap;//20120711
this.alertTimeMap = alertTimeMap;// DR 14570
monitorItems = StringUtil.split(cfg.getMonitorItems(), ",");
initMonitorLabels(cfg.getMonitorLabels());
@ -446,7 +450,9 @@ public class SiteMonitor implements IRequestCompleteListener<Map<?, ?>> {
if (severity > maxSeverity) {
maxSeverity = severity;
}
// if ( severity >= 2 ) {
// System.out.println("0***key/severity: "+key.toString()+" / "+severity);
// }
String msg = (String) valueMap.get("msg");
/**
@ -526,17 +532,64 @@ public class SiteMonitor implements IRequestCompleteListener<Map<?, ?>> {
ArrayList<Map<?, ?>> group = (ArrayList<Map<?, ?>>) dcd
.get("group");
Map<?, ?> oncl = group.get(0);
Map<?, ?> obs = (Map<?, ?>) oncl.get("prev");
Map<?, ?> obs = (Map<?, ?>) oncl.get("prev");
ArrayList<String> alertValues = new ArrayList<String>();
Map<?,?> tempo=null;//20120711
ArrayList<String> tempoAlertValues = new ArrayList<String>();//20120711
// DR 14570: based on A1 Python code in TafViewer.highlight()
long tsys= SimulatedTime.getSystemTime().getTime().getTime();
long tfrom= ((Float)((Map<?,?>)((Map<?,?>)oncl.get("prev")).get("time")).get("from")).longValue()*1000;
long time = tsys>tfrom ? tsys : tfrom;
long tto = 0;
for (String tafKey : tafKeys) {
Map<?, ?> alert = (Map<?, ?>) obs.get(tafKey);
if (alert != null) {
String value = (String) alert.get("str");
alertValues.add(value);
}
for(Map<?,?> map : group){
//for( Object o : map.keySet())System.out.println("^^^^^^^^^^^^ map keys: "+(String)o);
tto = ((Float)((Map<?,?>)((Map<?,?>)map.get("prev")).get("time")).get("to")).longValue()*1000;
//System.out.println("---1---time/tto: "+new java.util.Date(time)+" / "+new java.util.Date(tto)+" key: "+key.toString());
if(time < tto){
//20120711: see A1 TafViewer.py's highlight(), should be outside the if(severity >= 2) block?
//System.out.println("1+++map.keySet().contains(oncl): "+new Boolean(map.keySet().contains("oncl")));
String[] keyArray = map.keySet().toArray(new String[]{});//for TEMPO highlight
for(String s : keyArray){
if(s.equals("ocnl")){
long oFrom=((Float)((Map<?,?>)((Map<?,?>)map.get("ocnl")).get("time")).get("from")).longValue()*1000;
long oTo=((Float)((Map<?,?>)((Map<?,?>)map.get("ocnl")).get("time")).get("to")).longValue()*1000;
//System.out.println("2+++oFrom**time**oTo: "+oFrom+"**"+time+"**"+oTo);
if(oFrom<=time && time<oTo)
tempo=(Map<?, ?>) map.get("ocnl");
}
}
obs = (Map<?, ?>) map.get("prev"); //System.out.println("______2___time/tto: "+new java.util.Date(time)+" / "+new java.util.Date(tto)+" key: "+key.toString());
break;
}
}
Map<?, ?> obsTimeMap = (Map<?, ?>) obs.get("time");//for getting correct line using time
for (String tafKey : tafKeys) {
// DR 14570 20120711
Map<?,?> tempoAlert = (tempo==null) ? null:(Map<?,?>)tempo.get(tafKey);
//System.out.println("tempo==null***tempoAlert != null: "+new Boolean(tempo==null)+"***"+new Boolean(tempoAlert != null));
if(tempoAlert != null){
tempoAlertValues.add((String)tempoAlert.get("str"));
//System.out.println("(String)tempoAlert.get(str): "+(String)tempoAlert.get("str"));
}// END 20120711
Map<?, ?> alert = (Map<?, ?>) obs.get(tafKey);
if (alert != null) {
String value = (String) alert.get("str");
alertValues.add(value);
}
} //System.out.println("________3___obsTimeMap: "+(String)obsTimeMap.get("str"));
tempoMap.put((String)key, tempoAlertValues.toArray(new String[tempoAlertValues.size()]));//20120711
if(alertTimeMap!=null) alertTimeMap.put((String)key, (String)obsTimeMap.get("str"));// DR 14570
String[] s = new String[alertValues.size()];
alertMap.put((String) key, alertValues.toArray(s));
}
@ -643,4 +696,13 @@ public class SiteMonitor implements IRequestCompleteListener<Map<?, ?>> {
public Color getGraySeverityColor() {
return getSeverityColors()[GRAY_COLOR_SEVERITY];
}
//----------------------DR 14570:
private Map<String, String> alertTimeMap;// = new HashMap<String, String>();
public Map<String, String[]> tempoMap;// = new HashMap<String, String[]>();
public void setAlertTimeMap(Map<String, String> map){
alertTimeMap = map;
}
}

View file

@ -90,6 +90,7 @@ import com.raytheon.viz.avnconfig.IStatusSettable;
* 05/13/2011 8611 rferrel Added type to Site Monitor requests and update
* Viewer when a METAR changes alert status.
* 04/26/2012 14717 zhao Indicator labels turn gray when Metar is outdated
* 20JUL2012 14570 gzhang/zhao Add data structure for highlighting correct time groups in TAF viewer
*
* </pre>
*
@ -383,14 +384,15 @@ public class TafSiteComp {
monitorArray = new ArrayList<SiteMonitor>();
alertMap = new HashMap<String, String[]>();
ArrayList<MonitorCfg> monitorCfgs = tafMonCfg.getMonitorCfgs();
alertTimeMap = new HashMap<String,String>();/* DR 14570 */
tempoMap = new HashMap<String,String[]>();//20120711
for (MonitorCfg monCfg : monitorCfgs) {
SiteMonitor monitor = null;
if ("MetarMonitor".equals(monCfg.getClassName())) {
monitor = new SiteMonitor(parent, this, monCfg, alertMap);
metarMontiorIndex = monitorArray.size();
monitor = new SiteMonitor(parent, this, monCfg, alertMap, /* DR 14570 */alertTimeMap,tempoMap);
metarMontiorIndex = monitorArray.size();
} else {
monitor = new SiteMonitor(parent, this, monCfg, null);
monitor = new SiteMonitor(parent, this, monCfg, null, /* DR 14570 */null,null);
}
monitorArray.add(monitor);
}
@ -652,7 +654,7 @@ public class TafSiteComp {
long currentTime = SimulatedTime.getSystemTime().getTime()
.getTime();
if ( currentTime > ( metarTime + METAR_TIMEOUT_4HR10MIN ) ) {
if ( currentTime > ( metarTime + METAR_TIMEOUT_4HR10MIN ) ) {
mtrTimeLbl.setText("None");
mtrTimeLbl.setBackground(getBackgroundColor());
if ( persistMonitorProcessedFirst ) {
@ -815,7 +817,7 @@ public class TafSiteComp {
public void setPersistMonitorProcessedFirst(boolean b) {
persistMonitorProcessedFirst = b;
}
public void setLatestMtrTime(long latestMtrTime) {
this.latestMtrTime = latestMtrTime;
}
@ -823,4 +825,10 @@ public class TafSiteComp {
public long getLatestMtrTime() {
return latestMtrTime;
}
//------------------------------- DR 14570:
private Map<String, String[]> tempoMap = null;//20120711
private Map<String, String> alertTimeMap = null;
public Map<String,String> getAlertTimeMap(){ return alertTimeMap;}
public Map<String,String[]> getTempoMap(){return tempoMap;}//20120711
}

View file

@ -49,6 +49,7 @@ import com.raytheon.uf.viz.core.exception.VizException;
* Jul 6, 2010 5792 rferrel getLatestTafs now returns tafs
* sorted by issue date newest at
* the start of the array.
* 08AUG2012 15613 zhao Modified safeFormatTaf()
*
* </pre>
*
@ -161,12 +162,13 @@ public class TafUtil {
*/
public static String safeFormatTaf(TafRecord t, boolean includeHeader) {
StringBuilder sb = new StringBuilder();
if (includeHeader) {
sb.append(t.getWmoHeader());
sb.append(LINE_BREAK);
}
if (t != null) {
String[] text = t.getTafText().split("[\r\n]");
if (includeHeader) {
sb.append(t.getWmoHeader());
sb.append(LINE_BREAK);
sb.append("TAF").append(t.getStationId().substring(1,4)).append(LINE_BREAK);
}
String firstLine = text[0];
if (firstLine.startsWith("TAF AMD")
|| firstLine.startsWith("TAF COR")) {
@ -191,6 +193,7 @@ public class TafUtil {
sb.append(LINE_BREAK);
}
}
sb.append(LINE_BREAK);
}
return sb.toString();
}

View file

@ -68,6 +68,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
* 28 FEB 2008 938 lvenable Initial creation.
* 4/15/2009 1982 grichard Provide feedback when saving a working TAF.
* 12/08/2011 11745 rferrel Updated header time to transmission time.
* 08AUG2012 15613 zhao Determine proper BBB for transmission
*
* </pre>
*
@ -364,7 +365,7 @@ public class SendDialog extends CaveSWTDialog {
String siteWmoId = tabComp.getWmoId();
// WMO Site
String siteNode = null;
java.util.List<String> stationIds = new ArrayList<String>();
//java.util.List<String> stationIds = new ArrayList<String>();
ArrayList<String> tafs = new ArrayList<String>();
ArrayList<String> updatedTafs = new ArrayList<String>();
@ -402,6 +403,16 @@ public class SendDialog extends CaveSWTDialog {
// Site ID
String siteId = fourLetterId.substring(1);
/*
* If "AAX" or "CCX" or "RRX", determine BBB for transmission
*/
String xmitBbb = bbb;
if ( bbb.equals("AAX") || bbb.equals("CCX") || bbb.equals("RRX") ) {
String type = bbb.substring(0, 2);
xmitBbb = getXmitBbb( type, siteId);
}
// Update Header Time to transmission time.
tafText = TIMESTAMP_PATTERN.matcher(tafText).replaceFirst(
xmitTimestamp);
@ -418,7 +429,7 @@ public class SendDialog extends CaveSWTDialog {
}
TafQueueRecord record = new TafQueueRecord(forecasterId,
xmitTime.getTime(), tafText, bbb, siteId, siteWmoId,
xmitTime.getTime(), tafText, xmitBbb, siteId, siteWmoId,
siteNode, xmitTime.getTime());
records.add(record);
}
@ -455,4 +466,41 @@ public class SendDialog extends CaveSWTDialog {
tabComp.setTafSent(tafsQeueued);
shell.dispose();
}
@SuppressWarnings("unchecked")
private String getXmitBbb(String type, String siteId) {
try {
TafQueueRequest request = new TafQueueRequest();
request.setType(Type.GET_LIST);
request.setState(TafQueueRecord.TafQueueState.SENT);
ServerResponse<java.util.List<String>> response = (ServerResponse<java.util.List<String>>) ThriftClient.sendRequest(request);
java.util.List<String> payload = response.getPayload();
String [] records = (String []) payload.toArray(new String[0]);
int numRecords = records.length;
for ( int i = numRecords-1; i >=0; i-- ) {
if ( records[i].contains(siteId) ) {
String [] texts = records[i].split("-");
String bbb = texts[texts.length-2];
if ( bbb.equals(" ") ) {
return type+"A";
}
if ( bbb.subSequence(0, 2).equals(type) ) {
char[] newX = new char[] { bbb.charAt(2) };
if ( newX[0] == 'X' ) {
newX[0] = 'A';
} else {
newX[0]++;
}
return type + new String( newX );
}
}
}
} catch (VizException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return type + "A";
}
}

View file

@ -128,6 +128,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
* 10/27/2010 7383 rferrel Save changed blink state in configMgr.
* 3/14/2011 8588 rferrel Allow monitoring multiple products.
* 11/29/2011 11612 rferrel Added observers to update viewer tabs.
* 20JUL2012 14570 gzhang/zhao Added methods for highlighting in TAF viewer
*
* </pre>
*
@ -917,4 +918,38 @@ public class TafMonitorDlg extends CaveSWTDialog {
public final List<ViewerTab> getViewerTabList() {
return tveDlg.getViewerTabList();
}
//------------------------- DR 14570:
public static Map<String,String> getCurrentAlertTimeMap(String siteID){
Map<String, String> alertTimeMap = null;
if (currentDlg != null) {
if (currentDlg.getDisplay().isDisposed()) {
currentDlg = null;
} else {
for (TafSiteComp siteRow : currentDlg.getTafSiteComps()) {
if (siteRow.getStationName().equals(siteID)) {
alertTimeMap = siteRow.getAlertTimeMap();
}
}
}
}
return alertTimeMap;
}
//20120711
public static Map<String,String[]> getCurrentTempoMap(String siteID){
Map<String, String[]> tempoMap = null;
if (currentDlg != null) {
if (currentDlg.getDisplay().isDisposed()) {
currentDlg = null;
} else {
for (TafSiteComp siteRow : currentDlg.getTafSiteComps()) {
if (siteRow.getStationName().equals(siteID)) {
tempoMap= siteRow.getTempoMap();
}
}
}
}
return tempoMap;
}
}

View file

@ -26,6 +26,7 @@ import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.channels.FileChannel;
import java.nio.channels.FileChannel.MapMode;
import java.util.ArrayList;
@ -69,6 +70,7 @@ import com.vividsolutions.jts.geom.Coordinate;
* 7/1/06 chammack Initial Creation.
* 1/10/08 562 bphillip Modified to handle .bcx files
* 02/11/09 njensen Refactored to new rsc architecture
* 07/31/12 DR 14935 D. Friedman Handle little-endian files
*
* </pre>
*
@ -190,6 +192,14 @@ public class BCDResource extends
ByteBuffer buffer = fc.map(MapMode.READ_ONLY, 0, file.length());
// Determine byte order of data
if (buffer.remaining() >= 4) {
// Whether BCX or not, first value is an int.
// Note: Different from A1 which tests >31 or >500
if (buffer.getInt(0) > Short.MAX_VALUE)
buffer.order(ByteOrder.LITTLE_ENDIAN);
}
int i = 0;
double minLat = Double.MAX_VALUE;

View file

@ -85,6 +85,7 @@ import com.vividsolutions.jts.geom.Geometry;
* May 26, 2009 #2172 chammack Use zoomLevel to calculate label spacing
* Apr 26, 2010 #4583 rjpeter Replaced fortran fortconbuf with java port.
* Mar 4, 2011 #7747 njensen Cached subgrid envelopes
* Jul 9, 2012 DR 14940 M. Porricelli Adjust arrow size for streamlines
* </pre>
*
* @author chammack
@ -1125,7 +1126,12 @@ public class ContourSupport {
}
double gridPixelSize = offCenter[0] - center[0];
double gridPixelMax = 2000.;
// If gridPixelSize is large, arrows on streamline will be too small, so adjust here
if(gridPixelSize > gridPixelMax) {
gridPixelSize = gridPixelSize/5;
}
float arrowSize = (float) (currentMagnification * 5 / zoom / gridPixelSize);
double spadiv = zoom * density * gridPixelSize / 25;

View file

@ -50,10 +50,6 @@
id="com.raytheon.uf.viz.d2d.core.feature"
version="0.0.0"/>
<includes
id="com.raytheon.uf.viz.alertviz.localization.feature"
version="0.0.0"/>
<includes
id="com.raytheon.viz.radar.feature"
version="0.0.0"/>

View file

@ -126,7 +126,7 @@ fields.</i>
</p>
<hr width="100%">
<h2><a name="Testing"></a>Testing Your Own localWxConfig.py File</h2>
The recommended way to test your localConfigWx.py file is to start EDEX
The recommended way to test your localWxConfig.py file is to start EDEX
while running a tail command on the /awips2/edex/logs/edex-request-<i>date</i>.log.
If no exceptions result from the changes, you should be fine to proceed into GFE for
further testing.

View file

@ -34,6 +34,7 @@ import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.jface.util.SafeRunnable;
import com.raytheon.uf.common.dataplugin.gfe.python.GfePyIncludeUtil;
import com.raytheon.uf.common.localization.IPathManager;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
@ -76,7 +77,6 @@ public class PythonPreferenceStore implements IPreferenceStore,
private String configName;
@SuppressWarnings("unchecked")
public PythonPreferenceStore(String configName) {
this.propertyChangeListeners = new ArrayList<IPropertyChangeListener>();
this.configurationChangeListeners = new ArrayList<IConfigurationChangeListener>();
@ -84,7 +84,8 @@ public class PythonPreferenceStore implements IPreferenceStore,
this.loadConfiguration(configName);
}
public void loadConfiguration(String configName) {
@SuppressWarnings("unchecked")
public void loadConfiguration(String configName) {
IPathManager pathMgr = PathManagerFactory.getPathManager();
String utilityDir = pathMgr.getFile(
pathMgr.getContext(LocalizationType.CAVE_STATIC,
@ -92,23 +93,14 @@ public class PythonPreferenceStore implements IPreferenceStore,
com.raytheon.uf.common.util.FileUtil.join("gfe", "utility"))
.getPath();
String configDir = com.raytheon.uf.common.util.FileUtil.join("gfe",
"userPython", "gfeConfig");
String baseDir = pathMgr.getFile(
pathMgr.getContext(LocalizationType.CAVE_STATIC,
LocalizationLevel.BASE), configDir).getPath();
String siteDir = pathMgr.getFile(
pathMgr.getContext(LocalizationType.CAVE_STATIC,
LocalizationLevel.SITE), configDir).getPath();
String userDir = pathMgr.getFile(
pathMgr.getContext(LocalizationType.CAVE_STATIC,
LocalizationLevel.USER), configDir).getPath();
String configPath = GfePyIncludeUtil.getConfigIncludePath();
String vtecPath = GfePyIncludeUtil.getVtecIncludePath();
PythonScript py = null;
try {
py = new PythonScript(
utilityDir + File.separator + "loadConfig.py",
PyUtil.buildJepIncludePath(userDir, siteDir, baseDir));
PyUtil.buildJepIncludePath(configPath, vtecPath));
} catch (JepException e) {
statusHandler.handle(Priority.CRITICAL,
"Unable to load GFE config", e);

View file

@ -121,10 +121,11 @@ public class ConfigCatalog extends AbstractScriptCatalog {
// Look for HideConfigFile = True in the file
PythonScript pscript = null;
try {
String includePath = PyUtil
.buildJepIncludePath(GfePyIncludeUtil
.getConfigIncludePath());
pscript = new PythonScript(file.getAbsolutePath(), includePath,
String configPath = GfePyIncludeUtil.getConfigIncludePath();
String vtecPath = GfePyIncludeUtil.getVtecIncludePath();
pscript = new PythonScript(file.getAbsolutePath(),
PyUtil.buildJepIncludePath(configPath, vtecPath),
getClass().getClassLoader(), preEvals);
Boolean scriptValue = (Boolean) pscript.execute(
"checkHideConfigFile", null);

View file

@ -19,8 +19,8 @@
**/
package com.raytheon.viz.gfe.core;
import com.raytheon.viz.gfe.core.time.SelectTimeRange;
import com.raytheon.viz.gfe.core.time.SelectTimeRange.Mode;
import com.raytheon.uf.common.dataplugin.gfe.time.SelectTimeRange;
import com.raytheon.uf.common.dataplugin.gfe.time.SelectTimeRange.Mode;
/**
* TODO Add Description
@ -31,6 +31,7 @@ import com.raytheon.viz.gfe.core.time.SelectTimeRange.Mode;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Dec 3, 2009 randerso Initial creation
* Aug 1, 2012 #965 dgilling Change location of SelectTimeRange.
*
* </pre>
*

View file

@ -79,12 +79,12 @@ public abstract class AbstractGridData implements IGridData {
protected boolean iscCapable = true;
protected Date lastAccessTime;
protected long lastAccessTime;
protected Grid2DBit changedPoints;
protected AbstractGridData(Parm aParm, IGridSlice aSlice) {
this.lastAccessTime = SimulatedTime.getSystemTime().getTime();
this.lastAccessTime = System.currentTimeMillis();
this.parm = aParm;
this.gridSlice = aSlice;
// this.gridSlice.setUseCache(true);
@ -135,7 +135,7 @@ public abstract class AbstractGridData implements IGridData {
}
@Override
public Date getLastAccessTime() {
public long getLastAccessTime() {
return this.lastAccessTime;
}
@ -184,7 +184,7 @@ public abstract class AbstractGridData implements IGridData {
}
}
this.lastAccessTime = SimulatedTime.getSystemTime().getTime();
this.lastAccessTime = System.currentTimeMillis();
}
@Override
@ -458,7 +458,7 @@ public abstract class AbstractGridData implements IGridData {
public boolean applyDelta(Date time, float delta, boolean taper,
Grid2DBit pointsToChange) {
if (delta == 0.0) {
return false; // nothing to change
return true; // nothing to change
}
populate();
checkOkayForEdit();
@ -863,12 +863,12 @@ public abstract class AbstractGridData implements IGridData {
if (!this.isPopulated()) {
return;
}
String msg = "Depopulating " + getParm().getParmID() + " tr="
+ getGridTime();
statusHandler.handle(Priority.DEBUG, msg, new Exception("Debug: "
+ msg));
// String msg = "Depopulating " + getParm().getParmID() + " tr="
// + getGridTime();
// statusHandler.handle(Priority.DEBUG, msg, new Exception("Debug: "
// + msg));
this.lastAccessTime = SimulatedTime.getSystemTime().getTime();
this.lastAccessTime = 0;
setGridSliceDataToNull();
}
}

View file

@ -158,7 +158,7 @@ public interface IGridData extends Comparable<IGridData> {
*
* @return time the grid was last accessed
*/
public Date getLastAccessTime();
public long getLastAccessTime();
/**
* Returns the time range associated with this grid.

View file

@ -453,12 +453,12 @@ public abstract class AbstractParmManager implements IParmManager {
parms.releaseReadLock();
}
notificationPool.cancel();
vcModulePool.cancel();
for (VCModule module : vcModules) {
module.dispose();
}
notificationPool.cancel();
}
protected DatabaseID decodeDbString(final String string) {

View file

@ -94,6 +94,7 @@ public class GFESpatialDisplayManager extends AbstractSpatialDisplayManager
private static final String GFE_PERSPECTIVE = GFEPerspective.ID_PERSPECTIVE;
private final ISampleSetChangedListener sampleSetListener = new ISampleSetChangedListener() {
@Override
public void sampleSetChanged(ISampleSetManager sampleSetMgr) {
GFESpatialDisplayManager.this.refresh();
}
@ -163,14 +164,40 @@ public class GFESpatialDisplayManager extends AbstractSpatialDisplayManager
GridLocation gloc = parmManager.compositeGridLocation();
GridGeometry2D gridGeometry = MapUtil.getGridGeometry(gloc);
Envelope envelope = gridGeometry.getEnvelope();
double dx = (envelope.getSpan(0) / 8.0);
double dy = (envelope.getSpan(1) / 8.0);
double colorBarHeight = GFEColorbarResource.HEIGHT
* envelope.getSpan(1) / pane.getBounds().height;
PythonPreferenceStore prefs = Activator.getDefault()
.getPreferenceStore();
double expandLeft = 10;
if (prefs.contains("OfficeDomain_expandLeft")) {
expandLeft = prefs.getDouble("OfficeDomain_expandLeft");
}
double expandRight = 0.1;
if (prefs.contains("OfficeDomain_expandRight")) {
expandRight = prefs.getDouble("OfficeDomain_expandRight");
}
double expandTop = 0.1;
if (prefs.contains("OfficeDomain_expandTop")) {
expandTop = prefs.getDouble("OfficeDomain_expandTop");
}
double expandBottom = 0.1;
if (prefs.contains("OfficeDomain_expandBottom")) {
expandBottom = prefs.getDouble("OfficeDomain_expandBottom");
}
double dxLeft = (envelope.getSpan(0) * expandLeft / 100.0);
double dxRight = (envelope.getSpan(0) * expandRight / 100.0);
double dyTop = (envelope.getSpan(1) * expandTop / 100.0);
double dyBottom = (envelope.getSpan(1) * expandBottom / 100.0);
GeneralEnvelope newEnvelope = new GeneralEnvelope(
envelope.getCoordinateReferenceSystem());
newEnvelope.setRange(0, envelope.getMinimum(0) - dx,
envelope.getMaximum(0) + dx);
newEnvelope.setRange(1, envelope.getMinimum(1) - dy,
envelope.getMaximum(1) + dy);
newEnvelope.setRange(0, envelope.getMinimum(0) - dxLeft,
envelope.getMaximum(0) + dxRight);
newEnvelope.setRange(1, envelope.getMinimum(1) - dyBottom,
envelope.getMaximum(1) + colorBarHeight + dyTop);
GridGeometry2D newGridGeometry = new GridGeometry2D(
gridGeometry.getGridRange(), newEnvelope);
descriptor.setGridGeometry(newGridGeometry);
@ -323,6 +350,7 @@ public class GFESpatialDisplayManager extends AbstractSpatialDisplayManager
* com.raytheon.viz.gfe.core.ISpatialDisplayManager#setGlobalTimeRange(com
* .raytheon.edex.plugin.time.TimeRange)
*/
@Override
public void setGlobalTimeRange(TimeRange timeRange) {
this.globalTimeRange = timeRange;
@ -337,6 +365,7 @@ public class GFESpatialDisplayManager extends AbstractSpatialDisplayManager
* @see
* com.raytheon.viz.gfe.core.ISpatialDisplayManager#getGlobalTimeRange()
*/
@Override
public TimeRange getGlobalTimeRange() {
return this.globalTimeRange;
}

View file

@ -32,6 +32,8 @@ import java.util.List;
import java.util.Map;
import java.util.TimeZone;
import com.raytheon.uf.common.dataplugin.gfe.time.SelectTimeRange;
import com.raytheon.uf.common.dataplugin.gfe.time.SelectTimeRange.Mode;
import com.raytheon.uf.common.localization.FileUpdatedMessage;
import com.raytheon.uf.common.localization.ILocalizationFileObserver;
import com.raytheon.uf.common.localization.IPathManager;
@ -47,8 +49,6 @@ import com.raytheon.viz.gfe.GFEServerException;
import com.raytheon.viz.gfe.core.DataManager;
import com.raytheon.viz.gfe.core.ISelectTimeRangeManager;
import com.raytheon.viz.gfe.core.msgs.SelectTimeRangesChangedMsg;
import com.raytheon.viz.gfe.core.time.SelectTimeRange;
import com.raytheon.viz.gfe.core.time.SelectTimeRange.Mode;
/**
* Class which manages the selection time range definitions that are stored on
@ -60,6 +60,7 @@ import com.raytheon.viz.gfe.core.time.SelectTimeRange.Mode;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Dec 3, 2009 #3135 randerso Initial creation
* Aug 1, 2012 #965 dgilling Change location of SelectTimeRange.
*
* </pre>
*

View file

@ -718,10 +718,7 @@ public class DbParm extends Parm {
continue; // grid overlaps spatial editor time -- skip it
}
long lastAccess = 0;
if (grid.getLastAccessTime() != null) {
lastAccess = grid.getLastAccessTime().getTime();
}
long lastAccess = grid.getLastAccessTime();
long delta = now - lastAccess;
if (delta < milliseconds) {
@ -735,9 +732,10 @@ public class DbParm extends Parm {
// only deallocate unlocked grids
if (!locked) {
String msg = "Deallocating " + getParmID() + " tr=" + gTime;
statusHandler.handle(Priority.DEBUG, msg, new Exception(
"Debug: " + msg));
// String msg = "Deallocating " + getParmID() + " tr=" +
// gTime;
// statusHandler.handle(Priority.DEBUG, msg, new Exception(
// "Debug: " + msg));
grid.depopulate();
}

View file

@ -304,10 +304,7 @@ public class VCParm extends VParm implements IParmListChangedListener,
continue;
} // grid overlaps spatial editor time -- skip it
long lastAccess = 0;
if (grid.getLastAccessTime() != null) {
lastAccess = grid.getLastAccessTime().getTime();
}
long lastAccess = grid.getLastAccessTime();
long delta = now - lastAccess;
if (delta < milliseconds) {

View file

@ -63,6 +63,12 @@ public class VCModuleJobPool {
protected List<Job> jobList;
protected boolean cancel = false;
protected Object cancelLock = new Object();
protected Object joinLock = new Object();
public VCModuleJobPool(String name, DataManager dataMgr, int size) {
this(name, dataMgr, size, null, null);
}
@ -88,8 +94,18 @@ public class VCModuleJobPool {
}
}
public synchronized void enqueue(VCModuleRequest request) {
workQueue.offer(request);
public void enqueue(VCModuleRequest request) {
// do not schedule while canceling(cancel should be fast.
synchronized (cancelLock) {
if (cancel) {
return;
}
// do not schedule while joining, join might be slow but the
// javaDoc warns others.
synchronized (joinLock) {
workQueue.offer(request);
}
}
}
/**
@ -97,12 +113,14 @@ public class VCModuleJobPool {
* <code>Job</code>s will block until join as returned so be careful when
* calling
*/
public synchronized void join() {
for (Job j : jobList) {
try {
j.join();
} catch (InterruptedException e) {
// Ignore interrupt
public void join() {
synchronized (joinLock) {
for (Job j : jobList) {
try {
j.join();
} catch (InterruptedException e) {
// Ignore interrupt
}
}
}
}
@ -111,8 +129,11 @@ public class VCModuleJobPool {
* Cancel the job pool, will clear out the workQueue then join on all jobs
* running
*/
public synchronized void cancel() {
workQueue.clear();
public void cancel() {
synchronized (cancelLock) {
cancel = true;
workQueue.clear();
}
for (Job job : jobList) {
job.cancel();
}
@ -127,7 +148,7 @@ public class VCModuleJobPool {
* @param request
* @return
*/
public synchronized boolean cancel(VCModuleRequest request) {
public boolean cancel(VCModuleRequest request) {
return workQueue.remove(request);
}

View file

@ -158,77 +158,84 @@ public abstract class AbstractSaveParameterDialog extends CaveJFACEDialog
@Override
protected IStatus run(IProgressMonitor monitor) {
long t0 = System.currentTimeMillis();
final CountDownLatch latch = new CountDownLatch(
MAX_CONCURRENT_SAVES);
final AtomicBoolean allSuccessful = new AtomicBoolean(true);
// spawn separate jobs top save parms
for (int i = 0; i < MAX_CONCURRENT_SAVES; i++) {
new Job("Saving Parms") {
@Override
protected IStatus run(IProgressMonitor monitor) {
try {
Parm parm = null;
while ((parm = parms.poll()) != null) {
String parmString = parm.getParmID()
.toString();
try {
// save data
if (statusHandler
.isPriorityEnabled(Priority.DEBUG)) {
statusHandler.handle(
Priority.DEBUG, "Save: "
+ parmString);
}
if (!parm.saveParameter(true)) {
allSuccessful.set(false);
}
} catch (Exception e) {
allSuccessful.set(false);
statusHandler.handle(Priority.ERROR,
"Error occurred saving parm "
+ parmString, e);
}
}
} finally {
latch.countDown();
}
return Status.OK_STATUS;
}
}.schedule();
}
try {
latch.await();
} catch (InterruptedException e) {
e.printStackTrace();
}
final CountDownLatch latch = new CountDownLatch(
MAX_CONCURRENT_SAVES);
if (!allSuccessful.get()) {
statusHandler.handle(Priority.PROBLEM,
"Some grids were not saved. See log for details.");
} else {
statusHandler.handle(Priority.DEBUG, "Save Complete");
}
// spawn separate jobs top save parms
for (int i = 0; i < MAX_CONCURRENT_SAVES; i++) {
new Job("Saving Parms") {
@Override
protected IStatus run(IProgressMonitor monitor) {
try {
Parm parm = null;
while ((parm = parms.poll()) != null) {
String parmString = parm.getParmID()
.toString();
try {
// save data
if (statusHandler
.isPriorityEnabled(Priority.DEBUG)) {
statusHandler.handle(
Priority.DEBUG,
"Save: " + parmString);
}
if (!parm.saveParameter(true)) {
allSuccessful.set(false);
}
} catch (Throwable e) {
allSuccessful.set(false);
statusHandler.handle(
Priority.ERROR,
"Error occurred saving parm "
+ parmString, e);
}
}
} catch (Throwable e) {
allSuccessful.set(false);
statusHandler.handle(Priority.ERROR,
e.getLocalizedMessage(), e);
} finally {
latch.countDown();
}
VizApp.runAsync(new Runnable() {
@Override
public void run() {
AbstractSaveParameterDialog.this.getShell().setCursor(
origCursor);
AbstractSaveParameterDialog.this
.saveFinished(allSuccessful.get());
return Status.OK_STATUS;
}
}.schedule();
}
});
long t1 = System.currentTimeMillis();
System.out.println("GFE Save Forecast took: " + (t1 - t0)
+ " ms");
latch.await();
} catch (Throwable e) {
allSuccessful.set(false);
statusHandler.handle(Priority.PROBLEM,
e.getLocalizedMessage(), e);
} finally {
if (!allSuccessful.get()) {
statusHandler
.handle(Priority.PROBLEM,
"Some grids were not saved. See log for details.");
} else {
statusHandler.handle(Priority.DEBUG, "Save Complete");
}
VizApp.runAsync(new Runnable() {
@Override
public void run() {
AbstractSaveParameterDialog.this.getShell()
.setCursor(origCursor);
AbstractSaveParameterDialog.this
.saveFinished(allSuccessful.get());
}
});
long t1 = System.currentTimeMillis();
System.out.println("GFE Save Forecast took: " + (t1 - t0)
+ " ms");
}
return Status.OK_STATUS;
}
};
saveJob.setSystem(true);

View file

@ -811,7 +811,13 @@ public class DefineRefSetDialog extends CaveJFACEDialog implements
@Override
public void referenceSetChanged(ReferenceData refSet,
ArrayList<Envelope> domains) {
activeChanged();
VizApp.runAsync(new Runnable() {
@Override
public void run() {
activeChanged();
}
});
}
/*
@ -822,7 +828,13 @@ public class DefineRefSetDialog extends CaveJFACEDialog implements
*/
@Override
public void referenceSetIDChanged(ReferenceID refID) {
activeChanged();
VizApp.runAsync(new Runnable() {
@Override
public void run() {
activeChanged();
}
});
}
/*
@ -838,7 +850,13 @@ public class DefineRefSetDialog extends CaveJFACEDialog implements
java.util.List<ReferenceID> deletions,
java.util.List<ReferenceID> changes) {
this.refreshRefsets();
VizApp.runAsync(new Runnable() {
@Override
public void run() {
refreshRefsets();
}
});
}
/*
@ -849,7 +867,13 @@ public class DefineRefSetDialog extends CaveJFACEDialog implements
*/
@Override
public void editAreaGroupInvChanged() {
this.refreshRefsets();
VizApp.runAsync(new Runnable() {
@Override
public void run() {
refreshRefsets();
}
});
}
/*
@ -863,36 +887,35 @@ public class DefineRefSetDialog extends CaveJFACEDialog implements
@Override
public void displayedParmListChanged(Parm[] parms, Parm[] deletions,
Parm[] additions) {
refreshParms();
}
private void activeChanged() {
VizApp.runAsync(new Runnable() {
@Override
public void run() {
// Update display when active refset changes
ReferenceData refData = refSetMgr.getActiveRefSet();
// Fix active refset display
if (!activeDisplay.isDisposed()) {
activeDisplay.setText(getActiveRefDesc(refData));
}
// Enable/Disable Undo button
if (!undoButton.isDisposed()) {
undoButton.setEnabled(!refData.refType().equals(
RefType.NONE));
}
// Enable/Disable Convert to Location button
if (!convertButton.isDisposed()) {
convertButton.setEnabled(refData.isQuery());
}
refreshParms();
}
});
}
private void activeChanged() {
// Update display when active refset changes
ReferenceData refData = refSetMgr.getActiveRefSet();
// Fix active refset display
if (!activeDisplay.isDisposed()) {
activeDisplay.setText(getActiveRefDesc(refData));
}
// Enable/Disable Undo button
if (!undoButton.isDisposed()) {
undoButton.setEnabled(!refData.refType().equals(RefType.NONE));
}
// Enable/Disable Convert to Location button
if (!convertButton.isDisposed()) {
convertButton.setEnabled(refData.isQuery());
}
}
private String getActiveRefDesc(ReferenceData refData) {
String s = "";
@ -947,37 +970,29 @@ public class DefineRefSetDialog extends CaveJFACEDialog implements
}
private void refreshRefsets() {
VizApp.runAsync(new Runnable() {
if (groupList.isDisposed() || editAreasList.isDisposed()) {
return;
}
@Override
public void run() {
if (groupList.isDisposed() || editAreasList.isDisposed()) {
return;
}
String[] groups = groupList.getSelection();
String[] groups = groupList.getSelection();
// Refresh the Group and Areas lists
java.util.List<String> availGroups = refSetMgr.getGroupInventory();
availGroups.add("Misc");
groupList.setItems(availGroups.toArray(new String[availGroups.size()]));
// Refresh the Group and Areas lists
java.util.List<String> availGroups = refSetMgr
.getGroupInventory();
availGroups.add("Misc");
groupList.setItems(availGroups.toArray(new String[availGroups
.size()]));
// update selection
groupList.deselectAll();
for (String group : groups) {
int index = groupList.indexOf(group);
if (index >= 0) {
groupList.select(index);
}
}
groups = groupList.getSelection();
String[] areaNames = getAreaNames(groups);
editAreasList.setItems(areaNames);
// update selection
groupList.deselectAll();
for (String group : groups) {
int index = groupList.indexOf(group);
if (index >= 0) {
groupList.select(index);
}
});
}
groups = groupList.getSelection();
String[] areaNames = getAreaNames(groups);
editAreasList.setItems(areaNames);
}
private void refreshParms() {

View file

@ -88,6 +88,7 @@ import com.raytheon.viz.ui.dialogs.CaveJFACEDialog;
* practice and test modes
* Sep 16, 2010 6831 ryu Show same product for different areas on a sub-menu
* Nov 22, 2011 8781 mli remove Processor menu
* Jul 26, 2012 15165 ryu Set default db source when formatter has no db defined.
*
* </pre>
*
@ -776,6 +777,8 @@ public class FormatterLauncherDialog extends CaveJFACEDialog implements
ProductDefinition prodDef = textProductMgr
.getProductDefinition(productName);
String dataSource = (String) prodDef.get("database");
if (dataSource == null)
dataSource = "Official";
if (dataSource.equals("ISC")) {
selectedDataSource = getIscDataSource();

View file

@ -41,17 +41,15 @@ import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import com.raytheon.uf.common.dataplugin.gfe.time.SelectTimeRange;
import com.raytheon.uf.common.dataplugin.gfe.time.SelectTimeRange.Mode;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.common.time.SimulatedTime;
import com.raytheon.viz.gfe.Activator;
import com.raytheon.viz.gfe.GFEServerException;
import com.raytheon.viz.gfe.constants.StatusConstants;
import com.raytheon.viz.gfe.core.DataManager;
import com.raytheon.viz.gfe.core.time.SelectTimeRange;
import com.raytheon.viz.gfe.core.time.SelectTimeRange.Mode;
import com.raytheon.viz.ui.dialogs.CaveJFACEDialog;
import com.raytheon.viz.ui.widgets.SpinScale;
@ -64,6 +62,7 @@ import com.raytheon.viz.ui.widgets.SpinScale;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Dec 7, 2009 randerso Initial creation
* Aug 1, 2012 #965 dgilling Change location of SelectTimeRange.
*
* </pre>
*
@ -72,7 +71,8 @@ import com.raytheon.viz.ui.widgets.SpinScale;
*/
public class SaveDeleteSelectTRDialog extends CaveJFACEDialog {
private static final transient IUFStatusHandler statusHandler = UFStatus.getHandler(SaveDeleteSelectTRDialog.class);
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(SaveDeleteSelectTRDialog.class);
private DataManager dataManager;

View file

@ -178,6 +178,7 @@ public class SelectPointsTool extends AbstractFreeformTool {
if (parms.length == 0) {
statusHandler.handle(Priority.VERBOSE,
"No displayed parms. Cannot select points.");
return new Coordinate[0];
} else {
parm = parms[0];
}

Some files were not shown because too many files have changed in this diff Show more