Homepage | Demos | Overview | Downloads | Dev. Resources | Reference | Credits |
SavePostureControl.hGo to the documentation of this file.00001 //-*-c++-*- 00002 #ifndef INCLUDED_SavePostureControl_h_ 00003 #define INCLUDED_SavePostureControl_h_ 00004 00005 #include "StringInputControl.h" 00006 #include "Motion/PostureEngine.h" 00007 00008 //! Upon activation, saves the current position to a file name read from user (default is /ms/data/motion...) 00009 class SavePostureControl : public StringInputControl { 00010 public: 00011 //! Constructor 00012 SavePostureControl() : StringInputControl("Save Posture","Saves current posture to filename read from user","Please enter name for posture file (in data/motion)...") {} 00013 //! Constructor 00014 SavePostureControl(const std::string& n) : StringInputControl(n,"Saves current posture to filename read from user","Please enter name for posture file (in data/motion)...") {} 00015 00016 virtual ControlBase * takeInput(const std::string& msg) { 00017 if(msg.size()>0) { 00018 std::string filename; 00019 if(filename.find(".")==std::string::npos) 00020 filename+=".pos"; 00021 filename=config->motion.makePath(msg); 00022 PostureEngine post; 00023 post.takeSnapshot(); 00024 post.setWeights(1); 00025 post.SaveFile(filename.c_str()); 00026 } 00027 return StringInputControl::takeInput(msg); 00028 } 00029 }; 00030 00031 /*! @file 00032 * @brief Defines SavePostureControl, which when activated, saves the current position to a file name read from user (default is /ms/data/motion...) 00033 * @author ejt (Creator) 00034 * 00035 * $Author: ejt $ 00036 * $Name: tekkotsu-2_4_1 $ 00037 * $Revision: 1.12 $ 00038 * $State: Exp $ 00039 * $Date: 2005/06/01 05:47:45 $ 00040 */ 00041 00042 #endif |
Tekkotsu v2.4.1 |
Generated Tue Aug 16 16:32:48 2005 by Doxygen 1.4.4 |