14#include <yarp/companion/impl/Companion.h>
28 if (NetworkProfiler::progCallback) {
72 if(NetworkProfiler::progCallback) {
92 yWarning() <<
"Found a nonexistent port (" <<
cnn.port_name <<
")"
93 <<
"in the output list of" << (*vi1)->property.find(
"name").asString();
97 if(NetworkProfiler::progCallback) {
101 if (NetworkProfiler::progCallback) {
102 NetworkProfiler::progCallback->
onProgress(100);
112 for(itr = vertices.begin(); itr!=vertices.end(); itr++) {
121 mv1->property.find(
"hostname").asString());
122 mv2->property =
mv1->property;
128 for(itr = vertices.begin(); itr!=vertices.end(); itr++) {
136 pv1->property.find(
"hostname").asString());
137 pv2->property =
pv1->property;
142 for(itr = vertices.begin(); itr!=vertices.end(); itr++) {
150 const Edge&
e = (*eitr);
156 const Vertex&
p2 = (*peitr).second();
158 std::string label =
p1.property.find(
"name").asString();
159 label.append(
" - ").append(
p2.property.find(
"name").asString());
160 prop.
put(
"label", label);
161 subgraph.insertEdge(*
v1,
p2.outEdges()[0].second(), prop);
199 if (level ==
"NORMAL") {
202 if (level ==
"LOW") {
205 if (level ==
"HIGH") {
208 if (level ==
"CRITIC") {
211 if (level ==
"INVALID") {
222 for(itr = vertices.begin(); itr!=vertices.end(); itr++) {
224 for(
const auto&
i :
v1.outEdges()) {
227 if(!
v1.property.check(
"hidden") && !
v2.property.check(
"hidden")) {
228 if(
edge.property.find(
"type").asString() ==
"connection") {
234 edge.property.put(
"FromThreadPriority",
fromStyle.getThreadPriority());
235 edge.property.put(
"FromThreadPolicy",
fromStyle.getThreadPolicy());
236 edge.property.put(
"FromPacketPriority",
fromStyle.getPacketPriorityAsLevel());
237 edge.property.put(
"ToThreadPriority",
toStyle.getThreadPriority());
238 edge.property.put(
"ToThreadPolicy",
toStyle.getThreadPolicy());
239 edge.property.put(
"ToPacketPriority",
toStyle.getPacketPriorityAsLevel());
241 yWarning() <<
"Cannot retrieve Qos property of" <<
v1.property.find(
"name").asString() <<
"->" <<
v2.property.find(
"name").asString();
263 yError()<<
"Cannot write to"<<portName;
283 yError()<<
"Cannot write to"<<portName;
305 yError()<<
"Cannot write to"<<portName;
308 if(reply.
size() > 1) {
330 yError()<<
"Cannot write to"<<portName;
333 if(param.
size() > 1) {
edge_set::const_iterator edge_const_iterator
pvertex_set::const_iterator pvertex_const_iterator
std::vector< yarp::profiler::graph::Vertex * > pvertex_set
pvertex_set::iterator pvertex_iterator
std::vector< yarp::profiler::graph::Edge > edge_set
A simple collection of objects that can be described and transmitted in a portable way.
void add(const Value &value)
Add a Value to the bottle, at the end of the list.
size_type size() const
Gets the number of elements in the bottle.
Value & get(size_type index) const
Reads a Value v from a certain part of the list.
void addString(const char *str)
Places a string in the bottle, at the end of the list.
std::string toString() const override
Gives a human-readable textual representation of the bottle.
A mini-server for performing network communication in the background.
static bool getConnectionQos(const std::string &src, const std::string &dest, QosStyle &srcStyle, QosStyle &destStyle, bool quiet=true)
Gets the Qos preferences of a connection.
static bool write(const Contact &contact, PortWriter &cmd, PortReader &reply, bool admin=false, bool quiet=false, double timeout=-1)
Send a single command to a port and await a single response.
A class for storing options and configuration information.
std::string toString() const override
Return a standard text representation of the content of the object.
void put(const std::string &key, const std::string &value)
Associate the given key with the given string.
Preferences for the port's Quality of Service.
PacketPriorityLevel
The PacketPriorityLevel defines the packets quality of service (priority) levels.
virtual bool isString() const
Checks if value is a string.
virtual std::int32_t asInt32() const
Get 32-bit integer value.
virtual bool isInt32() const
Checks if value is a 32-bit integer.
virtual std::string asString() const
Get string value.
ports_detail_set::iterator ports_detail_iterator
std::vector< PortDetails > ports_detail_set
virtual void onProgress(unsigned int percentage)
static bool getPortmonitorParams(std::string portName, yarp::os::Bottle ¶m)
static std::string packetPrioToString(yarp::os::QosStyle::PacketPriorityLevel level)
static bool attachPortmonitorPlugin(std::string portName, yarp::os::Property pluginProp)
static bool updateConnectionQosStatus(yarp::profiler::graph::Graph &graph)
static bool setPortmonitorParams(std::string portName, yarp::os::Property ¶m)
static yarp::os::QosStyle::PacketPriorityLevel packetStringToPrio(std::string level)
static bool creatNetworkGraph(ports_detail_set details, yarp::profiler::graph::Graph &graph)
creatNetworkGraph
static bool creatSimpleModuleGraph(yarp::profiler::graph::Graph &graph, yarp::profiler::graph::Graph &subgraph)
static bool detachPortmonitorPlugin(std::string portName)
The yarp::profiler::graph::Edge class.
The yarp::profiler::graph::Graph class.
void insertEdge(const Vertex &v1, const Vertex &v2, const yarp::os::Property &property="")
const pvertex_set & vertices()
const pvertex_iterator find(const Vertex &v1)
pvertex_iterator insert(const Vertex &vertex)
bool setOwner(yarp::profiler::graph::Vertex *_owner)
The yarp::profiler::graph::Vertex class.
yarp::os::Property property
An interface to the operating system, including Port based communication.
std::vector< ConnectedPortInfo > outputs
std::vector< ConnectedPortInfo > inputs
ProcessInfo owner_process
MachineInfo owner_machine