Issue #2064 - Fix editing of subscriptions
Change-Id: I4d04e4c099c2f898a5a6b13304bcea80b2776637 Former-commit-id: 7c6c6ce1e129393316784d1fc4a24ea5d452f77f
This commit is contained in:
parent
29d8f65dc1
commit
b76a638951
4 changed files with 43 additions and 20 deletions
|
@ -98,6 +98,7 @@ import com.raytheon.uf.viz.datadelivery.utils.DataDeliveryUtils;
|
|||
* Mar 29, 2013 1841 djohnson Subscription is now UserSubscription.
|
||||
* May 21, 2013 2020 mpduff Rename UserSubscription to SiteSubscription.
|
||||
* Jun 04, 2013 223 mpduff Added grid specific items to this class.
|
||||
* Jun 11, 2013 2064 mpduff Fix editing of subscriptions.
|
||||
*
|
||||
*
|
||||
* </pre>
|
||||
|
@ -602,23 +603,33 @@ public class GriddedSubsetManagerDlg
|
|||
|
||||
Time dataSetTime = dataSet.getTime();
|
||||
|
||||
Time newTime = new Time();
|
||||
newTime.setEnd(dataSetTime.getEnd());
|
||||
newTime.setFormat(dataSetTime.getFormat());
|
||||
newTime.setNumTimes(dataSetTime.getNumTimes());
|
||||
newTime.setRequestEnd(dataSetTime.getRequestEnd());
|
||||
newTime.setRequestStart(dataSetTime.getRequestStart());
|
||||
newTime.setStart(dataSetTime.getStart());
|
||||
newTime.setStep(dataSetTime.getStep());
|
||||
newTime.setStepUnit(dataSetTime.getStepUnit());
|
||||
|
||||
if (sub instanceof AdhocSubscription) {
|
||||
newTime = setupDataSpecificTime(newTime, sub);
|
||||
} else if (!create) {
|
||||
newTime.setCycleTimes(this.subscription.getTime().getCycleTimes());
|
||||
}
|
||||
Time newTime = new Time();
|
||||
newTime.setEnd(dataSetTime.getEnd());
|
||||
newTime.setFormat(dataSetTime.getFormat());
|
||||
newTime.setNumTimes(dataSetTime.getNumTimes());
|
||||
newTime.setRequestEnd(dataSetTime.getRequestEnd());
|
||||
newTime.setRequestStart(dataSetTime.getRequestStart());
|
||||
newTime.setStart(dataSetTime.getStart());
|
||||
newTime.setStep(dataSetTime.getStep());
|
||||
newTime.setStepUnit(dataSetTime.getStepUnit());
|
||||
newTime.setCycleTimes(dataSetTime.getCycleTimes());
|
||||
|
||||
sub.setTime(newTime);
|
||||
newTime = setupDataSpecificTime(newTime, sub);
|
||||
sub.setTime(newTime);
|
||||
} else if (!create) {
|
||||
Time time = sub.getTime();
|
||||
List<String> fcstHours = time.getFcstHours();
|
||||
String[] selectedItems = this.timingTabControls
|
||||
.getSelectedFcstHours();
|
||||
List<Integer> fcstIndices = new ArrayList<Integer>();
|
||||
for (String hr : selectedItems) {
|
||||
fcstIndices.add(fcstHours.indexOf(hr));
|
||||
}
|
||||
|
||||
time.setSelectedTimeIndices(fcstIndices);
|
||||
subscription.setTime(time);
|
||||
}
|
||||
|
||||
GriddedCoverage cov = (GriddedCoverage) dataSet.getCoverage();
|
||||
cov.setModelName(dataSet.getDataSetName());
|
||||
|
|
|
@ -33,6 +33,8 @@ 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.DataLevelType;
|
||||
import com.raytheon.uf.common.datadelivery.registry.DataType;
|
||||
import com.raytheon.uf.common.datadelivery.registry.Parameter;
|
||||
import com.raytheon.uf.common.datadelivery.registry.PointDataSet;
|
||||
import com.raytheon.uf.common.datadelivery.registry.PointTime;
|
||||
|
@ -52,6 +54,7 @@ import com.raytheon.uf.viz.datadelivery.subscription.subset.xml.SubsetXML;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jun 04, 2013 223 mpduff Initial creation.
|
||||
* Jun 11, 2013 2064 mpduff Fix editing of subscriptions.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -176,13 +179,18 @@ public class PointSubsetManagerDlg extends
|
|||
sub.setTime(newTime);
|
||||
|
||||
Coverage cov = new Coverage();
|
||||
|
||||
cov.setEnvelope(dataSet.getCoverage().getEnvelope());
|
||||
setCoverage(sub, cov);
|
||||
|
||||
List<Parameter> paramList = new ArrayList<Parameter>();
|
||||
Map<String, Parameter> paramMap = dataSet.getParameters();
|
||||
List<DataLevelType> levelTypeList = new ArrayList<DataLevelType>();
|
||||
levelTypeList.add(new DataLevelType(DataLevelType.LevelType.SFC));
|
||||
for (String key : paramMap.keySet()) {
|
||||
paramList.add(paramMap.get(key));
|
||||
Parameter p = paramMap.get(key);
|
||||
p.setDataType(DataType.POINT);
|
||||
p.setLevelType(levelTypeList);
|
||||
paramList.add(p);
|
||||
}
|
||||
|
||||
sub.setParameter(paramList);
|
||||
|
|
|
@ -133,6 +133,7 @@ import com.raytheon.viz.ui.presenter.IDisplay;
|
|||
* May 21, 2013 2020 mpduff Rename UserSubscription to SiteSubscription.
|
||||
* May 28, 2013 1650 djohnson More information when failing to schedule subscriptions.
|
||||
* Jun 04, 2013 223 mpduff Moved data type specific code to sub classes.
|
||||
* Jun 11, 2013 2064 mpduff Fix editing of subscriptions.
|
||||
* </pre>
|
||||
*
|
||||
* @author mpduff
|
||||
|
@ -447,6 +448,8 @@ public abstract class SubsetManagerDlg<DATASET extends DataSet, PRESENTER extend
|
|||
launchCreateSubscriptionGui(createSubscription(
|
||||
new SiteSubscription(), Network.OPSNET));
|
||||
} else {
|
||||
setupCommonSubscriptionAttributes(subscription,
|
||||
subscription.getRoute());
|
||||
launchCreateSubscriptionGui(subscription);
|
||||
}
|
||||
}
|
||||
|
@ -549,8 +552,8 @@ public abstract class SubsetManagerDlg<DATASET extends DataSet, PRESENTER extend
|
|||
* The subscription object reference type
|
||||
* @param sub
|
||||
* The subscription to populate
|
||||
* @param the
|
||||
* route for the subscription
|
||||
* @param defaultRoute
|
||||
* the route for the subscription
|
||||
*
|
||||
* @return the populated subscription
|
||||
*/
|
||||
|
|
|
@ -76,6 +76,7 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
* May 15, 2013 1040 mpduff Using Set for office Ids.
|
||||
* May 20, 2013 2000 djohnson Add message to inform the user changes were applied.
|
||||
* Jun 04, 2013 223 mpduff Add point data stuff.
|
||||
* Jun 11, 2013 2064 mpduff Don't output Parameter header if none exist.
|
||||
* </pre>
|
||||
*
|
||||
* @author mpduff
|
||||
|
@ -696,7 +697,7 @@ public class DataDeliveryUtils {
|
|||
}
|
||||
|
||||
List<Parameter> parmArray = sub.getParameter();
|
||||
if (parmArray != null) {
|
||||
if (!CollectionUtil.isNullOrEmpty(parmArray)) {
|
||||
fmtStr.append("Parameters:").append(newline);
|
||||
for (Parameter p : parmArray) {
|
||||
fmtStr.append("------ Name: ").append(p.getName())
|
||||
|
|
Loading…
Add table
Reference in a new issue