12.9.1-10 baseline

Former-commit-id: 32048810bc091d7ba09a321c36cd5a78b2d4bd39
This commit is contained in:
Steve Harris 2012-08-30 14:28:27 -05:00
parent b77a4d40d7
commit cb9b80f3a0
80 changed files with 4281 additions and 23390 deletions

View file

@ -73,7 +73,8 @@ import com.raytheon.uf.viz.d2d.core.D2DLoadProperties;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Feb 10, 2009 chammack Initial creation * Feb 10, 2009 chammack Initial creation
* 2012-04-20 DR 14699 D. Friedman Work around race conditions * 2012-04-20 DR 14699 D. Friedman Work around race conditions
* 2012-08-14 DR 15160 D. Friedman Reduce chance of UI blocking
* *
* </pre> * </pre>
* *
@ -94,9 +95,7 @@ public class D2DTimeMatcher extends AbstractTimeMatcher implements
@Override @Override
public void disposed(AbstractVizResource<?, ?> resource) { public void disposed(AbstractVizResource<?, ?> resource) {
if ((resource == timeMatchBasis)) { if ((resource == timeMatchBasis)) {
synchronized (D2DTimeMatcher.this) { internalSetTimeMatchBasis(null);
timeMatchBasis = null;
}
} }
} }
@ -128,6 +127,11 @@ public class D2DTimeMatcher extends AbstractTimeMatcher implements
private boolean needRetry; private boolean needRetry;
private int nRetries; private int nRetries;
// DR 15160 state
private transient boolean pendingTmbChange = false;
private transient boolean inTimeMatch = false;
private transient AbstractVizResource<?, ?> pendingTimeMatchBasis;
/** /**
* Default Constructor. * Default Constructor.
*/ */
@ -158,8 +162,15 @@ public class D2DTimeMatcher extends AbstractTimeMatcher implements
public void redoTimeMatching(IDescriptor descriptor) throws VizException { public void redoTimeMatching(IDescriptor descriptor) throws VizException {
synchronized (this) { synchronized (this) {
if (inTimeMatch) {
needRetry = true;
return;
}
pendingTmbChange = false;
inTimeMatch = true;
needRetry = false; needRetry = false;
}
try {
if (timeMatchBasis != null) { if (timeMatchBasis != null) {
IDescriptor tmDescriptor = timeMatchBasis.getDescriptor(); IDescriptor tmDescriptor = timeMatchBasis.getDescriptor();
if (tmDescriptor != null && tmDescriptor != descriptor) { if (tmDescriptor != null && tmDescriptor != descriptor) {
@ -205,13 +216,27 @@ public class D2DTimeMatcher extends AbstractTimeMatcher implements
} }
} }
if (needRetry) { } finally {
if (nRetries < 200) { boolean scheduleRetry = false;
++nRetries; synchronized (this) {
TimeMatchingJob.scheduleTimeMatch(descriptor); inTimeMatch = false;
} if (pendingTmbChange) {
} else pendingTmbChange = false;
nRetries = 0; changeTimeMatchBasis(pendingTimeMatchBasis);
pendingTimeMatchBasis = null;
scheduleRetry = true;
}
if (needRetry) {
if (nRetries < 200) {
++nRetries;
scheduleRetry = true;
}
} else
nRetries = 0;
}
if (scheduleRetry)
TimeMatchingJob.scheduleTimeMatch(descriptor);
} }
} }
@ -708,9 +733,7 @@ public class D2DTimeMatcher extends AbstractTimeMatcher implements
IDescriptor descriptor) { IDescriptor descriptor) {
if ((resource == timeMatchBasis) if ((resource == timeMatchBasis)
&& (descriptor instanceof AbstractDescriptor)) { && (descriptor instanceof AbstractDescriptor)) {
synchronized (this) { internalSetTimeMatchBasis(null);
timeMatchBasis = null;
}
} }
} }
@ -1004,4 +1027,17 @@ public class D2DTimeMatcher extends AbstractTimeMatcher implements
configFactory.resetMultiload(); configFactory.resetMultiload();
} }
// For DR 15160
protected void internalSetTimeMatchBasis(AbstractVizResource<?, ?> timeMatchBasis) {
synchronized (this) {
if (inTimeMatch) {
pendingTmbChange = true;
pendingTimeMatchBasis = timeMatchBasis;
} else {
pendingTmbChange = false;
pendingTimeMatchBasis = null;
changeTimeMatchBasis(timeMatchBasis);
}
}
}
} }

View file

