Revision: 7482
          http://playerstage.svn.sourceforge.net/playerstage/?rev=7482&view=rev
Author:   rtv
Date:     2009-03-14 01:12:41 +0000 (Sat, 14 Mar 2009)

Log Message:
-----------
working on webstage

Modified Paths:
--------------
    code/stage/trunk/libstage/stage.hh
    code/stage/trunk/webstage/webstage.cc
    code/stage/trunk/webstage/world.fed
    code/stage/trunk/worlds/fasr.world

Modified: code/stage/trunk/libstage/stage.hh
===================================================================
--- code/stage/trunk/libstage/stage.hh  2009-03-14 01:12:23 UTC (rev 7481)
+++ code/stage/trunk/libstage/stage.hh  2009-03-14 01:12:41 UTC (rev 7482)
@@ -1382,7 +1382,8 @@
     void Start(){ paused = false; };
     void Stop(){ paused = true; };
     void TogglePause(){ paused = !paused; };
-        
+        bool Paused(){ return( paused ); };
+
     /** show the window - need to call this if you don't Load(). */
     void Show(); 
 

Modified: code/stage/trunk/webstage/webstage.cc
===================================================================
--- code/stage/trunk/webstage/webstage.cc       2009-03-14 01:12:23 UTC (rev 
7481)
+++ code/stage/trunk/webstage/webstage.cc       2009-03-14 01:12:41 UTC (rev 
7482)
@@ -16,12 +16,11 @@
 class WebStage : public websim::WebSim
 {
   Stg::World* world;
-
+  
 public:
   WebStage( Stg::World* world,
-                               const std::string& fedfile,
-                               const std::string& host, int port ) :
-        websim::WebSim( fedfile, host, port ),
+                               const std::string& host, const unsigned short 
port ) :
+        websim::WebSim( host, port ),
         world(world)
   {
   }
@@ -199,19 +198,42 @@
                                                 new World( worldfilename ) );
   world->Load( worldfilename );
 
-  WebStage ws( world, fedfilename, host, port );
+  WebStage ws( world, host, port );
+  ws.LoadFederationFile( fedfilename );
 
+  puts( "entering main loop" );
+
+  ws.Go();
+  ws.Wait();                   
+
+  puts( "through the sync" );
+
+  
   //close program once time has completed
   bool quit = false;
   while( ! quit )
         {
-               ws.ForEachPuppet( WebStage::UpdatePuppetCb, (void*)&ws );
+               // tell my friends to start simulating
+               ws.Go();
+               // todo - loop here to drain libevent's output?
 
+               puts( "go done" );
+
                // update Stage
-               //quit = world->Update();
                world->Update();
 
-               ws.Update();                    
+               puts( "update done" );
+
+               // todo? check for changes?
+               // send my updates
+               ws.ForEachPuppet( WebStage::UpdatePuppetCb, (void*)&ws );
+
+               puts( "pushes  done" );
+
+               // wait for goes from all my friends
+               ws.Wait();                      
+
+               puts( "wait done" );
         }
 
   printf( "Webstage done.\n" );

Modified: code/stage/trunk/webstage/world.fed
===================================================================
--- code/stage/trunk/webstage/world.fed 2009-03-14 01:12:23 UTC (rev 7481)
+++ code/stage/trunk/webstage/world.fed 2009-03-14 01:12:41 UTC (rev 7482)
@@ -21,5 +21,14 @@
 position:14=slave:position
 position:15=slave:position
 
+#[slave]
+#rob0=master:position
+#rob1=master:position
+#rob2=master:position
+#rob3=master:position
+#rob4=master:position
+#rob5=master:position
+#rob6=master:position
+#rob7=master:position
 
 

Modified: code/stage/trunk/worlds/fasr.world
===================================================================
--- code/stage/trunk/worlds/fasr.world  2009-03-14 01:12:23 UTC (rev 7481)
+++ code/stage/trunk/worlds/fasr.world  2009-03-14 01:12:41 UTC (rev 7482)
@@ -7,14 +7,14 @@
 include "sick.inc"
 
 interval_sim 100  # simulation timestep in milliseconds
-interval_real 20 # real-time interval between simulation updates in 
milliseconds 
+interval_real 0 # real-time interval between simulation updates in 
milliseconds 
 paused 1
 
 resolution 0.02
 
 # threads may speed things up here depending on available CPU cores & workload 
-# threadpool 0 
- threadpool 16
+ threadpool 0 
+# threadpool 16
 
 
 # configure the GUI window


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to