mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2025-12-19 14:14:12 +01:00
@@ -1,272 +1,274 @@
|
|||||||
from shared import *
|
from shared import *
|
||||||
head = sharedhead + """
|
head = sharedhead + """
|
||||||
if(tInstruction.txt=="wake")
|
if(tInstruction.txt=="wake")
|
||||||
{
|
{
|
||||||
click tc0,1
|
click tc0,1
|
||||||
}
|
}
|
||||||
if(tInstruction.txt=="dimmode")
|
if(tInstruction.txt=="dimmode")
|
||||||
{
|
{
|
||||||
// get value
|
// get value
|
||||||
spstr strCommand.txt,tTmp.txt,"~",1
|
spstr strCommand.txt,tTmp.txt,"~",1
|
||||||
covx tTmp.txt,dimValue,0,0
|
covx tTmp.txt,dimValue,0,0
|
||||||
dim=dimValue
|
dim=dimValue
|
||||||
// get value normal
|
// get value normal
|
||||||
spstr strCommand.txt,tTmp.txt,"~",2
|
spstr strCommand.txt,tTmp.txt,"~",2
|
||||||
covx tTmp.txt,dimValueNormal,0,0
|
covx tTmp.txt,dimValueNormal,0,0
|
||||||
// get background color
|
// get background color
|
||||||
spstr strCommand.txt,tTmp.txt,"~",3
|
spstr strCommand.txt,tTmp.txt,"~",3
|
||||||
if(tTmp.txt!="")
|
if(tTmp.txt!="")
|
||||||
{
|
{
|
||||||
covx tTmp.txt,defaultBcoColor,0,0
|
covx tTmp.txt,defaultBcoColor,0,0
|
||||||
}
|
}
|
||||||
// get font color
|
// get font color
|
||||||
spstr strCommand.txt,tTmp.txt,"~",4
|
spstr strCommand.txt,tTmp.txt,"~",4
|
||||||
if(tTmp.txt!="")
|
if(tTmp.txt!="")
|
||||||
{
|
{
|
||||||
covx tTmp.txt,defaultFontColor,0,0
|
covx tTmp.txt,defaultFontColor,0,0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(tInstruction.txt=="time")
|
if(tInstruction.txt=="time")
|
||||||
{
|
{
|
||||||
click m0,1
|
click m0,1
|
||||||
//get set time to global variable
|
//get set time to global variable
|
||||||
spstr strCommand.txt,pageIcons.vaTime.txt,"~",1
|
spstr strCommand.txt,pageIcons.vaTime.txt,"~",1
|
||||||
spstr pageIcons.vaTime.txt,tTime.txt,"?",0
|
spstr pageIcons.vaTime.txt,tTime.txt,"?",0
|
||||||
spstr pageIcons.vaTime.txt,tAMPM.txt,"?",1
|
spstr pageIcons.vaTime.txt,tAMPM.txt,"?",1
|
||||||
if(tAMPM.txt=="")
|
if(tAMPM.txt=="")
|
||||||
{
|
{
|
||||||
vis tAMPM,0
|
vis tAMPM,0
|
||||||
}
|
}
|
||||||
spstr strCommand.txt,tTimeAdd.txt,"~",2
|
spstr strCommand.txt,tTimeAdd.txt,"~",2
|
||||||
ref tIcon1
|
ref tIcon1
|
||||||
ref tIcon2
|
ref tIcon2
|
||||||
}
|
}
|
||||||
if(tInstruction.txt=="date")
|
if(tInstruction.txt=="date")
|
||||||
{
|
{
|
||||||
//get set date to global variable
|
//get set date to global variable
|
||||||
spstr strCommand.txt,pageIcons.vaDate.txt,"~",1
|
spstr strCommand.txt,pageIcons.vaDate.txt,"~",1
|
||||||
tDate.txt=pageIcons.vaDate.txt
|
tDate.txt=pageIcons.vaDate.txt
|
||||||
}
|
}
|
||||||
if(tInstruction.txt=="statusUpdate")
|
if(tInstruction.txt=="statusUpdate")
|
||||||
{
|
{
|
||||||
//statusIcon1
|
//statusIcon1
|
||||||
spstr strCommand.txt,tIcon1.txt,"~",1
|
spstr strCommand.txt,tIcon1.txt,"~",1
|
||||||
spstr strCommand.txt,tTmp.txt,"~",2
|
spstr strCommand.txt,tTmp.txt,"~",2
|
||||||
covx tTmp.txt,tIcon1.pco,0,0
|
covx tTmp.txt,tIcon1.pco,0,0
|
||||||
//statusIcon2
|
//statusIcon2
|
||||||
spstr strCommand.txt,tIcon2.txt,"~",3
|
spstr strCommand.txt,tIcon2.txt,"~",3
|
||||||
spstr strCommand.txt,tTmp.txt,"~",4
|
spstr strCommand.txt,tTmp.txt,"~",4
|
||||||
covx tTmp.txt,tIcon2.pco,0,0
|
covx tTmp.txt,tIcon2.pco,0,0
|
||||||
spstr strCommand.txt,tTmp.txt,"~",5
|
spstr strCommand.txt,tTmp.txt,"~",5
|
||||||
if(tTmp.txt!="")
|
if(tTmp.txt!="")
|
||||||
{
|
{
|
||||||
tIcon1.font=3
|
tIcon1.font=3
|
||||||
}
|
}
|
||||||
spstr strCommand.txt,tTmp.txt,"~",6
|
spstr strCommand.txt,tTmp.txt,"~",6
|
||||||
if(tTmp.txt!="")
|
if(tTmp.txt!="")
|
||||||
{
|
{
|
||||||
tIcon2.font=3
|
tIcon2.font=3
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(tInstruction.txt=="weatherUpdate"&&tNotifyHead.txt==""&&tNotifyText.txt=="")
|
if(tInstruction.txt=="weatherUpdate"&&tNotifyHead.txt==""&&tNotifyText.txt=="")
|
||||||
{
|
{
|
||||||
|
|
||||||
//tMainIcon
|
//tMainIcon
|
||||||
spstr strCommand.txt,tMainIcon.txt,"~",3
|
spstr strCommand.txt,tMainIcon.txt,"~",3
|
||||||
//tMainIcon Color
|
//tMainIcon Color
|
||||||
spstr strCommand.txt,tTmp.txt,"~",4
|
spstr strCommand.txt,tTmp.txt,"~",4
|
||||||
covx tTmp.txt,tMainIcon.pco,0,0
|
covx tTmp.txt,tMainIcon.pco,0,0
|
||||||
//tMainText
|
//tMainText
|
||||||
spstr strCommand.txt,tMainText.txt,"~",6
|
spstr strCommand.txt,tMainText.txt,"~",6
|
||||||
"""
|
"""
|
||||||
|
|
||||||
start = 7
|
start = 7
|
||||||
for i in range(1,4):
|
for i in range(1,4):
|
||||||
idxstart = start + (i-1)*6
|
idxstart = start + (i-1)*6
|
||||||
item = f"""
|
item = f"""
|
||||||
//d{i}Icon
|
//d{i}Icon
|
||||||
spstr strCommand.txt,d{i}Icon.txt,"~",{idxstart+2}
|
spstr strCommand.txt,d{i}Icon.txt,"~",{idxstart+2}
|
||||||
//d{i}Icon Color
|
//d{i}Icon Color
|
||||||
spstr strCommand.txt,tTmp.txt,"~",{idxstart+3}
|
spstr strCommand.txt,tTmp.txt,"~",{idxstart+3}
|
||||||
covx tTmp.txt,d{i}Icon.pco,0,0
|
covx tTmp.txt,d{i}Icon.pco,0,0
|
||||||
//d{i}Val
|
//d{i}Val
|
||||||
spstr strCommand.txt,d{i}Val.txt,"~",{idxstart+5}
|
spstr strCommand.txt,d{i}Val.txt,"~",{idxstart+5}
|
||||||
|
|
||||||
"""
|
"""
|
||||||
head = head + item
|
head = head + item
|
||||||
|
|
||||||
start = idxstart+6
|
start = idxstart+6
|
||||||
for i in range(1,7):
|
for i in range(1,7):
|
||||||
idxstart = start + (i-1)*6
|
idxstart = start + (i-1)*6
|
||||||
item = f"""
|
item = f"""
|
||||||
//e{i}Name
|
//e{i}Name
|
||||||
spstr strCommand.txt,e{i}Name.txt,"~",{idxstart+4}
|
spstr strCommand.txt,e{i}Name.txt,"~",{idxstart+4}
|
||||||
//e{i}Icon
|
//e{i}Icon
|
||||||
spstr strCommand.txt,e{i}Icon.txt,"~",{idxstart+2}
|
spstr strCommand.txt,e{i}Icon.txt,"~",{idxstart+2}
|
||||||
//e{i}Icon Color
|
//e{i}Icon Color
|
||||||
spstr strCommand.txt,tTmp.txt,"~",{idxstart+3}
|
spstr strCommand.txt,tTmp.txt,"~",{idxstart+3}
|
||||||
covx tTmp.txt,e{i}Icon.pco,0,0
|
covx tTmp.txt,e{i}Icon.pco,0,0
|
||||||
//e{i}Val
|
//e{i}Val
|
||||||
spstr strCommand.txt,e{i}Val.txt,"~",{idxstart+5}
|
spstr strCommand.txt,e{i}Val.txt,"~",{idxstart+5}
|
||||||
|
|
||||||
"""
|
"""
|
||||||
head = head + item
|
head = head + item
|
||||||
|
|
||||||
start = idxstart+6
|
start = idxstart+6
|
||||||
for i in range(1,6):
|
for i in range(1,6):
|
||||||
idxstart = start + (i-1)*6
|
idxstart = start + (i-1)*6
|
||||||
item = f"""
|
item = f"""
|
||||||
//f{i}Icon
|
//f{i}Icon
|
||||||
spstr strCommand.txt,f{i}Icon.txt,"~",{idxstart+2}
|
spstr strCommand.txt,f{i}Icon.txt,"~",{idxstart+2}
|
||||||
//f{i}Icon Color
|
//f{i}Icon Color
|
||||||
spstr strCommand.txt,tTmp.txt,"~",{idxstart+3}
|
spstr strCommand.txt,tTmp.txt,"~",{idxstart+3}
|
||||||
covx tTmp.txt,f{i}Icon.pco,0,0
|
covx tTmp.txt,f{i}Icon.pco,0,0
|
||||||
"""
|
//f{i}Icon intNameEntity
|
||||||
head = head + item
|
spstr strCommand.txt,entn{i}.txt,"~",{idxstart+1}
|
||||||
|
"""
|
||||||
head = head + """
|
head = head + item
|
||||||
}
|
|
||||||
|
head = head + """
|
||||||
if(tInstruction.txt=="color"&&tNotifyHead.txt==""&&tNotifyText.txt=="")
|
}
|
||||||
{
|
|
||||||
spstr strCommand.txt,tTmp.txt,"~",1
|
if(tInstruction.txt=="color"&&tNotifyHead.txt==""&&tNotifyText.txt=="")
|
||||||
covx tTmp.txt,tTime.bco,0,0
|
{
|
||||||
if(tTime.bco!=screensaver.bco)
|
spstr strCommand.txt,tTmp.txt,"~",1
|
||||||
{
|
covx tTmp.txt,tTime.bco,0,0
|
||||||
for(sys0=0;sys0<60;sys0++)
|
if(tTime.bco!=screensaver.bco)
|
||||||
{
|
{
|
||||||
if(b[sys0].type==98||b[sys0].type==116||b[sys0].type==54)
|
for(sys0=0;sys0<60;sys0++)
|
||||||
{
|
{
|
||||||
b[sys0].bco=tTime.bco
|
if(b[sys0].type==98||b[sys0].type==116||b[sys0].type==54)
|
||||||
}
|
{
|
||||||
}
|
b[sys0].bco=tTime.bco
|
||||||
}
|
}
|
||||||
spstr strCommand.txt,tTmp.txt,"~",2
|
}
|
||||||
covx tTmp.txt,tTime.pco,0,0
|
}
|
||||||
spstr strCommand.txt,tTmp.txt,"~",3
|
spstr strCommand.txt,tTmp.txt,"~",2
|
||||||
covx tTmp.txt,tAMPM.pco,0,0
|
covx tTmp.txt,tTime.pco,0,0
|
||||||
spstr strCommand.txt,tTmp.txt,"~",4
|
spstr strCommand.txt,tTmp.txt,"~",3
|
||||||
covx tTmp.txt,tDate.pco,0,0
|
covx tTmp.txt,tAMPM.pco,0,0
|
||||||
spstr strCommand.txt,tTmp.txt,"~",5
|
spstr strCommand.txt,tTmp.txt,"~",4
|
||||||
covx tTmp.txt,tMainText.pco,0,0
|
covx tTmp.txt,tDate.pco,0,0
|
||||||
//spstr strCommand.txt,tTmp.txt,"~",6
|
spstr strCommand.txt,tTmp.txt,"~",5
|
||||||
//covx tTmp.txt,tForecast1.pco,0,0
|
covx tTmp.txt,tMainText.pco,0,0
|
||||||
//spstr strCommand.txt,tTmp.txt,"~",7
|
//spstr strCommand.txt,tTmp.txt,"~",6
|
||||||
//covx tTmp.txt,tForecast2.pco,0,0
|
//covx tTmp.txt,tForecast1.pco,0,0
|
||||||
//spstr strCommand.txt,tTmp.txt,"~",8
|
//spstr strCommand.txt,tTmp.txt,"~",7
|
||||||
//covx tTmp.txt,tForecast3.pco,0,0
|
//covx tTmp.txt,tForecast2.pco,0,0
|
||||||
//spstr strCommand.txt,tTmp.txt,"~",9
|
//spstr strCommand.txt,tTmp.txt,"~",8
|
||||||
//covx tTmp.txt,tForecast4.pco,0,0
|
//covx tTmp.txt,tForecast3.pco,0,0
|
||||||
//spstr strCommand.txt,tTmp.txt,"~",10
|
//spstr strCommand.txt,tTmp.txt,"~",9
|
||||||
//covx tTmp.txt,tForecast1Val.pco,0,0
|
//covx tTmp.txt,tForecast4.pco,0,0
|
||||||
//spstr strCommand.txt,tTmp.txt,"~",11
|
//spstr strCommand.txt,tTmp.txt,"~",10
|
||||||
//covx tTmp.txt,tForecast2Val.pco,0,0
|
//covx tTmp.txt,tForecast1Val.pco,0,0
|
||||||
//spstr strCommand.txt,tTmp.txt,"~",12
|
//spstr strCommand.txt,tTmp.txt,"~",11
|
||||||
//covx tTmp.txt,tForecast3Val.pco,0,0
|
//covx tTmp.txt,tForecast2Val.pco,0,0
|
||||||
//spstr strCommand.txt,tTmp.txt,"~",13
|
//spstr strCommand.txt,tTmp.txt,"~",12
|
||||||
//covx tTmp.txt,tForecast4Val.pco,0,0
|
//covx tTmp.txt,tForecast3Val.pco,0,0
|
||||||
//spstr strCommand.txt,tTmp.txt,"~",14
|
//spstr strCommand.txt,tTmp.txt,"~",13
|
||||||
//covx tTmp.txt,t10.bco,0,0
|
//covx tTmp.txt,tForecast4Val.pco,0,0
|
||||||
//spstr strCommand.txt,tTmp.txt,"~",15
|
//spstr strCommand.txt,tTmp.txt,"~",14
|
||||||
//covx tTmp.txt,tMainTextAlt2.pco,0,0
|
//covx tTmp.txt,t10.bco,0,0
|
||||||
//spstr strCommand.txt,tTmp.txt,"~",16
|
//spstr strCommand.txt,tTmp.txt,"~",15
|
||||||
//covx tTmp.txt,tTimeAdd.pco,0,0
|
//covx tTmp.txt,tMainTextAlt2.pco,0,0
|
||||||
}
|
//spstr strCommand.txt,tTmp.txt,"~",16
|
||||||
|
//covx tTmp.txt,tTimeAdd.pco,0,0
|
||||||
|
}
|
||||||
|
|
||||||
if(tInstruction.txt=="notify")
|
|
||||||
{
|
|
||||||
spstr strCommand.txt,tNotifyHead.txt,"~",1
|
if(tInstruction.txt=="notify")
|
||||||
spstr strCommand.txt,tNotifyText.txt,"~",2
|
{
|
||||||
if(tNotifyHead.txt!=""||tNotifyText.txt!="")
|
spstr strCommand.txt,tNotifyHead.txt,"~",1
|
||||||
{
|
spstr strCommand.txt,tNotifyText.txt,"~",2
|
||||||
vis tNotifyHead,1
|
if(tNotifyHead.txt!=""||tNotifyText.txt!="")
|
||||||
vis tNotifyText,1
|
{
|
||||||
}else
|
vis tNotifyHead,1
|
||||||
{
|
vis tNotifyText,1
|
||||||
vis tNotifyHead,0
|
}else
|
||||||
vis tNotifyText,0
|
{
|
||||||
}
|
vis tNotifyHead,0
|
||||||
tNotifyHead.bco=tTime.bco
|
vis tNotifyText,0
|
||||||
tNotifyText.bco=tTime.bco
|
}
|
||||||
spstr strCommand.txt,tTmp.txt,"~",3
|
tNotifyHead.bco=tTime.bco
|
||||||
if(tTmp.txt!="")
|
tNotifyText.bco=tTime.bco
|
||||||
{
|
spstr strCommand.txt,tTmp.txt,"~",3
|
||||||
covx tTmp.txt,tNotifyHead.pco,0,0
|
if(tTmp.txt!="")
|
||||||
}
|
{
|
||||||
spstr strCommand.txt,tTmp.txt,"~",4
|
covx tTmp.txt,tNotifyHead.pco,0,0
|
||||||
if(tTmp.txt!="")
|
}
|
||||||
{
|
spstr strCommand.txt,tTmp.txt,"~",4
|
||||||
covx tTmp.txt,tNotifyText.pco,0,0
|
if(tTmp.txt!="")
|
||||||
}
|
{
|
||||||
"""
|
covx tTmp.txt,tNotifyText.pco,0,0
|
||||||
|
}
|
||||||
print(head)
|
"""
|
||||||
|
|
||||||
|
print(head)
|
||||||
#start = 23
|
|
||||||
#for i in range(1,7):
|
|
||||||
# idxstart = start + (i-1)*6
|
#start = 23
|
||||||
# item = f"""
|
#for i in range(1,7):
|
||||||
# // get Type
|
# idxstart = start + (i-1)*6
|
||||||
# spstr strCommand.txt,type{i}.txt,"~",{idxstart}
|
# item = f"""
|
||||||
# // get internal name
|
# // get Type
|
||||||
# spstr strCommand.txt,entn{i}.txt,"~",{idxstart+1}
|
# spstr strCommand.txt,type{i}.txt,"~",{idxstart}
|
||||||
# if(type{i}.txt=="delete"||type{i}.txt=="")
|
# // get internal name
|
||||||
# {{
|
# spstr strCommand.txt,entn{i}.txt,"~",{idxstart+1}
|
||||||
# vis tEntity{i},0
|
# if(type{i}.txt=="delete"||type{i}.txt=="")
|
||||||
# vis bEntity{i},0
|
# {{
|
||||||
# }}else
|
# vis tEntity{i},0
|
||||||
# {{
|
# vis bEntity{i},0
|
||||||
# // change icon
|
# }}else
|
||||||
# spstr strCommand.txt,bEntity{i}.txt,"~",{idxstart+2}
|
# {{
|
||||||
# vis bEntity{i},1
|
# // change icon
|
||||||
# // change icon color
|
# spstr strCommand.txt,bEntity{i}.txt,"~",{idxstart+2}
|
||||||
# spstr strCommand.txt,tTmp.txt,"~",{idxstart+3}
|
# vis bEntity{i},1
|
||||||
# covx tTmp.txt,sys0,0,0
|
# // change icon color
|
||||||
# bEntity{i}.pco=sys0
|
# spstr strCommand.txt,tTmp.txt,"~",{idxstart+3}
|
||||||
# // set name
|
# covx tTmp.txt,sys0,0,0
|
||||||
# spstr strCommand.txt,tEntity{i}.txt,"~",{idxstart+4}
|
# bEntity{i}.pco=sys0
|
||||||
# vis tEntity{i},1
|
# // set name
|
||||||
# }}
|
# spstr strCommand.txt,tEntity{i}.txt,"~",{idxstart+4}
|
||||||
#"""
|
# vis tEntity{i},1
|
||||||
# print(item)
|
# }}
|
||||||
foot = """
|
#"""
|
||||||
}
|
# print(item)
|
||||||
""" + sharedfoot.replace("sleepValue=0", "dim=100").replace("""
|
foot = """
|
||||||
if(tInstruction.txt=="time")
|
}
|
||||||
{
|
""" + sharedfoot.replace("sleepValue=0", "dim=100").replace("""
|
||||||
// get set time to global variable
|
if(tInstruction.txt=="time")
|
||||||
spstr strCommand.txt,pageIcons.vaTime.txt,"~",1
|
{
|
||||||
}
|
// get set time to global variable
|
||||||
if(tInstruction.txt=="date")
|
spstr strCommand.txt,pageIcons.vaTime.txt,"~",1
|
||||||
{
|
}
|
||||||
// get set date to global variable
|
if(tInstruction.txt=="date")
|
||||||
spstr strCommand.txt,pageIcons.vaDate.txt,"~",1
|
{
|
||||||
}
|
// get set date to global variable
|
||||||
if(tInstruction.txt=="dimmode")
|
spstr strCommand.txt,pageIcons.vaDate.txt,"~",1
|
||||||
{
|
}
|
||||||
// get value
|
if(tInstruction.txt=="dimmode")
|
||||||
spstr strCommand.txt,tTmp.txt,"~",1
|
{
|
||||||
covx tTmp.txt,dimValue,0,0
|
// get value
|
||||||
// get value normal
|
spstr strCommand.txt,tTmp.txt,"~",1
|
||||||
spstr strCommand.txt,tTmp.txt,"~",2
|
covx tTmp.txt,dimValue,0,0
|
||||||
covx tTmp.txt,dimValueNormal,0,0
|
// get value normal
|
||||||
dim=dimValueNormal
|
spstr strCommand.txt,tTmp.txt,"~",2
|
||||||
// get background color
|
covx tTmp.txt,dimValueNormal,0,0
|
||||||
spstr strCommand.txt,tTmp.txt,"~",3
|
dim=dimValueNormal
|
||||||
if(tTmp.txt!="")
|
// get background color
|
||||||
{
|
spstr strCommand.txt,tTmp.txt,"~",3
|
||||||
covx tTmp.txt,defaultBcoColor,0,0
|
if(tTmp.txt!="")
|
||||||
}
|
{
|
||||||
// get font color
|
covx tTmp.txt,defaultBcoColor,0,0
|
||||||
spstr strCommand.txt,tTmp.txt,"~",4
|
}
|
||||||
if(tTmp.txt!="")
|
// get font color
|
||||||
{
|
spstr strCommand.txt,tTmp.txt,"~",4
|
||||||
covx tTmp.txt,defaultFontColor,0,0
|
if(tTmp.txt!="")
|
||||||
}
|
{
|
||||||
}""","")
|
covx tTmp.txt,defaultFontColor,0,0
|
||||||
print(foot)
|
}
|
||||||
|
}""","")
|
||||||
|
print(foot)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
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