Compare commits

...

39 Commits

Author SHA1 Message Date
joBr99
be5b95fac2 fixed dim bug on startupscreen (add nextion2text) 2022-03-13 00:27:44 +00:00
Johannes
842ad460e9 fixed dim bug on startupscreen 2022-03-13 01:27:24 +01:00
Johannes
7f360e3fa6 fixed detail page shutter 2022-03-13 01:02:43 +01:00
Johannes
19dbda638e unified names 2022-03-13 00:48:52 +01:00
Johannes
05c6bf8770 Update nspanel-lovelance-ui.py 2022-03-13 00:35:18 +01:00
Johannes
8a66d49f93 Merge pull request #32 from gerard33/patch-1
Enhance readability
2022-03-12 23:45:08 +01:00
Gerard
1876470f15 Enhance readability 2022-03-12 23:42:32 +01:00
Johannes
c61c064fb4 Added "hs" to color modes for color wheel 2022-03-12 23:35:13 +01:00
Johannes
7c093d688b added rgbw to color modes for color wheel 2022-03-12 23:32:00 +01:00
Johannes
8fc4a2999d Added Notes about updating 2022-03-12 23:09:22 +01:00
joBr99
5083c1e2c4 modifed nextion2text action, to include visuals (add nextion2text) 2022-03-12 20:58:36 +00:00
Johannes Braun
42d3bb1d8a modifed nextion2text action, to include visuals 2022-03-12 21:58:16 +01:00
Johannes Braun
b087bcf390 fixed heading xcen on media card 2022-03-12 21:50:18 +01:00
joBr99
c588542b5b Merge branch 'main' of github.com:joBr99/nspanel-widget-ui (add nextion2text) 2022-03-12 20:43:59 +00:00
Johannes Braun
72515b6889 Merge branch 'main' of github.com:joBr99/nspanel-widget-ui 2022-03-12 21:43:36 +01:00
Johannes Braun
f624f4f119 moved nav buttons 2022-03-12 21:43:21 +01:00
Johannes
888f8ffeb5 Update nextion2text.yml 2022-03-12 21:08:30 +01:00
joBr99
5272d06513 Add nextion2text 2022-03-12 20:02:17 +00:00
Johannes Braun
376ca2dc40 fix deletion of buffer in pageType command 2022-03-12 21:01:57 +01:00
joBr99
e667d8fff4 Add nextion2text 2022-03-12 19:54:11 +00:00
Johannes Braun
4f180cded6 Merge branch 'main' of github.com:joBr99/nspanel-widget-ui 2022-03-12 20:53:25 +01:00
Johannes Braun
168e8c83c0 added pageType for notify 2022-03-12 20:53:08 +01:00
Johannes
5a5807cbf4 Update codeql-analysis.yml 2022-03-12 20:45:29 +01:00
Johannes
999ade0539 Update nextion2text.yml 2022-03-12 20:41:58 +01:00
joBr99
f0d3b775e6 Add nextion2text 2022-03-12 19:27:58 +00:00
Johannes
0617cae706 Update nextion2text.yml 2022-03-12 20:18:10 +01:00
Johannes
15570fc096 Update nextion2text.yml 2022-03-12 20:06:49 +01:00
Johannes
318ae91399 Create nextion2text.yml 2022-03-12 20:05:58 +01:00
Johannes Braun
72f9af1175 fix bug on light page #2 2022-03-12 19:49:58 +01:00
Johannes Braun
c93ad3ce13 bugfix on light detail page 2022-03-12 19:33:21 +01:00
Johannes Braun
6f21cff116 update screens 2022-03-12 18:33:20 +01:00
Johannes Braun
a625696159 added screens 2022-03-12 18:20:57 +01:00
Johannes Braun
87c6f4711e implemented color wheel and external detail update 2022-03-12 18:14:56 +01:00
Johannes Braun
69816e12f6 fixed brightness slider on detail page 2022-03-12 17:08:54 +01:00
Johannes Braun
2ee67c5a69 fixed offset in berry driver for new msg format 2022-03-12 16:54:05 +01:00
Johannes Braun
49c5877458 breaking change in message format, to support longer messages 2022-03-12 16:19:30 +01:00
Johannes Braun
58a3b3c63d Merge branch 'main' of github.com:joBr99/nspanel-widget-ui 2022-03-12 13:03:25 +01:00
Johannes Braun
57c36f412e bump version 2022-03-12 13:03:18 +01:00
Johannes Braun
05bc94c7e5 implemented rgb wheel in nextion project 2022-03-12 11:56:18 +01:00
37 changed files with 9774 additions and 103 deletions

View File

@@ -14,9 +14,13 @@ name: "CodeQL"
on: on:
push: push:
branches: [ main ] branches: [ main ]
paths:
- '**.py'
pull_request: pull_request:
# The branches below must be a subset of the branches above # The branches below must be a subset of the branches above
branches: [ main ] branches: [ main ]
paths:
- '**.py'
schedule: schedule:
- cron: '36 14 * * 3' - cron: '36 14 * * 3'

36
.github/workflows/nextion2text.yml vendored Normal file
View File

