Map canvas is faded during prediction running, and input form is hidden closes #26
rodzic
42f9f61d80
commit
11758a436a
|
@ -77,7 +77,7 @@ function runPred($pred_model) {
|
||||||
|
|
||||||
// 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 -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=3 --londelta=3 -p1 -f5 -t ".$pred_model['timestamp']." --lat=".$predictor_lat." --lon=".$predictor_lon." " . $use_hd . $pred_model['uuid']);
|
||||||
fclose($ph);
|
fclose($ph);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,8 +50,9 @@ function handlePred(pred_uuid) {
|
||||||
$("#prediction_status").html("Downloading wind data...");
|
$("#prediction_status").html("Downloading wind data...");
|
||||||
appendDebug("Prediction running with uuid: " + pred_uuid);
|
appendDebug("Prediction running with uuid: " + pred_uuid);
|
||||||
appendDebug("Attempting to download GFS data for prediction");
|
appendDebug("Attempting to download GFS data for prediction");
|
||||||
|
$("#input_form").hide("slide", { direction: "down" }, 500);
|
||||||
|
$("#map_canvas").fadeTo(1000, 0.2);
|
||||||
// ajax to poll for progress
|
// ajax to poll for progress
|
||||||
|
|
||||||
ajaxEventHandle = setInterval("getJSONProgress('"+pred_uuid+"')", 2000);
|
ajaxEventHandle = setInterval("getJSONProgress('"+pred_uuid+"')", 2000);
|
||||||
appendDebug("Getting flight path from server....");
|
appendDebug("Getting flight path from server....");
|
||||||
//getCSV(pred_uuid);
|
//getCSV(pred_uuid);
|
||||||
|
@ -94,6 +95,10 @@ function processProgress(progress) {
|
||||||
$("#prediction_status").html("");
|
$("#prediction_status").html("");
|
||||||
$("#prediction_progress").progressbar("options", "value", 0);
|
$("#prediction_progress").progressbar("options", "value", 0);
|
||||||
$("#prediction_percent").html("");
|
$("#prediction_percent").html("");
|
||||||
|
// bring the input form back up
|
||||||
|
$("#input_form").show("slide", { direction: "down" }, 500);
|
||||||
|
// un-fade the map canvas
|
||||||
|
$("#map_canvas").fadeTo(1500, 1);
|
||||||
appendDebug("The predictor finished running.");
|
appendDebug("The predictor finished running.");
|
||||||
// stop polling for JSON
|
// stop polling for JSON
|
||||||
clearInterval(ajaxEventHandle);
|
clearInterval(ajaxEventHandle);
|
||||||
|
@ -147,6 +152,7 @@ function initialize() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
//$("#input_form").draggable({containment: '#map_canvas'});
|
||||||
// if ( running_uuid != 0 ) handlePred(running_uuid);
|
// if ( running_uuid != 0 ) handlePred(running_uuid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -252,7 +258,7 @@ function clearMapItems() {
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body onload="initialize()">
|
<body onload="initialize()" bgcolor="#000000">
|
||||||
|
|
||||||
<div id="map_canvas" style="width:100%; height:100%"></div>
|
<div id="map_canvas" style="width:100%; height:100%"></div>
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue