version 3.21.0
add PISystemTime overload for thread/timer/io classes
This commit is contained in:
@@ -38,24 +38,11 @@
|
||||
|
||||
|
||||
PIDiagnostics::State::State() {
|
||||
immediate_freq = integral_freq = 0.f;
|
||||
received_packets_per_sec = 0ull;
|
||||
received_packets = 0ull;
|
||||
received_packets_wrong = 0ull;
|
||||
received_bytes_per_sec = 0ull;
|
||||
received_bytes = 0ull;
|
||||
received_bytes_wrong = 0ull;
|
||||
sended_packets_per_sec = 0ull;
|
||||
sended_packets = 0ull;
|
||||
sended_bytes_per_sec = 0ull;
|
||||
sended_bytes = 0ull;
|
||||
receive_speed = send_speed = PIString::readableSize(0) + "/s";
|
||||
quality = PIDiagnostics::Unknown;
|
||||
}
|
||||
|
||||
|
||||
PIDiagnostics::PIDiagnostics(bool start_): PITimer(/*PITimer::Pool*/) {
|
||||
disconn_ = 0.;
|
||||
// piCout << "PIDiagnostics construct";
|
||||
setInterval(100);
|
||||
reset();
|
||||
@@ -104,6 +91,20 @@ PIString PIDiagnostics::sendSpeed() const {
|
||||
}
|
||||
|
||||
|
||||
void PIDiagnostics::start() {
|
||||
PITimer::start(100.);
|
||||
changeDisconnectTimeout(disconn_);
|
||||
}
|
||||
|
||||
|
||||
void PIDiagnostics::start(double msecs) {
|
||||
if (msecs > 0.) {
|
||||
PITimer::start(msecs);
|
||||
changeDisconnectTimeout(disconn_);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void PIDiagnostics::reset() {
|
||||
mutex_state.lock();
|
||||
cur_state = State();
|
||||
|
||||
Reference in New Issue
Block a user