Homepage Demos Overview Downloads Tutorials Reference
Credits

PostureEditor.h

Go to the documentation of this file.
00001 //-*-c++-*-
00002 #ifndef INCLUDED_PostureEditor_h_
00003 #define INCLUDED_PostureEditor_h_
00004 
00005 #include "ControlBase.h"
00006 #include "Shared/SharedObject.h"
00007 #include "Motion/PostureEngine.h"
00008 #include "Motion/MotionManager.h"
00009 #include "StringInputControl.h"
00010 #include "FileInputControl.h"
00011 #include "Events/EventListener.h"
00012 
00013 //! allows logging of events to the console or a file
00014 class PostureEditor : public ControlBase, public EventListener {
00015 public:
00016   //! constructor
00017   explicit PostureEditor(MotionManager::MC_ID estop_ID);
00018 
00019   virtual ControlBase * activate(MotionManager::MC_ID disp_id, Socket * gui);
00020   virtual void refresh(); //!< if we're back from a child slot, it's either load or save, so we need to handle it
00021   virtual void pause();
00022   virtual void deactivate();
00023 
00024   //! opens a custom (embedded) menu edit outputs
00025   virtual ControlBase* doSelect();
00026   
00027   //! listens for the EStop to be turned off before moving
00028   virtual void processEvent(const EventBase& e);
00029   
00030 protected:
00031   PostureEngine pose; //!< the current target posture
00032   MotionManager::MC_ID reachID; //!< id of motion sequence used to slow "snapping" to positions
00033   MotionManager::MC_ID estopID; //!< so we can check if the estop is active
00034 
00035   ControlBase* lastSlot; //!< the last accessed slot
00036   FileInputControl* loadPose; //!< the control for loading postures
00037   StringInputControl* savePose; //!< the control for saving postures
00038   bool pauseCalled; //!< true if refresh hasn't been called since pause
00039   
00040   static const unsigned int moveTime=1500; //!< number of milliseconds to take to load a posture - individual joint changes will be done in half the time
00041   
00042   bool isEStopped(); //!< called to check status of estop
00043   void updatePose(unsigned int delay); //!< called anytime pose is modified; uses #reachID to move to #pose if estop is off, setting up #ledID otherwise
00044 
00045 private:
00046   PostureEditor(const PostureEditor& ); //!< don't call
00047   PostureEditor& operator=(const PostureEditor& ); //!< don't call
00048 };
00049 
00050 /*! @file
00051  * @brief Describes PostureEditor, which allows numeric control of joints and LEDs
00052  * @author ejt (Creator)
00053  *
00054  * $Author: ejt $
00055  * $Name: tekkotsu-2_2_1 $
00056  * $Revision: 1.4 $
00057  * $State: Exp $
00058  * $Date: 2004/10/18 19:53:02 $
00059  */
00060 
00061 #endif

Tekkotsu v2.2.1
Generated Tue Nov 23 16:36:39 2004 by Doxygen 1.3.9.1