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