Tekkotsu Homepage | Demos | Overview | Downloads | Dev. Resources | Reference | Credits |
SharedGlobals Class Reference#include <SharedGlobals.h>
Detailed DescriptionA class to hold various simulator parameters which need to be accessed from multiple processes.Definition at line 13 of file SharedGlobals.h.
Member Enumeration Documentation
defines the runlevels that each process passes through; runlevels should monotonically increase (can't go backwards)
Definition at line 130 of file SharedGlobals.h.
Constructor & Destructor Documentation
Member Function Documentation
call this to cause "system shutdown" -- clean halt of the simulator (not actually the host system)
Definition at line 41 of file SharedGlobals.h. Referenced by Main::processEvent(), and signalShutdown().
test to see if the shutdown flag has been set (non-blocking)
Definition at line 45 of file SharedGlobals.h. Referenced by signalShutdown().
blocks until shutdown flag has been set
Definition at line 49 of file SharedGlobals.h. Referenced by Simulator::run(), Motion::run(), and Main::run().
call this to cause "system shutdown" -- clean halt of the simulator (not actually the host system)
Definition at line 61 of file SharedGlobals.h. Referenced by Simulator::cmdQuit(), sim::handle_exit(), sim::handle_signal(), Simulator::run(), and Simulator::Simulator().
test to see if the shutdown flag has been set (non-blocking)
Definition at line 67 of file SharedGlobals.h. Referenced by Simulator::processRunlevel(), Motion::run(), and Main::run().
blocks until shutdown flag has been set
Definition at line 71 of file SharedGlobals.h. Referenced by Process::run().
access to semgr, returns SemaphoreManager::hadFault()
Definition at line 76 of file SharedGlobals.h. Referenced by sim::handle_exit(), and sim::handle_signal().
access to semgr's SemaphoreManager::faultShutdown() -- call this *after* a fault has occured from the signal handler; doesn't signal the fault itself
Definition at line 79 of file SharedGlobals.h. Referenced by sim::handle_exit(), and sim::handle_signal().
returns the current simulator time, in milliseconds since startup the simulator should set project_get_time::get_time_callback to call this, so calls to get_time() will be forwarded here. That wall all processes will share the same time Definition at line 18 of file SharedGlobals.cc. Referenced by sim::sim_get_time().
returns the current simulator timeScale (speed factor), as a ratio of real time (e.g. '2' means simulation is running two times wall clock) the simulator should set project_get_time::get_timeScale_callback to call this, so calls to getTimeScale() will be forwarded here. Definition at line 56 of file SharedGlobals.cc. Referenced by sim::sim_getTimeScale().
sets autoPauseTime
Definition at line 118 of file SharedGlobals.h. Referenced by Simulator::incrementTime(), and Simulator::resetSpeedMode().
returns autoPauseTime
Definition at line 120 of file SharedGlobals.h. Referenced by Simulator::incrementTime().
sets nextTimer, returns true if the new value differs from previous value
Definition at line 207 of file SharedGlobals.h. Referenced by Main::gotCamera(), Main::gotEvent(), Main::gotSensors(), Main::gotTimer(), TimerExecThread::poll(), and Main::run().
gets nextTimer
Definition at line 208 of file SharedGlobals.h. Referenced by TimerExecThread::calcSleepTime(), Simulator::getNextFrame(), TimerExecThread::poll(), and TimerExecThread::reset().
sets nextMotion
Definition at line 210 of file SharedGlobals.h. Referenced by MotionExecThread::launched(), MotionExecThread::poll(), and MotionExecThread::reset().
gets nextMotion
Definition at line 211 of file SharedGlobals.h. Referenced by Simulator::getNextFrame(), Motion::gotWakeup(), MotionExecThread::interrupted(), and MotionExecThread::poll().
this returns time since boot (bootTime), scaled by scale, relative to timeOffset
Definition at line 220 of file SharedGlobals.h. Referenced by get_time().
Member Data DocumentationControls whether to wait for initial sensor readings before triggering the startup behavior or starting the motion polling thread. This can avoid jumping to the 0-point on simulator launch. Changes after initial launch are ignored. Definition at line 38 of file SharedGlobals.h. Referenced by Main::DoStart(), Simulator::run(), Motion::run(), Main::run(), signalShutdown(), and sim::sim().
the current time within the simulation, only applicable when timeScale is negative (non-realtime)
Definition at line 100 of file SharedGlobals.h. Referenced by get_time(), Simulator::incrementTime(), resetBootTime(), Simulator::resetSpeedMode(), and sim::sim().
Controls the speed at which time from get_time() will move. You can use this to pretend your hardware is faster or slower than it actually is. For instance, a value of .5 means time will move at half speed (pretending your hardware is twice as fast) This can be useful for "slow motion" analysis, or you can speed up time to simulate a more processor-restrictive platform. Negative values indicate full-speed processing -- time will be incremented only as quickly as it can be without dropping any video or sensor frames. (may be faster or slower than realtime) in this case, simulatorTime is used by calls to get_time() A value of zero halts time. Definition at line 115 of file SharedGlobals.h. Referenced by TimerExecThread::calcSleepTime(), Motion::DoStart(), Motion::DoStop(), get_time(), getTimeScale(), Main::gotTimer(), Motion::gotWakeup(), Simulator::incrementTime(), MotionExecThread::interrupted(), TimerExecThread::launched(), MotionExecThread::launched(), Simulator::messagesRead(), Simulator::plistCollectionEntriesChanged(), Simulator::plistCollectionEntryAdded(), Simulator::plistValueChanged(), TimerExecThread::reset(), MotionExecThread::reset(), resetBootTime(), Simulator::resetSpeedMode(), Simulator::run(), sim::sim(), Simulator::Simulator(), and Simulator::~Simulator().
symbolic access to the total number of runlevel stages
Definition at line 139 of file SharedGlobals.h. Referenced by SharedGlobals().
Initial value: { "CREATED", "CONSTRUCTING", "STARTING", "RUNNING", "STOPPING", "DESTRUCTING", "DESTRUCTED", "" }
Definition at line 142 of file SharedGlobals.h. Referenced by sim::run(), and sim::wait_runlevel().
a count of the number of processes which have passed through each runlevel
Definition at line 145 of file SharedGlobals.h. Referenced by sim::fork_process(), sim::handle_exit(), sim::handle_signal(), sim::manage_process(), sim::run(), SharedGlobals(), and sim::wait_runlevel().
Referenced by Simulator::FrameCounter::filterSendRequest(), MotionExecThread::getPostureFeedback(), Motion::gotSensors(), Main::gotSensors(), Simulator::plistCollectionEntriesChanged(), Simulator::plistCollectionEntryAdded(), Simulator::plistValueChanged(), MotionExecThread::poll(), sim::sim(), Simulator::Simulator(), and Simulator::~Simulator(). allows mutually exclusive access to the fields of SharedObject
Definition at line 196 of file SharedGlobals.h. Referenced by sim::handle_exit(), sim::handle_signal(), sim::manage_process(), Process::statusReport(), and sim::wait_runlevel().
holds the host system's process ID for each simulator process
Definition at line 199 of file SharedGlobals.h. Referenced by Process::Process(), and Simulator::run().
maximum storage size of strings in processNames
Definition at line 202 of file SharedGlobals.h. Referenced by Process::Process(). each process should set a string version of its name for user feedback
Definition at line 205 of file SharedGlobals.h. Referenced by Process::Process(), and Simulator::run().
set by setNextTimer, called with the current value of EventRouter::getNextTimer() after each user code section, indicates time of next timer event
Definition at line 225 of file SharedGlobals.h. Referenced by getNextTimer(), and setNextTimer().
updated by Motion process after each motion update
Definition at line 228 of file SharedGlobals.h. Referenced by getNextMotion(), and setNextMotion().
updated by Main process after each sensor update
Definition at line 231 of file SharedGlobals.h. Referenced by getNextSensorUpdate(), and setNextSensorUpdate(). real time since simulator startup (or, at least, since SharedGlobals was constructed... close enough)
Definition at line 234 of file SharedGlobals.h. Referenced by get_real_time(), get_time(), and resetBootTime().
the scaled value of bootTime at which isRealTime was last activated, allows you to start and stop realtime fluidly
Definition at line 237 of file SharedGlobals.h. Referenced by get_real_time(), get_time(), and resetBootTime().
updated by each call to get_time(), if timeScale differs, allows timeOffset to be updated fluidly
Definition at line 240 of file SharedGlobals.h. Referenced by get_time().
if simulatorTime is about to move past this value, timeScale is set to 0 instead, and simulatorTime is set to this
Definition at line 243 of file SharedGlobals.h. Referenced by get_time(), getAutoPauseTime(), and setAutoPauseTime().
a semaphore set, only used for running and sensorValid
Definition at line 245 of file SharedGlobals.h. Referenced by faultShutdown(), hadFault(), haveSensors(), isShutdown(), SharedGlobals(), signalHaveSensors(), signalShutdown(), waitSensors(), waitShutdown(), and ~SharedGlobals().
the semaphore within semgr to communicate shutdown status between processes -- when the semaphore is set to 0, shutdown is requested
Definition at line 246 of file SharedGlobals.h. Referenced by isShutdown(), SharedGlobals(), signalShutdown(), waitShutdown(), and ~SharedGlobals().
the semaphore within semgr to notify processes when the first sensor frame is available
Definition at line 247 of file SharedGlobals.h. Referenced by haveSensors(), SharedGlobals(), signalHaveSensors(), waitSensors(), and ~SharedGlobals().
The documentation for this class was generated from the following files: |
Tekkotsu Hardware Abstraction Layer 4.0 |
Generated Thu Nov 22 01:01:23 2007 by Doxygen 1.5.4 |