Skip to content
Snippets Groups Projects
Mks651d.h 12.3 KiB
Newer Older
Lorenzo Pivetta's avatar
Lorenzo Pivetta committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520
/*----- PROTECTED REGION ID(Mks651d.h) ENABLED START -----*/
//=============================================================================
//
// file :        Mks651d.h
//
// description : Include for the Mks651d class.
//
// project :     Mks651d.
//
// $Author: mdm $
//
// $Revision: 1.2 $
// $Date: 2012-03-08 09:50:01 $
//
// SVN only:
// $HeadURL:  $
//
// CVS only:
// $Source: /home/cvsadm/cvsroot/fermi/servers/651d/src/Mks651d.h,v $
// $Log: Mks651d.h,v $
// Revision 1.2  2012-03-08 09:50:01  mdm
// New version of server
//
//
//=============================================================================
//                This file is generated by POGO
//        (Program Obviously used to Generate tango Object)
//=============================================================================


#ifndef MKS651D_H
#define MKS651D_H


#include <tango.h>

/*----- PROTECTED REGION END -----*/


/**
 *	Mks651d class Description:
 *	
 */

namespace Mks651d_ns
{
	/*----- PROTECTED REGION ID(Mks651d::Additional Class Declarations) ENABLED START -----*/

		//		Additional Class Declarations

	/*----- PROTECTED REGION END -----*/	//	Mks651d::Additional Class Declarations


class Mks651d : public Tango::Device_4Impl
{


	/*----- PROTECTED REGION ID(Mks651d::Data Members) ENABLED START -----*/

	Tango::DeviceProxy* device_proxy;
	omni_mutex proxy_mutex;

	bool init_completed;
	double current_back_off;
	time_t last_exception_t;

	/*----- PROTECTED REGION END -----*/	//	Mks651d::Data Members


//	Device property data members
public:		//	SerialDevice:	
	string	serialDevice;
	//	Timeout:	
	Tango::DevULong	timeout;
	//	MaxBackOff:	
	Tango::DevLong	maxBackOff;
	//	ShowPressure:	
	Tango::DevBoolean	showPressure;
	

//	Attribute data members
public:
	Tango::DevDouble	*attr_Pressure_read;
	Tango::DevDouble	*attr_Position_read;
	Tango::DevShort	*attr_ControlType_read;
	Tango::DevShort	*attr_SensorType_read;
	Tango::DevShort	*attr_SensorVoltage_read;
	Tango::DevShort	*attr_SensorRange_read;
	Tango::DevShort	*attr_ControlMode_read;
	Tango::DevShort	*attr_ValveType_read;
	Tango::DevShort	*attr_AnalogSPRange_read;
	Tango::DevShort	*attr_SelectedSP_read;
	Tango::DevShort	*attr_PowerFailResponse_read;



//	Constructors and destructors
public:
	/**
	 * Constructs a newly allocated Command object.
	 *
	 *	@param cl	Class.
	 *	@param s 	Device Name
	 */
	Mks651d(Tango::DeviceClass *cl,string &s);
	/**
	 * Constructs a newly allocated Command object.
	 *
	 *	@param cl	Class.
	 *	@param s 	Device Name
	 */
	Mks651d(Tango::DeviceClass *cl,const char *s);
	/**
	 * Constructs a newly allocated Command object.
	 *
	 *	@param cl	Class.
	 *	@param s 	Device name
	 *	@param d	Device description.
	 */
	Mks651d(Tango::DeviceClass *cl,const char *s,const char *d);
	/**
	 * The object destructor.
	 */	
	~Mks651d() {delete_device();};



//	Miscellaneous methods
public:
	/**
	 *	will be called at device destruction or at init command.
	 */
	void delete_device();
	/**
	 *	Initialize the device
	 */
	virtual void init_device();
	/**
	 *	Read the device properties from database
	 */
	 void get_device_property();
	/**
	 *	Always executed method before execution command method.
	 */
	virtual void always_executed_hook();


//	Attribute methods
public:
	/**
	 *	Method      : Mks651d::read_attr_hardware()
	 *	Description : Hardware acquisition for attributes.
	 */
	virtual void read_attr_hardware(vector<long> &attr_list);


	/**
	 *	Pressure attribute related methods.
	 *	Description: 
	 *
	 *	Data type:	Tango::DevDouble
	 *	Attr type:	Scalar 
	 */
	virtual void read_Pressure(Tango::Attribute &attr);
	virtual bool is_Pressure_allowed(Tango::AttReqType type);



	/**
	 *	Position attribute related methods.
	 *	Description: 
	 *
	 *	Data type:	Tango::DevDouble
	 *	Attr type:	Scalar 
	 */
	virtual void read_Position(Tango::Attribute &attr);
	virtual bool is_Position_allowed(Tango::AttReqType type);



	/**
	 *	ControlType attribute related methods.
	 *	Description: Control type
 *	             0 = self tuning
 *	             1 = PID
	 *
	 *	Data type:	Tango::DevShort
	 *	Attr type:	Scalar 
	 */
	virtual void read_ControlType(Tango::Attribute &attr);
	virtual void write_ControlType(Tango::WAttribute &attr);
	virtual bool is_ControlType_allowed(Tango::AttReqType type);



	/**
	 *	SensorType attribute related methods.
	 *	Description: Sensor type
 *	             0 = Absolute
 *	             1 = Differential
	 *
	 *	Data type:	Tango::DevShort
	 *	Attr type:	Scalar 
	 */
	virtual void read_SensorType(Tango::Attribute &attr);
	virtual void write_SensorType(Tango::WAttribute &attr);
	virtual bool is_SensorType_allowed(Tango::AttReqType type);



	/**
	 *	SensorVoltage attribute related methods.
	 *	Description: Sensor voltage range:
 *	             0 = 1 Volt
 *	             1 = 5 Volts
 *	             2 = 10 Volts
	 *
	 *	Data type:	Tango::DevShort
	 *	Attr type:	Scalar 
	 */
	virtual void read_SensorVoltage(Tango::Attribute &attr);
	virtual void write_SensorVoltage(Tango::WAttribute &attr);
	virtual bool is_SensorVoltage_allowed(Tango::AttReqType type);



	/**
	 *	SensorRange attribute related methods.
	 *	Description: Sensor range:
 *	             00 = 0.1
 *	             01 = 0.2
 *	             02 = 0.5
 *	             03 = 1
 *	             04 = 2
 *	             05 = 5
 *	             06 = 10
 *	             07 = 50
 *	             08 = 100
 *	             09 = 500
 *	             10 = 1000
 *	             11 = 5000
 *	             12 = 10000
 *	             13 = 1.3
 *	             14 = 2.66
 *	             15 = 13.33
 *	             16 = 133.3
 *	             17 = 1333
 *	             18 = 6666
 *	             19 = 13332
	 *
	 *	Data type:	Tango::DevShort
	 *	Attr type:	Scalar 
	 */
	virtual void read_SensorRange(Tango::Attribute &attr);
	virtual void write_SensorRange(Tango::WAttribute &attr);
	virtual bool is_SensorRange_allowed(Tango::AttReqType type);



	/**
	 *	ControlMode attribute related methods.
	 *	Description: Control type:
 *	             0 = direct
 *	             1 = reverse
	 *
	 *	Data type:	Tango::DevShort
	 *	Attr type:	Scalar 
	 */
	virtual void read_ControlMode(Tango::Attribute &attr);
	virtual void write_ControlMode(Tango::WAttribute &attr);
	virtual bool is_ControlMode_allowed(Tango::AttReqType type);



	/**
	 *	ValveType attribute related methods.
	 *	Description: Valve type:
 *	             1 = Std 253
 *	             2 = Fast 253
 *	             3 = 653
	 *
	 *	Data type:	Tango::DevShort
	 *	Attr type:	Scalar 
	 */
	virtual void read_ValveType(Tango::Attribute &attr);
	virtual bool is_ValveType_allowed(Tango::AttReqType type);



	/**
	 *	AnalogSPRange attribute related methods.
	 *	Description: 0 = 5 Volts
 *	             1 = 10 Volts
	 *
	 *	Data type:	Tango::DevShort
	 *	Attr type:	Scalar 
	 */
	virtual void read_AnalogSPRange(Tango::Attribute &attr);
	virtual void write_AnalogSPRange(Tango::WAttribute &attr);
	virtual bool is_AnalogSPRange_allowed(Tango::AttReqType type);



	/**
	 *	SelectedSP attribute related methods.
	 *	Description: 0 = setpoint analog
 *	             1 = setpoint A
 *	             2 = setpoint B
 *	             3 = setpoint C
 *	             4 = setpoint D
 *	             5 = setpoint E
	 *
	 *	Data type:	Tango::DevShort
	 *	Attr type:	Scalar 
	 */
	virtual void read_SelectedSP(Tango::Attribute &attr);
	virtual bool is_SelectedSP_allowed(Tango::AttReqType type);



	/**
	 *	PowerFailResponse attribute related methods.
	 *	Description: Power fail response:
 *	             0 = disabled
 *	             1 = open at power fail
 *	             2 = close at power fail
	 *
	 *	Data type:	Tango::DevShort
	 *	Attr type:	Scalar 
	 */
	virtual void read_PowerFailResponse(Tango::Attribute &attr);
	virtual void write_PowerFailResponse(Tango::WAttribute &attr);
	virtual bool is_PowerFailResponse_allowed(Tango::AttReqType type);



	/**
	 *	Method      : Mks651d::add_dynamic_attributes()
	 *	Description : Add dynamic attributes if any.
	 */
		void add_dynamic_attributes();

//	Command related methods
public: 


	/**
	 *	Command Open related methods.
	 */
	void open();
	virtual bool is_Open_allowed(const CORBA::Any &any);

	/**
	 *	Command Close related methods.
	 */
	void close();
	virtual bool is_Close_allowed(const CORBA::Any &any);

	/**
	 *	Command Stop related methods.
	 */
	void stop();
	virtual bool is_Stop_allowed(const CORBA::Any &any);

