From 1d894e9c65efc394c72cd07a1095e500b1ff90b5 Mon Sep 17 00:00:00 2001 From: AWIPS User Date: Mon, 22 Jun 2015 19:05:53 -0600 Subject: [PATCH] USPLN support added to binlightning plugin Former-commit-id: 7148e21bf7ede4a8359964cea33acba6ca416d65 [formerly cc4a29108159cfd6b47f91c33e0e8c52cbad6994] Former-commit-id: d4634d3d2369f85a82b0465ce8d31e390418c0a9 --- .../com.raytheon.uf.viz.d2d.ui.obs/plugin.xml | 8 + .../localization/bundles/USPLNPlot15Min.xml | 48 +++++ .../localization/bundles/USPLNPlot15MinPN.xml | 71 +++++++ .../localization/bundles/USPLNPlot5Min.xml | 48 +++++ .../localization/bundles/USPLNPlot60Min.xml | 48 +++++ .../localization/bundles/USPLNSeq60min.xml | 185 ++++++++++++++++++ .../localization/menus/lightning/index.xml | 2 + .../menus/lightning/usplnMenuItems.xml | 46 +++++ .../textlightning/TextLightningDecoder.java | 3 +- .../impl/TextLightningParser.java | 54 ++++- .../base/distribution/textlightning.xml | 2 + 11 files changed, 512 insertions(+), 3 deletions(-) create mode 100644 cave/com.raytheon.viz.lightning/localization/bundles/USPLNPlot15Min.xml create mode 100644 cave/com.raytheon.viz.lightning/localization/bundles/USPLNPlot15MinPN.xml create mode 100644 cave/com.raytheon.viz.lightning/localization/bundles/USPLNPlot5Min.xml create mode 100644 cave/com.raytheon.viz.lightning/localization/bundles/USPLNPlot60Min.xml create mode 100644 cave/com.raytheon.viz.lightning/localization/bundles/USPLNSeq60min.xml create mode 100644 cave/com.raytheon.viz.lightning/localization/menus/lightning/usplnMenuItems.xml diff --git a/cave/com.raytheon.uf.viz.d2d.ui.obs/plugin.xml b/cave/com.raytheon.uf.viz.d2d.ui.obs/plugin.xml index cff3933d42..32d98eb951 100644 --- a/cave/com.raytheon.uf.viz.d2d.ui.obs/plugin.xml +++ b/cave/com.raytheon.uf.viz.d2d.ui.obs/plugin.xml @@ -46,6 +46,14 @@ + + + + diff --git a/cave/com.raytheon.viz.lightning/localization/bundles/USPLNPlot15Min.xml b/cave/com.raytheon.viz.lightning/localization/bundles/USPLNPlot15Min.xml new file mode 100644 index 0000000000..a403cd3d1f --- /dev/null +++ b/cave/com.raytheon.viz.lightning/localization/bundles/USPLNPlot15Min.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/cave/com.raytheon.viz.lightning/localization/bundles/USPLNPlot15MinPN.xml b/cave/com.raytheon.viz.lightning/localization/bundles/USPLNPlot15MinPN.xml new file mode 100644 index 0000000000..6717da8a5b --- /dev/null +++ b/cave/com.raytheon.viz.lightning/localization/bundles/USPLNPlot15MinPN.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/cave/com.raytheon.viz.lightning/localization/bundles/USPLNPlot5Min.xml b/cave/com.raytheon.viz.lightning/localization/bundles/USPLNPlot5Min.xml new file mode 100644 index 0000000000..2c6463c587 --- /dev/null +++ b/cave/com.raytheon.viz.lightning/localization/bundles/USPLNPlot5Min.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/cave/com.raytheon.viz.lightning/localization/bundles/USPLNPlot60Min.xml b/cave/com.raytheon.viz.lightning/localization/bundles/USPLNPlot60Min.xml new file mode 100644 index 0000000000..add22edf0f --- /dev/null +++ b/cave/com.raytheon.viz.lightning/localization/bundles/USPLNPlot60Min.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/cave/com.raytheon.viz.lightning/localization/bundles/USPLNSeq60min.xml b/cave/com.raytheon.viz.lightning/localization/bundles/USPLNSeq60min.xml new file mode 100644 index 0000000000..26668b5e11 --- /dev/null +++ b/cave/com.raytheon.viz.lightning/localization/bundles/USPLNSeq60min.xml @@ -0,0 +1,185 @@ + + + + + + + + + + + + PLAN_VIEW + + + + + + + + + + + + + + + + + + + + PLAN_VIEW + + + + + + + + + + + + + + + + + + + + PLAN_VIEW + + + + + + + + + + + + + + + + + + + + PLAN_VIEW + + + + + + + + + + + + + + + + + + + + PLAN_VIEW + + + + + + + + + + + + + + + + + + + + PLAN_VIEW + + + + + + + + + + + + + + + + + + diff --git a/cave/com.raytheon.viz.lightning/localization/menus/lightning/index.xml b/cave/com.raytheon.viz.lightning/localization/menus/lightning/index.xml index 49ea2a059c..219c9d7b69 100644 --- a/cave/com.raytheon.viz.lightning/localization/menus/lightning/index.xml +++ b/cave/com.raytheon.viz.lightning/localization/menus/lightning/index.xml @@ -19,6 +19,8 @@ further_licensing_information. --> + diff --git a/cave/com.raytheon.viz.lightning/localization/menus/lightning/usplnMenuItems.xml b/cave/com.raytheon.viz.lightning/localization/menus/lightning/usplnMenuItems.xml new file mode 100644 index 0000000000..02b46b88e7 --- /dev/null +++ b/cave/com.raytheon.viz.lightning/localization/menus/lightning/usplnMenuItems.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/edexOsgi/com.raytheon.edex.plugin.textlightning/src/com/raytheon/edex/plugin/textlightning/TextLightningDecoder.java b/edexOsgi/com.raytheon.edex.plugin.textlightning/src/com/raytheon/edex/plugin/textlightning/TextLightningDecoder.java index c85564bf5d..0949748c76 100644 --- a/edexOsgi/com.raytheon.edex.plugin.textlightning/src/com/raytheon/edex/plugin/textlightning/TextLightningDecoder.java +++ b/edexOsgi/com.raytheon.edex.plugin.textlightning/src/com/raytheon/edex/plugin/textlightning/TextLightningDecoder.java @@ -45,6 +45,7 @@ import com.raytheon.uf.common.time.util.TimeUtil; * Feb 12, 2014 2655 njensen Set source * Jun 05, 2014 3226 bclement LightningStikePoint refactor * Jun 10, 2014 3226 bclement fixed source + * Jun 22, 2015 mjames@ucar Muted setSource * * * @@ -103,7 +104,7 @@ public class TextLightningDecoder extends AbstractDecoder implements report.setTraceId(traceId); - report.setSource(SOURCE); + //report.setSource(SOURCE); return new PluginDataObject[] { report }; } diff --git a/edexOsgi/com.raytheon.edex.plugin.textlightning/src/com/raytheon/edex/plugin/textlightning/impl/TextLightningParser.java b/edexOsgi/com.raytheon.edex.plugin.textlightning/src/com/raytheon/edex/plugin/textlightning/impl/TextLightningParser.java index cf0bc5aa1e..656f09344e 100644 --- a/edexOsgi/com.raytheon.edex.plugin.textlightning/src/com/raytheon/edex/plugin/textlightning/impl/TextLightningParser.java +++ b/edexOsgi/com.raytheon.edex.plugin.textlightning/src/com/raytheon/edex/plugin/textlightning/impl/TextLightningParser.java @@ -51,6 +51,7 @@ import com.raytheon.uf.common.status.UFStatus.Priority; * 999 * Feb 12, 2014 2655 njensen Use status handler for logging * Jun 05, 2014 3226 bclement LightningStikePoint refactor + * Jun 22, 2015 mjames@ucar Support for USPLN * * * @@ -83,6 +84,12 @@ public class TextLightningParser { private static final String LIGHTNING_PTRN_C = "(\\d{4,4}-\\d{2,2}-\\d{2,2})T(\\d{2,2}:\\d{2,2}:\\d{2,2}),(-?\\d{1,2}.\\d{1,4}),(-?\\d{1,3}.\\d{1,4}),(0.0),(1)"; private static final Pattern LTG_PTRN_C = Pattern.compile(LIGHTNING_PTRN_C); + + // USPLN + // 2015-06-22T22:26:56.988,20.0405176,-83.8311105,-117.00,1.50,0.25,28 + private static final String LIGHTNING_PTRN_USPLN = "(\\d{4,4}-\\d{2,2}-\\d{2,2})T(\\d{2,2}:\\d{2,2}:\\d{2,2}.\\d{3,3}),(-?\\d{1,2}.\\d{2,}),(-?\\d{1,3}.\\d{2,}),(-?\\d{1,3}\\.\\d{2,2}),(\\d{1,1}\\.\\d{2,2}),(\\d{1,1}\\.\\d{2,2}),(-?\\d{1,2})"; + + private static final Pattern LTG_PTRN_USPLN = Pattern.compile(LIGHTNING_PTRN_USPLN); /** * default constructor. @@ -159,8 +166,10 @@ public class TextLightningParser { LightningStrikePoint strike; for (String line : lines) { try { + // 03/23/2010 13:35:01 72.00 -157.00 -142 1 Matcher m = LTG_PTRN_A.matcher(line); if (m.matches()) { + String[] date = m.group(1).split("/"); String[] time = m.group(2).split(":"); String month = date[0]; @@ -191,6 +200,7 @@ public class TextLightningParser { strike.setLightSource("UNKN"); reports.add(strike); } else { + // 10:03:24:13:35:00.68 72.000 157.000 -14.2 1 m = LTG_PTRN_B.matcher(line); if (m.matches()) { String[] datetime = m.group(1).split(":"); @@ -228,6 +238,7 @@ public class TextLightningParser { strike.setLightSource("UNKN"); reports.add(strike); } else { + // 2012-03-14T18:58:00,-5.5021,-45.9669,0.0,1 m = LTG_PTRN_C.matcher(line); if (m.matches()) { String[] datec = m.group(1).split("-"); @@ -264,8 +275,47 @@ public class TextLightningParser { strike.setLightSource(sls); reports.add(strike); } else { - logger.error("Cannot match lightning input " - + line); + // 2015-06-22T23:04:46.884,30.6349741,-88.3066673,-27.10,0.25,0.25,8 + m = LTG_PTRN_USPLN.matcher(line); + if (m.matches()) { + String[] datec = m.group(1).split("-"); + String[] timec = m.group(2).split(":"); + String year = datec[0]; + String month = datec[1]; + String day = datec[2]; + String hour = timec[0]; + String min = timec[1]; + String sec = timec[2].substring(0, 2); + String msec = timec[2].substring(3, 6); + + String sls = "USPLN"; + + String latitude = m.group(3); + String longitude = m.group(4); + String strength = m.group(5); + String count = "1"; + + strike = new LightningStrikePoint( + Double.parseDouble(latitude), + Double.parseDouble(longitude)); + strike.setStrikeStrength(Double + .parseDouble(strength)); + strike.setPulseCount(Integer.parseInt(count)); + strike.setMonth(Integer.parseInt(month)); + strike.setDay(Integer.parseInt(day)); + strike.setYear(Integer.parseInt(year)); + strike.setHour(Integer.parseInt(hour)); + strike.setMinute(Integer.parseInt(min)); + strike.setSecond(Integer.parseInt(sec)); + strike.setMillis(Integer.parseInt(msec)); + strike.setMsgType(LtgMsgType.STRIKE_MSG_FL); + strike.setType(LtgStrikeType.CLOUD_TO_GROUND); + strike.setLightSource(sls); + reports.add(strike); + } else if (!line.startsWith("LIGHTNING-USPLN1EX")) { + logger.error("Cannot match lightning input " + + line); + } } } } diff --git a/edexOsgi/com.raytheon.edex.plugin.textlightning/utility/edex_static/base/distribution/textlightning.xml b/edexOsgi/com.raytheon.edex.plugin.textlightning/utility/edex_static/base/distribution/textlightning.xml index 19cbea4177..f4d7fcb18f 100644 --- a/edexOsgi/com.raytheon.edex.plugin.textlightning/utility/edex_static/base/distribution/textlightning.xml +++ b/edexOsgi/com.raytheon.edex.plugin.textlightning/utility/edex_static/base/distribution/textlightning.xml @@ -21,4 +21,6 @@ FAA_ WWLLN_ + ^USPLN1EX.* + .*uspln