mirror of
https://github.com/lumapu/ahoy.git
synced 2025-07-27 13:17:11 +02:00
Merge branch 'feature/PR_display' of https://github.com/You69Man/ahoy into You69Man-feature/PR_display
This commit is contained in:
commit
7934e26911
3 changed files with 13 additions and 6 deletions
|
@ -119,7 +119,7 @@ class DisplayMono {
|
||||||
case DispSwitchState::TEXT:
|
case DispSwitchState::TEXT:
|
||||||
if (mDispSwitchTime.isTimeout()) {
|
if (mDispSwitchTime.isTimeout()) {
|
||||||
mDispSwitchState = DispSwitchState::GRAPH;
|
mDispSwitchState = DispSwitchState::GRAPH;
|
||||||
mDispSwitchTime.startTimeMonitor(150 * mCfg->graph_ratio); // mGraphRatio: 0-100 Gesamtperiode 15000 ms
|
mDispSwitchTime.startTimeMonitor(150 * mCfg->graph_ratio); // graph_ratio: 0-100 Gesamtperiode 15000 ms
|
||||||
change = true;
|
change = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -135,6 +135,7 @@ class DisplayMono {
|
||||||
}
|
}
|
||||||
|
|
||||||
void initPowerGraph(uint8_t width, uint8_t height) {
|
void initPowerGraph(uint8_t width, uint8_t height) {
|
||||||
|
DBGPRINTLN("---- Init Power Graph ----");
|
||||||
mPgWidth = width;
|
mPgWidth = width;
|
||||||
mPgHeight = height;
|
mPgHeight = height;
|
||||||
mPgData = new float[mPgWidth];
|
mPgData = new float[mPgWidth];
|
||||||
|
@ -205,6 +206,10 @@ class DisplayMono {
|
||||||
mDisplay->drawLine(xoff, yoff, xoff, yoff - mPgHeight); // vertical axis
|
mDisplay->drawLine(xoff, yoff, xoff, yoff - mPgHeight); // vertical axis
|
||||||
mDisplay->drawLine(xoff, yoff, xoff + mPgWidth, yoff); // horizontal axis
|
mDisplay->drawLine(xoff, yoff, xoff + mPgWidth, yoff); // horizontal axis
|
||||||
|
|
||||||
|
// do not draw as long as time is not set correctly and no data was received
|
||||||
|
if ((mDisplayData->pGraphStartTime == 0) || (mDisplayData->pGraphEndTime == 0) || (mDisplayData->utcTs < 1) || (mPgMaxPwr < 1) || (mPgLastPos < 1))
|
||||||
|
return;
|
||||||
|
|
||||||
// draw X scale
|
// draw X scale
|
||||||
tmElements_t tm;
|
tmElements_t tm;
|
||||||
breakTime(mDisplayData->pGraphEndTime, tm);
|
breakTime(mDisplayData->pGraphEndTime, tm);
|
||||||
|
@ -234,7 +239,7 @@ class DisplayMono {
|
||||||
// draw curve
|
// draw curve
|
||||||
for (uint8_t i = 1; i <= mPgLastPos; i++) {
|
for (uint8_t i = 1; i <= mPgLastPos; i++) {
|
||||||
mDisplay->drawLine(xoff + getPowerGraphXpos(i - 1), yoff - getPowerGraphYpos(i - 1),
|
mDisplay->drawLine(xoff + getPowerGraphXpos(i - 1), yoff - getPowerGraphYpos(i - 1),
|
||||||
xoff + getPowerGraphXpos(i), yoff - getPowerGraphYpos(i));
|
xoff + getPowerGraphXpos(i), yoff - getPowerGraphYpos(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
// print max power value
|
// print max power value
|
||||||
|
|
|
@ -58,7 +58,8 @@ class DisplayMono128X64 : public DisplayMono {
|
||||||
|
|
||||||
widthShrink = (mCfg->screenSaver == 1) ? pixelShiftRange : 0; // shrink graphwidth for pixelshift screensaver
|
widthShrink = (mCfg->screenSaver == 1) ? pixelShiftRange : 0; // shrink graphwidth for pixelshift screensaver
|
||||||
|
|
||||||
initPowerGraph(mDispWidth - 22 - widthShrink, mLineYOffsets[graph_last_line] - mLineYOffsets[graph_first_line - 1] - 2);
|
if (mCfg->graph_ratio > 0)
|
||||||
|
initPowerGraph(mDispWidth - 22 - widthShrink, mLineYOffsets[graph_last_line] - mLineYOffsets[graph_first_line - 1] - 2);
|
||||||
|
|
||||||
printText("Ahoy!", l_Ahoy, 0xff);
|
printText("Ahoy!", l_Ahoy, 0xff);
|
||||||
printText("ahoydtu.de", l_Website, 0xff);
|
printText("ahoydtu.de", l_Website, 0xff);
|
||||||
|
@ -172,7 +173,7 @@ class DisplayMono128X64 : public DisplayMono {
|
||||||
printText(mFmtText, l_YieldTotal, 0xff);
|
printText(mFmtText, l_YieldTotal, 0xff);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mDispSwitchState == DispSwitchState::GRAPH) {
|
if ((mCfg->graph_ratio > 0) && (mDispSwitchState == DispSwitchState::GRAPH)) {
|
||||||
// plot power graph
|
// plot power graph
|
||||||
plotPowerGraph((mDispWidth - mPgWidth) / 2 + mPixelshift, mLineYOffsets[graph_last_line] - 1);
|
plotPowerGraph((mDispWidth - mPgWidth) / 2 + mPixelshift, mLineYOffsets[graph_last_line] - 1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,7 +46,8 @@ class DisplayMono84X48 : public DisplayMono {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
initPowerGraph(mDispWidth - 16, mLineYOffsets[graph_last_line] - mLineYOffsets[graph_first_line - 1] - 2);
|
if (mCfg->graph_ratio > 0)
|
||||||
|
initPowerGraph(mDispWidth - 16, mLineYOffsets[graph_last_line] - mLineYOffsets[graph_first_line - 1] - 2);
|
||||||
|
|
||||||
printText("Ahoy!", l_Ahoy, 0xff);
|
printText("Ahoy!", l_Ahoy, 0xff);
|
||||||
printText("ahoydtu.de", l_Website, 0xff);
|
printText("ahoydtu.de", l_Website, 0xff);
|
||||||
|
@ -134,7 +135,7 @@ class DisplayMono84X48 : public DisplayMono {
|
||||||
printText(mFmtText, l_YieldTotal, 0xff);
|
printText(mFmtText, l_YieldTotal, 0xff);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mDispSwitchState == DispSwitchState::GRAPH) {
|
if ((mCfg->graph_ratio > 0) && (mDispSwitchState == DispSwitchState::GRAPH)) {
|
||||||
// plot power graph
|
// plot power graph
|
||||||
plotPowerGraph(8, mLineYOffsets[graph_last_line] - 1);
|
plotPowerGraph(8, mLineYOffsets[graph_last_line] - 1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue