SimulatorAdvanceFrameControl.cc
Go to the documentation of this file.00001 #ifndef PLATFORM_APERIOS
00002
00003 #include "Behaviors/Controls/NullControl.h"
00004 #include "Shared/ProjectInterface.h"
00005
00006
00007
00008 class SimulatorAdvanceFrameControl : public NullControl {
00009 public:
00010
00011 SimulatorAdvanceFrameControl()
00012 : NullControl("Advance Frame","Requests the next camera frame and sensor data, for use when running in simulation")
00013 {}
00014
00015 SimulatorAdvanceFrameControl(const std::string& n)
00016 : NullControl(n,"Requests the next camera frame and sensor data, for use when running in simulation")
00017 {}
00018
00019 virtual ControlBase * activate(MC_ID disp_id, Socket * gui) {
00020 ProjectInterface::sendCommand("advance");
00021 return NullControl::activate(disp_id,gui);
00022 }
00023
00024 virtual std::string getName() const {
00025 if(canManuallyAdvance())
00026 return NullControl::getName();
00027 return "[Auto-Advancing]";
00028 }
00029
00030 virtual std::string getDescription() const {
00031 if(canManuallyAdvance())
00032 return NullControl::getDescription();
00033 return "Cannot manually advance when in realtime mode, or when AdvanceOnAccess is enabled";
00034 }
00035
00036 protected:
00037
00038 bool canManuallyAdvance() const { return true; }
00039 };
00040
00041 REGISTER_CONTROL(SimulatorAdvanceFrameControl,"Vision Pipeline");
00042
00043 #endif
00044
00045
00046
00047
00048