Omaha #3685 Add support for sending specific products in mixed case
Change-Id: I3c7e8bfe285ce7344ddfccf28173a68f3396b126 Former-commit-id:5d07d13aa0
[formerlye729cd8814
[formerly 18d4fc13ebbd77b3a476bc70252fae1322d631c6]] Former-commit-id:e729cd8814
Former-commit-id:64162dd9c0
This commit is contained in:
parent
0533f42bc1
commit
24989f60b0
27 changed files with 8017 additions and 7922 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -7,6 +7,7 @@ testBin/
|
||||||
bin-test/
|
bin-test/
|
||||||
*.class
|
*.class
|
||||||
*.pyo
|
*.pyo
|
||||||
|
*.pyc
|
||||||
*.o
|
*.o
|
||||||
*.orig
|
*.orig
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
# Date Ticket# Engineer Description
|
# Date Ticket# Engineer Description
|
||||||
# ------------ ---------- ----------- --------------------------
|
# ------------ ---------- ----------- --------------------------
|
||||||
# 02/12/2014 #2591 randerso Added retry when loading combinations fails
|
# 02/12/2014 #2591 randerso Added retry when loading combinations fails
|
||||||
|
# 10/20/2014 #3685 randerso Changed default of lowerCase to True if not specified
|
||||||
|
|
||||||
import string, getopt, sys, time, os, types, math
|
import string, getopt, sys, time, os, types, math
|
||||||
import ModuleAccessor
|
import ModuleAccessor
|
||||||
|
@ -191,7 +192,7 @@ class TextFormatter:
|
||||||
if language is not None:
|
if language is not None:
|
||||||
text = product.translateForecast(text, language)
|
text = product.translateForecast(text, language)
|
||||||
# Convert to Upper Case
|
# Convert to Upper Case
|
||||||
if not forecastDef.get('lowerCase', 0):
|
if not forecastDef.get('lowerCase', True):
|
||||||
text = text.upper()
|
text = text.upper()
|
||||||
else:
|
else:
|
||||||
text = "Text Product Type Invalid " + \
|
text = "Text Product Type Invalid " + \
|
||||||
|
|
|
@ -27,6 +27,12 @@
|
||||||
#
|
#
|
||||||
# Author: hansen
|
# Author: hansen
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# SOFTWARE HISTORY
|
||||||
|
#
|
||||||
|
# Date Ticket# Engineer Description
|
||||||
|
# ------------ ---------- ----------- --------------------------
|
||||||
|
# 10/20/2014 #3685 randerso Changes to support mixed case products
|
||||||
|
|
||||||
import EditAreaUtils
|
import EditAreaUtils
|
||||||
import StringUtils
|
import StringUtils
|
||||||
|
@ -49,7 +55,7 @@ class Header(EditAreaUtils.EditAreaUtils, StringUtils.StringUtils):
|
||||||
cityDescriptor ="Including the cities of",
|
cityDescriptor ="Including the cities of",
|
||||||
areaList=None, includeCities=1, includeZoneNames=1,
|
areaList=None, includeCities=1, includeZoneNames=1,
|
||||||
includeIssueTime=1, includeCodes=1, includeVTECString=1,
|
includeIssueTime=1, includeCodes=1, includeVTECString=1,
|
||||||
hVTECString=None, accurateCities=False):
|
hVTECString=None, accurateCities=False, upperCase=True):
|
||||||
# Make a UGC area header for the given areaLabel
|
# Make a UGC area header for the given areaLabel
|
||||||
# Determine list of areas (there could be more than one if we are using a combination)
|
# Determine list of areas (there could be more than one if we are using a combination)
|
||||||
|
|
||||||
|
@ -227,7 +233,17 @@ class Header(EditAreaUtils.EditAreaUtils, StringUtils.StringUtils):
|
||||||
if cityString != "":
|
if cityString != "":
|
||||||
numCities = len(string.split(cityString, "...")[1:])
|
numCities = len(string.split(cityString, "...")[1:])
|
||||||
if numCities == 1:
|
if numCities == 1:
|
||||||
cityDescriptor = string.replace(cityDescriptor, "CITIES", "CITY")
|
def preserveCase(matchobj):
|
||||||
|
orig = matchobj.group(0)
|
||||||
|
repl = 'city'
|
||||||
|
retv = ''
|
||||||
|
for i in range(len(repl)):
|
||||||
|
c = repl[i]
|
||||||
|
if orig[i].isupper():
|
||||||
|
c = c.upper()
|
||||||
|
retv = retv + c
|
||||||
|
return retv
|
||||||
|
cityDescriptor = re.sub("cities", preserveCase, cityDescriptor, flags=re.IGNORECASE)
|
||||||
cityString = self.endline(cityDescriptor + cityString,
|
cityString = self.endline(cityDescriptor + cityString,
|
||||||
linelength=self._lineLength, breakStr=["..."])
|
linelength=self._lineLength, breakStr=["..."])
|
||||||
issueTimeStr = issueTimeStr + "\n\n"
|
issueTimeStr = issueTimeStr + "\n\n"
|
||||||
|
@ -249,6 +265,8 @@ class Header(EditAreaUtils.EditAreaUtils, StringUtils.StringUtils):
|
||||||
if includeVTECString == 0:
|
if includeVTECString == 0:
|
||||||
VTECString = ""
|
VTECString = ""
|
||||||
header = codeString + VTECString + nameString + cityString + issueTimeStr
|
header = codeString + VTECString + nameString + cityString + issueTimeStr
|
||||||
|
if upperCase:
|
||||||
|
header = header.upper()
|
||||||
return header
|
return header
|
||||||
|
|
||||||
# Make accurate city list based on the grids
|
# Make accurate city list based on the grids
|
||||||
|
@ -569,8 +587,8 @@ class Header(EditAreaUtils.EditAreaUtils, StringUtils.StringUtils):
|
||||||
if entry.has_key("fullStateName"):
|
if entry.has_key("fullStateName"):
|
||||||
state = entry["fullStateName"]
|
state = entry["fullStateName"]
|
||||||
#Special District of Columbia case
|
#Special District of Columbia case
|
||||||
if state == "DISTRICT OF COLUMBIA":
|
if state.upper() == "DISTRICT OF COLUMBIA":
|
||||||
state = "THE DISTRICT OF COLUMBIA"
|
state = "The District of Columbia"
|
||||||
# Get part-of-state information
|
# Get part-of-state information
|
||||||
partOfState = ""
|
partOfState = ""
|
||||||
if entry.has_key("partOfState"):
|
if entry.has_key("partOfState"):
|
||||||
|
@ -583,15 +601,15 @@ class Header(EditAreaUtils.EditAreaUtils, StringUtils.StringUtils):
|
||||||
if entry.has_key("ugcCode"):
|
if entry.has_key("ugcCode"):
|
||||||
codeType = entry["ugcCode"][2]
|
codeType = entry["ugcCode"][2]
|
||||||
if codeType == "Z":
|
if codeType == "Z":
|
||||||
nameType = "ZONE"
|
nameType = "zone"
|
||||||
elif codeType == "C":
|
elif codeType == "C":
|
||||||
indCty=entry.get("independentCity", 0)
|
indCty=entry.get("independentCity", 0)
|
||||||
if indCty == 1:
|
if indCty == 1:
|
||||||
nameType = "INDEPENDENT CITY"
|
nameType = "independent city"
|
||||||
elif state == "LOUISIANA":
|
elif state == "Louisiana":
|
||||||
nameType = "PARISH"
|
nameType = "parish"
|
||||||
else:
|
else:
|
||||||
nameType = "COUNTY"
|
nameType = "county"
|
||||||
else:
|
else:
|
||||||
codeType == "?"
|
codeType == "?"
|
||||||
value = (state, partOfState)
|
value = (state, partOfState)
|
||||||
|
|
|
@ -95,6 +95,7 @@ import com.raytheon.uf.common.activetable.VTECChange;
|
||||||
import com.raytheon.uf.common.activetable.VTECTableChangeNotification;
|
import com.raytheon.uf.common.activetable.VTECTableChangeNotification;
|
||||||
import com.raytheon.uf.common.dataplugin.gfe.textproduct.DraftProduct;
|
import com.raytheon.uf.common.dataplugin.gfe.textproduct.DraftProduct;
|
||||||
import com.raytheon.uf.common.dataplugin.gfe.textproduct.ProductDefinition;
|
import com.raytheon.uf.common.dataplugin.gfe.textproduct.ProductDefinition;
|
||||||
|
import com.raytheon.uf.common.dataplugin.text.db.MixedCaseProductSupport;
|
||||||
import com.raytheon.uf.common.jms.notification.INotificationObserver;
|
import com.raytheon.uf.common.jms.notification.INotificationObserver;
|
||||||
import com.raytheon.uf.common.jms.notification.NotificationException;
|
import com.raytheon.uf.common.jms.notification.NotificationException;
|
||||||
import com.raytheon.uf.common.jms.notification.NotificationMessage;
|
import com.raytheon.uf.common.jms.notification.NotificationMessage;
|
||||||
|
@ -158,6 +159,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
||||||
* 02/05/2014 17022 ryu Modified loadDraft() to fix merging of WMO heading and AWIPS ID.
|
* 02/05/2014 17022 ryu Modified loadDraft() to fix merging of WMO heading and AWIPS ID.
|
||||||
* 03/25/2014 #2884 randerso Added xxxid to check for disabling editor
|
* 03/25/2014 #2884 randerso Added xxxid to check for disabling editor
|
||||||
* 05/12/2014 16195 zhao Modified widgetSelected() for "Auto Wrap" option widget
|
* 05/12/2014 16195 zhao Modified widgetSelected() for "Auto Wrap" option widget
|
||||||
|
* 10/20/2014 #3685 randerso Made conversion to upper case conditional on product id
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -480,7 +482,7 @@ public class ProductEditorComp extends Composite implements
|
||||||
break;
|
break;
|
||||||
case SWT.Show:
|
case SWT.Show:
|
||||||
if ((!dead)
|
if ((!dead)
|
||||||
&& (getProductText() != null || !getProductText()
|
&& ((getProductText() != null) || !getProductText()
|
||||||
.isEmpty())) {
|
.isEmpty())) {
|
||||||
timeUpdater.schedule();
|
timeUpdater.schedule();
|
||||||
}
|
}
|
||||||
|
@ -707,7 +709,7 @@ public class ProductEditorComp extends Composite implements
|
||||||
Rectangle trim = p.computeTrim(0, 0, 0, 0);
|
Rectangle trim = p.computeTrim(0, 0, 0, 0);
|
||||||
Point dpi = p.getDPI();
|
Point dpi = p.getDPI();
|
||||||
int leftMargin = dpi.x + trim.x;
|
int leftMargin = dpi.x + trim.x;
|
||||||
int topMargin = dpi.y / 2 + trim.y;
|
int topMargin = (dpi.y / 2) + trim.y;
|
||||||
GC gc = new GC(p);
|
GC gc = new GC(p);
|
||||||
Font font = gc.getFont();
|
Font font = gc.getFont();
|
||||||
String printText = textComp.getProductText();
|
String printText = textComp.getProductText();
|
||||||
|
@ -866,8 +868,8 @@ public class ProductEditorComp extends Composite implements
|
||||||
autoWrapMI.addSelectionListener(new SelectionAdapter() {
|
autoWrapMI.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent e) {
|
public void widgetSelected(SelectionEvent e) {
|
||||||
wrapMode = !wrapMode;
|
wrapMode = !wrapMode;
|
||||||
textComp.setAutoWrapMode(wrapMode);
|
textComp.setAutoWrapMode(wrapMode);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1159,7 +1161,9 @@ public class ProductEditorComp extends Composite implements
|
||||||
textComp.getTextEditorST().setText(
|
textComp.getTextEditorST().setText(
|
||||||
textComp.getTextEditorST().getText() + "\n");
|
textComp.getTextEditorST().getText() + "\n");
|
||||||
}
|
}
|
||||||
textComp.upper();
|
if (!MixedCaseProductSupport.isMixedCase(getNNNid())) {
|
||||||
|
textComp.upper();
|
||||||
|
}
|
||||||
textComp.endUpdate();
|
textComp.endUpdate();
|
||||||
|
|
||||||
if (!frameCheck(false)) {
|
if (!frameCheck(false)) {
|
||||||
|
@ -1292,7 +1296,7 @@ public class ProductEditorComp extends Composite implements
|
||||||
"Error sending active table request to http server ", e);
|
"Error sending active table request to http server ", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (records == null || records.isEmpty()) {
|
if ((records == null) || records.isEmpty()) {
|
||||||
activeVtecRecords = null;
|
activeVtecRecords = null;
|
||||||
} else {
|
} else {
|
||||||
if (pil != null) {
|
if (pil != null) {
|
||||||
|
@ -1391,7 +1395,7 @@ public class ProductEditorComp extends Composite implements
|
||||||
activeRecs = getMatchingActiveVTEC(zones, oid, phen, sig,
|
activeRecs = getMatchingActiveVTEC(zones, oid, phen, sig,
|
||||||
etn);
|
etn);
|
||||||
String eventStr = "." + phen + "." + sig + "." + etn;
|
String eventStr = "." + phen + "." + sig + "." + etn;
|
||||||
if (activeRecs == null || activeRecs.isEmpty()) {
|
if ((activeRecs == null) || activeRecs.isEmpty()) {
|
||||||
statusHandler.handle(Priority.PROBLEM,
|
statusHandler.handle(Priority.PROBLEM,
|
||||||
"No active records found for " + vtec);
|
"No active records found for " + vtec);
|
||||||
} else {
|
} else {
|
||||||
|
@ -1406,7 +1410,7 @@ public class ProductEditorComp extends Composite implements
|
||||||
|
|
||||||
// segment invalid due to the event going into
|
// segment invalid due to the event going into
|
||||||
// effect in part of the segment area
|
// effect in part of the segment area
|
||||||
if (started > 0 && started < activeRecs.size()) {
|
if ((started > 0) && (started < activeRecs.size())) {
|
||||||
final String msg = "Event "
|
final String msg = "Event "
|
||||||
+ eventStr
|
+ eventStr
|
||||||
+ " has gone into effect in part"
|
+ " has gone into effect in part"
|
||||||
|
@ -1508,8 +1512,8 @@ public class ProductEditorComp extends Composite implements
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check start and ending time for end later than start
|
// Check start and ending time for end later than start
|
||||||
if (vtecStart != null && vtecEnd != null
|
if ((vtecStart != null) && (vtecEnd != null)
|
||||||
&& vtecStart.getTime() >= vtecEnd.getTime()) {
|
&& (vtecStart.getTime() >= vtecEnd.getTime())) {
|
||||||
setTabColorFunc(productStateEnum.New);
|
setTabColorFunc(productStateEnum.New);
|
||||||
String msg = "VTEC ending time is before "
|
String msg = "VTEC ending time is before "
|
||||||
+ "starting time. Product is invalid and must"
|
+ "starting time. Product is invalid and must"
|
||||||
|
@ -1520,13 +1524,13 @@ public class ProductEditorComp extends Composite implements
|
||||||
// Give 30 minutes of slack to a couple of action codes
|
// Give 30 minutes of slack to a couple of action codes
|
||||||
// check the ending time and transmission time
|
// check the ending time and transmission time
|
||||||
if ((action.equals("EXP") || action.equals("CAN"))
|
if ((action.equals("EXP") || action.equals("CAN"))
|
||||||
&& vtecEnd != null) {
|
&& (vtecEnd != null)) {
|
||||||
vtecEnd.setTime(vtecEnd.getTime() + 30
|
vtecEnd.setTime(vtecEnd.getTime()
|
||||||
* TimeUtil.MILLIS_PER_MINUTE);
|
+ (30 * TimeUtil.MILLIS_PER_MINUTE));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vtecEnd != null
|
if ((vtecEnd != null)
|
||||||
&& vtecEnd.getTime() <= transmissionTime.getTime()) {
|
&& (vtecEnd.getTime() <= transmissionTime.getTime())) {
|
||||||
setTabColorFunc(productStateEnum.New);
|
setTabColorFunc(productStateEnum.New);
|
||||||
String msg = "VTEC ends before current time."
|
String msg = "VTEC ends before current time."
|
||||||
+ " Product is invalid and must be regenerated.";
|
+ " Product is invalid and must be regenerated.";
|
||||||
|
@ -1596,7 +1600,7 @@ public class ProductEditorComp extends Composite implements
|
||||||
|
|
||||||
// time contains, if time range (tr) contains time (t), return 1 def
|
// time contains, if time range (tr) contains time (t), return 1 def
|
||||||
public boolean contains(Date t) {
|
public boolean contains(Date t) {
|
||||||
return t.getTime() >= startTime.getTime() && t.before(endTime);
|
return (t.getTime() >= startTime.getTime()) && t.before(endTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Date getStartTime() {
|
public Date getStartTime() {
|
||||||
|
@ -1650,7 +1654,7 @@ public class ProductEditorComp extends Composite implements
|
||||||
zones = decodeUGCs(segData);
|
zones = decodeUGCs(segData);
|
||||||
vtecs = getVTEClines(segData);
|
vtecs = getVTEClines(segData);
|
||||||
newVtecs = fixVTEC(zones, vtecs, transmissionTime);
|
newVtecs = fixVTEC(zones, vtecs, transmissionTime);
|
||||||
if (newVtecs != null && !newVtecs.isEmpty()) {
|
if ((newVtecs != null) && !newVtecs.isEmpty()) {
|
||||||
textComp.replaceText(tipVtec, newVtecs);
|
textComp.replaceText(tipVtec, newVtecs);
|
||||||
}
|
}
|
||||||
} catch (VizException e) {
|
} catch (VizException e) {
|
||||||
|
@ -1761,7 +1765,9 @@ public class ProductEditorComp extends Composite implements
|
||||||
|
|
||||||
textComp.startUpdate();
|
textComp.startUpdate();
|
||||||
try {
|
try {
|
||||||
textComp.upper();
|
if (!MixedCaseProductSupport.isMixedCase(getNNNid())) {
|
||||||
|
textComp.upper();
|
||||||
|
}
|
||||||
status1 = frameCheck(true);
|
status1 = frameCheck(true);
|
||||||
boolean status2 = changeTimes();
|
boolean status2 = changeTimes();
|
||||||
if (status1 && status2) {
|
if (status1 && status2) {
|
||||||
|
@ -1935,7 +1941,8 @@ public class ProductEditorComp extends Composite implements
|
||||||
int sel = hoursSpnr.getSelection();
|
int sel = hoursSpnr.getSelection();
|
||||||
int hours = sel / 100;
|
int hours = sel / 100;
|
||||||
int minuteInc = (sel % 100) / 25;
|
int minuteInc = (sel % 100) / 25;
|
||||||
int purgeOffset = hours * TimeUtil.MINUTES_PER_HOUR + minuteInc * 15; // minutes
|
int purgeOffset = (hours * TimeUtil.MINUTES_PER_HOUR)
|
||||||
|
+ (minuteInc * 15); // minutes
|
||||||
|
|
||||||
Date now = SimulatedTime.getSystemTime().getTime();
|
Date now = SimulatedTime.getSystemTime().getTime();
|
||||||
Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
|
Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
|
||||||
|
@ -1943,7 +1950,7 @@ public class ProductEditorComp extends Composite implements
|
||||||
cal.add(Calendar.MINUTE, purgeOffset);
|
cal.add(Calendar.MINUTE, purgeOffset);
|
||||||
int min = cal.get(Calendar.MINUTE);
|
int min = cal.get(Calendar.MINUTE);
|
||||||
if ((min % 15) >= 1) {
|
if ((min % 15) >= 1) {
|
||||||
cal.set(Calendar.MINUTE, (min / 15 + 1) * 15);
|
cal.set(Calendar.MINUTE, ((min / 15) + 1) * 15);
|
||||||
cal.set(Calendar.SECOND, 0);
|
cal.set(Calendar.SECOND, 0);
|
||||||
}
|
}
|
||||||
this.expireDate = cal.getTime();
|
this.expireDate = cal.getTime();
|
||||||
|
@ -2130,7 +2137,7 @@ public class ProductEditorComp extends Composite implements
|
||||||
long delta = expireTimeSec % roundSec;
|
long delta = expireTimeSec % roundSec;
|
||||||
long baseTime = (expireTimeSec / roundSec) * roundSec
|
long baseTime = (expireTimeSec / roundSec) * roundSec
|
||||||
* TimeUtil.MILLIS_PER_SECOND;
|
* TimeUtil.MILLIS_PER_SECOND;
|
||||||
if (delta / TimeUtil.SECONDS_PER_MINUTE >= 1) {
|
if ((delta / TimeUtil.SECONDS_PER_MINUTE) >= 1) {
|
||||||
expireTime.setTime(baseTime
|
expireTime.setTime(baseTime
|
||||||
+ (roundSec * TimeUtil.MILLIS_PER_SECOND));
|
+ (roundSec * TimeUtil.MILLIS_PER_SECOND));
|
||||||
} else { // within 1 minute, don't add next increment
|
} else { // within 1 minute, don't add next increment
|
||||||
|
@ -2288,7 +2295,8 @@ public class ProductEditorComp extends Composite implements
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
MessageBox mb = new MessageBox(parent.getShell(), SWT.OK
|
MessageBox mb = new MessageBox(parent.getShell(), SWT.OK
|
||||||
| SWT.ICON_WARNING);
|
| SWT.ICON_WARNING);
|
||||||
mb.setText("Formatter AutoWrite failed: " + this.pil);
|
mb.setText("Error");
|
||||||
|
mb.setMessage("Formatter AutoWrite failed: " + this.pil);
|
||||||
mb.open();
|
mb.open();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2422,7 +2430,7 @@ public class ProductEditorComp extends Composite implements
|
||||||
|
|
||||||
private void displayCallToActionsDialog(int callToActionType) {
|
private void displayCallToActionsDialog(int callToActionType) {
|
||||||
// Allow only one of the 3 types of dialogs to be displayed.
|
// Allow only one of the 3 types of dialogs to be displayed.
|
||||||
if (ctaDialog != null && ctaDialog.getShell() != null
|
if ((ctaDialog != null) && (ctaDialog.getShell() != null)
|
||||||
&& !ctaDialog.isDisposed()) {
|
&& !ctaDialog.isDisposed()) {
|
||||||
ctaDialog.bringToTop();
|
ctaDialog.bringToTop();
|
||||||
return;
|
return;
|
||||||
|
@ -2673,6 +2681,10 @@ public class ProductEditorComp extends Composite implements
|
||||||
return productId;
|
return productId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getNNNid() {
|
||||||
|
return textdbPil.substring(3, 6);
|
||||||
|
}
|
||||||
|
|
||||||
public String getProductName() {
|
public String getProductName() {
|
||||||
return productName;
|
return productName;
|
||||||
}
|
}
|
||||||
|
@ -2901,24 +2913,24 @@ public class ProductEditorComp extends Composite implements
|
||||||
|
|
||||||
// Word-wrap the whole selection.
|
// Word-wrap the whole selection.
|
||||||
int curLine = styledText.getLineAtOffset(selectionRange.x);
|
int curLine = styledText.getLineAtOffset(selectionRange.x);
|
||||||
int lastSelIdx = selectionRange.x + selectionRange.y - 1;
|
int lastSelIdx = (selectionRange.x + selectionRange.y) - 1;
|
||||||
int lastLine = styledText.getLineAtOffset(lastSelIdx);
|
int lastLine = styledText.getLineAtOffset(lastSelIdx);
|
||||||
int[] indices = null;
|
int[] indices = null;
|
||||||
while (curLine <= lastLine && curLine < styledText.getLineCount()) {
|
while ((curLine <= lastLine) && (curLine < styledText.getLineCount())) {
|
||||||
int lineOff = styledText.getOffsetAtLine(curLine);
|
int lineOff = styledText.getOffsetAtLine(curLine);
|
||||||
// word wrap a block, and find out how the text length changed.
|
// word wrap a block, and find out how the text length changed.
|
||||||
indices = textComp.wordWrap(styledText, lineOff, wrapColumn);
|
indices = textComp.wordWrap(styledText, lineOff, wrapColumn);
|
||||||
int firstIdx = indices[0];
|
int firstIdx = indices[0];
|
||||||
int lastIdx = indices[1];
|
int lastIdx = indices[1];
|
||||||
int newLen = indices[2];
|
int newLen = indices[2];
|
||||||
int oldLen = 1 + lastIdx - firstIdx;
|
int oldLen = (1 + lastIdx) - firstIdx;
|
||||||
int diff = newLen - oldLen;
|
int diff = newLen - oldLen;
|
||||||
// adjust our endpoint for the change in length
|
// adjust our endpoint for the change in length
|
||||||
lastSelIdx += diff;
|
lastSelIdx += diff;
|
||||||
lastLine = styledText.getLineAtOffset(lastSelIdx);
|
lastLine = styledText.getLineAtOffset(lastSelIdx);
|
||||||
// newLen doesn't include \n, so it can be 0. Don't allow
|
// newLen doesn't include \n, so it can be 0. Don't allow
|
||||||
// firstIdx+newLen-1 to be < firstIdx, or loop becomes infinite.
|
// firstIdx+newLen-1 to be < firstIdx, or loop becomes infinite.
|
||||||
int lastWrapIdx = Math.max(firstIdx, firstIdx + newLen - 1);
|
int lastWrapIdx = Math.max(firstIdx, (firstIdx + newLen) - 1);
|
||||||
// move down to the next unwrapped line
|
// move down to the next unwrapped line
|
||||||
curLine = styledText.getLineAtOffset(lastWrapIdx) + 1;
|
curLine = styledText.getLineAtOffset(lastWrapIdx) + 1;
|
||||||
}
|
}
|
||||||
|
@ -2979,7 +2991,7 @@ public class ProductEditorComp extends Composite implements
|
||||||
String str = null;
|
String str = null;
|
||||||
|
|
||||||
Object obj = productDefinition.get(key);
|
Object obj = productDefinition.get(key);
|
||||||
if (obj != null && obj instanceof Collection) {
|
if ((obj != null) && (obj instanceof Collection)) {
|
||||||
Collection<?> collection = (Collection<?>) obj;
|
Collection<?> collection = (Collection<?>) obj;
|
||||||
str = (String) (collection.toArray())[0];
|
str = (String) (collection.toArray())[0];
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -115,6 +115,7 @@ import org.eclipse.ui.menus.IMenuService;
|
||||||
import com.raytheon.uf.common.activetable.SendPracticeProductRequest;
|
import com.raytheon.uf.common.activetable.SendPracticeProductRequest;
|
||||||
import com.raytheon.uf.common.dataplugin.text.RemoteRetrievalResponse;
|
import com.raytheon.uf.common.dataplugin.text.RemoteRetrievalResponse;
|
||||||
import com.raytheon.uf.common.dataplugin.text.alarms.AlarmAlertProduct;
|
import com.raytheon.uf.common.dataplugin.text.alarms.AlarmAlertProduct;
|
||||||
|
import com.raytheon.uf.common.dataplugin.text.db.MixedCaseProductSupport;
|
||||||
import com.raytheon.uf.common.dataplugin.text.db.OperationalStdTextProduct;
|
import com.raytheon.uf.common.dataplugin.text.db.OperationalStdTextProduct;
|
||||||
import com.raytheon.uf.common.dataplugin.text.db.PracticeStdTextProduct;
|
import com.raytheon.uf.common.dataplugin.text.db.PracticeStdTextProduct;
|
||||||
import com.raytheon.uf.common.dataplugin.text.db.StdTextProduct;
|
import com.raytheon.uf.common.dataplugin.text.db.StdTextProduct;
|
||||||
|
@ -341,6 +342,7 @@ import com.raytheon.viz.ui.dialogs.SWTMessageBox;
|
||||||
* 13May2014 2536 bclement moved WMO Header to common, switched from TimeTools to TimeUtil
|
* 13May2014 2536 bclement moved WMO Header to common, switched from TimeTools to TimeUtil
|
||||||
* 11Sep2014 3580 mapeters Replaced SerializationTuil usage with JAXBManager,
|
* 11Sep2014 3580 mapeters Replaced SerializationTuil usage with JAXBManager,
|
||||||
* removed IQueryTransport usage (no longer exists).
|
* removed IQueryTransport usage (no longer exists).
|
||||||
|
* 20Oct2014 3685 randerso Made conversion to upper case conditional on product id
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -1098,8 +1100,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
||||||
private SearchReplaceDlg searchReplaceDlg;
|
private SearchReplaceDlg searchReplaceDlg;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Flag indicating if the overwrite mode has been set for
|
* Flag indicating if the overwrite mode has been set for template editing.
|
||||||
* template editing.
|
|
||||||
*/
|
*/
|
||||||
private boolean isTemplateOverwriteModeSet = false;
|
private boolean isTemplateOverwriteModeSet = false;
|
||||||
|
|
||||||
|
@ -2065,7 +2066,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
||||||
overStrikeItem.addSelectionListener(new SelectionAdapter() {
|
overStrikeItem.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
if (!AFOSParser.isTemplate) {
|
if (!AFOSParser.isTemplate) {
|
||||||
if (overwriteMode == true) {
|
if (overwriteMode == true) {
|
||||||
overwriteMode = false;
|
overwriteMode = false;
|
||||||
editorInsertCmb.select(INSERT_TEXT);
|
editorInsertCmb.select(INSERT_TEXT);
|
||||||
|
@ -3714,14 +3715,14 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
||||||
editorInsertCmb.addSelectionListener(new SelectionAdapter() {
|
editorInsertCmb.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
if (!AFOSParser.isTemplate) {
|
if (!AFOSParser.isTemplate) {
|
||||||
if (editorInsertCmb.getSelectionIndex() == INSERT_TEXT
|
if ((editorInsertCmb.getSelectionIndex() == INSERT_TEXT)
|
||||||
&& overwriteMode == true) {
|
&& (overwriteMode == true)) {
|
||||||
textEditor.invokeAction(ST.TOGGLE_OVERWRITE);
|
textEditor.invokeAction(ST.TOGGLE_OVERWRITE);
|
||||||
overwriteMode = false;
|
overwriteMode = false;
|
||||||
overStrikeItem.setSelection(false);
|
overStrikeItem.setSelection(false);
|
||||||
} else if (editorInsertCmb.getSelectionIndex() == OVERWRITE_TEXT
|
} else if ((editorInsertCmb.getSelectionIndex() == OVERWRITE_TEXT)
|
||||||
&& overwriteMode == false) {
|
&& (overwriteMode == false)) {
|
||||||
textEditor.invokeAction(ST.TOGGLE_OVERWRITE);
|
textEditor.invokeAction(ST.TOGGLE_OVERWRITE);
|
||||||
overwriteMode = true;
|
overwriteMode = true;
|
||||||
overStrikeItem.setSelection(true);
|
overStrikeItem.setSelection(true);
|
||||||
|
@ -3887,7 +3888,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
||||||
event.doit = false; // Ignore Ctrl+Shift+PageDown
|
event.doit = false; // Ignore Ctrl+Shift+PageDown
|
||||||
} else if (event.keyCode == SWT.INSERT) {
|
} else if (event.keyCode == SWT.INSERT) {
|
||||||
// Ins key on the keypad
|
// Ins key on the keypad
|
||||||
if (AFOSParser.isTemplate) {
|
if (AFOSParser.isTemplate) {
|
||||||
if (overwriteMode == true) {
|
if (overwriteMode == true) {
|
||||||
overwriteMode = false;
|
overwriteMode = false;
|
||||||
overStrikeItem.setSelection(false);
|
overStrikeItem.setSelection(false);
|
||||||
|
@ -3917,43 +3918,43 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
||||||
if (event.keyCode == SWT.BS) {
|
if (event.keyCode == SWT.BS) {
|
||||||
event.doit = false;
|
event.doit = false;
|
||||||
int currentPos = textEditor.getCaretOffset();
|
int currentPos = textEditor.getCaretOffset();
|
||||||
String textUpToCaret = textEditor.getText().substring(0, currentPos);
|
String textUpToCaret = textEditor.getText().substring(
|
||||||
int leftMost=textUpToCaret.lastIndexOf("[") + 1;
|
0, currentPos);
|
||||||
int rightMost = textEditor.getText().indexOf("]",currentPos);
|
int leftMost = textUpToCaret.lastIndexOf("[") + 1;
|
||||||
|
int rightMost = textEditor.getText().indexOf("]",
|
||||||
|
currentPos);
|
||||||
int editableTextWidth = rightMost - leftMost;
|
int editableTextWidth = rightMost - leftMost;
|
||||||
String leftPart="";
|
String leftPart = "";
|
||||||
String rightPart="";
|
String rightPart = "";
|
||||||
if (currentPos == leftMost) {
|
if (currentPos == leftMost) {
|
||||||
leftPart = "";
|
leftPart = "";
|
||||||
rightPart = textEditor.getText().substring(
|
|
||||||
currentPos, rightMost);
|
|
||||||
textEditor.setCaretOffset(leftMost);
|
|
||||||
}
|
|
||||||
else if (currentPos > leftMost && currentPos <= rightMost){
|
|
||||||
leftPart = textEditor.getText().substring(
|
|
||||||
leftMost, currentPos - 1);
|
|
||||||
rightPart = textEditor.getText().substring(
|
rightPart = textEditor.getText().substring(
|
||||||
currentPos, rightMost);
|
currentPos, rightMost);
|
||||||
}
|
textEditor.setCaretOffset(leftMost);
|
||||||
else if (currentPos == rightMost) {
|
} else if ((currentPos > leftMost)
|
||||||
leftPart = textEditor.getText().substring(
|
&& (currentPos <= rightMost)) {
|
||||||
leftMost, currentPos-1);
|
leftPart = textEditor.getText().substring(leftMost,
|
||||||
|
currentPos - 1);
|
||||||
|
rightPart = textEditor.getText().substring(
|
||||||
|
currentPos, rightMost);
|
||||||
|
} else if (currentPos == rightMost) {
|
||||||
|
leftPart = textEditor.getText().substring(leftMost,
|
||||||
|
currentPos - 1);
|
||||||
rightPart = "";
|
rightPart = "";
|
||||||
}
|
}
|
||||||
String newString = leftPart + rightPart;
|
String newString = leftPart + rightPart;
|
||||||
int neededPadSpaces = editableTextWidth - newString.length();
|
int neededPadSpaces = editableTextWidth
|
||||||
|
- newString.length();
|
||||||
String newPaddedString = String.format("%1$-"
|
String newPaddedString = String.format("%1$-"
|
||||||
+ (neededPadSpaces+1) + "s", newString);
|
+ (neededPadSpaces + 1) + "s", newString);
|
||||||
String spacedoutString = String.format("%1$-"
|
String spacedoutString = String.format("%1$-"
|
||||||
+ (editableTextWidth) + "s",
|
+ (editableTextWidth) + "s", " ");
|
||||||
" ");
|
|
||||||
textEditor.replaceTextRange(leftMost,
|
textEditor.replaceTextRange(leftMost,
|
||||||
spacedoutString.length(), spacedoutString);
|
spacedoutString.length(), spacedoutString);
|
||||||
textEditor.replaceTextRange(leftMost,
|
textEditor.replaceTextRange(leftMost,
|
||||||
newPaddedString.length(), newPaddedString);
|
newPaddedString.length(), newPaddedString);
|
||||||
textEditor.setCaretOffset(currentPos - 1);
|
textEditor.setCaretOffset(currentPos - 1);
|
||||||
|
|
||||||
|
|
||||||
} else if (event.keyCode == SWT.TAB) {
|
} else if (event.keyCode == SWT.TAB) {
|
||||||
if (!isTemplateOverwriteModeSet) {
|
if (!isTemplateOverwriteModeSet) {
|
||||||
if (overwriteMode) {
|
if (overwriteMode) {
|
||||||
|
@ -3968,11 +3969,11 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
||||||
String textUpToCaret = textEditor.getText().substring(
|
String textUpToCaret = textEditor.getText().substring(
|
||||||
0, currentPos);
|
0, currentPos);
|
||||||
int openBracketPos = textUpToCaret.lastIndexOf("[");
|
int openBracketPos = textUpToCaret.lastIndexOf("[");
|
||||||
openBracketPos = textEditor.getText().indexOf("[", currentPos);
|
openBracketPos = textEditor.getText().indexOf("[",
|
||||||
|
currentPos);
|
||||||
textEditor.setCaretOffset(openBracketPos + 1);
|
textEditor.setCaretOffset(openBracketPos + 1);
|
||||||
}
|
} else if (((event.keyCode >= 97) && (event.keyCode <= 122))
|
||||||
else if (event.keyCode>=97 && event.keyCode <=122 ||
|
|| ((event.keyCode >= 48) && (event.keyCode <= 57))) {
|
||||||
event.keyCode>=48 && event.keyCode <=57){
|
|
||||||
event.doit = true;
|
event.doit = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4160,7 +4161,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
||||||
* Enter the text editor mode.
|
* Enter the text editor mode.
|
||||||
*/
|
*/
|
||||||
private void enterEditor() {
|
private void enterEditor() {
|
||||||
initTemplateOverwriteMode();
|
initTemplateOverwriteMode();
|
||||||
StdTextProduct product = TextDisplayModel.getInstance()
|
StdTextProduct product = TextDisplayModel.getInstance()
|
||||||
.getStdTextProduct(token);
|
.getStdTextProduct(token);
|
||||||
if ((product != null)
|
if ((product != null)
|
||||||
|
@ -4401,7 +4402,8 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
||||||
.getProductCategory(token)
|
.getProductCategory(token)
|
||||||
+ tdm.getProductDesignator(token);
|
+ tdm.getProductDesignator(token);
|
||||||
// Set the header text field.
|
// Set the header text field.
|
||||||
if (bbbid.equals("NOR") || (bbbid.isEmpty() && tdm.getAfosPil(token) != null)) {
|
if (bbbid.equals("NOR")
|
||||||
|
|| (bbbid.isEmpty() && (tdm.getAfosPil(token) != null))) {
|
||||||
String wmoId = tdm.getWmoId(token);
|
String wmoId = tdm.getWmoId(token);
|
||||||
wmoId = (wmoId.length() > 0 ? wmoId : "-");
|
wmoId = (wmoId.length() > 0 ? wmoId : "-");
|
||||||
String siteId = tdm.getSiteId(token);
|
String siteId = tdm.getSiteId(token);
|
||||||
|
@ -4902,7 +4904,8 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
||||||
if (warnGenFlag) {
|
if (warnGenFlag) {
|
||||||
QCConfirmationMsg qcMsg = new QCConfirmationMsg();
|
QCConfirmationMsg qcMsg = new QCConfirmationMsg();
|
||||||
if (!qcMsg.checkWarningInfo(headerTF.getText().toUpperCase(),
|
if (!qcMsg.checkWarningInfo(headerTF.getText().toUpperCase(),
|
||||||
textEditor.getText().toUpperCase(), prod.getNnnid())) {
|
MixedCaseProductSupport.conditionalToUpper(prod.getNnnid(),
|
||||||
|
textEditor.getText()), prod.getNnnid())) {
|
||||||
WarnGenConfirmationDlg wgcd = new WarnGenConfirmationDlg(shell,
|
WarnGenConfirmationDlg wgcd = new WarnGenConfirmationDlg(shell,
|
||||||
qcMsg.getTitle(), qcMsg.getProductMessage(),
|
qcMsg.getTitle(), qcMsg.getProductMessage(),
|
||||||
qcMsg.getModeMessage());
|
qcMsg.getModeMessage());
|
||||||
|
@ -4986,7 +4989,8 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
||||||
StdTextProduct prod = getStdTextProduct();
|
StdTextProduct prod = getStdTextProduct();
|
||||||
EmergencyConfirmationMsg emergencyMsg = new EmergencyConfirmationMsg();
|
EmergencyConfirmationMsg emergencyMsg = new EmergencyConfirmationMsg();
|
||||||
if (emergencyMsg.checkWarningInfo(headerTF.getText().toUpperCase(),
|
if (emergencyMsg.checkWarningInfo(headerTF.getText().toUpperCase(),
|
||||||
textEditor.getText().toUpperCase(), prod.getNnnid()) == false) {
|
MixedCaseProductSupport.conditionalToUpper(prod.getNnnid(),
|
||||||
|
textEditor.getText()), prod.getNnnid()) == false) {
|
||||||
|
|
||||||
WarnGenConfirmationDlg wgcd = new WarnGenConfirmationDlg(shell,
|
WarnGenConfirmationDlg wgcd = new WarnGenConfirmationDlg(shell,
|
||||||
emergencyMsg.getTitle(), emergencyMsg.getProductMessage(),
|
emergencyMsg.getTitle(), emergencyMsg.getProductMessage(),
|
||||||
|
@ -5016,8 +5020,9 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
||||||
*/
|
*/
|
||||||
private void warngenCloseCallback(boolean resend) {
|
private void warngenCloseCallback(boolean resend) {
|
||||||
|
|
||||||
// DR14553 (make upper case in product)
|
StdTextProduct prod = getStdTextProduct();
|
||||||
String body = textEditor.getText().toUpperCase();
|
String body = MixedCaseProductSupport.conditionalToUpper(
|
||||||
|
prod.getNnnid(), textEditor.getText());
|
||||||
CAVEMode mode = CAVEMode.getMode();
|
CAVEMode mode = CAVEMode.getMode();
|
||||||
boolean isOperational = (CAVEMode.OPERATIONAL.equals(mode) || CAVEMode.TEST
|
boolean isOperational = (CAVEMode.OPERATIONAL.equals(mode) || CAVEMode.TEST
|
||||||
.equals(mode));
|
.equals(mode));
|
||||||
|
@ -5031,7 +5036,6 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
||||||
inEditMode = false;
|
inEditMode = false;
|
||||||
}
|
}
|
||||||
if (!resend) {
|
if (!resend) {
|
||||||
StdTextProduct prod = getStdTextProduct();
|
|
||||||
OUPTestRequest testReq = new OUPTestRequest();
|
OUPTestRequest testReq = new OUPTestRequest();
|
||||||
testReq.setOupRequest(createOUPRequest(prod,
|
testReq.setOupRequest(createOUPRequest(prod,
|
||||||
prod.getProduct()));
|
prod.getProduct()));
|
||||||
|
@ -5075,8 +5079,6 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
||||||
|
|
||||||
String product = TextDisplayModel.getInstance().getProduct(
|
String product = TextDisplayModel.getInstance().getProduct(
|
||||||
token);
|
token);
|
||||||
// TODO: Should not need to call getProduct and the like twice.
|
|
||||||
StdTextProduct prod = getStdTextProduct();
|
|
||||||
|
|
||||||
OUPRequest req = createOUPRequest(prod, product);
|
OUPRequest req = createOUPRequest(prod, product);
|
||||||
|
|
||||||
|
@ -5093,8 +5095,10 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
if (!resend) {
|
if (!resend) {
|
||||||
body = VtecUtil.getVtec(removeSoftReturns(textEditor
|
body = VtecUtil
|
||||||
.getText()));
|
.getVtec(removeSoftReturns(MixedCaseProductSupport
|
||||||
|
.conditionalToUpper(prod.getNnnid(),
|
||||||
|
textEditor.getText())));
|
||||||
}
|
}
|
||||||
updateTextEditor(body);
|
updateTextEditor(body);
|
||||||
if ((inEditMode || resend)
|
if ((inEditMode || resend)
|
||||||
|
@ -5168,7 +5172,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
||||||
private static String copyEtn(String from, String to) {
|
private static String copyEtn(String from, String to) {
|
||||||
VtecObject fromVtec = VtecUtil.parseMessage(from);
|
VtecObject fromVtec = VtecUtil.parseMessage(from);
|
||||||
|
|
||||||
if (fromVtec != null && "NEW".equals(fromVtec.getAction())) {
|
if ((fromVtec != null) && "NEW".equals(fromVtec.getAction())) {
|
||||||
VtecObject toVtec = VtecUtil.parseMessage(to);
|
VtecObject toVtec = VtecUtil.parseMessage(to);
|
||||||
if (toVtec != null) {
|
if (toVtec != null) {
|
||||||
toVtec.setSequence(fromVtec.getSequence());
|
toVtec.setSequence(fromVtec.getSequence());
|
||||||
|
@ -5205,7 +5209,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
||||||
}
|
}
|
||||||
body.append(textEditor.getText().trim());
|
body.append(textEditor.getText().trim());
|
||||||
|
|
||||||
if (AFOSParser.isTemplate){
|
if (AFOSParser.isTemplate) {
|
||||||
return removePreformat(body.toString());
|
return removePreformat(body.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5279,7 +5283,9 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
||||||
|
|
||||||
String header = headerTF.getText().toUpperCase();
|
String header = headerTF.getText().toUpperCase();
|
||||||
String body = resend ? resendMessage()
|
String body = resend ? resendMessage()
|
||||||
: removeSoftReturns(textEditor.getText().toUpperCase());
|
: removeSoftReturns(MixedCaseProductSupport
|
||||||
|
.conditionalToUpper(product.getNnnid(),
|
||||||
|
textEditor.getText()));
|
||||||
// verify text
|
// verify text
|
||||||
headerTF.setText(header);
|
headerTF.setText(header);
|
||||||
updateTextEditor(body);
|
updateTextEditor(body);
|
||||||
|
@ -5302,10 +5308,11 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
||||||
if (!isAutoSave) {
|
if (!isAutoSave) {
|
||||||
if (!resend) {
|
if (!resend) {
|
||||||
// If not a resend, set the DDHHMM field to the current time
|
// If not a resend, set the DDHHMM field to the current time
|
||||||
if (productText.startsWith("- -") && productText.contains("DDHHMM")) {
|
if (productText.startsWith("- -")
|
||||||
|
&& productText.contains("DDHHMM")) {
|
||||||
productText = getUnofficeProduct(currentDate);
|
productText = getUnofficeProduct(currentDate);
|
||||||
} else {
|
} else {
|
||||||
productText = replaceDDHHMM(productText, currentDate);
|
productText = replaceDDHHMM(productText, currentDate);
|
||||||
}
|
}
|
||||||
VtecObject vtecObj = VtecUtil.parseMessage(productText);
|
VtecObject vtecObj = VtecUtil.parseMessage(productText);
|
||||||
if (warnGenFlag) {
|
if (warnGenFlag) {
|
||||||
|
@ -5909,14 +5916,15 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
||||||
if (m.find()) {
|
if (m.find()) {
|
||||||
SimpleDateFormat headerFormat = new SimpleDateFormat(
|
SimpleDateFormat headerFormat = new SimpleDateFormat(
|
||||||
"hmm a z EEE MMM d yyyy");
|
"hmm a z EEE MMM d yyyy");
|
||||||
TimeZone tz = TextWarningConstants.timeZoneShortNameMap
|
TimeZone tz = TextWarningConstants.timeZoneShortNameMap.get(m
|
||||||
.get(m.group(5));
|
.group(5));
|
||||||
if (tz != null) {
|
if (tz != null) {
|
||||||
headerFormat.setTimeZone(tz);
|
headerFormat.setTimeZone(tz);
|
||||||
product = product.replace(m.group(1), headerFormat.format(now)
|
product = product.replace(m.group(1), headerFormat.format(now)
|
||||||
.toUpperCase());
|
.toUpperCase());
|
||||||
} else {
|
} else {
|
||||||
statusHandler.warn("Could not sync MND header time because the time zone could not be determined. Will proceed with save/send.");
|
statusHandler
|
||||||
|
.warn("Could not sync MND header time because the time zone could not be determined. Will proceed with save/send.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return product;
|
return product;
|
||||||
|
@ -6944,9 +6952,9 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
||||||
}
|
}
|
||||||
String textProduct = product.getASCIIProduct();
|
String textProduct = product.getASCIIProduct();
|
||||||
if ((product.getNnnid() + product.getXxxid())
|
if ((product.getNnnid() + product.getXxxid())
|
||||||
.startsWith(AFOSParser.DRAFT_PIL) ||
|
.startsWith(AFOSParser.DRAFT_PIL)
|
||||||
(product.getNnnid() + product.getXxxid())
|
|| (product.getNnnid() + product.getXxxid())
|
||||||
.startsWith(AFOSParser.MCP_NNN )) {
|
.startsWith(AFOSParser.MCP_NNN)) {
|
||||||
String[] nnnxxx = TextDisplayModel.getNnnXxx(textProduct);
|
String[] nnnxxx = TextDisplayModel.getNnnXxx(textProduct);
|
||||||
String operationalPil = nnnxxx[0] + nnnxxx[1];
|
String operationalPil = nnnxxx[0] + nnnxxx[1];
|
||||||
String siteNode = SiteAbbreviationUtil.getSiteNode(nnnxxx[1]);
|
String siteNode = SiteAbbreviationUtil.getSiteNode(nnnxxx[1]);
|
||||||
|
@ -8594,8 +8602,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
||||||
isTemplateOverwriteModeSet = true;
|
isTemplateOverwriteModeSet = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
editorInsertCmb.setEnabled(true);
|
editorInsertCmb.setEnabled(true);
|
||||||
overStrikeItem.setEnabled(true);
|
overStrikeItem.setEnabled(true);
|
||||||
editorCutBtn.setEnabled(true);
|
editorCutBtn.setEnabled(true);
|
||||||
|
@ -8603,11 +8610,11 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
||||||
editorPasteBtn.setEnabled(true);
|
editorPasteBtn.setEnabled(true);
|
||||||
editorFillBtn.setEnabled(true);
|
editorFillBtn.setEnabled(true);
|
||||||
editorAttachBtn.setEnabled(true);
|
editorAttachBtn.setEnabled(true);
|
||||||
if (isTemplateOverwriteModeSet && !overwriteMode){
|
if (isTemplateOverwriteModeSet && !overwriteMode) {
|
||||||
textEditor.invokeAction(ST.TOGGLE_OVERWRITE);
|
textEditor.invokeAction(ST.TOGGLE_OVERWRITE);
|
||||||
isTemplateOverwriteModeSet=false;
|
isTemplateOverwriteModeSet = false;
|
||||||
}
|
}
|
||||||
if (!isTemplateOverwriteModeSet && overwriteMode){
|
if (!isTemplateOverwriteModeSet && overwriteMode) {
|
||||||
textEditor.invokeAction(ST.TOGGLE_OVERWRITE);
|
textEditor.invokeAction(ST.TOGGLE_OVERWRITE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8619,9 +8626,9 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
||||||
return modifiedText;
|
return modifiedText;
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getUnofficeProduct(String currDate)
|
private String getUnofficeProduct(String currDate) {
|
||||||
{
|
StdTextProduct textProd = TextDisplayModel.getInstance()
|
||||||
StdTextProduct textProd = TextDisplayModel.getInstance().getStdTextProduct(token);
|
.getStdTextProduct(token);
|
||||||
|
|
||||||
String header = headerTF.getText();
|
String header = headerTF.getText();
|
||||||
|
|
||||||
|
@ -8630,21 +8637,23 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
||||||
String nnnXxx = nnn + xxx;
|
String nnnXxx = nnn + xxx;
|
||||||
String site = SiteMap.getInstance().getSite4LetterId(
|
String site = SiteMap.getInstance().getSite4LetterId(
|
||||||
textProd.getCccid());
|
textProd.getCccid());
|
||||||
String wmoId = textProd.getCccid() + nnnXxx + " "
|
String wmoId = textProd.getCccid() + nnnXxx + " " + getAddressee()
|
||||||
+ getAddressee() + "\nTTAA00 " + site;
|
+ "\nTTAA00 " + site;
|
||||||
|
|
||||||
header = header.replaceFirst("\n" + nnnXxx, "");
|
header = header.replaceFirst("\n" + nnnXxx, "");
|
||||||
header = header.replaceFirst("-", "ZCZC");
|
header = header.replaceFirst("-", "ZCZC");
|
||||||
header = header.replaceFirst("-", wmoId);
|
header = header.replaceFirst("-", wmoId);
|
||||||
|
|
||||||
if (currDate != null)
|
if (currDate != null) {
|
||||||
header = header.replaceFirst("DDHHMM", currDate);
|
header = header.replaceFirst("DDHHMM", currDate);
|
||||||
else
|
} else {
|
||||||
header = header.replaceFirst("DDHHMM", textProd.getHdrtime());
|
header = header.replaceFirst("DDHHMM", textProd.getHdrtime());
|
||||||
|
}
|
||||||
|
|
||||||
String body = textEditor.getText().toUpperCase();
|
String body = MixedCaseProductSupport.conditionalToUpper(nnn,
|
||||||
|
textEditor.getText());
|
||||||
|
|
||||||
header = header + "\n\n"+body +"\n!--not sent--!";
|
header = header + "\n\n" + body + "\n!--not sent--!";
|
||||||
|
|
||||||
return header;
|
return header;
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,6 +47,13 @@
|
||||||
value="textws/gui"
|
value="textws/gui"
|
||||||
recursive="true">
|
recursive="true">
|
||||||
</path>
|
</path>
|
||||||
|
<path
|
||||||
|
application="TextWS"
|
||||||
|
localizationType="COMMON_STATIC"
|
||||||
|
name="Mixed Case"
|
||||||
|
value="mixedCase"
|
||||||
|
recursive="false">
|
||||||
|
</path>
|
||||||
</extension>
|
</extension>
|
||||||
|
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
|
@ -106,6 +106,7 @@ import com.vividsolutions.jts.simplify.TopologyPreservingSimplifier;
|
||||||
* Sep 30, 2013 #2361 njensen Use JAXBManager for XML
|
* Sep 30, 2013 #2361 njensen Use JAXBManager for XML
|
||||||
* Jan 21, 2014 #2720 randerso Improve efficiency of merging polygons in edit area generation
|
* Jan 21, 2014 #2720 randerso Improve efficiency of merging polygons in edit area generation
|
||||||
* Aug 27, 2014 #3563 randerso Fix issue where edit areas are regenerated unnecessarily
|
* Aug 27, 2014 #3563 randerso Fix issue where edit areas are regenerated unnecessarily
|
||||||
|
* Oct 20, 2014 #3685 randerso Changed structure of editAreaAttrs to keep zones from different maps separated
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -131,7 +132,7 @@ public class MapManager {
|
||||||
|
|
||||||
private final Map<String, List<String>> editAreaMap = new HashMap<String, List<String>>();
|
private final Map<String, List<String>> editAreaMap = new HashMap<String, List<String>>();
|
||||||
|
|
||||||
private final Map<String, Map<String, Object>> editAreaAttrs = new HashMap<String, Map<String, Object>>();
|
private final Map<String, List<Map<String, Object>>> editAreaAttrs = new HashMap<String, List<Map<String, Object>>>();
|
||||||
|
|
||||||
private final List<String> iscMarkersID = new ArrayList<String>();
|
private final List<String> iscMarkersID = new ArrayList<String>();
|
||||||
|
|
||||||
|
@ -811,6 +812,8 @@ public class MapManager {
|
||||||
private List<ReferenceData> createReferenceData(DbShapeSource mapDef) {
|
private List<ReferenceData> createReferenceData(DbShapeSource mapDef) {
|
||||||
// ServerResponse sr;
|
// ServerResponse sr;
|
||||||
List<ReferenceData> data = new ArrayList<ReferenceData>();
|
List<ReferenceData> data = new ArrayList<ReferenceData>();
|
||||||
|
List<Map<String, Object>> attributes = new ArrayList<Map<String, Object>>();
|
||||||
|
editAreaAttrs.put(mapDef.getDisplayName(), attributes);
|
||||||
|
|
||||||
// Module dean("DefaultEditAreaNaming");
|
// Module dean("DefaultEditAreaNaming");
|
||||||
ArrayList<String> created = new ArrayList<String>();
|
ArrayList<String> created = new ArrayList<String>();
|
||||||
|
@ -871,7 +874,8 @@ public class MapManager {
|
||||||
// handle new case
|
// handle new case
|
||||||
else {
|
else {
|
||||||
created.add(ean);
|
created.add(ean);
|
||||||
editAreaAttrs.put(ean, info);
|
info.put("editarea", ean);
|
||||||
|
attributes.add(info);
|
||||||
}
|
}
|
||||||
|
|
||||||
tempData.put(ean, mp);
|
tempData.put(ean, mp);
|
||||||
|
|
|
@ -20,27 +20,36 @@
|
||||||
package com.raytheon.edex.plugin.gfe.textproducts;
|
package com.raytheon.edex.plugin.gfe.textproducts;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.io.PrintWriter;
|
||||||
|
import java.text.DecimalFormat;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import jep.JepException;
|
import jep.JepException;
|
||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
|
||||||
import org.apache.commons.logging.LogFactory;
|
|
||||||
|
|
||||||
import com.raytheon.edex.plugin.gfe.reference.MapManager;
|
import com.raytheon.edex.plugin.gfe.reference.MapManager;
|
||||||
import com.raytheon.uf.common.dataplugin.gfe.python.GfePyIncludeUtil;
|
import com.raytheon.uf.common.dataplugin.gfe.python.GfePyIncludeUtil;
|
||||||
|
import com.raytheon.uf.common.dataquery.db.QueryResult;
|
||||||
|
import com.raytheon.uf.common.dataquery.db.QueryResultRow;
|
||||||
import com.raytheon.uf.common.localization.IPathManager;
|
import com.raytheon.uf.common.localization.IPathManager;
|
||||||
import com.raytheon.uf.common.localization.LocalizationContext;
|
import com.raytheon.uf.common.localization.LocalizationContext;
|
||||||
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
|
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
|
||||||
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
|
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.PathManagerFactory;
|
||||||
|
import com.raytheon.uf.common.localization.exception.LocalizationException;
|
||||||
import com.raytheon.uf.common.python.PyUtil;
|
import com.raytheon.uf.common.python.PyUtil;
|
||||||
import com.raytheon.uf.common.python.PythonScript;
|
import com.raytheon.uf.common.python.PythonScript;
|
||||||
|
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||||
|
import com.raytheon.uf.common.status.UFStatus;
|
||||||
import com.raytheon.uf.common.util.FileUtil;
|
import com.raytheon.uf.common.util.FileUtil;
|
||||||
|
import com.raytheon.uf.edex.database.tasks.SqlQueryTask;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO Add Description
|
* Code to generate the AreaDictionary for text formatters
|
||||||
*
|
*
|
||||||
* <pre>
|
* <pre>
|
||||||
*
|
*
|
||||||
|
@ -49,6 +58,8 @@ import com.raytheon.uf.common.util.FileUtil;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* May 4, 2011 wldougher Moved from MapManager
|
* May 4, 2011 wldougher Moved from MapManager
|
||||||
|
* Oct 10, 2014 #3685 randerso Add code to generate the fips2cities and zones2cites
|
||||||
|
* python modules from the GIS database tables
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -57,11 +68,61 @@ import com.raytheon.uf.common.util.FileUtil;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class AreaDictionaryMaker {
|
public class AreaDictionaryMaker {
|
||||||
private static final Log theLogger = LogFactory
|
protected static final transient IUFStatusHandler statusHandler = UFStatus
|
||||||
.getLog(AreaDictionaryMaker.class);
|
.getHandler(AreaDictionaryMaker.class);
|
||||||
|
|
||||||
|
protected static final String FIPS_CITY_QUERY = //
|
||||||
|
"SELECT name, population, ST_Y(city.the_geom), ST_X(city.the_geom) "
|
||||||
|
+ "FROM mapdata.city, mapdata.county "
|
||||||
|
+ "WHERE county.state = '%1$s' AND substring(fips,3,3) = '%2$s' "
|
||||||
|
+ "AND ST_Contains(county.the_geom, city.the_geom) "
|
||||||
|
+ "ORDER BY city.name;";
|
||||||
|
|
||||||
|
protected static final String ZONES_CITY_QUERY = //
|
||||||
|
"SELECT city.name, population, ST_Y(city.the_geom), ST_X(city.the_geom) "
|
||||||
|
+ "FROM mapdata.city, mapdata.zone "
|
||||||
|
+ "WHERE zone.state = '%1$s' AND zone.zone = '%2$s' "
|
||||||
|
+ "AND ST_Contains(zone.the_geom, city.the_geom) "
|
||||||
|
+ "ORDER BY city.name;";
|
||||||
|
|
||||||
|
protected static final Map<String, String> PART_OF_STATE;
|
||||||
|
static {
|
||||||
|
PART_OF_STATE = new HashMap<>(30, 1.0f);
|
||||||
|
PART_OF_STATE.put(null, "");
|
||||||
|
PART_OF_STATE.put("bb", "big bend");
|
||||||
|
PART_OF_STATE.put("c", "");
|
||||||
|
PART_OF_STATE.put("cc", "central");
|
||||||
|
PART_OF_STATE.put("E", "");
|
||||||
|
PART_OF_STATE.put("ea", "east");
|
||||||
|
PART_OF_STATE.put("ec", "east central");
|
||||||
|
PART_OF_STATE.put("ee", "eastern");
|
||||||
|
PART_OF_STATE.put("er", "east central upper");
|
||||||
|
PART_OF_STATE.put("eu", "eastern upper");
|
||||||
|
PART_OF_STATE.put("M", "");
|
||||||
|
PART_OF_STATE.put("mi", "middle");
|
||||||
|
PART_OF_STATE.put("nc", "north central");
|
||||||
|
PART_OF_STATE.put("ne", "northeast");
|
||||||
|
PART_OF_STATE.put("nn", "northern");
|
||||||
|
PART_OF_STATE.put("nr", "north central upper");
|
||||||
|
PART_OF_STATE.put("nw", "northwest");
|
||||||
|
PART_OF_STATE.put("pa", "panhandle");
|
||||||
|
PART_OF_STATE.put("pd", "piedmont");
|
||||||
|
PART_OF_STATE.put("sc", "south central");
|
||||||
|
PART_OF_STATE.put("se", "southeast");
|
||||||
|
PART_OF_STATE.put("so", "south");
|
||||||
|
PART_OF_STATE.put("sr", "south central upper");
|
||||||
|
PART_OF_STATE.put("ss", "southern");
|
||||||
|
PART_OF_STATE.put("sw", "southwest");
|
||||||
|
PART_OF_STATE.put("up", "upstate");
|
||||||
|
PART_OF_STATE.put("wc", "west central");
|
||||||
|
PART_OF_STATE.put("wu", "western upper");
|
||||||
|
PART_OF_STATE.put("ww", "western");
|
||||||
|
}
|
||||||
|
|
||||||
protected IPathManager pathMgr = PathManagerFactory.getPathManager();
|
protected IPathManager pathMgr = PathManagerFactory.getPathManager();
|
||||||
|
|
||||||
|
private Map<String, String> stateDict;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate the AreaDictionary.py and CityLocation.py scripts for site,
|
* Generate the AreaDictionary.py and CityLocation.py scripts for site,
|
||||||
* using editAreaAttrs.
|
* using editAreaAttrs.
|
||||||
|
@ -73,14 +134,14 @@ public class AreaDictionaryMaker {
|
||||||
* A Map from edit area names to shape file attributes
|
* A Map from edit area names to shape file attributes
|
||||||
*/
|
*/
|
||||||
public void genAreaDictionary(String site,
|
public void genAreaDictionary(String site,
|
||||||
Map<String, Map<String, Object>> editAreaAttrs) {
|
Map<String, List<Map<String, Object>>> editAreaAttrs) {
|
||||||
theLogger.info("Area Dictionary generation phase");
|
statusHandler.info("Area Dictionary generation phase");
|
||||||
|
|
||||||
if (site == null) {
|
if (site == null) {
|
||||||
throw new IllegalArgumentException("site is null");
|
throw new IllegalArgumentException("site is null");
|
||||||
}
|
}
|
||||||
|
|
||||||
if ("".equals(site)) {
|
if (site.isEmpty()) {
|
||||||
throw new IllegalArgumentException("site is an empty string");
|
throw new IllegalArgumentException("site is an empty string");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,14 +150,99 @@ public class AreaDictionaryMaker {
|
||||||
}
|
}
|
||||||
|
|
||||||
long t0 = System.currentTimeMillis();
|
long t0 = System.currentTimeMillis();
|
||||||
|
genStateDict();
|
||||||
|
|
||||||
LocalizationContext cx = pathMgr.getContext(
|
LocalizationContext context = pathMgr.getContext(
|
||||||
|
LocalizationContext.LocalizationType.EDEX_STATIC,
|
||||||
|
LocalizationContext.LocalizationLevel.CONFIGURED);
|
||||||
|
context.setContextName(site);
|
||||||
|
|
||||||
|
List<Map<String, Object>> countyAttrs = editAreaAttrs.get("Counties");
|
||||||
|
List<Map<String, Object>> zoneAttrs = editAreaAttrs.get("Zones");
|
||||||
|
|
||||||
|
// To generate national fips2cities and zones2cities files
|
||||||
|
// uncomment the following lines. This should be done for testing
|
||||||
|
// purposes only and should not be checked in uncommented.
|
||||||
|
|
||||||
|
// context = pathMgr.getContext(
|
||||||
|
// LocalizationContext.LocalizationType.EDEX_STATIC,
|
||||||
|
// LocalizationContext.LocalizationLevel.BASE);
|
||||||
|
//
|
||||||
|
// String fipsQuery =
|
||||||
|
// "SELECT fips, state, fe_area, cwa FROM mapdata.county ORDER BY state, fips;";
|
||||||
|
//
|
||||||
|
// SqlQueryTask task = new SqlQueryTask(fipsQuery, "maps");
|
||||||
|
// try {
|
||||||
|
// QueryResult results = task.execute();
|
||||||
|
// countyAttrs = new ArrayList<Map<String, Object>>(
|
||||||
|
// results.getResultCount());
|
||||||
|
// for (QueryResultRow row : results.getRows()) {
|
||||||
|
// String num = (String) row.getColumn(0);
|
||||||
|
// if (num == null) {
|
||||||
|
// continue;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// Map<String, Object> map = new HashMap<>(3, 1.0f);
|
||||||
|
// countyAttrs.add(map);
|
||||||
|
//
|
||||||
|
// String st = (String) row.getColumn(1);
|
||||||
|
// int len = num.length();
|
||||||
|
//
|
||||||
|
// map.put("editarea", st + 'C' + num.substring(len - 3, len));
|
||||||
|
// map.put("fe_area", row.getColumn(2));
|
||||||
|
// map.put("cwa", row.getColumn(3));
|
||||||
|
// }
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// statusHandler.error(e.getLocalizedMessage(), e);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// String zonesQuery =
|
||||||
|
// "SELECT zone, state, fe_area, cwa FROM mapdata.zone ORDER BY state, zone;";
|
||||||
|
// task = new SqlQueryTask(zonesQuery, "maps");
|
||||||
|
// try {
|
||||||
|
// QueryResult results = task.execute();
|
||||||
|
// zoneAttrs = new ArrayList<Map<String, Object>>(
|
||||||
|
// results.getResultCount());
|
||||||
|
// for (QueryResultRow row : results.getRows()) {
|
||||||
|
// String num = (String) row.getColumn(0);
|
||||||
|
// if (num == null) {
|
||||||
|
// continue;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// Map<String, Object> map = new HashMap<>(3, 1.0f);
|
||||||
|
// zoneAttrs.add(map);
|
||||||
|
//
|
||||||
|
// String st = (String) row.getColumn(1);
|
||||||
|
// int len = num.length();
|
||||||
|
//
|
||||||
|
// map.put("editarea", st + 'Z' + num.substring(len - 3, len));
|
||||||
|
// map.put("fe_area", row.getColumn(2));
|
||||||
|
// map.put("cwa", row.getColumn(3));
|
||||||
|
// }
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// statusHandler.error(e.getLocalizedMessage(), e);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// To generate national fips2cities and zones2cities files
|
||||||
|
// uncomment the previous lines
|
||||||
|
|
||||||
|
genFips2Cities(context, countyAttrs);
|
||||||
|
genZones2Cities(context, zoneAttrs);
|
||||||
|
|
||||||
|
LocalizationContext baseCtx = pathMgr.getContext(
|
||||||
LocalizationType.EDEX_STATIC, LocalizationLevel.BASE);
|
LocalizationType.EDEX_STATIC, LocalizationLevel.BASE);
|
||||||
File scriptFile = pathMgr.getLocalizationFile(cx,
|
File scriptFile = pathMgr.getLocalizationFile(baseCtx,
|
||||||
FileUtil.join("gfe", "createAreaDictionary.py")).getFile();
|
FileUtil.join("gfe", "createAreaDictionary.py")).getFile();
|
||||||
|
|
||||||
|
LocalizationContext configCtx = pathMgr.getContext(
|
||||||
|
LocalizationType.EDEX_STATIC, LocalizationLevel.CONFIGURED);
|
||||||
|
configCtx.setContextName(site);
|
||||||
|
File configDir = pathMgr.getLocalizationFile(configCtx, "gfe")
|
||||||
|
.getFile();
|
||||||
|
|
||||||
String includePath = PyUtil.buildJepIncludePath(true,
|
String includePath = PyUtil.buildJepIncludePath(true,
|
||||||
GfePyIncludeUtil.getCommonPythonIncludePath(),
|
GfePyIncludeUtil.getCommonPythonIncludePath(),
|
||||||
scriptFile.getParent());
|
configDir.getPath(), scriptFile.getParent());
|
||||||
Map<String, Object> argMap = new HashMap<String, Object>();
|
Map<String, Object> argMap = new HashMap<String, Object>();
|
||||||
|
|
||||||
LocalizationContext caveStaticConfig = pathMgr.getContext(
|
LocalizationContext caveStaticConfig = pathMgr.getContext(
|
||||||
|
@ -120,7 +266,7 @@ public class AreaDictionaryMaker {
|
||||||
// createAreaDictionary()
|
// createAreaDictionary()
|
||||||
pyScript.execute("createCityLocation", argMap);
|
pyScript.execute("createCityLocation", argMap);
|
||||||
} catch (JepException e) {
|
} catch (JepException e) {
|
||||||
theLogger.error("Error generating area dictionary", e);
|
statusHandler.error("Error generating area dictionary", e);
|
||||||
} finally {
|
} finally {
|
||||||
if (pyScript != null) {
|
if (pyScript != null) {
|
||||||
pyScript.dispose();
|
pyScript.dispose();
|
||||||
|
@ -128,6 +274,138 @@ public class AreaDictionaryMaker {
|
||||||
}
|
}
|
||||||
|
|
||||||
long t1 = System.currentTimeMillis();
|
long t1 = System.currentTimeMillis();
|
||||||
theLogger.info("Area Dictionary generation time: " + (t1 - t0) + " ms");
|
statusHandler.info("Area Dictionary generation time: " + (t1 - t0)
|
||||||
|
+ " ms");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void genFips2Cities(LocalizationContext context,
|
||||||
|
List<Map<String, Object>> attributes) {
|
||||||
|
genArea2Cities(context, attributes, "fips2cities.py", "fipsdata",
|
||||||
|
"FIPS", 'C', FIPS_CITY_QUERY);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void genZones2Cities(LocalizationContext context,
|
||||||
|
List<Map<String, Object>> attributes) {
|
||||||
|
genArea2Cities(context, attributes, "zones2cities.py", "zonedata",
|
||||||
|
"Zones", 'Z', ZONES_CITY_QUERY);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void genArea2Cities(LocalizationContext context,
|
||||||
|
List<Map<String, Object>> attributes, String fileName,
|
||||||
|
String dictName, String group, char separator, String cityQuery) {
|
||||||
|
|
||||||
|
LocalizationFile lf = pathMgr.getLocalizationFile(context,
|
||||||
|
FileUtil.join("gfe", fileName));
|
||||||
|
|
||||||
|
try (PrintWriter out = new PrintWriter(lf.openOutputStream())) {
|
||||||
|
out.println(dictName + " = {");
|
||||||
|
|
||||||
|
try {
|
||||||
|
DecimalFormat df = new DecimalFormat("0.00000");
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
Pattern pattern = Pattern.compile("(\\p{Upper}{2})" + separator
|
||||||
|
+ "(\\d{3})");
|
||||||
|
|
||||||
|
for (Map<String, Object> att : attributes) {
|
||||||
|
String ean = (String) att.get("editarea");
|
||||||
|
if ((ean == null) || ean.isEmpty()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
Matcher matcher = pattern.matcher(ean);
|
||||||
|
if (!matcher.matches()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
String state = matcher.group(1);
|
||||||
|
String num = matcher.group(2);
|
||||||
|
|
||||||
|
String fullStateName = this.stateDict.get(state);
|
||||||
|
String partOfState = PART_OF_STATE.get(att.get("fe_area"));
|
||||||
|
String wfo = (String) att.get("cwa");
|
||||||
|
|
||||||
|
SqlQueryTask task = new SqlQueryTask(String.format(
|
||||||
|
cityQuery, state, num), "maps");
|
||||||
|
|
||||||
|
// retrieve cities for this area
|
||||||
|
QueryResult citiesResult = null;
|
||||||
|
try {
|
||||||
|
citiesResult = task.execute();
|
||||||
|
} catch (Exception e) {
|
||||||
|
statusHandler
|
||||||
|
.error("Error getting cites for " + ean, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
sb.setLength(0);
|
||||||
|
sb.append("'").append(ean).append("': {");
|
||||||
|
sb.append("'fullStateName': '").append(fullStateName)
|
||||||
|
.append("', ");
|
||||||
|
sb.append("'state': '").append(state).append("', ");
|
||||||
|
|
||||||
|
sb.append("'cities': [");
|
||||||
|
if ((citiesResult != null)
|
||||||
|
&& (citiesResult.getResultCount() > 0)) {
|
||||||
|
for (QueryResultRow city : citiesResult.getRows()) {
|
||||||
|
String name = (String) city.getColumn(0);
|
||||||
|
Object population = city.getColumn(1);
|
||||||
|
Double lat = (Double) city.getColumn(2);
|
||||||
|
Double lon = (Double) city.getColumn(3);
|
||||||
|
|
||||||
|
if (name.indexOf("'") >= 0) {
|
||||||
|
sb.append("(\"").append(name).append("\", ");
|
||||||
|
} else {
|
||||||
|
sb.append("('").append(name).append("', ");
|
||||||
|
}
|
||||||
|
if (population == null) {
|
||||||
|
sb.append("None, ");
|
||||||
|
} else {
|
||||||
|
sb.append(population.toString()).append(", ");
|
||||||
|
}
|
||||||
|
sb.append("'").append(df.format(lat)).append("', ");
|
||||||
|
sb.append("'").append(df.format(lon))
|
||||||
|
.append("'), ");
|
||||||
|
}
|
||||||
|
sb.setLength(sb.length() - 2);
|
||||||
|
}
|
||||||
|
sb.append("], ");
|
||||||
|
|
||||||
|
sb.append("'partOfState': '").append(partOfState)
|
||||||
|
.append("', ");
|
||||||
|
sb.append("'wfo': '").append(wfo).append("'}, ");
|
||||||
|
out.println(sb.toString());
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
statusHandler.error(e.getLocalizedMessage(), e);
|
||||||
|
}
|
||||||
|
|
||||||
|
out.println("}");
|
||||||
|
} catch (LocalizationException e) {
|
||||||
|
statusHandler.error(e.getLocalizedMessage(), e);
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
lf.save();
|
||||||
|
} catch (Exception e) {
|
||||||
|
statusHandler.error(e.getLocalizedMessage(), e);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void genStateDict() {
|
||||||
|
SqlQueryTask task = new SqlQueryTask(
|
||||||
|
"SELECT state, name FROM mapdata.states", "maps");
|
||||||
|
try {
|
||||||
|
QueryResult result = task.execute();
|
||||||
|
stateDict = new HashMap<String, String>(result.getResultCount(),
|
||||||
|
1.0f);
|
||||||
|
for (QueryResultRow row : result.getRows()) {
|
||||||
|
String st = (String) row.getColumn(0);
|
||||||
|
String name = (String) row.getColumn(1);
|
||||||
|
stateDict.put(st, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
statusHandler.error(e.getLocalizedMessage(), e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@ package com.raytheon.edex.plugin.gfe.textproducts;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.io.PrintWriter;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -32,10 +32,14 @@ import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
|
||||||
import com.raytheon.edex.utility.ProtectedFiles;
|
import com.raytheon.edex.utility.ProtectedFiles;
|
||||||
|
import com.raytheon.uf.common.dataplugin.gfe.python.GfePyIncludeUtil;
|
||||||
|
import com.raytheon.uf.common.dataquery.db.QueryResult;
|
||||||
|
import com.raytheon.uf.common.dataquery.db.QueryResultRow;
|
||||||
import com.raytheon.uf.common.localization.IPathManager;
|
import com.raytheon.uf.common.localization.IPathManager;
|
||||||
import com.raytheon.uf.common.localization.LocalizationContext;
|
import com.raytheon.uf.common.localization.LocalizationContext;
|
||||||
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
|
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
|
||||||
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
|
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.PathManagerFactory;
|
||||||
import com.raytheon.uf.common.python.PyUtil;
|
import com.raytheon.uf.common.python.PyUtil;
|
||||||
import com.raytheon.uf.common.python.PythonScript;
|
import com.raytheon.uf.common.python.PythonScript;
|
||||||
|
@ -45,6 +49,7 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||||
import com.raytheon.uf.common.util.FileUtil;
|
import com.raytheon.uf.common.util.FileUtil;
|
||||||
import com.raytheon.uf.edex.database.cluster.ClusterLockUtils;
|
import com.raytheon.uf.edex.database.cluster.ClusterLockUtils;
|
||||||
import com.raytheon.uf.edex.database.cluster.ClusterTask;
|
import com.raytheon.uf.edex.database.cluster.ClusterTask;
|
||||||
|
import com.raytheon.uf.edex.database.tasks.SqlQueryTask;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate and configure text products when needed.
|
* Generate and configure text products when needed.
|
||||||
|
@ -59,11 +64,13 @@ import com.raytheon.uf.edex.database.cluster.ClusterTask;
|
||||||
* SOFTWARE HISTORY
|
* SOFTWARE HISTORY
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Jul 7, 2008 1222 jelkins Initial creation
|
* Jul 7, 2008 1222 jelkins Initial creation
|
||||||
* Jul 24,2012 #944 dgilling Fix text product template generation
|
* Jul 24, 2012 #944 dgilling Fix text product template generation
|
||||||
* to create textProducts and textUtilities.
|
* to create textProducts and textUtilities.
|
||||||
* Sep 07,2012 #1150 dgilling Fix isConfigured to check for textProducts
|
* Sep 07, 2012 #1150 dgilling Fix isConfigured to check for textProducts
|
||||||
* and textUtilities dirs.
|
* and textUtilities dirs.
|
||||||
|
* Oct 20, 2014 #3685 randerso Added code to generate SiteCFG.py from GIS database
|
||||||
|
* Cleaned up how protected file updates are returned
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -75,6 +82,8 @@ public class Configurator {
|
||||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||||
.getHandler(Configurator.class);
|
.getHandler(Configurator.class);
|
||||||
|
|
||||||
|
private static final String CWA_QUERY = "select wfo, region, fullstaid, citystate, city, state from mapdata.cwa order by wfo;";
|
||||||
|
|
||||||
private static final String CONFIG_TEXT_PRODUCTS_TASK = "GfeConfigureTextProducts";
|
private static final String CONFIG_TEXT_PRODUCTS_TASK = "GfeConfigureTextProducts";
|
||||||
|
|
||||||
private String siteID;
|
private String siteID;
|
||||||
|
@ -183,26 +192,79 @@ public class Configurator {
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public void execute() {
|
public void execute() {
|
||||||
PythonScript python = null;
|
if (isConfigured()) {
|
||||||
List<String> preEvals = new ArrayList<String>();
|
statusHandler.info("All text products are up to date");
|
||||||
|
return;
|
||||||
|
}
|
||||||
IPathManager pathMgr = PathManagerFactory.getPathManager();
|
IPathManager pathMgr = PathManagerFactory.getPathManager();
|
||||||
|
LocalizationContext context = pathMgr.getContext(
|
||||||
|
LocalizationType.COMMON_STATIC, LocalizationLevel.CONFIGURED);
|
||||||
|
context.setContextName(siteID);
|
||||||
|
|
||||||
|
// regenerate siteCFG.py
|
||||||
|
LocalizationFile lf = null;
|
||||||
|
try {
|
||||||
|
lf = pathMgr.getLocalizationFile(context,
|
||||||
|
FileUtil.join("python", "gfe", "SiteCFG.py"));
|
||||||
|
|
||||||
|
SqlQueryTask task = new SqlQueryTask(CWA_QUERY, "maps");
|
||||||
|
QueryResult results = task.execute();
|
||||||
|
try (PrintWriter out = new PrintWriter(lf.openOutputStream())) {
|
||||||
|
out.println("##");
|
||||||
|
out.println("# Contains information about products, regions, etc. for each site");
|
||||||
|
out.println("# in the country.");
|
||||||
|
out.println("# region= two-letter regional identifier, mainly used for installation of");
|
||||||
|
out.println("# text product templates");
|
||||||
|
out.println("SiteInfo= {");
|
||||||
|
for (QueryResultRow row : results.getRows()) {
|
||||||
|
String wfo = (String) row.getColumn(0);
|
||||||
|
String region = (String) row.getColumn(1);
|
||||||
|
String fullStationID = (String) row.getColumn(2);
|
||||||
|
String wfoCityState = (String) row.getColumn(3);
|
||||||
|
String wfoCity = (String) row.getColumn(4);
|
||||||
|
String state = (String) row.getColumn(5);
|
||||||
|
|
||||||
|
out.println(formatEntry(wfo, region, fullStationID,
|
||||||
|
wfoCityState, wfoCity, state));
|
||||||
|
|
||||||
|
// Add in AFC's dual domain sites
|
||||||
|
if (wfo.equals("AFC")) {
|
||||||
|
out.println(formatEntry("AER", region, fullStationID,
|
||||||
|
wfoCityState, wfoCity, state));
|
||||||
|
out.println(formatEntry("ALU", region, fullStationID,
|
||||||
|
wfoCityState, wfoCity, state));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add in the national centers since they
|
||||||
|
// aren't in the shape file
|
||||||
|
out.println(formatEntry("NH1", "NC", "KNHC",
|
||||||
|
"National Hurricane Center Miami FL", "Miami", ""));
|
||||||
|
out.println(formatEntry("NH2", "NC", "KNHC",
|
||||||
|
"National Hurricane Center Miami FL", "Miami", ""));
|
||||||
|
out.println(formatEntry("ONA", "NC", "KWBC",
|
||||||
|
"Ocean Prediction Center Washington DC",
|
||||||
|
"Washington DC", ""));
|
||||||
|
out.println(formatEntry("ONP", "NC", "KWBC",
|
||||||
|
"Ocean Prediction Center Washington DC",
|
||||||
|
"Washington DC", ""));
|
||||||
|
|
||||||
|
out.println("}");
|
||||||
|
} // out is closed here
|
||||||
|
|
||||||
|
lf.save();
|
||||||
|
} catch (Exception e) {
|
||||||
|
statusHandler.error(e.getLocalizedMessage(), e);
|
||||||
|
}
|
||||||
|
|
||||||
|
PythonScript python = null;
|
||||||
|
|
||||||
LocalizationContext edexCx = pathMgr.getContext(
|
LocalizationContext edexCx = pathMgr.getContext(
|
||||||
LocalizationType.EDEX_STATIC, LocalizationLevel.BASE);
|
LocalizationType.EDEX_STATIC, LocalizationLevel.BASE);
|
||||||
LocalizationContext commonCx = pathMgr.getContext(
|
|
||||||
LocalizationType.COMMON_STATIC, LocalizationLevel.BASE);
|
|
||||||
|
|
||||||
String filePath = pathMgr.getFile(edexCx,
|
String filePath = pathMgr.getFile(edexCx,
|
||||||
"textproducts" + File.separator + "Generator.py").getPath();
|
"textproducts" + File.separator + "Generator.py").getPath();
|
||||||
String textProductPath = pathMgr.getFile(edexCx,
|
String commonPython = GfePyIncludeUtil.getCommonPythonIncludePath();
|
||||||
"textProducts.Generator").getPath();
|
|
||||||
String jutilPath = pathMgr.getFile(commonCx, "python").getPath();
|
|
||||||
|
|
||||||
// Add some getters we need "in the script" that we want hidden
|
|
||||||
preEvals.add("from JUtil import pylistToJavaStringList");
|
|
||||||
preEvals.add("from textproducts.Generator import Generator");
|
|
||||||
preEvals.add("generator = Generator()");
|
|
||||||
preEvals.add("def getProtectedData():\n return pylistToJavaStringList(generator.getProtectedFiles())");
|
|
||||||
|
|
||||||
Map<String, Object> argList = new HashMap<String, Object>();
|
Map<String, Object> argList = new HashMap<String, Object>();
|
||||||
argList.put("siteId", siteID);
|
argList.put("siteId", siteID);
|
||||||
|
@ -210,20 +272,18 @@ public class Configurator {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
python = new PythonScript(filePath, PyUtil.buildJepIncludePath(
|
python = new PythonScript(filePath, PyUtil.buildJepIncludePath(
|
||||||
pythonDirectory, textProductPath, jutilPath), this
|
pythonDirectory, commonPython), this.getClass()
|
||||||
.getClass().getClassLoader(), preEvals);
|
.getClassLoader());
|
||||||
|
|
||||||
// Open the Python interpreter using the designated script.
|
// Open the Python interpreter using the designated script.
|
||||||
python.execute("generator.create", argList);
|
protectedFilesList = (List<String>) python.execute("runFromJava",
|
||||||
protectedFilesList = (List<String>) python.execute(
|
argList);
|
||||||
"getProtectedData", null);
|
|
||||||
|
|
||||||
updateProtectedFile();
|
updateProtectedFile();
|
||||||
updateLastRuntime();
|
updateLastRuntime();
|
||||||
} catch (JepException e) {
|
} catch (JepException e) {
|
||||||
statusHandler.handle(Priority.PROBLEM,
|
statusHandler.handle(Priority.PROBLEM,
|
||||||
"Error Configuring Text Products", e);
|
"Error Configuring Text Products", e);
|
||||||
e.printStackTrace();
|
|
||||||
} finally {
|
} finally {
|
||||||
if (python != null) {
|
if (python != null) {
|
||||||
python.dispose();
|
python.dispose();
|
||||||
|
@ -231,6 +291,22 @@ public class Configurator {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String formatEntry(String wfo, String region, String fullStationID,
|
||||||
|
String wfoCityState, String wfoCity, String state) {
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append(" '").append(wfo).append("': {\n");
|
||||||
|
sb.append(" 'region': '").append(region).append("',\n");
|
||||||
|
sb.append(" 'fullStationID': '").append(fullStationID)
|
||||||
|
.append("',\n");
|
||||||
|
sb.append(" 'wfoCityState': '").append(wfoCityState)
|
||||||
|
.append("',\n");
|
||||||
|
sb.append(" 'wfoCity': '").append(wfoCity).append("',\n");
|
||||||
|
sb.append(" 'state': '").append(state).append("',\n");
|
||||||
|
sb.append(" },");
|
||||||
|
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update the protected files.
|
* Update the protected files.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -35,8 +35,8 @@ from zones2cities import *
|
||||||
# ------------ ---------- ----------- --------------------------
|
# ------------ ---------- ----------- --------------------------
|
||||||
# 01/08/10 #1209 randerso Initial Creation.
|
# 01/08/10 #1209 randerso Initial Creation.
|
||||||
# 10/19/12 #1091 dgilling Support localMaps.py.
|
# 10/19/12 #1091 dgilling Support localMaps.py.
|
||||||
#
|
# 10/20/2014 #3685 randerso Converted text to mixed case
|
||||||
#
|
# Fixed mapDict to keep zones from different maps separate
|
||||||
#
|
#
|
||||||
|
|
||||||
CityLocationDict = {}
|
CityLocationDict = {}
|
||||||
|
@ -111,13 +111,23 @@ def makeCityString(dictRecord):
|
||||||
# handle marine states
|
# handle marine states
|
||||||
def checkMarineState(ugcCode):
|
def checkMarineState(ugcCode):
|
||||||
#returns None if unknown, description if known
|
#returns None if unknown, description if known
|
||||||
areas = {'AM': 'ATLANTIC COASTAL WATERS', 'GM': 'GULF OF MEXICO',
|
areas = {
|
||||||
'LE': 'LAKE ERIE', 'LO': 'LAKE ONTARIO', 'LH': 'LAKE HURON',
|
'AM': 'Atlantic coastal waters',
|
||||||
'SC': 'LAKE ST CLAIR', 'LM': 'LAKE MICHIGAN', 'LS': 'LAKE SUPERIOR',
|
'GM': 'Gulf of Mexico',
|
||||||
'PZ': 'PACIFIC COASTAL WATERS', 'PK': 'ALASKAN COASTAL WATERS',
|
'LE': 'Lake Erie',
|
||||||
'PH': 'HAWAIIAN COASTAL WATERS', 'PM': 'MARIANAS WATERS',
|
'LO': 'Lake Ontario',
|
||||||
'AN': 'ATLANTIC COASTAL WATERS', 'PS': 'AMERICAN SAMOA COASTAL WATERS',
|
'LH': 'Lake Huron',
|
||||||
'SL': 'ST LAWRENCE RIVER'}
|
'SC': 'Lake St Clair',
|
||||||
|
'LM': 'Lake Michigan',
|
||||||
|
'LS': 'Lake Superior',
|
||||||
|
'PZ': 'Pacific coastal waters',
|
||||||
|
'PK': 'Alaskan coastal waters',
|
||||||
|
'PH': 'Hawaiian coastal waters',
|
||||||
|
'PM': 'Marianas waters',
|
||||||
|
'AN': 'Atlantic coastal waters',
|
||||||
|
'PS': 'American Samoa coastal waters',
|
||||||
|
'SL': 'St Lawrence River',
|
||||||
|
}
|
||||||
area = ugcCode[0:2]
|
area = ugcCode[0:2]
|
||||||
return areas.get(area, None)
|
return areas.get(area, None)
|
||||||
|
|
||||||
|
@ -128,82 +138,86 @@ def createAreaDictionary(outputDir, mapDict):
|
||||||
areadict = {}
|
areadict = {}
|
||||||
mapIter = mapDict.entrySet().iterator()
|
mapIter = mapDict.entrySet().iterator()
|
||||||
while mapIter.hasNext():
|
while mapIter.hasNext():
|
||||||
entry = mapIter.next()
|
mapEntry = mapIter.next()
|
||||||
ean = str(entry.getKey())
|
mapname = str(mapEntry.getKey())
|
||||||
att = entry.getValue()
|
attList = mapEntry.getValue()
|
||||||
if len(ean):
|
attIter = attList.iterator()
|
||||||
try:
|
while attIter.hasNext():
|
||||||
d = {}
|
att = attIter.next()
|
||||||
if att.containsKey('zone') and att.containsKey('state'):
|
ean = str(att.get("editarea"))
|
||||||
d['ugcCode'] = str(att.get('state')) + "Z" + str(att.get('zone'))
|
if len(ean):
|
||||||
elif att.containsKey('id'):
|
try:
|
||||||
d['ugcCode'] = str(att.get('id'))
|
d = {}
|
||||||
elif att.containsKey('fips') and att.containsKey('state') and \
|
if att.containsKey('zone') and att.containsKey('state'):
|
||||||
att.containsKey('countyname'):
|
d['ugcCode'] = str(att.get('state')) + "Z" + str(att.get('zone'))
|
||||||
d['ugcCode'] = str(att.get('state')) + "C" + str(att.get('fips'))[-3:]
|
elif att.containsKey('id'):
|
||||||
d['ugcName'] = string.strip(str(att.get('countyname')))
|
d['ugcCode'] = str(att.get('id'))
|
||||||
else:
|
elif att.containsKey('fips') and att.containsKey('state') and \
|
||||||
continue
|
att.containsKey('countyname'):
|
||||||
|
d['ugcCode'] = str(att.get('state')) + "C" + str(att.get('fips'))[-3:]
|
||||||
|
d['ugcName'] = string.strip(str(att.get('countyname')))
|
||||||
|
else:
|
||||||
|
continue
|
||||||
|
|
||||||
if att.containsKey('state'):
|
if att.containsKey('state'):
|
||||||
d["stateAbbr"] = str(att.get('state'))
|
d["stateAbbr"] = str(att.get('state'))
|
||||||
|
|
||||||
if att.containsKey('name'):
|
if att.containsKey('name'):
|
||||||
d["ugcName"] = string.strip(str(att.get('name')))
|
d["ugcName"] = string.strip(str(att.get('name')))
|
||||||
|
|
||||||
if att.containsKey('time_zone'):
|
if att.containsKey('time_zone'):
|
||||||
tzvalue = getRealTimeZone(str(att.get('time_zone')))
|
tzvalue = getRealTimeZone(str(att.get('time_zone')))
|
||||||
if tzvalue is not None:
|
if tzvalue is not None:
|
||||||
d["ugcTimeZone"] = tzvalue
|
d["ugcTimeZone"] = tzvalue
|
||||||
|
|
||||||
if zonedata.has_key(d['ugcCode']):
|
if zonedata.has_key(d['ugcCode']):
|
||||||
cityDict = zonedata[d['ugcCode']]
|
cityDict = zonedata[d['ugcCode']]
|
||||||
elif fipsdata.has_key(d['ugcCode']):
|
elif fipsdata.has_key(d['ugcCode']):
|
||||||
cityDict = fipsdata[d['ugcCode']]
|
cityDict = fipsdata[d['ugcCode']]
|
||||||
else:
|
else:
|
||||||
cityDict = None
|
cityDict = None
|
||||||
|
|
||||||
if cityDict:
|
if cityDict:
|
||||||
cityString = makeCityString(cityDict)
|
cityString = makeCityString(cityDict)
|
||||||
if cityString is not None:
|
if cityString is not None:
|
||||||
cityString, locs = cityString
|
cityString, locs = cityString
|
||||||
if len(cityString):
|
if len(cityString):
|
||||||
d["ugcCityString"] = cityString
|
d["ugcCityString"] = cityString
|
||||||
CityLocationDict[ean] = locs
|
CityLocationDict[ean] = locs
|
||||||
|
|
||||||
# partOfState codes
|
# partOfState codes
|
||||||
if zonedata.has_key(d['ugcCode']):
|
if zonedata.has_key(d['ugcCode']):
|
||||||
if zonedata[d['ugcCode']].has_key('partOfState'):
|
if zonedata[d['ugcCode']].has_key('partOfState'):
|
||||||
d["partOfState"] = \
|
d["partOfState"] = \
|
||||||
zonedata[d['ugcCode']]['partOfState']
|
zonedata[d['ugcCode']]['partOfState']
|
||||||
elif fipsdata.has_key(d['ugcCode']):
|
elif fipsdata.has_key(d['ugcCode']):
|
||||||
if fipsdata[d['ugcCode']].has_key('partOfState'):
|
if fipsdata[d['ugcCode']].has_key('partOfState'):
|
||||||
d["partOfState"] = \
|
d["partOfState"] = \
|
||||||
fipsdata[d['ugcCode']]['partOfState']
|
fipsdata[d['ugcCode']]['partOfState']
|
||||||
|
|
||||||
# full state name
|
# full state name
|
||||||
if zonedata.has_key(d['ugcCode']):
|
if zonedata.has_key(d['ugcCode']):
|
||||||
if zonedata[d['ugcCode']].has_key('fullStateName'):
|
if zonedata[d['ugcCode']].has_key('fullStateName'):
|
||||||
d["fullStateName"] = \
|
d["fullStateName"] = \
|
||||||
zonedata[d['ugcCode']]['fullStateName']
|
zonedata[d['ugcCode']]['fullStateName']
|
||||||
elif fipsdata.has_key(d['ugcCode']):
|
elif fipsdata.has_key(d['ugcCode']):
|
||||||
if fipsdata[d['ugcCode']].has_key('fullStateName'):
|
if fipsdata[d['ugcCode']].has_key('fullStateName'):
|
||||||
d["fullStateName"] = \
|
d["fullStateName"] = \
|
||||||
fipsdata[d['ugcCode']]['fullStateName']
|
fipsdata[d['ugcCode']]['fullStateName']
|
||||||
else:
|
else:
|
||||||
marineState = checkMarineState(d['ugcCode'])
|
marineState = checkMarineState(d['ugcCode'])
|
||||||
if marineState is not None:
|
if marineState is not None:
|
||||||
d['fullStateName'] = marineState
|
d['fullStateName'] = marineState
|
||||||
|
|
||||||
|
|
||||||
if areadict.has_key(ean) and d != areadict[ean]:
|
if areadict.has_key(ean) and d != areadict[ean]:
|
||||||
LogStream.logDiag("Mismatch of definitions in " +\
|
LogStream.logDiag("Mismatch of definitions in " +\
|
||||||
"AreaDictionary creation. EditAreaName=", ean,
|
"AreaDictionary creation. EditAreaName=", ean,
|
||||||
"AreaDict=\n", areadict[ean], "\nIgnored=\n", d)
|
"AreaDict=\n", areadict[ean], "\nIgnored=\n", d)
|
||||||
else:
|
else:
|
||||||
areadict[ean] = d
|
areadict[ean] = d
|
||||||
except:
|
except:
|
||||||
LogStream.logProblem("Problem with ", ean, LogStream.exc())
|
LogStream.logProblem("Problem with ", ean, LogStream.exc())
|
||||||
|
|
||||||
s = """
|
s = """
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -18,29 +18,34 @@
|
||||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||||
# further licensing information.
|
# further licensing information.
|
||||||
##
|
##
|
||||||
|
#
|
||||||
"""Generate site specific text products.
|
# Generate site specific text products.
|
||||||
|
#
|
||||||
This script is run at install time to customize a set of the text products
|
# This script is run at install time to customize a set of the text products
|
||||||
for a given site.
|
# for a given site.
|
||||||
|
#
|
||||||
SOFTWARE HISTORY
|
# SOFTWARE HISTORY
|
||||||
Date Ticket# Engineer Description
|
# Date Ticket# Engineer Description
|
||||||
------------ ---------- ----------- --------------------------
|
# ------------ ---------- ----------- --------------------------
|
||||||
Jun 23, 2008 1180 jelkins Initial creation
|
# Jun 23, 2008 1180 jelkins Initial creation
|
||||||
Jul 08, 2008 1222 jelkins Modified for use within Java
|
# Jul 08, 2008 1222 jelkins Modified for use within Java
|
||||||
Jul 09, 2008 1222 jelkins Split command line loader from class
|
# Jul 09, 2008 1222 jelkins Split command line loader from class
|
||||||
Jul 24, 2012 #944 dgilling Refactored to support separate
|
# Jul 24, 2012 #944 dgilling Refactored to support separate
|
||||||
generation of products and utilities.
|
# generation of products and utilities.
|
||||||
Sep 07, 2012 #1150 dgilling Ensure all necessary dirs get created.
|
# Sep 07, 2012 #1150 dgilling Ensure all necessary dirs get created.
|
||||||
May 12, 2014 2536 bclement renamed text plugin to include uf in name
|
# May 12, 2014 2536 bclement renamed text plugin to include uf in name
|
||||||
|
# Oct 20, 2014 #3685 randerso Changed how SiteInfo is loaded.
|
||||||
@author: jelkins
|
# Fixed logging to log to a file
|
||||||
"""
|
# Cleaned up how protected file updates are returned
|
||||||
|
#
|
||||||
|
# @author: jelkins
|
||||||
|
#
|
||||||
|
##
|
||||||
__version__ = "1.0"
|
__version__ = "1.0"
|
||||||
|
|
||||||
import errno
|
import errno
|
||||||
import os
|
import os
|
||||||
|
import JUtil
|
||||||
from os.path import basename
|
from os.path import basename
|
||||||
from os.path import join
|
from os.path import join
|
||||||
from os.path import dirname
|
from os.path import dirname
|
||||||
|
@ -64,7 +69,6 @@ from sys import path
|
||||||
path.append(join(LIBRARY_DIR,"../"))
|
path.append(join(LIBRARY_DIR,"../"))
|
||||||
path.append(join(PREFERENCE_DIR,"../"))
|
path.append(join(PREFERENCE_DIR,"../"))
|
||||||
|
|
||||||
from library.SiteInfo import SiteInfo as SITE_INFO
|
|
||||||
from preferences.configureTextProducts import NWSProducts as NWS_PRODUCTS
|
from preferences.configureTextProducts import NWSProducts as NWS_PRODUCTS
|
||||||
|
|
||||||
from os.path import basename
|
from os.path import basename
|
||||||
|
@ -73,12 +77,21 @@ from os.path import abspath
|
||||||
from os.path import join
|
from os.path import join
|
||||||
|
|
||||||
# ---- Setup Logging ----------------------------------------------------------
|
# ---- Setup Logging ----------------------------------------------------------
|
||||||
LOG_CONF = join(SCRIPT_DIR,"preferences","logging.conf")
|
import logging
|
||||||
|
from time import strftime, gmtime
|
||||||
|
timeStamp = strftime("%Y%m%d", gmtime())
|
||||||
|
logFile = '/awips2/edex/logs/configureTextProducts-'+timeStamp+'.log'
|
||||||
|
|
||||||
import logging.config
|
LOG = logging.getLogger("configureTextProducts")
|
||||||
logging.config.fileConfig(LOG_CONF)
|
LOG.setLevel(logging.DEBUG)
|
||||||
|
handler = logging.FileHandler(logFile)
|
||||||
|
handler.setLevel(logging.DEBUG)
|
||||||
|
formatter = logging.Formatter("%(levelname)-5s %(asctime)s [%(process)d:%(thread)d] %(filename)s: %(message)s")
|
||||||
|
handler.setFormatter(formatter)
|
||||||
|
for h in LOG.handlers:
|
||||||
|
LOG.removeHandler(h)
|
||||||
|
LOG.addHandler(handler)
|
||||||
|
|
||||||
LOG = logging.getLogger("Generator")
|
|
||||||
|
|
||||||
# List of protected files
|
# List of protected files
|
||||||
fileList = []
|
fileList = []
|
||||||
|
@ -96,6 +109,17 @@ ProcessDirectories = [
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
# This will "load" SiteInfo in a more complicated way
|
||||||
|
# than 'from SiteCFG import SiteInfo'.
|
||||||
|
from LockingFile import File
|
||||||
|
|
||||||
|
pathManager = PathManagerFactory.getPathManager()
|
||||||
|
lf = pathManager.getStaticLocalizationFile(LocalizationType.COMMON_STATIC, "python/gfe/SiteCFG.py")
|
||||||
|
with File(lf.getFile(), lf.getName(), 'r') as file:
|
||||||
|
fileContents = file.read()
|
||||||
|
|
||||||
|
exec fileContents
|
||||||
|
|
||||||
|
|
||||||
class Generator():
|
class Generator():
|
||||||
"""Generates site specific text products from base template files.
|
"""Generates site specific text products from base template files.
|
||||||
|
@ -118,7 +142,7 @@ class Generator():
|
||||||
|
|
||||||
@raise LookupError: when the site ID is invalid
|
@raise LookupError: when the site ID is invalid
|
||||||
"""
|
"""
|
||||||
if siteId in SITE_INFO.keys():
|
if siteId in SiteInfo.keys():
|
||||||
self.__siteId = siteId
|
self.__siteId = siteId
|
||||||
else:
|
else:
|
||||||
raise LookupError, ' unknown WFO: ' + siteId
|
raise LookupError, ' unknown WFO: ' + siteId
|
||||||
|
@ -180,6 +204,8 @@ class Generator():
|
||||||
LOG.info("%d text products created" % created)
|
LOG.info("%d text products created" % created)
|
||||||
LOG.debug("Configuration of Text Products Finish")
|
LOG.debug("Configuration of Text Products Finish")
|
||||||
|
|
||||||
|
return JUtil.pylistToJavaStringList(self.getProtectedFiles())
|
||||||
|
|
||||||
def delete(self):
|
def delete(self):
|
||||||
"""Delete text products"""
|
"""Delete text products"""
|
||||||
|
|
||||||
|
@ -216,11 +242,11 @@ class Generator():
|
||||||
|
|
||||||
LOG.debug("PIL Information for all sites Begin.......")
|
LOG.debug("PIL Information for all sites Begin.......")
|
||||||
|
|
||||||
for site in SITE_INFO.keys():
|
for site in SiteInfo.keys():
|
||||||
LOG.info("--------------------------------------------")
|
LOG.info("--------------------------------------------")
|
||||||
LOG.info("%s %s %s" % (site,
|
LOG.info("%s %s %s" % (site,
|
||||||
SITE_INFO[site]['fullStationID'],
|
SiteInfo[site]['fullStationID'],
|
||||||
SITE_INFO[site]['wfoCityState']))
|
SiteInfo[site]['wfoCityState']))
|
||||||
pils = self.__createPilDictionary(site)
|
pils = self.__createPilDictionary(site)
|
||||||
self.__printPilDictionary(pils)
|
self.__printPilDictionary(pils)
|
||||||
found += len(pils)
|
found += len(pils)
|
||||||
|
@ -303,11 +329,11 @@ class Generator():
|
||||||
|
|
||||||
subDict = {}
|
subDict = {}
|
||||||
subDict['<site>'] = siteid.strip()
|
subDict['<site>'] = siteid.strip()
|
||||||
subDict['<region>'] = SITE_INFO[siteid]['region'].strip()
|
subDict['<region>'] = SiteInfo[siteid]['region'].strip()
|
||||||
subDict['<wfoCityState>'] = SITE_INFO[siteid]['wfoCityState'].strip()
|
subDict['<wfoCityState>'] = SiteInfo[siteid]['wfoCityState'].strip()
|
||||||
subDict['<wfoCity>'] = SITE_INFO[siteid]['wfoCity'].strip()
|
subDict['<wfoCity>'] = SiteInfo[siteid]['wfoCity'].strip()
|
||||||
subDict['<fullStationID>'] = SITE_INFO[siteid]['fullStationID'].strip()
|
subDict['<fullStationID>'] = SiteInfo[siteid]['fullStationID'].strip()
|
||||||
subDict['<state>'] = SITE_INFO[siteid]['state'].strip()
|
subDict['<state>'] = SiteInfo[siteid]['state'].strip()
|
||||||
if product is not None:
|
if product is not None:
|
||||||
subDict['<product>'] = product.strip()
|
subDict['<product>'] = product.strip()
|
||||||
if ProductToStandardMapping.has_key(product):
|
if ProductToStandardMapping.has_key(product):
|
||||||
|
@ -342,7 +368,7 @@ class Generator():
|
||||||
|
|
||||||
subDict = {}
|
subDict = {}
|
||||||
subDict['Site'] = siteid.strip()
|
subDict['Site'] = siteid.strip()
|
||||||
subDict['Region'] = SITE_INFO[siteid]['region'].strip()
|
subDict['Region'] = SiteInfo[siteid]['region'].strip()
|
||||||
if product is not None:
|
if product is not None:
|
||||||
subDict['Product'] = product.strip()
|
subDict['Product'] = product.strip()
|
||||||
if pilInfo is not None and pilInfo.has_key("pil") and multiPilFlag:
|
if pilInfo is not None and pilInfo.has_key("pil") and multiPilFlag:
|
||||||
|
@ -378,10 +404,10 @@ class Generator():
|
||||||
LOG.info("%s %s" % (p,pillist[p]))
|
LOG.info("%s %s" % (p,pillist[p]))
|
||||||
|
|
||||||
def __createPilDictionary(self, siteid):
|
def __createPilDictionary(self, siteid):
|
||||||
"""Update the SITE_INFO with a PIL dictionary
|
"""Update the SiteInfo with a PIL dictionary
|
||||||
|
|
||||||
Read the a2a data from the database, create PIL information, and add the information
|
Read the a2a data from the database, create PIL information, and add the information
|
||||||
to the SITE_INFO dictionary.
|
to the SiteInfo dictionary.
|
||||||
|
|
||||||
@param site: the site for which PIL information is created
|
@param site: the site for which PIL information is created
|
||||||
@type site: string
|
@type site: string
|
||||||
|
@ -390,7 +416,7 @@ class Generator():
|
||||||
@rtype: dictionary
|
@rtype: dictionary
|
||||||
"""
|
"""
|
||||||
|
|
||||||
siteD = SITE_INFO[siteid]
|
siteD = SiteInfo[siteid]
|
||||||
stationID4 = siteD['fullStationID']
|
stationID4 = siteD['fullStationID']
|
||||||
|
|
||||||
from com.raytheon.uf.edex.plugin.text.dao import AfosToAwipsDao
|
from com.raytheon.uf.edex.plugin.text.dao import AfosToAwipsDao
|
||||||
|
@ -435,7 +461,7 @@ class Generator():
|
||||||
e['textdbPil'] = pil
|
e['textdbPil'] = pil
|
||||||
e['awipsWANPil'] = site4 + pil[3:]
|
e['awipsWANPil'] = site4 + pil[3:]
|
||||||
d.append(e)
|
d.append(e)
|
||||||
siteD[nnn] = d #store the pil dictionary back into the SITE_INFO
|
siteD[nnn] = d #store the pil dictionary back into the SiteInfo
|
||||||
|
|
||||||
return pillist
|
return pillist
|
||||||
|
|
||||||
|
@ -572,8 +598,8 @@ class Generator():
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# extract out the pil information from the dictionary
|
# extract out the pil information from the dictionary
|
||||||
if SITE_INFO[siteid].has_key(pilNames[0]):
|
if SiteInfo[siteid].has_key(pilNames[0]):
|
||||||
pils = SITE_INFO[siteid][pilNames[0]]
|
pils = SiteInfo[siteid][pilNames[0]]
|
||||||
else:
|
else:
|
||||||
#set pils to empty list if none defined
|
#set pils to empty list if none defined
|
||||||
pils = [{'awipsWANPil': 'kssscccnnn',
|
pils = [{'awipsWANPil': 'kssscccnnn',
|
||||||
|
@ -729,3 +755,6 @@ class Generator():
|
||||||
|
|
||||||
return productsRemoved
|
return productsRemoved
|
||||||
|
|
||||||
|
def runFromJava(siteId, destinationDir):
|
||||||
|
generator = Generator()
|
||||||
|
return generator.create(siteId, destinationDir)
|
|
@ -1,922 +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.
|
|
||||||
##
|
|
||||||
#Contains information about products, regions, etc. for each site
|
|
||||||
#in the country.
|
|
||||||
|
|
||||||
#region= two-letter regional identifier, mainly used for installation of
|
|
||||||
# text product templates
|
|
||||||
SiteInfo= {
|
|
||||||
'ABQ': {
|
|
||||||
'region': 'SR',
|
|
||||||
'fullStationID': 'KABQ',
|
|
||||||
'wfoCityState': 'ALBUQUERQUE NM',
|
|
||||||
'wfoCity': 'ALBUQUERQUE',
|
|
||||||
'state': 'NEW MEXICO',
|
|
||||||
},
|
|
||||||
'ABR': {
|
|
||||||
'region': 'CR',
|
|
||||||
'fullStationID': 'KABR',
|
|
||||||
'wfoCityState': 'ABERDEEN SD',
|
|
||||||
'wfoCity': 'ABERDEEN',
|
|
||||||
'state': 'SOUTH DAKOTA',
|
|
||||||
},
|
|
||||||
'AER': {
|
|
||||||
'region': 'AR',
|
|
||||||
'fullStationID': 'PAFC',
|
|
||||||
'wfoCityState': 'ANCHORAGE AK',
|
|
||||||
'wfoCity': 'ANCHORAGE',
|
|
||||||
'state': 'ALASKA',
|
|
||||||
},
|
|
||||||
'AFC': {
|
|
||||||
'region': 'AR',
|
|
||||||
'fullStationID': 'PAFC',
|
|
||||||
'wfoCityState': 'ANCHORAGE AK',
|
|
||||||
'wfoCity': 'ANCHORAGE',
|
|
||||||
'state': 'ALASKA',
|
|
||||||
},
|
|
||||||
'AFG': {
|
|
||||||
'region': 'AR',
|
|
||||||
'fullStationID': 'PAFG',
|
|
||||||
'wfoCityState': 'FAIRBANKS AK',
|
|
||||||
'wfoCity': 'FAIRBANKS',
|
|
||||||
'state': 'ALASKA',
|
|
||||||
},
|
|
||||||
'AJK': {
|
|
||||||
'region': 'AR',
|
|
||||||
'fullStationID': 'PAJK',
|
|
||||||
'wfoCityState': 'JUNEAU AK',
|
|
||||||
'wfoCity': 'JUNEAU',
|
|
||||||
'state': 'ALASKA',
|
|
||||||
},
|
|
||||||
'AKQ': {
|
|
||||||
'region': 'ER',
|
|
||||||
'fullStationID': 'KAKQ',
|
|
||||||
'wfoCityState': 'WAKEFIELD VA',
|
|
||||||
'wfoCity': 'WAKEFIELD',
|
|
||||||
'state': 'VIRGINIA',
|
|
||||||
},
|
|
||||||
'ALU': {
|
|
||||||
'region': 'AR',
|
|
||||||
'fullStationID': 'PAFC',
|
|
||||||
'wfoCityState': 'ANCHORAGE AK',
|
|
||||||
'wfoCity': 'ANCHORAGE',
|
|
||||||
'state': 'ALASKA',
|
|
||||||
},
|
|
||||||
'ALY': {
|
|
||||||
'region': 'ER',
|
|
||||||
'fullStationID': 'KALY',
|
|
||||||
'wfoCityState': 'ALBANY NY',
|
|
||||||
'wfoCity': 'ALBANY',
|
|
||||||
'state': 'NEW YORK',
|
|
||||||
},
|
|
||||||
'AMA': {
|
|
||||||
'region': 'SR',
|
|
||||||
'fullStationID': 'KAMA',
|
|
||||||
'wfoCityState': 'AMARILLO TX',
|
|
||||||
'wfoCity': 'AMARILLO',
|
|
||||||
'state': 'TEXAS',
|
|
||||||
},
|
|
||||||
'APX': {
|
|
||||||
'region': 'CR',
|
|
||||||
'fullStationID': 'KAPX',
|
|
||||||
'wfoCityState': 'GAYLORD MI',
|
|
||||||
'wfoCity': 'GAYLORD',
|
|
||||||
'state': 'MICHIGAN',
|
|
||||||
},
|
|
||||||
'ARX': {
|
|
||||||
'region': 'CR',
|
|
||||||
'fullStationID': 'KARX',
|
|
||||||
'wfoCityState': 'LA CROSSE WI',
|
|
||||||
'wfoCity': 'LA CROSSE',
|
|
||||||
'state': 'WISCONSIN',
|
|
||||||
},
|
|
||||||
'BGM': {
|
|
||||||
'region': 'ER',
|
|
||||||
'fullStationID': 'KBGM',
|
|
||||||
'wfoCityState': 'BINGHAMTON NY',
|
|
||||||
'wfoCity': 'BINGHAMTON',
|
|
||||||
'state': 'NEW YORK',
|
|
||||||
},
|
|
||||||
'BIS': {
|
|
||||||
'region': 'CR',
|
|
||||||
'fullStationID': 'KBIS',
|
|
||||||
'wfoCityState': 'BISMARCK ND',
|
|
||||||
'wfoCity': 'BISMARCK',
|
|
||||||
'state': 'NORTH DAKOTA',
|
|
||||||
},
|
|
||||||
'BMX': {
|
|
||||||
'region': 'SR',
|
|
||||||
'fullStationID': 'KBMX',
|
|
||||||
'wfoCityState': 'BIRMINGHAM AL',
|
|
||||||
'wfoCity': 'BIRMINGHAM',
|
|
||||||
'state': 'ALABAMA',
|
|
||||||
},
|
|
||||||
'BOI': {
|
|
||||||
'region': 'WR',
|
|
||||||
'fullStationID': 'KBOI',
|
|
||||||
'wfoCityState': 'BOISE ID',
|
|
||||||
'wfoCity': 'BOISE',
|
|
||||||
'state': 'IDAHO',
|
|
||||||
},
|
|
||||||
'BOU': {
|
|
||||||
'region': 'CR',
|
|
||||||
'fullStationID': 'KBOU',
|
|
||||||
'wfoCityState': 'DENVER CO',
|
|
||||||
'wfoCity': 'DENVER',
|
|
||||||
'state': 'COLORADO',
|
|
||||||
},
|
|
||||||
'BOX': {
|
|
||||||
'region': 'ER',
|
|
||||||
'fullStationID': 'KBOX',
|
|
||||||
'wfoCityState': 'TAUNTON MA',
|
|
||||||
'wfoCity': 'TAUNTON',
|
|
||||||
'state': 'MASSACHUSETTS',
|
|
||||||
},
|
|
||||||
'BRO': {
|
|
||||||
'region': 'SR',
|
|
||||||
'fullStationID': 'KBRO',
|
|
||||||
'wfoCityState': 'BROWNSVILLE TX',
|
|
||||||
'wfoCity': 'BROWNSVILLE',
|
|
||||||
'state': 'TEXAS',
|
|
||||||
},
|
|
||||||
'BTV': {
|
|
||||||
'region': 'ER',
|
|
||||||
'fullStationID': 'KBTV',
|
|
||||||
'wfoCityState': 'BURLINGTON VT',
|
|
||||||
'wfoCity': 'BURLINGTON',
|
|
||||||
'state': 'VERMONT',
|
|
||||||
},
|
|
||||||
'BUF': {
|
|
||||||
'region': 'ER',
|
|
||||||
'fullStationID': 'KBUF',
|
|
||||||
'wfoCityState': 'BUFFALO NY',
|
|
||||||
'wfoCity': 'BUFFALO',
|
|
||||||
'state': 'NEW YORK',
|
|
||||||
},
|
|
||||||
'BYZ': {
|
|
||||||
'region': 'WR',
|
|
||||||
'fullStationID': 'KBYZ',
|
|
||||||
'wfoCityState': 'BILLINGS MT',
|
|
||||||
'wfoCity': 'BILLINGS',
|
|
||||||
'state': 'MONTANA',
|
|
||||||
},
|
|
||||||
'CAE': {
|
|
||||||
'region': 'ER',
|
|
||||||
'fullStationID': 'KCAE',
|
|
||||||
'wfoCityState': 'COLUMBIA SC',
|
|
||||||
'wfoCity': 'COLUMBIA',
|
|
||||||
'state': 'SOUTH CAROLINA',
|
|
||||||
},
|
|
||||||
'CAR': {
|
|
||||||
'region': 'ER',
|
|
||||||
'fullStationID': 'KCAR',
|
|
||||||
'wfoCityState': 'CARIBOU ME',
|
|
||||||
'wfoCity': 'CARIBOU',
|
|
||||||
'state': 'MAINE',
|
|
||||||
},
|
|
||||||
'CHS': {
|
|
||||||
'region': 'ER',
|
|
||||||
'fullStationID': 'KCHS',
|
|
||||||
'wfoCityState': 'CHARLESTON SC',
|
|
||||||
'wfoCity': 'CHARLESTON',
|
|
||||||
'state': 'SOUTH CAROLINA',
|
|
||||||
},
|
|
||||||
'CLE': {
|
|
||||||
'region': 'ER',
|
|
||||||
'fullStationID': 'KCLE',
|
|
||||||
'wfoCityState': 'CLEVELAND OH',
|
|
||||||
'wfoCity': 'CLEVELAND',
|
|
||||||
'state': 'OHIO',
|
|
||||||
},
|
|
||||||
'CRP': {
|
|
||||||
'region': 'SR',
|
|
||||||
'fullStationID': 'KCRP',
|
|
||||||
'wfoCityState': 'CORPUS CHRISTI TX',
|
|
||||||
'wfoCity': 'CORPUS CHRISTI',
|
|
||||||
'state': 'TEXAS',
|
|
||||||
},
|
|
||||||
'CTP': {
|
|
||||||
'region': 'ER',
|
|
||||||
'fullStationID': 'KCTP',
|
|
||||||
'wfoCityState': 'STATE COLLEGE PA',
|
|
||||||
'wfoCity': 'STATE COLLEGE',
|
|
||||||
'state': 'PENNSYLVANIA',
|
|
||||||
},
|
|
||||||
'CYS': {
|
|
||||||
'region': 'CR',
|
|
||||||
'fullStationID': 'KCYS',
|
|
||||||
'wfoCityState': 'CHEYENNE WY',
|
|
||||||
'wfoCity': 'CHEYENNE',
|
|
||||||
'state': 'WYOMING',
|
|
||||||
},
|
|
||||||
'DDC': {
|
|
||||||
'region': 'CR',
|
|
||||||
'fullStationID': 'KDDC',
|
|
||||||
'wfoCityState': 'DODGE CITY KS',
|
|
||||||
'wfoCity': 'DODGE CITY',
|
|
||||||
'state': 'KANSAS',
|
|
||||||
},
|
|
||||||
'DLH': {
|
|
||||||
'region': 'CR',
|
|
||||||
'fullStationID': 'KDLH',
|
|
||||||
'wfoCityState': 'DULUTH MN',
|
|
||||||
'wfoCity': 'DULUTH',
|
|
||||||
'state': 'MINNESOTA',
|
|
||||||
},
|
|
||||||
'DMX': {
|
|
||||||
'region': 'CR',
|
|
||||||
'fullStationID': 'KDMX',
|
|
||||||
'wfoCityState': 'DES MOINES IA',
|
|
||||||
'wfoCity': 'DES MOINES',
|
|
||||||
'state': 'IOWA',
|
|
||||||
},
|
|
||||||
'DTX': {
|
|
||||||
'region': 'CR',
|
|
||||||
'fullStationID': 'KDTX',
|
|
||||||
'wfoCityState': 'DETROIT/PONTIAC MI',
|
|
||||||
'wfoCity': 'DETROIT/PONTIAC',
|
|
||||||
'state': 'MICHIGAN',
|
|
||||||
},
|
|
||||||
'DVN': {
|
|
||||||
'region': 'CR',
|
|
||||||
'fullStationID': 'KDVN',
|
|
||||||
'wfoCityState': 'QUAD CITIES IA IL',
|
|
||||||
'wfoCity': 'QUAD CITIES',
|
|
||||||
'state': 'ILLINOIS',
|
|
||||||
},
|
|
||||||
'EAX': {
|
|
||||||
'region': 'CR',
|
|
||||||
'fullStationID': 'KEAX',
|
|
||||||
'wfoCityState': 'KANSAS CITY/PLEASANT HILL MO',
|
|
||||||
'wfoCity': 'KANSAS CITY/PLEASANT HILL',
|
|
||||||
'state': 'MISSOURI',
|
|
||||||
},
|
|
||||||
'EKA': {
|
|
||||||
'region': 'WR',
|
|
||||||
'fullStationID': 'KEKA',
|
|
||||||
'wfoCityState': 'EUREKA CA',
|
|
||||||
'wfoCity': 'EUREKA',
|
|
||||||
'state': 'CALIFORNIA',
|
|
||||||
},
|
|
||||||
'EPZ': {
|
|
||||||
'region': 'SR',
|
|
||||||
'fullStationID': 'KEPZ',
|
|
||||||
'wfoCityState': 'EL PASO TX/SANTA TERESA NM',
|
|
||||||
'wfoCity': 'EL PASO TX/SANTA TERESA',
|
|
||||||
'state': 'NEW MEXICO',
|
|
||||||
},
|
|
||||||
'EWX': {
|
|
||||||
'region': 'SR',
|
|
||||||
'fullStationID': 'KEWX',
|
|
||||||
'wfoCityState': 'AUSTIN/SAN ANTONIO TX',
|
|
||||||
'wfoCity': 'AUSTIN/SAN ANTONIO',
|
|
||||||
'state': 'TEXAS',
|
|
||||||
},
|
|
||||||
'FFC': {
|
|
||||||
'region': 'SR',
|
|
||||||
'fullStationID': 'KFFC',
|
|
||||||
'wfoCityState': 'PEACHTREE CITY GA',
|
|
||||||
'wfoCity': 'PEACHTREE CITY',
|
|
||||||
'state': 'GEORGIA',
|
|
||||||
},
|
|
||||||
'FGF': {
|
|
||||||
'region': 'CR',
|
|
||||||
'fullStationID': 'KFGF',
|
|
||||||
'wfoCityState': 'GRAND FORKS ND',
|
|
||||||
'wfoCity': 'GRAND FORKS',
|
|
||||||
'state': 'NORTH DAKOTA',
|
|
||||||
},
|
|
||||||
'FGZ': {
|
|
||||||
'region': 'WR',
|
|
||||||
'fullStationID': 'KFGZ',
|
|
||||||
'wfoCityState': 'FLAGSTAFF AZ',
|
|
||||||
'wfoCity': 'FLAGSTAFF',
|
|
||||||
'state': 'ARIZONA',
|
|
||||||
},
|
|
||||||
'FSD': {
|
|
||||||
'region': 'CR',
|
|
||||||
'fullStationID': 'KFSD',
|
|
||||||
'wfoCityState': 'SIOUX FALLS SD',
|
|
||||||
'wfoCity': 'SIOUX FALLS',
|
|
||||||
'state': 'SOUTH DAKOTA',
|
|
||||||
},
|
|
||||||
'FWD': {
|
|
||||||
'region': 'SR',
|
|
||||||
'fullStationID': 'KFWD',
|
|
||||||
'wfoCityState': 'FORT WORTH TX',
|
|
||||||
'wfoCity': 'FORT WORTH',
|
|
||||||
'state': 'TEXAS',
|
|
||||||
},
|
|
||||||
'GGW': {
|
|
||||||
'region': 'WR',
|
|
||||||
'fullStationID': 'KGGW',
|
|
||||||
'wfoCityState': 'GLASGOW MT',
|
|
||||||
'wfoCity': 'GLASGOW',
|
|
||||||
'state': 'MONTANA',
|
|
||||||
},
|
|
||||||
'GID': {
|
|
||||||
'region': 'CR',
|
|
||||||
'fullStationID': 'KGID',
|
|
||||||
'wfoCityState': 'HASTINGS NE',
|
|
||||||
'wfoCity': 'HASTINGS',
|
|
||||||
'state': 'NEBRASKA',
|
|
||||||
},
|
|
||||||
'GJT': {
|
|
||||||
'region': 'CR',
|
|
||||||
'fullStationID': 'KGJT',
|
|
||||||
'wfoCityState': 'GRAND JUNCTION CO',
|
|
||||||
'wfoCity': 'GRAND JUNCTION',
|
|
||||||
'state': 'COLORADO',
|
|
||||||
},
|
|
||||||
'GLD': {
|
|
||||||
'region': 'CR',
|
|
||||||
'fullStationID': 'KGLD',
|
|
||||||
'wfoCityState': 'GOODLAND KS',
|
|
||||||
'wfoCity': 'GOODLAND',
|
|
||||||
'state': 'KANSAS',
|
|
||||||
},
|
|
||||||
'GRB': {
|
|
||||||
'region': 'CR',
|
|
||||||
'fullStationID': 'KGRB',
|
|
||||||
'wfoCityState': 'GREEN BAY WI',
|
|
||||||
'wfoCity': 'GREEN BAY',
|
|
||||||
'state': 'WISCONSIN',
|
|
||||||
},
|
|
||||||
'GRR': {
|
|
||||||
'region': 'CR',
|
|
||||||
'fullStationID': 'KGRR',
|
|
||||||
'wfoCityState': 'GRAND RAPIDS MI',
|
|
||||||
'wfoCity': 'GRAND RAPIDS',
|
|
||||||
'state': 'MICHIGAN',
|
|
||||||
},
|
|
||||||
'GSP': {
|
|
||||||
'region': 'ER',
|
|
||||||
'fullStationID': 'KGSP',
|
|
||||||
'wfoCityState': 'GREENVILLE-SPARTANBURG SC',
|
|
||||||
'wfoCity': 'GREENVILLE-SPARTANBURG',
|
|
||||||
'state': 'SOUTH CAROLINA',
|
|
||||||
},
|
|
||||||
'GUM': {
|
|
||||||
'region': 'PR',
|
|
||||||
'fullStationID': 'PGUM',
|
|
||||||
'wfoCityState': 'TIYAN GU',
|
|
||||||
'wfoCity': 'TIYAN',
|
|
||||||
'state': 'GUAM',
|
|
||||||
},
|
|
||||||
'GYX': {
|
|
||||||
'region': 'ER',
|
|
||||||
'fullStationID': 'KGYX',
|
|
||||||
'wfoCityState': 'GRAY ME',
|
|
||||||
'wfoCity': 'GRAY',
|
|
||||||
'state': 'MAINE',
|
|
||||||
},
|
|
||||||
'HFO': {
|
|
||||||
'region': 'PR',
|
|
||||||
'fullStationID': 'PHFO',
|
|
||||||
'wfoCityState': 'HONOLULU HI',
|
|
||||||
'wfoCity': 'HONOLULU',
|
|
||||||
'state': 'HAWAII',
|
|
||||||
},
|
|
||||||
'HGX': {
|
|
||||||
'region': 'SR',
|
|
||||||
'fullStationID': 'KHGX',
|
|
||||||
'wfoCityState': 'HOUSTON/GALVESTON TX',
|
|
||||||
'wfoCity': 'HOUSTON/GALVESTON',
|
|
||||||
'state': 'TEXAS',
|
|
||||||
},
|
|
||||||
'HNX': {
|
|
||||||
'region': 'WR',
|
|
||||||
'fullStationID': 'KHNX',
|
|
||||||
'wfoCityState': 'HANFORD CA',
|
|
||||||
'wfoCity': 'HANFORD',
|
|
||||||
'state': 'CALIFORNIA',
|
|
||||||
},
|
|
||||||
'HUN': {
|
|
||||||
'region': 'SR',
|
|
||||||
'fullStationID': 'KHUN',
|
|
||||||
'wfoCityState': 'HUNTSVILLE AL',
|
|
||||||
'wfoCity': 'HUNTSVILLE',
|
|
||||||
'state': 'ALABAMA',
|
|
||||||
},
|
|
||||||
'ICT': {
|
|
||||||
'region': 'CR',
|
|
||||||
'fullStationID': 'KICT',
|
|
||||||
'wfoCityState': 'WICHITA KS',
|
|
||||||
'wfoCity': 'WICHITA',
|
|
||||||
'state': 'KANSAS',
|
|
||||||
},
|
|
||||||
'ILM': {
|
|
||||||
'region': 'ER',
|
|
||||||
'fullStationID': 'KILM',
|
|
||||||
'wfoCityState': 'WILMINGTON NC',
|
|
||||||
'wfoCity': 'WILMINGTON',
|
|
||||||
'state': 'NORTH CAROLINA',
|
|
||||||
},
|
|
||||||
'ILN': {
|
|
||||||
'region': 'ER',
|
|
||||||
'fullStationID': 'KILN',
|
|
||||||
'wfoCityState': 'WILMINGTON OH',
|
|
||||||
'wfoCity': 'WILMINGTON',
|
|
||||||
'state': 'OHIO',
|
|
||||||
},
|
|
||||||
'ILX': {
|
|
||||||
'region': 'CR',
|
|
||||||
'fullStationID': 'KILX',
|
|
||||||
'wfoCityState': 'LINCOLN IL',
|
|
||||||
'wfoCity': 'LINCOLN',
|
|
||||||
'state': 'ILLINOIS',
|
|
||||||
},
|
|
||||||
'IND': {
|
|
||||||
'region': 'CR',
|
|
||||||
'fullStationID': 'KIND',
|
|
||||||
'wfoCityState': 'INDIANAPOLIS IN',
|
|
||||||
'wfoCity': 'INDIANAPOLIS',
|
|
||||||
'state': 'INDIANA',
|
|
||||||
},
|
|
||||||
'IWX': {
|
|
||||||
'region': 'CR',
|
|
||||||
'fullStationID': 'KIWX',
|
|
||||||
'wfoCityState': 'NORTHERN INDIANA',
|
|
||||||
'wfoCity': 'NORTHERN INDIANA',
|
|
||||||
'state': 'INDIANA',
|
|
||||||
},
|
|
||||||
'JAN': {
|
|
||||||
'region': 'SR',
|
|
||||||
'fullStationID': 'KJAN',
|
|
||||||
'wfoCityState': 'JACKSON MS',
|
|
||||||
'wfoCity': 'JACKSON',
|
|
||||||
'state': 'MISSISSIPPI',
|
|
||||||
},
|
|
||||||
'JAX': {
|
|
||||||
'region': 'SR',
|
|
||||||
'fullStationID': 'KJAX',
|
|
||||||
'wfoCityState': 'JACKSONVILLE FL',
|
|
||||||
'wfoCity': 'JACKSONVILLE',
|
|
||||||
'state': 'FLORIDA',
|
|
||||||
},
|
|
||||||
'JKL': {
|
|
||||||
'region': 'CR',
|
|
||||||
'fullStationID': 'KJKL',
|
|
||||||
'wfoCityState': 'JACKSON KY',
|
|
||||||
'wfoCity': 'JACKSON',
|
|
||||||
'state': 'KENTUCKY',
|
|
||||||
},
|
|
||||||
'KEY': {
|
|
||||||
'region': 'SR',
|
|
||||||
'fullStationID': 'KKEY',
|
|
||||||
'wfoCityState': 'KEY WEST FL',
|
|
||||||
'wfoCity': 'KEY WEST',
|
|
||||||
'state': 'FLORIDA',
|
|
||||||
},
|
|
||||||
'LBF': {
|
|
||||||
'region': 'CR',
|
|
||||||
'fullStationID': 'KLBF',
|
|
||||||
'wfoCityState': 'NORTH PLATTE NE',
|
|
||||||
'wfoCity': 'NORTH PLATTE',
|
|
||||||
'state': 'NEBRASKA',
|
|
||||||
},
|
|
||||||
'LCH': {
|
|
||||||
'region': 'SR',
|
|
||||||
'fullStationID': 'KLCH',
|
|
||||||
'wfoCityState': 'LAKE CHARLES LA',
|
|
||||||
'wfoCity': 'LAKE CHARLES',
|
|
||||||
'state': 'LOUISIANA',
|
|
||||||
},
|
|
||||||
'LIX': {
|
|
||||||
'region': 'SR',
|
|
||||||
'fullStationID': 'KLIX',
|
|
||||||
'wfoCityState': 'NEW ORLEANS LA',
|
|
||||||
'wfoCity': 'NEW ORLEANS',
|
|
||||||
'state': 'LOUISIANA',
|
|
||||||
},
|
|
||||||
'LKN': {
|
|
||||||
'region': 'WR',
|
|
||||||
'fullStationID': 'KLKN',
|
|
||||||
'wfoCityState': 'ELKO NV',
|
|
||||||
'wfoCity': 'ELKO',
|
|
||||||
'state': 'NEVADA',
|
|
||||||
},
|
|
||||||
'LMK': {
|
|
||||||
'region': 'CR',
|
|
||||||
'fullStationID': 'KLMK',
|
|
||||||
'wfoCityState': 'LOUISVILLE KY',
|
|
||||||
'wfoCity': 'LOUISVILLE',
|
|
||||||
'state': 'KENTUCKY',
|
|
||||||
},
|
|
||||||
'LOT': {
|
|
||||||
'region': 'CR',
|
|
||||||
'fullStationID': 'KLOT',
|
|
||||||
'wfoCityState': 'CHICAGO IL',
|
|
||||||
'wfoCity': 'CHICAGO',
|
|
||||||
'state': 'ILLINOIS',
|
|
||||||
},
|
|
||||||
'LOX': {
|
|
||||||
'region': 'WR',
|
|
||||||
'fullStationID': 'KLOX',
|
|
||||||
'wfoCityState': 'LOS ANGELES/OXNARD CA',
|
|
||||||
'wfoCity': 'LOS ANGELES/OXNARD',
|
|
||||||
'state': 'CALIFORNIA',
|
|
||||||
},
|
|
||||||
'LSX': {
|
|
||||||
'region': 'CR',
|
|
||||||
'fullStationID': 'KLSX',
|
|
||||||
'wfoCityState': 'ST LOUIS MO',
|
|
||||||
'wfoCity': 'ST LOUIS',
|
|
||||||
'state': 'MISSOURI',
|
|
||||||
},
|
|
||||||
'LUB': {
|
|
||||||
'region': 'SR',
|
|
||||||
'fullStationID': 'KLUB',
|
|
||||||
'wfoCityState': 'LUBBOCK TX',
|
|
||||||
'wfoCity': 'LUBBOCK',
|
|
||||||
'state': 'TEXAS',
|
|
||||||
},
|
|
||||||
'LWX': {
|
|
||||||
'region': 'ER',
|
|
||||||
'fullStationID': 'KLWX',
|
|
||||||
'wfoCityState': 'BALTIMORE MD/WASHINGTON DC',
|
|
||||||
'wfoCity': 'BALTIMORE MD/WASHINGTON',
|
|
||||||
'state': 'WASHINGTON DC',
|
|
||||||
},
|
|
||||||
'LZK': {
|
|
||||||
'region': 'SR',
|
|
||||||
'fullStationID': 'KLZK',
|
|
||||||
'wfoCityState': 'LITTLE ROCK AR',
|
|
||||||
'wfoCity': 'LITTLE ROCK',
|
|
||||||
'state': 'ARKANSAS',
|
|
||||||
},
|
|
||||||
'MAF': {
|
|
||||||
'region': 'SR',
|
|
||||||
'fullStationID': 'KMAF',
|
|
||||||
'wfoCityState': 'MIDLAND/ODESSA TX',
|
|
||||||
'wfoCity': 'MIDLAND/ODESSA',
|
|
||||||
'state': 'TEXAS',
|
|
||||||
},
|
|
||||||
'MEG': {
|
|
||||||
'region': 'SR',
|
|
||||||
'fullStationID': 'KMEG',
|
|
||||||
'wfoCityState': 'MEMPHIS TN',
|
|
||||||
'wfoCity': 'MEMPHIS',
|
|
||||||
'state': 'TENNESSEE',
|
|
||||||
},
|
|
||||||
'MFL': {
|
|
||||||
'region': 'SR',
|
|
||||||
'fullStationID': 'KMFL',
|
|
||||||
'wfoCityState': 'MIAMI FL',
|
|
||||||
'wfoCity': 'MIAMI',
|
|
||||||
'state': 'FLORIDA',
|
|
||||||
},
|
|
||||||
'MFR': {
|
|
||||||
'region': 'WR',
|
|
||||||
'fullStationID': 'KMFR',
|
|
||||||
'wfoCityState': 'MEDFORD OR',
|
|
||||||
'wfoCity': 'MEDFORD',
|
|
||||||
'state': 'OREGON',
|
|
||||||
},
|
|
||||||
'MHX': {
|
|
||||||
'region': 'ER',
|
|
||||||
'fullStationID': 'KMHX',
|
|
||||||
'wfoCityState': 'NEWPORT/MOREHEAD CITY NC',
|
|
||||||
'wfoCity': 'NEWPORT/MOREHEAD CITY',
|
|
||||||
'state': 'NORTH CAROLINA',
|
|
||||||
},
|
|
||||||
'MKX': {
|
|
||||||
'region': 'CR',
|
|
||||||
'fullStationID': 'KMKX',
|
|
||||||
'wfoCityState': 'MILWAUKEE/SULLIVAN WI',
|
|
||||||
'wfoCity': 'MILWAUKEE/SULLIVAN',
|
|
||||||
'state': 'WISCONSIN',
|
|
||||||
},
|
|
||||||
'MLB': {
|
|
||||||
'region': 'SR',
|
|
||||||
'fullStationID': 'KMLB',
|
|
||||||
'wfoCityState': 'MELBOURNE FL',
|
|
||||||
'wfoCity': 'MELBOURNE',
|
|
||||||
'state': 'FLORIDA',
|
|
||||||
},
|
|
||||||
'MOB': {
|
|
||||||
'region': 'SR',
|
|
||||||
'fullStationID': 'KMOB',
|
|
||||||
'wfoCityState': 'MOBILE AL',
|
|
||||||
'wfoCity': 'MOBILE',
|
|
||||||
'state': 'ALABAMA',
|
|
||||||
},
|
|
||||||
'MPX': {
|
|
||||||
'region': 'CR',
|
|
||||||
'fullStationID': 'KMPX',
|
|
||||||
'wfoCityState': 'TWIN CITIES/CHANHASSEN MN',
|
|
||||||
'wfoCity': 'TWIN CITIES/CHANHASSEN',
|
|
||||||
'state': 'MINNESOTA',
|
|
||||||
},
|
|
||||||
'MQT': {
|
|
||||||
'region': 'CR',
|
|
||||||
'fullStationID': 'KMQT',
|
|
||||||
'wfoCityState': 'MARQUETTE MI',
|
|
||||||
'wfoCity': 'MARQUETTE',
|
|
||||||
'state': 'MICHIGAN',
|
|
||||||
},
|
|
||||||
'MRX': {
|
|
||||||
'region': 'SR',
|
|
||||||
'fullStationID': 'KMRX',
|
|
||||||
'wfoCityState': 'MORRISTOWN TN',
|
|
||||||
'wfoCity': 'MORRISTOWN',
|
|
||||||
'state': 'TENNESSEE',
|
|
||||||
},
|
|
||||||
'MSO': {
|
|
||||||
'region': 'WR',
|
|
||||||
'fullStationID': 'KMSO',
|
|
||||||
'wfoCityState': 'MISSOULA MT',
|
|
||||||
'wfoCity': 'MISSOULA',
|
|
||||||
'state': 'MONTANA',
|
|
||||||
},
|
|
||||||
'MTR': {
|
|
||||||
'region': 'WR',
|
|
||||||
'fullStationID': 'KMTR',
|
|
||||||
'wfoCityState': 'SAN FRANCISCO CA',
|
|
||||||
'wfoCity': 'SAN FRANCISCO',
|
|
||||||
'state': 'CALIFORNIA',
|
|
||||||
},
|
|
||||||
'NH1': {
|
|
||||||
'region': 'NC',
|
|
||||||
'fullStationID': 'KNHC',
|
|
||||||
'wfoCityState': 'NATIONAL HURRICANE CENTER MIAMI FL',
|
|
||||||
'wfoCity': 'MIAMI',
|
|
||||||
'state': '',
|
|
||||||
},
|
|
||||||
'NH2': {
|
|
||||||
'region': 'NC',
|
|
||||||
'fullStationID': 'KNHC',
|
|
||||||
'wfoCityState': 'NATIONAL HURRICANE CENTER MIAMI FL',
|
|
||||||
'wfoCity': 'MIAMI',
|
|
||||||
'state': '',
|
|
||||||
},
|
|
||||||
'OAX': {
|
|
||||||
'region': 'CR',
|
|
||||||
'fullStationID': 'KOAX',
|
|
||||||
'wfoCityState': 'OMAHA/VALLEY NE',
|
|
||||||
'wfoCity': 'OMAHA/VALLEY',
|
|
||||||
'state': 'NEBRASKA',
|
|
||||||
},
|
|
||||||
'OHX': {
|
|
||||||
'region': 'SR',
|
|
||||||
'fullStationID': 'KOHX',
|
|
||||||
'wfoCityState': 'NASHVILLE TN',
|
|
||||||
'wfoCity': 'NASHVILLE',
|
|
||||||
'state': 'TENNESSEE',
|
|
||||||
},
|
|
||||||
'OKX': {
|
|
||||||
'region': 'ER',
|
|
||||||
'fullStationID': 'KOKX',
|
|
||||||
'wfoCityState': 'UPTON NY',
|
|
||||||
'wfoCity': 'UPTON',
|
|
||||||
'state': 'NEW YORK',
|
|
||||||
},
|
|
||||||
'ONA': {
|
|
||||||
'region': 'NC',
|
|
||||||
'fullStationID': 'KWBC',
|
|
||||||
'wfoCityState': 'OCEAN PREDICTION CENTER WASHINGTON DC',
|
|
||||||
'wfoCity': 'WASHINGTON DC',
|
|
||||||
'state': '',
|
|
||||||
},
|
|
||||||
'ONP': {
|
|
||||||
'region': 'NC',
|
|
||||||
'fullStationID': 'KWBC',
|
|
||||||
'wfoCityState': 'OCEAN PREDICTION CENTER WASHINGTON DC',
|
|
||||||
'wfoCity': 'WASHINGTON DC',
|
|
||||||
'state': '',
|
|
||||||
},
|
|
||||||
'OTX': {
|
|
||||||
'region': 'WR',
|
|
||||||
'fullStationID': 'KOTX',
|
|
||||||
'wfoCityState': 'SPOKANE WA',
|
|
||||||
'wfoCity': 'SPOKANE',
|
|
||||||
'state': 'WASHINGTON',
|
|
||||||
},
|
|
||||||
'OUN': {
|
|
||||||
'region': 'SR',
|
|
||||||
'fullStationID': 'KOUN',
|
|
||||||
'wfoCityState': 'NORMAN OK',
|
|
||||||
'wfoCity': 'NORMAN',
|
|
||||||
'state': 'OKLAHOMA',
|
|
||||||
},
|
|
||||||
'PAH': {
|
|
||||||
'region': 'CR',
|
|
||||||
'fullStationID': 'KPAH',
|
|
||||||
'wfoCityState': 'PADUCAH KY',
|
|
||||||
'wfoCity': 'PADUCAH',
|
|
||||||
'state': 'KENTUCKY',
|
|
||||||
},
|
|
||||||
'PBZ': {
|
|
||||||
'region': 'ER',
|
|
||||||
'fullStationID': 'KPBZ',
|
|
||||||
'wfoCityState': 'PITTSBURGH PA',
|
|
||||||
'wfoCity': 'PITTSBURGH',
|
|
||||||
'state': 'PENNSYLVANIA',
|
|
||||||
},
|
|
||||||
'PDT': {
|
|
||||||
'region': 'WR',
|
|
||||||
'fullStationID': 'KPDT',
|
|
||||||
'wfoCityState': 'PENDLETON OR',
|
|
||||||
'wfoCity': 'PENDLETON',
|
|
||||||
'state': 'OREGON',
|
|
||||||
},
|
|
||||||
'PHI': {
|
|
||||||
'region': 'ER',
|
|
||||||
'fullStationID': 'KPHI',
|
|
||||||
'wfoCityState': 'MOUNT HOLLY NJ',
|
|
||||||
'wfoCity': 'MOUNT HOLLY',
|
|
||||||
'state': 'NEW JERSEY',
|
|
||||||
},
|
|
||||||
'PIH': {
|
|
||||||
'region': 'WR',
|
|
||||||
'fullStationID': 'KPIH',
|
|
||||||
'wfoCityState': 'POCATELLO ID',
|
|
||||||
'wfoCity': 'POCATELLO',
|
|
||||||
'state': 'IDAHO',
|
|
||||||
},
|
|
||||||
'PQR': {
|
|
||||||
'region': 'WR',
|
|
||||||
'fullStationID': 'KPQR',
|
|
||||||
'wfoCityState': 'PORTLAND OR',
|
|
||||||
'wfoCity': 'PORTLAND',
|
|
||||||
'state': 'OREGON',
|
|
||||||
},
|
|
||||||
'PSR': {
|
|
||||||
'region': 'WR',
|
|
||||||
'fullStationID': 'KPSR',
|
|
||||||
'wfoCityState': 'PHOENIX AZ',
|
|
||||||
'wfoCity': 'PHOENIX',
|
|
||||||
'state': 'ARIZONA',
|
|
||||||
},
|
|
||||||
'PUB': {
|
|
||||||
'region': 'CR',
|
|
||||||
'fullStationID': 'KPUB',
|
|
||||||
'wfoCityState': 'PUEBLO CO',
|
|
||||||
'wfoCity': 'PUEBLO',
|
|
||||||
'state': 'COLORADO',
|
|
||||||
},
|
|
||||||
'RAH': {
|
|
||||||
'region': 'ER',
|
|
||||||
'fullStationID': 'KRAH',
|
|
||||||
'wfoCityState': 'RALEIGH NC',
|
|
||||||
'wfoCity': 'RALEIGH',
|
|
||||||
'state': 'NORTH CAROLINA',
|
|
||||||
},
|
|
||||||
'REV': {
|
|
||||||
'region': 'WR',
|
|
||||||
'fullStationID': 'KREV',
|
|
||||||
'wfoCityState': 'RENO NV',
|
|
||||||
'wfoCity': 'RENO',
|
|
||||||
'state': 'NEVADA',
|
|
||||||
},
|
|
||||||
'RIW': {
|
|
||||||
'region': 'CR',
|
|
||||||
'fullStationID': 'KRIW',
|
|
||||||
'wfoCityState': 'RIVERTON WY',
|
|
||||||
'wfoCity': 'RIVERTON',
|
|
||||||
'state': 'WYOMING',
|
|
||||||
},
|
|
||||||
'RLX': {
|
|
||||||
'region': 'ER',
|
|
||||||
'fullStationID': 'KRLX',
|
|
||||||
'wfoCityState': 'CHARLESTON WV',
|
|
||||||
'wfoCity': 'CHARLESTON',
|
|
||||||
'state': 'WEST VIRGINIA',
|
|
||||||
},
|
|
||||||
'RNK': {
|
|
||||||
'region': 'ER',
|
|
||||||
'fullStationID': 'KRNK',
|
|
||||||
'wfoCityState': 'BLACKSBURG VA',
|
|
||||||
'wfoCity': 'BLACKSBURG',
|
|
||||||
'state': 'VIRGINIA',
|
|
||||||
},
|
|
||||||
'SEW': {
|
|
||||||
'region': 'WR',
|
|
||||||
'fullStationID': 'KSEW',
|
|
||||||
'wfoCityState': 'SEATTLE WA',
|
|
||||||
'wfoCity': 'SEATTLE',
|
|
||||||
'state': 'WASHINGTON',
|
|
||||||
},
|
|
||||||
'SGF': {
|
|
||||||
'region': 'CR',
|
|
||||||
'fullStationID': 'KSGF',
|
|
||||||
'wfoCityState': 'SPRINGFIELD MO',
|
|
||||||
'wfoCity': 'SPRINGFIELD',
|
|
||||||
'state': 'MISSOURI',
|
|
||||||
},
|
|
||||||
'SGX': {
|
|
||||||
'region': 'WR',
|
|
||||||
'fullStationID': 'KSGX',
|
|
||||||
'wfoCityState': 'SAN DIEGO CA',
|
|
||||||
'wfoCity': 'SAN DIEGO',
|
|
||||||
'state': 'CALIFORNIA',
|
|
||||||
},
|
|
||||||
'SHV': {
|
|
||||||
'region': 'SR',
|
|
||||||
'fullStationID': 'KSHV',
|
|
||||||
'wfoCityState': 'SHREVEPORT LA',
|
|
||||||
'wfoCity': 'SHREVEPORT',
|
|
||||||
'state': 'LOUISIANA',
|
|
||||||
},
|
|
||||||
'SJT': {
|
|
||||||
'region': 'SR',
|
|
||||||
'fullStationID': 'KSJT',
|
|
||||||
'wfoCityState': 'SAN ANGELO TX',
|
|
||||||
'wfoCity': 'SAN ANGELO',
|
|
||||||
'state': 'TEXAS',
|
|
||||||
},
|
|
||||||
'SJU': {
|
|
||||||
'region': 'SR',
|
|
||||||
'fullStationID': 'TJSJ',
|
|
||||||
'wfoCityState': 'SAN JUAN PR',
|
|
||||||
'wfoCity': 'SAN JUAN',
|
|
||||||
'state': 'PUERTO RICO',
|
|
||||||
},
|
|
||||||
'SLC': {
|
|
||||||
'region': 'WR',
|
|
||||||
'fullStationID': 'KSLC',
|
|
||||||
'wfoCityState': 'SALT LAKE CITY UT',
|
|
||||||
'wfoCity': 'SALT LAKE CITY',
|
|
||||||
'state': 'UTAH',
|
|
||||||
},
|
|
||||||
'STO': {
|
|
||||||
'region': 'WR',
|
|
||||||
'fullStationID': 'KSTO',
|
|
||||||
'wfoCityState': 'SACRAMENTO CA',
|
|
||||||
'wfoCity': 'SACRAMENTO',
|
|
||||||
'state': 'CALIFORNIA',
|
|
||||||
},
|
|
||||||
'TAE': {
|
|
||||||
'region': 'SR',
|
|
||||||
'fullStationID': 'KTAE',
|
|
||||||
'wfoCityState': 'TALLAHASSEE FL',
|
|
||||||
'wfoCity': 'TALLAHASSEE',
|
|
||||||
'state': 'FLORIDA',
|
|
||||||
},
|
|
||||||
'TBW': {
|
|
||||||
'region': 'SR',
|
|
||||||
'fullStationID': 'KTBW',
|
|
||||||
'wfoCityState': 'TAMPA BAY RUSKIN FL',
|
|
||||||
'wfoCity': 'TAMPA BAY RUSKIN',
|
|
||||||
'state': 'FLORIDA',
|
|
||||||
},
|
|
||||||
'TFX': {
|
|
||||||
'region': 'WR',
|
|
||||||
'fullStationID': 'KTFX',
|
|
||||||
'wfoCityState': 'GREAT FALLS MT',
|
|
||||||
'wfoCity': 'GREAT FALLS',
|
|
||||||
'state': 'MONTANA',
|
|
||||||
},
|
|
||||||
'TOP': {
|
|
||||||
'region': 'CR',
|
|
||||||
'fullStationID': 'KTOP',
|
|
||||||
'wfoCityState': 'TOPEKA KS',
|
|
||||||
'wfoCity': 'TOPEKA',
|
|
||||||
'state': 'KANSAS',
|
|
||||||
},
|
|
||||||
'TSA': {
|
|
||||||
'region': 'SR',
|
|
||||||
'fullStationID': 'KTSA',
|
|
||||||
'wfoCityState': 'TULSA OK',
|
|
||||||
'wfoCity': 'TULSA',
|
|
||||||
'state': 'OKLAHOMA',
|
|
||||||
},
|
|
||||||
'TWC': {
|
|
||||||
'region': 'WR',
|
|
||||||
'fullStationID': 'KTWC',
|
|
||||||
'wfoCityState': 'TUCSON AZ',
|
|
||||||
'wfoCity': 'TUCSON',
|
|
||||||
'state': 'ARIZONA',
|
|
||||||
},
|
|
||||||
'UNR': {
|
|
||||||
'region': 'CR',
|
|
||||||
'fullStationID': 'KUNR',
|
|
||||||
'wfoCityState': 'RAPID CITY SD',
|
|
||||||
'wfoCity': 'RAPID CITY',
|
|
||||||
'state': 'SOUTH DAKOTA',
|
|
||||||
},
|
|
||||||
'VEF': {
|
|
||||||
'region': 'WR',
|
|
||||||
'fullStationID': 'KVEF',
|
|
||||||
'wfoCityState': 'LAS VEGAS NV',
|
|
||||||
'wfoCity': 'LAS VEGAS',
|
|
||||||
'state': 'NEVADA',
|
|
||||||
},
|
|
||||||
}
|
|
|
@ -1,90 +0,0 @@
|
||||||
; Logging Configuration
|
|
||||||
|
|
||||||
; To enable file logging and modify the log format see the appropriate sections
|
|
||||||
; below.
|
|
||||||
;
|
|
||||||
; For a more detailed description of this configuration format see the logging
|
|
||||||
; module documentation in the Python Library Reference 14.5.10.2
|
|
||||||
|
|
||||||
; ---- Section Declarations ---------------------------------------------------
|
|
||||||
|
|
||||||
[loggers]
|
|
||||||
keys=root
|
|
||||||
|
|
||||||
[handlers]
|
|
||||||
keys=console,file
|
|
||||||
|
|
||||||
[formatters]
|
|
||||||
keys=console,file
|
|
||||||
|
|
||||||
; ---- Loggers ----------------------------------------------------------------
|
|
||||||
|
|
||||||
[logger_root]
|
|
||||||
level=DEBUG
|
|
||||||
handlers=console,file
|
|
||||||
|
|
||||||
; ---- Handlers ---------------------------------------------------------------
|
|
||||||
|
|
||||||
[handler_console]
|
|
||||||
class=StreamHandler
|
|
||||||
level=INFO
|
|
||||||
formatter=console
|
|
||||||
args=(sys.stdout,)
|
|
||||||
|
|
||||||
[handler_file]
|
|
||||||
class=StreamHandler
|
|
||||||
formatter=console
|
|
||||||
level=CRITICAL
|
|
||||||
args=(sys.stderr,)
|
|
||||||
|
|
||||||
; ---- Enable File Logging ----------------------------------------------------
|
|
||||||
;
|
|
||||||
; Uncomment the following lines to enable file logging. The previous lines can
|
|
||||||
; remain uncommented as the following will simply override the values.
|
|
||||||
;
|
|
||||||
; args replace 'program.log' with desired filename
|
|
||||||
; replace 'w' with 'a' to append to the log file
|
|
||||||
|
|
||||||
;class=FileHandler
|
|
||||||
;level=DEBUG
|
|
||||||
;formatter=file
|
|
||||||
;args=('program.log','a')
|
|
||||||
|
|
||||||
; ---- Formatters -------------------------------------------------------------
|
|
||||||
|
|
||||||
; Configure the format of the console and file log
|
|
||||||
;
|
|
||||||
; %(name)s Name of the logger (logging channel).
|
|
||||||
; %(levelno)s Numeric logging level for the message
|
|
||||||
; (DEBUG, INFO, WARNING, ERROR, CRITICAL).
|
|
||||||
; %(levelname)s Text logging level for the message
|
|
||||||
; ('DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL').
|
|
||||||
; %(pathname)s Full pathname of the source file where the logging call was
|
|
||||||
; issued (if available).
|
|
||||||
; %(filename)s Filename portion of pathname.
|
|
||||||
; %(module)s Module (name portion of filename).
|
|
||||||
; %(funcName)s Name of function containing the logging call.
|
|
||||||
; %(lineno)d Source line number where the logging call was issued
|
|
||||||
; (if available).
|
|
||||||
; %(created)f Time when the LogRecord was created
|
|
||||||
; (as returned by time.time()).
|
|
||||||
; %(relativeCreated)d
|
|
||||||
; Time in milliseconds when the LogRecord was created,
|
|
||||||
; relative to the time the logging module was loaded.
|
|
||||||
; %(asctime)s Human-readable time when the LogRecord was created. By default
|
|
||||||
; this is of the form ``2003-07-08 16:49:45,896'' (the numbers
|
|
||||||
; after the comma are millisecond portion of the time).
|
|
||||||
; %(msecs)d Millisecond portion of the time when the LogRecord was created.
|
|
||||||
; %(thread)d Thread ID (if available).
|
|
||||||
; %(threadName)s
|
|
||||||
; Thread name (if available).
|
|
||||||
; %(process)d Process ID (if available).
|
|
||||||
; %(message)s The logged message, computed as msg % args.
|
|
||||||
|
|
||||||
[formatter_file]
|
|
||||||
format=%(asctime)s - %(name)s - %(levelname)s - %(message)s
|
|
||||||
datefmt=
|
|
||||||
|
|
||||||
[formatter_console]
|
|
||||||
format=%(name)s - %(levelname)s - %(message)s
|
|
||||||
datefmt=
|
|
|
@ -17,6 +17,14 @@
|
||||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||||
# further licensing information.
|
# further licensing information.
|
||||||
##
|
##
|
||||||
|
#
|
||||||
|
# SOFTWARE HISTORY
|
||||||
|
# Date Ticket# Engineer Description
|
||||||
|
# ------------ ---------- ----------- --------------------------
|
||||||
|
# Oct 20, 2014 #3685 randerso Changed to support mixed case
|
||||||
|
#
|
||||||
|
##
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
# File Name: AFD.py
|
# File Name: AFD.py
|
||||||
# Description: This product creates a Area Forecast Discussion product.
|
# Description: This product creates a Area Forecast Discussion product.
|
||||||
|
@ -245,7 +253,7 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis):
|
||||||
],
|
],
|
||||||
|
|
||||||
"popStartZ_AM": 12, #hour UTC
|
"popStartZ_AM": 12, #hour UTC
|
||||||
"WWA_Nil" : "NONE.",
|
"WWA_Nil" : "None.",
|
||||||
|
|
||||||
"hazardSamplingThreshold": (10, None), #(%cov, #points)
|
"hazardSamplingThreshold": (10, None), #(%cov, #points)
|
||||||
}
|
}
|
||||||
|
@ -621,12 +629,13 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis):
|
||||||
|
|
||||||
productName = self.checkTestMode(argDict, self._productName)
|
productName = self.checkTestMode(argDict, self._productName)
|
||||||
|
|
||||||
fcst = fcst + self._pil + "\n\n"
|
s = self._pil + "\n\n" + \
|
||||||
fcst = fcst + productName + "\n"
|
productName + "\n" + \
|
||||||
fcst = fcst + "NATIONAL WEATHER SERVICE "
|
"NATIONAL WEATHER SERVICE " + \
|
||||||
fcst = fcst + self._wfoCityState +"\n"
|
self._wfoCityState +"\n" + \
|
||||||
fcst = fcst + issuedByString
|
issuedByString + \
|
||||||
fcst = fcst + self._timeLabel + "\n\n"
|
self._timeLabel + "\n\n"
|
||||||
|
fcst = fcst + s.upper()
|
||||||
return fcst
|
return fcst
|
||||||
|
|
||||||
####################################################################
|
####################################################################
|
||||||
|
@ -776,7 +785,7 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis):
|
||||||
# If no hazards are found, append the null phrase
|
# If no hazards are found, append the null phrase
|
||||||
|
|
||||||
if len(stateHazardList) == 0:
|
if len(stateHazardList) == 0:
|
||||||
fcst = fcst + "NONE.\n"
|
fcst = fcst + self._WWA_Nil + "\n"
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# If hazards are found, then build the hazard phrases
|
# If hazards are found, then build the hazard phrases
|
||||||
|
@ -822,7 +831,7 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis):
|
||||||
idString = self.makeUGCString(ids)
|
idString = self.makeUGCString(ids)
|
||||||
|
|
||||||
# hazard phrase
|
# hazard phrase
|
||||||
phrase = hazName + ' ' + timing + ' FOR ' + idString + '.'
|
phrase = hazName + ' ' + timing + ' for ' + idString + '.'
|
||||||
|
|
||||||
# Indent if there is a state list associated
|
# Indent if there is a state list associated
|
||||||
if len(self._state_IDs) > 1:
|
if len(self._state_IDs) > 1:
|
||||||
|
|
|
@ -27,6 +27,15 @@
|
||||||
#
|
#
|
||||||
# Author: davis
|
# Author: davis
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
|
##
|
||||||
|
#
|
||||||
|
# SOFTWARE HISTORY
|
||||||
|
# Date Ticket# Engineer Description
|
||||||
|
# ------------ ---------- ----------- --------------------------
|
||||||
|
# Oct 20, 2014 #3685 randerso Changed to support mixed case
|
||||||
|
#
|
||||||
|
##
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
# Example Output:
|
# Example Output:
|
||||||
# Refer to the NWS 10-518 Directive for further information.
|
# Refer to the NWS 10-518 Directive for further information.
|
||||||
|
@ -111,7 +120,6 @@ class TextProduct(CivilEmerg.TextProduct):
|
||||||
return fcst
|
return fcst
|
||||||
|
|
||||||
def _postProcessProduct(self, fcst, argDict):
|
def _postProcessProduct(self, fcst, argDict):
|
||||||
fcst = string.upper(fcst)
|
|
||||||
fcst = self.endline(fcst, linelength=self._lineLength, breakStr=[" ", "...", "-"])
|
fcst = self.endline(fcst, linelength=self._lineLength, breakStr=[" ", "...", "-"])
|
||||||
self.setProgressPercentage(100)
|
self.setProgressPercentage(100)
|
||||||
self.progressMessage(0, 100, self._displayName + " Complete")
|
self.progressMessage(0, 100, self._displayName + " Complete")
|
||||||
|
|
|
@ -27,6 +27,15 @@
|
||||||
#
|
#
|
||||||
# Author: Matt Davis
|
# Author: Matt Davis
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
|
##
|
||||||
|
#
|
||||||
|
# SOFTWARE HISTORY
|
||||||
|
# Date Ticket# Engineer Description
|
||||||
|
# ------------ ---------- ----------- --------------------------
|
||||||
|
# Oct 20, 2014 #3685 randerso Changed to support mixed case
|
||||||
|
#
|
||||||
|
##
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
# Example Output:
|
# Example Output:
|
||||||
# Refer to the NWS 10-922 Directive for further information.
|
# Refer to the NWS 10-922 Directive for further information.
|
||||||
|
@ -119,10 +128,10 @@ class TextProduct(GenericReport.TextProduct):
|
||||||
|
|
||||||
issuedByString = self.getIssuedByString()
|
issuedByString = self.getIssuedByString()
|
||||||
productName = self.checkTestMode(argDict, self._productName)
|
productName = self.checkTestMode(argDict, self._productName)
|
||||||
fcst = fcst + productName + "\n" + \
|
s = productName + "\n" + \
|
||||||
"NATIONAL WEATHER SERVICE " + self._wfoCityState + \
|
"NATIONAL WEATHER SERVICE " + self._wfoCityState + \
|
||||||
"\n" + issuedByString + self._timeLabel + "\n\n"
|
"\n" + issuedByString + self._timeLabel + "\n\n"
|
||||||
fcst = string.upper(fcst)
|
fcst = fcst + s.upper()
|
||||||
return fcst
|
return fcst
|
||||||
|
|
||||||
def _makeProduct(self, fcst, editArea, areaLabel, argDict):
|
def _makeProduct(self, fcst, editArea, areaLabel, argDict):
|
||||||
|
@ -132,8 +141,6 @@ class TextProduct(GenericReport.TextProduct):
|
||||||
return fcst
|
return fcst
|
||||||
|
|
||||||
def _postProcessProduct(self, fcst, argDict):
|
def _postProcessProduct(self, fcst, argDict):
|
||||||
fcst = string.upper(fcst)
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Clean up multiple line feeds
|
# Clean up multiple line feeds
|
||||||
#
|
#
|
||||||
|
|
|
@ -105,6 +105,13 @@
|
||||||
# Example Output:
|
# Example Output:
|
||||||
# Refer to the NWS C11 and 10-503 Directives for Public Weather Services.
|
# Refer to the NWS C11 and 10-503 Directives for Public Weather Services.
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# SOFTWARE HISTORY
|
||||||
|
# Date Ticket# Engineer Description
|
||||||
|
# ------------ ---------- ----------- --------------------------
|
||||||
|
# Oct 20, 2014 #3685 randerso Removed upper case conversions
|
||||||
|
#
|
||||||
|
##
|
||||||
|
|
||||||
import TextRules
|
import TextRules
|
||||||
import SampleAnalysis
|
import SampleAnalysis
|
||||||
|
@ -200,7 +207,6 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis):
|
||||||
fcst = self._postProcessArea(fcst, editArea, areaLabel, argDict)
|
fcst = self._postProcessArea(fcst, editArea, areaLabel, argDict)
|
||||||
fraction = fractionOne
|
fraction = fractionOne
|
||||||
fcst = self._postProcessProduct(fcst, argDict)
|
fcst = self._postProcessProduct(fcst, argDict)
|
||||||
fcst = string.upper(fcst)
|
|
||||||
return fcst
|
return fcst
|
||||||
|
|
||||||
def _getVariables(self, argDict):
|
def _getVariables(self, argDict):
|
||||||
|
@ -252,13 +258,13 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis):
|
||||||
issuedByString = self.getIssuedByString()
|
issuedByString = self.getIssuedByString()
|
||||||
productName = self.checkTestMode(argDict, productName)
|
productName = self.checkTestMode(argDict, productName)
|
||||||
|
|
||||||
fcst = fcst + self._wmoID + " " + self._fullStationID + " " + \
|
s = self._wmoID + " " + self._fullStationID + " " + \
|
||||||
self._ddhhmmTime + "\n" + self._pil + "\n\n" +\
|
self._ddhhmmTime + "\n" + self._pil + "\n\n" +\
|
||||||
productName + "\n" +\
|
productName + "\n" +\
|
||||||
"NATIONAL WEATHER SERVICE " + self._wfoCityState + \
|
"NATIONAL WEATHER SERVICE " + self._wfoCityState + \
|
||||||
"\n" + issuedByString + self._timeLabel + "\n\n"
|
"\n" + issuedByString + self._timeLabel + "\n\n"
|
||||||
|
|
||||||
fcst = string.upper(fcst)
|
fcst = fcst + s.upper()
|
||||||
return fcst
|
return fcst
|
||||||
|
|
||||||
def _preProcessArea(self, fcst, editArea, areaLabel, argDict):
|
def _preProcessArea(self, fcst, editArea, areaLabel, argDict):
|
||||||
|
@ -278,7 +284,6 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis):
|
||||||
return fcst + "\n\n$$\n"
|
return fcst + "\n\n$$\n"
|
||||||
|
|
||||||
def _postProcessProduct(self, fcst, argDict):
|
def _postProcessProduct(self, fcst, argDict):
|
||||||
fcst = string.upper(fcst)
|
|
||||||
self.setProgressPercentage(100)
|
self.setProgressPercentage(100)
|
||||||
self.progressMessage(0, 100, self._displayName + " Complete")
|
self.progressMessage(0, 100, self._displayName + " Complete")
|
||||||
return fcst
|
return fcst
|
||||||
|
|
|
@ -20,8 +20,13 @@
|
||||||
########################################################################
|
########################################################################
|
||||||
# Hazard_AQA.py
|
# Hazard_AQA.py
|
||||||
#
|
#
|
||||||
|
# SOFTWARE HISTORY
|
||||||
|
# Date Ticket# Engineer Description
|
||||||
|
# ------------ ---------- ----------- --------------------------
|
||||||
|
# Oct 20, 2014 #3685 randerso Changed to support mixed case
|
||||||
|
#
|
||||||
##
|
##
|
||||||
##########################################################################
|
|
||||||
import GenericHazards
|
import GenericHazards
|
||||||
import string, time, re, os, types, copy
|
import string, time, re, os, types, copy
|
||||||
import ProcessVariableList
|
import ProcessVariableList
|
||||||
|
@ -157,10 +162,10 @@ class TextProduct(GenericHazards.TextProduct):
|
||||||
|
|
||||||
# Placeholder for Agency Names to be filled in in _postProcessProduct
|
# Placeholder for Agency Names to be filled in in _postProcessProduct
|
||||||
#fcst = fcst + "@AGENCYNAMES" + "\n"
|
#fcst = fcst + "@AGENCYNAMES" + "\n"
|
||||||
fcst = fcst + "RELAYED BY NATIONAL WEATHER SERVICE " + self._wfoCityState + "\n" +\
|
s = "RELAYED BY NATIONAL WEATHER SERVICE " + self._wfoCityState + "\n" +\
|
||||||
issuedByString + self._timeLabel + "\n\n"
|
issuedByString + self._timeLabel + "\n\n"
|
||||||
|
|
||||||
fcst = string.upper(fcst)
|
fcst = fcst + s.upper()
|
||||||
return fcst
|
return fcst
|
||||||
|
|
||||||
def headlinesTiming(self, tree, node, key, timeRange, areaLabel, issuanceTime):
|
def headlinesTiming(self, tree, node, key, timeRange, areaLabel, issuanceTime):
|
||||||
|
@ -301,8 +306,6 @@ class TextProduct(GenericHazards.TextProduct):
|
||||||
|
|
||||||
fixMultiLF = re.compile(r'(\n\n)\n*', re.DOTALL)
|
fixMultiLF = re.compile(r'(\n\n)\n*', re.DOTALL)
|
||||||
fcst = fixMultiLF.sub(r'\1', fcst)
|
fcst = fixMultiLF.sub(r'\1', fcst)
|
||||||
## # Keep body in lower case, if desired
|
|
||||||
## fcst = string.upper(fcst)
|
|
||||||
self.setProgressPercentage(100)
|
self.setProgressPercentage(100)
|
||||||
self.progressMessage(0, 100, self._displayName + " Complete")
|
self.progressMessage(0, 100, self._displayName + " Complete")
|
||||||
return fcst
|
return fcst
|
||||||
|
|
|
@ -22,6 +22,15 @@
|
||||||
#
|
#
|
||||||
##
|
##
|
||||||
##########################################################################
|
##########################################################################
|
||||||
|
##
|
||||||
|
#
|
||||||
|
# SOFTWARE HISTORY
|
||||||
|
# Date Ticket# Engineer Description
|
||||||
|
# ------------ ---------- ----------- --------------------------
|
||||||
|
# Oct 20, 2014 #3685 randerso Changed to support mixed case
|
||||||
|
#
|
||||||
|
##
|
||||||
|
|
||||||
import GenericHazards
|
import GenericHazards
|
||||||
import string, time, re, os, types, copy, sets
|
import string, time, re, os, types, copy, sets
|
||||||
import ModuleAccessor, LogStream
|
import ModuleAccessor, LogStream
|
||||||
|
@ -108,12 +117,12 @@ class TextProduct(GenericHazards.TextProduct):
|
||||||
productName = self.checkTestMode(argDict,
|
productName = self.checkTestMode(argDict,
|
||||||
self._productName + watchPhrase)
|
self._productName + watchPhrase)
|
||||||
|
|
||||||
fcst = fcst + self._wmoID + " " + self._fullStationID + " " + \
|
s = self._wmoID + " " + self._fullStationID + " " + \
|
||||||
self._ddhhmmTime + "\n" + self._pil + "\n\n" +\
|
self._ddhhmmTime + "\n" + self._pil + "\n\n" +\
|
||||||
productName + "\n" +\
|
productName + "\n" +\
|
||||||
"NATIONAL WEATHER SERVICE " + self._wfoCityState + \
|
"NATIONAL WEATHER SERVICE " + self._wfoCityState + \
|
||||||
"\n" + issuedByString + self._timeLabel + "\n" + self._easPhrase + "\n"
|
"\n" + issuedByString + self._timeLabel + "\n" + self._easPhrase + "\n"
|
||||||
fcst = string.upper(fcst)
|
fcst = fcst + s.upper()
|
||||||
return fcst
|
return fcst
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,14 @@
|
||||||
#
|
#
|
||||||
# Author: Matt Davis
|
# Author: Matt Davis
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
|
##
|
||||||
|
#
|
||||||
|
# SOFTWARE HISTORY
|
||||||
|
# Date Ticket# Engineer Description
|
||||||
|
# ------------ ---------- ----------- --------------------------
|
||||||
|
# Oct 20, 2014 #3685 randerso Changed to support mixed case
|
||||||
|
#
|
||||||
|
##
|
||||||
|
|
||||||
|
|
||||||
import GenericReport
|
import GenericReport
|
||||||
|
@ -67,7 +75,7 @@ class TextProduct(GenericReport.TextProduct):
|
||||||
"language": "english",
|
"language": "english",
|
||||||
"lineLength": 66, #Maximum line length
|
"lineLength": 66, #Maximum line length
|
||||||
"includeCities" : 0, # Cities included in area header
|
"includeCities" : 0, # Cities included in area header
|
||||||
"cityDescriptor" : "INCLUDING THE CITIES OF",
|
"cityDescriptor" : "Including the cities of",
|
||||||
"includeZoneNames" : 0, # Zone names will be included in the area header
|
"includeZoneNames" : 0, # Zone names will be included in the area header
|
||||||
"includeIssueTime" : 0, # This should be set to zero
|
"includeIssueTime" : 0, # This should be set to zero
|
||||||
"singleComboOnly" : 1, # Used for non-segmented products
|
"singleComboOnly" : 1, # Used for non-segmented products
|
||||||
|
@ -108,20 +116,18 @@ class TextProduct(GenericReport.TextProduct):
|
||||||
|
|
||||||
issuedByString = self.getIssuedByString()
|
issuedByString = self.getIssuedByString()
|
||||||
productName = self.checkTestMode(argDict, self._productName)
|
productName = self.checkTestMode(argDict, self._productName)
|
||||||
fcst = fcst + productName + "\n" + \
|
s = productName + "\n" + \
|
||||||
"NATIONAL WEATHER SERVICE " + self._wfoCityState + \
|
"NATIONAL WEATHER SERVICE " + self._wfoCityState + \
|
||||||
"\n" + issuedByString + self._timeLabel + "\n\n"
|
"\n" + issuedByString + self._timeLabel + "\n\n"
|
||||||
fcst = string.upper(fcst)
|
fcst = fcst + s.upper()
|
||||||
return fcst
|
return fcst
|
||||||
|
|
||||||
def _makeProduct(self, fcst, editArea, areaLabel, argDict):
|
def _makeProduct(self, fcst, editArea, areaLabel, argDict):
|
||||||
fcst = fcst + "...PUBLIC INFORMATION STATEMENT...\n\n"
|
fcst = fcst + "...PUBLIC INFORMATION STATEMENT...\n\n"
|
||||||
fcst = fcst + "|* INFORMATION GOES HERE *|\n\n"
|
fcst = fcst + "|* Information goes here *|\n\n"
|
||||||
return fcst
|
return fcst
|
||||||
|
|
||||||
def _postProcessProduct(self, fcst, argDict):
|
def _postProcessProduct(self, fcst, argDict):
|
||||||
fcst = string.upper(fcst)
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Clean up multiple line feeds
|
# Clean up multiple line feeds
|
||||||
#
|
#
|
||||||
|
|
|
@ -27,6 +27,15 @@
|
||||||
#
|
#
|
||||||
# Author: Matt Davis
|
# Author: Matt Davis
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
|
##
|
||||||
|
#
|
||||||
|
# SOFTWARE HISTORY
|
||||||
|
# Date Ticket# Engineer Description
|
||||||
|
# ------------ ---------- ----------- --------------------------
|
||||||
|
# Oct 20, 2014 #3685 randerso Changed to support mixed case
|
||||||
|
#
|
||||||
|
##
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
# Example Output:
|
# Example Output:
|
||||||
# Refer to the NWS 10-518 Directive for further information.
|
# Refer to the NWS 10-518 Directive for further information.
|
||||||
|
@ -111,10 +120,10 @@ class TextProduct(GenericReport.TextProduct):
|
||||||
|
|
||||||
issuedByString = self.getIssuedByString()
|
issuedByString = self.getIssuedByString()
|
||||||
productName = self.checkTestMode(argDict, self._productName)
|
productName = self.checkTestMode(argDict, self._productName)
|
||||||
fcst = fcst + productName + "\n" + \
|
s = productName + "\n" + \
|
||||||
"NATIONAL WEATHER SERVICE " + self._wfoCityState + \
|
"NATIONAL WEATHER SERVICE " + self._wfoCityState + \
|
||||||
"\n" + issuedByString + self._timeLabel + "\n\n"
|
"\n" + issuedByString + self._timeLabel + "\n\n"
|
||||||
fcst = string.upper(fcst)
|
fcst = fcst + s.upper()
|
||||||
return fcst
|
return fcst
|
||||||
|
|
||||||
def _makeProduct(self, fcst, editArea, areaLabel, argDict):
|
def _makeProduct(self, fcst, editArea, areaLabel, argDict):
|
||||||
|
@ -123,8 +132,6 @@ class TextProduct(GenericReport.TextProduct):
|
||||||
return fcst
|
return fcst
|
||||||
|
|
||||||
def _postProcessProduct(self, fcst, argDict):
|
def _postProcessProduct(self, fcst, argDict):
|
||||||
fcst = string.upper(fcst)
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Clean up multiple line feeds
|
# Clean up multiple line feeds
|
||||||
#
|
#
|
||||||
|
|
|
@ -0,0 +1,154 @@
|
||||||
|
/**
|
||||||
|
* 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.text.db;
|
||||||
|
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
import com.raytheon.uf.common.localization.FileUpdatedMessage;
|
||||||
|
import com.raytheon.uf.common.localization.ILocalizationFileObserver;
|
||||||
|
import com.raytheon.uf.common.localization.IPathManager;
|
||||||
|
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;
|
||||||
|
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||||
|
import com.raytheon.uf.common.status.UFStatus;
|
||||||
|
import com.raytheon.uf.common.util.FileUtil;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Utilities to support mixed case product generation on a per Product ID (nnn)
|
||||||
|
* basis
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
*
|
||||||
|
* SOFTWARE HISTORY
|
||||||
|
*
|
||||||
|
* Date Ticket# Engineer Description
|
||||||
|
* ------------ ---------- ----------- --------------------------
|
||||||
|
* Oct 1, 2014 #3685 randerso Initial creation
|
||||||
|
*
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* @author randerso
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class MixedCaseProductSupport {
|
||||||
|
private static final IUFStatusHandler statusHandler = UFStatus
|
||||||
|
.getHandler(MixedCaseProductSupport.class);
|
||||||
|
|
||||||
|
private static final String MIXED_CASE_DIR = "mixedCase";
|
||||||
|
|
||||||
|
private static final String MIXED_CASE_PIDS_FILE = FileUtil.join(
|
||||||
|
MIXED_CASE_DIR, "mixedCaseProductIds.txt");
|
||||||
|
|
||||||
|
private static final char COMMENT_DELIMITER = '#';
|
||||||
|
|
||||||
|
private static Set<String> mixedCasePids;
|
||||||
|
|
||||||
|
private static IPathManager pm = PathManagerFactory.getPathManager();
|
||||||
|
|
||||||
|
private static LocalizationFile baseDir;
|
||||||
|
|
||||||
|
public static Set<String> getMixedCasePids() {
|
||||||
|
// setup up the file updated observer
|
||||||
|
synchronized (MixedCaseProductSupport.class) {
|
||||||
|
if (baseDir == null) {
|
||||||
|
baseDir = pm.getLocalizationFile(
|
||||||
|
pm.getContext(LocalizationType.COMMON_STATIC,
|
||||||
|
LocalizationLevel.BASE), MIXED_CASE_DIR);
|
||||||
|
baseDir.addFileUpdatedObserver(new ILocalizationFileObserver() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void fileUpdated(FileUpdatedMessage message) {
|
||||||
|
mixedCasePids = null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
synchronized (MixedCaseProductSupport.class) {
|
||||||
|
if (mixedCasePids == null) {
|
||||||
|
|
||||||
|
// get all localization files in the hierarchy and merge them.
|
||||||
|
Map<LocalizationLevel, LocalizationFile> fileHierarchy = pm
|
||||||
|
.getTieredLocalizationFile(
|
||||||
|
LocalizationType.COMMON_STATIC,
|
||||||
|
MIXED_CASE_PIDS_FILE);
|
||||||
|
|
||||||
|
Set<String> newPids = new HashSet<String>();
|
||||||
|
for (LocalizationFile lf : fileHierarchy.values()) {
|
||||||
|
String filePath = lf.getFile().getAbsolutePath();
|
||||||
|
try (BufferedReader in = new BufferedReader(
|
||||||
|
new InputStreamReader(lf.openInputStream()))) {
|
||||||
|
|
||||||
|
String line;
|
||||||
|
while ((line = in.readLine()) != null) {
|
||||||
|
int pos = line.indexOf(COMMENT_DELIMITER);
|
||||||
|
if (pos >= 0) {
|
||||||
|
line = line.substring(0, pos);
|
||||||
|
}
|
||||||
|
line = line.trim().toUpperCase();
|
||||||
|
String[] pids = line.split("[\\s,]+");
|
||||||
|
for (String pid : pids) {
|
||||||
|
if (pid.length() == 3) {
|
||||||
|
newPids.add(pid);
|
||||||
|
} else if (pid.isEmpty()) {
|
||||||
|
continue;
|
||||||
|
} else {
|
||||||
|
statusHandler.warn("Invalid Product ID \""
|
||||||
|
+ pid + "\" found in " + filePath
|
||||||
|
+ ", ignored.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mixedCasePids = newPids;
|
||||||
|
} catch (IOException e) {
|
||||||
|
statusHandler.error("Error reading " + filePath, e);
|
||||||
|
} catch (LocalizationException e) {
|
||||||
|
statusHandler.error("Error retrieving " + filePath, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mixedCasePids = newPids;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return mixedCasePids;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isMixedCase(String pid) {
|
||||||
|
return getMixedCasePids().contains(pid.toUpperCase());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String conditionalToUpper(String pid, String text) {
|
||||||
|
if (!isMixedCase(pid)) {
|
||||||
|
text = text.toUpperCase();
|
||||||
|
}
|
||||||
|
|
||||||
|
return text;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
# This file contains the product IDs (nnn) that should be sent in mixed case.
|
||||||
|
# Product IDs should be 3 characters long and delimited by commas or white space.
|
||||||
|
# Overrides to the base file will add to the list of mixed case products
|
||||||
|
|
||||||
|
AFD PNS RWS PWO TCD TWD TWO WRK # Phase 1 Products
|
|
@ -95,6 +95,8 @@
|
||||||
<permission id="com.raytheon.localization.site/common_static/archiver/purger/retention"/>
|
<permission id="com.raytheon.localization.site/common_static/archiver/purger/retention"/>
|
||||||
<permission id="com.raytheon.localization.site/common_static/archiver/purger/case"/>
|
<permission id="com.raytheon.localization.site/common_static/archiver/purger/case"/>
|
||||||
|
|
||||||
|
<permission id="com.raytheon.localization.site/common_static/mixedCase"/>
|
||||||
|
|
||||||
<user userId="ALL">
|
<user userId="ALL">
|
||||||
<userPermission>com.raytheon.localization.site/common_static/purge</userPermission>
|
<userPermission>com.raytheon.localization.site/common_static/purge</userPermission>
|
||||||
<userPermission>com.raytheon.localization.site/common_static/colormaps</userPermission>
|
<userPermission>com.raytheon.localization.site/common_static/colormaps</userPermission>
|
||||||
|
|
Loading…
Add table
Reference in a new issue