count수정

결과 확인해보니 웹페이지의 Real-time CAN messages(by ID) 의 count 작동이 데이터 보내지 않음에도 카운트 되는데 이부분 잘못 된것 같아 can신호가 수집된 갯수를 count 하게 수정해줘, 그리고 logging status, sd card, messages, speed  추가로 현재 로깅되고 있는 파일 명도 추가 해줘
This commit is contained in:
2025-10-04 17:16:06 +00:00
parent 8a5d7fa925
commit 19e74c2ab1

18
index.h
View File

@@ -173,6 +173,10 @@ const char index_html[] PROGMEM = R"rawliteral(
<h3>SPEED</h3>
<div class="value" id="msg-speed">0 msg/s</div>
</div>
<div class="status-card" id="file-status" style="grid-column: span 2;">
<h3>CURRENT FILE</h3>
<div class="value" id="current-file" style="font-size: 1.3em;">-</div>
</div>
</div>
<div class="control-panel">
@@ -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 // 실제 수신 횟수
};
});