diff --git a/ajax.php b/ajax.php new file mode 100644 index 0000000..5a2bfdf --- /dev/null +++ b/ajax.php @@ -0,0 +1,20 @@ + diff --git a/index.php b/index.php index 7f6d4d6..64f6d9a 100644 --- a/index.php +++ b/index.php @@ -159,10 +159,18 @@ function predSub() { appendDebug("Downloading GRIB data for tile, this could take some time..."); } -function handlePred() { +function handlePred(pred_uuid) { appendDebug("Prediction running with uuid: " + running_uuid); appendDebug("Prediction done for uuid: " + running_uuid); // now go get the prediction data from the server + getCSV(pred_uuid); +} + +function getCSV(pred_uuid) { + $.get("ajax.php", { "action":"getCSV", "uuid":pred_uuid }, function(data) { + //alert(data.length); + parseCSV(data); + }, 'json'); } function appendDebug(appendage) { @@ -187,13 +195,12 @@ function initialize() { mapTypeId: google.maps.MapTypeId.ROADMAP }; map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); - parseCSV("new.csv"); // debug remove - if ( form_submitted ) handlePred(); + //parseCSV("new.csv"); // debug remove + if ( form_submitted ) handlePred(running_uuid); } -function parseCSV(csv_name) { - $.get(csv_name, null, function(data, textStatus) { - var lines = data.split('\n'); +function parseCSV(lines) { + alert(lines[0]); var path = []; var max_height = -10; //just any -ve number var max_point = null; @@ -259,7 +266,7 @@ function parseCSV(csv_name) { strokeColor: '#000000', strokeWeight: 3, strokeOpacity: 0.75 - }); + }); path_polyline.setMap(map); @@ -270,7 +277,6 @@ function parseCSV(csv_name) { title: 'Balloon burst (max. altitude: ' + max_height + 'm)', }); - }); } diff --git a/valid_model_run b/valid_model_run index 7b4f405..fdd471e 100644 --- a/valid_model_run +++ b/valid_model_run @@ -1,2 +1,2 @@ -2010052712 -1274961600 \ No newline at end of file +2010052718 +1274983200 \ No newline at end of file