Skip to content

Commit

Permalink
Fix compilation
Browse files Browse the repository at this point in the history
(cherry picked from commit 03af77ec887b9eeb5da674693b7498ac97a407bd)
  • Loading branch information
mathieucarbou committed Jul 5, 2024
1 parent 977569d commit d1a2bae
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions src/Website.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ void YaSolR::WebsiteClass::initLayout() {
_routedPowerHistory.updateX(_historyX, YASOLR_GRAPH_POINTS);
_routerTHDiHistory.updateX(_historyX, YASOLR_GRAPH_POINTS);

#ifdef APP_MODEL_PRO
dashboard.setChartAnimations(false);

// overview graphs
_gridPowerHistory.setSize(chartSize);
_routedPowerHistory.setSize(chartSize);
_routerTHDiHistory.setSize(chartSize);

// PID
_pidInputHistory.updateX(_historyX, YASOLR_GRAPH_POINTS);
_pidOutputHistory.updateX(_historyX, YASOLR_GRAPH_POINTS);
Expand All @@ -30,15 +38,6 @@ void YaSolR::WebsiteClass::initLayout() {
_pidDTermHistory.updateX(_historyX, YASOLR_GRAPH_POINTS);
_pidSumHistory.updateX(_historyX, YASOLR_GRAPH_POINTS);

#ifdef APP_MODEL_PRO
dashboard.setChartAnimations(false);

// overview graphs
_gridPowerHistory.setSize(chartSize);
_routedPowerHistory.setSize(chartSize);
_routerTHDiHistory.setSize(chartSize);

// pid graphs
_pidInputHistory.setSize(chartSize);
_pidOutputHistory.setSize(chartSize);
_pidPTermHistory.setSize(chartSize);
Expand Down Expand Up @@ -786,6 +785,7 @@ void YaSolR::WebsiteClass::updateCharts() {
}

void YaSolR::WebsiteClass::updatePID() {
#ifdef APP_MODEL_PRO
// shift array
constexpr size_t shift = sizeof(_pidInputHistoryY) - sizeof(*_pidInputHistoryY);
memmove(&_pidInputHistoryY[0], &_pidInputHistoryY[1], shift);
Expand Down Expand Up @@ -813,16 +813,19 @@ void YaSolR::WebsiteClass::updatePID() {
_pidPTermHistory.updateY(_pidPTermHistoryY, YASOLR_GRAPH_POINTS);
_pidITermHistory.updateY(_pidITermHistoryY, YASOLR_GRAPH_POINTS);
_pidDTermHistory.updateY(_pidDTermHistoryY, YASOLR_GRAPH_POINTS);
#endif
}

void YaSolR::WebsiteClass::resetPID() {
#ifdef APP_MODEL_PRO
memset(_pidOutputHistoryY, 0, sizeof(_pidOutputHistoryY));
memset(_pidInputHistoryY, 0, sizeof(_pidInputHistoryY));
memset(_pidErrorHistoryY, 0, sizeof(_pidErrorHistoryY));
memset(_pidSumHistoryY, 0, sizeof(_pidSumHistoryY));
memset(_pidPTermHistoryY, 0, sizeof(_pidPTermHistoryY));
memset(_pidITermHistoryY, 0, sizeof(_pidITermHistoryY));
memset(_pidDTermHistoryY, 0, sizeof(_pidDTermHistoryY));
#endif
}

void YaSolR::WebsiteClass::_sliderConfig(Card& card, const char* key) {
Expand Down

0 comments on commit d1a2bae

Please sign in to comment.