Merge "ASM #511 changes to transmit_rfc_bias calls from MPE" into asm_14.3.1

Former-commit-id: 78bb549533 [formerly a129795302a562e68638bb5e5764f54a8dcc331e]
Former-commit-id: d37490acb1
This commit is contained in:
Juliya Dynina 2014-04-30 07:41:27 -05:00 committed by Gerrit Code Review
commit 00bbbf32c1
4 changed files with 46 additions and 10 deletions

View file

@ -22,6 +22,7 @@ package com.raytheon.viz.mpe.ui.actions;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import java.util.Iterator;
@ -58,6 +59,8 @@ import com.raytheon.viz.mpe.ui.MPEDisplayManager;
* Dec 11, 2012 mschenke Initial creation
* Feb 2, 2014 16201 snaples Added saved data flag support
*
* Apr29, 2014 16308 lbousaidi transmit RFC Bias when an hour
* MPE is saved via the GUI.
* </pre>
*
* @author mschenke
@ -256,13 +259,21 @@ public class SaveBestEstimate {
boolean transmit_bias_on_save = appsDefaults.getBoolean(
"transmit_bias_on_save", true);
if (transmit_rfc_bias && transmit_bias_on_save) {
// sprintf ( command_string, "%s/transmit_rfc_bias %s",
// precip_proc_bin_dir, cdate );
// UFStatus.handle(Priority.VERBOSE, Activator.PLUGIN_ID,
// StatusConstants.CATEGORY_MPE, null,
// String.format("Invoking transmit_rfc_bias script using command:\n"
// "%s\n", command_string ));
// system ( command_string );
Date currentDate = MPEDisplayManager.getCurrent().getCurrentEditDate();
SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHH");
String transmitDate = formatter.format(currentDate);
String scriptDir = appsDefaults.getToken("pproc_bin");
String scriptName = "transmit_rfc_bias";
ProcessBuilder pb = new ProcessBuilder(scriptDir + "/" + scriptName,
transmitDate);
try {
pb.start();
} catch (IOException e) {
e.printStackTrace();
}
}
MPEDisplayManager.getCurrent().setSavedData(true);
}

View file

@ -19,6 +19,7 @@
**/
package com.raytheon.viz.mpe.core;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
@ -38,6 +39,7 @@ import com.raytheon.uf.common.dataplugin.shef.tables.Hourlypp;
import com.raytheon.uf.common.dataplugin.shef.tables.Pseudogageval;
import com.raytheon.uf.common.dataplugin.shef.tables.Rawpp;
import com.raytheon.uf.common.dataplugin.shef.util.ShefConstants;
import com.raytheon.uf.common.ohd.AppsDefaults;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.viz.hydrocommon.whfslib.GagePPOptions;
import com.raytheon.viz.hydrocommon.whfslib.GagePPOptions.shef_dup;
@ -56,6 +58,8 @@ import com.raytheon.viz.mpe.core.MPEDataManager.MPEGageData;
* Jan 02, 2013 15565 snaples Fixed problem with wrong time being sent to mpe_fieldgen
* Mar 14, 2013 1457 mpduff Fixed memory leak.
* Jun 18, 2013 16053 snaples Removed check for Radar Edit flag
* Apr 24, 2014 16308 lbousaidi added the ability to send RFC Bias across the WAN
* after Mpe fieldgen run.
* </pre>
*
* @author snaples
@ -293,6 +297,22 @@ public class RegenHrFlds {
e.printStackTrace();
}
/*-------------------------------------------------------------------------*/
/* send RFC Bias across the WAN if the tokens TRANSMIT_BIAS_ON_RERUN
* and MPE_TRANSMIT_BIAS are both ON. The script rerun_mpe_fieldgen
* only run transmit_rfc_bias but it doesn't rerun mpe_fieldgen
/*-------------------------------------------------------------------------*/
AppsDefaults appsDefaults = AppsDefaults.getInstance();
String scriptDir = appsDefaults.getToken("pproc_bin");
String scriptName ="rerun_mpe_fieldgen";
String transmitRun= dr.format(datetime);
ProcessBuilder pb = new ProcessBuilder(scriptDir + "/" + scriptName ,hour,
transmitRun);
try {
pb.start();
} catch (IOException e) {
e.printStackTrace();
}
MPEDataManager.getInstance().clearEditGages();
shell.setCursor(null);
}

View file

@ -12,8 +12,11 @@
# This allows you to call this script from outside of ./standard/bin
RUN_FROM_DIR=`dirname $0`
. $RUN_FROM_DIR/../../set_hydro_env
export MPE_TRANSMIT_BIAS=$(get_apps_defaults mpe_transmit_bias)
export TRANSMIT_BIAS_ON_RERUN=$(get_apps_defaults transmit_bias_on_rerun)
export PPROC_BIN=$(get_apps_defaults pproc_bin)
#
# Transmit the RFC bias message if the user has
# elected to do so on reruns.
#
@ -21,6 +24,8 @@ if [[ "$MPE_TRANSMIT_BIAS" = "ON" && "$TRANSMIT_BIAS_ON_RERUN" = "YES" ]]
then
year=`echo $2 | cut -c5-8`
monthday=`echo $2 | cut -c1-4`
hour=`echo $1`
echo $year$monthday$1
$PPROC_BIN/transmit_rfc_bias $year$monthday$1
fi

View file

@ -43,13 +43,13 @@ RUN_FROM_DIR=`dirname $0`
# These lines are commented out because this script will be run
# from mpe_editor using mpe_editor's environment. If this script
# is run stand alone, these lines must be uncommented.
export FXA_HOME=/awips/fxa
. $FXA_HOME/readenv.sh
. $RUN_FROM_DIR/../../set_hydro_env
export RFC_BIAS_OUTPUT_DIR=$(get_apps_defaults rfc_bias_output_dir)
export PROCESS_BIAS_LOG_DIR=$(get_apps_defaults process_bias_log_dir)
export MPE_TRANSMIT_BIAS=$(get_apps_defaults mpe_transmit_bias)
export PPROC_BIN=$(get_apps_defaults pproc_bin)
export FXA_LOCAL_SITE=$(get_apps_defaults fxa_local_site)
export SYS_JAVA_DIR=$(get_apps_defaults sys_java_dir)
# set java classpath
export CLASSPATH=$DB_DRIVER_PATH:$PPROC_BIN/bias_trans.jar