diff --git a/src/io/pidiagnostics.cpp b/src/io/pidiagnostics.cpp index 40766e4c..8c690ba3 100755 --- a/src/io/pidiagnostics.cpp +++ b/src/io/pidiagnostics.cpp @@ -66,7 +66,7 @@ void PIDiagnostics::reset() { void PIDiagnostics::received(int size, bool correct) { lock(); - Entry & e(history_send.front()); + Entry & e(history_rec.front()); if (correct) { e.cnt_ok++; e.bytes_ok += size; @@ -95,7 +95,7 @@ void PIDiagnostics::sended(int size) { } -void PIDiagnostics::tick(void * data, int delimiter) { +void PIDiagnostics::tick(void * , int ) { lock(); int tcnt_recv = 0; int tcnt_send = 0; @@ -109,10 +109,10 @@ void PIDiagnostics::tick(void * data, int delimiter) { packets_send_sec = ullong(float(send.cnt_ok) / its); bytes_recv_sec = ullong(double(recv.bytes_ok) / itr); bytes_send_sec = ullong(double(send.bytes_ok) / its); - immediate_freq = double(history_rec.back().cnt_ok) / hz; -// piCoutObj << disconn_ << interval() << history_send.size() << tcnt_send << count_send << send.cnt_ok; -// speedRecv = PIString::readableSize(ullong(double(history_rec.back().bytes_ok) / hz)) + "/s"; -// speedSend = PIString::readableSize(ullong(double(history_send.back().bytes_ok) / hz)) + "/s"; + immediate_freq = double(history_rec.front().cnt_ok) / hz; + piCoutObj << "tick" << recv.cnt_ok << send.cnt_ok; +// speedRecv = PIString::readableSize(ullong(double(history_rec.front().bytes_ok) / hz)) + "/s"; +// speedSend = PIString::readableSize(ullong(double(history_send.front().bytes_ok) / hz)) + "/s"; speedRecv = PIString::readableSize(bytes_recv_sec) + "/s"; speedSend = PIString::readableSize(bytes_send_sec) + "/s"; int arc = recv.cnt_ok + recv.cnt_fail; @@ -156,7 +156,7 @@ PIDiagnostics::Entry PIDiagnostics::calcHistory(PIQueue & hist, int & cnt if (!hist[i].empty) cnt++; } e.empty = false; - //piCoutObj << hist.size() << cnt; + piCoutObj << hist.size() << cnt; return e; } diff --git a/src/io/pidiagnostics.h b/src/io/pidiagnostics.h index 8e4d161a..2acf8f49 100755 --- a/src/io/pidiagnostics.h +++ b/src/io/pidiagnostics.h @@ -189,14 +189,14 @@ private: bool empty; }; - void tick(void * data, int delimiter); + void tick(void *, int); Entry calcHistory(PIQueue & hist, int & cnt); void propertyChanged(const PIString &); void changeDisconnectTimeout(float disct); PIDiagnostics::Quality qual; PIString speedRecv, speedSend; - float ifreq, immediate_freq, integral_freq; + float immediate_freq, integral_freq; PIQueue history_rec, history_send; float disconn_; ullong count_wrong, count_recv, count_send, bytes_wrong, bytes_recv, bytes_send;