diff --git a/src/communication/SensythingWiFi.cpp b/src/communication/SensythingWiFi.cpp index 0483442..9dedebb 100644 --- a/src/communication/SensythingWiFi.cpp +++ b/src/communication/SensythingWiFi.cpp @@ -419,10 +419,31 @@ void SensythingWiFi::webSocketEvent(uint8_t num, WStype_t type, uint8_t* payload Serial.println(ip.toString()); clientCount++; - // Send welcome message with board info - String welcome = "{\"type\":\"info\",\"board\":\"" + String(boardConfig.channels[0].label) + - "\",\"channels\":" + String(boardConfig.channelCount) + "}"; + // Determine board type string + String boardType = "UNKNOWN"; + String sampleRateStr = "[100]"; // Default fallback + + if (boardConfig.boardType == BOARD_TYPE_OX) { + boardType = "OX"; + // OX runs at ~125Hz (8ms), offer range from 50-125Hz + sampleRateStr = "[8,10,12,16,20]"; // ms periods + } else if (boardConfig.boardType == BOARD_TYPE_CAP) { + boardType = "CAP"; + // CAP typically 10Hz, offer 2-20Hz range + sampleRateStr = "[50,100,200,500]"; // ms periods + } + + // Send enhanced init message with board detection info + String welcome = "{\"type\":\"init\"," + "\"board\":\"" + boardType + "\"," + "\"boardName\":\"" + String(boardConfig.boardName) + "\"," + "\"channels\":" + String(boardConfig.channelCount) + "," + "\"sampleRates\":" + sampleRateStr + "," + "\"sampleInterval\":" + String(boardConfig.minSampleInterval) + "}"; + pWebSocket->sendTXT(num, welcome); + + Serial.println(String(EMOJI_INFO) + " Sent board info: " + boardType); } break; @@ -908,6 +929,108 @@ String SensythingWiFi::generateDashboardHTML() { color: #666; font-size: 12px; } + + /* ===== OX BOARD SPECIFIC STYLES ===== */ + + /* OX Vitals Container */ + .ox-vitals-container { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); + gap: 16px; + margin-bottom: 20px; + } + + /* OX Vital Card - Large and Prominent */ + .ox-vital-card { + padding: 20px; + background: white; + border: 2px solid #e0e0e0; + border-radius: 12px; + text-align: center; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + min-height: 180px; + box-shadow: 0 2px 8px rgba(0,0,0,0.08); + transition: all 0.3s; + } + + .ox-vital-card:hover { + box-shadow: 0 4px 12px rgba(0,0,0,0.12); + } + + .ox-vital-value { + font-size: 48px; + font-weight: bold; + color: #333; + line-height: 1; + margin: 12px 0; + } + + .ox-vital-unit { + font-size: 18px; + color: #999; + font-weight: 500; + } + + .ox-vital-status { + padding: 6px 12px; + border-radius: 20px; + font-weight: 600; + display: inline-block; + font-size: 12px; + margin-top: 8px; + } + + .ox-status-normal { + background: #d4edda; + color: #155724; + } + + .ox-status-warning { + background: #fff3cd; + color: #856404; + } + + .ox-status-critical { + background: #f8d7da; + color: #721c24; + } + + /* OX PPG Section */ + .ox-ppg-section { + margin-bottom: 20px; + padding: 16px; + background: #f9f9f9; + border-radius: 8px; + border: 1px solid #e0e0e0; + } + + .ox-ppg-chart { + height: 250px !important; + } + + /* CAP Grid Adjustment */ + .cap-grid { + grid-template-columns: repeat(4, 1fr); + } + + @media (max-width: 1200px) { + .cap-grid { + grid-template-columns: repeat(2, 1fr); + } + } + + @media (max-width: 768px) { + .cap-grid { + grid-template-columns: 1fr; + } + + .ox-vitals-container { + grid-template-columns: 1fr; + } + }
@@ -1049,9 +1172,45 @@ String SensythingWiFi::generateDashboardHTML() { + + +