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/Main.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 Main::advanceVision();
00036 Main::advanceSensor();
00037 return NullControl::activate(disp_id,gui);
00038 }
00039
00040 virtual std::string getName() const {
00041 if(Main::canManuallyAdvance())
00042 return NullControl::getName();
00043 return "[Auto-Advancing]";
00044 }
00045
00046 virtual std::string getDescription() const {
00047 if(Main::canManuallyAdvance())
00048 return NullControl::getDescription();
00049 return "Cannot manually advance when in realtime mode, or when AdvanceOnAccess is enabled";
00050 }
00051
00052 #endif
00053
00054 };
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066 #endif