Skip to content
Snippets Groups Projects
MotionProxyHelper.h 2.79 KiB
Newer Older
Olivier Roux's avatar
Olivier Roux committed
#ifndef _MotionProxyHelper_H_
#define _MotionProxyHelper_H_
// ============================================================================
//
// = CONTEXT
//		Utility class - Implementation of a class encapsulating creation and control
//						of a Tango device proxy to a standard soleil motor
//
// = File
//		MotionProxyHelper.h
//
// = AUTHOR
//		Arafat NOUREDDINE - Synchrotron SOLEIL
//      F. Langlois - Synchrotron SOLEIL
//
// ============================================================================
#include <tango.h>
#include <helpers/TangoExceptionsHelper.h>
#include <helpers/DeviceProxyHelper.h>
Olivier Roux's avatar
Olivier Roux committed

using namespace std;
namespace mph
{
	
class  MotionProxyHelper : public Tango::LogAdapter
{
public:

	//- ctor 
	MotionProxyHelper(	const string sProxyName,
						const string sDescription,
						Tango::DeviceImpl * _device)
	throw (Tango::DevFailed) ;

	//- ctor
	MotionProxyHelper(	const string sProxyName,
						const string sDescription,
						const string sAttributePositionName ,
						const string sCommandStateName,
						const string sCommandStopName,
						Tango::DeviceImpl * _device)
	throw (Tango::DevFailed) ;
Olivier Roux's avatar
Olivier Roux committed
	
	//- dtor 
	virtual ~MotionProxyHelper();
	
	//- Move motor to a new position
	virtual void Move(double)
	throw (Tango::DevFailed);

	//- Stop the motor
	virtual void Stop(void)
	throw (Tango::DevFailed);
	
	//- Forward the motor
	virtual void Forward(void)
	throw (Tango::DevFailed);
	
	//- Backward the motor
	virtual void Backward(void)
	throw (Tango::DevFailed);
	
	//- Read the read part of the attribute "attributePositionName" associated to the motor (call read_attribute)
	virtual double Read(void)
	throw (Tango::DevFailed);

	//- Read the write part of the attribute "attributePositionName" associated to the motor (call read_attribute_w)
	virtual double ReadW(void)
	throw (Tango::DevFailed);

	//- Read the the attribute "attributeBLSWName" associated to the motor (call read_attribute)
	bool ReadBLSW(void)
	throw (Tango::DevFailed);
	
	//- Read the the attribute "attributeFLSWName" associated to the motor (call read_attribute)
	bool ReadFLSW(void)
	throw (Tango::DevFailed);

	//- Read the state of the motor
	virtual Tango::DevState State(void)
	throw (Tango::DevFailed);
	
	//- Read the status of the motor
	string Status(void)
	throw (Tango::DevFailed);

	
protected:
	Tango::DeviceProxyHelper* 	_mProxy;
	string 					  	_sProxyName;
	string 					  	_sDescription;
	string 					  	_sAttributePositionName;
	string						_sAttributeBLSWName;
	string 						_sAttributeFLSWName;
	string 					  	_sCommandStateName;
	string 					  	_sCommandStatusName;	
	string 					  	_sCommandStopName;
	string 					  	_sCommandForwardName;
	string 					  	_sCommandBackwardName;	
private:	

};
}

////////////////////////////////////////////////////////////////////////////////

#endif // _MotionProxyHelper_H_