Revision: 7929
http://playerstage.svn.sourceforge.net/playerstage/?rev=7929&view=rev
Author: asadat
Date: 2009-06-29 19:35:46 +0000 (Mon, 29 Jun 2009)
Log Message:
-----------
added visualization page HOST/sim/viz/get
Modified Paths:
--------------
code/websim/src/req_sim.cc
code/websim/src/websim.cc
code/websim/src/websim.hh
Modified: code/websim/src/req_sim.cc
===================================================================
--- code/websim/src/req_sim.cc 2009-06-29 17:34:12 UTC (rev 7928)
+++ code/websim/src/req_sim.cc 2009-06-29 19:35:46 UTC (rev 7929)
@@ -33,10 +33,23 @@
if(prop == "homepage")
return HandleSimHomepageRequest( action, format, kv, response );
+ if(prop == "viz")
+ return HandleSimVisualizationRequest( action, format, kv, response );
+
response = "ERROR: Unknown property " + prop + " for sim. Candidates are:
children clock factory greet tree.";
return false;
}
+bool WebSim::HandleSimVisualizationRequest( std::string action,
+ Format format,
+ struct evkeyvalq* kv,
+ std::string& response)
+{
+ response = WebSim::vizpage;
+
+ return true;
+}
+
bool WebSim::HandleSimHomepageRequest( std::string action,
Format format,
struct evkeyvalq* kv,
Modified: code/websim/src/websim.cc
===================================================================
--- code/websim/src/websim.cc 2009-06-29 17:34:12 UTC (rev 7928)
+++ code/websim/src/websim.cc 2009-06-29 19:35:46 UTC (rev 7929)
@@ -54,6 +54,10 @@
"<p><a href=\"http://HOST/position:1/model:0/fiducial:0/data/get\">
http://HOST/position:1/model:0/fiducial:0/data/get </a></p>"
"</body></html>";
+std::string WebSim::vizpage =
+ "<HTML><HEAD><TITLE>Websim Visualization</TITLE></HEAD>"
+ "<BODY><iframe id=\"visualization\" frameborder=0 width=\"1000\"
height=\"1000\" "
+ "src=\"http://192.168.1.210/viz.html\"></iframe></BODY></HTML>";
xmlChar *
@@ -234,25 +238,6 @@
{
return HandleSimRequest(prop, action, format, kv, response);
}
- else if(model == "viz")
- {
- if(prop ==""){
- puts("viz request");
- //response = "<html><header></header><body><img src=\"viz/1.png\"
></body></html>";
-
- response = "<HTML><HEAD><TITLE>A Simple Program</TITLE></HEAD>";
- response += "<BODY> <CENTER><APPLET CODE=\"ScrollingSimple.class\"
WIDTH=\"1500\" HEIGHT=\"1000\" id=\"TheApplet\"></APPLET></CENTER>";
- response += "<b>The returned data is:</b><br /><script
type=\"text/javascript\">
document.write(TheApplet.getResponseText());</script></BODY></HTML>";
- }
- else
- {
- puts("SendingFile:");
- puts(prop.c_str());
- }
- return true;
-
- }
- // Everything else must be an existing model
else
{
return HandleModelRequest(model, prop, action, format, kv, response);
Modified: code/websim/src/websim.hh
===================================================================
--- code/websim/src/websim.hh 2009-06-29 17:34:12 UTC (rev 7928)
+++ code/websim/src/websim.hh 2009-06-29 19:35:46 UTC (rev 7929)
@@ -232,6 +232,9 @@
// the string which contains the html code of the home page
static std::string webpage;
+
+ // the html code of visualization page
+ static std::string vizpage;
// Static, so that it can be passed as a callback to libevent
static void EventCallback(evhttp_request* req, void* arg);
@@ -297,6 +300,11 @@
struct evkeyvalq* kv,
std::string& response);
+ bool HandleSimVisualizationRequest( std::string action,
+ Format format,
+ struct evkeyvalq* kv,
+ std::string& response);
+
bool HandleModelRequest(const std::string& model,
const std::string& prop,
const std::string& action,
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit