Issue #2243 Resolved timing issues.
Change-Id: Ia0386bf21087cb2a00175e35ecfeae5206797a34 Former-commit-id:78b655fd1f
[formerly2b849d7003
] [formerly78b655fd1f
[formerly2b849d7003
] [formerlybc30396b63
[formerly 5833ecad04c31502b4e2991853e6aabeda4919f2]]] Former-commit-id:bc30396b63
Former-commit-id:19853a4b57
[formerlyfca67fb4ca
] Former-commit-id:dbb60f2c13
This commit is contained in:
parent
0e62a4243e
commit
a1dc6ac50b
3 changed files with 25 additions and 20 deletions
|
@ -36,7 +36,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. Removed calendar object.
|
||||
*
|
||||
* Aug 15,2013 2243 jsanchez Improved the expiration string off by one minute.
|
||||
* </pre>
|
||||
*
|
||||
* @author rferrel
|
||||
|
@ -139,9 +139,11 @@ public class FollowupData extends WarningRecord {
|
|||
StringBuilder rval = new StringBuilder();
|
||||
long timeInMillis = SimulatedTime.getSystemTime().getMillis();
|
||||
if (status != WarningAction.COR) {
|
||||
// Positive means not yet expired
|
||||
long diffMins = (record.getEndTime().getTimeInMillis() - timeInMillis)
|
||||
/ TimeUtil.MILLIS_PER_MINUTE;
|
||||
// use double to keep precision until it's casted to an integer
|
||||
double diffMillis = record.getEndTime().getTimeInMillis()
|
||||
- timeInMillis;
|
||||
int diffMins = (int) Math.round(diffMillis
|
||||
/ TimeUtil.MILLIS_PER_MINUTE);
|
||||
if (diffMins == 0) {
|
||||
rval.append(" Expired");
|
||||
} else if (diffMins > 0) {
|
||||
|
@ -150,8 +152,12 @@ public class FollowupData extends WarningRecord {
|
|||
rval.append(" Exp ").append(-diffMins).append(" min ago");
|
||||
}
|
||||
} else {
|
||||
long diffMins = (timeInMillis - record.getIssueTime()
|
||||
.getTimeInMillis()) / TimeUtil.MILLIS_PER_MINUTE;
|
||||
// use double to keep precision until it's casted to an integer
|
||||
double diffMillis = timeInMillis
|
||||
- record.getIssueTime().getTimeInMillis();
|
||||
int diffMins = (int) Math.round(diffMillis
|
||||
/ TimeUtil.MILLIS_PER_MINUTE);
|
||||
|
||||
if (diffMins == 0) {
|
||||
rval.append(" Just Issued");
|
||||
} else {
|
||||
|
|
|
@ -936,6 +936,7 @@ public class WarngenDialog extends CaveSWTDialog implements
|
|||
// Select the previously selected item.
|
||||
invalidFollowUpAction = false;
|
||||
if (currentSelection != null) {
|
||||
// isValid checks if the current selection is still in the list
|
||||
boolean isValid = false;
|
||||
for (int i = 0; i < updateListCbo.getItemCount(); i++) {
|
||||
if (updateListCbo.getItem(i).startsWith(
|
||||
|
@ -954,7 +955,9 @@ public class WarngenDialog extends CaveSWTDialog implements
|
|||
// 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())) {
|
||||
if (!isValid
|
||||
&& !timeRange.contains(SimulatedTime.getSystemTime()
|
||||
.getTime())) {
|
||||
invalidFollowUpAction = true;
|
||||
preventFollowUpAction(currentSelection);
|
||||
}
|
||||
|
|
|
@ -32,6 +32,7 @@ import com.raytheon.viz.warngen.text.ICommonPatterns;
|
|||
* 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.
|
||||
* Aug 15, 2013 2243 jsanchez Reset the time ranges to the correct values.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -314,45 +315,40 @@ public class FollowUpUtil {
|
|||
|
||||
TimeRange rval = null;
|
||||
|
||||
// The time ranges are offset by 1 minute so that after a refresh and on
|
||||
// the final minute of the time range the follow up data will be
|
||||
// removed. For example, if a CON is only a available until 5 minutes
|
||||
// before a warnings expiration, when the time reaches 5 minutes the
|
||||
// follow up data for a CON is correctly removed.
|
||||
if (action == WarningAction.NEW) {
|
||||
/* Calculate NEW Time Range */
|
||||
start.setTime(record.getEndTime().getTime());
|
||||
start.add(Calendar.MINUTE, -21);
|
||||
start.add(Calendar.MINUTE, -20);
|
||||
end.setTime(record.getEndTime().getTime());
|
||||
end.add(Calendar.MINUTE, 29);
|
||||
end.add(Calendar.MINUTE, 30);
|
||||
rval = new TimeRange(start, end);
|
||||
} else if (action == WarningAction.COR) {
|
||||
/* Calculate COR Time Range */
|
||||
end.setTime(record.getIssueTime().getTime());
|
||||
end.add(Calendar.MINUTE, 9);
|
||||
end.add(Calendar.MINUTE, 10);
|
||||
rval = new TimeRange(record.getStartTime(), end);
|
||||
} else if (action == WarningAction.CAN) {
|
||||
/* Calculate CAN Time Range */
|
||||
end.setTime(record.getEndTime().getTime());
|
||||
end.add(Calendar.MINUTE, -11);
|
||||
end.add(Calendar.MINUTE, -10);
|
||||
rval = new TimeRange(record.getStartTime(), end);
|
||||
} else if (action == WarningAction.CON) {
|
||||
/* Calculate CON Time Range */
|
||||
end.setTime(record.getEndTime().getTime());
|
||||
end.add(Calendar.MINUTE, -6);
|
||||
end.add(Calendar.MINUTE, -5);
|
||||
rval = new TimeRange(record.getStartTime(), end);
|
||||
} else if (action == WarningAction.EXP) {
|
||||
/* Calculate EXP Time Range */
|
||||
start.setTime(record.getEndTime().getTime());
|
||||
start.add(Calendar.MINUTE, -11);
|
||||
start.add(Calendar.MINUTE, -10);
|
||||
end.setTime(record.getEndTime().getTime());
|
||||
end.add(Calendar.MINUTE, 9);
|
||||
end.add(Calendar.MINUTE, 10);
|
||||
rval = new TimeRange(start, end);
|
||||
} else if (action == WarningAction.EXT) {
|
||||
/* Calculate EXT Time Range */
|
||||
start.setTime(record.getStartTime().getTime());
|
||||
end.setTime(record.getEndTime().getTime());
|
||||
end.add(Calendar.MINUTE, -6);
|
||||
end.add(Calendar.MINUTE, -5);
|
||||
rval = new TimeRange(start, end);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue