User Tools

Site Tools


steereo:classes:steerparameterclient

SteerParameterClient

Description

The SteerParameterClient class is designed to ease the use of parameter steering on the client side. Therefore you register variables on the client side that will be pendants of the parameters on the simulation side. The get and set requests will use these variables for getting and setting. In the Howto you can see an example of how it is used.

Important functions

  •  bool isParameterUpdated (std::string paramName) 

    returns whether the registered parameter paramName is up to date or not

  •  bool areAllParametersUpdated () 

    returns whether all registered parameters are up to date or not

  •  void addAction () 

    registers the response handler of the SteerparameterClient at the ClientSteering instance. If you don't want to write an own handler you should use it.

  •  int requestGetParameter(std::string paramName, int index, int connNr = 0) 
     int requestGetParameter(std::string paramName, int connNr = 0);

    send a request to the connected simulation identified by connNr (normally with only one connected simulation this is 0), to get the value of the simulation parameter paramName respectively paramName[index].

  •  int requestSetParameter(std::string paramName, int index, int connNr = 0); 
     int requestSetParameter(std::string paramName, int connNr = 0) 

    send a request to the connected simulation identified by connNr (normally with only one connected simulation this is 0), to set the value of the simulation parameter paramName respectively paramName[index] to the value of the registered local variable.

  •  template<class T> void registerScalarParameter (std::string paramName, T* ptrToParam, std::string minVal="0", std::string maxVal="0") 
     template<class T, class TC> void registerScalarParameter (std::string paramName, TC* ptrToInstance, T (TC::*getter) (), void (TC::*setter) (T), std::string minVal ="0", std::string maxVal="0")
     template<class T> void registerArrayParameter  (std::string paramName, T* ptrToParam, int arrayLength) 
     template<class T, class TC> void registerArrayParameter (std::string paramName, TC* ptrToInstance, T (TC::*getter) (), int arrayLength) 

    register the pendants to the steered simulation parameters on the client side. The get and set requests will use these registered variables to receive the simulation parameter values into or to get the values to which the simulation parameter should be set to respectively.

steereo/classes/steerparameterclient.txt · Last modified: 2010/03/22 15:25 (external edit)