Sending python time and position data closes #18

pull/73/head
jonsowman 2010-05-30 21:53:16 +01:00
rodzic ef7d34df63
commit 42f9f61d80
2 zmienionych plików z 11 dodań i 2 usunięć

Wyświetl plik

@ -72,9 +72,12 @@ function runPred($pred_model) {
// if we're using --hd, then append it to the exec string
if ( $pred_model['software'] == "gfs_hd" ) $use_hd ="--hd ";
$predictor_lat = number_format($pred_model['lat'], 0);
$predictor_lon = number_format($pred_model['lon'], 0);
// 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 --lat=52 --lon=0 " . $use_hd . $pred_model['uuid']);
fwrite($ph, "cd /var/www/hab/predict/ && ./predict.py -v --latdelta=3 --londelta=3 -t ".$pred_model['timestamp']." --lat=".$predictor_lat." --lon=".$predictor_lon." " . $use_hd . $pred_model['uuid']);
fclose($ph);
}

Wyświetl plik

@ -90,8 +90,14 @@ function processProgress(progress) {
if ( progress['pred_complete'] == true ) { // pred has finished
$("#prediction_status").html("Prediction finished.");
$("#status_message").fadeOut(500);
// now clear the status window
$("#prediction_status").html("");
$("#prediction_progress").progressbar("options", "value", 0);
$("#prediction_percent").html("");
appendDebug("The predictor finished running.");
clearInterval(ajaxEventHandle); // clear calling this function
// stop polling for JSON
clearInterval(ajaxEventHandle);
// parse the data
getCSV(running_uuid);
} else if ( progress['pred_running'] != true ) {
$("#prediction_status").html("Waiting for predictor to run...");