Index: trunk/tools/FlairGCS/src/ConnectionLayout.h
===================================================================
--- trunk/tools/FlairGCS/src/ConnectionLayout.h	(revision 368)
+++ trunk/tools/FlairGCS/src/ConnectionLayout.h	(revision 399)
@@ -36,5 +36,5 @@
 
 signals:
-  void UDTStats(QString stats,bool loosingPackets);  
+  void UDTStats(QString stats,QString stylesheet,bool loosingPackets);  
 };
 
Index: trunk/tools/FlairGCS/src/Manager.cpp
===================================================================
--- trunk/tools/FlairGCS/src/Manager.cpp	(revision 368)
+++ trunk/tools/FlairGCS/src/Manager.cpp	(revision 399)
@@ -73,5 +73,5 @@
   status=new QStatusBar();
   status->setSizeGripEnabled(false);
-  button_layout->addWidget(status, 1,0);
+  managerLayout->addWidget(status);
 
   UDT::startup();
@@ -100,5 +100,4 @@
   icon_red = QIcon(":red.png");
   icon_orange = QIcon(":orange.png");
-  
   
   QTimer *timer = new QTimer(this);
@@ -149,6 +148,6 @@
   
   ConnectionLayout *newLayout = new ConnectionLayout(udtSocket, name);
-  connect(udtSocket, SIGNAL(UDTStats(QString,bool)), newLayout, SIGNAL(UDTStats(QString,bool)));//connection in 2 steps to get udtsocket as sender
-  connect(newLayout, SIGNAL(UDTStats(QString,bool)), this, SLOT(printUDTStats(QString,bool)));
+  connect(udtSocket, SIGNAL(UDTStats(QString,QString,bool)), newLayout, SIGNAL(UDTStats(QString,QString,bool)));//connection in 2 steps to get udtsocket as sender
+  connect(newLayout, SIGNAL(UDTStats(QString,QString,bool)), this, SLOT(printUDTStats(QString,QString,bool)));
   connect(udtSocket, SIGNAL(dataReady(char *, int)), newLayout,SLOT(receive(char *, int)),Qt::BlockingQueuedConnection);
   connect(newLayout, SIGNAL(destroyed(QObject *)), this, SLOT(layoutDestroyed(QObject *)));
@@ -246,5 +245,5 @@
 }
 
-void Manager::printUDTStats(QString stats,bool loosingPackets) {
+void Manager::printUDTStats(QString stats,QString stylesheet,bool loosingPackets) {
   int index = -1;
   for(int i=0;i<connections.count();i++) {
@@ -264,6 +263,8 @@
   
   if (tabBar->count() == 0) {
+    status->setStyleSheet(stylesheet);
     status->showMessage(stats);
   } else if (index==tabBar->currentIndex()) {
+    status->setStyleSheet(stylesheet);
     status->showMessage(QString("%1: %2").arg(tabBar->tabText(index)).arg(stats));
   }
Index: trunk/tools/FlairGCS/src/Manager.h
===================================================================
--- trunk/tools/FlairGCS/src/Manager.h	(revision 368)
+++ trunk/tools/FlairGCS/src/Manager.h	(revision 399)
@@ -56,5 +56,5 @@
   void reset(void);
   void tabBarCurrentChanged(int index);
-  void printUDTStats(QString stats,bool loosingPackets);
+  void printUDTStats(QString stats,QString stylesheet,bool loosingPackets);
   void newFileUI(UDTSOCKET socket);
   void deleteFileUI(void);
Index: trunk/tools/FlairGCS/src/UdtSocket.cpp
===================================================================
--- trunk/tools/FlairGCS/src/UdtSocket.cpp	(revision 368)
+++ trunk/tools/FlairGCS/src/UdtSocket.cpp	(revision 399)
@@ -15,4 +15,5 @@
 #include <assert.h>
 #include <QThread>
+
 #define COMPRESS_CHUNK 1024*100
 
@@ -37,5 +38,6 @@
   total_received=0;
   pktSndLossTotal=0;
- 
+  lastpktRecvTotal=0;
+  
   bool blocking = false;
   if (UDT::setsockopt(socket, 0, UDT_RCVSYN, &blocking, sizeof(bool)) != 0)
@@ -94,11 +96,19 @@
     fprintf(stderr,"total number of received NAK packets: %i\n",perf.pktRecvNAKTotal);
     fprintf(stderr,"round trip time: %fms\n",perf.msRTT);
-      
   }*/
   bool loosingPackets=false;
   if(perf.pktSndLossTotal>pktSndLossTotal) loosingPackets=true;
   pktSndLossTotal=perf.pktSndLossTotal;
-  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);
-  UDTStats(stats,loosingPackets);
+  unsigned int pktPerSec=(perf.pktRecvTotal-lastpktRecvTotal)*1000/COMPUTE_UDT_STATS_TIMER;
+  QString stylesheet="color: black";
+  if(pktPerSec>=100) {
+    stylesheet="color: red";
+  }
+  else if(pktPerSec>=50) {
+    stylesheet="color: orange";
+  }
+  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);
+  lastpktRecvTotal=perf.pktRecvTotal;
+  UDTStats(stats,stylesheet,loosingPackets);
 }
 
Index: trunk/tools/FlairGCS/src/UdtSocket.h
===================================================================
--- trunk/tools/FlairGCS/src/UdtSocket.h	(revision 368)
+++ trunk/tools/FlairGCS/src/UdtSocket.h	(revision 399)
@@ -31,5 +31,7 @@
   unsigned int total_received;
   QString stats;
-  int pktSndLossTotal;
+  unsigned int pktSndLossTotal;
+  unsigned int lastpktRecvTotal;
+ 
 
 signals:
@@ -37,5 +39,5 @@
   void newFileUI(UDTSOCKET socket);
   void newConnectionLayout(QString name);
-  void UDTStats(QString stats,bool loosingPackets);
+  void UDTStats(QString stats,QString stylesheet,bool loosingPackets);
 
 public slots:
