diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..2c66445a --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# don't add nextion2text +HMI/Nextion2Text.py diff --git a/HMI/README.md b/HMI/README.md index 8bade4ed..d6e56308 100644 --- a/HMI/README.md +++ b/HMI/README.md @@ -14,7 +14,7 @@ See the following picture to get an Idea for the messages send and recived from # Custom Protocol ``` -55 BB [payload length] [payload] [crc] [crc] +55 BB [payload length] [payload length] [payload] [crc] [crc] ``` Payload length contains the number of bytes of the payload. @@ -27,7 +27,7 @@ Instead the commands are plain text commands with parameters. ## Example for valid Message This message has to be generated for the Message "1337" (1337 is not a valid command, this is just an example) ``` -55 BB 04 31 33 33 37 5F 5B +55 BB 04 00 31 33 33 37 5F 5B ``` ## Messages to Nextion Display @@ -95,9 +95,9 @@ entityUpd,1,switch,switch.entityName,4,Switch1,0 ### popupLight Page -entityUpdateDetail,*buttonState*,*sliderBrightnessPos*,*sliderColorTempPos* +entityUpdateDetail,*buttonState*,*sliderBrightnessPos*,*sliderColorTempPos*,*colorMode* -entityUpdateDetail,1,100,78 +entityUpdateDetail,1,100,78,enable entityUpdateDetail,1,100,disable @@ -107,6 +107,10 @@ entityUpdateDetail,*ignored*,*sliderPos* entityUpdateDetail,1,77 +### popupNotify Page + +entityUpdateDetail,*tHeading*,*b1*,*b2*,*tText* + ### cardThermo Page entityUpd,*internalNameEntiy*,*heading*,*currentTemp*,*destTemp*,*status*,*minTemp*,*maxTemp*,*stepTemp* @@ -151,12 +155,20 @@ event,buttonPress,D,nameEntity,internalNameEntity,1,brightnessSlider,50 event,buttonPress,D,nameEntity,internalNameEntity,1,colorTempSlider,50 +event,buttonPress,D,nameEntity,internalNameEntity,1,colorWheel,x|y + ### popupShutter Page event,pageOpenDetail,popupShutter,internalNameEntity event,buttonPress,D,nameEntity,internalNameEntity,1,positionSlider,50 +### popupNotify Page + +event,buttonPress,D,D,D,1,notifyAction,yes + +event,buttonPress,D,D,D,1,notifyAction,no + ### cardThermo Page event,pageOpen,0 @@ -173,6 +185,8 @@ event,buttonPress,1,tHeading,internalNameEntity,1,media-next event,buttonPress,1,tHeading,internalNameEntity,1,volumeSlider,75 + + # Icons IDs ID | Icon diff --git a/HMI/n2t-out/Program.s.txt b/HMI/n2t-out/Program.s.txt new file mode 100644 index 00000000..36907784 --- /dev/null +++ b/HMI/n2t-out/Program.s.txt @@ -0,0 +1,28 @@ +Program.s + //The following code is only run once when power on, and is generally used for global variable definition and power on initialization data + int sys0=0,sys1=0,sys2=0 //At present, the definition of global variable only supports 4-byte signed integer (int), and other types of global quantity declaration are not supported. If you want to use string type, you can use variable control in the page to implement + int bufferPos=0 + int recvCrc=0 + int payloadLength=0 + int par0=0,par1=0 + // landsspace orientation x has 480px and y has 320px xy limits todo: adjust xy values to something that fit's resulution + //Maximum values in directional change for Swipes beeing detected as swipe (diagonal swipes are invalid) (for one axis at a time) + int xLimit=125,yLimit=125 + int ixLimit=-125,iyLimit=-125 + //Minimum values for swipes, directional changes below theese values are ignored, because they could be unintended swipes + int xLimitMin=80,yLimitMin=80 + int ixLimitMin=-80,iyLimitMin=-80 + // Swipe Result Vars + int ycR=0,xcR=0 + // Start End Swipe Touch Locations + int yc1=0,xc1=0,yc2=0,xc2=0 + // sleep timeout in s + int sleepTimeout=20 + int sleepValue=0 + // dim value + int dimValue=40 + // current page + int nPage=0 + // fix touch offset + lcd_dev fffb 0002 0000 0020 + page pageStartup diff --git a/HMI/n2t-out/cardEntities.txt b/HMI/n2t-out/cardEntities.txt new file mode 100644 index 00000000..736ca75a --- /dev/null +++ b/HMI/n2t-out/cardEntities.txt @@ -0,0 +1,1659 @@ +Page cardEntities + Attributes + ID : 0 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + Locked : no + Swide up page ID : disabled + Swide down page ID : disabled + Swide left page ID : disabled + Swide right page ID : disabled + + Events + Preinitialize Event + //wup=cardEntities + //remove background & activate reparse mode + vis p0,0 + recmod=1 + bauds=115200 + //debug stuff + vis tTmp,0 + vis nPageDisp,0 + vis tSend,0 + vis tInstruction,0 + vis tId,0 + //ui e1 + vis btOnOff1,0 + vis bUp1,0 + vis bStop1,0 + vis bDown1,0 + vis tIcon1,0 + vis tEntity1,0 + vis bText1,0 + //ui e2 + vis btOnOff2,0 + vis bUp2,0 + vis bStop2,0 + vis bDown2,0 + vis tIcon2,0 + vis tEntity2,0 + vis bText2,0 + //ui e3 + vis btOnOff3,0 + vis bUp3,0 + vis bStop3,0 + vis bDown3,0 + vis tIcon3,0 + vis tEntity3,0 + vis bText3,0 + //ui e4 + vis btOnOff4,0 + vis bUp4,0 + vis bStop4,0 + vis bDown4,0 + vis tIcon4,0 + vis tEntity4,0 + vis bText4,0 + //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 + //display current page from global var + nPageDisp.val=nPage + +Variable (string) strCommand + Attributes + ID : 27 + Scope : local + Text : + Max. Text Size: 150 + +Variable (string) type1 + Attributes + ID : 47 + Scope : local + Text : + Max. Text Size: 10 + +Variable (string) type2 + Attributes + ID : 48 + Scope : local + Text : + Max. Text Size: 10 + +Variable (string) type3 + Attributes + ID : 49 + Scope : local + Text : + Max. Text Size: 10 + +Variable (string) type4 + Attributes + ID : 50 + Scope : local + Text : + Max. Text Size: 10 + +Variable (string) entn1 + Attributes + ID : 51 + Scope : local + Text : + Max. Text Size: 50 + +Variable (string) entn2 + Attributes + ID : 52 + Scope : local + Text : + Max. Text Size: 50 + +Variable (string) entn3 + Attributes + ID : 53 + Scope : local + Text : + Max. Text Size: 50 + +Variable (string) entn4 + Attributes + ID : 54 + Scope : local + Text : + Max. Text Size: 50 + +Number nPageDisp + Attributes + ID : 35 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + Associated Keyboard : none + Value : 0 + +Text tHeading + Attributes + ID : 2 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + Associated Keyboard : none + Text : + Max. Text Size : 40 + +Text tEntity1 + Attributes + ID : 3 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + Associated Keyboard : none + Text : tEntity1 + Max. Text Size : 30 + +Text tEntity2 + Attributes + ID : 4 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + Associated Keyboard : none + Text : tEntity2 + Max. Text Size : 30 + +Text tEntity3 + Attributes + ID : 5 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + Associated Keyboard : none + Text : tEntity3 + Max. Text Size : 30 + +Text tEntity4 + Attributes + ID : 6 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + Associated Keyboard : none + Text : tEntity4 + Max. Text Size : 30 + +Text tIcon1 + Attributes + ID : 7 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + Associated Keyboard : none + Text :  + Max. Text Size : 10 + +Text tIcon2 + Attributes + ID : 8 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + Associated Keyboard : none + Text :  + Max. Text Size : 10 + +Text tIcon3 + Attributes + ID : 9 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + Associated Keyboard : none + Text :  + Max. Text Size : 10 + +Text tIcon4 + Attributes + ID : 10 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + Associated Keyboard : none + Text :  + Max. Text Size : 30 + +Text tSend + Attributes + ID : 28 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + Associated Keyboard : none + Text : newtxt + Max. Text Size : 100 + +Text tTmp + Attributes + ID : 29 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + Associated Keyboard : none + Text : + Max. Text Size : 10 + +Text tInstruction + Attributes + ID : 31 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + Associated Keyboard : none + Text : + Max. Text Size : 20 + +Text tId + Attributes + ID : 32 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + Associated Keyboard : none + Text : + Max. Text Size : 50 + +Picture p0 + Attributes + ID : 1 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + +Button bDown1 + Attributes + ID : 11 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + State : unpressed + Text :  + Max. Text Size : 10 + + Events + Touch Press Event + // event,1,tHeading,tEntityName,1,up + //craft command + // convert pageNumber and write to tTmp + covx nPage,tTmp.txt,0,0 + tSend.txt="event,buttonPress,"+tTmp.txt+"," + tSend.txt+=tHeading.txt+"," + tSend.txt+=entn1.txt+"," + tSend.txt+="1,down" + //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 bUp1 + Attributes + ID : 12 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + State : unpressed + Text :  + Max. Text Size : 10 + + Events + Touch Press Event + // event,1,tHeading,tEntityName,1,up + //craft command + // convert pageNumber and write to tTmp + covx nPage,tTmp.txt,0,0 + tSend.txt="event,buttonPress,"+tTmp.txt+"," + tSend.txt+=tHeading.txt+"," + tSend.txt+=entn1.txt+"," + tSend.txt+="1,up" + //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 bStop1 + Attributes + ID : 13 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + State : unpressed + Text :  + Max. Text Size : 10 + + Events + Touch Press Event + // event,1,tHeading,tEntityName,1,up + //craft command + // convert pageNumber and write to tTmp + covx nPage,tTmp.txt,0,0 + tSend.txt="event,buttonPress,"+tTmp.txt+"," + tSend.txt+=tHeading.txt+"," + tSend.txt+=entn1.txt+"," + tSend.txt+="1,stop" + //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 bStop2 + Attributes + ID : 14 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + State : unpressed + Text :  + Max. Text Size : 10 + + Events + Touch Press Event + // event,1,tHeading,tEntityName,1,up + //craft command + // convert pageNumber and write to tTmp + covx nPage,tTmp.txt,0,0 + tSend.txt="event,buttonPress,"+tTmp.txt+"," + tSend.txt+=tHeading.txt+"," + tSend.txt+=entn2.txt+"," + tSend.txt+="2,stop" + //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 bDown2 + Attributes + ID : 15 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + State : unpressed + Text :  + Max. Text Size : 10 + + Events + Touch Press Event + // event,1,tHeading,tEntityName,1,up + //craft command + // convert pageNumber and write to tTmp + covx nPage,tTmp.txt,0,0 + tSend.txt="event,buttonPress,"+tTmp.txt+"," + tSend.txt+=tHeading.txt+"," + tSend.txt+=entn2.txt+"," + tSend.txt+="2,down" + //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 bUp2 + Attributes + ID : 16 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + State : unpressed + Text :  + Max. Text Size : 10 + + Events + Touch Press Event + // event,1,tHeading,tEntityName,1,up + //craft command + // convert pageNumber and write to tTmp + covx nPage,tTmp.txt,0,0 + tSend.txt="event,buttonPress,"+tTmp.txt+"," + tSend.txt+=tHeading.txt+"," + tSend.txt+=entn2.txt+"," + tSend.txt+="2,up" + //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 bStop3 + Attributes + ID : 17 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + State : unpressed + Text :  + Max. Text Size : 10 + + Events + Touch Press Event + // event,1,tHeading,tEntityName,1,up + //craft command + // convert pageNumber and write to tTmp + covx nPage,tTmp.txt,0,0 + tSend.txt="event,buttonPress,"+tTmp.txt+"," + tSend.txt+=tHeading.txt+"," + tSend.txt+=entn3.txt+"," + tSend.txt+="3,stop" + //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 bDown3 + Attributes + ID : 18 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + State : unpressed + Text :  + Max. Text Size : 10 + + Events + Touch Press Event + // event,1,tHeading,tEntityName,1,up + //craft command + // convert pageNumber and write to tTmp + covx nPage,tTmp.txt,0,0 + tSend.txt="event,buttonPress,"+tTmp.txt+"," + tSend.txt+=tHeading.txt+"," + tSend.txt+=entn3.txt+"," + tSend.txt+="3,down" + //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 bUp3 + Attributes + ID : 19 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + State : unpressed + Text :  + Max. Text Size : 10 + + Events + Touch Press Event + // event,1,tHeading,tEntityName,1,up + //craft command + // convert pageNumber and write to tTmp + covx nPage,tTmp.txt,0,0 + tSend.txt="event,buttonPress,"+tTmp.txt+"," + tSend.txt+=tHeading.txt+"," + tSend.txt+=entn3.txt+"," + tSend.txt+="3,up" + //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 bStop4 + Attributes + ID : 20 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + State : unpressed + Text :  + Max. Text Size : 10 + + Events + Touch Press Event + // event,1,tHeading,tEntityName,1,up + //craft command + // convert pageNumber and write to tTmp + covx nPage,tTmp.txt,0,0 + tSend.txt="event,buttonPress,"+tTmp.txt+"," + tSend.txt+=tHeading.txt+"," + tSend.txt+=entn4.txt+"," + tSend.txt+="4,stop" + //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 bDown4 + Attributes + ID : 21 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + State : unpressed + Text :  + Max. Text Size : 10 + + Events + Touch Press Event + // event,1,tHeading,tEntityName,1,up + //craft command + // convert pageNumber and write to tTmp + covx nPage,tTmp.txt,0,0 + tSend.txt="event,buttonPress,"+tTmp.txt+"," + tSend.txt+=tHeading.txt+"," + tSend.txt+=entn4.txt+"," + tSend.txt+="4,down" + //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 bUp4 + Attributes + ID : 22 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + State : unpressed + Text :  + Max. Text Size : 10 + + Events + Touch Press Event + // event,1,tHeading,tEntityName,1,up + //craft command + // convert pageNumber and write to tTmp + covx nPage,tTmp.txt,0,0 + tSend.txt="event,buttonPress,"+tTmp.txt+"," + tSend.txt+=tHeading.txt+"," + tSend.txt+=entn4.txt+"," + tSend.txt+="4,up" + //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 bPrev + Attributes + ID : 33 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + State : unpressed + Text :  + Max. Text Size : 10 + + Events + Touch Press Event + nPage=nPage-1 + nPageDisp.val=nPage + //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 bNext + Attributes + ID : 34 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + State : unpressed + Text :  + Max. Text Size : 10 + + Events + Touch Press Event + nPage=nPage+1 + nPageDisp.val=nPage + //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 bText1 + Attributes + ID : 39 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + State : unpressed + Text : newtxt + Max. Text Size : 10 + + Events + Touch Press Event + // event,1,tHeading,tEntityName,1,up + //craft command + // convert pageNumber and write to tTmp + covx nPage,tTmp.txt,0,0 + tSend.txt="event,buttonPress,"+tTmp.txt+"," + tSend.txt+=tHeading.txt+"," + tSend.txt+=entn1.txt+"," + tSend.txt+="1,button" + //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 bText2 + Attributes + ID : 40 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + State : unpressed + Text : newtxt + Max. Text Size : 10 + + Events + Touch Press Event + // event,1,tHeading,tEntityName,1,up + //craft command + // convert pageNumber and write to tTmp + covx nPage,tTmp.txt,0,0 + tSend.txt="event,buttonPress,"+tTmp.txt+"," + tSend.txt+=tHeading.txt+"," + tSend.txt+=entn2.txt+"," + tSend.txt+="1,button" + //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 bText3 + Attributes + ID : 41 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + State : unpressed + Text : newtxt + Max. Text Size : 10 + + Events + Touch Press Event + // event,1,tHeading,tEntityName,1,up + //craft command + // convert pageNumber and write to tTmp + covx nPage,tTmp.txt,0,0 + tSend.txt="event,buttonPress,"+tTmp.txt+"," + tSend.txt+=tHeading.txt+"," + tSend.txt+=entn3.txt+"," + tSend.txt+="1,button" + //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 bText4 + Attributes + ID : 42 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + State : unpressed + Text : newtxt + Max. Text Size : 10 + + Events + Touch Press Event + // event,1,tHeading,tEntityName,1,up + //craft command + // convert pageNumber and write to tTmp + covx nPage,tTmp.txt,0,0 + tSend.txt="event,buttonPress,"+tTmp.txt+"," + tSend.txt+=tHeading.txt+"," + tSend.txt+=entn4.txt+"," + tSend.txt+="1,button" + //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 + +Dual-state Button btOnOff1 + Attributes + ID : 23 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + State : unpressed + Text : + Max. Text Size : 10 + + Events + Touch Press Event + // event,1,tHeading,tEntityName,1,up + //craft command + // convert pageNumber and write to tTmp + covx nPage,tTmp.txt,0,0 + tSend.txt="event,buttonPress,"+tTmp.txt+"," + tSend.txt+=tHeading.txt+"," + tSend.txt+=entn1.txt+"," + tSend.txt+="1,OnOff," + covx btOnOff1.val,tTmp.txt,0,0 + tSend.txt+=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 + +Dual-state Button btOnOff2 + Attributes + ID : 24 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + State : unpressed + Text : + Max. Text Size : 10 + + Events + Touch Press Event + // event,1,tHeading,tEntityName,1,up + //craft command + // convert pageNumber and write to tTmp + covx nPage,tTmp.txt,0,0 + tSend.txt="event,buttonPress,"+tTmp.txt+"," + tSend.txt+=tHeading.txt+"," + tSend.txt+=entn2.txt+"," + tSend.txt+="2,OnOff," + covx btOnOff2.val,tTmp.txt,0,0 + tSend.txt+=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 + +Dual-state Button btOnOff3 + Attributes + ID : 25 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + State : unpressed + Text : + Max. Text Size : 10 + + Events + Touch Press Event + // event,1,tHeading,tEntityName,1,up + //craft command + // convert pageNumber and write to tTmp + covx nPage,tTmp.txt,0,0 + tSend.txt="event,buttonPress,"+tTmp.txt+"," + tSend.txt+=tHeading.txt+"," + tSend.txt+=entn3.txt+"," + tSend.txt+="3,OnOff," + covx btOnOff3.val,tTmp.txt,0,0 + tSend.txt+=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 + +Dual-state Button btOnOff4 + Attributes + ID : 26 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + State : unpressed + Text : + Max. Text Size : 10 + + Events + Touch Press Event + // event,1,tHeading,tEntityName,1,up + //craft command + // convert pageNumber and write to tTmp + covx nPage,tTmp.txt,0,0 + tSend.txt="event,buttonPress,"+tTmp.txt+"," + tSend.txt+=tHeading.txt+"," + tSend.txt+=entn4.txt+"," + tSend.txt+="4,OnOff," + covx btOnOff4.val,tTmp.txt,0,0 + tSend.txt+=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 + +Hotspot mSpecial + Attributes + ID : 36 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + + Events + Touch Press Event + sys2=sys2+1 + sys2%=10 + //n0.val=sys2 + if(sys2==9) + { + page pageTest + } + +Hotspot m2 + Attributes + ID : 43 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + + Events + Touch Release Event + pageIcons.tTmp1.txt=tEntity3.txt + pageIcons.tTmp2.txt=entn3.txt + if(type3.txt=="shutter") + { + //popupShutter.tHeading.txt=tEntity3.txt + page popupShutter + } + if(type3.txt=="light") + { + //popupLight.tEntity.txt=tEntity3.txt + page popupLight + } + +Hotspot m1 + Attributes + ID : 44 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + + Events + Touch Release Event + pageIcons.tTmp1.txt=tEntity2.txt + pageIcons.tTmp2.txt=entn2.txt + if(type2.txt=="shutter") + { + //popupShutter.tHeading.txt=tEntity2.txt + page popupShutter + } + if(type2.txt=="light") + { + //popupLight.tEntity.txt=tEntity2.txt + page popupLight + } + +Hotspot m0 + Attributes + ID : 45 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + + Events + Touch Release Event + pageIcons.tTmp1.txt=tEntity1.txt + pageIcons.tTmp2.txt=entn1.txt + if(type1.txt=="shutter") + { + //popupShutter.tHeading.txt=tEntity1.txt + page popupShutter + } + if(type1.txt=="light") + { + //popupLight.tEntity.txt=tEntity1.txt + page popupLight + } + +Hotspot m3 + Attributes + ID : 46 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + + Events + Touch Release Event + pageIcons.tTmp1.txt=tEntity4.txt + pageIcons.tTmp2.txt=entn4.txt + if(type4.txt=="shutter") + { + //popupShutter.tHeading.txt=tEntity4.txt + page popupShutter + } + if(type4.txt=="light") + { + //popupLight.tEntity.txt=tEntity4.txt + page popupLight + } + +Timer tmSerial + Attributes + ID : 30 + Scope : local + Period (ms): 50 + Enabled : yes + + Events + Timer Event + // data available + if(usize>1) + { + bufferPos=0 + while(bufferPos1) + { + bufferPos=0 + while(bufferPosxTempMin.val) + { + xTempDest.val=xTempDest.val-xTempStep.val + } + // temp chane event + // event,tempUpd,pageNumber,entityName,temperature + //craft command + // convert pageNumber and write to tTmp + covx nPage,tTmp.txt,0,0 + tSend.txt="event,tempUpd,"+tTmp.txt+"," + tSend.txt+=entn.txt+"," + //convert temperature + covx xTempDest.val,tTmp.txt,0,0 + tSend.txt+=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 bUp + Attributes + ID : 17 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + State : unpressed + Text : + Max. Text Size : 10 + + Events + Touch Press Event + if(xTempDest.val1) + { + bufferPos=0 + while(bufferPos1) + { + bufferPos=0 + while(bufferPos1) + { + bufferPos=0 + while(bufferPos125) + // { + // tDirection.txt="left" + // }else if(xcR<-125) + // { + // tDirection.txt="right" + // }else if(ycR>125) + // { + // tDirection.txt="up" + // }else if(ycR<-125) + // { + // tDirection.txt="down" + // }else + // { + // tDirection.txt="invalid" + // } + // new method + // one of the difference values should be low to be a valid direction, in case it has a high value it's not a valid swipe, because it's diagonal + // x difference between -125 and 125 (swipe on y-axis) + if(xcR>ixLimit&&xcRyLimitMin) + { + tDirNew.txt="up" + }else + { + tDirNew.txt="invalid" + } + // y difference between -125 and 125 (swipe on x-axis) + }else if(ycR>iyLimit&&ycRxLimitMin) + { + tDirNew.txt="left" + }else + { + tDirNew.txt="invalid" + } + //diagonal swipe invalid + }else + { + tStatusNew.txt="invalid" + tDirNew.txt="diagonal" + } + } + } + diff --git a/HMI/n2t-out/pageTest.txt b/HMI/n2t-out/pageTest.txt new file mode 100644 index 00000000..750c8a15 --- /dev/null +++ b/HMI/n2t-out/pageTest.txt @@ -0,0 +1,176 @@ +Page pageTest + Attributes + ID : 0 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + Locked : no + Swide up page ID : disabled + Swide down page ID : disabled + Swide left page ID : disabled + Swide right page ID : disabled + + Events + Preinitialize Event + vis p0,0 + +Picture p0 + Attributes + ID : 1 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + +Button b0 + Attributes + ID : 2 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + State : unpressed + Text : entities + Max. Text Size : 10 + + Events + Touch Press Event + page cardEntities + +Button b1 + Attributes + ID : 3 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + State : unpressed + Text : serial + Max. Text Size : 10 + + Events + Touch Press Event + page pageSerialTest + +Button b2 + Attributes + ID : 4 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + State : unpressed + Text : swipe + Max. Text Size : 10 + + Events + Touch Press Event + page pageSwipeTest + +Button b3 + Attributes + ID : 5 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + State : unpressed + Text : disable recmod + Max. Text Size : 20 + + Events + Touch Press Event + recmod=0 + +Button b6 + Attributes + ID : 6 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + State : unpressed + Text : shutter + Max. Text Size : 10 + + Events + Touch Press Event + page popupShutter + +Button b4 + Attributes + ID : 7 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + State : unpressed + Text : light + Max. Text Size : 10 + + Events + Touch Press Event + page popupLight + +Button b5 + Attributes + ID : 8 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + State : unpressed + Text : thermo + Max. Text Size : 10 + + Events + Touch Press Event + page cardThermo + +Button b7 + Attributes + ID : 9 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + State : unpressed + Text : media + Max. Text Size : 10 + + Events + Touch Press Event + page cardMedia + +Button b8 + Attributes + ID : 10 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + State : unpressed + Text : screens + Max. Text Size : 10 + + Events + Touch Press Event + dimValue=50 + page screensaver + +Button b9 + Attributes + ID : 11 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + State : unpressed + Text : notify + Max. Text Size : 10 + + Events + Touch Press Event + page popupNotify + diff --git a/HMI/n2t-out/popupLight.txt b/HMI/n2t-out/popupLight.txt new file mode 100644 index 00000000..3fdca56f --- /dev/null +++ b/HMI/n2t-out/popupLight.txt @@ -0,0 +1,625 @@ +Page popupLight + Attributes + ID : 0 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + Locked : no + Swide up page ID : disabled + Swide down page ID : disabled + Swide left page ID : disabled + Swide right page ID : disabled + + Events + Preinitialize Event + //get entitiy name + tEntity.txt=pageIcons.tTmp1.txt + //get entity id + entn.txt=pageIcons.tTmp2.txt + vis p0,0 + vis tSend,0 + vis tTmp,0 + vis tInstruction,0 + vis tItem,0 + //page open event + // event,pageOpenDetail,typeOfPage,tEntityName + // craft command + tSend.txt="event,pageOpenDetail,popupLight,"+entn.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 + //disable brightness by default + vis t1,0 + vis t2,0 + vis hBrightness,0 + //disable color temp by default + vis t4,0 + vis t3,0 + vis hTempSlider,0 + //disable color wheel components by default + vis bColor,0 + vis pColorWheel,0 + vis t0,0 + +Variable (string) strCommand + Attributes + ID : 17 + Scope : local + Text : + Max. Text Size: 50 + +Variable (string) entn + Attributes + ID : 21 + Scope : local + Text : newtxt + Max. Text Size: 50 + +Variable (int32) mode + Attributes + ID : 23 + Scope: local + Value: 0 + +Variable (int32) mode_bright + Attributes + ID : 24 + Scope: local + Value: 0 + +Variable (int32) mode_temp + Attributes + ID : 25 + Scope: local + Value: 0 + +Text tEntity + Attributes + ID : 3 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + Associated Keyboard : none + Text : tEntity1 + Max. Text Size : 25 + +Text tIcon1 + Attributes + ID : 4 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + Associated Keyboard : none + Text :  + Max. Text Size : 10 + +Text t1 + Attributes + ID : 6 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + Associated Keyboard : none + Text : Brightness + Max. Text Size : 15 + +Text t2 + Attributes + ID : 9 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + Associated Keyboard : none + Text :  + Max. Text Size : 10 + +Text t3 + Attributes + ID : 10 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + Associated Keyboard : none + Text :  + Max. Text Size : 10 + +Text t4 + Attributes + ID : 11 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + Associated Keyboard : none + Text : Temperature + Max. Text Size : 15 + +Text tSend + Attributes + ID : 12 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + Associated Keyboard : none + Text : newtxt + Max. Text Size : 100 + +Text tTmp + Attributes + ID : 13 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + Associated Keyboard : none + Text : + Max. Text Size : 10 + +Text tInstruction + Attributes + ID : 18 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + Associated Keyboard : none + Text : + Max. Text Size : 20 + +Text tItem + Attributes + ID : 19 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + Associated Keyboard : none + Text : + Max. Text Size : 20 + +Text t0 + Attributes + ID : 26 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + Associated Keyboard : none + Text : Color + Max. Text Size : 15 + +Picture p0 + Attributes + ID : 1 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + +Picture pColorWheel + Attributes + ID : 2 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + + Events + Touch Press Event + // event,buttonPress,D,nameEntity,internalNameEntity,1,brightnessSlider,50 + //craft command + tSend.txt="event,buttonPress,D," + tSend.txt+=tEntity.txt+"," + tSend.txt+=entn.txt+"," + tSend.txt+="1,colorWheel," + sys0=tch0 + sys0=sys0-pColorWheel.x + covx sys0,tTmp.txt,0,0 + tSend.txt+=tTmp.txt + tSend.txt+="|" + sys0=tch1 + sys0=sys0-pColorWheel.y + covx sys0,tTmp.txt,0,0 + tSend.txt+=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 + +Slider hBrightness + Attributes + ID : 7 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + Position : 50 + Upper range limit : 100 + Lower range limit : 0 + + Events + Touch Press Event + // event,buttonPress,D,nameEntity,internalNameEntity,1,brightnessSlider,50 + //craft command + tSend.txt="event,buttonPress,D," + tSend.txt+=tEntity.txt+"," + tSend.txt+=entn.txt+"," + tSend.txt+="1,brightnessSlider," + covx hBrightness.val,tTmp.txt,0,0 + tSend.txt+=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 + + Touch Release Event + // event,buttonPress,D,nameEntity,internalNameEntity,1,brightnessSlider,50 + //craft command + tSend.txt="event,buttonPress,D," + tSend.txt+=tEntity.txt+"," + tSend.txt+=entn.txt+"," + tSend.txt+="1,brightnessSlider," + covx hBrightness.val,tTmp.txt,0,0 + tSend.txt+=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 + +Slider hTempSlider + Attributes + ID : 20 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + Position : 50 + Upper range limit : 100 + Lower range limit : 0 + + Events + Touch Press Event + // event,buttonPress,D,nameEntity,internalNameEntity,1,colorTempSlider,50 + //craft command + tSend.txt="event,buttonPress,D," + tSend.txt+=tEntity.txt+"," + tSend.txt+=entn.txt+"," + tSend.txt+="1,colorTempSlider," + covx hTempSlider.val,tTmp.txt,0,0 + tSend.txt+=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 + + Touch Release Event + // event,buttonPress,D,nameEntity,internalNameEntity,1,colorTempSlider,50 + //craft command + tSend.txt="event,buttonPress,D," + tSend.txt+=tEntity.txt+"," + tSend.txt+=entn.txt+"," + tSend.txt+="1,colorTempSlider," + covx hTempSlider.val,tTmp.txt,0,0 + tSend.txt+=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 b0 + Attributes + ID : 5 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + State : unpressed + Text :  + Max. Text Size : 10 + + Events + Touch Press Event + page cardEntities + +Button bColor + Attributes + ID : 22 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + State : unpressed + Text :  + Max. Text Size : 10 + + Events + Touch Press Event + if(mode.val==0) + { + mode.val=1 + vis pColorWheel,1 + vis t0,1 + //disable brightness + vis t1,0 + vis t2,0 + vis hBrightness,0 + //disable color temp + vis t4,0 + vis t3,0 + vis hTempSlider,0 + }else + { + mode.val=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) + { + //enable color temp + vis t4,1 + vis t3,1 + vis hTempSlider,1 + } + } + +Dual-state Button btOnOff1 + Attributes + ID : 8 + Scope : local + Dragging : 0 + Disable release event after dragging: 0 + Send Component ID : disabled + State : unpressed + Text : + Max. Text Size : 10 + + Events + Touch Press Event + // event,buttonPress,D,nameEntity,internalNameEntity,1,OnOff,1 + //craft command + tSend.txt="event,buttonPress,D," + tSend.txt+=tEntity.txt+"," + tSend.txt+=entn.txt+"," + tSend.txt+="1,OnOff," + covx btOnOff1.val,tTmp.txt,0,0 + tSend.txt+=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 + +Timer tmSleep + Attributes + ID : 15 + Scope : local + Period (ms): 1000 + Enabled : yes + + Events + Timer Event + if(sleepTimeout!=0) + { + sleepValue+=1 + if(sleepTimeout<=sleepValue) + { + screensaver.originPage.val=dp + sleepValue=0 + page cardEntities + } + } + +Timer tmSerial + Attributes + ID : 16 + Scope : local + Period (ms): 50 + Enabled : yes + + Events + Timer Event + // data available + if(usize>1) + { + bufferPos=0 + while(bufferPos1) + { + bufferPos=0 + while(bufferPos1) + { + bufferPos=0 + while(bufferPos1) + { + bufferPos=0 + while(bufferPos