Skip to content

Commit

Permalink
Improve app responsiveness while PID tuning
Browse files Browse the repository at this point in the history
(cherry picked from commit 375c93c0075527207b78acce4d46d440c799ce94)
  • Loading branch information
mathieucarbou committed Jul 15, 2024
1 parent 2cba0c2 commit ed9ab0f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
4 changes: 1 addition & 3 deletions src/tasks/Dashboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,5 @@
Mycila::Task dashboardTask("Dashboard", [](void* params) {
YaSolR::Website.updateCards();
YaSolR::Website.updateCharts();
if (!routingTask.isEnabled() || !config.getBool(KEY_ENABLE_PID_VIEW)) {
dashboard.sendUpdates();
}
dashboard.sendUpdates();
});
3 changes: 0 additions & 3 deletions src/tasks/Router.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,7 @@ Mycila::Task routingTask("Routing", [](void* params) {
router.divert(gridMetrics.voltage, gridMetrics.power);

if (config.getBool(KEY_ENABLE_PID_VIEW)) {
// Dashboard
YaSolR::Website.updatePID();
dashboard.sendUpdates();
// WebSocket
AsyncWebSocketMessageBuffer* buffer = wsDebugPID.makeBuffer(256);
snprintf((char*)buffer->get(), 256, "%d,%d,%d,%d,%d,%.3f,%.3f,%.3f,%d,%d,%.3f,%.3f,%.3f,%.3f,%.3f,%.3f,%.3f", pidController.getProportionalMode(), pidController.getDerivativeMode(), pidController.getIntegralCorrectionMode(), pidController.isReversed(), static_cast<int>(pidController.getSetPoint()), pidController.getKp(), pidController.getKi(), pidController.getKd(), static_cast<int>(pidController.getOutputMin()), static_cast<int>(pidController.getOutputMax()), pidController.getInput(), pidController.getOutput(), pidController.getError(), pidController.getSum(), pidController.getPTerm(), pidController.getITerm(), pidController.getDTerm()); // NOLINT
wsDebugPID.textAll(buffer);
Expand Down

0 comments on commit ed9ab0f

Please sign in to comment.