mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2025-12-21 15:04:24 +01:00
added alternative screensaver
This commit is contained in:
368
HMI/code_gen/pages/out.txt
Normal file
368
HMI/code_gen/pages/out.txt
Normal file
@@ -0,0 +1,368 @@
|
|||||||
|
|
||||||
|
// data available
|
||||||
|
if(usize>1)
|
||||||
|
{
|
||||||
|
bufferPos=0
|
||||||
|
while(bufferPos<usize)
|
||||||
|
{
|
||||||
|
// check for 0x55 0xBB - Command Init Secuence
|
||||||
|
if(u[bufferPos]==187&&u[bufferPos-1]==85)
|
||||||
|
{
|
||||||
|
//remove garbage at the start of the buffer if there's any to free buffer for command
|
||||||
|
if(u[bufferPos]!=1)
|
||||||
|
{
|
||||||
|
udelete bufferPos-1
|
||||||
|
}
|
||||||
|
//instruction is now aligned with buffer, because we deleted garbage before instrcution
|
||||||
|
//get length after init sequence (check if there are more than to bytes in buffer)
|
||||||
|
if(3<usize)
|
||||||
|
{
|
||||||
|
// check if serial buffer has reached the announced length
|
||||||
|
ucopy payloadLength,2,2,0
|
||||||
|
// we are only checking payload length so we have to skip first 3 bytes (init+payload length) (-1 because of < instead of <=)
|
||||||
|
payloadLength+=3
|
||||||
|
// payload length does also not contain crc, so we are adding another 2 bytes for crc
|
||||||
|
payloadLength+=2
|
||||||
|
if(payloadLength<usize)
|
||||||
|
{
|
||||||
|
// calculate crc
|
||||||
|
crcrest 1,0xFFFF
|
||||||
|
// u[2] contains payload legth at 3rd pos in buffer, we are calculating crc from 3rd pos with number of bytes from payload length
|
||||||
|
//crcputu 3,u[2]
|
||||||
|
// u[2] cotnains payload length, we are calculating a crc over the whole message, so we have to add 3 to the length from u[2]
|
||||||
|
crcputu 0,payloadLength-1
|
||||||
|
// get recived crc to be able to compare it
|
||||||
|
ucopy recvCrc,payloadLength-1,2,0
|
||||||
|
// compare crc with recived value
|
||||||
|
if(crcval==recvCrc)
|
||||||
|
{
|
||||||
|
// crc is okay
|
||||||
|
// here is the location where acual code should be
|
||||||
|
// write command to variable strCommand
|
||||||
|
ucopy strCommand.txt,4,payloadLength-5,0
|
||||||
|
// write instruction to tInstuction (debug output, but used as variable here, ui elements will be disabled by default)
|
||||||
|
spstr strCommand.txt,tInstruction.txt,"~",0
|
||||||
|
|
||||||
|
if(tInstruction.txt=="wake")
|
||||||
|
{
|
||||||
|
click tc0,1
|
||||||
|
}
|
||||||
|
if(tInstruction.txt=="dimmode")
|
||||||
|
{
|
||||||
|
// get value
|
||||||
|
spstr strCommand.txt,tTmp.txt,"~",1
|
||||||
|
covx tTmp.txt,dimValue,0,0
|
||||||
|
dim=dimValue
|
||||||
|
// get value normal
|
||||||
|
spstr strCommand.txt,tTmp.txt,"~",2
|
||||||
|
covx tTmp.txt,dimValueNormal,0,0
|
||||||
|
// get background color
|
||||||
|
spstr strCommand.txt,tTmp.txt,"~",3
|
||||||
|
if(tTmp.txt!="")
|
||||||
|
{
|
||||||
|
covx tTmp.txt,defaultBcoColor,0,0
|
||||||
|
}
|
||||||
|
// get font color
|
||||||
|
spstr strCommand.txt,tTmp.txt,"~",4
|
||||||
|
if(tTmp.txt!="")
|
||||||
|
{
|
||||||
|
covx tTmp.txt,defaultFontColor,0,0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(tInstruction.txt=="time")
|
||||||
|
{
|
||||||
|
click m0,1
|
||||||
|
//get set time to global variable
|
||||||
|
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
|
||||||
|
}
|
||||||
|
spstr strCommand.txt,tTimeAdd.txt,"~",2
|
||||||
|
ref tIcon1
|
||||||
|
ref tIcon2
|
||||||
|
}
|
||||||
|
if(tInstruction.txt=="date")
|
||||||
|
{
|
||||||
|
//get set date to global variable
|
||||||
|
spstr strCommand.txt,pageIcons.vaDate.txt,"~",1
|
||||||
|
tDate.txt=pageIcons.vaDate.txt
|
||||||
|
}
|
||||||
|
if(tInstruction.txt=="statusUpdate")
|
||||||
|
{
|
||||||
|
//statusIcon1
|
||||||
|
spstr strCommand.txt,tIcon1.txt,"~",1
|
||||||
|
spstr strCommand.txt,tTmp.txt,"~",2
|
||||||
|
covx tTmp.txt,tIcon1.pco,0,0
|
||||||
|
//statusIcon2
|
||||||
|
spstr strCommand.txt,tIcon2.txt,"~",3
|
||||||
|
spstr strCommand.txt,tTmp.txt,"~",4
|
||||||
|
covx tTmp.txt,tIcon2.pco,0,0
|
||||||
|
spstr strCommand.txt,tTmp.txt,"~",5
|
||||||
|
if(tTmp.txt!="")
|
||||||
|
{
|
||||||
|
tIcon1.font=3
|
||||||
|
}
|
||||||
|
spstr strCommand.txt,tTmp.txt,"~",6
|
||||||
|
if(tTmp.txt!="")
|
||||||
|
{
|
||||||
|
tIcon2.font=3
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(tInstruction.txt=="weatherUpdate"&&tNotifyHead.txt==""&&tNotifyText.txt=="")
|
||||||
|
{
|
||||||
|
|
||||||
|
//tMainIcon
|
||||||
|
spstr strCommand.txt,tMainIcon.txt,"~",3
|
||||||
|
//tMainIcon Color
|
||||||
|
spstr strCommand.txt,tTmp.txt,"~",4
|
||||||
|
covx tTmp.txt,tMainIcon.pco,0,0
|
||||||
|
//tMainText
|
||||||
|
spstr strCommand.txt,tMainText.txt,"~",6
|
||||||
|
|
||||||
|
//d1Icon
|
||||||
|
spstr strCommand.txt,d1Icon.txt,"~",9
|
||||||
|
//d1Icon Color
|
||||||
|
spstr strCommand.txt,tTmp.txt,"~",10
|
||||||
|
covx tTmp.txt,d1Icon.pco,0,0
|
||||||
|
//d1Val
|
||||||
|
spstr strCommand.txt,d1Val.txt,"~",12
|
||||||
|
|
||||||
|
|
||||||
|
//d2Icon
|
||||||
|
spstr strCommand.txt,d2Icon.txt,"~",15
|
||||||
|
//d2Icon Color
|
||||||
|
spstr strCommand.txt,tTmp.txt,"~",16
|
||||||
|
covx tTmp.txt,d2Icon.pco,0,0
|
||||||
|
//d2Val
|
||||||
|
spstr strCommand.txt,d2Val.txt,"~",18
|
||||||
|
|
||||||
|
|
||||||
|
//d3Icon
|
||||||
|
spstr strCommand.txt,d3Icon.txt,"~",21
|
||||||
|
//d3Icon Color
|
||||||
|
spstr strCommand.txt,tTmp.txt,"~",22
|
||||||
|
covx tTmp.txt,d3Icon.pco,0,0
|
||||||
|
//d3Val
|
||||||
|
spstr strCommand.txt,d3Val.txt,"~",24
|
||||||
|
|
||||||
|
|
||||||
|
//e1Name
|
||||||
|
spstr strCommand.txt,e1Name.txt,"~",29
|
||||||
|
//e1Icon
|
||||||
|
spstr strCommand.txt,e1Icon.txt,"~",27
|
||||||
|
//e1Icon Color
|
||||||
|
spstr strCommand.txt,tTmp.txt,"~",28
|
||||||
|
covx tTmp.txt,e1Icon.pco,0,0
|
||||||
|
//e1Val
|
||||||
|
spstr strCommand.txt,e1Val.txt,"~",30
|
||||||
|
|
||||||
|
|
||||||
|
//e2Name
|
||||||
|
spstr strCommand.txt,e2Name.txt,"~",35
|
||||||
|
//e2Icon
|
||||||
|
spstr strCommand.txt,e2Icon.txt,"~",33
|
||||||
|
//e2Icon Color
|
||||||
|
spstr strCommand.txt,tTmp.txt,"~",34
|
||||||
|
covx tTmp.txt,e2Icon.pco,0,0
|
||||||
|
//e2Val
|
||||||
|
spstr strCommand.txt,e2Val.txt,"~",36
|
||||||
|
|
||||||
|
|
||||||
|
//e3Name
|
||||||
|
spstr strCommand.txt,e3Name.txt,"~",41
|
||||||
|
//e3Icon
|
||||||
|
spstr strCommand.txt,e3Icon.txt,"~",39
|
||||||
|
//e3Icon Color
|
||||||
|
spstr strCommand.txt,tTmp.txt,"~",40
|
||||||
|
covx tTmp.txt,e3Icon.pco,0,0
|
||||||
|
//e3Val
|
||||||
|
spstr strCommand.txt,e3Val.txt,"~",42
|
||||||
|
|
||||||
|
|
||||||
|
//e4Name
|
||||||
|
spstr strCommand.txt,e4Name.txt,"~",47
|
||||||
|
//e4Icon
|
||||||
|
spstr strCommand.txt,e4Icon.txt,"~",45
|
||||||
|
//e4Icon Color
|
||||||
|
spstr strCommand.txt,tTmp.txt,"~",46
|
||||||
|
covx tTmp.txt,e4Icon.pco,0,0
|
||||||
|
//e4Val
|
||||||
|
spstr strCommand.txt,e4Val.txt,"~",48
|
||||||
|
|
||||||
|
|
||||||
|
//e5Name
|
||||||
|
spstr strCommand.txt,e5Name.txt,"~",53
|
||||||
|
//e5Icon
|
||||||
|
spstr strCommand.txt,e5Icon.txt,"~",51
|
||||||
|
//e5Icon Color
|
||||||
|
spstr strCommand.txt,tTmp.txt,"~",52
|
||||||
|
covx tTmp.txt,e5Icon.pco,0,0
|
||||||
|
//e5Val
|
||||||
|
spstr strCommand.txt,e5Val.txt,"~",54
|
||||||
|
|
||||||
|
|
||||||
|
//e6Name
|
||||||
|
spstr strCommand.txt,e6Name.txt,"~",59
|
||||||
|
//e6Icon
|
||||||
|
spstr strCommand.txt,e6Icon.txt,"~",57
|
||||||
|
//e6Icon Color
|
||||||
|
spstr strCommand.txt,tTmp.txt,"~",58
|
||||||
|
covx tTmp.txt,e6Icon.pco,0,0
|
||||||
|
//e6Val
|
||||||
|
spstr strCommand.txt,e6Val.txt,"~",60
|
||||||
|
|
||||||
|
|
||||||
|
//f1Icon
|
||||||
|
spstr strCommand.txt,f1Icon.txt,"~",63
|
||||||
|
//f1Icon Color
|
||||||
|
spstr strCommand.txt,tTmp.txt,"~",64
|
||||||
|
covx tTmp.txt,f1Icon.pco,0,0
|
||||||
|
|
||||||
|
//f2Icon
|
||||||
|
spstr strCommand.txt,f2Icon.txt,"~",69
|
||||||
|
//f2Icon Color
|
||||||
|
spstr strCommand.txt,tTmp.txt,"~",70
|
||||||
|
covx tTmp.txt,f2Icon.pco,0,0
|
||||||
|
|
||||||
|
//f3Icon
|
||||||
|
spstr strCommand.txt,f3Icon.txt,"~",75
|
||||||
|
//f3Icon Color
|
||||||
|
spstr strCommand.txt,tTmp.txt,"~",76
|
||||||
|
covx tTmp.txt,f3Icon.pco,0,0
|
||||||
|
|
||||||
|
//f4Icon
|
||||||
|
spstr strCommand.txt,f4Icon.txt,"~",81
|
||||||
|
//f4Icon Color
|
||||||
|
spstr strCommand.txt,tTmp.txt,"~",82
|
||||||
|
covx tTmp.txt,f4Icon.pco,0,0
|
||||||
|
|
||||||
|
//f5Icon
|
||||||
|
spstr strCommand.txt,f5Icon.txt,"~",87
|
||||||
|
//f5Icon Color
|
||||||
|
spstr strCommand.txt,tTmp.txt,"~",88
|
||||||
|
covx tTmp.txt,f5Icon.pco,0,0
|
||||||
|
|
||||||
|
}
|
||||||
|
if(tInstruction.txt=="notify")
|
||||||
|
{
|
||||||
|
spstr strCommand.txt,tNotifyHead.txt,"~",1
|
||||||
|
spstr strCommand.txt,tNotifyText.txt,"~",2
|
||||||
|
if(tNotifyHead.txt!=""||tNotifyText.txt!="")
|
||||||
|
{
|
||||||
|
vis tNotifyHead,1
|
||||||
|
vis tNotifyText,1
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
vis tNotifyHead,0
|
||||||
|
vis tNotifyText,0
|
||||||
|
}
|
||||||
|
tNotifyHead.bco=tTime.bco
|
||||||
|
tNotifyText.bco=tTime.bco
|
||||||
|
spstr strCommand.txt,tTmp.txt,"~",3
|
||||||
|
if(tTmp.txt!="")
|
||||||
|
{
|
||||||
|
covx tTmp.txt,tNotifyHead.pco,0,0
|
||||||
|
}
|
||||||
|
spstr strCommand.txt,tTmp.txt,"~",4
|
||||||
|
if(tTmp.txt!="")
|
||||||
|
{
|
||||||
|
covx tTmp.txt,tNotifyText.pco,0,0
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if(tInstruction.txt=="pageType")
|
||||||
|
{
|
||||||
|
dim=100
|
||||||
|
//command format pageType,specialPageName
|
||||||
|
//write name of speical page to tId
|
||||||
|
spstr strCommand.txt,tId.txt,"~",1
|
||||||
|
//save second arg if there's one
|
||||||
|
spstr strCommand.txt,tTmp.txt,"~",2
|
||||||
|
//save third arg if there's one
|
||||||
|
spstr strCommand.txt,pageIcons.tTmp2.txt,"~",3
|
||||||
|
spstr strCommand.txt,pageIcons.tTmp3.txt,"~",4
|
||||||
|
//we are going to exit this page with this command, so we have to clear the buffer, so we are not getting into a stupid loop ...
|
||||||
|
udelete payloadLength-1
|
||||||
|
bufferPos=0
|
||||||
|
if(tId.txt=="pageStartup")
|
||||||
|
{
|
||||||
|
page pageStartup
|
||||||
|
}
|
||||||
|
if(tId.txt=="screensaver")
|
||||||
|
{
|
||||||
|
page screensaver
|
||||||
|
}
|
||||||
|
if(tId.txt=="screensaver2")
|
||||||
|
{
|
||||||
|
page screensaver2
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardEntities")
|
||||||
|
{
|
||||||
|
page cardEntities
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardGrid")
|
||||||
|
{
|
||||||
|
page cardGrid
|
||||||
|
}
|
||||||
|
if(tId.txt=="popupLight")
|
||||||
|
{
|
||||||
|
pageIcons.tTmp1.txt=tTmp.txt
|
||||||
|
page popupLight
|
||||||
|
}
|
||||||
|
if(tId.txt=="popupShutter")
|
||||||
|
{
|
||||||
|
pageIcons.tTmp1.txt=tTmp.txt
|
||||||
|
page popupShutter
|
||||||
|
}
|
||||||
|
if(tId.txt=="popupNotify")
|
||||||
|
{
|
||||||
|
page popupNotify
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardThermo")
|
||||||
|
{
|
||||||
|
page cardThermo
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardMedia")
|
||||||
|
{
|
||||||
|
page cardMedia
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardAlarm")
|
||||||
|
{
|
||||||
|
page cardAlarm
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardQR")
|
||||||
|
{
|
||||||
|
page cardQR
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardPower")
|
||||||
|
{
|
||||||
|
page cardPower
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardChart")
|
||||||
|
{
|
||||||
|
page cardChart
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(tInstruction.txt=="timeout")
|
||||||
|
{
|
||||||
|
//set timeout to global var
|
||||||
|
spstr strCommand.txt,tTmp.txt,"~",1
|
||||||
|
covx tTmp.txt,sleepTimeout,0,0
|
||||||
|
}
|
||||||
|
// end of user code
|
||||||
|
udelete payloadLength-1
|
||||||
|
bufferPos=0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// next character
|
||||||
|
bufferPos++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
223
HMI/code_gen/pages/screensaver2.py
Normal file
223
HMI/code_gen/pages/screensaver2.py
Normal file
@@ -0,0 +1,223 @@
|
|||||||
|
from shared import *
|
||||||
|
head = sharedhead + """
|
||||||
|
if(tInstruction.txt=="wake")
|
||||||
|
{
|
||||||
|
click tc0,1
|
||||||
|
}
|
||||||
|
if(tInstruction.txt=="dimmode")
|
||||||
|
{
|
||||||
|
// get value
|
||||||
|
spstr strCommand.txt,tTmp.txt,"~",1
|
||||||
|
covx tTmp.txt,dimValue,0,0
|
||||||
|
dim=dimValue
|
||||||
|
// get value normal
|
||||||
|
spstr strCommand.txt,tTmp.txt,"~",2
|
||||||
|
covx tTmp.txt,dimValueNormal,0,0
|
||||||
|
// get background color
|
||||||
|
spstr strCommand.txt,tTmp.txt,"~",3
|
||||||
|
if(tTmp.txt!="")
|
||||||
|
{
|
||||||
|
covx tTmp.txt,defaultBcoColor,0,0
|
||||||
|
}
|
||||||
|
// get font color
|
||||||
|
spstr strCommand.txt,tTmp.txt,"~",4
|
||||||
|
if(tTmp.txt!="")
|
||||||
|
{
|
||||||
|
covx tTmp.txt,defaultFontColor,0,0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(tInstruction.txt=="time")
|
||||||
|
{
|
||||||
|
click m0,1
|
||||||
|
//get set time to global variable
|
||||||
|
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
|
||||||
|
}
|
||||||
|
spstr strCommand.txt,tTimeAdd.txt,"~",2
|
||||||
|
ref tIcon1
|
||||||
|
ref tIcon2
|
||||||
|
}
|
||||||
|
if(tInstruction.txt=="date")
|
||||||
|
{
|
||||||
|
//get set date to global variable
|
||||||
|
spstr strCommand.txt,pageIcons.vaDate.txt,"~",1
|
||||||
|
tDate.txt=pageIcons.vaDate.txt
|
||||||
|
}
|
||||||
|
if(tInstruction.txt=="statusUpdate")
|
||||||
|
{
|
||||||
|
//statusIcon1
|
||||||
|
spstr strCommand.txt,tIcon1.txt,"~",1
|
||||||
|
spstr strCommand.txt,tTmp.txt,"~",2
|
||||||
|
covx tTmp.txt,tIcon1.pco,0,0
|
||||||
|
//statusIcon2
|
||||||
|
spstr strCommand.txt,tIcon2.txt,"~",3
|
||||||
|
spstr strCommand.txt,tTmp.txt,"~",4
|
||||||
|
covx tTmp.txt,tIcon2.pco,0,0
|
||||||
|
spstr strCommand.txt,tTmp.txt,"~",5
|
||||||
|
if(tTmp.txt!="")
|
||||||
|
{
|
||||||
|
tIcon1.font=3
|
||||||
|
}
|
||||||
|
spstr strCommand.txt,tTmp.txt,"~",6
|
||||||
|
if(tTmp.txt!="")
|
||||||
|
{
|
||||||
|
tIcon2.font=3
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(tInstruction.txt=="weatherUpdate"&&tNotifyHead.txt==""&&tNotifyText.txt=="")
|
||||||
|
{
|
||||||
|
|
||||||
|
//tMainIcon
|
||||||
|
spstr strCommand.txt,tMainIcon.txt,"~",3
|
||||||
|
//tMainIcon Color
|
||||||
|
spstr strCommand.txt,tTmp.txt,"~",4
|
||||||
|
covx tTmp.txt,tMainIcon.pco,0,0
|
||||||
|
//tMainText
|
||||||
|
spstr strCommand.txt,tMainText.txt,"~",6
|
||||||
|
"""
|
||||||
|
|
||||||
|
start = 7
|
||||||
|
for i in range(1,4):
|
||||||
|
idxstart = start + (i-1)*6
|
||||||
|
item = f"""
|
||||||
|
//d{i}Icon
|
||||||
|
spstr strCommand.txt,d{i}Icon.txt,"~",{idxstart+2}
|
||||||
|
//d{i}Icon Color
|
||||||
|
spstr strCommand.txt,tTmp.txt,"~",{idxstart+3}
|
||||||
|
covx tTmp.txt,d{i}Icon.pco,0,0
|
||||||
|
//d{i}Val
|
||||||
|
spstr strCommand.txt,d{i}Val.txt,"~",{idxstart+5}
|
||||||
|
|
||||||
|
"""
|
||||||
|
head = head + item
|
||||||
|
|
||||||
|
start = idxstart+6
|
||||||
|
for i in range(1,7):
|
||||||
|
idxstart = start + (i-1)*6
|
||||||
|
item = f"""
|
||||||
|
//e{i}Name
|
||||||
|
spstr strCommand.txt,e{i}Name.txt,"~",{idxstart+4}
|
||||||
|
//e{i}Icon
|
||||||
|
spstr strCommand.txt,e{i}Icon.txt,"~",{idxstart+2}
|
||||||
|
//e{i}Icon Color
|
||||||
|
spstr strCommand.txt,tTmp.txt,"~",{idxstart+3}
|
||||||
|
covx tTmp.txt,e{i}Icon.pco,0,0
|
||||||
|
//e{i}Val
|
||||||
|
spstr strCommand.txt,e{i}Val.txt,"~",{idxstart+5}
|
||||||
|
|
||||||
|
"""
|
||||||
|
head = head + item
|
||||||
|
|
||||||
|
start = idxstart+6
|
||||||
|
for i in range(1,6):
|
||||||
|
idxstart = start + (i-1)*6
|
||||||
|
item = f"""
|
||||||
|
//f{i}Icon
|
||||||
|
spstr strCommand.txt,f{i}Icon.txt,"~",{idxstart+2}
|
||||||
|
//f{i}Icon Color
|
||||||
|
spstr strCommand.txt,tTmp.txt,"~",{idxstart+3}
|
||||||
|
covx tTmp.txt,f{i}Icon.pco,0,0
|
||||||
|
"""
|
||||||
|
head = head + item
|
||||||
|
|
||||||
|
head = head + """
|
||||||
|
}
|
||||||
|
if(tInstruction.txt=="notify")
|
||||||
|
{
|
||||||
|
spstr strCommand.txt,tNotifyHead.txt,"~",1
|
||||||
|
spstr strCommand.txt,tNotifyText.txt,"~",2
|
||||||
|
if(tNotifyHead.txt!=""||tNotifyText.txt!="")
|
||||||
|
{
|
||||||
|
vis tNotifyHead,1
|
||||||
|
vis tNotifyText,1
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
vis tNotifyHead,0
|
||||||
|
vis tNotifyText,0
|
||||||
|
}
|
||||||
|
tNotifyHead.bco=tTime.bco
|
||||||
|
tNotifyText.bco=tTime.bco
|
||||||
|
spstr strCommand.txt,tTmp.txt,"~",3
|
||||||
|
if(tTmp.txt!="")
|
||||||
|
{
|
||||||
|
covx tTmp.txt,tNotifyHead.pco,0,0
|
||||||
|
}
|
||||||
|
spstr strCommand.txt,tTmp.txt,"~",4
|
||||||
|
if(tTmp.txt!="")
|
||||||
|
{
|
||||||
|
covx tTmp.txt,tNotifyText.pco,0,0
|
||||||
|
}
|
||||||
|
"""
|
||||||
|
|
||||||
|
print(head)
|
||||||
|
|
||||||
|
|
||||||
|
#start = 23
|
||||||
|
#for i in range(1,7):
|
||||||
|
# idxstart = start + (i-1)*6
|
||||||
|
# item = f"""
|
||||||
|
# // get Type
|
||||||
|
# spstr strCommand.txt,type{i}.txt,"~",{idxstart}
|
||||||
|
# // get internal name
|
||||||
|
# spstr strCommand.txt,entn{i}.txt,"~",{idxstart+1}
|
||||||
|
# if(type{i}.txt=="delete"||type{i}.txt=="")
|
||||||
|
# {{
|
||||||
|
# vis tEntity{i},0
|
||||||
|
# vis bEntity{i},0
|
||||||
|
# }}else
|
||||||
|
# {{
|
||||||
|
# // change icon
|
||||||
|
# spstr strCommand.txt,bEntity{i}.txt,"~",{idxstart+2}
|
||||||
|
# vis bEntity{i},1
|
||||||
|
# // change icon color
|
||||||
|
# spstr strCommand.txt,tTmp.txt,"~",{idxstart+3}
|
||||||
|
# covx tTmp.txt,sys0,0,0
|
||||||
|
# bEntity{i}.pco=sys0
|
||||||
|
# // set name
|
||||||
|
# spstr strCommand.txt,tEntity{i}.txt,"~",{idxstart+4}
|
||||||
|
# vis tEntity{i},1
|
||||||
|
# }}
|
||||||
|
#"""
|
||||||
|
# print(item)
|
||||||
|
foot = """
|
||||||
|
}
|
||||||
|
""" + sharedfoot.replace("sleepValue=0", "dim=100").replace("""
|
||||||
|
if(tInstruction.txt=="time")
|
||||||
|
{
|
||||||
|
// get set time to global variable
|
||||||
|
spstr strCommand.txt,pageIcons.vaTime.txt,"~",1
|
||||||
|
}
|
||||||
|
if(tInstruction.txt=="date")
|
||||||
|
{
|
||||||
|
// get set date to global variable
|
||||||
|
spstr strCommand.txt,pageIcons.vaDate.txt,"~",1
|
||||||
|
}
|
||||||
|
if(tInstruction.txt=="dimmode")
|
||||||
|
{
|
||||||
|
// get value
|
||||||
|
spstr strCommand.txt,tTmp.txt,"~",1
|
||||||
|
covx tTmp.txt,dimValue,0,0
|
||||||
|
// get value normal
|
||||||
|
spstr strCommand.txt,tTmp.txt,"~",2
|
||||||
|
covx tTmp.txt,dimValueNormal,0,0
|
||||||
|
dim=dimValueNormal
|
||||||
|
// get background color
|
||||||
|
spstr strCommand.txt,tTmp.txt,"~",3
|
||||||
|
if(tTmp.txt!="")
|
||||||
|
{
|
||||||
|
covx tTmp.txt,defaultBcoColor,0,0
|
||||||
|
}
|
||||||
|
// get font color
|
||||||
|
spstr strCommand.txt,tTmp.txt,"~",4
|
||||||
|
if(tTmp.txt!="")
|
||||||
|
{
|
||||||
|
covx tTmp.txt,defaultFontColor,0,0
|
||||||
|
}
|
||||||
|
}""","")
|
||||||
|
print(foot)
|
||||||
|
|
||||||
|
|
||||||
@@ -67,6 +67,10 @@ sharedfoot = """
|
|||||||
{
|
{
|
||||||
page screensaver
|
page screensaver
|
||||||
}
|
}
|
||||||
|
if(tId.txt=="screensaver2")
|
||||||
|
{
|
||||||
|
page screensaver2
|
||||||
|
}
|
||||||
if(tId.txt=="cardEntities")
|
if(tId.txt=="cardEntities")
|
||||||
{
|
{
|
||||||
page cardEntities
|
page cardEntities
|
||||||
|
|||||||
BIN
HMI/nspanel.HMI
BIN
HMI/nspanel.HMI
Binary file not shown.
BIN
HMI/nspanel.tft
BIN
HMI/nspanel.tft
Binary file not shown.
Reference in New Issue
Block a user