From 74bc8ad9997ee68679decd5d0ad8be6c05c8fe52 Mon Sep 17 00:00:00 2001 From: csoler Date: Mon, 7 Apr 2014 21:35:51 +0000 Subject: [PATCH] bug fixes to NS gui git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7254 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- .../tests/network_simulator/gui/GlobalRouterStatistics.cpp | 4 +++- .../src/tests/network_simulator/gui/NetworkSimulatorGUI.cpp | 4 +++- .../src/tests/network_simulator/network_simulator.pro | 2 ++ libretroshare/src/tests/network_simulator/nscore/Network.cpp | 2 +- libretroshare/src/tests/network_simulator/nscore/PeerNode.cpp | 2 +- 5 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 libretroshare/src/tests/network_simulator/network_simulator.pro diff --git a/libretroshare/src/tests/network_simulator/gui/GlobalRouterStatistics.cpp b/libretroshare/src/tests/network_simulator/gui/GlobalRouterStatistics.cpp index d134a2456..c1642cbb6 100644 --- a/libretroshare/src/tests/network_simulator/gui/GlobalRouterStatistics.cpp +++ b/libretroshare/src/tests/network_simulator/gui/GlobalRouterStatistics.cpp @@ -48,6 +48,7 @@ GlobalRouterStatistics::GlobalRouterStatistics(QWidget *parent) setupUi(this) ; _router_F->setWidget( _tst_CW = new GlobalRouterStatisticsWidget() ) ; + _grouter = NULL ; } GlobalRouterStatistics::~GlobalRouterStatistics() @@ -61,7 +62,8 @@ void GlobalRouterStatistics::setGlobalRouter(const RsGRouter *grouter) } void GlobalRouterStatistics::updateDisplay() { - _tst_CW->updateContent(_grouter) ; + if(_grouter != NULL) + _tst_CW->updateContent(_grouter) ; } QString GlobalRouterStatistics::getPeerName(const RsPeerId &peer_id) diff --git a/libretroshare/src/tests/network_simulator/gui/NetworkSimulatorGUI.cpp b/libretroshare/src/tests/network_simulator/gui/NetworkSimulatorGUI.cpp index c53f061b7..646839a65 100644 --- a/libretroshare/src/tests/network_simulator/gui/NetworkSimulatorGUI.cpp +++ b/libretroshare/src/tests/network_simulator/gui/NetworkSimulatorGUI.cpp @@ -33,6 +33,8 @@ void NetworkSimulatorGUI::updateSelectedNode(int node_id) _turtle_router_statistics->updateDisplay() ; _global_router_statistics->updateDisplay() ; + + std::cerr << "Selected objects: turtle=" << std::hex << _viewer->network().node(node_id).turtle_service() << ", grouter=" << _viewer->network().node(node_id).global_router_service() << std::dec << std::endl; } void NetworkSimulatorGUI::toggleNetworkTraffic(bool b) @@ -57,7 +59,7 @@ void NetworkSimulatorGUI::timerEvent(QTimerEvent *event) { Q_UNUSED(event) ; - std::cerr << "timer event!" << std::endl; + //std::cerr << "timer event!" << std::endl; _viewer->network().tick() ; diff --git a/libretroshare/src/tests/network_simulator/network_simulator.pro b/libretroshare/src/tests/network_simulator/network_simulator.pro new file mode 100644 index 000000000..8564c70fe --- /dev/null +++ b/libretroshare/src/tests/network_simulator/network_simulator.pro @@ -0,0 +1,2 @@ +TEMPLATE = subdirs +SUBDIRS = nscore gui diff --git a/libretroshare/src/tests/network_simulator/nscore/Network.cpp b/libretroshare/src/tests/network_simulator/nscore/Network.cpp index 003eca98f..83d05827b 100644 --- a/libretroshare/src/tests/network_simulator/nscore/Network.cpp +++ b/libretroshare/src/tests/network_simulator/nscore/Network.cpp @@ -66,7 +66,7 @@ bool Network::initRandom(uint32_t nb_nodes,float connexion_probability) void Network::tick() { - std::cerr<< "network loop: tick()" << std::endl; + //std::cerr<< "network loop: tick()" << std::endl; // Tick all nodes. diff --git a/libretroshare/src/tests/network_simulator/nscore/PeerNode.cpp b/libretroshare/src/tests/network_simulator/nscore/PeerNode.cpp index a2249d5bb..f214ea916 100644 --- a/libretroshare/src/tests/network_simulator/nscore/PeerNode.cpp +++ b/libretroshare/src/tests/network_simulator/nscore/PeerNode.cpp @@ -48,7 +48,7 @@ PeerNode::~PeerNode() void PeerNode::tick() { - std::cerr << " ticking peer node " << _id << std::endl; + //std::cerr << " ticking peer node " << _id << std::endl; _service_server->tick() ; }