Merge 12.9.1-4 into development_on_ss_builds
Former-commit-id: a178af491f4b4cd75ed1517f023354bab0b9c8c8
This commit is contained in:
parent
985167892d
commit
5a453ee984
296 changed files with 12695 additions and 9259 deletions
|
@ -30,6 +30,6 @@
|
||||||
<request> <productCode>34</productCode> <pdw20>16</pdw20> </request>
|
<request> <productCode>34</productCode> <pdw20>16</pdw20> </request>
|
||||||
<request> <productCode>34</productCode> <pdw20>32</pdw20> </request>
|
<request> <productCode>34</productCode> <pdw20>32</pdw20> </request>
|
||||||
</cronOTR>
|
</cronOTR>
|
||||||
<cronOTR cron="0 0 * * * ?" productCode="173" randomWait="600" hoursBack="3" wmo="SDUS8" nnn="DU3"/>
|
<cronOTR cron="0 10 * * * ?" productCode="173" randomWait="300" 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 12 * * ?" productCode="173" randomWait="300" hoursBack="24" wmo="SDUS8" nnn="DU6"/>
|
||||||
</cronOTRConfiguration>
|
</cronOTRConfiguration>
|
|
@ -21,14 +21,18 @@ package com.raytheon.rcm.server;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Scanner;
|
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.RadarEvent;
|
||||||
import com.raytheon.rcm.event.RadarEventAdapter;
|
import com.raytheon.rcm.event.RadarEventAdapter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO Add Description
|
* Send AlertViz notifications
|
||||||
*
|
*
|
||||||
* <pre>
|
* <pre>
|
||||||
*
|
*
|
||||||
|
@ -37,6 +41,7 @@ import com.raytheon.rcm.event.RadarEventAdapter;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Nov 9, 2011 mnash Initial creation
|
* Nov 9, 2011 mnash Initial creation
|
||||||
|
* 2012-07-27 DR 14896 D. Friedman Handle multiple RPGs.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -46,13 +51,15 @@ import com.raytheon.rcm.event.RadarEventAdapter;
|
||||||
|
|
||||||
public class RadarServerAvailable extends 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 ProcessBuilder builder;
|
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 HashSet<String> knownFailures = new HashSet<String>();
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public RadarServerAvailable(RadarServer server) {
|
public RadarServerAvailable(RadarServer server) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,64 +72,73 @@ public class RadarServerAvailable extends RadarEventAdapter {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void handleRadarEvent(RadarEvent event) {
|
public void handleRadarEvent(RadarEvent event) {
|
||||||
Process proc = null;
|
final String radarId = event.getRadarID();
|
||||||
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 (event.getType() == RadarEvent.CONNECTION_ATTEMPT_FAILED) {
|
||||||
if (!attempted) {
|
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));
|
Log.event("Executing " + values.get(0));
|
||||||
values.add(event.getRadarID() + " rpg connection is down.");
|
values.add(radarId + ' ' + message);
|
||||||
values.add("RADAR");
|
values.add("RADAR");
|
||||||
values.add("URGENT");
|
values.add("URGENT");
|
||||||
builder = new ProcessBuilder(values);
|
builder = new ProcessBuilder(values);
|
||||||
builder.redirectErrorStream(true);
|
builder.redirectErrorStream(true);
|
||||||
|
|
||||||
|
try {
|
||||||
proc = builder.start();
|
proc = builder.start();
|
||||||
StringBuilder output = new StringBuilder();
|
|
||||||
Scanner s = new Scanner(proc.getInputStream());
|
Scanner s = new Scanner(proc.getInputStream());
|
||||||
while (s.hasNextLine()) {
|
while (s.hasNextLine())
|
||||||
if (output.length() > 0)
|
s.nextLine();
|
||||||
output.append('\n');
|
|
||||||
output.append(s.nextLine());
|
|
||||||
}
|
|
||||||
proc.waitFor();
|
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
Log.errorf("Error running fxaAnnounce: %s", e);
|
||||||
} finally {
|
} finally {
|
||||||
if (proc != null) {
|
if (proc != null) {
|
||||||
proc.destroy();
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -178,10 +178,6 @@
|
||||||
<param name="feature"
|
<param name="feature"
|
||||||
value="com.raytheon.uf.viz.localization.perspective.feature" />
|
value="com.raytheon.uf.viz.localization.perspective.feature" />
|
||||||
</antcall>
|
</antcall>
|
||||||
<antcall target="p2.build.repo">
|
|
||||||
<param name="feature"
|
|
||||||
value="com.raytheon.uf.viz.alertviz.localization.feature" />
|
|
||||||
</antcall>
|
|
||||||
<antcall target="p2.build.repo">
|
<antcall target="p2.build.repo">
|
||||||
<param name="feature"
|
<param name="feature"
|
||||||
value="com.raytheon.viz.radar.feature" />
|
value="com.raytheon.viz.radar.feature" />
|
||||||
|
|
|
@ -21,10 +21,11 @@
|
||||||
<!--
|
<!--
|
||||||
Date DR# Engineer Description
|
Date DR# Engineer Description
|
||||||
03/26/2012 12864 zhao Changed CigVisTrendTimeout from 300 to 1800
|
03/26/2012 12864 zhao Changed CigVisTrendTimeout from 300 to 1800
|
||||||
|
07/27/2012 15169 zhao Changed WindRoseTimeout from 20 to 120
|
||||||
-->
|
-->
|
||||||
<ClimateTimeouts>
|
<ClimateTimeouts>
|
||||||
<ClimateMetarTimeout>20</ClimateMetarTimeout>
|
<ClimateMetarTimeout>20</ClimateMetarTimeout>
|
||||||
<WindRoseTimeout>20</WindRoseTimeout>
|
<WindRoseTimeout>120</WindRoseTimeout>
|
||||||
<CigVisDistTimeout>90</CigVisDistTimeout>
|
<CigVisDistTimeout>90</CigVisDistTimeout>
|
||||||
<CigVisTrendTimeout>1800</CigVisTrendTimeout>
|
<CigVisTrendTimeout>1800</CigVisTrendTimeout>
|
||||||
</ClimateTimeouts>
|
</ClimateTimeouts>
|
||||||
|
|
|
@ -26,6 +26,10 @@
|
||||||
# DELIVERED
|
# DELIVERED
|
||||||
#
|
#
|
||||||
# History:
|
# History:
|
||||||
|
# Revision 17
|
||||||
|
# Created: 10-AUG-2012 15:00:00 GZHANG
|
||||||
|
# DR 14702: Added fix for PyTables in Gui().trend()
|
||||||
|
#
|
||||||
# Revision 16 (DELIVERED)
|
# Revision 16 (DELIVERED)
|
||||||
# Created: 06-MAR-2008 17:01:20 OBERFIEL
|
# Created: 06-MAR-2008 17:01:20 OBERFIEL
|
||||||
# Added fix for leap-years.
|
# Added fix for leap-years.
|
||||||
|
@ -661,7 +665,7 @@ class Gui():
|
||||||
n1 = max(0, n-2*int((t-t1)//3600.0)-1) # small enough
|
n1 = max(0, n-2*int((t-t1)//3600.0)-1) # small enough
|
||||||
n2 = n1 + 5*self.MaxHours # big enough
|
n2 = n1 + 5*self.MaxHours # big enough
|
||||||
data = [(row['date_time'], row['cig'], row['vis']) for row in \
|
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)
|
process_data(count, data, t1, self.MaxHours, table)
|
||||||
# calculate frequencies
|
# calculate frequencies
|
||||||
args = count.keys()
|
args = count.keys()
|
||||||
|
|
|
@ -94,7 +94,7 @@
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
import logging, re, time
|
import logging, re, time
|
||||||
import Avn, AvnLib, Busy, TafDecoder, AvnParser
|
import Avn, AvnLib, TafDecoder, AvnParser
|
||||||
|
|
||||||
_Logger = logging.getLogger(Avn.CATEGORY)
|
_Logger = logging.getLogger(Avn.CATEGORY)
|
||||||
_AmdPat = re.compile(r'(AFT|TIL)\s+(\d{6})|(\d{4}/\d{4})')
|
_AmdPat = re.compile(r'(AFT|TIL)\s+(\d{6})|(\d{4}/\d{4})')
|
||||||
|
@ -175,8 +175,7 @@ def updateTafs(bbb, fcsts):
|
||||||
badidents.append(ident)
|
badidents.append(ident)
|
||||||
|
|
||||||
if badidents:
|
if badidents:
|
||||||
Busy.showwarning('Could not update times for %s' % ' '.join(badidents),
|
_Logger.warning('Could not update times for %s' % ' '.join(badidents))
|
||||||
master)
|
|
||||||
|
|
||||||
return fcsts
|
return fcsts
|
||||||
|
|
||||||
|
|
|
@ -78,7 +78,7 @@
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
import logging, time
|
import logging, time
|
||||||
import Avn, AvnLib, AvnParser, Busy, Globals, TafDecoder
|
import Avn, AvnLib, AvnParser, TafDecoder
|
||||||
|
|
||||||
import MetarData
|
import MetarData
|
||||||
|
|
||||||
|
@ -120,7 +120,6 @@ def updateTafs(bbb, fcsts):
|
||||||
badidents.append(ident)
|
badidents.append(ident)
|
||||||
|
|
||||||
if badidents:
|
if badidents:
|
||||||
Busy.showwarning('Could not update TAFs for %s' % ' '.join(badidents),
|
_Logger.warning('Could not update TAFs for %s' % ' '.join(badidents))
|
||||||
master)
|
|
||||||
|
|
||||||
return fcsts
|
return fcsts
|
||||||
|
|
|
@ -122,8 +122,6 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis):
|
||||||
if type(key) is types.TupleType:
|
if type(key) is types.TupleType:
|
||||||
label, variable = key
|
label, variable = key
|
||||||
exec "self._" + variable + "= varDict[key]"
|
exec "self._" + variable + "= varDict[key]"
|
||||||
else:
|
|
||||||
exec "self._" + key + "= varDict[key]"
|
|
||||||
|
|
||||||
# Make argDict accessible
|
# Make argDict accessible
|
||||||
self.__argDict = argDict
|
self.__argDict = argDict
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
# further licensing information.
|
# further licensing information.
|
||||||
##
|
##
|
||||||
|
|
||||||
|
import TimeRange, AbsTime
|
||||||
import logging
|
import logging
|
||||||
import TextFormatter
|
import TextFormatter
|
||||||
import time, os, string, inspect, sys
|
import time, os, string, inspect, sys
|
||||||
|
@ -288,6 +289,17 @@ def runFormatter(databaseID, site, forecastList, cmdLineVarDict, vtecMode,
|
||||||
logger.info("Text Formatter Finished")
|
logger.info("Text Formatter Finished")
|
||||||
return forecasts
|
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):
|
def writeToFile(forecasts, outputFile, mode):
|
||||||
if not outputFile is None and outputFile != "":
|
if not outputFile is None and outputFile != "":
|
||||||
outfile = open(outputFile, mode)
|
outfile = open(outputFile, mode)
|
||||||
|
|
|
@ -1905,12 +1905,9 @@ class FWS_Overrides:
|
||||||
# Get VariableList and _issuance_list variables
|
# Get VariableList and _issuance_list variables
|
||||||
varDict = argDict["varDict"]
|
varDict = argDict["varDict"]
|
||||||
for key in varDict.keys():
|
for key in varDict.keys():
|
||||||
print "key", key
|
|
||||||
if type(key) is types.TupleType:
|
if type(key) is types.TupleType:
|
||||||
label, variable = key
|
label, variable = key
|
||||||
exec "self._" + variable + "= varDict[key]"
|
exec "self._" + variable + "= varDict[key]"
|
||||||
elif type(key) is str:
|
|
||||||
exec "self._" + key + "= varDict[key]"
|
|
||||||
|
|
||||||
self._language = argDict["language"]
|
self._language = argDict["language"]
|
||||||
|
|
||||||
|
|
|
@ -796,7 +796,7 @@ class SmartScript(BaseTool.BaseTool):
|
||||||
if "A" == status:
|
if "A" == status:
|
||||||
importance = Priority.PROBLEM
|
importance = Priority.PROBLEM
|
||||||
elif "R" == status:
|
elif "R" == status:
|
||||||
importance = Priority.EVENTA
|
importance = Priority.EVENTB
|
||||||
elif "U" == status:
|
elif "U" == status:
|
||||||
importance = Priority.CRITICAL
|
importance = Priority.CRITICAL
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -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>
|
|
|
@ -1 +0,0 @@
|
||||||
bin.includes = feature.xml
|
|
|
@ -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>
|
|
|
@ -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>
|
|
|
@ -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>
|
|
|
@ -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
|
|
|
@ -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
|
|
|
@ -1,5 +0,0 @@
|
||||||
source.. = src/
|
|
||||||
output.. = bin/
|
|
||||||
bin.includes = META-INF/,\
|
|
||||||
.,\
|
|
||||||
plugin.xml
|
|
|
@ -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>
|
|
|
@ -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;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -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();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -341,7 +341,7 @@ public class FileSelectDlg extends Dialog {
|
||||||
importNewBtn1.addSelectionListener(new SelectionAdapter() {
|
importNewBtn1.addSelectionListener(new SelectionAdapter() {
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
FileDialog newFileDlg = new FileDialog(shell, SWT.OPEN
|
FileDialog newFileDlg = new FileDialog(shell, SWT.OPEN
|
||||||
| SWT.MULTI);
|
| SWT.SINGLE);
|
||||||
newFileDlg.setFilterExtensions(fileExtensions);
|
newFileDlg.setFilterExtensions(fileExtensions);
|
||||||
String newFileName = newFileDlg.open();
|
String newFileName = newFileDlg.open();
|
||||||
if (newFileName != null) {
|
if (newFileName != null) {
|
||||||
|
|
|
@ -27,5 +27,79 @@
|
||||||
id="com.raytheon.viz.notification.statusHandler">
|
id="com.raytheon.viz.notification.statusHandler">
|
||||||
</statusHandler>
|
</statusHandler>
|
||||||
</extension>
|
</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>
|
</plugin>
|
||||||
|
|
|
@ -50,7 +50,10 @@ import com.raytheon.uf.viz.core.exception.VizException;
|
||||||
import com.raytheon.uf.viz.core.localization.LocalizationManager;
|
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>
|
* <pre>
|
||||||
*
|
*
|
||||||
|
@ -73,6 +76,7 @@ import com.raytheon.uf.viz.core.localization.LocalizationManager;
|
||||||
* @author brockwoo
|
* @author brockwoo
|
||||||
* @version 1
|
* @version 1
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public class ScriptCreator {
|
public class ScriptCreator {
|
||||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||||
.getHandler(ScriptCreator.class);
|
.getHandler(ScriptCreator.class);
|
||||||
|
|
|
@ -4,6 +4,7 @@ import java.io.IOException;
|
||||||
import java.lang.reflect.InvocationHandler;
|
import java.lang.reflect.InvocationHandler;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.lang.reflect.Proxy;
|
import java.lang.reflect.Proxy;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
import javax.jws.WebService;
|
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.SerializationUtil;
|
||||||
import com.raytheon.uf.common.serialization.comm.IServerRequest;
|
import com.raytheon.uf.common.serialization.comm.IServerRequest;
|
||||||
import com.raytheon.uf.common.serialization.comm.RemoteServiceRequest;
|
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.ServiceException;
|
||||||
import com.raytheon.uf.common.serialization.comm.response.ServerErrorResponse;
|
import com.raytheon.uf.common.serialization.comm.response.ServerErrorResponse;
|
||||||
import com.raytheon.uf.common.serialization.comm.util.ExceptionWrapper;
|
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
|
* sure request type has registered a handler to handle the request on the
|
||||||
* server
|
* server.
|
||||||
*
|
*
|
||||||
* <pre>
|
* <pre>
|
||||||
*
|
*
|
||||||
|
@ -60,6 +62,7 @@ import com.raytheon.uf.viz.core.localization.LocalizationManager;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Aug 3, 2009 mschenke Initial creation
|
* Aug 3, 2009 mschenke Initial creation
|
||||||
|
* Jul 24, 2012 njensen Enhanced logging
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -273,9 +276,12 @@ public class ThriftClient {
|
||||||
private static Object sendRequest(IServerRequest request,
|
private static Object sendRequest(IServerRequest request,
|
||||||
String httpAddress, String uri) throws VizException {
|
String httpAddress, String uri) throws VizException {
|
||||||
httpAddress += uri;
|
httpAddress += uri;
|
||||||
|
String uniqueId = UUID.randomUUID().toString();
|
||||||
|
RequestWrapper wrapper = new RequestWrapper(request, VizApp.getWsId(),
|
||||||
|
uniqueId);
|
||||||
byte[] message;
|
byte[] message;
|
||||||
try {
|
try {
|
||||||
message = SerializationUtil.transformToThrift(request);
|
message = SerializationUtil.transformToThrift(wrapper);
|
||||||
} catch (SerializationException e) {
|
} catch (SerializationException e) {
|
||||||
throw new VizException("unable to serialize request object", e);
|
throw new VizException("unable to serialize request object", e);
|
||||||
}
|
}
|
||||||
|
@ -287,8 +293,8 @@ public class ThriftClient {
|
||||||
.postBinary(httpAddress, message);
|
.postBinary(httpAddress, message);
|
||||||
long time = System.currentTimeMillis() - t0;
|
long time = System.currentTimeMillis() - t0;
|
||||||
if (time >= SIMPLE_LOG_TIME) {
|
if (time >= SIMPLE_LOG_TIME) {
|
||||||
System.out.println("Took " + time + "ms to run request "
|
System.out.println("Took " + time + "ms to run request id["
|
||||||
+ request);
|
+ uniqueId + "] " + request.toString());
|
||||||
}
|
}
|
||||||
if (time >= BAD_LOG_TIME) {
|
if (time >= BAD_LOG_TIME) {
|
||||||
new Exception() {
|
new Exception() {
|
||||||
|
|
|
@ -80,9 +80,9 @@
|
||||||
<arrowStyle>
|
<arrowStyle>
|
||||||
<!--
|
<!--
|
||||||
<displayUnits>K/(km * 1000)</displayUnits>
|
<displayUnits>K/(km * 1000)</displayUnits>
|
||||||
-->
|
|
||||||
<displayUnits label="K/(km*1000)">K/m*1.0E6</displayUnits>
|
<displayUnits label="K/(km*1000)">K/m*1.0E6</displayUnits>
|
||||||
-->
|
-->
|
||||||
|
<displayUnits label="C/m">K/m*1.0E6</displayUnits>
|
||||||
</arrowStyle>
|
</arrowStyle>
|
||||||
</styleRule>
|
</styleRule>
|
||||||
|
|
||||||
|
|
|
@ -4084,4 +4084,13 @@ in | .03937 | 0 | 4 | | |..|8000F0FF| | 16 | \
|
||||||
</contourStyle>
|
</contourStyle>
|
||||||
</styleRule>
|
</styleRule>
|
||||||
|
|
||||||
|
<styleRule>
|
||||||
|
<paramLevelMatches>
|
||||||
|
<parameter>Wind</parameter>
|
||||||
|
<parameter>Gust</parameter>
|
||||||
|
</paramLevelMatches>
|
||||||
|
<contourStyle>
|
||||||
|
<displayUnits>kts</displayUnits>
|
||||||
|
</contourStyle>
|
||||||
|
</styleRule>
|
||||||
</styleRuleset>
|
</styleRuleset>
|
||||||
|
|
|
@ -498,4 +498,13 @@
|
||||||
</graphStyle>
|
</graphStyle>
|
||||||
</styleRule>
|
</styleRule>
|
||||||
|
|
||||||
|
<styleRule>
|
||||||
|
<paramLevelMatches>
|
||||||
|
<parameter>MTV</parameter>
|
||||||
|
</paramLevelMatches>
|
||||||
|
<graphStyle>
|
||||||
|
<displayUnits label="gm/kgs">g*m/(kg*s)</displayUnits>
|
||||||
|
</graphStyle>
|
||||||
|
</styleRule>
|
||||||
|
|
||||||
</styleRuleset>
|
</styleRuleset>
|
|
@ -1548,7 +1548,7 @@
|
||||||
</key>
|
</key>
|
||||||
<key
|
<key
|
||||||
contextId="com.raytheon.uf.viz.d2d.ui"
|
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"
|
schemeId="com.raytheon.viz.ui.awips.scheme"
|
||||||
sequence="M1+P">
|
sequence="M1+P">
|
||||||
</key>
|
</key>
|
||||||
|
|
|
@ -57,7 +57,7 @@ public class AddAWIPSProcedure extends AbstractHandler {
|
||||||
@Override
|
@Override
|
||||||
public Object execute(ExecutionEvent event) throws ExecutionException {
|
public Object execute(ExecutionEvent event) throws ExecutionException {
|
||||||
Procedure procedure = new Procedure();
|
Procedure procedure = new Procedure();
|
||||||
ProcedureDlg dlg = new ProcedureDlg(null, procedure,
|
ProcedureDlg dlg = ProcedureDlg.getOrCreateDialog(null, procedure,
|
||||||
HandlerUtil.getActiveShell(event));
|
HandlerUtil.getActiveShell(event));
|
||||||
dlg.open();
|
dlg.open();
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,8 @@ import java.io.File;
|
||||||
import org.eclipse.core.commands.AbstractHandler;
|
import org.eclipse.core.commands.AbstractHandler;
|
||||||
import org.eclipse.core.commands.ExecutionEvent;
|
import org.eclipse.core.commands.ExecutionEvent;
|
||||||
import org.eclipse.core.commands.ExecutionException;
|
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 org.eclipse.ui.handlers.HandlerUtil;
|
||||||
|
|
||||||
import com.raytheon.uf.common.localization.LocalizationFile;
|
import com.raytheon.uf.common.localization.LocalizationFile;
|
||||||
|
@ -53,6 +55,8 @@ import com.raytheon.viz.ui.actions.LoadSerializedXml;
|
||||||
*/
|
*/
|
||||||
public class OpenAWIPSProcedure extends AbstractHandler {
|
public class OpenAWIPSProcedure extends AbstractHandler {
|
||||||
|
|
||||||
|
private OpenProcedureListDlg dialog;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
*
|
||||||
|
@ -62,16 +66,21 @@ public class OpenAWIPSProcedure extends AbstractHandler {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Object execute(ExecutionEvent event) throws ExecutionException {
|
public Object execute(ExecutionEvent event) throws ExecutionException {
|
||||||
ProcedureListDlg listDlg = new OpenProcedureListDlg(
|
if(dialog != null){
|
||||||
|
dialog.open();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
dialog = new OpenProcedureListDlg(
|
||||||
HandlerUtil.getActiveShell(event));
|
HandlerUtil.getActiveShell(event));
|
||||||
listDlg.open();
|
dialog.open();
|
||||||
|
|
||||||
LocalizationFile selectedFile = listDlg.getSelectedFile();
|
|
||||||
|
|
||||||
|
LocalizationFile selectedFile = dialog.getSelectedFile();
|
||||||
|
dialog = null;
|
||||||
if (selectedFile != null) {
|
if (selectedFile != null) {
|
||||||
File f = selectedFile.getFile();
|
File f = selectedFile.getFile();
|
||||||
Procedure p = (Procedure) LoadSerializedXml.deserialize(f);
|
Procedure p = (Procedure) LoadSerializedXml.deserialize(f);
|
||||||
ProcedureDlg dlg = new ProcedureDlg(
|
ProcedureDlg dlg = ProcedureDlg.getOrCreateDialog(
|
||||||
LocalizationUtil.extractName(selectedFile.getName()), p,
|
LocalizationUtil.extractName(selectedFile.getName()), p,
|
||||||
VizWorkbenchManager.getInstance().getCurrentWindow()
|
VizWorkbenchManager.getInstance().getCurrentWindow()
|
||||||
.getShell());
|
.getShell());
|
||||||
|
|
|
@ -23,6 +23,7 @@ package com.raytheon.uf.viz.d2d.ui.dialogs.procedures;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Map.Entry;
|
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.dialogs.CaveSWTDialog;
|
||||||
import com.raytheon.viz.ui.editor.AbstractEditor;
|
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 {
|
public class ProcedureDlg extends CaveSWTDialog {
|
||||||
|
|
||||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||||
|
@ -94,6 +111,8 @@ public class ProcedureDlg extends CaveSWTDialog {
|
||||||
|
|
||||||
public static final String PROCEDURES_DIR = "/procedures";
|
public static final String PROCEDURES_DIR = "/procedures";
|
||||||
|
|
||||||
|
private static Collection<ProcedureDlg> openDialogs = new ArrayList<ProcedureDlg>();
|
||||||
|
|
||||||
private Font font;
|
private Font font;
|
||||||
|
|
||||||
private List dataList;
|
private List dataList;
|
||||||
|
@ -148,7 +167,7 @@ public class ProcedureDlg extends CaveSWTDialog {
|
||||||
|
|
||||||
private final java.util.List<BundlePair> bundles;
|
private final java.util.List<BundlePair> bundles;
|
||||||
|
|
||||||
public ProcedureDlg(String fileName, Procedure p, Shell parent) {
|
private ProcedureDlg(String fileName, Procedure p, Shell parent) {
|
||||||
// Win32
|
// Win32
|
||||||
super(parent, SWT.DIALOG_TRIM | SWT.RESIZE, CAVE.INDEPENDENT_SHELL
|
super(parent, SWT.DIALOG_TRIM | SWT.RESIZE, CAVE.INDEPENDENT_SHELL
|
||||||
| CAVE.DO_NOT_BLOCK);
|
| CAVE.DO_NOT_BLOCK);
|
||||||
|
@ -203,6 +222,9 @@ public class ProcedureDlg extends CaveSWTDialog {
|
||||||
@Override
|
@Override
|
||||||
protected void disposed() {
|
protected void disposed() {
|
||||||
font.dispose();
|
font.dispose();
|
||||||
|
synchronized (openDialogs) {
|
||||||
|
openDialogs.remove(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -989,4 +1011,44 @@ public class ProcedureDlg extends CaveSWTDialog {
|
||||||
};
|
};
|
||||||
dlg.open();
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,6 +54,24 @@ import com.raytheon.uf.common.localization.LocalizationUtil;
|
||||||
import com.raytheon.uf.common.localization.PathManagerFactory;
|
import com.raytheon.uf.common.localization.PathManagerFactory;
|
||||||
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
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 {
|
public class ProcedureListDlg extends CaveSWTDialog {
|
||||||
|
|
||||||
protected boolean oneLevel = true;
|
protected boolean oneLevel = true;
|
||||||
|
@ -317,11 +335,19 @@ public class ProcedureListDlg extends CaveSWTDialog {
|
||||||
if (treeViewer.getContentProvider() instanceof ProcedureTreeContentProvider) {
|
if (treeViewer.getContentProvider() instanceof ProcedureTreeContentProvider) {
|
||||||
ProcedureTreeContentProvider content = (ProcedureTreeContentProvider) treeViewer
|
ProcedureTreeContentProvider content = (ProcedureTreeContentProvider) treeViewer
|
||||||
.getContentProvider();
|
.getContentProvider();
|
||||||
Object find = content.findItem(user);
|
final Object find = content.findItem(user);
|
||||||
if (find != null) {
|
if (find != null) {
|
||||||
treeViewer.setExpandedElements(new Object[] { find });
|
treeViewer.setExpandedElements(new Object[] { 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);
|
treeViewer.reveal(find);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -449,6 +475,16 @@ public class ProcedureListDlg extends CaveSWTDialog {
|
||||||
procedureTF.setText(procedureTF.getText().concat(".xml"));
|
procedureTF.setText(procedureTF.getText().concat(".xml"));
|
||||||
}
|
}
|
||||||
if (dataListContains(procedureTF.getText())) {
|
if (dataListContains(procedureTF.getText())) {
|
||||||
|
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
|
// Pop up a warning
|
||||||
boolean result = MessageDialog.openQuestion(shell,
|
boolean result = MessageDialog.openQuestion(shell,
|
||||||
"Confirm Overwrite",
|
"Confirm Overwrite",
|
||||||
|
@ -458,6 +494,7 @@ public class ProcedureListDlg extends CaveSWTDialog {
|
||||||
fileName = procedureTF.getText();
|
fileName = procedureTF.getText();
|
||||||
shell.dispose();
|
shell.dispose();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
fileName = procedureTF.getText();
|
fileName = procedureTF.getText();
|
||||||
shell.dispose();
|
shell.dispose();
|
||||||
|
|
|
@ -24,15 +24,15 @@
|
||||||
</Method>
|
</Method>
|
||||||
<Method models="HPCGuide" displayName="Total Cloud Cover" name="Multiply">
|
<Method models="HPCGuide" displayName="Total Cloud Cover" name="Multiply">
|
||||||
<Field abbreviation="TCC"/>
|
<Field abbreviation="TCC"/>
|
||||||
<ConstantField value="0.01"/>
|
<ConstantField value="100.0"/>
|
||||||
</Method>
|
</Method>
|
||||||
<Method models="RTMA" displayName="GOES Effective Cloud Amount" name="Multiply">
|
<Method models="RTMA" displayName="GOES Effective Cloud Amount" name="Multiply">
|
||||||
<Field abbreviation="TCC"/>
|
<Field abbreviation="TCC"/>
|
||||||
<ConstantField value="0.01"/>
|
<ConstantField value="100.0"/>
|
||||||
</Method>
|
</Method>
|
||||||
<Method name="Multiply">
|
<Method name="Multiply">
|
||||||
<Field abbreviation="TCC"/>
|
<Field abbreviation="TCC"/>
|
||||||
<ConstantField value="0.01"/>
|
<ConstantField value="100.0"/>
|
||||||
</Method>
|
</Method>
|
||||||
<Method levels="Surface" name="Mapping">
|
<Method levels="Surface" name="Mapping">
|
||||||
<Field level="Station" abbreviation="clouds_bestCat"/>
|
<Field level="Station" abbreviation="clouds_bestCat"/>
|
||||||
|
|
|
@ -18,4 +18,9 @@
|
||||||
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
|
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
|
||||||
further_licensing_information.
|
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>
|
|
@ -18,4 +18,9 @@
|
||||||
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
|
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
|
||||||
further_licensing_information.
|
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>
|
|
@ -18,7 +18,7 @@
|
||||||
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
|
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
|
||||||
further_licensing_information.
|
further_licensing_information.
|
||||||
-->
|
-->
|
||||||
<DerivedParameter unit="m/s" name="Total Wind (Vector)" abbreviation="Wind">
|
<DerivedParameter unit="m/s" name="Wind" abbreviation="Wind">
|
||||||
<Method name="Vector">
|
<Method name="Vector">
|
||||||
<Field abbreviation="uW"/>
|
<Field abbreviation="uW"/>
|
||||||
<Field abbreviation="vW"/>
|
<Field abbreviation="vW"/>
|
||||||
|
|
|
@ -819,7 +819,7 @@ public class FileTreeView extends ViewPart implements IPartListener2,
|
||||||
// We can import into true directories, not group datas
|
// We can import into true directories, not group datas
|
||||||
mgr.add(new Separator());
|
mgr.add(new Separator());
|
||||||
mgr.add(new ImportFileAction(fdata.getPathData().getType(),
|
mgr.add(new ImportFileAction(fdata.getPathData().getType(),
|
||||||
fdata.getPath()));
|
fdata.getPath(), fdata.getPathData().getFilter()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,16 +67,35 @@ public class ImportFileAction extends Action {
|
||||||
private static final String FORMAT_STRING = "The file '%s' already exists at the %s level and "
|
private static final String FORMAT_STRING = "The file '%s' already exists at the %s level and "
|
||||||
+ "will be deleted. Proceed?";
|
+ "will be deleted. Proceed?";
|
||||||
|
|
||||||
|
private static final String ASTERISK = "*";
|
||||||
|
|
||||||
private String directoryPath;
|
private String directoryPath;
|
||||||
|
|
||||||
private LocalizationType contextType;
|
private LocalizationType contextType;
|
||||||
|
|
||||||
|
private String[] fileExtensionFilterArr;
|
||||||
|
|
||||||
public ImportFileAction(LocalizationType contextType, String directoryPath) {
|
public ImportFileAction(LocalizationType contextType, String directoryPath) {
|
||||||
super("Import File...");
|
super("Import File...");
|
||||||
this.contextType = contextType;
|
this.contextType = contextType;
|
||||||
this.directoryPath = directoryPath;
|
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)
|
* (non-Javadoc)
|
||||||
*
|
*
|
||||||
|
@ -87,6 +106,9 @@ public class ImportFileAction extends Action {
|
||||||
Shell parent = VizWorkbenchManager.getInstance().getCurrentWindow()
|
Shell parent = VizWorkbenchManager.getInstance().getCurrentWindow()
|
||||||
.getShell();
|
.getShell();
|
||||||
FileDialog dialog = new FileDialog(parent);
|
FileDialog dialog = new FileDialog(parent);
|
||||||
|
if (fileExtensionFilterArr != null) {
|
||||||
|
dialog.setFilterExtensions(fileExtensionFilterArr);
|
||||||
|
}
|
||||||
String fileToImport = dialog.open();
|
String fileToImport = dialog.open();
|
||||||
if (fileToImport != null) {
|
if (fileToImport != null) {
|
||||||
File importFile = new File(fileToImport);
|
File importFile = new File(fileToImport);
|
||||||
|
|
|
@ -824,15 +824,10 @@ public class FFMPMonitor extends ResourceMonitor {
|
||||||
// special case where FFG is the primary source
|
// special case where FFG is the primary source
|
||||||
// check for special case with dual stand alone and table
|
// check for special case with dual stand alone and table
|
||||||
// display loaded
|
// display loaded
|
||||||
SourceXML sourcexml = getSourceConfig().getSource(sourceName);
|
|
||||||
|
|
||||||
if (sourcexml.getSourceType().equals(
|
|
||||||
SOURCE_TYPE.GUIDANCE.getSourceType())) {
|
|
||||||
sourceName = sourcexml.getDisplayName();
|
|
||||||
} else {
|
|
||||||
populateFFMPRecord(product, siteKey, dataKey, sourceName,
|
populateFFMPRecord(product, siteKey, dataKey, sourceName,
|
||||||
ptime, phuc, retrieveNew);
|
ptime, phuc, retrieveNew);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
record = ffmpData.get(siteKey).get(sourceName);
|
record = ffmpData.get(siteKey).get(sourceName);
|
||||||
|
@ -1109,6 +1104,8 @@ public class FFMPMonitor extends ResourceMonitor {
|
||||||
}
|
}
|
||||||
|
|
||||||
resourceListeners.remove(listener);
|
resourceListeners.remove(listener);
|
||||||
|
// clean up if we can
|
||||||
|
System.gc();
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArrayList<IFFMPResourceListener> getResourceListenerList() {
|
public ArrayList<IFFMPResourceListener> getResourceListenerList() {
|
||||||
|
|
|
@ -279,7 +279,10 @@ public class FFTIControlDlg extends Dialog {
|
||||||
&& (thisItem.getQpeDurHr() == nextItem.getQpeDurHr())
|
&& (thisItem.getQpeDurHr() == nextItem.getQpeDurHr())
|
||||||
&& (thisItem.getGuidDurHr() == nextItem.getGuidDurHr())
|
&& (thisItem.getGuidDurHr() == nextItem.getGuidDurHr())
|
||||||
&& (thisItem.getQpfDurHr() == nextItem.getQpfDurHr())
|
&& (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(i + 1);
|
||||||
duplicateLst.add(j + 1);
|
duplicateLst.add(j + 1);
|
||||||
|
@ -295,8 +298,14 @@ public class FFTIControlDlg extends Dialog {
|
||||||
HashSet<Integer> duplicates = getDuplicates();
|
HashSet<Integer> duplicates = getDuplicates();
|
||||||
if (duplicates.size() > 0) {
|
if (duplicates.size() > 0) {
|
||||||
String setsStr = "";
|
String setsStr = "";
|
||||||
for (Integer setIndex : duplicates)
|
int i = 0;
|
||||||
setsStr += setIndex + "/";
|
for (Integer setIndex : duplicates) {
|
||||||
|
setsStr += setIndex;
|
||||||
|
if (i != duplicates.size()-1) {
|
||||||
|
setsStr = setsStr + "/";
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
MessageBox messageBox = new MessageBox(shell, SWT.OK);
|
MessageBox messageBox = new MessageBox(shell, SWT.OK);
|
||||||
messageBox.setText("Warning: Duplicate Setting(s)!");
|
messageBox.setText("Warning: Duplicate Setting(s)!");
|
||||||
messageBox
|
messageBox
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
package com.raytheon.uf.viz.monitor.ffmp.ffti;
|
package com.raytheon.uf.viz.monitor.ffmp.ffti;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
|
||||||
import org.eclipse.swt.SWT;
|
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.ProductXML;
|
||||||
import com.raytheon.uf.common.monitor.xml.SourceXML;
|
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 {
|
public class SettingComp extends Composite implements DurationInterface {
|
||||||
/**
|
/**
|
||||||
* Parent tab folder.
|
* Parent tab folder.
|
||||||
|
@ -103,6 +115,8 @@ public class SettingComp extends Composite implements DurationInterface {
|
||||||
// temporary storage for qpf
|
// temporary storage for qpf
|
||||||
private String selectedQpfVal = "0";
|
private String selectedQpfVal = "0";
|
||||||
|
|
||||||
|
private FFTISettingXML fftiSetting;
|
||||||
|
|
||||||
public SettingComp(TabFolder parent) {
|
public SettingComp(TabFolder parent) {
|
||||||
super(parent, 0);
|
super(parent, 0);
|
||||||
|
|
||||||
|
@ -115,6 +129,7 @@ public class SettingComp extends Composite implements DurationInterface {
|
||||||
super(parent, 0);
|
super(parent, 0);
|
||||||
|
|
||||||
this.parent = parent;
|
this.parent = parent;
|
||||||
|
this.fftiSetting = fftiSetting;
|
||||||
|
|
||||||
init();
|
init();
|
||||||
|
|
||||||
|
@ -217,6 +232,8 @@ public class SettingComp extends Composite implements DurationInterface {
|
||||||
|
|
||||||
accumRdo.setEnabled(true);
|
accumRdo.setEnabled(true);
|
||||||
accumAction(accumAttrib);
|
accumAction(accumAttrib);
|
||||||
|
|
||||||
|
setSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createAttributeControls() {
|
private void createAttributeControls() {
|
||||||
|
@ -318,7 +335,7 @@ public class SettingComp extends Composite implements DurationInterface {
|
||||||
gd = new GridData(SWT.CENTER, SWT.DEFAULT, true, false);
|
gd = new GridData(SWT.CENTER, SWT.DEFAULT, true, false);
|
||||||
gd.widthHint = listWidth;
|
gd.widthHint = listWidth;
|
||||||
gd.heightHint = listHeight;
|
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);
|
qpeList.setLayoutData(gd);
|
||||||
fillQpeList();
|
fillQpeList();
|
||||||
|
|
||||||
|
@ -327,8 +344,7 @@ public class SettingComp extends Composite implements DurationInterface {
|
||||||
gd.horizontalSpan = 2;
|
gd.horizontalSpan = 2;
|
||||||
gd.widthHint = listWidth - 75;
|
gd.widthHint = listWidth - 75;
|
||||||
gd.heightHint = listHeight;
|
gd.heightHint = listHeight;
|
||||||
guidList = new List(precipSrcComp, SWT.BORDER | SWT.MULTI
|
guidList = new List(precipSrcComp, SWT.BORDER | SWT.V_SCROLL);
|
||||||
| SWT.V_SCROLL);
|
|
||||||
guidList.setLayoutData(gd);
|
guidList.setLayoutData(gd);
|
||||||
fillGuidList();
|
fillGuidList();
|
||||||
|
|
||||||
|
@ -337,7 +353,7 @@ public class SettingComp extends Composite implements DurationInterface {
|
||||||
gd.horizontalSpan = 2;
|
gd.horizontalSpan = 2;
|
||||||
gd.widthHint = listWidth;
|
gd.widthHint = listWidth;
|
||||||
gd.heightHint = listHeight;
|
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);
|
qpfList.setLayoutData(gd);
|
||||||
fillQpfList();
|
fillQpfList();
|
||||||
|
|
||||||
|
@ -393,9 +409,6 @@ public class SettingComp extends Composite implements DurationInterface {
|
||||||
guidSet.add(sourceName);
|
guidSet.add(sourceName);
|
||||||
guidList.add(sourceName);
|
guidList.add(sourceName);
|
||||||
}
|
}
|
||||||
if (guidList.getItemCount() > 0) {
|
|
||||||
guidList.setSelection(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
guidList.addSelectionListener(new SelectionListener() {
|
guidList.addSelectionListener(new SelectionListener() {
|
||||||
|
|
||||||
|
@ -438,9 +451,10 @@ public class SettingComp extends Composite implements DurationInterface {
|
||||||
|
|
||||||
if (source.isMosaic()) {
|
if (source.isMosaic()) {
|
||||||
if (!qpeSet.contains(product.getProductKey())) {
|
if (!qpeSet.contains(product.getProductKey())) {
|
||||||
if (!qpeSet.contains(source.getDisplayName())) {
|
String displayName = source.getDisplayName();
|
||||||
qpeSet.add(source.getDisplayName());
|
if (!qpeSet.contains(displayName)) {
|
||||||
qpeList.add(source.getDisplayName());
|
qpeSet.add(displayName);
|
||||||
|
qpeList.add(displayName);
|
||||||
}
|
}
|
||||||
break;
|
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -599,6 +605,55 @@ public class SettingComp extends Composite implements DurationInterface {
|
||||||
attrLbl.setLayoutData(gd);
|
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) {
|
private void accumAction(FFTIAttribute attribVal) {
|
||||||
// change attribute values
|
// change attribute values
|
||||||
sliderCanvasLabel.setText("inches");
|
sliderCanvasLabel.setText("inches");
|
||||||
|
|
|
@ -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.FFMPConfigBasinXML;
|
||||||
import com.raytheon.uf.viz.monitor.ffmp.xml.FFMPTableColumnXML;
|
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 {
|
public class FFMPConfig {
|
||||||
private static FFMPConfig classInstance = new FFMPConfig();
|
private static FFMPConfig classInstance = new FFMPConfig();
|
||||||
|
|
||||||
|
@ -380,10 +396,14 @@ public class FFMPConfig {
|
||||||
}
|
}
|
||||||
if (column.equalsIgnoreCase(tcXML.getColumnName())) {
|
if (column.equalsIgnoreCase(tcXML.getColumnName())) {
|
||||||
boolean includedInTable = false;
|
boolean includedInTable = false;
|
||||||
if (column.equalsIgnoreCase(COLUMN_NAME.GUID.getColumnName()) ||
|
if (column.equalsIgnoreCase(COLUMN_NAME.GUID
|
||||||
column.equalsIgnoreCase(COLUMN_NAME.RATIO.getColumnName()) ||
|
.getColumnName())
|
||||||
column.equalsIgnoreCase(COLUMN_NAME.DIFF.getColumnName())) {
|
|| column.equalsIgnoreCase(COLUMN_NAME.RATIO
|
||||||
if (ffmpCfgBasin.getIncludedGuids().contains(displayName)) {
|
.getColumnName())
|
||||||
|
|| column.equalsIgnoreCase(COLUMN_NAME.DIFF
|
||||||
|
.getColumnName())) {
|
||||||
|
if (ffmpCfgBasin.getIncludedGuids().contains(
|
||||||
|
displayName)) {
|
||||||
includedInTable = true;
|
includedInTable = true;
|
||||||
attrData.setGuidColumnIncluded(displayName,
|
attrData.setGuidColumnIncluded(displayName,
|
||||||
includedInTable);
|
includedInTable);
|
||||||
|
@ -398,7 +418,8 @@ public class FFMPConfig {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public AttributesDlgData getVisibleColumns(String siteKey, boolean reReadAttrData) {
|
public AttributesDlgData getVisibleColumns(String siteKey,
|
||||||
|
boolean reReadAttrData) {
|
||||||
this.reReadAttrData = reReadAttrData;
|
this.reReadAttrData = reReadAttrData;
|
||||||
return getVisibleColumns(siteKey);
|
return getVisibleColumns(siteKey);
|
||||||
}
|
}
|
||||||
|
@ -417,22 +438,35 @@ public class FFMPConfig {
|
||||||
ArrayList<FFMPTableColumnXML> columnData = ffmpCfgBasin
|
ArrayList<FFMPTableColumnXML> columnData = ffmpCfgBasin
|
||||||
.getTableColumnData();
|
.getTableColumnData();
|
||||||
|
|
||||||
|
|
||||||
for (FFMPTableColumnXML tcXML : columnData) {
|
for (FFMPTableColumnXML tcXML : columnData) {
|
||||||
if (tcXML.getColumnName().equalsIgnoreCase(COLUMN_NAME.RATE.getColumnName())) {
|
if (tcXML.getColumnName().equalsIgnoreCase(
|
||||||
tcXML.setDisplayedInTable(attrData.isColumnVisible(COLUMN_NAME.RATE.getColumnName()));
|
COLUMN_NAME.RATE.getColumnName())) {
|
||||||
} else if (tcXML.getColumnName().equalsIgnoreCase(COLUMN_NAME.NAME.getColumnName())) {
|
tcXML.setDisplayedInTable(attrData
|
||||||
tcXML.setDisplayedInTable(attrData.isColumnVisible(COLUMN_NAME.NAME.getColumnName()));
|
.isColumnVisible(COLUMN_NAME.RATE.getColumnName()));
|
||||||
} else if (tcXML.getColumnName().equalsIgnoreCase(COLUMN_NAME.QPE.getColumnName())) {
|
} else if (tcXML.getColumnName().equalsIgnoreCase(
|
||||||
tcXML.setDisplayedInTable(attrData.isColumnVisible(COLUMN_NAME.QPE.getColumnName()));
|
COLUMN_NAME.NAME.getColumnName())) {
|
||||||
} else if (tcXML.getColumnName().equalsIgnoreCase(COLUMN_NAME.QPF.getColumnName())) {
|
tcXML.setDisplayedInTable(attrData
|
||||||
tcXML.setDisplayedInTable(attrData.isColumnVisible(COLUMN_NAME.QPF.getColumnName()));
|
.isColumnVisible(COLUMN_NAME.NAME.getColumnName()));
|
||||||
} else if (tcXML.getColumnName().equalsIgnoreCase(COLUMN_NAME.GUID.getColumnName())) {
|
} else if (tcXML.getColumnName().equalsIgnoreCase(
|
||||||
tcXML.setDisplayedInTable(attrData.isColumnVisible(COLUMN_NAME.GUID.getColumnName()));
|
COLUMN_NAME.QPE.getColumnName())) {
|
||||||
} else if (tcXML.getColumnName().equalsIgnoreCase(COLUMN_NAME.RATIO.getColumnName())) {
|
tcXML.setDisplayedInTable(attrData
|
||||||
tcXML.setDisplayedInTable(attrData.isColumnVisible(COLUMN_NAME.RATIO.getColumnName()));
|
.isColumnVisible(COLUMN_NAME.QPE.getColumnName()));
|
||||||
} else if (tcXML.getColumnName().equalsIgnoreCase(COLUMN_NAME.DIFF.getColumnName())) {
|
} else if (tcXML.getColumnName().equalsIgnoreCase(
|
||||||
tcXML.setDisplayedInTable(attrData.isColumnVisible(COLUMN_NAME.DIFF.getColumnName()));
|
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()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -496,7 +530,8 @@ public class FFMPConfig {
|
||||||
* starts. If the column is not visible then default the sort column to be
|
* starts. If the column is not visible then default the sort column to be
|
||||||
* the name column.
|
* the name column.
|
||||||
*
|
*
|
||||||
* @param siteKey The siteKey being used
|
* @param siteKey
|
||||||
|
* The siteKey being used
|
||||||
* @return Column index.
|
* @return Column index.
|
||||||
*/
|
*/
|
||||||
public int getStartSortIndex(String siteKey) {
|
public int getStartSortIndex(String siteKey) {
|
||||||
|
@ -566,6 +601,12 @@ public class FFMPConfig {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the filter value for this column.
|
||||||
|
*
|
||||||
|
* @param threshColName
|
||||||
|
* @return The filter value
|
||||||
|
*/
|
||||||
public double getFilterValue(ThreshColNames threshColName) {
|
public double getFilterValue(ThreshColNames threshColName) {
|
||||||
ArrayList<FFMPTableColumnXML> columnData = ffmpCfgBasin
|
ArrayList<FFMPTableColumnXML> columnData = ffmpCfgBasin
|
||||||
.getTableColumnData();
|
.getTableColumnData();
|
||||||
|
@ -575,6 +616,36 @@ public class FFMPConfig {
|
||||||
return data.getFilter();
|
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
|
* @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) {
|
public void setAttrData(AttributesDlgData attrData) {
|
||||||
this.attrData = attrData;
|
this.attrData = attrData;
|
||||||
|
@ -597,7 +669,8 @@ public class FFMPConfig {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param reReadAttrData the reReadAttrData to set
|
* @param reReadAttrData
|
||||||
|
* the reReadAttrData to set
|
||||||
*/
|
*/
|
||||||
public void setReReadAttrData(boolean reReadAttrData) {
|
public void setReReadAttrData(boolean reReadAttrData) {
|
||||||
this.reReadAttrData = reReadAttrData;
|
this.reReadAttrData = reReadAttrData;
|
||||||
|
|
|
@ -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.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.FFMPConfig.ThreshColNames;
|
||||||
import com.raytheon.uf.viz.monitor.ffmp.ui.dialogs.FfmpTableConfigData.COLUMN_NAME;
|
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;
|
import com.raytheon.uf.viz.monitor.ffmp.xml.FFMPTableColumnXML;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -67,13 +68,16 @@ import com.raytheon.uf.viz.monitor.ffmp.xml.FFMPTableColumnXML;
|
||||||
* Apr 7, 2009 lvenable Initial creation
|
* Apr 7, 2009 lvenable Initial creation
|
||||||
* Mar 15,2012 DR 14406 gzhang Fixing QPF Column Title Missing
|
* Mar 15,2012 DR 14406 gzhang Fixing QPF Column Title Missing
|
||||||
* Mar 20,2012 DR 14250 gzhang Eliminating column Missing values
|
* Mar 20,2012 DR 14250 gzhang Eliminating column Missing values
|
||||||
|
* Aug 01, 2012 14168 mpduff Only allow filtering if ColorCell is true
|
||||||
* </pre>
|
* </pre>
|
||||||
|
*
|
||||||
* @author lvenable
|
* @author lvenable
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
*/
|
*/
|
||||||
public abstract class FFMPTable extends Composite {
|
public abstract class FFMPTable extends Composite {
|
||||||
/** Default column width */
|
/** 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 static final int EXTRA_COLUMN_WIDTH = 28;
|
||||||
|
@ -377,18 +381,37 @@ public abstract class FFMPTable extends Composite {
|
||||||
int sortColIndex = table.indexOf(sortedTableColumn);
|
int sortColIndex = table.indexOf(sortedTableColumn);
|
||||||
boolean isAFilterCol = false;
|
boolean isAFilterCol = false;
|
||||||
ThreshColNames sortedThreshCol = null;
|
ThreshColNames sortedThreshCol = null;
|
||||||
|
boolean reverseFilter = false;
|
||||||
double filterNum = Double.NaN;
|
double filterNum = Double.NaN;
|
||||||
|
|
||||||
String columnName = getColumnKeys()[sortColIndex];
|
String sortedColumnName = getColumnKeys()[sortColIndex];
|
||||||
// Check if the sorted column is a column that will contain a filter.
|
|
||||||
if (!columnName.equalsIgnoreCase("NAME")) {
|
FFMPConfigBasinXML ffmpCfgBasin = FFMPConfig.getInstance()
|
||||||
isAFilterCol = true;
|
.getFFMPConfigData();
|
||||||
|
|
||||||
|
ArrayList<FFMPTableColumnXML> ffmpTableCols = ffmpCfgBasin
|
||||||
|
.getTableColumnData();
|
||||||
|
|
||||||
for (ThreshColNames threshColName : ThreshColNames.values()) {
|
for (ThreshColNames threshColName : ThreshColNames.values()) {
|
||||||
if (columnName.contains(threshColName.name())) {
|
if (sortedColumnName.contains(threshColName.name())) {
|
||||||
sortedThreshCol = threshColName;
|
sortedThreshCol = threshColName;
|
||||||
filterNum = ffmpConfig.getFilterValue(threshColName);
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check if the sorted column is a column that will contain a filter.
|
||||||
|
// 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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
table.removeAll();
|
table.removeAll();
|
||||||
|
@ -413,39 +436,17 @@ public abstract class FFMPTable extends Composite {
|
||||||
extent.x = Math.max(gc.stringExtent(cellData[0].displayString()).x,
|
extent.x = Math.max(gc.stringExtent(cellData[0].displayString()).x,
|
||||||
extent.x);
|
extent.x);
|
||||||
|
|
||||||
/*
|
|
||||||
* Check if the sorted column is a filter column.
|
|
||||||
*/
|
|
||||||
if (isAFilterCol == true) {
|
|
||||||
/*
|
/*
|
||||||
* Check if the data value is Not A Number.
|
* Check if the data value is Not A Number.
|
||||||
*/
|
*/
|
||||||
float dataVal = cellData[sortColIndex]
|
float dataVal = cellData[sortColIndex].getValueAsFloat();
|
||||||
.getValueAsFloat();
|
|
||||||
// DR 14250 fix: any value not a number will be omitted
|
// DR 14250 fix: any value not a number will be omitted
|
||||||
if (/*sortedThreshCol.name().equalsIgnoreCase("RATIO") &&*/ Float.isNaN(dataVal)) {
|
if (/* sortedThreshCol.name().equalsIgnoreCase("RATIO") && */Float
|
||||||
|
.isNaN(dataVal)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (sortedThreshCol.name().equalsIgnoreCase("RATIO") == false) {
|
if (isAFilterCol) {
|
||||||
|
|
||||||
// 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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// }
|
|
||||||
|
|
||||||
if (reverseFilter) {
|
if (reverseFilter) {
|
||||||
if (dataVal > filterNum) {
|
if (dataVal > filterNum) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -667,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;
|
imageHeight = textHeight * 2;
|
||||||
|
|
||||||
gc.dispose();
|
gc.dispose();
|
||||||
|
@ -727,15 +731,24 @@ public abstract class FFMPTable extends Composite {
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
xCoord = Math.round((imageWidth / 2)- (tmpArray[j].length() /*DR14406: old value: maxTextLen*/* textWidth / 2));
|
xCoord = Math.round((imageWidth / 2)
|
||||||
yCoord = j*(textHeight+1);//DR14406: old value 0 is only for the 1st line
|
- (tmpArray[j].length() /*
|
||||||
gc.drawText(tmpArray[j], xCoord, yCoord, true);//DR14406: draw each line separately
|
* 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 {
|
} else {
|
||||||
xCoord = Math.round((imageWidth / 2)
|
xCoord = Math.round((imageWidth / 2)
|
||||||
- (colName.length() * textWidth / 2));
|
- (colName.length() * textWidth / 2));
|
||||||
yCoord = imageHeight / 2 - textHeight / 2 - 1;
|
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);
|
// System.out.println("Column name = " + colName);
|
||||||
|
@ -796,7 +809,8 @@ public abstract class FFMPTable extends Composite {
|
||||||
tCols[i].setWidth(defaultColWidth);
|
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 {
|
} else {
|
||||||
tCols[i].setWidth(0);
|
tCols[i].setWidth(0);
|
||||||
}
|
}
|
||||||
|
@ -876,19 +890,16 @@ public abstract class FFMPTable extends Composite {
|
||||||
*/
|
*/
|
||||||
protected abstract int getColumnIndex(String sortCol);
|
protected abstract int getColumnIndex(String sortCol);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DR14406 code: QPF column's name should be re-set
|
* DR14406 code: QPF column's name should be re-set when a user choose
|
||||||
* when a user choose another type of QPF from the
|
* another type of QPF from the Attributes... button.
|
||||||
* Attributes... button.
|
|
||||||
*
|
*
|
||||||
* See FfmpTableConfigData.setQpfType() with ColumnAttribData
|
* See FfmpTableConfigData.setQpfType() with ColumnAttribData
|
||||||
*
|
*
|
||||||
* @param tCols: TableColumn
|
* @param tCols
|
||||||
* @param col: Column name
|
* : TableColumn
|
||||||
|
* @param col
|
||||||
|
* : Column name
|
||||||
*/
|
*/
|
||||||
private void setQPFColName(TableColumn tCols, String col) {
|
private void setQPFColName(TableColumn tCols, String col) {
|
||||||
|
|
||||||
|
|
|
@ -84,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.FFMPResource;
|
||||||
import com.raytheon.uf.viz.monitor.ffmp.ui.rsc.FFMPTableDataLoader;
|
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.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.uf.viz.monitor.listeners.IMonitorListener;
|
||||||
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
|
|
||||||
|
@ -96,6 +98,10 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Sep 30, 2009 lvenable Initial creation
|
* 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>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -499,7 +505,8 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
sourceMenuItems.get(0).setSelection(true);
|
sourceMenuItems.get(0).setSelection(true);
|
||||||
ffmpConfig.getFFMPConfigData().setGuidSrc(sourceMenuItems.get(0).getText());
|
ffmpConfig.getFFMPConfigData().setGuidSrc(
|
||||||
|
sourceMenuItems.get(0).getText());
|
||||||
}
|
}
|
||||||
|
|
||||||
fireFieldChangedEvent(FFMPRecord.FIELDS.RATIO, false);
|
fireFieldChangedEvent(FFMPRecord.FIELDS.RATIO, false);
|
||||||
|
@ -561,7 +568,8 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
|
||||||
for (int i = 0; i < sourceMenuItems.size(); i++) {
|
for (int i = 0; i < sourceMenuItems.size(); i++) {
|
||||||
String rdo = sourceMenuItems.get(i).getText();
|
String rdo = sourceMenuItems.get(i).getText();
|
||||||
if (rdo.equals(guidSrc)) {
|
if (rdo.equals(guidSrc)) {
|
||||||
ffmpConfig.getFFMPConfigData().setGuidSrc(guidSrc);
|
ffmpConfig.getFFMPConfigData().setGuidSrc(
|
||||||
|
guidSrc);
|
||||||
fireConfigUpdateEvent();
|
fireConfigUpdateEvent();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1023,6 +1031,8 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
|
||||||
|
|
||||||
// Loop over enum from config singleton to create menu items
|
// Loop over enum from config singleton to create menu items
|
||||||
for (ThreshColNames colName : ThreshColNames.values()) {
|
for (ThreshColNames colName : ThreshColNames.values()) {
|
||||||
|
if (ffmpConfig.isColorCell(colName)) {
|
||||||
|
// only add a menu item if colorCell is true
|
||||||
MenuItem mi = new MenuItem(popupMenu, SWT.NONE);
|
MenuItem mi = new MenuItem(popupMenu, SWT.NONE);
|
||||||
mi.setText(colName.name());
|
mi.setText(colName.name());
|
||||||
mi.setData(colName);
|
mi.setData(colName);
|
||||||
|
@ -1036,6 +1046,7 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Set the pop-up menu as the pop-up for the shell
|
// Set the pop-up menu as the pop-up for the shell
|
||||||
thresholdsBtn.setMenu(popupMenu);
|
thresholdsBtn.setMenu(popupMenu);
|
||||||
|
@ -1330,7 +1341,8 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
|
||||||
ffmpListeners.remove(fl);
|
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;
|
FFMPRecord.FIELDS field = FFMPRecord.FIELDS.QPE;
|
||||||
|
|
||||||
|
@ -1659,7 +1671,6 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
|
||||||
* @param tData
|
* @param tData
|
||||||
*/
|
*/
|
||||||
public void resetData(FFMPTableData tData) {
|
public void resetData(FFMPTableData tData) {
|
||||||
|
|
||||||
if (!ffmpTable.isDisposed()) {
|
if (!ffmpTable.isDisposed()) {
|
||||||
this.mainTableData = tData;
|
this.mainTableData = tData;
|
||||||
// System.out.println("---" + tData.getTableRows().size());
|
// System.out.println("---" + tData.getTableRows().size());
|
||||||
|
@ -1776,7 +1787,8 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
|
||||||
*/
|
*/
|
||||||
timeDurScale.setTimeDurationAndUpdate(ffmpConfig.getFFMPConfigData()
|
timeDurScale.setTimeDurationAndUpdate(ffmpConfig.getFFMPConfigData()
|
||||||
.getTimeFrame());
|
.getTimeFrame());
|
||||||
fireTimeChangedEvent(ffmpConfig.getFFMPConfigData().getTimeFrame(), false, false);
|
fireTimeChangedEvent(ffmpConfig.getFFMPConfigData().getTimeFrame(),
|
||||||
|
false, false);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Layer
|
* Layer
|
||||||
|
@ -2058,7 +2070,8 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
|
||||||
*/
|
*/
|
||||||
private FFMPTableDataLoader getLoader() {
|
private FFMPTableDataLoader getLoader() {
|
||||||
synchronized (retrievalQueue) {
|
synchronized (retrievalQueue) {
|
||||||
FFMPTableDataLoader loader = retrievalQueue.get(retrievalQueue.size() - 1);
|
FFMPTableDataLoader loader = retrievalQueue.get(retrievalQueue
|
||||||
|
.size() - 1);
|
||||||
retrievalQueue.clear();
|
retrievalQueue.clear();
|
||||||
return loader;
|
return loader;
|
||||||
}
|
}
|
||||||
|
@ -2097,9 +2110,26 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
|
||||||
Display.getDefault().asyncExec(new Runnable() {
|
Display.getDefault().asyncExec(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
processUpdate(fupdateData);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Process the update
|
||||||
|
*/
|
||||||
|
private void processUpdate(FFMPTableDataUpdate fupdateData) {
|
||||||
allowNewTableUpdate = fupdateData.isAllowNewTableUpdate();
|
allowNewTableUpdate = fupdateData.isAllowNewTableUpdate();
|
||||||
sourceUpdate = fupdateData.isSourceUpdate();
|
sourceUpdate = fupdateData.isSourceUpdate();
|
||||||
|
|
||||||
|
if (retrievalQueue.size() > 0) {
|
||||||
|
dataRetrieveThread = getLoader();
|
||||||
|
dataRetrieveThread.start();
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
}
|
||||||
|
|
||||||
if (fupdateData.getTableData() != null && sweet) {
|
if (fupdateData.getTableData() != null && sweet) {
|
||||||
resetData(fupdateData.getTableData());
|
resetData(fupdateData.getTableData());
|
||||||
}
|
}
|
||||||
|
@ -2114,18 +2144,10 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
|
||||||
|
|
||||||
resetCursor();
|
resetCursor();
|
||||||
sweet = true;
|
sweet = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (retrievalQueue.size() > 0) {
|
|
||||||
dataRetrieveThread = getLoader();
|
|
||||||
dataRetrieveThread.start();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* used to blank the group label when channging HUC
|
* used to blank the group label when channging HUC while in an aggregate.
|
||||||
* while in an aggregate.
|
|
||||||
*/
|
*/
|
||||||
public void blankGroupLabel() {
|
public void blankGroupLabel() {
|
||||||
if (groupLbl != null) {
|
if (groupLbl != null) {
|
||||||
|
|
|
@ -149,6 +149,8 @@ import com.vividsolutions.jts.geom.Point;
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* 29 June, 2009 2521 dhladky Initial creation
|
* 29 June, 2009 2521 dhladky Initial creation
|
||||||
* 11 Apr. 2012 DR 14522 gzhang Fixing invalid thread error.
|
* 11 Apr. 2012 DR 14522 gzhang Fixing invalid thread error.
|
||||||
|
* 31 July 2012 14517 mpduff Fix for blanking map on update.
|
||||||
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
* @author dhladky
|
* @author dhladky
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
|
@ -376,6 +378,9 @@ public class FFMPResource extends
|
||||||
/** force utility **/
|
/** force utility **/
|
||||||
private FFFGForceUtil forceUtil = null;
|
private FFFGForceUtil forceUtil = null;
|
||||||
|
|
||||||
|
/** Restore Table flag */
|
||||||
|
private boolean restoreTable = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* FFMP resource
|
* FFMP resource
|
||||||
*
|
*
|
||||||
|
@ -2441,7 +2446,8 @@ public class FFMPResource extends
|
||||||
}
|
}
|
||||||
if ((cwaBasins.size() == 0)
|
if ((cwaBasins.size() == 0)
|
||||||
|| !req.extent.equals(drawable.getExt())
|
|| !req.extent.equals(drawable.getExt())
|
||||||
|| !phuc.equals(drawable.getHuc())) {
|
|| !phuc.equals(drawable.getHuc())
|
||||||
|
|| restoreTable) {
|
||||||
Envelope env = null;
|
Envelope env = null;
|
||||||
try {
|
try {
|
||||||
Envelope e = req.descriptor.pixelToWorld(req.extent,
|
Envelope e = req.descriptor.pixelToWorld(req.extent,
|
||||||
|
@ -2466,7 +2472,7 @@ public class FFMPResource extends
|
||||||
templates, getSiteKey(), cwa, phuc);
|
templates, getSiteKey(), cwa, phuc);
|
||||||
for (Entry<Long, Envelope> entry : envMap.entrySet()) {
|
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
|
// add the individual basins
|
||||||
cwaBasins.add(entry.getKey());
|
cwaBasins.add(entry.getKey());
|
||||||
}
|
}
|
||||||
|
@ -2766,6 +2772,10 @@ public class FFMPResource extends
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (restoreTable) {
|
||||||
|
restoreTable = false;
|
||||||
|
}
|
||||||
|
|
||||||
drawable.setTime(req.time);
|
drawable.setTime(req.time);
|
||||||
if (lowestCenter != ZOOM.BASIN) {
|
if (lowestCenter != ZOOM.BASIN) {
|
||||||
drawable.setCenterAggrKey(centeredAggregationKey);
|
drawable.setCenterAggrKey(centeredAggregationKey);
|
||||||
|
@ -3189,6 +3199,7 @@ public class FFMPResource extends
|
||||||
public void restoreTable() {
|
public void restoreTable() {
|
||||||
centeredAggregationKey = null;
|
centeredAggregationKey = null;
|
||||||
centeredAggregatePfafList = null;
|
centeredAggregatePfafList = null;
|
||||||
|
restoreTable = true;
|
||||||
|
|
||||||
lowestCenter = FFMPRecord.ZOOM.WFO;
|
lowestCenter = FFMPRecord.ZOOM.WFO;
|
||||||
getDescriptor().getRenderableDisplay().getExtent().reset();
|
getDescriptor().getRenderableDisplay().getExtent().reset();
|
||||||
|
|
|
@ -41,7 +41,8 @@ import com.raytheon.uf.viz.monitor.ffmp.ui.dialogs.FfmpBasinTableDlg;
|
||||||
*
|
*
|
||||||
* Date Ticket# Engineer Description
|
* 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>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -142,11 +143,13 @@ public class FFMPTableDataLoader extends Thread {
|
||||||
|
|
||||||
// System.out
|
// System.out
|
||||||
// .println(" Cache MISSSSSSSSSSSS!!!!!");
|
// .println(" Cache MISSSSSSSSSSSS!!!!!");
|
||||||
|
|
||||||
|
double origDrawTime = resource.getTime();
|
||||||
FFMPDataGenerator dg = new FFMPDataGenerator(
|
FFMPDataGenerator dg = new FFMPDataGenerator(
|
||||||
ffmp, resource);
|
ffmp, resource);
|
||||||
tData = dg.generateFFMPData();
|
tData = dg.generateFFMPData();
|
||||||
drawable.setTableData(iHuc, tData);
|
drawable.setTableData(iHuc, tData);
|
||||||
drawable.setDrawTime(resource.getTime());
|
drawable.setDrawTime(origDrawTime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
|
@ -79,6 +79,8 @@ import com.vividsolutions.jts.geom.Coordinate;
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Oct 13, 2009 dhladky Initial creation
|
* Oct 13, 2009 dhladky Initial creation
|
||||||
*
|
*
|
||||||
|
* Jul 24 2012 12996 Xiaochuan Compare with MidVal()
|
||||||
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author dhladky
|
* @author dhladky
|
||||||
|
@ -359,7 +361,7 @@ public class ScanResource extends
|
||||||
d = Double.valueOf(rank);
|
d = Double.valueOf(rank);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (d >= getScanDrawer().ddfc.getLowerVal()) {
|
if (d >= getScanDrawer().ddfc.getMidVal()) {
|
||||||
if (!getScanDrawer().ddfc.isOverlap()) {
|
if (!getScanDrawer().ddfc.isOverlap()) {
|
||||||
if ((dtdr != null) && !dtdr.getOverlap()) {
|
if ((dtdr != null) && !dtdr.getOverlap()) {
|
||||||
isOverlap = false;
|
isOverlap = false;
|
||||||
|
|
|
@ -903,27 +903,37 @@ public final class TableUtil {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static TableRowData getSnowMetarHistTableRowData(ObReport report) {
|
private static TableRowData getSnowMetarHistTableRowData(ObReport report) {
|
||||||
TableRowData tblRowData = new TableRowData(8);
|
TableRowData tblRowData = new TableRowData(10);
|
||||||
tblRowData.setTableCellData(0, new TableCellData(report.getObservationTime(),"HH:mm MMM dd",CellType.ObsHist));
|
tblRowData.setTableCellData(0,
|
||||||
|
new TableCellData(report.getObservationTime(), "HH:mm MMM dd",
|
||||||
|
CellType.ObsHist));
|
||||||
tblRowData.setTableCellData(1,
|
tblRowData.setTableCellData(1,
|
||||||
new TableCellData(Math.round(new Float(report.getWindDir())),
|
new TableCellData(new Float(report.getLatitude()),
|
||||||
CellType.ObsHist, true));
|
CellType.ObsHist, true));
|
||||||
tblRowData.setTableCellData(2,
|
tblRowData.setTableCellData(2,
|
||||||
new TableCellData(Math.round(new Float(report.getWindSpeed())),
|
new TableCellData(new Float(report.getLongitude()),
|
||||||
CellType.ObsHist, true));
|
CellType.ObsHist, true));
|
||||||
tblRowData.setTableCellData(3,
|
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())),
|
new TableCellData(Math.round(new Float(report.getWindGust())),
|
||||||
CellType.ObsHist, true));
|
CellType.ObsHist, true));
|
||||||
tblRowData.setTableCellData(4, new TableCellData(report.getPressure(), CellType.ObsHist, CommonTableConfig.obsHistCols.P));
|
tblRowData.setTableCellData(6, new TableCellData(report.getPressure(),
|
||||||
tblRowData.setTableCellData(
|
CellType.ObsHist, CommonTableConfig.obsHistCols.P));
|
||||||
5,
|
tblRowData.setTableCellData(7,
|
||||||
new TableCellData(
|
new TableCellData(
|
||||||
Math.round(new Float(report.getTemperature())),
|
Math.round(new Float(report.getTemperature())),
|
||||||
CellType.ObsHist, true));
|
CellType.ObsHist, true));
|
||||||
tblRowData.setTableCellData(6,
|
tblRowData.setTableCellData(8,
|
||||||
new TableCellData(Math.round(new Float(report.getDewpoint())),
|
new TableCellData(Math.round(new Float(report.getDewpoint())),
|
||||||
CellType.ObsHist, true));
|
CellType.ObsHist, true));
|
||||||
tblRowData.setTableCellData(7, new TableCellData(report.getPressureChange(), CellType.ObsHist, CommonTableConfig.obsHistCols.PTend));
|
tblRowData.setTableCellData(9,
|
||||||
|
new TableCellData(report.getPressureChange(), CellType.ObsHist,
|
||||||
|
CommonTableConfig.obsHistCols.PTend));
|
||||||
return tblRowData;
|
return tblRowData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -932,161 +942,191 @@ public final class TableUtil {
|
||||||
return getSnowMetarHistTableRowData(report);
|
return getSnowMetarHistTableRowData(report);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static TableRowData getSafeseasMaritimeHistTableRowData(ObReport report) {
|
private static TableRowData getSafeseasMaritimeHistTableRowData(
|
||||||
TableRowData tblRowData = new TableRowData(15);
|
ObReport report) {
|
||||||
tblRowData.setTableCellData(0, new TableCellData(report.getObservationTime(),"HH:mm MMM dd",CellType.ObsHist));
|
TableRowData tblRowData = new TableRowData(17);
|
||||||
|
tblRowData.setTableCellData(0,
|
||||||
|
new TableCellData(report.getObservationTime(), "HH:mm MMM dd",
|
||||||
|
CellType.ObsHist));
|
||||||
tblRowData.setTableCellData(1,
|
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())),
|
new TableCellData(Math.round(new Float(report.getWindSpeed())),
|
||||||
CellType.ObsHist, true));
|
CellType.ObsHist, true));
|
||||||
tblRowData.setTableCellData(
|
tblRowData.setTableCellData(
|
||||||
2,
|
4,
|
||||||
new TableCellData(
|
new TableCellData(
|
||||||
Math.round(new Float(report.getMaxWindSpeed())),
|
Math.round(new Float(report.getMaxWindSpeed())),
|
||||||
CellType.ObsHist, true));
|
CellType.ObsHist, true));
|
||||||
tblRowData.setTableCellData(3,
|
tblRowData.setTableCellData(5,
|
||||||
new TableCellData(Math.round(new Float(report.getWindGust())),
|
new TableCellData(Math.round(new Float(report.getWindGust())),
|
||||||
CellType.ObsHist, true));
|
CellType.ObsHist, true));
|
||||||
tblRowData.setTableCellData(4,
|
tblRowData.setTableCellData(6,
|
||||||
new TableCellData(
|
new TableCellData(
|
||||||
Math.round(new Float(report.getVisibility())),
|
Math.round(new Float(report.getVisibility())),
|
||||||
CellType.ObsHist, true));
|
CellType.ObsHist, true));
|
||||||
tblRowData.setTableCellData(5, new TableCellData(report.getPressure(), CellType.ObsHist, CommonTableConfig.obsHistCols.P));
|
tblRowData.setTableCellData(7, new TableCellData(report.getPressure(),
|
||||||
|
CellType.ObsHist, CommonTableConfig.obsHistCols.P));
|
||||||
tblRowData.setTableCellData(
|
tblRowData.setTableCellData(
|
||||||
6,
|
8,
|
||||||
new TableCellData(Math.round(new Float(report
|
new TableCellData(Math.round(new Float(report
|
||||||
.getPressureChange())), CellType.ObsHist, true));
|
.getPressureChange())), CellType.ObsHist, true));
|
||||||
tblRowData.setTableCellData(
|
tblRowData.setTableCellData(
|
||||||
7,
|
9,
|
||||||
new TableCellData(
|
new TableCellData(
|
||||||
Math.round(new Float(report.getTemperature())),
|
Math.round(new Float(report.getTemperature())),
|
||||||
CellType.ObsHist, true));
|
CellType.ObsHist, true));
|
||||||
tblRowData.setTableCellData(8,
|
tblRowData.setTableCellData(10,
|
||||||
new TableCellData(Math.round(new Float(report.getDewpoint())),
|
new TableCellData(Math.round(new Float(report.getDewpoint())),
|
||||||
CellType.ObsHist, true));
|
CellType.ObsHist, true));
|
||||||
tblRowData.setTableCellData(
|
tblRowData.setTableCellData(
|
||||||
9,
|
11,
|
||||||
new TableCellData(Math.round(new Float(report
|
new TableCellData(Math.round(new Float(report
|
||||||
.getSeaSurfaceTemp())), CellType.ObsHist, true));
|
.getSeaSurfaceTemp())), CellType.ObsHist, true));
|
||||||
tblRowData.setTableCellData(
|
tblRowData.setTableCellData(
|
||||||
10,
|
12,
|
||||||
new TableCellData(Math.round(new Float(report
|
new TableCellData(Math.round(new Float(report
|
||||||
.getHighResWaveHeight())), CellType.ObsHist, true));
|
.getHighResWaveHeight())), CellType.ObsHist, true));
|
||||||
tblRowData.setTableCellData(
|
tblRowData.setTableCellData(
|
||||||
11,
|
13,
|
||||||
new TableCellData(Math.round(new Float(report
|
new TableCellData(Math.round(new Float(report
|
||||||
.getWaveSteepness())), CellType.ObsHist, true));
|
.getWaveSteepness())), CellType.ObsHist, true));
|
||||||
tblRowData.setTableCellData(
|
tblRowData.setTableCellData(
|
||||||
12,
|
14,
|
||||||
new TableCellData(
|
new TableCellData(
|
||||||
Math.round(new Float(report.getPSwellHeight())),
|
Math.round(new Float(report.getPSwellHeight())),
|
||||||
CellType.ObsHist, true));
|
CellType.ObsHist, true));
|
||||||
tblRowData.setTableCellData(
|
tblRowData.setTableCellData(
|
||||||
13,
|
15,
|
||||||
new TableCellData(
|
new TableCellData(
|
||||||
Math.round(new Float(report.getPSwellPeriod())),
|
Math.round(new Float(report.getPSwellPeriod())),
|
||||||
CellType.ObsHist, true));
|
CellType.ObsHist, true));
|
||||||
tblRowData.setTableCellData(14,
|
tblRowData.setTableCellData(16,
|
||||||
new TableCellData(Math.round(new Float(report.getPSwellDir())),
|
new TableCellData(Math.round(new Float(report.getPSwellDir())),
|
||||||
CellType.ObsHist, true));
|
CellType.ObsHist, true));
|
||||||
return tblRowData;
|
return tblRowData;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static TableRowData getFogMaritimeHistTableRowData(ObReport report) {
|
private static TableRowData getFogMaritimeHistTableRowData(ObReport report) {
|
||||||
TableRowData tblRowData = new TableRowData(16);
|
TableRowData tblRowData = new TableRowData(18);
|
||||||
tblRowData.setTableCellData(0, new TableCellData(report.getObservationTime(),"HH:mm MMM dd",CellType.ObsHist));
|
tblRowData.setTableCellData(0,
|
||||||
|
new TableCellData(report.getObservationTime(), "HH:mm MMM dd",
|
||||||
|
CellType.ObsHist));
|
||||||
tblRowData.setTableCellData(1,
|
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())),
|
new TableCellData(Math.round(new Float(report.getWindSpeed())),
|
||||||
CellType.ObsHist, true));
|
CellType.ObsHist, true));
|
||||||
tblRowData.setTableCellData(
|
tblRowData.setTableCellData(
|
||||||
2,
|
4,
|
||||||
new TableCellData(
|
new TableCellData(
|
||||||
Math.round(new Float(report.getMaxWindSpeed())),
|
Math.round(new Float(report.getMaxWindSpeed())),
|
||||||
CellType.ObsHist, true));
|
CellType.ObsHist, true));
|
||||||
tblRowData.setTableCellData(3,
|
tblRowData.setTableCellData(5,
|
||||||
new TableCellData(Math.round(new Float(report.getWindGust())),
|
new TableCellData(Math.round(new Float(report.getWindGust())),
|
||||||
CellType.ObsHist, true));
|
CellType.ObsHist, true));
|
||||||
tblRowData.setTableCellData(4,
|
tblRowData.setTableCellData(6,
|
||||||
new TableCellData(
|
new TableCellData(
|
||||||
Math.round(new Float(report.getVisibility())),
|
Math.round(new Float(report.getVisibility())),
|
||||||
CellType.ObsHist, true));
|
CellType.ObsHist, true));
|
||||||
tblRowData.setTableCellData(5, new TableCellData(report.getPressure(), CellType.ObsHist, CommonTableConfig.obsHistCols.P));
|
tblRowData.setTableCellData(7, new TableCellData(report.getPressure(),
|
||||||
|
CellType.ObsHist, CommonTableConfig.obsHistCols.P));
|
||||||
tblRowData.setTableCellData(
|
tblRowData.setTableCellData(
|
||||||
6,
|
8,
|
||||||
new TableCellData(Math.round(new Float(report
|
new TableCellData(Math.round(new Float(report
|
||||||
.getPressureChange())), CellType.ObsHist, true));
|
.getPressureChange())), CellType.ObsHist, true));
|
||||||
tblRowData.setTableCellData(
|
tblRowData.setTableCellData(
|
||||||
7,
|
9,
|
||||||
new TableCellData(
|
new TableCellData(
|
||||||
Math.round(new Float(report.getTemperature())),
|
Math.round(new Float(report.getTemperature())),
|
||||||
CellType.ObsHist, true));
|
CellType.ObsHist, true));
|
||||||
tblRowData.setTableCellData(8,
|
tblRowData.setTableCellData(10,
|
||||||
new TableCellData(Math.round(new Float(report.getDewpoint())),
|
new TableCellData(Math.round(new Float(report.getDewpoint())),
|
||||||
CellType.ObsHist, true));
|
CellType.ObsHist, true));
|
||||||
tblRowData.setTableCellData(
|
tblRowData.setTableCellData(
|
||||||
9,
|
11,
|
||||||
new TableCellData(Math.round(new Float(report
|
new TableCellData(Math.round(new Float(report
|
||||||
.getSeaSurfaceTemp())), CellType.ObsHist, true));
|
.getSeaSurfaceTemp())), CellType.ObsHist, true));
|
||||||
tblRowData.setTableCellData(
|
tblRowData.setTableCellData(
|
||||||
10,
|
12,
|
||||||
new TableCellData(Math.round(new Float(report
|
new TableCellData(Math.round(new Float(report
|
||||||
.getHighResWaveHeight())), CellType.ObsHist, true));
|
.getHighResWaveHeight())), CellType.ObsHist, true));
|
||||||
tblRowData.setTableCellData(
|
tblRowData.setTableCellData(
|
||||||
11,
|
13,
|
||||||
new TableCellData(Math.round(new Float(report
|
new TableCellData(Math.round(new Float(report
|
||||||
.getWaveSteepness())), CellType.ObsHist, true));
|
.getWaveSteepness())), CellType.ObsHist, true));
|
||||||
tblRowData.setTableCellData(
|
tblRowData.setTableCellData(
|
||||||
12,
|
14,
|
||||||
new TableCellData(
|
new TableCellData(
|
||||||
Math.round(new Float(report.getPSwellHeight())),
|
Math.round(new Float(report.getPSwellHeight())),
|
||||||
CellType.ObsHist, true));
|
CellType.ObsHist, true));
|
||||||
tblRowData.setTableCellData(
|
tblRowData.setTableCellData(
|
||||||
13,
|
15,
|
||||||
new TableCellData(
|
new TableCellData(
|
||||||
Math.round(new Float(report.getPSwellPeriod())),
|
Math.round(new Float(report.getPSwellPeriod())),
|
||||||
CellType.ObsHist, true));
|
CellType.ObsHist, true));
|
||||||
tblRowData.setTableCellData(14,
|
tblRowData.setTableCellData(16,
|
||||||
new TableCellData(Math.round(new Float(report.getPSwellDir())),
|
new TableCellData(Math.round(new Float(report.getPSwellDir())),
|
||||||
CellType.ObsHist, true));
|
CellType.ObsHist, true));
|
||||||
tblRowData.setTableCellData(
|
tblRowData.setTableCellData(
|
||||||
15,
|
17,
|
||||||
new TableCellData(Math.round(new Float(report
|
new TableCellData(Math.round(new Float(report
|
||||||
.getRelativeHumidity())), CellType.ObsHist, true));
|
.getRelativeHumidity())), CellType.ObsHist, true));
|
||||||
return tblRowData;
|
return tblRowData;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static TableRowData getFogMetarHistTableRowData(ObReport report) {
|
private static TableRowData getFogMetarHistTableRowData(ObReport report) {
|
||||||
TableRowData tblRowData = new TableRowData(12);
|
TableRowData tblRowData = new TableRowData(14);
|
||||||
tblRowData.setTableCellData(0, new TableCellData(report.getObservationTime(),"HH:mm MMM dd",CellType.ObsHist));
|
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(
|
tblRowData.setTableCellData(
|
||||||
1,
|
3,
|
||||||
new TableCellData(Math.round(new Float(report
|
new TableCellData(Math.round(new Float(report
|
||||||
.getRelativeHumidity())), CellType.ObsHist, true));
|
.getRelativeHumidity())), CellType.ObsHist, true));
|
||||||
tblRowData.setTableCellData(2,
|
tblRowData.setTableCellData(4,
|
||||||
new TableCellData(
|
new TableCellData(
|
||||||
Math.round(new Float(report.getVisibility())),
|
Math.round(new Float(report.getVisibility())),
|
||||||
CellType.ObsHist, true));
|
CellType.ObsHist, true));
|
||||||
tblRowData.setTableCellData(3,
|
tblRowData.setTableCellData(5,
|
||||||
new TableCellData(Math.round(new Float(report.getCeiling())),
|
new TableCellData(Math.round(new Float(report.getCeiling())),
|
||||||
CellType.ObsHist, true));
|
CellType.ObsHist, true));
|
||||||
tblRowData.setTableCellData(4,
|
tblRowData.setTableCellData(6,
|
||||||
new TableCellData(Math.round(new Float(report.getWindDir())),
|
new TableCellData(Math.round(new Float(report.getWindDir())),
|
||||||
CellType.ObsHist, true));
|
CellType.ObsHist, true));
|
||||||
tblRowData.setTableCellData(5,
|
tblRowData.setTableCellData(7,
|
||||||
new TableCellData(Math.round(new Float(report.getWindSpeed())),
|
new TableCellData(Math.round(new Float(report.getWindSpeed())),
|
||||||
CellType.ObsHist, true));
|
CellType.ObsHist, true));
|
||||||
tblRowData.setTableCellData(6,
|
tblRowData.setTableCellData(8,
|
||||||
new TableCellData(Math.round(new Float(report.getWindGust())),
|
new TableCellData(Math.round(new Float(report.getWindGust())),
|
||||||
CellType.ObsHist, true));
|
CellType.ObsHist, true));
|
||||||
tblRowData.setTableCellData(7, new TableCellData(report.getPressure(), CellType.ObsHist, CommonTableConfig.obsHistCols.P));
|
tblRowData.setTableCellData(9, new TableCellData(report.getPressure(),
|
||||||
|
CellType.ObsHist, CommonTableConfig.obsHistCols.P));
|
||||||
int tmph = Math.round(new Float(report.getTemperature()));
|
int tmph = Math.round(new Float(report.getTemperature()));
|
||||||
int dpth = Math.round(new Float(report.getDewpoint()));
|
int dpth = Math.round(new Float(report.getDewpoint()));
|
||||||
tblRowData.setTableCellData(8, new TableCellData(tmph,
|
tblRowData.setTableCellData(10, new TableCellData(tmph,
|
||||||
CellType.ObsHist, true));
|
CellType.ObsHist, true));
|
||||||
tblRowData.setTableCellData(9, new TableCellData(dpth,
|
tblRowData.setTableCellData(11, new TableCellData(dpth,
|
||||||
CellType.ObsHist, true));
|
CellType.ObsHist, true));
|
||||||
tblRowData.setTableCellData(10, new TableCellData(tmph - dpth,
|
tblRowData.setTableCellData(12, new TableCellData(tmph - dpth,
|
||||||
CellType.ObsHist, true));
|
CellType.ObsHist, true));
|
||||||
tblRowData.setTableCellData(11, new TableCellData(report.getPressureChange(), CellType.ObsHist, CommonTableConfig.obsHistCols.PTend));
|
tblRowData.setTableCellData(13,
|
||||||
|
new TableCellData(report.getPressureChange(), CellType.ObsHist,
|
||||||
|
CommonTableConfig.obsHistCols.PTend));
|
||||||
return tblRowData;
|
return tblRowData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -301,7 +301,7 @@ public class StationTableComp extends TableComp {
|
||||||
* @param name
|
* @param name
|
||||||
*/
|
*/
|
||||||
public void setIdLabel(String name) {
|
public void setIdLabel(String name) {
|
||||||
idLbl.setText("Zone/County: " + name);
|
idLbl.setText("Zone/County: "+ this.id +" - "+ name);
|
||||||
controlComp.layout();
|
controlComp.layout();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -67,9 +67,12 @@ import com.vividsolutions.jts.geom.Coordinate;
|
||||||
* replaced deprecated function calls
|
* replaced deprecated function calls
|
||||||
* replaced deprecated function calls
|
* replaced deprecated function calls
|
||||||
* Feb 10, 2011 8030 bkowal access to the plots ArrayList is now synchronized
|
* 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.
|
* 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>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author dhladky
|
* @author dhladky
|
||||||
|
@ -81,6 +84,8 @@ public class ProfilerResource extends
|
||||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||||
.getHandler(ProfilerResource.class);
|
.getHandler(ProfilerResource.class);
|
||||||
|
|
||||||
|
private static final int NUM_PROFILE_STAFFS = 13;
|
||||||
|
|
||||||
/* Graphic target */
|
/* Graphic target */
|
||||||
private IGraphicsTarget target = null;
|
private IGraphicsTarget target = null;
|
||||||
|
|
||||||
|
@ -137,7 +142,7 @@ public class ProfilerResource extends
|
||||||
protected void initInternal(IGraphicsTarget target) throws VizException {
|
protected void initInternal(IGraphicsTarget target) throws VizException {
|
||||||
this.target = target;
|
this.target = target;
|
||||||
dataTimes = new ArrayList<DataTime>();
|
dataTimes = new ArrayList<DataTime>();
|
||||||
incX = (ProfilerUtils.profilerRectangle.width / 12);
|
incX = (ProfilerUtils.profilerRectangle.width / NUM_PROFILE_STAFFS);
|
||||||
|
|
||||||
incYheight = ProfilerUtils.profilerRectangle.height / maxY;
|
incYheight = ProfilerUtils.profilerRectangle.height / maxY;
|
||||||
|
|
||||||
|
@ -222,7 +227,7 @@ public class ProfilerResource extends
|
||||||
earliestTime = Math.min(earliestTime, validTime);
|
earliestTime = Math.min(earliestTime, validTime);
|
||||||
latestTime = Math.max(latestTime, validTime);
|
latestTime = Math.max(latestTime, validTime);
|
||||||
}
|
}
|
||||||
long earliestRequestTime = earliestTime - 12 * 3600000;
|
long earliestRequestTime = earliestTime - NUM_PROFILE_STAFFS * 3600000;
|
||||||
List<DataTime> requestTimes = new ArrayList<DataTime>();
|
List<DataTime> requestTimes = new ArrayList<DataTime>();
|
||||||
for (DataTime time : resourceData.getAvailableTimes()) {
|
for (DataTime time : resourceData.getAvailableTimes()) {
|
||||||
long validTime = time.getValidTime().getTimeInMillis();
|
long validTime = time.getValidTime().getTimeInMillis();
|
||||||
|
@ -343,7 +348,7 @@ public class ProfilerResource extends
|
||||||
if (x < 0) {
|
if (x < 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (x >= 12) {
|
if (x >= NUM_PROFILE_STAFFS) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
ArrayList<PlotObject> plots = entry.getValue();
|
ArrayList<PlotObject> plots = entry.getValue();
|
||||||
|
@ -463,9 +468,10 @@ public class ProfilerResource extends
|
||||||
}
|
}
|
||||||
|
|
||||||
Calendar c = paintProps.getDataTime().getValidTime();
|
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.setText(d, ProfilerUtils.GRAPH_COLOR);
|
||||||
parameters.basics.x = ProfilerUtils.profilerRectangle.x
|
parameters.basics.x = ProfilerUtils.profilerRectangle.x
|
||||||
+ (i * incX) + (incX / 2);
|
+ (i * incX) + (incX / 2);
|
||||||
|
|
|
@ -61,7 +61,6 @@ import com.raytheon.rcm.mqsrvr.ReqObj;
|
||||||
import com.raytheon.rcm.rmr.RmrEvent;
|
import com.raytheon.rcm.rmr.RmrEvent;
|
||||||
import com.raytheon.uf.common.dataplugin.radar.request.RadarServerConnectionRequest;
|
import com.raytheon.uf.common.dataplugin.radar.request.RadarServerConnectionRequest;
|
||||||
import com.raytheon.uf.viz.core.exception.VizException;
|
import com.raytheon.uf.viz.core.exception.VizException;
|
||||||
import com.raytheon.uf.viz.core.preferences.JMSPreferences;
|
|
||||||
import com.raytheon.uf.viz.core.requests.ThriftClient;
|
import com.raytheon.uf.viz.core.requests.ThriftClient;
|
||||||
|
|
||||||
// TODO: use of queueSession outside synchronized(stateLock) could cause
|
// 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
|
// 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 {
|
public class RcmClient implements MessageListener, ExceptionListener {
|
||||||
|
|
||||||
private String connectionURL;
|
private String connectionURL;
|
||||||
|
@ -211,6 +227,11 @@ public class RcmClient implements MessageListener, ExceptionListener {
|
||||||
return;
|
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);
|
ActiveMQConnectionFactory connFac = new ActiveMQConnectionFactory(uri);
|
||||||
// This stuff can block...
|
// This stuff can block...
|
||||||
try {
|
try {
|
||||||
|
@ -238,8 +259,7 @@ public class RcmClient implements MessageListener, ExceptionListener {
|
||||||
topicConn.setExceptionListener(this);
|
topicConn.setExceptionListener(this);
|
||||||
topicSession = topicConn.createTopicSession(false,
|
topicSession = topicConn.createTopicSession(false,
|
||||||
Session.AUTO_ACKNOWLEDGE);
|
Session.AUTO_ACKNOWLEDGE);
|
||||||
topic = topicSession.createTopic(JMSPreferences
|
topic = topicSession.createTopic("RadarEvents");
|
||||||
.getPolicyString("RadarEvents"));
|
|
||||||
|
|
||||||
queueConn.start();
|
queueConn.start();
|
||||||
topicConn.start();
|
topicConn.start();
|
||||||
|
|
|
@ -231,11 +231,13 @@ public abstract class AbstractCrossSectionResource extends
|
||||||
time = time.clone();
|
time = time.clone();
|
||||||
time.setLevelValue((double) i);
|
time.setLevelValue((double) i);
|
||||||
times.add(time);
|
times.add(time);
|
||||||
|
sliceMap.put(time, null);
|
||||||
|
dataRetrievalJob.times.add(time);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dataTimes = new ArrayList<DataTime>(times);
|
dataTimes = new ArrayList<DataTime>(times);
|
||||||
Collections.sort(dataTimes);
|
Collections.sort(dataTimes);
|
||||||
sliceMap.clear();
|
dataRetrievalJob.schedule();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void loadSlice(DataTime time) throws VizException {
|
protected void loadSlice(DataTime time) throws VizException {
|
||||||
|
|
|
@ -138,11 +138,13 @@ public class CrossSectionImageResource extends AbstractCrossSectionResource
|
||||||
super.initInternal(target);
|
super.initInternal(target);
|
||||||
|
|
||||||
// defaults
|
// defaults
|
||||||
|
if (!hasCapability(ImagingCapability.class)) {
|
||||||
ImagingCapability imageCap = getCapability(ImagingCapability.class);
|
ImagingCapability imageCap = getCapability(ImagingCapability.class);
|
||||||
imageCap.setInterpolationState(true);
|
imageCap.setInterpolationState(true);
|
||||||
imageCap.setBrightness(1.0f);
|
imageCap.setBrightness(1.0f);
|
||||||
imageCap.setContrast(1.0f);
|
imageCap.setContrast(1.0f);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private IImage constructImage(float[] floatData, IGraphicsTarget target)
|
private IImage constructImage(float[] floatData, IGraphicsTarget target)
|
||||||
throws VizException {
|
throws VizException {
|
||||||
|
|
|
@ -450,6 +450,7 @@ public abstract class AbstractTimeHeightResource extends
|
||||||
secondaryResource.setDescriptor(descriptor);
|
secondaryResource.setDescriptor(descriptor);
|
||||||
}
|
}
|
||||||
super.setDescriptor(descriptor);
|
super.setDescriptor(descriptor);
|
||||||
|
interpolatedData = null;
|
||||||
loadDataJob.schedule();
|
loadDataJob.schedule();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,7 @@ import java.util.Calendar;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.ListIterator;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.TimeZone;
|
import java.util.TimeZone;
|
||||||
import java.util.TreeSet;
|
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.XYData;
|
||||||
import com.raytheon.viz.core.graphing.xy.XYDataList;
|
import com.raytheon.viz.core.graphing.xy.XYDataList;
|
||||||
import com.raytheon.viz.core.graphing.xy.XYImageData;
|
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;
|
||||||
import com.raytheon.viz.core.rsc.ICombinedResourceData.CombineOperation;
|
import com.raytheon.viz.core.rsc.ICombinedResourceData.CombineOperation;
|
||||||
import com.raytheon.viz.core.style.graph.GraphPreferences;
|
import com.raytheon.viz.core.style.graph.GraphPreferences;
|
||||||
|
@ -157,11 +159,23 @@ public class TimeSeriesResource extends
|
||||||
if (currentUnit.isCompatible(prefs.getDisplayUnits())) {
|
if (currentUnit.isCompatible(prefs.getDisplayUnits())) {
|
||||||
UnitConverter conv = currentUnit.getConverterTo(prefs
|
UnitConverter conv = currentUnit.getConverterTo(prefs
|
||||||
.getDisplayUnits());
|
.getDisplayUnits());
|
||||||
for (XYData d : data.getData()) {
|
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())
|
double converted = conv.convert(((Number) d.getY())
|
||||||
.doubleValue());
|
.doubleValue());
|
||||||
d.setY(converted);
|
d.setY(converted);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
units = prefs.getDisplayUnitLabel();
|
units = prefs.getDisplayUnitLabel();
|
||||||
} else {
|
} else {
|
||||||
units = UnitFormat.getUCUMInstance().format(
|
units = UnitFormat.getUCUMInstance().format(
|
||||||
|
@ -457,13 +471,6 @@ public class TimeSeriesResource extends
|
||||||
String lat = nf.format(Math.abs(y));
|
String lat = nf.format(Math.abs(y));
|
||||||
String stnID = "";
|
String stnID = "";
|
||||||
String source = resourceData.getSource();
|
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) {
|
if (resourceData.getMetadataMap().get("location.stationId") != null) {
|
||||||
stnID = resourceData.getMetadataMap().get("location.stationId")
|
stnID = resourceData.getMetadataMap().get("location.stationId")
|
||||||
|
@ -488,7 +495,7 @@ public class TimeSeriesResource extends
|
||||||
sb.append(" ").append(resourceData.getLevelKey());
|
sb.append(" ").append(resourceData.getLevelKey());
|
||||||
}
|
}
|
||||||
sb.append(String.format(" %s %s %s", adapter.getParameterName(),
|
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) {
|
if (secondaryResource != null) {
|
||||||
|
|
|
@ -26,6 +26,7 @@ import org.eclipse.core.commands.ExecutionException;
|
||||||
import org.eclipse.ui.PlatformUI;
|
import org.eclipse.ui.PlatformUI;
|
||||||
import org.eclipse.ui.commands.ICommandService;
|
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.IDisplayPaneContainer;
|
||||||
import com.raytheon.uf.viz.core.globals.VizGlobalsManager;
|
import com.raytheon.uf.viz.core.globals.VizGlobalsManager;
|
||||||
import com.raytheon.uf.viz.d2d.core.ID2DRenderableDisplay;
|
import com.raytheon.uf.viz.d2d.core.ID2DRenderableDisplay;
|
||||||
|
@ -75,30 +76,29 @@ public class ScaleHandler extends AbstractHandler {
|
||||||
* @param scale
|
* @param scale
|
||||||
*/
|
*/
|
||||||
static void setScale(IDisplayPaneContainer editor, String scale) {
|
static void setScale(IDisplayPaneContainer editor, String scale) {
|
||||||
if (editor.getActiveDisplayPane().getRenderableDisplay() instanceof ID2DRenderableDisplay) {
|
for (IDisplayPane pane : editor.getDisplayPanes()) {
|
||||||
ID2DRenderableDisplay disp = (ID2DRenderableDisplay) editor
|
if (pane.getRenderableDisplay() instanceof ID2DRenderableDisplay) {
|
||||||
.getActiveDisplayPane().getRenderableDisplay();
|
ID2DRenderableDisplay disp = (ID2DRenderableDisplay) pane
|
||||||
|
.getRenderableDisplay();
|
||||||
if (scale.equals(disp.getScale())) {
|
if (scale.equals(disp.getScale())) {
|
||||||
// don't set the scale if it is the same as the display's
|
// don't set the scale if it is the same as the display's
|
||||||
// current
|
// current scale
|
||||||
// scale
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
disp.setScale(scale);
|
disp.setScale(scale);
|
||||||
|
if (pane == editor.getActiveDisplayPane()) {
|
||||||
// update the scale button
|
|
||||||
final ICommandService service = (ICommandService) PlatformUI
|
|
||||||
.getWorkbench().getService(ICommandService.class);
|
|
||||||
|
|
||||||
VizGlobalsManager.getCurrentInstance().updateChanges(
|
VizGlobalsManager.getCurrentInstance().updateChanges(
|
||||||
editor.getActiveDisplayPane().getRenderableDisplay()
|
editor.getActiveDisplayPane()
|
||||||
.getGlobalsMap());
|
.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);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,5 +87,12 @@
|
||||||
value="aviation/config"
|
value="aviation/config"
|
||||||
recursive="true">
|
recursive="true">
|
||||||
</path>
|
</path>
|
||||||
|
<path
|
||||||
|
application="AvnFPS"
|
||||||
|
localizationType="CAVE_STATIC"
|
||||||
|
name="Avnwatch"
|
||||||
|
value="aviation/avnwatch"
|
||||||
|
recursive="true">
|
||||||
|
</path>
|
||||||
</extension>
|
</extension>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
|
@ -55,7 +55,6 @@ import org.eclipse.swt.widgets.MenuItem;
|
||||||
import org.eclipse.swt.widgets.MessageBox;
|
import org.eclipse.swt.widgets.MessageBox;
|
||||||
import org.eclipse.swt.widgets.Shell;
|
import org.eclipse.swt.widgets.Shell;
|
||||||
import org.eclipse.swt.widgets.Spinner;
|
import org.eclipse.swt.widgets.Spinner;
|
||||||
|
|
||||||
import com.raytheon.viz.avncommon.AvnMessageMgr.StatusMessageType;
|
import com.raytheon.viz.avncommon.AvnMessageMgr.StatusMessageType;
|
||||||
import com.raytheon.viz.avnconfig.HelpUsageDlg;
|
import com.raytheon.viz.avnconfig.HelpUsageDlg;
|
||||||
import com.raytheon.viz.avnconfig.ITafSiteConfig;
|
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.
|
* 9/12/2008 1444 grichard Accommodate separate message logs.
|
||||||
* 3/31/2011 8774 rferrel killProcess when doing a disposed
|
* 3/31/2011 8774 rferrel killProcess when doing a disposed
|
||||||
* 4/14/2011 8861 rferrel Use SaveImageDlg class
|
* 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>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -101,14 +102,14 @@ public class WindRosePlotDlg extends CaveSWTDialog {
|
||||||
private List siteList;
|
private List siteList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Month spinner.
|
* Month
|
||||||
*/
|
*/
|
||||||
private Spinner monthSpnr;
|
private Combo monthCbo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Number of months.
|
* Number of months.
|
||||||
*/
|
*/
|
||||||
private Spinner numMonthsSpnr;
|
private Combo numMonthsCbo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Hours spinner.
|
* Hours spinner.
|
||||||
|
@ -427,18 +428,17 @@ public class WindRosePlotDlg extends CaveSWTDialog {
|
||||||
Label monthLbl = new Label(monthHourComp, SWT.NONE);
|
Label monthLbl = new Label(monthHourComp, SWT.NONE);
|
||||||
monthLbl.setText("Month:");
|
monthLbl.setText("Month:");
|
||||||
|
|
||||||
gd = new GridData(40, SWT.DEFAULT);
|
gd = new GridData(66, SWT.DEFAULT);
|
||||||
monthSpnr = new Spinner(monthHourComp, SWT.BORDER);
|
monthCbo = new Combo(monthHourComp, SWT.DROP_DOWN | SWT.READ_ONLY);
|
||||||
monthSpnr.setDigits(0);
|
monthCbo.setLayoutData(gd);
|
||||||
monthSpnr.setIncrement(1);
|
for ( int i = 1; i <= 12; i++ ) {
|
||||||
monthSpnr.setPageIncrement(3);
|
monthCbo.add(""+i, i-1);
|
||||||
monthSpnr.setMinimum(1);
|
}
|
||||||
monthSpnr.setMaximum(12);
|
monthCbo.select(cal.get(Calendar.MONTH));
|
||||||
monthSpnr.setSelection(cal.get(Calendar.MONTH) + 1);
|
monthCbo.addSelectionListener(new SelectionAdapter() {
|
||||||
monthSpnr.setLayoutData(gd);
|
|
||||||
monthSpnr.addSelectionListener(new SelectionAdapter() {
|
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent e) {
|
public void widgetSelected(SelectionEvent e) {
|
||||||
|
//System.out.println(" *************** monthsCbo.getText() = " + monthCbo.getText() );
|
||||||
if (autoRedrawChk.getSelection()) {
|
if (autoRedrawChk.getSelection()) {
|
||||||
redrawWindRose();
|
redrawWindRose();
|
||||||
}
|
}
|
||||||
|
@ -448,18 +448,17 @@ public class WindRosePlotDlg extends CaveSWTDialog {
|
||||||
Label numMonthLbl = new Label(monthHourComp, SWT.NONE);
|
Label numMonthLbl = new Label(monthHourComp, SWT.NONE);
|
||||||
numMonthLbl.setText("Num Months:");
|
numMonthLbl.setText("Num Months:");
|
||||||
|
|
||||||
gd = new GridData(40, SWT.DEFAULT);
|
gd = new GridData(66, SWT.DEFAULT);
|
||||||
numMonthsSpnr = new Spinner(monthHourComp, SWT.BORDER);
|
numMonthsCbo = new Combo(monthHourComp, SWT.DROP_DOWN | SWT.READ_ONLY);
|
||||||
numMonthsSpnr.setDigits(0);
|
numMonthsCbo.setLayoutData(gd);
|
||||||
numMonthsSpnr.setIncrement(1);
|
for ( int i = 1; i <= 12; i++ ) {
|
||||||
numMonthsSpnr.setPageIncrement(3);
|
numMonthsCbo.add(""+i, i-1);
|
||||||
numMonthsSpnr.setMinimum(1);
|
}
|
||||||
numMonthsSpnr.setMaximum(12);
|
numMonthsCbo.select(0);
|
||||||
numMonthsSpnr.setSelection(1);
|
numMonthsCbo.addSelectionListener(new SelectionAdapter() {
|
||||||
numMonthsSpnr.setLayoutData(gd);
|
|
||||||
numMonthsSpnr.addSelectionListener(new SelectionAdapter() {
|
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent e) {
|
public void widgetSelected(SelectionEvent e) {
|
||||||
|
//System.out.println(" *************** numMonthsCbo.getText() = " + numMonthsCbo.getText() );
|
||||||
if (autoRedrawChk.getSelection()) {
|
if (autoRedrawChk.getSelection()) {
|
||||||
redrawWindRose();
|
redrawWindRose();
|
||||||
}
|
}
|
||||||
|
@ -586,8 +585,10 @@ public class WindRosePlotDlg extends CaveSWTDialog {
|
||||||
generateWindRoseHeader();
|
generateWindRoseHeader();
|
||||||
|
|
||||||
windRoseCanvasComp.updateAndRedraw(windRoseConfigData.cloneData(),
|
windRoseCanvasComp.updateAndRedraw(windRoseConfigData.cloneData(),
|
||||||
windRoseHeader, monthSpnr.getText(),
|
windRoseHeader,
|
||||||
numMonthsSpnr.getText(), hourSpnr.getText(),
|
monthCbo.getText(),
|
||||||
|
numMonthsCbo.getText(),
|
||||||
|
hourSpnr.getText(),
|
||||||
numHoursSpnr.getText(), flightCatCbo.getSelectionIndex(),
|
numHoursSpnr.getText(), flightCatCbo.getSelectionIndex(),
|
||||||
siteList.getItem(siteList.getSelectionIndex()), this);
|
siteList.getItem(siteList.getSelectionIndex()), this);
|
||||||
}
|
}
|
||||||
|
@ -599,11 +600,21 @@ public class WindRosePlotDlg extends CaveSWTDialog {
|
||||||
if (state == true) {
|
if (state == true) {
|
||||||
++busyCount;
|
++busyCount;
|
||||||
shell.setCursor(waitCursor);
|
shell.setCursor(waitCursor);
|
||||||
|
monthCbo.setEnabled(false);
|
||||||
|
numMonthsCbo.setEnabled(false);
|
||||||
|
hourSpnr.setEnabled(false);
|
||||||
|
numHoursSpnr.setEnabled(false);
|
||||||
|
flightCatCbo.setEnabled(false);
|
||||||
drawBtn.setEnabled(false);
|
drawBtn.setEnabled(false);
|
||||||
} else {
|
} else {
|
||||||
--busyCount;
|
--busyCount;
|
||||||
if (busyCount == 0) {
|
if (busyCount == 0) {
|
||||||
shell.setCursor(defaultCursor);
|
shell.setCursor(defaultCursor);
|
||||||
|
monthCbo.setEnabled(true);
|
||||||
|
numMonthsCbo.setEnabled(true);
|
||||||
|
hourSpnr.setEnabled(true);
|
||||||
|
numHoursSpnr.setEnabled(true);
|
||||||
|
flightCatCbo.setEnabled(true);
|
||||||
drawBtn.setEnabled(true);
|
drawBtn.setEnabled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -634,23 +645,21 @@ public class WindRosePlotDlg extends CaveSWTDialog {
|
||||||
header.append(siteList.getItem(siteList.getSelectionIndex()));
|
header.append(siteList.getItem(siteList.getSelectionIndex()));
|
||||||
header.append(" ");
|
header.append(" ");
|
||||||
|
|
||||||
header.append(MONTHS[monthSpnr.getSelection() - 1]);
|
header.append(MONTHS[monthCbo.getSelectionIndex()]);
|
||||||
|
|
||||||
if (numMonthsSpnr.getSelection() == 1) {
|
if ( numMonthsCbo.getSelectionIndex() == 0 ) {
|
||||||
header.append(" ");
|
header.append(" ");
|
||||||
} else {
|
} else {
|
||||||
header.append("-");
|
header.append("-");
|
||||||
|
|
||||||
int endMonth = 0;
|
int endMonth = 0;
|
||||||
|
|
||||||
if (((numMonthsSpnr.getSelection() - 1) + monthSpnr.getSelection()) > 12) {
|
if ( ( numMonthsCbo.getSelectionIndex() + monthCbo.getSelectionIndex() ) > 11 ) {
|
||||||
endMonth = (numMonthsSpnr.getSelection() - 1)
|
endMonth = numMonthsCbo.getSelectionIndex() + monthCbo.getSelectionIndex() - 12;
|
||||||
+ monthSpnr.getSelection() - 12;
|
header.append(MONTHS[endMonth]);
|
||||||
header.append(MONTHS[endMonth - 1]);
|
|
||||||
} else {
|
} else {
|
||||||
endMonth = (numMonthsSpnr.getSelection() - 1)
|
endMonth = numMonthsCbo.getSelectionIndex() + monthCbo.getSelectionIndex();
|
||||||
+ monthSpnr.getSelection();
|
header.append(MONTHS[endMonth]);
|
||||||
header.append(MONTHS[endMonth - 1]);
|
|
||||||
}
|
}
|
||||||
header.append(" ");
|
header.append(" ");
|
||||||
}
|
}
|
||||||
|
|
|
@ -213,6 +213,7 @@ import com.raytheon.viz.texteditor.msgs.IAviationObserver;
|
||||||
* 08/12/2011 10612 rferrel saveFile will now always push file back to the server.
|
* 08/12/2011 10612 rferrel saveFile will now always push file back to the server.
|
||||||
* 11/29/2011 11612 rferrel Added getViewerTabList.
|
* 11/29/2011 11612 rferrel Added getViewerTabList.
|
||||||
* 20JUL2012 14570 gzhang/zhao Highlight correct time groups in TAF Viewer
|
* 20JUL2012 14570 gzhang/zhao Highlight correct time groups in TAF Viewer
|
||||||
|
* 08AGU2012 15613 zhao Modified highlightTAF()
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -3676,6 +3677,9 @@ public class TafViewerEditorDlg extends Dialog implements ITafSettable,
|
||||||
ResourceConfigMgr configMgr = ResourceConfigMgr.getInstance();
|
ResourceConfigMgr configMgr = ResourceConfigMgr.getInstance();
|
||||||
String taf = tafViewerStTxt.getText();
|
String taf = tafViewerStTxt.getText();
|
||||||
int offset = taf.indexOf("TAF");
|
int offset = taf.indexOf("TAF");
|
||||||
|
if ( showHeadersChk.getSelection() ) {
|
||||||
|
offset = taf.indexOf("TAF", offset + 3);
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
int end = taf.indexOf("TAF", offset + 3);
|
int end = taf.indexOf("TAF", offset + 3);
|
||||||
if (end > 0) {
|
if (end > 0) {
|
||||||
|
@ -3705,7 +3709,7 @@ public class TafViewerEditorDlg extends Dialog implements ITafSettable,
|
||||||
for (String alertKey : tempoMap.keySet()) {
|
for (String alertKey : tempoMap.keySet()) {
|
||||||
//System.out.println("2___alertKey: "+ alertKey);
|
//System.out.println("2___alertKey: "+ alertKey);
|
||||||
for (String value : tempoMap.get(alertKey)) {
|
for (String value : tempoMap.get(alertKey)) {
|
||||||
System.out.println("3___value: "+ value);
|
//System.out.println("3___value: "+ value);
|
||||||
str.setLength(1);
|
str.setLength(1);
|
||||||
str.append(value);
|
str.append(value);
|
||||||
int len = str.length();
|
int len = str.length();
|
||||||
|
@ -3745,6 +3749,11 @@ public class TafViewerEditorDlg extends Dialog implements ITafSettable,
|
||||||
str.setLength(len);
|
str.setLength(len);
|
||||||
str.append("\n");
|
str.append("\n");
|
||||||
startIndex = taf.indexOf(str.toString());
|
startIndex = taf.indexOf(str.toString());
|
||||||
|
if (startIndex < 0) {
|
||||||
|
str.setLength(len);
|
||||||
|
str.append("=");
|
||||||
|
startIndex = taf.indexOf(str.toString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (startIndex >= 0 /*within the same line*/&& startIndex < endIndex) {
|
if (startIndex >= 0 /*within the same line*/&& startIndex < endIndex) {
|
||||||
|
@ -3983,11 +3992,11 @@ public class TafViewerEditorDlg extends Dialog implements ITafSettable,
|
||||||
// Only load the latest TAF, and assume it is the first one in
|
// Only load the latest TAF, and assume it is the first one in
|
||||||
// the Viewer.
|
// the Viewer.
|
||||||
sb.append(TafUtil.safeFormatTaf(tafsInViewer[0], false));
|
sb.append(TafUtil.safeFormatTaf(tafsInViewer[0], false));
|
||||||
String bbb = "";
|
String originalBbb = "";
|
||||||
String[] header = tafsInViewer[0].getWmoHeader().split(" ");
|
String[] header = tafsInViewer[0].getWmoHeader().split(" ");
|
||||||
|
|
||||||
if (header.length > 3) {
|
if (header.length > 3) {
|
||||||
bbb = header[3];
|
originalBbb = header[3];
|
||||||
}
|
}
|
||||||
|
|
||||||
ITafSiteConfig config = TafSiteConfigFactory.getInstance();
|
ITafSiteConfig config = TafSiteConfigFactory.getInstance();
|
||||||
|
@ -3997,6 +4006,7 @@ public class TafViewerEditorDlg extends Dialog implements ITafSettable,
|
||||||
String stationId = siteData.wmo.split(" ")[1];
|
String stationId = siteData.wmo.split(" ")[1];
|
||||||
String issueTime = header[2];
|
String issueTime = header[2];
|
||||||
|
|
||||||
|
String bbb = "";
|
||||||
if (type == null) {
|
if (type == null) {
|
||||||
// Do nothing
|
// Do nothing
|
||||||
} else if (type == TafSettings.OPEN_AMD) {
|
} else if (type == TafSettings.OPEN_AMD) {
|
||||||
|
|
|
@ -63,7 +63,7 @@ import com.raytheon.viz.aviation.resource.ResourceConfigMgr.ResourceTag;
|
||||||
* and set default value for check hours.
|
* and set default value for check hours.
|
||||||
* 04/28/2011 8065 rferrel Add flag to indicate display is current
|
* 04/28/2011 8065 rferrel Add flag to indicate display is current
|
||||||
* and implement data caching
|
* and implement data caching
|
||||||
* 20JUL2012 14570 gzhang/zhao Added "tempo" to alertMap
|
* 31JUL2012 14570 zhao Highlight Metar alert for case of 'cat'
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -127,6 +127,7 @@ public class MetarViewer extends ViewerTab implements
|
||||||
*/
|
*/
|
||||||
private static final HashMap<String, String[]> alertMap = new HashMap<String, String[]>();
|
private static final HashMap<String, String[]> alertMap = new HashMap<String, String[]>();
|
||||||
static {
|
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("tempo", new String[] { "<vsby>", "</vsby>", "<wind>", "</wind>", "<wx>", "</wx>", "<sky>", "</sky>" }); // 14570
|
||||||
alertMap.put("vsby", new String[] { "<vsby>", "</vsby>" });
|
alertMap.put("vsby", new String[] { "<vsby>", "</vsby>" });
|
||||||
alertMap.put("wind", new String[] { "<wind>", "</wind>" });
|
alertMap.put("wind", new String[] { "<wind>", "</wind>" });
|
||||||
|
@ -410,10 +411,15 @@ public class MetarViewer extends ViewerTab implements
|
||||||
|
|
||||||
if (alertMap != null && alertMap.size() > 0) {
|
if (alertMap != null && alertMap.size() > 0) {
|
||||||
for (String key : alertMap.keySet()) {
|
for (String key : alertMap.keySet()) {
|
||||||
|
if ( key.equals("cat") ) { // "cat" involves "visibility" and "sky condition"
|
||||||
|
colorViewerAlert("vsby", configMgr);
|
||||||
|
colorViewerAlert("sky", configMgr);
|
||||||
|
} else {
|
||||||
colorViewerAlert(key, configMgr);
|
colorViewerAlert(key, configMgr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (String key : alertMap.keySet()) {
|
for (String key : alertMap.keySet()) {
|
||||||
String[] tags = alertMap.get(key);
|
String[] tags = alertMap.get(key);
|
||||||
|
|
|
@ -63,7 +63,7 @@ import com.raytheon.viz.aviation.xml.MonitorCfg;
|
||||||
* May 13, 2011 8611 rferrel Added type to help determine blink state.
|
* May 13, 2011 8611 rferrel Added type to help determine blink state.
|
||||||
* Apr 30, 2012 14717 zhao Indicators turn gray when Metar is outdated
|
* 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
|
* 20JUL2012 14570 gzhang/zhao Modified for highlighting correct time groups in TAF Viewer
|
||||||
*
|
* 11AUG2012 14570 zhao Added 'cat' to alert_key_map
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author lvenable
|
* @author lvenable
|
||||||
|
@ -126,7 +126,8 @@ public class SiteMonitor implements IRequestCompleteListener<Map<?, ?>> {
|
||||||
*/
|
*/
|
||||||
private static final Map<String, String[]> ALERT_KEY_MAP = new HashMap<String, String[]>();
|
private static final Map<String, String[]> ALERT_KEY_MAP = new HashMap<String, String[]>();
|
||||||
{
|
{
|
||||||
ALERT_KEY_MAP.put("tempo", new String[] { "wind", "vsby", "pcp", "obv", "vcnty", "sky" } ); // 14570
|
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("vsby", new String[] { "vsby" });
|
||||||
ALERT_KEY_MAP.put("wind", new String[] { "wind" });
|
ALERT_KEY_MAP.put("wind", new String[] { "wind" });
|
||||||
ALERT_KEY_MAP.put("wx", new String[] { "pcp", "obv", "vcnty" });
|
ALERT_KEY_MAP.put("wx", new String[] { "pcp", "obv", "vcnty" });
|
||||||
|
|
|
@ -49,6 +49,7 @@ import com.raytheon.uf.viz.core.exception.VizException;
|
||||||
* Jul 6, 2010 5792 rferrel getLatestTafs now returns tafs
|
* Jul 6, 2010 5792 rferrel getLatestTafs now returns tafs
|
||||||
* sorted by issue date newest at
|
* sorted by issue date newest at
|
||||||
* the start of the array.
|
* the start of the array.
|
||||||
|
* 08AUG2012 15613 zhao Modified safeFormatTaf()
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -161,12 +162,13 @@ public class TafUtil {
|
||||||
*/
|
*/
|
||||||
public static String safeFormatTaf(TafRecord t, boolean includeHeader) {
|
public static String safeFormatTaf(TafRecord t, boolean includeHeader) {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
if (t != null) {
|
||||||
|
String[] text = t.getTafText().split("[\r\n]");
|
||||||
if (includeHeader) {
|
if (includeHeader) {
|
||||||
sb.append(t.getWmoHeader());
|
sb.append(t.getWmoHeader());
|
||||||
sb.append(LINE_BREAK);
|
sb.append(LINE_BREAK);
|
||||||
|
sb.append("TAF").append(t.getStationId().substring(1,4)).append(LINE_BREAK);
|
||||||
}
|
}
|
||||||
if (t != null) {
|
|
||||||
String[] text = t.getTafText().split("[\r\n]");
|
|
||||||
String firstLine = text[0];
|
String firstLine = text[0];
|
||||||
if (firstLine.startsWith("TAF AMD")
|
if (firstLine.startsWith("TAF AMD")
|
||||||
|| firstLine.startsWith("TAF COR")) {
|
|| firstLine.startsWith("TAF COR")) {
|
||||||
|
@ -191,6 +193,7 @@ public class TafUtil {
|
||||||
sb.append(LINE_BREAK);
|
sb.append(LINE_BREAK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
sb.append(LINE_BREAK);
|
||||||
}
|
}
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,6 +68,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
* 28 FEB 2008 938 lvenable Initial creation.
|
* 28 FEB 2008 938 lvenable Initial creation.
|
||||||
* 4/15/2009 1982 grichard Provide feedback when saving a working TAF.
|
* 4/15/2009 1982 grichard Provide feedback when saving a working TAF.
|
||||||
* 12/08/2011 11745 rferrel Updated header time to transmission time.
|
* 12/08/2011 11745 rferrel Updated header time to transmission time.
|
||||||
|
* 08AUG2012 15613 zhao Determine proper BBB for transmission
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -364,7 +365,7 @@ public class SendDialog extends CaveSWTDialog {
|
||||||
String siteWmoId = tabComp.getWmoId();
|
String siteWmoId = tabComp.getWmoId();
|
||||||
// WMO Site
|
// WMO Site
|
||||||
String siteNode = null;
|
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> tafs = new ArrayList<String>();
|
||||||
ArrayList<String> updatedTafs = new ArrayList<String>();
|
ArrayList<String> updatedTafs = new ArrayList<String>();
|
||||||
|
@ -402,6 +403,16 @@ public class SendDialog extends CaveSWTDialog {
|
||||||
// Site ID
|
// Site ID
|
||||||
String siteId = fourLetterId.substring(1);
|
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.
|
// Update Header Time to transmission time.
|
||||||
tafText = TIMESTAMP_PATTERN.matcher(tafText).replaceFirst(
|
tafText = TIMESTAMP_PATTERN.matcher(tafText).replaceFirst(
|
||||||
xmitTimestamp);
|
xmitTimestamp);
|
||||||
|
@ -418,7 +429,7 @@ public class SendDialog extends CaveSWTDialog {
|
||||||
}
|
}
|
||||||
|
|
||||||
TafQueueRecord record = new TafQueueRecord(forecasterId,
|
TafQueueRecord record = new TafQueueRecord(forecasterId,
|
||||||
xmitTime.getTime(), tafText, bbb, siteId, siteWmoId,
|
xmitTime.getTime(), tafText, xmitBbb, siteId, siteWmoId,
|
||||||
siteNode, xmitTime.getTime());
|
siteNode, xmitTime.getTime());
|
||||||
records.add(record);
|
records.add(record);
|
||||||
}
|
}
|
||||||
|
@ -455,4 +466,41 @@ public class SendDialog extends CaveSWTDialog {
|
||||||
tabComp.setTafSent(tafsQeueued);
|
tabComp.setTafSent(tafsQeueued);
|
||||||
shell.dispose();
|
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";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,7 @@ import java.io.FileInputStream;
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
|
import java.nio.ByteOrder;
|
||||||
import java.nio.channels.FileChannel;
|
import java.nio.channels.FileChannel;
|
||||||
import java.nio.channels.FileChannel.MapMode;
|
import java.nio.channels.FileChannel.MapMode;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -69,6 +70,7 @@ import com.vividsolutions.jts.geom.Coordinate;
|
||||||
* 7/1/06 chammack Initial Creation.
|
* 7/1/06 chammack Initial Creation.
|
||||||
* 1/10/08 562 bphillip Modified to handle .bcx files
|
* 1/10/08 562 bphillip Modified to handle .bcx files
|
||||||
* 02/11/09 njensen Refactored to new rsc architecture
|
* 02/11/09 njensen Refactored to new rsc architecture
|
||||||
|
* 07/31/12 DR 14935 D. Friedman Handle little-endian files
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -190,6 +192,14 @@ public class BCDResource extends
|
||||||
|
|
||||||
ByteBuffer buffer = fc.map(MapMode.READ_ONLY, 0, file.length());
|
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;
|
int i = 0;
|
||||||
|
|
||||||
double minLat = Double.MAX_VALUE;
|
double minLat = Double.MAX_VALUE;
|
||||||
|
|
|
@ -50,10 +50,6 @@
|
||||||
id="com.raytheon.uf.viz.d2d.core.feature"
|
id="com.raytheon.uf.viz.d2d.core.feature"
|
||||||
version="0.0.0"/>
|
version="0.0.0"/>
|
||||||
|
|
||||||
<includes
|
|
||||||
id="com.raytheon.uf.viz.alertviz.localization.feature"
|
|
||||||
version="0.0.0"/>
|
|
||||||
|
|
||||||
<includes
|
<includes
|
||||||
id="com.raytheon.viz.radar.feature"
|
id="com.raytheon.viz.radar.feature"
|
||||||
version="0.0.0"/>
|
version="0.0.0"/>
|
||||||
|
|
|
@ -34,6 +34,7 @@ import org.eclipse.jface.util.IPropertyChangeListener;
|
||||||
import org.eclipse.jface.util.PropertyChangeEvent;
|
import org.eclipse.jface.util.PropertyChangeEvent;
|
||||||
import org.eclipse.jface.util.SafeRunnable;
|
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.IPathManager;
|
||||||
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
|
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
|
||||||
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
|
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
|
||||||
|
@ -76,7 +77,6 @@ public class PythonPreferenceStore implements IPreferenceStore,
|
||||||
|
|
||||||
private String configName;
|
private String configName;
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public PythonPreferenceStore(String configName) {
|
public PythonPreferenceStore(String configName) {
|
||||||
this.propertyChangeListeners = new ArrayList<IPropertyChangeListener>();
|
this.propertyChangeListeners = new ArrayList<IPropertyChangeListener>();
|
||||||
this.configurationChangeListeners = new ArrayList<IConfigurationChangeListener>();
|
this.configurationChangeListeners = new ArrayList<IConfigurationChangeListener>();
|
||||||
|
@ -84,6 +84,7 @@ public class PythonPreferenceStore implements IPreferenceStore,
|
||||||
this.loadConfiguration(configName);
|
this.loadConfiguration(configName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public void loadConfiguration(String configName) {
|
public void loadConfiguration(String configName) {
|
||||||
IPathManager pathMgr = PathManagerFactory.getPathManager();
|
IPathManager pathMgr = PathManagerFactory.getPathManager();
|
||||||
String utilityDir = pathMgr.getFile(
|
String utilityDir = pathMgr.getFile(
|
||||||
|
@ -92,23 +93,14 @@ public class PythonPreferenceStore implements IPreferenceStore,
|
||||||
com.raytheon.uf.common.util.FileUtil.join("gfe", "utility"))
|
com.raytheon.uf.common.util.FileUtil.join("gfe", "utility"))
|
||||||
.getPath();
|
.getPath();
|
||||||
|
|
||||||
String configDir = com.raytheon.uf.common.util.FileUtil.join("gfe",
|
String configPath = GfePyIncludeUtil.getConfigIncludePath();
|
||||||
"userPython", "gfeConfig");
|
String vtecPath = GfePyIncludeUtil.getVtecIncludePath();
|
||||||
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();
|
|
||||||
|
|
||||||
PythonScript py = null;
|
PythonScript py = null;
|
||||||
try {
|
try {
|
||||||
py = new PythonScript(
|
py = new PythonScript(
|
||||||
utilityDir + File.separator + "loadConfig.py",
|
utilityDir + File.separator + "loadConfig.py",
|
||||||
PyUtil.buildJepIncludePath(userDir, siteDir, baseDir));
|
PyUtil.buildJepIncludePath(configPath, vtecPath));
|
||||||
} catch (JepException e) {
|
} catch (JepException e) {
|
||||||
statusHandler.handle(Priority.CRITICAL,
|
statusHandler.handle(Priority.CRITICAL,
|
||||||
"Unable to load GFE config", e);
|
"Unable to load GFE config", e);
|
||||||
|
|
|
@ -121,10 +121,11 @@ public class ConfigCatalog extends AbstractScriptCatalog {
|
||||||
// Look for HideConfigFile = True in the file
|
// Look for HideConfigFile = True in the file
|
||||||
PythonScript pscript = null;
|
PythonScript pscript = null;
|
||||||
try {
|
try {
|
||||||
String includePath = PyUtil
|
String configPath = GfePyIncludeUtil.getConfigIncludePath();
|
||||||
.buildJepIncludePath(GfePyIncludeUtil
|
String vtecPath = GfePyIncludeUtil.getVtecIncludePath();
|
||||||
.getConfigIncludePath());
|
|
||||||
pscript = new PythonScript(file.getAbsolutePath(), includePath,
|
pscript = new PythonScript(file.getAbsolutePath(),
|
||||||
|
PyUtil.buildJepIncludePath(configPath, vtecPath),
|
||||||
getClass().getClassLoader(), preEvals);
|
getClass().getClassLoader(), preEvals);
|
||||||
Boolean scriptValue = (Boolean) pscript.execute(
|
Boolean scriptValue = (Boolean) pscript.execute(
|
||||||
"checkHideConfigFile", null);
|
"checkHideConfigFile", null);
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
**/
|
**/
|
||||||
package com.raytheon.viz.gfe.core;
|
package com.raytheon.viz.gfe.core;
|
||||||
|
|
||||||
import com.raytheon.viz.gfe.core.time.SelectTimeRange;
|
import com.raytheon.uf.common.dataplugin.gfe.time.SelectTimeRange;
|
||||||
import com.raytheon.viz.gfe.core.time.SelectTimeRange.Mode;
|
import com.raytheon.uf.common.dataplugin.gfe.time.SelectTimeRange.Mode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO Add Description
|
* TODO Add Description
|
||||||
|
@ -31,6 +31,7 @@ import com.raytheon.viz.gfe.core.time.SelectTimeRange.Mode;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Dec 3, 2009 randerso Initial creation
|
* Dec 3, 2009 randerso Initial creation
|
||||||
|
* Aug 1, 2012 #965 dgilling Change location of SelectTimeRange.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
|
|
@ -79,12 +79,12 @@ public abstract class AbstractGridData implements IGridData {
|
||||||
|
|
||||||
protected boolean iscCapable = true;
|
protected boolean iscCapable = true;
|
||||||
|
|
||||||
protected Date lastAccessTime;
|
protected long lastAccessTime;
|
||||||
|
|
||||||
protected Grid2DBit changedPoints;
|
protected Grid2DBit changedPoints;
|
||||||
|
|
||||||
protected AbstractGridData(Parm aParm, IGridSlice aSlice) {
|
protected AbstractGridData(Parm aParm, IGridSlice aSlice) {
|
||||||
this.lastAccessTime = SimulatedTime.getSystemTime().getTime();
|
this.lastAccessTime = System.currentTimeMillis();
|
||||||
this.parm = aParm;
|
this.parm = aParm;
|
||||||
this.gridSlice = aSlice;
|
this.gridSlice = aSlice;
|
||||||
// this.gridSlice.setUseCache(true);
|
// this.gridSlice.setUseCache(true);
|
||||||
|
@ -135,7 +135,7 @@ public abstract class AbstractGridData implements IGridData {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Date getLastAccessTime() {
|
public long getLastAccessTime() {
|
||||||
return this.lastAccessTime;
|
return this.lastAccessTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -184,7 +184,7 @@ public abstract class AbstractGridData implements IGridData {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.lastAccessTime = SimulatedTime.getSystemTime().getTime();
|
this.lastAccessTime = System.currentTimeMillis();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -458,7 +458,7 @@ public abstract class AbstractGridData implements IGridData {
|
||||||
public boolean applyDelta(Date time, float delta, boolean taper,
|
public boolean applyDelta(Date time, float delta, boolean taper,
|
||||||
Grid2DBit pointsToChange) {
|
Grid2DBit pointsToChange) {
|
||||||
if (delta == 0.0) {
|
if (delta == 0.0) {
|
||||||
return false; // nothing to change
|
return true; // nothing to change
|
||||||
}
|
}
|
||||||
populate();
|
populate();
|
||||||
checkOkayForEdit();
|
checkOkayForEdit();
|
||||||
|
@ -863,12 +863,12 @@ public abstract class AbstractGridData implements IGridData {
|
||||||
if (!this.isPopulated()) {
|
if (!this.isPopulated()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String msg = "Depopulating " + getParm().getParmID() + " tr="
|
// String msg = "Depopulating " + getParm().getParmID() + " tr="
|
||||||
+ getGridTime();
|
// + getGridTime();
|
||||||
statusHandler.handle(Priority.DEBUG, msg, new Exception("Debug: "
|
// statusHandler.handle(Priority.DEBUG, msg, new Exception("Debug: "
|
||||||
+ msg));
|
// + msg));
|
||||||
|
|
||||||
this.lastAccessTime = SimulatedTime.getSystemTime().getTime();
|
this.lastAccessTime = 0;
|
||||||
setGridSliceDataToNull();
|
setGridSliceDataToNull();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -158,7 +158,7 @@ public interface IGridData extends Comparable<IGridData> {
|
||||||
*
|
*
|
||||||
* @return time the grid was last accessed
|
* @return time the grid was last accessed
|
||||||
*/
|
*/
|
||||||
public Date getLastAccessTime();
|
public long getLastAccessTime();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the time range associated with this grid.
|
* Returns the time range associated with this grid.
|
||||||
|
|
|
@ -32,6 +32,8 @@ import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.TimeZone;
|
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.FileUpdatedMessage;
|
||||||
import com.raytheon.uf.common.localization.ILocalizationFileObserver;
|
import com.raytheon.uf.common.localization.ILocalizationFileObserver;
|
||||||
import com.raytheon.uf.common.localization.IPathManager;
|
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.DataManager;
|
||||||
import com.raytheon.viz.gfe.core.ISelectTimeRangeManager;
|
import com.raytheon.viz.gfe.core.ISelectTimeRangeManager;
|
||||||
import com.raytheon.viz.gfe.core.msgs.SelectTimeRangesChangedMsg;
|
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
|
* 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
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Dec 3, 2009 #3135 randerso Initial creation
|
* Dec 3, 2009 #3135 randerso Initial creation
|
||||||
|
* Aug 1, 2012 #965 dgilling Change location of SelectTimeRange.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
|
|
@ -718,10 +718,7 @@ public class DbParm extends Parm {
|
||||||
continue; // grid overlaps spatial editor time -- skip it
|
continue; // grid overlaps spatial editor time -- skip it
|
||||||
}
|
}
|
||||||
|
|
||||||
long lastAccess = 0;
|
long lastAccess = grid.getLastAccessTime();
|
||||||
if (grid.getLastAccessTime() != null) {
|
|
||||||
lastAccess = grid.getLastAccessTime().getTime();
|
|
||||||
}
|
|
||||||
|
|
||||||
long delta = now - lastAccess;
|
long delta = now - lastAccess;
|
||||||
if (delta < milliseconds) {
|
if (delta < milliseconds) {
|
||||||
|
@ -735,9 +732,10 @@ public class DbParm extends Parm {
|
||||||
|
|
||||||
// only deallocate unlocked grids
|
// only deallocate unlocked grids
|
||||||
if (!locked) {
|
if (!locked) {
|
||||||
String msg = "Deallocating " + getParmID() + " tr=" + gTime;
|
// String msg = "Deallocating " + getParmID() + " tr=" +
|
||||||
statusHandler.handle(Priority.DEBUG, msg, new Exception(
|
// gTime;
|
||||||
"Debug: " + msg));
|
// statusHandler.handle(Priority.DEBUG, msg, new Exception(
|
||||||
|
// "Debug: " + msg));
|
||||||
|
|
||||||
grid.depopulate();
|
grid.depopulate();
|
||||||
}
|
}
|
||||||
|
|
|
@ -304,10 +304,7 @@ public class VCParm extends VParm implements IParmListChangedListener,
|
||||||
continue;
|
continue;
|
||||||
} // grid overlaps spatial editor time -- skip it
|
} // grid overlaps spatial editor time -- skip it
|
||||||
|
|
||||||
long lastAccess = 0;
|
long lastAccess = grid.getLastAccessTime();
|
||||||
if (grid.getLastAccessTime() != null) {
|
|
||||||
lastAccess = grid.getLastAccessTime().getTime();
|
|
||||||
}
|
|
||||||
|
|
||||||
long delta = now - lastAccess;
|
long delta = now - lastAccess;
|
||||||
if (delta < milliseconds) {
|
if (delta < milliseconds) {
|
||||||
|
|
|
@ -158,9 +158,10 @@ public abstract class AbstractSaveParameterDialog extends CaveJFACEDialog
|
||||||
@Override
|
@Override
|
||||||
protected IStatus run(IProgressMonitor monitor) {
|
protected IStatus run(IProgressMonitor monitor) {
|
||||||
long t0 = System.currentTimeMillis();
|
long t0 = System.currentTimeMillis();
|
||||||
|
final AtomicBoolean allSuccessful = new AtomicBoolean(true);
|
||||||
|
try {
|
||||||
final CountDownLatch latch = new CountDownLatch(
|
final CountDownLatch latch = new CountDownLatch(
|
||||||
MAX_CONCURRENT_SAVES);
|
MAX_CONCURRENT_SAVES);
|
||||||
final AtomicBoolean allSuccessful = new AtomicBoolean(true);
|
|
||||||
|
|
||||||
// spawn separate jobs top save parms
|
// spawn separate jobs top save parms
|
||||||
for (int i = 0; i < MAX_CONCURRENT_SAVES; i++) {
|
for (int i = 0; i < MAX_CONCURRENT_SAVES; i++) {
|
||||||
|
@ -177,19 +178,24 @@ public abstract class AbstractSaveParameterDialog extends CaveJFACEDialog
|
||||||
if (statusHandler
|
if (statusHandler
|
||||||
.isPriorityEnabled(Priority.DEBUG)) {
|
.isPriorityEnabled(Priority.DEBUG)) {
|
||||||
statusHandler.handle(
|
statusHandler.handle(
|
||||||
Priority.DEBUG, "Save: "
|
Priority.DEBUG,
|
||||||
+ parmString);
|
"Save: " + parmString);
|
||||||
}
|
}
|
||||||
if (!parm.saveParameter(true)) {
|
if (!parm.saveParameter(true)) {
|
||||||
allSuccessful.set(false);
|
allSuccessful.set(false);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Throwable e) {
|
||||||
allSuccessful.set(false);
|
allSuccessful.set(false);
|
||||||
statusHandler.handle(Priority.ERROR,
|
statusHandler.handle(
|
||||||
|
Priority.ERROR,
|
||||||
"Error occurred saving parm "
|
"Error occurred saving parm "
|
||||||
+ parmString, e);
|
+ parmString, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} catch (Throwable e) {
|
||||||
|
allSuccessful.set(false);
|
||||||
|
statusHandler.handle(Priority.ERROR,
|
||||||
|
e.getLocalizedMessage(), e);
|
||||||
} finally {
|
} finally {
|
||||||
latch.countDown();
|
latch.countDown();
|
||||||
}
|
}
|
||||||
|
@ -199,14 +205,15 @@ public abstract class AbstractSaveParameterDialog extends CaveJFACEDialog
|
||||||
}.schedule();
|
}.schedule();
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
latch.await();
|
latch.await();
|
||||||
} catch (InterruptedException e) {
|
} catch (Throwable e) {
|
||||||
e.printStackTrace();
|
allSuccessful.set(false);
|
||||||
}
|
|
||||||
|
|
||||||
if (!allSuccessful.get()) {
|
|
||||||
statusHandler.handle(Priority.PROBLEM,
|
statusHandler.handle(Priority.PROBLEM,
|
||||||
|
e.getLocalizedMessage(), e);
|
||||||
|
} finally {
|
||||||
|
if (!allSuccessful.get()) {
|
||||||
|
statusHandler
|
||||||
|
.handle(Priority.PROBLEM,
|
||||||
"Some grids were not saved. See log for details.");
|
"Some grids were not saved. See log for details.");
|
||||||
} else {
|
} else {
|
||||||
statusHandler.handle(Priority.DEBUG, "Save Complete");
|
statusHandler.handle(Priority.DEBUG, "Save Complete");
|
||||||
|
@ -216,8 +223,8 @@ public abstract class AbstractSaveParameterDialog extends CaveJFACEDialog
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
AbstractSaveParameterDialog.this.getShell().setCursor(
|
AbstractSaveParameterDialog.this.getShell()
|
||||||
origCursor);
|
.setCursor(origCursor);
|
||||||
AbstractSaveParameterDialog.this
|
AbstractSaveParameterDialog.this
|
||||||
.saveFinished(allSuccessful.get());
|
.saveFinished(allSuccessful.get());
|
||||||
}
|
}
|
||||||
|
@ -226,9 +233,9 @@ public abstract class AbstractSaveParameterDialog extends CaveJFACEDialog
|
||||||
long t1 = System.currentTimeMillis();
|
long t1 = System.currentTimeMillis();
|
||||||
System.out.println("GFE Save Forecast took: " + (t1 - t0)
|
System.out.println("GFE Save Forecast took: " + (t1 - t0)
|
||||||
+ " ms");
|
+ " ms");
|
||||||
|
}
|
||||||
return Status.OK_STATUS;
|
return Status.OK_STATUS;
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
saveJob.setSystem(true);
|
saveJob.setSystem(true);
|
||||||
|
|
|
@ -811,8 +811,14 @@ public class DefineRefSetDialog extends CaveJFACEDialog implements
|
||||||
@Override
|
@Override
|
||||||
public void referenceSetChanged(ReferenceData refSet,
|
public void referenceSetChanged(ReferenceData refSet,
|
||||||
ArrayList<Envelope> domains) {
|
ArrayList<Envelope> domains) {
|
||||||
|
VizApp.runAsync(new Runnable() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
activeChanged();
|
activeChanged();
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
|
@ -822,8 +828,14 @@ public class DefineRefSetDialog extends CaveJFACEDialog implements
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void referenceSetIDChanged(ReferenceID refID) {
|
public void referenceSetIDChanged(ReferenceID refID) {
|
||||||
|
VizApp.runAsync(new Runnable() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
activeChanged();
|
activeChanged();
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
|
@ -838,7 +850,13 @@ public class DefineRefSetDialog extends CaveJFACEDialog implements
|
||||||
java.util.List<ReferenceID> deletions,
|
java.util.List<ReferenceID> deletions,
|
||||||
java.util.List<ReferenceID> changes) {
|
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
|
@Override
|
||||||
public void editAreaGroupInvChanged() {
|
public void editAreaGroupInvChanged() {
|
||||||
this.refreshRefsets();
|
VizApp.runAsync(new Runnable() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
refreshRefsets();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -863,14 +887,16 @@ public class DefineRefSetDialog extends CaveJFACEDialog implements
|
||||||
@Override
|
@Override
|
||||||
public void displayedParmListChanged(Parm[] parms, Parm[] deletions,
|
public void displayedParmListChanged(Parm[] parms, Parm[] deletions,
|
||||||
Parm[] additions) {
|
Parm[] additions) {
|
||||||
refreshParms();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void activeChanged() {
|
|
||||||
VizApp.runAsync(new Runnable() {
|
VizApp.runAsync(new Runnable() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
refreshParms();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void activeChanged() {
|
||||||
// Update display when active refset changes
|
// Update display when active refset changes
|
||||||
ReferenceData refData = refSetMgr.getActiveRefSet();
|
ReferenceData refData = refSetMgr.getActiveRefSet();
|
||||||
|
|
||||||
|
@ -881,8 +907,7 @@ public class DefineRefSetDialog extends CaveJFACEDialog implements
|
||||||
|
|
||||||
// Enable/Disable Undo button
|
// Enable/Disable Undo button
|
||||||
if (!undoButton.isDisposed()) {
|
if (!undoButton.isDisposed()) {
|
||||||
undoButton.setEnabled(!refData.refType().equals(
|
undoButton.setEnabled(!refData.refType().equals(RefType.NONE));
|
||||||
RefType.NONE));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Enable/Disable Convert to Location button
|
// Enable/Disable Convert to Location button
|
||||||
|
@ -890,8 +915,6 @@ public class DefineRefSetDialog extends CaveJFACEDialog implements
|
||||||
convertButton.setEnabled(refData.isQuery());
|
convertButton.setEnabled(refData.isQuery());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private String getActiveRefDesc(ReferenceData refData) {
|
private String getActiveRefDesc(ReferenceData refData) {
|
||||||
String s = "";
|
String s = "";
|
||||||
|
@ -947,10 +970,6 @@ public class DefineRefSetDialog extends CaveJFACEDialog implements
|
||||||
}
|
}
|
||||||
|
|
||||||
private void refreshRefsets() {
|
private void refreshRefsets() {
|
||||||
VizApp.runAsync(new Runnable() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
if (groupList.isDisposed() || editAreasList.isDisposed()) {
|
if (groupList.isDisposed() || editAreasList.isDisposed()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -958,11 +977,9 @@ public class DefineRefSetDialog extends CaveJFACEDialog implements
|
||||||
String[] groups = groupList.getSelection();
|
String[] groups = groupList.getSelection();
|
||||||
|
|
||||||
// Refresh the Group and Areas lists
|
// Refresh the Group and Areas lists
|
||||||
java.util.List<String> availGroups = refSetMgr
|
java.util.List<String> availGroups = refSetMgr.getGroupInventory();
|
||||||
.getGroupInventory();
|
|
||||||
availGroups.add("Misc");
|
availGroups.add("Misc");
|
||||||
groupList.setItems(availGroups.toArray(new String[availGroups
|
groupList.setItems(availGroups.toArray(new String[availGroups.size()]));
|
||||||
.size()]));
|
|
||||||
|
|
||||||
// update selection
|
// update selection
|
||||||
groupList.deselectAll();
|
groupList.deselectAll();
|
||||||
|
@ -977,8 +994,6 @@ public class DefineRefSetDialog extends CaveJFACEDialog implements
|
||||||
String[] areaNames = getAreaNames(groups);
|
String[] areaNames = getAreaNames(groups);
|
||||||
editAreasList.setItems(areaNames);
|
editAreasList.setItems(areaNames);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private void refreshParms() {
|
private void refreshParms() {
|
||||||
this.weatherElementsList.removeAll();
|
this.weatherElementsList.removeAll();
|
||||||
|
|
|
@ -88,6 +88,7 @@ import com.raytheon.viz.ui.dialogs.CaveJFACEDialog;
|
||||||
* practice and test modes
|
* practice and test modes
|
||||||
* Sep 16, 2010 6831 ryu Show same product for different areas on a sub-menu
|
* Sep 16, 2010 6831 ryu Show same product for different areas on a sub-menu
|
||||||
* Nov 22, 2011 8781 mli remove Processor 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>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -776,6 +777,8 @@ public class FormatterLauncherDialog extends CaveJFACEDialog implements
|
||||||
ProductDefinition prodDef = textProductMgr
|
ProductDefinition prodDef = textProductMgr
|
||||||
.getProductDefinition(productName);
|
.getProductDefinition(productName);
|
||||||
String dataSource = (String) prodDef.get("database");
|
String dataSource = (String) prodDef.get("database");
|
||||||
|
if (dataSource == null)
|
||||||
|
dataSource = "Official";
|
||||||
|
|
||||||
if (dataSource.equals("ISC")) {
|
if (dataSource.equals("ISC")) {
|
||||||
selectedDataSource = getIscDataSource();
|
selectedDataSource = getIscDataSource();
|
||||||
|
|
|
@ -41,17 +41,15 @@ import org.eclipse.swt.widgets.Label;
|
||||||
import org.eclipse.swt.widgets.Shell;
|
import org.eclipse.swt.widgets.Shell;
|
||||||
import org.eclipse.swt.widgets.Text;
|
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.localization.LocalizationContext.LocalizationLevel;
|
||||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||||
import com.raytheon.uf.common.status.UFStatus;
|
import com.raytheon.uf.common.status.UFStatus;
|
||||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||||
import com.raytheon.uf.common.time.SimulatedTime;
|
import com.raytheon.uf.common.time.SimulatedTime;
|
||||||
import com.raytheon.viz.gfe.Activator;
|
|
||||||
import com.raytheon.viz.gfe.GFEServerException;
|
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.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.dialogs.CaveJFACEDialog;
|
||||||
import com.raytheon.viz.ui.widgets.SpinScale;
|
import com.raytheon.viz.ui.widgets.SpinScale;
|
||||||
|
|
||||||
|
@ -64,6 +62,7 @@ import com.raytheon.viz.ui.widgets.SpinScale;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Dec 7, 2009 randerso Initial creation
|
* Dec 7, 2009 randerso Initial creation
|
||||||
|
* Aug 1, 2012 #965 dgilling Change location of SelectTimeRange.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -72,7 +71,8 @@ import com.raytheon.viz.ui.widgets.SpinScale;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class SaveDeleteSelectTRDialog extends CaveJFACEDialog {
|
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;
|
private DataManager dataManager;
|
||||||
|
|
||||||
|
|
|
@ -115,6 +115,8 @@ import com.vividsolutions.jts.geom.LineString;
|
||||||
* Jul 29, 2009 randerso Initial creation
|
* Jul 29, 2009 randerso Initial creation
|
||||||
* Jul 02, 2010 6285 mpduff Fixed contours to update after
|
* Jul 02, 2010 6285 mpduff Fixed contours to update after
|
||||||
* drawing and calculating new grid.
|
* drawing and calculating new grid.
|
||||||
|
* Aug 08, 2012 #621 dgilling Fix ConcurrentModificationException
|
||||||
|
* in handling of renderables field.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -323,6 +325,9 @@ public class ContourTool extends AbstractFreeformTool implements
|
||||||
*/
|
*/
|
||||||
private void replaceCLines(List<CLine> contours) {
|
private void replaceCLines(List<CLine> contours) {
|
||||||
clearRenderables();
|
clearRenderables();
|
||||||
|
|
||||||
|
List<IRenderable> renderables = new ArrayList<IRenderable>(
|
||||||
|
this.renderables);
|
||||||
renderables.add(freeformRenderable);
|
renderables.add(freeformRenderable);
|
||||||
|
|
||||||
if (currentGrid != null) {
|
if (currentGrid != null) {
|
||||||
|
@ -353,26 +358,34 @@ public class ContourTool extends AbstractFreeformTool implements
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
renderables.add(renderable);
|
renderables.add(renderable);
|
||||||
refresh();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.renderables = renderables;
|
||||||
|
refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void disposeRenderables() {
|
private void disposeRenderables() {
|
||||||
|
List<IRenderable> renderables = new ArrayList<IRenderable>(
|
||||||
|
this.renderables);
|
||||||
for (IRenderable renderable : renderables) {
|
for (IRenderable renderable : renderables) {
|
||||||
if (renderable instanceof JTSRenderable) {
|
if (renderable instanceof JTSRenderable) {
|
||||||
((JTSRenderable) renderable).dispose();
|
((JTSRenderable) renderable).dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
renderables.clear();
|
renderables.clear();
|
||||||
|
this.renderables = renderables;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void clearRenderables() {
|
private void clearRenderables() {
|
||||||
|
List<IRenderable> renderables = new ArrayList<IRenderable>(
|
||||||
|
this.renderables);
|
||||||
for (IRenderable renderable : renderables) {
|
for (IRenderable renderable : renderables) {
|
||||||
if (renderable instanceof JTSRenderable) {
|
if (renderable instanceof JTSRenderable) {
|
||||||
((JTSRenderable) renderable).clear();
|
((JTSRenderable) renderable).clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
renderables.clear();
|
renderables.clear();
|
||||||
|
this.renderables = renderables;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initializeContourData(IGridData grid) {
|
private void initializeContourData(IGridData grid) {
|
||||||
|
|
|
@ -66,6 +66,8 @@ import com.vividsolutions.jts.geom.Coordinate;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* 04/08/2008 chammack Initial Port from AWIPS I (minus ISC support)
|
* 04/08/2008 chammack Initial Port from AWIPS I (minus ISC support)
|
||||||
|
* 07/23/2012 #936 dgilling Reinstate config-handling code to
|
||||||
|
* calcGridLabels().
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -253,7 +255,7 @@ public class SamplePainter {
|
||||||
private void calcGridLabels(Coordinate worldLoc, final List<GridID> grids,
|
private void calcGridLabels(Coordinate worldLoc, final List<GridID> grids,
|
||||||
final GridID imageGrid, List<String> sampleLabels, List<RGB> colors) {
|
final GridID imageGrid, List<String> sampleLabels, List<RGB> colors) {
|
||||||
|
|
||||||
if (grids.size() == 0) {
|
if (grids.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -261,9 +263,9 @@ public class SamplePainter {
|
||||||
// all parms
|
// all parms
|
||||||
List<String> limitSamples = Arrays.asList(Activator.getDefault()
|
List<String> limitSamples = Arrays.asList(Activator.getDefault()
|
||||||
.getPreferenceStore().getStringArray("SampleParms"));
|
.getPreferenceStore().getStringArray("SampleParms"));
|
||||||
|
|
||||||
// assumes all grids shared same grid location.
|
// assumes all grids shared same grid location.
|
||||||
boolean inGrid = false;
|
boolean inGrid = false;
|
||||||
|
|
||||||
Coordinate gridCoordinate = MapUtil.latLonToGridCoordinate(worldLoc,
|
Coordinate gridCoordinate = MapUtil.latLonToGridCoordinate(worldLoc,
|
||||||
PixelOrientation.UPPER_LEFT, grids.get(0).getParm()
|
PixelOrientation.UPPER_LEFT, grids.get(0).getParm()
|
||||||
.getGridInfo().getGridLoc());
|
.getGridInfo().getGridLoc());
|
||||||
|
@ -280,27 +282,41 @@ public class SamplePainter {
|
||||||
inGrid = true;
|
inGrid = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// sample label color
|
|
||||||
RGB labelColor = new RGB(255, 255, 255);
|
|
||||||
|
|
||||||
// get the list of samples that should be painted and in the
|
// get the list of samples that should be painted and in the
|
||||||
// order
|
// order
|
||||||
for (GridID grid : grids) {
|
for (GridID grid : grids) {
|
||||||
String pName = grid.getParm().getParmID().compositeNameUI();
|
String pName = grid.getParm().getParmID().compositeNameUI();
|
||||||
|
|
||||||
// do we plot this weather element?
|
// do we plot this weather element?
|
||||||
if ((limitSamples.size() != 0) && !limitSamples.contains(pName)) {
|
if ((!limitSamples.isEmpty()) && !limitSamples.contains(pName)) {
|
||||||
continue; // skip
|
continue; // skip
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// calculate color
|
||||||
|
RGB labelColor = grid.getParm().getDisplayAttributes()
|
||||||
|
.getBaseColor();
|
||||||
|
|
||||||
|
if (grid.equals(imageGrid)) {
|
||||||
|
RGB color = new RGB(255, 255, 255);
|
||||||
|
String colorName = Activator.getDefault().getPreferenceStore()
|
||||||
|
.getString("ImageLegend_color");
|
||||||
|
if (!colorName.isEmpty()) {
|
||||||
|
color = RGBColors.getRGBColor(colorName);
|
||||||
|
}
|
||||||
|
labelColor = color;
|
||||||
|
}
|
||||||
|
String parmColorName = Activator.getDefault().getPreferenceStore()
|
||||||
|
.getString(pName + "_Sample_color");
|
||||||
|
if (!parmColorName.isEmpty()) {
|
||||||
|
labelColor = RGBColors.getRGBColor(parmColorName);
|
||||||
|
}
|
||||||
|
|
||||||
// get the data value
|
// get the data value
|
||||||
String label = NO_DATA_LABEL;
|
String label = NO_DATA_LABEL;
|
||||||
if (inGrid) {
|
if (inGrid) {
|
||||||
|
|
||||||
// isc mode or grid from isc database
|
// isc mode or grid from isc database
|
||||||
if (showISC || grid.getParm().getParmState().isIscParm()) {
|
if (showISC || grid.getParm().getParmState().isIscParm()) {
|
||||||
label = iscSampleLabel(grid, gridCoordinate);
|
label = iscSampleLabel(grid, gridCoordinate);
|
||||||
|
|
||||||
} else if (showDataValues) {
|
} else if (showDataValues) {
|
||||||
final IGridData gridData = grid.grid();
|
final IGridData gridData = grid.grid();
|
||||||
if (gridData != null) {
|
if (gridData != null) {
|
||||||
|
|
|
@ -38,6 +38,7 @@ import com.raytheon.viz.gfe.core.msgs.Message;
|
||||||
import com.raytheon.viz.gfe.core.msgs.Message.IMessageClient;
|
import com.raytheon.viz.gfe.core.msgs.Message.IMessageClient;
|
||||||
import com.raytheon.viz.gfe.core.msgs.ShowQuickViewDataMsg;
|
import com.raytheon.viz.gfe.core.msgs.ShowQuickViewDataMsg;
|
||||||
import com.raytheon.viz.gfe.core.parm.Parm;
|
import com.raytheon.viz.gfe.core.parm.Parm;
|
||||||
|
import com.raytheon.viz.gfe.core.parm.ParmDisplayAttributes.VisMode;
|
||||||
import com.raytheon.viz.gfe.edittool.EditToolPaintProperties;
|
import com.raytheon.viz.gfe.edittool.EditToolPaintProperties;
|
||||||
import com.raytheon.viz.gfe.edittool.GridID;
|
import com.raytheon.viz.gfe.edittool.GridID;
|
||||||
import com.raytheon.viz.gfe.rsc.GFEFonts;
|
import com.raytheon.viz.gfe.rsc.GFEFonts;
|
||||||
|
@ -45,16 +46,18 @@ import com.vividsolutions.jts.geom.Coordinate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles the display for on-demand sampling capability.
|
* Handles the display for on-demand sampling capability.
|
||||||
*
|
* <p>
|
||||||
* Roughly based on AWIPS I class of the same name.
|
* Roughly based on AWIPS I class SampleVisual.
|
||||||
*
|
*
|
||||||
* <pre>
|
* <pre>
|
||||||
* SOFTWARE HISTORY
|
* SOFTWARE HISTORY
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* 04/08/2008 chammack Initial Creation.
|
* 04/08/2008 chammack Initial Creation.
|
||||||
* 11Jun2008 #1193 ebabin Updates for toggling lat/lon for sample set.
|
* 06/11/2008 #1193 ebabin Updates for toggling lat/lon for sample set.
|
||||||
* 07/21/2009 bphillip Removed the points field
|
* 07/21/2009 bphillip Removed the points field
|
||||||
|
* 07/23/2012 #936 dgilling Properly retrieve imageGrid for paintMarkers()
|
||||||
|
* and paintSamples().
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -148,13 +151,17 @@ public class SampleRenderable implements IRenderable, IMessageClient {
|
||||||
imageGrid = qvGrid;
|
imageGrid = qvGrid;
|
||||||
} else {
|
} else {
|
||||||
Parm[] parms = sdm.getCurrentlyEnabledParms();
|
Parm[] parms = sdm.getCurrentlyEnabledParms();
|
||||||
Parm imageParm = sdm.getActivatedParm();
|
Parm imageParm = null;
|
||||||
Arrays.sort(parms);
|
Arrays.sort(parms);
|
||||||
gids = new ArrayList<GridID>(parms.length);
|
gids = new ArrayList<GridID>(parms.length);
|
||||||
|
|
||||||
Date date = sdm.getSpatialEditorTime();
|
Date date = sdm.getSpatialEditorTime();
|
||||||
for (int i = 0; i < parms.length; i++) {
|
|
||||||
gids.add(new GridID(parms[i], date));
|
for (Parm p : parms) {
|
||||||
|
gids.add(new GridID(p, date));
|
||||||
|
|
||||||
|
if (p.getDisplayAttributes().getVisMode() == VisMode.IMAGE) {
|
||||||
|
imageParm = p;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
imageGrid = new GridID(imageParm, date);
|
imageGrid = new GridID(imageParm, date);
|
||||||
|
@ -184,12 +191,16 @@ public class SampleRenderable implements IRenderable, IMessageClient {
|
||||||
|
|
||||||
Date date = sdm.getSpatialEditorTime();
|
Date date = sdm.getSpatialEditorTime();
|
||||||
Parm[] parms = sdm.getCurrentlyEnabledParms();
|
Parm[] parms = sdm.getCurrentlyEnabledParms();
|
||||||
Parm imageParm = sdm.getActivatedParm();
|
Parm imageParm = null;
|
||||||
|
|
||||||
Arrays.sort(parms);
|
Arrays.sort(parms);
|
||||||
GridID[] grids = new GridID[parms.length];
|
GridID[] grids = new GridID[parms.length];
|
||||||
for (int i = 0; i < parms.length; i++) {
|
for (int i = 0; i < parms.length; i++) {
|
||||||
grids[i] = new GridID(parms[i], date);
|
grids[i] = new GridID(parms[i], date);
|
||||||
|
|
||||||
|
if (parms[i].getDisplayAttributes().getVisMode() == VisMode.IMAGE) {
|
||||||
|
imageParm = parms[i];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GridID imageGrid = new GridID(imageParm, date);
|
GridID imageGrid = new GridID(imageParm, date);
|
||||||
|
|
|
@ -647,13 +647,14 @@ public class GridBar implements IMessageClient, IParmInventoryChangedListener,
|
||||||
Rectangle rect = computeRect(dataTR);
|
Rectangle rect = computeRect(dataTR);
|
||||||
|
|
||||||
gc.setFont(timeBlockSourceFont);
|
gc.setFont(timeBlockSourceFont);
|
||||||
|
gc.setTextAntialias(SWT.OFF);
|
||||||
String s = truncateLabelToFit(gc, text, rect.width);
|
String s = truncateLabelToFit(gc, text, rect.width);
|
||||||
Point textSize = gc.stringExtent(s);
|
Point textSize = gc.stringExtent(s);
|
||||||
|
|
||||||
if (textSize.x < rect.width + DATA_BLOCK_HORIZONTAL_MARGIN) {
|
if (textSize.x < rect.width + DATA_BLOCK_HORIZONTAL_MARGIN) {
|
||||||
int xOffset = (rect.width - textSize.x) / 2;
|
int xOffset = (rect.width - textSize.x) / 2;
|
||||||
int yOffset = (rect.height - textSize.y) / 2;
|
int yOffset = (rect.height - textSize.y) / 2;
|
||||||
gc.drawString(s, rect.x + xOffset, rect.y + yOffset, false);
|
gc.drawString(s, rect.x + xOffset, rect.y + yOffset, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -603,7 +603,9 @@ public class Tool {
|
||||||
parmToEdit.startParmEdit(new Date[] { timeInfluence });
|
parmToEdit.startParmEdit(new Date[] { timeInfluence });
|
||||||
} catch (GFEOperationFailedException e) {
|
} catch (GFEOperationFailedException e) {
|
||||||
statusHandler.handle(Priority.PROBLEM,
|
statusHandler.handle(Priority.PROBLEM,
|
||||||
"Error during start parm edit", e);
|
"Error during start parm edit for " + toolName + " - already running." +
|
||||||
|
" Please wait for the operation to complete and try again.",
|
||||||
|
e);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
startedParmEdit = true;
|
startedParmEdit = true;
|
||||||
|
|
|
@ -2422,12 +2422,12 @@
|
||||||
<imageStyle>
|
<imageStyle>
|
||||||
<displayUnits>%</displayUnits>
|
<displayUnits>%</displayUnits>
|
||||||
<range scale="LINEAR">
|
<range scale="LINEAR">
|
||||||
<minValue>5</minValue>
|
<minValue>-1</minValue>
|
||||||
<maxValue>105</maxValue>
|
<maxValue>105</maxValue>
|
||||||
</range>
|
</range>
|
||||||
<defaultColormap>Grid/warm to cold</defaultColormap>
|
<defaultColormap>Grid/warm to cold</defaultColormap>
|
||||||
<colorbarLabeling>
|
<colorbarLabeling>
|
||||||
<increment>20</increment>
|
<values>20 40 60 80 100</values>
|
||||||
</colorbarLabeling>
|
</colorbarLabeling>
|
||||||
</imageStyle>
|
</imageStyle>
|
||||||
</styleRule>
|
</styleRule>
|
||||||
|
|
|
@ -162,6 +162,7 @@ public class GridResourceData extends AbstractRequestableResourceData implements
|
||||||
sampling = sampling == null ? false : sampling;
|
sampling = sampling == null ? false : sampling;
|
||||||
return new GridIconResource(this, loadProperties);
|
return new GridIconResource(this, loadProperties);
|
||||||
case BARB:
|
case BARB:
|
||||||
|
sampling = sampling == null ? false : sampling;
|
||||||
case ARROW:
|
case ARROW:
|
||||||
case DUALARROW:
|
case DUALARROW:
|
||||||
case STREAMLINE:
|
case STREAMLINE:
|
||||||
|
@ -170,7 +171,7 @@ public class GridResourceData extends AbstractRequestableResourceData implements
|
||||||
// grib data in D2D is in one location. There are only a few
|
// grib data in D2D is in one location. There are only a few
|
||||||
// products that do not work correctly, contours of vector
|
// products that do not work correctly, contours of vector
|
||||||
// direction, and data mapped images.
|
// direction, and data mapped images.
|
||||||
sampling = sampling == null ? false : sampling;
|
sampling = sampling == null ? true : sampling;
|
||||||
return new D2DGribGridResource(this, loadProperties);
|
return new D2DGribGridResource(this, loadProperties);
|
||||||
case CONTOUR:
|
case CONTOUR:
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -109,6 +109,7 @@ import com.vividsolutions.jts.geom.Coordinate;
|
||||||
* 05/16/2012 14993 D. Friedman Fix "blocky" contours
|
* 05/16/2012 14993 D. Friedman Fix "blocky" contours
|
||||||
* 06/19/2012 14988 D. Friedman Reproject based on conformality
|
* 06/19/2012 14988 D. Friedman Reproject based on conformality
|
||||||
* 07/09/2012 14940 M. Porricelli Apply reprojection to streamlines
|
* 07/09/2012 14940 M. Porricelli Apply reprojection to streamlines
|
||||||
|
* 07/23/2012 14968 M. Porricelli Changed wording of streamline legend
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -491,7 +492,7 @@ public class GridVectorResource extends AbstractMapVectorResource implements
|
||||||
legendParams.dataTime = getDisplayedDataTime();
|
legendParams.dataTime = getDisplayedDataTime();
|
||||||
|
|
||||||
if (displayType == DisplayType.STREAMLINE) {
|
if (displayType == DisplayType.STREAMLINE) {
|
||||||
legendParams.type = " Streamlines";
|
legendParams.type = " Strmlns";
|
||||||
} else if (displayType == DisplayType.BARB) {
|
} else if (displayType == DisplayType.BARB) {
|
||||||
legendParams.type = "Wind Barbs";
|
legendParams.type = "Wind Barbs";
|
||||||
} else if (displayType == DisplayType.ARROW) {
|
} else if (displayType == DisplayType.ARROW) {
|
||||||
|
@ -526,7 +527,7 @@ public class GridVectorResource extends AbstractMapVectorResource implements
|
||||||
legendParams.dataTime = getDisplayedDataTime();
|
legendParams.dataTime = getDisplayedDataTime();
|
||||||
|
|
||||||
if (displayType == DisplayType.STREAMLINE) {
|
if (displayType == DisplayType.STREAMLINE) {
|
||||||
legendParams.type = " Streamlines";
|
legendParams.type = " Strmlns";
|
||||||
} else if (displayType == DisplayType.BARB) {
|
} else if (displayType == DisplayType.BARB) {
|
||||||
legendParams.type = "Wind Barbs";
|
legendParams.type = "Wind Barbs";
|
||||||
} else if (displayType == DisplayType.ARROW) {
|
} else if (displayType == DisplayType.ARROW) {
|
||||||
|
|
|
@ -74,6 +74,8 @@ import com.vividsolutions.jts.geom.Coordinate;
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Mar 9, 2011 bsteffen Initial creation
|
* Mar 9, 2011 bsteffen Initial creation
|
||||||
* 06/19/2012 14988 D. Friedman Reproject based on conformality
|
* 06/19/2012 14988 D. Friedman Reproject based on conformality
|
||||||
|
* 07/23/2012 14968 M. Porricelli Changed wording of streamline
|
||||||
|
* legend
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -258,7 +260,7 @@ public class D2DGribGridResource extends GribGridResource<GridResourceData>
|
||||||
// The default type does not display in the legend
|
// The default type does not display in the legend
|
||||||
legendParams.type = "";
|
legendParams.type = "";
|
||||||
} else if (displayType == DisplayType.STREAMLINE) {
|
} else if (displayType == DisplayType.STREAMLINE) {
|
||||||
legendParams.type = "Streamlines";
|
legendParams.type = "Strmlns";
|
||||||
} else if (displayType == DisplayType.BARB) {
|
} else if (displayType == DisplayType.BARB) {
|
||||||
legendParams.type = "Wind Barbs";
|
legendParams.type = "Wind Barbs";
|
||||||
} else if (displayType == DisplayType.ARROW) {
|
} else if (displayType == DisplayType.ARROW) {
|
||||||
|
|
|
@ -237,7 +237,7 @@ public class FlashFloodGuidanceDlg extends CaveSWTDialog {
|
||||||
/**
|
/**
|
||||||
* The duration in millis being displayed.
|
* The duration in millis being displayed.
|
||||||
*/
|
*/
|
||||||
private int duration;
|
private int duration = 3600;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the display string and insert time for later use.
|
* Holds the display string and insert time for later use.
|
||||||
|
@ -1126,7 +1126,7 @@ public class FlashFloodGuidanceDlg extends CaveSWTDialog {
|
||||||
String day = parts[2];
|
String day = parts[2];
|
||||||
String date = parts[3];
|
String date = parts[3];
|
||||||
String hour = parts[4];
|
String hour = parts[4];
|
||||||
duration = Integer.parseInt(durationStr) * FFGConstants.MILLIS_PER_HOUR;
|
duration = Integer.parseInt(durationStr) * FFGConstants.SECONDS_PER_HOUR;
|
||||||
|
|
||||||
String paramAbr = "FFG" + durationStr + "24hr";
|
String paramAbr = "FFG" + durationStr + "24hr";
|
||||||
|
|
||||||
|
|
|
@ -343,24 +343,21 @@ public class MultiPointResource extends
|
||||||
Coordinate xy = new Coordinate(gage.getLon(), gage.getLat());
|
Coordinate xy = new Coordinate(gage.getLon(), gage.getLat());
|
||||||
gage.setCoordinate(xy);
|
gage.setCoordinate(xy);
|
||||||
|
|
||||||
double latInc = .05;
|
/* Create a small envelope around the point */
|
||||||
double lonInc = .03;
|
double shiftHeightValue = getShiftHeight(gage);
|
||||||
|
double shiftWidthValue = getShiftWidth(gage);
|
||||||
|
|
||||||
if (existing != null) {
|
if (existing != null) {
|
||||||
Coordinate p1 = new Coordinate(existing.getLon() + lonInc,
|
PixelExtent pe = getPixelExtent(existing, getShiftWidth(existing),
|
||||||
existing.getLat() + latInc);
|
getShiftHeight(existing));
|
||||||
Coordinate p2 = new Coordinate(existing.getLon() - lonInc,
|
Envelope oldEnv = descriptor.pixelToWorld(pe);
|
||||||
existing.getLat() - latInc);
|
|
||||||
Envelope oldEnv = new Envelope(p1, p2);
|
|
||||||
strTree.remove(oldEnv, existing);
|
strTree.remove(oldEnv, existing);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Create a small envelope around the point */
|
/* Create a small envelope around the point */
|
||||||
Coordinate p1 = new Coordinate(gage.getLon() + lonInc,
|
PixelExtent pe = getPixelExtent(gage, getShiftWidth(gage),
|
||||||
gage.getLat() + latInc);
|
getShiftHeight(gage));
|
||||||
Coordinate p2 = new Coordinate(gage.getLon() - lonInc,
|
Envelope newEnv = descriptor.pixelToWorld(pe);
|
||||||
gage.getLat() - latInc);
|
|
||||||
Envelope newEnv = new Envelope(p1, p2);
|
|
||||||
|
|
||||||
strTree.insert(newEnv, gage);
|
strTree.insert(newEnv, gage);
|
||||||
dataMap.put(lid, gage);
|
dataMap.put(lid, gage);
|
||||||
|
@ -871,12 +868,19 @@ public class MultiPointResource extends
|
||||||
Envelope env = new Envelope(coord.asLatLon());
|
Envelope env = new Envelope(coord.asLatLon());
|
||||||
List<?> elements = strTree.query(env);
|
List<?> elements = strTree.query(env);
|
||||||
if (elements.size() > 0) {
|
if (elements.size() > 0) {
|
||||||
|
StringBuffer sb = new StringBuffer();
|
||||||
|
boolean first = true;
|
||||||
Iterator<?> iter = elements.iterator();
|
Iterator<?> iter = elements.iterator();
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
GageData gage = (GageData) iter.next();
|
GageData gage = (GageData) iter.next();
|
||||||
return "GAGE: " + gage.getName() + " VALUE: "
|
if (!first) {
|
||||||
+ gage.getGageValue();
|
sb.append("\n");
|
||||||
}
|
}
|
||||||
|
sb.append("GAGE: " + gage.getName() + " VALUE: "
|
||||||
|
+ gage.getGageValue());
|
||||||
|
first = false;
|
||||||
|
}
|
||||||
|
return sb.toString();
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new VizException(e);
|
throw new VizException(e);
|
||||||
|
|
|
@ -89,6 +89,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
* printable area of the page.
|
* printable area of the page.
|
||||||
* 04 Mar 2011 7644 lbousaid fixed Zoom in feature
|
* 04 Mar 2011 7644 lbousaid fixed Zoom in feature
|
||||||
* 30 May 2012 14967 wkwock fix insert deleted data to rejecteddata table
|
* 30 May 2012 14967 wkwock fix insert deleted data to rejecteddata table
|
||||||
|
* 23 Jul 2012 15195 mpduff Fix dates for displaying groups
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -1360,22 +1361,9 @@ public class TimeSeriesDisplayDlg extends CaveSWTDialog {
|
||||||
linesMI.setSelection(true);
|
linesMI.setSelection(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get time data from group info */
|
|
||||||
int pastHours = groupInfo.getPastHours();
|
|
||||||
int futureHours = groupInfo.getFutureHours();
|
|
||||||
|
|
||||||
Calendar futureCal = Calendar.getInstance(TimeZone
|
|
||||||
.getTimeZone("GMT"));
|
|
||||||
Date d = SimulatedTime.getSystemTime().getTime();
|
|
||||||
futureCal.setTime(d);
|
|
||||||
futureCal.add(Calendar.HOUR_OF_DAY, futureHours);
|
|
||||||
Calendar pastCal = Calendar.getInstance(TimeZone
|
|
||||||
.getTimeZone("GMT"));
|
|
||||||
pastCal.setTime(d);
|
|
||||||
pastCal.add(Calendar.HOUR_OF_DAY, pastHours * -1);
|
|
||||||
displayCanvas = new TimeSeriesDisplayCanvas(this,
|
displayCanvas = new TimeSeriesDisplayCanvas(this,
|
||||||
canvasComp, gd, pastCal.getTime(),
|
canvasComp, gd, beginDate,
|
||||||
futureCal.getTime(), groupInfo.isGroupSelected());
|
endDate, groupInfo.isGroupSelected());
|
||||||
displayCanvas.setHorizontalSpan(gd.getXsize());
|
displayCanvas.setHorizontalSpan(gd.getXsize());
|
||||||
displayCanvas.setVerticalSpan(gd.getYsize());
|
displayCanvas.setVerticalSpan(gd.getYsize());
|
||||||
displayCanvas.showGridLines(groupInfo.isGridLines());
|
displayCanvas.showGridLines(groupInfo.isGridLines());
|
||||||
|
|
|
@ -111,6 +111,11 @@ import com.raytheon.viz.hydrocommon.util.StnClassSyncUtil;
|
||||||
* be ran as a standalone application
|
* be ran as a standalone application
|
||||||
* without starting CAVE.
|
* without starting CAVE.
|
||||||
* 01 June 2011 9499 djingtao update openGraph()
|
* 01 June 2011 9499 djingtao update openGraph()
|
||||||
|
* 23 Jul 2012 15180 mpduff Auto select the first group in the predefined group list
|
||||||
|
* 23 Jul 2012 15195 mpduff Fix Group graphing to use the date widgets.
|
||||||
|
* 08 Aug 2012 570 mpduff Fix a Ctrl-F in Station list causing IndexOutOfBounds error.
|
||||||
|
* 08 Aug 2012 657 mpduff Fix error when selecting a TS while no selection has been made
|
||||||
|
* in the Station List.
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author lvenable
|
* @author lvenable
|
||||||
|
@ -438,6 +443,9 @@ public class TimeSeriesDlg extends CaveHydroSWTDialog {
|
||||||
/** Holds the Group Information */
|
/** Holds the Group Information */
|
||||||
private GroupInfo groupInfo;
|
private GroupInfo groupInfo;
|
||||||
|
|
||||||
|
/** Holds the last graphed GroupInfo object */
|
||||||
|
private GroupInfo prevGroupInfo;
|
||||||
|
|
||||||
/** Holds the page information */
|
/** Holds the page information */
|
||||||
private PageInfo pageInfo = null;
|
private PageInfo pageInfo = null;
|
||||||
|
|
||||||
|
@ -1156,11 +1164,13 @@ public class TimeSeriesDlg extends CaveHydroSWTDialog {
|
||||||
tsOrderCbo.addSelectionListener(new SelectionAdapter() {
|
tsOrderCbo.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
|
if (topDataList.getSelectionIndex() != -1) {
|
||||||
String line = topDataList.getItem(topDataList
|
String line = topDataList.getItem(topDataList
|
||||||
.getSelectionIndex());
|
.getSelectionIndex());
|
||||||
String selectedLid = line.substring(0, line.indexOf(" "));
|
String selectedLid = line.substring(0, line.indexOf(" "));
|
||||||
populateBottomList(selectedLid, tsOrderCbo.getSelectionIndex());
|
populateBottomList(selectedLid, tsOrderCbo.getSelectionIndex());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
tsOrderCbo.select(1);
|
tsOrderCbo.select(1);
|
||||||
Label spacer2 = new Label(searchComp, SWT.NORMAL);
|
Label spacer2 = new Label(searchComp, SWT.NORMAL);
|
||||||
|
@ -1202,10 +1212,12 @@ public class TimeSeriesDlg extends CaveHydroSWTDialog {
|
||||||
topDataList.addSelectionListener(new SelectionAdapter() {
|
topDataList.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
|
if (topDataList.getSelectionIndex() != -1) {
|
||||||
populateBottomList(
|
populateBottomList(
|
||||||
lidList.get(topDataList.getSelectionIndex()),
|
lidList.get(topDataList.getSelectionIndex()),
|
||||||
tsOrderCbo.getSelectionIndex());
|
tsOrderCbo.getSelectionIndex());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1366,6 +1378,20 @@ public class TimeSeriesDlg extends CaveHydroSWTDialog {
|
||||||
endHourBtn.setText(String.valueOf(endCal.get(Calendar.HOUR_OF_DAY)));
|
endHourBtn.setText(String.valueOf(endCal.get(Calendar.HOUR_OF_DAY)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void updateTimeButtons() {
|
||||||
|
beginYearBtn.setText(String.valueOf(beginCal.get(Calendar.YEAR)));
|
||||||
|
beginMonthBtn.setText(String.valueOf(beginCal.get(Calendar.MONTH) + 1));
|
||||||
|
beginDayBtn
|
||||||
|
.setText(String.valueOf(beginCal.get(Calendar.DAY_OF_MONTH)));
|
||||||
|
beginHourBtn
|
||||||
|
.setText(String.valueOf(beginCal.get(Calendar.HOUR_OF_DAY)));
|
||||||
|
|
||||||
|
endYearBtn.setText(String.valueOf(endCal.get(Calendar.YEAR)));
|
||||||
|
endMonthBtn.setText(String.valueOf(endCal.get(Calendar.MONTH) + 1));
|
||||||
|
endDayBtn.setText(String.valueOf(endCal.get(Calendar.DAY_OF_MONTH)));
|
||||||
|
endHourBtn.setText(String.valueOf(endCal.get(Calendar.HOUR_OF_DAY)));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Populates the station list box.
|
* Populates the station list box.
|
||||||
*/
|
*/
|
||||||
|
@ -1963,6 +1989,11 @@ public class TimeSeriesDlg extends CaveHydroSWTDialog {
|
||||||
// TODO log error here, invalid value
|
// TODO log error here, invalid value
|
||||||
System.err.println("Error in Group Definition Config file: " + line);
|
System.err.println("Error in Group Definition Config file: " + line);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// select the first item in the list
|
||||||
|
if (groupDataList.getItemCount() > 0) {
|
||||||
|
groupDataList.select(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2225,32 +2256,26 @@ public class TimeSeriesDlg extends CaveHydroSWTDialog {
|
||||||
GroupInfo groupInfo = groupList.get(groupDataList
|
GroupInfo groupInfo = groupList.get(groupDataList
|
||||||
.getSelectionIndex());
|
.getSelectionIndex());
|
||||||
|
|
||||||
|
if (prevGroupInfo == null || !prevGroupInfo.equals(groupInfo)) {
|
||||||
int pastHours = groupInfo.getPastHours();
|
int pastHours = groupInfo.getPastHours();
|
||||||
int futureHours = groupInfo.getFutureHours();
|
int futureHours = groupInfo.getFutureHours();
|
||||||
|
beginCal = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
|
||||||
|
beginCal.add(Calendar.HOUR_OF_DAY, pastHours * -1);
|
||||||
|
|
||||||
|
endCal = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
|
||||||
|
endCal.add(Calendar.HOUR_OF_DAY, futureHours);
|
||||||
|
|
||||||
|
beginDate = beginCal.getTime();
|
||||||
|
endDate = endCal.getTime();
|
||||||
|
|
||||||
|
updateTimeButtons();
|
||||||
|
|
||||||
// long beginMillis = beginDate.getTime();
|
|
||||||
// long endMillis = endDate.getTime();
|
|
||||||
// long currentMillis = SimulatedTime.getSystemTime().getTime().getTime();
|
|
||||||
//
|
|
||||||
// long hoursBack = (currentMillis - beginMillis) / (1000*60*60);
|
|
||||||
// long hoursAhead = (endMillis - currentMillis) / (1000*60*60);
|
|
||||||
// groupInfo.setPastHours((int) hoursBack);
|
|
||||||
// groupInfo.setFutureHours((int) hoursAhead);
|
|
||||||
groupInfo.setPastHours(pastHours);
|
groupInfo.setPastHours(pastHours);
|
||||||
groupInfo.setFutureHours(futureHours);
|
groupInfo.setFutureHours(futureHours);
|
||||||
|
}
|
||||||
// Calendar futureCal = Calendar.getInstance(TimeZone
|
|
||||||
// .getTimeZone("GMT"));
|
|
||||||
// Date d = SimulatedTime.getSystemTime().getTime();
|
|
||||||
// futureCal.setTime(d);
|
|
||||||
// futureCal.add(Calendar.HOUR_OF_DAY, futureHours);
|
|
||||||
// Calendar pastCal = Calendar.getInstance(TimeZone
|
|
||||||
// .getTimeZone("GMT"));
|
|
||||||
// pastCal.setTime(d);
|
|
||||||
// pastCal.add(Calendar.HOUR_OF_DAY, pastHours * -1);
|
|
||||||
|
|
||||||
|
|
||||||
timeSeriesDisplayDlg.setGroupInfo(groupInfo);
|
timeSeriesDisplayDlg.setGroupInfo(groupInfo);
|
||||||
|
|
||||||
|
prevGroupInfo = groupInfo;
|
||||||
}
|
}
|
||||||
timeSeriesDisplayDlg.setBeginDate(beginDate);
|
timeSeriesDisplayDlg.setBeginDate(beginDate);
|
||||||
timeSeriesDisplayDlg.setEndDate(endDate);
|
timeSeriesDisplayDlg.setEndDate(endDate);
|
||||||
|
|
|
@ -63,6 +63,7 @@ import com.raytheon.viz.hydrocommon.HydroConstants;
|
||||||
* July 12 2011 9709 djingtao draw right Y axis for showPP is true. add new
|
* July 12 2011 9709 djingtao draw right Y axis for showPP is true. add new
|
||||||
* function adjust_pcymax()
|
* function adjust_pcymax()
|
||||||
* Aug. 10, 2011 10457 djingtao allow the red rubberband box to be drawn for setMissing in Edit
|
* Aug. 10, 2011 10457 djingtao allow the red rubberband box to be drawn for setMissing in Edit
|
||||||
|
* Jul. 24, 2012 15195 mpduff Fix x axis scales.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -492,7 +493,7 @@ public class TimeSeriesGraphCanvas extends Canvas {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check canvas width. if small then need to skip extra days
|
// Check canvas width. if small then need to skip extra days
|
||||||
if (this.canvasWidth < 600) {
|
if (this.canvasWidth < 500) {
|
||||||
daysSkip++;
|
daysSkip++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -538,7 +539,7 @@ public class TimeSeriesGraphCanvas extends Canvas {
|
||||||
/* Hour annotation */
|
/* Hour annotation */
|
||||||
/* ******************** */
|
/* ******************** */
|
||||||
dy = 10;
|
dy = 10;
|
||||||
if (ndays < 4) {
|
if (ndays < 8 && this.canvasWidth > 450) {
|
||||||
if (hour < 10) {
|
if (hour < 10) {
|
||||||
gc.drawText("0" + hour, x + leftBorder - dx, bottomBorder + 22);
|
gc.drawText("0" + hour, x + leftBorder - dx, bottomBorder + 22);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -141,6 +141,10 @@ public class CrestHistoryCanvas extends Canvas {
|
||||||
*/
|
*/
|
||||||
private final int YEAR_HASH_X_COORD_START = VLINE_XCOORD + 15;
|
private final int YEAR_HASH_X_COORD_START = VLINE_XCOORD + 15;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* number of intervals on the y-axis
|
||||||
|
*/
|
||||||
|
private final int NUM_VERTICAL_INTERVALS = 5;
|
||||||
/**
|
/**
|
||||||
* Maximum stage value.
|
* Maximum stage value.
|
||||||
*/
|
*/
|
||||||
|
@ -207,11 +211,12 @@ public class CrestHistoryCanvas extends Canvas {
|
||||||
if (crestHistoryData != null) {
|
if (crestHistoryData != null) {
|
||||||
selectCrestDataCB = callback;
|
selectCrestDataCB = callback;
|
||||||
stageMaxVal = crestHistoryData.getMaxStageLevel();
|
stageMaxVal = crestHistoryData.getMaxStageLevel();
|
||||||
stageMinVal = 0.0;
|
stageMinVal = crestHistoryData.getMinStageLevel();
|
||||||
} else {
|
} else {
|
||||||
stageMaxVal = 0.0;
|
stageMaxVal = 0.0;
|
||||||
stageMinVal = 0.0;
|
stageMinVal = 0.0;
|
||||||
}
|
}
|
||||||
|
setYAxisMaxMin();
|
||||||
// another work around
|
// another work around
|
||||||
if ((crestHistoryData.getEndingYear() == 0)
|
if ((crestHistoryData.getEndingYear() == 0)
|
||||||
|| (crestHistoryData.getStartingYear() == 0)) {
|
|| (crestHistoryData.getStartingYear() == 0)) {
|
||||||
|
@ -257,12 +262,13 @@ public class CrestHistoryCanvas extends Canvas {
|
||||||
|
|
||||||
if (crestHistoryData != null) {
|
if (crestHistoryData != null) {
|
||||||
stageMaxVal = crestHistoryData.getMaxStageLevel();
|
stageMaxVal = crestHistoryData.getMaxStageLevel();
|
||||||
stageMinVal = 0.0;
|
stageMinVal = crestHistoryData.getMinStageLevel();
|
||||||
} else {
|
} else {
|
||||||
stageMaxVal = 0.0;
|
stageMaxVal = 0.0;
|
||||||
stageMinVal = 0.0;
|
stageMinVal = 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setYAxisMaxMin();
|
||||||
generateCrestDataMap();
|
generateCrestDataMap();
|
||||||
redraw();
|
redraw();
|
||||||
}
|
}
|
||||||
|
@ -291,6 +297,46 @@ public class CrestHistoryCanvas extends Canvas {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Calculate for the max. and min. Y axis value
|
||||||
|
*/
|
||||||
|
private void setYAxisMaxMin() {
|
||||||
|
int roundFactor = 5;
|
||||||
|
long lmax, lmin;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Round min down. If the original min data > 0, then don't round below
|
||||||
|
* 0.
|
||||||
|
*/
|
||||||
|
lmin = (long) (stageMinVal / roundFactor);
|
||||||
|
|
||||||
|
if (lmin >= 0) {
|
||||||
|
stageMinVal = (lmin - 1) * roundFactor;
|
||||||
|
if (stageMinVal < 0)
|
||||||
|
stageMinVal = 0;
|
||||||
|
} else /* lmin < 0 */
|
||||||
|
{
|
||||||
|
stageMinVal = (lmin - 1) * roundFactor;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Round max up.
|
||||||
|
*/
|
||||||
|
lmax = (long) (stageMaxVal / roundFactor);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If the difference between max_y and min_y < 10, round max_y up again.
|
||||||
|
*/
|
||||||
|
if ((stageMaxVal - stageMaxVal) < 10) {
|
||||||
|
stageMaxVal = (lmax + 2) * roundFactor;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (stageMinVal < 0) {
|
||||||
|
stageMinVal=0;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Draw the crest history data and the graph lines & labels on the canvas.
|
* Draw the crest history data and the graph lines & labels on the canvas.
|
||||||
*
|
*
|
||||||
|
@ -360,15 +406,15 @@ public class CrestHistoryCanvas extends Canvas {
|
||||||
if (i % 5 == 0) {
|
if (i % 5 == 0) {
|
||||||
e.gc.drawString(df.format(startyear + i), yearXcoord,
|
e.gc.drawString(df.format(startyear + i), yearXcoord,
|
||||||
CANVAS_HEIGHT - fontHeight - 3, true);
|
CANVAS_HEIGHT - fontHeight - 3, true);
|
||||||
e.gc.drawLine(yearHashXcoord, HLINE_YCOORD, yearHashXcoord,
|
e.gc.drawLine(yearHashXcoord, HLINE_YCOORD,
|
||||||
HLINE_YCOORD + HASH_MARK);
|
yearHashXcoord, HLINE_YCOORD + HASH_MARK);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (i % 10 == 0) {
|
if (i % 10 == 0) {
|
||||||
e.gc.drawString(df.format(startyear + i), yearXcoord,
|
e.gc.drawString(df.format(startyear + i), yearXcoord,
|
||||||
CANVAS_HEIGHT - fontHeight - 3, true);
|
CANVAS_HEIGHT - fontHeight - 3, true);
|
||||||
e.gc.drawLine(yearHashXcoord, HLINE_YCOORD, yearHashXcoord,
|
e.gc.drawLine(yearHashXcoord, HLINE_YCOORD,
|
||||||
HLINE_YCOORD + HASH_MARK);
|
yearHashXcoord, HLINE_YCOORD + HASH_MARK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -378,23 +424,24 @@ public class CrestHistoryCanvas extends Canvas {
|
||||||
// -----------------------------------------
|
// -----------------------------------------
|
||||||
|
|
||||||
double maxPixValue = VLINE_LENGTH + VLINE_PIXELS_FROM_TOP;
|
double maxPixValue = VLINE_LENGTH + VLINE_PIXELS_FROM_TOP;
|
||||||
double numHashsY = stageMaxVal;
|
double numHashsY = stageMaxVal - stageMinVal;
|
||||||
|
double valInc = (stageMaxVal - stageMinVal)
|
||||||
|
/ NUM_VERTICAL_INTERVALS;
|
||||||
|
|
||||||
double pixelsPerIncY = VLINE_LENGTH / numHashsY;
|
double pixelsPerIncY = VLINE_LENGTH / numHashsY;
|
||||||
|
|
||||||
for (int x = 0; x <= stageMaxVal; ++x) {
|
for (int x = (int) (stageMinVal); x <= stageMaxVal; x += valInc) {
|
||||||
int yCoord = HLINE_YCOORD
|
int yCoord = HLINE_YCOORD
|
||||||
- new Double(Math.round(x * pixelsPerIncY)).intValue();
|
- new Double(Math.round((x - stageMinVal)
|
||||||
|
* pixelsPerIncY)).intValue();
|
||||||
|
|
||||||
if (x % 5 == 0) {
|
|
||||||
// draw little hash
|
|
||||||
e.gc.drawLine(VLINE_XCOORD, yCoord, VLINE_XCOORD
|
e.gc.drawLine(VLINE_XCOORD, yCoord, VLINE_XCOORD
|
||||||
- SMALL_HASH_MARK, yCoord);
|
- SMALL_HASH_MARK, yCoord);
|
||||||
|
|
||||||
String recStr = String.format("%5.1f", new Float(x)
|
String recStr = String.format("%5.1f",
|
||||||
.floatValue());
|
new Float(x).floatValue());
|
||||||
e.gc.drawString(recStr, 35, yCoord - fontHeightMid, true);
|
e.gc.drawString(recStr, 35, yCoord - fontHeightMid, true);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// -----------------------------------------
|
// -----------------------------------------
|
||||||
// Draw MAJOR line and label
|
// Draw MAJOR line and label
|
||||||
|
@ -522,7 +569,7 @@ public class CrestHistoryCanvas extends Canvas {
|
||||||
int circleHeight = 8;
|
int circleHeight = 8;
|
||||||
|
|
||||||
double maxPixValue = VLINE_LENGTH + VLINE_PIXELS_FROM_TOP;
|
double maxPixValue = VLINE_LENGTH + VLINE_PIXELS_FROM_TOP;
|
||||||
double numHashs = crestHistoryData.getMaxStageLevel();
|
double numHashs = stageMaxVal - stageMinVal;
|
||||||
double pixelsPerIncY = VLINE_LENGTH / numHashs;
|
double pixelsPerIncY = VLINE_LENGTH / numHashs;
|
||||||
int startyear = crestHistoryData.getStartingYear();
|
int startyear = crestHistoryData.getStartingYear();
|
||||||
int endyear = crestHistoryData.getEndingYear();
|
int endyear = crestHistoryData.getEndingYear();
|
||||||
|
@ -543,7 +590,7 @@ public class CrestHistoryCanvas extends Canvas {
|
||||||
for (CrestData crestData : crestHistoryData.getCrestDataArray()) {
|
for (CrestData crestData : crestHistoryData.getCrestDataArray()) {
|
||||||
|
|
||||||
int yCoord = (int) (maxPixValue - Math
|
int yCoord = (int) (maxPixValue - Math
|
||||||
.round((crestData.getStage() * pixelsPerIncY)));
|
.round(((crestData.getStage() - stageMinVal) * pixelsPerIncY)));
|
||||||
|
|
||||||
double yearXOffset = crestData.getYear() - startyear;
|
double yearXOffset = crestData.getYear() - startyear;
|
||||||
int xCoord = YEAR_HASH_X_COORD_START
|
int xCoord = YEAR_HASH_X_COORD_START
|
||||||
|
@ -553,8 +600,9 @@ public class CrestHistoryCanvas extends Canvas {
|
||||||
rec = new Rectangle(xCoord - circleWidth / 2, yCoord - circleHeight
|
rec = new Rectangle(xCoord - circleWidth / 2, yCoord - circleHeight
|
||||||
/ 2, circleWidth, circleHeight);
|
/ 2, circleWidth, circleHeight);
|
||||||
|
|
||||||
drawData = new CrestDrawData(crestData.getStage(), crestData
|
drawData = new CrestDrawData(crestData.getStage(),
|
||||||
.getYear(), calculateDataColor(crestData.getStage()));
|
crestData.getYear(),
|
||||||
|
calculateDataColor(crestData.getStage()));
|
||||||
|
|
||||||
crestDataMap.put(rec, drawData);
|
crestDataMap.put(rec, drawData);
|
||||||
}
|
}
|
||||||
|
@ -568,20 +616,20 @@ public class CrestHistoryCanvas extends Canvas {
|
||||||
* @return The color associated with the data.
|
* @return The color associated with the data.
|
||||||
*/
|
*/
|
||||||
private Color calculateDataColor(double stage) {
|
private Color calculateDataColor(double stage) {
|
||||||
if ((stage > crestHistoryData.getMajorLevel()) &&
|
if ((stage > crestHistoryData.getMajorLevel())
|
||||||
(crestHistoryData.getMajorLevel() != HydroConstants.MISSING_VALUE)) {
|
&& (crestHistoryData.getMajorLevel() != HydroConstants.MISSING_VALUE)) {
|
||||||
++majorCount;
|
++majorCount;
|
||||||
return parentComp.getDisplay().getSystemColor(SWT.COLOR_MAGENTA);
|
return parentComp.getDisplay().getSystemColor(SWT.COLOR_MAGENTA);
|
||||||
} else if ((stage > crestHistoryData.getModerateLevel()) &&
|
} else if ((stage > crestHistoryData.getModerateLevel())
|
||||||
(crestHistoryData.getModerateLevel() != HydroConstants.MISSING_VALUE)) {
|
&& (crestHistoryData.getModerateLevel() != HydroConstants.MISSING_VALUE)) {
|
||||||
++modCount;
|
++modCount;
|
||||||
return parentComp.getDisplay().getSystemColor(SWT.COLOR_BLUE);
|
return parentComp.getDisplay().getSystemColor(SWT.COLOR_BLUE);
|
||||||
} else if ((stage > crestHistoryData.getMinorLevel()) &&
|
} else if ((stage > crestHistoryData.getMinorLevel())
|
||||||
(crestHistoryData.getMinorLevel() != HydroConstants.MISSING_VALUE)) {
|
&& (crestHistoryData.getMinorLevel() != HydroConstants.MISSING_VALUE)) {
|
||||||
++minorCount;
|
++minorCount;
|
||||||
return parentComp.getDisplay().getSystemColor(SWT.COLOR_RED);
|
return parentComp.getDisplay().getSystemColor(SWT.COLOR_RED);
|
||||||
} else if ((stage > crestHistoryData.getActionLevel()) &&
|
} else if ((stage > crestHistoryData.getActionLevel())
|
||||||
(crestHistoryData.getActionLevel() != HydroConstants.MISSING_VALUE)) {
|
&& (crestHistoryData.getActionLevel() != HydroConstants.MISSING_VALUE)) {
|
||||||
++actionCount;
|
++actionCount;
|
||||||
return parentComp.getDisplay().getSystemColor(SWT.COLOR_YELLOW);
|
return parentComp.getDisplay().getSystemColor(SWT.COLOR_YELLOW);
|
||||||
}
|
}
|
||||||
|
@ -623,9 +671,9 @@ public class CrestHistoryCanvas extends Canvas {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (selectCrestDataCB != null) {
|
if (selectCrestDataCB != null) {
|
||||||
selectCrestDataCB.crestDataSelected(crestDataMap.get(
|
selectCrestDataCB.crestDataSelected(
|
||||||
foundRec).getStage(), crestDataMap.get(foundRec)
|
crestDataMap.get(foundRec).getStage(), crestDataMap
|
||||||
.getYear());
|
.get(foundRec).getYear());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -195,12 +195,19 @@ public class RiverDataManager {
|
||||||
// There is a problem when the stage is not set in the db.
|
// There is a problem when the stage is not set in the db.
|
||||||
// Added this work around here to manually find the max stage value
|
// Added this work around here to manually find the max stage value
|
||||||
double maxStag = 0;
|
double maxStag = 0;
|
||||||
|
double minStag = Double.MAX_VALUE;
|
||||||
for (int i = 0; i < crests.getCrestDataArray().size(); i++) {
|
for (int i = 0; i < crests.getCrestDataArray().size(); i++) {
|
||||||
if (crests.getCrestDataArray().get(i).getStage() > maxStag) {
|
if (crests.getCrestDataArray().get(i).getStage() > maxStag) {
|
||||||
maxStag = crests.getCrestDataArray().get(i).getStage();
|
maxStag = crests.getCrestDataArray().get(i).getStage();
|
||||||
}
|
}
|
||||||
|
if (crests.getCrestDataArray().get(i).getStage() < minStag &&
|
||||||
|
crests.getCrestDataArray().get(i).getStage() >= 0) {
|
||||||
|
minStag = crests.getCrestDataArray().get(i).getStage();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
crests.setMaxStageLevel(maxStag);
|
crests.setMaxStageLevel(maxStag);
|
||||||
|
crests.setMinStageLevel(minStag);
|
||||||
|
|
||||||
// set the values to gage by
|
// set the values to gage by
|
||||||
crests.setActionLevel(rdp.getActionStage());
|
crests.setActionLevel(rdp.getActionStage());
|
||||||
|
@ -313,8 +320,7 @@ public class RiverDataManager {
|
||||||
riverData.put(riverID, riverPoints);
|
riverData.put(riverID, riverPoints);
|
||||||
}
|
}
|
||||||
} catch (VizException e) {
|
} catch (VizException e) {
|
||||||
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(),
|
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
|
||||||
e);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return riverData;
|
return riverData;
|
||||||
|
@ -396,8 +402,7 @@ public class RiverDataManager {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (VizException e) {
|
} catch (VizException e) {
|
||||||
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(),
|
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
|
||||||
e);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return riverPoints;
|
return riverPoints;
|
||||||
|
@ -421,8 +426,7 @@ public class RiverDataManager {
|
||||||
riverID = (String) (riverObject.get(0))[0];
|
riverID = (String) (riverObject.get(0))[0];
|
||||||
}
|
}
|
||||||
} catch (VizException e) {
|
} catch (VizException e) {
|
||||||
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(),
|
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
|
||||||
e);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return riverID;
|
return riverID;
|
||||||
|
@ -470,8 +474,7 @@ public class RiverDataManager {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (VizException e) {
|
} catch (VizException e) {
|
||||||
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(),
|
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
|
||||||
e);
|
|
||||||
}
|
}
|
||||||
// next find the river stat values
|
// next find the river stat values
|
||||||
try {
|
try {
|
||||||
|
@ -512,8 +515,7 @@ public class RiverDataManager {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (VizException e) {
|
} catch (VizException e) {
|
||||||
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(),
|
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
|
||||||
e);
|
|
||||||
}
|
}
|
||||||
// next find the description values
|
// next find the description values
|
||||||
try {
|
try {
|
||||||
|
@ -530,8 +532,7 @@ public class RiverDataManager {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (VizException e) {
|
} catch (VizException e) {
|
||||||
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(),
|
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
|
||||||
e);
|
|
||||||
}
|
}
|
||||||
// get data for the flood categories
|
// get data for the flood categories
|
||||||
try {
|
try {
|
||||||
|
@ -560,8 +561,7 @@ public class RiverDataManager {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(),
|
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
|
||||||
e);
|
|
||||||
}
|
}
|
||||||
// Get data for Crest information
|
// Get data for Crest information
|
||||||
try {
|
try {
|
||||||
|
@ -587,8 +587,7 @@ public class RiverDataManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(),
|
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
|
||||||
e);
|
|
||||||
}
|
}
|
||||||
// get data for the river information
|
// get data for the river information
|
||||||
try {
|
try {
|
||||||
|
@ -602,8 +601,7 @@ public class RiverDataManager {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(),
|
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
|
||||||
e);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return rdp;
|
return rdp;
|
||||||
|
@ -620,8 +618,7 @@ public class RiverDataManager {
|
||||||
stream = (String) results.get(0)[0];
|
stream = (String) results.get(0)[0];
|
||||||
}
|
}
|
||||||
} catch (VizException e) {
|
} catch (VizException e) {
|
||||||
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(),
|
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
|
||||||
e);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return stream;
|
return stream;
|
||||||
|
@ -639,9 +636,9 @@ public class RiverDataManager {
|
||||||
// + com.raytheon.edex.plugin.shef.objects.Statprof.class
|
// + com.raytheon.edex.plugin.shef.objects.Statprof.class
|
||||||
// .getName();
|
// .getName();
|
||||||
// query += " where stream = '" + stream + "' order by mile desc";
|
// query += " where stream = '" + stream + "' order by mile desc";
|
||||||
String query = "select lid, name, primary_pe, stream, fs, wstg, fq, " +
|
String query = "select lid, name, primary_pe, stream, fs, wstg, fq, "
|
||||||
"action_flow, zd, mile, reach, proximity from statprof " +
|
+ "action_flow, zd, mile, reach, proximity from statprof "
|
||||||
"where stream = '" + stream + "' order by mile desc";
|
+ "where stream = '" + stream + "' order by mile desc";
|
||||||
|
|
||||||
List<Statprof> dataList = new ArrayList<Statprof>();
|
List<Statprof> dataList = new ArrayList<Statprof>();
|
||||||
try {
|
try {
|
||||||
|
@ -671,11 +668,13 @@ public class RiverDataManager {
|
||||||
if (spid.getPrimaryPe() == null) {
|
if (spid.getPrimaryPe() == null) {
|
||||||
continue;
|
continue;
|
||||||
} else if (spid.getPrimaryPe().startsWith("H")) {
|
} else if (spid.getPrimaryPe().startsWith("H")) {
|
||||||
if ((spid.getFs() == null) || (spid.getWstg() == null)) {
|
if ((spid.getFs() == null)
|
||||||
|
|| (spid.getWstg() == null)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ((spid.getFq() == null) || (spid.getActionFlow() == null)) {
|
if ((spid.getFq() == null)
|
||||||
|
|| (spid.getActionFlow() == null)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -684,8 +683,7 @@ public class RiverDataManager {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (VizException e) {
|
} catch (VizException e) {
|
||||||
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(),
|
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
|
||||||
e);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return dataList;
|
return dataList;
|
||||||
|
@ -723,8 +721,7 @@ public class RiverDataManager {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (VizException e) {
|
} catch (VizException e) {
|
||||||
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(),
|
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
|
||||||
e);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return dataList;
|
return dataList;
|
||||||
|
@ -739,8 +736,7 @@ public class RiverDataManager {
|
||||||
rs = DirectDbQuery.executeQuery(query, HydroConstants.IHFS,
|
rs = DirectDbQuery.executeQuery(query, HydroConstants.IHFS,
|
||||||
QueryLanguage.SQL);
|
QueryLanguage.SQL);
|
||||||
} catch (VizException e) {
|
} catch (VizException e) {
|
||||||
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(),
|
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
|
||||||
e);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return rs;
|
return rs;
|
||||||
|
|
|
@ -1,45 +0,0 @@
|
||||||
/**
|
|
||||||
* This software was developed and / or modified by Raytheon Company,
|
|
||||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
|
||||||
*
|
|
||||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
|
||||||
* This software product contains export-restricted data whose
|
|
||||||
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
|
||||||
* to non-U.S. persons whether in the United States or abroad requires
|
|
||||||
* an export license or other authorization.
|
|
||||||
*
|
|
||||||
* Contractor Name: Raytheon Company
|
|
||||||
* Contractor Address: 6825 Pine Street, Suite 340
|
|
||||||
* Mail Stop B8
|
|
||||||
* Omaha, NE 68106
|
|
||||||
* 402.291.0100
|
|
||||||
*
|
|
||||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
|
||||||
* further licensing information.
|
|
||||||
**/
|
|
||||||
package com.raytheon.viz.hydrocommon.ratingcurve;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Interface for getting the sort type for the rating curve data.
|
|
||||||
*
|
|
||||||
* <pre>
|
|
||||||
*
|
|
||||||
* SOFTWARE HISTORY
|
|
||||||
*
|
|
||||||
* Date Ticket# Engineer Description
|
|
||||||
* ------------ ---------- ----------- --------------------------
|
|
||||||
*24 Nov, 2008 1628 dhladky Initial creation
|
|
||||||
*
|
|
||||||
* </pre>
|
|
||||||
*
|
|
||||||
* @author dhladky
|
|
||||||
* @version 1.0
|
|
||||||
*/
|
|
||||||
public interface IRatingCurveSort
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Get the sort type.
|
|
||||||
* @return The sort type.
|
|
||||||
*/
|
|
||||||
String getSortType();
|
|
||||||
}
|
|
|
@ -167,4 +167,44 @@ public class RatingCurveData implements Comparable<RatingCurveData>
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see java.lang.Object#hashCode()
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
final int prime = 31;
|
||||||
|
int result = 1;
|
||||||
|
long temp;
|
||||||
|
temp = Double.doubleToLongBits(discharge);
|
||||||
|
result = prime * result + (int) (temp ^ (temp >>> 32));
|
||||||
|
temp = Double.doubleToLongBits(stage);
|
||||||
|
result = prime * result + (int) (temp ^ (temp >>> 32));
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see java.lang.Object#equals(java.lang.Object)
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object obj) {
|
||||||
|
if (this == obj)
|
||||||
|
return true;
|
||||||
|
if (obj == null)
|
||||||
|
return false;
|
||||||
|
if (getClass() != obj.getClass())
|
||||||
|
return false;
|
||||||
|
RatingCurveData other = (RatingCurveData) obj;
|
||||||
|
if (Double.doubleToLongBits(discharge) != Double
|
||||||
|
.doubleToLongBits(other.discharge))
|
||||||
|
return false;
|
||||||
|
if (Double.doubleToLongBits(stage) != Double
|
||||||
|
.doubleToLongBits(other.stage))
|
||||||
|
return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,12 +38,12 @@ import org.eclipse.core.runtime.Status;
|
||||||
import org.eclipse.swt.SWT;
|
import org.eclipse.swt.SWT;
|
||||||
import org.eclipse.swt.events.SelectionAdapter;
|
import org.eclipse.swt.events.SelectionAdapter;
|
||||||
import org.eclipse.swt.events.SelectionEvent;
|
import org.eclipse.swt.events.SelectionEvent;
|
||||||
import org.eclipse.swt.events.SelectionListener;
|
|
||||||
import org.eclipse.swt.graphics.Font;
|
import org.eclipse.swt.graphics.Font;
|
||||||
import org.eclipse.swt.layout.GridData;
|
import org.eclipse.swt.layout.GridData;
|
||||||
import org.eclipse.swt.layout.GridLayout;
|
import org.eclipse.swt.layout.GridLayout;
|
||||||
import org.eclipse.swt.widgets.Button;
|
import org.eclipse.swt.widgets.Button;
|
||||||
import org.eclipse.swt.widgets.Composite;
|
import org.eclipse.swt.widgets.Composite;
|
||||||
|
import org.eclipse.swt.widgets.Display;
|
||||||
import org.eclipse.swt.widgets.FileDialog;
|
import org.eclipse.swt.widgets.FileDialog;
|
||||||
import org.eclipse.swt.widgets.Label;
|
import org.eclipse.swt.widgets.Label;
|
||||||
import org.eclipse.swt.widgets.Layout;
|
import org.eclipse.swt.widgets.Layout;
|
||||||
|
@ -77,7 +77,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
* @author lvenable
|
* @author lvenable
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
*/
|
*/
|
||||||
public class RatingCurveDlg extends CaveSWTDialog implements IRatingCurveSort {
|
public class RatingCurveDlg extends CaveSWTDialog {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Control font.
|
* Control font.
|
||||||
|
@ -229,18 +229,6 @@ public class RatingCurveDlg extends CaveSWTDialog implements IRatingCurveSort {
|
||||||
*/
|
*/
|
||||||
private Button saveBtn;
|
private Button saveBtn;
|
||||||
|
|
||||||
/**
|
|
||||||
* Sort by enumeration.
|
|
||||||
*/
|
|
||||||
private enum sortBy {
|
|
||||||
Stage, Discharge
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sort by
|
|
||||||
*/
|
|
||||||
private sortBy sortKey;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dialog lid information.
|
* Dialog lid information.
|
||||||
*/
|
*/
|
||||||
|
@ -285,11 +273,6 @@ public class RatingCurveDlg extends CaveSWTDialog implements IRatingCurveSort {
|
||||||
*/
|
*/
|
||||||
private RatingCurveShiftData selectedRatingShift = null;
|
private RatingCurveShiftData selectedRatingShift = null;
|
||||||
|
|
||||||
/**
|
|
||||||
* The current selected rating point
|
|
||||||
*/
|
|
||||||
private RatingCurveData selectedRatingPoint = null;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shift amount
|
* Shift amount
|
||||||
*/
|
*/
|
||||||
|
@ -488,91 +471,6 @@ public class RatingCurveDlg extends CaveSWTDialog implements IRatingCurveSort {
|
||||||
df.setMaximumFractionDigits(2);
|
df.setMaximumFractionDigits(2);
|
||||||
df.setMaximumIntegerDigits(3);
|
df.setMaximumIntegerDigits(3);
|
||||||
|
|
||||||
shiftDataList.addSelectionListener(new SelectionListener() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void widgetDefaultSelected(SelectionEvent e) {
|
|
||||||
int index = 0; // default
|
|
||||||
RatingCurveShiftData rcsd = shiftData.get(index);
|
|
||||||
|
|
||||||
shiftValueTF.setText(df.format(rcsd.getValue()));
|
|
||||||
shiftDateTF.setText(sdf.format(rcsd.getDate().getTime()));
|
|
||||||
shiftActiveChk.setSelection(rcsd.isActive());
|
|
||||||
generateShiftList(rcsd);
|
|
||||||
setSelectedShift(rcsd);
|
|
||||||
|
|
||||||
if (shiftActiveChk.getSelection()) {
|
|
||||||
// redraw the canvas with shifted data
|
|
||||||
ratingCurveCanvas.updateCurveData(shiftCurveArray,
|
|
||||||
floodDbl, recordDbl, shiftAmount);
|
|
||||||
} else {
|
|
||||||
ratingCurveCanvas.updateCurveData(noShiftCurveArray,
|
|
||||||
floodDbl, recordDbl, shiftAmount);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void widgetSelected(SelectionEvent e) {
|
|
||||||
int index = shiftDataList.getSelectionIndex();
|
|
||||||
setSelectedShift(shiftData.get(index));
|
|
||||||
RatingCurveShiftData rcsd = shiftData.get(index);
|
|
||||||
|
|
||||||
shiftValueTF.setText(df.format(rcsd.getValue()));
|
|
||||||
shiftDateTF.setText(sdf.format(rcsd.getDate().getTime()));
|
|
||||||
shiftActiveChk.setSelection(rcsd.isActive());
|
|
||||||
|
|
||||||
if (shiftActiveChk.getSelection()) {
|
|
||||||
// redraw the canvas with shifted data
|
|
||||||
generateShiftList(getEditingShiftData());
|
|
||||||
ratingCurveCanvas.updateCurveData(shiftCurveArray,
|
|
||||||
floodDbl, recordDbl, shiftAmount);
|
|
||||||
} else {
|
|
||||||
ratingCurveCanvas.updateCurveData(noShiftCurveArray,
|
|
||||||
floodDbl, recordDbl, shiftAmount);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
shiftActiveChk.addSelectionListener(new SelectionListener() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void widgetDefaultSelected(SelectionEvent e) {
|
|
||||||
// redraw the canvas with shifted data
|
|
||||||
if ((shiftData.size() > 0) && (shiftDataList != null)) {
|
|
||||||
int index = 0;
|
|
||||||
RatingCurveShiftData rcsd = shiftData.get(index);
|
|
||||||
if (rcsd.isActive()) {
|
|
||||||
ratingCurveCanvas.updateCurveData(shiftCurveArray,
|
|
||||||
floodDbl, recordDbl, shiftAmount);
|
|
||||||
shiftActiveChk.setSelection(rcsd.isActive());
|
|
||||||
} else {
|
|
||||||
ratingCurveCanvas.updateCurveData(noShiftCurveArray,
|
|
||||||
floodDbl, recordDbl, shiftAmount);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void widgetSelected(SelectionEvent e) {
|
|
||||||
// redraw the canvas with shifted data
|
|
||||||
if ((shiftData.size() > 0)
|
|
||||||
&& (shiftDataList.getSelectionIndex() != -1)) {
|
|
||||||
RatingCurveShiftData rcsd = shiftData.get(shiftDataList
|
|
||||||
.getSelectionIndex());
|
|
||||||
generateShiftList(rcsd);
|
|
||||||
if (rcsd.isActive()) {
|
|
||||||
ratingCurveCanvas.updateCurveData(shiftCurveArray,
|
|
||||||
floodDbl, recordDbl, shiftAmount);
|
|
||||||
} else {
|
|
||||||
ratingCurveCanvas.updateCurveData(noShiftCurveArray,
|
|
||||||
floodDbl, recordDbl, shiftAmount);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
// --------------------------------------------------------
|
// --------------------------------------------------------
|
||||||
// Create the Shift Remove & Update/Insert buttons
|
// Create the Shift Remove & Update/Insert buttons
|
||||||
// --------------------------------------------------------
|
// --------------------------------------------------------
|
||||||
|
@ -589,25 +487,7 @@ public class RatingCurveDlg extends CaveSWTDialog implements IRatingCurveSort {
|
||||||
shftRemoveBtn.addSelectionListener(new SelectionAdapter() {
|
shftRemoveBtn.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
if (getEditingShiftData() != null) {
|
removeShift();
|
||||||
int index = shiftDataList.getSelectionIndex();
|
|
||||||
removedCurveShifts.add(getEditingShiftData());
|
|
||||||
shiftData.remove(index);
|
|
||||||
selectedRatingShift = null;
|
|
||||||
|
|
||||||
shiftDataList.removeAll();
|
|
||||||
for (RatingCurveShiftData rcsd : shiftData) {
|
|
||||||
shiftDataList.add(getShiftListString(rcsd));
|
|
||||||
}
|
|
||||||
shiftDataList.redraw();
|
|
||||||
|
|
||||||
shiftValueTF.setText("");
|
|
||||||
shiftDateTF.setText("");
|
|
||||||
shiftActiveChk.setSelection(false);
|
|
||||||
// default without shifting
|
|
||||||
ratingCurveCanvas.updateCurveData(noShiftCurveArray,
|
|
||||||
floodDbl, recordDbl, shiftAmount);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -656,6 +536,12 @@ public class RatingCurveDlg extends CaveSWTDialog implements IRatingCurveSort {
|
||||||
curveClearAllBtn.addSelectionListener(new SelectionAdapter() {
|
curveClearAllBtn.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
|
MessageBox messageDialog = new MessageBox(shell, SWT.OK | SWT.CANCEL);
|
||||||
|
messageDialog.setText("Clear Confirmation");
|
||||||
|
messageDialog.setMessage("This will clear the list for " + lid + ".");
|
||||||
|
int response = messageDialog.open();
|
||||||
|
|
||||||
|
if (response == SWT.OK) {
|
||||||
// get rid of every point
|
// get rid of every point
|
||||||
removedPoints = noShiftCurveArray;
|
removedPoints = noShiftCurveArray;
|
||||||
noShiftCurveArray.clear();
|
noShiftCurveArray.clear();
|
||||||
|
@ -664,18 +550,18 @@ public class RatingCurveDlg extends CaveSWTDialog implements IRatingCurveSort {
|
||||||
|
|
||||||
if (shiftCurveArray != null) {
|
if (shiftCurveArray != null) {
|
||||||
shiftCurveArray.clear();
|
shiftCurveArray.clear();
|
||||||
|
}
|
||||||
shiftCurveDataList.removeAll();
|
shiftCurveDataList.removeAll();
|
||||||
shiftCurveDataList.redraw();
|
shiftCurveDataList.redraw();
|
||||||
}
|
|
||||||
|
|
||||||
stageTF.setText("");
|
stageTF.setText("");
|
||||||
dischargeTF.setText("");
|
dischargeTF.setText("");
|
||||||
selectedRatingShift = null;
|
selectedRatingShift = null;
|
||||||
selectedRatingPoint = null;
|
|
||||||
|
|
||||||
ratingCurveCanvas.updateCurveData(noShiftCurveArray, floodDbl,
|
ratingCurveCanvas.updateCurveData(noShiftCurveArray, floodDbl,
|
||||||
recordDbl, shiftAmount);
|
recordDbl, shiftAmount);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
gd = new GridData(buttonWidth, SWT.DEFAULT);
|
gd = new GridData(buttonWidth, SWT.DEFAULT);
|
||||||
|
@ -686,6 +572,13 @@ public class RatingCurveDlg extends CaveSWTDialog implements IRatingCurveSort {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
if (noShiftCurveDataList.getSelectionIndex() != -1) {
|
if (noShiftCurveDataList.getSelectionIndex() != -1) {
|
||||||
|
MessageBox mb = new MessageBox(shell, SWT.ICON_QUESTION
|
||||||
|
| SWT.OK | SWT.CANCEL);
|
||||||
|
mb.setText("Remove Base Rating Point Confirmation");
|
||||||
|
mb.setMessage("This will remove the highlighted pair.");
|
||||||
|
int response = mb.open();
|
||||||
|
|
||||||
|
if (response == SWT.OK) {
|
||||||
// get rid of this point
|
// get rid of this point
|
||||||
int index = noShiftCurveDataList.getSelectionIndex();
|
int index = noShiftCurveDataList.getSelectionIndex();
|
||||||
removedPoints.add(noShiftCurveArray.remove(index));
|
removedPoints.add(noShiftCurveArray.remove(index));
|
||||||
|
@ -702,6 +595,7 @@ public class RatingCurveDlg extends CaveSWTDialog implements IRatingCurveSort {
|
||||||
floodDbl, recordDbl, shiftAmount);
|
floodDbl, recordDbl, shiftAmount);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
gd = new GridData(buttonWidth, SWT.DEFAULT);
|
gd = new GridData(buttonWidth, SWT.DEFAULT);
|
||||||
|
@ -712,22 +606,43 @@ public class RatingCurveDlg extends CaveSWTDialog implements IRatingCurveSort {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
if (verifyDouble(stageTF) && verifyInt(dischargeTF)) {
|
if (verifyDouble(stageTF) && verifyInt(dischargeTF)) {
|
||||||
|
|
||||||
RatingCurveData rcd = new RatingCurveData(new Double(
|
RatingCurveData rcd = new RatingCurveData(new Double(
|
||||||
stageTF.getText().trim()), new Double(dischargeTF
|
stageTF.getText().trim()), new Double(dischargeTF
|
||||||
.getText().trim()));
|
.getText().trim()));
|
||||||
|
insertBaseCurvePoint(rcd);
|
||||||
if (noShiftCurveDataList != null) {
|
|
||||||
if (getEditingCurveData() != null) {
|
|
||||||
int index = noShiftCurveDataList
|
|
||||||
.getSelectionIndex();
|
|
||||||
if (index > -1) {
|
|
||||||
noShiftCurveArray.remove(index);
|
|
||||||
noShiftCurveDataList.remove(index);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (fullControls == false) {
|
||||||
|
shftRemoveBtn.setVisible(false);
|
||||||
|
shftUpdateInsBtn.setVisible(false);
|
||||||
|
curveImportBtn.setVisible(false);
|
||||||
|
curveClearAllBtn.setVisible(false);
|
||||||
|
curveRemoveBtn.setVisible(false);
|
||||||
|
curveUpdateInsBtn.setVisible(false);
|
||||||
|
} else {
|
||||||
|
shiftDateTF.setEditable(true);
|
||||||
|
shiftValueTF.setEditable(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void insertBaseCurvePoint(RatingCurveData rcd) {
|
||||||
|
if (!noShiftCurveArray.contains(rcd)) {
|
||||||
|
// Check for a matching stage value
|
||||||
|
RatingCurveData data = null;
|
||||||
|
for (RatingCurveData d: noShiftCurveArray) {
|
||||||
|
if (d.getStage() == rcd.getStage()) {
|
||||||
|
data = d;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (data != null) {
|
||||||
|
noShiftCurveArray.remove(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
noShiftCurveArray.add(rcd);
|
||||||
if (!addedPoints.contains(rcd)) {
|
if (!addedPoints.contains(rcd)) {
|
||||||
addedPoints.add(rcd);
|
addedPoints.add(rcd);
|
||||||
} else {
|
} else {
|
||||||
|
@ -735,7 +650,6 @@ public class RatingCurveDlg extends CaveSWTDialog implements IRatingCurveSort {
|
||||||
addedPoints.add(rcd);
|
addedPoints.add(rcd);
|
||||||
}
|
}
|
||||||
|
|
||||||
noShiftCurveArray.add(rcd);
|
|
||||||
remakeRatingCurveDataList();
|
remakeRatingCurveDataList();
|
||||||
|
|
||||||
if (getEditingShiftData() != null) {
|
if (getEditingShiftData() != null) {
|
||||||
|
@ -755,20 +669,6 @@ public class RatingCurveDlg extends CaveSWTDialog implements IRatingCurveSort {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
|
||||||
if (fullControls == false) {
|
|
||||||
shftRemoveBtn.setVisible(false);
|
|
||||||
shftUpdateInsBtn.setVisible(false);
|
|
||||||
curveImportBtn.setVisible(false);
|
|
||||||
curveClearAllBtn.setVisible(false);
|
|
||||||
curveRemoveBtn.setVisible(false);
|
|
||||||
curveUpdateInsBtn.setVisible(false);
|
|
||||||
} else {
|
|
||||||
shiftDateTF.setEditable(true);
|
|
||||||
shiftValueTF.setEditable(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create the controls on the right side of the dialog.
|
* Create the controls on the right side of the dialog.
|
||||||
|
@ -789,10 +689,17 @@ public class RatingCurveDlg extends CaveSWTDialog implements IRatingCurveSort {
|
||||||
createStageDischargeLabels(rightComp);
|
createStageDischargeLabels(rightComp);
|
||||||
|
|
||||||
gd = new GridData(220, 400);
|
gd = new GridData(220, 400);
|
||||||
shiftCurveDataList = new List(rightComp, SWT.BORDER | SWT.SINGLE
|
shiftCurveDataList = new List(rightComp, SWT.BORDER | SWT.V_SCROLL);
|
||||||
| SWT.V_SCROLL);
|
|
||||||
shiftCurveDataList.setFont(controlFont);
|
shiftCurveDataList.setFont(controlFont);
|
||||||
shiftCurveDataList.setLayoutData(gd);
|
shiftCurveDataList.setLayoutData(gd);
|
||||||
|
shiftCurveDataList.deselectAll();
|
||||||
|
shiftCurveDataList.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_DARK_GRAY));
|
||||||
|
shiftCurveDataList.addSelectionListener(new SelectionAdapter() {
|
||||||
|
@Override
|
||||||
|
public void widgetSelected(SelectionEvent e) {
|
||||||
|
shiftCurveDataList.deselectAll();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
gd = new GridData(SWT.CENTER, SWT.DEFAULT, true, false);
|
gd = new GridData(SWT.CENTER, SWT.DEFAULT, true, false);
|
||||||
ratingLbl = new Label(rightComp, SWT.CENTER);
|
ratingLbl = new Label(rightComp, SWT.CENTER);
|
||||||
|
@ -804,17 +711,6 @@ public class RatingCurveDlg extends CaveSWTDialog implements IRatingCurveSort {
|
||||||
| SWT.V_SCROLL);
|
| SWT.V_SCROLL);
|
||||||
noShiftCurveDataList.setFont(controlFont);
|
noShiftCurveDataList.setFont(controlFont);
|
||||||
noShiftCurveDataList.setLayoutData(gd);
|
noShiftCurveDataList.setLayoutData(gd);
|
||||||
|
|
||||||
if (noShiftCurveArray != null) {
|
|
||||||
// populate the list
|
|
||||||
for (RatingCurveData curve : noShiftCurveArray) {
|
|
||||||
noShiftCurveDataList.add(curve.toString());
|
|
||||||
}
|
|
||||||
noShiftCurveDataList.setEnabled(true);
|
|
||||||
} else {
|
|
||||||
noShiftCurveDataList.setEnabled(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
noShiftCurveDataList.addSelectionListener(new SelectionAdapter() {
|
noShiftCurveDataList.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
|
@ -823,10 +719,27 @@ public class RatingCurveDlg extends CaveSWTDialog implements IRatingCurveSort {
|
||||||
stageTF.setText(String.format("%7.2f", data.getStage()));
|
stageTF.setText(String.format("%7.2f", data.getStage()));
|
||||||
dischargeTF
|
dischargeTF
|
||||||
.setText(String.format("%7.1f", data.getDischarge()));
|
.setText(String.format("%7.1f", data.getDischarge()));
|
||||||
setSelectedCurveData(data);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (noShiftCurveArray != null) {
|
||||||
|
// populate the list
|
||||||
|
RatingCurveShiftData currentShift = null;
|
||||||
|
if (shiftData != null && shiftData.size() > 0) {
|
||||||
|
if (shiftData.get(0).isActive()) {
|
||||||
|
currentShift = shiftData.get(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (RatingCurveData curve : noShiftCurveArray) {
|
||||||
|
noShiftCurveDataList.add(curve.toString());
|
||||||
|
}
|
||||||
|
if (noShiftCurveDataList.getItemCount() > 0) {
|
||||||
|
noShiftCurveDataList.select(0);
|
||||||
|
generateShiftList(currentShift);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
createStageDischargeTextFields(rightComp);
|
createStageDischargeTextFields(rightComp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -988,6 +901,11 @@ public class RatingCurveDlg extends CaveSWTDialog implements IRatingCurveSort {
|
||||||
ratingLbl.setText(label);
|
ratingLbl.setText(label);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (noShiftCurveArray.size() > 0) {
|
||||||
|
RatingCurveData rcd = noShiftCurveArray.get(0);
|
||||||
|
this.stageTF.setText(String.valueOf(rcd.getStage()));
|
||||||
|
this.dischargeTF.setText(String.valueOf(rcd.getDischarge()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1052,10 +970,10 @@ public class RatingCurveDlg extends CaveSWTDialog implements IRatingCurveSort {
|
||||||
* @param rcsd
|
* @param rcsd
|
||||||
*/
|
*/
|
||||||
public void generateShiftList(RatingCurveShiftData rcsd) {
|
public void generateShiftList(RatingCurveShiftData rcsd) {
|
||||||
|
shiftCurveDataList.removeAll();
|
||||||
|
|
||||||
if (rcsd != null) {
|
if (rcsd != null) {
|
||||||
shiftAmount = rcsd.getValue();
|
shiftAmount = rcsd.getValue();
|
||||||
shiftCurveDataList.removeAll();
|
|
||||||
shiftCurveArray = new ArrayList<RatingCurveData>();
|
shiftCurveArray = new ArrayList<RatingCurveData>();
|
||||||
|
|
||||||
// remake the rating curve with shift data
|
// remake the rating curve with shift data
|
||||||
|
@ -1067,36 +985,12 @@ public class RatingCurveDlg extends CaveSWTDialog implements IRatingCurveSort {
|
||||||
}
|
}
|
||||||
// redraw for the full effect
|
// redraw for the full effect
|
||||||
shiftCurveDataList.redraw();
|
shiftCurveDataList.redraw();
|
||||||
|
} else {
|
||||||
|
// make the rating curve with no shift data
|
||||||
|
for (RatingCurveData curve : noShiftCurveArray) {
|
||||||
|
shiftCurveDataList.add(curve.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getSortType() {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return "Stage";
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sort the crest data by stage value.
|
|
||||||
*/
|
|
||||||
public void sortByStage() {
|
|
||||||
sortKey = sortBy.Stage;
|
|
||||||
sortCurveData();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sort the crest data by flow value.
|
|
||||||
*/
|
|
||||||
public void sortByDischarge() {
|
|
||||||
sortKey = sortBy.Discharge;
|
|
||||||
sortCurveData();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sort the curve data.
|
|
||||||
*/
|
|
||||||
private void sortCurveData() {
|
|
||||||
Collections.sort(noShiftCurveArray);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1268,25 +1162,19 @@ public class RatingCurveDlg extends CaveSWTDialog implements IRatingCurveSort {
|
||||||
RatingCurveShiftData rcsd = new RatingCurveShiftData(lid, cal,
|
RatingCurveShiftData rcsd = new RatingCurveShiftData(lid, cal,
|
||||||
new Double(shiftValueTF.getText()), shiftActiveChk
|
new Double(shiftValueTF.getText()), shiftActiveChk
|
||||||
.getSelection());
|
.getSelection());
|
||||||
// remove old
|
|
||||||
if (shiftDataList != null) {
|
if (shiftData.size() > 0 && shiftData.contains(rcsd)) {
|
||||||
int index = shiftDataList.getSelectionIndex();
|
for (RatingCurveShiftData sd: shiftData) {
|
||||||
if (index != -1) {
|
if (rcsd.toString().equals(sd.toString())) {
|
||||||
if (rcsd.getDate().getTime().equals(
|
sd.setActive(rcsd.isActive());
|
||||||
shiftData.get(index).getDate().getTime())) {
|
sd.setDate(rcsd.getDate());
|
||||||
shiftDataList.remove(index);
|
sd.setLid(rcsd.getLid());
|
||||||
shiftData.remove(index);
|
sd.setValue(rcsd.getValue());
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (int i = 0; i < shiftData.size(); i++) {
|
shiftData.add(rcsd);
|
||||||
RatingCurveShiftData data = shiftData.get(i);
|
|
||||||
if (data.getDate().getTime().equals(cal.getTime())) {
|
|
||||||
shiftData.remove(i);
|
|
||||||
shiftDataList.remove(i);
|
|
||||||
i--;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!addedCurveShifts.contains(rcsd)) {
|
if (!addedCurveShifts.contains(rcsd)) {
|
||||||
|
@ -1296,24 +1184,80 @@ public class RatingCurveDlg extends CaveSWTDialog implements IRatingCurveSort {
|
||||||
addedCurveShifts.add(rcsd);
|
addedCurveShifts.add(rcsd);
|
||||||
}
|
}
|
||||||
|
|
||||||
shiftData.add(rcsd);
|
shiftDataList.removeAll();
|
||||||
shiftDataList.add(getShiftListString(rcsd));
|
Collections.sort(shiftData);
|
||||||
shiftDataList.redraw();
|
|
||||||
|
|
||||||
if (shiftActiveChk.getSelection()) {
|
for (RatingCurveShiftData sd: shiftData) {
|
||||||
generateShiftList(rcsd);
|
shiftDataList.add(getShiftListString(sd));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Display the latest shift
|
||||||
|
RatingCurveShiftData currentShift = shiftData.get(0);
|
||||||
|
if (currentShift.isActive()) {
|
||||||
|
generateShiftList(currentShift);
|
||||||
ratingCurveCanvas.updateCurveData(shiftCurveArray,
|
ratingCurveCanvas.updateCurveData(shiftCurveArray,
|
||||||
floodDbl, recordDbl, shiftAmount);
|
floodDbl, recordDbl, currentShift.getValue());
|
||||||
} else {
|
} else {
|
||||||
ratingCurveCanvas.updateCurveData(noShiftCurveArray,
|
ratingCurveCanvas.updateCurveData(noShiftCurveArray,
|
||||||
floodDbl, recordDbl, shiftAmount);
|
floodDbl, recordDbl, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
shiftValueTF.setText("");
|
||||||
|
shiftDateTF.setText("");
|
||||||
|
shiftActiveChk.setSelection(false);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void removeShift() {
|
||||||
|
if (shiftDataList.getItemCount() > 0 && shiftDataList.getSelectionCount() > 0) {
|
||||||
|
MessageBox messageDialog = new MessageBox(shell, SWT.OK | SWT.CANCEL);
|
||||||
|
messageDialog.setText("Shift Remove Confirmation");
|
||||||
|
messageDialog.setMessage("This will remove the highlighted shift.");
|
||||||
|
int response = messageDialog.open();
|
||||||
|
|
||||||
|
if (response == SWT.OK) {
|
||||||
|
String selection = shiftDataList.getItem(shiftDataList.getSelectionIndex());
|
||||||
|
for (RatingCurveShiftData sd: shiftData) {
|
||||||
|
if (getShiftListString(sd).equals(selection)) {
|
||||||
|
removedCurveShifts.add(sd);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
shiftData.removeAll(removedCurveShifts);
|
||||||
|
shiftDataList.removeAll();
|
||||||
|
Collections.sort(shiftData);
|
||||||
|
for (RatingCurveShiftData rcsd : shiftData) {
|
||||||
|
shiftDataList.add(getShiftListString(rcsd));
|
||||||
|
}
|
||||||
|
shiftDataList.redraw();
|
||||||
|
|
||||||
|
if (shiftData.size() > 0) {
|
||||||
|
shiftAmount = shiftData.get(0).getValue();
|
||||||
|
} else {
|
||||||
|
shiftAmount = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
ratingCurveCanvas.updateCurveData(noShiftCurveArray,
|
||||||
|
floodDbl, recordDbl, shiftAmount);
|
||||||
|
|
||||||
|
if (shiftData.size() > 0) {
|
||||||
|
RatingCurveShiftData currentShift = shiftData.get(0);
|
||||||
|
if (currentShift.isActive()) {
|
||||||
|
generateShiftList(currentShift);
|
||||||
|
} else {
|
||||||
|
generateShiftList(null);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
generateShiftList(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Verify validity of input
|
* Verify validity of input
|
||||||
*
|
*
|
||||||
|
@ -1371,44 +1315,40 @@ public class RatingCurveDlg extends CaveSWTDialog implements IRatingCurveSort {
|
||||||
return selectedRatingShift;
|
return selectedRatingShift;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* set the current curve shift
|
|
||||||
*
|
|
||||||
* @param selectedRatingShift
|
|
||||||
*/
|
|
||||||
private void setSelectedShift(RatingCurveShiftData selectedRatingShift) {
|
|
||||||
this.selectedRatingShift = selectedRatingShift;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the editing curve data
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
private RatingCurveData getEditingCurveData() {
|
|
||||||
return selectedRatingPoint;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the selected curve data
|
|
||||||
*
|
|
||||||
* @param selectedRatingPoint
|
|
||||||
*/
|
|
||||||
private void setSelectedCurveData(RatingCurveData selectedRatingPoint) {
|
|
||||||
this.selectedRatingPoint = selectedRatingPoint;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* update the noShiftCurveDataList
|
* update the noShiftCurveDataList
|
||||||
*/
|
*/
|
||||||
private void remakeRatingCurveDataList() {
|
private void remakeRatingCurveDataList() {
|
||||||
|
Collections.sort(noShiftCurveArray);
|
||||||
sortCurveData();
|
int index = noShiftCurveDataList.getSelectionIndex();
|
||||||
noShiftCurveDataList.removeAll();
|
noShiftCurveDataList.removeAll();
|
||||||
|
shiftCurveDataList.removeAll();
|
||||||
for (RatingCurveData rcd : noShiftCurveArray) {
|
for (RatingCurveData rcd : noShiftCurveArray) {
|
||||||
noShiftCurveDataList.add(rcd.toString());
|
noShiftCurveDataList.add(rcd.toString());
|
||||||
}
|
}
|
||||||
noShiftCurveDataList.redraw();
|
|
||||||
|
if (shiftData.size() > 0) {
|
||||||
|
RatingCurveShiftData currentShift = shiftData.get(0);
|
||||||
|
if (currentShift.isActive()) {
|
||||||
|
generateShiftList(currentShift);
|
||||||
|
} else {
|
||||||
|
remakeRatingCurveDataList();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
remakeRatingCurveDataList();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (noShiftCurveDataList.getItemCount() > 0) {
|
||||||
|
if (index >= noShiftCurveDataList.getItemCount()) {
|
||||||
|
noShiftCurveDataList.select(noShiftCurveDataList.getItemCount() - 1);
|
||||||
|
} else if (index >= 0 && index < noShiftCurveArray.size()) {
|
||||||
|
noShiftCurveDataList.select(index);
|
||||||
|
} else {
|
||||||
|
noShiftCurveDataList.select(0);
|
||||||
|
}
|
||||||
|
noShiftCurveDataList.showSelection();
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue