mirror of
https://github.com/sudoxnym/open-hyperion.git
synced 2026-07-13 15:38:36 +00:00
Receive counter works
This commit is contained in:
parent
14f7657ddf
commit
f651f96af4
1 changed files with 13 additions and 0 deletions
|
|
@ -133,6 +133,12 @@ void OpenRGBE131ReceiverDialog::E131ReceiverThreadFunction()
|
||||||
e131_packet_t packet;
|
e131_packet_t packet;
|
||||||
e131_error_t error;
|
e131_error_t error;
|
||||||
uint8_t last_seq = 0x00;
|
uint8_t last_seq = 0x00;
|
||||||
|
std::chrono::time_point<std::chrono::steady_clock> last_update_time;
|
||||||
|
|
||||||
|
/*-----------------------------------------------------*\
|
||||||
|
| Initialize update time |
|
||||||
|
\*-----------------------------------------------------*/
|
||||||
|
last_update_time = std::chrono::steady_clock::now();
|
||||||
|
|
||||||
/*-----------------------------------------------------*\
|
/*-----------------------------------------------------*\
|
||||||
| Clear online status |
|
| Clear online status |
|
||||||
|
|
@ -205,6 +211,13 @@ void OpenRGBE131ReceiverDialog::E131ReceiverThreadFunction()
|
||||||
|
|
||||||
received_count++;
|
received_count++;
|
||||||
|
|
||||||
|
if((std::chrono::steady_clock::now() - last_update_time) > std::chrono::milliseconds(500))
|
||||||
|
{
|
||||||
|
ui->PacketsReceivedValue->setText(QString::number(received_count));
|
||||||
|
|
||||||
|
last_update_time = std::chrono::steady_clock::now();
|
||||||
|
}
|
||||||
|
|
||||||
last_seq = packet.frame.seq_number;
|
last_seq = packet.frame.seq_number;
|
||||||
|
|
||||||
/*-------------------------------------------------*\
|
/*-------------------------------------------------*\
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue