14.1.1-11 baseline

Former-commit-id: 71ae71c850 [formerly c32b2b2037c84cc074e7dc5a5a13b93223640d7d]
Former-commit-id: 70a6f1936e
This commit is contained in:
Steve Harris 2013-12-02 17:10:10 -05:00
parent 8251107646
commit 337b138200
53 changed files with 511 additions and 220 deletions

View file

@ -25,11 +25,19 @@
# quite finished yet - or have finished only recently.
#
# 2010/04/23 ryu Initial port to AWIPS II.
# ----------------------------------------------------------------------------
#
# SOFTWARE HISTORY
#
# Date Ticket# Engineer Description
# ------------ ---------- ----------- --------------------------
# 11/21/13 16770 ryu Change name of temporary files
# for dual domain.
#
#=============================================================================
#
# Do not show this in any menu. Should only be run via runProcedure after
# putting the parms to save in /tmp/FILE (one on each line)
# putting the parms to save in /tmp/<siteId>_FILE (one on each line)
#
#MenuItems = ["Verify"]
#
@ -84,7 +92,7 @@ class Procedure (SmartScript.SmartScript):
# Read the parms from the FILE file
#
parmlist=[]
filename="/tmp/%s"%FILE
filename="/tmp/%s_%s"% (self.getSiteID(), FILE)
if ((os.path.exists(filename)) and (os.path.isfile(filename))):
try:
infile=file(filename,"r")

View file

@ -23,10 +23,18 @@
# 2008/05/28 - version 2.0.5 - bugfix for basetime/starttime when an
# archived grid is constant.
#
# ----------------------------------------------------------------------------
#
# SOFTWARE HISTORY
#
# Date Ticket# Engineer Description
# ------------ ---------- ----------- --------------------------
# 11/21/13 16770 ryu Change name of temporary files
# for dual domain.
#=============================================================================
#
# Do not show this in any menu. Should only be run via runProcedure after
# putting the force flag and model to correct in /tmp/FILE
# putting the force flag and model to correct in /tmp/<siteId>_FILE
#
#MenuItems = ["Verify"]
#
@ -97,7 +105,7 @@ class Procedure (SmartScript.SmartScript):
force="0"
model=""
obsmodel=""
filename="/tmp/%s"%FILE
filename="/tmp/%s_%s"% (self.getSiteID(), FILE)
if ((os.path.exists(filename))and(os.path.isfile(filename))):
try:
infile=file(filename,"r")

View file

@ -23,10 +23,18 @@
# this procedure is run via runProcedure.
#
# 2010/04/23 ryu Initial port to AWIPS II.
# ----------------------------------------------------------------------------
#
# SOFTWARE HISTORY
#
# Date Ticket# Engineer Description
# ------------ ---------- ----------- --------------------------
# 11/21/13 16770 ryu Change name of temporary files
# for dual domain.
#=============================================================================
#
# Do not show this in any menu. Should only be run via runProcedure after
# putting the model to save in /tmp/FILE
# putting the model to save in /tmp/<siteId>_FILE
#
#MenuItems = ["Verify"] # for debug
#
@ -739,7 +747,7 @@ class Procedure (SmartScript.SmartScript):
#==================================================================
#
# getSaveModels - get list of models to save. First try reading
# the model name from /tmp/$FILE. If not there -
# the model name from /tmp/<siteId>_$FILE. If not there -
# get list of all models in the
# BOIVerify system except Official and ISC
#
@ -749,7 +757,7 @@ class Procedure (SmartScript.SmartScript):
#
# Read the model from the FILE file
#
filename="/tmp/%s"%FILE
filename="/tmp/%s_%s"% (self.getSiteID(), FILE)
if ((os.path.exists(filename))and(os.path.isfile(filename))):
try:
infile=file(filename,"r")

View file

@ -13,6 +13,14 @@
# 2007/10/x25 - version 2.0 - original implementation of this program
#
# 2010/04/23 ryu Initial port to AWIPS II.
# ----------------------------------------------------------------------------
#
# SOFTWARE HISTORY
#
# Date Ticket# Engineer Description
# ------------ ---------- ----------- --------------------------
# 11/21/13 16770 ryu Change name of temporary files
# for dual domain.
#=====================================================================
#
# S T A R T C O N F I G U R A T I O N S E C T I O N
@ -56,11 +64,6 @@ MODLIST=["Official","MOSGuideBC","MOSGuide","GFS40","GFS40BC",
#
EMAIL_FROM_ADDRESS="nobody.nobody@noaa.gov"
#
# Temporary file where e-mail output is kept. This is automatically
# deleted after the commands below are executed.
#
EMAIL_TEMP_FILE="/tmp/temp_email.txt"
#
# Commands to be executed to send the temporary e-mail file.
# You probably need to reference the EMAIL_TEMP_FILE you
# specified above. This works on a typical AWIPS setup, where it
@ -68,9 +71,9 @@ EMAIL_TEMP_FILE="/tmp/temp_email.txt"
# then does a sendmail command on ls1, and then deletes the temporary
# file on ls1.
#
EMAIL_CMDS=["scp /tmp/temp_email.txt ldad@ls1-boi:/tmp/temp_email.txt",
"ssh ldad@ls1-boi sendmail -t </tmp/temp_email.txt",
"ssh ldad@ls1-boi rm /tmp/temp_email.txt",
EMAIL_CMDS=["scp /tmp/{FILE} ldad@ls1:/tmp/{FILE}",
"ssh ldad@ls1 sendmail -t </tmp/{FILE}",
"ssh ldad@ls1 rm /tmp/{FILE}",
]
#
# Always sends summary to these addresses - even if they were not
@ -102,10 +105,10 @@ SAVE_DIR="/tmp"
# output is created. You can put "{FILE}" in these and it will be
# replaced with the filename before execution.
#
SAVE_CMDS=["scp /tmp/{FILE} ldad@ls1-boi:/tmp/{FILE}",
"ssh ldad@ls1-boi chmod 666 /tmp/{FILE}",
"ssh ldad@ls1-boi cp /tmp/{FILE} /lanfiles/GridVer/{FILE}",
"ssh ldad@ls1-boi rm /tmp/{FILE}",
SAVE_CMDS=["scp /tmp/{FILE} ldad@ls1:/tmp/{FILE}",
"ssh ldad@ls1 chmod 666 /tmp/{FILE}",
"ssh ldad@ls1 cp /tmp/{FILE} /lanfiles/GridVer/{FILE}",
"ssh ldad@ls1 rm /tmp/{FILE}",
]
#
#
@ -159,7 +162,7 @@ class Procedure (SmartScript.SmartScript):
self.obsModel=OBSMODEL
grid=self._empty
#
# See if a time is provided in a /tmp/SumTemps.time file
# See if a time is provided in a /tmp/<siteId>_SumTemps.time file
# or otherwise get the current system time
#
now=self.getNow()
@ -249,8 +252,8 @@ class Procedure (SmartScript.SmartScript):
# Save the clean output for use on webpages
#
(vyea,vmon,vday,vhou,vmin,vsec,vwda,vyda,vdst)=time.gmtime(verifday)
outname="%4.4d%2.2d%2.2d_%s.html"%(vyea,vmon,vday,parm)
fullname="%s/%s"%(SAVE_DIR,outname)
outname="%s_%4.4d%2.2d%2.2d_%s.html"%(self.getSiteID(),vyea,vmon,vday,parm)
fullname="%s/%s_%s"%(SAVE_DIR, outname)
outfile=file(fullname,"w")
outfile.write(cleanoutput)
outfile.close()
@ -265,7 +268,7 @@ class Procedure (SmartScript.SmartScript):
return
#==================================================================
# getNow - sees if there is a specified time in the
# /tmp/SumTemps.time file. If no file exists, or there
# /tmp/<siteId>_SumTemps.time file. If no file exists, or there
# is trouble reading file, it uses the current system
# time as 'now'.
#
@ -277,7 +280,7 @@ class Procedure (SmartScript.SmartScript):
#
# If the file doesn't exist or isn't a real file...return
#
timeFile="/tmp/SumTemps.time"
timeFile="/tmp/%s_SumTemps.time" % self.getSiteID()
if not os.path.exists(timeFile):
return now
if not os.path.isfile(timeFile):
@ -363,6 +366,8 @@ class Procedure (SmartScript.SmartScript):
(gyea,gmon,gday,ghou,gmin,gsec,gwda,gyda,gdst)=time.gmtime(verifday)
subject="%s verification for %s, %s %d, %4.4d"%(parm,DAYS[gwda],
MONS[gmon-1],gday,gyea)
EMAIL_TEMP_FILE="/tmp/%s_temp_email.txt" % self.getSiteID()
outfile=open(EMAIL_TEMP_FILE,"w")
outfile.write("To:%s\n"%to)
outfile.write("From:%s\n"%EMAIL_FROM_ADDRESS)
@ -372,7 +377,8 @@ class Procedure (SmartScript.SmartScript):
outfile.close()
if len(EMAIL_CMDS)>0:
for cmd in EMAIL_CMDS:
os.system(cmd)
newcmd=cmd.replace("{FILE}", EMAIL_TEMP_FILE)
os.system(newcmd)
#os.system("rm %s"%EMAIL_TEMP_FILE)
return
#==================================================================

View file

@ -97,7 +97,8 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
* invalid product Id and user want to edit it anyway.
* 09/20/2012 1196 rferrel Changing dialogs being called to not block.
* 11/26/2012 14526 mgamazaychikov Added traverse listener for RETURN key
* 10/07/2012 16664 mgamazaychikov Added padProdDesignatorText method
* 10/07/2013 16664 mgamazaychikov Added padProdDesignatorText method
* 11/21/2013 16633 mgamazaychikov Improved consistency between AFOS PIL and WMO Heading fields.
* </pre>
*
* @author lvenable
@ -1012,6 +1013,17 @@ public class AWIPSHeaderBlockDlg extends CaveSWTDialog implements
}
}
// reset WMO Heading or AFOS PIL sections to
// make the sections consistent with each other
boolean afosReset = isAfosResetRequired();
boolean wmoidReset = isWmoidResetRequired();
if (callAfosLookup && afosReset) {
setAfosId(null);
}
if (!callAfosLookup && wmoidReset) {
setWmoId("", "");
}
if (!isDisposed()) {
if (tf.getCaretOffset() == tf.getTextLimit()) {
nextTF.setFocus();
@ -1051,4 +1063,31 @@ public class AWIPSHeaderBlockDlg extends CaveSWTDialog implements
});
}
private boolean isAfosResetRequired() {
// returns true if changes are made to WMO Heading for a complete AFOS PIL
boolean wmoSectionComplete = isWmoHeadingComplete();
boolean afosPilComplete = isAfosPilComplete();
return afosPilComplete && !wmoSectionComplete && lookupAllowed;
}
private boolean isWmoidResetRequired() {
// returns true if changes are made to AFOS PIL for a complete WMO Heading
boolean wmoSectionComplete = isWmoHeadingComplete();
boolean afosPilComplete = isAfosPilComplete();
return !afosPilComplete && wmoSectionComplete && lookupAllowed;
}
private boolean isWmoHeadingComplete() {
// returns true for a complete WMO Heading
return wmoTtaaiiTF.getText().length() == wmoTtaaiiTF.getTextLimit() &&
ccccTF.getText().length() == ccccTF.getTextLimit();
}
private boolean isAfosPilComplete() {
// returns true for a complete AFOS PIL
return wsfoIdTF.getText().length() == wsfoIdTF.getTextLimit() &&
prodCatTF.getText().length() == prodCatTF.getTextLimit() &&
prodDesignatorTF.getText().length() == prodDesignatorTF.getTextLimit();
}
}

