mirror of
https://github.com/lumapu/ahoy.git
synced 2025-06-07 21:21:38 +02:00
adapt main-changes fro nokia5110 functions
This commit is contained in:
parent
1859e853a0
commit
81fda86ef7
2 changed files with 16 additions and 14 deletions
|
@ -11,6 +11,7 @@
|
||||||
#include "app.h"
|
#include "app.h"
|
||||||
|
|
||||||
#include <ArduinoJson.h>
|
#include <ArduinoJson.h>
|
||||||
|
#include <U8g2lib.h>
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
@ -64,42 +65,43 @@ static unsigned char bmp_arrow[] U8X8_PROGMEM = {
|
||||||
B01110000, B01110000, B00110000, B00111000, B00011000, B01111111, B00111111,
|
B01110000, B01110000, B00110000, B00111000, B00011000, B01111111, B00111111,
|
||||||
B00011110, B00001110, B00000110, B00000000, B00000000, B00000000, B00000000 } ;
|
B00011110, B00001110, B00000110, B00000000, B00000000, B00000000, B00000000 } ;
|
||||||
|
|
||||||
void DataScreen( app* main, time_t ts )
|
void DataScreen( app* mApp, time_t ts )
|
||||||
{
|
{
|
||||||
static int extra = 0;
|
static int extra = 0;
|
||||||
String timeStr = main->getDateTimeStr(ts).substring(2,22);
|
String timeStr = mApp->getDateTimeStr(ts).substring(2,22);
|
||||||
IPAddress ip = WiFi.localIP();
|
IPAddress ip = WiFi.localIP();
|
||||||
float totalYield = 0.000, totalYieldToday = 0.000, totalActual = 0.0;
|
float totalYield = 0.000, totalYieldToday = 0.000, totalActual = 0.0;
|
||||||
char fmtText[32];
|
char fmtText[32];
|
||||||
int ucnt=0;
|
int ucnt=0;
|
||||||
|
|
||||||
for (uint8_t id = 0; id < main->mSys->getNumInverters(); id++)
|
for (uint8_t id = 0; id < mApp->mSys->getNumInverters(); id++)
|
||||||
{
|
{
|
||||||
Inverter<> *iv = main->mSys->getInverterByPos(id);
|
Inverter<> *iv = mApp->mSys->getInverterByPos(id);
|
||||||
if (NULL != iv)
|
if (NULL != iv)
|
||||||
{
|
{
|
||||||
|
record_t<> *rec = iv->getRecordStruct(RealTimeRunData_Debug);
|
||||||
uint8_t pos;
|
uint8_t pos;
|
||||||
uint8_t list[] = {FLD_PAC, FLD_YT, FLD_YD};
|
uint8_t list[] = {FLD_PAC, FLD_YT, FLD_YD};
|
||||||
|
|
||||||
if ( !iv->isAvailable(ts) )
|
if ( !iv->isProducing(ts,rec) )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
ucnt++;
|
ucnt++;
|
||||||
|
|
||||||
for (uint8_t fld = 0; fld < 3; fld++)
|
for (uint8_t fld = 0; fld < 3; fld++)
|
||||||
{
|
{
|
||||||
pos = (iv->getPosByChFld(CH0, list[fld]));
|
pos = iv->getPosByChFld(CH0, list[fld],rec);
|
||||||
|
|
||||||
if(fld == 1){
|
if(fld == 1){
|
||||||
totalYield += iv->getValue(pos);
|
totalYield += iv->getValue(pos,rec);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(fld == 2){
|
if(fld == 2){
|
||||||
totalYieldToday += iv->getValue(pos);
|
totalYieldToday += iv->getValue(pos,rec);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(fld == 0){
|
if(fld == 0){
|
||||||
totalActual += iv->getValue(pos);
|
totalActual += iv->getValue(pos,rec);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -202,7 +204,7 @@ void app::loop(void) {
|
||||||
static int lcnt=0;
|
static int lcnt=0;
|
||||||
if ( lcnt == 150000 )
|
if ( lcnt == 150000 )
|
||||||
{
|
{
|
||||||
DataScreen(this, mTimestamp);
|
DataScreen(this, mUtcTimestamp);
|
||||||
lcnt=0;
|
lcnt=0;
|
||||||
}
|
}
|
||||||
lcnt++;
|
lcnt++;
|
||||||
|
|
|
@ -50,7 +50,7 @@ lib_deps =
|
||||||
platform = espressif8266
|
platform = espressif8266
|
||||||
board = esp12e
|
board = esp12e
|
||||||
board_build.f_cpu = 80000000L
|
board_build.f_cpu = 80000000L
|
||||||
build_flags = -D RELEASE
|
build_flags = -D RELEASE -DU8X8_NO_HW_I2C
|
||||||
monitor_filters =
|
monitor_filters =
|
||||||
;default ; Remove typical terminal control codes from input
|
;default ; Remove typical terminal control codes from input
|
||||||
time ; Add timestamp with milliseconds for each new line
|
time ; Add timestamp with milliseconds for each new line
|
||||||
|
@ -60,7 +60,7 @@ monitor_filters =
|
||||||
platform = espressif8266
|
platform = espressif8266
|
||||||
board = esp12e
|
board = esp12e
|
||||||
board_build.f_cpu = 80000000L
|
board_build.f_cpu = 80000000L
|
||||||
build_flags = -DDEBUG_LEVEL=DBG_DEBUG -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_OOM -DDEBUG_ESP_PORT=Serial
|
build_flags = -DDEBUG_LEVEL=DBG_DEBUG -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_OOM -DDEBUG_ESP_PORT=Serial -DU8X8_NO_HW_I2C
|
||||||
build_type = debug
|
build_type = debug
|
||||||
monitor_filters =
|
monitor_filters =
|
||||||
;default ; Remove typical terminal control codes from input
|
;default ; Remove typical terminal control codes from input
|
||||||
|
@ -72,7 +72,7 @@ platform = espressif8266
|
||||||
board = esp8285
|
board = esp8285
|
||||||
board_build.ldscript = eagle.flash.1m64.ld
|
board_build.ldscript = eagle.flash.1m64.ld
|
||||||
board_build.f_cpu = 80000000L
|
board_build.f_cpu = 80000000L
|
||||||
build_flags = -D RELEASE
|
build_flags = -D RELEASE -DU8X8_NO_HW_I2C
|
||||||
monitor_filters =
|
monitor_filters =
|
||||||
;default ; Remove typical terminal control codes from input
|
;default ; Remove typical terminal control codes from input
|
||||||
time ; Add timestamp with milliseconds for each new line
|
time ; Add timestamp with milliseconds for each new line
|
||||||
|
@ -83,7 +83,7 @@ platform = espressif8266
|
||||||
board = esp8285
|
board = esp8285
|
||||||
board_build.ldscript = eagle.flash.1m64.ld
|
board_build.ldscript = eagle.flash.1m64.ld
|
||||||
board_build.f_cpu = 80000000L
|
board_build.f_cpu = 80000000L
|
||||||
build_flags = -DDEBUG_LEVEL=DBG_DEBUG -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_OOM -DDEBUG_ESP_PORT=Serial
|
build_flags = -DDEBUG_LEVEL=DBG_DEBUG -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_OOM -DDEBUG_ESP_PORT=Serial -DU8X8_NO_HW_I2C
|
||||||
build_type = debug
|
build_type = debug
|
||||||
monitor_filters =
|
monitor_filters =
|
||||||
;default ; Remove typical terminal control codes from input
|
;default ; Remove typical terminal control codes from input
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue