Page cardAlarm
    Attributes
        ID                                  : 0
        Scope                               : local
        Dragging                            : 0
        Disable release event after dragging: 0
        Send Component ID                   : disabled
        Opacity                             : 127
        Width                               : 480
        Effect                              : load
        Effect Priority                     : 0
        Effect Time                         : 300
        Locked                              : no
        Swide up page ID                    : disabled
        Swide down page ID                  : disabled
        Swide left page ID                  : disabled
        Swide right page ID                 : disabled
        Fill                                : solid color
        Back. Color                         : 6371
    
    Events
        Preinitialize Event
            dim=dimValueNormal
            vis p0,0
            vis tSend,0
            vis tInstruction,0
            vis tTmp,0
            vis tId,0
            vis arm1,0
            vis arm2,0
            vis arm3,0
            vis arm4,0
            vis b0,0
            vis b1,0
            vis b2,0
            vis b3,0
            vis b4,0
            vis b5,0
            vis b6,0
            vis b7,0
            vis b8,0
            vis b9,0
            vis b10,0
            vis b11,0
            vis tCode,0
            vis bPrev,0
            vis bNext,0
            cardAlarm.bco=defaultBcoColor
            for(sys0=0;sys0<40;sys0++)
            {
                if(b[sys0].type==98||b[sys0].type==116)
                {
                    b[sys0].bco=defaultBcoColor
                    b[sys0].pco=defaultFontColor
                }
            }
            if(defaultBcoColor==0)
            {
                tCode.bco=6371
                tCode.pco=40179
            }
            if(defaultBcoColor==6371)
            {
                tCode.bco=10565
                tCode.pco=40179
            }
        
Variable (string) strCommand
    Attributes
        ID            : 6
        Scope         : local
        Text          : 
        Max. Text Size: 200
    
Variable (string) entn
    Attributes
        ID            : 9
        Scope         : local
        Text          : 
        Max. Text Size: 80
    
Variable (string) tSend
    Attributes
        ID            : 25
        Scope         : local
        Text          : 
        Max. Text Size: 100
    
Variable (string) va1
    Attributes
        ID            : 30
        Scope         : local
        Text          : 
        Max. Text Size: 20
    
Variable (string) va2
    Attributes
        ID            : 31
        Scope         : local
        Text          : 
        Max. Text Size: 20
    
Variable (string) va3
    Attributes
        ID            : 32
        Scope         : local
        Text          : 
        Max. Text Size: 20
    
Variable (string) va4
    Attributes
        ID            : 33
        Scope         : local
        Text          : 
        Max. Text Size: 20
    
Variable (string) vaAddBtn
    Attributes
        ID            : 39
        Scope         : local
        Text          : 
        Max. Text Size: 80
    
Text tTmp
    Attributes
        ID                                  : 2
        Scope                               : local
        Dragging                            : 0
        Disable release event after dragging: 0
        Send Component ID                   : disabled
        Opacity                             : 127
        x coordinate                        : 421
        y coordinate                        : 277
        Width                               : 34
        Height                              : 30
        Effect                              : load
        Effect Priority                     : 0
        Effect Time                         : 300
        Fill                                : solid color
        Style                               : flat
        Associated Keyboard                 : none
        Font ID                             : 0
        Back. Color                         : 65535
        Font Color                          : 0
        Horizontal Alignment                : center
        Vertical Alignment                  : center
        Input Type                          : character
        Text                                : 
        Max. Text Size                      : 10
        Word wrap                           : disabled
        Horizontal Spacing                  : 0
        Vertical Spacing                    : 0
    
Text tInstruction
    Attributes
        ID                                  : 7
        Scope                               : local
        Dragging                            : 0
        Disable release event after dragging: 0
        Send Component ID                   : disabled
        Opacity                             : 127
        x coordinate                        : 15
        y coordinate                        : 290
        Width                               : 100
        Height                              : 30
        Effect                              : load
        Effect Priority                     : 0
        Effect Time                         : 300
        Fill                                : solid color
        Style                               : flat
        Associated Keyboard                 : none
        Font ID                             : 0
        Back. Color                         : 65535
        Font Color                          : 0
        Horizontal Alignment                : center
        Vertical Alignment                  : center
        Input Type                          : character
        Text                                : 
        Max. Text Size                      : 20
        Word wrap                           : disabled
        Horizontal Spacing                  : 0
        Vertical Spacing                    : 0
    
Text tId
    Attributes
        ID                                  : 8
        Scope                               : local
        Dragging                            : 0
        Disable release event after dragging: 0
        Send Component ID                   : disabled
        Opacity                             : 127
        x coordinate                        : 114
        y coordinate                        : 290
        Width                               : 39
        Height                              : 30
        Effect                              : load
        Effect Priority                     : 0
        Effect Time                         : 300
        Fill                                : solid color
        Style                               : flat
        Associated Keyboard                 : none
        Font ID                             : 0
        Back. Color                         : 65535
        Font Color                          : 0
        Horizontal Alignment                : center
        Vertical Alignment                  : center
        Input Type                          : character
        Text                                : 
        Max. Text Size                      : 20
        Word wrap                           : disabled
        Horizontal Spacing                  : 0
        Vertical Spacing                    : 0
    
