Issue #1602 Merged menu changes and D2D Nsharp changes to support NUCAPS NPP changes
Change-Id: Ia3375d8c4e03ffa143a74c965c9cf40cb2649402 Former-commit-id: ac58f7ba225688d0c2f56a8937e3477bf30bd8d1
This commit is contained in:
parent
8abc835e59
commit
d610c1b862
6 changed files with 19 additions and 41 deletions
|
@ -138,7 +138,7 @@ public class D2DNSharpResource extends
|
|||
D2DNSharpDataObject pdo = dataResponseQueue.poll();
|
||||
while (pdo != null) {
|
||||
if (pdos.get(pdo.getDataTime()) == pdo) {
|
||||
if (isValidSounding(pdo)) {
|
||||
if (pdo.getLayers() != null) {
|
||||
stnInfo = pdo.getStationInfo();
|
||||
myDataMap.put(stnInfo.getStnDisplayInfo(),
|
||||
pdo.getLayers());
|
||||
|
@ -154,31 +154,6 @@ public class D2DNSharpResource extends
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if a dataObject has enough valid layers to build a sounding
|
||||
* without freezing or crashing CAVE.
|
||||
*
|
||||
* @param pdo
|
||||
* @return
|
||||
*/
|
||||
protected boolean isValidSounding(D2DNSharpDataObject pdo) {
|
||||
if (pdo.getLayers() == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
int numberOfWindLayers = 0;
|
||||
for (NcSoundingLayer layer : pdo.getLayers()) {
|
||||
if (layer.getWindSpeed() > 0) {
|
||||
numberOfWindLayers += 1;
|
||||
if (numberOfWindLayers >= 2) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private NsharpResourceHandler getHandler() throws VizException {
|
||||
List<NsharpAbstractPaneResource> paneRscs = descriptor
|
||||
.getResourceList().getResourcesByTypeAsType(
|
||||
|
|
|
@ -157,6 +157,10 @@ public abstract class D2DNSharpResourceData extends
|
|||
List<NcSoundingLayer> layers = profileList.getSoundingLyLst();
|
||||
layers = NsharpDataHandling.organizeSoundingDataForShow(layers,
|
||||
profileList.getStationElevation());
|
||||
if (layers != null && layers.size() < 3) {
|
||||
// set invalid data to null
|
||||
layers = null;
|
||||
}
|
||||
dataObject.setLayers(layers);
|
||||
}
|
||||
|
||||
|
|
|
@ -25,6 +25,9 @@ import java.util.Set;
|
|||
import org.eclipse.jface.action.IContributionItem;
|
||||
import org.eclipse.jface.action.MenuManager;
|
||||
import org.eclipse.swt.widgets.Menu;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
import org.eclipse.ui.menus.IMenuService;
|
||||
import org.eclipse.ui.menus.MenuUtil;
|
||||
|
||||
import com.raytheon.uf.common.menus.xml.CommonAbstractMenuContribution;
|
||||
import com.raytheon.uf.common.menus.xml.VariableSubstitution;
|
||||
|
@ -77,9 +80,9 @@ public class SubmenuContributionItem extends MenuManager {
|
|||
* @param mListener
|
||||
*/
|
||||
public SubmenuContributionItem(VariableSubstitution[] includeSubstitutions,
|
||||
String name, CommonAbstractMenuContribution[] ci,
|
||||
String id, String name, CommonAbstractMenuContribution[] ci,
|
||||
Set<String> removals) {
|
||||
super(processNameSubstitution(includeSubstitutions, name));
|
||||
super(processNameSubstitution(includeSubstitutions, name), id);
|
||||
this.subs = includeSubstitutions;
|
||||
this.contribs = ci;
|
||||
this.removals = removals;
|
||||
|
@ -144,6 +147,10 @@ public class SubmenuContributionItem extends MenuManager {
|
|||
add(item);
|
||||
}
|
||||
}
|
||||
IMenuService menuService = (IMenuService) PlatformUI.getWorkbench()
|
||||
.getService(IMenuService.class);
|
||||
menuService.populateContributionManager(
|
||||
SubmenuContributionItem.this, MenuUtil.menuUri(getId()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -72,7 +72,7 @@ public class IncludeMenuContribution extends
|
|||
newItem.substitutions = item.substitutions;
|
||||
newItem.suppressErrors = item.suppressErrors;
|
||||
return new IContributionItem[] { new SubmenuContributionItem(subs,
|
||||
item.subMenuName,
|
||||
item.id, item.subMenuName,
|
||||
new CommonAbstractMenuContribution[] { newItem }, removals) };
|
||||
}
|
||||
return getContributionItemsInternal(items, subs, removals);
|
||||
|
|
|
@ -83,7 +83,8 @@ public class IncludeMenuItem extends CommonIncludeMenuItem implements
|
|||
throws VizException {
|
||||
if (subMenuName != null) {
|
||||
submenuCont = new SubmenuContributionItem(incomingSubs,
|
||||
subMenuName, null, removalsIn) {
|
||||
"IncludeSubMenuContributionId_" + subMenuName, subMenuName,
|
||||
null, removalsIn) {
|
||||
|
||||
@Override
|
||||
protected synchronized IContributionItem[][] getContributionItems() {
|
||||
|
@ -98,16 +99,6 @@ public class IncludeMenuItem extends CommonIncludeMenuItem implements
|
|||
}
|
||||
return this.contributionItems;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.jface.action.MenuManager#getId()
|
||||
*/
|
||||
@Override
|
||||
public String getId() {
|
||||
return "IncludeSubMenuContributionId_"+subMenuName;
|
||||
}
|
||||
};
|
||||
return new IContributionItem[] { submenuCont };
|
||||
}
|
||||
|
|
|
@ -65,7 +65,8 @@ public class SubmenuContribution extends
|
|||
return new IContributionItem[0];
|
||||
|
||||
return new IContributionItem[] { new SubmenuContributionItem(subs,
|
||||
item.menuText, item.contributions, new HashSet<String>()) };
|
||||
item.id, item.menuText, item.contributions,
|
||||
new HashSet<String>()) };
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue