From 26ee4a206c576df6e8ed910cb18d5b32cc1a68e9 Mon Sep 17 00:00:00 2001 From: joBr99 <29555657+joBr99@users.noreply.github.com> Date: Sun, 20 Mar 2022 16:18:47 +0000 Subject: [PATCH] swap default tasmota driver (add nextion2text) --- HMI/n2t-out/nspanel_Stats.txt | 32 +++++++++--------- HMI/n2t-out/pageStartup.txt | 2 +- HMI/n2t-out/popupLight.txt | 59 ++++++++++++++++++++++++++++++-- HMI/n2t-out/popupNotify.txt | 55 +++++++++++++++--------------- HMI/n2t-out/popupShutter.txt | 64 +++++++++++++++++++++++++++++++++-- 5 files changed, 162 insertions(+), 50 deletions(-) diff --git a/HMI/n2t-out/nspanel_Stats.txt b/HMI/n2t-out/nspanel_Stats.txt index cdaae47a..fad8fc8c 100644 --- a/HMI/n2t-out/nspanel_Stats.txt +++ b/HMI/n2t-out/nspanel_Stats.txt @@ -14,30 +14,26 @@ cardMedia 22 Component(s) 210 Line(s) of event code 116 Unique line(s) of event code -popupNotify - 16 Component(s) - 167 Line(s) of event code - 110 Unique line(s) of event code pageStartup 19 Component(s) 145 Line(s) of event code 110 Unique line(s) of event code +popupNotify + 16 Component(s) + 167 Line(s) of event code + 111 Unique line(s) of event code pageSwipeTest 18 Component(s) 62 Line(s) of event code 44 Unique line(s) of event code popupShutter 19 Component(s) - 148 Line(s) of event code - 84 Unique line(s) of event code + 195 Line(s) of event code + 107 Unique line(s) of event code pageTest 14 Component(s) 14 Line(s) of event code 14 Unique line(s) of event code -popupLight - 27 Component(s) - 297 Line(s) of event code - 154 Unique line(s) of event code screensaver 25 Component(s) 173 Line(s) of event code @@ -46,6 +42,10 @@ cardAlarm 28 Component(s) 147 Line(s) of event code 106 Unique line(s) of event code +cardThermo + 42 Component(s) + 438 Line(s) of event code + 221 Unique line(s) of event code cardEntities 54 Component(s) 808 Line(s) of event code @@ -54,13 +54,13 @@ cardGrid 39 Component(s) 406 Line(s) of event code 224 Unique line(s) of event code -cardThermo - 42 Component(s) - 438 Line(s) of event code - 221 Unique line(s) of event code +popupLight + 27 Component(s) + 339 Line(s) of event code + 171 Unique line(s) of event code Total 14 Page(s) 342 Component(s) - 3080 Line(s) of event code - 776 Unique line(s) of event code + 3169 Line(s) of event code + 787 Unique line(s) of event code diff --git a/HMI/n2t-out/pageStartup.txt b/HMI/n2t-out/pageStartup.txt index 0ad1cfd8..c52c4e00 100644 --- a/HMI/n2t-out/pageStartup.txt +++ b/HMI/n2t-out/pageStartup.txt @@ -402,7 +402,7 @@ Text tVersion Horizontal Alignment : center Vertical Alignment : center Input Type : character - Text : 4 + Text : 6 Max. Text Size : 10 Word wrap : disabled Horizontal Spacing : 0 diff --git a/HMI/n2t-out/popupLight.txt b/HMI/n2t-out/popupLight.txt index 1bba5a34..f3b1f895 100644 --- a/HMI/n2t-out/popupLight.txt +++ b/HMI/n2t-out/popupLight.txt @@ -28,7 +28,7 @@ Page popupLight vis tSend,0 vis tTmp,0 vis tInstruction,0 - vis tItem,0 + vis tId,0 //page open event // event,pageOpenDetail,typeOfPage,tEntityName // craft command @@ -360,7 +360,7 @@ Text tInstruction Horizontal Spacing : 0 Vertical Spacing : 0 -Text tItem +Text tId Attributes ID : 19 Scope : local @@ -653,7 +653,23 @@ Button b0 Events Touch Press Event - page cardEntities + //page open event + // event,pageOpen,cardEntities,pageNumber + // craft command + // convert pageNumber and write to tTmp + covx nPage,tTmp.txt,0,0 + tSend.txt="event,pageOpen,"+tTmp.txt + //send calc crc + btlen tSend.txt,sys0 + crcrest 1,0xffff // reset CRC + crcputh 55 bb + crcputs sys0,1 + crcputs tSend.txt,0 + //send cmd + printh 55 bb + prints sys0,2 + prints tSend.txt,0 + prints crcval,2 Button bColor Attributes @@ -938,6 +954,43 @@ Timer tmSerial udelete payloadLength-1 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 + } + } } } } diff --git a/HMI/n2t-out/popupNotify.txt b/HMI/n2t-out/popupNotify.txt index 04d70f7b..fff7599a 100644 --- a/HMI/n2t-out/popupNotify.txt +++ b/HMI/n2t-out/popupNotify.txt @@ -25,21 +25,6 @@ Page popupNotify vis tTmp,0 vis tInstruction,0 vis tId,0 - //page open event - // event,pageOpenDetail,typeOfPage,tEntityName - // craft command - tSend.txt="event,pageOpenDetail,notify" - //send calc crc - btlen tSend.txt,sys0 - crcrest 1,0xffff // reset CRC - crcputh 55 bb - crcputs sys0,1 - crcputs tSend.txt,0 - //send cmd - printh 55 bb - prints sys0,2 - prints tSend.txt,0 - prints crcval,2 Variable (string) strCommand Attributes @@ -286,7 +271,23 @@ Button b0 Events Touch Press Event - page cardEntities + //page open event + // event,pageOpen,cardEntities,pageNumber + // craft command + // convert pageNumber and write to tTmp + covx nPage,tTmp.txt,0,0 + tSend.txt="event,pageOpen,"+tTmp.txt + //send calc crc + btlen tSend.txt,sys0 + crcrest 1,0xffff // reset CRC + crcputh 55 bb + crcputs sys0,1 + crcputs tSend.txt,0 + //send cmd + printh 55 bb + prints sys0,2 + prints tSend.txt,0 + prints crcval,2 Button b2 Attributes @@ -527,15 +528,11 @@ Timer tmSerial spstr strCommand.txt,tId.txt,",",1 //save second arg if there's one spstr strCommand.txt,tTmp.txt,",",2 - if(tId.txt=="pageNotify") - { - //yay, we are already on the correct page - }else - { - //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 - } + //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=="popupLight") { pageIcons.tTmp1.txt=tTmp.txt @@ -553,9 +550,13 @@ Timer tmSerial { page pageStartup } - if(tId.txt=="pageThermo") + if(tId.txt=="cardGrid") { - page cardThermo + page cardGrid + } + if(tId.txt=="cardAlarm") + { + page cardAlarm } } // end of user code diff --git a/HMI/n2t-out/popupShutter.txt b/HMI/n2t-out/popupShutter.txt index 8cbae7a5..72fc2b4e 100644 --- a/HMI/n2t-out/popupShutter.txt +++ b/HMI/n2t-out/popupShutter.txt @@ -28,7 +28,7 @@ Page popupShutter vis tSend,0 vis tTmp,0 vis tInstruction,0 - vis tItem,0 + vis tId,0 //page open event // event,pageOpenDetail,typeOfPage,tEntityName // craft command @@ -209,7 +209,7 @@ Text tInstruction Horizontal Spacing : 0 Vertical Spacing : 0 -Text tItem +Text tId Attributes ID : 12 Scope : local @@ -367,7 +367,23 @@ Button b0 Events Touch Press Event - page cardEntities + //page open event + // event,pageOpen,cardEntities,pageNumber + // craft command + // convert pageNumber and write to tTmp + covx nPage,tTmp.txt,0,0 + tSend.txt="event,pageOpen,"+tTmp.txt + //send calc crc + btlen tSend.txt,sys0 + crcrest 1,0xffff // reset CRC + crcputh 55 bb + crcputs sys0,1 + crcputs tSend.txt,0 + //send cmd + printh 55 bb + prints sys0,2 + prints tSend.txt,0 + prints crcval,2 Button bDown1 Attributes @@ -633,6 +649,48 @@ Timer tmSerial spstr strCommand.txt,tTmp.txt,",",1 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=="popupLight") + { + pageIcons.tTmp1.txt=tTmp.txt + page popupLight + } + 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 udelete payloadLength-1 bufferPos=0