Merge branch 'master' of https://github.com/szmoore/MCTX3420.git
[matches/MCTX3420.git] / testing / MCTXWeb / public_html / pintest.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2 <html>
3   <head>
4     <title>MCTX3420 Web Interface</title>
5     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
6     <script type="text/javascript" src="static/jquery-1.10.1.min.js"></script>
7     <script type="text/javascript" src="static/mctx.gui.js"></script>
8     <script type="text/javascript" src="static/mctx.pintest.js"></script>
9     
10     <link rel="stylesheet" type="text/css" href="static/style.css">
11     <link rel="stylesheet" type="text/css" href="static/nav-menu.css">
12     <script type="text/javascript">
13       runBeforeLoad().done(function () {
14         //Ensure stuff is unloaded before leaving the page
15         $(window).unload(function(){
16           $("#adc-controls").find("input[type='checkbox']")
17           .each(function () {
18             if ($(this).is(":checked")) {
19               $(this).trigger("click");
20             }
21           });
22           $("#gpio-container").find("input[name='unexport']")
23           .each(function () {
24             $(this).trigger("click");
25           });
26           $("#pwm-container").find("input[name='unexport']")
27           .each(function () {
28             $(this).trigger("click");
29           });
30         });
31         
32         $(document).ready(function () {
33          //Set the welcome bar
34          var name = " " + (mctx.friendlyName ? mctx.friendlyName : "");
35          $("#welcome-container").text("Welcome"+ name + "!");
36          $("#content").css("display", "block");
37
38          $("#logout").click(function () {
39            $("#logout").logout();
40          });
41
42          $("#gpio-menu").populateDropdown(mctx.pintest.gpios, "GPIO ");
43          $("#pwm-menu").populateDropdown(mctx.pintest.pwms, "PWM ");
44
45          $("#gpio-go").click(function () {
46            if ($("#gpio-menu").val()) {
47              $(this).attr("disabled", true);
48              $("#gpio-container").exportGPIO($("#gpio-menu")).always(function () {
49                $("#gpio-go").attr("disabled", false);
50              });
51            }
52          });
53          $("#pwm-go").click(function () {
54            if ($("#pwm-menu").val()) {
55              $(this).attr("disabled", true);
56              $("#pwm-container").exportPWM($("#pwm-menu")).always(function () {
57                $("#pwm-go").attr("disabled", false);
58              });
59            }
60          });
61          $("#adc-controls").trigger("reset").setADCControl();
62
63          $("#errorlog").setErrorLog();
64        });
65       })
66
67     </script>
68   </head>
69   
70   <body>
71     <div id="header">
72       <div id="leftnav">
73         <a href="http://www.uwa.edu.au/" target="_blank">
74           <img alt = "The University of Western Australia"
75           src="static/uwacrest-text.png">
76         </a>
77         <span id="title">BBB Pin test (debug only)</span>
78       </div>
79       <div id="rightnav">
80         <span id="welcome-container">
81         </span>
82         <span id="date">
83           <script type="text/javascript">getDate();</script>
84         </span>
85         <div id="logout-container">
86           <form action="#">
87             <div>
88               <input type="button" id="logout" value="Logout">
89             </div>
90           </form>
91         </div>
92       </div>
93       <div class="clear"></div>
94     </div>
95     <!-- End header -->
96     
97     <div id="content">
98       <div id="sidebar">
99         <div class="widget">
100           <div class="title">Navigation menu</div>
101           <div class="nav-menu">
102           <ul>
103              <li><a href="index.html"><span>Home</span></a></li>
104              <li><a href="control.html"><span>Experiment control</span></a></li>
105              <li><a href="pintest.html"><span>Pin debugging</span></a></li>
106              <li class="last"><a href="#"><span>Help</span></a></li>
107           </ul>
108           </div>
109         </div>
110         <div class="widget">
111           <div class="title">Info</div>
112           <p>This test page gives control over the BBB's pins.
113           Select a pin that you wish to use from the relevant drop-down
114           menu and click 'Go'.</p>
115           <p>A new widget will appear with controls relevant to that pin.</p>
116           <p>Make sure to check the error log to see if something goes wrong.</p>
117         </div>
118         <div class="widget">
119           <div class="title">Pin out diagram</div>
120           <p>To see the pin out diagram of the BBB, click <a href="pinout-table.pdf" target="_blank">here</a>.</p>
121         </div>
122         <div class="widget">
123           <div class="title">Export/Unexport?</div>
124           <p>
125             To export/unexport a pin means to enable/disable it. Apart from the obvious
126             use case, sometimes this can be required if you use two PWM channels
127             that share the same frequency base.
128           </p>
129           <p>
130             You won't be able to change
131             the frequency until you unexport one of them.
132           </p>
133         </div>
134         <div class="widget">
135           <div class="title">PWM explained</div>
136           <p>The frequency must be a decimal number greater than 0.</p>
137           <p>
138             The duty cycle describes the proportion of off/on time per period.
139             This number is specified as a ratio, with values ranging from 0 to 1.
140           </p>
141           <p>
142             The polarity determines if the duty represents the 'active
143             high' or 'active low' portion. By default, the duty cycle
144             represents the 'active high' portion.
145           </p>
146         </div>
147       </div>
148       <!-- End sidebar -->
149
150       <div id="main">
151         <div class="widget">
152           <div class="title">Dashboard</div>
153           <table>
154             <tr>
155               <td>
156                 GPIO <select id="gpio-menu"></select>
157                 <input type="button" id="gpio-go" value="Go">
158               </td>
159               <td>
160                 PWM <select id="pwm-menu"></select>
161                 <input type="button" id="pwm-go" value="Go">
162               </td>
163             </tr>
164           </table>
165             
166           <div class="sub-title">Error log</div>
167           <textarea id="errorlog" wrap="off" rows="4" cols="30" readonly></textarea>
168         </div>
169
170         <div class="widget">
171           <div class="title">Analogue input (ADC)</div>
172           <form class="controls" action="#" id="adc-controls">
173             <table class="centre">
174               <tr>
175                 <td>AIN</td><th>0</th><th>1</th><th>2</th><th>3</th>
176                 <th>4</th><th>5</th><th>6</th><th>7</th>
177               </tr>
178               <tr>
179                 <td>Value</td>
180                 <td><input name="0" type="text" readonly></td>
181                 <td><input name="1" type="text" readonly></td>
182                 <td><input name="2" type="text" readonly></td>
183                 <td><input name="3" type="text" readonly></td>
184                 <td><input name="4" type="text" readonly></td>
185                 <td><input name="5" type="text" readonly></td>
186                 <td><input name="6" type="text" readonly></td>
187                 <td><input name="7" type="text" readonly></td>
188               </tr>
189               <tr>
190                 <td>Export</td>
191                 <td><input name="0" type="checkbox"></td>
192                 <td><input name="1" type="checkbox"></td>
193                 <td><input name="2" type="checkbox"></td>
194                 <td><input name="3" type="checkbox"></td>
195                 <td><input name="4" type="checkbox"></td>
196                 <td><input name="5" type="checkbox"></td>
197                 <td><input name="6" type="checkbox"></td>
198                 <td><input name="7" type="checkbox"></td>
199               </tr>
200             </table>
201           </form>
202         </div>
203         
204         <div class="widget" id="gpio-container">
205           <div class="title">GPIO controls</div>
206         </div>
207         
208         <div class="widget" id="pwm-container">
209           <div class="title">PWM controls</div>
210         </div>
211       </div>
212       <!-- End main content -->
213     </div>
214   </body>
215 </html>

UCC git Repository :: git.ucc.asn.au