forked from aduc812/xTDC4-tango
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathXTDC4.cpp
2105 lines (1919 loc) · 74.2 KB
/
XTDC4.cpp
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
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*----- PROTECTED REGION ID(XTDC4.cpp) ENABLED START -----*/
static const char *RcsId = "$Id: $";
//=============================================================================
//
// file : XTDC4.cpp
//
// description : C++ source for the XTDC4 class and its commands.
// The class is derived from Device. It represents the
// CORBA servant object which will be accessed from the
// network. All commands which can be executed on the
// XTDC4 are implemented in this file.
//
// project : xTDC4_DevServer
//
// 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/>.
//
// $Author: $
//
// $Revision: $
// $Date: $
//
// $HeadURL: $
//
//=============================================================================
// This file is generated by POGO
// (Program Obviously used to Generate tango Object)
//=============================================================================
#include <XTDC4.h>
#include <XTDC4Class.h>
#include <thread>
// this inclused proprietary xTDC4 libray by chronologic
#include "xTDC4_interface.h"
/*----- PROTECTED REGION END -----*/ // XTDC4.cpp
/**
* XTDC4 class description:
* https://www.cronologic.de/time_measurement/tdc/xtdc4/
*/
//================================================================
// The following table gives the correspondence
// between command and method names.
//
// Command name | Method name
//================================================================
// State | Inherited (no method)
// Status | Inherited (no method)
// Start | start
// Stop | stop
// Off | off
// apply_config | apply_config
// Clear | clear
//================================================================
//================================================================
// Attributes managed are:
//================================================================
// error_code | Tango::DevLong Scalar
// error_message | Tango::DevString Scalar
// device_type | Tango::DevShort Scalar
// START_RISING | Tango::DevBoolean Scalar
// START_DC_OFFSET | Tango::DevDouble Scalar
// CH0_ENABLED | Tango::DevBoolean Scalar
// CH0_RISING | Tango::DevBoolean Scalar
// CH0_DC_OFFSET | Tango::DevDouble Scalar
// CH1_ENABLED | Tango::DevBoolean Scalar
// CH1_RISING | Tango::DevBoolean Scalar
// CH1_DC_OFFSET | Tango::DevDouble Scalar
// CH2_ENABLED | Tango::DevBoolean Scalar
// CH2_RISING | Tango::DevBoolean Scalar
// CH2_DC_OFFSET | Tango::DevDouble Scalar
// CH3_ENABLED | Tango::DevBoolean Scalar
// CH3_RISING | Tango::DevBoolean Scalar
// CH3_DC_OFFSET | Tango::DevDouble Scalar
// TW_START | Tango::DevLong64 Scalar
// TW_END | Tango::DevLong64 Scalar
// config_changed | Tango::DevBoolean Scalar
// start_trigger_generator | Tango::DevBoolean Scalar
// last_run_valid_starts | Tango::DevLong Scalar
// last_run_empty_starts | Tango::DevLong Scalar
// last_run_hits | Tango::DevLong Scalar
// last_run_start_errors | Tango::DevLong Scalar
// start_trigger_generator_frequency | Tango::DevLong Scalar
// run_timeout | Tango::DevDouble Scalar
// firmware_revision | Tango::DevLong Scalar
// driver_version | Tango::DevLong Scalar
// board_serial | Tango::DevLong Scalar
// bin_size | Tango::DevDouble Scalar
// trigger_number | Tango::DevULong64 Scalar
// CH0_Timestamps | Tango::DevULong64 Spectrum ( max = 1400000)
// CH1_Timestamps | Tango::DevULong64 Spectrum ( max = 1400000)
// CH2_Timestamps | Tango::DevULong64 Spectrum ( max = 1400000)
// CH3_Timestamps | Tango::DevULong64 Spectrum ( max = 1400000)
//================================================================
namespace XTDC4_ns
{
/*----- PROTECTED REGION ID(XTDC4::namespace_starting) ENABLED START -----*/
// static initializations
xtdc4_device * this_device_ref;
#define NUMBER_OF_EXPOSED_CHANNELS 4
#define MAX_TIMESTAMPS_BUFFER_SIZE 1400000 // this is a number generated by pogo, too bad it is not defined by it!
std::queue <datachunk*> datachunk_list[NUMBER_OF_EXPOSED_CHANNELS];
int bTerminatePolingThread;
std::thread * poller_thread_ref;
__int64 run_timeout_ticks;
__int64 first_start_timestamp;
unsigned long start_counter;
/*----- PROTECTED REGION END -----*/ // XTDC4::namespace_starting
//--------------------------------------------------------
/**
* Method : XTDC4::XTDC4()
* Description : Constructors for a Tango device
* implementing the classXTDC4
*/
//--------------------------------------------------------
XTDC4::XTDC4(Tango::DeviceClass *cl, string &s)
: TANGO_BASE_CLASS(cl, s.c_str())
{
/*----- PROTECTED REGION ID(XTDC4::constructor_1) ENABLED START -----*/
init_device();
/*----- PROTECTED REGION END -----*/ // XTDC4::constructor_1
}
//--------------------------------------------------------
XTDC4::XTDC4(Tango::DeviceClass *cl, const char *s)
: TANGO_BASE_CLASS(cl, s)
{
/*----- PROTECTED REGION ID(XTDC4::constructor_2) ENABLED START -----*/
init_device();
/*----- PROTECTED REGION END -----*/ // XTDC4::constructor_2
}
//--------------------------------------------------------
XTDC4::XTDC4(Tango::DeviceClass *cl, const char *s, const char *d)
: TANGO_BASE_CLASS(cl, s, d)
{
/*----- PROTECTED REGION ID(XTDC4::constructor_3) ENABLED START -----*/
init_device();
/*----- PROTECTED REGION END -----*/ // XTDC4::constructor_3
}
//--------------------------------------------------------
/**
* Method : XTDC4::delete_device()
* Description : will be called at device destruction or at init command
*/
//--------------------------------------------------------
void XTDC4::delete_device()
{
DEBUG_STREAM << "XTDC4::delete_device() " << device_name << endl;
/*----- PROTECTED REGION ID(XTDC4::delete_device) ENABLED START -----*/
// must terminate the polling thread if still running
if (state() == Tango::DevState::RUNNING || state() == Tango::DevState::STANDBY)
{
bTerminatePolingThread = 1;
while (state() == Tango::DevState::RUNNING || state() == Tango::DevState::STANDBY)
// when terminated gracefully, the thread sets bTerminatePolingThread back to zero
{
Sleep(10);
}
}
// Delete device allocated objects
xtdc4_close(this_device_ref);
set_state(Tango::DevState::OFF);
// clear the output buffer queue (and delete its datachunks)
clear();
delete[] attr_error_message_read[0]; // unallocate memory for error message
/*----- PROTECTED REGION END -----*/ // XTDC4::delete_device
delete[] attr_error_code_read;
delete[] attr_error_message_read;
delete[] attr_device_type_read;
delete[] attr_START_RISING_read;
delete[] attr_START_DC_OFFSET_read;
delete[] attr_CH0_ENABLED_read;
delete[] attr_CH0_RISING_read;
delete[] attr_CH0_DC_OFFSET_read;
delete[] attr_CH1_ENABLED_read;
delete[] attr_CH1_RISING_read;
delete[] attr_CH1_DC_OFFSET_read;
delete[] attr_CH2_ENABLED_read;
delete[] attr_CH2_RISING_read;
delete[] attr_CH2_DC_OFFSET_read;
delete[] attr_CH3_ENABLED_read;
delete[] attr_CH3_RISING_read;
delete[] attr_CH3_DC_OFFSET_read;
delete[] attr_TW_START_read;
delete[] attr_TW_END_read;
delete[] attr_config_changed_read;
delete[] attr_start_trigger_generator_read;
delete[] attr_last_run_valid_starts_read;
delete[] attr_last_run_empty_starts_read;
delete[] attr_last_run_hits_read;
delete[] attr_last_run_start_errors_read;
delete[] attr_start_trigger_generator_frequency_read;
delete[] attr_run_timeout_read;
delete[] attr_firmware_revision_read;
delete[] attr_driver_version_read;
delete[] attr_board_serial_read;
delete[] attr_bin_size_read;
delete[] attr_trigger_number_read;
delete[] attr_CH0_Timestamps_read;
delete[] attr_CH1_Timestamps_read;
delete[] attr_CH2_Timestamps_read;
delete[] attr_CH3_Timestamps_read;
}
//--------------------------------------------------------
/**
* Method : XTDC4::init_device()
* Description : will be called at device initialization.
*/
//--------------------------------------------------------
void XTDC4::init_device()
{
DEBUG_STREAM << "XTDC4::init_device() create device " << device_name << endl;
/*----- PROTECTED REGION ID(XTDC4::init_device_before) ENABLED START -----*/
// Initialization before get_device_property() call
bTerminatePolingThread = 0;
/*----- PROTECTED REGION END -----*/ // XTDC4::init_device_before
// Get the device properties from database
get_device_property();
attr_error_code_read = new Tango::DevLong[1];
attr_error_message_read = new Tango::DevString[1];
attr_device_type_read = new Tango::DevShort[1];
attr_START_RISING_read = new Tango::DevBoolean[1];
attr_START_DC_OFFSET_read = new Tango::DevDouble[1];
attr_CH0_ENABLED_read = new Tango::DevBoolean[1];
attr_CH0_RISING_read = new Tango::DevBoolean[1];
attr_CH0_DC_OFFSET_read = new Tango::DevDouble[1];
attr_CH1_ENABLED_read = new Tango::DevBoolean[1];
attr_CH1_RISING_read = new Tango::DevBoolean[1];
attr_CH1_DC_OFFSET_read = new Tango::DevDouble[1];
attr_CH2_ENABLED_read = new Tango::DevBoolean[1];
attr_CH2_RISING_read = new Tango::DevBoolean[1];
attr_CH2_DC_OFFSET_read = new Tango::DevDouble[1];
attr_CH3_ENABLED_read = new Tango::DevBoolean[1];
attr_CH3_RISING_read = new Tango::DevBoolean[1];
attr_CH3_DC_OFFSET_read = new Tango::DevDouble[1];
attr_TW_START_read = new Tango::DevLong64[1];
attr_TW_END_read = new Tango::DevLong64[1];
attr_config_changed_read = new Tango::DevBoolean[1];
attr_start_trigger_generator_read = new Tango::DevBoolean[1];
attr_last_run_valid_starts_read = new Tango::DevLong[1];
attr_last_run_empty_starts_read = new Tango::DevLong[1];
attr_last_run_hits_read = new Tango::DevLong[1];
attr_last_run_start_errors_read = new Tango::DevLong[1];
attr_start_trigger_generator_frequency_read = new Tango::DevLong[1];
attr_run_timeout_read = new Tango::DevDouble[1];
attr_firmware_revision_read = new Tango::DevLong[1];
attr_driver_version_read = new Tango::DevLong[1];
attr_board_serial_read = new Tango::DevLong[1];
attr_bin_size_read = new Tango::DevDouble[1];
attr_trigger_number_read = new Tango::DevULong64[1];
attr_CH0_Timestamps_read = new Tango::DevULong64[1400000];
attr_CH1_Timestamps_read = new Tango::DevULong64[1400000];
attr_CH2_Timestamps_read = new Tango::DevULong64[1400000];
attr_CH3_Timestamps_read = new Tango::DevULong64[1400000];
/*----- PROTECTED REGION ID(XTDC4::init_device) ENABLED START -----*/
// Initialize device
xtdc4_init_parameters params;
xtdc4_get_default_init_parameters(¶ms);
params.buffer_size[0] = buffer_size; // packet buffer
params.board_id = board_id; // number copied to "card" field of every packet, allowed range 0..255
params.card_index = card_index; // ordering depends on PCIe slot position if more than one card is present
params.use_ext_clock = use_ext_clock; // 0: internal 10 MHz reference // 1: external 10 MHz reference connected to J12
// initialize card
int error_code;
const char * error_message;
this_device_ref = xtdc4_init(¶ms, &error_code, &error_message);
attr_error_code_read[0] = error_code;
attr_error_message_read[0] = new char[255];
strcpy_s(attr_error_message_read[0], 255, error_message);
if (error_code != CRONO_OK)
{
set_state(Tango::DevState::FAULT);
}
else
{
set_state(Tango::DevState::ON);
}
// fill in default config values. When the device is first installed, these will be read.
attr_START_RISING_read[0]=0;
attr_START_DC_OFFSET_read[0] = 0;
attr_CH0_ENABLED_read[0] = 0;
attr_CH0_RISING_read[0] = 0;
attr_CH0_DC_OFFSET_read[0] = 0;
attr_CH1_ENABLED_read[0] = 0;
attr_CH1_RISING_read[0] = 0;
attr_CH1_DC_OFFSET_read[0] = 0;
attr_CH2_ENABLED_read[0] = 0;
attr_CH2_RISING_read[0] = 0;
attr_CH2_DC_OFFSET_read[0] = 0;
attr_CH3_ENABLED_read[0] = 0;
attr_CH3_RISING_read[0] = 0;
attr_CH3_DC_OFFSET_read[0] = 0;
attr_TW_START_read[0] = 0;
attr_TW_END_read[0] = 0x3fffffff;
attr_config_changed_read[0] = 1;
attr_start_trigger_generator_read[0] = 0; // internal trigger disabled at startup
attr_start_trigger_generator_frequency_read[0] = 2000; // 2kHz default
attr_last_run_valid_starts_read[0] = 0;
attr_last_run_empty_starts_read[0] = 0;
attr_last_run_hits_read[0] = 0;
attr_last_run_start_errors_read[0] = 0;
attr_run_timeout_read[0] = 0;
// apply default config
apply_config();
// read device hardware parameters
attr_device_type_read[0] = xtdc4_get_device_type(this_device_ref);
xtdc4_static_info st_info;
xtdc4_get_static_info(this_device_ref, &st_info);
attr_firmware_revision_read[0] = st_info.firmware_revision;
attr_driver_version_read[0] = st_info.driver_revision;
attr_board_serial_read[0] = st_info.board_serial;
xtdc4_param_info p_info;
xtdc4_get_param_info(this_device_ref, &p_info);
attr_bin_size_read[0] = p_info.binsize;
attr_trigger_number_read[0] = 0;
start_counter = 0;
set_change_event("trigger_number", true);
set_change_event("CH0_Timestamps",true);
set_change_event("CH1_Timestamps", true);
set_change_event("CH2_Timestamps", true);
set_change_event("CH3_Timestamps", true);
/*----- PROTECTED REGION END -----*/ // XTDC4::init_device
}
//--------------------------------------------------------
/**
* Method : XTDC4::get_device_property()
* Description : Read database to initialize property data members.
*/
//--------------------------------------------------------
void XTDC4::get_device_property()
{
/*----- PROTECTED REGION ID(XTDC4::get_device_property_before) ENABLED START -----*/
// Initialize property data members
/*----- PROTECTED REGION END -----*/ // XTDC4::get_device_property_before
// Read device properties from database.
Tango::DbData dev_prop;
dev_prop.push_back(Tango::DbDatum("buffer_size"));
dev_prop.push_back(Tango::DbDatum("board_id"));
dev_prop.push_back(Tango::DbDatum("card_index"));
dev_prop.push_back(Tango::DbDatum("use_ext_clock"));
dev_prop.push_back(Tango::DbDatum("push_events"));
// is there at least one property to be read ?
if (dev_prop.size()>0)
{
// Call database and extract values
if (Tango::Util::instance()->_UseDb==true)
get_db_device()->get_property(dev_prop);
// get instance on XTDC4Class to get class property
Tango::DbDatum def_prop, cl_prop;
XTDC4Class *ds_class =
(static_cast<XTDC4Class *>(get_device_class()));
int i = -1;
// Try to initialize buffer_size from class property
cl_prop = ds_class->get_class_property(dev_prop[++i].name);
if (cl_prop.is_empty()==false) cl_prop >> buffer_size;
else {
// Try to initialize buffer_size from default device value
def_prop = ds_class->get_default_device_property(dev_prop[i].name);
if (def_prop.is_empty()==false) def_prop >> buffer_size;
}
// And try to extract buffer_size value from database
if (dev_prop[i].is_empty()==false) dev_prop[i] >> buffer_size;
// Try to initialize board_id from class property
cl_prop = ds_class->get_class_property(dev_prop[++i].name);
if (cl_prop.is_empty()==false) cl_prop >> board_id;
else {
// Try to initialize board_id from default device value
def_prop = ds_class->get_default_device_property(dev_prop[i].name);
if (def_prop.is_empty()==false) def_prop >> board_id;
}
// And try to extract board_id value from database
if (dev_prop[i].is_empty()==false) dev_prop[i] >> board_id;
// Try to initialize card_index from class property
cl_prop = ds_class->get_class_property(dev_prop[++i].name);
if (cl_prop.is_empty()==false) cl_prop >> card_index;
else {
// Try to initialize card_index from default device value
def_prop = ds_class->get_default_device_property(dev_prop[i].name);
if (def_prop.is_empty()==false) def_prop >> card_index;
}
// And try to extract card_index value from database
if (dev_prop[i].is_empty()==false) dev_prop[i] >> card_index;
// Try to initialize use_ext_clock from class property
cl_prop = ds_class->get_class_property(dev_prop[++i].name);
if (cl_prop.is_empty()==false) cl_prop >> use_ext_clock;
else {
// Try to initialize use_ext_clock from default device value
def_prop = ds_class->get_default_device_property(dev_prop[i].name);
if (def_prop.is_empty()==false) def_prop >> use_ext_clock;
}
// And try to extract use_ext_clock value from database
if (dev_prop[i].is_empty()==false) dev_prop[i] >> use_ext_clock;
// Try to initialize push_events from class property
cl_prop = ds_class->get_class_property(dev_prop[++i].name);
if (cl_prop.is_empty()==false) cl_prop >> push_events;
else {
// Try to initialize push_events from default device value
def_prop = ds_class->get_default_device_property(dev_prop[i].name);
if (def_prop.is_empty()==false) def_prop >> push_events;
}
// And try to extract push_events value from database
if (dev_prop[i].is_empty()==false) dev_prop[i] >> push_events;
}
/*----- PROTECTED REGION ID(XTDC4::get_device_property_after) ENABLED START -----*/
// Check device property data members init
/*----- PROTECTED REGION END -----*/ // XTDC4::get_device_property_after
}
//--------------------------------------------------------
/**
* Method : XTDC4::always_executed_hook()
* Description : method always executed before any command is executed
*/
//--------------------------------------------------------
void XTDC4::always_executed_hook()
{
DEBUG_STREAM << "XTDC4::always_executed_hook() " << device_name << endl;
/*----- PROTECTED REGION ID(XTDC4::always_executed_hook) ENABLED START -----*/
// code always executed before all requests
/*----- PROTECTED REGION END -----*/ // XTDC4::always_executed_hook
}
//--------------------------------------------------------
/**
* Method : XTDC4::read_attr_hardware()
* Description : Hardware acquisition for attributes
*/
//--------------------------------------------------------
void XTDC4::read_attr_hardware(TANGO_UNUSED(vector<long> &attr_list))
{
DEBUG_STREAM << "XTDC4::read_attr_hardware(vector<long> &attr_list) entering... " << endl;
/*----- PROTECTED REGION ID(XTDC4::read_attr_hardware) ENABLED START -----*/
// Add your own code
/*----- PROTECTED REGION END -----*/ // XTDC4::read_attr_hardware
}
//--------------------------------------------------------
/**
* Method : XTDC4::write_attr_hardware()
* Description : Hardware writing for attributes
*/
//--------------------------------------------------------
void XTDC4::write_attr_hardware(TANGO_UNUSED(vector<long> &attr_list))
{
DEBUG_STREAM << "XTDC4::write_attr_hardware(vector<long> &attr_list) entering... " << endl;
/*----- PROTECTED REGION ID(XTDC4::write_attr_hardware) ENABLED START -----*/
// Add your own code
/*----- PROTECTED REGION END -----*/ // XTDC4::write_attr_hardware
}
//--------------------------------------------------------
/**
* Read attribute error_code related method
* Description:
*
* Data type: Tango::DevLong
* Attr type: Scalar
*/
//--------------------------------------------------------
void XTDC4::read_error_code(Tango::Attribute &attr)
{
DEBUG_STREAM << "XTDC4::read_error_code(Tango::Attribute &attr) entering... " << endl;
/*----- PROTECTED REGION ID(XTDC4::read_error_code) ENABLED START -----*/
// Set the attribute value
attr.set_value(attr_error_code_read);
/*----- PROTECTED REGION END -----*/ // XTDC4::read_error_code
}
//--------------------------------------------------------
/**
* Read attribute error_message related method
* Description:
*
* Data type: Tango::DevString
* Attr type: Scalar
*/
//--------------------------------------------------------
void XTDC4::read_error_message(Tango::Attribute &attr)
{
DEBUG_STREAM << "XTDC4::read_error_message(Tango::Attribute &attr) entering... " << endl;
/*----- PROTECTED REGION ID(XTDC4::read_error_message) ENABLED START -----*/
// Set the attribute value
attr.set_value(attr_error_message_read);
/*----- PROTECTED REGION END -----*/ // XTDC4::read_error_message
}
//--------------------------------------------------------
/**
* Read attribute device_type related method
* Description: For xTDC4, the device type is 6
*
* Data type: Tango::DevShort
* Attr type: Scalar
*/
//--------------------------------------------------------
void XTDC4::read_device_type(Tango::Attribute &attr)
{
DEBUG_STREAM << "XTDC4::read_device_type(Tango::Attribute &attr) entering... " << endl;
/*----- PROTECTED REGION ID(XTDC4::read_device_type) ENABLED START -----*/
// Set the attribute value
attr.set_value(attr_device_type_read);
/*----- PROTECTED REGION END -----*/ // XTDC4::read_device_type
}
//--------------------------------------------------------
/**
* Read attribute START_RISING related method
* Description: Trigger START on rising of falling edge
*
* Data type: Tango::DevBoolean
* Attr type: Scalar
*/
//--------------------------------------------------------
void XTDC4::read_START_RISING(Tango::Attribute &attr)
{
DEBUG_STREAM << "XTDC4::read_START_RISING(Tango::Attribute &attr) entering... " << endl;
/*----- PROTECTED REGION ID(XTDC4::read_START_RISING) ENABLED START -----*/
// Set the attribute value
attr.set_value(attr_START_RISING_read);
/*----- PROTECTED REGION END -----*/ // XTDC4::read_START_RISING
}
//--------------------------------------------------------
/**
* Write attribute START_RISING related method
* Description: Trigger START on rising of falling edge
*
* Data type: Tango::DevBoolean
* Attr type: Scalar
*/
//--------------------------------------------------------
void XTDC4::write_START_RISING(Tango::WAttribute &attr)
{
DEBUG_STREAM << "XTDC4::write_START_RISING(Tango::WAttribute &attr) entering... " << endl;
// Retrieve write value
Tango::DevBoolean w_val;
attr.get_write_value(w_val);
/*----- PROTECTED REGION ID(XTDC4::write_START_RISING) ENABLED START -----*/
attr_START_RISING_read[0] = w_val;
attr_config_changed_read[0] = 1;
/*----- PROTECTED REGION END -----*/ // XTDC4::write_START_RISING
}
//--------------------------------------------------------
/**
* Read attribute START_DC_OFFSET related method
* Description: DC threshold of START input
*
* Data type: Tango::DevDouble
* Attr type: Scalar
*/
//--------------------------------------------------------
void XTDC4::read_START_DC_OFFSET(Tango::Attribute &attr)
{
DEBUG_STREAM << "XTDC4::read_START_DC_OFFSET(Tango::Attribute &attr) entering... " << endl;
/*----- PROTECTED REGION ID(XTDC4::read_START_DC_OFFSET) ENABLED START -----*/
// Set the attribute value
attr.set_value(attr_START_DC_OFFSET_read);
/*----- PROTECTED REGION END -----*/ // XTDC4::read_START_DC_OFFSET
}
//--------------------------------------------------------
/**
* Write attribute START_DC_OFFSET related method
* Description: DC threshold of START input
*
* Data type: Tango::DevDouble
* Attr type: Scalar
*/
//--------------------------------------------------------
void XTDC4::write_START_DC_OFFSET(Tango::WAttribute &attr)
{
DEBUG_STREAM << "XTDC4::write_START_DC_OFFSET(Tango::WAttribute &attr) entering... " << endl;
// Retrieve write value
Tango::DevDouble w_val;
attr.get_write_value(w_val);
/*----- PROTECTED REGION ID(XTDC4::write_START_DC_OFFSET) ENABLED START -----*/
attr_START_DC_OFFSET_read[0] = w_val;
attr_config_changed_read[0] = 1;
/*----- PROTECTED REGION END -----*/ // XTDC4::write_START_DC_OFFSET
}
//--------------------------------------------------------
/**
* Read attribute CH0_ENABLED related method
* Description: Enable input
*
* Data type: Tango::DevBoolean
* Attr type: Scalar
*/
//--------------------------------------------------------
void XTDC4::read_CH0_ENABLED(Tango::Attribute &attr)
{
DEBUG_STREAM << "XTDC4::read_CH0_ENABLED(Tango::Attribute &attr) entering... " << endl;
/*----- PROTECTED REGION ID(XTDC4::read_CH0_ENABLED) ENABLED START -----*/
// Set the attribute value
attr.set_value(attr_CH0_ENABLED_read);
/*----- PROTECTED REGION END -----*/ // XTDC4::read_CH0_ENABLED
}
//--------------------------------------------------------
/**
* Write attribute CH0_ENABLED related method
* Description: Enable input
*
* Data type: Tango::DevBoolean
* Attr type: Scalar
*/
//--------------------------------------------------------
void XTDC4::write_CH0_ENABLED(Tango::WAttribute &attr)
{
DEBUG_STREAM << "XTDC4::write_CH0_ENABLED(Tango::WAttribute &attr) entering... " << endl;
// Retrieve write value
Tango::DevBoolean w_val;
attr.get_write_value(w_val);
/*----- PROTECTED REGION ID(XTDC4::write_CH0_ENABLED) ENABLED START -----*/
attr_CH0_ENABLED_read[0] = w_val;
attr_config_changed_read[0] = 1;
/*----- PROTECTED REGION END -----*/ // XTDC4::write_CH0_ENABLED
}
//--------------------------------------------------------
/**
* Read attribute CH0_RISING related method
* Description: Trigger input on rising of falling edge
*
* Data type: Tango::DevBoolean
* Attr type: Scalar
*/
//--------------------------------------------------------
void XTDC4::read_CH0_RISING(Tango::Attribute &attr)
{
DEBUG_STREAM << "XTDC4::read_CH0_RISING(Tango::Attribute &attr) entering... " << endl;
/*----- PROTECTED REGION ID(XTDC4::read_CH0_RISING) ENABLED START -----*/
// Set the attribute value
attr.set_value(attr_CH0_RISING_read);
/*----- PROTECTED REGION END -----*/ // XTDC4::read_CH0_RISING
}
//--------------------------------------------------------
/**
* Write attribute CH0_RISING related method
* Description: Trigger input on rising of falling edge
*
* Data type: Tango::DevBoolean
* Attr type: Scalar
*/
//--------------------------------------------------------
void XTDC4::write_CH0_RISING(Tango::WAttribute &attr)
{
DEBUG_STREAM << "XTDC4::write_CH0_RISING(Tango::WAttribute &attr) entering... " << endl;
// Retrieve write value
Tango::DevBoolean w_val;
attr.get_write_value(w_val);
/*----- PROTECTED REGION ID(XTDC4::write_CH0_RISING) ENABLED START -----*/
attr_CH0_RISING_read[0] = w_val;
attr_config_changed_read[0] = 1;
/*----- PROTECTED REGION END -----*/ // XTDC4::write_CH0_RISING
}
//--------------------------------------------------------
/**
* Read attribute CH0_DC_OFFSET related method
* Description: DC threshold of input
*
* Data type: Tango::DevDouble
* Attr type: Scalar
*/
//--------------------------------------------------------
void XTDC4::read_CH0_DC_OFFSET(Tango::Attribute &attr)
{
DEBUG_STREAM << "XTDC4::read_CH0_DC_OFFSET(Tango::Attribute &attr) entering... " << endl;
/*----- PROTECTED REGION ID(XTDC4::read_CH0_DC_OFFSET) ENABLED START -----*/
// Set the attribute value
attr.set_value(attr_CH0_DC_OFFSET_read);
/*----- PROTECTED REGION END -----*/ // XTDC4::read_CH0_DC_OFFSET
}
//--------------------------------------------------------
/**
* Write attribute CH0_DC_OFFSET related method
* Description: DC threshold of input
*
* Data type: Tango::DevDouble
* Attr type: Scalar
*/
//--------------------------------------------------------
void XTDC4::write_CH0_DC_OFFSET(Tango::WAttribute &attr)
{
DEBUG_STREAM << "XTDC4::write_CH0_DC_OFFSET(Tango::WAttribute &attr) entering... " << endl;
// Retrieve write value
Tango::DevDouble w_val;
attr.get_write_value(w_val);
/*----- PROTECTED REGION ID(XTDC4::write_CH0_DC_OFFSET) ENABLED START -----*/
attr_CH0_DC_OFFSET_read[0] = w_val;
attr_config_changed_read[0] = 1;
/*----- PROTECTED REGION END -----*/ // XTDC4::write_CH0_DC_OFFSET
}
//--------------------------------------------------------
/**
* Read attribute CH1_ENABLED related method
* Description: Enable input
*
* Data type: Tango::DevBoolean
* Attr type: Scalar
*/
//--------------------------------------------------------
void XTDC4::read_CH1_ENABLED(Tango::Attribute &attr)
{
DEBUG_STREAM << "XTDC4::read_CH1_ENABLED(Tango::Attribute &attr) entering... " << endl;
/*----- PROTECTED REGION ID(XTDC4::read_CH1_ENABLED) ENABLED START -----*/
// Set the attribute value
attr.set_value(attr_CH1_ENABLED_read);
/*----- PROTECTED REGION END -----*/ // XTDC4::read_CH1_ENABLED
}
//--------------------------------------------------------
/**
* Write attribute CH1_ENABLED related method
* Description: Enable input
*
* Data type: Tango::DevBoolean
* Attr type: Scalar
*/
//--------------------------------------------------------
void XTDC4::write_CH1_ENABLED(Tango::WAttribute &attr)
{
DEBUG_STREAM << "XTDC4::write_CH1_ENABLED(Tango::WAttribute &attr) entering... " << endl;
// Retrieve write value
Tango::DevBoolean w_val;
attr.get_write_value(w_val);
/*----- PROTECTED REGION ID(XTDC4::write_CH1_ENABLED) ENABLED START -----*/
attr_CH1_ENABLED_read[0] = w_val;
attr_config_changed_read[0] = 1;
/*----- PROTECTED REGION END -----*/ // XTDC4::write_CH1_ENABLED
}
//--------------------------------------------------------
/**
* Read attribute CH1_RISING related method
* Description: Trigger input on rising of falling edge
*
* Data type: Tango::DevBoolean
* Attr type: Scalar
*/
//--------------------------------------------------------
void XTDC4::read_CH1_RISING(Tango::Attribute &attr)
{
DEBUG_STREAM << "XTDC4::read_CH1_RISING(Tango::Attribute &attr) entering... " << endl;
/*----- PROTECTED REGION ID(XTDC4::read_CH1_RISING) ENABLED START -----*/
// Set the attribute value
attr.set_value(attr_CH1_RISING_read);
/*----- PROTECTED REGION END -----*/ // XTDC4::read_CH1_RISING
}
//--------------------------------------------------------
/**
* Write attribute CH1_RISING related method
* Description: Trigger input on rising of falling edge
*
* Data type: Tango::DevBoolean
* Attr type: Scalar
*/
//--------------------------------------------------------
void XTDC4::write_CH1_RISING(Tango::WAttribute &attr)
{
DEBUG_STREAM << "XTDC4::write_CH1_RISING(Tango::WAttribute &attr) entering... " << endl;
// Retrieve write value
Tango::DevBoolean w_val;
attr.get_write_value(w_val);
/*----- PROTECTED REGION ID(XTDC4::write_CH1_RISING) ENABLED START -----*/
attr_CH1_RISING_read[0] = w_val;
attr_config_changed_read[0] = 1;
/*----- PROTECTED REGION END -----*/ // XTDC4::write_CH1_RISING
}
//--------------------------------------------------------
/**
* Read attribute CH1_DC_OFFSET related method
* Description: DC threshold of input
*
* Data type: Tango::DevDouble
* Attr type: Scalar
*/
//--------------------------------------------------------
void XTDC4::read_CH1_DC_OFFSET(Tango::Attribute &attr)
{
DEBUG_STREAM << "XTDC4::read_CH1_DC_OFFSET(Tango::Attribute &attr) entering... " << endl;
/*----- PROTECTED REGION ID(XTDC4::read_CH1_DC_OFFSET) ENABLED START -----*/
// Set the attribute value
attr.set_value(attr_CH1_DC_OFFSET_read);
/*----- PROTECTED REGION END -----*/ // XTDC4::read_CH1_DC_OFFSET
}
//--------------------------------------------------------
/**
* Write attribute CH1_DC_OFFSET related method
* Description: DC threshold of input
*
* Data type: Tango::DevDouble
* Attr type: Scalar
*/
//--------------------------------------------------------
void XTDC4::write_CH1_DC_OFFSET(Tango::WAttribute &attr)
{
DEBUG_STREAM << "XTDC4::write_CH1_DC_OFFSET(Tango::WAttribute &attr) entering... " << endl;
// Retrieve write value
Tango::DevDouble w_val;
attr.get_write_value(w_val);
/*----- PROTECTED REGION ID(XTDC4::write_CH1_DC_OFFSET) ENABLED START -----*/
attr_CH1_DC_OFFSET_read[0] = w_val;
attr_config_changed_read[0] = 1;
/*----- PROTECTED REGION END -----*/ // XTDC4::write_CH1_DC_OFFSET
}
//--------------------------------------------------------
/**
* Read attribute CH2_ENABLED related method
* Description: Enable input
*
* Data type: Tango::DevBoolean
* Attr type: Scalar
*/
//--------------------------------------------------------
void XTDC4::read_CH2_ENABLED(Tango::Attribute &attr)
{
DEBUG_STREAM << "XTDC4::read_CH2_ENABLED(Tango::Attribute &attr) entering... " << endl;
/*----- PROTECTED REGION ID(XTDC4::read_CH2_ENABLED) ENABLED START -----*/
// Set the attribute value
attr.set_value(attr_CH2_ENABLED_read);
/*----- PROTECTED REGION END -----*/ // XTDC4::read_CH2_ENABLED
}
//--------------------------------------------------------
/**
* Write attribute CH2_ENABLED related method
* Description: Enable input
*
* Data type: Tango::DevBoolean
* Attr type: Scalar
*/
//--------------------------------------------------------
void XTDC4::write_CH2_ENABLED(Tango::WAttribute &attr)
{
DEBUG_STREAM << "XTDC4::write_CH2_ENABLED(Tango::WAttribute &attr) entering... " << endl;
// Retrieve write value
Tango::DevBoolean w_val;
attr.get_write_value(w_val);
/*----- PROTECTED REGION ID(XTDC4::write_CH2_ENABLED) ENABLED START -----*/
attr_CH2_ENABLED_read[0] = w_val;
attr_config_changed_read[0] = 1;
/*----- PROTECTED REGION END -----*/ // XTDC4::write_CH2_ENABLED
}
//--------------------------------------------------------
/**
* Read attribute CH2_RISING related method
* Description: Trigger input on rising of falling edge
*
* Data type: Tango::DevBoolean
* Attr type: Scalar
*/
//--------------------------------------------------------
void XTDC4::read_CH2_RISING(Tango::Attribute &attr)
{
DEBUG_STREAM << "XTDC4::read_CH2_RISING(Tango::Attribute &attr) entering... " << endl;
/*----- PROTECTED REGION ID(XTDC4::read_CH2_RISING) ENABLED START -----*/
// Set the attribute value
attr.set_value(attr_CH2_RISING_read);
/*----- PROTECTED REGION END -----*/ // XTDC4::read_CH2_RISING
}
//--------------------------------------------------------
/**
* Write attribute CH2_RISING related method
* Description: Trigger input on rising of falling edge
*
* Data type: Tango::DevBoolean
* Attr type: Scalar
*/
//--------------------------------------------------------
void XTDC4::write_CH2_RISING(Tango::WAttribute &attr)
{
DEBUG_STREAM << "XTDC4::write_CH2_RISING(Tango::WAttribute &attr) entering... " << endl;
// Retrieve write value
Tango::DevBoolean w_val;
attr.get_write_value(w_val);
/*----- PROTECTED REGION ID(XTDC4::write_CH2_RISING) ENABLED START -----*/
attr_CH2_RISING_read[0] = w_val;
attr_config_changed_read[0] = 1;
/*----- PROTECTED REGION END -----*/ // XTDC4::write_CH2_RISING
}
//--------------------------------------------------------
/**
* Read attribute CH2_DC_OFFSET related method
* Description: DC threshold of input
*
* Data type: Tango::DevDouble
* Attr type: Scalar
*/
//--------------------------------------------------------
void XTDC4::read_CH2_DC_OFFSET(Tango::Attribute &attr)
{
DEBUG_STREAM << "XTDC4::read_CH2_DC_OFFSET(Tango::Attribute &attr) entering... " << endl;
/*----- PROTECTED REGION ID(XTDC4::read_CH2_DC_OFFSET) ENABLED START -----*/
// Set the attribute value
attr.set_value(attr_CH2_DC_OFFSET_read);
/*----- PROTECTED REGION END -----*/ // XTDC4::read_CH2_DC_OFFSET
}
//--------------------------------------------------------
/**
* Write attribute CH2_DC_OFFSET related method
* Description: DC threshold of input
*
* Data type: Tango::DevDouble
* Attr type: Scalar
*/
//--------------------------------------------------------
void XTDC4::write_CH2_DC_OFFSET(Tango::WAttribute &attr)
{
DEBUG_STREAM << "XTDC4::write_CH2_DC_OFFSET(Tango::WAttribute &attr) entering... " << endl;
// Retrieve write value