Revision: 8328
          http://playerstage.svn.sourceforge.net/playerstage/?rev=8328&view=rev
Author:   rtv
Date:     2009-10-26 21:27:19 +0000 (Mon, 26 Oct 2009)

Log Message:
-----------
removed key-value/property database. This is meta-level functionality that 
doesn't belong in Stage

Modified Paths:
--------------
    code/stage/trunk/docsrc/stage.dox
    code/stage/trunk/libstage/CMakeLists.txt
    code/stage/trunk/libstage/model_load.cc
    code/stage/trunk/libstage/stage.hh
    code/stage/trunk/libstageplugin/p_simulation.cc
    code/stage/trunk/worlds/benchmark/hospital.world

Modified: code/stage/trunk/docsrc/stage.dox
===================================================================
--- code/stage/trunk/docsrc/stage.dox   2009-10-26 08:48:33 UTC (rev 8327)
+++ code/stage/trunk/docsrc/stage.dox   2009-10-26 21:27:19 UTC (rev 8328)
@@ -23,7 +23,7 @@
 # This could be handy for archiving the generated documentation or 
 # if some version control system is used.
 
-PROJECT_NUMBER         = 3.1.0
+PROJECT_NUMBER         = 3.2.1
 
 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) 
 # base path where the generated documentation will be put. 

Modified: code/stage/trunk/libstage/CMakeLists.txt
===================================================================
--- code/stage/trunk/libstage/CMakeLists.txt    2009-10-26 08:48:33 UTC (rev 
8327)
+++ code/stage/trunk/libstage/CMakeLists.txt    2009-10-26 21:27:19 UTC (rev 
8328)
@@ -26,7 +26,6 @@
        model_lightindicator.cc
        model_load.cc
        model_position.cc
-       model_props.cc
        model_ranger.cc
        option.cc
        powerpack.cc

Modified: code/stage/trunk/libstage/model_load.cc
===================================================================
--- code/stage/trunk/libstage/model_load.cc     2009-10-26 08:48:33 UTC (rev 
8327)
+++ code/stage/trunk/libstage/model_load.cc     2009-10-26 21:27:19 UTC (rev 
8328)
@@ -188,10 +188,6 @@
   if( wf->PropertyExists( wf_entity, "map_resolution" ))
     this->SetMapResolution( wf->ReadFloat(wf_entity, "map_resolution", 
this->map_resolution ));
     
-  // populate the key-value database
-  if( wf->PropertyExists( wf_entity, "db_count" ) )
-               LoadDataBaseEntries( wf, wf_entity );
-
   if (vis.gravity_return)
        {
          Velocity vel = GetVelocity();
@@ -348,31 +344,3 @@
   fflush(stdout);
 }
 
- 
- void Model::LoadDataBaseEntries( Worldfile* wf, int entity )
- {
-       int entry_count = wf->ReadInt( entity, "db_count", 0 );
-
-       if( entry_count < 1 )
-         return;
-
-       for( int e=0; e<entry_count; e++ )
-         {
-                const char* entry = wf->ReadTupleString( entity, "db", e, NULL 
);
-                
-                const size_t SZ = 64;
-                char key[SZ], type[SZ], value[SZ];
-                
-                sscanf( entry, "%[^<]<%[^>]>%[^\"]", key, type, value );
-
-                if( strcmp( type, "int" ) == 0 )
-                       SetPropertyInt( strdup(key), atoi(value) );
-                else if( strcmp( type, "float" ) == 0 )                        
-                       SetPropertyFloat( strdup(key), strtod(value, NULL) );
-                else if( strcmp( type, "string" ) == 0 )
-                       SetPropertyStr( strdup(key), value );
-                else
-                       PRINT_ERR1( "unknown database entry type \"%s\"\n", 
type );              
-         }
-
- }

Modified: code/stage/trunk/libstage/stage.hh
===================================================================
--- code/stage/trunk/libstage/stage.hh  2009-10-26 08:48:33 UTC (rev 8327)
+++ code/stage/trunk/libstage/stage.hh  2009-10-26 21:27:19 UTC (rev 8328)
@@ -2014,7 +2014,6 @@
         void DataVisualizeTree( Camera* cam );
         void DrawFlagList();
         void DrawPose( Pose pose );
-        void LoadDataBaseEntries( Worldfile* wf, int entity );
        
   public:
         virtual void PushColor( Color col ){ world->PushColor( col ); }        
@@ -2301,49 +2300,6 @@
         void RemoveFlagDecrCallback( stg_model_callback_t cb )
         {      RemoveCallback( &hooks.flag_decr, cb ); }
         
-        /** named-property interface 
-         */
-        const void* GetProperty( const char* key ) const;
-        bool GetPropertyFloat( const char* key, float* f, float defaultval ) 
const;     
-        bool GetPropertyInt( const char* key, int* i, int defaultval ) const;  
 
