From d99da9a417436efa43cee4d3cbc5821ff322a1f0 Mon Sep 17 00:00:00 2001 From: jonsowman Date: Thu, 27 May 2010 23:16:40 +0100 Subject: [PATCH] GRIB predictor running properly with mutex closes #4 --- index.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/index.php b/index.php index b4a024f..7f6d4d6 100644 --- a/index.php +++ b/index.php @@ -96,13 +96,12 @@ function makeINI($pred_model) { // makes an ini file function runGRIB($pred_model) { // runs the grib predictor $lockfile = fopen("lock", "w"); $shellcmd = "./one_off_prediction " . $pred_model['lat'] . " " . $pred_model['lon'] . " " . $pred_model['alt'] ." " . (float)$pred_model['asc'] . " " . $pred_model['des']*1.1045 . " " . $pred_model['burst'] . " " . $pred_model['timestamp'] . " " . $pred_model['float'] . " &"; - echo $shellcmd; - //shell_exec($shellcmd); + shell_exec($shellcmd); if (!file_exists("flight_path.csv")) { unlink("lock"); die("The predictor didn't write a file"); } - shell_exec("mv flight_path.csv preds/".$pred_model['uuid']."/"); + shell_exec("mv flight_path.* preds/".$pred_model['uuid']."/"); unlink("lock"); } @@ -155,9 +154,15 @@ function SetSiteOther() { optOther.selected = true; } +function predSub() { + appendDebug("Sending data to server for uuid: " + document.form1.uuid.value); + appendDebug("Downloading GRIB data for tile, this could take some time..."); +} + function handlePred() { - appendDebug("Form was submitted"); appendDebug("Prediction running with uuid: " + running_uuid); + appendDebug("Prediction done for uuid: " + running_uuid); + // now go get the prediction data from the server } function appendDebug(appendage) { @@ -278,7 +283,7 @@ function parseCSV(csv_name) {
-
+ @@ -354,7 +359,7 @@ function parseCSV(csv_name) { - +
Launch Site: