Merge remote-tracking branch 'omaha/omaha_16.2.2' into master_16.2.2
Former-commit-id: 869b414c8476d6cfd22d74024e56d4ea7ee21e92
This commit is contained in:
commit
6bfcb5eb57
35 changed files with 578 additions and 839 deletions
|
@ -150,6 +150,7 @@ import com.raytheon.uf.viz.localization.service.ILocalizationService;
|
||||||
* Jan 11, 2016 5242 kbisanz Replaced calls to deprecated LocalizationFile methods
|
* Jan 11, 2016 5242 kbisanz Replaced calls to deprecated LocalizationFile methods
|
||||||
* Jan 15, 2016 5242 kbisanz Replaced LocalizationFile with
|
* Jan 15, 2016 5242 kbisanz Replaced LocalizationFile with
|
||||||
* ILocalizationFile where possible
|
* ILocalizationFile where possible
|
||||||
|
* Apr 14, 2016 4946 mapeters Fix duplicate files listed in delete confirmation dialog
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -921,9 +922,13 @@ public class FileTreeView extends ViewPart implements IPartListener2,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (toDelete.size() > 0) {
|
if (toDelete.size() > 0) {
|
||||||
Collections.sort(toDelete, new FileTreeFileComparator());
|
// Duplicates occur if both a dir and its contents are selected
|
||||||
mgr.add(new DeleteAction(getSite().getPage(), toDelete
|
LocalizationFile[] toDeleteWithoutDuplicates = new HashSet<>(
|
||||||
.toArray(new LocalizationFile[toDelete.size()])));
|
toDelete).toArray(new LocalizationFile[0]);
|
||||||
|
Arrays.sort(toDeleteWithoutDuplicates,
|
||||||
|
new FileTreeFileComparator());
|
||||||
|
mgr.add(new DeleteAction(getSite().getPage(),
|
||||||
|
toDeleteWithoutDuplicates));
|
||||||
mgr.add(new Separator());
|
mgr.add(new Separator());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,7 +78,8 @@
|
||||||
# Sep 11, 2015 4858 dgilling Remove notification processing from publishElements.
|
# Sep 11, 2015 4858 dgilling Remove notification processing from publishElements.
|
||||||
# Jan 20, 2016 4751 randerso Fix type of mask returned from getComposite() to work with numpy 1.9.2
|
# Jan 20, 2016 4751 randerso Fix type of mask returned from getComposite() to work with numpy 1.9.2
|
||||||
# Jan 28, 2016 5129 dgilling Support changes to IFPClient.
|
# Jan 28, 2016 5129 dgilling Support changes to IFPClient.
|
||||||
# 02/22/2016 5374 randerso Added support for sendWFOMessage
|
# Feb 22, 2016 5374 randerso Added support for sendWFOMessage
|
||||||
|
# Apr 05, 2016 5539 randerso Added exception when attempting create more than 256 Wx keys
|
||||||
#
|
#
|
||||||
########################################################################
|
########################################################################
|
||||||
import types, string, time, sys
|
import types, string, time, sys
|
||||||
|
@ -2198,6 +2199,10 @@ class SmartScript(BaseTool.BaseTool):
|
||||||
for str in keys:
|
for str in keys:
|
||||||
if sortedUglyStr == self.sortUglyStr(str):
|
if sortedUglyStr == self.sortUglyStr(str):
|
||||||
return keys.index(str)
|
return keys.index(str)
|
||||||
|
|
||||||
|
if len(keys) >= 256:
|
||||||
|
raise IndexError("Attempt to create more than 256 Wx keys")
|
||||||
|
|
||||||
keys.append(uglyStr)
|
keys.append(uglyStr)
|
||||||
return len(keys) - 1
|
return len(keys) - 1
|
||||||
|
|
||||||
|
|
|
@ -72,6 +72,7 @@ import com.vividsolutions.jts.geom.MultiPolygon;
|
||||||
* 02/19/2013 1637 randerso Added throws declarations to translateDataFrom
|
* 02/19/2013 1637 randerso Added throws declarations to translateDataFrom
|
||||||
* 10/31/2013 2508 randerso Change to use DiscreteGridSlice.getKeys()
|
* 10/31/2013 2508 randerso Change to use DiscreteGridSlice.getKeys()
|
||||||
* Apr 23, 2015 4259 njensen Removed unused INumpyable
|
* Apr 23, 2015 4259 njensen Removed unused INumpyable
|
||||||
|
* Apr 04, 2016 5539 randerso Fix unsigned byte issues
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -918,7 +919,7 @@ public class DiscreteGridData extends AbstractGridData {
|
||||||
for (int j = 0; j < dim.y; j++) {
|
for (int j = 0; j < dim.y; j++) {
|
||||||
if (points.get(i, j) == 1) {
|
if (points.get(i, j) == 1) {
|
||||||
DiscreteKey combined = DiscreteKey.combine(
|
DiscreteKey combined = DiscreteKey.combine(
|
||||||
key.get(values.get(i, j)),
|
key.get(0xFF & values.get(i, j)),
|
||||||
doGetDiscreteValue(i, j));
|
doGetDiscreteValue(i, j));
|
||||||
grid.set(i, j, lookupKeyValue(combined));
|
grid.set(i, j, lookupKeyValue(combined));
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,6 +76,7 @@ import com.vividsolutions.jts.geom.Coordinate;
|
||||||
* 10/31/2013 2508 randerso Change to use DiscreteGridSlice.getKeys()
|
* 10/31/2013 2508 randerso Change to use DiscreteGridSlice.getKeys()
|
||||||
* 09/01/2014 3572 randerso Removed ourSiteMap as it was unused and the only
|
* 09/01/2014 3572 randerso Removed ourSiteMap as it was unused and the only
|
||||||
* thing that used Grid2DBoolean
|
* thing that used Grid2DBoolean
|
||||||
|
* 04/04/2016 5539 randerso Fix unsigned byte issues
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -462,7 +463,7 @@ public class ISCDataAccess implements IISCDataAccess {
|
||||||
for (int i = 0; i < siteMask.getXdim(); i++) {
|
for (int i = 0; i < siteMask.getXdim(); i++) {
|
||||||
if (siteMask.getAsBoolean(i, j)) {
|
if (siteMask.getAsBoolean(i, j)) {
|
||||||
byte index = lookupKeyValue(keyIndexMap,
|
byte index = lookupKeyValue(keyIndexMap,
|
||||||
iscKey[iscGrid.get(i, j)]);
|
iscKey[0xFF & iscGrid.get(i, j)]);
|
||||||
slice.getWeatherGrid().set(i, j, index);
|
slice.getWeatherGrid().set(i, j, index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -551,7 +552,7 @@ public class ISCDataAccess implements IISCDataAccess {
|
||||||
for (int i = 0; i < siteMask.getXdim(); i++) {
|
for (int i = 0; i < siteMask.getXdim(); i++) {
|
||||||
if (siteMask.getAsBoolean(i, j)) {
|
if (siteMask.getAsBoolean(i, j)) {
|
||||||
byte index = lookupKeyValue(keyIndexMap,
|
byte index = lookupKeyValue(keyIndexMap,
|
||||||
iscKey[iscGrid.get(i, j)]);
|
iscKey[0xFF & iscGrid.get(i, j)]);
|
||||||
slice.getDiscreteGrid().set(i, j, index);
|
slice.getDiscreteGrid().set(i, j, index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -191,6 +191,7 @@ import com.vividsolutions.jts.geom.Coordinate;
|
||||||
* Sep 10, 2015 #4782 randerso Converted inParmEdit to ReentrantLock to force
|
* Sep 10, 2015 #4782 randerso Converted inParmEdit to ReentrantLock to force
|
||||||
* updates to be run consecutively.
|
* updates to be run consecutively.
|
||||||
* Cleaned up TODOs, FIXMEs and deprecations.
|
* Cleaned up TODOs, FIXMEs and deprecations.
|
||||||
|
* Apr 04, 2016 #5539 randerso Fix unsigned byte issues
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -2161,10 +2162,9 @@ public abstract class Parm implements Comparable<Parm> {
|
||||||
.getGridSlice()).getKeys();
|
.getGridSlice()).getKeys();
|
||||||
Grid2DByte grid1 = ((WeatherGridSlice) grids[k]
|
Grid2DByte grid1 = ((WeatherGridSlice) grids[k]
|
||||||
.getGridSlice()).getWeatherGrid();
|
.getGridSlice()).getWeatherGrid();
|
||||||
WeatherKey tmpKey = key1[grid1.get(i, j)];
|
WeatherKey tmpKey = key1[0xFF & grid1.get(i, j)];
|
||||||
WeatherSubKey gpkeys[] = tmpKey.getSubKeys().toArray(
|
WeatherSubKey gpkeys[] = tmpKey.getSubKeys().toArray(
|
||||||
new WeatherSubKey[tmpKey.getSubKeys().size()]);
|
new WeatherSubKey[tmpKey.getSubKeys().size()]);
|
||||||
// key1[grid1(i, j)].subKeys();
|
|
||||||
for (int m = 0; m < gpkeys.length; m++) {
|
for (int m = 0; m < gpkeys.length; m++) {
|
||||||
int index = subKeys.indexOf(gpkeys[m]);
|
int index = subKeys.indexOf(gpkeys[m]);
|
||||||
if (index == -1) {
|
if (index == -1) {
|
||||||
|
@ -2236,8 +2236,7 @@ public abstract class Parm implements Comparable<Parm> {
|
||||||
.getGridSlice()).getKeys();
|
.getGridSlice()).getKeys();
|
||||||
Grid2DByte grid1 = ((DiscreteGridSlice) grids[k]
|
Grid2DByte grid1 = ((DiscreteGridSlice) grids[k]
|
||||||
.getGridSlice()).getDiscreteGrid();
|
.getGridSlice()).getDiscreteGrid();
|
||||||
// TextString kv = key1[grid1(i, j)].keyAsString();
|
DiscreteKey kv = key1[0xFF & grid1.get(i, j)];
|
||||||
DiscreteKey kv = key1[grid1.get(i, j)];
|
|
||||||
// add it to the dictionary
|
// add it to the dictionary
|
||||||
MutableInteger cnt = values.get(kv);
|
MutableInteger cnt = values.get(kv);
|
||||||
if (cnt == null) {
|
if (cnt == null) {
|
||||||
|
@ -3706,7 +3705,7 @@ public abstract class Parm implements Comparable<Parm> {
|
||||||
.getGridSlice());
|
.getGridSlice());
|
||||||
WeatherKey[] key1 = slice.getKeys();
|
WeatherKey[] key1 = slice.getKeys();
|
||||||
Grid2DByte grid1 = slice.getWeatherGrid();
|
Grid2DByte grid1 = slice.getWeatherGrid();
|
||||||
WeatherKey key1ij = key1[grid1.get(i, j)];
|
WeatherKey key1ij = key1[0xFF & grid1.get(i, j)];
|
||||||
subkeys.addAll(key1ij.getSubKeys());
|
subkeys.addAll(key1ij.getSubKeys());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3760,7 +3759,7 @@ public abstract class Parm implements Comparable<Parm> {
|
||||||
.getGridSlice()).getKeys();
|
.getGridSlice()).getKeys();
|
||||||
Grid2DByte grid1 = ((DiscreteGridSlice) grids[k]
|
Grid2DByte grid1 = ((DiscreteGridSlice) grids[k]
|
||||||
.getGridSlice()).getDiscreteGrid();
|
.getGridSlice()).getDiscreteGrid();
|
||||||
DiscreteKey dkv = key1[grid1.get(i, j)];
|
DiscreteKey dkv = key1[0xFF & grid1.get(i, j)];
|
||||||
String dks = dkv.toString();
|
String dks = dkv.toString();
|
||||||
// add it to the dictionary
|
// add it to the dictionary
|
||||||
Integer count = values.get(dks);
|
Integer count = values.get(dks);
|
||||||
|
|
|
@ -35,9 +35,9 @@ import org.eclipse.swt.widgets.ProgressBar;
|
||||||
import org.eclipse.swt.widgets.TabFolder;
|
import org.eclipse.swt.widgets.TabFolder;
|
||||||
|
|
||||||
import com.raytheon.uf.common.dataplugin.gfe.db.objects.DatabaseID;
|
import com.raytheon.uf.common.dataplugin.gfe.db.objects.DatabaseID;
|
||||||
import com.raytheon.uf.viz.core.VizApp;
|
|
||||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||||
import com.raytheon.uf.common.status.UFStatus;
|
import com.raytheon.uf.common.status.UFStatus;
|
||||||
|
import com.raytheon.uf.viz.core.VizApp;
|
||||||
import com.raytheon.viz.gfe.Activator;
|
import com.raytheon.viz.gfe.Activator;
|
||||||
import com.raytheon.viz.gfe.core.DataManager;
|
import com.raytheon.viz.gfe.core.DataManager;
|
||||||
import com.raytheon.viz.gfe.dialogs.FormatterLauncherDialog;
|
import com.raytheon.viz.gfe.dialogs.FormatterLauncherDialog;
|
||||||
|
@ -47,7 +47,6 @@ import com.raytheon.viz.gfe.tasks.TaskManager;
|
||||||
import com.raytheon.viz.gfe.textformatter.FormatterUtil;
|
import com.raytheon.viz.gfe.textformatter.FormatterUtil;
|
||||||
import com.raytheon.viz.gfe.textformatter.TextProductFinishListener;
|
import com.raytheon.viz.gfe.textformatter.TextProductFinishListener;
|
||||||
import com.raytheon.viz.gfe.textformatter.TextProductManager;
|
import com.raytheon.viz.gfe.textformatter.TextProductManager;
|
||||||
import com.raytheon.viz.ui.simulatedtime.SimulatedTimeProhibitedOpException;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Composite containing the product area and its controls.
|
* Composite containing the product area and its controls.
|
||||||
|
@ -79,6 +78,7 @@ import com.raytheon.viz.ui.simulatedtime.SimulatedTimeProhibitedOpException;
|
||||||
* based on the pil of the product rather than the disply name.
|
* based on the pil of the product rather than the disply name.
|
||||||
* 18 FEB 2016 13033 yteng Improve error message for bad characters in text formatter
|
* 18 FEB 2016 13033 yteng Improve error message for bad characters in text formatter
|
||||||
* definitions.
|
* definitions.
|
||||||
|
* 14 APR 2016 5578 dgilling Support changes to FormatterUtil.runFormatterScript.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -399,28 +399,29 @@ public class ProductAreaComp extends Composite implements
|
||||||
String pil = "";
|
String pil = "";
|
||||||
try {
|
try {
|
||||||
pil = (String) textProductMgr
|
pil = (String) textProductMgr
|
||||||
.getDefinitionValue(productName, "pil");
|
.getDefinitionValue(productName,
|
||||||
|
"pil");
|
||||||
} catch (ClassCastException e) {
|
} catch (ClassCastException e) {
|
||||||
statusHandler.error("Invalid pil value: "
|
statusHandler.error(
|
||||||
|
"Invalid pil value: "
|
||||||
+ textProductMgr
|
+ textProductMgr
|
||||||
.getDefinitionValue(productName, "pil"), e);
|
.getDefinitionValue(
|
||||||
|
productName,
|
||||||
|
"pil"), e);
|
||||||
}
|
}
|
||||||
if (pil != null) {
|
if (pil != null) {
|
||||||
pil = pil.substring(0, 3);
|
pil = pil.substring(0, 3);
|
||||||
vtecMode = textProductMgr.getVtecMessageType(pil);
|
vtecMode = textProductMgr
|
||||||
|
.getVtecMessageType(pil);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the source database
|
// Get the source database
|
||||||
zoneCombiner.applyZoneCombo();
|
zoneCombiner.applyZoneCombo();
|
||||||
try {
|
|
||||||
FormatterUtil.runFormatterScript(dataMgr,
|
FormatterUtil.runFormatterScript(dataMgr,
|
||||||
textProductMgr, productName,
|
textProductMgr, productName,
|
||||||
dbId.toString(), vtecMode,
|
dbId.toString(), vtecMode,
|
||||||
ProductAreaComp.this);
|
ProductAreaComp.this);
|
||||||
} catch (SimulatedTimeProhibitedOpException e) {
|
|
||||||
statusHandler.error(e.getLocalizedMessage(), e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -663,9 +664,19 @@ public class ProductAreaComp extends Composite implements
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void textProductQueued(ConfigData.ProductStateEnum state) {
|
public void textProductQueued(final ConfigData.ProductStateEnum state) {
|
||||||
|
if (isTabClosed) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
VizApp.runSyncIfWorkbench(new Runnable() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
productTabCB.setTabState(state, productName);
|
productTabCB.setTabState(state, productName);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void textProductFinished(final String productText,
|
public void textProductFinished(final String productText,
|
||||||
|
|
|
@ -125,6 +125,7 @@ import com.raytheon.viz.gfe.Activator;
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Jun 2, 2008 #1161 randerso Initial creation
|
* Jun 2, 2008 #1161 randerso Initial creation
|
||||||
* Oct 31, 2013 #2508 randerso Change to use DiscreteGridSlice.getKeys()
|
* Oct 31, 2013 #2508 randerso Change to use DiscreteGridSlice.getKeys()
|
||||||
|
* Apr 04, 2016 #5539 randerso Fix unsigned byte issues
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -479,7 +480,7 @@ public class DiscreteInterp extends Interp {
|
||||||
// input byte index grids, but with values for the weatherKeys
|
// input byte index grids, but with values for the weatherKeys
|
||||||
// in _allKeys.
|
// in _allKeys.
|
||||||
|
|
||||||
byte index;
|
int index;
|
||||||
DiscreteKey key;
|
DiscreteKey key;
|
||||||
|
|
||||||
// For every grid point in the grids, load the new working grids
|
// For every grid point in the grids, load the new working grids
|
||||||
|
@ -488,7 +489,7 @@ public class DiscreteInterp extends Interp {
|
||||||
for (i = 0; i < _xDim; i++) {
|
for (i = 0; i < _xDim; i++) {
|
||||||
for (j = 0; j < _yDim; j++) {
|
for (j = 0; j < _yDim; j++) {
|
||||||
// get the index value from the actual first input grid of bytes
|
// get the index value from the actual first input grid of bytes
|
||||||
index = grid1.get(i, j);
|
index = 0xFF & grid1.get(i, j);
|
||||||
|
|
||||||
// Can save a lot of processing here if index=0
|
// Can save a lot of processing here if index=0
|
||||||
// ALWAYS means "no weather": the workGrid1 and 2 values
|
// ALWAYS means "no weather": the workGrid1 and 2 values
|
||||||
|
@ -508,7 +509,7 @@ public class DiscreteInterp extends Interp {
|
||||||
|
|
||||||
// get the index value from the actual second input grid of
|
// get the index value from the actual second input grid of
|
||||||
// bytes
|
// bytes
|
||||||
index = grid2.get(i, j);
|
index = 0xFF & grid2.get(i, j);
|
||||||
// get its key
|
// get its key
|
||||||
key = keys2[index];
|
key = keys2[index];
|
||||||
// find this key in the new list, and save the corresponding
|
// find this key in the new list, and save the corresponding
|
||||||
|
|
|
@ -23,7 +23,14 @@ import java.text.DateFormat;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.TimeZone;
|
import java.util.TimeZone;
|
||||||
|
|
||||||
|
import org.eclipse.core.runtime.IProgressMonitor;
|
||||||
|
import org.eclipse.core.runtime.IStatus;
|
||||||
|
import org.eclipse.core.runtime.Status;
|
||||||
|
import org.eclipse.core.runtime.jobs.Job;
|
||||||
|
|
||||||
import com.raytheon.uf.common.activetable.ActiveTableMode;
|
import com.raytheon.uf.common.activetable.ActiveTableMode;
|
||||||
|
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||||
|
import com.raytheon.uf.common.status.UFStatus;
|
||||||
import com.raytheon.uf.common.time.SimulatedTime;
|
import com.raytheon.uf.common.time.SimulatedTime;
|
||||||
import com.raytheon.uf.common.time.TimeRange;
|
import com.raytheon.uf.common.time.TimeRange;
|
||||||
import com.raytheon.viz.core.mode.CAVEMode;
|
import com.raytheon.viz.core.mode.CAVEMode;
|
||||||
|
@ -52,6 +59,8 @@ import com.raytheon.viz.ui.simulatedtime.SimulatedTimeProhibitedOpException;
|
||||||
* Aug 26, 2015 4804 dgilling Add methods so SmartScript can run formatters.
|
* Aug 26, 2015 4804 dgilling Add methods so SmartScript can run formatters.
|
||||||
* Sep 15, 2015 4858 dgilling Disable store/transmit in DRT mode.
|
* Sep 15, 2015 4858 dgilling Disable store/transmit in DRT mode.
|
||||||
* Oct 01, 2015 4888 dgilling Fix javadoc for exceptions.
|
* Oct 01, 2015 4888 dgilling Fix javadoc for exceptions.
|
||||||
|
* Apr 14, 2016 5578 dgilling Ensure formatters launched interactively
|
||||||
|
* ask for varDict before execution.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -61,6 +70,9 @@ import com.raytheon.viz.ui.simulatedtime.SimulatedTimeProhibitedOpException;
|
||||||
|
|
||||||
public class FormatterUtil {
|
public class FormatterUtil {
|
||||||
|
|
||||||
|
private static final IUFStatusHandler statusHandler = UFStatus
|
||||||
|
.getHandler(FormatterUtil.class);
|
||||||
|
|
||||||
public static final String[] VTEC_MODES = { "Normal: NoVTEC",
|
public static final String[] VTEC_MODES = { "Normal: NoVTEC",
|
||||||
"Normal: O-Vtec", "Normal: E-Vtec", "Normal: X-Vtec",
|
"Normal: O-Vtec", "Normal: E-Vtec", "Normal: X-Vtec",
|
||||||
"Test: NoVTEC", "Test: T-Vtec" };
|
"Test: NoVTEC", "Test: T-Vtec" };
|
||||||
|
@ -85,20 +97,43 @@ public class FormatterUtil {
|
||||||
* VTEC mode
|
* VTEC mode
|
||||||
* @param finish
|
* @param finish
|
||||||
* listener to fire when formatter finishes generating product
|
* listener to fire when formatter finishes generating product
|
||||||
* @throws SimulatedTimeProhibitedOperationException
|
*
|
||||||
*/
|
*/
|
||||||
public static void runFormatterScript(DataManager dataMgr,
|
public static void runFormatterScript(final DataManager dataMgr,
|
||||||
TextProductManager productMgr, String productName, String dbId,
|
final TextProductManager productMgr, final String productName,
|
||||||
String vtecMode, TextProductFinishListener finish)
|
final String dbId, final String vtecMode,
|
||||||
throws SimulatedTimeProhibitedOpException {
|
final TextProductFinishListener finish) {
|
||||||
|
/*
|
||||||
|
* we wrap this inside an eclipse Job so that we aren't blocking the UI
|
||||||
|
* thread by waiting for the varDict result. Waiting on the varDict on
|
||||||
|
* the UI thread would cause a deadlock because ValuesDialog requires
|
||||||
|
* use of VizApp.runAsync.
|
||||||
|
*/
|
||||||
|
Job runFormatterJob = new Job("Running product formatter") {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected IStatus run(IProgressMonitor monitor) {
|
||||||
String activeTable = getActiveTableName(dataMgr);
|
String activeTable = getActiveTableName(dataMgr);
|
||||||
int testMode = getTestMode(dataMgr, vtecMode);
|
int testMode = getTestMode(dataMgr, vtecMode);
|
||||||
String shortVtec = getVTECModeCode(vtecMode);
|
String shortVtec = getVTECModeCode(vtecMode);
|
||||||
String name = productMgr.getModuleName(productName);
|
String name = productMgr.getModuleName(productName);
|
||||||
String time = getDRTString();
|
String time = getDRTString();
|
||||||
|
String varDict = dataMgr.getTextProductMgr().obtainVarDictSelections(name,
|
||||||
|
dataMgr, dbId);
|
||||||
|
|
||||||
runFormatterScript(name, shortVtec, dbId, activeTable, time, testMode,
|
try {
|
||||||
finish, dataMgr);
|
runFormatterScript(name, shortVtec, dbId, varDict,
|
||||||
|
activeTable, time, testMode, finish, dataMgr);
|
||||||
|
} catch (Exception e) {
|
||||||
|
statusHandler.error(String.format(
|
||||||
|
"Error running text formatter %s", productName), e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Status.OK_STATUS;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
runFormatterJob.setSystem(true);
|
||||||
|
runFormatterJob.schedule();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -134,14 +169,6 @@ public class FormatterUtil {
|
||||||
testMode, listener, dataMgr);
|
testMode, listener, dataMgr);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void runFormatterScript(String name, String vtecMode,
|
|
||||||
String databaseID, String vtecActiveTable, String drtTime,
|
|
||||||
int testMode, TextProductFinishListener finish, DataManager dataMgr)
|
|
||||||
throws SimulatedTimeProhibitedOpException {
|
|
||||||
runFormatterScript(name, vtecMode, databaseID, null, vtecActiveTable,
|
|
||||||
drtTime, testMode, finish, dataMgr);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void runFormatterScript(String name, String vtecMode,
|
public static void runFormatterScript(String name, String vtecMode,
|
||||||
String databaseID, String varDict, String vtecActiveTable,
|
String databaseID, String varDict, String vtecActiveTable,
|
||||||
String drtTime, int testMode, TextProductFinishListener finish,
|
String drtTime, int testMode, TextProductFinishListener finish,
|
||||||
|
|
|
@ -25,10 +25,6 @@ import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import jep.JepException;
|
|
||||||
|
|
||||||
import com.raytheon.uf.common.dataplugin.gfe.db.objects.DatabaseID;
|
|
||||||
import com.raytheon.uf.common.dataplugin.gfe.python.GfePyIncludeUtil;
|
|
||||||
import com.raytheon.uf.common.status.IPerformanceStatusHandler;
|
import com.raytheon.uf.common.status.IPerformanceStatusHandler;
|
||||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||||
import com.raytheon.uf.common.status.PerformanceStatus;
|
import com.raytheon.uf.common.status.PerformanceStatus;
|
||||||
|
@ -37,7 +33,6 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||||
import com.raytheon.uf.common.time.SimulatedTime;
|
import com.raytheon.uf.common.time.SimulatedTime;
|
||||||
import com.raytheon.uf.common.time.util.ITimer;
|
import com.raytheon.uf.common.time.util.ITimer;
|
||||||
import com.raytheon.uf.common.time.util.TimeUtil;
|
import com.raytheon.uf.common.time.util.TimeUtil;
|
||||||
import com.raytheon.uf.common.util.StringUtil;
|
|
||||||
import com.raytheon.viz.gfe.core.DataManager;
|
import com.raytheon.viz.gfe.core.DataManager;
|
||||||
import com.raytheon.viz.gfe.dialogs.formatterlauncher.ConfigData;
|
import com.raytheon.viz.gfe.dialogs.formatterlauncher.ConfigData;
|
||||||
import com.raytheon.viz.gfe.dialogs.formatterlauncher.ConfigData.ProductStateEnum;
|
import com.raytheon.viz.gfe.dialogs.formatterlauncher.ConfigData.ProductStateEnum;
|
||||||
|
@ -65,6 +60,7 @@ import com.raytheon.viz.gfe.tasks.AbstractGfeTask;
|
||||||
* Aug 26, 2015 #4804 dgilling Support ability to run TextFormatters
|
* Aug 26, 2015 #4804 dgilling Support ability to run TextFormatters
|
||||||
* from SmartScript.
|
* from SmartScript.
|
||||||
* Dec 08, 2015 #5129 dgilling Pass IFPClient to getVarDict.
|
* Dec 08, 2015 #5129 dgilling Pass IFPClient to getVarDict.
|
||||||
|
* Apr 14, 2016 #5578 dgilling Remove getVarDict.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -166,9 +162,7 @@ public class TextFormatter extends AbstractGfeTask {
|
||||||
argMap.put(ArgDictConstants.VTEC_MODE, vtecMode);
|
argMap.put(ArgDictConstants.VTEC_MODE, vtecMode);
|
||||||
argMap.put(ArgDictConstants.VTEC_ACTIVE_TABLE, vtecActiveTable);
|
argMap.put(ArgDictConstants.VTEC_ACTIVE_TABLE, vtecActiveTable);
|
||||||
argMap.put("drtTime", drtTime);
|
argMap.put("drtTime", drtTime);
|
||||||
if (!StringUtil.isEmptyString(varDict)) {
|
|
||||||
argMap.put(ArgDictConstants.CMDLINE_VARDICT, varDict);
|
argMap.put(ArgDictConstants.CMDLINE_VARDICT, varDict);
|
||||||
}
|
|
||||||
|
|
||||||
listener = finish;
|
listener = finish;
|
||||||
this.state = ConfigData.ProductStateEnum.Queued;
|
this.state = ConfigData.ProductStateEnum.Queued;
|
||||||
|
@ -187,14 +181,6 @@ public class TextFormatter extends AbstractGfeTask {
|
||||||
|
|
||||||
String productName = (String) argMap
|
String productName = (String) argMap
|
||||||
.get(ArgDictConstants.FORECAST_LIST);
|
.get(ArgDictConstants.FORECAST_LIST);
|
||||||
String issuedBy = dataMgr.getTextProductMgr().getIssuedBy();
|
|
||||||
String dbId = (String) argMap.get(ArgDictConstants.DATABASE_ID);
|
|
||||||
|
|
||||||
if (!argMap.containsKey(ArgDictConstants.CMDLINE_VARDICT)) {
|
|
||||||
String varDict = getVarDict(productName, dataMgr, dbId,
|
|
||||||
issuedBy, script);
|
|
||||||
argMap.put(ArgDictConstants.CMDLINE_VARDICT, varDict);
|
|
||||||
}
|
|
||||||
|
|
||||||
String varDict = (String) argMap
|
String varDict = (String) argMap
|
||||||
.get(ArgDictConstants.CMDLINE_VARDICT);
|
.get(ArgDictConstants.CMDLINE_VARDICT);
|
||||||
|
@ -282,22 +268,6 @@ public class TextFormatter extends AbstractGfeTask {
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getVarDict(String productName, DataManager dataManager,
|
|
||||||
String dbId, String issuedBy, FormatterScript script)
|
|
||||||
throws JepException {
|
|
||||||
Map<String, Object> map = new HashMap<String, Object>(5, 1f);
|
|
||||||
map.put("paths", GfePyIncludeUtil.getTextProductsIncludePath());
|
|
||||||
map.put("dspName",
|
|
||||||
dataManager.getTextProductMgr().getDisplayName(productName));
|
|
||||||
map.put("dataMgr", dataManager);
|
|
||||||
map.put("ifpClient", dataManager.getClient().getPythonClient());
|
|
||||||
map.put("issuedBy", issuedBy);
|
|
||||||
map.put("dataSource", new DatabaseID(dbId).getModelName());
|
|
||||||
|
|
||||||
String varDict = (String) script.execute("getVarDict", map);
|
|
||||||
return varDict;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void cleanUp() {
|
public void cleanUp() {
|
||||||
super.cleanUp();
|
super.cleanUp();
|
||||||
|
|
|
@ -42,6 +42,7 @@ import com.raytheon.uf.common.python.concurrent.PythonJobCoordinator;
|
||||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||||
import com.raytheon.uf.common.status.UFStatus;
|
import com.raytheon.uf.common.status.UFStatus;
|
||||||
import com.raytheon.uf.viz.core.localization.LocalizationManager;
|
import com.raytheon.uf.viz.core.localization.LocalizationManager;
|
||||||
|
import com.raytheon.viz.gfe.core.DataManager;
|
||||||
import com.raytheon.viz.gfe.core.IAsyncStartupObjectListener;
|
import com.raytheon.viz.gfe.core.IAsyncStartupObjectListener;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -62,6 +63,7 @@ import com.raytheon.viz.gfe.core.IAsyncStartupObjectListener;
|
||||||
* Jul 30, 2015 4263 dgilling Major refactor so this object can be initialized off
|
* Jul 30, 2015 4263 dgilling Major refactor so this object can be initialized off
|
||||||
* UI thread.
|
* UI thread.
|
||||||
* Dec 14, 2015 4816 dgilling Support refactored PythonJobCoordinator API.
|
* Dec 14, 2015 4816 dgilling Support refactored PythonJobCoordinator API.
|
||||||
|
* Apr 14, 2016 5578 dgilling Add getVarDict.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -263,6 +265,39 @@ public class TextProductManager implements ILocalizationFileObserver {
|
||||||
return productDef;
|
return productDef;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the varDict for the given text formatter. In GFE, the varDict is
|
||||||
|
* a Map (or dict) containing the user's selections from an optional popup
|
||||||
|
* dialog that can appear before executing a formatter.
|
||||||
|
* <p>
|
||||||
|
* To retrieve the varDict this will require a call into Jep (specifically
|
||||||
|
* FormatterRunner.py's getVarDict method) to retrieve the varDict.
|
||||||
|
* Depending on whether or not the formatter script defines the global
|
||||||
|
* variable variableList, this may cause an instance of ValuesDialog to
|
||||||
|
* display.
|
||||||
|
* <p>
|
||||||
|
* Do NOT call this function from the UI thread of CAVE or it will deadlock
|
||||||
|
* the application.
|
||||||
|
*
|
||||||
|
* @param productName
|
||||||
|
* @param dataManager
|
||||||
|
* @param dbId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String obtainVarDictSelections(String productName, DataManager dataManager,
|
||||||
|
String dbId) {
|
||||||
|
String varDict = null;
|
||||||
|
try {
|
||||||
|
varDict = jobCoordinator.submitJob(
|
||||||
|
new TextProductVarDictExecutor(getDisplayName(productName),
|
||||||
|
dataManager, issuedBy, dbId)).get();
|
||||||
|
} catch (Exception e) {
|
||||||
|
statusHandler.error(String.format(
|
||||||
|
"Error retrieving varDict for product %s", productName), e);
|
||||||
|
}
|
||||||
|
return varDict;
|
||||||
|
}
|
||||||
|
|
||||||
public String getVtecMessageType(String productCategory) {
|
public String getVtecMessageType(String productCategory) {
|
||||||
String vtec = productDefaultVtecCoding.get(productCategory);
|
String vtec = productDefaultVtecCoding.get(productCategory);
|
||||||
if (vtec == null) {
|
if (vtec == null) {
|
||||||
|
|
|
@ -0,0 +1,82 @@
|
||||||
|
/**
|
||||||
|
* This software was developed and / or modified by Raytheon Company,
|
||||||
|
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||||
|
*
|
||||||
|
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||||
|
* This software product contains export-restricted data whose
|
||||||
|
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||||
|
* to non-U.S. persons whether in the United States or abroad requires
|
||||||
|
* an export license or other authorization.
|
||||||
|
*
|
||||||
|
* Contractor Name: Raytheon Company
|
||||||
|
* Contractor Address: 6825 Pine Street, Suite 340
|
||||||
|
* Mail Stop B8
|
||||||
|
* Omaha, NE 68106
|
||||||
|
* 402.291.0100
|
||||||
|
*
|
||||||
|
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||||
|
* further licensing information.
|
||||||
|
**/
|
||||||
|
package com.raytheon.viz.gfe.textformatter;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import jep.JepException;
|
||||||
|
|
||||||
|
import com.raytheon.uf.common.dataplugin.gfe.db.objects.DatabaseID;
|
||||||
|
import com.raytheon.uf.common.dataplugin.gfe.python.GfePyIncludeUtil;
|
||||||
|
import com.raytheon.uf.common.python.concurrent.IPythonExecutor;
|
||||||
|
import com.raytheon.viz.gfe.core.DataManager;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Executor object to get the user's selections from the formatter's
|
||||||
|
* ValuesDialog.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
*
|
||||||
|
* SOFTWARE HISTORY
|
||||||
|
*
|
||||||
|
* Date Ticket# Engineer Description
|
||||||
|
* ------------ ---------- ----------- --------------------------
|
||||||
|
* Apr 14, 2016 #5578 dgilling Initial creation
|
||||||
|
*
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* @author dgilling
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
public final class TextProductVarDictExecutor implements
|
||||||
|
IPythonExecutor<FormatterScript, String> {
|
||||||
|
|
||||||
|
private final String displayName;
|
||||||
|
|
||||||
|
private final DataManager dataMgr;
|
||||||
|
|
||||||
|
private final String issuedBy;
|
||||||
|
|
||||||
|
private final DatabaseID dbID;
|
||||||
|
|
||||||
|
public TextProductVarDictExecutor(String displayName, DataManager dataMgr,
|
||||||
|
String issuedBy, String dbID) {
|
||||||
|
this.displayName = displayName;
|
||||||
|
this.dataMgr = dataMgr;
|
||||||
|
this.issuedBy = issuedBy;
|
||||||
|
this.dbID = new DatabaseID(dbID);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String execute(FormatterScript script) throws JepException {
|
||||||
|
Map<String, Object> map = new HashMap<String, Object>(5, 1f);
|
||||||
|
map.put("paths", GfePyIncludeUtil.getTextProductsIncludePath());
|
||||||
|
map.put("dspName", displayName);
|
||||||
|
map.put("dataMgr", dataMgr);
|
||||||
|
map.put("ifpClient", dataMgr.getClient().getPythonClient());
|
||||||
|
map.put("issuedBy", issuedBy);
|
||||||
|
map.put("dataSource", dbID.getModelName());
|
||||||
|
|
||||||
|
String varDict = (String) script.execute("getVarDict", map);
|
||||||
|
return varDict;
|
||||||
|
}
|
||||||
|
}
|
|
@ -87,7 +87,7 @@ plotDelegate = ObsPlotDelegate()
|
||||||
<text id="pressChngText" plotMode="text" plotParam="pressChange3Hour" plotFormat="%02.0f" plotUnit="Pa" style="text-anchor: start;" x="10px" y="0">018</text>
|
<text id="pressChngText" plotMode="text" plotParam="pressChange3Hour" plotFormat="%02.0f" plotUnit="Pa" style="text-anchor: start;" x="10px" y="0">018</text>
|
||||||
<text id="dewText" plotMode="text" plotParam="DpT" plotUnit="°F" plotFormat="%3.0f" style="text-anchor: end;" x="-10px" y="10px">59</text>
|
<text id="dewText" plotMode="text" plotParam="DpT" plotUnit="°F" plotFormat="%3.0f" style="text-anchor: end;" x="-10px" y="10px">59</text>
|
||||||
<text id="tempText" plotMode="text" plotParam="T" plotUnit="°F" plotFormat="%3.0f" style="text-anchor: end;" x="-10px" y="-10px">75</text>
|
<text id="tempText" plotMode="text" plotParam="T" plotUnit="°F" plotFormat="%3.0f" style="text-anchor: end;" x="-10px" y="-10px">75</text>
|
||||||
<text id="pressure" plotMode="text" plotParam="seaLevelPress" plotUnit="dPa" plotFormat="%5.0f" plotTrim="2" style="text-anchor: start;" x="10px" y="-10px">018</text>
|
<text id="pressure" plotMode="text" plotParam="seaLevelPress" plotUnit="kPa" plotFormat="%5.0f" plotTrim="2" style="text-anchor: start;" x="10px" y="-10px">018</text>
|
||||||
<text id="cloudText" plotMode="table" class="special" plotFunctionTable="cloud_select.txt" plotLookupTable="cloud_chars.txt" plotParam="skyCover" style="text-anchor: start" x="0" y="0">0</text>
|
<text id="cloudText" plotMode="table" class="special" plotFunctionTable="cloud_select.txt" plotLookupTable="cloud_chars.txt" plotParam="skyCover" style="text-anchor: start" x="0" y="0">0</text>
|
||||||
<text id="presentWxText" plotMode="recursive_translation" class="weather" plotLookupTable="wx_symbol_trans.txt" plotParam="presWeather" style="text-anchor: end" x="-10" y="0">0</text>
|
<text id="presentWxText" plotMode="recursive_translation" class="weather" plotLookupTable="wx_symbol_trans.txt" plotParam="presWeather" style="text-anchor: end" x="-10" y="0">0</text>
|
||||||
<text id="peakWind" plotMode="text" plotParam="pkwndSpeed" plotUnit="kts" plotFormat="PK%.0f" style="text-anchor: end;" x="-10px" y="20px">59</text>
|
<text id="peakWind" plotMode="text" plotParam="pkwndSpeed" plotUnit="kts" plotFormat="PK%.0f" style="text-anchor: end;" x="-10px" y="20px">59</text>
|
||||||
|
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
|
@ -19,7 +19,7 @@
|
||||||
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="toolbarSubMenu" menuText="Probablistic Forecasts">
|
<contribute xsi:type="toolbarSubMenu" menuText="Probabilistic Forecasts">
|
||||||
<contribute xsi:type="toolbarSubMenu" menuText="12hr">
|
<contribute xsi:type="toolbarSubMenu" menuText="12hr">
|
||||||
<contribute xsi:type="menuItem" menuText="12hr 5th Percentile Snow accumulation" key="TOTSN5pct12hr" indentText="false" />
|
<contribute xsi:type="menuItem" menuText="12hr 5th Percentile Snow accumulation" key="TOTSN5pct12hr" indentText="false" />
|
||||||
<contribute xsi:type="menuItem" menuText="12hr 10th Percentile Snow accumulation" key="TOTSN10pct12hr" indentText="false" />
|
<contribute xsi:type="menuItem" menuText="12hr 10th Percentile Snow accumulation" key="TOTSN10pct12hr" indentText="false" />
|
||||||
|
|
34
deltaScripts/TO56/DR5345/_update_metar_slp_values.py
Executable file
34
deltaScripts/TO56/DR5345/_update_metar_slp_values.py
Executable file
|
@ -0,0 +1,34 @@
|
||||||
|
#!/usr/bin/env python2
|
||||||
|
|
||||||
|
# #5345
|
||||||
|
# Convert sea level pressure from hPa to Pa in an hdf5 file
|
||||||
|
# Do nothing if all values are already in Pa
|
||||||
|
|
||||||
|
import sys
|
||||||
|
import h5py
|
||||||
|
|
||||||
|
def main():
|
||||||
|
if len(sys.argv) != 2:
|
||||||
|
print "usage: {} filename.h5".format(sys.argv[0])
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
didstuff = False
|
||||||
|
try:
|
||||||
|
with h5py.File(sys.argv[1], 'r+') as f:
|
||||||
|
if 'seaLevelPress' in f:
|
||||||
|
for i, data in enumerate(f['seaLevelPress']):
|
||||||
|
if data > 0 and data < 1999:
|
||||||
|
f['seaLevelPress'][i] = data * 100.0
|
||||||
|
didstuff = True
|
||||||
|
except Exception as e:
|
||||||
|
print "ERROR: " + str(sys.exc_info()[0]) + ": " + str(e)
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
if didstuff:
|
||||||
|
print "INFO: {}: updated".format(sys.argv[1])
|
||||||
|
else:
|
||||||
|
print "INFO: {}: no update needed".format(sys.argv[1])
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
21
deltaScripts/TO56/DR5345/update_metar_slp_values.sh
Executable file
21
deltaScripts/TO56/DR5345/update_metar_slp_values.sh
Executable file
|
@ -0,0 +1,21 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# #5345
|
||||||
|
# Convert sea level pressure from hPa to Pa in all h5 files
|
||||||
|
|
||||||
|
TARGET=/awips2/edex/data/hdf5/obs
|
||||||
|
THIS_LOCATION=$(dirname $0)
|
||||||
|
success=0
|
||||||
|
|
||||||
|
for item in $(find $TARGET -type f -name "*.h5"); do
|
||||||
|
$THIS_LOCATION/_update_metar_slp_values.py $item
|
||||||
|
if [[ $? -ne 0 ]]; then
|
||||||
|
success=1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [[ success -eq 0 ]]; then
|
||||||
|
echo INFO: No errors reported.
|
||||||
|
else
|
||||||
|
echo "ERROR: There was a problem with one or more updates; see above."
|
||||||
|
fi
|
|
@ -79,8 +79,9 @@ import com.vividsolutions.jts.geom.Coordinate;
|
||||||
* 02/19/13 #1637 randerso Added exception handling for Discrete and Weather
|
* 02/19/13 #1637 randerso Added exception handling for Discrete and Weather
|
||||||
* 10/31/2013 #2508 randerso Change to use DiscreteGridSlice.getKeys()
|
* 10/31/2013 #2508 randerso Change to use DiscreteGridSlice.getKeys()
|
||||||
* 04/22/2014 #3050 randerso Allow exceptions to propagate to caller from readASCIIGridData
|
* 04/22/2014 #3050 randerso Allow exceptions to propagate to caller from readASCIIGridData
|
||||||
* Jan 14, 2016 #5237 tgurney Allow outputAsciiGridData to take
|
* 01/14/2016 #5237 tgurney Allow outputAsciiGridData to take
|
||||||
* OutputStream as well as File
|
* OutputStream as well as File
|
||||||
|
* 04/04/2016 #5539 randerso Fixed unsigned byte issues
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -341,7 +342,7 @@ public class ASCIIGrid {
|
||||||
WeatherGridSlice weather = (WeatherGridSlice) gs;
|
WeatherGridSlice weather = (WeatherGridSlice) gs;
|
||||||
for (int i = weather.getWeatherGrid().getYdim() - 1; i >= 0; i--) {
|
for (int i = weather.getWeatherGrid().getYdim() - 1; i >= 0; i--) {
|
||||||
for (int j = 0; j < weather.getWeatherGrid().getXdim(); j++) {
|
for (int j = 0; j < weather.getWeatherGrid().getXdim(); j++) {
|
||||||
String key = weather.getKeys()[weather
|
String key = weather.getKeys()[0xFF & weather
|
||||||
.getWeatherGrid().get(j, i)].toString();
|
.getWeatherGrid().get(j, i)].toString();
|
||||||
printStream.println(key);
|
printStream.println(key);
|
||||||
}
|
}
|
||||||
|
@ -352,7 +353,7 @@ public class ASCIIGrid {
|
||||||
for (int i = discrete.getDiscreteGrid().getYdim() - 1; i >= 0; i--) {
|
for (int i = discrete.getDiscreteGrid().getYdim() - 1; i >= 0; i--) {
|
||||||
for (int j = 0; j < discrete.getDiscreteGrid()
|
for (int j = 0; j < discrete.getDiscreteGrid()
|
||||||
.getXdim(); j++) {
|
.getXdim(); j++) {
|
||||||
String key = discrete.getKeys()[discrete
|
String key = discrete.getKeys()[0xFF & discrete
|
||||||
.getDiscreteGrid().get(j, i)].toString();
|
.getDiscreteGrid().get(j, i)].toString();
|
||||||
printStream.println(key);
|
printStream.println(key);
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,8 +35,8 @@ import javax.measure.unit.Unit;
|
||||||
import com.raytheon.edex.plugin.gfe.server.IFPServer;
|
import com.raytheon.edex.plugin.gfe.server.IFPServer;
|
||||||
import com.raytheon.edex.plugin.gfe.server.database.GridDatabase;
|
import com.raytheon.edex.plugin.gfe.server.database.GridDatabase;
|
||||||
import com.raytheon.uf.common.dataplugin.gfe.db.objects.DatabaseID;
|
import com.raytheon.uf.common.dataplugin.gfe.db.objects.DatabaseID;
|
||||||
import com.raytheon.uf.common.dataplugin.gfe.db.objects.GridParmInfo.GridType;
|
|
||||||
import com.raytheon.uf.common.dataplugin.gfe.db.objects.GridLocation;
|
import com.raytheon.uf.common.dataplugin.gfe.db.objects.GridLocation;
|
||||||
|
import com.raytheon.uf.common.dataplugin.gfe.db.objects.GridParmInfo.GridType;
|
||||||
import com.raytheon.uf.common.dataplugin.gfe.db.objects.ParmID;
|
import com.raytheon.uf.common.dataplugin.gfe.db.objects.ParmID;
|
||||||
import com.raytheon.uf.common.dataplugin.gfe.point.GFEPointDataContainer;
|
import com.raytheon.uf.common.dataplugin.gfe.point.GFEPointDataContainer;
|
||||||
import com.raytheon.uf.common.dataplugin.gfe.point.GFEPointDataContainers;
|
import com.raytheon.uf.common.dataplugin.gfe.point.GFEPointDataContainers;
|
||||||
|
@ -70,6 +70,7 @@ import com.vividsolutions.jts.geom.Coordinate;
|
||||||
* Jun 13, 2013 #2044 randerso Refactored to use IFPServer
|
* Jun 13, 2013 #2044 randerso Refactored to use IFPServer
|
||||||
* Oct 31, 2013 #2508 randerso Change to use DiscreteGridSlice.getKeys()
|
* Oct 31, 2013 #2508 randerso Change to use DiscreteGridSlice.getKeys()
|
||||||
* Apr 23, 2014 #3006 randerso Restructured code to work with multi-hour grids
|
* Apr 23, 2014 #3006 randerso Restructured code to work with multi-hour grids
|
||||||
|
* Apr 04, 2016 #5539 randerso Fixed unsigned byte issues
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -209,7 +210,7 @@ public class GetPointDataHandler extends BaseGfeRequestHandler implements
|
||||||
byte discreteValue = discreteSlice
|
byte discreteValue = discreteSlice
|
||||||
.getDiscreteGrid().get(x, y);
|
.getDiscreteGrid().get(x, y);
|
||||||
String discreteKey = discreteSlice
|
String discreteKey = discreteSlice
|
||||||
.getKeys()[discreteValue]
|
.getKeys()[0xFF & discreteValue]
|
||||||
.toString();
|
.toString();
|
||||||
type = Type.STRING;
|
type = Type.STRING;
|
||||||
view.setData(param, type, unit, discreteKey);
|
view.setData(param, type, unit, discreteKey);
|
||||||
|
@ -218,7 +219,7 @@ public class GetPointDataHandler extends BaseGfeRequestHandler implements
|
||||||
WeatherGridSlice weatherSlice = (WeatherGridSlice) slice;
|
WeatherGridSlice weatherSlice = (WeatherGridSlice) slice;
|
||||||
byte wxValue = weatherSlice
|
byte wxValue = weatherSlice
|
||||||
.getWeatherGrid().get(x, y);
|
.getWeatherGrid().get(x, y);
|
||||||
String wxKey = weatherSlice.getKeys()[wxValue]
|
String wxKey = weatherSlice.getKeys()[0xFF & wxValue]
|
||||||
.toString();
|
.toString();
|
||||||
type = Type.STRING;
|
type = Type.STRING;
|
||||||
view.setData(param, type, unit, wxKey);
|
view.setData(param, type, unit, wxKey);
|
||||||
|
|
|
@ -41,6 +41,8 @@
|
||||||
# 05/13/2015 4427 dgilling Add siteIdOverride field.
|
# 05/13/2015 4427 dgilling Add siteIdOverride field.
|
||||||
# 08/06/2015 4718 dgilling Optimize casting when using where with
|
# 08/06/2015 4718 dgilling Optimize casting when using where with
|
||||||
# NumPy 1.9.
|
# NumPy 1.9.
|
||||||
|
# 04/07/2016 5539 randerso Reversed order of parameters/return value in collapseKey
|
||||||
|
# to match order of Wx/Discrete tuple
|
||||||
#
|
#
|
||||||
##
|
##
|
||||||
|
|
||||||
|
@ -924,21 +926,20 @@ def storeVectorWE(we, trList, file, timeRange,
|
||||||
|
|
||||||
###-------------------------------------------------------------------------###
|
###-------------------------------------------------------------------------###
|
||||||
# Collapse key and bytes. (for discrete and weather)
|
# Collapse key and bytes. (for discrete and weather)
|
||||||
### Returns tuple of (updated key, updated grid)
|
### Returns tuple of (updated grid, updated key)
|
||||||
def collapseKey(keys, grid):
|
def collapseKey(grid, keys):
|
||||||
#make list of unique indexes in the grid
|
#make list of unique indexes in the grid
|
||||||
flatGrid = grid.flat
|
flatGrid = grid.flat
|
||||||
used = []
|
used = numpy.zeros((len(keys)), dtype=numpy.bool)
|
||||||
for n in range(flatGrid.__array__().shape[0]):
|
for n in range(flatGrid.__array__().shape[0]):
|
||||||
if flatGrid[n] not in used:
|
used[0xFF & flatGrid[n]] = True
|
||||||
used.append(flatGrid[n])
|
|
||||||
|
|
||||||
#make reverse map
|
#make reverse map
|
||||||
map = []
|
map = []
|
||||||
newKeys = []
|
newKeys = []
|
||||||
j = 0
|
j = 0
|
||||||
for i in range(len(keys)):
|
for i in range(len(keys)):
|
||||||
if i in used:
|
if used[i]:
|
||||||
map.append(j)
|
map.append(j)
|
||||||
newKeys.append(keys[i])
|
newKeys.append(keys[i])
|
||||||
j = j + 1
|
j = j + 1
|
||||||
|
@ -948,10 +949,10 @@ def collapseKey(keys, grid):
|
||||||
# modify the data
|
# modify the data
|
||||||
newGrid = grid
|
newGrid = grid
|
||||||
for k in range(len(map)):
|
for k in range(len(map)):
|
||||||
mask = numpy.equal(k, grid)
|
mask = numpy.equal(numpy.int8(k), grid)
|
||||||
newGrid = numpy.where(mask, numpy.int8(map[k]), newGrid).astype(numpy.int8)
|
newGrid = numpy.where(mask, numpy.int8(map[k]), newGrid).astype(numpy.int8)
|
||||||
|
|
||||||
return (newKeys, newGrid)
|
return (newGrid, newKeys)
|
||||||
|
|
||||||
###-------------------------------------------------------------------------###
|
###-------------------------------------------------------------------------###
|
||||||
# Stores the specified Weather WE in the netCDF file whose grids fall within
|
# Stores the specified Weather WE in the netCDF file whose grids fall within
|
||||||
|
@ -987,7 +988,7 @@ def storeWeatherWE(we, trList, file, timeRange, databaseID, invMask, clipArea, s
|
||||||
# Process the weather keys so we store only what is necessary
|
# Process the weather keys so we store only what is necessary
|
||||||
|
|
||||||
for g in range(byteCube.shape[0]):
|
for g in range(byteCube.shape[0]):
|
||||||
(keyList[g], byteCube[g]) = collapseKey(keyList[g], byteCube[g])
|
(byteCube[g], keyList[g]) = collapseKey(byteCube[g], keyList[g])
|
||||||
|
|
||||||
# Mask the values
|
# Mask the values
|
||||||
fillValue = -127
|
fillValue = -127
|
||||||
|
@ -1072,7 +1073,7 @@ def storeDiscreteWE(we, trList, file, timeRange, databaseID, invMask, clipArea,
|
||||||
# Process the discrete keys so we store only what is necessary
|
# Process the discrete keys so we store only what is necessary
|
||||||
|
|
||||||
for g in range(byteCube.shape[0]):
|
for g in range(byteCube.shape[0]):
|
||||||
(keyList[g], byteCube[g]) = collapseKey(keyList[g], byteCube[g])
|
(byteCube[g], keyList[g]) = collapseKey(byteCube[g], keyList[g])
|
||||||
|
|
||||||
# Mask the values
|
# Mask the values
|
||||||
fillValue = -127
|
fillValue = -127
|
||||||
|
|
|
@ -39,7 +39,7 @@ import LogStream, fcntl
|
||||||
# 11/05/13 2517 randerso Improve memory utilization
|
# 11/05/13 2517 randerso Improve memory utilization
|
||||||
# 08/06/2015 4718 dgilling Optimize casting when using where with
|
# 08/06/2015 4718 dgilling Optimize casting when using where with
|
||||||
# NumPy 1.9.
|
# NumPy 1.9.
|
||||||
#
|
# 04/07/2016 5539 randerso Fixed issues with Wx/Discretes with large number of keys
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
|
||||||
|
@ -79,6 +79,9 @@ class MergeGrid:
|
||||||
index = keyMap.index(key)
|
index = keyMap.index(key)
|
||||||
return index
|
return index
|
||||||
except:
|
except:
|
||||||
|
if (len(keyMap) >= 256):
|
||||||
|
raise IndexError("Attempt to create more than 256 Wx keys")
|
||||||
|
|
||||||
keyMap.append(key)
|
keyMap.append(key)
|
||||||
return len(keyMap) - 1
|
return len(keyMap) - 1
|
||||||
|
|
||||||
|
@ -186,6 +189,36 @@ class MergeGrid:
|
||||||
return (magGrid, dirGrid)
|
return (magGrid, dirGrid)
|
||||||
|
|
||||||
|
|
||||||
|
###-------------------------------------------------------------------------###
|
||||||
|
# Collapse key and bytes. (for discrete and weather)
|
||||||
|
### Returns tuple of (updated grid, updated key)
|
||||||
|
def __collapseKey(self, grid, keys):
|
||||||
|
#make list of unique indexes in the grid
|
||||||
|
flatGrid = grid.flat
|
||||||
|
used = numpy.zeros((len(keys)), dtype=numpy.bool)
|
||||||
|
for n in range(flatGrid.__array__().shape[0]):
|
||||||
|
used[0xFF & flatGrid[n]] = True
|
||||||
|
|
||||||
|
#make reverse map
|
||||||
|
map = []
|
||||||
|
newKeys = []
|
||||||
|
j = 0
|
||||||
|
for i in range(len(keys)):
|
||||||
|
if used[i]:
|
||||||
|
map.append(j)
|
||||||
|
newKeys.append(keys[i])
|
||||||
|
j = j + 1
|
||||||
|
else:
|
||||||
|
map.append(-1)
|
||||||
|
|
||||||
|
# modify the data
|
||||||
|
newGrid = grid
|
||||||
|
for k in range(len(map)):
|
||||||
|
mask = numpy.equal(numpy.int8(k), grid)
|
||||||
|
newGrid = numpy.where(mask, numpy.int8(map[k]), newGrid).astype(numpy.int8)
|
||||||
|
|
||||||
|
return (newGrid, newKeys)
|
||||||
|
|
||||||
#---------------------------------------------------------------------
|
#---------------------------------------------------------------------
|
||||||
# merge weather grid
|
# merge weather grid
|
||||||
#
|
#
|
||||||
|
@ -208,6 +241,11 @@ class MergeGrid:
|
||||||
noWxGrid = numpy.empty_like(gridA[0])
|
noWxGrid = numpy.empty_like(gridA[0])
|
||||||
noWxGrid.fill(self.__findKey(noWx, noWxKeys))
|
noWxGrid.fill(self.__findKey(noWx, noWxKeys))
|
||||||
gridB = (noWxGrid, noWxKeys)
|
gridB = (noWxGrid, noWxKeys)
|
||||||
|
else:
|
||||||
|
# clear out the masked area in gridB and collapse gridB's keys
|
||||||
|
grid, keys = gridB
|
||||||
|
grid[mask]= self.__findKey(noWx, keys)
|
||||||
|
gridB = self.__collapseKey(grid, keys)
|
||||||
(commonkey, remapG, dbG) = self.__commonizeKey(gridA, gridB)
|
(commonkey, remapG, dbG) = self.__commonizeKey(gridA, gridB)
|
||||||
mergedGrid = numpy.where(mask, remapG, dbG)
|
mergedGrid = numpy.where(mask, remapG, dbG)
|
||||||
return (mergedGrid, commonkey)
|
return (mergedGrid, commonkey)
|
||||||
|
@ -242,6 +280,11 @@ class MergeGrid:
|
||||||
noGrid = numpy.empty_like(gridA[0])
|
noGrid = numpy.empty_like(gridA[0])
|
||||||
noGrid.fill(self.__findKey(noKey, noKeys))
|
noGrid.fill(self.__findKey(noKey, noKeys))
|
||||||
gridB = (noGrid, noKeys)
|
gridB = (noGrid, noKeys)
|
||||||
|
else:
|
||||||
|
# clear out the masked area in gridB and collapse gridB's keys
|
||||||
|
grid, keys = gridB
|
||||||
|
grid[mask] = self.__findKey(noKey, keys)
|
||||||
|
gridB = self.__collapseKey(grid, keys)
|
||||||
|
|
||||||
(commonkey, remapG, dbG) = \
|
(commonkey, remapG, dbG) = \
|
||||||
self.__commonizeKey(gridA, gridB)
|
self.__commonizeKey(gridA, gridB)
|
||||||
|
|
|
@ -23,11 +23,14 @@ package com.raytheon.edex.plugin.grib.decoderpostprocessors;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
|
||||||
import javax.xml.bind.JAXBException;
|
import javax.xml.bind.JAXBException;
|
||||||
|
|
||||||
|
@ -35,7 +38,6 @@ import org.apache.camel.Headers;
|
||||||
|
|
||||||
import com.raytheon.edex.plugin.grib.decoderpostprocessors.DecoderPostProcessor.PostProcessorType;
|
import com.raytheon.edex.plugin.grib.decoderpostprocessors.DecoderPostProcessor.PostProcessorType;
|
||||||
import com.raytheon.edex.plugin.grib.exception.GribException;
|
import com.raytheon.edex.plugin.grib.exception.GribException;
|
||||||
import com.raytheon.edex.plugin.grib.util.GribModelLookup;
|
|
||||||
import com.raytheon.uf.common.dataplugin.PluginException;
|
import com.raytheon.uf.common.dataplugin.PluginException;
|
||||||
import com.raytheon.uf.common.dataplugin.annotations.DataURIUtil;
|
import com.raytheon.uf.common.dataplugin.annotations.DataURIUtil;
|
||||||
import com.raytheon.uf.common.dataplugin.grid.GridRecord;
|
import com.raytheon.uf.common.dataplugin.grid.GridRecord;
|
||||||
|
@ -72,6 +74,8 @@ import com.raytheon.uf.common.status.UFStatus;
|
||||||
* Oct 14, 2015 4627 nabowle Load post processor mappings at each
|
* Oct 14, 2015 4627 nabowle Load post processor mappings at each
|
||||||
* localization level as available, appending
|
* localization level as available, appending
|
||||||
* only new processors.
|
* only new processors.
|
||||||
|
* Apr 15, 2016 5182 tjensen Changed processorMap population to be done
|
||||||
|
* during processing instead of up front.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -88,9 +92,11 @@ public class GribPostProcessor {
|
||||||
private static GribPostProcessor instance;
|
private static GribPostProcessor instance;
|
||||||
|
|
||||||
/** The map containing the currently registered grib post processors */
|
/** The map containing the currently registered grib post processors */
|
||||||
private Map<String, List<DecoderPostProcessor>> processorMap;
|
private Map<String, List<DecoderPostProcessor>> processorMap = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
private Map<String, String> knownProcessors = new HashMap<>();
|
private final Map<String, String> knownProcessors = new HashMap<>();;
|
||||||
|
|
||||||
|
private List<PostProcessedModel> postProcessedModels;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the singleton instance of GribPostProcessor
|
* Gets the singleton instance of GribPostProcessor
|
||||||
|
@ -122,7 +128,7 @@ public class GribPostProcessor {
|
||||||
*/
|
*/
|
||||||
public GridRecord[] process(GridRecord[] records) throws GribException {
|
public GridRecord[] process(GridRecord[] records) throws GribException {
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
if (this.processorMap == null) {
|
if (this.postProcessedModels == null) {
|
||||||
initProcessorMap();
|
initProcessorMap();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -131,10 +137,22 @@ public class GribPostProcessor {
|
||||||
GridRecord[] results = null;
|
GridRecord[] results = null;
|
||||||
List<GridRecord> additionalGrids = null;
|
List<GridRecord> additionalGrids = null;
|
||||||
for (int i = 0; i < records.length; i++) {
|
for (int i = 0; i < records.length; i++) {
|
||||||
// Check the map to see if this grib record is part of a model for
|
String modelName = records[i].getDatasetId();
|
||||||
// which post processing is necessary
|
|
||||||
processors = processorMap.get(records[i].getDatasetId());
|
/*
|
||||||
if (processors != null) {
|
* If we don't already have a entry in the map, check to see if we
|
||||||
|
* need to add one.
|
||||||
|
*/
|
||||||
|
if (processorMap.get(modelName) == null) {
|
||||||
|
lookupModelProcessors(modelName);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Check the map to see if this grib record is part of a model for
|
||||||
|
* which post processing is necessary
|
||||||
|
*/
|
||||||
|
processors = processorMap.get(modelName);
|
||||||
|
if (processors != null && !processors.isEmpty()) {
|
||||||
for (DecoderPostProcessor processor : processors) {
|
for (DecoderPostProcessor processor : processors) {
|
||||||
// Post processing is not necessary, so we continue
|
// Post processing is not necessary, so we continue
|
||||||
if (processor == null
|
if (processor == null
|
||||||
|
@ -288,16 +306,14 @@ public class GribPostProcessor {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes the processor map. Starting at base working to site, the
|
* Initializes the list of postProcessedModels and the processor map.
|
||||||
* localization files will be unmarshalled if present and new processors
|
* Starting at base working to site, the localization files will be
|
||||||
* will be appended to the list of processors for a model. If a processor
|
* unmarshalled if present and new processors will be appended to the list
|
||||||
* has already been configured for a model, it will not be added again.
|
* of processors for a model. If a processor has already been configured for
|
||||||
|
* a model, it will not be added again.
|
||||||
*
|
*
|
||||||
* It's assumed that every processor will have already been registered under
|
* The processor map is initially empty, but will be populated as records
|
||||||
* its simple name, or is fully qualified.
|
* are processed to prevent repeated lookup for the same model.
|
||||||
*
|
|
||||||
* Other than the first initialization, the processor map will only be
|
|
||||||
* changed if the new value is not an empty map.
|
|
||||||
*/
|
*/
|
||||||
private synchronized void initProcessorMap() {
|
private synchronized void initProcessorMap() {
|
||||||
IPathManager pathMgr = PathManagerFactory.getPathManager();
|
IPathManager pathMgr = PathManagerFactory.getPathManager();
|
||||||
|
@ -310,7 +326,7 @@ public class GribPostProcessor {
|
||||||
.getTieredLocalizationFile(LocalizationType.EDEX_STATIC,
|
.getTieredLocalizationFile(LocalizationType.EDEX_STATIC,
|
||||||
"/grib/postProcessModels/postProcessedModels.xml");
|
"/grib/postProcessModels/postProcessedModels.xml");
|
||||||
PostProcessedModelSet ppModelSet;
|
PostProcessedModelSet ppModelSet;
|
||||||
List<PostProcessedModel> postProcessedModels = new ArrayList<>();
|
postProcessedModels = new ArrayList<>();
|
||||||
Map<String, Integer> idMap = new HashMap<>();
|
Map<String, Integer> idMap = new HashMap<>();
|
||||||
for (LocalizationLevel level : levels) {
|
for (LocalizationLevel level : levels) {
|
||||||
processorFile = files.get(level);
|
processorFile = files.get(level);
|
||||||
|
@ -339,7 +355,8 @@ public class GribPostProcessor {
|
||||||
Integer idx = idMap.get(ppModel.getId());
|
Integer idx = idMap.get(ppModel.getId());
|
||||||
if (idx == null) {
|
if (idx == null) {
|
||||||
postProcessedModels.add(ppModel);
|
postProcessedModels.add(ppModel);
|
||||||
idMap.put(ppModel.getId(), postProcessedModels.size() - 1);
|
idMap.put(ppModel.getId(),
|
||||||
|
postProcessedModels.size() - 1);
|
||||||
} else {
|
} else {
|
||||||
postProcessedModels.remove(idx.intValue());
|
postProcessedModels.remove(idx.intValue());
|
||||||
postProcessedModels.add(idx.intValue(), ppModel);
|
postProcessedModels.add(idx.intValue(), ppModel);
|
||||||
|
@ -355,26 +372,34 @@ public class GribPostProcessor {
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Iterate over post processed models. Determine which models apply to
|
* Initialize processorMap to an empty map. Map will be populated as
|
||||||
|
* records are processed.
|
||||||
|
*/
|
||||||
|
this.processorMap.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* For a given model name, determine if the model applies for each post
|
||||||
|
* processor. If so, update the processor map for this model to prevent
|
||||||
|
* repeated lookup for this model.
|
||||||
|
*
|
||||||
|
* @param modelName
|
||||||
|
*/
|
||||||
|
private synchronized void lookupModelProcessors(String modelName) {
|
||||||
|
/*
|
||||||
|
* Iterate over post processed models. Determine if model applies to
|
||||||
* each post processor if a regex is present
|
* each post processor if a regex is present
|
||||||
*/
|
*/
|
||||||
String knownProc;
|
String knownProc;
|
||||||
String classToLoad;
|
String classToLoad;
|
||||||
List<DecoderPostProcessor> processorInstances;
|
Matcher m;
|
||||||
Set<String> modelNames = GribModelLookup.getInstance().getModelNames();
|
List<DecoderPostProcessor> processorInstances = new ArrayList<>();
|
||||||
Map<String, List<DecoderPostProcessor>> newMap = new HashMap<>();
|
|
||||||
for (PostProcessedModel ppModel : postProcessedModels) {
|
for (PostProcessedModel ppModel : postProcessedModels) {
|
||||||
if (ppModel.getModelName() == null) {
|
if (ppModel.getModelName() == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
for (String modelName : modelNames) {
|
m = ppModel.getModelNamePattern().matcher(modelName);
|
||||||
if (modelName.matches(ppModel.getModelName())) {
|
if (m.matches()) {
|
||||||
processorInstances = newMap.get(modelName);
|
|
||||||
if (processorInstances == null) {
|
|
||||||
processorInstances = new ArrayList<DecoderPostProcessor>();
|
|
||||||
newMap.put(modelName, processorInstances);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (String processor : ppModel.getProcessors()) {
|
for (String processor : ppModel.getProcessors()) {
|
||||||
knownProc = this.knownProcessors.get(processor);
|
knownProc = this.knownProcessors.get(processor);
|
||||||
if (knownProc != null) {
|
if (knownProc != null) {
|
||||||
|
@ -396,10 +421,8 @@ public class GribPostProcessor {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!alreadyConfigured) {
|
if (!alreadyConfigured) {
|
||||||
processorInstances
|
processorInstances.add((DecoderPostProcessor) Class
|
||||||
.add((DecoderPostProcessor) Class
|
.forName(classToLoad).newInstance());
|
||||||
.forName(classToLoad)
|
|
||||||
.newInstance());
|
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
statusHandler.fatal(
|
statusHandler.fatal(
|
||||||
|
@ -409,10 +432,9 @@ public class GribPostProcessor {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (processorInstances.isEmpty()) {
|
||||||
|
processorInstances = Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
processorMap.put(modelName, processorInstances);
|
||||||
if (this.processorMap == null || !newMap.isEmpty()) {
|
|
||||||
this.processorMap = newMap;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,7 @@ package com.raytheon.edex.plugin.grib.decoderpostprocessors;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
|
@ -40,6 +41,7 @@ import javax.xml.bind.annotation.XmlRootElement;
|
||||||
* Jul 24, 2012 949 bphillip Initial Creation
|
* Jul 24, 2012 949 bphillip Initial Creation
|
||||||
* Oct 15, 2013 2473 bsteffen Remove deprecated ISerializableObject.
|
* Oct 15, 2013 2473 bsteffen Remove deprecated ISerializableObject.
|
||||||
* Oct 14, 2015 4627 nabowle Add id attribute.
|
* Oct 14, 2015 4627 nabowle Add id attribute.
|
||||||
|
* Apr 18, 2016 5182 tjensen Optimized to store modelNamePattern
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
|
@ -70,6 +72,11 @@ public class PostProcessedModel {
|
||||||
@XmlElement(name = "processorName")
|
@XmlElement(name = "processorName")
|
||||||
private List<String> processors;
|
private List<String> processors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Stores the regex pattern so it only needs to be calculated once.
|
||||||
|
*/
|
||||||
|
private Pattern modelNamePattern;
|
||||||
|
|
||||||
public PostProcessedModel() {
|
public PostProcessedModel() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -80,6 +87,7 @@ public class PostProcessedModel {
|
||||||
|
|
||||||
public void setModelName(String modelName) {
|
public void setModelName(String modelName) {
|
||||||
this.modelName = modelName;
|
this.modelName = modelName;
|
||||||
|
this.modelNamePattern = Pattern.compile(modelName);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -122,4 +130,10 @@ public class PostProcessedModel {
|
||||||
return buf.toString();
|
return buf.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Pattern getModelNamePattern() {
|
||||||
|
if (modelName != null && modelNamePattern == null) {
|
||||||
|
modelNamePattern = Pattern.compile(modelName);
|
||||||
|
}
|
||||||
|
return modelNamePattern;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,8 @@ import java.util.List;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
import javax.measure.unit.SI;
|
||||||
|
|
||||||
import com.raytheon.edex.esb.Headers;
|
import com.raytheon.edex.esb.Headers;
|
||||||
import com.raytheon.edex.exception.DecoderException;
|
import com.raytheon.edex.exception.DecoderException;
|
||||||
import com.raytheon.edex.plugin.obs.metar.util.VisibilityParser;
|
import com.raytheon.edex.plugin.obs.metar.util.VisibilityParser;
|
||||||
|
@ -90,6 +92,7 @@ import com.vividsolutions.jts.geom.impl.CoordinateArraySequence;
|
||||||
* Jul 13, 2015 4389 skorolev Added correction of invalid (NUL) characters in the message.
|
* Jul 13, 2015 4389 skorolev Added correction of invalid (NUL) characters in the message.
|
||||||
* Nov 01, 2015 DR 14741 MPorricelli Modified WIND_VAR_DIR_EXP pattern to prevent its matching
|
* Nov 01, 2015 DR 14741 MPorricelli Modified WIND_VAR_DIR_EXP pattern to prevent its matching
|
||||||
* some RVR strings
|
* some RVR strings
|
||||||
|
* Mar 08, 2016 5345 tgurney Convert sea level pressure from hPa to Pa
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -720,6 +723,8 @@ public class MetarDecoder {
|
||||||
// nothing
|
// nothing
|
||||||
}
|
}
|
||||||
if (slp != null) {
|
if (slp != null) {
|
||||||
|
slp = (float) SI.HECTO(SI.PASCAL)
|
||||||
|
.getConverterTo(SI.PASCAL).convert(slp);
|
||||||
record.setSeaLevelPress(slp);
|
record.setSeaLevelPress(slp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,6 +42,7 @@ import com.vividsolutions.jts.geom.Coordinate;
|
||||||
* Oct 22, 2008 1624 wdougherty Speed up translate method
|
* Oct 22, 2008 1624 wdougherty Speed up translate method
|
||||||
* Sep 01, 2014 3572 randerso Changed getNumpy to use getBytes()
|
* Sep 01, 2014 3572 randerso Changed getNumpy to use getBytes()
|
||||||
* Apr 23, 2015 4259 njensen Updated for new JEP API
|
* Apr 23, 2015 4259 njensen Updated for new JEP API
|
||||||
|
* Apr 04, 2016 5539 randerso Fixed toString method to handle unsigned bytes
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -103,7 +104,7 @@ public class Grid2DByte implements IGrid2D, Cloneable {
|
||||||
*/
|
*/
|
||||||
public Grid2DByte(int xDim, int yDim, byte[] data) {
|
public Grid2DByte(int xDim, int yDim, byte[] data) {
|
||||||
this(xDim, yDim);
|
this(xDim, yDim);
|
||||||
if (xDim * yDim != data.length) {
|
if ((xDim * yDim) != data.length) {
|
||||||
throw new IllegalArgumentException(
|
throw new IllegalArgumentException(
|
||||||
"Dimensions do not match data length (" + xDim + "," + yDim
|
"Dimensions do not match data length (" + xDim + "," + yDim
|
||||||
+ ") " + data.length);
|
+ ") " + data.length);
|
||||||
|
@ -122,7 +123,7 @@ public class Grid2DByte implements IGrid2D, Cloneable {
|
||||||
* ByteBuffer of initialization data
|
* ByteBuffer of initialization data
|
||||||
*/
|
*/
|
||||||
public Grid2DByte(int xDim, int yDim, ByteBuffer data) {
|
public Grid2DByte(int xDim, int yDim, ByteBuffer data) {
|
||||||
if (xDim * yDim != data.limit()) {
|
if ((xDim * yDim) != data.limit()) {
|
||||||
throw new IllegalArgumentException(
|
throw new IllegalArgumentException(
|
||||||
"Dimensions do not match data length (" + xDim + "," + yDim
|
"Dimensions do not match data length (" + xDim + "," + yDim
|
||||||
+ ") " + data.limit());
|
+ ") " + data.limit());
|
||||||
|
@ -165,7 +166,7 @@ public class Grid2DByte implements IGrid2D, Cloneable {
|
||||||
if (!isValid(xDim, yDim)) {
|
if (!isValid(xDim, yDim)) {
|
||||||
throw new IllegalArgumentException("Dimensions not valid");
|
throw new IllegalArgumentException("Dimensions not valid");
|
||||||
}
|
}
|
||||||
return buffer.get(yDim * this.xdim + xDim);
|
return buffer.get((yDim * this.xdim) + xDim);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -180,7 +181,7 @@ public class Grid2DByte implements IGrid2D, Cloneable {
|
||||||
if (!isValid(xDim, yDim)) {
|
if (!isValid(xDim, yDim)) {
|
||||||
throw new IllegalArgumentException("Dimensions not valid");
|
throw new IllegalArgumentException("Dimensions not valid");
|
||||||
}
|
}
|
||||||
buffer.put(yDim * this.xdim + xDim, aValue);
|
buffer.put((yDim * this.xdim) + xDim, aValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void set(int xDim, int yDim, int aValue) {
|
public void set(int xDim, int yDim, int aValue) {
|
||||||
|
@ -205,7 +206,7 @@ public class Grid2DByte implements IGrid2D, Cloneable {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isValid(int x, int y) {
|
public boolean isValid(int x, int y) {
|
||||||
return (x < xdim && y < ydim && x >= 0 && y >= 0);
|
return ((x < xdim) && (y < ydim) && (x >= 0) && (y >= 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -224,7 +225,7 @@ public class Grid2DByte implements IGrid2D, Cloneable {
|
||||||
* y coordinate to clear
|
* y coordinate to clear
|
||||||
*/
|
*/
|
||||||
public void clear(int x, int y) {
|
public void clear(int x, int y) {
|
||||||
buffer.put(y * xdim + x, (byte) 0);
|
buffer.put((y * xdim) + x, (byte) 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -241,7 +242,7 @@ public class Grid2DByte implements IGrid2D, Cloneable {
|
||||||
// make another Grid2DByte
|
// make another Grid2DByte
|
||||||
Grid2DByte rVal = new Grid2DByte(this.xdim, this.ydim, (byte) 0);
|
Grid2DByte rVal = new Grid2DByte(this.xdim, this.ydim, (byte) 0);
|
||||||
|
|
||||||
if (Math.abs(deltaCoord.x) < xdim && Math.abs(deltaCoord.y) < ydim) {
|
if ((Math.abs(deltaCoord.x) < xdim) && (Math.abs(deltaCoord.y) < ydim)) {
|
||||||
// Find iteration limits for X
|
// Find iteration limits for X
|
||||||
int fromXStart;
|
int fromXStart;
|
||||||
int toXStart;
|
int toXStart;
|
||||||
|
@ -275,8 +276,8 @@ public class Grid2DByte implements IGrid2D, Cloneable {
|
||||||
byte[] toA = rVal.getBuffer().array();
|
byte[] toA = rVal.getBuffer().array();
|
||||||
|
|
||||||
// Calculate from/to array offsets of the first point.
|
// Calculate from/to array offsets of the first point.
|
||||||
int fromOffset = fromYStart * xdim + fromXStart;
|
int fromOffset = (fromYStart * xdim) + fromXStart;
|
||||||
int toOffset = toYStart * xdim + toXStart;
|
int toOffset = (toYStart * xdim) + toXStart;
|
||||||
|
|
||||||
// For each row, copy cols bytes of data.
|
// For each row, copy cols bytes of data.
|
||||||
// Then update offsets for next row.
|
// Then update offsets for next row.
|
||||||
|
@ -328,9 +329,9 @@ public class Grid2DByte implements IGrid2D, Cloneable {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Grid2DByte subGrid(int minX, int minY, int maxX, int maxY) {
|
public Grid2DByte subGrid(int minX, int minY, int maxX, int maxY) {
|
||||||
Grid2DByte rVal = new Grid2DByte(maxX + 1 - minX, maxY + 1 - minY);
|
Grid2DByte rVal = new Grid2DByte((maxX + 1) - minX, (maxY + 1) - minY);
|
||||||
for (int y = minY; y < maxY + 1; y++) {
|
for (int y = minY; y < (maxY + 1); y++) {
|
||||||
for (int x = minX; x < maxX + 1; x++) {
|
for (int x = minX; x < (maxX + 1); x++) {
|
||||||
rVal.buffer.put(this.get(x, y));
|
rVal.buffer.put(this.get(x, y));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -345,7 +346,8 @@ public class Grid2DByte implements IGrid2D, Cloneable {
|
||||||
|
|
||||||
Grid2DByte rhsGrid2DByte = (Grid2DByte) rhs;
|
Grid2DByte rhsGrid2DByte = (Grid2DByte) rhs;
|
||||||
|
|
||||||
if (this.xdim != rhsGrid2DByte.xdim || this.ydim != rhsGrid2DByte.ydim) {
|
if ((this.xdim != rhsGrid2DByte.xdim)
|
||||||
|
|| (this.ydim != rhsGrid2DByte.ydim)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -374,9 +376,10 @@ public class Grid2DByte implements IGrid2D, Cloneable {
|
||||||
|
|
||||||
Grid2DByte sourceGrid2DByte = (Grid2DByte) sourceGrid;
|
Grid2DByte sourceGrid2DByte = (Grid2DByte) sourceGrid;
|
||||||
|
|
||||||
if (this.xdim != sourceGrid2DByte.xdim || this.xdim != maskGrid.xdim
|
if ((this.xdim != sourceGrid2DByte.xdim)
|
||||||
|| this.ydim != sourceGrid2DByte.ydim
|
|| (this.xdim != maskGrid.xdim)
|
||||||
|| this.ydim != maskGrid.ydim) {
|
|| (this.ydim != sourceGrid2DByte.ydim)
|
||||||
|
|| (this.ydim != maskGrid.ydim)) {
|
||||||
throw new IllegalArgumentException(
|
throw new IllegalArgumentException(
|
||||||
"This grid, the input grid, and the input mask grid must have equal dimensions");
|
"This grid, the input grid, and the input mask grid must have equal dimensions");
|
||||||
}
|
}
|
||||||
|
@ -407,7 +410,7 @@ public class Grid2DByte implements IGrid2D, Cloneable {
|
||||||
rVal += xdim + "X" + ydim + "\n[\n";
|
rVal += xdim + "X" + ydim + "\n[\n";
|
||||||
for (int y = 0; y < ydim; y++) {
|
for (int y = 0; y < ydim; y++) {
|
||||||
for (int x = 0; x < xdim; x++) {
|
for (int x = 0; x < xdim; x++) {
|
||||||
rVal += this.get(x, y) + (x + 1 == xdim ? "" : ",");
|
rVal += (0xFF & this.get(x, y)) + ((x + 1) == xdim ? "" : ",");
|
||||||
}
|
}
|
||||||
rVal += "\n";
|
rVal += "\n";
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,6 +60,7 @@ import com.raytheon.uf.common.time.TimeRange;
|
||||||
* Oct 29, 2013 2476 njensen Updated getNumpy() and added getKeyList()
|
* Oct 29, 2013 2476 njensen Updated getNumpy() and added getKeyList()
|
||||||
* Apr 23, 2015 4259 njensen Updated for new JEP API
|
* Apr 23, 2015 4259 njensen Updated for new JEP API
|
||||||
* Nov 03, 2015 5061 randerso Fixed null pointer in equals()
|
* Nov 03, 2015 5061 randerso Fixed null pointer in equals()
|
||||||
|
* Apr 05, 2016 5539 randerso Cleaned up collapse method
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -645,6 +646,20 @@ public class WeatherGridSlice extends AbstractGridSlice {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
int max = 0;
|
||||||
|
for (byte b : weatherGrid.getBytes()) {
|
||||||
|
int unsigned = 0xFF & b;
|
||||||
|
if (unsigned > max) {
|
||||||
|
max = unsigned;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (max >= keys.length) {
|
||||||
|
throw new IndexOutOfBoundsException("Grid contains index ("
|
||||||
|
+ max + ") > keys.length (" + keys.length + ")");
|
||||||
|
}
|
||||||
|
|
||||||
// make a histogram, indicating what is and what isn't
|
// make a histogram, indicating what is and what isn't
|
||||||
// used in the weather keys
|
// used in the weather keys
|
||||||
boolean[] used = new boolean[keys.length];
|
boolean[] used = new boolean[keys.length];
|
||||||
|
@ -657,9 +672,9 @@ public class WeatherGridSlice extends AbstractGridSlice {
|
||||||
// process the grid
|
// process the grid
|
||||||
for (int i = 0; i < weatherGrid.getXdim(); i++) {
|
for (int i = 0; i < weatherGrid.getXdim(); i++) {
|
||||||
for (int j = 0; j < weatherGrid.getYdim(); j++) {
|
for (int j = 0; j < weatherGrid.getYdim(); j++) {
|
||||||
used[0xFF & weatherGrid.get(i, j)] = true;
|
used[0xFF & weatherGrid.get(i, j)] = true; // indicate used
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} // indicate used
|
|
||||||
|
|
||||||
// clear the invmapping if not used
|
// clear the invmapping if not used
|
||||||
for (int i = 0; i < used.length; i++) {
|
for (int i = 0; i < used.length; i++) {
|
||||||
|
@ -684,7 +699,8 @@ public class WeatherGridSlice extends AbstractGridSlice {
|
||||||
nk++;
|
nk++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
WeatherKey[] newKeys = tmpKeys.toArray(new WeatherKey[tmpKeys.size()]);
|
WeatherKey[] newKeys = tmpKeys.toArray(new WeatherKey[tmpKeys
|
||||||
|
.size()]);
|
||||||
|
|
||||||
// anything to do?
|
// anything to do?
|
||||||
if (Arrays.equals(newKeys, keys)) {
|
if (Arrays.equals(newKeys, keys)) {
|
||||||
|
@ -698,10 +714,13 @@ public class WeatherGridSlice extends AbstractGridSlice {
|
||||||
(byte) invMapping[0xFF & weatherGrid.get(i, j)]);
|
(byte) invMapping[0xFF & weatherGrid.get(i, j)]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// store the grid
|
// store the grid
|
||||||
setWeatherGrid(weatherGrid);
|
setWeatherGrid(weatherGrid);
|
||||||
keys = newKeys;
|
keys = newKeys;
|
||||||
|
} catch (IndexOutOfBoundsException e) {
|
||||||
|
statusHandler.error(e.getLocalizedMessage(), e);
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -67,6 +67,7 @@ import com.raytheon.uf.common.dataplugin.gfe.request.IscRequestQueryRequest.IscQ
|
||||||
import com.raytheon.uf.common.dataplugin.gfe.request.LockChangeRequest;
|
import com.raytheon.uf.common.dataplugin.gfe.request.LockChangeRequest;
|
||||||
import com.raytheon.uf.common.dataplugin.gfe.request.SaveGfeGridRequest;
|
import com.raytheon.uf.common.dataplugin.gfe.request.SaveGfeGridRequest;
|
||||||
import com.raytheon.uf.common.dataplugin.gfe.request.SendIscGridRequest;
|
import com.raytheon.uf.common.dataplugin.gfe.request.SendIscGridRequest;
|
||||||
|
import com.raytheon.uf.common.dataplugin.gfe.request.SendWFOMessageRequest;
|
||||||
import com.raytheon.uf.common.dataplugin.gfe.sample.SampleData;
|
import com.raytheon.uf.common.dataplugin.gfe.sample.SampleData;
|
||||||
import com.raytheon.uf.common.dataplugin.gfe.sample.SampleId;
|
import com.raytheon.uf.common.dataplugin.gfe.sample.SampleId;
|
||||||
import com.raytheon.uf.common.dataplugin.gfe.server.lock.LockTable;
|
import com.raytheon.uf.common.dataplugin.gfe.server.lock.LockTable;
|
||||||
|
@ -1102,6 +1103,11 @@ public class IFPClient {
|
||||||
return (ServerResponse<IscSendStatus>) makeRequest(request);
|
return (ServerResponse<IscSendStatus>) makeRequest(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ServerResponse<?> sendWFOMessage(List<String> wfos, String message) {
|
||||||
|
SendWFOMessageRequest request = new SendWFOMessageRequest(wfos, message);
|
||||||
|
return makeRequest(request);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* To get a "legacy-style" (prior to A2 release 16.2.2) IFPClient
|
* To get a "legacy-style" (prior to A2 release 16.2.2) IFPClient
|
||||||
* implementation. Instead of returning ServerResponse objects, the
|
* implementation. Instead of returning ServerResponse objects, the
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
After updating the edex-component spec file, run generatePatchFiles.sh from the parent folder and commit any changed patch0 files that are updated.
|
|
|
@ -1 +0,0 @@
|
||||||
To update the Data Delivery installer, modify the component.spec file. Then, run generatePatchFiles.sh from the parent folder.
|
|
|
@ -1,144 +0,0 @@
|
||||||
#
|
|
||||||
# AWIPS II Edex "component" spec file
|
|
||||||
#
|
|
||||||
%define __prelink_undo_cmd %{nil}
|
|
||||||
# Turn off the brp-python-bytecompile script
|
|
||||||
%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')
|
|
||||||
%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-java-repack-jars[[:space:]].*$!!g')
|
|
||||||
|
|
||||||
Name: awips2-edex-datadelivery
|
|
||||||
Summary: awips2-edex-datadelivery Installation
|
|
||||||
Version: %{_component_version}
|
|
||||||
Release: %{_component_release}
|
|
||||||
Group: AWIPSII
|
|
||||||
BuildRoot: %{_build_root}
|
|
||||||
URL: N/A
|
|
||||||
License: N/A
|
|
||||||
Distribution: N/A
|
|
||||||
Vendor: Raytheon
|
|
||||||
Packager: %{_build_site}
|
|
||||||
|
|
||||||
provides: awips2-edex-datadelivery
|
|
||||||
requires: awips2
|
|
||||||
requires: awips2-edex-base
|
|
||||||
requires: awips2-python
|
|
||||||
requires: awips2-java
|
|
||||||
requires: awips2-psql
|
|
||||||
|
|
||||||
%description
|
|
||||||
AWIPS II Edex - Installs AWIPS II Edex Plugins.
|
|
||||||
|
|
||||||
%prep
|
|
||||||
# Verify That The User Has Specified A BuildRoot.
|
|
||||||
if [ "%{_build_root}" = "" ]
|
|
||||||
then
|
|
||||||
echo "ERROR: The RPM Build Root has not been specified."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -d %{_build_root} ]; then
|
|
||||||
rm -rf %{_build_root}
|
|
||||||
fi
|
|
||||||
|
|
||||||
%build
|
|
||||||
|
|
||||||
%install
|
|
||||||
mkdir -p %{_build_root}
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
# prepare the init.d directory path
|
|
||||||
mkdir -p %{_build_root}/etc/init.d
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
unzip %{_baseline_workspace}/build.edex/edex/dist/edex-datadelivery.zip \
|
|
||||||
-d %{_build_root}
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# include the init.d script
|
|
||||||
INSTALLER_RPM="%{_baseline_workspace}/rpms"
|
|
||||||
EDEX_DATADELIVERY="${INSTALLER_RPM}/awips2.edex/Installer.edex-datadelivery"
|
|
||||||
cp -v ${EDEX_DATADELIVERY}/scripts/init.d/* \
|
|
||||||
%{_build_root}/etc/init.d
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
# rename the script to prevent naming conflicts during installation
|
|
||||||
pushd . > /dev/null 2>&1
|
|
||||||
cd %{_build_root}/etc/init.d
|
|
||||||
mv edexServiceList edexServiceList-datadelivery
|
|
||||||
popd > /dev/null 2>&1
|
|
||||||
|
|
||||||
#add central registry script
|
|
||||||
mkdir -p %{_build_root}/awips2/edex/bin/
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
cp -v %{_baseline_workspace}/deploy.edex-Data_Delivery/esb/bin/centralRegistryProviderCredentials.sh %{_build_root}/awips2/edex/bin/
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
#create a list of all files packaged for /awips2/edex/data/utility
|
|
||||||
UTILITY=/awips2/edex/data/utility
|
|
||||||
if [ -d %{_build_root}/$UTILITY ]; then
|
|
||||||
cd %{_build_root}/$UTILITY
|
|
||||||
find . -type f > %{_build_root}/awips2/edex/util_filelist.%{name}.txt
|
|
||||||
fi
|
|
||||||
|
|
||||||
%pre
|
|
||||||
%post
|
|
||||||
# replace the service list script with the datadelivery service list script
|
|
||||||
if [ -f /etc/init.d/edexServiceList ]; then
|
|
||||||
mv /etc/init.d/edexServiceList /etc/init.d/edexServiceList.orig
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
cp /etc/init.d/edexServiceList-datadelivery /etc/init.d/edexServiceList
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
#change date stamp of utility files
|
|
||||||
UTILITY=/awips2/edex/data/utility
|
|
||||||
UTIL_FILENAME=/awips2/edex/util_filelist.%{name}.txt
|
|
||||||
if [ -d $UTILITY ] && [ -f $UTIL_FILENAME ]; then
|
|
||||||
while read fileName
|
|
||||||
do
|
|
||||||
touch "$UTILITY/$fileName"
|
|
||||||
done < $UTIL_FILENAME
|
|
||||||
rm -f $UTIL_FILENAME
|
|
||||||
fi
|
|
||||||
|
|
||||||
%preun
|
|
||||||
if [ "${1}" = "1" ]; then
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
# restore the original service list script with the datadelivery service list script
|
|
||||||
if [ -f /etc/init.d/edexServiceList.orig ]; then
|
|
||||||
mv /etc/init.d/edexServiceList.orig /etc/init.d/edexServiceList
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
%postun
|
|
||||||
|
|
||||||
%clean
|
|
||||||
rm -rf ${RPM_BUILD_ROOT}
|
|
||||||
|
|
||||||
%files
|
|
||||||
%defattr(644,awips,fxalpha,755)
|
|
||||||
%dir /awips2
|
|
||||||
%dir /awips2/edex
|
|
||||||
/awips2/edex/*
|
|
||||||
%dir /awips2/edex/bin
|
|
||||||
%attr(744, -, -) /awips2/edex/bin/centralRegistryProviderCredentials.sh
|
|
||||||
|
|
||||||
%attr(744,root,root) /etc/init.d/*
|
|
|
@ -1,147 +0,0 @@
|
||||||
*** Installer.edex-component/component.spec 2015-12-01 15:13:59.047022621 -0600
|
|
||||||
--- Installer.edex-datadelivery/component.spec 2015-12-01 15:13:59.048022609 -0600
|
|
||||||
***************
|
|
||||||
*** 6,13 ****
|
|
||||||
%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')
|
|
||||||
%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-java-repack-jars[[:space:]].*$!!g')
|
|
||||||
|
|
||||||
! Name: awips2-%{_component_name}
|
|
||||||
! Summary: awips2-%{_component_name} Installation
|
|
||||||
Version: %{_component_version}
|
|
||||||
Release: %{_component_release}
|
|
||||||
Group: AWIPSII
|
|
||||||
--- 6,13 ----
|
|
||||||
%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')
|
|
||||||
%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-java-repack-jars[[:space:]].*$!!g')
|
|
||||||
|
|
||||||
! Name: awips2-edex-datadelivery
|
|
||||||
! Summary: awips2-edex-datadelivery Installation
|
|
||||||
Version: %{_component_version}
|
|
||||||
Release: %{_component_release}
|
|
||||||
Group: AWIPSII
|
|
||||||
***************
|
|
||||||
*** 18,24 ****
|
|
||||||
Vendor: Raytheon
|
|
||||||
Packager: %{_build_site}
|
|
||||||
|
|
||||||
! provides: awips2-%{_component_name}
|
|
||||||
requires: awips2
|
|
||||||
requires: awips2-edex-base
|
|
||||||
requires: awips2-python
|
|
||||||
--- 18,24 ----
|
|
||||||
Vendor: Raytheon
|
|
||||||
Packager: %{_build_site}
|
|
||||||
|
|
||||||
! provides: awips2-edex-datadelivery
|
|
||||||
requires: awips2
|
|
||||||
requires: awips2-edex-base
|
|
||||||
requires: awips2-python
|
|
||||||
***************
|
|
||||||
*** 47,56 ****
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
! unzip %{_baseline_workspace}/build.edex/edex/dist/%{_component_name}.zip \
|
|
||||||
-d %{_build_root}
|
|
||||||
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
--- 47,85 ----
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
+ # prepare the init.d directory path
|
|
||||||
+ mkdir -p %{_build_root}/etc/init.d
|
|
||||||
+ if [ $? -ne 0 ]; then
|
|
||||||
+ exit 1
|
|
||||||
+ fi
|
|
||||||
|
|
||||||
! unzip %{_baseline_workspace}/build.edex/edex/dist/edex-datadelivery.zip \
|
|
||||||
-d %{_build_root}
|
|
||||||
+ if [ $? -ne 0 ]; then
|
|
||||||
+ exit 1
|
|
||||||
+ fi
|
|
||||||
|
|
||||||
+ # include the init.d script
|
|
||||||
+ INSTALLER_RPM="%{_baseline_workspace}/rpms"
|
|
||||||
+ EDEX_DATADELIVERY="${INSTALLER_RPM}/awips2.edex/Installer.edex-datadelivery"
|
|
||||||
+ cp -v ${EDEX_DATADELIVERY}/scripts/init.d/* \
|
|
||||||
+ %{_build_root}/etc/init.d
|
|
||||||
+ if [ $? -ne 0 ]; then
|
|
||||||
+ exit 1
|
|
||||||
+ fi
|
|
||||||
+ # rename the script to prevent naming conflicts during installation
|
|
||||||
+ pushd . > /dev/null 2>&1
|
|
||||||
+ cd %{_build_root}/etc/init.d
|
|
||||||
+ mv edexServiceList edexServiceList-datadelivery
|
|
||||||
+ popd > /dev/null 2>&1
|
|
||||||
+
|
|
||||||
+ #add central registry script
|
|
||||||
+ mkdir -p %{_build_root}/awips2/edex/bin/
|
|
||||||
+ if [ $? -ne 0 ]; then
|
|
||||||
+ exit 1
|
|
||||||
+ fi
|
|
||||||
+
|
|
||||||
+ cp -v %{_baseline_workspace}/deploy.edex-Data_Delivery/esb/bin/centralRegistryProviderCredentials.sh %{_build_root}/awips2/edex/bin/
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
***************
|
|
||||||
*** 64,70 ****
|
|
||||||
|
|
||||||
%pre
|
|
||||||
%post
|
|
||||||
!
|
|
||||||
|
|
||||||
#change date stamp of utility files
|
|
||||||
UTILITY=/awips2/edex/data/utility
|
|
||||||
--- 93,109 ----
|
|
||||||
|
|
||||||
%pre
|
|
||||||
%post
|
|
||||||
! # replace the service list script with the datadelivery service list script
|
|
||||||
! if [ -f /etc/init.d/edexServiceList ]; then
|
|
||||||
! mv /etc/init.d/edexServiceList /etc/init.d/edexServiceList.orig
|
|
||||||
! if [ $? -ne 0 ]; then
|
|
||||||
! exit 1
|
|
||||||
! fi
|
|
||||||
! fi
|
|
||||||
! cp /etc/init.d/edexServiceList-datadelivery /etc/init.d/edexServiceList
|
|
||||||
! if [ $? -ne 0 ]; then
|
|
||||||
! exit 1
|
|
||||||
! fi
|
|
||||||
|
|
||||||
#change date stamp of utility files
|
|
||||||
UTILITY=/awips2/edex/data/utility
|
|
||||||
***************
|
|
||||||
*** 78,83 ****
|
|
||||||
--- 117,133 ----
|
|
||||||
fi
|
|
||||||
|
|
||||||
%preun
|
|
||||||
+ if [ "${1}" = "1" ]; then
|
|
||||||
+ exit 0
|
|
||||||
+ fi
|
|
||||||
+ # restore the original service list script with the datadelivery service list script
|
|
||||||
+ if [ -f /etc/init.d/edexServiceList.orig ]; then
|
|
||||||
+ mv /etc/init.d/edexServiceList.orig /etc/init.d/edexServiceList
|
|
||||||
+ if [ $? -ne 0 ]; then
|
|
||||||
+ exit 1
|
|
||||||
+ fi
|
|
||||||
+ fi
|
|
||||||
+
|
|
||||||
%postun
|
|
||||||
|
|
||||||
%clean
|
|
||||||
***************
|
|
||||||
*** 88,90 ****
|
|
||||||
--- 138,144 ----
|
|
||||||
%dir /awips2
|
|
||||||
%dir /awips2/edex
|
|
||||||
/awips2/edex/*
|
|
||||||
+ %dir /awips2/edex/bin
|
|
||||||
+ %attr(744, -, -) /awips2/edex/bin/centralRegistryProviderCredentials.sh
|
|
||||||
+
|
|
||||||
+ %attr(744,root,root) /etc/init.d/*
|
|
|
@ -1,5 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Default Services to start
|
|
||||||
export SERVICES=('registry')
|
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
To update the Hazard Services installer, modify the component.spec file. Then, run generatePatchFiles.sh from the parent folder.
|
|
|
@ -1,141 +0,0 @@
|
||||||
#
|
|
||||||
# AWIPS II EDEX Hazard Services spec file
|
|
||||||
#
|
|
||||||
%define __prelink_undo_cmd %{nil}
|
|
||||||
# Turn off the brp-python-bytecompile script
|
|
||||||
%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')
|
|
||||||
%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-java-repack-jars[[:space:]].*$!!g')
|
|
||||||
|
|
||||||
Name: awips2-%{_component_name}
|
|
||||||
Summary: awips2-%{_component_name} Installation
|
|
||||||
Version: %{_component_version}
|
|
||||||
Release: %{_component_release}
|
|
||||||
Group: AWIPSII
|
|
||||||
BuildRoot: %{_build_root}
|
|
||||||
URL: N/A
|
|
||||||
License: N/A
|
|
||||||
Distribution: N/A
|
|
||||||
Vendor: Raytheon
|
|
||||||
Packager: %{_build_site}
|
|
||||||
|
|
||||||
provides: awips2-%{_component_name}
|
|
||||||
requires: awips2
|
|
||||||
requires: awips2-edex-base
|
|
||||||
requires: awips2-python
|
|
||||||
requires: awips2-java
|
|
||||||
requires: awips2-psql
|
|
||||||
|
|
||||||
%description
|
|
||||||
AWIPS II Edex - Installs AWIPS II Edex Plugins.
|
|
||||||
|
|
||||||
%prep
|
|
||||||
# Verify That The User Has Specified A BuildRoot.
|
|
||||||
if [ "%{_build_root}" = "" ]
|
|
||||||
then
|
|
||||||
echo "ERROR: The RPM Build Root has not been specified."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -d %{_build_root} ]; then
|
|
||||||
rm -rf %{_build_root}
|
|
||||||
fi
|
|
||||||
|
|
||||||
%build
|
|
||||||
|
|
||||||
%install
|
|
||||||
mkdir -p %{_build_root}
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
unzip %{_baseline_workspace}/build.edex/edex/dist/%{_component_name}.zip \
|
|
||||||
-d %{_build_root}
|
|
||||||
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
#create the edex scripts dir
|
|
||||||
EDEX_SCRIPTS_DIR=%{_build_root}/awips2/edex/scripts/
|
|
||||||
if [ ! -d $EDEX_SCRIPTS_DIR ]; then
|
|
||||||
mkdir -p $EDEX_SCRIPTS_DIR
|
|
||||||
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
# verify HazardServices directory exists and copy in files
|
|
||||||
HS_NAME=HazardServices
|
|
||||||
TOOLS_HS_DIR=%{_baseline_workspace}/tools/$HS_NAME
|
|
||||||
if [ -d $TOOLS_HS_DIR ]; then
|
|
||||||
|
|
||||||
cp -Rv $TOOLS_HS_DIR $EDEX_SCRIPTS_DIR
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
# HazardServices dir may not be available, as tools/HazardServices may not exist
|
|
||||||
# if not available, create the directory for other scripts
|
|
||||||
if [ ! -d $EDEX_SCRIPTS_DIR/$HS_NAME ]; then
|
|
||||||
mkdir -p $EDEX_SCRIPTS_DIR/$HS_NAME
|
|
||||||
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
#copy in specific files for HS
|
|
||||||
if [ -d $EDEX_SCRIPTS_DIR/$HS_NAME ]; then
|
|
||||||
|
|
||||||
cp -v %{_baseline_workspace}/tools/parseWarngenTemplate.py $EDEX_SCRIPTS_DIR/$HS_NAME
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
cp -v %{_baseline_workspace}/tools/ingestshapefiles.sh $EDEX_SCRIPTS_DIR/$HS_NAME
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
#create a list of all files packaged for /awips2/edex/data/utility
|
|
||||||
UTILITY=/awips2/edex/data/utility
|
|
||||||
if [ -d %{_build_root}/$UTILITY ]; then
|
|
||||||
cd %{_build_root}/$UTILITY
|
|
||||||
find . -type f > %{_build_root}/awips2/edex/util_filelist.%{name}.txt
|
|
||||||
fi
|
|
||||||
|
|
||||||
%pre
|
|
||||||
%post
|
|
||||||
|
|
||||||
|
|
||||||
#change date stamp of utility files
|
|
||||||
UTILITY=/awips2/edex/data/utility
|
|
||||||
UTIL_FILENAME=/awips2/edex/util_filelist.%{name}.txt
|
|
||||||
if [ -d $UTILITY ] && [ -f $UTIL_FILENAME ]; then
|
|
||||||
while read fileName
|
|
||||||
do
|
|
||||||
touch "$UTILITY/$fileName"
|
|
||||||
done < $UTIL_FILENAME
|
|
||||||
rm -f $UTIL_FILENAME
|
|
||||||
fi
|
|
||||||
|
|
||||||
%preun
|
|
||||||
%postun
|
|
||||||
|
|
||||||
%clean
|
|
||||||
rm -rf ${RPM_BUILD_ROOT}
|
|
||||||
|
|
||||||
%files
|
|
||||||
%defattr(644,awips,fxalpha,755)
|
|
||||||
%dir /awips2
|
|
||||||
%dir /awips2/edex
|
|
||||||
%dir /awips2/edex/conf
|
|
||||||
/awips2/edex/*
|
|
||||||
%defattr(755,awips,fxalpha,-)
|
|
||||||
/awips2/edex/scripts/*
|
|
|
@ -1,82 +0,0 @@
|
||||||
*** Installer.edex-component/component.spec 2015-12-01 15:13:59.047022621 -0600
|
|
||||||
--- Installer.edex-hazards/component.spec 2015-12-01 15:13:59.054022541 -0600
|
|
||||||
***************
|
|
||||||
*** 1,5 ****
|
|
||||||
#
|
|
||||||
! # AWIPS II Edex "component" spec file
|
|
||||||
#
|
|
||||||
%define __prelink_undo_cmd %{nil}
|
|
||||||
# Turn off the brp-python-bytecompile script
|
|
||||||
--- 1,5 ----
|
|
||||||
#
|
|
||||||
! # AWIPS II EDEX Hazard Services spec file
|
|
||||||
#
|
|
||||||
%define __prelink_undo_cmd %{nil}
|
|
||||||
# Turn off the brp-python-bytecompile script
|
|
||||||
***************
|
|
||||||
*** 55,60 ****
|
|
||||||
--- 55,108 ----
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
+ #create the edex scripts dir
|
|
||||||
+ EDEX_SCRIPTS_DIR=%{_build_root}/awips2/edex/scripts/
|
|
||||||
+ if [ ! -d $EDEX_SCRIPTS_DIR ]; then
|
|
||||||
+ mkdir -p $EDEX_SCRIPTS_DIR
|
|
||||||
+
|
|
||||||
+ if [ $? -ne 0 ]; then
|
|
||||||
+ exit 1
|
|
||||||
+ fi
|
|
||||||
+ fi
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+ # verify HazardServices directory exists and copy in files
|
|
||||||
+ HS_NAME=HazardServices
|
|
||||||
+ TOOLS_HS_DIR=%{_baseline_workspace}/tools/$HS_NAME
|
|
||||||
+ if [ -d $TOOLS_HS_DIR ]; then
|
|
||||||
+
|
|
||||||
+ cp -Rv $TOOLS_HS_DIR $EDEX_SCRIPTS_DIR
|
|
||||||
+ if [ $? -ne 0 ]; then
|
|
||||||
+ exit 1
|
|
||||||
+ fi
|
|
||||||
+
|
|
||||||
+ fi
|
|
||||||
+
|
|
||||||
+ # HazardServices dir may not be available, as tools/HazardServices may not exist
|
|
||||||
+ # if not available, create the directory for other scripts
|
|
||||||
+ if [ ! -d $EDEX_SCRIPTS_DIR/$HS_NAME ]; then
|
|
||||||
+ mkdir -p $EDEX_SCRIPTS_DIR/$HS_NAME
|
|
||||||
+
|
|
||||||
+ if [ $? -ne 0 ]; then
|
|
||||||
+ exit 1
|
|
||||||
+ fi
|
|
||||||
+ fi
|
|
||||||
+
|
|
||||||
+ #copy in specific files for HS
|
|
||||||
+ if [ -d $EDEX_SCRIPTS_DIR/$HS_NAME ]; then
|
|
||||||
+
|
|
||||||
+ cp -v %{_baseline_workspace}/tools/parseWarngenTemplate.py $EDEX_SCRIPTS_DIR/$HS_NAME
|
|
||||||
+ if [ $? -ne 0 ]; then
|
|
||||||
+ exit 1
|
|
||||||
+ fi
|
|
||||||
+
|
|
||||||
+ cp -v %{_baseline_workspace}/tools/ingestshapefiles.sh $EDEX_SCRIPTS_DIR/$HS_NAME
|
|
||||||
+ if [ $? -ne 0 ]; then
|
|
||||||
+ exit 1
|
|
||||||
+ fi
|
|
||||||
+
|
|
||||||
+ fi
|
|
||||||
+
|
|
||||||
#create a list of all files packaged for /awips2/edex/data/utility
|
|
||||||
UTILITY=/awips2/edex/data/utility
|
|
||||||
if [ -d %{_build_root}/$UTILITY ]; then
|
|
||||||
***************
|
|
||||||
*** 87,90 ****
|
|
||||||
--- 135,141 ----
|
|
||||||
%defattr(644,awips,fxalpha,755)
|
|
||||||
%dir /awips2
|
|
||||||
%dir /awips2/edex
|
|
||||||
+ %dir /awips2/edex/conf
|
|
||||||
/awips2/edex/*
|
|
||||||
+ %defattr(755,awips,fxalpha,-)
|
|
||||||
+ /awips2/edex/scripts/*
|
|
|
@ -56,26 +56,6 @@ if [ ! "${architecture}" = "x86_64" ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
function patchSpecification()
|
|
||||||
{
|
|
||||||
# copy the standard rpm feature specification into the
|
|
||||||
# component's project directory
|
|
||||||
cp -v Installer.edex-component/component.spec \
|
|
||||||
Installer.${COMPONENT_NAME}/component.spec
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# apply the specification patch
|
|
||||||
pushd . > /dev/null 2>&1
|
|
||||||
cd Installer.${COMPONENT_NAME}
|
|
||||||
patch -p1 -i *.patch0
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
popd > /dev/null 2>&1
|
|
||||||
}
|
|
||||||
|
|
||||||
function buildRPM()
|
function buildRPM()
|
||||||
{
|
{
|
||||||
# Arguments:
|
# Arguments:
|
||||||
|
@ -129,36 +109,16 @@ cd ../
|
||||||
buildRPM "Installer.edex"
|
buildRPM "Installer.edex"
|
||||||
buildRPM "Installer.edex-configuration"
|
buildRPM "Installer.edex-configuration"
|
||||||
|
|
||||||
# build the edex-hazards component
|
|
||||||
export COMPONENT_NAME="edex-hazards"
|
|
||||||
# Workaround until #5466 is resolved.
|
|
||||||
if [ -f ${DIST}/${COMPONENT_NAME}.zip ]; then
|
|
||||||
patchSpecification
|
|
||||||
buildRPM "Installer.edex-hazards"
|
|
||||||
fi
|
|
||||||
unset COMPONENT_NAME
|
|
||||||
|
|
||||||
DIST="${WORKSPACE}/build.edex/edex/dist"
|
DIST="${WORKSPACE}/build.edex/edex/dist"
|
||||||
for edex_zip in `cd ${DIST}; ls -1;`;
|
for edex_zip in `cd ${DIST}; ls -1;`;
|
||||||
do
|
do
|
||||||
edex_component=`python -c "zipFile='${edex_zip}'; componentName=zipFile.replace('.zip',''); print componentName;"`
|
edex_component=`python -c "zipFile='${edex_zip}'; componentName=zipFile.replace('.zip',''); print componentName;"`
|
||||||
|
|
||||||
#Data Delivery and Hazard Services components are built separately
|
# Check if component is in the ignore file, do not build an RPM if so.
|
||||||
if [ ! "${edex_component}" = "edex-datadelivery" ] &&
|
if ! grep -Fxq "${edex_component}" ${WORKSPACE}/build.edex/component.ignore.txt; then
|
||||||
[ ! "${edex_component}" = "common-base" ] &&
|
|
||||||
[ ! "${edex_component}" = "edex-hazards" ]; then
|
|
||||||
export COMPONENT_NAME="${edex_component}"
|
export COMPONENT_NAME="${edex_component}"
|
||||||
buildRPM "Installer.edex-component"
|
buildRPM "Installer.edex-component"
|
||||||
unset COMPONENT_NAME
|
unset COMPONENT_NAME
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# build the edex-datadelivery rpm
|
|
||||||
export COMPONENT_NAME="edex-datadelivery"
|
|
||||||
# Workaround until #5466 is resolved.
|
|
||||||
if [ -f ${DIST}/${COMPONENT_NAME}.zip ]; then
|
|
||||||
patchSpecification
|
|
||||||
buildRPM "Installer.edex-datadelivery"
|
|
||||||
fi
|
|
||||||
unset COMPONENT_NAME
|
|
||||||
|
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
#hazard services
|
|
||||||
diff -crb Installer.edex-component/component.spec Installer.edex-hazards/component.spec > Installer.edex-hazards/hazards.patch0
|
|
||||||
|
|
||||||
#data delivery
|
|
||||||
diff -crb Installer.edex-component/component.spec Installer.edex-datadelivery/component.spec > Installer.edex-datadelivery/datadelivery.patch0
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue