Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

get_time.h File Reference


Detailed Description

prototype for get_time(), a simple way to get the current time since boot in milliseconds

Author:
ejt (Creator)
Author
ejt
Name
tekkotsu-4_0
Revision
1.7
State
Exp
Date
2006/10/04 02:40:42

Definition in file get_time.h.

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  project_get_time

Functions

unsigned int(*) project_get_time::get_time_callback ()
 This by default will return the time in milliseconds since the first call was made. Note this is a function pointer, so you can reassign it to your own implementation!
float(*) project_get_time::get_timeScale_callback ()
 You can reassign this to your own implementation if you might play games with time control. For instance, the simulator can assign a function which simply returns SharedGlobals::timeScale. By default this is NULL, which indicates to getTimeScale that it should use the default implementation. Note that this is a slightly different usage paradigm than get_time_callback(), which is assumed to always be non-NULL (at least, unless you assign a value to simulation_time...).
unsigned int get_time ()
 This will call and return project_get_time::get_time_callback if project_get_time::simulation_time is -1. Otherwise simulation_time is returned.
float getTimeScale ()
 If project_get_time::get_timeScale_callback is NULL, this will return 1 if project_get_time::simulation_time is -1U (the default value), and -1 otherwise. If the callback is available, returns that.


Function Documentation

unsigned int get_time (  )  [inline]

This will call and return project_get_time::get_time_callback if project_get_time::simulation_time is -1. Otherwise simulation_time is returned.

Default values are set such that the system clock will be used, and values will range from 0 (first call) onward. However, by reassigning project_get_time::get_time_callback to your own function, you can control the flow of time however you wish.

Definition at line 38 of file get_time.h.

Referenced by SegCamBehavior::closePacket(), RawCamBehavior::closePacket(), WaypointEngine< MAX_WAY >::cycle(), LedEngine::cycle(), EventRouter::dispTimers(), WalkMC::DoStart(), WalkMC::DoStop(), WMMonitorBehavior::encodeHeader(), EmergencyStopMC::freezeJoints(), MotionManager::getOutputs(), HolonomicMotionModel< ParticleT >::getPosition(), LedNode::getPrivateMC(), WalkMC::getTravelTime(), LedEngine::getValue(), WaypointEngine< MAX_WAY >::go(), PostureMC::isAlive(), WorldStatePool::isUnread(), EventLogger::logImage(), EventLogger::logMessage(), EventLogger::logWebcam(), StateNode::postCompletionEvent(), StateNode::postStopEvent(), SegCamBehavior::processEvent(), RawCamBehavior::processEvent(), EventRouter::processTimers(), WorldState::read(), EmergencyStopMC::releaseJoints(), MotionSequenceEngine::resume(), EventRouter::TimerEntry::Set(), TailWagMC::setPeriod(), HolonomicMotionModel< ParticleT >::setPosition(), WaypointEngine< MAX_WAY >::setTargetWaypoint(), WalkCalibration::setupMoving(), HolonomicMotionModel< ParticleT >::setVelocity(), Controller::trapEvent(), WaypointEngine< MAX_WAY >::unpause(), HolonomicMotionModel< ParticleT >::updateMotion(), WalkMC::updateOutputs(), TailWagMC::updateOutputs(), PostureMC::updateOutputs(), MotionSequenceEngine::updateOutputs(), and EmergencyStopMC::updateOutputs().

float getTimeScale (  )  [inline]

If project_get_time::get_timeScale_callback is NULL, this will return 1 if project_get_time::simulation_time is -1U (the default value), and -1 otherwise. If the callback is available, returns that.

Definition at line 46 of file get_time.h.


Tekkotsu v4.0
Generated Thu Nov 22 00:55:57 2007 by Doxygen 1.5.4