removed files from remotes/origin/master_17.1.1p2..remotes/origin/master_18.1.1

This commit is contained in:
mjames-upc 2018-06-20 15:11:00 -06:00
parent 11c55078f9
commit 79d7ab168a
10770 changed files with 0 additions and 2261964 deletions

Binary file not shown.

Binary file not shown.

View file

@ -1,57 +0,0 @@
##
# This software was developed and / or modified by Raytheon Company,
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
#
# U.S. EXPORT CONTROLLED TECHNICAL DATA
# This software product contains export-restricted data whose
# export/transfer/disclosure is restricted by U.S. law. Dissemination
# to non-U.S. persons whether in the United States or abroad requires
# an export license or other authorization.
#
# Contractor Name: Raytheon Company
# Contractor Address: 6825 Pine Street, Suite 340
# Mail Stop B8
# Omaha, NE 68106
# 402.291.0100
#
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
# further licensing information.
##
import AlertVizProcessor
from com.raytheon.uf.viz.python.swt.widgets import LabelWidget
from com.raytheon.uf.viz.python.swt.widgets import PushButtonWidget
from com.raytheon.uf.viz.python.swt import Window
from java.util import ArrayList
#
# A debug processor that opens a window with a button callback
#
# This demonstrates how it is possible to create a SWT GUI that has
# buttons with Python Callbacks
#
# SOFTWARE HISTORY
#
# Date Ticket# Engineer Description
# ------------ ---------- ----------- --------------------------
# 07/15/09 chammack Initial Creation.
#
#
#
class DebugUIProcessor(AlertVizProcessor.AlertVizProcessor):
class Callback:
def run(self):
al = ArrayList()
Window.open("Callback Successful", al, False)
def process(self, statusMessage, alertMetadata, globalConfiguration):
al = ArrayList()
pb = PushButtonWidget.withText("Test Button")
cb = DebugUIProcessor.Callback()
pb.setCallback(self.createRunnableCallback(cb))
al.add(pb)
Window.open("Testing", al, False)

View file

@ -1,63 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.viz.d2d.core;
import com.raytheon.uf.viz.core.datastructure.PerspectiveSpecificProperties;
/**
* Provides a D2D-specific paint properties
*
* <pre>
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Feb 10, 2009 njensen Initial creation
*
* </pre>
*
* @author njensen
* @version 1.0
*/
public class D2DProperties extends PerspectiveSpecificProperties {
/** The current display scale */
protected String scale;
/**
* Get the scale
*
* @return
*/
public String getScale() {
return this.scale;
}
/**
* Set the scale
*
* @param scale
*/
public void setScale(String scale) {
this.scale = scale;
}
}

View file

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

View file

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

View file

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

View file

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

View file

@ -1,33 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
This_software_was_developed_and_/_or_modified_by_Raytheon_Company,
pursuant_to_Contract_DG133W-05-CQ-1067_with_the_US_Government.
U.S._EXPORT_CONTROLLED_TECHNICAL_DATA
This_software_product_contains_export-restricted_data_whose
export/transfer/disclosure_is_restricted_by_U.S._law._Dissemination
to_non-U.S._persons_whether_in_the_United_States_or_abroad_requires
an_export_license_or_other_authorization.
Contractor_Name:________Raytheon_Company
Contractor_Address:_____6825_Pine_Street,_Suite_340
________________________Mail_Stop_B8
________________________Omaha,_NE_68106
________________________402.291.0100
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
further_licensing_information.
-->
<?eclipse version="3.2"?>
<plugin>
<extension
point="com.raytheon.uf.viz.core.resource">
<resource
class="com.raytheon.uf.viz.objectiveanalysis.rsc.MetarOAResource"
name="Objective Analysis"
renderingOrderId="IMAGE_WORLD"
resourceType="PLAN_VIEW">
</resource>
</extension>
</plugin>

View file

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

View file

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

View file

@ -1,13 +0,0 @@
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.14.0.qualifier
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.7
Bundle-ActivationPolicy: lazy
Export-Package: com.raytheon.uf.viz.plugin.nwsauth

View file

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.2"?>
<plugin>
<extension
point="com.raytheon.uf.viz.core.userManager">
<userManager
class="com.raytheon.uf.viz.plugin.nwsauth.NwsUserManager">
</userManager>
</extension>
</plugin>

View file

@ -1,88 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.viz.plugin.nwsauth;
import com.raytheon.uf.common.auth.req.AbstractPrivilegedRequest;
import com.raytheon.uf.common.auth.resp.UserNotAuthenticated;
import com.raytheon.uf.common.auth.resp.UserNotAuthorized;
import com.raytheon.uf.common.auth.user.IUser;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.requests.INotAuthHandler;
/**
* Implementation of INotAuthHandler
*
* <pre>
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* May 27, 2010 rgeorge Initial creation
*
* </pre>
*
* @author rgeorge
* @version 1.0
*/
public class NwsNotAuthHandler implements INotAuthHandler {
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.viz.core.requests.INotAuthHandler#notAuthenticated(com
* .raytheon.uf.common.auth.resp.UserNotAuthenticated)
*/
@Override
public Object notAuthenticated(UserNotAuthenticated response)
throws VizException {
AbstractPrivilegedRequest request = response.getRequest();
IUser user = request.getUser();
String message = "User: <" + user.uniqueId()
+ "> is not authenticated to perform request:"
+ request.getClass();
UFStatus.getHandler(NwsNotAuthHandler.class).handle(Priority.PROBLEM,
message);
throw new VizException(message);
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.viz.core.requests.INotAuthHandler#notAuthorized(com.raytheon
* .uf.common.auth.resp.UserNotAuthorized)
*/
@Override
public Object notAuthorized(UserNotAuthorized response) throws VizException {
String message = response.getMessage();
if (message == null) {
message = "Error sending request for user: "
+ response.getRequest().getUser().uniqueId().toString();
}
UFStatus.getHandler(NwsNotAuthHandler.class).handle(Priority.PROBLEM,
message);
throw new VizException(message);
}
}

View file

@ -1,328 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.viz.plugin.nwsauth;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.raytheon.uf.common.auth.resp.SuccessfulExecution;
import com.raytheon.uf.common.auth.user.IPermission;
import com.raytheon.uf.common.auth.user.IRole;
import com.raytheon.uf.common.plugin.nwsauth.NwsPermission;
import com.raytheon.uf.common.plugin.nwsauth.NwsRole;
import com.raytheon.uf.common.plugin.nwsauth.NwsRoleDataRequest;
import com.raytheon.uf.common.plugin.nwsauth.NwsRoleDataRequest.NwsRoleDataRequestType;
import com.raytheon.uf.common.plugin.nwsauth.xml.NwsRoleData;
import com.raytheon.uf.common.plugin.nwsauth.xml.PermissionXML;
import com.raytheon.uf.common.plugin.nwsauth.xml.RoleXML;
import com.raytheon.uf.common.plugin.nwsauth.xml.UserXML;
import com.raytheon.uf.common.serialization.comm.RequestRouter;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
/**
* Uses localization data to determine role/permissions.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* May 30, 2012 mpduff Initial creation
* Nov 06, 2012 1302 djohnson Move to nwsauth plugin.
* Jan 09, 2013 1412 djohnson Move localization file writing to the server.
*
* </pre>
*
* @author mpduff
* @version 1.0
*/
public class NwsRoleDataManager {
/** Status handler */
private static final IUFStatusHandler statusHandler = UFStatus
.getHandler(NwsRoleDataManager.class);
private static final NwsRoleDataManager instance = new NwsRoleDataManager();
private Map<String, NwsRoleData> roleDataMap = new HashMap<String, NwsRoleData>();
private NwsRoleDataManager() {
retrieveRoleDataFromServer();
}
/**
* Get an instance.
*
* @return an instance
*/
public static NwsRoleDataManager getInstance() {
return instance;
}
/**
* Get the NwsRoleData object.
*
* @param application
* The application
*
* @return The NwsRoleData object
*/
public NwsRoleData getRoleData(String application) {
return this.roleDataMap.get(application);
}
/**
* Get a list of user ids for the application.
*
* @param application
* the application
* @return String[] of user ids
*/
public String[] getUserIdList(String application) {
ArrayList<String> userNameList = new ArrayList<String>();
for (UserXML ux : this.roleDataMap.get(application).getUserList()) {
userNameList.add(ux.getUserId());
}
return userNameList.toArray(new String[userNameList.size()]);
}
/**
* Get an array of user roles.
*
* @param userId
* The user id
* @param application
* The application
* @return the array of roles
*/
public String[] getUserRoles(String userId, String application) {
ArrayList<String> userRoles = new ArrayList<String>();
for (UserXML userXml : this.roleDataMap.get(application).getUserList()) {
if (userXml.getUserId().equals(userId)) {
for (String role : userXml.getRoleList()) {
userRoles.add(role);
}
break;
}
}
return userRoles.toArray(new String[userRoles.size()]);
}
/**
* Get a list of user permissions.
*
* @param userId
* The user id
* @param application
* The application
* @return The array of user permissions
*/
public String[] getUserPermissions(String userId, String application) {
ArrayList<String> userPermissions = new ArrayList<String>();
for (UserXML userXml : this.roleDataMap.get(application).getUserList()) {
if (userXml.getUserId().equals(userId)) {
for (String permission : userXml.getPermissionList()) {
userPermissions.add(permission);
}
break;
}
}
return userPermissions.toArray(new String[userPermissions.size()]);
}
public String[] getRolePermissions(String roleId, String application) {
ArrayList<String> rolePerms = new ArrayList<String>();
for (RoleXML roleXml : roleDataMap.get(application).getRoleList()) {
if (roleXml.getRoleId().equals(roleId)) {
for (String perm : roleXml.getPermissionList()) {
rolePerms.add(perm);
}
}
}
return rolePerms.toArray(new String[rolePerms.size()]);
}
/**
* @param application
* @return
*/
public List<IPermission> getPermissions(String application) {
List<IPermission> permissions = new ArrayList<IPermission>();
NwsRoleData roleData = roleDataMap.get(application);
for (PermissionXML xml : roleData.getPermissionList()) {
String id = xml.getId();
String description = xml.getDescription();
permissions.add(new NwsPermission(id, description));
}
return permissions;
}
/**
* @return
*/
public List<IRole> getRoles(String application) {
List<IRole> roles = new ArrayList<IRole>();
for (NwsRoleData roleData : roleDataMap.values()) {
for (RoleXML xml : roleData.getRoleList()) {
String id = xml.getRoleId();
String description = xml.getRoleDescription();
roles.add(new NwsRole(id,
getPermissionsForRole(id, application), description));
}
}
return roles;
}
private List<IPermission> getPermissionsForRole(String roleId,
String application) {
List<IPermission> rolePerms = new ArrayList<IPermission>();
List<String> permissionIds = Arrays.asList(getRolePermissions(roleId,
application));
for (PermissionXML roleXml : roleDataMap.get(application)
.getPermissionList()) {
if (permissionIds.contains(roleXml.getId())) {
rolePerms.add(new NwsPermission(roleXml.getId(), roleXml
.getDescription()));
}
}
return rolePerms;
}
/**
* Return a list of applications that have roles/permissions defined.
*
* @return String[] of application names
*/
public String[] getApplications() {
return roleDataMap.keySet().toArray(new String[roleDataMap.size()]);
}
public void addUser(String user, String application) {
if (user != null && user.length() > 0) {
UserXML userXml = new UserXML();
userXml.setUserId(user);
this.roleDataMap.get(application).getUserList().add(userXml);
}
}
public void addRole(String role, String description, String application) {
if (role != null && description != null && role.length() > 0
&& description.length() > 0) {
RoleXML roleXml = new RoleXML();
roleXml.setRoleDescription(description);
roleXml.setRoleId(role);
this.roleDataMap.get(application).getRoleList().add(roleXml);
}
}
public void deleteUser(String user, String application) {
if (user != null && user.length() > 0) {
int idx = -1;
for (UserXML u : roleDataMap.get(application).getUserList()) {
idx++;
if (u.getUserId().equalsIgnoreCase(user)) {
roleDataMap.get(application).getUserList().remove(idx);
break;
}
}
}
}
public void deleteRole(String role, String application) {
if (role != null && role.length() > 0) {
int idx = -1;
for (RoleXML r : roleDataMap.get(application).getRoleList()) {
idx++;
if (r.getRoleId().equalsIgnoreCase(role)) {
roleDataMap.get(application).getRoleList().remove(idx);
break;
}
}
}
}
/**
* {@inheritDoc}
*/
public void save(String application) {
updateRoleDataOnTheServer(application);
}
/**
* Updates the role data on the server.
*
* @param application
* the application to send updated role data for
*/
private void updateRoleDataOnTheServer(String application) {
Map<String, NwsRoleData> roleDataMapUpdates = new HashMap<String, NwsRoleData>();
roleDataMapUpdates.put(application, roleDataMap.get(application));
NwsRoleDataRequest request = new NwsRoleDataRequest();
request.setRoleDataMap(roleDataMapUpdates);
request.setType(NwsRoleDataRequestType.SUBMIT);
try {
RequestRouter.route(request);
} catch (Exception e) {
statusHandler
.handle(Priority.PROBLEM,
"Unable to send updated role data to the server.",
e);
}
}
private void retrieveRoleDataFromServer() {
try {
NwsRoleDataRequest request = new NwsRoleDataRequest();
request.setType(NwsRoleDataRequestType.REQUEST);
NwsRoleDataRequest response = (NwsRoleDataRequest) ((SuccessfulExecution) RequestRouter
.route(request)).getResponse();
this.roleDataMap = response.getRoleDataMap();
} catch (Exception e) {
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
}
}
/**
* Reload theXML files from disk.
*/
public void reloadRoleData() {
retrieveRoleDataFromServer();
}
}

View file

@ -1,79 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.viz.plugin.nwsauth;
import java.util.List;
import com.raytheon.uf.common.auth.user.IPermission;
import com.raytheon.uf.common.auth.user.IRole;
import com.raytheon.uf.viz.core.auth.BasicUserManager;
import com.raytheon.uf.viz.core.requests.INotAuthHandler;
/**
* Implementation of IUserManager
*
* <pre>
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* May 27, 2010 rgeorge Initial creation
* Jun 07, 2013 1981 mpduff Add an IUser field.
* Oct 06, 2014 3398 bclement now extends BasicUserManager
*
* </pre>
*
* @author rgeorge
* @version 1.0
*/
public class NwsUserManager extends BasicUserManager {
private final NwsNotAuthHandler notAuthHandler = new NwsNotAuthHandler();
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.core.auth.IUserManager#getNotAuthHandler()
*/
@Override
public INotAuthHandler getNotAuthHandler() {
return notAuthHandler;
}
/**
* {@inheritDoc}
*/
@Override
public List<IPermission> getPermissions(String application) {
// TODO: Should this pass through to EDEX to get this stuff?
return NwsRoleDataManager.getInstance().getPermissions(application);
}
/**
* {@inheritDoc}
*/
@Override
public List<IRole> getRoles(String application) {
// TODO: Should this pass through to EDEX to get this stuff?
return NwsRoleDataManager.getInstance().getRoles(application);
}
}

View file

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

View file

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

View file

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry combineaccessrules="false" kind="src" path="/com.raytheon.uf.common.useradmin"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View file

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

View file

@ -1,16 +0,0 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Useradmin
Bundle-SymbolicName: com.raytheon.uf.viz.useradmin;singleton:=true
Bundle-Version: 1.14.0.qualifier
Bundle-Vendor: RAYTHEON
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
com.raytheon.viz.ui;bundle-version="1.12.1174",
com.raytheon.uf.viz.core;bundle-version="1.12.1174",
com.raytheon.uf.common.auth;bundle-version="1.12.1174",
com.raytheon.uf.common.useradmin;bundle-version="1.0.0",
com.raytheon.uf.viz.plugin.nwsauth;bundle-version="1.12.1174"
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ActivationPolicy: lazy
Import-Package: com.raytheon.uf.common.plugin.nwsauth.xml

View file

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

View file

@ -1,31 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="org.eclipse.ui.menus">
<menuContribution
allPopups="false"
locationURI="menu:CAVE?after=group1">
<command
commandId="com.raytheon.uf.viz.useradmin.useradminui"
label="AWIPS User Administration..."
style="push">
</command>
</menuContribution>
</extension>
<extension
point="org.eclipse.ui.commands">
<command
id="com.raytheon.uf.viz.useradmin.useradminui"
name="AWIPS User Administration">
</command>
</extension>
<extension
point="org.eclipse.ui.handlers">
<handler
class="com.raytheon.uf.viz.useradmin.actions.UserAdminAction"
commandId="com.raytheon.uf.viz.useradmin.useradminui">
</handler>
</extension>
</plugin>

View file

@ -1,111 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.viz.useradmin.actions;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;
import com.raytheon.uf.common.auth.user.IUser;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.common.useradmin.request.UserAdminAuthRequest;
import com.raytheon.uf.viz.core.auth.UserController;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.requests.ThriftClient;
import com.raytheon.uf.viz.useradmin.ui.UserAdminSelectDlg;
/**
* Action class to launch the User Administration Dialog.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* May 12, 2012 224 mpduff Initial creation
*
* </pre>
*
* @author mpduff
* @version 1.0
*/
public class UserAdminAction extends AbstractHandler {
private static final transient IUFStatusHandler statusHandler = UFStatus.getHandler(UserAdminAction.class);
/** User Administration permission */
private final String permission = "awips.user.admin";
private UserAdminSelectDlg adminDlg = null;
/*
* (non-Javadoc)
*
* @see
* org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.
* ExecutionEvent)
*/
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
if (isAuthorized()) {
if ((adminDlg == null) || (adminDlg.isDisposed() == true)) {
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getShell();
adminDlg = new UserAdminSelectDlg(shell);
adminDlg.open();
} else {
adminDlg.bringToTop();
}
}
return null;
}
/**
* Is user authorized?
*
* @return true if authorized
*/
private boolean isAuthorized() {
IUser user = UserController.getUserObject();
String msg = user.uniqueId() + " is not a user administrator.";
UserAdminAuthRequest request = new UserAdminAuthRequest();
request.setRoleId(permission);
request.setNotAuthorizedMessage(msg);
request.setUser(user);
try {
Object o = ThriftClient.sendPrivilegedRequest(request);
if (o instanceof UserAdminAuthRequest) {
UserAdminAuthRequest r = (UserAdminAuthRequest) o;
return r.isAuthorized();
}
} catch (VizException e) {
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
}
return false;
}
}

View file

@ -1,207 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.viz.useradmin.ui;
import java.util.List;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.MenuItem;
import org.eclipse.swt.widgets.MessageBox;
import org.eclipse.swt.widgets.Shell;
import com.raytheon.uf.common.auth.user.IPermission;
import com.raytheon.uf.common.auth.user.IRole;
import com.raytheon.uf.viz.core.auth.IUserManager;
import com.raytheon.uf.viz.core.auth.UserController;
import com.raytheon.viz.ui.widgets.duallist.IMenuData;
/**
* Dual List menu data object.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jun 01, 2012 mpduff Initial creation.
* Nov 06, 2012 1306 djohnson Use API rather than implementation for role data.
* Aug 12, 2013 2247 mpduff Call getName() on IPermission.
*
* </pre>
*
* @author mpduff
* @version 1.0
*/
public class DualListMenuData implements IMenuData {
private String menuText = "menu";
private boolean showMenu = true;
private String application = null;
private String selection = null;
/**
* @return the menuText
*/
@Override
public String getMenuText() {
return menuText;
}
/**
* @param menuText
* the menuText to set
*/
public void setMenuText(String menuText) {
this.menuText = menuText;
}
/**
* @return the showMenu
*/
@Override
public boolean isShowMenu() {
return showMenu;
}
/**
* @param showMenu
* the showMenu to set
*/
public void setShowMenu(boolean showMenu) {
this.showMenu = showMenu;
}
/**
* @return the application
*/
public String getApplication() {
return application;
}
/**
* @param application
* the application to set
*/
public void setApplication(String application) {
this.application = application;
}
/**
* @return the selection
*/
public String getSelection() {
return selection;
}
/**
* @param selection
* the selection to set
*/
public void setSelection(String selection) {
this.selection = selection;
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.viz.ui.widgets.IMenuData#setSelectedListSelection(java.lang
* .String)
*/
@Override
public void setListSelection(String selection) {
this.selection = selection;
}
/**
* Show the right click menu for the list.
*
* @param shell
* The shell
* @param menuText
* The text for the menu item
*/
@Override
public void showListMenu(final Shell shell, String menuText) {
Menu menu = new Menu(shell, SWT.POP_UP);
MenuItem item1 = new MenuItem(menu, SWT.PUSH);
item1.setText(menuText);
item1.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent arg0) {
StringBuilder messageText = new StringBuilder();
boolean roleFlag = false;
IUserManager man = UserController.getManager();
for (IRole role : man.getRoles(application)) {
if (selection.equals(role.toString())) {
messageText.append("Role: ").append(selection);
messageText.append("\n\nDescription: ").append(
role.getDescription().trim());
List<IPermission> permissions = role.getPermissions();
if (!permissions.isEmpty()) {
messageText.append("\n\nPermissions: ");
for (IPermission perm : permissions) {
messageText.append("\n ").append(
perm.getName());
}
}
roleFlag = true;
break;
}
}
if (!roleFlag) {
for (IPermission perm : man.getPermissions(application)) {
if (perm.getName().equals(selection)) {
messageText.append("Permission: ")
.append(selection);
messageText.append("\nDescription: ").append(
perm.getDescription());
break;
}
}
}
if (messageText.length() == 0) {
messageText.append("No Description");
}
MessageBox messageDialog = new MessageBox(shell,
SWT.ICON_INFORMATION);
if (roleFlag) {
messageDialog.setText("Role Description");
} else {
messageDialog.setText("Permission Description");
}
messageDialog.setMessage(messageText.toString());
messageDialog.open();
}
});
shell.setMenu(menu);
menu.setVisible(true);
}
}

View file

@ -1,384 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.viz.useradmin.ui;
import java.util.ArrayList;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StackLayout;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import com.raytheon.uf.common.plugin.nwsauth.xml.NwsRoleData;
import com.raytheon.uf.common.plugin.nwsauth.xml.RoleXML;
import com.raytheon.uf.common.plugin.nwsauth.xml.UserXML;
import com.raytheon.uf.viz.plugin.nwsauth.NwsRoleDataManager;
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
import com.raytheon.viz.ui.widgets.duallist.DualList;
import com.raytheon.viz.ui.widgets.duallist.DualListConfig;
import com.raytheon.viz.ui.widgets.duallist.IUpdate;
/**
* Edit user di
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* May 23, 2012 mpduff Initial creation
* Aug 08, 2012 863 jpiatt Added new interface method.
* Jul 28, 2013 2236 mpduff Made resizable.
* May 04, 2015 4419 rferrel Sort {@link #roleDualList}.
*
* </pre>
*
* @author mpduff
* @version 1.0
*/
public class ManageUserDlg extends CaveSWTDialog implements IUpdate {
/** The Stack Layout. */
private final StackLayout stackLayout = new StackLayout();
/** Type of permissions */
private final String type;
/** Selection */
private final String selection;
/** Edit combo box */
private Combo editCbo;
/** All role dual list */
private DualList roleDualList;
/** Permissions dual list */
private DualList permDualList;
/** User role dual list */
private DualList userRoleDualList;
/** Stack composite */
private Composite stackComp;
/** The application currently selected. */
private final String application;
/**
* Constructor.
*
* @param parent
* parent shell
* @param type
* type of data being edited
* @param selection
* selection being passed in
* @param application
* application working on
*/
public ManageUserDlg(Shell parent, String type, String selection,
String application) {
super(parent, SWT.DIALOG_TRIM | SWT.RESIZE);
this.selection = selection;
this.type = type;
this.application = application;
setText("Edit " + type + " - " + selection);
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.viz.ui.dialogs.CaveSWTDialogBase#initializeComponents(org
* .eclipse.swt.widgets.Shell)
*/
@Override
protected void initializeComponents(Shell shell) {
GridData gd = new GridData(SWT.CENTER, SWT.DEFAULT, true, false);
GridLayout gl = new GridLayout(1, false);
gl.verticalSpacing = 2;
gl.horizontalSpacing = 2;
gl.marginWidth = 2;
shell.setLayout(gl);
shell.setLayoutData(gd);
gd = new GridData(SWT.CENTER, SWT.DEFAULT, true, false);
gl = new GridLayout(2, false);
gl.verticalSpacing = 2;
gl.horizontalSpacing = 2;
gl.marginWidth = 2;
Composite labelComp = new Composite(shell, SWT.NONE);
labelComp.setLayout(gl);
labelComp.setLayoutData(gd);
Label editLbl = new Label(labelComp, SWT.NONE);
editLbl.setText("Edit: ");
String[] entries;
if (type.equalsIgnoreCase("Role")) {
entries = new String[] { "Assigned Roles", "Assigned Permissions",
"Assign Role to Users" };
} else {
entries = new String[] { "Assigned Roles", "Assigned Permissions" };
}
gd = new GridData(SWT.CENTER, SWT.DEFAULT, true, false);
editCbo = new Combo(labelComp, SWT.DROP_DOWN | SWT.READ_ONLY);
editCbo.setLayoutData(gd);
editCbo.setItems(entries);
editCbo.select(0);
editCbo.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
if (editCbo.getItem(editCbo.getSelectionIndex()).equals(
"Assigned Roles")) {
stackLayout.topControl = roleDualList;
} else if (editCbo.getItem(editCbo.getSelectionIndex()).equals(
"Assigned Permissions")) {
stackLayout.topControl = permDualList;
} else if (editCbo.getItem(editCbo.getSelectionIndex()).equals(
"Assign Role to Users")) {
stackLayout.topControl = userRoleDualList;
}
stackComp.layout();
}
});
gd = new GridData(SWT.FILL, SWT.FILL, true, true);
stackComp = new Composite(shell, SWT.NONE);
stackComp.setLayout(stackLayout);
stackComp.setLayoutData(gd);
NwsRoleDataManager manager = NwsRoleDataManager.getInstance();
ArrayList<String> selectedList = new ArrayList<String>();
ArrayList<String> fullList = new ArrayList<String>();
String availableLabel = "Available Roles:";
String selectedLabel = "Selected Roles:";
// build roles widgets
String[] userRoles = manager.getRoleData(application).getUserRoles(
this.selection);
for (String role : userRoles) {
selectedList.add(role);
}
String[] roles = manager.getRoleData(application).getRoles();
for (String role : roles) {
fullList.add(role);
}
DualListMenuData menuData = new DualListMenuData();
menuData.setApplication(this.application);
menuData.setMenuText("Details...");
menuData.setShowMenu(true);
DualListConfig roleConfig = new DualListConfig();
roleConfig.setAvailableListLabel(availableLabel);
roleConfig.setSelectedListLabel(selectedLabel);
roleConfig.setListHeight(90);
roleConfig.setListWidth(175);
roleConfig.setSelectedList(selectedList);
roleConfig.setFullList(fullList);
roleConfig.setMenuData(menuData);
roleConfig.setSortList(true);
roleDualList = new DualList(stackComp, SWT.NONE, roleConfig, this);
// Build permissions widgets
ArrayList<String> selectedPermList = new ArrayList<String>();
ArrayList<String> fullPermList = new ArrayList<String>();
String[] userPerms = manager.getRoleData(application)
.getUserPermissions(this.selection);
for (String perm : userPerms) {
selectedPermList.add(perm);
}
String[] perms = manager.getRoleData(application).getPermissions();
for (String perm : perms) {
fullPermList.add(perm);
}
fullList.remove(selection);
availableLabel = "Available Permissions:";
selectedLabel = "Selected Permissions:";
DualListMenuData menuData2 = new DualListMenuData();
menuData2.setApplication(this.application);
menuData2.setMenuText("Details...");
menuData2.setShowMenu(true);
DualListConfig permConfig = new DualListConfig();
permConfig.setAvailableListLabel(availableLabel);
permConfig.setSelectedListLabel(selectedLabel);
permConfig.setListHeight(90);
permConfig.setListWidth(175);
permConfig.setSelectedList(selectedPermList);
permConfig.setFullList(fullPermList);
permConfig.setMenuData(menuData2);
permConfig.setSortList(true);
permDualList = new DualList(stackComp, SWT.NONE, permConfig, this);
// Build Roles to User Widgets
ArrayList<String> fullUserList = new ArrayList<String>();
String[] users = manager.getRoleData(application).getUsers();
for (String user : users) {
fullUserList.add(user);
}
fullUserList.remove(selection);
availableLabel = "Available Users:";
selectedLabel = "Assigned Users:";
DualListConfig userRoleConfig = new DualListConfig();
userRoleConfig.setAvailableListLabel(availableLabel);
userRoleConfig.setSelectedListLabel(selectedLabel);
userRoleConfig.setListHeight(90);
userRoleConfig.setListWidth(175);
userRoleConfig.setFullList(fullUserList);
userRoleDualList = new DualList(stackComp, SWT.NONE, userRoleConfig,
this);
int buttonWidth = 75;
GridData btnData = new GridData(buttonWidth, SWT.DEFAULT);
gd = new GridData(SWT.CENTER, SWT.DEFAULT, false, false);
gl = new GridLayout(2, false);
Composite bottomComp = new Composite(shell, SWT.NONE);
bottomComp.setLayout(gl);
bottomComp.setLayoutData(gd);
btnData = new GridData(buttonWidth, SWT.DEFAULT);
Button okBtn = new Button(bottomComp, SWT.PUSH);
okBtn.setText("OK");
okBtn.setLayoutData(btnData);
okBtn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
handleOk();
}
});
btnData = new GridData(buttonWidth, SWT.DEFAULT);
Button cancelBtn = new Button(bottomComp, SWT.PUSH);
cancelBtn.setText("Cancel");
cancelBtn.setLayoutData(btnData);
cancelBtn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
setReturnValue(false);
close();
}
});
stackLayout.topControl = roleDualList;
}
/**
* Handle the OK button click.
*/
private void handleOk() {
String[] selectedUsers = userRoleDualList.getSelectedListItems();
String[] permissions = permDualList.getSelectedListItems();
String[] roles = roleDualList.getSelectedListItems();
NwsRoleDataManager man = NwsRoleDataManager.getInstance();
NwsRoleData roleData = man.getRoleData(application);
if (type.equalsIgnoreCase("User")) {
ArrayList<UserXML> userList = (ArrayList<UserXML>) roleData
.getUserList();
for (UserXML user : userList) {
if (user.getUserId().equals(selection)) {
// Update permissions
ArrayList<String> permissionList = new ArrayList<String>();
for (String perm : permissions) {
permissionList.add(perm);
}
user.setPermissionList(permissionList);
// Update roles
ArrayList<String> roleList = new ArrayList<String>();
for (String role : roles) {
roleList.add(role);
}
user.setRoleList(roleList);
break;
}
}
} else { // type is role
ArrayList<RoleXML> roleList = (ArrayList<RoleXML>) roleData
.getRoleList();
for (RoleXML role : roleList) {
if (role.getRoleId().equals(selection)) {
// Update permissions, start by clearing the list
role.getPermissionList().clear();
for (String perm : permissions) {
if (!role.getPermissionList().contains(perm)) {
role.addPermission(perm);
}
}
// Add roles
for (String r : roles) {
if (!role.getPermissionList().contains(r)) {
role.addPermission(r);
}
}
}
}
// Add role to selected users
for (String selectedUser : selectedUsers) {
for (UserXML user : roleData.getUserList()) {
if (selectedUser.equals(user.getUserId())) {
if (!user.getRoleList().contains(selection)) {
user.addRole(selection);
break;
}
}
}
}
}
close();
}
@Override
public void hasEntries(boolean entries) {
this.setReturnValue(true);
}
@Override
public void selectionChanged() {
// unused
}
}

View file

@ -1,175 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.viz.useradmin.ui;
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.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import com.raytheon.uf.common.plugin.nwsauth.xml.NwsRoleData;
import com.raytheon.uf.viz.plugin.nwsauth.NwsRoleDataManager;
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
/**
* The User Admin new user/role dialog.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* May 23, 2012 mpduff Initial creation
*
* </pre>
*
* @author mpduff
* @version 1.0
*/
public class NewDlg extends CaveSWTDialog {
private final String type;
private Text newTextField;
private Text description;
private final String application;
/**
* Constructor.
*
* @param parent
* parent shell
* @param type
* type (role/user)
* @param application
* application name
*/
public NewDlg(Shell parent, String type, String application) {
super(parent, SWT.DIALOG_TRIM);
this.type = type;
this.application = application;
setText("Add New " + type);
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.viz.ui.dialogs.CaveSWTDialogBase#initializeComponents(org
* .eclipse.swt.widgets.Shell)
*/
@Override
protected void initializeComponents(Shell shell) {
GridData gd = new GridData(SWT.CENTER, SWT.DEFAULT, true, false);
GridLayout gl = new GridLayout(1, false);
shell.setLayout(gl);
shell.setLayoutData(gd);
gd = new GridData(SWT.CENTER, SWT.DEFAULT, true, false);
gl = new GridLayout(1, false);
Composite mainComp = new Composite(shell, SWT.NONE);
mainComp.setLayout(gl);
mainComp.setLayoutData(gd);
int textWidth = 225;
GridData textData = new GridData(textWidth, SWT.DEFAULT);
Label label = new Label(mainComp, SWT.NONE);
label.setText("Enter New " + type + ":");
newTextField = new Text(mainComp, SWT.BORDER);
newTextField.setLayoutData(textData);
if (type.equalsIgnoreCase("Role")) {
Label descLbl = new Label(mainComp, SWT.NONE);
descLbl.setText("Enter Role Description:");
textWidth = 250;
int textHeight = 150;
GridData descriptionData = new GridData(textWidth, textHeight);
description = new Text(mainComp, SWT.BORDER | SWT.MULTI | SWT.WRAP);
description.setLayoutData(descriptionData);
}
gd = new GridData(SWT.CENTER, SWT.DEFAULT, false, false);
gl = new GridLayout(2, false);
Composite buttonComp = new Composite(shell, SWT.NONE);
buttonComp.setLayout(gl);
buttonComp.setLayoutData(gd);
int buttonWidth = 100;
GridData btnData = new GridData(buttonWidth, SWT.DEFAULT);
Button okBtn = new Button(buttonComp, SWT.PUSH);
okBtn.setText("OK");
okBtn.setLayoutData(btnData);
okBtn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
handleOK();
}
});
btnData = new GridData(buttonWidth, SWT.DEFAULT);
Button cancelBtn = new Button(buttonComp, SWT.PUSH);
cancelBtn.setText("Cancel");
cancelBtn.setLayoutData(btnData);
cancelBtn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
setReturnValue(false);
close();
}
});
}
private void handleOK() {
if (newTextField.getText() != null && newTextField.getText().length() > 0) {
NwsRoleDataManager manager = NwsRoleDataManager.getInstance();
NwsRoleData roleData = manager.getRoleData(application);
if (type.equalsIgnoreCase("User")) {
roleData.addUser(newTextField.getText().trim());
} else if (type.equalsIgnoreCase("Role")) {
roleData.addRole(newTextField.getText().trim(), description.getText().trim());
} else if (type.equalsIgnoreCase("Permission")) {
roleData.addPermission(newTextField.getText().trim());
}
}
Shell parent = shell.getParent().getShell();
String value = newTextField.getText().trim();
close();
ManageUserDlg mud = new ManageUserDlg(parent, type, value, application);
boolean changes = (Boolean) mud.open();
setReturnValue(changes);
}
}

View file

@ -1,809 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.viz.useradmin.ui;
import java.util.ArrayList;
import java.util.Arrays;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.events.MouseAdapter;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.List;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.MenuItem;
import org.eclipse.swt.widgets.MessageBox;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.TabFolder;
import org.eclipse.swt.widgets.TabItem;
import com.raytheon.uf.common.jms.notification.INotificationObserver;
import com.raytheon.uf.common.jms.notification.NotificationMessage;
import com.raytheon.uf.common.plugin.nwsauth.xml.PermissionXML;
import com.raytheon.uf.common.plugin.nwsauth.xml.RoleXML;
import com.raytheon.uf.common.useradmin.request.UserAdminConstants;
import com.raytheon.uf.viz.core.VizApp;
import com.raytheon.uf.viz.core.notification.jobs.NotificationManagerJob;
import com.raytheon.uf.viz.plugin.nwsauth.NwsRoleDataManager;
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
/**
* Main User Administration Dialog.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* May 23, 2012 mpduff Initial creation.
* Nov 26, 2012 1347 mpduff Make resizable.
* Jan 09, 2013 1412 djohnson Listen for user authentication data changes.
* Aug 12, 2013 2247 mpduff Dialog cleanup and consistency.
* Dec 05, 2014 3801 nabowle Check if widgets are disposed in populate
* lists. Hide Description menu when nothing
* is selected. Better enable/disable edit
* and delete buttons. Give delete dialogs
* a title.
* Apr 02, 2015 4345 skorolev Fixed dialog to expand vertically properly.
* May 04, 2015 4419 rferrel Sort {@link #userPermList} and {@link #rolePermList}.
*
* </pre>
*
* @author mpduff
* @version 1.0
*/
public class UserAdminSelectDlg extends CaveSWTDialog implements
INotificationObserver {
private Combo appCombo;
private TabFolder tabFolder;
private TabItem userTab;
private TabItem roleTab;
private List userList;
private List roleList;
private List userPermList;
private List rolePermList;
private Button editUserBtn;
private Button deleteUserBtn;
private Button editRoleBtn;
private Button deleteRoleBtn;
private String selectedApplication;
private boolean dirty = false;
/**
* Constructor.
*
* @param parent
* The parent shell
*/
public UserAdminSelectDlg(Shell parent) {
super(parent, SWT.DIALOG_TRIM | SWT.RESIZE,
CAVE.PERSPECTIVE_INDEPENDENT);
setText("User Admin");
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.viz.ui.dialogs.CaveSWTDialogBase#initializeComponents(org
* .eclipse.swt.widgets.Shell)
*/
@Override
protected void initializeComponents(Shell shell) {
NwsRoleDataManager man = NwsRoleDataManager.getInstance();
GridData gd = new GridData(SWT.CENTER, SWT.DEFAULT, true, false);
GridLayout gl = new GridLayout(1, false);
shell.setLayout(gl);
shell.setLayoutData(gd);
gd = new GridData(SWT.CENTER, SWT.DEFAULT, true, false);
gl = new GridLayout(2, false);
Composite c = new Composite(shell, SWT.NONE);
c.setLayout(gl);
c.setLayoutData(gd);
Label label = new Label(c, SWT.NONE);
label.setText("Component: ");
gd = new GridData(SWT.CENTER, SWT.DEFAULT, true, false);
gl = new GridLayout(1, false);
appCombo = new Combo(c, SWT.DROP_DOWN | SWT.READ_ONLY);
appCombo.setLayoutData(gd);
appCombo.setItems(man.getApplications());
appCombo.select(0);
appCombo.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
selectedApplication = appCombo.getItem(appCombo
.getSelectionIndex());
populateLists();
}
});
selectedApplication = appCombo.getItem(appCombo.getSelectionIndex());
gd = new GridData(SWT.FILL, SWT.FILL, true, true);
gl = new GridLayout(1, false);
Composite tabComp = new Composite(shell, SWT.NONE);
tabComp.setLayout(gl);
tabComp.setLayoutData(gd);
gd = new GridData(SWT.FILL, SWT.FILL, true, true);
gl = new GridLayout(1, false);
tabFolder = new TabFolder(tabComp, SWT.BORDER);
tabFolder.setLayoutData(gd);
createTabs(tabFolder);
tabFolder.pack();
gd = new GridData(SWT.CENTER, SWT.DEFAULT, true, false);
gl = new GridLayout(2, false);
Composite buttonComp = new Composite(shell, SWT.NONE);
buttonComp.setLayout(gl);
buttonComp.setLayoutData(gd);
int buttonWidth = 100;
GridData btnData = new GridData(buttonWidth, SWT.DEFAULT);
Button okBtn = new Button(buttonComp, SWT.PUSH);
okBtn.setText("Save");
okBtn.setLayoutData(btnData);
okBtn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
handleOK();
}
});
btnData = new GridData(buttonWidth, SWT.DEFAULT);
Button closeBtn = new Button(buttonComp, SWT.PUSH);
closeBtn.setText("Close");
closeBtn.setLayoutData(btnData);
closeBtn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
if (dirty) {
MessageBox messageDialog = new MessageBox(getShell(),
SWT.ICON_WARNING | SWT.YES | SWT.NO);
messageDialog.setText("Unsaved Changes");
messageDialog.setMessage("Unsaved changes are present.\n"
+ "Are you sure you want to close without saving?");
int answer = messageDialog.open();
if (answer == SWT.YES) {
NwsRoleDataManager.getInstance().reloadRoleData();
close();
return;
}
return;
}
close();
}
});
NotificationManagerJob.addObserver(
UserAdminConstants.USER_AUTHENTICATION_CHANGED_TOPIC, this);
getShell().addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(DisposeEvent e) {
NotificationManagerJob.removeObserver(
UserAdminConstants.USER_AUTHENTICATION_CHANGED_TOPIC,
UserAdminSelectDlg.this);
}
});
populateLists();
}
/*
* (non-Javadoc)
*
* @see com.raytheon.viz.ui.dialogs.CaveSWTDialog#preOpened()
*/
@Override
protected void preOpened() {
shell.setMinimumSize(550, 405);
super.preOpened();
}
/**
* Creates Tabs.
*
* @param tabFolder
*/
private void createTabs(TabFolder tabFolder) {
String app = appCombo.getItem(appCombo.getSelectionIndex());
userTab = new TabItem(tabFolder, SWT.NONE);
userTab.setText(" " + app + " Users ");
GridData gd = new GridData(SWT.CENTER, SWT.DEFAULT, true, false);
GridLayout gl = new GridLayout(3, false);
gl.verticalSpacing = 2;
gl.horizontalSpacing = 2;
gl.marginWidth = 2;
Composite userComp = new Composite(tabFolder, SWT.NONE);
userComp.setLayout(gl);
userComp.setLayoutData(gd);
userTab.setControl(userComp);
gd = new GridData(SWT.FILL, SWT.FILL, true, true);
gl = new GridLayout(1, false);
Composite listComp = new Composite(userComp, SWT.NONE);
listComp.setLayout(gl);
listComp.setLayoutData(gd);
Label label = new Label(listComp, SWT.NONE);
label.setText("Selected Users:");
GridData listData = new GridData(SWT.FILL, SWT.FILL, true, true);
listData.widthHint = 150;
listData.heightHint = 175;
userList = new List(listComp, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL
| SWT.H_SCROLL);
userList.setLayoutData(listData);
userList.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
if (userList.getSelectionCount() == 0) {
deleteUserBtn.setEnabled(false);
editUserBtn.setEnabled(false);
} else {
deleteUserBtn.setEnabled(true);
editUserBtn.setEnabled(true);
}
populateUserRoleList();
}
});
gd = new GridData(SWT.DEFAULT, SWT.CENTER, false, false);
gl = new GridLayout(1, false);
Composite userBtnComp = new Composite(userComp, SWT.NONE);
userBtnComp.setLayout(gl);
userBtnComp.setLayoutData(gd);
int buttonWidth = 75;
GridData btnData = new GridData(buttonWidth, SWT.DEFAULT);
Button newBtn = new Button(userBtnComp, SWT.PUSH);
newBtn.setText("New...");
newBtn.setLayoutData(btnData);
newBtn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
handleNewUser();
}
});
btnData = new GridData(buttonWidth, SWT.DEFAULT);
editUserBtn = new Button(userBtnComp, SWT.PUSH);
editUserBtn.setText("Edit...");
editUserBtn.setLayoutData(btnData);
editUserBtn.setEnabled(false);
editUserBtn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
handleEditUser();
populateUserRoleList();
}
});
btnData = new GridData(buttonWidth, SWT.DEFAULT);
deleteUserBtn = new Button(userBtnComp, SWT.PUSH);
deleteUserBtn.setText("Delete");
deleteUserBtn.setLayoutData(btnData);
deleteUserBtn.setEnabled(false);
deleteUserBtn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
handleDeleteUser();
}
});
gd = new GridData(SWT.FILL, SWT.FILL, true, true);
gl = new GridLayout(1, false);
Composite userRoleComp = new Composite(userComp, SWT.NONE);
userRoleComp.setLayout(gl);
userRoleComp.setLayoutData(gd);
listData = new GridData(SWT.FILL, SWT.FILL, true, true);
listData.widthHint = 200;
listData.heightHint = 175;
Label l = new Label(userRoleComp, SWT.NONE);
l.setText("Defined Roles/Permissions:");
userPermList = new List(userRoleComp, SWT.BORDER | SWT.MULTI
| SWT.V_SCROLL | SWT.H_SCROLL);
userPermList.setLayoutData(listData);
userPermList.addMouseListener(new MouseAdapter() {
@Override
public void mouseDown(MouseEvent arg0) {
if (arg0.button == 3) {
showPermissionMenu(userPermList);
}
}
});
/************************************************************************************************/
// Roles tab
roleTab = new TabItem(tabFolder, SWT.NONE);
roleTab.setText(" " + app + " Roles ");
gd = new GridData(SWT.CENTER, SWT.DEFAULT, true, false);
gl = new GridLayout(3, false);
gl.verticalSpacing = 2;
gl.horizontalSpacing = 2;
gl.marginWidth = 2;
Composite roleComp = new Composite(tabFolder, SWT.NONE);
roleComp.setLayout(gl);
roleComp.setLayoutData(gd);
roleTab.setControl(roleComp);
gd = new GridData(SWT.FILL, SWT.FILL, true, true);
gl = new GridLayout(1, false);
Composite listComp2 = new Composite(roleComp, SWT.NONE);
listComp2.setLayout(gl);
listComp2.setLayoutData(gd);
Label roleLabel = new Label(listComp2, SWT.NONE);
roleLabel.setText("Defined Roles:");
listData = new GridData(SWT.FILL, SWT.FILL, true, true);
listData.widthHint = 150;
listData.heightHint = 175;
roleList = new List(listComp2, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL
| SWT.H_SCROLL);
roleList.setLayoutData(listData);
roleList.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
if (roleList.getSelectionCount() == 0) {
deleteRoleBtn.setEnabled(false);
editRoleBtn.setEnabled(false);
} else {
deleteRoleBtn.setEnabled(true);
editRoleBtn.setEnabled(true);
}
populatePermissionList();
}
});
roleList.addMouseListener(new MouseAdapter() {
@Override
public void mouseDown(MouseEvent arg0) {
if (arg0.button == 3) {
showPermissionMenu(roleList);
}
}
});
gd = new GridData(SWT.DEFAULT, SWT.CENTER, false, false);
gl = new GridLayout(1, false);
Composite roleBtnComp = new Composite(roleComp, SWT.NONE);
roleBtnComp.setLayout(gl);
roleBtnComp.setLayoutData(gd);
btnData = new GridData(buttonWidth, SWT.DEFAULT);
Button newRoleBtn = new Button(roleBtnComp, SWT.PUSH);
newRoleBtn.setText("New...");
newRoleBtn.setLayoutData(btnData);
newRoleBtn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
handleNewRole();
}
});
btnData = new GridData(buttonWidth, SWT.DEFAULT);
editRoleBtn = new Button(roleBtnComp, SWT.PUSH);
editRoleBtn.setText("Edit...");
editRoleBtn.setLayoutData(btnData);
editRoleBtn.setEnabled(false);
editRoleBtn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
handleEditRole();
populateUserRoleList();
}
});
btnData = new GridData(buttonWidth, SWT.DEFAULT);
deleteRoleBtn = new Button(roleBtnComp, SWT.PUSH);
deleteRoleBtn.setText("Delete");
deleteRoleBtn.setLayoutData(btnData);
deleteRoleBtn.setEnabled(false);
deleteRoleBtn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
handleDeleteRole();
}
});
gd = new GridData(SWT.FILL, SWT.FILL, true, true);
gl = new GridLayout(1, false);
Composite permComp = new Composite(roleComp, SWT.NONE);
permComp.setLayout(gl);
permComp.setLayoutData(gd);
listData = new GridData(SWT.FILL, SWT.FILL, true, true);
listData.widthHint = 200;
listData.heightHint = 175;
Label l2 = new Label(permComp, SWT.NONE);
l2.setText("Roles/Permissions:");
rolePermList = new List(permComp, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL
| SWT.H_SCROLL);
rolePermList.setLayoutData(listData);
rolePermList.addMouseListener(new MouseAdapter() {
@Override
public void mouseDown(MouseEvent arg0) {
if (arg0.button == 3) {
showPermissionMenu(rolePermList);
}
}
});
}
/**
* Populates Lists
*/
private void populateLists() {
NwsRoleDataManager man = NwsRoleDataManager.getInstance();
if (appCombo.isDisposed() || userList.isDisposed()
|| userTab.isDisposed() || roleTab.isDisposed()
|| roleList.isDisposed()) {
return;
}
String app = appCombo.getItem(appCombo.getSelectionIndex());
userTab.setText(app + " Users");
roleTab.setText(app + " Roles");
int selection = 0;
if (userList.getSelectionIndex() != -1) {
selection = userList.getSelectionIndex();
}
userList.setItems(man.getRoleData(app).getUsers());
if (selection < userList.getItemCount()) {
userList.select(selection);
editUserBtn.setEnabled(true);
deleteUserBtn.setEnabled(true);
} else {
editUserBtn.setEnabled(false);
deleteUserBtn.setEnabled(false);
}
populateUserRoleList();
if (roleList.getSelectionIndex() != -1) {
selection = roleList.getSelectionIndex();
} else {
selection = 0;
}
roleList.setItems(man.getRoleData(app).getRoles());
if (selection < roleList.getItemCount()) {
roleList.select(selection);
editRoleBtn.setEnabled(true);
deleteRoleBtn.setEnabled(true);
} else {
editRoleBtn.setEnabled(false);
deleteRoleBtn.setEnabled(false);
}
populatePermissionList();
}
/**
* Populates User Role List.
*/
private void populateUserRoleList() {
NwsRoleDataManager man = NwsRoleDataManager.getInstance();
if (appCombo.isDisposed() || userList.isDisposed()
|| userPermList.isDisposed()) {
return;
}
String app = appCombo.getItem(appCombo.getSelectionIndex());
if (userList.getSelectionIndex() != -1) {
String user = userList.getItem(userList.getSelectionIndex());
String[] roles = man.getUserRoles(user, app);
String[] perms = man.getUserPermissions(user, app);
ArrayList<String> rp = new ArrayList<String>();
for (String role : roles) {
rp.add(role);
}
for (String perm : perms) {
rp.add(perm);
}
String[] rpArray = rp.toArray(new String[rp.size()]);
Arrays.sort(rpArray);
userPermList.setItems(rpArray);
}
}
/**
* Populates Permission List.
*/
private void populatePermissionList() {
NwsRoleDataManager man = NwsRoleDataManager.getInstance();
rolePermList.removeAll();
String app = appCombo.getItem(appCombo.getSelectionIndex());
if (roleList.getSelectionIndex() != -1) {
String roleId = roleList.getItem(roleList.getSelectionIndex());
String[] perms = man.getRolePermissions(roleId, app);
Arrays.sort(perms);
rolePermList.setItems(perms);
}
}
/**
* Opens Add New User dialog.
*/
private void handleNewUser() {
NewDlg ad = new NewDlg(this.shell, "User", selectedApplication);
ad.open();
populateLists();
}
/**
* Opens Delete User dialog.
*/
private void handleDeleteUser() {
String user = userList.getItem(userList.getSelectionIndex());
MessageBox messageDialog = new MessageBox(this.shell, SWT.YES | SWT.NO);
messageDialog.setText("Delete user - " + user);
messageDialog
.setMessage("Are you sure you wish to delete user " + user);
int response = messageDialog.open();
if (response == SWT.YES) {
NwsRoleDataManager man = NwsRoleDataManager.getInstance();
String app = appCombo.getItem(appCombo.getSelectionIndex());
man.deleteUser(user, app);
dirty = true;
}
populateLists();
}
/**
* Opens Edit Role dialog.
*/
private void handleEditRole() {
String role = roleList.getItem(roleList.getSelectionIndex());
ManageUserDlg mud = new ManageUserDlg(this.shell, "Role", role,
selectedApplication);
boolean changes = (Boolean) mud.open();
if (changes) {
dirty = true;
}
}
/**
* Opens Delete Role dialog.
*/
private void handleDeleteRole() {
String role = roleList.getItem(roleList.getSelectionIndex());
MessageBox messageDialog = new MessageBox(this.shell, SWT.YES | SWT.NO);
messageDialog.setText("Delete role - " + role);
messageDialog
.setMessage("Are you sure you wish to delete role " + role);
int response = messageDialog.open();
if (response == SWT.YES) {
NwsRoleDataManager man = NwsRoleDataManager.getInstance();
String app = appCombo.getItem(appCombo.getSelectionIndex());
man.deleteRole(role, app);
dirty = true;
}
populateLists();
}
/**
* Opens Add New Role dialog.
*/
private void handleNewRole() {
NewDlg ad;
if (selectedApplication.equalsIgnoreCase("Localization")) {
ad = new NewDlg(this.shell, "Permission", selectedApplication);
} else {
ad = new NewDlg(this.shell, "Role", selectedApplication);
}
ad.open();
populateLists();
}
/**
* Opens Edit User dialog.
*/
private void handleEditUser() {
String user = userList.getItem(userList.getSelectionIndex());
ManageUserDlg mud = new ManageUserDlg(this.shell, "User", user,
selectedApplication);
boolean changes = (Boolean) mud.open();
if (changes) {
dirty = true;
}
}
/**
* Shows Permission context menu.
*
* @param list
*/
private void showPermissionMenu(final List list) {
if (list.getSelectionCount() > 0) {
Menu menu = new Menu(shell, SWT.POP_UP);
MenuItem item1 = new MenuItem(menu, SWT.PUSH);
item1.setText("Description...");
item1.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent arg0) {
String selection = list.getItem(list.getSelectionIndex());
StringBuilder messageText = new StringBuilder();
boolean roleFlag = false;
NwsRoleDataManager man = NwsRoleDataManager.getInstance();
for (RoleXML role : man.getRoleData(selectedApplication)
.getRoleList()) {
if (selection.equals(role.getRoleId())) {
messageText.append(getRoleDetails(role));
roleFlag = true;
break;
}
}
if (!roleFlag) {
for (PermissionXML perm : man.getRoleData(
selectedApplication).getPermissionList()) {
if (perm.getId().equals(selection)) {
messageText.append(getPermissionDetails(perm));
break;
}
}
}
if (messageText.length() == 0) {
messageText.append("No Description");
}
MessageBox messageDialog = new MessageBox(shell,
SWT.ICON_INFORMATION);
if (roleFlag) {
messageDialog.setText("Role Description");
} else {
messageDialog.setText("Permission Description");
}
messageDialog.setMessage(messageText.toString());
messageDialog.open();
}
});
shell.setMenu(menu);
menu.setVisible(true);
}
}
/**
* Gets Role Details.
*
* @param role
* @return
*/
private String getRoleDetails(RoleXML role) {
StringBuilder details = new StringBuilder();
details.append("Role: ").append(role.getRoleId());
details.append("\n\nDescription: ").append(
role.getRoleDescription().trim());
if (!role.getPermissionList().isEmpty()) {
details.append("\n\nPermissions: ");
for (String perm : role.getPermissionList()) {
details.append("\n ").append(perm);
}
}
return details.toString();
}
/**
* Gets Permission Details.
*
* @param perm
* @return
*/
private String getPermissionDetails(PermissionXML perm) {
StringBuilder details = new StringBuilder();
details.append("Permission: ").append(perm.getId());
details.append("\n\nDescription: ").append(perm.getDescription());
return details.toString();
}
/**
* Handle OK button.
*/
private void handleOK() {
NwsRoleDataManager manager = NwsRoleDataManager.getInstance();
manager.save(selectedApplication);
dirty = false;
}
/**
* {@inheritDoc}
*/
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.common.jms.notification.INotificationObserver#
* notificationArrived
* (com.raytheon.uf.common.jms.notification.NotificationMessage[])
*/
@Override
public void notificationArrived(NotificationMessage[] messages) {
VizApp.runAsync(new Runnable() {
@Override
public void run() {
NwsRoleDataManager.getInstance().reloadRoleData();
if (!UserAdminSelectDlg.this.isDisposed()) {
populateLists();
}
}
});
}
}

View file

@ -1,132 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.viz.core.graphing.util;
import org.geotools.coverage.grid.GeneralGridEnvelope;
import org.geotools.coverage.grid.GridGeometry2D;
import org.geotools.geometry.GeneralEnvelope;
import com.raytheon.uf.common.wxmath.DistFilter;
import com.raytheon.uf.common.wxmath.ScalelessAnalysis;
import com.raytheon.uf.viz.core.interp.IInterpolation;
import com.raytheon.uf.viz.core.interp.InterpolationRequest;
import com.raytheon.uf.viz.core.interp.InterpolationResult;
import com.raytheon.viz.core.slice.request.HeightScale.ScaleType;
/**
*
* Interpolation which uses functionality from A1 meteolib to map scattered
* points onto a grid.
*
* <pre>
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* May 12, 2010 bsteffen Initial creation
* Aug 20, 2013 2262 njensen Use wxmath instead of meteolib
*
* </pre>
*
* @author bsteffen
* @version 1.0
*/
public class MeteolibInterpolation implements IInterpolation {
private ScaleType scale;
public MeteolibInterpolation(ScaleType scale) {
this.scale = scale;
}
/*
* (non-Javadoc)
*
* @seecom.raytheon.uf.viz.core.interp.IInterpolation#interpolate(
* com.raytheon.uf.viz.core.interp.InterpolationRequest,
* org.geotools.coverage.grid.GridGeometry2D)
*/
@Override
public InterpolationResult interpolate(InterpolationRequest request) {
if (request.getXData().length == 0) {
throw new IllegalArgumentException(
"No Data Available for Interpolation");
}
float maxX = request.getMaxX();
float minX = request.getMinX();
float maxY = request.getMaxY();
float minY = request.getMinY();
float gridX = request.getGridX();
float gridY = request.getGridY();
float[] x = request.getXData();
float[] y = request.getYData();
float[] z = request.getZData();
float logMinY = (float) Math.log10(minY);
float logMaxY = (float) Math.log10(maxY);
for (int i = 0; i < x.length; i++) {
if (scale == ScaleType.LOG) {
y[i] = (float) ((Math.log10(y[i]) - logMinY)
/ (logMaxY - logMinY) * (gridY - 1));
} else {
y[i] = (y[i] - minY) / (maxY - minY) * (gridY - 1);
}
x[i] = (x[i] - minX) / (maxX - minX) * (gridX - 1);
if (x[i] < 0 || y[i] < 0 || x[i] > gridX - 1 || y[i] > gridY - 1) {
z[i] = 1e37f;
}
}
float[] grid = ScalelessAnalysis.scaleless_analysis(x, y, z, x.length,
(int) gridX, (int) gridY);
float[] newgrid = DistFilter.filter(grid, 5.0f, (int) gridX,
(int) gridY, 1);
for (int i = 0; i < grid.length; i++) {
if (newgrid[i] < -999999 || newgrid[i] > 999999) {
newgrid[i] = grid[i];
}
if (newgrid[i] < -999999 || newgrid[i] > 999999) {
newgrid[i] = -999999;
}
}
grid = newgrid;
InterpolationResult result = new InterpolationResult();
result.setValues(grid);
double nminX = Math.min(minX, maxX);
double nmaxX = Math.max(minX, maxX);
double nminY = Math.min(minY, maxY);
double nmaxY = Math.max(minY, maxY);
double xinc = (nmaxX - nminX) / gridX;
double yinc = (nmaxY - nminY) / gridY;
nminX -= xinc / 2;
nmaxX += xinc / 2;
nminY -= yinc / 2;
nmaxY += yinc / 2;
GeneralEnvelope env = new GeneralEnvelope(
new double[] { nminX, nminY }, new double[] { nmaxX, nmaxY });
GeneralGridEnvelope range = new GeneralGridEnvelope(new int[] { 0, 0 },
new int[] { (int) gridX, (int) gridY }, false);
result.setGeometry(new GridGeometry2D(range, env));
return result;
}
}

View file

@ -1,75 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.viz.geotiff;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
/**
* The activator class controls the plug-in life cycle
*/
public class Activator extends AbstractUIPlugin {
// The plug-in ID
public static final String PLUGIN_ID = "com.raytheon.viz.geotiff";
// The shared instance
private static Activator plugin;
/**
* The constructor
*/
public Activator() {
}
/*
* (non-Javadoc)
*
* @see
* org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext
* )
*/
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
}
/*
* (non-Javadoc)
*
* @see
* org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext
* )
*/
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
}
/**
* Returns the shared instance
*
* @return the shared instance
*/
public static Activator getDefault() {
return plugin;
}
}

View file

@ -1,23 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
/**
* GeoTIFF Resource support
*/
package com.raytheon.viz.geotiff.rsc;

View file

@ -1,201 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.viz.gfe;
import java.io.File;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.Timer;
import java.util.TimerTask;
import jep.Jep;
import jep.JepConfig;
import jep.JepException;
import jep.NamingConventionClassEnquirer;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import com.raytheon.uf.common.dataplugin.gfe.python.GfePyIncludeUtil;
import com.raytheon.uf.common.python.PyUtil;
import com.raytheon.uf.common.python.PythonIncludePathUtil;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.common.time.util.TimeUtil;
import com.raytheon.uf.common.util.FileUtil;
import com.raytheon.uf.viz.core.VizApp;
import com.raytheon.viz.gfe.python.GfeCavePyIncludeUtil;
import com.raytheon.viz.ui.personalities.awips.AbstractAWIPSComponent;
/**
* GFE Client application component
*
* <pre>
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jun 25, 2010 mschenke Initial creation
* Aug 20, 2012 #1081 dgilling Don't pass -server and -site args
* to python script.
* Sep 11, 2013 #2033 dgilling Update path to utilityDir and pyVizDir,
* now that they're no longer in
* localization store.
* Dec 04, 2013 #2588 dgilling Add thread to force shutdown.
* Mar 25, 2014 #2963 randerso Removed obsolete python_include support
* which was adding an empty string into the
* python path causing python to look in user's
* current default directory for modules.
* Aug 22, 2014 3500 bclement override postStartupActions()
* Aug 29, 2014 3500 bclement removed override of postStartupActions()
* since ProcedureXMLManager startup was moved to the CAVE subclass
* Apr 26, 2015 4259 njensen Updated for new JEP API
* May 20, 2015 4509 njensen Added time and dataaccess to include path
* Apr 28, 2016 5236 njensen Use Jep redirectOutput for python prints
* Jul 19, 2017 ---- mjames@ucar Add common python include path.
*
* </pre>
*
* @author mschenke
*/
public class GfeClient extends AbstractAWIPSComponent {
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(GfeClient.class);
@Override
protected void startInternal(String componentName) throws Exception {
long t0 = System.currentTimeMillis();
String[] args = Platform.getApplicationArgs();
int gfeClientArgStartIndex = -1;
for (int i = 0; i < args.length; ++i) {
String arg = args[i];
if (componentName.equals(arg)) {
gfeClientArgStartIndex = i + 1;
break;
}
}
if ((gfeClientArgStartIndex == -1)
|| (gfeClientArgStartIndex == args.length)) {
System.err.println("No python script specified to run - exiting");
return;
}
System.out.println("Running script: " + args[gfeClientArgStartIndex]);
String pyVizDir = new File(FileLocator.resolve(
FileLocator.find(Activator.getDefault().getBundle(), new Path(
FileUtil.join("python", "pyViz")), null)).getPath())
.getPath();
String utilityDir = new File(FileLocator.resolve(
FileLocator.find(Activator.getDefault().getBundle(), new Path(
FileUtil.join("python", "utility")), null)).getPath())
.getPath();
boolean includeUser = (!VizApp.getWsId().getUserName().equals("SITE"));
String includePath = PyUtil.buildJepIncludePath(true, utilityDir,
PythonIncludePathUtil.getCommonPythonIncludePath(),
PythonIncludePathUtil.getCommonPythonIncludePath("time",
"dataaccess"), GfePyIncludeUtil
.getCommonGfeIncludePath(), GfePyIncludeUtil
.getConfigIncludePath(includeUser), pyVizDir,
GfePyIncludeUtil.getUtilitiesIncludePath(includeUser),
GfePyIncludeUtil.getIToolIncludePath(), GfePyIncludeUtil
.getVtecIncludePath(), GfePyIncludeUtil
.getHeadlineIncludePath(), GfeCavePyIncludeUtil
.getAutotestIncludePath(), GfePyIncludeUtil
.getTextUtilitiesIncludePath(includeUser),
GfePyIncludeUtil.getTextProductsIncludePath(includeUser),
GfePyIncludeUtil.getCombinationsIncludePath(includeUser),
GfeCavePyIncludeUtil.getTestsIncludePath(), GfePyIncludeUtil
.getProceduresIncludePath(includeUser));
Jep jep = null;
try {
JepConfig config = new JepConfig().setInteractive(false)
.setIncludePath(includePath)
.setClassLoader(GfeClient.class.getClassLoader())
.setClassEnquirer(new NamingConventionClassEnquirer())
.setRedirectOutputStreams(true);
jep = new Jep(config);
jep.eval("import sys");
jep.eval("sys.argv = []");
boolean skipNextArg = false;
Collection<String> ignoredParams = getIgnoredParameters();
for (int i = gfeClientArgStartIndex; i < args.length; i++) {
if (ignoredParams.contains(args[i])) {
skipNextArg = true;
} else if (skipNextArg) {
skipNextArg = false;
} else {
jep.eval("sys.argv.append('"
+ args[i].replaceAll("'", "\\\\'") + "')");
}
}
jep.runScript(args[gfeClientArgStartIndex]);
// jep.eval("main()");
} catch (JepException e) {
statusHandler.handle(Priority.ERROR, e.getLocalizedMessage(), e);
}
if (jep != null) {
jep.close();
}
long t1 = System.currentTimeMillis();
System.out.println("Entire execution to run python script: "
+ (t1 - t0));
// operationally, we've found situations where gfeclient jobs seem to
// hang around running even though all non-daemon threads have completed
// their work. So, in attempt to prevent those cases from hanging around
// as "zombie" processes let's set a timer to kill the JVM if things
// haven't exited by themselves.
Timer shutdownTimer = new Timer("gfe-client-shutdown", true);
TimerTask shutdownTask = new TimerTask() {
@Override
public void run() {
statusHandler
.warn("GFEClient should have already exited, but it hasn't. Manually exiting.");
System.exit(0);
}
};
shutdownTimer.schedule(shutdownTask, 45 * TimeUtil.MILLIS_PER_SECOND);
}
@Override
protected int getRuntimeModes() {
return (NON_UI | ALERT_VIZ);
}
private Collection<String> getIgnoredParameters() {
return new HashSet<>(
Arrays.asList("-site", "-server", "-mode", "-time"));
}
}

View file

@ -1,127 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.viz.gfe.dialogs.sbu;
import java.util.Set;
import com.raytheon.uf.common.auth.user.IUser;
import com.raytheon.uf.common.dataplugin.gfe.request.CheckPermissionsRequest;
import com.raytheon.uf.common.dataplugin.gfe.request.CheckServiceBackupPrimarySiteRequest;
import com.raytheon.uf.common.dataplugin.gfe.request.GetServiceBackupPrimarySiteRequest;
import com.raytheon.uf.common.dataplugin.gfe.server.message.ServerResponse;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.viz.core.VizApp;
import com.raytheon.uf.viz.core.auth.UserController;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.requests.ThriftClient;
/**
* A utility class for the Service Backup GUI to do permissions checks.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Aug 11, 2011 bphillip Initial creation
* Nov 14, 2012 jdynina Added check for national center
* May 02, 2013 #1762 dgilling Replace national center check with
* a svcbu PRIMARY_SITES check.
* Jul 22, 2013 #1762 dgilling Ensure all fields of
* CheckServiceBackupPrimarySiteRequest are
* filled.
* Jun 10, 2013 DR-17401 lshi Added getPrimarySites()
* </pre>
*
* @author bphillip
* @version 1.0
*/
public class CheckPermissions {
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(CheckPermissions.class);
/**
* A private constructor so that Java does not attempt to create one for us.
* As this class should not be instantiated, do not attempt to ever call
* this constructor; it will simply throw an AssertionError.
*
*/
private CheckPermissions() {
throw new AssertionError();
}
@SuppressWarnings("unchecked")
public static boolean getAuthorization() {
boolean authorized = false;
IUser user = UserController.getUserObject();
CheckPermissionsRequest request = new CheckPermissionsRequest();
request.setUser(user);
try {
ServerResponse<String> obj = (ServerResponse<String>) ThriftClient
.sendRequest(request);
if (obj.isOkay()) {
authorized = true;
} else {
authorized = false;
}
} catch (VizException e) {
statusHandler.error("Error checking permissions for: " + user, e);
authorized = false;
}
return authorized;
}
public static boolean runningAsPrimary(String siteId) {
CheckServiceBackupPrimarySiteRequest request = new CheckServiceBackupPrimarySiteRequest();
request.setSiteID(siteId);
request.setWorkstationID(VizApp.getWsId());
try {
@SuppressWarnings("unchecked")
ServerResponse<Boolean> sr = (ServerResponse<Boolean>) ThriftClient
.sendRequest(request);
return sr.getPayload();
} catch (VizException e) {
statusHandler
.error("Error checking if running as primary site!", e);
}
return false;
}
public static Set<String> getPrimarySites() {
Set <String> primary = null;
GetServiceBackupPrimarySiteRequest request = new GetServiceBackupPrimarySiteRequest();
try {
@SuppressWarnings("unchecked")
ServerResponse<Set<String>> sr = (ServerResponse<Set<String>>) ThriftClient
.sendRequest(request);
primary = sr.getPayload();
return primary;
} catch (VizException e) {
statusHandler
.error("Error getting primary site(s)!", e);
}
return primary;
}
}

View file

@ -1,29 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!--
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.
-->
<parameterList>
<parameter abbrev="RR" productCodes="153 94 20 19"/>
<parameter abbrev="RRV" productCodes="154 99 27 25"/>
<parameter abbrev="BASSW" productCodes="185 28 29 30"/>
<parameter abbrev="ZDR" productCodes="159 158"/>
<parameter abbrev="KDP" productCodes="163 162"/>
<parameter abbrev="COCO" productCodes="161 160"/>
<parameter abbrev="HC" productCodes="165 164"/>
</parameterList>

View file

@ -1,163 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.viz.grid.data;
import java.io.File;
import java.lang.ref.WeakReference;
import javax.measure.converter.UnitConverter;
import javax.measure.unit.Unit;
import com.raytheon.uf.common.colormap.prefs.ColorMapParameters;
import com.raytheon.uf.common.dataplugin.HDF5Util;
import com.raytheon.uf.common.dataplugin.grid.GridRecord;
import com.raytheon.uf.common.dataplugin.grid.derivparam.data.GridRequestableData;
import com.raytheon.uf.common.dataplugin.grid.derivparam.data.SliceUtil;
import com.raytheon.uf.common.dataplugin.level.LevelFactory;
import com.raytheon.uf.common.dataplugin.radar.RadarRecord;
import com.raytheon.uf.common.dataplugin.radar.util.RadarDataRetriever;
import com.raytheon.uf.common.dataplugin.radar.util.RadarMapper;
import com.raytheon.uf.common.datastorage.DataStoreFactory;
import com.raytheon.uf.common.datastorage.IDataStore;
import com.raytheon.uf.common.datastorage.Request;
import com.raytheon.uf.common.datastorage.records.FloatDataRecord;
import com.raytheon.uf.common.datastorage.records.IDataRecord;
import com.raytheon.uf.common.gridcoverage.GridCoverage;
import com.raytheon.uf.common.inventory.exception.DataCubeException;
import com.raytheon.uf.common.parameter.Parameter;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.viz.grid.util.RadarAdapter;
/**
* A requestable data record which wraps a RadarRecord and can convert radar
* radial data into the expected radar projection and units.
*
* <pre>
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 18, 2010 4473 rjpeter Initial creation
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
* Sep 09, 2014 3356 njensen Remove CommunicationException
*
* </pre>
*
* @author rjpeter
* @version 1.0
*/
public class RadarRequestableData extends GridRequestableData {
private final RadarRecord radarSource;
private final RadarMapper tiler;
private WeakReference<FloatDataRecord> cache = null;
public RadarRequestableData(RadarRecord source, String parameterAbbrev)
throws VizException {
this.radarSource = source;
source.setAddSpatial(false);
// set unit converter here
ColorMapParameters cMapParams = RadarAdapter.getColorMap(radarSource);
Unit<?> unit = cMapParams.getDisplayUnit();
this.tiler = new RadarMapper(radarSource, RadarAdapter.getGridSize(),
RadarAdapter.getGridSpacing());
this.source = "radar";
this.dataTime = source.getDataTime();
this.space = RadarAdapter.getInstance().getCoverage();
this.level = LevelFactory.getInstance().getLevel("TILT",
source.getPrimaryElevationAngle());
this.parameter = parameterAbbrev;
this.parameterName = "";
this.unit = unit;
try {
GridRecord record = new GridRecord();
record.setDatasetId(this.source);
record.setLocation(RadarAdapter.getInstance().getCoverage());
record.setLevel(this.level);
Parameter parameter = new Parameter(parameterAbbrev,
this.parameterName, unit);
record.setParameter(parameter);
record.setDataTime(source.getDataTime());
setGridSource(record);
} catch (Exception e) {
throw new VizException(e);
}
}
@Override
public IDataRecord[] getDataValue(Object arg) throws DataCubeException {
FloatDataRecord fdr = null;
if (cache != null) {
fdr = cache.get();
}
if (fdr == null) {
File loc = HDF5Util.findHDF5Location(radarSource);
IDataStore dataStore = DataStoreFactory.getDataStore(loc);
try {
RadarDataRetriever.populateRadarRecord(dataStore, radarSource);
} catch (Exception e) {
throw new DataCubeException(
"Error Retrieving Data from Radar Record", e);
}
// Call radar tiler to get tile data, look up color map to translate
// to float
ColorMapParameters cMapParams;
try {
cMapParams = RadarAdapter.getColorMap(radarSource);
} catch (VizException e) {
throw new DataCubeException(e);
}
cMapParams.setDataUnit(radarSource.getDataUnit());
/*
* UnitConverter dataToImage =
* DataUtilities.getDataToImageConverter( radarSource, cMapParams);
* tiler.setDataToImageConverter(dataToImage);
*/
Unit<?> unit = cMapParams.getDisplayUnit();
getGridSource().getParameter().setUnit(unit);
setUnit(unit);
UnitConverter converter = cMapParams.getDataToDisplayConverter();
tiler.setDataConverter(converter);
// Based off looking at Awips I Col Max reflectivity it looks like
// they use -10 when there is no data.
tiler.setNan(-10);
float[] data = tiler.createImage();
fdr = new FloatDataRecord();
fdr.setFloatData(data);
GridCoverage coverage = gridSource.getLocation();
fdr.setSizes(new long[] { coverage.getNx(), coverage.getNy() });
fdr.setDimension(2);
cache = new WeakReference<FloatDataRecord>(fdr);
}
if (arg instanceof Request) {
fdr = SliceUtil.slice(fdr, (Request) arg);
return new IDataRecord[] { fdr };
} else {
return new IDataRecord[] { fdr };
}
}
}

View file

@ -1,91 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.viz.grid.data;
import javax.measure.unit.SI;
import com.raytheon.uf.common.inventory.data.AbstractRequestableData;
import com.raytheon.uf.common.inventory.exception.DataCubeException;
import com.raytheon.uf.common.dataplugin.grid.derivparam.data.SliceUtil;
import com.raytheon.uf.common.dataplugin.level.Level;
import com.raytheon.uf.common.datastorage.Request;
import com.raytheon.uf.common.datastorage.records.FloatDataRecord;
import com.raytheon.uf.common.gridcoverage.GridCoverage;
import com.raytheon.viz.grid.util.TiltUtils;
import com.vividsolutions.jts.geom.Coordinate;
/**
* Requestable Data that generated tilt elevation.
*
* <pre>
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jan 15, 2010 rjpeter Initial creation
*
* </pre>
*
* @author rjpeter
* @version 1.0
*/
public class TiltRequestableData extends AbstractRequestableData {
public static class TiltCenterPoint {
private final Coordinate latLon;
public TiltCenterPoint(Coordinate latLon) {
this.latLon = latLon;
}
}
public TiltRequestableData(String modelName, Level tiltAngle,
GridCoverage coverage) {
this.source = modelName;
this.unit = SI.METER;
this.parameter = "TILT";
this.parameterName = "TILT";
this.level = tiltAngle;
this.space = coverage;
}
@Override
public FloatDataRecord getDataValue(Object arg) throws DataCubeException {
GridCoverage coverage = (GridCoverage) getSpace();
FloatDataRecord fdr = null;
if (arg instanceof TiltCenterPoint) {
Coordinate tiltLoc = ((TiltCenterPoint) arg).latLon;
fdr = TiltUtils.getInstance().getHeightGrid(tiltLoc, coverage,
level.getLevelonevalue());
} else {
fdr = TiltUtils.getInstance().getHeightGrid(coverage,
level.getLevelonevalue());
}
if (fdr != null && arg instanceof Request) {
return SliceUtil.slice(fdr, (Request) arg);
} else {
return fdr;
}
}
}

View file

@ -1,57 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.viz.grid.inv;
import java.util.List;
import com.raytheon.uf.common.derivparam.tree.AbstractCubeLevelNode;
import com.raytheon.uf.common.inventory.tree.AbstractRequestableNode;
import com.raytheon.uf.common.inventory.tree.CubeLevel;
/**
*
* Implementation of {@link AbstractCubeLevelNode} that is intended specifically
* for cubes of data from a radar source.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------- -------- --------- -------------------------------------
* Jan 19, 2010 4126 bsteffen Initial creation
* Mar 22, 2016 5439 bsteffen Remove unneccessary constructor arg.
*
* </pre>
*
* @author bsteffen
*/
public class RadarCubeLevelNode extends AbstractCubeLevelNode {
public RadarCubeLevelNode(AbstractCubeLevelNode that) {
super(that);
}
public RadarCubeLevelNode(
List<CubeLevel<AbstractRequestableNode, AbstractRequestableNode>> levels,
String modelName) {
super(levels, modelName);
}
}

View file

@ -1,229 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.viz.grid.inv;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import com.raytheon.uf.common.inventory.data.AbstractRequestableData;
import com.raytheon.uf.common.inventory.exception.DataCubeException;
import com.raytheon.uf.common.inventory.TimeAndSpace;
import com.raytheon.uf.common.inventory.tree.LevelNode;
import com.raytheon.uf.common.dataplugin.radar.RadarRecord;
import com.raytheon.uf.common.dataquery.requests.DbQueryRequest;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint.ConstraintType;
import com.raytheon.uf.common.dataquery.responses.DbQueryResponse;
import com.raytheon.uf.common.derivparam.tree.AbstractBaseDataNode;
import com.raytheon.uf.common.time.DataTime;
import com.raytheon.uf.viz.core.catalog.CatalogQuery;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.viz.grid.data.RadarRequestableData;
import com.raytheon.viz.grid.util.RadarAdapter;
/**
*
* A basic node which fulfills time and data requests by going to edex.
*
* <pre>
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Apr 13, 2010 #4473 rjpeter Initial creation
*
* </pre>
*
* @author bsteffen
* @version 1.0
*/
public class RadarRequestableLevelNode extends AbstractBaseDataNode {
protected static final String TIME_FIELD = "dataTime";
protected Map<String, RequestConstraint> rcMap;
protected String paramAbbrev;
protected String paramName;
/**
* Copy constructor
*
* @param that
*/
public RadarRequestableLevelNode(RadarRequestableLevelNode that) {
super(that);
this.rcMap = that.rcMap;
this.paramAbbrev = that.paramAbbrev;
this.paramName = that.paramName;
}
/**
* Create a new requestable Level Node that is LevelNode clone of that and
* uses rcMap for all Requests
*
* @param that
* @param rcMap
*/
public RadarRequestableLevelNode(LevelNode that,
Map<String, RequestConstraint> rcMap, String paramAbbrev,
String paramName) {
super(that);
this.rcMap = rcMap;
this.paramAbbrev = paramAbbrev;
this.paramName = paramName;
}
/**
* @param rcMap
* the rcMap to set
*/
public void setRequestConstraintMap(Map<String, RequestConstraint> rcMap) {
this.rcMap = rcMap;
}
public Map<String, RequestConstraint> getRequestConstraintMap() {
return rcMap;
}
@Override
public DbQueryRequest getAvailabilityRequest(
Map<String, RequestConstraint> originalConstraints) {
return null;
}
@Override
public Set<TimeAndSpace> getAvailability(
Map<String, RequestConstraint> originalConstraints, Object response)
throws DataCubeException {
Set<TimeAndSpace> resultsSet = RadarUpdater.getInstance()
.getTimes(this);
if (resultsSet != null) {
return resultsSet;
}
DataTime[] results;
try {
results = CatalogQuery.performTimeQuery(rcMap, false, null);
} catch (VizException e) {
throw new DataCubeException(e);
}
if (results != null) {
resultsSet = new HashSet<TimeAndSpace>(results.length);
for (int i = 0; i < results.length; i++) {
resultsSet.add(new TimeAndSpace(results[i], RadarAdapter
.getInstance().getCoverage()));
}
RadarUpdater.getInstance().setTimes(this, resultsSet);
return resultsSet;
} else {
return null;
}
}
@Override
public DbQueryRequest getDataRequest(
Map<String, RequestConstraint> orignalConstraints,
Set<TimeAndSpace> availability) {
Map<String, RequestConstraint> newQuery = new HashMap<String, RequestConstraint>(
rcMap);
DbQueryRequest dbRequest = new DbQueryRequest();
RequestConstraint dtRC = new RequestConstraint();
dtRC.setConstraintType(ConstraintType.IN);
for (TimeAndSpace ast : availability) {
dtRC.addToConstraintValueList(ast.getTime().toString());
}
newQuery.put("dataTime", dtRC);
newQuery.put("pluginName", new RequestConstraint("radar"));
dbRequest.setConstraints(newQuery);
return dbRequest;
}
@Override
public Set<AbstractRequestableData> getData(
Map<String, RequestConstraint> orignalConstraints,
Set<TimeAndSpace> availability, Object response)
throws DataCubeException {
List<Map<String, Object>> rows = ((DbQueryResponse) response)
.getResults();
Set<AbstractRequestableData> rval = new HashSet<AbstractRequestableData>(
rows.size());
// switch to GribRequestableData and build a grib record from the radar
// record... won't work because of the get data call, can't be a
// GribRecord, needs to call getDataValue on Requestable
for (Map<String, Object> objMap : rows) {
try {
rval.add(new RadarRequestableData((RadarRecord) objMap
.get(null), paramAbbrev));
} catch (VizException e) {
throw new DataCubeException(e);
}
}
return rval;
}
public String getParamAbbrev() {
return paramAbbrev;
}
@Override
public RadarRequestableLevelNode clone() {
return new RadarRequestableLevelNode(this);
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result + ((rcMap == null) ? 0 : rcMap.hashCode());
return result;
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
RadarRequestableLevelNode other = (RadarRequestableLevelNode) obj;
if (rcMap == null) {
if (other.rcMap != null)
return false;
} else if (!rcMap.equals(other.rcMap))
return false;
return true;
}
}

View file

@ -1,259 +0,0 @@
package com.raytheon.viz.grid.inv;
import java.util.Collection;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.raytheon.uf.common.dataplugin.grid.GridRecord;
import com.raytheon.uf.common.dataplugin.level.Level;
import com.raytheon.uf.common.dataplugin.level.LevelFactory;
import com.raytheon.uf.common.dataplugin.radar.RadarStation;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint.ConstraintType;
import com.raytheon.uf.common.inventory.TimeAndSpace;
import com.raytheon.uf.common.parameter.Parameter;
import com.raytheon.uf.common.time.DataTime;
import com.raytheon.uf.viz.core.alerts.AlertMessage;
import com.raytheon.viz.alerts.IAlertObserver;
import com.raytheon.viz.alerts.observers.ProductAlertObserver;
import com.raytheon.viz.grid.util.RadarAdapter;
import com.raytheon.viz.grid.util.RadarProductCodeMapping;
/**
*
* Listens for updates to radatr products and transforms them into grid updates
* so that radar data being used in grid derived parameters will update.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Sep 20, 2012 bsteffen Initial creation
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
* Feb 21, 2014 DR 16744 D. Friedman Support thin client updates
* Sep 09, 2014 3356 njensen Remove CommunicationException
*
* </pre>
*
* @author bsteffen
* @version 1.0
*/
public class RadarUpdater implements IAlertObserver {
protected static final int CACHE_SIZE = 100;
protected static final int CACHE_TIME = 60000;
private static RadarUpdater instance;
public static RadarUpdater getInstance() {
if (instance == null) {
instance = new RadarUpdater();
}
return instance;
}
private class CacheKey {
public CacheKey(Integer productCode, Double elevationAngle) {
this.elevationAngle = elevationAngle;
this.productCode = productCode;
}
public Integer productCode;
public Double elevationAngle;
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = (prime * result)
+ ((elevationAngle == null) ? 0 : elevationAngle.hashCode());
result = (prime * result)
+ ((productCode == null) ? 0 : productCode.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
CacheKey other = (CacheKey) obj;
if (elevationAngle == null) {
if (other.elevationAngle != null) {
return false;
}
} else if (!elevationAngle.equals(other.elevationAngle)) {
return false;
}
if (productCode == null) {
if (other.productCode != null) {
return false;
}
} else if (!productCode.equals(other.productCode)) {
return false;
}
return true;
}
}
private class CacheEntry {
public CacheEntry(Set<TimeAndSpace> times) {
this.insertTime = System.currentTimeMillis();
this.times = times;
}
public long insertTime;
public Set<TimeAndSpace> times;
}
private final Map<CacheKey, CacheEntry> cache = new LinkedHashMap<CacheKey, CacheEntry>(
100, .75f, true) {
private static final long serialVersionUID = 2022670836957170184L;
@Override
protected boolean removeEldestEntry(Entry<CacheKey, CacheEntry> eldest) {
return this.size() > CACHE_SIZE;
}
};
private Set<DataTime> globalTimes;
private long globalInsertTime;
private RadarUpdater() {
ProductAlertObserver.addObserver("radar", this);
}
@Override
public void alertArrived(Collection<AlertMessage> alertMessages) {
ProductAlertObserver
.processDataURIAlerts(convertRadarAlertsToGridDatauris(alertMessages));
}
public Set<String> convertRadarAlertsToGridDatauris(
Collection<AlertMessage> alertMessages) {
RadarStation configuredRadar = RadarAdapter.getInstance()
.getConfiguredRadar();
if (configuredRadar == null) {
return new HashSet<String>();
}
Set<String> datauris = new HashSet<String>();
for (AlertMessage alertMessage : alertMessages) {
String icao = alertMessage.decodedAlert
.get(RadarAdapter.ICAO_QUERY).toString();
if ((icao == null)
|| !icao.equalsIgnoreCase(configuredRadar.getRdaId())) {
continue;
}
globalTimes = null;
Object obj = alertMessage.decodedAlert
.get(RadarAdapter.PRODUCT_CODE_QUERY);
if ((obj == null) || !(obj instanceof Integer)) {
continue;
}
Integer productCode = (Integer) obj;
String paramAbbrev = RadarProductCodeMapping.getInstance()
.getParameterAbbrev(productCode);
if (paramAbbrev == null) {
continue;
}
obj = alertMessage.decodedAlert.get("dataTime");
if ((obj == null) || !(obj instanceof DataTime)) {
continue;
}
DataTime time = (DataTime) obj;
obj = alertMessage.decodedAlert.get(RadarAdapter.TILT_QUERY);
if ((obj == null) || !(obj instanceof Double)) {
continue;
}
Double elevationAngle = (Double) obj;
cache.remove(new CacheKey(productCode, elevationAngle));
Level level = LevelFactory.getInstance().getLevel(
RadarAdapter.CUBE_MASTER_LEVEL_NAME, elevationAngle);
GridRecord fakeRec = new GridRecord();
fakeRec.setDataTime(time);
fakeRec.setDatasetId(RadarAdapter.RADAR_SOURCE);
Parameter param = new Parameter(paramAbbrev);
fakeRec.setParameter(param);
fakeRec.setLevel(level);
datauris.add(fakeRec.getDataURI());
}
return datauris;
}
private CacheKey getCacheKey(RadarRequestableLevelNode rNode) {
Map<String, RequestConstraint> rcMap = rNode.getRequestConstraintMap();
RequestConstraint rc = rcMap.get(RadarAdapter.PRODUCT_CODE_QUERY);
if ((rc == null) || (rc.getConstraintType() != ConstraintType.EQUALS)) {
return null;
}
Integer productCode = Integer.parseInt(rc.getConstraintValue());
rc = rcMap.get(RadarAdapter.TILT_QUERY);
if ((rc == null) || (rc.getConstraintType() != ConstraintType.EQUALS)) {
return null;
}
Double elevationAngle = Double.parseDouble(rc.getConstraintValue());
return new CacheKey(productCode, elevationAngle);
}
public void setTimes(RadarRequestableLevelNode rNode,
Set<TimeAndSpace> times) {
cache.put(getCacheKey(rNode), new CacheEntry(times));
}
public Set<TimeAndSpace> getTimes(RadarRequestableLevelNode rNode) {
CacheKey cacheKey = getCacheKey(rNode);
CacheEntry entry = cache.get(cacheKey);
if (entry == null) {
return null;
}
if ((entry.insertTime + CACHE_TIME) < System.currentTimeMillis()) {
cache.remove(cacheKey);
return null;
}
return entry.times;
}
public void setGlobalTimes(Set<DataTime> times) {
globalTimes = times;
globalInsertTime = System.currentTimeMillis();
}
public Set<DataTime> getGlobalTimes() {
if (globalTimes == null) {
return null;
}
if ((globalInsertTime + CACHE_TIME) < System.currentTimeMillis()) {
globalTimes = null;
return null;
}
return globalTimes;
}
public void clearCache() {
cache.clear();
globalTimes = null;
}
}

View file

@ -1,59 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.viz.grid.inv;
import com.raytheon.uf.common.dataplugin.grid.derivparam.tree.StaticGridDataLevelNode;
import com.raytheon.uf.common.dataplugin.level.Level;
import com.raytheon.uf.common.gridcoverage.GridCoverage;
import com.raytheon.uf.common.inventory.data.AbstractRequestableData;
import com.raytheon.viz.grid.data.TiltRequestableData;
/**
* A LevelNode for the height of a radar TILT. The data will be centered on a
* specific radar site and it increase moving away from that height, the rate of
* increase is determined by the level one value.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------- -------- --------- ----------------------------------------
* Mar 22, 2016 5439 bsteffen Initial creation
*
* </pre>
*
* @author bsteffen
*/
public class TiltGridDataLevelNode extends StaticGridDataLevelNode {
public TiltGridDataLevelNode(String source, String dataType, Level level) {
super(source, dataType, level);
}
@Override
protected AbstractRequestableData createRequestableData(
GridCoverage coverage) {
if ("TILT".equals(dataType)) {
return new TiltRequestableData(source, level, coverage);
}
return super.createRequestableData(coverage);
}
}

View file

@ -1,426 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.viz.grid.util;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.measure.unit.Unit;
import org.geotools.geometry.DirectPosition2D;
import org.opengis.referencing.crs.ProjectedCRS;
import org.opengis.referencing.operation.MathTransform;
import com.raytheon.uf.common.colormap.prefs.ColorMapParameters;
import com.raytheon.uf.common.dataplugin.grid.derivparam.cache.CoverageUtils;
import com.raytheon.uf.common.dataplugin.level.Level;
import com.raytheon.uf.common.dataplugin.level.LevelFactory;
import com.raytheon.uf.common.dataplugin.radar.RadarRecord;
import com.raytheon.uf.common.dataplugin.radar.RadarStation;
import com.raytheon.uf.common.dataplugin.radar.request.GetRadarDataTreeRequest;
import com.raytheon.uf.common.dataplugin.radar.util.RadarUtil;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
import com.raytheon.uf.common.derivparam.library.DerivParamDesc;
import com.raytheon.uf.common.derivparam.library.DerivParamMethod;
import com.raytheon.uf.common.derivparam.tree.OrLevelNode;
import com.raytheon.uf.common.derivparam.tree.StaticDataLevelNode;
import com.raytheon.uf.common.geospatial.MapUtil;
import com.raytheon.uf.common.gridcoverage.Corner;
import com.raytheon.uf.common.gridcoverage.GridCoverage;
import com.raytheon.uf.common.gridcoverage.StereographicGridCoverage;
import com.raytheon.uf.common.gridcoverage.exception.GridCoverageException;
import com.raytheon.uf.common.gridcoverage.lookup.GridCoverageLookup;
import com.raytheon.uf.common.inventory.tree.AbstractRequestableNode;
import com.raytheon.uf.common.inventory.tree.DataTree;
import com.raytheon.uf.common.inventory.tree.LevelNode;
import com.raytheon.uf.common.inventory.tree.ParameterNode;
import com.raytheon.uf.common.inventory.tree.SourceNode;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.common.style.StyleException;
import com.raytheon.uf.common.style.image.ColorMapParameterFactory;
import com.raytheon.uf.common.style.level.Level.LevelType;
import com.raytheon.uf.common.style.level.SingleLevel;
import com.raytheon.uf.common.time.DataTime;
import com.raytheon.uf.viz.core.catalog.CatalogQuery;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.requests.ThriftClient;
import com.raytheon.viz.grid.data.TopoRequestableData;
import com.raytheon.viz.grid.inv.RadarRequestableLevelNode;
import com.raytheon.viz.grid.inv.RadarUpdater;
import com.raytheon.viz.radar.util.StationUtils;
/**
* Handles pulling/mapping of radar data to grib parameters.
*
* <pre>
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 23, 2010 #4473 rjpeter Initial creation
* Feb 21, 2014 DR 16744 D. Friedman Add getUpdateConstraints
* Apr 1, 2014 DR 17220 D. Friedman Handle uninitialized grid inventory
* Sep 09, 2014 3356 njensen Remove CommunicationException
*
* </pre>
*
* @author rjpeter
* @version 1.0
*/
public class RadarAdapter {
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(RadarAdapter.class);
public static final String RADAR_SOURCE = "radar";
public static final String CUBE_MASTER_LEVEL_NAME = "TILT";
private static final String PLUGIN_NAME_QUERY = "pluginName";
public static final String ICAO_QUERY = "icao";
public static final String PRODUCT_CODE_QUERY = "productCode";
public static final String TILT_QUERY = "primaryElevationAngle";
private static final String RDA_ID_QUERY = "location.rdaId";
/**
* Number of x/y grid points in radar grid.
*/
private static final int GRID_SIZE = 100;
/**
* Spacing of grid points in meters.
*/
private static final int GRID_SPACING = 6000;
private static final RadarAdapter instance;
private RadarStation configuredRadar = null;
private GridCoverage coverage = null;
static {
instance = new RadarAdapter();
}
public static RadarAdapter getInstance() {
return instance;
}
private RadarAdapter() {
}
private boolean checkConfiguredRadar() {
boolean status = false;
RadarStation station = StationUtils.getInstance().getHomeRadarStation();
if (station != null) {
if (configuredRadar == null
|| !configuredRadar.getRdaId().equals(station.getRdaId())) {
configuredRadar = station;
RadarUpdater.getInstance().clearCache();
ProjectedCRS crs = RadarUtil.constructCRS(station.getLat(),
station.getLon());
StereographicGridCoverage coverage = new StereographicGridCoverage();
coverage.setNx(GRID_SIZE);
coverage.setNy(GRID_SIZE);
coverage.setDx(GRID_SPACING);
coverage.setDy(GRID_SPACING);
coverage.setLov(station.getLon());
coverage.setLad(station.getLat());
coverage.setSpacingUnit("m");
coverage.setName(station.getRdaId() + " Generated Coverage");
try {
MathTransform toLatLon = MapUtil.getTransformToLatLon(crs);
int minExtent = -1 * GRID_SPACING * GRID_SIZE / 2;
DirectPosition2D lowerLeft = new DirectPosition2D(
minExtent, minExtent);
toLatLon.transform(lowerLeft, lowerLeft);
coverage.setFirstGridPointCorner(Corner.LowerLeft);
coverage.setLa1(lowerLeft.getY());
coverage.setLo1(lowerLeft.getX());
} catch (Exception e) {
// shouldn't occur since parsing well known geometry
}
try {
coverage.initialize();
} catch (GridCoverageException e) {
statusHandler.handle(Priority.PROBLEM,
e.getLocalizedMessage(), e);
configuredRadar = null;
return status;
}
this.coverage = GridCoverageLookup.getInstance().getCoverage(
coverage, true);
CoverageUtils.getInstance().setCoverage(RADAR_SOURCE,
this.coverage);
System.out.println("Home RADAR set to "
+ configuredRadar.getRdaId());
status = true;
}
} else {
configuredRadar = null;
}
return status;
}
public void addRadarBaseTree(DataTree dataTree,
Map<String, DerivParamDesc> derParLibrary) {
if (dataTree == null) {
return;
}
checkConfiguredRadar();
if (configuredRadar == null) {
return;
}
DataTree radarTree = null;
GetRadarDataTreeRequest request = new GetRadarDataTreeRequest();
request.setRdaId(configuredRadar.getRdaId());
try {
long t0 = System.currentTimeMillis();
Object response = ThriftClient.sendRequest(request);
System.out.println("Time to GetRadarDataTreeRequest for "
+ configuredRadar.getRdaId() + " = "
+ (System.currentTimeMillis() - t0) + "ms");
if (response != null && response instanceof DataTree) {
radarTree = (DataTree) response;
}
} catch (Exception e) {
statusHandler.handle(Priority.PROBLEM,
"Unable to retrieve data tree for home radar", e);
}
String icao = null;
RadarProductCodeMapping pCodeMapping = RadarProductCodeMapping
.getInstance();
SourceNode gridSourceNode = new SourceNode();
gridSourceNode.setValue(RADAR_SOURCE);
gridSourceNode.setDt(60);
initTopoParam(gridSourceNode);
dataTree.getSourceNodes().put(RADAR_SOURCE, gridSourceNode);
// should never have more than one node...
for (SourceNode sNode : radarTree.getSourceNodes().values()) {
initTopoParam(sNode);
if (icao == null) {
icao = sNode.getValue();
}
Set<String> parameterAbbrevs = pCodeMapping.getParameterAbbrevs();
// Generate the projection information for the radar and set into
// each of the nodes...
for (String paramAbbrev : parameterAbbrevs) {
List<Integer> productCodes = pCodeMapping
.getProductCodesForAbbrev(paramAbbrev);
ParameterNode gridParameterNode = new ParameterNode();
gridParameterNode.setValue(paramAbbrev);
DerivParamDesc desc = derParLibrary.get(paramAbbrev);
if (desc != null) {
gridParameterNode.setParameterName(desc.getName());
if (desc.getUnit() != null) {
gridParameterNode.setParameterUnit(desc.getUnit()
.toString());
}
}
gridSourceNode.addChildNode(gridParameterNode);
// grab the associated nodes for merging
for (Integer pCode : productCodes) {
ParameterNode pCodeParamNode = sNode.getChildNode(pCode
.toString());
// should this go into derived parameters to lookup
// units/name?
if (pCodeParamNode != null) {
for (LevelNode pCodeLevelNode : pCodeParamNode
.getChildNodes().values()) {
Level l = pCodeLevelNode.getLevel();
LevelNode gridLevelNode = gridParameterNode
.getChildNode(pCodeLevelNode.getValue());
if (gridLevelNode == null) {
DerivParamMethod method = new DerivParamMethod();
method.setName("Supplement");
gridLevelNode = new OrLevelNode(l, desc,
method, RADAR_SOURCE,
new ArrayList<AbstractRequestableNode>(
productCodes.size()), false);
gridParameterNode.addChildNode(gridLevelNode);
}
Map<String, RequestConstraint> rcMap = new HashMap<String, RequestConstraint>();
rcMap.put(PLUGIN_NAME_QUERY, new RequestConstraint(
RADAR_SOURCE));
rcMap.put(ICAO_QUERY, new RequestConstraint(icao));
rcMap.put(
PRODUCT_CODE_QUERY,
new RequestConstraint(pCodeParamNode
.getValue()));
rcMap.put(
TILT_QUERY,
new RequestConstraint(Double.toString(l
.getLevelonevalue())));
RadarRequestableLevelNode radarLevelNode = new RadarRequestableLevelNode(
pCodeLevelNode, rcMap, paramAbbrev,
gridParameterNode.getParameterName());
((OrLevelNode) gridLevelNode)
.addNodeToOrList(radarLevelNode);
}
}
}
}
}
// create static pressure, height params at all tilts
}
/**
* Add the Topo param to the given node
*
* @param modelNameNode
* @param level
*/
private void initTopoParam(SourceNode modelNameNode) {
Level sfc = LevelFactory.getInstance().getLevel("SFC", 0.0);
DerivParamDesc topo = new DerivParamDesc();
topo.setAbbreviation("Topo");
topo.setName("Topography");
topo.setUnit(Unit.valueOf("m"));
ParameterNode topoParam = new ParameterNode();
topoParam.setParameterName("Topography");
topoParam.setParameterUnit("m");
topoParam.setValue("Topo");
TopoRequestableData topoData = new TopoRequestableData(
modelNameNode.getValue());
topoData.setSpace(getCoverage());
StaticDataLevelNode topoNode = new StaticDataLevelNode(sfc, topo,
topoData, modelNameNode.getValue());
topoNode.setLevel(sfc);
topoParam.addChildNode(topoNode);
modelNameNode.addChildNode(topoParam);
}
public Set<DataTime> timeInvariantQuery() throws VizException {
Set<DataTime> lastTimeQuery = RadarUpdater.getInstance()
.getGlobalTimes();
if (lastTimeQuery != null) {
return lastTimeQuery;
}
Set<DataTime> rval = null;
if (configuredRadar != null) {
Map<String, RequestConstraint> newQuery = new HashMap<String, RequestConstraint>();
newQuery.put(PLUGIN_NAME_QUERY, new RequestConstraint(RADAR_SOURCE));
newQuery.put(RDA_ID_QUERY,
new RequestConstraint(configuredRadar.getRdaId()));
DataTime[] times = CatalogQuery.performTimeQuery(newQuery, false,
null);
if (times != null) {
rval = new HashSet<DataTime>();
for (DataTime time : times) {
rval.add(time);
}
}
}
RadarUpdater.getInstance().setGlobalTimes(rval);
return rval;
}
public static int getGridSize() {
return GRID_SIZE;
}
public static int getGridSpacing() {
return GRID_SPACING;
}
public GridCoverage getCoverage() {
return coverage;
}
/**
* @return the configuredRadar
*/
public RadarStation getConfiguredRadar() {
return configuredRadar;
}
public static ColorMapParameters getColorMap(RadarRecord radar)
throws VizException {
SingleLevel level = new SingleLevel(LevelType.TILT);
level.setValue(radar.getPrimaryElevationAngle());
ColorMapParameters rval;
try {
rval = ColorMapParameterFactory.build(null, radar.getProductCode()
.toString(), radar.getUnitObject(), level);
} catch (StyleException e) {
throw new VizException(e.getLocalizedMessage(), e);
}
rval.setColorMapMax(255);
rval.setColorMapMin(0);
rval.setDataMax(255);
rval.setDataMin(0);
return rval;
}
public Map<String, RequestConstraint> getUpdateConstraints() {
RadarStation radarStation = getConfiguredRadar();
if (radarStation == null) {
// Can happen if grid inventory has not been initialized
return null;
}
RadarProductCodeMapping rpcMap = RadarProductCodeMapping.getInstance();
HashSet<Integer> productCodes = new HashSet<Integer>();
for (String abbrev : rpcMap.getParameterAbbrevs()) {
productCodes.addAll(rpcMap.getProductCodesForAbbrev(abbrev));
}
Map<String, RequestConstraint> rcMap = new HashMap<String, RequestConstraint>();
rcMap.put(RadarAdapter.PLUGIN_NAME_QUERY, new RequestConstraint(
RADAR_SOURCE));
rcMap.put(ICAO_QUERY, new RequestConstraint(radarStation.getRdaId()
.toLowerCase()));
rcMap.put(
PRODUCT_CODE_QUERY,
new RequestConstraint(Arrays.toString(new ArrayList<Integer>(
productCodes).toArray()),
RequestConstraint.ConstraintType.IN));
return rcMap;
}
}

View file

@ -1,130 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.viz.grid.util;
import java.io.File;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import com.raytheon.uf.common.localization.IPathManager;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.serialization.JAXBManager;
import com.raytheon.uf.common.serialization.SerializationException;
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.viz.grid.xml.ParameterList;
import com.raytheon.viz.grid.xml.ParameterMapping;
/**
* Structure for retrieving radar product code to grib parameter abbrev mappings
*
* <pre>
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 22, 2010 #4473 rjpeter Initial creation
* Nov 07, 2361 2361 njensen Use JAXBManager for XML
*
* </pre>
*
* @author rjpeter
* @version 1.0
*/
public class RadarProductCodeMapping {
private static final transient IUFStatusHandler statusHandler = UFStatus.getHandler(RadarProductCodeMapping.class);
private static RadarProductCodeMapping instance;
private Map<String, List<Integer>> parameterMappings = new HashMap<String, List<Integer>>();
private Map<Integer, String> pCodeMappings = new HashMap<Integer, String>();
public static RadarProductCodeMapping getInstance() {
if (instance == null) {
instance = new RadarProductCodeMapping();
}
return instance;
}
private RadarProductCodeMapping() {
IPathManager pm = PathManagerFactory.getPathManager();
File baseFile = pm.getFile(pm.getContext(LocalizationType.CAVE_STATIC,
LocalizationLevel.BASE),
"/parameterMapping/radar/RadarProductCodes.xml");
File siteFile = pm.getFile(pm.getContext(LocalizationType.CAVE_STATIC,
LocalizationLevel.SITE),
"/parameterMapping/radar/RadarProductCodes.xml");
File userFile = pm.getFile(pm.getContext(LocalizationType.CAVE_STATIC,
LocalizationLevel.USER),
"/parameterMapping/radar/RadarProductCodes.xml");
try {
JAXBManager jaxb = new JAXBManager(ParameterList.class);
loadParameters(baseFile, jaxb);
if (siteFile.exists()) {
loadParameters(siteFile, jaxb);
}
if (userFile.exists()) {
loadParameters(userFile, jaxb);
}
} catch (Exception e) {
statusHandler.handle(
Priority.PROBLEM,
"Error occurred loading radar product code to grid parameter mappings",
e);
}
}
private void loadParameters(File fileToLoad, JAXBManager jaxb)
throws SerializationException {
ParameterList parameterList = jaxb.unmarshalFromXmlFile(
ParameterList.class, fileToLoad);
for (ParameterMapping parameter : parameterList.getParameters()) {
// print message for overwrite?
parameterMappings.put(parameter.getAbbrev(),
parameter.getProductCodes());
for (Integer productCode : parameter.getProductCodes()) {
pCodeMappings.put(productCode, parameter.getAbbrev());
}
}
}
public List<Integer> getProductCodesForAbbrev(String abbrev) {
return parameterMappings.get(abbrev);
}
public Set<String> getParameterAbbrevs() {
return parameterMappings.keySet();
}
public String getParameterAbbrev(Integer productCode) {
return pCodeMappings.get(productCode);
}
}

View file

@ -1,59 +0,0 @@
/**
* This software was developed andimport com.raytheon.uf.common.datastorage.Request;
Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.viz.grid.util;
import com.raytheon.uf.common.datastorage.Request;
import com.vividsolutions.jts.geom.Coordinate;
/**
*
* This class provides a way for resources to pass a point to the GribDataCube
* adapter that will be used as the center of all TILT levels.
*
* TODO I dont like this class because it causes problems if one of these
* Requests gets inadvertantly sent over to PyPies/HDF5. We need a better way to
* communicate with the GribDataCubeAdapter
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Nov 9, 2011 bsteffen Initial creation
*
* </pre>
*
* @author bsteffen
* @version 1.0
*/
public class TiltRequest extends Request {
private Coordinate tiltLocation;
public Coordinate getTiltLocation() {
return tiltLocation;
}
public void setTiltLocation(Coordinate tiltLocation) {
this.tiltLocation = tiltLocation;
}
}

View file

@ -1,268 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.viz.grid.util;
import java.lang.ref.Reference;
import java.lang.ref.SoftReference;
import java.util.HashMap;
import java.util.Map;
import org.geotools.coverage.grid.GridEnvelope2D;
import org.geotools.coverage.grid.GridGeometry2D;
import org.geotools.referencing.GeodeticCalculator;
import org.opengis.referencing.operation.MathTransform;
import org.opengis.referencing.operation.TransformException;
import com.raytheon.uf.common.dataplugin.radar.RadarStation;
import com.raytheon.uf.common.datastorage.records.FloatDataRecord;
import com.raytheon.uf.common.geospatial.MapUtil;
import com.raytheon.uf.common.gridcoverage.GridCoverage;
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.viz.radar.util.StationUtils;
import com.vividsolutions.jts.geom.Coordinate;
/**
* Utility for generating grids of tilt heights for a Radar.
*
* <pre>
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Dec 17, 2009 rjpeter Initial creation
*
* </pre>
*
* @author rjpeter
* @version 1.0
*/
public class TiltUtils {
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(TiltUtils.class);
private static class CacheKey {
private final Integer coverageId;
private final double lat;
private final double lon;
public CacheKey(Integer coverageId, double lon, double lat) {
this.coverageId = coverageId;
this.lat = lat;
this.lon = lon;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result
+ ((coverageId == null) ? 0 : coverageId.hashCode());
long temp;
temp = Double.doubleToLongBits(lat);
result = prime * result + (int) (temp ^ (temp >>> 32));
temp = Double.doubleToLongBits(lon);
result = prime * result + (int) (temp ^ (temp >>> 32));
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
CacheKey other = (CacheKey) obj;
if (coverageId == null) {
if (other.coverageId != null)
return false;
} else if (!coverageId.equals(other.coverageId))
return false;
if (Double.doubleToLongBits(lat) != Double
.doubleToLongBits(other.lat))
return false;
if (Double.doubleToLongBits(lon) != Double
.doubleToLongBits(other.lon))
return false;
return true;
}
}
private Map<CacheKey, Reference<double[]>> gridRadiusCache = new HashMap<CacheKey, Reference<double[]>>();
private static TiltUtils instance;
public static synchronized TiltUtils getInstance() {
if (instance == null) {
instance = new TiltUtils();
}
return instance;
}
private TiltUtils() {
}
/**
*
* @param coverage
* @param tilt
* in degrees
*/
public FloatDataRecord getHeightGrid(GridCoverage coverage, double tilt) {
RadarStation homeRadar = StationUtils.getInstance()
.getHomeRadarStation();
return getHeightGrid(homeRadar, coverage, tilt);
}
public FloatDataRecord getHeightGrid(Coordinate latLon,
GridCoverage coverage, double tilt) {
RadarStation radar = StationUtils.getInstance().getClosestRadarStation(
latLon.x, latLon.y);
return getHeightGrid(radar, coverage, tilt);
}
private FloatDataRecord getHeightGrid(RadarStation radar,
GridCoverage coverage, double tilt) {
if (radar != null) {
CacheKey cacheKey = new CacheKey(coverage.getId(), radar.getLon(),
radar.getLat());
GridGeometry2D geometry = MapUtil.getGridGeometry(coverage);
GridEnvelope2D gridRange = geometry.getGridRange2D();
double[] radius = null;
Reference<double[]> radiusRef = gridRadiusCache.get(cacheKey);
if (radiusRef != null) {
radius = radiusRef.get();
}
if (radius == null) {
try {
MathTransform gridToCrs = geometry.getGridToCRS();
MathTransform fromLatLon = MapUtil
.getTransformFromLatLon(coverage.getCrs());
double[] radarLonLat = new double[] { radar.getLon(),
radar.getLat() };
double[] radarCrsCoord = new double[2];
fromLatLon.transform(radarLonLat, 0, radarCrsCoord, 0, 1);
int numPoints = gridRange.height * gridRange.width;
double[] gridCoordGrid = new double[numPoints * 2];
int offset = 0;
for (int j = 0; j < gridRange.height; j++) {
for (int i = 0; i < gridRange.width; i++) {
gridCoordGrid[offset++] = i;
gridCoordGrid[offset++] = j;
}
}
gridToCrs.transform(gridCoordGrid, 0, gridCoordGrid, 0,
numPoints);
radius = new double[numPoints];
offset = 0;
for (int i = 0; i < numPoints; i++) {
double xDist = radarCrsCoord[0]
- gridCoordGrid[offset++];
double yDist = radarCrsCoord[1]
- gridCoordGrid[offset++];
radius[i] = Math.sqrt(xDist * xDist + yDist * yDist);
}
gridRadiusCache.put(cacheKey, new SoftReference<double[]>(
radius));
} catch (Exception e) {
statusHandler
.handle(Priority.PROBLEM,
"Error occurred generating height grid for radar tilt",
e);
return null;
}
}
return getHeightGrid(radar, gridRange, radius, tilt);
} else {
return null;
}
}
public FloatDataRecord getHeightGrid(GridEnvelope2D gridRange,
MathTransform gridToLatLon, double tilt) {
RadarStation homeRadar = StationUtils.getInstance()
.getHomeRadarStation();
try {
double[] radius = getRadius(homeRadar, gridRange, gridToLatLon);
return getHeightGrid(homeRadar, gridRange, radius, tilt);
} catch (TransformException e) {
statusHandler.handle(Priority.PROBLEM,
"Error occurred generating height grid for radar tilt", e);
}
return null;
}
private FloatDataRecord getHeightGrid(RadarStation radar,
GridEnvelope2D gridRange, double[] radius, double tilt) {
float elevMeter = radar.getElevMeter();
double tanTilt = Math.tan(Math.toRadians(tilt));
float[] floatData = new float[radius.length];
for (int i = 0; i < radius.length; i++) {
floatData[i] = (float) (elevMeter + tanTilt * radius[i]);
}
FloatDataRecord fdr = new FloatDataRecord();
fdr.setFloatData(floatData);
fdr.setDimension(2);
long[] sizes = { gridRange.width, gridRange.height };
fdr.setSizes(sizes);
return fdr;
}
private double[] getRadius(RadarStation radar, GridEnvelope2D gridRange,
MathTransform gridToLatLon) throws TransformException {
int numPoints = gridRange.height * gridRange.width;
int offset = 0;
double[] gridCoordGrid = new double[numPoints * 2];
for (int j = 0; j < gridRange.height; j++) {
for (int i = 0; i < gridRange.width; i++) {
gridCoordGrid[offset++] = i;
gridCoordGrid[offset++] = j;
}
}
gridToLatLon.transform(gridCoordGrid, 0, gridCoordGrid, 0, numPoints);
double[] radius = new double[numPoints];
GeodeticCalculator gc = new GeodeticCalculator();
gc.setStartingGeographicPoint(radar.getLon(), radar.getLat());
offset = 0;
for (int i = 0; i < numPoints; i++) {
gc.setDestinationGeographicPoint(gridCoordGrid[offset],
gridCoordGrid[offset + 1]);
offset += 2;
radius[i] = gc.getOrthodromicDistance();
}
return radius;
}
}

View file

@ -1,23 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
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.
-->
<menuTemplate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<contribute xsi:type="separator" id="baseAirportRadarSeparator" />
</menuTemplate>

View file

@ -1,23 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
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.
-->
<menuTemplate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<contribute xsi:type="separator" id="baseDialRadarSeparator" />
</menuTemplate>

View file

@ -1,247 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
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.
-->
<menuTemplate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<contribute xsi:type="subMenu" menuText="Melting Layer"
id="${icao}AlgorithmOverlaysSubMenuMeltingLayer">
<contribute xsi:type="bundleItem" file="bundles/DefaultRadarGraphic.xml"
menuText="0.0 ML" id="${icao}00MeltingLayer">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="166" />
<substitute key="mode" value="" />
<substitute key="latest" value="false" />
<substitute key="elevation" value="0.0--0.0" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadarGraphic.xml"
menuText="0.5 ML" id="${icao}05MeltingLayer">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="166" />
<substitute key="mode" value="" />
<substitute key="latest" value="false" />
<substitute key="elevation" value="0.5--0.5" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadarGraphic.xml"
menuText="0.9 ML" id="${icao}09MeltingLayer">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="166" />
<substitute key="mode" value="" />
<substitute key="latest" value="false" />
<substitute key="elevation" value="0.9--0.9" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadarGraphic.xml"
menuText="1.5 ML" id="${icao}15MeltingLayer">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="166" />
<substitute key="mode" value="" />
<substitute key="latest" value="false" />
<substitute key="elevation" value="1.5--1.5" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadarGraphic.xml"
menuText="1.8 ML" id="${icao}18MeltingLayer">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="166" />
<substitute key="mode" value="" />
<substitute key="latest" value="false" />
<substitute key="elevation" value="1.8--1.8" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadarGraphic.xml"
menuText="2.4 ML" id="${icao}24MeltingLayer">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="166" />
<substitute key="mode" value="" />
<substitute key="latest" value="false" />
<substitute key="elevation" value="2.4--2.4" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadarGraphic.xml"
menuText="3.4 ML" id="${icao}34MeltingLayer">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="166" />
<substitute key="mode" value="" />
<substitute key="latest" value="false" />
<substitute key="elevation" value="3.4--3.4" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadarGraphic.xml"
menuText="4.3 ML" id="${icao}43MeltingLayer">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="166" />
<substitute key="mode" value="" />
<substitute key="latest" value="false" />
<substitute key="elevation" value="4.3--4.3" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadarGraphic.xml"
menuText="5.3 ML" id="${icao}53MeltingLayer">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="166" />
<substitute key="mode" value="" />
<substitute key="latest" value="false" />
<substitute key="elevation" value="5.3--5.3" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadarGraphic.xml"
menuText="6.0 ML" id="${icao}60MeltingLayer">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="166" />
<substitute key="mode" value="" />
<substitute key="latest" value="false" />
<substitute key="elevation" value="6.0--6.0" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadarGraphic.xml"
menuText="7.5 ML" id="${icao}75MeltingLayer">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="166" />
<substitute key="mode" value="" />
<substitute key="latest" value="false" />
<substitute key="elevation" value="7.5--7.5" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadarGraphic.xml"
menuText="8.7 ML" id="${icao}87MeltingLayer">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="166" />
<substitute key="mode" value="" />
<substitute key="latest" value="false" />
<substitute key="elevation" value="8.7--8.7" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadarGraphic.xml"
menuText="10.0 ML" id="${icao}100MeltingLayer">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="166" />
<substitute key="mode" value="" />
<substitute key="latest" value="false" />
<substitute key="elevation" value="10.0--10.0" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadarGraphic.xml"
menuText="12.0 ML" id="${icao}120MeltingLayer">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="166" />
<substitute key="mode" value="" />
<substitute key="latest" value="false" />
<substitute key="elevation" value="12.0--12.0" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadarGraphic.xml"
menuText="14.0 ML" id="${icao}140MeltingLayer">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="166" />
<substitute key="mode" value="" />
<substitute key="latest" value="false" />
<substitute key="elevation" value="14.0--14.0" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadarGraphic.xml"
menuText="16.7 ML" id="${icao}167MeltingLayer">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="166" />
<substitute key="mode" value="" />
<substitute key="latest" value="false" />
<substitute key="elevation" value="16.7--16.7" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadarGraphic.xml"
menuText="19.5 ML" id="${icao}195MeltingLayer">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="166" />
<substitute key="mode" value="" />
<substitute key="latest" value="false" />
<substitute key="elevation" value="19.5--19.5" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadarGraphic.xml"
menuText="Melting Layer (All)" id="${icao}MeltingLayerAll">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="166" />
<substitute key="mode" value="" />
<substitute key="latest" value="false" />
<substitute key="elevation" value="0.0--360.0" />
</contribute>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadarGraphic.xml"
menuText="Storm Track (STI)" id="${icao}StormTrack">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="58" />
<substitute key="mode" value="" />
<substitute key="latest" value="false" />
<substitute key="elevation" value="0.0--360.0" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadarGraphic.xml"
menuText="Hail Index (HI)" id="${icao}HailIndex">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="59" />
<substitute key="mode" value="" />
<substitute key="latest" value="false" />
<substitute key="elevation" value="0.0--360.0" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadarGraphic.xml"
menuText="Tornado Vortex Sig (TVS)" id="${icao}TornadoVortexSig">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="61" />
<substitute key="mode" value="" />
<substitute key="latest" value="false" />
<substitute key="elevation" value="0.0--360.0" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadarGraphic.xml"
menuText="Latest TVS Rapid Update (TRU)" id="${icao}TVSRapidUpdate">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="143" />
<substitute key="mode" value="" />
<substitute key="latest" value="true" />
<substitute key="elevation" value="0.0--360.0" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadarGraphic.xml"
menuText="All Tilts TRU" id="${icao}AllTilts">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="143" />
<substitute key="mode" value="" />
<substitute key="latest" value="false" />
<substitute key="elevation" value="0.0--360.0" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadarGraphic.xml"
menuText="Mesocyclone (MD)" id="${icao}Mesocyclone">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="141" />
<substitute key="mode" value="" />
<substitute key="latest" value="false" />
<substitute key="elevation" value="0.0--360.0" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadarGraphic.xml"
menuText="Digital Mesocyclone (DMD)" id="${icao}DigitalMesocyclone">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="149" />
<substitute key="mode" value="" />
<substitute key="latest" value="true" />
<substitute key="elevation" value="0.0--360.0" />
</contribute>
<contribute xsi:type="command"
commandId="com.raytheon.viz.radar.ui.RadarDisplayControls" menuText="Radar Display Controls..."
id="${icao}GraphicsRadarDisplayControls" />
<contribute xsi:type="separator"
id="${icao}AlgorithmOverlaysTableSeparator" />
<contribute xsi:type="bundleItem" file="bundles/DefaultRadarGraphic.xml"
menuText="Comb Att Table (1km CZ)" id="${icao}CombAttTable1km">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="37" />
<substitute key="mode" value="CZ-Pg" />
<substitute key="latest" value="false" />
<substitute key="elevation" value="0.0--360.0" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadarGraphic.xml"
menuText="Comb Att Table (4km CZ)" id="${icao}CombAttTable4km">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="38" />
<substitute key="mode" value="CZ-Pg" />
<substitute key="latest" value="false" />
<substitute key="elevation" value="0.0--360.0" />
</contribute>
</menuTemplate>

View file

@ -1,314 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
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.
-->
<menuTemplate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<contribute xsi:type="titleItem" titleText="------ Best Res Z+SRM8 combo ------"
id="BestResZSRM8" />
<contribute xsi:type="bundleItem"
file="bundles/DefaultRadarBlendedBestRes.xml" menuText="0.0 Z+SRM8"
id="${icao}00ZSRM8">
<substitute key="icao" value="${icao}" />
<substitute key="product1" value="153" />
<substitute key="product2" value="94" />
<substitute key="product3" value="19" />
<substitute key="product4" value="20" />
<substitute key="mode1" value="" />
<substitute key="product5" value="154" />
<substitute key="product6" value="99" />
<substitute key="product7" value="" />
<substitute key="product8" value="" />
<substitute key="mode2" value="SRM8" />
<substitute key="elevation" value="0.0--0.0" />
</contribute>
<contribute xsi:type="bundleItem"
file="bundles/DefaultRadarBlendedBestRes.xml" menuText="0.5 Z+SRM8"
id="${icao}05ZSRM8">
<substitute key="icao" value="${icao}" />
<substitute key="product1" value="153" />
<substitute key="product2" value="94" />
<substitute key="product3" value="19" />
<substitute key="product4" value="20" />
<substitute key="mode1" value="" />
<substitute key="product5" value="154" />
<substitute key="product6" value="99" />
<substitute key="product7" value="" />
<substitute key="product8" value="" />
<substitute key="mode2" value="SRM8" />
<substitute key="elevation" value="0.5--0.5" />
</contribute>
<contribute xsi:type="bundleItem"
file="bundles/DefaultRadarBlendedBestRes.xml" menuText="0.9 Z+SRM8"
id="${icao}09ZSRM8">
<substitute key="icao" value="${icao}" />
<substitute key="product1" value="153" />
<substitute key="product2" value="94" />
<substitute key="product3" value="19" />
<substitute key="product4" value="20" />
<substitute key="mode1" value="" />
<substitute key="product5" value="154" />
<substitute key="product6" value="99" />
<substitute key="product7" value="" />
<substitute key="product8" value="" />
<substitute key="mode2" value="SRM8" />
<substitute key="elevation" value="0.9--0.9" />
</contribute>
<contribute xsi:type="bundleItem"
file="bundles/DefaultRadarBlendedBestRes.xml" menuText="All Tilts Z+SRM8"
id="${icao}AllTiltsZSRM8">
<substitute key="icao" value="${icao}" />
<substitute key="product1" value="153" />
<substitute key="product2" value="94" />
<substitute key="product3" value="19" />
<substitute key="product4" value="20" />
<substitute key="mode1" value="" />
<substitute key="product5" value="154" />
<substitute key="product6" value="99" />
<substitute key="product7" value="" />
<substitute key="product8" value="" />
<substitute key="mode2" value="SRM8" />
<substitute key="elevation" value="0.0--360.0" />
</contribute>
<contribute xsi:type="subMenu" menuText="${icao} Hi Z+SRM8 tilts">
<contribute xsi:type="bundleItem"
file="bundles/DefaultRadarBlendedBestRes.xml" menuText="1.5 Z+SRM"
id="${icao}158bitZSRM">
<substitute key="icao" value="${icao}" />
<substitute key="product1" value="153" />
<substitute key="product2" value="94" />
<substitute key="product3" value="19" />
<substitute key="product4" value="20" />
<substitute key="mode1" value="" />
<substitute key="product5" value="154" />
<substitute key="product6" value="99" />
<substitute key="product7" value="" />
<substitute key="product8" value="" />
<substitute key="mode2" value="SRM8" />
<substitute key="elevation" value="1.5--1.5" />
</contribute>
<contribute xsi:type="bundleItem"
file="bundles/DefaultRadarBlendedBestRes.xml" menuText="1.8 Z+SRM"
id="${icao}188bitZSRM">
<substitute key="icao" value="${icao}" />
<substitute key="product1" value="153" />
<substitute key="product2" value="94" />
<substitute key="product3" value="19" />
<substitute key="product4" value="20" />
<substitute key="mode1" value="" />
<substitute key="product5" value="154" />
<substitute key="product6" value="99" />
<substitute key="product7" value="" />
<substitute key="product8" value="" />
<substitute key="mode2" value="SRM8" />
<substitute key="elevation" value="1.8--1.8" />
</contribute>
<contribute xsi:type="bundleItem"
file="bundles/DefaultRadarBlendedBestRes.xml" menuText="2.4 Z+SRM"
id="${icao}248bitZSRM">
<substitute key="icao" value="${icao}" />
<substitute key="product1" value="153" />
<substitute key="product2" value="94" />
<substitute key="product3" value="19" />
<substitute key="product4" value="20" />
<substitute key="mode1" value="" />
<substitute key="product5" value="154" />
<substitute key="product6" value="99" />
<substitute key="product7" value="" />
<substitute key="product8" value="" />
<substitute key="mode2" value="SRM8" />
<substitute key="elevation" value="2.4--2.4" />
</contribute>
<contribute xsi:type="bundleItem"
file="bundles/DefaultRadarBlendedBestRes.xml" menuText="3.4 Z+SRM"
id="${icao}348bitZSRM">
<substitute key="icao" value="${icao}" />
<substitute key="product1" value="153" />
<substitute key="product2" value="94" />
<substitute key="product3" value="19" />
<substitute key="product4" value="20" />
<substitute key="mode1" value="" />
<substitute key="product5" value="154" />
<substitute key="product6" value="99" />
<substitute key="product7" value="" />
<substitute key="product8" value="" />
<substitute key="mode2" value="SRM8" />
<substitute key="elevation" value="3.4--3.4" />
</contribute>
<contribute xsi:type="bundleItem"
file="bundles/DefaultRadarBlendedBestRes.xml" menuText="4.3 Z+SRM"
id="${icao}438bitZSRM">
<substitute key="icao" value="${icao}" />
<substitute key="product1" value="153" />
<substitute key="product2" value="94" />
<substitute key="product3" value="19" />
<substitute key="product4" value="20" />
<substitute key="mode1" value="" />
<substitute key="product5" value="154" />
<substitute key="product6" value="99" />
<substitute key="product7" value="" />
<substitute key="product8" value="" />
<substitute key="mode2" value="SRM8" />
<substitute key="elevation" value="4.3--4.3" />
</contribute>
<contribute xsi:type="bundleItem"
file="bundles/DefaultRadarBlendedBestRes.xml" menuText="5.3 Z+SRM"
id="${icao}538bitZSRM">
<substitute key="icao" value="${icao}" />
<substitute key="product1" value="153" />
<substitute key="product2" value="94" />
<substitute key="product3" value="19" />
<substitute key="product4" value="20" />
<substitute key="mode1" value="" />
<substitute key="product5" value="154" />
<substitute key="product6" value="99" />
<substitute key="product7" value="" />
<substitute key="product8" value="" />
<substitute key="mode2" value="SRM8" />
<substitute key="elevation" value="5.3--5.3" />
</contribute>
<contribute xsi:type="bundleItem"
file="bundles/DefaultRadarBlendedBestRes.xml" menuText="6.0 Z+SRM"
id="${icao}608bitZSRM">
<substitute key="icao" value="${icao}" />
<substitute key="product1" value="153" />
<substitute key="product2" value="94" />
<substitute key="product3" value="19" />
<substitute key="product4" value="20" />
<substitute key="mode1" value="" />
<substitute key="product5" value="154" />
<substitute key="product6" value="99" />
<substitute key="product7" value="" />
<substitute key="product8" value="" />
<substitute key="mode2" value="SRM8" />
<substitute key="elevation" value="6.0--6.0" />
</contribute>
<contribute xsi:type="bundleItem"
file="bundles/DefaultRadarBlendedBestRes.xml" menuText="7.5 Z+SRM"
id="${icao}758bitZSRM">
<substitute key="icao" value="${icao}" />
<substitute key="product1" value="153" />
<substitute key="product2" value="94" />
<substitute key="product3" value="19" />
<substitute key="product4" value="20" />
<substitute key="mode1" value="" />
<substitute key="product5" value="154" />
<substitute key="product6" value="99" />
<substitute key="product7" value="" />
<substitute key="product8" value="" />
<substitute key="mode2" value="SRM8" />
<substitute key="elevation" value="7.5--7.5" />
</contribute>
<contribute xsi:type="bundleItem"
file="bundles/DefaultRadarBlendedBestRes.xml" menuText="8.7 Z+SRM"
id="${icao}878bitZSRM">
<substitute key="icao" value="${icao}" />
<substitute key="product1" value="153" />
<substitute key="product2" value="94" />
<substitute key="product3" value="19" />
<substitute key="product4" value="20" />
<substitute key="mode1" value="" />
<substitute key="product5" value="154" />
<substitute key="product6" value="99" />
<substitute key="product7" value="" />
<substitute key="product8" value="" />
<substitute key="mode2" value="SRM8" />
<substitute key="elevation" value="8.7--8.7" />
</contribute>
<contribute xsi:type="bundleItem"
file="bundles/DefaultRadarBlendedBestRes.xml" menuText="10.0 Z+SRM"
id="${icao}1008bitZSRM">
<substitute key="icao" value="${icao}" />
<substitute key="product1" value="153" />
<substitute key="product2" value="94" />
<substitute key="product3" value="19" />
<substitute key="product4" value="20" />
<substitute key="mode1" value="" />
<substitute key="product5" value="154" />
<substitute key="product6" value="99" />
<substitute key="product7" value="" />
<substitute key="product8" value="" />
<substitute key="mode2" value="SRM8" />
<substitute key="elevation" value="10.0--10.0" />
</contribute>
<contribute xsi:type="bundleItem"
file="bundles/DefaultRadarBlendedBestRes.xml" menuText="12.0 Z+SRM"
id="${icao}1208bitZSRM">
<substitute key="icao" value="${icao}" />
<substitute key="product1" value="153" />
<substitute key="product2" value="94" />
<substitute key="product3" value="19" />
<substitute key="product4" value="20" />
<substitute key="mode1" value="" />
<substitute key="product5" value="154" />
<substitute key="product6" value="99" />
<substitute key="product7" value="" />
<substitute key="product8" value="" />
<substitute key="mode2" value="SRM8" />
<substitute key="elevation" value="12.0--12.0" />
</contribute>
<contribute xsi:type="bundleItem"
file="bundles/DefaultRadarBlendedBestRes.xml" menuText="14.0 Z+SRM"
id="${icao}1408bitZSRM">
<substitute key="icao" value="${icao}" />
<substitute key="product1" value="153" />
<substitute key="product2" value="94" />
<substitute key="product3" value="19" />
<substitute key="product4" value="20" />
<substitute key="mode1" value="" />
<substitute key="product5" value="154" />
<substitute key="product6" value="99" />
<substitute key="product7" value="" />
<substitute key="product8" value="" />
<substitute key="mode2" value="SRM8" />
<substitute key="elevation" value="14.0--14.0" />
</contribute>
<contribute xsi:type="bundleItem"
file="bundles/DefaultRadarBlendedBestRes.xml" menuText="16.7 Z+SRM"
id="${icao}1678bitZSRM">
<substitute key="icao" value="${icao}" />
<substitute key="product1" value="153" />
<substitute key="product2" value="94" />
<substitute key="product3" value="19" />
<substitute key="product4" value="20" />
<substitute key="mode1" value="" />
<substitute key="product5" value="154" />
<substitute key="product6" value="99" />
<substitute key="product7" value="" />
<substitute key="product8" value="" />
<substitute key="mode2" value="SRM8" />
<substitute key="elevation" value="16.7--16.7" />
</contribute>
<contribute xsi:type="bundleItem"
file="bundles/DefaultRadarBlendedBestRes.xml" menuText="19.5 Z+SRM"
id="${icao}1958bitZSRM">
<substitute key="icao" value="${icao}" />
<substitute key="product1" value="153" />
<substitute key="product2" value="94" />
<substitute key="product3" value="19" />
<substitute key="product4" value="20" />
<substitute key="mode1" value="" />
<substitute key="product5" value="154" />
<substitute key="product6" value="99" />
<substitute key="product7" value="" />
<substitute key="product8" value="" />
<substitute key="mode2" value="SRM8" />
<substitute key="elevation" value="19.5--19.5" />
</contribute>
</contribute>
</menuTemplate>

View file

@ -1,314 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
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.
-->
<menuTemplate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<contribute xsi:type="titleItem" titleText="------ Best Res Z+V combo ------"
id="BestResZV" />
<contribute xsi:type="bundleItem"
file="bundles/DefaultRadarBlendedBestRes.xml" menuText="0.0 Z+V"
id="${icao}008bitZV">
<substitute key="icao" value="${icao}" />
<substitute key="product1" value="153" />
<substitute key="product2" value="94" />
<substitute key="product3" value="19" />
<substitute key="product4" value="20" />
<substitute key="mode1" value="" />
<substitute key="product5" value="154" />
<substitute key="product6" value="99" />
<substitute key="product7" value="27" />
<substitute key="product8" value="25" />
<substitute key="mode2" value="" />
<substitute key="elevation" value="0.0--0.0" />
</contribute>
<contribute xsi:type="bundleItem"
file="bundles/DefaultRadarBlendedBestRes.xml" menuText="0.5 Z+V"
id="${icao}058bitZV">
<substitute key="icao" value="${icao}" />
<substitute key="product1" value="153" />
<substitute key="product2" value="94" />
<substitute key="product3" value="19" />
<substitute key="product4" value="20" />
<substitute key="mode1" value="" />
<substitute key="product5" value="154" />
<substitute key="product6" value="99" />
<substitute key="product7" value="27" />
<substitute key="product8" value="25" />
<substitute key="mode2" value="" />
<substitute key="elevation" value="0.5--0.5" />
</contribute>
<contribute xsi:type="bundleItem"
file="bundles/DefaultRadarBlendedBestRes.xml" menuText="0.9 Z+V"
id="${icao}098bitZV">
<substitute key="icao" value="${icao}" />
<substitute key="product1" value="153" />
<substitute key="product2" value="94" />
<substitute key="product3" value="19" />
<substitute key="product4" value="20" />
<substitute key="mode1" value="" />
<substitute key="product5" value="154" />
<substitute key="product6" value="99" />
<substitute key="product7" value="27" />
<substitute key="product8" value="25" />
<substitute key="mode2" value="" />
<substitute key="elevation" value="0.9--0.9" />
</contribute>
<contribute xsi:type="bundleItem"
file="bundles/DefaultRadarBlendedBestRes.xml" menuText="All Tilts Z+V"
id="${icao}AllTiltsZV">
<substitute key="icao" value="${icao}" />
<substitute key="product1" value="153" />
<substitute key="product2" value="94" />
<substitute key="product3" value="19" />
<substitute key="product4" value="20" />
<substitute key="mode1" value="" />
<substitute key="product5" value="154" />
<substitute key="product6" value="99" />
<substitute key="product7" value="27" />
<substitute key="product8" value="25" />
<substitute key="mode2" value="" />
<substitute key="elevation" value="0.0--360.0" />
</contribute>
<contribute xsi:type="subMenu" menuText="${icao} Hi Z+V tilts">
<contribute xsi:type="bundleItem"
file="bundles/DefaultRadarBlendedBestRes.xml" menuText="1.5 Z+V"
id="${icao}154bit8bitZV">
<substitute key="icao" value="${icao}" />
<substitute key="product1" value="153" />
<substitute key="product2" value="94" />
<substitute key="product3" value="19" />
<substitute key="product4" value="20" />
<substitute key="mode1" value="" />
<substitute key="product5" value="154" />
<substitute key="product6" value="99" />
<substitute key="product7" value="27" />
<substitute key="product8" value="25" />
<substitute key="mode2" value="" />
<substitute key="elevation" value="1.5--1.5" />
</contribute>
<contribute xsi:type="bundleItem"
file="bundles/DefaultRadarBlendedBestRes.xml" menuText="1.8 Z+V"
id="${icao}184bit8bitZV">
<substitute key="icao" value="${icao}" />
<substitute key="product1" value="153" />
<substitute key="product2" value="94" />
<substitute key="product3" value="19" />
<substitute key="product4" value="20" />
<substitute key="mode1" value="" />
<substitute key="product5" value="154" />
<substitute key="product6" value="99" />
<substitute key="product7" value="27" />
<substitute key="product8" value="25" />
<substitute key="mode2" value="" />
<substitute key="elevation" value="1.8--1.8" />
</contribute>
<contribute xsi:type="bundleItem"
file="bundles/DefaultRadarBlendedBestRes.xml" menuText="2.4 Z+V"
id="${icao}244bit8bitZV">
<substitute key="icao" value="${icao}" />
<substitute key="product1" value="153" />
<substitute key="product2" value="94" />
<substitute key="product3" value="19" />
<substitute key="product4" value="20" />
<substitute key="mode1" value="" />
<substitute key="product5" value="154" />
<substitute key="product6" value="99" />
<substitute key="product7" value="27" />
<substitute key="product8" value="25" />
<substitute key="mode2" value="" />
<substitute key="elevation" value="2.4--2.4" />
</contribute>
<contribute xsi:type="bundleItem"
file="bundles/DefaultRadarBlendedBestRes.xml" menuText="3.4 Z+V"
id="${icao}344bit8bitZV">
<substitute key="icao" value="${icao}" />
<substitute key="product1" value="153" />
<substitute key="product2" value="94" />
<substitute key="product3" value="19" />
<substitute key="product4" value="20" />
<substitute key="mode1" value="" />
<substitute key="product5" value="154" />
<substitute key="product6" value="99" />
<substitute key="product7" value="27" />
<substitute key="product8" value="25" />
<substitute key="mode2" value="" />
<substitute key="elevation" value="3.4--3.4" />
</contribute>
<contribute xsi:type="bundleItem"
file="bundles/DefaultRadarBlendedBestRes.xml" menuText="4.3 Z+V"
id="${icao}434bit8bitZV">
<substitute key="icao" value="${icao}" />
<substitute key="product1" value="153" />
<substitute key="product2" value="94" />
<substitute key="product3" value="19" />
<substitute key="product4" value="20" />
<substitute key="mode1" value="" />
<substitute key="product5" value="154" />
<substitute key="product6" value="99" />
<substitute key="product7" value="27" />
<substitute key="product8" value="25" />
<substitute key="mode2" value="" />
<substitute key="elevation" value="4.3--4.3" />
</contribute>
<contribute xsi:type="bundleItem"
file="bundles/DefaultRadarBlendedBestRes.xml" menuText="5.3 Z+V"
id="${icao}534bit8bitZV">
<substitute key="icao" value="${icao}" />
<substitute key="product1" value="153" />
<substitute key="product2" value="94" />
<substitute key="product3" value="19" />
<substitute key="product4" value="20" />
<substitute key="mode1" value="" />
<substitute key="product5" value="154" />
<substitute key="product6" value="99" />
<substitute key="product7" value="27" />
<substitute key="product8" value="25" />
<substitute key="mode2" value="" />
<substitute key="elevation" value="5.3--5.3" />
</contribute>
<contribute xsi:type="bundleItem"
file="bundles/DefaultRadarBlendedBestRes.xml" menuText="6.0 Z+V"
id="${icao}604bit8bitZV">
<substitute key="icao" value="${icao}" />
<substitute key="product1" value="153" />
<substitute key="product2" value="94" />
<substitute key="product3" value="19" />
<substitute key="product4" value="20" />
<substitute key="mode1" value="" />
<substitute key="product5" value="154" />
<substitute key="product6" value="99" />
<substitute key="product7" value="27" />
<substitute key="product8" value="25" />
<substitute key="mode2" value="" />
<substitute key="elevation" value="6.0--6.0" />
</contribute>
<contribute xsi:type="bundleItem"
file="bundles/DefaultRadarBlendedBestRes.xml" menuText="7.5 Z+V"
id="${icao}754bit8bitZV">
<substitute key="icao" value="${icao}" />
<substitute key="product1" value="153" />
<substitute key="product2" value="94" />
<substitute key="product3" value="19" />
<substitute key="product4" value="20" />
<substitute key="mode1" value="" />
<substitute key="product5" value="154" />
<substitute key="product6" value="99" />
<substitute key="product7" value="27" />
<substitute key="product8" value="25" />
<substitute key="mode2" value="" />
<substitute key="elevation" value="7.5--7.5" />
</contribute>
<contribute xsi:type="bundleItem"
file="bundles/DefaultRadarBlendedBestRes.xml" menuText="8.7 Z+V"
id="${icao}874bit8bitZV">
<substitute key="icao" value="${icao}" />
<substitute key="product1" value="153" />
<substitute key="product2" value="94" />
<substitute key="product3" value="19" />
<substitute key="product4" value="20" />
<substitute key="mode1" value="" />
<substitute key="product5" value="154" />
<substitute key="product6" value="99" />
<substitute key="product7" value="27" />
<substitute key="product8" value="25" />
<substitute key="mode2" value="" />
<substitute key="elevation" value="8.7--8.7" />
</contribute>
<contribute xsi:type="bundleItem"
file="bundles/DefaultRadarBlendedBestRes.xml" menuText="10.0 Z+V"
id="${icao}1004bit8bitZV">
<substitute key="icao" value="${icao}" />
<substitute key="product1" value="153" />
<substitute key="product2" value="94" />
<substitute key="product3" value="19" />
<substitute key="product4" value="20" />
<substitute key="mode1" value="" />
<substitute key="product5" value="154" />
<substitute key="product6" value="99" />
<substitute key="product7" value="27" />
<substitute key="product8" value="25" />
<substitute key="mode2" value="" />
<substitute key="elevation" value="10.0--10.0" />
</contribute>
<contribute xsi:type="bundleItem"
file="bundles/DefaultRadarBlendedBestRes.xml" menuText="12.0 Z+V"
id="${icao}1204bit8bitZV">
<substitute key="icao" value="${icao}" />
<substitute key="product1" value="153" />
<substitute key="product2" value="94" />
<substitute key="product3" value="19" />
<substitute key="product4" value="20" />
<substitute key="mode1" value="" />
<substitute key="product5" value="154" />
<substitute key="product6" value="99" />
<substitute key="product7" value="27" />
<substitute key="product8" value="25" />
<substitute key="mode2" value="" />
<substitute key="elevation" value="12.0--12.0" />
</contribute>
<contribute xsi:type="bundleItem"
file="bundles/DefaultRadarBlendedBestRes.xml" menuText="14.0 Z+V"
id="${icao}1404bit8bitZV">
<substitute key="icao" value="${icao}" />
<substitute key="product1" value="153" />
<substitute key="product2" value="94" />
<substitute key="product3" value="19" />
<substitute key="product4" value="20" />
<substitute key="mode1" value="" />
<substitute key="product5" value="154" />
<substitute key="product6" value="99" />
<substitute key="product7" value="27" />
<substitute key="product8" value="25" />
<substitute key="mode2" value="" />
<substitute key="elevation" value="14.0--14.0" />
</contribute>
<contribute xsi:type="bundleItem"
file="bundles/DefaultRadarBlendedBestRes.xml" menuText="16.7 Z+V"
id="${icao}1674bit8bitZV">
<substitute key="icao" value="${icao}" />
<substitute key="product1" value="153" />
<substitute key="product2" value="94" />
<substitute key="product3" value="19" />
<substitute key="product4" value="20" />
<substitute key="mode1" value="" />
<substitute key="product5" value="154" />
<substitute key="product6" value="99" />
<substitute key="product7" value="27" />
<substitute key="product8" value="25" />
<substitute key="mode2" value="" />
<substitute key="elevation" value="16.7--16.7" />
</contribute>
<contribute xsi:type="bundleItem"
file="bundles/DefaultRadarBlendedBestRes.xml" menuText="19.5 Z+V"
id="${icao}1954bit8bitZV">
<substitute key="icao" value="${icao}" />
<substitute key="product1" value="153" />
<substitute key="product2" value="94" />
<substitute key="product3" value="19" />
<substitute key="product4" value="20" />
<substitute key="mode1" value="" />
<substitute key="product5" value="154" />
<substitute key="product6" value="99" />
<substitute key="product7" value="27" />
<substitute key="product8" value="25" />
<substitute key="mode2" value="" />
<substitute key="elevation" value="19.5--19.5" />
</contribute>
</contribute>
</menuTemplate>

View file

@ -1,285 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
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.
-->
<menuTemplate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<contribute xsi:type="bundleItem" file="bundles/DefaultRadarXY.xml"
menuText="NEXRAD Unit Status" id="${icao}NexradStatus"
editorType="com.raytheon.viz.radar.ui.xy.RadarXYEditor">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="2" />
<substitute key="insetMap" value="false" />
</contribute>
<contribute xsi:type="separator"
id="${icao}DataQualityAfterNEXRADUnitStatus" />
<contribute xsi:type="titleItem"
titleText="------ Clutter Filter Control (CFC) ------" id="${icao}ClutterFilterControlCFC" />
<contribute xsi:type="bundleItem" file="bundles/DefaultRadarLayered.xml"
menuText="Segment 1" id="${icao}CFC1">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="34" />
<substitute key="layer" value="1.0" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadarLayered.xml"
menuText="Segment 2" id="${icao}CFC2">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="34" />
<substitute key="layer" value="2.0" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadarLayered.xml"
menuText="Segment 3" id="${icao}CFC3">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="34" />
<substitute key="layer" value="3.0" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadarLayered.xml"
menuText="Segment 4" id="${icao}CFC4">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="34" />
<substitute key="layer" value="4.0" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadarLayered.xml"
menuText="Segment 5" id="${icao}CFC5">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="34" />
<substitute key="layer" value="5.0" />
</contribute>
<contribute xsi:type="subMenu" menuText="${icao} Refl Clut Prob"
id="${icao}ReflClutProb">
<contribute xsi:type="bundleItem" file="bundles/DefaultRadar.xml"
menuText="0.0 CLR" id="${icao}00CLR">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="132" />
<substitute key="elevation" value="0.0--0.0" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadar.xml"
menuText="0.5 CLR" id="${icao}05CLR">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="132" />
<substitute key="elevation" value="0.5--0.5" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadar.xml"
menuText="0.9 CLR" id="${icao}09CLR">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="132" />
<substitute key="elevation" value="0.9--0.9" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadar.xml"
menuText="1.5 CLR" id="${icao}15CLR">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="132" />
<substitute key="elevation" value="1.5--1.5" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadar.xml"
menuText="1.8 CLR" id="${icao}18CLR">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="132" />
<substitute key="elevation" value="1.8--1.8" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadar.xml"
menuText="2.4 CLR" id="${icao}24CLR">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="132" />
<substitute key="elevation" value="2.4--2.4" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadar.xml"
menuText="3.4 CLR" id="${icao}34CLR">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="132" />
<substitute key="elevation" value="3.4--3.4" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadar.xml"
menuText="4.3 CLR" id="${icao}43CLR">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="132" />
<substitute key="elevation" value="4.3--4.3" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadar.xml"
menuText="5.3 CLR" id="${icao}53CLR">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="132" />
<substitute key="elevation" value="5.3--5.3" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadar.xml"
menuText="6.0 CLR" id="${icao}60CLR">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="132" />
<substitute key="elevation" value="6.0--6.0" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadar.xml"
menuText="7.5 CLR" id="${icao}75CLR">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="132" />
<substitute key="elevation" value="7.5--7.5" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadar.xml"
menuText="8.7 CLR" id="${icao}87CLR">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="132" />
<substitute key="elevation" value="8.7--8.7" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadar.xml"
menuText="10.0 CLR" id="${icao}100CLR">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="132" />
<substitute key="elevation" value="10.0--10.0" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadar.xml"
menuText="12.0 CLR" id="${icao}120CLR">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="132" />
<substitute key="elevation" value="12.0--12.0" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadar.xml"
menuText="14.0 CLR" id="${icao}140CLR">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="132" />
<substitute key="elevation" value="14.0--14.0" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadar.xml"
menuText="16.7 CLR" id="${icao}167CLR">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="132" />
<substitute key="elevation" value="16.7--16.7" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadar.xml"
menuText="19.5 CLR" id="${icao}195CLR">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="132" />
<substitute key="elevation" value="19.5--19.5" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadar.xml"
menuText="CLR (All)" id="${icao}195CLR">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="132" />
<substitute key="elevation" value="0.0--360.0" />
</contribute>
</contribute>
<contribute xsi:type="subMenu" menuText="${icao} Vel Clut Prob"
id="${icao}DataQualityVelClutProb">
<contribute xsi:type="bundleItem" file="bundles/DefaultRadar.xml"
menuText="0.0 CLD" id="${icao}00CLD">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="133" />
<substitute key="elevation" value="0.0--0.0" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadar.xml"
menuText="0.5 CLD" id="${icao}05CLD">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="133" />
<substitute key="elevation" value="0.5--0.5" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadar.xml"
menuText="0.9 CLD" id="${icao}09CLD">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="133" />
<substitute key="elevation" value="0.9--0.9" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadar.xml"
menuText="1.5 CLD" id="${icao}15CLD">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="133" />
<substitute key="elevation" value="1.5--1.5" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadar.xml"
menuText="1.8 CLD" id="${icao}18CLD">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="133" />
<substitute key="elevation" value="1.8--1.8" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadar.xml"
menuText="2.4 CLD" id="${icao}24CLD">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="133" />
<substitute key="elevation" value="2.4--2.4" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadar.xml"
menuText="3.4 CLD" id="${icao}34CLD">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="133" />
<substitute key="elevation" value="3.4--3.4" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadar.xml"
menuText="4.3 CLD" id="${icao}43CLD">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="133" />
<substitute key="elevation" value="4.3--4.3" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadar.xml"
menuText="5.3 CLD" id="${icao}53CLD">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="133" />
<substitute key="elevation" value="5.3--5.3" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadar.xml"
menuText="6.0 CLD" id="${icao}60CLD">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="133" />
<substitute key="elevation" value="6.0--6.0" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadar.xml"
menuText="7.5 CLD" id="${icao}75CLD">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="133" />
<substitute key="elevation" value="7.5--7.5" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadar.xml"
menuText="8.7 CLD" id="${icao}87CLD">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="133" />
<substitute key="elevation" value="8.7--8.7" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadar.xml"
menuText="10.0 CLD" id="${icao}100CLD">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="133" />
<substitute key="elevation" value="10.0--10.0" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadar.xml"
menuText="12.0 CLD" id="${icao}120CLD">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="133" />
<substitute key="elevation" value="12.0--12.0" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadar.xml"
menuText="14.0 CLD" id="${icao}140CLD">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="133" />
<substitute key="elevation" value="14.0--14.0" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadar.xml"
menuText="16.7 CLD" id="${icao}167CLD">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="133" />
<substitute key="elevation" value="16.7--16.7" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadar.xml"
menuText="19.5 CLD" id="${icao}195CLD">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="133" />
<substitute key="elevation" value="19.5--19.5" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadar.xml"
menuText="CLD (All)" id="${icao}195CLD">
<substitute key="icao" value="${icao}" />
<substitute key="product" value="133" />
<substitute key="elevation" value="0.0--360.0" />
</contribute>
</contribute>
</menuTemplate>

View file

@ -1,231 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
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.
-->
<menuTemplate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<contribute xsi:type="titleItem" id="${icao}4PanelZ+SRMZDR+VKDP+HCCC+SW"
titleText="------ 4-Panel Z+SRM/ZDR+V/KDP+HC/CC+SW ------" />
<contribute xsi:type="bundleItem"
file="bundles/DefaultRadarDualPolBaseData.xml" menuText="0.0 base data"
id="00dualpolbasedata">
<substitute key="icao" value="${icao}" />
<substitute key="elevation" value="0.0--0.0" />
</contribute>
<contribute xsi:type="bundleItem"
file="bundles/DefaultRadarDualPolBaseData.xml" menuText="0.5 base data"
id="05dualpolbasedata">
<substitute key="icao" value="${icao}" />
<substitute key="elevation" value="0.5--0.5" />
</contribute>
<contribute xsi:type="bundleItem"
file="bundles/DefaultRadarDualPolBaseData.xml" menuText="0.9 base data"
id="09dualpolbasedata">
<substitute key="icao" value="${icao}" />
<substitute key="elevation" value="0.9--0.9" />
</contribute>
<contribute xsi:type="bundleItem"
file="bundles/DefaultRadarDualPolBaseData.xml" menuText="All Tilts base data"
id="AllTiltsdualpolbasedata">
<substitute key="icao" value="${icao}" />
<substitute key="elevation" value="0.0--360.0" />
</contribute>
<contribute xsi:type="subMenu" id="${icao}HibasedatatiltsSubmenu"
menuText="${icao} Hi base data tilts">
<contribute xsi:type="bundleItem"
file="bundles/DefaultRadarDualPolBaseData.xml" menuText="1.5 base data"
id="15dualpolbasedata">
<substitute key="icao" value="${icao}" />
<substitute key="elevation" value="1.5--1.5" />
</contribute>
<contribute xsi:type="bundleItem"
file="bundles/DefaultRadarDualPolBaseData.xml" menuText="1.8 base data"
id="18dualpolbasedata">
<substitute key="icao" value="${icao}" />
<substitute key="elevation" value="1.8--1.8" />
</contribute>
<contribute xsi:type="bundleItem"
file="bundles/DefaultRadarDualPolBaseData.xml" menuText="2.4 base data"
id="24dualpolbasedata">
<substitute key="icao" value="${icao}" />
<substitute key="elevation" value="2.4--2.4" />
</contribute>
<contribute xsi:type="bundleItem"
file="bundles/DefaultRadarDualPolBaseData.xml" menuText="3.4 base data"
id="34dualpolbasedata">
<substitute key="icao" value="${icao}" />
<substitute key="elevation" value="3.4--3.4" />
</contribute>
<contribute xsi:type="bundleItem"
file="bundles/DefaultRadarDualPolBaseData.xml" menuText="4.3 base data"
id="43dualpolbasedata">
<substitute key="icao" value="${icao}" />
<substitute key="elevation" value="4.3--4.3" />
</contribute>
<contribute xsi:type="bundleItem"
file="bundles/DefaultRadarDualPolBaseData.xml" menuText="5.3 base data"
id="53dualpolbasedata">
<substitute key="icao" value="${icao}" />
<substitute key="elevation" value="5.3--5.3" />
</contribute>
<contribute xsi:type="bundleItem"
file="bundles/DefaultRadarDualPolBaseData.xml" menuText="6.0 base data"
id="60dualpolbasedata">
<substitute key="icao" value="${icao}" />
<substitute key="elevation" value="6.0--6.0" />
</contribute>
<contribute xsi:type="bundleItem"
file="bundles/DefaultRadarDualPolBaseData.xml" menuText="7.5 base data"
id="75dualpolbasedata">
<substitute key="icao" value="${icao}" />
<substitute key="elevation" value="7.5--7.5" />
</contribute>
<contribute xsi:type="bundleItem"
file="bundles/DefaultRadarDualPolBaseData.xml" menuText="8.7 base data"
id="87dualpolbasedata">
<substitute key="icao" value="${icao}" />
<substitute key="elevation" value="8.7--8.7" />
</contribute>
<contribute xsi:type="bundleItem"
file="bundles/DefaultRadarDualPolBaseData.xml" menuText="10.0 base data"
id="100dualpolbasedata">
<substitute key="icao" value="${icao}" />
<substitute key="elevation" value="10.0--10.0" />
</contribute>
<contribute xsi:type="bundleItem"
file="bundles/DefaultRadarDualPolBaseData.xml" menuText="12.0 base data"
id="120dualpolbasedata">
<substitute key="icao" value="${icao}" />
<substitute key="elevation" value="12.0--12.0" />
</contribute>
<contribute xsi:type="bundleItem"
file="bundles/DefaultRadarDualPolBaseData.xml" menuText="14.0 base data"
id="140dualpolbasedata">
<substitute key="icao" value="${icao}" />
<substitute key="elevation" value="14.0--14.0" />
</contribute>
<contribute xsi:type="bundleItem"
file="bundles/DefaultRadarDualPolBaseData.xml" menuText="16.7 base data"
id="167dualpolbasedata">
<substitute key="icao" value="${icao}" />
<substitute key="elevation" value="16.7--16.7" />
</contribute>
<contribute xsi:type="bundleItem"
file="bundles/DefaultRadarDualPolBaseData.xml" menuText="19.5 base data"
id="195dualpolbasedata">
<substitute key="icao" value="${icao}" />
<substitute key="elevation" value="19.5--19.5" />
</contribute>
</contribute>
<contribute xsi:type="separator" id="${icao}4PanelZZDRHCKDPCC" />
<contribute xsi:type="titleItem" id="${icao}4PanelZZDRHC+KDPCC"
titleText="------ 4-Panel Z/ZDR/HC+KDP/CC ------" />
<contribute xsi:type="bundleItem" file="bundles/DefaultRadarDualPolHCA.xml"
menuText="0.0 HC analysis" id="00dualpolHCanalysis">
<substitute key="icao" value="${icao}" />
<substitute key="elevation" value="0.0--0.0" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadarDualPolHCA.xml"
menuText="0.5 HC analysis" id="05dualpolHCanalysis">
<substitute key="icao" value="${icao}" />
<substitute key="elevation" value="0.5--0.5" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadarDualPolHCA.xml"
menuText="0.9 HC analysis" id="09dualpolHCanalysis">
<substitute key="icao" value="${icao}" />
<substitute key="elevation" value="0.9--0.9" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadarDualPolHCA.xml"
menuText="All Tilts HC analysis" id="AllTiltsdualpolHCanalysis">
<substitute key="icao" value="${icao}" />
<substitute key="elevation" value="0.0--360.0" />
</contribute>
<contribute xsi:type="subMenu" id="${icao}HiHCnalysistiltsSubmenu"
menuText="${icao} Hi HC analysis tilts">
<contribute xsi:type="bundleItem" file="bundles/DefaultRadarDualPolHCA.xml"
menuText="1.5 HC analysis" id="15dualpolHCanalysis">
<substitute key="icao" value="${icao}" />
<substitute key="elevation" value="1.5--1.5" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadarDualPolHCA.xml"
menuText="1.8 HC analysis" id="18dualpolHCanalysis">
<substitute key="icao" value="${icao}" />
<substitute key="elevation" value="1.8--1.8" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadarDualPolHCA.xml"
menuText="2.4 HC analysis" id="24dualpolHCanalysis">
<substitute key="icao" value="${icao}" />
<substitute key="elevation" value="2.4--2.4" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadarDualPolHCA.xml"
menuText="3.4 HC analysis" id="34dualpolHCanalysis">
<substitute key="icao" value="${icao}" />
<substitute key="elevation" value="3.4--3.4" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadarDualPolHCA.xml"
menuText="4.3 HC analysis" id="43dualpolHCanalysis">
<substitute key="icao" value="${icao}" />
<substitute key="elevation" value="4.3--4.3" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadarDualPolHCA.xml"
menuText="5.3 HC analysis" id="53dualpolHCanalysis">
<substitute key="icao" value="${icao}" />
<substitute key="elevation" value="5.3--5.3" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadarDualPolHCA.xml"
menuText="6.0 HC analysis" id="60dualpolHCanalysis">
<substitute key="icao" value="${icao}" />
<substitute key="elevation" value="6.0--6.0" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadarDualPolHCA.xml"
menuText="7.5 HC analysis" id="75dualpolHCanalysis">
<substitute key="icao" value="${icao}" />
<substitute key="elevation" value="7.5--7.5" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadarDualPolHCA.xml"
menuText="8.7 HC analysis" id="87dualpolHCanalysis">
<substitute key="icao" value="${icao}" />
<substitute key="elevation" value="8.7--8.7" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadarDualPolHCA.xml"
menuText="10.0 HC analysis" id="100dualpolHCanalysis">
<substitute key="icao" value="${icao}" />
<substitute key="elevation" value="10.0--10.0" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadarDualPolHCA.xml"
menuText="12.0 HC analysis" id="120dualpolHCanalysis">
<substitute key="icao" value="${icao}" />
<substitute key="elevation" value="12.0--12.0" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadarDualPolHCA.xml"
menuText="14.0 HC analysis" id="140dualpolHCanalysis">
<substitute key="icao" value="${icao}" />
<substitute key="elevation" value="14.0--14.0" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadarDualPolHCA.xml"
menuText="16.7 HC analysis" id="167dualpolHCanalysis">
<substitute key="icao" value="${icao}" />
<substitute key="elevation" value="16.7--16.7" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultRadarDualPolHCA.xml"
menuText="19.5 HC analysis" id="195dualpolHCanalysis">
<substitute key="icao" value="${icao}" />
<substitute key="elevation" value="19.5--19.5" />
</contribute>
</contribute>
</menuTemplate>

View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<menuContributionFile>
<include installTo="menu:radar?after=RADAR_MENU_START"
fileName="menus/radar/baseRadarMenu.xml">
</include>
</menuContributionFile>

View file

@ -1,92 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.viz.radar.interrogators;
import java.util.Map;
import javax.measure.unit.UnitFormat;
import com.raytheon.uf.common.colormap.prefs.ColorMapParameters;
import com.raytheon.uf.common.dataplugin.radar.RadarRecord;
/**
* Use DigitalVILUnit object for conversion, this class will be removed in the
* future.
*
* <pre>
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* May 13, 2010 mnash Initial creation
*
* </pre>
*
* @author mnash
* @version 1.0
*/
@Deprecated
public class RadarVILInterrogator extends RadarRasterInterrogator implements
IRadarInterrogator {
/*
* (non-Javadoc)
*
* @see
* com.raytheon.viz.radar.interrogators.RadarDefaultInterrogator#decodeValues
* (int, java.util.Map)
*/
@Override
public String decodeValues(int dataValue, String baseName, Map<String, String> dataMap,
RadarRecord radarRecord, ColorMapParameters params) {
double decoded[] = new double[] { 0, 0, 0, 0, 0 };
// TODO still doesn't return correct value
double dispValue = 0;
for (int i = 0; i < decoded.length; i++) {
if (i == 2) {
decoded[i] = radarRecord.getThreshold(i);
continue;
}
decoded[i] = getVILValue(radarRecord.getThreshold(i));
}
if (dataValue < decoded[2]) {
dispValue = (dataValue - decoded[1]) / decoded[0];
} else if (dataValue >= decoded[2]) {
dispValue = Math.exp((dataValue - decoded[4]) / decoded[3]);
}
return String.format("%.4f %s", dispValue, UnitFormat.getUCUMInstance()
.format(params.getDisplayUnit()));
}
private float getVILValue(short x) {
int s = (x >> 15) & 0x1;
int e = (x >> 10) & 0x1f;
int f = x & 0x3ff;
float value;
if (e == 0) {
value = (float) (Math.pow(-1, s) * 2 * (f / Math.pow(2, 10)));
} else {
value = (float) ((Math.pow(-1, s) * Math.pow(2, e - 16) * (1 + f
/ Math.pow(2, 10))));
}
return value;
}
}

View file

@ -1,33 +0,0 @@
package com.raytheon.viz.radar.textcontributors;
import com.raytheon.uf.common.dataplugin.radar.RadarRecord;
/**
*
* Display "SAILS" at upper text for SAILS products
*
* <pre>
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 07/08/2014 DR17356 zwang Initial creation
*
* </pre>
*
* @author zwang
* @version 1.0
*/
public class SailsTextContributor implements IRadarTextContributor {
@Override
public String contributeText(RadarRecord record) {
String sailsStr = "";
if (record.getPrimaryElevationAngle() <= 0.5 && record.getElevationNumber() > 2)
sailsStr = "SAILS";
return sailsStr;
}
}

View file

@ -1,41 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
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.
-->
<menuTemplate>
<contribute xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="subMenu" menuText="Model Graphics" id="modelGraphics">
<contribute xsi:type="bundleItem" useReferenceTime="true" file="bundles/Redbook.xml" menuText="UKMO 500 hgt" timeQuery="true" id="uaUKMO500hgt">
<substitute value="PHZM50, PHZO50, PHZQ50" key="wmo"/>
</contribute>
</contribute>
<contribute xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="subMenu" menuText="CPC Charts" id="cpcCharts">
<contribute xsi:type="bundleItem" useReferenceTime="true" file="bundles/Redbook.xml" menuText="6-10 day mean 500 Hgt" timeQuery="true" id="ua610daymean500Hgt">
<substitute value="PHBV50" key="wmo"/>
</contribute>
<contribute xsi:type="bundleItem" useReferenceTime="true" file="bundles/Redbook.xml" menuText="8-14 day Mean 500 Hgt" timeQuery="true" id="ua814dayMean500Hgt">
<substitute value="PHTT50" key="wmo"/>
</contribute>
<contribute xsi:type="bundleItem" useReferenceTime="true" file="bundles/Redbook.xml" menuText="6-10 day 500 Hgt Anomaly" timeQuery="true" id="ua610day500HgtAnomaly">
<substitute value="PHNT50" key="wmo"/>
</contribute>
<contribute xsi:type="bundleItem" useReferenceTime="true" file="bundles/Redbook.xml" menuText="8-14 day 500 Anom" timeQuery="true" id="ua814day500Anom">
<substitute value="PHTT51" key="wmo"/>
</contribute>
</contribute>
</menuTemplate>

View file

@ -1,30 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
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.
-->
<menuTemplate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<contribute xsi:type="subinclude" fileName="menus/satellite/baseSatellite.xml">
<substitute key="sector0" value="West CONUS"/>
<substitute key="sector1" value="East CONUS"/>
<substitute key="entity" value="GOES%"/>
<substitute key="blendedTimeMatchMode" value="ALL_IMAGES"/>
</contribute>
<contribute xsi:type="separator" id="baseCompositeSeparator"/>
<contribute xsi:type="subinclude" fileName="menus/satellite/basePOESImagery.xml" />
</menuTemplate>

View file

@ -1,78 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<menuTemplate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<contribute xsi:type="bundleItem" file="bundles/DefaultSatellite.xml"
menuText="Blended Rain Rate" id="rainfallRate">
<substitute key="element" value="Rain fall rate"/>
<substitute key="entity" value="POES-NPOESS"/>
<substitute key="colormap" value="Sat/VIS/Linear"/>
</contribute>
<contribute xsi:type="titleItem" titleText="------ GOES ------"
id="GOESLine"/>
<contribute xsi:type="bundleItem" file="bundles/DefaultSatellite.xml"
menuText="Lifted Index" id="liftedIndex">
<substitute key="element" value="Sounder Based Derived Lifted Index (LI)"/>
<substitute key="entity" value="Composite"/>
<substitute key="colormap" value="Sat/Lifted Index/Lifted Index Default"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultSatellite.xml"
menuText="Total Precip Water" id="totalPrecipWater">
<substitute key="element" value="Sounder Based Derived Precipitable Water (PW)"/>
<substitute key="entity" value="Composite"/>
<substitute key="colormap" value="Sat/Precip Water/Precip Water Default"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultSatellite.xml"
menuText="Cloud Amount" id="cloudAmount">
<substitute key="element" value="Gridded Cloud Amount"/>
<substitute key="entity" value="Composite"/>
<substitute key="colormap" value="Sat/Cloud Amount Default"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultSatellite.xml"
menuText="Cloud Top Height" id="cloudTopHeight">
<substitute key="element" value="Gridded Cloud Top Pressure or Height"/>
<substitute key="entity" value="Composite"/>
<substitute key="colormap" value="Sat/Cloud Top Height"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultSatellite.xml"
menuText="Skin Temperature" id="skinTemp">
<substitute key="element" value="Sounder Based Derived Surface Skin Temp (SFC Skin)"/>
<substitute key="entity" value="Composite"/>
<substitute key="colormap" value="Sat/Skin Temp/Skin Temp Default"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultCONUSSatellite.xml"
menuText="Low Cloud Base" id="lowCloudBase">
<substitute key="element" value="Low cloud base imagery" />
<substitute key="sector0" value="West CONUS" />
<substitute key="sector1" value="East CONUS" />
<substitute key="entity" value="GOES%" />
<substitute key="colormap" value="Sat/Low Cloud Base" />
</contribute>
<contribute xsi:type="titleItem" titleText="------ DMSP SSM/I ------" id="DMSPLine"/>
<contribute xsi:type="bundleItem" file="bundles/DefaultSatellite.xml"
menuText="Total Precip Water" id="totalPrecipWater">
<substitute key="element" value="Sounder Based Derived Precipitable Water (PW)"/>
<substitute key="entity" value="DMSP"/>
<substitute key="colormap" value="Sat/Precip Water/Precip Water - Polar)"/>
</contribute>
<contribute xsi:type="titleItem" titleText="------ POES AMSU ------" id="POESAMSULine"/>
<contribute xsi:type="bundleItem" file="bundles/DefaultSatellite.xml"
menuText="Total Precip Water" id="totalPrecipWater">
<substitute key="element" value="Sounder Based Derived Precipitable Water (PW)"/>
<substitute key="entity" value="POES-NPOESS"/>
<substitute key="colormap" value="Sat/Precip Water/Precip Water - Polar)"/>
</contribute>
<contribute xsi:type="titleItem"
titleText="------ AMSU and SSM/I + GPS ------" id="blendedofAMSUAndSSMIDataLine"/>
<contribute xsi:type="bundleItem" file="bundles/DefaultSatellite.xml"
menuText="Blended Total Precip Water" id="blendedTotalPrecipWater">
<substitute key="element" value="Sounder Based Derived Precipitable Water (PW)"/>
<substitute key="entity" value="Miscellaneous"/>
<substitute key="colormap" value="Sat/Precip Water/Blended Total Precip Water"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultSatellite.xml"
menuText="Percent of Normal TPW" id="percentofNormalTPW">
<substitute key="element" value="Percent of Normal TPW"/>
<substitute key="entity" value="Miscellaneous"/>
<substitute key="colormap" value="Sat/Precip Water/Percent of Normal TPW"/>
</contribute>
</menuTemplate>

View file

@ -1,335 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.viz.texteditor.util;
import java.util.Calendar;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* Mostly derived from the PVtecObject class in package
* com.raytheon.edex.vtec.api to remove dependency.
*
* <pre>
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Oct 14, 2009 bwoodle Initial creation
* May 08, 2013 #1842 dgilling Add getPhensig() method.
* Feb 17, 2014 #2774 dgilling Added toString() for debugging
*
* </pre>
*
* @author bwoodle
* @version 1.0
*/
public class VtecObject {
/**
* The format, used by {@link java.lang.String#format(String, Object...)},
* that defines the P-VTEC string.
*/
private static final String vtecCreateFormat = "/%s.%s.%s.%s.%s.%04d.%s-%s/";
public static final String vtecParseFormat = "\\/([OTEX])\\.([A-Z]{3})\\.([A-Za-z0-9]{4})\\.([A-Z]{2})\\.([WAYSFON])\\.(\\d{4})\\.(\\d{6}T\\d{4}Z)-(\\d{6}T\\d{4}Z)\\/";
private static final String PARTIAL_MATCH_FORMAT = "/[OTEX]\\.\\w{3}\\.(%s)\\.(%s)\\.(%s)\\.(\\d{4})\\.\\d{6}T\\d{4}Z-\\d{6}T\\d{4}Z/";
/**
* The P-VTEC Product Class token. Part of the P-VTEC Event Group. Initially
* set to an underscore to simplify P-VTEC generation.
*/
private String product = "_";
/**
* The P-VTEC Actions token. Part of the P-VTEC Event Group. Initially set
* to an underscore to simplify P-VTEC generation.
*/
private String action = "_";
/**
* The P-VTEC Office ID token. Part of the P-VTEC Event Group. Initially set
* to an underscore to simplify P-VTEC generation.
*/
private String office = "_";
/**
* The P-VTEC Phenomena token. Part of the P-VTEC Event Group. Initially set
* to an underscore to simplify P-VTEC generation.
*/
private String phenomena = "_";
/**
* The P-VTEC Significance token. Part of the P-VTEC Event Group. Initially
* set to an underscore to simplify P-VTEC generation.
*/
private String significance = "_";
/**
* The P-VTEC Event Tracking Number (ETN) token. Part of the P-VTEC Event
* Group. Initially set to zero (0) to simplify P-VTEC generation.
*/
private Integer sequence = 0;
/**
* The p-VTEC Event Beginning Date/Time value. Part of the P-VTEC Date/Time
* Group.
*/
private Calendar startTime = null;
/**
* The p-VTEC Event Ending Date/Time value. Part of the P-VTEC Date/Time
* Group.
*/
private Calendar endTime = null;
/**
* Constructor. Constructs an empty P-VTEC object.
*/
public VtecObject() {
}
public VtecObject(String vtec) {
Pattern p = Pattern.compile(vtecParseFormat);
Matcher m = p.matcher(vtec);
if (m.matches()) {
// 1 - 8
this.product = m.group(1);
this.action = m.group(2);
this.office = m.group(3);
this.phenomena = m.group(4);
this.significance = m.group(5);
this.sequence = new Integer(m.group(6));
this.startTime = VtecUtil.calendarFromVtec(m.group(7));
this.endTime = VtecUtil.calendarFromVtec(m.group(8));
}
}
/**
* Constructor. Creates a P-VTEC object and populates it using the specified
* parameters.
*
* @param product
* the product classification.
* @param action
* the action performed on the bulletin.
* @param office
* the originating office.
* @param phenomenon
* the phenomenon for the bulletin.
* @param significance
* the significance of the event - essentially the bulletin type.
* @param sequence
* the the VTN.
* @param startTime
* the valid start time for the bulletin.
* @param endTime
* the valid end time for the bulletin.
*/
public VtecObject(String action, String office, String phenomenon,
String significance, int sequence) {
this.action = action;
this.office = office;
this.phenomena = phenomenon;
this.significance = significance;
this.sequence = sequence;
}
/**
* Constructor. Creates a partially populated P-VTEC object.
*
* @param office
* the originating office.
* @param phenomenon
* the phenomenon for the bulletin.
* @param significance
* the significance of the event - essentially the bulletin type.
* @param sequence
* the the VTN.
*/
public VtecObject(String office, String phenomenon, String significance,
int sequence) {
this.office = office;
this.phenomena = phenomenon;
this.significance = significance;
this.sequence = sequence;
}
/**
* Returns the P-VTEC Action token.
*
* @return the action
*/
public String getAction() {
return action;
}
/**
* Sets the P-VTEC Action token.
*
* @param action
* the action to set
*/
public void setAction(String action) {
this.action = action;
}
/**
* Returns the P-VTEC Office ID token.
*
* @return the office
*/
public String getOffice() {
return office;
}
/**
* Sets the P-VTEC Office ID token.
*
* @param office
* the office to set
*/
public void setOffice(String office) {
this.office = office;
}
/**
* Returns the P-VTEC Phenomena token.
*
* @return the phenomenon
*/
public String getPhenomena() {
return phenomena;
}
/**
* Sets the P-VTEC Phenomena token.
*
* @param phenomenon
* the phenomenon to set
*/
public void setPhenomena(String phenomenon) {
this.phenomena = phenomenon;
}
/**
* Returns the P-VTEC Significance token.
*
* @return the significance
*/
public String getSignificance() {
return significance;
}
/**
* Sets the P-VTEC Significance token.
*
* @param significance
* the significance to set
*/
public void setSignificance(String significance) {
this.significance = significance;
}
/**
* Returns the P-VTEC ETN Sequence value.
*
* @return the sequence
*/
public Integer getSequence() {
return sequence;
}
/**
* Sets the P-VTEC ETN Sequence value.
*
* @param sequence
* the sequence to set
*/
public void setSequence(Integer sequence) {
this.sequence = sequence;
}
public String getProduct() {
return product;
}
public void setProduct(String product) {
this.product = product;
}
public Calendar getStartTime() {
return startTime;
}
public void setStartTime(Calendar startTime) {
this.startTime = startTime;
}
public Calendar getEndTime() {
return endTime;
}
public void setEndTime(Calendar endTime) {
this.endTime = endTime;
}
/*
* (non-Javadoc)
*
* @see com.raytheon.edex.vtec.db.IVtecObject#getVtecString()
*/
public String getVtecString() {
return generateVtec();
}
/**
* Generates the P-VTEC String for the object. Missing fields are indicated
* with an underscore.
*
* @return the P-VTEC string for the object
*/
private String generateVtec() {
return String.format(vtecCreateFormat, this.product, this.action,
this.office, this.phenomena, this.significance, this.sequence,
VtecUtil.formatVtecTime(this.startTime),
VtecUtil.formatVtecTime(this.endTime));
}
@Override
public String toString() {
return generateVtec();
}
/*
* (non-Javadoc)
*/
public String getMatchString() {
return String.format(PARTIAL_MATCH_FORMAT, this.office, this.phenomena,
this.significance);
}
public String getPhensig() {
return phenomena + '.' + significance;
}
}

View file

