Mercurial > hg > human-echolocation-java-webapp
diff src/HumanEchoServlet.java @ 47:398a53b30079
Fixes to struct fields
author | Chris Cannam |
---|---|
date | Fri, 28 Feb 2014 15:37:02 +0000 |
parents | 84d02afe28e6 |
children | ebfb3b91fb06 |
line wrap: on
line diff
--- a/src/HumanEchoServlet.java Fri Feb 28 13:41:45 2014 +0000 +++ b/src/HumanEchoServlet.java Fri Feb 28 15:37:02 2014 +0000 @@ -79,6 +79,8 @@ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + System.err.println("In doGet"); + // todo: validate/normalise distance int dist = Integer.parseInt(request.getParameter("dist")); @@ -90,7 +92,7 @@ String outputfname = new String(); - System.err.println("In doGet"); + System.err.println("Got dist and azim"); try { //!!! erch, shouldn't be creating a new one on each request as well as a global one @@ -103,15 +105,15 @@ System.err.println(System.getProperty("catalina.base")); // Matlab structure: - // Input = struct('dist', 0.9, 'azim', 0, 'orient', 'horz', 'dirweight', 0.2, 'outputfname', 'foo.wav') + // Input = struct('dist', 0.9, 'azim', 0, 'orient', 'horz', 'dirweight', 0.2, 'outdir', '/tmp/wav', 'outname', 'foo.wav') - String[] InputStructFields = {"dist", "azim", "orient", "dirweight", "outputfname"}; + String[] InputStructFields = {"dist", "azim", "orient", "dirweight", "outdir", "outname"}; + Input = new MWStructArray(1, 1, InputStructFields); Input.set("dist", 1, Double.valueOf(dist)); Input.set("azim", 1, Double.valueOf(azim)); Input.set("orient", 1, "horz"); Input.set("dirweight", 1, Double.valueOf(0.2)); - Input.set("outdir", 1, wavdir); // the ofname should depend on the parameters