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

This commit is contained in:
joBr99
2023-02-13 19:09:13 +00:00
committed by github-actions[bot]
parent e0d73142c2
commit d8e6d5f246
9 changed files with 5559 additions and 3778 deletions

View File

@@ -1,923 +0,0 @@
--- HMI/n2t-out
+++ HMI/US/landscape/n2t-out
├── file list
│ @@ -14,9 +14,8 @@
│ popupFan.txt
│ popupInSel.txt
│ popupLight.txt
│ popupNotify.txt
│ popupShutter.txt
│ popupThermo.txt
│ popupTimer.txt
│ -screensaver.txt
│ -screensaver2.txt
│ +screensaver.txt
│ --- HMI/n2t-out/Program.s.txt
├── +++ HMI/US/landscape/n2t-out/Program.s.txt
│ @@ -11,9 +11,9 @@
│ // dim value
│ int dimValue=40
│ int dimValueNormal=100
│ //color vars
│ int defaultFontColor=65535
│ int defaultBcoColor=6371
│ // fix touch offset
│ - lcd_dev fffb 0002 0000 0020
│ + //lcd_dev fffb 0002 0000 0020
│ page pageStartup
│ --- HMI/n2t-out/cardAlarm.txt
├── +++ HMI/US/landscape/n2t-out/cardAlarm.txt
│ @@ -902,18 +902,14 @@
│ {
│ 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
│ --- HMI/n2t-out/cardChart.txt
├── +++ HMI/US/landscape/n2t-out/cardChart.txt
│ @@ -635,18 +635,14 @@
│ {
│ 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
│ --- HMI/n2t-out/cardEntities.txt
├── +++ HMI/US/landscape/n2t-out/cardEntities.txt
│ @@ -1885,18 +1885,14 @@
│ {
│ 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
│ --- HMI/n2t-out/cardGrid.txt
├── +++ HMI/US/landscape/n2t-out/cardGrid.txt
│ @@ -870,18 +870,14 @@
│ {
│ 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
│ --- HMI/n2t-out/cardLChart.txt
├── +++ HMI/US/landscape/n2t-out/cardLChart.txt
│ @@ -616,18 +616,14 @@
│ {
│ 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
│ --- HMI/n2t-out/cardMedia.txt
├── +++ HMI/US/landscape/n2t-out/cardMedia.txt
│ @@ -1154,18 +1154,14 @@
│ {
│ 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
│ --- HMI/n2t-out/cardPower.txt
├── +++ HMI/US/landscape/n2t-out/cardPower.txt
│ @@ -35,27 +35,27 @@
│ vis t0Icon,0
│ vis t1Icon,0
│ vis t2Icon,0
│ vis t3Icon,0
│ vis t4Icon,0
│ vis t5Icon,0
│ cardPower.bco=defaultBcoColor
│ - for(sys0=0;sys0<54;sys0++)
│ + for(sys0=0;sys0<48;sys0++)
│ {
│ if(b[sys0].type==98||b[sys0].type==116)
│ {
│ b[sys0].bco=defaultBcoColor
│ b[sys0].pco=defaultFontColor
│ }
│ if(defaultBcoColor==0)
│ {
│ if(b[sys0].type==1)
│ {
│ - b[sys0].pic=21
│ - b[sys0].pic1=21
│ + b[sys0].pic=19
│ + b[sys0].pic1=19
│ b[sys0].pic2=15
│ }
│ }
│ }
│ Variable (string) nent1
│ Attributes
│ @@ -69,15 +69,15 @@
│ Text :
│ Max. Text Size: 80
│ Variable (string) strCommand
│ Attributes
│ Scope : local
│ Text :
│ - Max. Text Size: 1000
│ + Max. Text Size: 275
│ Variable (int32) t0Speed
│ Attributes
│ Scope: local
│ Value: 0
│ Variable (int32) t1Speed
│ @@ -135,24 +135,14 @@
│ Dragging : 0
│ Disable release event after dragging: 0
│ Send Component ID : disabled
│ Associated Keyboard : none
│ Text : 
│ Max. Text Size : 5
│ -Text t0o
│ - Attributes
│ - Scope : local
│ - Dragging : 0
│ - Disable release event after dragging: 0
│ - Send Component ID : disabled
│ - Associated Keyboard : none
│ - Text :
│ - Max. Text Size : 20
│ -
│ Text t0u
│ Attributes
│ Scope : local
│ Dragging : 0
│ Disable release event after dragging: 0
│ Send Component ID : disabled
│ Associated Keyboard : none
│ @@ -175,24 +165,14 @@
│ Dragging : 0
│ Disable release event after dragging: 0
│ Send Component ID : disabled
│ Associated Keyboard : none
│ Text : 
│ Max. Text Size : 5
│ -Text t1o
│ - Attributes
│ - Scope : local
│ - Dragging : 0
│ - Disable release event after dragging: 0
│ - Send Component ID : disabled
│ - Associated Keyboard : none
│ - Text :
│ - Max. Text Size : 20
│ -
│ Text t1u
│ Attributes
│ Scope : local
│ Dragging : 0
│ Disable release event after dragging: 0
│ Send Component ID : disabled
│ Associated Keyboard : none
│ @@ -205,24 +185,14 @@
│ Dragging : 0
│ Disable release event after dragging: 0
│ Send Component ID : disabled
│ Associated Keyboard : none
│ Text : î °
│ Max. Text Size : 5
│ -Text t2o
│ - Attributes
│ - Scope : local
│ - Dragging : 0
│ - Disable release event after dragging: 0
│ - Send Component ID : disabled
│ - Associated Keyboard : none
│ - Text :
│ - Max. Text Size : 20
│ -
│ Text t2u
│ Attributes
│ Scope : local
│ Dragging : 0
│ Disable release event after dragging: 0
│ Send Component ID : disabled
│ Associated Keyboard : none
│ @@ -235,24 +205,14 @@
│ Dragging : 0
│ Disable release event after dragging: 0
│ Send Component ID : disabled
│ Associated Keyboard : none
│ Text : î °
│ Max. Text Size : 5
│ -Text t3o
│ - Attributes
│ - Scope : local
│ - Dragging : 0
│ - Disable release event after dragging: 0
│ - Send Component ID : disabled
│ - Associated Keyboard : none
│ - Text :
│ - Max. Text Size : 20
│ -
│ Text t3u
│ Attributes
│ Scope : local
│ Dragging : 0
│ Disable release event after dragging: 0
│ Send Component ID : disabled
│ Associated Keyboard : none
│ @@ -265,24 +225,14 @@
│ Dragging : 0
│ Disable release event after dragging: 0
│ Send Component ID : disabled
│ Associated Keyboard : none
│ Text : î´½
│ Max. Text Size : 5
│ -Text t4o
│ - Attributes
│ - Scope : local
│ - Dragging : 0
│ - Disable release event after dragging: 0
│ - Send Component ID : disabled
│ - Associated Keyboard : none
│ - Text :
│ - Max. Text Size : 20
│ -
│ Text t4u
│ Attributes
│ Scope : local
│ Dragging : 0
│ Disable release event after dragging: 0
│ Send Component ID : disabled
│ Associated Keyboard : none
│ @@ -295,24 +245,14 @@
│ Dragging : 0
│ Disable release event after dragging: 0
│ Send Component ID : disabled
│ Associated Keyboard : none
│ Text : 
│ Max. Text Size : 5
│ -Text t5o
│ - Attributes
│ - Scope : local
│ - Dragging : 0
│ - Disable release event after dragging: 0
│ - Send Component ID : disabled
│ - Associated Keyboard : none
│ - Text :
│ - Max. Text Size : 20
│ -
│ Text t5u
│ Attributes
│ Scope : local
│ Dragging : 0
│ Disable release event after dragging: 0
│ Send Component ID : disabled
│ Associated Keyboard : none
│ @@ -535,85 +475,79 @@
│ h0.val=h0.minval
│ }
│ if(sys0<h0.minval)
│ {
│ h0.val=h0.maxval
│ }
│ h0.val+=t0Speed.val
│ - ref t0u
│ }
│ if(t1Speed.val!=0)
│ {
│ sys0=h1.val+t1Speed.val
│ if(sys0>h1.maxval)
│ {
│ h1.val=h1.minval
│ }
│ if(sys0<h1.minval)
│ {
│ h1.val=h1.maxval
│ }
│ h1.val+=t1Speed.val
│ - ref t1u
│ }
│ if(t2Speed.val!=0)
│ {
│ sys0=h2.val+t2Speed.val
│ if(sys0>h2.maxval)
│ {
│ h2.val=h2.minval
│ }
│ if(sys0<h2.minval)
│ {
│ h2.val=h2.maxval
│ }
│ h2.val+=t2Speed.val
│ - ref t2u
│ }
│ if(t3Speed.val!=0)
│ {
│ sys0=h3.val+t3Speed.val
│ if(sys0>h3.maxval)
│ {
│ h3.val=h3.minval
│ }
│ if(sys0<h3.minval)
│ {
│ h3.val=h3.maxval
│ }
│ h3.val+=t3Speed.val
│ - ref t3u
│ }
│ if(t4Speed.val!=0)
│ {
│ sys0=h4.val+t4Speed.val
│ if(sys0>h4.maxval)
│ {
│ h4.val=h4.minval
│ }
│ if(sys0<h4.minval)
│ {
│ h4.val=h4.maxval
│ }
│ h4.val+=t4Speed.val
│ - ref t4u
│ }
│ if(t5Speed.val!=0)
│ {
│ sys0=h5.val+t5Speed.val
│ if(sys0>h5.maxval)
│ {
│ h5.val=h5.minval
│ }
│ if(sys0<h5.minval)
│ {
│ h5.val=h5.maxval
│ }
│ h5.val+=t5Speed.val
│ - ref t5u
│ }
│ Timer tmSerial
│ Attributes
│ Scope : local
│ Period (ms): 50
│ Enabled : yes
│ @@ -661,14 +595,15 @@
│ // 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=="entityUpd")
│ {
│ + // command format: entityUpd,heading,navigation,colorHome,iconHome[,iconColor,icon,speed,valueUp,valueDown]x6
│ spstr strCommand.txt,tHeading.txt,"~",1
│ // navigation icon left
│ spstr strCommand.txt,tTmp.txt,"~",2 //type
│ if(tTmp.txt=="delete"||tTmp.txt=="")
│ {
│ vis bPrev,0
│ }else
│ @@ -697,202 +632,193 @@
│ // change icon color
│ spstr strCommand.txt,tTmp.txt,"~",11
│ covx tTmp.txt,sys0,0,0
│ bNext.pco=sys0
│ vis bNext,1
│ }
│ // icon color home
│ - spstr strCommand.txt,tTmp.txt,"~",17
│ + spstr strCommand.txt,tTmp.txt,"~",14
│ covx tTmp.txt,t1.pco,0,0
│ // icon home
│ - spstr strCommand.txt,t1.txt,"~",16
│ + spstr strCommand.txt,t1.txt,"~",15
│ // speed 16 ignored
│ // text home
│ - spstr strCommand.txt,tHome.txt,"~",19
│ + spstr strCommand.txt,tHome.txt,"~",17
│ spstr tHome.txt,tHome2.txt," ",1
│ spstr tHome.txt,tHome.txt," ",0
│ + // icon color 18 ignored
│ + // icon 19 ignored
│ + // speed 20 ignored
│ // text home
│ - spstr strCommand.txt,tHomeO.txt,"~",26
│ + spstr strCommand.txt,tHomeO.txt,"~",21
│ spstr tHomeO.txt,tHomeO2.txt," ",1
│ spstr tHomeO.txt,tHomeO.txt," ",0
│ // iconColor
│ - spstr strCommand.txt,tTmp.txt,"~",31
│ + spstr strCommand.txt,tTmp.txt,"~",22
│ covx tTmp.txt,t0Icon.pco,0,0
│ // icon
│ - spstr strCommand.txt,t0Icon.txt,"~",30
│ + spstr strCommand.txt,t0Icon.txt,"~",23
│ // speed
│ - spstr strCommand.txt,tTmp.txt,"~",34
│ + spstr strCommand.txt,tTmp.txt,"~",24
│ covx tTmp.txt,t0Speed.val,0,0
│ if(t0Speed.val>120)
│ {
│ t0Speed.val=120
│ }
│ if(t0Speed.val<-120)
│ {
│ t0Speed.val=-120
│ }
│ // lower text
│ - spstr strCommand.txt,t0u.txt,"~",33
│ - // upper text
│ - spstr strCommand.txt,t0o.txt,"~",32
│ + spstr strCommand.txt,t0u.txt,"~",25
│ if(t0Icon.txt!="")
│ {
│ vis t0Icon,1
│ vis t0u,1
│ vis h0,1
│ }else
│ {
│ vis t0Icon,0
│ vis t0u,0
│ vis h0,0
│ }
│ // iconColor
│ - spstr strCommand.txt,tTmp.txt,"~",38
│ + spstr strCommand.txt,tTmp.txt,"~",26
│ covx tTmp.txt,t1Icon.pco,0,0
│ // icon
│ - spstr strCommand.txt,t1Icon.txt,"~",37
│ + spstr strCommand.txt,t1Icon.txt,"~",27
│ // speed
│ - spstr strCommand.txt,tTmp.txt,"~",41
│ + spstr strCommand.txt,tTmp.txt,"~",28
│ covx tTmp.txt,t1Speed.val,0,0
│ if(t1Speed.val>120)
│ {
│ t1Speed.val=120
│ }
│ if(t1Speed.val<-120)
│ {
│ t1Speed.val=-120
│ }
│ // lower text
│ - spstr strCommand.txt,t1u.txt,"~",40
│ - // upper text
│ - spstr strCommand.txt,t1o.txt,"~",39
│ + spstr strCommand.txt,t1u.txt,"~",29
│ if(t1Icon.txt!="")
│ {
│ vis t1Icon,1
│ vis t1u,1
│ vis h1,1
│ }else
│ {
│ vis t1Icon,0
│ vis t1u,0
│ vis h1,0
│ }
│ // iconColor
│ - spstr strCommand.txt,tTmp.txt,"~",45
│ + spstr strCommand.txt,tTmp.txt,"~",30
│ covx tTmp.txt,t2Icon.pco,0,0
│ // icon
│ - spstr strCommand.txt,t2Icon.txt,"~",44
│ + spstr strCommand.txt,t2Icon.txt,"~",31
│ // speed
│ - spstr strCommand.txt,tTmp.txt,"~",48
│ + spstr strCommand.txt,tTmp.txt,"~",32
│ covx tTmp.txt,t2Speed.val,0,0
│ if(t2Speed.val>120)
│ {
│ t2Speed.val=120
│ }
│ if(t2Speed.val<-120)
│ {
│ t2Speed.val=-120
│ }
│ // lower text
│ - spstr strCommand.txt,t2u.txt,"~",47
│ - // upper text
│ - spstr strCommand.txt,t2o.txt,"~",46
│ + spstr strCommand.txt,t2u.txt,"~",33
│ if(t2Icon.txt!="")
│ {
│ vis t2Icon,1
│ vis t2u,1
│ vis h2,1
│ }else
│ {
│ vis t2Icon,0
│ vis t2u,0
│ vis h2,0
│ }
│ // iconColor
│ - spstr strCommand.txt,tTmp.txt,"~",52
│ + spstr strCommand.txt,tTmp.txt,"~",34
│ covx tTmp.txt,t3Icon.pco,0,0
│ // icon
│ - spstr strCommand.txt,t3Icon.txt,"~",51
│ + spstr strCommand.txt,t3Icon.txt,"~",35
│ // speed
│ - spstr strCommand.txt,tTmp.txt,"~",55
│ + spstr strCommand.txt,tTmp.txt,"~",36
│ covx tTmp.txt,t3Speed.val,0,0
│ if(t3Speed.val>120)
│ {
│ t3Speed.val=120
│ }
│ if(t3Speed.val<-120)
│ {
│ t3Speed.val=-120
│ }
│ // lower text
│ - spstr strCommand.txt,t3u.txt,"~",54
│ - // upper text
│ - spstr strCommand.txt,t3o.txt,"~",53
│ + spstr strCommand.txt,t3u.txt,"~",37
│ if(t3Icon.txt!="")
│ {
│ vis t3Icon,1
│ vis t3u,1
│ vis h3,1
│ }else
│ {
│ vis t3Icon,0
│ vis t3u,0
│ vis h3,0
│ }
│ // iconColor
│ - spstr strCommand.txt,tTmp.txt,"~",59
│ + spstr strCommand.txt,tTmp.txt,"~",38
│ covx tTmp.txt,t4Icon.pco,0,0
│ // icon
│ - spstr strCommand.txt,t4Icon.txt,"~",58
│ + spstr strCommand.txt,t4Icon.txt,"~",39
│ // speed
│ - spstr strCommand.txt,tTmp.txt,"~",62
│ + spstr strCommand.txt,tTmp.txt,"~",40
│ covx tTmp.txt,t4Speed.val,0,0
│ if(t4Speed.val>120)
│ {
│ t4Speed.val=120
│ }
│ if(t4Speed.val<-120)
│ {
│ t4Speed.val=-120
│ }
│ // lower text
│ - spstr strCommand.txt,t4u.txt,"~",61
│ - // upper text
│ - spstr strCommand.txt,t4o.txt,"~",60
│ + spstr strCommand.txt,t4u.txt,"~",41
│ if(t4Icon.txt!="")
│ {
│ vis t4Icon,1
│ vis t4u,1
│ vis h4,1
│ }else
│ {
│ vis t4Icon,0
│ vis t4u,0
│ vis h4,0
│ }
│ // iconColor
│ - spstr strCommand.txt,tTmp.txt,"~",66
│ + spstr strCommand.txt,tTmp.txt,"~",42
│ covx tTmp.txt,t5Icon.pco,0,0
│ // icon
│ - spstr strCommand.txt,t5Icon.txt,"~",65
│ + spstr strCommand.txt,t5Icon.txt,"~",43
│ // speed
│ - spstr strCommand.txt,tTmp.txt,"~",69
│ + spstr strCommand.txt,tTmp.txt,"~",44
│ covx tTmp.txt,t5Speed.val,0,0
│ if(t5Speed.val>120)
│ {
│ t5Speed.val=120
│ }
│ if(t5Speed.val<-120)
│ {
│ t5Speed.val=-120
│ }
│ // lower text
│ - spstr strCommand.txt,t5u.txt,"~",68
│ - // upper text
│ - spstr strCommand.txt,t5o.txt,"~",67
│ + spstr strCommand.txt,t5u.txt,"~",45
│ if(t5Icon.txt!="")
│ {
│ vis t5Icon,1
│ vis t5u,1
│ vis h5,1
│ }else
│ {
│ @@ -919,18 +845,14 @@
│ {
│ 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
│ @@ -969,14 +891,18 @@
│ {
│ page cardPower
│ }
│ if(tId.txt=="cardChart")
│ {
│ page cardChart
│ }
│ + if(tId.txt=="cardLChart")
│ + {
│ + page cardLChart
│ + }
│ }
│ if(tInstruction.txt=="time")
│ {
│ // get set time to global variable
│ spstr strCommand.txt,pageIcons.vaTime.txt,"~",1
│ }
│ if(tInstruction.txt=="date")
│ --- HMI/n2t-out/cardQR.txt
├── +++ HMI/US/landscape/n2t-out/cardQR.txt
│ @@ -669,18 +669,14 @@
│ {
│ 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
│ --- HMI/n2t-out/cardThermo.txt
├── +++ HMI/US/landscape/n2t-out/cardThermo.txt
│ @@ -1071,18 +1071,14 @@
│ {
│ 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
│ --- HMI/n2t-out/pageStartup.txt
├── +++ HMI/US/landscape/n2t-out/pageStartup.txt
│ @@ -179,15 +179,15 @@
│ Max. Text Size : 10
│ Events
│ Touch Press Event
│ recmod=1
│ bauds=115200
│ // startup event
│ - tSend.txt="event,startup,"+tVersion.txt+",eu"
│ + tSend.txt="event,startup,"+tVersion.txt+",us-l"
│ //send calc crc
│ btlen tSend.txt,sys0
│ crcrest 1,0xffff // reset CRC
│ crcputh 55 bb
│ crcputs sys0,2
│ crcputs tSend.txt,0
│ //send cmd
│ @@ -320,18 +320,14 @@
│ {
│ 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
│ --- HMI/n2t-out/screensaver.txt
├── +++ HMI/US/landscape/n2t-out/screensaver.txt
│ @@ -29,17 +29,14 @@
│ }
│ tDate.txt=pageIcons.vaDate.txt
│ dim=dimValue
│ vis tSend,0
│ //page open event
│ // clear weather elements, to keep example content in HMI
│ - Postinitialize Event
│ - click m0,1
│ -
│ Variable (string) strCommand
│ Attributes
│ Scope : local
│ Text :
│ Max. Text Size: 600
│ Variable (string) strTmp
│ @@ -103,35 +100,14 @@
│ Value: 0
│ Variable (int32) ycR
│ Attributes
│ Scope: local
│ Value: 0
│ -Text m0
│ - Attributes
│ - Scope : local
│ - Dragging : 0
│ - Disable release event after dragging: 0
│ - Send Component ID : disabled
│ - Associated Keyboard : none
│ - Text :
│ - Max. Text Size : 10
│ -
│ - Events
│ - Touch Press Event
│ - tTmp.txt="change model conf to us-l/p "
│ - strlen tTmp.txt,sys1
│ - sya1=sys1*11+m0.h-48/2
│ - for(sys0=0;sys0<sys1;sys0++)
│ - {
│ - substr tTmp.txt,strTmp.txt,sys0,1
│ - xstr m0.x-5,sys0*-11+m0.y+sya1,23,20,6,WHITE,RED,2,1,3,strTmp.txt
│ - }
│ -
│ Text t10
│ Attributes
│ Scope : local
│ Dragging : 0
│ Disable release event after dragging: 0
│ Send Component ID : disabled
│ Associated Keyboard : none
│ @@ -590,42 +566,39 @@
│ //tMainTextAlt2
│ spstr strCommand.txt,tMainTextAlt2.txt,"~",36
│ //tMainIconAlt2
│ spstr strCommand.txt,tMainIconAlt2.txt,"~",33
│ //tMainIconAlt2 Color
│ spstr strCommand.txt,tTmp.txt,"~",34
│ covx tTmp.txt,tMainIconAlt2.pco,0,0
│ - if(tMainTextAlt2.txt!="")
│ + if(tMainTextAlt2.txt!=""&&p0.w!=320)
│ {
│ //value for tMRIcon, activate alternative layout
│ vis tMainIcon,0
│ vis tMainText,0
│ vis tMainTextAlt,1
│ vis tMainIconAlt,1
│ vis tMainTextAlt2,1
│ vis tMainIconAlt2,1
│ - if(p0.w!=320)
│ - {
│ - vis tForecast1,0
│ - vis tF1Icon,0
│ - vis tForecast1Val,0
│ - //move forecast values to the right
│ - tForecast4.txt=tForecast3.txt
│ - tForecast3.txt=tForecast2.txt
│ - tForecast2.txt=tForecast1.txt
│ - tForecast4Val.txt=tForecast3Val.txt
│ - tForecast3Val.txt=tForecast2Val.txt
│ - tForecast2Val.txt=tForecast1Val.txt
│ - tF4Icon.txt=tF3Icon.txt
│ - tF3Icon.txt=tF2Icon.txt
│ - tF2Icon.txt=tF1Icon.txt
│ - tF4Icon.pco=tF3Icon.pco
│ - tF3Icon.pco=tF2Icon.pco
│ - tF2Icon.pco=tF1Icon.pco
│ - }
│ + vis tForecast1,0
│ + vis tF1Icon,0
│ + vis tForecast1Val,0
│ + //move forecast values to the right
│ + tForecast4.txt=tForecast3.txt
│ + tForecast3.txt=tForecast2.txt
│ + tForecast2.txt=tForecast1.txt
│ + tForecast4Val.txt=tForecast3Val.txt
│ + tForecast3Val.txt=tForecast2Val.txt
│ + tForecast2Val.txt=tForecast1Val.txt
│ + tF4Icon.txt=tF3Icon.txt
│ + tF3Icon.txt=tF2Icon.txt
│ + tF2Icon.txt=tF1Icon.txt
│ + tF4Icon.pco=tF3Icon.pco
│ + tF3Icon.pco=tF2Icon.pco
│ + tF2Icon.pco=tF1Icon.pco
│ }else
│ {
│ vis tMainIcon,1
│ vis tMainIconAlt,0
│ vis tMainText,1
│ vis tMainTextAlt,0
│ vis tMainTextAlt2,0

View File

@@ -82,9 +82,13 @@ cardPower
48 Component(s)
487 Line(s) of event code
326 Unique line(s) of event code
screensaver2
58 Component(s)
344 Line(s) of event code
243 Unique line(s) of event code
Total
20 Page(s)
736 Component(s)
8799 Line(s) of event code
2255 Unique line(s) of event code
21 Page(s)
794 Component(s)
9143 Line(s) of event code
2307 Unique line(s) of event code

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,978 @@
Page screensaver2
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Locked : no
Swide up page ID : disabled
Swide down page ID : disabled
Swide left page ID : disabled
Swide right page ID : disabled
Events
Preinitialize Event
recmod=1
baud=115200
vis tInstruction,0
vis tTmp,0
vis p0,0
vis tNotifyHead,0
vis tNotifyText,0
//load gloabl time string from pageIcons
//tTime.txt=vaTime.txt
spstr pageIcons.vaTime.txt,tTime.txt,"?",0
spstr pageIcons.vaTime.txt,tAMPM.txt,"?",1
if(tAMPM.txt=="")
{
vis tAMPM,0
}
tDate.txt=pageIcons.vaDate.txt
dim=dimValue
vis tSend,0
//page open event
// clear weather elements, to keep example content in HMI
Variable (string) strCommand
Attributes
Scope : local
Text :
Max. Text Size: 1979
Variable (string) strTmp
Attributes
Scope : local
Text :
Max. Text Size: 2
Variable (string) tId
Attributes
Scope : local
Text :
Max. Text Size: 25
Variable (string) tInstruction
Attributes
Scope : local
Text :
Max. Text Size: 50
Variable (string) tSend
Attributes
Scope : local
Text :
Max. Text Size: 50
Variable (string) tTmp
Attributes
Scope : local
Text :
Max. Text Size: 50
Variable (int32) vaTap
Attributes
Scope: local
Value: 0
Variable (int32) xc1
Attributes
Scope: local
Value: 0
Variable (int32) xc2
Attributes
Scope: local
Value: 0
Variable (int32) xcR
Attributes
Scope: local
Value: 0
Variable (int32) yc1
Attributes
Scope: local
Value: 0
Variable (int32) yc2
Attributes
Scope: local
Value: 0
Variable (int32) ycR
Attributes
Scope: local
Value: 0
Text d1Icon
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 4
Text d1Val
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 10
Text d2Icon
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 4
Text d2Val
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 10
Text d3Icon
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 4
Text d3Val
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 10
Text e1Icon
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 4
Text e1Name
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 10
Text e1Val
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 10
Text e2Icon
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 4
Text e2Name
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 10
Text e2Val
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 10
Text e3Icon
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 4
Text e3Name
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 10
Text e3Val
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 10
Text e4Icon
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 4
Text e4Name
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 10
Text e4Val
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 10
Text e5Icon
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 4
Text e5Name
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 10
Text e5Val
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 10
Text e6Icon
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 4
Text e6Name
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 10
Text e6Val
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 10
Text f1Icon
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 4
Text f2Icon
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 4
Text f3Icon
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 4
Text f4Icon
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 4
Text f5Icon
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 4
Text tAMPM
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text : PM
Max. Text Size : 10
Text tDate
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text : Thursday, 02.02
Max. Text Size : 30
Text tIcon1
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 10
Text tIcon2
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 10
Text tMainIcon
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 4
Text tMainText
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 10
Text tNotifyHead
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 35
Text tNotifyText
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 120
Text tTime
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text : 21:32
Max. Text Size : 15
Text tTimeAdd
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 20
Picture p0
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Timer tm0
Attributes
Scope : local
Period (ms): 50
Enabled : yes
Events
Timer Event
if(tc0.val!=0)
{
xc2.val=tch0
yc2.val=tch1
}
Timer tmSerial
Attributes
Scope : local
Period (ms): 50
Enabled : yes
Events
Timer Event
// 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")
{
//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++
}
}
Timer tmSleep
Attributes
Scope : local
Period (ms): 1000
Enabled : yes
Events
Timer Event
if(sleepTimeout!=0&&dimValue!=dim)
{
sleepValue+=1
if(sleepTimeout<=sleepValue)
{
sleepValue=0
dim=dimValue
vaTap.val=0
}
}
TouchCap tc0
Attributes
Scope: local
Value: 0
Events
Touch Press Event
xc1.val=tch0
yc1.val=tch1
tm0.en=1
if(tNotifyHead.txt!=""||tNotifyText.txt!="")
{
if(dim!=0)
{
tNotifyHead.txt=""
tNotifyText.txt=""
vis tNotifyHead,0
vis tNotifyText,0
}
}
dim=dimValueNormal
vaTap.val+=1
covx vaTap.val,tTmp.txt,0,0
tSend.txt="event,buttonPress2,screensaver,bExit,"+tTmp.txt
//send calc crc
//btlen tSend.txt,sys0
//crcrest 1,0xffff // reset CRC
//crcputh 55 bb
//crcputs sys0,2
//crcputs tSend.txt,0
//send cmd
//printh 55 bb
//prints sys0,2
//prints tSend.txt,0
//prints crcval,2
Touch Release Event
tm0.en=0
if(tch0==0)
// When this is zero we can interpret that as the real end of the drag event
{
xcR.val=xc1.val-xc2.val
ycR.val=yc1.val-yc2.val
// new method
// one of the difference values should be low to be a valid direction, in case it has a high value it's not a valid swipe, because it's diagonal
// x difference between -125 and 125 (swipe on y-axis)
if(xcR.val>-125&&xcR.val<125)
{
//tStatusNew.txt="x low, -> y"
// check if below minimum value (change is negative)
if(ycR.val<-80)
{
//tDirNew.txt="down"
tSend.txt="event,buttonPress2,screensaver,swipeDown"
}else if(ycR.val>80)
{
//tDirNew.txt="up"
tSend.txt="event,buttonPress2,screensaver,swipeUp"
}else
{
//tDirNew.txt="invalid"
}
// y difference between -125 and 125 (swipe on x-axis)
}else if(ycR.val>-125&&ycR.val<125)
{
//tStatusNew.txt="y low, -> x"
if(xcR.val<-80)
{
//tDirNew.txt="right"
tSend.txt="event,buttonPress2,screensaver,swipeRight"
}else if(xcR.val>80)
{
//tDirNew.txt="left"
tSend.txt="event,buttonPress2,screensaver,swipeLeft"
}else
{
//tDirNew.txt="invalid"
}
//diagonal swipe invalid
}else
{
//tStatusNew.txt="invalid"
//tDirNew.txt="diagonal"
}
}
//send calc crc
btlen tSend.txt,sys0
crcrest 1,0xffff // reset CRC
crcputh 55 bb
crcputs sys0,2
crcputs tSend.txt,0
//send cmd
printh 55 bb
prints sys0,2
prints tSend.txt,0
prints crcval,2

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -78,13 +78,17 @@ popupInSel
34 Component(s)
617 Line(s) of event code
295 Unique line(s) of event code
screensaver2
58 Component(s)
344 Line(s) of event code
243 Unique line(s) of event code
cardEntities
91 Component(s)
1622 Line(s) of event code
701 Unique line(s) of event code
Total
20 Page(s)
753 Component(s)
9210 Line(s) of event code
2395 Unique line(s) of event code
21 Page(s)
811 Component(s)
9554 Line(s) of event code
2447 Unique line(s) of event code

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,978 @@
Page screensaver2
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Locked : no
Swide up page ID : disabled
Swide down page ID : disabled
Swide left page ID : disabled
Swide right page ID : disabled
Events
Preinitialize Event
recmod=1
baud=115200
vis tInstruction,0
vis tTmp,0
vis p0,0
vis tNotifyHead,0
vis tNotifyText,0
//load gloabl time string from pageIcons
//tTime.txt=vaTime.txt
spstr pageIcons.vaTime.txt,tTime.txt,"?",0
spstr pageIcons.vaTime.txt,tAMPM.txt,"?",1
if(tAMPM.txt=="")
{
vis tAMPM,0
}
tDate.txt=pageIcons.vaDate.txt
dim=dimValue
vis tSend,0
//page open event
// clear weather elements, to keep example content in HMI
Variable (string) strCommand
Attributes
Scope : local
Text :
Max. Text Size: 1979
Variable (string) strTmp
Attributes
Scope : local
Text :
Max. Text Size: 2
Variable (string) tId
Attributes
Scope : local
Text :
Max. Text Size: 25
Variable (string) tInstruction
Attributes
Scope : local
Text :
Max. Text Size: 50
Variable (string) tSend
Attributes
Scope : local
Text :
Max. Text Size: 50
Variable (string) tTmp
Attributes
Scope : local
Text :
Max. Text Size: 50
Variable (int32) vaTap
Attributes
Scope: local
Value: 0
Variable (int32) xc1
Attributes
Scope: local
Value: 0
Variable (int32) xc2
Attributes
Scope: local
Value: 0
Variable (int32) xcR
Attributes
Scope: local
Value: 0
Variable (int32) yc1
Attributes
Scope: local
Value: 0
Variable (int32) yc2
Attributes
Scope: local
Value: 0
Variable (int32) ycR
Attributes
Scope: local
Value: 0
Text d1Icon
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 4
Text d1Val
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 10
Text d2Icon
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 4
Text d2Val
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 10
Text d3Icon
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 4
Text d3Val
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 10
Text e1Icon
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 4
Text e1Name
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 10
Text e1Val
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 10
Text e2Icon
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 4
Text e2Name
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 10
Text e2Val
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 10
Text e3Icon
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 4
Text e3Name
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 10
Text e3Val
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 10
Text e4Icon
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 4
Text e4Name
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 10
Text e4Val
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 10
Text e5Icon
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 4
Text e5Name
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 10
Text e5Val
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 10
Text e6Icon
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 4
Text e6Name
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 10
Text e6Val
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 10
Text f1Icon
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 4
Text f2Icon
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 4
Text f3Icon
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 4
Text f4Icon
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 4
Text f5Icon
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 4
Text tAMPM
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text : PM
Max. Text Size : 10
Text tDate
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text : Thursday, 02.02
Max. Text Size : 30
Text tIcon1
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 10
Text tIcon2
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 10
Text tMainIcon
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 4
Text tMainText
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 10
Text tNotifyHead
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 35
Text tNotifyText
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 120
Text tTime
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text : 21:32
Max. Text Size : 15
Text tTimeAdd
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 20
Picture p0
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Timer tm0
Attributes
Scope : local
Period (ms): 50
Enabled : yes
Events
Timer Event
if(tc0.val!=0)
{
xc2.val=tch0
yc2.val=tch1
}
Timer tmSerial
Attributes
Scope : local
Period (ms): 50
Enabled : yes
Events
Timer Event
// 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")
{
//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++
}
}
Timer tmSleep
Attributes
Scope : local
Period (ms): 1000
Enabled : yes
Events
Timer Event
if(sleepTimeout!=0&&dimValue!=dim)
{
sleepValue+=1
if(sleepTimeout<=sleepValue)
{
sleepValue=0
dim=dimValue
vaTap.val=0
}
}
TouchCap tc0
Attributes
Scope: local
Value: 0
Events
Touch Press Event
xc1.val=tch0
yc1.val=tch1
tm0.en=1
if(tNotifyHead.txt!=""||tNotifyText.txt!="")
{
if(dim!=0)
{
tNotifyHead.txt=""
tNotifyText.txt=""
vis tNotifyHead,0
vis tNotifyText,0
}
}
dim=dimValueNormal
vaTap.val+=1
covx vaTap.val,tTmp.txt,0,0
tSend.txt="event,buttonPress2,screensaver,bExit,"+tTmp.txt
//send calc crc
//btlen tSend.txt,sys0
//crcrest 1,0xffff // reset CRC
//crcputh 55 bb
//crcputs sys0,2
//crcputs tSend.txt,0
//send cmd
//printh 55 bb
//prints sys0,2
//prints tSend.txt,0
//prints crcval,2
Touch Release Event
tm0.en=0
if(tch0==0)
// When this is zero we can interpret that as the real end of the drag event
{
xcR.val=xc1.val-xc2.val
ycR.val=yc1.val-yc2.val
// new method
// one of the difference values should be low to be a valid direction, in case it has a high value it's not a valid swipe, because it's diagonal
// x difference between -125 and 125 (swipe on y-axis)
if(xcR.val>-125&&xcR.val<125)
{
//tStatusNew.txt="x low, -> y"
// check if below minimum value (change is negative)
if(ycR.val<-80)
{
//tDirNew.txt="down"
tSend.txt="event,buttonPress2,screensaver,swipeDown"
}else if(ycR.val>80)
{
//tDirNew.txt="up"
tSend.txt="event,buttonPress2,screensaver,swipeUp"
}else
{
//tDirNew.txt="invalid"
}
// y difference between -125 and 125 (swipe on x-axis)
}else if(ycR.val>-125&&ycR.val<125)
{
//tStatusNew.txt="y low, -> x"
if(xcR.val<-80)
{
//tDirNew.txt="right"
tSend.txt="event,buttonPress2,screensaver,swipeRight"
}else if(xcR.val>80)
{
//tDirNew.txt="left"
tSend.txt="event,buttonPress2,screensaver,swipeLeft"
}else
{
//tDirNew.txt="invalid"
}
//diagonal swipe invalid
}else
{
//tStatusNew.txt="invalid"
//tDirNew.txt="diagonal"
}
}
//send calc crc
btlen tSend.txt,sys0
crcrest 1,0xffff // reset CRC
crcputh 55 bb
crcputs sys0,2
crcputs tSend.txt,0
//send cmd
printh 55 bb
prints sys0,2
prints tSend.txt,0
prints crcval,2