+<!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">
+ <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>
+ <!-- End header -->
+
+ <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>
+ <form>
+ <td>Graphs</td>
+ <td>
+ <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>
+ </td>
+ </form>
+ </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>
+ <form>
+ <td>Graphs</td>
+ <td>
+ <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>
+ </td>
+ </form>
+ </tr>
+ </table>
+ <img src="current/nograph.png" id="g2">
+ </div>
+ </div>
+ <!-- End main content -->
+
+ </div>
+ </body>
+</html>