From 4a71dba38e00d6704c9fe570915721862b005b6d Mon Sep 17 00:00:00 2001 From: jonsowman Date: Wed, 12 Jan 2011 15:19:56 +0000 Subject: [PATCH] Beginning work on integrating the burst calculator, including styling and activation link --- predict/css/pred.css | 10 ++++ predict/index.php | 138 ++++++++++++++++++++++++++++++++++++++++++- predict/js/pred.js | 19 +++++- 3 files changed, 165 insertions(+), 2 deletions(-) diff --git a/predict/css/pred.css b/predict/css/pred.css index b2fc26b..b66b566 100644 --- a/predict/css/pred.css +++ b/predict/css/pred.css @@ -78,6 +78,10 @@ a { text-decoration: underline; color: #333; cursor: pointer; } display: none; } +#burst-calc-constants { + display: none; +} + .box { position: absolute; background-color: white; @@ -141,6 +145,12 @@ a { text-decoration: underline; color: #333; cursor: pointer; } bottom: 0; right: 0; } +#burst-calc { + display: none; + padding: 5px; + text-align: center; +} + #scenario_info { position: absolute; top: 25px; diff --git a/predict/index.php b/predict/index.php index 72a354e..282f62d 100644 --- a/predict/index.php +++ b/predict/index.php @@ -26,6 +26,7 @@ $time = time() + 3600; + + @@ -220,7 +222,10 @@ google.load("jqueryui", "1.8.1"); ?>" maxlength="4" size="4"> - Ascent Rate (m/s): + + Ascent Rate (m/s): ? + @@ -258,6 +263,137 @@ google.load("jqueryui", "1.8.1"); + + +
+ Burst Calculator +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Payload Mass (g)ANDBalloon Mass (g)
+ + + +
  
THEN
Target Burst Altitude (m)ORTarget Ascent Rate (m/s)
+ + + + +
  
Burst Altitude:33000 mAscent Rate:2.33 m/s
Time to Burst:238 minNeck Lift:1733 g
Launch Volume:2.66 + m32660 L93.9 + ft3
+
+ +
+ + +
+
Constants

+
+ For advanced
use only!

+ + You can probably
leave these alone.
+

+
+
+
+
+
+ +
+
+
+
+
+
+ + +
+
+ +
+
+ + diff --git a/predict/js/pred.js b/predict/js/pred.js index 4f50181..aabde48 100644 --- a/predict/js/pred.js +++ b/predict/js/pred.js @@ -24,13 +24,15 @@ $(document).ready(function() { initMap(52, 0, 8); populateLaunchSite(); setupEventHandlers(); - // make launch card draggable + + // Make launch card draggable $("#input_form").draggable({containment: '#map_canvas', handle: 'img.handle', snap: '#map_canvas'}); $("#scenario_info").draggable({containment: '#map_canvas', handle: 'img.handle', snap: '#map_canvas'}); $("#location_save").draggable({containment: '#map_canvas', handle: 'img.handle', snap: '#map_canvas'}); $("#location_save_local").draggable({containment: '#map_canvas', handle: 'img.handle', snap: '#map_canvas'}); $("#run_pred_btn").button(); $("#req_sub_btn").button(); + $("#burst-calc-hide").button(); // see if we want an old prediction displayed if ( current_uuid != '0' ) { @@ -51,6 +53,9 @@ $(document).ready(function() { // plot the initial launch location plotClick(); + + // Initialise the burst calculator + calc_init(); }); function predSub() { @@ -662,6 +667,18 @@ function setupEventHandlers() { $("#setWithClick").click(function() { setLatLonByClick(true); }); + // activate the "use burst calc" links + $("#burst-calc-show").click(function() { + $("#modelForm").hide(); + $("#burst-calc").show(); + }); + $("#burst-calc-hide").click(function() { + // Write the ascent rate and burst altitude to the launch card + $("#ascent").val($("#ar").html()); + $("#burst").val($("#ba").html()); + $("#burst-calc").hide(); + $("#modelForm").show(); + }); // attach onchange handlers to the lat/long boxes $("#lat").change(function() { plotClick();