Skip to content

Commit

Permalink
Delay scroll in 1s
Browse files Browse the repository at this point in the history
To avoid buffer overflow
  • Loading branch information
edwardtfn committed Oct 26, 2024
1 parent 3833150 commit a064b24
Show file tree
Hide file tree
Showing 19 changed files with 37 additions and 20 deletions.
15 changes: 13 additions & 2 deletions esphome/nspanel_esphome_core_page_boot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,21 @@ script:
- lambda: |-
ESP_LOGI("script.boot_log", "%s: %s", category.c_str(), log_message.c_str());
if (current_page->state == "boot"){
disp1->send_command_printf("log_body.txt+=\"%s: %s\\r\"", category.c_str(), log_message.c_str());
disp1->send_command("click log_box,1");
std::string combined_log = category + ": " + log_message;
if (combined_log.length() > 40) {
combined_log = combined_log.substr(0, 40);
}
disp1->send_command_printf("log_body.txt+=\"%s\\r\"", combined_log.c_str());
boot_log_scroll->execute();
}
- id: boot_log_scroll
mode: restart
then:
- delay: 1s
- lambda: |-
disp1->send_command("click log_box,1");
- id: !extend boot_progress
then:
- lambda: |-
Expand Down
7 changes: 4 additions & 3 deletions hmi/dev/nspanel_CJK_eu_code/boot.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ Text log_body
Send Component ID : disabled
Associated Keyboard: none
Text :
Max. Text Size : 800
Max. Text Size : 1000

Text initializing
Attributes
Expand Down Expand Up @@ -270,6 +270,7 @@ Text log_box
substr log_body.txt,log_body.txt,log_start_pos.val+2,log_len.val-log_start_pos.val-2
}
log_line_count.val--
doevents
}

Text log_title
Expand Down Expand Up @@ -324,11 +325,11 @@ Timer tm_esphome
printh 00
printh FF FF FF
counter.val++
if(counter.val>30)
if(counter.val>360)
{
rest
}
sys0=counter.val%10
sys0=counter.val%60
if(sys0==0)
{
bauds=115200
Expand Down
7 changes: 4 additions & 3 deletions hmi/dev/nspanel_CJK_us_code/boot.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ Text log_body
Send Component ID : disabled
Associated Keyboard: none
Text :
Max. Text Size : 800
Max. Text Size : 1000

Text initializing
Attributes
Expand Down Expand Up @@ -270,6 +270,7 @@ Text log_box
substr log_body.txt,log_body.txt,log_start_pos.val+2,log_len.val-log_start_pos.val-2
}
log_line_count.val--
doevents
}

Text log_title
Expand Down Expand Up @@ -324,11 +325,11 @@ Timer tm_esphome
printh 00
printh FF FF FF
counter.val++
if(counter.val>30)
if(counter.val>360)
{
rest
}
sys0=counter.val%10
sys0=counter.val%60
if(sys0==0)
{
bauds=115200
Expand Down
7 changes: 4 additions & 3 deletions hmi/dev/nspanel_CJK_us_land_code/boot.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ Text log_body
Send Component ID : disabled
Associated Keyboard: none
Text :
Max. Text Size : 800
Max. Text Size : 1000

Text initializing
Attributes
Expand Down Expand Up @@ -270,6 +270,7 @@ Text log_box
substr log_body.txt,log_body.txt,log_start_pos.val+2,log_len.val-log_start_pos.val-2
}
log_line_count.val--
doevents
}

Text log_title
Expand Down Expand Up @@ -324,11 +325,11 @@ Timer tm_esphome
printh 00
printh FF FF FF
counter.val++
if(counter.val>30)
if(counter.val>360)
{
rest
}
sys0=counter.val%10
sys0=counter.val%60
if(sys0==0)
{
bauds=115200
Expand Down
7 changes: 4 additions & 3 deletions hmi/dev/nspanel_eu_code/boot.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ Text log_body
Send Component ID : disabled
Associated Keyboard: none
Text :
Max. Text Size : 800
Max. Text Size : 1000

Text initializing
Attributes
Expand Down Expand Up @@ -270,6 +270,7 @@ Text log_box
substr log_body.txt,log_body.txt,log_start_pos.val+2,log_len.val-log_start_pos.val-2
}
log_line_count.val--
doevents
}

Text log_title
Expand Down Expand Up @@ -324,11 +325,11 @@ Timer tm_esphome
printh 00
printh FF FF FF
counter.val++
if(counter.val>30)
if(counter.val>360)
{
rest
}
sys0=counter.val%10
sys0=counter.val%60
if(sys0==0)
{
bauds=115200
Expand Down
7 changes: 4 additions & 3 deletions hmi/dev/nspanel_us_code/boot.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ Text log_body
Send Component ID : disabled
Associated Keyboard: none
Text :
Max. Text Size : 800
Max. Text Size : 1000

Text initializing
Attributes
Expand Down Expand Up @@ -270,6 +270,7 @@ Text log_box
substr log_body.txt,log_body.txt,log_start_pos.val+2,log_len.val-log_start_pos.val-2
}
log_line_count.val--
doevents
}

Text log_title
Expand Down Expand Up @@ -324,11 +325,11 @@ Timer tm_esphome
printh 00
printh FF FF FF
counter.val++
if(counter.val>30)
if(counter.val>360)
{
rest
}
sys0=counter.val%10
sys0=counter.val%60
if(sys0==0)
{
bauds=115200
Expand Down
7 changes: 4 additions & 3 deletions hmi/dev/nspanel_us_land_code/boot.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ Text log_body
Send Component ID : disabled
Associated Keyboard: none
Text :
Max. Text Size : 800
Max. Text Size : 1000

Text initializing
Attributes
Expand Down Expand Up @@ -270,6 +270,7 @@ Text log_box
substr log_body.txt,log_body.txt,log_start_pos.val+2,log_len.val-log_start_pos.val-2
}
log_line_count.val--
doevents
}

Text log_title
Expand Down Expand Up @@ -324,11 +325,11 @@ Timer tm_esphome
printh 00
printh FF FF FF
counter.val++
if(counter.val>30)
if(counter.val>360)
{
rest
}
sys0=counter.val%10
sys0=counter.val%60
if(sys0==0)
{
bauds=115200
Expand Down
Binary file modified hmi/nspanel_CJK_eu.HMI
Binary file not shown.
Binary file modified hmi/nspanel_CJK_eu.tft
Binary file not shown.
Binary file modified hmi/nspanel_CJK_us.HMI
Binary file not shown.
Binary file modified hmi/nspanel_CJK_us.tft
Binary file not shown.
Binary file modified hmi/nspanel_CJK_us_land.HMI
Binary file not shown.
Binary file modified hmi/nspanel_CJK_us_land.tft
Binary file not shown.
Binary file modified hmi/nspanel_eu.HMI
Binary file not shown.
Binary file modified hmi/nspanel_eu.tft
Binary file not shown.
Binary file modified hmi/nspanel_us.HMI
Binary file not shown.
Binary file modified hmi/nspanel_us.tft
Binary file not shown.
Binary file modified hmi/nspanel_us_land.HMI
Binary file not shown.
Binary file modified hmi/nspanel_us_land.tft
Binary file not shown.

0 comments on commit a064b24

Please sign in to comment.