Merge "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" into 4-Thin_Client

Former-commit-id: e746b4043a [formerly 00cf561d88] [formerly 42e12cc025 [formerly b28fce87e699357d5ec463fbda5a48590d590560]]
Former-commit-id: 42e12cc025
Former-commit-id: b1264d105b
This commit is contained in:
Nate Jensen 2012-02-07 09:45:28 -06:00 committed by Gerrit Code Review
commit 7bc07e29ca
2 changed files with 70 additions and 63 deletions

View file

@ -1308,7 +1308,7 @@ public class Grib1Decoder extends AbstractDecoder {
lon = lon % 360; lon = lon % 360;
} }
if (lon > 180) { if (lon >= 180) {
lon = (180 - lon % 180) * -1; lon = (180 - lon % 180) * -1;
} else if (lon < -180) { } else if (lon < -180) {
lon = (180 - (-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.Bundle;
import org.osgi.framework.BundleContext; import org.osgi.framework.BundleContext;
import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus;
@ -38,12 +36,14 @@ import com.raytheon.uf.common.status.UFStatus;
* The activator class controls the plug-in life cycle * The activator class controls the plug-in life cycle
*/ */
public class Activator extends AbstractUIPlugin { public class Activator extends AbstractUIPlugin {
private static final transient IUFStatusHandler statusHandler = UFStatus
private static final transient IUFStatusHandler statusHandler = UFStatus.getHandler(Activator.class); .getHandler(Activator.class);
// The plug-in ID // The plug-in ID
public static final String PLUGIN_ID = "gov.noaa.nws.ncep.ui.nsharp"; public static final String PLUGIN_ID = "gov.noaa.nws.ncep.ui.nsharp";
private static final String BIGNSHARP = "bignsharp";
// The shared instance // The shared instance
private static Activator plugin; private static Activator plugin;
@ -55,25 +55,34 @@ public class Activator extends AbstractUIPlugin {
/* /*
* (non-Javadoc) * (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 { public void start(BundleContext context) throws Exception {
super.start(context); super.start(context);
plugin = this; plugin = this;
try { try {
Bundle b = this.getBundle(); 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); url = FileLocator.resolve(url);
System.load(url.getPath()); System.load(url.getPath());
}catch (Throwable e) { } 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) * (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 { public void stop(BundleContext context) throws Exception {
plugin = null; plugin = null;
@ -89,16 +98,14 @@ public class Activator extends AbstractUIPlugin {
return plugin; return plugin;
} }
// for plugin to retrieve runtime properties from build.properties
//for plugin to retrieve runtime properties from build.properties
protected final static String MY_PROPERTIES = "build.properties"; protected final static String MY_PROPERTIES = "build.properties";
protected PropertyResourceBundle myProperties; protected PropertyResourceBundle myProperties;
public PropertyResourceBundle getMyProperties() {
public PropertyResourceBundle getMyProperties(){ if (myProperties == null) {
if (myProperties == null){
try { try {
@ -106,11 +113,11 @@ public class Activator extends AbstractUIPlugin {
FileLocator.openStream(this.getBundle(), FileLocator.openStream(this.getBundle(),
new Path(MY_PROPERTIES),false)); new Path(MY_PROPERTIES), false));
} catch (IOException e) { } catch (IOException e) {
System.out.println("Error open NSHARP build.properites file"); System.out.println("Error open NSHARP build.properties file");
} }
} }