From 0a7acf96c7a891f83cd998888bb9b2f41292e293 Mon Sep 17 00:00:00 2001 From: Steve Harris Date: Thu, 22 Aug 2013 09:12:43 -0400 Subject: [PATCH] 13.5.1-18 baseline Former-commit-id: f407ad6db2f621a5be95939aea88f49d874d1ab6 --- .../viz/warngen/gui/FollowupData.java | 33 +- .../viz/warngen/gui/WarngenDialog.java | 158 +- .../viz/warngen/util/CurrentWarnings.java | 10 +- .../viz/warngen/util/FollowUpUtil.java | 37 +- .../WarningDecoder.py | 3 +- .../uf/edex/distribution/DistributionSrv.java | 17 +- .../quartz/ClusteredQuartzEndpoint.java | 3 +- nativeLib/build.native/build-notification.sh | 7 - nativeLib/edexBridge/.cproject | 832 +++--- nativeLib/edexBridge/edexBridge.cpp | 147 +- nativeLib/edex_com/.cproject | 2255 ++++++----------- nativeLib/edex_com/.gitignore | 1 + nativeLib/edex_com/src/EdexNotification.cpp | 126 +- nativeLib/edex_com/src/EdexNotification.h | 17 +- nativeLib/edex_notify/.cproject | 758 ++---- nativeLib/edex_notify/.gitignore | 1 + rpms/awips2.core/Installer.ldm/component.spec | 13 +- .../patch/ld.so.conf.d/awips2-ldm-i386.conf | 2 + .../Installer.notification/component.spec | 1 + .../scripts/profile.d/awips2Notification.csh | 5 +- .../scripts/profile.d/awips2Notification.sh | 19 +- rpms/awips2.qpid/0.18/SPECS/qpid-lib.spec | 122 + rpms/awips2.qpid/0.18/deploy.builder/build.sh | 9 + rpms/build/common/rpms.sh | 76 +- rpms/build/i386/build.sh | 1 + 25 files changed, 1962 insertions(+), 2691 deletions(-) create mode 100644 rpms/awips2.qpid/0.18/SPECS/qpid-lib.spec diff --git a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gui/FollowupData.java b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gui/FollowupData.java index e8b162f040..35fd981c79 100644 --- a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gui/FollowupData.java +++ b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gui/FollowupData.java @@ -19,10 +19,8 @@ **/ 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.dataplugin.warning.WarningRecord.WarningAction; import com.raytheon.uf.common.time.SimulatedTime; import com.raytheon.uf.common.time.util.TimeUtil; @@ -37,14 +35,14 @@ 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. + * Aug 15,2013 2243 jsanchez Improved the expiration string off by one minute. Fixed for practice mode. * * * @author rferrel * @version 1.0 */ -public class FollowupData extends WarningRecord { +public class FollowupData extends AbstractWarningRecord { private static final long serialVersionUID = 1L; @@ -65,7 +63,7 @@ public class FollowupData extends WarningRecord { private String expirationString; public FollowupData(WarningAction action, AbstractWarningRecord record) { - super((WarningRecord) record); + super(record); setAct(action.toString()); displayString = createDisplayString(action, record); @@ -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,13 @@ 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; + // 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) { @@ -151,8 +152,12 @@ public class FollowupData extends WarningRecord { rval.append(" Exp ").append(-diffMins).append(" min ago"); } } else { - long diffMins = (cal.getTimeInMillis() - 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 { diff --git a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gui/WarngenDialog.java b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gui/WarngenDialog.java index a43b94bdf7..02b319c787 100644 --- a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gui/WarngenDialog.java +++ b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gui/WarngenDialog.java @@ -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; @@ -192,11 +194,11 @@ public class WarngenDialog extends CaveSWTDialog implements final DateFormat df = new SimpleDateFormat("HH:mm EEE d-MMM"); - private java.util.List mapsLoaded = new ArrayList(); + private final java.util.List mapsLoaded = new ArrayList(); private Button okButton; - private BulletListManager bulletListManager; + private final BulletListManager bulletListManager; private List bulletList; @@ -276,7 +278,7 @@ public class WarngenDialog extends CaveSWTDialog implements private boolean invalidFollowUpAction = false; - private IWarngenObserver wed = new WarningSender(); + private final IWarngenObserver wed = new WarningSender(); public WarngenDialog(Shell parentShell, WarngenLayer layer) { super(parentShell, SWT.CLOSE | SWT.MODELESS | SWT.BORDER | SWT.TITLE, @@ -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); @@ -480,7 +481,7 @@ public class WarngenDialog extends CaveSWTDialog implements String defaultTemplate = warngenLayer.getDialogConfig() .getDefaultTemplate(); - if (defaultTemplate == null || defaultTemplate.equals("")) { + if ((defaultTemplate == null) || defaultTemplate.equals("")) { defaultTemplate = mainProducts.get(0).split("/")[1]; } @@ -819,7 +820,7 @@ public class WarngenDialog extends CaveSWTDialog implements createTextButtonEnabled = false; } else if (warngenLayer.getStormTrackState().mode == Mode.NONE) { createTextButtonEnabled = false; - } else if (warngenLayer.getPolygon() == null + } else if ((warngenLayer.getPolygon() == null) || warngenLayer.getPolygon().isEmpty()) { str += WarngenConstants.INSTRUCTION_NO_SHADED_AREA; createTextButtonEnabled = false; @@ -888,9 +889,9 @@ public class WarngenDialog extends CaveSWTDialog implements newYes = true; } else if (act == WarningAction.EXT) { extYes = true; - } else if (act == WarningAction.CON - || act == WarningAction.CAN - || act == WarningAction.EXP) { + } else if ((act == WarningAction.CON) + || (act == WarningAction.CAN) + || (act == WarningAction.EXP)) { follow = true; } else if (act == WarningAction.COR) { corYes = true; @@ -935,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( @@ -945,7 +947,17 @@ public class WarngenDialog extends CaveSWTDialog implements } } - 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 (!isValid + && !timeRange.contains(SimulatedTime.getSystemTime() + .getTime())) { invalidFollowUpAction = true; preventFollowUpAction(currentSelection); } @@ -1033,13 +1045,13 @@ public class WarngenDialog extends CaveSWTDialog implements return; } - if (followupData != null - && WarningAction.valueOf(followupData.getAct()) == WarningAction.NEW) { + if ((followupData != null) + && (WarningAction.valueOf(followupData.getAct()) == WarningAction.NEW)) { redrawFromWarned(); } - if ((followupData == null || (WarningAction.valueOf(followupData - .getAct()) == WarningAction.CON && warngenLayer + if (((followupData == null) || ((WarningAction.valueOf(followupData + .getAct()) == WarningAction.CON) && warngenLayer .conWarnAreaChanged(followupData))) && !polygonLocked) { redrawFromWarned(); @@ -1054,6 +1066,7 @@ public class WarngenDialog extends CaveSWTDialog implements try { pmd.run(false, false, new IRunnableWithProgress() { + @Override public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { try { @@ -1123,7 +1136,7 @@ public class WarngenDialog extends CaveSWTDialog implements private boolean checkDamSelection() { if (bulletListManager.isDamNameSeletcted() - && bulletListManager.isDamCauseSelected() == false) { + && (bulletListManager.isDamCauseSelected() == false)) { /* * On WES 'Instructions' became 'Warning' but didn't prevent a * created text @@ -1144,9 +1157,9 @@ public class WarngenDialog extends CaveSWTDialog implements } private void updateWarngenUIState(String result) { - if (VtecUtil.parseMessage(result) != null - && WarningAction.valueOf(VtecUtil.parseMessage(result) - .getAction()) != WarningAction.NEW) { + if ((VtecUtil.parseMessage(result) != null) + && (WarningAction.valueOf(VtecUtil.parseMessage(result) + .getAction()) != WarningAction.NEW)) { // TODO Use warningsArrived method to set old // polygon and warning area warngenLayer.state.setOldWarningPolygon((Polygon) warngenLayer @@ -1161,7 +1174,7 @@ public class WarngenDialog extends CaveSWTDialog implements // An error dialog is to appear if a user tries to press Create Text // again after a product was issued.AWIPS I does not auto update their // update list, this is their solution. - if (followupData != null && totalSegments > 1) { + if ((followupData != null) && (totalSegments > 1)) { multiSegmentMessage(followupData.getEquvialentString()); return false; } @@ -1229,8 +1242,8 @@ public class WarngenDialog extends CaveSWTDialog implements warngenLayer.getStormTrackState().mode = Mode.TRACK; warngenLayer.lastMode = Mode.DRAG_ME; } - if (warngenLayer.getConfiguration().isTrackEnabled() == false - || warngenLayer.getConfiguration().getPathcastConfig() == null) { + if ((warngenLayer.getConfiguration().isTrackEnabled() == false) + || (warngenLayer.getConfiguration().getPathcastConfig() == null)) { warngenLayer.getStormTrackState().setInitiallyMotionless(true); } warngenLayer.resetInitialFrame(); @@ -1250,8 +1263,8 @@ public class WarngenDialog extends CaveSWTDialog implements * Action for when something is selected from the backup site combo */ private void backupSiteSelected() { - if (backupSiteCbo.getSelectionIndex() >= 0 - && backupSiteCbo.getItemCount() > 0) { + if ((backupSiteCbo.getSelectionIndex() >= 0) + && (backupSiteCbo.getItemCount() > 0)) { warngenLayer.setBackupSite(backupSiteCbo.getItems()[backupSiteCbo .getSelectionIndex()]); // Refresh template @@ -1359,8 +1372,8 @@ public class WarngenDialog extends CaveSWTDialog implements DamInfoBullet damBullet = bulletListManager.getSelectedDamInfoBullet(); if (damBullet != null) { - if (damBullet.getCoords() == null - || damBullet.getCoords().length() == 0) { + if ((damBullet.getCoords() == null) + || (damBullet.getCoords().length() == 0)) { damBreakInstruct = "LAT...LON can not be found in 'coords' parameter"; } else { ArrayList coordinates = new ArrayList(); @@ -1373,8 +1386,8 @@ public class WarngenDialog extends CaveSWTDialog implements if (m.find()) { m = latLonPtrn.matcher(damBullet.getCoords()); while (m.find()) { - coordinates.add(new Coordinate(-1 - * Double.parseDouble(m.group(2)) / 100, Double + coordinates.add(new Coordinate((-1 * Double + .parseDouble(m.group(2))) / 100, Double .parseDouble(m.group(1)) / 100)); } @@ -1440,8 +1453,9 @@ public class WarngenDialog extends CaveSWTDialog implements private void changeTemplate(String templateName) { // DR 14515 - if (templateName.equals(warngenLayer.getTemplateName())) + if (templateName.equals(warngenLayer.getTemplateName())) { return; + } String lastAreaSource = warngenLayer.getConfiguration() .getHatchedAreaSource().getAreaSource(); @@ -1495,9 +1509,9 @@ public class WarngenDialog extends CaveSWTDialog implements .getSelection() ? DisplayType.POLY : DisplayType.POINT; } warngenLayer.getStormTrackState().setInitiallyMotionless( - warngenLayer.getConfiguration().isTrackEnabled() == false - || warngenLayer.getConfiguration() - .getPathcastConfig() == null); + (warngenLayer.getConfiguration().isTrackEnabled() == false) + || (warngenLayer.getConfiguration() + .getPathcastConfig() == null)); if (warngenLayer.getStormTrackState().isInitiallyMotionless()) { warngenLayer.getStormTrackState().speed = 0; warngenLayer.getStormTrackState().angle = 0; @@ -1525,6 +1539,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) { @@ -1598,10 +1614,10 @@ public class WarngenDialog extends CaveSWTDialog implements // (AWIPS 1) if (warngenLayer.state.followupData != null) { if (data.equals(warngenLayer.state.followupData)) { - if (WarningAction + if ((WarningAction .valueOf(warngenLayer.state.followupData - .getAct()) == WarningAction.CON - && totalSegments > 1) { + .getAct()) == WarningAction.CON) + && (totalSegments > 1)) { sameProductMessage(warngenLayer.state.followupData .getEquvialentString()); } @@ -1668,7 +1684,7 @@ public class WarngenDialog extends CaveSWTDialog implements if (warngenLayer.getConfiguration().getEnableDamBreakThreat()) { for (BulletActionGroup bulletActionGroup : warngenLayer .getConfiguration().getBulletActionGroups()) { - if (bulletActionGroup.getAction() != null + if ((bulletActionGroup.getAction() != null) && bulletActionGroup.getAction().equals( data.getAct())) { warngenLayer.getConfiguration().setDamInfoBullets( @@ -1689,14 +1705,14 @@ public class WarngenDialog extends CaveSWTDialog implements bulletListManager.recreateBulletsFromFollowup( warngenLayer.getConfiguration(), action, oldWarning); if (bulletListManager.isDamNameSeletcted() - && action != WarningAction.NEW) { + && (action != WarningAction.NEW)) { setPolygonLocked(true); } } refreshBulletList(); recreateUpdates(); - if (action == null || action == WarningAction.NEW - || action == WarningAction.EXT) { + if ((action == null) || (action == WarningAction.NEW) + || (action == WarningAction.EXT)) { recreateDurations(durationList); } } @@ -1731,7 +1747,7 @@ public class WarngenDialog extends CaveSWTDialog implements } private void changeSelected() { - if (validPeriodDlg == null || validPeriodDlg.isDisposed()) { + if ((validPeriodDlg == null) || validPeriodDlg.isDisposed()) { validPeriodDlg = new ValidPeriodDialog(shell, startTime, endTime); validPeriodDlg.setCloseCallback(new ICloseCallback() { @@ -1836,6 +1852,7 @@ public class WarngenDialog extends CaveSWTDialog implements public void run() { getDisplay().syncExec(new Runnable() { + @Override public void run() { try { changeStartEndTimes(); @@ -1862,6 +1879,7 @@ public class WarngenDialog extends CaveSWTDialog implements public void run() { getDisplay().syncExec(new Runnable() { + @Override public void run() { try { recreateUpdates(); @@ -1877,7 +1895,7 @@ public class WarngenDialog extends CaveSWTDialog implements // Update the follow up list every minute long currentTimeInSeconds = SimulatedTime.getSystemTime().getMillis() / 1000; long secondsToNextMinute = 0; - if (currentTimeInSeconds % 60 != 0) { + if ((currentTimeInSeconds % 60) != 0) { secondsToNextMinute = 60 - (currentTimeInSeconds % 60); } timer.schedule(recreateUpdatesTask, secondsToNextMinute * 1000, @@ -1899,16 +1917,14 @@ public class WarngenDialog extends CaveSWTDialog implements FollowupData fd = (FollowupData) updateListCbo .getData(updateListCbo.getItem(updateListCbo .getSelectionIndex())); - if (fd == null + 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 +2148,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())); @@ -2172,7 +2187,7 @@ public class WarngenDialog extends CaveSWTDialog implements * Set the shell to visible and then move it on top of the CAVE dialog. */ public void showDialog(boolean show) { - if (shell != null && shell.isDisposed() == false) { + if ((shell != null) && (shell.isDisposed() == false)) { if (show) { if (shell.isVisible() == false) { shell.setVisible(true); @@ -2259,8 +2274,9 @@ public class WarngenDialog extends CaveSWTDialog implements Polygon rval = gf.createPolygon(gf.createLinearRing(points .toArray(new Coordinate[points.size()])), null); - if (adjusted) + if (adjusted) { oldWarning.setGeometry(rval); + } boolean invalidPolyFlag = false; if (rval.isValid() == false) { @@ -2285,10 +2301,12 @@ public class WarngenDialog extends CaveSWTDialog implements int size = coords.length; java.util.List coords2 = new ArrayList(); coords2.add(coords[0]); - for (int i = 1; i < size; i++) - if (Math.abs(coords[i].x - coords[i - 1].x) > MIN_LATLON_DIFF - || Math.abs(coords[i].y - coords[i - 1].y) > MIN_LATLON_DIFF) + for (int i = 1; i < size; i++) { + if ((Math.abs(coords[i].x - coords[i - 1].x) > MIN_LATLON_DIFF) + || (Math.abs(coords[i].y - coords[i - 1].y) > MIN_LATLON_DIFF)) { coords2.add(coords[i]); + } + } size = coords2.size(); Coordinate[] coords3 = coords2.toArray(new Coordinate[size]); return coords3; @@ -2301,7 +2319,7 @@ public class WarngenDialog extends CaveSWTDialog implements double diffx1, diffx2, diffy1, diffy2; double ratio1, ratio2; boolean adjusted = false; - for (int i = 2; i < coords.length - 2; i++) { + for (int i = 2; i < (coords.length - 2); i++) { diffx1 = coords[i - 1].x - coords[i].x; if (Math.abs(diffx1) > MIN_LATLON_DIFF) { ratio1 = (coords[i - 1].y - coords[i].y) / diffx1; @@ -2309,8 +2327,8 @@ public class WarngenDialog extends CaveSWTDialog implements if (Math.abs(diffx2) > MIN_LATLON_DIFF) { ratio2 = (coords[i].y - coords[i + 1].y) / diffx2; if (Math.abs(ratio1 - ratio2) < MIN_DIFF) { - if (diffx1 > 0.0 && diffx2 > 0.0 || diffx1 < 0.0 - && diffx2 < 0.0) { + if (((diffx1 > 0.0) && (diffx2 > 0.0)) + || ((diffx1 < 0.0) && (diffx2 < 0.0))) { // three vertices on a straight line. Not overlaid. } else { // two segments overlaid @@ -2328,8 +2346,8 @@ public class WarngenDialog extends CaveSWTDialog implements if (Math.abs(diffy2) > MIN_LATLON_DIFF) { ratio2 = (coords[i].x - coords[i + 1].x) / diffy2; if (Math.abs(ratio1 - ratio2) < MIN_DIFF) { - if (diffy1 > 0.0 && diffy2 > 0.0 || diffy1 < 0.0 - && diffy2 < 0.0) { + if (((diffy1 > 0.0) && (diffy2 > 0.0)) + || ((diffy1 < 0.0) && (diffy2 < 0.0))) { // three vertices on a straight line. Not overlaid. } else { // two segments overlaid @@ -2361,29 +2379,33 @@ public class WarngenDialog extends CaveSWTDialog implements if (Math.abs(diffx) > MIN_LATLON_DIFF) { if (coords[i - 1].y > coords[i].y) { factor = 1; - } else + } else { factor = -1; + } if (diffx < 0.0) { coords[i + 1].x -= factor * adjustedValue; } else { coords[i - 1].x += factor * adjustedValue; } - if (i == n - 3) + if (i == (n - 3)) { coords[0].x = coords[i - 1].x; + } } else { diffx = coords[i + 2].x - coords[i + 1].x; if (Math.abs(diffx) > MIN_LATLON_DIFF) { if (coords[i + 1].y > coords[i].y) { factor = -1; - } else + } else { factor = 1; + } if (diffx < 0.0) { coords[i - 1].x -= factor * adjustedValue; } else { coords[i + 1].x += factor * adjustedValue; } - if (i == n - 3) + if (i == (n - 3)) { coords[0].x = coords[i - 1].x; + } } } } else { @@ -2392,29 +2414,33 @@ public class WarngenDialog extends CaveSWTDialog implements if (Math.abs(diffy) > MIN_LATLON_DIFF) { if (coords[i - 1].x > coords[i].x) { factor = -1; - } else + } else { factor = 1; + } if (diffy > 0.0) { coords[i + 1].y -= factor * adjustedValue; } else { coords[i - 1].y += factor * adjustedValue; } - if (i == n - 3) + if (i == (n - 3)) { coords[0].y = coords[i - 1].y; + } } else { diffy = coords[i + 2].y - coords[i + 1].y; if (Math.abs(diffy) > MIN_LATLON_DIFF) { if (coords[i + 1].x > coords[i].x) { factor = -1; - } else + } else { factor = 1; + } if (diffy < 0.0) { coords[i - 1].y -= factor * adjustedValue; } else { coords[i + 1].y += factor * adjustedValue; } - if (i == n - 3) + if (i == (n - 3)) { coords[0].y = coords[i - 1].y; + } } } } diff --git a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/util/CurrentWarnings.java b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/util/CurrentWarnings.java index e4e97143a7..4588f44669 100644 --- a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/util/CurrentWarnings.java +++ b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/util/CurrentWarnings.java @@ -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; @@ -258,9 +259,8 @@ public class CurrentWarnings { public List getCorrectableWarnings( AbstractWarningRecord warnRec) { List rval = new ArrayList(); - Calendar current = Calendar.getInstance(); + Calendar current = TimeUtil.newCalendar(); Calendar end = Calendar.getInstance(); - current.setTime(SimulatedTime.getSystemTime().getTime()); synchronized (officeId) { List records = warningMap.get(toKey( @@ -373,8 +373,7 @@ public class CurrentWarnings { List 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()); @@ -413,8 +412,7 @@ public class CurrentWarnings { AbstractWarningRecord newProd = null; boolean conMatchesCan = false; ArrayList conProds = new ArrayList(); - 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()); diff --git a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/util/FollowUpUtil.java b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/util/FollowUpUtil.java index 34ed5ab3ac..04b3dca957 100644 --- a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/util/FollowUpUtil.java +++ b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/util/FollowUpUtil.java @@ -12,6 +12,7 @@ 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.GisUtil; import com.raytheon.viz.warngen.gis.GisUtil.Direction; @@ -30,6 +31,8 @@ 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. + * Aug 15, 2013 2243 jsanchez Reset the time ranges to the correct values. * * * @@ -55,10 +58,6 @@ public class FollowUpUtil { WarngenConfiguration config, AbstractWarningRecord record, WarningAction action) { - // Current Time - Calendar cal = Calendar.getInstance(); - cal.setTime(SimulatedTime.getSystemTime().getTime()); - boolean rval = false; if (record == null) { return rval; @@ -74,7 +73,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,52 +310,45 @@ 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; - // 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); } diff --git a/edexOsgi/com.raytheon.edex.plugin.warning/WarningDecoder.py b/edexOsgi/com.raytheon.edex.plugin.warning/WarningDecoder.py index e08ef12a8f..3c051d366c 100644 --- a/edexOsgi/com.raytheon.edex.plugin.warning/WarningDecoder.py +++ b/edexOsgi/com.raytheon.edex.plugin.warning/WarningDecoder.py @@ -34,6 +34,7 @@ # Feb 19, 2013 1636 rferrel Use TimeTools to get file timestamp. # May 07, 2013 1973 rferrel Adjust Issue and Purge times to be relative to start time. # Jun 24, 2013 DR 16317 D. Friedman If no storm line, parse storm motion from event text. +# Aug 21, 2013 DR16501 m.gamazaychikov Adjusted calculation of Purge time in NoVTECWarningDecoder. # # # @author rferrel @@ -986,7 +987,7 @@ class NoVTECWarningDecoder(StdWarningDecoder): if self._officeFromWMO: template['officeid'] = self._officeFromWMO - template['purgeTime'] = long(purgeTime * 1000) + template['purgeTime'] = long(self._dtgFromDDHHMM(purgeTime, self._issueTime)*1000) template['issueTime'] = long(self._issueTime * 1000) template['state'] = "Decoded" template['xxxid'] = self._completeProductPil[3:] diff --git a/edexOsgi/com.raytheon.uf.edex.distribution/src/com/raytheon/uf/edex/distribution/DistributionSrv.java b/edexOsgi/com.raytheon.uf.edex.distribution/src/com/raytheon/uf/edex/distribution/DistributionSrv.java index 6d0cd35200..d613a2c985 100644 --- a/edexOsgi/com.raytheon.uf.edex.distribution/src/com/raytheon/uf/edex/distribution/DistributionSrv.java +++ b/edexOsgi/com.raytheon.uf.edex.distribution/src/com/raytheon/uf/edex/distribution/DistributionSrv.java @@ -61,6 +61,7 @@ import com.raytheon.uf.common.status.UFStatus.Priority; * Feb 27, 2013 1638 mschenke Cleaned up localization code to fix null pointer * when no distribution files present * Mar 19, 2013 1794 djohnson PatternWrapper is immutable, add toString() to it for debugging. + * Aug 19, 2013 2257 bkowal edexBridge to qpid 0.18 upgrade * * * @@ -73,6 +74,8 @@ public class DistributionSrv { private static final IUFStatusHandler statusHandler = UFStatus .getHandler(DistributionSrv.class); + private static final String HEADER_QPID_SUBJECT = "qpid.subject"; + private static class PatternWrapper { private final String plugin; @@ -223,7 +226,15 @@ public class DistributionSrv { StringBuilder pluginNames = new StringBuilder(); List dest = new ArrayList(); Message in = exchange.getIn(); - String header = (String) in.getHeader("header"); + // determine if the header is in the qpid subject field? + String header = (String) in.getHeader(HEADER_QPID_SUBJECT); + if (header != null) { + // make the qpid subject the header so that everything downstream + // will be able to read it as the header. + in.setHeader("header", header); + } + + header = (String) in.getHeader("header"); Object payload = in.getBody(); String bodyString = null; if (payload instanceof byte[]) { @@ -277,8 +288,8 @@ public class DistributionSrv { throws DistributionException { RequestPatterns patternSet = null; try { - patternSet = SerializationUtil - .jaxbUnmarshalFromXmlFile(RequestPatterns.class, modelFile.getPath()); + patternSet = SerializationUtil.jaxbUnmarshalFromXmlFile( + RequestPatterns.class, modelFile.getPath()); } catch (Exception e) { throw new DistributionException("File " + modelFile.getAbsolutePath() diff --git a/edexOsgi/com.raytheon.uf.edex.esb.camel/src/com/raytheon/uf/edex/esb/camel/cluster/quartz/ClusteredQuartzEndpoint.java b/edexOsgi/com.raytheon.uf.edex.esb.camel/src/com/raytheon/uf/edex/esb/camel/cluster/quartz/ClusteredQuartzEndpoint.java index 4a205c7e9e..2d852ff443 100644 --- a/edexOsgi/com.raytheon.uf.edex.esb.camel/src/com/raytheon/uf/edex/esb/camel/cluster/quartz/ClusteredQuartzEndpoint.java +++ b/edexOsgi/com.raytheon.uf.edex.esb.camel/src/com/raytheon/uf/edex/esb/camel/cluster/quartz/ClusteredQuartzEndpoint.java @@ -39,6 +39,7 @@ import com.raytheon.uf.edex.database.cluster.ClusterTask; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Feb 19, 2010 njensen Initial creation + * Aug 21, 2013 DR 16521 D. Friedman Ensure endpoint URI is used for cluster entry * * * @@ -61,7 +62,7 @@ public class ClusteredQuartzEndpoint extends QuartzEndpoint { @Override public void onJobExecute(final JobExecutionContext jobExecutionContext) throws JobExecutionException { - String jName = jobExecutionContext.getJobDetail().getName(); + String jName = getEndpointUri(); long period = Math.abs(jobExecutionContext.getFireTime().getTime() - jobExecutionContext.getNextFireTime().getTime()) / 2; ClusterTask ct = ClusterLockUtils.lock(TASK, jName, period, false); diff --git a/nativeLib/build.native/build-notification.sh b/nativeLib/build.native/build-notification.sh index 2bb5a68c36..4517812a8e 100644 --- a/nativeLib/build.native/build-notification.sh +++ b/nativeLib/build.native/build-notification.sh @@ -197,12 +197,5 @@ if [ $? -ne 0 ]; then echo "ERROR: Failed to copy the org.apache.thrift lib to its destination." exit 1 fi -# org.apache.qpid lib -> notification/lib -cp -vPf ${BUILD_ROOT}/workspace_/org.apache.qpid/${FOSS_LIB_DIR}/* \ - ${BUILD_ROOT}/awips2/notification/${FOSS_LIB_DIR} -if [ $? -ne 0 ]; then - echo "ERROR: Failed to copy the org.apache.qpid lib to its destination." - exit 1 -fi exit 0 diff --git a/nativeLib/edexBridge/.cproject b/nativeLib/edexBridge/.cproject index e46d10c81d..d6e0bcb04b 100644 --- a/nativeLib/edexBridge/.cproject +++ b/nativeLib/edexBridge/.cproject @@ -26,7 +26,7 @@