Mercurial > hg > human-echolocation-java-webapp
changeset 8:76f809129f98
build file now correctly compiling the TestEchoClass; the TestEchoClass now calls the matlab function with the output filename arg.
author | luisf <luis.figueira@eecs.qmul.ac.uk> |
---|---|
date | Fri, 29 Nov 2013 13:04:29 +0000 |
parents | 81cbea09cc75 |
children | 1eb7ec525d3c |
files | build.xml webapp/WEB-INF/src/HumanEchoServlet.java webapp/WEB-INF/src/TestEchoClass.java |
diffstat | 3 files changed, 19 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/build.xml Thu Nov 28 11:30:56 2013 +0000 +++ b/build.xml Fri Nov 29 13:04:29 2013 +0000 @@ -1,13 +1,14 @@ -<project name="EchoWebApp" default="compile-matlab" basedir="."> +<project name="EchoWebApp" default="build" basedir="."> <description> Simple build file for the EchoLocation WebApp. </description> <!-- set global properties for this build --> - <property name="matlab-src" location="webapp/WEB-INF/mcode"/> + <property name="matlab-src" location="webapp/WEB-INF/mcode/human-echolocation"/> <property name="matlab-build" location="scratch"/> <property name="lib" location="webapp/WEB-INF/lib"/> - <property name="compile-test" location="webapp/WEB-INF/lib"/> + <property name="src" location="webapp/WEB-INF/src"/> + <property name="classes" location="webapp/WEB-INF/classes"/> <property name="dist" location="dist"/> @@ -33,10 +34,13 @@ <!-- Copy the generated jar to the lib folder --> <copy file="${matlab-build}/isvr.jar" tofile="${lib}/isvr.jar" overwrite="true" /> - </target> - <target name="dist" depends="compile-matlab" + <target name="build" depends="compile-matlab" > + <javac srcdir="${src}" destdir="${classes}" classpath="servlet-api.jar:${lib}/javabuilder.jar:${lib}/isvr.jar"/> + </target> + + <target name="dist" depends="build" description="generate the distribution" > <!-- Create the distribution directory --> <mkdir dir="${dist}/lib"/> @@ -51,4 +55,4 @@ <delete dir="${build}"/> <delete dir="${dist}"/> </target> -</project> \ No newline at end of file +</project>
--- a/webapp/WEB-INF/src/HumanEchoServlet.java Thu Nov 28 11:30:56 2013 +0000 +++ b/webapp/WEB-INF/src/HumanEchoServlet.java Fri Nov 29 13:04:29 2013 +0000 @@ -41,7 +41,7 @@ // double[][] square = new double[0][]; // WebFigure figure = null; - +/* try { // refers to the mcode function gen_echo.m Object[] result = echo.gen_echo(1, test); @@ -72,5 +72,6 @@ buffer.append("</TABLE>"); buffer.append("<BR>"); response.getOutputStream().print(buffer.toString()); +*/ } }
--- a/webapp/WEB-INF/src/TestEchoClass.java Thu Nov 28 11:30:56 2013 +0000 +++ b/webapp/WEB-INF/src/TestEchoClass.java Fri Nov 29 13:04:29 2013 +0000 @@ -20,21 +20,22 @@ try { echo = new HumanEcho(); + // Matlab structure: + // Input = struct('dist', 0.9, 'azim', 0, 'orient', 'horz', 'dirweight', 0.2, 'outputfname', 'foo.wav') - // Matlab structure: - // Input = struct('dist', 0.9, 'azim', 0, 'orient', 'horz', 'dirweight', 0.2) - - String[] InputStructFields = {"dist", "azim", "orient", "dirweight"}; + String[] InputStructFields = {"dist", "azim", "orient", "dirweight", "outputfname"}; Input = new MWStructArray(1, 1, InputStructFields); Input.set("dist", 1, Double.valueOf(0.9)); Input.set("azim", 1, Double.valueOf(0)); Input.set("orient", 1, "horz"); Input.set("dirweight", 1, Double.valueOf(0.2)); + Input.set("outputfname", 1, "yeah.wav"); + Object[] result = echo.simulateBinauralSignals(Input); - MWNumericArray array = (MWNumericArray)result[0]; - //square = (double[][])array.toArray(); + // MWNumericArray array = (MWNumericArray)result[0]; + // square = (double[][])array.toArray(); } catch(MWException e) {