Changeset 399 in flair-src for trunk/tools/FlairGCS
- Timestamp:
- Mar 16, 2021, 5:50:25 PM (4 years ago)
- Location:
- trunk/tools/FlairGCS/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/FlairGCS/src/ConnectionLayout.h
r269 r399 36 36 37 37 signals: 38 void UDTStats(QString stats, bool loosingPackets);38 void UDTStats(QString stats,QString stylesheet,bool loosingPackets); 39 39 }; 40 40 -
trunk/tools/FlairGCS/src/Manager.cpp
r269 r399 73 73 status=new QStatusBar(); 74 74 status->setSizeGripEnabled(false); 75 button_layout->addWidget(status, 1,0);75 managerLayout->addWidget(status); 76 76 77 77 UDT::startup(); … … 100 100 icon_red = QIcon(":red.png"); 101 101 icon_orange = QIcon(":orange.png"); 102 103 102 104 103 QTimer *timer = new QTimer(this); … … 149 148 150 149 ConnectionLayout *newLayout = new ConnectionLayout(udtSocket, name); 151 connect(udtSocket, SIGNAL(UDTStats(QString, bool)), newLayout, SIGNAL(UDTStats(QString,bool)));//connection in 2 steps to get udtsocket as sender152 connect(newLayout, SIGNAL(UDTStats(QString, bool)), this, SLOT(printUDTStats(QString,bool)));150 connect(udtSocket, SIGNAL(UDTStats(QString,QString,bool)), newLayout, SIGNAL(UDTStats(QString,QString,bool)));//connection in 2 steps to get udtsocket as sender 151 connect(newLayout, SIGNAL(UDTStats(QString,QString,bool)), this, SLOT(printUDTStats(QString,QString,bool))); 153 152 connect(udtSocket, SIGNAL(dataReady(char *, int)), newLayout,SLOT(receive(char *, int)),Qt::BlockingQueuedConnection); 154 153 connect(newLayout, SIGNAL(destroyed(QObject *)), this, SLOT(layoutDestroyed(QObject *))); … … 246 245 } 247 246 248 void Manager::printUDTStats(QString stats, bool loosingPackets) {247 void Manager::printUDTStats(QString stats,QString stylesheet,bool loosingPackets) { 249 248 int index = -1; 250 249 for(int i=0;i<connections.count();i++) { … … 264 263 265 264 if (tabBar->count() == 0) { 265 status->setStyleSheet(stylesheet); 266 266 status->showMessage(stats); 267 267 } else if (index==tabBar->currentIndex()) { 268 status->setStyleSheet(stylesheet); 268 269 status->showMessage(QString("%1: %2").arg(tabBar->tabText(index)).arg(stats)); 269 270 } -
trunk/tools/FlairGCS/src/Manager.h
r248 r399 56 56 void reset(void); 57 57 void tabBarCurrentChanged(int index); 58 void printUDTStats(QString stats, bool loosingPackets);58 void printUDTStats(QString stats,QString stylesheet,bool loosingPackets); 59 59 void newFileUI(UDTSOCKET socket); 60 60 void deleteFileUI(void); -
trunk/tools/FlairGCS/src/UdtSocket.cpp
r307 r399 15 15 #include <assert.h> 16 16 #include <QThread> 17 17 18 #define COMPRESS_CHUNK 1024*100 18 19 … … 37 38 total_received=0; 38 39 pktSndLossTotal=0; 39 40 lastpktRecvTotal=0; 41 40 42 bool blocking = false; 41 43 if (UDT::setsockopt(socket, 0, UDT_RCVSYN, &blocking, sizeof(bool)) != 0) … … 94 96 fprintf(stderr,"total number of received NAK packets: %i\n",perf.pktRecvNAKTotal); 95 97 fprintf(stderr,"round trip time: %fms\n",perf.msRTT); 96 97 98 }*/ 98 99 bool loosingPackets=false; 99 100 if(perf.pktSndLossTotal>pktSndLossTotal) loosingPackets=true; 100 101 pktSndLossTotal=perf.pktSndLossTotal; 101 stats=QString("rx rate %1kB/s, round trip %2ms, lost packets %3").arg(rxRate,0,'f',3).arg(perf.msRTT,0,'f',3).arg(perf.pktSndLossTotal); 102 UDTStats(stats,loosingPackets); 102 unsigned int pktPerSec=(perf.pktRecvTotal-lastpktRecvTotal)*1000/COMPUTE_UDT_STATS_TIMER; 103 QString stylesheet="color: black"; 104 if(pktPerSec>=100) { 105 stylesheet="color: red"; 106 } 107 else if(pktPerSec>=50) { 108 stylesheet="color: orange"; 109 } 110 stats=QString("rx rate %1kB/s, %2 rx packets/s, round trip %3ms, lost packets %4").arg(rxRate,0,'f',3).arg(pktPerSec).arg(perf.msRTT,0,'f',3).arg(perf.pktSndLossTotal); 111 lastpktRecvTotal=perf.pktRecvTotal; 112 UDTStats(stats,stylesheet,loosingPackets); 103 113 } 104 114 -
trunk/tools/FlairGCS/src/UdtSocket.h
r248 r399 31 31 unsigned int total_received; 32 32 QString stats; 33 int pktSndLossTotal; 33 unsigned int pktSndLossTotal; 34 unsigned int lastpktRecvTotal; 35 34 36 35 37 signals: … … 37 39 void newFileUI(UDTSOCKET socket); 38 40 void newConnectionLayout(QString name); 39 void UDTStats(QString stats, bool loosingPackets);41 void UDTStats(QString stats,QString stylesheet,bool loosingPackets); 40 42 41 43 public slots:
Note:
See TracChangeset
for help on using the changeset viewer.