	/**
	 *	Command SelectSP related methods.
	 */
	void select_sp(Tango::DevShort argin);
	virtual bool is_SelectSP_allowed(const CORBA::Any &any);

	/**
	 *	Command ReadSPLevel related methods.
	 */
	Tango::DevDouble read_splevel(Tango::DevShort argin);
	virtual bool is_ReadSPLevel_allowed(const CORBA::Any &any);

	/**
	 *	Command WriteSPLevel related methods.
	 */
	void write_splevel(const Tango::DevVarDoubleArray *argin);
	virtual bool is_WriteSPLevel_allowed(const CORBA::Any &any);

	/**
	 *	Command ReadSPType related methods.
	 */
	Tango::DevShort read_sptype(Tango::DevShort argin);
	virtual bool is_ReadSPType_allowed(const CORBA::Any &any);

	/**
	 *	Command WriteSPType related methods.
	 */
	void write_sptype(const Tango::DevVarShortArray *argin);
	virtual bool is_WriteSPType_allowed(const CORBA::Any &any);

	/**
	 *	Command ReadSoftStart related methods.
	 */
	Tango::DevDouble read_soft_start(Tango::DevShort argin);
	virtual bool is_ReadSoftStart_allowed(const CORBA::Any &any);

	/**
	 *	Command WriteSoftStart related methods.
	 */
	void write_soft_start(const Tango::DevVarDoubleArray *argin);
	virtual bool is_WriteSoftStart_allowed(const CORBA::Any &any);

	/**
	 *	Command ReadSPGain related methods.
	 */
	Tango::DevDouble read_spgain(Tango::DevShort argin);
	virtual bool is_ReadSPGain_allowed(const CORBA::Any &any);

	/**
	 *	Command WriteSPGain related methods.
	 */
	void write_spgain(const Tango::DevVarDoubleArray *argin);
	virtual bool is_WriteSPGain_allowed(const CORBA::Any &any);

	/**
	 *	Command ReadSPLead related methods.
	 */
	Tango::DevLong read_splead(Tango::DevShort argin);
	virtual bool is_ReadSPLead_allowed(const CORBA::Any &any);

	/**
	 *	Command WriteSPLead related methods.
	 */
	void write_splead(const Tango::DevVarLongArray *argin);
	virtual bool is_WriteSPLead_allowed(const CORBA::Any &any);

	/**
	 *	Command ReadThreshold related methods.
	 */
	Tango::DevDouble read_threshold(Tango::DevShort argin);
	virtual bool is_ReadThreshold_allowed(const CORBA::Any &any);

	/**
	 *	Command WriteThreshold related methods.
	 */
	void write_threshold(const Tango::DevVarDoubleArray *argin);
	virtual bool is_WriteThreshold_allowed(const CORBA::Any &any);

	/**
	 *	Command StartLearning related methods.
	 */
	void start_learning();
	virtual bool is_StartLearning_allowed(const CORBA::Any &any);

	/**
	 *	Command StopLearning related methods.
	 */
	void stop_learning();
	virtual bool is_StopLearning_allowed(const CORBA::Any &any);

	/**
	 *	Command LearnAnalog related methods.
	 */
	void learn_analog();
	virtual bool is_LearnAnalog_allowed(const CORBA::Any &any);

	/**
	 *	Command CalibrateAdc related methods.
	 */
	void calibrate_adc(Tango::DevDouble argin);
	virtual bool is_CalibrateAdc_allowed(const CORBA::Any &any);

	/**
	 *	Command ZeroSensor related methods.
	 */
	void zero_sensor();
	virtual bool is_ZeroSensor_allowed(const CORBA::Any &any);

	/**
	 *	Command RemoveZero related methods.
	 */
	void remove_zero();
	virtual bool is_RemoveZero_allowed(const CORBA::Any &any);

	/**
	 *	Command SetZero related methods.
	 */
	void set_zero(Tango::DevDouble argin);
	virtual bool is_SetZero_allowed(const CORBA::Any &any);

	/**
	 *	Command LearnZero related methods.
	 */
	void learn_zero();
	virtual bool is_LearnZero_allowed(const CORBA::Any &any);

	/**
	 *	Command DirectCommand related methods.
	 */
	Tango::DevString direct_command(Tango::DevString argin);
	virtual bool is_DirectCommand_allowed(const CORBA::Any &any);



	/*----- PROTECTED REGION ID(Mks651d::Additional Method prototypes) ENABLED START -----*/

	virtual void update_state();
	virtual bool update_state_allowed();
	virtual std::string serial_in_out(std::string, bool);
	virtual void exception_handler(Tango::DevFailed &, Tango::DevState, const std::string);
	virtual void strip_last(std::string &, char, int);
	virtual void strip_first(std::string &, char, int);

	/*----- PROTECTED REGION END -----*/	//	Mks651d::Additional Method prototypes

};

	/*----- PROTECTED REGION ID(Mks651d::Additional Classes Definitions) ENABLED START -----*/

	//	Additional Classes definitions

	/*----- PROTECTED REGION END -----*/	//	Mks651d::Additional Classes Definitions

} //	namespace

#endif	//	MKS651D_H