Accepts old UUIDs in the URL
rodzic
68578133c8
commit
57347ffab5
|
@ -6,7 +6,7 @@ $action = $_GET['action'];
|
|||
switch($action) {
|
||||
case "getCSV":
|
||||
$uuid = $_GET['uuid'];
|
||||
$fh = fopen("preds/".$uuid."/flight_path.csv", "r");
|
||||
$fh = fopen("preds/".$uuid."/flight_path.csv", "r") or die("No CSV for UUID");
|
||||
$data = array();
|
||||
while (!feof($fh)) {
|
||||
$line = trim(fgets($fh));
|
||||
|
|
|
@ -21,7 +21,7 @@ google.load("jqueryui", "1.8.1");
|
|||
<script type="text/javascript">
|
||||
|
||||
var ajaxEventHandle;
|
||||
var running_uuid = '<?php echo ( isset($_GET['uuid'])? $_GET['uuid'] : "0" ); ?>';
|
||||
var current_uuid = '<?php echo ( isset($_GET['uuid'])? $_GET['uuid'] : "0" ); ?>';
|
||||
|
||||
var map;
|
||||
var map_items = [];
|
||||
|
@ -49,18 +49,22 @@ function initialize() {
|
|||
appendDebug("The server rejected the submitted form data");
|
||||
} else {
|
||||
appendDebug("The server accepted the form data");
|
||||
running_uuid = data_split[1];
|
||||
appendDebug("The server gave us uuid:<br>" + running_uuid);
|
||||
// update the global current_uuid variable
|
||||
current_uuid = data_split[1];
|
||||
appendDebug("The server gave us uuid:<br>" + current_uuid);
|
||||
appendDebug("Starting to poll for progress JSON");
|
||||
handlePred(running_uuid);
|
||||
handlePred(current_uuid);
|
||||
}
|
||||
}
|
||||
});
|
||||
//$("#input_form").draggable({containment: '#map_canvas'});
|
||||
// if ( running_uuid != 0 ) handlePred(running_uuid);
|
||||
if ( current_uuid != '0' ) {
|
||||
appendDebug("Got an old UUID to plot:<br>" + current_uuid);
|
||||
appendDebug("Trying to get flight path from server...");
|
||||
getCSV(current_uuid);
|
||||
}
|
||||
$("#debuginfo").hide();
|
||||
$("#showHideDebug").click(function() {
|
||||
// $("#debuginfo").show("slide", { direction: "down" }, 500);
|
||||
toggleDebugWindow();
|
||||
});
|
||||
}
|
||||
|
|
|
@ -77,7 +77,7 @@ function processProgress(progress) {
|
|||
// stop polling for JSON
|
||||
clearInterval(ajaxEventHandle);
|
||||
// parse the data
|
||||
getCSV(running_uuid);
|
||||
getCSV(current_uuid);
|
||||
} else if ( progress['pred_running'] != true ) {
|
||||
$("#prediction_status").html("Waiting for predictor to run...");
|
||||
appendDebug("Server says: predictor not yet running...");
|
||||
|
@ -188,8 +188,8 @@ function parseCSV(lines) {
|
|||
}
|
||||
|
||||
function clearMapItems() {
|
||||
if(map_items.length > 0) {
|
||||
appendDebug("Clearing previous map trace");
|
||||
if(map_items) {
|
||||
for(i in map_items) {
|
||||
map_items[i].setMap(null);
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue