diff --git a/predict/css/pred.css b/predict/css/pred.css index 7891b21..fdd4c9e 100644 --- a/predict/css/pred.css +++ b/predict/css/pred.css @@ -76,7 +76,7 @@ a { text-decoration: underline; color: #333; cursor: pointer; } #input_form { border-right: none; border-bottom: none; - height:350px; + height:370px; width: 400px; padding: 5px; bottom: 0; right: 0; diff --git a/predict/includes/functions.inc.php b/predict/includes/functions.inc.php index 69ad273..b179897 100644 --- a/predict/includes/functions.inc.php +++ b/predict/includes/functions.inc.php @@ -25,6 +25,9 @@ function createModel($post_array) { $pred_model['burst'] = $post_array['burst']; $pred_model['float'] = $post_array['float_time']; + $pred_model['delta_lat'] = $post_array['delta_lat']; + $pred_model['delta_lon'] = $post_array['delta_lon']; + $pred_model['wind_error'] = 0; $pred_model['software'] = $post_array['software']; @@ -55,10 +58,10 @@ function verifyModel($pred_model, $software_available) { foreach($pred_model as $idx => $value) { if ($idx == "software") { if (!in_array($value, $software_available)) return false; - } else { - if (!is_numeric($value)) { - return false; - } + } else if ($idx == "delta_lat" || $idx == "delta_lon") { + if ( $value < 1 || $value > 10 ) return false; + } else if (!is_numeric($value)) { + return false; } } return true; @@ -77,7 +80,11 @@ function runPred($pred_model) { // use `at` to automatically background the task $ph = popen("at now", "w"); - fwrite($ph, "cd /var/www/hab/predict/ && ./predict.py -v --latdelta=3 --londelta=3 -p1 -f5 -t ".$pred_model['timestamp']." --lat=".$predictor_lat." --lon=".$predictor_lon." " . $use_hd . $pred_model['uuid']); + fwrite($ph, "cd /var/www/hab/predict/ && ./predict.py -v --latdelta=" + .$pred_model['delta_lat']." --londelta=".$pred_model['delta_lon'] + ." -p1 -f5 -t ".$pred_model['timestamp'] + ." --lat=".$predictor_lat." --lon=".$predictor_lon." " . $use_hd + . $pred_model['uuid']); fclose($ph); } diff --git a/predict/index.php b/predict/index.php index 4c45b14..034055c 100644 --- a/predict/index.php +++ b/predict/index.php @@ -103,6 +103,7 @@ function initialize() {
@@ -175,11 +176,25 @@ function initialize() {