From 2435bb74d47c98d80a584311efe122fc724326eb Mon Sep 17 00:00:00 2001 From: Daniel Richman Date: Tue, 25 Dec 2012 12:34:26 +0000 Subject: [PATCH] Add time delta selection --- predict/css/pred.css | 2 +- predict/includes/functions.inc.php | 10 +++++++++- predict/index.php | 9 +++++++++ predict/js/pred/pred.js | 1 + 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/predict/css/pred.css b/predict/css/pred.css index be839fb..6854b79 100644 --- a/predict/css/pred.css +++ b/predict/css/pred.css @@ -178,7 +178,7 @@ a { text-decoration: underline; color: #333; cursor: pointer; } width: 400px; padding: 5px 5px 0px 5px; bottom: 0; right: 0; - max-height: 400px; + max-height: 500px; } #launch-card { diff --git a/predict/includes/functions.inc.php b/predict/includes/functions.inc.php index 9a7b409..09bb205 100644 --- a/predict/includes/functions.inc.php +++ b/predict/includes/functions.inc.php @@ -33,6 +33,7 @@ function createModel($post_array) { $pred_model['delta_lat'] = (int)$post_array['delta_lat']; $pred_model['delta_lon'] = (int)$post_array['delta_lon']; + $pred_model['delta_time'] = (int)$post_array['delta_time']; $pred_model['wind_error'] = 0; @@ -89,6 +90,12 @@ function verifyModel( $pred_model, $software_available ) { $return_array['msg'] = "The latitude or longitude deltas were outside the allowed range on this server"; } + } else if ( $idx == "delta_time" ) { + if ( $value < 5 || $value > 24) { + $return_array['valid'] = false; + $return_array['msg'] = "The time delta was + outside the allowed range on this server"; + } } else if ( $idx == "asc" || $idx == "des" ) { if ( $value <= 0 ) { $return_array['valid'] = false; @@ -138,7 +145,7 @@ function runPred($pred_model) { $log = PREDS_PATH . $pred_model['uuid'] . "/" . LOG_FILE; $sh = ROOT . "/predict.py --cd=" . ROOT . " --fork --alarm --redirect=predict/$log -v --latdelta=" .$pred_model['delta_lat']." --londelta=".$pred_model['delta_lon'] - ." -p1 -f5 -t ".$pred_model['timestamp'] + ." -p1 -f".$pred_model['delta_time']." -t ".$pred_model['timestamp'] ." --lat=".$predictor_lat." --lon=".$predictor_lon." " . $use_hd . $pred_model['uuid']; if (defined("PYTHON")) @@ -178,6 +185,7 @@ function makeINI($pred_model) { // makes an ini file $w_string .= $pred_model['min'] . "\n"; // add our predictor stuff $w_string .= "[predictor]\nlat-delta = " . $pred_model['delta_lat'] . "\n"; + $w_string .= "time-delta = " . $pred_model['delta_time'] . "\n"; $w_string .= "lon-delta = " . $pred_model['delta_lon'] . "\nsoftware = "; $w_string .= $pred_model['software'] . "\n"; diff --git a/predict/index.php b/predict/index.php index 117bce7..66b0cf9 100644 --- a/predict/index.php +++ b/predict/index.php @@ -471,6 +471,15 @@ google.load("jqueryui", "1.8.1"); + Time Delta: + + + + Display UK NOTAMS & Airspace: diff --git a/predict/js/pred/pred.js b/predict/js/pred/pred.js index 4b26118..d026dbc 100644 --- a/predict/js/pred/pred.js +++ b/predict/js/pred/pred.js @@ -110,6 +110,7 @@ function populateFormByUUID(pred_uuid) { $("#software").val(data.software); $("#delta_lat").val(data['lat-delta']); $("#delta_lon").val(data['lon-delta']); + $("#delta_time").val(data['time-delta']); // now sort the map out SetSiteOther(); plotClick();