| 1890 | } |
| 1891 | |
| 1892 | void MainWindow::refreshTimerTimeout() |
| 1893 | { |
| 1894 | |
| 1895 | QDateTime now = QDateTime::currentDateTime(); |
| 1896 | |
| 1897 | for (int i = 0; i < packetsRepeat.size() && !stopResending; i++) { |
| 1898 | |
| 1899 | int repeatMS = (int)(packetsRepeat[i].repeat * 1000 - 100); |
| 1900 | |
| 1901 | if (packetsRepeat[i].timestamp.addMSecs(repeatMS) < now) { |
| 1902 | packetsRepeat[i].timestamp = now; |
| 1903 | |
| 1904 | if (((resendCounter + 1) < cancelResendNum) || (cancelResendNum == 0)) { |
| 1905 | |
| 1906 | emit sendPacket(packetsRepeat[i]); |
| 1907 | statusBarMessage("Send: " + packetsRepeat[i].name + " (Resend)"); |
| 1908 | resendCounter++; |
| 1909 | |
| 1910 | } else { |
| 1911 | stopResending = 1; |
| 1912 | } |
| 1913 | |
| 1914 | } |
| 1915 | } |
| 1916 | |
| 1917 | |
| 1918 | if (packetsRepeat.isEmpty() || stopResending) { |
| 1919 | stopResendingButton->hide(); |
| 1920 | packetsRepeat.clear(); |
| 1921 | stopResending = 0; |
| 1922 | resendCounter = 0; |
| 1923 | |
| 1924 | } else { |
| 1925 | stopResendingButton->show(); |
| 1926 | } |
| 1927 | |
| 1928 | |
| 1929 | while (maxLogSize > 0 && packetsLogged.size() > maxLogSize) { |
| 1930 | packetsLogged.removeLast(); |
| 1931 | } |
| 1932 | |
| 1933 | |
| 1934 | //ui->mainTabWidget->setTabText(1,"Traffic Log (" + QString::number(packetsLogged.size()) +")"); |
| 1935 | |
| 1936 | //got nothing else to do. check datagrams. |
| 1937 | packetNetwork.readPendingDatagrams(); |
| 1938 | |
| 1939 | |
| 1940 | } |
| 1941 | |
| 1942 | void MainWindow::on_trafficLogClearButton_clicked() |
| 1943 | { |
nothing calls this directly
no test coverage detected