Changeset 30 in flair-src for trunk/tools/FlairGCS/src/ConnectionLayout.cpp
- Timestamp:
- 06/21/16 15:48:18 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/FlairGCS/src/ConnectionLayout.cpp
r15 r30 12 12 13 13 #define COMPRESS_CHUNK 1024 14 #define RX_TIME 5000 14 15 15 16 ConnectionLayout::ConnectionLayout(UdtSocket *socket, QString name) … … 17 18 isRemoteNameDefined = false; 18 19 this->socket = socket; 20 21 total_received=0; 22 receive_timer = new QTimer(this); 23 connect(receive_timer, SIGNAL(timeout()), this, SLOT(computeRxRate())); 24 receive_timer->start(RX_TIME); 19 25 } 20 26 21 ConnectionLayout::~ConnectionLayout() {} 27 ConnectionLayout::~ConnectionLayout() { 28 receive_timer->stop(); 29 } 30 31 void ConnectionLayout::computeRxRate(void) { 32 float receive_rate=((float)total_received/(RX_TIME/1000))/1000;//in Ko/s 33 total_received=0; 34 computedRxRate(receive_rate); 35 } 22 36 23 37 void ConnectionLayout::receive(char *buf, int size) { 38 total_received+=size-1; 24 39 // printf("trame %x\n",buf[0]); 25 40 // for(int i=0; i<size;i++) printf("%x ",buf[i]);
Note:
See TracChangeset
for help on using the changeset viewer.