# HG changeset patch # User Chris Cannam # Date 1393346772 0 # Node ID 65a26b38bf433821ce51a989a92611766947bfd6 # Parent 65338d2507bcd4b8b2a78c8119587690fdba76c8 Some debug output, and work toward neatening the jsp &c diff -r 65338d2507bc -r 65a26b38bf43 .hgignore --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.hgignore Tue Feb 25 16:46:12 2014 +0000 @@ -0,0 +1,2 @@ +syntax: glob +*.class diff -r 65338d2507bc -r 65a26b38bf43 INSTALL.txt --- a/INSTALL.txt Fri Feb 14 15:24:09 2014 +0000 +++ b/INSTALL.txt Tue Feb 25 16:46:12 2014 +0000 @@ -40,7 +40,7 @@ == Building the Web Application (echoapp.war) == -3. Run 'ant build.xml'. This should create the echoapp.war file. In case this fails, follow "Compiling and Generating the echoapp.war file" instructions below. +3. Run 'ant -f build.xml'. This should create the echoapp.war file. In case this fails, follow "Compiling and Generating the echoapp.war file" instructions below. 4. Copy the echoapp.war file to your web server's webapps folder: @@ -55,7 +55,7 @@ == Compiling and Generating the echoapp.war file == -Note: You only need to follow this instructions if run 'ant build.xml' correctly and you were unable to generate the echoapp.war file. The steps described in this section assume that you already have a working version of the isvr.jar package. The isvr.jar file should be located in WebContent/WEB-INF/lib/isvr.jar. +Note: You only need to follow this instructions if run 'ant -f build.xml' correctly and you were unable to generate the echoapp.war file. The steps described in this section assume that you already have a working version of the isvr.jar package. The isvr.jar file should be located in WebContent/WEB-INF/lib/isvr.jar. 1. Copy the deployed component from the scratch folder to the web applications lib folder .\WebContent\WEB-INF\lib @@ -82,7 +82,7 @@ You can only compile the isvr.jar if you have MATLAB and the JavaBuilder toolbox: please check this with you systems administrator. -To compile isvr.jar, simply run 'ant build-isvr.xml'. If this fails you can recompile the MATLAB component by running the following MCC command: +To compile isvr.jar, simply run 'ant -f build-isvr.xml'. If this fails you can recompile the MATLAB component by running the following MCC command: /Applications/MATLAB_R2013b.app/bin/mcc -W "java:uk.ac.soton.isvr,HumanEcho" -d ./scratch -T "link:lib" -v "class{HumanEcho:./WebContent/WEB-INF/mcode/gen_echo.m}" diff -r 65338d2507bc -r 65a26b38bf43 WebContent/WEB-INF/README.txt --- a/WebContent/WEB-INF/README.txt Fri Feb 14 15:24:09 2014 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ -You need to copy the following files to this folder: - -Copy the javabuilder.jar file from your MATLAB or MCR install root in -the directory /toolbox/javabuilder/jar/javabuilder.jar to the web -applications lib folder ./webapp/WEB-INF/lib - - - -You should copy the generated JAR file here: - -cp ./scratch/examples.jar ./webapp/WEB-INF/lib - - - diff -r 65338d2507bc -r 65a26b38bf43 WebContent/WEB-INF/classes/log4j.properties --- a/WebContent/WEB-INF/classes/log4j.properties Fri Feb 14 15:24:09 2014 +0000 +++ b/WebContent/WEB-INF/classes/log4j.properties Tue Feb 25 16:46:12 2014 +0000 @@ -1,5 +1,5 @@ log4j.appender.file=org.apache.log4j.FileAppender -log4j.appender.file.File=${appRootPath}WEB-INF/logs/EchoWebApp.log +log4j.appender.file.File=${appRootPath}/WEB-INF/logs/EchoWebApp.log log4j.appender.file.layout=org.apache.log4j.PatternLayout log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1} - %m%n log4j.appender.file.append=true @@ -7,4 +7,4 @@ # log levels log4j.rootCategory=ALL, file log4j.logger.com.saral=debug -log4j.logger.org.eclipse=debug \ No newline at end of file +log4j.logger.org.eclipse=debug diff -r 65338d2507bc -r 65a26b38bf43 WebContent/header_bg.jpg Binary file WebContent/header_bg.jpg has changed diff -r 65338d2507bc -r 65a26b38bf43 WebContent/index.jsp --- a/WebContent/index.jsp Fri Feb 14 15:24:09 2014 +0000 +++ b/WebContent/index.jsp Tue Feb 25 16:46:12 2014 +0000 @@ -1,101 +1,112 @@ <%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> - - Human Echolocation - - + + Human Echolocation + + - - - - - - - - - - + + + + + + + + + + - - - - + + + + - - - - - - - - - + + + + + + + + + - + - -
-
- - - - -
Header Image Not Found
-
+ + + + + + + +
University of Southampton
+
+ +

Human Echolocation WebApp Test Page

+ +

Simulated environment

+ + + + + + + + + + + + + + + + + + + + + +
Distance
+ In metres. Typical value: 0.9 +
Azimuth
+ -17 to +17 +
Orientation + Horizontal
+ Angled +
Dirweight
+ Controls how easy it is to distinguish whether the reflector is to the left or the right (the lower dirweight is, the easier). +
+ +
+
+ +
+ -

Human Echolocation WebApp Example Page

+
+ + + &azim=&dirweight=&orient=" type="audio/x-wav"/> + + + + + +
+
- Input parameters: -
- Distance (typical value: 0.9): - -
- Azimuth (-17 to +17): - -
+
+

Debug info

+

+ Distance: ; + Azim: ; + Dirweight: ; + Orient: +

+
- Orientation:
-

- Horizontal
- Angled
-
- - - Dirweight (): - -
-

Controls how easy it is to distinguish whether the reflector is to the left or the right (the lower .dirweight is, the easier).

- - -
- -
-
- - -
- - - &azim=&dirweight=&orient=" type="audio/x-wav"/> - - - - - -
-
- -
-

Debug info

-

- Distance: ; - Azim: ; - Dirweight: ; - Orient: -

-
- - + diff -r 65338d2507bc -r 65a26b38bf43 WebContent/screen.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/WebContent/screen.css Tue Feb 25 16:46:12 2014 +0000 @@ -0,0 +1,46 @@ +body { + font-size: 14pt; + font-family: Mako, sans-serif; + background-color: '#fffefa'; +} + +.debug { + border: 0.5px dashed; + font-size: 9pt; + font-family: monospace; + padding: 10 18; +} + +.player { + border: 0.25px solid; +} + +h1 { + text-align: center; +} + +h2 { + margin-left: 8%; +} + +table { + width: 80%; + margin-left: 8%; +} + +th { + vertical-align: top; + text-align: right; + width: 40%; +} + +td { + vertical-align: top; + text-align: left; +} + +th .description { + font-weight: normal; + font-size: 0.9em; +} + diff -r 65338d2507bc -r 65a26b38bf43 WebContent/soton-logo.png Binary file WebContent/soton-logo.png has changed diff -r 65338d2507bc -r 65a26b38bf43 hrir_final.mat Binary file hrir_final.mat has changed diff -r 65338d2507bc -r 65a26b38bf43 src/HumanEchoServlet.java --- a/src/HumanEchoServlet.java Fri Feb 14 15:24:09 2014 +0000 +++ b/src/HumanEchoServlet.java Tue Feb 25 16:46:12 2014 +0000 @@ -32,29 +32,39 @@ private HumanEcho echo; private static Logger logger = Logger.getLogger(HumanEchoServlet.class); - private String tempdir = ""; private String wavdir = ""; public void init(ServletConfig config) throws ServletException { super.init(config); - // reading properties file + System.err.println("In init"); + + logger.error("java.library.path is " + + System.getProperty("java.library.path")); + try { + // Read directory properties Properties properties = new Properties(); - properties.load(Thread.currentThread().getContextClassLoader().getResourceAsStream("myapp.properties")); + properties.load + (Thread.currentThread().getContextClassLoader(). + getResourceAsStream("myapp.properties")); - //get the property value and print it out - tempdir = properties.getProperty("tmpdir"); wavdir = properties.getProperty("outdir"); + System.err.println("WAV file directory is " + wavdir); + } catch (IOException e) { e.printStackTrace(); } try { + // Test that we can construct one of the MATLAB objects + + long before = System.currentTimeMillis(); echo = new HumanEcho(); - } - catch(MWException e) { + long after = System.currentTimeMillis(); + System.err.println("Created a HumanEcho object: it took " + (after - before) + " ms"); + } catch (MWException e) { e.printStackTrace(); } } @@ -62,7 +72,7 @@ public void destroy() { super.destroy(); - if(echo!=null) { + if (echo != null) { echo.dispose(); } } @@ -75,20 +85,22 @@ logger.info("String azim is: " + request.getParameter("azim")); Float azim = Float.parseFloat(request.getParameter("azim")); - - - MWStructArray Input = null; HumanEcho echo; String outputfname = new String(); + System.err.println("In doGet"); + try { + //!!! erch, shouldn't be creating a new one on each request as well as a global one echo = new HumanEcho(); logger.error("We are logging!"); logger.warn(System.getProperty("catalina.base")); + System.err.println("Done some logging"); + System.err.println(System.getProperty("catalina.base")); // Matlab structure: // Input = struct('dist', 0.9, 'azim', 0, 'orient', 'horz', 'dirweight', 0.2, 'outputfname', 'foo.wav')