5 #ifndef __DDS__UIChannelInfo__ 6 #define __DDS__UIChannelInfo__ 19 #include <boost/property_tree/json_parser.hpp> 23 namespace commander_cmd
38 , m_startTime(std::chrono::steady_clock::now())
59 m_startTime = std::chrono::steady_clock::now();
74 T* pThis = static_cast<T*>(
this);
75 std::string userMessage = pThis->getMessage(_sender, _cmd, _channel);
80 std::chrono::steady_clock::time_point curTime = std::chrono::steady_clock::now();
87 std::chrono::duration_cast<std::chrono::milliseconds>(curTime - m_startTime).count()));
91 catch (std::bad_weak_ptr& e)
110 T* pThis = static_cast<T*>(
this);
111 std::string userMessage = pThis->getErrorMessage(_sender, _cmd, _channel);
116 std::chrono::steady_clock::time_point curTime = std::chrono::steady_clock::now();
122 std::chrono::duration_cast<std::chrono::milliseconds>(curTime - m_startTime).count()));
126 catch (std::bad_weak_ptr& e)
145 dds::tools_api::SMessageResponseData msg;
148 msg.m_severity = _severity;
151 cmd.
m_sCmd = msg.toJSON();
153 pUI->template pushMsg<protocol_api::cmdCUSTOM_CMD>(cmd);
176 pUI->template pushMsg<protocol_api::cmdCUSTOM_CMD>(cmd);
194 dds::tools_api::SDoneResponseData done;
197 cmd.
m_sCmd = done.toJSON();
199 pUI->template pushMsg<protocol_api::cmdCUSTOM_CMD>(cmd);
208 void checkAllReceived()
216 T* pThis = static_cast<T*>(
this);
217 std::string userMessage = pThis->getAllReceivedMessage();
228 catch (std::bad_weak_ptr& e)
246 std::chrono::steady_clock::time_point m_startTime;
262 std::stringstream ss;
263 auto p = _channel.lock();
273 std::stringstream ss;
274 auto p = _channel.lock();
281 std::stringstream ss;
303 std::stringstream ss;
304 auto p = _channel.lock();
306 float speed = (downloadTime != 0.) ? 0.001 * _cmd.
m_receivedFileSize / downloadTime : 0;
308 <<
" bytes in " << downloadTime <<
" s (" << speed <<
" KB/s)";
316 std::stringstream ss;
317 auto p = _channel.lock();
324 std::stringstream ss;
329 float speed = (downloadTime != 0.) ? 0.001 *
m_totalReceived / downloadTime : 0;
330 ss <<
"download " <<
m_totalReceived <<
" bytes in " << downloadTime <<
" s (" << speed <<
" KB/s)";
351 std::stringstream ss;
352 auto p = _channel.lock();
359 str =
"Topology updated";
368 std::stringstream ss;
369 auto p = _channel.lock();
376 std::stringstream ss;
383 str =
"topology updates";
Definition: ProtocolCommands.h:54
Definition: BaseEventHandlersImpl.h:48
bool processErrorMessage(const dds::protocol_api::SSenderInfo &_sender, const A &_cmd, CAgentChannel::weakConnectionPtr_t _channel)
Definition: UIChannelInfo.h:100
Definition: ProtocolCommands.h:61
CGetLogChannelInfo()
Definition: UIChannelInfo.h:252
void sendUIProgress(const dds::tools_api::SProgressResponseData &_progress)
Definition: UIChannelInfo.h:161
void checkPluginFailedToStart()
Definition: UIChannelInfo.cpp:169
size_t nofReceived() const
Definition: UIChannelInfo.h:43
std::string getErrorMessage(const protocol_api::SSimpleMsgCmd &_cmd, CAgentChannel::weakConnectionPtr_t _channel) const
Definition: UIChannelInfo.cpp:32
Definition: BinaryAttachmentReceivedCmd.h:15
bool isPluginOnline()
Definition: UIChannelInfo.cpp:162
size_t m_totalTime
Definition: UIChannelInfo.h:335
std::string getMessage(const protocol_api::SSimpleMsgCmd &_cmd, CAgentChannel::weakConnectionPtr_t _channel) const
Definition: UIChannelInfo.cpp:23
uint32_t m_receivedFileSize
Number of recieved bytes.
Definition: BinaryAttachmentReceivedCmd.h:26
std::string getErrorMessage(const dds::protocol_api::SSenderInfo &, const protocol_api::SReplyCmd &_cmd, CAgentChannel::weakConnectionPtr_t _channel) const
Definition: UIChannelInfo.h:312
Definition: UIChannelInfo.h:249
bool m_shutdownOnComplete
Definition: UIChannelInfo.h:241
Definition: UIChannelInfo.h:288
std::string getMessage(const dds::protocol_api::SSenderInfo &, const protocol_api::SReplyCmd &, CAgentChannel::weakConnectionPtr_t _channel) const
Definition: UIChannelInfo.h:347
size_t m_nofReceivedErrors
Definition: UIChannelInfo.h:237
Definition: ReplyCmd.h:15
std::string m_strInitialSubmitRequest
Definition: UIChannelInfo.h:413
std::string getAllReceivedMessage() const
Definition: UIChannelInfo.h:322
std::string m_sCondition
Definition: CustomCmdCmd.h:25
CAgentChannel::weakConnectionPtr_t m_channelSubmitPlugin
Definition: UIChannelInfo.h:412
std::mutex m_mutexStart
Definition: UIChannelInfo.h:239
std::weak_ptr< CAgentChannel > weakConnectionPtr_t
Definition: BaseChannelImpl.h:230
dds::tools_api::requestID_t m_requestID
Definition: UIChannelInfo.h:243
std::string m_sCmd
Definition: CustomCmdCmd.h:24
Definition: SimpleMsgCmd.h:16
void zeroCounters()
Definition: UIChannelInfo.h:54
CUpdateTopologyChannelInfo()
Definition: UIChannelInfo.h:341
std::string getAllReceivedMessage() const
Definition: UIChannelInfo.cpp:41
std::string m_sMsg
Definition: ReplyCmd.h:33
void doneWithUI()
Definition: UIChannelInfo.h:184
std::string m_requestedFileName
Requested name of the file.
Definition: BinaryAttachmentReceivedCmd.h:24
Definition: UIChannelInfo.h:338
size_t m_totalReceived
Definition: UIChannelInfo.h:334
Miscellaneous functions and helpers are located here.
Definition: AgentConnectionManager.h:13
CUIChannelInfo()
Definition: UIChannelInfo.h:30
std::chrono::system_clock::duration m_PluginStartTime
Definition: UIChannelInfo.h:414
std::string getErrorMessage(const dds::protocol_api::SSenderInfo &, const protocol_api::SReplyCmd &_cmd, CAgentChannel::weakConnectionPtr_t _channel) const
Definition: UIChannelInfo.h:364
Definition: UIChannelInfo.h:26
Definition: ProtocolCommands.h:52
bool processCustomCommandMessage(const protocol_api::SCustomCmdCmd &_cmd, CAgentChannel::weakConnectionPtr_t _channel)
Definition: UIChannelInfo.cpp:50
CSubmitAgentsChannelInfo()
Definition: UIChannelInfo.cpp:15
Definition: ProtocolCommands.h:51
std::string getMessage(const dds::protocol_api::SSenderInfo &, const protocol_api::SBinaryAttachmentReceivedCmd &_cmd, CAgentChannel::weakConnectionPtr_t _channel) const
Definition: UIChannelInfo.h:299
CTestChannelInfo()
Definition: UIChannelInfo.h:291
bool allReceived() const
Definition: UIChannelInfo.h:48
CAgentChannel::weakConnectionPtr_t m_channel
Definition: UIChannelInfo.h:238
Definition: CustomCmdCmd.h:14
uint32_t m_downloadTime
Time spent to download file [microseconds].
Definition: BinaryAttachmentReceivedCmd.h:27
Definition: ProtocolCommands.h:46
uint16_t m_srcCommand
Definition: UIChannelInfo.h:242
bool m_bInit
Definition: UIChannelInfo.h:415
std::string getAllReceivedMessage() const
Definition: UIChannelInfo.h:374
EMsgSeverity
Enumeration with message severity.
Definition: Intercom.h:126
std::mutex m_mutexReceive
Definition: UIChannelInfo.h:240
std::string getErrorMessage(const dds::protocol_api::SSenderInfo &, const protocol_api::SReplyCmd &_cmd, CAgentChannel::weakConnectionPtr_t _channel) const
Definition: UIChannelInfo.h:269
size_t m_nofRequests
Definition: UIChannelInfo.h:235
bool processMessage(const dds::protocol_api::SSenderInfo &_sender, const A &_cmd, CAgentChannel::weakConnectionPtr_t _channel)
Definition: UIChannelInfo.h:64
void sendUIMessage(const std::string &_msg, dds::intercom_api::EMsgSeverity _severity=dds::intercom_api::EMsgSeverity::info)
Definition: UIChannelInfo.h:134
std::string getAllReceivedMessage() const
Definition: UIChannelInfo.h:279
void initPlugin()
Definition: UIChannelInfo.cpp:248
void shutdown()
Definition: UIChannelInfo.cpp:218
std::string getMessage(const dds::protocol_api::SSenderInfo &, const protocol_api::SBinaryAttachmentReceivedCmd &_cmd, CAgentChannel::weakConnectionPtr_t _channel) const
Definition: UIChannelInfo.h:258
size_t m_nofReceived
Definition: UIChannelInfo.h:236
Definition: UIChannelInfo.h:391