Sending python time and position data closes #18
rodzic
ef7d34df63
commit
42f9f61d80
|
@ -72,9 +72,12 @@ function runPred($pred_model) {
|
||||||
// if we're using --hd, then append it to the exec string
|
// if we're using --hd, then append it to the exec string
|
||||||
if ( $pred_model['software'] == "gfs_hd" ) $use_hd ="--hd ";
|
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
|
// use `at` to automatically background the task
|
||||||
$ph = popen("at now", "w");
|
$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);
|
fclose($ph);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,8 +90,14 @@ function processProgress(progress) {
|
||||||
if ( progress['pred_complete'] == true ) { // pred has finished
|
if ( progress['pred_complete'] == true ) { // pred has finished
|
||||||
$("#prediction_status").html("Prediction finished.");
|
$("#prediction_status").html("Prediction finished.");
|
||||||
$("#status_message").fadeOut(500);
|
$("#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.");
|
appendDebug("The predictor finished running.");
|
||||||
clearInterval(ajaxEventHandle); // clear calling this function
|
// stop polling for JSON
|
||||||
|
clearInterval(ajaxEventHandle);
|
||||||
|
// parse the data
|
||||||
getCSV(running_uuid);
|
getCSV(running_uuid);
|
||||||
} else if ( progress['pred_running'] != true ) {
|
} else if ( progress['pred_running'] != true ) {
|
||||||
$("#prediction_status").html("Waiting for predictor to run...");
|
$("#prediction_status").html("Waiting for predictor to run...");
|
||||||
|
|
Ładowanie…
Reference in New Issue