Rename help/data file + fix the sidebar width
authorJeremy Tan <[email protected]>
Sun, 13 Oct 2013 12:52:07 +0000 (20:52 +0800)
committerJeremy Tan <[email protected]>
Sun, 13 Oct 2013 12:52:07 +0000 (20:52 +0800)
testing/MCTXWeb/public_html/control.html
testing/MCTXWeb/public_html/data-Justin.html [deleted file]
testing/MCTXWeb/public_html/data.html [new file with mode: 0644]
testing/MCTXWeb/public_html/help-Justin.html [deleted file]
testing/MCTXWeb/public_html/help.html [new file with mode: 0644]
testing/MCTXWeb/public_html/index.html
testing/MCTXWeb/public_html/pintest.html
testing/MCTXWeb/public_html/static/mctx.gui.js
testing/MCTXWeb/public_html/static/style.css

index ecefd5a..d31801d 100644 (file)
@@ -86,8 +86,9 @@
             <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="data.html"><span>Experiment data</span></a></li>
                <li><a href="pintest.html"><span>Pin debugging</span></a></li>
-               <li class="last"><a href="#"><span>Help</span></a></li>
+               <li class="last"><a href="help.html"><span>Help</span></a></li>
             </ul>
             </div>
           </div>
diff --git a/testing/MCTXWeb/public_html/data-Justin.html b/testing/MCTXWeb/public_html/data-Justin.html
deleted file mode 100644 (file)
index 975b538..0000000
+++ /dev/null
@@ -1,271 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
-
-<!--Current Experiment section is pretty much working, still working out the previous experiments bit-->
-<!--Basically, the download links and graph links automatically update depending on what is selected in the drop-down menus-->
-<!--Some dodgy javascript is involved but it sort of works-->
-<!--The HTML5 "download" attribute is used to force downloads, but that's not compatible with IE (it just views the files in IE)-->
-<html>
-  <head>
-    <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/mctx.gui.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">
-      runBeforeLoad().done(function() {
-        $(document).ready(function() {
-          //Show the content!
-          $("#content").css("display", "block");
-          //Set the welcome bar
-          var name = " " + (mctx.friendlyName ? mctx.friendlyName : "");
-          $("#welcome-container").text("Welcome" + name + "!");
-          $("#logout-container").css("display", "block");
-          //$("#menu-container").populateNavbar();
-
-          $("#logout").click(function() {
-            $("#logout").logout();
-          });
-
-          $("#main_controls").submit(function() {
-            //Validate!
-            return false;
-          });
-
-          $("#errorlog").setErrorLog();
-        });
-      })
-
-      //function to load appropriate graph image depending on drop-down menu
-      function graphLoad(graphid, folder, newgraph) {
-        document.getElementById(graphid).src = folder + "/" + newgraph + ".png";
-      }
-      //function to load appropriate graph image depending on drop-down menu
-      function graphLoad2(graphid, newgraph) {
-        var exp = document.getElementById("expselect").value;
-        document.getElementById(graphid).src = exp + "/" + newgraph + ".png";
-      }
-      //function to create appropriate experiment links depending on drop-down menu
-      function expLoad(expclass, folder, newlink) {
-        var elems = document.getElementsByClassName(expclass);
-        for (i = 0; i < elems.length; i++) {
-          var elem = elems[i];
-          elem.href = folder + "/" + newlink;
-        }
-      }
-      //function to update experiment links links depending on drop-down menu
-      function expLoadTotal(folder) {
-        expLoad('s1', folder, 'strain1');
-        expLoad('s2', folder, 'strain2');
-        expLoad('s3', folder, 'strain3');
-        expLoad('s4', folder, 'strain4');
-        expLoad('p1', folder, 'pressure1');
-        expLoad('p2', folder, 'pressure2');
-        expLoad('d', folder, 'all.zip');
-      }
-    </script>
-  </head>
-
-  <body>
-    <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">Exploding Cans</span>
-        </div>
-        <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>
-    <!-- End header -->
-
-    <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>
-      </noscript>
-
-      <div id="content">
-        <div id="sidebar">
-          <div class="widget">
-            <div class="title">Navigation menu</div>
-            <div 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="pintest.html"><span>Pin debugging</span></a></li>
-                <li class="last"><a href="#"><span>Help</span></a></li>
-              </ul>
-            </div>
-          </div>
-          <div class="widget">
-            <div class="title">Help</div>
-
-          </div>
-        </div>
-        <!-- End sidebar -->
-
-        <div id="main">
-          <div class="widget">
-            <div class="title">Experiment Data</div>
-            <b>Current Experiment</b>
-            <table>
-              <tr>
-                <!--I have no idea how we'll end up storing all the experiment data on the Beaglebone so these currently just link to a bunch of dummy files-->
-                <td>View Sensor Data</td>
-                <td></td>
-                <td><a href="current/strain1">Strain 1</a></td>
-                <td><a href="current/strain2">Strain 2</a></td>
-                <td><a href="current/strain3">Strain 3</a></td>
-                <td><a href="current/strain4">Strain 4</a></td>
-                <td><a href="current/pressure1">Pressure 1</a></td>
-                <td><a href="current/pressure2">Pressure 2</a></td>
-              </tr>
-              <tr>
-                <!--uses the download attribute to force downloads, only compatible with some browsers. Other users will just have to right-click and Save File As-->
-                <td>Save Sensor Data</td>
-                <td><a href="current/all.zip" download><input type="button" value="Download All"></a></td>
-                <td><a href="current/strain1" download><input type="button" value="Strain 1"></a></td>
-                <td><a href="current/strain2" download><input type="button" value="Strain 2"></a></td>
-                <td><a href="current/strain3" download><input type="button" value="Strain 3"></a></td>
-                <td><a href="current/strain4" download><input type="button" value="Strain 4"></a></td>
-                <td><a href="current/pressure1" download><input type="button" value="Pressure 1"></a></td>
-                <td><a href="current/pressure1" download><input type="button" value="Pressure 1"></a></td>
-              </tr>
-              <tr>
-                <!--not sure about how exactly we'll be linking to dilatometer or camera data yet-->
-                <td>Dilatometer</td>
-                <td><a href="nowhere" download="nowhere"><input type="button" value="Download Data"></a></td>
-                <td><a href="nowhere">View Data</a></td>
-              </tr>
-              <tr>
-                <td>Camera Data</td>
-                <td><a href="nowhere" download="nowhere"><input type="button" value="Download Data"></a></td>
-                <td><a href="nowhere">View Data</a></td>
-              </tr>
-              <tr>
-
-                <td>Graphs</td>
-                <td>
-                  <form>
-                    <select onChange="graphLoad('g1', 'current', this.value)">
-                      <!--link this to graphs functionality, currently just loads a placeholder image-->
-                      <!--graphs could just plot the data over entire time range of the experiment-->
-                      <option value="nograph">Choose to view</option>
-                      <option value="graph1">Strain 1</option>
-                      <option value="graph2">Strain 2</option>
-                      <option value="graph3">Strain 3</option>
-                      <option value="graph4">Strain 4</option>
-                      <option value="graph5">Pressure 1</option>
-                      <option value="graph6">Pressure 2</option>
-                    </select>
-                  </form>
-
-                </td>
-              </tr>
-            </table>
-            <img src="current/nograph.png" id="g1">
-            <p><b>Previous Experiments</b></p>
-            <table>
-              <tr>
-                <td>Select Experiment</td>
-                <td>
-                  <!--Upon selecting experiment, modify all the download links-->
-                  <!--TODO: prevent downloads of data if no experiment is selected-->
-                  <select id="expselect" onChange="expLoadTotal(this.value)">
-                    <option value="current">Current</option>
-                    <option value="exp1">Experiment 1</option>
-                    <option value="exp2">Experiment 2</option>
-                    <option value="exp3">Experiment 3</option>
-                    <option value="exp4">Experiment 4</option>
-                    <option value="exp5">Experiment 5</option>
-                  </select>
-                </td>
-              </tr>
-              <tr>
-                <td>Experiment Date</td>
-                <!--Lookup the experiment date here for identification purposes-->
-                <td><b>DATE LOOKUP</b></td>
-              </tr>
-              <tr>
-                <td>View Sensor Data</td>
-                <td></td>
-                <td><a href="current/strain1" class="s1">Strain 1</a></td>
-                <td><a href="current/strain2" class="s2">Strain 2</a></td>
-                <td><a href="current/strain3" class="s3">Strain 3</a></td>
-                <td><a href="current/strain4" class="s4">Strain 4</a></td>
-                <td><a href="current/pressure1" class="p1">Pressure 1</a></td>
-                <td><a href="current/pressure2" class="p2">Pressure 2</a></td>
-              </tr>
-              <tr>
-                <td>Save Sensor Data</td>
-                <td><a href="current/all.zip" download class="d"><input type="button" value="Download All"></a></td>
-                <td><a href="current/strain1" download class="s1"><input type="button" value="Strain 1"></a></td>
-                <td><a href="current/strain2" download class="s2"><input type="button" value="Strain 2"></a></td>
-                <td><a href="current/strain3" download class="s3"><input type="button" value="Strain 3"></a></td>
-                <td><a href="current/strain4" download class="s4"><input type="button" value="Strain 4"></a></td>
-                <td><a href="current/pressure1" download class="p1"><input type="button" value="Pressure 1"></a></td>
-                <td><a href="current/pressure2" download class="p2"><input type="button" value="Pressure 1"></a></td>
-              </tr>
-              <tr>
-                <!--not sure about how exactly we'll be linking to dilatometer or camera data yet-->
-                <td>Dilatometer</td>
-                <td><a href="nowhere" download="nowhere"><input type="button" value="Download Data"></a></td>
-                <td><a href="nowhere">View Data</a></td>
-              </tr>
-              <tr>
-                <td>Camera Data</td>
-                <td><a href="nowhere" download="nowhere"><input type="button" value="Download Data"></a></td>
-                <td><a href="nowhere">View Data</a></td>
-              </tr>
-              <tr>
-                <td>Graphs</td>
-                <td>
-                  <form>
-                    <select onChange="graphLoad2('g2', this.value)">
-                      <!--link this to graphs functionality, currently just loads a placeholder image-->
-                      <!--graphs could just plot the data over entire time range of the experiment-->
-                      <option value="nograph">Choose to view</option>
-                      <option value="graph1">Strain 1</option>
-                      <option value="graph2">Strain 2</option>
-                      <option value="graph3">Strain 3</option>
-                      <option value="graph4">Strain 4</option>
-                      <option value="graph5">Pressure 1</option>
-                      <option value="graph6">Pressure 2</option>
-                    </select>
-                  </form>
-                </td>
-              </tr>
-            </table>
-            <img src="current/nograph.png" id="g2">
-          </div>
-        </div>
-        <!-- End main content -->
-      </div>
-    </div>
-  </body>
-</html>
diff --git a/testing/MCTXWeb/public_html/data.html b/testing/MCTXWeb/public_html/data.html
new file mode 100644 (file)
index 0000000..89a29a7
--- /dev/null
@@ -0,0 +1,272 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+
+<!--Current Experiment section is pretty much working, still working out the previous experiments bit-->
+<!--Basically, the download links and graph links automatically update depending on what is selected in the drop-down menus-->
+<!--Some dodgy javascript is involved but it sort of works-->
+<!--The HTML5 "download" attribute is used to force downloads, but that's not compatible with IE (it just views the files in IE)-->
+<html>
+  <head>
+    <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/mctx.gui.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">
+      runBeforeLoad().done(function() {
+        $(document).ready(function() {
+          //Show the content!
+          $("#content").css("display", "block");
+          //Set the welcome bar
+          var name = " " + (mctx.friendlyName ? mctx.friendlyName : "");
+          $("#welcome-container").text("Welcome" + name + "!");
+          $("#logout-container").css("display", "block");
+          //$("#menu-container").populateNavbar();
+
+          $("#logout").click(function() {
+            $("#logout").logout();
+          });
+
+          $("#main_controls").submit(function() {
+            //Validate!
+            return false;
+          });
+
+          $("#errorlog").setErrorLog();
+        });
+      })
+
+      //function to load appropriate graph image depending on drop-down menu
+      function graphLoad(graphid, folder, newgraph) {
+        document.getElementById(graphid).src = folder + "/" + newgraph + ".png";
+      }
+      //function to load appropriate graph image depending on drop-down menu
+      function graphLoad2(graphid, newgraph) {
+        var exp = document.getElementById("expselect").value;
+        document.getElementById(graphid).src = exp + "/" + newgraph + ".png";
+      }
+      //function to create appropriate experiment links depending on drop-down menu
+      function expLoad(expclass, folder, newlink) {
+        var elems = document.getElementsByClassName(expclass);
+        for (i = 0; i < elems.length; i++) {
+          var elem = elems[i];
+          elem.href = folder + "/" + newlink;
+        }
+      }
+      //function to update experiment links links depending on drop-down menu
+      function expLoadTotal(folder) {
+        expLoad('s1', folder, 'strain1');
+        expLoad('s2', folder, 'strain2');
+        expLoad('s3', folder, 'strain3');
+        expLoad('s4', folder, 'strain4');
+        expLoad('p1', folder, 'pressure1');
+        expLoad('p2', folder, 'pressure2');
+        expLoad('d', folder, 'all.zip');
+      }
+    </script>
+  </head>
+
+  <body>
+    <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">Exploding Cans</span>
+        </div>
+        <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>
+    <!-- End header -->
+
+    <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>
+      </noscript>
+
+      <div id="content">
+        <div id="sidebar">
+          <div class="widget">
+            <div class="title">Navigation menu</div>
+            <div 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="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">Help</div>
+
+          </div>
+        </div>
+        <!-- End sidebar -->
+
+        <div id="main">
+          <div class="widget">
+            <div class="title">Experiment Data</div>
+            <b>Current Experiment</b>
+            <table>
+              <tr>
+                <!--I have no idea how we'll end up storing all the experiment data on the Beaglebone so these currently just link to a bunch of dummy files-->
+                <td>View Sensor Data</td>
+                <td></td>
+                <td><a href="current/strain1">Strain 1</a></td>
+                <td><a href="current/strain2">Strain 2</a></td>
+                <td><a href="current/strain3">Strain 3</a></td>
+                <td><a href="current/strain4">Strain 4</a></td>
+                <td><a href="current/pressure1">Pressure 1</a></td>
+                <td><a href="current/pressure2">Pressure 2</a></td>
+              </tr>
+              <tr>
+                <!--uses the download attribute to force downloads, only compatible with some browsers. Other users will just have to right-click and Save File As-->
+                <td>Save Sensor Data</td>
+                <td><a href="current/all.zip" download><input type="button" value="Download All"></a></td>
+                <td><a href="current/strain1" download><input type="button" value="Strain 1"></a></td>
+                <td><a href="current/strain2" download><input type="button" value="Strain 2"></a></td>
+                <td><a href="current/strain3" download><input type="button" value="Strain 3"></a></td>
+                <td><a href="current/strain4" download><input type="button" value="Strain 4"></a></td>
+                <td><a href="current/pressure1" download><input type="button" value="Pressure 1"></a></td>
+                <td><a href="current/pressure1" download><input type="button" value="Pressure 1"></a></td>
+              </tr>
+              <tr>
+                <!--not sure about how exactly we'll be linking to dilatometer or camera data yet-->
+                <td>Dilatometer</td>
+                <td><a href="nowhere" download="nowhere"><input type="button" value="Download Data"></a></td>
+                <td><a href="nowhere">View Data</a></td>
+              </tr>
+              <tr>
+                <td>Camera Data</td>
+                <td><a href="nowhere" download="nowhere"><input type="button" value="Download Data"></a></td>
+                <td><a href="nowhere">View Data</a></td>
+              </tr>
+              <tr>
+
+                <td>Graphs</td>
+                <td>
+                  <form>
+                    <select onChange="graphLoad('g1', 'current', this.value)">
+                      <!--link this to graphs functionality, currently just loads a placeholder image-->
+                      <!--graphs could just plot the data over entire time range of the experiment-->
+                      <option value="nograph">Choose to view</option>
+                      <option value="graph1">Strain 1</option>
+                      <option value="graph2">Strain 2</option>
+                      <option value="graph3">Strain 3</option>
+                      <option value="graph4">Strain 4</option>
+                      <option value="graph5">Pressure 1</option>
+                      <option value="graph6">Pressure 2</option>
+                    </select>
+                  </form>
+
+                </td>
+              </tr>
+            </table>
+            <img src="current/nograph.png" id="g1">
+            <p><b>Previous Experiments</b></p>
+            <table>
+              <tr>
+                <td>Select Experiment</td>
+                <td>
+                  <!--Upon selecting experiment, modify all the download links-->
+                  <!--TODO: prevent downloads of data if no experiment is selected-->
+                  <select id="expselect" onChange="expLoadTotal(this.value)">
+                    <option value="current">Current</option>
+                    <option value="exp1">Experiment 1</option>
+                    <option value="exp2">Experiment 2</option>
+                    <option value="exp3">Experiment 3</option>
+                    <option value="exp4">Experiment 4</option>
+                    <option value="exp5">Experiment 5</option>
+                  </select>
+                </td>
+              </tr>
+              <tr>
+                <td>Experiment Date</td>
+                <!--Lookup the experiment date here for identification purposes-->
+                <td><b>DATE LOOKUP</b></td>
+              </tr>
+              <tr>
+                <td>View Sensor Data</td>
+                <td></td>
+                <td><a href="current/strain1" class="s1">Strain 1</a></td>
+                <td><a href="current/strain2" class="s2">Strain 2</a></td>
+                <td><a href="current/strain3" class="s3">Strain 3</a></td>
+                <td><a href="current/strain4" class="s4">Strain 4</a></td>
+                <td><a href="current/pressure1" class="p1">Pressure 1</a></td>
+                <td><a href="current/pressure2" class="p2">Pressure 2</a></td>
+              </tr>
+              <tr>
+                <td>Save Sensor Data</td>
+                <td><a href="current/all.zip" download class="d"><input type="button" value="Download All"></a></td>
+                <td><a href="current/strain1" download class="s1"><input type="button" value="Strain 1"></a></td>
+                <td><a href="current/strain2" download class="s2"><input type="button" value="Strain 2"></a></td>
+                <td><a href="current/strain3" download class="s3"><input type="button" value="Strain 3"></a></td>
+                <td><a href="current/strain4" download class="s4"><input type="button" value="Strain 4"></a></td>
+                <td><a href="current/pressure1" download class="p1"><input type="button" value="Pressure 1"></a></td>
+                <td><a href="current/pressure2" download class="p2"><input type="button" value="Pressure 1"></a></td>
+              </tr>
+              <tr>
+                <!--not sure about how exactly we'll be linking to dilatometer or camera data yet-->
+                <td>Dilatometer</td>
+                <td><a href="nowhere" download="nowhere"><input type="button" value="Download Data"></a></td>
+                <td><a href="nowhere">View Data</a></td>
+              </tr>
+              <tr>
+                <td>Camera Data</td>
+                <td><a href="nowhere" download="nowhere"><input type="button" value="Download Data"></a></td>
+                <td><a href="nowhere">View Data</a></td>
+              </tr>
+              <tr>
+                <td>Graphs</td>
+                <td>
+                  <form>
+                    <select onChange="graphLoad2('g2', this.value)">
+                      <!--link this to graphs functionality, currently just loads a placeholder image-->
+                      <!--graphs could just plot the data over entire time range of the experiment-->
+                      <option value="nograph">Choose to view</option>
+                      <option value="graph1">Strain 1</option>
+                      <option value="graph2">Strain 2</option>
+                      <option value="graph3">Strain 3</option>
+                      <option value="graph4">Strain 4</option>
+                      <option value="graph5">Pressure 1</option>
+                      <option value="graph6">Pressure 2</option>
+                    </select>
+                  </form>
+                </td>
+              </tr>
+            </table>
+            <img src="current/nograph.png" id="g2">
+          </div>
+        </div>
+        <!-- End main content -->
+      </div>
+    </div>
+  </body>
+</html>
diff --git a/testing/MCTXWeb/public_html/help-Justin.html b/testing/MCTXWeb/public_html/help-Justin.html
deleted file mode 100644 (file)
index acf23a9..0000000
+++ /dev/null
@@ -1,186 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
-<html>
-  <head>
-    <title>MCTX3420 Web Interface</title>
-    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-    <script type="text/javascript" src="static/jquery-1.10.1.min.js"></script>
-    <script type="text/javascript" src="static/mctx.gui.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">
-      runBeforeLoad().done(function() {
-        $(document).ready(function() {
-          //Show the content!
-          $("#content").css("display", "block");
-          //Set the welcome bar
-          var name = " " + (mctx.friendlyName ? mctx.friendlyName : "");
-          $("#welcome-container").text("Welcome" + name + "!");
-          $("#logout-container").css("display", "block");
-          //$("#menu-container").populateNavbar();
-
-          $("#logout").click(function() {
-            $("#logout").logout();
-          });
-
-          $("#main_controls").submit(function() {
-            //Validate!
-            return false;
-          });
-
-          $("#errorlog").setErrorLog();
-        });
-      })
-
-    </script>
-  </head>
-
-  <body>
-    <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">Exploding Cans</span>
-        </div>
-        <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>
-    <!-- End header -->
-
-    <div id="content-wrap">
-      <div id="content">
-        <div id="sidebar">
-          <div class="widget">
-            <div class="title">Navigation menu</div>
-            <div 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="pintest.html"><span>Pin debugging</span></a></li>
-                <li class="last"><a href="#"><span>Help</span></a></li>
-              </ul>
-            </div>
-          </div>
-          <div class="widget justify">
-            <div class="title">Tutorials</div>
-            <p class="justify">For general information on using the MCTX project web interface (i.e. this webpage!) see the <b>'Tutorials'</b> section.
-              This will guide you through setting up, running and analysing an experiment with basic tutorials and explanation of the possible options.</p>
-          </div>
-          <div class="widget justify">
-            <div class="title">Experiment Hardware</div>
-            <p class="justify">For detailed technical information about the experiment hardware, including system diagrams, datasheets and run-downs of the components,
-              see the <b>'Hardware'</b> section.</p>
-          </div>
-          <div class="widget justify">
-            <div class="title">Experiment Software</div>
-            <p class="justify">For detailed technical information about the experiment software, including explanations of its structure, functions and so on, see the
-              <b>'Software'</b> section. Actual code can be accessed on the project's GitHub: <a href="https://github.com/szmoore/MCTX3420">MCTX3420</a>.</p>
-          </div>
-          <div class="widget justify">
-            <div class="title">Contact</div>
-            <p class="justify">If you would like more information about the project or require additional assistance, please contact:</p>
-            <p><b>Adrian Keating</b></p>
-            <p><b>Adam Wittek</b></p>
-          </div>
-        </div>
-        <!-- End sidebar -->
-
-        <div id="main">
-          <div class="widget">
-            <div class="title">Getting Started</div>
-            <p class="justify">Welcome to the MCTX3420 project documentation! On this page, you will find help on how to use the project software,
-              as well as information about the various hardware components.</p>
-            <p class="justify">For a basic introduction to using the experiment, see <b>'Tutorials'</b>.
-              <a href="https://github.com/szmoore/MCTX3420/wiki/System-Overview" target="_blank">System overview</a> provides a general overview of the experiment's hardware, while
-              <a href="https://github.com/szmoore/MCTX3420/wiki/Getting-Started:-Web-Interface" target="_blank">Using the web interface</a> provides a tutorial on using the the project software.
-              For detailed information about the experiment hardware, see the <b>'Hardware'</b> section. For detailed information about the project software,
-              see the <b>'Software'</b> section.</p>
-            <div class="sub-title">Tutorials</div>
-            <ul>
-              <li><a href="https://github.com/szmoore/MCTX3420/wiki/System-Overview" target="_blank">System overview</a></li>
-              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Getting-Started:-Web-Interface" target="_blank">Using the web interface</a></li>
-              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Getting-Started:-Run-an-Experiment" target="_blank">Running an experiment</a></li>
-              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Getting-Started:-View-Old-Experiments" target="_blank">Viewing previous experiments</a></li>
-              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Getting-Started:-Data-Processing" target="_blank">Data processing</a></li>
-              <li><a href="https://github.com/szmoore/MCTX3420/wiki/System-Safety" target="_blank">System safety</a></li>
-            </ul>
-            <div class="sub-title">Hardware</div>
-            <ul>
-              <li><a href="https://github.com/szmoore/MCTX3420/wiki/System-Overview" target="_blank">System overview</a></li>
-              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Hardware:-Electronics" target="_blank">Electronics</a></li>
-              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Hardware:-BeagleBone" target="_blank">BeagleBone</a></li>
-              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Hardware:-Pneumatics" target="_blank">Pneumatics</a></li>
-              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Hardware:-Sensors" target="_blank">Sensors</a></li>
-              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Hardware:-Mounting" target="_blank">Mounting</a></li>
-              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Hardware:-Case" target="_blank">Case</a></li>
-            </ul>
-            <div class="sub-title">Software</div>
-            <ul>
-              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Software:-Overview" target="_blank">Software overview</a></li>
-              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Software:-Browser-Interface" target="_blank">Browser interface</a></li>
-              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Software:-Server-API" target="_blank">Server API</a></li>
-              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Software:-Server-Code" target="_blank">Server code</a>
-                <ul>
-                  <li><a href="https://github.com/szmoore/MCTX3420/wiki/Software:-Data-Handling" target="_blank">Data handling</a></li>
-                  <li><a href="https://github.com/szmoore/MCTX3420/wiki/Software:-Sensors-&amp;-Actuators" target="_blank">Sensors and actuators</a></li>
-                  <li><a href="https://github.com/szmoore/MCTX3420/wiki/Software:-Pin-Access" target="_blank">Pin access</a></li>
-                  <li><a href="https://github.com/szmoore/MCTX3420/wiki/Software:-Image-Processing" target="_blank">Image processing</a></li>
-                </ul>
-              </li>
-              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Software:-Terminology" target="_blank">Terminology</a></li>
-            </ul>
-          </div>
-
-          <div class="widget">
-            <div class="title">Project Wiki</div>
-            <p>All of the project's help documentation is stored in its <a href="https://github.com/szmoore/MCTX3420/wiki" target="_blank">GitHub wiki.</a> This git repository also
-              stores all of the software code for the project; to access the project code files, visit <a href="https://github.com/szmoore/MCTX3420" target="_blank">this link</a>.</p>
-            <p>The following is a list of pages on the GitHub wiki (all of which can be accessed via the categories above):<p>
-            <ul>
-              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Getting-Started:-Data-Processing" target="_blank">Getting Started: Data Processing</a></li>
-              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Getting-Started:-Run-an-Experiment" target="_blank">Getting Started: Run an Experiment</a></li>
-              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Getting-Started:-View-Old-Experiments" target="_blank">Getting Started: View Old Experiments</a></li>
-              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Getting-Started:-Web-Interface" target="_blank">Getting Started: Web Interface</a></li>
-              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Hardware:-BeagleBone" target="_blank">Hardware: BeagleBone</a></li>
-              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Hardware:-Case" target="_blank">Hardware: Case</a></li>
-              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Hardware:-Electronics" target="_blank">Hardware: Electronics</a></li>
-              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Hardware:-Mounting" target="_blank">Hardware: Mounting</a></li>
-              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Hardware:-Pneumatics" target="_blank">Hardware: Pneumatics</a></li>
-              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Hardware:-Sensors" target="_blank">Hardware: Sensors</a></li>
-              <li><a href="https://github.com/szmoore/MCTX3420/wiki" target="_blank">Home</a>
-              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Software:-Browser-Interface" target="_blank">Software: Browser Interface</a></li>
-              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Software:-Data-Handling" target="_blank">Software: Data Handling</a></li>
-              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Software:-Image-Processing" target="_blank">Software: Image Processing</a></li>
-              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Software:-Overview" target="_blank">Software: Overview</a></li>
-              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Software:-Pin-Access" target="_blank">Software: Pin Access</a></li>
-              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Software:-Sensors-&amp;-Actuators" target="_blank">Software: Sensors &amp; Actuators</a></li>
-              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Software:-Server-API" target="_blank">Software: Server API</a></li>
-              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Software:-Server-Code" target="_blank">Software: Server Code</a></li>
-              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Software:-Terminology" target="_blank">Software: Terminology</a></li>
-              <li><a href="https://github.com/szmoore/MCTX3420/wiki/System-Overview" target="_blank">System Overview</a></li>
-              <li><a href="https://github.com/szmoore/MCTX3420/wiki/System-Safety" target="_blank">System Safety</a></li>
-            </ul>
-          </div>
-        </div>
-        <!-- End main content -->
-      </div>
-    </div>
-  </body>
-</html>
diff --git a/testing/MCTXWeb/public_html/help.html b/testing/MCTXWeb/public_html/help.html
new file mode 100644 (file)
index 0000000..49eef7c
--- /dev/null
@@ -0,0 +1,187 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+  <head>
+    <title>MCTX3420 Web Interface</title>
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+    <script type="text/javascript" src="static/jquery-1.10.1.min.js"></script>
+    <script type="text/javascript" src="static/mctx.gui.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">
+      runBeforeLoad().done(function() {
+        $(document).ready(function() {
+          //Show the content!
+          $("#content").css("display", "block");
+          //Set the welcome bar
+          var name = " " + (mctx.friendlyName ? mctx.friendlyName : "");
+          $("#welcome-container").text("Welcome" + name + "!");
+          $("#logout-container").css("display", "block");
+          //$("#menu-container").populateNavbar();
+
+          $("#logout").click(function() {
+            $("#logout").logout();
+          });
+
+          $("#main_controls").submit(function() {
+            //Validate!
+            return false;
+          });
+
+          $("#errorlog").setErrorLog();
+        });
+      })
+
+    </script>
+  </head>
+
+  <body>
+    <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">Exploding Cans</span>
+        </div>
+        <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>
+    <!-- End header -->
+
+    <div id="content-wrap">
+      <div id="content">
+        <div id="sidebar">
+          <div class="widget">
+            <div class="title">Navigation menu</div>
+            <div 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="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 justify">
+            <div class="title">Tutorials</div>
+            <p class="justify">For general information on using the MCTX project web interface (i.e. this webpage!) see the <b>'Tutorials'</b> section.
+              This will guide you through setting up, running and analysing an experiment with basic tutorials and explanation of the possible options.</p>
+          </div>
+          <div class="widget justify">
+            <div class="title">Experiment Hardware</div>
+            <p class="justify">For detailed technical information about the experiment hardware, including system diagrams, datasheets and run-downs of the components,
+              see the <b>'Hardware'</b> section.</p>
+          </div>
+          <div class="widget justify">
+            <div class="title">Experiment Software</div>
+            <p class="justify">For detailed technical information about the experiment software, including explanations of its structure, functions and so on, see the
+              <b>'Software'</b> section. Actual code can be accessed on the project's GitHub: <a href="https://github.com/szmoore/MCTX3420">MCTX3420</a>.</p>
+          </div>
+          <div class="widget justify">
+            <div class="title">Contact</div>
+            <p class="justify">If you would like more information about the project or require additional assistance, please contact:</p>
+            <p><b>Adrian Keating</b></p>
+            <p><b>Adam Wittek</b></p>
+          </div>
+        </div>
+        <!-- End sidebar -->
+
+        <div id="main">
+          <div class="widget">
+            <div class="title">Getting Started</div>
+            <p class="justify">Welcome to the MCTX3420 project documentation! On this page, you will find help on how to use the project software,
+              as well as information about the various hardware components.</p>
+            <p class="justify">For a basic introduction to using the experiment, see <b>'Tutorials'</b>.
+              <a href="https://github.com/szmoore/MCTX3420/wiki/System-Overview" target="_blank">System overview</a> provides a general overview of the experiment's hardware, while
+              <a href="https://github.com/szmoore/MCTX3420/wiki/Getting-Started:-Web-Interface" target="_blank">Using the web interface</a> provides a tutorial on using the the project software.
+              For detailed information about the experiment hardware, see the <b>'Hardware'</b> section. For detailed information about the project software,
+              see the <b>'Software'</b> section.</p>
+            <div class="sub-title">Tutorials</div>
+            <ul>
+              <li><a href="https://github.com/szmoore/MCTX3420/wiki/System-Overview" target="_blank">System overview</a></li>
+              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Getting-Started:-Web-Interface" target="_blank">Using the web interface</a></li>
+              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Getting-Started:-Run-an-Experiment" target="_blank">Running an experiment</a></li>
+              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Getting-Started:-View-Old-Experiments" target="_blank">Viewing previous experiments</a></li>
+              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Getting-Started:-Data-Processing" target="_blank">Data processing</a></li>
+              <li><a href="https://github.com/szmoore/MCTX3420/wiki/System-Safety" target="_blank">System safety</a></li>
+            </ul>
+            <div class="sub-title">Hardware</div>
+            <ul>
+              <li><a href="https://github.com/szmoore/MCTX3420/wiki/System-Overview" target="_blank">System overview</a></li>
+              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Hardware:-Electronics" target="_blank">Electronics</a></li>
+              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Hardware:-BeagleBone" target="_blank">BeagleBone</a></li>
+              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Hardware:-Pneumatics" target="_blank">Pneumatics</a></li>
+              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Hardware:-Sensors" target="_blank">Sensors</a></li>
+              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Hardware:-Mounting" target="_blank">Mounting</a></li>
+              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Hardware:-Case" target="_blank">Case</a></li>
+            </ul>
+            <div class="sub-title">Software</div>
+            <ul>
+              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Software:-Overview" target="_blank">Software overview</a></li>
+              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Software:-Browser-Interface" target="_blank">Browser interface</a></li>
+              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Software:-Server-API" target="_blank">Server API</a></li>
+              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Software:-Server-Code" target="_blank">Server code</a>
+                <ul>
+                  <li><a href="https://github.com/szmoore/MCTX3420/wiki/Software:-Data-Handling" target="_blank">Data handling</a></li>
+                  <li><a href="https://github.com/szmoore/MCTX3420/wiki/Software:-Sensors-&amp;-Actuators" target="_blank">Sensors and actuators</a></li>
+                  <li><a href="https://github.com/szmoore/MCTX3420/wiki/Software:-Pin-Access" target="_blank">Pin access</a></li>
+                  <li><a href="https://github.com/szmoore/MCTX3420/wiki/Software:-Image-Processing" target="_blank">Image processing</a></li>
+                </ul>
+              </li>
+              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Software:-Terminology" target="_blank">Terminology</a></li>
+            </ul>
+          </div>
+
+          <div class="widget">
+            <div class="title">Project Wiki</div>
+            <p>All of the project's help documentation is stored in its <a href="https://github.com/szmoore/MCTX3420/wiki" target="_blank">GitHub wiki.</a> This git repository also
+              stores all of the software code for the project; to access the project code files, visit <a href="https://github.com/szmoore/MCTX3420" target="_blank">this link</a>.</p>
+            <p>The following is a list of pages on the GitHub wiki (all of which can be accessed via the categories above):<p>
+            <ul>
+              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Getting-Started:-Data-Processing" target="_blank">Getting Started: Data Processing</a></li>
+              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Getting-Started:-Run-an-Experiment" target="_blank">Getting Started: Run an Experiment</a></li>
+              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Getting-Started:-View-Old-Experiments" target="_blank">Getting Started: View Old Experiments</a></li>
+              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Getting-Started:-Web-Interface" target="_blank">Getting Started: Web Interface</a></li>
+              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Hardware:-BeagleBone" target="_blank">Hardware: BeagleBone</a></li>
+              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Hardware:-Case" target="_blank">Hardware: Case</a></li>
+              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Hardware:-Electronics" target="_blank">Hardware: Electronics</a></li>
+              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Hardware:-Mounting" target="_blank">Hardware: Mounting</a></li>
+              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Hardware:-Pneumatics" target="_blank">Hardware: Pneumatics</a></li>
+              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Hardware:-Sensors" target="_blank">Hardware: Sensors</a></li>
+              <li><a href="https://github.com/szmoore/MCTX3420/wiki" target="_blank">Home</a>
+              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Software:-Browser-Interface" target="_blank">Software: Browser Interface</a></li>
+              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Software:-Data-Handling" target="_blank">Software: Data Handling</a></li>
+              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Software:-Image-Processing" target="_blank">Software: Image Processing</a></li>
+              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Software:-Overview" target="_blank">Software: Overview</a></li>
+              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Software:-Pin-Access" target="_blank">Software: Pin Access</a></li>
+              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Software:-Sensors-&amp;-Actuators" target="_blank">Software: Sensors &amp; Actuators</a></li>
+              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Software:-Server-API" target="_blank">Software: Server API</a></li>
+              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Software:-Server-Code" target="_blank">Software: Server Code</a></li>
+              <li><a href="https://github.com/szmoore/MCTX3420/wiki/Software:-Terminology" target="_blank">Software: Terminology</a></li>
+              <li><a href="https://github.com/szmoore/MCTX3420/wiki/System-Overview" target="_blank">System Overview</a></li>
+              <li><a href="https://github.com/szmoore/MCTX3420/wiki/System-Safety" target="_blank">System Safety</a></li>
+            </ul>
+          </div>
+        </div>
+        <!-- End main content -->
+      </div>
+    </div>
+  </body>
+</html>
index 4ffacec..ff9b733 100644 (file)
            $("#logout").logout();
          });
        });       
-      })
+      }).always(function () {
+        $(document).ready(function () {
+          //$("#sidebar-menu").populateNavMenu();
+        });
+      });
 
     </script>
   </head>
         <div id="sidebar">
           <div class="widget">
             <div class="title">Navigation menu</div>
-            <div class="nav-menu">
+            <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="data.html"><span>Experiment data</span></a></li>
                <li><a href="pintest.html"><span>Pin debugging</span></a></li>
-               <li class="last"><a href="#"><span>Help</span></a></li>
+               <li class="last"><a href="help.html"><span>Help</span></a></li>
             </ul>
             </div>
           </div>
index fbc9411..ba7f742 100644 (file)
             <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="data.html"><span>Experiment data</span></a></li>
                <li><a href="pintest.html"><span>Pin debugging</span></a></li>
-               <li class="last"><a href="#"><span>Help</span></a></li>
+               <li class="last"><a href="help.html"><span>Help</span></a></li>
             </ul>
             </div>
           </div>
index 773fa23..c609ef5 100644 (file)
@@ -1,12 +1,12 @@
 /**
- * MCTX3420 2013 GUI stuff.
- * Coding style:
- *  - Always end statements with semicolons
- *  - Egyptian brackets are highly recommended (*cough*).
- *  - Don't use synchronous stuff - hook events into callbacks
- *  - $.fn functions should return either themselves or some useful object
- *    to allow for chaining of method calls
- */
+* MCTX3420 2013 GUI stuff.
+* Coding style:
+*  - Always end statements with semicolons
+*  - Egyptian brackets are highly recommended (*cough*).
+*  - Don't use synchronous stuff - hook events into callbacks
+*  - $.fn functions should return either themselves or some useful object
+*    to allow for chaining of method calls
+*/
 
 mctx = {};
 //Don't use this in the final version