Text tCode
    Attributes
        ID                                  : 23
        Scope                               : local
        Dragging                            : 0
        Disable release event after dragging: 0
        Send Component ID                   : disabled
        Opacity                             : 127
        x coordinate                        : 107
        y coordinate                        : 16
        Width                               : 192
        Height                              : 49
        Effect                              : load
        Effect Priority                     : 0
        Effect Time                         : 300
        Fill                                : solid color
        Style                               : flat
        Associated Keyboard                 : none
        Font ID                             : 2
        Back. Color                         : 10565
        Font Color                          : 40179
        Horizontal Alignment                : center
        Vertical Alignment                  : center
        Input Type                          : password
        Text                                : 
        Max. Text Size                      : 10
        Word wrap                           : disabled
        Horizontal Spacing                  : 0
        Vertical Spacing                    : 0
    
Text tIcon
    Attributes
        ID                                  : 26
        Scope                               : local
        Dragging                            : 0
        Disable release event after dragging: 0
        Send Component ID                   : disabled
        Opacity                             : 127
        x coordinate                        : 315
        y coordinate                        : 16
        Width                               : 64
        Height                              : 49
        Effect                              : load
        Effect Priority                     : 0
        Effect Time                         : 300
        Fill                                : solid color
        Style                               : flat
        Associated Keyboard                 : none
        Font ID                             : 3
        Back. Color                         : 6371
        Font Color                          : 65535
        Horizontal Alignment                : center
        Vertical Alignment                  : center
        Input Type                          : character
        Text                                : 
        Max. Text Size                      : 10
        Word wrap                           : disabled
        Horizontal Spacing                  : 0
        Vertical Spacing                    : 0
    
Picture p0
    Attributes
        ID                                  : 1
        Scope                               : local
        Dragging                            : 0
        Disable release event after dragging: 0
        Send Component ID                   : disabled
        Opacity                             : 127
        x coordinate                        : 0
        y coordinate                        : 0
        Width                               : 480
        Height                              : 320
        Effect                              : load
        Effect Priority                     : 0
        Effect Time                         : 300
        Picture ID                          : 0
    
Button bNext
    Attributes
        ID                                  : 3
        Scope                               : local
        Dragging                            : 0
        Disable release event after dragging: 0
        Send Component ID                   : disabled
        Opacity                             : 127
        x coordinate                        : 406
        y coordinate                        : 16
        Width                               : 50
        Height                              : 50
        Effect                              : load
        Effect Priority                     : 0
        Effect Time                         : 300
        Fill                                : solid color
        Style                               : flat
        Font ID                             : 3
        Back. Color                         : 6371
        Back. Picture ID (Pressed)          : 65535
        Back. Color (Pressed)               : 14823
        Font Color (Unpressed)              : 65535
        Font Color (Pressed)                : 65535
        Horizontal Alignment                : center
        Vertical Alignment                  : center
        State                               : unpressed
        Text                                : î³
        Max. Text Size                      : 10
        Word wrap                           : disabled
        Horizontal Spacing                  : 0
        Vertical Spacing                    : 0
    
    Events
        Touch Press Event
            tSend.txt="event,buttonPress2,cardAlarm,bNext"
            //send calc crc
            btlen tSend.txt,sys0
            crcrest 1,0xffff // reset CRC
            crcputh 55 bb
            crcputs sys0,2
            crcputs tSend.txt,0
            //send cmd
            printh 55 bb
            prints sys0,2
            prints tSend.txt,0
            prints crcval,2
        
Button bPrev
    Attributes
        ID                                  : 4
        Scope                               : local
        Dragging                            : 0
        Disable release event after dragging: 0
        Send Component ID                   : disabled
        Opacity                             : 127
        x coordinate                        : 24
        y coordinate                        : 16
        Width                               : 50
        Height                              : 50
        Effect                              : load
        Effect Priority                     : 0
        Effect Time                         : 300
        Fill                                : solid color
        Style                               : flat
        Font ID                             : 3
        Back. Color                         : 6371
        Back. Picture ID (Pressed)          : 65535
        Back. Color (Pressed)               : 14823
        Font Color (Unpressed)              : 65535
        Font Color (Pressed)                : 65535
        Horizontal Alignment                : center
        Vertical Alignment                  : center
        State                               : unpressed
        Text                                : î°
        Max. Text Size                      : 10
        Word wrap                           : disabled
        Horizontal Spacing                  : 0
        Vertical Spacing                    : 0
    
    Events
        Touch Press Event
            tSend.txt="event,buttonPress2,cardAlarm,"
            if(bPrev.txt=="î¶")
            {
                tSend.txt+="bUp"
            }else
            {
                tSend.txt+="bPrev"
            }
            //send calc crc
            btlen tSend.txt,sys0
            crcrest 1,0xffff // reset CRC
            crcputh 55 bb
            crcputs sys0,2
            crcputs tSend.txt,0
            //send cmd
            printh 55 bb
            prints sys0,2
            prints tSend.txt,0
            prints crcval,2
        
