Improved packetMonitor draw function

This commit is contained in:
Stefan Kremser
2018-10-14 17:32:16 +02:00
parent 30658583f1
commit ffeae7ca1a
2 changed files with 19 additions and 5 deletions

View File

@@ -731,17 +731,29 @@ void DisplayUI::drawLoadingScan() {
}
void DisplayUI::drawPacketMonitor() {
double scale = scan.getScaleFactor(50);
double scale = scan.getScaleFactor(sreenHeight - lineHeight - 2);
String headline = leftRight(str(D_CH) + getChannel() + String(' ') + String('[') + String(scan.deauths) + String(']'), String(scan.getPacketRate()) + str(D_PKTS), maxLen);
drawString(0, 0, headline);
if (scan.getMaxPacket() > 0) {
for (int i = 0; i < SCAN_PACKET_LIST_SIZE * 2; i += 2) {
drawLine(i, 64, i, 64 - scan.getPackets(i / 2) * scale);
drawLine(i + 1, 64, i + 1, 64 - scan.getPackets(i / 2) * scale);
int i = 0;
int x = 0;
int y = 0;
while(i < SCAN_PACKET_LIST_SIZE && x < screenWidth){
y = (sreenHeight-1) - (scan.getPackets(i) * scale);
i++;
//Serial.printf("%d,%d -> %d,%d\n", x, (sreenHeight-1), x, y);
drawLine(x, (sreenHeight-1), x, y);
x++;
//Serial.printf("%d,%d -> %d,%d\n", x, (sreenHeight-1), x, y);
drawLine(x, (sreenHeight-1), x, y);
x++;
}
//Serial.println("---------");
}
}

View File

@@ -85,6 +85,8 @@ class DisplayUI {
const uint8_t buttonDelay = 250;
const uint8_t drawInterval = 100; // 100ms = 10 FPS
const uint16_t screenIntroTime = 2500;
const uint16_t screenWidth = 128;
const uint16_t sreenHeight = 64;
void configInit();
void configOn();