@ -1,360 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.viz.texteditor.util;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.TimeZone;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import com.raytheon.uf.common.activetable.ActiveTableMode;
import com.raytheon.uf.common.activetable.GetNextEtnRequest;
import com.raytheon.uf.common.activetable.response.GetNextEtnResponse;
import com.raytheon.uf.common.time.SimulatedTime;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.requests.ThriftClient;
import com.raytheon.viz.core.mode.CAVEMode;
/**
* Utility class for assigning the next ETN to a VTEC string in a transmitted
* VTEC product.
*
* <pre>
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Feb 09, 2009 bwoodle Initial creation
* May 08, 2013 #1842 dgilling Code cleanup.
* Aug 29, 2013 #1843 dgilling Use new GetNextEtnRequest constructor.
* Oct 21, 2013 #1843 dgilling Use new GetNextEtnResponse.
* Apr 28, 2015 #4027 randerso Expunged Calendar from ActiveTableRecord
* Added getNextEtn method with parameter to specify
* activeTableMode
*
* </pre>
*
* @author bwoodle
* @version 1.0
*/
public class VtecUtil {
private static final String dateFormat = "%1$ty%1$tm%1$tdT%1$tH%1$tMZ";
public static final Pattern VTEC_REGEX = Pattern
.compile("\\/([OTEX])\\.([A-Z]{3})\\.([A-Za-z0-9]{4})\\.([A-Z]{2})\\.([WAYSFON])\\.(\\d{4})\\.(\\d{6}T\\d{4}Z)-(\\d{6}T\\d{4}Z)\\/");
/**
* A private constructor so that Java does not attempt to create one for us.
* As this class should not be instantiated, do not attempt to ever call
* this constructor; it will simply throw an AssertionError.
*
*/
private VtecUtil() {
throw new AssertionError();
}
/**
* Gets the next available ETN for a specific product and office
*
* @param message
* the message containing the VTEC string to update
*
* @return the update message
*
* @throws VizException
* if an error occurs
*/
public static String getVtec(String message) throws VizException {
return getVtec(message, false);
}
/**
* Gets the next available ETN for a specific product and office
*
* @param message
* the message containing the VTEC string to update
*
* @return the update message
*
* @throws VizException
* if an error occurs
*/
public static String getVtec(String message, boolean lockEtn)
throws VizException {
/* quick short circuit - exit if message is null */
if (message == null) {
return message;
}
VtecObject vtec = parseMessage(message);
if ((vtec == null) || (vtec.getAction() == null)) {
return message;
}
if (vtec.getAction().equals("NEW")) {
int nextEtn = getNextEtn(vtec.getOffice(),
vtec.getPhenomena() + "." + vtec.getSignificance(), lockEtn)
.getNextEtn();
vtec.setSequence(nextEtn);
}
return replaceFirstVtecString(message, vtec);
}
/**
* Gets the next available ETN for a specific product and office.
*
* @param office
* The 4-character site ID of the office.
* @param phensig
* The phenomenon and significance of the hazard concatenated
* with a '.' (e.g., TO.W or DU.Y)
* @param lockEtn
* Whether or not to request an exclusive ETN--if true, this will
* cause the server to increment its running ETN sequence to the
* next number after determining the next ETN for this request.
* If false, the next ETN will be returned, but it will not
* increment the server's running sequence, so the ETN return
* could be used by another client that makes a
* GetNextEtnRequest.
* @return The next ETN in sequence, given the office and phensig.
* @throws VizException
* If an error occurs while submitting or processing the remote
* request.
*/
public static GetNextEtnResponse getNextEtn(String office, String phensig,
boolean lockEtn) throws VizException {
return getNextEtn(office, phensig, lockEtn, false, false, null);
}
/**
* Gets the next available ETN for a specific product and office.
*
* @param office
* The 4-character site ID of the office.
* @param phensig
* The phenomenon and significance of the hazard concatenated
* with a '.' (e.g., TO.W or DU.Y)
* @param lockEtn
* Whether or not to request an exclusive ETN--if true, this will
* cause the server to increment its running ETN sequence to the
* next number after determining the next ETN for this request.
* If false, the next ETN will be returned, but it will not
* increment the server's running sequence, so the ETN return
* could be used by another client that makes a
* GetNextEtnRequest.
* @param performISC
* Whether or not to collaborate with neighboring sites to
* determine the next ETN. See {@link
* GetNextEtnUtil#getNextEtnFromPartners(String, ActiveTableMode,
* String, Calendar, List<IRequestRouter>)} for more information.
* @param reportOnlyConflict
* Affects which kinds of errors get reported back to the
* requestor. If true, only cases where the value of
* <code>etnOverride</code> is less than or equal to the last ETN
* used by this site or any of its partners will be reported.
* Else, all significant errors will be reported back.
* @param etnOverride
* Allows the user to influence the next ETN assigned by using
* this value unless it is less than or equal to the last ETN
* used by this site or one of its partners.
* @return The next ETN in sequence, given the office and phensig.
* @throws VizException
* If an error occurs while submitting or processing the remote
* request.
*/
public static GetNextEtnResponse getNextEtn(String office, String phensig,
boolean lockEtn, boolean performISC, boolean reportOnlyConflict,
Integer etnOverride) throws VizException {
ActiveTableMode mode = (CAVEMode.getMode().equals(CAVEMode.PRACTICE)) ? ActiveTableMode.PRACTICE
: ActiveTableMode.OPERATIONAL;
return getNextEtn(office, phensig, lockEtn, performISC,
reportOnlyConflict, etnOverride, mode);
}
/**
* Gets the next available ETN for a specific product and office.
*
* @param office
* The 4-character site ID of the office.
* @param phensig
* The phenomenon and significance of the hazard concatenated
* with a '.' (e.g., TO.W or DU.Y)
* @param lockEtn
* Whether or not to request an exclusive ETN--if true, this will
* cause the server to increment its running ETN sequence to the
* next number after determining the next ETN for this request.
* If false, the next ETN will be returned, but it will not
* increment the server's running sequence, so the ETN return
* could be used by another client that makes a
* GetNextEtnRequest.
* @param performISC
* Whether or not to collaborate with neighboring sites to
* determine the next ETN. See {@link
* GetNextEtnUtil#getNextEtnFromPartners(String, ActiveTableMode,
* String, Calendar, List<IRequestRouter>)} for more information.
* @param reportOnlyConflict
* Affects which kinds of errors get reported back to the
* requestor. If true, only cases where the value of
* <code>etnOverride</code> is less than or equal to the last ETN
* used by this site or any of its partners will be reported.
* Else, all significant errors will be reported back.
* @param etnOverride
* Allows the user to influence the next ETN assigned by using
* this value unless it is less than or equal to the last ETN
* used by this site or one of its partners.
* @param mode
* Indicates which active table to query
* @return The next ETN in sequence, given the office and phensig.
* @throws VizException
* If an error occurs while submitting or processing the remote
* request.
*/
public static GetNextEtnResponse getNextEtn(String office, String phensig,
boolean lockEtn, boolean performISC, boolean reportOnlyConflict,
Integer etnOverride, ActiveTableMode mode) throws VizException {
Date currentTime = SimulatedTime.getSystemTime().getTime();
GetNextEtnRequest req = new GetNextEtnRequest(office, mode, phensig,
currentTime, lockEtn, performISC, reportOnlyConflict,
etnOverride);
GetNextEtnResponse resp = (GetNextEtnResponse) ThriftClient
.sendRequest(req);
GetNextEtnResponse rval = (resp != null) ? resp
: new GetNextEtnResponse(1, phensig);
return rval;
}
/**
* Parse a VTEC message
*
* @param message
* the message
* @return the parsed VtecObject
*/
public static VtecObject parseMessage(String message) {
VtecObject rval = null;
Matcher m = VTEC_REGEX.matcher(message);
if (m.find()) {
rval = new VtecObject(m.group());
}
return rval;
}
/**
* Performs a replacement on a P-VTEC string embedded in a message. This
* assumes that 1) the P-VTEC string is identifiable by the WFO, phenomenon,
* and sequence, and 2) at most one matching VTEC string will occur in a
* single message. If the message does not have a matching VTEC string, the
* original message is returned.
*
* @param message
* the message to modify
* @param vtec
* new VTEC for the message
*
* @return the modified message
*/
public static String replaceFirstVtecString(String message, VtecObject vtec) {
String vStr = vtec.getVtecString();
String pattern = vtec.getMatchString();
// Replace the representation of 0 time with the text of 0 time.
// This is needed for follow ups (i.e. EXT, CON, CAN)
return message.replaceFirst(pattern, vStr).replace("991130T0000Z",
"000000T0000Z");
}
/**
* Formats the Calendar into the standard VTEC date/time string format. If
* the Calendar is {@code null}, an underscore is used as the formatted
* string. The standard VTEC format is "yymmddThhmmZ"
*
* @param cal
* the Calendar to format
* @return the formatted Calendar
*/
public static final String formatVtecTime(Calendar cal) {
return (cal != null) ? String.format(dateFormat, cal) : "_";
}
/**
* Creates a calendar for the specified dateTime. The time zone is set to
* GMT. No checking is performed to validate entries.
*
* @param year
* four digit year
* @param month
* month of the year (January = 0)
* @param day
* day of the month
* @param hour
* hour of the day (0 - 23)
* @param min
* minute of the hour (0 - 59)
*
* @return a Calendar representing the specified date.
*/
public static final Calendar getVtecCalendar(int year, int month, int day,
int hour, int min) {
GregorianCalendar cal = new GregorianCalendar(
TimeZone.getTimeZone("GMT"));
cal.clear();
cal.set(year, month, day, hour, min);
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MILLISECOND, 0);
return cal;
}
/**
* Creates a Calendar object by parsing the VTEC date/time string.
*
* @param date
* the date/time string to parse.
*
* @return the Calendar representing the date.
*/
public static final Calendar calendarFromVtec(String date) {
Pattern p = Pattern
.compile("(\\d{2})(\\d{2})(\\d{2})T(\\d{2})(\\d{2})Z");
Matcher m = p.matcher(date);
// get a calendar based on GMT time zone
// all time stamp strings from the catalog query are in GMT
GregorianCalendar cal = new GregorianCalendar(
TimeZone.getTimeZone("GMT"));
if (m.matches()) {
int year = Integer.parseInt(m.group(1)) + 2000;
int month = Integer.parseInt(m.group(2)) - 1;
int day = Integer.parseInt(m.group(3));
int hour = Integer.parseInt(m.group(4));
int min = Integer.parseInt(m.group(5));
cal.clear();
cal.set(year, month, day, hour, min);
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MILLISECOND, 0);
}
return cal;
}
}

View file

@ -1,175 +0,0 @@
package com.raytheon.viz.volumebrowser.xml;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import com.raytheon.viz.volumebrowser.vbui.VBMenuBarItemsMgr.ViewMenu;
/**
*
* Description of a single source for the volume browser.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------- -------- ----------- -----------------------------------------
* Jan 06, 2011 bsteffen Initial creation
* Dec 11, 2013 2602 bsteffen Remove ISerializableObject.
* Aug 14, 2014 3506 mapeters Added remove field and equals
* and hashCode functions.
* Jul 10, 2015 4641 mapeters Added toString().
*
* </pre>
*
* @author bsteffen
* @version 1.0
* @see VbSourceList
*/
@XmlAccessorType(XmlAccessType.NONE)
public class VbSource {
@XmlAttribute(required = true)
private String key;
@XmlAttribute(required = false)
private String name;
@XmlAttribute(required = true)
private String category;
@XmlAttribute(required = false)
private List<ViewMenu> views;
@XmlAttribute(required = false)
private String subCategory;
@XmlAttribute(required = false)
private boolean remove;
/**
* @return the key
*/
public String getKey() {
return key;
}
/**
* @param key
* the key to set
*/
public void setKey(String key) {
this.key = key;
}
/**
* @return the name
*/
public String getName() {
return name;
}
/**
* @param name
* the name to set
*/
public void setName(String name) {
this.name = name;
}
/**
* @return the category
*/
public String getCategory() {
return category;
}
/**
* @param category
* the category to set
*/
public void setCategory(String category) {
this.category = category;
}
/**
* @return the views
*/
public List<ViewMenu> getViews() {
return views;
}
/**
* @param views
* the views to set
*/
public void setViews(List<ViewMenu> views) {
this.views = views;
}
/**
* @return the subCategory
*/
public String getSubCategory() {
return subCategory;
}
/**
* @param subCategory
* the subCategory to set
*/
public void setSubCategory(String subCategory) {
this.subCategory = subCategory;
}
/**
* @return whether or not this source is to be removed
*/
public boolean getRemove() {
return remove;
}
/**
* @param remove
* the remove status to set
*/
public void setRemove(boolean remove) {
this.remove = remove;
}
@Override
public boolean equals(Object that) {
if (that instanceof VbSource) {
if ((this.key.equals(((VbSource) that).getKey()) && (this
.getCategory().compareTo(((VbSource) that).getCategory()) == 0))) {
return true;
}
}
return false;
}
@Override
public int hashCode() {
String newKey = key.concat(category);
return newKey.hashCode();
}
@Override
public String toString() {
StringBuilder sourceString = new StringBuilder("VbSource[");
sourceString.append("key=").append(key);
sourceString.append(", ");
sourceString.append("name=").append(name);
sourceString.append(", ");
sourceString.append("category=").append(category);
sourceString.append(", ");
sourceString.append("subCategory=").append(subCategory);
sourceString.append("]");
return sourceString.toString();
}
}

View file

@ -1,596 +0,0 @@
package com.raytheon.viz.volumebrowser.xml;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.ListIterator;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import javax.xml.bind.JAXB;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import com.raytheon.uf.common.dataplugin.grid.dataset.DatasetInfo;
import com.raytheon.uf.common.dataplugin.grid.dataset.DatasetInfoLookup;
import com.raytheon.uf.common.localization.FileUpdatedMessage;
import com.raytheon.uf.common.localization.ILocalizationFileObserver;
import com.raytheon.uf.common.localization.IPathManager;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.localization.exception.LocalizationException;
import com.raytheon.uf.common.menus.xml.CommonAbstractMenuContribution;
import com.raytheon.uf.common.menus.xml.CommonMenuContribution;
import com.raytheon.uf.common.menus.xml.CommonTitleImgContribution;
import com.raytheon.uf.common.menus.xml.CommonToolBarContribution;
import com.raytheon.uf.common.menus.xml.CommonToolbarSubmenuContribution;
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.viz.volumebrowser.vbui.VBMenuBarItemsMgr.ViewMenu;
/**
*
* List of sources for populating the volume browser tool bar menus
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------- -------- ----------- -----------------------------------------
* Jan 06, 2011 bsteffen Initial creation
* Dec 11, 2013 2602 bsteffen Remove ISerializableObject.
* Mar 18, 2014 2874 bsteffen Allow subMenus and move contribution
* creation from DataListsProdTableComp
* Aug 19, 2014 3506 mapeters Populate toolbar contributions from directory of
* source files instead of one file, merge sources from
* different localization levels instead of overriding.
* Jul 07, 2015 4641 mapeters Fix/improve comparators for VbSource sorting.
* Jul 10, 2015 4641 mapeters Added check for sources with null key/category fields.
* Oct 05, 2015 3861 bsteffen Remove deprecated method call on LocalizationFile
* Feb 12, 2016 5242 dgilling Remove calls to deprecated Localization APIs.
*
* </pre>
*
* @author bsteffen
* @version 1.0
*/
@XmlAccessorType(XmlAccessType.NONE)
@XmlRootElement
public class VbSourceList {
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(VbSourceList.class);
private final static IPathManager pm = PathManagerFactory.getPathManager();
/** The sources categories in order */
private static final String[] CATEGORIES = new String[] { "Volume",
"SfcGrid", "Local", "Point" };
/**
* Comparator for sorting sources (compares category, then subcategory, then
* name).
*/
private static Comparator<VbSource> comparator = new Comparator<VbSource>() {
@Override
public int compare(VbSource source1, VbSource source2) {
String cat1 = source1.getCategory();
String cat2 = source2.getCategory();
if (!cat1.equals(cat2)) {
/*
* Categories are in the format
* "DropDownMenu/SubMenu/SubMenu/..."
*/
String[] cat1Parts = cat1.split("/");
String[] cat2Parts = cat2.split("/");
int minParts = Math.min(cat1Parts.length, cat2Parts.length);
for (int i = 0; i < minParts; i++) {
if (!cat1Parts[i].equals(cat2Parts[i])) {
/*
* Compare the drop down menu names differently to keep
* them in the order the NWS is used to.
*/
Comparator<String> comparator = (i == 0) ? categoryComparator
: stringComparator;
return comparator.compare(cat1Parts[i], cat2Parts[i]);
}
}
/*
* At this point, categories must match up to the end of the
* smaller of the two (e.g. SfcGrid and SfcGrid/RTOFS/forecast).
* Return the comparison of sourceWithShorterCategory's name and
* otherSource's next submenu level (RTOFS in the example).
*/
if (cat1Parts.length > minParts) {
return stringComparator.compare(cat1Parts[minParts],
source2.getName());
} else {
return stringComparator.compare(source1.getName(),
cat2Parts[minParts]);
}
}
/*
* Compare subcategories next. If one source has a subcategory and
* another doesn't, return the source with a subcategory as being
* larger (later in the list).
*/
String subCat1 = source1.getSubCategory();
String subCat2 = source2.getSubCategory();
if (subCat1 != null && subCat2 != null) {
if (!subCat1.equals(subCat2)) {
return stringComparator.compare(subCat1, subCat2);
}
} else if (subCat1 != null) {
return 1;
} else if (subCat2 != null) {
return -1;
}
// Compare names if categories and subcategories match.
return stringComparator.compare(source1.getName(),
source2.getName());
}
};
/**
* Comparator for comparing two strings, ignoring capitalization and
* comparing numeric values (assumes there are no leading zeros in the
* numeric values).
*/
private static Comparator<String> stringComparator = new Comparator<String>() {
@Override
public int compare(String s1, String s2) {
int n1 = s1.length();
int n2 = s2.length();
int min = Math.min(n1, n2);
String number1 = "";
String number2 = "";
for (int i = 0; i < min; i++) {
char c1 = s1.charAt(i);
char c2 = s2.charAt(i);
if (Character.isDigit(c1) && Character.isDigit(c2)) {
/*
* If aligned characters are both digits, store them as
* strings and proceed to next pair of aligned characters.
*/
number1 += c1;
number2 += c2;
continue;
} else if (!(Character.isDigit(c1) || Character.isDigit(c2))) {
/*
* If neither aligned character is a digit, return
* difference in stored numbers if they aren't equal,
* otherwise reset numbers if they aren't already empty.
*/
if (!number1.equals(number2)) {
return Integer.valueOf(number1)
- Integer.valueOf(number2);
} else if (!number1.isEmpty()) {
number1 = "";
number2 = "";
}
} else if (!number1.isEmpty()) {
/*
* Exactly one of the two characters must be a digit to
* reach here. If the numbers aren't empty, whichever string
* has the extra digit is larger as its number is larger.
*/
if (Character.isDigit(c1)) {
return 1;
} else {
return -1;
}
}
c1 = Character.toUpperCase(c1);
c2 = Character.toUpperCase(c2);
if (c1 != c2) {
c1 = Character.toLowerCase(c1);
c2 = Character.toLowerCase(c2);
if (c1 != c2) {
// No overflow because of numeric promotion
return c1 - c2;
}
}
}
/*
* If two strings end with unequal numeric values after for loop,
* check for additional digits beyond minimum length to determine
* order.
*/
if (!number1.equals(number2)) {
if (n1 > n2 && Character.isDigit(s1.charAt(n2))) {
return 1;
} else if (n2 > n1 && Character.isDigit(s2.charAt(n1))) {
return -1;
} else {
return Integer.valueOf(number1) - Integer.valueOf(number2);
}
}
return n1 - n2;
}
};
/**
* Comparator for comparing the drop down menu names of the sources.
* Determines order based on {@link #CATEGORIES}.
*/
private static Comparator<String> categoryComparator = new Comparator<String>() {
@Override
public int compare(String cat1, String cat2) {
if (cat1.equals(cat2)) {
return 0;
}
for (String category : CATEGORIES) {
/*
* The categories aren't equal (checked for above), so whichever
* one appears first in the ordered categories list (CATEGORIES)
* should be returned as being smaller (making it also appear
* earlier in the sorted list of VbSources).
*/
if (cat1.equals(category)) {
return -1;
} else if (cat2.equals(category)) {
return 1;
}
}
/*
* If neither category is in the ordered list of expected
* categories, compare them alphabetically.
*/
return stringComparator.compare(cat1, cat2);
}
};
/**
* @deprecated This file path string exists only to support legacy overrides
* and should eventually be removed.
*/
@Deprecated
private final static String VB_SOURCE_FILE = "volumebrowser/VbSources.xml";
private final static char SUB_MENU_SPLIT = '/';
private static class VbSourceListener implements ILocalizationFileObserver {
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.common.localization.ILocalizationFileObserver#fileUpdated
* (com.raytheon.uf.common.localization.FileUpdatedMessage)
*/
@Override
public void fileUpdated(FileUpdatedMessage message) {
synchronized (VB_SOURCE_FILE) {
instance = null;
}
}
}
private static ILocalizationFileObserver observer = null;
private static VbSourceList instance;
/**
* List of all the sources from one file at one localization level.
*/
@XmlElement(name = "vbSource")
private List<VbSource> entries;
/**
* @return the entries
*/
public List<VbSource> getEntries() {
return entries;
}
/**
* @param entries
* the entries to set
*/
public void setEntries(List<VbSource> entries) {
this.entries = entries;
}
/**
* List of all sources from all files at all localization levels.
*/
private List<VbSource> allSources;
/**
* @return the list of all sources
*/
public synchronized List<VbSource> getAllSources() {
return allSources;
}
public static VbSourceList getInstance() {
synchronized (VB_SOURCE_FILE) {
if (instance == null) {
instance = new VbSourceList();
instance.populateAllSources();
if (observer == null) {
observer = new VbSourceListener();
LocalizationFile vbDirectory = pm
.getStaticLocalizationFile("volumebrowser");
vbDirectory.addFileUpdatedObserver(observer);
}
}
return instance;
}
}
public synchronized void populateAllSources() {
allSources = new ArrayList<VbSource>();
List<String> fileNames = new ArrayList<String>();
LocalizationFile vbSourceFile = pm
.getStaticLocalizationFile(VB_SOURCE_FILE);
if (vbSourceFile == null) {
LocalizationFile[] files = pm.listStaticFiles(
"volumebrowser/VbSources", null, false, true);
for (LocalizationFile file : files) {
fileNames.add(file.getPath());
}
} else {
fileNames.add(VB_SOURCE_FILE);
}
for (String fileName : fileNames) {
Map<LocalizationLevel, LocalizationFile> localizationFilesMap = pm
.getTieredLocalizationFile(LocalizationType.CAVE_STATIC,
fileName);
LocalizationLevel[] levels = pm.getAvailableLevels();
/*
* Add sources from localization files to entries, in order of
* greatest precedence to lowest
*/
for (int i = levels.length - 1; i >= 0; i--) {
LocalizationFile locFile = localizationFilesMap.get(levels[i]);
if (locFile != null) {
List<VbSource> sources = null;
try (InputStream is = locFile.openInputStream()) {
sources = JAXB.unmarshal(is, VbSourceList.class)
.getEntries();
} catch (IOException | LocalizationException e) {
statusHandler
.handle(Priority.ERROR,
locFile.getPath()
+ " was excluded from sources menu due to error reading file.");
}
if (sources != null) {
Iterator<VbSource> itr = sources.iterator();
while (itr.hasNext()) {
VbSource source = itr.next();
if (source.getCategory() == null
|| source.getKey() == null) {
statusHandler
.handle(Priority.WARN,
source
+ " was excluded from sources menu due to null key and/or category field.");
itr.remove();
}
}
allSources.addAll(sources);
}
}
}
}
DatasetInfoLookup lookup = DatasetInfoLookup.getInstance();
DatasetInfo info;
// Set containing sources to not be added to lists
Set<VbSource> removes = new HashSet<VbSource>();
Iterator<VbSource> itr = allSources.iterator();
// The current index in allSources
int i = 0;
while (itr.hasNext()) {
VbSource source = itr.next();
// Set display names for sources
if (source.getName() == null) {
info = lookup.getInfo(source.getKey());
source.setName(info != null ? info.getTitle() : source.getKey());
}
if (source.getRemove()) {
// Add sources with remove tags to removal set and remove them.
removes.add(source);
itr.remove();
} else if (removes.contains(source)
|| allSources.subList(0, i).contains(source)) {
// Remove sources in removal set and repeats
itr.remove();
} else {
// Increment index in allSources if source wasn't removed
i++;
}
}
Collections.sort(allSources, comparator);
allSources = Collections.unmodifiableList(allSources);
}
/**
* Use the VbSources information to build {@link CommonToolBarContribution}
* s.
*
* @param selectedView
* the active viewMenu for the sources tool bar.
* @return
*/
public static List<CommonToolBarContribution> getToolBarContributions(
ViewMenu selectedView) {
/*
* When processing the VbSource objects we need to look up the
* contributions based off String values in the XML.
*/
Map<String, CommonAbstractMenuContribution> contributions = new HashMap<String, CommonAbstractMenuContribution>();
/*
* For every category, subcategory or subMenu keep a list of all menu
* contributions that fall within that category/menu.
*/
Map<CommonAbstractMenuContribution, List<CommonAbstractMenuContribution>> subContributions = new LinkedHashMap<CommonAbstractMenuContribution, List<CommonAbstractMenuContribution>>();
for (VbSource source : VbSourceList.getInstance().getAllSources()) {
String key = source.getKey();
/*
* Skip sources that are not active for this view or are marked for
* removal
*/
if (source.getViews() != null
&& !source.getViews().contains(selectedView)) {
continue;
}
String cat = source.getCategory();
String subCat = source.getSubCategory();
/*
* Start with the menu item for the source and then find where it
* goes.
*/
CommonMenuContribution mContrib = new CommonMenuContribution();
mContrib.key = key;
mContrib.menuText = source.getName();
CommonAbstractMenuContribution contrib = mContrib;
if (subCat != null) {
/*
* If there is a subCategory then that should appear within the
* category and any submenues within that category.
*/
String subCatkey = cat + ':' + subCat;
if (contributions.containsKey(subCatkey)) {
CommonTitleImgContribution tContrib = (CommonTitleImgContribution) contributions
.get(subCatkey);
List<CommonAbstractMenuContribution> subList = subContributions
.get(tContrib);
subList.add(contrib);
contrib = null;
} else {
CommonTitleImgContribution tContrib = new CommonTitleImgContribution();
tContrib.titleText = subCat;
tContrib.displayDashes = true;
tContrib.displayImage = true;
List<CommonAbstractMenuContribution> subList = new ArrayList<CommonAbstractMenuContribution>();
subList.add(contrib);
subContributions.put(tContrib, subList);
contributions.put(subCatkey, tContrib);
contrib = tContrib;
}
}
/*
* contrib will be null if the subCategory was already created by a
* different source in which case no further processing is needed.
*/
if (contrib != null) {
int sepInd = cat.lastIndexOf(SUB_MENU_SPLIT);
while (sepInd > -1) {
String parent = cat.substring(0, sepInd);
String child = cat.substring(sepInd + 1);
if (contributions.containsKey(cat)) {
CommonAbstractMenuContribution sContrib = contributions
.get(cat);
List<CommonAbstractMenuContribution> subList = subContributions
.get(sContrib);
subList.add(contrib);
contrib = null;
/*
* If the subMenu already exists we don't need to
* process any further
*/
break;
} else {
CommonToolbarSubmenuContribution sContrib = new CommonToolbarSubmenuContribution();
sContrib.menuText = child;
sContrib.id = selectedView + cat;
List<CommonAbstractMenuContribution> subList = new ArrayList<CommonAbstractMenuContribution>();
subList.add(contrib);
subContributions.put(sContrib, subList);
contributions.put(cat, sContrib);
contrib = sContrib;
}
cat = parent;
sepInd = cat.lastIndexOf(SUB_MENU_SPLIT);
}
if (contrib != null) {
if (contributions.containsKey(cat)) {
CommonAbstractMenuContribution pContrib = contributions
.get(cat);
List<CommonAbstractMenuContribution> subList = subContributions
.get(pContrib);
subList.add(contrib);
} else {
CommonToolBarContribution rContrib = new CommonToolBarContribution();
rContrib.toolItemText = cat;
rContrib.id = selectedView + cat;
List<CommonAbstractMenuContribution> subList = new ArrayList<CommonAbstractMenuContribution>();
subList.add(contrib);
subContributions.put(rContrib, subList);
contributions.put(cat, rContrib);
contrib = rContrib;
}
}
}
}
/*
* Now that all sources are processed, set the contributions within the
* toolbar and submenu contributions. Also add all subcategories to the
* end of the menu that contains them.
*/
contributions = null;
List<CommonToolBarContribution> rootContributions = new ArrayList<CommonToolBarContribution>();
for (Entry<CommonAbstractMenuContribution, List<CommonAbstractMenuContribution>> entry : subContributions
.entrySet()) {
CommonAbstractMenuContribution contrib = entry.getKey();
/*
* Pull out all sub categories(CommonTitleImgContribution), move
* them to the end of the list and then add all items within the
* subcategory to the contributions. This is because sub categories
* are just a visual separator not an actual element with children.
*/
List<CommonAbstractMenuContribution> list = entry.getValue();
List<CommonAbstractMenuContribution> titleItems = new ArrayList<CommonAbstractMenuContribution>();
ListIterator<CommonAbstractMenuContribution> it = list
.listIterator();
while (it.hasNext()) {
CommonAbstractMenuContribution subContrib = it.next();
if (subContrib instanceof CommonTitleImgContribution) {
it.remove();
titleItems.add(subContrib);
}
}
for (CommonAbstractMenuContribution titleItem : titleItems) {
list.add(titleItem);
list.addAll(subContributions.get(titleItem));
}
if (contrib instanceof CommonToolBarContribution) {
CommonToolBarContribution rContrib = (CommonToolBarContribution) contrib;
rContrib.contributions = list
.toArray(new CommonAbstractMenuContribution[0]);
rootContributions.add(rContrib);
} else if (contrib instanceof CommonToolbarSubmenuContribution) {
CommonToolbarSubmenuContribution sContrib = (CommonToolbarSubmenuContribution) contrib;
sContrib.contributions = list
.toArray(new CommonAbstractMenuContribution[0]);
}
}
return rootContributions;
}
}

View file

@ -1,53 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.viz.warngen;
/**
* TODO Add Description
*
* <pre>
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jul 29, 2009 bwoodle Initial creation
*
* </pre>
*
* @author bwoodle
* @version 1.0
*/
public class WarngenConstants {
public static final int INSTRUCTIONS_HEIGHT = 20;
public static final String INSTRUCTION_DRAG_STORM = "Move Centroid to Storm in any Frame";
public static final String INSTRUCTION_NO_SHADED_AREA = "Move Storm Polygon to CWA";
/**
* Pattern is localization site (OAX, ABR, etc) concatenated with WRK
* concatenated with a 1-3 char id set by workstation (W4, WG4, etc)
*/
public static final String AFOS_ID_PATTERN = "%sWRK%s";
}

View file

@ -1,239 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.viz.warnings;
import java.text.DateFormat;
import java.util.Date;
import java.util.TimeZone;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import com.raytheon.viz.texteditor.TextWarningConstants;
/**
* Warning Date Util
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 06182008 bwoodle additional format method overloads, javadocs.
* Sep 12, 2014 ASM RM#15551 Qinglu Lin Added formatUseNoonMidnight().
* Oct 21, 2015 5022 randerso Changes for mixed case WarnGen products
*
* </pre>
*
* @author ?
*
*/
public class DateUtil {
Pattern timePtrn = Pattern.compile("(1200\\s(AM|PM))");
/**
* Format a date for the severe weather warnings templates
*
* @param date
* @param format
* @return
*/
public String format(Date date, DateFormat format) {
return format(date, format, 0);
}
/**
* Format a date for the severe weather warnings templates
*
* @param date
* @param format
* @param interval
* @return
*/
public String format(Date date, DateFormat format, int interval) {
return format(date, format, interval, TimeZone.getTimeZone("GMT"));
}
/**
* Format a date for the severe weather warnings templates
*
* This method rounds to the closest interval - up or down.
*
* @param date
* @param format
* @param interval
* @param tz
* @return
*/
public String format(Date date, DateFormat format, int interval, String tz) {
return format(date, format, interval, getTimeZoneFromString(tz));
}
/**
* Format a date for the severe weather warnings templates
*
* This method rounds to the closest interval - up or down.
*
* @param date
* @param format
* @param interval
* @param tz
* @return
*/
public String format(Date date, DateFormat format, int interval, TimeZone tz) {
String str;
Date workingDate = date;
if (interval > 0) {
workingDate = roundDate(date, interval);
}
synchronized (format) {
format.setTimeZone(tz);
str = format.format(workingDate);
}
return str;
}
public String formatUseNoonMidnight(Date date, DateFormat format,
int interval, String tz) {
return formatUseNoonMidnight(date, format, interval,
getTimeZoneFromString(tz));
}
public String formatUseNoonMidnight(Date date, DateFormat format,
int interval, TimeZone tz) {
String str;
Date workingDate = date;
if (interval > 0) {
workingDate = roundDate(date, interval);
}
synchronized (format) {
format.setTimeZone(tz);
str = format.format(workingDate);
}
Matcher m = timePtrn.matcher(str);
if (m.find()) {
str = str.replace("1200 AM", "midnight");
str = str.replace("1200 PM", "noon");
}
return str;
}
/**
* Format a date for the severe weather warnings templates
*
* @param date
* @param format
* @param tz
* @return
*/
public String format(Date date, DateFormat format, TimeZone tz) {
return format(date, format, 0, tz);
}
/**
* Format a date for the severe weather warnings templates
*
* @param date
* @param format
* @param tz
* @return
*/
public String format(Date date, DateFormat format, String tz) {
return format(date, format, 0, getTimeZoneFromString(tz));
}
/**
* Format a date for the severe weather warnings templates
*
* @param date
* @param format
* @return
*/
public String formatLocal(Date date, DateFormat format) {
return formatLocal(date, format, 0);
}
/**
* Format a date for the severe weather warnings templates
*
* @param date
* @param format
* @param interval
* @return
*/
public String formatLocal(Date date, DateFormat format, int interval) {
return format(date, format, interval, TimeZone.getDefault());
}
private TimeZone getTimeZoneFromString(String tz) {
TimeZone rval = null;
rval = TextWarningConstants.timeZoneAbbreviationMap.get(tz);
if (rval == null) {
rval = TimeZone.getDefault();
}
return rval;
}
public String period(Date date, DateFormat format, int interval, String tz) {
Pattern periodPtrn = Pattern.compile("(\\d{3})\\s(\\w{2})");
Matcher m = periodPtrn.matcher(format(date, format, interval, tz));
if (m.find()) {
if (m.group(2).equalsIgnoreCase("AM")) {
return " morning";
} else if (Integer.parseInt(m.group(1)) < 600) {
return " afternoon";
} else {
return " evening";
}
} else {
return "";
}
}
public static Date roundDateTo15(Date input) {
int intervalInMs = 60 * 1000 * 15;
long tNormal = input.getTime();
long tEarlier = input.getTime() - (input.getTime() % intervalInMs);
long tLater = tEarlier + intervalInMs;
long earlierDelta = tNormal - tEarlier;
long laterDelta = tLater - tNormal;
if (earlierDelta > laterDelta) {
return new Date(tLater);
} else {
return new Date(tEarlier);
}
}
public static Date roundDate(Date input, int intervalInMin) {
int intervalInMs = 60 * 1000 * intervalInMin;
long tNormal = input.getTime();
long tEarlier = input.getTime() - (input.getTime() % intervalInMs);
long tLater = tEarlier + intervalInMs;
long earlierDelta = tNormal - tEarlier;
long laterDelta = tLater - tNormal;
if (earlierDelta > laterDelta) {
return new Date(tLater);
} else {
return new Date(tEarlier);
}
}
}

View file

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

View file

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

View file

@ -1,7 +0,0 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6

View file

@ -1,10 +0,0 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Satellite Spatial Upgrade
Bundle-SymbolicName: com.raytheon.uf.edex.upgrade.satellitespatial
Bundle-Version: 1.0.0.qualifier
Bundle-Vendor: RAYTHEON
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Require-Bundle: org.postgres;bundle-version="9.2.0",
com.raytheon.uf.common.geospatial;bundle-version="1.12.1174",
com.raytheon.uf.common.serialization;bundle-version="1.12.1174"

View file

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

View file

