. (add nextion2text)

This commit is contained in:
joBr99
2022-03-22 15:09:16 +00:00
committed by GitHub Actions
parent cbfd803a65
commit 277b2ccfd6
2 changed files with 83 additions and 96 deletions

View File

@@ -22,10 +22,6 @@ 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
popupLight
27 Component(s)
338 Line(s) of event code
170 Unique line(s) of event code
pageTest pageTest
14 Component(s) 14 Component(s)
14 Line(s) of event code 14 Line(s) of event code
@@ -50,6 +46,10 @@ cardThermo
42 Component(s) 42 Component(s)
412 Line(s) of event code 412 Line(s) of event code
221 Unique line(s) of event code 221 Unique line(s) of event code
popupLight
26 Component(s)
343 Line(s) of event code
165 Unique line(s) of event code
cardEntities cardEntities
54 Component(s) 54 Component(s)
808 Line(s) of event code 808 Line(s) of event code
@@ -61,6 +61,6 @@ cardAlarm
Total Total
14 Page(s) 14 Page(s)
350 Component(s) 349 Component(s)
3256 Line(s) of event code 3261 Line(s) of event code
843 Unique line(s) of event code 823 Unique line(s) of event code

View File

@@ -78,15 +78,9 @@ Variable (int32) mode
Scope: local Scope: local
Value: 1 Value: 1
Variable (int32) mode_bright
Attributes
ID : 24
Scope: local
Value: 0
Variable (int32) mode_temp Variable (int32) mode_temp
Attributes Attributes
ID : 25 ID : 24
Scope: local Scope: local
Value: 0 Value: 0
@@ -392,7 +386,7 @@ Text tId
Text t0 Text t0
Attributes Attributes
ID : 26 ID : 25
Scope : local Scope : local
Dragging : 0 Dragging : 0
Disable release event after dragging: 0 Disable release event after dragging: 0
@@ -710,11 +704,6 @@ Button bColor
mode.val=0 mode.val=0
//enable color wheel //enable color wheel
vis pColorWheel,1 vis pColorWheel,1
//vis t0,1
//disable brightness
//vis t1,0
//vis t2,0
//vis hBrightness,0
//disable color temp //disable color temp
vis t4,0 vis t4,0
vis t3,0 vis t3,0
@@ -724,14 +713,6 @@ Button bColor
mode.val=1 mode.val=1
//disable color wheel //disable color wheel
vis pColorWheel,0 vis pColorWheel,0
//vis t0,0
//if(mode_bright.val==1)
//{
// //enable brightness
// vis t1,1
// vis t2,1
// vis hBrightness,1
//}
if(mode_temp.val==1) if(mode_temp.val==1)
{ {
//enable color temp //enable color temp
@@ -885,46 +866,61 @@ Timer tmSerial
vis t1,0 vis t1,0
vis t2,0 vis t2,0
vis hBrightness,0 vis hBrightness,0
mode_bright.val=0
}else }else
{ {
vis t1,1 vis t1,1
vis t2,1 vis t2,1
vis hBrightness,1 vis hBrightness,1
mode_bright.val=1
covx tTmp.txt,sys0,0,0 covx tTmp.txt,sys0,0,0
hBrightness.val=sys0 hBrightness.val=sys0
} }
if(mode.val==1) // get ColorTemp value
spstr strCommand.txt,tTmp.txt,",",5
if(tTmp.txt=="disable")
{ {
// get ColorTemp value vis hTempSlider,0
spstr strCommand.txt,tTmp.txt,",",5 vis t3,0
if(tTmp.txt=="unknown") vis t4,0
// mode == 1 is temp controls currently shown
if(mode.val==1)
{ {
// switch mode
click bColor,1 click bColor,1
mode_temp.val=1 click bColor,0
}else if(tTmp.txt=="disable") }
}else if(tTmp.txt=="unknown") // temp supported, but not in color mode
{
// mode == 1 is temp controls currently shown
if(mode.val==1)
{ {
vis t4,0 // switch mode
vis t3,0 click bColor,1
vis hTempSlider,0 click bColor,0
mode_temp.val=0 }
}else }else
{
vis hTempSlider,1
vis t3,1
vis t4,1
// mode == 0 is rgb controls currently shown
if(mode.val==0)
{ {
vis t4,1 // switch mode
vis t3,1 click bColor,1
vis hTempSlider,1 click bColor,0
mode_temp.val=1
covx tTmp.txt,sys0,0,0
hTempSlider.val=sys0
} }
} }
// get ColorWheel value // get Color value
spstr strCommand.txt,tTmp.txt,",",6 spstr strCommand.txt,tTmp.txt,",",6
if(tTmp.txt!="disable") // disable -> isn't supported
if(tTmp.txt=="disable")
{
vis t0,0
vis bColor,0
}else
{ {
vis bColor,1
vis t0,1 vis t0,1
vis bColor,1
} }
} }
if(tInstruction.txt=="time") if(tInstruction.txt=="time")
@@ -949,62 +945,53 @@ Timer tmSerial
spstr strCommand.txt,tTmp.txt,",",1 spstr strCommand.txt,tTmp.txt,",",1
covx tTmp.txt,sleepTimeout,0,0 covx tTmp.txt,sleepTimeout,0,0
} }
if(tInstruction.txt=="pageType")
{
//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
//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=="cardEntities")
{
page cardEntities
}
if(tId.txt=="cardMedia")
{
page cardMedia
}
if(tId.txt=="pageStartup")
{
page pageStartup
}
if(tId.txt=="popupNotify")
{
page popupNotify
}
if(tId.txt=="cardGrid")
{
page cardGrid
}
if(tId.txt=="cardAlarm")
{
page cardAlarm
}
}
// end of user code // end of user code
udelete payloadLength-1 udelete payloadLength-1
bufferPos=0 bufferPos=0
} }
if(tInstruction.txt=="pageType")
{
//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
//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=="cardEntities")
{
page cardEntities
}
if(tId.txt=="cardMedia")
{
page cardMedia
}
if(tId.txt=="pageStartup")
{
page pageStartup
}
if(tId.txt=="popupNotify")
{
page popupNotify
}
if(tId.txt=="cardGrid")
{
page cardGrid
}
if(tId.txt=="cardAlarm")
{
page cardAlarm
}
}
} }
} }
} }
// next character // next character
bufferPos++ bufferPos++
} }
if(bufferPos==usize)
{
// copy whole buffer to t1.txt, for debugging
//ucopy t2.txt,0,usize,0
// ucopy n2.val,0,usize,0
// clear whole buffer
//code_c
//bufferPos=0
}
} }
TouchCap tc0 TouchCap tc0