ifw-ccf 5.0.2
Loading...
Searching...
No Matches
dcsCmdsImpl.hpp
Go to the documentation of this file.
1
5#ifndef CONTROL_DCSCMDSIMPL_HPP_
6#define CONTROL_DCSCMDSIMPL_HPP_
7
8#include <rad/exceptions.hpp>
9#include <rad/smAdapter.hpp>
10
11#include <ifw/ccf/control/dcsCmds.rad.hpp>
12
13namespace ifw::ccf::control {
14
16class DcsCmdsImpl: public dcsif::AsyncDcsCmds {
17 public:
18 explicit DcsCmdsImpl(rad::SMAdapter& sm): m_sm(sm) { LOG4CPLUS_TRACE_METHOD(Logger(), __PRETTY_FUNCTION__); }
19
20 virtual ~DcsCmdsImpl() { LOG4CPLUS_TRACE_METHOD(Logger(), __PRETTY_FUNCTION__); }
21
22 virtual elt::mal::future<std::string> Abort() override {
23 LOG4CPLUS_TRACE_METHOD(Logger(), __PRETTY_FUNCTION__);
24 auto ev = std::make_shared<DcsCmds::Abort>();
25 m_sm.PostEvent(ev);
26 return ev->GetPayload().GetReplyFuture();
27 }
28
29 virtual elt::mal::future<std::string> Execute(
30 const std::shared_ptr<dcsif::Method>& mal_param) override {
31 LOG4CPLUS_TRACE_METHOD(Logger(), __PRETTY_FUNCTION__);
32 auto ev = std::make_shared<DcsCmds::Execute>(mal_param->clone());
33 m_sm.PostEvent(ev);
34 return ev->GetPayload().GetReplyFuture();
35 }
36
37 virtual elt::mal::future<std::string> GetConfig(
38 const std::string& mal_param) override {
39 LOG4CPLUS_TRACE_METHOD(Logger(), __PRETTY_FUNCTION__);
40 auto ev = std::make_shared<DcsCmds::GetConfig>(mal_param);
41 m_sm.PostEvent(ev);
42 return ev->GetPayload().GetReplyFuture();
43 }
44
45 virtual elt::mal::future<std::string> GetDiagnostics() override {
46 LOG4CPLUS_TRACE_METHOD(Logger(), __PRETTY_FUNCTION__);
47 auto ev = std::make_shared<DcsCmds::GetDiagnostics>();
48 m_sm.PostEvent(ev);
49 return ev->GetPayload().GetReplyFuture();
50 }
51
52 virtual elt::mal::future<std::string> GetSetup(
53 const std::string& mal_param) override {
54 LOG4CPLUS_TRACE_METHOD(Logger(), __PRETTY_FUNCTION__);
55 auto ev = std::make_shared<DcsCmds::GetSetup>(mal_param);
56 m_sm.PostEvent(ev);
57 return ev->GetPayload().GetReplyFuture();
58 }
59
60 virtual elt::mal::future<std::string> Ping() override {
61 LOG4CPLUS_TRACE_METHOD(Logger(), __PRETTY_FUNCTION__);
62 auto ev = std::make_shared<DcsCmds::Ping>();
63 m_sm.PostEvent(ev);
64 return ev->GetPayload().GetReplyFuture();
65 }
66
67 virtual elt::mal::future<std::string> ReadPars(
68 const std::string& mal_param) override {
69 LOG4CPLUS_TRACE_METHOD(Logger(), __PRETTY_FUNCTION__);
70 auto ev = std::make_shared<DcsCmds::ReadPars>(mal_param);
71 m_sm.PostEvent(ev);
72 return ev->GetPayload().GetReplyFuture();
73 }
74
75 virtual elt::mal::future<std::string> Recover() override {
76 LOG4CPLUS_TRACE_METHOD(Logger(), __PRETTY_FUNCTION__);
77 auto ev = std::make_shared<DcsCmds::Recover>();
78 m_sm.PostEvent(ev);
79 return ev->GetPayload().GetReplyFuture();
80 }
81
82 virtual elt::mal::future<std::string> Scan() override {
83 LOG4CPLUS_TRACE_METHOD(Logger(), __PRETTY_FUNCTION__);
84 auto ev = std::make_shared<DcsCmds::Scan>();
85 m_sm.PostEvent(ev);
86 return ev->GetPayload().GetReplyFuture();
87 }
88
89 virtual elt::mal::future<std::string> SetConfig(
90 const std::string& mal_param) override {
91 LOG4CPLUS_TRACE_METHOD(Logger(), __PRETTY_FUNCTION__);
92 auto ev = std::make_shared<DcsCmds::SetConfig>(mal_param);
93 m_sm.PostEvent(ev);
94 return ev->GetPayload().GetReplyFuture();
95 }
96
97 virtual elt::mal::future<std::string> Setup(
98 const std::string& mal_param) override {
99 LOG4CPLUS_TRACE_METHOD(Logger(), __PRETTY_FUNCTION__);
100 auto ev = std::make_shared<DcsCmds::Setup>(mal_param);
101 m_sm.PostEvent(ev);
102 return ev->GetPayload().GetReplyFuture();
103 }
104
105 virtual elt::mal::future<std::string> Start(
106 const std::shared_ptr<dcsif::StartProperties>& mal_param) override {
107 LOG4CPLUS_TRACE_METHOD(Logger(), __PRETTY_FUNCTION__);
108 auto ev = std::make_shared<DcsCmds::Start>(mal_param->clone());
109 m_sm.PostEvent(ev);
110 return ev->GetPayload().GetReplyFuture();
111 }
112
113 virtual elt::mal::future<std::string> WritePars(
114 const std::string& mal_param) override {
115 LOG4CPLUS_TRACE_METHOD(Logger(), __PRETTY_FUNCTION__);
116 auto ev = std::make_shared<DcsCmds::WritePars>(mal_param);
117 m_sm.PostEvent(ev);
118 return ev->GetPayload().GetReplyFuture();
119 }
120
121 private:
122 rad::SMAdapter& m_sm;
123};
124
125} // namespace ifw::ccf::control
126
127#endif // CONTROL_DCSCMDSIMPL_HPP_
Implements the CII/MAL interface.
Definition dcsCmdsImpl.hpp:16
virtual elt::mal::future< std::string > Ping() override
Definition dcsCmdsImpl.hpp:60
virtual elt::mal::future< std::string > Abort() override
Definition dcsCmdsImpl.hpp:22
virtual elt::mal::future< std::string > ReadPars(const std::string &mal_param) override
Definition dcsCmdsImpl.hpp:67
virtual ~DcsCmdsImpl()
Definition dcsCmdsImpl.hpp:20
virtual elt::mal::future< std::string > SetConfig(const std::string &mal_param) override
Definition dcsCmdsImpl.hpp:89
virtual elt::mal::future< std::string > GetConfig(const std::string &mal_param) override
Definition dcsCmdsImpl.hpp:37
virtual elt::mal::future< std::string > Setup(const std::string &mal_param) override
Definition dcsCmdsImpl.hpp:97
virtual elt::mal::future< std::string > Execute(const std::shared_ptr< dcsif::Method > &mal_param) override
Definition dcsCmdsImpl.hpp:29
virtual elt::mal::future< std::string > GetSetup(const std::string &mal_param) override
Definition dcsCmdsImpl.hpp:52
virtual elt::mal::future< std::string > Recover() override
Definition dcsCmdsImpl.hpp:75
virtual elt::mal::future< std::string > GetDiagnostics() override
Definition dcsCmdsImpl.hpp:45
virtual elt::mal::future< std::string > WritePars(const std::string &mal_param) override
Definition dcsCmdsImpl.hpp:113
virtual elt::mal::future< std::string > Scan() override
Definition dcsCmdsImpl.hpp:82
virtual elt::mal::future< std::string > Start(const std::shared_ptr< dcsif::StartProperties > &mal_param) override
Definition dcsCmdsImpl.hpp:105
DcsCmdsImpl(rad::SMAdapter &sm)
Definition dcsCmdsImpl.hpp:18
Definition acqThread.cpp:10
log4cplus::Logger & Logger()
Definition base.cpp:23