Button b0
    Attributes
        ID                                  : 12
        Scope                               : local
        Dragging                            : 0
        Disable release event after dragging: 0
        Send Component ID                   : disabled
        Opacity                             : 127
        x coordinate                        : 40
        y coordinate                        : 94
        Width                               : 75
        Height                              : 50
        Effect                              : load
        Effect Priority                     : 0
        Effect Time                         : 300
        Fill                                : solid color
        Style                               : border
        Border Color                        : 6371
        Border Width                        : 0
        Font ID                             : 2
        Back. Color                         : 6371
        Back. Picture ID (Pressed)          : 65535
        Back. Color (Pressed)               : 14823
        Font Color (Unpressed)              : 1374
        Font Color (Pressed)                : 65535
        Horizontal Alignment                : center
        Vertical Alignment                  : center
        State                               : unpressed
        Text                                : 1
        Max. Text Size                      : 10
        Word wrap                           : disabled
        Horizontal Spacing                  : 0
        Vertical Spacing                    : 0
    
    Events
        Touch Press Event
            tCode.txt=tCode.txt+"1"
        
Button b1
    Attributes
        ID                                  : 13
        Scope                               : local
        Dragging                            : 0
        Disable release event after dragging: 0
        Send Component ID                   : disabled
        Opacity                             : 127
        x coordinate                        : 132
        y coordinate                        : 94
        Width                               : 75
        Height                              : 50
        Effect                              : load
        Effect Priority                     : 0
        Effect Time                         : 300
        Fill                                : solid color
        Style                               : border
        Border Color                        : 6371
        Border Width                        : 0
        Font ID                             : 2
        Back. Color                         : 6371
        Back. Picture ID (Pressed)          : 65535
        Back. Color (Pressed)               : 14823
        Font Color (Unpressed)              : 1374
        Font Color (Pressed)                : 65535
        Horizontal Alignment                : center
        Vertical Alignment                  : center
        State                               : unpressed
        Text                                : 2
        Max. Text Size                      : 10
        Word wrap                           : disabled
        Horizontal Spacing                  : 0
        Vertical Spacing                    : 0
    
    Events
        Touch Press Event
            tCode.txt=tCode.txt+"2"
        
Button b2
    Attributes
        ID                                  : 14
        Scope                               : local
        Dragging                            : 0
        Disable release event after dragging: 0
        Send Component ID                   : disabled
        Opacity                             : 127
        x coordinate                        : 224
        y coordinate                        : 93
        Width                               : 75
        Height                              : 50
        Effect                              : load
        Effect Priority                     : 0
        Effect Time                         : 300
        Fill                                : solid color
        Style                               : border
        Border Color                        : 6371
        Border Width                        : 0
        Font ID                             : 2
        Back. Color                         : 6371
        Back. Picture ID (Pressed)          : 65535
        Back. Color (Pressed)               : 14823
        Font Color (Unpressed)              : 1374
        Font Color (Pressed)                : 65535
        Horizontal Alignment                : center
        Vertical Alignment                  : center
        State                               : unpressed
        Text                                : 3
        Max. Text Size                      : 10
        Word wrap                           : disabled
        Horizontal Spacing                  : 0
        Vertical Spacing                    : 0
    
    Events
        Touch Press Event
            tCode.txt=tCode.txt+"3"
        
Button b3
    Attributes
        ID                                  : 15
        Scope                               : local
        Dragging                            : 0
        Disable release event after dragging: 0
        Send Component ID                   : disabled
        Opacity                             : 127
        x coordinate                        : 40
        y coordinate                        : 152
        Width                               : 75
        Height                              : 50
        Effect                              : load
        Effect Priority                     : 0
        Effect Time                         : 300
        Fill                                : solid color
        Style                               : border
        Border Color                        : 6371
        Border Width                        : 0
        Font ID                             : 2
        Back. Color                         : 6371
        Back. Picture ID (Pressed)          : 65535
        Back. Color (Pressed)               : 14823
        Font Color (Unpressed)              : 1374
        Font Color (Pressed)                : 65535
        Horizontal Alignment                : center
        Vertical Alignment                  : center
        State                               : unpressed
        Text                                : 4
        Max. Text Size                      : 10
        Word wrap                           : disabled
        Horizontal Spacing                  : 0
        Vertical Spacing                    : 0
    
    Events
        Touch Press Event
            tCode.txt=tCode.txt+"4"
        
Button b4
    Attributes
        ID                                  : 16
        Scope                               : local
        Dragging                            : 0
        Disable release event after dragging: 0
        Send Component ID                   : disabled
        Opacity                             : 127
        x coordinate                        : 132
        y coordinate                        : 152
        Width                               : 75
        Height                              : 50
        Effect                              : load
        Effect Priority                     : 0
        Effect Time                         : 300
        Fill                                : solid color
        Style                               : border
        Border Color                        : 6371
        Border Width                        : 0
        Font ID                             : 2
        Back. Color                         : 6371
        Back. Picture ID (Pressed)          : 65535
        Back. Color (Pressed)               : 14823
        Font Color (Unpressed)              : 1374
        Font Color (Pressed)                : 65535
        Horizontal Alignment                : center
        Vertical Alignment                  : center
        State                               : unpressed
        Text                                : 5
        Max. Text Size                      : 10
        Word wrap                           : disabled
        Horizontal Spacing                  : 0
        Vertical Spacing                    : 0
    
    Events
        Touch Press Event
            tCode.txt=tCode.txt+"5"
        
