HLCC Documentation 2.2.0
Loading...
Searching...
No Matches
oldbInterface.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_PFSSIMHLCC_OLDBINTERFACE_HPP
14#define HLCC_PFSSIMHLCC_OLDBINTERFACE_HPP
15
16#include <string>
17#include <vector>
18#include <memory> // shared_ptr
19
21#include <boost/asio/thread_pool.hpp>
22#include <taiclock/taiClock.hpp>
23#include <rad/oldbInterface.hpp>
24#include <rad/cii/oldbAdapter.hpp>
25#include "Ccsinsif.hpp"
26#include "Ccsinsdetif.hpp"
28#include "pfssimhlcc/config.hpp"
31
32namespace hlcc::pfssimhlcc {
33
34/*
35 * Monitor OLDB Attributes.
36 */
37const std::string KEY_MON_GPA_PCORR_RA = "mon/gpa/pcorrection_ra";
38const std::string KEY_MON_GPA_PCORR_DEC = "mon/gpa/pcorrection_dec";
39const std::string KEY_MON_GPA_PCORR_VALID = "mon/gpa/pcorrection_valid";
40const std::string KEY_MON_GPA_PCORR_TSTAMP = "mon/gpa/timstamp";
41const std::string KEY_MON_GPB_PCORR_RA = "mon/gpb/pcorrection_ra";
42const std::string KEY_MON_GPB_PCORR_DEC = "mon/gpb/pcorrection_dec";
43const std::string KEY_MON_GPB_PCORR_VALID = "mon/gpb/pcorrection_valid";
44const std::string KEY_MON_GPB_PCORR_TSTAMP = "mon/gpb/timstamp";
45const std::string KEY_MON_GPC_PCORR_RA = "mon/gpc/pcorrection_ra";
46const std::string KEY_MON_GPC_PCORR_DEC = "mon/gpc/pcorrection_dec";
47const std::string KEY_MON_GPC_PCORR_VALID = "mon/gpc/pcorrection_valid";
48const std::string KEY_MON_GPC_PCORR_TSTAMP = "mon/gpc/timstamp";
49const std::string HEARTBEAT("mon/heartbeat");
50
54class OldbInterface : public rad::OldbInterface {
55 public:
62 OldbInterface(const std::string& prefix = "");
63
67 virtual ~OldbInterface();
68
73 void Init(::hlcc::pfssimhlcc::Config& config);
74
80
81 void SetConfig(const rad::Config& cfg); // solves hidden virtual function
82
84 void StorePointingCorrections(const pfs::gpctr::PointingCorrection pcorr_a, // PointingCorrections are immutable: const is no pointless here
86 const pfs::gpctr::PointingCorrection pcorr_c);
87
88 void UpdateHeartbeat();
89 OldbInterface(const OldbInterface&) = delete;
91
92 private:
93
94 std::shared_ptr<::hlcc::oldbmux::CiiOldbDataPointAsync<double>> heartbeat_subscriber;
95
105 boost::asio::thread_pool m_async_exec {2};
106
112 log4cplus::Logger m_logger_oldb_async;
113
114};
115
116} // namespace hlcc::pfssimhlcc
117
118#endif // HLCC_PFSSIMHLCC_OLDBINTERFACE_HPP
Definition config.hpp:213
Definition oldbInterface.hpp:54
void UpdateHeartbeat()
Definition oldbInterface.cpp:170
void Init(::hlcc::pfssimhlcc::Config &config)
Definition oldbInterface.cpp:61
OldbInterface(const OldbInterface &)=delete
void SetConfig(hlcc::pfssimhlcc::Config &cfg)
Definition oldbInterface.cpp:112
void StorePointingCorrections(const pfs::gpctr::PointingCorrection pcorr_a, const pfs::gpctr::PointingCorrection pcorr_b, const pfs::gpctr::PointingCorrection pcorr_c)
Store the pointing corrections of the GPs in the OLDB.
Definition oldbInterface.cpp:142
OldbInterface(const std::string &prefix="")
Definition oldbInterface.cpp:35
OldbInterface & operator=(const OldbInterface &)=delete
Disable copy constructor.
virtual ~OldbInterface()
Definition oldbInterface.cpp:44
Definition pointingCorrection.hpp:29
Definition actionMgr.cpp:34
const std::string KEY_MON_GPC_PCORR_VALID
Definition oldbInterface.hpp:47
const std::string KEY_MON_GPB_PCORR_VALID
Definition oldbInterface.hpp:43
const std::string KEY_MON_GPB_PCORR_RA
Definition oldbInterface.hpp:41
const std::string KEY_MON_GPA_PCORR_VALID
Definition oldbInterface.hpp:39
const std::string KEY_MON_GPB_PCORR_DEC
Definition oldbInterface.hpp:42
const std::string KEY_MON_GPA_PCORR_TSTAMP
Definition oldbInterface.hpp:40
const std::string KEY_MON_GPC_PCORR_TSTAMP
Definition oldbInterface.hpp:48
const std::string KEY_MON_GPB_PCORR_TSTAMP
Definition oldbInterface.hpp:44
const std::string KEY_MON_GPC_PCORR_RA
Definition oldbInterface.hpp:45
const std::string KEY_MON_GPA_PCORR_DEC
Definition oldbInterface.hpp:38
const std::string KEY_MON_GPC_PCORR_DEC
Definition oldbInterface.hpp:46
const std::string KEY_MON_GPA_PCORR_RA
Definition oldbInterface.hpp:37
const std::string HEARTBEAT("mon/heartbeat")
Config class header file.
Performance and other monitoring.
PointingCorrectionType class header file.