@@ -18,33 +18,40 @@ mctx.expected_api_version = 0;
 mctx.has_control = false;
 mctx.debug = true;
 
+mctx.menu = [
+    {'text' : 'Home', href : mctx.location + 'index.html'},
+    {'text' : 'Experiment control', href : mctx.location + 'control.html'},
+    {'text' : 'Pin debugging', href : mctx.location + 'pintest.html'},
+    {'text' : 'Help', href : mctx.location + 'help.html'}
+];
+
 mctx.statusCodes = {
-  STATUS_OK : 1
+    STATUS_OK : 1
 };
 
 mctx.statusCodesDescription = {
-  "1" : "Ok",
-  "-1" : "General error",
-  "-2" : "Unauthorized",
-  "-3" : "Not running",
-  "-4" : "Already exists"
+    "1" : "Ok",
+    "-1" : "General error",
+    "-2" : "Unauthorized",
+    "-3" : "Not running",
+    "-4" : "Already exists"
 };
 
 mctx.sensors = {
-  0 : {name : "Strain gauge 1"},
-  1 : {name : "Strain gauge 2"},
-  2 : {name : "Strain gauge 3"},
-  3 : {name : "Strain gauge 4"},
-  4 : {name : "Pressure sensor 1"},
-  5 : {name : "Pressure sensor 2"},
-  6 : {name : "Pressure sensor 3"}
+    0 : {name : "Strain gauge 1"},
+    1 : {name : "Strain gauge 2"},
+    2 : {name : "Strain gauge 3"},
+    3 : {name : "Strain gauge 4"},
+    4 : {name : "Pressure sensor 1"},
+    5 : {name : "Pressure sensor 2"},
+    6 : {name : "Pressure sensor 3"}
 };
 
 mctx.actuators = {
-  0 : {name : "Solenoid 1"},
-  1 : {name : "Solenoid 2"},
-  2 : {name : "Solenoid 3"},
-  3 : {name : "Pressure regulator"}
+    0 : {name : "Solenoid 1"},
+    1 : {name : "Solenoid 2"},
+    2 : {name : "Solenoid 3"},
+    3 : {name : "Pressure regulator"}
 };
 
 mctx.strain_gauges = {};
@@ -52,257 +59,231 @@ mctx.strain_gauges.ids = [0, 1, 2, 3];
 mctx.strain_gauges.time_limit = 20;
 
 /**
- * Logs a message if mctx.debug is enabled. This function takes
- * a variable number of arguments and passes them 
- * to alert or console.log (based on browser support).
- * @returns {undefined}
- */
+* Logs a message if mctx.debug is enabled. This function takes
+* a variable number of arguments and passes them 
+* to alert or console.log (based on browser support).
+* @returns {undefined}
+*/
 function debugLog () {
-  if (mctx.debug) {
-    if (typeof console === "undefined" || typeof console.log === "undefined") {
-      for (var i = 0; i < arguments.length; i++) {
-        alert(arguments[i]);
-      }
-    } else {
-      console.log.apply(this, arguments);
+    if (mctx.debug) {
+        if (typeof console === "undefined" || typeof console.log === "undefined") {
+            for (var i = 0; i < arguments.length; i++) {
+                alert(arguments[i]);
+            }
+        } else {
+            console.log.apply(this, arguments);
+        }
     }
-  }
 }
 
 /**
- * Writes the current date to wherever it's called.
- */
+* Writes the current date to wherever it's called.
+*/
 function getDate() {
-       document.write((new Date()).toDateString());
+    document.write((new Date()).toDateString());
 }
 
 /**
- * Should be run before the load of any GUI page.
- * To hook events to be called after this function runs,
- * use the 'always' method, e.g runBeforeLoad().always(function() {my stuff});
- * @param {type} isLoginPage
- * @returns The return value of calling $.ajax
- */
+* Should be run before the load of any GUI page.
+* To hook events to be called after this function runs,
+* use the 'always' method, e.g runBeforeLoad().always(function() {my stuff});
+* @param {type} isLoginPage
+* @returns The return value of calling $.ajax
+*/
 function runBeforeLoad(isLoginPage) {
-  return $.ajax({
-    url : mctx.api + "identify"
-  }).done(function (data) {
-    if (data.logged_in && isLoginPage) {
-      if (mctx.debug) {
-        debugLog("Redirect disabled!");
-      } else {
-        window.location = mctx.location;
-      }
-    } else if (!data.logged_in && !isLoginPage) {
-      if (mctx.debug) {
-        debugLog("Redirect disabled!");
-      } else {
-        //Note: this only clears the nameless cookie
-        document.cookie = ""; 
-        window.location = mctx.location + "login.html";
-      }
-    } else {
-      mctx.friendlyName = data.friendly_name;
-    }
-  }).fail(function (jqHXR) {
-    if (mctx.debug) {
-      debugLog("Failed to ident server. Is API running?")
-    } else if (!isLoginPage) {
-      window.location = mctx.location + "login.html";
-    }
-  });
+    return $.ajax({
+        url : mctx.api + "identify"
+    }).done(function (data) {
+        if (data.logged_in && isLoginPage) {
+            if (mctx.debug) {
+                debugLog("Redirect disabled!");
+            } else {
+                window.location = mctx.location;
+            }
+        } else if (!data.logged_in && !isLoginPage) {
+            if (mctx.debug) {
+                debugLog("Redirect disabled!");
+            } else {
+                //Note: this only clears the nameless cookie
+                document.cookie = ""; 
+                window.location = mctx.location + "login.html";
+            }
+        } else {
+            mctx.friendlyName = data.friendly_name;
+        }
+    }).fail(function (jqHXR) {
+        if (mctx.debug) {
+            debugLog("Failed to ident server. Is API running?")
+        } else if (!isLoginPage) {
+            window.location = mctx.location + "login.html";
+        }
+    }).always(function () {
+        
+    });
 }
 
 /**
- * Populates a submenu of the navigation bar
- * @param {string} header The header
- * @param {object} items An object representing the submenu items
- * @param {function} translator A function that translates an object item
- *                              into a text and href.
- * @returns {$.fn} Itself
- */
-$.fn.populateSubmenu = function(header, items, translator) {
-  var submenuHeader = $("<li/>").append($("<a/>", {text : header, href : "#"}));
-  var submenu = $("<ul/>", {"class" : "submenu"});
-  
-  for (var item in items) {
-    var info = translator(item, items);
-    submenu.append($("<li/>").append(
-          $("<a/>", {text : info.text, 
-                     href : info.href, target : "_blank"})
-    ));
-  }
-  
-  this.append(submenuHeader.append(submenu));
-  return this;
-};
-
-/** 
- * Populates the navigation bar
+ * Populates the navigation menu.
  */
-$.fn.populateNavbar = function () {
-  var menu = $("<ul/>", {"class" : "menu"});
-  var sensorTranslator = function(item, items) {
-    var href = mctx.api + "sensors?start_time=0&format=tsv&id=" + item;
-    return {text : items[item].name, href : href};
-  };
-  var actuatorTranslator = function(item, items) {
-    var href = mctx.api + "actuators?start_time=0&format=tsv&id=" + item;
-    return {text : items[item].name, href : href};
-  };
-  
-  menu.populateSubmenu("Sensor data", mctx.sensors, sensorTranslator);
-  menu.populateSubmenu("Actuator data", mctx.actuators, actuatorTranslator);
-  menu.appendTo(this);
-  return this;
+$.fn.populateNavMenu = function() {
+    var root = $("<ul/>")
+    for (var i = 0; i < mctx.menu.length; i++) {
+        var item = mctx.menu[i];
+        var entry = $("<li/>").append(
+            $("<a/>", {text : item.text, href: item.href})
+        );
+        root.append(entry);
+    }
+    $(this).append(root);
+    return this;
 }
 
 /**
- * Sets the camera autoupdater
- * Obsolete?
- * @returns {$.fn}
- */
+* Sets the camera autoupdater
+* Obsolete?
+* @returns {$.fn}
+*/
 $.fn.setCamera = function () {
-  var url = mctx.api + "image";  //http://beaglebone/api/image
-  var update = true;
+    var url = mctx.api + "image";  //http://beaglebone/api/image
+    var update = true;
 
-  //Stop updating if we can't retrieve an image!
-  this.error(function() {
-    update = false;
-  });
-  
-  var parent = this;
-  
-  var updater = function() {
-    if (!update) {
-      alert("Cam fail");
-      parent.attr("src", "");
-      return;
-    }
-    
-    parent.attr("src", url + "#" + (new Date()).getTime());
-    
-    setTimeout(updater, 1000);
-  };
-  
-  updater();
-  return this;
+    //Stop updating if we can't retrieve an image!
+    this.error(function() {
+        update = false;
+    });
+
+    var parent = this;
+
+    var updater = function() {
+        if (!update) {
+            alert("Cam fail");
+            parent.attr("src", "");
+            return;
+        }
+        
+        parent.attr("src", url + "#" + (new Date()).getTime());
+        
+        setTimeout(updater, 10000);
+    };
+
+    updater();
+    return this;
 };
 
 /**
- * Sets the strain graphs to graph stuff. Obsolete?
- * @returns {$.fn}
- */
+* Sets the strain graphs to graph stuff. Obsolete?
+* @returns {$.fn}
+*/
 $.fn.setStrainGraphs = function () {
-  var sensor_url = mctx.api + "sensors";
-  var graphdiv = this;
-  
-  var updater = function () {
-    var time_limit = mctx.strain_gauges.time_limit;
-    var responses = new Array(mctx.strain_gauges.ids.length);
-    
-    for (var i = 0; i < mctx.strain_gauges.ids.length; i++) {
-      var parameters = {id : i, start_time: -time_limit};
-      responses[i] = $.ajax({url : sensor_url, data : parameters});
-    }
-    
-    $.when.apply(this, responses).then(function () {
-      var data = new Array(arguments.length);
-      for (var i = 0; i < arguments.length; i++) {
-        var raw_data = arguments[i][0].data;
-        var pruned_data = [];
-        var step = ~~(raw_data.length/100);
-        for (var j = 0; j < raw_data.length; j += step)
-          pruned_data.push(raw_data[j]); 
-        data[i] = pruned_data;
-      }
-      $.plot(graphdiv, data);
-      setTimeout(updater, 500);
-    }, function () {debugLog("It crashed");});
-  };
-  
-  updater();
-  return this;
+    var sensor_url = mctx.api + "sensors";
+    var graphdiv = this;
+
+    var updater = function () {
+        var time_limit = mctx.strain_gauges.time_limit;
+        var responses = new Array(mctx.strain_gauges.ids.length);
+        
+        for (var i = 0; i < mctx.strain_gauges.ids.length; i++) {
+            var parameters = {id : i, start_time: -time_limit};
+            responses[i] = $.ajax({url : sensor_url, data : parameters});
+        }
+        
+        $.when.apply(this, responses).then(function () {
+            var data = new Array(arguments.length);
+            for (var i = 0; i < arguments.length; i++) {
+                var raw_data = arguments[i][0].data;
+                var pruned_data = [];
+                var step = ~~(raw_data.length/100);
+                for (var j = 0; j < raw_data.length; j += step)
+                pruned_data.push(raw_data[j]); 
+                data[i] = pruned_data;
+            }
+            $.plot(graphdiv, data);
+            setTimeout(updater, 1000);
+        }, function () {debugLog("It crashed");});
+    };
+
+    updater();
+    return this;
 };
 
 /**
- * Performs a login attempt.
- * @returns The AJAX object of the login request */
+* Performs a login attempt.
+* @returns The AJAX object of the login request */
 $.fn.login = function () {
-  var username = this.find("input[name='username']").val();
-  var password = this.find("input[name='pass']").val();
-  var out = this.find("#result");
-  var redirect = function () {
-    window.location.href = mctx.location;
-  };
-  
-  out.removeAttr("class");
-  out.text("Logging in...");
-  
-  return $.ajax({
-    url : mctx.api + "bind",
-    data : {user: username, pass : password}
-  }).done(function (data) {
-    if (data.status < 0) {
-      mctx.has_control = false;
-      out.attr("class", "fail");
-      out.text("Login failed: " + data.description);
-    } else {
-      //todo: error check
-      mctx.has_control = true;
-      out.attr("class", "pass");
-      out.text("Login ok!");
-      setTimeout(redirect, 800);      
-    }
-  }).fail(function (jqXHR) {
-    mctx.has_control = false;
-    out.attr("class", "fail");
-    out.text("Login request failed - connection issues.")
-  });
+    var username = this.find("input[name='username']").val();
+    var password = this.find("input[name='pass']").val();
+    var out = this.find("#result");
+    var redirect = function () {
+        window.location.href = mctx.location;
+    };
+
+    out.removeAttr("class");
+    out.text("Logging in...");
+
+    return $.ajax({
+        url : mctx.api + "bind",
+        data : {user: username, pass : password}
+    }).done(function (data) {
+        if (data.status < 0) {
+            mctx.has_control = false;
+            out.attr("class", "fail");
+            out.text("Login failed: " + data.description);
+        } else {
+            //todo: error check
+            mctx.has_control = true;
+            out.attr("class", "pass");
+            out.text("Login ok!");
+            setTimeout(redirect, 800);      
+        }
+    }).fail(function (jqXHR) {
+        mctx.has_control = false;
+        out.attr("class", "fail");
+        out.text("Login request failed - connection issues.")
+    });
 };
 
 /**
- * Performs a logout request. The nameless cookie is
- * always cleared and the browser redirected to the login page,
- * independent of whether or not logout succeeded.
- * @returns  The AJAX object of the logout request.
- */
+* Performs a logout request. The nameless cookie is
+* always cleared and the browser redirected to the login page,
+* independent of whether or not logout succeeded.
+* @returns  The AJAX object of the logout request.
+*/
 $.fn.logout = function () {
-  return $.ajax({
-    url : mctx.api + "unbind"
-  }).always(function () {
-    //Note: this only clears the nameless cookie
-    document.cookie = ""; 
-    window.location = mctx.location + "login.html";
-  });
+    return $.ajax({
+        url : mctx.api + "unbind"
+    }).always(function () {
+        //Note: this only clears the nameless cookie
+        document.cookie = ""; 
+        window.location = mctx.location + "login.html";
+    });
 };
 
 /**
- * Sets the error log to continuously update.
- * @returns itself */
+* Sets the error log to continuously update.
+* @returns itself */
 $.fn.setErrorLog = function () {
-  var url = mctx.api + "errorlog";
-  var outdiv = this;
-  
-  var updater = function () {
-    $.ajax({url : url}).done(function (data) {
-      outdiv.text(data);
-      outdiv.scrollTop(
-        outdiv[0].scrollHeight - outdiv.height()
-      );
-      setTimeout(updater, 2000);
-    }).fail(function (jqXHR) {
-      if (jqXHR.status === 502 || jqXHR.status === 0) {
-        outdiv.text("Failed to retrieve the error log.");
-      }
-      setTimeout(updater, 4000);
-    });
-  };
-  
-  updater();
-  return this;
+    var url = mctx.api + "errorlog";
+    var outdiv = this;
+
+    var updater = function () {
+        $.ajax({url : url}).done(function (data) {
+            outdiv.text(data);
+            outdiv.scrollTop(
+            outdiv[0].scrollHeight - outdiv.height()
+            );
+            setTimeout(updater, 3000);
+        }).fail(function (jqXHR) {
+            if (jqXHR.status === 502 || jqXHR.status === 0) {
+                outdiv.text("Failed to retrieve the error log.");
+            }
+            setTimeout(updater, 10000); //poll at slower rate
+        });
+    };
+
+    updater();
+    return this;
 };
 
 $(document).ajaxError(function (event, jqXHR) {
-  //console.log("AJAX query failed with: " + jqXHR.status + " (" + jqXHR.statusText + ")");
+    //console.log("AJAX query failed with: " + jqXHR.status + " (" + jqXHR.statusText + ")");
 });
\ No newline at end of file
index e9a8623..22f20d1 100644 (file)
@@ -196,7 +196,7 @@ input[type="text"]:focus, input[type="password"]:focus {
 
 #sidebar{
   float: left;
-  max-width: 26%;
+  width: 240px;
 }
 
 #sidebar .title {

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