@ -81,6 +81,8 @@ public abstract class FFMPTable extends Composite {
/** DR14406: For columns with more words */ /** DR14406: For columns with more words */
protected static final int EXTRA_COLUMN_WIDTH = 28; protected static final int EXTRA_COLUMN_WIDTH = 28;
private static final String NAME = "Name";
protected String currentPfaf = null; protected String currentPfaf = null;
@ -392,28 +394,30 @@ public abstract class FFMPTable extends Composite {
ArrayList<FFMPTableColumnXML> ffmpTableCols = ffmpCfgBasin ArrayList<FFMPTableColumnXML> ffmpTableCols = ffmpCfgBasin
.getTableColumnData(); .getTableColumnData();
for (ThreshColNames threshColName : ThreshColNames.values()) { if (!sortedColumnName.equalsIgnoreCase(NAME)) {
if (sortedColumnName.contains(threshColName.name())) { for (ThreshColNames threshColName : ThreshColNames.values()) {
sortedThreshCol = threshColName; if (sortedColumnName.contains(threshColName.name())) {
break; sortedThreshCol = threshColName;
} break;
} }
}
// Check if the sorted column is a column that will contain a filter.
// Check the gui config to see if colorCell is true. If false then do // Check if the sorted column is a column that will contain a filter.
// not apply filter // Check the gui config to see if colorCell is true. If false then do
for (FFMPTableColumnXML xml : ffmpTableCols) { // not apply filter
if (xml.getColumnName().contains(sortedThreshCol.name())) { for (FFMPTableColumnXML xml : ffmpTableCols) {
if (ffmpConfig.isColorCell(sortedThreshCol)) { if (xml.getColumnName().contains(sortedThreshCol.name())) {
// Only filter if colorCell is true if (ffmpConfig.isColorCell(sortedThreshCol)) {
isAFilterCol = true; // Only filter if colorCell is true
filterNum = ffmpConfig.getFilterValue(sortedThreshCol); isAFilterCol = true;
reverseFilter = ffmpConfig.isReverseFilter(sortedThreshCol); filterNum = ffmpConfig.getFilterValue(sortedThreshCol);
reverseFilter = ffmpConfig.isReverseFilter(sortedThreshCol);
}
break;
} }
break;
} }
} }
table.removeAll(); table.removeAll();
if (tableData == null) { if (tableData == null) {
@ -439,25 +443,26 @@ public abstract class FFMPTable extends Composite {
/* /*
* Check if the data value is Not A Number. * Check if the data value is Not A Number.
*/ */
float dataVal = cellData[sortColIndex].getValueAsFloat(); if (!sortedColumnName.equalsIgnoreCase(NAME)) {
// DR 14250 fix: any value not a number will be omitted float dataVal = cellData[sortColIndex].getValueAsFloat();
if (/* sortedThreshCol.name().equalsIgnoreCase("RATIO") && */Float
.isNaN(dataVal)) { // DR 14250 fix: any value not a number will be omitted
continue; if (Float.isNaN(dataVal)) {
} continue;
}
if (isAFilterCol) {
if (reverseFilter) { if (isAFilterCol) {
if (dataVal > filterNum) { if (reverseFilter) {
continue; if (dataVal > filterNum) {
} continue;
} else { }
if (dataVal < filterNum) { } else {
continue; if (dataVal < filterNum) {
continue;
}
} }
} }
} }
indexArray.add(t); indexArray.add(t);
// Check to see if this is the selected row // Check to see if this is the selected row
@ -465,6 +470,7 @@ public abstract class FFMPTable extends Composite {
tableIndex = indexArray.indexOf(t); tableIndex = indexArray.indexOf(t);
} }
} }
/* /*
* VIRTUAL TABLE * VIRTUAL TABLE
* *
@ -608,6 +614,10 @@ public abstract class FFMPTable extends Composite {
* Table column to sort. * Table column to sort.
*/ */
private void sortTableData(TableColumn tc) { private void sortTableData(TableColumn tc) {
if (tableData == null) {
return;
}
String sortCol = (String) tc.getData(); String sortCol = (String) tc.getData();
int sortDir = getColumnAttributeData(sortCol).getSortDir(); int sortDir = getColumnAttributeData(sortCol).getSortDir();

View file

@ -227,7 +227,7 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
private FFMPTableDataLoader dataRetrieveThread = null; private FFMPTableDataLoader dataRetrieveThread = null;
private boolean sweet = true; private boolean groupLabelFlag = true;
public FfmpBasinTableDlg(Shell parent, FFMPTableData tData, public FfmpBasinTableDlg(Shell parent, FFMPTableData tData,
FFMPResource resource) { FFMPResource resource) {
@ -1646,7 +1646,6 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
@Override @Override
public void run() { public void run() {
// Must be a full 11 digit pfaf in order to display the graph. // Must be a full 11 digit pfaf in order to display the graph.
System.out.println(pfaf);
if ((pfaf.length() < 11) && pfaf.matches("\\d+")) { if ((pfaf.length() < 11) && pfaf.matches("\\d+")) {
resetCursor(); resetCursor();
return; return;
@ -1693,7 +1692,7 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
@Override @Override
public void tableSelection(String pfaf, String name) { public void tableSelection(String pfaf, String name) {
if (groupLbl.getText().length() > 0) { if (groupLbl.getText().length() > 0) {
sweet = false; groupLabelFlag = false;
} }
if ((groupLbl.getText().length() == 0) if ((groupLbl.getText().length() == 0)
@ -2011,7 +2010,6 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
// System.out.println("Status message..."); // System.out.println("Status message...");
if (gd.exclude == true) { if (gd.exclude == true) {
System.out.println("Showing data load comp");
((GridData) dataLoadComp.getLayoutData()).exclude = false; ((GridData) dataLoadComp.getLayoutData()).exclude = false;
dataLoadComp.setVisible(true); dataLoadComp.setVisible(true);
shell.pack(); shell.pack();
@ -2127,13 +2125,13 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
dataRetrieveThread = getLoader(); dataRetrieveThread = getLoader();
dataRetrieveThread.start(); dataRetrieveThread.start();
return; return;
} else {
} }
if (fupdateData.getTableData() != null && sweet) { if (fupdateData.getTableData() != null && groupLabelFlag) {
resetData(fupdateData.getTableData()); resetData(fupdateData.getTableData());
} }
groupLabelFlag = true;
if (fupdateData.isFireGraph()) { if (fupdateData.isFireGraph()) {
fireGraphDataEvent(fupdateData.getGraphPfaf(), false, fireGraphDataEvent(fupdateData.getGraphPfaf(), false,
fupdateData.getGraphTime()); fupdateData.getGraphTime());
@ -2143,7 +2141,7 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
updateGapValueLabel(fupdateData.getGapValueLabel()); updateGapValueLabel(fupdateData.getGapValueLabel());
resetCursor(); resetCursor();
sweet = true;
} }
/** /**

View file

@ -73,9 +73,24 @@ import com.raytheon.uf.viz.monitor.ffmp.ui.dialogs.FfmpTableConfigData;
public class FFMPDataGenerator { public class FFMPDataGenerator {
private FfmpTableConfig tableConfig; private FfmpTableConfig tableConfig;
private static final transient IUFStatusHandler statusHandler = UFStatus private static final IUFStatusHandler statusHandler = UFStatus
.getHandler(FFMPDataGenerator.class); .getHandler(FFMPDataGenerator.class);
private final String ALL = "ALL";
private final String NA = "NA";
private String siteKey;
private String dataKey;
private ProductXML product;
private Date paintRefTime;
private Date tableTime;
private Object centeredAggregationKey;
private String huc;
private ArrayList<DomainXML> domains;
private double sliderTime;
private boolean isWorstCase = false;
FFMPConfig ffmpCfg = FFMPConfig.getInstance(); FFMPConfig ffmpCfg = FFMPConfig.getInstance();
FFMPTemplates ft = null; FFMPTemplates ft = null;
@ -125,16 +140,27 @@ public class FFMPDataGenerator {
private FfmpTableConfigData ffmpTableCfgData = null; private FfmpTableConfigData ffmpTableCfgData = null;
public FFMPDataGenerator(FFMPMonitor monitor, FFMPResource resource) { public FFMPDataGenerator(FFMPMonitor monitor, FFMPResource resource) {
this.tableConfig = FfmpTableConfig.getInstance(); siteKey = resource.getSiteKey();
dataKey = resource.getDataKey();
product = resource.getProduct();
paintRefTime = resource.getPaintTime().getRefTime();
tableTime = resource.getTableTime();
centeredAggregationKey = resource.centeredAggregationKey;
huc = resource.getHuc();
domains = resource.getDomains();
sliderTime = resource.getTime();
isWorstCase = resource.isWorstCase();
this.tableConfig = FfmpTableConfig.getInstance();
this.resource = resource; this.resource = resource;
this.monitor = monitor; this.monitor = monitor;
this.ft = monitor.getTemplates(resource.getSiteKey()); this.ft = monitor.getTemplates(siteKey);
this.primarySource = resource.getResourceData().getPrimarySourceXML(); this.primarySource = resource.getResourceData().getPrimarySourceXML();
this.isRate = primarySource.isRate(); this.isRate = primarySource.isRate();
this.expirationTime = primarySource.getExpirationMinutes(resource this.expirationTime = primarySource.getExpirationMinutes(resource
.getSiteKey()) * 60 * 1000; .getSiteKey()) * 60 * 1000;
ffmpTableCfgData = tableConfig ffmpTableCfgData = tableConfig
.getTableConfigData(resource.getSiteKey()); .getTableConfigData(siteKey);
} }
public FFMPTableData generateFFMPData() throws Exception { public FFMPTableData generateFFMPData() throws Exception {
@ -149,24 +175,23 @@ public class FFMPDataGenerator {
if (field != null) { if (field != null) {
if (baseRec != null) { if (baseRec != null) {
FFMPBasinData fbd = null; FFMPBasinData fbd = null;
if (resource.centeredAggregationKey != null) { if (centeredAggregationKey != null) {
fbd = baseRec.getBasinData("ALL"); fbd = baseRec.getBasinData(ALL);
} else { } else {
fbd = baseRec.getBasinData(resource.getHuc()); fbd = baseRec.getBasinData(huc);
} }
if (fbd.getBasins().size() > 0) { if (fbd.getBasins().size() > 0) {
if ((resource.centeredAggregationKey == null) if ((centeredAggregationKey == null)
|| resource.getHuc().equals("ALL")) { || huc.equals(ALL)) {
// System.out.println(fbd.getBasins().keySet().size() // System.out.println(fbd.getBasins().keySet().size()
// + " rows in the table"); // + " rows in the table");
for (Long key : fbd.getBasins().keySet()) { for (Long key : fbd.getBasins().keySet()) {
if (resource.getHuc().equals("ALL")) { if (huc.equals(ALL)) {
for (DomainXML domain : resource for (DomainXML domain : domains) {
.getDomains()) {
FFMPBasinMetaData fmdb = ft.getBasin( FFMPBasinMetaData fmdb = ft.getBasin(
resource.getSiteKey(), key); siteKey, key);
if (fmdb == null) { if (fmdb == null) {
continue; continue;
@ -183,7 +208,7 @@ public class FFMPDataGenerator {
if (virtualBasin != null) { if (virtualBasin != null) {
for (Long id : ft for (Long id : ft
.getVirtualGageBasinLookupIds( .getVirtualGageBasinLookupIds(
resource.getSiteKey(), siteKey,
key)) { key)) {
setFFMPRow( setFFMPRow(
virtualBasin virtualBasin
@ -203,13 +228,13 @@ public class FFMPDataGenerator {
ArrayList<Long> pfafs = ft ArrayList<Long> pfafs = ft
.getAggregatePfafs(key, .getAggregatePfafs(key,
resource.getSiteKey(), siteKey,
resource.getHuc()); huc);
boolean isVGB = false; boolean isVGB = false;
if (ft.checkVGBsInAggregate(key, if (ft.checkVGBsInAggregate(key,
resource.getSiteKey(), siteKey,
resource.getHuc())) { huc)) {
isVGB = true; isVGB = true;
} }
@ -217,8 +242,8 @@ public class FFMPDataGenerator {
FFMPBasinMetaData fmdb = ft FFMPBasinMetaData fmdb = ft
.getBasinInDomains( .getBasinInDomains(
resource.getSiteKey(), siteKey,
resource.getDomains(), domains,
pfafs); pfafs);
if (fmdb != null) { if (fmdb != null) {
@ -239,11 +264,10 @@ public class FFMPDataGenerator {
.getCenteredAggregatePfafs()) { .getCenteredAggregatePfafs()) {
FFMPBasinMetaData fmdb = ft.getBasin( FFMPBasinMetaData fmdb = ft.getBasin(
resource.getSiteKey(), key); siteKey, key);
if (fmdb != null) { if (fmdb != null) {
for (DomainXML domain : resource for (DomainXML domain : domains) {
.getDomains()) {
if ((domain.getCwa().equals(fmdb if ((domain.getCwa().equals(fmdb
.getCwa())) .getCwa()))
@ -256,7 +280,7 @@ public class FFMPDataGenerator {
if (virtualBasin != null) { if (virtualBasin != null) {
for (Long id : ft for (Long id : ft
.getVirtualGageBasinLookupIds( .getVirtualGageBasinLookupIds(
resource.getSiteKey(), siteKey,
key)) { key)) {
setFFMPRow( setFFMPRow(
virtualBasin virtualBasin
@ -325,17 +349,17 @@ public class FFMPDataGenerator {
// in this special case it is actually the LID // in this special case it is actually the LID
trd.setPfaf(((FFMPVirtualGageBasin) cBasin).getLid()); trd.setPfaf(((FFMPVirtualGageBasin) cBasin).getLid());
FFMPVirtualGageBasinMetaData fvgmbd = ft FFMPVirtualGageBasinMetaData fvgmbd = ft
.getVirtualGageBasinMetaData(resource.getSiteKey(), .getVirtualGageBasinMetaData(siteKey,
((FFMPVirtualGageBasin) cBasin).getLid()); ((FFMPVirtualGageBasin) cBasin).getLid());
FFMPBasinMetaData metabasin = ft.getBasin( FFMPBasinMetaData metabasin = ft.getBasin(
resource.getSiteKey(), fvgmbd.getParentPfaf()); siteKey, fvgmbd.getParentPfaf());
Long parentBasinPfaf = fvgmbd.getParentPfaf(); Long parentBasinPfaf = fvgmbd.getParentPfaf();
if (fvgmbd != null) { if (fvgmbd != null) {
mouseOverText = metabasin.getBasinId() + "\n" mouseOverText = metabasin.getBasinId() + "\n"
+ fvgmbd.getLid() + "-" + fvgmbd.getName(); + fvgmbd.getLid() + "-" + fvgmbd.getName();
if (!resource.getHuc().equals("ALL")) { if (!huc.equals(ALL)) {
displayName += "-" + fvgmbd.getName(); displayName += "-" + fvgmbd.getName();
} }
} }
@ -343,12 +367,12 @@ public class FFMPDataGenerator {
trd.setTableCellData(0, new FFMPTableCellData(rowField, trd.setTableCellData(0, new FFMPTableCellData(rowField,
displayName, mouseOverText)); displayName, mouseOverText));
if (!resource.isWorstCase() || resource.getHuc().equals("ALL") if (!isWorstCase || huc.equals(ALL)
|| (resource.centeredAggregationKey != null)) { || (centeredAggregationKey != null)) {
if (cBasin.getValues().size() > 0) { if (cBasin.getValues().size() > 0) {
rate = ((FFMPVirtualGageBasin) cBasin) rate = ((FFMPVirtualGageBasin) cBasin)
.getValue(resource.getPaintTime().getRefTime()); .getValue(paintRefTime);
trd.setTableCellData(1, new FFMPTableCellData( trd.setTableCellData(1, new FFMPTableCellData(
FIELDS.RATE, rate)); FIELDS.RATE, rate));
} else { } else {
@ -357,7 +381,7 @@ public class FFMPDataGenerator {
} }
if (cBasin.getValues().size() > 0) { if (cBasin.getValues().size() > 0) {
if (resource.getTime() > 0.00) { if (sliderTime > 0.00) {
qpe = cBasin.getAccumValue(monitor.getQpeWindow() qpe = cBasin.getAccumValue(monitor.getQpeWindow()
.getAfterTime(), monitor.getQpeWindow() .getAfterTime(), monitor.getQpeWindow()
.getBeforeTime(), expirationTime, isRate); .getBeforeTime(), expirationTime, isRate);
@ -394,7 +418,7 @@ public class FFMPDataGenerator {
boolean forced = false; boolean forced = false;
FFFGForceUtil forceUtil = forceUtils.get(guidType); FFFGForceUtil forceUtil = forceUtils.get(guidType);
FFMPBasinData guidBasin = guidBasins.get(guidType); FFMPBasinData guidBasin = guidBasins.get(guidType);
forceUtil.setSliderTime(resource.getTime()); forceUtil.setSliderTime(sliderTime);
if ((guidBasin != null) if ((guidBasin != null)
&& ((FFMPGuidanceBasin) guidBasin && ((FFMPGuidanceBasin) guidBasin
@ -407,26 +431,26 @@ public class FFMPDataGenerator {
if (domain == null) { if (domain == null) {
pfafList = ft.getAggregatePfafs( pfafList = ft.getAggregatePfafs(
cBasin.getPfaf(), cBasin.getPfaf(),
resource.getSiteKey(), siteKey,
resource.getHuc()); huc);
} else if (!domain.equals("NA")) { } else if (!domain.equals(NA)) {
if (!resource.getHuc().equals("ALL")) { if (!huc.equals(ALL)) {
pfafList = ft pfafList = ft
.getAggregatePfafsByDomain( .getAggregatePfafsByDomain(
parentBasinPfaf, parentBasinPfaf,
resource.getSiteKey(), siteKey,
domain, domain,
resource.getHuc()); huc);
} }
} else { } else {
pfafList = ft.getAggregatePfafsByDomain( pfafList = ft.getAggregatePfafsByDomain(
parentBasinPfaf, parentBasinPfaf,
resource.getSiteKey(), domain, siteKey, domain,
resource.getHuc()); huc);
pfafList.add(ft.getAggregatedPfaf( pfafList.add(ft.getAggregatedPfaf(
cBasin.getPfaf(), cBasin.getPfaf(),
resource.getSiteKey(), siteKey,
resource.getHuc())); huc));
} }
} }
@ -434,7 +458,7 @@ public class FFMPDataGenerator {
if (fdm.isForcingConfigured()) { if (fdm.isForcingConfigured()) {
FFMPBasin parentBasin = baseRec.getBasinData( FFMPBasin parentBasin = baseRec.getBasinData(
"ALL").get(parentBasinPfaf); ALL).get(parentBasinPfaf);
forceUtil.calculateForcings(domain, ft, forceUtil.calculateForcings(domain, ft,
parentBasin); parentBasin);
forcedPfafs = forceUtil.getForcedPfafList(); forcedPfafs = forceUtil.getForcedPfafList();
@ -446,7 +470,7 @@ public class FFMPDataGenerator {
// value(s) // value(s)
guidance = guidRecords guidance = guidRecords
.get(guidType) .get(guidType)
.getBasinData("ALL") .getBasinData(ALL)
.getAverageGuidanceValue( .getAverageGuidanceValue(
pfafList, pfafList,
resource.getGuidanceInterpolators() resource.getGuidanceInterpolators()
@ -457,7 +481,7 @@ public class FFMPDataGenerator {
} else if (forcedPfafs.size() > 1) { } else if (forcedPfafs.size() > 1) {
guidance = guidRecords guidance = guidRecords
.get(guidType) .get(guidType)
.getBasinData("ALL") .getBasinData(ALL)
.getAverageGuidanceValue( .getAverageGuidanceValue(
pfafList, pfafList,
resource.getGuidanceInterpolators() resource.getGuidanceInterpolators()
@ -469,7 +493,7 @@ public class FFMPDataGenerator {
} else if (pfafList.size() > 1) { } else if (pfafList.size() > 1) {
guidance = guidRecords guidance = guidRecords
.get(guidType) .get(guidType)
.getBasinData("ALL") .getBasinData(ALL)
.getAverageGuidanceValue( .getAverageGuidanceValue(
pfafList, pfafList,
resource.getGuidanceInterpolators() resource.getGuidanceInterpolators()
@ -479,8 +503,7 @@ public class FFMPDataGenerator {
resource.getGuidSourceExpiration()); resource.getGuidSourceExpiration());
} else { } else {
guidance = resource.getGuidanceValue( guidance = resource.getGuidanceValue(
ffmpGuidBasin, resource.getPaintTime() ffmpGuidBasin, paintRefTime, guidType);
.getRefTime(), guidType);
if (guidance < 0.0f) { if (guidance < 0.0f) {
guidance = Float.NaN; guidance = Float.NaN;
@ -530,11 +553,11 @@ public class FFMPDataGenerator {
displayName, cBasin.getPfaf().toString() + "\n" displayName, cBasin.getPfaf().toString() + "\n"
+ displayName)); + displayName));
if (!resource.isWorstCase() || resource.getHuc().equals("ALL") if (!isWorstCase || huc.equals(ALL)
|| (resource.centeredAggregationKey != null)) { || (centeredAggregationKey != null)) {
if ((rateBasin != null) if ((rateBasin != null)
&& (rateBasin.get(cBasin.getPfaf()) != null)) { && (rateBasin.get(cBasin.getPfaf()) != null)) {
rate = rateBasin.get(cBasin.getPfaf()).getValue(resource.getPaintTime().getRefTime()); rate = rateBasin.get(cBasin.getPfaf()).getValue(paintRefTime);
trd.setTableCellData(1, new FFMPTableCellData( trd.setTableCellData(1, new FFMPTableCellData(
FIELDS.RATE, rate)); FIELDS.RATE, rate));
// System.out.println("rate: "+rate); // System.out.println("rate: "+rate);
@ -579,7 +602,7 @@ public class FFMPDataGenerator {
boolean forced = false; boolean forced = false;
FFFGForceUtil forceUtil = forceUtils.get(guidType); FFFGForceUtil forceUtil = forceUtils.get(guidType);
FFMPBasinData guidBasin = guidBasins.get(guidType); FFMPBasinData guidBasin = guidBasins.get(guidType);
forceUtil.setSliderTime(resource.getTime()); forceUtil.setSliderTime(sliderTime);
if ((guidBasin != null) if ((guidBasin != null)
&& ((FFMPGuidanceBasin) guidBasin.get(cBasin && ((FFMPGuidanceBasin) guidBasin.get(cBasin
@ -592,26 +615,26 @@ public class FFMPDataGenerator {
if (domain == null) { if (domain == null) {
pfafList = ft.getAggregatePfafs( pfafList = ft.getAggregatePfafs(
cBasin.getPfaf(), cBasin.getPfaf(),
resource.getSiteKey(), siteKey,
resource.getHuc()); huc);
} else if (!domain.equals("NA")) { } else if (!domain.equals(NA)) {
if (!resource.getHuc().equals("ALL")) { if (!huc.equals(ALL)) {
pfafList = ft pfafList = ft
.getAggregatePfafsByDomain( .getAggregatePfafsByDomain(
cBasin.getPfaf(), cBasin.getPfaf(),
resource.getSiteKey(), siteKey,
domain, domain,
resource.getHuc()); huc);
} }
} else { } else {
pfafList = ft.getAggregatePfafsByDomain( pfafList = ft.getAggregatePfafsByDomain(
cBasin.getPfaf(), cBasin.getPfaf(),
resource.getSiteKey(), domain, siteKey, domain,
resource.getHuc()); huc);
pfafList.add(ft.getAggregatedPfaf( pfafList.add(ft.getAggregatedPfaf(
cBasin.getPfaf(), cBasin.getPfaf(),
resource.getSiteKey(), siteKey,
resource.getHuc())); huc));
} }
} }
@ -628,7 +651,7 @@ public class FFMPDataGenerator {
// value(s) // value(s)
guidance = guidRecords guidance = guidRecords
.get(guidType) .get(guidType)
.getBasinData("ALL") .getBasinData(ALL)
.getAverageGuidanceValue( .getAverageGuidanceValue(
pfafList, pfafList,
resource.getGuidanceInterpolators() resource.getGuidanceInterpolators()
@ -639,7 +662,7 @@ public class FFMPDataGenerator {
} else if (forcedPfafs.size() > 1) { } else if (forcedPfafs.size() > 1) {
guidance = guidRecords guidance = guidRecords
.get(guidType) .get(guidType)
.getBasinData("ALL") .getBasinData(ALL)
.getAverageGuidanceValue( .getAverageGuidanceValue(
pfafList, pfafList,
resource.getGuidanceInterpolators() resource.getGuidanceInterpolators()
@ -651,7 +674,7 @@ public class FFMPDataGenerator {
} else if (pfafList.size() > 1) { } else if (pfafList.size() > 1) {
guidance = guidRecords guidance = guidRecords
.get(guidType) .get(guidType)
.getBasinData("ALL") .getBasinData(ALL)
.getAverageGuidanceValue( .getAverageGuidanceValue(
pfafList, pfafList,
resource.getGuidanceInterpolators() resource.getGuidanceInterpolators()
@ -739,22 +762,22 @@ public class FFMPDataGenerator {
if (cBasin.getAggregated()) { if (cBasin.getAggregated()) {
if (domain == null) { if (domain == null) {
pfafList = ft.getAggregatePfafs(cBasin.getPfaf(), pfafList = ft.getAggregatePfafs(cBasin.getPfaf(),
resource.getSiteKey(), resource.getHuc()); siteKey, huc);
} else if (!domain.equals("NA")) { } else if (!domain.equals(NA)) {
if (!resource.getHuc().equals("ALL")) { if (!huc.equals(ALL)) {
pfafList = ft.getAggregatePfafsByDomain(cBasin.getPfaf(), pfafList = ft.getAggregatePfafsByDomain(cBasin.getPfaf(),
resource.getSiteKey(), domain, resource.getHuc()); siteKey, domain, huc);
} }
} else { } else {
pfafList = ft.getAggregatePfafsByDomain(cBasin.getPfaf(), pfafList = ft.getAggregatePfafsByDomain(cBasin.getPfaf(),
resource.getSiteKey(), domain, resource.getHuc()); siteKey, domain, huc);
pfafList.add(ft.getAggregatedPfaf(cBasin.getPfaf(), pfafList.add(ft.getAggregatedPfaf(cBasin.getPfaf(),
resource.getSiteKey(), resource.getHuc())); siteKey, huc));
} }
} }
if (!resource.isWorstCase() || resource.getHuc().equals("ALL") if (!isWorstCase || huc.equals(ALL)
|| (resource.centeredAggregationKey != null)) { || (centeredAggregationKey != null)) {
if (((forcedPfafs.size() > 1)) || forced) { if (((forcedPfafs.size() > 1)) || forced) {
// Calculate an average // Calculate an average
guidance = forceUtil.getAvgForcedValue(pfafList, forcedPfafs, guidance = forceUtil.getAvgForcedValue(pfafList, forcedPfafs,
@ -785,25 +808,25 @@ public class FFMPDataGenerator {
String name = null; String name = null;
try { try {
if (resource.getHuc().equals("ALL") if (huc.equals(ALL)
|| (resource.centeredAggregationKey != null)) { || (centeredAggregationKey != null)) {
name = ft.getBasin(resource.getSiteKey(), basin.getPfaf()) name = ft.getBasin(siteKey, basin.getPfaf())
.getStreamName(); .getStreamName();
} }
// aggregations // aggregations
else { else {
ArrayList<Long> pfafs = ft.getAggregatePfafs(basin.getPfaf(), ArrayList<Long> pfafs = ft.getAggregatePfafs(basin.getPfaf(),
resource.getSiteKey(), resource.getHuc()); siteKey, huc);
if (pfafs.size() > 0) { if (pfafs.size() > 0) {
if (resource.getHuc().equals("COUNTY")) { if (huc.equals("COUNTY")) {
name = ft.getCountyStateName(resource.getSiteKey(), name = ft.getCountyStateName(siteKey,
basin.getPfaf()); basin.getPfaf());
} else { } else {
for (int i = 0; i < pfafs.size(); i++) { for (int i = 0; i < pfafs.size(); i++) {
if (ft.getBasin(resource.getSiteKey(), pfafs.get(0)) if (ft.getBasin(siteKey, pfafs.get(0))
.getHucName() != null) { .getHucName() != null) {
name = ft.getBasin(resource.getSiteKey(), name = ft.getBasin(siteKey,
pfafs.get(0)).getHucName(); pfafs.get(0)).getHucName();
break; break;
} }
@ -832,7 +855,7 @@ public class FFMPDataGenerator {
} }
ArrayList<Long> pfafs = ft.getAggregatePfafs(cBasin.getPfaf(), ArrayList<Long> pfafs = ft.getAggregatePfafs(cBasin.getPfaf(),
resource.getSiteKey(), resource.getHuc(), activeDomains); siteKey, huc, activeDomains);
trd.setPfaf(cBasin.getPfaf().toString()); trd.setPfaf(cBasin.getPfaf().toString());
Float qpe = Float.NaN; Float qpe = Float.NaN;
Float guidance = Float.NaN; Float guidance = Float.NaN;
@ -846,13 +869,13 @@ public class FFMPDataGenerator {
1, 1,
new FFMPTableCellData(FIELDS.RATE, virtualBasin new FFMPTableCellData(FIELDS.RATE, virtualBasin
.get(cBasin.getPfaf()).getValue( .get(cBasin.getPfaf()).getValue(
resource.getPaintTime().getRefTime()))); paintRefTime)));
} else { } else {
trd.setTableCellData(1, new FFMPTableCellData(FIELDS.RATE, trd.setTableCellData(1, new FFMPTableCellData(FIELDS.RATE,
Float.NaN)); Float.NaN));
} }
if (virtualBasin != null) { if (virtualBasin != null) {
if (resource.getTime() > 0.00) { if (sliderTime > 0.00) {
qpe = virtualBasin.get(cBasin.getPfaf()).getAccumValue( qpe = virtualBasin.get(cBasin.getPfaf()).getAccumValue(
monitor.getQpeWindow().getAfterTime(), monitor.getQpeWindow().getAfterTime(),
monitor.getQpeWindow().getBeforeTime(), monitor.getQpeWindow().getBeforeTime(),
@ -887,7 +910,7 @@ public class FFMPDataGenerator {
int i = 0; int i = 0;
for (String guidType : guidBasins.keySet()) { for (String guidType : guidBasins.keySet()) {
FFFGForceUtil forceUtil = forceUtils.get(guidType); FFFGForceUtil forceUtil = forceUtils.get(guidType);
forceUtil.setSliderTime(resource.getTime()); forceUtil.setSliderTime(sliderTime);
FFMPBasinData guidBasin = guidBasins.get(guidType); FFMPBasinData guidBasin = guidBasins.get(guidType);
@ -941,7 +964,7 @@ public class FFMPDataGenerator {
} else { } else {
if (pfafs.size() > 0) { if (pfafs.size() > 0) {
if (rateBasin != null) { if (rateBasin != null) {
rate = rateBasin.getMaxValue(pfafs, resource.getPaintTime().getRefTime()); rate = rateBasin.getMaxValue(pfafs, paintRefTime);
trd.setTableCellData(1, new FFMPTableCellData(FIELDS.RATE, trd.setTableCellData(1, new FFMPTableCellData(FIELDS.RATE,
rate)); rate));
} else { } else {
@ -977,7 +1000,7 @@ public class FFMPDataGenerator {
int i = 0; int i = 0;
for (String guidType : guidBasins.keySet()) { for (String guidType : guidBasins.keySet()) {
FFFGForceUtil forceUtil = forceUtils.get(guidType); FFFGForceUtil forceUtil = forceUtils.get(guidType);
forceUtil.setSliderTime(resource.getTime()); forceUtil.setSliderTime(sliderTime);
FFMPBasinData guidBasin = guidBasins.get(guidType); FFMPBasinData guidBasin = guidBasins.get(guidType);
@ -986,9 +1009,9 @@ public class FFMPDataGenerator {
&& (guidBasin.getBasins().size() > 0)) { && (guidBasin.getBasins().size() > 0)) {
if (cBasin.getAggregated()) { if (cBasin.getAggregated()) {
pfafList = ft.getAggregatePfafs(cBasin.getPfaf(), pfafList = ft.getAggregatePfafs(cBasin.getPfaf(),
resource.getSiteKey(), resource.getHuc()); siteKey, huc);
pfafList.add(ft.getAggregatedPfaf(cBasin.getPfaf(), pfafList.add(ft.getAggregatedPfaf(cBasin.getPfaf(),
resource.getSiteKey(), resource.getHuc())); siteKey, huc));
} }
boolean forced = false; boolean forced = false;
@ -1008,10 +1031,10 @@ public class FFMPDataGenerator {
} }
} }
if (resource.isWorstCase()) { if (isWorstCase) {
guidance = guidRecords guidance = guidRecords
.get(guidType) .get(guidType)
.getBasinData("ALL") .getBasinData(ALL)
.getMaxGuidanceValue( .getMaxGuidanceValue(
pfafs, pfafs,
resource.getGuidanceInterpolators() resource.getGuidanceInterpolators()
@ -1021,7 +1044,7 @@ public class FFMPDataGenerator {
} else { } else {
FFMPGuidanceBasin basin = (FFMPGuidanceBasin) guidRecords FFMPGuidanceBasin basin = (FFMPGuidanceBasin) guidRecords
.get(guidType) .get(guidType)
.getBasinData(resource.getHuc()) .getBasinData(huc)
.get(cBasin.getPfaf()); .get(cBasin.getPfaf());
guidance = resource.getGuidanceValue(basin, monitor guidance = resource.getGuidanceValue(basin, monitor
.getQpeWindow().getBeforeTime(), guidType); .getQpeWindow().getBeforeTime(), guidType);
@ -1081,7 +1104,7 @@ public class FFMPDataGenerator {
trd.setTableCellData( trd.setTableCellData(
1, 1,
new FFMPTableCellData(FIELDS.RATE, rateBasin.get( new FFMPTableCellData(FIELDS.RATE, rateBasin.get(
cBasin.getPfaf()).getValue(resource.getPaintTime().getRefTime()))); cBasin.getPfaf()).getValue(paintRefTime)));
} else { } else {
trd.setTableCellData(1, new FFMPTableCellData(FIELDS.RATE, trd.setTableCellData(1, new FFMPTableCellData(FIELDS.RATE,
Float.NaN)); Float.NaN));
@ -1118,7 +1141,7 @@ public class FFMPDataGenerator {
int i = 0; int i = 0;
for (String guidType : guidBasins.keySet()) { for (String guidType : guidBasins.keySet()) {
FFFGForceUtil forceUtil = forceUtils.get(guidType); FFFGForceUtil forceUtil = forceUtils.get(guidType);
forceUtil.setSliderTime(resource.getTime()); forceUtil.setSliderTime(sliderTime);
FFMPBasinData guidBasin = guidBasins.get(guidType); FFMPBasinData guidBasin = guidBasins.get(guidType);
@ -1185,84 +1208,78 @@ public class FFMPDataGenerator {
* @throws VizException * @throws VizException
*/ */
private FIELDS getBaseField() { private FIELDS getBaseField() {
FIELDS field = null; System.out.println("Paint/Table Time: " + paintRefTime + "/" + tableTime);
String huc = null;
FIELDS field = null;
String localHuc = null;
dman = FFFGDataMgr.getInstance(); dman = FFFGDataMgr.getInstance();
FfmpTableConfigData ffmpTableCfgData = FfmpTableConfig.getInstance() FfmpTableConfigData ffmpTableCfgData = FfmpTableConfig.getInstance()
.getTableConfigData(resource.getSiteKey()); .getTableConfigData(siteKey);
String qpfType = ffmpTableCfgData.getQpfType(); String qpfType = ffmpTableCfgData.getQpfType();
ProductRunXML productRun = FFMPRunConfigurationManager.getInstance() ProductRunXML productRun = FFMPRunConfigurationManager.getInstance()
.getProduct(resource.getSiteKey()); .getProduct(siteKey);
String qpfSource = productRun String qpfSource = productRun
.getQpfSources(resource.getProduct(), qpfType).get(0) .getQpfSources(product, qpfType).get(0)
.getSourceName(); .getSourceName();
FFMPConfig config = FFMPConfig.getInstance(); FFMPConfig config = FFMPConfig.getInstance();
String includedCWAs = config.getFFMPConfigData().getIncludedCWAs(); String includedCWAs = config.getFFMPConfigData().getIncludedCWAs();
cwaArr = includedCWAs.split(","); cwaArr = includedCWAs.split(",");
monitor.setQpfWindow(monitor.getTimeWindow(qpfSource, resource monitor.setQpfWindow(monitor.getTimeWindow(qpfSource, paintRefTime, siteKey));
.getPaintTime().getRefTime(), resource.getSiteKey())); Date qpeTime = paintRefTime;
Date qpeTime = resource.getPaintTime().getRefTime();
if (resource.isSplit()) { if (resource.isSplit()) {
// hack off the QPF duration for the table values of QPE (Split // hack off the QPF duration for the table values of QPE (Split
// Window) // Window)
double duration = FFMPSourceConfigurationManager.getInstance() double duration = FFMPSourceConfigurationManager.getInstance()
.getSource(qpfSource).getDurationHour(); .getSource(qpfSource).getDurationHour();
qpeTime = new Date((long) (resource.getPaintTime().getRefTime() qpeTime = new Date((long) (qpeTime.getTime() - (duration * 3600 * 1000)));
.getTime() - (duration * 3600 * 1000)));
} }
monitor.setQpeWindow(new FFMPTimeWindow(resource.getTableTime(), monitor.setQpeWindow(new FFMPTimeWindow(tableTime,
qpeTime)); qpeTime));
// set keys
String siteKey = resource.getSiteKey();
String dataKey = resource.getDataKey();
ProductXML product = resource.getProduct();
if (resource.isWorstCase() || (resource.centeredAggregationKey != null)) { if (isWorstCase || (centeredAggregationKey != null)) {
// make sure that "ALL" is loaded // make sure that "ALL" is loaded
huc = "ALL"; localHuc = ALL;
rateRecord = monitor.getRateRecord(product, siteKey, dataKey, rateRecord = monitor.getRateRecord(product, siteKey, dataKey,
product.getRate(), resource.getPaintTime().getRefTime(), product.getRate(), paintRefTime, localHuc, true);
huc, true);
qpeRecord = monitor.getQPERecord(product, siteKey, dataKey, qpeRecord = monitor.getQPERecord(product, siteKey, dataKey,
product.getQpe(), resource.getTableTime(), huc, true); product.getQpe(), tableTime, localHuc, true);
qpfRecord = monitor.getQPFRecord(product, siteKey, dataKey, null, qpfRecord = monitor.getQPFRecord(product, siteKey, dataKey, null,
resource.getPaintTime().getRefTime(), huc, true); paintRefTime, localHuc, true);
guidRecords = monitor.getGuidanceRecords(product, siteKey, guidRecords = monitor.getGuidanceRecords(product, siteKey,
resource.getTableTime(), huc, true); tableTime, localHuc, true);
virtualRecord = monitor.getVirtualRecord(product, siteKey, dataKey, virtualRecord = monitor.getVirtualRecord(product, siteKey, dataKey,
product.getVirtual(), resource.getTableTime(), huc, true); product.getVirtual(), tableTime, localHuc, true);
} else { } else {
rateRecord = monitor.getRateRecord(product, siteKey, dataKey, rateRecord = monitor.getRateRecord(product, siteKey, dataKey,
product.getRate(), resource.getPaintTime().getRefTime(), product.getRate(), paintRefTime, huc, true);
resource.getHuc(), true);
qpeRecord = monitor.getQPERecord(product, siteKey, dataKey, qpeRecord = monitor.getQPERecord(product, siteKey, dataKey,
product.getQpe(), resource.getTableTime(), product.getQpe(), tableTime, huc, true);
resource.getHuc(), true);
qpfRecord = monitor.getQPFRecord(product, siteKey, dataKey, null, qpfRecord = monitor.getQPFRecord(product, siteKey, dataKey, null,
resource.getPaintTime().getRefTime(), resource.getHuc(), true); paintRefTime, huc, true);
guidRecords = monitor.getGuidanceRecords(product, siteKey, guidRecords = monitor.getGuidanceRecords(product, siteKey,
resource.getTableTime(), resource.getHuc(), true); tableTime, huc, true);
if (resource.getHuc().equals("ALL")) { if (huc.equals(ALL)) {
virtualRecord = monitor.getVirtualRecord(product, siteKey, virtualRecord = monitor.getVirtualRecord(product, siteKey,
dataKey, product.getVirtual(), resource.getTableTime(), dataKey, product.getVirtual(), tableTime,
resource.getHuc(), true); huc, true);
} }
huc = resource.getHuc(); localHuc = huc;
} }
try { try {
if (rateRecord != null) { if (rateRecord != null) {
rateBasin = rateRecord.getBasinData(huc); rateBasin = rateRecord.getBasinData(localHuc);
if (rateBasin.getBasins().size() > 0) { if (rateBasin.getBasins().size() > 0) {
field = FIELDS.RATE; field = FIELDS.RATE;
baseRec = rateRecord; baseRec = rateRecord;
} }
} }
if (qpeRecord != null) { if (qpeRecord != null) {
qpeBasin = qpeRecord.getBasinData(huc); qpeBasin = qpeRecord.getBasinData(localHuc);
if (qpeBasin.getBasins().size() > 0) { if (qpeBasin.getBasins().size() > 0) {
field = FIELDS.QPE; field = FIELDS.QPE;
if (baseRec == null) { if (baseRec == null) {
@ -1271,21 +1288,21 @@ public class FFMPDataGenerator {
} }
} }
if (qpfRecord != null) { if (qpfRecord != null) {
qpfBasin = qpfRecord.getBasinData(huc); qpfBasin = qpfRecord.getBasinData(localHuc);
} }
if (guidRecords != null) { if (guidRecords != null) {
guidBasins = new HashMap<String, FFMPBasinData>(); guidBasins = new HashMap<String, FFMPBasinData>();
for (String type : guidRecords.keySet()) { for (String type : guidRecords.keySet()) {
if (guidRecords.get(type) != null) { if (guidRecords.get(type) != null) {
guidBasins.put(type, guidRecords.get(type) guidBasins.put(type, guidRecords.get(type)
.getBasinData(huc)); .getBasinData(localHuc));
} else { } else {
guidBasins.put(type, null); guidBasins.put(type, null);
} }
} }
} }
if (virtualRecord != null) { if (virtualRecord != null) {
virtualBasin = virtualRecord.getBasinData(huc); virtualBasin = virtualRecord.getBasinData(localHuc);
} }
// Get interpolators // Get interpolators

View file

@ -40,7 +40,6 @@ import com.raytheon.uf.common.ohd.AppsDefaults;
import com.raytheon.uf.common.serialization.DynamicSerializationManager; import com.raytheon.uf.common.serialization.DynamicSerializationManager;
import com.raytheon.uf.common.serialization.DynamicSerializationManager.SerializationType; import com.raytheon.uf.common.serialization.DynamicSerializationManager.SerializationType;
import com.raytheon.uf.common.serialization.SerializationException; import com.raytheon.uf.common.serialization.SerializationException;
import com.raytheon.uf.common.time.SimulatedTime;
import com.raytheon.uf.viz.core.VizApp; import com.raytheon.uf.viz.core.VizApp;
import com.raytheon.uf.viz.monitor.ffmp.FFMPMonitor; import com.raytheon.uf.viz.monitor.ffmp.FFMPMonitor;
import com.raytheon.uf.viz.monitor.ffmp.ui.dialogs.FFMPConfig; import com.raytheon.uf.viz.monitor.ffmp.ui.dialogs.FFMPConfig;
@ -57,7 +56,7 @@ import com.raytheon.uf.viz.monitor.ffmp.ui.listeners.FFMPLoaderEvent;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* 28 Feb, 2011 7587 dhladky Initial creation * 28 Feb, 2011 7587 dhladky Initial creation
* 25 Jan, 2012 DR13839 gzhang Handle Uris and Huc processing * 25 Jan, 2012 DR13839 gzhang Handle Uris and Huc processing
* </pre> * </pre>
* *
* @author dhladky * @author dhladky
@ -65,8 +64,8 @@ import com.raytheon.uf.viz.monitor.ffmp.ui.listeners.FFMPLoaderEvent;
*/ */
public class FFMPDataLoader extends Thread { public class FFMPDataLoader extends Thread {
//private static final transient IUFStatusHandler statusHandler = UFStatus // private static final transient IUFStatusHandler statusHandler = UFStatus
// .getHandler(FFMPDataLoader.class); // .getHandler(FFMPDataLoader.class);
private String sharePath = null; private String sharePath = null;
@ -102,7 +101,7 @@ public class FFMPDataLoader extends Thread {
sharePath = AppsDefaults.getInstance().getToken("apps_dir") sharePath = AppsDefaults.getInstance().getToken("apps_dir")
+ File.separator + "ffmp" + File.separator; + File.separator + "ffmp" + File.separator;
this.product = resourceData.getProduct(); this.product = resourceData.getProduct();
this.siteKey = resourceData.siteKey; this.siteKey = resourceData.siteKey;
this.dataKey = resourceData.dataKey; this.dataKey = resourceData.dataKey;
@ -151,9 +150,8 @@ public class FFMPDataLoader extends Thread {
long time = System.currentTimeMillis(); long time = System.currentTimeMillis();
try { try {
resourceData.setLoader(loadType); resourceData.setLoader(loadType);
System.out.println("Starting Loader: "+loadType.getLoaderType());
ProductRunXML productRun = runner.getProduct(siteKey); ProductRunXML productRun = runner.getProduct(siteKey);
ArrayList<String> qpfSources = new ArrayList<String>(); ArrayList<String> qpfSources = new ArrayList<String>();
@ -164,8 +162,8 @@ public class FFMPDataLoader extends Thread {
|| (loadType == LOADER_TYPE.GENERAL)) { || (loadType == LOADER_TYPE.GENERAL)) {
rateURI = getMonitor().getAvailableUri(siteKey, dataKey, rateURI = getMonitor().getAvailableUri(siteKey, dataKey,
product.getRate(), mostRecentTime); product.getRate(), mostRecentTime);
} }
NavigableMap<Date, List<String>> qpeURIs = getMonitor() NavigableMap<Date, List<String>> qpeURIs = getMonitor()
.getAvailableUris(siteKey, dataKey, product.getQpe(), .getAvailableUris(siteKey, dataKey, product.getQpe(),
timeBack); timeBack);
@ -206,7 +204,7 @@ public class FFMPDataLoader extends Thread {
NavigableMap<Date, List<String>> iguidURIs = null; NavigableMap<Date, List<String>> iguidURIs = null;
Date guidTime = timeBack; Date guidTime = timeBack;
if (loadType == LOADER_TYPE.GENERAL) { if (loadType == LOADER_TYPE.GENERAL) {
guidTime = getMonitor().getPreviousQueryTime(siteKey, guidTime = getMonitor().getPreviousQueryTime(siteKey,
guidSource.getSourceName()); guidSource.getSourceName());
@ -220,11 +218,12 @@ public class FFMPDataLoader extends Thread {
} }
} }
} }
// We only load all for long range data, all + layer for medium range // We only load all for long range data, all + layer for medium
// range
if (loadType == LOADER_TYPE.TERTIARY) { if (loadType == LOADER_TYPE.TERTIARY) {
hucsToLoad.clear(); hucsToLoad.clear();
hucsToLoad.add("ALL"); hucsToLoad.add("ALL");
} }
for (String phuc : hucsToLoad) { for (String phuc : hucsToLoad) {
@ -238,9 +237,10 @@ public class FFMPDataLoader extends Thread {
} else { } else {
// rate // rate
if (rateURI != null) { if (rateURI != null) {
fireLoaderEvent(loadType, "Processing "+product.getRate() + "/" + phuc, fireLoaderEvent(loadType,
"Processing " + product.getRate() + "/" + phuc,
isDone); isDone);
getMonitor().processUri(isProductLoad, rateURI, getMonitor().processUri(isProductLoad, rateURI,
siteKey, product.getRate(), timeBack, phuc); siteKey, product.getRate(), timeBack, phuc);
fireLoaderEvent(loadType, product.getRate() + "/" fireLoaderEvent(loadType, product.getRate() + "/"
@ -248,8 +248,8 @@ public class FFMPDataLoader extends Thread {
} }
// qpes // qpes
fireLoaderEvent(loadType, "Processing "+product.getQpe() + "/" + phuc, fireLoaderEvent(loadType, "Processing " + product.getQpe()
isDone); + "/" + phuc, isDone);
FFMPBasinData qpeData = null; FFMPBasinData qpeData = null;
if (loadType == LOADER_TYPE.INITIAL) { if (loadType == LOADER_TYPE.INITIAL) {
@ -265,13 +265,13 @@ public class FFMPDataLoader extends Thread {
getMonitor().insertFFMPData(qpeData, siteKey, getMonitor().insertFFMPData(qpeData, siteKey,
product.getQpe(), phuc); product.getQpe(), phuc);
} }
} }
if (!qpeURIs.isEmpty() && qpeData == null) { if (!qpeURIs.isEmpty() && qpeData == null) {
if (phuc.equals(config.getFFMPConfigData().getLayer()) || phuc.equals("ALL")) { if (phuc.equals(config.getFFMPConfigData().getLayer())
|| phuc.equals("ALL")) {
getMonitor().processUris(qpeURIs, isProductLoad, getMonitor().processUris(qpeURIs, isProductLoad,
siteKey, product.getQpe(), timeBack, phuc, siteKey, product.getQpe(), timeBack, phuc);
loadType);
} }
} }
@ -281,7 +281,8 @@ public class FFMPDataLoader extends Thread {
int i = 0; int i = 0;
for (NavigableMap<Date, List<String>> qpfURIs : qpfs) { for (NavigableMap<Date, List<String>> qpfURIs : qpfs) {
// qpf // qpf
fireLoaderEvent(loadType, "Processing "+product.getQpf(i) + "/" + phuc, fireLoaderEvent(loadType,
"Processing " + product.getQpf(i) + "/" + phuc,
isDone); isDone);
FFMPBasinData qpfData = null; FFMPBasinData qpfData = null;
if (loadType == LOADER_TYPE.INITIAL) { if (loadType == LOADER_TYPE.INITIAL) {
@ -306,7 +307,7 @@ public class FFMPDataLoader extends Thread {
getMonitor().processUris(qpfURIs, getMonitor().processUris(qpfURIs,
isProductLoad, siteKey, isProductLoad, siteKey,
source.getSourceName(), source.getSourceName(),
timeBack, phuc, loadType); timeBack, phuc);
} }
} }
@ -314,15 +315,19 @@ public class FFMPDataLoader extends Thread {
source.getSourceName(), phuc); source.getSourceName(), phuc);
} }
} }
//if (isUrisProcessNeeded(qpfData,qpfURIs)) {/*DR13839*/ // if (isUrisProcessNeeded(qpfData,qpfURIs))
// {/*DR13839*/
if ((qpfData == null) && !qpfURIs.isEmpty()) { if ((qpfData == null) && !qpfURIs.isEmpty()) {
if (phuc.equals(config.getFFMPConfigData() if (phuc.equals(config.getFFMPConfigData()
.getLayer()) || phuc.equals("ALL")) { //old code: keep for reference*/ .getLayer()) || phuc.equals("ALL")) { // old
//if (isHucProcessNeeded(phuc)) {/*DR13839*/ // code:
// keep
// for
// reference*/
// if (isHucProcessNeeded(phuc)) {/*DR13839*/
getMonitor().processUris(qpfURIs, getMonitor().processUris(qpfURIs,
isProductLoad, siteKey, isProductLoad, siteKey,
product.getQpf(i), timeBack, phuc, product.getQpf(i), timeBack, phuc);
loadType);
} }
} }
@ -335,7 +340,8 @@ public class FFMPDataLoader extends Thread {
} }
// virtuals only have data for ALL // virtuals only have data for ALL
if (phuc.equals("ALL")) { if (phuc.equals("ALL")) {
fireLoaderEvent(loadType, "Processing "+product.getVirtual() + "/" + phuc, fireLoaderEvent(loadType,
"Processing " + product.getVirtual() + "/" + phuc,
isDone); isDone);
FFMPBasinData vgbData = null; FFMPBasinData vgbData = null;
@ -356,8 +362,7 @@ public class FFMPDataLoader extends Thread {
if ((vgbData == null) && !virtualURIs.isEmpty()) { if ((vgbData == null) && !virtualURIs.isEmpty()) {
getMonitor().processUris(virtualURIs, isProductLoad, getMonitor().processUris(virtualURIs, isProductLoad,
siteKey, product.getVirtual(), timeBack, phuc, siteKey, product.getVirtual(), timeBack, phuc);
loadType);
} }
fireLoaderEvent(loadType, fireLoaderEvent(loadType,
@ -366,20 +371,21 @@ public class FFMPDataLoader extends Thread {
// process guidance all at once // process guidance all at once
for (String type : productRun.getGuidanceTypes(product)) { for (String type : productRun.getGuidanceTypes(product)) {
ArrayList<SourceXML> guidSources = productRun ArrayList<SourceXML> guidSources = productRun
.getGuidanceSources(product, type); .getGuidanceSources(product, type);
for (SourceXML guidSource : guidSources) { for (SourceXML guidSource : guidSources) {
NavigableMap<Date, List<String>> iguidURIs = guids NavigableMap<Date, List<String>> iguidURIs = guids
.get(guidSource.getSourceName()); .get(guidSource.getSourceName());
fireLoaderEvent(loadType, "Processing "+guidSource.getSourceName() + "/" + phuc, fireLoaderEvent(loadType,
isDone); "Processing " + guidSource.getSourceName()
+ "/" + phuc, isDone);
getMonitor().processUris(iguidURIs, isProductLoad, getMonitor().processUris(iguidURIs, isProductLoad,
siteKey, guidSource.getSourceName(), timeBack, siteKey, guidSource.getSourceName(), timeBack,
phuc, loadType); phuc);
fireLoaderEvent(loadType, guidSource.getSourceName() fireLoaderEvent(loadType, guidSource.getSourceName()
+ "/" + phuc, isDone); + "/" + phuc, isDone);
@ -390,7 +396,6 @@ public class FFMPDataLoader extends Thread {
fireLoaderEvent(loadType, phuc + " Load complete", isDone); fireLoaderEvent(loadType, phuc + " Load complete", isDone);
} }
} catch (Exception e) { } catch (Exception e) {
isDone = true;
System.err.println("FFMP Data Loader terminated...." System.err.println("FFMP Data Loader terminated...."
+ e.getMessage()); + e.getMessage());
} finally { } finally {
@ -477,72 +482,73 @@ public class FFMPDataLoader extends Thread {
+ "-" + siteKey + "-" + pdataKey + "-" + huc + ".bin"); + "-" + siteKey + "-" + pdataKey + "-" + huc + ".bin");
File lockFile = new File(sharePath + wfo + File.separator + sourceName File lockFile = new File(sharePath + wfo + File.separator + sourceName
+ "-" + siteKey + "-" + pdataKey + ".lock"); + "-" + siteKey + "-" + pdataKey + ".lock");
while (lockFile.exists()) {
for (int i = 0; i < 4; i++) {
try {
sleep(100);
i++;
} catch (InterruptedException e) {
e.printStackTrace();
}
}
break;
}
System.out.println("Buddy File expected path: " + file.getAbsolutePath()); while (lockFile.exists()) {
FFMPBasinData basinData = null; for (int i = 0; i < 4; i++) {
try {
sleep(100);
i++;
} catch (InterruptedException e) {
e.printStackTrace();
}
}
if (file.exists()) { break;
}
System.out.println("Last mod: " + new Date(file.lastModified()));
if (file.lastModified() > (System.currentTimeMillis() - (6 * 1000 * 3600))) { System.out.println("Buddy File expected path: "
+ file.getAbsolutePath());
while (lockFile.exists()) { FFMPBasinData basinData = null;
for (int i = 0; i < 4; i++) {
try {
System.out.println("Waiting for new file: " + file.getAbsolutePath());
sleep(100);
i++;
} catch (InterruptedException e) {
e.printStackTrace();
}
}
break;
}
BufferedInputStream is = null; if (file.exists()) {
try {
System.out.println("Loading file: " + file.getName());
is = new BufferedInputStream(
new FileInputStream(file));
DynamicSerializationManager dsm = DynamicSerializationManager
.getManager(SerializationType.Thrift);
basinData = (FFMPBasinData) dsm.deserialize(is);
} catch (SerializationException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
if (is != null) {
try {
is.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
}
return basinData; System.out.println("Last mod: " + new Date(file.lastModified()));
} if (file.lastModified() > (System.currentTimeMillis() - (6 * 1000 * 3600))) {
while (lockFile.exists()) {
for (int i = 0; i < 4; i++) {
try {
System.out.println("Waiting for new file: "
+ file.getAbsolutePath());
sleep(100);
i++;
} catch (InterruptedException e) {
e.printStackTrace();
}
}
break;
}
BufferedInputStream is = null;
try {
System.out.println("Loading file: " + file.getName());
is = new BufferedInputStream(new FileInputStream(file));
DynamicSerializationManager dsm = DynamicSerializationManager
.getManager(SerializationType.Thrift);
basinData = (FFMPBasinData) dsm.deserialize(is);
} catch (SerializationException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
if (is != null) {
try {
is.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
}
return basinData;
}
/** /**
* Finds the home datakey identifier for QPF sources * Finds the home datakey identifier for QPF sources
@ -568,5 +574,5 @@ public class FFMPDataLoader extends Thread {
return siteKey; return siteKey;
} }
} }

View file

@ -1,19 +1,19 @@
/** /**
* This software was developed and / or modified by Raytheon Company, * This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government. * pursuant to Contract DG133W-05-CQ-1067 with the US Government.
* *
* U.S. EXPORT CONTROLLED TECHNICAL DATA * U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose * This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination * export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires * to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization. * an export license or other authorization.
* *
* Contractor Name: Raytheon Company * Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340 * Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8 * Mail Stop B8
* Omaha, NE 68106 * Omaha, NE 68106
* 402.291.0100 * 402.291.0100
* *
* 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.
**/ **/
@ -152,6 +152,7 @@ import com.vividsolutions.jts.geom.Point;
* 31 July 2012 14517 mpduff Fix for blanking map on update. * 31 July 2012 14517 mpduff Fix for blanking map on update.
* *
* </pre> * </pre>
*
* @author dhladky * @author dhladky
* @version 1.0 * @version 1.0
*/ */
@ -217,7 +218,7 @@ public class FFMPResource extends
private IShadedShape streamShadedShape = null; private IShadedShape streamShadedShape = null;
/** always the same vertexes, one for each CWA **/ /** always the same vertexes, one for each CWA **/
private FFMPShapeContainer shadedShapes = new FFMPShapeContainer(); private FFMPShapeContainer shadedShapes = new FFMPShapeContainer();
/** Basin shaded shape **/ /** Basin shaded shape **/
protected ConcurrentHashMap<DataTime, FFMPDrawable> drawables = new ConcurrentHashMap<DataTime, FFMPDrawable>(); protected ConcurrentHashMap<DataTime, FFMPDrawable> drawables = new ConcurrentHashMap<DataTime, FFMPDrawable>();
@ -236,7 +237,7 @@ public class FFMPResource extends
// time used by the resource // time used by the resource
private DataTime paintTime = null; private DataTime paintTime = null;
/** mouse handler **/ /** mouse handler **/
private final IInputHandler inspectAdapter = new InputAdapter() { private final IInputHandler inspectAdapter = new InputAdapter() {
@ -307,7 +308,7 @@ public class FFMPResource extends
/** show ffmp color display */ /** show ffmp color display */
private boolean showFfmpData = true; private boolean showFfmpData = true;
/** qpf split window */ /** qpf split window */
private boolean isSplit = false; private boolean isSplit = false;
@ -319,7 +320,7 @@ public class FFMPResource extends
/** table slider time **/ /** table slider time **/
private Date tableTime = null; private Date tableTime = null;
// complete reset // complete reset
public boolean isQuery = true; public boolean isQuery = true;
@ -342,7 +343,7 @@ public class FFMPResource extends
/** guidance source expiration **/ /** guidance source expiration **/
public long guidSourceExpiration = 0l; public long guidSourceExpiration = 0l;
/** QPF source expiration **/ /** QPF source expiration **/
public long qpfSourceExpiration = 0l; public long qpfSourceExpiration = 0l;
@ -373,7 +374,9 @@ public class FFMPResource extends
private RGB basinBoundaryColor = null; private RGB basinBoundaryColor = null;
/** ordered list of times **/ /** ordered list of times **/
private ArrayList<Date> timeOrderedKeys = null; private ArrayList<Date> timeOrderedKeys = new ArrayList<Date>();
private boolean toKeysInitialized = false;
/** force utility **/ /** force utility **/
private FFFGForceUtil forceUtil = null; private FFFGForceUtil forceUtil = null;
@ -412,9 +415,15 @@ public class FFMPResource extends
FFFGDataMgr.getUpdatedInstance(); FFFGDataMgr.getUpdatedInstance();
PluginDataObject[] pdos = (PluginDataObject[]) object; PluginDataObject[] pdos = (PluginDataObject[]) object;
FFMPRecord ffmpRec = (FFMPRecord) pdos[pdos.length - 1]; FFMPRecord ffmpRec = (FFMPRecord) pdos[pdos.length - 1];
if (getTimeOrderedKeys().contains(
ffmpRec.getDataTime().getRefTime())) {
return;
}
// an update clears everything
clear();
// only care about the most recent one // only care about the most recent one
try { try {
if (ffmpRec.getSourceName() if (ffmpRec.getSourceName()
.equals(getResourceData().sourceName)) { .equals(getResourceData().sourceName)) {
// go back an extra time step // go back an extra time step
@ -430,41 +439,46 @@ public class FFMPResource extends
} }
updateTimeOrderedkeys(ffmpRec.getDataTime().getRefTime()); updateTimeOrderedkeys(ffmpRec.getDataTime().getRefTime());
if (getResourceData().tableLoad) {
setTableTime();
}
setRecord(ffmpRec); setRecord(ffmpRec);
statusHandler.handle(Priority.INFO, "Updating : Previous: " statusHandler.handle(Priority.INFO, "Updating : Previous: "
+ previousMostRecentTime + " New: " + previousMostRecentTime + " New: "
+ ffmpRec.getDataTime().getRefTime()); + ffmpRec.getDataTime().getRefTime());
if (getResourceData().tableLoad) { if (getResourceData().tableLoad) {
if (loader == null) { if (loader == null) {
startLoader(previousMostRecentTime, ffmpRec startLoader(previousMostRecentTime, ffmpRec
.getDataTime().getRefTime(), .getDataTime().getRefTime(),
LOADER_TYPE.GENERAL); LOADER_TYPE.GENERAL);
} else { } else {
while (!loader.isDone) { while (!loader.isDone) {
try { try {
Thread.sleep(10); Thread.sleep(1000);
} catch (InterruptedException e) { } catch (InterruptedException e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
startLoader(previousMostRecentTime, ffmpRec startLoader(previousMostRecentTime, ffmpRec
.getDataTime().getRefTime(), .getDataTime().getRefTime(),
LOADER_TYPE.GENERAL); LOADER_TYPE.GENERAL);
} }
while (!loader.isDone) { while (!loader.isDone) {
try { try {
Thread.sleep(10); Thread.sleep(1000);
} catch (InterruptedException e) { } catch (InterruptedException e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
purge(ffmpRec.getDataTime().getRefTime()); purge(ffmpRec.getDataTime().getRefTime());
} }
qpeRecord = null; qpeRecord = null;
isNewQpe = true; isNewQpe = true;
@ -484,12 +498,12 @@ public class FFMPResource extends
ve); ve);
} }
} }
if (getResourceData().tableLoad) { if (getResourceData().tableLoad) {
allowNewTableUpdate(); allowNewTableUpdate();
isFirst = true; isFirst = true;
} }
refresh(); refresh();
} }
@ -500,7 +514,7 @@ public class FFMPResource extends
} }
issueRefresh(); issueRefresh();
} }
@Override @Override
public void hucChanged() { public void hucChanged() {
@ -593,7 +607,7 @@ public class FFMPResource extends
return getColorUtil().colorByValue(value); return getColorUtil().colorByValue(value);
} else { } else {
if (getCenteredAggregatePfafs().contains(key) && isParent()) { if (getCenteredAggregatePfafs().contains(key) && isParent()) {
// this is for a reason // this is for a reason
} else { } else {
if (!isMaintainLayer() && isParent()) { if (!isMaintainLayer() && isParent()) {
return getColorUtil().colorByValue(value); return getColorUtil().colorByValue(value);
@ -649,7 +663,8 @@ public class FFMPResource extends
} }
case QPF: { case QPF: {
value = getQpfRecord(recentTime).getBasinData("ALL") value = getQpfRecord(recentTime).getBasinData("ALL")
.getAverageMaxValue(pfafs, recentTime, getQpfSourceExpiration()); .getAverageMaxValue(pfafs, recentTime,
getQpfSourceExpiration());
break; break;
} }
case GUIDANCE: { case GUIDANCE: {
@ -698,11 +713,13 @@ public class FFMPResource extends
break; break;
} }
case RATE: case RATE:
value = getBasin(key, field, recentTime, aggregate).getValue(recentTime); value = getBasin(key, field, recentTime, aggregate)
break; .getValue(recentTime);
break;
case QPF: { case QPF: {
value = getBasin(key, field, recentTime, aggregate) value = getBasin(key, field, recentTime, aggregate)
.getAverageValue(recentTime, getQpfSourceExpiration()); .getAverageValue(recentTime,
getQpfSourceExpiration());
break; break;
} }
case GUIDANCE: { case GUIDANCE: {
@ -729,7 +746,8 @@ public class FFMPResource extends
switch (field) { switch (field) {
case QPF: { case QPF: {
value = getBasin(key, field, recentTime, aggregate) value = getBasin(key, field, recentTime, aggregate)
.getAverageValue(recentTime, getQpfSourceExpiration()); .getAverageValue(recentTime,
getQpfSourceExpiration());
break; break;
} }
case GUIDANCE: { case GUIDANCE: {
@ -755,9 +773,9 @@ public class FFMPResource extends
if (forceUtil == null) { if (forceUtil == null) {
forceUtil = new FFFGForceUtil(this, getFFGName()); forceUtil = new FFFGForceUtil(this, getFFGName());
} }
forceUtil.setSliderTime(this.getTime()); forceUtil.setSliderTime(this.getTime());
if (pfafs != null) { if (pfafs != null) {
forceUtil.calculateForcings(pfafs, forceUtil.calculateForcings(pfafs,
monitor.getTemplates(getSiteKey()), basin); monitor.getTemplates(getSiteKey()), basin);
@ -797,11 +815,11 @@ public class FFMPResource extends
} }
PluginDataObject pdo = null; PluginDataObject pdo = null;
try { try {
pdo = getRecord(sfield, paintTime.getRefTime()); pdo = getRecord(sfield, paintTime.getRefTime());
} catch (NullPointerException npe) { } catch (NullPointerException npe) {
return "No Data Available"; return "No Data Available";
} }
if (pdo == null) { if (pdo == null) {
@ -862,7 +880,6 @@ public class FFMPResource extends
e.printStackTrace(); e.printStackTrace();
} }
} }
return rateRecord; return rateRecord;
} }
@ -891,6 +908,7 @@ public class FFMPResource extends
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
// System.out.println("FFMPResource.getQPERecord(): " + getTableTime());
return qpeRecord; return qpeRecord;
} }
@ -917,11 +935,13 @@ public class FFMPResource extends
} }
if (isWorstCase()) { if (isWorstCase()) {
guidRecord = monitor.getGuidanceRecord(getProduct(), guidRecord = monitor
getSiteKey(), sourceName, date, "ALL", isStandAlone); .getGuidanceRecord(getProduct(), getSiteKey(),
sourceName, date, "ALL", isStandAlone);
} else { } else {
guidRecord = monitor.getGuidanceRecord(getProduct(), guidRecord = monitor.getGuidanceRecord(getProduct(),
getSiteKey(), sourceName, date, getHuc(), isStandAlone); getSiteKey(), sourceName, date, getHuc(),
isStandAlone);
} }
isNewGuid = false; isNewGuid = false;
@ -1073,12 +1093,12 @@ public class FFMPResource extends
} }
/** /**
* DR 14522 fixing: enclosing font setting * DR 14522 fixing: enclosing font setting into GUI thread to avoid invalid
* into GUI thread to avoid invalid thread * thread access.
* access.
*/ */
@Override @Override
protected void initInternal(final IGraphicsTarget target) throws VizException { protected void initInternal(final IGraphicsTarget target)
throws VizException {
EditableManager.makeEditable(this, EditableManager.makeEditable(this,
getCapability(EditableCapability.class).isEditable()); getCapability(EditableCapability.class).isEditable());
IDisplayPaneContainer container = getResourceContainer(); IDisplayPaneContainer container = getResourceContainer();
@ -1103,40 +1123,45 @@ public class FFMPResource extends
} catch (Exception ex) { } catch (Exception ex) {
statusHandler.handle(Priority.PROBLEM, "Error opening FFMP", ex); statusHandler.handle(Priority.PROBLEM, "Error opening FFMP", ex);
} }
//DR 14522: use Display.getDefault().asyncExec() for GUI thread.
org.eclipse.swt.widgets.Display.getDefault().asyncExec(new Runnable(){
public void run(){
if (/*this.*/font == null) {
/*this.*/font = target.initializeFont("Dialog", 11, null);
}
font.setMagnification(getCapability(MagnificationCapability.class) // DR 14522: use Display.getDefault().asyncExec() for GUI thread.
.getMagnification().floatValue()); org.eclipse.swt.widgets.Display.getDefault().asyncExec(new Runnable() {
if (/*this.*/xfont == null) {
IFont.Style[] styles = new IFont.Style[] { IFont.Style.BOLD };
/*this.*/xfont = target.initializeFont("Monospace", 12, styles);
}
xfont.setMagnification(getCapability(MagnificationCapability.class) public void run() {
.getMagnification().floatValue());
fieldDescString = new DrawableString("FFMP " + df.format(getTime())
+ " hour " + FFMPRecord.getFieldLongDescription(getField()),
getCapability(ColorableCapability.class).getColor());
fieldDescString.font = font;
fieldDescString.horizontalAlignment = HorizontalAlignment.CENTER;
fieldDescString.verticallAlignment = VerticalAlignment.MIDDLE;
basinLocatorString = new DrawableString("X", new RGB(255, 255, 255)); if (/* this. */font == null) {
basinLocatorString.font = xfont; /* this. */font = target.initializeFont("Dialog", 11, null);
basinLocatorString.horizontalAlignment = HorizontalAlignment.CENTER; }
basinLocatorString.verticallAlignment = VerticalAlignment.MIDDLE;
basinLocatorString.textStyle = TextStyle.BLANKED; font.setMagnification(getCapability(
} MagnificationCapability.class).getMagnification()
.floatValue());
if (/* this. */xfont == null) {
IFont.Style[] styles = new IFont.Style[] { IFont.Style.BOLD };
/* this. */xfont = target.initializeFont("Monospace", 12,
styles);
}
xfont.setMagnification(getCapability(
MagnificationCapability.class).getMagnification()
.floatValue());
fieldDescString = new DrawableString("FFMP "
+ df.format(getTime()) + " hour "
+ FFMPRecord.getFieldLongDescription(getField()),
getCapability(ColorableCapability.class).getColor());
fieldDescString.font = font;
fieldDescString.horizontalAlignment = HorizontalAlignment.CENTER;
fieldDescString.verticallAlignment = VerticalAlignment.MIDDLE;
basinLocatorString = new DrawableString("X", new RGB(255, 255,
255));
basinLocatorString.font = xfont;
basinLocatorString.horizontalAlignment = HorizontalAlignment.CENTER;
basinLocatorString.verticallAlignment = VerticalAlignment.MIDDLE;
basinLocatorString.textStyle = TextStyle.BLANKED;
}
}); });
} }
@ -1170,13 +1195,17 @@ public class FFMPResource extends
FFMPDrawable drawable = null; FFMPDrawable drawable = null;
if (paintTime != null) { if (paintTime != null) {
if (loader != null && !loader.isDone && loader.loadType == LOADER_TYPE.GENERAL) {
return;
}
if (!drawables.containsKey(paintTime)) { if (!drawables.containsKey(paintTime)) {
drawable = new FFMPDrawable(getDomains()); drawable = new FFMPDrawable(getDomains());
drawables.put(paintTime, drawable); drawables.put(paintTime, drawable);
} else { } else {
// we found it! // we found it!
drawable = drawables.get(paintTime); drawable = drawables.get(paintTime);
// System.out.println("Found the drawable");
if (!paintTime.equals(drawable.getTime())) { if (!paintTime.equals(drawable.getTime())) {
drawable.setDirty(true); drawable.setDirty(true);
@ -1198,6 +1227,7 @@ public class FFMPResource extends
&& !paintTime.getRefTime().equals(getMostRecentTime())) { && !paintTime.getRefTime().equals(getMostRecentTime())) {
setMostRecentTime(paintTime.getRefTime()); setMostRecentTime(paintTime.getRefTime());
setTableTime(); setTableTime();
// if (isLinkToFrame && loader != null && loader.loadType != LOADER_TYPE.GENERAL) {
if (isLinkToFrame) { if (isLinkToFrame) {
updateDialog(); updateDialog();
} }
@ -1487,25 +1517,25 @@ public class FFMPResource extends
@Override @Override
public void project(CoordinateReferenceSystem mapData) throws VizException { public void project(CoordinateReferenceSystem mapData) throws VizException {
if (shadedShapes != null) { if (shadedShapes != null) {
shadedShapes.clear(); shadedShapes.clear();
} }
if (streamShadedShape != null) { if (streamShadedShape != null) {
streamShadedShape.dispose(); streamShadedShape.dispose();
streamShadedShape = null; streamShadedShape = null;
} }
if (streamOutlineShape != null) { if (streamOutlineShape != null) {
streamOutlineShape.dispose(); streamOutlineShape.dispose();
streamOutlineShape = null; streamOutlineShape = null;
} }
if (smallBasinOverlayShape != null) { if (smallBasinOverlayShape != null) {
smallBasinOverlayShape.dispose(); smallBasinOverlayShape.dispose();
smallBasinOverlayShape = null; smallBasinOverlayShape = null;
} }
setQuery(true); setQuery(true);
refresh(); refresh();
} }
@ -1581,9 +1611,9 @@ public class FFMPResource extends
if (getHuc().equals("ALL") || centeredAggregationKey != null) { if (getHuc().equals("ALL") || centeredAggregationKey != null) {
pfaf = metaBasin.getPfaf(); pfaf = metaBasin.getPfaf();
if (isMaintainLayer) { if (isMaintainLayer) {
pfaf = monitor.getTemplates(getSiteKey()).findAggregatedPfaf( pfaf = monitor.getTemplates(getSiteKey())
pfaf, getSiteKey(), getHuc()); .findAggregatedPfaf(pfaf, getSiteKey(), getHuc());
aggregate = true; aggregate = true;
} }
} else { } else {
pfaf = monitor.getTemplates(getSiteKey()).findAggregatedPfaf( pfaf = monitor.getTemplates(getSiteKey()).findAggregatedPfaf(
@ -1611,8 +1641,8 @@ public class FFMPResource extends
if (val.isNaN() || (val == FFMPUtils.MISSING)) { if (val.isNaN() || (val == FFMPUtils.MISSING)) {
valst = "NO DATA"; valst = "NO DATA";
} else { } else {
valst = df.format(getBasinValue(pfaf, valst = df.format(getBasinValue(pfaf, getPaintTime()
getPaintTime().getRefTime(), aggregate)); .getRefTime(), aggregate));
} }
if (!valst.equals("NO DATA")) { if (!valst.equals("NO DATA")) {
@ -1768,7 +1798,7 @@ public class FFMPResource extends
if (getResourceData().tableLoad) { if (getResourceData().tableLoad) {
if (isUpdateDialog) { if (isUpdateDialog) {
updateDialog(); updateDialog();
} }
// stops the annoying wait cursor every time you re-center // stops the annoying wait cursor every time you re-center
@ -2007,7 +2037,7 @@ public class FFMPResource extends
for (Entry<DataTime, FFMPDrawable> entry : drawables.entrySet()) { for (Entry<DataTime, FFMPDrawable> entry : drawables.entrySet()) {
entry.getValue().dispose(); entry.getValue().dispose();
} }
drawables.clear(); drawables.clear();
} }
} }
@ -2271,7 +2301,7 @@ public class FFMPResource extends
public DataTime getPaintTime() { public DataTime getPaintTime() {
return paintTime; return paintTime;
} }
/** /**
* Add a value to worst case hash * Add a value to worst case hash
* *
@ -2279,9 +2309,9 @@ public class FFMPResource extends
* @param value * @param value
*/ */
private void addWorstCase(Long aggPfaf, Date recentTime, Float value) { private void addWorstCase(Long aggPfaf, Date recentTime, Float value) {
FFMPDrawable drawable = drawables.get(new DataTime(recentTime)); FFMPDrawable drawable = drawables.get(new DataTime(recentTime));
if (drawable != null && drawable.worstCaseHash != null) { if (drawable != null && drawable.worstCaseHash != null) {
drawable.worstCaseHash.put(aggPfaf, value); drawable.worstCaseHash.put(aggPfaf, value);
} }
} }
@ -2446,8 +2476,7 @@ public class FFMPResource extends
} }
if ((cwaBasins.size() == 0) if ((cwaBasins.size() == 0)
|| !req.extent.equals(drawable.getExt()) || !req.extent.equals(drawable.getExt())
|| !phuc.equals(drawable.getHuc()) || !phuc.equals(drawable.getHuc()) || restoreTable) {
|| restoreTable) {
Envelope env = null; Envelope env = null;
try { try {
Envelope e = req.descriptor.pixelToWorld(req.extent, Envelope e = req.descriptor.pixelToWorld(req.extent,
@ -2472,7 +2501,8 @@ public class FFMPResource extends
templates, getSiteKey(), cwa, phuc); templates, getSiteKey(), cwa, phuc);
for (Entry<Long, Envelope> entry : envMap.entrySet()) { for (Entry<Long, Envelope> entry : envMap.entrySet()) {
if (env.intersects(entry.getValue()) || env.contains(entry.getValue())) { if (env.intersects(entry.getValue())
|| env.contains(entry.getValue())) {
// add the individual basins // add the individual basins
cwaBasins.add(entry.getKey()); cwaBasins.add(entry.getKey());
} }
@ -2556,11 +2586,11 @@ public class FFMPResource extends
// the // the
// the basin when the color map changes. // the basin when the color map changes.
if (globalRegen || drawable.genCwa(cwa)) { if (globalRegen || drawable.genCwa(cwa)) {
//System.out // System.out
//.println("Regenerating the entire image: CWA: +" // .println("Regenerating the entire image: CWA: +"
//+ cwa // + cwa
//+ " Table:" // + " Table:"
//+ resourceData.tableLoad); // + resourceData.tableLoad);
// get base aggr basins that are in screen area // get base aggr basins that are in screen area
Set<Long> cwaPfafs = null; Set<Long> cwaPfafs = null;
cwaPfafs = getAreaBasins(cwa, req, phuc); cwaPfafs = getAreaBasins(cwa, req, phuc);
@ -2585,7 +2615,11 @@ public class FFMPResource extends
.getCenterAggrKey(); .getCenterAggrKey();
// this is a fall back for VGB's // this is a fall back for VGB's
if (centeredAggr == null) { if (centeredAggr == null) {
centeredAggr = templates.findAggregatedVGB((String) centeredAggregationKey, getSiteKey(), phuc); centeredAggr = templates
.findAggregatedVGB(
(String) centeredAggregationKey,
getSiteKey(),
phuc);
} }
} }
@ -2596,7 +2630,11 @@ public class FFMPResource extends
centeredAggr = (Long) drawable centeredAggr = (Long) drawable
.getCenterAggrKey(); .getCenterAggrKey();
if (centeredAggr == null) { if (centeredAggr == null) {
centeredAggr = templates.getAggregatedPfaf((Long)centeredAggregationKey, getSiteKey(), phuc); centeredAggr = templates
.getAggregatedPfaf(
(Long) centeredAggregationKey,
getSiteKey(),
phuc);
} }
} }
} }
@ -2775,7 +2813,7 @@ public class FFMPResource extends
if (restoreTable) { if (restoreTable) {
restoreTable = false; restoreTable = false;
} }
drawable.setTime(req.time); drawable.setTime(req.time);
if (lowestCenter != ZOOM.BASIN) { if (lowestCenter != ZOOM.BASIN) {
drawable.setCenterAggrKey(centeredAggregationKey); drawable.setCenterAggrKey(centeredAggregationKey);
@ -2830,7 +2868,7 @@ public class FFMPResource extends
// check whether or not the dialog needs to be dumped // check whether or not the dialog needs to be dumped
monitor.splashDisposeAndDataLoad(getResource()); monitor.splashDisposeAndDataLoad(getResource());
if (getResourceData().tableLoad && isFirst) { if (getResourceData().tableLoad && isFirst) {
isFirst = false; isFirst = false;
updateDialog(); updateDialog();
@ -3059,13 +3097,13 @@ public class FFMPResource extends
centeredAggregatePfafList = null; centeredAggregatePfafList = null;
if (isAutoRefresh) { if (isAutoRefresh) {
if (basinTableDlg != null) { if (basinTableDlg != null) {
// Gets rid of the aggregate name if it is zoomed into one // Gets rid of the aggregate name if it is zoomed into one
basinTableDlg.blankGroupLabel(); basinTableDlg.blankGroupLabel();
} }
clearTables(); clearTables();
hucChanged(); hucChanged();
refresh(); refresh();
} }
updateDialog(); updateDialog();
@ -3075,12 +3113,12 @@ public class FFMPResource extends
public void timeChanged(FFMPTimeChangeEvent fhce, FFMPRecord.FIELDS fieldArg) public void timeChanged(FFMPTimeChangeEvent fhce, FFMPRecord.FIELDS fieldArg)
throws VizException { throws VizException {
FFMPTime ffmpTime = (FFMPTime) fhce.getSource(); FFMPTime ffmpTime = (FFMPTime) fhce.getSource();
if (ffmpTime.getTime() != time || isSplit != ffmpTime.isSplit()) { if (ffmpTime.getTime() != time || isSplit != ffmpTime.isSplit()) {
isSplit = ffmpTime.isSplit(); isSplit = ffmpTime.isSplit();
setTime(ffmpTime.getTime()); setTime(ffmpTime.getTime());
setTableTime(); setTableTime();
if (interpolationMap != null) { if (interpolationMap != null) {
interpolationMap.clear(); interpolationMap.clear();
@ -3200,7 +3238,7 @@ public class FFMPResource extends
centeredAggregationKey = null; centeredAggregationKey = null;
centeredAggregatePfafList = null; centeredAggregatePfafList = null;
restoreTable = true; restoreTable = true;
lowestCenter = FFMPRecord.ZOOM.WFO; lowestCenter = FFMPRecord.ZOOM.WFO;
getDescriptor().getRenderableDisplay().getExtent().reset(); getDescriptor().getRenderableDisplay().getExtent().reset();
zoom(1.0f); zoom(1.0f);
@ -3223,7 +3261,8 @@ public class FFMPResource extends
@Override @Override
public FFMPGraphData getGraphData(String pfafString) throws VizException { public FFMPGraphData getGraphData(String pfafString) throws VizException {
FfmpTableConfig tableConfig = FfmpTableConfig.getInstance(); FfmpTableConfig tableConfig = FfmpTableConfig.getInstance();
String ffgGraphType = tableConfig.getTableConfigData(getSiteKey()).getFfgGraphType(); String ffgGraphType = tableConfig.getTableConfigData(getSiteKey())
.getFfgGraphType();
Long basinPfaf = null; Long basinPfaf = null;
Long dataId = null; Long dataId = null;
FFMPVirtualGageBasinMetaData fvgbmd = null; FFMPVirtualGageBasinMetaData fvgbmd = null;
@ -3397,7 +3436,7 @@ public class FFMPResource extends
if (fvgbmd != null) { if (fvgbmd != null) {
try { try {
// VGB's use a different timing sequence // VGB's use a different timing sequenceFFMPResource
String lid = fvgbmd.getLid(); String lid = fvgbmd.getLid();
virtualBasin = monitor.getVirtualGageBasinData(dataId, lid, virtualBasin = monitor.getVirtualGageBasinData(dataId, lid,
@ -3557,13 +3596,18 @@ public class FFMPResource extends
* Sets the time used for accumulation drawn from the slider time * Sets the time used for accumulation drawn from the slider time
*/ */
private void setTableTime() { private void setTableTime() {
if (tableTime == null) {
Date recentTime = getMostRecentTime(); tableTime = new Date();
long time = new Double(recentTime.getTime() - (1000 * 3600) * getTime()) }
.longValue();
Date date = new Date(); synchronized (tableTime) {
date.setTime(time); Date recentTime = getMostRecentTime();
this.tableTime = date; long time = new Double(recentTime.getTime() - (1000 * 3600)
* getTime()).longValue();
Date date = new Date();
date.setTime(time);
this.tableTime = date;
}
} }
/** /**
@ -3721,9 +3765,10 @@ public class FFMPResource extends
* @param set * @param set
* @return ordered dates * @return ordered dates
*/ */
public ArrayList<Date> getTimeOrderedKeys() { public synchronized ArrayList<Date> getTimeOrderedKeys() {
if (timeOrderedKeys == null) { if (timeOrderedKeys == null || !toKeysInitialized) {
toKeysInitialized = true;
// stand alone displays use this // stand alone displays use this
timeOrderedKeys = new ArrayList<Date>(); timeOrderedKeys = new ArrayList<Date>();
@ -3851,7 +3896,7 @@ public class FFMPResource extends
long fips = monitor.getTemplates(getSiteKey()).getCountyFipsByPfaf( long fips = monitor.getTemplates(getSiteKey()).getCountyFipsByPfaf(
basin.getPfaf()); basin.getPfaf());
basin.setCountyFips(fips); basin.setCountyFips(fips);
if (getResourceData().tableLoad) { if (getResourceData().tableLoad) {
// interpolating // interpolating
if (getGuidanceInterpolation(guidType).isInterpolate()) { if (getGuidanceInterpolation(guidType).isInterpolate()) {
@ -3904,9 +3949,9 @@ public class FFMPResource extends
public boolean isLinkToFrame() { public boolean isLinkToFrame() {
return isLinkToFrame; return isLinkToFrame;
} }
public boolean isSplit() { public boolean isSplit() {
return isSplit; return isSplit;
} }
/** /**
@ -4021,31 +4066,30 @@ public class FFMPResource extends
} }
return qpeSourceExpiration; return qpeSourceExpiration;
} }
/** /**
* source expiration value as a long * source expiration value as a long
* *
* @return * @return
*/ */
public long getQpfSourceExpiration() { public long getQpfSourceExpiration() {
if (qpfSourceExpiration == 0l) { if (qpfSourceExpiration == 0l) {
SourceXML source = null; SourceXML source = null;
if (getProduct() != null) { if (getProduct() != null) {
FfmpTableConfigData ffmpTableCfgData = FfmpTableConfig FfmpTableConfigData ffmpTableCfgData = FfmpTableConfig
.getInstance().getTableConfigData(getSiteKey()); .getInstance().getTableConfigData(getSiteKey());
String qpfType = ffmpTableCfgData.getQpfType(); String qpfType = ffmpTableCfgData.getQpfType();
source = getProduct().getQpfSourcesByType(qpfType).get(0); source = getProduct().getQpfSourcesByType(qpfType).get(0);
} else { } else {
source = FFMPSourceConfigurationManager.getInstance() source = FFMPSourceConfigurationManager.getInstance()
.getSource(getResourceData().sourceName); .getSource(getResourceData().sourceName);
} }
qpfSourceExpiration = source.getExpirationMinutes(getSiteKey()) * 60 * 1000; qpfSourceExpiration = source.getExpirationMinutes(getSiteKey()) * 60 * 1000;
} }
return qpfSourceExpiration; return qpfSourceExpiration;
} }
/** /**
* Gets the guidance source expiration * Gets the guidance source expiration
* *
@ -4055,12 +4099,13 @@ public class FFMPResource extends
if (guidSourceExpiration == 0l) { if (guidSourceExpiration == 0l) {
if (getProduct() != null) { if (getProduct() != null) {
String guidSrc = FFMPConfig.getInstance().getFFMPConfigData().getIncludedGuids(); String guidSrc = FFMPConfig.getInstance().getFFMPConfigData()
.getIncludedGuids();
if (guidSrc.contains(",")) { if (guidSrc.contains(",")) {
String[] parts = guidSrc.split(","); String[] parts = guidSrc.split(",");
guidSrc = parts[0]; guidSrc = parts[0];
} }
SourceXML source = getProduct().getGuidanceSourcesByType( SourceXML source = getProduct().getGuidanceSourcesByType(
guidSrc).get(0); guidSrc).get(0);
guidSourceExpiration = source guidSourceExpiration = source
.getExpirationMinutes(getSiteKey()) * 60 * 1000; .getExpirationMinutes(getSiteKey()) * 60 * 1000;
@ -4123,7 +4168,8 @@ public class FFMPResource extends
String ffgName = null; String ffgName = null;
if (getResourceData().tableLoad) { if (getResourceData().tableLoad) {
String guidSrc = FFMPConfig.getInstance().getFFMPConfigData().getGuidSrc(); String guidSrc = FFMPConfig.getInstance().getFFMPConfigData()
.getGuidSrc();
if (guidSrc.startsWith("xxx")) { if (guidSrc.startsWith("xxx")) {
ffgName = ""; ffgName = "";
} else { } else {
@ -4210,9 +4256,7 @@ public class FFMPResource extends
ArrayList<String> hucsToLoad = new ArrayList<String>(); ArrayList<String> hucsToLoad = new ArrayList<String>();
if (isWorstCase) { if (isWorstCase) {
if (!hucsToLoad.contains("ALL")) { hucsToLoad.add("ALL");
hucsToLoad.add("ALL");
}
} }
// tertiary loader only loads ALL // tertiary loader only loads ALL
@ -4245,62 +4289,61 @@ public class FFMPResource extends
loader.removeListener(this); loader.removeListener(this);
} }
} }
/** /**
* Get the purge file time * Get the purge file time
*/ */
public long getPurgePeriod() { public long getPurgePeriod() {
IPathManager pm = PathManagerFactory.getPathManager(); IPathManager pm = PathManagerFactory.getPathManager();
LocalizationContext lc = pm.getContext( LocalizationContext lc = pm.getContext(LocalizationType.COMMON_STATIC,
LocalizationType.COMMON_STATIC, LocalizationLevel.SITE); LocalizationLevel.SITE);
LocalizationFile lfFile = pm.getLocalizationFile(lc, LocalizationFile lfFile = pm.getLocalizationFile(lc,
"purge/ffmpPurgeRules.xml"); "purge/ffmpPurgeRules.xml");
if (lfFile.exists()) { if (lfFile.exists()) {
//TODO Need to figure out why we can't read in the purgeRules! // TODO Need to figure out why we can't read in the purgeRules!
/*try { /*
PurgeRuleSet prs = (PurgeRuleSet) SerializationUtil * try { PurgeRuleSet prs = (PurgeRuleSet) SerializationUtil
.jaxbUnmarshalFromXmlFile(lfFile.getFile().getAbsolutePath()); * .jaxbUnmarshalFromXmlFile(lfFile.getFile().getAbsolutePath());
*
for (PurgeRule rule: prs.getRules()) { * for (PurgeRule rule: prs.getRules()) { if
if (rule.getId().equals("ffmp")) { * (rule.getId().equals("ffmp")) { return rule.getPeriodInMillis();
return rule.getPeriodInMillis(); * } }
} *
} * } catch (SerializationException e) { e.printStackTrace(); return
* 3600*24*1000; }
} catch (SerializationException e) { */
e.printStackTrace();
return 3600*24*1000;
} */
} }
return 3600*24*1000; return 3600 * 24 * 1000;
} }
/** /**
* Kicks off additional loaders that need to be fired off * Kicks off additional loaders that need to be fired off
*
* @param loader * @param loader
* @param isDone * @param isDone
*/ */
public void manageLoaders(FFMPLoaderStatus status) { public void manageLoaders(FFMPLoaderStatus status) {
if (status.getLoaderType() == LOADER_TYPE.SECONDARY) { if (status.getLoaderType() == LOADER_TYPE.SECONDARY) {
if (status.isDone() && !this.getResourceData().isTertiaryLoad) { if (status.isDone() && !this.getResourceData().isTertiaryLoad) {
try { try {
Date startDate = new Date(getMostRecentTime().getTime() - (6 * 3600 * 1000)); Date startDate = new Date(getMostRecentTime().getTime()
- (6 * 3600 * 1000));
FFMPMonitor.getInstance().startLoad(this, startDate, FFMPMonitor.getInstance().startLoad(this, startDate,
LOADER_TYPE.TERTIARY); LOADER_TYPE.TERTIARY);
} catch (VizException e) { } catch (VizException e) {
statusHandler.handle(Priority.PROBLEM, statusHandler.handle(Priority.PROBLEM,
"Secondary Data Load failure", e); "Secondary Data Load failure", e);
} }
} }
} }
// We don't really care about status of tertiary and general loaders // We don't really care about status of tertiary and general loaders
} }
} }

View file

@ -22,6 +22,8 @@ package com.raytheon.uf.viz.monitor.ffmp.ui.rsc;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Comparator; import java.util.Comparator;
import java.util.Date; import java.util.Date;
import java.util.List;
import java.util.NavigableMap;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAccessorType;
@ -258,15 +260,33 @@ public class FFMPResourceData extends AbstractRequestableResourceData {
} }
} else { } else {
/*
* This appears completely un-orthodox for anything in D2D. But
* alas FFMP always does things differently. According to Vada
* Driesbach, FFMP in stand alone mode functions similarly to
* the way it does in table mode. Meaning you have to reach back
* and find time windows for the source displayed +- the
* expirationTime. None of the sources are displayed for exact
* times like everything else in D2D. This forces us to use the
* same Data Population methods the table uses. The only
* difference here is they are done for single sources.
*/
SourceXML source = getPrimarySourceXML();
this.domains = monitor.getRunConfig().getDomains(); this.domains = monitor.getRunConfig().getDomains();
SourceXML source = monitor.getSourceConfig().getSource(
sourceName);
for (int i = 0; i < objects.length; i++) { if (source != null) {
FFMPRecord rec = (FFMPRecord) objects[i];
rec.setExpiration(source.getExpirationMinutes(siteKey)); long oldestTime = availableTimes[0].getRefTime().getTime();
rec.setRate(source.isRate()); long expirationTime = source.getExpirationMinutes(siteKey) * 60 * 1000;
populateRecord(getProduct(), rec, huc); Date standAloneTime = new Date(oldestTime - expirationTime);
NavigableMap<Date, List<String>> sourceURIs = getMonitor()
.getAvailableUris(siteKey, dataKey, sourceName,
standAloneTime);
getMonitor().processUris(sourceURIs, false, siteKey,
sourceName, standAloneTime, "ALL");
} }
} }
} }

View file

@ -34,6 +34,8 @@ import com.raytheon.uf.common.time.TimeRange;
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Jun 3, 2008 1167 mnash Initial creation * Jun 3, 2008 1167 mnash Initial creation
* Sep 3, 2008 1283 njensen Fixed issues * Sep 3, 2008 1283 njensen Fixed issues
* Aug 9, 2012 #1036 dgilling Fixed NullPointerException
* in compareTo().
* *
* </pre> * </pre>
* *
@ -141,7 +143,7 @@ public class SamplerRequest implements Comparable<SamplerRequest> {
* @return * @return
*/ */
public boolean isRefID() { public boolean isRefID() {
if (_areaID != null && _areaID.getName().length() > 0) { if ((_areaID != null) && (!_areaID.getName().isEmpty())) {
return true; return true;
} else { } else {
return false; return false;
@ -154,59 +156,98 @@ public class SamplerRequest implements Comparable<SamplerRequest> {
* @return * @return
*/ */
public boolean isRefArea() { public boolean isRefArea() {
if (_area.getId().getName().length() > 0) { if ((_area != null) && (!_area.getId().getName().isEmpty())) {
return true; return true;
} else { } else {
return false; return false;
} }
} }
/** @Override
* Outputs the class information public int compareTo(SamplerRequest samp) {
* // 1st level - parmID
* @param o int pid = _parmID.compareTo(samp._parmID);
*/ if (pid != 0) {
public String printOn() { return pid;
return "(" + _parmID + "," + _timeRange + "," + _areaID + "," + _area } else {
+ ")"; // 2nd level, time range
int tr = _timeRange.compareTo(samp._timeRange);
if (tr != 0) {
return tr;
} else {
// 3rd level, reference id
String left = (_area != null) ? _area.getId().getName()
: _areaID.getName();
String right = (samp._area != null) ? samp._area.getId()
.getName() : samp._areaID.getName();
return left.compareTo(right);
}
}
} }
@Override @Override
public int compareTo(SamplerRequest samp) { public boolean equals(Object obj) {
int pid = _parmID.compareTo(samp._parmID); if (this == obj) {
if (pid == -1) { return true;
return -1;
} else if (pid == 1) {
return 1;
} else if (pid == 0) {
int tr = _timeRange.compareTo(samp._timeRange);
if (tr == -1) {
return -1;
} else if (tr == 1) {
return 1;
} else if (tr == 0) {
int rid = _area.getId().getName().compareTo(
samp._area.getId().getName());
if (rid == -1) {
return -1;
} else if (rid == 1) {
return 1;
} else if (rid == 0) {
return 0;
}
}
} }
return 0; // should never reach this if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
SamplerRequest other = (SamplerRequest) obj;
if (_area == null) {
if (other._area != null) {
return false;
}
} else if (!_area.equals(other._area)) {
return false;
}
if (_areaID == null) {
if (other._areaID != null) {
return false;
}
} else if (!_areaID.equals(other._areaID)) {
return false;
}
if (_parmID == null) {
if (other._parmID != null) {
return false;
}
} else if (!_parmID.equals(other._parmID)) {
return false;
}
if (_timeRange == null) {
if (other._timeRange != null) {
return false;
}
} else if (!_timeRange.equals(other._timeRange)) {
return false;
}
return true;
} }
@Override
public String toString() { public String toString() {
String s = "SamplerRequest: " + _parmID.getParmName() + " " StringBuilder builder = new StringBuilder();
+ _timeRange.toString() + " "; builder.append("SamplerRequest (");
if (_area != null) { builder.append(_parmID);
s += _area.getId().getName(); builder.append(", ");
} else if (_areaID != null) { builder.append(_timeRange);
s += _areaID.getName(); builder.append(", ");
if (_areaID != null) {
builder.append(_areaID.getName());
} else {
builder.append("null");
} }
return s; builder.append(", ");
if (_area != null) {
builder.append(_area.getId().getName());
} else {
builder.append("null");
}
builder.append(")");
return builder.toString();
} }
} }

View file

@ -95,6 +95,7 @@ import com.vividsolutions.jts.index.strtree.STRtree;
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Feb 8, 2011 mschenke Initial creation * Feb 8, 2011 mschenke Initial creation
* Aug 8, 2012 15271 snaples Updated hourly slot * Aug 8, 2012 15271 snaples Updated hourly slot
* Aug 17, 2012 15271 snaples Added check to add only PP gages
* *
* </pre> * </pre>
* *
@ -122,6 +123,8 @@ public class MPEGageResource extends AbstractMPEInputResource {
private final RGB triangleColor = RGBColors.getRGBColor("YELLOW"); private final RGB triangleColor = RGBColors.getRGBColor("YELLOW");
private final double MILLICVT = 25.4;
private DataMappingPreferences dmPref; private DataMappingPreferences dmPref;
private ColorMap colorMap; private ColorMap colorMap;
@ -175,6 +178,8 @@ public class MPEGageResource extends AbstractMPEInputResource {
gageTriangles = null; gageTriangles = null;
} }
} }
lastDate = displayMgr.getCurrentDate();
addPoints(MPEDataManager.getInstance().readGageData(lastDate, lastDate));
issueRefresh(); issueRefresh();
} }
@ -267,6 +272,7 @@ public class MPEGageResource extends AbstractMPEInputResource {
double lon_2 = in.getDouble(); double lon_2 = in.getDouble();
lon_2 *= (lon_2 > 0) ? -1 : 1; lon_2 *= (lon_2 > 0) ? -1 : 1;
lat_2 *= (lat_2 < 0) ? -1 : 1; lat_2 *= (lat_2 < 0) ? -1 : 1;
compiler.handle(gf.createLineString(new Coordinate[] { compiler.handle(gf.createLineString(new Coordinate[] {
new Coordinate(lon_1, lat_1), new Coordinate(lon_1, lat_1),
new Coordinate(lon_2, lat_2) })); new Coordinate(lon_2, lat_2) }));
@ -422,9 +428,7 @@ public class MPEGageResource extends AbstractMPEInputResource {
// Check for pseudo gage and convert // Check for pseudo gage and convert
float fltVal = gageData.getGval(); float fltVal = gageData.getGval();
if (gageData.getId().contains("PSEUDO")) { if (gageData.getId().contains("PSEUDO")) {
UnitConverter conv = SI.MILLIMETER fltVal = (float) (gageData.getGval() / MILLICVT);
.getConverterTo(NonSI.INCH);
fltVal = (float) conv.convert(gageData.getGval());
} }
// System.out.println("--- fltVal = " + fltVal); // System.out.println("--- fltVal = " + fltVal);
gageColor = getColorByValue(fltVal); gageColor = getColorByValue(fltVal);
@ -452,6 +456,9 @@ public class MPEGageResource extends AbstractMPEInputResource {
for (ListIterator<MPEGageData> it = gages.listIterator(); it for (ListIterator<MPEGageData> it = gages.listIterator(); it
.hasNext();) { .hasNext();) {
MPEGageData gageData = it.next(); MPEGageData gageData = it.next();
if (!gageData.getPe().equalsIgnoreCase("PP")) {
continue;
}
Coordinate latLon = gageData.getLatLon(); Coordinate latLon = gageData.getLatLon();
double[] pixel = descriptor.worldToPixel(new double[] { double[] pixel = descriptor.worldToPixel(new double[] {
latLon.x, latLon.y }); latLon.x, latLon.y });
@ -463,8 +470,9 @@ public class MPEGageResource extends AbstractMPEInputResource {
Envelope env = new Envelope(p1, p2); Envelope env = new Envelope(p1, p2);
ArrayList<Object> data = new ArrayList<Object>(); ArrayList<Object> data = new ArrayList<Object>();
data.add(latLon); data.add(latLon);
data.add("GAGE: " + gageData.getId() + " VALUE: " String newData = "GAGE: " + gageData.getId() + " VALUE: "
+ gageData.getGval()); + gageData.getGval();
data.add(newData);
strTree.insert(env, data); strTree.insert(env, data);
} }
} }

View file

@ -19,6 +19,13 @@
further_licensing_information. further_licensing_information.
--> -->
<menuTemplate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <menuTemplate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<contribute xsi:type="bundleItem" file="bundles/DefaultSatellite.xml"
menuText="Blended Rain Rate" id="rainfallRate">
<dataURI>/satellite/%/NESDIS/POES-NPOESS/Supernational/Rain_fall_rate</dataURI>
<substitute key="element" value="Rain fall rate"/>
<substitute key="entity" value="POES-NPOESS"/>
<substitute key="colormap" value="Sat/VIS/ZA (Vis Default)"/>
</contribute>
<contribute xsi:type="titleItem" titleText="------ GOES ------" <contribute xsi:type="titleItem" titleText="------ GOES ------"
id="GOESLine"/> id="GOESLine"/>
<contribute xsi:type="bundleItem" file="bundles/DefaultSatellite.xml" <contribute xsi:type="bundleItem" file="bundles/DefaultSatellite.xml"
@ -66,13 +73,6 @@
<substitute key="colormap" value="Sat/Low Cloud Base" /> <substitute key="colormap" value="Sat/Low Cloud Base" />
</contribute> </contribute>
<contribute xsi:type="titleItem" titleText="------ DMSP SSM/I ------" id="DMSPLine"/> <contribute xsi:type="titleItem" titleText="------ DMSP SSM/I ------" id="DMSPLine"/>
<contribute xsi:type="bundleItem" file="bundles/DefaultSatellite.xml"
menuText="Rainfall Rate" id="rainfallRate">
<dataURI>/satellite/%/NESDIS/DMSP/Supernational/Rain_fall_rate</dataURI>
<substitute key="element" value="Rain fall rate"/>
<substitute key="entity" value="DMSP"/>
<substitute key="colormap" value="Sat/VIS/ZA (Vis Default)"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultSatellite.xml" <contribute xsi:type="bundleItem" file="bundles/DefaultSatellite.xml"
menuText="Total Precip Water" id="totalPrecipWater"> menuText="Total Precip Water" id="totalPrecipWater">
<dataURI>/satellite/%/NESDIS/DMSP/Supernational/Sounder_Based_Derived_Precipitable_Water_(PW)</dataURI> <dataURI>/satellite/%/NESDIS/DMSP/Supernational/Sounder_Based_Derived_Precipitable_Water_(PW)</dataURI>
@ -81,13 +81,6 @@
<substitute key="colormap" value="Sat/Precip Water/Precip Water - Polar)"/> <substitute key="colormap" value="Sat/Precip Water/Precip Water - Polar)"/>
</contribute> </contribute>
<contribute xsi:type="titleItem" titleText="------ POES AMSU ------" id="POESAMSULine"/> <contribute xsi:type="titleItem" titleText="------ POES AMSU ------" id="POESAMSULine"/>
<contribute xsi:type="bundleItem" file="bundles/DefaultSatellite.xml"
menuText="Rainfall Rate" id="rainfallRate">
<dataURI>/satellite/%/NESDIS/POES-NPOESS/Supernational/Rain_fall_rate</dataURI>
<substitute key="element" value="Rain fall rate"/>
<substitute key="entity" value="POES-NPOESS"/>
<substitute key="colormap" value="Sat/VIS/ZA (Vis Default)"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/DefaultSatellite.xml" <contribute xsi:type="bundleItem" file="bundles/DefaultSatellite.xml"
menuText="Total Precip Water" id="totalPrecipWater"> menuText="Total Precip Water" id="totalPrecipWater">
<dataURI>/satellite/%/NESDIS/POES-NPOESS/Supernational/Sounder_Based_Derived_Precipitable_Water_(PW)</dataURI> <dataURI>/satellite/%/NESDIS/POES-NPOESS/Supernational/Sounder_Based_Derived_Precipitable_Water_(PW)</dataURI>
@ -111,4 +104,4 @@
<substitute key="entity" value="Miscellaneous"/> <substitute key="entity" value="Miscellaneous"/>
<substitute key="colormap" value="Sat/Precip Water/Percent of Normal TPW"/> <substitute key="colormap" value="Sat/Precip Water/Percent of Normal TPW"/>
</contribute> </contribute>
</menuTemplate> </menuTemplate>

View file

@ -151,7 +151,12 @@ public class SatelliteConstants {
} else if(creatingEntity.equals(DMSP)){ } else if(creatingEntity.equals(DMSP)){
rVal = "DMSP SSM/I " + rVal; rVal = "DMSP SSM/I " + rVal;
} else if(creatingEntity.equals(POES)){ } else if(creatingEntity.equals(POES)){
rVal = "POES AMSU " + rVal; if (productName.equals("Rain fall rate")) {
rVal = "Blended Rain Rate (mm/hr)";
}
else {
rVal = "POES AMSU " + rVal;
}
} else if(creatingEntity.equals(MISC)){ } else if(creatingEntity.equals(MISC)){
rVal = "Blended " + rVal; rVal = "Blended " + rVal;
} }

View file

@ -158,6 +158,7 @@ import com.raytheon.viz.texteditor.command.CommandFailedException;
import com.raytheon.viz.texteditor.command.CommandHistory; import com.raytheon.viz.texteditor.command.CommandHistory;
import com.raytheon.viz.texteditor.command.CommandType; import com.raytheon.viz.texteditor.command.CommandType;
import com.raytheon.viz.texteditor.command.ICommand; import com.raytheon.viz.texteditor.command.ICommand;
import com.raytheon.viz.texteditor.dialogs.WarnGenConfirmationDlg.SessionDelegate;
import com.raytheon.viz.texteditor.fax.dialogs.FaxMessageDlg; import com.raytheon.viz.texteditor.fax.dialogs.FaxMessageDlg;
import com.raytheon.viz.texteditor.fax.dialogs.LdadFaxSitesDlg; import com.raytheon.viz.texteditor.fax.dialogs.LdadFaxSitesDlg;
import com.raytheon.viz.texteditor.msgs.IAfosBrowserCallback; import com.raytheon.viz.texteditor.msgs.IAfosBrowserCallback;
@ -281,7 +282,8 @@ import com.raytheon.viz.ui.dialogs.SWTMessageBox;
* 06/19/2012 14975 D.Friedman Prevent zeroed-out WMO header times. * 06/19/2012 14975 D.Friedman Prevent zeroed-out WMO header times.
* 18JUL2012 14457 rferrel Add mouse listener to clear site's update obs when clicked on. * 18JUL2012 14457 rferrel Add mouse listener to clear site's update obs when clicked on.
* 25JUL2012 14459 rferrel Strip WMH headers when getting all METARs. * 25JUL2012 14459 rferrel Strip WMH headers when getting all METARs.
* 13AUG2012 14613 M.Gamazaychikov Ensured the WMO and MND header times are the same. * 13AUG2012 14613 M.Gamazaychikov Ensured the WMO and MND header times are the same.
* 20AUG2012 15340 D.Friedman Use callbacks for stop sign dialog. Prevent NOR in header.
* </pre> * </pre>
* *
* @author lvenable * @author lvenable
@ -4358,43 +4360,50 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
* @param resend * @param resend
* true if product is to be resent * true if product is to be resent
*/ */
synchronized private void sendProduct(boolean resend) { synchronized private void sendProduct(final boolean resend) {
CAVEMode mode = CAVEMode.getMode(); final CAVEMode mode = CAVEMode.getMode();
StdTextProduct prod = getStdTextProduct(); StdTextProduct prod = getStdTextProduct();
String afosId = prod.getCccid() + prod.getNnnid() + prod.getXxxid(); String afosId = prod.getCccid() + prod.getNnnid() + prod.getXxxid();
String title = QualityControl.getProductWarningType(prod.getNnnid()); final String title = QualityControl.getProductWarningType(prod.getNnnid());
StringBuilder productMessage = new StringBuilder(); final StringBuilder productMessage = new StringBuilder();
StringBuilder modeMessage = new StringBuilder(); final StringBuilder modeMessage = new StringBuilder();
modeMessage.append("The workstation is in ").append(mode) modeMessage.append("The workstation is in ").append(mode)
.append(" mode."); .append(" mode.");
if (resend) { if (resend) {
productMessage = new StringBuilder();
productMessage.append("You are about to RESEND a " + afosId + "\n"); productMessage.append("You are about to RESEND a " + afosId + "\n");
productMessage.append(title).append(".\n"); productMessage.append(title).append(".\n");
modeMessage.append("\nThere is no QC check for resend product."); modeMessage.append("\nThere is no QC check for resend product.");
} else if (warnGenFlag) { } else if (warnGenFlag) {
productMessage.append("You are about to SEND a " + afosId + "\n");
productMessage.append(title).append(".\n");
QualityControl qcCheck = new QualityControl(); QualityControl qcCheck = new QualityControl();
if (qcCheck.checkWarningInfo(headerTF.getText().toUpperCase(), if (qcCheck.checkWarningInfo(headerTF.getText().toUpperCase(),
textEditor.getText().toUpperCase(), prod.getNnnid()) == false) { textEditor.getText().toUpperCase(), prod.getNnnid()) == false) {
WarnGenConfirmationDlg wgcd = new WarnGenConfirmationDlg(shell, WarnGenConfirmationDlg wgcd = new WarnGenConfirmationDlg(shell,
"Problem Detected by QC", qcCheck.getErrorMessage(), "Problem Detected by QC", qcCheck.getErrorMessage(),
"Do you really want to Send?\n", mode); "Do you really want to Send?\n", mode);
wgcd.open(); wgcd.open(new SessionDelegate() {
if (!Boolean.TRUE.equals(wgcd.getReturnValue())) { @Override
return; public void dialogDismissed(Object dialogResult) {
} if (Boolean.TRUE.equals(dialogResult))
finishSendProduct1(resend, title, mode, productMessage, modeMessage);
}
});
return;
} }
productMessage.append("You are about to SEND a " + afosId + "\n");
productMessage.append(title).append(".\n");
} }
finishSendProduct1(resend, title, mode, productMessage, modeMessage);
}
private void finishSendProduct1(final boolean resend, String title, CAVEMode mode, StringBuilder productMessage, StringBuilder modeMessage) {
Pattern p = Pattern.compile(".\\%[s]."); Pattern p = Pattern.compile(".\\%[s].");
Matcher m = p.matcher(STORED_SENT_MSG); Matcher m = p.matcher(STORED_SENT_MSG);
boolean result = (CAVEMode.OPERATIONAL.equals(mode) || CAVEMode.TEST final boolean result = (CAVEMode.OPERATIONAL.equals(mode) || CAVEMode.TEST
.equals(mode)); .equals(mode));
modeMessage.append(result ? m.replaceAll(" ") : m.replaceAll(" not ")); modeMessage.append(result ? m.replaceAll(" ") : m.replaceAll(" not "));
@ -4423,11 +4432,16 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
WarnGenConfirmationDlg wgcd = new WarnGenConfirmationDlg(shell, title, WarnGenConfirmationDlg wgcd = new WarnGenConfirmationDlg(shell, title,
productMessage.toString(), modeMessage.toString(), mode); productMessage.toString(), modeMessage.toString(), mode);
wgcd.open(); wgcd.open(new SessionDelegate() {
@Override
public void dialogDismissed(Object dialogResult) {
if (Boolean.TRUE.equals(dialogResult))
finishSendProduct2(resend, result);
}
});
}
if (!Boolean.TRUE.equals(wgcd.getReturnValue())) { private void finishSendProduct2(boolean resend, boolean result) {
return;
}
// DR14553 (make upper case in product) // DR14553 (make upper case in product)
String body = textEditor.getText().toUpperCase(); String body = textEditor.getText().toUpperCase();
@ -4450,7 +4464,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
token); token);
OUPRequest req = new OUPRequest(); OUPRequest req = new OUPRequest();
OfficialUserProduct oup = new OfficialUserProduct(); OfficialUserProduct oup = new OfficialUserProduct();
prod = getStdTextProduct(); StdTextProduct prod = getStdTextProduct(); // TODO: makes me nervous...
String awipsWanPil = prod.getSite() + prod.getNnnid() String awipsWanPil = prod.getSite() + prod.getNnnid()
+ prod.getXxxid(); + prod.getXxxid();
String awipsID = prod.getNnnid() + prod.getXxxid(); String awipsID = prod.getNnnid() + prod.getXxxid();
@ -4462,7 +4476,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
oup.setNeedsWmoHeader(false); oup.setNeedsWmoHeader(false);
oup.setProductText(product); oup.setProductText(product);
oup.setSource("TextWS"); oup.setSource("TextWS");
oup.setWmoType(prod.getBbbid()); oup.setWmoType(fixNOR(prod.getBbbid()));
oup.setUserDateTimeStamp(prod.getHdrtime()); oup.setUserDateTimeStamp(prod.getHdrtime());
oup.setFilename(awipsID + ".wan" oup.setFilename(awipsID + ".wan"
+ (System.currentTimeMillis() / 1000)); + (System.currentTimeMillis() / 1000));
@ -4872,7 +4886,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
StdTextProductServerRequest request = new StdTextProductServerRequest(); StdTextProductServerRequest request = new StdTextProductServerRequest();
request.setBbbid(product.getBbbid()); request.setBbbid(fixNOR(product.getBbbid()));
request.setCccid(product.getCccid()); request.setCccid(product.getCccid());
request.setCreatetime(product.getRefTime()); request.setCreatetime(product.getRefTime());
request.setDataCrc(product.getDataCrc()); request.setDataCrc(product.getDataCrc());
@ -5182,7 +5196,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
} }
public void setCurrentBbbId(String bbbId) { public void setCurrentBbbId(String bbbId) {
TextDisplayModel.getInstance().setBbbId(token, bbbId); TextDisplayModel.getInstance().setBbbId(token, fixNOR(bbbId));
} }
public void setCurrentWsfoId(String wsfoId) { public void setCurrentWsfoId(String wsfoId) {
@ -7279,4 +7293,11 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
job.setSystem(true); job.setSystem(true);
job.schedule(); job.schedule();
} }
private static String fixNOR(String bbb) {
if ("NOR".equals(bbb))
return "";
else
return bbb;
}
} }

View file

@ -23,6 +23,8 @@ package com.raytheon.viz.texteditor.dialogs;
import java.io.InputStream; import java.io.InputStream;
import org.eclipse.swt.SWT; import org.eclipse.swt.SWT;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Image; import org.eclipse.swt.graphics.Image;
@ -48,6 +50,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
* 27Jul2010 4773 cjeanbap Initial development * 27Jul2010 4773 cjeanbap Initial development
* 10Aug2010 2187 cjeanbap Removed warnGenFlag. * 10Aug2010 2187 cjeanbap Removed warnGenFlag.
* 10Nov2011 11552 rferrel returnvalue no longer null * 10Nov2011 11552 rferrel returnvalue no longer null
* 08/20/2012 DR 15340 D. Friedman Use callbacks for closing
* *
* </pre> * </pre>
* *
@ -66,10 +69,17 @@ public class WarnGenConfirmationDlg extends CaveSWTDialog {
private String IMAGE_TEST = "res/images/twsTest.gif"; private String IMAGE_TEST = "res/images/twsTest.gif";
private String IMAGE_PRACTICE = "res/images/twsPractice.gif"; private String IMAGE_PRACTICE = "res/images/twsPractice.gif";
public static interface SessionDelegate {
void dialogDismissed(Object result);
}
private SessionDelegate sessionDelegate;
protected WarnGenConfirmationDlg(Shell parentShell, String title, protected WarnGenConfirmationDlg(Shell parentShell, String title,
String productMessage, String modeMessage, CAVEMode mode) { String productMessage, String modeMessage, CAVEMode mode) {
super(parentShell, SWT.DIALOG_TRIM, CAVE.NONE); super(parentShell, SWT.DIALOG_TRIM | SWT.PRIMARY_MODAL,
CAVE.NONE | CAVE.DO_NOT_BLOCK);
setText(title); setText(title);
@ -78,6 +88,13 @@ public class WarnGenConfirmationDlg extends CaveSWTDialog {
this.mode = mode; this.mode = mode;
setReturnValue(Boolean.FALSE); setReturnValue(Boolean.FALSE);
} }
public void open(SessionDelegate sessionDelegate) {
if (sessionDelegate != null && isOpen())
throw new RuntimeException(String.format("Dialog \"%s\" already open", getText()));
this.sessionDelegate = sessionDelegate;
super.open();
}
@Override @Override
protected void initializeComponents(Shell shell) { protected void initializeComponents(Shell shell) {
@ -86,7 +103,13 @@ public class WarnGenConfirmationDlg extends CaveSWTDialog {
createImage(mainComposite); createImage(mainComposite);
createMessageLabel(mainComposite); createMessageLabel(mainComposite);
createButtonRow(mainComposite); createButtonRow(mainComposite);
shell.addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(DisposeEvent e) {
if (sessionDelegate != null)
sessionDelegate.dialogDismissed(getReturnValue());
}
});
} }
private void createImage(Composite mainComposite) { private void createImage(Composite mainComposite) {

View file

@ -1,28 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.jboss.cache</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View file

@ -1,5 +1,6 @@
package com.raytheon.uf.common.dataplugin.ffmp; package com.raytheon.uf.common.dataplugin.ffmp;
import java.util.ArrayList;
import java.util.Comparator; import java.util.Comparator;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
@ -99,6 +100,28 @@ public class FFMPGuidanceBasin extends FFMPBasin implements ISerializableObject
return Float.NaN; return Float.NaN;
} }
} }
/**
* purge out old entries
*
* @param date
*/
public void purgeData(Date date) {
if (guidValues != null) {
synchronized (guidValues) {
ArrayList<Date> removes = new ArrayList<Date>();
for (Date mdate : guidValues.keySet()) {
if (mdate.before(date)) {
removes.add(mdate);
}
}
for (Date rdate : removes) {
guidValues.remove(rdate);
}
}
}
}
/** /**
* Check for a source, only recent date * Check for a source, only recent date
@ -155,7 +178,7 @@ public class FFMPGuidanceBasin extends FFMPBasin implements ISerializableObject
return val; return val;
} }
/** /**
* Gets a Value for a FFG source * Gets a Value for a FFG source
* *
@ -188,8 +211,13 @@ public class FFMPGuidanceBasin extends FFMPBasin implements ISerializableObject
FFMPGuidanceInterpolation interpolation, long expiration) { FFMPGuidanceInterpolation interpolation, long expiration) {
Float dvalue = Float.NaN; Float dvalue = Float.NaN;
Float value = getValue(date, sourceName); Float value = Float.NaN;
Date closestDate = getClosest(sourceName, date, expiration);
if (closestDate != null) {
value = getValue(closestDate, sourceName);
}
if (!value.isNaN()) { if (!value.isNaN()) {
FFFGDataMgr dman = FFFGDataMgr.getInstance(); FFFGDataMgr dman = FFFGDataMgr.getInstance();
if (dman.isExpired() == false) { if (dman.isExpired() == false) {
@ -220,6 +248,7 @@ public class FFMPGuidanceBasin extends FFMPBasin implements ISerializableObject
Date markerDate = guidValues.firstKey(); Date markerDate = guidValues.firstKey();
for (Date checkDate : guidValues.keySet()) { for (Date checkDate : guidValues.keySet()) {
if (guidValues.get(checkDate).containsKey(sourceName)) { if (guidValues.get(checkDate).containsKey(sourceName)) {
float val = guidValues.get(checkDate).get(sourceName); float val = guidValues.get(checkDate).get(sourceName);
if (val != FFMPUtils.MISSING) { if (val != FFMPUtils.MISSING) {
@ -230,7 +259,7 @@ public class FFMPGuidanceBasin extends FFMPBasin implements ISerializableObject
if ((time1 - time2) < expiration) { if ((time1 - time2) < expiration) {
rdate = checkDate; rdate = checkDate;
} }
break; break;
} }
} }
} }
@ -238,6 +267,68 @@ public class FFMPGuidanceBasin extends FFMPBasin implements ISerializableObject
return rdate; return rdate;
} }
/**
* Get Youngest Key
*
* @param sourceName
* @param Date
* @param expiration
* @return
*/
public Date getClosest(String sourceName, Date date, long expiration) {
Date rdate = null;
if (guidValues != null && guidValues.size() > 0) {
if (guidValues.containsKey(date)) {
if (guidValues.get(date).containsKey(sourceName)) {
float val = guidValues.get(date).get(sourceName);
if (val != FFMPUtils.MISSING) {
rdate = date;
}
}
}
if (rdate == null) {
long time1 = date.getTime();
for (Date checkDate : guidValues.descendingKeySet()) {
if (guidValues.get(checkDate).containsKey(sourceName)) {
float val2 = guidValues.get(checkDate).get(sourceName);
if (val2 != FFMPUtils.MISSING) {
long time2 = checkDate.getTime();
// as long as it is +- expiration from orig date,
// golden
if (date.after(checkDate)) {
if ((time1 - time2) > expiration) {
rdate = checkDate;
break;
}
} else {
if ((time2 - time1) > expiration) {
rdate = checkDate;
break;
}
}
rdate = checkDate;
break;
}
}
}
}
}
return rdate;
}
/** /**
* Interpolate between guidance sources * Interpolate between guidance sources

View file

@ -19,13 +19,16 @@
**/ **/
package com.raytheon.uf.common.dataplugin.persist; package com.raytheon.uf.common.dataplugin.persist;
import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.Inheritance; import javax.persistence.Inheritance;
import javax.persistence.InheritanceType; import javax.persistence.InheritanceType;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
/** /**
* Provides an abstract implementation of plugindataobject with clustered file * Provides an abstract implementation of plugindataobject with clustered file
@ -37,7 +40,8 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Dec 16, 2008 chammack Initial creation * Dec 16, 2008 chammack Initial creation
* * - AWIPS2 Baseline Repository --------
* 08/22/2012 798 jkorman Corrected hdfFileId persistence.
* </pre> * </pre>
* *
* @author chammack * @author chammack
@ -52,6 +56,9 @@ public abstract class ServerSpecificPersistablePluginDataObject extends
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@XmlAttribute
@DynamicSerializeElement
@Column
private Integer hdfFileId; private Integer hdfFileId;
/** /**

View file

@ -40,6 +40,7 @@ import com.raytheon.uf.edex.dissemination.transmitted.TransmittedProductList;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Nov 13, 2009 njensen Initial creation * Nov 13, 2009 njensen Initial creation
* 08/20/2012 DR 15340 D. Friedman Fix BBB problems
* *
* </pre> * </pre>
* *
@ -124,7 +125,8 @@ public class ModifyProduct {
sb.append(DDHHMM.format(new Date())); sb.append(DDHHMM.format(new Date()));
} }
} }
if (req.getProduct().getWmoType() != null) { if (req.getProduct().getWmoType() != null
&& req.getProduct().getWmoType().length() > 0) {
sb.append(" "); sb.append(" ");
sb.append(req.getProduct().getWmoType()); sb.append(req.getProduct().getWmoType());
} }
@ -173,6 +175,7 @@ public class ModifyProduct {
product.setProductText(sb.toString()); product.setProductText(sb.toString());
changed = true; changed = true;
} }
header.setBbb(productBBB);
} }
product.setWmoType(productBBB); product.setWmoType(productBBB);

View file

@ -36,6 +36,7 @@ import com.raytheon.uf.edex.dissemination.StatusConstants;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Nov 10, 2009 njensen Initial creation * Nov 10, 2009 njensen Initial creation
* 08/20/2012 DR 15340 D. Friedman Fix BBB problems
* *
* </pre> * </pre>
* *
@ -83,7 +84,7 @@ public class TransmittedProductList {
} }
private static String assignBBB(String productBBB, String transmittedBBB) { private static String assignBBB(String productBBB, String transmittedBBB) {
if (transmittedBBB == null) if (transmittedBBB == null || transmittedBBB.length() == 0)
return "RRA"; return "RRA";
String newBBB = null; String newBBB = null;
@ -91,7 +92,7 @@ public class TransmittedProductList {
if (newX[0] == 'X') { if (newX[0] == 'X') {
newX[0] = 'A'; newX[0] = 'A';
} else { } else {
newX[0] = newX[0]++; newX[0]++;
} }
newBBB = transmittedBBB.substring(0, 2) + new String(newX); newBBB = transmittedBBB.substring(0, 2) + new String(newX);

View file

@ -32,10 +32,11 @@
# 12/09/09 DR3778 M. Huang Add acknowledgment handling # 12/09/09 DR3778 M. Huang Add acknowledgment handling
# 09/05/11 DR9602 M. Huang Fix acknowledgment handling error # 09/05/11 DR9602 M. Huang Fix acknowledgment handling error
# 04/13/12 DR 10388 D. Friedman Correct acknowledgment handling # 04/13/12 DR 10388 D. Friedman Correct acknowledgment handling
# 08/17/12 DR 15304 D. Friedman Use unique output file names
# #
# #
import time, os, os.path, sys, subprocess, select import time, os, os.path, sys, subprocess, select, errno
import logging, UFStatusHandler import logging, UFStatusHandler
from com.raytheon.uf.common.dissemination import OUPResponse from com.raytheon.uf.common.dissemination import OUPResponse
_Logger = logging.getLogger("HandleOUP") _Logger = logging.getLogger("HandleOUP")
@ -126,8 +127,9 @@ def process(oup, afosID, resp, ackMgr = None):
#---------- #----------
# Locally store OUP in text database and archive # Locally store OUP in text database and archive
#---------- #----------
awipsPathname = OUT_DIR + '/' + oup.getFilename() awipsPathname = createTargetFile(contents,
if not createTargetFile(contents, awipsPathname): OUT_DIR + '/' + oup.getFilename())
if not awipsPathname:
_Logger.debug('Unable to store product to text database:') _Logger.debug('Unable to store product to text database:')
storageCompleted = DB_FAILURE storageCompleted = DB_FAILURE
msg = 'Product ' + awipsWanPil + ' failed to be ingested and archived.\n' msg = 'Product ' + awipsWanPil + ' failed to be ingested and archived.\n'
@ -499,9 +501,8 @@ def isNWWSProduct(myAwipsId, myAfosId, myWmoId, siteID):
# product contents # product contents
# target product pathname (Output) # target product pathname (Output)
# #
# Returns: # Returns:
# 1 (TRUE) = target product successfully created # The output path (which may differ from targetPathname)
# 0 (FALSE) = target product creation failed
# #
# Implementation: # Implementation:
# #
@ -509,13 +510,27 @@ def isNWWSProduct(myAwipsId, myAfosId, myWmoId, siteID):
def createTargetFile(fileData, targetPathname): def createTargetFile(fileData, targetPathname):
_Logger.debug('createTargetFile():') _Logger.debug('createTargetFile():')
_Logger.debug('target product pathname = ' + targetPathname) _Logger.debug('target product pathname = ' + targetPathname)
pathToUse = targetPathname
i = 0
while True:
try:
fd = os.open(pathToUse, os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0666)
except OSError, e:
if e.errno == errno.EEXIST:
i += 1
pathToUse = targetPathname + '.' + str(i)
continue
raise e
else:
break
if i > 0:
_Logger.info('Renamed target file to ' + pathToUse)
outFile = open(targetPathname, 'w') outFile = os.fdopen(fd, 'w')
outFile.write(fileData) outFile.write(fileData)
outFile.flush() outFile.flush()
outFile.close() outFile.close()
return True return pathToUse

View file

@ -170,7 +170,7 @@ public class FFMPGenerator extends CompositeProductGenerator implements
public ArrayList<String> loadedData = new ArrayList<String>(); public ArrayList<String> loadedData = new ArrayList<String>();
/** thread the productkeys **/ /** thread the productkeys **/
public HashMap<String, ArrayList<String>> productKeys = new HashMap<String, ArrayList<String>>(); public ConcurrentHashMap<String, ArrayList<String>> productKeys = new ConcurrentHashMap<String, ArrayList<String>>();
/** template config manager **/ /** template config manager **/
public FFMPTemplateConfigurationManager tempConfig = null; public FFMPTemplateConfigurationManager tempConfig = null;
@ -510,7 +510,7 @@ public class FFMPGenerator extends CompositeProductGenerator implements
+ " ms, wrote " + records.size() + " "); + " ms, wrote " + records.size() + " ");
} else { } else {
statusHandler.handle(Priority.INFO, config.getCWA() statusHandler.handle(Priority.WARN, config.getCWA()
+ " no new products to produce."); + " no new products to produce.");
} }
// dump data we don't need anymore // dump data we don't need anymore
@ -1371,12 +1371,9 @@ public class FFMPGenerator extends CompositeProductGenerator implements
source, ffmpRec.getBasinData(huc), huc, source, ffmpRec.getBasinData(huc), huc,
ffmpRec.getSiteKey()); ffmpRec.getSiteKey());
} }
// purge it up
fdc.purge(backDate);
// set the name // set the name
fdc.setFilePath("" + sharePath + ffmpRec.getWfo() + "/" fdc.setFilePath("" + sharePath + ffmpRec.getWfo() + "/"
+ sourceSiteDataKey); + sourceSiteDataKey);
// cache it temporarily for FFTI use // cache it temporarily for FFTI use
if (source.getSourceType().equals( if (source.getSourceType().equals(
SOURCE_TYPE.GUIDANCE.getSourceType())) { SOURCE_TYPE.GUIDANCE.getSourceType())) {
@ -1396,7 +1393,7 @@ public class FFMPGenerator extends CompositeProductGenerator implements
+ (System.currentTimeMillis() - ptime) + (System.currentTimeMillis() - ptime)
+ " ms: source: " + sourceSiteDataKey); + " ms: source: " + sourceSiteDataKey);
} catch (Exception e) { } catch (Exception e) {
statusHandler.handle(Priority.INFO, statusHandler.handle(Priority.ERROR,
"Failed Processing FFMPDataContainer" + e.getMessage()); "Failed Processing FFMPDataContainer" + e.getMessage());
} finally { } finally {
@ -1413,10 +1410,20 @@ public class FFMPGenerator extends CompositeProductGenerator implements
} }
} }
} }
// purge it up
if (write) { if (fdc != null) {
// write it out // this is defensive for if errors get thrown
writeLoaderBuddyFiles(fdc); if (backDate == null) {
backDate = new Date((System.currentTimeMillis())
- (3600 * 1000 * 6));
}
fdc.purge(backDate);
if (write) {
// write it out
writeLoaderBuddyFiles(fdc);
}
} }
} }
} }
@ -1624,6 +1631,10 @@ public class FFMPGenerator extends CompositeProductGenerator implements
statusHandler.handle(Priority.ERROR, statusHandler.handle(Priority.ERROR,
"IO Error Writing buddy file: " "IO Error Writing buddy file: "
+ e.getMessage()); + e.getMessage());
} catch (Exception e) {
statusHandler.handle(Priority.ERROR,
"General Error Writing buddy file: "
+ e.getMessage());
} finally { } finally {
if (os != null) { if (os != null) {
os.close(); os.close();
@ -1643,7 +1654,17 @@ public class FFMPGenerator extends CompositeProductGenerator implements
try { try {
for (String tmpName : fileNames.keySet()) { for (String tmpName : fileNames.keySet()) {
File file = new File(tmpName); File file = new File(tmpName);
file.renameTo(new File(fileNames.get(tmpName))); if (file.renameTo(new File(fileNames.get(tmpName)))) {
statusHandler
.handle(Priority.DEBUG,
"Successful rename: : "
+fileNames.get(tmpName));
} else {
statusHandler
.handle(Priority.ERROR,
"UN-Successful rename: : "
+fileNames.get(tmpName));
}
} }
if (lockfile.exists()) { if (lockfile.exists()) {
@ -1849,13 +1870,16 @@ public class FFMPGenerator extends CompositeProductGenerator implements
.file2bytes(f.getFile(), true)); .file2bytes(f.getFile(), true));
} catch (FileNotFoundException fnfe) { } catch (FileNotFoundException fnfe) {
statusHandler.handle(Priority.ERROR, statusHandler.handle(Priority.ERROR,
"Unable to locate file " + f.getName()); "Unable to locate file " + f.getName(), fnfe);
} catch (SerializationException se) { } catch (SerializationException se) {
statusHandler.handle(Priority.ERROR, statusHandler.handle(Priority.ERROR,
"Unable to read file " + f.getName()); "Unable to serialize file " + f.getName(), se);
} catch (IOException ioe) { } catch (IOException ioe) {
statusHandler.handle(Priority.ERROR, statusHandler.handle(Priority.ERROR,
"Unable to read file " + f.getName()); "IO problem reading file " + f.getName(), ioe);
} catch (Exception e) {
statusHandler.handle(Priority.ERROR,
"General Exception reading file " + f.getName(), e);
} }
return ffti; return ffti;

View file

@ -205,7 +205,7 @@ mask=ISC_Send_Area
# Parameter list for the netcdf file # Parameter list for the netcdf file
parmlist="" #send all parameters parmlist="" #send all parameters
. ${IFPS_DATA}/rsync_parms.${1} . ${IFPS_DATA}/rsync_parms.${site}
creationAttempts=3 # How many times do you want script to create and creationAttempts=3 # How many times do you want script to create and
# quality control netcdf files if bad netcdf files # quality control netcdf files if bad netcdf files
@ -272,7 +272,7 @@ find ${WRKDIR}/. -mmin +60 -exec rm {} -f \;
echo ...finished. >> $LOG_FILE echo ...finished. >> $LOG_FILE
echo " " >> $LOG_FILE echo " " >> $LOG_FILE
if [ "$parmlist" != "" ]; then if [ "$parmlist" != "" ] && [ "$parmlist" != " " ]; then
echo "Will trim elements to $parmlist" >> $LOG_FILE echo "Will trim elements to $parmlist" >> $LOG_FILE
else else
echo "Will send all elements" >> $LOG_FILE echo "Will send all elements" >> $LOG_FILE

View file

@ -59,6 +59,12 @@
* __END_OF_JASPER_LICENSE__ * __END_OF_JASPER_LICENSE__
*/ */
/*
August 20, 2012
Modified by Raytheon (c) 2012 Raytheon Company. All Rights Reserved.
This file modified for 64-bit compatibility
*/
/* /*
* Color Management * Color Management
* *

View file

@ -59,6 +59,13 @@
* __END_OF_JASPER_LICENSE__ * __END_OF_JASPER_LICENSE__
*/ */
/*
August 20, 2012
Modified by Raytheon (c) 2012 Raytheon Company. All Rights Reserved.
This file modified for 64-bit compatibility
*/
#include <assert.h> #include <assert.h>
#include <jasper/jas_config.h> #include <jasper/jas_config.h>
#include <jasper/jas_types.h> #include <jasper/jas_types.h>

View file

@ -61,6 +61,13 @@
* __END_OF_JASPER_LICENSE__ * __END_OF_JASPER_LICENSE__
*/ */
/*
August 20, 2012
Modified by Raytheon (c) 2012 Raytheon Company. All Rights Reserved.
This file modified for 64-bit compatibility
*/
/* /*
* Image Library * Image Library
* *

View file

@ -61,6 +61,13 @@
* __END_OF_JASPER_LICENSE__ * __END_OF_JASPER_LICENSE__
*/ */
/*
August 20, 2012
Modified by Raytheon (c) 2012 Raytheon Company. All Rights Reserved.
This file modified for 64-bit compatibility
*/
/* /*
* Memory Allocator * Memory Allocator
* *

View file

@ -61,6 +61,13 @@
* __END_OF_JASPER_LICENSE__ * __END_OF_JASPER_LICENSE__
*/ */
/*
August 20, 2012
Modified by Raytheon (c) 2012 Raytheon Company. All Rights Reserved.
This file modified for 64-bit compatibility
*/
/* /*
* Sequence/Matrix Library * Sequence/Matrix Library
* *

View file

@ -61,6 +61,13 @@
* __END_OF_JASPER_LICENSE__ * __END_OF_JASPER_LICENSE__
*/ */
/*
August 20, 2012
Modified by Raytheon (c) 2012 Raytheon Company. All Rights Reserved.
This file modified for 64-bit compatibility
*/
/* /*
* I/O Stream Library * I/O Stream Library
* *

View file

@ -61,6 +61,13 @@
* __END_OF_JASPER_LICENSE__ * __END_OF_JASPER_LICENSE__
*/ */
/*
August 20, 2012
Modified by Raytheon (c) 2012 Raytheon Company. All Rights Reserved.
This file modified for 64-bit compatibility
*/
/* /*
* Windows Bitmap File Library * Windows Bitmap File Library
* *

View file

@ -61,6 +61,13 @@
* __END_OF_JASPER_LICENSE__ * __END_OF_JASPER_LICENSE__
*/ */
/*
August 20, 2012
Modified by Raytheon (c) 2012 Raytheon Company. All Rights Reserved.
This file modified for 64-bit compatibility
*/
/* /*
* Memory Allocator * Memory Allocator
* *

View file

@ -61,6 +61,13 @@
* __END_OF_JASPER_LICENSE__ * __END_OF_JASPER_LICENSE__
*/ */
/*
August 20, 2012
Modified by Raytheon (c) 2012 Raytheon Company. All Rights Reserved.
This file modified for 64-bit compatibility
*/
/* /*
* JP2 Library * JP2 Library
* *

View file

@ -61,6 +61,13 @@
* __END_OF_JASPER_LICENSE__ * __END_OF_JASPER_LICENSE__
*/ */
/*
August 20, 2012
Modified by Raytheon (c) 2012 Raytheon Company. All Rights Reserved.
This file modified for 64-bit compatibility
*/
/* /*
* JP2 Library * JP2 Library
* *

View file

@ -61,6 +61,13 @@
* __END_OF_JASPER_LICENSE__ * __END_OF_JASPER_LICENSE__
*/ */
/*
August 20, 2012
Modified by Raytheon (c) 2012 Raytheon Company. All Rights Reserved.
This file modified for 64-bit compatibility
*/
/* /*
* JP2 Library * JP2 Library
* *

View file

@ -61,6 +61,13 @@
* __END_OF_JASPER_LICENSE__ * __END_OF_JASPER_LICENSE__
*/ */
/*
August 20, 2012
Modified by Raytheon (c) 2012 Raytheon Company. All Rights Reserved.
This file modified for 64-bit compatibility
*/
/* /*
* JPEG-2000 Code Stream Library * JPEG-2000 Code Stream Library
* *

View file

@ -61,6 +61,13 @@
* __END_OF_JASPER_LICENSE__ * __END_OF_JASPER_LICENSE__
*/ */
/*
August 20, 2012
Modified by Raytheon (c) 2012 Raytheon Company. All Rights Reserved.
This file modified for 64-bit compatibility
*/
/* /*
* $Id$ * $Id$
*/ */

View file

@ -61,6 +61,13 @@
* __END_OF_JASPER_LICENSE__ * __END_OF_JASPER_LICENSE__
*/ */
/*
August 20, 2012
Modified by Raytheon (c) 2012 Raytheon Company. All Rights Reserved.
This file modified for 64-bit compatibility
*/
/* /*
* $Id$ * $Id$
*/ */

View file

@ -61,6 +61,13 @@
* __END_OF_JASPER_LICENSE__ * __END_OF_JASPER_LICENSE__
*/ */
/*
August 20, 2012
Modified by Raytheon (c) 2012 Raytheon Company. All Rights Reserved.
This file modified for 64-bit compatibility
*/
/* /*
* MQ Arithmetic Decoder * MQ Arithmetic Decoder
* *

View file

@ -61,6 +61,13 @@
* __END_OF_JASPER_LICENSE__ * __END_OF_JASPER_LICENSE__
*/ */
/*
August 20, 2012
Modified by Raytheon (c) 2012 Raytheon Company. All Rights Reserved.
This file modified for 64-bit compatibility
*/
/* /*
* MQ Arithmetic Encoder * MQ Arithmetic Encoder
* *

View file

@ -61,6 +61,13 @@
* __END_OF_JASPER_LICENSE__ * __END_OF_JASPER_LICENSE__
*/ */
/*
August 20, 2012
Modified by Raytheon (c) 2012 Raytheon Company. All Rights Reserved.
This file modified for 64-bit compatibility
*/
/* /*
* Quadrature Mirror-Image Filter Bank (QMFB) Library * Quadrature Mirror-Image Filter Bank (QMFB) Library
* *

View file

@ -61,6 +61,13 @@
* __END_OF_JASPER_LICENSE__ * __END_OF_JASPER_LICENSE__
*/ */
/*
August 20, 2012
Modified by Raytheon (c) 2012 Raytheon Company. All Rights Reserved.
This file modified for 64-bit compatibility
*/
/* /*
* Quadrature Mirror-Image Filter Bank (QMFB) Routines * Quadrature Mirror-Image Filter Bank (QMFB) Routines
* *

View file

@ -61,6 +61,13 @@
* __END_OF_JASPER_LICENSE__ * __END_OF_JASPER_LICENSE__
*/ */
/*
August 20, 2012
Modified by Raytheon (c) 2012 Raytheon Company. All Rights Reserved.
This file modified for 64-bit compatibility
*/
/* /*
* Tier 1 Encoder * Tier 1 Encoder
* *

View file

@ -61,6 +61,13 @@
* __END_OF_JASPER_LICENSE__ * __END_OF_JASPER_LICENSE__
*/ */
/*
August 20, 2012
Modified by Raytheon (c) 2012 Raytheon Company. All Rights Reserved.
This file modified for 64-bit compatibility
*/
/* /*
* Tier-2 Coding Library * Tier-2 Coding Library
* *

View file

@ -61,6 +61,13 @@
* __END_OF_JASPER_LICENSE__ * __END_OF_JASPER_LICENSE__
*/ */
/*
August 20, 2012
Modified by Raytheon (c) 2012 Raytheon Company. All Rights Reserved.
This file modified for 64-bit compatibility
*/
/* /*
* Tier 2 Decoder * Tier 2 Decoder
* *

View file

@ -61,6 +61,13 @@
* __END_OF_JASPER_LICENSE__ * __END_OF_JASPER_LICENSE__
*/ */
/*
August 20, 2012
Modified by Raytheon (c) 2012 Raytheon Company. All Rights Reserved.
This file modified for 64-bit compatibility
*/
/* /*
* Tier 2 Encoder * Tier 2 Encoder
* *

View file

@ -61,6 +61,13 @@
* __END_OF_JASPER_LICENSE__ * __END_OF_JASPER_LICENSE__
*/ */
/*
August 20, 2012
Modified by Raytheon (c) 2012 Raytheon Company. All Rights Reserved.
This file modified for 64-bit compatibility
*/
/* /*
* Tag Tree Library * Tag Tree Library
* *

View file

@ -61,6 +61,13 @@
* __END_OF_JASPER_LICENSE__ * __END_OF_JASPER_LICENSE__
*/ */
/*
August 20, 2012
Modified by Raytheon (c) 2012 Raytheon Company. All Rights Reserved.
This file modified for 64-bit compatibility
*/
/* /*
* Tree-Structured Filter Bank (TSFB) Library * Tree-Structured Filter Bank (TSFB) Library
* *

View file

@ -61,6 +61,13 @@
* __END_OF_JASPER_LICENSE__ * __END_OF_JASPER_LICENSE__
*/ */
/*
August 20, 2012
Modified by Raytheon (c) 2012 Raytheon Company. All Rights Reserved.
This file modified for 64-bit compatibility
*/
/* /*
* $Id$ * $Id$
*/ */

View file

@ -59,6 +59,13 @@
* __END_OF_JASPER_LICENSE__ * __END_OF_JASPER_LICENSE__
*/ */
/*
August 20, 2012
Modified by Raytheon (c) 2012 Raytheon Company. All Rights Reserved.
This file modified for 64-bit compatibility
*/
/******************************************************************************\ /******************************************************************************\
* Includes. * Includes.
\******************************************************************************/ \******************************************************************************/

View file

@ -41,6 +41,13 @@ import jep.python.PyObject;
* @author [mrjohnson0 at sourceforge.net] Mike Johnson * @author [mrjohnson0 at sourceforge.net] Mike Johnson
* @version $Id: Jep.java 448 2007-11-27 00:30:23Z mrjohnson0 $ * @version $Id: Jep.java 448 2007-11-27 00:30:23Z mrjohnson0 $
*/ */
/*
August 2, 2012
Modified by Raytheon (c) 2012 Raytheon Company. All Rights Reserved.
Modifications marked and described by 'njensen'
*/
public final class Jep { public final class Jep {
private boolean closed = false; private boolean closed = false;

View file

@ -12,6 +12,13 @@
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE. # PARTICULAR PURPOSE.
#
# August 2, 2012
# Modified by Raytheon (c) 2012 Raytheon Company. All Rights Reserved.
# Modifications marked and described by 'njensen'
#
srcdir = . srcdir = .

View file

@ -26,6 +26,12 @@
distribution. distribution.
*/ */
/*
August 2, 2012
Modified by Raytheon (c) 2012 Raytheon Company. All Rights Reserved.
Modifications marked and described by 'njensen'
*/
#include "util.h" #include "util.h"
#include "jep.h" #include "jep.h"
#include "pyembed.h" #include "pyembed.h"

View file

@ -38,6 +38,13 @@
***************************************************************************** *****************************************************************************
*/ */
/*
August 2, 2012
Modified by Raytheon (c) 2012 Raytheon Company. All Rights Reserved.
Modifications marked and described by 'njensen'
*/
#ifdef WIN32 #ifdef WIN32
# include "winconfig.h" # include "winconfig.h"
#endif #endif

View file

@ -26,6 +26,13 @@
distribution. distribution.
*/ */
/*
August 2, 2012
Modified by Raytheon (c) 2012 Raytheon Company. All Rights Reserved.
Modifications marked and described by 'njensen'
*/
#ifndef _Included_pyembed #ifndef _Included_pyembed
#define _Included_pyembed #define _Included_pyembed

View file

@ -31,6 +31,13 @@
of the python distribution. of the python distribution.
*/ */
/*
August 2, 2012
Modified by Raytheon (c) 2012 Raytheon Company. All Rights Reserved.
Modifications marked and described by 'njensen'
*/
#ifdef WIN32 #ifdef WIN32
# include "winconfig.h" # include "winconfig.h"
#endif #endif

View file

@ -25,6 +25,13 @@
distribution. distribution.
*/ */
/*
August 2, 2012
Modified by Raytheon (c) 2012 Raytheon Company. All Rights Reserved.
Modifications marked and described by 'njensen'
*/
// shut up the compiler // shut up the compiler
#ifdef _POSIX_C_SOURCE #ifdef _POSIX_C_SOURCE

View file

@ -26,6 +26,13 @@
distribution. distribution.
*/ */
/*
August 2, 2012
Modified by Raytheon (c) 2012 Raytheon Company. All Rights Reserved.
Modifications marked and described by 'njensen'
*/
#ifdef WIN32 #ifdef WIN32
# include "winconfig.h" # include "winconfig.h"
#endif #endif

View file

@ -26,6 +26,13 @@
distribution. distribution.
*/ */
/*
August 2, 2012
Modified by Raytheon (c) 2012 Raytheon Company. All Rights Reserved.
Modifications marked and described by 'njensen'
*/
// shut up the compiler // shut up the compiler
#ifdef _POSIX_C_SOURCE #ifdef _POSIX_C_SOURCE
# undef _POSIX_C_SOURCE # undef _POSIX_C_SOURCE

View file

@ -26,6 +26,13 @@
distribution. distribution.
*/ */
/*
August 2, 2012
Modified by Raytheon (c) 2012 Raytheon Company. All Rights Reserved.
Modifications marked and described by 'njensen'
*/
#ifdef WIN32 #ifdef WIN32
# include "winconfig.h" # include "winconfig.h"
#endif #endif

View file

@ -26,6 +26,13 @@
distribution. distribution.
*/ */
/*
August 2, 2012
Modified by Raytheon (c) 2012 Raytheon Company. All Rights Reserved.
Modifications marked and described by 'njensen'
*/
// shut up the compiler // shut up the compiler
#ifdef _POSIX_C_SOURCE #ifdef _POSIX_C_SOURCE

View file

@ -26,6 +26,13 @@
distribution. distribution.
*/ */
/*
August 2, 2012
Modified by Raytheon (c) 2012 Raytheon Company. All Rights Reserved.
New file created with modifications to pyjmethod.c
*/
#ifdef WIN32 #ifdef WIN32
# include "winconfig.h" # include "winconfig.h"
#endif #endif

View file

@ -26,6 +26,13 @@
distribution. distribution.
*/ */
/*
August 2, 2012
Modified by Raytheon (c) 2012 Raytheon Company. All Rights Reserved.
New file created with modifications to pyjmethod.h
*/
// shut up the compiler // shut up the compiler
#ifdef _POSIX_C_SOURCE #ifdef _POSIX_C_SOURCE

View file

@ -26,6 +26,13 @@
distribution. distribution.
*/ */
/*
August 2, 2012
Modified by Raytheon (c) 2012 Raytheon Company. All Rights Reserved.
Modifications marked and described by 'njensen'
*/
#ifdef WIN32 #ifdef WIN32
# include "winconfig.h" # include "winconfig.h"
#endif #endif

View file

@ -26,6 +26,13 @@
distribution. distribution.
*/ */
/*
August 2, 2012
Modified by Raytheon (c) 2012 Raytheon Company. All Rights Reserved.
Modifications marked and described by 'njensen'
*/
// shut up the compiler // shut up the compiler
#ifdef _POSIX_C_SOURCE #ifdef _POSIX_C_SOURCE

View file

@ -26,6 +26,13 @@
distribution. distribution.
*/ */
/*
August 2, 2012
Modified by Raytheon (c) 2012 Raytheon Company. All Rights Reserved.
Modifications marked and described by 'njensen'
*/
#ifdef WIN32 #ifdef WIN32
# include "winconfig.h" # include "winconfig.h"
#endif #endif

View file

@ -1,224 +0,0 @@
%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-java-repack-jars[[:space:]].*$!!g')
#
# AWIPS II Java JRockit Spec File
#
Name: awips2-java-jrockit
Summary: AWIPS II Java JRockit Distribution - 32 Bit
Version: 1.6.0_26
Release: 1
Group: AWIPSII
BuildRoot: %{_build_root}
URL: N/A
License: N/A
Distribution: N/A
Vendor: Raytheon
Packager: Bryan Kowal
AutoReq: no
provides: awips2-java-jrockit
requires: awips2-java
%description
AWIPS II Java JRockit Distribution - Contains JRockit JDK 1.6.0_26 and
the JRockit Mission Control Utility.
%prep
# Verify That The User Has Specified A BuildRoot.
if [ "%{_build_root}" = "/tmp" ]
then
echo "An Actual BuildRoot Must Be Specified. Use The --buildroot Parameter."
echo "Unable To Continue ... Terminating"
exit 1
fi
rm -rf %{_build_root}
mkdir -p %{_build_root}/build-java
mkdir -p %{_build_root}/awips2/java
%build
%install
RPM_CORE_PROJECT_DIR="%{_baseline_workspace}/rpms/awips2.core"
JROCKIT_PROJECT_DIR="${RPM_CORE_PROJECT_DIR}/Installer.java-jrockit"
JROCKIT_INSTALLER="jrockit-jdk1.6.0_26-R28.1.4-4.0.1-linux-ia32.bin"
SILENT_XML="silent.xml"
pushd . > /dev/null
# JRockit Setup
cd ${JROCKIT_PROJECT_DIR}/src
chmod u+x ${JROCKIT_INSTALLER}
./${JROCKIT_INSTALLER} -mode=silent -silent_xml="${SILENT_XML}"
RC=$?
if [ ${RC} -ne 0 ]; then
exit 1
fi
popd > /dev/null
# Copy the Java "Extensions" to build-java.
JROCKIT_SRC_DIR="${JROCKIT_PROJECT_DIR}/src"
JAI_BIN="jai-1_1_3-lib-linux-i586-jdk.bin"
JAI_PATCH="jai.patch1"
JAI_IMAGEIO_BIN="jai_imageio-1_1-lib-linux-i586-jdk.bin"
JAI_IMAGEIO_PATCH="jai_imageio.patch1"
# Prepare
touch %{_build_root}/build-java/yes.txt
echo "yes" > %{_build_root}/build-java/yes.txt
cp -v ${JROCKIT_SRC_DIR}/${JAI_BIN} \
%{_build_root}/build-java
RC=$?
if [ ${RC} -ne 0 ]; then
exit 1
fi
cp -v ${JROCKIT_SRC_DIR}/${JAI_PATCH} \
%{_build_root}/build-java
RC=$?
if [ ${RC} -ne 0 ]; then
exit 1
fi
cp -v ${JROCKIT_SRC_DIR}/${JAI_IMAGEIO_BIN} \
%{_build_root}/build-java
RC=$?
if [ ${RC} -ne 0 ]; then
exit 1
fi
cp -v ${JROCKIT_SRC_DIR}/${JAI_IMAGEIO_PATCH} \
%{_build_root}/build-java
RC=$?
if [ ${RC} -ne 0 ]; then
exit 1
fi
# JAI Setup
# ... Complete Patching.
pushd . > /dev/null
cd %{_build_root}/build-java
patch -i ${JAI_PATCH}
RC=$?
if [ ${RC} -ne 0 ]; then
exit 1
fi
chmod u+x ${JAI_BIN}
popd > /dev/null
# ... Complete Installation.
pushd . > /dev/null
cd %{_build_root}/awips2/java/jrockit
%{_build_root}/build-java/${JAI_BIN} < %{_build_root}/build-java/yes.txt
RC=$?
if [ ${RC} -ne 0 ]; then
exit 1
fi
popd > /dev/null
# JAI ImageIO Setup
# ... Complete Patching.
pushd . > /dev/null
cd %{_build_root}/build-java
patch -i ${JAI_IMAGEIO_PATCH}
RC=$?
if [ ${RC} -ne 0 ]; then
exit 1
fi
chmod u+x ${JAI_IMAGEIO_BIN}
popd > /dev/null
# ... Complete Installation.
pushd . > /dev/null
cd %{_build_root}/awips2/java/jrockit
%{_build_root}/build-java/${JAI_IMAGEIO_BIN} < %{_build_root}/build-java/yes.txt
RC=$?
if [ ${RC} -ne 0 ]; then
exit 1
fi
popd > /dev/null
# pydev certificate
PYDEV_CERTIFICATE="pydev_certificate.cer"
cp -v ${JROCKIT_SRC_DIR}/${PYDEV_CERTIFICATE} \
%{_build_root}/awips2/java/jrockit/jre/lib/security
RC=$?
if [ ${RC} -ne 0 ]; then
exit 1
fi
touch %{_build_root}/build-java/changeit.txt
echo "changeit" > %{_build_root}/build-java/changeit.txt
chmod 666 %{_build_root}/awips2/java/jrockit/jre/lib/security/cacerts
RC=$?
if [ ${RC} -ne 0 ]; then
exit 1
fi
%{_build_root}/awips2/java/jrockit/bin/keytool -import \
-file %{_build_root}/awips2/java/jrockit/jre/lib/security/pydev_certificate.cer \
-keystore %{_build_root}/awips2/java/jrockit/jre/lib/security/cacerts \
-noprompt < %{_build_root}/build-java/changeit.txt
RC=$?
if [ ${RC} -ne 0 ]; then
exit 1
fi
rm -rf %{_build_root}/build-java
%pre
%post
# Create a link JRockit Mission Control.
pushd . > /dev/null
cd /awips2/java/bin
ln -sf /awips2/java/jrockit/bin/jrmc .
popd > /dev/null
%preun
# Remove the link JRockit Mission Control.
pushd . > /dev/null
cd /awips2/java/bin
if [ -L jrockit ]; then
rm -f jrockit
fi
popd > /dev/null
%postun
%clean
rm -rf ${RPM_BUILD_ROOT}
%files
%defattr(644,awips,fxalpha,755)
%dir /awips2
%dir /awips2/java
%dir /awips2/java/jrockit
%dir /awips2/java/jrockit/bin
%dir /awips2/java/jrockit/include
/awips2/java/jrockit/include/*
%dir /awips2/java/jrockit/inventory
/awips2/java/jrockit/inventory/*
%dir /awips2/java/jrockit/jre
/awips2/java/jrockit/jre/*
%dir /awips2/java/jrockit/lib
%dir /awips2/java/jrockit/missioncontrol
/awips2/java/jrockit/missioncontrol/*
%doc /awips2/java/jrockit/THIRDPARTYLICENSEREADME.txt
%doc /awips2/java/jrockit/jre/THIRDPARTYLICENSEREADME.txt
/awips2/java/jrockit/jre/.systemPrefs/.system.lock
/awips2/java/jrockit/jre/.systemPrefs/.systemRootModFile
/awips2/java/jrockit/missioncontrol/.eclipseproduct
%doc /awips2/java/jrockit/COPYRIGHT-jai.txt
%doc /awips2/java/jrockit/COPYRIGHT-jai_imageio.txt
%doc /awips2/java/jrockit/DISTRIBUTIONREADME-jai.txt
%doc /awips2/java/jrockit/DISTRIBUTIONREADME-jai_imageio.txt
%doc /awips2/java/jrockit/ENTITLEMENT-jai_imageio.txt
%doc /awips2/java/jrockit/LICENSE-jai.txt
%doc /awips2/java/jrockit/LICENSE-jai_imageio.txt
%doc /awips2/java/jrockit/THIRDPARTYLICENSEREADME-jai.txt
%doc /awips2/java/jrockit/THIRDPARTYLICENSEREADME-jai_imageio.txt
%doc /awips2/java/jrockit/UNINSTALL-jai
%doc /awips2/java/jrockit/UNINSTALL-jai_imageio
%defattr(755,awips,fxalpha,755)
/awips2/java/jrockit/bin/*
/awips2/java/jrockit/lib/*
/awips2/java/jrockit/jre/bin/*
/awips2/java/jrockit/jre/lib/*

View file

@ -1,49 +0,0 @@
*** jai-1_1_3-lib-linux-i586-jdk.bin 2011-09-08 14:03:07.000000000 -0500
--- jai-1_1_3-lib-linux-i586-jdk.bin.update 2011-09-08 14:04:43.000000000 -0500
***************
*** 1,6 ****
#!/bin/sh
PATH=/bin:/usr/bin
! more <<EOF
--- 1,6 ----
#!/bin/sh
PATH=/bin:/usr/bin
! cat <<EOF
***************
*** 81,89 ****
outname=install.sfx.$$
echo "Unpacking..."
if [ "`uname`" = "SunOS" ]; then
! /bin/tail +139 $0 > $outname
else
! tail -n +139 $0 > $outname
fi
if [ -x /usr/bin/cksum ] ; then
echo "Checksumming..."
--- 81,89 ----
outname=install.sfx.$$
echo "Unpacking..."
if [ "`uname`" = "SunOS" ]; then
! /bin/tail +137 $0 > $outname
else
! tail -n +137 $0 > $outname
fi
if [ -x /usr/bin/cksum ] ; then
echo "Checksumming..."
***************
*** 119,126 ****
else
ARCH=i386 # solaris-i586 or solaris-amd64
fi
- elif [ `expr "\`uname -m\`" : .*64.*` != '0' ]; then
- ARCH=amd64 # linux-amd64
else
ARCH=i386 # linux-i586
fi
--- 119,124 ----

View file

@ -1,45 +0,0 @@
*** jai_imageio-1_1-lib-linux-i586-jdk.bin 2011-09-08 14:29:01.000000000 -0500
--- jai_imageio-1_1-lib-linux-i586-jdk.bin.update 2011-09-08 14:30:10.000000000 -0500
***************
*** 1,6 ****
#!/bin/sh
PATH=/bin:/usr/bin
! more <<EOF
--- 1,6 ----
#!/bin/sh
PATH=/bin:/usr/bin
! cat <<EOF
***************
*** 160,166 ****
fi
outname=install.sfx.$$
echo "Unpacking..."
! tail +215 $0 > $outname
if [ -x /usr/bin/cksum ] ; then
echo "Checksumming..."
--- 160,166 ----
fi
outname=install.sfx.$$
echo "Unpacking..."
! tail -n +213 $0 > $outname
if [ -x /usr/bin/cksum ] ; then
echo "Checksumming..."
***************
*** 195,202 ****
else
ARCH=i386 # solaris-i586 or solaris-amd64
fi
- elif [ `expr \`uname -m\` : .*64.*` != '0' ]; then
- ARCH=amd64 # linux-amd64
else
ARCH=i386 # linux-i586
fi
--- 195,200 ----

View file

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<domain-template-descriptor>
<input-fields>
<data-value name="USER_INSTALL_DIR" value="/tmp/awips-component/awips2/java/jrockit" />
<data-value name="INSTALL_DEMOS_AND_SAMPLES" value="false" />
<data-value name="INSTALL_SOURCE_CODE" value="false" />
</input-fields>
</domain-template-descriptor>

View file

@ -98,6 +98,54 @@ if [ "${1}" = "-custom" ]; then
exit 0 exit 0
fi fi
if [ "${1}" = "-python-qpid" ]; then
buildRPM "awips2"
buildRPM "awips2-python"
buildRPM "awips2-python-cherrypy"
buildRPM "awips2-python-dynamicserialize"
buildRPM "awips2-python-nose"
buildRPM "awips2-python-numpy"
buildRPM "awips2-python-h5py"
buildRPM "awips2-python-jimporter"
buildRPM "awips2-python-matplotlib"
buildRPM "awips2-python-pil"
buildRPM "awips2-python-pmw"
buildRPM "awips2-python-pupynere"
buildRPM "awips2-python-qpid"
buildRPM "awips2-python-scientific"
buildRPM "awips2-python-scipy"
buildRPM "awips2-python-tables"
buildRPM "awips2-python-thrift"
buildRPM "awips2-python-tpg"
buildRPM "awips2-python-ufpy"
buildRPM "awips2-python-werkzeug"
buildRPM "awips2-python-pygtk"
buildRPM "awips2-python-pycairo"
if [ $? -ne 0 ]; then
exit 1
fi
buildQPID
if [ $? -ne 0 ]; then
exit 1
fi
#buildRPM "awips2-ant"
#unpackHttpdPypies
if [ $? -ne 0 ]; then
exit 1
fi
#buildRPM "awips2-httpd-pypies"
#buildRPM "awips2-java"
#buildRPM "awips2-ldm"
#buildRPM "awips2-postgresql"
#buildRPM "awips2-psql"
#buildRPM "awips2-tools"
exit 0
fi
if [ "${1}" = "-delta" ]; then if [ "${1}" = "-delta" ]; then
buildCAVE buildCAVE
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
@ -109,6 +157,9 @@ if [ "${1}" = "-delta" ]; then
exit 1 exit 1
fi fi
buildRPM "awips2"
buildRPM "awips2-gfesuite-client"
buildRPM "awips2-gfesuite-server"
buildRPM "awips2-python-dynamicserialize" buildRPM "awips2-python-dynamicserialize"
buildRPM "awips2-python-ufpy" buildRPM "awips2-python-ufpy"
@ -119,8 +170,6 @@ if [ "${1}" = "-delta" ]; then
buildRPM "awips2-database-server-configuration" buildRPM "awips2-database-server-configuration"
buildRPM "awips2-database-standalone-configuration" buildRPM "awips2-database-standalone-configuration"
buildRPM "awips2-data.hdf5-gfe.climo" buildRPM "awips2-data.hdf5-gfe.climo"
buildRPM "awips2-gfesuite-client"
buildRPM "awips2-gfesuite-server"
buildRPM "awips2-hydroapps-shared" buildRPM "awips2-hydroapps-shared"
buildRPM "awips2-localapps-environment" buildRPM "awips2-localapps-environment"
buildRPM "awips2-maps-database" buildRPM "awips2-maps-database"
@ -128,7 +177,6 @@ if [ "${1}" = "-delta" ]; then
buildRPM "awips2-pypies" buildRPM "awips2-pypies"
buildRPM "awips2-data.hdf5-topo" buildRPM "awips2-data.hdf5-topo"
buildRPM "awips2-data.gfe" buildRPM "awips2-data.gfe"
buildRPM "awips2"
buildRPM "awips2-rcm" buildRPM "awips2-rcm"
buildLocalizationRPMs buildLocalizationRPMs
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
@ -297,6 +345,7 @@ if [ "${1}" = "-viz" ]; then
fi fi
if [ "${1}" = "-edex" ]; then if [ "${1}" = "-edex" ]; then
buildRPM "awips2"
buildEDEX buildEDEX
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
exit 1 exit 1

View file

@ -0,0 +1,368 @@
#!/bin/bash
function buildRPM()
{
# Arguments:
# ${1} == the name of the rpm.
lookupRPM "${1}"
if [ $? -ne 0 ]; then
echo "ERROR: '${1}' is not a recognized AWIPS II RPM."
exit 1
fi
/usr/bin/rpmbuild -ba \
--define '_topdir %(echo ${AWIPSII_TOP_DIR})' \
--define '_baseline_workspace %(echo ${WORKSPACE})' \
--define '_uframe_eclipse %(echo ${UFRAME_ECLIPSE})' \
--define '_awipscm_share %(echo ${AWIPSCM_SHARE})' \
--define '_build_root %(echo ${AWIPSII_BUILD_ROOT})' \
--define '_component_version %(echo ${AWIPSII_VERSION})' \
--define '_component_release %(echo ${AWIPSII_RELEASE})' \
--define '_component_build_date %(echo ${COMPONENT_BUILD_DATE})' \
--define '_component_build_time %(echo ${COMPONENT_BUILD_TIME})' \
--define '_component_build_system %(echo ${COMPONENT_BUILD_SYSTEM})' \
--buildroot ${AWIPSII_BUILD_ROOT} \
${RPM_SPECIFICATION}/component.spec
if [ $? -ne 0 ]; then
echo "ERROR: Failed to build RPM ${1}."
exit 1
fi
return 0
}
# This script will build all of the 32-bit rpms.
# Ensure that we are on a machine with the correct architecture.
architecture=`uname -i`
if [ ! "${architecture}" = "i386" ]; then
echo "ERROR: This build can only be performed on a 32-bit Operating System."
exit 1
fi
# Determine which directory we are running from.
path_to_script=`readlink -f $0`
dir=$(dirname $path_to_script)
common_dir=`cd ${dir}/../common; pwd;`
if [ $? -ne 0 ]; then
echo "ERROR: Unable to find the common functions directory."
exit 1
fi
# source the common functions.
source ${common_dir}/lookupRPM.sh
if [ $? -ne 0 ]; then
echo "ERROR: Unable to source the common functions."
exit 1
fi
source ${common_dir}/usage.sh
if [ $? -ne 0 ]; then
echo "ERROR: Unable to source the common functions."
exit 1
fi
source ${common_dir}/rpms.sh
if [ $? -ne 0 ]; then
echo "ERROR: Unable to source the common functions."
exit 1
fi
source ${common_dir}/systemInfo.sh
if [ $? -ne 0 ]; then
echo "ERROR: Unable to retrieve the system information."
exit 1
fi
# prepare the build environment.
source ${dir}/buildEnvironment.sh
if [ $? -ne 0 ]; then
echo "ERROR: Unable to prepare the build environment."
exit 1
fi
export LIGHTNING=true
# Determine if the optional '-nobinlightning' argument has been specified.
if [ "${2}" = "-nobinlightning" ]; then
LIGHTNING=false
fi
if [ "${1}" = "-custom" ]; then
buildRPM "awips2-java"
buildRPM "awips2-postgresql"
buildRPM "awips2-psql"
buildRPM "awips2-tools"
unpackHttpdPypies
if [ $? -ne 0 ]; then
exit 1
fi
buildRPM "awips2-httpd-pypies"
exit 0
fi
if [ "${1}" = "-delta" ]; then
buildCAVE
if [ $? -ne 0 ]; then
exit 1
fi
buildRPM "awips2-alertviz"
buildEDEX
if [ $? -ne 0 ]; then
exit 1
fi
buildRPM "awips2-python-dynamicserialize"
buildRPM "awips2-python-ufpy"
buildRPM "awips2-adapt-native"
buildRPM "awips2-aviation-shared"
buildRPM "awips2-cli"
buildRPM "awips2-database"
buildRPM "awips2-database-server-configuration"
buildRPM "awips2-database-standalone-configuration"
buildRPM "awips2-data.hdf5-gfe.climo"
buildRPM "awips2-gfesuite-client"
buildRPM "awips2-gfesuite-server"
buildRPM "awips2-hydroapps-shared"
buildRPM "awips2-localapps-environment"
buildRPM "awips2-maps-database"
buildRPM "awips2-notification"
buildRPM "awips2-pypies"
buildRPM "awips2-data.hdf5-topo"
buildRPM "awips2-data.gfe"
buildRPM "awips2"
buildRPM "awips2-rcm"
buildLocalizationRPMs
if [ $? -ne 0 ]; then
exit 1
fi
exit 0
fi
if [ "${1}" = "-full" ]; then
buildCAVE
if [ $? -ne 0 ]; then
exit 1
fi
buildRPM "awips2-alertviz"
buildEDEX
if [ $? -ne 0 ]; then
exit 1
fi
buildRPM "awips2-python"
buildRPM "awips2-python-cherrypy"
buildRPM "awips2-python-dynamicserialize"
buildRPM "awips2-python-h5py"
buildRPM "awips2-python-jimporter"
buildRPM "awips2-python-matplotlib"
buildRPM "awips2-python-nose"
buildRPM "awips2-python-numpy"
buildRPM "awips2-python-pil"
buildRPM "awips2-python-pmw"
buildRPM "awips2-python-pupynere"
buildRPM "awips2-python-qpid"
buildRPM "awips2-python-scientific"
buildRPM "awips2-python-scipy"
buildRPM "awips2-python-tables"
buildRPM "awips2-python-thrift"
buildRPM "awips2-python-tpg"
buildRPM "awips2-python-ufpy"
buildRPM "awips2-python-werkzeug"
buildRPM "awips2-python-pygtk"
buildRPM "awips2-python-pycairo"
buildRPM "awips2-adapt-native"
buildRPM "awips2-aviation-shared"
buildRPM "awips2-cli"
buildRPM "awips2-database"
buildRPM "awips2-database-server-configuration"
buildRPM "awips2-database-standalone-configuration"
buildRPM "awips2-data.hdf5-gfe.climo"
buildRPM "awips2-data.gfe"
buildRPM "awips2-gfesuite-client"
buildRPM "awips2-gfesuite-server"
buildRPM "awips2-hydroapps-shared"
buildRPM "awips2-localapps-environment"
buildRPM "awips2-maps-database"
buildRPM "awips2-notification"
buildRPM "awips2-pypies"
buildRPM "awips2-data.hdf5-topo"
buildRPM "awips2"
buildRPM "awips2-rcm"
buildLocalizationRPMs
if [ $? -ne 0 ]; then
exit 1
fi
buildQPID
if [ $? -ne 0 ]; then
exit 1
fi
buildRPM "awips2-ant"
unpackHttpdPypies
if [ $? -ne 0 ]; then
exit 1
fi
buildRPM "awips2-httpd-pypies"
buildRPM "awips2-java"
#buildRPM "awips2-ldm"
buildRPM "awips2-postgresql"
buildRPM "awips2-psql"
buildRPM "awips2-tools"
exit 0
fi
if [ "${1}" = "-ade" ]; then
buildRPM "awips2-eclipse"
buildRPM "awips2-java"
buildRPM "awips2-ant"
buildRPM "awips2-python"
buildRPM "awips2-python-cherrypy"
buildRPM "awips2-python-dynamicserialize"
buildRPM "awips2-python-h5py"
buildRPM "awips2-python-jimporter"
buildRPM "awips2-python-matplotlib"
buildRPM "awips2-python-nose"
buildRPM "awips2-python-numpy"
buildRPM "awips2-python-pil"
buildRPM "awips2-python-pmw"
buildRPM "awips2-python-pupynere"
buildRPM "awips2-python-qpid"
buildRPM "awips2-python-scientific"
buildRPM "awips2-python-scipy"
buildRPM "awips2-python-tables"
buildRPM "awips2-python-thrift"
buildRPM "awips2-python-tpg"
buildRPM "awips2-python-ufpy"
buildRPM "awips2-python-werkzeug"
buildRPM "awips2-python-pygtk"
buildRPM "awips2-python-pycairo"
buildQPID -ade
if [ $? -ne 0 ]; then
exit 1
fi
# Package the ade.
# Create the containing directory.
ade_directory="awips2-ade-${AWIPSII_VERSION}-${AWIPSII_RELEASE}"
if [ -d ${WORKSPACE}/${ade_directory} ]; then
rm -rf ${WORKSPACE}/${ade_directory}
if [ $? -ne 0 ]; then
exit 1
fi
fi
mkdir -p ${WORKSPACE}/${ade_directory}
if [ $? -ne 0 ]; then
exit 1
fi
# Copy the rpms to the directory.
cp -v ${AWIPSII_TOP_DIR}/RPMS/i386/* \
${AWIPSII_TOP_DIR}/RPMS/noarch/* \
${WORKSPACE}/${ade_directory}
if [ $? -ne 0 ]; then
exit 1
fi
awips2_ade_directory="${WORKSPACE}/rpms/awips2.ade"
# Copy the install and uninstall script to the directory.
cp -v ${awips2_ade_directory}/tar.ade/scripts/*.sh \
${WORKSPACE}/${ade_directory}
if [ $? -ne 0 ]; then
exit 1
fi
# Tar the directory.
pushd . > /dev/null 2>&1
cd ${WORKSPACE}
tar -cvf ${ade_directory}.tar ${ade_directory}
popd > /dev/null 2>&1
RC=$?
if [ ${RC} -ne 0 ]; then
exit 1
fi
exit 0
fi
if [ "${1}" = "-viz" ]; then
buildCAVE
if [ $? -ne 0 ]; then
exit 1
fi
buildRPM "awips2-alertviz"
exit 0
fi
if [ "${1}" = "-edex" ]; then
buildEDEX
if [ $? -ne 0 ]; then
exit 1
fi
exit 0
fi
if [ "${1}" = "-qpid" ]; then
buildQPID
if [ $? -ne 0 ]; then
exit 1
fi
exit 0
fi
if [ "${1}" = "-ldm" ]; then
# Ensure that the user has root privileges.
if [ ! ${UID} = 0 ]; then
echo "ERROR: You must have root privileges to build ldm."
exit 1
fi
buildRPM "awips2-ldm"
exit 0
fi
if [ "${1}" = "-package" ]; then
repository_directory="awips2-repository-${AWIPSII_VERSION}-${AWIPSII_RELEASE}"
if [ -d ${WORKSPACE}/${repository_directory} ]; then
rm -rf ${WORKSPACE}/${repository_directory}
if [ $? -ne 0 ]; then
exit 1
fi
fi
mkdir -p ${WORKSPACE}/${repository_directory}/${AWIPSII_VERSION}-${AWIPSII_RELEASE}
if [ $? -ne 0 ]; then
exit 1
fi
cp -r ${AWIPSII_TOP_DIR}/RPMS/* \
${WORKSPACE}/${repository_directory}/${AWIPSII_VERSION}-${AWIPSII_RELEASE}
if [ $? -ne 0 ]; then
exit 1
fi
rpms_directory="${WORKSPACE}/rpms"
comps_xml="${rpms_directory}/common/yum/arch.x86/comps.xml"
cp -v ${comps_xml} ${WORKSPACE}/${repository_directory}
if [ $? -ne 0 ]; then
exit 1
fi
pushd . > /dev/null
cd ${WORKSPACE}
tar -cvf ${repository_directory}.tar ${repository_directory}
RC=$?
popd > /dev/null
if [ ${RC} -ne 0 ]; then
exit 1
fi
exit 0
fi
usage
exit 0

View file

@ -0,0 +1,51 @@
JasPer License Version 2.0
Copyright (c) 2001-2006 Michael David Adams
Copyright (c) 1999-2000 Image Power, Inc.
Copyright (c) 1999-2000 The University of British Columbia
All rights reserved.
Permission is hereby granted, free of charge, to any person (the
"User") obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the
following conditions:
1. The above copyright notices and this permission notice (which
includes the disclaimer below) shall be included in all copies or
substantial portions of the Software.
2. The name of a copyright holder shall not be used to endorse or
promote products derived from the Software without specific prior
written permission.
THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
LICENSE. NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
THIS DISCLAIMER. THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
"AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO
EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. NO ASSURANCES ARE
PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
PROPERTY RIGHTS OR OTHERWISE. AS A CONDITION TO EXERCISING THE RIGHTS
GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY. THE SOFTWARE
IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
RISK ACTIVITIES"). THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.

View file

@ -8,7 +8,7 @@
Name: awips2-python-qpid Name: awips2-python-qpid
Summary: AWIPS II Python qpid Distribution Summary: AWIPS II Python qpid Distribution
Version: 0.6 Version: 0.6
Release: 4 Release: 5
Group: AWIPSII Group: AWIPSII
BuildRoot: %{_build_root} BuildRoot: %{_build_root}
BuildArch: %{_build_arch} BuildArch: %{_build_arch}
@ -60,6 +60,7 @@ QPID_SRC_DIR="%{_python_pkgs_dir}/qpid"
QPID_SRC="qpid-0.6/python" QPID_SRC="qpid-0.6/python"
QPID_SPECS="qpid-0.6/specs" QPID_SPECS="qpid-0.6/specs"
QPID_QUEUE_COUNT_SCRIPT="qpid-queue-count" QPID_QUEUE_COUNT_SCRIPT="qpid-queue-count"
QPID_MONITOR_SCRIPT="monitor_qpid_host.sh"
pushd . > /dev/null pushd . > /dev/null
cd %{_build_root}/build-python/${QPID_SRC} cd %{_build_root}/build-python/${QPID_SRC}
@ -77,6 +78,10 @@ popd > /dev/null
cp -v ${QPID_SRC_DIR}/bin/${QPID_QUEUE_COUNT_SCRIPT} \ cp -v ${QPID_SRC_DIR}/bin/${QPID_QUEUE_COUNT_SCRIPT} \
%{_build_root}/awips2/python/bin %{_build_root}/awips2/python/bin
# Copy the queue-counting script to bin
cp -v ${QPID_SRC_DIR}/bin/${QPID_MONITOR_SCRIPT} \
%{_build_root}/awips2/python/bin
# Copy the amqp dtd/xml data to share # Copy the amqp dtd/xml data to share
mkdir -p %{_build_root}/awips2/python/share/amqp mkdir -p %{_build_root}/awips2/python/share/amqp
cp -prv %{_build_root}/build-python/${QPID_SPECS}/* \ cp -prv %{_build_root}/build-python/${QPID_SPECS}/* \

View file

@ -0,0 +1,116 @@
%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')
%define _build_arch %(uname -i)
%define _python_pkgs_dir "%{_baseline_workspace}/pythonPackages"
#
# AWIPS II Python qpid Spec File
#
Name: awips2-python-qpid
Summary: AWIPS II Python qpid Distribution
Version: 0.6
Release: 4
Group: AWIPSII
BuildRoot: %{_build_root}
BuildArch: %{_build_arch}
URL: N/A
License: N/A
Distribution: N/A
Vendor: Raytheon
Packager: Bryan Kowal
AutoReq: no
requires: awips2-python
provides: awips2-python-qpid
%description
AWIPS II Python qpid Site-Package
%prep
# Verify That The User Has Specified A BuildRoot.
if [ "%{_build_root}" = "" ]
then
echo "A Build Root has not been specified."
echo "Unable To Continue ... Terminating"
exit 1
fi
rm -rf %{_build_root}
mkdir -p %{_build_root}
mkdir -p %{_build_root}/build-python
%build
QPID_SRC_DIR="%{_python_pkgs_dir}/qpid"
QPID_TAR="qpid-0.6.tar.gz"
cp -rv ${QPID_SRC_DIR}/${QPID_TAR} \
%{_build_root}/build-python
RC=$?
if [ ${RC} -ne 0 ]; then
exit 1
fi
pushd . > /dev/null
cd %{_build_root}/build-python
tar -xvf ${QPID_TAR}
rm -f ${QPID_TAR}
popd > /dev/null
%install
QPID_SRC_DIR="%{_python_pkgs_dir}/qpid"
QPID_SRC="qpid-0.6/python"
QPID_SPECS="qpid-0.6/specs"
QPID_QUEUE_COUNT_SCRIPT="qpid-queue-count"
pushd . > /dev/null
cd %{_build_root}/build-python/${QPID_SRC}
mkdir -p %{_build_root}/awips2/python
export LD_LIBRARY_PATH=/awips2/python/lib
export PATH=/awips2/python/bin:${PATH}
make install PREFIX=%{_build_root}/awips2/python
RC=$?
if [ ${RC} -ne 0 ]; then
exit 1
fi
popd > /dev/null
# Copy the queue-counting script to bin
cp -v ${QPID_SRC_DIR}/bin/${QPID_QUEUE_COUNT_SCRIPT} \
%{_build_root}/awips2/python/bin
# Copy the amqp dtd/xml data to share
mkdir -p %{_build_root}/awips2/python/share/amqp
cp -prv %{_build_root}/build-python/${QPID_SPECS}/* \
%{_build_root}/awips2/python/share/amqp
rm -rf %{_build_root}/build-python
%pre
%post
# get the path to the awips2-python that is installed
PYDIR="/awips2/python"
# get the python version so we can fix the amqp xml/dtd
PYTHON_VERSION=$( LD_LIBRARY_PATH=${PYDIR}/lib ${PYDIR}/bin/python -c "from distutils.sysconfig import get_python_version; print get_python_version()" )
# the file /awips2/python/lib/python$PYTHON_VERSION/site-packages/qpid_config.py is wrong
# this substitution will put the correct path in the file qpid_config.py
# otherwise it will generate AMQP errors when run, it won't find the directory
sed -i "s|^AMQP_SPEC_DIR=.*/share/amqp\"|AMQP_SPEC_DIR=\"${PYDIR}/share/amqp\"|g" \
${PYDIR}/lib/python${PYTHON_VERSION}/site-packages/qpid_config.py
%preun
%postun
%clean
rm -rf ${RPM_BUILD_ROOT}
%files
%defattr(644,awips,fxalpha,755)
%dir /awips2/python/lib/python2.7/site-packages
/awips2/python/lib/python2.7/site-packages/*
%dir /awips2/python/share
/awips2/python/share/*
%defattr(755,awips,fxalpha,755)
%dir /awips2/python/bin
/awips2/python/bin/*