Merge branch 'omaha_14.4.1' into omaha_pda

Conflicts:
	cave/com.raytheon.viz.feature.awips.developer/feature.xml

Former-commit-id: f2c656a4fe6d4b82f691e10d8dc49dcbbcff5adc
This commit is contained in:
Steve Harris 2014-10-16 13:40:43 -05:00
commit 4535f432ce
184 changed files with 10007 additions and 44432 deletions

View file

@ -245,6 +245,10 @@
<param name="feature"
value="com.raytheon.uf.viz.ncep.core.feature" />
</antcall>
<antcall target="p2.build.repo">
<param name="feature"
value="com.raytheon.uf.viz.aviation.advisory.feature" />
</antcall>
<antcall target="p2.build.repo">
<param name="feature"
value="com.raytheon.uf.viz.ncep.dataplugins.feature" />

View file

@ -3,6 +3,31 @@
# Alert VIZ Startup Script
# Note: Alert VIZ will not run as 'root'
# 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.
#
#
# SOFTWARE HISTORY
# Date Ticket# Engineer Description
# ------------ ---------- ----------- --------------------------
# Oct 09, 2014 #3675 bclement added cleanExit signal trap
#
user=`/usr/bin/whoami`
if [ ${user} == 'root' ]; then
echo "WARNING: Alert VIZ cannot be run as user '${user}'!"
@ -78,11 +103,21 @@ if [ ! -d $LOGDIR ]; then
mkdir -p $LOGDIR
fi
# Special instructions for the 64-bit jvm.
ARCH_ARGS=""
if [ -f /awips2/java/jre/lib/amd64/server/libjvm.so ]; then
ARCH_ARGS="-vm /awips2/java/jre/lib/amd64/server/libjvm.so"
fi
# takes in a process id
# kills spawned subprocesses of pid
# and then kills the process itself and exits
function cleanExit()
{
pid=$1
if [[ -n $pid ]]
then
pkill -P $pid
kill $pid
fi
exit
}
trap 'cleanExit $pid' SIGHUP SIGINT SIGQUIT SIGTERM
#run a loop for alertviz
count=0
@ -105,11 +140,13 @@ do
else
#finally check if we can write to the file
if [ -w ${LOGFILE} ]; then
${dir}/alertviz ${ARCH_ARGS} $* > ${LOGFILE} 2>&1
${dir}/alertviz $* > ${LOGFILE} 2>&1 &
else
${dir}/alertviz ${ARCH_ARGS} $*
${dir}/alertviz $* &
fi
pid=$!
wait $pid
exitVal=$?
fi
exitVal=$?
done

View file

@ -31,6 +31,8 @@
# Jan 24, 2014 #2739 bsteffen Log exit status
# Jan 30, 2014 #2593 bclement warns based on memory usage, fixed for INI files with spaces
# Jul 10, 2014 #3363 bclement logs command used to launch application to console logs
# Oct 10, 2014 #3675 njensen Logback now does console logging to ensure correct pid
# Oct 13, 2014 #3675 bclement startup shutdown log includes both launching pid and placeholder
#
#
@ -210,13 +212,16 @@ curTime=`date +%Y%m%d_%H%M%S`
(
export pid=`/bin/bash -c 'echo $PPID'`
LOGFILE="${LOGDIR}/${PROGRAM_NAME}_${curTime}_pid_${pid}_console.log"
export LOGFILE_CAVE="${LOGDIR}/${PROGRAM_NAME}_${curTime}_pid_${pid}_alertviz.log"
export LOGFILE_PERFORMANCE="${LOGDIR}/${PROGRAM_NAME}_${curTime}_pid_${pid}_perf.log"
# we include the PID of the launching process along with
# a %PID% placeholder to be replaced with the "real" PID
LOGFILE_STARTUP_SHUTDOWN="${LOGDIR}/${PROGRAM_NAME}_${pid}_${curTime}_pid_%PID%_startup-shutdown.log"
export LOGFILE_CAVE="${LOGDIR}/${PROGRAM_NAME}_${curTime}_pid_%PID%_logs.log"
export LOGFILE_CONSOLE="${LOGDIR}/${PROGRAM_NAME}_${curTime}_pid_%PID%_console.log"
export LOGFILE_PERFORMANCE="${LOGDIR}/${PROGRAM_NAME}_${curTime}_pid_%PID%_perf.log"
# can we write to log directory
if [ -w ${LOGDIR} ]; then
touch ${LOGFILE}
touch ${LOGFILE_STARTUP_SHUTDOWN}
fi
# remove "-noredirect" flag from command-line if set so it doesn't confuse any
@ -241,18 +246,20 @@ curTime=`date +%Y%m%d_%H%M%S`
nohup ${CAVE_INSTALL}/monitorThreads.sh $pid >> /dev/null 2>&1 &
fi
echo "Launching cave application using the following command: " >> ${LOGFILE}
echo "${CAVE_INSTALL}/cave ${CAVE_INI_ARG} ${SWITCHES} ${USER_ARGS[@]}" >> ${LOGFILE}
echo "Launching cave application using the following command: " >> ${LOGFILE_STARTUP_SHUTDOWN}
echo "${CAVE_INSTALL}/cave ${CAVE_INI_ARG} ${SWITCHES} ${USER_ARGS[@]}" >> ${LOGFILE_STARTUP_SHUTDOWN}
if [[ "${redirect}" == "true" ]] ; then
exec ${CAVE_INSTALL}/cave ${CAVE_INI_ARG} ${SWITCHES} "${USER_ARGS[@]}" >> ${LOGFILE} 2>&1
if [[ "${redirect}" == "true" ]] ; then
# send output to /dev/null because the logback CaveConsoleAppender will capture that output
exec ${CAVE_INSTALL}/cave ${CAVE_INI_ARG} ${SWITCHES} "${USER_ARGS[@]}" >> /dev/null 2>&1
else
exec ${CAVE_INSTALL}/cave ${CAVE_INI_ARG} ${SWITCHES} "${USER_ARGS[@]}" 2>&1 | tee -a ${LOGFILE}
# allow output to print to the console/terminal that launched CAVE
exec ${CAVE_INSTALL}/cave ${CAVE_INI_ARG} ${SWITCHES} "${USER_ARGS[@]}" 2>&1
fi
) &
pid=$!
LOGFILE="${LOGDIR}/${PROGRAM_NAME}_${curTime}_pid_${pid}_console.log"
logExitStatus $pid $LOGFILE
LOGFILE_STARTUP_SHUTDOWN="${LOGDIR}/${PROGRAM_NAME}_${pid}_${curTime}_pid_%PID%_startup-shutdown.log"
logExitStatus $pid $LOGFILE_STARTUP_SHUTDOWN

View file

@ -36,6 +36,7 @@
# Jul 02, 2014 #3245 bclement account for memory override in vm arguments
# Jul 10, 2014 #3363 bclement fixed precedence order for ini file lookup
# Jul 11, 2014 #3371 bclement added killSpawn()
# Oct 13, 2014 #3675 bclement logExitStatus() waits for child to start and renames log with child PID
source /awips2/cave/iniLookup.sh
@ -330,6 +331,14 @@ function logExitStatus()
logFile=$2
trap 'killSpawn $pid' SIGHUP SIGINT SIGQUIT SIGTERM
childPid=$(waitForChildToStart $pid)
if [[ -n $childPid ]]
then
newFileName=${logFile/\%PID\%/$childPid}
mv $logFile $newFileName
logFile=$newFileName
fi
wait $pid
exitCode=$?
curTime=`date --rfc-3339=seconds`
@ -348,6 +357,24 @@ function logExitStatus()
fi
}
# takes in a PID
# waits for PID to spawn child
# outputs the PID of the child or nothing if PID exits first
function waitForChildToStart()
{
pid=$1
# check if PID is still running
while ps -p $pid > /dev/null
do
sleep 1s
if child=$(pgrep -P $pid)
then
echo $child
break
fi
done
}
#Delete old CAVE logs DR 15348
function deleteOldCaveLogs()
{

View file

@ -26,6 +26,7 @@ import org.jivesoftware.smack.packet.Presence;
import com.raytheon.uf.viz.collaboration.comm.identity.info.IVenue;
import com.raytheon.uf.viz.collaboration.comm.identity.invite.VenueInvite;
import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId;
import com.raytheon.uf.viz.collaboration.comm.provider.user.VenueId;
import com.raytheon.uf.viz.collaboration.comm.provider.user.VenueParticipant;
/**
@ -55,6 +56,7 @@ import com.raytheon.uf.viz.collaboration.comm.provider.user.VenueParticipant;
* Jan 30, 2014 2698 bclement changed UserId to VenueParticipant
* Mar 06, 2014 2751 bclement added isAdmin()
* Mar 07, 2014 2848 bclement added getVenueName() and hasOtherParticipants()
* Oct 08, 2014 3705 bclement added getVenueId()
*
* </pre>
*
@ -76,6 +78,11 @@ public interface IVenueSession extends ISession {
*/
public String getVenueName();
/**
* @return qualified id of venue on server
*/
public VenueId getVenueId();
/**
* Send a chat message.
*

View file

@ -0,0 +1,170 @@
/**
* 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.collaboration.comm.identity.info;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
/**
* Collaboration host configuration object
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Oct 9, 2014 3708 bclement moved from SiteConfigurationInformation
*
* </pre>
*
* @author bclement
* @version 1.0
*/
@XmlAccessorType(XmlAccessType.NONE)
public class HostConfig {
@XmlAttribute
private String hostname;
@XmlAttribute
private String prettyName;
@XmlAttribute
private boolean removed = false;
/**
*
*/
public HostConfig() {
}
public HostConfig(String hostname) {
this.hostname = hostname;
}
/**
* @return the hostname
*/
public String getHostname() {
return hostname;
}
/**
* @param hostname
* the hostname to set
*/
public void setHostname(String hostname) {
this.hostname = hostname;
}
/**
* @return the prettyName
*/
public String getPrettyName() {
return prettyName;
}
/**
* @param prettyName
* the prettyName to set
*/
public void setPrettyName(String prettyName) {
this.prettyName = prettyName;
}
/**
* Format for display to the user
*/
@Override
public String toString() {
if (prettyName == null) {
return "Site Server : " + hostname;
} else {
return prettyName + " : " + hostname;
}
}
/**
* Remove description name from hostname
*
* @param text
* @return
*/
public static String removeDescription(String text) {
int firstColon = text.indexOf(':');
if (firstColon >= 0) {
text = text.substring(firstColon + 1);
}
return text.trim();
}
/**
* @return the removed
*/
public boolean isRemoved() {
return removed;
}
/**
* @param removed
* the removed to set
*/
public void setRemoved(boolean removed) {
this.removed = removed;
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result
+ ((hostname == null) ? 0 : hostname.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;
HostConfig other = (HostConfig) obj;
if (hostname == null) {
if (other.hostname != null)
return false;
} else if (!hostname.equals(other.hostname))
return false;
return true;
}
}

View file

@ -0,0 +1,177 @@
/**
* 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.collaboration.comm.identity.info;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlValue;
/**
* Collaboration site configuration object. Stores site specific white/black
* lists used for message filtering and forecaster roles. Roles are not
* restricted by an enum, but usually are short term or long term forecaster.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Oct 9, 2014 3708 bclement moved from SiteConfigurationInformation
* added blacklist support
*
* </pre>
*
* @author bclement
* @version 1.0
*/
@XmlAccessorType(XmlAccessType.NONE)
public class SiteConfig {
public static enum ListType {
WHITELIST, BLACKLIST
};
@XmlAccessorType(XmlAccessType.NONE)
public static class ListEntry {
@XmlValue
private String value;
@XmlAttribute
private boolean removed = false;
/**
*
*/
public ListEntry() {
}
public ListEntry(String value, boolean removed) {
this.value = value;
this.removed = removed;
}
/**
* @return the value
*/
public String getValue() {
return value;
}
/**
* @param value
* the value to set
*/
public void setValue(String value) {
this.value = value;
}
/**
* @return the removed
*/
public boolean isRemoved() {
return removed;
}
/**
* @param removed
* the removed to set
*/
public void setRemoved(boolean removed) {
this.removed = removed;
}
}
@XmlAttribute
private String site;
@XmlAttribute
private ListType listType;
@XmlElement(name = "listEntry")
private ListEntry[] listEntries;
@XmlElement
private String[] roles;
/**
* @return the site
*/
public String getSite() {
return site;
}
/**
* @param site
* the site to set
*/
public void setSite(String site) {
this.site = site;
}
/**
* @return the role
*/
public String[] getRoles() {
return roles;
}
/**
* @param role
* the role to set
*/
public void setRoles(String[] roles) {
this.roles = roles;
}
/**
* @return the listType
*/
public ListType getListType() {
return listType;
}
/**
* @param listType
* the listType to set
*/
public void setListType(ListType listType) {
this.listType = listType;
}
/**
* @return the listEntries
*/
public ListEntry[] getListEntries() {
return listEntries;
}
/**
* @param listEntries
* the listEntries to set
*/
public void setListEntries(ListEntry[] listEntries) {
this.listEntries = listEntries;
}
}

View file

@ -23,7 +23,6 @@ import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
@ -36,8 +35,9 @@ import javax.xml.bind.annotation.XmlRootElement;
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jun 12, 2012 mnash Initial creation
* Jun 12, 2012 mnash Initial creation
* Jan 08, 2014 2563 bclement added format/parse methods to HostConfig
* Oct 10, 2014 3708 bclement moved HostConfig and SiteConfig to separate files
*
* </pre>
*
@ -89,127 +89,4 @@ public class SiteConfigInformation {
this.config = config;
}
@XmlAccessorType(XmlAccessType.NONE)
public static class HostConfig {
@XmlAttribute
private String hostname;
@XmlAttribute
private String prettyName;
/**
* @return the hostname
*/
public String getHostname() {
return hostname;
}
/**
* @param hostname
* the hostname to set
*/
public void setHostname(String hostname) {
this.hostname = hostname;
}
/**
* @return the prettyName
*/
public String getPrettyName() {
return prettyName;
}
/**
* @param prettyName
* the prettyName to set
*/
public void setPrettyName(String prettyName) {
this.prettyName = prettyName;
}
/**
* Format for display to the user
*/
@Override
public String toString() {
if (prettyName == null) {
return "Site Server : " + hostname;
} else {
return prettyName + " : " + hostname;
}
}
/**
* Remove description name from hostname
*
* @param text
* @return
*/
public static String removeDescription(String text) {
int firstColon = text.indexOf(':');
if (firstColon >= 0) {
text = text.substring(firstColon + 1);
}
return text.trim();
}
}
@XmlAccessorType(XmlAccessType.NONE)
public static class SiteConfig {
@XmlAttribute
private String site;
@XmlElement
private String[] subscribedSites;
@XmlElement
private String[] roles;
/**
* @return the site
*/
public String getSite() {
return site;
}
/**
* @param site
* the site to set
*/
public void setSite(String site) {
this.site = site;
}
/**
* @return the subscribedSites
*/
public String[] getSubscribedSites() {
return subscribedSites;
}
/**
* @param subscribedSites
* the subscribedSites to set
*/
public void setSubscribedSites(String[] subscribedSites) {
this.subscribedSites = subscribedSites;
}
/**
* @return the role
*/
public String[] getRoles() {
return roles;
}
/**
* @param role
* the role to set
*/
public void setRoles(String[] roles) {
this.roles = roles;
}
}
}

View file

@ -21,8 +21,11 @@ package com.raytheon.uf.viz.collaboration.comm.provider.connection;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.TreeSet;
import java.util.concurrent.ConcurrentHashMap;
import org.apache.commons.lang.StringUtils;
@ -35,6 +38,9 @@ import org.jivesoftware.smack.packet.Message;
import org.jivesoftware.smack.packet.Presence;
import org.jivesoftware.smack.packet.XMPPError;
import org.jivesoftware.smack.provider.ProviderManager;
import org.jivesoftware.smackx.bookmark.BookmarkManager;
import org.jivesoftware.smackx.bookmark.BookmarkedConference;
import org.jivesoftware.smackx.muc.HostedRoom;
import org.jivesoftware.smackx.muc.MultiUserChat;
import org.jivesoftware.smackx.pubsub.PubSubElementType;
import org.jivesoftware.smackx.pubsub.packet.PubSubNamespace;
@ -62,6 +68,8 @@ import com.raytheon.uf.viz.collaboration.comm.packet.SessionPayload;
import com.raytheon.uf.viz.collaboration.comm.packet.SessionPayloadProvider;
import com.raytheon.uf.viz.collaboration.comm.provider.account.AccountManager;
import com.raytheon.uf.viz.collaboration.comm.provider.account.ClientAuthManager;
import com.raytheon.uf.viz.collaboration.comm.provider.event.BookmarkEvent;
import com.raytheon.uf.viz.collaboration.comm.provider.event.BookmarkEvent.Type;
import com.raytheon.uf.viz.collaboration.comm.provider.event.VenueUserEvent;
import com.raytheon.uf.viz.collaboration.comm.provider.session.CreateSessionData;
import com.raytheon.uf.viz.collaboration.comm.provider.session.FeedVenueConfigManager;
@ -126,6 +134,7 @@ import com.raytheon.uf.viz.collaboration.comm.provider.user.VenueParticipant;
* May 09, 2014 3107 bclement added ability for packet timeout to be set via system properties
* May 19, 2014 3180 bclement added getJoinedVenueSessions()
* Jun 16, 2014 3288 bclement feed venue configuration changes
* Oct 08, 2014 3705 bclement added bookmarks, joinTextOnlyVenue() and getPublicRooms()
*
* </pre>
*
@ -556,6 +565,27 @@ public class CollaborationConnection implements IEventPublisher {
return session;
}
/**
* Join existing chat room with provided handle
*
* @param venueId
* @param handle
* @return
* @throws CollaborationException
*/
public VenueSession joinTextOnlyVenue(VenueId venueId, String handle)
throws CollaborationException {
VenueSession session = createTextOnlyVenue(venueId, handle);
try {
session.configureVenue();
postEvent(session);
return session;
} catch (CollaborationException e) {
removeSession(session);
throw e;
}
}
/**
* Check if venue exists on server
*
@ -625,6 +655,29 @@ public class CollaborationConnection implements IEventPublisher {
return sessions.values();
}
/**
* @return list of public chat rooms on server
*/
public Collection<VenueId> getPublicRooms() {
XMPPConnection conn = getXmppConnection();
String mucService = VenueId.DEFAULT_SUBDOMAIN + "."
+ conn.getServiceName();
Collection<HostedRoom> results;
try {
results = MultiUserChat.getHostedRooms(conn, mucService);
} catch (XMPPException e) {
statusHandler.error("Problem getting public room list from server",
e);
results = Collections.emptyList();
}
Collection<VenueId> rval = new TreeSet<>();
for (HostedRoom room : results) {
rval.add(new VenueId(room.getJid()));
}
return rval;
}
/**
* @return all IVenueSessions that this user is a participant in
*/
@ -682,4 +735,82 @@ public class CollaborationConnection implements IEventPublisher {
return statusHandler;
}
/**
* @return collection of chat rooms bookmarked by user
* @throws CollaborationException
*/
public Collection<VenueId> getBookmarkedRooms()
throws CollaborationException {
Collection<BookmarkedConference> bookmarkedConferences;
try {
BookmarkManager bmkManager = BookmarkManager
.getBookmarkManager(getXmppConnection());
bookmarkedConferences = bmkManager.getBookmarkedConferences();
} catch (XMPPException e) {
throw new CollaborationException(
"Unable to get list of bookmarked rooms from server", e);
}
List<VenueId> rval = new ArrayList<>(bookmarkedConferences.size());
for (BookmarkedConference conf : bookmarkedConferences) {
rval.add(new VenueId(conf.getJid()));
}
return rval;
}
/**
* Bookmark room on server
*
* @param room
* @throws CollaborationException
*/
public void bookmarkRoom(VenueId room) throws CollaborationException {
try {
BookmarkManager bmkManager = BookmarkManager
.getBookmarkManager(getXmppConnection());
bmkManager.addBookmarkedConference(room.getName(),
room.getFQName(), false, null, null);
postEvent(new BookmarkEvent(Type.ADDED, room));
} catch (XMPPException e) {
throw new CollaborationException("Unable to bookmark room: "
+ room.getFQName(), e);
}
}
/**
* Remove bookmark for room from server
*
* @param room
* @throws CollaborationException
*/
public void removeBookmark(VenueId room) throws CollaborationException {
try {
BookmarkManager bmkManager = BookmarkManager
.getBookmarkManager(getXmppConnection());
bmkManager.removeBookmarkedConference(room.getFQName());
postEvent(new BookmarkEvent(Type.REMOVED, room));
} catch (XMPPException e) {
throw new CollaborationException(
"Unable to remove bookmark for room: " + room.getFQName(),
e);
}
}
/**
* Find session this user is joined to by venue id
*
* @param room
* @return null if not joined to room
*/
public IVenueSession getJoinedVenueSession(VenueId room) {
IVenueSession rval = null;
Collection<IVenueSession> joinedRooms = getJoinedVenueSessions();
for (IVenueSession session : joinedRooms) {
VenueId vid = session.getVenueId();
if (room.equals(vid)) {
rval = session;
break;
}
}
return rval;
}
}

View file

@ -0,0 +1,72 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.viz.collaboration.comm.provider.event;
import com.raytheon.uf.viz.collaboration.comm.provider.user.VenueId;
/**
* Event triggered when the user adds or removes a bookmark for a chat room
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Oct 8, 2014 3705 bclement Initial creation
*
* </pre>
*
* @author bclement
* @version 1.0
*/
public class BookmarkEvent {
public static enum Type {
ADDED, REMOVED
};
private final Type type;
private final VenueId room;
/**
*
*/
public BookmarkEvent(Type type, VenueId room) {
this.type = type;
this.room = room;
}
/**
* @return the type
*/
public Type getType() {
return type;
}
/**
* @return the room
*/
public VenueId getRoom() {
return room;
}
}

View file

@ -113,6 +113,7 @@ import com.raytheon.uf.viz.collaboration.comm.provider.user.VenueParticipant;
* Apr 29, 2014 3061 bclement moved invite payload to shared display session
* May 09, 2014 3107 bclement removed catch from isRoomOwner() so callers know about errors
* Jun 16, 2014 3288 bclement changed String venueName to VenueId venueId, added createVenueId()
* Oct 08, 2014 3705 bclement aded getVenueId()
*
*
* </pre>
@ -1004,4 +1005,16 @@ public class VenueSession extends BaseSession implements IVenueSession {
venueName);
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.viz.collaboration.comm.identity.IVenueSession#getVenueId
* ()
*/
@Override
public VenueId getVenueId() {
return venueId;
}
}

View file

@ -19,6 +19,8 @@
**/
package com.raytheon.uf.viz.collaboration.comm.provider.user;
import org.jivesoftware.smack.util.StringUtils;
import com.raytheon.uf.viz.collaboration.comm.identity.user.IQualifiedID;
import com.raytheon.uf.viz.collaboration.comm.provider.Tools;
@ -35,6 +37,7 @@ import com.raytheon.uf.viz.collaboration.comm.provider.Tools;
* Feb 13, 2014 2751 bclement removed resource, fixed getFQN
* May 19, 2014 3180 bclement added isSameVenue() fromString() and hashcode/equals
* Jun 16, 2014 3288 bclement added constructors, default subdomain
* Oct 08, 2014 3705 bclement added single string constructor, compareTo()
*
* </pre>
*
@ -42,7 +45,7 @@ import com.raytheon.uf.viz.collaboration.comm.provider.Tools;
* @version 1.0
*/
public class VenueId implements IQualifiedID {
public class VenueId implements IQualifiedID, Comparable<VenueId> {
public static final String DEFAULT_SUBDOMAIN = "conference";
@ -56,6 +59,11 @@ public class VenueId implements IQualifiedID {
public VenueId() {
}
public VenueId(String jid) {
this.name = StringUtils.parseName(jid);
this.host = StringUtils.parseServer(jid);
}
/**
* @param host
* @param name
@ -189,4 +197,30 @@ public class VenueId implements IQualifiedID {
rval.setHost(Tools.parseHost(venueId));
return rval;
}
/*
* (non-Javadoc)
*
* @see java.lang.Comparable#compareTo(java.lang.Object)
*/
@Override
public int compareTo(VenueId o) {
int rval;
if (o == null) {
rval = 1;
} else if (this.name == null) {
if (o.name == null) {
rval = 0;
} else {
rval = -1;
}
} else {
if (o.name == null) {
rval = 1;
} else {
rval = this.name.compareTo(o.name);
}
}
return rval;
}
}

View file

@ -87,12 +87,14 @@ import com.raytheon.uf.viz.collaboration.comm.identity.IVenueSession;
import com.raytheon.uf.viz.collaboration.comm.identity.event.IRosterChangeEvent;
import com.raytheon.uf.viz.collaboration.comm.identity.event.RosterChangeType;
import com.raytheon.uf.viz.collaboration.comm.provider.connection.CollaborationConnection;
import com.raytheon.uf.viz.collaboration.comm.provider.event.BookmarkEvent;
import com.raytheon.uf.viz.collaboration.comm.provider.event.UserPresenceChangedEvent;
import com.raytheon.uf.viz.collaboration.comm.provider.user.ContactsManager;
import com.raytheon.uf.viz.collaboration.comm.provider.user.ContactsManager.GroupListener;
import com.raytheon.uf.viz.collaboration.comm.provider.user.IDConverter;
import com.raytheon.uf.viz.collaboration.comm.provider.user.SharedGroup;
import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId;
import com.raytheon.uf.viz.collaboration.comm.provider.user.VenueId;
import com.raytheon.uf.viz.collaboration.ui.actions.AddNotifierAction;
import com.raytheon.uf.viz.collaboration.ui.actions.AddToGroupAction;
import com.raytheon.uf.viz.collaboration.ui.actions.ArchiveViewerAction;
@ -106,10 +108,12 @@ import com.raytheon.uf.viz.collaboration.ui.actions.CreateSessionAction;
import com.raytheon.uf.viz.collaboration.ui.actions.DeleteGroupAction;
import com.raytheon.uf.viz.collaboration.ui.actions.DisplayFeedAction;
import com.raytheon.uf.viz.collaboration.ui.actions.InviteAction;
import com.raytheon.uf.viz.collaboration.ui.actions.JoinRoomAction;
import com.raytheon.uf.viz.collaboration.ui.actions.LinkToEditorAction;
import com.raytheon.uf.viz.collaboration.ui.actions.LoginAction;
import com.raytheon.uf.viz.collaboration.ui.actions.LogoutAction;
import com.raytheon.uf.viz.collaboration.ui.actions.PeerToPeerChatAction;
import com.raytheon.uf.viz.collaboration.ui.actions.RemoveBookmarkAction;
import com.raytheon.uf.viz.collaboration.ui.actions.RemoveFromGroupAction;
import com.raytheon.uf.viz.collaboration.ui.actions.RemoveFromRosterAction;
import com.raytheon.uf.viz.collaboration.ui.actions.SendSubReqAction;
@ -117,6 +121,7 @@ import com.raytheon.uf.viz.collaboration.ui.actions.ShowVenueAction;
import com.raytheon.uf.viz.collaboration.ui.actions.UserSearchAction;
import com.raytheon.uf.viz.collaboration.ui.data.AlertWordWrapper;
import com.raytheon.uf.viz.collaboration.ui.data.CollaborationGroupContainer;
import com.raytheon.uf.viz.collaboration.ui.data.PublicRoomContainer;
import com.raytheon.uf.viz.collaboration.ui.data.SessionGroupContainer;
import com.raytheon.uf.viz.collaboration.ui.notifier.NotifierTools;
import com.raytheon.uf.viz.collaboration.ui.prefs.CollabPrefConstants;
@ -154,6 +159,7 @@ import com.raytheon.viz.ui.views.CaveWorkbenchPageManager;
* Apr 11, 2014 2903 bclement login action changes, removed server disconnect listener,
* added static utility method to show view
* May 19, 2014 3180 bclement fixed inviting multiple users to session
* Oct 08, 2014 3705 bclement added room search and bookmarking
*
* </pre>
*
@ -192,6 +198,8 @@ public class CollaborationGroupView extends CaveFloatingView implements
private LogoutAction logOut;
private Action roomSearchAction;
/**
* @param parent
*/
@ -307,6 +315,15 @@ public class CollaborationGroupView extends CaveFloatingView implements
// this is either on or off, so it is a toggle
displayFeedAction = new DisplayFeedAction();
roomSearchAction = new Action("Public Room Search...",
IconUtil.getImageDescriptor(Activator.getDefault().getBundle(),
"spyglass.gif")) {
public void run() {
new RoomSearchDialog(Display.getCurrent().getActiveShell())
.open();
};
};
this.disableOrEnableToolbarActions();
}
@ -341,6 +358,7 @@ public class CollaborationGroupView extends CaveFloatingView implements
private void createMenu(IMenuManager mgr) {
mgr.add(new UserSearchAction());
mgr.add(roomSearchAction);
mgr.add(new Separator());
mgr.add(new ChangeFontAction());
mgr.add(new ChangeStatusAction());
@ -413,6 +431,9 @@ public class CollaborationGroupView extends CaveFloatingView implements
if (o instanceof SessionGroupContainer) {
manager.add(createSessionAction);
return;
} else if (o instanceof PublicRoomContainer){
manager.add(roomSearchAction);
return;
} else if (o instanceof IVenueSession) {
manager.add(new ShowVenueAction((IVenueSession) o));
manager.add(new ArchiveViewerAction((IVenueSession) o));
@ -458,6 +479,11 @@ public class CollaborationGroupView extends CaveFloatingView implements
renameAction.setId(group.getName());
manager.add(renameAction);
}
} else if (o instanceof VenueId) {
VenueId venue = (VenueId) o;
manager.add(new JoinRoomAction(venue, false));
manager.add(new JoinRoomAction(venue, true));
manager.add(new RemoveBookmarkAction(venue));
}
}
@ -515,6 +541,8 @@ public class CollaborationGroupView extends CaveFloatingView implements
new PeerToPeerChatAction(user).run();
} else if (o instanceof IVenueSession) {
new ShowVenueAction((IVenueSession) o).run();
} else if (o instanceof VenueId) {
new JoinRoomAction((VenueId) o, false).run();
}
}
});
@ -913,6 +941,11 @@ public class CollaborationGroupView extends CaveFloatingView implements
refreshUsersTreeViewerAsync(topLevel.getSessionGroup());
}
@Subscribe
public void handleBookmarkEvent(BookmarkEvent event) {
refreshUsersTreeViewerAsync(topLevel.getPublicRoomGroup());
}
/**
* Enables or disables the toolbar buttons based on whether or not the user
* is connected to the xmpp server.

View file

@ -0,0 +1,183 @@
/**
* 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.collaboration.ui;
import java.util.Collection;
import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.layout.TableColumnLayout;
import org.eclipse.jface.viewers.ColumnWeightData;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.RowData;
import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.TableItem;
import com.raytheon.uf.viz.collaboration.comm.provider.connection.CollaborationConnection;
import com.raytheon.uf.viz.collaboration.comm.provider.user.VenueId;
import com.raytheon.uf.viz.collaboration.ui.actions.AddBookmarkAction;
import com.raytheon.uf.viz.collaboration.ui.actions.JoinRoomAction;
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
/**
* Dialog for finding public chat rooms on server
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Oct 8, 2014 3705 bclement Initial creation
*
* </pre>
*
* @author bclement
* @version 1.0
*/
public class RoomSearchDialog extends CaveSWTDialog {
private Table resultTable;
/**
* @param parentShell
*/
public RoomSearchDialog(Shell parentShell) {
super(parentShell);
setText("Room Search");
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.viz.ui.dialogs.CaveSWTDialogBase#initializeComponents(org
* .eclipse.swt.widgets.Shell)
*/
@Override
protected void initializeComponents(Shell shell) {
initializeResultsTable(shell);
initializeButtonBar(shell);
}
private void initializeResultsTable(Shell shell) {
Composite tableComp = new Composite(shell, SWT.NONE);
GridData gridData = new GridData(500, 200);
gridData.horizontalAlignment = SWT.FILL;
gridData.verticalAlignment = SWT.FILL;
gridData.grabExcessHorizontalSpace = true;
gridData.grabExcessVerticalSpace = true;
tableComp.setLayoutData(gridData);
resultTable = new Table(tableComp, SWT.BORDER | SWT.V_SCROLL
| SWT.H_SCROLL | SWT.MULTI | SWT.FULL_SELECTION);
resultTable.setHeaderVisible(true);
resultTable.setLinesVisible(true);
TableColumn nameColumn = new TableColumn(resultTable, SWT.LEFT);
nameColumn.setText("Room Name");
TableColumn idColumn = new TableColumn(resultTable, SWT.LEFT);
idColumn.setText("Service");
TableColumnLayout tcl = new TableColumnLayout();
tableComp.setLayout(tcl);
tcl.setColumnData(nameColumn, new ColumnWeightData(40));
tcl.setColumnData(idColumn, new ColumnWeightData(60));
MenuManager menuMgr = new MenuManager();
menuMgr.setRemoveAllWhenShown(true);
menuMgr.addMenuListener(new IMenuListener() {
@Override
public void menuAboutToShow(IMenuManager manager) {
fillContextMenu(manager);
}
});
Menu menu = menuMgr.createContextMenu(resultTable);
resultTable.setMenu(menu);
search();
}
private void initializeButtonBar(Shell shell) {
Composite buttonComp = new Composite(shell, SWT.NONE);
buttonComp.setLayoutData(new GridData(SWT.RIGHT, SWT.NONE, false,
false, 1, 1));
RowLayout layout = new RowLayout(SWT.HORIZONTAL);
layout.pack = false;
buttonComp.setLayout(layout);
Button closeButton = new Button(buttonComp, SWT.PUSH);
closeButton.setText("Close");
closeButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
close();
}
});
closeButton.setLayoutData(new RowData(90, SWT.DEFAULT));
}
private void fillContextMenu(IMenuManager manager) {
TableItem[] selection = resultTable.getSelection();
if (selection == null || selection.length == 0) {
return;
}
VenueId[] rooms = new VenueId[selection.length];
for (int i = 0; i < rooms.length; i += 1) {
rooms[i] = (VenueId) selection[i].getData();
}
if (rooms.length == 1) {
manager.add(new JoinRoomAction(rooms[0], false));
manager.add(new JoinRoomAction(rooms[0], true));
}
manager.add(new AddBookmarkAction(rooms));
}
private void search() {
CollaborationConnection conn = CollaborationConnection.getConnection();
Collection<VenueId> results = conn.getPublicRooms();
resultTable.removeAll();
if (results.size() > 0) {
for (VenueId room : results) {
TableItem ti = new TableItem(resultTable, SWT.NONE);
ti.setText(0, room.getName());
ti.setText(1, room.getHost());
ti.setData(room);
}
resultTable.setEnabled(true);
} else {
TableItem ti = new TableItem(resultTable, SWT.NONE);
ti.setText("No rooms found.");
resultTable.setEnabled(false);
}
}
}

View file

@ -0,0 +1,159 @@
/**
* 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.collaboration.ui;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
import java.util.Map;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
import com.raytheon.uf.common.localization.IPathManager;
import com.raytheon.uf.common.localization.LocalizationContext;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.PathManager;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.viz.collaboration.ui.SiteColorInformation.SiteColor;
/**
* Site coloring configuration manager
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Oct 10, 2014 3708 bclement Moved color methods from SiteConfigurationManager
*
* </pre>
*
* @author bclement
* @version 1.0
*/
public class SiteColorConfigManager {
private static SiteColorInformation colorInfo;
/**
*
*/
private SiteColorConfigManager() {
}
/**
* Write the colorInfo.xml file out to user localization so that the user
* can retrieve it on CAVE restart
*
* @param information
*/
public static void writeSiteColorInformation(
SiteColorInformation information) {
colorInfo = information;
IPathManager pathMgr = PathManagerFactory.getPathManager();
LocalizationContext lContext = pathMgr.getContext(
LocalizationType.CAVE_STATIC, LocalizationLevel.USER);
LocalizationFile file = pathMgr.getLocalizationFile(lContext,
"collaboration" + File.separator + "colorInfo.xml");
try {
JAXBContext context = JAXBContext
.newInstance(SiteColorInformation.class);
Marshaller marshaller = context.createMarshaller();
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,
new Boolean(true));
marshaller.marshal(information, file.getFile());
file.save();
} catch (Exception e) {
Activator.statusHandler.error(
"Unable to write color information to file: "
+ file.getName() + " in context " + lContext, e);
}
}
/**
* Instantiate the colorInfo object so that the colors can be read in from
* the colorInfo.xml file and retrieved from localization
*
* @return
*/
public static SiteColorInformation getSiteColorInformation() {
if (colorInfo == null) {
PathManager pm = (PathManager) PathManagerFactory.getPathManager();
Map<LocalizationLevel, LocalizationFile> files = pm
.getTieredLocalizationFile(LocalizationType.CAVE_STATIC,
"collaboration" + File.separator + "colorInfo.xml");
LocalizationLevel[] levels = LocalizationLevel.values();
for (int i = levels.length - 1; i >= 0 && colorInfo == null; --i) {
LocalizationLevel level = levels[i];
if (level == LocalizationLevel.SITE
|| level == LocalizationLevel.USER) {
LocalizationFile file = files.get(level);
if (file != null) {
InputStream in = null;
try {
in = file.openInputStream();
JAXBContext context = JAXBContext
.newInstance(SiteColorInformation.class);
Unmarshaller unmarshaller = context
.createUnmarshaller();
colorInfo = (SiteColorInformation) unmarshaller
.unmarshal(in);
} catch (Exception e) {
Activator.statusHandler.error(
"Unable to read color information from file: "
+ file.getName() + " in level "
+ level, e);
}
if (in != null) {
try {
in.close();
} catch (IOException e) {
Activator.statusHandler.error(
"Problem closing color information file: "
+ file.getName(), e);
}
}
}
}
}
}
return colorInfo;
}
/**
* @return list of colors from site information config
*/
public static List<SiteColor> getSiteColors() {
SiteColorInformation colorInfo = getSiteColorInformation();
if (colorInfo != null) {
return getSiteColorInformation().getColors();
} else {
return null;
}
}
}

View file

