COMPASS  5.4.4
End-to-end AO simulation tool using GPU acceleration
sutra_rtc_brahma.h
1 // -----------------------------------------------------------------------------
2 // This file is part of COMPASS <https://anr-compass.github.io/compass/>
3 //
4 // Copyright (C) 2011-2023 COMPASS Team <https://github.com/ANR-COMPASS>
5 // All rights reserved.
6 
7 // -----------------------------------------------------------------------------
8 
16 
17 #ifndef SUTRA_RTC_BRAHMA_H_
18 #define SUTRA_RTC_BRAHMA_H_
19 
20 #include <BRAHMA_context.h>
21 #include <sutra_rtc.h>
22 #include <SutraRtcBrahmaListenerImpl.h>
23 #include <sutra_target.h>
24 #include <sutra_wfs.h>
25 
26 template <typename T>
27 class SutraRtcBrahma : public SutraRtc<float, T, float> {
28  private:
29  DDS::Subscriber_var sub;
30  DDS::Publisher_var pub;
31 
32  DDS::DataReaderListener_var cmd_listener;
33  SutraRtcBrahmaListenerImpl<T> *cmd_listener_servant;
34  DDS::DataReader_var cmd_dr;
35 
36  DDS::DataWriter_var superframe_base_dw;
37  BRAHMA::SuperFrameDataWriter_var superframe_dw;
38  DDS::InstanceHandle_t superframe_handle;
39 
40  DDS::DataWriter_var megaframe_base_dw;
41  BRAHMA::MegaFrameDataWriter_var megaframe_dw;
42  DDS::InstanceHandle_t megaframe_handle;
43 
44  CORBA::Octet *buff_wfs;
45  CORBA::Octet *buff_wfs_phase;
46  CORBA::Octet *buff_intensities;
47  CORBA::Octet *buff_slopes;
48  CORBA::Octet *buff_commands;
49  CORBA::Octet *buff_target;
50  CORBA::Octet *buff_target_phase;
51 
52  CORBA::ULong *dims_wfs;
53  CORBA::ULong *dims_wfs_phase;
54  CORBA::ULong *dims_intensities;
55  CORBA::ULong *dims_slopes;
56  CORBA::ULong *dims_commands;
57  CORBA::ULong *dims_target;
58  CORBA::ULong *dims_target_phase;
59 
60  long framecounter;
61  ACE_Mutex lock_;
62 
63  int wfs_size;
64  int wfs_phase_size;
65  SutraSensors *wfs;
66  int target_size;
67  int target_phase_size;
68  SutraTarget *target;
69 
70  int nslp;
71  int ncmd;
72  int nvalid;
73 
74  int is_initialised;
75 
76  public:
78  SutraTarget *target, ACE_TCHAR *name);
80 
81  void publish();
82 
83  private:
84  void allocate_buffers();
85 };
86 
87 #endif /* SUTRA_RTC_BRAHMA_H_ */
this class provides the context in which CarmaObj are created
Definition: carma_context.h:79
this class provides the rtc_brahma features to COMPASS
SutraRtcBrahma(CarmaContext *context, SutraSensors *wfs, SutraTarget *target, ACE_TCHAR *name)
this class provides the rtc_brahmaListenerImpl features to COMPASS
this class provides the rtc features to COMPASS
Definition: sutra_rtc.h:36
this class provides the sensors features to COMPASS
Definition: sutra_sensors.h:34
this class provides the target features to COMPASS
Definition: sutra_target.h:29