<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
- <title>BeagleBone Black Pin Test</title>
+ <title>MCTX3420 Web Interface</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <!--[if lte IE 8]>
- <script language="javascript" type="text/javascript" src="static/excanvas.min.js"></script>
- <![endif]-->
<script type="text/javascript" src="static/jquery-1.10.1.min.js"></script>
- <script type="text/javascript" src="static/jquery.flot.min.js"></script>
- <script type="text/javascript" src="static/base64.js"></script>
<script type="text/javascript" src="static/mctx.gui.js"></script>
<script type="text/javascript" src="static/mctx.pintest.js"></script>
<link rel="stylesheet" type="text/css" href="static/style.css">
<link rel="stylesheet" type="text/css" href="static/nav-menu.css">
<script type="text/javascript">
- $(document).ready(function () {
- $("#errorlog").setErrorLog();
- $("#gpio-menu").populateDropdown(mctx.pintest.gpios, "GPIO ");
- $("#pwm-menu").populateDropdown(mctx.pintest.pwms, "PWM ");
-
- $("#gpio-go").click(function () {
- if ($("#gpio-menu").val()) {
- $("#gpio-container").exportGPIO($("#gpio-menu"));
- }
- });
- $("#pwm-go").click(function () {
- if ($("#pwm-menu").val()) {
- $("#pwm-container").exportPWM($("#pwm-menu"));
- }
+ runBeforeLoad().done(function () {
+ //Ensure stuff is unloaded before leaving the page
+ $(window).unload(function(){
+ $("#adc-controls").find("input[type='checkbox']")
+ .each(function () {
+ if ($(this).is(":checked")) {
+ $(this).trigger("click");
+ }
+ });
+ $("#gpio-container").find("input[name='unexport']")
+ .each(function () {
+ $(this).trigger("click");
+ });
+ $("#pwm-container").find("input[name='unexport']")
+ .each(function () {
+ $(this).trigger("click");
+ });
});
- $("#adc-controls").trigger("reset").setADCControl();
- });
+
+ $(document).ready(function () {
+ $("#gpio-menu").populateDropdown(mctx.pintest.gpios, "GPIO ");
+ $("#pwm-menu").populateDropdown(mctx.pintest.pwms, "PWM ");
+
+ $("#gpio-go").click(function () {
+ if ($("#gpio-menu").val()) {
+ $(this).attr("disabled", true);
+ $("#gpio-container").exportGPIO($("#gpio-menu")).always(function () {
+ $("#gpio-go").attr("disabled", false);
+ });
+ }
+ });
+ $("#pwm-go").click(function () {
+ if ($("#pwm-menu").val()) {
+ $(this).attr("disabled", true);
+ $("#pwm-container").exportPWM($("#pwm-menu")).always(function () {
+ $("#pwm-go").attr("disabled", false);
+ });
+ }
+ });
+ $("#adc-controls").trigger("reset").setADCControl();
+ });
+ })
+
</script>
</head>
<body>
- <div id="header">
- <div id="leftnav">
- <a href="http://www.uwa.edu.au/" target="_blank">
- <img alt = "The University of Western Australia"
- src="static/uwacrest-text.png">
- </a>
- <span id="title">BBB pin test</span>
- </div>
- <div id="rightnav">
- <div id="menu-container" class="nav-menu">
+ <div id="header-wrap">
+ <div id="header">
+ <div id="leftnav">
+ <a href="http://www.uwa.edu.au/" target="_blank">
+ <img alt = "The University of Western Australia"
+ src="static/uwacrest-text.png">
+ </a>
+ <span id="title">BBB Pin test (debug only)</span>
</div>
- <span id="date">
- <script type="text/javascript">getDate();</script>
- </span>
+ <div id="rightnav">
+ <span id="welcome-container">
+ </span>
+ <span id="date">
+ <script type="text/javascript">getDate();</script>
+ </span>
+ <div id="logout-container">
+ <form action="#">
+ <div>
+ <input type="button" id="logout" value="Logout">
+ </div>
+ </form>
+ </div>
+ </div>
+ <div class="clear"></div>
</div>
- <div class="clear"></div>
</div>
<!-- End header -->
- <div id="content">
- <div id="sidebar">
- <div class="widget">
- <div class="title">Info</div>
- <p>This test page gives control over the BBB's pins.
- Select a pin that you wish to use from the relevant drop-down
- menu and click 'Go'.</p>
- <p>A new widget will appear with controls relevant to that pin.</p>
- <p>Make sure to check the error log to see if something goes wrong.</p>
- </div>
- <div class="widget">
- <div class="title">Pin out diagram</div>
- <p>To see the pin out diagram of the BBB, click <a href="">here</a>.</p>
- </div>
- <div class="widget">
- <div class="title">Unexport?</div>
- <p>
- To 'unexport' a pin means to disable it. Apart from the obvious
- use case, sometimes this can be required if you use two PWM channels
- that share the same frequency base.
- </p>
- <p>
- You won't be able to change
- the frequency until you unexport one of them.
- </p>
+ <div id="content-wrap">
+ <noscript>
+ <div class="widget centre">
+ <div class="title">JavaScript required</div>
+ This website requires JavaScript to function correctly.
+ Please enable JavaScript to use this site.
</div>
- <div class="widget">
- <div class="title">PWM explained</div>
- <p>
- The BBB has up to 8 PWM channels, with 6 having enhanced
- resolution.
- </p>
- <p>
- However, those 6 are paired, meaning that each pair must share the
- same frequency (although the duty cycle can be different).
- </p>
- </div>
- </div>
- <!-- End sidebar -->
-
- <div id="main">
- <div class="widget">
- <div class="title">Dashboard</div>
- <table>
- <tr>
- <td>
- GPIO <select id="gpio-menu"></select>
- <input type="button" id="gpio-go" value="Go">
- </td>
- <td>
- PWM <select id="pwm-menu"></select>
- <input type="button" id="pwm-go" value="Go">
- </td>
- </tr>
- </table>
-
- <div class="sub-title">Error log</div>
- <textarea id="errorlog" wrap="off" rows="4" cols="30" readonly></textarea>
+ </noscript>
+
+ <div id="content">
+ <div class="widget" id="sidebar-show">></div>
+ <div id="sidebar">
+ <div class="widget">
+ <div id="sidebar-hide"><</div>
+ <div class="title">Navigation menu</div>
+ <div id="sidebar-menu" class="nav-menu">
+ <ul>
+ <li><a href="index.html"><span>Home</span></a></li>
+ <li><a href="control.html"><span>Experiment control</span></a></li>
+ <li><a href="graph.html"><span>Experiment graphs</span></a></li>
+ <li><a href="values.html"><span>Experiment data (live)</span></a></li>
+ <li><a href="data.html"><span>Experiment data</span></a></li>
+ <li><a href="pintest.html"><span>Pin debugging</span></a></li>
+ <li class="last"><a href="help.html"><span>Help</span></a></li>
+ </ul>
+ </div>
+ </div>
+ <div class="widget">
+ <div class="title">Info</div>
+ <p>This test page gives control over the BBB's pins.
+ Select a pin that you wish to use from the relevant drop-down
+ menu and click 'Go'.</p>
+ <p>A new widget will appear with controls relevant to that pin.</p>
+ <p>Make sure to check the error log to see if something goes wrong.</p>
+ </div>
+ <div class="widget">
+ <div class="title">Pin out diagram</div>
+ <p>To see the pin out diagram of the BBB, click <a href="pinout-table.pdf" target="_blank">here</a>.</p>
+ </div>
+ <div class="widget">
+ <div class="title">Export/Unexport?</div>
+ <p>
+ To export/unexport a pin means to enable/disable it. Apart from the obvious
+ use case, sometimes this can be required if you use two PWM channels
+ that share the same frequency base.
+ </p>
+ <p>
+ You won't be able to change
+ the frequency until you unexport one of them.
+ </p>
+ </div>
+ <div class="widget">
+ <div class="title">PWM explained</div>
+ <p>The frequency must be a decimal number greater than 0.</p>
+ <p>
+ The duty cycle describes the proportion of off/on time per period.
+ This number is specified as a ratio, with values ranging from 0 to 1.
+ </p>
+ <p>
+ The polarity determines if the duty represents the 'active
+ high' or 'active low' portion. By default, the duty cycle
+ represents the 'active high' portion.
+ </p>
+ </div>
</div>
+ <!-- End sidebar -->
- <div class="widget">
- <div class="title">Analogue input (ADC)</div>
- <form class="controls" action="#" id="adc-controls">
- <table class="centre">
+ <div id="main">
+ <div class="widget">
+ <div class="title">Dashboard</div>
+ <table>
<tr>
- <td>AIN</td><th>0</th><th>1</th><th>2</th><th>3</th>
- <th>4</th><th>5</th><th>6</th><th>7</th>
- </tr>
- <tr>
- <td>Value</td>
- <td><input name="0" type="text" readonly></td>
- <td><input name="1" type="text" readonly></td>
- <td><input name="2" type="text" readonly></td>
- <td><input name="3" type="text" readonly></td>
- <td><input name="4" type="text" readonly></td>
- <td><input name="5" type="text" readonly></td>
- <td><input name="6" type="text" readonly></td>
- <td><input name="7" type="text" readonly></td>
- </tr>
- <tr>
- <td>Export</td>
- <td><input name="0" type="checkbox"></td>
- <td><input name="1" type="checkbox"></td>
- <td><input name="2" type="checkbox"></td>
- <td><input name="3" type="checkbox"></td>
- <td><input name="4" type="checkbox"></td>
- <td><input name="5" type="checkbox"></td>
- <td><input name="6" type="checkbox"></td>
- <td><input name="7" type="checkbox"></td>
+ <td>
+ GPIO <select id="gpio-menu"></select>
+ <input type="button" id="gpio-go" value="Go">
+ </td>
+ <td>
+ PWM <select id="pwm-menu"></select>
+ <input type="button" id="pwm-go" value="Go">
+ </td>
</tr>
</table>
- </form>
- </div>
-
- <div class="widget" id="gpio-container">
- <div class="title">GPIO controls</div>
- </div>
-
- <div class="widget" id="pwm-container">
- <div class="title">PWM controls</div>
+
+ <div class="sub-title">Error log</div>
+ <textarea id="errorlog" wrap="off" rows="4" cols="30" readonly></textarea>
+ </div>
+
+ <div class="widget">
+ <div class="title">Analogue input (ADC)</div>
+ <form class="controls" action="#" id="adc-controls">
+ <table class="centre">
+ <tr>
+ <td>AIN</td><th>0</th><th>1</th><th>2</th><th>3</th>
+ <th>4</th><th>5</th><th>6</th><th>7</th>
+ </tr>
+ <tr>
+ <td>Value</td>
+ <td><input name="0" type="text" readonly></td>
+ <td><input name="1" type="text" readonly></td>
+ <td><input name="2" type="text" readonly></td>
+ <td><input name="3" type="text" readonly></td>
+ <td><input name="4" type="text" readonly></td>
+ <td><input name="5" type="text" readonly></td>
+ <td><input name="6" type="text" readonly></td>
+ <td><input name="7" type="text" readonly></td>
+ </tr>
+ <tr>
+ <td>Export</td>
+ <td><input name="0" type="checkbox"></td>
+ <td><input name="1" type="checkbox"></td>
+ <td><input name="2" type="checkbox"></td>
+ <td><input name="3" type="checkbox"></td>
+ <td><input name="4" type="checkbox"></td>
+ <td><input name="5" type="checkbox"></td>
+ <td><input name="6" type="checkbox"></td>
+ <td><input name="7" type="checkbox"></td>
+ </tr>
+ </table>
+ </form>
+ </div>
+
+ <div class="widget" id="gpio-container">
+ <div class="title">GPIO controls</div>
+ </div>
+
+ <div class="widget" id="pwm-container">
+ <div class="title">PWM controls</div>
+ </div>
</div>
+ <!-- End main content -->
</div>
- <!-- End main content -->
</div>
</body>
</html>