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,83 +36,92 @@ 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
.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";
// The plug-in ID private static final String BIGNSHARP = "bignsharp";
public static final String PLUGIN_ID = "gov.noaa.nws.ncep.ui.nsharp";
// The shared instance // The shared instance
private static Activator plugin; private static Activator plugin;
/** /**
* The constructor * The constructor
*/ */
public Activator() { public Activator() {
} }
/* /*
* (non-Javadoc) * (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) *
*/ * @see
public void start(BundleContext context) throws Exception { * org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext
super.start(context); * )
plugin = this; */
try { public void start(BundleContext context) throws Exception {
Bundle b = this.getBundle(); super.start(context);
URL url = FileLocator.find(b, new Path("libbignsharp.so"), null); plugin = this;
url = FileLocator.resolve(url); try {
System.load(url.getPath()); Bundle b = this.getBundle();
}catch (Throwable e) { URL url = FileLocator.find(b,
statusHandler.handle(UFStatus.Priority.WARN, "An Error occured loading nsharp libraries, nsharp will not work.", e); 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);
}
}
} /*
* (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);
}
/* /**
* (non-Javadoc) * Returns the shared instance
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) *
*/ * @return the shared instance
public void stop(BundleContext context) throws Exception { */
plugin = null; public static Activator getDefault() {
super.stop(context); return plugin;
} }
/** // for plugin to retrieve runtime properties from build.properties
* Returns the shared instance protected final static String MY_PROPERTIES = "build.properties";
*
* @return the shared instance
*/
public static Activator getDefault() {
return plugin;
}
protected PropertyResourceBundle myProperties;
//for plugin to retrieve runtime properties from build.properties public PropertyResourceBundle getMyProperties() {
protected final static String MY_PROPERTIES = "build.properties";
protected PropertyResourceBundle myProperties; if (myProperties == null) {
try {
public PropertyResourceBundle getMyProperties(){ myProperties = new PropertyResourceBundle(
if (myProperties == null){ FileLocator.openStream(this.getBundle(),
try { new Path(MY_PROPERTIES), false));
myProperties = new PropertyResourceBundle( } catch (IOException e) {
FileLocator.openStream(this.getBundle(), System.out.println("Error open NSHARP build.properties file");
new Path(MY_PROPERTIES),false)); }
}
} catch (IOException e) { return myProperties;
}
System.out.println("Error open NSHARP build.properites file");
}
}
return myProperties;
}
} }