@@ -0,0 +1,36 @@
name: nextion2text
on:
pull_request:
paths:
- HMI/nspanel.HMI
push:
branches:
- main
paths:
- HMI/nspanel.HMI
jobs:
gen-nextion-to-text:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
- name: Get last commit message
id: last-commit-message
run: |
echo "::set-output name=msg::$(git log -1 --pretty=%s)"
- name: Run nextion2text
run: |
cd HMI
wget https://raw.githubusercontent.com/joBr99/Nextion2Text/linux/Nextion2Text.py
python Nextion2Text.py -s -d -p -p visual -i nspanel.HMI -o n2t-out
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: ${{ steps.last-commit-message.outputs.msg }} (add nextion2text)
file_pattern: HMI/n2t-out/*.txt

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
# don't add nextion2text
HMI/Nextion2Text.py

View File

@@ -14,7 +14,7 @@ See the following picture to get an Idea for the messages send and recived from
# Custom Protocol # 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. 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 ## 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) 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 ## Messages to Nextion Display
@@ -35,143 +35,161 @@ The following message should be implemented on all pages
wake screen: wake screen:
wake `wake`
set brightness of screensaver: set brightness of screensaver:
dimmode,0 - (screen off) `dimmode,0 - (screen off)`
dimmode,100 - (screen on with full brightness)
`dimmode,100 - (screen on with full brightness)`
set current time: set current time:
time,22 : 26 `time,22 : 26`
set current date: set current date:
date,?Di 24. Februar `date,?Di 24. Februar`
set screensaver timeout (set time in ms limited from 50 to 65535: set screensaver timeout (set time in sec, max 65):
timeout,15 - timeout after 15 seconds `timeout,15 - timeout after 15 seconds`
timeout,0 - disable screensaver
`timeout,0 - disable screensaver`
change the page type: change the page type:
pageType,pageStartup `pageType,pageStartup`
pageType,cardEntities `pageType,cardEntities`
pageType,cardThermo `pageType,cardThermo`
pageType,cardMedia `pageType,cardMedia`
pageType,popupLight,Schreibtischlampe `pageType,popupLight,Schreibtischlampe`
`pageType,popupNotify`
### screensaver page ### screensaver page
weatherUpdate,? tMainIcon? tMainText? tMRIcon? tMR? tForecast1? tF1Icon? tForecast1Val? tForecast2? tF2Icon? tForecast2Val `weatherUpdate,? tMainIcon? tMainText? tMRIcon? tMR? tForecast1? tF1Icon? tForecast1Val? tForecast2? tF2Icon? tForecast2Val`
weatherUpdate,?0?2,3 C?0?0 mm?Mi?0?9,3 C?Do?0?11,5 C `weatherUpdate,?0?2,3 C?0?0 mm?Mi?0?9,3 C?Do?0?11,5 C`
### cardEntities Page ### cardEntities Page
The following message can be used to update the content on the cardEntities Page The following message can be used to update the content on the cardEntities Page
entityUpdHeading,heading1337 `entityUpdHeading,heading1337`
entityUpd,*id*,*type*,*internalNameEntity*,*iconId*,*displayNameEntity*,*optionalValue* `entityUpd,*id*,*type*,*internalNameEntity*,*iconId*,*displayNameEntity*,*optionalValue*`
entityUpd,1,light,light.entityName,1,Light1,0 `entityUpd,1,light,light.entityName,1,Light1,0`
entityUpd,2,shutter,cover.entityName,0,Shutter2 `entityUpd,2,shutter,cover.entityName,0,Shutter2`
entityUpd,3,delete `entityUpd,3,delete`
entityUpd,4,text,sensor.entityName,3,Temperature,content `entityUpd,4,text,sensor.entityName,3,Temperature,content`
entityUpd,4,button,button.entityName,3,bt-name,bt-text `entityUpd,4,button,button.entityName,3,bt-name,bt-text`
entityUpd,1,switch,switch.entityName,4,Switch1,0 `entityUpd,1,switch,switch.entityName,4,Switch1,0`
### popupLight Page ### popupLight Page
entityUpdateDetail,*buttonState*,*sliderBrightnessPos*,*sliderColorTempPos* `entityUpdateDetail,*buttonState*,*sliderBrightnessPos*,*sliderColorTempPos*,*colorMode*`
entityUpdateDetail,1,100,78 `entityUpdateDetail,1,100,78,enable`
entityUpdateDetail,1,100,disable `entityUpdateDetail,1,100,disable`
### popupShutter Page ### popupShutter Page
entityUpdateDetail,*ignored*,*sliderPos* `entityUpdateDetail,*ignored*,*sliderPos*`
entityUpdateDetail,1,77 `entityUpdateDetail,1,77`
### popupNotify Page
`entityUpdateDetail,*tHeading*,*b1*,*b2*,*tText*`
### cardThermo Page ### cardThermo Page
entityUpd,*internalNameEntiy*,*heading*,*currentTemp*,*destTemp*,*status*,*minTemp*,*maxTemp*,*stepTemp* `entityUpd,*internalNameEntiy*,*heading*,*currentTemp*,*destTemp*,*status*,*minTemp*,*maxTemp*,*stepTemp*`
### cardMedia Page ### cardMedia Page
entityUpd,|*internalNameEntiy*|*heading*|*icon*|*title*|*author*|*volume*|*playpauseicon* `entityUpd,|*internalNameEntiy*|*heading*|*icon*|*title*|*author*|*volume*|*playpauseicon*`
## Messages from Nextion Display ## Messages from Nextion Display
### startup page ### startup page
event,startup,version `event,startup,version`
### screensaver page ### screensaver page
event,screensaverOpen `event,screensaverOpen`
### cardEntities Page ### cardEntities Page
event,*eventName*,*PageNumber*,*PageHeading*,*entityName*,*buttonId*,*actionName*,*optionalValue* `event,*eventName*,*PageNumber*,*PageHeading*,*entityName*,*buttonId*,*actionName*,*optionalValue*`
event,pageOpen,0 `event,pageOpen,0`
event,buttonPress,1,tHeading,internalNameEntity,1,up `event,buttonPress,1,tHeading,internalNameEntity,1,up`
event,buttonPress,1,tHeading,internalNameEntity,1,down `event,buttonPress,1,tHeading,internalNameEntity,1,down`
event,buttonPress,1,tHeading,internalNameEntity,1,stop `event,buttonPress,1,tHeading,internalNameEntity,1,stop`
event,buttonPress,1,tHeading,internalNameEntity,1,OnOff,1 `event,buttonPress,1,tHeading,internalNameEntity,1,OnOff,1`
event,buttonPress,1,tHeading,internalNameEntity,1,button `event,buttonPress,1,tHeading,internalNameEntity,1,button`
### popupLight Page ### popupLight Page
event,pageOpenDetail,popupLight,internalNameEntity `event,pageOpenDetail,popupLight,internalNameEntity`
event,buttonPress,D,nameEntity,internalNameEntity,1,OnOff,1 `event,buttonPress,D,nameEntity,internalNameEntity,1,OnOff,1`
event,buttonPress,D,nameEntity,internalNameEntity,1,brightnessSlider,50 `event,buttonPress,D,nameEntity,internalNameEntity,1,brightnessSlider,50`
event,buttonPress,D,nameEntity,internalNameEntity,1,colorTempSlider,50 `event,buttonPress,D,nameEntity,internalNameEntity,1,colorTempSlider,50`
`event,buttonPress,D,nameEntity,internalNameEntity,1,colorWheel,x|y`
### popupShutter Page ### popupShutter Page
event,pageOpenDetail,popupShutter,internalNameEntity `event,pageOpenDetail,popupShutter,internalNameEntity`
event,buttonPress,D,nameEntity,internalNameEntity,1,positionSlider,50 `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 ### cardThermo Page
event,pageOpen,0 `event,pageOpen,0`
event,tempUpd,*pageNumber*,*entityName*,*temperature* `event,tempUpd,*pageNumber*,*entityName*,*temperature*`
### cardMedia Page ### cardMedia Page
event,buttonPress,1,tHeading,internalNameEntity,1,media-back `event,buttonPress,1,tHeading,internalNameEntity,1,media-back`
event,buttonPress,1,tHeading,internalNameEntity,1,media-pause `event,buttonPress,1,tHeading,internalNameEntity,1,media-pause`
`event,buttonPress,1,tHeading,internalNameEntity,1,media-next`
`event,buttonPress,1,tHeading,internalNameEntity,1,volumeSlider,75`
event,buttonPress,1,tHeading,internalNameEntity,1,media-next
event,buttonPress,1,tHeading,internalNameEntity,1,volumeSlider,75
# Icons IDs # Icons IDs

28
HMI/n2t-out/Program.s.txt Normal file
View File

@@ -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

2432
HMI/n2t-out/cardEntities.txt Normal file

File diff suppressed because it is too large Load Diff

843
HMI/n2t-out/cardMedia.txt Normal file
View File

@@ -0,0 +1,843 @@
Page cardMedia
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
vis p0,0
vis tSend,0
vis tInstruction,0
vis nPageDisp,0
vis tTmp,0
vis tId,0
//vis nPageDisp,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 : 8
Scope : local
Text :
Max. Text Size: 200
Variable (string) entn
Attributes
ID : 19
Scope : local
Text :
Max. Text Size: 50
Number nPageDisp
Attributes
ID : 6
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 426
y coordinate : 0
Width : 42
Height : 24
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
Value : 0
Significant digits shown : all
Format : decimal
Word wrap : enabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text tSend
Attributes
ID : 2
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 0
y coordinate : 0
Width : 230
Height : 23
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 : newtxt
Max. Text Size : 100
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text tTmp
Attributes
ID : 3
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 406
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 : 9
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 0
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 : 10
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 99
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 tHeading
Attributes
ID : 11
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 111
y coordinate : 26
Width : 228
Height : 30
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 1
Back. Color : 6371
Font Color : 65535
Horizontal Alignment : center
Vertical Alignment : center
Input Type : character
Text :
Max. Text Size : 40
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text tTitle
Attributes
ID : 12
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 84
y coordinate : 78
Width : 360
Height : 25
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 0
Back. Color : 6371
Font Color : 65535
Horizontal Alignment : right
Vertical Alignment : center
Input Type : character
Text :
Max. Text Size : 50
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text tAuthor
Attributes
ID : 13
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 85
y coordinate : 108
Width : 360
Height : 25
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 0
Back. Color : 6371
Font Color : 65535
Horizontal Alignment : right
Vertical Alignment : center
Input Type : character
Text :
Max. Text Size : 50
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text t2
Attributes
ID : 14
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 314
y coordinate : 159
Width : 50
Height : 50
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 2
Back. Color : 6371
Font Color : 50712
Horizontal Alignment : center
Vertical Alignment : center
Input Type : character
Text : 
Max. Text Size : 10
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
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+=entn.txt+","
tSend.txt+="1,media-next"
//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
Text tPlayPause
Attributes
ID : 15
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 203
y coordinate : 159
Width : 50
Height : 50
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 2
Back. Color : 6371
Font Color : 50712
Horizontal Alignment : center
Vertical Alignment : center
Input Type : character
Text : 
Max. Text Size : 10
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
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+=entn.txt+","
tSend.txt+="1,media-pause"
//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
Text t0
Attributes
ID : 16
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 92
y coordinate : 159
Width : 50
Height : 50
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 2
Back. Color : 6371
Font Color : 50712
Horizontal Alignment : center
Vertical Alignment : center
Input Type : character
Text : 
Max. Text Size : 10
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
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+=entn.txt+","
tSend.txt+="1,media-back"
//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
Text tIcon
Attributes
ID : 18
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 11
y coordinate : 75
Width : 71
Height : 62
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 2
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
Slider hVolume
Attributes
ID : 17
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 61
y coordinate : 227
Width : 335
Height : 43
Effect : load
Effect Priority : 0
Effect Time : 300
Direction : horizontal
Fill : image
Cursor width : auto
Cursor height : 255
Back. Picture ID : 5
Slided Back. Picture ID : 4
Position : 50
Upper range limit : 100
Lower range limit : 0
Events
Touch Release Event
// event,buttonPress,D,nameEntity,internalNameEntity,1,positionSlider,50
//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+=entn.txt+","
tSend.txt+="1,volumeSlider,"
covx hVolume.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 bNext
Attributes
ID : 4
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 391
y coordinate : 16
Width : 50
Height : 50
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Font ID : 2
Back. Color : 6371
Back. Picture ID (Pressed) : 65535
Back. Color (Pressed) : 1024
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
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 bPrev
Attributes
ID : 5
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 9
y coordinate : 16
Width : 50
Height : 50
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Font ID : 2
Back. Color : 6371
Back. Picture ID (Pressed) : 65535
Back. Color (Pressed) : 1024
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
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
Timer tmSerial
Attributes
ID : 7
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")
{
//entity name
spstr strCommand.txt,entn.txt,"|",1
//heading
spstr strCommand.txt,tHeading.txt,"|",2
//icon
spstr strCommand.txt,tTmp.txt,"|",3
covx tTmp.txt,sys0,0,0
substr pageIcons.tIcons.txt,tIcon.txt,sys0,1
//title
spstr strCommand.txt,tTitle.txt,"|",4
//author
spstr strCommand.txt,tAuthor.txt,"|",5
//volume
spstr strCommand.txt,tTmp.txt,"|",6
covx tTmp.txt,sys0,0,0
hVolume.val=sys0
//icon
spstr strCommand.txt,tTmp.txt,"|",7
covx tTmp.txt,sys0,0,0
substr pageIcons.tIcons.txt,tPlayPause.txt,sys0,1
}
if(tInstruction.txt=="time")
{
// get set time to global variable
spstr strCommand.txt,screensaver.vaTime.txt,",",1
}
if(tInstruction.txt=="date")
{
// get set date to global variable
spstr strCommand.txt,screensaver.vaDate.txt,"?",1
}
if(tInstruction.txt=="dimmode")
{
// get value
spstr strCommand.txt,tTmp.txt,",",1
covx tTmp.txt,dimValue,0,0
dim=dimValue
}
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
if(tId.txt=="cardMedia")
{
//yay, we are already on the correct page
}else
{
//we are going to exit this page with this command, so we have to clear the buffer, so we are not getting into a stupid loop ...
udelete payloadLength-1
bufferPos=0
}
if(tId.txt=="cardEntities")
{
page cardEntities
}
if(tId.txt=="cardThermo")
{
page cardThermo
}
if(tId.txt=="pageStartup")
{
page pageStartup
}
if(tId.txt=="pageNotify")
{
page popupNotify
}
}
// end of user code
udelete payloadLength-1
bufferPos=0
}
}
}
}
// next character
bufferPos++
}
if(bufferPos==usize)
{
// copy whole buffer to t1.txt, for debugging
//ucopy t2.txt,0,usize,0
// ucopy n2.val,0,usize,0
// clear whole buffer
//code_c
//bufferPos=0
}
}
Timer tmSleep
Attributes
ID : 20
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 screensaver
}
}
TouchCap tc0
Attributes
ID : 21
Scope: local
Value: 0
Events
Touch Press Event
sleepValue=0

973
HMI/n2t-out/cardThermo.txt Normal file
View File

@@ -0,0 +1,973 @@
Page cardThermo
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
vis p0,0
vis tSend,0
vis tInstruction,0
vis tTmp,0
vis tId,0
vis nPageDisp,0
vis xTempMin,0
vis xTempMax,0
vis xTempStep,0
//tEntity.txt=tHeading.txt
//disable buttons that are not implemented
vis t7,0
vis t6,0
vis t5,0
//
//page open event
// event,pageOpen,cardThermo,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 : 7
Scope : local
Text :
Max. Text Size: 100
Variable (string) entn
Attributes
ID : 25
Scope : local
Text :
Max. Text Size: 50
Number nPageDisp
Attributes
ID : 5
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 426
y coordinate : 0
Width : 42
Height : 24
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
Value : 0
Significant digits shown : all
Format : decimal
Word wrap : enabled
Horizontal Spacing : 0
Vertical Spacing : 0
XFloat xTempCurr
Attributes
ID : 17
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 156
y coordinate : 79
Width : 130
Height : 70
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 4
Back. Color : 6371
Font Color : 65535
Horizontal Alignment : center
Vertical Alignment : center
Value : 215
Significant digits left : 0
Significant digits right : 1
Word wrap : enabled
Horizontal Spacing : 0
Vertical Spacing : 0
XFloat xTempDest
Attributes
ID : 19
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 201
y coordinate : 156
Width : 50
Height : 22
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 0
Back. Color : 6371
Font Color : 65535
Horizontal Alignment : center
Vertical Alignment : center
Value : 215
Significant digits left : 0
Significant digits right : 1
Word wrap : enabled
Horizontal Spacing : 0
Vertical Spacing : 0
XFloat xTempMin
Attributes
ID : 20
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 10
y coordinate : 30
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
Value : 0
Significant digits left : 0
Significant digits right : 1
Word wrap : enabled
Horizontal Spacing : 0
Vertical Spacing : 0
XFloat xTempMax
Attributes
ID : 21
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 8
y coordinate : 62
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
Value : 0
Significant digits left : 0
Significant digits right : 1
Word wrap : enabled
Horizontal Spacing : 0
Vertical Spacing : 0
XFloat xTempStep
Attributes
ID : 22
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 7
y coordinate : 91
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
Value : 0
Significant digits left : 0
Significant digits right : 1
Word wrap : enabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text tSend
Attributes
ID : 2
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 0
y coordinate : 0
Width : 230
Height : 23
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 : newtxt
Max. Text Size : 100
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text tTmp
Attributes
ID : 3
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 406
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 : 8
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 0
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 : 9
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 99
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 tHeading
Attributes
ID : 10
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 112
y coordinate : 265
Width : 228
Height : 30
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 1
Back. Color : 6371
Font Color : 65535
Horizontal Alignment : center
Vertical Alignment : center
Input Type : character
Text :
Max. Text Size : 40
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text tStatus
Attributes
ID : 11
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 181
y coordinate : 178
Width : 88
Height : 30
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 0
Back. Color : 6371
Font Color : 50712
Horizontal Alignment : center
Vertical Alignment : center
Input Type : character
Text : Heizung
Max. Text Size : 10
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text t5
Attributes
ID : 12
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 263
y coordinate : 218
Width : 30
Height : 30
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 1
Back. Color : 6371
Font Color : 50712
Horizontal Alignment : center
Vertical Alignment : center
Input Type : character
Text : 
Max. Text Size : 10
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text t6
Attributes
ID : 13
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 211
y coordinate : 218
Width : 30
Height : 30
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 1
Back. Color : 6371
Font Color : 64512
Horizontal Alignment : center
Vertical Alignment : center
Input Type : character
Text : 
Max. Text Size : 10
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text t7
Attributes
ID : 14
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 160
y coordinate : 218
Width : 30
Height : 30
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 1
Back. Color : 6371
Font Color : 50712
Horizontal Alignment : center
Vertical Alignment : center
Input Type : character
Text : 
Max. Text Size : 10
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text t2
Attributes
ID : 18
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 283
y coordinate : 74
Width : 25
Height : 30
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 1
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 : 4
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 396
y coordinate : 16
Width : 50
Height : 50
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Font ID : 2
Back. Color : 6371
Back. Picture ID (Pressed) : 65535
Back. Color (Pressed) : 1024
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
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 bDown
Attributes
ID : 15
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 68
y coordinate : 124
Width : 64
Height : 64
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : image
Font ID : 3
Background Picture ID (Unpressed) : 7
Back. Picture ID (Pressed) : 7
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
if(xTempDest.val>xTempMin.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 : 16
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 316
y coordinate : 124
Width : 64
Height : 64
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : image
Font ID : 3
Background Picture ID (Unpressed) : 9
Back. Picture ID (Pressed) : 9
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
if(xTempDest.val<xTempMax.val)
{
xTempDest.val=xTempDest.val+xTempStep.val
}
// temp chane event
// event,tempUpd,pageNumber,entityName,temperature
//craft command
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 bPrev
Attributes
ID : 26
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 9
y coordinate : 16
Width : 50
Height : 50
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Font ID : 2
Back. Color : 6371
Back. Picture ID (Pressed) : 65535
Back. Color (Pressed) : 1024
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
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
Timer tmSerial
Attributes
ID : 6
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")
{
//entity name
spstr strCommand.txt,entn.txt,",",1
//heading
spstr strCommand.txt,tHeading.txt,",",2
//currentTemp
spstr strCommand.txt,tTmp.txt,",",3
covx tTmp.txt,xTempCurr.val,0,0
//dstTemp
spstr strCommand.txt,tTmp.txt,",",4
covx tTmp.txt,xTempDest.val,0,0
//status
spstr strCommand.txt,tStatus.txt,",",5
//minTemp
spstr strCommand.txt,tTmp.txt,",",6
covx tTmp.txt,xTempMin.val,0,0
//maxTemp
spstr strCommand.txt,tTmp.txt,",",7
covx tTmp.txt,xTempMax.val,0,0
//tempStep
spstr strCommand.txt,tTmp.txt,",",8
covx tTmp.txt,xTempStep.val,0,0
}
if(tInstruction.txt=="time")
{
// get set time to global variable
spstr strCommand.txt,screensaver.vaTime.txt,",",1
}
if(tInstruction.txt=="date")
{
// get set date to global variable
spstr strCommand.txt,screensaver.vaDate.txt,"?",1
}
if(tInstruction.txt=="dimmode")
{
// get value
spstr strCommand.txt,tTmp.txt,",",1
covx tTmp.txt,dimValue,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
if(tId.txt=="cardThermo")
{
//yay, we are already on the correct page
}else
{
//we are going to exit this page with this command, so we have to clear the buffer, so we are not getting into a stupid loop ...
udelete payloadLength-1
bufferPos=0
}
if(tId.txt=="popupLight")
{
pageIcons.tTmp1.txt=tTmp.txt
page popupLight
}
if(tId.txt=="cardEntities")
{
page cardEntities
}
if(tId.txt=="cardMedia")
{
page cardMedia
}
if(tId.txt=="pageStartup")
{
page pageStartup
}
if(tId.txt=="pageNotify")
{
page popupNotify
}
}
// end of user code
udelete payloadLength-1
bufferPos=0
}
}
}
}
// next character
bufferPos++
}
if(bufferPos==usize)
{
// copy whole buffer to t1.txt, for debugging
//ucopy t2.txt,0,usize,0
// ucopy n2.val,0,usize,0
// clear whole buffer
//code_c
//bufferPos=0
}
}
Timer tmSleep
Attributes
ID : 23
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 screensaver
}
}
TouchCap tc0
Attributes
ID : 24
Scope: local
Value: 0
Events
Touch Press Event
sleepValue=0

View File

@@ -0,0 +1,58 @@
Program.s
0 Component(s)
17 Line(s) of event code
17 Unique line(s) of event code
pageIcons
6 Component(s)
0 Line(s) of event code
0 Unique line(s) of event code
pageSerialTest
13 Component(s)
48 Line(s) of event code
43 Unique line(s) of event code
pageTest
12 Component(s)
12 Line(s) of event code
12 Unique line(s) of event code
pageSwipeTest
18 Component(s)
62 Line(s) of event code
44 Unique line(s) of event code
popupNotify
15 Component(s)
143 Line(s) of event code
95 Unique line(s) of event code
screensaver
25 Component(s)
145 Line(s) of event code
115 Unique line(s) of event code
cardThermo
27 Component(s)
200 Line(s) of event code
119 Unique line(s) of event code
pageStartup
19 Component(s)
134 Line(s) of event code
104 Unique line(s) of event code
popupLight
27 Component(s)
296 Line(s) of event code
152 Unique line(s) of event code
popupShutter
19 Component(s)
148 Line(s) of event code
84 Unique line(s) of event code
cardMedia
22 Component(s)
212 Line(s) of event code
109 Unique line(s) of event code
cardEntities
55 Component(s)
823 Line(s) of event code
312 Unique line(s) of event code
Total
12 Page(s)
258 Component(s)
2240 Line(s) of event code
577 Unique line(s) of event code

13
HMI/n2t-out/page0.txt Normal file
View File

@@ -0,0 +1,13 @@
Page page0
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

157
HMI/n2t-out/pageIcons.txt Normal file
View File

@@ -0,0 +1,157 @@
Page pageIcons
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 : 65535
Text t0
Attributes
ID : 2
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 0
y coordinate : 5
Width : 295
Height : 107
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 : tIcons contains all icons that can be used though serial (icon will be pulled from this textbox, first icon 0 and so on)
Max. Text Size : 400
Word wrap : enabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text tIcons
Attributes
ID : 3
Scope : global
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 1
y coordinate : 117
Width : 300
Height : 190
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 1
Back. Color : 65535
Font Color : 0
Horizontal Alignment : left
Vertical Alignment : top
Input Type : character
Text : 
Max. Text Size : 100
Word wrap : enabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text tTmp1
Attributes
ID : 4
Scope : global
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 302
y coordinate : 8
Width : 146
Height : 69
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 1
Back. Color : 65535
Font Color : 0
Horizontal Alignment : center
Vertical Alignment : center
Input Type : character
Text :
Max. Text Size : 50
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text tTmp2
Attributes
ID : 5
Scope : global
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 302
y coordinate : 82
Width : 146
Height : 69
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 1
Back. Color : 65535
Font Color : 0
Horizontal Alignment : center
Vertical Alignment : center
Input Type : character
Text :
Max. Text Size : 50
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 : 479
Height : 319
Effect : load
Effect Priority : 0
Effect Time : 300
Picture ID : 0

View File

@@ -0,0 +1,434 @@
Page pageSerialTest
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 : 65535
Events
Preinitialize Event
//vis p0,0
//recmod=1
//bauds=115200
Number nCrcRecv
Attributes
ID : 5
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 160
y coordinate : 0
Width : 88
Height : 29
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 5
Back. Color : 65535
Font Color : 0
Horizontal Alignment : center
Vertical Alignment : center
Value : 0
Significant digits shown : all
Format : decimal with digit grouping
Word wrap : enabled
Horizontal Spacing : 0
Vertical Spacing : 0
Number nCrcCalc
Attributes
ID : 6
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 159
y coordinate : 31
Width : 90
Height : 30
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 5
Back. Color : 65535
Font Color : 0
Horizontal Alignment : center
Vertical Alignment : center
Value : 0
Significant digits shown : all
Format : decimal with digit grouping
Word wrap : enabled
Horizontal Spacing : 0
Vertical Spacing : 0
Number nIt
Attributes
ID : 11
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 378
y coordinate : 234
Width : 52
Height : 30
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 5
Back. Color : 65535
Font Color : 0
Horizontal Alignment : center
Vertical Alignment : center
Value : 0
Significant digits shown : all
Format : decimal
Word wrap : enabled
Horizontal Spacing : 0
Vertical Spacing : 0
Number nLength
Attributes
ID : 12
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 15
y coordinate : 215
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
Value : 0
Significant digits shown : all
Format : decimal
Word wrap : enabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text tStatus
Attributes
ID : 3
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 160
y coordinate : 60
Width : 271
Height : 90
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 5
Back. Color : 65535
Font Color : 0
Horizontal Alignment : center
Vertical Alignment : center
Input Type : character
Text : newtxt
Max. Text Size : 100
Word wrap : enabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text tCmd
Attributes
ID : 4
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 160
y coordinate : 151
Width : 272
Height : 80
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 5
Back. Color : 65535
Font Color : 0
Horizontal Alignment : center
Vertical Alignment : center
Input Type : character
Text : newtxt
Max. Text Size : 500
Word wrap : enabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text tBuffer
Attributes
ID : 7
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 7
y coordinate : 270
Width : 435
Height : 30
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 5
Back. Color : 65535
Font Color : 0
Horizontal Alignment : center
Vertical Alignment : center
Input Type : character
Text : newtxt
Max. Text Size : 100
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text tDesc
Attributes
ID : 8
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 0
y coordinate : 0
Width : 159
Height : 204
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 5
Back. Color : 65535
Font Color : 0
Horizontal Alignment : center
Vertical Alignment : center
Input Type : character
Text : CRC Recv:\r\nCRC Calc:\r\n\r\nStatus\r\n\r\nCommand
Max. Text Size : 60
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 : 479
Height : 319
Effect : load
Effect Priority : 0
Effect Time : 300
Picture ID : 0
Button b0
Attributes
ID : 9
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 334
y coordinate : 9
Width : 46
Height : 46
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : 3D auto
Font ID : 5
Back. Color : 50712
Back. Picture ID (Pressed) : 0
Back. Color (Pressed) : 1024
Font Color (Unpressed) : 0
Font Color (Pressed) : 65535
Horizontal Alignment : center
Vertical Alignment : center
State : unpressed
Text : bck
Max. Text Size : 10
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Events
Touch Press Event
recmod=0
page pageTest
Button b1
Attributes
ID : 10
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 392
y coordinate : 10
Width : 48
Height : 48
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : 3D auto
Font ID : 5
Back. Color : 50712
Back. Picture ID (Pressed) : 0
Back. Color (Pressed) : 1024
Font Color (Unpressed) : 0
Font Color (Pressed) : 65535
Horizontal Alignment : center
Vertical Alignment : center
State : unpressed
Text : ON
Max. Text Size : 10
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Events
Touch Press Event
recmod=1
bauds=115200
Timer tmSerial
Attributes
ID : 2
Scope : local
Period (ms): 400
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
}
tStatus.txt="init command detected"
//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
//payloadLength=u[2]
ucopy payloadLength,2,2,0
nLength.val=payloadLength
// 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)
{
tStatus.txt="reached"
// calculate crc
crcrest 1,0xFFFF
// payload length -1 to exclude crc
crcputu 0,payloadLength-1 //u[2]+3
// get recived crc to be able to compare it
ucopy recvCrc,payloadLength-1,2,0
nCrcRecv.val=recvCrc
// compare crc with recived value
if(crcval==recvCrc)
{
tStatus.txt="crc ok"
nIt.val=nIt.val+1
ucopy tCmd.txt,4,payloadLength-5,0
udelete payloadLength-1
bufferPos=0
// here is the location where acual code should be
}
// copy calculated crc and recived crc to nCrcRecv and nCrcCalc, for debugging
nCrcRecv.val=recvCrc
nCrcCalc.val=crcval
//ucopy nCrcCalc.val,u[2]+3,3,0
}
}
}
// next character
bufferPos++
}
if(bufferPos==usize)
{
// copy whole buffer to tCmd.txt, for debugging
//ucopy tBuffer.txt,0,usize,0
// ucopy nIt.val,0,usize,0
// clear whole buffer
//code_c
//bufferPos=0
}
}

657
HMI/n2t-out/pageStartup.txt Normal file
View File

@@ -0,0 +1,657 @@
Page pageStartup
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
vis p0,0
recmod=1
bauds=115200
vis tSend,0
vis tInstruction,0
vis tTmp,0
vis tId,0
vis bSendStartup,0
vis frame_ptr,0
vis spinner_w,0
vis frapic_w,0
vis usual_cnt,0
vis tMsg2,0
vis tMsg3,0
vis tVersion,0
dim=100
Postinitialize Event
//send messages by clicking button
click bSendStartup,1
Variable (string) strCommand
Attributes
ID : 5
Scope : local
Text :
Max. Text Size: 50
Number frame_ptr
Attributes
ID : 10
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 11
y coordinate : 34
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
Value : 0
Significant digits shown : all
Format : decimal
Word wrap : enabled
Horizontal Spacing : 0
Vertical Spacing : 0
Number spinner_w
Attributes
ID : 11
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 11
y coordinate : 67
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
Value : 140
Significant digits shown : all
Format : decimal
Word wrap : enabled
Horizontal Spacing : 0
Vertical Spacing : 0
Number frapic_w
Attributes
ID : 12
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 11
y coordinate : 100
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
Value : 1960
Significant digits shown : all
Format : decimal
Word wrap : enabled
Horizontal Spacing : 0
Vertical Spacing : 0
Number usual_cnt
Attributes
ID : 15
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 12
y coordinate : 134
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
Value : 0
Significant digits shown : all
Format : decimal
Word wrap : enabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text tSend
Attributes
ID : 2
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 0
y coordinate : 0
Width : 230
Height : 23
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 : newtxt
Max. Text Size : 100
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text tTmp
Attributes
ID : 3
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 408
y coordinate : 0
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 : 6
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 246
y coordinate : 0
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 : 7
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 355
y coordinate : 0
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 tMsg1
Attributes
ID : 8
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 42
y coordinate : 223
Width : 375
Height : 30
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 1
Back. Color : 6371
Font Color : 65535
Horizontal Alignment : center
Vertical Alignment : center
Input Type : character
Text : Waiting for content ...
Max. Text Size : 40
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text tMsg2
Attributes
ID : 13
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 25
y coordinate : 256
Width : 408
Height : 25
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 0
Back. Color : 6371
Font Color : 65535
Horizontal Alignment : center
Vertical Alignment : center
Input Type : character
Text : This is taking longer than usual,
Max. Text Size : 100
Word wrap : enabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text tMsg3
Attributes
ID : 14
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 25
y coordinate : 278
Width : 408
Height : 25
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 0
Back. Color : 6371
Font Color : 65535
Horizontal Alignment : center
Vertical Alignment : center
Input Type : character
Text : please check your backend configuration
Max. Text Size : 100
Word wrap : enabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text tVersion
Attributes
ID : 18
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 402
y coordinate : 101
Width : 78
Height : 72
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 : 4
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 bSendStartup
Attributes
ID : 17
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 380
y coordinate : 39
Width : 63
Height : 50
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : 3D auto
Font ID : 0
Back. Color : 50712
Back. Picture ID (Pressed) : 65535
Back. Color (Pressed) : 1024
Font Color (Unpressed) : 0
Font Color (Pressed) : 65535
Horizontal Alignment : center
Vertical Alignment : center
State : unpressed
Text : startup
Max. Text Size : 10
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Events
Touch Press Event
bauds=115200
// startup event
tSend.txt="event,startup,"+tVersion.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 : 16
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 87
y coordinate : 33
Width : 288
Height : 187
Effect : load
Effect Priority : 0
Effect Time : 300
Events
Touch Press Event
sys2=sys2+1
sys2%=10
//n0.val=sys2
if(sys2==9)
{
page pageTest
}
Timer tmSerial
Attributes
ID : 4
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=="time")
{
// get set time to global variable
spstr strCommand.txt,screensaver.vaTime.txt,",",1
}
if(tInstruction.txt=="date")
{
// get set date to global variable
spstr strCommand.txt,screensaver.vaDate.txt,"?",1
}
if(tInstruction.txt=="dimmode")
{
// get value
spstr strCommand.txt,tTmp.txt,",",1
covx tTmp.txt,dimValue,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
//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=="cardThermo")
{
page cardThermo
}
if(tId.txt=="popupLight")
{
pageIcons.tTmp1.txt=tTmp.txt
page popupLight
}
if(tId.txt=="cardEntities")
{
page cardEntities
}
if(tId.txt=="pageStartup")
{
page pageStartup
}
if(tId.txt=="pageNotify")
{
page popupNotify
}
}
// end of user code
udelete payloadLength-1
bufferPos=0
}
}
}
}
// next character
bufferPos++
}
if(bufferPos==usize)
{
// copy whole buffer to t1.txt, for debugging
//ucopy t2.txt,0,usize,0
// ucopy n2.val,0,usize,0
// clear whole buffer
//code_c
//bufferPos=0
}
}
Timer tmSpinner
Attributes
ID : 9
Scope : local
Period (ms): 80
Enabled : yes
Events
Timer Event
xpic 154,49,spinner_w.val,140,frame_ptr.val,0,11 // draw the current frame
frame_ptr.val+=spinner_w.val%frapic_w.val // advance the pointer to the next frame in the pic resource and roll over at the end
doevents // finish drawing before next timer event triggers
if(frame_ptr.val==1820)
{
usual_cnt.val+=1
sys0=usual_cnt.val%5
if(sys0==0)
{
// retry sending startup messages by clicking button
click bSendStartup,1
}
}
if(usual_cnt.val==10)
{
vis tMsg2,1
vis tMsg3,1
}

View File

@@ -0,0 +1,573 @@
Page pageSwipeTest
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 : 65535
Number nXS
Attributes
ID : 7
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 130
y coordinate : 20
Width : 100
Height : 30
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 5
Back. Color : 65535
Font Color : 0
Horizontal Alignment : center
Vertical Alignment : center
Value : 0
Significant digits shown : all
Format : decimal
Word wrap : enabled
Horizontal Spacing : 0
Vertical Spacing : 0
Number nYE
Attributes
ID : 8
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 128
y coordinate : 111
Width : 100
Height : 30
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 5
Back. Color : 65535
Font Color : 0
Horizontal Alignment : center
Vertical Alignment : center
Value : 0
Significant digits shown : all
Format : decimal
Word wrap : enabled
Horizontal Spacing : 0
Vertical Spacing : 0
Number nYS
Attributes
ID : 9
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 134
y coordinate : 77
Width : 100
Height : 30
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 5
Back. Color : 65535
Font Color : 0
Horizontal Alignment : center
Vertical Alignment : center
Value : 0
Significant digits shown : all
Format : decimal
Word wrap : enabled
Horizontal Spacing : 0
Vertical Spacing : 0
Number nXE
Attributes
ID : 10
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 132
y coordinate : 48
Width : 100
Height : 30
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 5
Back. Color : 65535
Font Color : 0
Horizontal Alignment : center
Vertical Alignment : center
Value : 0
Significant digits shown : all
Format : decimal
Word wrap : enabled
Horizontal Spacing : 0
Vertical Spacing : 0
Number nYR
Attributes
ID : 12
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 315
y coordinate : 101
Width : 100
Height : 30
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 5
Back. Color : 65535
Font Color : 0
Horizontal Alignment : center
Vertical Alignment : center
Value : 0
Significant digits shown : all
Format : decimal
Word wrap : enabled
Horizontal Spacing : 0
Vertical Spacing : 0
Number nXR
Attributes
ID : 13
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 315
y coordinate : 73
Width : 100
Height : 30
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 5
Back. Color : 65535
Font Color : 0
Horizontal Alignment : center
Vertical Alignment : center
Value : 0
Significant digits shown : all
Format : decimal
Word wrap : enabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text tDesc1
Attributes
ID : 2
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 4
y coordinate : 2
Width : 152
Height : 164
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 5
Back. Color : 65535
Font Color : 0
Horizontal Alignment : center
Vertical Alignment : center
Input Type : character
Text : X-Start:\r\nX-End:\r\nY-Start:\r\nY-End:
Max. Text Size : 70
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text t2
Attributes
ID : 3
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 4
y coordinate : 152
Width : 152
Height : 62
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 5
Back. Color : 65535
Font Color : 0
Horizontal Alignment : center
Vertical Alignment : center
Input Type : character
Text : Swipe Dir\r\nold:
Max. Text Size : 70
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text tDirection
Attributes
ID : 6
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 93
y coordinate : 183
Width : 100
Height : 29
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 5
Back. Color : 65535
Font Color : 0
Horizontal Alignment : center
Vertical Alignment : center
Input Type : character
Text : newtxt
Max. Text Size : 10
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text t0
Attributes
ID : 11
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 259
y coordinate : 5
Width : 171
Height : 129
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 5
Back. Color : 65535
Font Color : 0
Horizontal Alignment : center
Vertical Alignment : center
Input Type : character
Text : Difference\r\n\r\nX\r\nY
Max. Text Size : 60
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text tStatusNew
Attributes
ID : 14
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 216
y coordinate : 240
Width : 162
Height : 33
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 5
Back. Color : 65535
Font Color : 0
Horizontal Alignment : center
Vertical Alignment : center
Input Type : character
Text : newtxt
Max. Text Size : 40
Word wrap : enabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text t3
Attributes
ID : 15
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 9
y coordinate : 242
Width : 203
Height : 65
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 5
Back. Color : 65535
Font Color : 0
Horizontal Alignment : center
Vertical Alignment : center
Input Type : character
Text : new status:\r\nnew direction:
Max. Text Size : 50
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text tDirNew
Attributes
ID : 16
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 218
y coordinate : 272
Width : 162
Height : 33
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 5
Back. Color : 65535
Font Color : 0
Horizontal Alignment : center
Vertical Alignment : center
Input Type : character
Text : newtxt
Max. Text Size : 40
Word wrap : enabled
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 : 479
Height : 319
Effect : load
Effect Priority : 0
Effect Time : 300
Picture ID : 0
Button b8
Attributes
ID : 17
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 326
y coordinate : 158
Width : 107
Height : 50
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : 3D auto
Font ID : 5
Back. Color : 50712
Back. Picture ID (Pressed) : 65535
Back. Color (Pressed) : 1024
Font Color (Unpressed) : 0
Font Color (Pressed) : 65535
Horizontal Alignment : center
Vertical Alignment : center
State : unpressed
Text : back
Max. Text Size : 10
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Events
Touch Press Event
page pageTest
Timer tm0
Attributes
ID : 5
Scope : local
Period (ms): 50
Enabled : yes
Events
Timer Event
if(tc0.val!=0)
{
xc2=tch0
yc2=tch1
//debug
nXE.val=xc2
nYE.val=yc2
}
TouchCap tc0
Attributes
ID : 4
Scope: local
Value: 0
Events
Touch Press Event
if(tc0.val==9) // This is the location of the brightness slider
{
xc1=0
yc1=0
}else
{
xc1=tch0
yc1=tch1
//debug
nXS.val=xc1
nYS.val=yc1
tm0.en=1
}
Touch Release Event
tm0.en=0
if(tc0.val==9) // This is the location of the brightness slider
{
}else
{
if(tch0==0)
// When this is zero we can interpret that as the real end of the drag event
{
xcR=xc1-xc2
ycR=yc1-yc2
// //debug
// nXR.val=xcR
// nYR.val=ycR
// if(xcR>125)
// {
// 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&&xcR<xLimit)
{
tStatusNew.txt="x low, -> y"
// check if below minimum value (change is negative)
if(ycR<iyLimitMin)
{
tDirNew.txt="down"
}else if(ycR>yLimitMin)
{
tDirNew.txt="up"
}else
{
tDirNew.txt="invalid"
}
// y difference between -125 and 125 (swipe on x-axis)
}else if(ycR>iyLimit&&ycR<yLimit)
{
tStatusNew.txt="y low, -> x"
if(xcR<ixLimitMin)
{
tDirNew.txt="right"
}else if(xcR>xLimitMin)
{
tDirNew.txt="left"
}else
{
tDirNew.txt="invalid"
}
//diagonal swipe invalid
}else
{
tStatusNew.txt="invalid"
tDirNew.txt="diagonal"
}
}
}

402
HMI/n2t-out/pageTest.txt Normal file
View File

@@ -0,0 +1,402 @@
Page pageTest
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 : 4226
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
Opacity : 127
x coordinate : 0
y coordinate : 0
Width : 479
Height : 319
Effect : load
Effect Priority : 0
Effect Time : 300
Picture ID : 0
Button b0
Attributes
ID : 2
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 5
y coordinate : 12
Width : 100
Height : 50
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : 3D auto
Font ID : 5
Back. Color : 50712
Back. Picture ID (Pressed) : 65535
Back. Color (Pressed) : 1024
Font Color (Unpressed) : 0
Font Color (Pressed) : 65535
Horizontal Alignment : center
Vertical Alignment : center
State : unpressed
Text : entities
Max. Text Size : 10
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
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
Opacity : 127
x coordinate : 347
y coordinate : 262
Width : 100
Height : 50
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : 3D auto
Font ID : 5
Back. Color : 50712
Back. Picture ID (Pressed) : 65535
Back. Color (Pressed) : 1024
Font Color (Unpressed) : 0
Font Color (Pressed) : 65535
Horizontal Alignment : center
Vertical Alignment : center
State : unpressed
Text : serial
Max. Text Size : 10
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
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
Opacity : 127
x coordinate : 7
y coordinate : 265
Width : 100
Height : 50
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : 3D auto
Font ID : 5
Back. Color : 50712
Back. Picture ID (Pressed) : 65535
Back. Color (Pressed) : 1024
Font Color (Unpressed) : 0
Font Color (Pressed) : 65535
Horizontal Alignment : center
Vertical Alignment : center
State : unpressed
Text : swipe
Max. Text Size : 10
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
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
Opacity : 127
x coordinate : 345
y coordinate : 195
Width : 102
Height : 63
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : 3D auto
Font ID : 5
Back. Color : 50712
Back. Picture ID (Pressed) : 0
Back. Color (Pressed) : 1024
Font Color (Unpressed) : 0
Font Color (Pressed) : 65535
Horizontal Alignment : center
Vertical Alignment : center
State : unpressed
Text : disable recmod
Max. Text Size : 20
Word wrap : enabled
Horizontal Spacing : 0
Vertical Spacing : 0
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
Opacity : 127
x coordinate : 5
y coordinate : 64
Width : 100
Height : 50
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : 3D auto
Font ID : 5
Back. Color : 50712
Back. Picture ID (Pressed) : 65535
Back. Color (Pressed) : 1024
Font Color (Unpressed) : 0
Font Color (Pressed) : 65535
Horizontal Alignment : center
Vertical Alignment : center
State : unpressed
Text : shutter
Max. Text Size : 10
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
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
Opacity : 127
x coordinate : 7
y coordinate : 120
Width : 100
Height : 50
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : 3D auto
Font ID : 5
Back. Color : 50712
Back. Picture ID (Pressed) : 65535
Back. Color (Pressed) : 1024
Font Color (Unpressed) : 0
Font Color (Pressed) : 65535
Horizontal Alignment : center
Vertical Alignment : center
State : unpressed
Text : light
Max. Text Size : 10
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
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
Opacity : 127
x coordinate : 111
y coordinate : 12
Width : 100
Height : 50
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : 3D auto
Font ID : 5
Back. Color : 50712
Back. Picture ID (Pressed) : 65535
Back. Color (Pressed) : 1024
Font Color (Unpressed) : 0
Font Color (Pressed) : 65535
Horizontal Alignment : center
Vertical Alignment : center
State : unpressed
Text : thermo
Max. Text Size : 10
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
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
Opacity : 127
x coordinate : 113
y coordinate : 72
Width : 100
Height : 50
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : 3D auto
Font ID : 5
Back. Color : 50712
Back. Picture ID (Pressed) : 65535
Back. Color (Pressed) : 1024
Font Color (Unpressed) : 0
Font Color (Pressed) : 65535
Horizontal Alignment : center
Vertical Alignment : center
State : unpressed
Text : media
Max. Text Size : 10
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
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
Opacity : 127
x coordinate : 341
y coordinate : 9
Width : 106
Height : 50
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : 3D auto
Font ID : 5
Back. Color : 50712
Back. Picture ID (Pressed) : 65535
Back. Color (Pressed) : 1024
Font Color (Unpressed) : 0
Font Color (Pressed) : 65535
Horizontal Alignment : center
Vertical Alignment : center
State : unpressed
Text : screens
Max. Text Size : 10
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
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
Opacity : 127
x coordinate : 6
y coordinate : 175
Width : 100
Height : 50
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : 3D auto
Font ID : 5
Back. Color : 50712
Back. Picture ID (Pressed) : 65535
Back. Color (Pressed) : 1024
Font Color (Unpressed) : 0
Font Color (Pressed) : 65535
Horizontal Alignment : center
Vertical Alignment : center
State : unpressed
Text : notify
Max. Text Size : 10
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Events
Touch Press Event
page popupNotify

952
HMI/n2t-out/popupLight.txt Normal file
View File

@@ -0,0 +1,952 @@
Page popupLight
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
//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: 1
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
Opacity : 127
x coordinate : 63
y coordinate : 37
Width : 263
Height : 30
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 0
Back. Color : 6371
Font Color : 65535
Horizontal Alignment : left
Vertical Alignment : center
Input Type : character
Text : tEntity1
Max. Text Size : 25
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text tIcon1
Attributes
ID : 4
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 10
y coordinate : 38
Width : 45
Height : 30
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 1
Back. Color : 6371
Font Color : 17299
Horizontal Alignment : center
Vertical Alignment : center
Input Type : character
Text : 
Max. Text Size : 10
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text t1
Attributes
ID : 6
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 10
y coordinate : 133
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 : 6371
Font Color : 65535
Horizontal Alignment : center
Vertical Alignment : center
Input Type : character
Text : Brightness
Max. Text Size : 15
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text t2
Attributes
ID : 9
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 10
y coordinate : 173
Width : 45
Height : 30
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 1
Back. Color : 6371
Font Color : 40147
Horizontal Alignment : center
Vertical Alignment : center
Input Type : character
Text : 
Max. Text Size : 10
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text t3
Attributes
ID : 10
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 10
y coordinate : 251
Width : 45
Height : 30
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 1
Back. Color : 6371
Font Color : 40147
Horizontal Alignment : center
Vertical Alignment : center
Input Type : character
Text : 
Max. Text Size : 10
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text t4
Attributes
ID : 11
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 9
y coordinate : 213
Width : 116
Height : 30
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 0
Back. Color : 6371
Font Color : 65535
Horizontal Alignment : center
Vertical Alignment : center
Input Type : character
Text : Temperature
Max. Text Size : 15
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text tSend
Attributes
ID : 12
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 0
y coordinate : 0
Width : 348
Height : 22
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 : newtxt
Max. Text Size : 100
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text tTmp
Attributes
ID : 13
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 406
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 : 18
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 0
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 tItem
Attributes
ID : 19
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 100
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 t0
Attributes
ID : 26
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 76
y coordinate : 89
Width : 64
Height : 30
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 0
Back. Color : 6371
Font Color : 65535
Horizontal Alignment : center
Vertical Alignment : center
Input Type : character
Text : Color
Max. Text Size : 15
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
Picture pColorWheel
Attributes
ID : 2
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 142
y coordinate : 87
Width : 213
Height : 213
Effect : load
Effect Priority : 0
Effect Time : 300
Picture ID : 3
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
Opacity : 127
x coordinate : 61
y coordinate : 167
Width : 335
Height : 43
Effect : load
Effect Priority : 0
Effect Time : 300
Direction : horizontal
Fill : image
Cursor width : auto
Cursor height : 255
Back. Picture ID : 5
Slided Back. Picture ID : 4
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
Opacity : 127
x coordinate : 61
y coordinate : 248
Width : 335
Height : 44
Effect : load
Effect Priority : 0
Effect Time : 300
Direction : horizontal
Fill : image
Cursor width : auto
Cursor height : 255
Back. Picture ID : 8
Slided Back. Picture ID : 10
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
Opacity : 127
x coordinate : 397
y coordinate : 8
Width : 50
Height : 50
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Font ID : 1
Back. Color : 6371
Back. Picture ID (Pressed) : 65535
Back. Color (Pressed) : 6371
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
page cardEntities
Button bColor
Attributes
ID : 22
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 9
y coordinate : 78
Width : 50
Height : 50
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Font ID : 1
Back. Color : 6371
Back. Picture ID (Pressed) : 65535
Back. Color (Pressed) : 6371
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
if(mode.val==1)
{
mode.val=0
//enable color wheel
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=1
//disable color wheel
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
Opacity : 127
x coordinate : 370
y coordinate : 75
Width : 50
Height : 50
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : image
Font ID : 0
Background Picture ID (Unpressed) : 1
Back. Picture ID (Pressed) : 2
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,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(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=="entityUpdateDetail")
{
// get Button State
spstr strCommand.txt,tTmp.txt,",",1
covx tTmp.txt,sys0,0,0
btOnOff1.val=sys0
if(mode.val==1)
{
// get Brightness value
spstr strCommand.txt,tTmp.txt,",",2
if(tTmp.txt=="disable")
{
vis t1,0
vis t2,0
vis hBrightness,0
mode_bright.val=0
}else
{
vis t1,1
vis t2,1
vis hBrightness,1
mode_bright.val=1
covx tTmp.txt,sys0,0,0
hBrightness.val=sys0
}
// get ColorTemp value
spstr strCommand.txt,tTmp.txt,",",3
if(tTmp.txt=="disable")
{
vis t4,0
vis t3,0
vis hTempSlider,0
mode_temp.val=0
}else
{
vis t4,1
vis t3,1
vis hTempSlider,1
mode_temp.val=1
covx tTmp.txt,sys0,0,0
hTempSlider.val=sys0
}
}
// get ColorWheel value
spstr strCommand.txt,tTmp.txt,",",4
if(tTmp.txt!="disable")
{
vis bColor,1
}
}
if(tInstruction.txt=="time")
{
// get set time to global variable
spstr strCommand.txt,screensaver.vaTime.txt,",",1
}
if(tInstruction.txt=="date")
{
// get set date to global variable
spstr strCommand.txt,screensaver.vaDate.txt,"?",1
}
if(tInstruction.txt=="dimmode")
{
// get value
spstr strCommand.txt,tTmp.txt,",",1
covx tTmp.txt,dimValue,0,0
dim=dimValue
}
if(tInstruction.txt=="timeout")
{
//set timeout to global var
spstr strCommand.txt,tTmp.txt,",",1
covx tTmp.txt,sleepTimeout,0,0
}
// end of user code
udelete payloadLength-1
bufferPos=0
}
}
}
}
// next character
bufferPos++
}
if(bufferPos==usize)
{
// copy whole buffer to t1.txt, for debugging
//ucopy t2.txt,0,usize,0
// ucopy n2.val,0,usize,0
// clear whole buffer
//code_c
//bufferPos=0
}
}
TouchCap tc0
Attributes
ID : 14
Scope: local
Value: 0
Events
Touch Press Event
sleepValue=0

554
HMI/n2t-out/popupNotify.txt Normal file
View File

@@ -0,0 +1,554 @@
Page popupNotify
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
vis p0,0
vis tSend,0
vis tTmp,0
vis tInstruction,0
vis tId,0
//page open event
// event,pageOpenDetail,typeOfPage,tEntityName
// craft command
tSend.txt="event,pageOpenDetail,notify"
//send calc crc
btlen tSend.txt,sys0
crcrest 1,0xffff // reset CRC
crcputh 55 bb
crcputs sys0,1
crcputs tSend.txt,0
//send cmd
printh 55 bb
prints sys0,2
prints tSend.txt,0
prints crcval,2
Variable (string) strCommand
Attributes
ID : 8
Scope : local
Text :
Max. Text Size: 500
Text tSend
Attributes
ID : 3
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 0
y coordinate : 0
Width : 348
Height : 22
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 : newtxt
Max. Text Size : 100
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text tTmp
Attributes
ID : 4
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 406
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 : 9
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 0
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 : 10
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 100
y coordinate : 290
Width : 100
Height : 29
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 tHeading
Attributes
ID : 11
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 23
y coordinate : 26
Width : 345
Height : 30
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 1
Back. Color : 6371
Font Color : 65535
Horizontal Alignment : left
Vertical Alignment : center
Input Type : character
Text :
Max. Text Size : 40
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text tText
Attributes
ID : 12
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 23
y coordinate : 74
Width : 397
Height : 171
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 0
Back. Color : 6371
Font Color : 65535
Horizontal Alignment : left
Vertical Alignment : top
Input Type : character
Text :
Max. Text Size : 300
Word wrap : enabled
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 b0
Attributes
ID : 2
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 397
y coordinate : 8
Width : 50
Height : 50
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Font ID : 1
Back. Color : 6371
Back. Picture ID (Pressed) : 65535
Back. Color (Pressed) : 6371
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
page cardEntities
Button b2
Attributes
ID : 13
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 239
y coordinate : 261
Width : 182
Height : 50
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Font ID : 1
Back. Color : 6371
Back. Picture ID (Pressed) : 9
Back. Color (Pressed) : 1024
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
//craft command
tSend.txt="event,buttonPress,D,D,D,1,notifyAction,yes"
//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 b1
Attributes
ID : 14
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 24
y coordinate : 261
Width : 182
Height : 50
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Font ID : 1
Back. Color : 6371
Back. Picture ID (Pressed) : 9
Back. Color (Pressed) : 1024
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
//craft command
tSend.txt="event,buttonPress,D,D,D,1,notifyAction,no"
//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 : 6
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 : 7
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=="entityUpdateDetail")
{
// get Heading
spstr strCommand.txt,tHeading.txt,",",1
// get b1
spstr strCommand.txt,b1.txt,",",2
// get b2
spstr strCommand.txt,b2.txt,",",3
// get tText
spstr strCommand.txt,tText.txt,",",4
}
if(tInstruction.txt=="time")
{
// get set time to global variable
spstr strCommand.txt,screensaver.vaTime.txt,",",1
}
if(tInstruction.txt=="date")
{
// get set date to global variable
spstr strCommand.txt,screensaver.vaDate.txt,"?",1
}
if(tInstruction.txt=="dimmode")
{
// get value
spstr strCommand.txt,tTmp.txt,",",1
covx tTmp.txt,dimValue,0,0
dim=dimValue
}
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
if(tId.txt=="pageNotify")
{
//yay, we are already on the correct page
}else
{
//we are going to exit this page with this command, so we have to clear the buffer, so we are not getting into a stupid loop ...
udelete payloadLength-1
bufferPos=0
}
if(tId.txt=="popupLight")
{
pageIcons.tTmp1.txt=tTmp.txt
page popupLight
}
if(tId.txt=="cardEntities")
{
page cardEntities
}
if(tId.txt=="cardMedia")
{
page cardMedia
}
if(tId.txt=="pageStartup")
{
page pageStartup
}
if(tId.txt=="pageThermo")
{
page cardThermo
}
}
// end of user code
udelete payloadLength-1
bufferPos=0
}
}
}
}
// next character
bufferPos++
}
if(bufferPos==usize)
{
// copy whole buffer to t1.txt, for debugging
//ucopy t2.txt,0,usize,0
// ucopy n2.val,0,usize,0
// clear whole buffer
//code_c
//bufferPos=0
}
}
TouchCap tc0
Attributes
ID : 5
Scope: local
Value: 0
Events
Touch Press Event
sleepValue=0

View File

@@ -0,0 +1,666 @@
Page popupShutter
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
//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,popupShutter,"+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
Variable (string) strCommand
Attributes
ID : 10
Scope : local
Text :
Max. Text Size: 50
Variable (string) entn
Attributes
ID : 18
Scope : local
Text : newtxt
Max. Text Size: 50
Text tEntity
Attributes
ID : 2
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 65
y coordinate : 108
Width : 195
Height : 30
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 0
Back. Color : 6371
Font Color : 65535
Horizontal Alignment : left
Vertical Alignment : center
Input Type : character
Text : tEntity1
Max. Text Size : 25
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text tIcon1
Attributes
ID : 3
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 12
y coordinate : 109
Width : 45
Height : 30
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 1
Back. Color : 6371
Font Color : 17299
Horizontal Alignment : center
Vertical Alignment : center
Input Type : character
Text : 
Max. Text Size : 10
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text tSend
Attributes
ID : 5
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 0
y coordinate : 0
Width : 348
Height : 22
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 : newtxt
Max. Text Size : 100
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text tTmp
Attributes
ID : 6
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 406
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 : 11
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 0
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 tItem
Attributes
ID : 12
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 100
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 t1
Attributes
ID : 17
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 64
y coordinate : 164
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 : 6371
Font Color : 65535
Horizontal Alignment : center
Vertical Alignment : center
Input Type : character
Text : Position
Max. Text Size : 15
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
Slider hPosition
Attributes
ID : 16
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 65
y coordinate : 194
Width : 335
Height : 43
Effect : load
Effect Priority : 0
Effect Time : 300
Direction : horizontal
Fill : image
Cursor width : auto
Cursor height : 255
Back. Picture ID : 5
Slided Back. Picture ID : 4
Position : 50
Upper range limit : 100
Lower range limit : 0
Events
Touch Release Event
// event,buttonPress,D,nameEntity,internalNameEntity,1,positionSlider,50
//craft command
tSend.txt="event,buttonPress,D,"
tSend.txt+=tEntity.txt+","
tSend.txt+=entn.txt+","
tSend.txt+="1,positionSlider,"
covx hPosition.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 : 4
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 397
y coordinate : 8
Width : 50
Height : 50
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Font ID : 1
Back. Color : 6371
Back. Picture ID (Pressed) : 65535
Back. Color (Pressed) : 6371
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
page cardEntities
Button bDown1
Attributes
ID : 13
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 393
y coordinate : 96
Width : 50
Height : 50
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Font ID : 1
Back. Color : 6371
Back. Picture ID (Pressed) : 65535
Back. Color (Pressed) : 1024
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
// 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+=tEntity.txt+","
tSend.txt+=entn.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 bStop1
Attributes
ID : 14
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 341
y coordinate : 96
Width : 50
Height : 50
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Font ID : 1
Back. Color : 6371
Back. Picture ID (Pressed) : 65535
Back. Color (Pressed) : 1024
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
// 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+=tEntity.txt+","
tSend.txt+=entn.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 bUp1
Attributes
ID : 15
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 289
y coordinate : 96
Width : 50
Height : 50
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Font ID : 1
Back. Color : 6371
Back. Picture ID (Pressed) : 65535
Back. Color (Pressed) : 1024
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
// 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+=tEntity.txt+","
tSend.txt+=entn.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
Timer tmSleep
Attributes
ID : 8
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 : 9
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=="entityUpdateDetail")
{
// get Position value
spstr strCommand.txt,tTmp.txt,",",1
covx tTmp.txt,sys0,0,0
hPosition.val=sys0
}
if(tInstruction.txt=="dimmode")
{
// get value
spstr strCommand.txt,tTmp.txt,",",1
covx tTmp.txt,dimValue,0,0
dim=dimValue
}
if(tInstruction.txt=="time")
{
// get set time to global variable
spstr strCommand.txt,screensaver.vaTime.txt,",",1
}
if(tInstruction.txt=="date")
{
// get set date to global variable
spstr strCommand.txt,screensaver.vaDate.txt,"?",1
}
if(tInstruction.txt=="timeout")
{
//set timeout to global var
spstr strCommand.txt,tTmp.txt,",",1
covx tTmp.txt,sleepTimeout,0,0
}
// end of user code
udelete payloadLength-1
bufferPos=0
}
}
}
}
// next character
bufferPos++
}
if(bufferPos==usize)
{
// copy whole buffer to t1.txt, for debugging
//ucopy t2.txt,0,usize,0
// ucopy n2.val,0,usize,0
// clear whole buffer
//code_c
//bufferPos=0
}
}
TouchCap tc0
Attributes
ID : 7
Scope: local
Value: 0
Events
Touch Press Event
sleepValue=0

786
HMI/n2t-out/screensaver.txt Normal file
View File

@@ -0,0 +1,786 @@
Page screensaver
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 : 0
Events
Preinitialize Event
recmod=1
bauds=115200
vis originPage,0
vis tInstruction,0
vis tTmp,0
vis p0,0
//load gloabl time string from pageIcons
tTime.txt=vaTime.txt
tDate.txt=vaDate.txt
dim=dimValue
vis tSend,0
//page open event
// craft command
tSend.txt="event,screensaverOpen"
//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
// clear weather elements, to keep example content in HMI
tMainIcon.txt=""
tMainText.txt=""
tMRIcon.txt=""
tMR.txt=""
tForecast1.txt=""
tF1Icon.txt=""
tForecast1Val.txt=""
tForecast2.txt=""
tF2Icon.txt=""
tForecast2Val.txt=""
Variable (string) strCommand
Attributes
ID : 5
Scope : local
Text :
Max. Text Size: 100
Variable (string) vaTime
Attributes
ID : 10
Scope : global
Text :
Max. Text Size: 10
Variable (string) vaDate
Attributes
ID : 11
Scope : global
Text :
Max. Text Size: 30
Variable (string) tId
Attributes
ID : 24
Scope : local
Text :
Max. Text Size: 25
Number originPage
Attributes
ID : 3
Scope : global
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 452
y coordinate : 267
Width : 24
Height : 49
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
Value : 0
Significant digits shown : all
Format : decimal
Word wrap : enabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text tInstruction
Attributes
ID : 6
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 450
y coordinate : 186
Width : 27
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 tTmp
Attributes
ID : 7
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 451
y coordinate : 228
Width : 25
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 tTime
Attributes
ID : 8
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 0
y coordinate : 0
Width : 451
Height : 150
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 6
Back. Color : 0
Font Color : 65535
Horizontal Alignment : center
Vertical Alignment : center
Input Type : character
Text : 21:32
Max. Text Size : 10
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text tDate
Attributes
ID : 9
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 0
y coordinate : 150
Width : 451
Height : 38
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 1
Back. Color : 0
Font Color : 65535
Horizontal Alignment : center
Vertical Alignment : center
Input Type : character
Text : Tuesday, 08. March 2022
Max. Text Size : 30
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text tSend
Attributes
ID : 12
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 451
y coordinate : 9
Width : 29
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 : 25
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text tMainIcon
Attributes
ID : 13
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 6
y coordinate : 223
Width : 100
Height : 66
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 4
Back. Color : 0
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
Text tMainText
Attributes
ID : 14
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 114
y coordinate : 214
Width : 110
Height : 43
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 2
Back. Color : 0
Font Color : 65535
Horizontal Alignment : center
Vertical Alignment : center
Input Type : character
Text : 2,3 °C
Max. Text Size : 10
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text tMRIcon
Attributes
ID : 15
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 115
y coordinate : 268
Width : 40
Height : 35
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 1
Back. Color : 0
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
Text tMR
Attributes
ID : 16
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 157
y coordinate : 275
Width : 67
Height : 22
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 0
Back. Color : 0
Font Color : 65535
Horizontal Alignment : center
Vertical Alignment : center
Input Type : character
Text : 0 mm
Max. Text Size : 10
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text tForecast1
Attributes
ID : 17
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 228
y coordinate : 210
Width : 108
Height : 26
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 0
Back. Color : 0
Font Color : 65535
Horizontal Alignment : center
Vertical Alignment : center
Input Type : character
Text : Mi
Max. Text Size : 10
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text tForecast1Val
Attributes
ID : 18
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 228
y coordinate : 277
Width : 108
Height : 26
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 0
Back. Color : 0
Font Color : 65535
Horizontal Alignment : center
Vertical Alignment : center
Input Type : character
Text : 9,3 °C
Max. Text Size : 10
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text tF1Icon
Attributes
ID : 19
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 262
y coordinate : 239
Width : 40
Height : 35
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 1
Back. Color : 0
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
Text tForecast2
Attributes
ID : 20
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 341
y coordinate : 210
Width : 107
Height : 25
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 0
Back. Color : 0
Font Color : 65535
Horizontal Alignment : center
Vertical Alignment : center
Input Type : character
Text : Do
Max. Text Size : 10
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text tF2Icon
Attributes
ID : 21
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 375
y coordinate : 238
Width : 40
Height : 33
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 1
Back. Color : 0
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
Text tForecast2Val
Attributes
ID : 22
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 341
y coordinate : 277
Width : 107
Height : 25
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 0
Back. Color : 0
Font Color : 65535
Horizontal Alignment : center
Vertical Alignment : center
Input Type : character
Text : 11,9 °C
Max. Text Size : 10
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text t10
Attributes
ID : 23
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 46
y coordinate : 195
Width : 360
Height : 2
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
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 : 1
Width : 479
Height : 319
Effect : load
Effect Priority : 0
Effect Time : 300
Picture ID : 0
Timer tmSerial
Attributes
ID : 4
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=="wake")
{
dim=100
page originPage.val
}
if(tInstruction.txt=="dimmode")
{
// get value
spstr strCommand.txt,tTmp.txt,",",1
covx tTmp.txt,dimValue,0,0
dim=dimValue
}
if(tInstruction.txt=="time")
{
//get set time to global variable
spstr strCommand.txt,vaTime.txt,",",1
tTime.txt=vaTime.txt
}
if(tInstruction.txt=="date")
{
//get set date to global variable
spstr strCommand.txt,vaDate.txt,"?",1
tDate.txt=vaDate.txt
}
if(tInstruction.txt=="timeout")
{
//set timeout to global var
spstr strCommand.txt,tTmp.txt,",",1
covx tTmp.txt,sleepTimeout,0,0
}
if(tInstruction.txt=="weatherUpdate")
{
//tMainIcon
spstr strCommand.txt,tTmp.txt,"?",1
covx tTmp.txt,sys0,0,0
substr pageIcons.tIcons.txt,tMainIcon.txt,sys0,1
//tMainText
spstr strCommand.txt,tMainText.txt,"?",2
//tMRIcon
spstr strCommand.txt,tTmp.txt,"?",3
covx tTmp.txt,sys0,0,0
substr pageIcons.tIcons.txt,tMRIcon.txt,sys0,1
//tMR
spstr strCommand.txt,tMR.txt,"?",4
//tForecast1
spstr strCommand.txt,tForecast1.txt,"?",5
//tF1Icon
spstr strCommand.txt,tTmp.txt,"?",6
covx tTmp.txt,sys0,0,0
substr pageIcons.tIcons.txt,tF1Icon.txt,sys0,1
//tForecast1Val
spstr strCommand.txt,tForecast1Val.txt,"?",7
//tForecast2
spstr strCommand.txt,tForecast2.txt,"?",8
//tF2Icon
spstr strCommand.txt,tTmp.txt,"?",9
covx tTmp.txt,sys0,0,0
substr pageIcons.tIcons.txt,tF2Icon.txt,sys0,1
//tForecast2Val
spstr strCommand.txt,tForecast2Val.txt,"?",10
}
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
//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 u[2]+3
bufferPos=0
if(tId.txt=="popupLight")
{
pageIcons.tTmp1.txt=tTmp.txt
page popupLight
}
if(tId.txt=="pageStartup")
{
page pageStartup
}
if(tId.txt=="cardThermo")
{
page cardThermo
}
if(tId.txt=="cardMedia")
{
page cardMedia
}
if(tId.txt=="pageStartup")
{
page pageStartup
}
if(tId.txt=="pageNotify")
{
page popupNotify
}
}
// end of user code
udelete payloadLength-1
bufferPos=0
}
}
}
}
// next character
bufferPos++
}
}
TouchCap tc0
Attributes
ID : 2
Scope: local
Value: 0
Events
Touch Press Event
dim=100
page originPage.val

Binary file not shown.

Binary file not shown.

View File

@@ -21,7 +21,6 @@ To control the panel and update it with content from HomeAssistant there is an [
See the following picture to get an idea of the look of this firmware for NSPanel. See the following picture to get an idea of the look of this firmware for NSPanel.
![screens](doc-pics/screens.png) ![screens](doc-pics/screens.png)
![screensaver](doc-pics/screensaver.png)
## TLDR ## TLDR
1. Install Tasmota to NSPanel 1. Install Tasmota to NSPanel
@@ -53,6 +52,7 @@ For more detailed Instructions see the following Sections:
- [Configuration](#configuration) - [Configuration](#configuration)
- [Configuring the MQTT integration in AppDaemon](#configuring-the-mqtt-integration-in-appdaemon) - [Configuring the MQTT integration in AppDaemon](#configuring-the-mqtt-integration-in-appdaemon)
- [Configure your NSPanel in AppDaemon](#configure-your-nspanel-in-appdaemon) - [Configure your NSPanel in AppDaemon](#configure-your-nspanel-in-appdaemon)
- [How to update](#how-to-update)
- [FAQ](#faq---frequently-asked-questions) - [FAQ](#faq---frequently-asked-questions)
@@ -117,12 +117,12 @@ AppDaemon automations in HACS, as these are not enabled by default:
then require you to wait a few hours for HACS to be fully configured. In this case, then require you to wait a few hours for HACS to be fully configured. In this case,
you won't be able to proceed to the next steps until HACS is ready. you won't be able to proceed to the next steps until HACS is ready.
Now, to install NSPanel Lovelance UI Backend with HACS, follow these steps: Now, to install NSPanel Lovelace UI Backend with HACS, follow these steps:
1. Click on `HACS` on the left menu bar in Home Assistant Web UI 1. Click on `HACS` on the left menu bar in Home Assistant Web UI
2. Click on `Automations` in the right panel 2. Click on `Automations` in the right panel
3. Click on `Explore & download repositories` in the bottom right corner 3. Click on `Explore & download repositories` in the bottom right corner
4. Search for `NSPanel`, and click on `NSPanel Lovelance UI Backend` in the list that appears 4. Search for `NSPanel`, and click on `NSPanel Lovelace UI Backend` in the list that appears
5. In the bottom right corner of the panel that appears, click on 5. In the bottom right corner of the panel that appears, click on
`Download this repository with HACS` `Download this repository with HACS`
6. A confirmation panel will appear, click on `Download`, and wait for HACS to 6. A confirmation panel will appear, click on `Download`, and wait for HACS to
@@ -132,7 +132,7 @@ Now, to install NSPanel Lovelance UI Backend with HACS, follow these steps:
#### Manually #### Manually
Installing the Backend Application manually can be summarized by putting the content of the Installing the Backend Application manually can be summarized by putting the content of the
`apps/` directory of this repository (the `nspanel-lovelance-ui/` directory) into the `apps/` `apps/` directory of this repository (the `nspanel-lovelace-ui/` directory) into the `apps/`
directory of your AppDaemon installation. directory of your AppDaemon installation.
@@ -167,7 +167,7 @@ See Tasmota [MQTT Documentation](https://tasmota.github.io/docs/MQTT/) for more
### Upload Berry Driver to Tasmota ### Upload Berry Driver to Tasmota
1. Download the [Berry Driver from this Repository](tasmota/autoexec.be). 1. Download the autoexec.be berry driver from the latest release. (Development Version [Berry Driver from this Repository](tasmota/autoexec.be))
2. Go to `Consoles` > `Manage File System` in Tasmota and upload the previously downloaded file. 2. Go to `Consoles` > `Manage File System` in Tasmota and upload the previously downloaded file.
@@ -177,7 +177,7 @@ See Tasmota [MQTT Documentation](https://tasmota.github.io/docs/MQTT/) for more
#### Use your own Webserver #### Use your own Webserver
Upload the [tft file from HMI folder](HMI/nspanel.tft) to a Webserver (for example www folder of Home Assistant) and execute the following command in Tasmota Console. Upload the nspanel.tft from the lastest release to a Webserver (for example www folder of Home Assistant) and execute the following command in Tasmota Console. (Development Version: [tft file from HMI folder](HMI/nspanel.tft))
**Webserver needs to support HTTP Range Header Requests, python2/3 http server doesn't work** **Webserver needs to support HTTP Range Header Requests, python2/3 http server doesn't work**
@@ -185,6 +185,14 @@ Upload the [tft file from HMI folder](HMI/nspanel.tft) to a Webserver (for examp
`FlashNextion http://ip-address-of-your-homeassistant:8123/local/nspanel.tft` `FlashNextion http://ip-address-of-your-homeassistant:8123/local/nspanel.tft`
#### Use my webserver
Due the limitations of Berry, it's not possible to download the tft file directly from github, so I'm also renting a small server where you can download the file via HTTP.
The following Link has always the latest version from this repository, just execute the following Command in Tasmota:
`FlashNextion http://nspanel.pky.eu/lui.tft`
## Configuration ## Configuration
### Configuring the MQTT integration in AppDaemon ### Configuring the MQTT integration in AppDaemon
@@ -226,8 +234,8 @@ You can have multiple nspanel sections.
```yaml ```yaml
nspanel-1: nspanel-1:
module: nspanel-lovelance-ui module: nspanel-lovelace-ui
class: NsPanelLovelanceUIManager class: NsPanelLovelaceUIManager
config: config:
panelRecvTopic: "tele/tasmota_your_mqtt_topic/RESULT" panelRecvTopic: "tele/tasmota_your_mqtt_topic/RESULT"
panelSendTopic: "cmnd/tasmota_your_mqtt_topic/CustomSend" panelSendTopic: "cmnd/tasmota_your_mqtt_topic/CustomSend"
@@ -278,6 +286,36 @@ key | optional | type | default | description
`class` | False | string | | The name of the Class. `class` | False | string | | The name of the Class.
`config` | False | complex | | Config/Mapping between Homeassistant and your NsPanel `config` | False | complex | | Config/Mapping between Homeassistant and your NsPanel
## How to update
Updating involves mainly already descriped steps from installation, so this is a short summary.
This project has three main parts, on a new release you usally need to update at least two of them, the AppDaemon Backend and the firmware of the display.
Sometimes there are also changes to the berry driver script on tasmota.
*Note the commands in the following section will update to the current development version of this repository, use the command from release page if you want to use a release version*
### Update AppDaemon Script
HACS will show you that there is an update avalible and ask you to update.
### Update Display Firmware
Use the following command to update or use your own webserver. FlashNextionFast will use Nextion Upload Protocol 1.2 and try to skip unchanged parts of the firmware.
`FlashNextionFast http://nspanel.pky.eu/lui.tft`
In case this Update failes, reboot tasmota and use the following command:
`FlashNextion http://nspanel.pky.eu/lui.tft`
### Update Tasmota Berry Driver
Since release 1.1 you can update the berry driver directly from the Tasmota Console with the following command.
`UpdateDriverVersion https://raw.githubusercontent.com/joBr99/nspanel-lovelace-ui/main/tasmota/autoexec.be`
## FAQ - Frequently Asked Questions ## FAQ - Frequently Asked Questions

View File

@@ -1,7 +1,7 @@
--- ---
nspanel: nspanel:
module: nspanel-lovelance-ui module: nspanel-lovelace-ui
class: NsPanelLovelanceUIManager class: NsPanelLovelaceUIManager
config: config:
panelRecvTopic: "tele/tasmota_your_mqtt_topic/RESULT" panelRecvTopic: "tele/tasmota_your_mqtt_topic/RESULT"
panelSendTopic: "cmnd/tasmota_your_mqtt_topic/CustomSend" panelSendTopic: "cmnd/tasmota_your_mqtt_topic/CustomSend"

View File

@@ -2,13 +2,16 @@ import json
import datetime import datetime
import hassapi as hass import hassapi as hass
class NsPanelLovelanceUIManager(hass.Hass): import math
import colorsys
class NsPanelLovelaceUIManager(hass.Hass):
def initialize(self): def initialize(self):
data = self.args["config"] data = self.args["config"]
NsPanelLovelanceUI(self, data) NsPanelLovelaceUI(self, data)
class NsPanelLovelanceUI: class NsPanelLovelaceUI:
def __init__(self, api, config): def __init__(self, api, config):
self.api = api self.api = api
self.config = config self.config = config
@@ -48,7 +51,7 @@ class NsPanelLovelanceUI:
found_current_dim_value = False found_current_dim_value = False
for index, timeset in enumerate(sorted_timesets): for index, timeset in enumerate(sorted_timesets):
self.api.run_daily(self.update_screensaver_brightness, timeset["time"], value=timeset["value"]) self.api.run_daily(self.update_screensaver_brightness, timeset["time"], value=timeset["value"])
self.api.log("Current time %s", self.api.get_now().time()) self.api.log("Current time %s", self.api.get_now().time(), level="DEBUG")
if self.api.parse_time(timeset["time"]) > self.api.get_now().time() and not found_current_dim_value: if self.api.parse_time(timeset["time"]) > self.api.get_now().time() and not found_current_dim_value:
# first time after current time, set dim value # first time after current time, set dim value
self.current_screensaver_brightness = sorted_timesets[index-1]["value"] self.current_screensaver_brightness = sorted_timesets[index-1]["value"]
@@ -119,30 +122,7 @@ class NsPanelLovelanceUI:
if msg[1] == "pageOpenDetail": if msg[1] == "pageOpenDetail":
self.api.log("Received pageOpenDetail command", level="DEBUG") self.api.log("Received pageOpenDetail command", level="DEBUG")
if(msg[2] == "popupLight"): self.generate_detail_page(msg[2], msg[3])
entity = self.api.get_entity(msg[3])
switch_val = 1 if entity.state == "on" else 0
# scale 0-255 brightness from ha to 0-100
if entity.state == "on":
if entity.attributes.get("brightness"):
brightness = int(self.scale(entity.attributes.brightness,(0,255),(0,100)))
else:
brightness = "disable"
if "color_temp" in entity.attributes.supported_color_modes:
# scale ha color temp range to 0-100
color_temp = self.scale(entity.attributes.color_temp,(entity.attributes.min_mireds, entity.attributes.max_mireds),(0,100))
else:
color_temp = "disable"
else:
brightness = 0
color_temp = "disable"
self.send_mqtt_msg("entityUpdateDetail,{0},{1},{2}".format(switch_val,brightness,color_temp))
if(msg[2] == "popupShutter"):
pos = self.api.get_entity(msg[3]).attributes.current_position
# reverse position for slider
pos = 100-pos
self.send_mqtt_msg("entityUpdateDetail,{0}".format(pos))
if msg[1] == "tempUpd": if msg[1] == "tempUpd":
self.api.log("Received tempUpd command", level="DEBUG") self.api.log("Received tempUpd command", level="DEBUG")
@@ -153,6 +133,7 @@ class NsPanelLovelanceUI:
self.update_screensaver_weather("") self.update_screensaver_weather("")
def send_mqtt_msg(self,msg): def send_mqtt_msg(self,msg):
self.api.log("Send Message from Tasmota: %s", msg, level="DEBUG")
self.mqtt.mqtt_publish(self.config["panelSendTopic"], msg) self.mqtt.mqtt_publish(self.config["panelSendTopic"], msg)
def update_time(self, kwargs): def update_time(self, kwargs):
@@ -248,6 +229,13 @@ class NsPanelLovelanceUI:
color_val = self.scale(int(optVal), (0, 100), (entity.attributes.min_mireds, entity.attributes.max_mireds)) color_val = self.scale(int(optVal), (0, 100), (entity.attributes.min_mireds, entity.attributes.max_mireds))
self.api.get_entity(entity_id).call_service("turn_on", color_temp=color_val) self.api.get_entity(entity_id).call_service("turn_on", color_temp=color_val)
if(btype == "colorWheel"):
self.api.log(optVal)
optVal = optVal.split('|')
color = self.pos_to_color(int(optVal[0]), int(optVal[1]))
self.api.log(color)
self.api.get_entity(entity_id).call_service("turn_on", rgb_color=color)
if(btype == "positionSlider"): if(btype == "positionSlider"):
pos = int(optVal) pos = int(optVal)
self.api.get_entity(entity_id).call_service("set_cover_position", position=pos) self.api.get_entity(entity_id).call_service("set_cover_position", position=pos)
@@ -300,7 +288,11 @@ class NsPanelLovelanceUI:
# send update of the item on page # send update of the item on page
command = self.generate_entities_item(entity, items.index(entity)+1) command = self.generate_entities_item(entity, items.index(entity)+1)
self.send_mqtt_msg(command) self.send_mqtt_msg(command)
# TODO: Send data of detail page, just in case this page is currently open if(entity.startswith("cover")):
self.generate_detail_page("popupShutter", entity)
if(entity.startswith("light")):
self.generate_detail_page("popupLight", entity)
return return
if page_type == "cardThermo" or page_type == "cardMedia": if page_type == "cardThermo" or page_type == "cardMedia":
@@ -441,3 +433,55 @@ class NsPanelLovelanceUI:
self.send_mqtt_msg("pageType,{0}".format(page_type)) self.send_mqtt_msg("pageType,{0}".format(page_type))
command = self.generate_media_page(self.config["pages"][self.current_page_nr]["item"]) command = self.generate_media_page(self.config["pages"][self.current_page_nr]["item"])
self.send_mqtt_msg(command) self.send_mqtt_msg(command)
def generate_detail_page(self, page_type, entity):
if(page_type == "popupLight"):
entity = self.api.get_entity(entity)
switch_val = 1 if entity.state == "on" else 0
brightness = "disable"
color_temp = "disable"
color = "disable"
# scale 0-255 brightness from ha to 0-100
if entity.state == "on":
if "brightness" in entity.attributes:
brightness = int(self.scale(entity.attributes.brightness,(0,255),(0,100)))
else:
brightness = "disable"
if "color_temp" in entity.attributes.supported_color_modes:
if "color_temp" in entity.attributes:
# scale ha color temp range to 0-100
color_temp = int(self.scale(entity.attributes.color_temp,(entity.attributes.min_mireds, entity.attributes.max_mireds),(0,100)))
else:
color_temp = 0
else:
color_temp = "disable"
if "xy" in entity.attributes.supported_color_modes or "rgb" in entity.attributes.supported_color_modes or "rgbw" in entity.attributes.supported_color_modes or "hs" in entity.attributes.supported_color_modes:
color = "enable"
else:
color = "disable"
self.send_mqtt_msg(f"entityUpdateDetail,{switch_val},{brightness},{color_temp},{color}")
if(page_type == "popupShutter"):
pos = self.api.get_entity(msg[3]).attributes.current_position
# reverse position for slider
pos = 100-pos
self.send_mqtt_msg("entityUpdateDetail,{0}".format(pos))
def hsv2rgb(self, h, s, v):
hsv = colorsys.hsv_to_rgb(h,s,v)
return tuple(round(i * 255) for i in hsv)
def pos_to_color(self, x, y):
r = 213/2
x = round((x - r) / r * 100) / 100
y = round((r - y) / r * 100) / 100
r = math.sqrt(x*x + y*y)
sat = 0
if (r > 1):
sat = 0
else:
sat = r
hsv = (math.degrees(math.atan2(y, x))%360/360, sat, 1)
rgb = self.hsv2rgb(hsv[0],hsv[1],hsv[2])
return rgb

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 116 KiB

After

Width:  |  Height:  |  Size: 206 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

View File

@@ -1,3 +1,3 @@
{ {
"name": "NSPanel Lovelance UI Backend" "name": "NSPanel Lovelace UI Backend"
} }

View File

@@ -1,13 +1,13 @@
# NSPanel Lovelance UI # NSPanel Lovelace UI
Checkout [README](https://github.com/joBr99/nspanel-lovelance-ui/blob/main/README.md) for detailed Instructions. Checkout [README](https://github.com/joBr99/nspanel-lovelace-ui/blob/main/README.md) for detailed Instructions.
### App Configuration ### App Configuration
```yaml ```yaml
nspanel-1: nspanel-1:
module: nspanel-lovelance-ui module: nspanel-lovelace-ui
class: NsPanelLovelanceUIManager class: NsPanelLovelaceUIManager
config: config:
panelRecvTopic: "tele/tasmota_your_mqtt_topic/RESULT" panelRecvTopic: "tele/tasmota_your_mqtt_topic/RESULT"
panelSendTopic: "cmnd/tasmota_your_mqtt_topic/CustomSend" panelSendTopic: "cmnd/tasmota_your_mqtt_topic/CustomSend"

View File

@@ -167,11 +167,11 @@ class Nextion : Driver
return ret return ret
end end
# encode using custom protocol 55 BB [payload length] [payload] [crc] [crc] # encode using custom protocol 55 BB [payload length] [payload length] [payload] [crc] [crc]
def encode(payload) def encode(payload)
var b = bytes() var b = bytes()
b += self.header b += self.header
b.add(size(payload), 1) # add size as 1 byte b.add(size(payload), 2) # add size as 2 bytes, little endian
b += bytes().fromstring(payload) b += bytes().fromstring(payload)
var msg_crc = self.crc16(b) var msg_crc = self.crc16(b)
b.add(msg_crc, 2) # crc 2 bytes, little endian b.add(msg_crc, 2) # crc 2 bytes, little endian
@@ -303,13 +303,14 @@ class Nextion : Driver
self.flash_nextion() self.flash_nextion()
end end
else else
# Recive messages using custom protocol 55 BB [payload length] [payload] [crc] [crc] # Recive messages using custom protocol 55 BB [payload length] [payload length] [payload] [crc] [crc]
if msg[0..1] == self.header if msg[0..1] == self.header
var lst = self.split_55(msg) var lst = self.split_55(msg)
for i:0..size(lst)-1 for i:0..size(lst)-1
msg = lst[i] msg = lst[i]
var j = msg[2]+2 #var j = msg[2]+2
msg = msg[3..j] var j = size(msg) - 3
msg = msg[4..j]
if size(msg) > 2 if size(msg) > 2
var jm = string.format("{\"CustomRecv\":\"%s\"}",msg.asstring()) var jm = string.format("{\"CustomRecv\":\"%s\"}",msg.asstring())
tasmota.publish_result(jm, "RESULT") tasmota.publish_result(jm, "RESULT")

View File

@@ -27,7 +27,7 @@ header = binascii.unhexlify('55BB')
print("length:", len(value)) print("length:", len(value))
length = len(value).to_bytes(1, 'little') length = len(value).to_bytes(2, 'little')
bytes_payload = header + length + payload bytes_payload = header + length + payload