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

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