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

This commit is contained in:
joBr99
2022-03-31 07:32:24 +00:00
committed by GitHub Actions
parent 210efd1384
commit f3933ab0e2
33 changed files with 327 additions and 750 deletions

View File

@@ -10,6 +10,7 @@ Program.s
int sleepValue=0
// dim value
int dimValue=40
// fix touch offset (Removed for US version)
//lcd_dev fffb 0002 0000 0020
int dimValueNormal=100
// fix touch offset
lcd_dev fffb 0002 0000 0020
page pageStartup

View File

@@ -583,12 +583,12 @@ Timer tmSerial
if(tInstruction.txt=="time")
{
// get set time to global variable
spstr strCommand.txt,screensaver.vaTime.txt,",",1
spstr strCommand.txt,pageIcons.vaTime.txt,",",1
}
if(tInstruction.txt=="date")
{
// get set date to global variable
spstr strCommand.txt,screensaver.vaDate.txt,"?",1
spstr strCommand.txt,pageIcons.vaDate.txt,"?",1
}
if(tInstruction.txt=="dimmode")
{
@@ -670,9 +670,20 @@ Timer tmSleep
sleepValue+=1
if(sleepTimeout<=sleepValue)
{
screensaver.originPage.val=dp
sleepValue=0
page screensaver
dim=dimValue
tSend.txt="event,sleepReached,cardAlarm"
//send calc crc
btlen tSend.txt,sys0
crcrest 1,0xffff // reset CRC
crcputh 55 bb
crcputs sys0,1
crcputs tSend.txt,0
//send cmd
printh 55 bb
prints sys0,2
prints tSend.txt,0
prints crcval,2
}
}

View File

@@ -1675,12 +1675,12 @@ Timer tmSerial
if(tInstruction.txt=="time")
{
// get set time to global variable
spstr strCommand.txt,screensaver.vaTime.txt,",",1
spstr strCommand.txt,pageIcons.vaTime.txt,",",1
}
if(tInstruction.txt=="date")
{
// get set date to global variable
spstr strCommand.txt,screensaver.vaDate.txt,"?",1
spstr strCommand.txt,pageIcons.vaDate.txt,"?",1
}
if(tInstruction.txt=="dimmode")
{
@@ -1719,9 +1719,20 @@ Timer tmSleep
sleepValue+=1
if(sleepTimeout<=sleepValue)
{
screensaver.originPage.val=dp
sleepValue=0
page screensaver
dim=dimValue
tSend.txt="event,sleepReached,cardEntities"
//send calc crc
btlen tSend.txt,sys0
crcrest 1,0xffff // reset CRC
crcputh 55 bb
crcputs sys0,1
crcputs tSend.txt,0
//send cmd
printh 55 bb
prints sys0,2
prints tSend.txt,0
prints crcval,2
}
}

View File

@@ -765,12 +765,12 @@ Timer tmSerial
if(tInstruction.txt=="time")
{
// get set time to global variable
spstr strCommand.txt,screensaver.vaTime.txt,",",1
spstr strCommand.txt,pageIcons.vaTime.txt,",",1
}
if(tInstruction.txt=="date")
{
// get set date to global variable
spstr strCommand.txt,screensaver.vaDate.txt,"?",1
spstr strCommand.txt,pageIcons.vaDate.txt,"?",1
}
if(tInstruction.txt=="dimmode")
{
@@ -809,9 +809,20 @@ Timer tmSleep
sleepValue+=1
if(sleepTimeout<=sleepValue)
{
screensaver.originPage.val=dp
sleepValue=0
page screensaver
dim=dimValue
tSend.txt="event,sleepReached,cardGrid"
//send calc crc
btlen tSend.txt,sys0
crcrest 1,0xffff // reset CRC
crcputh 55 bb
crcputs sys0,1
crcputs tSend.txt,0
//send cmd
printh 55 bb
prints sys0,2
prints tSend.txt,0
prints crcval,2
}
}

View File

@@ -551,12 +551,12 @@ Timer tmSerial
if(tInstruction.txt=="time")
{
// get set time to global variable
spstr strCommand.txt,screensaver.vaTime.txt,",",1
spstr strCommand.txt,pageIcons.vaTime.txt,",",1
}
if(tInstruction.txt=="date")
{
// get set date to global variable
spstr strCommand.txt,screensaver.vaDate.txt,"?",1
spstr strCommand.txt,pageIcons.vaDate.txt,"?",1
}
if(tInstruction.txt=="dimmode")
{
@@ -647,9 +647,20 @@ Timer tmSleep
sleepValue+=1
if(sleepTimeout<=sleepValue)
{
screensaver.originPage.val=dp
sleepValue=0
page screensaver
dim=dimValue
tSend.txt="event,sleepReached,cardMedia"
//send calc crc
btlen tSend.txt,sys0
crcrest 1,0xffff // reset CRC
crcputh 55 bb
crcputs sys0,1
crcputs tSend.txt,0
//send cmd
printh 55 bb
prints sys0,2
prints tSend.txt,0
prints crcval,2
}
}

View File

@@ -835,12 +835,12 @@ Timer tmSerial
if(tInstruction.txt=="time")
{
// get set time to global variable
spstr strCommand.txt,screensaver.vaTime.txt,",",1
spstr strCommand.txt,pageIcons.vaTime.txt,",",1
}
if(tInstruction.txt=="date")
{
// get set date to global variable
spstr strCommand.txt,screensaver.vaDate.txt,"?",1
spstr strCommand.txt,pageIcons.vaDate.txt,"?",1
}
if(tInstruction.txt=="dimmode")
{
@@ -921,9 +921,20 @@ Timer tmSleep
sleepValue+=1
if(sleepTimeout<=sleepValue)
{
screensaver.originPage.val=dp
sleepValue=0
page screensaver
dim=dimValue
tSend.txt="event,sleepReached,cardThermo"
//send calc crc
btlen tSend.txt,sys0
crcrest 1,0xffff // reset CRC
crcputh 55 bb
crcputs sys0,1
crcputs tSend.txt,0
//send cmd
printh 55 bb
prints sys0,2
prints tSend.txt,0
prints crcval,2
}
}

View File

@@ -10,6 +10,18 @@ Page pageIcons
Swide left page ID : disabled
Swide right page ID : disabled
Variable (string) vaTime
Attributes
Scope : global
Text :
Max. Text Size: 15
Variable (string) vaDate
Attributes
Scope : global
Text :
Max. Text Size: 30
Text tIcons
Attributes
Scope : global
@@ -17,7 +29,7 @@ Text tIcons
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text : 
Text : 
Max. Text Size : 170
Text tTmp1

View File

@@ -152,7 +152,7 @@ Text tVersion
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text : 23
Text : 24
Max. Text Size : 10
Picture p0
@@ -177,7 +177,7 @@ Button bSendStartup
recmod=1
bauds=115200
// startup event
tSend.txt="event,startup,"+tVersion.txt+",us-l"
tSend.txt="event,startup,"+tVersion.txt+",eu"
//send calc crc
btlen tSend.txt,sys0
crcrest 1,0xffff // reset CRC
@@ -261,12 +261,12 @@ Timer tmSerial
if(tInstruction.txt=="time")
{
// get set time to global variable
spstr strCommand.txt,screensaver.vaTime.txt,",",1
spstr strCommand.txt,pageIcons.vaTime.txt,",",1
}
if(tInstruction.txt=="date")
{
// get set date to global variable
spstr strCommand.txt,screensaver.vaDate.txt,"?",1
spstr strCommand.txt,pageIcons.vaDate.txt,"?",1
}
if(tInstruction.txt=="dimmode")
{

View File

@@ -382,7 +382,6 @@ Timer tmSleep
sleepValue+=1
if(sleepTimeout<=sleepValue)
{
screensaver.originPage.val=dp
sleepValue=0
click b0,1
click b0,0
@@ -542,12 +541,12 @@ Timer tmSerial
if(tInstruction.txt=="time")
{
// get set time to global variable
spstr strCommand.txt,screensaver.vaTime.txt,",",1
spstr strCommand.txt,pageIcons.vaTime.txt,",",1
}
if(tInstruction.txt=="date")
{
// get set date to global variable
spstr strCommand.txt,screensaver.vaDate.txt,"?",1
spstr strCommand.txt,pageIcons.vaDate.txt,"?",1
}
if(tInstruction.txt=="dimmode")
{

View File

@@ -195,7 +195,6 @@ Timer tmSleep
sleepValue+=1
if(sleepTimeout<=sleepValue)
{
screensaver.originPage.val=dp
sleepValue=0
click b0,1
click b0,0
@@ -299,12 +298,12 @@ Timer tmSerial
if(tInstruction.txt=="time")
{
// get set time to global variable
spstr strCommand.txt,screensaver.vaTime.txt,",",1
spstr strCommand.txt,pageIcons.vaTime.txt,",",1
}
if(tInstruction.txt=="date")
{
// get set date to global variable
spstr strCommand.txt,screensaver.vaDate.txt,"?",1
spstr strCommand.txt,pageIcons.vaDate.txt,"?",1
}
if(tInstruction.txt=="dimmode")
{

View File

@@ -268,7 +268,6 @@ Timer tmSleep
sleepValue+=1
if(sleepTimeout<=sleepValue)
{
screensaver.originPage.val=dp
sleepValue=0
click b0,1
click b0,0
@@ -342,12 +341,12 @@ Timer tmSerial
if(tInstruction.txt=="time")
{
// get set time to global variable
spstr strCommand.txt,screensaver.vaTime.txt,",",1
spstr strCommand.txt,pageIcons.vaTime.txt,",",1
}
if(tInstruction.txt=="date")
{
// get set date to global variable
spstr strCommand.txt,screensaver.vaDate.txt,"?",1
spstr strCommand.txt,pageIcons.vaDate.txt,"?",1
}
if(tInstruction.txt=="timeout")
{

View File

@@ -14,19 +14,18 @@ Page screensaver
Preinitialize Event
recmod=1
bauds=115200
vis originPage,0
vis tInstruction,0
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
spstr pageIcons.vaTime.txt,tTime.txt,"?",0
spstr pageIcons.vaTime.txt,tAMPM.txt,"?",1
if(tAMPM.txt=="")
{
vis tAMPM,0
}
tDate.txt=vaDate.txt
tDate.txt=pageIcons.vaDate.txt
dim=dimValue
vis tSend,0
//page open event
@@ -39,18 +38,18 @@ Page screensaver
tForecast2.txt=""
tF2Icon.txt=""
tForecast2Val.txt=""
tSend.txt="event,screensaverOpen"
//tSend.txt="event,screensaverOpen"
//send calc crc
btlen tSend.txt,sys0
crcrest 1,0xffff // reset CRC
crcputh 55 bb
crcputs sys0,1
crcputs tSend.txt,0
//btlen tSend.txt,sys0
//crcrest 1,0xffff // reset CRC
//crcputh 55 bb
//crcputs sys0,1
//crcputs tSend.txt,0
//send cmd
printh 55 bb
prints sys0,2
prints tSend.txt,0
prints crcval,2
//printh 55 bb
//prints sys0,2
//prints tSend.txt,0
//prints crcval,2
Variable (string) strCommand
Attributes
@@ -58,18 +57,6 @@ Variable (string) strCommand
Text :
Max. Text Size: 200
Variable (string) vaTime
Attributes
Scope : global
Text :
Max. Text Size: 15
Variable (string) vaDate
Attributes
Scope : global
Text :
Max. Text Size: 30
Variable (string) tId
Attributes
Scope : local
@@ -81,15 +68,6 @@ Variable (int32) vaTap
Scope: local
Value: 0
Number originPage
Attributes
Scope : global
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Value : 0
Text tInstruction
Attributes
Scope : local
@@ -373,9 +351,9 @@ Timer tmSerial
if(tInstruction.txt=="time")
{
//get set time to global variable
spstr strCommand.txt,vaTime.txt,",",1
spstr vaTime.txt,tTime.txt,"?",0
spstr vaTime.txt,tAMPM.txt,"?",1
spstr strCommand.txt,pageIcons.vaTime.txt,",",1
spstr pageIcons.vaTime.txt,tTime.txt,"?",0
spstr pageIcons.vaTime.txt,tAMPM.txt,"?",1
if(tAMPM.txt=="")
{
vis tAMPM,0
@@ -384,8 +362,8 @@ Timer tmSerial
if(tInstruction.txt=="date")
{
//get set date to global variable
spstr strCommand.txt,vaDate.txt,"?",1
tDate.txt=vaDate.txt
spstr strCommand.txt,pageIcons.vaDate.txt,"?",1
tDate.txt=pageIcons.vaDate.txt
}
if(tInstruction.txt=="timeout")
{
@@ -504,7 +482,7 @@ TouchCap tc0
Events
Touch Press Event
dim=100
dim=dimValueNormal
vaTap.val+=1
covx vaTap.val,tTmp.txt,0,0
tSend.txt="event,buttonPress2,screensaver,bExit,"+tTmp.txt
@@ -519,6 +497,4 @@ TouchCap tc0
prints sys0,2
prints tSend.txt,0
prints crcval,2
//dim=100
//page originPage.val