@ -23,19 +23,23 @@ import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.concurrent.locks.ReentrantLock;
import javax.xml.bind.DataBindingException;
import javax.xml.bind.JAXB;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
import com.raytheon.uf.common.localization.IPathManager;
import org.apache.commons.collections.map.LRUMap;
import com.raytheon.uf.common.localization.FileUpdatedMessage;
import com.raytheon.uf.common.localization.ILocalizationFileObserver;
import com.raytheon.uf.common.localization.LocalizationContext;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
@ -47,10 +51,11 @@ import com.raytheon.uf.common.localization.exception.LocalizationException;
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.collaboration.comm.identity.info.HostConfig;
import com.raytheon.uf.viz.collaboration.comm.identity.info.SiteConfig;
import com.raytheon.uf.viz.collaboration.comm.identity.info.SiteConfig.ListEntry;
import com.raytheon.uf.viz.collaboration.comm.identity.info.SiteConfig.ListType;
import com.raytheon.uf.viz.collaboration.comm.identity.info.SiteConfigInformation;
import com.raytheon.uf.viz.collaboration.comm.identity.info.SiteConfigInformation.HostConfig;
import com.raytheon.uf.viz.collaboration.comm.identity.info.SiteConfigInformation.SiteConfig;
import com.raytheon.uf.viz.collaboration.ui.SiteColorInformation.SiteColor;
/**
* Parse a file to grab attributes about a user
@ -61,10 +66,14 @@ import com.raytheon.uf.viz.collaboration.ui.SiteColorInformation.SiteColor;
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jun 12, 2012 mnash Initial creation
* Jun 12, 2012 mnash Initial creation
* Jan 08, 2014 2563 bclement duplicate code elimination
* added methods to partially modify user config
* Jan 27, 2014 2700 bclement fixed null list from jaxb object
* Oct 10, 2014 3708 bclement refactored to support blacklisting
* moved color config to SiteColorConfigManager
* site level now combined with site config
* Oct 10, 2014 3708 bclement fixed possible NPE in getSiteConfig() getSiteVisibilityConfig()
*
* </pre>
*
@ -72,25 +81,40 @@ import com.raytheon.uf.viz.collaboration.ui.SiteColorInformation.SiteColor;
* @version 1.0
*/
public class SiteConfigurationManager {
private static final IUFStatusHandler log = UFStatus.getHandler(SiteConfigurationManager.class);
private static SiteConfigInformation instance;
private static final IUFStatusHandler log = UFStatus
.getHandler(SiteConfigurationManager.class);
private static SiteConfigInformation userInstance;
private static final String PRIMARY_CONF_FILE = "config.xml";
private static final ReentrantLock userConfigLock = new ReentrantLock();
private static SiteConfigInformation _siteInstance;
private static SiteColorInformation colorInfo;
private static LocalizationFile siteConfigInfoFile;
private static SiteConfigInformation _userInstance;
private static LocalizationFile userConfigInfoFile;
@SuppressWarnings("unchecked")
private static final Map<String, SiteVisiblityConfig> siteVisibilityMap = new LRUMap(
2);
private static final ILocalizationFileObserver siteConfigObserver = new ILocalizationFileObserver() {
@Override
public void fileUpdated(FileUpdatedMessage message) {
clear();
}
};
// level hierarchy for site config
private static final LocalizationLevel[] siteLevels;
static{
static {
// load site levels with all levels except for USER
PathManager pm = (PathManager) PathManagerFactory.getPathManager();
LocalizationLevel[] available = pm.getAvailableLevels();
List<LocalizationLevel> levels = new ArrayList<LocalizationLevel>(available.length -1);
List<LocalizationLevel> levels = new ArrayList<LocalizationLevel>(
available.length - 1);
for (int i = available.length - 1; i >= 0; --i) {
if (!available[i].equals(LocalizationLevel.USER)) {
levels.add(available[i]);
@ -102,15 +126,17 @@ public class SiteConfigurationManager {
/**
* Get first localization file for SiteConfigInformation found in levels
*
* @param filename
* config file name
* @param levels
* localization levels to search in order
* @return null if none found
*/
private static LocalizationFile findConfigLocalizationFile(
private static LocalizationFile findConfigLocalizationFile(String filename,
LocalizationLevel[] levels) {
LocalizationFile rval = null;
for (LocalizationLevel level : levels) {
rval = getConfigLocalizationFile(level);
rval = getConfigLocalizationFile(filename, level);
if (rval != null && rval.exists()) {
break;
}
@ -121,29 +147,28 @@ public class SiteConfigurationManager {
/**
* Get LocalizationFile for SiteConfigInformation at specified level.
*
* @param filename
* config file name
* @param level
* @return
*/
private static LocalizationFile getConfigLocalizationFile(
private static LocalizationFile getConfigLocalizationFile(String filename,
LocalizationLevel level) {
PathManager pm = (PathManager) PathManagerFactory.getPathManager();
LocalizationContext localContext = pm.getContext(
LocalizationType.CAVE_STATIC, level);
return pm.getLocalizationFile(localContext, "collaboration"
+ File.separator + "config.xml");
+ File.separator + filename);
}
/**
* Read configuration file from file system. Must be externally
* synchronized.
*
* @param levels
* localization levels to search in order
* @return null if configuration file wasn't found or an error occurred
*/
private static SiteConfigInformation readConfigInformation(
LocalizationLevel[] levels) {
LocalizationFile file = findConfigLocalizationFile(levels);
LocalizationFile file) {
SiteConfigInformation rval = null;
if (file != null && file.exists()) {
InputStream in = null;
@ -182,7 +207,8 @@ public class SiteConfigurationManager {
private static void writeConfigInformation(LocalizationLevel level,
SiteConfigInformation config) throws JAXBException,
LocalizationException {
LocalizationFile file = getConfigLocalizationFile(level);
LocalizationFile file = getConfigLocalizationFile(PRIMARY_CONF_FILE,
level);
LocalizationFileOutputStream out = null;
try {
out = file.openOutputStream();
@ -191,7 +217,7 @@ public class SiteConfigurationManager {
Marshaller marshaller = context.createMarshaller();
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,
new Boolean(true));
marshaller.marshal(userInstance, out);
marshaller.marshal(config, out);
} finally {
if (out != null) {
try {
@ -204,16 +230,19 @@ public class SiteConfigurationManager {
}
/**
* Go to the config.xml file and grab the user information, for use in
* determining what kind of user you are in collaboration
* Read site level configuration file
*
* @return
* @return null if no file was found or file is invalid
*/
public static synchronized SiteConfigInformation getSiteConfigInformation() {
if (instance == null) {
SiteConfigInformation info = readConfigInformation(siteLevels);
private static SiteConfigInformation getSiteConfigInformation() {
if (_siteInstance == null) {
LocalizationFile file = findConfigLocalizationFile(
PRIMARY_CONF_FILE, siteLevels);
SiteConfigInformation info = readConfigInformation(file);
if (isValid(info)) {
instance = info;
_siteInstance = info;
file.addFileUpdatedObserver(siteConfigObserver);
siteConfigInfoFile = file;
} else {
log.handle(Priority.PROBLEM,
"Misconfigured config.xml file at site level. "
@ -223,50 +252,28 @@ public class SiteConfigurationManager {
+ " attributes.");
}
}
return instance;
return _siteInstance;
}
/**
* Write the colorInfo.xml file out to user localization so that the user
* can retrieve it on CAVE restart
* Read user level configuration file. Creates new file if not found.
*
* @param information
* @return
*/
public static void writeSiteColorInformation(
SiteColorInformation information) {
colorInfo = information;
IPathManager pathMgr = PathManagerFactory.getPathManager();
LocalizationContext lContext = pathMgr.getContext(
LocalizationType.CAVE_STATIC, LocalizationLevel.USER);
LocalizationFile file = pathMgr.getLocalizationFile(lContext,
"collaboration" + File.separator + "colorInfo.xml");
try {
JAXBContext context = JAXBContext
.newInstance(SiteColorInformation.class);
Marshaller marshaller = context.createMarshaller();
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,
new Boolean(true));
marshaller.marshal(information, file.getFile());
file.save();
} catch (Exception e) {
Activator.statusHandler.handle(Priority.PROBLEM,
e.getLocalizedMessage(), e);
}
}
/**
* Allows users to have their own extra configured sites, but does not check
* for validity as we don't have to have a role or a site specified. Must be
* externally synchronized.
*/
private static void readUserSiteConfigInformation() {
// we always want to read/write the same localization file, only give
// one level to search
userInstance = readConfigInformation(new LocalizationLevel[] { LocalizationLevel.USER });
if (userInstance == null) {
// user config doesn't exist, create a new one
userInstance = new SiteConfigInformation();
private static SiteConfigInformation getUserConfigInformation() {
if (_userInstance == null) {
LocalizationFile file = getConfigLocalizationFile(
PRIMARY_CONF_FILE, LocalizationLevel.USER);
SiteConfigInformation info = readConfigInformation(file);
if (info == null) {
// user config doesn't exist, create a new one
info = new SiteConfigInformation();
file.addFileUpdatedObserver(siteConfigObserver);
userConfigInfoFile = file;
}
_userInstance = info;
}
return _userInstance;
}
/**
@ -274,31 +281,34 @@ public class SiteConfigurationManager {
*
* @param userEnabledSites
*/
public static void writeUserEnabledSites(String[] userEnabledSites) {
userConfigLock.lock();
private static void writeUserConfiguredVisibility(
SiteVisiblityConfig visibility) {
try {
if (userInstance == null) {
readUserSiteConfigInformation();
}
// update object
List<SiteConfig> configs = userInstance.getConfig();
SiteConfig config;
if (configs == null || configs.isEmpty()) {
configs = new ArrayList<SiteConfigInformation.SiteConfig>(1);
config = new SiteConfig();
configs.add(config);
userInstance.setConfig(configs);
} else {
config = configs.get(0);
}
config.setSubscribedSites(userEnabledSites);
SiteConfigInformation userInstance = getUserConfigInformation();
Map<String, ListEntry> userSpecificConfigs = visibility
.getUserSpecificConfigs();
if (!userSpecificConfigs.isEmpty()) {
String site = visibility.getActingSite();
SiteConfig siteConfig = getSiteConfig(userInstance, site);
if (siteConfig == null) {
siteConfig = new SiteConfig();
siteConfig.setSite(site);
List<SiteConfig> configs = userInstance.getConfig();
if (configs == null) {
configs = new ArrayList<>(1);
userInstance.setConfig(configs);
}
configs.add(siteConfig);
}
ListEntry[] entries = userSpecificConfigs.values().toArray(
new ListEntry[0]);
siteConfig.setListEntries(entries);
// update on file system
writeConfigInformation(LocalizationLevel.USER, userInstance);
// update on file system
writeConfigInformation(LocalizationLevel.USER, userInstance);
}
} catch (Exception e) {
log.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
} finally {
userConfigLock.unlock();
}
}
@ -308,40 +318,54 @@ public class SiteConfigurationManager {
*
* @param config
*/
public static void addUserHostConfig(HostConfig config){
userConfigLock.lock();
try{
if(userInstance == null){
readUserSiteConfigInformation();
}
synchronized public static void addUserHostConfig(HostConfig config) {
updateUserHostConfig(config, false);
}
/**
* Update user level host overrides
*
* @param config
* @param remove
* true if the host entry specifies that the user doesn't want to
* see the host in the UI
*/
private static void updateUserHostConfig(HostConfig config, boolean remove) {
try {
SiteConfigInformation userInstance = getUserConfigInformation();
List<HostConfig> servers = userInstance.getServer();
if (servers == null){
servers = new ArrayList<SiteConfigInformation.HostConfig>(1);
if (servers == null) {
servers = new ArrayList<HostConfig>(1);
userInstance.setServer(servers);
}
if (!hasHost(servers, config)) {
HostConfig existing = findHost(servers, config);
if (existing == null) {
config.setRemoved(remove);
servers.add(config);
writeConfigInformation(LocalizationLevel.USER, userInstance);
} else if (existing.isRemoved() != remove) {
existing.setRemoved(remove);
existing.setPrettyName(config.getPrettyName());
writeConfigInformation(LocalizationLevel.USER, userInstance);
}
} catch (Exception e) {
log.error(e.getLocalizedMessage(), e);
} finally {
userConfigLock.unlock();
}
}
/**
* @param servers
* @param config
* @return true if the hostname in config matches any in servers
* @return null if matching host config not found
*/
private static boolean hasHost(List<HostConfig> servers, HostConfig config) {
private static HostConfig findHost(List<HostConfig> servers,
HostConfig config) {
for (HostConfig hc : servers) {
if (hc.getHostname().equalsIgnoreCase(config.getHostname())) {
return true;
return hc;
}
}
return false;
return null;
}
/**
@ -351,100 +375,58 @@ public class SiteConfigurationManager {
* @param serverAddress
*/
public static void removeUserHostConfig(String serverAddress) {
userConfigLock.lock();
try {
if (userInstance == null) {
readUserSiteConfigInformation();
}
List<HostConfig> servers = userInstance.getServer();
if (servers != null) {
List<HostConfig> newServers = new ArrayList<HostConfig>();
for (HostConfig hc : servers) {
if (!hc.getHostname().equalsIgnoreCase(serverAddress)) {
newServers.add(hc);
}
}
userInstance.setServer(newServers);
writeConfigInformation(LocalizationLevel.USER, userInstance);
}
} catch (Exception e) {
log.error(e.getLocalizedMessage(), e);
} finally {
userConfigLock.unlock();
}
updateUserHostConfig(new HostConfig(serverAddress), true);
}
/**
* Get host configuration added by this user.
* Constructs a list of host configs from the site level configs and the
* user level overrides
*
* @return empty list if none are found
* @return empty list if none found
*/
public static List<HostConfig> getUserHostConfig() {
List<HostConfig> rval;
userConfigLock.lock();
try {
if (userInstance == null) {
readUserSiteConfigInformation();
synchronized public static Collection<HostConfig> getHostConfigs() {
List<HostConfig> userConfigured = getUserHostConfigs();
SiteConfigInformation siteConfigInformation = getSiteConfigInformation();
if (siteConfigInformation == null) {
return Collections.emptyList();
}
List<HostConfig> siteConfigured = siteConfigInformation.getServer();
if (siteConfigured == null) {
siteConfigured = new ArrayList<>(0);
}
Collection<HostConfig> rval;
if (userConfigured.isEmpty()) {
rval = siteConfigured;
} else {
rval = new HashSet<HostConfig>(siteConfigured);
for (HostConfig user : userConfigured) {
if (user.isRemoved()) {
rval.remove(user);
} else {
rval.add(user);
}
}
List<HostConfig> servers = userInstance.getServer();
if (servers == null) {
rval = new ArrayList<HostConfig>(0);
} else {
rval = new ArrayList<HostConfig>(servers);
}
} finally {
userConfigLock.unlock();
}
return rval;
}
/**
* Instantiate the colorInfo object so that the colors can be read in from
* the colorInfo.xml file and retrieved from localization
* Get host configuration added by this user. Must be externally read
* locked.
*
* @return
* @return empty list if none are found
*/
public static SiteColorInformation getSiteColorInformation() {
if (colorInfo == null) {
PathManager pm = (PathManager) PathManagerFactory.getPathManager();
Map<LocalizationLevel, LocalizationFile> files = pm
.getTieredLocalizationFile(LocalizationType.CAVE_STATIC,
"collaboration" + File.separator + "colorInfo.xml");
LocalizationLevel[] levels = LocalizationLevel.values();
for (int i = levels.length - 1; i >= 0 && colorInfo == null; --i) {
LocalizationLevel level = levels[i];
if (level == LocalizationLevel.SITE
|| level == LocalizationLevel.USER) {
LocalizationFile file = files.get(level);
if (file != null) {
InputStream in = null;
try {
in = file.openInputStream();
JAXBContext context = JAXBContext
.newInstance(SiteColorInformation.class);
Unmarshaller unmarshaller = context
.createUnmarshaller();
colorInfo = (SiteColorInformation) unmarshaller
.unmarshal(in);
} catch (Exception e) {
Activator.statusHandler.handle(Priority.PROBLEM,
e.getLocalizedMessage(), e);
}
if (in != null) {
try {
in.close();
} catch (IOException e) {
Activator.statusHandler.handle(
Priority.PROBLEM,
e.getLocalizedMessage(), e);
}
}
}
}
}
private static List<HostConfig> getUserHostConfigs() {
List<HostConfig> rval;
SiteConfigInformation userInstance = getUserConfigInformation();
List<HostConfig> servers = userInstance.getServer();
if (servers == null) {
rval = new ArrayList<HostConfig>(0);
} else {
rval = new ArrayList<HostConfig>(servers);
}
return colorInfo;
return rval;
}
/**
@ -464,70 +446,159 @@ public class SiteConfigurationManager {
}
/**
* Get list of subscribed sites from site configuration
* Gets configuration objects for sites. Does not include user level
* overrides.
*
* @return
*/
synchronized public static Collection<SiteConfig> getSiteConfigs() {
Collection<SiteConfig> rval;
SiteConfigInformation info = getSiteConfigInformation();
if (info == null) {
rval = Collections.emptyList();
} else {
List<SiteConfig> configs = info.getConfig();
if (configs == null) {
rval = Collections.emptyList();
} else {
rval = configs;
}
}
return rval;
}
/**
* @param actingSite
* @param otherSite
* @return true if the configuration for the acting site shows the other
* site as visible (takes into account user level overrides)
*/
synchronized public static boolean isVisible(String actingSite,
String otherSite) {
SiteVisiblityConfig config = getSiteVisibilityConfig(actingSite);
return config.isVisible(otherSite);
}
/**
* Add a user level override for the acting site config to set the other
* site as visible
*
* @param actingSite
* @param otherSite
*/
synchronized public static void showSite(String actingSite, String otherSite) {
SiteVisiblityConfig config = getSiteVisibilityConfig(actingSite);
config.show(otherSite);
writeUserConfiguredVisibility(config);
}
/**
* Add a user level override for the acting site config to set the other
* site as not visible
*
* @param actingSite
* @param otherSite
*/
synchronized public static void hideSite(String actingSite, String otherSite) {
SiteVisiblityConfig config = getSiteVisibilityConfig(actingSite);
config.hide(otherSite);
writeUserConfiguredVisibility(config);
}
/**
* Get site visibility configuration for acting site
*
* @param site
* @return
*/
public static List<String> getSubscribeList(String site) {
List<String> subscribed = new ArrayList<String>();
if (instance.getConfig() != null) {
for (SiteConfig config : instance.getConfig()) {
if (config.getSite().equals(site)) {
subscribed = Arrays.asList(config.getSubscribedSites());
break;
}
}
}
return subscribed;
}
/**
* Reads the user subscribe list
*
* @return
*/
public static List<String> getUserSubscribeList() {
List<String> subscribed = new ArrayList<String>();
userConfigLock.lock();
try {
if (userInstance == null) {
readUserSiteConfigInformation();
}
if (userInstance != null && userInstance.getConfig() != null) {
for (SiteConfig config : userInstance.getConfig()) {
if (config.getSubscribedSites() != null) {
subscribed = new ArrayList<String>();
for (String item : config.getSubscribedSites()) {
subscribed.add(item);
}
private static SiteVisiblityConfig getSiteVisibilityConfig(String site) {
SiteVisiblityConfig rval = null;
rval = siteVisibilityMap.get(site);
if (rval == null) {
Map<String, ListEntry> userSpecificConfigs = getUserSpecificConfigs(site);
SiteConfigInformation siteInstance = getSiteConfigInformation();
if (siteInstance != null && siteInstance.getConfig() != null) {
for (SiteConfig config : siteInstance.getConfig()) {
String configSite = config.getSite();
if (configSite != null && configSite.equals(site)) {
rval = new SiteVisiblityConfig(config,
userSpecificConfigs);
break;
}
}
}
} finally {
userConfigLock.unlock();
if (rval == null) {
/*
* this shouldn't happen since you have to have an entry in the
* site configuration file to log in
*/
log.warn("No configuration found for site '" + site
+ "'. Defaulting to showing all sites.");
rval = new SiteVisiblityConfig(site, new HashSet<String>(0),
ListType.BLACKLIST, userSpecificConfigs);
} else {
siteVisibilityMap.put(site, rval);
}
}
return subscribed;
return rval;
}
/**
* @return list of colors from site information config
* Get user level overrides for site visibility
*
* @param site
* @return site configs indexed by name
*/
public static List<SiteColor> getSiteColors() {
SiteColorInformation colorInfo = getSiteColorInformation();
if (colorInfo != null) {
return getSiteColorInformation().getColors();
} else {
return null;
private static Map<String, ListEntry> getUserSpecificConfigs(String site) {
Map<String, ListEntry> rval = new HashMap<>();
SiteConfigInformation userInstance = getUserConfigInformation();
SiteConfig siteConfig = getSiteConfig(userInstance, site);
if (siteConfig != null) {
ListEntry[] entries = siteConfig.getListEntries();
if (entries != null) {
for (ListEntry entry : entries) {
rval.put(entry.getValue(), entry);
}
}
}
return rval;
}
/**
* @param info
* @param site
* @return null if no config exists for privided site in info
*/
private static SiteConfig getSiteConfig(SiteConfigInformation info,
String site) {
SiteConfig rval = null;
if (info.getConfig() != null) {
for (SiteConfig config : info.getConfig()) {
String configSite = config.getSite();
if (configSite != null && configSite.equals(site)) {
rval = config;
break;
}
}
}
return rval;
}
/**
* reset in-memory configuration
*/
public static void nullifySiteConfigInstance() {
instance = null;
userInstance = null;
synchronized private static void clear() {
if (siteConfigInfoFile != null) {
siteConfigInfoFile.removeFileUpdatedObserver(siteConfigObserver);
siteConfigInfoFile = null;
}
_siteInstance = null;
if (userConfigInfoFile != null) {
userConfigInfoFile.removeFileUpdatedObserver(siteConfigObserver);
userConfigInfoFile = null;
}
_userInstance = null;
siteVisibilityMap.clear();
}
}

View file

@ -0,0 +1,159 @@
/**
* 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.collaboration.ui;
import java.util.Collections;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import com.raytheon.uf.viz.collaboration.comm.identity.info.SiteConfig;
import com.raytheon.uf.viz.collaboration.comm.identity.info.SiteConfig.ListEntry;
import com.raytheon.uf.viz.collaboration.comm.identity.info.SiteConfig.ListType;
/**
* Configuration that determines if the user should see messages from other
* sites
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Oct 9, 2014 3708 bclement Initial creation
*
* </pre>
*
* @author bclement
* @version 1.0
*/
public class SiteVisiblityConfig {
private final String actingSite;
private final Set<String> sites;
private final Map<String, ListEntry> userSpecificConfigs;
private final ListType listType;
/**
* @param config
* @param userSpecificConfigs
*/
public SiteVisiblityConfig(SiteConfig config,
Map<String, ListEntry> userSpecificConfigs) {
ListType lt = config.getListType();
if (lt == null) {
lt = ListType.WHITELIST;
}
this.listType = lt;
this.actingSite = config.getSite();
this.userSpecificConfigs = userSpecificConfigs;
ListEntry[] listEntries = config.getListEntries();
if (listEntries != null) {
this.sites = new HashSet<String>(listEntries.length);
for (ListEntry entry : listEntries) {
this.sites.add(entry.getValue());
}
} else {
this.sites = Collections.emptySet();
}
}
/**
* @param actingSite
* @param sites
* @param listType
* @param userSpecificConfigs
*/
public SiteVisiblityConfig(String actingSite, Set<String> sites,
ListType listType, Map<String, ListEntry> userSpecificConfigs) {
this.sites = sites;
this.listType = listType;
this.actingSite = actingSite;
this.userSpecificConfigs = userSpecificConfigs;
}
/**
* @param site
* @return true if messages from site should be shown to user
*/
public boolean isVisible(String site) {
ListEntry userSettings = userSpecificConfigs.get(site);
if (userSettings != null) {
return !userSettings.isRemoved();
} else {
if (isWhitelist()) {
return sites.contains(site);
} else {
return !sites.contains(site);
}
}
}
/**
* Allow messages from site to be seen
*
* @param site
*/
public void show(String site) {
userSpecificConfigs.put(site, new ListEntry(site, false));
}
/**
* Don't show messages from site
*
* @param site
*/
public void hide(String site) {
userSpecificConfigs.put(site, new ListEntry(site, true));
}
/**
* @return filter list for sites. see {@link #isWhitelist()}
*/
public String[] getSites() {
return sites.toArray(new String[0]);
}
/**
* @return true if filter list is a whitelist, false if it is a blacklist
*/
public boolean isWhitelist() {
return listType.equals(ListType.WHITELIST);
}
/**
* @return the actingSite
*/
public String getActingSite() {
return actingSite;
}
/**
* @return the userSpecificConfigs
*/
public Map<String, ListEntry> getUserSpecificConfigs() {
return userSpecificConfigs;
}
}

View file

@ -35,7 +35,7 @@ import com.raytheon.uf.viz.collaboration.comm.provider.connection.CollaborationC
import com.raytheon.uf.viz.collaboration.comm.provider.user.SharedGroup;
import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId;
import com.raytheon.uf.viz.collaboration.ui.data.CollaborationGroupContainer;
import com.raytheon.uf.viz.collaboration.ui.data.SessionGroupContainer;
import com.raytheon.uf.viz.collaboration.ui.data.TreeObjectContainer;
/**
* Provides access to contacts list tree
@ -51,6 +51,7 @@ import com.raytheon.uf.viz.collaboration.ui.data.SessionGroupContainer;
* Jan 24, 2014 2701 bclement removed local groups, added shared groups
* Jan 27, 2014 2700 bclement added support roster entries
* Apr 24, 2014 3070 bclement removed check for hasInteraction() from group entries
* Oct 08, 2014 3705 bclement replaced checks for SessionGroupContainer with TreeObjectContainer
*
* </pre>
*
@ -93,9 +94,9 @@ public class UsersTreeContentProvider implements ITreeContentProvider {
*/
@Override
public Object[] getElements(Object inputElement) {
if (inputElement instanceof SessionGroupContainer) {
SessionGroupContainer group = (SessionGroupContainer) inputElement;
return group.getObjects().toArray();
if (inputElement instanceof TreeObjectContainer) {
TreeObjectContainer cont = (TreeObjectContainer) inputElement;
return cont.getObjects();
} else if (inputElement instanceof CollaborationGroupContainer) {
CollaborationGroupContainer cont = (CollaborationGroupContainer) inputElement;
return cont.getObjects().toArray();
@ -115,9 +116,9 @@ public class UsersTreeContentProvider implements ITreeContentProvider {
public Object[] getChildren(Object parentElement) {
// the only things that can have children are the sessions item or the
// groups items
if (parentElement instanceof SessionGroupContainer) {
SessionGroupContainer cont = (SessionGroupContainer) parentElement;
return cont.getObjects().toArray();
if (parentElement instanceof TreeObjectContainer) {
TreeObjectContainer cont = (TreeObjectContainer) parentElement;
return cont.getObjects();
} else if (parentElement instanceof RosterGroup) {
RosterGroup group = (RosterGroup) parentElement;
return getRosterChildren(group.getEntries());
@ -177,9 +178,9 @@ public class UsersTreeContentProvider implements ITreeContentProvider {
} else if (element instanceof SharedGroup) {
SharedGroup group = (SharedGroup) element;
hasChildren = rosterHasChildren(group.getEntries());
} else if (element instanceof SessionGroupContainer) {
SessionGroupContainer cont = (SessionGroupContainer) element;
if (cont.getObjects() != null && cont.getObjects().size() > 0) {
} else if (element instanceof TreeObjectContainer) {
TreeObjectContainer cont = (TreeObjectContainer) element;
if (cont.getObjects() != null && cont.getObjects().length > 0) {
hasChildren = true;
} else {
hasChildren = false;

View file

@ -43,7 +43,8 @@ import com.raytheon.uf.viz.collaboration.comm.provider.user.ContactsManager;
import com.raytheon.uf.viz.collaboration.comm.provider.user.IDConverter;
import com.raytheon.uf.viz.collaboration.comm.provider.user.SharedGroup;
import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId;
import com.raytheon.uf.viz.collaboration.ui.data.SessionGroupContainer;
import com.raytheon.uf.viz.collaboration.comm.provider.user.VenueId;
import com.raytheon.uf.viz.collaboration.ui.data.TreeObjectContainer;
/**
* Provides contacts list UI elements with icons, text, tooltips, etc
@ -64,6 +65,7 @@ import com.raytheon.uf.viz.collaboration.ui.data.SessionGroupContainer;
* Feb 17, 2014 2751 bclement added block image logic to userLabelProvider
* Mar 06, 2014 2848 bclement get venueName directly from session
* Jun 12, 2014 3267 bclement fixed missing null-check for outdated UI info
* Oct 08, 2014 3705 bclement replaced checks for SessionGroupContainer with TreeObjectContainer
*
* </pre>
*
@ -164,9 +166,9 @@ public class UsersTreeLabelProvider extends ColumnLabelProvider {
key = "shared_group";
} else if (element instanceof IVenueSession) {
// key = "session_group";
} else if (element instanceof SessionGroupContainer) {
key = "session_group";
}
} else if (element instanceof TreeObjectContainer) {
key = ((TreeObjectContainer) element).getIcon();
}
if (imageMap.get(key) == null && !key.equals("")) {
imageMap.put(key, CollaborationUtils.getNodeImage(key));
@ -182,8 +184,8 @@ public class UsersTreeLabelProvider extends ColumnLabelProvider {
return ((SharedGroup) element).getName();
} else if (element instanceof RosterEntry) {
return userLabelProvider.getText((RosterEntry) element);
} else if (element instanceof SessionGroupContainer) {
return "Active Sessions";
} else if (element instanceof TreeObjectContainer) {
return ((TreeObjectContainer) element).getLabel();
} else if (element instanceof UserId) {
UserId user = (UserId) element;
String fullname = userLabelProvider.getText(element);
@ -201,6 +203,8 @@ public class UsersTreeLabelProvider extends ColumnLabelProvider {
return null;
}
return venue.getVenueName();
} else if (element instanceof VenueId) {
return ((VenueId) element).getName();
}
return null;
}
@ -208,7 +212,7 @@ public class UsersTreeLabelProvider extends ColumnLabelProvider {
@Override
public Font getFont(Object element) {
if (element instanceof RosterGroup || element instanceof SharedGroup
|| element instanceof SessionGroupContainer) {
|| element instanceof TreeObjectContainer) {
// for this case do nothing, as it is not the top level of
// session groups
if (boldFont == null) {

View file

@ -28,6 +28,8 @@ import org.jivesoftware.smack.RosterGroup;
import com.raytheon.uf.viz.collaboration.comm.identity.IVenueSession;
import com.raytheon.uf.viz.collaboration.comm.provider.user.SharedGroup;
import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId;
import com.raytheon.uf.viz.collaboration.comm.provider.user.VenueId;
import com.raytheon.uf.viz.collaboration.ui.data.PublicRoomContainer;
import com.raytheon.uf.viz.collaboration.ui.data.SessionGroupContainer;
/**
@ -42,6 +44,7 @@ import com.raytheon.uf.viz.collaboration.ui.data.SessionGroupContainer;
* Mar 1, 2012 rferrel Initial creation
* Dec 6, 2013 2561 bclement removed ECF
* Jan 24, 2014 2701 bclement removed local groups, added shared groups
* Oct 08, 2014 3705 bclement added public rooms (venue ids)
*
* </pre>
*
@ -74,6 +77,15 @@ public class UsersTreeViewerSorter extends ViewerSorter {
return 1;
}
/* bookmarked rooms next */
if (e1 instanceof PublicRoomContainer) {
if ((e2 instanceof PublicRoomContainer) == false) {
return -1;
}
} else if (e2 instanceof PublicRoomContainer) {
return 1;
}
// Groups before users.
if (e1 instanceof SharedGroup) {
if (!(e2 instanceof SharedGroup)) {
@ -129,6 +141,10 @@ public class UsersTreeViewerSorter extends ViewerSorter {
((RosterGroup) e2).getName());
}
if (e1 instanceof VenueId && e2 instanceof VenueId) {
return ((VenueId) e1).compareTo((VenueId) e2);
}
return 0;
}
}

View file

@ -0,0 +1,78 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.viz.collaboration.ui.actions;
import org.eclipse.jface.action.Action;
import com.raytheon.uf.viz.collaboration.comm.identity.CollaborationException;
import com.raytheon.uf.viz.collaboration.comm.provider.connection.CollaborationConnection;
import com.raytheon.uf.viz.collaboration.comm.provider.user.VenueId;
import com.raytheon.uf.viz.collaboration.ui.Activator;
/**
* Adds bookmarks for public chatrooms
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Oct 8, 2014 3705 bclement Initial creation
*
* </pre>
*
* @author bclement
* @version 1.0
*/
public class AddBookmarkAction extends Action {
private final VenueId[] rooms;
/**
*
*/
public AddBookmarkAction(VenueId... rooms) {
super("Add Bookmark");
this.rooms = rooms;
}
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.action.Action#run()
*/
@Override
public void run() {
CollaborationConnection connection = CollaborationConnection
.getConnection();
if (connection != null) {
for (VenueId room : rooms) {
try {
connection.bookmarkRoom(room);
} catch (CollaborationException e) {
Activator.statusHandler.error("Unable to bookmark room: "
+ room.getFQName(), e);
}
}
}
}
}

View file

@ -31,8 +31,8 @@ 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.collaboration.comm.identity.CollaborationException;
import com.raytheon.uf.viz.collaboration.comm.identity.info.SiteConfig;
import com.raytheon.uf.viz.collaboration.comm.identity.info.SiteConfigInformation;
import com.raytheon.uf.viz.collaboration.comm.identity.info.SiteConfigInformation.SiteConfig;
import com.raytheon.uf.viz.collaboration.comm.provider.connection.CollaborationConnection;
import com.raytheon.uf.viz.collaboration.ui.SiteConfigurationManager;
@ -46,6 +46,7 @@ import com.raytheon.uf.viz.collaboration.ui.SiteConfigurationManager;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jul 5, 2012 bsteffen Initial creation
* Oct 10, 2014 3708 bclement SiteConfigurationManager changes
*
* </pre>
*
@ -122,13 +123,11 @@ public class ChangeRoleAction extends Action {
}
private void fill() {
SiteConfigInformation siteInfo = SiteConfigurationManager
.getSiteConfigInformation();
Presence presence = CollaborationConnection.getConnection()
.getPresence();
String currentSite = (String) presence
.getProperty(SiteConfigInformation.SITE_NAME);
for (SiteConfig config : siteInfo.getConfig()) {
for (SiteConfig config : SiteConfigurationManager.getSiteConfigs()) {
if (config.getSite().equals(currentSite)) {
for (String role : config.getRoles()) {
Action action = new ChangeRoleAction(role);

View file

@ -31,11 +31,11 @@ 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.collaboration.comm.identity.CollaborationException;
import com.raytheon.uf.viz.collaboration.comm.identity.info.SiteConfig;
import com.raytheon.uf.viz.collaboration.comm.identity.info.SiteConfigInformation;
import com.raytheon.uf.viz.collaboration.comm.identity.info.SiteConfigInformation.SiteConfig;
import com.raytheon.uf.viz.collaboration.comm.provider.connection.CollaborationConnection;
import com.raytheon.uf.viz.collaboration.ui.SiteConfigurationManager;
import com.raytheon.uf.viz.collaboration.ui.session.SubscribeList;
import com.raytheon.uf.viz.collaboration.ui.session.SiteChangeEvent;
/**
* Change the site for the logged in user
@ -47,6 +47,7 @@ import com.raytheon.uf.viz.collaboration.ui.session.SubscribeList;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jul 5, 2012 bsteffen Initial creation
* Oct 10, 2014 3708 bclement added SiteChangeEvent
*
* </pre>
*
@ -91,11 +92,8 @@ public class ChangeSiteAction extends Action {
Presence presence = connection.getPresence();
presence.setProperty(SiteConfigInformation.SITE_NAME, site);
// now need to send the new subscribe list out to those who are
// listening for it
SubscribeList list = new SubscribeList();
list.setEnabledSites(SiteConfigurationManager.getSubscribeList(site));
connection.postEvent(list);
/* now need to send the new site out to those who are listening for it */
connection.postEvent(new SiteChangeEvent(site));
try {
connection.getAccountManager().sendPresence(presence);
@ -129,9 +127,7 @@ public class ChangeSiteAction extends Action {
}
private void fill() {
SiteConfigInformation siteInfo = SiteConfigurationManager
.getSiteConfigInformation();
for (SiteConfig config : siteInfo.getConfig()) {
for (SiteConfig config : SiteConfigurationManager.getSiteConfigs()) {
Action action = new ChangeSiteAction(config.getSite());
IContributionItem contrib = new ActionContributionItem(action);
contrib.fill(menu, -1);

View file

@ -71,6 +71,7 @@ import com.raytheon.viz.ui.views.CaveWorkbenchPageManager;
* Apr 10, 2014 2937 bgonzale Connect to the venue after the feed view is available
* to display messages.
* Jun 16, 2014 3288 bclement feed venue configuration changes
* Oct 08, 2014 3705 bclement moved venue joining code to CollaborationConnection
*
* </pre>
*
@ -133,14 +134,11 @@ public class DisplayFeedAction extends Action {
String defaultHandle = HandleUtil.getDefaultHandle();
FeedVenueConfig config = FeedVenueConfigManager.getConfig();
VenueId venueId = createVenueId(config);
VenueSession session = connection.createTextOnlyVenue(venueId,
defaultHandle);
try {
session.configureVenue();
connection.postEvent(session);
VenueSession session = connection.joinTextOnlyVenue(venueId,
defaultHandle);
return session;
} catch (CollaborationException e) {
connection.removeSession(session);
final String msg = e.getLocalizedMessage()
+ "\n\nDefault handle options can be set in the Collaboration Preferences page.";
VizApp.runAsync(new Runnable() {

View file

@ -0,0 +1,136 @@
/**
* 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.collaboration.ui.actions;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.dialogs.InputDialog;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.window.Window;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.PartInitException;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.viz.collaboration.comm.identity.CollaborationException;
import com.raytheon.uf.viz.collaboration.comm.identity.IVenueSession;
import com.raytheon.uf.viz.collaboration.comm.provider.connection.CollaborationConnection;
import com.raytheon.uf.viz.collaboration.comm.provider.session.VenueSession;
import com.raytheon.uf.viz.collaboration.comm.provider.user.VenueId;
import com.raytheon.uf.viz.collaboration.ui.prefs.HandleUtil;
import com.raytheon.uf.viz.collaboration.ui.session.SessionView;
import com.raytheon.viz.ui.views.CaveWorkbenchPageManager;
/**
* Action for joining a public chat room on server
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Oct 8, 2014 3705 bclement Initial creation
*
* </pre>
*
* @author bclement
* @version 1.0
*/
public class JoinRoomAction extends Action {
private static final IUFStatusHandler log = UFStatus
.getHandler(JoinRoomAction.class);
private final boolean promptForHandle;
private final VenueId room;
/**
*
*/
public JoinRoomAction(VenueId room, boolean promptForHandle) {
super(promptForHandle ? "Join with Custom Handle"
: "Join with Default Handle");
this.promptForHandle = promptForHandle;
this.room = room;
}
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.action.Action#run()
*/
@Override
public void run() {
CollaborationConnection connection = CollaborationConnection
.getConnection();
IVenueSession joinedVenueSession = connection
.getJoinedVenueSession(room);
if (joinedVenueSession != null) {
openExistingSession(joinedVenueSession);
return;
}
String handle = HandleUtil.getDefaultHandle();
if (promptForHandle) {
Shell shell = new Shell(Display.getCurrent());
InputDialog dlg = new InputDialog(shell, "Join Room",
"Enter handle for room: " + room.getName(), handle, null);
if (dlg.open() == Window.OK) {
handle = dlg.getValue();
} else {
/* user cancelled the dialog, abort joining the room */
return;
}
}
if (connection != null) {
try {
VenueSession session = connection.joinTextOnlyVenue(room,
handle);
CaveWorkbenchPageManager page = CaveWorkbenchPageManager
.getActiveInstance();
page.showView(SessionView.ID, session.getSessionId(),
IWorkbenchPage.VIEW_ACTIVATE);
session.connectToRoom();
} catch (CollaborationException | PartInitException e) {
log.error("Unable to join room " + room.getFQName(), e);
}
}
}
private void openExistingSession(IVenueSession session) {
if (promptForHandle) {
Shell shell = new Shell(Display.getCurrent());
/* we are already in the room, prompt user before continuing */
if (!MessageDialog.openQuestion(shell, "Already In Room",
"Already joined to room '" + room.getName()
+ "' with handle '"
+ session.getUserID().getHandle()
+ "'. Open Session?")) {
/* user aborted */
return;
}
}
new ShowVenueAction(session).run();
}
}

View file

@ -0,0 +1,79 @@
/**
* 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.collaboration.ui.actions;
import org.eclipse.jface.action.Action;
import com.raytheon.uf.viz.collaboration.comm.identity.CollaborationException;
import com.raytheon.uf.viz.collaboration.comm.provider.connection.CollaborationConnection;
import com.raytheon.uf.viz.collaboration.comm.provider.user.VenueId;
import com.raytheon.uf.viz.collaboration.ui.Activator;
/**
* Remove bookmark for public chat room on server
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Oct 8, 2014 3705 bclement Initial creation
*
* </pre>
*
* @author bclement
* @version 1.0
*/
public class RemoveBookmarkAction extends Action {
private final VenueId[] rooms;
/**
*
*/
public RemoveBookmarkAction(VenueId... rooms) {
super("Remove Bookmark");
this.rooms = rooms;
}
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.action.Action#run()
*/
@Override
public void run() {
CollaborationConnection connection = CollaborationConnection
.getConnection();
if (connection != null) {
for (VenueId room : rooms) {
try {
connection.removeBookmark(room);
} catch (CollaborationException e) {
Activator.statusHandler.error(
"Unable to remove bookmark for room: "
+ room.getFQName(), e);
}
}
}
}
}

View file

@ -39,6 +39,7 @@ import com.raytheon.uf.viz.collaboration.comm.provider.user.ContactsManager;
* Apr 23, 2012 mnash Initial creation
* Dec 20, 2013 2563 bclement added items from server roster not in groups
* Jan 24, 2014 2701 bclement removed local groups, added shared groups
* Oct 08, 2014 3705 bclement added public room group
*
* </pre>
*
@ -48,7 +49,9 @@ import com.raytheon.uf.viz.collaboration.comm.provider.user.ContactsManager;
public class CollaborationGroupContainer {
private SessionGroupContainer sessionGroup = new SessionGroupContainer();
private final SessionGroupContainer sessionGroup = new SessionGroupContainer();
private final PublicRoomContainer publicRoomGroup = new PublicRoomContainer();
public CollaborationGroupContainer() {
}
@ -67,6 +70,7 @@ public class CollaborationGroupContainer {
List<Object> result = new ArrayList<Object>();
result.add(connection.getUser());
result.add(sessionGroup);
result.add(publicRoomGroup);
ContactsManager contactsManager = connection.getContactsManager();
result.addAll(contactsManager.getSharedGroups());
result.addAll(contactsManager.getGroups());
@ -83,4 +87,11 @@ public class CollaborationGroupContainer {
return sessionGroup;
}
/**
* @return the publicRoomGroup
*/
public PublicRoomContainer getPublicRoomGroup() {
return publicRoomGroup;
}
}

View file

@ -0,0 +1,68 @@
/**
* 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.collaboration.ui.data;
import java.util.Collection;
import java.util.Collections;
import com.raytheon.uf.viz.collaboration.comm.identity.CollaborationException;
import com.raytheon.uf.viz.collaboration.comm.provider.connection.CollaborationConnection;
import com.raytheon.uf.viz.collaboration.comm.provider.user.VenueId;
import com.raytheon.uf.viz.collaboration.ui.Activator;
/**
* Contributes bookmarked public rooms to the group view
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Oct 8, 2014 3705 bclement Initial creation
*
* </pre>
*
* @author bclement
* @version 1.0
*/
public class PublicRoomContainer extends TreeObjectContainer {
public PublicRoomContainer() {
super("Bookmarked Rooms", "session_group");
}
public Object[] getObjects() {
CollaborationConnection connection = CollaborationConnection
.getConnection();
if (connection == null) {
return new Object[0];
}
Collection<VenueId> bookmarkedRooms;
try {
bookmarkedRooms = connection.getBookmarkedRooms();
} catch (CollaborationException e) {
Activator.statusHandler.error(
"Unable to get bookmarked rooms from server", e);
bookmarkedRooms = Collections.emptyList();
}
return bookmarkedRooms.toArray(new Object[0]);
}
}

View file

@ -21,7 +21,6 @@ package com.raytheon.uf.viz.collaboration.ui.data;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import com.raytheon.uf.viz.collaboration.comm.identity.ISession;
@ -39,19 +38,24 @@ import com.raytheon.uf.viz.collaboration.comm.provider.connection.CollaborationC
* ------------ ---------- ----------- --------------------------
* Mar 6, 2012 rferrel Initial creation
* Jan 28, 2014 2698 bclement removed venue info
* Oct 08, 2014 3705 bclement extends TreeObjectContainer
*
* </pre>
*
* @author rferrel
* @version 1.0
*/
public class SessionGroupContainer {
public class SessionGroupContainer extends TreeObjectContainer {
public List<Object> getObjects() {
public SessionGroupContainer() {
super("Active Sessions", "session_group");
}
public Object[] getObjects() {
CollaborationConnection connection = CollaborationConnection
.getConnection();
if (connection == null) {
return Collections.emptyList();
return new Object[0];
}
Collection<ISession> sessions = connection.getSessions();
List<Object> result = new ArrayList<Object>();
@ -60,7 +64,7 @@ public class SessionGroupContainer {
result.add(session);
}
}
return result;
return result.toArray();
}
}

View file

@ -0,0 +1,66 @@
/**
* 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.collaboration.ui.data;
/**
* Base class for containers that contribute groups to the collaboration group
* view
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Oct 8, 2014 3705 bclement Initial creation
*
* </pre>
*
* @author bclement
* @version 1.0
*/
public abstract class TreeObjectContainer {
private final String label;
private final String icon;
public TreeObjectContainer(String label, String icon) {
this.label = label;
this.icon = icon;
}
public abstract Object[] getObjects();
/**
* @return the label
*/
public String getLabel() {
return label;
}
/**
* @return the icon
*/
public String getIcon() {
return icon;
}
}

View file

@ -20,6 +20,7 @@
package com.raytheon.uf.viz.collaboration.ui.login;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
@ -45,12 +46,11 @@ import org.jivesoftware.smack.packet.Presence;
import org.jivesoftware.smack.packet.Presence.Mode;
import org.jivesoftware.smack.packet.Presence.Type;
import com.google.common.collect.Iterators;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.viz.collaboration.comm.identity.CollaborationException;
import com.raytheon.uf.viz.collaboration.comm.identity.info.HostConfig;
import com.raytheon.uf.viz.collaboration.comm.identity.info.SiteConfig;
import com.raytheon.uf.viz.collaboration.comm.identity.info.SiteConfigInformation;
import com.raytheon.uf.viz.collaboration.comm.identity.info.SiteConfigInformation.HostConfig;
import com.raytheon.uf.viz.collaboration.comm.identity.info.SiteConfigInformation.SiteConfig;
import com.raytheon.uf.viz.collaboration.comm.provider.Tools;
import com.raytheon.uf.viz.collaboration.comm.provider.connection.CollaborationConnection;
import com.raytheon.uf.viz.collaboration.comm.provider.connection.CollaborationConnectionData;
@ -79,6 +79,7 @@ import com.raytheon.uf.viz.collaboration.ui.prefs.CollabPrefConstants;
* Apr 11, 2014 2903 bclement added success flag, moved login logic to static method
* fixed populating server with previous, removed password from heap
* Apr 23, 2014 2822 bclement added version to initial presence
* Oct 10, 2014 3708 bclement SiteConfigurationManager changes
*
* </pre>
*
@ -171,19 +172,13 @@ public class LoginDialog extends Dialog {
serverText.setLayoutData(gd);
// retrieve the servers
SiteConfigInformation information = SiteConfigurationManager
.getSiteConfigInformation();
List<HostConfig> siteServers = information.getServer();
if (siteServers == null) {
siteServers = new ArrayList<SiteConfigInformation.HostConfig>(0);
}
List<HostConfig> userServers = SiteConfigurationManager
.getUserHostConfig();
Collection<HostConfig> servers = SiteConfigurationManager
.getHostConfigs();
// put configured as true so we don't disable the login button
serverText.setData("configured", true);
String[] names = new String[siteServers.size() + userServers.size()];
Iterator<HostConfig> iter = Iterators.concat(siteServers.iterator(),
userServers.iterator());
String[] names = new String[servers.size()];
Iterator<HostConfig> iter = servers.iterator();
int index = 0;
String prevServer = loginData.getServer();
for (int i = 0; iter.hasNext() && i < names.length; i++) {
@ -264,11 +259,11 @@ public class LoginDialog extends Dialog {
comp.setLayoutData(gd);
// TODO: Default to previous settings
SiteConfigInformation information = SiteConfigurationManager
.getSiteConfigInformation();
Collection<SiteConfig> configs = SiteConfigurationManager
.getSiteConfigs();
List<String> sites = new ArrayList<String>();
final Map<String, String[]> roles = new HashMap<String, String[]>();
for (SiteConfig conf : information.getConfig()) {
for (SiteConfig conf : configs) {
sites.add(conf.getSite());
roles.put(conf.getSite(), conf.getRoles());
}
@ -387,7 +382,6 @@ public class LoginDialog extends Dialog {
cancelButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
SiteConfigurationManager.nullifySiteConfigInstance();
shell.dispose();
}
});

View file

@ -20,8 +20,8 @@
package com.raytheon.uf.viz.collaboration.ui.login;
import java.util.Arrays;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import org.eclipse.jface.window.Window;
import org.eclipse.swt.widgets.Button;
@ -31,7 +31,7 @@ import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Shell;
import com.raytheon.uf.viz.collaboration.comm.identity.info.SiteConfigInformation.HostConfig;
import com.raytheon.uf.viz.collaboration.comm.identity.info.HostConfig;
import com.raytheon.uf.viz.collaboration.ui.SiteConfigurationManager;
/**
@ -49,6 +49,7 @@ import com.raytheon.uf.viz.collaboration.ui.SiteConfigurationManager;
* Jan 07, 2014 2563 bclement updated default xmpp port
* Jan 08, 2014 2563 bclement renamed from ServerInput to ServerListListener
* moved input responsibility to ServerInputDialog
* Oct 10, 2014 3708 bclement SiteConfigurationManager changes
*
* </pre>
*
@ -115,11 +116,10 @@ public class ServerListListener implements Listener {
*/
private void remove() {
Shell shell = Display.getCurrent().getActiveShell();
List<HostConfig> userHosts = SiteConfigurationManager
.getUserHostConfig();
if (!userHosts.isEmpty()) {
String[] options = new String[userHosts.size()];
Iterator<HostConfig> iter = userHosts.iterator();
Collection<HostConfig> hosts = SiteConfigurationManager.getHostConfigs();
if (!hosts.isEmpty()) {
String[] options = new String[hosts.size()];
Iterator<HostConfig> iter = hosts.iterator();
for (int i = 0; iter.hasNext() && i < options.length; ++i) {
options[i] = iter.next().toString();
}

View file

@ -45,6 +45,7 @@ import com.raytheon.uf.viz.collaboration.ui.prefs.CollabPrefConstants.HandleOpti
* Jan 14, 2014 2630 bclement added away on idle
* Jan 27, 2014 2700 bclement added auto accept subscribe
* Feb 3, 2014 2699 bclement added handle preferences
* Oct 9, 2014 3711 mapeters added chat lines preferences
*
* </pre>
*
@ -83,9 +84,15 @@ public class CollaborationPreferencePage extends FieldEditorPreferencePage
*/
@Override
protected void createFieldEditors() {
FieldEditor chatLines = new BooleanFieldEditor("chatLines",
"Display Chat Messages On Separate Line From Time And Name",
getFieldEditorParent());
this.addField(chatLines);
FieldEditor notifications = new BooleanFieldEditor("notifications",
"Show Notifications", getFieldEditorParent());
"Show Chat Notification Popups", getFieldEditorParent());
this.addField(notifications);
FieldEditor autojoinColl = new BooleanFieldEditor(
CollabPrefConstants.AUTO_JOIN, "Join Discussion On Login",
getFieldEditorParent());

View file

@ -93,6 +93,7 @@ import com.raytheon.viz.ui.views.CaveFloatingView;
* Mar 11, 2014 #2865 lvenable Added null checks for msgArchive.
* Jun 20, 2014 3281 bclement made sendErrorMessage() public
* Jun 27, 2014 3323 bclement fixed disposed font issue
* Oct 09, 2014 3711 mapeters Display chat text in accordance with preferences.
* </pre>
*
* @author rferrel
@ -358,8 +359,11 @@ public abstract class AbstractSessionView<T extends IUser> extends
sb.append("(").append(time).append(") ");
int offset = sb.length();
sb.append(name).append(": ").append(body);
boolean newLine = Activator.getDefault()
.getPreferenceStore().getBoolean("chatLines");
String displayPreference = newLine ? ("\n ") : (": ");
sb.append(name).append(displayPreference).append(body);
// here is the place to put the font and color changes for
// keywords
// read in localization file once and then don't read in again,

View file

@ -20,7 +20,6 @@
package com.raytheon.uf.viz.collaboration.ui.session;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.eclipse.swt.SWT;
@ -40,6 +39,7 @@ import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId;
import com.raytheon.uf.viz.collaboration.comm.provider.user.VenueParticipant;
import com.raytheon.uf.viz.collaboration.display.data.SessionColorManager;
import com.raytheon.uf.viz.collaboration.ui.AbstractUserLabelProvider;
import com.raytheon.uf.viz.collaboration.ui.SiteConfigurationManager;
/**
* Generate the Participant's label and icon image.
@ -57,6 +57,7 @@ import com.raytheon.uf.viz.collaboration.ui.AbstractUserLabelProvider;
* Feb 13, 2014 2751 bclement VenueParticipant refactor
* Feb 13, 2014 2751 njensen Added leader icons
* Feb 18, 2014 2751 bclement changed tooltip from JID to UserId
* Oct 10, 2014 3708 bclement SiteConfigurationManager changes, added actingSite
*
* </pre>
*
@ -69,7 +70,7 @@ public class ParticipantsLabelProvider extends
protected String sessionId = null;
private List<String> enabledSites;
private String actingSite;
protected Map<RGB, Color> colors = new HashMap<RGB, Color>();
@ -220,8 +221,13 @@ public class ParticipantsLabelProvider extends
if (presence != null) {
String site = String.valueOf(presence
.getProperty(SiteConfigInformation.SITE_NAME));
if (enabledSites != null && enabledSites.contains(site)) {
builder.append("\n").append("Subscribed");
if (actingSite != null
&& SiteConfigurationManager.isVisible(actingSite, site)) {
builder.append("\n").append(
"Messages from " + site + " are shown");
} else {
builder.append("\n").append(
"Messages from " + site + " are hidden");
}
}
if (isSomeKindOfLeader(user)) {
@ -235,8 +241,11 @@ public class ParticipantsLabelProvider extends
return builder.toString();
}
protected void setEnabledSites(List<String> enabledSites) {
this.enabledSites = enabledSites;
/**
* @param actingSite
*/
public void setActingSite(String actingSite) {
this.actingSite = actingSite;
}
/**

View file

@ -44,6 +44,7 @@ import com.raytheon.uf.viz.collaboration.comm.identity.info.SiteConfigInformatio
import com.raytheon.uf.viz.collaboration.comm.provider.connection.CollaborationConnection;
import com.raytheon.uf.viz.collaboration.comm.provider.user.VenueParticipant;
import com.raytheon.uf.viz.collaboration.ui.Activator;
import com.raytheon.uf.viz.collaboration.ui.SiteColorConfigManager;
import com.raytheon.uf.viz.collaboration.ui.SiteColorInformation;
import com.raytheon.uf.viz.collaboration.ui.SiteColorInformation.SiteColor;
import com.raytheon.uf.viz.collaboration.ui.SiteConfigurationManager;
@ -75,6 +76,7 @@ import com.raytheon.uf.viz.core.icon.IconUtil;
* Mar 25, 2014 2938 mpduff Show status message for site and role changes.
* Apr 01, 2014 2938 mpduff Update logic for site and role changes.
* Apr 22, 2014 3038 bclement added initialized flag to differentiate between roster population and new joins
* Oct 10, 2014 3708 bclement SiteConfigurationManager refactor
*
* </pre>
*
@ -94,16 +96,14 @@ public class SessionFeedView extends SessionView {
private Action userRemoveSiteAction;
private List<String> enabledSites;
private final List<String> userEnabledSites;
private List<SiteColor> colors;
private String actingSite;
/**
* Set of users logged in.
*/
private final ConcurrentHashMap<String, Presence> enabledUsers = new ConcurrentHashMap<String, Presence>();
private final ConcurrentHashMap<String, Presence> otherParticipants = new ConcurrentHashMap<String, Presence>();
private volatile boolean initialized = false;
@ -112,11 +112,9 @@ public class SessionFeedView extends SessionView {
*/
public SessionFeedView() {
super();
String actingSite = CollaborationConnection.getConnection()
actingSite = CollaborationConnection.getConnection()
.getPresence().getProperty(SiteConfigInformation.SITE_NAME)
.toString();
enabledSites = SiteConfigurationManager.getSubscribeList(actingSite);
userEnabledSites = SiteConfigurationManager.getUserSubscribeList();
}
/*
@ -129,7 +127,7 @@ public class SessionFeedView extends SessionView {
@Override
protected void initComponents(Composite parent) {
super.initComponents(parent);
colors = SiteConfigurationManager.getSiteColors();
colors = SiteColorConfigManager.getSiteColors();
if (colors != null) {
for (VenueParticipant user : session.getVenue().getParticipants()) {
setColorForSite(user);
@ -141,8 +139,8 @@ public class SessionFeedView extends SessionView {
}
@Subscribe
public void refreshBlockList(SubscribeList list) {
enabledSites = list.getEnabledSites();
public void refreshBlockList(SiteChangeEvent event) {
this.actingSite = event.getNewSite();
}
/*
@ -209,17 +207,19 @@ public class SessionFeedView extends SessionView {
}
});
userAddSiteAction = new Action("Subscribe") {
userAddSiteAction = new Action("Show Messages from Site") {
@Override
public void run() {
userEnabledSites.add(getSelectedSite());
SiteConfigurationManager
.showSite(actingSite, getSelectedSite());
};
};
userRemoveSiteAction = new Action("Unsubscribe") {
userRemoveSiteAction = new Action("Hide Messages from Site") {
@Override
public void run() {
userEnabledSites.remove(getSelectedSite());
SiteConfigurationManager
.hideSite(actingSite, getSelectedSite());
}
};
@ -240,13 +240,12 @@ public class SessionFeedView extends SessionView {
super.fillContextMenu(manager);
manager.add(colorChangeAction);
String site = getSelectedSite();
if (userEnabledSites.contains(site) == false
&& enabledSites.contains(site) == false) {
userAddSiteAction.setText("Subscribe to " + getSelectedSite());
if (!SiteConfigurationManager.isVisible(actingSite, site)) {
userAddSiteAction
.setText("Show Messages from " + getSelectedSite());
manager.add(userAddSiteAction);
} else if (enabledSites.contains(site) == false
&& userEnabledSites.contains(site)) {
userRemoveSiteAction.setText("Unsubscribe from "
} else {
userRemoveSiteAction.setText("Hide Messages from "
+ getSelectedSite());
manager.add(userRemoveSiteAction);
}
@ -262,7 +261,7 @@ public class SessionFeedView extends SessionView {
@Override
protected void setParticipantValues(ParticipantsLabelProvider labelProvider) {
super.setParticipantValues(labelProvider);
labelProvider.setEnabledSites(enabledSites);
labelProvider.setActingSite(actingSite);
}
/*
@ -293,8 +292,9 @@ public class SessionFeedView extends SessionView {
}
// should we append?
if (site == null || enabledSites.contains(site)
|| userEnabledSites.contains(site)) {
if (site == null
|| SiteConfigurationManager
.isVisible(actingSite, site.toString())) {
appendMessage(msg);
}
}
@ -433,10 +433,9 @@ public class SessionFeedView extends SessionView {
String siteName = getSiteName(presence);
// only show sites you care about
if (enabledSites.contains(siteName)
|| userEnabledSites.contains(siteName)) {
if (SiteConfigurationManager.isVisible(actingSite, siteName)) {
String user = participant.getName();
Presence prev = enabledUsers.get(user);
Presence prev = otherParticipants.get(user);
String roleName = getRoleName(presence);
if (presence.isAvailable()) {
@ -447,7 +446,7 @@ public class SessionFeedView extends SessionView {
sendSystemMessage(message);
}
enabledUsers.put(user, presence);
otherParticipants.put(user, presence);
}
}
@ -536,7 +535,7 @@ public class SessionFeedView extends SessionView {
@Override
protected void participantDeparted(VenueParticipant participant,
String description) {
if (enabledUsers.remove(participant.getName()) != null) {
if (otherParticipants.remove(participant.getName()) != null) {
super.participantDeparted(participant, description);
}
}
@ -551,11 +550,7 @@ public class SessionFeedView extends SessionView {
super.dispose();
SiteColorInformation information = new SiteColorInformation();
information.setColors(this.colors);
SiteConfigurationManager.writeSiteColorInformation(information);
// write out the user enabled sites information to a file
String[] sites = userEnabledSites.toArray(new String[userEnabledSites
.size()]);
SiteConfigurationManager.writeUserEnabledSites(sites);
// TODO should color config be written more often?
SiteColorConfigManager.writeSiteColorInformation(information);
}
}

View file

@ -19,13 +19,8 @@
**/
package com.raytheon.uf.viz.collaboration.ui.session;
import java.util.List;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
/**
* TODO Add Description
* Event fired when the user changes the acting site
*
* <pre>
*
@ -33,30 +28,29 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jun 7, 2012 mnash Initial creation
* Oct 9, 2014 3708 bclement Initial creation
*
* </pre>
*
* @author mnash
* @author bclement
* @version 1.0
*/
@DynamicSerialize
public class SubscribeList {
@DynamicSerializeElement
private List<String> enabledSites;
public class SiteChangeEvent {
private final String newSite;
/**
* @return the enabledUsers
*
*/
public List<String> getEnabledSites() {
return enabledSites;
public SiteChangeEvent(String newSite) {
this.newSite = newSite;
}
/**
* @param enabledUsers
* the enabledUsers to set
* @return the newSite
*/
public void setEnabledSites(List<String> enabledSites) {
this.enabledSites = enabledSites;
public String getNewSite() {
return newSite;
}
}

View file

@ -102,7 +102,7 @@ import de.micromata.opengis.kml.v_2_2_0.Vec2;
* ------------- -------- ----------- --------------------------
* Jun0 6, 2012 bsteffen Initial creation
* Jan 23, 2014 2703 bsteffen Use framesInfo for frame count.
*
* Oct 06, 2014 3686 njensen Ensure lastIndex is at least 1
*
* </pre>
*
@ -305,6 +305,8 @@ public class KmlExportJob extends Job {
int lastIndex = options.getLastFrameIndex();
lastIndex = Math.min(lastIndex, descriptor.getFramesInfo()
.getFrameCount());
// in case there's zero frames (i.e. all time agnostic)
lastIndex = Math.max(lastIndex, 1);
rscmonitor.beginTask("Saving " + rsc.getName(), lastIndex
- startIndex);
DataTime[] times = descriptor.getFramesInfo().getTimeMap()
@ -321,6 +323,7 @@ public class KmlExportJob extends Job {
}
}
}
List<DataTime> pastFrames = new ArrayList<DataTime>();
for (int i = startIndex; i < lastIndex; i += 1) {
descriptor.setFramesInfo(new FramesInfo(i));

View file

@ -40,6 +40,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
* Jul 14 2010 6567 zhao Launch AreaConfigDlg w/o monitor
* Nov.27, 2012 1297 skorolev Cleanup code for non-blocking dialog.
* May 08, 2014 3086 skorolev Added CloseCallback to dialog.
* Sep 16, 2014 2757 skorolev Added test of dialog on dispose.
* Sep 19, 2014 3220 skorolev Added check on dispose.
*
* </pre>

View file

@ -48,6 +48,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
* Apr 23, 2014 3054 skorolev Fixed issue with removing a new station from list.
* Apr 28, 2014 3086 skorolev Updated getConfigManager.
* Sep 04, 2014 3220 skorolev Added fireConfigUpdateEvent method. Updated handler.
* Sep 19, 2014 2757 skorolev Updated handlers for dialog buttons.
*
*
* </pre>
@ -61,7 +62,7 @@ public class FogMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
private FogMonDispThreshDlg fogMonitorDlg;
/**
* Constructor
* Constructor.
*
* @param parent
* @param title
@ -79,7 +80,6 @@ public class FogMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
*/
@Override
protected void handleOkBtnSelection() {
// Check for changes in the data
if (dataIsChanged()) {
int choice = showMessage(shell, SWT.OK | SWT.CANCEL,
"Fog Monitor Confirm Changes",
@ -89,13 +89,14 @@ public class FogMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
getValues();
resetStatus();
configMgr.saveConfigXml();
configMgr.saveAdjacentAreaConfigXml();
/**
* DR#11279: re-initialize threshold manager and the monitor
* using new monitor area configuration
*/
FogThresholdMgr.reInitialize();
fireConfigUpdateEvent();
if ((!configMgr.getAddedZones().isEmpty())
|| (!configMgr.getAddedStations().isEmpty())) {
if (editDialog() == SWT.YES) {
@ -119,7 +120,7 @@ public class FogMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
}
}
}
if (fogMonitorDlg == null || fogMonitorDlg.isDisposed()) {
if ((fogMonitorDlg == null) || fogMonitorDlg.isDisposed()) {
setReturnValue(true);
close();
}
@ -147,12 +148,13 @@ public class FogMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
* com.raytheon.uf.viz.monitor.ui.dialogs.MonitoringAreaConfigDlg#getInstance
* ()
*/
@Override
protected FSSObsMonitorConfigurationManager getInstance() {
if (configMgr == null) {
configMgr = new FSSObsMonitorConfigurationManager(
MonName.fog.name());
}
return (FSSObsMonitorConfigurationManager) configMgr;
return configMgr;
}
/*

View file

@ -40,6 +40,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
* March 5, 2012 14413 zhao Launch AreaConfigDlg w/o monitor
* Nov.27, 2012 1297 skorolev Cleanup code for non-blocking dialog.
* May 08, 2014 3086 skorolev Added CloseCallback to dialog.
* Sep 16, 2014 2757 skorolev Added test of dialog on dispose.
* Sep 19, 2014 3220 skorolev Added check on dispose.
*
* </pre>

View file

@ -37,6 +37,22 @@ import com.raytheon.uf.viz.monitor.util.MonitorConfigConstants.SafeSeasMonitor;
import com.raytheon.uf.viz.monitor.xml.AreaXML;
import com.raytheon.uf.viz.monitor.xml.ThresholdsXML;
/**
* SAFESEAS Monitor Meteo Table.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Sep 17, 2014 2757 skorolev Removed unnecessary printouts.
*
* </pre>
*
* @author skorolev
* @version 1.0
*/
public class SSMonitorMeteoTab extends TabItemComp implements IUpdateMonitorMeteo
{
private SSMonitorMeteoEditDlg monitorMeteoEditDlg;
@ -191,9 +207,6 @@ public class SSMonitorMeteoTab extends TabItemComp implements IUpdateMonitorMete
ssmmd.setWindSpeedR(sstm.getThresholdValue(duKey, threshKeyR, areaID, xmlKey));
ssmmd.setWindSpeedY(sstm.getThresholdValue(duKey, threshKeyY, areaID, xmlKey));
System.out.println("=== " + sstm.getThresholdValue(duKey, threshKeyR, areaID, xmlKey));
System.out.println("=== " + sstm.getThresholdValue(duKey, threshKeyY, areaID, xmlKey));
/*
* Peak Wind
*/

View file

@ -48,6 +48,8 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
* Apr 23, 2014 3054 skorolev Fixed issue with removing a new station from list.
* Apr 28, 2014 3086 skorolev Updated getConfigManager.
* Sep 04, 2014 3220 skorolev Added fireConfigUpdateEvent method. Updated handler.
* Sep 19, 2014 2757 skorolev Updated handlers for dialog buttons.
*
*
* </pre>
*
@ -70,15 +72,8 @@ public class SSMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
SafeSeasMonitor.getInstance();
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.monitor.ui.dialogs.MonitoringAreaConfigDlg#
* handleOkBtnSelection()
*/
@Override
protected void handleOkBtnSelection() {
// Check for changes in the data
if (dataIsChanged()) {
int choice = showMessage(shell, SWT.OK | SWT.CANCEL,
"SAFESEAS Monitor Confirm Changes",
@ -88,6 +83,8 @@ public class SSMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
getValues();
resetStatus();
configMgr.saveConfigXml();
configMgr.saveAdjacentAreaConfigXml();
SSThresholdMgr.reInitialize();
fireConfigUpdateEvent();
@ -115,7 +112,7 @@ public class SSMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
}
}
}
if (ssMonitorDlg == null || ssMonitorDlg.isDisposed()) {
if ((ssMonitorDlg == null) || ssMonitorDlg.isDisposed()) {
setReturnValue(true);
close();
}
@ -143,11 +140,12 @@ public class SSMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
* com.raytheon.uf.viz.monitor.ui.dialogs.MonitoringAreaConfigDlg#getInstance
* ()
*/
@Override
public FSSObsMonitorConfigurationManager getInstance() {
if (configMgr == null) {
configMgr = new FSSObsMonitorConfigurationManager(MonName.ss.name());
}
return (FSSObsMonitorConfigurationManager) configMgr;
return configMgr;
}
/*

View file

@ -40,6 +40,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
* March 5, 2012 14413 zhao Launch AreaConfigDlg w/o monitor
* Nov.27, 2012 1297 skorolev Cleanup code for non-blocking dialog.
* May 08, 2014 3086 skorolev Added CloseCallback to dialog.
* Sep 16, 2014 2757 skorolev Added test of dialog on dispose.
* Sep 19, 2014 3220 skorolev Added check on dispose.
*
* </pre>

View file

@ -48,7 +48,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
* Apr 23, 2014 3054 skorolev Fixed issue with removing a new station from list.
* Apr 28, 2014 3086 skorolev Updated snowConfigManager.
* Sep 04, 2014 3220 skorolev Added fireConfigUpdateEvent method. Updated handler.
*
* Sep 19, 2014 2757 skorolev Updated handlers for dialog buttons.
* </pre>
*
* @author mpduff
@ -74,11 +74,10 @@ public class SnowMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.monitor.ui.dialogs.MonitoringAreaConfigDlg#
* handleOkBtnSelection()
* handleApplyBtnSelection()
*/
@Override
protected void handleOkBtnSelection() {
// Check for changes in the data\
if (dataIsChanged()) {
int choice = showMessage(shell, SWT.OK | SWT.CANCEL,
"SNOW Monitor Confirm Changes",
@ -88,13 +87,14 @@ public class SnowMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
getValues();
resetStatus();
configMgr.saveConfigXml();
configMgr.saveAdjacentAreaConfigXml();
SnowThresholdMgr.reInitialize();
fireConfigUpdateEvent();
if ((!configMgr.getAddedZones().isEmpty())
|| (!configMgr.getAddedStations().isEmpty())) {
if (editDialog() == SWT.YES) {
if (snowMonitorDlg == null
if ((snowMonitorDlg == null)
|| snowMonitorDlg.isDisposed()) {
snowMonitorDlg = new SnowMonDispThreshDlg(shell,
CommonConfig.AppName.SNOW,
@ -119,7 +119,7 @@ public class SnowMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
}
}
}
if (snowMonitorDlg == null || snowMonitorDlg.isDisposed()) {
if ((snowMonitorDlg == null) || snowMonitorDlg.isDisposed()) {
setReturnValue(true);
close();
}
@ -138,7 +138,7 @@ public class SnowMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
configMgr = new FSSObsMonitorConfigurationManager(
MonName.snow.name());
}
return (FSSObsMonitorConfigurationManager) configMgr;
return configMgr;
}
/*
@ -166,5 +166,4 @@ public class SnowMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
}
});
}
}

View file

@ -72,6 +72,8 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
* Apr 23, 2014 3054 skorolev Fixed issue with removing from list a new zone and a new station.
* Apr 28, 2014 3086 skorolev Updated getConfigManager method.
*
* Sep 16, 2014 2757 skorolev Updated createBottomButtons method.
* Sep 24, 2014 2757 skorolev Fixed problem with adding and removing zones.
* </pre>
*
* @author lvenable
@ -1064,14 +1066,20 @@ public abstract class MonitoringAreaConfigDlg extends CaveSWTDialog implements
if (!configMgr.getAddedZones().contains(entry)) {
configMgr.getAddedZones().add(entry);
}
configMgr.removeAdjArea(entry);
} else { // Station mode
maStations.add(entry);
Collections.sort(maStations);
monitorAreaList.setItems(maStations.toArray(new String[maStations
.size()]));
monitorAreaList.setSelection(maStations.indexOf(entry));
handleMonitorAreaListSelection();
additionalStns.remove(entry);
String zone = associatedList.getItem(associatedList.getSelectionIndex());
String stnId = entry.substring(0, entry.indexOf('#'));
String stnType = entry.substring(entry.indexOf('#') + 1);
configMgr.addStation(zone, stnId, stnType, configMgr
.getAddedStations().contains(stnId));
handleMonitorAreaListSelection();
}
}
@ -1106,6 +1114,9 @@ public abstract class MonitoringAreaConfigDlg extends CaveSWTDialog implements
if (configMgr.getAddedZones().contains(entry)) {
configMgr.getAddedZones().remove(entry);
}
configMgr.addAdjArea(entry,entry.charAt(2) == 'Z' ? ZoneType.MARITIME
: ZoneType.REGULAR);
} else { // Station mode
additionalStns.add(entry);
Collections.sort(additionalStns);
@ -1204,7 +1215,7 @@ public abstract class MonitoringAreaConfigDlg extends CaveSWTDialog implements
* Removes an associated zone or station.
*/
private void removeAssociated() {
if (associatedList.getItemCount() == 0) {
if (associatedList.getSelectionCount() == 0) {
if (mode == Mode.Zone) {
showMessage(shell, SWT.ERROR, "Select Needed",
"You must select a station");
@ -1280,7 +1291,7 @@ public abstract class MonitoringAreaConfigDlg extends CaveSWTDialog implements
}
/**
* Called when the cancel or "X" button is clicked.
* Called when the cancel.
*/
private void closeWithoutSave() {
resetStatus();
@ -1297,7 +1308,8 @@ public abstract class MonitoringAreaConfigDlg extends CaveSWTDialog implements
}
/**
* Handles OK button.
* Handles OK button. Save changes and close the dialog (or just close if
* there are no changes).
*/
protected abstract void handleOkBtnSelection();

View file

@ -1,7 +0,0 @@
#Wed May 26 15:16:32 CDT 2010
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6

View file

@ -2,13 +2,13 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Nws Auth Plug-in
Bundle-SymbolicName: com.raytheon.uf.viz.plugin.nwsauth;singleton:=true
Bundle-Version: 1.12.1174.qualifier
Bundle-Version: 1.14.0.qualifier
Bundle-Activator: com.raytheon.uf.viz.plugin.nwsauth.Activator
Bundle-Vendor: RAYTHEON
Require-Bundle: org.eclipse.core.runtime,
com.raytheon.uf.common.auth,
com.raytheon.uf.common.plugin.nwsauth,
com.raytheon.uf.viz.core
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ActivationPolicy: lazy
Export-Package: com.raytheon.uf.viz.plugin.nwsauth

View file

@ -21,12 +21,9 @@ package com.raytheon.uf.viz.plugin.nwsauth;
import java.util.List;
import com.raytheon.uf.common.auth.user.IAuthenticationData;
import com.raytheon.uf.common.auth.user.IPermission;
import com.raytheon.uf.common.auth.user.IRole;
import com.raytheon.uf.common.auth.user.IUser;
import com.raytheon.uf.common.plugin.nwsauth.user.User;
import com.raytheon.uf.viz.core.auth.IUserManager;
import com.raytheon.uf.viz.core.auth.BasicUserManager;
import com.raytheon.uf.viz.core.requests.INotAuthHandler;
/**
@ -39,6 +36,7 @@ import com.raytheon.uf.viz.core.requests.INotAuthHandler;
* ------------ ---------- ----------- --------------------------
* May 27, 2010 rgeorge Initial creation
* Jun 07, 2013 1981 mpduff Add an IUser field.
* Oct 06, 2014 3398 bclement now extends BasicUserManager
*
* </pre>
*
@ -46,13 +44,10 @@ import com.raytheon.uf.viz.core.requests.INotAuthHandler;
* @version 1.0
*/
public class NwsUserManager implements IUserManager {
public class NwsUserManager extends BasicUserManager {
private final NwsNotAuthHandler notAuthHandler = new NwsNotAuthHandler();
/** Saved User Name */
private IUser user;
/*
* (non-Javadoc)
*
@ -63,35 +58,6 @@ public class NwsUserManager implements IUserManager {
return notAuthHandler;
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.core.auth.IUserManager#getUserObject()
*/
@Override
public IUser getUserObject() {
if (this.user == null) {
String userId = System.getProperty("user.name");
this.user = new User(userId);
return this.user;
} else {
return user;
}
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.viz.core.auth.IUserManager#updateUserObject(com.raytheon
* .uf.common.auth.user.IUser,
* com.raytheon.uf.common.auth.user.IAuthenticationData)
*/
@Override
public void updateUserObject(IUser user, IAuthenticationData authData) {
this.user = user;
}
/**
* {@inheritDoc}
*/
@ -110,11 +76,4 @@ public class NwsUserManager implements IUserManager {
return NwsRoleDataManager.getInstance().getRoles(application);
}
/**
* {@inheritDoc}
*/
@Override
public void updateUserObject(String userId, IAuthenticationData authData) {
user = new User(userId);
}
}

File diff suppressed because it is too large Load diff

View file

@ -21,6 +21,7 @@ package com.raytheon.uf.viz.spellchecker.dialogs;
import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import java.util.Deque;
import java.util.HashSet;
import java.util.LinkedList;
@ -77,6 +78,7 @@ import com.raytheon.uf.viz.spellchecker.jobs.SpellCheckJob;
* ------------ ---------- ----------- --------------------------
* 18 APR 2008 ### lvenable Initial creation
* 01Mar2010 4765 MW Fegan Moved from GFE plug-in.
* 09/24/2014 #16693 lshi filter out swear words in spelling check
*
* </pre>
*
@ -85,6 +87,8 @@ import com.raytheon.uf.viz.spellchecker.jobs.SpellCheckJob;
*
*/
public class SpellCheckDlg extends Dialog implements ISpellingProblemCollector {
private static java.util.List<String> swearWords = Arrays.asList("ASSHOLE");
private static final transient IUFStatusHandler statusHandler = UFStatus.getHandler(SpellCheckDlg.class);
private static final Pattern DIGITS = Pattern.compile("\\d");
@ -348,7 +352,8 @@ public class SpellCheckDlg extends Dialog implements ISpellingProblemCollector {
if (pdMatch.matches()) {
String replString = pdMatch.group(1).toUpperCase();
// proposals may include case changes, which get lost
if (replString != badWord) {
//if (replString != badWord) {
if (!swearWords.contains(replString) && !replString.equals(badWord)) {
suggestionList.add(replString);
}
}

View file

@ -182,9 +182,13 @@
version="0.0.0"/>
<includes
id="com.raytheon.uf.viz.datadelivery.feature"
id="com.raytheon.uf.viz.aviation.advisory.feature"
version="0.0.0"/>
<includes
id="com.raytheon.uf.viz.datadelivery.feature"
version="0.0.0"/>
<requires>
<import feature="com.raytheon.uf.viz.application.feature" version="1.0.0.qualifier"/>
</requires>

View file

@ -71,6 +71,7 @@ HazardsConflictDict = {
"AQ.Y" : ["AS.O", "AS.Y"],
"AS.O" : ["AQ.Y", "AS.Y"],
"AS.Y" : ["AQ.Y", "AS.O"],
"BH.S" : [],
"BW.Y" : ["GL.W", "SR.W", "HF.W", "TR.A", "TR.W", "HU.A", "HU.W", "HU.S",
"SC.Y", "SW.Y", "SE.W", "RB.Y", "SI.Y"],
"BZ.A" : ["LE.A", "WS.A", "BZ.W", "IS.W", "LE.W", "WS.W",
@ -78,10 +79,10 @@ HazardsConflictDict = {
"BZ.W" : ["BZ.A", "LE.A", "WS.A", "IS.W",
"LE.W", "WS.W",
"WW.Y", "LE.Y", "ZR.Y"],
"CF.A" : ["CF.W", "CF.Y", "HU.A", "TR.A", "TY.A", "HU.W", "TR.W"],
"CF.W" : ["CF.A", "CF.Y", "HU.W", "TR.W", "TY.W"],
"CF.Y" : ["CF.W", "CF.A", "HU.W", "TR.W", "TY.W"],
"CF.S" : ["HU.A", "TR.A", "TY.A", "CF.Y", "CF.W", "CF.A"],
"CF.A" : ["CF.W", "CF.Y", "HU.A", "TR.A", "TY.A", "HU.W", "TR.W", "SS.A", "SS.W"],
"CF.W" : ["CF.A", "CF.Y", "HU.W", "TR.W", "TY.W", "SS.A", "SS.W"],
"CF.Y" : ["CF.W", "CF.A", "HU.W", "TR.W", "TY.W,", "SS.A", "SS.W"],
"CF.S" : ["HU.A", "TR.A", "TY.A", "CF.Y", "CF.W", "CF.A", "SS.A", "SS.W"],
"DS.W" : ["DU.Y"],
"DU.Y" : ["DS.W"],
"EC.A" : ["WC.A", "EC.W", "WC.W"],
@ -161,6 +162,8 @@ HazardsConflictDict = {
"RB.Y", "SC.Y", "SE.A", "SE.W", "SI.Y", "SR.W", "SW.Y", "TY.W", "TY.A"],
"SR.W" : ["GL.W", "HF.W", "BW.Y", "TR.W", "HU.W", "TY.W",
"SC.Y", "SW.Y", "SE.W", "SE.A", "RB.Y", "SI.Y", "GL.A", "SR.A"],
"SS.A" : ["CF.A", "CF.W", "CF.Y", "SS.W"],
"SS.W" : ["CF.A", "CF.W", "CF.Y", "SS.A"],
"SU.W" : ["SU.Y", "HU.W", "TR.W", "TY.W"],
"SU.Y" : ["SU.W", "HU.W", "TR.W", "TY.W"],
"SV.A" : ["TO.A"],

View file

@ -93,6 +93,7 @@ class CallToActions:
"AF.Y": self.ctaAFY,
"AS.O": self.ctaASO,
"AS.Y": self.ctaASY,
"BH.S": self.ctaBHS,
"BW.Y": self.ctaBWY,
"BZ.A": self.ctaBZA,
"BZ.W": self.ctaBZW,
@ -280,6 +281,11 @@ LISTEN TO NOAA WEATHER RADIO OR LOCAL MEDIA FOR FURTHER INFORMATION.""",
"""AN AIR STAGNATION ADVISORY INDICATES THAT DUE TO LIMITED MOVEMENT OF AN AIR MASS ACROSS THE ADVISORY AREA...POLLUTION WILL INCREASE TO DANGEROUS LEVELS. PERSONS WITH RESPIRATORY ILLNESS SHOULD FOLLOW THEIR PHYSICIANS ADVICE FOR DEALING WITH HIGH LEVELS OF AIR POLLUTION.""",
]
def ctaBHS(self):
return [
"""A Beach Hazards Statement is issued when threats such as rip currents...longshore currents...sneaker waves and other hazards create life-threatening conditions in the surf zone. Caution should be used when in or near the water.""",
]
def ctaBWY(self):
return [
"""A BRISK WIND ADVISORY MEANS THAT WINDS WILL REACH SMALL CRAFT ADVISORY CRITERIA IN AREAS THAT ARE PRIMARILY ICE COVERED. MOVING ICE FLOES COULD DAMAGE SMALL CRAFT.""",
@ -333,11 +339,15 @@ LISTEN TO NOAA WEATHER RADIO OR LOCAL MEDIA FOR FURTHER INFORMATION.""",
def ctaEHA(self):
return [
"""AN EXCESSIVE HEAT WATCH MEANS THAT A PROLONGED PERIOD OF HOT TEMPERATURES IS EXPECTED. THE COMBINATION OF HOT TEMPERATURES AND HIGH HUMIDITY WILL COMBINE TO CREATE A DANGEROUS SITUATION IN WHICH HEAT ILLNESSES ARE POSSIBLE. DRINK PLENTY OF FLUIDS...STAY IN AN AIR-CONDITIONED ROOM...STAY OUT OF THE SUN...AND CHECK UP ON RELATIVES AND NEIGHBORS.""",
"""YOUNG CHILDREN AND PETS SHOULD NEVER BE LEFT UNATTENDED IN VEHICLES UNDER ANY CIRCUMSTANCES. THIS IS ESPECIALLY TRUE DURING WARM OR HOT WEATHER WHEN CAR INTERIORS CAN REACH LETHAL TEMPERATURES IN A MATTER OF MINUTES.""",
]
def ctaEHW(self):
return [
"""AN EXCESSIVE HEAT WARNING MEANS THAT A PROLONGED PERIOD OF DANGEROUSLY HOT TEMPERATURES WILL OCCUR. THE COMBINATION OF HOT TEMPERATURES AND HIGH HUMIDITY WILL COMBINE TO CREATE A DANGEROUS SITUATION IN WHICH HEAT ILLNESSES ARE LIKELY. DRINK PLENTY OF FLUIDS...STAY IN AN AIR-CONDITIONED ROOM...STAY OUT OF THE SUN...AND CHECK UP ON RELATIVES AND NEIGHBORS.""",
"""TAKE EXTRA PRECAUTIONS...IF YOU WORK OR SPEND TIME OUTSIDE. WHEN POSSIBLE...RESCHEDULE STRENUOUS ACTIVITIES TO EARLY MORNING OR EVENING. KNOW THE SIGNS AND SYMPTOMS OF HEAT EXHAUSTION AND HEAT STROKE. WEAR LIGHT WEIGHT AND LOOSE FITTING CLOTHING WHEN POSSIBLE AND DRINK PLENTY OF WATER.\n\n
TO REDUCE RISK DURING OUTDOOR WORK...THE OCCUPATIONAL SAFETY AND HEALTH ADMINISTRATION RECOMMENDS SCHEDULING FREQUENT REST BREAKS IN SHADED OR AIR CONDITIONED ENVIRONMENTS. ANYONE OVERCOME BY HEAT SHOULD BE MOVED TO A COOL AND SHADED LOCATION. HEAT STROKE IS AN EMERGENCY...CALL 9 1 1.\n\n
AN EXCESSIVE HEAT WARNING MEANS THAT A PROLONGED PERIOD OF DANGEROUSLY HOT TEMPERATURES WILL OCCUR. THE COMBINATION OF HOT TEMPERATURES AND HIGH HUMIDITY WILL COMBINE TO CREATE A DANGEROUS SITUATION IN WHICH HEAT ILLNESSES ARE LIKELY. DRINK PLENTY OF FLUIDS...STAY IN AN AIR-CONDITIONED ROOM...STAY OUT OF THE SUN...AND CHECK UP ON RELATIVES AND NEIGHBORS.\n\n
YOUNG CHILDREN AND PETS SHOULD NEVER BE LEFT UNATTENDED IN VEHICLES UNDER ANY CIRCUMSTANCES. THIS IS ESPECIALLY TRUE DURING WARM OR HOT WEATHER WHEN CAR INTERIORS CAN REACH LETHAL TEMPERATURES IN A MATTER OF MINUTES.""",
]
def ctaFAA(self):
@ -357,7 +367,7 @@ LISTEN TO NOAA WEATHER RADIO OR LOCAL MEDIA FOR FURTHER INFORMATION.""",
def ctaFRY(self):
return [
"""A FROST ADVISORY MEANS THAT FROST IS POSSIBLE. SENSITIVE OUTDOOR PLANTS MAY BE KILLED IF LEFT UNCOVERED.""",
"""A FROST ADVISORY MEANS THAT WIDESPREAD FROST IS EXPECTED. SENSITIVE OUTDOOR PLANTS MAY BE KILLED IF LEFT UNCOVERED.""",
]
def ctaFWA(self):
@ -402,7 +412,9 @@ LISTEN TO NOAA WEATHER RADIO OR LOCAL MEDIA FOR FURTHER INFORMATION.""",
def ctaHTY(self):
return [
"""A HEAT ADVISORY MEANS THAT A PERIOD OF HOT TEMPERATURES IS EXPECTED. THE COMBINATION OF HOT TEMPERATURES AND HIGH HUMIDITY WILL COMBINE TO CREATE A SITUATION IN WHICH HEAT ILLNESSES ARE POSSIBLE. DRINK PLENTY OF FLUIDS...STAY IN AN AIR-CONDITIONED ROOM...STAY OUT OF THE SUN...AND CHECK UP ON RELATIVES AND NEIGHBORS.""",
"""TAKE EXTRA PRECAUTIONS...IF YOU WORK OR SPEND TIME OUTSIDE. WHEN POSSIBLE...RESCHEDULE STRENUOUS ACTIVITIES TO EARLY MORNING OR EVENING. KNOW THE SIGNS AND SYMPTOMS OF HEAT EXHAUSTION AND HEAT STROKE. WEAR LIGHT WEIGHT AND LOOSE FITTING CLOTHING WHEN POSSIBLE AND DRINK PLENTY OF WATER.\n\n
TO REDUCE RISK DURING OUTDOOR WORK...THE OCCUPATIONAL SAFETY AND HEALTH ADMINISTRATION RECOMMENDS SCHEDULING FREQUENT REST BREAKS IN SHADED OR AIR CONDITIONED ENVIRONMENTS. ANYONE OVERCOME BY HEAT SHOULD BE MOVED TO A COOL AND SHADED LOCATION. HEAT STROKE IS AN EMERGENCY...CALL 9 1 1.\n\n
A HEAT ADVISORY MEANS THAT A PERIOD OF HOT TEMPERATURES IS EXPECTED. THE COMBINATION OF HOT TEMPERATURES AND HIGH HUMIDITY WILL COMBINE TO CREATE A SITUATION IN WHICH HEAT ILLNESSES ARE POSSIBLE. DRINK PLENTY OF FLUIDS...STAY IN AN AIR-CONDITIONED ROOM...STAY OUT OF THE SUN...AND CHECK UP ON RELATIVES AND NEIGHBORS.""",
]
def ctaHUA(self):
@ -509,10 +521,11 @@ LISTEN TO NOAA WEATHER RADIO OR LOCAL MEDIA FOR FURTHER INFORMATION.""",
return [
"""THERE IS A HIGH RISK OF RIP CURRENTS.
RIP CURRENTS ARE POWERFUL CHANNELS OF WATER FLOWING QUICKLY AWAY FROM SHORE...WHICH OCCUR MOST OFTEN AT LOW SPOTS OR BREAKS IN THE SANDBAR AND IN THE VICINITY OF STRUCTURES SUCH AS GROINS...JETTIES AND PIERS. HEED THE ADVICE OF LIFEGUARDS AND THE BEACH PATROL. PAY ATTENTION TO FLAGS AND POSTED SIGNS.
RIP CURRENTS ARE POWERFUL CHANNELS OF WATER FLOWING QUICKLY AWAY FROM SHORE...WHICH OCCUR MOST OFTEN AT LOW SPOTS OR BREAKS IN THE SANDBAR AND IN THE VICINITY OF STRUCTURES SUCH AS GROINS...JETTIES AND PIERS. HEED THE ADVICE OF LIFEGUARDS...BEACH PATROL FLAGS AND SIGNS.
IF YOU BECOME CAUGHT IN A RIP CURRENT...DO NOT PANIC. REMAIN CALM AND BEGIN TO SWIM PARALLEL TO SHORE. ONCE YOU ARE AWAY FROM THE FORCE OF THE RIP CURRENT...BEGIN TO SWIM BACK TO THE BEACH. DO NOT ATTEMPT TO SWIM DIRECTLY AGAINST A RIP CURRENT. EVEN A STRONG SWIMMER CAN BECOME EXHAUSTED QUICKLY.""",
IF YOU BECOME CAUGHT IN A RIP CURRENT...YELL FOR HELP. REMAIN CALM...do not exhaust yourself and stay afloat while waiting for help. If you have to swim out of a rip current...SWIM PARALLEL TO SHORE and back toward the beach when possible. DO NOT ATTEMPT TO SWIM DIRECTLY AGAINST A RIP CURRENT as you will tire quickly. """,
]
def ctaSCY(self):
return [
"""A SMALL CRAFT ADVISORY MEANS THAT WIND SPEEDS OF 21 TO 33 KNOTS ARE EXPECTED TO PRODUCE HAZARDOUS WAVE CONDITIONS TO SMALL CRAFT. INEXPERIENCED MARINERS...ESPECIALLY THOSE OPERATING SMALLER VESSELS SHOULD AVOID NAVIGATING IN THESE CONDITIONS.""",
@ -538,7 +551,6 @@ IF YOU BECOME CAUGHT IN A RIP CURRENT...DO NOT PANIC. REMAIN CALM AND BEGIN TO S
"""A DENSE SMOKE ADVISORY MEANS WIDESPREAD FIRES WILL CREATE SMOKE...LIMITING VISIBILITIES. IF DRIVING...SLOW DOWN...USE YOUR HEADLIGHTS...AND LEAVE PLENTY OF DISTANCE AHEAD OF YOU IN CASE A SUDDEN STOP IS NEEDED.""",
]
def ctaSRA(self):
return [
"""A STORM WATCH IS ISSUED WHEN THE RISK OF STORM FORCE WINDS OF 48 TO 63 KNOTS HAS SIGNIFICANTLY INCREASED...BUT THE SPECIFIC TIMING AND/OR LOCATION IS STILL UNCERTAIN. IT IS INTENDED TO PROVIDE ADDITIONAL LEAD TIME FOR MARINERS WHO MAY WISH TO CONSIDER ALTERING THEIR PLANS.""",
@ -551,12 +563,12 @@ IF YOU BECOME CAUGHT IN A RIP CURRENT...DO NOT PANIC. REMAIN CALM AND BEGIN TO S
def ctaSUW(self):
return [
"""A HIGH SURF WARNING INDICATES THAT DANGEROUS...BATTERING WAVE WILL POUND THE SHORELINE. THIS WILL RESULT IN VERY DANGEROUS SWIMMING CONDITIONS...AND DEADLY RIP CURRENTS.""",
"""A HIGH SURF WARNING INDICATES THAT DANGEROUS...BATTERING WAVES WILL POUND THE SHORELINE. THIS WILL RESULT IN LIFE-THREATENING CONDITIONS.""",
]
def ctaSUY(self):
return [
"""A HIGH SURF ADVISORY MEANS THAT HIGH SURF WILL AFFECT BEACHES IN THE ADVISORY AREA...PRODUCING RIP CURRENTS AND LOCALIZED BEACH EROSION.""",
"""A HIGH SURF ADVISORY MEANS THAT HIGH SURF WILL AFFECT BEACHES IN THE ADVISORY AREA...PRODUCING LOCALIZED BEACH EROSION AND DANGEROUS SWIMMING CONDITIONS.""",
]
def ctaSWY(self):
@ -694,7 +706,15 @@ A WINTER WEATHER ADVISORY FOR SNOW MEANS THAT PERIODS OF SNOW WILL CAUSE PRIMARI
]
def ctaPilCFW(self):
return [
return [("***RIP CURRENTS CTA", """RIP CURRENTS ARE POWERFUL CHANNELS OF WATER FLOWING QUICKLY AWAY FROM SHORE...WHICH OCCUR MOST OFTEN AT LOW SPOTS OR BREAKS IN THE SANDBAR AND IN THE VICINITY OF STRUCTURES SUCH AS GROINS...JETTIES AND PIERS. HEED THE ADVICE OF LIFEGUARDS...BEACH PATROL FLAGS AND SIGNS.
IF YOU BECOME CAUGHT IN A RIP CURRENT...YELL FOR HELP. REMAIN CALM...do not exhaust yourself and stay afloat while waiting for help. If you have to swim out of a rip current...SWIM PARALLEL TO SHORE and back toward the beach when possible. DO NOT ATTEMPT TO SWIM DIRECTLY AGAINST A RIP CURRENT as you will tire quickly."""),
("***LONGSHORE CURRENTS CTA", """LONGSHORE CURRENTS COMMONLY OCCUR WHEN WAVES APPROACH THE SHORELINE AT AN ANGLE. THEY CAN BE PARTICULARLY DANGEROUS NEAR A JETTY OR PIER."""),
("***SNEAKER WAVES CTA", """ADD CTA HERE."""),
("***RED TIDE CTA", """ADD CTA HERE"""),
("***SEA NETTLES CTA", """ADD CTA HERE"""),
("***TSUNAMI DEBRIS CTA", """ADD CTA HERE"""),
("***OTHER BEACH HAZARDS CTA", """ADD CTA HERE"""),
]
def ctaPilCWF(self):

View file

@ -52,7 +52,7 @@ hazardDict = OrderedDict([
('Fire Weather', ["FW.A", "FW.W"]),
('Convective Watches', ["SV.A", "TO.A"]),
('Coastal Flood', ["CF.S", "LS.S", "CF.Y", "CF.W", "CF.A",
"SU.Y", "SU.W", "LS.Y", "LS.W", "LS.A", "RP.S"]),
"SU.Y", "SU.W", "LS.Y", "LS.W", "LS.A", "BH.S", "RP.S"]),
('Non-Precipitation', ["AF.W", "AF.Y", "AQ.Y", "AS.O", "AS.Y", "DU.Y",
"DS.W", "EH.W", "EH.A", "EC.W", "EC.A", "FG.Y", "FZ.W", "FZ.A",
"HZ.W", "HZ.A", "ZF.Y", "FR.Y", "HT.Y", "HW.W", "HW.A",
@ -60,7 +60,7 @@ hazardDict = OrderedDict([
('Marine', ["MA.S", "MH.W", "MH.Y", "BW.Y", "UP.Y", "MF.Y",
"GL.A", "GL.W", "SE.A", "SE.W", "UP.A", "UP.W", "HF.A", "HF.W", "LO.Y", "SC.Y", "SW.Y",
"RB.Y", "SI.Y", "MS.Y", "SR.A", "SR.W"]),
('Tropical Cyclone', ["HU.W", "HU.A", "HU.S", "TR.W", "TR.A"]),
('Tropical Cyclone', ["HU.W", "HU.A", "TR.W", "TR.A"]),
('Tsunami', ["TS.A", "TS.W"]),
# ('Local', ["TEST"]), #example of adding local hazards
@ -73,7 +73,7 @@ hazardDict = OrderedDict([
# ('Hydrology', ["FF.A", "FA.A"]),
# ('Fire Weather', ["FW.A", "FW.W"]),
# ('Coastal Flood', ["CF.S", "LS.S", "CF.Y", "CF.W", "CF.A",
# "SU.Y", "SU.W", "LS.Y", "LS.W", "LS.A", "RP.S"]),
# "SU.Y", "SU.W", "LS.Y", "LS.W", "LS.A", "RP.S", "BH.S"]),
# ('Non-Precipitation', ["AF.W", "AF.Y", "AQ.Y", "AS.O", "AS.Y", "DU.Y",
# "DS.W", "EH.W", "EH.A", "EC.W", "EC.A", "FG.Y", "FZ.W", "FZ.A",
# "HZ.W", "HZ.A", "ZF.Y", "FR.Y", "HT.Y", "HW.W", "HW.A",

View file

@ -19,12 +19,17 @@
**/
package com.raytheon.viz.gfe;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import jep.JepException;
import com.raytheon.uf.common.dataplugin.gfe.db.objects.GFERecord.GridType;
import com.raytheon.uf.common.dataplugin.gfe.grid.Grid2DByte;
import com.raytheon.uf.common.dataplugin.gfe.grid.Grid2DFloat;
import com.raytheon.uf.common.python.controller.PythonScriptController;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
@ -43,6 +48,9 @@ import com.raytheon.viz.gfe.smartscript.FieldDefinition;
* Nov 10, 2008 njensen Initial creation
* Jan 08, 2013 1486 dgilling Refactor based on PythonScriptController.
* Jan 18, 2013 njensen Added garbageCollect()
* Oct 14, 2014 3676 njensen Moved getNumpyResult(GridType) here and
* hardened it by separating jep.getValue()
* calls from python copying/casting to correct types
*
* </pre>
*
@ -179,4 +187,114 @@ public abstract class BaseGfePyController extends PythonScriptController {
"Error garbage collecting GFE python interpreter", e);
}
}
/**
* Transforms the execution result of a python GFE script to a type expected
* based on the GridType. Currently used by smart tools and VC modules.
*
* @param type
* the type of data that is coming back
* @return the result of the execution in Java format
* @throws JepException
*/
protected Object getNumpyResult(GridType type) throws JepException {
Object result = null;
boolean resultFound = (Boolean) jep.getValue(RESULT + " is not None");
if (resultFound) {
int xDim, yDim = 0;
/*
* correctType is just a memory optimization. A copy is made when we
* call getValue(numpyArray), but doing array.astype(dtype) or
* numpy.ascontiguousarray(array, dtype) will create yet another
* copy.
*
* Note that if you attempt jep.getValue(array.astype(dtype)) or
* jep.getValue(numpy.ascontiguousarray(array, dtype)) you can
* potentially crash the JVM. jep.getValue(variable) should
* primarily retrieve variables that are globally scoped in the
* python interpreter as opposed to created on the fly.
*/
boolean correctType = false;
switch (type) {
case SCALAR:
correctType = (boolean) jep.getValue(RESULT
+ ".dtype.name == 'float32'");
if (!correctType) {
/*
* the following line needs to be separate from
* jep.getValue() to be stable
*/
jep.eval(RESULT + " = numpy.ascontiguousarray(" + RESULT
+ ", numpy.float32)");
}
float[] scalarData = (float[]) jep.getValue(RESULT);
xDim = (Integer) jep.getValue(RESULT + ".shape[1]");
yDim = (Integer) jep.getValue(RESULT + ".shape[0]");
result = new Grid2DFloat(xDim, yDim, scalarData);
break;
case VECTOR:
correctType = (boolean) jep.getValue(RESULT
+ "[0].dtype.name == 'float32'");
if (!correctType) {
/*
* the following line needs to be separate from
* jep.getValue() to be stable
*/
jep.eval(RESULT + "[0] = numpy.ascontiguousarray(" + RESULT
+ "[0], numpy.float32)");
}
correctType = (boolean) jep.getValue(RESULT
+ "[1].dtype.name == 'float32'");
if (!correctType) {
/*
* the following line needs to be separate from
* jep.getValue() to be stable
*/
jep.eval(RESULT + "[1] = numpy.ascontiguousarray(" + RESULT
+ "[1], numpy.float32)");
}
float[] mag = (float[]) jep.getValue(RESULT + "[0]");
float[] dir = (float[]) jep.getValue(RESULT + "[1]");
xDim = (Integer) jep.getValue(RESULT + "[0].shape[1]");
yDim = (Integer) jep.getValue(RESULT + "[0].shape[0]");
Grid2DFloat magGrid = new Grid2DFloat(xDim, yDim, mag);
Grid2DFloat dirGrid = new Grid2DFloat(xDim, yDim, dir);
result = new Grid2DFloat[] { magGrid, dirGrid };
break;
case WEATHER:
case DISCRETE:
correctType = (boolean) jep.getValue(RESULT
+ "[0].dtype.name == 'int8'");
if (!correctType) {
/*
* the following line needs to be separate from
* jep.getValue() to be stable
*/
jep.eval(RESULT + "[0] = numpy.ascontiguousarray(" + RESULT
+ "[0], numpy.int8)");
}
byte[] bytes = (byte[]) jep.getValue(RESULT + "[0]");
String[] keys = (String[]) jep.getValue(RESULT + "[1]");
xDim = (Integer) jep.getValue(RESULT + "[0].shape[1]");
yDim = (Integer) jep.getValue(RESULT + "[0].shape[0]");
Grid2DByte grid = new Grid2DByte(xDim, yDim, bytes);
List<String> keysList = new ArrayList<String>();
Collections.addAll(keysList, keys);
result = new Object[] { grid, keysList };
break;
}
jep.eval(RESULT + " = None");
}
return result;
}
}

View file

@ -58,7 +58,6 @@ import com.raytheon.uf.common.util.FileUtil;
* Sep 05, 2013 #2307 dgilling Use better PythonScript constructor.
* Sep 11, 2013 #2033 dgilling Don't load loadConfig.py from
* localization store.
* Apr 02, 2014 #2729 randerso Added commonPython to path for LogStream
*
* </pre>
*
@ -90,7 +89,6 @@ public class PythonPreferenceStore implements IPreferenceStore,
@SuppressWarnings("unchecked")
public void loadConfiguration(String configName) {
String commonPythonPath = GfePyIncludeUtil.getCommonPythonIncludePath();
String configPath = GfePyIncludeUtil.getConfigIncludePath();
String vtecPath = GfePyIncludeUtil.getVtecIncludePath();
@ -102,8 +100,8 @@ public class PythonPreferenceStore implements IPreferenceStore,
new Path(FileUtil.join("python", "utility",
"loadConfig.py")), null)).getPath());
py = new PythonScript(scriptFile.getPath(),
PyUtil.buildJepIncludePath(commonPythonPath, configPath,
vtecPath), this.getClass().getClassLoader());
PyUtil.buildJepIncludePath(configPath, vtecPath), this
.getClass().getClassLoader());
} catch (JepException e) {
statusHandler.handle(Priority.CRITICAL,
"Unable to load GFE config", e);
@ -190,7 +188,7 @@ public class PythonPreferenceStore implements IPreferenceStore,
public void firePropertyChangeEvent(String name, Object oldValue,
Object newValue) {
// The following criteria meets the Eclipse contract
if ((oldValue == null) || oldValue.equals(newValue)) {
if (oldValue == null || oldValue.equals(newValue)) {
return;
}
@ -677,32 +675,32 @@ public class PythonPreferenceStore implements IPreferenceStore,
public boolean isBoolean(String name) {
Object obj = selectedConfiguration.get(name);
return ((obj != null) && (obj instanceof Boolean));
return (obj != null && obj instanceof Boolean);
}
public boolean isInt(String name) {
Object obj = selectedConfiguration.get(name);
return ((obj != null) && (obj instanceof Integer));
return (obj != null && obj instanceof Integer);
}
public boolean isFloat(String name) {
Object obj = selectedConfiguration.get(name);
return ((obj != null) && (obj instanceof Float));
return (obj != null && obj instanceof Float);
}
public boolean isDouble(String name) {
Object obj = selectedConfiguration.get(name);
return ((obj != null) && (obj instanceof Double));
return (obj != null && obj instanceof Double);
}
public boolean isLong(String name) {
Object obj = selectedConfiguration.get(name);
return ((obj != null) && (obj instanceof Long));
return (obj != null && obj instanceof Long);
}
public boolean isString(String name) {
Object obj = selectedConfiguration.get(name);
return ((obj != null) && (obj instanceof String));
return (obj != null && obj instanceof String);
}
public boolean isStringArray(String name) {
@ -713,7 +711,7 @@ public class PythonPreferenceStore implements IPreferenceStore,
result = true;
} else if (obj instanceof List) {
List<?> list = (List<?>) obj;
if ((list.size() == 0) || (list.get(0) instanceof String)) {
if (list.size() == 0 || list.get(0) instanceof String) {
result = true;
}
}
@ -730,7 +728,7 @@ public class PythonPreferenceStore implements IPreferenceStore,
result = true;
} else if (obj instanceof List) {
List<?> list = (List<?>) obj;
if ((list.size() == 0) || (list.get(0) instanceof Float)) {
if (list.size() == 0 || list.get(0) instanceof Float) {
result = true;
}
}
@ -747,7 +745,7 @@ public class PythonPreferenceStore implements IPreferenceStore,
result = true;
} else if (obj instanceof List) {
List<?> list = (List<?>) obj;
if ((list.size() == 0) || (list.get(0) instanceof Integer)) {
if (list.size() == 0 || list.get(0) instanceof Integer) {
result = true;
}
}

View file

@ -21,15 +21,12 @@ package com.raytheon.viz.gfe.core.parm.vcparm;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import jep.JepException;
import com.raytheon.uf.common.dataplugin.gfe.db.objects.GFERecord.GridType;
import com.raytheon.uf.common.dataplugin.gfe.grid.Grid2DByte;
import com.raytheon.uf.common.dataplugin.gfe.grid.Grid2DFloat;
import com.raytheon.uf.common.dataplugin.gfe.python.GfePyIncludeUtil;
import com.raytheon.uf.common.python.PyConstants;
import com.raytheon.viz.gfe.BaseGfePyController;
@ -48,6 +45,8 @@ import com.raytheon.viz.gfe.core.DataManager;
* ------------ ---------- ----------- --------------------------
* Nov 17, 2011 dgilling Initial creation
* Jan 08, 2013 1486 dgilling Support changes to BaseGfePyController.
* Oct 14, 2014 3676 njensen Removed decodeGD(GridType) since it was
* a copy of getNumpyResult()
*
* </pre>
*
@ -119,10 +118,11 @@ public class VCModuleController extends BaseGfePyController {
if (!methodName.equals("calcGrid")) {
jep.eval(RESULT + " = JUtil.pyValToJavaObj(" + RESULT + ")");
obj = jep.getValue(RESULT);
jep.eval(RESULT + " = None");
} else {
obj = decodeGD(type);
obj = getNumpyResult(type);
// getNumpyResult will set result to None to free up memory
}
jep.eval(RESULT + " = None");
return obj;
}
@ -169,52 +169,6 @@ public class VCModuleController extends BaseGfePyController {
tempGridNames.clear();
}
private Object decodeGD(GridType type) throws JepException {
Object result = null;
boolean resultFound = (Boolean) jep.getValue(RESULT + " is not None");
if (resultFound) {
int xDim, yDim = 0;
switch (type) {
case SCALAR:
float[] scalarData = (float[]) jep.getValue(RESULT
+ ".astype(numpy.float32)");
xDim = (Integer) jep.getValue(RESULT + ".shape[1]");
yDim = (Integer) jep.getValue(RESULT + ".shape[0]");
result = new Grid2DFloat(xDim, yDim, scalarData);
break;
case VECTOR:
float[] mag = (float[]) jep.getValue(RESULT
+ "[0].astype(numpy.float32)");
float[] dir = (float[]) jep.getValue(RESULT
+ "[1].astype(numpy.float32)");
xDim = (Integer) jep.getValue(RESULT + "[0].shape[1]");
yDim = (Integer) jep.getValue(RESULT + "[0].shape[0]");
Grid2DFloat magGrid = new Grid2DFloat(xDim, yDim, mag);
Grid2DFloat dirGrid = new Grid2DFloat(xDim, yDim, dir);
result = new Grid2DFloat[] { magGrid, dirGrid };
break;
case WEATHER:
case DISCRETE:
byte[] bytes = (byte[]) jep.getValue(RESULT
+ "[0].astype(numpy.int8)");
String[] keys = (String[]) jep.getValue(RESULT + "[1]");
xDim = (Integer) jep.getValue(RESULT + "[0].shape[1]");
yDim = (Integer) jep.getValue(RESULT + "[0].shape[0]");
Grid2DByte grid = new Grid2DByte(xDim, yDim, bytes);
List<String> keysList = new ArrayList<String>();
Collections.addAll(keysList, keys);
result = new Object[] { grid, keysList };
break;
}
}
return result;
}
/*
* (non-Javadoc)
*

View file

@ -21,7 +21,6 @@ package com.raytheon.viz.gfe.smarttool.script;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -29,9 +28,7 @@ import java.util.Set;
import jep.JepException;
import com.raytheon.uf.common.dataplugin.gfe.db.objects.GFERecord.GridType;
import com.raytheon.uf.common.dataplugin.gfe.discrete.DiscreteKey;
import com.raytheon.uf.common.dataplugin.gfe.grid.Grid2DByte;
import com.raytheon.uf.common.dataplugin.gfe.grid.Grid2DFloat;
import com.raytheon.uf.common.dataplugin.gfe.python.GfePyIncludeUtil;
import com.raytheon.uf.common.dataplugin.gfe.weather.WeatherKey;
@ -69,8 +66,10 @@ import com.raytheon.viz.gfe.core.wxvalue.WxValue;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Oct 20, 2008 njensen Initial creation
* Oct 29, 2013 2476 njensen Renamed numeric methods to numpy
* 10/31/2013 2508 randerso Change to use DiscreteGridSlice.getKeys()
* Oct 29, 2013 2476 njensen Renamed numeric methods to numpy
* 10/31/2013 2508 randerso Change to use DiscreteGridSlice.getKeys()
* Oct 14, 2014 3676 njensen Promoted getNumpyResult() to parent class
*
* </pre>
*
* @author njensen
@ -239,63 +238,6 @@ public class SmartToolController extends BaseGfePyController {
return (String) execute("getWeatherElementEdited", INTERFACE, args);
}
/**
* Transforms the execution result of a smart tool to a type that can be
* handled by the GridCycler
*
* @param type
* the type of data that is coming back from the smart tool
* @return the result of the execution in Java format
* @throws JepException
*/
protected Object getNumpyResult(GridType type) throws JepException {
Object result = null;
boolean resultFound = (Boolean) jep.getValue(RESULT + " is not None");
if (resultFound) {
int xDim, yDim = 0;
switch (type) {
case SCALAR:
float[] scalarData = (float[]) jep.getValue(RESULT
+ ".astype(numpy.float32)");
xDim = (Integer) jep.getValue(RESULT + ".shape[1]");
yDim = (Integer) jep.getValue(RESULT + ".shape[0]");
result = new Grid2DFloat(xDim, yDim, scalarData);
break;
case VECTOR:
float[] mag = (float[]) jep.getValue(RESULT
+ "[0].astype(numpy.float32)");
float[] dir = (float[]) jep.getValue(RESULT
+ "[1].astype(numpy.float32)");
xDim = (Integer) jep.getValue(RESULT + "[0].shape[1]");
yDim = (Integer) jep.getValue(RESULT + "[0].shape[0]");
Grid2DFloat magGrid = new Grid2DFloat(xDim, yDim, mag);
Grid2DFloat dirGrid = new Grid2DFloat(xDim, yDim, dir);
result = new Grid2DFloat[] { magGrid, dirGrid };
break;
case WEATHER:
case DISCRETE:
byte[] bytes = (byte[]) jep.getValue(RESULT
+ "[0].astype(numpy.int8)");
String[] keys = (String[]) jep.getValue(RESULT + "[1]");
xDim = (Integer) jep.getValue(RESULT + "[0].shape[1]");
yDim = (Integer) jep.getValue(RESULT + "[0].shape[0]");
Grid2DByte grid = new Grid2DByte(xDim, yDim, bytes);
List<String> keysList = new ArrayList<String>();
Collections.addAll(keysList, keys);
result = new Object[] { grid, keysList };
break;
}
jep.eval(RESULT + " = None");
}
return result;
}
/**
* Evaluates python method arguments for smart tools, transforming Java
* objects into python objects where appropriate.

View file

@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<bundle xmlns:ns2="com.raytheon.uf.common.datadelivery.registry" xmlns:ns3="http://www.example.org/productType">
<displayList>
<displays xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="d2DMapRenderableDisplay" density="1.0" magnification="1.0" scale="CONUS">
<descriptor xsi:type="mapDescriptor">
<resource>
<loadProperties xsi:type="gridLoadProperties" displayType="IMAGE" loadWithoutData="false">
<resourceType>PLAN_VIEW</resourceType>
<perspectiveProperty xsi:type="d2dLoadProperties" timeMatchBasis="true" loadMode="VALID_TIME_SEQ"/>
<capabilities>
<capability xsi:type="colorableCapability" colorAsString="green"/>
<capability xsi:type="imagingCapability" alpha="1.0" interpolationState="true" brightness="1.0" contrast="1.0"/>
<capability xsi:type="displayTypeCapability" displayType="IMAGE"/>
</capabilities>
</loadProperties>
<properties renderingOrderId="IMAGE_WORLD" isSystemResource="false" isBlinking="false" isMapLayer="false" isHoverOn="false" isVisible="true">
<pdProps maxDisplayWidth="100000000" minDisplayWidth="0"/>
</properties>
<resourceData xsi:type="gridResourceData" spatial="false" sampling="true" retrieveData="true" isUpdatingOnMetadataOnly="false" isRequeryNecessaryOnTimeMatch="true">
<metadataMap>
<mapping key="info.level.levelonevalue">
<constraint constraintValue="${levelOneValue}" constraintType="EQUALS"/>
</mapping>
<mapping key="info.level.masterLevel.name">
<constraint constraintValue="FH" constraintType="EQUALS"/>
</mapping>
<mapping key="info.datasetId">
<constraint constraintValue="${datasetID}" constraintType="EQUALS"/>
</mapping>
<mapping key="info.parameter.abbreviation">
<constraint constraintValue="${parameterID}" constraintType="EQUALS"/>
</mapping>
<mapping key="info.level.leveltwovalue">
<constraint constraintValue="-999999.0" constraintType="EQUALS"/>
</mapping>
<mapping key="pluginName">
<constraint constraintValue="grid" constraintType="EQUALS"/>
</mapping>
</metadataMap>
<alertParser xsi:type="dataCubeAlertMessageParser"/>
</resourceData>
</resource>
</descriptor>
</displays>
</displayList>
</bundle>

View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
Name Organization Date Info
Darrel Kingfield NOAA/NSSL/CIMMS 09-02-2014 Initial File Creation
-->
<menuContributionFile>
<include installTo="menu:org.eclipse.ui.main.menu?after=radar"
fileName="menus/mrms/mrms.xml">
</include>
</menuContributionFile>

View file

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
Name Organization Date Info
Darrel Kingfield NOAA/NSSL/CIMMS 09-02-2014 Initial File Creation
-->
<menuTemplate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<!-- Set the initial top level menu -->
<contribute xsi:type="subMenu" menuText="MRMS">
<contribute xsi:type="titleItem" titleText="---Multiple-Radar/Multiple-Sensor---" id="MRMS-SVR"/>
<contribute xsi:type="subinclude" fileName="menus/mrms/mrmsProducts.xml"/>
</contribute>
</menuTemplate>

View file

@ -0,0 +1,422 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
Name Organization Date Info
Darrel Kingfield NOAA/NSSL/CIMMS 09-02-2014 Initial File Creation
-->
<menuTemplate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<!-- Set the initial top level menu -->
<contribute xsi:type="subMenu" menuText="Hail Products" id="MRMS_HAIL">
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="Maximum Estimated Size of Hail (MESH)" id="MESH">
<substitute key="levelOneValue" value="500.0" />
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="MESH"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="MESH Tracks (30 min. accum.)" id="MESH30">
<substitute key="levelOneValue" value="500.0" />
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="MESHTrack30min"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="MESH Tracks (60 min. accum.)" id="MESH60">
<substitute key="levelOneValue" value="500.0" />
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="MESHTrack60min"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="MESH Tracks (120 min. accum.)" id="MESH120">
<substitute key="levelOneValue" value="500.0" />
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="MESHTrack120min"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="MESH Tracks (240 min. accum.)" id="MESH240">
<substitute key="levelOneValue" value="500.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="MESHTrack240min"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="MESH Tracks (360 min. accum.)" id="MESH360">
<substitute key="levelOneValue" value="500.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="MESHTrack360min"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="MESH Tracks (1440 min. accum.)" id="MESH1440">
<substitute key="levelOneValue" value="500.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="MESHTrack1440min"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="Probability Of Severe Hail (POSH)" id="POSH">
<substitute key="levelOneValue" value="500.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="POSH"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="Severe Hail Index (SHI)" id="SHI">
<substitute key="levelOneValue" value="500.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="SHI"/>
</contribute>
</contribute>
<contribute xsi:type="subMenu" menuText="Lightning Products" id="MRMS_LIGHTNING">
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="Cloud-to-Ground Lightning Density (1 min.)" id="LightDensity1min">
<substitute key="levelOneValue" value="0.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="LightningDensity1min"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="Cloud-to-Ground Lightning Density (5 min.)" id="LightDensity5min">
<substitute key="levelOneValue" value="0.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="LightningDensity5min"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="Cloud-to-Ground Lightning Density (15 min.)" id="LightDensity15min">
<substitute key="levelOneValue" value="0.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="LightningDensity15min"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="Cloud-to-Ground Lightning Density (30 min.)" id="LightDensity30min">
<substitute key="levelOneValue" value="0.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="LightningDensity30min"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="Cloud-to-Ground Lightning Probability (0-30 min.)" id="LightProb30min">
<substitute key="levelOneValue" value="500.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="LightningProbabilityNext30min"/>
</contribute>
</contribute>
<contribute xsi:type="subMenu" menuText="Precipitation Products" id="MRMS_PRECIPITATION">
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="Surface Precipitation Type (SPT)" id="SfcPrecipType">
<substitute key="levelOneValue" value="0.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="PrecipType"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="Surface Precipitation Rate (SPR)" id="RadarPrecipRate">
<substitute key="levelOneValue" value="0.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="PrecipRate"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="Radar Quality Index (RQI)" id="RadarQualityIndex">
<substitute key="levelOneValue" value="0.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="RadarQualityIndex"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="Seamless Hybrid Scan Reflectivity (SHSR)" id="SHSRVPR">
<substitute key="levelOneValue" value="0.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="SeamlessHSR"/>
</contribute>
<contribute xsi:type="subMenu" menuText="QPE - Radar Only">
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="1 hour Accumulation" id="RadarOnly01hr">
<substitute key="levelOneValue" value="0.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="RadarOnlyQPE01H"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="3 hour Accumulation" id="RadarOnly03hr">
<substitute key="levelOneValue" value="0.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="RadarOnlyQPE03H"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="6 hour Accumulation" id="RadarOnly06hr">
<substitute key="levelOneValue" value="0.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="RadarOnlyQPE06H"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="12 hour Accumulation" id="RadarOnly12hr">
<substitute key="levelOneValue" value="0.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="RadarOnlyQPE12H"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="24 hour Accumulation" id="RadarOnly24hr">
<substitute key="levelOneValue" value="0.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="RadarOnlyQPE24H"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="48 hour Accumulation" id="RadarOnly48hr">
<substitute key="levelOneValue" value="0.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="RadarOnlyQPE48H"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="72 hour Accumulation" id="RadarOnly72hr">
<substitute key="levelOneValue" value="0.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="RadarOnlyQPE72H"/>
</contribute>
</contribute>
<contribute xsi:type="subMenu" menuText="QPE - Gauge Only">
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="1 hour Accumulation" id="GaugeOnly01hr">
<substitute key="levelOneValue" value="0.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="GaugeOnlyQPE01H"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="3 hour Accumulation" id="GaugeOnly03hr">
<substitute key="levelOneValue" value="0.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="GaugeOnlyQPE03H"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="6 hour Accumulation" id="GaugeOnly06hr">
<substitute key="levelOneValue" value="0.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="GaugeOnlyQPE06H"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="12 hour Accumulation" id="GaugeOnly12hr">
<substitute key="levelOneValue" value="0.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="GaugeOnlyQPE12H"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="24 hour Accumulation" id="GaugeOnly24hr">
<substitute key="levelOneValue" value="0.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="GaugeOnlyQPE24H"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="48 hour Accumulation" id="GaugeOnly48hr">
<substitute key="levelOneValue" value="0.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="GaugeOnlyQPE48H"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="72 hour Accumulation" id="GaugeOnly72hr">
<substitute key="levelOneValue" value="0.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="GaugeOnlyQPE72H"/>
</contribute>
</contribute>
<contribute xsi:type="subMenu" menuText="QPE - Radar w/ Gauge Bias Correction">
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="1 hour Accumulation" id="GaugeCorr01hr">
<substitute key="levelOneValue" value="0.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="GaugeCorrQPE01H"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="3 hour Accumulation" id="GaugeCorr03hr">
<substitute key="levelOneValue" value="0.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="GaugeCorrQPE03H"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="6 hour Accumulation" id="GaugeCorr06hr">
<substitute key="levelOneValue" value="0.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="GaugeCorrQPE06H"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="12 hour Accumulation" id="GaugeCorr12hr">
<substitute key="levelOneValue" value="0.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="GaugeCorrQPE12H"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="24 hour Accumulation" id="GaugeCorr24hr">
<substitute key="levelOneValue" value="0.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="GaugeCorrQPE24H"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="48 hour Accumulation" id="GaugeCorr48hr">
<substitute key="levelOneValue" value="0.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="GaugeCorrQPE48H"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="72 hour Accumulation" id="GaugeCorr72hr">
<substitute key="levelOneValue" value="0.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="GaugeCorrQPE72H"/>
</contribute>
</contribute>
<contribute xsi:type="subMenu" menuText="QPE - Mountain Mapper">
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="1 hour Accumulation" id="MountainMapper01hr">
<substitute key="levelOneValue" value="0.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="MountainMapperQPE01H"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="3 hour Accumulation" id="MountainMapper03hr">
<substitute key="levelOneValue" value="0.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="MountainMapperQPE03H"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="6 hour Accumulation" id="MountainMapper06hr">
<substitute key="levelOneValue" value="0.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="MountainMapperQPE06H"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="12 hour Accumulation" id="MountainMapper12hr">
<substitute key="levelOneValue" value="0.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="MountainMapperQPE12H"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="24 hour Accumulation" id="MountainMapper24hr">
<substitute key="levelOneValue" value="0.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="MountainMapperQPE24H"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="48 hour Accumulation" id="MountainMapper48hr">
<substitute key="levelOneValue" value="0.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="MountainMapperQPE48H"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="72 hour Accumulation" id="MountainMapper72hr">
<substitute key="levelOneValue" value="0.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="MountainMapperQPE72H"/>
</contribute>
</contribute>
</contribute>
<contribute xsi:type="subMenu" menuText="Reflectivity Products" id="MRMS_REFLECTIVITY">
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="Composite Reflectivity" id="CompZ">
<substitute key="levelOneValue" value="500.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="MergedReflectivityQCComposite"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="Composite Reflectivity Height" id="CompZH">
<substitute key="levelOneValue" value="500.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="HeightCompositeReflectivity"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="Reflectivity At Lowest Altitude (RALA)" id="REFLA">
<substitute key="levelOneValue" value="500.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="ReflectivityAtLowestAltitude"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="Vertically Integrated Ice (VII)" id="VII">
<substitute key="levelOneValue" value="500.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="VII"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="Vertically Integrated Liquid (VIL)" id="MRMSVIL">
<substitute key="levelOneValue" value="500.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="MRMSVIL"/>
</contribute>
<contribute xsi:type="subMenu" menuText="Echo Tops" id="MRMS_ECHO">
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="18 dBZ Echo Top" id="18ET">
<substitute key="levelOneValue" value="500.0" />
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="EchoTop18"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="30 dBZ Echo Top" id="30ET">
<substitute key="levelOneValue" value="500.0" />
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="EchoTop30"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="50 dBZ Echo Top" id="50ET">
<substitute key="levelOneValue" value="500.0" />
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="EchoTop50"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="60 dBZ Echo Top" id="60ET">
<substitute key="levelOneValue" value="500.0" />
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="EchoTop60"/>
</contribute>
</contribute>
<contribute xsi:type="subMenu" menuText="Isothermal Reflectivity" id="REF_ISOTHERMAL">
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="Reflectivity at 0°C" id="REF0C">
<substitute key="levelOneValue" value="500.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="Reflectivity0C"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="Reflectivity at -5°C" id="REFM5C">
<substitute key="levelOneValue" value="500.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="ReflectivityM5C"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="Reflectivity at -10°C" id="REFM10C">
<substitute key="levelOneValue" value="500.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="ReflectivityM10C"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="Reflectivity at -15°C" id="REFM15C">
<substitute key="levelOneValue" value="500.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="ReflectivityM15C"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="Reflectivity at -20°C" id="REFM20C">
<substitute key="levelOneValue" value="500.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="ReflectivityM20C"/>
</contribute>
</contribute>
<contribute xsi:type="subMenu" menuText="Thickness" id="REF_THICKNESS">
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="Height of 50dBZ Echo Above -20°C" id="H50253">
<substitute key="levelOneValue" value="500.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="H50AboveM20C"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="Height of 60dBZ Echo Above -20°C" id="H60253">
<substitute key="levelOneValue" value="500.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="H60AboveM20C"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="Height of 50dBZ Echo Above 0°C" id="H50273">
<substitute key="levelOneValue" value="500.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="H50Above0C"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="Height of 60dBZ Echo Above 0°C" id="H60273">
<substitute key="levelOneValue" value="500.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="H60Above0C"/>
</contribute>
</contribute>
</contribute>
<contribute xsi:type="subMenu" menuText="Velocity Products" id="MRMS_VELOCITY">
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="Low-Level Azimuthal Shear (0-2km AGL)" id="AZ02">
<substitute key="levelOneValue" value="500.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="MergedAzShear02kmAGL"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="Low-Level Rotation Tracks (30 min. accum.)" id="ROTLL30">
<substitute key="levelOneValue" value="500.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="RotationTrackLL30min"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="Low-Level Rotation Tracks (60 min. accum.)" id="ROTLL60">
<substitute key="levelOneValue" value="500.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="RotationTrackLL60min"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="Low-Level Rotation Tracks (120 min. accum.)" id="ROTLL120">
<substitute key="levelOneValue" value="500.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="RotationTrackLL120min"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="Low-Level Rotation Tracks (240 min. accum.)" id="ROTLL240">
<substitute key="levelOneValue" value="500.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="RotationTrackLL240min"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="Low-Level Rotation Tracks (360 min. accum.)" id="ROTLL360">
<substitute key="levelOneValue" value="500.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="RotationTrackLL360min"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="Low-Level Rotation Tracks (1440 min. accum.)" id="ROTLL1440">
<substitute key="levelOneValue" value="500.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="RotationTrackLL1440min"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="Mid-Level Azimuthal Shear (3-6km AGL)" id="AZ36">
<substitute key="levelOneValue" value="500.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="MergedAzShear36kmAGL"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="Mid-Level Rotation Tracks (30 min. accum.)" id="ROTML30">
<substitute key="levelOneValue" value="500.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="RotationTrackML30min"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="Mid-Level Rotation Tracks (60 min. accum.)" id="ROTML60">
<substitute key="levelOneValue" value="500.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="RotationTrackML60min"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="Mid-Level Rotation Tracks (120 min. accum.)" id="ROTML120">
<substitute key="levelOneValue" value="500.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="RotationTrackML120min"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="Mid-Level Rotation Tracks (240 min. accum.)" id="ROTML240">
<substitute key="levelOneValue" value="500.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="RotationTrackML240min"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="Mid-Level Rotation Tracks (360 min. accum.)" id="ROTML360">
<substitute key="levelOneValue" value="500.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="RotationTrackML360min"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mrms/mrms2D.xml" menuText="Mid-Level Rotation Tracks (1440 min. accum.)" id="ROTML1440">
<substitute key="levelOneValue" value="500.0"/>
<substitute key="datasetID" value="MRMS"/>
<substitute key="parameterID" value="RotationTrackML1440min"/>
</contribute>
</contribute>
</menuTemplate>

View file

@ -130,6 +130,7 @@ import com.vividsolutions.jts.geom.Coordinate;
* instead of raw float data.
* Feb 28, 2014 2791 bsteffen Switch all data to use data source.
* Aug 21, 2014 DR 17313 jgerth Implements ImageProvider
* Oct 07, 2014 3668 bclement Renamed requestJob to requestRunner
*
* </pre>
*
@ -156,7 +157,7 @@ public abstract class AbstractGridResource<T extends AbstractResourceData>
public static final String INTERROGATE_DIRECTION = "direction";
private final GridDataRequestJob requestJob;
private final GridDataRequestRunner requestRunner;
private Map<DataTime, List<PluginDataObject>> pdoMap = new ConcurrentHashMap<DataTime, List<PluginDataObject>>();
@ -214,7 +215,7 @@ public abstract class AbstractGridResource<T extends AbstractResourceData>
}
});
dataTimes = new ArrayList<DataTime>();
requestJob = new GridDataRequestJob(this);
requestRunner = new GridDataRequestRunner(this);
// Capabilities need to be inited in construction for things like the
// image combination tool.
initCapabilities();
@ -254,7 +255,7 @@ public abstract class AbstractGridResource<T extends AbstractResourceData>
}
}
}
requestJob.remove(time);
requestRunner.remove(time);
dataMap.remove(time);
if (!dataTimes.contains(dataTimes)) {
dataTimes.add(time);
@ -643,10 +644,10 @@ public abstract class AbstractGridResource<T extends AbstractResourceData>
List<PluginDataObject> pdos) throws VizException;
protected List<GeneralGridData> requestData(DataTime time) {
synchronized (requestJob) {
synchronized (requestRunner) {
List<GeneralGridData> data = this.dataMap.get(time);
if (data == null) {
data = requestJob.requestData(time, pdoMap.get(time));
data = requestRunner.requestData(time, pdoMap.get(time));
if (data != null) {
data = mergeData(data);
this.dataMap.put(time, data);
@ -898,7 +899,7 @@ public abstract class AbstractGridResource<T extends AbstractResourceData>
public void remove(DataTime dataTime) {
pdoMap.remove(dataTime);
dataMap.remove(dataTime);
requestJob.remove(dataTime);
requestRunner.remove(dataTime);
dataTimes.remove(dataTime);
synchronized (renderableMap) {
List<IRenderable> renderableList = renderableMap.remove(dataTime);
@ -940,7 +941,7 @@ public abstract class AbstractGridResource<T extends AbstractResourceData>
*
*/
protected void clearRequestedData() {
requestJob.stopAndClear();
requestRunner.stopAndClear();
synchronized (renderableMap) {
for (List<IRenderable> renderableList : renderableMap.values()) {
for (IRenderable renderable : renderableList) {

View file

@ -22,11 +22,8 @@ package com.raytheon.viz.grid.rsc.general;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.status.IUFStatusHandler;
@ -37,7 +34,7 @@ import com.raytheon.uf.viz.core.exception.VizException;
/**
*
* A Job for asynchronously requesting data for GridResources.
* Manages asynchronously requesting data for GridResources.
*
* <pre>
*
@ -49,16 +46,24 @@ import com.raytheon.uf.viz.core.exception.VizException;
* Jun 04, 2013 2041 bsteffen Improve exception handing in grid
* resources.
* Jun 24, 2013 2140 randerso Moved safe name code into AbstractVizResource
* Oct 07, 2014 3668 bclement uses executor instead of eclipse job
* renamed to GridDataRequestRunner
*
* </pre>
*
* @author bsteffen
* @version 1.0
*/
class GridDataRequestJob extends Job {
class GridDataRequestRunner implements Runnable {
private static final int POOL_SIZE = Integer.getInteger(
"grid.request.pool.size", 10);
private static final Executor executor = Executors
.newFixedThreadPool(POOL_SIZE);
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(GridDataRequestJob.class);
.getHandler(GridDataRequestRunner.class);
private static class GridDataRequest {
@ -90,17 +95,18 @@ class GridDataRequestJob extends Job {
}
private volatile boolean cancelled = false;
private AbstractGridResource<?> resource;
private List<GridDataRequest> requests = new ArrayList<GridDataRequest>();
public GridDataRequestJob(AbstractGridResource<?> resource) {
super("Requesting Gridded Data");
public GridDataRequestRunner(AbstractGridResource<?> resource) {
this.resource = resource;
}
@Override
protected IStatus run(IProgressMonitor monitor) {
public void run() {
for (GridDataRequest request = getNext(); request != null; request = getNext()) {
try {
request.gridData = resource.getData(request.time, request.pdos);
@ -117,13 +123,17 @@ class GridDataRequestJob extends Job {
request.exception = e;
resource.issueRefresh();
}
if (monitor.isCanceled()) {
if (cancelled) {
break;
}
}
return Status.OK_STATUS;
}
/**
* Get the next request that should be sent
*
* @return null if no request should be sent
*/
protected GridDataRequest getNext() {
synchronized (requests) {
for (GridDataRequest request : requests) {
@ -135,6 +145,11 @@ class GridDataRequestJob extends Job {
return null;
}
/**
* @param time
* @param pdos
* @return null if no requests matching time have been fulfilled
*/
public List<GeneralGridData> requestData(DataTime time,
List<PluginDataObject> pdos) {
GridDataRequest request = new GridDataRequest(time, pdos);
@ -164,6 +179,14 @@ class GridDataRequestJob extends Job {
return null;
}
/**
* send current requests
*/
private void schedule() {
cancelled = false;
executor.execute(this);
}
private void handleExceptions() {
List<GridDataRequest> failedRequests = new ArrayList<GridDataRequest>(
@ -247,4 +270,11 @@ class GridDataRequestJob extends Job {
this.cancel();
}
/**
* cancel current request
*/
private void cancel() {
cancelled = true;
}
}

View file

@ -14,7 +14,7 @@
</configIni>
<launcherArgs>
<programArgs>-data @user.home/caveData -user @user.home/caveData -clean</programArgs>
<programArgs>-data @user.home/caveData -user @user.home/caveData</programArgs>
<programArgsLin>-consoleLog</programArgsLin>
<vmArgs>-XX:+UseG1GC
-Dosgi.instance.area.readOnly=true

View file

@ -59,8 +59,5 @@ eclipse.product=com.raytheon.viz.product.awips
# The build identifier
# eclipse.buildId=I20050627-1435
#uncomment if you want to use thrift for hdf5 access instead of filesystem
#awips.mode=pypies
# End of file marker - must be here
eof=eof

View file

@ -60,7 +60,6 @@
</properties>
<resourceData xsi:type="bestResResourceData"
productIdentifierKey="productCode" retrieveData="false">
<enabler xsi:type="radarSpatialEnabler" />
<metadataMap>
<mapping key="productCode">
<constraint constraintValue="37,35" constraintType="IN" />
@ -130,7 +129,6 @@
<properties isSystemResource="false" isBlinking="false" isMapLayer="false" isHoverOn="false" isVisible="true">
</properties>
<resourceData xsi:type="bestResResourceData" productIdentifierKey="productCode" retrieveData="false">
<enabler xsi:type="radarSpatialEnabler" />
<metadataMap>
<mapping key="productCode">
<constraint constraintValue="38,36" constraintType="IN" />
@ -211,7 +209,6 @@
</properties>
<resourceData xsi:type="bestResResourceData"
productIdentifierKey="productCode" retrieveData="false">
<enabler xsi:type="radarSpatialEnabler" />
<metadataMap>
<mapping key="productCode">
<constraint constraintValue="153,94,19,20"

View file

@ -70,7 +70,6 @@
</properties>
<resourceData xsi:type="bestResResourceData"
productIdentifierKey="productCode" retrieveData="false">
<enabler xsi:type="radarSpatialEnabler" />
<metadataMap>
<mapping key="productCode">
<constraint constraintValue="37,35" constraintType="IN" />
@ -159,7 +158,6 @@
</properties>
<resourceData xsi:type="bestResResourceData"
productIdentifierKey="productCode" retrieveData="false">
<enabler xsi:type="radarSpatialEnabler" />
<metadataMap>
<mapping key="productCode">
<constraint constraintValue="38,36" constraintType="IN" />

View file

@ -59,7 +59,6 @@
<properties isSystemResource="false" isBlinking="false" isMapLayer="false" isHoverOn="false" isVisible="true">
</properties>
<resourceData xsi:type="bestResResourceData" productIdentifierKey="productCode" retrieveData="false">
<enabler xsi:type="radarSpatialEnabler" />
<metadataMap>
<mapping key="productCode">
<constraint constraintValue="37,36,57" constraintType="IN" />

View file

@ -104,7 +104,6 @@
<properties isSystemResource="false" isBlinking="false" isMapLayer="false" isHoverOn="false" isVisible="true">
</properties>
<resourceData xsi:type="bestResResourceData" productIdentifierKey="productCode" retrieveData="false">
<enabler xsi:type="radarSpatialEnabler" />
<metadataMap>
<mapping key="productCode">
<constraint constraintValue="153,94,19,20" constraintType="IN" />

View file

@ -97,7 +97,6 @@
</properties>
<resourceData xsi:type="bestResResourceData"
productIdentifierKey="productCode" retrieveData="false">
<enabler xsi:type="radarSpatialEnabler" />
<metadataMap>
<mapping key="productCode">
<constraint constraintValue="37,35" constraintType="IN" />
@ -167,7 +166,6 @@
<properties isSystemResource="false" isBlinking="false" isMapLayer="false" isHoverOn="false" isVisible="true">
</properties>
<resourceData xsi:type="bestResResourceData" productIdentifierKey="productCode" retrieveData="false">
<enabler xsi:type="radarSpatialEnabler" />
<metadataMap>
<mapping key="productCode">
<constraint constraintValue="38,36" constraintType="IN" />

View file

@ -62,7 +62,6 @@
</properties>
<resourceData xsi:type="bestResResourceData"
productIdentifierKey="productCode" retrieveData="false">
<enabler xsi:type="radarSpatialEnabler" />
<metadataMap>
<mapping key="productCode">
<constraint constraintValue="37,35" constraintType="IN" />
@ -132,7 +131,6 @@
<properties isSystemResource="false" isBlinking="false" isMapLayer="false" isHoverOn="false" isVisible="true">
</properties>
<resourceData xsi:type="bestResResourceData" productIdentifierKey="productCode" retrieveData="false">
<enabler xsi:type="radarSpatialEnabler" />
<metadataMap>
<mapping key="productCode">
<constraint constraintValue="38,36,57" constraintType="IN" />

View file

@ -22,50 +22,28 @@ package com.raytheon.viz.radar;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.dataplugin.radar.RadarRecord;
import com.raytheon.uf.viz.core.rsc.AbstractRequestableResourceData;
import com.raytheon.viz.core.rsc.AbstractSpatialEnabler;
import com.raytheon.viz.radar.rsc.RadarResourceData;
/**
* TODO Add Description
* @deprecated do not use this class, it only exists for XML compatibility.
*
* <pre>
* <pre>
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 2, 2010 mnash Initial creation
* Sep 26, 2014 3669 bsteffen Deprecate
*
* </pre>
*
* @author mnash
* @version 1.0
*/
@Deprecated
@XmlAccessorType(XmlAccessType.NONE)
public class RadarSpatialEnabler extends AbstractSpatialEnabler {
public final class RadarSpatialEnabler extends AbstractSpatialEnabler {
private final String elevAngle = "primaryElevationAngle";
/* Empty due to deprecation */
public RadarSpatialEnabler() {
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.viz.core.rsc.AbstractSpatialEnabler#enable(com.raytheon.
* uf.common.dataplugin.PluginDataObject,
* com.raytheon.uf.viz.core.rsc.AbstractRequestableResourceData)
*/
@Override
public void enable(PluginDataObject d, AbstractRequestableResourceData arrd) {
if (arrd instanceof RadarResourceData && d instanceof RadarRecord) {
RadarRecord rr = (RadarRecord) d;
RadarResourceData rrd = (RadarResourceData) arrd;
rr.setAddSpatial(!rrd.isLatest());
}
}
}

View file

@ -44,7 +44,7 @@ import com.raytheon.uf.viz.core.requests.ThriftClient;
import com.raytheon.uf.viz.personalities.cave.workbench.VizWorkbenchAdvisor;
/**
* AWIPS {@link VizWorkbenchAdvisor} that reqeusts menu creation service to run
* AWIPS {@link VizWorkbenchAdvisor} that requests menu creation service to run
* before discovering dynamic menus
*
* <pre>
@ -54,6 +54,7 @@ import com.raytheon.uf.viz.personalities.cave.workbench.VizWorkbenchAdvisor;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 20, 2013 mschenke Initial creation
* Oct 01, 2014 3679 njensen Fix propertyChange() for logPerformance
*
* </pre>
*
@ -81,7 +82,8 @@ public class AWIPSWorkbenchAdvisor extends VizWorkbenchAdvisor {
public void propertyChange(PropertyChangeEvent event) {
if (PreferenceConstants.P_LOG_PERF.equals(event
.getProperty())) {
Boolean log = (Boolean) event.getNewValue();
Boolean log = Boolean.valueOf(event.getNewValue()
.toString());
if (log != logPeformance) {
toggleLogging();
}

View file

@ -38,6 +38,7 @@
<Level displayName="Surface" key="Surface">
<DatabaseLevel levelName="SFC" levelOneValue="0.0" />
<DatabaseLevel levelName="MSL" levelOneValue="0.0" />
<DatabaseLevel levelName="FH" levelOneValue="0.0" />
</Level>
<Level displayName="10FHAG" key="10FHAG">
<DatabaseLevel levelName="FHAG" levelOneValue="10.0" />

View file

@ -24,6 +24,7 @@
<vbSource key="AK-NamDNG5" category="SfcGrid" views="PLANVIEW TIMESERIES" />
<vbSource key="AK-NICICE" category="SfcGrid" views="PLANVIEW TIMESERIES" />
<vbSource key="AK-RTMA" category="SfcGrid" views="PLANVIEW TIMESERIES" />
<vbSource key="AK-RTMA3" category="SfcGrid" views="PLANVIEW TIMESERIES" />
<vbSource key="AKWAVE239" category="SfcGrid" views="PLANVIEW TIMESERIES" />
<vbSource key="AKwave10" category="SfcGrid" views="PLANVIEW TIMESERIES" />
<vbSource key="AKwave4" category="SfcGrid" views="PLANVIEW TIMESERIES" />
@ -37,6 +38,7 @@
<vbSource key="EPwave10" category="SfcGrid" views="PLANVIEW TIMESERIES" />
<vbSource key="estofsUS" category="SfcGrid" views="PLANVIEW TIMESERIES" />
<vbSource key="estofsPR" category="SfcGrid" views="PLANVIEW TIMESERIES" />
<vbSource key="GFE" category="SfcGrid" views="PLANVIEW TIMESERIES" />
<vbSource key="GFS199" category="SfcGrid" views="PLANVIEW TIMESERIES" />
<vbSource key="GFSGuide" category="SfcGrid" views="PLANVIEW TIMESERIES" />
<vbSource key="GFSLAMPTstorm" name="GFSLAMP-Grid" category="SfcGrid"
@ -95,7 +97,7 @@
subCategory="Global" views="PLANVIEW TIMESERIES" />
<vbSource key="RTOFS-GulfAlaska" category="SfcGrid/RTOFS/forecast"
subCategory="Global" views="PLANVIEW TIMESERIES" />
<vbSource key="RTOFS-Honolulu" category="SfcGrid/RTOFS/forecast"
<vbSource key="RTOFS-Honolulu" category="SfcGrid/RTOFS/forecast"
subCategory="Global" views="PLANVIEW TIMESERIES" />
<vbSource key="RTOFS-HudsonBaffin" category="SfcGrid/RTOFS/forecast"
subCategory="Global" views="PLANVIEW TIMESERIES" />

View file

@ -43,6 +43,21 @@
<vbSource key="GEFS" category="Volume" />
<vbSource key="ENSEMBLE" category="Volume" views="PLANVIEW TIMESERIES" />
<vbSource key="AVN-NorthernHemisphere" category="Volume" />
<vbSource key="HFR-EAST_6KM" category="Volume" views="PLANVIEW TIMESERIES" />
<vbSource key="HFR-US_EAST_DELAWARE_1KM" category="Volume" views="PLANVIEW TIMESERIES" />
<vbSource key="HFR-US_EAST_FLORIDA_2KM" category="Volume" views="PLANVIEW TIMESERIES" />
<vbSource key="HFR-US_EAST_NORTH_2KM" category="Volume" views="PLANVIEW TIMESERIES" />
<vbSource key="HFR-US_EAST_SOUTH_2KM" category="Volume" views="PLANVIEW TIMESERIES" />
<vbSource key="HFR-US_EAST_VIRGINIA_1KM" category="Volume" views="PLANVIEW TIMESERIES" />
<vbSource key="HFR-US_HAWAII_1KM" category="Volume" views="PLANVIEW TIMESERIES" />
<vbSource key="HFR-US_HAWAII_2KM" category="Volume" views="PLANVIEW TIMESERIES" />
<vbSource key="HFR-WEST_6KM" category="Volume" views="PLANVIEW TIMESERIES" />
<vbSource key="HFR-US_WEST_CENCAL_2KM" category="Volume" views="PLANVIEW TIMESERIES" />
<vbSource key="HFR-US_WEST_NORTH_2KM" category="Volume" views="PLANVIEW TIMESERIES" />
<vbSource key="HFR-US_WEST_SANFRAN_1KM" category="Volume" views="PLANVIEW TIMESERIES" />
<vbSource key="HFR-US_WEST_SOCAL_2KM" category="Volume" views="PLANVIEW TIMESERIES" />
<vbSource key="HFR-US_WEST_LOSANGELES_1KM" category="Volume" views="PLANVIEW TIMESERIES" />
<vbSource key="HFR-US_WEST_LOSOSOS_1KM" category="Volume" views="PLANVIEW TIMESERIES" />
<vbSource key="HiResW-ARW-AK" category="Volume" />
<vbSource key="HiResW-ARW-East" category="Volume" />
<vbSource key="HiResW-ARW-GU" category="Volume" />
@ -64,7 +79,6 @@
<vbSource key="ETA" category="Volume" />
<vbSource key="ETA207" category="Volume" />
<vbSource key="NOGAPS" category="Volume" />
<vbSource key="radar" name="Radar" category="Volume" />
<vbSource key="RUC130" category="Volume" />
<vbSource key="RAP200" category="Volume" />
<vbSource key="RUC236" category="Volume" />
@ -74,4 +88,5 @@
<vbSource key="GFS161" category="Volume" />
<vbSource key="SREF212" category="Volume" views="PLANVIEW TIMESERIES" />
<vbSource key="UKMET-NorthernHemisphere" category="Volume" />
<vbSource key="radar" name="Radar" category="Volume" />
</vbSourceList>

View file

@ -23,6 +23,7 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.regex.Pattern;
@ -85,6 +86,9 @@ import com.raytheon.viz.volumebrowser.xml.VbSourceList;
* Dec 11, 2013 2602 bsteffen Remove dead catch block.
* Mar 18, 2014 2874 bsteffen Move creation of Sources toolbar
* contributions to VbSourceList
* Oct 03, 2014 2618 mapeters Updated pointChangeListener's pointChanged()
* implementation to fully remove deleted points,
* added createUniqueKey(String, String, String).
*
* </pre>
*
@ -818,11 +822,57 @@ public class DataListsProdTableComp extends Composite implements
public void run() {
MenuItemManager menuItemMgr = MenuItemManager
.getInstance();
HashMap<String, Object> planeListItemsMap = planeControl.list
.getAvailableKeys();
Set<String> planeListItems = planeListItemsMap
.keySet();
Collection<String> points = PointsDataManager
.getInstance().getPointNames();
Set<String> deletedPoints = new HashSet<String>(0);
Set<String> planeListItems = planeControl.list
.getAvailableKeys().keySet();
int[] sourcesSelIdx = sourceControl.list
.getSelectedIndexes();
int[] fieldsSelIdx = fieldControl.list
.getSelectedIndexes();
for (String point : planeListItems) {
/*
* PointsDataManager point names are stored as
* "A", planeListItems are "PointA"
*/
if (point.length() >= 5
&& !points.contains(point.substring(5))) {
deletedPoints.add(point);
String uniqueKey;
for (int s : sourcesSelIdx) {
for (int f : fieldsSelIdx) {
/*
* Build unique product identifier
* for deleted planes items with
* each selected source/field
*/
uniqueKey = createUniqueKey(
sourceControl.list
.createUniqueKey(s),
fieldControl.list
.createUniqueKey(f),
point);
// Update products list
prodTable.removeProduct(uniqueKey);
}
}
}
}
planeListItems.removeAll(deletedPoints);
// Update selected items in planes table
planeControl.list
.retainMatchingItems(planeListItemsMap);
menuItemMgr.clearPlanesMap();
// Update selected items in planes drop-down menu
menuItemMgr.setSelectedPlaneItems(planeListItems);
pta.resetMenu();
}
@ -997,12 +1047,27 @@ public class DataListsProdTableComp extends Composite implements
* @return The unique key string.
*/
private String createUniqueKey(int sourceIdx, int fieldsIdx, int planesIdx) {
return createUniqueKey(sourceControl.list.createUniqueKey(sourceIdx),
fieldControl.list.createUniqueKey(fieldsIdx),
planeControl.list.createUniqueKey(planesIdx));
}
/**
* Create a unique key that will be used to track if a product is in the
* product table.
*
* @param source
* The selected item in the Sources list control.
* @param field
* The selected item in the Fields list control.
* @param plane
* The selected item in the Planes list control.
* @return The unique key string.
*/
private String createUniqueKey(String source, String field, String plane) {
StringBuilder sb = new StringBuilder();
sb.append(sourceControl.list.createUniqueKey(sourceIdx)).append("::")
.append(fieldControl.list.createUniqueKey(fieldsIdx))
.append("::")
.append(planeControl.list.createUniqueKey(planesIdx));
sb.append(source).append("::").append(field).append("::").append(plane);
return sb.toString();
}

View file

@ -379,14 +379,11 @@ public class WarngenLayer extends AbstractStormTrackResource {
private Set<String> mapsToLoad;
private Set<String> preloadedMaps;
private final MapManager manager;
public CustomMaps() {
super("Loading WarnGen Maps");
manager = MapManager.getInstance(descriptor);
preloadedMaps=new HashSet<String>();
}
@Override
@ -403,15 +400,15 @@ public class WarngenLayer extends AbstractStormTrackResource {
if (toLoad != null) {
for (String loaded : customMaps) {
if (!preloadedMaps.contains(loaded)) {
manager.unloadMap(loaded);
manager.unloadMap(loaded);
}
customMaps.clear();
for (String load : toLoad) {
if (!manager.isMapLoaded(load)) {
manager.loadMapByName(load);
customMaps.add(load);
}
}
for (String load : toLoad) {
manager.loadMapByName(load);
}
customMaps = toLoad;
issueRefresh();
}
@ -421,11 +418,6 @@ public class WarngenLayer extends AbstractStormTrackResource {
}
public void loadCustomMaps(Collection<String> maps) {
for (String map : maps) {
if (manager.isMapLoaded(map)) {
preloadedMaps.add(map);
}
}
synchronized (this) {
mapsToLoad = new HashSet<String>(maps);
}

View file

@ -15,50 +15,61 @@
#clean up platform dictionary
#
cmddir=$(dirname $_)
FNAME="spelldict"
user=$(whoami)
host=$(hostname)
stddict=$cmddir/$FNAME.std
[ ! -f $stddict ] && {
echo Error: the standard dictionary \"$stddict\" not found.
exit 1
}
edex_user_dir=/awips2/edex/data/utility/cave_static/user/
cave_etc=/awips2/cave/etc
run_type=0
FNAME="spelldict"
clean () {
lines=`cat $1 |wc -l`
size=`cat $1 |wc -c`
MSG="$1, size=$size, #line=$lines:"
LASTWD=$(grep 'zymurgy' $1)
if [ $size -eq 1290760 ]
if [ $run_type == 1 ]
then
remove $1
# elif [ $lines -gt 135553 ]
# then
# [ $run_type == 1 ] && (cp $1 "$1.bak";
# sed -n "135554,${lines}p" "$1.bak" > $1)
# let "newlines=${lines}-135553"
# echo $MSG modified, \#line=$(( lines-135553 ))
elif [ "$LASTWD" ]
then
line=$(sed -n "/^$LASTWD/=" $1)
# echo line=$line
[ $run_type == 1 ] && (cp -p $1 "$1.bak"; sed "1, /^$LASTWD/d" "$1.bak" > $1)
echo $MSG "modified, #line=$(( lines-line ))"
cp -p $1 "$1.bak"
cp $stddict $1
if [ "$LASTWD" ]
then
sed "1, /^$LASTWD/d" "$1.bak" >> $1
else
cat $1.bak >> $1
fi
echo "$MSG modified, #line=$(cat $1 |wc -l)"
else
echo $MSG unchanged
echo $MSG "modified"
fi
}
remove () {
lines=`cat $1 |wc -l`
size=`cat $1 |wc -c`
if [ $run_type == 1 ]
if [ $run_type == 1 ] && [ -f $1 ]
then
cp -p $1 "$1.bak"
mv $1 "$1.bak"
[[ $1 == ${cave_etc}* ]] && cat /dev/null > $1 || rm -f $1
fi
action=$([[ $1 == ${cave_etc}* ]] && echo emptied || echo removed )
echo "$1, size=$size, #line=$lines: $action"
echo "$1, removed"
}
create () {
[ $run_type == 1 ] && (
cp $stddict $1
chown awips $1
chgrp fxalpha $1
chmod 644 $1
)
echo "$1, created the standard dictionary"
}
usage () {
@ -110,11 +121,7 @@ then
then
clean $f
else
cat /dev/null > $f
chown awips $f
chgrp fxalpha $f
chmod 644 $f
echo $f: created, size=0
create $f
fi
fi

View file

@ -0,0 +1,41 @@
#!/bin/bash
# DR #3644 - this update script will drop the dataURI column from ccfp
PSQL="/awips2/psql/bin/psql"
# takes one arg: a table name
# drops the datauri constraint and column if they exist
function dropDatauri {
echo "INFO: Dropping DataURI column from $1"
${PSQL} -U awips -d metadata -c "ALTER TABLE $1 DROP CONSTRAINT IF EXISTS ${1}_datauri_key;"
${PSQL} -U awips -d metadata -c "ALTER TABLE $1 DROP COLUMN IF EXISTS datauri;"
if [ $? -ne 0 ]; then
echo "ERROR: Failed to drop dataURI column for $table"
echo "FATAL: The update has failed."
exit 1
fi
}
# takes three args: table, constraint name, unique columns
# will first drop the constraint if it exists and then adds it back, this is
# fairly inefficient if it does exist but operationally it won't exist and for
# testing this allows the script to be run easily as a noop.
function dropDatauriAndAddConstraint {
dropDatauri $1
${PSQL} -U awips -d metadata -c "ALTER TABLE $1 DROP CONSTRAINT IF EXISTS $2;"
${PSQL} -U awips -d metadata -c "ALTER TABLE $1 ADD CONSTRAINT $2 UNIQUE $3;"
if [ $? -ne 0 ]; then
echo "ERROR: Failed to add new unique constraint for $table"
echo "FATAL: The update has failed."
exit 1
fi
}
echo "INFO: Dropping ccfp dataURI columns."
dropDatauriAndAddConstraint ccfp ccfp_reftime_producttype_boxlat_boxlong_key "(reftime, producttype, boxlat, boxlong)"
${PSQL} -U awips -d metadata -c "DROP INDEX ccfp_reftimeindex;"
${PSQL} -U awips -d metadata -c "CREATE INDEX ccfp_reftimeindex ON ccfp USING btree (reftime);"
${PSQL} -U awips -d metadata -c "VACUUM FULL ANALYZE ccfp"
echo "INFO: ccfp dataURI columns dropped successfully"

View file

@ -0,0 +1,30 @@
#!/bin/bash
# DR #3702 Copy text plugin_info to the fxatext database.
PSQL="/awips2/psql/bin/psql"
echo "INFO: Copying text plugin_info to fxatext database."
initialized=`$PSQL -t -U awips -d metadata -c "SELECT initialized FROM plugin_info WHERE name = 'text';"`
if [ -n "$initialized" ]; then
$PSQL -U awips -d fxatext -c "CREATE TABLE IF NOT EXISTS plugin_info(name character varying(255) NOT NULL, initialized boolean,tablename character varying(255),CONSTRAINT plugin_info_pkey PRIMARY KEY (name)); ALTER TABLE plugin_info OWNER TO awips;"
if [ $? -ne 0 ]; then
echo "ERROR: Failed to create plugin_info table in fxatext database"
echo "FATAL: The update has failed."
exit 1
fi
$PSQL -U awips -d fxatext -c "INSERT INTO plugin_info (name,initialized) VALUES ('text','$initialized');"
if [ $? -ne 0 ]; then
echo "ERROR: Failed to register text plugin in fxatext database."
echo "FATAL: The update has failed."
exit 1
fi
$PSQL -t -U awips -d metadata -c "DELETE FROM plugin_info WHERE name = 'text';"
else
echo "INFO: Nothing to do."
fi
${PSQL} -U awips -d metadata -c "ALTER TABLE plugin_info DROP COLUMN IF EXISTS database;"
echo "INFO: Done copying text plugin_info to fxatext database."

View file

@ -0,0 +1,30 @@
#!/bin/bash
# DR3708 updates collaboration config to support blacklists
IFS=$'\n'
files=`find /awips2/edex/data/utility/cave_static/*/*/collaboration/ -name 'config.xml'`
if [ $? -ne 0 ]; then
echo "No files found."
exit 1
fi
echo ""
echo "Press Enter to perform the updates Ctrl-C to quit."
read done
MY_DIR=`dirname $0`
for f in $files; do
echo "Updating $f"
xml=$(python $MY_DIR/util/updateCollaborationConfig.py $f)
if [[ $? != 0 ]]
then
echo "ERROR: Problem updating file $f"
elif [[ -n $xml ]]
then
echo $xml | xmllint --format - > $f
echo "Successfully updated"
else
echo "No update needed for $f"
fi
done

View file

@ -0,0 +1,37 @@
#!/usr/bin/env python
# DR3708 utility for updating collaboration config to support blacklists
# this script is not intended to be run standalone
# see shell script in parent directory
import sys
import xml.etree.ElementTree as ET
CONFIG_TAG="config"
LIST_TYPE_ATTRIBUTE="listType"
WHITELIST_ATTRIB_VALUE="WHITELIST"
SUB_SITE_TAG="subscribedSites"
LIST_ENTRY_TAG="listEntry"
if len(sys.argv) != 2:
sys.stderr.write("Usage: %s [xml inputfile file]" % (sys.argv[0]))
sys.exit(1)
tree = ET.parse(sys.argv[1])
root = tree.getroot()
matches = root.findall(CONFIG_TAG)
if len(matches) < 1:
sys.stderr.write("No matches found, exiting\n")
sys.exit(0)
for match in matches:
if LIST_TYPE_ATTRIBUTE not in match.attrib:
match.attrib[LIST_TYPE_ATTRIBUTE] = WHITELIST_ATTRIB_VALUE
subSites = match.findall(SUB_SITE_TAG)
for subSite in subSites :
lt = ET.SubElement(match, LIST_ENTRY_TAG)
lt.text = subSite.text
match.remove(subSite)
tree.write(sys.stdout)

View file

@ -0,0 +1,41 @@
#!/bin/bash
# DR #3722 - this update script will drop the dataURI column from taf
PSQL="/awips2/psql/bin/psql"
# takes one arg: a table name
# drops the datauri constraint and column if they exist
function dropDatauri {
echo "INFO: Dropping DataURI column from $1"
${PSQL} -U awips -d metadata -c "ALTER TABLE $1 DROP CONSTRAINT IF EXISTS ${1}_datauri_key;"
${PSQL} -U awips -d metadata -c "ALTER TABLE $1 DROP COLUMN IF EXISTS datauri;"
if [ $? -ne 0 ]; then
echo "ERROR: Failed to drop dataURI column for $table"
echo "FATAL: The update has failed."
exit 1
fi
}
# takes three args: table, constraint name, unique columns
# will first drop the constraint if it exists and then adds it back, this is
# fairly inefficient if it does exist but operationally it won't exist and for
# testing this allows the script to be run easily as a noop.
function dropDatauriAndAddConstraint {
dropDatauri $1
${PSQL} -U awips -d metadata -c "ALTER TABLE $1 DROP CONSTRAINT IF EXISTS $2;"
${PSQL} -U awips -d metadata -c "ALTER TABLE $1 ADD CONSTRAINT $2 UNIQUE $3;"
if [ $? -ne 0 ]; then
echo "ERROR: Failed to add new unique constraint for $table"
echo "FATAL: The update has failed."
exit 1
fi
}
echo "INFO: Dropping taf dataURI columns."
dropDatauriAndAddConstraint taf taf_reftime_stationid_corindicator_amdindicator_issuetimestring_key "(reftime, stationid, corindicator, amdindicator, issue_timestring)"
${PSQL} -U awips -d metadata -c "DROP INDEX taf_reftimeindex;"
${PSQL} -U awips -d metadata -c "CREATE INDEX taf_reftimeindex ON taf USING btree (reftime);"
${PSQL} -U awips -d metadata -c "VACUUM FULL ANALYZE taf"
echo "INFO: taf dataURI columns dropped successfully"

View file

@ -0,0 +1,20 @@
#!/bin/bash
# Omaha #3690: Finds empty localization directories and deletes them with the
# '-d' flag. This can improve performance in some areas of the system.
if [[ $1 == '-d' ]]
then
echo "Delete all directory trees that don't contain regular files? [y/n]"
read answer
if [[ $answer == 'y' || $answer == 'Y' ]]
then
DEL_OPTS='-delete -print'
echo "Deleting the following directories"
else
echo "Aborting"
exit 1
fi
fi
find /awips2/edex/data/utility -type d -empty $DEL_OPTS

View file

@ -172,4 +172,34 @@
<level>FHAG2</level>
</levels>
</gridParameterInfo>
<gridParameterInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="parameterInfo">
<short_name>vis</short_name>
<long_name>visibility</long_name>
<units>m</units>
<udunits>meters</udunits>
<uiname>Vis</uiname>
<valid_range>0.0</valid_range>
<valid_range>100000.0</valid_range>
<fillValue>-99999.0</fillValue>
<n3D>1</n3D>
<levelsDesc>SFC</levelsDesc>
<levels>
<level>SFC</level>
</levels>
</gridParameterInfo>
<gridParameterInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="parameterInfo">
<short_name>viserranl</short_name>
<long_name>visibility uncertainty</long_name>
<units>m</units>
<udunits>meters</udunits>
<uiname>Viserranlind</uiname>
<valid_range>0.0</valid_range>
<valid_range>100000.0</valid_range>
<fillValue>-99999.0</fillValue>
<n3D>1</n3D>
<levelsDesc>SFC</levelsDesc>
<levels>
<level>SFC</level>
</levels>
</gridParameterInfo>
</gridParamInfo>

View file

@ -1088,6 +1088,7 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis):
('SU.W', allActions, 'HighSurf'), # HIGH SURF WARNING
('SU.Y', allActions, 'HighSurf1'), # HIGH SURF ADVISORY
('RP.S', allActions, 'Rip'), # HIGH RIP CURRENT RISK
('BH.S', allActions, 'BeachHaz'), # BEACH HAZARDS STATEMENT
('AF.W', allActions, 'Ashfall2'), # VOLCANIC ASHFALL WARNING
('AF.Y', allActions, 'Ashfall'), # VOLCANIC ASHFALL ADVISORY
('TS.W', allActions, 'Tsunami'), # TSUNAMI WARNING

View file

@ -1439,13 +1439,14 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis):
# These are sorted in priority order - most important first.
def allowedHazards(self):
allActions = ["NEW", "EXA", "EXB", "EXT", "CAN", "CON", "EXP"]
tropicalActions = ["NEW", "EXA", "EXB", "EXT", "UPG", "CAN", "CON",
"EXP"]
tropicalActions = ["NEW", "EXA","UPG", "CAN", "CON"]
return [
('HU.W', tropicalActions, 'Tropical'), # HURRICANE WARNING
('SS.W', tropicalActions, 'Surge'), # Storm Surge WARNING
('TY.W', tropicalActions, 'Tropical'), # TYPHOON WARNING
('TR.W', tropicalActions, 'Tropical1'), # TROPICAL STORM WARNING
('HU.A', tropicalActions, 'Tropical'), # HURRICANE WATCH
('SS.A', tropicalActions, 'Surge'), # Storm Surge WATCH
('TY.A', tropicalActions, 'Tropical'), # TYPHOON WATCH
('TR.A', tropicalActions, 'Tropical1'), # TROPICAL STORM WATCH
('HF.W', allActions, 'Marine'), # HURRICANE FORCE WIND WARNING
@ -1498,6 +1499,7 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis):
('SU.W', allActions, 'HighSurf'), # HIGH SURF WARNING
('SU.Y', allActions, 'HighSurf'), # HIGH SURF ADVISORY
('RP.S', allActions, 'Rip'), # HIGH RIP CURRENT RISK
('BH.S', allActions, 'BeachHaz'), # BEACH HAZARDS STATEMENT
('AF.W', allActions, 'Ashfall'), # VOLCANIC ASHFALL WARNING
('AF.Y', allActions, 'Ashfall'), # VOLCANIC ASHFALL ADVISORY
('LO.Y', allActions, 'Drought'), # LOW WATER ADVISORY

View file

@ -1,19 +1,19 @@
##
# This software was developed and / or modified by Raytheon Company,
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
#
# U.S. EXPORT CONTROLLED TECHNICAL DATA
# 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
#
# 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.
##
@ -100,13 +100,15 @@ class TextProduct(GenericHazards.TextProduct):
('LS.S', allActions, 'CoastalFloodStatement'), # LAKESHORE FLOOD STATEMENT
('SU.W', allActions, 'HighSurf'), # HIGH SURF WARNING
('SU.Y', allActions, 'HighSurf'), # HIGH SURF ADVISORY
('BH.S', allActions, 'BeachHaz'), # Beach Hazards Statement
('RP.S', allActions, 'RipCurrent'), # HIGH RIP CURRENT RISK
]
def _bulletDict(self):
def _bulletDict(self):
return {
"CF" : ("COASTAL FLOODING,TIMING,IMPACTS"), ### coastal flood warning, advisory, watch
"LS" : ("LAKE SHORE FLOODING,TIMING,IMPACTS"), ### lake shore flood warning, advisory, watch
"BH" : ("HAZARDS,TIMING,LOCATION,POTENTIAL IMPACTS"), ### hazardous beach conditions
"SU" : ("WAVES AND SURF,TIMING,IMPACTS"), ### high surf warning, advisory
"RP" : ("TIMING,IMPACTS"), ### high rip current risk
}
@ -116,11 +118,14 @@ class TextProduct(GenericHazards.TextProduct):
"COASTAL FLOODING",
"LAKE SHORE FLOODING",
"WAVES AND SURF",
"HAZARDS",
"TIMING",
"LOCATION",
"POTENTIAL IMPACTS",
"IMPACTS",
]
#
# Overridden to allow for attribution statement
#

View file

@ -1946,5 +1946,6 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis):
('SU.W', allActions, 'Marine'), # HIGH SURF WARNING
('SU.Y', allActions, 'Marine'), # HIGH SURF ADVISORY
('RP.S', allActions, 'Rip'), # High Rip Threat
('BH.S', allActions, 'BeachHaz'), # Beach Hazards Statement
]

View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<latLonGridCoverage>
<name>10000</name>
<description>CONUS domain for MRMS 1km products</description>
<la1>55</la1>
<lo1>230</lo1>
<firstGridPointCorner>UpperLeft</firstGridPointCorner>
<nx>7000</nx>
<ny>3500</ny>
<dx>0.01</dx>
<dy>0.01</dy>
<spacingUnit>degree</spacingUnit>
</latLonGridCoverage>

View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<latLonGridCoverage>
<name>10001</name>
<description>CONUS domain for MRMS 500m products</description>
<la1>55</la1>
<lo1>230</lo1>
<firstGridPointCorner>UpperLeft</firstGridPointCorner>
<nx>14000</nx>
<ny>7000</ny>
<dx>0.005</dx>
<dy>0.005</dy>
<spacingUnit>degree</spacingUnit>
</latLonGridCoverage>

View file

@ -10,6 +10,30 @@
<gribModelSet>
<!-- SUBCENTER 0 -->
<model>
<name>MRMS</name>
<center>161</center>
<subcenter>0</subcenter>
<grid>10000</grid>
<process>
<id>97</id>
</process>
</model>
<model>
<name>MRMS</name>
<center>161</center>
<subcenter>0</subcenter>
<grid>10001</grid>
<process>
<id>97</id>
</process>
</model>
<!-- END SUBCENTER 0 -->
<!-- SUBCENTER 1 -->
<model>

View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<subGridDef>
<modelNames>MRMS</modelNames>
<referenceGrid>10000</referenceGrid>
<nx>800</nx>
<ny>600</ny>
</subGridDef>

View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<subGridDef>
<modelNames>MRMS</modelNames>
<referenceGrid>10001</referenceGrid>
<nx>1600</nx>
<ny>1200</ny>
</subGridDef>

View file

@ -0,0 +1,53 @@
#Product Discipline 0 - Meteorological Products, Parameter Category 15: Radar
200:200:CG Lightning Probability (0-30 min.):%:LightningProbabilityNext30min
201:201:CG Lightning Density (1 min.):Flashes/km^2/min:LightningDensity1min
202:202:CG Lightning Density (5 min.):Flashes/km^2/min:LightningDensity5min
203:203:CG Lightning Density (15 min.):Flashes/km^2/min:LightningDensity15min
204:204:CG Lightning Density (30 min.):Flashes/km^2/min:LightningDensity30min
205:205:Maximum Estimated Size of Hail (MESH):mm:MESH
206:206:MESH Tracks (60 min. accum.):mm:MESHTrack60min
207:207:MESH Tracks (1440 min. accum.):mm:MESHTrack1440min
208:208:Composite Reflectivity:dBZ:MergedReflectivityQCComposite
209:209:Composite Reflectivity Height:m:HeightCompositeReflectivity
210:210:Reflectivity At Lowest Altitude (RALA):dBZ:ReflectivityAtLowestAltitude
211:211:Vertically Integrated Ice (VII):kg/m^2:VII
212:212:Vertically Integrated Liquid (VIL):kg/m^2:VIL
213:213:18 dBZ Echo Top:km:EchoTop18
214:214:30 dBZ Echo Top:km:EchoTop30
215:215:50 dBZ Echo Top:km:EchoTop50
216:216:60 dBZ Echo Top:km:EchoTop60
217:217:Height of 50 dBZ Echo Above -20C:km:H50AboveM20C
218:218:Height of 50 dBZ Echo Above 0C:km:H50Above0C
219:219:Height of 60 dBZ Echo Above 0C:km:H60Above0C
220:220:Reflectivity at 0C:dBZ:Reflectivity0C
221:221:Reflectivity at -10C:dBZ:ReflectivityM10C
222:222:Reflectivity at -20C:dBZ:ReflectivityM20C
223:223:Low-Level Rotation Tracks 0-2km AGL (60 min. accum.):1/s:RotationTrackLL60min
224:224:Low-Level Rotation Tracks 0-2km AGL (1440 min. accum.):1/s:RotationTrackLL1440min
225:225:Mid-Level Rotation Tracks 0-3km AGL (60 min. accum.):1/s:RotationTrackML60min
226:226:Mid-Level Rotation Tracks 0-3km AGL (1440 min. accum.):1/s:RotationTrackML1440min
227:227:Surface Precipitation Type (SPT)::PrecipType
228:228:Radar Precipitation Rate (SPR):mm/hr:PrecipRate
229:229:Seamless Hybrid Scan Reflectivity (SHSR):dBZ:SeamlessHSR
230:230:Radar Quality Index (RQI)::RadarQualityIndex
231:231:QPE - Radar Only (1 hr. accum):mm:RadarOnlyQPE01H
232:232:QPE - Radar Only (3 hr. accum.):RadarOnlyQPE03H
233:233:QPE - Radar Only (6 hr. accum.):mm:RadarOnlyQPE06H
234:234:QPE - Radar Only (12 hr. accum.):mm:RadarOnlyQPE12H
235:235:QPE - Radar Only (24 hr. accum.):mm:RadarOnlyQPE24H
236:236:QPE - Radar Only (48 hr. accum.):mm:RadarOnlyQPE48H
237:237:QPE - Radar Only (72 hr. accum.):mm:RadarOnlyQPE72H
238:238:QPE - Radar w/ Gauge Bias Correction (1 hr. accum.):mm:GaugeCorrQPE01H
239:239:QPE - Radar w/ Gauge Bias Correction (3 hr. accum.):mm:GaugeCorrQPE03H
240:240:QPE - Radar w/ Gauge Bias Correction (6 hr. accum.):mm:GaugeCorrQPE06H
241:241:QPE - Radar w/ Gauge Bias Correction (12 hr. accum.):mm:GaugeCorrQPE12H
242:242:QPE - Radar w/ Gauge Bias Correction (24 hr. accum.):mm:GaugeCorrQPE24H
243:243:QPE - Radar w/ Gauge Bias Correction (48 hr. accum.):mm:GaugeCorrQPE48H
244:244:QPE - Radar w/ Gauge Bias Correction (72 hr. accum.):mm:GaugeCorrQPE72H
245:245:QPE - Mountain Mapper (1 hr. accum.):mm:MountainMapperQPE01H
246:246:QPE - Mountain Mapper (3 hr. accum.):mm:MountainMapperQPE03H
247:247:QPE - Mountain Mapper (6 hr. accum.):mm:MountainMapperQPE06H
248:248:QPE - Mountain Mapper (12 hr. accum.):mm:MountainMapperQPE12H
249:249:QPE - Mountain Mapper (24 hr. accum.):mm:MountainMapperQPE24H
250:250:QPE - Mountain Mapper (48 hr. accum.):mm:MountainMapperQPE48H
251:251:QPE - Mountain Mapper (72 hr. accum.):mm:MountainMapperQPE72H

View file

@ -0,0 +1,3 @@
#Product Discipline 209 - Multi-Radar/Multi-Sensor, Parameter Category 10: Composite Products
0:0:Composite Reflectivity:dBZ:MergedReflectivityQCComposite
1:1:Composite Reflectivity Height:m:HeightCompositeReflectivity

View file

@ -0,0 +1,6 @@
#Product Discipline 209 - Multi-Radar/Multi-Sensor, Parameter Category 2: Lightning Products
0:0:CG Lightning Density (1 min.):Flashes/km^2/min:LightningDensity1min
1:1:CG Lightning Density (5 min.):Flashes/km^2/min:LightningDensity5min
2:2:CG Lightning Density (15 min.):Flashes/km^2/min:LightningDensity15min
3:3:CG Lightning Density (30 min.):Flashes/km^2/min:LightningDensity30min
4:4:CG Lightning Probability (0-30 min.):%:LightningProbabilityNext30min

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