1 static const char *RcsId
= "$Header: /cvsroot/tango-ds/Instrumentation/Diffractometer/src/DiffractometerDeviceClass.cpp,v 1.3 2008/10/16 10:16:55 piccaf Exp $";
2 static const char *TagName
= "$Name: $";
3 static const char *HttpServer
= "http://www.esrf.fr/computing/cs/tango/tango_doc/ds_doc/";
4 //+=============================================================================
6 // file : DiffractometerDeviceClass.cpp
8 // description : C++ source for the DiffractometerDeviceClass. A singleton
9 // class derived from DeviceClass. It implements the
10 // command list and all properties and methods required
11 // by the DiffractometerDevice once per process.
13 // project : TANGO Device Server
19 // $Log: DiffractometerDeviceClass.cpp,v $
20 // Revision 1.3 2008/10/16 10:16:55 piccaf
21 // * update to build on windows with vc8
22 // * add the Eulerian6C diffractometer.
23 // * add the dynamic attributes in the factory instead of the init device
25 // Revision 1.2 2008/09/22 08:46:25 piccaf
26 // * add files from the new diffractometer Device
29 // copyleft : European Synchrotron Radiation Facility
30 // BP 220, Grenoble 38043
33 //-=============================================================================
35 // This file is generated by POGO
36 // (Program Obviously used to Generate tango Object)
38 // (c) - Software Engineering Group - ESRF
39 //=============================================================================
44 #include <DiffractometerDevice.h>
45 #include <DiffractometerDeviceClass.h>
48 //+----------------------------------------------------------------------------
50 * Create DiffractometerDeviceClass singleton and return it in a C function for Python usage
52 //+----------------------------------------------------------------------------
60 Tango::DeviceClass
*_create_DiffractometerDevice_class(const char *name
) {
61 return DiffractometerDevice_ns::DiffractometerDeviceClass::init(name
);
66 namespace DiffractometerDevice_ns
68 //+----------------------------------------------------------------------------
70 // method : GotoComputedAnglesClass::execute()
72 // description : method to trigger the execution of the command.
73 // PLEASE DO NOT MODIFY this method core without pogo
75 // in : - device : The device on which the command must be excuted
76 // - in_any : The command input data
78 // returns : The command output data (packed in the Any object)
80 //-----------------------------------------------------------------------------
81 CORBA::Any
*GotoComputedAnglesClass::execute(Tango::DeviceImpl
*device
,const CORBA::Any
&in_any
)
84 cout2
<< "GotoComputedAnglesClass::execute(): arrived" << endl
;
86 Tango::DevShort argin
;
87 extract(in_any
, argin
);
89 ((static_cast<DiffractometerDevice
*>(device
))->goto_computed_angles(argin
));
90 return new CORBA::Any();
93 //+----------------------------------------------------------------------------
95 // method : ComputedAnglesHKLListClass::execute()
97 // description : method to trigger the execution of the command.
98 // PLEASE DO NOT MODIFY this method core without pogo
100 // in : - device : The device on which the command must be excuted
101 // - in_any : The command input data
103 // returns : The command output data (packed in the Any object)
105 //-----------------------------------------------------------------------------
106 CORBA::Any
*ComputedAnglesHKLListClass::execute(Tango::DeviceImpl
*device
,const CORBA::Any
&in_any
)
109 cout2
<< "ComputedAnglesHKLListClass::execute(): arrived" << endl
;
111 const Tango::DevVarDoubleArray
*argin
;
112 extract(in_any
, argin
);
114 ((static_cast<DiffractometerDevice
*>(device
))->computed_angles_hkllist(argin
));
115 return new CORBA::Any();
118 //+----------------------------------------------------------------------------
120 // method : ComputedAnglesClearCmd::execute()
122 // description : method to trigger the execution of the command.
123 // PLEASE DO NOT MODIFY this method core without pogo
125 // in : - device : The device on which the command must be excuted
126 // - in_any : The command input data
128 // returns : The command output data (packed in the Any object)
130 //-----------------------------------------------------------------------------
131 CORBA::Any
*ComputedAnglesClearCmd::execute(Tango::DeviceImpl
*device
,const CORBA::Any
&in_any
)
134 cout2
<< "ComputedAnglesClearCmd::execute(): arrived" << endl
;
136 ((static_cast<DiffractometerDevice
*>(device
))->computed_angles_clear());
137 return new CORBA::Any();
140 //+----------------------------------------------------------------------------
142 // method : GetReflectionCmd::execute()
144 // description : method to trigger the execution of the command.
145 // PLEASE DO NOT MODIFY this method core without pogo
147 // in : - device : The device on which the command must be excuted
148 // - in_any : The command input data
150 // returns : The command output data (packed in the Any object)
152 //-----------------------------------------------------------------------------
153 CORBA::Any
*GetReflectionCmd::execute(Tango::DeviceImpl
*device
,const CORBA::Any
&in_any
)
156 cout2
<< "GetReflectionCmd::execute(): arrived" << endl
;
158 Tango::DevShort argin
;
159 extract(in_any
, argin
);
161 return insert((static_cast<DiffractometerDevice
*>(device
))->get_reflection(argin
));
164 //+----------------------------------------------------------------------------
166 // method : AffineCrystalCmd::execute()
168 // description : method to trigger the execution of the command.
169 // PLEASE DO NOT MODIFY this method core without pogo
171 // in : - device : The device on which the command must be excuted
172 // - in_any : The command input data
174 // returns : The command output data (packed in the Any object)
176 //-----------------------------------------------------------------------------
177 CORBA::Any
*AffineCrystalCmd::execute(Tango::DeviceImpl
*device
,const CORBA::Any
&in_any
)
180 cout2
<< "AffineCrystalCmd::execute(): arrived" << endl
;
182 Tango::DevString argin
;
183 extract(in_any
, argin
);
185 return insert((static_cast<DiffractometerDevice
*>(device
))->affine_crystal(argin
));
188 //+----------------------------------------------------------------------------
190 // method : GetAxesNamesClass::execute()
192 // description : method to trigger the execution of the command.
193 // PLEASE DO NOT MODIFY this method core without pogo
195 // in : - device : The device on which the command must be excuted
196 // - in_any : The command input data
198 // returns : The command output data (packed in the Any object)
200 //-----------------------------------------------------------------------------
201 CORBA::Any
*GetAxesNamesClass::execute(Tango::DeviceImpl
*device
,const CORBA::Any
&in_any
)
204 cout2
<< "GetAxesNamesClass::execute(): arrived" << endl
;
206 return insert((static_cast<DiffractometerDevice
*>(device
))->get_axes_names());
209 //+----------------------------------------------------------------------------
211 // method : ComputeUCmd::execute()
213 // description : method to trigger the execution of the command.
214 // PLEASE DO NOT MODIFY this method core without pogo
216 // in : - device : The device on which the command must be excuted
217 // - in_any : The command input data
219 // returns : The command output data (packed in the Any object)
221 //-----------------------------------------------------------------------------
222 CORBA::Any
*ComputeUCmd::execute(Tango::DeviceImpl
*device
,const CORBA::Any
&in_any
)
225 cout2
<< "ComputeUCmd::execute(): arrived" << endl
;
227 const Tango::DevVarLongArray
*argin
;
228 extract(in_any
, argin
);
230 ((static_cast<DiffractometerDevice
*>(device
))->compute_u(argin
));
231 return new CORBA::Any();
234 //+----------------------------------------------------------------------------
236 // method : GetCrystalParameterValuesCmd::execute()
238 // description : method to trigger the execution of the command.
239 // PLEASE DO NOT MODIFY this method core without pogo
241 // in : - device : The device on which the command must be excuted
242 // - in_any : The command input data
244 // returns : The command output data (packed in the Any object)
246 //-----------------------------------------------------------------------------
247 CORBA::Any
*GetCrystalParameterValuesCmd::execute(Tango::DeviceImpl
*device
,const CORBA::Any
&in_any
)
250 cout2
<< "GetCrystalParameterValuesCmd::execute(): arrived" << endl
;
252 Tango::DevString argin
;
253 extract(in_any
, argin
);
255 return insert((static_cast<DiffractometerDevice
*>(device
))->get_crystal_parameter_values(argin
));
259 //+----------------------------------------------------------------------------
261 // method : AbortCmd::execute()
263 // description : method to trigger the execution of the command.
264 // PLEASE DO NOT MODIFY this method core without pogo
266 // in : - device : The device on which the command must be excuted
267 // - in_any : The command input data
269 // returns : The command output data (packed in the Any object)
271 //-----------------------------------------------------------------------------
272 CORBA::Any
*AbortCmd::execute(Tango::DeviceImpl
*device
,const CORBA::Any
&in_any
)
275 cout2
<< "AbortCmd::execute(): arrived" << endl
;
277 ((static_cast<DiffractometerDevice
*>(device
))->abort());
278 return new CORBA::Any();
281 //+----------------------------------------------------------------------------
283 // method : AddNewCrystalClass::execute()
285 // description : method to trigger the execution of the command.
286 // PLEASE DO NOT MODIFY this method core without pogo
288 // in : - device : The device on which the command must be excuted
289 // - in_any : The command input data
291 // returns : The command output data (packed in the Any object)
293 //-----------------------------------------------------------------------------
294 CORBA::Any
*AddNewCrystalClass::execute(Tango::DeviceImpl
*device
,const CORBA::Any
&in_any
)
297 cout2
<< "AddNewCrystalClass::execute(): arrived" << endl
;
299 Tango::DevString argin
;
300 extract(in_any
, argin
);
302 ((static_cast<DiffractometerDevice
*>(device
))->add_new_crystal(argin
));
303 return new CORBA::Any();
306 //+----------------------------------------------------------------------------
308 // method : AddReflectionClass::execute()
310 // description : method to trigger the execution of the command.
311 // PLEASE DO NOT MODIFY this method core without pogo
313 // in : - device : The device on which the command must be excuted
314 // - in_any : The command input data
316 // returns : The command output data (packed in the Any object)
318 //-----------------------------------------------------------------------------
319 CORBA::Any
*AddReflectionClass::execute(Tango::DeviceImpl
*device
,const CORBA::Any
&in_any
)
322 cout2
<< "AddReflectionClass::execute(): arrived" << endl
;
324 const Tango::DevVarDoubleArray
*argin
;
325 extract(in_any
, argin
);
327 ((static_cast<DiffractometerDevice
*>(device
))->add_reflection(argin
));
328 return new CORBA::Any();
335 //+----------------------------------------------------------------------------
337 // method : ConfigureCrystalCmd::execute()
339 // description : method to trigger the execution of the command.
340 // PLEASE DO NOT MODIFY this method core without pogo
342 // in : - device : The device on which the command must be excuted
343 // - in_any : The command input data
345 // returns : The command output data (packed in the Any object)
347 //-----------------------------------------------------------------------------
348 CORBA::Any
*ConfigureCrystalCmd::execute(Tango::DeviceImpl
*device
,const CORBA::Any
&in_any
)
351 cout2
<< "ConfigureCrystalCmd::execute(): arrived" << endl
;
353 const Tango::DevVarDoubleArray
*argin
;
354 extract(in_any
, argin
);
356 ((static_cast<DiffractometerDevice
*>(device
))->configure_crystal(argin
));
357 return new CORBA::Any();
360 //+----------------------------------------------------------------------------
362 // method : CopyCurrentCrystalAsClass::execute()
364 // description : method to trigger the execution of the command.
365 // PLEASE DO NOT MODIFY this method core without pogo
367 // in : - device : The device on which the command must be excuted
368 // - in_any : The command input data
370 // returns : The command output data (packed in the Any object)
372 //-----------------------------------------------------------------------------
373 CORBA::Any
*CopyCurrentCrystalAsClass::execute(Tango::DeviceImpl
*device
,const CORBA::Any
&in_any
)
376 cout2
<< "CopyCurrentCrystalAsClass::execute(): arrived" << endl
;
378 Tango::DevString argin
;
379 extract(in_any
, argin
);
381 ((static_cast<DiffractometerDevice
*>(device
))->copy_current_crystal_as(argin
));
382 return new CORBA::Any();
385 //+----------------------------------------------------------------------------
387 // method : DeleteCurrentCrystalClass::execute()
389 // description : method to trigger the execution of the command.
390 // PLEASE DO NOT MODIFY this method core without pogo
392 // in : - device : The device on which the command must be excuted
393 // - in_any : The command input data
395 // returns : The command output data (packed in the Any object)
397 //-----------------------------------------------------------------------------
398 CORBA::Any
*DeleteCurrentCrystalClass::execute(Tango::DeviceImpl
*device
,const CORBA::Any
&in_any
)
401 cout2
<< "DeleteCurrentCrystalClass::execute(): arrived" << endl
;
403 ((static_cast<DiffractometerDevice
*>(device
))->delete_current_crystal());
404 return new CORBA::Any();
407 //+----------------------------------------------------------------------------
409 // method : GetAffinementIterationClass::execute()
411 // description : method to trigger the execution of the command.
412 // PLEASE DO NOT MODIFY this method core without pogo
414 // in : - device : The device on which the command must be excuted
415 // - in_any : The command input data
417 // returns : The command output data (packed in the Any object)
419 //-----------------------------------------------------------------------------
420 CORBA::Any
*GetAffinementIterationClass::execute(Tango::DeviceImpl
*device
,const CORBA::Any
&in_any
)
423 cout2
<< "GetAffinementIterationClass::execute(): arrived" << endl
;
425 Tango::DevString argin
;
426 extract(in_any
, argin
);
428 return insert((static_cast<DiffractometerDevice
*>(device
))->get_affinement_iteration(argin
));
431 //+----------------------------------------------------------------------------
433 // method : GetReflectionsSizeClass::execute()
435 // description : method to trigger the execution of the command.
436 // PLEASE DO NOT MODIFY this method core without pogo
438 // in : - device : The device on which the command must be excuted
439 // - in_any : The command input data
441 // returns : The command output data (packed in the Any object)
443 //-----------------------------------------------------------------------------
444 CORBA::Any
*GetReflectionsSizeClass::execute(Tango::DeviceImpl
*device
,const CORBA::Any
&in_any
)
447 cout2
<< "GetReflectionsSizeClass::execute(): arrived" << endl
;
449 return insert((static_cast<DiffractometerDevice
*>(device
))->get_affinement_list());
452 //+----------------------------------------------------------------------------
454 // method : GetAffinementMaxIterationClass::execute()
456 // description : method to trigger the execution of the command.
457 // PLEASE DO NOT MODIFY this method core without pogo
459 // in : - device : The device on which the command must be excuted
460 // - in_any : The command input data
462 // returns : The command output data (packed in the Any object)
464 //-----------------------------------------------------------------------------
465 CORBA::Any
*GetAffinementMaxIterationClass::execute(Tango::DeviceImpl
*device
,const CORBA::Any
&in_any
)
468 cout2
<< "GetAffinementMaxIterationClass::execute(): arrived" << endl
;
470 Tango::DevString argin
;
471 extract(in_any
, argin
);
473 return insert((static_cast<DiffractometerDevice
*>(device
))->get_affinement_max_iteration(argin
));
476 //+----------------------------------------------------------------------------
478 // method : GetCrystalNamesClass::execute()
480 // description : method to trigger the execution of the command.
481 // PLEASE DO NOT MODIFY this method core without pogo
483 // in : - device : The device on which the command must be excuted
484 // - in_any : The command input data
486 // returns : The command output data (packed in the Any object)
488 //-----------------------------------------------------------------------------
489 CORBA::Any
*GetCrystalNamesClass::execute(Tango::DeviceImpl
*device
,const CORBA::Any
&in_any
)
492 cout2
<< "GetCrystalNamesClass::execute(): arrived" << endl
;
494 return insert((static_cast<DiffractometerDevice
*>(device
))->get_crystal_names());
498 //+----------------------------------------------------------------------------
500 // method : GetModeDescriptionClass::execute()
502 // description : method to trigger the execution of the command.
503 // PLEASE DO NOT MODIFY this method core without pogo
505 // in : - device : The device on which the command must be excuted
506 // - in_any : The command input data
508 // returns : The command output data (packed in the Any object)
510 //-----------------------------------------------------------------------------
511 CORBA::Any
*GetModeDescriptionClass::execute(Tango::DeviceImpl
*device
,const CORBA::Any
&in_any
)
514 cout2
<< "GetModeDescriptionClass::execute(): arrived" << endl
;
516 Tango::DevString argin
;
517 extract(in_any
, argin
);
519 return insert((static_cast<DiffractometerDevice
*>(device
))->get_mode_description(argin
));
522 //+----------------------------------------------------------------------------
524 // method : GetModeParametersNamesClass::execute()
526 // description : method to trigger the execution of the command.
527 // PLEASE DO NOT MODIFY this method core without pogo
529 // in : - device : The device on which the command must be excuted
530 // - in_any : The command input data
532 // returns : The command output data (packed in the Any object)
534 //-----------------------------------------------------------------------------
535 CORBA::Any
*GetModeParametersNamesClass::execute(Tango::DeviceImpl
*device
,const CORBA::Any
&in_any
)
538 cout2
<< "GetModeParametersNamesClass::execute(): arrived" << endl
;
540 return insert((static_cast<DiffractometerDevice
*>(device
))->get_mode_parameters_names());
543 //+----------------------------------------------------------------------------
545 // method : GetModeParametersValuesClass::execute()
547 // description : method to trigger the execution of the command.
548 // PLEASE DO NOT MODIFY this method core without pogo
550 // in : - device : The device on which the command must be excuted
551 // - in_any : The command input data
553 // returns : The command output data (packed in the Any object)
555 //-----------------------------------------------------------------------------
556 CORBA::Any
*GetModeParametersValuesClass::execute(Tango::DeviceImpl
*device
,const CORBA::Any
&in_any
)
559 cout2
<< "GetModeParametersValuesClass::execute(): arrived" << endl
;
561 return insert((static_cast<DiffractometerDevice
*>(device
))->get_mode_parameters_values());
564 //+----------------------------------------------------------------------------
566 // method : GetModeParameterValueClass::execute()
568 // description : method to trigger the execution of the command.
569 // PLEASE DO NOT MODIFY this method core without pogo
571 // in : - device : The device on which the command must be excuted
572 // - in_any : The command input data
574 // returns : The command output data (packed in the Any object)
576 //-----------------------------------------------------------------------------
577 CORBA::Any
*GetModeParameterValueClass::execute(Tango::DeviceImpl
*device
,const CORBA::Any
&in_any
)
580 cout2
<< "GetModeParameterValueClass::execute(): arrived" << endl
;
582 Tango::DevString argin
;
583 extract(in_any
, argin
);
585 return insert((static_cast<DiffractometerDevice
*>(device
))->get_mode_parameter_value(argin
));
589 //+----------------------------------------------------------------------------
591 // method : GetReflectionSizeClass::execute()
593 // description : method to trigger the execution of the command.
594 // PLEASE DO NOT MODIFY this method core without pogo
596 // in : - device : The device on which the command must be excuted
597 // - in_any : The command input data
599 // returns : The command output data (packed in the Any object)
601 //-----------------------------------------------------------------------------
602 CORBA::Any
*GetReflectionSizeClass::execute(Tango::DeviceImpl
*device
,const CORBA::Any
&in_any
)
605 cout2
<< "GetReflectionSizeClass::execute(): arrived" << endl
;
607 return insert((static_cast<DiffractometerDevice
*>(device
))->get_reflection_size());
610 //+----------------------------------------------------------------------------
612 // method : GotoReflectionClass::execute()
614 // description : method to trigger the execution of the command.
615 // PLEASE DO NOT MODIFY this method core without pogo
617 // in : - device : The device on which the command must be excuted
618 // - in_any : The command input data
620 // returns : The command output data (packed in the Any object)
622 //-----------------------------------------------------------------------------
623 CORBA::Any
*GotoReflectionClass::execute(Tango::DeviceImpl
*device
,const CORBA::Any
&in_any
)
626 cout2
<< "GotoReflectionClass::execute(): arrived" << endl
;
628 Tango::DevShort argin
;
629 extract(in_any
, argin
);
631 ((static_cast<DiffractometerDevice
*>(device
))->goto_reflection(argin
));
632 return new CORBA::Any();
635 //+----------------------------------------------------------------------------
637 // method : LoadClass::execute()
639 // description : method to trigger the execution of the command.
640 // PLEASE DO NOT MODIFY this method core without pogo
642 // in : - device : The device on which the command must be excuted
643 // - in_any : The command input data
645 // returns : The command output data (packed in the Any object)
647 //-----------------------------------------------------------------------------
648 CORBA::Any
*LoadClass::execute(Tango::DeviceImpl
*device
,const CORBA::Any
&in_any
)
651 cout2
<< "LoadClass::execute(): arrived" << endl
;
653 ((static_cast<DiffractometerDevice
*>(device
))->load());
654 return new CORBA::Any();
657 //+----------------------------------------------------------------------------
659 // method : RemoveReflectionClass::execute()
661 // description : method to trigger the execution of the command.
662 // PLEASE DO NOT MODIFY this method core without pogo
664 // in : - device : The device on which the command must be excuted
665 // - in_any : The command input data
667 // returns : The command output data (packed in the Any object)
669 //-----------------------------------------------------------------------------
670 CORBA::Any
*RemoveReflectionClass::execute(Tango::DeviceImpl
*device
,const CORBA::Any
&in_any
)
673 cout2
<< "RemoveReflectionClass::execute(): arrived" << endl
;
675 Tango::DevShort argin
;
676 extract(in_any
, argin
);
678 ((static_cast<DiffractometerDevice
*>(device
))->remove_reflection(argin
));
679 return new CORBA::Any();
682 //+----------------------------------------------------------------------------
684 // method : SaveClass::execute()
686 // description : method to trigger the execution of the command.
687 // PLEASE DO NOT MODIFY this method core without pogo
689 // in : - device : The device on which the command must be excuted
690 // - in_any : The command input data
692 // returns : The command output data (packed in the Any object)
694 //-----------------------------------------------------------------------------
695 CORBA::Any
*SaveClass::execute(Tango::DeviceImpl
*device
,const CORBA::Any
&in_any
)
698 cout2
<< "SaveClass::execute(): arrived" << endl
;
700 ((static_cast<DiffractometerDevice
*>(device
))->save());
701 return new CORBA::Any();
704 //+----------------------------------------------------------------------------
706 // method : SetAffinementMaxIterationClass::execute()
708 // description : method to trigger the execution of the command.
709 // PLEASE DO NOT MODIFY this method core without pogo
711 // in : - device : The device on which the command must be excuted
712 // - in_any : The command input data
714 // returns : The command output data (packed in the Any object)
716 //-----------------------------------------------------------------------------
717 CORBA::Any
*SetAffinementMaxIterationClass::execute(Tango::DeviceImpl
*device
,const CORBA::Any
&in_any
)
720 cout2
<< "SetAffinementMaxIterationClass::execute(): arrived" << endl
;
722 const Tango::DevVarStringArray
*argin
;
723 extract(in_any
, argin
);
725 ((static_cast<DiffractometerDevice
*>(device
))->set_affinement_max_iteration(argin
));
726 return new CORBA::Any();
729 //+----------------------------------------------------------------------------
731 // method : SetCrystalParameterValuesClass::execute()
733 // description : method to trigger the execution of the command.
734 // PLEASE DO NOT MODIFY this method core without pogo
736 // in : - device : The device on which the command must be excuted
737 // - in_any : The command input data
739 // returns : The command output data (packed in the Any object)
741 //-----------------------------------------------------------------------------
742 CORBA::Any
*SetCrystalParameterValuesClass::execute(Tango::DeviceImpl
*device
,const CORBA::Any
&in_any
)
745 cout2
<< "SetCrystalParameterValuesClass::execute(): arrived" << endl
;
747 const Tango::DevVarDoubleStringArray
*argin
;
748 extract(in_any
, argin
);
750 ((static_cast<DiffractometerDevice
*>(device
))->set_crystal_parameter_values(argin
));
751 return new CORBA::Any();
754 //+----------------------------------------------------------------------------
756 // method : SetHKLClass::execute()
758 // description : method to trigger the execution of the command.
759 // PLEASE DO NOT MODIFY this method core without pogo
761 // in : - device : The device on which the command must be excuted
762 // - in_any : The command input data
764 // returns : The command output data (packed in the Any object)
766 //-----------------------------------------------------------------------------
767 CORBA::Any
*SetHKLClass::execute(Tango::DeviceImpl
*device
,const CORBA::Any
&in_any
)
770 cout2
<< "SetHKLClass::execute(): arrived" << endl
;
772 const Tango::DevVarDoubleArray
*argin
;
773 extract(in_any
, argin
);
775 ((static_cast<DiffractometerDevice
*>(device
))->set_hkl(argin
));
776 return new CORBA::Any();
779 //+----------------------------------------------------------------------------
781 // method : SetModeParametersValuesClass::execute()
783 // description : method to trigger the execution of the command.
784 // PLEASE DO NOT MODIFY this method core without pogo
786 // in : - device : The device on which the command must be excuted
787 // - in_any : The command input data
789 // returns : The command output data (packed in the Any object)
791 //-----------------------------------------------------------------------------
792 CORBA::Any
*SetModeParametersValuesClass::execute(Tango::DeviceImpl
*device
,const CORBA::Any
&in_any
)
795 cout2
<< "SetModeParametersValuesClass::execute(): arrived" << endl
;
797 const Tango::DevVarDoubleStringArray
*argin
;
798 extract(in_any
, argin
);
800 ((static_cast<DiffractometerDevice
*>(device
))->set_mode_parameters_values(argin
));
801 return new CORBA::Any();
804 //+----------------------------------------------------------------------------
806 // method : SetReflectionClass::execute()
808 // description : method to trigger the execution of the command.
809 // PLEASE DO NOT MODIFY this method core without pogo
811 // in : - device : The device on which the command must be excuted
812 // - in_any : The command input data
814 // returns : The command output data (packed in the Any object)
816 //-----------------------------------------------------------------------------
817 CORBA::Any
*SetReflectionClass::execute(Tango::DeviceImpl
*device
,const CORBA::Any
&in_any
)
820 cout2
<< "SetReflectionClass::execute(): arrived" << endl
;
822 const Tango::DevVarDoubleArray
*argin
;
823 extract(in_any
, argin
);
825 ((static_cast<DiffractometerDevice
*>(device
))->set_reflection(argin
));
826 return new CORBA::Any();
829 //+----------------------------------------------------------------------------
831 // method : CopyReflectionToCmd::execute()
833 // description : method to trigger the execution of the command.
834 // PLEASE DO NOT MODIFY this method core without pogo
836 // in : - device : The device on which the command must be excuted
837 // - in_any : The command input data
839 // returns : The command output data (packed in the Any object)
841 //-----------------------------------------------------------------------------
842 CORBA::Any
*CopyReflectionToCmd::execute(Tango::DeviceImpl
*device
,const CORBA::Any
&in_any
)
845 cout2
<< "CopyReflectionToCmd::execute(): arrived" << endl
;
847 const Tango::DevVarDoubleStringArray
*argin
;
848 extract(in_any
, argin
);
850 ((static_cast<DiffractometerDevice
*>(device
))->copy_reflection_to(argin
));
851 return new CORBA::Any();
856 //----------------------------------------------------------------
857 // Initialize pointer for singleton pattern
858 //----------------------------------------------------------------
860 DiffractometerDeviceClass
*DiffractometerDeviceClass::_instance
= NULL
;
862 //+----------------------------------------------------------------------------
864 // method : DiffractometerDeviceClass::DiffractometerDeviceClass(string &s)
866 // description : constructor for the DiffractometerDeviceClass
868 // in : - s : The class name
870 //-----------------------------------------------------------------------------
871 DiffractometerDeviceClass::DiffractometerDeviceClass(string
&s
):DeviceClass(s
)
874 cout2
<< "Entering DiffractometerDeviceClass constructor" << endl
;
875 set_default_property();
876 get_class_property();
877 write_class_property();
879 cout2
<< "Leaving DiffractometerDeviceClass constructor" << endl
;
882 //+----------------------------------------------------------------------------
884 // method : DiffractometerDeviceClass::~DiffractometerDeviceClass()
886 // description : destructor for the DiffractometerDeviceClass
888 //-----------------------------------------------------------------------------
889 DiffractometerDeviceClass::~DiffractometerDeviceClass()
894 //+----------------------------------------------------------------------------
896 // method : DiffractometerDeviceClass::instance
898 // description : Create the object if not already done. Otherwise, just
899 // return a pointer to the object
901 // in : - name : The class name
903 //-----------------------------------------------------------------------------
904 DiffractometerDeviceClass
*DiffractometerDeviceClass::init(const char *name
)
906 if (_instance
== NULL
)
911 _instance
= new DiffractometerDeviceClass(s
);
921 DiffractometerDeviceClass
*DiffractometerDeviceClass::instance()
923 if (_instance
== NULL
)
925 cerr
<< "Class is not initialised !!" << endl
;
931 //+----------------------------------------------------------------------------
933 // method : DiffractometerDeviceClass::command_factory
935 // description : Create the command object(s) and store them in the
938 //-----------------------------------------------------------------------------
939 void DiffractometerDeviceClass::command_factory()
941 command_list
.push_back(new AbortCmd("Abort",
942 Tango::DEV_VOID
, Tango::DEV_VOID
,
946 command_list
.push_back(new AddNewCrystalClass("AddNewCrystal",
947 Tango::DEV_STRING
, Tango::DEV_VOID
,
948 "Name of the new crystal",
951 command_list
.push_back(new AddReflectionClass("AddReflection",
952 Tango::DEVVAR_DOUBLEARRAY
, Tango::DEV_VOID
,
953 "reflections i.e : h, k, l, relevance, enable/disable",
956 command_list
.push_back(new AffineCrystalCmd("AffineCrystal",
957 Tango::DEV_STRING
, Tango::DEV_DOUBLE
,
958 "name of the crystal to fit",
959 "the fitness of the crystal after the affinement.",
961 command_list
.push_back(new ComputedAnglesClearCmd("ComputedAnglesClear",
962 Tango::DEV_VOID
, Tango::DEV_VOID
,
966 command_list
.push_back(new ComputedAnglesHKLListClass("ComputedAnglesHKLList",
967 Tango::DEVVAR_DOUBLEARRAY
, Tango::DEV_VOID
,
971 command_list
.push_back(new ComputeUCmd("ComputeU",
972 Tango::DEVVAR_LONGARRAY
, Tango::DEV_VOID
,
973 "a two elements array with the index of reflection to use",
976 command_list
.push_back(new ConfigureCrystalCmd("ConfigureCrystal",
977 Tango::DEVVAR_DOUBLEARRAY
, Tango::DEV_VOID
,
978 "Crystal parameters : alpha,beta,gamma, A,B,C",
981 command_list
.push_back(new CopyCurrentCrystalAsClass("CopyCurrentCrystalAs",
982 Tango::DEV_STRING
, Tango::DEV_VOID
,
986 command_list
.push_back(new CopyReflectionToCmd("CopyReflectionTo",
987 Tango::DEVVAR_DOUBLESTRINGARRAY
, Tango::DEV_VOID
,
988 "Double: Reflection number of the current crystal String : Name of the crystal where copy this reflection",
991 command_list
.push_back(new DeleteCurrentCrystalClass("DeleteCurrentCrystal",
992 Tango::DEV_VOID
, Tango::DEV_VOID
,
996 command_list
.push_back(new GetAffinementIterationClass("GetAffinementIteration",
997 Tango::DEV_STRING
, Tango::DEV_LONG
,
999 "Iteration value of the last calculation",
1001 command_list
.push_back(new GetReflectionsSizeClass("GetAffinementList",
1002 Tango::DEV_VOID
, Tango::DEVVAR_STRINGARRAY
,
1004 "List of Affinement names",
1006 command_list
.push_back(new GetAffinementMaxIterationClass("GetAffinementMaxIteration",
1007 Tango::DEV_STRING
, Tango::DEV_LONG
,
1009 "Value of iteration max",
1011 command_list
.push_back(new GetAxesNamesClass("GetAxesNames",
1012 Tango::DEV_VOID
, Tango::DEVVAR_STRINGARRAY
,
1014 "namers of the axes",
1016 command_list
.push_back(new GetCrystalNamesClass("GetCrystalNames",
1017 Tango::DEV_VOID
, Tango::DEVVAR_STRINGARRAY
,
1019 "all crystals names registed",
1021 command_list
.push_back(new GetCrystalParameterValuesCmd("GetCrystalParameterValues",
1022 Tango::DEV_STRING
, Tango::DEVVAR_DOUBLESTRINGARRAY
,
1023 "Name of parameter (see getParametersNames for the complete list of parameters)",
1024 "In the order : minimum value, maximum value, affinement enable",
1026 command_list
.push_back(new GetModeDescriptionClass("GetModeDescription",
1027 Tango::DEV_STRING
, Tango::DEV_STRING
,
1031 command_list
.push_back(new GetModeParametersNamesClass("GetModeParametersNames",
1032 Tango::DEV_VOID
, Tango::DEVVAR_STRINGARRAY
,
1034 "Parameters names of the current mode",
1036 command_list
.push_back(new GetModeParametersValuesClass("GetModeParametersValues",
1037 Tango::DEV_VOID
, Tango::DEVVAR_DOUBLESTRINGARRAY
,
1039 "String : Names of parameters ; Double : values of parameters",
1041 command_list
.push_back(new GetModeParameterValueClass("GetModeParameterValue",
1042 Tango::DEV_STRING
, Tango::DEV_DOUBLE
,
1043 "name of parameter",
1044 "value of this parameter",
1046 command_list
.push_back(new GetReflectionCmd("GetReflection",
1047 Tango::DEV_SHORT
, Tango::DEVVAR_DOUBLEARRAY
,
1048 "index of reflection",
1049 "H, K, L, Relevance, Affinement Enabled ",
1051 command_list
.push_back(new GetReflectionSizeClass("GetReflectionSize",
1052 Tango::DEV_VOID
, Tango::DEV_USHORT
,
1053 "index of reflection",
1054 "Number of reflection in current crytal",
1056 command_list
.push_back(new GotoComputedAnglesClass("GotoComputedAngles",
1057 Tango::DEV_SHORT
, Tango::DEV_VOID
,
1058 "the idx of the computed angles",
1061 command_list
.push_back(new GotoReflectionClass("GotoReflection",
1062 Tango::DEV_SHORT
, Tango::DEV_VOID
,
1063 "reflection number",
1066 command_list
.push_back(new LoadClass("Load",
1067 Tango::DEV_VOID
, Tango::DEV_VOID
,
1071 command_list
.push_back(new RemoveReflectionClass("RemoveReflection",
1072 Tango::DEV_SHORT
, Tango::DEV_VOID
,
1073 "index of reflection to remove",
1076 command_list
.push_back(new SaveClass("Save",
1077 Tango::DEV_VOID
, Tango::DEV_VOID
,
1081 command_list
.push_back(new SetAffinementMaxIterationClass("SetAffinementMaxIteration",
1082 Tango::DEVVAR_STRINGARRAY
, Tango::DEV_VOID
,
1083 "Affinement name, Value of iteration max",
1086 command_list
.push_back(new SetCrystalParameterValuesClass("SetCrystalParameterValues",
1087 Tango::DEVVAR_DOUBLESTRINGARRAY
, Tango::DEV_VOID
,
1088 "String : Name of parameter ; Double : min value, max value, affinement enable",
1091 command_list
.push_back(new SetHKLClass("SetHKL",
1092 Tango::DEVVAR_DOUBLEARRAY
, Tango::DEV_VOID
,
1096 command_list
.push_back(new SetModeParametersValuesClass("SetModeParametersValues",
1097 Tango::DEVVAR_DOUBLESTRINGARRAY
, Tango::DEV_VOID
,
1098 "String : name of parameter ; Double : value of parameter",
1101 command_list
.push_back(new SetReflectionClass("SetReflection",
1102 Tango::DEVVAR_DOUBLEARRAY
, Tango::DEV_VOID
,
1103 "reflections i.e : index, h, k, l, relevance, affinement enabled ",
1107 // add polling if any
1108 for (unsigned int i
=0 ; i
<command_list
.size(); i
++)
1113 //+----------------------------------------------------------------------------
1115 // method : DiffractometerDeviceClass::get_class_property
1117 // description : Get the class property for specified name.
1119 // in : string name : The property name
1121 //+----------------------------------------------------------------------------
1122 Tango::DbDatum
DiffractometerDeviceClass::get_class_property(string
&prop_name
)
1124 for (unsigned int i
=0 ; i
<cl_prop
.size() ; i
++)
1125 if (cl_prop
[i
].name
== prop_name
)
1127 // if not found, return an empty DbDatum
1128 return Tango::DbDatum(prop_name
);
1130 //+----------------------------------------------------------------------------
1132 // method : DiffractometerDeviceClass::get_default_device_property()
1134 // description : Return the default value for device property.
1136 //-----------------------------------------------------------------------------
1137 Tango::DbDatum
DiffractometerDeviceClass::get_default_device_property(string
&prop_name
)
1139 for (unsigned int i
=0 ; i
<dev_def_prop
.size() ; i
++)
1140 if (dev_def_prop
[i
].name
== prop_name
)
1141 return dev_def_prop
[i
];
1142 // if not found, return an empty DbDatum
1143 return Tango::DbDatum(prop_name
);
1146 //+----------------------------------------------------------------------------
1148 // method : DiffractometerDeviceClass::get_default_class_property()
1150 // description : Return the default value for class property.
1152 //-----------------------------------------------------------------------------
1153 Tango::DbDatum
DiffractometerDeviceClass::get_default_class_property(string
&prop_name
)
1155 for (unsigned int i
=0 ; i
<cl_def_prop
.size() ; i
++)
1156 if (cl_def_prop
[i
].name
== prop_name
)
1157 return cl_def_prop
[i
];
1158 // if not found, return an empty DbDatum
1159 return Tango::DbDatum(prop_name
);
1161 //+----------------------------------------------------------------------------
1163 // method : DiffractometerDeviceClass::device_factory
1165 // description : Create the device object(s) and store them in the
1168 // in : Tango::DevVarStringArray *devlist_ptr : The device name list
1170 //-----------------------------------------------------------------------------
1171 void DiffractometerDeviceClass::device_factory(const Tango::DevVarStringArray
*devlist_ptr
)
1174 // Create all devices.(Automatic code generation)
1175 //-------------------------------------------------------------
1176 for (unsigned long i
=0 ; i
< devlist_ptr
->length() ; i
++)
1178 cout4
<< "Device name : " << (*devlist_ptr
)[i
].in() << endl
;
1180 // Create devices and add it into the device list
1181 //----------------------------------------------------
1182 device_list
.push_back(new DiffractometerDevice(this, (*devlist_ptr
)[i
]));
1184 // Export device to the outside world
1185 // Check before if database used.
1186 //---------------------------------------------
1187 if ((Tango::Util::_UseDb
== true) && (Tango::Util::_FileDb
== false))
1188 export_device(device_list
.back());
1190 export_device(device_list
.back(), (*devlist_ptr
)[i
]);
1192 // End of Automatic code generation
1193 //-------------------------------------------------------------
1194 for (unsigned long i
=0 ; i
< devlist_ptr
->length() ; i
++) {
1195 // Call the create_dynamic_attributes() method after the
1196 // initialisation of the device to created
1197 // dynamic attributes only for the device!
1199 (static_cast <DiffractometerDevice
*> (device_list
[i
]))->create_dynamic_attributes();
1202 //+----------------------------------------------------------------------------
1203 // Method: DiffractometerDeviceClass::attribute_factory(vector<Tango::Attr *> &att_list)
1204 //-----------------------------------------------------------------------------
1205 void DiffractometerDeviceClass::attribute_factory(vector
<Tango::Attr
*> &att_list
)
1208 HAttrib
*h
= new HAttrib();
1209 Tango::UserDefaultAttrProp h_prop
;
1210 h_prop
.set_label("h");
1211 h_prop
.set_unit(" ");
1212 h_prop
.set_format("%8.3f");
1213 h_prop
.set_description("- Set Point will write motor positions\n- Read point is the h value calculated from real motor positions");
1214 h
->set_default_properties(h_prop
);
1215 att_list
.push_back(h
);
1218 KAttrib
*k
= new KAttrib();
1219 Tango::UserDefaultAttrProp k_prop
;
1220 k_prop
.set_label("k");
1221 k_prop
.set_unit(" ");
1222 k_prop
.set_format("%8.3f");
1223 k_prop
.set_description("- Set Point will write motor positions\n- Read point is the h value calculated from real motor positions");
1224 k
->set_default_properties(k_prop
);
1225 att_list
.push_back(k
);
1228 LAttrib
*l
= new LAttrib();
1229 Tango::UserDefaultAttrProp l_prop
;
1230 l_prop
.set_label("l");
1231 l_prop
.set_unit(" ");
1232 l_prop
.set_format("%8.3f");
1233 l_prop
.set_description("- Set Point will write motor positions\n- Read point is the h value calculated from real motor positions");
1234 l
->set_default_properties(l_prop
);
1235 att_list
.push_back(l
);
1238 ModeAttrib
*mode
= new ModeAttrib();
1239 Tango::UserDefaultAttrProp mode_prop
;
1240 mode_prop
.set_label("mode");
1241 mode_prop
.set_description("The name of the mode usually bissector");
1242 mode
->set_default_properties(mode_prop
);
1243 att_list
.push_back(mode
);
1245 // Attribute : AnglesIdx
1246 AnglesIdxAttrib
*angles_idx
= new AnglesIdxAttrib();
1247 Tango::UserDefaultAttrProp angles_idx_prop
;
1248 angles_idx_prop
.set_description("this attribut select the solution used to set the axes after an angle computation.");
1249 angles_idx
->set_default_properties(angles_idx_prop
);
1250 att_list
.push_back(angles_idx
);
1252 // Attribute : Simulated
1253 SimulatedAttrib
*simulated
= new SimulatedAttrib();
1254 Tango::UserDefaultAttrProp simulated_prop
;
1255 simulated_prop
.set_label("simulated");
1256 simulated_prop
.set_format("%1d");
1257 simulated_prop
.set_max_value("1");
1258 simulated_prop
.set_min_value("0");
1259 simulated_prop
.set_description("0 : Device REALLY moves diffractometers motors\n1 : Device only simulates calculations and DOES NOT move any motor\n");
1260 simulated
->set_default_properties(simulated_prop
);
1261 att_list
.push_back(simulated
);
1263 // Attribute : WaveLength
1264 WaveLengthAttrib
*wave_length
= new WaveLengthAttrib();
1265 Tango::UserDefaultAttrProp wave_length_prop
;
1266 wave_length_prop
.set_label("wavelength");
1267 wave_length_prop
.set_format("%8.3f");
1268 wave_length_prop
.set_description("The wave length used by the diffractometer.\nUsually connected to an AttributeProxy.");
1269 wave_length
->set_default_properties(wave_length_prop
);
1270 wave_length
->set_memorized();
1271 wave_length
->set_memorized_init(true);
1272 att_list
.push_back(wave_length
);
1274 // Attribute : Crystal
1275 CrystalAttrib
*crystal
= new CrystalAttrib();
1276 Tango::UserDefaultAttrProp crystal_prop
;
1277 crystal_prop
.set_label("crystal");
1278 crystal_prop
.set_description("The name of the crystal used by the diffractometer.\n\nthe list of the available crystals is in the attribut crystals \n");
1279 crystal
->set_default_properties(crystal_prop
);
1280 att_list
.push_back(crystal
);
1283 AAttrib
*a
= new AAttrib();
1284 Tango::UserDefaultAttrProp a_prop
;
1285 a_prop
.set_format("%8.3f");
1286 a_prop
.set_description("crystal lattice a parameter");
1287 a
->set_default_properties(a_prop
);
1288 att_list
.push_back(a
);
1291 BAttrib
*b
= new BAttrib();
1292 Tango::UserDefaultAttrProp b_prop
;
1293 b_prop
.set_format("%8.3f");
1294 b_prop
.set_description("crystal lattice b parameter");
1295 b
->set_default_properties(b_prop
);
1296 att_list
.push_back(b
);
1299 CAttrib
*c
= new CAttrib();
1300 Tango::UserDefaultAttrProp c_prop
;
1301 c_prop
.set_format("%8.3f");
1302 c_prop
.set_description("crystal lattice c parameter");
1303 c
->set_default_properties(c_prop
);
1304 att_list
.push_back(c
);
1306 // Attribute : Alpha
1307 AlphaAttrib
*alpha
= new AlphaAttrib();
1308 Tango::UserDefaultAttrProp alpha_prop
;
1309 alpha_prop
.set_unit("degree");
1310 alpha_prop
.set_format("%8.3f");
1311 alpha_prop
.set_description("crystal lattice alpha parameter");
1312 alpha
->set_default_properties(alpha_prop
);
1313 att_list
.push_back(alpha
);
1316 BetaAttrib
*beta
= new BetaAttrib();
1317 Tango::UserDefaultAttrProp beta_prop
;
1318 beta_prop
.set_unit("degree");
1319 beta_prop
.set_format("%8.3f");
1320 beta_prop
.set_description("crystal lattice beta parameter");
1321 beta
->set_default_properties(beta_prop
);
1322 att_list
.push_back(beta
);
1324 // Attribute : Gamma
1325 GammaAttrib
*gamma
= new GammaAttrib();
1326 Tango::UserDefaultAttrProp gamma_prop
;
1327 gamma_prop
.set_unit("degree");
1328 gamma_prop
.set_format("%8.3f");
1329 gamma_prop
.set_description("crystal lattice gamma parameter");
1330 gamma
->set_default_properties(gamma_prop
);
1331 att_list
.push_back(gamma
);
1334 UxAttrib
*ux
= new UxAttrib();
1335 Tango::UserDefaultAttrProp ux_prop
;
1336 ux_prop
.set_unit("degree");
1337 ux_prop
.set_description("The x coordinate of the U matrix");
1338 ux
->set_default_properties(ux_prop
);
1339 att_list
.push_back(ux
);
1342 UyAttrib
*uy
= new UyAttrib();
1343 Tango::UserDefaultAttrProp uy_prop
;
1344 uy_prop
.set_unit("degree");
1345 uy_prop
.set_description("The y coordinate of the U matrix");
1346 uy
->set_default_properties(uy_prop
);
1347 att_list
.push_back(uy
);
1350 UzAttrib
*uz
= new UzAttrib();
1351 Tango::UserDefaultAttrProp uz_prop
;
1352 uz_prop
.set_unit("degree");
1353 uz_prop
.set_description("The z coordinate of the U matrix");
1354 uz
->set_default_properties(uz_prop
);
1355 att_list
.push_back(uz
);
1357 // Attribute : AStar
1358 AStarAttrib
*astar
= new AStarAttrib();
1359 Tango::UserDefaultAttrProp astar_prop
;
1360 astar_prop
.set_description("The a* crystal parameter");
1361 astar
->set_default_properties(astar_prop
);
1362 att_list
.push_back(astar
);
1364 // Attribute : BStar
1365 BStarAttrib
*bstar
= new BStarAttrib();
1366 Tango::UserDefaultAttrProp bstar_prop
;
1367 bstar_prop
.set_description("The b* crystal parameter");
1368 bstar
->set_default_properties(bstar_prop
);
1369 att_list
.push_back(bstar
);
1371 // Attribute : CStar
1372 CStarAttrib
*cstar
= new CStarAttrib();
1373 Tango::UserDefaultAttrProp cstar_prop
;
1374 cstar_prop
.set_description("The c* crystal parameter");
1375 cstar
->set_default_properties(cstar_prop
);
1376 att_list
.push_back(cstar
);
1378 // Attribute : AlphaStar
1379 AlphaStarAttrib
*alpha_star
= new AlphaStarAttrib();
1380 Tango::UserDefaultAttrProp alpha_star_prop
;
1381 alpha_star_prop
.set_description("The alpha* crystal parameter");
1382 alpha_star
->set_default_properties(alpha_star_prop
);
1383 att_list
.push_back(alpha_star
);
1385 // Attribute : BetaStar
1386 BetaStarAttrib
*beta_star
= new BetaStarAttrib();
1387 Tango::UserDefaultAttrProp beta_star_prop
;
1388 beta_star_prop
.set_description("The beta* crystal parameter");
1389 beta_star
->set_default_properties(beta_star_prop
);
1390 att_list
.push_back(beta_star
);
1392 // Attribute : GammaStar
1393 GammaStarAttrib
*gamma_star
= new GammaStarAttrib();
1394 Tango::UserDefaultAttrProp gamma_star_prop
;
1395 gamma_star_prop
.set_description("The beta* crystal parameter");
1396 gamma_star
->set_default_properties(gamma_star_prop
);
1397 att_list
.push_back(gamma_star
);
1399 // Attribute : AxesNames
1400 AxesNamesAttrib
*axes_names
= new AxesNamesAttrib();
1401 Tango::UserDefaultAttrProp axes_names_prop
;
1402 axes_names_prop
.set_description("the names of the Dynamic axis attributes");
1403 axes_names
->set_default_properties(axes_names_prop
);
1404 att_list
.push_back(axes_names
);
1406 // Attribute : CrystalNames
1407 CrystalNamesAttrib
*crystal_names
= new CrystalNamesAttrib();
1408 att_list
.push_back(crystal_names
);
1410 // Attribute : ModeNames
1411 ModeNamesAttrib
*mode_names
= new ModeNamesAttrib();
1412 att_list
.push_back(mode_names
);
1414 // Attribute : Angles
1415 AnglesAttrib
*angles
= new AnglesAttrib();
1416 Tango::UserDefaultAttrProp angles_prop
;
1417 angles_prop
.set_description("containe all the hkl computed values.\nsimulated (0/1) h, k, l, axies angles");
1418 angles
->set_default_properties(angles_prop
);
1419 att_list
.push_back(angles
);
1421 // Attribute : AnglesDegenerated
1422 AnglesDegeneratedAttrib
*angles_degenerated
= new AnglesDegeneratedAttrib();
1423 Tango::UserDefaultAttrProp angles_degenerated_prop
;
1424 angles_degenerated_prop
.set_description("containe all the hkl computed values.\nsimulated (0/1) h, k, l, axies angles");
1425 angles_degenerated
->set_default_properties(angles_degenerated_prop
);
1426 att_list
.push_back(angles_degenerated
);
1428 // Attribute : AnglesRangeCheck
1429 AnglesRangeCheckAttrib
*angles_range_check
= new AnglesRangeCheckAttrib();
1430 Tango::UserDefaultAttrProp angles_range_check_prop
;
1431 angles_range_check_prop
.set_description("containe all the hkl computed values.\nsimulated (0/1) h, k, l, axies angles");
1432 angles_range_check
->set_default_properties(angles_range_check_prop
);
1433 att_list
.push_back(angles_range_check
);
1435 // Attribute : ComputedAngles
1436 ComputedAnglesAttrib
*computed_angles
= new ComputedAnglesAttrib();
1437 Tango::UserDefaultAttrProp computed_angles_prop
;
1438 computed_angles_prop
.set_description("containe all the hkl computed values.\nsimulated (0/1) h, k, l, axies angles");
1439 computed_angles
->set_default_properties(computed_angles_prop
);
1440 att_list
.push_back(computed_angles
);
1442 // Attribute : CrystalReflections
1443 CrystalReflectionsAttrib
*crystal_reflections
= new CrystalReflectionsAttrib();
1444 att_list
.push_back(crystal_reflections
);
1446 // Attribute : Reflections
1447 ReflectionsAttrib
*reflections
= new ReflectionsAttrib();
1448 att_list
.push_back(reflections
);
1450 // Attribute : ReflectionsAngles
1451 ReflectionsAnglesAttrib
*reflections_angles
= new ReflectionsAnglesAttrib();
1452 Tango::UserDefaultAttrProp reflections_angles_prop
;
1453 reflections_angles_prop
.set_description("matrix with the theoretical (lower triangular part) and\nmesured angles (upper triangular part) between\nreflections.");
1454 reflections_angles
->set_default_properties(reflections_angles_prop
);
1455 att_list
.push_back(reflections_angles
);
1458 UBAttrib
*ub
= new UBAttrib();
1459 Tango::UserDefaultAttrProp ub_prop
;
1460 ub_prop
.set_description("The UB matrix of the current crystal");
1461 ub
->set_default_properties(ub_prop
);
1462 att_list
.push_back(ub
);
1464 // End of Automatic code generation
1465 //-------------------------------------------------------------
1468 //+----------------------------------------------------------------------------
1470 // method : DiffractometerDeviceClass::get_class_property()
1472 // description : Read the class properties from database.
1474 //-----------------------------------------------------------------------------
1475 void DiffractometerDeviceClass::get_class_property()
1477 // Initialize your default values here (if not done with POGO).
1478 //------------------------------------------------------------------
1480 // Read class properties from database.(Automatic code generation)
1481 //------------------------------------------------------------------
1483 // Call database and extract values
1484 //--------------------------------------------
1485 if (Tango::Util::instance()->_UseDb
==true)
1486 get_db_class()->get_property(cl_prop
);
1487 Tango::DbDatum def_prop
;
1491 // End of Automatic code generation
1492 //------------------------------------------------------------------
1496 //+----------------------------------------------------------------------------
1498 // method : DiffractometerDeviceClass::set_default_property
1500 // description: Set default property (class and device) for wizard.
1501 // For each property, add to wizard property name and description
1502 // If default value has been set, add it to wizard property and
1503 // store it in a DbDatum.
1505 //-----------------------------------------------------------------------------
1506 void DiffractometerDeviceClass::set_default_property()
1512 vector
<string
> vect_data
;
1513 // Set Default Class Properties
1514 // Set Default Device Properties
1515 prop_name
= "TauConstant";
1516 prop_desc
= "Definition of the Tau constant .\nPossible values are pi or 1 .\nDefault : 1";
1518 if (prop_def
.length()>0)
1520 Tango::DbDatum
data(prop_name
);
1522 dev_def_prop
.push_back(data
);
1523 add_wiz_dev_prop(prop_name
, prop_desc
, prop_def
);
1526 add_wiz_dev_prop(prop_name
, prop_desc
);
1528 prop_name
= "RealAxisProxies";
1530 prop_def
= "mu:tests/diffabs/mu\nkomega:tests/diffabs/komega\nkappa:tests/diffabs/kappa\nkphi:tests/diffabs/kphi\ndelta:tests/diffabs/delta\ngamma:tests/diffabs/gamma";
1532 vect_data
.push_back("mu:tests/diffabs/mu");
1533 vect_data
.push_back("komega:tests/diffabs/komega");
1534 vect_data
.push_back("kappa:tests/diffabs/kappa");
1535 vect_data
.push_back("kphi:tests/diffabs/kphi");
1536 vect_data
.push_back("delta:tests/diffabs/delta");
1537 vect_data
.push_back("gamma:tests/diffabs/gamma");
1538 if (prop_def
.length()>0)
1540 Tango::DbDatum
data(prop_name
);
1542 dev_def_prop
.push_back(data
);
1543 add_wiz_dev_prop(prop_name
, prop_desc
, prop_def
);
1546 add_wiz_dev_prop(prop_name
, prop_desc
);
1548 prop_name
= "LambdaAttributeProxy";
1549 prop_desc
= "The name of the lambda attribute proxy.\n\nThe diffractometer use it to read the lambda value from another Device";
1551 if (prop_def
.length()>0)
1553 Tango::DbDatum
data(prop_name
);
1555 dev_def_prop
.push_back(data
);
1556 add_wiz_dev_prop(prop_name
, prop_desc
, prop_def
);
1559 add_wiz_dev_prop(prop_name
, prop_desc
);
1561 prop_name
= "DiffractometerType";
1562 prop_desc
= "The Type of the diffractometer\n\n";
1564 if (prop_def
.length()>0)
1566 Tango::DbDatum
data(prop_name
);
1568 dev_def_prop
.push_back(data
);
1569 add_wiz_dev_prop(prop_name
, prop_desc
, prop_def
);
1572 add_wiz_dev_prop(prop_name
, prop_desc
);
1575 //+----------------------------------------------------------------------------
1577 // method : DiffractometerDeviceClass::write_class_property
1579 // description : Set class description as property in database
1581 //-----------------------------------------------------------------------------
1582 void DiffractometerDeviceClass::write_class_property()
1584 // First time, check if database used
1585 //--------------------------------------------
1586 if (Tango::Util::_UseDb
== false)
1590 string classname
= get_name();
1592 string::size_type start
, end
;
1595 Tango::DbDatum
title("ProjectTitle");
1596 string
str_title("null");
1598 data
.push_back(title
);
1601 Tango::DbDatum
description("Description");
1602 vector
<string
> str_desc
;
1603 str_desc
.push_back(" ");
1604 description
<< str_desc
;
1605 data
.push_back(description
);
1608 string
rcsId(RcsId
);
1609 string
filename(classname
);
1610 start
= rcsId
.find("/");
1611 if (start
!=string::npos
)
1613 filename
+= "Class.cpp";
1614 end
= rcsId
.find(filename
);
1617 string strloc
= rcsId
.substr(start
, end
-start
);
1618 // Check if specific repository
1619 start
= strloc
.find("/cvsroot/");
1620 if (start
!=string::npos
&& start
>0)
1622 string repository
= strloc
.substr(0, start
);
1623 if (repository
.find("/segfs/")!=string::npos
)
1624 strloc
= "ESRF:" + strloc
.substr(start
, strloc
.length()-start
);
1626 Tango::DbDatum
cvs_loc("cvs_location");
1628 data
.push_back(cvs_loc
);
1632 // Get CVS tag revision
1633 string
tagname(TagName
);
1635 start
= header
.length();
1636 string
endstr(" $");
1637 end
= tagname
.find(endstr
);
1638 if (end
!=string::npos
&& end
>start
)
1640 string strtag
= tagname
.substr(start
, end
-start
);
1641 Tango::DbDatum
cvs_tag("cvs_tag");
1643 data
.push_back(cvs_tag
);
1647 string
httpServ(HttpServer
);
1648 if (httpServ
.length()>0)
1650 Tango::DbDatum
db_doc_url("doc_url");
1651 db_doc_url
<< httpServ
;
1652 data
.push_back(db_doc_url
);
1656 Tango::DbDatum
inher_datum("InheritedFrom");
1657 vector
<string
> inheritance
;
1658 inheritance
.push_back("Device_3Impl");
1659 inher_datum
<< inheritance
;
1660 data
.push_back(inher_datum
);
1662 // Call database and and values
1663 //--------------------------------------------
1664 get_db_class()->put_property(data
);