28 #include <Ice/Communicator.h>
29 #include <Ice/Endpoint.h>
37 widget.finderLayout->addWidget(finder);
39 connect(widget.pushButtonFinder, SIGNAL(clicked()),
this, SLOT(on_pushButtonFinder_clicked()));
40 connect(widget.pushButtonString, SIGNAL(clicked()),
this, SLOT(on_pushButtonString_clicked()));
52 std::string
str{
"-----"};
55 str = prx->ice_getAdapterId();
57 catch (Ice::Exception& e)
59 ARMARX_ERROR <<
"Error while reading data for the current proxy (ice_getAdapterId):\n what:\n" << e.what();
61 widget.labelAdapterId->setText(QString::fromStdString(
str));
64 std::string
str{
"-----"};
67 str = prx->ice_toString();
69 catch (Ice::Exception& e)
71 ARMARX_ERROR <<
"Error while reading data for the current proxy (ice_toString):\n what:\n" << e.what();
73 widget.labelAsString->setText(QString::fromStdString(
str));
76 std::string
str{
"-----"};
79 str = prx->ice_getIdentity().category +
" / " + prx->ice_getIdentity().name;
81 catch (Ice::Exception& e)
83 ARMARX_ERROR <<
"Error while reading data for the current proxy (ice_getIdentity):\n what:\n" << e.what();
85 widget.labelIdentity->setText(QString::fromStdString(
str));
88 std::string
str{
"-----"};
91 std::stringstream ssend;
92 auto ends = prx->ice_getEndpoints();
93 for (
const auto& end : ends)
95 ssend << end->toString() <<
"\n";
102 catch (Ice::Exception& e)
104 ARMARX_ERROR <<
"Error while reading data for the current proxy (ice_getEndpoints):\n what:\n" << e.what();
106 widget.labelEndpoints->setText(QString::fromStdString(
str));
109 std::string
str{
"-----"};
112 std::stringstream ssctx;
113 auto ctxs = prx->ice_getContext();
114 for (
const auto& ctx : ctxs)
116 ssctx << ctx.first <<
"\t" << ctx.second <<
"\n";
123 catch (Ice::Exception& e)
125 ARMARX_ERROR <<
"Error while reading data for the current proxy (ice_getContext):\n what:\n" << e.what();
127 widget.labelContext->setText(QString::fromStdString(
str));
130 std::string
str{
"-----"};
133 std::stringstream ssids;
134 auto ids = prx->ice_ids();
135 for (
const auto&
id : ids)
144 catch (Ice::Exception& e)
146 ARMARX_ERROR <<
"Error while reading data for the current proxy (ice_ids):\n what:\n" << e.what();
148 widget.labelIds->setText(QString::fromStdString(
str));
151 std::string
str{
"-----"};
154 auto start = std::chrono::high_resolution_clock::now();
156 auto end = std::chrono::high_resolution_clock::now();
157 str =
to_string(std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count()) +
" ms";
159 catch (Ice::Exception& e)
161 ARMARX_ERROR <<
"Error while reading data for the current proxy (ice_ping):\n what:\n" << e.what();
163 widget.labelPing->setText(QString::fromStdString(
str));
167 void armarx::IceProxyWidgetController::on_pushButtonFinder_clicked()
171 loadProxy(getIceManager()->getProxy<Ice::ObjectPrx>(finder->getSelectedProxyName().toStdString()));
175 ARMARX_ERROR <<
"No proxy with the name '" << finder->getSelectedProxyName().toStdString() <<
"' for Ice::ObjectPrx";
179 void armarx::IceProxyWidgetController::on_pushButtonString_clicked()
184 loadProxy(getIceManager()->getCommunicator()->stringToProxy(widget.lineEdit->text().toStdString()));
188 ARMARX_ERROR <<
"Can't convert '" << finder->getSelectedProxyName().toStdString() <<
"' to Ice::ObjectPrx";