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 pUI->template pushMsg<protocol_api::cmdSIMPLE_MSG>(
84 std::chrono::steady_clock::time_point curTime = std::chrono::steady_clock::now();
91 std::chrono::duration_cast<std::chrono::milliseconds>(curTime - m_startTime).count()));
96 catch (std::bad_weak_ptr& e)
115 T* pThis =
static_cast<T*
>(
this);
116 std::string userMessage = pThis->getErrorMessage(_sender, _cmd, _channel);
121 pUI->template pushMsg<protocol_api::cmdSIMPLE_MSG>(
125 std::chrono::steady_clock::time_point curTime = std::chrono::steady_clock::now();
132 std::chrono::duration_cast<std::chrono::milliseconds>(curTime - m_startTime).count()));
137 catch (std::bad_weak_ptr& e)
146 void checkAllReceived()
152 T* pThis =
static_cast<T*
>(
this);
153 std::string userMessage = pThis->getAllReceivedMessage();
158 pUI->template pushMsg<protocol_api::cmdSIMPLE_MSG>(
163 pUI->template pushMsg<protocol_api::cmdSHUTDOWN>();
169 catch (std::bad_weak_ptr& e)
186 std::chrono::steady_clock::time_point m_startTime;
202 std::stringstream ss;
203 auto p = _channel.lock();
213 std::stringstream ss;
214 auto p = _channel.lock();
221 std::stringstream ss;
243 std::stringstream ss;
244 auto p = _channel.lock();
246 float speed = (downloadTime != 0.) ? 0.001 * _cmd.
m_receivedFileSize / downloadTime : 0;
248 <<
"]: " << _cmd.
m_receivedFileSize <<
" bytes in " << downloadTime <<
" s (" << speed <<
" KB/s)";
256 std::stringstream ss;
257 auto p = _channel.lock();
264 std::stringstream ss;
268 float downloadTime = 0.000001 * m_totalTime;
269 float speed = (downloadTime != 0.) ? 0.001 * m_totalReceived / downloadTime : 0;
270 ss <<
"download " << m_totalReceived <<
" bytes in " << downloadTime <<
" s (" << speed <<
" KB/s)";
291 std::stringstream ss;
292 auto p = _channel.lock();
302 std::stringstream ss;
303 auto p = _channel.lock();
310 std::stringstream ss;
329 std::string getAllReceivedMessage()
const;
332 bool isPluginOnline();
335 void checkPluginFailedToStart();
Definition: ProtocolCommands.h:53
Definition: BaseEventHandlersImpl.h:48
bool processErrorMessage(const dds::protocol_api::SSenderInfo &_sender, const A &_cmd, CAgentChannel::weakConnectionPtr_t _channel)
Definition: UIChannelInfo.h:105
std::string getMessage(const dds::protocol_api::SSenderInfo &_sender, const protocol_api::SSimpleMsgCmd &_cmd, CAgentChannel::weakConnectionPtr_t _channel) const
Definition: UIChannelInfo.h:287
CGetLogChannelInfo()
Definition: UIChannelInfo.h:192
std::string getMessage(const dds::protocol_api::SSenderInfo &_sender, const protocol_api::SBinaryAttachmentReceivedCmd &_cmd, CAgentChannel::weakConnectionPtr_t _channel) const
Definition: UIChannelInfo.h:239
std::string getErrorMessage(const dds::protocol_api::SSenderInfo &_sender, const protocol_api::SSimpleMsgCmd &_cmd, CAgentChannel::weakConnectionPtr_t _channel) const
Definition: UIChannelInfo.h:209
size_t nofReceived() const
Definition: UIChannelInfo.h:43
Definition: BinaryAttachmentReceivedCmd.h:15
size_t m_totalTime
Definition: UIChannelInfo.h:275
uint32_t m_receivedFileSize
Number of recieved bytes.
Definition: BinaryAttachmentReceivedCmd.h:26
Definition: UIChannelInfo.h:189
bool m_shutdownOnComplete
Definition: UIChannelInfo.h:182
Definition: UIChannelInfo.h:228
size_t m_nofReceivedErrors
Definition: UIChannelInfo.h:178
std::string m_strInitialSubmitRequest
Definition: UIChannelInfo.h:341
std::string getAllReceivedMessage() const
Definition: UIChannelInfo.h:262
CAgentChannel::weakConnectionPtr_t m_channelSubmitPlugin
Definition: UIChannelInfo.h:340
std::mutex m_mutexStart
Definition: UIChannelInfo.h:180
std::weak_ptr< CAgentChannel > weakConnectionPtr_t
Definition: BaseChannelImpl.h:217
Definition: SimpleMsgCmd.h:16
std::string m_sMsg
Definition: SimpleMsgCmd.h:27
void zeroCounters()
Definition: UIChannelInfo.h:54
CUpdateTopologyChannelInfo()
Definition: UIChannelInfo.h:281
std::string m_requestedFileName
Requested name of the file.
Definition: BinaryAttachmentReceivedCmd.h:24
Definition: UIChannelInfo.h:278
size_t m_totalReceived
Definition: UIChannelInfo.h:274
Definition: dds-agent/src/AgentConnectionManager.h:18
CUIChannelInfo()
Definition: UIChannelInfo.h:30
std::string getMessage(const dds::protocol_api::SSenderInfo &_sender, const protocol_api::SBinaryAttachmentReceivedCmd &_cmd, CAgentChannel::weakConnectionPtr_t _channel) const
Definition: UIChannelInfo.h:198
std::chrono::system_clock::duration m_PluginStartTime
Definition: UIChannelInfo.h:342
Definition: UIChannelInfo.h:26
std::string getErrorMessage(const dds::protocol_api::SSenderInfo &_sender, const protocol_api::SSimpleMsgCmd &_cmd, CAgentChannel::weakConnectionPtr_t _channel) const
Definition: UIChannelInfo.h:252
std::string getErrorMessage(const dds::protocol_api::SSenderInfo &_sender, const protocol_api::SSimpleMsgCmd &_cmd, CAgentChannel::weakConnectionPtr_t _channel) const
Definition: UIChannelInfo.h:298
CTestChannelInfo()
Definition: UIChannelInfo.h:231
Definition: ProtocolCommands.h:50
bool allReceived() const
Definition: UIChannelInfo.h:48
CAgentChannel::weakConnectionPtr_t m_channel
Definition: UIChannelInfo.h:179
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:183
bool m_bInit
Definition: UIChannelInfo.h:343
std::string getAllReceivedMessage() const
Definition: UIChannelInfo.h:308
std::mutex m_mutexReceive
Definition: UIChannelInfo.h:181
size_t m_nofRequests
Definition: UIChannelInfo.h:176
bool processMessage(const dds::protocol_api::SSenderInfo &_sender, const A &_cmd, CAgentChannel::weakConnectionPtr_t _channel)
Definition: UIChannelInfo.h:64
std::string getAllReceivedMessage() const
Definition: UIChannelInfo.h:219
Definition: ProgressCmd.h:19
size_t m_nofReceived
Definition: UIChannelInfo.h:177
Definition: UIChannelInfo.h:319