Browse Source

0.8.48

* merge PR: pin selection for ESP-32 S2 #1334
* merge PR: enhancement: power graph display option #1330
pull/1341/head
lumapu 1 year ago
parent
commit
3c5be9ae35
  1. 15
      .github/workflows/compile_development.yml
  2. 4
      src/CHANGES.md
  3. 2
      src/defines.h
  4. 39
      src/plugins/Display/Display_Mono.h
  5. 4
      src/plugins/Display/Display_Mono_128X64.h
  6. 4
      src/plugins/Display/Display_Mono_84X48.h

15
.github/workflows/compile_development.yml

@ -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 }}

4
src/CHANGES.md

@ -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`

2
src/defines.h

@ -13,7 +13,7 @@
//-------------------------------------
#define VERSION_MAJOR 0
#define VERSION_MINOR 8
#define VERSION_PATCH 47
#define VERSION_PATCH 48
//-------------------------------------
typedef struct {

39
src/plugins/Display/Display_Mono.h

@ -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;
}

4
src/plugins/Display/Display_Mono_128X64.h

@ -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)));
}
};

4
src/plugins/Display/Display_Mono_84X48.h

@ -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…
Cancel
Save