View file

@ -121,6 +121,7 @@ import com.raytheon.uf.common.dataplugin.text.db.StdTextProductId;
import com.raytheon.uf.common.dataplugin.text.request.RemoteRetrievalRequest;
import com.raytheon.uf.common.dataplugin.text.request.StdTextProductServerRequest;
import com.raytheon.uf.common.dataplugin.text.request.TextProductInfoCreateRequest;
import com.raytheon.uf.common.dissemination.OUPTestRequest;
import com.raytheon.uf.common.dissemination.OUPRequest;
import com.raytheon.uf.common.dissemination.OUPResponse;
import com.raytheon.uf.common.dissemination.OfficialUserProduct;
@ -331,6 +332,7 @@ import com.raytheon.viz.ui.dialogs.SWTMessageBox;
* 04Sep2013 2176 jsanchez Changed the order of the QC check dialogs.
* 12Sep2013 DR 2249 rferrel Change Time stamp in file name created by warngen to use
* simulated time.
* 20Nov2013 DR 16777 D. Friedman Check if OUPRequest will work before setting ETN.
* </pre>
*
* @author lvenable
@ -4936,53 +4938,61 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
removeOptionalFields();
try {
/* update the vtec string in the message */
// DR14553 (make upper case in product)
if (!resend) {
body = VtecUtil.getVtec(removeSoftReturns(textEditor
.getText().toUpperCase()), true);
}
updateTextEditor(body);
if ((inEditMode || resend)
&& saveEditedProduct(false, resend, true)) {
inEditMode = false;
}
if (!resend) {
StdTextProduct prod = getStdTextProduct();
OUPTestRequest testReq = new OUPTestRequest();
testReq.setOupRequest(
createOUPRequest(prod, prod.getProduct()));
try {
OUPResponse checkResponse = (OUPResponse)
ThriftClient.sendRequest(testReq);
if (checkResponse.hasFailure()) {
statusHandler.handle(Priority.PROBLEM,
"Error during text product transmission check: "
+ checkResponse.getMessage());
inEditMode = true;
return;
}
} catch (VizException e) {
statusHandler.handle(Priority.PROBLEM,
"Error during text product transmission check", e);
inEditMode = true;
return;
}
/* Update the vtec string in the message. It looks wrong to
* do this after saveEditedProduct, but it works because
* for this case (isOpertional && ! resend) case, saveEditedProduct,
* does not actually save anything. */
prod.setProduct(
VtecUtil.getVtec(removeSoftReturns(prod.getProduct()), true));
/*
* This silly bit of code updates the ETN of a VTEC in the
* text pane to reflect the ETN that was actually used, but
* not update any other parts of the text even though they
* may have also been changed just before the product was
* sent.
*
* A1 works similarly.
*/
updateTextEditor(copyEtn(prod.getProduct(), body));
}
String product = TextDisplayModel.getInstance().getProduct(
token);
OUPRequest req = new OUPRequest();
OfficialUserProduct oup = new OfficialUserProduct();
StdTextProduct prod = getStdTextProduct(); // TODO: makes me
// nervous...
String awipsWanPil = prod.getSite() + prod.getNnnid()
+ prod.getXxxid();
String awipsID = prod.getNnnid() + prod.getXxxid();
// TODO: Should not need to call getProduct and the like twice.
StdTextProduct prod = getStdTextProduct();
OUPRequest req = createOUPRequest(prod, product);
if (notify != null) {
notify.add(product);
}
oup.setAwipsWanPil(awipsWanPil);
oup.setNeedsWmoHeader(false);
oup.setProductText(product);
oup.setSource("TextWS");
oup.setWmoType(fixNOR(prod.getBbbid()));
oup.setUserDateTimeStamp(prod.getHdrtime());
StringBuilder fileName = new StringBuilder();
// The .wan extension followed by the 10 digit epoch seconds
// of simulated time is used in EDEX's WarningDecoder to
// determine the base time.
fileName.append(awipsID).append(".wan")
.append(TimeUtil.getUnixTime(TimeUtil.newDate()));
oup.setFilename(fileName.toString());
oup.setAddress(addressee);
if ((attachedFile != null) && (attachedFilename != null)) {
oup.setAttachedFile(attachedFile);
oup.setAttachedFilename(attachedFilename);
}
req.setCheckBBB(true);
req.setProduct(oup);
req.setUser(UserController.getUserObject());
// Code in Run statement goes here!
new Thread(new ThriftClientRunnable(req)).start();
@ -5034,6 +5044,51 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
}
}
private OUPRequest createOUPRequest(StdTextProduct prod, String text) {
OUPRequest req = new OUPRequest();
OfficialUserProduct oup = new OfficialUserProduct();
String awipsWanPil = prod.getSite() + prod.getNnnid()
+ prod.getXxxid();
String awipsID = prod.getNnnid() + prod.getXxxid();
oup.setAwipsWanPil(awipsWanPil);
oup.setNeedsWmoHeader(false);
oup.setProductText(text);
oup.setSource("TextWS");
oup.setWmoType(fixNOR(prod.getBbbid()));
oup.setUserDateTimeStamp(prod.getHdrtime());
StringBuilder fileName = new StringBuilder();
// The .wan extension followed by the 10 digit epoch seconds
// of simulated time is used in EDEX's WarningDecoder to
// determine the base time.
fileName.append(awipsID).append(".wan")
.append(TimeUtil.getUnixTime(TimeUtil.newDate()));
oup.setFilename(fileName.toString());
oup.setAddress(addressee);
if ((attachedFile != null) && (attachedFilename != null)) {
oup.setAttachedFile(attachedFile);
oup.setAttachedFilename(attachedFilename);
}
req.setCheckBBB(true);
req.setProduct(oup);
req.setUser(UserController.getUserObject());
return req;
}
private static String copyEtn(String from, String to) {
VtecObject fromVtec = VtecUtil.parseMessage(from);
if (fromVtec != null && "NEW".equals(fromVtec.getAction())) {
VtecObject toVtec = VtecUtil.parseMessage(to);
if (toVtec != null) {
toVtec.setSequence(fromVtec.getSequence());
return VtecUtil.replaceFirstVtecString(to, fromVtec);
}
}
return to;
}
/**
* Recreates the original message by combining the header and the body from
* the edit windows.

View file

@ -47,6 +47,7 @@ import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.common.time.ISimulatedTimeChangeListener;
import com.raytheon.uf.common.time.SimulatedTime;
import com.raytheon.uf.common.time.util.TimeUtil;
import com.raytheon.viz.core.mode.CAVEMode;
import com.raytheon.viz.ui.actions.ShowTimeDialog;
@ -64,6 +65,8 @@ import com.raytheon.viz.ui.actions.ShowTimeDialog;
* Nov 30,2007 461 bphillip Initial Creation
* 09JUL2008 1234 ebabin Updates for color, and display issues.
* Jan 09, 2013 1442 rferrel Added Simulated Time Change listener.
* Nov 19, 2013 2439 rferrel Adjust timer schedule to update when
* DRT rolls over to the next minute.
*
* </pre>
*
@ -102,8 +105,10 @@ public class TimeDisplay extends ContributionItem {
td.update();
}
long t = System.currentTimeMillis() % 60000;
this.schedule(60000 - t);
// DR 2439 schedule when simulated time minute changes.
long t = TimeUtil.newDate().getTime()
% TimeUtil.MILLIS_PER_MINUTE;
this.schedule(TimeUtil.MILLIS_PER_MINUTE - t);
}
return Status.OK_STATUS;
@ -158,7 +163,8 @@ public class TimeDisplay extends ContributionItem {
@Override
public void timechanged() {
update();
// Force immediate update and reschedule.
updateJob.wakeUp();
}
};
SimulatedTime.getSystemTime().addSimulatedTimeChangeListener(

View file

@ -2,6 +2,7 @@ package com.raytheon.viz.warnings.rsc;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
@ -212,7 +213,8 @@ public abstract class AbstractWWAResource extends
framePeriod = new TimeRange(time.getRefTime(),
frameTimes[frameIdx + 1].getRefTime());
} else {
framePeriod = new TimeRange(time.getRefTime(), LAST_FRAME_ADJ);
framePeriod = getLastFrameTimeRange(time.getRefTime());
lastFrame = true;
}
@ -333,8 +335,7 @@ public abstract class AbstractWWAResource extends
framePeriod = new TimeRange(thisFrameTime.getRefTime(),
frames[index + 1].getRefTime());
} else {
framePeriod = new TimeRange(thisFrameTime.getRefTime(),
LAST_FRAME_ADJ);
framePeriod = getLastFrameTimeRange(thisFrameTime.getRefTime());
lastFrame = true;
}
synchronized (paintLock) {
@ -472,15 +473,7 @@ public abstract class AbstractWWAResource extends
frameTime = timeToDisplay;
// point paint time to different time
paintTime = new DataTime(timeToDisplay);
// point framePeriod to new frame
if (SimulatedTime.getSystemTime().isRealTime()) {
framePeriod = new TimeRange(frameTime, LAST_FRAME_ADJ);
} else {
// Prevent getting "future" records by keeping interval in the
// same minute.
framePeriod = new TimeRange(frameTime,
30 * TimeUtil.MILLIS_PER_SECOND);
}
framePeriod = getLastFrameTimeRange(frameTime);
}
// check if the warning is cancelled
@ -508,8 +501,8 @@ public abstract class AbstractWWAResource extends
descFrameTimes.length);
for (int i = 0; i < descFrameTimes.length; i++) {
if (i == descFrameTimes.length - 1) {
framePeriods.add(new TimeRange(descFrameTimes[i].getRefTime(),
LAST_FRAME_ADJ));
framePeriods.add(getLastFrameTimeRange(descFrameTimes[i]
.getRefTime()));
} else {
framePeriods.add(new TimeRange(descFrameTimes[i].getRefTime(),
descFrameTimes[i + 1].getRefTime()));
@ -691,4 +684,27 @@ public abstract class AbstractWWAResource extends
return name;
}
/**
* Determine time range for the last frame. When in simulated time (DRT)
* keep end of time range the start of the base time's next minute.
*
* @param baseTime
* @return timeRange
*/
private TimeRange getLastFrameTimeRange(Date baseTime) {
TimeRange timeRange = null;
if (SimulatedTime.getSystemTime().isRealTime()) {
timeRange = new TimeRange(baseTime, LAST_FRAME_ADJ);
} else {
Calendar cal = TimeUtil.newGmtCalendar();
cal.setTime(baseTime);
// Make the end time for the last frame the start of the next minute
// of the base time to prevent getting "future" warnings.
cal.add(Calendar.MINUTE, 1);
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MILLISECOND, 0);
timeRange = new TimeRange(baseTime, cal.getTime());
}
return timeRange;
}
}

View file

@ -780,7 +780,7 @@ class IscMosaic:
if tr is not None:
try:
logger.debug("Processing Blank: %s TR=%s",
parmName, self.__printTR(tr))
parmName, printTR(tr))
self.__processBlankTime(mGrid, tr)
except:
logger.exception('Failure to process grid blanking Parm=%s Time=%s',

View file

@ -74,7 +74,7 @@ import com.raytheon.uf.edex.plugin.grid.dao.GridDao;
* Mar 27, 2013 1821 bsteffen Reduce db and pypies requests in grid
* assembler.
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
*
* Nov 19, 2013 2478 rjpeter Make update process update database also.
* </pre>
*
* @author bphillip
@ -112,8 +112,8 @@ public class EnsembleGridAssembler implements IDecoderPostProcessor {
FilenameFilters.ACCEPT_FILES,
FilenameFilters.byFileExtension(".xml"));
List<File> thinnedModelFiles = FileUtil.listFiles(commonPath,
filter, false);
List<File> thinnedModelFiles = FileUtil.listFiles(commonPath, filter,
false);
for (File file : thinnedModelFiles) {
try {
@ -274,7 +274,7 @@ public class EnsembleGridAssembler implements IDecoderPostProcessor {
assembledRecord.setMessageData(rec.getFloatData());
mergeData(record, assembledRecord, thinned);
assembledRecord.setOverwriteAllowed(true);
dao.persistToHDF5(assembledRecord);
dao.persistRecords(assembledRecord);
} catch (PluginException e) {
throw new GribException("Error storing assembled grid to HDF5", e);
}

View file

@ -0,0 +1,43 @@
package com.raytheon.uf.common.dissemination;
import com.raytheon.uf.common.auth.req.AbstractPrivilegedRequest;
import com.raytheon.uf.common.auth.user.IUser;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
/**
* Request to check if an OUPRequest will work
*
* <pre>
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Nov 20, 2013 DR 16777 D. Friedman Initial creation
*
* </pre>
*
*/
@DynamicSerialize
public class OUPTestRequest extends AbstractPrivilegedRequest {
@DynamicSerializeElement
OUPRequest oupRequest;
public IUser getUser() {
return oupRequest.getUser();
}
public void setUser(IUser user) {
oupRequest.setUser(user);
}
public OUPRequest getOupRequest() {
return oupRequest;
}
public void setOupRequest(OUPRequest oupRequest) {
this.oupRequest = oupRequest;
}
}

View file

@ -7,10 +7,17 @@
<bean id="oupHandler" class="com.raytheon.uf.edex.dissemination.OUPHandler">
<property name="ackManager" ref="oupAckMgr" />
</bean>
<bean id="oupTestHandler" class="com.raytheon.uf.edex.dissemination.OUPTestHandler">
<property name="oupHandler" ref="oupHandler" />
</bean>
<bean factory-bean="handlerRegistry" factory-method="register">
<constructor-arg value="com.raytheon.uf.common.dissemination.OUPRequest" />
<constructor-arg ref="oupHandler" />
</bean>
<bean factory-bean="handlerRegistry" factory-method="register">
<constructor-arg value="com.raytheon.uf.common.dissemination.OUPTestRequest" />
<constructor-arg ref="oupTestHandler" />
</bean>
<camelContext id="handleoupAckMgrContext" xmlns="http://camel.apache.org/schema/spring"
errorHandlerRef="errorHandler">

View file

@ -58,6 +58,7 @@ import com.raytheon.uf.edex.dissemination.transmitted.TransProdHeader;
* Oct 22, 2009 njensen Initial creation
* Oct 12, 2012 DR 15418 D. Friedman Use clustered TransmittedProductList
* Jun 07, 2013 1981 mpduff This is now a priviledged request handler.
# Nov 20, 2013 DR 16777 D. Friedman Add a test mode.
*
* </pre>
*
@ -76,6 +77,10 @@ public class OUPHandler extends AbstractPrivilegedRequestHandler<OUPRequest> {
@Override
public OUPResponse handleRequest(OUPRequest request) throws Exception {
return handleOUPRequest(request, false);
}
public OUPResponse handleOUPRequest(OUPRequest request, boolean test) throws Exception {
OfficialUserProduct oup = request.getProduct();
OUPResponse resp = new OUPResponse();
boolean changedBbb = false;
@ -85,7 +90,7 @@ public class OUPHandler extends AbstractPrivilegedRequestHandler<OUPRequest> {
request = ModifyProduct.addWmoHeader(request);
}
TransProdHeader header = ModifyProduct.getProductHeader(oup);
if (request.isCheckBBB()) {
if (request.isCheckBBB() && ! test) {
changedBbb = ModifyProduct.checkBBBField(oup, header);
if (changedBbb) {
resp.setChangedBBB(request.getProduct().getWmoType());
@ -104,6 +109,7 @@ public class OUPHandler extends AbstractPrivilegedRequestHandler<OUPRequest> {
args.put("afosID", header.getProductId());
args.put("resp", resp);
args.put("ackMgr", ackManager);
args.put("test", test);
resp.setAttempted(true);
py.execute("process", args);
} catch (JepException e) {

View file

@ -0,0 +1,45 @@
package com.raytheon.uf.edex.dissemination;
import com.raytheon.uf.common.auth.exception.AuthorizationException;
import com.raytheon.uf.common.auth.user.IUser;
import com.raytheon.uf.common.dissemination.OUPTestRequest;
import com.raytheon.uf.edex.auth.req.AbstractPrivilegedRequestHandler;
import com.raytheon.uf.edex.auth.resp.AuthorizationResponse;
/**
* Check if an OUPRequest will work
*
* <pre>
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Nov 20, 2013 DR 16777 D. Friedman Initial creation
*
* </pre>
*
*/
public class OUPTestHandler extends AbstractPrivilegedRequestHandler<OUPTestRequest> {
private OUPHandler oupHandler;
@Override
public Object handleRequest(OUPTestRequest request) throws Exception {
return oupHandler.handleOUPRequest(request.getOupRequest(), true);
}
@Override
public AuthorizationResponse authorized(IUser user,
OUPTestRequest request) throws AuthorizationException {
return oupHandler.authorized(user, request.getOupRequest());
}
public OUPHandler getOupHandler() {
return oupHandler;
}
public void setOupHandler(OUPHandler oupHandler) {
this.oupHandler = oupHandler;
}
}

View file

@ -34,6 +34,7 @@
# 04/13/12 DR 10388 D. Friedman Correct acknowledgment handling
# 08/17/12 DR 15304 D. Friedman Use unique output file names
# 10/12/12 DR 15418 D. Friedman Use unique attachment file names
# 11/20/13 DR 16777 D. Friedman Add a test mode.
#
#
@ -71,7 +72,7 @@ INGEST_DIR = dataDir + 'manual'
INGEST_ROUTE = 'handleoupFilePush'
SITE_ID = env.getEnvValue('SITENAME')
def process(oup, afosID, resp, ackMgr = None):
def process(oup, afosID, resp, ackMgr = None, test = False):
_Logger.info("handleOUP.py received " + str(oup.getFilename()))
wmoTypeString = ""
userDateTimeStamp = ""
@ -137,7 +138,7 @@ def process(oup, afosID, resp, ackMgr = None):
_Logger.debug(msg)
resp.setMessage(msg)
return
else:
elif not test:
try:
from com.raytheon.uf.edex.plugin.manualIngest import MessageGenerator
if MessageGenerator.getInstance().sendFileToIngest(awipsPathname, INGEST_ROUTE):
@ -166,7 +167,22 @@ def process(oup, afosID, resp, ackMgr = None):
fos.write(attachedFile)
fos.flush()
fos.close()
if test:
try:
os.remove(awipsPathname)
except EnvironmentError:
pass # ignore
if attachedFilename:
try:
os.remove(attachedFilename)
except EnvironmentError:
pass # ignore
resp.setSendLocalSuccess(True)
resp.setSendWANSuccess(True)
return
messageIdToAcknowledge = None
#----------
# Check if product should be distributed over WAN via NCF

View file

@ -1,126 +1,126 @@
#!/bin/bash
if [ ${#AWIPS_HOME} = 0 ]
then
path_to_script=`readlink -f $0`
export AWIPS_HOME=$(dirname $(dirname $(dirname $(dirname $path_to_script))))
fi
. ${AWIPS_HOME}/GFESuite/ServiceBackup/configuration/svcbu.env
# Create the log file
logdir=${IFPS_LOG}/`date +%Y%m%d`
logfil=svcbu_receive_grids_from_bksite`date +%H%M`
logfile=${logdir}/${logfil}
[ ! -d ${logdir} ] && (umask 000;mkdir ${logdir})
touch ${logdir}/${logfil}
exec 1>${logdir}/${logfil} 2>&1
# Check the status of the lock file to see if we are OK to proceed
if [ -f ${LOCK_DIR}/importBkSiteGrids ];
then
log_msg Cannot process grids.
exit 1
fi
touch ${LOCK_DIR}/importBkSiteGrids
log_msg 0
# Retrieve the name of the site from the tar file.
import_grd_file=${1}
if [ -a ${import_grd_file} ]
then
log_msg "Import Grids file is ${import_grd_file}"
mv ${import_grd_file} ${GFESUITE_HOME}/Grd
cd ${GFESUITE_HOME}
tar xf Grd
if [ $? -eq 0 ]; then
SITE=`cat siteID.txt | tr '[a-z]' '[A-Z]'`
site=`echo $SITE | tr '[A-Z]' '[a-z]'`
gunzip -f ${site}Grd.netcdf.gz
else
# move the file to appropriate directory.
mv -f Grd Grd.netcdf.gz
chmod 777 Grd.netcdf.gz
log_msg "Gunzipping ${GFESUITE_HOME}/Grd.netcdf.gz"
gunzip -f Grd.netcdf.gz
if [ $? -ne 0 ];
then
log_msg "ERROR: Could not gunzip ${GFESUITE_HOME}/Grd.netcdf.gz"
rm -f ${LOCK_DIR}/importBkSiteGrids
log_msg 100
exit 1
fi
log_msg "Done Gunzipping!"
log_msg "Finding site-id using ncdump method."
hdr=`mktemp`
ncdump -h ${GFESUITE_HOME}/Grd.netcdf > $hdr
SITE=`grep siteID $hdr | head -1 | cut -d'"' -f2`
site=`echo $SITE | tr '[A-Z]' '[a-z]'`
if [ -z $site ]
then
log_msg "ERROR: Could not find out the site from ncdump method..."
rm -f $hdr
rm -f ${LOCK_DIR}/importBkSiteGrids
log_msg 100
exit 1
fi
mv -f ${GFESUITE_HOME}/Grd.netcdf ${GFESUITE_HOME}/${site}Grd.netcdf
rm -f $hdr
fi
log_msg "site is $site"
else
log_msg "Unable to locate the gridded data of the site, ${import_grd_file}"
log_msg "You will need to request your backup site to send grids again."
log_msg 100
rm -f ${LOCK_DIR}/importBkSiteGrids
exit 1
fi
log_msg 50
# Check if import file was supplied correctly by msg_send.
import_file=${GFESUITE_HOME}/${site}Grd.netcdf
log_msg "import_file=${import_file}"
SITE=`echo ${SITE} | tr '[a-z]' '[A-Z]'`
if [ -a ${import_file} ]
then
#use iscMosaic to load grids into databases
log_msg "Running iscMosaic to unpack griddded data..."
${GFESUITE_BIN}/iscMosaic -h $SVCBU_HOST -r $CDSPORT -d ${SITE}_GRID__Restore_00000000_0000 -f ${import_file} -n -x
if [ $? -ne 0 ];
then
log_msg "ERROR: iscMosaic failed to run correctly. Please re-run iscMosaic manually."
log_msg 100
rm -f ${LOCK_DIR}/importBkSiteGrids
exit 1
fi
log_msg "Finished running iscMosaic..."
# Generate a GFE message saying new Grids have arrived in Restore database.
cd ${GFESUITE_BIN}
./sendGfeMessage -h ${SVCBU_HOST} -p ${CDSPORT} -u -m "Restore database has been populated with new grids."
else
log_msg "Unable to locate the gridded data of the site,${import_file} You will need to request your backup site to send grids again."
log_msg 100
rm -f ${LOCK_DIR}/importBkSiteGrids
exit 1
fi
#clean-up.
rm -f ${GFESUITE_HOME}/Grd
rm -f ${GFESUITE_HOME}/${SITE}Grd* siteID.txt
log_msg 100
rm -f ${LOCK_DIR}/importBkSiteGrids
#ALL well, send a msg and get out of here
log_msg "Importing Grids from backup site is completed. You may start your GFE now."
log_msg "Grids received from backup site are stored in ${SITE}_GRID__Restore_00000000_0000 database."
exit 0
#!/bin/bash
if [ ${#AWIPS_HOME} = 0 ]
then
path_to_script=`readlink -f $0`
export AWIPS_HOME=$(dirname $(dirname $(dirname $(dirname $path_to_script))))
fi
. ${AWIPS_HOME}/GFESuite/ServiceBackup/configuration/svcbu.env
# Create the log file
logdir=${IFPS_LOG}/`date +%Y%m%d`
logfil=svcbu_receive_grids_from_bksite`date +%H%M`
logfile=${logdir}/${logfil}
[ ! -d ${logdir} ] && (umask 000;mkdir ${logdir})
touch ${logdir}/${logfil}
exec 1>${logdir}/${logfil} 2>&1
# Check the status of the lock file to see if we are OK to proceed
if [ -f ${LOCK_DIR}/importBkSiteGrids ];
then
log_msg Cannot process grids.
exit 1
fi
touch ${LOCK_DIR}/importBkSiteGrids
log_msg 0
# Retrieve the name of the site from the tar file.
import_grd_file=${1}
if [ -a ${import_grd_file} ]
then
log_msg "Import Grids file is ${import_grd_file}"
mv ${import_grd_file} ${GFESUITE_HOME}/Grd
cd ${GFESUITE_HOME}
tar xf Grd
if [ $? -eq 0 ]; then
SITE=`cat siteID.txt | tr '[a-z]' '[A-Z]'`
site=`echo $SITE | tr '[A-Z]' '[a-z]'`
gunzip -f ${site}Grd.netcdf.gz
else
# move the file to appropriate directory.
mv -f Grd Grd.netcdf.gz
chmod 777 Grd.netcdf.gz
log_msg "Gunzipping ${GFESUITE_HOME}/Grd.netcdf.gz"
gunzip -f Grd.netcdf.gz
if [ $? -ne 0 ];
then
log_msg "ERROR: Could not gunzip ${GFESUITE_HOME}/Grd.netcdf.gz"
rm -f ${LOCK_DIR}/importBkSiteGrids
log_msg 100
exit 1
fi
log_msg "Done Gunzipping!"
log_msg "Finding site-id using ncdump method."
hdr=`mktemp`
ncdump -h ${GFESUITE_HOME}/Grd.netcdf > $hdr
SITE=`grep siteID $hdr | head -1 | cut -d'"' -f2`
site=`echo $SITE | tr '[A-Z]' '[a-z]'`
if [ -z $site ]
then
log_msg "ERROR: Could not find out the site from ncdump method..."
rm -f $hdr
rm -f ${LOCK_DIR}/importBkSiteGrids
log_msg 100
exit 1
fi
mv -f ${GFESUITE_HOME}/Grd.netcdf ${GFESUITE_HOME}/${site}Grd.netcdf
rm -f $hdr
fi
log_msg "site is $site"
else
log_msg "Unable to locate the gridded data of the site, ${import_grd_file}"
log_msg "You will need to request your backup site to send grids again."
log_msg 100
rm -f ${LOCK_DIR}/importBkSiteGrids
exit 1
fi
log_msg 50
# Check if import file was supplied correctly by msg_send.
import_file=${GFESUITE_HOME}/${site}Grd.netcdf
log_msg "import_file=${import_file}"
SITE=`echo ${SITE} | tr '[a-z]' '[A-Z]'`
if [ -a ${import_file} ]
then
#use iscMosaic to load grids into databases
log_msg "Running iscMosaic to unpack griddded data..."
${GFESUITE_BIN}/iscMosaic -h $SVCBU_HOST -r $CDSPORT -d ${SITE}_GRID__Restore_00000000_0000 -f ${import_file} -n -x
if [ $? -ne 0 ];
then
log_msg "ERROR: iscMosaic failed to run correctly. Please re-run iscMosaic manually."
log_msg 100
rm -f ${LOCK_DIR}/importBkSiteGrids
exit 1
fi
log_msg "Finished running iscMosaic..."
# Generate a GFE message saying new Grids have arrived in Restore database.
cd ${GFESUITE_BIN}
./sendGfeMessage -h ${SVCBU_HOST} -p ${CDSPORT} -u -m "Restore database has been populated with new grids."
else
log_msg "Unable to locate the gridded data of the site,${import_file} You will need to request your backup site to send grids again."
log_msg 100
rm -f ${LOCK_DIR}/importBkSiteGrids
exit 1
fi
#clean-up.
rm -f ${GFESUITE_HOME}/Grd
rm -f ${GFESUITE_HOME}/${SITE}Grd* siteID.txt
log_msg 100
rm -f ${LOCK_DIR}/importBkSiteGrids
#ALL well, send a msg and get out of here
log_msg "Importing Grids from backup site is completed. You may start your GFE now."
log_msg "Grids received from backup site are stored in ${SITE}_GRID__Restore_00000000_0000 database."
exit 0

View file

@ -1 +1 @@
1a32b06c313e625de84f906b3a788e18d5fbf5a4
7d5b051039964b49fc7ac2336857ce70d216028f

View file

@ -1 +1 @@
8fe0a749af6fc67549da23d33fd3d63a094c1466
80c11668bbfe3803e0c4919198ed9da9a1a39b1b

Binary file not shown.

View file

@ -1 +1 @@
1a32b06c313e625de84f906b3a788e18d5fbf5a4
7d5b051039964b49fc7ac2336857ce70d216028f

View file

@ -1 +1 @@
8fe0a749af6fc67549da23d33fd3d63a094c1466
80c11668bbfe3803e0c4919198ed9da9a1a39b1b

View file

@ -0,0 +1,25 @@
Copyright (c) 2009, Swiss AviationSoftware Ltd. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
- Neither the name of the Swiss AviationSoftware Ltd. nor the names of its
contributors may be used to endorse or promote products derived from this
software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

6
pythonPackages/numpy/numpy/core/numeric.py Executable file → Normal file
View file

@ -1493,8 +1493,10 @@ def set_string_function(f, repr=True):
else:
return multiarray.set_string_function(f, repr)
set_string_function(array_str, 0)
set_string_function(array_repr, 1)
# randerso DR #2513 remove calls to non-threadsafe set_string_function
# https://github.com/numpy/numpy/issues/3961
# set_string_function(array_str, 0)
# set_string_function(array_repr, 1)
little_endian = (sys.byteorder == 'little')

View file

@ -402,6 +402,7 @@ if [ "${1}" = "-viz" ]; then
#buildRPM "awips2-python-dynamicserialize"
buildRPM "awips2-gfesuite-client"
buildRPM "awips2-gfesuite-server"
buildRPM "awips2-python-numpy"
#buildRPM "awips2-python"
#buildRPM "awips2-adapt-native"
#unpackHttpdPypies

View file

@ -9,7 +9,7 @@
Name: awips2-python-numpy
Summary: AWIPS II Python numpy Distribution
Version: 1.5.0
Release: 3.el6
Release: 3.el6.p1
Group: AWIPSII
BuildRoot: %{_build_root}
BuildArch: %{_build_arch}