comparison WebContent/index.jsp @ 42:65a26b38bf43

Some debug output, and work toward neatening the jsp &c
author Chris Cannam
date Tue, 25 Feb 2014 16:46:12 +0000
parents b31c64b316c5
children 9be81b43142b
comparison
equal deleted inserted replaced
40:65338d2507bc 42:65a26b38bf43
1 <%@ page contentType="text/html;charset=UTF-8" language="java" %> 1 <%@ page contentType="text/html;charset=UTF-8" language="java" %>
2 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 2 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
3 <html> 3 <html>
4 <head> 4 <head>
5 <title>Human Echolocation</title> 5 <title>Human Echolocation</title>
6 <link rel="Stylesheet" type="text/css" media=all href="./StyleSheet.css" /> 6 <link href="http://fonts.googleapis.com/css?family=Mako" rel="stylesheet" type="text/css">
7 <link href="StyleSheet.css" rel="stylesheet" type="text/css" /> 7 <link href="screen.css" rel="stylesheet" type="text/css" />
8 8
9 <!-- no default value for distance --> 9 <!-- no default value for distance -->
10 <c:choose> 10 <c:choose>
11 <c:when test="${not empty param.dist}"> 11 <c:when test="${not empty param.dist}">
12 <c:set var="dist" value="${param.dist}" /> 12 <c:set var="dist" value="${param.dist}" />
13 <c:set var="distSet" value="true" /> 13 <c:set var="distSet" value="true" />
14 </c:when> 14 </c:when>
15 <c:otherwise> 15 <c:otherwise>
16 <c:set var="distSet" value="false" /> 16 <c:set var="distSet" value="false" />
17 </c:otherwise> 17 </c:otherwise>
18 </c:choose> 18 </c:choose>
19 19
20 <!-- Default values for remaining parameters --> 20 <!-- Default values for remaining parameters -->
21 <c:set var="azim" value="0" /> 21 <c:set var="azim" value="0" />
22 <c:set var="dirweight" value="0.2" /> 22 <c:set var="dirweight" value="0.2" />
23 <c:set var="orient" value="horz" /> 23 <c:set var="orient" value="horz" />
24 24
25 <c:if test="${not empty param.azim}"> 25 <c:if test="${not empty param.azim}">
26 <c:set var="azim" value="${param.azim}" /> 26 <c:set var="azim" value="${param.azim}" />
27 </c:if> 27 </c:if>
28 <c:if test="${not empty param.dirweight}"> 28 <c:if test="${not empty param.dirweight}">
29 <c:set var="dirweight" value="${param.dirweight}" /> 29 <c:set var="dirweight" value="${param.dirweight}" />
30 </c:if> 30 </c:if>
31 <c:if test="${not empty param.orient}"> 31 <c:if test="${not empty param.orient}">
32 <c:set var="orient" value="${param.orient}" /> 32 <c:set var="orient" value="${param.orient}" />
33 </c:if> 33 </c:if>
34 34
35 </head> 35 </head>
36 36
37 <body> 37 <body>
38 <form action="index.jsp" method="get"> 38 <!-- NB the form submits back to this very page -->
39 <div style="text-align: center"> 39 <form action="index.jsp" method="get">
40 <table width="760" cellpadding="0" cellspacing="0"> 40 <table width="100%" cellpadding="0" cellspacing="0">
41 <tr> 41 <tr>
42 <td><img src="header_bg.jpg" alt="Header Image Not Found" width="779" height="72" /></td> 42 <td align="right"><img src="soton-logo.png" alt="University of Southampton"/></td>
43 </tr> 43 </tr>
44 </table> 44 </table>
45 <br /> 45 <br />
46
47 <h1>Human Echolocation WebApp Test Page</h1>
48
49 <h2>Simulated environment</h2>
50 <table>
51 <tr>
52 <th>Distance<br>
53 <span class="description">In metres. Typical value: 0.9</span>
54 </th>
55 <td><input type="text" name="dist" size="8" value="${dist}"></td>
56 </tr>
57 <tr>
58 <th>Azimuth<br>
59 <span class="description">-17 to +17</span>
60 </th>
61 <td><input type="text" name="azim" size="8" value="${azim}" ></td>
62 </tr>
63 <tr>
64 <th>Orientation</th>
65 <td>
66 <input type="radio" name="orient" value="horz" checked> Horizontal<br>
67 <input type="radio" name="orient" value="angled"> Angled
68 </td>
69 </tr>
70 <tr>
71 <th>Dirweight<br>
72 <span class="description">Controls how easy it is to distinguish whether the reflector is to the left or the right (the lower dirweight is, the easier).</span>
73 </th>
74 <td>
75 <input type="text" name="dirweight" size="8" value="${dirweight}">
76 <br />
77 </td>
78 </tr>
79 <tr>
80 <td></td>
81 <td>
82 <input type="submit" value="Generate audio">
83 </td>
84 </tr>
85 </table>
86 </form>
46 87
47 <h1>Human Echolocation WebApp Example Page</h1> 88 <div class="player">
89 <c:choose>
90 <c:when test="${distSet==true}">
91 <embed src="/echoapp/HumanEcho?dist=<c:out value="${dist}"/>&amp;azim=<c:out value="${azim}"/>&amp;dirweight=<c:out value="${dirweight}"/>&amp;orient=<c:out value="${orient}"/>" type="audio/x-wav"/>
92 </c:when>
93 <c:otherwise>
94 <c:out value="Please set the distance parameter and select 'Generate audio'"/>
95 </c:otherwise>
96 </c:choose>
97 </div>
98 <br />
48 99
49 Input parameters: 100 <div class="debug">
50 <br /> 101 <h3>Debug info</h3>
51 Distance (typical value: 0.9): 102 <p>
52 <input type="text" name="dist" size="8" value="${dist}"> 103 Distance: <c:out value="${dist}"/>;
53 <br /> 104 Azim: <c:out value="${azim}"/>;
54 Azimuth (-17 to +17): 105 Dirweight: <c:out value="${dirweight}"/>;
55 <input type="text" name="azim" size="8" value="${azim}" > 106 Orient: <c:out value="${orient}"/>
56 <br /> 107 </p>
108 </div>
57 109
58 Orientation:<br> 110 </body>
59 <div align="left"><br>
60 <input type="radio" name="orient" value="horz" checked> Horizontal<br>
61 <input type="radio" name="orient" value="angled"> Angled<br />
62 </div>
63
64
65 Dirweight ():
66 <input type="text" name="dirweight" size="8" value="${dirweight}">
67 <br />
68 <p class="description">Controls how easy it is to distinguish whether the reflector is to the left or the right (the lower .dirweight is, the easier).</p>
69
70 <input type="submit" value="Generate">
71 <br />
72
73 <br />
74 </div>
75 </form>
76
77 <div class="player">
78 <c:choose>
79 <c:when test="${distSet==true}">
80 <embed src="/echoapp/HumanEcho?dist=<c:out value="${dist}"/>&amp;azim=<c:out value="${azim}"/>&amp;dirweight=<c:out value="${dirweight}"/>&amp;orient=<c:out value="${orient}"/>" type="audio/x-wav"/>
81 </c:when>
82 <c:otherwise>
83 <c:out value="Cowardly refusing to generate a player without distance parameter..."/>
84 </c:otherwise>
85 </c:choose>
86 </div>
87 <br />
88
89 <div class="debug">
90 <h3>Debug info</h3>
91 <p>
92 Distance: <c:out value="${dist}"/>;
93 Azim: <c:out value="${azim}"/>;
94 Dirweight: <c:out value="${dirweight}"/>;
95 Orient: <c:out value="${orient}"/>
96 </p>
97 </div>
98
99 </body>
100 </html> 111 </html>
101 112