Revision: 8016
http://playerstage.svn.sourceforge.net/playerstage/?rev=8016&view=rev
Author: asadat
Date: 2009-07-14 18:36:30 +0000 (Tue, 14 Jul 2009)
Log Message:
-----------
changed how sample links are generated
Modified Paths:
--------------
code/websim/src/req_model.cc
code/websim/src/req_sim.cc
Modified: code/websim/src/req_model.cc
===================================================================
--- code/websim/src/req_model.cc 2009-07-14 08:53:51 UTC (rev 8015)
+++ code/websim/src/req_model.cc 2009-07-14 18:36:30 UTC (rev 8016)
@@ -284,7 +284,7 @@
void* xmlnode)
{
if(format == TEXT){
-
+
std::string res;
char temp[128];
for(unsigned int i=0;i<ranges.size();i++){
Modified: code/websim/src/req_sim.cc
===================================================================
--- code/websim/src/req_sim.cc 2009-07-14 08:53:51 UTC (rev 8015)
+++ code/websim/src/req_sim.cc 2009-07-14 18:36:30 UTC (rev 8016)
@@ -273,32 +273,48 @@
void WebSim::GenerateSampleUrls(std::vector<std::string> &list){
- std::vector<std::string> interfaces;
+ std::vector<std::string> sensors;
std::vector<std::string> temp;
GetModelChildren("",temp);
- while(temp.size()>0 && interfaces.size() < 6){
+ while(temp.size()>0 && sensors.size() < 50){
std::string m = temp.at(0);
temp.erase(temp.begin());
- int size = temp.size();
+ unsigned int size = temp.size();
GetModelChildren(m, temp);
if(temp.size()==size){
- interfaces.push_back(m);
+ sensors.push_back(m);
}
}
- for(unsigned int i=0;i<interfaces.size();i++){
- if(interfaces[i].find("laser")!=std::string::npos ||
interfaces[i].find("fiducial")!=std::string::npos ||
- interfaces[i].find("irarray")!=std::string::npos)
- list.push_back("<a href=http://HOST/"+interfaces[i]+"/data/get
> http://HOST/"+interfaces[i]+"/data/get</a> <br>");
+ bool laser=false,ranger=false,fiducial=false;
+
+ for(unsigned int i=0;i<sensors.size();i++){
+
+ if(sensors[i].find("laser")!=std::string::npos && !laser){
+ list.push_back("<a href=http://HOST/"+sensors[i]+"/data/get >
http://HOST/"+sensors[i]+"/data/get</a> <br>");
+ laser = true;
+ }
+
+ if(sensors[i].find("fiducial")!=std::string::npos && !fiducial){
+ list.push_back("<a href=http://HOST/"+sensors[i]+"/data/get >
http://HOST/"+sensors[i]+"/data/get</a> <br>");
+ fiducial = true;
+ }
+
+ if((sensors[i].find("ranger")!=std::string::npos ||
sensors[i].find("irarray")!=std::string::npos) && !ranger){
+ list.push_back("<a href=http://HOST/"+sensors[i]+"/data/get >
http://HOST/"+sensors[i]+"/data/get</a> <br>");
+ ranger = true;
+ }
+
+
}
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit