Timestamp is now part of , default ascent rate 5m/s

pull/73/head
jonsowman 2010-05-30 12:29:29 +01:00
rodzic 31f2ce3c3d
commit 4e2f1a2866
3 zmienionych plików z 17 dodań i 14 usunięć

Wyświetl plik

@ -33,9 +33,12 @@ case "submitForm":
if ( isset($_POST['submit'])) {
// form was submitted, let's run a pred!
// first, make a model from the form data
$pred_model = createModel($_POST);
if ( !$pred_model = createModel($_POST)) {
echo false;
break;
}
// verify the model here
// verify the model
if ( !verifyModel($pred_model, $software_available) ) {
echo false;
break;
@ -44,18 +47,9 @@ case "submitForm":
// make a sha1 hash of the model for uuid
$pred_model['uuid'] = makesha1hash($pred_model);
// make a timestamp of the form data
$pred_model['timestamp'] = mktime($_pred_model['hour'], $_pred_model['min'], $_pred_model['sec'], (int)$_pred_model['month'] + 1, $_pred_model['day'], (int)$_pred_model['year'] - 2000);
// and check that it's within range
if ($pred_model['timestamp'] > (time() + 180*3600)) {
echo false;
break;
}
// now we have a populated model, run the predictor
runPred($pred_model);
echo true . "|" . $pred_model['uuid'];
echo true . "|" . $pred_model['uuid'] . "|" . $pred_model['timestamp'];
} else {
echo "The form submit function was called without any data";
echo false;

Wyświetl plik

@ -9,7 +9,7 @@ function createModel($post_array) {
$pred_model = array();
// first, populate the prediction model
$pred_model['hour'] = $post_array['hour'];
$pred_model['hour'] = $post_array['hour'] + 1; //adjust for GMT
$pred_model['min'] = $post_array['min'];
$pred_model['sec'] = $post_array['sec'];
@ -29,6 +29,15 @@ function createModel($post_array) {
$pred_model['software'] = $post_array['software'];
// make a timestamp of the form data
$pred_model['timestamp'] = mktime($pred_model['hour'], $pred_model['min'], $pred_model['sec'], (int)$pred_model['month'], $pred_model['day'], (int)$pred_model['year'] - 2000);
// and check that it's within range
if ($pred_model['timestamp'] > (time() + 180*3600)) {
return false;
break;
}
return $pred_model;
}

Wyświetl plik

@ -271,7 +271,7 @@ function parseCSV(lines) {
</td>
<tr>
<td>Ascent Rate (m/s):</td>
<td><input id="ascent" type="text" name="ascent" value="3"></td>
<td><input id="ascent" type="text" name="ascent" value="5"></td>
</tr>
<tr>
<td>Descent Rate (sea level m/s):</td>