Issue #2243 Fixed update list bugs.
Change-Id: Ie04d66593c450592c78fccdb8d6b78d889d4b68f Former-commit-id:d685125b25
[formerlyd685125b25
[formerly 4dcfd87f1ae127b8050a4c168a5acf0dd6c815ee]] Former-commit-id:49f488a58f
Former-commit-id:96c88ad28b
This commit is contained in:
parent
b5332f3eb5
commit
721b2c7c04
4 changed files with 35 additions and 33 deletions
|
@ -19,8 +19,6 @@
|
|||
**/
|
||||
package com.raytheon.viz.warngen.gui;
|
||||
|
||||
import java.util.Calendar;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.warning.AbstractWarningRecord;
|
||||
import com.raytheon.uf.common.dataplugin.warning.WarningRecord;
|
||||
import com.raytheon.uf.common.time.SimulatedTime;
|
||||
|
@ -37,7 +35,7 @@ import com.raytheon.uf.common.time.util.TimeUtil;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Initial creation
|
||||
* May 7, 2013 1973 rferrel Changes to properly display Issue Time.
|
||||
* Aug 7, 2013 2243 jsanchez Set all the attributes of an AbstractWarningRecord and added an expiration string.
|
||||
* Aug 7, 2013 2243 jsanchez Set all the attributes of an AbstractWarningRecord and added an expiration string. Removed calendar object.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -121,6 +119,8 @@ public class FollowupData extends WarningRecord {
|
|||
message = "Continuation no longer allowed; within 5 minutes of warning expiration.";
|
||||
} else if (action == WarningAction.EXP) {
|
||||
message = "Expiration no longer allowed; after 10 minutes of warning expiration.";
|
||||
} else if (action == WarningAction.EXT) {
|
||||
message = "Extention no longer allowed; within 5 minutes of warning expiration.";
|
||||
}
|
||||
return message;
|
||||
}
|
||||
|
@ -137,12 +137,11 @@ public class FollowupData extends WarningRecord {
|
|||
private String buildExpStr(WarningAction status,
|
||||
AbstractWarningRecord record) {
|
||||
StringBuilder rval = new StringBuilder();
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.setTime(SimulatedTime.getSystemTime().getTime());
|
||||
long timeInMillis = SimulatedTime.getSystemTime().getMillis();
|
||||
if (status != WarningAction.COR) {
|
||||
// Positive means not yet expired
|
||||
long diffMins = (record.getEndTime().getTimeInMillis() - cal
|
||||
.getTimeInMillis()) / TimeUtil.MILLIS_PER_MINUTE;
|
||||
long diffMins = (record.getEndTime().getTimeInMillis() - timeInMillis)
|
||||
/ TimeUtil.MILLIS_PER_MINUTE;
|
||||
if (diffMins == 0) {
|
||||
rval.append(" Expired");
|
||||
} else if (diffMins > 0) {
|
||||
|
@ -151,7 +150,7 @@ public class FollowupData extends WarningRecord {
|
|||
rval.append(" Exp ").append(-diffMins).append(" min ago");
|
||||
}
|
||||
} else {
|
||||
long diffMins = (cal.getTimeInMillis() - record.getIssueTime()
|
||||
long diffMins = (timeInMillis - record.getIssueTime()
|
||||
.getTimeInMillis()) / TimeUtil.MILLIS_PER_MINUTE;
|
||||
if (diffMins == 0) {
|
||||
rval.append(" Just Issued");
|
||||
|
|
|
@ -69,6 +69,8 @@ import com.raytheon.uf.common.status.IUFStatusHandler;
|
|||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
import com.raytheon.uf.common.time.SimulatedTime;
|
||||
import com.raytheon.uf.common.time.TimeRange;
|
||||
import com.raytheon.uf.common.time.util.TimeUtil;
|
||||
import com.raytheon.uf.viz.core.IDisplayPaneContainer;
|
||||
import com.raytheon.uf.viz.core.VizApp;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
|
@ -391,8 +393,7 @@ public class WarngenDialog extends CaveSWTDialog implements
|
|||
durationList.setLayoutData(gd);
|
||||
durationList.setEnabled(config.isEnableDuration());
|
||||
|
||||
startTime = Calendar.getInstance();
|
||||
startTime.setTime(SimulatedTime.getSystemTime().getTime());
|
||||
startTime = TimeUtil.newCalendar();
|
||||
endTime = DurationUtil.calcEndTime(this.startTime,
|
||||
defaultDuration.minutes);
|
||||
|
||||
|
@ -935,17 +936,23 @@ public class WarngenDialog extends CaveSWTDialog implements
|
|||
// Select the previously selected item.
|
||||
invalidFollowUpAction = false;
|
||||
if (currentSelection != null) {
|
||||
boolean isValid = false;
|
||||
for (int i = 0; i < updateListCbo.getItemCount(); i++) {
|
||||
if (updateListCbo.getItem(i).startsWith(
|
||||
currentSelection.getEquvialentString())) {
|
||||
updateListCbo.select(i);
|
||||
isValid = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isValid) {
|
||||
WarningAction action = WarningAction.valueOf(currentSelection
|
||||
.getAct());
|
||||
TimeRange timeRange = FollowUpUtil.getTimeRange(action,
|
||||
currentSelection);
|
||||
// Checks if selection is invalid based on the time range. A follow
|
||||
// up option could be removed due to an action such as a CAN or an
|
||||
// EXP. If an action removes the follow up, then no warning message
|
||||
// should be displayed.
|
||||
if (!timeRange.contains(SimulatedTime.getSystemTime().getTime())) {
|
||||
invalidFollowUpAction = true;
|
||||
preventFollowUpAction(currentSelection);
|
||||
}
|
||||
|
@ -1525,6 +1532,8 @@ public class WarngenDialog extends CaveSWTDialog implements
|
|||
} catch (VizException e1) {
|
||||
statusHandler.handle(Priority.PROBLEM, "WarnGen Error", e1);
|
||||
}
|
||||
// Properly sets the "Create Text" button.
|
||||
setInstructions();
|
||||
}
|
||||
|
||||
protected void recreateDurations(Combo durList) {
|
||||
|
@ -1901,14 +1910,12 @@ public class WarngenDialog extends CaveSWTDialog implements
|
|||
.getSelectionIndex()));
|
||||
if (fd == null
|
||||
|| (WarningAction.valueOf(fd.getAct()) == WarningAction.NEW)) {
|
||||
startTime = Calendar.getInstance();
|
||||
startTime.setTime(SimulatedTime.getSystemTime().getTime());
|
||||
startTime = TimeUtil.newCalendar();
|
||||
endTime = DurationUtil.calcEndTime(this.startTime, duration);
|
||||
start.setText(df.format(this.startTime.getTime()));
|
||||
end.setText(df.format(this.endTime.getTime()));
|
||||
} else if (WarningAction.valueOf(fd.getAct()) == WarningAction.EXT) {
|
||||
startTime = Calendar.getInstance();
|
||||
startTime.setTime(SimulatedTime.getSystemTime().getTime());
|
||||
startTime = TimeUtil.newCalendar();
|
||||
endTime = DurationUtil.calcEndTime(extEndTime, duration);
|
||||
end.setText(df.format(this.endTime.getTime()));
|
||||
}
|
||||
|
@ -2132,8 +2139,7 @@ public class WarngenDialog extends CaveSWTDialog implements
|
|||
.getItem(durationList.getSelectionIndex()))).minutes;
|
||||
warngenLayer.getStormTrackState().duration = duration;
|
||||
|
||||
startTime = Calendar.getInstance();
|
||||
startTime.setTime(SimulatedTime.getSystemTime().getTime());
|
||||
startTime = TimeUtil.newCalendar();
|
||||
extEndTime = newWarn.getEndTime();
|
||||
endTime = DurationUtil.calcEndTime(extEndTime, duration);
|
||||
end.setText(df.format(this.endTime.getTime()));
|
||||
|
|
|
@ -46,6 +46,7 @@ import com.raytheon.uf.common.status.UFStatus;
|
|||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
import com.raytheon.uf.common.time.SimulatedTime;
|
||||
import com.raytheon.uf.common.time.TimeRange;
|
||||
import com.raytheon.uf.common.time.util.TimeUtil;
|
||||
import com.raytheon.uf.viz.core.RecordFactory;
|
||||
import com.raytheon.uf.viz.core.alerts.AlertMessage;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
|
@ -256,9 +257,8 @@ public class CurrentWarnings {
|
|||
public List<AbstractWarningRecord> getCorrectableWarnings(
|
||||
AbstractWarningRecord warnRec) {
|
||||
List<AbstractWarningRecord> rval = new ArrayList<AbstractWarningRecord>();
|
||||
Calendar current = Calendar.getInstance();
|
||||
Calendar current = TimeUtil.newCalendar();
|
||||
Calendar end = Calendar.getInstance();
|
||||
current.setTime(SimulatedTime.getSystemTime().getTime());
|
||||
|
||||
synchronized (officeId) {
|
||||
List<AbstractWarningRecord> records = warningMap.get(toKey(
|
||||
|
@ -371,8 +371,7 @@ public class CurrentWarnings {
|
|||
List<AbstractWarningRecord> warnings = warningMap.get(toKey(
|
||||
phensig, etn));
|
||||
if (warnings != null) {
|
||||
Calendar c = Calendar.getInstance();
|
||||
c.setTime(SimulatedTime.getSystemTime().getTime());
|
||||
Calendar c = TimeUtil.newCalendar();
|
||||
c.add(Calendar.MINUTE, -10);
|
||||
TimeRange t = new TimeRange(c.getTime(), SimulatedTime
|
||||
.getSystemTime().getTime());
|
||||
|
@ -411,8 +410,7 @@ public class CurrentWarnings {
|
|||
AbstractWarningRecord newProd = null;
|
||||
boolean conMatchesCan = false;
|
||||
ArrayList<AbstractWarningRecord> conProds = new ArrayList<AbstractWarningRecord>();
|
||||
Calendar c = Calendar.getInstance();
|
||||
c.setTime(SimulatedTime.getSystemTime().getTime());
|
||||
Calendar c = TimeUtil.newCalendar();
|
||||
c.add(Calendar.MINUTE, -10);
|
||||
TimeRange t = new TimeRange(c.getTime(), SimulatedTime
|
||||
.getSystemTime().getTime());
|
||||
|
|
|
@ -12,9 +12,10 @@ import com.raytheon.uf.common.dataplugin.warning.WarningRecord.WarningAction;
|
|||
import com.raytheon.uf.common.dataplugin.warning.config.WarngenConfiguration;
|
||||
import com.raytheon.uf.common.time.SimulatedTime;
|
||||
import com.raytheon.uf.common.time.TimeRange;
|
||||
import com.raytheon.uf.common.time.util.TimeUtil;
|
||||
import com.raytheon.viz.warngen.gis.AffectedAreas;
|
||||
import com.raytheon.viz.warngen.gis.Direction;
|
||||
import com.raytheon.viz.warngen.gis.GisUtil;
|
||||
import com.raytheon.viz.warngen.gis.GisUtil.Direction;
|
||||
import com.raytheon.viz.warngen.text.ICommonPatterns;
|
||||
|
||||
/**
|
||||
|
@ -30,6 +31,7 @@ import com.raytheon.viz.warngen.text.ICommonPatterns;
|
|||
* Oct 18, 2012 15332 jsanchez Fixed refactor bugs.
|
||||
* Mar 13, 2013 DR 15892 D. Friedman Handle SMW format in canceledAreasFromText
|
||||
* Aug 6, 2013 2243 jsanchez Updated the time ranges to be removed from the follow up list correctly.
|
||||
* Aug 13, 2013 2243 jsanchez Removed calendar object.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -56,8 +58,6 @@ public class FollowUpUtil {
|
|||
WarningAction action) {
|
||||
|
||||
// Current Time
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.setTime(SimulatedTime.getSystemTime().getTime());
|
||||
|
||||
boolean rval = false;
|
||||
if (record == null) {
|
||||
|
@ -74,7 +74,8 @@ public class FollowUpUtil {
|
|||
for (String s : config.getFollowUps()) {
|
||||
WarningAction act = WarningAction.valueOf(s);
|
||||
if (act == action
|
||||
&& getTimeRange(act, record).contains(cal.getTime())
|
||||
&& getTimeRange(act, record).contains(
|
||||
SimulatedTime.getSystemTime().getTime())
|
||||
&& act != WarningAction.COR) {
|
||||
rval = true;
|
||||
}
|
||||
|
@ -310,10 +311,8 @@ public class FollowUpUtil {
|
|||
AbstractWarningRecord record) {
|
||||
/* Calendars for time calculations */
|
||||
|
||||
Calendar start = Calendar.getInstance();
|
||||
Calendar end = Calendar.getInstance();
|
||||
start.setTime(SimulatedTime.getSystemTime().getTime());
|
||||
end.setTime(SimulatedTime.getSystemTime().getTime());
|
||||
Calendar start = TimeUtil.newCalendar();
|
||||
Calendar end = TimeUtil.newCalendar();
|
||||
|
||||
TimeRange rval = null;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue