add draw cooldown (add nextion2text)

This commit is contained in:
joBr99
2023-04-19 16:16:31 +00:00
committed by github-actions[bot]
parent 62cbcf433d
commit f020aa28b9
6 changed files with 205 additions and 105 deletions

View File

@@ -1302,7 +1302,46 @@
│ tSend.txt="event,buttonPress2,"+entn.txt+","+"OnOff," │ tSend.txt="event,buttonPress2,"+entn.txt+","+"OnOff,"
│ covx btOnOff1.val,tTmp.txt,0,0 │ covx btOnOff1.val,tTmp.txt,0,0
│ tSend.txt+=tTmp.txt │ tSend.txt+=tTmp.txt
│ @@ -401,63 +473,48 @@ │ @@ -345,38 +417,14 @@
│ Period (ms): 100
│ Enabled : no
│ Events
│ Timer Event
│ tmCooldown.en=0
│ -Timer tmDrawCooldown
│ - Attributes
│ - Scope : local
│ - Period (ms): 500
│ - Enabled : no
│ -
│ - Events
│ - Timer Event
│ - //draw black background
│ - fill hBrightness.x,hBrightness.y,100,hBrightness.val*-25/10+250,8484
│ - //draw draw colored bar at the position of the current brightness value
│ - fill hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.val*25/10,col.val
│ - if(hBrightness.val>7)
│ - {
│ - //draw cursor
│ - fill hBrightness.x+25,hBrightness.val*-25/10+322,50,4,WHITE
│ - //paint corner
│ - xstr hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.h,7,8484,0,0,0,3,"a"
│ - }
│ - //paint corners
│ - xstr hBrightness.x,hBrightness.y,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"a"
│ - xstr hBrightness.x,hBrightness.y+hBrightness.h-15,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"b"
│ - tmDrawCooldown.en=0
│ -
│ Timer tmSerial
│ Attributes
│ Scope : local
│ Period (ms): 50
│ Enabled : yes
│ Events
│ @@ -425,48 +473,48 @@
│ // write instruction to tInstuction (debug output, but used as variable here, ui elements will be disabled by default) │ // write instruction to tInstuction (debug output, but used as variable here, ui elements will be disabled by default)
│ spstr strCommand.txt,tInstruction.txt,"~",0 │ spstr strCommand.txt,tInstruction.txt,"~",0
│ spstr strCommand.txt,tTmp.txt,"~",1 │ spstr strCommand.txt,tTmp.txt,"~",1
@@ -1339,25 +1378,13 @@
│ + vis t2,1 │ + vis t2,1
│ vis hBrightness,1 │ vis hBrightness,1
│ covx tTmp.txt,sys0,0,0 │ covx tTmp.txt,sys0,0,0
│ - if(tmCooldown.en==0&&hBrightness.val!=sys0) │ - hBrightness.val=sys0
│ - tmDrawCooldown.en=1
│ - tmDrawCooldown.tim=500
│ + if(tmCooldown.en==0) │ + if(tmCooldown.en==0)
{ + {
hBrightness.val=sys0 + hBrightness.val=sys0
- //draw black background + }
│ - fill hBrightness.x,hBrightness.y,100,hBrightness.val*-25/10+250,8484
│ - //draw draw colored bar at the position of the current brightness value
│ - fill hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.val*25/10,col.val
│ - if(hBrightness.val>7)
│ - {
│ - //draw cursor
│ - fill hBrightness.x+25,hBrightness.val*-25/10+322,50,4,WHITE
│ - //paint corner
│ - xstr hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.h,7,8484,0,0,0,3,"a"
│ - }
│ - //paint corners
│ - xstr hBrightness.x,hBrightness.y,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"a"
│ - xstr hBrightness.x,hBrightness.y+hBrightness.h-15,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"b"
│ }
│ } │ }
│ // get ColorTemp value │ // get ColorTemp value
│ spstr strCommand.txt,tTmp.txt,"~",6 │ spstr strCommand.txt,tTmp.txt,"~",6
@@ -1375,7 +1402,7 @@
│ // switch mode │ // switch mode
│ click bColor,1 │ click bColor,1
│ click bColor,0 │ click bColor,0
│ @@ -472,16 +529,16 @@ │ @@ -481,16 +529,16 @@
│ click bColor,1 │ click bColor,1
│ click bColor,0 │ click bColor,0
│ } │ }
@@ -1394,7 +1421,7 @@
│ } │ }
│ // mode == 0 is rgb controls currently shown │ // mode == 0 is rgb controls currently shown
│ if(mode.val==0) │ if(mode.val==0)
│ @@ -492,36 +549,36 @@ │ @@ -501,36 +549,36 @@
│ } │ }
│ } │ }
│ // get Color value │ // get Color value

View File

@@ -2677,7 +2677,46 @@
│ tSend.txt="event,buttonPress2,"+entn.txt+","+"OnOff," │ tSend.txt="event,buttonPress2,"+entn.txt+","+"OnOff,"
│ covx btOnOff1.val,tTmp.txt,0,0 │ covx btOnOff1.val,tTmp.txt,0,0
│ tSend.txt+=tTmp.txt │ tSend.txt+=tTmp.txt
│ @@ -401,63 +473,48 @@ │ @@ -345,38 +417,14 @@
│ Period (ms): 100
│ Enabled : no
│ Events
│ Timer Event
│ tmCooldown.en=0
│ -Timer tmDrawCooldown
│ - Attributes
│ - Scope : local
│ - Period (ms): 500
│ - Enabled : no
│ -
│ - Events
│ - Timer Event
│ - //draw black background
│ - fill hBrightness.x,hBrightness.y,100,hBrightness.val*-25/10+250,8484
│ - //draw draw colored bar at the position of the current brightness value
│ - fill hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.val*25/10,col.val
│ - if(hBrightness.val>7)
│ - {
│ - //draw cursor
│ - fill hBrightness.x+25,hBrightness.val*-25/10+322,50,4,WHITE
│ - //paint corner
│ - xstr hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.h,7,8484,0,0,0,3,"a"
│ - }
│ - //paint corners
│ - xstr hBrightness.x,hBrightness.y,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"a"
│ - xstr hBrightness.x,hBrightness.y+hBrightness.h-15,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"b"
│ - tmDrawCooldown.en=0
│ -
│ Timer tmSerial
│ Attributes
│ Scope : local
│ Period (ms): 50
│ Enabled : yes
│ Events
│ @@ -425,48 +473,48 @@
│ // write instruction to tInstuction (debug output, but used as variable here, ui elements will be disabled by default) │ // write instruction to tInstuction (debug output, but used as variable here, ui elements will be disabled by default)
│ spstr strCommand.txt,tInstruction.txt,"~",0 │ spstr strCommand.txt,tInstruction.txt,"~",0
│ spstr strCommand.txt,tTmp.txt,"~",1 │ spstr strCommand.txt,tTmp.txt,"~",1
@@ -2714,25 +2753,13 @@
│ + vis t2,1 │ + vis t2,1
│ vis hBrightness,1 │ vis hBrightness,1
│ covx tTmp.txt,sys0,0,0 │ covx tTmp.txt,sys0,0,0
│ - if(tmCooldown.en==0&&hBrightness.val!=sys0) │ - hBrightness.val=sys0
│ - tmDrawCooldown.en=1
│ - tmDrawCooldown.tim=500
│ + if(tmCooldown.en==0) │ + if(tmCooldown.en==0)
{ + {
hBrightness.val=sys0 + hBrightness.val=sys0
- //draw black background + }
│ - fill hBrightness.x,hBrightness.y,100,hBrightness.val*-25/10+250,8484
│ - //draw draw colored bar at the position of the current brightness value
│ - fill hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.val*25/10,col.val
│ - if(hBrightness.val>7)
│ - {
│ - //draw cursor
│ - fill hBrightness.x+25,hBrightness.val*-25/10+322,50,4,WHITE
│ - //paint corner
│ - xstr hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.h,7,8484,0,0,0,3,"a"
│ - }
│ - //paint corners
│ - xstr hBrightness.x,hBrightness.y,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"a"
│ - xstr hBrightness.x,hBrightness.y+hBrightness.h-15,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"b"
│ }
│ } │ }
│ // get ColorTemp value │ // get ColorTemp value
│ spstr strCommand.txt,tTmp.txt,"~",6 │ spstr strCommand.txt,tTmp.txt,"~",6
@@ -2750,7 +2777,7 @@
│ // switch mode │ // switch mode
│ click bColor,1 │ click bColor,1
│ click bColor,0 │ click bColor,0
│ @@ -472,16 +529,16 @@ │ @@ -481,16 +529,16 @@
│ click bColor,1 │ click bColor,1
│ click bColor,0 │ click bColor,0
│ } │ }
@@ -2769,7 +2796,7 @@
│ } │ }
│ // mode == 0 is rgb controls currently shown │ // mode == 0 is rgb controls currently shown
│ if(mode.val==0) │ if(mode.val==0)
│ @@ -492,36 +549,36 @@ │ @@ -501,36 +549,36 @@
│ } │ }
│ } │ }
│ // get Color value │ // get Color value

View File

@@ -1,4 +1,4 @@
+++ /dev/fd/62 2023-04-18 22:17:40.643093312 +0000 +++ /dev/fd/62 2023-04-19 16:16:22.100652931 +0000
+I/n2t-out/Program.s.txt +I/n2t-out/Program.s.txt
++ HMI/US/portrait/n2t-out/Program.s.txt ++ HMI/US/portrait/n2t-out/Program.s.txt
+1 +10,10 @@ +1 +10,10 @@
@@ -57,13 +57,13 @@
+ributes +ributes
+ Scope : local + Scope : local
+ Text : + Text :
+ Max. Text Size: 80
+ Max. Text Size: 40 + Max. Text Size: 40
+ +
+e (string) nent2 +e (string) nent2
+ributes +ributes
+ Scope : local + Scope : local
+ Text : + Text :
+ Max. Text Size: 80
+ Max. Text Size: 40 + Max. Text Size: 40
+14 +186,26 @@ +14 +186,26 @@
+e (string) type6 +e (string) type6
@@ -1483,9 +1483,6 @@
+ Associated Keyboard: none + Associated Keyboard: none
+ Text : newtxt + Text : newtxt
+ Max. Text Size : 100 + Max. Text Size : 100
+ Scope : local
+ Dragging : 0
+ Disable release event after dragging: 0
+ Send Component ID : disabled + Send Component ID : disabled
+ Associated Keyboard : none + Associated Keyboard : none
+ Text : newtxt + Text : newtxt
@@ -1541,6 +1538,9 @@
+ State : unpressed + State : unpressed
+ Text : startup + Text : startup
+ Max. Text Size : 10 + Max. Text Size : 10
+ Scope : local
+ Dragging : 0
+ Disable release event after dragging: 0
+ Send Component ID : disabled + Send Component ID : disabled
+ State : unpressed + State : unpressed
+ Text : startup + Text : startup
@@ -2067,7 +2067,46 @@
+ tSend.txt="event,buttonPress2,"+entn.txt+","+"OnOff," + tSend.txt="event,buttonPress2,"+entn.txt+","+"OnOff,"
+ covx btOnOff1.val,tTmp.txt,0,0 + covx btOnOff1.val,tTmp.txt,0,0
+ tSend.txt+=tTmp.txt + tSend.txt+=tTmp.txt
+63 +473,48 @@ +38 +417,14 @@
+ Period (ms): 100
+ Enabled : no
+
+nts
+ Timer Event
+ tmCooldown.en=0
+
+mDrawCooldown
+ributes
+ Scope : local
+ Period (ms): 500
+ Enabled : no
+
+nts
+ Timer Event
+ //draw black background
+ fill hBrightness.x,hBrightness.y,100,hBrightness.val*-25/10+250,8484
+ //draw draw colored bar at the position of the current brightness value
+ fill hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.val*25/10,col.val
+ if(hBrightness.val>7)
+ {
+ //draw cursor
+ fill hBrightness.x+25,hBrightness.val*-25/10+322,50,4,WHITE
+ //paint corner
+ xstr hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.h,7,8484,0,0,0,3,"a"
+ }
+ //paint corners
+ xstr hBrightness.x,hBrightness.y,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"a"
+ xstr hBrightness.x,hBrightness.y+hBrightness.h-15,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"b"
+ tmDrawCooldown.en=0
+
+mSerial
+ributes
+ Scope : local
+ Period (ms): 50
+ Enabled : yes
+
+nts
+48 +473,48 @@
+ // write instruction to tInstuction (debug output, but used as variable here, ui elements will be disabled by default) + // write instruction to tInstuction (debug output, but used as variable here, ui elements will be disabled by default)
+ spstr strCommand.txt,tInstruction.txt,"~",0 + spstr strCommand.txt,tInstruction.txt,"~",0
+ spstr strCommand.txt,tTmp.txt,"~",1 + spstr strCommand.txt,tTmp.txt,"~",1
@@ -2104,24 +2143,12 @@
+ vis t2,1 + vis t2,1
+ vis hBrightness,1 + vis hBrightness,1
+ covx tTmp.txt,sys0,0,0 + covx tTmp.txt,sys0,0,0
+ if(tmCooldown.en==0&&hBrightness.val!=sys0) + hBrightness.val=sys0
+ tmDrawCooldown.en=1
+ tmDrawCooldown.tim=500
+ if(tmCooldown.en==0) + if(tmCooldown.en==0)
+ { + {
+ hBrightness.val=sys0 + hBrightness.val=sys0
+ //draw black background
+ fill hBrightness.x,hBrightness.y,100,hBrightness.val*-25/10+250,8484
+ //draw draw colored bar at the position of the current brightness value
+ fill hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.val*25/10,col.val
+ if(hBrightness.val>7)
+ {
+ //draw cursor
+ fill hBrightness.x+25,hBrightness.val*-25/10+322,50,4,WHITE
+ //paint corner
+ xstr hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.h,7,8484,0,0,0,3,"a"
+ }
+ //paint corners
+ xstr hBrightness.x,hBrightness.y,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"a"
+ xstr hBrightness.x,hBrightness.y+hBrightness.h-15,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"b"
+ } + }
+ } + }
+ // get ColorTemp value + // get ColorTemp value

View File

@@ -10,10 +10,6 @@ pageTest
27 Component(s) 27 Component(s)
68 Line(s) of event code 68 Line(s) of event code
66 Unique line(s) of event code 66 Unique line(s) of event code
popupLight
22 Component(s)
406 Line(s) of event code
214 Unique line(s) of event code
popupNotify popupNotify
19 Component(s) 19 Component(s)
263 Line(s) of event code 263 Line(s) of event code
@@ -34,6 +30,10 @@ screensaver2
59 Component(s) 59 Component(s)
354 Line(s) of event code 354 Line(s) of event code
251 Unique line(s) of event code 251 Unique line(s) of event code
popupLight
23 Component(s)
406 Line(s) of event code
207 Unique line(s) of event code
cardChart cardChart
33 Component(s) 33 Component(s)
433 Line(s) of event code 433 Line(s) of event code
@@ -89,6 +89,6 @@ cardEntities
Total Total
21 Page(s) 21 Page(s)
799 Component(s) 800 Component(s)
9262 Line(s) of event code 9262 Line(s) of event code
2348 Unique line(s) of event code 2343 Unique line(s) of event code

View File

@@ -511,6 +511,31 @@ Timer tmCooldown
Timer Event Timer Event
tmCooldown.en=0 tmCooldown.en=0
Timer tmDrawCooldown
Attributes
ID : 22
Scope : local
Period (ms): 500
Enabled : no
Events
Timer Event
//draw black background
fill hBrightness.x,hBrightness.y,100,hBrightness.val*-25/10+250,8484
//draw draw colored bar at the position of the current brightness value
fill hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.val*25/10,col.val
if(hBrightness.val>7)
{
//draw cursor
fill hBrightness.x+25,hBrightness.val*-25/10+322,50,4,WHITE
//paint corner
xstr hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.h,7,8484,0,0,0,3,"a"
}
//paint corners
xstr hBrightness.x,hBrightness.y,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"a"
xstr hBrightness.x,hBrightness.y+hBrightness.h-15,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"b"
tmDrawCooldown.en=0
Timer tmSerial Timer tmSerial
Attributes Attributes
ID : 8 ID : 8
@@ -591,24 +616,9 @@ Timer tmSerial
//vis t2,1 //vis t2,1
vis hBrightness,1 vis hBrightness,1
covx tTmp.txt,sys0,0,0 covx tTmp.txt,sys0,0,0
if(tmCooldown.en==0&&hBrightness.val!=sys0) hBrightness.val=sys0
{ tmDrawCooldown.en=1
hBrightness.val=sys0 tmDrawCooldown.tim=500
//draw black background
fill hBrightness.x,hBrightness.y,100,hBrightness.val*-25/10+250,8484
//draw draw colored bar at the position of the current brightness value
fill hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.val*25/10,col.val
if(hBrightness.val>7)
{
//draw cursor
fill hBrightness.x+25,hBrightness.val*-25/10+322,50,4,WHITE
//paint corner
xstr hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.h,7,8484,0,0,0,3,"a"
}
//paint corners
xstr hBrightness.x,hBrightness.y,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"a"
xstr hBrightness.x,hBrightness.y+hBrightness.h-15,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"b"
}
} }
// get ColorTemp value // get ColorTemp value
spstr strCommand.txt,tTmp.txt,"~",6 spstr strCommand.txt,tTmp.txt,"~",6

View File

@@ -349,6 +349,30 @@ Timer tmCooldown
Timer Event Timer Event
tmCooldown.en=0 tmCooldown.en=0
Timer tmDrawCooldown
Attributes
Scope : local
Period (ms): 500
Enabled : no
Events
Timer Event
//draw black background
fill hBrightness.x,hBrightness.y,100,hBrightness.val*-25/10+250,8484
//draw draw colored bar at the position of the current brightness value
fill hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.val*25/10,col.val
if(hBrightness.val>7)
{
//draw cursor
fill hBrightness.x+25,hBrightness.val*-25/10+322,50,4,WHITE
//paint corner
xstr hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.h,7,8484,0,0,0,3,"a"
}
//paint corners
xstr hBrightness.x,hBrightness.y,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"a"
xstr hBrightness.x,hBrightness.y+hBrightness.h-15,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"b"
tmDrawCooldown.en=0
Timer tmSerial Timer tmSerial
Attributes Attributes
Scope : local Scope : local
@@ -428,24 +452,9 @@ Timer tmSerial
//vis t2,1 //vis t2,1
vis hBrightness,1 vis hBrightness,1
covx tTmp.txt,sys0,0,0 covx tTmp.txt,sys0,0,0
if(tmCooldown.en==0&&hBrightness.val!=sys0) hBrightness.val=sys0
{ tmDrawCooldown.en=1
hBrightness.val=sys0 tmDrawCooldown.tim=500
//draw black background
fill hBrightness.x,hBrightness.y,100,hBrightness.val*-25/10+250,8484
//draw draw colored bar at the position of the current brightness value
fill hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.val*25/10,col.val
if(hBrightness.val>7)
{
//draw cursor
fill hBrightness.x+25,hBrightness.val*-25/10+322,50,4,WHITE
//paint corner
xstr hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.h,7,8484,0,0,0,3,"a"
}
//paint corners
xstr hBrightness.x,hBrightness.y,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"a"
xstr hBrightness.x,hBrightness.y+hBrightness.h-15,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"b"
}
} }
// get ColorTemp value // get ColorTemp value
spstr strCommand.txt,tTmp.txt,"~",6 spstr strCommand.txt,tTmp.txt,"~",6