COMPASS  5.0.0
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-2019 COMPASS Team <https://github.com/ANR-COMPASS>
5 // All rights reserved.
6 // Distributed under GNU - LGPL
7 //
8 // COMPASS is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser
9 // General Public License as published by the Free Software Foundation, either version 3 of the License,
10 // or any later version.
11 //
12 // COMPASS: End-to-end AO simulation tool using GPU acceleration
13 // The COMPASS platform was designed to meet the need of high-performance for the simulation of AO systems.
14 //
15 // The final product includes a software package for simulating all the critical subcomponents of AO,
16 // particularly in the context of the ELT and a real-time core based on several control approaches,
17 // with performances consistent with its integration into an instrument. Taking advantage of the specific
18 // hardware architecture of the GPU, the COMPASS tool allows to achieve adequate execution speeds to
19 // conduct large simulation campaigns called to the ELT.
20 //
21 // The COMPASS platform can be used to carry a wide variety of simulations to both testspecific components
22 // of AO of the E-ELT (such as wavefront analysis device with a pyramid or elongated Laser star), and
23 // various systems configurations such as multi-conjugate AO.
24 //
25 // COMPASS is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
26 // implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
27 // See the GNU Lesser General Public License for more details.
28 //
29 // You should have received a copy of the GNU Lesser General Public License along with COMPASS.
30 // If not, see <https://www.gnu.org/licenses/lgpl-3.0.txt>.
31 // -----------------------------------------------------------------------------
32 
41 
42 #ifndef SUTRA_RTC_BRAHMA_H_
43 #define SUTRA_RTC_BRAHMA_H_
44 
45 #include <BRAHMA_context.h>
46 #include <sutra_rtc.h>
47 #include <SutraRtcBrahmaListenerImpl.h>
48 #include <sutra_target.h>
49 #include <sutra_wfs.h>
50 
51 template <typename T>
52 class SutraRtcBrahma : public SutraRtc<float, T, float> {
53  private:
54  DDS::Subscriber_var sub;
55  DDS::Publisher_var pub;
56 
57  DDS::DataReaderListener_var cmd_listener;
58  SutraRtcBrahmaListenerImpl<T> *cmd_listener_servant;
59  DDS::DataReader_var cmd_dr;
60 
61  DDS::DataWriter_var superframe_base_dw;
62  BRAHMA::SuperFrameDataWriter_var superframe_dw;
63  DDS::InstanceHandle_t superframe_handle;
64 
65  DDS::DataWriter_var megaframe_base_dw;
66  BRAHMA::MegaFrameDataWriter_var megaframe_dw;
67  DDS::InstanceHandle_t megaframe_handle;
68 
69  CORBA::Octet *buff_wfs;
70  CORBA::Octet *buff_wfs_phase;
71  CORBA::Octet *buff_intensities;
72  CORBA::Octet *buff_slopes;
73  CORBA::Octet *buff_commands;
74  CORBA::Octet *buff_target;
75  CORBA::Octet *buff_target_phase;
76 
77  CORBA::ULong *dims_wfs;
78  CORBA::ULong *dims_wfs_phase;
79  CORBA::ULong *dims_intensities;
80  CORBA::ULong *dims_slopes;
81  CORBA::ULong *dims_commands;
82  CORBA::ULong *dims_target;
83  CORBA::ULong *dims_target_phase;
84 
85  long framecounter;
86  ACE_Mutex lock_;
87 
88  int wfs_size;
89  int wfs_phase_size;
90  SutraSensors *wfs;
91  int target_size;
92  int target_phase_size;
93  SutraTarget *target;
94 
95  int nslp;
96  int ncmd;
97  int nvalid;
98 
99  int is_initialised;
100 
101  public:
103  SutraTarget *target, ACE_TCHAR *name);
105 
106  void publish();
107 
108  private:
109  void allocate_buffers();
110 };
111 
112 #endif /* SUTRA_RTC_BRAHMA_H_ */
SutraTarget
this class provides the target features to COMPASS
Definition: sutra_target.h:54
sutra_target.h
SutraRtcBrahma
this class provides the rtc_brahma features to COMPASS
Definition: sutra_rtc_brahma.h:52
SutraRtcBrahmaListenerImpl
this class provides the rtc_brahmaListenerImpl features to COMPASS
Definition: sutra_rtc_brahmaListenerImpl.h:58
sutra_rtc.h
SutraRtcBrahma::publish
void publish()
SutraRtcBrahma::SutraRtcBrahma
SutraRtcBrahma(CarmaContext *context, SutraSensors *wfs, SutraTarget *target, ACE_TCHAR *name)
sutra_wfs.h
CarmaContext
this class provides the context in which CarmaObj are created
Definition: carma_context.h:104
SutraRtcBrahma::~SutraRtcBrahma
~SutraRtcBrahma()
SutraSensors
this class provides the sensors features to COMPASS
Definition: sutra_sensors.h:59
SutraRtc
this class provides the rtc features to COMPASS
Definition: sutra_rtc.h:60