/* * MoveToPointWithTimeout.hh * * Created on: 8 июл. 2020 г. * Author: LeonidTitov */ #ifndef UMLIBRARY_TECHNOLOGICAL_FUNCTION_MOVETOPOINTWITHTIMEOUT_HH_ #define UMLIBRARY_TECHNOLOGICAL_FUNCTION_MOVETOPOINTWITHTIMEOUT_HH_ #include "MoveToPoint.hh" namespace technological { namespace function { class MoveToPointWithTimeout : public MoveToPoint { public: struct Setting { float retention_accuracy; //!<Точность достижения позиции. float on_position_timeout; //!<Время удержания заданного положения, с. float permit_speed_factor; //!<Допустимая скорость, отн. float permit_time; //!<Допустимое время, в секундах. Setting(); bool isValid(); }; void configure( Setting & config ); short getState() const; void stop(); MoveToPointWithTimeout( ResourceKeeper< technological::adapter::TieInterface > & control_system_wrapper, ResourceKeeper & speed_limit, ResourceKeeper & torque_limit, ResourceKeeper & acc_limit ); protected: virtual void on_start( Input & input, float start_point, systemic::time_t on_position_timeout ); virtual void in_progress(); private: systemic::Timer compite_timer; float permit_speed_factor; float permit_time; bool move_failure; }; }} #endif /* UMLIBRARY_TECHNOLOGICAL_FUNCTION_MOVETOPOINTWITHTIMEOUT_HH_ */