@ -1,307 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.edex.upgrade.satellitespatial;
import java.io.File;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
import org.geotools.coverage.grid.GridEnvelope2D;
import org.geotools.coverage.grid.GridGeometry2D;
import org.geotools.geometry.Envelope2D;
import org.geotools.referencing.CRS;
import org.geotools.referencing.crs.DefaultGeographicCRS;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
import com.raytheon.uf.common.geospatial.ISpatialObject;
import com.raytheon.uf.common.geospatial.MapUtil;
import com.raytheon.uf.common.geospatial.util.EnvelopeIntersection;
import com.vividsolutions.jts.geom.Geometry;
import com.vividsolutions.jts.io.WKBReader;
/**
* Java application to update the satellite spatial table. Converts old spatial
* format into new format using crs space
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Sep 30, 2013 2333 mschenke Initial creation
* Oct 4, 2016 DCS18655 K.Steinfeld Implement secure DB access using SSL keys/certificates;
* remove DB password implementation
*
*
* </pre>
*
* @author mschenke
* @version 1.0
*/
public class UpdateSatSpatial {
// SSL related constants
private static final String CERTIFICATE_FILE_EXTENSION = ".crt";
private static final String ROOT_CERTIFICATE_FILE_NAME = "root" + CERTIFICATE_FILE_EXTENSION;
private static final String PKCS8_KEY_FILE_EXTENSION = ".pk8";
private static final String SSL_FACTORY_CLASS = "org.postgresql.ssl.jdbc4.LibPQFactory";
//
private static final String SATELLITE_SPATIAL_TABLE = "satellite_spatial";
private static final String SATELLITE_SPATIAL_GID = "gid";
private static final String SATELLITE_SPATIAL_CRSWKT = "crswkt";
private static final String SATELLITE_SPATIAL_GEOM = "the_geom";
private static final String SATELLITE_SPATIAL_NX = "nx";
private static final String SATELLITE_SPATIAL_NY = "ny";
private static final String SATELLITE_SPATIAL_DX = "dx";
private static final String SATELLITE_SPATIAL_DY = "dy";
private static final String SATELLITE_SPATIAL_MINX = "minx";
private static final String SATELLITE_SPATIAL_MINY = "miny";
private static final String SATELLITE_SPATIAL_MINIMUMS = "minimums";
private static final String HOST_ARGUMENT = "-host";
private static final String DEFAULT_HOST = "localhost";
private static final String PORT_ARGUMENT = "-port";
private static final String DEFAULT_PORT = "5432";
private static final String DB_USER_ARGUMENT = "-user";
private static final String DEFAULT_DB_USER = "awips";
private static final String DATABASE_ARGUMENT = "-database";
private static final String DEFAULT_DATABASE = "metadata";
private static final String CERT_DIR_PATH_ARGUMENT = "-certDirPath";
private static final String DEFAULT_CERT_DIR_PATH = System.getProperty("user.home") + File.separator + ".postgresql";
private static final String SSL_MODE_ARGUMENT = "-sslMode";
private static final String DEFAULT_SSL_MODE = "verify-full";
private static final String JDBC_CONNECTION_FORMAT_STRING = "jdbc:postgresql://%s:%s/%s";
private static Map<String, Object> argumentMap = new HashMap<String, Object>();
private static class SpatialObject implements ISpatialObject {
private static final long serialVersionUID = 1L;
private final int nx;
private final int ny;
private final Geometry geometry;
private final CoordinateReferenceSystem crs;
public SpatialObject(int nx, int ny, Geometry geometry,
CoordinateReferenceSystem crs) {
this.nx = nx;
this.ny = ny;
this.geometry = geometry;
this.crs = crs;
}
@Override
public Geometry getGeometry() {
return geometry;
}
@Override
public CoordinateReferenceSystem getCrs() {
return crs;
}
@Override
public Integer getNx() {
return nx;
}
@Override
public Integer getNy() {
return ny;
}
}
public static void main(String[] args) throws Exception {
// Parse arguments
parseArguments(args);
Connection conn = openConnection();
Statement query = conn.createStatement();
ResultSet results = query.executeQuery("SELECT ("
+ SATELLITE_SPATIAL_MINX + " || '_' || "
+ SATELLITE_SPATIAL_MINY + ") as " + SATELLITE_SPATIAL_MINIMUMS
+ ", " + SATELLITE_SPATIAL_GID + ", "
+ SATELLITE_SPATIAL_CRSWKT + ", " + SATELLITE_SPATIAL_NX + ", "
+ SATELLITE_SPATIAL_NY + ", " + SATELLITE_SPATIAL_DX + ", "
+ SATELLITE_SPATIAL_DY + ", AsBinary(" + SATELLITE_SPATIAL_GEOM
+ ") as " + SATELLITE_SPATIAL_GEOM + " FROM "
+ SATELLITE_SPATIAL_TABLE);
String updateStatement = "UPDATE " + SATELLITE_SPATIAL_TABLE + " SET ("
+ SATELLITE_SPATIAL_MINX + ", " + SATELLITE_SPATIAL_MINY + ", "
+ SATELLITE_SPATIAL_DX + ", " + SATELLITE_SPATIAL_DY + ", "
+ SATELLITE_SPATIAL_GEOM
+ ") = (?, ?, ?, ?, GeomFromText(? , -1)) WHERE "
+ SATELLITE_SPATIAL_GID + " = ?";
while (results.next()) {
int gid = results.getInt(SATELLITE_SPATIAL_GID);
String mins = results.getString(SATELLITE_SPATIAL_MINIMUMS);
if (mins == null || mins.isEmpty()) {
System.out
.println("Upgrading satellite_spatial record: " + gid);
// No minimum values set, continue with upgrade
Geometry geometry = new WKBReader().read(results
.getBytes(SATELLITE_SPATIAL_GEOM));
CoordinateReferenceSystem crs = CRS.parseWKT(results
.getString(SATELLITE_SPATIAL_CRSWKT));
int nx = results.getInt(SATELLITE_SPATIAL_NX);
int ny = results.getInt(SATELLITE_SPATIAL_NY);
double dx = results.getDouble(SATELLITE_SPATIAL_DX);
double dy = results.getDouble(SATELLITE_SPATIAL_DY);
ISpatialObject object = new SpatialObject(nx, ny, geometry, crs);
GridGeometry2D resultGeom = MapUtil.getGridGeometry(object);
Envelope2D env = resultGeom.getEnvelope2D();
GridEnvelope2D grid = resultGeom.getGridRange2D();
double minX = env.getMinX();
double minY = env.getMinY();
if (dx == 0.0) {
dx = env.getWidth() / grid.width;
}
if (dy == 0.0) {
dy = env.getHeight() / grid.height;
}
Geometry newGeom = EnvelopeIntersection
.createEnvelopeIntersection(
resultGeom.getEnvelope(),
new Envelope2D(DefaultGeographicCRS.WGS84,
-180, -90, 360, 180), 1.0, 10, 10)
.getEnvelope();
PreparedStatement update = conn
.prepareStatement(updateStatement);
int index = 1;
update.setDouble(index++, minX);
update.setDouble(index++, minY);
update.setDouble(index++, dx);
update.setDouble(index++, dy);
update.setString(index++, newGeom.toText());
update.setInt(index++, gid);
update.execute();
} else {
System.err
.println("Skipping update of satellite_spatial record: "
+ gid);
}
}
conn.close();
}
private static Connection openConnection() throws SQLException, Exception {
String host = getString(HOST_ARGUMENT, DEFAULT_HOST);
String port = getString(PORT_ARGUMENT, DEFAULT_PORT);
String database = getString(DATABASE_ARGUMENT, DEFAULT_DATABASE);
String DBUser = getString(DB_USER_ARGUMENT, DEFAULT_DB_USER);
String certDir = getString(CERT_DIR_PATH_ARGUMENT, DEFAULT_CERT_DIR_PATH);
String sslMode = getString(SSL_MODE_ARGUMENT, DEFAULT_SSL_MODE);
DriverManager.registerDriver(new org.postgresql.Driver());
String connectionURL = String.format(JDBC_CONNECTION_FORMAT_STRING, host, port, database);
StringBuilder filePath = new StringBuilder(certDir);
filePath.append(File.separator);
// the following connection properties are needed for DB access with SSL certificates
Properties props = new Properties();
props.setProperty("sslmode", sslMode);
props.setProperty("sslfactory", SSL_FACTORY_CLASS);
props.setProperty("sslroot", filePath.toString() + ROOT_CERTIFICATE_FILE_NAME);
props.setProperty("sslcert", filePath.append(DBUser).toString() + CERTIFICATE_FILE_EXTENSION);
props.setProperty("sslkey", filePath.toString() + PKCS8_KEY_FILE_EXTENSION);
return DriverManager.getConnection(connectionURL, props);
}
private static void parseArguments(String[] args) {
for (int i = 0; i < args.length; ++i) {
String arg = args[i];
if (arg.startsWith("-")) {
// we have a key
if (args.length > (i + 1)
&& args[i + 1].startsWith("-") == false) {
argumentMap.put(arg, args[i + 1]);
++i;
} else {
argumentMap.put(arg, true);
}
}
}
}
private static String getString(String key, String defaultValue) {
Object val = argumentMap.get(key);
if (val != null) {
return val.toString();
}
return defaultValue;
}
}

View file

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

View file

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

View file

@ -1,8 +0,0 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Obslocation
Bundle-SymbolicName: com.raytheon.uf.edex.upgrade.obslocation
Bundle-Version: 1.14.0.qualifier
Bundle-Vendor: RAYTHEON
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Require-Bundle: org.postgres;bundle-version="9.2.4"

View file

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

View file

@ -1,327 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.edex.upgrade.obslocation;
import java.io.File;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
/**
* Reformats the dataURI to match the new precision scheme for obs locations.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jul 30, 2014 3410 bclement Initial creation
* Oct 4, 2016 DCS18655 K.Steinfeld Implement secure DB access using SSL keys/certificates;
* remove DB password implementation
*
* </pre>
*
* @author bclement
* @version 1.0
*/
public class DataUriDoubleToFloat {
// SSL related constants
private static final String CERTIFICATE_FILE_EXTENSION = ".crt";
private static final String ROOT_CERTIFICATE_FILE_NAME = "root" + CERTIFICATE_FILE_EXTENSION;
private static final String PKCS8_KEY_FILE_EXTENSION = ".pk8";
private static final String SSL_FACTORY_CLASS = "org.postgresql.ssl.jdbc4.LibPQFactory";
//
private static final String HOST_ARGUMENT = "-host";
private static final String DEFAULT_HOST = "localhost";
private static final String PORT_ARGUMENT = "-port";
private static final String DEFAULT_PORT = "5432";
private static final String DB_USER_ARGUMENT = "-user";
private static final String DEFAULT_DB_USER = "awips";
private static final String DATABASE_ARGUMENT = "-database";
private static final String DEFAULT_DATABASE = "metadata";
private static final String CERT_DIR_PATH_ARGUMENT = "-certDirPath";
private static final String DEFAULT_CERT_DIR_PATH = System.getProperty("user.home") + File.separator + ".postgresql";
private static final String SSL_MODE_ARGUMENT = "-sslMode";
private static final String DEFAULT_SSL_MODE = "verify-full";
private static final String JDBC_CONNECTION_FORMAT_STRING = "jdbc:postgresql://%s:%s/%s";
private static Map<String, Object> argumentMap = new HashMap<String, Object>();
/* map of table names to latitude 0-based index in data uri */
private static final Map<String, Integer> latitudeIndexMap = new HashMap<String, Integer>();
static {
latitudeIndexMap.put("tcg", 5);
latitudeIndexMap.put("acars", 4);
latitudeIndexMap.put("acarssounding", 3);
latitudeIndexMap.put("ldad_manual", 5);
latitudeIndexMap.put("obs", 5);
latitudeIndexMap.put("airep", 5);
latitudeIndexMap.put("bufrncwf", 3);
latitudeIndexMap.put("svrwx", 4);
latitudeIndexMap.put("ldadprofiler", 4);
latitudeIndexMap.put("bufrquikscat", 4);
latitudeIndexMap.put("sfcobs", 5);
latitudeIndexMap.put("bufrua", 6);
latitudeIndexMap.put("modelsounding", 4);
latitudeIndexMap.put("fssobs", 5);
latitudeIndexMap.put("lsr", 4);
latitudeIndexMap.put("ldadhydro", 5);
latitudeIndexMap.put("pirep", 5);
latitudeIndexMap.put("profiler", 4);
latitudeIndexMap.put("tcs", 4);
latitudeIndexMap.put("ncpafm", 5);
latitudeIndexMap.put("ncscd", 4);
latitudeIndexMap.put("ncuair", 4);
latitudeIndexMap.put("nctaf", 4);
}
private static final String LOC_DEF_COL = "locationdefined";
private static final String DATAURI_COL = "datauri";
private static final String LAT_COL = "latitude";
private static final String LON_COL = "longitude";
/**
* @return a newly created connection to the database
* @throws SQLException
*/
private static Connection openConnection() throws SQLException, Exception {
String host = getString(HOST_ARGUMENT, DEFAULT_HOST);
String port = getString(PORT_ARGUMENT, DEFAULT_PORT);
String database = getString(DATABASE_ARGUMENT, DEFAULT_DATABASE);
String DBUser = getString(DB_USER_ARGUMENT, DEFAULT_DB_USER);
String certDir = getString(CERT_DIR_PATH_ARGUMENT, DEFAULT_CERT_DIR_PATH);
String sslMode = getString(SSL_MODE_ARGUMENT, DEFAULT_SSL_MODE);
DriverManager.registerDriver(new org.postgresql.Driver());
String connectionURL = String.format(JDBC_CONNECTION_FORMAT_STRING, host, port, database);
StringBuilder filePath = new StringBuilder(certDir);
filePath.append(File.separator);
// the following connection properties are needed for DB access with SSL certificates
Properties props = new Properties();
props.setProperty("sslmode", sslMode);
props.setProperty("sslfactory", SSL_FACTORY_CLASS);
props.setProperty("sslroot", filePath.toString() + ROOT_CERTIFICATE_FILE_NAME);
props.setProperty("sslcert", filePath.append(DBUser).toString() + CERTIFICATE_FILE_EXTENSION);
props.setProperty("sslkey", filePath.toString() + PKCS8_KEY_FILE_EXTENSION);
return DriverManager.getConnection(connectionURL, props);
}
/**
* Parse command line arguments into the argumentMap
*
* @param args
*/
private static void parseArguments(String[] args) {
for (int i = 0; i < args.length; ++i) {
String arg = args[i];
if (arg.startsWith("-")) {
// we have a key
if (args.length > (i + 1)
&& args[i + 1].startsWith("-") == false) {
argumentMap.put(arg, args[i + 1]);
++i;
} else {
argumentMap.put(arg, true);
}
}
}
}
/**
* Get command line argument value
*
* @param key
* @param defaultValue
* @return
*/
private static String getString(String key, String defaultValue) {
Object val = argumentMap.get(key);
if (val != null) {
return val.toString();
}
return defaultValue;
}
/**
* Get all tables in the schema with the provided column name
*
* @param conn
* @param column
* @return
* @throws Exception
*/
private static Set<String> getTablesWithColumn(Connection conn,
String column) throws Exception {
Statement query = conn.createStatement();
ResultSet result = query
.executeQuery("select table_name from information_schema.columns where column_name = '" + column +"'");
Set<String> rval = new HashSet<>();
while (result.next()) {
rval.add(result.getString("table_name"));
}
return rval;
}
/**
* Create an updatable result set with id, latitude, longitude and datauri
* columns
*
* @param conn
* @param table
* @return
* @throws Exception
*/
private static ResultSet getLocationAndDataUri(Connection conn, String table)
throws Exception {
Statement query = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,
ResultSet.CONCUR_UPDATABLE);
String sql = String.format("select id, %s, %s, %s from %s", LAT_COL,
LON_COL, DATAURI_COL, table);
return query.executeQuery(sql);
}
/**
* Reformat each dataURI in table
*
* @param conn
* @param table
* @throws Exception
*/
private static void updateTable(Connection conn, String table)
throws Exception {
Integer latIndex = latitudeIndexMap.get(table);
if (latIndex == null) {
throw new Exception(
"Unable to determine index of latitude/longitude in dataURI");
}
/* plus 1 here to account for how String.split() handles leading slash */
latIndex += 1;
int lonIndex = latIndex + 1;
ResultSet res = getLocationAndDataUri(conn, table);
while (res.next()) {
String uri = res.getString(DATAURI_COL);
Float lat = res.getFloat(LAT_COL);
Float lon = res.getFloat(LON_COL);
if (uri == null) {
int id = res.getInt("id");
throw new Exception("Empty dataURI on row with id " + id);
}
String[] parts = uri.split("/");
if (parts.length < lonIndex + 1) {
throw new Exception("Expected dataURI with at least "
+ (lonIndex + 1) + " parts, got " + uri);
}
String latStr = parts[latIndex];
String lonStr = parts[lonIndex];
String newLatStr = String.valueOf(lat);
String newLonStr = String.valueOf(lon);
if (!latStr.equals(newLatStr) || !lonStr.equals(newLonStr)) {
parts[latIndex] = newLatStr;
parts[lonIndex] = newLonStr;
StringBuilder sb = new StringBuilder();
/*
* skip first element due to String.split() with leading slash
*/
for (int i = 1; i < parts.length; ++i) {
sb.append("/").append(parts[i]);
}
res.updateString(DATAURI_COL, sb.toString());
try {
res.updateRow();
} catch (SQLException e) {
if (e.getMessage().contains("duplicate key")) {
/*
* this can happen if data has been ingested twice with
* both the float locations and the double locations.
*/
res.deleteRow();
System.out.println("Encountered duplicate row after"
+ " reformatting, deleted row with dataURI "
+ uri + " to resolve conflict.");
} else {
throw e;
}
}
}
}
System.out.println("Updated table: " + table);
}
/**
* @param args
* @throws Exception
*/
public static void main(String[] args) throws Exception {
parseArguments(args);
Connection conn = openConnection();
Set<String> locationTables = getTablesWithColumn(conn, LOC_DEF_COL);
Set<String> dataUriTables = getTablesWithColumn(conn, DATAURI_COL);
/* only look at tables that both use obs location and have data uris */
locationTables.retainAll(dataUriTables);
for (String table : locationTables) {
try {
updateTable(conn, table);
} catch (Exception e) {
String msg = e.getLocalizedMessage();
System.err.println("ERROR: Unable to update table " + table
+ ": " + e.getLocalizedMessage());
if (msg == null || msg.isEmpty()) {
e.printStackTrace();
}
}
}
}
}

View file

@ -1,131 +0,0 @@
<!DOCTYPE project [
<!ENTITY substitute-targets SYSTEM "../substitute.xml">
]>
<project name="base.plugin.deploy" default="noaction">
<if>
<equals arg1="${installer}" arg2="true"/>
<then>
<condition property="BIN.DIR"
value="@dot"
else="bin">
<available file="${basedir}/@dot"/>
</condition>
</then>
<else>
<property name="BIN.DIR" value="bin"/>
</else>
</if>
<property name="SRC.DIR" value="src" />
<property name="RES.DIR" value="res" />
<property name="UTIL.DIR" value="utility" />
<condition property="util.deploy.ready" >
<and>
<isset property="util.dest.dir" />
<available file="${basedir}/${UTIL.DIR}" />
</and>
</condition>
<target name="noaction">
<echo message="this is a base for other ant files, do not call directly" />
</target>
<target name="deploy" depends="util.deploy,resources.deploy">
<echo message="Basedir: ${basedir}"/>
<echo message="bin dir: ${BIN.DIR}"/>
<!-- The build files that inherite from this base are designed to be
called from a master build file located in the build.edex directory.
To override and use locally, set the 'dest.dir' property on the command
line -->
<basename property="component.name" file="${basedir}"/>
<fail message="'dest.dir' property not set" unless="dest.dir" />
<echo message="Jarring ${component.name}" />
<echo message="Destination: ${dest.dir}" />
<!--replace the version in the manifest file so it includes the timestamp instead of "qualifier" -->
<antcall target="update.manifest"/>
<mkdir dir="${dest.dir}" />
<if>
<available file="${basedir}/${BIN.DIR}" type="dir" />
<then>
<jar destfile="${dest.dir}/${component.name}.jar" manifest="${basedir}/META-INF/MANIFEST.MF">
<fileset dir="${basedir}/${BIN.DIR}" includes="**/*.class" />
<fileset dir="${basedir}" includes="${RES.DIR}/**/*" />
<fileset dir="${basedir}" includes="META-INF/**/*" />
<fileset dir="${basedir}" includes="*.py" />
</jar>
</then>
<else>
<jar destfile="${dest.dir}/${component.name}.jar" manifest="${basedir}/META-INF/MANIFEST.MF">
<fileset dir="${basedir}" includes="${RES.DIR}/**/*" />
<fileset dir="${basedir}" includes="META-INF/**/*" />
<fileset dir="${basedir}" includes="*.py" />
</jar>
</else>
</if>
</target>
<target name="update.manifest" if="installer">
<tstamp>
<format property="build.time.stamp" pattern="yyyyMMddhhmm"/>
</tstamp>
<filterset id="bundle.version.fs" begintoken="Bundle-Version" endtoken="qualifier">
<filter token=": 1.12.1150." value="Bundle-Version: 1.12.1152.${build.time.stamp}"/>
</filterset>
<!-- file names to use for the substitution -->
<property name="src.manifest.file" value="${basedir}/META-INF/MANIFEST.MF"/>
<property name="tmp.manifest.file" value="${basedir}/META-INF/MANIFEST.MF-TMP"/>
<!-- move the file to make the substitution -->
<move file="${src.manifest.file}" tofile="${tmp.manifest.file}" overwrite="true">
<filterset refid="bundle.version.fs"/>
</move>
<!-- move it back -->
<move file="${tmp.manifest.file}" tofile="${src.manifest.file}" overwrite="true"/>
<!-- delete the temporaty file -->
<delete file="${tmp.manifest.file}"/>
</target>
<!-- inport a utility substitution configuration if one exists -->
<import file="${basedir}/component-substitute.xml" optional="true"/>
<target name="utility-substitute" if="enable-component-substitute">
<antcall target="component-substitute.utility-substitute"></antcall>
</target>
<target name="util.deploy" if="util.deploy.ready" description="Deploys the component's Utility Service Configurations">
<echo message="deploying utility files to ${util.dest.dir}" />
<copy todir="${util.dest.dir}" overwrite="true" >
<fileset dir="${basedir}/${UTIL.DIR}"/>
</copy>
<antcall target="utility-substitute"></antcall>
</target>
<target name="resources.deploy" description="Deploy the component's resource files">
<if>
<available file="${basedir}/resources" type="dir" />
<then>
<echo message="deploying resource files to ${resources.dest.dir}" />
<mkdir dir="${resources.dest.dir}" />
<copy todir="${resources.dest.dir}" overwrite="true">
<fileset dir="${basedir}/resources" />
</copy>
</then>
</if>
</target>
&substitute-targets;
</project>

View file

@ -1,66 +0,0 @@
<project name="build.javadoc" default="javadocBoth" basedir=".">
<target name="javadocBoth" description="Generate JavaDoc">
<property name="projects.dir" location=".." />
<!-- Class path and jars -->
<path id="base.class.path">
<!-- EDEX static libraries -->
<fileset dir="${basedir}/lib">
<include name="**/*.jar/" />
</fileset>
<fileset dir="${projects.dir}" includesfile="${basedir}/tmp/includes/cots.includes" />
<fileset dir="${projects.dir}" includesfile="${basedir}/tmp/includes/core.includes" />
<fileset dir="${projects.dir}" includesfile="${basedir}/tmp/includes/plugins.includes" />
<!-- include our annotations jars -->
<fileset dir="${basedir}/tmp/uengine">
<include name="**/*.jar/" />
</fileset>
<!-- ECLIPSE RCP libraries -->
<fileset dir="${projects.dir}/eclipse/plugins">
<include name="**/*.jar/" />
</fileset>
</path>
<!-- Package locations for Javadoc -->
<path id="javadoc.packages.path">
<!-- EDEX Source -->
<dirset dir="${projects.dir}">
<include name="com.raytheon.edex*/src" />
</dirset>
<dirset dir="${projects.dir}">
<include name="com.raytheon.uf*/src" />
</dirset>
<!-- CAVE Source -->
<dirset dir="${projects.dir}">
<include name="com.raytheon.viz*/src" />
</dirset>
<dirset dir="${projects.dir}">
<include name="com.raytheon.uf.viz*/src" />
</dirset>
</path>
<!-- Javadoc destination folder and source reference -->
<property name="javadoc.dest.dir" value="${basedir}/../docs.edex" />
<property name="javadoc.src.path" refid="javadoc.packages.path" />
<!-- javadoc task - using offline package-list because of proxy-->
<javadoc overview="${projects.dir}/docs.edex/overview.html" sourcepath="${javadoc.src.path}" classpathref="base.class.path" failonerror="true" packagenames="com.raytheon.*" destdir="${javadoc.dest.dir}" author="true" use="true" maxmemory="1024m" verbose="false" package="true" useexternalfile="yes">
<link offline="true" href="http://java.sun.com/j2se/1.5.0/docs/api/" packagelistloc="${basedir}/opt/javadoc/jdk/1.5/" />
<link offline="true" href="http://mule.codehaus.org/docs/apidocs" packagelistloc="${basedir}/opt/javadoc/mule/1.3/" />
<link offline="true" href="http://lucene.apache.org/java/docs/api/" packagelistloc="${basedir}/opt/javadoc/lucene/2.0/" />
</javadoc>
</target>
</project>

View file

@ -1,6 +0,0 @@
install.dir=/usr/share/tomcat5/.hudson/jobs/AWIPSNightly/workspace/trunk/edex/Installer/temp/build/jar/awips/edex
projects.dir=${basedir}/tmp/plugins
pde.build=true
feature=../com.raytheon.edex.feature.uframe/feature.xml

View file

@ -1,4 +0,0 @@
esbDir=${install.dir}/../edex
feature=../com.raytheon.edex.feature.uframe/feature.xml
working.dir=edex/tmp/plugins
deploy.data=true

View file

@ -1,183 +0,0 @@
<!--
This_software_was_developed_and_/_or_modified_by_Raytheon_Company,
pursuant_to_Contract_DG133W-05-CQ-1067_with_the_US_Government.
U.S._EXPORT_CONTROLLED_TECHNICAL_DATA
This_software_product_contains_export-restricted_data_whose
export/transfer/disclosure_is_restricted_by_U.S._law._Dissemination
to_non-U.S._persons_whether_in_the_United_States_or_abroad_requires
an_export_license_or_other_authorization.
Contractor_Name:________Raytheon_Company
Contractor_Address:_____6825_Pine_Street,_Suite_340
________________________Mail_Stop_B8
________________________Omaha,_NE_68106
________________________402.291.0100
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
further_licensing_information.
-->
<!--
* Defines substitutions that may be performed during the deploy process.
*
* Current substitutions supported based on the installer flag:
* Macro flag set flag not set
* =========== ================= =============================
* DB_ADDR $databaseAddress localhost
* DB_PORT $databasePort 5432
* PY_HOME $pythonHome $HOME/awips
*
* These substitutions are enabled by nesting the following in a <copy> tag
* <filterset refid="installer.filter.set"/>
*
* To set the substitution flag, add "-Dinstaller=true" to the build command
* line.
*
* SOFTWARE HISTORY:
* Date PTR# INIT DESCRIPTION
* 06May2008 1080 MW Fegan Initial Creation.
-->
<!-- Set the database host name for the copy filter -->
<property name="def.db.host" value="localhost" />
<condition property="db.host" value="$databaseAddress" else="${def.db.host}">
<isset property="installer"/>
</condition>
<!-- Set the database port for the copy filter -->
<property name="def.db.port" value="5432" />
<condition property="db.port" value="$databasePort" else="${def.db.port}">
<isset property="installer"/>
</condition>
<!-- Set the database port for the copy filter -
percent version for installer shell scripts variable replacement -->
<property name="def.db.port.p" value="5432" />
<condition property="db.port.p" value="%databasePort" else="${def.db.port}">
<isset property="installer"/>
</condition>
<!-- set the Python home location for the copy filter -->
<property name="def.py.home" value="$awips_home/python" />
<condition property="py.home" value="%{PYTHON_INSTALL}%" else="${def.py.home}">
<isset property="installer"/>
</condition>
<!-- set the PSQL home location for the copy filter -->
<property name="def.psql.home" value="$awips_home/psql"/>
<condition property="psql.home" value="%{PSQL_INSTALL}%" else="${def.psql.home}">
<isset property="installer"/>
</condition>
<!-- set the Java home location for the copy filter -->
<property name="def.java.home" value="$awips_home/java" />
<condition property="sub.java.home" value="%{JAVA_INSTALL}%" else="${def.java.home}">
<isset property="installer"/>
</condition>
<!-- Set the data archive location for the copy filter -->
<property name="def.data.arch.loc" value="/tmp/sbn" />
<condition property="data.arch.loc" value="%archiveLocation" else="${def.data.arch.loc}">
<isset property="installer"/>
</condition>
<!-- Set the database machine name for the copy filter -->
<property name="def.db.machine.name" value="localhost" />
<condition property="db.machine.name" value="$dbMachineName" else="${def.db.machine.name}">
<isset property="installer"/>
</condition>
<!-- Set the database machine name for the copy filter -
percent version for installer shell scripts variable replacement -->
<property name="def.db.machine.name.p" value="localhost" />
<condition property="db.machine.name.p" value="%dbMachineName" else="${def.db.machine.name}">
<isset property="installer"/>
</condition>
<!-- Set the edex master server name for the copy filter -->
<property name="def.edex.server" value="localhost" />
<condition property="edex.server" value="$edexServer" else="${def.edex.server}">
<isset property="installer"/>
</condition>
<!-- Set the edex master server name for the copy filter
percent version for installer shell scripts variable replacement -->
<property name="def.edex.server.p" value="localhost" />
<condition property="edex.server.p" value="%edexServer" else="${def.edex.server}">
<isset property="installer"/>
</condition>
<!-- Set the mcast_port for the copy filter -->
<condition property="mcast.port" value="%cacheMcastPort" else="${mcast.port}">
<isset property="installer"/>
</condition>
<!-- Set the damCatalog database name -->
<property name="def.dc.db.name" value="dc_ob7oax"/>
<condition property="dc.db.name" value="%dcDbName" else="${def.dc.db.name}">
<isset property="installer"/>
</condition>
<!-- Set the fxatext database name -->
<property name="def.fxa.db.name" value="fxatext"/>
<condition property="fxa.db.name" value="%fxaDbName" else="${def.fxa.db.name}">
<isset property="installer"/>
</condition>
<!-- Set the hmdb database name -->
<property name="def.hm.db.name" value="hmdb"/>
<condition property="hm.db.name" value="%hmDbName" else="${def.hm.db.name}">
<isset property="installer"/>
</condition>
<!-- Set the ihfs database -->
<property name="def.ih.db.name" value="hd_ob92oax"/>
<condition property="ih.db.name" value="%ihDbName" else="${def.ih.db.name}">
<isset property="installer"/>
</condition>
<!-- Set the edex localization site -->
<property name="def.site.identifier" value="OAX"/>
<condition property="site.identifier" value="%siteIdentifier" else="${def.site.identifier}">
<isset property="installer"/>
</condition>
<!-- Set the installation root -->
<!--
Note: The $ is used for replacement in non-script files and the % is used
for replacement in script files.
-->
<property name="def.install.path" value="$awips_home"/>
<condition property="install.path" value="%INSTALL_PATH" else="${def.install.path}">
<isset property="installer"/>
</condition>
<property name="def.install.path.d" value="$awips_home"/>
<condition property="install.path.d" value="$INSTALL_PATH" else="${def.install.path.d}">
<isset property="installer"/>
</condition>
<!-- Create the copy filter -->
<!-- filter set -->
<filterset id="installer.filter.set">
<filter token="DB_ADDR" value="${db.host}"/>
<filter token="DB_PORT" value="${db.port}"/>
<filter token="DB_PORT_P" value="${db.port.p}"/>
<filter token="MCAST_PORT" value="${mcast.port}"/>
<filter token="PY_HOME" value="${py.home}" />
<filter token="JAVA_HOME" value="${sub.java.home}"/>
<filter token="PSQL_HOME" value="${psql.home}"/>
<filter token="DB_MACHINE" value="${db.machine.name}" />
<filter token="DB_MACHINE_P" value="${db.machine.name.p}" />
<filter token="EDEX_SERVER" value="${edex.server}" />
<filter token="EDEX_SERVER_P" value="${edex.server.p}" />
<filter token="DATA_ARCH_LOC" value="${data.arch.loc}"/>
<filter token="DC_DB_NAME" value="${dc.db.name}" />
<filter token="FXA_DB_NAME" value="${fxa.db.name}" />
<filter token="HM_DB_NAME" value="${hm.db.name}" />
<filter token="IH_DB_NAME" value="${ih.db.name}" />
<filter token="SITE_IDENTIFIER" value="${site.identifier}" />
<filter token="INSTALL_PATH" value="${install.path}" />
<filter token="INSTALL_PATH_D" value="${install.path.d}" />
</filterset>

View file

@ -1,3 +0,0 @@
com.raytheon.edex.plugin.gfe.isc.IscSendRecord
com.raytheon.edex.plugin.gfe.smartinit.SmartInitRecord
com.raytheon.edex.plugin.gfe.smartinit.SmartInitRecordPK

View file

@ -1,30 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.edex.plugin.gfe;
import com.raytheon.edex.db.mapping.EnumUserType;
import com.raytheon.uf.common.dataplugin.gfe.db.objects.GridParmInfo.GridType;
/** Mapping class for persistence of GridType enum */
public class GridTypeUserType extends EnumUserType<GridType> {
public GridTypeUserType() {
super(GridType.class);
}
}

View file

@ -1,223 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.edex.plugin.gfe.config;
import java.io.File;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.raytheon.edex.plugin.gfe.exception.GfeConfigurationException;
import com.raytheon.edex.plugin.gfe.exception.GfeMissingConfigurationException;
import com.raytheon.uf.common.dataplugin.gfe.discrete.DiscreteDefinition;
import com.raytheon.uf.common.dataplugin.gfe.discrete.DiscreteKey;
import com.raytheon.uf.common.dataplugin.gfe.python.GfePyIncludeUtil;
import com.raytheon.uf.common.dataplugin.gfe.weather.WeatherSubKey;
import com.raytheon.uf.common.dataplugin.gfe.weather.WxDefinition;
import com.raytheon.uf.common.localization.IPathManager;
import com.raytheon.uf.common.localization.LocalizationContext;
import com.raytheon.uf.common.localization.LocalizationUtil;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.python.PyUtil;
import com.raytheon.uf.common.python.PythonEval;
/**
* Manages the serverConfigs of active sites
*
* <pre>
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jul 9, 2009 njensen Initial creation
* Dec 11, 2012 14360 ryu Throw specific exception for missing configuration.
* Feb 20, 2014 #2824 randerso Fixed import of localVTECPartners to use siteID
* Added common python path for LogStream
* Jul 09, 2014 #3146 randerso Improved exception handling
* Dec 15, 2015 #5166 kbisanz Update logging to use SLF4J
* Jul 13, 2016 #5747 dgilling Move edex_static to common_static.
* Aug 08, 2016 #5747 randerso Moved additional files to common static.
* Eliminated wrapper.py
*
* </pre>
*
* @author njensen
*/
public class IFPServerConfigManager {
private static final Logger logger = LoggerFactory
.getLogger(IFPServerConfigManager.class);
private static final String CONFIG_PATH = LocalizationUtil.join("gfe",
"config");
private static Map<String, IFPServerConfig> configMap = new HashMap<>();
private static Set<String> activeSites = new HashSet<>();
/**
* Returns the sites that have active configurations
*
* @return
*/
protected static Set<String> getActiveSites() {
return activeSites;
}
/**
* Gets the server configuration for a particular site
*
* @param siteID
* the site
* @return the site's configuration
* @throws GfeConfigurationException
* if the site is not active
*/
public static IFPServerConfig getServerConfig(String siteID)
throws GfeConfigurationException {
IFPServerConfig config = configMap.get(siteID);
if (config == null) {
throw new GfeConfigurationException("Site " + siteID
+ " has no active GFE configuration.");
}
return config;
}
/**
* Initializes a site's serverConfig by reading in the site's localConfig
*
* @param siteID
* the site
* @return the site's configuration
* @throws GfeConfigurationException
*/
protected static IFPServerConfig initializeSite(String siteID)
throws GfeConfigurationException {
IFPServerConfig siteConfig = null;
siteConfig = initializeConfig(siteID);
if (siteConfig != null) {
configMap.put(siteID, siteConfig);
}
WxDefinition wxDef = siteConfig.getWxDefinition();
WeatherSubKey.setWxDefinition(siteID, wxDef);
DiscreteDefinition dxDef = siteConfig.getDiscreteDefinition();
DiscreteKey.setDiscreteDefinition(siteID, dxDef);
return siteConfig;
}
/**
* Add a site to the active sites list
*
* @param siteID
* the site to be added
*/
public static void addActiveSite(String siteID) {
activeSites.add(siteID);
}
/**
* Initialize an IFPServerConfig object for a site
*
* @param siteID
* the desired site
* @return the IFPServerConfig object
* @throws GfeConfigurationException
*/
public static IFPServerConfig initializeConfig(String siteID)
throws GfeConfigurationException {
String baseDir = "";
String siteDir = "";
IFPServerConfig siteConfig = null;
IPathManager pathMgr = PathManagerFactory.getPathManager();
LocalizationContext baseCtx = pathMgr.getContext(
LocalizationContext.LocalizationType.COMMON_STATIC,
LocalizationContext.LocalizationLevel.BASE);
LocalizationContext siteCtx = pathMgr.getContextForSite(
LocalizationContext.LocalizationType.COMMON_STATIC, siteID);
baseDir = pathMgr.getFile(baseCtx, CONFIG_PATH).getPath();
File siteDirFile = pathMgr.getFile(siteCtx, CONFIG_PATH);
if (siteDirFile.exists()) {
File[] siteFiles = siteDirFile.listFiles();
boolean siteConfigFound = false;
for (File f : siteFiles) {
if (f.getName().equals("siteConfig.py")) {
siteConfigFound = true;
break;
}
}
if (!siteConfigFound) {
throw new GfeMissingConfigurationException(
"No siteConfig.py file found for " + siteID);
}
} else {
throw new GfeMissingConfigurationException(
"No site config directory found for " + siteID);
}
siteDir = siteDirFile.getPath();
String gfeCommonPath = GfePyIncludeUtil.getCommonGfeIncludePath();
String vtecPath = GfePyIncludeUtil.getVtecIncludePath(siteID);
try (PythonEval py = new PythonEval(PyUtil.buildJepIncludePath(siteDir,
baseDir, gfeCommonPath, vtecPath),
IFPServerConfig.class.getClassLoader())) {
py.eval("from serverConfig import *");
SimpleServerConfig simpleConfig = (SimpleServerConfig) py.execute(
"getSimpleConfig", null);
siteConfig = new IFPServerConfig(simpleConfig);
} catch (Throwable e) {
throw new GfeConfigurationException(
"Exception occurred while processing serverConfig for site "
+ siteID, e);
}
return siteConfig;
}
/**
* Removes a site's configuration from the set of active configurations
*
* @param siteID
*/
protected static void removeSite(String siteID) {
if (configMap.containsKey(siteID)) {
configMap.remove(siteID);
activeSites.remove(siteID);
} else {
logger.debug("Can't deactivate inactive site " + siteID);
}
}
protected static void removeActiveSite(String siteID) {
activeSites.remove(siteID);
}
}

View file

@ -1,206 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.edex.plugin.gfe.reference;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import com.raytheon.edex.plugin.gfe.config.IFPServerConfig;
import com.raytheon.uf.common.dataplugin.gfe.db.objects.GridLocation;
import com.raytheon.uf.common.dataplugin.gfe.reference.ReferenceData;
import com.raytheon.uf.common.dataplugin.gfe.reference.ReferenceID;
import com.raytheon.uf.common.dataplugin.gfe.server.message.ServerResponse;
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.LocalizationUtil;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.localization.region.RegionLookup;
import com.raytheon.uf.common.serialization.SingleTypeJAXBManager;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.util.FileUtil;
/**
* Manages reference sets for the ifpServer.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jul 24, 2012 dgilling Initial creation
* Aug 07, 2013 1561 njensen Use pm.listFiles() instead of pm.listStaticFiles()
* Sep 30, 2013 2361 njensen Use JAXBManager for XML
* Sep 08, 2104 3592 randerso Changed to use new pm listStaticFiles()
* Feb 19, 2015 4125 rjpeter Fix jaxb performance issue
* Apr 10, 2015 4383 dgilling Fix getData so it searches correct localization
* directories for secondary sites.
* Jan 27, 2016 5237 tgurney Remove deprecated LocalizationFile
* method call
*
* </pre>
*
* @author dgilling
* @version 1.0
*/
public class ReferenceMgr {
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(ReferenceMgr.class);
private static final String EDIT_AREAS_DIR = FileUtil.join("gfe",
"editAreas");
private final IPathManager pathMgr;
private final GridLocation dbGridLocation;
public ReferenceMgr(final IFPServerConfig config) {
this.pathMgr = PathManagerFactory.getPathManager();
this.dbGridLocation = config.dbDomain();
}
/**
* Returns the inventory of data on disk.
*
* @return <code>ReferenceID</code>s for every defined edit area on disk.
*/
public ServerResponse<List<ReferenceID>> getInventory() {
List<ReferenceID> refIDs = new ArrayList<ReferenceID>();
LocalizationFile[] contents = pathMgr.listStaticFiles(
getSiteSearchContexts(), EDIT_AREAS_DIR,
new String[] { ".xml" }, false, true);
if (contents != null) {
for (LocalizationFile lf : contents) {
String s = LocalizationUtil.extractName(lf.getPath());
String area = s.replace(".xml", "");
refIDs.add(new ReferenceID(area, lf.isProtected(), lf
.getContext().getLocalizationLevel()));
}
}
statusHandler.debug("ReferenceID inventory: " + refIDs);
ServerResponse<List<ReferenceID>> sr = new ServerResponse<List<ReferenceID>>();
sr.setPayload(refIDs);
return sr;
}
/**
* Retrieves the specified <code>ReferenceData</code>, which is identified
* by <code>ReferenceID</code>s, and returns it to the caller.
*
* @param ids
* <code>ReferenceID</code>s of the data to retrieve.
* @return The requested <code>ReferenceData</code>.
*/
public ServerResponse<List<ReferenceData>> getData(
final List<ReferenceID> ids) {
ServerResponse<List<ReferenceData>> sr = new ServerResponse<List<ReferenceData>>();
List<ReferenceData> data = new ArrayList<ReferenceData>();
SingleTypeJAXBManager<ReferenceData> jaxbManager = ReferenceData
.getJAXBManager();
// process each ReferenceID requested
for (ReferenceID id : ids) {
String path = FileUtil.join(EDIT_AREAS_DIR, id.getName() + ".xml");
LocalizationFile lf = pathMgr.getStaticLocalizationFile(
getSiteSearchContexts(), path);
// does it exist?
if (lf == null) {
sr.addMessage("Unable to find reference data [" + id + "]");
data = Collections.emptyList();
sr.setPayload(data);
return sr;
}
// open and read the file
ReferenceData refData = null;
try {
refData = jaxbManager.unmarshalFromXmlFile(lf.getFile()
.getPath());
} catch (Exception e) {
sr.addMessage("Unable to read reference data [" + id + "]");
data = Collections.emptyList();
sr.setPayload(data);
return sr;
}
// assemble the actual ReferenceID, with the protect and access
// flags
ReferenceID referenceID = new ReferenceID(id.getName(),
lf.isProtected(), lf.getContext().getLocalizationLevel());
// assemble the ReferenceData
refData.setGloc(dbGridLocation);
refData.setId(referenceID);
data.add(refData);
}
sr.setPayload(data);
return sr;
}
@Override
public String toString() {
return "ReferenceMgr [" + dbGridLocation.getSiteId() + "]";
}
private LocalizationContext[] getSiteSearchContexts() {
String siteId = dbGridLocation.getSiteId();
/*
* regionName could be returned as null, and if so, we will not add it
* to the final list of LocalizationContexts.
*/
String regionName = RegionLookup.getWfoRegion(siteId);
LocalizationContext[] searchContexts = pathMgr
.getLocalSearchHierarchy(LocalizationType.COMMON_STATIC);
List<LocalizationContext> fixedContexts = new ArrayList<>(
searchContexts.length);
for (LocalizationContext ctx : searchContexts) {
if (((ctx.getLocalizationLevel().equals(LocalizationLevel.SITE)) || (ctx
.getLocalizationLevel()
.equals(LocalizationLevel.CONFIGURED)))
&& (!ctx.getContextName().equals(siteId))) {
ctx.setContextName(siteId);
} else if (ctx.getLocalizationLevel().equals(
LocalizationLevel.REGION)) {
if (regionName == null) {
continue;
} else if (!ctx.getContextName().equals(regionName)) {
ctx.setContextName(regionName);
}
}
fixedContexts.add(ctx);
}
return fixedContexts.toArray(new LocalizationContext[fixedContexts
.size()]);
}
}

View file

@ -1,915 +0,0 @@
##
# This software was developed and / or modified by Raytheon Company,
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
#
# U.S. EXPORT CONTROLLED TECHNICAL DATA
# This software product contains export-restricted data whose
# export/transfer/disclosure is restricted by U.S. law. Dissemination
# to non-U.S. persons whether in the United States or abroad requires
# an export license or other authorization.
#
# Contractor Name: Raytheon Company
# Contractor Address: 6825 Pine Street, Suite 340
# Mail Stop B8
# Omaha, NE 68106
# 402.291.0100
#
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
# further licensing information.
##
#Contains information about products, regions, etc. for each site
#in the country.
#region= two-letter regional identifier, mainly used for installation of
# text product templates
SiteInfo= {
'ABQ': {
'region': 'SR',
'fullStationID': 'KABQ',
'wfoCityState': 'ALBUQUERQUE NM',
'wfoCity': 'ALBUQUERQUE',
'state': 'NEW MEXICO',
},
'ABR': {
'region': 'CR',
'fullStationID': 'KABR',
'wfoCityState': 'ABERDEEN SD',
'wfoCity': 'ABERDEEN',
'state': 'SOUTH DAKOTA',
},
'AER': {
'region': 'AR',
'fullStationID': 'PAFC',
'wfoCityState': 'ANCHORAGE AK',
'wfoCity': 'ANCHORAGE',
'state': 'ALASKA',
},
'AFG': {
'region': 'AR',
'fullStationID': 'PAFG',
'wfoCityState': 'FAIRBANKS AK',
'wfoCity': 'FAIRBANKS',
'state': 'ALASKA',
},
'AJK': {
'region': 'AR',
'fullStationID': 'PAJK',
'wfoCityState': 'JUNEAU AK',
'wfoCity': 'JUNEAU',
'state': 'ALASKA',
},
'AKQ': {
'region': 'ER',
'fullStationID': 'KAKQ',
'wfoCityState': 'WAKEFIELD VA',
'wfoCity': 'WAKEFIELD',
'state': 'VIRGINIA',
},
'ALU': {
'region': 'AR',
'fullStationID': 'PAFC',
'wfoCityState': 'ANCHORAGE AK',
'wfoCity': 'ANCHORAGE',
'state': 'ALASKA',
},
'ALY': {
'region': 'ER',
'fullStationID': 'KALY',
'wfoCityState': 'ALBANY NY',
'wfoCity': 'ALBANY',
'state': 'NEW YORK',
},
'AMA': {
'region': 'SR',
'fullStationID': 'KAMA',
'wfoCityState': 'AMARILLO TX',
'wfoCity': 'AMARILLO',
'state': 'TEXAS',
},
'APX': {
'region': 'CR',
'fullStationID': 'KAPX',
'wfoCityState': 'GAYLORD MI',
'wfoCity': 'GAYLORD',
'state': 'MICHIGAN',
},
'ARX': {
'region': 'CR',
'fullStationID': 'KARX',
'wfoCityState': 'LA CROSSE WI',
'wfoCity': 'LA CROSSE',
'state': 'WISCONSIN',
},
'BGM': {
'region': 'ER',
'fullStationID': 'KBGM',
'wfoCityState': 'BINGHAMTON NY',
'wfoCity': 'BINGHAMTON',
'state': 'NEW YORK',
},
'BIS': {
'region': 'CR',
'fullStationID': 'KBIS',
'wfoCityState': 'BISMARCK ND',
'wfoCity': 'BISMARCK',
'state': 'NORTH DAKOTA',
},
'BMX': {
'region': 'SR',
'fullStationID': 'KBMX',
'wfoCityState': 'BIRMINGHAM AL',
'wfoCity': 'BIRMINGHAM',
'state': 'ALABAMA',
},
'BOI': {
'region': 'WR',
'fullStationID': 'KBOI',
'wfoCityState': 'BOISE ID',
'wfoCity': 'BOISE',
'state': 'IDAHO',
},
'BOU': {
'region': 'CR',
'fullStationID': 'KBOU',
'wfoCityState': 'DENVER CO',
'wfoCity': 'DENVER',
'state': 'COLORADO',
},
'BOX': {
'region': 'ER',
'fullStationID': 'KBOX',
'wfoCityState': 'TAUNTON MA',
'wfoCity': 'TAUNTON',
'state': 'MASSACHUSETTS',
},
'BRO': {
'region': 'SR',
'fullStationID': 'KBRO',
'wfoCityState': 'BROWNSVILLE TX',
'wfoCity': 'BROWNSVILLE',
'state': 'TEXAS',
},
'BTV': {
'region': 'ER',
'fullStationID': 'KBTV',
'wfoCityState': 'BURLINGTON VT',
'wfoCity': 'BURLINGTON',
'state': 'VERMONT',
},
'BUF': {
'region': 'ER',
'fullStationID': 'KBUF',
'wfoCityState': 'BUFFALO NY',
'wfoCity': 'BUFFALO',
'state': 'NEW YORK',
},
'BYZ': {
'region': 'WR',
'fullStationID': 'KBYZ',
'wfoCityState': 'BILLINGS MT',
'wfoCity': 'BILLINGS',
'state': 'MONTANA',
},
'CAE': {
'region': 'ER',
'fullStationID': 'KCAE',
'wfoCityState': 'COLUMBIA SC',
'wfoCity': 'COLUMBIA',
'state': 'SOUTH CAROLINA',
},
'CAR': {
'region': 'ER',
'fullStationID': 'KCAR',
'wfoCityState': 'CARIBOU ME',
'wfoCity': 'CARIBOU',
'state': 'MAINE',
},
'CHS': {
'region': 'ER',
'fullStationID': 'KCHS',
'wfoCityState': 'CHARLESTON SC',
'wfoCity': 'CHARLESTON',
'state': 'SOUTH CAROLINA',
},
'CLE': {
'region': 'ER',
'fullStationID': 'KCLE',
'wfoCityState': 'CLEVELAND OH',
'wfoCity': 'CLEVELAND',
'state': 'OHIO',
},
'CRP': {
'region': 'SR',
'fullStationID': 'KCRP',
'wfoCityState': 'CORPUS CHRISTI TX',
'wfoCity': 'CORPUS CHRISTI',
'state': 'TEXAS',
},
'CTP': {
'region': 'ER',
'fullStationID': 'KCTP',
'wfoCityState': 'STATE COLLEGE PA',
'wfoCity': 'STATE COLLEGE',
'state': 'PENNSYLVANIA',
},
'CYS': {
'region': 'CR',
'fullStationID': 'KCYS',
'wfoCityState': 'CHEYENNE WY',
'wfoCity': 'CHEYENNE',
'state': 'WYOMING',
},
'DDC': {
'region': 'CR',
'fullStationID': 'KDDC',
'wfoCityState': 'DODGE CITY KS',
'wfoCity': 'DODGE CITY',
'state': 'KANSAS',
},
'DLH': {
'region': 'CR',
'fullStationID': 'KDLH',
'wfoCityState': 'DULUTH MN',
'wfoCity': 'DULUTH',
'state': 'MINNESOTA',
},
'DMX': {
'region': 'CR',
'fullStationID': 'KDMX',
'wfoCityState': 'DES MOINES IA',
'wfoCity': 'DES MOINES',
'state': 'IOWA',
},
'DTX': {
'region': 'CR',
'fullStationID': 'KDTX',
'wfoCityState': 'DETROIT/PONTIAC MI',
'wfoCity': 'DETROIT/PONTIAC',
'state': 'MICHIGAN',
},
'DVN': {
'region': 'CR',
'fullStationID': 'KDVN',
'wfoCityState': 'QUAD CITIES IA IL',
'wfoCity': 'QUAD CITIES',
'state': 'ILLINOIS',
},
'EAX': {
'region': 'CR',
'fullStationID': 'KEAX',
'wfoCityState': 'KANSAS CITY/PLEASANT HILL MO',
'wfoCity': 'KANSAS CITY/PLEASANT HILL',
'state': 'MISSOURI',
},
'EKA': {
'region': 'WR',
'fullStationID': 'KEKA',
'wfoCityState': 'EUREKA CA',
'wfoCity': 'EUREKA',
'state': 'CALIFORNIA',
},
'EPZ': {
'region': 'SR',
'fullStationID': 'KEPZ',
'wfoCityState': 'EL PASO TX/SANTA TERESA NM',
'wfoCity': 'EL PASO TX/SANTA TERESA',
'state': 'NEW MEXICO',
},
'EWX': {
'region': 'SR',
'fullStationID': 'KEWX',
'wfoCityState': 'AUSTIN/SAN ANTONIO TX',
'wfoCity': 'AUSTIN/SAN ANTONIO',
'state': 'TEXAS',
},
'FFC': {
'region': 'SR',
'fullStationID': 'KFFC',
'wfoCityState': 'PEACHTREE CITY GA',
'wfoCity': 'PEACHTREE CITY',
'state': 'GEORGIA',
},
'FGF': {
'region': 'CR',
'fullStationID': 'KFGF',
'wfoCityState': 'GRAND FORKS ND',
'wfoCity': 'GRAND FORKS',
'state': 'NORTH DAKOTA',
},
'FGZ': {
'region': 'WR',
'fullStationID': 'KFGZ',
'wfoCityState': 'FLAGSTAFF AZ',
'wfoCity': 'FLAGSTAFF',
'state': 'ARIZONA',
},
'FSD': {
'region': 'CR',
'fullStationID': 'KFSD',
'wfoCityState': 'SIOUX FALLS SD',
'wfoCity': 'SIOUX FALLS',
'state': 'SOUTH DAKOTA',
},
'FWD': {
'region': 'SR',
'fullStationID': 'KFWD',
'wfoCityState': 'FORT WORTH TX',
'wfoCity': 'FORT WORTH',
'state': 'TEXAS',
},
'GGW': {
'region': 'WR',
'fullStationID': 'KGGW',
'wfoCityState': 'GLASGOW MT',
'wfoCity': 'GLASGOW',
'state': 'MONTANA',
},
'GID': {
'region': 'CR',
'fullStationID': 'KGID',
'wfoCityState': 'HASTINGS NE',
'wfoCity': 'HASTINGS',
'state': 'NEBRASKA',
},
'GJT': {
'region': 'CR',
'fullStationID': 'KGJT',
'wfoCityState': 'GRAND JUNCTION CO',
'wfoCity': 'GRAND JUNCTION',
'state': 'COLORADO',
},
'GLD': {
'region': 'CR',
'fullStationID': 'KGLD',
'wfoCityState': 'GOODLAND KS',
'wfoCity': 'GOODLAND',
'state': 'KANSAS',
},
'GRB': {
'region': 'CR',
'fullStationID': 'KGRB',
'wfoCityState': 'GREEN BAY WI',
'wfoCity': 'GREEN BAY',
'state': 'WISCONSIN',
},
'GRR': {
'region': 'CR',
'fullStationID': 'KGRR',
'wfoCityState': 'GRAND RAPIDS MI',
'wfoCity': 'GRAND RAPIDS',
'state': 'MICHIGAN',
},
'GSP': {
'region': 'ER',
'fullStationID': 'KGSP',
'wfoCityState': 'GREENVILLE-SPARTANBURG SC',
'wfoCity': 'GREENVILLE-SPARTANBURG',
'state': 'SOUTH CAROLINA',
},
'GUM': {
'region': 'PR',
'fullStationID': 'PGUM',
'wfoCityState': 'TIYAN GU',
'wfoCity': 'TIYAN',
'state': 'GUAM',
},
'GYX': {
'region': 'ER',
'fullStationID': 'KGYX',
'wfoCityState': 'GRAY ME',
'wfoCity': 'GRAY',
'state': 'MAINE',
},
'HFO': {
'region': 'PR',
'fullStationID': 'PHFO',
'wfoCityState': 'HONOLULU HI',
'wfoCity': 'HONOLULU',
'state': 'HAWAII',
},
'HGX': {
'region': 'SR',
'fullStationID': 'KHGX',
'wfoCityState': 'HOUSTON/GALVESTON TX',
'wfoCity': 'HOUSTON/GALVESTON',
'state': 'TEXAS',
},
'HNX': {
'region': 'WR',
'fullStationID': 'KHNX',
'wfoCityState': 'HANFORD CA',
'wfoCity': 'HANFORD',
'state': 'CALIFORNIA',
},
'HUN': {
'region': 'SR',
'fullStationID': 'KHUN',
'wfoCityState': 'HUNTSVILLE AL',
'wfoCity': 'HUNTSVILLE',
'state': 'ALABAMA',
},
'ICT': {
'region': 'CR',
'fullStationID': 'KICT',
'wfoCityState': 'WICHITA KS',
'wfoCity': 'WICHITA',
'state': 'KANSAS',
},
'ILM': {
'region': 'ER',
'fullStationID': 'KILM',
'wfoCityState': 'WILMINGTON NC',
'wfoCity': 'WILMINGTON',
'state': 'NORTH CAROLINA',
},
'ILN': {
'region': 'ER',
'fullStationID': 'KILN',
'wfoCityState': 'WILMINGTON OH',
'wfoCity': 'WILMINGTON',
'state': 'OHIO',
},
'ILX': {
'region': 'CR',
'fullStationID': 'KILX',
'wfoCityState': 'LINCOLN IL',
'wfoCity': 'LINCOLN',
'state': 'ILLINOIS',
},
'IND': {
'region': 'CR',
'fullStationID': 'KIND',
'wfoCityState': 'INDIANAPOLIS IN',
'wfoCity': 'INDIANAPOLIS',
'state': 'INDIANA',
},
'IWX': {
'region': 'CR',
'fullStationID': 'KIWX',
'wfoCityState': 'NORTHERN INDIANA',
'wfoCity': 'NORTHERN INDIANA',
'state': 'INDIANA',
},
'JAN': {
'region': 'SR',
'fullStationID': 'KJAN',
'wfoCityState': 'JACKSON MS',
'wfoCity': 'JACKSON',
'state': 'MISSISSIPPI',
},
'JAX': {
'region': 'SR',
'fullStationID': 'KJAX',
'wfoCityState': 'JACKSONVILLE FL',
'wfoCity': 'JACKSONVILLE',
'state': 'FLORIDA',
},
'JKL': {
'region': 'CR',
'fullStationID': 'KJKL',
'wfoCityState': 'JACKSON KY',
'wfoCity': 'JACKSON',
'state': 'KENTUCKY',
},
'KEY': {
'region': 'SR',
'fullStationID': 'KKEY',
'wfoCityState': 'KEY WEST FL',
'wfoCity': 'KEY WEST',
'state': 'FLORIDA',
},
'LBF': {
'region': 'CR',
'fullStationID': 'KLBF',
'wfoCityState': 'NORTH PLATTE NE',
'wfoCity': 'NORTH PLATTE',
'state': 'NEBRASKA',
},
'LCH': {
'region': 'SR',
'fullStationID': 'KLCH',
'wfoCityState': 'LAKE CHARLES LA',
'wfoCity': 'LAKE CHARLES',
'state': 'LOUISIANA',
},
'LIX': {
'region': 'SR',
'fullStationID': 'KLIX',
'wfoCityState': 'NEW ORLEANS LA',
'wfoCity': 'NEW ORLEANS',
'state': 'LOUISIANA',
},
'LKN': {
'region': 'WR',
'fullStationID': 'KLKN',
'wfoCityState': 'ELKO NV',
'wfoCity': 'ELKO',
'state': 'NEVADA',
},
'LMK': {
'region': 'CR',
'fullStationID': 'KLMK',
'wfoCityState': 'LOUISVILLE KY',
'wfoCity': 'LOUISVILLE',
'state': 'KENTUCKY',
},
'LOT': {
'region': 'CR',
'fullStationID': 'KLOT',
'wfoCityState': 'CHICAGO IL',
'wfoCity': 'CHICAGO',
'state': 'ILLINOIS',
},
'LOX': {
'region': 'WR',
'fullStationID': 'KLOX',
'wfoCityState': 'LOS ANGELES/OXNARD CA',
'wfoCity': 'LOS ANGELES/OXNARD',
'state': 'CALIFORNIA',
},
'LSX': {
'region': 'CR',
'fullStationID': 'KLSX',
'wfoCityState': 'ST LOUIS MO',
'wfoCity': 'ST LOUIS',
'state': 'MISSOURI',
},
'LUB': {
'region': 'SR',
'fullStationID': 'KLUB',
'wfoCityState': 'LUBBOCK TX',
'wfoCity': 'LUBBOCK',
'state': 'TEXAS',
},
'LWX': {
'region': 'ER',
'fullStationID': 'KLWX',
'wfoCityState': 'BALTIMORE MD/WASHINGTON DC',
'wfoCity': 'BALTIMORE MD/WASHINGTON',
'state': 'WASHINGTON DC',
},
'LZK': {
'region': 'SR',
'fullStationID': 'KLZK',
'wfoCityState': 'LITTLE ROCK AR',
'wfoCity': 'LITTLE ROCK',
'state': 'ARKANSAS',
},
'MAF': {
'region': 'SR',
'fullStationID': 'KMAF',
'wfoCityState': 'MIDLAND/ODESSA TX',
'wfoCity': 'MIDLAND/ODESSA',
'state': 'TEXAS',
},
'MEG': {
'region': 'SR',
'fullStationID': 'KMEG',
'wfoCityState': 'MEMPHIS TN',
'wfoCity': 'MEMPHIS',
'state': 'TENNESSEE',
},
'MFL': {
'region': 'SR',
'fullStationID': 'KMFL',
'wfoCityState': 'MIAMI FL',
'wfoCity': 'MIAMI',
'state': 'FLORIDA',
},
'MFR': {
'region': 'WR',
'fullStationID': 'KMFR',
'wfoCityState': 'MEDFORD OR',
'wfoCity': 'MEDFORD',
'state': 'OREGON',
},
'MHX': {
'region': 'ER',
'fullStationID': 'KMHX',
'wfoCityState': 'NEWPORT/MOREHEAD CITY NC',
'wfoCity': 'NEWPORT/MOREHEAD CITY',
'state': 'NORTH CAROLINA',
},
'MKX': {
'region': 'CR',
'fullStationID': 'KMKX',
'wfoCityState': 'MILWAUKEE/SULLIVAN WI',
'wfoCity': 'MILWAUKEE/SULLIVAN',
'state': 'WISCONSIN',
},
'MLB': {
'region': 'SR',
'fullStationID': 'KMLB',
'wfoCityState': 'MELBOURNE FL',
'wfoCity': 'MELBOURNE',
'state': 'FLORIDA',
},
'MOB': {
'region': 'SR',
'fullStationID': 'KMOB',
'wfoCityState': 'MOBILE AL',
'wfoCity': 'MOBILE',
'state': 'ALABAMA',
},
'MPX': {
'region': 'CR',
'fullStationID': 'KMPX',
'wfoCityState': 'TWIN CITIES/CHANHASSEN MN',
'wfoCity': 'TWIN CITIES/CHANHASSEN',
'state': 'MINNESOTA',
},
'MQT': {
'region': 'CR',
'fullStationID': 'KMQT',
'wfoCityState': 'MARQUETTE MI',
'wfoCity': 'MARQUETTE',
'state': 'MICHIGAN',
},
'MRX': {
'region': 'SR',
'fullStationID': 'KMRX',
'wfoCityState': 'MORRISTOWN TN',
'wfoCity': 'MORRISTOWN',
'state': 'TENNESSEE',
},
'MSO': {
'region': 'WR',
'fullStationID': 'KMSO',
'wfoCityState': 'MISSOULA MT',
'wfoCity': 'MISSOULA',
'state': 'MONTANA',
},
'MTR': {
'region': 'WR',
'fullStationID': 'KMTR',
'wfoCityState': 'SAN FRANCISCO CA',
'wfoCity': 'SAN FRANCISCO',
'state': 'CALIFORNIA',
},
'NH1': {
'region': 'NC',
'fullStationID': 'KNHC',
'wfoCityState': 'NATIONAL HURRICANE CENTER MIAMI FL',
'wfoCity': 'MIAMI',
'state': '',
},
'NH2': {
'region': 'NC',
'fullStationID': 'KNHC',
'wfoCityState': 'NATIONAL HURRICANE CENTER MIAMI FL',
'wfoCity': 'MIAMI',
'state': '',
},
'OAX': {
'region': 'CR',
'fullStationID': 'KOAX',
'wfoCityState': 'OMAHA/VALLEY NE',
'wfoCity': 'OMAHA/VALLEY',
'state': 'NEBRASKA',
},
'OHX': {
'region': 'SR',
'fullStationID': 'KOHX',
'wfoCityState': 'NASHVILLE TN',
'wfoCity': 'NASHVILLE',
'state': 'TENNESSEE',
},
'OKX': {
'region': 'ER',
'fullStationID': 'KOKX',
'wfoCityState': 'UPTON NY',
'wfoCity': 'UPTON',
'state': 'NEW YORK',
},
'ONA': {
'region': 'NC',
'fullStationID': 'KWBC',
'wfoCityState': 'OCEAN PREDICTION CENTER WASHINGTON DC',
'wfoCity': 'WASHINGTON DC',
'state': '',
},
'ONP': {
'region': 'NC',
'fullStationID': 'KWBC',
'wfoCityState': 'OCEAN PREDICTION CENTER WASHINGTON DC',
'wfoCity': 'WASHINGTON DC',
'state': '',
},
'OTX': {
'region': 'WR',
'fullStationID': 'KOTX',
'wfoCityState': 'SPOKANE WA',
'wfoCity': 'SPOKANE',
'state': 'WASHINGTON',
},
'OUN': {
'region': 'SR',
'fullStationID': 'KOUN',
'wfoCityState': 'NORMAN OK',
'wfoCity': 'NORMAN',
'state': 'OKLAHOMA',
},
'PAH': {
'region': 'CR',
'fullStationID': 'KPAH',
'wfoCityState': 'PADUCAH KY',
'wfoCity': 'PADUCAH',
'state': 'KENTUCKY',
},
'PBZ': {
'region': 'ER',
'fullStationID': 'KPBZ',
'wfoCityState': 'PITTSBURGH PA',
'wfoCity': 'PITTSBURGH',
'state': 'PENNSYLVANIA',
},
'PDT': {
'region': 'WR',
'fullStationID': 'KPDT',
'wfoCityState': 'PENDLETON OR',
'wfoCity': 'PENDLETON',
'state': 'OREGON',
},
'PHI': {
'region': 'ER',
'fullStationID': 'KPHI',
'wfoCityState': 'MOUNT HOLLY NJ',
'wfoCity': 'MOUNT HOLLY',
'state': 'NEW JERSEY',
},
'PIH': {
'region': 'WR',
'fullStationID': 'KPIH',
'wfoCityState': 'POCATELLO ID',
'wfoCity': 'POCATELLO',
'state': 'IDAHO',
},
'PQR': {
'region': 'WR',
'fullStationID': 'KPQR',
'wfoCityState': 'PORTLAND OR',
'wfoCity': 'PORTLAND',
'state': 'OREGON',
},
'PSR': {
'region': 'WR',
'fullStationID': 'KPSR',
'wfoCityState': 'PHOENIX AZ',
'wfoCity': 'PHOENIX',
'state': 'ARIZONA',
},
'PUB': {
'region': 'CR',
'fullStationID': 'KPUB',
'wfoCityState': 'PUEBLO CO',
'wfoCity': 'PUEBLO',
'state': 'COLORADO',
},
'RAH': {
'region': 'ER',
'fullStationID': 'KRAH',
'wfoCityState': 'RALEIGH NC',
'wfoCity': 'RALEIGH',
'state': 'NORTH CAROLINA',
},
'REV': {
'region': 'WR',
'fullStationID': 'KREV',
'wfoCityState': 'RENO NV',
'wfoCity': 'RENO',
'state': 'NEVADA',
},
'RIW': {
'region': 'CR',
'fullStationID': 'KRIW',
'wfoCityState': 'RIVERTON WY',
'wfoCity': 'RIVERTON',
'state': 'WYOMING',
},
'RLX': {
'region': 'ER',
'fullStationID': 'KRLX',
'wfoCityState': 'CHARLESTON WV',
'wfoCity': 'CHARLESTON',
'state': 'WEST VIRGINIA',
},
'RNK': {
'region': 'ER',
'fullStationID': 'KRNK',
'wfoCityState': 'BLACKSBURG VA',
'wfoCity': 'BLACKSBURG',
'state': 'VIRGINIA',
},
'SEW': {
'region': 'WR',
'fullStationID': 'KSEW',
'wfoCityState': 'SEATTLE WA',
'wfoCity': 'SEATTLE',
'state': 'WASHINGTON',
},
'SGF': {
'region': 'CR',
'fullStationID': 'KSGF',
'wfoCityState': 'SPRINGFIELD MO',
'wfoCity': 'SPRINGFIELD',
'state': 'MISSOURI',
},
'SGX': {
'region': 'WR',
'fullStationID': 'KSGX',
'wfoCityState': 'SAN DIEGO CA',
'wfoCity': 'SAN DIEGO',
'state': 'CALIFORNIA',
},
'SHV': {
'region': 'SR',
'fullStationID': 'KSHV',
'wfoCityState': 'SHREVEPORT LA',
'wfoCity': 'SHREVEPORT',
'state': 'LOUISIANA',
},
'SJT': {
'region': 'SR',
'fullStationID': 'KSJT',
'wfoCityState': 'SAN ANGELO TX',
'wfoCity': 'SAN ANGELO',
'state': 'TEXAS',
},
'SJU': {
'region': 'SR',
'fullStationID': 'TJSJ',
'wfoCityState': 'SAN JUAN PR',
'wfoCity': 'SAN JUAN',
'state': 'PUERTO RICO',
},
'SLC': {
'region': 'WR',
'fullStationID': 'KSLC',
'wfoCityState': 'SALT LAKE CITY UT',
'wfoCity': 'SALT LAKE CITY',
'state': 'UTAH',
},
'STO': {
'region': 'WR',
'fullStationID': 'KSTO',
'wfoCityState': 'SACRAMENTO CA',
'wfoCity': 'SACRAMENTO',
'state': 'CALIFORNIA',
},
'TAE': {
'region': 'SR',
'fullStationID': 'KTAE',
'wfoCityState': 'TALLAHASSEE FL',
'wfoCity': 'TALLAHASSEE',
'state': 'FLORIDA',
},
'TBW': {
'region': 'SR',
'fullStationID': 'KTBW',
'wfoCityState': 'TAMPA BAY RUSKIN FL',
'wfoCity': 'TAMPA BAY RUSKIN',
'state': 'FLORIDA',
},
'TFX': {
'region': 'WR',
'fullStationID': 'KTFX',
'wfoCityState': 'GREAT FALLS MT',
'wfoCity': 'GREAT FALLS',
'state': 'MONTANA',
},
'TOP': {
'region': 'CR',
'fullStationID': 'KTOP',
'wfoCityState': 'TOPEKA KS',
'wfoCity': 'TOPEKA',
'state': 'KANSAS',
},
'TSA': {
'region': 'SR',
'fullStationID': 'KTSA',
'wfoCityState': 'TULSA OK',
'wfoCity': 'TULSA',
'state': 'OKLAHOMA',
},
'TWC': {
'region': 'WR',
'fullStationID': 'KTWC',
'wfoCityState': 'TUCSON AZ',
'wfoCity': 'TUCSON',
'state': 'ARIZONA',
},
'UNR': {
'region': 'CR',
'fullStationID': 'KUNR',
'wfoCityState': 'RAPID CITY SD',
'wfoCity': 'RAPID CITY',
'state': 'SOUTH DAKOTA',
},
'VEF': {
'region': 'WR',
'fullStationID': 'KVEF',
'wfoCityState': 'LAS VEGAS NV',
'wfoCity': 'LAS VEGAS',
'state': 'NEVADA',
},
}

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