-        bool GetPropertyStr( const char* key, char** c, char* defaultval ) 
const;
-
-        /** @brief Set a named property of a Stage model.
-        
-                 Set a property of a Stage model. 
-        
-                 This function can set both predefined and user-defined
-                 properties of a model. Predefined properties are intrinsic to
-                 every model, such as pose and color. Every supported 
predefined
-                 properties has its identifying string defined as a 
preprocessor
-                 macro in stage.h. Users should use the macro instead of a
-                 hard-coded string, so that the compiler can help you to avoid
-                 mis-naming properties.
-        
-                 User-defined properties allow the user to attach arbitrary 
data
-                 pointers to a model. User-defined property data is not copied,
-                 so the original pointer must remain valid. User-defined 
property
-                 names are simple strings. Names beginning with an underscore
-                 ('_') are reserved for internal libstage use: users should not
-                 use names beginning with underscore (at risk of causing very
-                 weird behaviour).
-        
-                 Any callbacks registered for the named property will be 
called.      
-        
-                 Returns 0 on success, or a positive error code on failure.
-        
-                 *CAUTION* The caller is responsible for making sure the 
pointer
-                 points to data of the correct type for the property, so use
-                 carefully. Check the docs or the equivalent
-                 stg_model_set_<property>() function definition to see the type
-                 of data required for each property.
-        */ 
-        int SetProperty( const char* key, const void* data );
-        void SetPropertyInt( const char* key, int i );
-        void SetPropertyFloat( const char* key, float f );
-        void SetPropertyStr( const char* key, const char* str );
-        
-        void UnsetProperty( const char* key );
                
         virtual void Print( char* prefix ) const;
         virtual const char* PrintWithPose() const;

Modified: code/stage/trunk/libstageplugin/p_simulation.cc
===================================================================
--- code/stage/trunk/libstageplugin/p_simulation.cc     2009-10-26 08:48:33 UTC 
(rev 8327)
+++ code/stage/trunk/libstageplugin/p_simulation.cc     2009-10-26 21:27:19 UTC 
(rev 8328)
@@ -314,67 +314,6 @@
                        return(-1);
                }
        }
-
-
-       // Is it a request to set a model's property?
-       else if(Message::MatchMessage(hdr, PLAYER_MSGTYPE_REQ,
-                               PLAYER_SIMULATION_REQ_SET_PROPERTY,
-                               this->addr))
-    {
-               player_simulation_property_req_t* req =
-                       (player_simulation_property_req_t*)data;
-
-               // look up the named model
-               Model* mod = StgDriver::world->GetModel( req->name );
-
-               if( mod )
-               {
-                       int ack =
-                       mod->SetProperty( req->prop,
-                                         (void*)req->value );
-
-                       this->driver->Publish(this->addr, resp_queue,
-                                       ack==0 ? PLAYER_MSGTYPE_RESP_ACK : 
PLAYER_MSGTYPE_RESP_NACK,
-                                       PLAYER_SIMULATION_REQ_SET_PROPERTY);
-                       return(0);
-               }
-               else
-               {
-                       PRINT_WARN1( "SET_PROPERTY request: simulation model 
\"%s\" not found", req->name );
-                       return(-1);
-               }
-       }
-
-       // Is it a request to get a model's property?
-//     else if(Message::MatchMessage(hdr, PLAYER_MSGTYPE_REQ,
-//                                                               
PLAYER_SIMULATION_REQ_GET_PROPERTY,
-//                                                               this->addr))
-//    {
-//             player_simulation_property_req_t* req =
-//                     (player_simulation_property_req_t*)data;
-//
-//             // look up the named model
-//             Model* mod = StgDriver::world->GetModel( req->name );
-//
-//             if( mod )
-//             {
-//
-//                     // This is probably wrong
-//                     req->value = (char*)mod->GetProperty( req->prop );
-//
-//                     this->driver->Publish(this->addr, resp_queue,
-//                                                               
PLAYER_MSGTYPE_RESP_ACK,
-//                                                               
PLAYER_SIMULATION_REQ_GET_PROPERTY);
-//                     return(0);
-//             }
-//             else
-//             {
-//                     PRINT_WARN1( "GET_PROPERTY request: simulation model 
\"%s\" not found", req->name );
-//                     return(-1);
-//             }
-//     }
-
-
        else
        {
                // Don't know how to handle this message.

Modified: code/stage/trunk/worlds/benchmark/hospital.world
===================================================================
--- code/stage/trunk/worlds/benchmark/hospital.world    2009-10-26 08:48:33 UTC 
(rev 8327)
+++ code/stage/trunk/worlds/benchmark/hospital.world    2009-10-26 21:27:19 UTC 
(rev 8328)
@@ -13,7 +13,7 @@
 paused 0
 
 # threads may help or hurt performance depending on your worldfile, machine 
and load
-# threads 7
+ threads 8
 
 quit_time 60
 


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

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Playerstage-commit mailing list
Playerstage-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to