Button b5
    Attributes
        ID                                  : 17
        Scope                               : local
        Dragging                            : 0
        Disable release event after dragging: 0
        Send Component ID                   : disabled
        Opacity                             : 127
        x coordinate                        : 224
        y coordinate                        : 152
        Width                               : 75
        Height                              : 50
        Effect                              : load
        Effect Priority                     : 0
        Effect Time                         : 300
        Fill                                : solid color
        Style                               : border
        Border Color                        : 6371
        Border Width                        : 0
        Font ID                             : 2
        Back. Color                         : 6371
        Back. Picture ID (Pressed)          : 65535
        Back. Color (Pressed)               : 14823
        Font Color (Unpressed)              : 1374
        Font Color (Pressed)                : 65535
        Horizontal Alignment                : center
        Vertical Alignment                  : center
        State                               : unpressed
        Text                                : 6
        Max. Text Size                      : 10
        Word wrap                           : disabled
        Horizontal Spacing                  : 0
        Vertical Spacing                    : 0
    
    Events
        Touch Press Event
            tCode.txt=tCode.txt+"6"
        
Button b6
    Attributes
        ID                                  : 18
        Scope                               : local
        Dragging                            : 0
        Disable release event after dragging: 0
        Send Component ID                   : disabled
        Opacity                             : 127
        x coordinate                        : 40
        y coordinate                        : 210
        Width                               : 75
        Height                              : 50
        Effect                              : load
        Effect Priority                     : 0
        Effect Time                         : 300
        Fill                                : solid color
        Style                               : border
        Border Color                        : 6371
        Border Width                        : 0
        Font ID                             : 2
        Back. Color                         : 6371
        Back. Picture ID (Pressed)          : 65535
        Back. Color (Pressed)               : 14823
        Font Color (Unpressed)              : 1374
        Font Color (Pressed)                : 65535
        Horizontal Alignment                : center
        Vertical Alignment                  : center
        State                               : unpressed
        Text                                : 7
        Max. Text Size                      : 10
        Word wrap                           : disabled
        Horizontal Spacing                  : 0
        Vertical Spacing                    : 0
    
    Events
        Touch Press Event
            tCode.txt=tCode.txt+"7"
        
Button b7
    Attributes
        ID                                  : 19
        Scope                               : local
        Dragging                            : 0
        Disable release event after dragging: 0
        Send Component ID                   : disabled
        Opacity                             : 127
        x coordinate                        : 132
        y coordinate                        : 210
        Width                               : 75
        Height                              : 50
        Effect                              : load
        Effect Priority                     : 0
        Effect Time                         : 300
        Fill                                : solid color
        Style                               : border
        Border Color                        : 6371
        Border Width                        : 0
        Font ID                             : 2
        Back. Color                         : 6371
        Back. Picture ID (Pressed)          : 65535
        Back. Color (Pressed)               : 14823
        Font Color (Unpressed)              : 1374
        Font Color (Pressed)                : 65535
        Horizontal Alignment                : center
        Vertical Alignment                  : center
        State                               : unpressed
        Text                                : 8
        Max. Text Size                      : 10
        Word wrap                           : disabled
        Horizontal Spacing                  : 0
        Vertical Spacing                    : 0
    
    Events
        Touch Press Event
            tCode.txt=tCode.txt+"8"
        
Button b8
    Attributes
        ID                                  : 20
        Scope                               : local
        Dragging                            : 0
        Disable release event after dragging: 0
        Send Component ID                   : disabled
        Opacity                             : 127
        x coordinate                        : 224
        y coordinate                        : 210
        Width                               : 75
        Height                              : 50
        Effect                              : load
        Effect Priority                     : 0
        Effect Time                         : 300
        Fill                                : solid color
        Style                               : border
        Border Color                        : 6371
        Border Width                        : 0
        Font ID                             : 2
        Back. Color                         : 6371
        Back. Picture ID (Pressed)          : 65535
        Back. Color (Pressed)               : 14823
        Font Color (Unpressed)              : 1374
        Font Color (Pressed)                : 65535
        Horizontal Alignment                : center
        Vertical Alignment                  : center
        State                               : unpressed
        Text                                : 9
        Max. Text Size                      : 10
        Word wrap                           : disabled
        Horizontal Spacing                  : 0
        Vertical Spacing                    : 0
    
    Events
        Touch Press Event
            tCode.txt=tCode.txt+"9"
        
Button b9
    Attributes
        ID                                  : 21
        Scope                               : local
        Dragging                            : 0
        Disable release event after dragging: 0
        Send Component ID                   : disabled
        Opacity                             : 127
        x coordinate                        : 40
        y coordinate                        : 266
        Width                               : 75
        Height                              : 50
        Effect                              : load
        Effect Priority                     : 0
        Effect Time                         : 300
        Fill                                : solid color
        Style                               : border
        Border Color                        : 6371
        Border Width                        : 0
        Font ID                             : 1
        Back. Color                         : 6371
        Back. Picture ID (Pressed)          : 65535
        Back. Color (Pressed)               : 14823
        Font Color (Unpressed)              : 1374
        Font Color (Pressed)                : 65535
        Horizontal Alignment                : center
        Vertical Alignment                  : center
        State                               : unpressed
        Text                                : 
        Max. Text Size                      : 10
        Word wrap                           : disabled
        Horizontal Spacing                  : 0
        Vertical Spacing                    : 0
    
    Events
        Touch Press Event
            // event,buttonPress2,entn,arm1,tCode
            tSend.txt="event,buttonPress2,"
            if(vaAddBtn.txt!="")
            {
                tSend.txt+=vaAddBtn.txt+",button"
            }else
            {
                tSend.txt+=entn.txt+",opnSensorNotify"
            }
            //send calc crc
            btlen tSend.txt,sys0
            crcrest 1,0xffff // reset CRC
            crcputh 55 bb
            crcputs sys0,2
            crcputs tSend.txt,0
            //send cmd
            printh 55 bb
            prints sys0,2
            prints tSend.txt,0
            prints crcval,2
            tCode.txt=""
        
Button b10
    Attributes
        ID                                  : 22
        Scope                               : local
        Dragging                            : 0
        Disable release event after dragging: 0
        Send Component ID                   : disabled
        Opacity                             : 127
        x coordinate                        : 133
        y coordinate                        : 266
        Width                               : 75
        Height                              : 50
        Effect                              : load
        Effect Priority                     : 0
        Effect Time                         : 300
        Fill                                : solid color
        Style                               : border
        Border Color                        : 6371
        Border Width                        : 0
        Font ID                             : 2
        Back. Color                         : 6371
        Back. Picture ID (Pressed)          : 65535
        Back. Color (Pressed)               : 14823
        Font Color (Unpressed)              : 1374
        Font Color (Pressed)                : 65535
        Horizontal Alignment                : center
        Vertical Alignment                  : center
        State                               : unpressed
        Text                                : 0
        Max. Text Size                      : 10
        Word wrap                           : disabled
        Horizontal Spacing                  : 0
        Vertical Spacing                    : 0
    
    Events
        Touch Press Event
            tCode.txt=tCode.txt+"0"
        
Button arm1
    Attributes
        ID                                  : 24
        Scope                               : local
        Dragging                            : 0
        Disable release event after dragging: 0
        Send Component ID                   : disabled
        Opacity                             : 127
        x coordinate                        : 315
        y coordinate                        : 91
        Width                               : 141
        Height                              : 50
        Effect                              : load
        Effect Priority                     : 0
        Effect Time                         : 300
        Fill                                : solid color
        Style                               : border
        Border Color                        : 6371
        Border Width                        : 0
        Font ID                             : 0
        Back. Color                         : 6371
        Back. Picture ID (Pressed)          : 65535
        Back. Color (Pressed)               : 14823
        Font Color (Unpressed)              : 1374
        Font Color (Pressed)                : 65535
        Horizontal Alignment                : center
        Vertical Alignment                  : center
        State                               : unpressed
        Text                                : 
        Max. Text Size                      : 40
        Word wrap                           : enabled
        Horizontal Spacing                  : 0
        Vertical Spacing                    : 0
    
    Events
        Touch Press Event
            // event,buttonPress2,entn,arm1,tCode
            tSend.txt="event,buttonPress2,"
            tSend.txt+=entn.txt+","
            tSend.txt+=va1.txt+","
            tSend.txt+=tCode.txt
            //send calc crc
            btlen tSend.txt,sys0
            crcrest 1,0xffff // reset CRC
            crcputh 55 bb
            crcputs sys0,2
            crcputs tSend.txt,0
            //send cmd
            printh 55 bb
            prints sys0,2
            prints tSend.txt,0
            prints crcval,2
            tCode.txt=""
        
Button arm3
    Attributes
        ID                                  : 27
        Scope                               : local
        Dragging                            : 0
        Disable release event after dragging: 0
        Send Component ID                   : disabled
        Opacity                             : 127
        x coordinate                        : 315
        y coordinate                        : 210
        Width                               : 140
        Height                              : 50
        Effect                              : load
        Effect Priority                     : 0
        Effect Time                         : 300
        Fill                                : solid color
        Style                               : border
        Border Color                        : 6371
        Border Width                        : 0
        Font ID                             : 0
        Back. Color                         : 6371
        Back. Picture ID (Pressed)          : 65535
        Back. Color (Pressed)               : 14823
        Font Color (Unpressed)              : 1374
        Font Color (Pressed)                : 65535
        Horizontal Alignment                : center
        Vertical Alignment                  : center
        State                               : unpressed
        Text                                : 
        Max. Text Size                      : 40
        Word wrap                           : enabled
        Horizontal Spacing                  : 0
        Vertical Spacing                    : 0
    
    Events
        Touch Press Event
            // event,buttonPress2,entn,arm1,tCode
            tSend.txt="event,buttonPress2,"
            tSend.txt+=entn.txt+","
            tSend.txt+=va3.txt+","
            tSend.txt+=tCode.txt
            //send calc crc
            btlen tSend.txt,sys0
            crcrest 1,0xffff // reset CRC
            crcputh 55 bb
            crcputs sys0,2
            crcputs tSend.txt,0
            //send cmd
            printh 55 bb
            prints sys0,2
            prints tSend.txt,0
            prints crcval,2
            tCode.txt=""
        
Button arm2
    Attributes
        ID                                  : 28
        Scope                               : local
        Dragging                            : 0
        Disable release event after dragging: 0
        Send Component ID                   : disabled
        Opacity                             : 127
        x coordinate                        : 315
        y coordinate                        : 152
        Width                               : 141
        Height                              : 50
        Effect                              : load
        Effect Priority                     : 0
        Effect Time                         : 300
        Fill                                : solid color
        Style                               : border
        Border Color                        : 6371
        Border Width                        : 0
        Font ID                             : 0
        Back. Color                         : 6371
        Back. Picture ID (Pressed)          : 65535
        Back. Color (Pressed)               : 14823
        Font Color (Unpressed)              : 1374
        Font Color (Pressed)                : 65535
        Horizontal Alignment                : center
        Vertical Alignment                  : center
        State                               : unpressed
        Text                                : 
        Max. Text Size                      : 40
        Word wrap                           : enabled
        Horizontal Spacing                  : 0
        Vertical Spacing                    : 0
    
    Events
        Touch Press Event
            // event,buttonPress2,entn,arm1,tCode
            tSend.txt="event,buttonPress2,"
            tSend.txt+=entn.txt+","
            tSend.txt+=va2.txt+","
            tSend.txt+=tCode.txt
            //send calc crc
            btlen tSend.txt,sys0
            crcrest 1,0xffff // reset CRC
            crcputh 55 bb
            crcputs sys0,2
            crcputs tSend.txt,0
            //send cmd
            printh 55 bb
            prints sys0,2
            prints tSend.txt,0
            prints crcval,2
            tCode.txt=""
        
Button arm4
    Attributes
        ID                                  : 29
        Scope                               : local
        Dragging                            : 0
        Disable release event after dragging: 0
        Send Component ID                   : disabled
        Opacity                             : 127
        x coordinate                        : 315
        y coordinate                        : 266
        Width                               : 141
        Height                              : 50
        Effect                              : load
        Effect Priority                     : 0
        Effect Time                         : 300
        Fill                                : solid color
        Style                               : border
        Border Color                        : 6371
        Border Width                        : 0
        Font ID                             : 0
        Back. Color                         : 6371
        Back. Picture ID (Pressed)          : 65535
        Back. Color (Pressed)               : 14823
        Font Color (Unpressed)              : 1374
        Font Color (Pressed)                : 65535
        Horizontal Alignment                : center
        Vertical Alignment                  : center
        State                               : unpressed
        Text                                : 
        Max. Text Size                      : 40
        Word wrap                           : enabled
        Horizontal Spacing                  : 0
        Vertical Spacing                    : 0
    
    Events
        Touch Press Event
            // event,buttonPress2,entn,arm1,tCode
            tSend.txt="event,buttonPress2,"
            tSend.txt+=entn.txt+","
            tSend.txt+=va4.txt+","
            tSend.txt+=tCode.txt
            //send calc crc
            btlen tSend.txt,sys0
            crcrest 1,0xffff // reset CRC
            crcputh 55 bb
            crcputs sys0,2
            crcputs tSend.txt,0
            //send cmd
            printh 55 bb
            prints sys0,2
            prints tSend.txt,0
            prints crcval,2
            tCode.txt=""
        
Button b11
    Attributes
        ID                                  : 38
        Scope                               : local
        Dragging                            : 0
        Disable release event after dragging: 0
        Send Component ID                   : disabled
        Opacity                             : 127
        x coordinate                        : 224
        y coordinate                        : 266
        Width                               : 75
        Height                              : 50
        Effect                              : load
        Effect Priority                     : 0
        Effect Time                         : 300
        Fill                                : solid color
        Style                               : border
        Border Color                        : 6371
        Border Width                        : 0
        Font ID                             : 2
        Back. Color                         : 6371
        Back. Picture ID (Pressed)          : 65535
        Back. Color (Pressed)               : 14823
        Font Color (Unpressed)              : 1374
        Font Color (Pressed)                : 65535
        Horizontal Alignment                : center
        Vertical Alignment                  : center
        State                               : unpressed
        Text                                : CLR
        Max. Text Size                      : 10
        Word wrap                           : disabled
        Horizontal Spacing                  : 0
        Vertical Spacing                    : 0
    
    Events
        Touch Press Event
            tCode.txt=""
        
Hotspot mSwipeNext
    Attributes
        ID                                  : 35
        Scope                               : local
        Dragging                            : 0
        Disable release event after dragging: 0
        Send Component ID                   : disabled
        Opacity                             : 127
        x coordinate                        : 472
        y coordinate                        : 5
        Width                               : 8
        Height                              : 310
        Effect                              : load
        Effect Priority                     : 0
        Effect Time                         : 300
    
    Events
        Touch Press Event
            click bNext,1
        
Hotspot mSwipeUp
    Attributes
        ID                                  : 36
        Scope                               : local
        Dragging                            : 0
        Disable release event after dragging: 0
        Send Component ID                   : disabled
        Opacity                             : 127
        x coordinate                        : 27
        y coordinate                        : 0
        Width                               : 426
        Height                              : 9
        Effect                              : load
        Effect Priority                     : 0
        Effect Time                         : 300
    
    Events
        Touch Press Event
            click bPrev,1
        
Hotspot mSwipePrev
    Attributes
        ID                                  : 37
        Scope                               : local
        Dragging                            : 0
        Disable release event after dragging: 0
        Send Component ID                   : disabled
        Opacity                             : 127
        x coordinate                        : 0
        y coordinate                        : 5
        Width                               : 8
        Height                              : 310
        Effect                              : load
        Effect Priority                     : 0
        Effect Time                         : 300
    
    Events
        Touch Press Event
            click bPrev,1
        
Timer tmSerial
    Attributes
        ID         : 5
        Scope      : local
        Period (ms): 50
        Enabled    : yes
    
    Events
        Timer Event
            // data available
            if(usize>1)
            {
                bufferPos=0
                while(bufferPos<usize)
                {
                    // check for 0x55 0xBB - Command Init Secuence
                    if(u[bufferPos]==187&&u[bufferPos-1]==85)
                    {
                        //remove garbage at the start of the buffer if there's any to free buffer for command
                        if(u[bufferPos]!=1)
                        {
                            udelete bufferPos-1
                        }
                        //instruction is now aligned with buffer, because we deleted garbage before instrcution
                        //get length after init sequence (check if there are more than to bytes in buffer)
                        if(3<usize)
                        {
                            // check if serial buffer has reached the announced length
                            ucopy payloadLength,2,2,0
                            // we are only checking payload length so we have to skip first 3 bytes (init+payload length) (-1 because of < instead of <=)
                            payloadLength+=3
                            // payload length does also not contain crc, so we are adding another 2 bytes for crc
                            payloadLength+=2
                            if(payloadLength<usize)
                            {
                                // calculate crc
                                crcrest 1,0xFFFF
                                // u[2] contains payload legth at 3rd pos in buffer, we are calculating crc from 3rd pos with number of bytes from payload length
                                //crcputu 3,u[2]
                                // u[2] cotnains payload length, we are calculating a crc over the whole message, so we have to add 3 to the length from u[2]
                                crcputu 0,payloadLength-1
                                // get recived crc to be able to compare it
                                ucopy recvCrc,payloadLength-1,2,0
                                // compare crc with recived value
                                if(crcval==recvCrc)
                                {
                                    // crc is okay
                                    // here is the location where acual code should be
                                    // write command to variable strCommand
                                    ucopy strCommand.txt,4,payloadLength-5,0
                                    // write instruction to tInstuction (debug output, but used as variable here, ui elements will be disabled by default)
                                    spstr strCommand.txt,tInstruction.txt,"~",0
                                    if(tInstruction.txt=="entityUpd")
                                    {
                                        //entn
                                        spstr strCommand.txt,entn.txt,"~",1
                                        // navigation icons
                                        spstr strCommand.txt,tId.txt,"~",2
                                        spstr tId.txt,tTmp.txt,"|",0
                                        if(tTmp.txt=="0")
                                        {
                                            vis bPrev,0
                                            tsw mSwipePrev,0
                                            tsw mSwipeUp,0
                                        }
                                        if(tTmp.txt=="1")
                                        {
                                            vis bPrev,1
                                            tsw mSwipePrev,1
                                            tsw mSwipeUp,0
                                            bPrev.txt="î°"
                                        }
                                        if(tTmp.txt=="2")
                                        {
                                            vis bPrev,1
                                            tsw mSwipePrev,0
                                            tsw mSwipeUp,1
                                            bPrev.txt="î¶"
                                        }
                                        spstr tId.txt,tTmp.txt,"|",1
                                        if(tTmp.txt=="0")
                                        {
                                            vis bNext,0
                                            tsw mSwipeNext,0
                                        }
                                        if(tTmp.txt=="1")
                                        {
                                            vis bNext,1
                                            tsw mSwipeNext,1
                                            bNext.txt="î³"
                                        }
                                        //text arm1
                                        spstr strCommand.txt,arm1.txt,"~",3
                                        if(arm1.txt!="")
                                        {
                                            vis arm1,1
                                        }
                                        //id arm1
                                        spstr strCommand.txt,va1.txt,"~",4
                                        //text arm2
                                        spstr strCommand.txt,arm2.txt,"~",5
                                        if(arm2.txt!="")
                                        {
                                            vis arm2,1
                                        }
                                        //id arm2
                                        spstr strCommand.txt,va2.txt,"~",6
                                        //text arm3
                                        spstr strCommand.txt,arm3.txt,"~",7
                                        if(arm3.txt!="")
                                        {
                                            vis arm3,1
                                        }
                                        //id arm3
                                        spstr strCommand.txt,va3.txt,"~",8
                                        //text arm4
                                        spstr strCommand.txt,arm4.txt,"~",9
                                        if(arm4.txt!="")
                                        {
                                            vis arm4,1
                                        }
                                        //id arm4
                                        spstr strCommand.txt,va4.txt,"~",10
                                        //icon
                                        spstr strCommand.txt,tIcon.txt,"~",11
                                        //icon color
                                        spstr strCommand.txt,tTmp.txt,"~",12
                                        covx tTmp.txt,sys0,0,0
                                        tIcon.pco=sys0
                                        //numpad status
                                        spstr strCommand.txt,tTmp.txt,"~",13
                                        if(tTmp.txt!="disable")
                                        {
                                            vis b0,1
                                            vis b1,1
                                            vis b2,1
                                            vis b3,1
                                            vis b4,1
                                            vis b5,1
                                            vis b6,1
                                            vis b7,1
                                            vis b8,1
                                            vis b9,1
                                            vis b10,1
                                            vis b11,1
                                            vis tCode,1
                                        }else
                                        {
                                            vis b0,0
                                            vis b1,0
                                            vis b2,0
                                            vis b3,0
                                            vis b4,0
                                            vis b5,0
                                            vis b6,0
                                            vis b7,0
                                            vis b8,0
                                            vis b9,0
                                            vis b10,0
                                            vis b11,0
                                            vis tCode,0
                                        }
                                        //flashing status
                                        spstr strCommand.txt,tTmp.txt,"~",14
                                        if(tTmp.txt=="enable")
                                        {
                                            tmFlash.en=1
                                        }else
                                        {
                                            tmFlash.en=0
                                        }
                                        // extra button
                                        spstr strCommand.txt,b9.txt,"~",15
                                        if(b9.txt!="")
                                        {
                                            vis b9,1
                                            spstr strCommand.txt,tTmp.txt,"~",16
                                            covx tTmp.txt,b9.pco,0,0
                                            spstr strCommand.txt,vaAddBtn.txt,"~",17
                                        }
                                    }
                                    if(tInstruction.txt=="time")
                                    {
                                        // get set time to global variable
                                        spstr strCommand.txt,pageIcons.vaTime.txt,"~",1
                                    }
                                    if(tInstruction.txt=="date")
                                    {
                                        // get set date to global variable
                                        spstr strCommand.txt,pageIcons.vaDate.txt,"~",1
                                    }
                                    if(tInstruction.txt=="dimmode")
                                    {
                                        // get value
                                        spstr strCommand.txt,tTmp.txt,"~",1
                                        covx tTmp.txt,dimValue,0,0
                                        // get value normal
                                        spstr strCommand.txt,tTmp.txt,"~",2
                                        covx tTmp.txt,dimValueNormal,0,0
                                        dim=dimValueNormal
                                        // get background color
                                        spstr strCommand.txt,tTmp.txt,"~",3
                                        if(tTmp.txt!="")
                                        {
                                            covx tTmp.txt,defaultBcoColor,0,0
                                        }
                                        // get font color
                                        spstr strCommand.txt,tTmp.txt,"~",4
                                        if(tTmp.txt!="")
                                        {
                                            covx tTmp.txt,defaultFontColor,0,0
                                        }
                                    }
                                    if(tInstruction.txt=="timeout")
                                    {
                                        //set timeout to global var
                                        spstr strCommand.txt,tTmp.txt,"~",1
                                        covx tTmp.txt,sleepTimeout,0,0
                                    }
                                    if(tInstruction.txt=="pageType")
                                    {
                                        //command format pageType,specialPageName
                                        //write name of speical page to tId
                                        spstr strCommand.txt,tId.txt,"~",1
                                        //save second arg if there's one
                                        spstr strCommand.txt,tTmp.txt,"~",2
                                        //save third arg if there's one
                                        spstr strCommand.txt,pageIcons.tTmp2.txt,"~",3
                                        //we are going to exit this page with this command, so we have to clear the buffer, so we are not getting into a stupid loop ...
                                        udelete payloadLength-1
                                        bufferPos=0
                                        if(tId.txt=="pageStartup")
                                        {
                                            page pageStartup
                                        }
                                        if(tId.txt=="screensaver")
                                        {
                                            page screensaver
                                        }
                                        if(tId.txt=="cardEntities")
                                        {
                                            page cardEntities
                                        }
                                        if(tId.txt=="cardGrid")
                                        {
                                            page cardGrid
                                        }
                                        if(tId.txt=="popupLight")
                                        {
                                            pageIcons.tTmp1.txt=tTmp.txt
                                            page popupLight
                                        }
                                        if(tId.txt=="popupShutter")
                                        {
                                            pageIcons.tTmp1.txt=tTmp.txt
                                            page popupShutter
                                        }
                                        if(tId.txt=="popupNotify")
                                        {
                                            page popupNotify
                                        }
                                        if(tId.txt=="cardThermo")
                                        {
                                            page cardThermo
                                        }
                                        if(tId.txt=="cardMedia")
                                        {
                                            page cardMedia
                                        }
                                        if(tId.txt=="cardAlarm")
                                        {
                                            page cardAlarm
                                        }
                                        if(tId.txt=="cardQR")
                                        {
                                            page cardQR
                                        }
                                    }
                                    // end of user code
                                    udelete payloadLength-1
                                    bufferPos=0
                                }
                            }
                        }
                    }
                    // next character
                    bufferPos++
                }
            }
        
Timer tmSleep
    Attributes
        ID         : 10
        Scope      : local
        Period (ms): 1000
        Enabled    : yes
    
    Events
        Timer Event
            if(sleepTimeout!=0&&dimValue!=dim)
            {
                sleepValue+=1
                if(sleepTimeout<=sleepValue)
                {
                    sleepValue=0
                    dim=dimValue
                    tSend.txt="event,sleepReached,cardAlarm"
                    //send calc crc
                    btlen tSend.txt,sys0
                    crcrest 1,0xffff // reset CRC
                    crcputh 55 bb
                    crcputs sys0,2
                    crcputs tSend.txt,0
                    //send cmd
                    printh 55 bb
                    prints sys0,2
                    prints tSend.txt,0
                    prints crcval,2
                }
            }
        
Timer tmFlash
    Attributes
        ID         : 34
        Scope      : local
        Period (ms): 600
        Enabled    : no
    
    Events
        Timer Event
            if(tIcon.isbr==1)
            {
                tIcon.isbr=0
                vis tIcon,0
            }else
            {
                tIcon.isbr=1
                vis tIcon,1
            }
        
TouchCap tc0
    Attributes
        ID   : 11
        Scope: local
        Value: 0
    
    Events
        Touch Press Event
            sleepValue=0
        
