Issue #237 revert Silver Spring changes to nsharp activator which break windows. Fix grib decoder to handle grib files with lo1 on the dateline.

Change-Id: I4991e7f02c8cdcfd608c3c6d987f4d0ea8593f40

Former-commit-id: 324b358c44 [formerly 2b0f9f149c4dc2031cb9178538899eb3f9f5de23]
Former-commit-id: 851046ccf3
This commit is contained in:
Ben Steffensmeier 2012-02-06 16:54:00 -06:00
parent 7bcbf3e3bc
commit 56c1b70d03
2 changed files with 70 additions and 63 deletions

View file

@ -1308,7 +1308,7 @@ public class Grib1Decoder extends AbstractDecoder {
lon = lon % 360;
}
if (lon > 180) {
if (lon >= 180) {
lon = (180 - lon % 180) * -1;
} else if (lon < -180) {
lon = (180 - (-lon % 180));

View file

@ -29,8 +29,6 @@ import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
@ -38,12 +36,14 @@ import com.raytheon.uf.common.status.UFStatus;
* The activator class controls the plug-in life cycle
*/
public class Activator extends AbstractUIPlugin {
private static final transient IUFStatusHandler statusHandler = UFStatus.getHandler(Activator.class);
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(Activator.class);
// The plug-in ID
public static final String PLUGIN_ID = "gov.noaa.nws.ncep.ui.nsharp";
private static final String BIGNSHARP = "bignsharp";
// The shared instance
private static Activator plugin;
@ -55,25 +55,34 @@ public class Activator extends AbstractUIPlugin {
/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
*
* @see
* org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext
* )
*/
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
try {
Bundle b = this.getBundle();
URL url = FileLocator.find(b, new Path("libbignsharp.so"), null);
URL url = FileLocator.find(b,
new Path(System.mapLibraryName(BIGNSHARP)), null);
url = FileLocator.resolve(url);
System.load(url.getPath());
} catch (Throwable e) {
statusHandler.handle(UFStatus.Priority.WARN, "An Error occured loading nsharp libraries, nsharp will not work.", e);
statusHandler
.handle(UFStatus.Priority.WARN,
"An Error occured loading nsharp libraries, nsharp will not work.",
e);
}
}
/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
*
* @see
* org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext
* )
*/
public void stop(BundleContext context) throws Exception {
plugin = null;
@ -89,13 +98,11 @@ public class Activator extends AbstractUIPlugin {
return plugin;
}
// for plugin to retrieve runtime properties from build.properties
protected final static String MY_PROPERTIES = "build.properties";
protected PropertyResourceBundle myProperties;
public PropertyResourceBundle getMyProperties() {
if (myProperties == null) {
@ -110,7 +117,7 @@ public class Activator extends AbstractUIPlugin {
} catch (IOException e) {
System.out.println("Error open NSHARP build.properites file");
System.out.println("Error open NSHARP build.properties file");
}
}