Newer
Older
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
/*----- PROTECTED REGION ID(SimulatedE2PS.h) ENABLED START -----*/
/* clang-format on */
//=============================================================================
//
// file : SimulatedE2PS.h
//
// description : Include file for the SimulatedE2PS class
//
// project : SimulatedE2PS
//
// This file is part of Tango device class.
//
// Tango is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Tango is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Tango. If not, see <http://www.gnu.org/licenses/>.
//
//
//
//=============================================================================
// This file is generated by POGO
// (Program Obviously used to Generate tango Object)
//=============================================================================
#ifndef SimulatedE2PS_H
#define SimulatedE2PS_H
#include <tango/tango.h>
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // SimulatedE2PS.h
#ifdef TANGO_LOG
// cppTango after c934adea (Merge branch 'remove-cout-definition' into 'main', 2022-05-23)
// nothing to do
#else
// cppTango 9.3-backports and older
#define TANGO_LOG cout
#define TANGO_LOG_INFO cout2
#define TANGO_LOG_DEBUG cout3
#endif // TANGO_LOG
/**
* SimulatedE2PS class description:
* Simulated power supply for Elettra 2.0 tests (digiltal twin).
* Tango interface Loosely based on NGPS tango device
*/
namespace SimulatedE2PS_ns
{
/*----- PROTECTED REGION ID(SimulatedE2PS::Additional Class Declarations) ENABLED START -----*/
/* clang-format on */
// Additional Class Declarations
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // SimulatedE2PS::Additional Class Declarations
class SimulatedE2PS : public TANGO_BASE_CLASS
{
/*----- PROTECTED REGION ID(SimulatedE2PS::Data Members) ENABLED START -----*/
/* clang-format on */
// Add your own data members
friend class cyclethread;
protected :
double _current;
double _current_read;
double _current_ripple;
double _voltage;
double _ohm;
bool _busy;
bool _add_ripple;
unsigned int rand_r_seed;
class cyclethread *cycleloop;
bool thread_running;
bool abortflag;
//void psdelay();
Tango::WAttribute *attr_current;
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // SimulatedE2PS::Data Members
// Device property data members
public:
// CurrentRipple: Residual current oscillation [A]
//
// The simulator adds noise of CurrenRipple amplitude to the reading
Tango::DevDouble currentRipple;
// Attribute data members
public:
Tango::DevDouble *attr_current_read;
Tango::DevDouble *attr_voltage_read;
Tango::DevDouble *attr_currentSet_read;
Tango::DevDouble *attr_CurrentRipple_read;
Tango::DevBoolean *attr_AddRipple_read;
// Constructors and destructors
public:
/**
* Constructs a newly device object.
*
* @param cl Class.
* @param s Device Name
*/
SimulatedE2PS(Tango::DeviceClass *cl,std::string &s);
/**
* Constructs a newly device object.
*
* @param cl Class.
* @param s Device Name
*/
SimulatedE2PS(Tango::DeviceClass *cl,const char *s);
/**
* Constructs a newly device object.
*
* @param cl Class.
* @param s Device name
* @param d Device description.
*/
SimulatedE2PS(Tango::DeviceClass *cl,const char *s,const char *d);
/**
* The device object destructor.
*/
~SimulatedE2PS();
// 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 : SimulatedE2PS::read_attr_hardware()
* Description: Hardware acquisition for attributes.
*/
//--------------------------------------------------------
virtual void read_attr_hardware(std::vector<long> &attr_list);
//--------------------------------------------------------
/*
* Method : SimulatedE2PS::write_attr_hardware()
* Description: Hardware writing for attributes.
*/
//--------------------------------------------------------
virtual void write_attr_hardware(std::vector<long> &attr_list);
/**
* Attribute current related methods
* Description: The powersupply current setting in amps
*
* Data type: Tango::DevDouble
* Attr type: Scalar
*/
virtual void read_current(Tango::Attribute &attr);
virtual void write_current(Tango::WAttribute &attr);
virtual bool is_current_allowed(Tango::AttReqType type);
/**
* Attribute voltage related methods
* Description: The powersupply voltage in volts.
*
* Data type: Tango::DevDouble
* Attr type: Scalar
*/
virtual void read_voltage(Tango::Attribute &attr);
virtual bool is_voltage_allowed(Tango::AttReqType type);
/**
* Attribute currentSet related methods
* Description: The current set value as stored in the powersupply.
*
* Data type: Tango::DevDouble
* Attr type: Scalar
*/
virtual void read_currentSet(Tango::Attribute &attr);
virtual bool is_currentSet_allowed(Tango::AttReqType type);
/**
* Attribute CurrentRipple related methods
* Description: Amplitude of current ripple (noise) added to output.
* Initial value from property CurrentRipple
*
* Data type: Tango::DevDouble
* Attr type: Scalar
*/
virtual void read_CurrentRipple(Tango::Attribute &attr);
virtual void write_CurrentRipple(Tango::WAttribute &attr);
virtual bool is_CurrentRipple_allowed(Tango::AttReqType type);
/**
* Attribute AddRipple related methods
* Description: Switch on/off current ripple. If False the power supply is ideal :no noise.
*
* Data type: Tango::DevBoolean
* Attr type: Scalar
*/
virtual void read_AddRipple(Tango::Attribute &attr);
virtual void write_AddRipple(Tango::WAttribute &attr);
virtual bool is_AddRipple_allowed(Tango::AttReqType type);
//--------------------------------------------------------
/**
* Method : SimulatedE2PS::add_dynamic_attributes()
* Description: Add dynamic attributes if any.
*/
//--------------------------------------------------------
void add_dynamic_attributes();
// Command related methods
public:
/**
* Command On related method
* Description: Switch powersupply ON.
*
*/
virtual void on();
virtual bool is_On_allowed(const CORBA::Any &any);
/**
* Command Off related method
* Description: Switch power supply OFF.
*
*/
virtual void off();
virtual bool is_Off_allowed(const CORBA::Any &any);
/**
* Command Reset related method
* Description: Reset the powersupply to a well known state.
*
*/
virtual void reset();
virtual bool is_Reset_allowed(const CORBA::Any &any);
/**
* Command StartCycling related method
*
*
*/
virtual void start_cycling();
virtual bool is_StartCycling_allowed(const CORBA::Any &any);
/**
* Command Abort related method
* Description: stop ramp or cycling
*
*/
virtual void abort();
virtual bool is_Abort_allowed(const CORBA::Any &any);
/**
* Command Fault related method
* Description: Force a simulated faulty condtion
*
*/
virtual void fault();
virtual bool is_Fault_allowed(const CORBA::Any &any);
//--------------------------------------------------------
/**
* Method : SimulatedE2PS::add_dynamic_commands()
* Description: Add dynamic commands if any.
*/
//--------------------------------------------------------
void add_dynamic_commands();
/*----- PROTECTED REGION ID(SimulatedE2PS::Additional Method prototypes) ENABLED START -----*/
/* clang-format on */
// Additional Method prototypes
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // SimulatedE2PS::Additional Method prototypes
};
/*----- PROTECTED REGION ID(SimulatedE2PS::Additional Classes Definitions) ENABLED START -----*/
/* clang-format on */
// Additional Classes Definitions
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // SimulatedE2PS::Additional Classes Definitions
} // End of namespace
#endif // SimulatedE2PS_H