add serial code

This commit is contained in:
Johannes Braun
2022-12-29 16:38:58 +01:00
parent 80670a4722
commit eac9a73f8a

View File

@@ -26,50 +26,16 @@ text += """
//tempStep //tempStep
spstr strCommand.txt,tTmp.txt,"~",20 spstr strCommand.txt,tTmp.txt,"~",20
covx tTmp.txt,xTempStep1.val,0,0 covx tTmp.txt,xTempStep1.val,0,0
// disable all buttons
vis bt0,0
vis bt1,0
vis bt2,0
vis bt3,0
vis bt4,0
vis bt5,0
vis bt6,0
vis bt7,0
"""
start = 21
for i in range(0,8):
idxstart = start + i*4
text += f"""
//bt{i}
spstr strCommand.txt,bt{i}.txt,"~",{idxstart}
if(bt{i}.txt!="")
{{
// set text color on active state
spstr strCommand.txt,tTmp.txt,"~",{idxstart+1}
covx tTmp.txt,bt{i}.pco2,0,0
// set state
spstr strCommand.txt,tTmp.txt,"~",{idxstart+2}
covx tTmp.txt,bt{i}.val,0,0
// save action
spstr strCommand.txt,va{i}.txt,"~",{idxstart+3}
//enable
vis bt{i},1
}}"""
text += """
//Text tCurTempLbl //Text tCurTempLbl
spstr strCommand.txt,tCurTempLbl.txt,"~",53 spstr strCommand.txt,tCurTempLbl.txt,"~",21
//Text tStateLbl //Text tStateLbl
spstr strCommand.txt,tStateLbl.txt,"~",54 spstr strCommand.txt,tStateLbl.txt,"~",22
//Text tALbl
spstr strCommand.txt,tALbl.txt,"~",55
//Text tCF //Text tCF
spstr strCommand.txt,tCF.txt,"~",56 spstr strCommand.txt,tCF.txt,"~",23
tCF1.txt=tCF.txt tCF1.txt=tCF.txt
tCF2.txt=tCF.txt tCF2.txt=tCF.txt
//Second Temperature //Second Temperature
spstr strCommand.txt,tTmp.txt,"~",57 spstr strCommand.txt,tTmp.txt,"~",24
if(tTmp.txt!="") if(tTmp.txt!="")
{ {
covx tTmp.txt,xTempDest2.val,0,0 covx tTmp.txt,xTempDest2.val,0,0
@@ -87,15 +53,46 @@ text += """
vis tCF2,1 vis tCF2,1
} }
//Show btDetail //Show btDetail
spstr strCommand.txt,tTmp.txt,"~",58 spstr strCommand.txt,tTmp.txt,"~",25
if(tTmp.txt!="1") if(tTmp.txt=="enable")
{ {
vis btDetail,1 vis btDetail,1
}else }else
{ {
vis btDetail,0 vis btDetail,0
} }
} """
""" + sharedfoot
print(text) print(text)
start = 26
for i in range(1,9):
idxstart = start + (i-1)*6
item = f"""
// get Type
spstr strCommand.txt,tTmp.txt,"~",{idxstart}
if(tTmp.txt=="delete"||tTmp.txt=="")
{{
vis bEntity{i},0
}}else
{{
// get internal name
spstr strCommand.txt,entn{i}.txt,"~",{idxstart+1}
// 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
}}
"""
print(item)
print("""
}
""" + sharedfoot
)