Automatic commit of irc logs
[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          $("#gpio-menu").populateDropdown(mctx.pintest.gpios, "GPIO ");
34          $("#pwm-menu").populateDropdown(mctx.pintest.pwms, "PWM ");
35
36          $("#gpio-go").click(function () {
37            if ($("#gpio-menu").val()) {
38              $(this).attr("disabled", true);
39              $("#gpio-container").exportGPIO($("#gpio-menu")).always(function () {
40                $("#gpio-go").attr("disabled", false);
41              });
42            }
43          });
44          $("#pwm-go").click(function () {
45            if ($("#pwm-menu").val()) {
46              $(this).attr("disabled", true);
47              $("#pwm-container").exportPWM($("#pwm-menu")).always(function () {
48                $("#pwm-go").attr("disabled", false);
49              });
50            }
51          });
52          $("#adc-controls").trigger("reset").setADCControl();
53        });
54       })
55
56     </script>
57   </head>
58   
59   <body>
60     <div id="header-wrap">
61       <div id="header">
62         <div id="leftnav">
63           <a href="http://www.uwa.edu.au/" target="_blank">
64             <img alt = "The University of Western Australia"
65             src="static/uwacrest-text.png">
66           </a>
67           <span id="title">BBB Pin test (debug only)</span>
68         </div>
69         <div id="rightnav">
70           <span id="welcome-container">
71           </span>
72           <span id="date">
73             <script type="text/javascript">getDate();</script>
74           </span>
75           <div id="logout-container">
76             <form action="#">
77               <div>
78                 <input type="button" id="change-password" value="Change password">
79                 <input type="button" id="logout" value="Logout">
80               </div>
81             </form>
82           </div>
83         </div>
84         <div class="clear"></div>
85       </div>
86     </div>
87     <!-- End header -->
88     
89     <div id="content-wrap">
90       <noscript>
91         <div class="widget centre">
92           <div class="title">JavaScript required</div>
93           This website requires JavaScript to function correctly.
94           Please enable JavaScript to use this site.
95         </div>
96       </noscript>
97       
98       <div id="content">
99         <div class="widget" id="sidebar-show">&gt;</div>
100         <div id="sidebar">
101           <div class="widget">
102             <div id="sidebar-hide">&lt;</div>
103             <div class="title">Navigation menu</div>
104             <div id="sidebar-menu" class="nav-menu">
105               <ul>
106                 <li><a href="index.html"><span>Home</span></a></li>
107                 <li><a href="control.html"><span>Experiment control</span></a></li>
108                 <li><a href="graph.html"><span>Experiment graphs</span></a></li>
109                 <li><a href="values.html"><span>Experiment data (live)</span></a></li>
110                 <li><a href="data.html"><span>Experiment data</span></a></li>
111                 <li><a href="pintest.html"><span>Pin debugging</span></a></li>
112                 <li class="last"><a href="help.html"><span>Help</span></a></li>
113               </ul>
114             </div>
115           </div>
116           <div class="widget">
117             <div class="title">Info</div>
118             <p>This test page gives control over the BBB's pins.
119             Select a pin that you wish to use from the relevant drop-down
120             menu and click 'Go'.</p>
121             <p>A new widget will appear with controls relevant to that pin.</p>
122             <p>Make sure to check the error log to see if something goes wrong.</p>
123           </div>
124           <div class="widget">
125             <div class="title">Pin out diagram</div>
126             <p>To see the pin out diagram of the BBB, click <a href="pinout-table.pdf" target="_blank">here</a>.</p>
127           </div>
128           <div class="widget">
129             <div class="title">Export/Unexport?</div>
130             <p>
131               To export/unexport a pin means to enable/disable it. Apart from the obvious
132               use case, sometimes this can be required if you use two PWM channels
133               that share the same frequency base.
134             </p>
135             <p>
136               You won't be able to change
137               the frequency until you unexport one of them.
138             </p>
139           </div>
140           <div class="widget">
141             <div class="title">PWM explained</div>
142             <p>The frequency must be a decimal number greater than 0.</p>
143             <p>
144               The duty cycle describes the proportion of off/on time per period.
145               This number is specified as a ratio, with values ranging from 0 to 1.
146             </p>
147             <p>
148               The polarity determines if the duty represents the 'active
149               high' or 'active low' portion. By default, the duty cycle
150               represents the 'active high' portion.
151             </p>
152           </div>
153         </div>
154         <!-- End sidebar -->
155
156         <div id="main">
157           <div class="widget">
158             <div class="title">Dashboard</div>
159             <table>
160               <tr>
161                 <td>
162                   GPIO <select id="gpio-menu"></select>
163                   <input type="button" id="gpio-go" value="Go">
164                 </td>
165                 <td>
166                   PWM <select id="pwm-menu"></select>
167                   <input type="button" id="pwm-go" value="Go">
168                 </td>
169               </tr>
170             </table>
171
172             <div class="sub-title">Error log</div>
173             <textarea id="errorlog" wrap="off" rows="4" cols="30" readonly></textarea>
174           </div>
175
176           <div class="widget">
177             <div class="title">Analogue input (ADC)</div>
178             <form class="controls" action="#" id="adc-controls">
179               <table class="centre">
180                 <tr>
181                   <td>AIN</td><th>0</th><th>1</th><th>2</th><th>3</th>
182                   <th>4</th><th>5</th><th>6</th><th>7</th>
183                 </tr>
184                 <tr>
185                   <td>Value</td>
186                   <td><input name="0" type="text" readonly></td>
187                   <td><input name="1" type="text" readonly></td>
188                   <td><input name="2" type="text" readonly></td>
189                   <td><input name="3" type="text" readonly></td>
190                   <td><input name="4" type="text" readonly></td>
191                   <td><input name="5" type="text" readonly></td>
192                   <td><input name="6" type="text" readonly></td>
193                   <td><input name="7" type="text" readonly></td>
194                 </tr>
195                 <tr>
196                   <td>Export</td>
197                   <td><input name="0" type="checkbox"></td>
198                   <td><input name="1" type="checkbox"></td>
199                   <td><input name="2" type="checkbox"></td>
200                   <td><input name="3" type="checkbox"></td>
201                   <td><input name="4" type="checkbox"></td>
202                   <td><input name="5" type="checkbox"></td>
203                   <td><input name="6" type="checkbox"></td>
204                   <td><input name="7" type="checkbox"></td>
205                 </tr>
206               </table>
207             </form>
208           </div>
209
210           <div class="widget" id="gpio-container">
211             <div class="title">GPIO controls</div>
212           </div>
213
214           <div class="widget" id="pwm-container">
215             <div class="title">PWM controls</div>
216           </div>
217         </div>
218         <!-- End main content -->
219       </div>
220     </div>
221   </body>
222 </html>

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