diff --git a/components/meteofrance/include/meteofrance.h b/components/meteofrance/include/meteofrance.h index 47754a9..f11011b 100644 --- a/components/meteofrance/include/meteofrance.h +++ b/components/meteofrance/include/meteofrance.h @@ -13,12 +13,13 @@ struct Hashtable { struct forecast_temp{ float min; float max; - char desc[20]; + char desc[25]; char icon[8]; }; struct meteoforecast_data{ int datetime; + bool isValid; struct forecast_temp previsions; }; diff --git a/components/meteofrance/meteofrance.c b/components/meteofrance/meteofrance.c index 610b5cc..dfab41a 100644 --- a/components/meteofrance/meteofrance.c +++ b/components/meteofrance/meteofrance.c @@ -54,7 +54,7 @@ void printffd(struct meteoforecast_data *tmp){ struct tm * pTime=localtime( & tmp->datetime ); char buffer[ MAX_SIZE ]; strftime(buffer, MAX_SIZE, "%d/%m/%Y", pTime); - printf(" date:%d, Min:%.1f Max:%.1f Desc:%s\n", tmp->datetime, tmp->previsions.min, tmp->previsions.max, tmp->previsions.desc); + printf("IsValid:%s date:%d, Min:%.1f Max:%.1f Desc:%s\n", tmp->isValid ?"true":"false", tmp->datetime, tmp->previsions.min, tmp->previsions.max, tmp->previsions.desc); } esp_err_t _http_event_handler(esp_http_client_event_t *evt) @@ -182,8 +182,9 @@ void JSON_Parse(const cJSON * const root) { datasT.previsions.max=cJSON_GetObjectItem(temps,"max")->valuedouble; cJSON *weather12=cJSON_GetObjectItem(current_element,"weather12H"); - strncpy(datasT.previsions.desc,cJSON_GetObjectItem(weather12,"desc")->valuestring,19); + strncpy(datasT.previsions.desc,cJSON_GetObjectItem(weather12,"desc")->valuestring,24); strncpy(datasT.previsions.icon,cJSON_GetObjectItem(weather12,"icon")->valuestring,7); + datasT.isValid=true; ESP_LOGE(TAG,"Donnees lues"); printffd(&datasT); datas[i++]=datasT; diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt index c13f477..0ed2572 100644 --- a/main/CMakeLists.txt +++ b/main/CMakeLists.txt @@ -3,15 +3,73 @@ idf_component_register(SRC_DIRS . fonts REQUIRES esp_wifi nvs_flash mqtt meteofrance) lvgl_port_create_c_image("images/esp_logo.png" "images/" "ARGB8888" "NONE") -lvgl_port_create_c_image("images/p1j.png" "images/" "ARGB8888" "NONE") -lvgl_port_create_c_image("images/p2j.png" "images/" "ARGB8888" "NONE") -lvgl_port_create_c_image("images/p3j.png" "images/" "ARGB8888" "NONE") +lvgl_port_create_c_image("images/p10j.png" "images/" "ARGB8888" "NONE") +lvgl_port_create_c_image("images/p10n.png" "images/" "ARGB8888" "NONE") +lvgl_port_create_c_image("images/p11j.png" "images/" "ARGB8888" "NONE") +lvgl_port_create_c_image("images/p11n.png" "images/" "ARGB8888" "NONE") +lvgl_port_create_c_image("images/p12j.png" "images/" "ARGB8888" "NONE") +lvgl_port_create_c_image("images/p12n.png" "images/" "ARGB8888" "NONE") +lvgl_port_create_c_image("images/p13j.png" "images/" "ARGB8888" "NONE") +lvgl_port_create_c_image("images/p13n.png" "images/" "ARGB8888" "NONE") +lvgl_port_create_c_image("images/p14bisj.png" "images/" "ARGB8888" "NONE") lvgl_port_create_c_image("images/p14j.png" "images/" "ARGB8888" "NONE") +lvgl_port_create_c_image("images/p14n.png" "images/" "ARGB8888" "NONE") +lvgl_port_create_c_image("images/p15j.png" "images/" "ARGB8888" "NONE") +lvgl_port_create_c_image("images/p15n.png" "images/" "ARGB8888" "NONE") +lvgl_port_create_c_image("images/p16bisj.png" "images/" "ARGB8888" "NONE") +lvgl_port_create_c_image("images/p16j.png" "images/" "ARGB8888" "NONE") +lvgl_port_create_c_image("images/p16n.png" "images/" "ARGB8888" "NONE") +lvgl_port_create_c_image("images/p17j.png" "images/" "ARGB8888" "NONE") +lvgl_port_create_c_image("images/p17n.png" "images/" "ARGB8888" "NONE") +lvgl_port_create_c_image("images/p18j.png" "images/" "ARGB8888" "NONE") +lvgl_port_create_c_image("images/p18n.png" "images/" "ARGB8888" "NONE") +lvgl_port_create_c_image("images/p19j.png" "images/" "ARGB8888" "NONE") +lvgl_port_create_c_image("images/p19n.png" "images/" "ARGB8888" "NONE") +lvgl_port_create_c_image("images/p1j.png" "images/" "ARGB8888" "NONE") +lvgl_port_create_c_image("images/p1n.png" "images/" "ARGB8888" "NONE") +lvgl_port_create_c_image("images/p20j.png" "images/" "ARGB8888" "NONE") +lvgl_port_create_c_image("images/p20n.png" "images/" "ARGB8888" "NONE") +lvgl_port_create_c_image("images/p21j.png" "images/" "ARGB8888" "NONE") +lvgl_port_create_c_image("images/p21n.png" "images/" "ARGB8888" "NONE") +lvgl_port_create_c_image("images/p22j.png" "images/" "ARGB8888" "NONE") +lvgl_port_create_c_image("images/p22n.png" "images/" "ARGB8888" "NONE") +lvgl_port_create_c_image("images/p23j.png" "images/" "ARGB8888" "NONE") +lvgl_port_create_c_image("images/p23n.png" "images/" "ARGB8888" "NONE") lvgl_port_create_c_image("images/p24j.png" "images/" "ARGB8888" "NONE") +lvgl_port_create_c_image("images/p24n.png" "images/" "ARGB8888" "NONE") lvgl_port_create_c_image("images/p25j.png" "images/" "ARGB8888" "NONE") +lvgl_port_create_c_image("images/p25n.png" "images/" "ARGB8888" "NONE") lvgl_port_create_c_image("images/p26j.png" "images/" "ARGB8888" "NONE") +lvgl_port_create_c_image("images/p26n.png" "images/" "ARGB8888" "NONE") lvgl_port_create_c_image("images/p27j.png" "images/" "ARGB8888" "NONE") +lvgl_port_create_c_image("images/p27n.png" "images/" "ARGB8888" "NONE") +lvgl_port_create_c_image("images/p28j.png" "images/" "ARGB8888" "NONE") +lvgl_port_create_c_image("images/p28n.png" "images/" "ARGB8888" "NONE") lvgl_port_create_c_image("images/p29j.png" "images/" "ARGB8888" "NONE") +lvgl_port_create_c_image("images/p29n.png" "images/" "ARGB8888" "NONE") +lvgl_port_create_c_image("images/p2j.png" "images/" "ARGB8888" "NONE") +lvgl_port_create_c_image("images/p2n.png" "images/" "ARGB8888" "NONE") +lvgl_port_create_c_image("images/p30j.png" "images/" "ARGB8888" "NONE") +lvgl_port_create_c_image("images/p30n.png" "images/" "ARGB8888" "NONE") +lvgl_port_create_c_image("images/p31j.png" "images/" "ARGB8888" "NONE") +lvgl_port_create_c_image("images/p31n.png" "images/" "ARGB8888" "NONE") +lvgl_port_create_c_image("images/p32j.png" "images/" "ARGB8888" "NONE") +lvgl_port_create_c_image("images/p32n.png" "images/" "ARGB8888" "NONE") +lvgl_port_create_c_image("images/p3j.png" "images/" "ARGB8888" "NONE") +lvgl_port_create_c_image("images/p3n.png" "images/" "ARGB8888" "NONE") +lvgl_port_create_c_image("images/p4j.png" "images/" "ARGB8888" "NONE") +lvgl_port_create_c_image("images/p4n.png" "images/" "ARGB8888" "NONE") +lvgl_port_create_c_image("images/p5bisj.png" "images/" "ARGB8888" "NONE") +lvgl_port_create_c_image("images/p5j.png" "images/" "ARGB8888" "NONE") +lvgl_port_create_c_image("images/p5n.png" "images/" "ARGB8888" "NONE") +lvgl_port_create_c_image("images/p6j.png" "images/" "ARGB8888" "NONE") +lvgl_port_create_c_image("images/p6n.png" "images/" "ARGB8888" "NONE") +lvgl_port_create_c_image("images/p7j.png" "images/" "ARGB8888" "NONE") +lvgl_port_create_c_image("images/p7n.png" "images/" "ARGB8888" "NONE") +lvgl_port_create_c_image("images/p8j.png" "images/" "ARGB8888" "NONE") +lvgl_port_create_c_image("images/p8n.png" "images/" "ARGB8888" "NONE") +lvgl_port_create_c_image("images/p9j.png" "images/" "ARGB8888" "NONE") +lvgl_port_create_c_image("images/p9n.png" "images/" "ARGB8888" "NONE") lvgl_port_add_images(${COMPONENT_LIB} "images/") diff --git a/main/images/p10j.png b/main/images/p10j.png new file mode 100644 index 0000000..71ded95 Binary files /dev/null and b/main/images/p10j.png differ diff --git a/main/images/p10j.svg b/main/images/p10j.svg new file mode 100644 index 0000000..18ac3dd --- /dev/null +++ b/main/images/p10j.svg @@ -0,0 +1 @@ +14Plan de travail 1 \ No newline at end of file diff --git a/main/images/p10n.png b/main/images/p10n.png new file mode 100644 index 0000000..934d74e Binary files /dev/null and b/main/images/p10n.png differ diff --git a/main/images/p10n.svg b/main/images/p10n.svg new file mode 100644 index 0000000..755ba89 --- /dev/null +++ b/main/images/p10n.svg @@ -0,0 +1 @@ +15Plan de travail 1 \ No newline at end of file diff --git a/main/images/p11j.png b/main/images/p11j.png new file mode 100644 index 0000000..33723f3 Binary files /dev/null and b/main/images/p11j.png differ diff --git a/main/images/p11j.svg b/main/images/p11j.svg new file mode 100644 index 0000000..8aafd2a --- /dev/null +++ b/main/images/p11j.svg @@ -0,0 +1,46 @@ + + + + +16Plan de travail 1 + + + + + + + + + + + + + + + + + + diff --git a/main/images/p11n.png b/main/images/p11n.png new file mode 100644 index 0000000..33723f3 Binary files /dev/null and b/main/images/p11n.png differ diff --git a/main/images/p11n.svg b/main/images/p11n.svg new file mode 100644 index 0000000..d436eb0 --- /dev/null +++ b/main/images/p11n.svg @@ -0,0 +1,46 @@ + + + + +16Plan de travail 1 + + + + + + + + + + + + + + + + + + diff --git a/main/images/p12j.png b/main/images/p12j.png new file mode 100644 index 0000000..f8ed806 Binary files /dev/null and b/main/images/p12j.png differ diff --git a/main/images/p12j.svg b/main/images/p12j.svg new file mode 100644 index 0000000..89eab7f --- /dev/null +++ b/main/images/p12j.svg @@ -0,0 +1 @@ +17Plan de travail 1 \ No newline at end of file diff --git a/main/images/p12n.png b/main/images/p12n.png new file mode 100644 index 0000000..7a7a9d5 Binary files /dev/null and b/main/images/p12n.png differ diff --git a/main/images/p12n.svg b/main/images/p12n.svg new file mode 100644 index 0000000..251e569 --- /dev/null +++ b/main/images/p12n.svg @@ -0,0 +1 @@ +18Plan de travail 1 \ No newline at end of file diff --git a/main/images/p13j.png b/main/images/p13j.png new file mode 100644 index 0000000..c5adf8c Binary files /dev/null and b/main/images/p13j.png differ diff --git a/main/images/p13j.svg b/main/images/p13j.svg new file mode 100644 index 0000000..eeab9da --- /dev/null +++ b/main/images/p13j.svg @@ -0,0 +1,45 @@ + + + + +19Plan de travail 1 + + + + + + + + + + + + + + + + diff --git a/main/images/p13n.png b/main/images/p13n.png new file mode 100644 index 0000000..c5adf8c Binary files /dev/null and b/main/images/p13n.png differ diff --git a/main/images/p13n.svg b/main/images/p13n.svg new file mode 100644 index 0000000..1e0ab84 --- /dev/null +++ b/main/images/p13n.svg @@ -0,0 +1,45 @@ + + + + +19Plan de travail 1 + + + + + + + + + + + + + + + + diff --git a/main/images/p14n.png b/main/images/p14n.png new file mode 100644 index 0000000..5054cde Binary files /dev/null and b/main/images/p14n.png differ diff --git a/main/images/p14n.svg b/main/images/p14n.svg new file mode 100644 index 0000000..ec8394d --- /dev/null +++ b/main/images/p14n.svg @@ -0,0 +1,55 @@ + + + + +22Plan de travail 1 + + + + + + + + + + + + + + + + + + + + + diff --git a/main/images/p15j.png b/main/images/p15j.png new file mode 100644 index 0000000..1f9b1e8 Binary files /dev/null and b/main/images/p15j.png differ diff --git a/main/images/p15j.svg b/main/images/p15j.svg new file mode 100644 index 0000000..5e93c4c --- /dev/null +++ b/main/images/p15j.svg @@ -0,0 +1,33 @@ + + + + +23Plan de travail 1 + + + + + + + + + + + diff --git a/main/images/p15n.png b/main/images/p15n.png new file mode 100644 index 0000000..1f9b1e8 Binary files /dev/null and b/main/images/p15n.png differ diff --git a/main/images/p15n.svg b/main/images/p15n.svg new file mode 100644 index 0000000..578494c --- /dev/null +++ b/main/images/p15n.svg @@ -0,0 +1,33 @@ + + + + +23Plan de travail 1 + + + + + + + + + + + diff --git a/main/images/p16j.png b/main/images/p16j.png new file mode 100644 index 0000000..a3fd4f9 Binary files /dev/null and b/main/images/p16j.png differ diff --git a/main/images/p16j.svg b/main/images/p16j.svg new file mode 100644 index 0000000..5ce591b --- /dev/null +++ b/main/images/p16j.svg @@ -0,0 +1,47 @@ + + + + +26Plan de travail 1 + + + + + + + + + + + + + + + + + diff --git a/main/images/p16n.png b/main/images/p16n.png new file mode 100644 index 0000000..a3fd4f9 Binary files /dev/null and b/main/images/p16n.png differ diff --git a/main/images/p16n.svg b/main/images/p16n.svg new file mode 100644 index 0000000..8774a4b --- /dev/null +++ b/main/images/p16n.svg @@ -0,0 +1,47 @@ + + + + +26Plan de travail 1 + + + + + + + + + + + + + + + + + diff --git a/main/images/p17j.png b/main/images/p17j.png new file mode 100644 index 0000000..e88c19d Binary files /dev/null and b/main/images/p17j.png differ diff --git a/main/images/p17j.svg b/main/images/p17j.svg new file mode 100644 index 0000000..8228888 --- /dev/null +++ b/main/images/p17j.svg @@ -0,0 +1 @@ +27Plan de travail 1 \ No newline at end of file diff --git a/main/images/p17n.png b/main/images/p17n.png new file mode 100644 index 0000000..243ab07 Binary files /dev/null and b/main/images/p17n.png differ diff --git a/main/images/p17n.svg b/main/images/p17n.svg new file mode 100644 index 0000000..1f280ff --- /dev/null +++ b/main/images/p17n.svg @@ -0,0 +1 @@ +28Plan de travail 1 \ No newline at end of file diff --git a/main/images/p18j.png b/main/images/p18j.png new file mode 100644 index 0000000..26903ef Binary files /dev/null and b/main/images/p18j.png differ diff --git a/main/images/p18j.svg b/main/images/p18j.svg new file mode 100644 index 0000000..330632c --- /dev/null +++ b/main/images/p18j.svg @@ -0,0 +1,33 @@ + + + + +29Plan de travail 1 + + + + + + + + + diff --git a/main/images/p18n.png b/main/images/p18n.png new file mode 100644 index 0000000..26903ef Binary files /dev/null and b/main/images/p18n.png differ diff --git a/main/images/p18n.svg b/main/images/p18n.svg new file mode 100644 index 0000000..4f17381 --- /dev/null +++ b/main/images/p18n.svg @@ -0,0 +1,33 @@ + + + + +29Plan de travail 1 + + + + + + + + + diff --git a/main/images/p19j.png b/main/images/p19j.png new file mode 100644 index 0000000..2dcf66e Binary files /dev/null and b/main/images/p19j.png differ diff --git a/main/images/p19j.svg b/main/images/p19j.svg new file mode 100644 index 0000000..5e949b7 --- /dev/null +++ b/main/images/p19j.svg @@ -0,0 +1 @@ +30Plan de travail 1 \ No newline at end of file diff --git a/main/images/p19n.png b/main/images/p19n.png new file mode 100644 index 0000000..51b7ee2 Binary files /dev/null and b/main/images/p19n.png differ diff --git a/main/images/p19n.svg b/main/images/p19n.svg new file mode 100644 index 0000000..c4868fe --- /dev/null +++ b/main/images/p19n.svg @@ -0,0 +1 @@ +31Plan de travail 1 \ No newline at end of file diff --git a/main/images/p20j.png b/main/images/p20j.png new file mode 100644 index 0000000..0fff270 Binary files /dev/null and b/main/images/p20j.png differ diff --git a/main/images/p20j.svg b/main/images/p20j.svg new file mode 100644 index 0000000..02b2327 --- /dev/null +++ b/main/images/p20j.svg @@ -0,0 +1,58 @@ + + + + +32Plan de travail 1 + + + + + + + + + + + + + + + + + + + + + diff --git a/main/images/p20n.png b/main/images/p20n.png new file mode 100644 index 0000000..0fff270 Binary files /dev/null and b/main/images/p20n.png differ diff --git a/main/images/p20n.svg b/main/images/p20n.svg new file mode 100644 index 0000000..f1275b6 --- /dev/null +++ b/main/images/p20n.svg @@ -0,0 +1,58 @@ + + + + +32Plan de travail 1 + + + + + + + + + + + + + + + + + + + + + diff --git a/main/images/p21j.png b/main/images/p21j.png new file mode 100644 index 0000000..38e32da Binary files /dev/null and b/main/images/p21j.png differ diff --git a/main/images/p21j.svg b/main/images/p21j.svg new file mode 100644 index 0000000..78e2542 --- /dev/null +++ b/main/images/p21j.svg @@ -0,0 +1 @@ +33Plan de travail 1 \ No newline at end of file diff --git a/main/images/p21n.png b/main/images/p21n.png new file mode 100644 index 0000000..f74cad9 Binary files /dev/null and b/main/images/p21n.png differ diff --git a/main/images/p21n.svg b/main/images/p21n.svg new file mode 100644 index 0000000..25f645a --- /dev/null +++ b/main/images/p21n.svg @@ -0,0 +1 @@ +34Plan de travail 1 \ No newline at end of file diff --git a/main/images/p22j.png b/main/images/p22j.png new file mode 100644 index 0000000..820bdd9 Binary files /dev/null and b/main/images/p22j.png differ diff --git a/main/images/p22j.svg b/main/images/p22j.svg new file mode 100644 index 0000000..d3081d2 --- /dev/null +++ b/main/images/p22j.svg @@ -0,0 +1 @@ +35Plan de travail 1 \ No newline at end of file diff --git a/main/images/p22n.png b/main/images/p22n.png new file mode 100644 index 0000000..820bdd9 Binary files /dev/null and b/main/images/p22n.png differ diff --git a/main/images/p22n.svg b/main/images/p22n.svg new file mode 100644 index 0000000..d3081d2 --- /dev/null +++ b/main/images/p22n.svg @@ -0,0 +1 @@ +35Plan de travail 1 \ No newline at end of file diff --git a/main/images/p23j.png b/main/images/p23j.png new file mode 100644 index 0000000..82f7b10 Binary files /dev/null and b/main/images/p23j.png differ diff --git a/main/images/p23j.svg b/main/images/p23j.svg new file mode 100644 index 0000000..4147a79 --- /dev/null +++ b/main/images/p23j.svg @@ -0,0 +1 @@ +36Plan de travail 1 \ No newline at end of file diff --git a/main/images/p23n.png b/main/images/p23n.png new file mode 100644 index 0000000..82f7b10 Binary files /dev/null and b/main/images/p23n.png differ diff --git a/main/images/p23n.svg b/main/images/p23n.svg new file mode 100644 index 0000000..4147a79 --- /dev/null +++ b/main/images/p23n.svg @@ -0,0 +1 @@ +36Plan de travail 1 \ No newline at end of file diff --git a/main/images/p24n.png b/main/images/p24n.png new file mode 100644 index 0000000..93efeff Binary files /dev/null and b/main/images/p24n.png differ diff --git a/main/images/p24n.svg b/main/images/p24n.svg new file mode 100644 index 0000000..9f33dc4 --- /dev/null +++ b/main/images/p24n.svg @@ -0,0 +1 @@ +38Plan de travail 1 \ No newline at end of file diff --git a/main/images/p25n.png b/main/images/p25n.png new file mode 100644 index 0000000..56361d9 Binary files /dev/null and b/main/images/p25n.png differ diff --git a/main/images/p25n.svg b/main/images/p25n.svg new file mode 100644 index 0000000..3c749a7 --- /dev/null +++ b/main/images/p25n.svg @@ -0,0 +1 @@ +39Plan de travail 1 \ No newline at end of file diff --git a/main/images/p26j.svg.1 b/main/images/p26j.svg.1 deleted file mode 100644 index 8190304..0000000 --- a/main/images/p26j.svg.1 +++ /dev/null @@ -1 +0,0 @@ -40Plan de travail 1 \ No newline at end of file diff --git a/main/images/p27n.png b/main/images/p27n.png new file mode 100644 index 0000000..97ba1cb Binary files /dev/null and b/main/images/p27n.png differ diff --git a/main/images/p27n.svg b/main/images/p27n.svg new file mode 100644 index 0000000..75ba956 --- /dev/null +++ b/main/images/p27n.svg @@ -0,0 +1 @@ +42Plan de travail 1 \ No newline at end of file diff --git a/main/images/p28j.png b/main/images/p28j.png new file mode 100644 index 0000000..24e0e49 Binary files /dev/null and b/main/images/p28j.png differ diff --git a/main/images/p28j.svg b/main/images/p28j.svg new file mode 100644 index 0000000..c13afb9 --- /dev/null +++ b/main/images/p28j.svg @@ -0,0 +1 @@ +43Plan de travail 1 \ No newline at end of file diff --git a/main/images/p28n.png b/main/images/p28n.png new file mode 100644 index 0000000..2546521 Binary files /dev/null and b/main/images/p28n.png differ diff --git a/main/images/p28n.svg b/main/images/p28n.svg new file mode 100644 index 0000000..9c117fc --- /dev/null +++ b/main/images/p28n.svg @@ -0,0 +1 @@ +44Plan de travail 1 \ No newline at end of file diff --git a/main/images/p29n.png b/main/images/p29n.png new file mode 100644 index 0000000..865932a Binary files /dev/null and b/main/images/p29n.png differ diff --git a/main/images/p29n.svg b/main/images/p29n.svg new file mode 100644 index 0000000..40dc7ff --- /dev/null +++ b/main/images/p29n.svg @@ -0,0 +1 @@ +45Plan de travail 1 \ No newline at end of file diff --git a/main/images/p30j.png b/main/images/p30j.png new file mode 100644 index 0000000..b74b5fe Binary files /dev/null and b/main/images/p30j.png differ diff --git a/main/images/p30j.svg b/main/images/p30j.svg new file mode 100644 index 0000000..5417c00 --- /dev/null +++ b/main/images/p30j.svg @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + diff --git a/main/images/p30n.png b/main/images/p30n.png new file mode 100644 index 0000000..5f587e7 Binary files /dev/null and b/main/images/p30n.png differ diff --git a/main/images/p30n.svg b/main/images/p30n.svg new file mode 100644 index 0000000..85f1a1c --- /dev/null +++ b/main/images/p30n.svg @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/main/images/p31j.png b/main/images/p31j.png new file mode 100644 index 0000000..5007106 Binary files /dev/null and b/main/images/p31j.png differ diff --git a/main/images/p31j.svg b/main/images/p31j.svg new file mode 100644 index 0000000..7e4d761 --- /dev/null +++ b/main/images/p31j.svg @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/main/images/p31n.png b/main/images/p31n.png new file mode 100644 index 0000000..5007106 Binary files /dev/null and b/main/images/p31n.png differ diff --git a/main/images/p31n.svg b/main/images/p31n.svg new file mode 100644 index 0000000..a41814b --- /dev/null +++ b/main/images/p31n.svg @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/main/images/p32j.png b/main/images/p32j.png new file mode 100644 index 0000000..05ea58c Binary files /dev/null and b/main/images/p32j.png differ diff --git a/main/images/p32j.svg b/main/images/p32j.svg new file mode 100644 index 0000000..28ba3a1 --- /dev/null +++ b/main/images/p32j.svg @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/main/images/p32n.png b/main/images/p32n.png new file mode 100644 index 0000000..05ea58c Binary files /dev/null and b/main/images/p32n.png differ diff --git a/main/images/p32n.svg b/main/images/p32n.svg new file mode 100644 index 0000000..61adce4 --- /dev/null +++ b/main/images/p32n.svg @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/main/images/p3n.png b/main/images/p3n.png new file mode 100644 index 0000000..bd9eb1a Binary files /dev/null and b/main/images/p3n.png differ diff --git a/main/images/p3n.svg b/main/images/p3n.svg new file mode 100644 index 0000000..4b8548f --- /dev/null +++ b/main/images/p3n.svg @@ -0,0 +1 @@ +7Plan de travail 1 \ No newline at end of file diff --git a/main/images/p5bisj.png b/main/images/p5bisj.png new file mode 100644 index 0000000..8c55f74 Binary files /dev/null and b/main/images/p5bisj.png differ diff --git a/main/images/p5bisj.svg b/main/images/p5bisj.svg new file mode 100644 index 0000000..c8e71fa --- /dev/null +++ b/main/images/p5bisj.svg @@ -0,0 +1,26 @@ + + + + +8Plan de travail 1 + + + + + + + + + diff --git a/main/images/p5bisj.svg.1 b/main/images/p5bisj.svg.1 new file mode 100644 index 0000000..c8e71fa --- /dev/null +++ b/main/images/p5bisj.svg.1 @@ -0,0 +1,26 @@ + + + + +8Plan de travail 1 + + + + + + + + + diff --git a/main/images/p5j.png b/main/images/p5j.png new file mode 100644 index 0000000..281fa7f Binary files /dev/null and b/main/images/p5j.png differ diff --git a/main/images/p5j.svg b/main/images/p5j.svg new file mode 100644 index 0000000..fe65180 --- /dev/null +++ b/main/images/p5j.svg @@ -0,0 +1 @@ +8Plan de travail 1 \ No newline at end of file diff --git a/main/images/p5n.png b/main/images/p5n.png new file mode 100644 index 0000000..f39b708 Binary files /dev/null and b/main/images/p5n.png differ diff --git a/main/images/p5n.svg b/main/images/p5n.svg new file mode 100644 index 0000000..bc31ca3 --- /dev/null +++ b/main/images/p5n.svg @@ -0,0 +1 @@ +9Plan de travail 1 \ No newline at end of file diff --git a/main/images/p6j.png b/main/images/p6j.png new file mode 100644 index 0000000..246da99 Binary files /dev/null and b/main/images/p6j.png differ diff --git a/main/images/p6j.svg b/main/images/p6j.svg new file mode 100644 index 0000000..4e18b10 --- /dev/null +++ b/main/images/p6j.svg @@ -0,0 +1,22 @@ + + + + +10Plan de travail 1 + + + + + + + diff --git a/main/images/p6n.png b/main/images/p6n.png new file mode 100644 index 0000000..246da99 Binary files /dev/null and b/main/images/p6n.png differ diff --git a/main/images/p6n.svg b/main/images/p6n.svg new file mode 100644 index 0000000..e30e77a --- /dev/null +++ b/main/images/p6n.svg @@ -0,0 +1,22 @@ + + + + +10Plan de travail 1 + + + + + + + diff --git a/main/images/p7j.png b/main/images/p7j.png new file mode 100644 index 0000000..e75ff9e Binary files /dev/null and b/main/images/p7j.png differ diff --git a/main/images/p7j.svg b/main/images/p7j.svg new file mode 100644 index 0000000..6aa374d --- /dev/null +++ b/main/images/p7j.svg @@ -0,0 +1,34 @@ + + + + +11Plan de travail 1 + + + + + + + + + + + + + diff --git a/main/images/p7n.png b/main/images/p7n.png new file mode 100644 index 0000000..e75ff9e Binary files /dev/null and b/main/images/p7n.png differ diff --git a/main/images/p7n.svg b/main/images/p7n.svg new file mode 100644 index 0000000..c1c86d8 --- /dev/null +++ b/main/images/p7n.svg @@ -0,0 +1,34 @@ + + + + +11Plan de travail 1 + + + + + + + + + + + + + diff --git a/main/images/p8j.png b/main/images/p8j.png new file mode 100644 index 0000000..7c09d37 Binary files /dev/null and b/main/images/p8j.png differ diff --git a/main/images/p8j.svg b/main/images/p8j.svg new file mode 100644 index 0000000..e80f3db --- /dev/null +++ b/main/images/p8j.svg @@ -0,0 +1,45 @@ + + + + +12Plan de travail 1 + + + + + + + + + + + + + + + + + + diff --git a/main/images/p8n.png b/main/images/p8n.png new file mode 100644 index 0000000..7c09d37 Binary files /dev/null and b/main/images/p8n.png differ diff --git a/main/images/p8n.svg b/main/images/p8n.svg new file mode 100644 index 0000000..9b0c280 --- /dev/null +++ b/main/images/p8n.svg @@ -0,0 +1,45 @@ + + + + +12Plan de travail 1 + + + + + + + + + + + + + + + + + + diff --git a/main/images/p9j.png b/main/images/p9j.png new file mode 100644 index 0000000..8ac0732 Binary files /dev/null and b/main/images/p9j.png differ diff --git a/main/images/p9j.svg b/main/images/p9j.svg new file mode 100644 index 0000000..f6cdfdf --- /dev/null +++ b/main/images/p9j.svg @@ -0,0 +1,51 @@ + + + + +13Plan de travail 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/main/images/p9n.png b/main/images/p9n.png new file mode 100644 index 0000000..8ac0732 Binary files /dev/null and b/main/images/p9n.png differ diff --git a/main/images/p9n.svg b/main/images/p9n.svg new file mode 100644 index 0000000..8a6782d --- /dev/null +++ b/main/images/p9n.svg @@ -0,0 +1,51 @@ + + + + +13Plan de travail 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/main/main.c b/main/main.c index d4e6871..1f96066 100644 --- a/main/main.c +++ b/main/main.c @@ -188,7 +188,7 @@ static esp_err_t app_lvgl_init(void) /* Initialize LVGL */ const lvgl_port_cfg_t lvgl_cfg = { .task_priority = 4, /* LVGL task priority */ - .task_stack = 6144, /* LVGL task stack size */ + .task_stack = 12288,//6144, /* LVGL task stack size */ .task_affinity = -1, /* LVGL task pinned to core (-1 is no affinity) */ .task_max_sleep_ms = 500, /* Maximum sleep in LVGL task */ .timer_period_ms = 5 /* LVGL timer tick period in ms */ @@ -256,17 +256,18 @@ static esp_err_t app_lvgl_init(void) static void _app_button_cb(lv_event_t *e) { - lvgl_port_lock(0); - lv_disp_rotation_t rotation = lv_disp_get_rotation(lvgl_disp); - rotation++; - if (rotation > LV_DISPLAY_ROTATION_270) - { - rotation = LV_DISPLAY_ROTATION_0; - } + if(lvgl_port_lock(0)){ + lv_disp_rotation_t rotation = lv_disp_get_rotation(lvgl_disp); + rotation++; + if (rotation > LV_DISPLAY_ROTATION_270) + { + rotation = LV_DISPLAY_ROTATION_0; + } - /* LCD HW rotation */ - lv_disp_set_rotation(lvgl_disp, rotation); - lvgl_port_unlock(); + /* LCD HW rotation */ + lv_disp_set_rotation(lvgl_disp, rotation); + lvgl_port_unlock(); + } } static void app_main_display(void) @@ -351,6 +352,7 @@ static void event_handler(lv_event_t *e) LV_IMAGE_DECLARE(p1j); LV_IMAGE_DECLARE(p2j); LV_IMAGE_DECLARE(p3j); +LV_IMAGE_DECLARE(p5bisj); LV_IMAGE_DECLARE(p14j); LV_IMAGE_DECLARE(p24j); LV_IMAGE_DECLARE(p25j); @@ -362,6 +364,7 @@ static void weatherdata_obs_cb(lv_observer_t *observer, lv_subject_t *subject) { // Retrieve weatherdata struct meteoforecast_data *data = subject->value.pointer; + printffd(data); char buff[40] = {}; // sprintf(buff,"%s %.1f %.1f", data->previsions.desc, data->previsions.min, data->previsions.max); lv_obj_t *parent = (lv_obj_t *)(observer->target); @@ -376,6 +379,9 @@ static void weatherdata_obs_cb(lv_observer_t *observer, lv_subject_t *subject) }else if (strcmp(data->previsions.icon, "p3j") == 0) { lv_image_set_src(lv_obj_get_child(desc_icon, 0), &p3j); + }else if (strcmp(data->previsions.icon, "p5bisj") == 0) + { + lv_image_set_src(lv_obj_get_child(desc_icon, 0), &p5bisj); }else if (strcmp(data->previsions.icon, "p14j") == 0) { lv_image_set_src(lv_obj_get_child(desc_icon, 0), &p14j); @@ -453,6 +459,7 @@ static lv_obj_t *weatherDay_fragment_create_obj(lv_fragment_t *self, lv_obj_t *p lv_obj_align(img1, LV_ALIGN_CENTER, 0, 0); lv_obj_t *desc = lv_label_create(container); + lv_label_set_text(desc,"--"); lv_obj_add_style(desc, &style_font_12, 0); lv_obj_t *container2 = lv_obj_create(sup); @@ -469,10 +476,12 @@ static lv_obj_t *weatherDay_fragment_create_obj(lv_fragment_t *self, lv_obj_t *p //lv_style_set_text_font(&tempStyle,¬omedium16); lv_obj_t *max = lv_label_create(container2); + lv_label_set_text(max,"--"); lv_obj_add_style(max, &tempStyle,0); lv_obj_add_style(max, &style_font_16, 0); lv_obj_set_style_text_color(max,lv_color_hex(0xFF0000),0); lv_obj_t *min = lv_label_create(container2); + lv_label_set_text(min,"--"); lv_obj_add_style(min, &tempStyle,0); lv_obj_add_style(min, &style_font_16, 0); lv_obj_set_style_text_color(min,lv_color_hex(0x3000FF),0); @@ -502,6 +511,32 @@ void draw_ihm() // keys.clear(); lv_obj_clean(lv_scr_act()); + /*Create a Tab view object*/ + lv_obj_t * tabview; + tabview = lv_tabview_create(lv_screen_active()); + lv_tabview_set_tab_bar_position(tabview, LV_DIR_LEFT); + lv_tabview_set_tab_bar_size(tabview, 80); + + lv_obj_set_style_bg_color(tabview, lv_palette_lighten(LV_PALETTE_RED, 2), 0); + + + lv_obj_t * tab_buttons = lv_tabview_get_tab_bar(tabview); + lv_obj_set_style_text_font(tab_buttons, &montserrat_medium_18, 0); + lv_obj_set_style_bg_color(tab_buttons, lv_palette_darken(LV_PALETTE_GREY, 3), 0); + lv_obj_set_style_text_color(tab_buttons, lv_palette_lighten(LV_PALETTE_GREY, 5), 0); + lv_obj_set_style_border_side(tab_buttons, LV_BORDER_SIDE_RIGHT, LV_PART_ITEMS | LV_STATE_CHECKED); + + /*Add 3 tabs (the tabs are page (lv_page) and can be scrolled*/ + lv_obj_t * tab1 = lv_tabview_add_tab(tabview, LV_SYMBOL_HOME); + lv_obj_t * tab2 = lv_tabview_add_tab(tabview, "Volets"); + lv_obj_t * tab3 = lv_tabview_add_tab(tabview, "Météo"); + lv_obj_t * tab4 = lv_tabview_add_tab(tabview, "Cuve"); + lv_obj_t * tab5 = lv_tabview_add_tab(tabview, "Réglages"); + + lv_obj_set_style_bg_color(tab2, lv_palette_lighten(LV_PALETTE_AMBER, 3), 0); + lv_obj_set_style_bg_opa(tab2, LV_OPA_COVER, 0); + + static lv_style_t style_btn; lv_style_init(&style_btn); @@ -530,13 +565,15 @@ void draw_ihm() static lv_style_t style_lbvValue; lv_style_init(&style_lbvValue); + lv_obj_t *main = tab1; + lv_style_set_text_font(&style_lbvValue, &lv_font_montserrat_40); - lv_obj_set_flex_flow(lv_screen_active(), LV_FLEX_FLOW_ROW); - lv_obj_set_style_pad_column(lv_screen_active(), 1, 0); + lv_obj_set_flex_flow(tab1, LV_FLEX_FLOW_ROW); + lv_obj_set_style_pad_column(tab1, 1, 0); /*Create a container with COLUMN flex direction*/ - lv_obj_t *cont_col = lv_obj_create(lv_screen_active()); + lv_obj_t *cont_col = lv_obj_create(tab1); lv_obj_set_style_pad_all(cont_col, 5, 0); lv_obj_set_size(cont_col, 250, 480); lv_obj_align(cont_col, LV_ALIGN_TOP_LEFT, 0, 0); @@ -544,12 +581,12 @@ void draw_ihm() lv_obj_set_flex_align(cont_col,LV_FLEX_ALIGN_CENTER,LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_CENTER); /*Create a container with COLUMN flex direction*/ - lv_obj_t *cont_col2 = lv_obj_create(lv_screen_active()); + lv_obj_t *cont_col2 = lv_obj_create(tab1); lv_obj_set_style_pad_all(cont_col2, 5, 0); lv_obj_set_flex_align(cont_col2, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_CENTER); /*Create a container with COLUMN flex direction*/ - lv_obj_t *cont_col3 = lv_obj_create(lv_screen_active()); + lv_obj_t *cont_col3 = lv_obj_create(tab1); lv_obj_set_style_pad_all(cont_col3, 5, 0); lv_obj_set_size(cont_col3, 300, 480); lv_obj_set_flex_flow(cont_col3, LV_FLEX_FLOW_COLUMN); @@ -623,7 +660,7 @@ void draw_ihm() /*Create a chart*/ /* - chart = lv_chart_create(lv_screen_active()); + chart = lv_chart_create(tab1); lv_obj_set_size(chart, 200, 200); lv_chart_set_type(chart, LV_CHART_TYPE_LINE); //Show lines and points too lv_chart_set_range(chart, LV_CHART_AXIS_PRIMARY_Y, 0, 130); @@ -1024,10 +1061,12 @@ void weather_data_retreived(struct meteoforecast_data datas[3]) if (lvgl_port_lock(0)) { - lv_subject_set_pointer(&tempD1Subj, &datas[0]); + ESP_LOGE(TAG, "------------------------------------- Set des subjects --------------------------------"); + lv_subject_set_pointer(&tempD1Subj, &datas[0]); lv_subject_set_pointer(&tempD2Subj, &datas[1]); lv_subject_set_pointer(&tempD3Subj, &datas[2]); lvgl_port_unlock(); + ESP_LOGE(TAG, "------------------------------------- Fin Set des subjects --------------------------------"); } } @@ -1052,9 +1091,10 @@ void app_main(void) ESP_ERROR_CHECK(ret); /* Show LVGL objects */ - lvgl_port_lock(0); - app_main_display(); - lvgl_port_unlock(); + if(lvgl_port_lock(0)){ + app_main_display(); + lvgl_port_unlock(); + } ESP_LOGI(TAG, "ESP_WIFI_MODE_STA"); wifi_init_sta(); mqtt_app_start(); @@ -1064,8 +1104,9 @@ void app_main(void) ESP_LOGW(TAG, "Weather data retrieval initialized"); /* Show LVGL objects */ - lvgl_port_lock(0); - // app_main_display(); - draw_ihm(); - lvgl_port_unlock(); + if(lvgl_port_lock(0)){ + // app_main_display(); + draw_ihm(); + lvgl_port_unlock(); + } }