HLCC Documentation 3.0.0
Loading...
Searching...
No Matches
ambientData.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2020-2025 European Southern Observatory (ESO)
2//
3// SPDX-License-Identifier: LGPL-3.0-only
4
13#ifndef HLCC_AMBIENTDATACLIENT_AMBIENTDATA_HPP
14#define HLCC_AMBIENTDATACLIENT_AMBIENTDATA_HPP
15
16#include <mutex>
17#include <memory>
18
19#include <boost/asio/thread_pool.hpp>
20
21#include <ptk/posastro.hpp>
22#include <rad/logger.hpp>
23#include <rad/cii/oldbAdapter.hpp>
24#include <TrsHksRrIcd.hpp>
25
27
28
29
31
35struct AsmData {
36 bool data_quality; /* false means the quality of the data in this struct is not reliable */
43};
44
45
49public:
53 AmbientData(log4cplus::Logger& logger, rad::cii::OldbAdapter& oldb);
54
55 virtual ~AmbientData();
56
68 bool RefreshTrs(std::string hksrr_uri);
69
80
86 void RefreshAsm();
87
92 void RefreshAsmAsync();
93
98 double GetTemperature() const;
99
104 double GetPressure() const;
105
110 double GetHumidity() const;
111
117 double GetObservingWavelength() const;
118
122 void SetObservingWavelength(double observing_wavelength);
123
130 ptk::Dut1 GetDut1() const;
131
139 void SetDut1(ptk::Dut1 dut1);
140
147 ptk::Arcsecs GetXp() const;
148
156 void SetXp(ptk::Arcsecs xp);
157
164 ptk::Arcsecs GetYp() const;
165
173 void SetYp(ptk::Arcsecs yp);
174
175private:
176
180 log4cplus::Logger& m_logger;
181
186
192 ptk::Dut1 m_dut1;
193
197 ptk::Arcsecs m_xp;
198
202 ptk::Arcsecs m_yp;
203
204
209 rad::cii::OldbAdapter& m_oldb;
210
214 mutable std::recursive_mutex m_mutex {};
215
223 boost::asio::thread_pool m_async_exec;
224
234 std::atomic<bool> m_reading_busy;
235
239 double m_temperature;
240
244 double m_pressure;
245
249 double m_humidity;
250
269 double m_observing_wavelength {650*1e-9};
270
271
272
273};
274
275} // namespace hlcc::ambientdataclient
276
277#endif // HLCC_AMBIENTDATACLIENT_AMBIENTDATA_HPP
double GetHumidity() const
Definition ambientData.cpp:289
bool RefreshTrs(std::string hksrr_uri)
Definition ambientData.cpp:51
void RefreshAsm()
Definition ambientData.cpp:231
ptk::Arcsecs GetXp() const
Definition ambientData.cpp:324
ptk::Dut1 GetDut1() const
Definition ambientData.cpp:312
void SetYp(ptk::Arcsecs yp)
Definition ambientData.cpp:342
void RefreshAsmAsync()
Definition ambientData.cpp:259
double GetTemperature() const
Definition ambientData.cpp:277
AsmData ReadAsm()
Definition ambientData.cpp:102
ptk::Arcsecs GetYp() const
Definition ambientData.cpp:336
virtual ~AmbientData()
Definition ambientData.cpp:46
double GetPressure() const
Definition ambientData.cpp:283
AmbientData(log4cplus::Logger &logger, rad::cii::OldbAdapter &oldb)
Definition ambientData.cpp:31
void SetDut1(ptk::Dut1 dut1)
Definition ambientData.cpp:318
void SetXp(ptk::Arcsecs xp)
Definition ambientData.cpp:330
double GetObservingWavelength() const
Definition ambientData.cpp:295
void SetObservingWavelength(double observing_wavelength)
Definition ambientData.cpp:301
Definition requestor.hpp:39
Definition ambientData.cpp:29
Requestor class header file.
Definition ambientData.hpp:35
double air_temperature
Definition ambientData.hpp:37
bool data_quality
Definition ambientData.hpp:36
double relative_humidity_average
Definition ambientData.hpp:40
double ambient_pressure_average
Definition ambientData.hpp:42
double relative_humidity
Definition ambientData.hpp:39
double ambient_pressure
Definition ambientData.hpp:41
double air_temperature_average
Definition ambientData.hpp:38