mirror of
https://github.com/lumapu/ahoy.git
synced 2025-07-09 12:37:17 +02:00
0.8.48
* merge PR: pin selection for ESP-32 S2 #1334 * merge PR: enhancement: power graph display option #1330
This commit is contained in:
parent
42926c4d26
commit
3c5be9ae35
6 changed files with 234 additions and 246 deletions
15
.github/workflows/compile_development.yml
vendored
15
.github/workflows/compile_development.yml
vendored
|
@ -147,8 +147,6 @@ jobs:
|
|||
with:
|
||||
merge-multiple: true
|
||||
path: firmware
|
||||
- name: Display structure of downloaded files
|
||||
run: ls -R firmware
|
||||
|
||||
- name: Get Version from code
|
||||
id: version_name
|
||||
|
@ -161,19 +159,6 @@ jobs:
|
|||
env:
|
||||
VERSION: ${{ steps.version_name.outputs.name }}
|
||||
|
||||
# - name: Create Manifest
|
||||
# working-directory: src
|
||||
# run: python ../scripts/buildManifest.py
|
||||
#
|
||||
# - name: Create Artifact
|
||||
# uses: actions/upload-artifact@v3
|
||||
# with:
|
||||
# name: ahoydtu_dev
|
||||
# path: |
|
||||
# src/firmware/*
|
||||
# src/User_Manual.md
|
||||
# src/install.html
|
||||
|
||||
- name: Rename firmware directory
|
||||
run: mv firmware ${{ steps.version_name.outputs.name }}
|
||||
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
# Development Changes
|
||||
|
||||
## 0.8.48 - 2024-01-07
|
||||
* merge PR: pin selection for ESP-32 S2 #1334
|
||||
* merge PR: enhancement: power graph display option #1330
|
||||
|
||||
## 0.8.47 - 2024-01-06
|
||||
* reduce GxEPD2 lib to compile faster
|
||||
* upgraded GxEPD2 lib to `1.5.3`
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
//-------------------------------------
|
||||
#define VERSION_MAJOR 0
|
||||
#define VERSION_MINOR 8
|
||||
#define VERSION_PATCH 47
|
||||
#define VERSION_PATCH 48
|
||||
|
||||
//-------------------------------------
|
||||
typedef struct {
|
||||
|
|
|
@ -64,18 +64,23 @@ class DisplayMono {
|
|||
return(monoMaintainDispSwitchState());
|
||||
}
|
||||
|
||||
protected:
|
||||
enum class DispSwitchState {
|
||||
TEXT,
|
||||
GRAPH
|
||||
};
|
||||
|
||||
protected:
|
||||
U8G2* mDisplay;
|
||||
DisplayData *mDisplayData;
|
||||
|
||||
float *mPgData=nullptr;
|
||||
uint8_t mPgWidth=0;
|
||||
uint8_t mPgHeight=0;
|
||||
float mPgMaxPwr=0.0;
|
||||
// float mPgMaxAvailPower = 0.0;
|
||||
uint32_t mPgPeriod=0; // seconds
|
||||
uint32_t mPgTimeOfDay=0;
|
||||
uint8_t mPgLastPos=0;
|
||||
float *mPgData = nullptr;
|
||||
uint8_t mPgWidth = 0;
|
||||
uint8_t mPgHeight = 0;
|
||||
float mPgMaxPwr = 0.0;
|
||||
uint32_t mPgPeriod = 0; // seconds
|
||||
uint32_t mPgTimeOfDay = 0;
|
||||
uint8_t mPgLastPos = 0;
|
||||
|
||||
uint8_t mType;
|
||||
uint16_t mDispWidth;
|
||||
|
@ -95,15 +100,10 @@ class DisplayMono {
|
|||
int8_t mPixelshift=0;
|
||||
TimeMonitor mDisplayTime = TimeMonitor(1000 * DISP_DEFAULT_TIMEOUT, true);
|
||||
TimeMonitor mDispSwitchTime = TimeMonitor();
|
||||
uint8_t mDispSwitchState;
|
||||
DispSwitchState mDispSwitchState = DispSwitchState::TEXT;
|
||||
bool mDisplayActive = true; // always start with display on
|
||||
char mFmtText[DISP_FMT_TEXT_LEN];
|
||||
|
||||
enum _dispSwitchState {
|
||||
d_POWER_TEXT = 0,
|
||||
d_POWER_GRAPH = 1,
|
||||
};
|
||||
|
||||
// Common initialization function to be called by subclasses
|
||||
void monoInit(U8G2* display, uint8_t type, DisplayData *displayData) {
|
||||
mDisplay = display;
|
||||
|
@ -116,9 +116,8 @@ class DisplayMono {
|
|||
mDispWidth = mDisplay->getDisplayWidth();
|
||||
mDispHeight = mDisplay->getDisplayHeight();
|
||||
mDispSwitchTime.stopTimeMonitor();
|
||||
mDispSwitchState = d_POWER_TEXT;
|
||||
if (mGraphRatio == 100) // if graph ratio is 100% start in graph mode
|
||||
mDispSwitchState = d_POWER_GRAPH;
|
||||
mDispSwitchState = DispSwitchState::GRAPH;
|
||||
else if (mGraphRatio != 0)
|
||||
mDispSwitchTime.startTimeMonitor(150 * (100 - mGraphRatio)); // start display mode change only if ratio is neither 0 nor 100
|
||||
}
|
||||
|
@ -126,16 +125,16 @@ class DisplayMono {
|
|||
bool monoMaintainDispSwitchState(void) {
|
||||
bool change = false;
|
||||
switch(mDispSwitchState) {
|
||||
case d_POWER_TEXT:
|
||||
case DispSwitchState::TEXT:
|
||||
if (mDispSwitchTime.isTimeout()) {
|
||||
mDispSwitchState = d_POWER_GRAPH;
|
||||
mDispSwitchState = DispSwitchState::GRAPH;
|
||||
mDispSwitchTime.startTimeMonitor(150 * mGraphRatio); // mGraphRatio: 0-100 Gesamtperiode 15000 ms
|
||||
change = true;
|
||||
}
|
||||
break;
|
||||
case d_POWER_GRAPH:
|
||||
case DispSwitchState::GRAPH:
|
||||
if (mDispSwitchTime.isTimeout()) {
|
||||
mDispSwitchState = d_POWER_TEXT;
|
||||
mDispSwitchState = DispSwitchState::TEXT;
|
||||
mDispSwitchTime.startTimeMonitor(150 * (100 - mGraphRatio));
|
||||
change = true;
|
||||
}
|
||||
|
|
|
@ -176,7 +176,7 @@ class DisplayMono128X64 : public DisplayMono {
|
|||
printText(mFmtText, l_YieldTotal, 0xff);
|
||||
}
|
||||
|
||||
if (mDispSwitchState == d_POWER_GRAPH) {
|
||||
if (mDispSwitchState == DispSwitchState::GRAPH) {
|
||||
// plot power graph
|
||||
plotPowerGraph((mDispWidth - mPgWidth) / 2 + mPixelshift, mLineYOffsets[graph_last_line] - 1);
|
||||
}
|
||||
|
@ -274,6 +274,6 @@ class DisplayMono128X64 : public DisplayMono {
|
|||
}
|
||||
|
||||
bool showLine(uint8_t line) {
|
||||
return ((mDispSwitchState == d_POWER_TEXT) || ((line < graph_first_line) || (line > graph_last_line)));
|
||||
return ((mDispSwitchState == DispSwitchState::TEXT) || ((line < graph_first_line) || (line > graph_last_line)));
|
||||
}
|
||||
};
|
||||
|
|
|
@ -137,7 +137,7 @@ class DisplayMono84X48 : public DisplayMono {
|
|||
printText(mFmtText, l_YieldTotal, 0xff);
|
||||
}
|
||||
|
||||
if (mDispSwitchState == d_POWER_GRAPH) {
|
||||
if (mDispSwitchState == DispSwitchState::GRAPH) {
|
||||
// plot power graph
|
||||
plotPowerGraph(8, mLineYOffsets[graph_last_line] - 1);
|
||||
}
|
||||
|
@ -227,7 +227,7 @@ class DisplayMono84X48 : public DisplayMono {
|
|||
}
|
||||
|
||||
bool showLine(uint8_t line) {
|
||||
return ((mDispSwitchState == d_POWER_TEXT) || ((line < graph_first_line) || (line > graph_last_line)));
|
||||
return ((mDispSwitchState == DispSwitchState::TEXT) || ((line < graph_first_line) || (line > graph_last_line)));
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue