Beginning work on integrating the burst calculator, including styling and activation link

pull/73/head
jonsowman 2011-01-12 15:19:56 +00:00
rodzic 4f6745cc65
commit 4a71dba38e
3 zmienionych plików z 165 dodań i 2 usunięć

Wyświetl plik

@ -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;

Wyświetl plik

@ -26,6 +26,7 @@ $time = time() + 3600;
</script>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<link href="css/pred.css" type="text/css" rel="stylesheet" />
<link href="css/calc.css" type="text/css" rel="stylesheet" />
<link rel="stylesheet" href="css/tipsy.css" type="text/css" />
<link href="css/cupertino/jquery-ui-1.8.1.custom.css" type="text/css" rel="stylesheet">
<script type="text/javascript">
@ -39,6 +40,7 @@ google.load("jqueryui", "1.8.1");
<script src="js/date.jsport.js" type="text/javascript"></script>
<script src="js/config.js" type="text/javascript"></script>
<script src="js/pred.js" type="text/javascript"></script>
<script src="js/calc.js" type="text/javascript"></script>
</head>
<body>
@ -220,7 +222,10 @@ google.load("jqueryui", "1.8.1");
?>" maxlength="4" size="4">
</td>
<tr>
<td>Ascent Rate (m/s):</td>
<td>
Ascent Rate (m/s): <a id="burst-calc-show" class="tipsyLink"
title="Use the burst calculator to find this value">?</a>
</td>
<td><input id="ascent" type="text" name="ascent" value="5"></td>
</tr>
<tr>
@ -258,6 +263,137 @@ google.load("jqueryui", "1.8.1");
</tr>
</table>
</form>
<!-- Burst calculator div, hidden onLoad -->
<div id="burst-calc">
<b>Burst Calculator</b>
<br>
<table id="input_table">
<tr class="input_row">
<td class="input_label" colspan="2">Payload Mass (g)</td>
<td class="input_instruction" rowspan="3">AND</td>
<td class="input_label" colspan="2">Balloon Mass (g)</td>
</tr>
<tr class="input_row">
<td colspan="2">
<input type="text" id="mp" class="input_field" value="1500"
tabindex="1"/>
</td>
<td colspan="2">
<select class="input_field" id="mb" tabindex="2">
<option value="200">200</option>
<option value="300">300</option>
<option value="350">350</option>
<option value="450">450</option>
<option value="500">500</option>
<option value="600">600</option>
<option value="700">700</option>
<option value="800">800</option>
<option value="1000" selected="selected">1000</option>
<option value="1200">1200</option>
<option value="1500">1500</option>
<option value="2000">2000</option>
<option value="3000">3000</option>
</select>
</td>
</tr>
<tr class="warning_row">
<td colspan="2" id="mp_w">&nbsp;</td>
<td colspan="2" id="mb_w">&nbsp;</td>
</tr>
<tr>
<td class="input_instruction" colspan="5">THEN</td>
</tr>
<tr class="input_row">
<td class="input_label" colspan="2">Target Burst Altitude (m)</td>
<td class="input_instruction" rowspan="3">OR</td>
<td class="input_label" colspan="2">Target Ascent Rate (m/s)</td>
</tr>
<tr class="input_row">
<td colspan="2">
<input type="text" id="tba" class="input_field" value="33000" tabindex="3"/>
</td>
<td colspan="2">
<input type="text" id="tar" class="input_field" tabindex="4"/>
</td>
</tr>
<tr class="warning_row">
<td id="tba_w" colspan="2">&nbsp;</td>
<td id="tar_w" colspan="2">&nbsp;</td>
</tr>
<tr class="output_row">
<td class="output_label">Burst Altitude:</td>
<td class="output_data"><span id="ba">33000</span> m</td>
<td></td>
<td class="output_label">Ascent Rate:</td>
<td class="output_data"><span id="ar">2.33</span> m/s</td>
</tr>
<tr class="output_row">
<td class="output_label">Time to Burst:</td>
<td class="output_data"><span id="ttb">238</span> min</td>
<td></td>
<td class="output_label">Neck Lift:</td>
<td class="output_data"><span id="nl">1733</span> g</td>
</tr>
<tr class="output_row">
<td class="output_label">Launch Volume:</td>
<td class="output_data"><span id="lv_m3">2.66</span>
m<sup>3</sup></td>
<td></td>
<td class="output_data"><span id="lv_l">2660</span> L</td>
<td class="output_data"><span id="lv_cf">93.9</span>
ft<sup>3</sup></td>
</tr>
</table>
<br>
<input type="button" id="burst-calc-hide" name="burst-calc-submit"
value="Done"/ >
</div>
<!-- these are the burst calc constants -->
<div id="burst-calc-constants">
<div class="constants_header">Constants</div><br />
<div class="constants_warning">
For advanced<br />use only!<br /><br />
You can probably<br />leave these alone.<br />
</div><br />
<label class="constant_label" for="gas">Gas</label><br />
<select id="gas" class="constant_field">
<option value="he">Helium</option>
<option value="h">Hydrogen</option>
<option value="ch4">Methane</option>
<option value="custom">Custom</option>
</select><br />
<label class="constant_label" for="rho_g">Gas Density (kg/m<sup>3</sup>)</label><br />
<input type="text" id="rho_g" value="0.1786" class="constant_field" size="9" disabled="disabled"/><br />
<label class="constant_label" for="rho_a">Air Density (kg/m<sup>3</sup>)</label><br />
<input type="text" id="rho_a" value="1.2050" class="constant_field" size="9"/><br />
<label class="constant_label" for="adm">Air Density Model</label><br />
<input type="text" id="adm" value="7238.3" class="constant_field" size="9"/><br />
<label class="constant_label" for="ga">Gravitational<br />Acceleration (m/s<sup>2</sup>)</label><br />
<input type="text" id="ga" value="9.80665" class="constant_field" size="9" /><br />
<label class="constant_label" for="bd">Burst Diameter (m)</label><br />
<input type="checkbox" id="bd_c" />
<input type="text" id="bd" class="constant_field" size="9" disabled="disabled" value="7.86"/><br />
<label class="constant_label" for="cd">Balloon Cd</label><br />
<input type="checkbox" id="cd_c" />
<input type="text" id="cd" class="constant_field" size="9" disabled="disabled" value="0.3"/><br />
</div>
</div>
</body>

Wyświetl plik

@ -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();