Page utilities - Line movement

Solves #168
This commit is contained in:
Edward Firmo
2024-03-06 21:20:24 +01:00
parent 2caf2cced4
commit b633ac1fe3
29 changed files with 1266 additions and 479 deletions

View File

@@ -4,12 +4,12 @@ Program.s
int r=0,g=0,b=0
int h=0,s=0,v=0
int p=0,q=0,t=0,f=0
int is_buttonpage01=1, is_buttonpage02=1, is_buttonpage03=1, is_buttonpage04=1
int is_entitypage01=1, is_entitypage02=1, is_entitypage03=1, is_entitypage04=1
int is_buttonpage01=0, is_buttonpage02=0, is_buttonpage03=0, is_buttonpage04=0
int is_entitypage01=0, is_entitypage02=0, is_entitypage03=0, is_entitypage04=0
int back_page_id=0
int dimdelta=0
int api=0 // 0 = disconnected from HA, 1 = connected to HA
int is_entities=0,is_qrcode=0,is_notification=0
int is_qrcode=0,is_notification=0,is_utilities=0
int brightness=100,brightness_dim=40,brightness_sleep=0
int display_mode=2 // 1 = EU, 2 = US, 3 = US landscape, 4 = blank
int charset=2 // 1 = International (original), 2 = CJK

View File

@@ -103,7 +103,7 @@ Text tft_version
Dragging : 0
Send Component ID : on press and release
Associated Keyboard: none
Text : 4.3dev
Text : 4.3dev3
Max. Text Size : 9
Events

View File

@@ -13,9 +13,16 @@ Page home
Events
Preinitialize Event
back_page_id=0
if(is_entitypage01>0||is_entitypage02>0||is_entitypage03>0||is_entitypage04>0)
{
vis bt_entities,1
}else
{
vis bt_entities,0
}
vis bt_notific,is_notification
vis bt_qrcode,is_qrcode
vis bt_entities,is_entities
vis bt_utilities,is_utilities
if(display_mode==3)
{
vis left_bt_text,0
@@ -364,7 +371,22 @@ Text bt_entities
Touch Release Event
if(api==1)
{
page entitypage01
if(is_entitypage01>0)
{
page entitypage01
}else if(is_entitypage02>0)
{
page entitypage02
}else if(is_entitypage03>0)
{
page entitypage03
}else if(is_entitypage04>0)
{
page entitypage04
}else
{
vis bt_entities,0
}
}
Text button07
@@ -590,6 +612,23 @@ Text unavailable
Text :
Max. Text Size : 1
Text bt_utilities
Attributes
ID : 45
Scope : global
Dragging : 0
Send Component ID : on press and release
Associated Keyboard: none
Text :
Max. Text Size : 3
Events
Touch Release Event
if(api==1)
{
page utilities
}
Picture weather
Attributes
ID : 7

View File

@@ -16,34 +16,59 @@ Page utilities
{
page home
}
vis unavailable,0
vis 255,0
vis title_icon,1
vis title,1
vis button_back,1
Postinitialize Event
sendme
Text title
Variable (int32) line_main_d
Attributes
ID : 1
Scope : local
Dragging : 0
Send Component ID : on press and release
Associated Keyboard: none
Text : Power Dashboard
Max. Text Size : 100
ID : 46
Scope: local
Value: 4294967295
Text title_icon
Variable (int32) group01_line_d
Attributes
ID : 2
Scope : local
Dragging : 0
Send Component ID : on press and release
Associated Keyboard: none
Text : 
Max. Text Size : 10
ID : 47
Scope: local
Value: 1
Variable (int32) group02_line_d
Attributes
ID : 48
Scope: local
Value: 4294967295
Variable (int32) group03_line_d
Attributes
ID : 49
Scope: local
Value: 1
Variable (int32) group04_line_d
Attributes
ID : 50
Scope: local
Value: 4294967295
Variable (int32) group05_line_d
Attributes
ID : 51
Scope: local
Value: 1
Variable (int32) group06_line_d
Attributes
ID : 52
Scope: local
Value: 4294967295
Text unavailable
Attributes
ID : 5
ID : 3
Scope : local
Dragging : 0
Send Component ID : disabled
@@ -51,7 +76,27 @@ Text unavailable
Text :
Max. Text Size : 1
Text t1
Text title_icon
Attributes
ID : 4
Scope : local
Dragging : 0
Send Component ID : on press and release
Associated Keyboard: none
Text :
Max. Text Size : 10
Text title
Attributes
ID : 5
Scope : local
Dragging : 0
Send Component ID : on press and release
Associated Keyboard: none
Text :
Max. Text Size : 100
Text home_icon
Attributes
ID : 6
Scope : local
@@ -61,7 +106,7 @@ Text t1
Text : 賈
Max. Text Size : 4
Text t6
Text home_label
Attributes
ID : 7
Scope : local
@@ -71,29 +116,29 @@ Text t6
Text : Home
Max. Text Size : 10
Text t15
Text home
Attributes
ID : 8
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text : 1.7 kW
Text :
Max. Text Size : 10
Text t16
Text homeb
Attributes
ID : 9
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text : 21.7°C
Text :
Max. Text Size : 10
Text t0
Text grid_icon
Attributes
ID : 10
ID : 11
Scope : local
Dragging : 0
Send Component ID : disabled
@@ -101,219 +146,279 @@ Text t0
Text : î´½
Max. Text Size : 4
Text t2
Text grid_label
Attributes
ID : 12
Scope : local
Dragging : 0
Send Component ID : disabled
Send Component ID : on press and release
Associated Keyboard: none
Text : 
Max. Text Size : 4
Text : Grid
Max. Text Size : 10
Text t4
Text grid
Attributes
ID : 13
Scope : local
Dragging : 0
Send Component ID : disabled
Send Component ID : on press and release
Associated Keyboard: none
Text : Green
Text :
Max. Text Size : 10
Text t9
Text gridb
Attributes
ID : 14
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text :
Max. Text Size : 10
Text group01_icon
Attributes
ID : 15
Scope : local
Dragging : 0
Send Component ID : disabled
Send Component ID : on press and release
Associated Keyboard: none
Text : 98%
Max. Text Size : 10
Text : 
Max. Text Size : 4
Text t3
Text group01_label
Attributes
ID : 16
Scope : local
Dragging : 0
Send Component ID : disabled
Send Component ID : on press and release
Associated Keyboard: none
Text : 
Max. Text Size : 4
Text : Label
Max. Text Size : 10
Text t5
Text group01
Attributes
ID : 17
Scope : local
Dragging : 0
Send Component ID : disabled
Send Component ID : on press and release
Associated Keyboard: none
Text : Fossil
Text :
Max. Text Size : 10
Text t10
Text group01b
Attributes
ID : 19
ID : 18
Scope : local
Dragging : 0
Send Component ID : disabled
Send Component ID : on press and release
Associated Keyboard: none
Text : 2%
Text :
Max. Text Size : 10
Text t7
Text group02_icon
Attributes
ID : 20
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text : 全
Text : 
Max. Text Size : 4
Text t8
Text group02_label
Attributes
ID : 21
Scope : local
Dragging : 0
Send Component ID : disabled
Send Component ID : on press and release
Associated Keyboard: none
Text : Solar
Text : Label
Max. Text Size : 10
Text t17
Text group02
Attributes
ID : 22
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text :
Max. Text Size : 10
Text group02b
Attributes
ID : 23
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text : 1.1 kW
Text :
Max. Text Size : 10
Text t20
Attributes
ID : 24
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text : 慎
Max. Text Size : 4
Text t21
Text group03_icon
Attributes
ID : 25
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text : Wind
Text : 
Max. Text Size : 4
Text group03_label
Attributes
ID : 26
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text : Label
Max. Text Size : 10
Text t22
Text group03
Attributes
ID : 27
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text : 1.1 kW
Text :
Max. Text Size : 10
Text t11
Text group03b
Attributes
ID : 28
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text : 豈
Max. Text Size : 4
Text :
Max. Text Size : 10
Text t12
Text group04_icon
Attributes
ID : 29
ID : 30
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text : Battery
Max. Text Size : 10
Text : 
Max. Text Size : 4
Text t18
Text group04_label
Attributes
ID : 31
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text : -2.1 kW
Text : Label
Max. Text Size : 10
Text t23
Text group04
Attributes
ID : 32
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text : î—°
Max. Text Size : 4
Text :
Max. Text Size : 10
Text t24
Text group04b
Attributes
ID : 33
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text : Car
Text :
Max. Text Size : 10
Text t25
Text group05_icon
Attributes
ID : 35
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text : 1.1 kW
Max. Text Size : 10
Text : 
Max. Text Size : 4
Text t13
Text group05_label
Attributes
ID : 36
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text : 暑
Max. Text Size : 4
Text : Label
Max. Text Size : 10
Text t14
Text group05
Attributes
ID : 37
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text : Heating
Text :
Max. Text Size : 10
Text t19
Text group05b
Attributes
ID : 39
ID : 38
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text : 0.8 kW
Text :
Max. Text Size : 10
Slider h0
Text group06_icon
Attributes
ID : 11
ID : 40
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text : 
Max. Text Size : 4
Text group06_label
Attributes
ID : 41
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text : Label
Max. Text Size : 10
Text group06
Attributes
ID : 42
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text :
Max. Text Size : 10
Text group06b
Attributes
ID : 43
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text :
Max. Text Size : 10
Slider line_main
Attributes
ID : 10
Scope : local
Dragging : 0
Send Component ID: disabled
@@ -321,9 +426,19 @@ Slider h0
Upper range limit: 100
Lower range limit: 0
Slider h1
Slider group01_line
Attributes
ID : 14
ID : 19
Scope : local
Dragging : 0
Send Component ID: on press and release
Position : 50
Upper range limit: 100
Lower range limit: 0
Slider group02_line
Attributes
ID : 24
Scope : local
Dragging : 0
Send Component ID: disabled
@@ -331,9 +446,9 @@ Slider h1
Upper range limit: 100
Lower range limit: 0
Slider h2
Slider group03_line
Attributes
ID : 18
ID : 29
Scope : local
Dragging : 0
Send Component ID: disabled
@@ -341,37 +456,7 @@ Slider h2
Upper range limit: 100
Lower range limit: 0
Slider h3
Attributes
ID : 22
Scope : local
Dragging : 0
Send Component ID: disabled
Position : 50
Upper range limit: 100
Lower range limit: 0
Slider h6
Attributes
ID : 26
Scope : local
Dragging : 0
Send Component ID: disabled
Position : 50
Upper range limit: 100
Lower range limit: 0
Slider h4
Attributes
ID : 30
Scope : local
Dragging : 0
Send Component ID: disabled
Position : 50
Upper range limit: 100
Lower range limit: 0
Slider h7
Slider group04_line
Attributes
ID : 34
Scope : local
@@ -381,9 +466,19 @@ Slider h7
Upper range limit: 100
Lower range limit: 0
Slider h5
Slider group05_line
Attributes
ID : 38
ID : 39
Scope : local
Dragging : 0
Send Component ID: disabled
Position : 50
Upper range limit: 100
Lower range limit: 0
Slider group06_line
Attributes
ID : 44
Scope : local
Dragging : 0
Send Component ID: disabled
@@ -393,7 +488,7 @@ Slider h5
Button button_back
Attributes
ID : 3
ID : 2
Scope : local
Dragging : 0
Send Component ID: on release
@@ -403,11 +498,11 @@ Button button_back
Events
Touch Press Event
page back_page_id
page home
Timer wakeup_timer
Attributes
ID : 4
ID : 1
Scope : local
Period (ms): 100
Enabled : yes
@@ -428,3 +523,76 @@ Timer wakeup_timer
wakeup_timer.en=0
}
Timer tm_movement
Attributes
ID : 45
Scope : local
Period (ms): 50
Enabled : yes
Events
Timer Event
//line_main
line_main.val+=line_main_d.val
if(line_main.val>=line_main.maxval)
{
line_main.val=line_main.minval
}else if(line_main.val<=line_main.minval)
{
line_main.val=line_main.maxval
}
//group01_line
group01_line.val+=group01_line_d.val
if(group01_line.val>=group01_line.maxval)
{
group01_line.val=group01_line.minval
}else if(group01_line.val<=group01_line.minval)
{
group01_line.val=group01_line.maxval
}
//group02_line
group02_line.val+=group02_line_d.val
if(group02_line.val>=group02_line.maxval)
{
group02_line.val=group02_line.minval
}else if(group02_line.val<=group02_line.minval)
{
group02_line.val=group02_line.maxval
}
//group03_line
group03_line.val+=group03_line_d.val
if(group03_line.val>=group03_line.maxval)
{
group03_line.val=group03_line.minval
}else if(group03_line.val<=group03_line.minval)
{
group03_line.val=group03_line.maxval
}
//group04_line
group04_line.val+=group04_line_d.val
if(group04_line.val>=group04_line.maxval)
{
group04_line.val=group04_line.minval
}else if(group04_line.val<=group04_line.minval)
{
group04_line.val=group04_line.maxval
}
//group05_line
group05_line.val+=group05_line_d.val
if(group05_line.val>=group05_line.maxval)
{
group05_line.val=group05_line.minval
}else if(group05_line.val<=group05_line.minval)
{
group05_line.val=group05_line.maxval
}
//group06_line
group06_line.val+=group06_line_d.val
if(group06_line.val>=group06_line.maxval)
{
group06_line.val=group06_line.minval
}else if(group06_line.val<=group06_line.minval)
{
group06_line.val=group06_line.maxval
}