00001
00002 #ifndef INCLUDED_SimulatorAdvanceFrameControl_h
00003 #define INCLUDED_SimulatorAdvanceFrameControl_h
00004
00005 #include "Behaviors/Controls/NullControl.h"
00006 #ifdef PLATFORM_APERIOS
00007 # warning SimulatorAdvanceFrameControl is only useful when running in simulation!
00008 #else
00009 # include "local/sim/Simulator.h"
00010 #endif
00011
00012
00013
00014
00015
00016
00017
00018
00019 class SimulatorAdvanceFrameControl : public NullControl {
00020
00021 public:
00022
00023 SimulatorAdvanceFrameControl()
00024 : NullControl("SimulatorAdvanceFrameControl","Requests the next camera frame and sensor data, for use when running in simulation")
00025 {}
00026
00027 SimulatorAdvanceFrameControl(const std::string& n)
00028 : NullControl(n,"Requests the next camera frame and sensor data, for use when running in simulation")
00029 {}
00030
00031
00032 #ifndef PLATFORM_APERIOS
00033
00034 virtual ControlBase * activate(MotionManager::MC_ID disp_id, Socket * gui) {
00035 Simulator::sendCommand("advance");
00036 return NullControl::activate(disp_id,gui);
00037 }
00038
00039 virtual std::string getName() const {
00040 if(canManuallyAdvance())
00041 return NullControl::getName();
00042 return "[Auto-Advancing]";
00043 }
00044
00045 virtual std::string getDescription() const {
00046 if(canManuallyAdvance())
00047 return NullControl::getDescription();
00048 return "Cannot manually advance when in realtime mode, or when AdvanceOnAccess is enabled";
00049 }
00050
00051 protected:
00052 bool canManuallyAdvance() const { return true; }
00053
00054 #endif
00055
00056 };
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068 #endif