Issue #2064 - fixes for requested envelope, adding all parameters to
subscription, and subscription manager filtering Review comments Change-Id: Iabab607b828ffa2ce7c75047d0d1647a243132f4 Former-commit-id: d3799ccf79d88e2048471d7452590d4d174326b3
This commit is contained in:
parent
2a557e1e3f
commit
1069f21613
4 changed files with 64 additions and 26 deletions
|
@ -123,6 +123,7 @@ import com.raytheon.viz.ui.presenter.IDisplay;
|
|||
* May 09, 2013 2000 djohnson Copy subscription now requires editing first to prevent duplicates, and remove duplicate code.
|
||||
* May 17, 2013 1040 mpduff Change office id to list for shared subscription.
|
||||
* May 28, 2013 1650 djohnson Allow specifying filters for what subscriptions to show.
|
||||
* Jun 05, 2013 2064 mpduff Fix for filtering combo boxes.
|
||||
* Jun 06, 2013 2030 mpduff Refactored help.
|
||||
* </pre>
|
||||
*
|
||||
|
@ -212,6 +213,15 @@ public class SubscriptionManagerDlg extends CaveSWTDialog implements
|
|||
|
||||
private final ISubscriptionManagerFilter filter;
|
||||
|
||||
/** The selected office */
|
||||
private String selectedOffice;
|
||||
|
||||
/** The selected group */
|
||||
private String selectedGroup;
|
||||
|
||||
/** The office display list */
|
||||
private final SortedSet<String> officeDisplayItems = new TreeSet<String>();
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
|
@ -779,6 +789,8 @@ public class SubscriptionManagerDlg extends CaveSWTDialog implements
|
|||
|
||||
final String group = groupCbo.getText();
|
||||
final String office = officeCbo.getText();
|
||||
this.selectedOffice = office;
|
||||
this.selectedGroup = group;
|
||||
|
||||
tableComp.setSubscriptionFilter(new ISubscriptionManagerFilter() {
|
||||
@Override
|
||||
|
@ -953,17 +965,18 @@ public class SubscriptionManagerDlg extends CaveSWTDialog implements
|
|||
groupNameList.add(0, "All Subscriptions");
|
||||
groupNames = groupNameList.toArray(new String[0]);
|
||||
groupCbo.setItems(groupNames);
|
||||
groupCbo.select(0);
|
||||
|
||||
if (this.selectedGroup != null) {
|
||||
groupCbo.select(groupNameList.indexOf(selectedGroup));
|
||||
} else {
|
||||
groupCbo.select(0);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the list of office names available. Default is "ALL" office ids
|
||||
*/
|
||||
public void loadOfficeNames() {
|
||||
|
||||
// Create sorted set
|
||||
SortedSet<String> officeDisplayItems = new TreeSet<String>();
|
||||
|
||||
int numRows = tableComp.getTable().getItemCount();
|
||||
|
||||
if (numRows > 0) {
|
||||
|
@ -983,16 +996,21 @@ public class SubscriptionManagerDlg extends CaveSWTDialog implements
|
|||
officeAll[0] = "ALL";
|
||||
|
||||
System.arraycopy(officeNames, 0, officeAll, 1, officeNames.length);
|
||||
int idx = 0;
|
||||
for (String site : officeAll) {
|
||||
if (site.equalsIgnoreCase(CURRENT_SITE)) {
|
||||
break;
|
||||
}
|
||||
idx++;
|
||||
}
|
||||
officeCbo.setItems(officeAll);
|
||||
officeCbo.select(idx);
|
||||
|
||||
String site = CURRENT_SITE;
|
||||
if (this.selectedOffice != null) {
|
||||
for (Iterator<String> iter = officeDisplayItems.iterator(); iter
|
||||
.hasNext();) {
|
||||
String next = iter.next();
|
||||
if (next.equals(selectedOffice)) {
|
||||
site = next;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
officeCbo.select(officeCbo.indexOf(site));
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -620,22 +620,13 @@ public class GriddedSubsetManagerDlg
|
|||
|
||||
sub.setTime(newTime);
|
||||
|
||||
// TODO Phase 1 is only gridded coverage
|
||||
GriddedCoverage cov = (GriddedCoverage) dataSet.getCoverage();
|
||||
cov.setModelName(dataSet.getDataSetName());
|
||||
cov.setGridName(getNameText());
|
||||
GridCoverage coverage = cov.getGridCoverage();
|
||||
coverage.setName(getNameText());
|
||||
|
||||
if (spatialTabControls.useDataSetSize()) {
|
||||
cov.setRequestEnvelope(cov.getEnvelope());
|
||||
sub.setFullDataSet(true);
|
||||
} else {
|
||||
cov.setRequestEnvelope(spatialTabControls.getEnvelope());
|
||||
sub.setFullDataSet(false);
|
||||
}
|
||||
|
||||
sub.setCoverage(cov);
|
||||
setCoverage(sub, cov);
|
||||
|
||||
return sub;
|
||||
}
|
||||
|
|
|
@ -19,7 +19,10 @@
|
|||
**/
|
||||
package com.raytheon.uf.viz.datadelivery.subscription.subset;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
|
@ -30,6 +33,7 @@ import org.eclipse.swt.widgets.TabFolder;
|
|||
import org.eclipse.swt.widgets.TabItem;
|
||||
|
||||
import com.raytheon.uf.common.datadelivery.registry.Coverage;
|
||||
import com.raytheon.uf.common.datadelivery.registry.Parameter;
|
||||
import com.raytheon.uf.common.datadelivery.registry.PointDataSet;
|
||||
import com.raytheon.uf.common.datadelivery.registry.PointTime;
|
||||
import com.raytheon.uf.common.datadelivery.registry.Subscription;
|
||||
|
@ -171,10 +175,17 @@ public class PointSubsetManagerDlg extends
|
|||
newTime.setEndDate(new Date());
|
||||
sub.setTime(newTime);
|
||||
|
||||
Coverage coverage = new Coverage();
|
||||
coverage.setEnvelope(spatialTabControls.getEnvelope());
|
||||
sub.setCoverage(coverage);
|
||||
Coverage cov = new Coverage();
|
||||
|
||||
setCoverage(sub, cov);
|
||||
|
||||
List<Parameter> paramList = new ArrayList<Parameter>();
|
||||
Map<String, Parameter> paramMap = dataSet.getParameters();
|
||||
for (String key : paramMap.keySet()) {
|
||||
paramList.add(paramMap.get(key));
|
||||
}
|
||||
|
||||
sub.setParameter(paramList);
|
||||
return sub;
|
||||
}
|
||||
|
||||
|
|
|
@ -45,6 +45,7 @@ import org.opengis.referencing.operation.TransformException;
|
|||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.raytheon.uf.common.datadelivery.registry.AdhocSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.Coverage;
|
||||
import com.raytheon.uf.common.datadelivery.registry.DataSet;
|
||||
import com.raytheon.uf.common.datadelivery.registry.DataType;
|
||||
import com.raytheon.uf.common.datadelivery.registry.GriddedDataSet;
|
||||
|
@ -1006,4 +1007,21 @@ public abstract class SubsetManagerDlg<DATASET extends DataSet, PRESENTER extend
|
|||
protected String getNameText() {
|
||||
return nameText.getText();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the coverage into the subscription.
|
||||
*
|
||||
* @param sub
|
||||
* The subscription needing the coverage
|
||||
*/
|
||||
protected void setCoverage(Subscription sub, Coverage cov) {
|
||||
if (spatialTabControls.useDataSetSize()) {
|
||||
cov.setRequestEnvelope(cov.getEnvelope());
|
||||
sub.setFullDataSet(true);
|
||||
} else {
|
||||
cov.setRequestEnvelope(spatialTabControls.getEnvelope());
|
||||
sub.setFullDataSet(false);
|
||||
}
|
||||
sub.setCoverage(cov);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue