Moved to c++17 and espressif32 @ 6.9.0, fixed waypoint boatdata code

This commit is contained in:
Thomas Hooge 2025-08-06 14:04:54 +02:00
parent 2d47702627
commit f823dadc6b
7 changed files with 1983 additions and 1995 deletions

View File

@ -254,6 +254,10 @@ static void writeToString(GwTextWriter *writer, const int16_t &value)
{ {
writer->writeInteger(value); writer->writeInteger(value);
} }
static void writeToString(GwTextWriter *writer, String value)
{
writer->writeString(value.c_str());
}
static void writeToString(GwTextWriter *writer, GwSatInfoList &value) static void writeToString(GwTextWriter *writer, GwSatInfoList &value)
{ {
writer->writeInteger(value.getNumSats()); writer->writeInteger(value.getNumSats());

View File

@ -121,7 +121,13 @@ template<class T> class GwBoatItem : public GwBoatItemBase{
if (! isValid(millis())) return defaultv; if (! isValid(millis())) return defaultv;
return data; return data;
} }
virtual double getDoubleValue(){return (double)data;} virtual double getDoubleValue(){
if constexpr (std::is_same<T, String>::value) {
return 0.0; // TODO any better ideas?
} else {
return (double)data;
}
}
virtual void fillString(); virtual void fillString();
virtual void toJsonDoc(GwJsonDocument *doc, unsigned long minTime); virtual void toJsonDoc(GwJsonDocument *doc, unsigned long minTime);
virtual int getLastSource(){return lastUpdateSource;} virtual int getLastSource(){return lastUpdateSource;}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -20,7 +20,7 @@ import getopt
import re import re
import json import json
__version__ = "0.2" __version__ = "1.2"
def detect_pages(filename): def detect_pages(filename):
# returns a dictionary with page name and the number of gui fields # returns a dictionary with page name and the number of gui fields
@ -110,11 +110,10 @@ def create_json(device, no_of_pages, pagedata):
"description": "The display for field {}".format(number_to_text(field_no)), "description": "The display for field {}".format(number_to_text(field_no)),
"category": f"{device.upper()} Page {page_no}", "category": f"{device.upper()} Page {page_no}",
"capabilities": {device.lower(): "true"}, "capabilities": {device.lower(): "true"},
"condition": [ "condition": {
{f"page{page_no}type": page} f"page{page_no}type": [page for page in pages if pagedata[page] >= field_no],
for page in pages "visiblePages": [vp for vp in range(page_no, no_of_pages + 1)]
if pagedata[page] >= field_no },
],
} }
output.append(field_data) output.append(field_data)

View File

@ -8,7 +8,6 @@ default_envs =
obp40_s3 obp40_s3
[env:obp60_s3] [env:obp60_s3]
platform = espressif32@6.8.1
board_build.variants_dir = variants board_build.variants_dir = variants
#board = obp60_s3_n8 #ESP32-S3 N8, 8MB flash, no PSRAM #board = obp60_s3_n8 #ESP32-S3 N8, 8MB flash, no PSRAM
#board = obp60_s3_n16 #ESP32-S3 N16,16MB flash, no PSRAM, zero series #board = obp60_s3_n16 #ESP32-S3 N16,16MB flash, no PSRAM, zero series
@ -63,7 +62,6 @@ upload_speed = 230400
monitor_speed = 115200 monitor_speed = 115200
[env:obp40_s3] [env:obp40_s3]
platform = espressif32@6.8.1
board_build.variants_dir = variants board_build.variants_dir = variants
board = obp40_s3_n8r8 #ESP32-S3 N8R8, 8MB flash, 8MB PSRAM, OBP60 clone (CrowPanel 4.2) board = obp40_s3_n8r8 #ESP32-S3 N8R8, 8MB flash, 8MB PSRAM, OBP60 clone (CrowPanel 4.2)
board_build.partitions = default_8MB.csv #ESP32-S3 N8, 8MB flash board_build.partitions = default_8MB.csv #ESP32-S3 N8, 8MB flash

View File

@ -30,7 +30,7 @@ lib_deps =
Update Update
[env] [env]
platform = espressif32 @ 6.8.1 platform = espressif32 @ 6.9.0
framework = arduino framework = arduino
;platform_packages= ;platform_packages=
; framework-arduinoespressif32 @ 3.20017.0 ; framework-arduinoespressif32 @ 3.20017.0
@ -56,6 +56,9 @@ lib_ldf_mode = off
monitor_speed = 115200 monitor_speed = 115200
build_flags = build_flags =
-D PIO_ENV_BUILD=$PIOENV -D PIO_ENV_BUILD=$PIOENV
-std=gnu++17
build_unflags =
-std=gnu++11
[sensors] [sensors]
; collect the libraries for sensors here ; collect the libraries for sensors here