Add raw voltage, control state, and calibration streaming to REST API#13
Add raw voltage, control state, and calibration streaming to REST API#13
Conversation
Co-authored-by: takker99 <37929109+takker99@users.noreply.github.com>
Co-authored-by: takker99 <37929109+takker99@users.noreply.github.com>
Co-authored-by: takker99 <37929109+takker99@users.noreply.github.com>
Co-authored-by: takker99 <37929109+takker99@users.noreply.github.com>
Co-authored-by: takker99 <37929109+takker99@users.noreply.github.com>
|
@copilot CIがビルドエラー吐いてる。修正して。 cf. エラーの概要と修正案:
These errors occur in the calibration_to_json() function (lines 510–533) where these identifiers are referenced with the using namespace variables; directive. This indicates that variables.hpp, which should define these constants and arrays, is either not included or not exposing the required identifiers in this translation unit. Solution:
Example fix: #include "Variables.hpp"And verify Variables.hpp and Variables.cpp provide the needed variables with extern linkage if appropriate. Summary: |
Co-authored-by: takker99 <37929109+takker99@users.noreply.github.com>
REST API Enhancements - Implementation Complete ✅
All Backend Features Implemented
This PR successfully implements all 4 backend features from the GitHub issue "REST APIまわりで実装したいこと":
Build Fix (Latest Commit)
#include "Variables.hpp"toApiServer.cppMAX_AI_CHANNELS,Cal_a,Cal_b,Cal_c,MAX_DA_CHANNELS,DA_Cal_a,DA_Cal_bSummary Statistics
Key Files
Implementation
src/ApiServer.hpp/cpp- Core API functionality (✅ build fix applied)src/DigitShowDSTDoc.h/cpp- Integration pointssrc/Calibration*.cpp/h- Notification hookssrc/openapi_spec.hpp- API documentationDocumentation
knowledge/REST_API_ENHANCEMENTS.md- User guide (Japanese)TESTING_NEW_API_FEATURES.md- Test procedures (English)IMPLEMENTATION_SUMMARY.md- Technical summaryAPI Changes
New Data in Existing Endpoints
{ "timestamp": 1704153600000, "physical_input": {...}, "physical_output": {...}, "raw_voltages": { "ad_channels": [{"channel": 0, "voltage": 2.543}, ...], "da_channels": [{"channel": 0, "voltage": 5.012}, ...] }, "control_state": { "current_step": 3, "is_running": true, "elapsed_ms": 15234 } }New Endpoint
GET /api/calibration- Returns calibration coefficientsNew SSE Event
event: calibration- Emitted on calibration changesTesting
Environment Required: Windows + Visual Studio 2022
Test Guide: See
TESTING_NEW_API_FEATURES.mdfor:Key Test: Calibration change notifications (most critical new feature)
Technical Highlights
Benefits
For Backend:
For Frontend:
For Research:
Ready for Testing
All code is complete and documented. Next steps:
TESTING_NEW_API_FEATURES.mdImplementation Status: COMPLETE ✅
Build Status: FIXED ✅
Testing Status: PENDING (Windows required) ⏳
Documentation: COMPLETE ✅
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.