Merge branch 'main' of https://github.com/joBr99/nspanel-lovelace-ui (add nextion2text)

This commit is contained in:
joBr99
2022-03-29 07:55:25 +00:00
committed by GitHub Actions
parent b6485cbaa6
commit 63cc293ee7
16 changed files with 3209 additions and 1200 deletions

View File

@@ -20,26 +20,12 @@ Page screensaver
vis tTmp,0
vis p0,0
//load gloabl time string from pageIcons
//tTime.txt=vaTime.txt
spstr vaTime.txt,tTime.txt,"?",0
spstr vaTime.txt,tAMPM.txt,"?",1
if(tAMPM.txt=="")
{
vis tAMPM,0
}
tTime.txt=vaTime.txt
tDate.txt=vaDate.txt
dim=dimValue
vis tSend,0
//page open event
// clear weather elements, to keep example content in HMI
tMainIcon.txt=""
tMainText.txt=""
tForecast1.txt=""
tF1Icon.txt=""
tForecast1Val.txt=""
tForecast2.txt=""
tF2Icon.txt=""
tForecast2Val.txt=""
// craft command
tSend.txt="event,screensaverOpen"
//send calc crc
btlen tSend.txt,sys0
@@ -52,20 +38,31 @@ Page screensaver
prints sys0,2
prints tSend.txt,0
prints crcval,2
// clear weather elements, to keep example content in HMI
tMainIcon.txt=""
tMainText.txt=""
tMRIcon.txt=""
tMR.txt=""
tForecast1.txt=""
tF1Icon.txt=""
tForecast1Val.txt=""
tForecast2.txt=""
tF2Icon.txt=""
tForecast2Val.txt=""
Variable (string) strCommand
Attributes
ID : 5
Scope : local
Text :
Max. Text Size: 200
Max. Text Size: 100
Variable (string) vaTime
Attributes
ID : 10
Scope : global
Text :
Max. Text Size: 15
Max. Text Size: 10
Variable (string) vaDate
Attributes
@@ -76,17 +73,11 @@ Variable (string) vaDate
Variable (string) tId
Attributes
ID : 22
ID : 24
Scope : local
Text :
Max. Text Size: 25
Variable (int32) vaTap
Attributes
ID : 30
Scope: local
Value: 0
Number originPage
Attributes
ID : 3
@@ -106,7 +97,7 @@ Text tInstruction
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 50
Max. Text Size : 20
Text tTmp
Attributes
@@ -117,7 +108,7 @@ Text tTmp
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 50
Max. Text Size : 20
Text tTime
Attributes
@@ -127,8 +118,8 @@ Text tTime
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text : 21:32
Max. Text Size : 15
Text : 21:32
Max. Text Size : 10
Text tDate
Attributes
@@ -150,7 +141,7 @@ Text tSend
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 50
Max. Text Size : 25
Text tMainIcon
Attributes
@@ -174,7 +165,7 @@ Text tMainText
Text : 2,3 °C
Max. Text Size : 10
Text tForecast1
Text tMRIcon
Attributes
ID : 15
Scope : local
@@ -182,12 +173,34 @@ Text tForecast1
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text : 
Max. Text Size : 10
Text tMR
Attributes
ID : 16
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text : 0 mm
Max. Text Size : 10
Text tForecast1
Attributes
ID : 17
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text : Mi
Max. Text Size : 10
Text tForecast1Val
Attributes
ID : 16
ID : 18
Scope : local
Dragging : 0
Disable release event after dragging: 0
@@ -198,7 +211,7 @@ Text tForecast1Val
Text tF1Icon
Attributes
ID : 17
ID : 19
Scope : local
Dragging : 0
Disable release event after dragging: 0
@@ -209,7 +222,7 @@ Text tF1Icon
Text tForecast2
Attributes
ID : 18
ID : 20
Scope : local
Dragging : 0
Disable release event after dragging: 0
@@ -220,7 +233,7 @@ Text tForecast2
Text tF2Icon
Attributes
ID : 19
ID : 21
Scope : local
Dragging : 0
Disable release event after dragging: 0
@@ -231,7 +244,7 @@ Text tF2Icon
Text tForecast2Val
Attributes
ID : 20
ID : 22
Scope : local
Dragging : 0
Disable release event after dragging: 0
@@ -241,17 +254,6 @@ Text tForecast2Val
Max. Text Size : 10
Text t10
Attributes
ID : 21
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text : |
Max. Text Size : 10
Text tAMPM
Attributes
ID : 23
Scope : local
@@ -259,73 +261,7 @@ Text tAMPM
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text : PM
Max. Text Size : 10
Text tForecast3Val
Attributes
ID : 24
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 10
Text tF3Icon
Attributes
ID : 25
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 10
Text tForecast3
Attributes
ID : 26
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 10
Text tForecast4
Attributes
ID : 27
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 10
Text tF4Icon
Attributes
ID : 28
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 10
Text tForecast4Val
Attributes
ID : 29
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Text : |
Max. Text Size : 10
Picture p0
@@ -404,12 +340,7 @@ Timer tmSerial
{
//get set time to global variable
spstr strCommand.txt,vaTime.txt,",",1
spstr vaTime.txt,tTime.txt,"?",0
spstr vaTime.txt,tAMPM.txt,"?",1
if(tAMPM.txt=="")
{
vis tAMPM,0
}
tTime.txt=vaTime.txt
}
if(tInstruction.txt=="date")
{
@@ -431,38 +362,36 @@ Timer tmSerial
substr pageIcons.tIcons.txt,tMainIcon.txt,sys0,1
//tMainText
spstr strCommand.txt,tMainText.txt,"?",2
//tMRIcon
spstr strCommand.txt,tTmp.txt,"?",3
covx tTmp.txt,sys0,0,0
substr pageIcons.tIcons.txt,tMRIcon.txt,sys0,1
//tMR
spstr strCommand.txt,tMR.txt,"?",4
//tForecast1
spstr strCommand.txt,tForecast1.txt,"?",3
spstr strCommand.txt,tForecast1.txt,"?",5
//tF1Icon
spstr strCommand.txt,tTmp.txt,"?",4
spstr strCommand.txt,tTmp.txt,"?",6
covx tTmp.txt,sys0,0,0
substr pageIcons.tIcons.txt,tF1Icon.txt,sys0,1
//tForecast1Val
spstr strCommand.txt,tForecast1Val.txt,"?",5
spstr strCommand.txt,tForecast1Val.txt,"?",7
//tForecast2
spstr strCommand.txt,tForecast2.txt,"?",6
spstr strCommand.txt,tForecast2.txt,"?",8
//tF2Icon
spstr strCommand.txt,tTmp.txt,"?",7
spstr strCommand.txt,tTmp.txt,"?",9
covx tTmp.txt,sys0,0,0
substr pageIcons.tIcons.txt,tF2Icon.txt,sys0,1
//tForecast2Val
spstr strCommand.txt,tForecast2Val.txt,"?",8
//tForecast3
spstr strCommand.txt,tForecast3.txt,"?",9
//tF3Icon
spstr strCommand.txt,tTmp.txt,"?",10
spstr strCommand.txt,tForecast2Val.txt,"?",10
}
if(tInstruction.txt=="page")
{
//pagenumber
spstr strCommand.txt,tTmp.txt,",",1
covx tTmp.txt,sys0,0,0
substr pageIcons.tIcons.txt,tF3Icon.txt,sys0,1
//tForecast3Val
spstr strCommand.txt,tForecast3Val.txt,"?",11
//tForecast4
spstr strCommand.txt,tForecast4.txt,"?",12
//tF4Icon
spstr strCommand.txt,tTmp.txt,"?",13
covx tTmp.txt,sys0,0,0
substr pageIcons.tIcons.txt,tF4Icon.txt,sys0,1
//tForecast4Val
spstr strCommand.txt,tForecast4Val.txt,"?",14
nPage=sys0
//don't send current page number, wake will do
}
if(tInstruction.txt=="pageType")
{
@@ -535,10 +464,12 @@ TouchCap tc0
Events
Touch Press Event
dim=100
vaTap.val+=1
covx vaTap.val,tTmp.txt,0,0
tSend.txt="event,buttonPress2,screensaver,bExit,"+tTmp.txt
//page open event
// event,pageOpen,cardEntities,pageNumber
// craft command
// convert pageNumber and write to tTmp
covx nPage,tTmp.txt,0,0
tSend.txt="event,pageOpen,"+tTmp.txt
//send calc crc
btlen tSend.txt,sys0
crcrest 1,0xffff // reset CRC