Homepage
Demos
Overview
Downloads
Dev. Resources
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 "IPC/SharedObject.h"
00007 #include "Motion/PostureEngine.h"
00008 #include "Motion/MotionManager.h"
00009 #include "Events/EventListener.h"
00010 
00011 //! allows logging of events to the console or a file
00012 class PostureEditor : public ControlBase, public EventListener {
00013 public:
00014   //! constructor
00015   explicit PostureEditor(MotionManager::MC_ID estop_ID);
00016 
00017   //! destructor
00018   virtual ~PostureEditor();
00019 
00020   virtual ControlBase * activate(MotionManager::MC_ID disp_id, Socket * gui);
00021   virtual void refresh(); //!< if we're back from a child slot, it's either load or save, so we need to handle it
00022   virtual void pause();
00023   virtual void deactivate();
00024 
00025   //! listens for the EStop to be turned off before moving
00026   virtual void processEvent(const EventBase& e);
00027   
00028 protected:
00029   PostureEngine pose; //!< the current target posture
00030   MotionManager::MC_ID reachID; //!< id of motion sequence used to slow "snapping" to positions
00031   MotionManager::MC_ID estopID; //!< so we can check if the estop is active
00032 
00033   class FileInputControl* loadPose; //!< the control for loading postures
00034   class NullControl* disabledLoadPose; //!< a message to display instead of loadPose when EStop is on
00035   class StringInputControl* savePose; //!< the control for saving postures
00036   bool pauseCalled; //!< true if refresh hasn't been called since pause
00037   
00038   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
00039   
00040   bool isEStopped(); //!< called to check status of estop
00041   void updatePose(unsigned int delay); //!< called anytime pose is modified; uses #reachID to move to #pose if estop is off
00042 
00043 private:
00044   PostureEditor(const PostureEditor& ); //!< don't call
00045   PostureEditor& operator=(const PostureEditor& ); //!< don't call
00046 };
00047 
00048 /*! @file
00049  * @brief Describes PostureEditor, which allows numeric control of joints and LEDs
00050  * @author ejt (Creator)
00051  *
00052  * $Author: ejt $
00053  * $Name: tekkotsu-2_4_1 $
00054  * $Revision: 1.8 $
00055  * $State: Exp $
00056  * $Date: 2005/08/07 04:11:03 $
00057  */
00058 
00059 #endif

Tekkotsu v2.4.1
Generated Tue Aug 16 16:32:48 2005 by Doxygen 1.4.4