mirror of
https://github.com/lumapu/ahoy.git
synced 2025-04-30 10:46:24 +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:
|
with:
|
||||||
merge-multiple: true
|
merge-multiple: true
|
||||||
path: firmware
|
path: firmware
|
||||||
- name: Display structure of downloaded files
|
|
||||||
run: ls -R firmware
|
|
||||||
|
|
||||||
- name: Get Version from code
|
- name: Get Version from code
|
||||||
id: version_name
|
id: version_name
|
||||||
|
@ -161,19 +159,6 @@ jobs:
|
||||||
env:
|
env:
|
||||||
VERSION: ${{ steps.version_name.outputs.name }}
|
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
|
- name: Rename firmware directory
|
||||||
run: mv firmware ${{ steps.version_name.outputs.name }}
|
run: mv firmware ${{ steps.version_name.outputs.name }}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
# Development Changes
|
# 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
|
## 0.8.47 - 2024-01-06
|
||||||
* reduce GxEPD2 lib to compile faster
|
* reduce GxEPD2 lib to compile faster
|
||||||
* upgraded GxEPD2 lib to `1.5.3`
|
* upgraded GxEPD2 lib to `1.5.3`
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
//-------------------------------------
|
//-------------------------------------
|
||||||
#define VERSION_MAJOR 0
|
#define VERSION_MAJOR 0
|
||||||
#define VERSION_MINOR 8
|
#define VERSION_MINOR 8
|
||||||
#define VERSION_PATCH 47
|
#define VERSION_PATCH 48
|
||||||
|
|
||||||
//-------------------------------------
|
//-------------------------------------
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
|
@ -64,6 +64,12 @@ class DisplayMono {
|
||||||
return(monoMaintainDispSwitchState());
|
return(monoMaintainDispSwitchState());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected:
|
||||||
|
enum class DispSwitchState {
|
||||||
|
TEXT,
|
||||||
|
GRAPH
|
||||||
|
};
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
U8G2* mDisplay;
|
U8G2* mDisplay;
|
||||||
DisplayData *mDisplayData;
|
DisplayData *mDisplayData;
|
||||||
|
@ -72,7 +78,6 @@ class DisplayMono {
|
||||||
uint8_t mPgWidth = 0;
|
uint8_t mPgWidth = 0;
|
||||||
uint8_t mPgHeight = 0;
|
uint8_t mPgHeight = 0;
|
||||||
float mPgMaxPwr = 0.0;
|
float mPgMaxPwr = 0.0;
|
||||||
// float mPgMaxAvailPower = 0.0;
|
|
||||||
uint32_t mPgPeriod = 0; // seconds
|
uint32_t mPgPeriod = 0; // seconds
|
||||||
uint32_t mPgTimeOfDay = 0;
|
uint32_t mPgTimeOfDay = 0;
|
||||||
uint8_t mPgLastPos = 0;
|
uint8_t mPgLastPos = 0;
|
||||||
|
@ -95,15 +100,10 @@ class DisplayMono {
|
||||||
int8_t mPixelshift=0;
|
int8_t mPixelshift=0;
|
||||||
TimeMonitor mDisplayTime = TimeMonitor(1000 * DISP_DEFAULT_TIMEOUT, true);
|
TimeMonitor mDisplayTime = TimeMonitor(1000 * DISP_DEFAULT_TIMEOUT, true);
|
||||||
TimeMonitor mDispSwitchTime = TimeMonitor();
|
TimeMonitor mDispSwitchTime = TimeMonitor();
|
||||||
uint8_t mDispSwitchState;
|
DispSwitchState mDispSwitchState = DispSwitchState::TEXT;
|
||||||
bool mDisplayActive = true; // always start with display on
|
bool mDisplayActive = true; // always start with display on
|
||||||
char mFmtText[DISP_FMT_TEXT_LEN];
|
char mFmtText[DISP_FMT_TEXT_LEN];
|
||||||
|
|
||||||
enum _dispSwitchState {
|
|
||||||
d_POWER_TEXT = 0,
|
|
||||||
d_POWER_GRAPH = 1,
|
|
||||||
};
|
|
||||||
|
|
||||||
// Common initialization function to be called by subclasses
|
// Common initialization function to be called by subclasses
|
||||||
void monoInit(U8G2* display, uint8_t type, DisplayData *displayData) {
|
void monoInit(U8G2* display, uint8_t type, DisplayData *displayData) {
|
||||||
mDisplay = display;
|
mDisplay = display;
|
||||||
|
@ -116,9 +116,8 @@ class DisplayMono {
|
||||||
mDispWidth = mDisplay->getDisplayWidth();
|
mDispWidth = mDisplay->getDisplayWidth();
|
||||||
mDispHeight = mDisplay->getDisplayHeight();
|
mDispHeight = mDisplay->getDisplayHeight();
|
||||||
mDispSwitchTime.stopTimeMonitor();
|
mDispSwitchTime.stopTimeMonitor();
|
||||||
mDispSwitchState = d_POWER_TEXT;
|
|
||||||
if (mGraphRatio == 100) // if graph ratio is 100% start in graph mode
|
if (mGraphRatio == 100) // if graph ratio is 100% start in graph mode
|
||||||
mDispSwitchState = d_POWER_GRAPH;
|
mDispSwitchState = DispSwitchState::GRAPH;
|
||||||
else if (mGraphRatio != 0)
|
else if (mGraphRatio != 0)
|
||||||
mDispSwitchTime.startTimeMonitor(150 * (100 - mGraphRatio)); // start display mode change only if ratio is neither 0 nor 100
|
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 monoMaintainDispSwitchState(void) {
|
||||||
bool change = false;
|
bool change = false;
|
||||||
switch(mDispSwitchState) {
|
switch(mDispSwitchState) {
|
||||||
case d_POWER_TEXT:
|
case DispSwitchState::TEXT:
|
||||||
if (mDispSwitchTime.isTimeout()) {
|
if (mDispSwitchTime.isTimeout()) {
|
||||||
mDispSwitchState = d_POWER_GRAPH;
|
mDispSwitchState = DispSwitchState::GRAPH;
|
||||||
mDispSwitchTime.startTimeMonitor(150 * mGraphRatio); // mGraphRatio: 0-100 Gesamtperiode 15000 ms
|
mDispSwitchTime.startTimeMonitor(150 * mGraphRatio); // mGraphRatio: 0-100 Gesamtperiode 15000 ms
|
||||||
change = true;
|
change = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case d_POWER_GRAPH:
|
case DispSwitchState::GRAPH:
|
||||||
if (mDispSwitchTime.isTimeout()) {
|
if (mDispSwitchTime.isTimeout()) {
|
||||||
mDispSwitchState = d_POWER_TEXT;
|
mDispSwitchState = DispSwitchState::TEXT;
|
||||||
mDispSwitchTime.startTimeMonitor(150 * (100 - mGraphRatio));
|
mDispSwitchTime.startTimeMonitor(150 * (100 - mGraphRatio));
|
||||||
change = true;
|
change = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -176,7 +176,7 @@ class DisplayMono128X64 : public DisplayMono {
|
||||||
printText(mFmtText, l_YieldTotal, 0xff);
|
printText(mFmtText, l_YieldTotal, 0xff);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mDispSwitchState == d_POWER_GRAPH) {
|
if (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);
|
||||||
}
|
}
|
||||||
|
@ -274,6 +274,6 @@ class DisplayMono128X64 : public DisplayMono {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool showLine(uint8_t line) {
|
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);
|
printText(mFmtText, l_YieldTotal, 0xff);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mDispSwitchState == d_POWER_GRAPH) {
|
if (mDispSwitchState == DispSwitchState::GRAPH) {
|
||||||
// plot power graph
|
// plot power graph
|
||||||
plotPowerGraph(8, mLineYOffsets[graph_last_line] - 1);
|
plotPowerGraph(8, mLineYOffsets[graph_last_line] - 1);
|
||||||
}
|
}
|
||||||
|
@ -227,7 +227,7 @@ class DisplayMono84X48 : public DisplayMono {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool showLine(uint8_t line) {
|
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
Reference in a new issue