Merge branch 'main' of github.com:joBr99/nspanel-widget-ui

This commit is contained in:
Johannes Braun
2022-03-19 14:07:35 +01:00
3 changed files with 333 additions and 348 deletions

View File

@@ -1971,352 +1971,337 @@ Timer tmSerial
} }
if(tInstruction.txt=="entityUpd") if(tInstruction.txt=="entityUpd")
{ {
// command format: entityUpd,id,icon,name,type,optionalValue // command format: entityUpd[,type,internalName,iconId,displayName,optionalValue]x4
// write id to tId (debug output, but used as variable here, ui elements will be disabled by default) // get Type
spstr strCommand.txt,tId.txt,",",1 spstr strCommand.txt,type1.txt,",",1
// id 1 // get internal name
if(tId.txt=="1") spstr strCommand.txt,entn1.txt,",",2
if(type1.txt=="delete")
{ {
// get Type vis bUp1,0
spstr strCommand.txt,type1.txt,",",2 vis bStop1,0
// get internal name vis bDown1,0
spstr strCommand.txt,entn1.txt,",",3 vis btOnOff1,0
if(type1.txt=="delete") vis tEntity1,0
{ vis tIcon1,0
vis bUp1,0 vis bText1,0
vis bStop1,0 }else
vis bDown1,0 {
vis btOnOff1,0 // change icon
vis tEntity1,0 spstr strCommand.txt,tTmp.txt,",",3
vis tIcon1,0 covx tTmp.txt,sys0,0,0
vis bText1,0 substr pageIcons.tIcons.txt,tIcon1.txt,sys0,1
}else vis tIcon1,1
{ // set name
// change icon spstr strCommand.txt,tEntity1.txt,",",4
spstr strCommand.txt,tTmp.txt,",",4 vis tEntity1,1
covx tTmp.txt,sys0,0,0
substr pageIcons.tIcons.txt,tIcon1.txt,sys0,1
vis tIcon1,1
// set name
spstr strCommand.txt,tEntity1.txt,",",5
vis tEntity1,1
}
if(type1.txt=="shutter")
{
vis bUp1,1
vis bStop1,1
vis bDown1,1
vis btOnOff1,0
vis bText1,0
}
if(type1.txt=="light")
{
vis bUp1,0
vis bStop1,0
vis bDown1,0
vis btOnOff1,1
vis bText1,0
// get Button State (optional Value)
spstr strCommand.txt,tTmp.txt,",",6
covx tTmp.txt,sys0,0,0
btOnOff1.val=sys0
}
if(type1.txt=="switch")
{
vis bUp1,0
vis bStop1,0
vis bDown1,0
vis btOnOff1,1
vis bText1,0
// get Button State (optional Value)
spstr strCommand.txt,tTmp.txt,",",6
covx tTmp.txt,sys0,0,0
btOnOff1.val=sys0
}
if(type1.txt=="text")
{
vis bUp1,0
vis bStop1,0
vis bDown1,0
vis btOnOff1,0
vis bText1,1
tsw bText1,0
bText1.pco=65535
bText1.pco2=65535
// get Text (optional Value)
spstr strCommand.txt,bText1.txt,",",6
}
if(type1.txt=="button")
{
vis bUp1,0
vis bStop1,0
vis bDown1,0
vis btOnOff1,0
vis bText1,1
tsw bText1,1
bText1.pco=1374
bText1.pco2=1374
// get Text (optional Value)
spstr strCommand.txt,bText1.txt,",",6
}
} }
// id 2 if(type1.txt=="shutter")
if(tId.txt=="2")
{ {
// get Type vis bUp1,1
spstr strCommand.txt,type2.txt,",",2 vis bStop1,1
// get internal name vis bDown1,1
spstr strCommand.txt,entn2.txt,",",3 vis btOnOff1,0
if(type2.txt=="delete") vis bText1,0
{
vis bUp2,0
vis bStop2,0
vis bDown2,0
vis btOnOff2,0
vis tEntity2,0
vis tIcon2,0
vis bText2,0
}else
{
//change icon
spstr strCommand.txt,tTmp.txt,",",4
covx tTmp.txt,sys0,0,0
substr pageIcons.tIcons.txt,tIcon2.txt,sys0,1
vis tIcon2,1
// set name
spstr strCommand.txt,tEntity2.txt,",",5
vis tEntity2,1
}
if(type2.txt=="shutter")
{
vis bUp2,1
vis bStop2,1
vis bDown2,1
vis btOnOff2,0
vis bText2,0
}
if(type2.txt=="light")
{
vis bUp2,0
vis bStop2,0
vis bDown2,0
vis btOnOff2,1
vis bText2,0
// get Button State (optional Value)
spstr strCommand.txt,tTmp.txt,",",6
covx tTmp.txt,sys0,0,0
btOnOff2.val=sys0
}
if(type2.txt=="switch")
{
vis bUp2,0
vis bStop2,0
vis bDown2,0
vis btOnOff2,1
vis bText2,0
// get Button State (optional Value)
spstr strCommand.txt,tTmp.txt,",",6
covx tTmp.txt,sys0,0,0
btOnOff2.val=sys0
}
if(type2.txt=="text")
{
vis bUp2,0
vis bStop2,0
vis bDown2,0
vis btOnOff2,0
vis bText2,1
tsw bText2,0
bText2.pco=65535
bText2.pco2=65535
// get Text (optional Value)
spstr strCommand.txt,bText2.txt,",",6
}
if(type2.txt=="button")
{
vis bUp2,0
vis bStop2,0
vis bDown2,0
vis btOnOff2,0
vis bText2,1
tsw bText2,1
bText2.pco=1374
bText2.pco2=1374
// get Text (optional Value)
spstr strCommand.txt,bText2.txt,",",6
}
} }
// id 3 if(type1.txt=="light")
if(tId.txt=="3")
{ {
// get Type vis bUp1,0
spstr strCommand.txt,type3.txt,",",2 vis bStop1,0
// get internal name vis bDown1,0
spstr strCommand.txt,entn3.txt,",",3 vis btOnOff1,1
if(type3.txt=="delete") vis bText1,0
{ // get Button State (optional Value)
vis bUp3,0 spstr strCommand.txt,tTmp.txt,",",5
vis bStop3,0 covx tTmp.txt,sys0,0,0
vis bDown3,0 btOnOff1.val=sys0
vis btOnOff3,0
vis tEntity3,0
vis tIcon3,0
vis bText3,0
}else
{
//change icon
spstr strCommand.txt,tTmp.txt,",",4
covx tTmp.txt,sys0,0,0
substr pageIcons.tIcons.txt,tIcon3.txt,sys0,1
vis tIcon3,1
// set name
spstr strCommand.txt,tEntity3.txt,",",5
vis tEntity3,1
}
if(type3.txt=="shutter")
{
vis bUp3,1
vis bStop3,1
vis bDown3,1
vis btOnOff3,0
vis bText3,0
}
if(type3.txt=="light")
{
vis bUp3,0
vis bStop3,0
vis bDown3,0
vis bText3,0
vis btOnOff3,1
// get Button State (optional Value)
spstr strCommand.txt,tTmp.txt,",",6
covx tTmp.txt,sys0,0,0
btOnOff3.val=sys0
}
if(type3.txt=="switch")
{
vis bUp3,0
vis bStop3,0
vis bDown3,0
vis bText3,0
vis btOnOff3,1
// get Button State (optional Value)
spstr strCommand.txt,tTmp.txt,",",6
covx tTmp.txt,sys0,0,0
btOnOff3.val=sys0
}
if(type3.txt=="text")
{
vis bUp3,0
vis bStop3,0
vis bDown3,0
vis btOnOff3,0
vis bText3,1
tsw bText3,0
bText3.pco=65535
bText3.pco2=65535
// get Text (optional Value)
spstr strCommand.txt,bText3.txt,",",6
}
if(type3.txt=="button")
{
vis bUp3,0
vis bStop3,0
vis bDown3,0
vis btOnOff3,0
vis bText3,1
tsw bText3,1
bText3.pco=1374
bText3.pco2=1374
// get Text (optional Value)
spstr strCommand.txt,bText3.txt,",",6
}
} }
// id 2 if(type1.txt=="switch")
if(tId.txt=="4")
{ {
// get Type vis bUp1,0
spstr strCommand.txt,type4.txt,",",2 vis bStop1,0
// get internal name vis bDown1,0
spstr strCommand.txt,entn4.txt,",",3 vis btOnOff1,1
if(type4.txt=="delete") vis bText1,0
{ // get Button State (optional Value)
vis bUp4,0 spstr strCommand.txt,tTmp.txt,",",5
vis bStop4,0 covx tTmp.txt,sys0,0,0
vis bDown4,0 btOnOff1.val=sys0
vis btOnOff4,0 }
vis tEntity4,0 if(type1.txt=="text")
vis tIcon4,0 {
vis bText4,0 vis bUp1,0
}else vis bStop1,0
{ vis bDown1,0
//change icon vis btOnOff1,0
spstr strCommand.txt,tTmp.txt,",",4 vis bText1,1
covx tTmp.txt,sys0,0,0 tsw bText1,0
substr pageIcons.tIcons.txt,tIcon4.txt,sys0,1 bText1.pco=65535
vis tIcon4,1 bText1.pco2=65535
// set name // get Text (optional Value)
spstr strCommand.txt,tEntity4.txt,",",5 spstr strCommand.txt,bText1.txt,",",5
vis tEntity4,1 }
} if(type1.txt=="button")
if(type4.txt=="shutter") {
{ vis bUp1,0
vis bUp4,1 vis bStop1,0
vis bStop4,1 vis bDown1,0
vis bDown4,1 vis btOnOff1,0
vis btOnOff4,0 vis bText1,1
vis bText4,0 tsw bText1,1
} bText1.pco=1374
if(type4.txt=="light") bText1.pco2=1374
{ // get Text (optional Value)
vis bUp4,0 spstr strCommand.txt,bText1.txt,",",5
vis bStop4,0 }
vis bDown4,0 // id2
vis bText4,0 // get Type
vis btOnOff4,1 spstr strCommand.txt,type2.txt,",",6
// get Button State (optional Value) // get internal name
spstr strCommand.txt,tTmp.txt,",",6 spstr strCommand.txt,entn2.txt,",",7
covx tTmp.txt,sys0,0,0 if(type2.txt=="delete")
btOnOff4.val=sys0 {
} vis bUp2,0
if(type4.txt=="switch") vis bStop2,0
{ vis bDown2,0
vis bUp4,0 vis btOnOff2,0
vis bStop4,0 vis tEntity2,0
vis bDown4,0 vis tIcon2,0
vis bText4,0 vis bText2,0
vis btOnOff4,1 }else
// get Button State (optional Value) {
spstr strCommand.txt,tTmp.txt,",",6 //change icon
covx tTmp.txt,sys0,0,0 spstr strCommand.txt,tTmp.txt,",",8
btOnOff4.val=sys0 covx tTmp.txt,sys0,0,0
} substr pageIcons.tIcons.txt,tIcon2.txt,sys0,1
if(type4.txt=="text") vis tIcon2,1
{ // set name
vis bUp4,0 spstr strCommand.txt,tEntity2.txt,",",9
vis bStop4,0 vis tEntity2,1
vis bDown4,0 }
vis btOnOff4,0 if(type2.txt=="shutter")
vis bText4,1 {
tsw bText4,0 vis bUp2,1
bText4.pco=65535 vis bStop2,1
bText4.pco2=65535 vis bDown2,1
// get Text (optional Value) vis btOnOff2,0
spstr strCommand.txt,bText4.txt,",",6 vis bText2,0
} }
if(type4.txt=="button") if(type2.txt=="light")
{ {
vis bUp4,0 vis bUp2,0
vis bStop4,0 vis bStop2,0
vis bDown4,0 vis bDown2,0
vis btOnOff4,0 vis btOnOff2,1
vis bText4,1 vis bText2,0
tsw bText4,1 // get Button State (optional Value)
bText4.pco=1374 spstr strCommand.txt,tTmp.txt,",",10
bText4.pco2=1374 covx tTmp.txt,sys0,0,0
// get Text (optional Value) btOnOff2.val=sys0
spstr strCommand.txt,bText4.txt,",",6 }
} if(type2.txt=="switch")
{
vis bUp2,0
vis bStop2,0
vis bDown2,0
vis btOnOff2,1
vis bText2,0
// get Button State (optional Value)
spstr strCommand.txt,tTmp.txt,",",10
covx tTmp.txt,sys0,0,0
btOnOff2.val=sys0
}
if(type2.txt=="text")
{
vis bUp2,0
vis bStop2,0
vis bDown2,0
vis btOnOff2,0
vis bText2,1
tsw bText2,0
bText2.pco=65535
bText2.pco2=65535
// get Text (optional Value)
spstr strCommand.txt,bText2.txt,",",10
}
if(type2.txt=="button")
{
vis bUp2,0
vis bStop2,0
vis bDown2,0
vis btOnOff2,0
vis bText2,1
tsw bText2,1
bText2.pco=1374
bText2.pco2=1374
// get Text (optional Value)
spstr strCommand.txt,bText2.txt,",",10
}
// id3
// get Type
spstr strCommand.txt,type3.txt,",",11
// get internal name
spstr strCommand.txt,entn3.txt,",",12
if(type3.txt=="delete")
{
vis bUp3,0
vis bStop3,0
vis bDown3,0
vis btOnOff3,0
vis tEntity3,0
vis tIcon3,0
vis bText3,0
}else
{
//change icon
spstr strCommand.txt,tTmp.txt,",",13
covx tTmp.txt,sys0,0,0
substr pageIcons.tIcons.txt,tIcon3.txt,sys0,1
vis tIcon3,1
// set name
spstr strCommand.txt,tEntity3.txt,",",14
vis tEntity3,1
}
if(type3.txt=="shutter")
{
vis bUp3,1
vis bStop3,1
vis bDown3,1
vis btOnOff3,0
vis bText3,0
}
if(type3.txt=="light")
{
vis bUp3,0
vis bStop3,0
vis bDown3,0
vis bText3,0
vis btOnOff3,1
// get Button State (optional Value)
spstr strCommand.txt,tTmp.txt,",",15
covx tTmp.txt,sys0,0,0
btOnOff3.val=sys0
}
if(type3.txt=="switch")
{
vis bUp3,0
vis bStop3,0
vis bDown3,0
vis bText3,0
vis btOnOff3,1
// get Button State (optional Value)
spstr strCommand.txt,tTmp.txt,",",15
covx tTmp.txt,sys0,0,0
btOnOff3.val=sys0
}
if(type3.txt=="text")
{
vis bUp3,0
vis bStop3,0
vis bDown3,0
vis btOnOff3,0
vis bText3,1
tsw bText3,0
bText3.pco=65535
bText3.pco2=65535
// get Text (optional Value)
spstr strCommand.txt,bText3.txt,",",15
}
if(type3.txt=="button")
{
vis bUp3,0
vis bStop3,0
vis bDown3,0
vis btOnOff3,0
vis bText3,1
tsw bText3,1
bText3.pco=1374
bText3.pco2=1374
// get Text (optional Value)
spstr strCommand.txt,bText3.txt,",",15
}
// id4
// get Type
spstr strCommand.txt,type4.txt,",",16
// get internal name
spstr strCommand.txt,entn4.txt,",",17
if(type4.txt=="delete")
{
vis bUp4,0
vis bStop4,0
vis bDown4,0
vis btOnOff4,0
vis tEntity4,0
vis tIcon4,0
vis bText4,0
}else
{
//change icon
spstr strCommand.txt,tTmp.txt,",",18
covx tTmp.txt,sys0,0,0
substr pageIcons.tIcons.txt,tIcon4.txt,sys0,1
vis tIcon4,1
// set name
spstr strCommand.txt,tEntity4.txt,",",19
vis tEntity4,1
}
if(type4.txt=="shutter")
{
vis bUp4,1
vis bStop4,1
vis bDown4,1
vis btOnOff4,0
vis bText4,0
}
if(type4.txt=="light")
{
vis bUp4,0
vis bStop4,0
vis bDown4,0
vis bText4,0
vis btOnOff4,1
// get Button State (optional Value)
spstr strCommand.txt,tTmp.txt,",",20
covx tTmp.txt,sys0,0,0
btOnOff4.val=sys0
}
if(type4.txt=="switch")
{
vis bUp4,0
vis bStop4,0
vis bDown4,0
vis bText4,0
vis btOnOff4,1
// get Button State (optional Value)
spstr strCommand.txt,tTmp.txt,",",20
covx tTmp.txt,sys0,0,0
btOnOff4.val=sys0
}
if(type4.txt=="text")
{
vis bUp4,0
vis bStop4,0
vis bDown4,0
vis btOnOff4,0
vis bText4,1
tsw bText4,0
bText4.pco=65535
bText4.pco2=65535
// get Text (optional Value)
spstr strCommand.txt,bText4.txt,",",20
}
if(type4.txt=="button")
{
vis bUp4,0
vis bStop4,0
vis bDown4,0
vis btOnOff4,0
vis bText4,1
tsw bText4,1
bText4.pco=1374
bText4.pco2=1374
// get Text (optional Value)
spstr strCommand.txt,bText4.txt,",",20
} }
} }
if(tInstruction.txt=="pageType") if(tInstruction.txt=="pageType")

View File

@@ -38,25 +38,25 @@ pageSwipeTest
18 Component(s) 18 Component(s)
62 Line(s) of event code 62 Line(s) of event code
44 Unique line(s) of event code 44 Unique line(s) of event code
screensaver
25 Component(s)
152 Line(s) of event code
118 Unique line(s) of event code
cardThermo cardThermo
42 Component(s) 42 Component(s)
450 Line(s) of event code 450 Line(s) of event code
220 Unique line(s) of event code 220 Unique line(s) of event code
cardEntities cardEntities
55 Component(s) 55 Component(s)
824 Line(s) of event code 811 Line(s) of event code
313 Unique line(s) of event code 312 Unique line(s) of event code
cardAlarm cardAlarm
28 Component(s) 28 Component(s)
159 Line(s) of event code 159 Line(s) of event code
105 Unique line(s) of event code 105 Unique line(s) of event code
screensaver
25 Component(s)
152 Line(s) of event code
118 Unique line(s) of event code
Total Total
13 Page(s) 13 Page(s)
302 Component(s) 302 Component(s)
2665 Line(s) of event code 2652 Line(s) of event code
684 Unique line(s) of event code 682 Unique line(s) of event code

View File

@@ -730,7 +730,7 @@ Timer tmSerial
//pagenumber //pagenumber
spstr strCommand.txt,tTmp.txt,"?",1 spstr strCommand.txt,tTmp.txt,"?",1
covx tTmp.txt,sys0,0,0 covx tTmp.txt,sys0,0,0
substr pageIcons.tIcons.txt,nPage,sys0,1 nPage=sys0
//don't send current page number, wake will do //don't send current page number, wake will do
} }
if(tInstruction.txt=="pageType") if(tInstruction.txt=="pageType")