12.11.1-1 baseline

Former-commit-id: 618aa3f316 [formerly 618aa3f316 [formerly 765055b5332ddace3cec2d07e279652de869cfe4]]
Former-commit-id: feec28f274
Former-commit-id: 8843ffd022
This commit is contained in:
Steven Harris 2012-09-27 15:57:45 -05:00
parent 57d4eacbb5
commit a544be6d83
263 changed files with 46335 additions and 36370 deletions

View file

@ -43,8 +43,9 @@ xmlns:xlink="http://www.w3.org/1999/xlink" style="stroke: rgb(255,255,255);">
]]>
</style>
<symbol overflow="visible" id="plotData" class="info">
<text id="turbInensity" plotMode="table" class="weather" plotLookupTable="airep_turb_intens_trans.txt" plotParam="FLT_HZD" x="0" y="0">0</text>
<text id="fltLvlText" plotMode="text" plotParam="FLT_LVL" plotFormat="%3.0f" plotUnit="hft" style="text-anchor: end;" x="-15px" y="0px">75</text>
<text id="airepturbIntensity" plotMode="table" class="weather" plotLookupTable="turb_intens_trans.txt" plotParam="TBI" x="0" y="0">0</text>
<text id="airepturbFreq" plotMode="table" class="weather" plotLookupTable="turb_freq_trans.txt" plotParam="TBF" style="text-anchor: end" x="0" y="-10">0</text>
<text id="airepfltLvlText" plotMode="text" plotParam="FLT_LVL" plotFormat="%3.0f" plotUnit="hft" style="text-anchor: end;" x="-15px" y="0px">75</text>
</symbol>
</defs>

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View file

@ -46,6 +46,7 @@ from java.util import HashSet
# ------------ ---------- ----------- --------------------------
# 04/01/09 njensen Initial Creation.
# 08/20/2012 #1077 randerso Fixed backgroundColor setting
# 09/13/2012 #1147 dgilling Allow map labels to be disabled.
#
#
#
@ -160,8 +161,7 @@ class GFEPainter(VizPainter.VizPainter):
rsc.getCapability(LabelableCapability).setxOffset(xOffset)
if yOffset is not None:
rsc.getCapability(LabelableCapability).setyOffset(yOffset)
if labelAttribute is not None:
rsc.getCapability(LabelableCapability).setLabelField(labelAttribute)
rsc.getCapability(LabelableCapability).setLabelField(labelAttribute)
if fontOffset is not None:
mag = Double(1.26 ** fontOffset)
rsc.getCapability(MagnificationCapability).setMagnification(mag)

View file

@ -88,7 +88,8 @@ fi
while [ $exitVal -ne 0 ]
do
curTime=`date +%Y%m%d_%H%M%S`
LOGFILE=${LOGDIR}/alertviz_${curTime}.log
LOGFILE=${LOGDIR}/alertviz_${curTime}_console.log
export LOGFILE_ALERTVIZ=${LOGDIR}/alertviz_${curTime}_admin.log
#first check if we can write to the directory
if [ -w ${LOGDIR} ]; then

View file

@ -116,7 +116,8 @@ fi
export pid=$$
curTime=`date +%Y%m%d_%H%M%S`
LOGFILE=${LOGDIR}/cave_${curTime}_pid_${pid}.log
LOGFILE=${LOGDIR}/cave_${curTime}_pid_${pid}_console.log
export LOGFILE_CAVE=${LOGDIR}/cave_${curTime}_pid_${pid}_alertviz.log
redirect="TRUE"
for flag in $@; do

View file

