diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index b748904c..79fbaf7a 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -47,7 +47,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v1 + uses: github/codeql-action/init@v2 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -58,7 +58,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@v1 + uses: github/codeql-action/autobuild@v2 # â„šī¸ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -72,4 +72,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 + uses: github/codeql-action/analyze@v2 diff --git a/HMI/README.md b/HMI/README.md index 90ecccfc..5b57dd70 100644 --- a/HMI/README.md +++ b/HMI/README.md @@ -111,7 +111,7 @@ The following message can be used to update the content on the cardEntities Page ### popupShutter Page -`entityUpdateDetail~*ignored*~*sliderPos*~2ndrow~textPosition~icon1~iconUp~iconStop~iconDown` +`entityUpdateDetail~*ignored*~*sliderPos*~2ndrow~textPosition~icon1~iconUp~iconStop~iconDown~iconUpStatus~iconStopStatus~iconDownStatus `entityUpdateDetail~1~77` diff --git a/HMI/US/landscape/diff-eu-version.txt b/HMI/US/landscape/diff-eu-version.txt index aebc8351..6d6eb9f3 100644 --- a/HMI/US/landscape/diff-eu-version.txt +++ b/HMI/US/landscape/diff-eu-version.txt @@ -1,6 +1,6 @@ diff -bur HMI/n2t-out/Program.s.txt HMI/US/landscape/n2t-out/Program.s.txt ---- HMI/n2t-out/Program.s.txt 2022-05-22 08:52:05.367816736 +0000 -+++ HMI/US/landscape/n2t-out/Program.s.txt 2022-05-22 08:52:06.663941704 +0000 +--- HMI/n2t-out/Program.s.txt 2022-05-23 06:20:44.296447221 +0000 ++++ HMI/US/landscape/n2t-out/Program.s.txt 2022-05-23 06:20:45.196459256 +0000 @@ -11,6 +11,4 @@ // dim value int dimValue=40 @@ -8,9 +8,21 @@ diff -bur HMI/n2t-out/Program.s.txt HMI/US/landscape/n2t-out/Program.s.txt - // fix touch offset - lcd_dev fffb 0002 0000 0020 page pageStartup +diff -bur HMI/n2t-out/cardQR.txt HMI/US/landscape/n2t-out/cardQR.txt +--- HMI/n2t-out/cardQR.txt 2022-05-23 06:20:44.300447274 +0000 ++++ HMI/US/landscape/n2t-out/cardQR.txt 2022-05-23 06:20:45.196459256 +0000 +@@ -34,7 +34,7 @@ + Attributes + Scope : local + Text : +- Max. Text Size: 275 ++ Max. Text Size: 270 + + Variable (string) entn + Attributes diff -bur HMI/n2t-out/pageStartup.txt HMI/US/landscape/n2t-out/pageStartup.txt ---- HMI/n2t-out/pageStartup.txt 2022-05-22 08:52:05.367816736 +0000 -+++ HMI/US/landscape/n2t-out/pageStartup.txt 2022-05-22 08:52:06.667941783 +0000 +--- HMI/n2t-out/pageStartup.txt 2022-05-23 06:20:44.300447274 +0000 ++++ HMI/US/landscape/n2t-out/pageStartup.txt 2022-05-23 06:20:45.196459256 +0000 @@ -177,7 +177,7 @@ recmod=1 bauds=115200 diff --git a/HMI/US/landscape/n2t-out-visual/cardEntities.txt b/HMI/US/landscape/n2t-out-visual/cardEntities.txt index 764d0cad..a80481ef 100644 --- a/HMI/US/landscape/n2t-out-visual/cardEntities.txt +++ b/HMI/US/landscape/n2t-out-visual/cardEntities.txt @@ -2252,39 +2252,42 @@ Timer tmSerial // get Button State (optional Value) spstr strCommand.txt,tId.txt,"~",8 // up button - spstr tId.txt,tTmp.txt,"|",0 + spstr tId.txt,tTmp.txt,"|",3 if(tTmp.txt=="disable") { bUp1.pco=27501 + spstr tId.txt,bUp1.txt,"|",0 tsw bUp1,0 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { bUp1.pco=65535 - bUp1.txt=tTmp.txt + spstr tId.txt,bUp1.txt,"|",0 tsw bUp1,1 } // stop button - spstr tId.txt,tTmp.txt,"|",1 + spstr tId.txt,tTmp.txt,"|",4 if(tTmp.txt=="disable") { bStop1.pco=27501 + spstr tId.txt,bStop1.txt,"|",1 tsw bStop1,0 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { bStop1.pco=65535 - bStop1.txt=tTmp.txt + spstr tId.txt,bStop1.txt,"|",1 tsw bStop1,1 } // down button - spstr tId.txt,tTmp.txt,"|",2 + spstr tId.txt,tTmp.txt,"|",5 if(tTmp.txt=="disable") { bDown1.pco=27501 + spstr tId.txt,bDown1.txt,"|",2 tsw bDown1,0 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { bDown1.pco=65535 - bDown1.txt=tTmp.txt + spstr tId.txt,bDown1.txt,"|",2 tsw bDown1,1 } } @@ -2412,39 +2415,42 @@ Timer tmSerial // get Button State (optional Value) spstr strCommand.txt,tId.txt,"~",14 // up button - spstr tId.txt,tTmp.txt,"|",0 + spstr tId.txt,tTmp.txt,"|",3 if(tTmp.txt=="disable") { bUp2.pco=27501 + spstr tId.txt,bUp2.txt,"|",0 tsw bUp2,0 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { bUp2.pco=65535 - bUp2.txt=tTmp.txt + spstr tId.txt,bUp2.txt,"|",0 tsw bUp2,1 } // stop button - spstr tId.txt,tTmp.txt,"|",1 + spstr tId.txt,tTmp.txt,"|",4 if(tTmp.txt=="disable") { bStop2.pco=27501 + spstr tId.txt,bStop2.txt,"|",1 tsw bStop2,0 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { bStop2.pco=65535 - bStop2.txt=tTmp.txt + spstr tId.txt,bStop2.txt,"|",1 tsw bStop2,1 } // down button - spstr tId.txt,tTmp.txt,"|",2 + spstr tId.txt,tTmp.txt,"|",5 if(tTmp.txt=="disable") { bDown2.pco=27501 + spstr tId.txt,bDown2.txt,"|",2 tsw bDown2,0 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { bDown2.pco=65535 - bDown2.txt=tTmp.txt + spstr tId.txt,bDown2.txt,"|",2 tsw bDown2,1 } } @@ -2572,39 +2578,42 @@ Timer tmSerial // get Button State (optional Value) spstr strCommand.txt,tId.txt,"~",20 // up button - spstr tId.txt,tTmp.txt,"|",0 + spstr tId.txt,tTmp.txt,"|",3 if(tTmp.txt=="disable") { bUp3.pco=27501 + spstr tId.txt,bUp3.txt,"|",0 tsw bUp3,0 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { bUp3.pco=65535 - bUp3.txt=tTmp.txt + spstr tId.txt,bUp3.txt,"|",0 tsw bUp3,1 } // stop button - spstr tId.txt,tTmp.txt,"|",1 + spstr tId.txt,tTmp.txt,"|",4 if(tTmp.txt=="disable") { bStop3.pco=27501 + spstr tId.txt,bStop3.txt,"|",1 tsw bStop3,0 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { bStop3.pco=65535 - bStop3.txt=tTmp.txt + spstr tId.txt,bStop3.txt,"|",1 tsw bStop3,1 } // down button - spstr tId.txt,tTmp.txt,"|",2 + spstr tId.txt,tTmp.txt,"|",5 if(tTmp.txt=="disable") { bDown3.pco=27501 + spstr tId.txt,bDown3.txt,"|",2 tsw bDown3,0 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { bDown3.pco=65535 - bDown3.txt=tTmp.txt + spstr tId.txt,bDown3.txt,"|",2 tsw bDown3,1 } } @@ -2732,39 +2741,42 @@ Timer tmSerial // get Button State (optional Value) spstr strCommand.txt,tId.txt,"~",26 // up button - spstr tId.txt,tTmp.txt,"|",0 + spstr tId.txt,tTmp.txt,"|",3 if(tTmp.txt=="disable") { bUp4.pco=27501 + spstr tId.txt,bUp4.txt,"|",0 tsw bUp4,0 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { bUp4.pco=65535 - bUp4.txt=tTmp.txt + spstr tId.txt,bUp4.txt,"|",0 tsw bUp4,1 } // stop button - spstr tId.txt,tTmp.txt,"|",1 + spstr tId.txt,tTmp.txt,"|",4 if(tTmp.txt=="disable") { bStop4.pco=27501 + spstr tId.txt,bStop4.txt,"|",1 tsw bStop4,0 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { bStop4.pco=65535 - bStop4.txt=tTmp.txt + spstr tId.txt,bStop4.txt,"|",1 tsw bStop4,1 } // down button - spstr tId.txt,tTmp.txt,"|",2 + spstr tId.txt,tTmp.txt,"|",5 if(tTmp.txt=="disable") { bDown4.pco=27501 + spstr tId.txt,bDown4.txt,"|",2 tsw bDown4,0 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { bDown4.pco=65535 - bDown4.txt=tTmp.txt + spstr tId.txt,bDown4.txt,"|",2 tsw bDown4,1 } } diff --git a/HMI/US/landscape/n2t-out-visual/cardGrid.txt b/HMI/US/landscape/n2t-out-visual/cardGrid.txt index 24d9bcb5..7115454f 100644 --- a/HMI/US/landscape/n2t-out-visual/cardGrid.txt +++ b/HMI/US/landscape/n2t-out-visual/cardGrid.txt @@ -592,9 +592,9 @@ Button bEntity1 Disable release event after dragging: 0 Send Component ID : disabled Opacity : 127 - x coordinate : 53 + x coordinate : 23 y coordinate : 75 - Width : 80 + Width : 140 Height : 80 Effect : load Effect Priority : 0 @@ -650,9 +650,9 @@ Button bEntity2 Disable release event after dragging: 0 Send Component ID : disabled Opacity : 127 - x coordinate : 204 + x coordinate : 174 y coordinate : 75 - Width : 80 + Width : 140 Height : 80 Effect : load Effect Priority : 0 @@ -708,9 +708,9 @@ Button bEntity3 Disable release event after dragging: 0 Send Component ID : disabled Opacity : 127 - x coordinate : 354 + x coordinate : 324 y coordinate : 75 - Width : 80 + Width : 140 Height : 80 Effect : load Effect Priority : 0 @@ -766,9 +766,9 @@ Button bEntity4 Disable release event after dragging: 0 Send Component ID : disabled Opacity : 127 - x coordinate : 37 + x coordinate : 24 y coordinate : 194 - Width : 80 + Width : 140 Height : 80 Effect : load Effect Priority : 0 @@ -824,9 +824,9 @@ Button bEntity5 Disable release event after dragging: 0 Send Component ID : disabled Opacity : 127 - x coordinate : 204 + x coordinate : 174 y coordinate : 194 - Width : 80 + Width : 140 Height : 80 Effect : load Effect Priority : 0 @@ -882,9 +882,9 @@ Button bEntity6 Disable release event after dragging: 0 Send Component ID : disabled Opacity : 127 - x coordinate : 354 + x coordinate : 324 y coordinate : 194 - Width : 80 + Width : 140 Height : 80 Effect : load Effect Priority : 0 diff --git a/HMI/US/landscape/n2t-out-visual/cardQR.txt b/HMI/US/landscape/n2t-out-visual/cardQR.txt index 56cc825e..b0eb93c1 100644 --- a/HMI/US/landscape/n2t-out-visual/cardQR.txt +++ b/HMI/US/landscape/n2t-out-visual/cardQR.txt @@ -43,7 +43,7 @@ Variable (string) strCommand ID : 6 Scope : local Text : - Max. Text Size: 200 + Max. Text Size: 270 Variable (string) entn Attributes @@ -292,7 +292,7 @@ QR Code qr0 Effect Time : 300 Logo overlay : no Text : - Max. Text Size : 105 + Max. Text Size : 100 Button bNext Attributes @@ -422,7 +422,7 @@ Button bText1 Vertical Alignment : center State : unpressed Text : - Max. Text Size : 10 + Max. Text Size : 30 Word wrap : disabled Horizontal Spacing : 0 Vertical Spacing : 0 @@ -469,7 +469,7 @@ Button bText2 Vertical Alignment : center State : unpressed Text : - Max. Text Size : 10 + Max. Text Size : 30 Word wrap : disabled Horizontal Spacing : 0 Vertical Spacing : 0 @@ -564,8 +564,8 @@ Dual-state Button btOnOff2 Events Touch Press Event - tSend.txt="event,buttonPress2,"+entn1.txt+",OnOff," - covx btOnOff1.val,tTmp.txt,0,0 + tSend.txt="event,buttonPress2,"+entn2.txt+",OnOff," + covx btOnOff2.val,tTmp.txt,0,0 tSend.txt+=tTmp.txt //send calc crc btlen tSend.txt,sys0 diff --git a/HMI/US/landscape/n2t-out-visual/nspanel_US_L_Stats.txt b/HMI/US/landscape/n2t-out-visual/nspanel_US_L_Stats.txt index c3223464..5c0fc908 100644 --- a/HMI/US/landscape/n2t-out-visual/nspanel_US_L_Stats.txt +++ b/HMI/US/landscape/n2t-out-visual/nspanel_US_L_Stats.txt @@ -26,9 +26,13 @@ cardAlarm 38 Component(s) 364 Line(s) of event code 224 Unique line(s) of event code +cardGrid + 42 Component(s) + 439 Line(s) of event code + 254 Unique line(s) of event code popupShutter 20 Component(s) - 241 Line(s) of event code + 244 Line(s) of event code 138 Unique line(s) of event code popupLight 27 Component(s) @@ -42,21 +46,17 @@ cardMedia 33 Component(s) 350 Line(s) of event code 179 Unique line(s) of event code -cardGrid - 42 Component(s) - 439 Line(s) of event code - 254 Unique line(s) of event code cardQR 30 Component(s) 363 Line(s) of event code - 205 Unique line(s) of event code + 207 Unique line(s) of event code cardEntities 65 Component(s) - 1121 Line(s) of event code + 1133 Line(s) of event code 491 Unique line(s) of event code Total 13 Page(s) 402 Component(s) - 4443 Line(s) of event code + 4458 Line(s) of event code 1167 Unique line(s) of event code diff --git a/HMI/US/landscape/n2t-out-visual/popupShutter.txt b/HMI/US/landscape/n2t-out-visual/popupShutter.txt index bc4f5fff..ea376ba8 100644 --- a/HMI/US/landscape/n2t-out-visual/popupShutter.txt +++ b/HMI/US/landscape/n2t-out-visual/popupShutter.txt @@ -646,38 +646,41 @@ Timer tmSerial tIcon1.txt=tTmp.txt } // set icon bUp - spstr strCommand.txt,tTmp.txt,"~",5 + spstr strCommand.txt,tTmp.txt,"~",8 if(tTmp.txt=="disable") { tsw bUp1,0 + spstr strCommand.txt,bUp1.txt,"~",5 bUp1.pco=27501 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { - bUp1.txt=tTmp.txt + spstr strCommand.txt,bUp1.txt,"~",5 tsw bUp1,1 bUp1.pco=65535 } // set icon bStop - spstr strCommand.txt,tTmp.txt,"~",6 + spstr strCommand.txt,tTmp.txt,"~",9 if(tTmp.txt=="disable") { tsw bStop1,0 + spstr strCommand.txt,bStop1.txt,"~",6 bStop1.pco=27501 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { - bStop1.txt=tTmp.txt + spstr strCommand.txt,bStop1.txt,"~",6 tsw bStop1,1 bStop1.pco=65535 } // set icon bDown - spstr strCommand.txt,tTmp.txt,"~",7 + spstr strCommand.txt,tTmp.txt,"~",10 if(tTmp.txt=="disable") { + spstr strCommand.txt,bDown1.txt,"~",7 tsw bDown1,0 bDown1.pco=27501 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { - bDown1.txt=tTmp.txt + spstr strCommand.txt,bDown1.txt,"~",7 tsw bDown1,1 bDown1.pco=65535 } diff --git a/HMI/US/landscape/n2t-out/cardEntities.txt b/HMI/US/landscape/n2t-out/cardEntities.txt index 157f7426..0440bb4f 100644 --- a/HMI/US/landscape/n2t-out/cardEntities.txt +++ b/HMI/US/landscape/n2t-out/cardEntities.txt @@ -1280,39 +1280,42 @@ Timer tmSerial // get Button State (optional Value) spstr strCommand.txt,tId.txt,"~",8 // up button - spstr tId.txt,tTmp.txt,"|",0 + spstr tId.txt,tTmp.txt,"|",3 if(tTmp.txt=="disable") { bUp1.pco=27501 + spstr tId.txt,bUp1.txt,"|",0 tsw bUp1,0 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { bUp1.pco=65535 - bUp1.txt=tTmp.txt + spstr tId.txt,bUp1.txt,"|",0 tsw bUp1,1 } // stop button - spstr tId.txt,tTmp.txt,"|",1 + spstr tId.txt,tTmp.txt,"|",4 if(tTmp.txt=="disable") { bStop1.pco=27501 + spstr tId.txt,bStop1.txt,"|",1 tsw bStop1,0 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { bStop1.pco=65535 - bStop1.txt=tTmp.txt + spstr tId.txt,bStop1.txt,"|",1 tsw bStop1,1 } // down button - spstr tId.txt,tTmp.txt,"|",2 + spstr tId.txt,tTmp.txt,"|",5 if(tTmp.txt=="disable") { bDown1.pco=27501 + spstr tId.txt,bDown1.txt,"|",2 tsw bDown1,0 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { bDown1.pco=65535 - bDown1.txt=tTmp.txt + spstr tId.txt,bDown1.txt,"|",2 tsw bDown1,1 } } @@ -1440,39 +1443,42 @@ Timer tmSerial // get Button State (optional Value) spstr strCommand.txt,tId.txt,"~",14 // up button - spstr tId.txt,tTmp.txt,"|",0 + spstr tId.txt,tTmp.txt,"|",3 if(tTmp.txt=="disable") { bUp2.pco=27501 + spstr tId.txt,bUp2.txt,"|",0 tsw bUp2,0 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { bUp2.pco=65535 - bUp2.txt=tTmp.txt + spstr tId.txt,bUp2.txt,"|",0 tsw bUp2,1 } // stop button - spstr tId.txt,tTmp.txt,"|",1 + spstr tId.txt,tTmp.txt,"|",4 if(tTmp.txt=="disable") { bStop2.pco=27501 + spstr tId.txt,bStop2.txt,"|",1 tsw bStop2,0 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { bStop2.pco=65535 - bStop2.txt=tTmp.txt + spstr tId.txt,bStop2.txt,"|",1 tsw bStop2,1 } // down button - spstr tId.txt,tTmp.txt,"|",2 + spstr tId.txt,tTmp.txt,"|",5 if(tTmp.txt=="disable") { bDown2.pco=27501 + spstr tId.txt,bDown2.txt,"|",2 tsw bDown2,0 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { bDown2.pco=65535 - bDown2.txt=tTmp.txt + spstr tId.txt,bDown2.txt,"|",2 tsw bDown2,1 } } @@ -1600,39 +1606,42 @@ Timer tmSerial // get Button State (optional Value) spstr strCommand.txt,tId.txt,"~",20 // up button - spstr tId.txt,tTmp.txt,"|",0 + spstr tId.txt,tTmp.txt,"|",3 if(tTmp.txt=="disable") { bUp3.pco=27501 + spstr tId.txt,bUp3.txt,"|",0 tsw bUp3,0 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { bUp3.pco=65535 - bUp3.txt=tTmp.txt + spstr tId.txt,bUp3.txt,"|",0 tsw bUp3,1 } // stop button - spstr tId.txt,tTmp.txt,"|",1 + spstr tId.txt,tTmp.txt,"|",4 if(tTmp.txt=="disable") { bStop3.pco=27501 + spstr tId.txt,bStop3.txt,"|",1 tsw bStop3,0 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { bStop3.pco=65535 - bStop3.txt=tTmp.txt + spstr tId.txt,bStop3.txt,"|",1 tsw bStop3,1 } // down button - spstr tId.txt,tTmp.txt,"|",2 + spstr tId.txt,tTmp.txt,"|",5 if(tTmp.txt=="disable") { bDown3.pco=27501 + spstr tId.txt,bDown3.txt,"|",2 tsw bDown3,0 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { bDown3.pco=65535 - bDown3.txt=tTmp.txt + spstr tId.txt,bDown3.txt,"|",2 tsw bDown3,1 } } @@ -1760,39 +1769,42 @@ Timer tmSerial // get Button State (optional Value) spstr strCommand.txt,tId.txt,"~",26 // up button - spstr tId.txt,tTmp.txt,"|",0 + spstr tId.txt,tTmp.txt,"|",3 if(tTmp.txt=="disable") { bUp4.pco=27501 + spstr tId.txt,bUp4.txt,"|",0 tsw bUp4,0 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { bUp4.pco=65535 - bUp4.txt=tTmp.txt + spstr tId.txt,bUp4.txt,"|",0 tsw bUp4,1 } // stop button - spstr tId.txt,tTmp.txt,"|",1 + spstr tId.txt,tTmp.txt,"|",4 if(tTmp.txt=="disable") { bStop4.pco=27501 + spstr tId.txt,bStop4.txt,"|",1 tsw bStop4,0 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { bStop4.pco=65535 - bStop4.txt=tTmp.txt + spstr tId.txt,bStop4.txt,"|",1 tsw bStop4,1 } // down button - spstr tId.txt,tTmp.txt,"|",2 + spstr tId.txt,tTmp.txt,"|",5 if(tTmp.txt=="disable") { bDown4.pco=27501 + spstr tId.txt,bDown4.txt,"|",2 tsw bDown4,0 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { bDown4.pco=65535 - bDown4.txt=tTmp.txt + spstr tId.txt,bDown4.txt,"|",2 tsw bDown4,1 } } diff --git a/HMI/US/landscape/n2t-out/cardQR.txt b/HMI/US/landscape/n2t-out/cardQR.txt index bb7d2918..50ada2f8 100644 --- a/HMI/US/landscape/n2t-out/cardQR.txt +++ b/HMI/US/landscape/n2t-out/cardQR.txt @@ -34,7 +34,7 @@ Variable (string) strCommand Attributes Scope : local Text : - Max. Text Size: 200 + Max. Text Size: 270 Variable (string) entn Attributes @@ -154,7 +154,7 @@ QR Code qr0 Disable release event after dragging: 0 Send Component ID : disabled Text : - Max. Text Size : 105 + Max. Text Size : 100 Button bNext Attributes @@ -221,7 +221,7 @@ Button bText1 Send Component ID : disabled State : unpressed Text : - Max. Text Size : 10 + Max. Text Size : 30 Events Touch Press Event @@ -246,7 +246,7 @@ Button bText2 Send Component ID : disabled State : unpressed Text : - Max. Text Size : 10 + Max. Text Size : 30 Events Touch Press Event @@ -302,8 +302,8 @@ Dual-state Button btOnOff2 Events Touch Press Event - tSend.txt="event,buttonPress2,"+entn1.txt+",OnOff," - covx btOnOff1.val,tTmp.txt,0,0 + tSend.txt="event,buttonPress2,"+entn2.txt+",OnOff," + covx btOnOff2.val,tTmp.txt,0,0 tSend.txt+=tTmp.txt //send calc crc btlen tSend.txt,sys0 diff --git a/HMI/US/landscape/n2t-out/popupShutter.txt b/HMI/US/landscape/n2t-out/popupShutter.txt index 5fca3dc8..6c7b272d 100644 --- a/HMI/US/landscape/n2t-out/popupShutter.txt +++ b/HMI/US/landscape/n2t-out/popupShutter.txt @@ -361,38 +361,41 @@ Timer tmSerial tIcon1.txt=tTmp.txt } // set icon bUp - spstr strCommand.txt,tTmp.txt,"~",5 + spstr strCommand.txt,tTmp.txt,"~",8 if(tTmp.txt=="disable") { tsw bUp1,0 + spstr strCommand.txt,bUp1.txt,"~",5 bUp1.pco=27501 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { - bUp1.txt=tTmp.txt + spstr strCommand.txt,bUp1.txt,"~",5 tsw bUp1,1 bUp1.pco=65535 } // set icon bStop - spstr strCommand.txt,tTmp.txt,"~",6 + spstr strCommand.txt,tTmp.txt,"~",9 if(tTmp.txt=="disable") { tsw bStop1,0 + spstr strCommand.txt,bStop1.txt,"~",6 bStop1.pco=27501 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { - bStop1.txt=tTmp.txt + spstr strCommand.txt,bStop1.txt,"~",6 tsw bStop1,1 bStop1.pco=65535 } // set icon bDown - spstr strCommand.txt,tTmp.txt,"~",7 + spstr strCommand.txt,tTmp.txt,"~",10 if(tTmp.txt=="disable") { + spstr strCommand.txt,bDown1.txt,"~",7 tsw bDown1,0 bDown1.pco=27501 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { - bDown1.txt=tTmp.txt + spstr strCommand.txt,bDown1.txt,"~",7 tsw bDown1,1 bDown1.pco=65535 } diff --git a/HMI/US/landscape/nspanel_US_L.HMI b/HMI/US/landscape/nspanel_US_L.HMI index a33bc8a0..66af8c32 100644 Binary files a/HMI/US/landscape/nspanel_US_L.HMI and b/HMI/US/landscape/nspanel_US_L.HMI differ diff --git a/HMI/US/landscape/nspanel_US_L.tft b/HMI/US/landscape/nspanel_US_L.tft index 043e26e0..a6da9efe 100644 Binary files a/HMI/US/landscape/nspanel_US_L.tft and b/HMI/US/landscape/nspanel_US_L.tft differ diff --git a/HMI/US/portrait/diff-eu-version.txt b/HMI/US/portrait/diff-eu-version.txt index aeac48ab..2acf4f1f 100644 --- a/HMI/US/portrait/diff-eu-version.txt +++ b/HMI/US/portrait/diff-eu-version.txt @@ -1,6 +1,6 @@ diff -bur HMI/n2t-out/Program.s.txt HMI/US/portrait/n2t-out/Program.s.txt ---- HMI/n2t-out/Program.s.txt 2022-05-22 08:52:05.367816736 +0000 -+++ HMI/US/portrait/n2t-out/Program.s.txt 2022-05-22 08:52:05.927852627 +0000 +--- HMI/n2t-out/Program.s.txt 2022-05-23 06:20:44.296447221 +0000 ++++ HMI/US/portrait/n2t-out/Program.s.txt 2022-05-23 06:20:44.736453105 +0000 @@ -11,6 +11,6 @@ // dim value int dimValue=40 @@ -11,8 +11,8 @@ diff -bur HMI/n2t-out/Program.s.txt HMI/US/portrait/n2t-out/Program.s.txt + //lcd_dev fffb 0002 0000 0020 page pageStartup diff -bur HMI/n2t-out/cardEntities.txt HMI/US/portrait/n2t-out/cardEntities.txt ---- HMI/n2t-out/cardEntities.txt 2022-05-22 08:52:05.367816736 +0000 -+++ HMI/US/portrait/n2t-out/cardEntities.txt 2022-05-22 08:52:05.927852627 +0000 +--- HMI/n2t-out/cardEntities.txt 2022-05-23 06:20:44.300447274 +0000 ++++ HMI/US/portrait/n2t-out/cardEntities.txt 2022-05-23 06:20:44.736453105 +0000 @@ -62,6 +62,16 @@ vis bText4,0 vis hSlider4,0 @@ -297,7 +297,7 @@ diff -bur HMI/n2t-out/cardEntities.txt HMI/US/portrait/n2t-out/cardEntities.txt Hotspot mSwipeNext Attributes Scope : local -@@ -1880,6 +2108,166 @@ +@@ -1892,6 +2120,169 @@ covx tTmp.txt,sys0,0,0 hSlider4.maxval=sys0 } @@ -341,39 +341,42 @@ diff -bur HMI/n2t-out/cardEntities.txt HMI/US/portrait/n2t-out/cardEntities.txt + // get Button State (optional Value) + spstr strCommand.txt,tId.txt,"~",32 + // up button -+ spstr tId.txt,tTmp.txt,"|",0 ++ spstr tId.txt,tTmp.txt,"|",3 + if(tTmp.txt=="disable") + { + bUp5.pco=27501 ++ spstr tId.txt,bUp5.txt,"|",0 + tsw bUp5,0 -+ }else if(tTmp.txt!="") ++ }else if(tTmp.txt=="enable") + { + bUp5.pco=65535 -+ bUp5.txt=tTmp.txt ++ spstr tId.txt,bUp5.txt,"|",0 + tsw bUp5,1 + } + // stop button -+ spstr tId.txt,tTmp.txt,"|",1 ++ spstr tId.txt,tTmp.txt,"|",4 + if(tTmp.txt=="disable") + { + bStop5.pco=27501 ++ spstr tId.txt,bStop5.txt,"|",1 + tsw bStop5,0 -+ }else if(tTmp.txt!="") ++ }else if(tTmp.txt=="enable") + { + bStop5.pco=65535 -+ bStop5.txt=tTmp.txt ++ spstr tId.txt,bStop5.txt,"|",1 + tsw bStop5,1 + } + // down button -+ spstr tId.txt,tTmp.txt,"|",2 ++ spstr tId.txt,tTmp.txt,"|",5 + if(tTmp.txt=="disable") + { + bDown5.pco=27501 ++ spstr tId.txt,bDown5.txt,"|",2 + tsw bDown5,0 -+ }else if(tTmp.txt!="") ++ }else if(tTmp.txt=="enable") + { + bDown5.pco=65535 -+ bDown5.txt=tTmp.txt ++ spstr tId.txt,bDown5.txt,"|",2 + tsw bDown5,1 + } + } @@ -464,9 +467,21 @@ diff -bur HMI/n2t-out/cardEntities.txt HMI/US/portrait/n2t-out/cardEntities.txt } if(tInstruction.txt=="pageType") { +diff -bur HMI/n2t-out/cardQR.txt HMI/US/portrait/n2t-out/cardQR.txt +--- HMI/n2t-out/cardQR.txt 2022-05-23 06:20:44.300447274 +0000 ++++ HMI/US/portrait/n2t-out/cardQR.txt 2022-05-23 06:20:44.736453105 +0000 +@@ -34,7 +34,7 @@ + Attributes + Scope : local + Text : +- Max. Text Size: 275 ++ Max. Text Size: 270 + + Variable (string) entn + Attributes diff -bur HMI/n2t-out/pageStartup.txt HMI/US/portrait/n2t-out/pageStartup.txt ---- HMI/n2t-out/pageStartup.txt 2022-05-22 08:52:05.367816736 +0000 -+++ HMI/US/portrait/n2t-out/pageStartup.txt 2022-05-22 08:52:05.927852627 +0000 +--- HMI/n2t-out/pageStartup.txt 2022-05-23 06:20:44.300447274 +0000 ++++ HMI/US/portrait/n2t-out/pageStartup.txt 2022-05-23 06:20:44.736453105 +0000 @@ -142,7 +142,7 @@ Disable release event after dragging: 0 Send Component ID : disabled diff --git a/HMI/US/portrait/diff-filtered.txt b/HMI/US/portrait/diff-filtered.txt index 9b0ffe96..6a6d5af8 100644 --- a/HMI/US/portrait/diff-filtered.txt +++ b/HMI/US/portrait/diff-filtered.txt @@ -1,30 +1,47 @@ -+++ HMI/US/portrait/diff-eu-version.txt 2022-05-22 08:52:06.071870294 +0000 -+--- HMI/n2t-out/Program.s.txt 2022-05-22 08:52:05.367816736 +0000 -++++ HMI/US/portrait/n2t-out/Program.s.txt 2022-05-22 08:52:05.927852627 +0000 -+--- HMI/n2t-out/cardEntities.txt 2022-05-22 08:52:05.367816736 +0000 -++++ HMI/US/portrait/n2t-out/cardEntities.txt 2022-05-22 08:52:05.927852627 +0000 ++++ HMI/US/portrait/diff-eu-version.txt 2022-05-23 06:20:44.752453318 +0000 ++--- HMI/n2t-out/Program.s.txt 2022-05-23 06:20:44.296447221 +0000 +++++ HMI/US/portrait/n2t-out/Program.s.txt 2022-05-23 06:20:44.736453105 +0000 ++--- HMI/n2t-out/cardEntities.txt 2022-05-23 06:20:44.300447274 +0000 +++++ HMI/US/portrait/n2t-out/cardEntities.txt 2022-05-23 06:20:44.736453105 +0000 + Hotspot mSwipeNext + Scope : local -+@@ -1880,6 +2108,166 @@ ++@@ -1892,6 +2120,169 @@ ++ // up button +++ spstr tId.txt,tTmp.txt,"|",3 ++ if(tTmp.txt=="disable") -++ }else if(tTmp.txt!="") -++ bUp5.txt=tTmp.txt +++ spstr tId.txt,bUp5.txt,"|",0 +++ }else if(tTmp.txt=="enable") +++ spstr tId.txt,bUp5.txt,"|",0 ++ // stop button +++ spstr tId.txt,tTmp.txt,"|",4 ++ if(tTmp.txt=="disable") ++ { ++ bStop5.pco=27501 +++ spstr tId.txt,bStop5.txt,"|",1 ++ tsw bStop5,0 -++ }else if(tTmp.txt!="") +++ }else if(tTmp.txt=="enable") ++ { ++ bStop5.pco=65535 -++ bStop5.txt=tTmp.txt +++ spstr tId.txt,bStop5.txt,"|",1 ++ tsw bStop5,1 ++ } ++ // down button -++ spstr tId.txt,tTmp.txt,"|",2 +++ spstr tId.txt,tTmp.txt,"|",5 ++ if(tTmp.txt=="disable") -++ }else if(tTmp.txt!="") -++ bDown5.txt=tTmp.txt -+--- HMI/n2t-out/pageStartup.txt 2022-05-22 08:52:05.367816736 +0000 -++++ HMI/US/portrait/n2t-out/pageStartup.txt 2022-05-22 08:52:05.927852627 +0000 +++ spstr tId.txt,bDown5.txt,"|",2 +++ }else if(tTmp.txt=="enable") +++ spstr tId.txt,bDown5.txt,"|",2 ++diff -bur HMI/n2t-out/cardQR.txt HMI/US/portrait/n2t-out/cardQR.txt ++--- HMI/n2t-out/cardQR.txt 2022-05-23 06:20:44.300447274 +0000 +++++ HMI/US/portrait/n2t-out/cardQR.txt 2022-05-23 06:20:44.736453105 +0000 ++@@ -34,7 +34,7 @@ ++ Attributes ++ Scope : local ++ Text : ++- Max. Text Size: 275 +++ Max. Text Size: 270 ++ ++ Variable (string) entn ++ Attributes ++--- HMI/n2t-out/pageStartup.txt 2022-05-23 06:20:44.300447274 +0000 +++++ HMI/US/portrait/n2t-out/pageStartup.txt 2022-05-23 06:20:44.736453105 +0000 diff --git a/HMI/US/portrait/n2t-out-visual/cardEntities.txt b/HMI/US/portrait/n2t-out-visual/cardEntities.txt index b911f7cb..0efd53d3 100644 --- a/HMI/US/portrait/n2t-out-visual/cardEntities.txt +++ b/HMI/US/portrait/n2t-out-visual/cardEntities.txt @@ -2673,39 +2673,42 @@ Timer tmSerial // get Button State (optional Value) spstr strCommand.txt,tId.txt,"~",8 // up button - spstr tId.txt,tTmp.txt,"|",0 + spstr tId.txt,tTmp.txt,"|",3 if(tTmp.txt=="disable") { bUp1.pco=27501 + spstr tId.txt,bUp1.txt,"|",0 tsw bUp1,0 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { bUp1.pco=65535 - bUp1.txt=tTmp.txt + spstr tId.txt,bUp1.txt,"|",0 tsw bUp1,1 } // stop button - spstr tId.txt,tTmp.txt,"|",1 + spstr tId.txt,tTmp.txt,"|",4 if(tTmp.txt=="disable") { bStop1.pco=27501 + spstr tId.txt,bStop1.txt,"|",1 tsw bStop1,0 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { bStop1.pco=65535 - bStop1.txt=tTmp.txt + spstr tId.txt,bStop1.txt,"|",1 tsw bStop1,1 } // down button - spstr tId.txt,tTmp.txt,"|",2 + spstr tId.txt,tTmp.txt,"|",5 if(tTmp.txt=="disable") { bDown1.pco=27501 + spstr tId.txt,bDown1.txt,"|",2 tsw bDown1,0 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { bDown1.pco=65535 - bDown1.txt=tTmp.txt + spstr tId.txt,bDown1.txt,"|",2 tsw bDown1,1 } } @@ -2833,39 +2836,42 @@ Timer tmSerial // get Button State (optional Value) spstr strCommand.txt,tId.txt,"~",14 // up button - spstr tId.txt,tTmp.txt,"|",0 + spstr tId.txt,tTmp.txt,"|",3 if(tTmp.txt=="disable") { bUp2.pco=27501 + spstr tId.txt,bUp2.txt,"|",0 tsw bUp2,0 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { bUp2.pco=65535 - bUp2.txt=tTmp.txt + spstr tId.txt,bUp2.txt,"|",0 tsw bUp2,1 } // stop button - spstr tId.txt,tTmp.txt,"|",1 + spstr tId.txt,tTmp.txt,"|",4 if(tTmp.txt=="disable") { bStop2.pco=27501 + spstr tId.txt,bStop2.txt,"|",1 tsw bStop2,0 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { bStop2.pco=65535 - bStop2.txt=tTmp.txt + spstr tId.txt,bStop2.txt,"|",1 tsw bStop2,1 } // down button - spstr tId.txt,tTmp.txt,"|",2 + spstr tId.txt,tTmp.txt,"|",5 if(tTmp.txt=="disable") { bDown2.pco=27501 + spstr tId.txt,bDown2.txt,"|",2 tsw bDown2,0 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { bDown2.pco=65535 - bDown2.txt=tTmp.txt + spstr tId.txt,bDown2.txt,"|",2 tsw bDown2,1 } } @@ -2993,39 +2999,42 @@ Timer tmSerial // get Button State (optional Value) spstr strCommand.txt,tId.txt,"~",20 // up button - spstr tId.txt,tTmp.txt,"|",0 + spstr tId.txt,tTmp.txt,"|",3 if(tTmp.txt=="disable") { bUp3.pco=27501 + spstr tId.txt,bUp3.txt,"|",0 tsw bUp3,0 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { bUp3.pco=65535 - bUp3.txt=tTmp.txt + spstr tId.txt,bUp3.txt,"|",0 tsw bUp3,1 } // stop button - spstr tId.txt,tTmp.txt,"|",1 + spstr tId.txt,tTmp.txt,"|",4 if(tTmp.txt=="disable") { bStop3.pco=27501 + spstr tId.txt,bStop3.txt,"|",1 tsw bStop3,0 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { bStop3.pco=65535 - bStop3.txt=tTmp.txt + spstr tId.txt,bStop3.txt,"|",1 tsw bStop3,1 } // down button - spstr tId.txt,tTmp.txt,"|",2 + spstr tId.txt,tTmp.txt,"|",5 if(tTmp.txt=="disable") { bDown3.pco=27501 + spstr tId.txt,bDown3.txt,"|",2 tsw bDown3,0 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { bDown3.pco=65535 - bDown3.txt=tTmp.txt + spstr tId.txt,bDown3.txt,"|",2 tsw bDown3,1 } } @@ -3153,39 +3162,42 @@ Timer tmSerial // get Button State (optional Value) spstr strCommand.txt,tId.txt,"~",26 // up button - spstr tId.txt,tTmp.txt,"|",0 + spstr tId.txt,tTmp.txt,"|",3 if(tTmp.txt=="disable") { bUp4.pco=27501 + spstr tId.txt,bUp4.txt,"|",0 tsw bUp4,0 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { bUp4.pco=65535 - bUp4.txt=tTmp.txt + spstr tId.txt,bUp4.txt,"|",0 tsw bUp4,1 } // stop button - spstr tId.txt,tTmp.txt,"|",1 + spstr tId.txt,tTmp.txt,"|",4 if(tTmp.txt=="disable") { bStop4.pco=27501 + spstr tId.txt,bStop4.txt,"|",1 tsw bStop4,0 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { bStop4.pco=65535 - bStop4.txt=tTmp.txt + spstr tId.txt,bStop4.txt,"|",1 tsw bStop4,1 } // down button - spstr tId.txt,tTmp.txt,"|",2 + spstr tId.txt,tTmp.txt,"|",5 if(tTmp.txt=="disable") { bDown4.pco=27501 + spstr tId.txt,bDown4.txt,"|",2 tsw bDown4,0 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { bDown4.pco=65535 - bDown4.txt=tTmp.txt + spstr tId.txt,bDown4.txt,"|",2 tsw bDown4,1 } } @@ -3313,39 +3325,42 @@ Timer tmSerial // get Button State (optional Value) spstr strCommand.txt,tId.txt,"~",32 // up button - spstr tId.txt,tTmp.txt,"|",0 + spstr tId.txt,tTmp.txt,"|",3 if(tTmp.txt=="disable") { bUp5.pco=27501 + spstr tId.txt,bUp5.txt,"|",0 tsw bUp5,0 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { bUp5.pco=65535 - bUp5.txt=tTmp.txt + spstr tId.txt,bUp5.txt,"|",0 tsw bUp5,1 } // stop button - spstr tId.txt,tTmp.txt,"|",1 + spstr tId.txt,tTmp.txt,"|",4 if(tTmp.txt=="disable") { bStop5.pco=27501 + spstr tId.txt,bStop5.txt,"|",1 tsw bStop5,0 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { bStop5.pco=65535 - bStop5.txt=tTmp.txt + spstr tId.txt,bStop5.txt,"|",1 tsw bStop5,1 } // down button - spstr tId.txt,tTmp.txt,"|",2 + spstr tId.txt,tTmp.txt,"|",5 if(tTmp.txt=="disable") { bDown5.pco=27501 + spstr tId.txt,bDown5.txt,"|",2 tsw bDown5,0 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { bDown5.pco=65535 - bDown5.txt=tTmp.txt + spstr tId.txt,bDown5.txt,"|",2 tsw bDown5,1 } } diff --git a/HMI/US/portrait/n2t-out-visual/cardGrid.txt b/HMI/US/portrait/n2t-out-visual/cardGrid.txt index fd9109c9..85bcd160 100644 --- a/HMI/US/portrait/n2t-out-visual/cardGrid.txt +++ b/HMI/US/portrait/n2t-out-visual/cardGrid.txt @@ -592,9 +592,9 @@ Button bEntity1 Disable release event after dragging: 0 Send Component ID : disabled Opacity : 127 - x coordinate : 43 + x coordinate : 13 y coordinate : 75 - Width : 80 + Width : 140 Height : 80 Effect : load Effect Priority : 0 @@ -650,9 +650,9 @@ Button bEntity2 Disable release event after dragging: 0 Send Component ID : disabled Opacity : 127 - x coordinate : 198 + x coordinate : 168 y coordinate : 75 - Width : 80 + Width : 140 Height : 80 Effect : load Effect Priority : 0 @@ -708,9 +708,9 @@ Button bEntity3 Disable release event after dragging: 0 Send Component ID : disabled Opacity : 127 - x coordinate : 38 + x coordinate : 8 y coordinate : 210 - Width : 80 + Width : 140 Height : 80 Effect : load Effect Priority : 0 @@ -766,9 +766,9 @@ Button bEntity4 Disable release event after dragging: 0 Send Component ID : disabled Opacity : 127 - x coordinate : 198 + x coordinate : 168 y coordinate : 210 - Width : 80 + Width : 140 Height : 80 Effect : load Effect Priority : 0 @@ -824,9 +824,9 @@ Button bEntity5 Disable release event after dragging: 0 Send Component ID : disabled Opacity : 127 - x coordinate : 38 + x coordinate : 8 y coordinate : 340 - Width : 80 + Width : 140 Height : 80 Effect : load Effect Priority : 0 @@ -882,9 +882,9 @@ Button bEntity6 Disable release event after dragging: 0 Send Component ID : disabled Opacity : 127 - x coordinate : 198 + x coordinate : 168 y coordinate : 340 - Width : 80 + Width : 140 Height : 80 Effect : load Effect Priority : 0 diff --git a/HMI/US/portrait/n2t-out-visual/cardQR.txt b/HMI/US/portrait/n2t-out-visual/cardQR.txt index 48ec60fb..0ede21e2 100644 --- a/HMI/US/portrait/n2t-out-visual/cardQR.txt +++ b/HMI/US/portrait/n2t-out-visual/cardQR.txt @@ -43,7 +43,7 @@ Variable (string) strCommand ID : 6 Scope : local Text : - Max. Text Size: 200 + Max. Text Size: 270 Variable (string) entn Attributes @@ -292,7 +292,7 @@ QR Code qr0 Effect Time : 300 Logo overlay : no Text : - Max. Text Size : 105 + Max. Text Size : 100 Button bNext Attributes @@ -422,7 +422,7 @@ Button bText1 Vertical Alignment : center State : unpressed Text : - Max. Text Size : 10 + Max. Text Size : 30 Word wrap : disabled Horizontal Spacing : 0 Vertical Spacing : 0 @@ -469,7 +469,7 @@ Button bText2 Vertical Alignment : center State : unpressed Text : - Max. Text Size : 10 + Max. Text Size : 30 Word wrap : disabled Horizontal Spacing : 0 Vertical Spacing : 0 @@ -564,8 +564,8 @@ Dual-state Button btOnOff2 Events Touch Press Event - tSend.txt="event,buttonPress2,"+entn1.txt+",OnOff," - covx btOnOff1.val,tTmp.txt,0,0 + tSend.txt="event,buttonPress2,"+entn2.txt+",OnOff," + covx btOnOff2.val,tTmp.txt,0,0 tSend.txt+=tTmp.txt //send calc crc btlen tSend.txt,sys0 diff --git a/HMI/US/portrait/n2t-out-visual/nspanel_US_P_Stats.txt b/HMI/US/portrait/n2t-out-visual/nspanel_US_P_Stats.txt index 16421cb3..04503939 100644 --- a/HMI/US/portrait/n2t-out-visual/nspanel_US_P_Stats.txt +++ b/HMI/US/portrait/n2t-out-visual/nspanel_US_P_Stats.txt @@ -18,10 +18,10 @@ pageStartup 19 Component(s) 154 Line(s) of event code 115 Unique line(s) of event code -popupShutter - 20 Component(s) - 241 Line(s) of event code - 138 Unique line(s) of event code +cardGrid + 42 Component(s) + 439 Line(s) of event code + 254 Unique line(s) of event code popupLight 27 Component(s) 345 Line(s) of event code @@ -29,7 +29,7 @@ popupLight cardQR 30 Component(s) 363 Line(s) of event code - 205 Unique line(s) of event code + 207 Unique line(s) of event code cardThermo 56 Component(s) 546 Line(s) of event code @@ -42,21 +42,21 @@ cardMedia 33 Component(s) 350 Line(s) of event code 179 Unique line(s) of event code -cardGrid - 42 Component(s) - 439 Line(s) of event code - 254 Unique line(s) of event code screensaver 35 Component(s) 296 Line(s) of event code 237 Unique line(s) of event code +popupShutter + 20 Component(s) + 244 Line(s) of event code + 138 Unique line(s) of event code cardEntities 77 Component(s) - 1348 Line(s) of event code + 1363 Line(s) of event code 576 Unique line(s) of event code Total 13 Page(s) 414 Component(s) - 4670 Line(s) of event code + 4688 Line(s) of event code 1239 Unique line(s) of event code diff --git a/HMI/US/portrait/n2t-out-visual/popupShutter.txt b/HMI/US/portrait/n2t-out-visual/popupShutter.txt index 2cfd938c..d7c97199 100644 --- a/HMI/US/portrait/n2t-out-visual/popupShutter.txt +++ b/HMI/US/portrait/n2t-out-visual/popupShutter.txt @@ -247,8 +247,8 @@ Text tPosHeading Disable release event after dragging: 0 Send Component ID : disabled Opacity : 127 - x coordinate : 8 - y coordinate : 168 + x coordinate : 106 + y coordinate : 273 Width : 100 Height : 30 Effect : load @@ -324,8 +324,8 @@ Slider hPosition Disable release event after dragging: 0 Send Component ID : disabled Opacity : 127 - x coordinate : 9 - y coordinate : 198 + x coordinate : 35 + y coordinate : 304 Width : 250 Height : 43 Effect : load @@ -415,10 +415,10 @@ Button bDown1 Disable release event after dragging: 0 Send Component ID : disabled Opacity : 127 - x coordinate : 112 - y coordinate : 88 - Width : 50 - Height : 50 + x coordinate : 199 + y coordinate : 156 + Width : 70 + Height : 70 Effect : load Effect Priority : 0 Effect Time : 300 @@ -462,10 +462,10 @@ Button bStop1 Disable release event after dragging: 0 Send Component ID : disabled Opacity : 127 - x coordinate : 60 - y coordinate : 88 - Width : 50 - Height : 50 + x coordinate : 125 + y coordinate : 156 + Width : 70 + Height : 70 Effect : load Effect Priority : 0 Effect Time : 300 @@ -509,10 +509,10 @@ Button bUp1 Disable release event after dragging: 0 Send Component ID : disabled Opacity : 127 - x coordinate : 8 - y coordinate : 88 - Width : 50 - Height : 50 + x coordinate : 51 + y coordinate : 156 + Width : 70 + Height : 70 Effect : load Effect Priority : 0 Effect Time : 300 @@ -646,38 +646,41 @@ Timer tmSerial tIcon1.txt=tTmp.txt } // set icon bUp - spstr strCommand.txt,tTmp.txt,"~",5 + spstr strCommand.txt,tTmp.txt,"~",8 if(tTmp.txt=="disable") { tsw bUp1,0 + spstr strCommand.txt,bUp1.txt,"~",5 bUp1.pco=27501 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { - bUp1.txt=tTmp.txt + spstr strCommand.txt,bUp1.txt,"~",5 tsw bUp1,1 bUp1.pco=65535 } // set icon bStop - spstr strCommand.txt,tTmp.txt,"~",6 + spstr strCommand.txt,tTmp.txt,"~",9 if(tTmp.txt=="disable") { tsw bStop1,0 + spstr strCommand.txt,bStop1.txt,"~",6 bStop1.pco=27501 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { - bStop1.txt=tTmp.txt + spstr strCommand.txt,bStop1.txt,"~",6 tsw bStop1,1 bStop1.pco=65535 } // set icon bDown - spstr strCommand.txt,tTmp.txt,"~",7 + spstr strCommand.txt,tTmp.txt,"~",10 if(tTmp.txt=="disable") { + spstr strCommand.txt,bDown1.txt,"~",7 tsw bDown1,0 bDown1.pco=27501 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { - bDown1.txt=tTmp.txt + spstr strCommand.txt,bDown1.txt,"~",7 tsw bDown1,1 bDown1.pco=65535 } diff --git a/HMI/US/portrait/n2t-out/cardEntities.txt b/HMI/US/portrait/n2t-out/cardEntities.txt index c25f8fdc..8805505a 100644 --- a/HMI/US/portrait/n2t-out/cardEntities.txt +++ b/HMI/US/portrait/n2t-out/cardEntities.txt @@ -1508,39 +1508,42 @@ Timer tmSerial // get Button State (optional Value) spstr strCommand.txt,tId.txt,"~",8 // up button - spstr tId.txt,tTmp.txt,"|",0 + spstr tId.txt,tTmp.txt,"|",3 if(tTmp.txt=="disable") { bUp1.pco=27501 + spstr tId.txt,bUp1.txt,"|",0 tsw bUp1,0 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { bUp1.pco=65535 - bUp1.txt=tTmp.txt + spstr tId.txt,bUp1.txt,"|",0 tsw bUp1,1 } // stop button - spstr tId.txt,tTmp.txt,"|",1 + spstr tId.txt,tTmp.txt,"|",4 if(tTmp.txt=="disable") { bStop1.pco=27501 + spstr tId.txt,bStop1.txt,"|",1 tsw bStop1,0 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { bStop1.pco=65535 - bStop1.txt=tTmp.txt + spstr tId.txt,bStop1.txt,"|",1 tsw bStop1,1 } // down button - spstr tId.txt,tTmp.txt,"|",2 + spstr tId.txt,tTmp.txt,"|",5 if(tTmp.txt=="disable") { bDown1.pco=27501 + spstr tId.txt,bDown1.txt,"|",2 tsw bDown1,0 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { bDown1.pco=65535 - bDown1.txt=tTmp.txt + spstr tId.txt,bDown1.txt,"|",2 tsw bDown1,1 } } @@ -1668,39 +1671,42 @@ Timer tmSerial // get Button State (optional Value) spstr strCommand.txt,tId.txt,"~",14 // up button - spstr tId.txt,tTmp.txt,"|",0 + spstr tId.txt,tTmp.txt,"|",3 if(tTmp.txt=="disable") { bUp2.pco=27501 + spstr tId.txt,bUp2.txt,"|",0 tsw bUp2,0 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { bUp2.pco=65535 - bUp2.txt=tTmp.txt + spstr tId.txt,bUp2.txt,"|",0 tsw bUp2,1 } // stop button - spstr tId.txt,tTmp.txt,"|",1 + spstr tId.txt,tTmp.txt,"|",4 if(tTmp.txt=="disable") { bStop2.pco=27501 + spstr tId.txt,bStop2.txt,"|",1 tsw bStop2,0 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { bStop2.pco=65535 - bStop2.txt=tTmp.txt + spstr tId.txt,bStop2.txt,"|",1 tsw bStop2,1 } // down button - spstr tId.txt,tTmp.txt,"|",2 + spstr tId.txt,tTmp.txt,"|",5 if(tTmp.txt=="disable") { bDown2.pco=27501 + spstr tId.txt,bDown2.txt,"|",2 tsw bDown2,0 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { bDown2.pco=65535 - bDown2.txt=tTmp.txt + spstr tId.txt,bDown2.txt,"|",2 tsw bDown2,1 } } @@ -1828,39 +1834,42 @@ Timer tmSerial // get Button State (optional Value) spstr strCommand.txt,tId.txt,"~",20 // up button - spstr tId.txt,tTmp.txt,"|",0 + spstr tId.txt,tTmp.txt,"|",3 if(tTmp.txt=="disable") { bUp3.pco=27501 + spstr tId.txt,bUp3.txt,"|",0 tsw bUp3,0 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { bUp3.pco=65535 - bUp3.txt=tTmp.txt + spstr tId.txt,bUp3.txt,"|",0 tsw bUp3,1 } // stop button - spstr tId.txt,tTmp.txt,"|",1 + spstr tId.txt,tTmp.txt,"|",4 if(tTmp.txt=="disable") { bStop3.pco=27501 + spstr tId.txt,bStop3.txt,"|",1 tsw bStop3,0 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { bStop3.pco=65535 - bStop3.txt=tTmp.txt + spstr tId.txt,bStop3.txt,"|",1 tsw bStop3,1 } // down button - spstr tId.txt,tTmp.txt,"|",2 + spstr tId.txt,tTmp.txt,"|",5 if(tTmp.txt=="disable") { bDown3.pco=27501 + spstr tId.txt,bDown3.txt,"|",2 tsw bDown3,0 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { bDown3.pco=65535 - bDown3.txt=tTmp.txt + spstr tId.txt,bDown3.txt,"|",2 tsw bDown3,1 } } @@ -1988,39 +1997,42 @@ Timer tmSerial // get Button State (optional Value) spstr strCommand.txt,tId.txt,"~",26 // up button - spstr tId.txt,tTmp.txt,"|",0 + spstr tId.txt,tTmp.txt,"|",3 if(tTmp.txt=="disable") { bUp4.pco=27501 + spstr tId.txt,bUp4.txt,"|",0 tsw bUp4,0 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { bUp4.pco=65535 - bUp4.txt=tTmp.txt + spstr tId.txt,bUp4.txt,"|",0 tsw bUp4,1 } // stop button - spstr tId.txt,tTmp.txt,"|",1 + spstr tId.txt,tTmp.txt,"|",4 if(tTmp.txt=="disable") { bStop4.pco=27501 + spstr tId.txt,bStop4.txt,"|",1 tsw bStop4,0 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { bStop4.pco=65535 - bStop4.txt=tTmp.txt + spstr tId.txt,bStop4.txt,"|",1 tsw bStop4,1 } // down button - spstr tId.txt,tTmp.txt,"|",2 + spstr tId.txt,tTmp.txt,"|",5 if(tTmp.txt=="disable") { bDown4.pco=27501 + spstr tId.txt,bDown4.txt,"|",2 tsw bDown4,0 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { bDown4.pco=65535 - bDown4.txt=tTmp.txt + spstr tId.txt,bDown4.txt,"|",2 tsw bDown4,1 } } @@ -2148,39 +2160,42 @@ Timer tmSerial // get Button State (optional Value) spstr strCommand.txt,tId.txt,"~",32 // up button - spstr tId.txt,tTmp.txt,"|",0 + spstr tId.txt,tTmp.txt,"|",3 if(tTmp.txt=="disable") { bUp5.pco=27501 + spstr tId.txt,bUp5.txt,"|",0 tsw bUp5,0 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { bUp5.pco=65535 - bUp5.txt=tTmp.txt + spstr tId.txt,bUp5.txt,"|",0 tsw bUp5,1 } // stop button - spstr tId.txt,tTmp.txt,"|",1 + spstr tId.txt,tTmp.txt,"|",4 if(tTmp.txt=="disable") { bStop5.pco=27501 + spstr tId.txt,bStop5.txt,"|",1 tsw bStop5,0 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { bStop5.pco=65535 - bStop5.txt=tTmp.txt + spstr tId.txt,bStop5.txt,"|",1 tsw bStop5,1 } // down button - spstr tId.txt,tTmp.txt,"|",2 + spstr tId.txt,tTmp.txt,"|",5 if(tTmp.txt=="disable") { bDown5.pco=27501 + spstr tId.txt,bDown5.txt,"|",2 tsw bDown5,0 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { bDown5.pco=65535 - bDown5.txt=tTmp.txt + spstr tId.txt,bDown5.txt,"|",2 tsw bDown5,1 } } diff --git a/HMI/US/portrait/n2t-out/cardQR.txt b/HMI/US/portrait/n2t-out/cardQR.txt index bb7d2918..50ada2f8 100644 --- a/HMI/US/portrait/n2t-out/cardQR.txt +++ b/HMI/US/portrait/n2t-out/cardQR.txt @@ -34,7 +34,7 @@ Variable (string) strCommand Attributes Scope : local Text : - Max. Text Size: 200 + Max. Text Size: 270 Variable (string) entn Attributes @@ -154,7 +154,7 @@ QR Code qr0 Disable release event after dragging: 0 Send Component ID : disabled Text : - Max. Text Size : 105 + Max. Text Size : 100 Button bNext Attributes @@ -221,7 +221,7 @@ Button bText1 Send Component ID : disabled State : unpressed Text : - Max. Text Size : 10 + Max. Text Size : 30 Events Touch Press Event @@ -246,7 +246,7 @@ Button bText2 Send Component ID : disabled State : unpressed Text : - Max. Text Size : 10 + Max. Text Size : 30 Events Touch Press Event @@ -302,8 +302,8 @@ Dual-state Button btOnOff2 Events Touch Press Event - tSend.txt="event,buttonPress2,"+entn1.txt+",OnOff," - covx btOnOff1.val,tTmp.txt,0,0 + tSend.txt="event,buttonPress2,"+entn2.txt+",OnOff," + covx btOnOff2.val,tTmp.txt,0,0 tSend.txt+=tTmp.txt //send calc crc btlen tSend.txt,sys0 diff --git a/HMI/US/portrait/n2t-out/popupShutter.txt b/HMI/US/portrait/n2t-out/popupShutter.txt index 5fca3dc8..6c7b272d 100644 --- a/HMI/US/portrait/n2t-out/popupShutter.txt +++ b/HMI/US/portrait/n2t-out/popupShutter.txt @@ -361,38 +361,41 @@ Timer tmSerial tIcon1.txt=tTmp.txt } // set icon bUp - spstr strCommand.txt,tTmp.txt,"~",5 + spstr strCommand.txt,tTmp.txt,"~",8 if(tTmp.txt=="disable") { tsw bUp1,0 + spstr strCommand.txt,bUp1.txt,"~",5 bUp1.pco=27501 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { - bUp1.txt=tTmp.txt + spstr strCommand.txt,bUp1.txt,"~",5 tsw bUp1,1 bUp1.pco=65535 } // set icon bStop - spstr strCommand.txt,tTmp.txt,"~",6 + spstr strCommand.txt,tTmp.txt,"~",9 if(tTmp.txt=="disable") { tsw bStop1,0 + spstr strCommand.txt,bStop1.txt,"~",6 bStop1.pco=27501 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { - bStop1.txt=tTmp.txt + spstr strCommand.txt,bStop1.txt,"~",6 tsw bStop1,1 bStop1.pco=65535 } // set icon bDown - spstr strCommand.txt,tTmp.txt,"~",7 + spstr strCommand.txt,tTmp.txt,"~",10 if(tTmp.txt=="disable") { + spstr strCommand.txt,bDown1.txt,"~",7 tsw bDown1,0 bDown1.pco=27501 - }else if(tTmp.txt!="") + }else if(tTmp.txt=="enable") { - bDown1.txt=tTmp.txt + spstr strCommand.txt,bDown1.txt,"~",7 tsw bDown1,1 bDown1.pco=65535 } diff --git a/HMI/US/portrait/nspanel_US_P.HMI b/HMI/US/portrait/nspanel_US_P.HMI index 90bfa81b..3c12e6a7 100644 Binary files a/HMI/US/portrait/nspanel_US_P.HMI and b/HMI/US/portrait/nspanel_US_P.HMI differ diff --git a/HMI/US/portrait/nspanel_US_P.tft b/HMI/US/portrait/nspanel_US_P.tft index e5dd5368..c91f8f7e 100644 Binary files a/HMI/US/portrait/nspanel_US_P.tft and b/HMI/US/portrait/nspanel_US_P.tft differ diff --git a/HMI/code_gen/pages/cardEntitiesSerial.py b/HMI/code_gen/pages/cardEntitiesSerial.py index 8fcd077f..fb94fe66 100644 --- a/HMI/code_gen/pages/cardEntitiesSerial.py +++ b/HMI/code_gen/pages/cardEntitiesSerial.py @@ -49,47 +49,50 @@ for i in range(1,6): vis hSlider{i},0 vis nNum{i},0 // get Button State (optional Value) - spstr strCommand.txt,tId.txt,"~",{idxstart+5} + spstr strCommand.txt,tId.txt,"~",{idxstart+5} // up button - spstr tId.txt,tTmp.txt,"|",0 + spstr tId.txt,tTmp.txt,"|",3 if(tTmp.txt=="disable") {{ bUp{i}.pco=27501 + spstr tId.txt,bUp{i}.txt,"|",0 tsw bUp{i},0 }} - else if(tTmp.txt!="") + else if(tTmp.txt=="enable") {{ bUp{i}.pco=65535 - bUp{i}.txt=tTmp.txt + spstr tId.txt,bUp{i}.txt,"|",0 tsw bUp{i},1 }} // stop button - spstr tId.txt,tTmp.txt,"|",1 + spstr tId.txt,tTmp.txt,"|",4 if(tTmp.txt=="disable") {{ bStop{i}.pco=27501 + spstr tId.txt,bStop{i}.txt,"|",1 tsw bStop{i},0 }} - else if(tTmp.txt!="") + else if(tTmp.txt=="enable") {{ bStop{i}.pco=65535 - bStop{i}.txt=tTmp.txt + spstr tId.txt,bStop{i}.txt,"|",1 tsw bStop{i},1 }} // down button - spstr tId.txt,tTmp.txt,"|",2 + spstr tId.txt,tTmp.txt,"|",5 if(tTmp.txt=="disable") {{ bDown{i}.pco=27501 + spstr tId.txt,bDown{i}.txt,"|",2 tsw bDown{i},0 }} - else if(tTmp.txt!="") + else if(tTmp.txt=="enable") {{ bDown{i}.pco=65535 - bDown{i}.txt=tTmp.txt + spstr tId.txt,bDown{i}.txt,"|",2 tsw bDown{i},1 }} }} diff --git a/HMI/code_gen/pages/out.txt b/HMI/code_gen/pages/out.txt deleted file mode 100644 index 42c39fd9..00000000 --- a/HMI/code_gen/pages/out.txt +++ /dev/null @@ -1,1034 +0,0 @@ - -// data available -if(usize>1) -{ - bufferPos=0 - while(bufferPos= 2: self._current_card = self._previous_cards.pop() @@ -212,7 +215,7 @@ class LuiController(object): self._ha_api.get_entity(entity_id).call_service("turn_on") elif entity_id.startswith('script'): self._ha_api.get_entity(entity_id).call_service("turn_on") - elif entity_id.startswith('light') or entity_id.startswith('switch') or entity_id.startswith('input_boolean'): + elif entity_id.startswith('light') or entity_id.startswith('switch') or entity_id.startswith('input_boolean') or entity_id.startswith('automation'): self._ha_api.get_entity(entity_id).call_service("toggle") elif entity_id.startswith('lock'): if self._ha_api.get_entity(entity_id).state == "locked": diff --git a/apps/nspanel-lovelace-ui/luibackend/icons.py b/apps/nspanel-lovelace-ui/luibackend/icons.py index 849d826e..851ebdf5 100644 --- a/apps/nspanel-lovelace-ui/luibackend/icons.py +++ b/apps/nspanel-lovelace-ui/luibackend/icons.py @@ -27,35 +27,81 @@ sensor_mapping_off = { } sensor_mapping = { + "apparent_power": "flash", + "aqi": "smog", + "battery": "battery", + "carbon_dioxide": "smog", + "carbon_monoxide": "smog", + "current": "flash", + "date": "calendar", + "duration": "timer", + "energy": "flash", + "frequency": "chart-bell-curve", + "gas": "gas-cylinder", + "humidity": "air-humidifier", + "illuminance": "light", + "monetary": "cash", + "nitrogen_dioxide": "smog", + "nitrogen_monoxide": "smog", + "nitrous_oxide": "smog", + "ozone": "smog", + "pm1": "smog", + "pm10": "smog", + "pm25": "smog", + "power_factor": "flash", + "power": "flash", + "pressure": "gauge", + "reactive_power": "flash", + "signal_strength": "signal", + "sulphur_dioxide": "smog", "temperature": "thermometer", - "power": "flash" + "timestamp": "calendar-clock", + "volatile_organic_compounds": "smog", + "voltage": "flash" } +cover_mapping = { + #"device_class": ("icon-open", "icon-closed", "icon-cover-open", "icon-cover-stop", "icon-cover-close") + "awning": ("window-open", "window-closed", "arrow-up", "stop", "arrow-down"), + "blind": ("blinds-open", "blinds", "arrow-up", "stop", "arrow-down"), + "curtain": ("curtains-closed", "curtains", "arrow-expand-horizontal", "stop", "arrow-collapse-horizontal"), + "damper": ("checkbox-blank-circle", "circle-slice-8", "arrow-up", "stop", "arrow-down"), + "door": ("door-open", "door-closed", "arrow-expand-horizontal", "stop", "arrow-collapse-horizontal"), + "garage": ("garage-open", "garage", "arrow-up", "stop", "arrow-down"), + "gate": ("gate-open", "gate", "arrow-expand-horizontal", "stop", "arrow-collapse-horizontal"), + "shade": ("blinds-open", "blinds", "arrow-up", "stop", "arrow-down"), + "shutter": ("window-shutter-open", "window-shutter", "arrow-up", "stop", "arrow-down"), + "window": ("window-open", "window-closed", "arrow-up", "stop", "arrow-down"), +} -def map_to_mdi_name(ha_type, state=None, device_class=None): +def map_to_mdi_name(ha_type, state=None, device_class=None, cardType=None): if ha_type == "weather": return weather_mapping[state] if state in weather_mapping else "alert-circle-outline" - if ha_type == "button": + elif ha_type == "button": return "gesture-tap-button" - if ha_type == "scene": + elif ha_type == "scene": return "palette" - if ha_type == "script": + elif ha_type == "script": return "script-text" - if ha_type == "switch": + elif ha_type == "switch": return "light-switch" - if ha_type == "number": + elif ha_type == "automation": + return "robot" + elif ha_type == "number": return "ray-vertex" - if ha_type == "light": + elif ha_type == "light": return "lightbulb" - if ha_type == "fan": + elif ha_type == "fan": return "fan" - if ha_type == "input_boolean": + elif ha_type == "input_boolean": return "check-circle-outline" if state == "on" else "close-circle-outline" - if ha_type == "cover": - return "window-open" if state == "open" else "window-closed" - if ha_type == "lock": + elif ha_type == "cover": + if state == "closed": + return cover_mapping[device_class][1] if device_class in cover_mapping else "alert-circle-outline" + else: + return cover_mapping[device_class][0] if device_class in cover_mapping else "alert-circle-outline" + elif ha_type == "lock": return "lock-open" if state == "unlocked" else "lock" - elif ha_type == "sensor": if state == "on": return sensor_mapping_on[device_class] if device_class in sensor_mapping_on else "alert-circle-outline" @@ -63,10 +109,26 @@ def map_to_mdi_name(ha_type, state=None, device_class=None): return sensor_mapping_off[device_class] if device_class in sensor_mapping_off else "alert-circle-outline" else: return sensor_mapping[device_class] if device_class in sensor_mapping else "alert-circle-outline" + else: + return "alert-circle-outline" - return "alert-circle-outline" - -def get_icon_id_ha(ha_name, state=None, device_class=None, overwrite=None): +def get_icon_id_ha(ha_type, state=None, device_class=None, overwrite=None): if overwrite is not None: return get_icon_id(overwrite) - return get_icon_id(map_to_mdi_name(ha_name, state, device_class)) + return get_icon_id(map_to_mdi_name(ha_type, state, device_class)) + +def get_action_id_ha(ha_type, action, device_class=None, overwrite=None): + if overwrite is not None: + return get_icon_id(overwrite) + if ha_type == "cover": + if action == "open": + actionicon = cover_mapping[device_class][2] if device_class in cover_mapping else "alert-circle-outline" + elif action == "close": + actionicon = cover_mapping[device_class][4] if device_class in cover_mapping else "alert-circle-outline" + elif action == "stop": + actionicon = cover_mapping[device_class][3] if device_class in cover_mapping else "alert-circle-outline" + else: + actionicon = "alert-circle-outline" + else: + actionicon = "alert-circle-outline" + return get_icon_id(actionicon) diff --git a/apps/nspanel-lovelace-ui/luibackend/pages.py b/apps/nspanel-lovelace-ui/luibackend/pages.py index 835975ff..45f00a59 100644 --- a/apps/nspanel-lovelace-ui/luibackend/pages.py +++ b/apps/nspanel-lovelace-ui/luibackend/pages.py @@ -1,8 +1,10 @@ import datetime import dateutil.parser as dp +from theme import get_screensaver_color_output from icon_mapping import get_icon_id from icons import get_icon_id_ha +from icons import get_action_id_ha from helper import scale, rgb_dec565, rgb_brightness, get_attr_safe, convert_temperature from localization import get_translation @@ -56,10 +58,11 @@ class LuiPagesGen(object): def page_type(self, target_page): self._send_mqtt_msg(f"pageType~{target_page}") - def update_screensaver_weather(self): + def update_screensaver_weather(self, theme): global babel_spec we_name = self._config._config_screensaver.entity.entityId unit = self._config._config_screensaver.raw_config.get("weatherUnit", "celsius") + state = {} if self._ha_api.entity_exists(we_name): we = self._ha_api.get_entity(we_name) @@ -68,6 +71,7 @@ class LuiPagesGen(object): return icon_cur = get_icon_id_ha("weather", state=we.state) + state["tMainIcon"] = we.state text_cur = convert_temperature(we.attributes.temperature, unit) forecastSkip = self._config._config_screensaver.raw_config.get(f"forecastSkip")+1 @@ -94,6 +98,14 @@ class LuiPagesGen(object): else: up = up.strftime('%a') icon = get_icon_id_ha("weather", state=we.attributes.forecast[fid]['condition']) + if i == 1: + state["tF1Icon"] = we.attributes.forecast[fid]['condition'] + elif i == 2: + state["tF2Icon"] = we.attributes.forecast[fid]['condition'] + elif i == 3: + state["tF3Icon"] = we.attributes.forecast[fid]['condition'] + elif i == 4: + state["tF4Icon"] = we.attributes.forecast[fid]['condition'] down = convert_temperature(we.attributes.forecast[fid]['temperature'], unit) else: up = "" @@ -111,12 +123,18 @@ class LuiPagesGen(object): weather_res+=f"~{up}~{icon}~{down}" altLayout = "" - if self._config._config_screensaver.raw_config.get("alternativeLayout", False) is True: + if self._config._config_screensaver.raw_config.get("alternativeLayout", False): altLayout = f"~{get_icon_id('water-percent')}~{we.attributes.humidity} %" self._send_mqtt_msg(f"weatherUpdate~{icon_cur}~{text_cur}{weather_res}{altLayout}") + + # send color if configured in screensaver + if theme is not None: + if not ("AutoWeather" in theme and theme["AutoWeather"] == "auto"): + state = None + self._send_mqtt_msg(get_screensaver_color_output(theme=theme, state=state)) - def generate_entities_item(self, entity): + def generate_entities_item(self, entity, cardType): entityId = entity.entityId icon = entity.iconOverride name = entity.nameOverride @@ -136,6 +154,11 @@ class LuiPagesGen(object): return f"~button~{entityId}~{icon_id}~17299~{name}~{text}" else: return f"~text~{entityId}~{get_icon_id('alert-circle-outline')}~17299~page not found~" + if entityType == "iText": + key = entityId.split(".")[1] + value = entityId.split(".")[2] + icon_id = get_icon_id(icon) if icon is not None else get_icon_id("alert-circle-outline") + return f"~text~{entityId}~{icon_id}~17299~{key}~{value}" if not self._ha_api.entity_exists(entityId): return f"~text~{entityId}~{get_icon_id('alert-circle-outline')}~17299~Not found check~ apps.yaml" @@ -143,33 +166,49 @@ class LuiPagesGen(object): entity = self._ha_api.get_entity(entityId) name = name if name is not None else entity.attributes.friendly_name if entityType == "cover": - icon_id = get_icon_id_ha("cover", state=entity.state, overwrite=icon) - icon_up = get_icon_id("arrow-up") - icon_stop = get_icon_id("stop") - icon_down = get_icon_id("arrow-down") - pos = int(entity.attributes.get("current_position", 50)) + + device_class = entity.attributes.get("device_class", "window") + icon_id = get_icon_id_ha(ha_type=entityType, state=entity.state, device_class=device_class, overwrite=icon) + icon_up = get_action_id_ha(ha_type=entityType, action="open", device_class=device_class) + icon_stop = get_action_id_ha(ha_type=entityType, action="stop", device_class=device_class) + icon_down = get_action_id_ha(ha_type=entityType, action="close", device_class=device_class) + + pos = entity.attributes.get("current_position") if pos == 100: - status = f"disable|{icon_stop}|{icon_down}" + status = f"disable|enable|enable" elif pos == 0: - status = f"{icon_up}|{icon_stop}|disable" + status = f"enable|enable|disable" + elif pos is None: + pos_status = entity.state + if pos_status == "open": + status = f"disable|enable|enable" + elif pos_status == "closed": + status = f"enable|enable|disable" + else: + status = f"enable|enable|enable" else: - status = f"{icon_up}|{icon_stop}|{icon_down}" - return f"~shutter~{entityId}~{icon_id}~17299~{name}~{status}" + status = f"enable|enable|enable" + return f"~shutter~{entityId}~{icon_id}~17299~{name}~{icon_up}|{icon_stop}|{icon_down}|{status}" if entityType in "light": switch_val = 1 if entity.state == "on" else 0 icon_color = self.get_entity_color(entity) icon_id = get_icon_id_ha("light", overwrite=icon) return f"~{entityType}~{entityId}~{icon_id}~{icon_color}~{name}~{switch_val}" - if entityType in ["switch", "input_boolean"]: + if entityType in ["switch", "input_boolean", "automation"]: switch_val = 1 if entity.state == "on" else 0 icon_color = self.get_entity_color(entity) icon_id = get_icon_id_ha(entityType, state=entity.state, overwrite=icon) return f"~switch~{entityId}~{icon_id}~{icon_color}~{name}~{switch_val}" if entityType in ["sensor", "binary_sensor"]: device_class = entity.attributes.get("device_class", "") - icon_id = get_icon_id_ha("sensor", state=entity.state, device_class=device_class, overwrite=icon) unit_of_measurement = entity.attributes.get("unit_of_measurement", "") value = entity.state + " " + unit_of_measurement + if cardType == "cardGrid": + icon_id = entity.state[:4] + if icon_id[-1] == ".": + icon_id = icon_id[:-1] + else: + icon_id = get_icon_id_ha("sensor", state=entity.state, device_class=device_class, overwrite=icon) icon_color = self.get_entity_color(entity) return f"~text~{entityId}~{icon_id}~{icon_color}~{name}~{value}" if entityType in ["button", "input_button"]: @@ -204,11 +243,11 @@ class LuiPagesGen(object): return f"~text~{entityId}~{icon_id}~17299~{name}~{value}" return f"~text~{entityId}~{get_icon_id('alert-circle-outline')}~17299~error~" - def generate_entities_page(self, navigation, heading, items): + def generate_entities_page(self, navigation, heading, items, cardType): command = f"entityUpd~{heading}~{navigation}" # Get items and construct cmd string for item in items: - command += self.generate_entities_item(item) + command += self.generate_entities_item(item, cardType) self._send_mqtt_msg(command) def generate_thermo_page(self, navigation, entity, temp_unit): @@ -276,7 +315,7 @@ class LuiPagesGen(object): else: entity = self._ha_api.get_entity(item) heading = entity.attributes.friendly_name - icon = get_icon_id('alert-circle-outline') + icon = get_icon_id('speaker-off') title = get_attr_safe(entity, "media_title", "") author = get_attr_safe(entity, "media_artist", "") volume = int(get_attr_safe(entity, "volume_level", 0)*100) @@ -362,6 +401,15 @@ class LuiPagesGen(object): command = f"entityUpd~{item}~{navigation}{arm_buttons}~{icon}~{color}~{numpad}~{flashing}" self._send_mqtt_msg(command) + + def generate_qr_page(self, navigation, heading, items, cardType, qrcode): + command = f"entityUpd~{heading}~{navigation}~{qrcode}" + # Get items and construct cmd string + for item in items: + command += self.generate_entities_item(item, cardType) + self._send_mqtt_msg(command) + + def render_card(self, card, send_page_type=True): self._ha_api.log(f"Started rendering of page {card.pos} with type {card.cardType}") @@ -377,7 +425,7 @@ class LuiPagesGen(object): self.page_type(card.cardType) if card.cardType in ["cardEntities", "cardGrid"]: - self.generate_entities_page(navigation, card.title, card.entities) + self.generate_entities_page(navigation, card.title, card.entities, card.cardType) return if card.cardType == "cardThermo": temp_unit = card.raw_config.get("temperatureUnit", "celsius") @@ -387,7 +435,12 @@ class LuiPagesGen(object): if card.cardType == "cardAlarm": self.generate_alarm_page(navigation, card.entity) if card.cardType == "screensaver": - self.update_screensaver_weather() + theme = card.raw_config.get("theme") + self.update_screensaver_weather(theme) + if card.cardType == "cardQR": + qrcode = card.raw_config.get("qrCode", "") + self.generate_qr_page(navigation, card.title, card.entities, card.cardType, qrcode) + def generate_light_detail_page(self, entity): @@ -423,7 +476,9 @@ class LuiPagesGen(object): def generate_shutter_detail_page(self, entity): entity = self._ha_api.get_entity(entity) - icon_id = get_icon_id_ha("cover", state=entity.state) + entityType="cover" + device_class = entity.attributes.get("device_class", "window") + icon_id = get_icon_id_ha(entityType, state=entity.state, device_class=device_class) pos = entity.attributes.get("current_position") if pos is None: @@ -433,17 +488,25 @@ class LuiPagesGen(object): pos_status = pos - icon_up = get_icon_id("arrow-up") - icon_stop = get_icon_id("stop") - icon_down = get_icon_id("arrow-down") - + icon_up = get_action_id_ha(ha_type=entityType, action="open", device_class=device_class) + icon_stop = get_action_id_ha(ha_type=entityType, action="stop", device_class=device_class) + icon_down = get_action_id_ha(ha_type=entityType, action="close", device_class=device_class) + icon_up_status = "enable" + icon_stop_status = "enable" + icon_down_status = "enable" + if pos == 100: - icon_up = "disable" + icon_up_status = "disable" elif pos == 0: - icon_down = "disable" + icon_down_status = "disable" + elif pos == "disable": + if pos_status == "open": + icon_up_status = "disable" + elif pos_status == "closed": + icon_down_status = "disable" pos_translation = get_translation(self._locale, "position") - self._send_mqtt_msg(f"entityUpdateDetail~{pos}~{pos_translation}: {pos_status}~{pos_translation}~{icon_id}~{icon_up}~{icon_stop}~{icon_down}") + self._send_mqtt_msg(f"entityUpdateDetail~{pos}~{pos_translation}: {pos_status}~{pos_translation}~{icon_id}~{icon_up}~{icon_stop}~{icon_down}~{icon_up_status}~{icon_stop_status}~{icon_down_status}") def send_message_page(self, id, heading, msg, b1, b2): self._send_mqtt_msg(f"pageType~popupNotify") diff --git a/apps/nspanel-lovelace-ui/luibackend/theme.py b/apps/nspanel-lovelace-ui/luibackend/theme.py new file mode 100644 index 00000000..a7de37d2 --- /dev/null +++ b/apps/nspanel-lovelace-ui/luibackend/theme.py @@ -0,0 +1,72 @@ + +from helper import rgb_dec565 + +default_screensaver_color_mapping = { + #"item": "color in decimal RGB565 (0-65535)" + "background": "0", + "time": "65535", + "timeAMPM": "65535", + "date": "65535", + "tMainIcon": "65535", + "tMainText": "65535", + "tForecast1": "65535", + "tForecast2": "65535", + "tForecast3": "65535", + "tForecast4": "65535", + "tF1Icon": "65535", + "tF2Icon": "65535", + "tF3Icon": "65535", + "tF4Icon": "65535", + "tForecast1Val": "65535", + "tForecast2Val": "65535", + "tForecast3Val": "65535", + "tForecast4Val": "65535", + "bar": "65535", + "tMainIconAlt": "65535", + "tMainTextAlt": "65535", + "tMRIcon": "65535", + "tMR": "65535" +} + +default_weather_icon_color_mapping = { + #"item-per HA" "color in decimal RGB 565 (0-65535)" + "clear-night": "35957", #50% grey + "cloudy": "31728", #grey-blue + "exceptional": "63488", #red + "fog": "21130", #75% grey + "hail": "65535", #white + "lightning": "65120", #golden-yellow + "lightning-rainy": "50400", #dark-golden-yellow + "partlycloudy": "35957", #50% grey + "pouring": "249", #blue + "rainy": "33759", #light-blue + "snowy": "65535", #white + "snowy-rainy": "44479", #light-blue-grey + "sunny": "63469", #bright-yellow + "windy": "35957", #50% grey + "windy-variant": "35957" #50% grey +} + +def get_screensaver_color_output(theme, state=None): + color_output = "color" + for key in default_screensaver_color_mapping: + color_output += f"~{map_color(key=key, theme=theme, state=state)}" + return color_output + +def map_color(key, theme, state=None): + config_color = default_screensaver_color_mapping[key] +# Use theme color if set + if key in theme: + config_color = rgb_dec565(theme[key]) +# Use Autocolouring for weather + elif state is not None: + if key in ["tMainIcon", "tF1Icon", "tF2Icon", "tF3Icon", "tF4Icon"]: + config_color = map_weather_icon_color(key=key, state=state) + return config_color + +def map_weather_icon_color(key, state): + if state[key] in default_weather_icon_color_mapping: + config_color = default_weather_icon_color_mapping[state[key]] + else: + config_color = "65535" + return config_color