Select Git revision
RetrigAO.h
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
RetrigAO.h 14.39 KiB
//=============================================================================
//
// file : RetrigAO.h
//
// description : Include for the RetrigAO class.
//
// project : Retriggered Continuous Anolog Output
//
// $Author: vince_soleil $
//
// $Revision: 1.11 $
//
// $Log: not supported by cvs2svn $
// Revision 1.10 2010/03/11 11:10:25 anoureddine
// deplace #include <tango.h> due to conflict between tang7/ACE
//
// Revision 1.9 2009/09/29 07:56:13 anoureddine
// - Add BufferDepth property and use it to memorize bufferDepth attribute in order to keep compatibility wilth previous version
// - call init_board() in stop() command
//
// Revision 1.8 2009/09/16 08:10:54 anoureddine
// - Transform bufferDepth property into attribute.
// - Generate code with pogo 5.2.10
//
// Revision 1.7 2009/07/31 06:53:51 flanglois
// - support external sampling (conversionSource)
//
// Revision 1.6 2007/06/25 10:19:06 abeilleg
// save data in files+bug fix on config cpy
//
// Revision 1.5 2006/09/18 10:32:52 abeilleg
// added internal software support.
//
// Revision 1.4 2005/09/26 15:20:14 abeilleg
// zero forcing after stopping generation.
//
// Revision 1.3 2005/06/15 09:18:01 abeilleg
// attributes channelXEnable added.
//
// Revision 1.2 2005/01/24 15:42:47 abeilleg
// following ASL modifications (states management).
//
// Revision 1.1.1.1 2004/12/06 10:23:38 syldup
// initial import
//
//
// copyleft : Synchrotron SOLEIL
// L'Orme des Merisiers
// Saint-Aubin - BP 48
//
//=============================================================================
//
// This file is generated by POGO
// (Program Obviously used to Generate tango Object)
//
// (c) - Software Engineering Group - ESRF
//=============================================================================
#ifndef _RETRIGAO_H
#define _RETRIGAO_H
#include <tango.h>
#include <ADLinkContinuousAO.h>
//using namespace Tango;
//class ADLinkContinuousAO;
/**
* @author $Author: vince_soleil $
* @version $Revision: 1.11 $ $
*/
// Add your own constants definitions here.
//-----------------------------------------------
namespace RetrigAO_ns
{
/**
* Class Description:
* Perform continuous anolog ouput (waveform generation) on the selected outputs.
*/
/*
* Device States Description:
* Tango::UNKNOWN :
* Tango::STANDBY :
* Tango::RUNNING :
* Tango::FAULT :
*/
class RetrigAO: public Tango::Device_4Impl
{
public :
// Add your own data members here
//-----------------------------------------
// Here is the Start of the automatic code generation part
//-------------------------------------------------------------
/**
* @name attributes
* Attributs member data.
*/
//@{
Tango::DevUShort *attr_bufferDepth_read;
Tango::DevUShort attr_bufferDepth_write;
Tango::DevDouble *attr_errorCounter_read;
Tango::DevShort *attr_useBoardFifo_read;
Tango::DevShort *attr_channel0Enable_read;
Tango::DevShort *attr_channel1Enable_read;
Tango::DevShort *attr_channel2Enable_read;
Tango::DevShort *attr_channel3Enable_read;
Tango::DevShort *attr_channel4Enable_read;
Tango::DevShort *attr_channel5Enable_read;
Tango::DevShort *attr_channel6Enable_read;
Tango::DevShort *attr_channel7Enable_read;
Tango::DevDouble *attr_channel0_read;
Tango::DevDouble *attr_channel1_read;
Tango::DevDouble *attr_channel2_read;
Tango::DevDouble *attr_channel3_read;
Tango::DevDouble *attr_channel4_read;
Tango::DevDouble *attr_channel5_read;
Tango::DevDouble *attr_channel6_read;
Tango::DevDouble *attr_channel7_read;
//@}
/**
* @name Device properties
* Device properties member data.
*/
//@{
/**
* The number of the board in the chassis cPCI.
*/
Tango::DevUShort boardNum;
/**
* The output frequency (the rate the samples are outputed).
*/
Tango::DevDouble frequency;
/**
* Trigger mode: POST trigger or DELAY trigger.
*/
Tango::DevUShort triggerMode;
/**
* The trigger source.The possible values are internal trigger INTRIG, digital trigger
* DTRIG or analog trigger ATRIG.
*/
Tango::DevUShort triggerSource;
/**
* select the type of analog trigger. Can be BELOW (trigger occurs below ATRIGLevel)
* or can be ABOVE (trigger occurs above ATRIGLevel).
*/
Tango::DevUShort aTRIGSelection;
/**
* The analog trigger level in volts.
*/
Tango::DevDouble aTRIGLevel;
/**
* The edges on which the trigger are detected. Can be RISING or FALLING.
*/
Tango::DevUShort dTRIGPolarity;
/**
* The value of the reference voltage gave on pin AORefA.
*/
Tango::DevDouble aORefA;
/**
* The value of the reference voltage gave on pin AORefB.
*/
Tango::DevDouble aORefB;
/**
* BP for unipolar outputs or UP for bipolar outputs.
*/
Tango::DevUShort polarity;
/**
* Select the internal reference (10.0 volts) with INTERN or the external references
* AORefA and AORefB with EXTERN.
*/
Tango::DevUShort aORefSource;
/**
* 1 if enable channel 0, 0 otherwise.
*/
Tango::DevShort channel0Enable;
/**
* 1 if enable channel 1, 0 otherwise.
*/
Tango::DevShort channel1Enable;
/**
* 1 if enable channel 2, 0 otherwise.
*/
Tango::DevShort channel2Enable;
/**
* 1 if enable channel 3, 0 otherwise.
*/
Tango::DevShort channel3Enable;
/**
* 1 if enable channel 4, 0 otherwise.
*/
Tango::DevShort channel4Enable;
/**
* 1 if enable channel 5, 0 otherwise.
*/
Tango::DevShort channel5Enable;
/**
* 1 if enable channel 6, 0 otherwise.
*/
Tango::DevShort channel6Enable;
/**
* 1 if enable channel 7, 0 otherwise.
*/
Tango::DevShort channel7Enable;
/**
* If trigger mode is delay, configure the delay in seconds.
*/
Tango::DevUShort delay;
/**
* The buffer depth for <b>one channel</b>
*/
Tango::DevUShort bufferDepth;
/**
* The waveform for channel 0 (attribute persistency).
*/
vector<double> channel0Waveform;
/**
* The waveform for channel 1 (attribute persistency).
*/
vector<double> channel1Waveform;
/**
* The waveform for channel 2 (attribute persistency).
*/
vector<double> channel2Waveform;
/**
* The waveform for channel 3 (attribute persistency).
*/
vector<double> channel3Waveform;
/**
* The waveform for channel 4 (attribute persistency).
*/
vector<double> channel4Waveform;
/**
* The waveform for channel 5 (attribute persistency).
*/
vector<double> channel5Waveform;
/**
* The waveform for channel 6 (attribute persistency).
*/
vector<double> channel6Waveform;
/**
* The waveform for channel 7 (attribute persistency).
*/
vector<double> channel7Waveform;
/**
* The path to waveforms persistancy files
*/
string filePath;
/**
* Set the AO conversion signal source (i.e. DAC sampling source).
* Use one of the following: INTERNAL, EXTSAMPLING.
*/
Tango::DevUShort conversionSource;
//@}
/**@name Constructors
* Miscellaneous constructors */
//@{
/**
* Constructs a newly allocated Command object.
*
* @param cl Class.
* @param s Device Name
*/
RetrigAO(Tango::DeviceClass *cl,string &s);
/**
* Constructs a newly allocated Command object.
*
* @param cl Class.
* @param s Device Name
*/
RetrigAO(Tango::DeviceClass *cl,const char *s);
/**
* Constructs a newly allocated Command object.
*
* @param cl Class.
* @param s Device name
* @param d Device description.
*/
RetrigAO(Tango::DeviceClass *cl,const char *s,const char *d);
//@}
/**@name Destructor
* Only one desctructor is defined for this class */
//@{
/**
* The object desctructor.
*/
~RetrigAO() { delete_device(); };
/**
* will be called at device destruction or at init command.
*/
void delete_device();
//@}
/**@name Miscellaneous methods */
//@{
/**
* Initialize the device
*/
virtual void init_device();
/**
* Always executed method befor execution command method.
*/
virtual void always_executed_hook();
//@}
/**
* @name RetrigAO methods prototypes
*/
//@{
/**
* Hardware acquisition for attributes.
*/
virtual void read_attr_hardware(vector<long> &attr_list);
/**
* Extract real attribute values for bufferDepth acquisition result.
*/
virtual void read_bufferDepth(Tango::Attribute &attr);
/**
* Write bufferDepth attribute values to hardware.
*/
virtual void write_bufferDepth(Tango::WAttribute &attr);
/**
* Extract real attribute values for errorCounter acquisition result.
*/
virtual void read_errorCounter(Tango::Attribute &attr);
/**
* Extract real attribute values for useBoardFifo acquisition result.
*/
virtual void read_useBoardFifo(Tango::Attribute &attr);
/**
* Extract real attribute values for channel0Enable acquisition result.
*/
virtual void read_channel0Enable(Tango::Attribute &attr);
/**
* Extract real attribute values for channel1Enable acquisition result.
*/
virtual void read_channel1Enable(Tango::Attribute &attr);
/**
* Extract real attribute values for channel2Enable acquisition result.
*/
virtual void read_channel2Enable(Tango::Attribute &attr);
/**
* Extract real attribute values for channel3Enable acquisition result.
*/
virtual void read_channel3Enable(Tango::Attribute &attr);
/**
* Extract real attribute values for channel4Enable acquisition result.
*/
virtual void read_channel4Enable(Tango::Attribute &attr);
/**
* Extract real attribute values for channel5Enable acquisition result.
*/
virtual void read_channel5Enable(Tango::Attribute &attr);
/**
* Extract real attribute values for channel6Enable acquisition result.
*/
virtual void read_channel6Enable(Tango::Attribute &attr);
/**
* Extract real attribute values for channel7Enable acquisition result.
*/
virtual void read_channel7Enable(Tango::Attribute &attr);
/**
* Extract real attribute values for channel0 acquisition result.
*/
virtual void read_channel0(Tango::Attribute &attr);
/**
* Extract real attribute values for channel1 acquisition result.
*/
virtual void read_channel1(Tango::Attribute &attr);
/**
* Extract real attribute values for channel2 acquisition result.
*/
virtual void read_channel2(Tango::Attribute &attr);
/**
* Extract real attribute values for channel3 acquisition result.
*/
virtual void read_channel3(Tango::Attribute &attr);
/**
* Extract real attribute values for channel4 acquisition result.
*/
virtual void read_channel4(Tango::Attribute &attr);
/**
* Extract real attribute values for channel5 acquisition result.
*/
virtual void read_channel5(Tango::Attribute &attr);
/**
* Extract real attribute values for channel6 acquisition result.
*/
virtual void read_channel6(Tango::Attribute &attr);
/**
* Extract real attribute values for channel7 acquisition result.
*/
virtual void read_channel7(Tango::Attribute &attr);
/**
* Read/Write allowed for bufferDepth attribute.
*/
virtual bool is_bufferDepth_allowed(Tango::AttReqType type);
/**
* Read/Write allowed for errorCounter attribute.
*/
virtual bool is_errorCounter_allowed(Tango::AttReqType type);
/**
* Read/Write allowed for useBoardFifo attribute.
*/
virtual bool is_useBoardFifo_allowed(Tango::AttReqType type);
/**
* Read/Write allowed for channel0Enable attribute.
*/
virtual bool is_channel0Enable_allowed(Tango::AttReqType type);
/**
* Read/Write allowed for channel1Enable attribute.
*/
virtual bool is_channel1Enable_allowed(Tango::AttReqType type);
/**
* Read/Write allowed for channel2Enable attribute.
*/
virtual bool is_channel2Enable_allowed(Tango::AttReqType type);
/**
* Read/Write allowed for channel3Enable attribute.
*/
virtual bool is_channel3Enable_allowed(Tango::AttReqType type);
/**
* Read/Write allowed for channel4Enable attribute.
*/
virtual bool is_channel4Enable_allowed(Tango::AttReqType type);
/**
* Read/Write allowed for channel5Enable attribute.
*/
virtual bool is_channel5Enable_allowed(Tango::AttReqType type);
/**
* Read/Write allowed for channel6Enable attribute.
*/
virtual bool is_channel6Enable_allowed(Tango::AttReqType type);
/**
* Read/Write allowed for channel7Enable attribute.
*/
virtual bool is_channel7Enable_allowed(Tango::AttReqType type);
/**
* Read/Write allowed for channel0 attribute.
*/
virtual bool is_channel0_allowed(Tango::AttReqType type);
/**
* Read/Write allowed for channel1 attribute.
*/
virtual bool is_channel1_allowed(Tango::AttReqType type);
/**
* Read/Write allowed for channel2 attribute.
*/
virtual bool is_channel2_allowed(Tango::AttReqType type);
/**
* Read/Write allowed for channel3 attribute.
*/
virtual bool is_channel3_allowed(Tango::AttReqType type);
/**
* Read/Write allowed for channel4 attribute.
*/
virtual bool is_channel4_allowed(Tango::AttReqType type);
/**
* Read/Write allowed for channel5 attribute.
*/
virtual bool is_channel5_allowed(Tango::AttReqType type);
/**
* Read/Write allowed for channel6 attribute.
*/
virtual bool is_channel6_allowed(Tango::AttReqType type);
/**
* Read/Write allowed for channel7 attribute.
*/
virtual bool is_channel7_allowed(Tango::AttReqType type);
/**
* Execution allowed for Start command.
*/
virtual bool is_Start_allowed(const CORBA::Any &any);
/**
* Execution allowed for Stop command.
*/
virtual bool is_Stop_allowed(const CORBA::Any &any);
/**
* Execution allowed for SetAOScaledData command.
*/
virtual bool is_SetAOScaledData_allowed(const CORBA::Any &any);
/**
* start the generation.
* @exception DevFailed
*/
void start();
/**
* stop the generation.
* @exception DevFailed
*/
void stop();
/**
* Give one period of the signal to generated of a specified channel in volts.
* @param argin The channel number ,in string). The output data in volts ,in double)
* @exception DevFailed
*/
void set_aoscaled_data(const Tango::DevVarDoubleStringArray *);
/**
* Read the device properties from database
*/
void get_device_property();
//@}
// Here is the end of the automatic code generation part
//-------------------------------------------------------------
protected :
// Add your own data members here
//-----------------------------------------
ADLinkContinuousAO* ao;
void set_internal_state(void);
void stop_with_zero_forcing();
double* ch0;
double* ch1;
double* ch2;
double* ch3;
double* ch4;
double* ch5;
double* ch6;
double* ch7;
double err_ctr;
short use_fifo;
//- Store the values into the property
//- Properties stuff
int FindIndexFromPropertyName(Tango::DbData& dev_prop, string property_name);
template <class T>
void create_property_if_empty(Tango::DbData& dev_prop,T value, string property_name);
template <class T>
void store_value_as_property(T value, string property_name);
void save_waveform(double* waveform, string wfm_channel);
void load_waveform(double* waveform, string wfm_channel);
void init_board(void);
asl::ContinuousAOConfig config;
asl::ContinuousAOConfig stop_config;
};
} // namespace
#endif // _RETRIGAO_H