From 19e74c2ab1726cf3c8467391d717ef25d59b726d Mon Sep 17 00:00:00 2001 From: byun Date: Sat, 4 Oct 2025 17:16:06 +0000 Subject: [PATCH] =?UTF-8?q?count=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 결과 확인해보니 웹페이지의 Real-time CAN messages(by ID) 의 count 작동이 데이터 보내지 않음에도 카운트 되는데 이부분 잘못 된것 같아 can신호가 수집된 갯수를 count 하게 수정해줘, 그리고 logging status, sd card, messages, speed 추가로 현재 로깅되고 있는 파일 명도 추가 해줘 --- index.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/index.h b/index.h index d444905..19a001d 100644 --- a/index.h +++ b/index.h @@ -173,6 +173,10 @@ const char index_html[] PROGMEM = R"rawliteral(

SPEED

0 msg/s
+
+

CURRENT FILE

+
-
+
@@ -266,6 +270,7 @@ const char index_html[] PROGMEM = R"rawliteral( function updateStatus(data) { const loggingCard = document.getElementById('logging-status'); const sdCard = document.getElementById('sd-status'); + const fileCard = document.getElementById('file-status'); if (data.logging) { loggingCard.classList.add('status-on'); @@ -287,6 +292,16 @@ const char index_html[] PROGMEM = R"rawliteral( sdCard.querySelector('.value').textContent = 'NOT READY'; } + // 현재 파일명 표시 + if (data.currentFile && data.currentFile !== '') { + fileCard.classList.add('status-on'); + fileCard.classList.remove('status-off'); + document.getElementById('current-file').textContent = data.currentFile; + } else { + fileCard.classList.remove('status-on', 'status-off'); + document.getElementById('current-file').textContent = '-'; + } + document.getElementById('msg-count').textContent = data.msgCount.toLocaleString(); document.getElementById('msg-speed').textContent = data.msgSpeed + ' msg/s'; } @@ -317,11 +332,12 @@ const char index_html[] PROGMEM = R"rawliteral( messageOrder.push(canId); } + // ESP32에서 받은 실제 count 값 사용 canMessages[canId] = { timestamp: msg.timestamp, dlc: msg.dlc, data: msg.data, - updateCount: (canMessages[canId]?.updateCount || 0) + 1 + updateCount: msg.count // 실제 수신 횟수 }; });