@ -632,7 +632,7 @@ public class AlertVisualization implements ITimerAction, IAudioAction,
|| statMsg.getSourceKey().equals("GDN_ADMIN");
if (isGdnAdminMessage) {
Container.logInternal(statMsg);
// Container.logInternal(statMsg);
if ((statMsg.getDetails() != null)
&& (statMsg.getDetails().contains("Error")
|| statMsg.getDetails().contains("Exception")

View file

@ -29,3 +29,5 @@ Import-Package: com.raytheon.uf.common.python,
com.raytheon.uf.viz.python.swt,
com.raytheon.uf.viz.python.swt.widgets
Bundle-ActivationPolicy: lazy
Eclipse-BuddyPolicy: ext, registered, global
Eclipse-RegisterBuddy: org.apache.log4j

View file

@ -6,4 +6,5 @@ bin.includes = META-INF/,\
lib/derbyrun.jar,\
lib/derby.jar,\
statusMessage.xsd,\
config.xml
config.xml,\
log4j-alertviz.xml

View file

@ -0,0 +1,79 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
<!-- general application log -->
<appender name="console" class="org.apache.log4j.ConsoleAppender">
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%-5p %d [%t] %c{1}: %m%n"/>
</layout>
<filter class="org.apache.log4j.varia.LevelRangeFilter">
<param name="levelMin" value="DEBUG" />
<param name="levelMax" value="INFO" />
</filter>
</appender>
<appender name="errConsole" class="org.apache.log4j.ConsoleAppender">
<param name="Target" value="System.err"/>
<param name="Threshold" value="WARN" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%-5p %d [%t] %c{1}: %m%n"/>
</layout>
</appender>
<appender name="AlertVizAdminLogAppender" class="com.raytheon.uf.viz.alertviz.EnvConfigurableRollingFileAppender">
<param name="envLogVar" value="LOGFILE_ALERTVIZ" />
<param name="maxFileSize" value="2GB"/>
<param name="maxBackupIndex" value="5"/>
<param name="Append" value="true"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%-5p %d [%t] : %m%n"/>
</layout>
</appender>
<logger name="AlertVizAdminLogger" additivity="false">
<level value="ALL"/>
<appender-ref ref="AlertVizAdminLogAppender"/>
</logger>
<logger name="com.raytheon">
<level value="INFO"/>
</logger>
<logger name="com.tc">
<level value="WARN"/>
</logger>
<logger name="mx4j">
<level value="ERROR"/>
</logger>
<logger name="org.apache">
<level value="INFO"/>
</logger>
<logger name="org.apache.activemq.spring">
<level value="WARN"/>
</logger>
<logger name="org.apache.commons.beanutils">
<level value="WARN"/>
</logger>
<logger name="org.apache.qpid">
<level value="WARN"/>
</logger>
<logger name="org.geotools">
<level value="WARN"/>
</logger>
<logger name="org.apache.xbean.spring">
<level value="WARN"/>
</logger>
<logger name="org.springframework">
<level value="ERROR"/>
</logger>
<logger name="uk.ltd.getahead">
<level value="WARN"/>
</logger>
<!-- default logging -->
<root>
<level value="INFO"/>
<appender-ref ref="console"/>
<appender-ref ref="errConsole"/>
</root>
</log4j:configuration>

View file

@ -230,7 +230,7 @@ public class AlertvizJob extends Job {
e);
StatusMessage sm = new StatusMessage();
sm.setPriority(Priority.CRITICAL);
sm.setMachine("LOCAL");
sm.setMachineToCurrent();
sm.setCategory("GDN_ADMIN");
sm.setSourceKey("GDN_ADMIN");
sm.setMessage(e.getMessage());

View file

@ -36,7 +36,7 @@ import com.raytheon.uf.viz.alertviz.config.Category;
import com.raytheon.uf.viz.alertviz.config.Configuration;
import com.raytheon.uf.viz.alertviz.config.ForcedConfiguration;
import com.raytheon.uf.viz.alertviz.config.Source;
import com.raytheon.uf.viz.alertviz.internal.ArchiveLogJob;
import com.raytheon.uf.viz.alertviz.internal.PurgeLogJob;
import com.raytheon.uf.viz.alertviz.internal.LogMessageDAO;
import com.raytheon.uf.viz.core.VizApp;
@ -63,8 +63,8 @@ public class Container implements IConfigurationChangedListener {
public static final String SOURCE_MISSING = "Source was not found";
private transient static final org.apache.log4j.Logger internalLogger = Logger
.getLogger("AlertVizLogger");
private transient static final org.apache.log4j.Logger adminLogger = Logger
.getLogger("AlertVizAdminLogger");
private Configuration configuration;
@ -96,7 +96,7 @@ public class Container implements IConfigurationChangedListener {
.getForcedConfiguration();
ConfigurationManager.getInstance().addListener(this);
this.callbacks = callbacks;
ArchiveLogJob archive = new ArchiveLogJob();
PurgeLogJob archive = new PurgeLogJob();
archive.schedule();
}
@ -171,7 +171,7 @@ public class Container implements IConfigurationChangedListener {
// for now, just send to the regular log
StatusMessage sm = new StatusMessage();
sm.setPriority(priority);
sm.setMachine("LOCAL");
sm.setMachineToCurrent();
sm.setSourceKey("GDN_ADMIN");
sm.setCategory("GDN)ADMIN");
sm.setMessage(msg);
@ -319,24 +319,25 @@ public class Container implements IConfigurationChangedListener {
String cat = message.getCategory();
String source = message.getSourceKey();
if ((cat != null && cat.equalsIgnoreCase("GDN_ADMIN"))
|| (source != null && source.equalsIgnoreCase("GDN_ADMIN"))) {
boolean isInternal = (cat != null && cat.equalsIgnoreCase("GDN_ADMIN"))
|| (source != null && source.equalsIgnoreCase("GDN_ADMIN"));
if (isInternal) {
switch (message.getPriority()) {
case CRITICAL:
internalLogger.fatal(message);
adminLogger.fatal(message);
break;
case SIGNIFICANT:
internalLogger.error(message);
adminLogger.error(message);
break;
case PROBLEM:
internalLogger.warn(message);
adminLogger.warn(message);
break;
case EVENTA: // fall through
case EVENTB:
internalLogger.info(message);
adminLogger.info(message);
break;
case VERBOSE:
internalLogger.debug(message);
adminLogger.debug(message);
break;
}
}

View file

@ -0,0 +1,80 @@
/**
* 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;
import org.apache.log4j.RollingFileAppender;
import org.apache.log4j.helpers.LogLog;
/**
* RollingFileAppender retrieves the value set for property EnvLogVar from the
* system environment to define the log file.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Sep 10, 2012 bgonzale Initial creation
*
* </pre>
*
* @author bgonzale
* @version 1.0
*/
public class EnvConfigurableRollingFileAppender extends RollingFileAppender {
private String envLogVar;
/**
* @param envLogVar
* the envLogVar to set
*/
public void setEnvLogVar(String envLogVar) {
this.envLogVar = envLogVar;
setFileFromEnv();
}
/**
* @return the envLogVar
*/
public String getEnvLogVar() {
return envLogVar;
}
private void setFileFromEnv() {
if (envLogVar == null || envLogVar.isEmpty()) {
LogLog.error("Appender [" + name
+ "] requires EnvLogVar to be set.");
} else {
String file = System.getenv(envLogVar);
if (file == null || file.isEmpty()) {
LogLog.error("Appender [" + name
+ "] needs environment variable, " + envLogVar
+ ", to be set.");
} else {
setFile(file);
}
}
}
}

View file

@ -19,6 +19,7 @@
**/
package com.raytheon.uf.viz.alertviz;
import org.apache.log4j.Logger;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.ErrorDialog;
@ -50,6 +51,9 @@ import com.raytheon.uf.viz.core.status.VizStatusInternal;
public class SystemStatusHandler extends AbstractStatusHandler {
private transient static final org.apache.log4j.Logger logger = Logger
.getLogger("CaveLogger");
private static final String WORKSTATION = "WORKSTATION";
/*
@ -66,14 +70,13 @@ public class SystemStatusHandler extends AbstractStatusHandler {
if (status instanceof VizStatusInternal) {
VizStatusInternal vs = (VizStatusInternal) status;
sm = new StatusMessage(vs.getSource(), vs.getCategory(),
vs.getPriority(), vs.getPluginName(), vs.getMessage(),
vs.getException());
sm = vs.toStatusMessage();
} else {
sm = from(status);
}
try {
logStatus(sm);
AlertVizClient.sendMessage(sm);
} catch (final AlertvizException e) {
// not a good situation, since we can't communicate with the log
@ -111,7 +114,7 @@ public class SystemStatusHandler extends AbstractStatusHandler {
StatusMessage sm = new StatusMessage();
sm.setCategory(WORKSTATION);
sm.setMachine("LOCAL");
sm.setMachineToCurrent();
switch (status.getSeverity()) {
case Status.ERROR:
sm.setPriority(Priority.SIGNIFICANT);
@ -184,4 +187,26 @@ public class SystemStatusHandler extends AbstractStatusHandler {
int count) throws AlertvizException {
return LogMessageDAO.getInstance().load(count, category);
}
private void logStatus(StatusMessage status) {
switch (status.getPriority()) {
case CRITICAL:
logger.fatal(status);
break;
case SIGNIFICANT:
logger.error(status);
break;
case PROBLEM:
logger.warn(status);
break;
case EVENTA: // fall through
case EVENTB:
logger.info(status);
break;
case VERBOSE:
logger.debug(status);
break;
}
}
}

View file

@ -250,7 +250,7 @@ public class LogMessageDAO {
}
public void save(StatusMessage sm) throws AlertvizException {
// Container.logInternal(sm);
Container.logInternal(sm);
synchronized (this) {
boolean errorOccurred = false;
ResultSet rs = null;

View file

@ -19,7 +19,6 @@
**/
package com.raytheon.uf.viz.alertviz.internal;
import java.io.File;
import java.sql.Timestamp;
import org.eclipse.core.runtime.IProgressMonitor;
@ -32,13 +31,9 @@ import org.eclipse.swt.widgets.Display;
import com.raytheon.uf.viz.alertviz.Activator;
import com.raytheon.uf.viz.alertviz.AlertvizException;
import com.raytheon.uf.viz.alertviz.Constants;
import com.raytheon.uf.viz.alertviz.LogUtil;
import com.raytheon.uf.viz.alertviz.LogUtil.Order;
import com.raytheon.uf.viz.core.VizApp;
import com.raytheon.uf.viz.core.localization.LocalizationManager;
/**
* Purges the database, and archives the old log entries to a text file
* Purges old database entries.
*
* <pre>
* SOFTWARE HISTORY
@ -50,26 +45,16 @@ import com.raytheon.uf.viz.core.localization.LocalizationManager;
* @author chammack
* @version 1.0
*/
public class ArchiveLogJob extends Job {
private int numberOfLogsToKeep;
public class PurgeLogJob extends Job {
private int ageOfLogInHours;
private static final int DEFAULT_NUMBER_OF_LOGS = 10;
private static final int DEFAULT_AGE_OF_LOG_IN_HRS = 12;
private static final int MILLISECONDS_IN_HOUR = 60 * 60 * 1000;
public ArchiveLogJob() {
super("Archive Log");
this.setSystem(true);
numberOfLogsToKeep = Activator.getDefault().getPreferenceStore()
.getInt(Constants.P_NUMBER_OF_LOGS);
if (numberOfLogsToKeep == 0) {
this.numberOfLogsToKeep = DEFAULT_NUMBER_OF_LOGS;
}
public PurgeLogJob() {
super("Archive Log Purge");
ageOfLogInHours = Activator.getDefault().getPreferenceStore()
.getInt(Constants.P_MAX_AGE_OF_LOGS);
@ -90,14 +75,8 @@ public class ArchiveLogJob extends Job {
long now = System.currentTimeMillis();
if ((now - lastPurgeInMs) > (ageOfLogInHours * MILLISECONDS_IN_HOUR)) {
String s = LocalizationManager.getUserDir() + "textLogs"
+ File.separator + VizApp.getHostName()
+ File.separator + "log";
LogUtil.rollLogs(s, numberOfLogsToKeep);
Timestamp ts = new Timestamp(now
- (ageOfLogInHours * MILLISECONDS_IN_HOUR));
LogUtil.saveLogToFile(new File(s + ".0"), ts, Order.BEFORE);
LogMessageDAO.getInstance().purge(ts);
}
} catch (AlertvizException e) {
@ -111,7 +90,7 @@ public class ArchiveLogJob extends Job {
.openError(
Display.getDefault().getActiveShell(),
"Error",
"Error rotating saving and rotating logs. Archived logs may not be stored",
"Error purging logs.",
s);
}

View file

@ -34,7 +34,7 @@ Require-Bundle: org.eclipse.ui,
com.raytheon.uf.common.geospatial;bundle-version="1.12.1174"
Bundle-ActivationPolicy: lazy
Eclipse-BuddyPolicy: ext, registered, global
Eclipse-RegisterBuddy: org.apache.velocity, com.raytheon.edex.common, com.raytheon.uf.common.serialization, com.raytheon.uf.common.serialization.comm, com.raytheon.uf.common.status, com.raytheon.uf.common.dataplugin.level
Eclipse-RegisterBuddy: org.apache.velocity, org.apache.log4j, com.raytheon.edex.common, com.raytheon.uf.common.serialization, com.raytheon.uf.common.serialization.comm, com.raytheon.uf.common.status, com.raytheon.uf.common.dataplugin.level
Export-Package: com.raytheon.uf.viz.core,
com.raytheon.uf.viz.core.alerts,
com.raytheon.uf.viz.core.auth,

View file

@ -5,4 +5,5 @@ bin.includes = META-INF/,\
plugin.xml,\
config.xml,\
scriptTemplates/,\
schema/
schema/,\
log4j-viz-core.xml

View file

@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
<appender name="console" class="org.apache.log4j.ConsoleAppender">
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%-5p %d [%t] %c{1}: %m%n"/>
</layout>
<filter class="org.apache.log4j.varia.LevelRangeFilter">
<param name="levelMin" value="DEBUG" />
<param name="levelMax" value="INFO" />
</filter>
</appender>
<appender name="errConsole" class="org.apache.log4j.ConsoleAppender">
<param name="Target" value="System.err"/>
<param name="Threshold" value="WARN" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%-5p %d [%t] %c{1}: %m%n"/>
</layout>
</appender>
<appender name="CaveLogAppender" class="com.raytheon.uf.viz.alertviz.EnvConfigurableRollingFileAppender">
<param name="envLogVar" value="LOGFILE_CAVE" />
<param name="maxFileSize" value="2GB"/>
<param name="maxBackupIndex" value="5"/>
<param name="Append" value="true"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%-5p %d [%t] %m%n"/>
</layout>
</appender>
<appender name="AsyncCaveLogAppender" class="org.apache.log4j.AsyncAppender">
<param name="BufferSize" value="500"/>
<appender-ref ref="CaveLogAppender"/>
</appender>
<logger name="CaveLogger" additivity="false">
<level value="ALL"/>
<appender-ref ref="AsyncCaveLogAppender"/>
</logger>
<logger name="com.raytheon">
<level value="INFO"/>
</logger>
<logger name="com.tc">
<level value="WARN"/>
</logger>
<logger name="mx4j">
<level value="ERROR"/>
</logger>
<logger name="org.apache">
<level value="INFO"/>
</logger>
<logger name="org.apache.activemq.spring">
<level value="WARN"/>
</logger>
<logger name="org.apache.commons.beanutils">
<level value="WARN"/>
</logger>
<logger name="org.apache.qpid">
<level value="WARN"/>
</logger>
<logger name="org.geotools">
<level value="WARN"/>
</logger>
<logger name="org.apache.xbean.spring">
<level value="WARN"/>
</logger>
<logger name="org.springframework">
<level value="ERROR"/>
</logger>
<logger name="uk.ltd.getahead">
<level value="WARN"/>
</logger>
<root>
<level value="INFO"/>
<appender-ref ref="console"/>
<appender-ref ref="errConsole"/>
</root>
</log4j:configuration>

View file

@ -105,18 +105,6 @@ public abstract class AbstractTimeMatcher {
DataTime[] availableTimes, IDescriptor descriptor)
throws VizException;
/**
* Set the matched list of times to a particular resource
*
* @param dataTimes
* @param rsc
* @param descriptor
* @throws VizException
*/
public abstract void setTimeList(DataTime[] dataTimes,
AbstractVizResource<?, ?> rsc, IDescriptor descriptor)
throws VizException;
/**
* Given a list of RenderableDisplays, determine the order to instantiate
* them in to get the correct time match settings, should only be called

View file

@ -64,6 +64,7 @@ import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
import com.raytheon.uf.viz.core.rsc.IResourceGroup;
import com.raytheon.uf.viz.core.rsc.ResourceGroup;
import com.raytheon.uf.viz.core.rsc.ResourceList;
import com.raytheon.uf.viz.core.time.TimeMatchingJob;
/**
* AbstractDescriptor
@ -192,33 +193,37 @@ public abstract class AbstractDescriptor extends ResourceGroup implements
}
if (basis != newBasis) {
redoTimeMatching();
TimeMatchingJob.scheduleTimeMatch(AbstractDescriptor.this);
if (renderableDisplay != null
&& renderableDisplay.getContainer() != null) {
IDisplayPaneContainer container = renderableDisplay.getContainer();
for (IDisplayPane pane : container.getDisplayPanes()) {
if (pane.getDescriptor() != AbstractDescriptor.this) {
TimeMatchingJob.scheduleTimeMatch(pane.getDescriptor());
}
}
}
}
}
});
}
private void redoTimeMatching() throws VizException {
if (getTimeMatcher() != null) {
getTimeMatcher().redoTimeMatching(this);
}
if (renderableDisplay != null
&& renderableDisplay.getContainer() != null) {
IDisplayPaneContainer container = renderableDisplay.getContainer();
for (IDisplayPane pane : container.getDisplayPanes()) {
if (pane.getDescriptor() != this) {
if (pane.getDescriptor().getTimeMatcher() != null) {
pane.getDescriptor().getTimeMatcher()
.redoTimeMatching(pane.getDescriptor());
}
}
}
}
}
protected void postAddListener(ResourcePair rp) {
if (rp.getResource() != null && getTimeMatcher() != null) {
// We need to run time matching immediately beacuse order
// constructed is important for time matching so we must do it now
// instead of scheduling since another resource could be added by
// the time it runs
AbstractTimeMatcher tm = getTimeMatcher();
tm.redoTimeMatching(rp.getResource());
try {
tm.redoTimeMatching(this);
} catch (VizException e) {
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(),
e);
}
}
}
@SuppressWarnings("unchecked")

View file

@ -35,7 +35,6 @@ 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.LocalizationInternalFile;
import com.raytheon.uf.common.localization.exception.LocalizationException;
import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException;
import com.raytheon.uf.common.localization.msgs.AbstractUtilityCommand;
import com.raytheon.uf.common.localization.msgs.AbstractUtilityResponse;
@ -43,9 +42,6 @@ import com.raytheon.uf.common.localization.msgs.ListResponseEntry;
import com.raytheon.uf.common.localization.msgs.ProtectedFileCommand;
import com.raytheon.uf.common.localization.msgs.ProtectedFileResponse;
import com.raytheon.uf.common.localization.msgs.UtilityRequestMessage;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.common.util.FileUtil;
/**
@ -66,9 +62,6 @@ import com.raytheon.uf.common.util.FileUtil;
*/
public class CAVELocalizationAdapter implements ILocalizationAdapter {
private static transient IUFStatusHandler statusHandler = UFStatus
.getHandler(CAVELocalizationAdapter.class.getPackage().getName(),
"WORKSTATION", "CAVE");
private static final LocalizationManager manager = LocalizationManager
.getInstance();
@ -198,7 +191,7 @@ public class CAVELocalizationAdapter implements ILocalizationAdapter {
response.date = null;
response.existsOnServer = false;
response.fileName = fileName;
response.isProtected = false;
response.protectedLevel = null;
File file = getPath(caveConfigBase, fileName);
response.isDirectory = file != null && file.isDirectory();
responses.add(response);
@ -229,17 +222,6 @@ public class CAVELocalizationAdapter implements ILocalizationAdapter {
}
manager.retrieve(file);
if (file.isProtected()) {
File f;
try {
f = file.getFile(false);
f.setReadOnly();
} catch (LocalizationException e) {
// shouldn't happen since file was just retrieved
statusHandler.handle(Priority.PROBLEM, "Error retrieving file",
e);
}
}
}
/*
@ -253,7 +235,6 @@ public class CAVELocalizationAdapter implements ILocalizationAdapter {
@Override
public boolean save(File localFile, LocalizationContext context,
String fileName) throws LocalizationOpFailedException {
if (context.getLocalizationLevel().isSystemLevel()) {
throw new UnsupportedOperationException(
"Saving to the System Level, "
@ -416,7 +397,7 @@ public class CAVELocalizationAdapter implements ILocalizationAdapter {
ListResponse response = new ListResponse();
response.context = context;
response.isDirectory = configFile.isDirectory();
response.isProtected = false;
response.protectedLevel = null;
response.existsOnServer = false;
response.fileName = p;
response.date = new Date(configFile.lastModified());
@ -442,10 +423,13 @@ public class CAVELocalizationAdapter implements ILocalizationAdapter {
response.existsOnServer = false;
response.fileName = pfr.getPathName();
response.isDirectory = locFile.isDirectory();
response.isProtected = pfr.isProtectedFile();
response.protectedLevel = pfr.getProtectedLevel();
if (!response.isProtected
|| (response.context.getLocalizationLevel() == LocalizationLevel.BASE)) {
if (response.protectedLevel == null
|| response.context.getLocalizationLevel().compareTo(
response.protectedLevel) <= 0) {
// if not protected or protected level is less than/equal to
// our level, add response
responses.add(response);
}
}
@ -486,7 +470,7 @@ public class CAVELocalizationAdapter implements ILocalizationAdapter {
lr.isDirectory = entry.isDirectory();
}
lr.context = context;
lr.isProtected = entry.isProtectedFile();
lr.protectedLevel = entry.getProtectedLevel();
lr.existsOnServer = entry.isExistsOnServer();
return lr;
}

View file

@ -169,8 +169,7 @@ public abstract class AbstractRequestableResourceData extends
// 3. Throw an exception of no data available and user has not specified
// to suppress load errors
// 4. Retrieve the PluginDataObjects for all DataTimes
// 5. Notify the time matcher that load has completed with the set of
// datatimes
// 5. Construct resource with loaded pdos
DataTime[] availableTimes = this.getAvailableTimes();
DataTime[] dataTimes = descriptor.getTimeMatcher().initialLoad(
loadProperties, availableTimes, descriptor);
@ -205,9 +204,8 @@ public abstract class AbstractRequestableResourceData extends
}
resource = constructResource(loadProperties, data);
descriptor.getTimeMatcher().setTimeList(dataTimes, resource,
descriptor);
}
return resource;
}

View file

@ -88,8 +88,9 @@ public class VizStatusHandler implements IUFStatusHandler {
this.source = factory.getSource(source, pluginId);
}
}
StatusManager.getManager().handle(
new VizStatusInternal(status, category, source, pluginId));
VizStatusInternal vizStatus = new VizStatusInternal(status, category,
source, pluginId);
StatusManager.getManager().handle(vizStatus);
}
@Override

View file

@ -22,6 +22,7 @@ package com.raytheon.uf.viz.core.status;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import com.raytheon.uf.common.message.StatusMessage;
import com.raytheon.uf.common.status.UFStatus;
/**
@ -170,4 +171,9 @@ public class VizStatusInternal extends UFStatus implements IStatus {
return pluginName;
}
public StatusMessage toStatusMessage() {
return new StatusMessage(this.source, this.category, this.priority,
this.pluginName, this.message, this.exception);
}
}

View file

@ -138,18 +138,33 @@ public class TileLevel {
DefaultGeographicCRS.WGS84));
corrector = new WorldWrapCorrector(targetGeometry);
// Calculate pixel density
// Grab the center x, 3/4 y of the map
double mapXCenter = targetGeometry.getGridRange().getSpan(0) * 0.5;
double mapYCenter = targetGeometry.getGridRange().getSpan(1) * 0.75;
Envelope levelEnv = levelGeometry.getEnvelope();
double[] in = new double[] {
levelEnv.getMinimum(0) + (levelEnv.getSpan(0) / 2),
levelEnv.getMinimum(1) + (levelEnv.getSpan(1) / 2) };
double[] out = new double[in.length];
tileCRSToTargetGrid.transform(in, 0, out, 0, 1);
double[] input = new double[] { mapXCenter, mapYCenter,
mapXCenter + 1, mapYCenter + 1 };
double mapPointX = out[0];
double mapPointY = out[1];
GridEnvelope targetEnv = targetGeometry.getGridRange();
if (targetEnv.getLow(0) > mapPointX
|| targetEnv.getHigh(0) < mapPointX
|| targetEnv.getLow(1) > mapPointY
|| targetEnv.getHigh(1) < mapPointY) {
// Center of tile level outside target grid, use something on
// target grid for calculations
mapPointX = targetEnv.getLow(0) + targetEnv.getSpan(0) * 0.5;
mapPointY = targetEnv.getLow(1)
+ targetGeometry.getGridRange().getSpan(1) * 0.75;
}
double[] input = new double[] { mapPointX, mapPointY,
mapPointX + 1, mapPointY + 1 };
double[] output = new double[input.length];
tileCRSToTargetGrid.inverse().transform(input, 0, output, 0, 2);
levelGeometry.getGridToCRS(PixelInCell.CELL_CORNER).inverse()
.transform(output, 0, input, 0, 2);
crsToGrid.transform(output, 0, input, 0, 2);
pixelDensity = 1.0 / Math.abs(new Coordinate(input[0], input[1],
0.0).distance(new Coordinate(input[2], input[3], 0.0)));
} catch (Exception e) {

View file

@ -114,7 +114,7 @@ public class TileSetRenderable implements IRenderable {
.getHandler(TileSetRenderable.class);
/** Screen pixel to image pixel threshold at which we change levels */
protected static final double LEVEL_CHANGE_THRESHOLD = 2.0;
protected static final double LEVEL_CHANGE_THRESHOLD = 1.75;
/** Job pool for tile creation */
protected static final JobPool tileCreationPool = new JobPool(

View file

@ -50,6 +50,7 @@ import com.raytheon.uf.viz.core.drawables.AbstractRenderableDisplay;
import com.raytheon.uf.viz.core.drawables.FrameCoordinator;
import com.raytheon.uf.viz.core.drawables.IDescriptor;
import com.raytheon.uf.viz.core.drawables.IDescriptor.FramesInfo;
import com.raytheon.uf.viz.core.drawables.IRenderableDisplay;
import com.raytheon.uf.viz.core.drawables.ResourcePair;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.globals.VizGlobalsManager;
@ -61,7 +62,6 @@ import com.raytheon.uf.viz.core.rsc.IResourceDataChanged.ChangeType;
import com.raytheon.uf.viz.core.rsc.IResourceGroup;
import com.raytheon.uf.viz.core.rsc.LoadProperties;
import com.raytheon.uf.viz.core.rsc.ResourceList;
import com.raytheon.uf.viz.core.time.TimeMatchingJob;
import com.raytheon.uf.viz.d2d.core.D2DLoadProperties;
/**
@ -73,7 +73,6 @@ import com.raytheon.uf.viz.d2d.core.D2DLoadProperties;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Feb 10, 2009 chammack Initial creation
* 2012-04-20 DR 14699 D. Friedman Work around race conditions
*
* </pre>
*
@ -124,10 +123,6 @@ public class D2DTimeMatcher extends AbstractTimeMatcher implements
private AbstractTimeMatchingConfigurationFactory configFactory;
// DR 14699 work arounds
private boolean needRetry;
private int nRetries;
/**
* Default Constructor.
*/
@ -158,8 +153,6 @@ public class D2DTimeMatcher extends AbstractTimeMatcher implements
public void redoTimeMatching(IDescriptor descriptor) throws VizException {
synchronized (this) {
needRetry = false;
if (timeMatchBasis != null) {
IDescriptor tmDescriptor = timeMatchBasis.getDescriptor();
if (tmDescriptor != null && tmDescriptor != descriptor) {
@ -183,11 +176,8 @@ public class D2DTimeMatcher extends AbstractTimeMatcher implements
Iterator<ResourcePair> pairIterator = descriptor.getResourceList()
.listIterator();
while (pairIterator.hasNext()) {
ResourcePair rp = pairIterator.next();
AbstractVizResource<?, ?> rsc = rp
AbstractVizResource<?, ?> rsc = pairIterator.next()
.getResource();
if (rsc == null && rp.getResourceData() instanceof AbstractRequestableResourceData)
needRetry = true;
recursiveOverlay(descriptor, new FramesInfo(timeSteps, -1,
resourceTimeMap), rsc);
}
@ -204,24 +194,18 @@ public class D2DTimeMatcher extends AbstractTimeMatcher implements
timeMatchUpdate(entry.getKey(), entry.getValue());
}
}
if (needRetry) {
if (nRetries < 200) {
++nRetries;
TimeMatchingJob.scheduleTimeMatch(descriptor);
}
} else
nRetries = 0;
}
}
private int indexToUpdateTo(IDescriptor descriptor, DataTime[] oldTimes,
int oldIndex, DataTime[] frames, int startFrame) {
int frameToUse = startFrame;
IDisplayPaneContainer container = descriptor.getRenderableDisplay()
.getContainer();
if (container != null && container.getLoopProperties().isLooping()) {
return frameToUse;
IRenderableDisplay display = descriptor.getRenderableDisplay();
if (display != null && display.getContainer() != null) {
IDisplayPaneContainer container = display.getContainer();
if (container.getLoopProperties().isLooping()) {
return frameToUse;
}
}
switch (descriptor.getFrameCoordinator().getAnimationMode()) {
case Latest: {
@ -322,8 +306,6 @@ public class D2DTimeMatcher extends AbstractTimeMatcher implements
if (rsc instanceof IResourceGroup) {
for (ResourcePair rp : ((IResourceGroup) rsc).getResourceList()) {
AbstractVizResource<?, ?> rsc1 = rp.getResource();
if (rsc1 == null && rp.getResourceData() instanceof AbstractRequestableResourceData)
needRetry = true;
recursiveOverlay(descriptor, framesInfo, rsc1);
}
}
@ -332,9 +314,7 @@ public class D2DTimeMatcher extends AbstractTimeMatcher implements
TimeMatchingConfiguration config = getConfiguration(rsc
.getLoadProperties());
DataTime[] timeSteps = getFrameTimes(descriptor, framesInfo);
if (Arrays.equals(timeSteps, config.getLastBaseTimes()) &&
config.getLastFrameTimes() != null &&
config.getLastFrameTimes().length > 0) {
if (Arrays.equals(timeSteps, config.getLastBaseTimes())) {
framesInfo.getTimeMap().put(rsc, config.getLastFrameTimes());
} else {
config = config.clone();
@ -839,41 +819,6 @@ public class D2DTimeMatcher extends AbstractTimeMatcher implements
return timeMatchBasis;
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.viz.core.AbstractTimeMatcher#setTimeList(com.raytheon
* .uf.common.time.DataTime[],
* com.raytheon.uf.viz.core.rsc.AbstractVizResource,
* com.raytheon.uf.viz.core.drawables.IDescriptor)
*/
@Override
public void setTimeList(DataTime[] dataTimes,
AbstractVizResource<?, ?> rsc, IDescriptor descriptor)
throws VizException {
((AbstractDescriptor) descriptor).getTimeMatchingMap().put(rsc,
dataTimes);
// if the resource is the basis , set the time to the last
// time
if (dataTimes.length > 0
&& (rsc == timeMatchBasis || timeMatchBasis == null)) {
boolean setFrameTimes = true;
// If there are any null times we do not want to set this as the
// frame times, that means we were matched against a time match
// basis that has since been removed.
for (DataTime time : dataTimes) {
setFrameTimes = setFrameTimes && time != null;
}
if (setFrameTimes) {
descriptor.setFramesInfo(new FramesInfo(dataTimes,
dataTimes.length - 1));
changeTimeMatchBasis(rsc);
}
}
}
public boolean hasTimeMatchBasis() {
return (timeMatchBasis != null);
}

View file

@ -1400,6 +1400,11 @@
<handler
class="com.raytheon.uf.viz.d2d.ui.actions.TimeOptionsAction"
commandId="com.raytheon.uf.viz.d2d.ui.actions.timeOptionsAction">
<activeWhen>
<with variable="activeEditor">
<instanceof value="com.raytheon.uf.viz.core.IDisplayPaneContainer"/>
</with>
</activeWhen>
</handler>
<handler
class="com.raytheon.uf.viz.d2d.ui.actions.LocateCursorAction"
@ -1485,6 +1490,11 @@
<handler
class="com.raytheon.uf.viz.d2d.ui.actions.CopyOutAWIPSProcedure"
commandId="com.raytheon.viz.ui.copyOutAWIPSProcedure">
<activeWhen>
<with variable="activeEditor">
<instanceof value="com.raytheon.uf.viz.core.IDisplayPaneContainer"/>
</with>
</activeWhen>
</handler>
<handler
class="com.raytheon.uf.viz.d2d.ui.actions.SetPerspectiveHandler"
@ -1497,6 +1507,11 @@
<handler
class="com.raytheon.uf.viz.d2d.ui.actions.ShowPrintDialog"
commandId="com.raytheon.uf.viz.d2d.ui.actions.showPrintDialog">
<activeWhen>
<with variable="activeEditor">
<instanceof value="com.raytheon.uf.viz.core.IDisplayPaneContainer"/>
</with>
</activeWhen>
</handler>
<handler
class="com.raytheon.uf.viz.d2d.ui.actions.IncreaseBlendAmount"
@ -1509,6 +1524,11 @@
<handler
class="com.raytheon.uf.viz.d2d.ui.actions.ToggleTool"
commandId="com.raytheon.uf.viz.d2d.ui.actions.toggleTool">
<activeWhen>
<with variable="activeEditor">
<instanceof value="com.raytheon.uf.viz.core.IDisplayPaneContainer"/>
</with>
</activeWhen>
</handler>
</extension>
<extension

View file

@ -68,6 +68,9 @@ public class TimeOptionsAction extends AbstractTool {
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
super.execute(event);
if (this.editor == null) {
return null;
}
IRenderableDisplay iDisplay = this.editor.getActiveDisplayPane()
.getRenderableDisplay();
D2DTimeMatcher matcher = ((D2DTimeMatcher) iDisplay.getDescriptor()

View file

@ -91,12 +91,16 @@ public class LocalizationSaveAsPopulator extends CompoundContributionItem {
protected IContributionItem[] getContributionItems() {
MenuManager menuMgr = new MenuManager("SaveAs", "FileSaveAs");
final boolean enabled;
final LocalizationLevel protectedLevel;
final IEditorPart active = EditorUtil.getActiveEditor();
if (active != null
&& active.getEditorInput() instanceof LocalizationEditorInput) {
enabled = active.isDirty();
protectedLevel = ((LocalizationEditorInput) active.getEditorInput())
.getLocalizationFile().getProtectedLevel();
} else {
enabled = false;
protectedLevel = null;
}
LocalizationLevel[] levels = PathManagerFactory.getPathManager()
@ -119,7 +123,9 @@ public class LocalizationSaveAsPopulator extends CompoundContributionItem {
@Override
public boolean isEnabled() {
return enabled;
return enabled
&& (protectedLevel == null || level
.compareTo(protectedLevel) <= 0);
}
});

View file

@ -0,0 +1,156 @@
/**
* 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.localization.perspective.view;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtension;
import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.Platform;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
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.adapter.LocalizationPerspectiveAdapter;
import com.raytheon.uf.viz.localization.filetreeview.PathData;
/**
* Manager class for creating {@link PathData} objects for the localization path
* extension point entries
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Sep 7, 2012 mschenke Initial creation
*
* </pre>
*
* @author mschenke
* @version 1.0
*/
public class PathDataExtManager {
private static final IUFStatusHandler statusHandler = UFStatus
.getHandler(PathDataExtManager.class);
/** Localization path extension point id */
private static final String PATH_DEFINITION_ID = "com.raytheon.uf.viz.localization.localizationpath";
private static final String APPLICATION_ATTR = "application";
private static final String NAME_ATTR = "name";
private static final String PATH_ATTR = "value";
private static final String TYPE_ATTR = "localizationType";
private static final String FILTER_ATTR = "extensionFilter";
private static final String ADAPTER_ATTR = "localizationAdapter";
private static final String RECURSIVE_ATTR = "recursive";
/** Default application name */
private static final String DEFAULT_APPLICATION = "Uncategorized";
/** Default localization perspective adapter */
private static final LocalizationPerspectiveAdapter DEFAULT_ADAPTER = new LocalizationPerspectiveAdapter();
public static Collection<PathData> getPathData() {
List<PathData> pathData = new ArrayList<PathData>();
IExtensionRegistry registry = Platform.getExtensionRegistry();
IExtensionPoint point = registry.getExtensionPoint(PATH_DEFINITION_ID);
if (point != null) {
for (IExtension ext : point.getExtensions()) {
for (IConfigurationElement element : ext
.getConfigurationElements()) {
PathData pd = new PathData();
pd.setApplication(element.getAttribute(APPLICATION_ATTR));
if (pd.getApplication() == null
|| pd.getApplication().trim().isEmpty()) {
pd.setApplication(DEFAULT_APPLICATION);
}
pd.setName(element.getAttribute(NAME_ATTR));
if (pd.getName() == null || pd.getName().trim().isEmpty()) {
statusHandler
.handle(Priority.PROBLEM,
"Skipping path extension entry with no name set");
continue;
}
pd.setPath(element.getAttribute(PATH_ATTR));
if (pd.getPath() == null) {
statusHandler
.handle(Priority.PROBLEM,
"Skipping path extension entry with no path set");
}
pd.setFilter(element.getAttribute(FILTER_ATTR));
String recurse = element.getAttribute(RECURSIVE_ATTR);
pd.setRecursive(Boolean.parseBoolean(recurse));
pd.setType(LocalizationType.valueOf(element
.getAttribute(TYPE_ATTR)));
if (pd.getType() == null) {
// Skip if bad localization type specified
statusHandler.handle(
Priority.PROBLEM,
"Skipping path extension entry with name: "
+ pd.getName() + " and path: "
+ pd.getPath()
+ " with invalid localiation type: "
+ element.getAttribute(TYPE_ATTR));
continue;
}
LocalizationPerspectiveAdapter adapter = DEFAULT_ADAPTER;
try {
if (element.getAttribute(ADAPTER_ATTR) != null) {
adapter = (LocalizationPerspectiveAdapter) element
.createExecutableExtension(ADAPTER_ATTR);
}
} catch (Throwable t) {
statusHandler
.handle(Priority.PROBLEM,
"Skipping path with name: "
+ pd.getName()
+ " and path: "
+ pd.getPath()
+ " due to error constructing adapter: "
+ t.getLocalizedMessage(), t);
}
pd.setAdapter(adapter);
pathData.add(pd);
}
}
} else {
throw new RuntimeException("Could not find extension point ("
+ PATH_DEFINITION_ID
+ ") from the extension point registry");
}
return pathData;
}
}

View file

@ -19,8 +19,6 @@
**/
package com.raytheon.uf.viz.localization.perspective.view.actions;
import java.util.Arrays;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.ActionContributionItem;
import org.eclipse.jface.action.IAction;
@ -127,8 +125,7 @@ public abstract class AbstractToAction extends Action implements IMenuCreator {
protected void fillMenu(Menu menu) {
LocalizationLevel[] levels = PathManagerFactory.getPathManager()
.getAvailableLevels();
Arrays.sort(levels, LocalizationLevel.REVERSE_COMPARATOR);
for (int i = levels.length - 1; i >= 0; --i) {
for (int i = 0; i < levels.length; ++i) {
LocalizationLevel level = levels[i];
if (level.isSystemLevel() == false) {
new ActionContributionItem(new AbstractToInternalAction(level))
@ -137,6 +134,26 @@ public abstract class AbstractToAction extends Action implements IMenuCreator {
}
}
/**
* Determines if the action for this level is enabled. By default, checks if
* the level is the same as the file level
*
* @param level
* @return
*/
protected boolean isLevelEnabled(LocalizationLevel level) {
if (level == file.getContext().getLocalizationLevel()) {
String fileCtxName = file.getContext().getContextName();
String levelCtxName = LocalizationManager.getContextName(level);
if ((fileCtxName == null && levelCtxName == null)
|| (fileCtxName != null && fileCtxName.equals(levelCtxName))) {
// same context name
return false;
}
}
return true;
}
protected abstract void run(LocalizationLevel level);
private class AbstractToInternalAction extends Action {
@ -145,16 +162,7 @@ public abstract class AbstractToAction extends Action implements IMenuCreator {
public AbstractToInternalAction(LocalizationLevel level) {
this.level = level;
if (level == file.getContext().getLocalizationLevel()) {
String fileCtxName = file.getContext().getContextName();
String levelCtxName = LocalizationManager.getContextName(level);
if ((fileCtxName == null && levelCtxName == null)
|| (fileCtxName != null && fileCtxName
.equals(levelCtxName))) {
// same context name
this.setEnabled(false);
}
}
this.setEnabled(isLevelEnabled(level));
}
@Override

View file

@ -63,11 +63,28 @@ public class CopyToAction extends AbstractToAction {
protected ILocalizationService service;
public CopyToAction(LocalizationFile file, ILocalizationService service) {
super(file.isProtected() ? "Copy To (Protected)" : "Copy To", file);
setEnabled(file.isProtected() == false);
super("Copy To", file);
this.service = service;
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.viz.localization.perspective.view.actions.AbstractToAction
* #isLevelEnabled(com.raytheon.uf.common.localization.LocalizationContext.
* LocalizationLevel)
*/
@Override
protected boolean isLevelEnabled(LocalizationLevel level) {
boolean enabled = super.isLevelEnabled(level);
if (enabled && file.isProtected()) {
// Ensure protected level is greater than copy to level
enabled = file.getProtectedLevel().compareTo(level) >= 0;
}
return enabled;
}
/*
* (non-Javadoc)
*

View file

@ -70,14 +70,35 @@ public class MoveFileAction extends CopyToAction {
setEnabled(delete.isEnabled());
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.viz.localization.perspective.view.actions.AbstractToAction
* #isLevelEnabled(com.raytheon.uf.common.localization.LocalizationContext.
* LocalizationLevel)
*/
@Override
protected boolean isLevelEnabled(LocalizationLevel level) {
boolean enabled = super.isLevelEnabled(level);
if (enabled && file.isProtected()) {
// Ensure protected level is greater than copy to level
enabled = file.getProtectedLevel().compareTo(level) >= 0;
}
return enabled;
}
@Override
protected void run(LocalizationLevel level) {
boolean choice = MessageDialog.openQuestion(
page.getWorkbenchWindow().getShell(),
"Move Confirmation",
"Are you sure you want to move "
+ LocalizationUtil.extractName(file.getName()) + " to "
+ level + " replacing any existing file?");
boolean choice = MessageDialog
.openQuestion(
page.getWorkbenchWindow().getShell(),
"Move Confirmation",
"Are you sure you want to move "
+ LocalizationUtil.extractName(file.getName())
+ " to "
+ level
+ " replacing any existing file and deleting this file?");
if (choice) {
IPathManager pm = PathManagerFactory.getPathManager();
final LocalizationFile newFile = pm.getLocalizationFile(

View file

@ -25,6 +25,7 @@ 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.viz.localization.filetreeview.LocalizationFileEntryData;
import com.raytheon.uf.viz.localization.filetreeview.LocalizationFileGroupData;
import com.raytheon.uf.viz.localization.service.ILocalizationService;
@ -47,15 +48,35 @@ import com.raytheon.uf.viz.localization.service.ILocalizationService;
public class PasteFileAction extends CopyToAction {
LocalizationFileGroupData dataToCopyTo;
private LocalizationFileGroupData dataToCopyTo;
private LocalizationLevel pasteToProtectedLevel;
public PasteFileAction(ILocalizationService service, LocalizationFile file,
LocalizationFileGroupData data) {
super(file, service);
setText(file.isProtected() ? "Paste To (Protected)" : "Paste To");
setText("Paste To");
this.dataToCopyTo = data;
// Grab the level this file is protected at (if any)
for (LocalizationFileEntryData entry : dataToCopyTo.getChildrenData()) {
pasteToProtectedLevel = entry.getFile().getProtectedLevel();
break;
}
}
setEnabled(file.isProtected() == false);
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.viz.localization.perspective.view.actions.CopyToAction
* #isLevelEnabled
* (com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel
* )
*/
@Override
protected boolean isLevelEnabled(LocalizationLevel level) {
return pasteToProtectedLevel == null
|| level.compareTo(pasteToProtectedLevel) <= 0;
}
/*

View file

@ -0,0 +1,149 @@
/**
* 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.localization.perspective.view.actions;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.ActionContributionItem;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IMenuCreator;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Menu;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.viz.localization.perspective.view.FileTreeView;
/**
* Action for generating menu items for hiding/showing localization levels in
* the {@link FileTreeView}
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Sep 6, 2012 mschenke Initial creation
*
* </pre>
*
* @author mschenke
* @version 1.0
*/
public class ShowLevelsAction extends Action implements IMenuCreator {
private FileTreeView view;
private Menu menu;
public ShowLevelsAction(FileTreeView view) {
super("Show", IAction.AS_DROP_DOWN_MENU);
this.view = view;
}
@Override
public IMenuCreator getMenuCreator() {
return this;
}
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.action.IMenuCreator#dispose()
*/
@Override
public void dispose() {
if (menu != null) {
menu.dispose();
}
}
/*
* (non-Javadoc)
*
* @see
* org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets
* .Control)
*/
@Override
public Menu getMenu(Control parent) {
if (menu != null) {
menu.dispose();
}
menu = new Menu(parent);
fillMenu(menu);
return menu;
}
/*
* (non-Javadoc)
*
* @see
* org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets
* .Menu)
*/
@Override
public Menu getMenu(Menu parent) {
if (menu != null) {
menu.dispose();
}
menu = new Menu(parent);
fillMenu(menu);
return menu;
}
/**
*
*/
private void fillMenu(Menu menu) {
// Use of LocalizationLevels.values() in this case should be okay since
// we are setting a property to display all context names for the level,
// doesn't matter if our local context for the level is set
for (LocalizationLevel level : PathManagerFactory.getPathManager()
.getAvailableLevels()) {
ActionContributionItem aci = new ActionContributionItem(
new ShowLevelInternalAction(level));
aci.fill(menu, -1);
}
}
private class ShowLevelInternalAction extends Action {
private LocalizationLevel level;
public ShowLevelInternalAction(LocalizationLevel level) {
super(level.name(), IAction.AS_CHECK_BOX);
this.level = level;
setChecked(view.isShown(level));
}
@Override
public void run() {
view.toggleShowLevel(level);
setChecked(view.isShown(level));
}
}
}

View file

@ -19,6 +19,8 @@
**/
package com.raytheon.uf.viz.monitor.scan.commondialogs;
import java.util.Set;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.FocusAdapter;
import org.eclipse.swt.events.FocusEvent;
@ -40,8 +42,12 @@ import org.eclipse.swt.widgets.Text;
import com.raytheon.uf.common.monitor.scan.config.AbsConfigMgr;
import com.raytheon.uf.common.monitor.scan.config.SCANConfig;
import com.raytheon.uf.common.monitor.scan.config.SCANConfigEnums.ScanTables;
import com.raytheon.uf.viz.monitor.scan.ScanMonitor;
import com.raytheon.uf.viz.monitor.scan.tables.AbstractTableDlg;
import com.raytheon.uf.viz.monitor.scan.tables.SCANAlarmAlertManager;
import com.raytheon.uf.viz.monitor.scan.tables.SCANCellTableDlg;
import com.raytheon.uf.viz.monitor.scan.tables.SCANAlarmAlertManager.AlarmType;
import com.raytheon.uf.viz.monitor.scan.tables.SCANAlarmAlertManager.AlertedAlarms;
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
public class SCANAlarmThreshDlg extends CaveSWTDialog implements
@ -239,6 +245,16 @@ public class SCANAlarmThreshDlg extends CaveSWTDialog implements
@Override
public void widgetSelected(SelectionEvent e) {
alarmChoiceChanged();
String columnName = attributeCbo.getText();
mgr.clearAlertedAlarms(site, scanTable);
AbstractTableDlg tableDlg = ScanMonitor.getInstance()
.getDialog(scanTable, site);
tableDlg.updateThresh(columnName);
if (mgr.getAlertedAlarmCount(site, scanTable) == 0) {
tableDlg.turnOffAlarm();
} else {
tableDlg.turnOnAlarm();
}
shell.dispose();
}
});

View file

@ -157,7 +157,7 @@ public class ScanResource extends
VizApp.runAsync(new Runnable() {
@Override
public void run() {
if (getScanDrawer().font != null) {
if (gc != null && getScanDrawer().font != null) {
getScanDrawer().font.setMagnification(getCapability(
MagnificationCapability.class).getMagnification()
.floatValue());
@ -560,7 +560,7 @@ public class ScanResource extends
* @return
*/
public ScanDrawer getScanDrawer() {
if (drawer == null) {
if (drawer == null && gc != null) {
if (getTable().equals(ScanTables.CELL)) {
drawer = new ScanDrawer(SCANConfig.getInstance()
.getStormCellConfig(), gc, getScan()

View file

@ -765,4 +765,8 @@ public abstract class AbstractTableDlg extends Dialog implements IMonitor,
protected abstract void handleRankMenuEvent(SelectionEvent event);
public abstract void updateThresh(String attr);
public abstract void turnOffAlarm();
public abstract void turnOnAlarm();
}

View file

@ -21,10 +21,13 @@ package com.raytheon.uf.viz.monitor.scan.tables;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.CopyOnWriteArrayList;
@ -36,6 +39,7 @@ import com.raytheon.uf.common.monitor.scan.config.SCANConfigEnums;
import com.raytheon.uf.common.monitor.scan.config.SCANConfigEnums.ScanTables;
import com.raytheon.uf.viz.monitor.scan.ScanMonitor;
import com.raytheon.uf.viz.monitor.scan.data.ScanDataGenerator;
import com.raytheon.uf.viz.monitor.scan.tables.SCANAlarmAlertManager.AlarmType;
/**
* Manager class to hold between scan dialog and alarming capabilities
@ -74,11 +78,11 @@ public class SCANAlarmAlertManager {
private static SCANAlarmAlertManager instance = null;
private HashMap<String, HashMap<ScanTables, List<ScheduledAlarms>>> scheduledAlarmsMap;
private Map<String, Map<ScanTables, List<ScheduledAlarms>>> scheduledAlarmsMap;
private HashMap<String, HashMap<ScanTables, Set<AlertedAlarms>>> alertedAlarmsMap;
private Map<String, Map<ScanTables, Set<AlertedAlarms>>> alertedAlarmsMap;
private HashMap<String, HashMap<ScanTables, List<String>>> idents;
private Map<String, Map<ScanTables, List<String>>> idents;
private boolean ring = false;
@ -98,7 +102,7 @@ public class SCANAlarmAlertManager {
public void addSite(String site) {
if (!scheduledAlarmsMap.containsKey(site)) {
HashMap<ScanTables, List<ScheduledAlarms>> siteScheduledAlarmsMap = new HashMap<ScanTables, List<ScheduledAlarms>>();
Map<ScanTables, List<ScheduledAlarms>> siteScheduledAlarmsMap = Collections.synchronizedMap(new HashMap<ScanTables, List<ScheduledAlarms>>());
siteScheduledAlarmsMap.put(ScanTables.DMD,
new CopyOnWriteArrayList<ScheduledAlarms>());
siteScheduledAlarmsMap.put(ScanTables.CELL,
@ -107,7 +111,7 @@ public class SCANAlarmAlertManager {
}
if (!alertedAlarmsMap.containsKey(site)) {
HashMap<ScanTables, Set<AlertedAlarms>> siteAlertedAlarmsSet = new HashMap<ScanTables, Set<AlertedAlarms>>();
Map<ScanTables, Set<AlertedAlarms>> siteAlertedAlarmsSet = Collections.synchronizedMap(new HashMap<ScanTables, Set<AlertedAlarms>>());
siteAlertedAlarmsSet.put(ScanTables.DMD,
new HashSet<AlertedAlarms>());
siteAlertedAlarmsSet.put(ScanTables.CELL,
@ -116,7 +120,7 @@ public class SCANAlarmAlertManager {
}
if (!idents.containsKey(site)) {
HashMap<ScanTables, List<String>> siteIdents = new HashMap<ScanTables, List<String>>();
Map<ScanTables, List<String>> siteIdents = new HashMap<ScanTables, List<String>>();
siteIdents.put(ScanTables.CELL, new ArrayList<String>());
siteIdents.put(ScanTables.DMD, new ArrayList<String>());
idents.put(site, siteIdents);
@ -126,15 +130,15 @@ public class SCANAlarmAlertManager {
private SCANAlarmAlertManager() {
if (scheduledAlarmsMap == null) {
scheduledAlarmsMap = new HashMap<String, HashMap<ScanTables, List<ScheduledAlarms>>>();
scheduledAlarmsMap = Collections.synchronizedMap(new HashMap<String, Map<ScanTables, List<ScheduledAlarms>>>());
}
if (alertedAlarmsMap == null) {
alertedAlarmsMap = new HashMap<String, HashMap<ScanTables, Set<AlertedAlarms>>>();
alertedAlarmsMap = Collections.synchronizedMap(new HashMap<String, Map<ScanTables, Set<AlertedAlarms>>>());
}
if (idents == null) {
idents = new HashMap<String, HashMap<ScanTables, List<String>>>();
idents = new HashMap<String, Map<ScanTables, List<String>>>();
}
}
@ -438,7 +442,7 @@ public class SCANAlarmAlertManager {
return count;
}
public boolean containsAlarm(String site, ScanTables tableType,
AlarmType type, String colName, String ident) {
for (AlertedAlarms alarm : alertedAlarmsMap.get(site).get(tableType)) {
@ -493,9 +497,10 @@ public class SCANAlarmAlertManager {
alarm.cleared = true;
}
}
public void removeAlertedAlarms(String site, ScanTables tableType) {
alertedAlarmsMap.get(site).get(tableType).clear();
setRing(false);
}
/**
@ -603,4 +608,5 @@ public class SCANAlarmAlertManager {
+ this.row + "\nCol #:" + this.col + "\nCleared: " + cleared + "\n";
}
}
}

View file

@ -475,8 +475,7 @@ public class SCANCellTableDlg extends AbstractTableDlg implements
alarmDlg.open();
if (!alarmBtn.isDisposed()
&& (mgr.getAlertedAlarmCount(site, scanTable) == 0)) {
alarmBtn.setVisible(false);
mgr.setRing(false);
turnOffAlarm();
}
}
});
@ -488,7 +487,23 @@ public class SCANCellTableDlg extends AbstractTableDlg implements
timeLbl.setLayoutData(gd);
}
// private void resetButtonForegroundColor(Button btn)
@Override
public void turnOffAlarm() {
if (alarmBtn != null && !alarmBtn.isDisposed()) {
alarmBtn.setVisible(false);
}
mgr.setRing(false);
}
@Override
public void turnOnAlarm() {
if (alarmBtn != null && !alarmBtn.isDisposed()) {
alarmBtn.setVisible(true);
}
mgr.setRing(true);
}
// private void resetButtonForegroundColor(Button btn)
// {
// btn.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
// }

View file

@ -514,8 +514,7 @@ public class SCANDmdTableDlg extends AbstractTableDlg implements
alarmsDlg.open();
if (!alarmBtn.isDisposed()
&& mgr.getAlertedAlarms(site, scanTable).isEmpty()) {
alarmBtn.setVisible(false);
mgr.setRing(false);
turnOffAlarm();
}
}
});
@ -1299,4 +1298,19 @@ public class SCANDmdTableDlg extends AbstractTableDlg implements
dmdTableComp.alarmSelection(ident);
}
public void turnOffAlarm() {
if (alarmBtn != null && !alarmBtn.isDisposed()) {
alarmBtn.setVisible(false);
}
mgr.setRing(false);
}
public void turnOnAlarm() {
if (alarmBtn != null && !alarmBtn.isDisposed()) {
alarmBtn.setVisible(true);
}
mgr.setRing(true);
}
}

View file

@ -647,4 +647,14 @@ public class SCANMesoTableDlg extends AbstractTableDlg implements
return false;
}
@Override
public void turnOffAlarm() {
mgr.setRing(false);
}
@Override
public void turnOnAlarm() {
mgr.setRing(true);
}
}

View file

@ -609,4 +609,14 @@ public class SCANTvsTableDlg extends AbstractTableDlg implements
// Not currently used for TVS
return false;
}
@Override
public void turnOffAlarm() {
mgr.setRing(false);
}
@Override
public void turnOnAlarm() {
mgr.setRing(true);
}
}

View file

@ -20,12 +20,11 @@ Developed on the Raytheon Visualization Environment (viz)
<launcherArgs>
<programArgs>-data @user.home/caveData -user @user.home/caveData -clean</programArgs>
<programArgsLin>-consoleLog</programArgsLin>
<vmArgs>-Xincgc -Xmx256M -Xss2024k -Dosgi.instance.area.readOnly=true -Dosgi.hook.configurators.exclude=org.eclipse.core.runtime.internal.adaptor.EclipseLogHook,org.eclipse.core.runtime.internal.adaptor.EclipseErrorHandler -Dorg.eclipse.update.reconcile=false -Dqpid.dest_syntax=BURL -Dorg.eclipse.update.reconcile=false -XX:MaxPermSize=128m -Dorg.eclipse.ui/KEY_CONFIGURATION_ID=com.raytheon.viz.ui.awips.scheme -Dawips.mode=pypies -Dqpid.dest_syntax=BURL -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false</vmArgs>
<vmArgs>-Xincgc -Xmx256M -Xss2024k -Dosgi.instance.area.readOnly=true -Dosgi.hook.configurators.exclude=org.eclipse.core.runtime.internal.adaptor.EclipseLogHook,org.eclipse.core.runtime.internal.adaptor.EclipseErrorHandler -Dorg.eclipse.update.reconcile=false -Dqpid.dest_syntax=BURL -Dorg.eclipse.update.reconcile=false -XX:MaxPermSize=128m -Dorg.eclipse.ui/KEY_CONFIGURATION_ID=com.raytheon.viz.ui.awips.scheme -Dawips.mode=pypies -Dqpid.dest_syntax=BURL -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dlog4j.configuration=log4j-alertviz.xml</vmArgs>
</launcherArgs>
<windowImages/>
<launcher name="alertviz">
<solaris/>
<win useIco="false">
@ -39,7 +38,6 @@ Developed on the Raytheon Visualization Environment (viz)
</win>
</launcher>
<vm>
<linux include="true">jdk1.6.0</linux>
<windows include="true">jdk1.6.0</windows>

View file

@ -27,11 +27,15 @@ import java.util.Map;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchWindow;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
import com.raytheon.uf.common.serialization.ISerializableObject;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.viz.core.DescriptorMap;
import com.raytheon.uf.viz.core.IDisplayPaneContainer;
import com.raytheon.uf.viz.core.catalog.CatalogQuery;
import com.raytheon.uf.viz.core.catalog.DbQuery;
@ -39,6 +43,7 @@ import com.raytheon.uf.viz.core.drawables.AbstractRenderableDisplay;
import com.raytheon.uf.viz.core.drawables.IDescriptor;
import com.raytheon.uf.viz.core.drawables.ResourcePair;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.map.MapDescriptor;
import com.raytheon.uf.viz.core.procedures.Bundle;
import com.raytheon.uf.viz.core.rsc.AbstractRequestableResourceData;
import com.raytheon.uf.viz.core.rsc.ResourceProperties;
@ -46,7 +51,10 @@ import com.raytheon.uf.viz.core.rsc.ResourceType;
import com.raytheon.uf.viz.productbrowser.ProductBrowserPreference.PreferenceType;
import com.raytheon.viz.ui.EditorUtil;
import com.raytheon.viz.ui.MenuLoader;
import com.raytheon.viz.ui.VizWorkbenchManager;
import com.raytheon.viz.ui.editor.AbstractEditor;
import com.raytheon.viz.ui.perspectives.AbstractVizPerspectiveManager;
import com.raytheon.viz.ui.perspectives.VizPerspectiveListener;
/**
* Product browser abstract requestable implementation
@ -134,11 +142,11 @@ public abstract class AbstractRequestableProductBrowserDataDefinition<T extends
String[] temp = queryData(param, queryList);
if (temp != null) {
if ((Boolean) getPreference(FORMAT_DATA).getValue()) {
parameters = formatData(param, temp);
} else {
parameters = super.formatData(param, temp);
}
if ((Boolean) getPreference(FORMAT_DATA).getValue()) {
parameters = formatData(param, temp);
} else {
parameters = super.formatData(param, temp);
}
}
if (parameters != null) {
@ -194,7 +202,10 @@ public abstract class AbstractRequestableProductBrowserDataDefinition<T extends
IDescriptor currDesc = null;
// retrieves the correct editor
getEditor();
IDisplayPaneContainer container = EditorUtil.getActiveVizContainer();
IDisplayPaneContainer container = getEditor();
if (container == null) {
return;
}
AbstractRenderableDisplay display = (AbstractRenderableDisplay) container
.getActiveDisplayPane().getRenderableDisplay();
display = (AbstractRenderableDisplay) display.createNewDisplay();
@ -265,8 +276,39 @@ public abstract class AbstractRequestableProductBrowserDataDefinition<T extends
return null;
}
public void getEditor() {
// do nothing, if user wants a certain editor then overwrite this method
protected IDisplayPaneContainer getEditor() {
String id = DescriptorMap.getEditorId(getDescriptorClass().getName());
IEditorPart editorPart = EditorUtil.getActiveEditor();
if (editorPart != null && id.equals(editorPart.getEditorSite().getId())) {
return (AbstractEditor) editorPart;
}
editorPart = EditorUtil.findEditor(id);
if (editorPart != null) {
return (AbstractEditor) editorPart;
}
return openNewEditor(id);
}
protected IDisplayPaneContainer openNewEditor(String editorId) {
IWorkbenchWindow window = VizWorkbenchManager.getInstance()
.getCurrentWindow();
AbstractVizPerspectiveManager mgr = VizPerspectiveListener.getInstance(
window).getActivePerspectiveManager();
if (mgr != null) {
AbstractEditor editor = mgr.openNewEditor();
if (editor == null) {
return null;
} else if (editorId.equals(editor.getEditorSite().getId())) {
return editor;
} else {
window.getActivePage().closeEditor(editor, false);
}
}
return null;
}
protected Class<? extends IDescriptor> getDescriptorClass() {
return MapDescriptor.class;
}
/*

View file

@ -121,7 +121,7 @@ public class ThinClientLocalizationAdapter extends CAVELocalizationAdapter
ListResponse response = new ListResponse();
response.context = context;
response.isDirectory = localFile.isDirectory();
response.isProtected = false;
response.protectedLevel = null;
response.existsOnServer = false;
response.fileName = p;
response.date = new Date(localFile.lastModified());
@ -155,7 +155,7 @@ public class ThinClientLocalizationAdapter extends CAVELocalizationAdapter
response.context = ctx;
response.existsOnServer = false;
response.fileName = fileName;
response.isProtected = false;
response.protectedLevel = null;
File file = getPath(ctx, fileName);
if (file == null) {
response.isDirectory = false;

View file

@ -197,7 +197,7 @@ public class GLStats {
" * GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX = %dMB\n",
nvxDedicatedMem / 1024));
output.append(String.format(
" * GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX = %dMB\n",
" * GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX = %dMB\n",
nvxTotalAvailableMem / 1024));
output.append(String.format(
" * GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX = %dMB\n",

View file

@ -177,7 +177,7 @@ public class GLShadedShapeBase implements IShape {
for (FloatBuffer[] contours : polygons) {
glu.gluTessProperty(tessellator, GLU.GLU_TESS_WINDING_RULE,
GLU.GLU_TESS_WINDING_NONZERO);
GLU.GLU_TESS_WINDING_ODD);
glu.gluTessBeginPolygon(tessellator, (double[]) null);
int polygonStart = vertexBuffer.position() / 2;
for (FloatBuffer contour : contours) {

View file

@ -170,10 +170,8 @@ public class GriddedImageDisplay2 extends AbstractTileSet {
private IImage createShortTile(IGraphicsTarget target, Rectangle rect,
int width, int i, int j) {
// short is 2 bytes
int elemSize = 2;
// buffer to copy into
short[] dest = new short[rect.width * rect.height * elemSize];
short[] dest = new short[rect.width * rect.height];
ShortBuffer srcBuff = (ShortBuffer) data;
short[] tmp = new short[rect.width];

View file

@ -21,7 +21,6 @@ package com.raytheon.viz.gfe.dialogs;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
@ -32,8 +31,6 @@ import java.util.TimeZone;
import com.raytheon.uf.common.dataplugin.gfe.db.objects.DatabaseID;
import com.raytheon.uf.common.dataplugin.gfe.db.objects.ParmID;
import com.raytheon.viz.core.mode.CAVEMode;
import com.raytheon.viz.gfe.GFEServerException;
import com.raytheon.viz.gfe.core.DataManager;
import com.raytheon.viz.gfe.core.IParmManager;
/**
@ -48,6 +45,10 @@ import com.raytheon.viz.gfe.core.IParmManager;
* 04/30/2009 2282 rjpeter Refactored interfaces.
* 08/19/2009 2547 rjpeter Implement Test/Prac database display.
* 02/22/2012 14351 mli update with incoming databases
* 09/12/2012 #1117 dgilling Revert previous changes, force
* source list to always rebuild to ensure
* up to date db list.
*
* </pre>
*
* @author ebabin
@ -58,7 +59,7 @@ public class WEBrowserTypeRecord {
private String type;
private java.util.List<String> sources = new ArrayList<String>();
private List<String> sources = new ArrayList<String>();
public static final SimpleDateFormat SOURCE_FORMAT = new SimpleDateFormat(
"dd/HHmm");
@ -77,12 +78,14 @@ public class WEBrowserTypeRecord {
*/
private Map<String, Map<String, List<String>>> miscMap = new HashMap<String, Map<String, List<String>>>();
private ParmID possibleParms[];
private ParmID[] possibleParms;
private ParmID fields[];
private ParmID[] fields;
private final CAVEMode mode;
private final IParmManager parmMgr;
static {
SOURCE_FORMAT.setTimeZone(TimeZone.getTimeZone("GMT"));
}
@ -90,9 +93,10 @@ public class WEBrowserTypeRecord {
/**
* @return the type
*/
public WEBrowserTypeRecord(String type, CAVEMode mode) {
public WEBrowserTypeRecord(String type, CAVEMode mode, IParmManager parmMgr) {
this.type = type;
this.mode = mode;
this.parmMgr = parmMgr;
// create and fill these entries on creation of this type.
makeSources();
// go ahead and fill the ParmID[] array.
@ -115,14 +119,7 @@ public class WEBrowserTypeRecord {
* @return the sources
*/
public java.util.List<String> getSources() {
return sources;
}
/**
* @return the sources
*/
public java.util.List<String> getUpdatedSources() {
makeSources();
makeSources();
return sources;
}
@ -136,7 +133,7 @@ public class WEBrowserTypeRecord {
return fields;
}
private ArrayList<DatabaseID> getDbsForType(String typeLabel) {
private List<DatabaseID> getDbsForType(String typeLabel) {
boolean pracFlag = false;
boolean testFlag = false;
@ -145,19 +142,9 @@ public class WEBrowserTypeRecord {
pracFlag = mode.equals(CAVEMode.PRACTICE);
testFlag = mode.equals(CAVEMode.TEST);
}
// List<DatabaseID> dbs = DataManager.getCurrentInstance()
// .getParmManager().getAvailableDbs();
List<DatabaseID> dbs = parmMgr.getAvailableDbs();
// Always retrieve updated databases
List<DatabaseID> dbs = null;
try {
dbs = DataManager.getCurrentInstance().getClient().getAvailableDbs();
} catch (GFEServerException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
ArrayList<DatabaseID> filtDB = new ArrayList<DatabaseID>();
List<DatabaseID> filtDB = new ArrayList<DatabaseID>();
for (DatabaseID db : dbs) {
if (db.getDbType().equalsIgnoreCase(typeLabel)) {
@ -167,88 +154,89 @@ public class WEBrowserTypeRecord {
} else if (db.getDbType().equalsIgnoreCase("Test") && testFlag) {
filtDB.add(db);
}
}
return filtDB;
}
private void makeSources() {
ArrayList<DatabaseID> databases = getDbsForType(type);
IParmManager parmMgr = DataManager.getCurrentInstance()
.getParmManager();
// clear all existing data as we will end up rebuilding it here...
sources.clear();
fieldMap.clear();
miscMap.clear();
pressureMap.clear();
// move mutable to front of list.
DatabaseID mutableDb = parmMgr.getMutableDatabase();
if (databases.indexOf(mutableDb) > 0) {
databases.remove(mutableDb);
databases.add(0, mutableDb);
}
List<DatabaseID> databases = getDbsForType(type);
final DatabaseID mutableDb = parmMgr.getMutableDatabase();
Collections.sort(databases, new Comparator<DatabaseID>() {
@Override
public int compare(DatabaseID left, DatabaseID right) {
String compare1 = null == left.getModelName() ? "" : left
.getModelName();
String compare2 = null == right.getModelName() ? "" : right
.getModelName();
int returnValue = compare1.compareTo(compare2);
if (0 == returnValue) {
compare1 = null == left.getModelTime() ? "" : left
.getModelTime();
compare2 = null == right.getModelTime() ? "" : right
.getModelTime();
returnValue = -1 * compare1.compareTo(compare2);
// sorting rules for WeatherElementBrowser:
// mutable first
// singletons next in alpha order
// rest in order first by name, then time (newest to oldest)
if (left.equals(right)) {
return 0;
}
return returnValue;
if (left.equals(mutableDb)) {
return -1;
} else if (right.equals(mutableDb)) {
return 1;
}
String leftModelTime = (left.getModelTime() != null ? left
.getModelTime() : "");
String rightModelTime = (right.getModelTime() != null ? right
.getModelTime() : "");
if (leftModelTime.equals(DatabaseID.NO_MODEL_TIME)
&& (!rightModelTime.equals(DatabaseID.NO_MODEL_TIME))) {
return -1;
} else if (!leftModelTime.equals(DatabaseID.NO_MODEL_TIME)
&& (rightModelTime.equals(DatabaseID.NO_MODEL_TIME))) {
return 1;
} else if (leftModelTime.equals(DatabaseID.NO_MODEL_TIME)
&& (rightModelTime.equals(DatabaseID.NO_MODEL_TIME))) {
return left.getModelName().compareTo(right.getModelName());
}
int modelNameCompare = left.getModelName().compareTo(
right.getModelName());
if (modelNameCompare != 0) {
return modelNameCompare;
}
return -1 * leftModelTime.compareTo(rightModelTime);
}
});
for (DatabaseID dbase : databases) {
String sourceTime = dbase.getModelName();
if (dbase.getModelDate() != null) {
for (DatabaseID dbId : databases) {
String sourceString = dbId.getModelName();
if (dbId.getModelDate() != null) {
synchronized (SOURCE_FORMAT) {
sourceTime += " "
+ SOURCE_FORMAT.format(dbase.getModelDate());
sourceString += " "
+ SOURCE_FORMAT.format(dbId.getModelDate());
}
}
boolean srcAdded = false;
ParmID[] availParms = parmMgr.getAvailableParms(dbase);
if (availParms != null) {
for (ParmID parm : availParms) {
if (parm.getParmLevel().startsWith("MB")) {
addToMap(pressureMap, sourceTime, parm.getParmName(),
parm.getParmLevel());
} else {
addToMap(miscMap, sourceTime, parm.getParmName(),
parm.getParmLevel());
}
DatabaseID parmDB = parm.getDbId();
if (parmDB.getModelName().equalsIgnoreCase(
dbase.getModelName())
&& parmDB.getModelTime().equalsIgnoreCase(
dbase.getModelTime())
&& parmDB.getDbType().equalsIgnoreCase(
dbase.getDbType())) {
if (!sources.contains(sourceTime)) {
sources.add(sourceTime);
srcAdded = true;
}
}
}
if (srcAdded) {
// create a list...
ArrayList<ParmID> ids = new ArrayList<ParmID>();
for (ParmID parm : availParms) {
ids.add(parm);
}
java.util.Collections.sort(ids);
sources.add(sourceString);
fieldMap.put(sourceTime,
ids.toArray(new ParmID[ids.size()]));
ParmID[] availParms = parmMgr.getAvailableParms(dbId);
List<ParmID> sortedParms = new ArrayList<ParmID>(availParms.length);
for (ParmID parm : availParms) {
if (parm.getParmLevel().startsWith("MB")) {
addToMap(pressureMap, sourceString, parm.getParmName(),
parm.getParmLevel());
} else {
addToMap(miscMap, sourceString, parm.getParmName(),
parm.getParmLevel());
}
sortedParms.add(parm);
}
Collections.sort(sortedParms);
fieldMap.put(sourceString,
sortedParms.toArray(new ParmID[sortedParms.size()]));
}
}
@ -420,11 +408,10 @@ public class WEBrowserTypeRecord {
*/
public ParmID[] getPossibleParmIDs() {
if (possibleParms == null) {
ArrayList<DatabaseID> databases = getDbsForType(type);
List<DatabaseID> databases = getDbsForType(type);
ArrayList<ParmID> parmIds = new ArrayList<ParmID>();
for (DatabaseID db : databases) {
ParmID ids[] = DataManager.getCurrentInstance()
.getParmManager().getAvailableParms(db);
ParmID ids[] = parmMgr.getAvailableParms(db);
for (int i = 0; i < ids.length; i++) {
parmIds.add(ids[i]);
}
@ -437,25 +424,6 @@ public class WEBrowserTypeRecord {
return possibleParms;
}
/**
* Add ParmIDs for new database
*/
public void addNewParmIDs(String newSource) {
ArrayList<ParmID> parmIds = new ArrayList<ParmID>();
possibleParms = getPossibleParmIDs();
parmIds.addAll(Arrays.asList(possibleParms));
ParmID ids[] = getFields(newSource);
for ( int i = 0; i < ids.length; i++) {
if (!parmIds.contains(ids[i])) {
parmIds.add(ids[i]);
}
}
possibleParms = new ParmID[parmIds.size()];
parmIds.toArray(possibleParms);
}
public ArrayList<ParmID> getFilteredParmIDs(String sources[],
String fields[], String planes[]) {
ArrayList<ParmID> listToReturn = new ArrayList<ParmID>();

View file

@ -51,7 +51,6 @@ import org.eclipse.swt.widgets.ToolItem;
import com.raytheon.uf.common.dataplugin.gfe.db.objects.DatabaseID;
import com.raytheon.uf.common.dataplugin.gfe.db.objects.ParmID;
import com.raytheon.viz.core.mode.CAVEMode;
import com.raytheon.viz.gfe.GFEServerException;
import com.raytheon.viz.gfe.core.DataManager;
import com.raytheon.viz.gfe.core.parm.Parm;
import com.raytheon.viz.ui.dialogs.CaveJFACEDialog;
@ -69,7 +68,10 @@ import com.raytheon.viz.ui.widgets.ToggleSelectList;
* 06/27/2008 ebabin Updated to properly add fields.
* 04/30/2009 2282 rjpeter Refactored.
* 08/19/2009 2547 rjpeter Fix Test/Prac database display.
* 02/22/2012 14351 mli update with incoming new grids.
* 02/22/2012 14351 mli update with incoming new grids.
* 09/12/2012 #1117 dgilling Revert previous changes, retrieve
* database list from ParmManager
* not EDEX.
* </pre>
*
* @author ebabin
@ -107,8 +109,6 @@ public class WeatherElementBrowserDialog extends CaveJFACEDialog {
private ParmID[] currentDisplayedParms;
private List<DatabaseID> databases;
private static final Point size = new Point(603, 778);
private static final String IFP = "IFP";
@ -499,7 +499,6 @@ public class WeatherElementBrowserDialog extends CaveJFACEDialog {
* Automatically checks for dups, and sorts.
*/
private void updateSourceMenu() {
sourceList.removeAll();
resetMenu(sourceMenu);
List<String> sortedSources = selectedType.getSources();
@ -519,48 +518,6 @@ public class WeatherElementBrowserDialog extends CaveJFACEDialog {
}
}
/*
* check for incoming new databases
*/
private void checkForNewSource() {
List<String> sortedSources = selectedType.getUpdatedSources();
if (sortedSources != null) {
List<String> newSources = new ArrayList<String>();
// Check for new new database
for (String source : sortedSources) {
boolean found = false;
for (int i = 0; i < sourceMenu.getItemCount(); i++) {
if (sourceMenu.getItem(i).getText().equals(source)) {
found = true;
break;
}
}
if (!found) {
newSources.add(source);
}
}
// create menuItem for new database
if (newSources != null) {
for (String s : newSources) {
selectedType.addNewParmIDs(s);
final MenuItem item = new MenuItem(sourceMenu, SWT.PUSH);
item.setText(s);
item.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
addToList(item.getText(), sourceList);
processSourceSelection();
}
});
}
}
}
}
private void processSourceSelection() {
java.util.List<String> currentSourceSelection = java.util.Arrays
.asList(sourceList.getSelection());
@ -858,9 +815,7 @@ public class WeatherElementBrowserDialog extends CaveJFACEDialog {
sourceToolItem.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
// Check for new source
checkForNewSource();
updateSourceMenu();
Rectangle rect = sourceToolItem.getBounds();
Point pt = new Point(rect.x, rect.y + rect.height);
pt = sourceToolBar.toDisplay(pt);
@ -1208,10 +1163,11 @@ public class WeatherElementBrowserDialog extends CaveJFACEDialog {
final CAVEMode mode = CAVEMode.getMode();
if (mutableID.getDbType().equalsIgnoreCase("")) {
typeEntries.add(new WEBrowserTypeRecord(IFP, mode));
typeEntries.add(new WEBrowserTypeRecord(IFP, mode, dataManager
.getParmManager()));
} else {
typeEntries
.add(new WEBrowserTypeRecord(mutableID.getDbType(), mode));
typeEntries.add(new WEBrowserTypeRecord(mutableID.getDbType(),
mode, dataManager.getParmManager()));
}
for (DatabaseID database : getDatabases()) {
@ -1229,7 +1185,8 @@ public class WeatherElementBrowserDialog extends CaveJFACEDialog {
databaseType = IFP;
}
typeEntries.add(new WEBrowserTypeRecord(databaseType, mode));
typeEntries.add(new WEBrowserTypeRecord(databaseType, mode,
dataManager.getParmManager()));
}
if (!siteList.contains(database.getSiteId())) {
siteList.add(database.getSiteId());
@ -1251,19 +1208,7 @@ public class WeatherElementBrowserDialog extends CaveJFACEDialog {
}
private List<DatabaseID> getDatabases() {
if (databases == null) {
// databases = dataManager.getParmManager().getAvailableDbs();
// Always Retrieve updated databases
try {
databases = DataManager.getCurrentInstance().getClient().getAvailableDbs();
} catch (GFEServerException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
return databases;
return dataManager.getParmManager().getAvailableDbs();
}
private ParmID[] getSelectedParmIDS() {
@ -1294,6 +1239,7 @@ public class WeatherElementBrowserDialog extends CaveJFACEDialog {
*
* @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
*/
@Override
public int compare(String s1, String s2) {
// we expect pressure strings to read MBnnnn (e.g., MB100 or
// MB1000), thus we'll strip the first two letters of the strings

View file

@ -235,7 +235,8 @@ public class MakeHazardDialog extends CaveSWTDialog implements
Map<String, List<String>> localEffectAreas,
Map<String, List<Object>> localAreaData) {
super(parent, SWT.DIALOG_TRIM | SWT.RESIZE, CAVE.DO_NOT_BLOCK);
super(parent, SWT.DIALOG_TRIM | SWT.RESIZE, CAVE.DO_NOT_BLOCK
| CAVE.NO_PACK);
this.dataManager = dataManager;
this.defaultMapWidth = defaultMapWidth;
this.timeScaleEndTime = timeScaleEndTime;
@ -279,6 +280,7 @@ public class MakeHazardDialog extends CaveSWTDialog implements
protected void initializeComponents(Shell shell) {
// Initialize all of the controls and layouts
initializeComponents();
shell.pack();
this.comboDict = new HashMap<String, Integer>();
setHazardType(this.defaultHazardType);
@ -1100,6 +1102,7 @@ public class MakeHazardDialog extends CaveSWTDialog implements
// create the start time slider
startTimeSlider = new Scale(startGroup, SWT.HORIZONTAL);
gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
gd.minimumWidth = 200;
startTimeSlider.setLayoutData(gd);
startTimeSlider.addSelectionListener(new SelectionListener() {
@ -1130,7 +1133,6 @@ public class MakeHazardDialog extends CaveSWTDialog implements
startTimeSlider.setMaximum(this.timeScaleEndTime);
startTimeSlider.setIncrement(1);
startTimeSlider.setPageIncrement(1);
startTimeSlider.setLayoutData(new GridData(200, SWT.DEFAULT));
// Force start time to an hourly boundary
Calendar cal = Calendar.getInstance();
@ -1158,6 +1160,7 @@ public class MakeHazardDialog extends CaveSWTDialog implements
// Create the end time slider
endTimeSlider = new Scale(endGroup, SWT.HORIZONTAL);
gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
gd.minimumWidth = 200;
endTimeSlider.setLayoutData(gd);
endTimeSlider.setMinimum(1);
@ -1165,7 +1168,6 @@ public class MakeHazardDialog extends CaveSWTDialog implements
endTimeSlider.setIncrement(1);
endTimeSlider.setPageIncrement(1);
endTimeSlider.setSelection(1);
endTimeSlider.setLayoutData(new GridData(200, SWT.DEFAULT));
endTimeSlider.addSelectionListener(new SelectionListener() {
@Override
@ -1215,6 +1217,21 @@ public class MakeHazardDialog extends CaveSWTDialog implements
gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
leCombo.setLayoutData(gd);
leCombo.addSelectionListener(selAdapt);
GC gc = new GC(this.getDisplay());
String longest = "";
int widest = 0;
for (List<String> list : localEffectAreas.values()) {
for (String s : list) {
int width = gc.stringExtent(s).x;
if (width > widest) {
widest = width;
longest = s;
}
}
}
gc.dispose();
leCombo.add(longest);
}
private Map<String, List<String>> getHazardsDictionary() {
@ -1347,7 +1364,6 @@ public class MakeHazardDialog extends CaveSWTDialog implements
this.hazLocalEffect = "None";
this.etnSegNumberField.setText("");
}
leGroup.getParent().pack();
}
/**

View file

@ -1165,7 +1165,7 @@ public class TimeSeriesDisplayCanvas extends TimeSeriesGraphCanvas implements
/* loop through each trace and set the min and max values */
for (int i = 0; i < gd.getTraces().size(); i++) {
td = gd.getTraceData(i);
if (td != null) {
if (td != null && td.isTraceOn()) {
TimeSeriesPoint[] points = null;
if (zoomed) {
points = td.getZoomedTsData();
@ -2572,9 +2572,7 @@ public class TimeSeriesDisplayCanvas extends TimeSeriesGraphCanvas implements
traceData.setName(name);
traceData.setBasistime(basisTime);
traceData.setProductTime(productTime);
if (this.latestFcstFlag) {
traceData.setTraceOn(false);
}
traceData.setTraceOn(!this.latestFcstFlag);
} else {
/* reached max fcst traces, break out of loop */
break;
@ -2802,4 +2800,5 @@ public class TimeSeriesDisplayCanvas extends TimeSeriesGraphCanvas implements
public void setZoomed(boolean zoomed) {
this.zoomed = zoomed;
}
}

View file

@ -173,9 +173,9 @@ public class TimeSeriesDlg extends CaveHydroSWTDialog {
private static final String COLOR = "color";
private static final String[] TS_LIST = { "RG", "RP", "RZ", "FF", "FX",
"FZ" };
// private static final String[] TS_LIST = { "RG", "RP", "RZ", "FF", "FX",
// "FZ" };
private final String[] TS_ORDER = { "R", "F", "P", "M", "C" };
/**
@ -726,8 +726,7 @@ public class TimeSeriesDlg extends CaveHydroSWTDialog {
try {
populateStationList();
} catch (VizException e) {
// TODO Auto-generated catch block
e.printStackTrace();
statusHandler.error("Failed to populate station list", e);
}
if (startMode.equals("GROUP") && (displayGraph == false)) {
@ -1143,8 +1142,7 @@ public class TimeSeriesDlg extends CaveHydroSWTDialog {
try {
populateStationList();
} catch (VizException e) {
// TODO Auto-generated catch block
e.printStackTrace();
statusHandler.error("Failed to populate station list", e);
}
shell.setCursor(arrowCursor);
}
@ -1188,8 +1186,7 @@ public class TimeSeriesDlg extends CaveHydroSWTDialog {
try {
populateStationList();
} catch (VizException e) {
// TODO Auto-generated catch block
e.printStackTrace();
statusHandler.error("Failed to populate station list", e);
}
shell.setCursor(arrowCursor);
}
@ -1629,8 +1626,7 @@ public class TimeSeriesDlg extends CaveHydroSWTDialog {
}
in.close();
} catch (IOException e) {
// TODO add log statement about group_definition.cfg not found
e.printStackTrace();
statusHandler.error("Failed to read group definition configuration.", e);
}
}
@ -1642,8 +1638,7 @@ public class TimeSeriesDlg extends CaveHydroSWTDialog {
try {
populateStationList();
} catch (VizException e) {
// TODO Auto-generated catch block
e.printStackTrace();
statusHandler.error("Failed to populate station list", e);
}
filteredLidList = new ArrayList<String>();
topDataList.removeAll();
@ -1668,8 +1663,7 @@ public class TimeSeriesDlg extends CaveHydroSWTDialog {
try {
populateStationList();
} catch (VizException e) {
// TODO Auto-generated catch block
e.printStackTrace();
statusHandler.error("Failed to populate station list", e);
}
return;
} else {
@ -1900,8 +1894,7 @@ public class TimeSeriesDlg extends CaveHydroSWTDialog {
} else if (values[0].equalsIgnoreCase(FUTUREHOURS)) {
groupInfo.setFutureHours(Integer.parseInt(values[1]));
} else {
// TODO log a message about invalid key/value pair
System.err.println("Invalid key/value pair: " + s);
statusHandler.warn("Invalid key/value pair: " + s);
}
}
}
@ -1950,8 +1943,7 @@ public class TimeSeriesDlg extends CaveHydroSWTDialog {
graphData.setLatestfcstonly(false);
}
} else {
// TODO log a message about invalid key/value pair
System.err.println("Invalid key/value pair: " + s);
statusHandler.warn("Invalid key/value pair: " + s);
}
}
}
@ -1986,8 +1978,7 @@ public class TimeSeriesDlg extends CaveHydroSWTDialog {
graphData.setEndDate(endDate);
} else {
// TODO log error here, invalid value
System.err.println("Error in Group Definition Config file: " + line);
statusHandler.warn("Error in Group Definition Config file: " + line);
}
// select the first item in the list
@ -2518,8 +2509,7 @@ public class TimeSeriesDlg extends CaveHydroSWTDialog {
try {
populateStationList();
} catch (VizException e) {
// TODO Auto-generated catch block
e.printStackTrace();
statusHandler.error("Failed to populate station list", e);
}
setCurrentData();
opened();

View file

@ -142,7 +142,12 @@ public class LocalizationEditorInput implements IFileEditorInput,
*/
@Override
public String getToolTipText() {
return localizationFile.getName();
String tip = localizationFile.getName();
if (localizationFile.isProtected()) {
tip += " (Protected @ " + localizationFile.getProtectedLevel()
+ ")";
}
return tip;
}
/*

View file

@ -99,4 +99,46 @@ public class FileTreeEntryData {
return resource instanceof IFolder;
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((path == null) ? 0 : path.hashCode());
result = prime * result
+ ((pathData == null) ? 0 : pathData.hashCode());
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;
FileTreeEntryData other = (FileTreeEntryData) obj;
if (path == null) {
if (other.path != null)
return false;
} else if (!path.equals(other.path))
return false;
if (pathData == null) {
if (other.pathData != null)
return false;
} else if (!pathData.equals(other.pathData))
return false;
return true;
}
}

View file

@ -62,4 +62,40 @@ public class LocalizationFileEntryData extends FileTreeEntryData {
return (IFile) super.getResource();
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result
+ ((file == null) ? 0 : file.getContext().hashCode());
return result;
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
LocalizationFileEntryData other = (LocalizationFileEntryData) obj;
if (file == null) {
if (other.file != null)
return false;
} else if (!file.getContext().equals(other.file.getContext()))
return false;
return true;
}
}

View file

@ -198,21 +198,6 @@ public class PathData {
return application;
}
/**
* @param element
* the element to set
*/
public void setElement(IConfigurationElement element) {
this.element = element;
}
/**
* @return the element
*/
public IConfigurationElement getElement() {
return element;
}
/**
* @param recursive
* the recursive to set

View file

@ -145,26 +145,29 @@ public class PlotModelDataRequestJob extends Job {
// TODO need to determine if this type of plot is a combination or
// not
combineData(stationQuery);
if (monitor.isCanceled()) {
break;
}
synchronized (this) {
if (monitor.isCanceled()) {
break;
}
for (PlotInfo[] infos : stationQuery) {
// schedule next work for other jobs
// TODO investigate further, shouldn't be possible to get a null
// here, but somehow we do
if (infos[0].pdv != null) {
switch (task.getRequestType()) {
case PLOT_ONLY:
this.generatorJob.enqueue(infos);
break;
case SAMPLE_ONLY:
this.sampleJob.enqueue(infos);
break;
case PLOT_AND_SAMPLE:
this.generatorJob.enqueue(infos);
this.sampleJob.enqueue(infos);
break;
for (PlotInfo[] infos : stationQuery) {
// schedule next work for other jobs
// TODO investigate further, shouldn't be possible to get a
// null
// here, but somehow we do
if (infos[0].pdv != null) {
switch (task.getRequestType()) {
case PLOT_ONLY:
this.generatorJob.enqueue(infos);
break;
case SAMPLE_ONLY:
this.sampleJob.enqueue(infos);
break;
case PLOT_AND_SAMPLE:
this.generatorJob.enqueue(infos);
this.sampleJob.enqueue(infos);
break;
}
}
}
}
@ -342,13 +345,8 @@ public class PlotModelDataRequestJob extends Job {
&& generatorJob.isDone();
}
public void shutdown() {
public synchronized void shutdown() {
this.cancel();
try {
join();
} catch (InterruptedException e) {
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
}
this.generatorJob.shutdown();
}

View file

@ -32,7 +32,6 @@ import org.eclipse.core.runtime.jobs.Job;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.viz.core.IGraphicsTarget;
import com.raytheon.uf.viz.core.data.IRenderedImageCallback;
import com.raytheon.uf.viz.core.drawables.IImage;
@ -119,10 +118,15 @@ public class PlotModelGeneratorJob extends Job {
}
}
}
if (monitor.isCanceled()) {
break;
synchronized (this) {
if (monitor.isCanceled()) {
if(image != null){
image.dispose();
}
break;
}
caller.modelGenerated(infos, image);
}
caller.modelGenerated(infos, image);
} catch (Exception e) {
statusHandler.error("Error creating plot", e);
}
@ -153,14 +157,9 @@ public class PlotModelGeneratorJob extends Job {
return getState() != Job.RUNNING && getState() != Job.WAITING;
}
protected void shutdown() {
protected synchronized void shutdown() {
cancel();
taskQueue.clear();
try {
join();
} catch (InterruptedException e) {
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
}
clearImageCache();
}
}

View file

@ -44,7 +44,10 @@ import com.raytheon.uf.viz.core.rsc.ResourceList;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* May 7, 2009 jsanchez Initial creation
*
* ======================================
* AWIPS2 DR Work
* 20120913 1172 jkorman Added code to call postAddListeners when
* creating sub-resources.
* </pre>
*
* @author jsanchez
@ -78,6 +81,18 @@ public class PlotBlendedResourceData extends AbstractResourceData implements
}
/**
* Constructs a resource(s) from this resource data.
*
* @param loadProperties
* The load properties
* @param descriptor
* The descriptor that the resource will be loaded onto
* @throws VizException
* if construction fails
* @return The renderable capability. Will return null if any of the sub-resources
* fail to construct.
*/
@Override
public PlotBlendedResource construct(LoadProperties loadProperties,
IDescriptor descriptor) throws VizException {
@ -85,13 +100,16 @@ public class PlotBlendedResourceData extends AbstractResourceData implements
for (ResourcePair rp : resourceList) {
if (!rp.instantiateResource(descriptor, false)) {
// failure to create any sub resources is a failure to construct
// failure to create any sub-resource is a failure to construct
// the blended resource.
return null;
}
this.addChangeListener((IResourceDataChanged) rp.getResource());
}
// All sub-resources have been instantiated, add the listeners.
for (ResourcePair rp : resourceList) {
addChangeListener((IResourceDataChanged) rp.getResource());
resourceList.firePostAddListeners(rp);
}
return rsc;
}

View file

@ -402,11 +402,11 @@ public class PlotResource2 extends
@Override
protected void disposeInternal() {
resourceData.getPlotInfoRetriever().cancel();
progressiveDisclosure.shutdown();
if (generator != null) {
generator.shutdown();
}
resourceData.getPlotInfoRetriever().cancel();
progressiveDisclosure.shutdown();
clearImages();
}

View file

@ -18,7 +18,7 @@
<programArgsLin>-consoleLog</programArgsLin>
<vmArgs>-Xincgc -Xmx1280M -Dosgi.instance.area.readOnly=true
-Dosgi.hook.configurators.exclude=org.eclipse.core.runtime.internal.adaptor.EclipseLogHook,org.eclipse.core.runtime.internal.adaptor.EclipseErrorHandler
-XX:+UnlockDiagnosticVMOptions -XX:+UnsyncloadClass -Dorg.eclipse.update.reconcile=false -XX:MaxPermSize=128m -Dorg.eclipse.ui/KEY_CONFIGURATION_ID=com.raytheon.viz.ui.awips.scheme -Dawips.mode=pypies -Dqpid.dest_syntax=BURL -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -XX:OnOutOfMemoryError=&quot;capture -t no -p $pid &amp;&quot;</vmArgs>
-XX:+UnlockDiagnosticVMOptions -XX:+UnsyncloadClass -Dorg.eclipse.update.reconcile=false -XX:MaxPermSize=128m -Dorg.eclipse.ui/KEY_CONFIGURATION_ID=com.raytheon.viz.ui.awips.scheme -Dawips.mode=pypies -Dqpid.dest_syntax=BURL -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -XX:OnOutOfMemoryError=&quot;capture -t no -p $pid &amp;&quot; -Dlog4j.configuration=log4j-viz-core.xml</vmArgs>
<vmArgsWin>-Dfile.encoding=UTF-8</vmArgsWin>
</launcherArgs>

View file

@ -17,7 +17,7 @@
<programArgs>-data @user.home/caveData -user @user.home/caveData -clean -consoleLog -alertviz</programArgs>
<vmArgs>-Xincgc -Xmx1024M -Dosgi.instance.area.readOnly=true
-Dosgi.hook.configurators.exclude=org.eclipse.core.runtime.internal.adaptor.EclipseLogHook,org.eclipse.core.runtime.internal.adaptor.EclipseErrorHandler
-XX:+UnlockDiagnosticVMOptions -XX:+UnsyncloadClass -Dorg.eclipse.update.reconcile=false -XX:MaxPermSize=128m -Dorg.eclipse.ui/KEY_CONFIGURATION_ID=com.raytheon.viz.ui.awips.scheme -Dawips.mode=pypies -Dqpid.dest_syntax=BURL -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false</vmArgs>
-XX:+UnlockDiagnosticVMOptions -XX:+UnsyncloadClass -Dorg.eclipse.update.reconcile=false -XX:MaxPermSize=128m -Dorg.eclipse.ui/KEY_CONFIGURATION_ID=com.raytheon.viz.ui.awips.scheme -Dawips.mode=pypies -Dqpid.dest_syntax=BURL -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dlog4j.configuration=log4j-viz-core.xml</vmArgs>
<vmArgsWin>-Dfile.encoding=UTF-8</vmArgsWin>
</launcherArgs>
@ -36,7 +36,6 @@
</launcher>
<vm>
<linux include="true">jdk1.6.0</linux>
<windows include="true">jdk1.6.0</windows>
</vm>

View file

@ -27,15 +27,13 @@ import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import com.raytheon.uf.common.dataplugin.radar.util.RadarInfoDict;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.viz.core.drawables.IRenderableDisplay;
import com.raytheon.uf.viz.core.DescriptorMap;
import com.raytheon.uf.viz.core.IDisplayPaneContainer;
import com.raytheon.uf.viz.core.drawables.IDescriptor;
import com.raytheon.uf.viz.core.rsc.DisplayType;
import com.raytheon.uf.viz.core.rsc.LoadProperties;
import com.raytheon.uf.viz.core.rsc.ResourceType;
@ -44,9 +42,11 @@ import com.raytheon.uf.viz.productbrowser.AbstractRequestableProductBrowserDataD
import com.raytheon.uf.viz.productbrowser.ProductBrowserLabel;
import com.raytheon.uf.viz.productbrowser.ProductBrowserPreference;
import com.raytheon.viz.radar.rsc.RadarResourceData;
import com.raytheon.viz.radar.ui.xy.RadarGraphDescriptor;
import com.raytheon.viz.radar.ui.xy.RadarGraphDisplay;
import com.raytheon.viz.radar.ui.xy.RadarXYDescriptor;
import com.raytheon.viz.radar.ui.xy.RadarXYDisplay;
import com.raytheon.viz.ui.editor.EditorInput;
import com.raytheon.viz.ui.UiUtil;
/**
* Product browser implementation for radar
@ -174,40 +174,30 @@ public class RadarProductBrowserDataDefinition extends
return new RadarResourceData();
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.viz.productbrowser.AbstractProductBrowserDataDefinition
* #getEditor()
*/
@Override
public void getEditor() {
protected IDisplayPaneContainer openNewEditor(String editorId) {
if (editorId.equals(DescriptorMap.getEditorId(RadarXYDescriptor.class
.getName()))) {
return UiUtil.createEditor(editorId, new RadarXYDisplay());
} else if (editorId.equals(DescriptorMap
.getEditorId(RadarGraphDescriptor.class.getName()))) {
return UiUtil.createEditor(editorId, new RadarGraphDisplay());
} else {
return super.openNewEditor(editorId);
}
}
@Override
public Class<? extends IDescriptor> getDescriptorClass() {
int prodCode = Integer.parseInt((resourceData).getMetadataMap()
.get("productCode").getConstraintValue());
String format = infoDict.getInfo(prodCode).getFormat();
if ("XY".equals(format)) {
String editor = "com.raytheon.viz.radar.ui.xy.RadarXYEditor";
EditorInput cont = new EditorInput(
(IRenderableDisplay) new RadarXYDisplay());
try {
PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getActivePage().openEditor(cont, editor, true);
} catch (PartInitException e) {
statusHandler.handle(Priority.PROBLEM,
"Unable to open editor : " + editor, e);
}
return RadarXYDescriptor.class;
} else if ("Graph".equals(format)) {
String editor = "com.raytheon.viz.radar.ui.xy.RadarGraphEditor";
EditorInput cont = new EditorInput(
(IRenderableDisplay) new RadarGraphDisplay());
try {
PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getActivePage().openEditor(cont, editor, true);
} catch (PartInitException e) {
statusHandler.handle(Priority.PROBLEM,
"Unable to open editor : " + editor, e);
}
return RadarGraphDescriptor.class;
} else {
return super.getDescriptorClass();
}
}

View file

@ -102,9 +102,11 @@ public class RadarGraphDisplay extends AbstractNonMapDisplay {
GraphProperties graphProps) throws VizException {
// Plot the resource data on the graph
for (ResourcePair rp : getDescriptor().getResourceList()) {
graphProps = (GraphProperties) calcPaintDataTime(graphProps,
rp.getResource());
rp.getResource().paint(target, graphProps);
if (rp.getResource() != null) {
graphProps = (GraphProperties) calcPaintDataTime(graphProps,
rp.getResource());
rp.getResource().paint(target, graphProps);
}
}
}

View file

@ -80,9 +80,11 @@ public class RadarXYDisplay extends AbstractNonMapDisplay {
// Plot the resource data on the graph
for (ResourcePair rp : getDescriptor().getResourceList()) {
graphProps = (GraphProperties) calcPaintDataTime(graphProps,
rp.getResource());
rp.getResource().paint(target, graphProps);
if (rp.getResource() != null) {
graphProps = (GraphProperties) calcPaintDataTime(graphProps,
rp.getResource());
rp.getResource().paint(target, graphProps);
}
}
}

View file

@ -29,7 +29,8 @@ import com.raytheon.uf.viz.core.localization.LocalizationManager;
import com.raytheon.viz.texteditor.TextWarningConstants;
/**
* TODO Add Description
* A grouping of static methods to obtain site id and to query for site
* information in various, seldom changed, tables.
*
* <pre>
*
@ -37,6 +38,7 @@ import com.raytheon.viz.texteditor.TextWarningConstants;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 21, 2009 bwoodle Initial creation
* Sep 09, 2012 14668 rferrel Change default WMO ID to 'blank'.
*
* </pre>
*
@ -103,8 +105,7 @@ public class SiteAbbreviationUtil {
public static String getTtaaii(String afosId) {
String query = "SELECT wmottaaii FROM afos_to_awips WHERE afosid = '"
+ afosId + "';";
// Keep the same default we previously had.
String rval = "SAUS43";
String rval = "-";
try {
List<Object[]> results = DirectDbQuery.executeQuery(query,

View file

@ -208,6 +208,11 @@
<handler
class="com.raytheon.viz.ui.actions.ImagePropertiesAction"
commandId="com.raytheon.viz.ui.imageProperties">
<activeWhen>
<with variable="activeEditor">
<instanceof value="com.raytheon.uf.viz.core.IDisplayPaneContainer"/>
</with>
</activeWhen>
</handler>
<handler
class="com.raytheon.viz.ui.personalities.awips.ClosePerspectiveHandler"

View file

@ -70,22 +70,47 @@
<handler
class="com.raytheon.viz.ui.tools.looping.CombinedFrameTool"
commandId="com.raytheon.viz.ui.tools.looping.frameTool">
<activeWhen>
<with variable="activeEditor">
<instanceof value="com.raytheon.uf.viz.core.IDisplayPaneContainer"/>
</with>
</activeWhen>
</handler>
<handler
class="com.raytheon.viz.ui.tools.looping.LoopTool"
commandId="com.raytheon.viz.ui.tools.looping.loop">
<activeWhen>
<with variable="activeEditor">
<instanceof value="com.raytheon.uf.viz.core.IDisplayPaneContainer"/>
</with>
</activeWhen>
</handler>
<handler
class="com.raytheon.viz.ui.tools.looping.LoopPropertiesTool"
commandId="com.raytheon.viz.ui.tools.looping.loopProperties">
<activeWhen>
<with variable="activeEditor">
<instanceof value="com.raytheon.uf.viz.core.IDisplayPaneContainer"/>
</with>
</activeWhen>
</handler>
<handler
class="com.raytheon.viz.ui.tools.looping.FasterLoopSpeedTool"
commandId="com.raytheon.viz.ui.tools.looping.fasterLoop">
<activeWhen>
<with variable="activeEditor">
<instanceof value="com.raytheon.uf.viz.core.IDisplayPaneContainer"/>
</with>
</activeWhen>
</handler>
<handler
class="com.raytheon.viz.ui.tools.looping.SlowerLoopSpeedTool"
commandId="com.raytheon.viz.ui.tools.looping.slowerLoop">
<activeWhen>
<with variable="activeEditor">
<instanceof value="com.raytheon.uf.viz.core.IDisplayPaneContainer"/>
</with>
</activeWhen>
</handler>
</extension>

View file

@ -50,7 +50,9 @@ public class FasterLoopSpeedTool extends AbstractTool {
@Override
public Object execute(ExecutionEvent arg0) throws ExecutionException {
super.execute(arg0);
PageUpDownKey.handlePageUp(editor);
if (editor != null) {
PageUpDownKey.handlePageUp(editor);
}
return null;
}
}

View file

@ -58,9 +58,9 @@ public class LoopPropertiesTool extends AbstractTool {
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getShell();
LoopPropertiesDialog.openDialog(shell, this.editor);
if (editor != null) {
LoopPropertiesDialog.openDialog(shell, this.editor);
}
return null;
}

View file

@ -50,7 +50,9 @@ public class SlowerLoopSpeedTool extends AbstractTool {
@Override
public Object execute(ExecutionEvent arg0) throws ExecutionException {
super.execute(arg0);
PageUpDownKey.handlePageDown(editor);
if (editor != null) {
PageUpDownKey.handlePageDown(editor);
}
return null;
}

View file

@ -242,11 +242,20 @@ public class LoadSerializedXml extends AbstractHandler {
final boolean multiEditor = container instanceof IMultiPaneEditor;
if (multiEditor) {
while (container.getDisplayPanes().length > b.getDisplays().length) {
((IMultiPaneEditor) container)
.removePane(container.getDisplayPanes()[container
.getDisplayPanes().length - 1]);
if (container.getDisplayPanes().length > b.getDisplays().length) {
VizApp.runSync(new Runnable() {
@Override
public void run() {
while (container.getDisplayPanes().length > b
.getDisplays().length) {
((IMultiPaneEditor) container).removePane(container
.getDisplayPanes()[container
.getDisplayPanes().length - 1]);
}
}
});
}
}
List<AbstractRenderableDisplay> orderedDisplays = Arrays.asList(b
.getDisplays());

View file

@ -20,6 +20,8 @@
package com.raytheon.viz.ui.dialogs;
import java.util.concurrent.RejectedExecutionException;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.DisposeEvent;
@ -47,6 +49,9 @@ import com.raytheon.viz.ui.perspectives.VizPerspectiveListener;
* ---------- ---------- ----------- --------------------------
* 12/20/07 561 Dan Fitch Initial Creation.
* 04/22/08 1088 chammack Added dialog event propagation fix
* 09/13/12 1165 lvenable Update for the initial process
* of removing the dialog blocking capability.
*
* </pre>
*
* @author Dan Fitch
@ -55,10 +60,18 @@ import com.raytheon.viz.ui.perspectives.VizPerspectiveListener;
public class CaveJFACEDialog extends Dialog implements
IPerspectiveSpecificDialog {
/** Dialog last location on the screen. */
protected Point lastLocation;
/** Flag indicating of the dialog was visible. */
private boolean wasVisible = true;
/** Callback called when the dialog is disposed. */
private ICloseCallback closeCallback = null;
/** Flag indicating if the dialog was blocked when opened. */
private boolean blockedOnOpen = false;
/**
*
* @param parentShell
@ -111,6 +124,8 @@ public class CaveJFACEDialog extends Dialog implements
if (mgr != null) {
mgr.removePespectiveDialog(CaveJFACEDialog.this);
}
callCloseCallback();
}
});
@ -165,4 +180,71 @@ public class CaveJFACEDialog extends Dialog implements
shell.setLocation(lastLocation);
}
}
/**
* Call the callback method as this dialog has been disposed.
*/
private void callCloseCallback() {
if (closeCallback != null) {
closeCallback.dialogClosed(new Integer(getReturnCode()));
}
}
/**
* Returns whether the dialog has been opened yet or not
*
* @return True if the dialog was opened, false otherwise.
*/
public final boolean isOpen() {
return (getShell() != null && !getShell().isDisposed());
}
/**
* Add a callback to the dialog. This callback will be called when the
* dialog is disposed.
*
* @param callback
* Callback to be called when the dialog is disposed.
*/
public void setCloseCallback(ICloseCallback callback) {
/*
* Since JFACE allows you to call setBlockOnOpen() after the
* constructor, if the open() method is called before setBlockOnOpen
* then the block is ignored. Here we are checking if the block was set
* and if the dialog is already open because that makes the callback
* pointless.
*/
if (blockedOnOpen && isOpen()) {
StringBuilder sb = new StringBuilder();
sb.append("The method setBlockOnOpen() was called and set to true. The callback method ");
sb.append("will not run correctly as the dialog has been opened and blocked before this ");
sb.append("method was called.");
throw new RejectedExecutionException(sb.toString());
}
this.closeCallback = callback;
}
/**
* This method overrides the existing setBlockOnOpen() method. This will
* eventually be a catch method that will prevent blocking the dialog on
* open. At this time it serves as a placeholder for upcoming work.
*
* @param blockOnOpen
* Flag indicating if the dialog should block when opened.
*/
public void setBlockOnOpen(boolean blockOnOpen) {
/*
* If the dialog is already opened then just return because setting the
* block won't work. In JFACE the setBlockOnOpen needs to be set before
* the open() call, otherwise it is ignored.
*/
if (isOpen()) {
return;
}
super.setBlockOnOpen(blockOnOpen);
blockedOnOpen = blockOnOpen;
}
}

View file

@ -21,6 +21,7 @@ package com.raytheon.viz.ui.dialogs;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.RejectedExecutionException;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.DisposeEvent;
@ -48,7 +49,9 @@ import org.eclipse.swt.widgets.Shell;
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Nov 2, 2010 mschenke Initial creation
* Nov 2, 2010 mschenke Initial creation
* Sep 12, 2012 #1165 lvenable Update for the initial process
* of removing the dialog blocking capability.
*
* </pre>
*
@ -113,20 +116,29 @@ public abstract class CaveSWTDialogBase extends Dialog {
}
}
/** Style used to determine how the dialog will function. */
private int caveStyle = CAVE.NONE;
/** Display reference. */
private Display display;
/** Dialog last location on the screen. */
protected Point lastLocation;
/** Flag indicating of the dialog was visible. */
protected boolean wasVisible = true;
/** Return value. */
private Object returnValue;
/** Shell reference. */
protected Shell shell;
private List<ListenerPair> listenersToAdd;
/** Callback called when the dialog is disposed. */
private ICloseCallback closeCallback = null;
/**
* Construct default cave dialog
*
@ -220,6 +232,7 @@ public abstract class CaveSWTDialogBase extends Dialog {
@Override
public void widgetDisposed(DisposeEvent e) {
disposed();
callCloseCallback();
}
});
@ -282,6 +295,16 @@ public abstract class CaveSWTDialogBase extends Dialog {
}
/**
* Call the callback method as this dialog has been disposed. This action is
* in a separate method since the disposed method can be overridden.
*/
private void callCloseCallback() {
if (closeCallback != null) {
closeCallback.dialogClosed(returnValue);
}
}
/**
* Construct the layout for the shell. Defaults to a GridLayout with one
* column and margins set to 3
@ -405,10 +428,25 @@ public abstract class CaveSWTDialogBase extends Dialog {
return true;
}
/**
* Check if the caveStyle contains a specified attribute.
*
* @param attribute
* Attribute to check for.
* @return True if caveStyle contains the attribute. False if it doesn't.
*/
protected boolean hasAttribute(int attribute) {
return (caveStyle & attribute) == attribute;
}
/**
* Check if the caveStyle does not contain a specified attribute.
*
* @param attribute
* Attribute to check for.
* @return True if caveStyle does not contain the attribute. False if it
* does.
*/
protected boolean doesNotHaveAttribute(int attribute) {
return (caveStyle & attribute) != attribute;
}
@ -443,4 +481,29 @@ public abstract class CaveSWTDialogBase extends Dialog {
}
}
}
/**
* Add a callback to the dialog. This callback will be called when the
* dialog is disposed. Also, the caveStyle is updated to include
* DO_NOT_BLOCK.
*
* @param callback
* Callback to be called when the dialog is disposed.
* @throws Throws
* a RejectedExecutionException with a message indicating that
* this method needs to be called before the open method.
*/
public void setCloseCallback(ICloseCallback callback) {
if (isOpen()) {
StringBuilder sb = new StringBuilder();
sb.append("The method addCloseCallback() needs to be called before the open(). ");
sb.append("This is due to addCloseCallback setting the caveStyle to DO_NOT_BLOCK");
throw new RejectedExecutionException(sb.toString());
}
// Set the DO_NOT_BLOCK on the cave style
this.caveStyle = caveStyle | CAVE.DO_NOT_BLOCK;
this.closeCallback = callback;
}
}

View file

@ -0,0 +1,47 @@
/**
* 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.ui.dialogs;
/**
*
* Callback interface used when a dialog using CaveSWTDialog is disposed.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Sep 11, 2012 #1165 lvenable Initial creation
*
* </pre>
*
* @author lvenable
* @version 1.0
*/
public interface ICloseCallback {
/**
* Method called when a dialog is closed.
*
* @param returnValue
* Return value set in a dialog.
*/
public void dialogClosed(Object returnValue);
}

View file

@ -77,6 +77,8 @@ public abstract class AbstractWorkbenchPartContextActivator implements
private void activate(IWorkbenchPartReference partRef) {
if (isPerspectivePart(partRef)) {
contextManager.activateContexts(this);
} else {
contextManager.deactivateContexts(this);
}
}

View file

@ -1,5 +1,2 @@
source.. = .
output.. = .
bin.includes = META-INF/,\
ognl/,\
ognl-2.7.3.jar

View file

@ -44,15 +44,6 @@
</layout>
</appender-->
<appender name="AlertVizInternalLogAppender" class="org.apache.log4j.rolling.RollingFileAppender">
<rollingPolicy class="org.apache.log4j.rolling.TimeBasedRollingPolicy">
<param name="FileNamePattern" value="${user.home}/caveData/logs/alertviz-%d{yyyyMMdd}.log"/>
</rollingPolicy>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%-5p %d [%t] %c{1}: %m%n"/>
</layout>
</appender>
<logger name="gov.noaa.nws.ncep">
<level value="INFO"/>
<appender-ref ref="NcepILogAppender"/>
@ -65,11 +56,6 @@
<appender-ref ref="NcepDailyRollingFileAppender"/>
</logger>
<logger name="AlertVizLogger" additivity="false">
<level value="ALL"/>
<appender-ref ref="AlertVizInternalLogAppender"/>
</logger>
<logger name="com.raytheon">
<level value="INFO"/>
</logger>

View file

@ -1,4 +1,3 @@
bin.includes = META-INF/,\
.,\
libjep.so
src.includes = libjep.so

View file

@ -1,4 +1,3 @@
bin.includes = META-INF/,\
.,\
libjep.so
src.includes = libjep.so

View file

@ -1,3 +1,2 @@
bin.includes = META-INF/,\
.,\
jep.dll

View file

@ -0,0 +1,73 @@
##
# 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.
##
import glob
import logging
import os
import os.path
import sys
logger = None
def main():
__initLogger()
logger.info("Staring upgrade script for DR #1117...")
logger.info("All information will also be written to removeObeGribParamInfoFiles.log")
if not os.path.isdir('/awips2/edex/data/utility/edex_static/site/'):
logger.error("This script must be run on the EDEX server. Exiting.")
sys.exit(-1)
obsoleteFiles = glob.glob('/awips2/edex/data/utility/edex_static/site/*/grib/parameterInfo/*.xml')
logger.info("Deleting obsolete grib parameter info files.")
for file in obsoleteFiles:
try:
os.remove(file)
except (OSError, IOError):
logger.exception("Could not delete file [" + file + ". Please manually delete this file after the script has exited.")
logger.info("Upgrade script complete.")
logger.info("The following files will need to be regenerated before restarting EDEX: " + str(obsoleteFiles))
def __initLogger():
global logger
logger = logging.getLogger("removeObeGribParamInfoFiles")
logger.setLevel(logging.DEBUG)
format = "%(asctime)s %(name)s %(levelname)s: %(message)s", "%H:%M:%S"
ch = logging.StreamHandler()
ch.setLevel(logging.INFO)
formatter = logging.Formatter("%(asctime)s %(name)s %(levelname)s: %(message)s", "%H:%M:%S")
ch.setFormatter(formatter)
logger.addHandler(ch)
ch = logging.FileHandler('removeObeGribParamInfoFiles.log')
ch.setLevel(logging.INFO)
formatter = logging.Formatter("%(asctime)s %(name)s %(levelname)s: %(message)s", "%H:%M:%S")
ch.setFormatter(formatter)
logger.addHandler(ch)
if __name__ == '__main__':
main()

View file

@ -98,17 +98,7 @@
<fileset dir="${esb.directory}">
<include name="**/bin/linux-x86-64/**" />
</fileset>
</copy>
<if>
<available file="${edex.root.directory}/lib/native/linux32/libjep.so"
type="file" />
<then>
<delete>
<fileset file="${edex.root.directory}/lib/native/linux32/libjep.so" />
</delete>
</then>
</if>
</copy>
<!-- update permissions on the wrapper. -->
<chmod file="${edex.root.directory}/bin/linux-x86-64/wrapper"

View file

@ -30,7 +30,14 @@
</if>
</sequential>
</for>
<if>
<equals arg1="${project.dir}" arg2="" />
<then>
<fail message="Failed to find web project: @{web.project.dir}" />
</then>
</if>
<var name="war.file" value="@{war.name}.war" />
<!-- delete old war file -->

View file

@ -81,6 +81,13 @@
</if>
</sequential>
</for>
<if>
<equals arg1="${plugin.path}" arg2="" />
<then>
<fail message="Failed to find plugin: @{plugin.name}" />
</then>
</if>
<var name="plugin.base" value="${plugin.path}/@{plugin.name}" />
<var name="plugin.bin" value="${plugin.base}/bin" />
@ -91,12 +98,11 @@
<if>
<equals arg1="@{plugin.type}" arg2="cots" />
<then>
<!-- copy the cots jars to the destination -->
<copy todir="${destination.directory}"
overwrite="true" verbose="true">
<fileset dir="${plugin.path}"
includes="@{original.pattern}" />
</copy>
<!-- copy the cots jars to the destination -->
<copyFOSS
plugin.directory323="${plugin.base}"
jar.file323="${jar.destfile}"
destination.directory323="${destination.directory}/@{plugin.name}" />
<!-- jar any compiled cots source -->
<if>
@ -140,7 +146,7 @@
maintain uniqueness of variable names
-->
<attribute name="plugin.directory323" />
<attribute name="jar.file323" />
<attribute name="jar.file323" />
<sequential>
<!--
@ -209,4 +215,83 @@
</for>
</sequential>
</macrodef>
<macrodef name="copyFOSS">
<!--
random character suffixes added to
maintain uniqueness of variable names
-->
<attribute name="plugin.directory323" />
<attribute name="jar.file323" />
<attribute name="destination.directory323" />
<sequential>
<mkdir dir="@{destination.directory323}" />
<!-- scan build.properties -->
<var file="@{plugin.directory323}/build.properties" />
<!--
* iterate through bin.includes
* '.' is seen as the ${output..} directory, itself
* artifacts are only deployed if they are present
-->
<for list="${bin.includes}" param="include"
delimiter="," trim="true">
<sequential>
<if>
<available file="@{plugin.directory323}/@{include}"
type="dir" />
<then>
<!-- deploy a directory -->
<!-- is this the output directory? -->
<if>
<equals arg1="@{include}" arg2="." />
<then>
<if>
<available file="@{plugin.directory323}/${output..}"
type="dir" />
<then>
<jar destfile="@{jar.file323}" update="true">
<fileset
dir="@{plugin.directory323}/${output..}"
includes="**" />
</jar>
</then>
</if>
</then>
<else>
<copy todir="@{destination.directory323}"
overwrite="true" verbose="true">
<fileset dir="@{plugin.directory323}"
includes="@{include}/**" />
</copy>
</else>
</if>
</then>
<else>
<!-- are we deploying a file? -->
<if>
<available file="@{plugin.directory323}/@{include}"
type="file" />
<then>
<copy todir="@{destination.directory323}"
overwrite="true" verbose="true">
<fileset dir="@{plugin.directory323}"
includes="@{include}" />
</copy>
</then>
<else>
<!-- fail: unknown deployment artifact -->
<fail
message="Unable to deploy '@{include}' specified in @{plugin.directory323}/build.properties; unable to find the file / directory." />
</else>
</if>
</else>
</if>
</sequential>
</for>
</sequential>
</macrodef>
</project>

View file

@ -76,6 +76,12 @@
</for>
<!-- run includegen -->
<echo message="Generating deployment list for feature: ${edex.feature}" />
<!--
TODO: need to update the includegen ant task to recognize
plugin architecture restrictions. Plugins that should only
be deployed for a 64-bit system should not be deployed for
a 32-bit system, etc.
-->
<includegen providerfilter="${includegen.filter}"
basedirectories="${basedirectories}"
featurefile="${feature}"

View file

@ -1,4 +1,4 @@
<project name="allElements Delegator">
<project name="allElements Delegator">
<property name="defaultAssemblyEnabled" value="true" />
<!-- ===================================================================== -->
@ -67,6 +67,13 @@
</sequential>
</for>
<if>
<equals arg1="${feature.path}" arg2="" />
<then>
<fail message="Failed to find feature: ${topLevelElementId}" />
</then>
</if>
<mkdir dir="${builder}/tmp/features" />
<!-- copy the feature -->
<copy todir="${builder}/tmp/features">
@ -205,15 +212,81 @@
<if>
<equals arg1="@{plugin.type}" arg2="cots" />
<then>
<copy todir="${builder}/dependencies-stash">
<fileset dir="${plugin.directory}"
includes="@{plugin.pattern}" />
</copy>
<copyFOSS
plugin.directory323="${plugin.directory}/${plugin.name}"
destination.directory323="${builder}/dependencies-stash/@{plugin.name}" />
</then>
</if>
</sequential>
</macrodef>
<macrodef name="copyFOSS">
<!--
random character suffixes added to
maintain uniqueness of variable names
-->
<attribute name="plugin.directory323" />
<attribute name="destination.directory323" />
<sequential>
<mkdir dir="@{destination.directory323}" />
<!-- scan build.properties -->
<var file="@{plugin.directory323}/build.properties" />
<!--
* iterate through bin.includes
* '.' is seen as the ${output..} directory, itself
* artifacts are only deployed if they are present
-->
<for list="${bin.includes}" param="include"
delimiter="," trim="true">
<sequential>
<if>
<available file="@{plugin.directory323}/@{include}"
type="dir" />
<then>
<!-- deploy a directory -->
<!-- is this the output directory? -->
<if>
<not>
<equals arg1="@{include}" arg2="." />
</not>
<then>
<copy todir="@{destination.directory323}"
overwrite="true" verbose="true">
<fileset dir="@{plugin.directory323}"
includes="@{include}/**" />
</copy>
</then>
</if>
</then>
<else>
<!-- are we deploying a file? -->
<if>
<available file="@{plugin.directory323}/@{include}"
type="file" />
<then>
<copy todir="@{destination.directory323}"
overwrite="true" verbose="true">
<fileset dir="@{plugin.directory323}"
includes="@{include}" />
</copy>
</then>
<else>
<!-- fail: unknown deployment artifact -->
<fail
message="Unable to deploy '@{include}' specified in @{plugin.directory323}/build.properties; unable to find the file / directory." />
</else>
</if>
</else>
</if>
</sequential>
</for>
</sequential>
</macrodef>
<!-- ====================================================================== -->
<!-- The default assemble target, this will be called to assemble each -->

View file

@ -23,4 +23,5 @@
# Java Library Path (location of Wrapper.DLL or libwrapper.so)
wrapper.java.library.path.1=%EDEX_HOME%/bin/linux-x86-32/
wrapper.java.library.path.4=%EDEX_HOME%/lib/dependencies/org.jep.linux32/

View file

@ -24,3 +24,4 @@
# Java Library Path (location of Wrapper.DLL or libwrapper.so)
wrapper.java.library.path.1=%EDEX_HOME%/bin/linux-x86-64/
wrapper.java.library.path.4=%EDEX_HOME%/lib/native/linux64/
wrapper.java.library.path.5=%EDEX_HOME%/lib/dependencies/org.jep.linux64/

View file

@ -32,11 +32,13 @@ Jul 08, 2008 1222 jelkins Modified for use within Java
Jul 09, 2008 1222 jelkins Split command line loader from class
Jul 24, 2012 #944 dgilling Refactored to support separate
generation of products and utilities.
Sep 07, 2012 #1150 dgilling Ensure all necessary dirs get created.
@author: jelkins
"""
__version__ = "1.0"
import errno
import os
from os.path import basename
from os.path import join
@ -129,14 +131,13 @@ class Generator():
@type value: string
@raise IOError: when the directory does not exist or is not writable
"""
from os import makedirs
"""
try:
makedirs(value,0755)
os.makedirs(value, 0755)
except OSError, e:
LOG.warn("%s: '%s'" % (e.strerror,e.filename))
if e.errno != errno.EEXIST:
LOG.warn("%s: '%s'" % (e.strerror,e.filename))
self.__destination = value
@ -497,6 +498,13 @@ class Generator():
"""
LOG.debug("Processing Formatter Templates.......")
try:
os.makedirs(join(self.getDestination(), destDir))
except OSError, e:
if e.errno != errno.EEXIST:
LOG.error("%s: '%s'" % (e.strerror,e.filename))
return 0
siteid = self.__siteId
productsWritten = 0

View file

@ -243,8 +243,8 @@ public class EDEXLocalizationAdapter implements ILocalizationAdapter {
entry.fileName = fullPath.substring(fullPath.indexOf(basePath));
entry.date = new Date(file.lastModified());
entry.isProtected = ProtectedFiles.getProtectedLevel(null,
ctx.getLocalizationType(), entry.fileName) != null;
entry.protectedLevel = ProtectedFiles.getProtectedLevel(null,
ctx.getLocalizationType(), entry.fileName);
return entry;
}

View file

@ -25,13 +25,12 @@ import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
import com.raytheon.uf.common.localization.LocalizationContext;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
@ -58,6 +57,7 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
*/
public class ProtectedFiles {
private static transient IUFStatusHandler statusHandler = UFStatus
.getHandler(ProtectedFiles.class);
@ -83,23 +83,6 @@ public class ProtectedFiles {
private static Map<String, ProtectedFiles> sites = new HashMap<String, ProtectedFiles>();
private Set<String> protectedFiles;
private LocalizationLevel level;
private File file;
private long lastModifiedTime = 0;
private ProtectedFiles(LocalizationContext context) {
level = context.getLocalizationLevel();
file = PathManagerFactory.getPathManager()
.getLocalizationFile(context, PROTECTED_FILE).getFile();
protectedFiles = Collections
.synchronizedSortedSet(new TreeSet<String>());
reloadFile();
}
/**
* Add the list of protected files into protectedFiles.txt for the site with
* siteId
@ -126,19 +109,18 @@ public class ProtectedFiles {
*/
public static LocalizationLevel getProtectedLevel(String localizedSite,
LocalizationType type, String path) {
// Check base first
if (base == null) {
return null;
LocalizationLevel protectedLevel = null;
if (localizedSite != null) {
ProtectedFiles site = getSiteLevelFiles(localizedSite);
protectedLevel = site.getProtectedLevelInternal(type, path);
}
LocalizationLevel level = base.getProtectedLevelInternal(type, path);
// If not protected in base file, check the site
if (level == null && localizedSite != null) {
ProtectedFiles files = getSiteLevelFiles(localizedSite);
level = files.getProtectedLevelInternal(type, path);
// base can be null when constructing the base ProtectedFile object and
// the ProtectedFiles constructor looks up it's localization file
if (protectedLevel == null && base != null) {
protectedLevel = base.getProtectedLevelInternal(type, path);
}
return level;
return protectedLevel;
}
/**
@ -157,27 +139,42 @@ public class ProtectedFiles {
return site;
}
private Set<String> protectedFiles;
private LocalizationLevel level;
private File file;
private long lastModifiedTime = 0;
private ProtectedFiles(LocalizationContext context) {
this.level = context.getLocalizationLevel();
this.protectedFiles = new LinkedHashSet<String>();
this.file = PathManagerFactory.getPathManager()
.getLocalizationFile(context, PROTECTED_FILE).getFile();
reloadFile();
}
/**
* Write the protectedFiles.txt file.
*/
private synchronized void writeProtectedFile() {
String str;
try {
file.createNewFile();
BufferedWriter out = new BufferedWriter(new FileWriter(file));
out.write(level == LocalizationLevel.BASE ? BASE_HEADER : String
.format(LEVEL_HEADER, level.toString()));
.format(LEVEL_HEADER, level));
Iterator<String> iter = protectedFiles.iterator();
while (iter.hasNext()) {
str = iter.next();
out.write(str + "\n");
out.write(iter.next() + "\n");
}
out.flush();
out.close();
} catch (IOException e) {
e.printStackTrace();
statusHandler.handle(Priority.PROBLEM,
"Error writing protected file list", e);
}
}
@ -230,11 +227,12 @@ public class ProtectedFiles {
LocalizationLevel[] levels = PathManagerFactory.getPathManager()
.getAvailableLevels();
for (LocalizationLevel level : levels) {
String levelPath = level.toString().toUpperCase() + ":" + path;
boolean isProtected = protectedFiles.contains(levelPath);
if (isProtected) {
for (int i = levels.length - 1; i >= 0; --i) {
// Search backwards so we get highest protected level in case of
// duplicate entries at different levels
LocalizationLevel level = levels[i];
String levelPath = level.name() + ":" + path;
if (protectedFiles.contains(levelPath)) {
protectionLevel = level;
break;
}

View file

@ -3,5 +3,6 @@
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="unit-test"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View file

@ -12,7 +12,8 @@ Require-Bundle: org.apache.commons.logging,
javax.measure,
org.geotools,
javax.persistence,
org.apache.camel;bundle-version="1.0.0";resolution:=optional
org.apache.camel;bundle-version="1.0.0";resolution:=optional,
org.junit;bundle-version="1.0.0"
Export-Package: com.raytheon.edex.plugin.airep,
com.raytheon.edex.plugin.airep.decoder
Bundle-RequiredExecutionEnvironment: JavaSE-1.6

View file

@ -57,6 +57,9 @@ import com.raytheon.uf.edex.wmo.message.WMOHeader;
* 20080103 384 jkorman Initial Coding.
* 20080408 1039 jkorman Added traceId for tracing data.
* 11/11/08 1684 chammack Camel Refactor
* ======================================
* AWIPS2 DR Work
* 20120911 1011 jkorman Added decode of AIREP turbulence.
* </pre>
*
* @author jkorman
@ -99,10 +102,11 @@ public class AirepDecoder extends AbstractDecoder {
String traceId = null;
try {
// traceId = getTraceId(hdrMap);
logger.debug(traceId + "- AirepDecoder.decode()");
WMOHeader wmoHeader = input.wmoHeader;
if(wmoHeader != null) {
traceId = wmoHeader.getWmoHeader().replace(" ", "_");
logger.info(traceId + "- AirepDecoder.decode()");
Calendar refTime = TimeTools.findDataTime(
wmoHeader.getYYGGgg(), header);
if(refTime != null) {
@ -170,11 +174,28 @@ public class AirepDecoder extends AbstractDecoder {
record.setLocation(location);
AIREPWeather wx = parser.getWeatherGroup();
int flightConditions = -1;
if (wx != null) {
record.setFlightConditions(wx.getFlightConditions());
flightConditions = wx.getFlightConditions();
record.setFlightHazard(wx.getHazard());
record.setFlightWeather(wx.getWeather());
}
AirepParser.Turbulence turb = parser.getTurbulence();
int t = -1;
if(turb != null) {
t = turb.getTurbulence() << 4;
}
if(flightConditions > -1) {
if(t > -1) {
record.setFlightConditions(flightConditions | t);
} else {
record.setFlightConditions(flightConditions);
}
} else {
if(t > -1) {
record.setFlightConditions(t);
}
}
}
}
return record;

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