1b8361f4f1d88c09d2a97c13d2cebf28300f5fdc
[matches/MCTX3420.git] / testing / MCTXWeb / public_html / graph.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/html2canvas.js"></script>
12     
13     <script type="text/javascript" src="static/mctx.gui.js"></script>
14     <script type="text/javascript" src="static/mctx.graph.js"></script>
15     
16     <link rel="stylesheet" type="text/css" href="static/style.css">
17     <link rel="stylesheet" type="text/css" href="static/nav-menu.css">
18     <script type="text/javascript">
19       runBeforeLoad().always(function() {
20         $(document).ready(function() {
21           $("#graph-controls").setDevices();
22         });
23       });
24
25     </script>
26   </head>
27
28   <body>
29     <div id="header-wrap">
30       <div id="header">
31         <div id="leftnav">
32           <a href="http://www.uwa.edu.au/" target="_blank">
33             <img alt = "The University of Western Australia"
34                  src="static/uwacrest-text.png">
35           </a>
36           <span id="title">Exploding Cans</span>
37         </div>
38         <div id="rightnav">
39           <span id="welcome-container">
40           </span>
41           <span id="date">
42             <script type="text/javascript">getDate();</script>
43           </span>
44           <div id="logout-container">
45             <form action="#">
46               <div>
47                 <input type="button" id="logout" value="Logout">
48               </div>
49             </form>
50           </div>
51         </div>
52         <div class="clear"></div>
53       </div>
54     </div>
55     <!-- End header -->
56
57     <div id="content-wrap">
58       <noscript>
59         <div class="widget centre">
60           <div class="title">JavaScript required</div>
61           This website requires JavaScript to function correctly.
62           Please enable JavaScript to use this site.
63         </div>
64       </noscript>
65
66       <div id="content">
67         <div class="widget" id="sidebar-show">&gt;</div>
68         <div id="sidebar">
69           <div class="widget">
70             <div id="sidebar-hide">&lt;</div>
71             <div class="title">Navigation menu</div>
72             <div id="sidebar-menu" class="nav-menu">
73               <ul>
74                 <li><a href="index.html"><span>Home</span></a></li>
75                 <li><a href="control.html"><span>Experiment control</span></a></li>
76                 <li><a href="graph.html"><span>Experiment graphs</span></a></li>
77                 <li><a href="data.html"><span>Experiment data</span></a></li>
78                 <li><a href="pintest.html"><span>Pin debugging</span></a></li>
79                 <li class="last"><a href="help.html"><span>Help</span></a></li>
80               </ul>
81             </div>
82           </div>
83         </div>
84         <!-- End sidebar -->
85
86         <div id="main">
87           <div class="widget" id="graph-widget">
88             <div class="title">Graph</div>
89             <!-- graph placeholder -->
90             <div id="graph-container">
91               <div id="graph" class="plot"></div>
92               <div id="graph-legend"></div>
93             </div>
94           </div>
95           <div class="widget" id="graph-controls">
96             <!--<div class="title">Visualise</div>-->
97             <b>X-Axis</b>
98             <form id="xaxis" class="change">
99               <input type="radio" name="xaxis" alt="time" id="time" checked="checked">
100               <label for="time">time</label>
101             </form>
102             <b>Y-Axis</b>
103             <form id="yaxis" class="change">  </form>
104             <!--b>Right Y-Axis</b>
105             <form id="y2axis" onChange=$("#graph").setGraph()> <input type="radio" name="y2axis" value="none" id="none" checked="yes">none</form>-->
106
107
108             <form id="time_range" class="change">
109               <p> 
110                 Time of Last Update <input type="text" value="" id="current_time" disabled>
111                 Start Time <input type="text" value="" id="start_time"> 
112                 End Time <input type="text" value="" id="end_time">
113               </p>
114             </form>
115
116             <input type="button" value="Run" id="graph-run" onClick="$('#graph-run').runButton()">
117             <input type="button" value="Open New Graph" disabled>
118             <input type="button" value="Save Graph Image" id="saveimage">
119             <input type="button" value="Dump Raw Data" disabled>
120             <script type="text/javascript">
121               $("#saveimage").click(function() {
122                   html2canvas($("#graph-widget")[0], {
123                     onrendered: function(canvas) {
124                       var context = canvas.getContext('2d');
125                       context.webkitImageSmoothingEnabled = false;//webkit
126                       context.mozImageSmoothingEnabled = false;//firefox
127                       context.imageSmoothingEnabled = false;
128                       
129                       window.open(canvas.toDataURL("image/png"));
130                       
131                       /*
132                       var canvasOut = document.createElement("canvas");
133                       var ratio = canvas.height / canvas.width;
134                       var width = 1600;
135                       var height = width * ratio;
136                       canvasOut.setAttribute('width', width);
137                       canvasOut.setAttribute('height', height);
138                       
139                       context = canvasOut.getContext('2d');
140                       context.webkitImageSmoothingEnabled = false;//webkit
141                       context.mozImageSmoothingEnabled = false;//firefox
142                       context.imageSmoothingEnabled = false;
143                       context.drawImage(canvas, 0, 0, canvas.width, canvas.height, 0, 0, width, height);
144                       
145                       window.open(canvasOut.toDataURL("image/png"))*/
146                     }
147                   });
148               });
149             </script>
150             
151             <div id="status-text">&nbsp;</div>
152           </div>
153           
154
155           <!-- TODO: Put this on its own page? 
156             <div class="widget">
157                 <div class="title">Controls</div>
158                 <form id="controls">
159                   <p>Mode: <input type="radio" name="mode" value="normal">Normal
160                         <input type="radio" name="mode" value="explode">EXPLODE! </p>
161                   Filename: <input type="text"> 
162                   <input type="button" value="Stop" id="stopstart">
163                   <input type="button" value="Pause" id="runpause">
164                   <input type="button" value="Load">
165                 </form>
166             </div>
167           -->
168         </div>
169       </div>
170       <!-- End main content -->
171     </div>
172   </body>
173 </html>

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