From d7ff8a2638b25a22104a5b161cebcfd9e3d22d4e Mon Sep 17 00:00:00 2001 From: "steve.naples" Date: Tue, 24 Jun 2014 15:52:23 +0000 Subject: [PATCH 01/39] ASM #253 Update RadarBiasTableDialog to allow undo changes. Change-Id: Ibfb87730fda8185b27777fd83606bc1397aca1f9 Former-commit-id: e994aa9482258b63ab28bfee1bc6e74c38e51139 [formerly 2a49bbda2fe339ac479bf141412d929f2e1f58ae] [formerly efe877d82be7a9e030aa58bf8b731bdeddc04d3a] [formerly e994aa9482258b63ab28bfee1bc6e74c38e51139 [formerly 2a49bbda2fe339ac479bf141412d929f2e1f58ae] [formerly efe877d82be7a9e030aa58bf8b731bdeddc04d3a] [formerly 90ed51147841979edd62e453ab8592c4e6121706 [formerly efe877d82be7a9e030aa58bf8b731bdeddc04d3a [formerly fcd20d35abf3617701cc797baf9ba2b3984379c8]]]] Former-commit-id: 90ed51147841979edd62e453ab8592c4e6121706 Former-commit-id: b8d5f833ec5caf5872551552e4602d1cbb9822c1 [formerly 2e77b74c440b279ad3b8f0d22583d42abad7120d] [formerly f502e650f306b12ad50f762f688616a9b1039de1 [formerly 362e1ce8801be74f935eda0fce4c9dd29f58e31f]] Former-commit-id: d75382cb3e72ed1c52902aa0d9f71c8e7e9c77f6 [formerly 5dcda5cabc38f57655b00c8c2a710590d36782dc] Former-commit-id: 363887905783e2644ba3424b834c1b7cee847066 --- .../mpe/ui/dialogs/RadarBiasTableDialog.java | 74 ++++++++++++------- 1 file changed, 49 insertions(+), 25 deletions(-) diff --git a/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/dialogs/RadarBiasTableDialog.java b/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/dialogs/RadarBiasTableDialog.java index 98514b0d00..27033ba814 100644 --- a/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/dialogs/RadarBiasTableDialog.java +++ b/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/dialogs/RadarBiasTableDialog.java @@ -23,6 +23,7 @@ import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; +import java.util.Iterator; import java.util.Map; import java.util.TimeZone; @@ -72,7 +73,7 @@ import com.raytheon.viz.mpe.ui.radartable.ReadBiasTableParam; * Feb 2, 2014 16201 snaples Added saved data flag support * Apr 4, 2014 17223 snaples Updated other_office_id and rfc_bias to object * array so that called procedure can update and return values properly. - * + * May 1, 2014 16626 snaples Updated the Manual Bias button to allow revert to original value. * * * @author snaples @@ -147,6 +148,10 @@ public class RadarBiasTableDialog extends Dialog { Button mbiasBtn = null; Button[] manEdit = null; + + Text[] lbTxts = null; + + private final Map biasChgs = new HashMap(); static { sdf.setTimeZone(TimeZone.getTimeZone("GMT")); @@ -343,7 +348,7 @@ public class RadarBiasTableDialog extends Dialog { dt = pgsdf.format(dt3); rsList = new HashMap(radIds.length); rsList = MPEDataManager.getInstance().readRadarData(dt3); - Text[] lbTxts = new Text[radIds.length]; + lbTxts = new Text[radIds.length]; manEdit = new Button[radIds.length]; for (int i = 0; i < radIds.length; i++) { @@ -398,9 +403,10 @@ public class RadarBiasTableDialog extends Dialog { }); - bias = String.format("%-1.2f", radarresultdata.getRwBiasValUsed()); oldbias[i] = (float) radarresultdata.getRwBiasValUsed(); editbias[i] = 0.0f; + editbias[i] = oldbias[i]; + bias = String.format("%-1.2f", editbias[i]); gd = new GridData(SWT.FILL, SWT.CENTER, true, true); final Text lbiasTxt = new Text(biasListComp, SWT.SINGLE @@ -442,16 +448,36 @@ public class RadarBiasTableDialog extends Dialog { lbTxts[i] = lbiasTxt; gd = new GridData(SWT.FILL, SWT.CENTER, true, true); - mbiasBtn = new Button(biasListComp, SWT.TOGGLE | SWT.READ_ONLY); - // mbiasBtn.setEnabled(false); + final Button mbiasBtn = new Button(biasListComp, SWT.TOGGLE); mbias = ("n".equalsIgnoreCase(radarresultdata.getEditBias()) || radarresultdata .getEditBias() == null) ? "NO" : "YES"; mbiasBtn.setText(mbias); mbiasBtn.setLayoutData(gd); mbiasBtn.setData(i); - mbiasBtn.setSelection(false); manEdit[i] = mbiasBtn; + mbiasBtn.addSelectionListener(new SelectionAdapter() { + /** + * (non-Javadoc) + * + * @see + * org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse + * .swt.events.SelectionEvent) + */ + @Override + public void widgetSelected(SelectionEvent e) { + final int ai = (Integer) mbiasBtn.getData(); + if ("YES".equalsIgnoreCase(mbiasBtn.getText())) { + manEdit[ai].setSelection(false); + editbias[ai] = oldbias[ai]; + lbTxts[ai].setText(String.format("%-1.2f", editbias[ai])); + biasChgs.put(radIds[ai], ai); + applyBtn.setEnabled(false); + manEdit[ai].setText("NO"); + } + } + }); + gd = new GridData(SWT.FILL, SWT.CENTER, true, true); Label acoefLbl = new Label(biasListComp, SWT.CENTER); if (abzerocoef.mlt_zrcoef == 0.0) { @@ -515,29 +541,27 @@ public class RadarBiasTableDialog extends Dialog { final float memspan = -99.0f; ArrayList rwr = new ArrayList(); Rwradarresult rwrr = new Rwradarresult(); - for (int i = 0; i < radIds.length; i++) { - if (radIds[i].equals("ZZZ")) { - continue; - } - if (manEdit[i] != null - && "YES".equalsIgnoreCase(manEdit[i].getText())) { - where = String.format("WHERE radid='%s' AND obstime='%s'", - radIds[i], obstime); - rwr = (ArrayList) IHFSDbGenerated - .GetRWRadarResult(where); - if (rwr.size() != 0) { - rwrr = rwr.get(0); - } else { - continue; - } - rwrr.setEditBias("y"); - rwrr.setMemSpanUsed((double) memspan); - rwrr.setRwBiasValUsed((double) editbias[i]); - IHFSDbGenerated.UpdateRWRadarResult(rwrr); + Iterator bi = biasChgs.keySet().iterator(); + while (bi.hasNext()) { + String rid = bi.next(); + where = String.format("WHERE radid='%s' AND obstime='%s'",rid, obstime); + rwr = (ArrayList) IHFSDbGenerated.GetRWRadarResult(where); + if (rwr.size() != 0) { + rwrr = rwr.get(0); } else { continue; } + int indexval = biasChgs.get(rid); + if("YES".equalsIgnoreCase(manEdit[indexval].getText())){ + rwrr.setEditBias("y"); + rwrr.setMemSpanUsed((double) memspan); + } else { + rwrr.setEditBias("n"); + } + rwrr.setRwBiasValUsed((double) editbias[indexval]); + IHFSDbGenerated.UpdateRWRadarResult(rwrr); } + biasChgs.clear(); return; } } From f48167eb8dc49570e1015129022a6ece2658dc76 Mon Sep 17 00:00:00 2001 From: Ron Anderson Date: Wed, 25 Jun 2014 13:06:02 -0500 Subject: [PATCH 02/39] Issue #3317 Fix issue with obsolete D2DGridDatabases not getting purged. Change-Id: If792327215bb9f8db470c95099463e735c462d46 Former-commit-id: cdef6bd26c1bcc8f8ddf8ed6a72eb1857842a2da [formerly f76a2d3700935b2fb3ec93defb62067285547ac1] [formerly 898b30fadbf04e0360f0c5c0e96ccf55256e01ae] [formerly cdef6bd26c1bcc8f8ddf8ed6a72eb1857842a2da [formerly f76a2d3700935b2fb3ec93defb62067285547ac1] [formerly 898b30fadbf04e0360f0c5c0e96ccf55256e01ae] [formerly 2ac9cd84ec37c0d08a00039638c3a7fd93bf4c8d [formerly 898b30fadbf04e0360f0c5c0e96ccf55256e01ae [formerly 2a84ea1af7bb767e9e85387de1fd90c662f9f91d]]]] Former-commit-id: 2ac9cd84ec37c0d08a00039638c3a7fd93bf4c8d Former-commit-id: 0076ccb3116e18d050ef6f4b2f37cc97cffaffee [formerly ddcfe574d84192d642eecdfb3eff5b3d49c0265f] [formerly 63b195143dbea5ac0724f5f746efdcdd457eeade [formerly ff5c0f2c3313f1c544e162d101a520e8a9f0c214]] Former-commit-id: 35d631e2502a21703771a49f440d628b03dfec10 [formerly 2cc92ecc694c63ef602ff5f2a547ddc372b7e149] Former-commit-id: 849625a3e1ee7e70306852d32d4fa21cf2405c76 --- .../plugin/gfe/server/GridParmManager.java | 515 ++++++++---------- .../gfe/server/database/D2DGridDatabase.java | 7 +- 2 files changed, 243 insertions(+), 279 deletions(-) diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/server/GridParmManager.java b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/server/GridParmManager.java index fdea485b5f..7098ba4e93 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/server/GridParmManager.java +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/server/GridParmManager.java @@ -101,7 +101,7 @@ import com.raytheon.uf.edex.database.purge.PurgeLogger; * D2DGridDatabase constructor * 04/23/13 #1949 rjpeter Added inventory retrieval for a given time range. * 05/02/13 #1969 randerso Fixed possible null pointer in getParmList - * Removed inventory from DBInvChangedNotification + * Removed inventory from DBInvChangeNotification * 05/03/13 #1974 randerso Fixed error logging to include stack trace * 05/14/13 #2004 randerso Added methods to synch GridParmManager across JVMs * 05/30/13 #2044 randerso Refactored to better match A1 design. Removed D2DParmIDCache. @@ -119,6 +119,9 @@ import com.raytheon.uf.edex.database.purge.PurgeLogger; * the same parm simultaneously. * Added code to check the purge times when publishing and not publish * data that is eligible to be purged. + * 06/24/2014 #3317 randerso Send DBInvChangeNotification when database is created, unless it's + * created in response to another DBInvChangeNotification so IFPServers stay in synch. + * Cleaned up commented code. * * * @@ -172,7 +175,7 @@ public class GridParmManager { this.lockMgr.setGridParmMgr(this); initializeManager(); - } + } /** * Dispose the GridParmManager @@ -199,7 +202,7 @@ public class GridParmManager { .debug("No matching GridDatabase for requested ParmID in createParm()"); // TODO: should we return null? return new GridParm(); - } + } } /** @@ -330,10 +333,10 @@ public class GridParmManager { for (SaveGridRequest req : saveRequest) { ServerResponse ssr = null; GridParm gp = null; - gp = gridParm(req.getParmId()); - if (!gp.isValid()) { - sr.addMessage("Unknown Parm: " + req.getParmId() - + " in saveGridData()"); + gp = gridParm(req.getParmId()); + if (!gp.isValid()) { + sr.addMessage("Unknown Parm: " + req.getParmId() + + " in saveGridData()"); statusHandler.error("Unknown Parm: " + req.getParmId() + " in saveGridData()"); continue; @@ -455,27 +458,27 @@ public class GridParmManager { // for the source data ParmID sourceParmId = req.getParmId(); GridParm sourceGP = gridParm(sourceParmId); - if (!sourceGP.isValid()) { - ssr.addMessage("Unknown Source Parm: " + req.getParmId() - + " in commitGrid()"); - srDetailed.addMessages(ssr); - failures.add(req); - continue; - } + if (!sourceGP.isValid()) { + ssr.addMessage("Unknown Source Parm: " + req.getParmId() + + " in commitGrid()"); + srDetailed.addMessages(ssr); + failures.add(req); + continue; + } // for the destination data ParmID destParmId = new ParmID(req.getParmId().getParmName(), officialDBid, req.getParmId().getParmLevel()); String destParmIdStr = destParmId.toString(); GridParm destGP = null; - destGP = gridParm(destParmId); - if (!destGP.isValid()) { - ssr.addMessage("Unknown Destination Parm: " + destGP - + " in commitGrid()"); - srDetailed.addMessages(ssr); - failures.add(req); - continue; - } + destGP = gridParm(destParmId); + if (!destGP.isValid()) { + ssr.addMessage("Unknown Destination Parm: " + destGP + + " in commitGrid()"); + srDetailed.addMessages(ssr); + failures.add(req); + continue; + } // verify that the source and destination are matched GridParmInfo sourceInfo, destInfo; @@ -519,17 +522,17 @@ public class GridParmManager { publishTime.setStart(startTime); } - inventoryTimer.start(); + inventoryTimer.start(); ServerResponse> invSr = sourceGP .getGridInventory(publishTime); List overlapInventory = invSr.getPayload(); - ssr.addMessages(invSr); - if (!ssr.isOkay()) { - ssr.addMessage("GetGridInventory for source for commitGrid() failure: " - + ssr.message()); - srDetailed.addMessages(ssr); - failures.add(req); - } + ssr.addMessages(invSr); + if (!ssr.isOkay()) { + ssr.addMessage("GetGridInventory for source for commitGrid() failure: " + + ssr.message()); + srDetailed.addMessages(ssr); + failures.add(req); + } // expand publish time to span overlapping inventory if (!overlapInventory.isEmpty()) { @@ -546,173 +549,173 @@ public class GridParmManager { } invSr = destGP.getGridInventory(publishTime); - inventoryTimer.stop(); - List destInventory = invSr.getPayload(); - ssr.addMessages(invSr); - if (!ssr.isOkay()) { - ssr.addMessage("GetGridInventory for destination for commitGrid() failure: " - + ssr.message()); - srDetailed.addMessages(ssr); - failures.add(req); - continue; - } - - // get the source grid data - List sourceData = null; - List badGridTR = new ArrayList(); - - // System.out.println("overlapInventory initial size " - // + overlapInventory.size()); - - historyRetrieveTimer.start(); - ServerResponse>> history = sourceGP - .getGridHistory(overlapInventory); - Map> currentDestHistory = destGP - .getGridHistory(overlapInventory).getPayload(); - historyRetrieveTimer.stop(); - - Map> historyOnly = new HashMap>(); - for (TimeRange tr : history.getPayload().keySet()) { - // should only ever be one history for source grids - List gdhList = history.getPayload() - .get(tr); - boolean doPublish = false; - for (GridDataHistory gdh : gdhList) { - // if update time is less than publish time, grid - // has not changed since last published, - // therefore only update history, do not publish - if ((gdh.getPublishTime() == null) - || (gdh.getUpdateTime().getTime() > gdh - .getPublishTime().getTime()) - // in service backup, times on srcHistory - // could appear as not needing a publish, - // even though dest data does not exist - || (currentDestHistory.get(tr) == null) - || (currentDestHistory.get(tr).size() == 0)) { - doPublish = true; - } - } - if (!doPublish) { - historyOnly.put(tr, gdhList); - overlapInventory.remove(tr); - } - } - - retrieveTimer.start(); - ServerResponse> getSr = sourceGP.getGridData( - new GetGridRequest(req.getParmId(), overlapInventory), - badGridTR); - retrieveTimer.stop(); - // System.out.println("Retrieved " + overlapInventory.size() - // + " grids"); - sourceData = getSr.getPayload(); - ssr.addMessages(getSr); - if (!ssr.isOkay()) { - ssr.addMessage("GetGridData for source for commitGrid() failure: " - + ssr.message()); - srDetailed.addMessages(ssr); - failures.add(req); - continue; - } - - // get list of official grids that overlap publish range and - // aren't contained in the publish range, these have to be - // included in the publish step. Then get the grids, shorten - // and insert into sourceData. - List officialData = new ArrayList(); - List officialTR = new ArrayList(); - for (int t = 0; t < destInventory.size(); t++) { - if (!publishTime.contains(destInventory.get(t))) { - officialTR.add(destInventory.get(t)); - } - } - - if (!officialTR.isEmpty()) { - retrieveTimer.start(); - getSr = destGP.getGridData(new GetGridRequest(destParmId, - officialTR), badGridTR); - retrieveTimer.stop(); - officialData = getSr.getPayload(); - ssr.addMessages(getSr); + inventoryTimer.stop(); + List destInventory = invSr.getPayload(); + ssr.addMessages(invSr); if (!ssr.isOkay()) { - ssr.addMessage("GetGridData for official for commidtGrid() failure: " + ssr.addMessage("GetGridInventory for destination for commitGrid() failure: " + ssr.message()); srDetailed.addMessages(ssr); failures.add(req); continue; } - // insert the grid into the "sourceGrid" list - for (int t = 0; t < officialTR.size(); t++) { - // before - try { - if (officialTR.get(t).getStart() - .before(publishTime.getStart())) { + // get the source grid data + List sourceData = null; + List badGridTR = new ArrayList(); + + // System.out.println("overlapInventory initial size " + // + overlapInventory.size()); + + historyRetrieveTimer.start(); + ServerResponse>> history = sourceGP + .getGridHistory(overlapInventory); + Map> currentDestHistory = destGP + .getGridHistory(overlapInventory).getPayload(); + historyRetrieveTimer.stop(); + + Map> historyOnly = new HashMap>(); + for (TimeRange tr : history.getPayload().keySet()) { + // should only ever be one history for source grids + List gdhList = history.getPayload() + .get(tr); + boolean doPublish = false; + for (GridDataHistory gdh : gdhList) { + // if update time is less than publish time, grid + // has not changed since last published, + // therefore only update history, do not publish + if ((gdh.getPublishTime() == null) + || (gdh.getUpdateTime().getTime() > gdh + .getPublishTime().getTime()) + // in service backup, times on srcHistory + // could appear as not needing a publish, + // even though dest data does not exist + || (currentDestHistory.get(tr) == null) + || (currentDestHistory.get(tr).size() == 0)) { + doPublish = true; + } + } + if (!doPublish) { + historyOnly.put(tr, gdhList); + overlapInventory.remove(tr); + } + } + + retrieveTimer.start(); + ServerResponse> getSr = sourceGP.getGridData( + new GetGridRequest(req.getParmId(), overlapInventory), + badGridTR); + retrieveTimer.stop(); + // System.out.println("Retrieved " + overlapInventory.size() + // + " grids"); + sourceData = getSr.getPayload(); + ssr.addMessages(getSr); + if (!ssr.isOkay()) { + ssr.addMessage("GetGridData for source for commitGrid() failure: " + + ssr.message()); + srDetailed.addMessages(ssr); + failures.add(req); + continue; + } + + // get list of official grids that overlap publish range and + // aren't contained in the publish range, these have to be + // included in the publish step. Then get the grids, shorten + // and insert into sourceData. + List officialData = new ArrayList(); + List officialTR = new ArrayList(); + for (int t = 0; t < destInventory.size(); t++) { + if (!publishTime.contains(destInventory.get(t))) { + officialTR.add(destInventory.get(t)); + } + } + + if (!officialTR.isEmpty()) { + retrieveTimer.start(); + getSr = destGP.getGridData(new GetGridRequest(destParmId, + officialTR), badGridTR); + retrieveTimer.stop(); + officialData = getSr.getPayload(); + ssr.addMessages(getSr); + if (!ssr.isOkay()) { + ssr.addMessage("GetGridData for official for commidtGrid() failure: " + + ssr.message()); + srDetailed.addMessages(ssr); + failures.add(req); + continue; + } + + // insert the grid into the "sourceGrid" list + for (int t = 0; t < officialTR.size(); t++) { + // before + try { + if (officialTR.get(t).getStart() + .before(publishTime.getStart())) { IGridSlice tempSlice = officialData.get(t) .clone(); tempSlice.setValidTime(new TimeRange(officialTR .get(t).getStart(), publishTime - .getStart())); - sourceData.add(0, tempSlice); + .getStart())); + sourceData.add(0, tempSlice); publishTime.setStart(officialTR.get(t) .getStart()); - overlapInventory.add(tempSlice.getValidTime()); - } + overlapInventory.add(tempSlice.getValidTime()); + } - // after - if (officialTR.get(t).getEnd() - .after(publishTime.getEnd())) { + // after + if (officialTR.get(t).getEnd() + .after(publishTime.getEnd())) { IGridSlice tempSlice = officialData.get(t) .clone(); tempSlice.setValidTime(new TimeRange( publishTime.getEnd(), officialTR.get(t) .getEnd())); - sourceData.add(tempSlice); - publishTime.setEnd(officialTR.get(t).getEnd()); - overlapInventory.add(tempSlice.getValidTime()); + sourceData.add(tempSlice); + publishTime.setEnd(officialTR.get(t).getEnd()); + overlapInventory.add(tempSlice.getValidTime()); + } + } catch (CloneNotSupportedException e) { + sr.addMessage("Error cloning GridSlice " + + e.getMessage()); } - } catch (CloneNotSupportedException e) { - sr.addMessage("Error cloning GridSlice " - + e.getMessage()); } } - } // save off the source grid history, to update the source // database modify the source grid data for the dest ParmID and - // GridDataHistory - Map> histories = new HashMap>(); - Date nowTime = new Date(); + // GridDataHistory + Map> histories = new HashMap>(); + Date nowTime = new Date(); - for (IGridSlice slice : sourceData) { - GridDataHistory[] sliceHist = slice.getHistory(); - for (GridDataHistory hist : sliceHist) { - hist.setPublishTime((Date) nowTime.clone()); - } - slice.getGridInfo().resetParmID(destParmId); + for (IGridSlice slice : sourceData) { + GridDataHistory[] sliceHist = slice.getHistory(); + for (GridDataHistory hist : sliceHist) { + hist.setPublishTime((Date) nowTime.clone()); + } + slice.getGridInfo().resetParmID(destParmId); histories.put(slice.getValidTime(), Arrays.asList(sliceHist)); - } + } // update the history for publish time for grids that are // unchanged - for (TimeRange tr : historyOnly.keySet()) { - List histList = historyOnly.get(tr); - for (GridDataHistory hist : histList) { - hist.setPublishTime((Date) nowTime.clone()); + for (TimeRange tr : historyOnly.keySet()) { + List histList = historyOnly.get(tr); + for (GridDataHistory hist : histList) { + hist.setPublishTime((Date) nowTime.clone()); + } + histories.put(tr, histList); } - histories.put(tr, histList); - } // update the publish times in the source database, // update the notifications - historyUpdateTimer.start(); - sr.addMessages(sourceGP.updatePublishTime(histories.values(), - (Date) nowTime.clone())); + historyUpdateTimer.start(); + sr.addMessages(sourceGP.updatePublishTime(histories.values(), + (Date) nowTime.clone())); // System.out.println("Updated " + histories.size() + // " histories"); - historyUpdateTimer.stop(); + historyUpdateTimer.stop(); List historyTimes = new ArrayList( histories.keySet()); @@ -723,56 +726,56 @@ public class GridParmManager { // update the histories of destination database for ones // that are not going to be saved since there hasn't been a // change - List historyOnlyList = new ArrayList(); - historyOnlyList.addAll(historyOnly.keySet()); + List historyOnlyList = new ArrayList(); + historyOnlyList.addAll(historyOnly.keySet()); - historyRetrieveTimer.start(); - Map> destHistory = destGP - .getGridHistory(historyOnlyList).getPayload(); - historyRetrieveTimer.stop(); - for (TimeRange tr : destHistory.keySet()) { - List srcHistList = histories.get(tr); - List destHistList = destHistory.get(tr); - for (int i = 0; i < srcHistList.size(); i++) { - destHistList.get(i).replaceValues(srcHistList.get(i)); + historyRetrieveTimer.start(); + Map> destHistory = destGP + .getGridHistory(historyOnlyList).getPayload(); + historyRetrieveTimer.stop(); + for (TimeRange tr : destHistory.keySet()) { + List srcHistList = histories.get(tr); + List destHistList = destHistory.get(tr); + for (int i = 0; i < srcHistList.size(); i++) { + destHistList.get(i).replaceValues(srcHistList.get(i)); + } } - } // only need to update the publish time on the destination // histories of grids that are not being saved (due to no // changes), because the saveGridSlices() call below will update // the publish time of the ones with changes - historyUpdateTimer.start(); - destGP.updatePublishTime(destHistory.values(), - (Date) nowTime.clone()); - historyUpdateTimer.stop(); + historyUpdateTimer.start(); + destGP.updatePublishTime(destHistory.values(), + (Date) nowTime.clone()); + historyUpdateTimer.stop(); - // save data directly to the official database (bypassing - // the checks in Parm intentionally) - storeTimer.start(); - ssr.addMessages(officialDBPtr.saveGridSlices(destParmId, - publishTime, sourceData, requestorId, historyOnlyList)); - storeTimer.stop(); + // save data directly to the official database (bypassing + // the checks in Parm intentionally) + storeTimer.start(); + ssr.addMessages(officialDBPtr.saveGridSlices(destParmId, + publishTime, sourceData, requestorId, historyOnlyList)); + storeTimer.stop(); // System.out.println("Published " + sourceData.size() + // " slices"); - if (!ssr.isOkay()) { - ssr.addMessage("SaveGridData for official for commitGrid() failure: " - + ssr.message()); - srDetailed.addMessages(ssr); - failures.add(req); - continue; - } + if (!ssr.isOkay()) { + ssr.addMessage("SaveGridData for official for commitGrid() failure: " + + ssr.message()); + srDetailed.addMessages(ssr); + failures.add(req); + continue; + } - // make the notification + // make the notification GridUpdateNotification not = new GridUpdateNotification( destParmId, publishTime, histories, requestorId, siteID); - changes.add(not); - sr.getPayload().add(not); + changes.add(not); + sr.getPayload().add(not); } finally { ClusterLockUtils.unlock(ct, false); - } + } } perfLog.logDuration("Publish Grids: Acquiring cluster lock", @@ -822,8 +825,8 @@ public class GridParmManager { this.dbMap.keySet()); sr.setPayload(databases); - return sr; - } + return sr; + } /** * Get a database if available @@ -832,6 +835,10 @@ public class GridParmManager { * @return GridDatabase or null if not available */ public GridDatabase getDatabase(DatabaseID dbId) { + return getDatabase(dbId, true); + } + + private GridDatabase getDatabase(DatabaseID dbId, boolean notify) { // look up the database in the map GridDatabase db = this.dbMap.get(dbId); @@ -846,12 +853,14 @@ public class GridParmManager { ServerResponse status = createDB(dbId); if (status.isOkay()) { db = status.getPayload(); - createDbNotification(Arrays.asList(dbId), null); + } } - } if (db != null) { this.addDB(db); + if (notify) { + createDbNotification(Arrays.asList(dbId), null); + } } } @@ -886,8 +895,8 @@ public class GridParmManager { return sr; } - return sr; - } + return sr; + } /** * Delete database @@ -944,9 +953,9 @@ public class GridParmManager { if (db == null) { sr.addMessage("Database " + dbId - + " does not exist for getParmList()"); + + " does not exist for getParmList()"); return sr; - } + } sr = db.getParmList(); return sr; @@ -988,7 +997,7 @@ public class GridParmManager { // determine desired number of versions desiredVersions = this.config.desiredDbVersions(dbId); - } + } // process the id and determine whether it should be purged count++; @@ -1012,9 +1021,9 @@ public class GridParmManager { toRemove.removeAll(newInv); for (DatabaseID dbId : toRemove) { if (dbMap.remove(dbId) != null) { - statusHandler - .info("Synching GridParmManager with database inventory, removing " - + dbId); + statusHandler + .info("Synching GridParmManager with database inventory, removing " + + dbId); } // add any removals to the deletions list @@ -1073,14 +1082,14 @@ public class GridParmManager { List lockNotify = new ArrayList(); GridParm gp = createParm(parmId); if (gp.isValid()) { - ServerResponse sr1 = gp.timePurge(purgeTime, + ServerResponse sr1 = gp.timePurge(purgeTime, gridNotify, lockNotify); - sr.addMessages(sr1); - purgedCount += sr1.getPayload(); + sr.addMessages(sr1); + purgedCount += sr1.getPayload(); - gridNotifications.addAll(gridNotify); - lockNotifications.addAll(lockNotify); - } + gridNotifications.addAll(gridNotify); + lockNotifications.addAll(lockNotify); + } } PurgeLogger.logInfo("Purge " + purgedCount + " items from " + dbId, @@ -1119,7 +1128,7 @@ public class GridParmManager { if (dbId.getRemovedDate() != null) { // mark database as not removed - try { + try { GFEDao gfeDao = new GFEDao(); gfeDao.setDatabaseRemovedDate(dbId, null); statusHandler.info("Database " + dbId + " restored"); @@ -1127,7 +1136,7 @@ public class GridParmManager { statusHandler.handle(Priority.PROBLEM, "Unable to mark database restored: " + dbId, e); } - } + } // add to list of databases addDB(db); @@ -1177,8 +1186,8 @@ public class GridParmManager { if (manID.getFormat().equals(DataType.GRID) && !inventory.contains(manID)) { inventory.add(manID); + } } - } // create the databases (the list should now only contain GRID dbs) ServerResponse sr = new ServerResponse(); @@ -1208,11 +1217,6 @@ public class GridParmManager { ClusterTask ct = ClusterLockUtils.lookupLock(SMART_INIT_TASK_NAME, SMART_INIT_TASK_DETAILS + siteID); - // TODO: reconsider this as changes to localConfig may change what - // smartInits should be run - // TODO: re-enable check - // if ((ct.getLastExecution() + SMART_INIT_TIMEOUT) < System - // .currentTimeMillis()) { ct = ClusterLockUtils .lock(SMART_INIT_TASK_NAME, SMART_INIT_TASK_DETAILS + siteID, SMART_INIT_TIMEOUT, false); @@ -1285,7 +1289,7 @@ public class GridParmManager { if (db == null) { // New database db = D2DGridDatabase.getDatabase(config, d2dModelName, refTime); - if (db == null) { + if (db == null) { continue; } @@ -1308,16 +1312,16 @@ public class GridParmManager { queue.queue(siteID, config, dbId, validTime, false, SmartInitRecord.LIVE_SMART_INIT_PRIORITY); } - } - } + } + } // send notifications; - try { + try { SendNotifications.send(guns); - } catch (Exception e) { + } catch (Exception e) { statusHandler.error("Unable to send grib ingest notifications", e); - } - } + } + } /** * @param records @@ -1339,9 +1343,9 @@ public class GridParmManager { Date validTime = gun.getReplacementTimeRange().getStart(); queue.queue(siteID, config, dbId, validTime, false, SmartInitRecord.LIVE_SMART_INIT_PRIORITY); + } } } - } try { SendNotifications.send(guns); @@ -1349,7 +1353,7 @@ public class GridParmManager { statusHandler.error( "Unable to send satellite ingest notifications", e); } - } + } private Date purgeTime(DatabaseID id) { int numHours = this.config.gridPurgeAgeInHours(id); @@ -1427,8 +1431,8 @@ public class GridParmManager { for (ParmID pid : parmList) { out.add(new CommitGridRequest(pid, req.getTimeRange(), req.isClientSendStatus())); - } - } else { + } + } else { sr.addMessage("Could not find database for " + req.getDbId() + " in convertToParmReq()"); } @@ -1495,25 +1499,7 @@ public class GridParmManager { ServerResponse sr = new ServerResponse(); for (DatabaseID dbId : invChanged.getAdditions()) { - // TODO: This is pretty much just a duplicate of what's in - // getDatabase. - // Verify this works and then remove this commented code - - // if (dbId.getDbType().equals("D2D")) { - // String d2dModelName = config.d2dModelNameMapping(dbId - // .getModelName()); - // D2DGridDatabase db = D2DGridDatabase.getDatabase(config, - // d2dModelName, dbId.getModelDate()); - // if (db != null) { - // this.addDB(db); - // } - // statusHandler - // .info("handleGfeNotification new D2D database: " - // + dbId); - // } else { - // sr = this.createDB(dbId); - // } - this.getDatabase(dbId); + this.getDatabase(dbId, false); } if (!sr.isOkay()) { statusHandler.error("Error updating GridParmManager: " @@ -1544,7 +1530,7 @@ public class GridParmManager { DatabaseID dbId = db.getDbId(); statusHandler.info("addDB called, adding " + dbId); this.dbMap.put(dbId, db); - } + } /** * Process D2D grid data purge notification @@ -1568,37 +1554,12 @@ public class GridParmManager { newInventory.addAll(dbIds); } catch (DataAccessLayerException e) { statusHandler.error(e.getLocalizedMessage(), e); + } } } - } DatabaseID satDbid = D2DSatDatabase.getDbId(siteID); - // TODO why are we processing adds in a purge method. We should get adds - // via other means - // Verify and remove the commented code - // List added = new ArrayList(newInventory); - // added.removeAll(currentInventory); - // Iterator iter = added.iterator(); - // while (iter.hasNext()) { - // DatabaseID dbid = iter.next(); - // // remove satellite database and non-D2D databases from adds - // if (!dbid.getDbType().equals("D2D") || dbid.equals(satDbid)) { - // iter.remove(); - // } else { - // // add the new database - // try { - // D2DGridDatabase db = new D2DGridDatabase(config, dbid); - // addDB(db); - // statusHandler.info("d2dGridDataPurged new D2D database: " - // + dbid); - // } catch (Exception e) { - // statusHandler.handle(Priority.PROBLEM, - // e.getLocalizedMessage(), e); - // } - // } - // } - List deleted = new ArrayList(currentInventory); deleted.removeAll(newInventory); Iterator iter = deleted.iterator(); @@ -1613,8 +1574,8 @@ public class GridParmManager { statusHandler.info("d2dGridDataPurged removing database: " + dbid); } - } } + } // if ((added.size() > 0) || (deleted.size() > 0)) { // DBInvChangeNotification changed = new DBInvChangeNotification( @@ -1624,8 +1585,8 @@ public class GridParmManager { deleted, siteID); SendNotifications.send(changed); - } } + } /** * Process D2D satellite data purge notification diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/server/database/D2DGridDatabase.java b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/server/database/D2DGridDatabase.java index 583872025a..6a5fa55a04 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/server/database/D2DGridDatabase.java +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/server/database/D2DGridDatabase.java @@ -114,6 +114,8 @@ import com.raytheon.uf.edex.database.DataAccessLayerException; * Added function to create a D2DGridDatabase object only if there is * data in postgres for the desired model/reftime * 04/17/2014 #2934 dgilling Change getGridParmInfo to use D2DParm's GridParmInfo. + * 06/24/2014 #3317 randerso Don't allow database to be created if it exceeds D2DDBVERSIONS and + * should be purged. * * * @@ -176,8 +178,9 @@ public class D2DGridDatabase extends VGridDatabase { String d2dModelName, Date refTime) { try { GFED2DDao dao = new GFED2DDao(); - // TODO create query for single refTime - List result = dao.getModelRunTimes(d2dModelName, -1); + int dbVersions = config.desiredDbVersions(getDbId(d2dModelName, + refTime, config)); + List result = dao.getModelRunTimes(d2dModelName, dbVersions); if (result.contains(refTime)) { D2DGridDatabase db = new D2DGridDatabase(config, d2dModelName, From 9e022261ae643d3c4ef3aa8e26fc9104fcfca543 Mon Sep 17 00:00:00 2001 From: Ron Anderson Date: Wed, 25 Jun 2014 19:12:51 +0000 Subject: [PATCH 03/39] Issue #3317 Fix merge problem that removed GFE notification of D2D purge Change-Id: I925b7287bdb2fb7f9c330b05b1b2c32031e693d9 Former-commit-id: 8c0311507bdc5c648c09956f46fcff0e14a0dca8 [formerly 5dd7a035aceb7e5fa4d47f2ff8d5f6b48e8cc1f8] [formerly ead09dd683e06fdf7257d5d93a7a8617581ea9d1] [formerly 8c0311507bdc5c648c09956f46fcff0e14a0dca8 [formerly 5dd7a035aceb7e5fa4d47f2ff8d5f6b48e8cc1f8] [formerly ead09dd683e06fdf7257d5d93a7a8617581ea9d1] [formerly a6956a8ccd811de7c5a62af1eabd2c3381cff537 [formerly ead09dd683e06fdf7257d5d93a7a8617581ea9d1 [formerly 04805a8957ef14754225f85f4722d8302cde8df3]]]] Former-commit-id: a6956a8ccd811de7c5a62af1eabd2c3381cff537 Former-commit-id: 81db7329c700bda37c75730742fb9e0da371b489 [formerly 8b027efdec139c928a65c7fe738e6fdd68e67b34] [formerly 95a171c25d2d56a721f156a97720989d676e8e63 [formerly 7abeff57cc6c0b4c04f9581f073a6c83179b66c2]] Former-commit-id: efa4e25bb2ebffaf63718fb148cb9143abea2252 [formerly e5b81ccee04029278d4d0bd3d45de50b809ce649] Former-commit-id: b4a2ae3aaeabc07926e7f4839336e2ae74b0f445 --- .../res/spring/gfe-spring.xml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/res/spring/gfe-spring.xml b/edexOsgi/com.raytheon.edex.plugin.gfe/res/spring/gfe-spring.xml index 3d2721aba3..fa8ebba93c 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/res/spring/gfe-spring.xml +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/res/spring/gfe-spring.xml @@ -132,6 +132,19 @@ + + + + + + + java.lang.Throwable + + + + + From b88d5fc6e77f299256f5ad33fd3a69cfad49594f Mon Sep 17 00:00:00 2001 From: Mike Duff Date: Thu, 26 Jun 2014 15:45:33 -0500 Subject: [PATCH 04/39] Issue #3321 - Fix ingest switch checks Change-Id: I7de7ee482ab57789874a179499e6c51079e68e12 Former-commit-id: 0de6d3b92ac939b21a05c0939befbf2767dfd97a [formerly 1d3aeb881bf6adabf770c5e54fcafbdc6433cf7d] [formerly f17c93bb195d6611ca519ebc5384e03e71aa2ceb] [formerly 0de6d3b92ac939b21a05c0939befbf2767dfd97a [formerly 1d3aeb881bf6adabf770c5e54fcafbdc6433cf7d] [formerly f17c93bb195d6611ca519ebc5384e03e71aa2ceb] [formerly d62c925baa0c2bd5e3cd7ae4a5ba0c57602e507a [formerly f17c93bb195d6611ca519ebc5384e03e71aa2ceb [formerly 5df0ac7f96d1280c1c50f39982693f9503b56f14]]]] Former-commit-id: d62c925baa0c2bd5e3cd7ae4a5ba0c57602e507a Former-commit-id: 9c869c928e6cd2e42496fe7697849e3f3276b800 [formerly 5078011147eb9e3907868c9477c267f0a85fede8] [formerly 939d0365bdd8eecc342c0665f97c4d8d8697f445 [formerly d2cbeff06a40c35758ab2a6f68699e88b4b7f109]] Former-commit-id: cc2d0bb3117f698401c903f5221926bbed77ac62 [formerly 07dda3ecc1edd2a1df0aa34ac4b91e559d3f8ad2] Former-commit-id: 6163364939056fe7c4fcb95a6ec0f32559e22e0c --- .../edex/plugin/shef/data/ShefData.java | 21 +++++++++++++++++-- .../edex/plugin/shef/database/PostShef.java | 19 ++++++++++------- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/edexOsgi/com.raytheon.edex.plugin.shef/src/com/raytheon/edex/plugin/shef/data/ShefData.java b/edexOsgi/com.raytheon.edex.plugin.shef/src/com/raytheon/edex/plugin/shef/data/ShefData.java index d703e39306..949baffe4c 100644 --- a/edexOsgi/com.raytheon.edex.plugin.shef/src/com/raytheon/edex/plugin/shef/data/ShefData.java +++ b/edexOsgi/com.raytheon.edex.plugin.shef/src/com/raytheon/edex/plugin/shef/data/ShefData.java @@ -25,6 +25,7 @@ import java.util.regex.Pattern; import com.raytheon.edex.plugin.shef.util.SHEFDate; import com.raytheon.edex.plugin.shef.util.ShefParm; +import com.raytheon.uf.common.dataplugin.shef.tables.IngestfilterId; import com.raytheon.uf.common.dataplugin.shef.util.ParameterCode; import com.raytheon.uf.common.dataplugin.shef.util.ParameterCode.Duration; import com.raytheon.uf.common.dataplugin.shef.util.ParameterCode.Extremum; @@ -47,6 +48,7 @@ import com.raytheon.uf.common.serialization.ISerializableObject; * 03/19/08 387 M. Duff Initial creation. * 10/16/2008 1548 jelkins Integrated ParameterCode Types * 04/29/2014 3088 mpduff cleanup. + * 06/26/2014 3321 mpduff Added ingestfilter primary key getter. * * */ @@ -805,14 +807,30 @@ public class ShefData implements ISerializableObject { * * @return */ - public String getPeTsE() { + public String getPeDTsE() { StringBuilder sb = new StringBuilder(); sb.append(this.getPhysicalElement().getCode()); sb.append(this.getTypeSource().getCode()); sb.append(this.getExtremum().getCode()); + sb.append(this.getDurationCodeVariable()); return sb.toString(); } + /** + * Get the ingest filter table primary key value for this data object. + * + * @return The primary key object + */ + public IngestfilterId getIngestFilterKey() { + IngestfilterId id = new IngestfilterId(); + id.setLid(this.getLocationId()); + id.setDur(this.getDurationValue()); + id.setExtremum(this.getExtremum().getCode()); + id.setPe(this.getPhysicalElement().getCode()); + id.setTs(this.getTypeSource().getCode()); + return id; + } + /** * * @param element @@ -885,5 +903,4 @@ public class ShefData implements ISerializableObject { } } - } diff --git a/edexOsgi/com.raytheon.edex.plugin.shef/src/com/raytheon/edex/plugin/shef/database/PostShef.java b/edexOsgi/com.raytheon.edex.plugin.shef/src/com/raytheon/edex/plugin/shef/database/PostShef.java index ea8957b8bf..ceafe1d177 100644 --- a/edexOsgi/com.raytheon.edex.plugin.shef/src/com/raytheon/edex/plugin/shef/database/PostShef.java +++ b/edexOsgi/com.raytheon.edex.plugin.shef/src/com/raytheon/edex/plugin/shef/database/PostShef.java @@ -122,7 +122,7 @@ import com.raytheon.uf.edex.decodertools.time.TimeTools; * Updated with more performance fixes. * 05/28/2014 3222 mpduff Fix posting time to be processed time so db doesn't show all post times the same * 06/02/2014 mpduff Fix for caching of range checks. - * + * 06/26/2014 3321 mpduff Fix ingestSwitchMap checks * * * @author mduff @@ -228,7 +228,7 @@ public class PostShef { private Map adjustmentMap = new HashMap(); /** Map of location identifier to IngestSwitch */ - private Map ingestSwitchMap = new HashMap(); + private Map ingestSwitchMap = new HashMap(); // AppsDefaults tokens private String undefStation; @@ -529,7 +529,7 @@ public class PostShef { if (dataLog) { log.info(LOG_SEP); log.info("Posting process started for LID [" + locId - + "] PEDTSEP [" + data.getPeTsE() + "] value [" + + "] PEDTSEP [" + data.getPeDTsE() + "] value [" + dataValue + "]"); } @@ -650,7 +650,7 @@ public class PostShef { if (Location.LOC_LOCATION.equals(postLocData) || (Location.LOC_GEOAREA.equals(postLocData))) { if (!DataType.CONTINGENCY.equals(dataType)) { - ingestSwitch = checkIngest(locId, data, ingestSwitch); + ingestSwitch = checkIngest(locId, data); } if (ShefConstants.IngestSwitch.POST_PE_OFF .equals(ingestSwitch)) { @@ -2123,8 +2123,7 @@ public class PostShef { * ingest switch setting * @return */ - private IngestSwitch checkIngest(String locId, ShefData data, - ShefConstants.IngestSwitch ingestSwitch) { + private IngestSwitch checkIngest(String locId, ShefData data) { StringBuilder errorMsg = new StringBuilder(); boolean matchFound = false; int hNum = 0; @@ -2150,7 +2149,12 @@ public class PostShef { String telem = null; String sql = null; Object[] oa = null; - String key = locId + data.getPeTsE(); + + IngestfilterId key = data.getIngestFilterKey();// .getPeDTsE(); + + // Default to off + ShefConstants.IngestSwitch ingestSwitch = IngestSwitch.POST_PE_OFF; + try { if (!ingestSwitchMap.containsKey(key)) { errorMsg.append("Error getting connection to IHFS Database"); @@ -2192,7 +2196,6 @@ public class PostShef { ingestSwitchMap.put(key, ingestSwitch); } - matchFound = ingestSwitchMap.containsKey(key); ingestSwitch = ingestSwitchMap.get(key); /* From f2728065ba516d4d56de273ad6bbfe084e36fd45 Mon Sep 17 00:00:00 2001 From: David Friedman Date: Fri, 27 Jun 2014 19:17:55 +0000 Subject: [PATCH 05/39] ASM #660 - WarnGen can generate polygons that do not match hatched area Change-Id: I48e93e69d75e903b266f5bb615dd8a72e8813652 Former-commit-id: 5c62d368ea1bd6354682f202520ec8cf138dbdd6 [formerly c4967a96fbfc577c1eabdbbf36d9c5f148628146] [formerly 18b3b61afc4dbabce05b7180f4a9a0cf14e0241b] [formerly 5c62d368ea1bd6354682f202520ec8cf138dbdd6 [formerly c4967a96fbfc577c1eabdbbf36d9c5f148628146] [formerly 18b3b61afc4dbabce05b7180f4a9a0cf14e0241b] [formerly dc25040a259590a6b6b0c13a24fda79e13754396 [formerly 18b3b61afc4dbabce05b7180f4a9a0cf14e0241b [formerly 993663cbee3f794981fc7f4cc97f96e3b86c47f8]]]] Former-commit-id: dc25040a259590a6b6b0c13a24fda79e13754396 Former-commit-id: 2e4cf863dd3f8b7b5a17b757b41c80fa3c70c9f1 [formerly 217aa6ce769bcdd4c476470b4d6ed54941ebf3f6] [formerly 7b3bdb180812815c4f2d1bc65959d40cce07d595 [formerly b546ca6ac8720afa729eb238737517f79c5396c5]] Former-commit-id: d5d8e4678be9cbb6c94920e0cb97562c13b4888f [formerly a756c1436ba044ada733a39365185bd4f857cb98] Former-commit-id: 18b1d1755016cf3bdd0cba826dc7a6d371a4e933 --- .../raytheon/viz/warngen/gis/PolygonUtil.java | 52 ++++++++++++++++++- 1 file changed, 50 insertions(+), 2 deletions(-) diff --git a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gis/PolygonUtil.java b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gis/PolygonUtil.java index 386a696682..139ece3233 100644 --- a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gis/PolygonUtil.java +++ b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gis/PolygonUtil.java @@ -86,6 +86,8 @@ import com.vividsolutions.jts.precision.SimpleGeometryPrecisionReducer; * 01/09/2014 DR 16974 D. Friedman Improve followup redraw-from-hatched-area polygons. * 04/15/2014 DR 17247 D. Friedman Prevent some invalid coordinates in adjustVertex. * 05/16/2014 DR 17365 D. Friedman Prevent some Coordinate reuse. Add reducePrecision. + * 06/27/2014 DR 17443 D. Friedman Fix some odd cases in which parts of a polygon not covering a + * hatched area would be retained after redrawing. * * * @author mschenke @@ -417,12 +419,15 @@ public class PolygonUtil { p1--; if (p1 >= 0) { + Coordinate last = new Coordinate(); int n, best1, best2; for (n = k = 0; k < npoints; k++) { if (match[k] == nv) continue; best1 = match[p1]; best2 = match[k]; + last.x = longest[p1].x; + last.y = longest[p1].y; p1 = k; if (best1 < 0 && best2 < 0) { if (k == n) @@ -460,16 +465,59 @@ public class PolygonUtil { best1 += nv; else if (dn - da < -len2) best2 += nv; - if (best1 < best2) + + /* + * We have apparently jumped from side best1 to side + * best2. Should we add all of the original + * vert[best1] -> vert[best2] vertices? If this is + * significantly longer then the distance from the + * last contour point to this one, it is probably + * the wrong thing to do. + * + * The factor of 3 assumes that all points along the + * contour we ware redrawing are fairly close so + * that three times the length from any one point to + * another is not very long. + */ + double maxPatchLen = last.distance(longest[k]) * 3; + double patchLen = 0; + + int va = Math.min(best1, best2); + int vb = Math.max(best1, best2); + if (va < nv) { + patchLen = totlen[Math.min(nv, vb)] - totlen[va]; + if (vb >= nv) + patchLen += totlen[vb % nv]; + } else { + patchLen = totlen[vb % nv] - totlen[va % nv]; + } + + if (patchLen >= maxPatchLen) { + /* + * Adding all of the other vertices would be + * going of the rails, so just add a vertex for + * the last point (since it may be far from + * vert[best1] and the current point. Only add + * one point if adding two would cause the + * output in longest to overtake the input. + */ + if (n + 1 < k) { + fixed[n] = 1; + longest[n++] = new Coordinate(last); + } + fixed[n] = 1; + longest[n++] = longest[k]; + } else if (best1 < best2) { for (best1++; best1 <= best2; best1++) { fixed[n] = 1; longest[n++] = new Coordinate(vert[best1]); } - else + } else { for (; best1 > best2; best1--) { fixed[n] = 1; longest[n++] = new Coordinate(vert[best1]); } + } continue; } fixed[n] = 1; From a4d359fce078fd634fec8d61a036254d195297d3 Mon Sep 17 00:00:00 2001 From: "Qinglu.Lin" Date: Mon, 30 Jun 2014 13:08:49 -0400 Subject: [PATCH 06/39] ASM #663 - WarnGen does not properly handle Outer Banks Counties in North Carolina Change-Id: If7fbcea362618e0dea5153f65489388b406b7a81 Former-commit-id: 660d1c9ff275a6b86569b24039ddbbf74a7e2737 [formerly 1180b318756217e44042c4681d3339ac8b41d6ec] [formerly 1200633cd2df86fdb197b74a057e8bfffede8924] [formerly 660d1c9ff275a6b86569b24039ddbbf74a7e2737 [formerly 1180b318756217e44042c4681d3339ac8b41d6ec] [formerly 1200633cd2df86fdb197b74a057e8bfffede8924] [formerly 1d52d020eb81b9db4fc3ad4085850d670bb81bd5 [formerly 1200633cd2df86fdb197b74a057e8bfffede8924 [formerly 4d50beaed59d785d923e357f8ce036f6625ce4b4]]]] Former-commit-id: 1d52d020eb81b9db4fc3ad4085850d670bb81bd5 Former-commit-id: 712f3b0f461a4aa5899b236352892ea70c68d80b [formerly 5e07f13dd83f89d8d31d25b9891a9d4aaa9fd6a4] [formerly 79c9a926a4430a2e87a6959f559d52c89cb1c374 [formerly 6e4b7e1e6d08402f7090dd0362eb3f85fdae0f4a]] Former-commit-id: d7eb9af4998b1fcd67d349f3068f4af192e86aff [formerly 3eaedad10561316a22ab6694653fefc0281d4234] Former-commit-id: 7235488050c757be10a2b9d609f80b7d6fe0af7b --- .../src/com/raytheon/viz/warngen/gis/Area.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gis/Area.java b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gis/Area.java index c91606ecea..e4817f8cbc 100644 --- a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gis/Area.java +++ b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gis/Area.java @@ -76,6 +76,7 @@ import com.vividsolutions.jts.geom.prep.PreparedGeometry; * Aug 19, 2013 2177 jsanchez Used portionsUtil to calculate area portion descriptions. * Apr 29, 2014 3033 jsanchez Updated method to retrieve files in localization. * May 16, 2014 DR 17365 D. Friedman Reduce precision of warning area to avoid topology errors. + * Jun 30, 2014 DR 17447 Qinglu lin Updated findAffectedAreas(). * * * @author chammack @@ -178,6 +179,7 @@ public class Area { } List uniqueFips = new ArrayList(); + List uniqueCountyname = new ArrayList(); List areas = new ArrayList(); for (GeospatialData regionFeature : countyMap.values()) { Geometry regionGeom = regionFeature.geometry; @@ -257,8 +259,12 @@ public class Area { area.points = pointList.toArray(new String[pointList.size()]); } - if (uniqueFips.contains(area.fips) == false) { + String countyName = (String)regionFeature.attributes.get("COUNTYNAME"); + if (uniqueFips.contains(area.fips) == false || !uniqueCountyname.contains(countyName)) { uniqueFips.add(area.fips); + if (countyName != null) { + uniqueCountyname.add(countyName); + } areas.add(area); } } From 1b7f4a8121a264d7b5cbe494b4bbf5b1d73fb0ba Mon Sep 17 00:00:00 2001 From: "Sean.Webb" Date: Fri, 30 May 2014 14:27:59 -0400 Subject: [PATCH 07/39] ASM #552 - Increased postgres max_connections to 400 Change-Id: I6e4a3c02ff2645480ca20274f1fa445e25196a03 Former-commit-id: 4aa35df7c72a5c1e13218eacb86de0858d196ac5 [formerly 5288764393a5820747b04cb77d28ac2cc624b5c3] [formerly c24c2f1e3e2fcadfaa1811e976771b4b8dee09ff] [formerly 4aa35df7c72a5c1e13218eacb86de0858d196ac5 [formerly 5288764393a5820747b04cb77d28ac2cc624b5c3] [formerly c24c2f1e3e2fcadfaa1811e976771b4b8dee09ff] [formerly 0b29e6677223400bb751805e371cafdfe4d369fa [formerly c24c2f1e3e2fcadfaa1811e976771b4b8dee09ff [formerly add5d004eca457782f957a95262e880b91dfeeb1]]]] Former-commit-id: 0b29e6677223400bb751805e371cafdfe4d369fa Former-commit-id: 010d6b95168a99103ce5cafe12a593a7e1498e8a [formerly cd179cddff3a974e5c1173e92afc503a3015a190] [formerly fb4ad3bfb75666fa94af0badd60456d9cfcc4290 [formerly a875ae3f24f227367eaf89769bd2f96d760c05fc]] Former-commit-id: bc0c747f1f72f5b7593a653e0a4748bab19eab8d [formerly c9d3906b32792d9469907ed1d1eeaf8e6d482356] Former-commit-id: 342896c0d76b3520261feb06e5d397735a6c4cc1 --- .../configuration/postgresql.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpms/awips2.core/Installer.database-server-configuration/configuration/postgresql.conf b/rpms/awips2.core/Installer.database-server-configuration/configuration/postgresql.conf index 88aaee18cf..ddc0c0cca3 100644 --- a/rpms/awips2.core/Installer.database-server-configuration/configuration/postgresql.conf +++ b/rpms/awips2.core/Installer.database-server-configuration/configuration/postgresql.conf @@ -61,7 +61,7 @@ listen_addresses = '*' # what IP address(es) to listen on; # defaults to 'localhost'; use '*' for all # (change requires restart) port = 5432 # (change requires restart) -max_connections = 300 # (change requires restart) +max_connections = 400 # (change requires restart) # Note: Increasing max_connections costs ~400 bytes of shared memory per # connection slot, plus lock space (see max_locks_per_transaction). #superuser_reserved_connections = 3 # (change requires restart) From d6ffc287792129a69f0e4a4c23c1cd4770c9c214 Mon Sep 17 00:00:00 2001 From: Ron Anderson Date: Wed, 18 Jun 2014 11:45:32 -0500 Subject: [PATCH 08/39] Omaha #3296 Added performance logging. Moved backup and purging to separate java thread. Cached PythonScript. Change-Id: I9814345b512674269f17f4bf61bd615f0a50b059 (cherry picked from commit a11bcadd76eb9f9597e23ee609fd9cb364ad26ac) Former-commit-id: 1f056e7ab90b6bd5bce9912e6d9508f6c7909128 [formerly 9818d9b4857bfb83b11f39ee6bbae747957c6f7f] [formerly beee08c32b525f8c962718863588f6bf14c9cd75] [formerly 1f056e7ab90b6bd5bce9912e6d9508f6c7909128 [formerly 9818d9b4857bfb83b11f39ee6bbae747957c6f7f] [formerly beee08c32b525f8c962718863588f6bf14c9cd75] [formerly 487c7ee30ad3f57ddc9cb5d3146dc2f687bbac28 [formerly beee08c32b525f8c962718863588f6bf14c9cd75 [formerly 49638ba1e9561dea7b318b7adc0f1ab9571170f5]]]] Former-commit-id: 487c7ee30ad3f57ddc9cb5d3146dc2f687bbac28 Former-commit-id: 53c11e062a292a4a2297dda0b59e7e37467f4e9f [formerly 699f2aa9bf89d8f8d3d3e87511e09690f14806cb] [formerly b61496c3397723d5bba2b477c82852166c411ddf [formerly c16fc8ee7f4e393d80099db1ba8a5f45615592fb]] Former-commit-id: 115b6d514da08606bd90d2de458c294ecc3e8d7e [formerly 8314f40ec3787cb186a3a261a60ddace72260f3e] Former-commit-id: 2b33bfac7d290cc4c1e3b83483903e7e7229d460 --- ...f.common.serialization.ISerializableObject | 1 - .../edex/plugin/gfe/watch/WclInfo.java | 5 +- .../META-INF/MANIFEST.MF | 5 +- .../uf/edex/activetable/ActiveTable.java | 220 ++++++++++++----- .../edex/activetable/ActiveTableBackup.java | 231 ++++++++++++++++++ .../uf/edex/activetable/ActiveTableSrv.java | 51 ++-- .../common_static/base/vtec/ActiveTable.py | 63 ++++- .../common_static/base/vtec/MergeVTEC.py | 1 + .../base/vtec/VTECTableSqueeze.py | 10 +- .../common_static/base/vtec/VTECTableUtil.py | 22 +- 10 files changed, 510 insertions(+), 99 deletions(-) create mode 100644 edexOsgi/com.raytheon.uf.edex.activetable/src/com/raytheon/uf/edex/activetable/ActiveTableBackup.java diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject b/edexOsgi/com.raytheon.edex.plugin.gfe/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject index c13bd549c5..968d1866e0 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject @@ -1,4 +1,3 @@ -com.raytheon.edex.plugin.gfe.wcl.WclInfo com.raytheon.edex.plugin.gfe.isc.IscSendRecord com.raytheon.edex.plugin.gfe.smartinit.SmartInitRecord com.raytheon.edex.plugin.gfe.smartinit.SmartInitRecordPK \ No newline at end of file diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/watch/WclInfo.java b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/watch/WclInfo.java index 59878355cf..a80e94c503 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/watch/WclInfo.java +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/watch/WclInfo.java @@ -31,7 +31,6 @@ import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; -import com.raytheon.uf.common.serialization.ISerializableObject; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -43,9 +42,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; */ @XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize -public class WclInfo implements ISerializableObject { - - private static final long serialVersionUID = 1L; +public class WclInfo { @XmlAttribute @DynamicSerializeElement diff --git a/edexOsgi/com.raytheon.uf.edex.activetable/META-INF/MANIFEST.MF b/edexOsgi/com.raytheon.uf.edex.activetable/META-INF/MANIFEST.MF index 3f2f5253c8..1bcd36d5fd 100644 --- a/edexOsgi/com.raytheon.uf.edex.activetable/META-INF/MANIFEST.MF +++ b/edexOsgi/com.raytheon.uf.edex.activetable/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Activetablesrv Plug-in Bundle-SymbolicName: com.raytheon.uf.edex.activetable -Bundle-Version: 1.12.1174.qualifier +Bundle-Version: 1.13.0.qualifier Bundle-Vendor: RAYTHEON Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Import-Package: com.raytheon.uf.common.activetable, @@ -24,6 +24,7 @@ Require-Bundle: com.raytheon.uf.common.localization;bundle-version="1.11.1", com.raytheon.uf.common.activetable;bundle-version="1.12.1174", com.raytheon.uf.edex.site;bundle-version="1.0.0", com.google.guava;bundle-version="1.0.0", - org.apache.log4j;bundle-version="1.0.0" + org.apache.log4j;bundle-version="1.0.0", + org.apache.commons.io;bundle-version="2.4.0" Eclipse-RegisterBuddy: com.raytheon.uf.common.serialization Export-Package: com.raytheon.uf.edex.activetable diff --git a/edexOsgi/com.raytheon.uf.edex.activetable/src/com/raytheon/uf/edex/activetable/ActiveTable.java b/edexOsgi/com.raytheon.uf.edex.activetable/src/com/raytheon/uf/edex/activetable/ActiveTable.java index 17257317d9..42584abbbc 100644 --- a/edexOsgi/com.raytheon.uf.edex.activetable/src/com/raytheon/uf/edex/activetable/ActiveTable.java +++ b/edexOsgi/com.raytheon.uf.edex.activetable/src/com/raytheon/uf/edex/activetable/ActiveTable.java @@ -24,14 +24,15 @@ import java.util.Arrays; import java.util.Calendar; import java.util.Date; import java.util.HashMap; +import java.util.HashSet; import java.util.List; import java.util.Set; -import java.util.TreeSet; import jep.JepException; import org.apache.log4j.Logger; +import com.raytheon.edex.site.SiteUtil; import com.raytheon.edex.util.Util; import com.raytheon.uf.common.activetable.ActiveTableMode; import com.raytheon.uf.common.activetable.ActiveTableRecord; @@ -49,9 +50,13 @@ import com.raytheon.uf.common.localization.PathManagerFactory; import com.raytheon.uf.common.python.PyUtil; import com.raytheon.uf.common.python.PythonScript; import com.raytheon.uf.common.site.SiteMap; +import com.raytheon.uf.common.status.IPerformanceStatusHandler; import com.raytheon.uf.common.status.IUFStatusHandler; +import com.raytheon.uf.common.status.PerformanceStatus; import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus.Priority; +import com.raytheon.uf.common.time.util.ITimer; +import com.raytheon.uf.common.time.util.TimeUtil; import com.raytheon.uf.common.util.FileUtil; import com.raytheon.uf.edex.core.EDEXUtil; import com.raytheon.uf.edex.database.DataAccessLayerException; @@ -82,6 +87,9 @@ import com.raytheon.uf.edex.database.query.DatabaseQuery; * PRACTICE active table. * Jun 11, 2013 2083 randerso Log active table changes * Mar 06, 2014 2883 randerso Pass siteId into python code + * Jun 17, 2014 3296 randerso Cached PythonScript. Moved active table + * backup and purging to a separate thread. + * Added performance logging * * * @@ -98,9 +106,44 @@ public class ActiveTable { private static final String NEXT_ETN_LOCK = "ActiveTableNextEtn"; - private static String filePath; + private static ThreadLocal threadLocalPythonScript = new ThreadLocal() { - private static String includePath; + /* + * (non-Javadoc) + * + * @see java.lang.ThreadLocal#initialValue() + */ + @Override + protected PythonScript initialValue() { + try { + ITimer timer = TimeUtil.getTimer(); + timer.start(); + IPathManager pathMgr = PathManagerFactory.getPathManager(); + LocalizationContext commonCx = pathMgr.getContext( + LocalizationType.COMMON_STATIC, LocalizationLevel.BASE); + String filePath = pathMgr.getFile(commonCx, + "vtec" + File.separator + "ActiveTable.py").getPath(); + String siteId = pathMgr.getContext( + LocalizationType.COMMON_STATIC, LocalizationLevel.SITE) + .getContextName(); + String includePath = PyUtil.buildJepIncludePath( + ActiveTablePyIncludeUtil.getCommonPythonIncludePath(), + ActiveTablePyIncludeUtil.getVtecIncludePath(siteId), + ActiveTablePyIncludeUtil + .getGfeConfigIncludePath(siteId)); + + PythonScript python = new PythonScript(filePath, includePath, + ActiveTable.class.getClassLoader()); + timer.stop(); + PerformanceStatus.getHandler("ActiveTable").logDuration( + "create PythonScript", timer.getElapsedTime()); + return python; + } catch (JepException e) { + throw new RuntimeException(e); + } + } + + }; private static CoreDao practiceDao = new CoreDao( DaoConfig.forClass(PracticeActiveTableRecord.class)); @@ -108,25 +151,9 @@ public class ActiveTable { private static CoreDao operationalDao = new CoreDao( DaoConfig.forClass(OperationalActiveTableRecord.class)); - private PythonScript python; - - static { - IPathManager pathMgr = PathManagerFactory.getPathManager(); - LocalizationContext commonCx = pathMgr.getContext( - LocalizationType.COMMON_STATIC, LocalizationLevel.BASE); - filePath = pathMgr.getFile(commonCx, - "vtec" + File.separator + "ActiveTable.py").getPath(); - String siteId = pathMgr.getContext(LocalizationType.COMMON_STATIC, - LocalizationLevel.SITE).getContextName(); - String pythonPath = ActiveTablePyIncludeUtil - .getCommonPythonIncludePath(); - String vtecPath = ActiveTablePyIncludeUtil.getVtecIncludePath(siteId); - String configPath = ActiveTablePyIncludeUtil - .getGfeConfigIncludePath(siteId); - includePath = PyUtil.buildJepIncludePath(pythonPath, vtecPath, - configPath); - } - + /** + * Default constructor + */ public ActiveTable() { } @@ -155,6 +182,10 @@ public class ActiveTable { * the active table mode (PRACTICE or OPERATIONAL) * @param phensigList * phensigs to include. If null, all phensigs will be included. + * @param act + * the VTEC action. If null all actions will be included + * @param etn + * the ETN. If null all ETNs will be included * @param requestValidTimes * true if only valid times are to be returned * @return the active table corresponding to the input parameters @@ -174,6 +205,10 @@ public class ActiveTable { * the active table mode (PRACTICE or OPERATIONAL) * @param phensigList * phensigs to include. If null, all phensigs will be included. + * @param act + * the VTEC action. If null all actions will be included + * @param etn + * the ETN. If null all ETNs will be included * @param requestValidTimes * true if only valid times are to be returned * @param wfos @@ -187,32 +222,18 @@ public class ActiveTable { String[] wfos) { if (wfos == null || !Arrays.asList(wfos).contains("all")) { - SiteMap siteMap = SiteMap.getInstance(); if (wfos == null || wfos.length == 0) { // default to WFOs from VTECPartners - // Use the 3-char site or VTEC_DECODER_SITES will be empty - Set site3s = siteMap.getSite3LetterIds(siteId); - Set wfoSet = new TreeSet(); - for (String site3 : site3s) { - VTECPartners vtecPartners = VTECPartners.getInstance(site3); - List wfoList = (List) vtecPartners - .getattr("VTEC_DECODER_SITES"); - wfoSet.addAll(wfoList); - String spcSite = (String) vtecPartners - .getattr("VTEC_SPC_SITE"); - wfoSet.add(spcSite); - String tpcSite = (String) vtecPartners - .getattr("VTEC_TPC_SITE"); - wfoSet.add(tpcSite); - } + Set wfoSet = getDecoderSites(siteId); wfoSet.add(siteId); wfos = wfoSet.toArray(new String[0]); } // We have an array of 3- or 4-char WFOs to filter against. // We need a String "KMFL,KTBW,..." for the query. + SiteMap siteMap = SiteMap.getInstance(); StringBuilder wfosb = new StringBuilder(); String sep = ""; for (String wfo : wfos) { @@ -229,6 +250,36 @@ public class ActiveTable { false); } + private static Set getDecoderSites(String siteId) { + SiteMap siteMap = SiteMap.getInstance(); + + // Use the 3-char site or VTEC_DECODER_SITES will be empty + Set site3s = siteMap.getSite3LetterIds(siteId); + Set wfoSet = new HashSet(); + for (String site3 : site3s) { + VTECPartners vtecPartners = VTECPartners.getInstance(site3); + @SuppressWarnings("unchecked") + List wfoList = (List) vtecPartners + .getattr("VTEC_DECODER_SITES"); + wfoSet.addAll(wfoList); + String spcSite = (String) vtecPartners.getattr("VTEC_SPC_SITE"); + wfoSet.add(spcSite); + String tpcSite = (String) vtecPartners.getattr("VTEC_TPC_SITE"); + wfoSet.add(tpcSite); + } + return wfoSet; + } + + /** + * Get next ETN for a specific site and phensig + * + * @param siteId + * @param mode + * @param phensig + * @param currentTime + * @param isLock + * @return next ETN + */ public static Integer getNextEtn(String siteId, ActiveTableMode mode, String phensig, Calendar currentTime, boolean isLock) { String lockName = getEtnClusterLockName(siteId, mode); @@ -312,11 +363,38 @@ public class ActiveTable { mode = ActiveTableMode.OPERATIONAL; } - MergeResult result = filterTable(siteId, - getActiveTable(siteId, mode), newRecords, mode, offsetSecs); + IPerformanceStatusHandler perfStat = PerformanceStatus + .getHandler("ActiveTable"); + ITimer timer = TimeUtil.getTimer(); + timer.start(); + List activeTable = getActiveTable(siteId, mode); + timer.stop(); + perfStat.logDuration("getActiveTable", timer.getElapsedTime()); + // get decoder sites to see if we need to backup active table + Set decoderSites = getDecoderSites(siteId); + + // if any new record is from one of the decoder sites + // we need to queue a backup + for (ActiveTableRecord rec : newRecords) { + if (decoderSites.contains(rec.getOfficeid())) { + ActiveTableBackup.queue(mode, activeTable); + break; + } + } + + timer.reset(); + timer.start(); + MergeResult result = filterTable(siteId, activeTable, newRecords, + mode, offsetSecs); + timer.stop(); + perfStat.logDuration("filterTable", timer.getElapsedTime()); + + timer.reset(); + timer.start(); updateTable(siteId, result, mode); - + timer.stop(); + perfStat.logDuration("updateTable", timer.getElapsedTime()); if (result.changeList.size() > 0) { sendNotification(mode, result.changeList, "VTECDecoder"); } @@ -349,25 +427,16 @@ public class ActiveTable { args.put("offsetSecs", offsetSecs); MergeResult result = null; try { + PythonScript python = threadLocalPythonScript.get(); try { - python = new PythonScript(filePath, includePath, - ActiveTable.class.getClassLoader()); - try { - result = (MergeResult) python - .execute("mergeFromJava", args); - } catch (JepException e) { - statusHandler.handle(Priority.PROBLEM, - "Error updating active table", e); - } + result = (MergeResult) python.execute("mergeFromJava", args); } catch (JepException e) { statusHandler.handle(Priority.PROBLEM, - "Error initializing active table python", e); - } - } finally { - if (python != null) { - python.dispose(); - python = null; + "Error updating active table", e); } + } catch (Exception e) { + statusHandler.handle(Priority.PROBLEM, + "Error initializing active table python", e); } return result; @@ -483,15 +552,32 @@ public class ActiveTable { } } + /** + * Merge new records into the active table + * + * @param newRecords + * records to be merged + * @return Exception if any occurs during merge + */ public Exception merge(List newRecords) { return merge(newRecords, 0.0f); } + /** + * Merge new records into the active table + * + * @param newRecords + * records to be merged + * @param timeOffset + * time offset for practice mode in displaced real time mode + * @return Exception if any occurs during merge + */ public Exception merge(List newRecords, float timeOffset) { Exception exc = null; try { if (newRecords != null) { - String siteId = newRecords.get(0).getOfficeid(); + String siteId = SiteUtil.getSite(); + siteId = SiteMap.getInstance().getSite4LetterId(siteId); updateActiveTable(siteId, newRecords, timeOffset); } } catch (Throwable t) { @@ -596,10 +682,15 @@ public class ActiveTable { } } - public void dispose() { - python.dispose(); - } - + /** + * Clear the practice active table for the requested site + * + * @param requestedSiteId + * site ID + * @param mode + * unused (removed in later build) + * @throws DataAccessLayerException + */ public static void clearPracticeTable(String requestedSiteId, ActiveTableMode mode) throws DataAccessLayerException { CoreDao dao = practiceDao; @@ -612,6 +703,13 @@ public class ActiveTable { dao.executeNativeSql(sql); } + /** + * Dump product text to temp file + * + * @param productText + * product text + * @return the temp file + */ public static File dumpProductToTempFile(String productText) { File file = Util.createTempFile(productText.getBytes(), "vtec"); file.deleteOnExit(); diff --git a/edexOsgi/com.raytheon.uf.edex.activetable/src/com/raytheon/uf/edex/activetable/ActiveTableBackup.java b/edexOsgi/com.raytheon.uf.edex.activetable/src/com/raytheon/uf/edex/activetable/ActiveTableBackup.java new file mode 100644 index 0000000000..65050de43b --- /dev/null +++ b/edexOsgi/com.raytheon.uf.edex.activetable/src/com/raytheon/uf/edex/activetable/ActiveTableBackup.java @@ -0,0 +1,231 @@ +/** + * This software was developed and / or modified by Raytheon Company, + * pursuant to Contract DG133W-05-CQ-1067 with the US Government. + * + * U.S. EXPORT CONTROLLED TECHNICAL DATA + * This software product contains export-restricted data whose + * export/transfer/disclosure is restricted by U.S. law. Dissemination + * to non-U.S. persons whether in the United States or abroad requires + * an export license or other authorization. + * + * Contractor Name: Raytheon Company + * Contractor Address: 6825 Pine Street, Suite 340 + * Mail Stop B8 + * Omaha, NE 68106 + * 402.291.0100 + * + * See the AWIPS II Master Rights File ("Master Rights File.pdf") for + * further licensing information. + **/ +package com.raytheon.uf.edex.activetable; + +import java.io.File; +import java.io.FilenameFilter; +import java.util.HashMap; +import java.util.List; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.LinkedBlockingQueue; + +import jep.JepException; + +import org.apache.commons.io.filefilter.WildcardFileFilter; + +import com.raytheon.uf.common.activetable.ActiveTableMode; +import com.raytheon.uf.common.activetable.ActiveTableRecord; +import com.raytheon.uf.common.activetable.VTECPartners; +import com.raytheon.uf.common.localization.IPathManager; +import com.raytheon.uf.common.localization.LocalizationContext; +import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel; +import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType; +import com.raytheon.uf.common.localization.PathManagerFactory; +import com.raytheon.uf.common.python.PyUtil; +import com.raytheon.uf.common.python.PythonScript; +import com.raytheon.uf.common.status.IPerformanceStatusHandler; +import com.raytheon.uf.common.status.IUFStatusHandler; +import com.raytheon.uf.common.status.PerformanceStatus; +import com.raytheon.uf.common.status.UFStatus; +import com.raytheon.uf.common.status.UFStatus.Priority; +import com.raytheon.uf.common.time.util.ITimer; +import com.raytheon.uf.common.time.util.TimeUtil; +import com.raytheon.uf.common.util.FileUtil; + +/** + * Perform Active Table Backup + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Jun 17, 2014  #3296     randerso    Initial creation
+ * 
+ * 
+ * + * @author randerso + * @version 1.0 + */ + +public class ActiveTableBackup { + private static final transient IUFStatusHandler statusHandler = UFStatus + .getHandler(ActiveTableBackup.class); + + private static class BackupRequest { + ActiveTableMode activeTableMode; + + List activeTable; + + BackupRequest(ActiveTableMode activeTableMode, + List activeTable) { + this.activeTableMode = activeTableMode; + this.activeTable = activeTable; + } + } + + private static int QUEUE_LIMIT = 10; + + private static BlockingQueue queue = new LinkedBlockingQueue( + QUEUE_LIMIT); + + private static ThreadLocal threadLocalPythonScript = new ThreadLocal() { + + /* + * (non-Javadoc) + * + * @see java.lang.ThreadLocal#initialValue() + */ + @Override + protected PythonScript initialValue() { + try { + IPathManager pathMgr = PathManagerFactory.getPathManager(); + LocalizationContext commonCx = pathMgr.getContext( + LocalizationType.COMMON_STATIC, LocalizationLevel.BASE); + String filePath = pathMgr.getFile(commonCx, + "vtec" + File.separator + "VTECTableUtil.py").getPath(); + String siteId = pathMgr.getContext( + LocalizationType.COMMON_STATIC, LocalizationLevel.SITE) + .getContextName(); + String includePath = PyUtil.buildJepIncludePath( + ActiveTablePyIncludeUtil.getCommonPythonIncludePath(), + ActiveTablePyIncludeUtil.getVtecIncludePath(siteId)); + + PythonScript python = new PythonScript(filePath, includePath, + ActiveTableBackup.class.getClassLoader()); + return python; + } catch (JepException e) { + throw new RuntimeException(e); + } + } + + }; + + private static Runnable target = new Runnable() { + + @Override + public void run() { + IPerformanceStatusHandler perfStat = PerformanceStatus + .getHandler("ActiveTable"); + ITimer timer = TimeUtil.getTimer(); + long lastPurge = 0; + while (true) { + try { + BackupRequest request = queue.take(); + timer.reset(); + timer.start(); + IPathManager pathMgr = PathManagerFactory.getPathManager(); + LocalizationContext ctx = pathMgr.getContext( + LocalizationType.EDEX_STATIC, + LocalizationLevel.SITE); + String siteId = ctx.getContextName(); + File backupDir = pathMgr.getFile(ctx, + FileUtil.join("vtec", "backup")).getAbsoluteFile(); + + try { + PythonScript python = threadLocalPythonScript.get(); + HashMap args = new HashMap( + 4, 1.0f); + args.put("activeTable", request.activeTable); + args.put("activeTableMode", + request.activeTableMode.toString()); + args.put("filePath", backupDir.getParent()); + args.put("siteId", siteId); + try { + python.execute("backupActiveTable", args); + } catch (JepException e) { + statusHandler.handle(Priority.PROBLEM, + "Error backing up active table", e); + } + } catch (Exception e) { + statusHandler.handle(Priority.PROBLEM, + "Error initializing active table python", e); + } + timer.stop(); + perfStat.logDuration("backup activeTable", + timer.getElapsedTime()); + + long now = System.currentTimeMillis(); + // don't run purge more than once a day + if ((now - lastPurge) > TimeUtil.MILLIS_PER_DAY) { + timer.reset(); + timer.start(); + lastPurge = now; + // get purge age in hours + long purgeAge = ((Number) VTECPartners.getInstance( + siteId).getattr("VTEC_BACKUP_TABLE_PURGE_TIME", + 168 * 4)).longValue(); + + // compute purge time + long purgeTime = now + - (purgeAge * TimeUtil.MILLIS_PER_HOUR); + + // file filter for backup files for the requested mode + FilenameFilter filter = new WildcardFileFilter("*" + + request.activeTableMode.toString() + "*.gz"); + + // purge any backup file older than purge time; + for (File file : backupDir.listFiles(filter)) { + if (file.lastModified() < purgeTime) { + file.delete(); + } + } + + timer.stop(); + perfStat.logDuration("purge activeTable backups", + timer.getElapsedTime()); + } + } catch (Exception e) { + statusHandler.handle(Priority.PROBLEM, + e.getLocalizedMessage(), e); + } + } + } + + }; + + private static Thread backupJob = new Thread(target, "activeTableBackup"); + + /** + * Queue an active table backup request + * + * @param activeTableMode + * @param activeTable + */ + public static void queue(ActiveTableMode activeTableMode, + List activeTable) { + BackupRequest req = new BackupRequest(activeTableMode, activeTable); + try { + queue.add(req); + } catch (IllegalStateException e) { + // discard a backup request due to queue full + BackupRequest discard = queue.poll(); + queue.add(req); + if (discard != null) { + statusHandler + .warn("ActiveTable backup request discarded, queue full"); + } + } + if (!backupJob.isAlive()) { + backupJob.start(); + } + } +} diff --git a/edexOsgi/com.raytheon.uf.edex.activetable/src/com/raytheon/uf/edex/activetable/ActiveTableSrv.java b/edexOsgi/com.raytheon.uf.edex.activetable/src/com/raytheon/uf/edex/activetable/ActiveTableSrv.java index ec80df322b..eeb25bedc8 100644 --- a/edexOsgi/com.raytheon.uf.edex.activetable/src/com/raytheon/uf/edex/activetable/ActiveTableSrv.java +++ b/edexOsgi/com.raytheon.uf.edex.activetable/src/com/raytheon/uf/edex/activetable/ActiveTableSrv.java @@ -19,17 +19,18 @@ **/ package com.raytheon.uf.edex.activetable; -import java.util.HashMap; import java.util.List; -import java.util.Map; import com.raytheon.edex.esb.Headers; import com.raytheon.uf.common.activetable.ActiveTableMode; import com.raytheon.uf.common.activetable.ActiveTableRecord; import com.raytheon.uf.common.dataplugin.warning.AbstractWarningRecord; import com.raytheon.uf.common.status.IUFStatusHandler; +import com.raytheon.uf.common.status.PerformanceStatus; import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus.Priority; +import com.raytheon.uf.common.time.util.ITimer; +import com.raytheon.uf.common.time.util.TimeUtil; /** * Service for the VTEC active table. Determines if the VTEC product corresponds @@ -43,6 +44,7 @@ import com.raytheon.uf.common.status.UFStatus.Priority; * Mar 17, 2009 njensen Initial creation * Jul 14, 2009 #2950 njensen Multiple site support * Dec 21, 2009 #4055 njensen No site filtering + * Jun 17, 2014 3296 randerso Added performance logging * * * @@ -54,16 +56,30 @@ public class ActiveTableSrv { private static final transient IUFStatusHandler statusHandler = UFStatus .getHandler(ActiveTableSrv.class); - private static Map activeTableMap = new HashMap(); + private static ThreadLocal threadLocalActiveTable = new ThreadLocal() { + /* + * (non-Javadoc) + * + * @see java.lang.ThreadLocal#initialValue() + */ + @Override + protected ActiveTable initialValue() { + return new ActiveTable(); + } + + }; + + /** + * Merge VTEC info from new warning records into the active table + * + * @param records + */ public void vtecArrived(List records) { + ITimer timer = TimeUtil.getTimer(); + timer.start(); try { - long threadId = Thread.currentThread().getId(); - ActiveTable activeTable = activeTableMap.get(threadId); - if (activeTable == null) { - activeTable = new ActiveTable(); - activeTableMap.put(threadId, activeTable); - } + ActiveTable activeTable = threadLocalActiveTable.get(); if (records != null && records.size() > 0) { activeTable.merge(ActiveTableRecord.transformFromWarnings( records, ActiveTableMode.OPERATIONAL)); @@ -72,8 +88,18 @@ public class ActiveTableSrv { statusHandler.handle(Priority.PROBLEM, "Error merging active table", t); } + timer.stop(); + PerformanceStatus.getHandler("ActiveTable").logDuration( + "Total time to process " + records.size() + " records", + timer.getElapsedTime()); } + /** + * Merge new warning records into the practice active table + * + * @param records + * @param headers + */ public void practiceVtecArrived(List records, Headers headers) { Integer offsetSeconds = null; @@ -84,12 +110,7 @@ public class ActiveTableSrv { offsetSeconds = Integer.valueOf(0); } if (records != null && records.size() > 0) { - long threadId = Thread.currentThread().getId(); - ActiveTable activeTable = activeTableMap.get(threadId); - if (activeTable == null) { - activeTable = new ActiveTable(); - activeTableMap.put(threadId, activeTable); - } + ActiveTable activeTable = threadLocalActiveTable.get(); try { activeTable.merge(ActiveTableRecord.transformFromWarnings( records, ActiveTableMode.PRACTICE), offsetSeconds diff --git a/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/ActiveTable.py b/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/ActiveTable.py index f7c35bc5f9..c26f5b2fd0 100644 --- a/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/ActiveTable.py +++ b/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/ActiveTable.py @@ -28,6 +28,9 @@ # 06/11/13 #2083 randerso Log active table changes, save backups # 03/06/14 #2883 randerso Pass siteId into mergeFromJava # 03/25/14 #2884 randerso Added xxxid to VTECChange +# 06/17/13 #3296 randerso Moved active table backup and purging +# to a separate thread in java. +# Added performance logging # import time @@ -40,6 +43,10 @@ from com.raytheon.uf.common.localization import PathManagerFactory from com.raytheon.uf.common.localization import LocalizationContext_LocalizationType as LocalizationType from com.raytheon.uf.common.localization import LocalizationContext_LocalizationLevel as LocalizationLevel +from com.raytheon.uf.common.time.util import TimeUtil +from com.raytheon.uf.common.status import PerformanceStatus +perfStat = PerformanceStatus.getHandler("ActiveTable") + class ActiveTable(VTECTableUtil.VTECTableUtil): def __init__(self, activeTableMode): @@ -60,6 +67,8 @@ class ActiveTable(VTECTableUtil.VTECTableUtil): changedFlag = False #delete "obsolete" records from the old table. + timer = TimeUtil.getTimer() + timer.start() vts = VTECTableSqueeze.VTECTableSqueeze(self._time+offsetSecs) activeTable, tossRecords = vts.squeeze(activeTable) for r in tossRecords: @@ -67,9 +76,13 @@ class ActiveTable(VTECTableUtil.VTECTableUtil): del vts if len(tossRecords): changedFlag = True + timer.stop(); + perfStat.logDuration("updateActiveTable squeeze", timer.getElapsedTime()); #expand out any 000 UGC codes, such as FLC000, to indicate all #zones. + timer.reset() + timer.start() newRecExpanded = [] compare1 = ['phen', 'sig', 'officeid', 'etn', 'pil'] for newR in newRecords: @@ -85,11 +98,15 @@ class ActiveTable(VTECTableUtil.VTECTableUtil): else: newRecExpanded.append(newR) newRecords = newRecExpanded + timer.stop(); + perfStat.logDuration("updateActiveTable expand", timer.getElapsedTime()); # match new records with old records, with issue time is different # years and event times overlap. Want to reassign ongoing events # from last year's issueTime to be 12/31/2359z, rather than the # real issuetime (which is this year's). + timer.reset() + timer.start() compare = ['phen', 'sig', 'officeid', 'pil', 'etn'] for newR in newRecords: cyear = time.gmtime(newR['issueTime'])[0] #current year issuance time @@ -106,9 +123,13 @@ class ActiveTable(VTECTableUtil.VTECTableUtil): "\nNewRec: ", self.printEntry(newR), "OldRec: ", self.printEntry(oldR)) newR['issueTime'] = lastYearIssueTime + timer.stop(); + perfStat.logDuration("updateActiveTable match", timer.getElapsedTime()); # split records out by issuance year for processing + timer.reset() + timer.start() newRecDict = {} #key is issuance year oldRecDict = {} years = [] @@ -126,8 +147,12 @@ class ActiveTable(VTECTableUtil.VTECTableUtil): oldRecDict[issueYear] = records if issueYear not in years: years.append(issueYear) + timer.stop(); + perfStat.logDuration("updateActiveTable split", timer.getElapsedTime()); # process each year + timer.reset() + timer.start() compare = ['id', 'phen', 'sig', 'officeid', 'pil'] for year in years: @@ -166,8 +191,12 @@ class ActiveTable(VTECTableUtil.VTECTableUtil): oldR['state'] = "Replaced" changedFlag = True updatedTable.append(oldR) + timer.stop(); + perfStat.logDuration("updateActiveTable process", timer.getElapsedTime()); #always add in the new records (except for ROU) + timer.reset() + timer.start() compare = ['id', 'phen', 'sig', 'officeid', 'pil', 'etn'] for year in newRecDict.keys(): newRecords = newRecDict[year] @@ -199,8 +228,12 @@ class ActiveTable(VTECTableUtil.VTECTableUtil): rec = (newR['officeid'], newR['pil'], newR['phensig'], newR['xxxid']) if rec not in changes: changes.append(rec) + timer.stop(); + perfStat.logDuration("updateActiveTable add", timer.getElapsedTime()); #filter out any captured text and overviewText if not in the categories + timer.reset() + timer.start() cats = self._getTextCaptureCategories() if cats is not None: for rec in updatedTable: @@ -210,6 +243,8 @@ class ActiveTable(VTECTableUtil.VTECTableUtil): if rec.has_key('overviewText'): del rec['overviewText'] + timer.stop(); + perfStat.logDuration("updateActiveTable filter", timer.getElapsedTime()); return updatedTable, tossRecords, changes, changedFlag # time overlaps, if tr1 overlaps tr2 (adjacent is not an overlap) @@ -250,35 +285,35 @@ class ActiveTable(VTECTableUtil.VTECTableUtil): return outTable, purgedRecords, changes, changedFlag def mergeFromJava(siteId, activeTable, newRecords, logger, mode, offsetSecs=0): + perfStat.log("mergeFromJava called for site: %s, activeTable: %d , newRecords: %d" % + (siteId, activeTable.size(), newRecords.size())) + timer = TimeUtil.getTimer() + timer.start() pyActive = [] szActive = activeTable.size() for i in range(szActive): pyActive.append(ActiveTableRecord.ActiveTableRecord(activeTable.get(i))) - decoderSites = VTECPartners.VTEC_DECODER_SITES - decoderSites.append(VTECPartners.get4ID(siteId)) - decoderSites.append(VTECPartners.VTEC_SPC_SITE) - decoderSites.append(VTECPartners.VTEC_TPC_SITE) - - backup = False pyNew = [] szNew = newRecords.size() for i in range(szNew): rec = ActiveTableRecord.ActiveTableRecord(newRecords.get(i)) - if rec['officeid'] in decoderSites: - backup = True pyNew.append(rec) active = ActiveTable(mode) - if backup: - oldActiveTable = active._convertTableToPurePython(pyActive, siteId) - active.saveOldActiveTable(oldActiveTable) - pTime = getattr(VTECPartners, "VTEC_BACKUP_TABLE_PURGE_TIME",168) - active.purgeOldSavedTables(pTime) + logger.info("Updating " + mode + " Active Table: new records\n" + + active.printActiveTable(pyNew, combine=1)) + + timer.stop() + perfStat.logDuration("mergeFromJava preprocess", timer.getElapsedTime()); updatedTable, purgeRecords, changes, changedFlag = active.activeTableMerge(pyActive, pyNew, offsetSecs) + perfStat.log("mergeFromJava activeTableMerge returned updateTable: %d, purgeRecords: %d, changes: %d" % + (len(updatedTable), len(purgeRecords), len(changes))) + timer.reset() + timer.start() logger.info("Updated " + mode + " Active Table: purged\n" + active.printActiveTable(purgeRecords, combine=1)) @@ -314,4 +349,6 @@ def mergeFromJava(siteId, activeTable, newRecords, logger, mode, offsetSecs=0): from com.raytheon.uf.common.activetable import MergeResult result = MergeResult(updatedList, purgedList, changeList) + timer.stop() + perfStat.logDuration("mergeFromJava postprocess", timer.getElapsedTime()); return result diff --git a/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/MergeVTEC.py b/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/MergeVTEC.py index a58d73dac9..3fa580baaa 100644 --- a/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/MergeVTEC.py +++ b/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/MergeVTEC.py @@ -43,6 +43,7 @@ import logging import os import sys import time +import errno import ActiveTableRecord import siteConfig diff --git a/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/VTECTableSqueeze.py b/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/VTECTableSqueeze.py index 94e12be3c3..dc7224e602 100644 --- a/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/VTECTableSqueeze.py +++ b/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/VTECTableSqueeze.py @@ -17,6 +17,14 @@ # See the AWIPS II Master Rights File ("Master Rights File.pdf") for # further licensing information. ## +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# 06/17/13 #3296 randerso Default debug to False to avoid logging overhead +# + import os, sys, time, copy, LogStream # This class takes a VTEC active table and eliminates unnecessary @@ -27,7 +35,7 @@ import os, sys, time, copy, LogStream class VTECTableSqueeze: #constructor - def __init__(self, currentTime, debug=True): + def __init__(self, currentTime, debug=False): self.__ctime = currentTime self.__thisYear = time.gmtime(self.__ctime)[0] self.__debug = debug diff --git a/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/VTECTableUtil.py b/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/VTECTableUtil.py index 74a1d4ae0f..2fbd01a30e 100644 --- a/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/VTECTableUtil.py +++ b/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/VTECTableUtil.py @@ -17,7 +17,14 @@ # See the AWIPS II Master Rights File ("Master Rights File.pdf") for # further licensing information. ## -# Utility classes for the VTEC active table +# Utility classes for the VTEC util table +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# 06/17/13 #3296 randerso Moved active table backup and purging +# to a separate thread in java. import copy import cPickle @@ -318,7 +325,7 @@ class VTECTableUtil: os.makedirs(directory) except OSError as e: if e.errno != errno.EEXIST: - LogStream.logProblem("Could not create active table backup directory:", + LogStream.logProblem("Could not create util table backup directory:", directory, LogStream.exc()) raise e @@ -384,3 +391,14 @@ class VTECTableUtil: return JUtil.javaObjToPyVal(javaDictFormat) +def backupActiveTable(activeTable, activeTableMode, filePath, siteId): + import ActiveTableRecord + pyActive = [] + szActive = activeTable.size() + for i in range(szActive): + pyActive.append(ActiveTableRecord.ActiveTableRecord(activeTable.get(i))) + + # create a dummy name to simplify the file access code in VTECTableUtil + util = VTECTableUtil(os.path.join(filePath, activeTableMode + ".tbl")) + oldActiveTable = util._convertTableToPurePython(pyActive, siteId) + util.saveOldActiveTable(oldActiveTable) From 26df246878e5276c66b1dc00d14ee61c15f8de00 Mon Sep 17 00:00:00 2001 From: Ron Anderson Date: Tue, 24 Jun 2014 10:06:54 -0500 Subject: [PATCH 09/39] Omaha #3296 A few more minor performance tweaks and some addtional logging. Change-Id: Iab603f6f7420a11c5c5cae82df7ebb96f66b0945 (cherry picked from commit 9e6a14877578177e4cfb0c5698097750bde6f280) Former-commit-id: 319819d3a737dde3f534352885aaa6cc52add5dd [formerly c7a74ab5b1c67abd805d1927614084d9d110407a] [formerly 2c5f910f90e90c5bbce79ced4aec73949df41ba7] [formerly 319819d3a737dde3f534352885aaa6cc52add5dd [formerly c7a74ab5b1c67abd805d1927614084d9d110407a] [formerly 2c5f910f90e90c5bbce79ced4aec73949df41ba7] [formerly 4123073c4e1784229f1b81dde0e9cc68b754d19e [formerly 2c5f910f90e90c5bbce79ced4aec73949df41ba7 [formerly a0384ccfb30a877f14893c6cfa62d92117c0bb87]]]] Former-commit-id: 4123073c4e1784229f1b81dde0e9cc68b754d19e Former-commit-id: 9210f3a55de00bb368bfa2d36a7bc2a29480c0e3 [formerly 0329b4d8f4322c2720cb2d3d784f21ec0c5fe0d9] [formerly 0e147fb71ca969d1fc46cffd1962c97ca7cece30 [formerly 892eb7095275ff1cc1f2535f648ef933f124345a]] Former-commit-id: 05ef0d1dfd0a62197a13dc4c5614043584e047f3 [formerly bb91362572fc5e608fa8df28f3f9dd0bd45e7c55] Former-commit-id: ac6b3b0b100f5578447f4f7fb5fcbbdc4db2ce33 --- .../common_static/base/vtec/ActiveTable.py | 6 +-- .../base/vtec/VTECTableSqueeze.py | 46 +++++++++++++------ 2 files changed, 36 insertions(+), 16 deletions(-) diff --git a/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/ActiveTable.py b/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/ActiveTable.py index c26f5b2fd0..0105bf91b6 100644 --- a/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/ActiveTable.py +++ b/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/ActiveTable.py @@ -333,15 +333,15 @@ def mergeFromJava(siteId, activeTable, newRecords, logger, mode, offsetSecs=0): logger.info("Updated " + mode + " Active Table: decoded\n" + active.printActiveTable(decoded, combine=1)) - updatedList = ArrayList() + updatedList = ArrayList(len(updatedTable)) for x in updatedTable: updatedList.add(x.javaRecord()) - purgedList = ArrayList() + purgedList = ArrayList(len(purgeRecords)) for x in purgeRecords: purgedList.add(x.javaRecord()) - changeList = ArrayList() + changeList = ArrayList(len(changes)) if (changedFlag): from com.raytheon.uf.common.activetable import VTECChange for c in changes: diff --git a/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/VTECTableSqueeze.py b/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/VTECTableSqueeze.py index dc7224e602..78da869f11 100644 --- a/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/VTECTableSqueeze.py +++ b/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/VTECTableSqueeze.py @@ -1,19 +1,19 @@ ## # This software was developed and / or modified by Raytheon Company, -# pursuant to Contract DG133W-05-CQ-1067 with the US Government. -# -# U.S. EXPORT CONTROLLED TECHNICAL DATA +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA # This software product contains export-restricted data whose # export/transfer/disclosure is restricted by U.S. law. Dissemination # to non-U.S. persons whether in the United States or abroad requires # an export license or other authorization. # -# Contractor Name: Raytheon Company -# Contractor Address: 6825 Pine Street, Suite 340 -# Mail Stop B8 -# Omaha, NE 68106 -# 402.291.0100 -# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# # See the AWIPS II Master Rights File ("Master Rights File.pdf") for # further licensing information. ## @@ -23,10 +23,16 @@ # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 06/17/13 #3296 randerso Default debug to False to avoid logging overhead +# Added performance logging # import os, sys, time, copy, LogStream +from com.raytheon.uf.common.time.util import TimeUtil +from com.raytheon.uf.common.status import PerformanceStatus +perfStat = PerformanceStatus.getHandler("ActiveTable") +timer = TimeUtil.getTimer() + # This class takes a VTEC active table and eliminates unnecessary # records. Records purged consist of old SPC watches, old Tropical # events, last year's records, and extraneous records not needed for @@ -49,7 +55,11 @@ class VTECTableSqueeze: LogStream.logDebug(self.__printActiveTable(table)) # modify old UFN events (in case fcstrs didn't CAN them) + timer.reset() + timer.start() table, modTable = self.__modifyOldUFNEvents(table) + timer.stop() + perfStat.logDuration("updateActiveTable squeeze __modifyOldUFNEvents", timer.getElapsedTime()); if self.__debug: LogStream.logDebug("************** MOD UFN TABLE *********************") for old, new in modTable: @@ -58,8 +68,12 @@ class VTECTableSqueeze: LogStream.logDebug(" -----------") # remove the national center and short fused events + timer.reset() + timer.start() shortWFO, shortNC, purgeT = \ self.__removeOldNationalAndShortFusedEvents(table) + timer.stop() + perfStat.logDuration("updateActiveTable squeeze __removeOldNationalAndShortFusedEvents", timer.getElapsedTime()); if self.__debug: LogStream.logDebug("************** SHORT WFO TABLE *********************") LogStream.logDebug(self.__printActiveTable(shortWFO)) @@ -69,10 +83,18 @@ class VTECTableSqueeze: LogStream.logDebug(self.__printActiveTable(purgeT)) # separate out the shortWFO into dictionary structure + timer.reset() + timer.start() dict = self.__separateTable(shortWFO) + timer.stop() + perfStat.logDuration("updateActiveTable squeeze __separateTable", timer.getElapsedTime()); # purge old entries with LowerETNs that aren't in effect + timer.reset() + timer.start() shorterT, purgeT2 = self.__purgeOldEntriesWithLowerETNs(dict) + timer.stop() + perfStat.logDuration("updateActiveTable squeeze __purgeOldEntriesWithLowerETNs", timer.getElapsedTime()); if self.__debug: LogStream.logDebug("************** TRIMMED WFO TABLE ******************") LogStream.logDebug(self.__printActiveTable(shorterT)) @@ -80,12 +102,10 @@ class VTECTableSqueeze: LogStream.logDebug(self.__printActiveTable(purgeT2)) #add in any shortNC entries to final table - for r in shortNC: - shorterT.append(r) + shorterT.extend(shortNC) #add in the purged entries from before - for r in purgeT2: - purgeT.append(r) + purgeT.extend(purgeT2) if self.__debug: LogStream.logDebug("************** FINAL TABLE ********************") From 21d3d905b1adbc6d727b443f5ccd38047885d319 Mon Sep 17 00:00:00 2001 From: Nate Jensen Date: Wed, 2 Jul 2014 09:17:25 -0500 Subject: [PATCH 10/39] Issue #3337 disable logback packaging data in cave Former-commit-id: 2baedbf6b83fd1f8613491f15982ab8e7f93ad8a [formerly 56363ffc4a43fe5c81f0ea10ebea6aac948f7c25] [formerly c003d7016804e0e2af4b4ba60500ffa4e1c27953] [formerly 2baedbf6b83fd1f8613491f15982ab8e7f93ad8a [formerly 56363ffc4a43fe5c81f0ea10ebea6aac948f7c25] [formerly c003d7016804e0e2af4b4ba60500ffa4e1c27953] [formerly 939fde157548becfb15b7c8241b5d745da109cbb [formerly c003d7016804e0e2af4b4ba60500ffa4e1c27953 [formerly db10ba5a37dbe219110f4f902bf9257f2f220b3d]]]] Former-commit-id: 939fde157548becfb15b7c8241b5d745da109cbb Former-commit-id: 25379a63f64cdc2c18e855198ca714688636345d [formerly c421e2de751d75902e45d0bd43c8ad5155b885ac] [formerly 3c068152fc5db062515196cd9a0c4241b85b8f92 [formerly a2cfcd8716c5b215904c4f0cb3ebd91f359dca1d]] Former-commit-id: f92a2a465f2193ba867848c40d1d3ca215e457ba [formerly 75ffabbcc27d3341404630186c1e17eb8dd531b2] Former-commit-id: b54a9694ee02239620540f5aaae2600ea3c8052d --- .../uf/viz/alertviz/SystemStatusHandler.java | 34 ++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/cave/com.raytheon.uf.viz.alertviz/src/com/raytheon/uf/viz/alertviz/SystemStatusHandler.java b/cave/com.raytheon.uf.viz.alertviz/src/com/raytheon/uf/viz/alertviz/SystemStatusHandler.java index 9c04d56058..0510ac7ed2 100644 --- a/cave/com.raytheon.uf.viz.alertviz/src/com/raytheon/uf/viz/alertviz/SystemStatusHandler.java +++ b/cave/com.raytheon.uf.viz.alertviz/src/com/raytheon/uf/viz/alertviz/SystemStatusHandler.java @@ -39,7 +39,10 @@ import com.raytheon.uf.viz.core.status.VizStatusInternal; /** * Implements status handling by converting status messages into StatusMessages - * and sending them to alertviz + * and sending them to alertviz. + * + * Also logs to a file so the error can be traced to the specific process id and + * as a safety net in case alertviz cannot be reached. * *
  * SOFTWARE HISTORY
@@ -47,6 +50,7 @@ import com.raytheon.uf.viz.core.status.VizStatusInternal;
  * ------------ ---------- ----------- --------------------------
  * Sep 09, 2008 1433       chammack    Initial creation
  * Aug 26, 2013 2142       njensen     Changed to use SLF4J
+ * Jul 02, 2014 3337       njensen     Disabled logback packaging data
  * 
* * @author chammack @@ -62,6 +66,34 @@ public class SystemStatusHandler extends AbstractStatusHandler { private static final Marker FATAL = MarkerFactory.getMarker("FATAL"); + static { + /* + * Disables the packaging data feature of logback (ie how the + * stacktraces list the jar the class is in). Due to the viz dependency + * tree, in some scenarios the determination of the packaging data can + * spend an inordinate amount of time in the OSGi classloader trying to + * find classes. If the viz dependency tree is cleaned up (ie + * modularized, unnecessary imports removed, register buddies reduced) + * then this may be able to be re-enabled without a performance hit. + * + * Unfortunately there is no way to do this other than casting to a + * logback Logger, see http://jira.qos.ch/browse/LOGBACK-730 and + * http://jira.qos.ch/browse/LOGBACK-899 + */ + try { + ((ch.qos.logback.classic.Logger) logger).getLoggerContext() + .setPackagingDataEnabled(false); + } catch (Throwable t) { + /* + * given that this static block is for initializing the logger + * correctly, if that went wrong let's not even try to "log" it, + * just use stderr + */ + System.err.println("Error disabling logback packaging data"); + t.printStackTrace(); + } + } + /* * (non-Javadoc) * From 0f4f7230ef744f0eb4ba737b08e7f2b711c7d79f Mon Sep 17 00:00:00 2001 From: "steve.naples" Date: Wed, 2 Jul 2014 15:30:48 +0000 Subject: [PATCH 11/39] ASM #253 Update RadarBiasTableDialog to remove old code. Change-Id: I003f8dbf520e1e8025afe46266d1ee4849003a6f Former-commit-id: e82b0ae8959fabc06dbe70019a6f92ce5f1db512 [formerly 3d75da3db0434f6e8e1e0e3387864e8c8e91941b] [formerly 66c3241bc4e06a630dc24b880ef3784cb90d9bed] [formerly e82b0ae8959fabc06dbe70019a6f92ce5f1db512 [formerly 3d75da3db0434f6e8e1e0e3387864e8c8e91941b] [formerly 66c3241bc4e06a630dc24b880ef3784cb90d9bed] [formerly 4e959af1b45af66799a4d2fafdd94e6561836bf8 [formerly 66c3241bc4e06a630dc24b880ef3784cb90d9bed [formerly b9f868e0ced53987accf675bfe2ce1a1f4f34da1]]]] Former-commit-id: 4e959af1b45af66799a4d2fafdd94e6561836bf8 Former-commit-id: dbd231a099107ce26fb0851341b1d2047e5e5613 [formerly f1c92f1e3511693e09d5fe5b116fb172bb66d1a2] [formerly 18ba10573377ee74433b2ab0bbbbc0f2efa06dea [formerly 3cfabd29bc7106ad420de1230ee49aa0dfb69441]] Former-commit-id: e33d6b9199b205144f76ed9c11a26bf937dec501 [formerly 93c8f822ccbfaa70f0ad547ac3552e3cf2c1f26a] Former-commit-id: 9f52699bd253fa3a9d2c744b8f88589b42a0ad86 --- .../com/raytheon/viz/mpe/ui/dialogs/RadarBiasTableDialog.java | 1 - 1 file changed, 1 deletion(-) diff --git a/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/dialogs/RadarBiasTableDialog.java b/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/dialogs/RadarBiasTableDialog.java index 27033ba814..1f32b4ec29 100644 --- a/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/dialogs/RadarBiasTableDialog.java +++ b/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/dialogs/RadarBiasTableDialog.java @@ -432,7 +432,6 @@ public class RadarBiasTableDialog extends Dialog { try { float parsedFloat = Float.parseFloat(lbiasTxt.getText()); editbias[ei] = parsedFloat; - manEdit[ei].setSelection(!mbiasBtn.getSelection()); manEdit[ei].setText("YES"); lbiasTxt.setBackground(getParent().getDisplay() .getSystemColor(SWT.COLOR_WHITE)); From b2c35e26d65e9452d19d73d6069599bdd184ed24 Mon Sep 17 00:00:00 2001 From: David Friedman Date: Thu, 3 Jul 2014 13:58:24 +0000 Subject: [PATCH 12/39] ASM #15052 - WarnGen: service backup should use config.xml from failed site Change-Id: Icff8ca2a124da595be6b83ac9f9999831daee0b1 Former-commit-id: b82fb691e0dfd9224b26330fe5103cc9a679df7e [formerly 8784501bba23f3b07926e5410de70fa4d675bc44] [formerly a45fe1dad06c8c4d0df2c0f0df86ccb21d3509b2] [formerly b82fb691e0dfd9224b26330fe5103cc9a679df7e [formerly 8784501bba23f3b07926e5410de70fa4d675bc44] [formerly a45fe1dad06c8c4d0df2c0f0df86ccb21d3509b2] [formerly db8977e2812d0603cfbe949876f44a636bf33201 [formerly a45fe1dad06c8c4d0df2c0f0df86ccb21d3509b2 [formerly f9c0dc09ee7bc692c6f70b4a5ad67bb2c2ed5a20]]]] Former-commit-id: db8977e2812d0603cfbe949876f44a636bf33201 Former-commit-id: 363de7a3c5aa3bdeaa468451e1f2e84fb9fa6e35 [formerly 5270711c5d39b75580d990fe25bdd62ea5d02e71] [formerly c850f84db3b8b601f2bbda41059ace7ce49e7f85 [formerly d36834080e872b33cbd4315adb68249150f34c9a]] Former-commit-id: bb504fd33ed91e33e9927f5c6b5ff9592840208c [formerly 4f53bbd556459ed69f92435e5eef547f60b12c59] Former-commit-id: c44e9f88f62a8f0c52ca6aa65c314f4a0b157c34 --- .../viz/warngen/gui/WarngenDialog.java | 148 ++++++++++++------ .../viz/warngen/gui/WarngenLayer.java | 44 ++++++ .../warning/config/DialogConfiguration.java | 13 ++ .../dataplugin/warning/util/WarnFileUtil.java | 37 ++++- 4 files changed, 191 insertions(+), 51 deletions(-) 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 fc95040d21..62272c75bb 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 @@ -154,6 +154,7 @@ import com.vividsolutions.jts.geom.Polygon; * Oct 01, 2013 DR16612 m.gamazaychikov Fixed inconsistencies with track locking and updateListSelected method * Oct 29, 2013 DR 16734 D. Friedman If redraw-from-hatched-area fails, don't allow the polygon the be used. * Apr 28, 2014 3033 jsanchez Re-initialized the Velocity Engine when switching back up sites. + * Jul 01, 2014 DR 17450 D. Friedman Use list of templates from backup site. * * * @author chammack @@ -482,30 +483,39 @@ public class WarngenDialog extends CaveSWTDialog implements * @param productType2 */ private void createOtherProductsList(Group productType2) { - other = new Button(productType, SWT.RADIO); - other.setText("Other:"); - other.setEnabled(true); - other.addSelectionListener(new SelectionAdapter() { + if (other == null) { + other = new Button(productType, SWT.RADIO); + other.setText("Other:"); + other.setEnabled(true); + other.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent arg0) { - otherSelected(); + @Override + public void widgetSelected(SelectionEvent arg0) { + otherSelected(); + } + + }); + + otherProductListCbo = new Combo(productType, SWT.READ_ONLY + | SWT.DROP_DOWN); + GridData gd = new GridData(SWT.RIGHT, SWT.DEFAULT, true, false); + otherProductListCbo.setLayoutData(gd); + otherProductListCbo.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent arg0) { + otherProductSelected(); + } + + }); + } else { + other.setSelection(false); + if (mainProductBtns.length > 0 && mainProductBtns.length > 0) { + other.moveBelow(mainProductBtns[mainProductBtns.length - 1]); } + otherProductListCbo.moveBelow(other); + } - }); - - otherProductListCbo = new Combo(productType, SWT.READ_ONLY - | SWT.DROP_DOWN); - GridData gd = new GridData(SWT.RIGHT, SWT.DEFAULT, true, false); - otherProductListCbo.setLayoutData(gd); updateOtherProductList(otherProductListCbo); - otherProductListCbo.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent arg0) { - otherProductSelected(); - } - - }); } private void createMainProductButtons(Group productType) { @@ -517,12 +527,13 @@ public class WarngenDialog extends CaveSWTDialog implements mainProducts.add(str); } - String defaultTemplate = warngenLayer.getDialogConfig() - .getDefaultTemplate(); - if ((defaultTemplate == null) || defaultTemplate.equals("")) { - defaultTemplate = mainProducts.get(0).split("/")[1]; - } + String defaultTemplate = getDefaultTemplate(); + if (mainProductBtns != null) { + for (Button button : mainProductBtns) { + button.dispose(); + } + } mainProductBtns = new Button[mainProducts.size()]; if (mainProducts.size() > 0) { @@ -538,24 +549,28 @@ public class WarngenDialog extends CaveSWTDialog implements mainProductBtns[0].addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { - changeTemplate(mainProducts.get(0).split("/")[1]); + uiChangeTemplate(mainProducts.get(0).split("/")[1]); } }); } GridData gd = new GridData(SWT.RIGHT, SWT.DEFAULT, true, false); - gd.horizontalIndent = 30; - updateListCbo = new Combo(productType, SWT.READ_ONLY | SWT.DROP_DOWN); - updateListCbo.setLayoutData(gd); - recreateUpdates(); + if (updateListCbo == null) { + gd.horizontalIndent = 30; + updateListCbo = new Combo(productType, SWT.READ_ONLY | SWT.DROP_DOWN); + updateListCbo.setLayoutData(gd); + recreateUpdates(); - updateListCbo.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent arg0) { - updateListSelected(); - } + updateListCbo.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent arg0) { + updateListSelected(); + } - }); + }); + } else if (mainProductBtns.length > 0) { + updateListCbo.moveBelow(mainProductBtns[0]); + } for (int cnt = 1; cnt < mainProducts.size(); cnt++) { final String[] tmp = mainProducts.get(cnt).split("/"); @@ -584,7 +599,7 @@ public class WarngenDialog extends CaveSWTDialog implements } } - changeTemplate(templateName); + uiChangeTemplate(templateName); } } }); @@ -681,7 +696,7 @@ public class WarngenDialog extends CaveSWTDialog implements backupGroup.setLayout(new GridLayout(2, false)); Label label2 = new Label(backupGroup, SWT.BOLD); - label2.setText("Full:"); + label2.setText("WFO:"); label2.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); backupSiteCbo = new Combo(backupGroup, SWT.READ_ONLY | SWT.DROP_DOWN); backupSiteCbo.addSelectionListener(new SelectionAdapter() { @@ -1320,9 +1335,28 @@ public class WarngenDialog extends CaveSWTDialog implements } else { new TemplateRunnerInitJob(backupSite).schedule(); } - // Refresh template - changeTemplate(warngenLayer.getTemplateName()); - resetPressed(); + + /* + * When the product selection buttons are recreated below, the + * button for the default template will be selected and mainProducts + * will have been recreated. Then getDefaultTemplate() can be used + * here to change the state. + */ + createMainProductButtons(productType); + createOtherProductsList(productType); + + // Don't let errors prevent the new controls from being displayed! + try { + changeTemplate(getDefaultTemplate()); + resetPressed(); + } catch (Exception e) { + statusHandler + .error("Error occurred while switching to the default template.", + e); + } + + productType.layout(true, true); + getShell().pack(true); } if (backupSiteCbo.getSelectionIndex() == 0) { @@ -1483,6 +1517,19 @@ public class WarngenDialog extends CaveSWTDialog implements return result; } + /** Called by controls that can change the current template. Do not + * do anything if the request template is already selected. This + * check is necessary to prevent certain state being reset if + * a followup has been selected as this is not handled by + * changeTemplate() (DR 14515.) + */ + private void uiChangeTemplate(String templateName) { + if (templateName.equals(warngenLayer.getTemplateName())) { + return; + } + changeTemplate(templateName); + } + /** * This method updates the Warngen Layer and Warngen Dialog based on a new * template selection. This method should also be called when the CWA is @@ -1495,11 +1542,6 @@ public class WarngenDialog extends CaveSWTDialog implements */ private void changeTemplate(String templateName) { - // DR 14515 - if (templateName.equals(warngenLayer.getTemplateName())) { - return; - } - String lastAreaSource = warngenLayer.getConfiguration() .getHatchedAreaSource().getAreaSource(); @@ -1634,6 +1676,7 @@ public class WarngenDialog extends CaveSWTDialog implements otherProducts = new HashMap(); String[] otherProductsStr = warngenLayer.getDialogConfig() .getOtherWarngenProducts().split(","); + theList.removeAll(); for (String str : otherProductsStr) { String[] s = str.split("/"); otherProducts.put(s[0], s[1]); @@ -1784,7 +1827,7 @@ public class WarngenDialog extends CaveSWTDialog implements templateName = otherProducts.get(otherProductListCbo .getItem(otherProductListCbo.getSelectionIndex())); } - changeTemplate(templateName); + uiChangeTemplate(templateName); otherProductListCbo.pack(true); productType.layout(); @@ -2251,7 +2294,7 @@ public class WarngenDialog extends CaveSWTDialog implements templateName = otherProducts.get(otherProductListCbo .getItem(otherProductListCbo.getSelectionIndex())); } - changeTemplate(templateName); + uiChangeTemplate(templateName); } private void refreshDisplay() { @@ -2503,4 +2546,13 @@ public class WarngenDialog extends CaveSWTDialog implements warngenLayer.issueRefresh(); } + private String getDefaultTemplate() { + String defaultTemplate = warngenLayer.getDialogConfig() + .getDefaultTemplate(); + if ((defaultTemplate == null) || defaultTemplate.equals("")) { + defaultTemplate = mainProducts.get(0).split("/")[1]; + } + return defaultTemplate; + } + } diff --git a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gui/WarngenLayer.java b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gui/WarngenLayer.java index 9d660771d4..72506a7994 100644 --- a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gui/WarngenLayer.java +++ b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gui/WarngenLayer.java @@ -209,6 +209,7 @@ import com.vividsolutions.jts.io.WKTReader; * 04/15/2014 DR 17247 D. Friedman Rework error handling in AreaHatcher. * 04/28,2014 3033 jsanchez Properly handled back up configuration (*.xml) files. Set backupSite to null when backup site is not selected. * 05/16/2014 DR 17365 D. Friedman Check if moved vertex results in polygon valid in both lat/lon and local coordinates. + * 07/01/2014 DR 17450 D. Friedman Use list of templates from backup site. * * * @author mschenke @@ -1370,6 +1371,49 @@ public class WarngenLayer extends AbstractStormTrackResource { } else { backupSite = site; } + + DialogConfiguration dc = null; + if (backupSite != null) { + boolean haveBackupConfig = DialogConfiguration.isSiteDialogConfigExtant(backupSite); + if (haveBackupConfig) { + try { + dc = DialogConfiguration.loadDialogConfigNoUser(backupSite); + } catch (Exception e) { + statusHandler.error(String.format( + "Unable to load WarnGen configuration for site %s. Falling back to local configuration.", + getLocalizedSite()), e); + } + } else { + statusHandler.warn(String.format( + "WarnGen configuration for site %s does not exist. Falling back to local configuration.", + backupSite)); + } + if (dc == null) { + try { + dc = DialogConfiguration.loadDialogConfigNoUser(LocalizationManager + .getInstance().getCurrentSite()); + } catch (Exception e) { + dc = new DialogConfiguration(); + statusHandler.error(String.format( + "Unable to load WarnGen configuration for site %s.", + getLocalizedSite()), e); + } + } + } else { + try { + dc = DialogConfiguration.loadDialogConfig(LocalizationManager + .getInstance().getCurrentSite()); + } catch (Exception e) { + dc = new DialogConfiguration(); + statusHandler.error( + "Unable to load local WarnGen configuration.", e); + } + } + if (dc != null && dialogConfig != null) { + dialogConfig.setDefaultTemplate(dc.getDefaultTemplate()); + dialogConfig.setMainWarngenProducts(dc.getMainWarngenProducts()); + dialogConfig.setOtherWarngenProducts(dc.getOtherWarngenProducts()); + } } public String getLocalizedSite() { diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/config/DialogConfiguration.java b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/config/DialogConfiguration.java index e8f48f4f9e..7955e1a5b9 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/config/DialogConfiguration.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/config/DialogConfiguration.java @@ -43,6 +43,7 @@ import com.raytheon.uf.common.serialization.SingleTypeJAXBManager; * --/--/---- Initial creation * 10/22/2013 2361 njensen Use JAXBManager for XML * Apr 28, 2014 3033 jsanchez Refactored file retrieval. + * Jul 02, 2014 DR 17450 D. Friedman Support using list of templates from backup site. * * * @author jsanchez @@ -91,6 +92,18 @@ public class DialogConfiguration { return (DialogConfiguration) jaxb.unmarshalFromXml(xml); } + public static DialogConfiguration loadDialogConfigNoUser(String site) + throws FileNotFoundException, IOException, JAXBException { + String xml = WarnFileUtil.convertFileContentsToStringNoUser( + CONFIG_FILE, site); + return (DialogConfiguration) jaxb.unmarshalFromXml(xml); + } + + public static boolean isSiteDialogConfigExtant(String backupSite) { + return WarnFileUtil.isLocalizationFileExtantAtSiteLevel(CONFIG_FILE, + backupSite); + } + public String getWarngenOfficeShort() { return warngenOfficeShort; } diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/util/WarnFileUtil.java b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/util/WarnFileUtil.java index defda48d7b..adafb372a7 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/util/WarnFileUtil.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/util/WarnFileUtil.java @@ -25,12 +25,18 @@ import com.raytheon.uf.common.localization.PathManagerFactory; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Apr 28, 2014 3033 jsanchez Searches the backup site directory before the localized site directory. + * Jul 02, 2014 DR 17450 D. Friedman Support using list of templates from backup site. * * * @author jsanchez * @version 1.0 */ public class WarnFileUtil { + public static LocalizationFile findFileInLocalizationIncludingBackupSite(String filename, + String issuingSiteID, String backupSiteID) throws FileNotFoundException { + return findFileInLocalizationIncludingBackupSite(filename, issuingSiteID, backupSiteID, true); + } + /** * Returns the appropriate file in localization. If a backupSiteID is not * null and a corresponding file does exist in the backup site directory, @@ -49,7 +55,7 @@ public class WarnFileUtil { * @throws FileNotFoundException */ public static LocalizationFile findFileInLocalizationIncludingBackupSite(String filename, - String issuingSiteID, String backupSiteID) + String issuingSiteID, String backupSiteID, boolean allowUser) throws FileNotFoundException { IPathManager pm = PathManagerFactory.getPathManager(); @@ -71,6 +77,9 @@ public class WarnFileUtil { LocalizationContext[] searchContext = pm .getLocalSearchHierarchy(LocalizationType.COMMON_STATIC); for (LocalizationContext ctx : searchContext) { + if (!allowUser && ctx.getLocalizationLevel() == LocalizationLevel.USER) + continue; + if ((ctx.getLocalizationLevel() == LocalizationLevel.SITE || ctx .getLocalizationLevel() == LocalizationLevel.CONFIGURED) && issuingSiteID != null) { @@ -90,6 +99,18 @@ public class WarnFileUtil { return fileToUse; } + public static boolean isLocalizationFileExtantAtSiteLevel(String filename, String siteID) { + IPathManager pm = PathManagerFactory.getPathManager(); + String fileToRetrieve = WarningConstants.WARNGEN_DIR + + IPathManager.SEPARATOR + filename; + LocalizationContext backupSiteCtx = pm.getContext( + LocalizationType.COMMON_STATIC, LocalizationLevel.SITE); + backupSiteCtx.setContextName(siteID); + LocalizationFile backupFile = pm.getLocalizationFile(backupSiteCtx, + fileToRetrieve); + return backupFile != null && backupFile.exists(); + } + /** * Locates the appropriate file in the localization hierarchy including the * backupSite directory (if provided) and converts the content of the file @@ -105,10 +126,20 @@ public class WarnFileUtil { public static String convertFileContentsToString(String filename, String localizedSite, String backupSite) throws FileNotFoundException, IOException { - StringBuffer sb = new StringBuffer(); - BufferedReader input = null; File file = findFileInLocalizationIncludingBackupSite(filename, localizedSite, backupSite) .getFile(); + return convertFileContentsToString(file); + } + + public static String convertFileContentsToStringNoUser(String filename, + String site) throws FileNotFoundException { + File file = findFileInLocalizationIncludingBackupSite(filename, site, null, false).getFile(); + return convertFileContentsToString(file); + } + + private static String convertFileContentsToString(File file) { + StringBuffer sb = new StringBuffer(); + BufferedReader input = null; try { input = new BufferedReader(new FileReader(file)); From 0bf2f3eed53e15979957fc706b550813f794152f Mon Sep 17 00:00:00 2001 From: "steve.naples" Date: Tue, 8 Jul 2014 16:32:08 +0000 Subject: [PATCH 13/39] ASM #253 Update RadarBiasTableDialog fix issue of not saving. Change-Id: If88c12673afeb3ae8cecfb53d856bc90820a4673 Former-commit-id: 9dcf27e2178a21a826b111117192eaf525c16f36 [formerly 29ca2338b8e7eb9a720f460bca059b0c244c1ff4] [formerly 75969ceec2ea83c3296fcd2d93e38e105376108b] [formerly 9dcf27e2178a21a826b111117192eaf525c16f36 [formerly 29ca2338b8e7eb9a720f460bca059b0c244c1ff4] [formerly 75969ceec2ea83c3296fcd2d93e38e105376108b] [formerly 24b0d49a5b7d110d78060317511a45dc0de2b5a2 [formerly 75969ceec2ea83c3296fcd2d93e38e105376108b [formerly 9021eca6b32dd2b3859cd928c14a0e40a4907c13]]]] Former-commit-id: 24b0d49a5b7d110d78060317511a45dc0de2b5a2 Former-commit-id: bd3e8973d224a99c2c5c0117eb7cec9bcaed5e4e [formerly 94e246b619d47882e820f15533d747e5bed5d87f] [formerly 8b99713670e5a0d85aee792b8067ae607b78230c [formerly ea071e81f5e86462a746834e166c43698a7da622]] Former-commit-id: 92c9bb35d883903b31bca5165db414369b88663d [formerly 23ff3f3fe7068e4fbca98fb9e8d4434a26aed3e2] Former-commit-id: 10e2eaa6edd49145375bba5fb1efcdd31e779360 --- .../com/raytheon/viz/mpe/ui/dialogs/RadarBiasTableDialog.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/dialogs/RadarBiasTableDialog.java b/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/dialogs/RadarBiasTableDialog.java index 1f32b4ec29..61b36e7b60 100644 --- a/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/dialogs/RadarBiasTableDialog.java +++ b/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/dialogs/RadarBiasTableDialog.java @@ -248,6 +248,7 @@ public class RadarBiasTableDialog extends Dialog { applyBtn = new Button(applyBtnComp, SWT.PUSH); applyBtn.setText("Apply"); applyBtn.setLayoutData(bd); + applyBtn.setEnabled(false); applyBtn.addSelectionListener(new SelectionAdapter() { /* @@ -262,7 +263,6 @@ public class RadarBiasTableDialog extends Dialog { applyBiasUpdate(dt); MPEDisplayManager mgr = MPEDisplayManager.getCurrent(); mgr.setSavedData(false); - shell.dispose(); } }); @@ -435,6 +435,7 @@ public class RadarBiasTableDialog extends Dialog { manEdit[ei].setText("YES"); lbiasTxt.setBackground(getParent().getDisplay() .getSystemColor(SWT.COLOR_WHITE)); + biasChgs.put(radIds[ei], ei); applyBtn.setEnabled(true); } catch (NumberFormatException e1) { lbiasTxt.setBackground(getParent().getDisplay() From 57b2705ef7ce22b13a6d5668d488a0f0136a78c8 Mon Sep 17 00:00:00 2001 From: Ron Anderson Date: Wed, 9 Jul 2014 08:56:06 -0500 Subject: [PATCH 14/39] Issue #3332 Fixed race condition which could cause GFE grid saving to hang Change-Id: I4a2ef9e25999d95ac1ecf204907c59b2f1e85652 Former-commit-id: 10f629428e9a6ee306033c231f703c2994c8034d [formerly 4b4629a2fd8bbd6050989e06c78de73cfc31280c] [formerly 111b04296c73a9af0c86b2365bd00930a9661449] [formerly 10f629428e9a6ee306033c231f703c2994c8034d [formerly 4b4629a2fd8bbd6050989e06c78de73cfc31280c] [formerly 111b04296c73a9af0c86b2365bd00930a9661449] [formerly 5efba0347431ceac6776b0e1f29d08108d6c20b3 [formerly 111b04296c73a9af0c86b2365bd00930a9661449 [formerly b01b72b896b894568acce6a8dc4d45328a06067a]]]] Former-commit-id: 5efba0347431ceac6776b0e1f29d08108d6c20b3 Former-commit-id: 9691bf2deea0910f44283542c4ee4e987e39d92e [formerly e39615ab7a45d9976e5678a17fde7e0849a23e60] [formerly 629e83f9edf01bd52b896613ba791f05dcdcec19 [formerly 1cc0ff4ab7d2fecb60ee90426733a17be92bb570]] Former-commit-id: 8d831abf9d91162a2834bb4a5f34984776cfb287 [formerly 0a7c4c855e1ccb8cbaa9edf38298b28529624b54] Former-commit-id: a1a980ed6e9962f084f231995c036f9c2c06d642 --- .../com/raytheon/viz/gfe/core/parm/Parm.java | 23 ++++++++++--------- .../viz/gfe/core/parm/ParmSaveJob.java | 15 ++++++++++-- 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/core/parm/Parm.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/core/parm/Parm.java index 04304a4b6a..e18387a9f4 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/core/parm/Parm.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/core/parm/Parm.java @@ -54,6 +54,7 @@ import com.raytheon.uf.common.dataplugin.gfe.grid.Grid2DByte; import com.raytheon.uf.common.dataplugin.gfe.grid.Grid2DFloat; import com.raytheon.uf.common.dataplugin.gfe.grid.Op; import com.raytheon.uf.common.dataplugin.gfe.reference.ReferenceData; +import com.raytheon.uf.common.dataplugin.gfe.server.lock.Lock; import com.raytheon.uf.common.dataplugin.gfe.server.lock.LockTable; import com.raytheon.uf.common.dataplugin.gfe.server.lock.LockTable.LockMode; import com.raytheon.uf.common.dataplugin.gfe.server.lock.LockTable.LockStatus; @@ -185,6 +186,8 @@ import com.vividsolutions.jts.geom.Coordinate; * Apr 02, 2013 #1774 randerso Fixed a possible deadlock issue. * Aug 27, 2013 #2302 randerso Fix simultaneous save issue * Oct 31, 2013 #2508 randerso Change to use DiscreteGridSlice.getKeys() + * Jun 30, 2014 #3332 randerso Kept local reference to lock table to avoid + * race conditions with asynchronous updates * * * @@ -619,21 +622,19 @@ public abstract class Parm implements Comparable { return new TimeRange(); } - if (!isMutable()) { - return getInventorySpan(); - } + TimeRange tr = getInventorySpan(); - TimeRange tr = new TimeRange(); - if (lockTable != null) { - if (lockTable.getLocks().size() > 0) { - tr = lockTable.getLocks().get(0).getTimeRange(); - } - for (int i = 1; i < lockTable.getLocks().size(); i++) { - tr = tr.combineWith(lockTable.getLocks().get(i).getTimeRange()); + if (isMutable()) { + LockTable lt = this.lockTable; + if (lt != null) { + List locks = lt.getLocks(); + for (Lock lock : locks) { + tr = tr.combineWith(lock.getTimeRange()); + } } } - return tr.combineWith(getInventorySpan()); + return tr; } /** diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/core/parm/ParmSaveJob.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/core/parm/ParmSaveJob.java index 94329309a3..13b3a2b5e1 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/core/parm/ParmSaveJob.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/core/parm/ParmSaveJob.java @@ -28,6 +28,8 @@ import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.Job; +import com.raytheon.uf.common.status.IUFStatusHandler; +import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.time.TimeRange; /** @@ -40,6 +42,7 @@ import com.raytheon.uf.common.time.TimeRange; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Aug 27, 2013 #2302 randerso Initial creation + * Jun 30, 2014 #3332 randerso Added exception handling * * * @@ -48,6 +51,9 @@ import com.raytheon.uf.common.time.TimeRange; */ public class ParmSaveJob extends Job { + private static final transient IUFStatusHandler statusHandler = UFStatus + .getHandler(ParmSaveJob.class); + public static class ParmSaveStatus { boolean successful = false; @@ -127,8 +133,13 @@ public class ParmSaveJob extends Job { protected IStatus run(IProgressMonitor monitor) { ParmSaveRequest req = null; while ((req = this.saveQueue.poll()) != null) { - boolean successful = parm.saveParameterSubClass(req.times); - req.status.setSuccessful(successful); + try { + boolean successful = parm.saveParameterSubClass(req.times); + req.status.setSuccessful(successful); + } catch (Exception e) { + statusHandler.error("Error saving grids for " + this.parm, e); + req.status.setSuccessful(false); + } } return Status.OK_STATUS; } From afe17e2857574646638737af84431028b22fb5fc Mon Sep 17 00:00:00 2001 From: "steve.naples" Date: Wed, 9 Jul 2014 15:42:51 +0000 Subject: [PATCH 15/39] ASM #253 Update RadarBiasTableDialog fix issue of not saving undo. Change-Id: I57ad9d4407665fd4c5f7e922cbf3daac373c9f88 Former-commit-id: 72ae26401d3f4a79edd045fddcbe95df462d0a32 [formerly 2ebfd61f12fb8f364f8a6697f379b742d68de541] [formerly 339fcbc18a5e29d3d18ecfc8d5294476b4056b62] [formerly 72ae26401d3f4a79edd045fddcbe95df462d0a32 [formerly 2ebfd61f12fb8f364f8a6697f379b742d68de541] [formerly 339fcbc18a5e29d3d18ecfc8d5294476b4056b62] [formerly 0bd7b6c65ba7b7432e812a0aab0a4928bdf1af98 [formerly 339fcbc18a5e29d3d18ecfc8d5294476b4056b62 [formerly 24b9a6e0801cc653062a71d86090df3836aa86a4]]]] Former-commit-id: 0bd7b6c65ba7b7432e812a0aab0a4928bdf1af98 Former-commit-id: 04208dc8375164b53d47479b241f6623b466733a [formerly 6b58fb25098ed853536896703e70a8aac233cb21] [formerly 05c10c3b18e9704c50ddf97525d0165e3c4e0b2b [formerly aa8c11d134af53bffd92a09fd4a8ee87b14203a8]] Former-commit-id: f17ec83e9cf28c564f411b5e04c09e7a9226b11f [formerly 458dd1fe8f41782c8a5c159a79423b1ab5402dca] Former-commit-id: db04c1a2ec955603f14602b7d683144674eacf7f --- .../com/raytheon/viz/mpe/ui/dialogs/RadarBiasTableDialog.java | 1 - 1 file changed, 1 deletion(-) diff --git a/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/dialogs/RadarBiasTableDialog.java b/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/dialogs/RadarBiasTableDialog.java index 61b36e7b60..19fcb667ab 100644 --- a/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/dialogs/RadarBiasTableDialog.java +++ b/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/dialogs/RadarBiasTableDialog.java @@ -472,7 +472,6 @@ public class RadarBiasTableDialog extends Dialog { editbias[ai] = oldbias[ai]; lbTxts[ai].setText(String.format("%-1.2f", editbias[ai])); biasChgs.put(radIds[ai], ai); - applyBtn.setEnabled(false); manEdit[ai].setText("NO"); } } From 107df0dc7c7fc45704fe91561e94203f365588bc Mon Sep 17 00:00:00 2001 From: Mike Duff Date: Thu, 10 Jul 2014 10:01:24 -0500 Subject: [PATCH 16/39] Issue #3370 - Fix for mulitple shef types in same file. Change-Id: I23110d7887b68ff073afdf61815d7dced9c4a3ad Former-commit-id: 6ce3e57525d1959ba56095b0022a919950cc935c [formerly e3b7a993886f75b6d9dba6f61fea761871131ff1] [formerly b5b61650d3e740e5dc1d2b80d0f05a6cbea653fc] [formerly 6ce3e57525d1959ba56095b0022a919950cc935c [formerly e3b7a993886f75b6d9dba6f61fea761871131ff1] [formerly b5b61650d3e740e5dc1d2b80d0f05a6cbea653fc] [formerly 30655cf2ca1c194f0ab5a53c92c92d7b2e3b423e [formerly b5b61650d3e740e5dc1d2b80d0f05a6cbea653fc [formerly 0c0b14929f74f2262559a4919171623870139313]]]] Former-commit-id: 30655cf2ca1c194f0ab5a53c92c92d7b2e3b423e Former-commit-id: 031ee7b5f5a92d0a8c62e4de00d6f12c78ab6b71 [formerly 7a988c92fac7b152c36ef2e84df480ce173c9b22] [formerly 66304b48c28db98c6ef9c79bc64ab65a2cf95669 [formerly 69fb1ccf3508a8de47fab0bad42aced9abdb28f9]] Former-commit-id: 8fdf0fbb56028776ff8455c543d6f2b5a36bd7f4 [formerly 2c0488534ab28ae127cd86b789f163cf5080b5c2] Former-commit-id: 918b247d7926f3c3541835f58c0d467c2b738a8d --- .../edex/plugin/shef/database/PostShef.java | 20 ++++--------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/edexOsgi/com.raytheon.edex.plugin.shef/src/com/raytheon/edex/plugin/shef/database/PostShef.java b/edexOsgi/com.raytheon.edex.plugin.shef/src/com/raytheon/edex/plugin/shef/database/PostShef.java index ceafe1d177..84235c2c59 100644 --- a/edexOsgi/com.raytheon.edex.plugin.shef/src/com/raytheon/edex/plugin/shef/database/PostShef.java +++ b/edexOsgi/com.raytheon.edex.plugin.shef/src/com/raytheon/edex/plugin/shef/database/PostShef.java @@ -123,6 +123,7 @@ import com.raytheon.uf.edex.decodertools.time.TimeTools; * 05/28/2014 3222 mpduff Fix posting time to be processed time so db doesn't show all post times the same * 06/02/2014 mpduff Fix for caching of range checks. * 06/26/2014 3321 mpduff Fix ingestSwitchMap checks + * 07/10/2014 3370 mpduff Fix update/insert issue for riverstatus * * * @author mduff @@ -274,9 +275,6 @@ public class PostShef { /** Basis time TimeStamp */ private java.sql.Timestamp basisTimeAnsi = new Timestamp(basisBeginTime); - /** River status update flag. update if true */ - private boolean riverStatusUpdateFlag = true; - /** river status update query value */ private boolean riverStatusUpdateValueFlag; @@ -1105,7 +1103,6 @@ public class PostShef { // Reset .E cache vars tsList.clear(); useLatest = MISSING; - riverStatusUpdateFlag = true; qualityCheckFlag = true; useTs = null; basisTimeValues = null; @@ -1446,15 +1443,7 @@ public class PostShef { if ((shefList != null) && (shefList.size() > 0)) { ShefData maxShefDataValue = findMaxFcst(shefList); - if (shefRecord.getShefType() == ShefType.E) { - if (riverStatusUpdateFlag) { - riverStatusUpdateFlag = false; - - riverStatusUpdateValueFlag = updateRiverStatus(lid, pe, ts); - } - } else { - riverStatusUpdateValueFlag = updateRiverStatus(lid, pe, ts); - } + riverStatusUpdateValueFlag = updateRiverStatus(lid, pe, ts); postTables.postRiverStatus(shefRecord, maxShefDataValue, riverStatusUpdateValueFlag); } else { @@ -2157,10 +2146,8 @@ public class PostShef { try { if (!ingestSwitchMap.containsKey(key)) { - errorMsg.append("Error getting connection to IHFS Database"); sql = "select lid, pe, dur, ts, extremum, ts_rank, ingest, ofs_input, stg2_input from IngestFilter where lid = '" + locId + "'"; - errorMsg.setLength(0); errorMsg.append("Error requesting IngestFilter data: " + sql); oa = dao.executeSQLQuery(sql); if (oa.length > 0) { @@ -2196,6 +2183,7 @@ public class PostShef { ingestSwitchMap.put(key, ingestSwitch); } + matchFound = ingestSwitchMap.containsKey(key); ingestSwitch = ingestSwitchMap.get(key); /* @@ -2444,7 +2432,7 @@ public class PostShef { if (!matchFound) { log.warn(locId + " - " + data.getPhysicalElement() + "(" + data.getDuration() + ")" + data.getTypeSource() - + data.getExtremum() + " ingest " + "filter not defined"); + + data.getExtremum() + " ingest filter not defined"); stats.incrementWarningMessages(); ingestSwitch = ShefConstants.IngestSwitch.POST_PE_OFF; } From 87e582fdbd6d0f6a2bcd6ee6ba18a09857f376d7 Mon Sep 17 00:00:00 2001 From: Melissa Porricel Date: Thu, 10 Jul 2014 14:58:03 -0400 Subject: [PATCH 17/39] ASM #15557 - Restore ability to display HPCGuide2.5 Change-Id: Ibdcdd0aa95e406b5cd886dc8f51e74a3cde54d17 Change-Id: I5594c2151026247d48e657a30c7b4f94b14f036f Former-commit-id: 73063fd89494074a5caa917704c83cf18ce447b3 [formerly 1e5bef6820ebb94b286161cc26f62480afb39b7a] [formerly d3c29b834d2c14be547b09d5df006d5d39e369a1] [formerly 73063fd89494074a5caa917704c83cf18ce447b3 [formerly 1e5bef6820ebb94b286161cc26f62480afb39b7a] [formerly d3c29b834d2c14be547b09d5df006d5d39e369a1] [formerly 1f7cf4a1656980364a35828a73b3d40fc0102d4c [formerly d3c29b834d2c14be547b09d5df006d5d39e369a1 [formerly 5998e7ad9690e3b87805c75dcb711d299e8f1427]]]] Former-commit-id: 1f7cf4a1656980364a35828a73b3d40fc0102d4c Former-commit-id: 947f8af4f5b15c23a890ac567afa84b26655e121 [formerly c6a7e3bf85f2a6b72776884e69269347ff81866b] [formerly 8b541032eb4107eb1eec145f9fb65a2bc7646063 [formerly 055dd5133fc0251ed2511c00d2b73a8799bc7f9b]] Former-commit-id: 7df85cbc2358a5b5de17f326afad5075b5ab2140 [formerly 408f1920888b0818189a67cc576e987d2901547d] Former-commit-id: 60bae53945e61175270f9eda4660c1b4c17ae9ea --- .../base/grib/models/gribModels_NCEP-7.xml | 1 - .../base/grib/subgrids/HPCGuideClip.xml | 30 ------------------- 2 files changed, 31 deletions(-) delete mode 100644 edexOsgi/com.raytheon.edex.plugin.grib/utility/edex_static/base/grib/subgrids/HPCGuideClip.xml diff --git a/edexOsgi/com.raytheon.edex.plugin.grib/utility/edex_static/base/grib/models/gribModels_NCEP-7.xml b/edexOsgi/com.raytheon.edex.plugin.grib/utility/edex_static/base/grib/models/gribModels_NCEP-7.xml index cec4d8e4e3..09022b1ea0 100644 --- a/edexOsgi/com.raytheon.edex.plugin.grib/utility/edex_static/base/grib/models/gribModels_NCEP-7.xml +++ b/edexOsgi/com.raytheon.edex.plugin.grib/utility/edex_static/base/grib/models/gribModels_NCEP-7.xml @@ -2879,7 +2879,6 @@ HPCGuide
7
5 - 197 183 diff --git a/edexOsgi/com.raytheon.edex.plugin.grib/utility/edex_static/base/grib/subgrids/HPCGuideClip.xml b/edexOsgi/com.raytheon.edex.plugin.grib/utility/edex_static/base/grib/subgrids/HPCGuideClip.xml deleted file mode 100644 index 322118d976..0000000000 --- a/edexOsgi/com.raytheon.edex.plugin.grib/utility/edex_static/base/grib/subgrids/HPCGuideClip.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - HPCGuide - 197 - 1000 - 689 - - \ No newline at end of file From 960e8ce56cbcea5f276f822b4a9c8504d49f9c79 Mon Sep 17 00:00:00 2001 From: Mike Duff Date: Thu, 10 Jul 2014 15:56:08 -0500 Subject: [PATCH 18/39] Issue #3370 - Revert "Issue #3370 - Fix for mulitple shef types in same file." This reverts commit 0d73c880f8b96034bf1f9b443aeb8dfcad2be382 [formerly 30655cf2ca1c194f0ab5a53c92c92d7b2e3b423e] [formerly 6ce3e57525d1959ba56095b0022a919950cc935c [formerly e3b7a993886f75b6d9dba6f61fea761871131ff1] [formerly b5b61650d3e740e5dc1d2b80d0f05a6cbea653fc] [formerly 6ce3e57525d1959ba56095b0022a919950cc935c [formerly e3b7a993886f75b6d9dba6f61fea761871131ff1] [formerly b5b61650d3e740e5dc1d2b80d0f05a6cbea653fc] [formerly 30655cf2ca1c194f0ab5a53c92c92d7b2e3b423e [formerly b5b61650d3e740e5dc1d2b80d0f05a6cbea653fc [formerly 0c0b14929f74f2262559a4919171623870139313]]]]]. Former-commit-id: c5a344ac7544049ed2c186829922f06e69f91168 [formerly c8bfcd54a39f4e41641f485ce15eb285220cae13] [formerly a35529bba4f759454c71a6fe3814054634249307] [formerly c5a344ac7544049ed2c186829922f06e69f91168 [formerly c8bfcd54a39f4e41641f485ce15eb285220cae13] [formerly a35529bba4f759454c71a6fe3814054634249307] [formerly 73c75303a84d2f7a18a0fb73f524f975646cfe41 [formerly a35529bba4f759454c71a6fe3814054634249307 [formerly 43cbf77bb90ba12a6ee11bc35b18c226f9490a88]]]] Former-commit-id: 73c75303a84d2f7a18a0fb73f524f975646cfe41 Former-commit-id: f778742aa483c050d63bf3d29d050e3919b4d7cf [formerly 6b1031a927cb88a20c9b7f71ad70184c901b224e] [formerly 01d1b4afe87eefe7fa8a15321568e95cbea343d4 [formerly 6f18256c56006c9ef28b3564366a7aec8be09720]] Former-commit-id: 28bce5abc620bec275b1452ceb9697a31eb27b13 [formerly 08275089f5e68713cc1a93d75c9129a75a2d2ee0] Former-commit-id: 327f695d0caf24d5503e35ac36731bbd17f861bb --- .../edex/plugin/shef/database/PostShef.java | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/edexOsgi/com.raytheon.edex.plugin.shef/src/com/raytheon/edex/plugin/shef/database/PostShef.java b/edexOsgi/com.raytheon.edex.plugin.shef/src/com/raytheon/edex/plugin/shef/database/PostShef.java index 84235c2c59..ceafe1d177 100644 --- a/edexOsgi/com.raytheon.edex.plugin.shef/src/com/raytheon/edex/plugin/shef/database/PostShef.java +++ b/edexOsgi/com.raytheon.edex.plugin.shef/src/com/raytheon/edex/plugin/shef/database/PostShef.java @@ -123,7 +123,6 @@ import com.raytheon.uf.edex.decodertools.time.TimeTools; * 05/28/2014 3222 mpduff Fix posting time to be processed time so db doesn't show all post times the same * 06/02/2014 mpduff Fix for caching of range checks. * 06/26/2014 3321 mpduff Fix ingestSwitchMap checks - * 07/10/2014 3370 mpduff Fix update/insert issue for riverstatus * * * @author mduff @@ -275,6 +274,9 @@ public class PostShef { /** Basis time TimeStamp */ private java.sql.Timestamp basisTimeAnsi = new Timestamp(basisBeginTime); + /** River status update flag. update if true */ + private boolean riverStatusUpdateFlag = true; + /** river status update query value */ private boolean riverStatusUpdateValueFlag; @@ -1103,6 +1105,7 @@ public class PostShef { // Reset .E cache vars tsList.clear(); useLatest = MISSING; + riverStatusUpdateFlag = true; qualityCheckFlag = true; useTs = null; basisTimeValues = null; @@ -1443,7 +1446,15 @@ public class PostShef { if ((shefList != null) && (shefList.size() > 0)) { ShefData maxShefDataValue = findMaxFcst(shefList); - riverStatusUpdateValueFlag = updateRiverStatus(lid, pe, ts); + if (shefRecord.getShefType() == ShefType.E) { + if (riverStatusUpdateFlag) { + riverStatusUpdateFlag = false; + + riverStatusUpdateValueFlag = updateRiverStatus(lid, pe, ts); + } + } else { + riverStatusUpdateValueFlag = updateRiverStatus(lid, pe, ts); + } postTables.postRiverStatus(shefRecord, maxShefDataValue, riverStatusUpdateValueFlag); } else { @@ -2146,8 +2157,10 @@ public class PostShef { try { if (!ingestSwitchMap.containsKey(key)) { + errorMsg.append("Error getting connection to IHFS Database"); sql = "select lid, pe, dur, ts, extremum, ts_rank, ingest, ofs_input, stg2_input from IngestFilter where lid = '" + locId + "'"; + errorMsg.setLength(0); errorMsg.append("Error requesting IngestFilter data: " + sql); oa = dao.executeSQLQuery(sql); if (oa.length > 0) { @@ -2183,7 +2196,6 @@ public class PostShef { ingestSwitchMap.put(key, ingestSwitch); } - matchFound = ingestSwitchMap.containsKey(key); ingestSwitch = ingestSwitchMap.get(key); /* @@ -2432,7 +2444,7 @@ public class PostShef { if (!matchFound) { log.warn(locId + " - " + data.getPhysicalElement() + "(" + data.getDuration() + ")" + data.getTypeSource() - + data.getExtremum() + " ingest filter not defined"); + + data.getExtremum() + " ingest " + "filter not defined"); stats.incrementWarningMessages(); ingestSwitch = ShefConstants.IngestSwitch.POST_PE_OFF; } From 1259addab9df56fdcf4b3b5bd9152a649e709f1c Mon Sep 17 00:00:00 2001 From: "Fay.Liang" Date: Fri, 11 Jul 2014 15:05:24 -0400 Subject: [PATCH 19/39] ASM #15468 Shefdecode failed to ingest RVF product at OUN Change-Id: Ie345c88c4a3a0ff995c4d33772f90e863bed7ee5 Former-commit-id: a6b6b401f25a3b13cb1e119bfe8ff55ebce987c6 [formerly 34465f09ce60611848cb4fefe88b6b8013c60ed4] [formerly 400561ac9cbdcd5eefd28f047dd0bbbda141c6f8] [formerly a6b6b401f25a3b13cb1e119bfe8ff55ebce987c6 [formerly 34465f09ce60611848cb4fefe88b6b8013c60ed4] [formerly 400561ac9cbdcd5eefd28f047dd0bbbda141c6f8] [formerly 65677246c2f698c32cc6f7763f6fb777c7ea8341 [formerly 400561ac9cbdcd5eefd28f047dd0bbbda141c6f8 [formerly f78783d2ea194539414294abff46d4f2acda65d1]]]] Former-commit-id: 65677246c2f698c32cc6f7763f6fb777c7ea8341 Former-commit-id: c7fce0ed289f537b498192c8c69e58ef20fd34c9 [formerly 475da269d85415f3c306bb0d6640cbf534c181f6] [formerly 2bfea4d98b455ecf0a6f36d2035a3570cb73d338 [formerly 9285e0530f45d3c6045f9e948a22f810b5228421]] Former-commit-id: 48fb055d34038b50716bf7a2fa7ab49cd63c84b3 [formerly 60b7095e208bfb1e31c4ec64c3d3dded58c8df7a] Former-commit-id: 3a4cff44ccc78da80dbef869cd34cb3bc9c0bba1 --- .../edex/plugin/shef/database/PostShef.java | 20 ++++--------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/edexOsgi/com.raytheon.edex.plugin.shef/src/com/raytheon/edex/plugin/shef/database/PostShef.java b/edexOsgi/com.raytheon.edex.plugin.shef/src/com/raytheon/edex/plugin/shef/database/PostShef.java index ceafe1d177..84235c2c59 100644 --- a/edexOsgi/com.raytheon.edex.plugin.shef/src/com/raytheon/edex/plugin/shef/database/PostShef.java +++ b/edexOsgi/com.raytheon.edex.plugin.shef/src/com/raytheon/edex/plugin/shef/database/PostShef.java @@ -123,6 +123,7 @@ import com.raytheon.uf.edex.decodertools.time.TimeTools; * 05/28/2014 3222 mpduff Fix posting time to be processed time so db doesn't show all post times the same * 06/02/2014 mpduff Fix for caching of range checks. * 06/26/2014 3321 mpduff Fix ingestSwitchMap checks + * 07/10/2014 3370 mpduff Fix update/insert issue for riverstatus * * * @author mduff @@ -274,9 +275,6 @@ public class PostShef { /** Basis time TimeStamp */ private java.sql.Timestamp basisTimeAnsi = new Timestamp(basisBeginTime); - /** River status update flag. update if true */ - private boolean riverStatusUpdateFlag = true; - /** river status update query value */ private boolean riverStatusUpdateValueFlag; @@ -1105,7 +1103,6 @@ public class PostShef { // Reset .E cache vars tsList.clear(); useLatest = MISSING; - riverStatusUpdateFlag = true; qualityCheckFlag = true; useTs = null; basisTimeValues = null; @@ -1446,15 +1443,7 @@ public class PostShef { if ((shefList != null) && (shefList.size() > 0)) { ShefData maxShefDataValue = findMaxFcst(shefList); - if (shefRecord.getShefType() == ShefType.E) { - if (riverStatusUpdateFlag) { - riverStatusUpdateFlag = false; - - riverStatusUpdateValueFlag = updateRiverStatus(lid, pe, ts); - } - } else { - riverStatusUpdateValueFlag = updateRiverStatus(lid, pe, ts); - } + riverStatusUpdateValueFlag = updateRiverStatus(lid, pe, ts); postTables.postRiverStatus(shefRecord, maxShefDataValue, riverStatusUpdateValueFlag); } else { @@ -2157,10 +2146,8 @@ public class PostShef { try { if (!ingestSwitchMap.containsKey(key)) { - errorMsg.append("Error getting connection to IHFS Database"); sql = "select lid, pe, dur, ts, extremum, ts_rank, ingest, ofs_input, stg2_input from IngestFilter where lid = '" + locId + "'"; - errorMsg.setLength(0); errorMsg.append("Error requesting IngestFilter data: " + sql); oa = dao.executeSQLQuery(sql); if (oa.length > 0) { @@ -2196,6 +2183,7 @@ public class PostShef { ingestSwitchMap.put(key, ingestSwitch); } + matchFound = ingestSwitchMap.containsKey(key); ingestSwitch = ingestSwitchMap.get(key); /* @@ -2444,7 +2432,7 @@ public class PostShef { if (!matchFound) { log.warn(locId + " - " + data.getPhysicalElement() + "(" + data.getDuration() + ")" + data.getTypeSource() - + data.getExtremum() + " ingest " + "filter not defined"); + + data.getExtremum() + " ingest filter not defined"); stats.incrementWarningMessages(); ingestSwitch = ShefConstants.IngestSwitch.POST_PE_OFF; } From 1c149ddffd2d626a85a96b8f86bdd25f36c46ce5 Mon Sep 17 00:00:00 2001 From: Nate Jensen Date: Mon, 14 Jul 2014 08:37:41 -0500 Subject: [PATCH 20/39] Issue #3372 make LocalizationStreamHandler thread safe Change-Id: I208b66fbd2b0bfcd225c3df98f96bcdcf5cb9a88 Former-commit-id: c0d1fe1bd8e91c04c989f7da133be20dfb4e57aa [formerly 801ed7154f175a095d47afc77e36f124e5760fd7] [formerly 47bf21d7b559a6d7da5dca012519b48f7ab7bfc4] [formerly c0d1fe1bd8e91c04c989f7da133be20dfb4e57aa [formerly 801ed7154f175a095d47afc77e36f124e5760fd7] [formerly 47bf21d7b559a6d7da5dca012519b48f7ab7bfc4] [formerly aaa0ed7ed7c030ca5867ae3195dec2f08a91432e [formerly 47bf21d7b559a6d7da5dca012519b48f7ab7bfc4 [formerly 87d5faa03ea63759a6805ed063174fb09ca4800a]]]] Former-commit-id: aaa0ed7ed7c030ca5867ae3195dec2f08a91432e Former-commit-id: 7bde94571fa1255b2d2324d9ce7d359fa65dff19 [formerly e47111f601f4572c4cb07aea286e2f568cd2731f] [formerly f0448bcb1f489173c370e7c12059614931e19771 [formerly eeba10c11dc5a442c66650196e83d2016e332ddd]] Former-commit-id: 50cb46b6707393b4db550e45c2c9a648332f79c0 [formerly a802b19c298d3098dbd1f90134918e60148e2f43] Former-commit-id: fa9cc74703f1b893f3666d04047af1144be3d214 --- .../raytheon/edex/services/LocalizationStreamHandler.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/edexOsgi/com.raytheon.edex.utilitysrv/src/com/raytheon/edex/services/LocalizationStreamHandler.java b/edexOsgi/com.raytheon.edex.utilitysrv/src/com/raytheon/edex/services/LocalizationStreamHandler.java index bca03d5c30..fa38cdf8d3 100644 --- a/edexOsgi/com.raytheon.edex.utilitysrv/src/com/raytheon/edex/services/LocalizationStreamHandler.java +++ b/edexOsgi/com.raytheon.edex.utilitysrv/src/com/raytheon/edex/services/LocalizationStreamHandler.java @@ -23,8 +23,8 @@ import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.util.Arrays; -import java.util.HashMap; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import com.raytheon.edex.utility.ProtectedFiles; import com.raytheon.uf.common.auth.exception.AuthorizationException; @@ -54,6 +54,7 @@ import com.raytheon.uf.edex.core.EDEXUtil; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Aug 11, 2010 mschenke Initial creation + * Jul 14, 2014 3372 njensen fileMap is ConcurrentHashMap for thread safety * * * @@ -75,7 +76,7 @@ public class LocalizationStreamHandler } } - private Map fileMap = new HashMap(); + private Map fileMap = new ConcurrentHashMap(); /* * (non-Javadoc) From 273a2a4b6852ea8c801f6c687cc9eb55c770a477 Mon Sep 17 00:00:00 2001 From: "Fay.Liang" Date: Tue, 15 Jul 2014 10:22:09 -0400 Subject: [PATCH 21/39] ASM #15468 Shefdecode failed to ingest RVF product at OUN Change-Id: I6238c25f867c0e6e491831e9c2b1c47e22484620 Former-commit-id: e571f735bb2cfd490fb5c3d59be72c7ca6a8054e [formerly 7cbd90018e2e2aa5b4ff83f8c9091113c38d15c8] [formerly 87d50e7296a8d11870374e9e02da0140a3e31f2e] [formerly e571f735bb2cfd490fb5c3d59be72c7ca6a8054e [formerly 7cbd90018e2e2aa5b4ff83f8c9091113c38d15c8] [formerly 87d50e7296a8d11870374e9e02da0140a3e31f2e] [formerly a00be8447de4264d157e7310f3e01c404171da67 [formerly 87d50e7296a8d11870374e9e02da0140a3e31f2e [formerly 3637d6387396f88811ec3964bd61d10ce0ee38eb]]]] Former-commit-id: a00be8447de4264d157e7310f3e01c404171da67 Former-commit-id: 545400c732f12c6f4c0d7f2983f9219b8fded644 [formerly cc238af632e3e5e5f4c8cab9e40c04035f534bd1] [formerly f73048280867ff8de4b030b4f2fb82add0a87e58 [formerly e69a6fe6f5dc886583645f00eebf28b41957ed1a]] Former-commit-id: 5961f11b4d53be2fc67f457a02f172bffc86c9f2 [formerly 66a3732b4ba2d80dcdb2ac9a88827436c79d7920] Former-commit-id: ba05a236a77905c4d526ef9090c03b8914d89312 --- .../edex/plugin/shef/database/PostShef.java | 137 ++++++-------- .../plugin/shef/database/ShefRangeData.java | 179 ++++++++++++++++++ 2 files changed, 235 insertions(+), 81 deletions(-) create mode 100644 edexOsgi/com.raytheon.edex.plugin.shef/src/com/raytheon/edex/plugin/shef/database/ShefRangeData.java diff --git a/edexOsgi/com.raytheon.edex.plugin.shef/src/com/raytheon/edex/plugin/shef/database/PostShef.java b/edexOsgi/com.raytheon.edex.plugin.shef/src/com/raytheon/edex/plugin/shef/database/PostShef.java index 84235c2c59..2ced8e3adc 100644 --- a/edexOsgi/com.raytheon.edex.plugin.shef/src/com/raytheon/edex/plugin/shef/database/PostShef.java +++ b/edexOsgi/com.raytheon.edex.plugin.shef/src/com/raytheon/edex/plugin/shef/database/PostShef.java @@ -96,7 +96,7 @@ import com.raytheon.uf.edex.decodertools.time.TimeTools; * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 04/21/2008 387 M. Duff Initial Version. + * 04/21/2008 387 M. Duff Initial Version. * 06/02/2008 1166 M. Duff Added checks for null data objects. * 22Jul2008 1277 MW Fegan Use CoreDao in checkIngest(). * 10/16/2008 1548 jelkins Integrated ParameterCode Types and misc fixes @@ -124,6 +124,7 @@ import com.raytheon.uf.edex.decodertools.time.TimeTools; * 06/02/2014 mpduff Fix for caching of range checks. * 06/26/2014 3321 mpduff Fix ingestSwitchMap checks * 07/10/2014 3370 mpduff Fix update/insert issue for riverstatus + * 07/14/2014 mpduff Fix data range checks * * * @author mduff @@ -293,39 +294,12 @@ public class PostShef { /** Forecast query results */ private Object[] queryForecastResults; - /** Location range data found flag */ - private boolean locRangeFound = false; - - /** Default range data found flag */ - private boolean defRangeFound = false; + /** Cache of data limits and loc data limits */ + private Map dataRangeMap = new HashMap(); /** Valid date range flag */ private boolean validDateRange = false; - /** Gross range minimum value */ - private double grossRangeMin = ShefConstants.SHEF_MISSING_INT; - - /** Gross range maximum value */ - private double grossRangeMax = ShefConstants.SHEF_MISSING_INT; - - /** Reasonable range minimum value */ - private double reasonRangeMin = ShefConstants.SHEF_MISSING_INT; - - /** Reasonable range maximum value */ - private double reasonRangeMax = ShefConstants.SHEF_MISSING_INT; - - /** Alert upper limit value */ - private double alertUpperLimit = ShefConstants.SHEF_MISSING_INT; - - /** Alarm upper limit value */ - private double alarmUpperLimit = ShefConstants.SHEF_MISSING_INT; - - /** Alert lower limit value */ - private double alertLowerLimit = ShefConstants.SHEF_MISSING_INT; - - /** Alarm lower limit value */ - private double alarmLowerLimit = ShefConstants.SHEF_MISSING_INT; - /** * * @param date @@ -1107,18 +1081,8 @@ public class PostShef { useTs = null; basisTimeValues = null; previousQueryForecast = null; - locRangeFound = false; - defRangeFound = false; + dataRangeMap.clear(); validDateRange = false; - grossRangeMin = ShefConstants.SHEF_MISSING_INT; - grossRangeMax = ShefConstants.SHEF_MISSING_INT; - reasonRangeMin = ShefConstants.SHEF_MISSING_INT; - reasonRangeMax = ShefConstants.SHEF_MISSING_INT; - alertUpperLimit = ShefConstants.SHEF_MISSING_INT; - alarmUpperLimit = ShefConstants.SHEF_MISSING_INT; - alertLowerLimit = ShefConstants.SHEF_MISSING_INT; - alarmLowerLimit = ShefConstants.SHEF_MISSING_INT; - } /** @@ -2635,24 +2599,12 @@ public class PostShef { return ShefConstants.QC_MANUAL_FAILED; } - boolean executeQuery = true; - if (!qualityCheckFlag) { - // If qualityCheckFlag is false the the query has already been - // executed - executeQuery = false; - } - - if (shefRecord.getShefType() == ShefType.E) { - // if qualityCheckFlag is true then don't need to query - if (qualityCheckFlag) { - qualityCheckFlag = false; - } - } - StringBuilder locLimitSql = new StringBuilder(); StringBuilder defLimitSql = new StringBuilder(); + String key = lid + data.getPhysicalElement().getCode() + + data.getDurationValue(); try { - if (executeQuery) { + if (!dataRangeMap.containsKey(key)) { String sqlStart = "select monthdaystart, monthdayend, gross_range_min, gross_range_max, reason_range_min, " + "reason_range_max, roc_max, alert_upper_limit, alert_roc_limit, alarm_upper_limit, " + "alarm_roc_limit, alert_lower_limit, alarm_lower_limit, alert_diff_limit, " @@ -2668,6 +2620,7 @@ public class PostShef { Object[] oa = dao.executeSQLQuery(locLimitSql.toString()); if (oa.length == 0) { + dataRangeMap.put(key, null); // default range defLimitSql = new StringBuilder(sqlStart); defLimitSql.append("datalimits where pe = '") @@ -2676,7 +2629,13 @@ public class PostShef { .append(data.getDurationValue()); oa = dao.executeSQLQuery(defLimitSql.toString()); + key = data.getPhysicalElement().getCode() + + data.getDurationValue(); + if (oa.length == 0) { + dataRangeMap.put(key, null); + } } + for (int i = 0; i < oa.length; i++) { Object[] oa2 = (Object[]) oa[i]; @@ -2693,49 +2652,65 @@ public class PostShef { * if a range is found, then check the value and set the * flag */ - grossRangeMin = ShefUtil.getDouble(oa2[2], missing); - grossRangeMax = ShefUtil.getDouble(oa2[3], missing); - reasonRangeMin = ShefUtil.getDouble(oa2[4], missing); - reasonRangeMax = ShefUtil.getDouble(oa2[5], missing); - alertUpperLimit = ShefUtil.getDouble(oa2[7], missing); - alertLowerLimit = ShefUtil.getDouble(oa2[11], missing); - alarmLowerLimit = ShefUtil.getDouble(oa2[12], missing); - alarmUpperLimit = ShefUtil.getDouble(oa2[9], missing); - defRangeFound = true; + ShefRangeData rangeData = new ShefRangeData(); + rangeData.setGrossRangeMin(ShefUtil.getDouble(oa2[2], + missing)); + rangeData.setGrossRangeMax(ShefUtil.getDouble(oa2[3], + missing)); + rangeData.setReasonRangeMin(ShefUtil.getDouble(oa2[4], + missing)); + rangeData.setReasonRangeMax(ShefUtil.getDouble(oa2[5], + missing)); + rangeData.setAlarmLowerLimit(ShefUtil.getDouble( + oa2[12], missing)); + rangeData.setAlarmUpperLimit(ShefUtil.getDouble(oa2[9], + missing)); + rangeData.setAlertLowerLimit(ShefUtil.getDouble( + oa2[11], missing)); + rangeData.setAlertUpperLimit(ShefUtil.getDouble(oa2[7], + missing)); + this.dataRangeMap.put(key, rangeData); break; } } } - if (locRangeFound || defRangeFound) { + ShefRangeData rangeData = dataRangeMap.get(key); + if (rangeData != null) { /* * if a range is found, then check the value and set the flag */ - if (((grossRangeMin != missing) && (dValue < grossRangeMin)) - || ((grossRangeMax != missing) && (dValue > grossRangeMax))) { + if (((rangeData.getGrossRangeMin() != missing) && (dValue < rangeData + .getGrossRangeMin())) + || ((rangeData.getGrossRangeMax() != missing) && (dValue > rangeData + .getGrossRangeMax()))) { qualityCode = ShefQC.setQcCode( (int) ShefConstants.QC_GROSSRANGE_FAILED, qualityCode); if (dataLog) { log.info(lid + " failed gross range check: " + dValue - + " out of range " + grossRangeMin + " - " - + grossRangeMax); + + " out of range " + + rangeData.getGrossRangeMin() + " - " + + rangeData.getGrossRangeMax()); } /* * don't do anything if it fails the gross range check */ } else { - if (((reasonRangeMin != missing) && (dValue < reasonRangeMin)) - || ((reasonRangeMax != missing) && (dValue > reasonRangeMax))) { + if (((rangeData.getReasonRangeMin() != missing) && (dValue < rangeData + .getReasonRangeMin())) + || ((rangeData.getReasonRangeMax() != missing) && (dValue > rangeData + .getReasonRangeMax()))) { qualityCode = ShefQC.setQcCode( (int) ShefConstants.QC_REASONRANGE_FAILED, qualityCode); if (dataLog) { log.info(lid + " failed reasonable range check: " + dValue + " out of range " - + reasonRangeMin + " - " + reasonRangeMax); + + rangeData.getReasonRangeMin() + " - " + + rangeData.getReasonRangeMax()); } } @@ -2745,17 +2720,17 @@ public class PostShef { * table. */ if (shefAlertAlarm) { - if ((alarmUpperLimit != missing) - && (dValue >= alarmUpperLimit)) { + if ((rangeData.getAlarmUpperLimit() != missing) + && (dValue >= rangeData.getAlarmUpperLimit())) { alertAlarm = ShefConstants.ALARM_UPPER_DETECTED; - } else if ((alertUpperLimit != missing) - && (dValue >= alertUpperLimit)) { + } else if ((rangeData.getAlertUpperLimit() != missing) + && (dValue >= rangeData.getAlertUpperLimit())) { alertAlarm = ShefConstants.ALERT_UPPER_DETECTED; - } else if ((alarmLowerLimit != missing) - && (dValue <= alarmLowerLimit)) { + } else if ((rangeData.getAlarmLowerLimit() != missing) + && (dValue <= rangeData.getAlarmLowerLimit())) { alertAlarm = ShefConstants.ALARM_LOWER_DETECTED; - } else if ((alertLowerLimit != missing) - && (dValue <= alertLowerLimit)) { + } else if ((rangeData.getAlertLowerLimit() != missing) + && (dValue <= rangeData.getAlertLowerLimit())) { alertAlarm = ShefConstants.ALERT_LOWER_DETECTED; } diff --git a/edexOsgi/com.raytheon.edex.plugin.shef/src/com/raytheon/edex/plugin/shef/database/ShefRangeData.java b/edexOsgi/com.raytheon.edex.plugin.shef/src/com/raytheon/edex/plugin/shef/database/ShefRangeData.java new file mode 100644 index 0000000000..73b7fbb46a --- /dev/null +++ b/edexOsgi/com.raytheon.edex.plugin.shef/src/com/raytheon/edex/plugin/shef/database/ShefRangeData.java @@ -0,0 +1,179 @@ +/** + * This software was developed and / or modified by Raytheon Company, + * pursuant to Contract DG133W-05-CQ-1067 with the US Government. + * + * U.S. EXPORT CONTROLLED TECHNICAL DATA + * This software product contains export-restricted data whose + * export/transfer/disclosure is restricted by U.S. law. Dissemination + * to non-U.S. persons whether in the United States or abroad requires + * an export license or other authorization. + * + * Contractor Name: Raytheon Company + * Contractor Address: 6825 Pine Street, Suite 340 + * Mail Stop B8 + * Omaha, NE 68106 + * 402.291.0100 + * + * See the AWIPS II Master Rights File ("Master Rights File.pdf") for + * further licensing information. + **/ +package com.raytheon.edex.plugin.shef.database; + +import com.raytheon.uf.common.dataplugin.shef.util.ShefConstants; + +/** + * Data object for holding SHEF range limits + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Jul 14, 2014            mpduff     Initial creation
+ * 
+ * 
+ * + * @author mpduff + * @version 1.0 + */ + +public class ShefRangeData { + + private double grossRangeMin = ShefConstants.SHEF_MISSING_INT; + + private double grossRangeMax = ShefConstants.SHEF_MISSING_INT; + + private double reasonRangeMin = ShefConstants.SHEF_MISSING_INT; + + private double reasonRangeMax = ShefConstants.SHEF_MISSING_INT; + + private double alertUpperLimit = ShefConstants.SHEF_MISSING_INT; + + private double alarmUpperLimit = ShefConstants.SHEF_MISSING_INT; + + private double alertLowerLimit = ShefConstants.SHEF_MISSING_INT; + + private double alarmLowerLimit = ShefConstants.SHEF_MISSING_INT; + + /** + * @return the grossRangeMin + */ + public double getGrossRangeMin() { + return grossRangeMin; + } + + /** + * @param grossRangeMin + * the grossRangeMin to set + */ + public void setGrossRangeMin(double grossRangeMin) { + this.grossRangeMin = grossRangeMin; + } + + /** + * @return the grossRangeMax + */ + public double getGrossRangeMax() { + return grossRangeMax; + } + + /** + * @param grossRangeMax + * the grossRangeMax to set + */ + public void setGrossRangeMax(double grossRangeMax) { + this.grossRangeMax = grossRangeMax; + } + + /** + * @return the reasonRangeMin + */ + public double getReasonRangeMin() { + return reasonRangeMin; + } + + /** + * @param reasonRangeMin + * the reasonRangeMin to set + */ + public void setReasonRangeMin(double reasonRangeMin) { + this.reasonRangeMin = reasonRangeMin; + } + + /** + * @return the reasonRangeMax + */ + public double getReasonRangeMax() { + return reasonRangeMax; + } + + /** + * @param reasonRangeMax + * the reasonRangeMax to set + */ + public void setReasonRangeMax(double reasonRangeMax) { + this.reasonRangeMax = reasonRangeMax; + } + + /** + * @return the alertUpperLimit + */ + public double getAlertUpperLimit() { + return alertUpperLimit; + } + + /** + * @param alertUpperLimit + * the alertUpperLimit to set + */ + public void setAlertUpperLimit(double alertUpperLimit) { + this.alertUpperLimit = alertUpperLimit; + } + + /** + * @return the alarmUpperLimit + */ + public double getAlarmUpperLimit() { + return alarmUpperLimit; + } + + /** + * @param alarmUpperLimit + * the alarmUpperLimit to set + */ + public void setAlarmUpperLimit(double alarmUpperLimit) { + this.alarmUpperLimit = alarmUpperLimit; + } + + /** + * @return the alertLowerLimit + */ + public double getAlertLowerLimit() { + return alertLowerLimit; + } + + /** + * @param alertLowerLimit + * the alertLowerLimit to set + */ + public void setAlertLowerLimit(double alertLowerLimit) { + this.alertLowerLimit = alertLowerLimit; + } + + /** + * @return the alarmLowerLimit + */ + public double getAlarmLowerLimit() { + return alarmLowerLimit; + } + + /** + * @param alarmLowerLimit + * the alarmLowerLimit to set + */ + public void setAlarmLowerLimit(double alarmLowerLimit) { + this.alarmLowerLimit = alarmLowerLimit; + } + +} From 00fb95b9fb19ba968a97e7f282648a6f36cedb93 Mon Sep 17 00:00:00 2001 From: Nate Jensen Date: Tue, 15 Jul 2014 15:24:58 -0500 Subject: [PATCH 22/39] Issue #2954 fall back to existing map scales if map scale is missing Change-Id: I75083325edec689c38f2fe7661c635ddf3e0f527 Former-commit-id: ef72e8e2225b16f7498e73fa756496427f5c18b0 [formerly c07802a208cb9fbe83bc0be6e6041607de4b8a34] [formerly 6e21526fd2e9edd88c8f140c3814e9728c0c94e4] [formerly ef72e8e2225b16f7498e73fa756496427f5c18b0 [formerly c07802a208cb9fbe83bc0be6e6041607de4b8a34] [formerly 6e21526fd2e9edd88c8f140c3814e9728c0c94e4] [formerly ed9bee55335bcec22a284f1a47533d727ea4096d [formerly 6e21526fd2e9edd88c8f140c3814e9728c0c94e4 [formerly c7167ad2f59ba02edc842f321d12cd36cd6da8bb]]]] Former-commit-id: ed9bee55335bcec22a284f1a47533d727ea4096d Former-commit-id: 8a296f44dc464e8da2fe050951bdf5c19900f76c [formerly 12aa82ee3f5b421e62dc1430142a236fcbe97b2a] [formerly 1b7296f4e0b0b00a7428592a879e684a9594a9a1 [formerly d07ec00b92f2241468fe19ab647ca4b0bdce81c3]] Former-commit-id: 0c9f09720e80fe71eeb3ad39fefb92e4902c6206 [formerly 61b8abe5892237e6942a7561355fc785bf5a9120] Former-commit-id: a559ae9796ee9f6d1e91be71ce191dfdcb206480 --- .../core/maps/scales/MapScalesManager.java | 228 +++++++++++++++--- .../raytheon/uf/viz/d2d/ui/map/SideView.java | 23 +- 2 files changed, 203 insertions(+), 48 deletions(-) diff --git a/cave/com.raytheon.uf.viz.core.maps/src/com/raytheon/uf/viz/core/maps/scales/MapScalesManager.java b/cave/com.raytheon.uf.viz.core.maps/src/com/raytheon/uf/viz/core/maps/scales/MapScalesManager.java index 440e228879..4da840a25d 100644 --- a/cave/com.raytheon.uf.viz.core.maps/src/com/raytheon/uf/viz/core/maps/scales/MapScalesManager.java +++ b/cave/com.raytheon.uf.viz.core.maps/src/com/raytheon/uf/viz/core/maps/scales/MapScalesManager.java @@ -30,6 +30,9 @@ import org.eclipse.ui.IWorkbenchWindow; import com.raytheon.uf.common.localization.AutoUpdatingLocalizationFile; import com.raytheon.uf.common.localization.AutoUpdatingLocalizationFile.AutoUpdatingFileChangedListener; import com.raytheon.uf.common.localization.IPathManager; +import com.raytheon.uf.common.localization.LocalizationContext; +import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel; +import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType; import com.raytheon.uf.common.localization.LocalizationFile; import com.raytheon.uf.common.localization.PathManagerFactory; import com.raytheon.uf.common.localization.exception.LocalizationException; @@ -41,6 +44,7 @@ import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.viz.core.drawables.AbstractRenderableDisplay; import com.raytheon.uf.viz.core.exception.VizException; +import com.raytheon.uf.viz.core.maps.display.VizMapEditor; import com.raytheon.uf.viz.core.maps.scales.MapScales.MapScale; import com.raytheon.uf.viz.core.maps.scales.MapScales.PartId; import com.raytheon.uf.viz.core.procedures.Bundle; @@ -61,7 +65,8 @@ import com.raytheon.viz.ui.actions.LoadSerializedXml; * Oct 08, 2013 mschenke Initial creation * Oct 22, 2013 2491 bsteffen Change from SerializationUtil to * ProcedureXmlManager - * Mar 24, 2014 2954 mpduff Check for missing map scale files and handle the situation. + * Mar 24, 2014 2954 mpduff Log when missing map scale files + * Jul 15, 2014 2954 njensen Added fallbacks when missing map scale files * * * @@ -79,6 +84,11 @@ public class MapScalesManager { private static final String DEFAULT_SCALES_FILE = "scalesInfo.xml"; + // TODO would be better to fall back to a worldwide display + private static final String LAST_RESORT_NAME = "Northern Hemisphere"; + + private static final String LAST_RESORT_FILENAME = "NHemisphere.xml"; + /** * Manager class for a single {@link MapScale}. Is able to create a Bundle * for the scale. May provide functions for modifying/saving scales @@ -94,7 +104,7 @@ public class MapScalesManager { private final String displayName; - private final PartId[] partIds; + private PartId[] partIds; private final AutoUpdatingLocalizationFile scaleFile; @@ -103,13 +113,15 @@ public class MapScalesManager { private final boolean isCustom; private ManagedMapScale(String baseDir, MapScale scale) - throws SerializationException { + throws IllegalStateException, SerializationException { this.isCustom = false; + this.partIds = scale.getPartIds(); + this.displayName = scale.getDisplayName(); + LocalizationFile file = PathManagerFactory.getPathManager() .getStaticLocalizationFile( baseDir + IPathManager.SEPARATOR + scale.getFileName()); - if (file == null || !file.exists()) { throw new IllegalStateException( "scalesInfo.xml references missing file " @@ -117,9 +129,18 @@ public class MapScalesManager { } this.scaleFile = new AutoUpdatingLocalizationFile(file); this.scaleFile.addListener(listener); - this.partIds = scale.getPartIds(); - this.displayName = scale.getDisplayName(); loadBundleXml(); + + /* + * TODO this is inefficient to unmarshal it eagerly for no purpose + * other than to validate, but it ensures that if the files exist + * but have bad XML, then the thrown exception from getScaleBundle() + * will cause the fallback code to be triggered, leading to no blank + * panes + */ + + // validate the XML is good + getScaleBundle(); } private ManagedMapScale(String displayName, Bundle scaleBundle) @@ -190,7 +211,9 @@ public class MapScalesManager { @Override public void fileChanged(AutoUpdatingLocalizationFile file) { try { - loadMapScales(); + MapScales scales = file.loadObject(getJAXBManager(), + MapScales.class); + loadMapScales(scales); } catch (SerializationException e) { statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e); @@ -198,7 +221,7 @@ public class MapScalesManager { } }; - private final AutoUpdatingLocalizationFile scalesFile; + private AutoUpdatingLocalizationFile scalesFile; private final String scaleBundleDir; @@ -223,36 +246,106 @@ public class MapScalesManager { */ public MapScalesManager(String scalesDir, String scalesFile) throws SerializationException { - this(scalesDir, PathManagerFactory.getPathManager() + String filename = scalesDir + IPathManager.SEPARATOR + scalesFile; + LocalizationFile locFile = PathManagerFactory.getPathManager() .getStaticLocalizationFile( - scalesDir + IPathManager.SEPARATOR + scalesFile)); +filename); + MapScales scales = null; + try { + this.scalesFile = new AutoUpdatingLocalizationFile(locFile); + scales = this.scalesFile.loadObject(getJAXBManager(), + MapScales.class); + } catch (SerializationException e) { + /* + * failed to load scalesInfo file, try and fall back to BASE + */ + if (!locFile.getContext().getLocalizationLevel() + .equals(LocalizationLevel.BASE)) { + locFile = PathManagerFactory.getPathManager() + .getLocalizationFile( + new LocalizationContext( + LocalizationType.CAVE_STATIC, + LocalizationLevel.BASE), filename); + this.scalesFile = new AutoUpdatingLocalizationFile(locFile); + scales = this.scalesFile.loadObject(getJAXBManager(), + MapScales.class); + } else { + throw e; + } + } + this.scaleBundleDir = scalesDir; + this.scalesFile.addListener(listener); + loadMapScales(scales); + } + + private synchronized void loadMapScales(MapScales scales) + { + List storedScales = new ArrayList(); + List failedParts = new ArrayList(); + for (MapScale scale : scales.getScales()) { + try { + storedScales.add(new ManagedMapScale(scaleBundleDir, scale)); + } catch (Exception e) { + StringBuilder sb = new StringBuilder(); + sb.append("Error loading " + scale.getDisplayName() + + " scale. "); + if (scale.getPartIds() != null && scale.getPartIds().length > 0) { + sb.append(scale.getDisplayName() + + " pane will attempt to revert to working scale. "); + } + sb.append(scale.getDisplayName() + + " will not appear in the menu. "); + statusHandler.error(sb.toString(), e); + if (scale.getPartIds() != null) { + for (PartId p : scale.getPartIds()) { + failedParts.add(p); + } + } + } + } + this.storedScales = storedScales; + + // storedScales must be set before handleMissingParts() + if (!failedParts.isEmpty()) { + handleMissingParts(failedParts); + } } /** - * Construct a MapScalesManager for the given scales file. File must be - * deserializable into a {@link MapScales} object + * Handles the parts that referenced scales files that couldn't be found. * - * @param bundleDir - * directory bundle files are relative to - * @param scalesFile - * @throws SerializationException + * @param missingParts + * the parts that were missing + * @param goodScales + * the scales that successfully loaded */ - public MapScalesManager(String bundleDir, LocalizationFile scalesFile) - throws SerializationException { - this.scaleBundleDir = bundleDir; - this.scalesFile = new AutoUpdatingLocalizationFile(scalesFile); - this.scalesFile.addListener(listener); - loadMapScales(); - } + protected void handleMissingParts(List missingParts) { + /* + * if the missing part was a side view, fall back to the main pane + */ + ManagedMapScale mainPane = findEditorScale(); - private synchronized void loadMapScales() throws SerializationException { - List storedScales = new ArrayList(); - MapScales scales = this.scalesFile.loadObject(getJAXBManager(), - MapScales.class); - for (MapScale scale : scales.getScales()) { - storedScales.add(new ManagedMapScale(scaleBundleDir, scale)); + if (mainPane == null) { + /* + * main pane is missing too, so fall back to a base scale that is + * guaranteed to be there + */ + mainPane = getLastResortScale(); + storedScales.add(mainPane); } - this.storedScales = storedScales; + + /* + * Set all the missing parts to the scale in the main pane + */ + List combinedParts = new ArrayList( + mainPane.partIds.length + missingParts.size()); + for (PartId p : mainPane.getPartIds()) { + combinedParts.add(p); + } + for (PartId p : missingParts) { + combinedParts.add(p); + } + mainPane.partIds = combinedParts.toArray(new PartId[0]); } /** @@ -336,12 +429,12 @@ public class MapScalesManager { } /** - * Gets the {@link ManagedMapScale}s defined for the partId + * Gets the Bundle defined for the partId. * * @param partId * @return */ - public ManagedMapScale[] getScalesForPart(String partId) { + public Bundle getScaleBundleForPart(String partId) { List scalesForPart = new ArrayList(); for (ManagedMapScale scale : storedScales) { for (PartId part : scale.getPartIds()) { @@ -351,7 +444,26 @@ public class MapScalesManager { } } } - return scalesForPart.toArray(new ManagedMapScale[0]); + + Bundle b = null; + for (ManagedMapScale scale : scalesForPart) { + try { + b = scale.getScaleBundle(); + } catch (SerializationException e) { + statusHandler.error("Error deserializing bundle for scale: " + + scale, e); + } + + if (b != null) { + break; + } + } + + if (b != null) { + b.setView(partId); + } + + return b; } /** @@ -408,4 +520,54 @@ public class MapScalesManager { } return jaxbManager; } + + /** + * Gets a base scale that should always be there and should always work. + * Used to prevent blank panes if scale overrides are misconfigured. + * + * @return + */ + protected ManagedMapScale getLastResortScale() { + ManagedMapScale scale = null; + PartId fallbackPartId = new PartId(); + fallbackPartId.setId(VizMapEditor.EDITOR_ID); + fallbackPartId.setView(false); + MapScale fallback = new MapScale(); + fallback.setPartIds(new PartId[] { fallbackPartId }); + fallback.setDisplayName(LAST_RESORT_NAME); + fallback.setFileName(LAST_RESORT_FILENAME); + try { + scale = new ManagedMapScale(scaleBundleDir, fallback); + } catch (Exception e) { + statusHandler.fatal("Error loading the last resort scale " + + LAST_RESORT_FILENAME, e); + // things will null pointer if this ever hits, but come on + } + return scale; + } + + /** + * Finds the editor pane (ie VizMapEditor.EDITOR_ID) associated with a list + * of scales + * + * @return the first scale tied to a VizMapEditor, or null if none are found + */ + public ManagedMapScale findEditorScale() { + ManagedMapScale editorScale = null; + for (ManagedMapScale scale : storedScales) { + PartId[] parts = scale.partIds; + if (parts != null) { + for (PartId p : parts) { + if (VizMapEditor.EDITOR_ID.equals(p.getId())) { + editorScale = scale; + break; + } + } + } + if (editorScale != null) { + break; + } + } + return editorScale; + } } diff --git a/cave/com.raytheon.uf.viz.d2d.ui/src/com/raytheon/uf/viz/d2d/ui/map/SideView.java b/cave/com.raytheon.uf.viz.d2d.ui/src/com/raytheon/uf/viz/d2d/ui/map/SideView.java index 980f4b02e8..1502997800 100644 --- a/cave/com.raytheon.uf.viz.d2d.ui/src/com/raytheon/uf/viz/d2d/ui/map/SideView.java +++ b/cave/com.raytheon.uf.viz.d2d.ui/src/com/raytheon/uf/viz/d2d/ui/map/SideView.java @@ -35,7 +35,6 @@ import org.eclipse.ui.PartInitException; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.part.ViewPart; -import com.raytheon.uf.common.serialization.SerializationException; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus.Priority; @@ -52,7 +51,6 @@ import com.raytheon.uf.viz.core.drawables.ResourcePair; import com.raytheon.uf.viz.core.exception.VizException; import com.raytheon.uf.viz.core.globals.VizGlobalsManager; import com.raytheon.uf.viz.core.maps.scales.MapScalesManager; -import com.raytheon.uf.viz.core.maps.scales.MapScalesManager.ManagedMapScale; import com.raytheon.uf.viz.core.procedures.Bundle; import com.raytheon.uf.viz.core.rsc.AbstractVizResource; import com.raytheon.uf.viz.core.rsc.IInputHandler; @@ -96,7 +94,8 @@ import com.vividsolutions.jts.geom.Coordinate; * Mar 21, 2013 1638 mschenke Changed map scales not tied to d2d * Aug 9, 2013 DR 16427 D. Friedman Swap additional input handlers. * Oct 10, 2013 #2104 mschenke Switched to use MapScalesManager - * + * Jul 15, 2014 2954 njensen Updated init() for MapScalesManager change + * * * * @author chammack @@ -141,18 +140,8 @@ public class SideView extends ViewPart implements IMultiPaneEditor, String myId = site.getId() + UiUtil.SECONDARY_ID_SEPARATOR + site.getSecondaryId(); - for (ManagedMapScale scale : MapScalesManager.getInstance() - .getScalesForPart(myId)) { - try { - Bundle b = scale.getScaleBundle(); - b.setView(myId); - bundleToLoad = b; - } catch (SerializationException e) { - statusHandler.handle(Priority.PROBLEM, - "Error deserializing bundle for scale: " + scale, e); - } - break; - } + bundleToLoad = MapScalesManager.getInstance().getScaleBundleForPart( + myId); } @Override @@ -284,6 +273,7 @@ public class SideView extends ViewPart implements IMultiPaneEditor, * * @see com.raytheon.viz.core.IDisplayPaneContainer#getActiveDisplayPane() */ + @Override public IDisplayPane getActiveDisplayPane() { return paneManager.getActiveDisplayPane(); } @@ -774,15 +764,18 @@ public class SideView extends ViewPart implements IMultiPaneEditor, ISelectedPanesChangedListener listener) { } + @Override public void registerMouseHandler(IInputHandler handler, InputPriority priority) { paneManager.registerMouseHandler(handler, priority); } + @Override public void registerMouseHandler(IInputHandler handler) { paneManager.registerMouseHandler(handler); } + @Override public void unregisterMouseHandler(IInputHandler handler) { paneManager.unregisterMouseHandler(handler); } From 9d2c3e22db8e11a87d6086173e4d488abeef3274 Mon Sep 17 00:00:00 2001 From: Nate Jensen Date: Thu, 17 Jul 2014 13:27:48 -0500 Subject: [PATCH 23/39] Issue #2954 actually log when the scalesInfo.xml cannot be parsed before falling back to the base version Change-Id: I2df669504061160c6ace76560f07845f99a80912 Former-commit-id: 9aa3ba110f63f995e4cc8b0dc3fa4b8c5fd37d9a [formerly 82bef0037899121311f8cba4cafaacd751315508] [formerly da731be2f788820229d13646e2da31ec487bfad6] [formerly 9aa3ba110f63f995e4cc8b0dc3fa4b8c5fd37d9a [formerly 82bef0037899121311f8cba4cafaacd751315508] [formerly da731be2f788820229d13646e2da31ec487bfad6] [formerly 2a01b1ebcd4f43b2feb2469cffd8273a1718fc84 [formerly da731be2f788820229d13646e2da31ec487bfad6 [formerly 894e6ac1db5b34e6466c68aefa5877b9405bfd59]]]] Former-commit-id: 2a01b1ebcd4f43b2feb2469cffd8273a1718fc84 Former-commit-id: 0e32ad72ab9f0f071d812221602baa2bc779b833 [formerly ecff8cddf22182b3f5cdcfe2be6ede24d00f5d8c] [formerly 98418245e306d7bb9d04b03550569274aa13743e [formerly 95731087ed78e586cbdcf96933aaf019aed7b5fc]] Former-commit-id: b565c825d359b911b961e2fdf66de11743369c78 [formerly eec604da0d2356bb02faf4ce36601de49e4c5ffd] Former-commit-id: 18439faeb99627298032593a4ad263fd05fe3d84 --- .../com/raytheon/uf/viz/core/maps/scales/MapScalesManager.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cave/com.raytheon.uf.viz.core.maps/src/com/raytheon/uf/viz/core/maps/scales/MapScalesManager.java b/cave/com.raytheon.uf.viz.core.maps/src/com/raytheon/uf/viz/core/maps/scales/MapScalesManager.java index 4da840a25d..c3cca54c5f 100644 --- a/cave/com.raytheon.uf.viz.core.maps/src/com/raytheon/uf/viz/core/maps/scales/MapScalesManager.java +++ b/cave/com.raytheon.uf.viz.core.maps/src/com/raytheon/uf/viz/core/maps/scales/MapScalesManager.java @@ -259,6 +259,8 @@ filename); /* * failed to load scalesInfo file, try and fall back to BASE */ + statusHandler.error("Error loading " + DEFAULT_SCALES_FILE + + ". Attempting to revert to base version. ", e); if (!locFile.getContext().getLocalizationLevel() .equals(LocalizationLevel.BASE)) { locFile = PathManagerFactory.getPathManager() From 8ff8d445a203c5be47dae775d0c7b8d6ac1e0e52 Mon Sep 17 00:00:00 2001 From: David Friedman Date: Fri, 18 Jul 2014 17:06:05 +0000 Subject: [PATCH 24/39] ASM #15049 - LAPS time matching problem Change-Id: I52eee87defb407b741208e183b9829558bfa6733 Former-commit-id: 59de9e6c91ae33a7476e76edcfbdb65e4988af38 [formerly 6aebd3a19be18cbe645aa4869f79b62ad0b872a5] [formerly ec25c44fe74eefdff06035aa4dd2a3df2e85ed36] [formerly 59de9e6c91ae33a7476e76edcfbdb65e4988af38 [formerly 6aebd3a19be18cbe645aa4869f79b62ad0b872a5] [formerly ec25c44fe74eefdff06035aa4dd2a3df2e85ed36] [formerly 188e25d2e712e897353890e27865deef8ec5acee [formerly ec25c44fe74eefdff06035aa4dd2a3df2e85ed36 [formerly 624c3a4225910863d5cc0b795493a39c0422a3e3]]]] Former-commit-id: 188e25d2e712e897353890e27865deef8ec5acee Former-commit-id: 60e96a066d116b74a46a21db82779d9d9efc1774 [formerly e73a125fd92920be8d0ac7fc4807a6ac9477ac50] [formerly b777018c04a1b2cf314123b3137b1c7c9f0d4b4c [formerly 93a57dafea0f8340d1bc640088f42414c9d8a0a1]] Former-commit-id: e8c6e7c9e564992ec09ce930d73875f14793c999 [formerly 9efbcdf0b21e18ccc2724b1bb26144c8142ade4e] Former-commit-id: 4bdc4d4297bba2c997117e27d7dc57aebe6190d3 --- .../src/com/raytheon/uf/viz/d2d/core/time/TimeMatcher.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cave/com.raytheon.uf.viz.d2d.core/src/com/raytheon/uf/viz/d2d/core/time/TimeMatcher.java b/cave/com.raytheon.uf.viz.d2d.core/src/com/raytheon/uf/viz/d2d/core/time/TimeMatcher.java index a47eb1ec08..59274966a7 100644 --- a/cave/com.raytheon.uf.viz.d2d.core/src/com/raytheon/uf/viz/d2d/core/time/TimeMatcher.java +++ b/cave/com.raytheon.uf.viz.d2d.core/src/com/raytheon/uf/viz/d2d/core/time/TimeMatcher.java @@ -53,6 +53,7 @@ import com.raytheon.uf.common.time.DataTimeComparator; * cease a null pointer exception. * May 5, 2014 DR 17201 D. Friedman Make same-radar time matching work more like A1. * Aug 08, 2013 2245 bsteffen Make all DataTime comparisons consistent. + * Jul 18, 2014 ASM #15049 D. Friedman Fix LAPS problem introduced by DR 17201 * * * @@ -657,7 +658,6 @@ public class TimeMatcher { if (fspatial) { frameFcsts = dataFcsts; - dtf = dt; } else if (dtf > dt) { dt = dtf; } From 119cf7a5946bae5622f4dfca563c6cff1c3ce47e Mon Sep 17 00:00:00 2001 From: "Fay.Liang" Date: Mon, 21 Jul 2014 12:51:31 -0400 Subject: [PATCH 25/39] ASM #15630 -- GFE: Missing ISC Wind Grids Change-Id: I289f1fafac8e034faa38dcddf639d5744fabe901 Former-commit-id: 4c06eca38e4441eee69a5a54cf96790becb750b9 [formerly 212fcd9eb403c3397564a55267fa0bbadf5c8d65] [formerly a5791db7cbbea5e60a83e8399f2cf0e99ab97ed2] [formerly 4c06eca38e4441eee69a5a54cf96790becb750b9 [formerly 212fcd9eb403c3397564a55267fa0bbadf5c8d65] [formerly a5791db7cbbea5e60a83e8399f2cf0e99ab97ed2] [formerly 8de6be5219b267ed29e8298dd9d9fad5d3552031 [formerly a5791db7cbbea5e60a83e8399f2cf0e99ab97ed2 [formerly db678db964b46a46e062cd0602cf9ce8bc96e4cd]]]] Former-commit-id: 8de6be5219b267ed29e8298dd9d9fad5d3552031 Former-commit-id: 1c2766bd5158cd1b1805b175a07e1dfc4d87fcf3 [formerly 14d7b5b41a75258047729402a246925d02f63cff] [formerly 03b4c6c8cef618a591d76f5fb4be2659669776ef [formerly bf4d91c7db985077c020f362d3a725c7e452837f]] Former-commit-id: 1328be60879c4cb2ca19426110990ec13d658973 [formerly 30a4b6218be082cf0199bcff6b215040f552b0e3] Former-commit-id: 5a51ceabac9645ed428b6198b66fe178b659bcba --- .../edex_static/base/gfe/isc/iscMosaic.py | 30 ++++++++++++------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/gfe/isc/iscMosaic.py b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/gfe/isc/iscMosaic.py index 5fdd6066ac..b145b1189d 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/gfe/isc/iscMosaic.py +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/gfe/isc/iscMosaic.py @@ -38,6 +38,7 @@ from com.raytheon.uf.common.time import TimeRange from com.vividsolutions.jts.geom import Coordinate from java.awt import Point +from com.raytheon.edex.plugin.gfe.server import GridParmManager from com.raytheon.edex.plugin.gfe.config import IFPServerConfigManager from com.raytheon.edex.plugin.gfe.smartinit import IFPDB from com.raytheon.uf.common.dataplugin.gfe import GridDataHistory @@ -61,6 +62,7 @@ from com.raytheon.uf.common.dataplugin.gfe.reference import ReferenceID from com.raytheon.uf.common.dataplugin.gfe.reference import ReferenceData_CoordinateType as CoordinateType from com.raytheon.uf.edex.database.cluster import ClusterLockUtils from com.raytheon.uf.edex.database.cluster import ClusterTask +from java.lang import System # # Port of iscMosaic.py @@ -80,13 +82,10 @@ from com.raytheon.uf.edex.database.cluster import ClusterTask # 05/23/13 1759 dgilling Remove unnecessary imports. # 06/05/13 2063 dgilling Change __siteInDbGrid() to # call IFPWE.history() like A1. -# 09/05/13 2307 dgilling Fix breakage caused by #2044. -# 10/31/2013 2508 randerso Change to use DiscreteGridSlice.getKeys() # 11/05/13 2517 randerso Restructured logging so it coulde be used by WECache # Changed WECache to limit the number of cached grids kept in memory # 01/09/14 16952 randerso Fix regression made in #2517 which caused errors with overlapping grids # 02/04/14 17042 ryu Check in changes for randerso. -# 04/11/2014 17242 David Gillingham (code checked in by zhao) # BATCH_DELAY = 0.0 @@ -419,12 +418,18 @@ class WECache(object): elif gridType == "VECTOR": vecGrids = grid.__numpy__ return (vecGrids[0], vecGrids[1]) - elif gridType == "WEATHER" or gridType =="DISCRETE": + elif gridType == "WEATHER": keys = grid.getKeys() keyList = [] for theKey in keys: keyList.append(theKey.toString()) return (grid.__numpy__[0], keyList) + elif gridType == "DISCRETE": + keys = grid.getKey() + keyList = [] + for theKey in keys: + keyList.append(theKey.toString()) + return (grid.__numpy__[0], keyList) def __encodeGridHistory(self, histories): retVal = [] @@ -726,6 +731,9 @@ class IscMosaic: # process incoming grids for i in xrange(len(inTimes)): + # update cluster lock time to avoid time out + ClusterLockUtils.updateLockTime("ISC Write Lock", parmName , System.currentTimeMillis()) + # Put in a delay so we don't hammer the server so hard. if self.__gridDelay > 0.0: time.sleep(self.__gridDelay) @@ -747,7 +755,7 @@ class IscMosaic: grid = self.__validateAdjustWeatherKeys(grid, self.__parmName, tr) - grid = self.__remap(self.__dbwe, grid, inGeoDict, inFillV) + grid = self.__remap(self.__dbwe.getParmid(), grid, inGeoDict, inFillV) # if rate parm, then may need to adjust the values if self.__rateParm and inTimes[i] != tr: @@ -1224,12 +1232,13 @@ class IscMosaic: return grid.astype(numpy.float32) - def __remap(self, we, grid, inGeoDict, inFillV): - gpi = we.getGpi() + def __remap(self, pid, grid, inGeoDict, inFillV): + + gpi = GridParmManager.getGridParmInfo(pid).getPayload() gridType = gpi.getGridType().toString() - gs = self.__decodeGridSlice(we, grid, TimeRange()) + gs = self.__decodeGridSlice(pid, grid, TimeRange()) pd = self.__decodeProj(inGeoDict) fill = inFillV @@ -1259,10 +1268,9 @@ class IscMosaic: newGrid = mapper.remap(gs.getDiscreteGrid(), fill, fill) return (newGrid.__numpy__[0], grid[1]) - def __decodeGridSlice(self, we, value, tr, history=None): - pid = we.getParmid() - gpi = we.getGpi() + def __decodeGridSlice(self, pid, value, tr, history=None): + gpi = GridParmManager.getGridParmInfo(pid).getPayload() gridType = gpi.getGridType().toString() hist = ArrayList() From db3a4b1fb3fbdfda582816eb8aec13b95bb2c083 Mon Sep 17 00:00:00 2001 From: Ron Anderson Date: Mon, 21 Jul 2014 12:43:21 -0500 Subject: [PATCH 26/39] Issue #3415 Fixed d2dGridDataPurged to not purge NetCDF databases. Change-Id: Ie52a5b8c46d58cb39acde27f0ebdde0c42fdfa67 Former-commit-id: e0bfbb796bc7de872213be1ab988c806b5321fcd [formerly 7903a20dbc73d0b9f0ec1ffaf0745ffbf9d4fc0f] [formerly f3a6393b96f73c858ee98b022db43748e8c3f170] [formerly e0bfbb796bc7de872213be1ab988c806b5321fcd [formerly 7903a20dbc73d0b9f0ec1ffaf0745ffbf9d4fc0f] [formerly f3a6393b96f73c858ee98b022db43748e8c3f170] [formerly 6ea726136b8a510e2130835c03ead7f5d5d94b7c [formerly f3a6393b96f73c858ee98b022db43748e8c3f170 [formerly a2362b68b103c9013d615815924514ebe44be147]]]] Former-commit-id: 6ea726136b8a510e2130835c03ead7f5d5d94b7c Former-commit-id: c2ee319ae14925f7f9940da689bf7bfe4f85104d [formerly 07dd567f6084e9407a0bdd8e9f8dd311a35511db] [formerly 2d25a696f9c5848055ea4706f1fa617108ed1801 [formerly b79ebd050896bbb1944f3b0fd88741535c98333f]] Former-commit-id: 7d65cc86660e90573002904abe1b2c26380e6ee0 [formerly e1b7339a39abe88ede7bf779755c6f07ea0b154f] Former-commit-id: a9382653cbebdc29f269e6f5a2f901b0d7bdd5ba --- .../edex/plugin/gfe/server/GridParmManager.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/server/GridParmManager.java b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/server/GridParmManager.java index 7098ba4e93..4b4bd91cd2 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/server/GridParmManager.java +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/server/GridParmManager.java @@ -122,7 +122,7 @@ import com.raytheon.uf.edex.database.purge.PurgeLogger; * 06/24/2014 #3317 randerso Send DBInvChangeNotification when database is created, unless it's * created in response to another DBInvChangeNotification so IFPServers stay in synch. * Cleaned up commented code. - * + * 07/21/2014 #3415 randerso Fixed d2dGridDataPurged to not purge NetCDF databases. * * * @author bphillip @@ -1558,15 +1558,18 @@ public class GridParmManager { } } - DatabaseID satDbid = D2DSatDatabase.getDbId(siteID); - List deleted = new ArrayList(currentInventory); deleted.removeAll(newInventory); + + // don't delete NetCDF and satellite databases. + deleted.removeAll(NetCDFDatabaseManager.getDatabaseIds(siteID)); + deleted.remove(D2DSatDatabase.getDbId(siteID)); + Iterator iter = deleted.iterator(); while (iter.hasNext()) { DatabaseID dbid = iter.next(); - // remove satellite database and non-D2D databases from deletes - if (!dbid.getDbType().equals("D2D") || dbid.equals(satDbid)) { + // don't delete non-D2D databases + if (!dbid.getDbType().equals("D2D")) { iter.remove(); } else { // remove the database @@ -1577,9 +1580,6 @@ public class GridParmManager { } } - // if ((added.size() > 0) || (deleted.size() > 0)) { - // DBInvChangeNotification changed = new DBInvChangeNotification( - // added, deleted, siteID); if (deleted.size() > 0) { DBInvChangeNotification changed = new DBInvChangeNotification(null, deleted, siteID); From d5f03bcf00e4852248c988a1b5f54eaeb7872a43 Mon Sep 17 00:00:00 2001 From: Shawn Hooper Date: Tue, 22 Jul 2014 10:15:46 -0500 Subject: [PATCH 27/39] Revert "ASM #15630 -- GFE: Missing ISC Wind Grids" This reverts commit a31a408a18846806e64c2450d665b6ce6ed8ea82 [formerly 8de6be5219b267ed29e8298dd9d9fad5d3552031] [formerly 4c06eca38e4441eee69a5a54cf96790becb750b9 [formerly 212fcd9eb403c3397564a55267fa0bbadf5c8d65] [formerly a5791db7cbbea5e60a83e8399f2cf0e99ab97ed2] [formerly 4c06eca38e4441eee69a5a54cf96790becb750b9 [formerly 212fcd9eb403c3397564a55267fa0bbadf5c8d65] [formerly a5791db7cbbea5e60a83e8399f2cf0e99ab97ed2] [formerly 8de6be5219b267ed29e8298dd9d9fad5d3552031 [formerly a5791db7cbbea5e60a83e8399f2cf0e99ab97ed2 [formerly db678db964b46a46e062cd0602cf9ce8bc96e4cd]]]]]. Change-Id: Ib5d03f81b35c0371e063a89739b823b8264c439f Former-commit-id: c3c267fbdca4cf25498a08a3fee5d47652a6e49d [formerly faf934a05a32efbd196196b56a52b820587d6346] [formerly 425bcea65d86fce5c1781d186e3655558245f45d] [formerly c3c267fbdca4cf25498a08a3fee5d47652a6e49d [formerly faf934a05a32efbd196196b56a52b820587d6346] [formerly 425bcea65d86fce5c1781d186e3655558245f45d] [formerly 65802e34fd03d5be5e52db57188d6043e0fe9a97 [formerly 425bcea65d86fce5c1781d186e3655558245f45d [formerly 7dcfb55353ba7ec9d0619737da37781b0b186e5d]]]] Former-commit-id: 65802e34fd03d5be5e52db57188d6043e0fe9a97 Former-commit-id: 1809ba336873da7ded256589573c1aa9c5222880 [formerly e44a911ccc86b6ea8cde0d20af56298a0ddfb2f6] [formerly 20694ec929f593e4321933dd27fa642c119017f1 [formerly e53566cda233f60aeaec7cddbbcaf32111695ada]] Former-commit-id: 1554c68605f8cd0788fc862ed6e02689824c86b4 [formerly 44cfa3d6d3026fc08219adc2adea518576325a5d] Former-commit-id: 17d864604d3da3e794db2f302455f399f5142c80 --- .../edex_static/base/gfe/isc/iscMosaic.py | 30 +++++++------------ 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/gfe/isc/iscMosaic.py b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/gfe/isc/iscMosaic.py index b145b1189d..5fdd6066ac 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/gfe/isc/iscMosaic.py +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/gfe/isc/iscMosaic.py @@ -38,7 +38,6 @@ from com.raytheon.uf.common.time import TimeRange from com.vividsolutions.jts.geom import Coordinate from java.awt import Point -from com.raytheon.edex.plugin.gfe.server import GridParmManager from com.raytheon.edex.plugin.gfe.config import IFPServerConfigManager from com.raytheon.edex.plugin.gfe.smartinit import IFPDB from com.raytheon.uf.common.dataplugin.gfe import GridDataHistory @@ -62,7 +61,6 @@ from com.raytheon.uf.common.dataplugin.gfe.reference import ReferenceID from com.raytheon.uf.common.dataplugin.gfe.reference import ReferenceData_CoordinateType as CoordinateType from com.raytheon.uf.edex.database.cluster import ClusterLockUtils from com.raytheon.uf.edex.database.cluster import ClusterTask -from java.lang import System # # Port of iscMosaic.py @@ -82,10 +80,13 @@ from java.lang import System # 05/23/13 1759 dgilling Remove unnecessary imports. # 06/05/13 2063 dgilling Change __siteInDbGrid() to # call IFPWE.history() like A1. +# 09/05/13 2307 dgilling Fix breakage caused by #2044. +# 10/31/2013 2508 randerso Change to use DiscreteGridSlice.getKeys() # 11/05/13 2517 randerso Restructured logging so it coulde be used by WECache # Changed WECache to limit the number of cached grids kept in memory # 01/09/14 16952 randerso Fix regression made in #2517 which caused errors with overlapping grids # 02/04/14 17042 ryu Check in changes for randerso. +# 04/11/2014 17242 David Gillingham (code checked in by zhao) # BATCH_DELAY = 0.0 @@ -418,18 +419,12 @@ class WECache(object): elif gridType == "VECTOR": vecGrids = grid.__numpy__ return (vecGrids[0], vecGrids[1]) - elif gridType == "WEATHER": + elif gridType == "WEATHER" or gridType =="DISCRETE": keys = grid.getKeys() keyList = [] for theKey in keys: keyList.append(theKey.toString()) return (grid.__numpy__[0], keyList) - elif gridType == "DISCRETE": - keys = grid.getKey() - keyList = [] - for theKey in keys: - keyList.append(theKey.toString()) - return (grid.__numpy__[0], keyList) def __encodeGridHistory(self, histories): retVal = [] @@ -731,9 +726,6 @@ class IscMosaic: # process incoming grids for i in xrange(len(inTimes)): - # update cluster lock time to avoid time out - ClusterLockUtils.updateLockTime("ISC Write Lock", parmName , System.currentTimeMillis()) - # Put in a delay so we don't hammer the server so hard. if self.__gridDelay > 0.0: time.sleep(self.__gridDelay) @@ -755,7 +747,7 @@ class IscMosaic: grid = self.__validateAdjustWeatherKeys(grid, self.__parmName, tr) - grid = self.__remap(self.__dbwe.getParmid(), grid, inGeoDict, inFillV) + grid = self.__remap(self.__dbwe, grid, inGeoDict, inFillV) # if rate parm, then may need to adjust the values if self.__rateParm and inTimes[i] != tr: @@ -1232,13 +1224,12 @@ class IscMosaic: return grid.astype(numpy.float32) - def __remap(self, pid, grid, inGeoDict, inFillV): - - gpi = GridParmManager.getGridParmInfo(pid).getPayload() + def __remap(self, we, grid, inGeoDict, inFillV): + gpi = we.getGpi() gridType = gpi.getGridType().toString() - gs = self.__decodeGridSlice(pid, grid, TimeRange()) + gs = self.__decodeGridSlice(we, grid, TimeRange()) pd = self.__decodeProj(inGeoDict) fill = inFillV @@ -1268,9 +1259,10 @@ class IscMosaic: newGrid = mapper.remap(gs.getDiscreteGrid(), fill, fill) return (newGrid.__numpy__[0], grid[1]) - def __decodeGridSlice(self, pid, value, tr, history=None): + def __decodeGridSlice(self, we, value, tr, history=None): + pid = we.getParmid() + gpi = we.getGpi() - gpi = GridParmManager.getGridParmInfo(pid).getPayload() gridType = gpi.getGridType().toString() hist = ArrayList() From 4dfee553281564a60ee8f35a1781da4bdf09e0ad Mon Sep 17 00:00:00 2001 From: "Shawn.Hooper" Date: Tue, 22 Jul 2014 15:55:31 -0400 Subject: [PATCH 28/39] ASM #15630 - Check-in fix for GFE: Missing ISC Wind Grids on behalf of Ron Anderson Change-Id: I9053182b6c02d6c77e10e23b017b94bcff4da58b Former-commit-id: 11196e72751023ba4f67e89e70853e6208763bef [formerly a70786ff22e7216948248d7cc4d2bfde940c09ab] [formerly 2a32d5945c91a22f4c48030c20a62b9842d19706] [formerly 11196e72751023ba4f67e89e70853e6208763bef [formerly a70786ff22e7216948248d7cc4d2bfde940c09ab] [formerly 2a32d5945c91a22f4c48030c20a62b9842d19706] [formerly ae272328a3b2755e272a335114993f9278e06aea [formerly 2a32d5945c91a22f4c48030c20a62b9842d19706 [formerly 4bca3ffd258a6869150154e93abb652a1f22bc4d]]]] Former-commit-id: ae272328a3b2755e272a335114993f9278e06aea Former-commit-id: ed0f24b1f0024795cbb28878393fa293c32f45cf [formerly 4171066d845f8aa51b535b0b03790e7bc0bc9094] [formerly e28a234c0ae60b0a65752feb1c62a4f4f5adcd36 [formerly 94e01820a2bc963b6addc90c88b18c99d8f767b4]] Former-commit-id: 381f55d183136f0bd97474c6c8ee8df930dbca9f [formerly 141996f0ab611e7ad3bb1cb668345ad32cfa054d] Former-commit-id: df3b41ed7d994c5e244b98563ec0ed08c21dd02c --- .../utility/edex_static/base/gfe/isc/iscMosaic.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/gfe/isc/iscMosaic.py b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/gfe/isc/iscMosaic.py index 5fdd6066ac..70bf4b68fe 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/gfe/isc/iscMosaic.py +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/gfe/isc/iscMosaic.py @@ -30,6 +30,7 @@ except: import numpy import JUtil +from java.lang import System from java.util import ArrayList from java.util import LinkedHashMap from com.raytheon.uf.common.dataplugin.gfe.grid import Grid2DFloat @@ -87,6 +88,7 @@ from com.raytheon.uf.edex.database.cluster import ClusterTask # 01/09/14 16952 randerso Fix regression made in #2517 which caused errors with overlapping grids # 02/04/14 17042 ryu Check in changes for randerso. # 04/11/2014 17242 David Gillingham (code checked in by zhao) +# 07/22/2014 17484 randerso Update cluster lock time to prevent time out # BATCH_DELAY = 0.0 @@ -726,6 +728,9 @@ class IscMosaic: # process incoming grids for i in xrange(len(inTimes)): + # update cluster lock time to avoid time out + ClusterLockUtils.updateLockTime("ISC Write Lock", parmName ,System.currentTimeMillis()) + # Put in a delay so we don't hammer the server so hard. if self.__gridDelay > 0.0: time.sleep(self.__gridDelay) From 1eebd8ac537f20acbab207ade925001f4c252f87 Mon Sep 17 00:00:00 2001 From: Jonathan Sanchez Date: Tue, 22 Jul 2014 15:32:12 -0500 Subject: [PATCH 29/39] Issue #3419 Refactored watches to use the county table. Change-Id: Ide7e07813203213511640d5ee515e73b278089c1 Former-commit-id: c479178882b07e661c5691f33a9ad8b159bf9ff7 [formerly 997485dd2264c7c87926c2c264d5785c2c0dad96] [formerly 86a8ca4a30562f711d6104532b20e01fbd54350f] [formerly c479178882b07e661c5691f33a9ad8b159bf9ff7 [formerly 997485dd2264c7c87926c2c264d5785c2c0dad96] [formerly 86a8ca4a30562f711d6104532b20e01fbd54350f] [formerly b9918384945c460605762a031376fc3712b778ec [formerly 86a8ca4a30562f711d6104532b20e01fbd54350f [formerly 135d7ffa84af58d7b3c9575e654fa1298b76b2e2]]]] Former-commit-id: b9918384945c460605762a031376fc3712b778ec Former-commit-id: 3d434c29c1fc9390482db6301565064f75e8a11e [formerly f7bc9a8023beb37c99e455ecd20cc07f553c823f] [formerly 850ffbd991e733a0bd522e120fa37ad963197e14 [formerly 025c29acc0d02ecf8e84c4c0ca3f8e54b9635754]] Former-commit-id: 5b450f5b49602fd2a5be013c2018216984912a58 [formerly 56cbd231414fb3ac2dcdbd5143a152c246b84822] Former-commit-id: e4268f814ea1eddfbe9a7b1f6a924e66aa528aa9 --- .../com/raytheon/viz/warngen/gis/Area.java | 83 +-- .../com/raytheon/viz/warngen/gis/Watch.java | 191 ++++++ .../raytheon/viz/warngen/gis/WatchUtil.java | 536 +++++++++++++++ .../viz/warngen/gui/WarngenDialog.java | 131 ++-- .../viz/warngen/template/TemplateRunner.java | 611 +----------------- .../raytheon/viz/warngen/util/WatchUtil.java | 100 --- .../warngen/util/WeatherAdvisoryWatch.java | 155 ----- .../base/warngen/VM_global_library.vm | 72 +-- .../base/warngen/airportWeatherWarning.vm | 4 +- .../base/warngen/airportWeatherWarning.xml | 6 +- .../warngen/burnScarFlashFloodWarning.xml | 6 +- .../base/warngen/extremeWindWarning.vm | 4 +- .../base/warngen/extremeWindWarning.xml | 6 +- .../warngen/extremeWindWarningFollowup.vm | 20 +- .../warngen/extremeWindWarningFollowup.xml | 6 +- .../base/warngen/fireWarning.xml | 2 +- .../base/warngen/flashFloodWarning.xml | 6 +- .../impactSevereThunderstormWarning.vm | 4 +- .../impactSevereThunderstormWarning.xml | 4 +- .../warngen/impactSevereWeatherStatement.vm | 6 +- .../warngen/impactSevereWeatherStatement.xml | 4 +- .../warngen/impactSpecialMarineWarning.vm | 4 +- .../warngen/impactSpecialMarineWarning.xml | 6 +- .../impactSpecialMarineWarningFollowup.vm | 28 +- .../impactSpecialMarineWarningFollowup.xml | 6 +- .../base/warngen/marineWeatherStatement.xml | 6 +- .../warngen/marineWeatherStatementAshfall.xml | 6 +- .../base/warngen/severeThunderstormWarning.vm | 2 +- .../warngen/severeThunderstormWarning.xml | 4 +- .../base/warngen/severeWeatherStatement.vm | 6 +- .../base/warngen/severeWeatherStatement.xml | 4 +- .../base/warngen/shortTermForecast.vm | 4 +- .../base/warngen/shortTermForecast.xml | 6 +- .../warngen/significantWeatherAdvisory.vm | 4 +- .../warngen/significantWeatherAdvisory.xml | 6 +- .../base/warngen/specialMarineWarning.vm | 4 +- .../base/warngen/specialMarineWarning.xml | 6 +- .../warngen/specialMarineWarningFollowup.vm | 28 +- .../warngen/specialMarineWarningFollowup.xml | 6 +- .../base/warngen/specialWeatherStatement.xml | 6 +- 40 files changed, 994 insertions(+), 1105 deletions(-) create mode 100644 cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gis/Watch.java create mode 100644 cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gis/WatchUtil.java delete mode 100644 cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/util/WatchUtil.java delete mode 100644 cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/util/WeatherAdvisoryWatch.java diff --git a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gis/Area.java b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gis/Area.java index e4817f8cbc..4bc94893ba 100644 --- a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gis/Area.java +++ b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gis/Area.java @@ -21,6 +21,7 @@ package com.raytheon.viz.warngen.gis; import java.io.FileNotFoundException; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -45,6 +46,7 @@ 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.viz.core.exception.VizException; +import com.raytheon.viz.warngen.gis.GisUtil.Direction; import com.raytheon.viz.warngen.gui.WarngenLayer; import com.raytheon.viz.warngen.util.Abbreviation; import com.vividsolutions.jts.geom.Geometry; @@ -77,6 +79,7 @@ import com.vividsolutions.jts.geom.prep.PreparedGeometry; * Apr 29, 2014 3033 jsanchez Updated method to retrieve files in localization. * May 16, 2014 DR 17365 D. Friedman Reduce precision of warning area to avoid topology errors. * Jun 30, 2014 DR 17447 Qinglu lin Updated findAffectedAreas(). + * Jul 22, 23014 3419 jsanchez Cleaned up converFeAreaToPartList. * * * @author chammack @@ -92,6 +95,10 @@ public class Area { */ public static final double DEFAULT_PORTION_TOLERANCE = 0.60; + private static final List SPECIAL_CASE_FE_AREAS = Arrays + .asList(new String[] { "PA", "MI", "PD", "UP", "BB", "ER", "EU", + "SR", "NR", "WU", "DS" }); + private PortionsUtil portionsUtil; public Area(PortionsUtil portionsUtil) { @@ -259,8 +266,10 @@ public class Area { area.points = pointList.toArray(new String[pointList.size()]); } - String countyName = (String)regionFeature.attributes.get("COUNTYNAME"); - if (uniqueFips.contains(area.fips) == false || !uniqueCountyname.contains(countyName)) { + String countyName = (String) regionFeature.attributes + .get("COUNTYNAME"); + if (uniqueFips.contains(area.fips) == false + || !uniqueCountyname.contains(countyName)) { uniqueFips.add(area.fips); if (countyName != null) { uniqueCountyname.add(countyName); @@ -300,7 +309,8 @@ public class Area { Map areasMap = new HashMap(); try { - Geometry precisionReducedArea = PolygonUtil.reducePrecision(warnArea); + Geometry precisionReducedArea = PolygonUtil + .reducePrecision(warnArea); if (precisionReducedArea.isValid()) { warnArea = precisionReducedArea; } @@ -338,66 +348,41 @@ public class Area { public static List converFeAreaToPartList(String feArea) { final List partList = new ArrayList(); - if (feArea == null) { - // Marine warnings - partList.add(""); - } else { - if (feArea.equals("pa")) - partList.add("PA"); - else if (feArea.equals("mi")) - partList.add("MI"); - else if (feArea.equals("pd")) - partList.add("PD"); - else if (feArea.equals("up")) - partList.add("UP"); - else if (feArea.equals("bb")) - partList.add("BB"); - else if (feArea.equals("er")) - partList.add("ER"); - else if (feArea.equals("eu")) - partList.add("EU"); - else if (feArea.equals("sr")) - partList.add("SR"); - else if (feArea.equals("nr")) - partList.add("NR"); - else if (feArea.equals("wu")) - partList.add("WU"); - else if (feArea.equals("ds")) - partList.add("DS"); - else if (feArea.equals("ne")) - partList.add("NE"); - else if (feArea.equals("nw")) - partList.add("NW"); - else if (feArea.equals("se")) - partList.add("SE"); - else if (feArea.equals("sw")) - partList.add("SW"); - else { + if (feArea != null) { + feArea = feArea.toUpperCase(); + if (SPECIAL_CASE_FE_AREAS.contains(feArea)) { + partList.add(feArea); + } else { for (int i = 0; i < feArea.length(); i++) { char c = feArea.charAt(i); + Direction direction = null; switch (c) { - case 'c': - partList.add("CENTRAL"); + + case 'C': + direction = Direction.CENTRAL; break; - case 'w': - partList.add("WEST"); + case 'W': + direction = Direction.WEST; break; - case 'n': - partList.add("NORTH"); + case 'N': + direction = Direction.NORTH; break; - case 'e': - partList.add("EAST"); + case 'E': + direction = Direction.EAST; break; - case 's': - partList.add("SOUTH"); + case 'S': + direction = Direction.SOUTH; break; default: break; } + + if (direction != null) { + partList.add(direction.toString()); + } } } } return partList; } - } diff --git a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gis/Watch.java b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gis/Watch.java new file mode 100644 index 0000000000..78c1630ca5 --- /dev/null +++ b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gis/Watch.java @@ -0,0 +1,191 @@ +/** + * This software was developed and / or modified by Raytheon Company, + * pursuant to Contract DG133W-05-CQ-1067 with the US Government. + * + * U.S. EXPORT CONTROLLED TECHNICAL DATA + * This software product contains export-restricted data whose + * export/transfer/disclosure is restricted by U.S. law. Dissemination + * to non-U.S. persons whether in the United States or abroad requires + * an export license or other authorization. + * + * Contractor Name: Raytheon Company + * Contractor Address: 6825 Pine Street, Suite 340 + * Mail Stop B8 + * Omaha, NE 68106 + * 402.291.0100 + * + * See the AWIPS II Master Rights File ("Master Rights File.pdf") for + * further licensing information. + **/ +package com.raytheon.viz.warngen.gis; + +import java.util.Date; +import java.util.List; + +/** + * Simple POJO for a watch. The phenSig, action, etn, start time, and end time + * make each watch unique similar to the VTEC. + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Jul 16, 2014 3419       jsanchez     Initial creation
+ * 
+ * 
+ * + * @author jsanchez + * @version 1.0 + */ + +public class Watch { + + private String phenSig; + + private String action; + + private String etn; + + private Date startTime; + + private Date endTime; + + private List areas; + + private String state; + + private List partOfState; + + public Watch(String state, String action, String phenSig, String etn, + Date startTime, Date endTime) { + this.state = state; + this.action = action; + this.phenSig = phenSig; + this.etn = etn; + this.startTime = startTime; + this.endTime = endTime; + } + + public String getPhenSig() { + return phenSig; + } + + public void setPhenSig(String phenSig) { + this.phenSig = phenSig; + } + + public Date getStartTime() { + return startTime; + } + + public void setStartTime(Date startTime) { + this.startTime = startTime; + } + + public Date getEndTime() { + return endTime; + } + + public void setEndTime(Date endTime) { + this.endTime = endTime; + } + + public List getAreas() { + return areas; + } + + public void setAreas(List areas) { + this.areas = areas; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + public List getPartOfState() { + return partOfState; + } + + public void setPartOfState(List partOfState) { + this.partOfState = partOfState; + } + + public String getAction() { + return action; + } + + public void setAction(String action) { + this.action = action; + } + + public String getEtn() { + return etn; + } + + public void setEtn(String etn) { + this.etn = etn; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((action == null) ? 0 : action.hashCode()); + result = prime * result + ((endTime == null) ? 0 : endTime.hashCode()); + result = prime * result + ((etn == null) ? 0 : etn.hashCode()); + result = prime * result + ((phenSig == null) ? 0 : phenSig.hashCode()); + result = prime * result + + ((startTime == null) ? 0 : startTime.hashCode()); + result = prime * result + ((state == null) ? 0 : state.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + Watch other = (Watch) obj; + if (action == null) { + if (other.action != null) + return false; + } else if (!action.equals(other.action)) + return false; + if (endTime == null) { + if (other.endTime != null) + return false; + } else if (!endTime.equals(other.endTime)) + return false; + if (etn == null) { + if (other.etn != null) + return false; + } else if (!etn.equals(other.etn)) + return false; + if (phenSig == null) { + if (other.phenSig != null) + return false; + } else if (!phenSig.equals(other.phenSig)) + return false; + if (startTime == null) { + if (other.startTime != null) + return false; + } else if (!startTime.equals(other.startTime)) + return false; + if (state == null) { + if (other.state != null) + return false; + } else if (!state.equals(other.state)) + return false; + return true; + } + +} diff --git a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gis/WatchUtil.java b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gis/WatchUtil.java new file mode 100644 index 0000000000..ec732ab855 --- /dev/null +++ b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gis/WatchUtil.java @@ -0,0 +1,536 @@ +/** + * This software was developed and / or modified by Raytheon Company, + * pursuant to Contract DG133W-05-CQ-1067 with the US Government. + * + * U.S. EXPORT CONTROLLED TECHNICAL DATA + * This software product contains export-restricted data whose + * export/transfer/disclosure is restricted by U.S. law. Dissemination + * to non-U.S. persons whether in the United States or abroad requires + * an export license or other authorization. + * + * Contractor Name: Raytheon Company + * Contractor Address: 6825 Pine Street, Suite 340 + * Mail Stop B8 + * Omaha, NE 68106 + * 402.291.0100 + * + * See the AWIPS II Master Rights File ("Master Rights File.pdf") for + * further licensing information. + **/ +package com.raytheon.viz.warngen.gis; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Calendar; +import java.util.Collections; +import java.util.Comparator; +import java.util.Date; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import javax.measure.converter.UnitConverter; +import javax.measure.unit.NonSI; +import javax.measure.unit.SI; + +import org.apache.commons.lang.Validate; + +import com.raytheon.uf.common.activetable.ActiveTableRecord; +import com.raytheon.uf.common.activetable.OperationalActiveTableRecord; +import com.raytheon.uf.common.activetable.PracticeActiveTableRecord; +import com.raytheon.uf.common.dataplugin.warning.WarningRecord.WarningAction; +import com.raytheon.uf.common.dataplugin.warning.config.AreaSourceConfiguration; +import com.raytheon.uf.common.dataplugin.warning.config.WarngenConfiguration; +import com.raytheon.uf.common.dataplugin.warning.gis.GeospatialData; +import com.raytheon.uf.common.dataquery.requests.DbQueryRequest; +import com.raytheon.uf.common.dataquery.requests.RequestConstraint; +import com.raytheon.uf.common.dataquery.requests.RequestConstraint.ConstraintType; +import com.raytheon.uf.common.dataquery.responses.DbQueryResponse; +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.util.TimeUtil; +import com.raytheon.uf.viz.core.requests.ThriftClient; +import com.raytheon.viz.core.mode.CAVEMode; +import com.raytheon.viz.warngen.gui.WarngenLayer; +import com.vividsolutions.jts.geom.Geometry; +import com.vividsolutions.jts.geom.Polygon; + +/** + * Determines the valid watches related to the warning. + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Jul 17, 2014 3419       jsanchez     Initial creation
+ * 
+ * 
+ * + * @author jsanchez + * @version 1.0 + */ + +public class WatchUtil { + private static final transient IUFStatusHandler statusHandler = UFStatus + .getHandler(WatchUtil.class); + + private static final UnitConverter milesToKilometer = NonSI.MILE + .getConverterTo(SI.KILOMETER); + + private static final double KmToDegrees = 111.12; + + private static final String ISSUE_TIME_FIELD = "issueTime"; + + private static final String START_TIME_FIELD = "startTime"; + + private static final String END_TIME_FIELD = "endTime"; + + private static final String UGC_ZONE_FIELD = "ugcZone"; + + private static final String PHEN_SIG_FIELD = "phensig"; + + private static final String ETN = "etn"; + + private static final String ACTION = "act"; + + private static final String COUNTY_FIPS_FIELD = "FIPS"; + + private static final String COUNTY_FE_AREA_FIELD = "FE_AREA"; + + private static final String STATE_FIELD = "STATE"; + + private static final String COUNTY_TABLE = "County"; + + private static final String PARENT_NAME_FIELD = "NAME"; + + private static final String[] REQUEST_FIELDS = new String[] { + ISSUE_TIME_FIELD, START_TIME_FIELD, END_TIME_FIELD, UGC_ZONE_FIELD, + PHEN_SIG_FIELD, END_TIME_FIELD, ACTION, ETN }; + + private GeospatialData[] countyGeoData; + + private WarngenLayer warngenLayer; + + public WatchUtil(WarngenLayer warngenLayer) throws InstantiationException { + countyGeoData = warngenLayer.getGeodataFeatures(COUNTY_TABLE, + warngenLayer.getLocalizedSite()); + if ((countyGeoData == null) || (countyGeoData.length == 0)) { + throw new InstantiationException("Cannot get geospatial data for " + + COUNTY_TABLE + "-based watches"); + } + this.warngenLayer = warngenLayer; + } + + /** + * Retrieves valid watches based on the constraints in the config, the + * warning polygon, and the current simulated time. + * + * @param config + * @param warningPolygon + * @param simulatedTime + * @return + * @throws Exception + */ + public List getWatches(WarngenConfiguration config, + Geometry warningPolygon, Date simulatedTime) throws Exception { + List watches = null; + AreaSourceConfiguration hatchedAreaSourceConfig = config + .getHatchedAreaSource(); + // Validation check + Validate.notNull(hatchedAreaSourceConfig, + "Cannot process watches: missing HATCHING area source configuration"); + + double watchAreaBuffer = hatchedAreaSourceConfig + .getIncludedWatchAreaBuffer(); + // Validation check + Validate.isTrue(watchAreaBuffer >= 0, + "'includedWatchAreaBuffer' can not be negative in .xml file"); + + String[] includedWatches = config.getIncludedWatches(); + + if ((includedWatches != null) && (includedWatches.length > 0)) { + StringBuilder phenSigConstraint = new StringBuilder(); + Iterator iterator = Arrays.asList(includedWatches) + .iterator(); + while (iterator.hasNext()) { + phenSigConstraint.append(iterator.next()); + if (iterator.hasNext()) { + phenSigConstraint.append(","); + } + } + + // Determine entity class + Class entityClass = OperationalActiveTableRecord.class; + if (CAVEMode.getMode() != CAVEMode.OPERATIONAL) { + entityClass = PracticeActiveTableRecord.class; + } + + DbQueryRequest request = buildRequest(simulatedTime, + phenSigConstraint.toString(), warngenLayer.getAllUgcs(), + entityClass); + DbQueryResponse response = (DbQueryResponse) ThriftClient + .sendRequest(request); + + List records = convertReponse(entityClass, + response); + + if (records.isEmpty() == false) { + try { + long t0 = System.currentTimeMillis(); + Polygon watchArea = (Polygon) warningPolygon + .buffer(milesToKilometer.convert(watchAreaBuffer) + / KmToDegrees); + System.out.println("create watch area buffer time: " + + (System.currentTimeMillis() - t0)); + Set validUgcZones = warngenLayer + .getUgcsForWatches(watchArea); + watches = processRecords(records, validUgcZones); + } catch (RuntimeException e) { + statusHandler + .handle(Priority.ERROR, + "Error determining areas to search for watches.", + e); + } + } + } + + return watches; + } + + /** + * Builds a DBQueryRequest object. + * + * @param simulatedTime + * @param phenSig + * @param ugcs + * @param entityClass + * @return + */ + private static DbQueryRequest buildRequest(Date simulatedTime, + String phenSig, Set ugcs, + Class entityClass) { + // Create start constraint + Calendar cal = Calendar.getInstance(); + cal.setTime(simulatedTime); + cal.add(Calendar.MINUTE, 3); + Date startConstraintTime = cal.getTime(); + + DbQueryRequest request = new DbQueryRequest(); + request.setEntityClass(entityClass); + request.addConstraint(START_TIME_FIELD, + new RequestConstraint(TimeUtil.formatDate(startConstraintTime), + ConstraintType.LESS_THAN_EQUALS)); + request.addConstraint(END_TIME_FIELD, + new RequestConstraint(TimeUtil.formatDate(simulatedTime), + ConstraintType.GREATER_THAN_EQUALS)); + request.addConstraint("phensig", + new RequestConstraint(phenSig.toString(), ConstraintType.IN)); + + /* + * Get all UGCs in the CWA now so that the watches will be formatted + * with all portions of the affected state(s). + * + * Filtering for valid UGCs is performed in processATEntries + */ + RequestConstraint ugcConstraint = new RequestConstraint("", + ConstraintType.IN); + ugcConstraint.setConstraintValueList(ugcs); + request.addConstraint("ugcZone", ugcConstraint); + + // These are the only fields we need for processing watches + request.addFields(REQUEST_FIELDS); + + return request; + } + + /** + * Converts the results of DbQueryResponse into a list of + * ActiveTableRecords. + * + * @param entityClass + * @param response + * @return + * @throws IllegalAccessException + * @throws InstantiationException + */ + private static final List convertReponse( + Class entityClass, + DbQueryResponse response) throws IllegalAccessException, + InstantiationException { + List records = new ArrayList( + response.getNumResults()); + for (Map result : response.getResults()) { + WarningAction action = WarningAction.valueOf(String.valueOf(result + .get(ACTION))); + /* + * TODO: Currently limited to filtering out one of ("CAN","EXP"). + * Could use "Act" in addition to "act", but this should really be + * fixed the underlying system. request.addConstraint("act", new + * RequestConstraint("CAN", ConstraintType.NOT_EQUALS)); + */ + if (action != WarningAction.CAN || action != WarningAction.EXP) { + ActiveTableRecord record = entityClass.newInstance(); + record.setIssueTime((Calendar) result.get(ISSUE_TIME_FIELD)); + record.setStartTime((Calendar) result.get(START_TIME_FIELD)); + record.setEndTime((Calendar) result.get(END_TIME_FIELD)); + record.setEndTime((Calendar) result.get(END_TIME_FIELD)); + record.setUgcZone(String.valueOf(result.get(UGC_ZONE_FIELD))); + record.setPhensig(String.valueOf(result.get(PHEN_SIG_FIELD))); + record.setEtn(String.valueOf(result.get(ETN))); + record.setAct(String.valueOf(result.get(ACTION))); + records.add(record); + } + } + + return records; + } + + /** + * Groups the activeTableRecords into Watch objects that share phenSig, + * action, ETN, start time, and end time. It also determines the part of + * state the watch covers. + * + * @param activeTableRecords + * @param validUgcZones + * + * @return + */ + private List processRecords( + List activeTableRecords, + Set validUgcZones) { + List watches = new ArrayList(); + + /* + * Assumption 1: TO.A and SV.A UGC line will always be in county format + * from WOU. + */ + /* + * Assumption 2: At least 1 warning for the issuing site supports county + * based warnings. This will allow the county geo features to be cached. + */ + + Map> map = new HashMap>(); + // For each watch event, get the end time and list of active zones + for (ActiveTableRecord ar : activeTableRecords) { + /* + * Currently reports all zones in the watch even if a given zone is + * not in the warning polygon. If the logic is changed to only show + * the portions of the watch near our warning polygon, filter on + * validUgcZones here. + */ + String ugcZone = ar.getUgcZone(); + String state = getStateName(ugcZone.substring(0, 2)); + String action = ar.getAct(); + String phenSig = ar.getPhensig(); + String etn = ar.getEtn(); + Date startTime = ar.getStartTime().getTime(); + Date endTime = ar.getEndTime().getTime(); + + if (validUgcZones.contains(ugcZone)) { + Watch watch = new Watch(state, action, phenSig, etn, startTime, + endTime); + List areas = map.get(watch); + if (areas == null) { + areas = new ArrayList(); + } + areas.add(ugcZone); + map.put(watch, areas); + } + } + + // Sets the areas for the watch + for (Entry> entry : map.entrySet()) { + Watch watch = entry.getKey(); + watch.setAreas(entry.getValue()); + List partOfState = new ArrayList( + determineAffectedPortions(watch.getAreas())); + watch.setPartOfState(partOfState); + watches.add(watch); + } + + // Sorts the watches based on state name. + Collections.sort(watches, new Comparator() { + + @Override + public int compare(Watch watch1, Watch watch2) { + return watch1.getState().compareTo(watch2.getState()); + } + }); + + return watches; + } + + /** + * Determines the directional set of a state. + * + * @param ugcs + * @return + */ + private Set determineAffectedPortions(List ugcs) { + Set feAreas = new HashSet(); + for (String ugc : ugcs) { + // Want the first 2 letters + String stateAbbrev = ugc.substring(0, 2); + // Want the last 3 digits + String fips = ugc.substring(ugc.length() - 3); + String feArea = getFeArea(stateAbbrev, fips); + // Checks to see if feArea in CWA + if (feArea != null) { + feAreas.add(feArea); + } + } + + Set affectedPortions = new HashSet( + Area.converFeAreaToPartList(mungeFeAreas(feAreas))); + return affectedPortions; + } + + /** + * Returns the full state name from the state abbreviation. + * + * @param stateAbrev + * @return + */ + private String getStateName(String stateAbrev) { + for (GeospatialData g : countyGeoData) { + if (stateAbrev.equals(g.attributes.get(STATE_FIELD))) { + return (String) g.parent.attributes.get(PARENT_NAME_FIELD); + } + } + return null; + } + + /** + * Returns the feArea field in the county table (i.e. n, s, e, w). + * + * @param stateAbbrev + * @param ugc + * @return + */ + private String getFeArea(String stateAbbrev, String ugc) { + for (GeospatialData g : countyGeoData) { + if (stateAbbrev.equals(g.attributes.get(STATE_FIELD)) + && ((String) g.attributes.get(COUNTY_FIPS_FIELD)) + .endsWith(ugc)) { + return (String) g.attributes.get(COUNTY_FE_AREA_FIELD); + } + } + + return null; + } + + // Based on AWIPS 1 SELSparagraphs.C SELSparagraphs::processWOU(). + private String mungeFeAreas(Set feAreas) { + String abrev = ""; + // If eight or more portions, don't qualify area of state + int m = feAreas.size(); + if (m < 8) { + String partAbrev = ""; + /* + * TODO: Unused variables should be removed if we are not going to + * improve this in A2. + */ + @SuppressWarnings("unused") + int nw, nc, ne, wc, cc, ec, sw, sc, se, pa; + int eee, www, nnn, sss, ee, ww, nn, ss; + + // Identify individual sub areas of this state affected + nw = nc = ne = wc = cc = ec = sw = sc = se = pa = 0; + eee = www = nnn = sss = ee = ww = nn = ss = 0; + for (String part : feAreas) { + if ("pa".equals(part)) { + pa = 1; + continue; + } else if ("nn".equals(part)) { + nnn = nn = 1; + } else if ("ss".equals(part)) { + sss = ss = 1; + } else if ("ee".equals(part)) { + eee = ee = 1; + } else if ("ww".equals(part)) { + www = ww = 1; + } else if ("nw".equals(part)) { + nnn = www = nw = 1; + } else if ("nc".equals(part)) { + nnn = nc = 1; + } else if ("ne".equals(part)) { + nnn = eee = ne = 1; + } else if ("wc".equals(part)) { + www = wc = 1; + } else if ("cc".equals(part)) { + cc = 1; + continue; + } else if ("ec".equals(part)) { + eee = ec = 1; + } else if ("sw".equals(part)) { + sss = www = sw = 1; + } else if ("sc".equals(part)) { + sss = sc = 1; + } else if ("se".equals(part)) { + sss = eee = se = 1; + } + partAbrev = part; + } + // decide how to describe these subareas. + if ((ne > 0) && (nw > 0)) { + nn = 1; + } + if ((se > 0) && (sw > 0)) { + ss = 1; + } + if ((se > 0) && (ne > 0)) { + ee = 1; + } + if ((sw > 0) && (nw > 0)) { + ww = 1; + } + if ((nnn > 0) && (sss > 0) && (eee > 0) && (www > 0)) { + return abrev; + } + if (((nn > 0) && (ss > 0)) || ((ee > 0) && (ww > 0))) { + return abrev; + } + if (nnn + sss + eee + www == 3) { + if (www == 0) { + abrev = "e"; + } else if (eee == 0) { + abrev = "w"; + } else if (nnn == 0) { + abrev = "s"; + } else if (sss == 0) { + abrev = "n"; + } + return abrev; + } + if (((nnn == sss) && (eee == www)) || (cc == m)) { + abrev = "c"; + return abrev; + } + if ((pa != 0) && (cc == 0)) { + abrev = "pa"; + if (--m <= 0) { + return abrev; + } + } + if (m == 1 + cc) { + abrev += partAbrev + " "; + return abrev; + } + if (nnn != sss) { + abrev += nnn != 0 ? "n" : "s"; + } + if (eee != www) { + abrev += eee != 0 ? "e" : "w"; + } + } + return abrev; + } + +} 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 62272c75bb..37aaea6155 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 @@ -155,6 +155,7 @@ import com.vividsolutions.jts.geom.Polygon; * Oct 29, 2013 DR 16734 D. Friedman If redraw-from-hatched-area fails, don't allow the polygon the be used. * Apr 28, 2014 3033 jsanchez Re-initialized the Velocity Engine when switching back up sites. * Jul 01, 2014 DR 17450 D. Friedman Use list of templates from backup site. + * Jul 21, 2014 3419 jsanchez Created a hidden button to make recreating polygons easier. * * * @author chammack @@ -165,6 +166,12 @@ public class WarngenDialog extends CaveSWTDialog implements private static final transient IUFStatusHandler statusHandler = UFStatus .getHandler(WarngenDialog.class); + /* + * This flag allows a hidden button to appear to help recreating warning + * polygons that had issues in the feed. + */ + private boolean debug = false; + private static final int BULLET_WIDTH = 390; private static final int BULLET_HEIGHT = 230; @@ -557,7 +564,8 @@ public class WarngenDialog extends CaveSWTDialog implements GridData gd = new GridData(SWT.RIGHT, SWT.DEFAULT, true, false); if (updateListCbo == null) { gd.horizontalIndent = 30; - updateListCbo = new Combo(productType, SWT.READ_ONLY | SWT.DROP_DOWN); + updateListCbo = new Combo(productType, SWT.READ_ONLY + | SWT.DROP_DOWN); updateListCbo.setLayoutData(gd); recreateUpdates(); @@ -629,7 +637,8 @@ public class WarngenDialog extends CaveSWTDialog implements }); Composite redrawFrom = new Composite(redrawBox, SWT.NONE); - redrawFrom.setLayout(new GridLayout(3, false)); + int columns = debug ? 4 : 3; + redrawFrom.setLayout(new GridLayout(columns, false)); redrawFrom.setLayoutData(new GridData(SWT.DEFAULT, SWT.FILL, false, true)); @@ -664,9 +673,30 @@ public class WarngenDialog extends CaveSWTDialog implements damBreakThreatArea.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { - damBreakThreatAreaPressed(); + DamInfoBullet damBullet = bulletListManager + .getSelectedDamInfoBullet(); + if (damBullet != null) { + damBreakThreatAreaPressed(damBullet.getCoords(), true); + } } }); + + if (debug) { + Button drawPolygonButton = new Button(redrawFrom, SWT.PUSH); + drawPolygonButton.setText("?"); + drawPolygonButton.setEnabled(true); + drawPolygonButton.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + /* + * Copy/paste the LAT...LON line from the text product to + * quickly recreate the polygon. + */ + String latLon = "LAT...LON 4282 7174 4256 7129 4248 7159 4280 7198"; + damBreakThreatAreaPressed(latLon, false); + } + }); + } } private void createBackupTrackEditGroups(Composite mainComposite) { @@ -1208,7 +1238,11 @@ public class WarngenDialog extends CaveSWTDialog implements setInstructions(); } else if (bulletListManager.isDamNameSeletcted() && bulletListManager.isDamCauseSelected()) { - damBreakThreatAreaPressed(); + DamInfoBullet damBullet = bulletListManager + .getSelectedDamInfoBullet(); + if (damBullet != null) { + damBreakThreatAreaPressed(damBullet.getCoords(), true); + } if (damBreakInstruct != null) { return false; } @@ -1345,7 +1379,7 @@ public class WarngenDialog extends CaveSWTDialog implements createMainProductButtons(productType); createOtherProductsList(productType); - // Don't let errors prevent the new controls from being displayed! + // Don't let errors prevent the new controls from being displayed! try { changeTemplate(getDefaultTemplate()); resetPressed(); @@ -1440,55 +1474,50 @@ public class WarngenDialog extends CaveSWTDialog implements } /** - * This method is responsible for drawing a pre-defined drainage basin on - * the WarnGen layer. The method is called when a drainage basin is selected - * in the WarnGen Dialog Bullet List and the Dam Break Threat Area button is - * pressed. Dam info geometries are defined in the Database so a Spatial - * Query is performed to retrieve the data. + * Responsible for drawing a pre-defined warning polygon (coords) on the + * WarnGen layer. * + * @param coords + * pre-defined warning polygon coordinates in LAT...LON form. + * @param lockPolygon + * indicates if the polygon should be locked or not. */ - private void damBreakThreatAreaPressed() { + private void damBreakThreatAreaPressed(String coords, boolean lockPolygon) { damBreakInstruct = "Either no dam selected, no dam info bullets in .xml file, or no\n" + "dam break primary cause selected."; - DamInfoBullet damBullet = bulletListManager.getSelectedDamInfoBullet(); - if (damBullet != null) { - if ((damBullet.getCoords() == null) - || (damBullet.getCoords().length() == 0)) { - damBreakInstruct = "LAT...LON can not be found in 'coords' parameter"; - } else { - ArrayList coordinates = new ArrayList(); - Pattern coordinatePtrn = Pattern - .compile("LAT...LON+(\\s\\d{3,4}\\s\\d{3,5}){1,}"); - Pattern latLonPtrn = Pattern - .compile("\\s(\\d{3,4})\\s(\\d{3,5})"); + if ((coords == null) || (coords.length() == 0)) { + damBreakInstruct = "LAT...LON can not be found in 'coords' parameter"; + } else { + ArrayList coordinates = new ArrayList(); + Pattern coordinatePtrn = Pattern + .compile("LAT...LON+(\\s\\d{3,4}\\s\\d{3,5}){1,}"); + Pattern latLonPtrn = Pattern.compile("\\s(\\d{3,4})\\s(\\d{3,5})"); - Matcher m = coordinatePtrn.matcher(damBullet.getCoords()); - if (m.find()) { - m = latLonPtrn.matcher(damBullet.getCoords()); - while (m.find()) { - coordinates.add(new Coordinate((-1 * Double - .parseDouble(m.group(2))) / 100, Double - .parseDouble(m.group(1)) / 100)); - } - - if (coordinates.size() < 3) { - damBreakInstruct = "Lat/Lon pair for dam break threat area is less than three"; - } else { - coordinates.add(coordinates.get(0)); - PolygonUtil.truncate(coordinates, 2); - warngenLayer.createDamThreatArea(coordinates - .toArray(new Coordinate[coordinates.size()])); - setPolygonLocked(true); - warngenLayer.issueRefresh(); - damBreakInstruct = null; - } - } else { - damBreakInstruct = "The 'coords' parameter maybe be misformatted or the\n" - + "La/Lon for dam break threat area is not in pairs."; + Matcher m = coordinatePtrn.matcher(coords); + if (m.find()) { + m = latLonPtrn.matcher(coords); + while (m.find()) { + coordinates.add(new Coordinate((-1 * Double.parseDouble(m + .group(2))) / 100, + Double.parseDouble(m.group(1)) / 100)); } - } + if (coordinates.size() < 3) { + damBreakInstruct = "Lat/Lon pair for dam break threat area is less than three"; + } else { + coordinates.add(coordinates.get(0)); + PolygonUtil.truncate(coordinates, 2); + warngenLayer.createDamThreatArea(coordinates + .toArray(new Coordinate[coordinates.size()])); + setPolygonLocked(lockPolygon); + warngenLayer.issueRefresh(); + damBreakInstruct = null; + } + } else { + damBreakInstruct = "The 'coords' parameter maybe be misformatted or the\n" + + "La/Lon for dam break threat area is not in pairs."; + } } if (damBreakInstruct != null) { setInstructions(); @@ -1517,11 +1546,11 @@ public class WarngenDialog extends CaveSWTDialog implements return result; } - /** Called by controls that can change the current template. Do not - * do anything if the request template is already selected. This - * check is necessary to prevent certain state being reset if - * a followup has been selected as this is not handled by - * changeTemplate() (DR 14515.) + /** + * Called by controls that can change the current template. Do not do + * anything if the request template is already selected. This check is + * necessary to prevent certain state being reset if a followup has been + * selected as this is not handled by changeTemplate() (DR 14515.) */ private void uiChangeTemplate(String templateName) { if (templateName.equals(warngenLayer.getTemplateName())) { diff --git a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/template/TemplateRunner.java b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/template/TemplateRunner.java index 1ab7ab65d1..1d2c74bd82 100644 --- a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/template/TemplateRunner.java +++ b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/template/TemplateRunner.java @@ -37,40 +37,23 @@ import java.util.Hashtable; import java.util.Iterator; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Properties; import java.util.Set; import java.util.TimeZone; -import java.util.TreeMap; import java.util.regex.Matcher; import java.util.regex.Pattern; -import javax.measure.converter.UnitConverter; -import javax.measure.unit.NonSI; -import javax.measure.unit.SI; - -import org.apache.commons.lang.Validate; import org.apache.velocity.Template; import org.apache.velocity.VelocityContext; import org.apache.velocity.app.Velocity; import org.apache.velocity.app.VelocityEngine; import org.apache.velocity.tools.generic.ListTool; -import com.raytheon.uf.common.activetable.ActiveTableRecord; -import com.raytheon.uf.common.activetable.OperationalActiveTableRecord; -import com.raytheon.uf.common.activetable.PracticeActiveTableRecord; import com.raytheon.uf.common.dataplugin.warning.AbstractWarningRecord; import com.raytheon.uf.common.dataplugin.warning.WarningConstants; import com.raytheon.uf.common.dataplugin.warning.WarningRecord.WarningAction; -import com.raytheon.uf.common.dataplugin.warning.config.AreaSourceConfiguration; -import com.raytheon.uf.common.dataplugin.warning.config.AreaSourceConfiguration.AreaType; import com.raytheon.uf.common.dataplugin.warning.config.WarngenConfiguration; -import com.raytheon.uf.common.dataplugin.warning.gis.GeospatialData; import com.raytheon.uf.common.dataplugin.warning.util.GeometryUtil; -import com.raytheon.uf.common.dataquery.requests.DbQueryRequest; -import com.raytheon.uf.common.dataquery.requests.RequestConstraint; -import com.raytheon.uf.common.dataquery.requests.RequestConstraint.ConstraintType; -import com.raytheon.uf.common.dataquery.responses.DbQueryResponse; import com.raytheon.uf.common.localization.IPathManager; import com.raytheon.uf.common.localization.LocalizationContext; import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel; @@ -82,11 +65,9 @@ import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.common.time.DataTime; import com.raytheon.uf.common.time.SimulatedTime; -import com.raytheon.uf.common.time.util.TimeUtil; import com.raytheon.uf.common.util.FileUtil; import com.raytheon.uf.viz.core.exception.VizException; import com.raytheon.uf.viz.core.localization.LocalizationManager; -import com.raytheon.uf.viz.core.requests.ThriftClient; import com.raytheon.viz.awipstools.ToolsDataManager; import com.raytheon.viz.awipstools.common.StormTrackData; import com.raytheon.viz.awipstools.common.stormtrack.StormTrackState; @@ -99,6 +80,8 @@ import com.raytheon.viz.warngen.gis.ClosestPointComparator; import com.raytheon.viz.warngen.gis.GisUtil; import com.raytheon.viz.warngen.gis.PathCast; import com.raytheon.viz.warngen.gis.PortionsUtil; +import com.raytheon.viz.warngen.gis.Watch; +import com.raytheon.viz.warngen.gis.WatchUtil; import com.raytheon.viz.warngen.gis.Wx; import com.raytheon.viz.warngen.gui.BackupData; import com.raytheon.viz.warngen.gui.FollowupData; @@ -111,9 +94,6 @@ import com.raytheon.viz.warngen.util.CurrentWarnings; import com.raytheon.viz.warngen.util.FipsUtil; import com.raytheon.viz.warngen.util.FollowUpUtil; import com.raytheon.viz.warngen.util.WarnGenMathTool; -import com.raytheon.viz.warngen.util.WatchUtil; -import com.raytheon.viz.warngen.util.WeatherAdvisoryWatch; -import com.raytheon.viz.warngen.util.WeatherAdvisoryWatch.Portion; import com.raytheon.viz.warnings.DateUtil; import com.vividsolutions.jts.geom.Coordinate; import com.vividsolutions.jts.geom.Geometry; @@ -159,6 +139,7 @@ import com.vividsolutions.jts.io.WKTReader; * Apr 28, 2014 3033 jsanchez Set the site and backup site in Velocity Engine's properties * Mar 17, 2014 DR 16309 Qinglu Lin Updated getWatches(), processATEntries() and determineAffectedPortions(), and * added determineAffectedMarinePortions(). + * Jul 21, 2014 3419 jsanchez Refactored WatchUtil. * * * @author njensen @@ -171,16 +152,13 @@ public class TemplateRunner { private static final String LOGIN_NAME_KEY = "LOGNAME"; - private static final UnitConverter milesToKilometer = NonSI.MILE - .getConverterTo(SI.KILOMETER); - - private static final double KmToDegrees = 111.12; - private static final Pattern BBB_PATTERN = Pattern .compile(".*\\sCC([A-Z])"); private static Hashtable dateFormat; + private static WatchUtil watchUtil; + static { dateFormat = new Hashtable(); dateFormat @@ -873,11 +851,14 @@ public class TemplateRunner { // Store Watches try { t0 = System.currentTimeMillis(); - WatchUtil watches = getWatches(warngenLayer, config, warnPolygon, - areas, fourLetterSiteId, simulatedTime); + if (watchUtil == null) { + watchUtil = new WatchUtil(warngenLayer); + } + List watches = watchUtil.getWatches(config, warnPolygon, + simulatedTime); System.out.println("getWatches time: " + (System.currentTimeMillis() - t0)); - if (watches != null) { + if (watches != null && watches.isEmpty() == false) { context.put("watches", watches); } } catch (Exception e) { @@ -977,574 +958,4 @@ public class TemplateRunner { return rval; } - /** - * This method populates a WatchUtil object with tornado and severe - * thunderstorm watches from the active table that are contained by the - * polygon. Furthermore, watches that have not yet expired (current time < - * end time) are only included. - * - * @param config - * WarnGen template configuration settings - * ([template_name_site.xml]) - * @param polygon - * The Geometry surrounded by the warning polygon. - * @param simulatedTime - * @return - * @throws Exception - */ - private static WatchUtil getWatches(WarngenLayer warngenLayer, - WarngenConfiguration config, Geometry polygon, - AffectedAreas[] affectedAreas, String fourLetterSiteId, - Date simulatedTime) throws Exception { - Validate.isTrue(config.getHatchedAreaSource() - .getIncludedWatchAreaBuffer() >= 0, - "IncludedWatchAreaBuffer can not be negative"); - - WatchUtil rval = null; - String[] includedWatches = config.getIncludedWatches(); - - if ((includedWatches != null) && (includedWatches.length > 0)) { - String phensigList = null; - for (String includedWatch : includedWatches) { - if (includedWatch.equalsIgnoreCase("torWatches")) { - phensigList = phensigList == null ? "TO.A" : phensigList - + ",TO.A"; - } else if (includedWatch.equalsIgnoreCase("svrWatches")) { - phensigList = phensigList == null ? "SV.A" : phensigList - + ",SV.A"; - } - } - - if (phensigList != null) { - // Create start/endtime constraints - Date endConstraintTime = simulatedTime; - Calendar cal = Calendar.getInstance(); - cal.setTime(simulatedTime); - cal.add(Calendar.MINUTE, 3); - Date startConstraintTime = cal.getTime(); - - // Get record type - Class recordType = CAVEMode - .getMode() == CAVEMode.OPERATIONAL ? OperationalActiveTableRecord.class - : PracticeActiveTableRecord.class; - - DbQueryRequest request = new DbQueryRequest(); - request.setEntityClass(recordType); - request.addConstraint("startTime", new RequestConstraint( - TimeUtil.formatDate(startConstraintTime), - ConstraintType.LESS_THAN_EQUALS)); - request.addConstraint( - "endTime", - new RequestConstraint(TimeUtil - .formatDate(endConstraintTime), - ConstraintType.GREATER_THAN_EQUALS)); - /* - * TODO: Currently limited to filtering out one of - * ("CAN","EXP"). Could use "Act" in addition to "act", but this - * should really be fixed the underlying system. - * request.addConstraint("act", new RequestConstraint("CAN", - * ConstraintType.NOT_EQUALS)); - */ - request.addConstraint("act", new RequestConstraint("EXP", - ConstraintType.NOT_EQUALS)); - request.addConstraint("phensig", new RequestConstraint( - phensigList, ConstraintType.IN)); - - // TODO: Talk to Jonathan about this... Do I even need officeid - // IN or is ugc zone good enough? - - /* - * Get all UGCs in the CWA now so that the watches will be - * formatted with all portions of the affected state(s). - * - * Filtering for valid UGCs is performed in processATEntries - */ - RequestConstraint ugcConstraint = new RequestConstraint("", - ConstraintType.IN); - ugcConstraint.setConstraintValueList(warngenLayer - .getAllUgcs()); - request.addConstraint("ugcZone", ugcConstraint); - - // These are the only fields we need for processing watches - request.addFields(new String[] { "issueTime", "startTime", - "endTime", "ugcZone", "phensig", "vtecstr", "etn", - "act" }); - - DbQueryResponse response = (DbQueryResponse) ThriftClient - .sendRequest(request); - - List records = new ArrayList( - response.getNumResults()); - for (Map result : response.getResults()) { - /* - * TODO: Doing this here because only "EXP" is filtered out - * by the query. Remove "act" from the field list once this - * is fixed. - */ - if ("CAN".equals(result.get("act"))) - continue; - ActiveTableRecord record = recordType.newInstance(); - record.setIssueTime((Calendar) result.get("issueTime")); - record.setStartTime((Calendar) result.get("startTime")); - record.setEndTime((Calendar) result.get("endTime")); - record.setUgcZone((String) result.get("ugcZone")); - record.setPhensig((String) result.get("phensig")); - record.setVtecstr((String) result.get("vtecstr")); - record.setEtn((String) result.get("etn")); - records.add(record); - } - - if (records.size() > 0) { - Set validUgcZones; - try { - long t0, t1; - t0 = System.currentTimeMillis(); - Polygon watchArea = (Polygon) polygon - .buffer(milesToKilometer.convert(config - .getHatchedAreaSource() - .getIncludedWatchAreaBuffer()) - / KmToDegrees); - t1 = System.currentTimeMillis(); - System.out.println("getWatches.polygonBuffer time: " - + (t1 - t0)); - validUgcZones = warngenLayer - .getUgcsForWatches(watchArea); - } catch (RuntimeException e) { - statusHandler - .handle(Priority.ERROR, - "Error determining areas to search for watches.", - e); - return rval; - } - - rval = processATEntries(records, warngenLayer, - validUgcZones); - } - } - } - - return rval; - } - - private static class WatchWork { - public WeatherAdvisoryWatch waw; - - public boolean valid; - - public ArrayList ugcZone = new ArrayList(); - - public WatchWork(WeatherAdvisoryWatch waw) { - this.waw = waw; - } - } - - /** - * Create the list of objects representing active watches that will be - * passed to the template context. - * - * @param activeTable - * List of entries for active watches - * @param warngenLayer - * @param validUgcZones - * @return - */ - private static WatchUtil processATEntries( - List activeTable, WarngenLayer warngenLayer, - Set validUgcZones) { - WatchUtil rval = new WatchUtil(); - TreeMap map = new TreeMap(); - - AreaSourceConfiguration asc = null; - for (AreaSourceConfiguration a : warngenLayer.getConfiguration() - .getAreaSources()) { - if (a.getType() == AreaType.HATCHING) { - asc = a; - break; - } - } - if (asc == null) { - statusHandler - .handle(Priority.ERROR, - "Cannot process watches: missing HATCHING area source configuration"); - return rval; - } - GeospatialData[] geoData = warngenLayer.getGeodataFeatures( - asc.getAreaSource(), warngenLayer.getLocalizedSite()); - if ((geoData == null) || (geoData.length == 0)) { - statusHandler.handle(Priority.ERROR, - "Cannot process watches: cannot get geospatial data"); - return rval; - } - - // For each watch event, get the end time and list of active zones - for (ActiveTableRecord ar : activeTable) { - /* - * Currently reports all zones in the watch even if a given zone is - * not in the warning polygon. If the logic is changed to only show - * the portions of the watch near our warning polygon, filter on - * validUgcZones here. - */ - WeatherAdvisoryWatch waw = new WeatherAdvisoryWatch(); - waw.setPhensig(ar.getPhensig()); - try { - waw.setEventId(Integer.parseInt(ar.getEtn())); - } catch (RuntimeException e) { - statusHandler.handle(Priority.ERROR, String.format( - "Watch %s has null end time; not included.", - ar.getVtecstr())); - continue; - } - - WatchWork work = map.get(waw); - if (work == null) { - waw.setEndTime(ar.getEndTime().getTime()); - work = new WatchWork(waw); - map.put(waw, work); - } - - if (validUgcZones.contains(ar.getUgcZone())) { - work.valid = true; - } - - /* - * There are no checks here to determine whether or not the given - * zone is in the CWA. That should have already been done the query - * performed in getWatches. - * - * There is also validation performed later in - * determineAffectedPortions. - */ - work.ugcZone.add(ar.getUgcZone()); - } - - for (WatchWork work : map.values()) { - /* - * If none of the areas in the watch were neer our warning polygon, - * do not included it. - */ - if (!work.valid) { - continue; - } - boolean isMarineZone = warngenLayer.getConfiguration().getGeospatialConfig() - .getAreaSource().equalsIgnoreCase(WarngenLayer.MARINE); - if (!isMarineZone) { - if (determineAffectedPortions(work.ugcZone, asc, geoData, work.waw)) { - rval.addWaw(work.waw); - } - } else { - if (determineAffectedMarinePortions(work.ugcZone, asc, geoData, work.waw)) { - rval.addWaw(work.waw); - } - } - } - - return rval; - } - - /** - * Given the list of counties in a watch, fill out the "portions" part of - * the given WeatherAdvisoryWatch. Also checks if the given counties are - * actually in the CWA. - * - * @param ugcs - * @param asc - * @param geoData - * @param waw - */ - private static boolean determineAffectedPortions(List ugcs, - AreaSourceConfiguration asc, GeospatialData[] geoData, - WeatherAdvisoryWatch waw) { - - // Maps state abbreviation to unique fe_area values - HashMap> map = new HashMap>(); - - for (String ugc : ugcs) { - Map parsed = FipsUtil.parseHeader(ugc, "County"); - Entry e = null; - - // Either zero or more than one sates/counties would be wrong - if ((parsed.size() != 1) - || ((e = parsed.entrySet().iterator().next()).getValue().length != 1)) { - statusHandler.handle(Priority.ERROR, - "Invalid ugczone in active table entry: " + ugc); - continue; - } - - String stateAbbrev = e.getKey(); - String feArea = null; - try { - feArea = getFeArea(stateAbbrev, e.getValue()[0], asc, geoData); - } catch (RuntimeException exc) { - statusHandler.handle(Priority.ERROR, - "Error generating included watches.", exc); - return false; - } - if (feArea == NOT_IN_CWA) { - continue; - } - - Set feAreas = map.get(stateAbbrev); - if (feAreas == null) { - feAreas = new HashSet(); - map.put(stateAbbrev, feAreas); - } - if (feArea != null) { - feAreas.add(feArea); - } - } - - ArrayList portions = new ArrayList(map.size()); - for (Entry> e : map.entrySet()) { - Portion portion = new Portion(); - try { - portion.parentRegion = getStateName(e.getKey(), asc, geoData) - .toUpperCase(); - } catch (RuntimeException exc) { - statusHandler.handle(Priority.ERROR, - "Error generating included watches.", exc); - return false; - } - portion.partOfParentRegion = Area - .converFeAreaToPartList(mungeFeAreas(e.getValue())); - portions.add(portion); - } - waw.setPortions(portions); - // Set legacy values - if (portions.size() > 0) { - waw.setParentRegion(portions.get(0).parentRegion); - waw.setPartOfParentRegion(portions.get(0).partOfParentRegion); - } - - return true; - } - - /** - * Given the list of marine zones in a watch, fill out the "portions" part of - * the given WeatherAdvisoryWatch. Also checks if the given marine zones are - * actually in the CWA. - * - * @param ugcs - * @param asc - * @param geoData - * @param waw - */ - @SuppressWarnings("deprecation") - private static boolean determineAffectedMarinePortions(List ugcs, - AreaSourceConfiguration asc, GeospatialData[] geoData, - WeatherAdvisoryWatch waw) { - - // Maps state abbreviation to unique fe_area values - HashMap> map = new HashMap>(); - Set marinezonenameSet = new HashSet(); - for (String ugc : ugcs) { - for (GeospatialData gd: geoData) { - - if (gd.attributes.get("ID").equals(ugc)) { - marinezonenameSet.add((String)gd.attributes.get("NAME")); - } - } - } - String marinezonename = ""; - int size = marinezonenameSet.size(); - Iterator iter = marinezonenameSet.iterator(); - int count = 0; - while (iter.hasNext()) { - String s = iter.next(); - marinezonename += s; - count += 1; - if (size > 1) { - if (size == 2 && count < 2) { - marinezonename += " and "; - } else { - if (count == size - 1) { - marinezonename += ", and "; - } else { - if (count < size - 1) { - marinezonename += ", "; - } - } - } - } - } - - for (String ugc : ugcs) { - Map parsed = FipsUtil.parseHeader(ugc, "Marine"); - Entry e = null; - - // Either zero or more than one marine zone would be wrong - if ((parsed.size() != 1) - || ((e = parsed.entrySet().iterator().next()).getValue().length != 1)) { - statusHandler.handle(Priority.ERROR, - "Invalid ugczone in active table entry: " + ugc); - continue; - } - - String stateAbbrev = e.getKey(); - Set feAreas = map.get(stateAbbrev); - if (feAreas == null) { - feAreas = new HashSet(); - map.put(stateAbbrev, feAreas); - } - } - - ArrayList portions = new ArrayList(map.size()); - Portion portion = new Portion(); - portion.parentRegion = marinezonename; - portion.partOfParentRegion = new ArrayList(); - portion.partOfParentRegion.add(""); - portions.add(portion); - waw.setPortions(portions); - // Set legacy values - if (portions.size() > 0) { - waw.setParentRegion(portions.get(0).parentRegion); - waw.setPartOfParentRegion(portions.get(0).partOfParentRegion); - } - - return true; - } - - // Based on AWIPS 1 SELSparagraphs.C SELSparagraphs::processWOU(). - private static String mungeFeAreas(Set feAreas) { - String abrev = ""; - // If eight or more portions, don't qualify area of state - int m = feAreas.size(); - if (m < 8) { - String partAbrev = ""; - /* - * TODO: Unused variables should be removed if we are not going to - * improve this in A2. - */ - @SuppressWarnings("unused") - int nw, nc, ne, wc, cc, ec, sw, sc, se, pa; - int eee, www, nnn, sss, ee, ww, nn, ss; - - // Identify individual sub areas of this state affected - nw = nc = ne = wc = cc = ec = sw = sc = se = pa = 0; - eee = www = nnn = sss = ee = ww = nn = ss = 0; - for (String part : feAreas) { - if ("pa".equals(part)) { - pa = 1; - continue; - } else if ("nn".equals(part)) { - nnn = nn = 1; - } else if ("ss".equals(part)) { - sss = ss = 1; - } else if ("ee".equals(part)) { - eee = ee = 1; - } else if ("ww".equals(part)) { - www = ww = 1; - } else if ("nw".equals(part)) { - nnn = www = nw = 1; - } else if ("nc".equals(part)) { - nnn = nc = 1; - } else if ("ne".equals(part)) { - nnn = eee = ne = 1; - } else if ("wc".equals(part)) { - www = wc = 1; - } else if ("cc".equals(part)) { - cc = 1; - continue; - } else if ("ec".equals(part)) { - eee = ec = 1; - } else if ("sw".equals(part)) { - sss = www = sw = 1; - } else if ("sc".equals(part)) { - sss = sc = 1; - } else if ("se".equals(part)) { - sss = eee = se = 1; - } - partAbrev = part; - } - // decide how to describe these subareas. - if ((ne > 0) && (nw > 0)) { - nn = 1; - } - if ((se > 0) && (sw > 0)) { - ss = 1; - } - if ((se > 0) && (ne > 0)) { - ee = 1; - } - if ((sw > 0) && (nw > 0)) { - ww = 1; - } - if ((nnn > 0) && (sss > 0) && (eee > 0) && (www > 0)) { - return abrev; - } - if (((nn > 0) && (ss > 0)) || ((ee > 0) && (ww > 0))) { - return abrev; - } - if (nnn + sss + eee + www == 3) { - if (www == 0) { - abrev = "e"; - } else if (eee == 0) { - abrev = "w"; - } else if (nnn == 0) { - abrev = "s"; - } else if (sss == 0) { - abrev = "n"; - } - return abrev; - } - if (((nnn == sss) && (eee == www)) || (cc == m)) { - abrev = "c"; - return abrev; - } - if ((pa != 0) && (cc == 0)) { - abrev = "pa"; - if (--m <= 0) { - return abrev; - } - } - if (m == 1 + cc) { - abrev += partAbrev + " "; - return abrev; - } - if (nnn != sss) { - abrev += nnn != 0 ? "n" : "s"; - } - if (eee != www) { - abrev += eee != 0 ? "e" : "w"; - } - } - return abrev; - } - - private static String getStateName(String key, AreaSourceConfiguration asc, - GeospatialData[] geoData) { - for (GeospatialData g : geoData) { - if (key.equals(g.attributes.get("STATE"))) { - return (String) g.parent.attributes.get("NAME"); - } - } - return null; - } - - private static String NOT_IN_CWA = new String("NOT_IN_CWA"); - - /** - * Determines if the given UGC is in the CWA and if it is, returns the - * portion of the CWA. - * - * @param stateAbbrev - * @param ugc - * @param asc - * @param geoData - * @return - */ - private static String getFeArea(String stateAbbrev, String ugc, - AreaSourceConfiguration asc, GeospatialData[] geoData) { - for (GeospatialData g : geoData) { - if (stateAbbrev.equals(g.attributes.get("STATE")) - && ((String) g.attributes.get(asc.getFipsField())) - .endsWith(ugc)) { - return (String) g.attributes.get(asc.getFeAreaField()); - } - } - - // TODO: Is this the correct way to determine if the county is in the - // CWA? - return NOT_IN_CWA; - } - } diff --git a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/util/WatchUtil.java b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/util/WatchUtil.java deleted file mode 100644 index b6791a78c1..0000000000 --- a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/util/WatchUtil.java +++ /dev/null @@ -1,100 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ -package com.raytheon.viz.warngen.util; - -import java.util.ArrayList; -import java.util.Date; -import java.util.Set; -import java.util.TreeSet; - -/** - * This utility will provide an object to be sent into velocity templates which - * will allow the template to output current Warnings. - * - *
- * 
- * SOFTWARE HISTORY
- * Date         Ticket#    Engineer    Description
- * ------------ ---------- ----------- --------------------------
- * Jul 1, 2009            bwoodle     Initial creation
- * 
- * 
- * - * @author bwoodle - * @version 1.0 - */ - -public class WatchUtil { - - private Date latestTorTime; - - private Date latestSvrTime; - - private ArrayList torWatches; - - private ArrayList svrWatches; - - public WatchUtil() { - torWatches = new ArrayList(); - svrWatches = new ArrayList(); - } - - public void addWaw(WeatherAdvisoryWatch watch) { - if (watch.getPhensig().equalsIgnoreCase("SV.A")) { - svrWatches.add(watch); - if (latestSvrTime == null - || watch.getEndTime().after(latestSvrTime)) { - latestSvrTime = watch.getEndTime(); - } - } else if (watch.getPhensig().equalsIgnoreCase("TO.A")) { - torWatches.add(watch); - if (latestTorTime == null - || watch.getEndTime().after(latestTorTime)) { - latestTorTime = watch.getEndTime(); - } - } - } - - public ArrayList getTorWatches() { - Set rval = new TreeSet(); - for (WeatherAdvisoryWatch w : torWatches) { - w.setEndTime(latestTorTime); - rval.add(w); - } - return new ArrayList(rval); - } - - public ArrayList getSvrWatches() { - Set rval = new TreeSet(); - for (WeatherAdvisoryWatch w : svrWatches) { - w.setEndTime(latestSvrTime); - rval.add(w); - } - return new ArrayList(rval); - } - - public Date getLatestTorTime() { - return latestTorTime; - } - - public Date getLatestSvrTime() { - return latestSvrTime; - } -} diff --git a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/util/WeatherAdvisoryWatch.java b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/util/WeatherAdvisoryWatch.java deleted file mode 100644 index 06afc5544b..0000000000 --- a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/util/WeatherAdvisoryWatch.java +++ /dev/null @@ -1,155 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ -package com.raytheon.viz.warngen.util; - -import java.util.Date; -import java.util.List; - -/** - * TODO Add Description - * - *
- * 
- * SOFTWARE HISTORY
- * Date         Ticket#    Engineer    Description
- * ------------ ---------- ----------- --------------------------
- * Jul 1, 2009            bwoodle     Initial creation
- * Nov 9, 2012  DR 15430   D. Friedman Support proper watch inclusion language
- * 
- * 
- * - * @author bwoodle - * @version 1.0 - */ - -public class WeatherAdvisoryWatch implements Comparable { - - public static class Portion { - public String parentRegion; - - public List partOfParentRegion; - - public String getParentRegion() { - return parentRegion; - } - - public void setParentRegion(String parentRegion) { - this.parentRegion = parentRegion; - } - - public List getPartOfParentRegion() { - return partOfParentRegion; - } - - public void setPartOfParentRegion(List partOfParentRegion) { - this.partOfParentRegion = partOfParentRegion; - } - } - - /* TODO: NOTE: There is no site field. We currently only process - * WCNs for the site and not WOUs from the SPC. - */ - - private String phensig; - - private int eventId; - - private Date endTime; - - private List portions; - - @Deprecated - private String parentRegion; - - @Deprecated - private List partOfParentRegion; - - public String getPhensig() { - return phensig; - } - - public void setPhensig(String phensig) { - this.phensig = phensig; - } - - public Date getEndTime() { - return endTime; - } - - public void setEndTime(Date endTime) { - this.endTime = endTime; - } - - @Deprecated - public String getParentRegion() { - return parentRegion; - } - - @Deprecated - public void setParentRegion(String parentRegion) { - this.parentRegion = parentRegion; - } - - @Deprecated - public List getPartOfParentRegion() { - return partOfParentRegion; - } - - @Deprecated - public void setPartOfParentRegion(List partOfParentRegion) { - this.partOfParentRegion = partOfParentRegion; - } - - @Override - public boolean equals(Object obj) { - return obj instanceof WeatherAdvisoryWatch && - this.compareTo((WeatherAdvisoryWatch) obj) == 0; - } - - public int compareTo(WeatherAdvisoryWatch waw) { - if (this.phensig == null) - return waw.phensig == null ? 0 : -1; - else if (waw.phensig == null) - return 1; - else { - int c = this.phensig.compareTo(waw.phensig); - if (c == 0) - return this.eventId - waw.eventId; - else - return c; - } - } - - public int getEventId() { - return eventId; - } - - public void setEventId(int eventId) { - this.eventId = eventId; - } - - public List getPortions() { - return portions; - } - - public void setPortions(List portions) { - this.portions = portions; - } -} diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/VM_global_library.vm b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/VM_global_library.vm index c9d739e623..f61c8ee837 100755 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/VM_global_library.vm +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/VM_global_library.vm @@ -189,33 +189,35 @@ ${drainage.name}## ########END MACRO #macro(inserttorwatches $watches $list $secondtimezone $dateUtil $timeFormat) -#set($torWatches = ${watches.getTorWatches()}) -#set($torWatchAlso = "") -#set($torWatchFirst = 1) -#foreach(${watch} in ${torWatches}) -#if($torWatchFirst) -#set($torWatchFirst = 0) -#else - ## +#set($tornadoWatches = []) +#foreach(${watch} in ${watches}) +#if(${watch.getPhenSig()} == 'TO.A') +#set($success = $tornadoWatches.add($watch)) +#set($endTime = ${watch.endTime}) +#if(!$latestEndTime || ${endTime.after($latestEndTime)}) +#set($latestEndTime = ${endTime}) #end -A TORNADO WATCH ${torWatchAlso}REMAINS IN EFFECT UNTIL ${dateUtil.format(${watch.getEndTime()}, ${timeFormat.plain}, 15, ${localtimezone})}## -${dateUtil.period(${watches.getLatestTorTime()},${timeFormat.plain}, 15, ${localtimezone})}## +#end +#end +#if(!${list.isEmpty($tornadoWatches)}) + +A TORNADO WATCH REMAINS IN EFFECT UNTIL ${dateUtil.format(${latestEndTime}, ${timeFormat.plain}, 15, ${localtimezone})}## +${dateUtil.period(${latestEndTime},${timeFormat.plain}, 15, ${localtimezone})}## #if(${secondtimezone}) /${dateUtil.format(${watch.getEndTime()}, ${timeFormat.plain}, 15, ${secondtimezone})}/## #end FOR ## -#set($numPortions = ${list.size(${watch.getPortions()})}) +#set($numPortions = ${list.size(${tornadoWatches})}) #set($count = 0) -#foreach(${portion} in ${watch.getPortions()}) +#foreach(${watch} in ${tornadoWatches}) #set($count = $count + 1) -#areaFormat(${portion.partOfParentRegion} true false true)${portion.parentRegion}## +#areaFormat(${watch.partOfState} true false true)${watch.state}## #if($count == $numPortions - 1) AND ## #elseif($count < $numPortions) ...## #end #end -#set($torWatchAlso = "ALSO ") . ## #end @@ -223,33 +225,35 @@ ${dateUtil.period(${watches.getLatestTorTime()},${timeFormat.plain}, 15, ${local ########END MACRO #macro(insertsvrwatches $watches $list $secondtimezone $dateUtil $timeFormat) -#set($svrWatches = ${watches.getSvrWatches()}) -#set($svrWatchAlso = "") -#set($svrWatchFirst = 1) -#foreach(${watch} in ${svrWatches}) -#if($svrWatchFirst) -#set($svrWatchFirst = 0) -#else - ## +#set($severeWatches = []) +#foreach(${watch} in ${watches}) +#if(${watch.getPhenSig()} == 'SV.A') +#set($success = $severeWatches.add($watch)) +#set($endTime = ${watch.endTime}) +#if(!$latestEndTime || ${endTime.after($latestEndTime)}) +#set($latestEndTime = ${endTime}) #end -A SEVERE THUNDERSTORM WATCH ${svrWatchAlso}REMAINS IN EFFECT UNTIL ${dateUtil.format(${watch.getEndTime()}, ${timeFormat.plain}, 15, ${localtimezone})}## -${dateUtil.period(${watches.getLatestSvrTime()},${timeFormat.plain}, 15, ${localtimezone})}## +#end +#end +#if(!${list.isEmpty($severeWatches)}) + +A SEVERE THUNDERSTORM WATCH REMAINS IN EFFECT UNTIL ${dateUtil.format(${latestEndTime}, ${timeFormat.plain}, 15, ${localtimezone})}## +${dateUtil.period(${latestEndTime},${timeFormat.plain}, 15, ${localtimezone})}## #if(${secondtimezone}) /${dateUtil.format(${watch.getEndTime()}, ${timeFormat.plain}, 15, ${secondtimezone})}/## #end FOR ## -#set($numPortions = ${list.size(${watch.getPortions()})}) +#set($numPortions = ${list.size(${severeWatches})}) #set($count = 0) -#foreach(${portion} in ${watch.getPortions()}) +#foreach(${watch} in ${severeWatches}) #set($count = $count + 1) -#areaFormat(${portion.partOfParentRegion} true false true)${portion.parentRegion}## +#areaFormat(${watch.partOfState} true false true)${watch.state}## #if($count == $numPortions - 1) AND ## #elseif($count < $numPortions) ...## #end #end -#set($svrWatchAlso = "ALSO ") . ## #end @@ -368,18 +372,6 @@ SOUTH## #if(${list.contains($directionSet, "WEST")}) #set($output = "${output}WEST") #end -#if(${list.contains($directionSet, "NE")}) -#set($output = "${output}NORTHEAST") -#end -#if(${list.contains($directionSet, "NW")}) -#set($output = "${output}NORTHWEST") -#end -#if(${list.contains($directionSet, "SE")}) -#set($output = "${output}SOUTHEAST") -#end -#if(${list.contains($directionSet, "SW")}) -#set($output = "${output}SOUTHWEST") -#end #if(${useCentral} && ${list.contains($directionSet, "CENTRAL")}) #if(${list.contains($directionSet, "NORTH")} || ${list.contains($directionSet, "SOUTH")} || ${list.contains($directionSet, "EAST")} || ${list.contains($directionSet, "WEST")}) #set($output = "${output} ") diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/airportWeatherWarning.vm b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/airportWeatherWarning.vm index 925363999f..0b9092e811 100755 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/airportWeatherWarning.vm +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/airportWeatherWarning.vm @@ -119,11 +119,11 @@ FOR THE FOLLOWING THREATS... ## If sites do not want watches in their AWW product comment out the ## section below ####################################################################### -#if(${list.contains(${includedWatches}, "torWatches")} && ${list.contains(${bullets}, "includeTorWatches")}) +#if(${list.contains(${includedWatches}, "TO.A")} && ${list.contains(${bullets}, "includeTorWatches")}) #inserttorwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat}) #end -#if(${list.contains(${includedWatches}, "svrWatches")} && ${list.contains(${bullets}, "includeSvrWatches")}) +#if(${list.contains(${includedWatches}, "SV.A")} && ${list.contains(${bullets}, "includeSvrWatches")}) #insertsvrwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat}) #end diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/airportWeatherWarning.xml b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/airportWeatherWarning.xml index 515b9be7ff..aaec47aea4 100755 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/airportWeatherWarning.xml +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/airportWeatherWarning.xml @@ -48,11 +48,11 @@ turned on unless the corresponding .vm file is turned on in a given template's . true - torWatches - svrWatches + TO.A + SV.A diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/burnScarFlashFloodWarning.xml b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/burnScarFlashFloodWarning.xml index 95b7e3bccf..4ec5e538c9 100755 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/burnScarFlashFloodWarning.xml +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/burnScarFlashFloodWarning.xml @@ -59,11 +59,11 @@ turned on unless the corresponding .vm file is turned on in a given template's . true diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/extremeWindWarning.vm b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/extremeWindWarning.vm index 49e03ff80b..beb59dc28a 100755 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/extremeWindWarning.vm +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/extremeWindWarning.vm @@ -191,10 +191,10 @@ THE SAFEST PLACE TO BE DURING A MAJOR LANDFALLING HURRICANE IS IN A REINFORCED I ############# ## WATCHES ## ############# -#if(${list.contains(${includedWatches}, "torWatches")}) +#if(${list.contains(${includedWatches}, "TO.A")}) #inserttorwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat}) #end -#if(${list.contains(${includedWatches}, "svrWatches")}) +#if(${list.contains(${includedWatches}, "SV.A")}) #insertsvrwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat}) #end diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/extremeWindWarning.xml b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/extremeWindWarning.xml index 51dda91a61..e60c44bd89 100755 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/extremeWindWarning.xml +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/extremeWindWarning.xml @@ -52,11 +52,11 @@ turned on unless the corresponding .vm file is turned on in a given template's . true - torWatches - svrWatches + TO.A + SV.A diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/extremeWindWarningFollowup.vm b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/extremeWindWarningFollowup.vm index c5f48fd652..2046feab8c 100755 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/extremeWindWarningFollowup.vm +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/extremeWindWarningFollowup.vm @@ -69,10 +69,10 @@ THIS IS A TEST MESSAGE. ## ############# ## WATCHES ## ############# -#if(${list.contains(${includedWatches}, "torWatches")}) +#if(${list.contains(${includedWatches}, "TO.A")}) #inserttorwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat}) #end -#if(${list.contains(${includedWatches}, "svrWatches")}) +#if(${list.contains(${includedWatches}, "SV.A")}) #insertsvrwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat}) #end #end @@ -238,10 +238,10 @@ THE SAFEST PLACE TO BE DURING A MAJOR LANDFALLING HURRICANE IS IN A REINFORCED I ############# ## WATCHES ## ############# -#if(${list.contains(${includedWatches}, "torWatches")}) +#if(${list.contains(${includedWatches}, "TO.A")}) #inserttorwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat}) #end -#if(${list.contains(${includedWatches}, "svrWatches")}) +#if(${list.contains(${includedWatches}, "SV.A")}) #insertsvrwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat}) #end #end @@ -346,10 +346,10 @@ THIS IS A TEST MESSAGE.## ############# ## WATCHES ## ############# -#if(${list.contains(${includedWatches}, "torWatches")}) +#if(${list.contains(${includedWatches}, "TO.A")}) #inserttorwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat}) #end -#if(${list.contains(${includedWatches}, "svrWatches")}) +#if(${list.contains(${includedWatches}, "SV.A")}) #insertsvrwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat}) #end #if(${productClass}=="T") @@ -468,10 +468,10 @@ THE SAFEST PLACE TO BE DURING A MAJOR LANDFALLING HURRICANE IS IN A REINFORCED I ############# ## WATCHES ## ############# -#if(${list.contains(${includedWatches}, "torWatches")}) +#if(${list.contains(${includedWatches}, "TO.A")}) #inserttorwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat}) #end -#if(${list.contains(${includedWatches}, "svrWatches")}) +#if(${list.contains(${includedWatches}, "SV.A")}) #insertsvrwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat}) #end #end @@ -512,10 +512,10 @@ THIS IS A TEST MESSAGE.## ############# ## WATCHES ## ############# -#if(${list.contains(${includedWatches}, "torWatches")}) +#if(${list.contains(${includedWatches}, "TO.A")}) #inserttorwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat}) #end -#if(${list.contains(${includedWatches}, "svrWatches")}) +#if(${list.contains(${includedWatches}, "SV.A")}) #insertsvrwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat}) #end #end diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/extremeWindWarningFollowup.xml b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/extremeWindWarningFollowup.xml index 201c1800dc..a4dbaf5d31 100755 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/extremeWindWarningFollowup.xml +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/extremeWindWarningFollowup.xml @@ -57,11 +57,11 @@ turned on unless the corresponding .vm file is turned on in a given template's . true - torWatches - svrWatches + TO.A + SV.A diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/fireWarning.xml b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/fireWarning.xml index ebb44f9f77..2cb5ae0f3c 100755 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/fireWarning.xml +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/fireWarning.xml @@ -52,7 +52,7 @@ turned on unless the corresponding .vm file is turned on in a given template's . true diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/flashFloodWarning.xml b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/flashFloodWarning.xml index 38531bfb1f..a6bd12d821 100755 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/flashFloodWarning.xml +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/flashFloodWarning.xml @@ -67,11 +67,11 @@ Must be paired with proper vm code (also commented out in flashFloodWarning.vm)! - torWatches - svrWatches + TO.A + SV.A diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/impactSevereThunderstormWarning.vm b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/impactSevereThunderstormWarning.vm index 6a74dfd0e5..2af1dbd411 100755 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/impactSevereThunderstormWarning.vm +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/impactSevereThunderstormWarning.vm @@ -624,12 +624,12 @@ TORRENTIAL RAINFALL IS OCCURRING WITH THIS STORM...AND MAY LEAD TO FLASH FLOODIN ## WATCHES ## ############# -#if(${list.contains(${includedWatches}, "torWatches")}) +#if(${list.contains(${includedWatches}, "TO.A")}) #inserttorwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat}) #end #* NO NEED TO INCLUDE SVR T-STM WATCHES IN A SVR WARNING!!!! -#if(${list.contains(${includedWatches}, "svrWatches")}) +#if(${list.contains(${includedWatches}, "SV.A")}) #insertsvrwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat}) # #end diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/impactSevereThunderstormWarning.xml b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/impactSevereThunderstormWarning.xml index d0bd8e2468..0bab1dcf4d 100755 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/impactSevereThunderstormWarning.xml +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/impactSevereThunderstormWarning.xml @@ -54,10 +54,10 @@ turned on unless the corresponding .vm file is turned on in a given template's . true - torWatches + TO.A diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/impactSevereWeatherStatement.vm b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/impactSevereWeatherStatement.vm index 0beb51d369..2dcebd7c19 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/impactSevereWeatherStatement.vm +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/impactSevereWeatherStatement.vm @@ -290,10 +290,10 @@ ${expcanPhrase} ${addthreat} ########################################### ## WATCHES ## ############# -#if(${list.contains(${includedWatches}, "torWatches")}) +#if(${list.contains(${includedWatches}, "TO.A")}) #inserttorwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat}) #end -#if(${list.contains(${includedWatches}, "svrWatches")}) +#if(${list.contains(${includedWatches}, "SV.A")}) #insertsvrwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat}) #end @@ -1180,7 +1180,7 @@ TORRENTIAL RAINFALL IS OCCURRING WITH THIS STORM...AND MAY LEAD TO FLASH FLOODIN ## WATCHES ## ############# -#if(${list.contains(${includedWatches}, "torWatches")} && ${phenomena}=="SV") +#if(${list.contains(${includedWatches}, "TO.A")} && ${phenomena}=="SV") #inserttorwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat}) #end diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/impactSevereWeatherStatement.xml b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/impactSevereWeatherStatement.xml index 97516c2459..dd9445095c 100755 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/impactSevereWeatherStatement.xml +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/impactSevereWeatherStatement.xml @@ -72,8 +72,8 @@ turned on unless the corresponding .vm file is turned on in a given template's . - torWatches - svrWatches + TO.A + SV.A false diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/impactSpecialMarineWarning.vm b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/impactSpecialMarineWarning.vm index 7efb6291b3..38166ec4a9 100755 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/impactSpecialMarineWarning.vm +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/impactSpecialMarineWarning.vm @@ -470,10 +470,10 @@ REPORT SEVERE WEATHER TO THE COAST GUARD OR NEAREST LAW ENFORCEMENT AGENCY. THEY ## WATCHES ## ############# -#if(${list.contains(${includedWatches}, "torWatches")}) +#if(${list.contains(${includedWatches}, "TO.A")}) #inserttorwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat}) #end -#if(${list.contains(${includedWatches}, "svrWatches")}) +#if(${list.contains(${includedWatches}, "SV.A")}) #insertsvrwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat}) #end #if(${productClass}=="T") diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/impactSpecialMarineWarning.xml b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/impactSpecialMarineWarning.xml index f32d251601..d2169a3b81 100755 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/impactSpecialMarineWarning.xml +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/impactSpecialMarineWarning.xml @@ -52,11 +52,11 @@ turned on unless the corresponding .vm file is turned on in a given template's . true - torWatches - svrWatches + TO.A + SV.A diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/impactSpecialMarineWarningFollowup.vm b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/impactSpecialMarineWarningFollowup.vm index 312e7cab78..91c833cc4f 100755 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/impactSpecialMarineWarningFollowup.vm +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/impactSpecialMarineWarningFollowup.vm @@ -397,10 +397,10 @@ ${canwarning} ############# ## WATCHES ## ############# -#if(${list.contains(${includedWatches}, "torWatches")}) +#if(${list.contains(${includedWatches}, "TO.A")}) #inserttorwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat}) #end -#if(${list.contains(${includedWatches}, "svrWatches")}) +#if(${list.contains(${includedWatches}, "SV.A")}) #insertsvrwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat}) #end #end @@ -571,10 +571,10 @@ REPORT SEVERE WEATHER TO THE COAST GUARD OR NEAREST LAW ENFORCEMENT AGENCY. THEY ############# ## WATCHES ## ############# -#if(${list.contains(${includedWatches}, "torWatches")}) +#if(${list.contains(${includedWatches}, "TO.A")}) #inserttorwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat}) #end -#if(${list.contains(${includedWatches}, "svrWatches")}) +#if(${list.contains(${includedWatches}, "SV.A")}) #insertsvrwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat}) #end #end @@ -679,10 +679,10 @@ THE ${eventType} !** WEAKENED / MOVED OUT OF THE WARNED AREA **! AND NO LONGER $ ############# ## WATCHES ## ############# -#if(${list.contains(${includedWatches}, "torWatches")}) +#if(${list.contains(${includedWatches}, "TO.A")}) #inserttorwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat}) #end -#if(${list.contains(${includedWatches}, "svrWatches")}) +#if(${list.contains(${includedWatches}, "SV.A")}) #insertsvrwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat}) #end #if(${productClass}=="T") @@ -880,10 +880,10 @@ REPORT SEVERE WEATHER TO THE COAST GUARD OR NEAREST LAW ENFORCEMENT AGENCY. THEY ############# ## WATCHES ## ############# -#if(${list.contains(${includedWatches}, "torWatches")}) +#if(${list.contains(${includedWatches}, "TO.A")}) #inserttorwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat}) #end -#if(${list.contains(${includedWatches}, "svrWatches")}) +#if(${list.contains(${includedWatches}, "SV.A")}) #insertsvrwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat}) #end #elseif(${CORCAN} == "true") @@ -952,10 +952,10 @@ THE ${eventType} !** WEAKENED / MOVED OUT OF THE WARNED AREA **! AND NO LONGER $ ############# ## WATCHES ## ############# -#if(${list.contains(${includedWatches}, "torWatches")}) +#if(${list.contains(${includedWatches}, "TO.A")}) #inserttorwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat}) #end -#if(${list.contains(${includedWatches}, "svrWatches")}) +#if(${list.contains(${includedWatches}, "SV.A")}) #insertsvrwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat}) #end #if(${productClass}=="T") @@ -1142,10 +1142,10 @@ REPORT SEVERE WEATHER TO THE COAST GUARD OR NEAREST LAW ENFORCEMENT AGENCY. THEY ############# ## WATCHES ## ############# -#if(${list.contains(${includedWatches}, "torWatches")}) +#if(${list.contains(${includedWatches}, "TO.A")}) #inserttorwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat}) #end -#if(${list.contains(${includedWatches}, "svrWatches")}) +#if(${list.contains(${includedWatches}, "SV.A")}) #insertsvrwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat}) #end #end @@ -1219,10 +1219,10 @@ ${expwarning} ############# ## WATCHES ## ############# -#if(${list.contains(${includedWatches}, "torWatches")}) +#if(${list.contains(${includedWatches}, "TO.A")}) #inserttorwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat}) #end -#if(${list.contains(${includedWatches}, "svrWatches")}) +#if(${list.contains(${includedWatches}, "SV.A")}) #insertsvrwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat}) #end #end diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/impactSpecialMarineWarningFollowup.xml b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/impactSpecialMarineWarningFollowup.xml index 282c828cb2..afaabe00f7 100755 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/impactSpecialMarineWarningFollowup.xml +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/impactSpecialMarineWarningFollowup.xml @@ -52,11 +52,11 @@ turned on unless the corresponding .vm file is turned on in a given template's . true - torWatches - svrWatches + TO.A + SV.A diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/marineWeatherStatement.xml b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/marineWeatherStatement.xml index 94af0ead79..1b741dadd6 100755 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/marineWeatherStatement.xml +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/marineWeatherStatement.xml @@ -51,11 +51,11 @@ turned on unless the corresponding .vm file is turned on in a given template's . true - torWatches - svrWatches + TO.A + SV.A diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/marineWeatherStatementAshfall.xml b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/marineWeatherStatementAshfall.xml index f8d740f5a9..7d0011ec8e 100755 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/marineWeatherStatementAshfall.xml +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/marineWeatherStatementAshfall.xml @@ -51,11 +51,11 @@ turned on unless the corresponding .vm file is turned on in a given template's . true - torWatches - svrWatches + TO.A + SV.A diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/severeThunderstormWarning.vm b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/severeThunderstormWarning.vm index 2026a34d82..1b5a496254 100755 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/severeThunderstormWarning.vm +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/severeThunderstormWarning.vm @@ -471,7 +471,7 @@ TORRENTIAL RAINFALL IS ALSO OCCURRING WITH THIS STORM...AND MAY LEAD TO FLASH FL ## WATCHES ## ############# -#if(${list.contains(${includedWatches}, "torWatches")}) +#if(${list.contains(${includedWatches}, "TO.A")}) #inserttorwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat}) #end diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/severeThunderstormWarning.xml b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/severeThunderstormWarning.xml index bf18698b4a..e8fa6b5ed4 100755 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/severeThunderstormWarning.xml +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/severeThunderstormWarning.xml @@ -58,10 +58,10 @@ turned on unless the corresponding .vm file is turned on in a given template's . true - torWatches + TO.A diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/severeWeatherStatement.vm b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/severeWeatherStatement.vm index 31cbd3f5b7..13de4f620f 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/severeWeatherStatement.vm +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/severeWeatherStatement.vm @@ -262,10 +262,10 @@ ${expcanPhrase} ${addthreat} ########################################### ## WATCHES ## ############# -###if(${list.contains(${includedWatches}, "torWatches")}) +###if(${list.contains(${includedWatches}, "TO.A")}) ###inserttorwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat}) ###end -###if(${list.contains(${includedWatches}, "svrWatches")}) +###if(${list.contains(${includedWatches}, "SV.A")}) ###insertsvrwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat}) ###end #if(${list.contains(${bullets}, "svrboxactive")}) @@ -924,7 +924,7 @@ TORRENTIAL RAINFALL IS ALSO OCCURRING WITH THIS STORM...AND MAY LEAD TO FLASH FL ############# ## WATCHES ## ############# -#if(${list.contains(${includedWatches}, "torWatches")} && ${phenomena}=="SV") +#if(${list.contains(${includedWatches}, "TO.A")} && ${phenomena}=="SV") #inserttorwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat}) #end diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/severeWeatherStatement.xml b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/severeWeatherStatement.xml index 1483bf541d..ebf7b7720f 100755 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/severeWeatherStatement.xml +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/severeWeatherStatement.xml @@ -69,8 +69,8 @@ turned on unless the corresponding .vm file is turned on in a given template's . - torWatches - svrWatches + TO.A + SV.A false diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/shortTermForecast.vm b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/shortTermForecast.vm index e97abde500..4d94012917 100755 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/shortTermForecast.vm +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/shortTermForecast.vm @@ -230,11 +230,11 @@ LOCATIONS CAN EXPECT !** EXPECTED SNOW **! INCHES OF SNOW. ############# ## WATCHES ## ############# -#if(${list.contains(${includedWatches}, "torWatches")} && ${list.contains(${bullets}, "includeTorWatches")}) +#if(${list.contains(${includedWatches}, "TO.A")} && ${list.contains(${bullets}, "includeTorWatches")}) #inserttorwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat}) #end -#if(${list.contains(${includedWatches}, "svrWatches")} && ${list.contains(${bullets}, "includeSvrWatches")}) +#if(${list.contains(${includedWatches}, "SV.A")} && ${list.contains(${bullets}, "includeSvrWatches")}) #insertsvrwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat}) #end diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/shortTermForecast.xml b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/shortTermForecast.xml index 52a6eeb82f..87466c49da 100755 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/shortTermForecast.xml +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/shortTermForecast.xml @@ -54,11 +54,11 @@ turned on unless the corresponding .vm file is turned on in a given template's . true - torWatches - svrWatches + TO.A + SV.A diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/significantWeatherAdvisory.vm b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/significantWeatherAdvisory.vm index 1befba963d..be2c0880df 100755 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/significantWeatherAdvisory.vm +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/significantWeatherAdvisory.vm @@ -309,10 +309,10 @@ IF ON OR NEAR !**Name Of Lake**!...GET OUT OF THE WATER AND MOVE INDOORS OR INSI ############# ## WATCHES ## ############# -#if(${list.contains(${includedWatches}, "torWatches")}) +#if(${list.contains(${includedWatches}, "TO.A")}) #inserttorwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat}) #end -#if(${list.contains(${includedWatches}, "svrWatches")}) +#if(${list.contains(${includedWatches}, "SV.A")}) #insertsvrwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat}) #end #################################### diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/significantWeatherAdvisory.xml b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/significantWeatherAdvisory.xml index 37298cbbca..7f5706eabc 100755 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/significantWeatherAdvisory.xml +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/significantWeatherAdvisory.xml @@ -50,11 +50,11 @@ turned on unless the corresponding .vm file is turned on in a given template's . true - torWatches - svrWatches + TO.A + SV.A diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/specialMarineWarning.vm b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/specialMarineWarning.vm index c61278ce4c..d1dd56df79 100755 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/specialMarineWarning.vm +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/specialMarineWarning.vm @@ -431,10 +431,10 @@ REPORT SEVERE WEATHER TO THE COAST GUARD OR NEAREST LAW ENFORCEMENT AGENCY. THEY ## WATCHES ## ############# -#if(${list.contains(${includedWatches}, "torWatches")}) +#if(${list.contains(${includedWatches}, "TO.A")}) #inserttorwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat}) #end -#if(${list.contains(${includedWatches}, "svrWatches")}) +#if(${list.contains(${includedWatches}, "SV.A")}) #insertsvrwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat}) #end #if(${productClass}=="T") diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/specialMarineWarning.xml b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/specialMarineWarning.xml index 70f1df6d30..a34a8dfd89 100755 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/specialMarineWarning.xml +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/specialMarineWarning.xml @@ -54,11 +54,11 @@ turned on unless the corresponding .vm file is turned on in a given template's . true - torWatches - svrWatches + TO.A + SV.A diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/specialMarineWarningFollowup.vm b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/specialMarineWarningFollowup.vm index 3dd71b8e81..6cd06d242b 100755 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/specialMarineWarningFollowup.vm +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/specialMarineWarningFollowup.vm @@ -365,10 +365,10 @@ ${canwarning} ############# ## WATCHES ## ############# -#if(${list.contains(${includedWatches}, "torWatches")}) +#if(${list.contains(${includedWatches}, "TO.A")}) #inserttorwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat}) #end -#if(${list.contains(${includedWatches}, "svrWatches")}) +#if(${list.contains(${includedWatches}, "SV.A")}) #insertsvrwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat}) #end #end @@ -538,10 +538,10 @@ REPORT SEVERE WEATHER TO THE COAST GUARD OR NEAREST LAW ENFORCEMENT AGENCY. THEY ############# ## WATCHES ## ############# -#if(${list.contains(${includedWatches}, "torWatches")}) +#if(${list.contains(${includedWatches}, "TO.A")}) #inserttorwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat}) #end -#if(${list.contains(${includedWatches}, "svrWatches")}) +#if(${list.contains(${includedWatches}, "SV.A")}) #insertsvrwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat}) #end #end @@ -646,10 +646,10 @@ THE ${eventType} !** WEAKENED / MOVED OUT OF THE WARNED AREA **! AND NO LONGER $ ############# ## WATCHES ## ############# -#if(${list.contains(${includedWatches}, "torWatches")}) +#if(${list.contains(${includedWatches}, "TO.A")}) #inserttorwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat}) #end -#if(${list.contains(${includedWatches}, "svrWatches")}) +#if(${list.contains(${includedWatches}, "SV.A")}) #insertsvrwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat}) #end #if(${productClass}=="T") @@ -845,10 +845,10 @@ REPORT SEVERE WEATHER TO THE COAST GUARD OR NEAREST LAW ENFORCEMENT AGENCY. THEY ############# ## WATCHES ## ############# -#if(${list.contains(${includedWatches}, "torWatches")}) +#if(${list.contains(${includedWatches}, "TO.A")}) #inserttorwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat}) #end -#if(${list.contains(${includedWatches}, "svrWatches")}) +#if(${list.contains(${includedWatches}, "SV.A")}) #insertsvrwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat}) #end #elseif(${CORCAN} == "true") @@ -917,10 +917,10 @@ THE ${eventType} !** WEAKENED / MOVED OUT OF THE WARNED AREA **! AND NO LONGER $ ############# ## WATCHES ## ############# -#if(${list.contains(${includedWatches}, "torWatches")}) +#if(${list.contains(${includedWatches}, "TO.A")}) #inserttorwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat}) #end -#if(${list.contains(${includedWatches}, "svrWatches")}) +#if(${list.contains(${includedWatches}, "SV.A")}) #insertsvrwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat}) #end @@ -1104,10 +1104,10 @@ REPORT SEVERE WEATHER TO THE COAST GUARD OR NEAREST LAW ENFORCEMENT AGENCY. THEY ############# ## WATCHES ## ############# -#if(${list.contains(${includedWatches}, "torWatches")}) +#if(${list.contains(${includedWatches}, "TO.A")}) #inserttorwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat}) #end -#if(${list.contains(${includedWatches}, "svrWatches")}) +#if(${list.contains(${includedWatches}, "SV.A")}) #insertsvrwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat}) #end #end @@ -1182,10 +1182,10 @@ ${expwarning} ############# ## WATCHES ## ############# -#if(${list.contains(${includedWatches}, "torWatches")}) +#if(${list.contains(${includedWatches}, "TO.A")}) #inserttorwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat}) #end -#if(${list.contains(${includedWatches}, "svrWatches")}) +#if(${list.contains(${includedWatches}, "SV.A")}) #insertsvrwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat}) #end #end diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/specialMarineWarningFollowup.xml b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/specialMarineWarningFollowup.xml index 5eac690e76..cffaf9a764 100755 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/specialMarineWarningFollowup.xml +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/specialMarineWarningFollowup.xml @@ -56,11 +56,11 @@ turned on unless the corresponding .vm file is turned on in a given template's . true - torWatches - svrWatches + TO.A + SV.A diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/specialWeatherStatement.xml b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/specialWeatherStatement.xml index b296717f9a..9e5088848e 100755 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/specialWeatherStatement.xml +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/specialWeatherStatement.xml @@ -49,11 +49,11 @@ turned on unless the corresponding .vm file is turned on in a given template's . true - torWatches - svrWatches + TO.A + SV.A From 752e386363829e287a2a33aea060542e69881e30 Mon Sep 17 00:00:00 2001 From: "Ying-Lian.Shi" Date: Tue, 22 Jul 2014 19:18:16 +0000 Subject: [PATCH 30/39] ASM #15649 - these 5 files are rolled back to 14.1.3 Change-Id: Ifc52168f1faf3984f2a2d72947273686c5a00fd9 Former-commit-id: a258d2fe226b72af7084db8b133bb42eaf961b47 [formerly 9dbfbbe0c30e4c9f762baf4c1986ce8e1e0c5a25] [formerly 22d46f265834021bf6a6a593e6df2347cd5d579e] [formerly a258d2fe226b72af7084db8b133bb42eaf961b47 [formerly 9dbfbbe0c30e4c9f762baf4c1986ce8e1e0c5a25] [formerly 22d46f265834021bf6a6a593e6df2347cd5d579e] [formerly 1f6d24a076017b717d6b38ae9f8e592c4723017b [formerly 22d46f265834021bf6a6a593e6df2347cd5d579e [formerly ab5a6807a591605e230d4180f1dcf3c2eaa8657f]]]] Former-commit-id: 1f6d24a076017b717d6b38ae9f8e592c4723017b Former-commit-id: 6f4a17363fd5e4a485a8ab13fe7a3657fb24db9a [formerly ef8ec0cff0a7bf92b7ce4876edca01a5f3e8bac4] [formerly e7f2c77f7910b963761f0209e7ac972fc6adfa8d [formerly c571da3e89b3d39b4f98e0fb97ad3ddbaf81e556]] Former-commit-id: c155f99f8b6ea5c68344fe29b4fd38a506591fb6 [formerly a0b78308568a39453883d46a8ef28dbb5925c01d] Former-commit-id: a1c024e5757b4d4cf1a5b04d3568531d4cb9c61e --- nativeLib/edex_com/src/Notification_types.cpp | 18 +- .../src/PointDataServer_constants.cpp | 22 +- .../edex_com/src/PointDataServer_types.cpp | 408 ++-- .../edex_com/src/PointData_constants.cpp | 22 +- nativeLib/edex_com/src/PointData_types.cpp | 1999 ++++++++--------- 5 files changed, 1192 insertions(+), 1277 deletions(-) diff --git a/nativeLib/edex_com/src/Notification_types.cpp b/nativeLib/edex_com/src/Notification_types.cpp index 651ae811c6..6a4c9de10a 100644 --- a/nativeLib/edex_com/src/Notification_types.cpp +++ b/nativeLib/edex_com/src/Notification_types.cpp @@ -1,5 +1,5 @@ /** - * Autogenerated by Thrift Compiler (0.9.0) + * Autogenerated by Thrift Compiler (0.8.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated @@ -35,6 +35,7 @@ * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * 07/29/13 2215 bkowal Regenerated for thrift 0.9.0 + * 07/22/14 15649 lshi Rollback to thrift 0.8.0 * * * @@ -43,14 +44,13 @@ */ #include "Notification_types.h" -#include - const char* com_raytheon_uf_common_dataplugin_message_DataURINotificationMessage::ascii_fingerprint = "ACE4F644F0FDD289DDC4EE5B83BC13C0"; const uint8_t com_raytheon_uf_common_dataplugin_message_DataURINotificationMessage::binary_fingerprint[16] = {0xAC,0xE4,0xF6,0x44,0xF0,0xFD,0xD2,0x89,0xDD,0xC4,0xEE,0x5B,0x83,0xBC,0x13,0xC0}; uint32_t com_raytheon_uf_common_dataplugin_message_DataURINotificationMessage::read(::apache::thrift::protocol::TProtocol* iprot) { + uint32_t xfer = 0; std::string fname; ::apache::thrift::protocol::TType ftype; @@ -75,14 +75,14 @@ uint32_t com_raytheon_uf_common_dataplugin_message_DataURINotificationMessage::r this->dataURIs.clear(); uint32_t _size0; ::apache::thrift::protocol::TType _etype3; - xfer += iprot->readListBegin(_etype3, _size0); + iprot->readListBegin(_etype3, _size0); this->dataURIs.resize(_size0); uint32_t _i4; for (_i4 = 0; _i4 < _size0; ++_i4) { xfer += iprot->readString(this->dataURIs[_i4]); } - xfer += iprot->readListEnd(); + iprot->readListEnd(); } this->__isset.dataURIs = true; } else { @@ -104,7 +104,6 @@ uint32_t com_raytheon_uf_common_dataplugin_message_DataURINotificationMessage::r uint32_t com_raytheon_uf_common_dataplugin_message_DataURINotificationMessage::write(::apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; xfer += oprot->writeStructBegin("com_raytheon_uf_common_dataplugin_message_DataURINotificationMessage"); - xfer += oprot->writeFieldBegin("dataURIs", ::apache::thrift::protocol::T_LIST, 1); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->dataURIs.size())); @@ -116,16 +115,9 @@ uint32_t com_raytheon_uf_common_dataplugin_message_DataURINotificationMessage::w xfer += oprot->writeListEnd(); } xfer += oprot->writeFieldEnd(); - xfer += oprot->writeFieldStop(); xfer += oprot->writeStructEnd(); return xfer; } -void swap(com_raytheon_uf_common_dataplugin_message_DataURINotificationMessage &a, com_raytheon_uf_common_dataplugin_message_DataURINotificationMessage &b) { - using ::std::swap; - swap(a.dataURIs, b.dataURIs); - swap(a.__isset, b.__isset); -} - diff --git a/nativeLib/edex_com/src/PointDataServer_constants.cpp b/nativeLib/edex_com/src/PointDataServer_constants.cpp index efda7a0ec5..d42c1c9302 100644 --- a/nativeLib/edex_com/src/PointDataServer_constants.cpp +++ b/nativeLib/edex_com/src/PointDataServer_constants.cpp @@ -1,10 +1,3 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ - /***************************************************************************************** * COPYRIGHT (c), 2009, RAYTHEON COMPANY * ALL RIGHTS RESERVED, An Unpublished Work @@ -26,7 +19,8 @@ ******************************************************************************************/ /* - * Extended thrift protocol to handle messages from edex. + * Support for point data request capability to retrieve point data and metadata + * from EDEX Thrift service. * *
  *
@@ -34,13 +28,21 @@
  *
  * Date         Ticket#     Engineer    Description
  * ------------ ----------  ----------- --------------------------
- * 07/29/13       2215       bkowal     Regenerated for thrift 0.9.0
+ * 08/08/11     9696        gzhou       Initial Creation
+ * 07/29/13     2215        bkowal      Regenerated for thrift 0.9.0
+ * 07/22/14     15649       lshi        Rollback to Initial Creation
  *
  * 
* - * @author bkowal + * @author gzhou * @version 1 */ + +/** + * Autogenerated by Thrift + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + */ #include "PointDataServer_constants.h" diff --git a/nativeLib/edex_com/src/PointDataServer_types.cpp b/nativeLib/edex_com/src/PointDataServer_types.cpp index e8c8713053..7c20e78d3d 100644 --- a/nativeLib/edex_com/src/PointDataServer_types.cpp +++ b/nativeLib/edex_com/src/PointDataServer_types.cpp @@ -1,10 +1,3 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ - /***************************************************************************************** * COPYRIGHT (c), 2009, RAYTHEON COMPANY * ALL RIGHTS RESERVED, An Unpublished Work @@ -26,7 +19,8 @@ ******************************************************************************************/ /* - * Extended thrift protocol to handle messages from edex. + * Support for point data request capability to retrieve point data and metadata + * from EDEX Thrift service. * *
  *
@@ -34,240 +28,222 @@
  *
  * Date         Ticket#     Engineer    Description
  * ------------ ----------  ----------- --------------------------
- * 07/29/13       2215       bkowal     Regenerated for thrift 0.9.0
+ * 08/08/11     9696        gzhou       Initial Creation
+ * 07/29/13     2215        bkowal      Regenerated for thrift 0.9.0
+ * 07/22/14     15649       lshi        Rollback to Initial Creation
  *
  * 
* - * @author bkowal + * @author gzhou * @version 1 */ + #include "PointDataServer_types.h" -#include +const char + * com_raytheon_uf_common_dataquery_requests_ConstraintType::ascii_fingerprint = + "EFB929595D312AC8F305D5A794CFEDA1"; +const uint8_t + com_raytheon_uf_common_dataquery_requests_ConstraintType::binary_fingerprint[16] = + { 0xEF, 0xB9, 0x29, 0x59, 0x5D, 0x31, 0x2A, 0xC8, 0xF3, 0x05, + 0xD5, 0xA7, 0x94, 0xCF, 0xED, 0xA1 }; +uint32_t com_raytheon_uf_common_dataquery_requests_ConstraintType::read( + ::apache::thrift::protocol::TProtocol* iprot) { + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; -const char* com_raytheon_uf_common_dataquery_requests_ConstraintType::ascii_fingerprint = "EFB929595D312AC8F305D5A794CFEDA1"; -const uint8_t com_raytheon_uf_common_dataquery_requests_ConstraintType::binary_fingerprint[16] = {0xEF,0xB9,0x29,0x59,0x5D,0x31,0x2A,0xC8,0xF3,0x05,0xD5,0xA7,0x94,0xCF,0xED,0xA1}; + xfer += iprot->readStructBegin(fname); -uint32_t com_raytheon_uf_common_dataquery_requests_ConstraintType::read(::apache::thrift::protocol::TProtocol* iprot) { + using ::apache::thrift::protocol::TProtocolException; - uint32_t xfer = 0; - std::string fname; - ::apache::thrift::protocol::TType ftype; - int16_t fid; + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(operand); + this->__isset.operand = true; + } else + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); - xfer += iprot->readStructBegin(fname); + xfer += iprot->readStructEnd(); - using ::apache::thrift::protocol::TProtocolException; - - - while (true) - { - xfer += iprot->readFieldBegin(fname, ftype, fid); - if (ftype == ::apache::thrift::protocol::T_STOP) { - break; - } - switch (fid) - { - case 1: - if (ftype == ::apache::thrift::protocol::T_STRING) { - xfer += iprot->readString(this->operand); - this->__isset.operand = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - return xfer; + return xfer; } -uint32_t com_raytheon_uf_common_dataquery_requests_ConstraintType::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - xfer += oprot->writeStructBegin("com_raytheon_uf_common_dataquery_requests_ConstraintType"); - - xfer += oprot->writeFieldBegin("operand", ::apache::thrift::protocol::T_STRING, 1); - xfer += oprot->writeString(this->operand); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; +uint32_t com_raytheon_uf_common_dataquery_requests_ConstraintType::write( + ::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer + += oprot->writeStructBegin( + "com_raytheon_uf_common_dataquery_requests_RequestConstraint$ConstraintType"); + xfer += oprot->writeFieldBegin("__enumValue__", + ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->operand); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeStructEnd(); + return xfer; } -void swap(com_raytheon_uf_common_dataquery_requests_ConstraintType &a, com_raytheon_uf_common_dataquery_requests_ConstraintType &b) { - using ::std::swap; - swap(a.operand, b.operand); - swap(a.__isset, b.__isset); +const char + * com_raytheon_uf_common_dataquery_requests_RequestConstraint::ascii_fingerprint = + "BDAF55DAA660FA1ADBE30760752211A8"; +const uint8_t + com_raytheon_uf_common_dataquery_requests_RequestConstraint::binary_fingerprint[16] = + { 0xBD, 0xAF, 0x55, 0xDA, 0xA6, 0x60, 0xFA, 0x1A, 0xDB, 0xE3, + 0x07, 0x60, 0x75, 0x22, 0x11, 0xA8 }; + +uint32_t com_raytheon_uf_common_dataquery_requests_RequestConstraint::read( + ::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + while (true) { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->constraintType.read(iprot); + this->__isset.constraintType = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->constraintValue); + this->__isset.constraintValue = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; } -const char* com_raytheon_uf_common_dataquery_requests_RequestConstraint::ascii_fingerprint = "BDAF55DAA660FA1ADBE30760752211A8"; -const uint8_t com_raytheon_uf_common_dataquery_requests_RequestConstraint::binary_fingerprint[16] = {0xBD,0xAF,0x55,0xDA,0xA6,0x60,0xFA,0x1A,0xDB,0xE3,0x07,0x60,0x75,0x22,0x11,0xA8}; - -uint32_t com_raytheon_uf_common_dataquery_requests_RequestConstraint::read(::apache::thrift::protocol::TProtocol* iprot) { - - uint32_t xfer = 0; - std::string fname; - ::apache::thrift::protocol::TType ftype; - int16_t fid; - - xfer += iprot->readStructBegin(fname); - - using ::apache::thrift::protocol::TProtocolException; - - - while (true) - { - xfer += iprot->readFieldBegin(fname, ftype, fid); - if (ftype == ::apache::thrift::protocol::T_STOP) { - break; - } - switch (fid) - { - case 1: - if (ftype == ::apache::thrift::protocol::T_STRUCT) { - xfer += this->constraintType.read(iprot); - this->__isset.constraintType = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 2: - if (ftype == ::apache::thrift::protocol::T_STRING) { - xfer += iprot->readString(this->constraintValue); - this->__isset.constraintValue = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - return xfer; +uint32_t com_raytheon_uf_common_dataquery_requests_RequestConstraint::write( + ::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin( + "com_raytheon_uf_common_dataquery_requests_RequestConstraint"); + xfer += oprot->writeFieldBegin("constraintType", + ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->constraintType.write(oprot); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("constraintValue", + ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->constraintValue); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; } -uint32_t com_raytheon_uf_common_dataquery_requests_RequestConstraint::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - xfer += oprot->writeStructBegin("com_raytheon_uf_common_dataquery_requests_RequestConstraint"); +const char + * com_raytheon_uf_common_pointdata_PointDataServerRequest::ascii_fingerprint = + "C9F1CC9CD1A896EE01B7C5215E2BE99F"; +const uint8_t + com_raytheon_uf_common_pointdata_PointDataServerRequest::binary_fingerprint[16] = + { 0xC9, 0xF1, 0xCC, 0x9C, 0xD1, 0xA8, 0x96, 0xEE, 0x01, 0xB7, + 0xC5, 0x21, 0x5E, 0x2B, 0xE9, 0x9F }; - xfer += oprot->writeFieldBegin("constraintType", ::apache::thrift::protocol::T_STRUCT, 1); - xfer += this->constraintType.write(oprot); - xfer += oprot->writeFieldEnd(); +uint32_t com_raytheon_uf_common_pointdata_PointDataServerRequest::read( + ::apache::thrift::protocol::TProtocol* iprot) { - xfer += oprot->writeFieldBegin("constraintValue", ::apache::thrift::protocol::T_STRING, 2); - xfer += oprot->writeString(this->constraintValue); - xfer += oprot->writeFieldEnd(); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + while (true) { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == ::apache::thrift::protocol::T_MAP) { + { + this->rcMap.clear(); + uint32_t _size0; + ::apache::thrift::protocol::TType _ktype1; + ::apache::thrift::protocol::TType _vtype2; + iprot->readMapBegin(_ktype1, _vtype2, _size0); + uint32_t _i4; + for (_i4 = 0; _i4 < _size0; ++_i4) { + std::string _key5; + xfer += iprot->readString(_key5); + com_raytheon_uf_common_dataquery_requests_RequestConstraint + & _val6 = this->rcMap[_key5]; + xfer += _val6.read(iprot); + } + iprot->readMapEnd(); + } + this->__isset.rcMap = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; } -void swap(com_raytheon_uf_common_dataquery_requests_RequestConstraint &a, com_raytheon_uf_common_dataquery_requests_RequestConstraint &b) { - using ::std::swap; - swap(a.constraintType, b.constraintType); - swap(a.constraintValue, b.constraintValue); - swap(a.__isset, b.__isset); +uint32_t com_raytheon_uf_common_pointdata_PointDataServerRequest::write( + ::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin( + "com_raytheon_uf_common_pointdata_PointDataServerRequest"); + xfer += oprot->writeFieldBegin("rcMap", ::apache::thrift::protocol::T_MAP, + 1); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, + ::apache::thrift::protocol::T_STRUCT, this->rcMap.size()); + std::map::const_iterator + _iter7; + for (_iter7 = this->rcMap.begin(); _iter7 != this->rcMap.end(); ++_iter7) { + xfer += oprot->writeStructBegin("11"); + xfer += oprot->writeString(_iter7->first); + xfer += oprot->writeStructEnd(); + xfer += _iter7->second.write(oprot); + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; } -const char* com_raytheon_uf_common_pointdata_PointDataServerRequest::ascii_fingerprint = "C9F1CC9CD1A896EE01B7C5215E2BE99F"; -const uint8_t com_raytheon_uf_common_pointdata_PointDataServerRequest::binary_fingerprint[16] = {0xC9,0xF1,0xCC,0x9C,0xD1,0xA8,0x96,0xEE,0x01,0xB7,0xC5,0x21,0x5E,0x2B,0xE9,0x9F}; - -uint32_t com_raytheon_uf_common_pointdata_PointDataServerRequest::read(::apache::thrift::protocol::TProtocol* iprot) { - - uint32_t xfer = 0; - std::string fname; - ::apache::thrift::protocol::TType ftype; - int16_t fid; - - xfer += iprot->readStructBegin(fname); - - using ::apache::thrift::protocol::TProtocolException; - - - while (true) - { - xfer += iprot->readFieldBegin(fname, ftype, fid); - if (ftype == ::apache::thrift::protocol::T_STOP) { - break; - } - switch (fid) - { - case 1: - if (ftype == ::apache::thrift::protocol::T_MAP) { - { - this->rcMap.clear(); - uint32_t _size0; - ::apache::thrift::protocol::TType _ktype1; - ::apache::thrift::protocol::TType _vtype2; - xfer += iprot->readMapBegin(_ktype1, _vtype2, _size0); - uint32_t _i4; - for (_i4 = 0; _i4 < _size0; ++_i4) - { - std::string _key5; - xfer += iprot->readString(_key5); - com_raytheon_uf_common_dataquery_requests_RequestConstraint& _val6 = this->rcMap[_key5]; - xfer += _val6.read(iprot); - } - xfer += iprot->readMapEnd(); - } - this->__isset.rcMap = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - return xfer; -} - -uint32_t com_raytheon_uf_common_pointdata_PointDataServerRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - xfer += oprot->writeStructBegin("com_raytheon_uf_common_pointdata_PointDataServerRequest"); - - xfer += oprot->writeFieldBegin("rcMap", ::apache::thrift::protocol::T_MAP, 1); - { - xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRUCT, static_cast(this->rcMap.size())); - std::map ::const_iterator _iter7; - for (_iter7 = this->rcMap.begin(); _iter7 != this->rcMap.end(); ++_iter7) - { - xfer += oprot->writeString(_iter7->first); - xfer += _iter7->second.write(oprot); - } - xfer += oprot->writeMapEnd(); - } - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(com_raytheon_uf_common_pointdata_PointDataServerRequest &a, com_raytheon_uf_common_pointdata_PointDataServerRequest &b) { - using ::std::swap; - swap(a.rcMap, b.rcMap); - swap(a.__isset, b.__isset); -} - - diff --git a/nativeLib/edex_com/src/PointData_constants.cpp b/nativeLib/edex_com/src/PointData_constants.cpp index d1320a0071..f9a3740b12 100644 --- a/nativeLib/edex_com/src/PointData_constants.cpp +++ b/nativeLib/edex_com/src/PointData_constants.cpp @@ -1,10 +1,3 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ - /***************************************************************************************** * COPYRIGHT (c), 2009, RAYTHEON COMPANY * ALL RIGHTS RESERVED, An Unpublished Work @@ -26,7 +19,8 @@ ******************************************************************************************/ /* - * Extended thrift protocol to handle messages from edex. + * Support for point data request capability to retrieve point data + * from EDEX Thrift service. * *
  *
@@ -34,13 +28,21 @@
  *
  * Date         Ticket#     Engineer    Description
  * ------------ ----------  ----------- --------------------------
- * 07/29/13       2215       bkowal     Regenerated for thrift 0.9.0
+ * 01/18/10     3747        brockwoo    Initial Creation
+ * 07/29/13     2215        bkowal      Regenerated for thrift 0.9.0
+ * 07/22/14     15649       lshi		Rollback to Initial Creation
  *
  * 
* - * @author bkowal + * @author brockwoo * @version 1 */ + +/** + * Autogenerated by Thrift + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + */ #include "PointData_constants.h" diff --git a/nativeLib/edex_com/src/PointData_types.cpp b/nativeLib/edex_com/src/PointData_types.cpp index b9af07f958..b20d79c78f 100644 --- a/nativeLib/edex_com/src/PointData_types.cpp +++ b/nativeLib/edex_com/src/PointData_types.cpp @@ -1,10 +1,3 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ - /***************************************************************************************** * COPYRIGHT (c), 2009, RAYTHEON COMPANY * ALL RIGHTS RESERVED, An Unpublished Work @@ -26,7 +19,8 @@ ******************************************************************************************/ /* - * Extended thrift protocol to handle messages from edex. + * Support for point data request capability to retrieve point data + * from EDEX Thrift service. * *
  *
@@ -34,1091 +28,1040 @@
  *
  * Date         Ticket#     Engineer    Description
  * ------------ ----------  ----------- --------------------------
- * 07/29/13       2215       bkowal     Regenerated for thrift 0.9.0
+ * 01/18/10     3747        brockwoo    Initial Creation
+ * 07/29/13     2215        bkowal      Regenerated for thrift 0.9.0
+ * 07/22/14     15649       lshi        Rollback to Initial Creation
  *
  * 
* - * @author bkowal + * @author brockwoo * @version 1 */ + +/** + * Autogenerated by Thrift + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + */ #include "PointData_types.h" -#include +const char + * com_raytheon_uf_common_pointdata_ParameterDescription::ascii_fingerprint = + "F8914BAC237E22C5EFA279EDDBA3C5C6"; +const uint8_t + com_raytheon_uf_common_pointdata_ParameterDescription::binary_fingerprint[16] = { + 0xF8, 0x91, 0x4B, 0xAC, 0x23, 0x7E, 0x22, 0xC5, 0xEF, 0xA2, + 0x79, 0xED, 0xDB, 0xA3, 0xC5, 0xC6 }; +uint32_t com_raytheon_uf_common_pointdata_ParameterDescription::read( + apache::thrift::protocol::TProtocol* iprot) { + uint32_t xfer = 0; + std::string fname; + apache::thrift::protocol::TType ftype; + int16_t fid; -const char* com_raytheon_uf_common_pointdata_ParameterDescription::ascii_fingerprint = "F8914BAC237E22C5EFA279EDDBA3C5C6"; -const uint8_t com_raytheon_uf_common_pointdata_ParameterDescription::binary_fingerprint[16] = {0xF8,0x91,0x4B,0xAC,0x23,0x7E,0x22,0xC5,0xEF,0xA2,0x79,0xED,0xDB,0xA3,0xC5,0xC6}; + xfer += iprot->readStructBegin(fname); -uint32_t com_raytheon_uf_common_pointdata_ParameterDescription::read(::apache::thrift::protocol::TProtocol* iprot) { + using apache::thrift::protocol::TProtocolException; - uint32_t xfer = 0; - std::string fname; - ::apache::thrift::protocol::TType ftype; - int16_t fid; + while (true) { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dimension); + this->__isset.dimension = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->dimensionAsInt); + this->__isset.dimensionAsInt = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == apache::thrift::protocol::T_DOUBLE) { + xfer += iprot->readDouble(this->fillValue); + this->__isset.fillValue = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->maxLength); + this->__isset.maxLength = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->numDims); + this->__isset.numDims = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->parameterName); + this->__isset.parameterName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->unit); + this->__isset.unit = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } - xfer += iprot->readStructBegin(fname); + xfer += iprot->readStructEnd(); - using ::apache::thrift::protocol::TProtocolException; - - - while (true) - { - xfer += iprot->readFieldBegin(fname, ftype, fid); - if (ftype == ::apache::thrift::protocol::T_STOP) { - break; - } - switch (fid) - { - case 1: - if (ftype == ::apache::thrift::protocol::T_STRING) { - xfer += iprot->readString(this->dimension); - this->__isset.dimension = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 2: - if (ftype == ::apache::thrift::protocol::T_I32) { - xfer += iprot->readI32(this->dimensionAsInt); - this->__isset.dimensionAsInt = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 3: - if (ftype == ::apache::thrift::protocol::T_DOUBLE) { - xfer += iprot->readDouble(this->fillValue); - this->__isset.fillValue = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 4: - if (ftype == ::apache::thrift::protocol::T_I32) { - xfer += iprot->readI32(this->maxLength); - this->__isset.maxLength = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 5: - if (ftype == ::apache::thrift::protocol::T_I32) { - xfer += iprot->readI32(this->numDims); - this->__isset.numDims = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 6: - if (ftype == ::apache::thrift::protocol::T_STRING) { - xfer += iprot->readString(this->parameterName); - this->__isset.parameterName = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 7: - if (ftype == ::apache::thrift::protocol::T_STRING) { - xfer += iprot->readString(this->unit); - this->__isset.unit = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - return xfer; + return xfer; } -uint32_t com_raytheon_uf_common_pointdata_ParameterDescription::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - xfer += oprot->writeStructBegin("com_raytheon_uf_common_pointdata_ParameterDescription"); - - xfer += oprot->writeFieldBegin("dimension", ::apache::thrift::protocol::T_STRING, 1); - xfer += oprot->writeString(this->dimension); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldBegin("dimensionAsInt", ::apache::thrift::protocol::T_I32, 2); - xfer += oprot->writeI32(this->dimensionAsInt); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldBegin("fillValue", ::apache::thrift::protocol::T_DOUBLE, 3); - xfer += oprot->writeDouble(this->fillValue); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldBegin("maxLength", ::apache::thrift::protocol::T_I32, 4); - xfer += oprot->writeI32(this->maxLength); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldBegin("numDims", ::apache::thrift::protocol::T_I32, 5); - xfer += oprot->writeI32(this->numDims); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldBegin("parameterName", ::apache::thrift::protocol::T_STRING, 6); - xfer += oprot->writeString(this->parameterName); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldBegin("unit", ::apache::thrift::protocol::T_STRING, 7); - xfer += oprot->writeString(this->unit); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; +uint32_t com_raytheon_uf_common_pointdata_ParameterDescription::write( + apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin( + "com_raytheon_uf_common_pointdata_ParameterDescription"); + xfer += oprot->writeFieldBegin("dimension", + apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->dimension); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("dimensionAsInt", + apache::thrift::protocol::T_I32, 2); + xfer += oprot->writeI32(this->dimensionAsInt); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("fillValue", + apache::thrift::protocol::T_DOUBLE, 3); + xfer += oprot->writeDouble(this->fillValue); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("maxLength", + apache::thrift::protocol::T_I32, 4); + xfer += oprot->writeI32(this->maxLength); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("numDims", apache::thrift::protocol::T_I32, + 5); + xfer += oprot->writeI32(this->numDims); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("parameterName", + apache::thrift::protocol::T_STRING, 6); + xfer += oprot->writeString(this->parameterName); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("unit", apache::thrift::protocol::T_STRING, + 7); + xfer += oprot->writeString(this->unit); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; } -void swap(com_raytheon_uf_common_pointdata_ParameterDescription &a, com_raytheon_uf_common_pointdata_ParameterDescription &b) { - using ::std::swap; - swap(a.dimension, b.dimension); - swap(a.dimensionAsInt, b.dimensionAsInt); - swap(a.fillValue, b.fillValue); - swap(a.maxLength, b.maxLength); - swap(a.numDims, b.numDims); - swap(a.parameterName, b.parameterName); - swap(a.unit, b.unit); - swap(a.__isset, b.__isset); +const char + * com_raytheon_uf_common_pointdata_elements_StringPointDataObject::ascii_fingerprint = + "8432CD88CCBAE483EB61F9210360E5F9"; +const uint8_t + com_raytheon_uf_common_pointdata_elements_StringPointDataObject::binary_fingerprint[16] = { + 0x84, 0x32, 0xCD, 0x88, 0xCC, 0xBA, 0xE4, 0x83, 0xEB, 0x61, + 0xF9, 0x21, 0x03, 0x60, 0xE5, 0xF9 }; + +uint32_t com_raytheon_uf_common_pointdata_elements_StringPointDataObject::read( + apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using apache::thrift::protocol::TProtocolException; + + while (true) { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == apache::thrift::protocol::T_STRUCT) { + xfer += this->description.read(iprot); + this->__isset.description = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->dimensions); + this->__isset.dimensions = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == apache::thrift::protocol::T_LIST) { + { + this->stringData.clear(); + uint32_t _size0; + apache::thrift::protocol::TType _etype3; + iprot->readListBegin(_etype3, _size0); + this->stringData.resize(_size0); + uint32_t _i4; + for (_i4 = 0; _i4 < _size0; ++_i4) { + xfer += iprot->readString(this->stringData[_i4]); + } + iprot->readListEnd(); + } + this->__isset.stringData = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; } -const char* com_raytheon_uf_common_pointdata_elements_StringPointDataObject::ascii_fingerprint = "8432CD88CCBAE483EB61F9210360E5F9"; -const uint8_t com_raytheon_uf_common_pointdata_elements_StringPointDataObject::binary_fingerprint[16] = {0x84,0x32,0xCD,0x88,0xCC,0xBA,0xE4,0x83,0xEB,0x61,0xF9,0x21,0x03,0x60,0xE5,0xF9}; - -uint32_t com_raytheon_uf_common_pointdata_elements_StringPointDataObject::read(::apache::thrift::protocol::TProtocol* iprot) { - - uint32_t xfer = 0; - std::string fname; - ::apache::thrift::protocol::TType ftype; - int16_t fid; - - xfer += iprot->readStructBegin(fname); - - using ::apache::thrift::protocol::TProtocolException; - - - while (true) - { - xfer += iprot->readFieldBegin(fname, ftype, fid); - if (ftype == ::apache::thrift::protocol::T_STOP) { - break; - } - switch (fid) - { - case 1: - if (ftype == ::apache::thrift::protocol::T_STRUCT) { - xfer += this->description.read(iprot); - this->__isset.description = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 2: - if (ftype == ::apache::thrift::protocol::T_I32) { - xfer += iprot->readI32(this->dimensions); - this->__isset.dimensions = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 3: - if (ftype == ::apache::thrift::protocol::T_LIST) { - { - this->stringData.clear(); - uint32_t _size0; - ::apache::thrift::protocol::TType _etype3; - xfer += iprot->readListBegin(_etype3, _size0); - this->stringData.resize(_size0); - uint32_t _i4; - for (_i4 = 0; _i4 < _size0; ++_i4) - { - xfer += iprot->readString(this->stringData[_i4]); - } - xfer += iprot->readListEnd(); - } - this->__isset.stringData = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - return xfer; +uint32_t com_raytheon_uf_common_pointdata_elements_StringPointDataObject::write( + apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin( + "com_raytheon_uf_common_pointdata_elements_StringPointDataObject"); + xfer += oprot->writeFieldBegin("description", + apache::thrift::protocol::T_STRUCT, 1); + xfer += this->description.write(oprot); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("dimensions", + apache::thrift::protocol::T_I32, 2); + xfer += oprot->writeI32(this->dimensions); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("stringData", + apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(apache::thrift::protocol::T_STRING, + this->stringData.size()); + std::vector::const_iterator _iter5; + for (_iter5 = this->stringData.begin(); _iter5 + != this->stringData.end(); ++_iter5) { + xfer += oprot->writeString((*_iter5)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; } -uint32_t com_raytheon_uf_common_pointdata_elements_StringPointDataObject::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - xfer += oprot->writeStructBegin("com_raytheon_uf_common_pointdata_elements_StringPointDataObject"); +const char + * com_raytheon_uf_common_pointdata_elements_FloatPointDataObject::ascii_fingerprint = + "3E090BC5D21490BE0856576B426175A4"; +const uint8_t + com_raytheon_uf_common_pointdata_elements_FloatPointDataObject::binary_fingerprint[16] = { + 0x3E, 0x09, 0x0B, 0xC5, 0xD2, 0x14, 0x90, 0xBE, 0x08, 0x56, + 0x57, 0x6B, 0x42, 0x61, 0x75, 0xA4 }; - xfer += oprot->writeFieldBegin("description", ::apache::thrift::protocol::T_STRUCT, 1); - xfer += this->description.write(oprot); - xfer += oprot->writeFieldEnd(); +uint32_t com_raytheon_uf_common_pointdata_elements_FloatPointDataObject::read( + apache::thrift::protocol::TProtocol* iprot) { - xfer += oprot->writeFieldBegin("dimensions", ::apache::thrift::protocol::T_I32, 2); - xfer += oprot->writeI32(this->dimensions); - xfer += oprot->writeFieldEnd(); + uint32_t xfer = 0; + std::string fname; + apache::thrift::protocol::TType ftype; + int16_t fid; - xfer += oprot->writeFieldBegin("stringData", ::apache::thrift::protocol::T_LIST, 3); - { - xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->stringData.size())); - std::vector ::const_iterator _iter5; - for (_iter5 = this->stringData.begin(); _iter5 != this->stringData.end(); ++_iter5) - { - xfer += oprot->writeString((*_iter5)); - } - xfer += oprot->writeListEnd(); - } - xfer += oprot->writeFieldEnd(); + xfer += iprot->readStructBegin(fname); - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; + using apache::thrift::protocol::TProtocolException; + + while (true) { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == apache::thrift::protocol::T_STRUCT) { + xfer += this->description.read(iprot); + this->__isset.description = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->dimensions); + this->__isset.dimensions = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == apache::thrift::protocol::T_LIST) { + { + this->floatData.clear(); + uint32_t _size6; + apache::thrift::protocol::TType _etype9; + iprot->readListBegin(_etype9, _size6); + this->floatData.resize(_size6); + uint32_t _i10; + for (_i10 = 0; _i10 < _size6; ++_i10) { + xfer += iprot->readI32(this->floatData[_i10]); + } + iprot->readListEnd(); + } + this->__isset.floatData = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + union { + int32_t i; + float f; + } u; + //u.i = (long)v; + //return (jfloat)u.f; + + int intCounter = 0; + for (intCounter = 0; intCounter < (int)this->floatData.size(); intCounter++) { + u.i = this->floatData.at(intCounter); + float holder = (float)u.f; + this->trueFloatData.push_back(holder); + } + + xfer += iprot->readStructEnd(); + + return xfer; } -void swap(com_raytheon_uf_common_pointdata_elements_StringPointDataObject &a, com_raytheon_uf_common_pointdata_elements_StringPointDataObject &b) { - using ::std::swap; - swap(a.description, b.description); - swap(a.dimensions, b.dimensions); - swap(a.stringData, b.stringData); - swap(a.__isset, b.__isset); +uint32_t com_raytheon_uf_common_pointdata_elements_FloatPointDataObject::write( + apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin( + "com_raytheon_uf_common_pointdata_elements_FloatPointDataObject"); + xfer += oprot->writeFieldBegin("description", + apache::thrift::protocol::T_STRUCT, 1); + xfer += this->description.write(oprot); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("dimensions", + apache::thrift::protocol::T_I32, 2); + xfer += oprot->writeI32(this->dimensions); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("floatData", + apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(apache::thrift::protocol::T_I32, + this->floatData.size()); + std::vector::const_iterator _iter11; + for (_iter11 = this->floatData.begin(); _iter11 + != this->floatData.end(); ++_iter11) { + xfer += oprot->writeI32((*_iter11)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; } -const char* com_raytheon_uf_common_pointdata_elements_FloatPointDataObject::ascii_fingerprint = "89584E5DAFB01EC75A91F6E88874692D"; -const uint8_t com_raytheon_uf_common_pointdata_elements_FloatPointDataObject::binary_fingerprint[16] = {0x89,0x58,0x4E,0x5D,0xAF,0xB0,0x1E,0xC7,0x5A,0x91,0xF6,0xE8,0x88,0x74,0x69,0x2D}; +const char + * com_raytheon_uf_common_pointdata_elements_IntPointDataObject::ascii_fingerprint = + "3E090BC5D21490BE0856576B426175A4"; +const uint8_t + com_raytheon_uf_common_pointdata_elements_IntPointDataObject::binary_fingerprint[16] = { + 0x3E, 0x09, 0x0B, 0xC5, 0xD2, 0x14, 0x90, 0xBE, 0x08, 0x56, + 0x57, 0x6B, 0x42, 0x61, 0x75, 0xA4 }; -uint32_t com_raytheon_uf_common_pointdata_elements_FloatPointDataObject::read(::apache::thrift::protocol::TProtocol* iprot) { +uint32_t com_raytheon_uf_common_pointdata_elements_IntPointDataObject::read( + apache::thrift::protocol::TProtocol* iprot) { - uint32_t xfer = 0; - std::string fname; - ::apache::thrift::protocol::TType ftype; - int16_t fid; + uint32_t xfer = 0; + std::string fname; + apache::thrift::protocol::TType ftype; + int16_t fid; - xfer += iprot->readStructBegin(fname); + xfer += iprot->readStructBegin(fname); - using ::apache::thrift::protocol::TProtocolException; + using apache::thrift::protocol::TProtocolException; + while (true) { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == apache::thrift::protocol::T_STRUCT) { + xfer += this->description.read(iprot); + this->__isset.description = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->dimensions); + this->__isset.dimensions = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == apache::thrift::protocol::T_LIST) { + { + this->intData.clear(); + uint32_t _size12; + apache::thrift::protocol::TType _etype15; + iprot->readListBegin(_etype15, _size12); + this->intData.resize(_size12); + uint32_t _i16; + for (_i16 = 0; _i16 < _size12; ++_i16) { + xfer += iprot->readI32(this->intData[_i16]); + } + iprot->readListEnd(); + } + this->__isset.intData = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } - while (true) - { - xfer += iprot->readFieldBegin(fname, ftype, fid); - if (ftype == ::apache::thrift::protocol::T_STOP) { - break; - } - switch (fid) - { - case 1: - if (ftype == ::apache::thrift::protocol::T_STRUCT) { - xfer += this->description.read(iprot); - this->__isset.description = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 2: - if (ftype == ::apache::thrift::protocol::T_I32) { - xfer += iprot->readI32(this->dimensions); - this->__isset.dimensions = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 3: - if (ftype == ::apache::thrift::protocol::T_LIST) { - { - this->floatData.clear(); - uint32_t _size6; - ::apache::thrift::protocol::TType _etype9; - xfer += iprot->readListBegin(_etype9, _size6); - this->floatData.resize(_size6); - uint32_t _i10; - for (_i10 = 0; _i10 < _size6; ++_i10) - { - xfer += iprot->readI32(this->floatData[_i10]); - } - xfer += iprot->readListEnd(); - } - this->__isset.floatData = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 4: - if (ftype == ::apache::thrift::protocol::T_LIST) { - { - this->trueFloatData.clear(); - uint32_t _size11; - ::apache::thrift::protocol::TType _etype14; - xfer += iprot->readListBegin(_etype14, _size11); - this->trueFloatData.resize(_size11); - uint32_t _i15; - for (_i15 = 0; _i15 < _size11; ++_i15) - { - xfer += iprot->readDouble(this->trueFloatData[_i15]); - } - xfer += iprot->readListEnd(); - } - this->__isset.trueFloatData = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } + xfer += iprot->readStructEnd(); - xfer += iprot->readStructEnd(); - - return xfer; + return xfer; } -uint32_t com_raytheon_uf_common_pointdata_elements_FloatPointDataObject::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - xfer += oprot->writeStructBegin("com_raytheon_uf_common_pointdata_elements_FloatPointDataObject"); - - xfer += oprot->writeFieldBegin("description", ::apache::thrift::protocol::T_STRUCT, 1); - xfer += this->description.write(oprot); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldBegin("dimensions", ::apache::thrift::protocol::T_I32, 2); - xfer += oprot->writeI32(this->dimensions); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldBegin("floatData", ::apache::thrift::protocol::T_LIST, 3); - { - xfer += oprot->writeListBegin(::apache::thrift::protocol::T_I32, static_cast(this->floatData.size())); - std::vector ::const_iterator _iter16; - for (_iter16 = this->floatData.begin(); _iter16 != this->floatData.end(); ++_iter16) - { - xfer += oprot->writeI32((*_iter16)); - } - xfer += oprot->writeListEnd(); - } - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldBegin("trueFloatData", ::apache::thrift::protocol::T_LIST, 4); - { - xfer += oprot->writeListBegin(::apache::thrift::protocol::T_DOUBLE, static_cast(this->trueFloatData.size())); - std::vector ::const_iterator _iter17; - for (_iter17 = this->trueFloatData.begin(); _iter17 != this->trueFloatData.end(); ++_iter17) - { - xfer += oprot->writeDouble((*_iter17)); - } - xfer += oprot->writeListEnd(); - } - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; +uint32_t com_raytheon_uf_common_pointdata_elements_IntPointDataObject::write( + apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin( + "com_raytheon_uf_common_pointdata_elements_IntPointDataObject"); + xfer += oprot->writeFieldBegin("description", + apache::thrift::protocol::T_STRUCT, 1); + xfer += this->description.write(oprot); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("dimensions", + apache::thrift::protocol::T_I32, 2); + xfer += oprot->writeI32(this->dimensions); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("intData", apache::thrift::protocol::T_LIST, + 3); + { + xfer += oprot->writeListBegin(apache::thrift::protocol::T_I32, + this->intData.size()); + std::vector::const_iterator _iter17; + for (_iter17 = this->intData.begin(); _iter17 != this->intData.end(); ++_iter17) { + xfer += oprot->writeI32((*_iter17)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; } -void swap(com_raytheon_uf_common_pointdata_elements_FloatPointDataObject &a, com_raytheon_uf_common_pointdata_elements_FloatPointDataObject &b) { - using ::std::swap; - swap(a.description, b.description); - swap(a.dimensions, b.dimensions); - swap(a.floatData, b.floatData); - swap(a.trueFloatData, b.trueFloatData); - swap(a.__isset, b.__isset); +const char + * com_raytheon_uf_common_pointdata_elements_LongPointDataObject::ascii_fingerprint = + "135921A65C05459AFDDA382E27DDA225"; +const uint8_t + com_raytheon_uf_common_pointdata_elements_LongPointDataObject::binary_fingerprint[16] = { + 0x13, 0x59, 0x21, 0xA6, 0x5C, 0x05, 0x45, 0x9A, 0xFD, 0xDA, + 0x38, 0x2E, 0x27, 0xDD, 0xA2, 0x25 }; + +uint32_t com_raytheon_uf_common_pointdata_elements_LongPointDataObject::read( + apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using apache::thrift::protocol::TProtocolException; + + while (true) { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == apache::thrift::protocol::T_STRUCT) { + xfer += this->description.read(iprot); + this->__isset.description = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->dimensions); + this->__isset.dimensions = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == apache::thrift::protocol::T_LIST) { + { + this->longData.clear(); + uint32_t _size18; + apache::thrift::protocol::TType _etype21; + iprot->readListBegin(_etype21, _size18); + this->longData.resize(_size18); + uint32_t _i22; + for (_i22 = 0; _i22 < _size18; ++_i22) { + xfer += iprot->readI64(this->longData[_i22]); + } + iprot->readListEnd(); + } + this->__isset.longData = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; } -const char* com_raytheon_uf_common_pointdata_elements_IntPointDataObject::ascii_fingerprint = "3E090BC5D21490BE0856576B426175A4"; -const uint8_t com_raytheon_uf_common_pointdata_elements_IntPointDataObject::binary_fingerprint[16] = {0x3E,0x09,0x0B,0xC5,0xD2,0x14,0x90,0xBE,0x08,0x56,0x57,0x6B,0x42,0x61,0x75,0xA4}; - -uint32_t com_raytheon_uf_common_pointdata_elements_IntPointDataObject::read(::apache::thrift::protocol::TProtocol* iprot) { - - uint32_t xfer = 0; - std::string fname; - ::apache::thrift::protocol::TType ftype; - int16_t fid; - - xfer += iprot->readStructBegin(fname); - - using ::apache::thrift::protocol::TProtocolException; - - - while (true) - { - xfer += iprot->readFieldBegin(fname, ftype, fid); - if (ftype == ::apache::thrift::protocol::T_STOP) { - break; - } - switch (fid) - { - case 1: - if (ftype == ::apache::thrift::protocol::T_STRUCT) { - xfer += this->description.read(iprot); - this->__isset.description = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 2: - if (ftype == ::apache::thrift::protocol::T_I32) { - xfer += iprot->readI32(this->dimensions); - this->__isset.dimensions = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 3: - if (ftype == ::apache::thrift::protocol::T_LIST) { - { - this->intData.clear(); - uint32_t _size18; - ::apache::thrift::protocol::TType _etype21; - xfer += iprot->readListBegin(_etype21, _size18); - this->intData.resize(_size18); - uint32_t _i22; - for (_i22 = 0; _i22 < _size18; ++_i22) - { - xfer += iprot->readI32(this->intData[_i22]); - } - xfer += iprot->readListEnd(); - } - this->__isset.intData = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - return xfer; +uint32_t com_raytheon_uf_common_pointdata_elements_LongPointDataObject::write( + apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin( + "com_raytheon_uf_common_pointdata_elements_LongPointDataObject"); + xfer += oprot->writeFieldBegin("description", + apache::thrift::protocol::T_STRUCT, 1); + xfer += this->description.write(oprot); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("dimensions", + apache::thrift::protocol::T_I32, 2); + xfer += oprot->writeI32(this->dimensions); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("longData", + apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(apache::thrift::protocol::T_I64, + this->longData.size()); + std::vector::const_iterator _iter23; + for (_iter23 = this->longData.begin(); _iter23 != this->longData.end(); ++_iter23) { + xfer += oprot->writeI64((*_iter23)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; } -uint32_t com_raytheon_uf_common_pointdata_elements_IntPointDataObject::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - xfer += oprot->writeStructBegin("com_raytheon_uf_common_pointdata_elements_IntPointDataObject"); +const char + * com_raytheon_uf_common_pointdata_PointDataThriftContainer::ascii_fingerprint = + "1FBB5099264525B0793D6869D0E4CD21"; +const uint8_t + com_raytheon_uf_common_pointdata_PointDataThriftContainer::binary_fingerprint[16] = { + 0x1F, 0xBB, 0x50, 0x99, 0x26, 0x45, 0x25, 0xB0, 0x79, 0x3D, + 0x68, 0x69, 0xD0, 0xE4, 0xCD, 0x21 }; - xfer += oprot->writeFieldBegin("description", ::apache::thrift::protocol::T_STRUCT, 1); - xfer += this->description.write(oprot); - xfer += oprot->writeFieldEnd(); +uint32_t com_raytheon_uf_common_pointdata_PointDataThriftContainer::read( + apache::thrift::protocol::TProtocol* iprot) { - xfer += oprot->writeFieldBegin("dimensions", ::apache::thrift::protocol::T_I32, 2); - xfer += oprot->writeI32(this->dimensions); - xfer += oprot->writeFieldEnd(); + uint32_t xfer = 0; + std::string fname; + apache::thrift::protocol::TType ftype; + int16_t fid; - xfer += oprot->writeFieldBegin("intData", ::apache::thrift::protocol::T_LIST, 3); - { - xfer += oprot->writeListBegin(::apache::thrift::protocol::T_I32, static_cast(this->intData.size())); - std::vector ::const_iterator _iter23; - for (_iter23 = this->intData.begin(); _iter23 != this->intData.end(); ++_iter23) - { - xfer += oprot->writeI32((*_iter23)); - } - xfer += oprot->writeListEnd(); - } - xfer += oprot->writeFieldEnd(); + xfer += iprot->readStructBegin(fname); - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; + using apache::thrift::protocol::TProtocolException; + + while (true) { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == apache::thrift::protocol::T_LIST) { + { + this->floatData.clear(); + uint32_t _size24; + apache::thrift::protocol::TType _etype27; + iprot->readListBegin(_etype27, _size24); + this->floatData.resize(_size24); + uint32_t _i28; + for (_i28 = 0; _i28 < _size24; ++_i28) { + xfer += this->floatData[_i28].read(iprot); + } + iprot->readListEnd(); + } + this->__isset.floatData = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == apache::thrift::protocol::T_LIST) { + { + this->intData.clear(); + uint32_t _size29; + apache::thrift::protocol::TType _etype32; + iprot->readListBegin(_etype32, _size29); + this->intData.resize(_size29); + uint32_t _i33; + for (_i33 = 0; _i33 < _size29; ++_i33) { + xfer += this->intData[_i33].read(iprot); + } + iprot->readListEnd(); + } + this->__isset.intData = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == apache::thrift::protocol::T_LIST) { + { + this->longData.clear(); + uint32_t _size34; + apache::thrift::protocol::TType _etype37; + iprot->readListBegin(_etype37, _size34); + this->longData.resize(_size34); + uint32_t _i38; + for (_i38 = 0; _i38 < _size34; ++_i38) { + xfer += this->longData[_i38].read(iprot); + } + iprot->readListEnd(); + } + this->__isset.longData = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->size); + this->__isset.size = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == apache::thrift::protocol::T_LIST) { + { + this->stringData.clear(); + uint32_t _size39; + apache::thrift::protocol::TType _etype42; + iprot->readListBegin(_etype42, _size39); + this->stringData.resize(_size39); + uint32_t _i43; + for (_i43 = 0; _i43 < _size39; ++_i43) { + xfer += this->stringData[_i43].read(iprot); + } + iprot->readListEnd(); + } + this->__isset.stringData = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; } -void swap(com_raytheon_uf_common_pointdata_elements_IntPointDataObject &a, com_raytheon_uf_common_pointdata_elements_IntPointDataObject &b) { - using ::std::swap; - swap(a.description, b.description); - swap(a.dimensions, b.dimensions); - swap(a.intData, b.intData); - swap(a.__isset, b.__isset); +uint32_t com_raytheon_uf_common_pointdata_PointDataThriftContainer::write( + apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin( + "com_raytheon_uf_common_pointdata_PointDataThriftContainer"); + xfer += oprot->writeFieldBegin("floatData", + apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(apache::thrift::protocol::T_STRUCT, + this->floatData.size()); + std::vector< + com_raytheon_uf_common_pointdata_elements_FloatPointDataObject>::const_iterator + _iter44; + for (_iter44 = this->floatData.begin(); _iter44 + != this->floatData.end(); ++_iter44) { + xfer += (*_iter44).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("intData", apache::thrift::protocol::T_LIST, + 2); + { + xfer += oprot->writeListBegin(apache::thrift::protocol::T_STRUCT, + this->intData.size()); + std::vector< + com_raytheon_uf_common_pointdata_elements_IntPointDataObject>::const_iterator + _iter45; + for (_iter45 = this->intData.begin(); _iter45 != this->intData.end(); ++_iter45) { + xfer += (*_iter45).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("longData", + apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(apache::thrift::protocol::T_STRUCT, + this->longData.size()); + std::vector< + com_raytheon_uf_common_pointdata_elements_LongPointDataObject>::const_iterator + _iter46; + for (_iter46 = this->longData.begin(); _iter46 != this->longData.end(); ++_iter46) { + xfer += (*_iter46).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("size", apache::thrift::protocol::T_I32, 4); + xfer += oprot->writeI32(this->size); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("stringData", + apache::thrift::protocol::T_LIST, 5); + { + xfer += oprot->writeListBegin(apache::thrift::protocol::T_STRUCT, + this->stringData.size()); + std::vector< + com_raytheon_uf_common_pointdata_elements_StringPointDataObject>::const_iterator + _iter47; + for (_iter47 = this->stringData.begin(); _iter47 + != this->stringData.end(); ++_iter47) { + xfer += (*_iter47).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; } -const char* com_raytheon_uf_common_pointdata_elements_LongPointDataObject::ascii_fingerprint = "135921A65C05459AFDDA382E27DDA225"; -const uint8_t com_raytheon_uf_common_pointdata_elements_LongPointDataObject::binary_fingerprint[16] = {0x13,0x59,0x21,0xA6,0x5C,0x05,0x45,0x9A,0xFD,0xDA,0x38,0x2E,0x27,0xDD,0xA2,0x25}; +const char + * com_raytheon_uf_common_pointdata_PointDataRequestMessageConstraint::ascii_fingerprint = + "3368C2F81F2FEF71F11EDACDB2A3ECEF"; +const uint8_t + com_raytheon_uf_common_pointdata_PointDataRequestMessageConstraint::binary_fingerprint[16] = { + 0x33, 0x68, 0xC2, 0xF8, 0x1F, 0x2F, 0xEF, 0x71, 0xF1, 0x1E, + 0xDA, 0xCD, 0xB2, 0xA3, 0xEC, 0xEF }; -uint32_t com_raytheon_uf_common_pointdata_elements_LongPointDataObject::read(::apache::thrift::protocol::TProtocol* iprot) { +uint32_t com_raytheon_uf_common_pointdata_PointDataRequestMessageConstraint::read( + apache::thrift::protocol::TProtocol* iprot) { - uint32_t xfer = 0; - std::string fname; - ::apache::thrift::protocol::TType ftype; - int16_t fid; + uint32_t xfer = 0; + std::string fname; + apache::thrift::protocol::TType ftype; + int16_t fid; - xfer += iprot->readStructBegin(fname); + xfer += iprot->readStructBegin(fname); - using ::apache::thrift::protocol::TProtocolException; + using apache::thrift::protocol::TProtocolException; + while (true) { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->constraintType); + this->__isset.constraintType = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->parameter); + this->__isset.parameter = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->value); + this->__isset.value = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } - while (true) - { - xfer += iprot->readFieldBegin(fname, ftype, fid); - if (ftype == ::apache::thrift::protocol::T_STOP) { - break; - } - switch (fid) - { - case 1: - if (ftype == ::apache::thrift::protocol::T_STRUCT) { - xfer += this->description.read(iprot); - this->__isset.description = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 2: - if (ftype == ::apache::thrift::protocol::T_I32) { - xfer += iprot->readI32(this->dimensions); - this->__isset.dimensions = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 3: - if (ftype == ::apache::thrift::protocol::T_LIST) { - { - this->longData.clear(); - uint32_t _size24; - ::apache::thrift::protocol::TType _etype27; - xfer += iprot->readListBegin(_etype27, _size24); - this->longData.resize(_size24); - uint32_t _i28; - for (_i28 = 0; _i28 < _size24; ++_i28) - { - xfer += iprot->readI64(this->longData[_i28]); - } - xfer += iprot->readListEnd(); - } - this->__isset.longData = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } + xfer += iprot->readStructEnd(); - xfer += iprot->readStructEnd(); - - return xfer; + return xfer; } -uint32_t com_raytheon_uf_common_pointdata_elements_LongPointDataObject::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - xfer += oprot->writeStructBegin("com_raytheon_uf_common_pointdata_elements_LongPointDataObject"); - - xfer += oprot->writeFieldBegin("description", ::apache::thrift::protocol::T_STRUCT, 1); - xfer += this->description.write(oprot); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldBegin("dimensions", ::apache::thrift::protocol::T_I32, 2); - xfer += oprot->writeI32(this->dimensions); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldBegin("longData", ::apache::thrift::protocol::T_LIST, 3); - { - xfer += oprot->writeListBegin(::apache::thrift::protocol::T_I64, static_cast(this->longData.size())); - std::vector ::const_iterator _iter29; - for (_iter29 = this->longData.begin(); _iter29 != this->longData.end(); ++_iter29) - { - xfer += oprot->writeI64((*_iter29)); - } - xfer += oprot->writeListEnd(); - } - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; +uint32_t com_raytheon_uf_common_pointdata_PointDataRequestMessageConstraint::write( + apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer + += oprot->writeStructBegin( + "com_raytheon_uf_common_pointdata_PointDataRequestMessageConstraint"); + xfer += oprot->writeFieldBegin("constraintType", + apache::thrift::protocol::T_I32, 1); + xfer += oprot->writeI32(this->constraintType); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("parameter", + apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->parameter); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("value", apache::thrift::protocol::T_STRING, + 3); + xfer += oprot->writeString(this->value); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; } -void swap(com_raytheon_uf_common_pointdata_elements_LongPointDataObject &a, com_raytheon_uf_common_pointdata_elements_LongPointDataObject &b) { - using ::std::swap; - swap(a.description, b.description); - swap(a.dimensions, b.dimensions); - swap(a.longData, b.longData); - swap(a.__isset, b.__isset); +const char + * com_raytheon_uf_common_pointdata_PointDataRequestMessage::ascii_fingerprint = + "781EA3AAB5B079D92C9DA7774B669520"; +const uint8_t + com_raytheon_uf_common_pointdata_PointDataRequestMessage::binary_fingerprint[16] = { + 0x78, 0x1E, 0xA3, 0xAA, 0xB5, 0xB0, 0x79, 0xD9, 0x2C, 0x9D, + 0xA7, 0x77, 0x4B, 0x66, 0x95, 0x20 }; + +uint32_t com_raytheon_uf_common_pointdata_PointDataRequestMessage::read( + apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using apache::thrift::protocol::TProtocolException; + + while (true) { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->allLevels); + this->__isset.allLevels = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == apache::thrift::protocol::T_LIST) { + { + this->constraints.clear(); + uint32_t _size48; + apache::thrift::protocol::TType _etype51; + iprot->readListBegin(_etype51, _size48); + this->constraints.resize(_size48); + uint32_t _i52; + for (_i52 = 0; _i52 < _size48; ++_i52) { + xfer += this->constraints[_i52].read(iprot); + } + iprot->readListEnd(); + } + this->__isset.constraints = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->levelParameter); + this->__isset.levelParameter = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == apache::thrift::protocol::T_LIST) { + { + this->levelValue.clear(); + uint32_t _size53; + apache::thrift::protocol::TType _etype56; + iprot->readListBegin(_etype56, _size53); + this->levelValue.resize(_size53); + uint32_t _i57; + for (_i57 = 0; _i57 < _size53; ++_i57) { + xfer += iprot->readDouble(this->levelValue[_i57]); + } + iprot->readListEnd(); + } + this->__isset.levelValue = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == apache::thrift::protocol::T_LIST) { + { + this->parameters.clear(); + uint32_t _size58; + apache::thrift::protocol::TType _etype61; + iprot->readListBegin(_etype61, _size58); + this->parameters.resize(_size58); + uint32_t _i62; + for (_i62 = 0; _i62 < _size58; ++_i62) { + xfer += iprot->readString(this->parameters[_i62]); + } + iprot->readListEnd(); + } + this->__isset.parameters = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->pluginName); + this->__isset.pluginName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; } -const char* com_raytheon_uf_common_pointdata_PointDataThriftContainer::ascii_fingerprint = "8E622421D449B7CCD34FF11BE324DA19"; -const uint8_t com_raytheon_uf_common_pointdata_PointDataThriftContainer::binary_fingerprint[16] = {0x8E,0x62,0x24,0x21,0xD4,0x49,0xB7,0xCC,0xD3,0x4F,0xF1,0x1B,0xE3,0x24,0xDA,0x19}; - -uint32_t com_raytheon_uf_common_pointdata_PointDataThriftContainer::read(::apache::thrift::protocol::TProtocol* iprot) { - - uint32_t xfer = 0; - std::string fname; - ::apache::thrift::protocol::TType ftype; - int16_t fid; - - xfer += iprot->readStructBegin(fname); - - using ::apache::thrift::protocol::TProtocolException; - - - while (true) - { - xfer += iprot->readFieldBegin(fname, ftype, fid); - if (ftype == ::apache::thrift::protocol::T_STOP) { - break; - } - switch (fid) - { - case 1: - if (ftype == ::apache::thrift::protocol::T_LIST) { - { - this->floatData.clear(); - uint32_t _size30; - ::apache::thrift::protocol::TType _etype33; - xfer += iprot->readListBegin(_etype33, _size30); - this->floatData.resize(_size30); - uint32_t _i34; - for (_i34 = 0; _i34 < _size30; ++_i34) - { - xfer += this->floatData[_i34].read(iprot); - } - xfer += iprot->readListEnd(); - } - this->__isset.floatData = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 2: - if (ftype == ::apache::thrift::protocol::T_LIST) { - { - this->intData.clear(); - uint32_t _size35; - ::apache::thrift::protocol::TType _etype38; - xfer += iprot->readListBegin(_etype38, _size35); - this->intData.resize(_size35); - uint32_t _i39; - for (_i39 = 0; _i39 < _size35; ++_i39) - { - xfer += this->intData[_i39].read(iprot); - } - xfer += iprot->readListEnd(); - } - this->__isset.intData = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 3: - if (ftype == ::apache::thrift::protocol::T_LIST) { - { - this->longData.clear(); - uint32_t _size40; - ::apache::thrift::protocol::TType _etype43; - xfer += iprot->readListBegin(_etype43, _size40); - this->longData.resize(_size40); - uint32_t _i44; - for (_i44 = 0; _i44 < _size40; ++_i44) - { - xfer += this->longData[_i44].read(iprot); - } - xfer += iprot->readListEnd(); - } - this->__isset.longData = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 4: - if (ftype == ::apache::thrift::protocol::T_I32) { - xfer += iprot->readI32(this->size); - this->__isset.size = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 5: - if (ftype == ::apache::thrift::protocol::T_LIST) { - { - this->stringData.clear(); - uint32_t _size45; - ::apache::thrift::protocol::TType _etype48; - xfer += iprot->readListBegin(_etype48, _size45); - this->stringData.resize(_size45); - uint32_t _i49; - for (_i49 = 0; _i49 < _size45; ++_i49) - { - xfer += this->stringData[_i49].read(iprot); - } - xfer += iprot->readListEnd(); - } - this->__isset.stringData = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - return xfer; +uint32_t com_raytheon_uf_common_pointdata_PointDataRequestMessage::write( + apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin( + "com_raytheon_uf_common_pointdata_PointDataRequestMessage"); + xfer += oprot->writeFieldBegin("allLevels", + apache::thrift::protocol::T_BOOL, 1); + xfer += oprot->writeBool(this->allLevels); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("constraints", + apache::thrift::protocol::T_LIST, 2); + { + xfer += oprot->writeListBegin(apache::thrift::protocol::T_STRUCT, + this->constraints.size()); + std::vector< + com_raytheon_uf_common_pointdata_PointDataRequestMessageConstraint>::const_iterator + _iter63; + for (_iter63 = this->constraints.begin(); _iter63 + != this->constraints.end(); ++_iter63) { + xfer += (*_iter63).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("levelParameter", + apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->levelParameter); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("levelValue", + apache::thrift::protocol::T_LIST, 4); + { + xfer += oprot->writeListBegin(apache::thrift::protocol::T_DOUBLE, + this->levelValue.size()); + std::vector::const_iterator _iter64; + for (_iter64 = this->levelValue.begin(); _iter64 + != this->levelValue.end(); ++_iter64) { + xfer += oprot->writeDouble((*_iter64)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("parameters", + apache::thrift::protocol::T_LIST, 5); + { + xfer += oprot->writeListBegin(apache::thrift::protocol::T_STRING, + this->parameters.size()); + std::vector::const_iterator _iter65; + for (_iter65 = this->parameters.begin(); _iter65 + != this->parameters.end(); ++_iter65) { + xfer += oprot->writeString((*_iter65)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("pluginName", + apache::thrift::protocol::T_STRING, 6); + xfer += oprot->writeString(this->pluginName); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; } -uint32_t com_raytheon_uf_common_pointdata_PointDataThriftContainer::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - xfer += oprot->writeStructBegin("com_raytheon_uf_common_pointdata_PointDataThriftContainer"); - - xfer += oprot->writeFieldBegin("floatData", ::apache::thrift::protocol::T_LIST, 1); - { - xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->floatData.size())); - std::vector ::const_iterator _iter50; - for (_iter50 = this->floatData.begin(); _iter50 != this->floatData.end(); ++_iter50) - { - xfer += (*_iter50).write(oprot); - } - xfer += oprot->writeListEnd(); - } - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldBegin("intData", ::apache::thrift::protocol::T_LIST, 2); - { - xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->intData.size())); - std::vector ::const_iterator _iter51; - for (_iter51 = this->intData.begin(); _iter51 != this->intData.end(); ++_iter51) - { - xfer += (*_iter51).write(oprot); - } - xfer += oprot->writeListEnd(); - } - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldBegin("longData", ::apache::thrift::protocol::T_LIST, 3); - { - xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->longData.size())); - std::vector ::const_iterator _iter52; - for (_iter52 = this->longData.begin(); _iter52 != this->longData.end(); ++_iter52) - { - xfer += (*_iter52).write(oprot); - } - xfer += oprot->writeListEnd(); - } - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldBegin("size", ::apache::thrift::protocol::T_I32, 4); - xfer += oprot->writeI32(this->size); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldBegin("stringData", ::apache::thrift::protocol::T_LIST, 5); - { - xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->stringData.size())); - std::vector ::const_iterator _iter53; - for (_iter53 = this->stringData.begin(); _iter53 != this->stringData.end(); ++_iter53) - { - xfer += (*_iter53).write(oprot); - } - xfer += oprot->writeListEnd(); - } - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(com_raytheon_uf_common_pointdata_PointDataThriftContainer &a, com_raytheon_uf_common_pointdata_PointDataThriftContainer &b) { - using ::std::swap; - swap(a.floatData, b.floatData); - swap(a.intData, b.intData); - swap(a.longData, b.longData); - swap(a.size, b.size); - swap(a.stringData, b.stringData); - swap(a.__isset, b.__isset); -} - -const char* com_raytheon_uf_common_pointdata_PointDataRequestMessageConstraint::ascii_fingerprint = "3368C2F81F2FEF71F11EDACDB2A3ECEF"; -const uint8_t com_raytheon_uf_common_pointdata_PointDataRequestMessageConstraint::binary_fingerprint[16] = {0x33,0x68,0xC2,0xF8,0x1F,0x2F,0xEF,0x71,0xF1,0x1E,0xDA,0xCD,0xB2,0xA3,0xEC,0xEF}; - -uint32_t com_raytheon_uf_common_pointdata_PointDataRequestMessageConstraint::read(::apache::thrift::protocol::TProtocol* iprot) { - - uint32_t xfer = 0; - std::string fname; - ::apache::thrift::protocol::TType ftype; - int16_t fid; - - xfer += iprot->readStructBegin(fname); - - using ::apache::thrift::protocol::TProtocolException; - - - while (true) - { - xfer += iprot->readFieldBegin(fname, ftype, fid); - if (ftype == ::apache::thrift::protocol::T_STOP) { - break; - } - switch (fid) - { - case 1: - if (ftype == ::apache::thrift::protocol::T_I32) { - xfer += iprot->readI32(this->constraintType); - this->__isset.constraintType = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 2: - if (ftype == ::apache::thrift::protocol::T_STRING) { - xfer += iprot->readString(this->parameter); - this->__isset.parameter = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 3: - if (ftype == ::apache::thrift::protocol::T_STRING) { - xfer += iprot->readString(this->value); - this->__isset.value = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - return xfer; -} - -uint32_t com_raytheon_uf_common_pointdata_PointDataRequestMessageConstraint::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - xfer += oprot->writeStructBegin("com_raytheon_uf_common_pointdata_PointDataRequestMessageConstraint"); - - xfer += oprot->writeFieldBegin("constraintType", ::apache::thrift::protocol::T_I32, 1); - xfer += oprot->writeI32(this->constraintType); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldBegin("parameter", ::apache::thrift::protocol::T_STRING, 2); - xfer += oprot->writeString(this->parameter); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldBegin("value", ::apache::thrift::protocol::T_STRING, 3); - xfer += oprot->writeString(this->value); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(com_raytheon_uf_common_pointdata_PointDataRequestMessageConstraint &a, com_raytheon_uf_common_pointdata_PointDataRequestMessageConstraint &b) { - using ::std::swap; - swap(a.constraintType, b.constraintType); - swap(a.parameter, b.parameter); - swap(a.value, b.value); - swap(a.__isset, b.__isset); -} - -const char* com_raytheon_uf_common_pointdata_PointDataRequestMessage::ascii_fingerprint = "781EA3AAB5B079D92C9DA7774B669520"; -const uint8_t com_raytheon_uf_common_pointdata_PointDataRequestMessage::binary_fingerprint[16] = {0x78,0x1E,0xA3,0xAA,0xB5,0xB0,0x79,0xD9,0x2C,0x9D,0xA7,0x77,0x4B,0x66,0x95,0x20}; - -uint32_t com_raytheon_uf_common_pointdata_PointDataRequestMessage::read(::apache::thrift::protocol::TProtocol* iprot) { - - uint32_t xfer = 0; - std::string fname; - ::apache::thrift::protocol::TType ftype; - int16_t fid; - - xfer += iprot->readStructBegin(fname); - - using ::apache::thrift::protocol::TProtocolException; - - - while (true) - { - xfer += iprot->readFieldBegin(fname, ftype, fid); - if (ftype == ::apache::thrift::protocol::T_STOP) { - break; - } - switch (fid) - { - case 1: - if (ftype == ::apache::thrift::protocol::T_BOOL) { - xfer += iprot->readBool(this->allLevels); - this->__isset.allLevels = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 2: - if (ftype == ::apache::thrift::protocol::T_LIST) { - { - this->constraints.clear(); - uint32_t _size54; - ::apache::thrift::protocol::TType _etype57; - xfer += iprot->readListBegin(_etype57, _size54); - this->constraints.resize(_size54); - uint32_t _i58; - for (_i58 = 0; _i58 < _size54; ++_i58) - { - xfer += this->constraints[_i58].read(iprot); - } - xfer += iprot->readListEnd(); - } - this->__isset.constraints = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 3: - if (ftype == ::apache::thrift::protocol::T_STRING) { - xfer += iprot->readString(this->levelParameter); - this->__isset.levelParameter = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 4: - if (ftype == ::apache::thrift::protocol::T_LIST) { - { - this->levelValue.clear(); - uint32_t _size59; - ::apache::thrift::protocol::TType _etype62; - xfer += iprot->readListBegin(_etype62, _size59); - this->levelValue.resize(_size59); - uint32_t _i63; - for (_i63 = 0; _i63 < _size59; ++_i63) - { - xfer += iprot->readDouble(this->levelValue[_i63]); - } - xfer += iprot->readListEnd(); - } - this->__isset.levelValue = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 5: - if (ftype == ::apache::thrift::protocol::T_LIST) { - { - this->parameters.clear(); - uint32_t _size64; - ::apache::thrift::protocol::TType _etype67; - xfer += iprot->readListBegin(_etype67, _size64); - this->parameters.resize(_size64); - uint32_t _i68; - for (_i68 = 0; _i68 < _size64; ++_i68) - { - xfer += iprot->readString(this->parameters[_i68]); - } - xfer += iprot->readListEnd(); - } - this->__isset.parameters = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 6: - if (ftype == ::apache::thrift::protocol::T_STRING) { - xfer += iprot->readString(this->pluginName); - this->__isset.pluginName = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - return xfer; -} - -uint32_t com_raytheon_uf_common_pointdata_PointDataRequestMessage::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - xfer += oprot->writeStructBegin("com_raytheon_uf_common_pointdata_PointDataRequestMessage"); - - xfer += oprot->writeFieldBegin("allLevels", ::apache::thrift::protocol::T_BOOL, 1); - xfer += oprot->writeBool(this->allLevels); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldBegin("constraints", ::apache::thrift::protocol::T_LIST, 2); - { - xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->constraints.size())); - std::vector ::const_iterator _iter69; - for (_iter69 = this->constraints.begin(); _iter69 != this->constraints.end(); ++_iter69) - { - xfer += (*_iter69).write(oprot); - } - xfer += oprot->writeListEnd(); - } - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldBegin("levelParameter", ::apache::thrift::protocol::T_STRING, 3); - xfer += oprot->writeString(this->levelParameter); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldBegin("levelValue", ::apache::thrift::protocol::T_LIST, 4); - { - xfer += oprot->writeListBegin(::apache::thrift::protocol::T_DOUBLE, static_cast(this->levelValue.size())); - std::vector ::const_iterator _iter70; - for (_iter70 = this->levelValue.begin(); _iter70 != this->levelValue.end(); ++_iter70) - { - xfer += oprot->writeDouble((*_iter70)); - } - xfer += oprot->writeListEnd(); - } - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldBegin("parameters", ::apache::thrift::protocol::T_LIST, 5); - { - xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->parameters.size())); - std::vector ::const_iterator _iter71; - for (_iter71 = this->parameters.begin(); _iter71 != this->parameters.end(); ++_iter71) - { - xfer += oprot->writeString((*_iter71)); - } - xfer += oprot->writeListEnd(); - } - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldBegin("pluginName", ::apache::thrift::protocol::T_STRING, 6); - xfer += oprot->writeString(this->pluginName); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(com_raytheon_uf_common_pointdata_PointDataRequestMessage &a, com_raytheon_uf_common_pointdata_PointDataRequestMessage &b) { - using ::std::swap; - swap(a.allLevels, b.allLevels); - swap(a.constraints, b.constraints); - swap(a.levelParameter, b.levelParameter); - swap(a.levelValue, b.levelValue); - swap(a.parameters, b.parameters); - swap(a.pluginName, b.pluginName); - swap(a.__isset, b.__isset); -} - - From d175ff24fe019dce9a00fdddef1124a9e0d80c76 Mon Sep 17 00:00:00 2001 From: "Zhidong.Hao" Date: Wed, 23 Jul 2014 14:25:22 -0400 Subject: [PATCH 31/39] ASM #15645 - Fix for AvnFPS: TAF syntax check fails when equal sign is missing Change-Id: I1a4fb9be1253b4655bd43674aab4a4ddcf6d0ce7 Former-commit-id: e085f07dd5691a34f1b83b7ac28d5ba0970ae73c [formerly d7cce22d02d6cef699ebc088886b756e416c2b78] [formerly 26c4bb2414b3828dd163fb20270ddd4b4cfbc83f] [formerly e085f07dd5691a34f1b83b7ac28d5ba0970ae73c [formerly d7cce22d02d6cef699ebc088886b756e416c2b78] [formerly 26c4bb2414b3828dd163fb20270ddd4b4cfbc83f] [formerly a3cda853cf781290c66bf1664aeb2c97e3fd1ebd [formerly 26c4bb2414b3828dd163fb20270ddd4b4cfbc83f [formerly 192948e00538bcf0dfc0aaf20ea1dcb216313ffb]]]] Former-commit-id: a3cda853cf781290c66bf1664aeb2c97e3fd1ebd Former-commit-id: ee0ea4eda554da6bb2967a1950ac393aec22f255 [formerly ee2f893d217a92c1adc89144a157ec7a6d1402bc] [formerly b530a83b93588b9662a433efcc257682d01b21cd [formerly eef5191d1c43d97afd3dead6baf176ab0e06859c]] Former-commit-id: 0eeed145c6b36d143e71cb6efb8b8fab5b1ff3a9 [formerly 350028e06965e2d29a1690a4150de4f4103fef05] Former-commit-id: 2a4ea1243cb8e35dc84cbc291c59b347903d544d --- .../aviation/editor/TafViewerEditorDlg.java | 97 ++++++++----------- 1 file changed, 39 insertions(+), 58 deletions(-) diff --git a/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/editor/TafViewerEditorDlg.java b/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/editor/TafViewerEditorDlg.java index ad97eb88c4..59d2cfa47e 100644 --- a/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/editor/TafViewerEditorDlg.java +++ b/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/editor/TafViewerEditorDlg.java @@ -235,6 +235,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback; * 02/19/2014 16980 zhao add code to ensure the Alt flag is false after the Alt kay is released * 09Apr2014 #3005 lvenable Added calls to mark the tabs as not current when the tabs are changed. * This will show the tab as updating in the header and data text controls. + * 07/23/2014 15645 zhao modified checkBasicSyntaxError() * * * @@ -2109,19 +2110,29 @@ public class TafViewerEditorDlg extends CaveSWTDialog implements ITafSettable, return editorComp; } - /** + /** + * Check if there is an extra '=' sign in a TAF * * @param doLogMessage * @return true if error found, otherwise false */ private boolean checkBasicSyntaxError(boolean doLogMessage) { + boolean errorFound = false; + String in = editorTafTabComp.getTextEditorControl().getText(); clearSyntaxErrorLevel(); st = editorTafTabComp.getTextEditorControl(); + in = in.toUpperCase().replaceAll("TAF", "\n\nTAF").trim(); + while ( in.contains("\n\n\n") ) { + in = in.replace("\n\n\n", "\n\n"); + } + + st.setText(in); + final Map syntaxMap = new HashMap(); st.addMouseTrackListener(new MouseTrackAdapter() { @@ -2153,66 +2164,36 @@ public class TafViewerEditorDlg extends CaveSWTDialog implements ITafSettable, } }); - int tafIndex = in.indexOf("TAF"); - int equalSignIndex = in.indexOf("="); - int lastEqualSignIndex = equalSignIndex; - - if (tafIndex < 0 && equalSignIndex < 0) { // empty TAF - return false; - } - - while (tafIndex > -1 || equalSignIndex > -1) { - - if (tafIndex == -1 || tafIndex > equalSignIndex) { - - int lineIndexOfFirstEqualSign = st - .getLineAtOffset(lastEqualSignIndex); - int lineIndexOfSecondEqualSign = st - .getLineAtOffset(equalSignIndex); - if (lineIndexOfFirstEqualSign == lineIndexOfSecondEqualSign) { - StyleRange sr = new StyleRange(lastEqualSignIndex, 1, null, - qcColors[3]); - String msg = "Syntax error: there is an extra '=' sign in this line"; - syntaxMap.put(sr, msg); - st.setStyleRange(null); - st.setStyleRange(sr); - if (doLogMessage) { - msgStatComp.setMessageText(msg, qcColors[3].getRGB()); - } - return true; - } - - int startIndex = lastEqualSignIndex; - - while (!in.substring(startIndex, startIndex + 1).matches( - "[A-Z]") - && !in.substring(startIndex, startIndex + 1).matches( - "[0-9]")) { - startIndex++; - } - int length = 6; - if ((equalSignIndex - startIndex) < 6) { - length = equalSignIndex - startIndex; - } - StyleRange sr = new StyleRange(startIndex, length, null, - qcColors[3]); - String msg = "Syntax error: There is an extra '=' sign before this point, or 'TAF' is missing at beginning of TAF"; - syntaxMap.put(sr, msg); - st.setStyleRange(null); - st.setStyleRange(sr); - if (doLogMessage) { - msgStatComp.setMessageText(msg, qcColors[3].getRGB()); - } - - return true; + String msg = "Syntax error: There is an extra '=' sign or 'TAF' is missing at beginning of TAF"; + String[] tafs = in.split("\n\n"); + int tafStartIndex = 0; + for ( String taf : tafs ) { + int firstEqualSignIndex = taf.indexOf('='); + if ( firstEqualSignIndex == -1 ) { + tafStartIndex += taf.length() + 2; + continue; } - - tafIndex = in.indexOf("TAF", tafIndex + 1); - lastEqualSignIndex = equalSignIndex; - equalSignIndex = in.indexOf("=", equalSignIndex + 1); + int secondEqualSignIndex = taf.indexOf('=', firstEqualSignIndex+1); + if ( secondEqualSignIndex == -1 ) { + tafStartIndex += taf.length() + 2; + continue; + } + while ( secondEqualSignIndex > -1 ) { + int secondEqualSignIndexInEditorText = tafStartIndex + secondEqualSignIndex; + StyleRange sr = new StyleRange(secondEqualSignIndexInEditorText, 1, null, qcColors[3]); + syntaxMap.put(sr, msg); + st.setStyleRange(sr); + secondEqualSignIndex = taf.indexOf('=', secondEqualSignIndex+1); + } + errorFound = true; + tafStartIndex += taf.length() + 2; } - return false; + if ( doLogMessage ) { + msgStatComp.setMessageText(msg, qcColors[3].getRGB()); + } + + return errorFound; } private void syntaxCheck() { From 2f327c8d03349161f09782b34e7713df77b8e3e6 Mon Sep 17 00:00:00 2001 From: Ron Anderson Date: Thu, 24 Jul 2014 14:02:10 -0500 Subject: [PATCH 32/39] Issue #3423 Move alarm/alert product requests off UI thread Change-Id: I44149b5af54fbeac75231d6caeb3929fbf6ecf5e Former-commit-id: be5794d46482809de0f3302906416ab6e44632c3 [formerly ac0799ce35f67068bcf837610b5bbad1abbd67c8] [formerly 17b681f3559957c6e260bc0aaef9bcd8d0b01be8] [formerly be5794d46482809de0f3302906416ab6e44632c3 [formerly ac0799ce35f67068bcf837610b5bbad1abbd67c8] [formerly 17b681f3559957c6e260bc0aaef9bcd8d0b01be8] [formerly 174d8b59e0c8e8c8fc94bf2f7743e7966d143228 [formerly 17b681f3559957c6e260bc0aaef9bcd8d0b01be8 [formerly c3401cee78edae8dea6d21736fac25bfed996fb3]]]] Former-commit-id: 174d8b59e0c8e8c8fc94bf2f7743e7966d143228 Former-commit-id: 4195c36f08a92bc5f15204da38c211515a4a7fbf [formerly 3da914cf978c67d175e522caac9d049fc15cf409] [formerly f037b9fe395c757a1cf7c40690b05cf533498d43 [formerly 64ba8b1c1aeb5afe87acc377e899a0d5cc6f4e48]] Former-commit-id: d640dce651f9095068c4d3a337094bc506763e2a [formerly 243decf32238c1ebb274533862a42e932987b653] Former-commit-id: e9b0d50ee94c29597329189dcb05d762670846a3 --- .../dialogs/AlarmDisplayWindow.java | 17 +- .../alarmalert/dialogs/CurrentAlarmQueue.java | 246 +++++++++++------- .../alarmalert/util/AlarmAlertFunctions.java | 17 +- .../util/AlarmAlertNotificationObserver.java | 9 +- 4 files changed, 181 insertions(+), 108 deletions(-) diff --git a/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/alarmalert/dialogs/AlarmDisplayWindow.java b/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/alarmalert/dialogs/AlarmDisplayWindow.java index 1bd1acdfdd..c9f80f5071 100644 --- a/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/alarmalert/dialogs/AlarmDisplayWindow.java +++ b/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/alarmalert/dialogs/AlarmDisplayWindow.java @@ -62,6 +62,8 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog; * Sep 6, 2012 13365 rferrel Accumulate and Display fix. * Sep 25, 2012 1196 lvenable Dialog refactor for AlarmDisplayWindow.Added DO_NOT_BLOCK. * Nov 20, 2013 2488 randerso Changed to use DejaVu font + * Jul 24, 2014 3423 randerso Added setLoading() to indicate waiting on product + * retrieval. Removed prods from constructor. * * * @@ -100,19 +102,13 @@ public class AlarmDisplayWindow extends CaveSWTDialog { /** * @param parentShell - * @param prodList * @param accum_state */ - protected AlarmDisplayWindow(Shell parentShell, - java.util.List prodList, - ACCUMULATE_STATE accum_state) { + protected AlarmDisplayWindow(Shell parentShell, ACCUMULATE_STATE accum_state) { super(parentShell, SWT.RESIZE, CAVE.PERSPECTIVE_INDEPENDENT | CAVE.INDEPENDENT_SHELL | CAVE.DO_NOT_BLOCK); setText("Alarm Display Window"); - prods = prodList; - if (prods == null) { - prods = new ArrayList(); - } + prods = new ArrayList(0); this.accum_state = accum_state; } @@ -265,6 +261,11 @@ public class AlarmDisplayWindow extends CaveSWTDialog { populateText(); } + public void setLoading() { + actualText = text.getText(); + text.setText("Loading..."); + } + public void addText(String msg) { if (accumulate) { if (text.getText().isEmpty()) { diff --git a/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/alarmalert/dialogs/CurrentAlarmQueue.java b/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/alarmalert/dialogs/CurrentAlarmQueue.java index 31c0300df0..0d7dda8784 100644 --- a/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/alarmalert/dialogs/CurrentAlarmQueue.java +++ b/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/alarmalert/dialogs/CurrentAlarmQueue.java @@ -24,7 +24,13 @@ import java.util.ArrayList; import java.util.Date; import java.util.HashMap; import java.util.Map; +import java.util.Queue; +import java.util.concurrent.ConcurrentLinkedQueue; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.jobs.Job; import org.eclipse.swt.SWT; import org.eclipse.swt.events.ControlAdapter; import org.eclipse.swt.events.ControlEvent; @@ -52,7 +58,9 @@ import com.raytheon.uf.common.dataplugin.text.db.StdTextProduct; 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.util.Pair; import com.raytheon.uf.edex.services.textdbsrv.IQueryTransport; +import com.raytheon.uf.viz.core.VizApp; import com.raytheon.viz.core.mode.CAVEMode; import com.raytheon.viz.texteditor.alarmalert.dialogs.AlarmDisplayWindow.ACCUMULATE_STATE; import com.raytheon.viz.texteditor.alarmalert.util.AlarmAlertFunctions; @@ -97,8 +105,10 @@ import com.raytheon.viz.ui.dialogs.ModeListener; * Alarm Queue" GUI * Sep 6, 2012 13365 rferrel Accumulate and Display fix. * Sep 25, 2012 1196 lvenable Dialog refactor for AlarmDisplayWindow. - * Mar 05,2013 15173 mgamazaychikov The dimensions and location of closed window - * are saved and set on the next open. + * Mar 05, 2013 15173 mgamazaychikov The dimensions and location of closed window + * are saved and set on the next open. + * Jul 24, 2014 3423 randerso Created eclipse job to get afos command + * execution off the UI thread * * * @@ -142,7 +152,7 @@ public class CurrentAlarmQueue extends CaveSWTDialog implements * Location and dimensions of the dialog on the close. */ private static Point closeLocation = null; - + private static Point closeDimensions = null; /** @@ -151,14 +161,65 @@ public class CurrentAlarmQueue extends CaveSWTDialog implements private boolean canRedraw = true; /** - * Maximum width,initial height and offset of the window + * Maximum width,initial height and offset of the window */ private static final int SHELL_WIDTH = 350; - + private static final int INIT_HEIGHT = 200; - + private static final int INIT_OFFSET = 15; + /** + * Job to retrieve text products off the UI thread + */ + private class ProduceTextProductsJob extends Job { + private Queue> queue = new ConcurrentLinkedQueue>(); + + /** + * Constructor + */ + public ProduceTextProductsJob() { + super("ProduceTextProductsJob"); + setSystem(true); + } + + /** + * Queue a text product retrieval job + * + * @param refTime + * @param commands + */ + public void queue(Long refTime, String... commands) { + queue.add(new Pair(refTime, commands)); + this.schedule(); + } + + @Override + protected IStatus run(IProgressMonitor monitor) { + while (queue.size() > 0) { + Pair pair = queue.poll(); + if (pair != null) { + final java.util.List prods = produceTextProducts( + pair.getFirst(), pair.getSecond()); + + VizApp.runSync(new Runnable() { + + @Override + public void run() { + if (alarmDisplayDlg != null + && !alarmDisplayDlg.isDisposed()) { + alarmDisplayDlg.setProds(prods); + } + } + }); + } + } + return Status.OK_STATUS; + } + } + + private ProduceTextProductsJob produceTextProductsJob = new ProduceTextProductsJob(); + /** * @param parentShell * @param style @@ -261,12 +322,13 @@ public class CurrentAlarmQueue extends CaveSWTDialog implements shellComp = new Composite(shell, SWT.NONE); shellComp.setLayout(constructShellLayout()); shellComp.setLayoutData(gd); - + /* - * DR15173 - Create a listener to save the location - * and dimensions of closed window. + * DR15173 - Create a listener to save the location and dimensions of + * closed window. */ shell.addShellListener(new ShellAdapter() { + @Override public void shellClosed(ShellEvent event) { closeLocation = getShell().getLocation(); closeDimensions = getShell().getSize(); @@ -289,11 +351,13 @@ public class CurrentAlarmQueue extends CaveSWTDialog implements Display.getDefault().asyncExec(new Runnable() { @Override public void run() { - /* - * DR15173 - Enforce that the window width does not exceed the SHELL_WIDTH. - */ - shell.setBounds(location.x, location.y, SHELL_WIDTH, point.y); - shell.setMinimumSize(SHELL_WIDTH, 0); + /* + * DR15173 - Enforce that the window width does not + * exceed the SHELL_WIDTH. + */ + shell.setBounds(location.x, location.y, SHELL_WIDTH, + point.y); + shell.setMinimumSize(SHELL_WIDTH, 0); canRedraw = true; } }); @@ -302,7 +366,7 @@ public class CurrentAlarmQueue extends CaveSWTDialog implements // Initialize all of the controls and layouts initializeComponents(); - + // Set the shell location and dimensions. setShellGeometry(); } @@ -310,26 +374,25 @@ public class CurrentAlarmQueue extends CaveSWTDialog implements /** * Sets the geometry for the Current Alarm Queue shell */ - private void setShellGeometry() { - Rectangle displayArea = shell.getDisplay().getClientArea(); - int locationX = displayArea.x + INIT_OFFSET; - int locationY = displayArea.y + INIT_OFFSET; - int width = SHELL_WIDTH; - int height = INIT_HEIGHT; - if (CurrentAlarmQueue.closeLocation != null) { - locationX = CurrentAlarmQueue.closeLocation.x; - locationY = CurrentAlarmQueue.closeLocation.y; - } - if (CurrentAlarmQueue.closeDimensions != null) { - height = CurrentAlarmQueue.closeDimensions.y; - } - shell.setMinimumSize(width, height); - shell.setLocation(locationX, locationY); - return; - } + private void setShellGeometry() { + Rectangle displayArea = shell.getDisplay().getClientArea(); + int locationX = displayArea.x + INIT_OFFSET; + int locationY = displayArea.y + INIT_OFFSET; + int width = SHELL_WIDTH; + int height = INIT_HEIGHT; + if (CurrentAlarmQueue.closeLocation != null) { + locationX = CurrentAlarmQueue.closeLocation.x; + locationY = CurrentAlarmQueue.closeLocation.y; + } + if (CurrentAlarmQueue.closeDimensions != null) { + height = CurrentAlarmQueue.closeDimensions.y; + } + shell.setMinimumSize(width, height); + shell.setLocation(locationX, locationY); + return; + } - - /** + /** * Initializes each component of the shell */ private void initializeComponents() { @@ -421,7 +484,7 @@ public class CurrentAlarmQueue extends CaveSWTDialog implements * Display the selected product the current alarm queue list. */ private void displayList() { - String command = ""; + String command = null; Date refDate = null; if (list != null && list.getItemCount() > 0 && list.getSelectionCount() > 0 && list.getSelection() != null) { @@ -436,14 +499,9 @@ public class CurrentAlarmQueue extends CaveSWTDialog implements } } - java.util.List prods = null; - if (command != "" && refDate != null) { - prods = produceTextProduct(command, refDate.getTime()); - } - // Display the Alarm Display Window if (alarmDisplayDlg == null || alarmDisplayDlg.getShell().isDisposed()) { - alarmDisplayDlg = new AlarmDisplayWindow(shell, prods, + alarmDisplayDlg = new AlarmDisplayWindow(shell, ACCUMULATE_STATE.UNCHANGE); alarmDisplayDlg.setCloseCallback(new ICloseCallback() { @@ -458,58 +516,52 @@ public class CurrentAlarmQueue extends CaveSWTDialog implements alarmDisplayDlg.open(); } else { - alarmDisplayDlg.setProds(prods); alarmDisplayDlg.setDialogFocus(); } + + if (command != null && refDate != null) { + alarmDisplayDlg.setLoading(); + produceTextProductsJob.queue(refDate.getTime(), command); + } } /** * Display all the products in the alarm queue list and clear the list. */ private void displayAll() { - String[] command = null; - if (list != null) { - command = new String[list.getItemCount()]; - for (int i = 0; i < list.getItemCount(); i++) { - command[i] = list.getItems()[i].split(" ")[0]; - } - // Do a count of how many instances of each command are in - // the queue. - Map counter = new HashMap(); - for (int i = 0; i < command.length; ++i) { - if (counter.get(command[i]) == null) { - counter.put(command[i], 0); - } else { - counter.put(command[i], (counter.get(command[i]) + 1)); - } - } - // For each command, see how far back it needs to go to - // account for multiple instances, and construct the - // appropriate AFOS command. - for (int j = 0; j < command.length; ++j) { - Integer count = counter.get(command[j]); - if (count > 0) { - String newCom = "-" + count.toString() + ":" + command[j]; - counter.put(command[j], (count - 1)); - command[j] = newCom; - } - } - AlarmAlertLists.getInstance().getCurrentAlarms().clear(); - listDates.clear(); - list.removeAll(); - AlarmAlertFunctions.getAlarmalertbell().close(); + String[] command = new String[list.getItemCount()]; + for (int i = 0; i < list.getItemCount(); i++) { + command[i] = list.getItems()[i].split(" ")[0]; } - - java.util.List prods = new ArrayList(); - if (command.length > 0) { - for (int i = 0; i < command.length; i++) { - prods.addAll(produceTextProduct(command[i])); + // Do a count of how many instances of each command are in + // the queue. + Map counter = new HashMap(); + for (int i = 0; i < command.length; ++i) { + if (counter.get(command[i]) == null) { + counter.put(command[i], 0); + } else { + counter.put(command[i], (counter.get(command[i]) + 1)); } } + // For each command, see how far back it needs to go to + // account for multiple instances, and construct the + // appropriate AFOS command. + for (int j = 0; j < command.length; ++j) { + Integer count = counter.get(command[j]); + if (count > 0) { + String newCom = "-" + count.toString() + ":" + command[j]; + counter.put(command[j], (count - 1)); + command[j] = newCom; + } + } + AlarmAlertLists.getInstance().getCurrentAlarms().clear(); + listDates.clear(); + list.removeAll(); + AlarmAlertFunctions.getAlarmalertbell().close(); // Display the Alarm Display Window if (alarmDisplayDlg == null || alarmDisplayDlg.getShell().isDisposed()) { - alarmDisplayDlg = new AlarmDisplayWindow(shell, prods, + alarmDisplayDlg = new AlarmDisplayWindow(shell, ACCUMULATE_STATE.TRUE); alarmDisplayDlg.setCloseCallback(new ICloseCallback() { @Override @@ -523,10 +575,12 @@ public class CurrentAlarmQueue extends CaveSWTDialog implements }); alarmDisplayDlg.open(); } else { - alarmDisplayDlg.setProds(prods); alarmDisplayDlg.setAccumulate(true); alarmDisplayDlg.setDialogFocus(); } + + alarmDisplayDlg.setLoading(); + produceTextProductsJob.queue(null, command); } /** @@ -578,12 +632,6 @@ public class CurrentAlarmQueue extends CaveSWTDialog implements } } - public java.util.List produceTextProduct(String command) { - ICommand cmd = CommandFactory.getAfosCommand(command); - executeCommand(cmd); - return prodList; - } - /** * Get the product for the given AFOS command and reference time. * @@ -591,11 +639,16 @@ public class CurrentAlarmQueue extends CaveSWTDialog implements * @param refTime * @return prodList */ - private java.util.List produceTextProduct(String command, - Long refTime) { - ICommand cmd = CommandFactory.getAfosCommand(command, refTime); - executeCommand(cmd); - return prodList; + private java.util.List produceTextProducts(Long refTime, + String... commands) { + + java.util.List prods = new ArrayList(); + for (String command : commands) { + ICommand cmd = CommandFactory.getAfosCommand(command, refTime); + executeCommand(cmd); + prods.addAll(prodList); + } + return prods; } /* @@ -652,12 +705,19 @@ public class CurrentAlarmQueue extends CaveSWTDialog implements */ @Override public void currentAlarmChanged(CurrentAlarmEvent event) { - AlarmAlertProduct aap = (AlarmAlertProduct) event.getSource(); + final AlarmAlertProduct aap = (AlarmAlertProduct) event.getSource(); if (!shell.isDisposed() && shell != null) { CAVEMode mode = CAVEMode.getMode(); if ((CAVEMode.OPERATIONAL.equals(mode) || CAVEMode.TEST .equals(mode)) && aap.getOperationalMode()) { - addToQueue(aap.getProductId(), aap.getDateReceived()); + + VizApp.runAsync(new Runnable() { + + @Override + public void run() { + addToQueue(aap.getProductId(), aap.getDateReceived()); + } + }); } } } diff --git a/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/alarmalert/util/AlarmAlertFunctions.java b/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/alarmalert/util/AlarmAlertFunctions.java index 1579b620a1..fe2c6b2846 100644 --- a/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/alarmalert/util/AlarmAlertFunctions.java +++ b/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/alarmalert/util/AlarmAlertFunctions.java @@ -56,6 +56,7 @@ import com.raytheon.uf.common.localization.exception.LocalizationOpFailedExcepti 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.viz.core.VizApp; import com.raytheon.uf.viz.core.localization.LocalizationManager; import com.raytheon.viz.texteditor.alarmalert.dialogs.AlarmAlertBell; import com.raytheon.viz.texteditor.command.CommandFactory; @@ -79,6 +80,7 @@ import com.vividsolutions.jts.geom.GeometryFactory; * 03/19/2012 D. Friedman Fix determination of "Alarm" entries. * 12/07/2012 15555 m.gamazaychikov Added methods and constants for * the implementation of proximity alarm + * 07/24/2014 3423 randerso Ensure ringBell is called on UI thread * * * @@ -211,14 +213,16 @@ public class AlarmAlertFunctions { match = true; } if (match) { - if (productFound == null) + if (productFound == null) { productFound = p; + } if ("Alarm".equals(p.getAlarmType()) && p.isAlarm()) { alarm = true; productFound = p; } - if (alarm) + if (alarm) { break; + } } } } @@ -229,7 +233,14 @@ public class AlarmAlertFunctions { instance.getCurrentAlarms().add(prod); instance.fireNewCurrentAlarmEvent(prod); - ringBell(alarm); + final boolean sound = alarm; + VizApp.runAsync(new Runnable() { + + @Override + public void run() { + ringBell(sound); + } + }); } } } diff --git a/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/alarmalert/util/AlarmAlertNotificationObserver.java b/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/alarmalert/util/AlarmAlertNotificationObserver.java index 1a68290813..0a3b6e6c03 100644 --- a/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/alarmalert/util/AlarmAlertNotificationObserver.java +++ b/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/alarmalert/util/AlarmAlertNotificationObserver.java @@ -23,22 +23,22 @@ import com.raytheon.uf.common.dataplugin.text.alarms.AlarmAlertProduct; 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.viz.core.VizApp; import com.raytheon.uf.viz.core.notification.INotificationObserver; import com.raytheon.uf.viz.core.notification.NotificationMessage; import com.raytheon.uf.viz.core.notification.jobs.NotificationManagerJob; import com.raytheon.viz.core.mode.CAVEMode; /** - * TODO Add Description + * Alarm Alert Notification Observer * *
  * 
  * SOFTWARE HISTORY
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
- * Oct 13, 2009            mnash     Initial creation
+ * Oct 13, 2009            mnash       Initial creation
  * Jun 07, 2010 5851       cjeanbap    Properly stop alarm/alert observer listener.
+ * Jul 24, 2014 3423       randerso    Get afos command execution off the UI thread
  * 
  * 
* @@ -108,7 +108,8 @@ public class AlarmAlertNotificationObserver implements INotificationObserver { } if (run != null) { - VizApp.runAsync(run); + Thread thread = new Thread(run); + thread.start(); } } catch (Exception e) { statusHandler.handle(Priority.PROBLEM, From 593d722c22d7f78bf2aada593c400019e07f96a1 Mon Sep 17 00:00:00 2001 From: "Rici.Yu" Date: Mon, 28 Jul 2014 11:30:49 -0400 Subject: [PATCH 33/39] ASM #15655 - Negate raising exception for empty db from IFPDB() Change-Id: I5c96d654f3080a4b0f10113648f290a0d09961cb Former-commit-id: 9b78be1622ef41f629ef1a567c195afb9dbfd849 [formerly a75c0c2f15e2b0680b3a5ab77842232a0182b896] [formerly 9a1310d1acd303cc9a152ff87e68662227a9cdf0] [formerly 9b78be1622ef41f629ef1a567c195afb9dbfd849 [formerly a75c0c2f15e2b0680b3a5ab77842232a0182b896] [formerly 9a1310d1acd303cc9a152ff87e68662227a9cdf0] [formerly 661737fb39ea93fcb806094830834398ca7808c6 [formerly 9a1310d1acd303cc9a152ff87e68662227a9cdf0 [formerly 9af51efbef229984de09a5ad338885d54f720270]]]] Former-commit-id: 661737fb39ea93fcb806094830834398ca7808c6 Former-commit-id: e2b9936e38a3fd20db8c77ec465054ce961a03db [formerly bacd423e0ee0bffca269d811dff413f004c1b801] [formerly bfb83b4cc16a3ed2c99c3583195dd3cd54445b2e [formerly 60116edbcc838fd2d247425c83153bcd7bdfc8e8]] Former-commit-id: 41dcdd610046cb473cb5e7ead7c1e8f22535bb80 [formerly af5d129375731e9071e20bc24b60dd5be3e700cd] Former-commit-id: 53691c3cd32351f989b8128c3b463a5fa9c65514 --- .../src/com/raytheon/edex/plugin/gfe/smartinit/IFPDB.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/smartinit/IFPDB.java b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/smartinit/IFPDB.java index fb342d4aff..224a3b8e7e 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/smartinit/IFPDB.java +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/smartinit/IFPDB.java @@ -41,6 +41,7 @@ import com.raytheon.uf.common.dataplugin.gfe.server.message.ServerResponse; * ------------ ---------- ----------- -------------------------- * May 7, 2008 njensen Initial creation * Jun 13, 2013 #2044 randerso Refactored to use IFPServer + * Jul 28, 2014 RM 15655 ryu Negate raising exception for empty db in constructor * * * @@ -88,7 +89,6 @@ public class IFPDB { } } else { this.keys = Collections.emptyList(); - throw new GfeException(sr.message()); } } From 7f7869a810f8e9ef7440795e2318db66405d9930 Mon Sep 17 00:00:00 2001 From: "Qinglu.Lin" Date: Mon, 28 Jul 2014 12:36:07 -0400 Subject: [PATCH 34/39] ASM #15554 - Improve speed/efficiency of WarngenLayer.populateStrings Change-Id: I6a3b9823ac7c23ba171206708187ab3fc3c7c1ca Former-commit-id: 632ec498ffbf3353cb076110843906f9a852debe [formerly f69a06238bf3335337a7268e872a86d0a1b95e1d] [formerly 1eca5ef51a3e1714e17b77e0e1ae1ad7213ed35e] [formerly 632ec498ffbf3353cb076110843906f9a852debe [formerly f69a06238bf3335337a7268e872a86d0a1b95e1d] [formerly 1eca5ef51a3e1714e17b77e0e1ae1ad7213ed35e] [formerly 2aa16c114a52523e7ff08e45c06817597cc5022b [formerly 1eca5ef51a3e1714e17b77e0e1ae1ad7213ed35e [formerly 3b971d52a82099142fe08986df879a379dfa6314]]]] Former-commit-id: 2aa16c114a52523e7ff08e45c06817597cc5022b Former-commit-id: 3cdad48a5de8954b75b02e2c308d9c0331a7f60d [formerly 28842008ecb44bc705d06a44045d0f41da43150a] [formerly 0530943e480469d1125783c548c7f3e20af3002b [formerly 80c41d8904a94746fdd6567e3557e3ccec8318fc]] Former-commit-id: eb074bc63aab17207cd6f4a5ebca29b3dd524c6a [formerly b3b4c058aa656da6dcf55aa24e97de316c6d395d] Former-commit-id: 000daa27167b2541f4ecbcf3dbc6908970a7fb95 --- .../raytheon/viz/warngen/gis/PolygonUtil.java | 13 +- .../viz/warngen/gui/WarngenLayer.java | 205 +++++++++++------- 2 files changed, 141 insertions(+), 77 deletions(-) diff --git a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gis/PolygonUtil.java b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gis/PolygonUtil.java index 139ece3233..9943db6592 100644 --- a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gis/PolygonUtil.java +++ b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gis/PolygonUtil.java @@ -88,6 +88,7 @@ import com.vividsolutions.jts.precision.SimpleGeometryPrecisionReducer; * 05/16/2014 DR 17365 D. Friedman Prevent some Coordinate reuse. Add reducePrecision. * 06/27/2014 DR 17443 D. Friedman Fix some odd cases in which parts of a polygon not covering a * hatched area would be retained after redrawing. + * 07/22/2014 DR 17475 Qinglu Lin Updated createPolygonByPoints() and created second createPolygonByPoints(). * * * @author mschenke @@ -1718,11 +1719,11 @@ public class PolygonUtil { } return slope; } - + /** * Create a polygon whose two diagonal coordinates are a and b. **/ - static public Geometry createPolygonByPoints(Coordinate a, Coordinate b) { + static public Geometry createPolygonByPoints(GeometryFactory gf, Coordinate a, Coordinate b) { double maxX, minX, maxY, minY; maxX = Math.max(a.x, b.x); minX = Math.min(a.x, b.x); @@ -1734,10 +1735,14 @@ public class PolygonUtil { coord[2] = new Coordinate(maxX, maxY); coord[3] = new Coordinate(minX, maxY); coord[4] = new Coordinate(coord[0]); - GeometryFactory gf = new GeometryFactory(); LinearRing lr = gf.createLinearRing(coord); return gf.createPolygon(lr, null); - } + } + + static public Geometry createPolygonByPoints(GeometryFactory gf, Coordinate a, double shift) { + Coordinate b = new Coordinate(a.x + shift, a.y + shift); + return createPolygonByPoints(gf, a, b); + } /** Creates a copy of a Geometry with reduced precision to reduce the chance of topology errors when used * in intersection operations. diff --git a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gui/WarngenLayer.java b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gui/WarngenLayer.java index 72506a7994..ac4bdacd2d 100644 --- a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gui/WarngenLayer.java +++ b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gui/WarngenLayer.java @@ -210,6 +210,8 @@ import com.vividsolutions.jts.io.WKTReader; * 04/28,2014 3033 jsanchez Properly handled back up configuration (*.xml) files. Set backupSite to null when backup site is not selected. * 05/16/2014 DR 17365 D. Friedman Check if moved vertex results in polygon valid in both lat/lon and local coordinates. * 07/01/2014 DR 17450 D. Friedman Use list of templates from backup site. + * 07/28/2014 DR 17475 Qinglu Lin Updated populateStrings() and findLargestQuadrant(), removed findLargestGeometry(), + * added createAreaAndCentroidMaps() and movePopulatePt(), updated paintText() to center W. * * * @author mschenke @@ -222,6 +224,9 @@ public class WarngenLayer extends AbstractStormTrackResource { String uniqueFip = null; + Map geomArea = new HashMap(); + Map geomCentroid = new HashMap(); + private static class GeospatialDataList { private static final String LOCAL_GEOM = "localGeometry"; @@ -1087,6 +1092,8 @@ public class WarngenLayer extends AbstractStormTrackResource { DrawableString string = new DrawableString(text, textColor); string.magnification = magnification; string.setCoordinates(out[0], out[1]); + string.horizontalAlignment = IGraphicsTarget.HorizontalAlignment.CENTER; + string.verticallAlignment = IGraphicsTarget.VerticalAlignment.MIDDLE; strings.add(string); } } @@ -1170,6 +1177,8 @@ public class WarngenLayer extends AbstractStormTrackResource { }// end synchronize customMaps.loadCustomMaps(Arrays.asList(config.getMaps())); + createAreaAndCentroidMaps(); + this.configuration = config; System.out.println("Total time to init warngen config = " + (System.currentTimeMillis() - t0) + "ms"); @@ -3169,66 +3178,127 @@ public class WarngenLayer extends AbstractStormTrackResource { toKeep.toArray(new Geometry[0])); } + private void createAreaAndCentroidMaps() { + String gid; + geomArea.clear(); + geomCentroid.clear(); + for (GeospatialData f : geoData.features) { + Geometry geom = f.getGeometry(); + gid = ((CountyUserData)geom.getUserData()).gid; + geomArea.put(gid, geom.getArea()); + geomCentroid.put(gid, geom.getCentroid()); + } + } + /** * Populate the W strings with the included counties */ private void populateStrings() { state.strings.clear(); + Geometry warningArea = state.getWarningArea(); Set prefixes = new HashSet(Arrays.asList(GeometryUtil - .getGID(state.getWarningArea()))); + .getGID(warningArea))); prefixes = removeDuplicateGid(prefixes); - for (GeospatialData f : geoData.features) { - Geometry geom = f.geometry; - Geometry geom2 = null; - Geometry warningAreaN = null; - Coordinate populatePt = null; - Geometry populatePtGeom; - boolean contained = false, closeTo = false; - double shift = 1.E-8, distance, minDistance = 10.0; - int loop, maxLoop = 10; - Geometry warningArea = state.getWarningArea(); - String prefix = GeometryUtil.getPrefix(geom.getUserData()); - if (prefixes.contains(prefix)) { - loop = 0; - warningAreaN = findLargestGeometry(GeometryUtil.intersection(geom, warningArea)); - do { - if (!warningAreaN.isEmpty()) { - populatePt = GisUtil.d2dCoordinate(warningAreaN.getCentroid() - .getCoordinate()); - for (GeospatialData f2 : geoData.features) { - geom2 = f2.getGeometry(); - if (!GeometryUtil.getPrefix(geom2.getUserData()).equals(prefix)) { - contained = false; - closeTo = false; - populatePtGeom = PolygonUtil.createPolygonByPoints(populatePt, - new Coordinate(populatePt.x + shift, populatePt.y + shift)); - if (GeometryUtil.contains(geom2, populatePtGeom)) { - // populatePt is in another county/zone. - warningAreaN = findLargestQuadrant(warningAreaN, geom); - contained = true; - break; - } else { - distance = populatePtGeom.distance(geom2); - if (distance < minDistance) { - // populatePt is very close to the boundary of another county/zone. - warningAreaN = findLargestQuadrant(warningAreaN, geom); - closeTo = true; - break; - } - } - } + Set indexes = new HashSet(); + String prefixM, prefixN; + double areaM, areaN, maxArea = -1.0; + int geomIndex = -1; + int geomNum = warningArea.getNumGeometries(); + // Find an unique index for each county in warningArea. If there is more than one index + // for one county, find the one with max area. + Geometry warningAreaM = null, warningAreaN = null; + for (int i = 0; i < geomNum; i++) { + warningAreaM = warningArea.getGeometryN(i); + prefixM = GeometryUtil.getPrefix(warningAreaM.getUserData()); + if (!prefixes.contains(prefixM)) { + continue; + } + areaM = warningAreaM.getArea(); + geomIndex = i; + while (i + 1 < geomNum) { + warningAreaN = warningArea.getGeometryN(i + 1); + prefixN = GeometryUtil.getPrefix(warningAreaN.getUserData()); + if (prefixN.equals(prefixM)) { + areaN = warningAreaN.getArea(); + if (areaN > areaM) { + if (areaN > maxArea) { + maxArea = areaN; + geomIndex = i + 1; } } else { - // use the existing populatePt - break; + if (areaM > maxArea) { + maxArea = areaM; + } } - loop += 1; - } while ((contained || closeTo) && loop <= maxLoop); - state.strings.put(populatePt, "W"); + } else { + break; + } + i = i + 1; } + indexes.add(geomIndex); } + + Map populatePtMap = new HashMap(); + GeometryFactory gf = new GeometryFactory(); + Geometry geomN = null, populatePtGeom = null; + Coordinate populatePt = new Coordinate(); + Point centroid = null; + int loop, maxLoop = 10; + double threshold = 0.1, weight = 0.5, shift = 1.E-8, minArea = 1.0E-2, area; + Iterator iter = indexes.iterator(); + while (iter.hasNext()) { + warningAreaM = warningArea.getGeometryN(iter.next().intValue()); + prefixM = GeometryUtil.getPrefix(warningAreaM.getUserData()); + area = warningAreaM.getArea(); + if (area < minArea || area / geomArea.get(prefixM) < threshold) { + // Hatched area inside a county is small, move W toward to default centroid + centroid = movePopulatePt(gf, warningAreaM, geomCentroid.get(prefixM), weight); + populatePt = new Coordinate(centroid.getX(), centroid.getY()); + populatePtGeom = PolygonUtil.createPolygonByPoints(gf, populatePt, shift); + } else { + // Use the controid of the hatched area in a county + centroid = warningAreaM.getCentroid(); + populatePt = new Coordinate(centroid.getX(), centroid.getY()); + populatePtGeom = PolygonUtil.createPolygonByPoints(gf, populatePt, shift); + } + for (GeospatialData gd : geoData.features) { + geomN = gd.getGeometry(); + CountyUserData cud = (CountyUserData)geomN.getUserData(); + prefixN = cud.gid; + if (prefixN.length() > 0 && prefixM.length() > 0 && + !prefixN.equals(prefixM)) { + if (GeometryUtil.contains(geomN, populatePtGeom)) { + // W is inside a county. Use default centroid of a county (not that of its hatched area) + centroid = geomCentroid.get(prefixM); + populatePt = new Coordinate(centroid.getX(), centroid.getY()); + populatePtGeom = PolygonUtil.createPolygonByPoints(gf, populatePt, shift); + } + loop = 1; + while (GeometryUtil.contains(geomN, populatePtGeom) && loop < maxLoop) { + // W is still inside a county, move W to the largest quadrant + warningAreaM = findLargestQuadrant(gf, warningAreaM); + centroid = warningAreaM.getCentroid(); + populatePt = new Coordinate(centroid.getX(), centroid.getY()); + populatePtGeom = PolygonUtil.createPolygonByPoints(gf, populatePt, shift); + loop += 1; + } + } + } + populatePtMap.put(prefixM, populatePt); + } + for (String key: populatePtMap.keySet()) { + state.strings.put(populatePtMap.get(key), "W"); + } + } + + private Point movePopulatePt(GeometryFactory gf, Geometry geom, Point point, double weight) { + Point centroid = geom.getCentroid(); + Coordinate coord = new Coordinate(); + coord.x = centroid.getX() * weight + point.getX() * (1.0 - weight); + coord.y = centroid.getY() * weight + point.getY() * (1.0 - weight); + return gf.createPoint(new Coordinate(coord.x, coord.y)); } public boolean featureProduct(Coordinate c) { @@ -3504,21 +3574,6 @@ public class WarngenLayer extends AbstractStormTrackResource { * A Geometry or a GeometryCollection. * @return Geometry */ - private Geometry findLargestGeometry(Geometry g) { - int size = g.getNumGeometries(); - if (size == 1) - return g; - double area, maxArea = -1.0; - int index = 0; - for (int i = 0; i < size; i++) { - area = g.getGeometryN(i).getArea(); - if (area > maxArea) { - maxArea = area; - index = i; - } - } - return g.getGeometryN(index); - } /** * Split the hatched area into four quadrants, and return the largest one. @@ -3529,10 +3584,10 @@ public class WarngenLayer extends AbstractStormTrackResource { * The geometry of a county/zone. * @return Geometry * The geometey of largest quadrant among the four, which are the result of - * splitting of hatchedArea. + * splitting of a county's hatched area. */ - private Geometry findLargestQuadrant(Geometry hatchedArea, Geometry geom) { - Geometry envelope = hatchedArea.getEnvelope(); + private Geometry findLargestQuadrant(GeometryFactory gf, Geometry geom) { + Geometry envelope = geom.getEnvelope(); Coordinate centroidCoord = GisUtil.d2dCoordinate(envelope.getCentroid() .getCoordinate()); Coordinate[] envCoords = envelope.getCoordinates(); @@ -3542,19 +3597,23 @@ public class WarngenLayer extends AbstractStormTrackResource { double largestArea = -1.0, area = -1.0; int index = -1; for (int i = 0; i < size; i++) { - quadrants[i] = PolygonUtil.createPolygonByPoints(envCoords[i], centroidCoord); - intersections[i] = GeometryUtil.intersection(quadrants[i], hatchedArea); - area = intersections[i].getArea(); - if (area > largestArea) { - largestArea = area; - index = i; + quadrants[i] = PolygonUtil.createPolygonByPoints(gf, envCoords[i], centroidCoord); + try { + intersections[i] = GeometryUtil.intersection(quadrants[i], geom); + area = intersections[i].getArea(); + if (area > largestArea) { + largestArea = area; + index = i; + } + } catch (Exception e) { + ; } } - if (intersections[index].isValid()) + if (null != intersections[index] && intersections[index].isValid()) return intersections[index]; else { - // "intersections[" + index + "] is invalid" - return hatchedArea; + return geom; } } + } From b280c3f5c76b890f45665d4776e04462f6ca1f6d Mon Sep 17 00:00:00 2001 From: Michael Gamazaychikov Date: Mon, 28 Jul 2014 15:12:10 -0400 Subject: [PATCH 35/39] ASM #15627 - WarnGen leaving out reference to State that is under SVR or TOR Watch in SPS text products. Change-Id: Ic5689db7714be086d6e4543602db33a07e5b2fc1 Former-commit-id: c71189dd922fea5c9dc08c9cca48bdb9b0519655 [formerly e24dd6958e442b52ace317edc824d18bc66a40b5] [formerly ba4c386f308147743e1772bca49fb0393a9d50e6] [formerly c71189dd922fea5c9dc08c9cca48bdb9b0519655 [formerly e24dd6958e442b52ace317edc824d18bc66a40b5] [formerly ba4c386f308147743e1772bca49fb0393a9d50e6] [formerly 8cffe955a9d215c5f3e293ade959e1f4b45c3682 [formerly ba4c386f308147743e1772bca49fb0393a9d50e6 [formerly 00ec5e2d47809d084b3e24e1f1503af96d129fed]]]] Former-commit-id: 8cffe955a9d215c5f3e293ade959e1f4b45c3682 Former-commit-id: 4c4132f0aa700bbf1aa79748df1b9cf6270eece5 [formerly f186b49e9283c83fc869347a0d133d421a7364f4] [formerly ff7f89fdff34c0527901d834458ee4e10d6f19f3 [formerly bb7b43be4908e818954f3c536acc3291984157a5]] Former-commit-id: 6829c833cd21836bdce90d24a801642877a0b282 [formerly 134b1286fc85dfe7df7bfa8662e0c4cdd17872a1] Former-commit-id: cc3172ead3a8a5b56106ab7f50d0ac3cb9d6309b --- .../viz/warngen/gui/WarngenLayer.java | 51 ++++++++++++++--- .../viz/warngen/template/TemplateRunner.java | 29 +++++----- .../warngen/watchAreaSourceConfiguration.xml | 55 +++++++++++++++++++ 3 files changed, 113 insertions(+), 22 deletions(-) create mode 100755 edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/watchAreaSourceConfiguration.xml diff --git a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gui/WarngenLayer.java b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gui/WarngenLayer.java index ac4bdacd2d..f584abf32a 100644 --- a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gui/WarngenLayer.java +++ b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gui/WarngenLayer.java @@ -212,6 +212,7 @@ import com.vividsolutions.jts.io.WKTReader; * 07/01/2014 DR 17450 D. Friedman Use list of templates from backup site. * 07/28/2014 DR 17475 Qinglu Lin Updated populateStrings() and findLargestQuadrant(), removed findLargestGeometry(), * added createAreaAndCentroidMaps() and movePopulatePt(), updated paintText() to center W. + * 07/28/2014 DR15627 mgamazaychikov Change access qualifiers for some fields, methods for GeospatialDataList and GeospatialDataAccessor classes, create setAccessorAreaSourceConfiguration method. * * * @author mschenke @@ -246,10 +247,22 @@ public class WarngenLayer extends AbstractStormTrackResource { GeneralGridGeometry localGridGeometry; } - private static class GeospatialDataAccessor { - GeospatialDataList geoData; + public static class GeospatialDataAccessor { + public GeospatialDataList geoData; - AreaSourceConfiguration areaConfig; + public AreaSourceConfiguration areaConfig; + + public GeospatialDataList getGeoData() { + return geoData; + } + + public AreaSourceConfiguration getAreaConfig() { + return areaConfig; + } + + public GeospatialData[] getFeatures() { + return Arrays.copyOf(geoData.features, geoData.features.length); + } public GeospatialDataAccessor(GeospatialDataList geoData, AreaSourceConfiguration areaConfig) { @@ -1550,7 +1563,7 @@ public class WarngenLayer extends AbstractStormTrackResource { return ugcs; } - private GeospatialDataAccessor getGeospatialDataAcessor() + public GeospatialDataAccessor getGeospatialDataAcessor() throws Exception { GeospatialDataList gdl = searchGeospatialDataAccessor(); if (gdl == null) { @@ -1571,12 +1584,36 @@ public class WarngenLayer extends AbstractStormTrackResource { // TODO: There should be some way to get the "county" configuration by // name // independent of a template - AreaSourceConfiguration areaConfig = new AreaSourceConfiguration(); - areaConfig.setFipsField("FIPS"); - + AreaSourceConfiguration areaConfig = getAccessorAreaSourceConfiguration(); return new GeospatialDataAccessor(gdl, areaConfig); } + private static String ASC_MARINE = "MarineZones"; + private static String ASC_COUNTY = "County"; + + /** + * Returns the AreaSourceConfiguration for either county or marine zones based product + * + * @return + * @throws Exception + */ + private AreaSourceConfiguration getAccessorAreaSourceConfiguration() throws Exception { + boolean isMarineZone = configuration.getGeospatialConfig() + .getAreaSource().equalsIgnoreCase(MARINE); + WarngenConfiguration ascConfig = WarngenConfiguration.loadConfig( + "watchAreaSourceConfiguration", getLocalizedSite(), null); + AreaSourceConfiguration[] areaConfigs = ascConfig.getAreaSources(); + for (AreaSourceConfiguration af:areaConfigs){ + if (!isMarineZone && af.getAreaSource().equalsIgnoreCase(ASC_COUNTY)) {; + return af; + } + else if (isMarineZone && af.getAreaSource().equalsIgnoreCase(ASC_MARINE) ) { + return af; + } + } + return new AreaSourceConfiguration(); + } + private GeospatialDataList searchGeospatialDataAccessor() { synchronized (siteMap) { for (Map.Entry entry : siteMap diff --git a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/template/TemplateRunner.java b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/template/TemplateRunner.java index 1ab7ab65d1..527c276403 100644 --- a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/template/TemplateRunner.java +++ b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/template/TemplateRunner.java @@ -63,7 +63,6 @@ import com.raytheon.uf.common.dataplugin.warning.AbstractWarningRecord; import com.raytheon.uf.common.dataplugin.warning.WarningConstants; import com.raytheon.uf.common.dataplugin.warning.WarningRecord.WarningAction; import com.raytheon.uf.common.dataplugin.warning.config.AreaSourceConfiguration; -import com.raytheon.uf.common.dataplugin.warning.config.AreaSourceConfiguration.AreaType; import com.raytheon.uf.common.dataplugin.warning.config.WarngenConfiguration; import com.raytheon.uf.common.dataplugin.warning.gis.GeospatialData; import com.raytheon.uf.common.dataplugin.warning.util.GeometryUtil; @@ -103,6 +102,7 @@ import com.raytheon.viz.warngen.gis.Wx; import com.raytheon.viz.warngen.gui.BackupData; import com.raytheon.viz.warngen.gui.FollowupData; import com.raytheon.viz.warngen.gui.WarngenLayer; +import com.raytheon.viz.warngen.gui.WarngenLayer.GeospatialDataAccessor; import com.raytheon.viz.warngen.gui.WarngenUIState; import com.raytheon.viz.warngen.text.WarningTextHandler; import com.raytheon.viz.warngen.text.WarningTextHandlerFactory; @@ -159,6 +159,8 @@ import com.vividsolutions.jts.io.WKTReader; * Apr 28, 2014 3033 jsanchez Set the site and backup site in Velocity Engine's properties * Mar 17, 2014 DR 16309 Qinglu Lin Updated getWatches(), processATEntries() and determineAffectedPortions(), and * added determineAffectedMarinePortions(). + * Jul 17, 2014 DR15627 mgamazaychikov Fix setting asc and geoData in processATEntries, update getStateName, + * determineAffectedPortions and determineAffectedMarinePortions. * * * @author njensen @@ -1153,14 +1155,14 @@ public class TemplateRunner { Set validUgcZones) { WatchUtil rval = new WatchUtil(); TreeMap map = new TreeMap(); - + GeospatialData[] geoData = null; AreaSourceConfiguration asc = null; - for (AreaSourceConfiguration a : warngenLayer.getConfiguration() - .getAreaSources()) { - if (a.getType() == AreaType.HATCHING) { - asc = a; - break; - } + try { + GeospatialDataAccessor gda = warngenLayer.getGeospatialDataAcessor(); + geoData = gda.getFeatures(); + asc = gda.getAreaConfig(); + } catch (Exception e) { + statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(),e); } if (asc == null) { statusHandler @@ -1168,8 +1170,6 @@ public class TemplateRunner { "Cannot process watches: missing HATCHING area source configuration"); return rval; } - GeospatialData[] geoData = warngenLayer.getGeodataFeatures( - asc.getAreaSource(), warngenLayer.getLocalizedSite()); if ((geoData == null) || (geoData.length == 0)) { statusHandler.handle(Priority.ERROR, "Cannot process watches: cannot get geospatial data"); @@ -1232,7 +1232,7 @@ public class TemplateRunner { rval.addWaw(work.waw); } } else { - if (determineAffectedMarinePortions(work.ugcZone, asc, geoData, work.waw)) { + if (determineAffectedMarinePortions(work.ugcZone, geoData, work.waw)) { rval.addWaw(work.waw); } } @@ -1297,7 +1297,7 @@ public class TemplateRunner { for (Entry> e : map.entrySet()) { Portion portion = new Portion(); try { - portion.parentRegion = getStateName(e.getKey(), asc, geoData) + portion.parentRegion = getStateName(e.getKey(), geoData) .toUpperCase(); } catch (RuntimeException exc) { statusHandler.handle(Priority.ERROR, @@ -1330,8 +1330,7 @@ public class TemplateRunner { */ @SuppressWarnings("deprecation") private static boolean determineAffectedMarinePortions(List ugcs, - AreaSourceConfiguration asc, GeospatialData[] geoData, - WeatherAdvisoryWatch waw) { + GeospatialData[] geoData, WeatherAdvisoryWatch waw) { // Maps state abbreviation to unique fe_area values HashMap> map = new HashMap>(); @@ -1510,7 +1509,7 @@ public class TemplateRunner { return abrev; } - private static String getStateName(String key, AreaSourceConfiguration asc, + private static String getStateName(String key, GeospatialData[] geoData) { for (GeospatialData g : geoData) { if (key.equals(g.attributes.get("STATE"))) { diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/watchAreaSourceConfiguration.xml b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/watchAreaSourceConfiguration.xml new file mode 100755 index 0000000000..8efb1a476a --- /dev/null +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/watchAreaSourceConfiguration.xml @@ -0,0 +1,55 @@ + + + + + + + County + 0 + AND + 0 + COUNTYNAME + NAME + STATE + FE_AREA + TIME_ZONE + countyTypes.txt + FIPS + NAME + + parent + + + + + + + 0 + + + + + MarineZones + 0 + AND + 0 + NAME + NAME + NAME + countyTypes.txt + ID + NAME + + parent + + + + + + + 0 + + + From 32da13ecc38dd85283c9375101fd5686db99a692 Mon Sep 17 00:00:00 2001 From: "Kiran.Shrestha" Date: Mon, 28 Jul 2014 16:18:39 -0400 Subject: [PATCH 36/39] ASM #97 - Freezing Level Height AGL for all models has units of dam instead of feet Change-Id: Ib92fbb1c153a8a4739371d8148673a5e32ea36f9 Former-commit-id: d7c8a9a458f8cfd1751134ec638627da1c0eca6a [formerly e9a417f5f8ce88e7ab1c70e51b624c8a65b8a9f9] [formerly a044b44c8bd9352874d8933083d314266b5a834e] [formerly d7c8a9a458f8cfd1751134ec638627da1c0eca6a [formerly e9a417f5f8ce88e7ab1c70e51b624c8a65b8a9f9] [formerly a044b44c8bd9352874d8933083d314266b5a834e] [formerly 11bab40785647e05e89eaaa2265a7963ef6ff23a [formerly a044b44c8bd9352874d8933083d314266b5a834e [formerly 1730a6dea78cfd922b59c6cccc1c6f44d3a56949]]]] Former-commit-id: 11bab40785647e05e89eaaa2265a7963ef6ff23a Former-commit-id: f544c8e64febd5c70be299741cd194b94b195321 [formerly fe32fc419a9296dfc736d662ae119b630df97f2b] [formerly 4b133e12715365fa25363fcbb64628b8c3ce4aef [formerly d32c2739cf4650d308582f0b55a9e9e25bc7c8e0]] Former-commit-id: 3d2329fbc6c7d4a188ca052d16d44e1b65c7c8b1 [formerly 2c2ad03ee5286a2455fbee0f5a8f2b674992447b] Former-commit-id: fa984fd8a444d51c033b018ca19496a54a2ee6d7 --- .../common_static/base/styleRules/d2dContourStyleRules.xml | 2 +- .../common_static/base/styleRules/gridImageryStyleRules.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.grid/utility/common_static/base/styleRules/d2dContourStyleRules.xml b/edexOsgi/com.raytheon.uf.common.dataplugin.grid/utility/common_static/base/styleRules/d2dContourStyleRules.xml index c46b09f8bb..cd0173fc21 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.grid/utility/common_static/base/styleRules/d2dContourStyleRules.xml +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.grid/utility/common_static/base/styleRules/d2dContourStyleRules.xml @@ -31,7 +31,7 @@ zAGL - dam + ft 50 diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.grid/utility/common_static/base/styleRules/gridImageryStyleRules.xml b/edexOsgi/com.raytheon.uf.common.dataplugin.grid/utility/common_static/base/styleRules/gridImageryStyleRules.xml index 7e50d4aa9a..98760217c6 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.grid/utility/common_static/base/styleRules/gridImageryStyleRules.xml +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.grid/utility/common_static/base/styleRules/gridImageryStyleRules.xml @@ -74,7 +74,7 @@ Topo - km + ft Grid/gridded data From 730815ac4e3d5673e0a7f0c5b1622078786bc390 Mon Sep 17 00:00:00 2001 From: "Daniel.Huffman" Date: Tue, 29 Jul 2014 21:40:46 +0000 Subject: [PATCH 37/39] ASM #15648 Change to Cities.xml Change-Id: Idc89484cf45fcd1fb30538119d254ed9c0fd79e2 Former-commit-id: 0604b6151ffb2b86f2ab02a00bd99e519250b054 [formerly 008255ad0ef45349a47c2fec16567dc4e76cb875] [formerly aca63e248f1c4b7efb6b38507cef3cc82b03b16b] [formerly 0604b6151ffb2b86f2ab02a00bd99e519250b054 [formerly 008255ad0ef45349a47c2fec16567dc4e76cb875] [formerly aca63e248f1c4b7efb6b38507cef3cc82b03b16b] [formerly ea11c480080f1b3fe09faa4133a5154022062bf5 [formerly aca63e248f1c4b7efb6b38507cef3cc82b03b16b [formerly 1e2b8582fa4dec428b70a2e8aaa1e401ddbfcee7]]]] Former-commit-id: ea11c480080f1b3fe09faa4133a5154022062bf5 Former-commit-id: b79a4b26865307dc09cb00d6d60d119786f2273e [formerly cf2df78596ef5dc1afbfb2a0c02bb982d31b3461] [formerly 689c437b5ef83791d3726fa3d228f4816af33e7e [formerly e9986b7316a01c9489fcbd4bf50998bdd83e7787]] Former-commit-id: ba2ae1bb399fc8a6cb27ee1d0e6f856b40eb1186 [formerly e9f98275bd301370e0e86c24a62b319ad68828c2] Former-commit-id: 11de63b4f065ce45edd4dd4a99de085546032a85 --- .../localization/bundles/maps/Cities.xml | 42 ++++++++++--------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/cave/com.raytheon.uf.viz.core.maps/localization/bundles/maps/Cities.xml b/cave/com.raytheon.uf.viz.core.maps/localization/bundles/maps/Cities.xml index aff2ef1b06..a6c0b21089 100644 --- a/cave/com.raytheon.uf.viz.core.maps/localization/bundles/maps/Cities.xml +++ b/cave/com.raytheon.uf.viz.core.maps/localization/bundles/maps/Cities.xml @@ -26,7 +26,10 @@ - + + + + PLAN_VIEW @@ -37,7 +40,23 @@ - + PLAN_VIEW + + + + + + cities.lpi + Cities + + + Cities + + + + + outlineWidth="1" /> PLAN_VIEW @@ -51,27 +70,10 @@ Cities - - - - - - - - PLAN_VIEW - - - - - - cities.lpi - Cities - - - Cities + From a774213fa96e2ada0bcb0e2c47642268631f6f18 Mon Sep 17 00:00:00 2001 From: "Shawn.Hooper" Date: Wed, 30 Jul 2014 14:02:42 -0400 Subject: [PATCH 38/39] ASM #15627 Revert "ASM #15627 - WarnGen leaving out reference to State that is under SVR or TOR Watch in SPS text products." This reverts commit 9732ea69398c323fee2b61570bfc18ab595da709 [formerly 8cffe955a9d215c5f3e293ade959e1f4b45c3682] [formerly c71189dd922fea5c9dc08c9cca48bdb9b0519655 [formerly e24dd6958e442b52ace317edc824d18bc66a40b5] [formerly ba4c386f308147743e1772bca49fb0393a9d50e6] [formerly c71189dd922fea5c9dc08c9cca48bdb9b0519655 [formerly e24dd6958e442b52ace317edc824d18bc66a40b5] [formerly ba4c386f308147743e1772bca49fb0393a9d50e6] [formerly 8cffe955a9d215c5f3e293ade959e1f4b45c3682 [formerly ba4c386f308147743e1772bca49fb0393a9d50e6 [formerly 00ec5e2d47809d084b3e24e1f1503af96d129fed]]]]]. Change-Id: Ie01ca9463a4db371ffce0b6e38d5c43e1f9addf2 Former-commit-id: adcd4dfa64daddfe50b887062bf35d521407f9c6 [formerly 27f50397aadc7d23b993784d77552f99cff8c947] [formerly 976c7b2d4af499de11d4e951382c1a7a90b87b73] [formerly adcd4dfa64daddfe50b887062bf35d521407f9c6 [formerly 27f50397aadc7d23b993784d77552f99cff8c947] [formerly 976c7b2d4af499de11d4e951382c1a7a90b87b73] [formerly 4e322737cece643661b73035ff3c3399bf412d05 [formerly 976c7b2d4af499de11d4e951382c1a7a90b87b73 [formerly d272d426f8bd218954a75a7b2e19d21b30f975cb]]]] Former-commit-id: 4e322737cece643661b73035ff3c3399bf412d05 Former-commit-id: 6388744d4f9b56f3fb4017616c61bd507389c9e7 [formerly af19d9f9c4c40c381c5e50968debdcc531b24d75] [formerly 04fd2b332f2591e977341aaaa648d03eb4ecc9c3 [formerly fe0fffe51bda475276839ff2cfcefc81c1ad3a5a]] Former-commit-id: 0693c97544c8dd01a9ad695768ee8e2df2354373 [formerly 17ac974932c1313742c6d1827f16390e64111c2d] Former-commit-id: 53daf4e3bc754512698732033e9f931d8b55cd85 --- .../viz/warngen/gui/WarngenLayer.java | 51 +++-------------- .../viz/warngen/template/TemplateRunner.java | 29 +++++----- .../warngen/watchAreaSourceConfiguration.xml | 55 ------------------- 3 files changed, 22 insertions(+), 113 deletions(-) delete mode 100755 edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/watchAreaSourceConfiguration.xml diff --git a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gui/WarngenLayer.java b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gui/WarngenLayer.java index f584abf32a..ac4bdacd2d 100644 --- a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gui/WarngenLayer.java +++ b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gui/WarngenLayer.java @@ -212,7 +212,6 @@ import com.vividsolutions.jts.io.WKTReader; * 07/01/2014 DR 17450 D. Friedman Use list of templates from backup site. * 07/28/2014 DR 17475 Qinglu Lin Updated populateStrings() and findLargestQuadrant(), removed findLargestGeometry(), * added createAreaAndCentroidMaps() and movePopulatePt(), updated paintText() to center W. - * 07/28/2014 DR15627 mgamazaychikov Change access qualifiers for some fields, methods for GeospatialDataList and GeospatialDataAccessor classes, create setAccessorAreaSourceConfiguration method. * * * @author mschenke @@ -247,22 +246,10 @@ public class WarngenLayer extends AbstractStormTrackResource { GeneralGridGeometry localGridGeometry; } - public static class GeospatialDataAccessor { - public GeospatialDataList geoData; + private static class GeospatialDataAccessor { + GeospatialDataList geoData; - public AreaSourceConfiguration areaConfig; - - public GeospatialDataList getGeoData() { - return geoData; - } - - public AreaSourceConfiguration getAreaConfig() { - return areaConfig; - } - - public GeospatialData[] getFeatures() { - return Arrays.copyOf(geoData.features, geoData.features.length); - } + AreaSourceConfiguration areaConfig; public GeospatialDataAccessor(GeospatialDataList geoData, AreaSourceConfiguration areaConfig) { @@ -1563,7 +1550,7 @@ public class WarngenLayer extends AbstractStormTrackResource { return ugcs; } - public GeospatialDataAccessor getGeospatialDataAcessor() + private GeospatialDataAccessor getGeospatialDataAcessor() throws Exception { GeospatialDataList gdl = searchGeospatialDataAccessor(); if (gdl == null) { @@ -1584,36 +1571,12 @@ public class WarngenLayer extends AbstractStormTrackResource { // TODO: There should be some way to get the "county" configuration by // name // independent of a template - AreaSourceConfiguration areaConfig = getAccessorAreaSourceConfiguration(); + AreaSourceConfiguration areaConfig = new AreaSourceConfiguration(); + areaConfig.setFipsField("FIPS"); + return new GeospatialDataAccessor(gdl, areaConfig); } - private static String ASC_MARINE = "MarineZones"; - private static String ASC_COUNTY = "County"; - - /** - * Returns the AreaSourceConfiguration for either county or marine zones based product - * - * @return - * @throws Exception - */ - private AreaSourceConfiguration getAccessorAreaSourceConfiguration() throws Exception { - boolean isMarineZone = configuration.getGeospatialConfig() - .getAreaSource().equalsIgnoreCase(MARINE); - WarngenConfiguration ascConfig = WarngenConfiguration.loadConfig( - "watchAreaSourceConfiguration", getLocalizedSite(), null); - AreaSourceConfiguration[] areaConfigs = ascConfig.getAreaSources(); - for (AreaSourceConfiguration af:areaConfigs){ - if (!isMarineZone && af.getAreaSource().equalsIgnoreCase(ASC_COUNTY)) {; - return af; - } - else if (isMarineZone && af.getAreaSource().equalsIgnoreCase(ASC_MARINE) ) { - return af; - } - } - return new AreaSourceConfiguration(); - } - private GeospatialDataList searchGeospatialDataAccessor() { synchronized (siteMap) { for (Map.Entry entry : siteMap diff --git a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/template/TemplateRunner.java b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/template/TemplateRunner.java index 527c276403..1ab7ab65d1 100644 --- a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/template/TemplateRunner.java +++ b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/template/TemplateRunner.java @@ -63,6 +63,7 @@ import com.raytheon.uf.common.dataplugin.warning.AbstractWarningRecord; import com.raytheon.uf.common.dataplugin.warning.WarningConstants; import com.raytheon.uf.common.dataplugin.warning.WarningRecord.WarningAction; import com.raytheon.uf.common.dataplugin.warning.config.AreaSourceConfiguration; +import com.raytheon.uf.common.dataplugin.warning.config.AreaSourceConfiguration.AreaType; import com.raytheon.uf.common.dataplugin.warning.config.WarngenConfiguration; import com.raytheon.uf.common.dataplugin.warning.gis.GeospatialData; import com.raytheon.uf.common.dataplugin.warning.util.GeometryUtil; @@ -102,7 +103,6 @@ import com.raytheon.viz.warngen.gis.Wx; import com.raytheon.viz.warngen.gui.BackupData; import com.raytheon.viz.warngen.gui.FollowupData; import com.raytheon.viz.warngen.gui.WarngenLayer; -import com.raytheon.viz.warngen.gui.WarngenLayer.GeospatialDataAccessor; import com.raytheon.viz.warngen.gui.WarngenUIState; import com.raytheon.viz.warngen.text.WarningTextHandler; import com.raytheon.viz.warngen.text.WarningTextHandlerFactory; @@ -159,8 +159,6 @@ import com.vividsolutions.jts.io.WKTReader; * Apr 28, 2014 3033 jsanchez Set the site and backup site in Velocity Engine's properties * Mar 17, 2014 DR 16309 Qinglu Lin Updated getWatches(), processATEntries() and determineAffectedPortions(), and * added determineAffectedMarinePortions(). - * Jul 17, 2014 DR15627 mgamazaychikov Fix setting asc and geoData in processATEntries, update getStateName, - * determineAffectedPortions and determineAffectedMarinePortions. * * * @author njensen @@ -1155,14 +1153,14 @@ public class TemplateRunner { Set validUgcZones) { WatchUtil rval = new WatchUtil(); TreeMap map = new TreeMap(); - GeospatialData[] geoData = null; + AreaSourceConfiguration asc = null; - try { - GeospatialDataAccessor gda = warngenLayer.getGeospatialDataAcessor(); - geoData = gda.getFeatures(); - asc = gda.getAreaConfig(); - } catch (Exception e) { - statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(),e); + for (AreaSourceConfiguration a : warngenLayer.getConfiguration() + .getAreaSources()) { + if (a.getType() == AreaType.HATCHING) { + asc = a; + break; + } } if (asc == null) { statusHandler @@ -1170,6 +1168,8 @@ public class TemplateRunner { "Cannot process watches: missing HATCHING area source configuration"); return rval; } + GeospatialData[] geoData = warngenLayer.getGeodataFeatures( + asc.getAreaSource(), warngenLayer.getLocalizedSite()); if ((geoData == null) || (geoData.length == 0)) { statusHandler.handle(Priority.ERROR, "Cannot process watches: cannot get geospatial data"); @@ -1232,7 +1232,7 @@ public class TemplateRunner { rval.addWaw(work.waw); } } else { - if (determineAffectedMarinePortions(work.ugcZone, geoData, work.waw)) { + if (determineAffectedMarinePortions(work.ugcZone, asc, geoData, work.waw)) { rval.addWaw(work.waw); } } @@ -1297,7 +1297,7 @@ public class TemplateRunner { for (Entry> e : map.entrySet()) { Portion portion = new Portion(); try { - portion.parentRegion = getStateName(e.getKey(), geoData) + portion.parentRegion = getStateName(e.getKey(), asc, geoData) .toUpperCase(); } catch (RuntimeException exc) { statusHandler.handle(Priority.ERROR, @@ -1330,7 +1330,8 @@ public class TemplateRunner { */ @SuppressWarnings("deprecation") private static boolean determineAffectedMarinePortions(List ugcs, - GeospatialData[] geoData, WeatherAdvisoryWatch waw) { + AreaSourceConfiguration asc, GeospatialData[] geoData, + WeatherAdvisoryWatch waw) { // Maps state abbreviation to unique fe_area values HashMap> map = new HashMap>(); @@ -1509,7 +1510,7 @@ public class TemplateRunner { return abrev; } - private static String getStateName(String key, + private static String getStateName(String key, AreaSourceConfiguration asc, GeospatialData[] geoData) { for (GeospatialData g : geoData) { if (key.equals(g.attributes.get("STATE"))) { diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/watchAreaSourceConfiguration.xml b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/watchAreaSourceConfiguration.xml deleted file mode 100755 index 8efb1a476a..0000000000 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/watchAreaSourceConfiguration.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - County - 0 - AND - 0 - COUNTYNAME - NAME - STATE - FE_AREA - TIME_ZONE - countyTypes.txt - FIPS - NAME - - parent - - - - - - - 0 - - - - - MarineZones - 0 - AND - 0 - NAME - NAME - NAME - countyTypes.txt - ID - NAME - - parent - - - - - - - 0 - - - From 406148cefa7aaa89b1130d6abad184d31775110b Mon Sep 17 00:00:00 2001 From: Ben Steffensmeier Date: Wed, 30 Jul 2014 16:38:51 -0500 Subject: [PATCH 39/39] Issue #3455 Fix gridless grib models. Former-commit-id: fa3207a140560e12b6896ed2af89238d02cb4cac [formerly 1005d4d4b19a6f4c0d274dca37e9113080b02ee8] [formerly 7341c62f40775fdaa7a6c5b4081fb549a76da06a] [formerly fa3207a140560e12b6896ed2af89238d02cb4cac [formerly 1005d4d4b19a6f4c0d274dca37e9113080b02ee8] [formerly 7341c62f40775fdaa7a6c5b4081fb549a76da06a] [formerly 12f84a942775bc286412bebc8ccdd05cbbf96da6 [formerly 7341c62f40775fdaa7a6c5b4081fb549a76da06a [formerly 1228b73957fc4a407e9075292faffeff3a84bdb4]]]] Former-commit-id: 12f84a942775bc286412bebc8ccdd05cbbf96da6 Former-commit-id: b18fd8fa99a2c6e8ffb1e225cb1458738a385f72 [formerly dd7791eb00a501eb4fed6603bd966cff81de0cb6] [formerly ea5f516de72498c070ef57de9dea6fd6fb7b76e8 [formerly 5c437a4be91aabe224710a8ead03bab743d6a122]] Former-commit-id: 8f9786f83d688fb6f9fda6e140eaefa90c889798 [formerly 06f70271f5df1c0550bd343e7a5b11866cba0bef] Former-commit-id: fe12b1d41968285da4f0a890754617960344319e --- .../com/raytheon/edex/plugin/grib/util/GribModelLookup.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/util/GribModelLookup.java b/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/util/GribModelLookup.java index 9af2c1260e..1207ed3c65 100644 --- a/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/util/GribModelLookup.java +++ b/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/util/GribModelLookup.java @@ -56,6 +56,7 @@ import com.raytheon.uf.common.util.mapping.MultipleMappingException; * Apr 30, 2013 1961 bsteffen Add ability to disable grib tables. * Oct 14, 2013 2473 bsteffen Remove lookup of deprecated grib files. * Apr 25, 2014 2874 bsteffen Add processType + * Jul 30, 2014 3455 bsteffen Allow model matching with no grid defined. * * * @@ -148,6 +149,9 @@ public class GribModelLookup { return model; } } + } else { + String key = toKey(center, subcenter, null, process, processType); + return models.get(key); } return null; }