mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2025-12-28 10:24:20 +01:00
add draw cooldown (add nextion2text)
This commit is contained in:
committed by
github-actions[bot]
parent
62cbcf433d
commit
f020aa28b9
@@ -1302,7 +1302,46 @@
|
||||
│ tSend.txt="event,buttonPress2,"+entn.txt+","+"OnOff,"
|
||||
│ covx btOnOff1.val,tTmp.txt,0,0
|
||||
│ 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)
|
||||
│ spstr strCommand.txt,tInstruction.txt,"~",0
|
||||
│ spstr strCommand.txt,tTmp.txt,"~",1
|
||||
@@ -1339,25 +1378,13 @@
|
||||
│ + vis t2,1
|
||||
│ vis hBrightness,1
|
||||
│ 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)
|
||||
│ {
|
||||
│ 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"
|
||||
│ }
|
||||
│ + {
|
||||
│ + hBrightness.val=sys0
|
||||
│ + }
|
||||
│ }
|
||||
│ // get ColorTemp value
|
||||
│ spstr strCommand.txt,tTmp.txt,"~",6
|
||||
@@ -1375,7 +1402,7 @@
|
||||
│ // switch mode
|
||||
│ click bColor,1
|
||||
│ click bColor,0
|
||||
│ @@ -472,16 +529,16 @@
|
||||
│ @@ -481,16 +529,16 @@
|
||||
│ click bColor,1
|
||||
│ click bColor,0
|
||||
│ }
|
||||
@@ -1394,7 +1421,7 @@
|
||||
│ }
|
||||
│ // mode == 0 is rgb controls currently shown
|
||||
│ if(mode.val==0)
|
||||
│ @@ -492,36 +549,36 @@
|
||||
│ @@ -501,36 +549,36 @@
|
||||
│ }
|
||||
│ }
|
||||
│ // get Color value
|
||||
|
||||
@@ -2677,7 +2677,46 @@
|
||||
│ tSend.txt="event,buttonPress2,"+entn.txt+","+"OnOff,"
|
||||
│ covx btOnOff1.val,tTmp.txt,0,0
|
||||
│ 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)
|
||||
│ spstr strCommand.txt,tInstruction.txt,"~",0
|
||||
│ spstr strCommand.txt,tTmp.txt,"~",1
|
||||
@@ -2714,25 +2753,13 @@
|
||||
│ + vis t2,1
|
||||
│ vis hBrightness,1
|
||||
│ 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)
|
||||
│ {
|
||||
│ 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"
|
||||
│ }
|
||||
│ + {
|
||||
│ + hBrightness.val=sys0
|
||||
│ + }
|
||||
│ }
|
||||
│ // get ColorTemp value
|
||||
│ spstr strCommand.txt,tTmp.txt,"~",6
|
||||
@@ -2750,7 +2777,7 @@
|
||||
│ // switch mode
|
||||
│ click bColor,1
|
||||
│ click bColor,0
|
||||
│ @@ -472,16 +529,16 @@
|
||||
│ @@ -481,16 +529,16 @@
|
||||
│ click bColor,1
|
||||
│ click bColor,0
|
||||
│ }
|
||||
@@ -2769,7 +2796,7 @@
|
||||
│ }
|
||||
│ // mode == 0 is rgb controls currently shown
|
||||
│ if(mode.val==0)
|
||||
│ @@ -492,36 +549,36 @@
|
||||
│ @@ -501,36 +549,36 @@
|
||||
│ }
|
||||
│ }
|
||||
│ // get Color value
|
||||
|
||||
@@ -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
|
||||
++ HMI/US/portrait/n2t-out/Program.s.txt
|
||||
+1 +10,10 @@
|
||||
@@ -57,13 +57,13 @@
|
||||
+ributes
|
||||
+ Scope : local
|
||||
+ Text :
|
||||
+ Max. Text Size: 80
|
||||
+ Max. Text Size: 40
|
||||
+
|
||||
+e (string) nent2
|
||||
+ributes
|
||||
+ Scope : local
|
||||
+ Text :
|
||||
+ Max. Text Size: 80
|
||||
+ Max. Text Size: 40
|
||||
+14 +186,26 @@
|
||||
+e (string) type6
|
||||
@@ -1483,9 +1483,6 @@
|
||||
+ Associated Keyboard: none
|
||||
+ Text : newtxt
|
||||
+ Max. Text Size : 100
|
||||
+ Scope : local
|
||||
+ Dragging : 0
|
||||
+ Disable release event after dragging: 0
|
||||
+ Send Component ID : disabled
|
||||
+ Associated Keyboard : none
|
||||
+ Text : newtxt
|
||||
@@ -1541,6 +1538,9 @@
|
||||
+ State : unpressed
|
||||
+ Text : startup
|
||||
+ Max. Text Size : 10
|
||||
+ Scope : local
|
||||
+ Dragging : 0
|
||||
+ Disable release event after dragging: 0
|
||||
+ Send Component ID : disabled
|
||||
+ State : unpressed
|
||||
+ Text : startup
|
||||
@@ -2067,7 +2067,46 @@
|
||||
+ tSend.txt="event,buttonPress2,"+entn.txt+","+"OnOff,"
|
||||
+ covx btOnOff1.val,tTmp.txt,0,0
|
||||
+ 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)
|
||||
+ spstr strCommand.txt,tInstruction.txt,"~",0
|
||||
+ spstr strCommand.txt,tTmp.txt,"~",1
|
||||
@@ -2104,24 +2143,12 @@
|
||||
+ vis t2,1
|
||||
+ vis hBrightness,1
|
||||
+ 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)
|
||||
+ {
|
||||
+ 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
|
||||
|
||||
@@ -10,10 +10,6 @@ pageTest
|
||||
27 Component(s)
|
||||
68 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
|
||||
19 Component(s)
|
||||
263 Line(s) of event code
|
||||
@@ -34,6 +30,10 @@ screensaver2
|
||||
59 Component(s)
|
||||
354 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
|
||||
33 Component(s)
|
||||
433 Line(s) of event code
|
||||
@@ -89,6 +89,6 @@ cardEntities
|
||||
|
||||
Total
|
||||
21 Page(s)
|
||||
799 Component(s)
|
||||
800 Component(s)
|
||||
9262 Line(s) of event code
|
||||
2348 Unique line(s) of event code
|
||||
2343 Unique line(s) of event code
|
||||
|
||||
@@ -511,6 +511,31 @@ Timer tmCooldown
|
||||
Timer Event
|
||||
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
|
||||
Attributes
|
||||
ID : 8
|
||||
@@ -591,24 +616,9 @@ Timer tmSerial
|
||||
//vis t2,1
|
||||
vis hBrightness,1
|
||||
covx tTmp.txt,sys0,0,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"
|
||||
}
|
||||
hBrightness.val=sys0
|
||||
tmDrawCooldown.en=1
|
||||
tmDrawCooldown.tim=500
|
||||
}
|
||||
// get ColorTemp value
|
||||
spstr strCommand.txt,tTmp.txt,"~",6
|
||||
|
||||
@@ -349,6 +349,30 @@ Timer tmCooldown
|
||||
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
|
||||
@@ -428,24 +452,9 @@ Timer tmSerial
|
||||
//vis t2,1
|
||||
vis hBrightness,1
|
||||
covx tTmp.txt,sys0,0,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"
|
||||
}
|
||||
hBrightness.val=sys0
|
||||
tmDrawCooldown.en=1
|
||||
tmDrawCooldown.tim=500
|
||||
}
|
||||
// get ColorTemp value
|
||||
spstr strCommand.txt,tTmp.txt,"~",6
|
||||
|
||||
Reference in New Issue
Block a user