Merge "Omaha #2707 LSR rework" into omaha_14.4.1
Former-commit-id:e2bd527996
[formerlycf7fee3b58
[formerly e9636595208e033882c6f7ec85329845a99cb66b]] Former-commit-id:cf7fee3b58
Former-commit-id:1304c2b343
This commit is contained in:
commit
b81ebfda25
20 changed files with 490 additions and 468 deletions
|
@ -1,7 +0,0 @@
|
|||
#Thu Mar 26 10:54:58 CDT 2009
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
|
||||
org.eclipse.jdt.core.compiler.compliance=1.6
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.source=1.6
|
|
@ -5,7 +5,7 @@ Bundle-SymbolicName: com.raytheon.viz.pointdata;singleton:=true
|
|||
Bundle-Version: 1.14.1.qualifier
|
||||
Bundle-Vendor: Raytheon
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
|
||||
Require-Bundle: org.apache.batik;bundle-version="1.6",
|
||||
org.eclipse.ui;bundle-version="3.8",
|
||||
org.eclipse.core.runtime;bundle-version="3.8",
|
||||
|
|
|
@ -1,42 +1,50 @@
|
|||
n2s
|
||||
0
|
||||
1
|
||||
2
|
||||
3
|
||||
4 DRY
|
||||
5
|
||||
6 HEAT
|
||||
7 COLD
|
||||
8 CHILL
|
||||
9 FlFld
|
||||
10 Fld
|
||||
11
|
||||
12
|
||||
13
|
||||
14 A
|
||||
15
|
||||
16
|
||||
17
|
||||
18 +Tide
|
||||
19 +Surf
|
||||
20 +W
|
||||
21
|
||||
22
|
||||
23
|
||||
24 -Tide
|
||||
25 A
|
||||
26
|
||||
27 DMG
|
||||
28
|
||||
29 RIP
|
||||
30 SEICHE
|
||||
31
|
||||
32
|
||||
33 SURGE
|
||||
34
|
||||
35
|
||||
36
|
||||
37
|
||||
38
|
||||
39
|
||||
40
|
||||
s2s
|
||||
pass
|
||||
'AVALANCHE'
|
||||
'BLIZZARD'
|
||||
'DENSE FOG'
|
||||
'DOWNBURST'
|
||||
'DROUGHT' 'DRY'
|
||||
'DUST STORM'
|
||||
'EXCESSIVE HEAT' 'HEAT'
|
||||
'EXTREME COLD' 'COLD'
|
||||
'EXTR WIND CHILL' 'CHILL'
|
||||
'FLASH FLOOD' 'FlFld'
|
||||
'FLOOD' 'Fld'
|
||||
'FREEZE'
|
||||
'FREEZING RAIN'
|
||||
'FUNNEL CLOUD'
|
||||
'HAIL'
|
||||
'HEAVY RAIN'
|
||||
'HEAVY SLEET'
|
||||
'HEAVY SNOW'
|
||||
'HIGH ASTR TIDES' '+Tide'
|
||||
'HIGH SURF' '+Surf'
|
||||
'HIGH SUST WINDS' '+W'
|
||||
'HURRICANE'
|
||||
'ICE STORM'
|
||||
'LIGHTNING'
|
||||
'LOW ASTR TIDES' '-Tide'
|
||||
'MARINE HAIL'
|
||||
'MARINE TSTM WIND'
|
||||
'NON-TSTM WND DMG' 'DMG'
|
||||
'NON-TSTM WND GST'
|
||||
'RIP CURRENTS' 'RIP'
|
||||
'SEICHE' 'SEICHE'
|
||||
'SLEET'
|
||||
'SNOW'
|
||||
'STORM SURGE' 'SURGE'
|
||||
'TORNADO'
|
||||
'TROPICAL STORM'
|
||||
'TSTM WND DMG'
|
||||
'TSTM WND GST'
|
||||
'WATER SPOUT'
|
||||
'WILDFIRE' 'FIRE'
|
||||
'FREEZING DRIZZLE'
|
||||
'COASTAL FLOOD' 'Fld'
|
||||
'DEBRIS FLOW' 'DEBRIS'
|
||||
'BLOWING SNOW'
|
||||
'RAIN'
|
||||
'BLOWING DUST'
|
||||
'SNOW_24'
|
||||
'NO SGFNT WX'
|
|
@ -1,42 +1,49 @@
|
|||
n2s
|
||||
0 : 197
|
||||
1 : 198
|
||||
2 : 53
|
||||
3 : 199
|
||||
4 :
|
||||
5 : 58
|
||||
6 :
|
||||
7 :
|
||||
8 :
|
||||
9 :
|
||||
10 :
|
||||
11 : 204
|
||||
12 : 71
|
||||
13 : 43
|
||||
14 :
|
||||
15 : 165
|
||||
16 : 77
|
||||
17 : 161
|
||||
18 :
|
||||
19 :
|
||||
20 :
|
||||
21 : 121
|
||||
22 : 71
|
||||
23 : 37
|
||||
24 :
|
||||
25 :
|
||||
26 : 200
|
||||
27 :
|
||||
28 : 201
|
||||
29 :
|
||||
30 :
|
||||
31 : 77
|
||||
32 : 89
|
||||
33 :
|
||||
34 : 137
|
||||
35 : 120
|
||||
36 :
|
||||
37 : 203
|
||||
38 : 138
|
||||
39 :
|
||||
40 :
|
||||
s2s
|
||||
'AVALANCHE' 197
|
||||
'BLIZZARD' 198
|
||||
'DENSE FOG' 53
|
||||
'DOWNBURST' 199
|
||||
'DROUGHT'
|
||||
'DUST STORM' 58
|
||||
'EXCESSIVE HEAT'
|
||||
'EXTREME COLD'
|
||||
'EXTR WIND CHILL'
|
||||
'FLASH FLOOD'
|
||||
'FLOOD'
|
||||
'FREEZE' 204
|
||||
'FREEZING RAIN' 71
|
||||
'FUNNEL CLOUD' 43
|
||||
'HAIL' 80
|
||||
'HEAVY RAIN' 165
|
||||
'HEAVY SLEET' 77
|
||||
'HEAVY SNOW' 161
|
||||
'HIGH ASTR TIDES'
|
||||
'HIGH SURF'
|
||||
'HIGH SUST WINDS'
|
||||
'HURRICANE' 121
|
||||
'ICE STORM' 71
|
||||
'LIGHTNING' 37
|
||||
'LOW ASTR TIDES'
|
||||
'MARINE HAIL'
|
||||
'MARINE TSTM WIND' 200
|
||||
'NON-TSTM WND DMG'
|
||||
'NON-TSTM WND GST' 201
|
||||
'RIP CURRENTS'
|
||||
'SEICHE'
|
||||
'SLEET' 77
|
||||
'SNOW' 163
|
||||
'STORM SURGE'
|
||||
'TORNADO' 137
|
||||
'TROPICAL STORM' 120
|
||||
'TSTM WND DMG' 41
|
||||
'TSTM WND GST' 203
|
||||
'WATER SPOUT' 138
|
||||
'WILDFIRE'
|
||||
'FREEZING DRIZZLE' 68
|
||||
'COASTAL FLOOD'
|
||||
'DEBRIS FLOW'
|
||||
'BLOWING SNOW' 38
|
||||
'RAIN' 63
|
||||
'BLOWING DUST' 55
|
||||
'SNOW_24' 163
|
||||
'NO SGFNT WX' 0
|
|
@ -1,5 +1,39 @@
|
|||
/**
|
||||
* 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.pointdata.lookup;
|
||||
|
||||
/**
|
||||
* Interface for SVG plot lookup tables
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* ??? ??? Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @version 1.0
|
||||
*/
|
||||
public interface IAbstractLookupTable {
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,10 +1,31 @@
|
|||
/**
|
||||
* 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.pointdata.lookup;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
|
@ -21,6 +42,7 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Apr 21, 2011 ekladstrup Initial creation
|
||||
* Sep 16, 2014 2707 bclement added splitGroupedString()
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -28,6 +50,13 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
|
|||
* @version 1.0
|
||||
*/
|
||||
public class LookupUtils {
|
||||
|
||||
private static final Pattern WHITESPACE = Pattern.compile("\\s+");
|
||||
|
||||
private static enum QuotedState {
|
||||
OUTSIDE_GROUP, IN_SINGLE_QUOTES, IN_DOUBLE_QUOTES, IN_REGULAR_BLOCK
|
||||
}
|
||||
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(LookupUtils.class);
|
||||
|
||||
|
@ -56,10 +85,8 @@ public class LookupUtils {
|
|||
* non-critical errors
|
||||
*/
|
||||
public static TableTypes getTableType(File table) {
|
||||
try {
|
||||
BufferedReader input = new BufferedReader(new FileReader(table));
|
||||
try (BufferedReader input = new BufferedReader(new FileReader(table))) {
|
||||
String line = "";
|
||||
try {
|
||||
boolean stillLoop = true;
|
||||
while (stillLoop && (line = input.readLine()) != null) {
|
||||
line = line.trim();
|
||||
|
@ -91,14 +118,10 @@ public class LookupUtils {
|
|||
return TableTypes.UNKNOWN;
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
statusHandler.handle(Priority.SIGNIFICANT,
|
||||
e.getLocalizedMessage(), e);
|
||||
return TableTypes.UNKNOWN;
|
||||
}
|
||||
} catch (FileNotFoundException e) {
|
||||
statusHandler.handle(Priority.CRITICAL, e.getLocalizedMessage(), e);
|
||||
return null;
|
||||
} catch (IOException e) {
|
||||
statusHandler
|
||||
.error("Problem parsing SVG config table: " + table, e);
|
||||
return TableTypes.UNKNOWN;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -158,8 +181,85 @@ public class LookupUtils {
|
|||
return rval;
|
||||
}
|
||||
|
||||
/**
|
||||
* Split string on whitespaces
|
||||
*
|
||||
* @param line
|
||||
* @return
|
||||
*/
|
||||
public static String[] splitString(String line) {
|
||||
String[] rval = line.split("\\s+");
|
||||
return rval;
|
||||
return WHITESPACE.split(line);
|
||||
}
|
||||
|
||||
/**
|
||||
* Split string on whitespaces with double or single quoted groups. Any
|
||||
* character (including whitespaces) inside a quoted group will be a single
|
||||
* string in the returned array. Double quotes can be nested inside of
|
||||
* single quotes and vice versa.
|
||||
*
|
||||
* @param line
|
||||
* @return empty array if line is empty
|
||||
*/
|
||||
public static String[] splitGroupedString(String line) {
|
||||
QuotedState state = QuotedState.OUTSIDE_GROUP;
|
||||
List<String> rval = new ArrayList<String>();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
/* iterate over string; splitting out groups */
|
||||
for (int i = 0; i < line.length(); ++i) {
|
||||
char c = line.charAt(i);
|
||||
if (state == QuotedState.OUTSIDE_GROUP) {
|
||||
/* outside of a group all whitespace is ignored */
|
||||
if (!Character.isWhitespace(c)) {
|
||||
/* any non-whitespace transitions inside group */
|
||||
if (c == '\'') {
|
||||
state = QuotedState.IN_SINGLE_QUOTES;
|
||||
} else if (c == '"') {
|
||||
state = QuotedState.IN_DOUBLE_QUOTES;
|
||||
} else {
|
||||
state = QuotedState.IN_REGULAR_BLOCK;
|
||||
sb.append(c);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/* inside a group, look for transition out of group */
|
||||
QuotedState newState = null;
|
||||
switch (state) {
|
||||
case IN_REGULAR_BLOCK:
|
||||
if (Character.isWhitespace(c)) {
|
||||
newState = QuotedState.OUTSIDE_GROUP;
|
||||
} else if (c == '\'') {
|
||||
newState = QuotedState.IN_SINGLE_QUOTES;
|
||||
} else if (c == '"') {
|
||||
newState = QuotedState.IN_DOUBLE_QUOTES;
|
||||
}
|
||||
break;
|
||||
case IN_SINGLE_QUOTES:
|
||||
if (c == '\'') {
|
||||
newState = QuotedState.OUTSIDE_GROUP;
|
||||
}
|
||||
break;
|
||||
case IN_DOUBLE_QUOTES:
|
||||
if (c == '"') {
|
||||
newState = QuotedState.OUTSIDE_GROUP;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
}
|
||||
if (newState != null) {
|
||||
/* state changed, leave group */
|
||||
state = newState;
|
||||
rval.add(sb.toString());
|
||||
sb = new StringBuilder();
|
||||
} else {
|
||||
sb.append(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
/* add last group */
|
||||
if (sb.length() > 0) {
|
||||
rval.add(sb.toString());
|
||||
}
|
||||
return rval.toArray(new String[rval.size()]);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,10 +1,27 @@
|
|||
/**
|
||||
* 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.pointdata.lookup;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
|
||||
|
@ -49,6 +66,7 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Apr 21, 2011 ekladstrup Initial creation
|
||||
* Sep 16, 2014 2707 bclement removed warnings, closed input
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -71,18 +89,10 @@ public class N2SLookupTable implements IAbstractLookupTable {
|
|||
return key;
|
||||
}
|
||||
|
||||
public void setKey(Double key) {
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == null) {
|
||||
|
@ -118,7 +128,6 @@ public class N2SLookupTable implements IAbstractLookupTable {
|
|||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(N2SLookupTable.class);
|
||||
|
||||
private String mode = "";
|
||||
|
||||
/**
|
||||
* default value, for keys that do not specify a value in the table or other
|
||||
|
@ -135,8 +144,7 @@ public class N2SLookupTable implements IAbstractLookupTable {
|
|||
public N2SLookupTable(File table) {
|
||||
lookupList = new LinkedList<N2SPair>();
|
||||
tablePath = table.getAbsolutePath();
|
||||
try {
|
||||
BufferedReader input = new BufferedReader(new FileReader(table));
|
||||
try (BufferedReader input = new BufferedReader(new FileReader(table))) {
|
||||
String line = null;
|
||||
int lineNumber = 0;
|
||||
while ((line = input.readLine()) != null) {
|
||||
|
@ -153,10 +161,8 @@ public class N2SLookupTable implements IAbstractLookupTable {
|
|||
}
|
||||
}
|
||||
}
|
||||
} catch (FileNotFoundException e) {
|
||||
statusHandler.handle(Priority.CRITICAL, e.getLocalizedMessage(), e);
|
||||
} catch (IOException e) {
|
||||
statusHandler.handle(Priority.CRITICAL, e.getLocalizedMessage(), e);
|
||||
} catch (Exception e) {
|
||||
statusHandler.error("Unable to parse SVG table: " + table, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -277,7 +283,6 @@ public class N2SLookupTable implements IAbstractLookupTable {
|
|||
|
||||
@Override
|
||||
public void setMode(String mode) {
|
||||
this.mode = mode;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,10 +1,27 @@
|
|||
/**
|
||||
* 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.pointdata.lookup;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
|
||||
|
@ -12,14 +29,31 @@ import com.raytheon.uf.common.status.IUFStatusHandler;
|
|||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
|
||||
/**
|
||||
* Range lookup table for SVG plots
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* ??? ??? Initial creation
|
||||
* Sep 16, 2014 2707 bclement removed warnings, closed input
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author bclement
|
||||
* @version 1.0
|
||||
*/
|
||||
public class R2SLookupTable implements IAbstractLookupTable {
|
||||
|
||||
private class R2SPair {
|
||||
private Double low;
|
||||
private final Double low;
|
||||
|
||||
private Double high;
|
||||
private final Double high;
|
||||
|
||||
private String value;
|
||||
private final String value;
|
||||
|
||||
public R2SPair(Double low, Double high, String value) {
|
||||
this.low = low;
|
||||
|
@ -27,15 +61,6 @@ public class R2SLookupTable implements IAbstractLookupTable {
|
|||
this.value = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* set the low value of the range
|
||||
*
|
||||
* @param low
|
||||
*/
|
||||
public void setLow(Double low) {
|
||||
this.low = low;
|
||||
}
|
||||
|
||||
/**
|
||||
* get the low value of the range
|
||||
*
|
||||
|
@ -45,15 +70,6 @@ public class R2SLookupTable implements IAbstractLookupTable {
|
|||
return low;
|
||||
}
|
||||
|
||||
/**
|
||||
* set the high value of the range
|
||||
*
|
||||
* @param high
|
||||
*/
|
||||
public void setHigh(Double high) {
|
||||
this.high = high;
|
||||
}
|
||||
|
||||
/**
|
||||
* get the high value of the range
|
||||
*
|
||||
|
@ -63,15 +79,6 @@ public class R2SLookupTable implements IAbstractLookupTable {
|
|||
return high;
|
||||
}
|
||||
|
||||
/**
|
||||
* set the string the range maps to
|
||||
*
|
||||
* @param value
|
||||
*/
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* get the string the range maps to
|
||||
*
|
||||
|
@ -124,8 +131,6 @@ public class R2SLookupTable implements IAbstractLookupTable {
|
|||
}
|
||||
}
|
||||
|
||||
private String mode = "";
|
||||
|
||||
LinkedList<R2SPair> lookupList = null;
|
||||
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
|
@ -141,8 +146,7 @@ public class R2SLookupTable implements IAbstractLookupTable {
|
|||
lookupList = new LinkedList<R2SPair>();
|
||||
tablePath = table.getAbsolutePath();
|
||||
|
||||
try {
|
||||
BufferedReader input = new BufferedReader(new FileReader(table));
|
||||
try (BufferedReader input = new BufferedReader(new FileReader(table))) {
|
||||
String line = null;
|
||||
int lineNumber = 0;
|
||||
while ((line = input.readLine()) != null) {
|
||||
|
@ -160,10 +164,8 @@ public class R2SLookupTable implements IAbstractLookupTable {
|
|||
}
|
||||
}
|
||||
}
|
||||
} catch (FileNotFoundException e) {
|
||||
statusHandler.handle(Priority.CRITICAL, e.getLocalizedMessage(), e);
|
||||
} catch (IOException e) {
|
||||
statusHandler.handle(Priority.CRITICAL, e.getLocalizedMessage(), e);
|
||||
} catch (Exception e) {
|
||||
statusHandler.error("Unable to parse SVG table: " + table, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -295,7 +297,6 @@ public class R2SLookupTable implements IAbstractLookupTable {
|
|||
|
||||
@Override
|
||||
public void setMode(String mode) {
|
||||
this.mode = mode;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,10 +1,27 @@
|
|||
/**
|
||||
* 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.pointdata.lookup;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
|
@ -61,6 +78,7 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Apr 21, 2011 ekladstrup Initial creation
|
||||
* Sep 16, 2014 2707 bclement removed warnings, split respects quotes
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -136,22 +154,19 @@ public class S2SLookupTable implements IAbstractLookupTable {
|
|||
public S2SLookupTable(File table) {
|
||||
lookupList = new LinkedList<S2SPair>();
|
||||
tablePath = table.getAbsolutePath();
|
||||
try {
|
||||
BufferedReader input = new BufferedReader(new FileReader(table));
|
||||
try (BufferedReader input = new BufferedReader(new FileReader(table))) {
|
||||
String line = null;
|
||||
int lineNumber = 0;
|
||||
while ((line = input.readLine()) != null) {
|
||||
lineNumber++;
|
||||
if (!line.isEmpty() && !line.equals("s2s")
|
||||
&& !line.startsWith("//") && !line.startsWith("#")) {
|
||||
String[] columns = LookupUtils.splitString(line);
|
||||
String[] columns = LookupUtils.splitGroupedString(line);
|
||||
handleLine(columns, lineNumber, line);
|
||||
}
|
||||
}
|
||||
} catch (FileNotFoundException e) {
|
||||
statusHandler.handle(Priority.CRITICAL, e.getLocalizedMessage(), e);
|
||||
} catch (IOException e) {
|
||||
statusHandler.handle(Priority.CRITICAL, e.getLocalizedMessage(), e);
|
||||
} catch (Exception e) {
|
||||
statusHandler.error("Unable to parse SVG table: " + table, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -60,6 +60,7 @@ import com.raytheon.viz.pointdata.rsc.retrieve.PointDataPlotInfoRetriever;
|
|||
* IPathManager.SEPARATOR
|
||||
* Sep 05, 2013 2316 bsteffen Unify pirep and ncpirep.
|
||||
* Jun 06, 2014 2061 bsteffen Remove old PlotResource
|
||||
* Sep 16, 2014 2707 bclement lsr no longer uses dataURI
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -144,7 +145,6 @@ public class PlotResourceData extends AbstractRequestableResourceData {
|
|||
*/
|
||||
pluginProps.put("bufrquikscat", new PluginPlotProperties(false));
|
||||
pluginProps.put("radar", new PluginPlotProperties(false));
|
||||
pluginProps.put("lsr", new PluginPlotProperties(false));
|
||||
pluginProps.put("tcg", new PluginPlotProperties(false));
|
||||
pluginProps.put("svrwx", new PluginPlotProperties(false));
|
||||
pluginProps.put("ldadhydro", new PluginPlotProperties(false));
|
||||
|
@ -180,6 +180,7 @@ public class PlotResourceData extends AbstractRequestableResourceData {
|
|||
pluginProps.put("pirep", new PluginPlotProperties());
|
||||
pluginProps.put("airep", new PluginPlotProperties());
|
||||
pluginProps.put("acars", new PluginPlotProperties());
|
||||
pluginProps.put("lsr", new PluginPlotProperties());
|
||||
|
||||
ParsedURL.registerHandler(new LocalizationParsedURLHandler());
|
||||
}
|
||||
|
|
95
deltaScripts/14.4.1/DR2707/updateLsrTable.sh
Executable file
95
deltaScripts/14.4.1/DR2707/updateLsrTable.sh
Executable file
|
@ -0,0 +1,95 @@
|
|||
#!/bin/bash
|
||||
|
||||
# eventType was stored as the numeric ID of an enum
|
||||
# this does not cover all event types and storing the raw string is prefered
|
||||
|
||||
DBUSER="awips"
|
||||
DBNAME="metadata"
|
||||
|
||||
TABLE_NAME='lsr'
|
||||
COLUMN_NAME='eventtype'
|
||||
BACKUP_NAME='eventtype_old'
|
||||
DATAURI_COLUMN='datauri'
|
||||
STATION_COLUMN='stationid'
|
||||
LAT_COLUMN='latitude'
|
||||
LON_COLUMN='longitude'
|
||||
|
||||
CONSTRAINT_NAME='latitude_longitude_officeId_refTime_forecastTime_eventType'
|
||||
CONSTRAINT_COLUMNS='latitude, longitude, officeId, refTime, forecastTime, eventType'
|
||||
|
||||
PSQL="/awips2/psql/bin/psql"
|
||||
|
||||
SQL_STATEMENT="
|
||||
BEGIN;
|
||||
ALTER TABLE ${TABLE_NAME} RENAME COLUMN ${COLUMN_NAME} to ${BACKUP_NAME};
|
||||
ALTER TABLE ${TABLE_NAME} ADD COLUMN ${COLUMN_NAME} character varying(255);
|
||||
UPDATE ${TABLE_NAME}
|
||||
SET ${COLUMN_NAME} =
|
||||
CASE ${BACKUP_NAME}
|
||||
WHEN 0 then 'AVALANCHE'
|
||||
WHEN 1 then 'BLIZZARD'
|
||||
WHEN 2 then 'DENSE FOG'
|
||||
WHEN 3 then 'DOWNBURST'
|
||||
WHEN 4 then 'DROUGHT'
|
||||
WHEN 5 then 'DUST STORM'
|
||||
WHEN 6 then 'EXCESSIVE HEAT'
|
||||
WHEN 7 then 'EXTREME COLD'
|
||||
WHEN 8 then 'EXTR WIND CHILL'
|
||||
WHEN 9 then 'FLASH FLOOD'
|
||||
WHEN 10 then 'FLOOD'
|
||||
WHEN 11 then 'FREEZE'
|
||||
WHEN 12 then 'FREEZING RAIN'
|
||||
WHEN 13 then 'FUNNEL CLOUD'
|
||||
WHEN 14 then 'HAIL'
|
||||
WHEN 15 then 'HEAVY RAIN'
|
||||
WHEN 16 then 'HEAVY SLEET'
|
||||
WHEN 17 then 'HEAVY SNOW'
|
||||
WHEN 18 then 'HIGH ASTR TIDES'
|
||||
WHEN 19 then 'HIGH SURF'
|
||||
WHEN 20 then 'HIGH SUST WINDS'
|
||||
WHEN 21 then 'HURRICANE'
|
||||
WHEN 22 then 'ICE STORM'
|
||||
WHEN 23 then 'LIGHTNING'
|
||||
WHEN 24 then 'LOW ASTR TIDES'
|
||||
WHEN 25 then 'MARINE HAIL'
|
||||
WHEN 26 then 'MARINE TSTM WIND'
|
||||
WHEN 27 then 'NON-TSTM WND DMG'
|
||||
WHEN 28 then 'NON-TSTM WND GST'
|
||||
WHEN 29 then 'RIP CURRENTS'
|
||||
WHEN 30 then 'SEICHE'
|
||||
WHEN 31 then 'SLEET'
|
||||
WHEN 32 then 'SNOW'
|
||||
WHEN 33 then 'STORM SURGE'
|
||||
WHEN 34 then 'TORNADO'
|
||||
WHEN 35 then 'TROPICAL STORM'
|
||||
WHEN 36 then 'TSTM WND DMG'
|
||||
WHEN 37 then 'TSTM WND GST'
|
||||
WHEN 38 then 'WATER SPOUT'
|
||||
WHEN 39 then 'WILDFIRE'
|
||||
WHEN 40 then 'FREEZING DRIZZLE'
|
||||
WHEN 41 then 'COASTAL FLOOD'
|
||||
WHEN 42 then 'DEBRIS FLOW'
|
||||
WHEN 43 then 'BLOWING SNOW'
|
||||
WHEN 44 then 'RAIN'
|
||||
ELSE ${BACKUP_NAME}
|
||||
END;
|
||||
UPDATE ${TABLE_NAME} set ${STATION_COLUMN} = concat(${LON_COLUMN}, ':', ${LAT_COLUMN});
|
||||
ALTER TABLE ${TABLE_NAME} DROP COLUMN ${BACKUP_NAME};
|
||||
ALTER TABLE ${TABLE_NAME} DROP COLUMN ${DATAURI_COLUMN};
|
||||
ALTER TABLE ${TABLE_NAME} ADD CONSTRAINT ${CONSTRAINT_NAME} UNIQUE (${CONSTRAINT_COLUMNS});
|
||||
COMMIT;"
|
||||
|
||||
COLUMN_TYPE=$(${PSQL} -U ${DBUSER} -d ${DBNAME} -tc "select data_type from INFORMATION_SCHEMA.COLUMNS where table_name = '${TABLE_NAME}' and column_name = '${COLUMN_NAME}'")
|
||||
|
||||
if [[ $COLUMN_TYPE =~ integer ]]
|
||||
then
|
||||
if ${PSQL} -U ${DBUSER} -d ${DBNAME} -c "${SQL_STATEMENT}"
|
||||
then
|
||||
echo "${TABLE_NAME} updated successfully, vacuuming table"
|
||||
${PSQL} -U ${DBUSER} -d ${DBNAME} -c "VACUUM FULL ANALYZE ${TABLE_NAME}"
|
||||
else
|
||||
echo "Update failed on ${TABLE_NAME}"
|
||||
fi
|
||||
else
|
||||
echo "$TABLE_NAME already updated, no changes made"
|
||||
fi
|
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
|||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: Lsr Plug-in
|
||||
Bundle-SymbolicName: com.raytheon.uf.common.dataplugin.lsr
|
||||
Bundle-Version: 1.14.0.qualifier
|
||||
Bundle-Version: 1.14.1.qualifier
|
||||
Bundle-Vendor: RAYTHEON
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
|
||||
Require-Bundle: com.raytheon.uf.common.serialization,
|
||||
|
|
|
@ -1,142 +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.uf.common.dataplugin.lsr;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* Local Storm Report event type
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Oct 14, 2009 jkorman Initial creation
|
||||
* Dec 09, 2013 2581 njensen Added freezing drizzle
|
||||
* Jan 03, 2014 2581 njensen Added coastal flood
|
||||
* Jan 13, 2014 2581 njensen Added debris flow
|
||||
* Jan 17, 2014 2581 njensen Added blowing snow
|
||||
* Jan 30, 2014 2581 njensen Added rain
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author jkorman
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public enum LSREventType {
|
||||
|
||||
AVALANCHE("AVALANCHE",0,LSRUnits.NOUNITS),
|
||||
BLIZZARD("BLIZZARD",1,LSRUnits.NOUNITS),
|
||||
DENSEFOG("DENSE FOG",2,LSRUnits.NOUNITS),
|
||||
DOWNBURST("DOWNBURST",3,LSRUnits.NOUNITS),
|
||||
DROUGHT("DROUGHT",4,LSRUnits.NOUNITS),
|
||||
DUSTSTORM("DUST STORM",5,LSRUnits.NOUNITS),
|
||||
EXCESSIVEHEAT("EXCESSIVE HEAT",6,LSRUnits.FAHRENHEIT),
|
||||
EXTREMECOLD("EXTREME COLD",7,LSRUnits.FAHRENHEIT),
|
||||
EXTRWINDCHILL("EXTR WIND CHILL",8,LSRUnits.FAHRENHEIT),
|
||||
FLASHFLOOD("FLASH FLOOD",9,LSRUnits.NOUNITS),
|
||||
FLOOD("FLOOD",10,LSRUnits.NOUNITS),
|
||||
FREEZE("FREEZE",11,LSRUnits.FAHRENHEIT),
|
||||
FREEZINGRAIN("FREEZING RAIN",12,LSRUnits.INCH),
|
||||
FUNNELCLOUD("FUNNEL CLOUD",13,LSRUnits.NOUNITS),
|
||||
HAIL("HAIL",14,LSRUnits.INCH),
|
||||
HEAVYRAIN("HEAVY RAIN",15,LSRUnits.INCH),
|
||||
HEAVYSLEET("HEAVY SLEET",16,LSRUnits.INCH),
|
||||
HEAVYSNOW("HEAVY SNOW",17,LSRUnits.INCH),
|
||||
HIGHASTRTIDES("HIGH ASTR TIDES",18,LSRUnits.NOUNITS),
|
||||
HIGHSURF("HIGH SURF",19,LSRUnits.NOUNITS),
|
||||
HIGHSUSTWINDS("HIGH SUST WINDS",20,LSRUnits.MPH),
|
||||
HURRICANE("HURRICANE",21,LSRUnits.NOUNITS),
|
||||
ICESTORM("ICE STORM",22,LSRUnits.NOUNITS),
|
||||
LIGHTNING("LIGHTNING",23,LSRUnits.NOUNITS),
|
||||
LOWASTRTIDES("LOW ASTR TIDES",24,LSRUnits.NOUNITS),
|
||||
MARINEHAIL("MARINE HAIL",25,LSRUnits.INCH),
|
||||
MARINETSTMWIND("MARINE TSTM WIND",26,LSRUnits.MPH),
|
||||
NONTSTMWNDDMG("NON-TSTM WND DMG",27,LSRUnits.NOUNITS),
|
||||
NONTSTMWNDGST("NON-TSTM WND GST",28,LSRUnits.MPH),
|
||||
RIPCURRENTS("RIP CURRENTS",29,LSRUnits.NOUNITS),
|
||||
SEICHE("SEICHE",30,LSRUnits.NOUNITS),
|
||||
SLEET("SLEET",31,LSRUnits.INCH),
|
||||
SNOW("SNOW",32,LSRUnits.INCH),
|
||||
STORMSURGE("STORM SURGE",33,LSRUnits.FT),
|
||||
TORNADO("TORNADO",34,LSRUnits.FUJITA),
|
||||
TROPICALSTORM("TROPICAL STORM",35,LSRUnits.NOUNITS),
|
||||
TSTMWNDDMG("TSTM WND DMG",36,LSRUnits.NOUNITS),
|
||||
TSTMWNDGST("TSTM WND GST",37,LSRUnits.MPH),
|
||||
WATERSPOUT("WATER SPOUT",38,LSRUnits.NOUNITS),
|
||||
WILDFIRE("WILDFIRE",39,LSRUnits.NOUNITS),
|
||||
FREEZINGDRIZZLE("FREEZING DRIZZLE", 40, LSRUnits.NOUNITS),
|
||||
COASTALFLOOD("COASTAL FLOOD", 41, LSRUnits.NOUNITS),
|
||||
DEBRISFLOW("DEBRIS FLOW", 42, LSRUnits.NOUNITS),
|
||||
BLOWINGSNOW("BLOWING SNOW", 43, LSRUnits.NOUNITS),
|
||||
RAIN("RAIN", 44, LSRUnits.NOUNITS);
|
||||
|
||||
// TODO contemplate storing the event type as a string in the database instead of an enum/integer
|
||||
|
||||
private final String eventName;
|
||||
|
||||
private final int value;
|
||||
|
||||
private final LSRUnits eventUnits;
|
||||
|
||||
private static Map<String,LSREventType> lookup = new HashMap<String,LSREventType>();
|
||||
static {
|
||||
for(LSREventType t : LSREventType.values()) {
|
||||
lookup.put(t.getEventName(), t);
|
||||
}
|
||||
}
|
||||
|
||||
private LSREventType(String name, int value, LSRUnits units) {
|
||||
eventName = name;
|
||||
this.value = value;
|
||||
eventUnits = units;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the eventName
|
||||
*/
|
||||
public String getEventName() {
|
||||
return eventName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the value
|
||||
*/
|
||||
public int getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the eventUnits
|
||||
*/
|
||||
public LSRUnits getEventUnits() {
|
||||
return eventUnits;
|
||||
}
|
||||
|
||||
public static LSREventType lookup(String event) {
|
||||
return lookup.get(event);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,99 +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.uf.common.dataplugin.lsr;
|
||||
|
||||
/**
|
||||
* TODO Add Description
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Oct 14, 2009 jkorman Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author jkorman
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public enum LSRUnits {
|
||||
|
||||
FUJITA("enum"),
|
||||
FAHRENHEIT("f"),
|
||||
INCH("in"),
|
||||
FT("ft"),
|
||||
MPH("mi/hr"),
|
||||
NOUNITS("enum");
|
||||
|
||||
//eventType:units_0 = "NO_UNITS" ;
|
||||
//eventType:units_1 = "NO_UNITS" ;
|
||||
//eventType:units_2 = "NO_UNITS" ;
|
||||
//eventType:units_3 = "NO_UNITS" ;
|
||||
//eventType:units_4 = "NO_UNITS" ;
|
||||
//eventType:units_5 = "NO_UNITS" ;
|
||||
//eventType:units_6 = "F" ;
|
||||
//eventType:units_7 = "F" ;
|
||||
//eventType:units_8 = "F" ;
|
||||
//eventType:units_9 = "NO_UNITS" ;
|
||||
//eventType:units_10 = "NO_UNITS" ;
|
||||
//eventType:units_11 = "F" ;
|
||||
//eventType:units_12 = "in" ;
|
||||
//eventType:units_13 = "NO_UNITS" ;
|
||||
//eventType:units_14 = "in" ;
|
||||
//eventType:units_15 = "in" ;
|
||||
//eventType:units_16 = "in" ;
|
||||
//eventType:units_17 = "in" ;
|
||||
//eventType:units_18 = "NO_UNITS" ;
|
||||
//eventType:units_19 = "NO_UNITS" ;
|
||||
//eventType:units_20 = "mi/hr" ;
|
||||
//eventType:units_21 = "NO_UNITS" ;
|
||||
//eventType:units_22 = "NO_UNITS" ;
|
||||
//eventType:units_23 = "NO_UNITS" ;
|
||||
//eventType:units_24 = "NO_UNITS" ;
|
||||
//eventType:units_25 = "in" ;
|
||||
//eventType:units_26 = "mi/hr" ;
|
||||
//eventType:units_27 = "NO_UNITS" ;
|
||||
//eventType:units_28 = "mi/hr" ;
|
||||
//eventType:units_29 = "NO_UNITS" ;
|
||||
//eventType:units_30 = "NO_UNITS" ;
|
||||
//eventType:units_31 = "in" ;
|
||||
//eventType:units_32 = "in" ;
|
||||
//eventType:units_33 = "ft" ;
|
||||
//eventType:units_34 = "Fujita" ;
|
||||
//eventType:units_35 = "NO_UNITS" ;
|
||||
//eventType:units_36 = "NO_UNITS" ;
|
||||
//eventType:units_37 = "mi/hr" ;
|
||||
//eventType:units_38 = "NO_UNITS" ;
|
||||
//eventType:units_39 = "NO_UNITS" ;
|
||||
//eventType:comment_0 = "N is a flag for no units";
|
||||
//eventType:comment_1 = "Y is a flag for Fujita Scale";
|
||||
|
||||
private final String unitsId;
|
||||
|
||||
private LSRUnits(String id) {
|
||||
unitsId = id;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -30,8 +30,6 @@ import javax.measure.quantity.Velocity;
|
|||
import javax.measure.unit.NonSI;
|
||||
import javax.measure.unit.SI;
|
||||
import javax.measure.unit.Unit;
|
||||
import javax.persistence.Access;
|
||||
import javax.persistence.AccessType;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Embedded;
|
||||
import javax.persistence.Entity;
|
||||
|
@ -73,6 +71,7 @@ import com.vividsolutions.jts.geom.Geometry;
|
|||
* Dec 10, 2013 2581 njensen Removed dataURI column
|
||||
* Jan 15, 2014 2581 njensen Changed constraint to use officeId instead of stationId
|
||||
* Jan 30, 2014 2581 njensen Added dataURI column back in
|
||||
* Sep 16, 2014 2707 bclement removed dataURI column, event type now string, added event units
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -82,8 +81,8 @@ import com.vividsolutions.jts.geom.Geometry;
|
|||
@Entity
|
||||
@SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "lsrseq")
|
||||
@Table(name = "lsr", uniqueConstraints = { @UniqueConstraint(columnNames = {
|
||||
// "latitude", "longitude", "officeId", "refTime", "forecastTime", "eventType"
|
||||
"dataURI" }) })
|
||||
"latitude", "longitude", "officeId", "refTime", "forecastTime",
|
||||
"eventType" }) })
|
||||
/*
|
||||
* Both refTime and forecastTime are included in the refTimeIndex since
|
||||
* forecastTime is unlikely to be used.
|
||||
|
@ -118,7 +117,11 @@ public class LocalStormReport extends PersistablePluginDataObject implements
|
|||
@DataURI(position = 1)
|
||||
@Column
|
||||
@DynamicSerializeElement
|
||||
private LSREventType eventType;
|
||||
private String eventType;
|
||||
|
||||
@Transient
|
||||
@DynamicSerializeElement
|
||||
private String eventUnits;
|
||||
|
||||
// Correction indicator from wmo header
|
||||
@Column
|
||||
|
@ -210,7 +213,7 @@ public class LocalStormReport extends PersistablePluginDataObject implements
|
|||
/**
|
||||
* @return the eventType
|
||||
*/
|
||||
public LSREventType getEventType() {
|
||||
public String getEventType() {
|
||||
return eventType;
|
||||
}
|
||||
|
||||
|
@ -218,10 +221,25 @@ public class LocalStormReport extends PersistablePluginDataObject implements
|
|||
* @param eventType
|
||||
* the eventType to set
|
||||
*/
|
||||
public void setEventType(LSREventType eventType) {
|
||||
public void setEventType(String eventType) {
|
||||
this.eventType = eventType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the eventUnits
|
||||
*/
|
||||
public String getEventUnits() {
|
||||
return eventUnits;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param eventUnits
|
||||
* the eventUnits to set
|
||||
*/
|
||||
public void setEventUnits(String eventUnits) {
|
||||
this.eventUnits = eventUnits;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the corIndicator
|
||||
*/
|
||||
|
@ -407,6 +425,7 @@ public class LocalStormReport extends PersistablePluginDataObject implements
|
|||
*
|
||||
* @param dataURI
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void setDataURI(String dataURI) {
|
||||
super.setDataURI(dataURI);
|
||||
|
@ -441,7 +460,11 @@ public class LocalStormReport extends PersistablePluginDataObject implements
|
|||
* @return The geometry latitude.
|
||||
*/
|
||||
public double getLatitude() {
|
||||
return location.getLatitude();
|
||||
if (location == null) {
|
||||
return Double.NaN;
|
||||
} else {
|
||||
return location.getLatitude();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -450,7 +473,11 @@ public class LocalStormReport extends PersistablePluginDataObject implements
|
|||
* @return The geometry longitude.
|
||||
*/
|
||||
public double getLongitude() {
|
||||
return location.getLongitude();
|
||||
if (location == null) {
|
||||
return Double.NaN;
|
||||
} else {
|
||||
return location.getLongitude();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -459,7 +486,11 @@ public class LocalStormReport extends PersistablePluginDataObject implements
|
|||
* @return the stationId
|
||||
*/
|
||||
public String getStationId() {
|
||||
return location.getStationId();
|
||||
if (location == null) {
|
||||
return null;
|
||||
} else {
|
||||
return location.getStationId();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -502,9 +533,8 @@ public class LocalStormReport extends PersistablePluginDataObject implements
|
|||
}
|
||||
sb.append(String.format("%6.2f %7.2f:", getLatitude(), getLongitude()));
|
||||
sb.append(String.format("%s:", cityLoc));
|
||||
sb.append(String.format("%s:", eventType.getEventName()));
|
||||
sb.append(String.format("%5.2f:%s", getMagnitude(), getEventType()
|
||||
.getEventUnits()));
|
||||
sb.append(String.format("%s:", eventType));
|
||||
sb.append(String.format("%5.2f:%s", getMagnitude(), eventUnits));
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
@ -513,10 +543,4 @@ public class LocalStormReport extends PersistablePluginDataObject implements
|
|||
return "lsr";
|
||||
}
|
||||
|
||||
@Override
|
||||
@Column
|
||||
@Access(AccessType.PROPERTY)
|
||||
public String getDataURI() {
|
||||
return super.getDataURI();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
#Wed Oct 14 07:46:21 CDT 2009
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
|
||||
org.eclipse.jdt.core.compiler.compliance=1.6
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.source=1.6
|
|
@ -2,9 +2,9 @@ Manifest-Version: 1.0
|
|||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: Lsr Plug-in
|
||||
Bundle-SymbolicName: com.raytheon.uf.edex.plugin.lsr
|
||||
Bundle-Version: 1.13.0.qualifier
|
||||
Bundle-Version: 1.14.1.qualifier
|
||||
Bundle-Vendor: RAYTHEON
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
|
||||
Require-Bundle: com.raytheon.uf.common.dataplugin.lsr;bundle-version="1.0.0",
|
||||
com.raytheon.uf.edex.decodertools,
|
||||
com.raytheon.uf.common.pointdata,
|
||||
|
|
|
@ -22,9 +22,7 @@
|
|||
Local Storm Reports
|
||||
-->
|
||||
<pointDataDescription>
|
||||
<parameter name="timeObs" numDims="1" type="LONG" />
|
||||
<parameter name="wmoHeader" numDims="1" type="STRING" />
|
||||
<parameter name="eventType" numDims="1" type="INT" />
|
||||
<parameter name="eventUnit" numDims="1" type="STRING" />
|
||||
<parameter name="magnitude" numDims="1" type="FLOAT" />
|
||||
<parameter name="countylocation" numDims="1" type="STRING" />
|
||||
|
|
|
@ -2,5 +2,7 @@
|
|||
<pointDataDbDescription>
|
||||
<parameter name="latitude" queryName="location.latitude" type="FLOAT" unit="°" />
|
||||
<parameter name="longitude" queryName="location.longitude" type="FLOAT" unit="°" />
|
||||
<parameter name="dataURI" queryName="dataURI" type="STRING" />
|
||||
<parameter name="stationId" queryName="location.stationId" type="STRING" />
|
||||
<parameter name="eventType" queryName="eventType" type="STRING" />
|
||||
<parameter name="timeObs" queryName="dataTime.refTime" numDims="1" type="LONG" unit="ms" />
|
||||
</pointDataDbDescription>
|
|
@ -30,7 +30,6 @@ import java.util.regex.Pattern;
|
|||
|
||||
import com.raytheon.edex.esb.Headers;
|
||||
import com.raytheon.uf.common.dataplugin.exception.UnrecognizedDataException;
|
||||
import com.raytheon.uf.common.dataplugin.lsr.LSREventType;
|
||||
import com.raytheon.uf.common.dataplugin.lsr.LocalStormReport;
|
||||
import com.raytheon.uf.common.pointdata.PointDataContainer;
|
||||
import com.raytheon.uf.common.pointdata.PointDataDescription;
|
||||
|
@ -60,6 +59,7 @@ import com.raytheon.uf.edex.plugin.lsr.LocalStormReportDao;
|
|||
* May 14, 2014 2536 bclement moved WMO Header to common, removed TimeTools usage
|
||||
* Jul 23, 2014 3410 bclement location changed to floats
|
||||
* Jul 30, 2014 3410 bclement lat, lon and data uri moved to database point data desc
|
||||
* Sep 16, 2014 2707 bclement removed event type from PDV, generated stationId
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -239,13 +239,9 @@ public class LSRParser {
|
|||
|
||||
// Populate the point data.
|
||||
PointDataView view = pdc.append();
|
||||
view.setLong("timeObs", report.getDataTime()
|
||||
.getRefTimeAsCalendar().getTimeInMillis());
|
||||
view.setString("wmoHeader", report.getWmoHeader());
|
||||
|
||||
view.setInt("eventType", report.getEventType().getValue());
|
||||
view.setString("eventUnit", report.getEventType()
|
||||
.getEventUnits().name());
|
||||
view.setString("eventUnit", report.getEventUnits());
|
||||
view.setFloat("magnitude", report.getMagnitude());
|
||||
view.setString("countylocation", report.getCountyLoc());
|
||||
view.setString("statelocation", report.getStateLoc());
|
||||
|
@ -320,7 +316,7 @@ public class LSRParser {
|
|||
try {
|
||||
if (parseTimeLine(s, rpt)) {
|
||||
List<InternalReport> rptLines = r.getSubLines();
|
||||
if (rptLines != null) {
|
||||
if (rptLines != null && !rptLines.isEmpty()) {
|
||||
r = rptLines.get(0);
|
||||
if (InternalType.DATE.equals(r
|
||||
.getLineType())) {
|
||||
|
@ -375,12 +371,7 @@ public class LSRParser {
|
|||
}
|
||||
}
|
||||
ss = timeLine.substring(EVENT, EVENT + EVENT_LENGTH).trim();
|
||||
LSREventType eventType = LSREventType.lookup(ss);
|
||||
if (eventType == null) {
|
||||
throw new UnrecognizedDataException(
|
||||
"LSRParser does not recognize eventType " + ss);
|
||||
}
|
||||
rpt.setEventType(eventType);
|
||||
rpt.setEventType(ss);
|
||||
|
||||
ss = timeLine.substring(LOCATION, LOCATION + LOCATION_LENGTH)
|
||||
.trim();
|
||||
|
@ -459,9 +450,10 @@ public class LSRParser {
|
|||
lon *= -1;
|
||||
}
|
||||
|
||||
SurfaceObsLocation loc = new SurfaceObsLocation("LSR");
|
||||
SurfaceObsLocation loc = new SurfaceObsLocation();
|
||||
loc.assignLocation(lat, lon);
|
||||
loc.setElevation(PDV_FILL_INT);
|
||||
loc.generateCoordinateStationId();
|
||||
rpt.setLocation(loc);
|
||||
locOk = true;
|
||||
}
|
||||
|
@ -532,12 +524,7 @@ public class LSRParser {
|
|||
} catch (NumberFormatException nfe) {
|
||||
logger.info("Unknown magnitude value " + magData);
|
||||
}
|
||||
String eventUnits = rpt.getEventType().getEventUnits()
|
||||
.toString();
|
||||
if (!eventUnits.equals(magUnit)) {
|
||||
logger.info(traceId + "- Units do not match [" + magUnit
|
||||
+ "|" + eventUnits + "]");
|
||||
}
|
||||
rpt.setEventUnits(magUnit);
|
||||
} else if (magData.startsWith("F")) {
|
||||
// Tornado fujita scale data.
|
||||
rpt.setMagQual(0);
|
||||
|
|
Loading…
Add table
Reference in a new issue