// -*-C++-*-
/*!
 * @file  com_RHHandWrapSVC_impl.h
 * @brief Service implementation header of com_RHHandWrap.idl
 *
 */

#include "com_handSkel.h"
#include "rtm/idl/BasicDataType.hh"
#include <rtm/SystemLogger.h>

#ifndef COM_RHHANDWRAPSVC_IMPL_H
#define COM_RHHANDWRAPSVC_IMPL_H

double calc_tm_dif(RTC::Time tm1, RTC::Time tm2);
int diff_check(double num1, double num2, double diff);
 
/*!
 * @class ComHandSVC_impl
 * Example class implementing IDL interface ComHand
 */
class ComHandSVC_impl
 : public virtual POA_ComHand,
   public virtual PortableServer::RefCountServantBase
{
 private:
   // Make sure all instances are built on the heap by making the
   // destructor non-public
   //virtual ~ComHandSVC_impl();
   RTC::Logger rtclog; 

 public:
  /*!
   * @brief standard constructor
   */
   ComHandSVC_impl();
  /*!
   * @brief destructor
   */
   virtual ~ComHandSVC_impl();

   // attributes and operations
   CORBA::Short InitHand();
   CORBA::Short OpenHand(CORBA::Short slow);
   CORBA::Short CloseHand(CORBA::Short slow);
   CORBA::Short GetHandCond();
   CORBA::Short GetHandMode();
   CORBA::Short StopHand();
   int action_mode; 	//動作モード  0:READY, 1:OPEN, 2:CLOSE
   int condition;   	//状態フラグ  0:閉完了 1:開完了 2:動作中 3:中断
   RTC::Time s_tm;   //グリッパー動作開始時刻

};



#endif // COM_RHHANDWRAPSVC_IMPL_H


