mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2025-12-20 14:37:01 +01:00
Compare commits
547 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
628a097f5b | ||
|
|
3d5aad77b6 | ||
|
|
985f217a0e | ||
|
|
f0bfbc6759 | ||
|
|
7a86c7a75a | ||
|
|
7b79014ec8 | ||
|
|
5c33689579 | ||
|
|
481b26c8b0 | ||
|
|
8fa93af672 | ||
|
|
b3983f058a | ||
|
|
912899fb91 | ||
|
|
36db4d82d3 | ||
|
|
536190458d | ||
|
|
e9d516c662 | ||
|
|
31a4390a50 | ||
|
|
1af88ccf5a | ||
|
|
c2b1d9f3e4 | ||
|
|
e916b35d53 | ||
|
|
8e0086e269 | ||
|
|
6401689012 | ||
|
|
a95735b300 | ||
|
|
cb09d14261 | ||
|
|
c8d02f5111 | ||
|
|
989e65bac9 | ||
|
|
0a1f359827 | ||
|
|
bd81e40040 | ||
|
|
9a0e4982fb | ||
|
|
0ab91236f2 | ||
|
|
ee71ab0fb1 | ||
|
|
8c8fb0ad33 | ||
|
|
03c7f249ba | ||
|
|
b7a092ba04 | ||
|
|
406e4975d1 | ||
|
|
29571b5535 | ||
|
|
1827c7df57 | ||
|
|
c525623500 | ||
|
|
1c13df53c2 | ||
|
|
3f1d2e1a2a | ||
|
|
d6d0fe2a56 | ||
|
|
d80ecc4a14 | ||
|
|
9a6eea3cab | ||
|
|
c532df614b | ||
|
|
2088167e2b | ||
|
|
8edaa6f1e1 | ||
|
|
286a486292 | ||
|
|
5a8b87aab1 | ||
|
|
36bd64836e | ||
|
|
9683af77cd | ||
|
|
f52918364d | ||
|
|
aff20c443b | ||
|
|
8cdfe32679 | ||
|
|
ecbc635557 | ||
|
|
7ec528f6e3 | ||
|
|
2d8a571ec7 | ||
|
|
2238015bac | ||
|
|
3f6a26e7d9 | ||
|
|
593fe33a1b | ||
|
|
ec43580e7f | ||
|
|
ca8d393219 | ||
|
|
10f56235fe | ||
|
|
ee9dcfb879 | ||
|
|
e2b97c9261 | ||
|
|
10ef128535 | ||
|
|
685d7de399 | ||
|
|
f35a633058 | ||
|
|
e8b3168ecc | ||
|
|
ed2180cdea | ||
|
|
d44697cbc6 | ||
|
|
b63fc7a8c8 | ||
|
|
9bc7096399 | ||
|
|
b6cb755427 | ||
|
|
eeb0a1d360 | ||
|
|
887e883265 | ||
|
|
641f957947 | ||
|
|
84665ffeab | ||
|
|
3eba8dad15 | ||
|
|
321604dd52 | ||
|
|
df751096d1 | ||
|
|
8325720d44 | ||
|
|
e398736f82 | ||
|
|
b524169942 | ||
|
|
34340d2ac4 | ||
|
|
ca59b35b87 | ||
|
|
1539149c09 | ||
|
|
2851c80bb5 | ||
|
|
383fc978fd | ||
|
|
1e57b46f9d | ||
|
|
2c1868ba29 | ||
|
|
8366555eed | ||
|
|
6bccd8dd50 | ||
|
|
6ccc5bafe1 | ||
|
|
89174c2bbd | ||
|
|
f5395153ee | ||
|
|
e9fb5ba32b | ||
|
|
661494b0b5 | ||
|
|
ea49bc9d70 | ||
|
|
1210838186 | ||
|
|
0c872bfa87 | ||
|
|
e3a30e2da8 | ||
|
|
2a829e7217 | ||
|
|
15c79b60fa | ||
|
|
05e05c7cb5 | ||
|
|
a27bc617a2 | ||
|
|
0a9e174c23 | ||
|
|
4fd2d3b260 | ||
|
|
28a43f46d7 | ||
|
|
fffb73e310 | ||
|
|
7aacef87bd | ||
|
|
1bf01b28a3 | ||
|
|
0e6ec05056 | ||
|
|
2cd39b0abd | ||
|
|
e3ab0d5594 | ||
|
|
f0bdc3c8ac | ||
|
|
e958eabc86 | ||
|
|
a742fbb2ae | ||
|
|
b3eb283544 | ||
|
|
2fa535a888 | ||
|
|
31b8c566ed | ||
|
|
ef6c42d1e0 | ||
|
|
af7edd37ad | ||
|
|
9525b5ad2c | ||
|
|
e882934d1b | ||
|
|
7477af1d2b | ||
|
|
f2c67e47b3 | ||
|
|
d35c990cc0 | ||
|
|
03c0940baa | ||
|
|
48a0f331a8 | ||
|
|
3081804f5a | ||
|
|
daf9fc5181 | ||
|
|
b6b12a2855 | ||
|
|
94eaebb542 | ||
|
|
dbe7725e48 | ||
|
|
98e5249a43 | ||
|
|
43211467b2 | ||
|
|
07260c0d0b | ||
|
|
071b56f488 | ||
|
|
d30fcf4157 | ||
|
|
3d04f77961 | ||
|
|
0b206e7fe3 | ||
|
|
f6e5e1ffdb | ||
|
|
d2695b0437 | ||
|
|
04bc737fd1 | ||
|
|
5586b57c9b | ||
|
|
11fc578984 | ||
|
|
a74043e4aa | ||
|
|
816d6787b7 | ||
|
|
01e4e233bf | ||
|
|
f78e03e5ec | ||
|
|
33afd31d8f | ||
|
|
4dccdfb014 | ||
|
|
2d6b8634bf | ||
|
|
f11177c5c1 | ||
|
|
645aef4cfa | ||
|
|
d5fe05f806 | ||
|
|
64cb8563aa | ||
|
|
b91629421e | ||
|
|
814cd4a295 | ||
|
|
9c2d91e3d9 | ||
|
|
028ddb7896 | ||
|
|
afdc05a239 | ||
|
|
f63f7f7861 | ||
|
|
c9d8f622cb | ||
|
|
e6bb202823 | ||
|
|
7080facb10 | ||
|
|
dcce889b3e | ||
|
|
2e15482ed1 | ||
|
|
adb99623e9 | ||
|
|
27f48819a4 | ||
|
|
1b52c885f6 | ||
|
|
1f937f75f2 | ||
|
|
269b983c2a | ||
|
|
29dfa5671d | ||
|
|
74a3860aa0 | ||
|
|
1bc69128a9 | ||
|
|
4529d5e34e | ||
|
|
0db8983b4a | ||
|
|
dc5e732e04 | ||
|
|
7e7d14a999 | ||
|
|
7ebc29b4a4 | ||
|
|
8b24f70ae0 | ||
|
|
edfe79e3c4 | ||
|
|
93d223141b | ||
|
|
853de19a40 | ||
|
|
da2b4565a4 | ||
|
|
18d360d339 | ||
|
|
af494ada10 | ||
|
|
05d6ee1f5f | ||
|
|
a4344ade18 | ||
|
|
1470ee5c82 | ||
|
|
9ae898c30f | ||
|
|
ec65eebb74 | ||
|
|
f7a768de7c | ||
|
|
e7aa27128c | ||
|
|
11bbad78d1 | ||
|
|
95e3dfa0ea | ||
|
|
70557ab748 | ||
|
|
2ecc7caedd | ||
|
|
6fd8553450 | ||
|
|
83396c283f | ||
|
|
a388efb5b5 | ||
|
|
77b05b8079 | ||
|
|
0aae22118b | ||
|
|
4a0a2d3620 | ||
|
|
cfd0d2cbe8 | ||
|
|
39575935b6 | ||
|
|
9f8900bf78 | ||
|
|
a054f7a7b3 | ||
|
|
464e625eaa | ||
|
|
505db42064 | ||
|
|
36459145e4 | ||
|
|
32b84bba9f | ||
|
|
952398a827 | ||
|
|
ff106be9cb | ||
|
|
0ab7900ec0 | ||
|
|
f328107f75 | ||
|
|
8deb0fd35e | ||
|
|
ed207b6e1a | ||
|
|
83e3316458 | ||
|
|
53c4ed370b | ||
|
|
050a8e6fd2 | ||
|
|
907f814ac7 | ||
|
|
e91c514fe1 | ||
|
|
5566f20e47 | ||
|
|
4810679ac5 | ||
|
|
48ed2daa33 | ||
|
|
482cee0552 | ||
|
|
8813331299 | ||
|
|
abf4868281 | ||
|
|
420905db04 | ||
|
|
4151aba6ea | ||
|
|
8a48ff35d4 | ||
|
|
35b15c92e0 | ||
|
|
c40906fdfe | ||
|
|
66a65c03e8 | ||
|
|
20e6f21307 | ||
|
|
342a97df0f | ||
|
|
0d343d4919 | ||
|
|
0111a9bb21 | ||
|
|
9ac5c8d748 | ||
|
|
a725305cd4 | ||
|
|
0746221fe7 | ||
|
|
dbfd5e7da4 | ||
|
|
6d80a53e9c | ||
|
|
fb93f96a94 | ||
|
|
5dd7dd2c77 | ||
|
|
f11c870f47 | ||
|
|
e4727822a9 | ||
|
|
a75e7abc32 | ||
|
|
d3e308ccaf | ||
|
|
f5d785298f | ||
|
|
89cd951e70 | ||
|
|
9278258684 | ||
|
|
327be4bca2 | ||
|
|
27f492ba6a | ||
|
|
c66e595e65 | ||
|
|
29613e11cc | ||
|
|
2bf396f7af | ||
|
|
9dd34abac4 | ||
|
|
aae3aa9e62 | ||
|
|
ff3208d5fa | ||
|
|
da3ae4b78d | ||
|
|
256b3e5fe6 | ||
|
|
0629f70d30 | ||
|
|
3ed71d725d | ||
|
|
35e4252a6c | ||
|
|
9ba4395e6c | ||
|
|
909101d726 | ||
|
|
f99fa640fe | ||
|
|
d2434ca626 | ||
|
|
65f4dd3970 | ||
|
|
fac86624ae | ||
|
|
277b2ccfd6 | ||
|
|
cbfd803a65 | ||
|
|
ae691d298f | ||
|
|
ee187ae9cd | ||
|
|
35e1b4cd66 | ||
|
|
f6912ad3ca | ||
|
|
71a5830db4 | ||
|
|
8ada5ad9b9 | ||
|
|
9a59b453d2 | ||
|
|
e52091b274 | ||
|
|
95de956e77 | ||
|
|
358a5f8b72 | ||
|
|
4292a34c11 | ||
|
|
60c40d56e5 | ||
|
|
97fed8c52c | ||
|
|
bf06931a2e | ||
|
|
cec43eeb16 | ||
|
|
20c02007fa | ||
|
|
2be33d723a | ||
|
|
ea121ff9a9 | ||
|
|
601de7b47f | ||
|
|
0c33184e5c | ||
|
|
979d37281c | ||
|
|
7a5d76e2f4 | ||
|
|
745445af19 | ||
|
|
1f7a3d513d | ||
|
|
24365f7824 | ||
|
|
7996393afb | ||
|
|
5903239456 | ||
|
|
32aa35d9c3 | ||
|
|
bb0108dc7a | ||
|
|
cf6359dea5 | ||
|
|
8d4c1904f1 | ||
|
|
3111ce15a2 | ||
|
|
85d290c3f4 | ||
|
|
f8a72a55a9 | ||
|
|
b9123ed2e9 | ||
|
|
b9d2c08cab | ||
|
|
0d460af0c6 | ||
|
|
6eefab4ed7 | ||
|
|
41c90f68ce | ||
|
|
18516917b9 | ||
|
|
bd64ba702a | ||
|
|
429f023d3d | ||
|
|
6264f22d12 | ||
|
|
fc4fb72818 | ||
|
|
23814a7bf2 | ||
|
|
ef6877b2ae | ||
|
|
9b5ca37673 | ||
|
|
acc2e859bb | ||
|
|
481f5fc074 | ||
|
|
ff96c8fce6 | ||
|
|
5e74db2d85 | ||
|
|
74a2cfd369 | ||
|
|
e780bf302d | ||
|
|
54c8b7d2ab | ||
|
|
88a2ad46ec | ||
|
|
18855840d8 | ||
|
|
2cbcb098e6 | ||
|
|
e2c20b8c2d | ||
|
|
a895a85477 | ||
|
|
d1165efbd8 | ||
|
|
a2a2e221d4 | ||
|
|
23d0514339 | ||
|
|
d66cfc6cd8 | ||
|
|
07fd51543f | ||
|
|
8d0feefb01 | ||
|
|
b5afc7d427 | ||
|
|
c0dd81f967 | ||
|
|
91273bb6f2 | ||
|
|
4ce16095b5 | ||
|
|
9bd6925f75 | ||
|
|
0b58f16a0e | ||
|
|
6983ff1532 | ||
|
|
f7f63d00a4 | ||
|
|
b0027d4c3c | ||
|
|
622f9bf0c7 | ||
|
|
b6b0249bfe | ||
|
|
27251104ee | ||
|
|
7822782fc6 | ||
|
|
763dbb6ef8 | ||
|
|
45b59d4d01 | ||
|
|
ae515df4c9 | ||
|
|
498f8bf234 | ||
|
|
3f531da6f0 | ||
|
|
264e9cd61c | ||
|
|
fc0f24a794 | ||
|
|
f9549a7dc6 | ||
|
|
b698d67f79 | ||
|
|
d0d456c49d | ||
|
|
e3909e457c | ||
|
|
b1768f2b80 | ||
|
|
6643d6c284 | ||
|
|
c683a9bc7c | ||
|
|
721a41ce3e | ||
|
|
94891bf2cb | ||
|
|
0de9d83b50 | ||
|
|
25f3913010 | ||
|
|
a023d2e04a | ||
|
|
741ff125f3 | ||
|
|
0d883983fa | ||
|
|
646ec6cf92 | ||
|
|
411ef851a7 | ||
|
|
65886ca9fc | ||
|
|
a789c39fa1 | ||
|
|
3930408ebf | ||
|
|
17554fd57d | ||
|
|
5d6f59df71 | ||
|
|
818405fa73 | ||
|
|
2451c353f8 | ||
|
|
d3475a948e | ||
|
|
0b7fec2f99 | ||
|
|
81487e580b | ||
|
|
6347297d1f | ||
|
|
6e3dbc4057 | ||
|
|
8849e18e48 | ||
|
|
5e6348dc70 | ||
|
|
b1399aad81 | ||
|
|
fe3e0c882e | ||
|
|
59691cc591 | ||
|
|
0d85dac1e1 | ||
|
|
f08010d74b | ||
|
|
470a891f65 | ||
|
|
860f4a3dd0 | ||
|
|
64cb6c58e3 | ||
|
|
21d1ad9a1e | ||
|
|
7a55c1c876 | ||
|
|
ae9254eda2 | ||
|
|
2b0e16d633 | ||
|
|
330744ca9c | ||
|
|
7584516ac9 | ||
|
|
7937368f73 | ||
|
|
1aca308970 | ||
|
|
5a9ffc1889 | ||
|
|
6a9b4d4f0e | ||
|
|
0809443b5d | ||
|
|
9ca085e296 | ||
|
|
5120a87472 | ||
|
|
8c3df900fe | ||
|
|
3af3fd5172 | ||
|
|
13d1e95e74 | ||
|
|
36ab2eb09c | ||
|
|
66f3e2955b | ||
|
|
e01d4a8bc8 | ||
|
|
63e7ecd60a | ||
|
|
2ad0ad4c35 | ||
|
|
a1665075b5 | ||
|
|
d095f7ef28 | ||
|
|
9a4fef98d3 | ||
|
|
1e9a8df3f8 | ||
|
|
2f21594289 | ||
|
|
63778275dc | ||
|
|
ff43743ae3 | ||
|
|
a7d710bb6f | ||
|
|
ee66eb13f6 | ||
|
|
441bedf5a2 | ||
|
|
85b0ed4154 | ||
|
|
890236f683 | ||
|
|
18c96ee0f8 | ||
|
|
00442c82b0 | ||
|
|
dc3062eba0 | ||
|
|
cfdfb9404c | ||
|
|
246c03ee4b | ||
|
|
940ee10fc4 | ||
|
|
ba887cf60c | ||
|
|
e5706d848f | ||
|
|
eac1095bbd | ||
|
|
1f6cd2d1aa | ||
|
|
1201142cb5 | ||
|
|
dddff76d11 | ||
|
|
e74de74ede | ||
|
|
e859c338b3 | ||
|
|
0921dd81b8 | ||
|
|
413401b1f9 | ||
|
|
fcc8d44bfd | ||
|
|
d4ff842dee | ||
|
|
4cd0ecbe56 | ||
|
|
cfba107246 | ||
|
|
e5b4fb4743 | ||
|
|
a35467830f | ||
|
|
625bddc894 | ||
|
|
6124a24887 | ||
|
|
39e44bc820 | ||
|
|
f3351af4e5 | ||
|
|
0cc735566f | ||
|
|
90e2b1622b | ||
|
|
9f8be27835 | ||
|
|
b852703aa1 | ||
|
|
cce36c281e | ||
|
|
9267e7be4e | ||
|
|
91434bfdd3 | ||
|
|
9153b602d7 | ||
|
|
7c7241bc98 | ||
|
|
9a111720e5 | ||
|
|
a93681f262 | ||
|
|
dfe82dcd45 | ||
|
|
6f792443ad | ||
|
|
4b21961707 | ||
|
|
699ba7855b | ||
|
|
0b740fb14d | ||
|
|
19764eb220 | ||
|
|
8fee0af87f | ||
|
|
ccd914c1a7 | ||
|
|
49f6631d5a | ||
|
|
6fd1ddb432 | ||
|
|
3fae02ebe2 | ||
|
|
6e073f7181 | ||
|
|
9ea6c218fa | ||
|
|
f48510e03e | ||
|
|
b5e3133d77 | ||
|
|
fc1614e243 | ||
|
|
2d39e15b9d | ||
|
|
025a3bd700 | ||
|
|
93393ac877 | ||
|
|
b28c4e46eb | ||
|
|
48e17ed986 | ||
|
|
f0857aeec7 | ||
|
|
36dddb0dc2 | ||
|
|
e1ac4d4cec | ||
|
|
d82c4127b7 | ||
|
|
991c882373 | ||
|
|
e35b9d4a82 | ||
|
|
0cdbfc5708 | ||
|
|
21e8300191 | ||
|
|
d534ba30ac | ||
|
|
491ad5ea25 | ||
|
|
fb5145561f | ||
|
|
a65b8cb2df | ||
|
|
4d27f2f485 | ||
|
|
864f5b80d0 | ||
|
|
6b1e0f0499 | ||
|
|
13919eba01 | ||
|
|
5965a089f1 | ||
|
|
5ea3557ffb | ||
|
|
c8e3960003 | ||
|
|
9aec695f89 | ||
|
|
14bc505c79 | ||
|
|
7504120e83 | ||
|
|
c1d15385c3 | ||
|
|
a49b12c204 | ||
|
|
96b136c194 | ||
|
|
292c372060 | ||
|
|
9c79197a59 | ||
|
|
ac167a36ea | ||
|
|
989f085649 | ||
|
|
f231ea690b | ||
|
|
d18fbe269d | ||
|
|
27ff4f0581 | ||
|
|
b9e70f7b89 | ||
|
|
bea91b01a9 | ||
|
|
0bcacd6ba6 | ||
|
|
e3f5aad46b | ||
|
|
f367758445 | ||
|
|
9f0f670db5 | ||
|
|
36d0685f3d | ||
|
|
f0ee420d52 | ||
|
|
daa1b1ee0f | ||
|
|
35d97fa0bd | ||
|
|
0e76fc37de | ||
|
|
0cb06c752f | ||
|
|
cf9f14f12a | ||
|
|
a3a6487e13 | ||
|
|
bd9709fda6 | ||
|
|
ac237ff2ed | ||
|
|
6353d67335 | ||
|
|
c9b73303cf | ||
|
|
580681eb73 | ||
|
|
dc2aea3ffc | ||
|
|
4af3449491 | ||
|
|
85d1de3c19 | ||
|
|
cdda0d9601 | ||
|
|
7961a27ab2 | ||
|
|
1533f52130 | ||
|
|
af618b0f12 | ||
|
|
36836f39c8 | ||
|
|
d934f92a7e |
2
.github/FUNDING.yml
vendored
Normal file
2
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
custom: ['https://paypal.me/joBr99']
|
||||||
|
ko_fi: jobr99
|
||||||
11
.github/workflows/codeql-analysis.yml
vendored
11
.github/workflows/codeql-analysis.yml
vendored
@@ -14,13 +14,14 @@ name: "CodeQL"
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ main ]
|
branches: [ main ]
|
||||||
paths:
|
# paths:
|
||||||
- '**.py'
|
# - '**.py'
|
||||||
|
# - '**.ts'
|
||||||
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:
|
# paths:
|
||||||
- '**.py'
|
# - '**.py'
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '36 14 * * 3'
|
- cron: '36 14 * * 3'
|
||||||
|
|
||||||
@@ -36,7 +37,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
language: [ 'python' ]
|
language: [ 'python', 'typescript' ]
|
||||||
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
|
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
|
||||||
# Learn more about CodeQL language support at https://git.io/codeql-language-support
|
# Learn more about CodeQL language support at https://git.io/codeql-language-support
|
||||||
|
|
||||||
|
|||||||
26
.github/workflows/nextion2text.yml
vendored
26
.github/workflows/nextion2text.yml
vendored
@@ -4,11 +4,15 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- HMI/nspanel.HMI
|
- HMI/nspanel.HMI
|
||||||
|
- HMI/US/portrait/nspanel_US_P.HMI
|
||||||
|
- .github/workflows/nextion2text.yml
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
paths:
|
paths:
|
||||||
- HMI/nspanel.HMI
|
- HMI/nspanel.HMI
|
||||||
|
- HMI/US/portrait/nspanel_US_P.HMI
|
||||||
|
- .github/workflows/nextion2text.yml
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
gen-nextion-to-text:
|
gen-nextion-to-text:
|
||||||
@@ -24,13 +28,25 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
echo "::set-output name=msg::$(git log -1 --pretty=%s)"
|
echo "::set-output name=msg::$(git log -1 --pretty=%s)"
|
||||||
|
|
||||||
- name: Run nextion2text
|
- name: Download n2t
|
||||||
|
continue-on-error: true
|
||||||
run: |
|
run: |
|
||||||
cd HMI
|
|
||||||
wget https://raw.githubusercontent.com/joBr99/Nextion2Text/linux/Nextion2Text.py
|
wget https://raw.githubusercontent.com/joBr99/Nextion2Text/linux/Nextion2Text.py
|
||||||
python Nextion2Text.py -s -d -p -p visual -i nspanel.HMI -o n2t-out
|
|
||||||
|
- name: Run n2t EU
|
||||||
|
continue-on-error: true
|
||||||
|
run: |
|
||||||
|
python Nextion2Text.py -s -d -p -p visual -i HMI/nspanel.HMI -o HMI/n2t-out-visual
|
||||||
|
|
||||||
|
- name: Run n2t US DIFF
|
||||||
|
continue-on-error: true
|
||||||
|
run: |
|
||||||
|
echo "YXR0cmlidXRlcyA9IHsKICAgICJpZCI6IHsKICAgICAgICAiaWdub3JlIjogVHJ1ZSwKICAgICAgICAibmFtZSI6ICJJRCIsCiAgICAgICAgInN0cnVjdCI6ICJpIiwKICAgIH0KfQ==" | base64 -d > ignore-id.py
|
||||||
|
python Nextion2Text.py -c ignore-id.py -d -i HMI/nspanel.HMI -o HMI/n2t-out
|
||||||
|
python Nextion2Text.py -c ignore-id.py -d -i HMI/US/portrait/nspanel_US_P.HMI -o HMI/US/portrait/n2t-out
|
||||||
|
diff -bur HMI/n2t-out HMI/US/portrait/n2t-out > HMI/US/portrait/diff-eu-version.txt
|
||||||
|
|
||||||
- uses: stefanzweifel/git-auto-commit-action@v4
|
- uses: stefanzweifel/git-auto-commit-action@v4
|
||||||
with:
|
with:
|
||||||
commit_message: ${{ steps.last-commit-message.outputs.msg }} (add nextion2text)
|
commit_message: ${{ steps.last-commit-message.outputs.msg }} (add nextion2text)
|
||||||
file_pattern: HMI/n2t-out/*.txt
|
file_pattern: "**.txt"
|
||||||
|
|||||||
129
HMI/README.md
129
HMI/README.md
@@ -67,43 +67,41 @@ change the page type:
|
|||||||
|
|
||||||
`pageType,cardMedia`
|
`pageType,cardMedia`
|
||||||
|
|
||||||
`pageType,popupLight,Schreibtischlampe`
|
`pageType,popupLight,Schreibtischlampe,light.schreibtischlampe`
|
||||||
|
|
||||||
`pageType,popupNotify`
|
`pageType,popupNotify`
|
||||||
|
|
||||||
|
`pageType,screensaver`
|
||||||
|
|
||||||
### 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?tForecast3? tF3Icon? tForecast3Val?tForecast4? tF4Icon? tForecast4Val`
|
||||||
|
|
||||||
`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`
|
`entityUpd,heading,navigation,[,*type*,*internalNameEntity*,*iconId*,*iconColor*,*displayNameEntity*,*optionalValue*]x4`
|
||||||
|
|
||||||
`entityUpd,*id*,*type*,*internalNameEntity*,*iconId*,*displayNameEntity*,*optionalValue*`
|
`,light,light.entityName,1,17299,Light1,0`
|
||||||
|
|
||||||
`entityUpd,1,light,light.entityName,1,Light1,0`
|
`,shutter,cover.entityName,0,17299,Shutter2,`
|
||||||
|
|
||||||
`entityUpd,2,shutter,cover.entityName,0,Shutter2`
|
`,delete,,,,,`
|
||||||
|
|
||||||
`entityUpd,3,delete`
|
`,text,sensor.entityName,3,17299,Temperature,content`
|
||||||
|
|
||||||
`entityUpd,4,text,sensor.entityName,3,Temperature,content`
|
`,button,button.entityName,3,17299,bt-name,bt-text`
|
||||||
|
|
||||||
`entityUpd,4,button,button.entityName,3,bt-name,bt-text`
|
`,switch,switch.entityName,4,17299,Switch1,0`
|
||||||
|
|
||||||
`entityUpd,1,switch,switch.entityName,4,Switch1,0`
|
|
||||||
|
|
||||||
### popupLight Page
|
### popupLight Page
|
||||||
|
|
||||||
`entityUpdateDetail,*buttonState*,*sliderBrightnessPos*,*sliderColorTempPos*,*colorMode*`
|
`entityUpdateDetail,*iconId*,*iconColor*,*buttonState*,*sliderBrightnessPos*,*sliderColorTempPos*,*colorMode*`
|
||||||
|
|
||||||
`entityUpdateDetail,1,100,78,enable`
|
`entityUpdateDetail,1,17299,1,100,78,enable`
|
||||||
|
|
||||||
`entityUpdateDetail,1,100,disable`
|
`entityUpdateDetail,1,17299,1,100,disable`
|
||||||
|
|
||||||
### popupShutter Page
|
### popupShutter Page
|
||||||
|
|
||||||
@@ -113,115 +111,106 @@ The following message can be used to update the content on the cardEntities Page
|
|||||||
|
|
||||||
### popupNotify Page
|
### popupNotify Page
|
||||||
|
|
||||||
`entityUpdateDetail,*tHeading*,*b1*,*b2*,*tText*`
|
`entityUpdateDetail,*internalName*,*tHeading*,*tHeadingColor*,*b1*,*tB1Color*,*b2*,*tB2Color*,*tText*,*tTextColor*,*sleepTimeout*`
|
||||||
|
|
||||||
|
`exitPopup`
|
||||||
|
|
||||||
### cardThermo Page
|
### cardThermo Page
|
||||||
|
|
||||||
`entityUpd,*internalNameEntiy*,*heading*,*currentTemp*,*destTemp*,*status*,*minTemp*,*maxTemp*,*stepTemp*`
|
`entityUpd,*internalNameEntiy*,*heading*,*currentTemp*,*destTemp*,*status*,*minTemp*,*maxTemp*,*stepTemp*[[,*iconId*,*activeColor*,*state*,*hvac_action*]]`
|
||||||
|
|
||||||
|
`[[]]` are not part of the command, this part repeats 9 times for the buttons
|
||||||
|
|
||||||
### cardMedia Page
|
### cardMedia Page
|
||||||
|
|
||||||
`entityUpd,|*internalNameEntiy*|*heading*|*icon*|*title*|*author*|*volume*|*playpauseicon*`
|
`entityUpd,|*internalNameEntiy*|*heading*|*icon*|*title*|*author*|*volume*|*playpauseicon*|currentSpeaker|speakerList-seperated-by-?`
|
||||||
|
|
||||||
|
### cardAlarm Page
|
||||||
|
|
||||||
|
`entityUpd,*internalNameEntity*,*arm1*,*arm1ActionName*,*arm2*,*arm2ActionName*,*arm3*,*arm3ActionName*,*arm4*,*arm4ActionName*,*icon*,*iconcolor*,*numpadStatus*,*flashing*`
|
||||||
|
|
||||||
|
|
||||||
## Messages from Nextion Display
|
## Messages from Nextion Display
|
||||||
|
|
||||||
|
`event,buttonPress2,pageName,bNext`
|
||||||
|
|
||||||
|
`event,buttonPress2,pageName,bPrev`
|
||||||
|
|
||||||
|
`event,buttonPress2,pageName,bExit,number_of_taps`
|
||||||
|
|
||||||
### startup page
|
### startup page
|
||||||
|
|
||||||
`event,startup,version`
|
`event,startup,version`
|
||||||
|
|
||||||
### screensaver page
|
### screensaver page
|
||||||
|
|
||||||
`event,screensaverOpen`
|
`event,buttonPress2,screensaver,exit` - Touch Event on Screensaver
|
||||||
|
|
||||||
|
`event,screensaverOpen` - Screensaver has opened
|
||||||
|
|
||||||
|
|
||||||
### cardEntities Page
|
### cardEntities Page
|
||||||
|
|
||||||
`event,*eventName*,*PageNumber*,*PageHeading*,*entityName*,*buttonId*,*actionName*,*optionalValue*`
|
`event,*eventName*,*entityName*,*actionName*,*optionalValue*`
|
||||||
|
|
||||||
`event,pageOpen,0`
|
`event,buttonPress2,internalNameEntity,up`
|
||||||
|
|
||||||
`event,buttonPress,1,tHeading,internalNameEntity,1,up`
|
`event,buttonPress2,internalNameEntity,down`
|
||||||
|
|
||||||
`event,buttonPress,1,tHeading,internalNameEntity,1,down`
|
`event,buttonPress2,internalNameEntity,stop`
|
||||||
|
|
||||||
`event,buttonPress,1,tHeading,internalNameEntity,1,stop`
|
`event,buttonPress2,internalNameEntity,OnOff,1`
|
||||||
|
|
||||||
`event,buttonPress,1,tHeading,internalNameEntity,1,OnOff,1`
|
`event,buttonPress2,internalNameEntity,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,buttonPress2,internalNameEntity,OnOff,1`
|
||||||
|
|
||||||
`event,buttonPress,D,nameEntity,internalNameEntity,1,brightnessSlider,50`
|
`event,buttonPress2,internalNameEntity,brightnessSlider,50`
|
||||||
|
|
||||||
`event,buttonPress,D,nameEntity,internalNameEntity,1,colorTempSlider,50`
|
`event,buttonPress2,internalNameEntity,colorTempSlider,50`
|
||||||
|
|
||||||
`event,buttonPress,D,nameEntity,internalNameEntity,1,colorWheel,x|y`
|
`event,buttonPress2,internalNameEntity,colorWheel,x|y`
|
||||||
|
|
||||||
### popupShutter Page
|
### popupShutter Page
|
||||||
|
|
||||||
`event,pageOpenDetail,popupShutter,internalNameEntity`
|
`event,pageOpenDetail,popupShutter,internalNameEntity`
|
||||||
|
|
||||||
`event,buttonPress,D,nameEntity,internalNameEntity,1,positionSlider,50`
|
`event,buttonPress2,internalNameEntity,positionSlider,50`
|
||||||
|
|
||||||
### popupNotify Page
|
### popupNotify Page
|
||||||
|
|
||||||
`event,buttonPress,D,D,D,1,notifyAction,yes`
|
`event,buttonPress2,*internalName*,notifyAction,yes`
|
||||||
|
|
||||||
`event,buttonPress,D,D,D,1,notifyAction,no`
|
`event,buttonPress2,*internalName*,notifyAction,no`
|
||||||
|
|
||||||
### cardThermo Page
|
### cardThermo Page
|
||||||
|
|
||||||
`event,pageOpen,0`
|
`event,buttonPress2,*entityName*,tempUpd,*temperature*`
|
||||||
|
|
||||||
`event,tempUpd,*pageNumber*,*entityName*,*temperature*`
|
`event,buttonPress2,*entityName*,hvac_action,*hvac_action*`
|
||||||
|
|
||||||
### cardMedia Page
|
### cardMedia Page
|
||||||
|
|
||||||
`event,buttonPress,1,tHeading,internalNameEntity,1,media-back`
|
`event,buttonPress2,internalNameEntity,media-back`
|
||||||
|
|
||||||
`event,buttonPress,1,tHeading,internalNameEntity,1,media-pause`
|
`event,buttonPress2,internalNameEntity,media-pause`
|
||||||
|
|
||||||
`event,buttonPress,1,tHeading,internalNameEntity,1,media-next`
|
`event,buttonPress2,internalNameEntity,media-next`
|
||||||
|
|
||||||
`event,buttonPress,1,tHeading,internalNameEntity,1,volumeSlider,75`
|
`event,buttonPress2,internalNameEntity,volumeSlider,75`
|
||||||
|
|
||||||
|
### cardAlarm Page
|
||||||
|
|
||||||
|
`event,buttonPress2,internalNameEntity,actionName,code`
|
||||||
|
|
||||||
|
|
||||||
# Icons IDs
|
# Icons IDs
|
||||||
|
|
||||||
ID | Icon
|
Please see Icon's int the [icons.md file](icons.md)
|
||||||
-- | ----
|
|
||||||
0 | 
|
|
||||||
1 | 
|
|
||||||
2 | 
|
|
||||||
3 | 
|
|
||||||
4 | 
|
|
||||||
5 | 
|
|
||||||
6 | 
|
|
||||||
7 | 
|
|
||||||
8 | 
|
|
||||||
9 | 
|
|
||||||
10 | 
|
|
||||||
11 | 
|
|
||||||
12 | 
|
|
||||||
13 | 
|
|
||||||
14 | 
|
|
||||||
15 | 
|
|
||||||
16 | 
|
|
||||||
17 | 
|
|
||||||
18 | 
|
|
||||||
19 | 
|
|
||||||
20 | 
|
|
||||||
21 | 
|
|
||||||
22 | 
|
|
||||||
23 | 
|
|
||||||
24 | 
|
|
||||||
25 | 
|
|
||||||
26 | 
|
|
||||||
|
|
||||||
# Design Guidelines for Nextion HMI Project
|
# Design Guidelines for Nextion HMI Project
|
||||||
|
|
||||||
|
|||||||
817
HMI/US/portrait/diff-eu-version.txt
Normal file
817
HMI/US/portrait/diff-eu-version.txt
Normal file
@@ -0,0 +1,817 @@
|
|||||||
|
diff -bur HMI/n2t-out/Program.s.txt HMI/US/portrait/n2t-out/Program.s.txt
|
||||||
|
--- HMI/n2t-out/Program.s.txt 2022-03-29 11:46:11.344670256 +0000
|
||||||
|
+++ HMI/US/portrait/n2t-out/Program.s.txt 2022-03-29 11:46:11.748675118 +0000
|
||||||
|
@@ -10,6 +10,6 @@
|
||||||
|
int sleepValue=0
|
||||||
|
// dim value
|
||||||
|
int dimValue=40
|
||||||
|
- // fix touch offset
|
||||||
|
- lcd_dev fffb 0002 0000 0020
|
||||||
|
+ // fix touch offset (Removed for US version)
|
||||||
|
+ //lcd_dev fffb 0002 0000 0020
|
||||||
|
page pageStartup
|
||||||
|
diff -bur HMI/n2t-out/cardEntities.txt HMI/US/portrait/n2t-out/cardEntities.txt
|
||||||
|
--- HMI/n2t-out/cardEntities.txt 2022-03-29 11:46:11.348670304 +0000
|
||||||
|
+++ HMI/US/portrait/n2t-out/cardEntities.txt 2022-03-29 11:46:11.748675118 +0000
|
||||||
|
@@ -31,7 +31,6 @@
|
||||||
|
vis tEntity1,0
|
||||||
|
vis bText1,0
|
||||||
|
vis hSlider1,0
|
||||||
|
- vis nNum1,0
|
||||||
|
//ui e2
|
||||||
|
vis btOnOff2,0
|
||||||
|
vis bUp2,0
|
||||||
|
@@ -41,7 +40,6 @@
|
||||||
|
vis tEntity2,0
|
||||||
|
vis bText2,0
|
||||||
|
vis hSlider2,0
|
||||||
|
- vis nNum2,0
|
||||||
|
//ui e3
|
||||||
|
vis btOnOff3,0
|
||||||
|
vis bUp3,0
|
||||||
|
@@ -51,7 +49,6 @@
|
||||||
|
vis tEntity3,0
|
||||||
|
vis bText3,0
|
||||||
|
vis hSlider3,0
|
||||||
|
- vis nNum3,0
|
||||||
|
//ui e4
|
||||||
|
vis btOnOff4,0
|
||||||
|
vis bUp4,0
|
||||||
|
@@ -61,7 +58,24 @@
|
||||||
|
vis tEntity4,0
|
||||||
|
vis bText4,0
|
||||||
|
vis hSlider4,0
|
||||||
|
- vis nNum4,0
|
||||||
|
+ //ui e5
|
||||||
|
+ vis btOnOff5,0
|
||||||
|
+ vis bUp5,0
|
||||||
|
+ vis bStop5,0
|
||||||
|
+ vis bDown5,0
|
||||||
|
+ vis tIcon5,0
|
||||||
|
+ vis tEntity5,0
|
||||||
|
+ vis bText5,0
|
||||||
|
+ vis hSlider5,0
|
||||||
|
+ //ui e6
|
||||||
|
+ vis btOnOff6,0
|
||||||
|
+ vis bUp6,0
|
||||||
|
+ vis bStop6,0
|
||||||
|
+ vis bDown6,0
|
||||||
|
+ vis tIcon6,0
|
||||||
|
+ vis tEntity6,0
|
||||||
|
+ vis bText6,0
|
||||||
|
+ vis hSlider6,0
|
||||||
|
|
||||||
|
Variable (string) strCommand
|
||||||
|
Attributes
|
||||||
|
@@ -117,6 +131,30 @@
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 70
|
||||||
|
|
||||||
|
+Variable (string) entn5
|
||||||
|
+ Attributes
|
||||||
|
+ Scope : local
|
||||||
|
+ Text :
|
||||||
|
+ Max. Text Size: 70
|
||||||
|
+
|
||||||
|
+Variable (string) entn6
|
||||||
|
+ Attributes
|
||||||
|
+ Scope : local
|
||||||
|
+ Text :
|
||||||
|
+ Max. Text Size: 70
|
||||||
|
+
|
||||||
|
+Variable (string) type5
|
||||||
|
+ Attributes
|
||||||
|
+ Scope : local
|
||||||
|
+ Text :
|
||||||
|
+ Max. Text Size: 10
|
||||||
|
+
|
||||||
|
+Variable (string) type6
|
||||||
|
+ Attributes
|
||||||
|
+ Scope : local
|
||||||
|
+ Text :
|
||||||
|
+ Max. Text Size: 10
|
||||||
|
+
|
||||||
|
Number nNum1
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
@@ -153,6 +191,24 @@
|
||||||
|
Associated Keyboard : none
|
||||||
|
Value : 0
|
||||||
|
|
||||||
|
+Number nNum5
|
||||||
|
+ Attributes
|
||||||
|
+ Scope : local
|
||||||
|
+ Dragging : 0
|
||||||
|
+ Disable release event after dragging: 0
|
||||||
|
+ Send Component ID : disabled
|
||||||
|
+ Associated Keyboard : none
|
||||||
|
+ Value : 0
|
||||||
|
+
|
||||||
|
+Number nNum6
|
||||||
|
+ Attributes
|
||||||
|
+ Scope : local
|
||||||
|
+ Dragging : 0
|
||||||
|
+ Disable release event after dragging: 0
|
||||||
|
+ Send Component ID : disabled
|
||||||
|
+ Associated Keyboard : none
|
||||||
|
+ Value : 0
|
||||||
|
+
|
||||||
|
Text tHeading
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
@@ -283,6 +339,46 @@
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 50
|
||||||
|
|
||||||
|
+Text tEntity5
|
||||||
|
+ Attributes
|
||||||
|
+ Scope : local
|
||||||
|
+ Dragging : 0
|
||||||
|
+ Disable release event after dragging: 0
|
||||||
|
+ Send Component ID : disabled
|
||||||
|
+ Associated Keyboard : none
|
||||||
|
+ Text : tEntity5
|
||||||
|
+ Max. Text Size : 30
|
||||||
|
+
|
||||||
|
+Text tIcon5
|
||||||
|
+ Attributes
|
||||||
|
+ Scope : local
|
||||||
|
+ Dragging : 0
|
||||||
|
+ Disable release event after dragging: 0
|
||||||
|
+ Send Component ID : disabled
|
||||||
|
+ Associated Keyboard : none
|
||||||
|
+ Text : î°
|
||||||
|
+ Max. Text Size : 30
|
||||||
|
+
|
||||||
|
+Text tEntity6
|
||||||
|
+ Attributes
|
||||||
|
+ Scope : local
|
||||||
|
+ Dragging : 0
|
||||||
|
+ Disable release event after dragging: 0
|
||||||
|
+ Send Component ID : disabled
|
||||||
|
+ Associated Keyboard : none
|
||||||
|
+ Text : tEntity6
|
||||||
|
+ Max. Text Size : 30
|
||||||
|
+
|
||||||
|
+Text tIcon6
|
||||||
|
+ Attributes
|
||||||
|
+ Scope : local
|
||||||
|
+ Dragging : 0
|
||||||
|
+ Disable release event after dragging: 0
|
||||||
|
+ Send Component ID : disabled
|
||||||
|
+ Associated Keyboard : none
|
||||||
|
+ Text : î°
|
||||||
|
+ Max. Text Size : 30
|
||||||
|
+
|
||||||
|
Picture p0
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
@@ -402,6 +498,62 @@
|
||||||
|
prints tSend.txt,0
|
||||||
|
prints crcval,2
|
||||||
|
|
||||||
|
+Slider hSlider5
|
||||||
|
+ Attributes
|
||||||
|
+ Scope : local
|
||||||
|
+ Dragging : 0
|
||||||
|
+ Disable release event after dragging: 0
|
||||||
|
+ Send Component ID : disabled
|
||||||
|
+ Position : 50
|
||||||
|
+ Upper range limit : 100
|
||||||
|
+ Lower range limit : 0
|
||||||
|
+
|
||||||
|
+ Events
|
||||||
|
+ Touch Release Event
|
||||||
|
+ nNum5.val=hSlider5.val
|
||||||
|
+ tSend.txt="event,buttonPress2,"+entn5.txt+",number-set,"
|
||||||
|
+ covx nNum5.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 hSlider6
|
||||||
|
+ Attributes
|
||||||
|
+ Scope : local
|
||||||
|
+ Dragging : 0
|
||||||
|
+ Disable release event after dragging: 0
|
||||||
|
+ Send Component ID : disabled
|
||||||
|
+ Position : 50
|
||||||
|
+ Upper range limit : 100
|
||||||
|
+ Lower range limit : 0
|
||||||
|
+
|
||||||
|
+ Events
|
||||||
|
+ Touch Release Event
|
||||||
|
+ nNum6.val=hSlider6.val
|
||||||
|
+ tSend.txt="event,buttonPress2,"+entn6.txt+",number-set,"
|
||||||
|
+ covx nNum6.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 bDown1
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
@@ -852,6 +1004,206 @@
|
||||||
|
prints tSend.txt,0
|
||||||
|
prints crcval,2
|
||||||
|
|
||||||
|
+Button bStop5
|
||||||
|
+ Attributes
|
||||||
|
+ Scope : local
|
||||||
|
+ Dragging : 0
|
||||||
|
+ Disable release event after dragging: 0
|
||||||
|
+ Send Component ID : disabled
|
||||||
|
+ State : unpressed
|
||||||
|
+ Text : î
|
||||||
|
+ Max. Text Size : 10
|
||||||
|
+
|
||||||
|
+ Events
|
||||||
|
+ Touch Press Event
|
||||||
|
+ tSend.txt="event,buttonPress2,"+entn5.txt+",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 bDown5
|
||||||
|
+ Attributes
|
||||||
|
+ Scope : local
|
||||||
|
+ Dragging : 0
|
||||||
|
+ Disable release event after dragging: 0
|
||||||
|
+ Send Component ID : disabled
|
||||||
|
+ State : unpressed
|
||||||
|
+ Text : î
|
||||||
|
+ Max. Text Size : 10
|
||||||
|
+
|
||||||
|
+ Events
|
||||||
|
+ Touch Press Event
|
||||||
|
+ tSend.txt="event,buttonPress2,"+entn4.txt+",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 bUp5
|
||||||
|
+ Attributes
|
||||||
|
+ Scope : local
|
||||||
|
+ Dragging : 0
|
||||||
|
+ Disable release event after dragging: 0
|
||||||
|
+ Send Component ID : disabled
|
||||||
|
+ State : unpressed
|
||||||
|
+ Text : î
|
||||||
|
+ Max. Text Size : 10
|
||||||
|
+
|
||||||
|
+ Events
|
||||||
|
+ Touch Press Event
|
||||||
|
+ tSend.txt="event,buttonPress2,"+entn5.txt+",up"
|
||||||
|
+ //send calc crc
|
||||||
|
+ btlen tSend.txt,sys0
|
||||||
|
+ crcrest 1,0xffff // reset CRC
|
||||||
|
+ crcputh 55 bb
|
||||||
|
+ crcputs sys0,1
|
||||||
|
+ crcputs tSend.txt,0
|
||||||
|
+ //send cmd
|
||||||
|
+ printh 55 bb
|
||||||
|
+ prints sys0,2
|
||||||
|
+ prints tSend.txt,0
|
||||||
|
+ prints crcval,2
|
||||||
|
+
|
||||||
|
+Button bText5
|
||||||
|
+ Attributes
|
||||||
|
+ Scope : local
|
||||||
|
+ Dragging : 0
|
||||||
|
+ Disable release event after dragging: 0
|
||||||
|
+ Send Component ID : disabled
|
||||||
|
+ State : unpressed
|
||||||
|
+ Text : newtxt
|
||||||
|
+ Max. Text Size : 10
|
||||||
|
+
|
||||||
|
+ Events
|
||||||
|
+ Touch Press Event
|
||||||
|
+ tSend.txt="event,buttonPress2,"+entn5.txt+",button"
|
||||||
|
+ //send calc crc
|
||||||
|
+ btlen tSend.txt,sys0
|
||||||
|
+ crcrest 1,0xffff // reset CRC
|
||||||
|
+ crcputh 55 bb
|
||||||
|
+ crcputs sys0,1
|
||||||
|
+ crcputs tSend.txt,0
|
||||||
|
+ //send cmd
|
||||||
|
+ printh 55 bb
|
||||||
|
+ prints sys0,2
|
||||||
|
+ prints tSend.txt,0
|
||||||
|
+ prints crcval,2
|
||||||
|
+
|
||||||
|
+Button bStop6
|
||||||
|
+ Attributes
|
||||||
|
+ Scope : local
|
||||||
|
+ Dragging : 0
|
||||||
|
+ Disable release event after dragging: 0
|
||||||
|
+ Send Component ID : disabled
|
||||||
|
+ State : unpressed
|
||||||
|
+ Text : î
|
||||||
|
+ Max. Text Size : 10
|
||||||
|
+
|
||||||
|
+ Events
|
||||||
|
+ Touch Press Event
|
||||||
|
+ tSend.txt="event,buttonPress2,"+entn6.txt+",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 bDown6
|
||||||
|
+ Attributes
|
||||||
|
+ Scope : local
|
||||||
|
+ Dragging : 0
|
||||||
|
+ Disable release event after dragging: 0
|
||||||
|
+ Send Component ID : disabled
|
||||||
|
+ State : unpressed
|
||||||
|
+ Text : î
|
||||||
|
+ Max. Text Size : 10
|
||||||
|
+
|
||||||
|
+ Events
|
||||||
|
+ Touch Press Event
|
||||||
|
+ tSend.txt="event,buttonPress2,"+entn4.txt+",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 bUp6
|
||||||
|
+ Attributes
|
||||||
|
+ Scope : local
|
||||||
|
+ Dragging : 0
|
||||||
|
+ Disable release event after dragging: 0
|
||||||
|
+ Send Component ID : disabled
|
||||||
|
+ State : unpressed
|
||||||
|
+ Text : î
|
||||||
|
+ Max. Text Size : 10
|
||||||
|
+
|
||||||
|
+ Events
|
||||||
|
+ Touch Press Event
|
||||||
|
+ tSend.txt="event,buttonPress2,"+entn6.txt+",up"
|
||||||
|
+ //send calc crc
|
||||||
|
+ btlen tSend.txt,sys0
|
||||||
|
+ crcrest 1,0xffff // reset CRC
|
||||||
|
+ crcputh 55 bb
|
||||||
|
+ crcputs sys0,1
|
||||||
|
+ crcputs tSend.txt,0
|
||||||
|
+ //send cmd
|
||||||
|
+ printh 55 bb
|
||||||
|
+ prints sys0,2
|
||||||
|
+ prints tSend.txt,0
|
||||||
|
+ prints crcval,2
|
||||||
|
+
|
||||||
|
+Button bText6
|
||||||
|
+ Attributes
|
||||||
|
+ Scope : local
|
||||||
|
+ Dragging : 0
|
||||||
|
+ Disable release event after dragging: 0
|
||||||
|
+ Send Component ID : disabled
|
||||||
|
+ State : unpressed
|
||||||
|
+ Text : newtxt
|
||||||
|
+ Max. Text Size : 10
|
||||||
|
+
|
||||||
|
+ Events
|
||||||
|
+ Touch Press Event
|
||||||
|
+ tSend.txt="event,buttonPress2,"+entn6.txt+",button"
|
||||||
|
+ //send calc crc
|
||||||
|
+ btlen tSend.txt,sys0
|
||||||
|
+ crcrest 1,0xffff // reset CRC
|
||||||
|
+ crcputh 55 bb
|
||||||
|
+ crcputs sys0,1
|
||||||
|
+ crcputs tSend.txt,0
|
||||||
|
+ //send cmd
|
||||||
|
+ printh 55 bb
|
||||||
|
+ prints sys0,2
|
||||||
|
+ prints tSend.txt,0
|
||||||
|
+ prints crcval,2
|
||||||
|
+
|
||||||
|
Dual-state Button btOnOff1
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
@@ -960,6 +1312,60 @@
|
||||||
|
prints tSend.txt,0
|
||||||
|
prints crcval,2
|
||||||
|
|
||||||
|
+Dual-state Button btOnOff5
|
||||||
|
+ Attributes
|
||||||
|
+ Scope : local
|
||||||
|
+ Dragging : 0
|
||||||
|
+ Disable release event after dragging: 0
|
||||||
|
+ Send Component ID : disabled
|
||||||
|
+ State : unpressed
|
||||||
|
+ Text :
|
||||||
|
+ Max. Text Size : 10
|
||||||
|
+
|
||||||
|
+ Events
|
||||||
|
+ Touch Press Event
|
||||||
|
+ tSend.txt="event,buttonPress2,"+entn5.txt+",OnOff,"
|
||||||
|
+ covx btOnOff5.val,tTmp.txt,0,0
|
||||||
|
+ tSend.txt+=tTmp.txt
|
||||||
|
+ //send calc crc
|
||||||
|
+ btlen tSend.txt,sys0
|
||||||
|
+ crcrest 1,0xffff // reset CRC
|
||||||
|
+ crcputh 55 bb
|
||||||
|
+ crcputs sys0,1
|
||||||
|
+ crcputs tSend.txt,0
|
||||||
|
+ //send cmd
|
||||||
|
+ printh 55 bb
|
||||||
|
+ prints sys0,2
|
||||||
|
+ prints tSend.txt,0
|
||||||
|
+ prints crcval,2
|
||||||
|
+
|
||||||
|
+Dual-state Button btOnOff6
|
||||||
|
+ Attributes
|
||||||
|
+ Scope : local
|
||||||
|
+ Dragging : 0
|
||||||
|
+ Disable release event after dragging: 0
|
||||||
|
+ Send Component ID : disabled
|
||||||
|
+ State : unpressed
|
||||||
|
+ Text :
|
||||||
|
+ Max. Text Size : 10
|
||||||
|
+
|
||||||
|
+ Events
|
||||||
|
+ Touch Press Event
|
||||||
|
+ tSend.txt="event,buttonPress2,"+entn6.txt+",OnOff,"
|
||||||
|
+ covx btOnOff6.val,tTmp.txt,0,0
|
||||||
|
+ tSend.txt+=tTmp.txt
|
||||||
|
+ //send calc crc
|
||||||
|
+ btlen tSend.txt,sys0
|
||||||
|
+ crcrest 1,0xffff // reset CRC
|
||||||
|
+ crcputh 55 bb
|
||||||
|
+ crcputs sys0,1
|
||||||
|
+ crcputs tSend.txt,0
|
||||||
|
+ //send cmd
|
||||||
|
+ printh 55 bb
|
||||||
|
+ prints sys0,2
|
||||||
|
+ prints tSend.txt,0
|
||||||
|
+ prints crcval,2
|
||||||
|
+
|
||||||
|
Hotspot mSpecial
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
@@ -1065,6 +1471,50 @@
|
||||||
|
page popupLight
|
||||||
|
}
|
||||||
|
|
||||||
|
+Hotspot m4
|
||||||
|
+ Attributes
|
||||||
|
+ Scope : local
|
||||||
|
+ Dragging : 0
|
||||||
|
+ Disable release event after dragging: 0
|
||||||
|
+ Send Component ID : disabled
|
||||||
|
+
|
||||||
|
+ Events
|
||||||
|
+ Touch Press Event
|
||||||
|
+ pageIcons.tTmp1.txt=tEntity5.txt
|
||||||
|
+ pageIcons.tTmp2.txt=entn5.txt
|
||||||
|
+ if(type5.txt=="shutter")
|
||||||
|
+ {
|
||||||
|
+ //popupShutter.tHeading.txt=tEntity5.txt
|
||||||
|
+ page popupShutter
|
||||||
|
+ }
|
||||||
|
+ if(type5.txt=="light")
|
||||||
|
+ {
|
||||||
|
+ //popupLight.tEntity.txt=tEntity5.txt
|
||||||
|
+ page popupLight
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+Hotspot m5
|
||||||
|
+ Attributes
|
||||||
|
+ Scope : local
|
||||||
|
+ Dragging : 0
|
||||||
|
+ Disable release event after dragging: 0
|
||||||
|
+ Send Component ID : disabled
|
||||||
|
+
|
||||||
|
+ Events
|
||||||
|
+ Touch Press Event
|
||||||
|
+ pageIcons.tTmp1.txt=tEntity6.txt
|
||||||
|
+ pageIcons.tTmp2.txt=entn6.txt
|
||||||
|
+ if(type6.txt=="shutter")
|
||||||
|
+ {
|
||||||
|
+ //popupShutter.tHeading.txt=tEntity6.txt
|
||||||
|
+ page popupShutter
|
||||||
|
+ }
|
||||||
|
+ if(type6.txt=="light")
|
||||||
|
+ {
|
||||||
|
+ //popupLight.tEntity.txt=tEntity6.txt
|
||||||
|
+ page popupLight
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
Timer tmSerial
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
@@ -1616,6 +2066,254 @@
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
hSlider4.maxval=sys0
|
||||||
|
}
|
||||||
|
+ // get Type
|
||||||
|
+ spstr strCommand.txt,type5.txt,",",27
|
||||||
|
+ // get internal name
|
||||||
|
+ spstr strCommand.txt,entn5.txt,",",28
|
||||||
|
+ if(type5.txt=="delete"||type5.txt=="")
|
||||||
|
+ {
|
||||||
|
+ vis bUp5,0
|
||||||
|
+ vis bStop5,0
|
||||||
|
+ vis bDown5,0
|
||||||
|
+ vis btOnOff5,0
|
||||||
|
+ vis tEntity5,0
|
||||||
|
+ vis tIcon5,0
|
||||||
|
+ vis bText5,0
|
||||||
|
+ vis hSlider5,0
|
||||||
|
+ vis nNum5,0
|
||||||
|
+ }else
|
||||||
|
+ {
|
||||||
|
+ // change icon
|
||||||
|
+ spstr strCommand.txt,tTmp.txt,",",29
|
||||||
|
+ covx tTmp.txt,sys0,0,0
|
||||||
|
+ substr pageIcons.tIcons.txt,tIcon5.txt,sys0,1
|
||||||
|
+ vis tIcon5,1
|
||||||
|
+ // change icon color
|
||||||
|
+ spstr strCommand.txt,tTmp.txt,",",30
|
||||||
|
+ covx tTmp.txt,sys0,0,0
|
||||||
|
+ tIcon5.pco=sys0
|
||||||
|
+ // set name
|
||||||
|
+ spstr strCommand.txt,tEntity5.txt,",",31
|
||||||
|
+ vis tEntity5,1
|
||||||
|
+ }
|
||||||
|
+ if(type5.txt=="shutter")
|
||||||
|
+ {
|
||||||
|
+ vis bUp5,1
|
||||||
|
+ vis bStop5,1
|
||||||
|
+ vis bDown5,1
|
||||||
|
+ vis btOnOff5,0
|
||||||
|
+ vis bText5,0
|
||||||
|
+ vis hSlider5,0
|
||||||
|
+ vis nNum5,0
|
||||||
|
+ }
|
||||||
|
+ if(type5.txt=="light")
|
||||||
|
+ {
|
||||||
|
+ vis bUp5,0
|
||||||
|
+ vis bStop5,0
|
||||||
|
+ vis bDown5,0
|
||||||
|
+ vis btOnOff5,1
|
||||||
|
+ vis bText5,0
|
||||||
|
+ vis hSlider5,0
|
||||||
|
+ vis nNum5,0
|
||||||
|
+ // get Button State (optional Value)
|
||||||
|
+ spstr strCommand.txt,tTmp.txt,",",32
|
||||||
|
+ covx tTmp.txt,sys0,0,0
|
||||||
|
+ btOnOff5.val=sys0
|
||||||
|
+ }
|
||||||
|
+ if(type5.txt=="switch")
|
||||||
|
+ {
|
||||||
|
+ vis bUp5,0
|
||||||
|
+ vis bStop5,0
|
||||||
|
+ vis bDown5,0
|
||||||
|
+ vis btOnOff5,1
|
||||||
|
+ vis bText5,0
|
||||||
|
+ vis hSlider5,0
|
||||||
|
+ vis nNum5,0
|
||||||
|
+ // get Button State (optional Value)
|
||||||
|
+ spstr strCommand.txt,tTmp.txt,",",32
|
||||||
|
+ covx tTmp.txt,sys0,0,0
|
||||||
|
+ btOnOff5.val=sys0
|
||||||
|
+ }
|
||||||
|
+ if(type5.txt=="text")
|
||||||
|
+ {
|
||||||
|
+ vis bUp5,0
|
||||||
|
+ vis bStop5,0
|
||||||
|
+ vis bDown5,0
|
||||||
|
+ vis btOnOff5,0
|
||||||
|
+ vis bText5,1
|
||||||
|
+ tsw bText5,0
|
||||||
|
+ vis hSlider5,0
|
||||||
|
+ vis nNum5,0
|
||||||
|
+ bText5.pco=65535
|
||||||
|
+ bText5.pco2=65535
|
||||||
|
+ // get Text (optional Value)
|
||||||
|
+ spstr strCommand.txt,bText5.txt,",",32
|
||||||
|
+ }
|
||||||
|
+ if(type5.txt=="button")
|
||||||
|
+ {
|
||||||
|
+ vis bUp5,0
|
||||||
|
+ vis bStop5,0
|
||||||
|
+ vis bDown5,0
|
||||||
|
+ vis btOnOff5,0
|
||||||
|
+ vis bText5,1
|
||||||
|
+ tsw bText5,1
|
||||||
|
+ vis hSlider5,0
|
||||||
|
+ vis nNum5,0
|
||||||
|
+ bText5.pco=1374
|
||||||
|
+ bText5.pco2=1374
|
||||||
|
+ // get Text (optional Value)
|
||||||
|
+ spstr strCommand.txt,bText5.txt,",",32
|
||||||
|
+ }
|
||||||
|
+ if(type5.txt=="number")
|
||||||
|
+ {
|
||||||
|
+ vis bUp5,0
|
||||||
|
+ vis bStop5,0
|
||||||
|
+ vis bDown5,0
|
||||||
|
+ vis btOnOff5,0
|
||||||
|
+ vis bText5,0
|
||||||
|
+ tsw bText5,0
|
||||||
|
+ vis hSlider5,1
|
||||||
|
+ vis nNum5,1
|
||||||
|
+ // get config (optional Value) (use bText as variable)
|
||||||
|
+ spstr strCommand.txt,bText5.txt,",",32
|
||||||
|
+ //first value is current value
|
||||||
|
+ spstr bText5.txt,tTmp.txt,"|",0
|
||||||
|
+ covx tTmp.txt,sys0,0,0
|
||||||
|
+ hSlider5.val=sys0
|
||||||
|
+ nNum5.val=sys0
|
||||||
|
+ //second value is min value
|
||||||
|
+ spstr bText5.txt,tTmp.txt,"|",1
|
||||||
|
+ covx tTmp.txt,sys0,0,0
|
||||||
|
+ hSlider5.minval=sys0
|
||||||
|
+ //third value is max value
|
||||||
|
+ spstr bText5.txt,tTmp.txt,"|",2
|
||||||
|
+ covx tTmp.txt,sys0,0,0
|
||||||
|
+ hSlider5.maxval=sys0
|
||||||
|
+ }
|
||||||
|
+ // get Type
|
||||||
|
+ spstr strCommand.txt,type6.txt,",",33
|
||||||
|
+ // get internal name
|
||||||
|
+ spstr strCommand.txt,entn6.txt,",",34
|
||||||
|
+ if(type6.txt=="delete"||type6.txt=="")
|
||||||
|
+ {
|
||||||
|
+ vis bUp6,0
|
||||||
|
+ vis bStop6,0
|
||||||
|
+ vis bDown6,0
|
||||||
|
+ vis btOnOff6,0
|
||||||
|
+ vis tEntity6,0
|
||||||
|
+ vis tIcon6,0
|
||||||
|
+ vis bText6,0
|
||||||
|
+ vis hSlider6,0
|
||||||
|
+ vis nNum6,0
|
||||||
|
+ }else
|
||||||
|
+ {
|
||||||
|
+ // change icon
|
||||||
|
+ spstr strCommand.txt,tTmp.txt,",",35
|
||||||
|
+ covx tTmp.txt,sys0,0,0
|
||||||
|
+ substr pageIcons.tIcons.txt,tIcon6.txt,sys0,1
|
||||||
|
+ vis tIcon6,1
|
||||||
|
+ // change icon color
|
||||||
|
+ spstr strCommand.txt,tTmp.txt,",",36
|
||||||
|
+ covx tTmp.txt,sys0,0,0
|
||||||
|
+ tIcon6.pco=sys0
|
||||||
|
+ // set name
|
||||||
|
+ spstr strCommand.txt,tEntity6.txt,",",37
|
||||||
|
+ vis tEntity6,1
|
||||||
|
+ }
|
||||||
|
+ if(type6.txt=="shutter")
|
||||||
|
+ {
|
||||||
|
+ vis bUp6,1
|
||||||
|
+ vis bStop6,1
|
||||||
|
+ vis bDown6,1
|
||||||
|
+ vis btOnOff6,0
|
||||||
|
+ vis bText6,0
|
||||||
|
+ vis hSlider6,0
|
||||||
|
+ vis nNum6,0
|
||||||
|
+ }
|
||||||
|
+ if(type6.txt=="light")
|
||||||
|
+ {
|
||||||
|
+ vis bUp6,0
|
||||||
|
+ vis bStop6,0
|
||||||
|
+ vis bDown6,0
|
||||||
|
+ vis btOnOff6,1
|
||||||
|
+ vis bText6,0
|
||||||
|
+ vis hSlider6,0
|
||||||
|
+ vis nNum6,0
|
||||||
|
+ // get Button State (optional Value)
|
||||||
|
+ spstr strCommand.txt,tTmp.txt,",",38
|
||||||
|
+ covx tTmp.txt,sys0,0,0
|
||||||
|
+ btOnOff6.val=sys0
|
||||||
|
+ }
|
||||||
|
+ if(type6.txt=="switch")
|
||||||
|
+ {
|
||||||
|
+ vis bUp6,0
|
||||||
|
+ vis bStop6,0
|
||||||
|
+ vis bDown6,0
|
||||||
|
+ vis btOnOff6,1
|
||||||
|
+ vis bText6,0
|
||||||
|
+ vis hSlider6,0
|
||||||
|
+ vis nNum6,0
|
||||||
|
+ // get Button State (optional Value)
|
||||||
|
+ spstr strCommand.txt,tTmp.txt,",",38
|
||||||
|
+ covx tTmp.txt,sys0,0,0
|
||||||
|
+ btOnOff6.val=sys0
|
||||||
|
+ }
|
||||||
|
+ if(type6.txt=="text")
|
||||||
|
+ {
|
||||||
|
+ vis bUp6,0
|
||||||
|
+ vis bStop6,0
|
||||||
|
+ vis bDown6,0
|
||||||
|
+ vis btOnOff6,0
|
||||||
|
+ vis bText6,1
|
||||||
|
+ tsw bText6,0
|
||||||
|
+ vis hSlider6,0
|
||||||
|
+ vis nNum6,0
|
||||||
|
+ bText6.pco=65535
|
||||||
|
+ bText6.pco2=65535
|
||||||
|
+ // get Text (optional Value)
|
||||||
|
+ spstr strCommand.txt,bText6.txt,",",38
|
||||||
|
+ }
|
||||||
|
+ if(type6.txt=="button")
|
||||||
|
+ {
|
||||||
|
+ vis bUp6,0
|
||||||
|
+ vis bStop6,0
|
||||||
|
+ vis bDown6,0
|
||||||
|
+ vis btOnOff6,0
|
||||||
|
+ vis bText6,1
|
||||||
|
+ tsw bText6,1
|
||||||
|
+ vis hSlider6,0
|
||||||
|
+ vis nNum6,0
|
||||||
|
+ bText6.pco=1374
|
||||||
|
+ bText6.pco2=1374
|
||||||
|
+ // get Text (optional Value)
|
||||||
|
+ spstr strCommand.txt,bText6.txt,",",38
|
||||||
|
+ }
|
||||||
|
+ if(type6.txt=="number")
|
||||||
|
+ {
|
||||||
|
+ vis bUp6,0
|
||||||
|
+ vis bStop6,0
|
||||||
|
+ vis bDown6,0
|
||||||
|
+ vis btOnOff6,0
|
||||||
|
+ vis bText6,0
|
||||||
|
+ tsw bText6,0
|
||||||
|
+ vis hSlider6,1
|
||||||
|
+ vis nNum6,1
|
||||||
|
+ // get config (optional Value) (use bText as variable)
|
||||||
|
+ spstr strCommand.txt,bText6.txt,",",38
|
||||||
|
+ //first value is current value
|
||||||
|
+ spstr bText6.txt,tTmp.txt,"|",0
|
||||||
|
+ covx tTmp.txt,sys0,0,0
|
||||||
|
+ hSlider6.val=sys0
|
||||||
|
+ nNum6.val=sys0
|
||||||
|
+ //second value is min value
|
||||||
|
+ spstr bText6.txt,tTmp.txt,"|",1
|
||||||
|
+ covx tTmp.txt,sys0,0,0
|
||||||
|
+ hSlider6.minval=sys0
|
||||||
|
+ //third value is max value
|
||||||
|
+ spstr bText6.txt,tTmp.txt,"|",2
|
||||||
|
+ covx tTmp.txt,sys0,0,0
|
||||||
|
+ hSlider6.maxval=sys0
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
if(tInstruction.txt=="pageType")
|
||||||
|
{
|
||||||
|
diff -bur HMI/n2t-out/pageStartup.txt HMI/US/portrait/n2t-out/pageStartup.txt
|
||||||
|
--- HMI/n2t-out/pageStartup.txt 2022-03-29 11:46:11.344670256 +0000
|
||||||
|
+++ HMI/US/portrait/n2t-out/pageStartup.txt 2022-03-29 11:46:11.748675118 +0000
|
||||||
|
@@ -142,7 +142,7 @@
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
- Text : please check your backend configuration
|
||||||
|
+ Text : pls check your backend configuration
|
||||||
|
Max. Text Size : 100
|
||||||
|
|
||||||
|
Text tVersion
|
||||||
15
HMI/US/portrait/n2t-out/Program.s.txt
Normal file
15
HMI/US/portrait/n2t-out/Program.s.txt
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
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
|
||||||
|
// sleep timeout in s
|
||||||
|
int sleepTimeout=20
|
||||||
|
int sleepValue=0
|
||||||
|
// dim value
|
||||||
|
int dimValue=40
|
||||||
|
// fix touch offset (Removed for US version)
|
||||||
|
//lcd_dev fffb 0002 0000 0020
|
||||||
|
page pageStartup
|
||||||
705
HMI/US/portrait/n2t-out/cardAlarm.txt
Normal file
705
HMI/US/portrait/n2t-out/cardAlarm.txt
Normal file
@@ -0,0 +1,705 @@
|
|||||||
|
Page cardAlarm
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Locked : no
|
||||||
|
Swide up page ID : disabled
|
||||||
|
Swide down page ID : disabled
|
||||||
|
Swide left page ID : disabled
|
||||||
|
Swide right page ID : disabled
|
||||||
|
|
||||||
|
Events
|
||||||
|
Preinitialize Event
|
||||||
|
vis p0,0
|
||||||
|
vis tSend,0
|
||||||
|
vis tInstruction,0
|
||||||
|
vis tTmp,0
|
||||||
|
vis tId,0
|
||||||
|
//vis nPageDisp,0
|
||||||
|
vis arm1,0
|
||||||
|
vis arm2,0
|
||||||
|
vis arm3,0
|
||||||
|
vis arm4,0
|
||||||
|
vis b0,0
|
||||||
|
vis b1,0
|
||||||
|
vis b2,0
|
||||||
|
vis b3,0
|
||||||
|
vis b4,0
|
||||||
|
vis b5,0
|
||||||
|
vis b6,0
|
||||||
|
vis b7,0
|
||||||
|
vis b8,0
|
||||||
|
vis b9,0
|
||||||
|
vis b10,0
|
||||||
|
vis tCode,0
|
||||||
|
|
||||||
|
Variable (string) strCommand
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 200
|
||||||
|
|
||||||
|
Variable (string) entn
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 50
|
||||||
|
|
||||||
|
Variable (string) tSend
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 100
|
||||||
|
|
||||||
|
Variable (string) va1
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 20
|
||||||
|
|
||||||
|
Variable (string) va2
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 20
|
||||||
|
|
||||||
|
Variable (string) va3
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 20
|
||||||
|
|
||||||
|
Variable (string) va4
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 20
|
||||||
|
|
||||||
|
Text tTmp
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Text tInstruction
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 20
|
||||||
|
|
||||||
|
Text tId
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 20
|
||||||
|
|
||||||
|
Text tCode
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Text tIcon
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Picture p0
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
|
||||||
|
Button bNext
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : î³
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
tSend.txt="event,buttonPress2,cardAlarm,bNext"
|
||||||
|
//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
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : î°
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
tSend.txt="event,buttonPress2,cardAlarm,bPrev"
|
||||||
|
//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
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : 1
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
tCode.txt=tCode.txt+"1"
|
||||||
|
|
||||||
|
Button b1
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : 2
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
tCode.txt=tCode.txt+"2"
|
||||||
|
|
||||||
|
Button b2
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : 3
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
tCode.txt=tCode.txt+"3"
|
||||||
|
|
||||||
|
Button b3
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : 4
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
tCode.txt=tCode.txt+"4"
|
||||||
|
|
||||||
|
Button b4
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : 5
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
tCode.txt=tCode.txt+"5"
|
||||||
|
|
||||||
|
Button b5
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : 6
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
tCode.txt=tCode.txt+"6"
|
||||||
|
|
||||||
|
Button b6
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : 7
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
tCode.txt=tCode.txt+"7"
|
||||||
|
|
||||||
|
Button b7
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : 8
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
tCode.txt=tCode.txt+"8"
|
||||||
|
|
||||||
|
Button b8
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : 9
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
tCode.txt=tCode.txt+"9"
|
||||||
|
|
||||||
|
Button b9
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : 0
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
tCode.txt=tCode.txt+"0"
|
||||||
|
|
||||||
|
Button b10
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : CLR
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
tCode.txt=""
|
||||||
|
|
||||||
|
Button arm1
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 40
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
// event,buttonPress2,entn,arm1,tCode
|
||||||
|
tSend.txt="event,buttonPress2,"
|
||||||
|
tSend.txt+=entn.txt+","
|
||||||
|
tSend.txt+=va1.txt+","
|
||||||
|
tSend.txt+=tCode.txt
|
||||||
|
//send calc crc
|
||||||
|
btlen tSend.txt,sys0
|
||||||
|
crcrest 1,0xffff // reset CRC
|
||||||
|
crcputh 55 bb
|
||||||
|
crcputs sys0,1
|
||||||
|
crcputs tSend.txt,0
|
||||||
|
//send cmd
|
||||||
|
printh 55 bb
|
||||||
|
prints sys0,2
|
||||||
|
prints tSend.txt,0
|
||||||
|
prints crcval,2
|
||||||
|
tCode.txt=""
|
||||||
|
|
||||||
|
Button arm3
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 40
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
// event,buttonPress2,entn,arm1,tCode
|
||||||
|
tSend.txt="event,buttonPress2,"
|
||||||
|
tSend.txt+=entn.txt+","
|
||||||
|
tSend.txt+=va3.txt+","
|
||||||
|
tSend.txt+=tCode.txt
|
||||||
|
//send calc crc
|
||||||
|
btlen tSend.txt,sys0
|
||||||
|
crcrest 1,0xffff // reset CRC
|
||||||
|
crcputh 55 bb
|
||||||
|
crcputs sys0,1
|
||||||
|
crcputs tSend.txt,0
|
||||||
|
//send cmd
|
||||||
|
printh 55 bb
|
||||||
|
prints sys0,2
|
||||||
|
prints tSend.txt,0
|
||||||
|
prints crcval,2
|
||||||
|
tCode.txt=""
|
||||||
|
|
||||||
|
Button arm2
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 40
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
// event,buttonPress2,entn,arm1,tCode
|
||||||
|
tSend.txt="event,buttonPress2,"
|
||||||
|
tSend.txt+=entn.txt+","
|
||||||
|
tSend.txt+=va2.txt+","
|
||||||
|
tSend.txt+=tCode.txt
|
||||||
|
//send calc crc
|
||||||
|
btlen tSend.txt,sys0
|
||||||
|
crcrest 1,0xffff // reset CRC
|
||||||
|
crcputh 55 bb
|
||||||
|
crcputs sys0,1
|
||||||
|
crcputs tSend.txt,0
|
||||||
|
//send cmd
|
||||||
|
printh 55 bb
|
||||||
|
prints sys0,2
|
||||||
|
prints tSend.txt,0
|
||||||
|
prints crcval,2
|
||||||
|
tCode.txt=""
|
||||||
|
|
||||||
|
Button arm4
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 40
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
// event,buttonPress2,entn,arm1,tCode
|
||||||
|
tSend.txt="event,buttonPress2,"
|
||||||
|
tSend.txt+=entn.txt+","
|
||||||
|
tSend.txt+=va4.txt+","
|
||||||
|
tSend.txt+=tCode.txt
|
||||||
|
//send calc crc
|
||||||
|
btlen tSend.txt,sys0
|
||||||
|
crcrest 1,0xffff // reset CRC
|
||||||
|
crcputh 55 bb
|
||||||
|
crcputs sys0,1
|
||||||
|
crcputs tSend.txt,0
|
||||||
|
//send cmd
|
||||||
|
printh 55 bb
|
||||||
|
prints sys0,2
|
||||||
|
prints tSend.txt,0
|
||||||
|
prints crcval,2
|
||||||
|
tCode.txt=""
|
||||||
|
|
||||||
|
Timer tmSerial
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Period (ms): 50
|
||||||
|
Enabled : yes
|
||||||
|
|
||||||
|
Events
|
||||||
|
Timer Event
|
||||||
|
// data available
|
||||||
|
if(usize>1)
|
||||||
|
{
|
||||||
|
bufferPos=0
|
||||||
|
while(bufferPos<usize)
|
||||||
|
{
|
||||||
|
// check for 0x55 0xBB - Command Init Secuence
|
||||||
|
if(u[bufferPos]==187&&u[bufferPos-1]==85)
|
||||||
|
{
|
||||||
|
//remove garbage at the start of the buffer if there's any to free buffer for command
|
||||||
|
if(u[bufferPos]!=1)
|
||||||
|
{
|
||||||
|
udelete bufferPos-1
|
||||||
|
}
|
||||||
|
//instruction is now aligned with buffer, because we deleted garbage before instrcution
|
||||||
|
//get length after init sequence (check if there are more than to bytes in buffer)
|
||||||
|
if(3<usize)
|
||||||
|
{
|
||||||
|
// check if serial buffer has reached the announced length
|
||||||
|
ucopy payloadLength,2,2,0
|
||||||
|
// we are only checking payload length so we have to skip first 3 bytes (init+payload length) (-1 because of < instead of <=)
|
||||||
|
payloadLength+=3
|
||||||
|
// payload length does also not contain crc, so we are adding another 2 bytes for crc
|
||||||
|
payloadLength+=2
|
||||||
|
if(payloadLength<usize)
|
||||||
|
{
|
||||||
|
// calculate crc
|
||||||
|
crcrest 1,0xFFFF
|
||||||
|
// u[2] contains payload legth at 3rd pos in buffer, we are calculating crc from 3rd pos with number of bytes from payload length
|
||||||
|
//crcputu 3,u[2]
|
||||||
|
// u[2] cotnains payload length, we are calculating a crc over the whole message, so we have to add 3 to the length from u[2]
|
||||||
|
crcputu 0,payloadLength-1
|
||||||
|
// get recived crc to be able to compare it
|
||||||
|
ucopy recvCrc,payloadLength-1,2,0
|
||||||
|
// compare crc with recived value
|
||||||
|
if(crcval==recvCrc)
|
||||||
|
{
|
||||||
|
// crc is okay
|
||||||
|
// here is the location where acual code should be
|
||||||
|
// write command to variable strCommand
|
||||||
|
ucopy strCommand.txt,4,payloadLength-5,0
|
||||||
|
// write instruction to tInstuction (debug output, but used as variable here, ui elements will be disabled by default)
|
||||||
|
spstr strCommand.txt,tInstruction.txt,",",0
|
||||||
|
if(tInstruction.txt=="entityUpd")
|
||||||
|
{
|
||||||
|
//entn
|
||||||
|
spstr strCommand.txt,entn.txt,",",1
|
||||||
|
//text arm1
|
||||||
|
spstr strCommand.txt,arm1.txt,",",2
|
||||||
|
if(arm1.txt!="")
|
||||||
|
{
|
||||||
|
vis arm1,1
|
||||||
|
}
|
||||||
|
//id arm1
|
||||||
|
spstr strCommand.txt,va1.txt,",",3
|
||||||
|
//text arm2
|
||||||
|
spstr strCommand.txt,arm2.txt,",",4
|
||||||
|
if(arm2.txt!="")
|
||||||
|
{
|
||||||
|
vis arm2,1
|
||||||
|
}
|
||||||
|
//id arm2
|
||||||
|
spstr strCommand.txt,va2.txt,",",5
|
||||||
|
//text arm3
|
||||||
|
spstr strCommand.txt,arm3.txt,",",6
|
||||||
|
if(arm3.txt!="")
|
||||||
|
{
|
||||||
|
vis arm3,1
|
||||||
|
}
|
||||||
|
//id arm3
|
||||||
|
spstr strCommand.txt,va3.txt,",",7
|
||||||
|
//text arm4
|
||||||
|
spstr strCommand.txt,arm4.txt,",",8
|
||||||
|
if(arm4.txt!="")
|
||||||
|
{
|
||||||
|
vis arm4,1
|
||||||
|
}
|
||||||
|
//id arm4
|
||||||
|
spstr strCommand.txt,va4.txt,",",9
|
||||||
|
//icon
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",10
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
substr pageIcons.tIcons.txt,tIcon.txt,sys0,1
|
||||||
|
//icon color
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",11
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
tIcon.pco=sys0
|
||||||
|
//numpad status
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",12
|
||||||
|
if(tTmp.txt!="disable")
|
||||||
|
{
|
||||||
|
vis b0,1
|
||||||
|
vis b1,1
|
||||||
|
vis b2,1
|
||||||
|
vis b3,1
|
||||||
|
vis b4,1
|
||||||
|
vis b5,1
|
||||||
|
vis b6,1
|
||||||
|
vis b7,1
|
||||||
|
vis b8,1
|
||||||
|
vis b9,1
|
||||||
|
vis b10,1
|
||||||
|
vis tCode,1
|
||||||
|
}
|
||||||
|
//flashing status
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",13
|
||||||
|
if(tTmp.txt=="enable")
|
||||||
|
{
|
||||||
|
tmFlash.en=1
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
tmFlash.en=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
|
||||||
|
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
|
||||||
|
//save third arg if there's one
|
||||||
|
spstr strCommand.txt,pageIcons.tTmp2.txt,",",3
|
||||||
|
//we are going to exit this page with this command, so we have to clear the buffer, so we are not getting into a stupid loop ...
|
||||||
|
udelete payloadLength-1
|
||||||
|
bufferPos=0
|
||||||
|
if(tId.txt=="popupLight")
|
||||||
|
{
|
||||||
|
pageIcons.tTmp1.txt=tTmp.txt
|
||||||
|
page popupLight
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardEntities")
|
||||||
|
{
|
||||||
|
page cardEntities
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardThermo")
|
||||||
|
{
|
||||||
|
page cardThermo
|
||||||
|
}
|
||||||
|
if(tId.txt=="pageStartup")
|
||||||
|
{
|
||||||
|
page pageStartup
|
||||||
|
}
|
||||||
|
if(tId.txt=="popupNotify")
|
||||||
|
{
|
||||||
|
page popupNotify
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardGrid")
|
||||||
|
{
|
||||||
|
page cardGrid
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardMedia")
|
||||||
|
{
|
||||||
|
page cardMedia
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// end of user code
|
||||||
|
udelete payloadLength-1
|
||||||
|
bufferPos=0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// next character
|
||||||
|
bufferPos++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Timer tmSleep
|
||||||
|
Attributes
|
||||||
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Timer tmFlash
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Period (ms): 600
|
||||||
|
Enabled : no
|
||||||
|
|
||||||
|
Events
|
||||||
|
Timer Event
|
||||||
|
if(tIcon.isbr==1)
|
||||||
|
{
|
||||||
|
tIcon.isbr=0
|
||||||
|
vis tIcon,0
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
tIcon.isbr=1
|
||||||
|
vis tIcon,1
|
||||||
|
}
|
||||||
|
|
||||||
|
TouchCap tc0
|
||||||
|
Attributes
|
||||||
|
Scope: local
|
||||||
|
Value: 0
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
sleepValue=0
|
||||||
|
|
||||||
2434
HMI/US/portrait/n2t-out/cardEntities.txt
Normal file
2434
HMI/US/portrait/n2t-out/cardEntities.txt
Normal file
File diff suppressed because it is too large
Load Diff
839
HMI/US/portrait/n2t-out/cardGrid.txt
Normal file
839
HMI/US/portrait/n2t-out/cardGrid.txt
Normal file
@@ -0,0 +1,839 @@
|
|||||||
|
Page cardGrid
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Locked : no
|
||||||
|
Swide up page ID : disabled
|
||||||
|
Swide down page ID : disabled
|
||||||
|
Swide left page ID : disabled
|
||||||
|
Swide right page ID : disabled
|
||||||
|
|
||||||
|
Events
|
||||||
|
Preinitialize Event
|
||||||
|
//wup=cardEntities
|
||||||
|
//remove background & activate reparse mode
|
||||||
|
vis p0,0
|
||||||
|
recmod=1
|
||||||
|
bauds=115200
|
||||||
|
//debug stuff
|
||||||
|
vis tTmp,0
|
||||||
|
vis tSend,0
|
||||||
|
vis tInstruction,0
|
||||||
|
vis tId,0
|
||||||
|
vis bEntity1,0
|
||||||
|
vis bEntity2,0
|
||||||
|
vis bEntity3,0
|
||||||
|
vis bEntity4,0
|
||||||
|
vis bEntity5,0
|
||||||
|
vis bEntity6,0
|
||||||
|
vis tEntity1,0
|
||||||
|
vis tEntity2,0
|
||||||
|
vis tEntity3,0
|
||||||
|
vis tEntity4,0
|
||||||
|
vis tEntity5,0
|
||||||
|
vis tEntity6,0
|
||||||
|
|
||||||
|
Variable (string) strCommand
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 500
|
||||||
|
|
||||||
|
Variable (string) type1
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 10
|
||||||
|
|
||||||
|
Variable (string) type2
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 10
|
||||||
|
|
||||||
|
Variable (string) type3
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 10
|
||||||
|
|
||||||
|
Variable (string) type4
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 10
|
||||||
|
|
||||||
|
Variable (string) entn1
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 70
|
||||||
|
|
||||||
|
Variable (string) entn2
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 70
|
||||||
|
|
||||||
|
Variable (string) entn3
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 70
|
||||||
|
|
||||||
|
Variable (string) entn4
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 70
|
||||||
|
|
||||||
|
Variable (string) type5
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 10
|
||||||
|
|
||||||
|
Variable (string) type6
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 10
|
||||||
|
|
||||||
|
Variable (string) entn5
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 50
|
||||||
|
|
||||||
|
Variable (string) entn6
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 50
|
||||||
|
|
||||||
|
Text tHeading
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 40
|
||||||
|
|
||||||
|
Text tEntity1
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : tEntity1
|
||||||
|
Max. Text Size : 30
|
||||||
|
|
||||||
|
Text tSend
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : newtxt
|
||||||
|
Max. Text Size : 100
|
||||||
|
|
||||||
|
Text tTmp
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Text tInstruction
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 20
|
||||||
|
|
||||||
|
Text tId
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 50
|
||||||
|
|
||||||
|
Text tEntity2
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : tEntity2
|
||||||
|
Max. Text Size : 30
|
||||||
|
|
||||||
|
Text tEntity3
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : tEntity3
|
||||||
|
Max. Text Size : 30
|
||||||
|
|
||||||
|
Text tEntity4
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : tEntity4
|
||||||
|
Max. Text Size : 30
|
||||||
|
|
||||||
|
Text tEntity5
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : tEntity5
|
||||||
|
Max. Text Size : 30
|
||||||
|
|
||||||
|
Text tEntity6
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : tEntity6
|
||||||
|
Max. Text Size : 30
|
||||||
|
|
||||||
|
Picture p0
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
|
||||||
|
Button bPrev
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : î°
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
tSend.txt="event,buttonPress2,cardGrid,bPrev"
|
||||||
|
//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
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : î³
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
tSend.txt="event,buttonPress2,cardGrid,bNext"
|
||||||
|
//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 bEntity1
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : î´
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
tmLP.en=1
|
||||||
|
tTmp.txt=type1.txt
|
||||||
|
pageIcons.tTmp1.txt=tEntity1.txt
|
||||||
|
pageIcons.tTmp2.txt=entn1.txt
|
||||||
|
if(type1.txt=="shutter")
|
||||||
|
{
|
||||||
|
page popupShutter
|
||||||
|
}
|
||||||
|
|
||||||
|
Touch Release Event
|
||||||
|
tmLP.en=0
|
||||||
|
tSend.txt="event,buttonPress2,"+entn1.txt+",button"
|
||||||
|
//send calc crc
|
||||||
|
btlen tSend.txt,sys0
|
||||||
|
crcrest 1,0xffff // reset CRC
|
||||||
|
crcputh 55 bb
|
||||||
|
crcputs sys0,1
|
||||||
|
crcputs tSend.txt,0
|
||||||
|
//send cmd
|
||||||
|
printh 55 bb
|
||||||
|
prints sys0,2
|
||||||
|
prints tSend.txt,0
|
||||||
|
prints crcval,2
|
||||||
|
|
||||||
|
Button bEntity2
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : î´
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
tmLP.en=1
|
||||||
|
tTmp.txt=type2.txt
|
||||||
|
pageIcons.tTmp1.txt=tEntity2.txt
|
||||||
|
pageIcons.tTmp2.txt=entn2.txt
|
||||||
|
if(type2.txt=="shutter")
|
||||||
|
{
|
||||||
|
page popupShutter
|
||||||
|
}
|
||||||
|
|
||||||
|
Touch Release Event
|
||||||
|
tmLP.en=0
|
||||||
|
tSend.txt="event,buttonPress2,"+entn2.txt+",button"
|
||||||
|
//send calc crc
|
||||||
|
btlen tSend.txt,sys0
|
||||||
|
crcrest 1,0xffff // reset CRC
|
||||||
|
crcputh 55 bb
|
||||||
|
crcputs sys0,1
|
||||||
|
crcputs tSend.txt,0
|
||||||
|
//send cmd
|
||||||
|
printh 55 bb
|
||||||
|
prints sys0,2
|
||||||
|
prints tSend.txt,0
|
||||||
|
prints crcval,2
|
||||||
|
|
||||||
|
Button bEntity3
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : î´
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
tmLP.en=1
|
||||||
|
tTmp.txt=type3.txt
|
||||||
|
pageIcons.tTmp1.txt=tEntity3.txt
|
||||||
|
pageIcons.tTmp2.txt=entn3.txt
|
||||||
|
if(type3.txt=="shutter")
|
||||||
|
{
|
||||||
|
page popupShutter
|
||||||
|
}
|
||||||
|
|
||||||
|
Touch Release Event
|
||||||
|
tmLP.en=0
|
||||||
|
tSend.txt="event,buttonPress2,"+entn3.txt+",button"
|
||||||
|
//send calc crc
|
||||||
|
btlen tSend.txt,sys0
|
||||||
|
crcrest 1,0xffff // reset CRC
|
||||||
|
crcputh 55 bb
|
||||||
|
crcputs sys0,1
|
||||||
|
crcputs tSend.txt,0
|
||||||
|
//send cmd
|
||||||
|
printh 55 bb
|
||||||
|
prints sys0,2
|
||||||
|
prints tSend.txt,0
|
||||||
|
prints crcval,2
|
||||||
|
|
||||||
|
Button bEntity4
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : î´
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
tmLP.en=1
|
||||||
|
tTmp.txt=type4.txt
|
||||||
|
pageIcons.tTmp1.txt=tEntity4.txt
|
||||||
|
pageIcons.tTmp2.txt=entn4.txt
|
||||||
|
if(type4.txt=="shutter")
|
||||||
|
{
|
||||||
|
page popupShutter
|
||||||
|
}
|
||||||
|
|
||||||
|
Touch Release Event
|
||||||
|
tmLP.en=0
|
||||||
|
tSend.txt="event,buttonPress2,"+entn4.txt+",button"
|
||||||
|
//send calc crc
|
||||||
|
btlen tSend.txt,sys0
|
||||||
|
crcrest 1,0xffff // reset CRC
|
||||||
|
crcputh 55 bb
|
||||||
|
crcputs sys0,1
|
||||||
|
crcputs tSend.txt,0
|
||||||
|
//send cmd
|
||||||
|
printh 55 bb
|
||||||
|
prints sys0,2
|
||||||
|
prints tSend.txt,0
|
||||||
|
prints crcval,2
|
||||||
|
|
||||||
|
Button bEntity5
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : î´
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
tmLP.en=1
|
||||||
|
tTmp.txt=type5.txt
|
||||||
|
pageIcons.tTmp1.txt=tEntity5.txt
|
||||||
|
pageIcons.tTmp2.txt=entn5.txt
|
||||||
|
if(type5.txt=="shutter")
|
||||||
|
{
|
||||||
|
page popupShutter
|
||||||
|
}
|
||||||
|
|
||||||
|
Touch Release Event
|
||||||
|
tmLP.en=0
|
||||||
|
tSend.txt="event,buttonPress2,"+entn5.txt+",button"
|
||||||
|
//send calc crc
|
||||||
|
btlen tSend.txt,sys0
|
||||||
|
crcrest 1,0xffff // reset CRC
|
||||||
|
crcputh 55 bb
|
||||||
|
crcputs sys0,1
|
||||||
|
crcputs tSend.txt,0
|
||||||
|
//send cmd
|
||||||
|
printh 55 bb
|
||||||
|
prints sys0,2
|
||||||
|
prints tSend.txt,0
|
||||||
|
prints crcval,2
|
||||||
|
|
||||||
|
Button bEntity6
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : î´
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
tmLP.en=1
|
||||||
|
tTmp.txt=type6.txt
|
||||||
|
pageIcons.tTmp1.txt=tEntity6.txt
|
||||||
|
pageIcons.tTmp2.txt=entn6.txt
|
||||||
|
if(type6.txt=="shutter")
|
||||||
|
{
|
||||||
|
page popupShutter
|
||||||
|
}
|
||||||
|
|
||||||
|
Touch Release Event
|
||||||
|
tmLP.en=0
|
||||||
|
tSend.txt="event,buttonPress2,"+entn6.txt+",button"
|
||||||
|
//send calc crc
|
||||||
|
btlen tSend.txt,sys0
|
||||||
|
crcrest 1,0xffff // reset CRC
|
||||||
|
crcputh 55 bb
|
||||||
|
crcputs sys0,1
|
||||||
|
crcputs tSend.txt,0
|
||||||
|
//send cmd
|
||||||
|
printh 55 bb
|
||||||
|
prints sys0,2
|
||||||
|
prints tSend.txt,0
|
||||||
|
prints crcval,2
|
||||||
|
|
||||||
|
Hotspot mSpecial
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
sys2=sys2+1
|
||||||
|
sys2%=10
|
||||||
|
//n0.val=sys2
|
||||||
|
if(sys2==9)
|
||||||
|
{
|
||||||
|
page pageTest
|
||||||
|
}
|
||||||
|
|
||||||
|
Timer tmSerial
|
||||||
|
Attributes
|
||||||
|
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")
|
||||||
|
{
|
||||||
|
// command format: entityUpd,heading,navigation,[,type,internalName,iconId,iconColor,displayName,optionalValue]x6
|
||||||
|
spstr strCommand.txt,tHeading.txt,",",1
|
||||||
|
// get Type
|
||||||
|
spstr strCommand.txt,type1.txt,",",3
|
||||||
|
// get internal name
|
||||||
|
spstr strCommand.txt,entn1.txt,",",4
|
||||||
|
if(type1.txt=="delete"||type1.txt=="")
|
||||||
|
{
|
||||||
|
vis tEntity1,0
|
||||||
|
vis bEntity1,0
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
// change icon
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",5
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
substr pageIcons.tIcons.txt,bEntity1.txt,sys0,1
|
||||||
|
vis bEntity1,1
|
||||||
|
// change icon color
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",6
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
bEntity1.pco=sys0
|
||||||
|
// set name
|
||||||
|
spstr strCommand.txt,tEntity1.txt,",",7
|
||||||
|
vis tEntity1,1
|
||||||
|
}
|
||||||
|
// get Type
|
||||||
|
spstr strCommand.txt,type2.txt,",",9
|
||||||
|
// get internal name
|
||||||
|
spstr strCommand.txt,entn2.txt,",",10
|
||||||
|
if(type2.txt=="delete"||type2.txt=="")
|
||||||
|
{
|
||||||
|
vis tEntity2,0
|
||||||
|
vis bEntity2,0
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
// change icon
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",11
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
substr pageIcons.tIcons.txt,bEntity2.txt,sys0,1
|
||||||
|
vis bEntity2,1
|
||||||
|
// change icon color
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",12
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
bEntity2.pco=sys0
|
||||||
|
// set name
|
||||||
|
spstr strCommand.txt,tEntity2.txt,",",13
|
||||||
|
vis tEntity2,1
|
||||||
|
}
|
||||||
|
// get Type
|
||||||
|
spstr strCommand.txt,type3.txt,",",15
|
||||||
|
// get internal name
|
||||||
|
spstr strCommand.txt,entn3.txt,",",16
|
||||||
|
if(type3.txt=="delete"||type3.txt=="")
|
||||||
|
{
|
||||||
|
vis tEntity3,0
|
||||||
|
vis bEntity3,0
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
// change icon
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",17
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
substr pageIcons.tIcons.txt,bEntity3.txt,sys0,1
|
||||||
|
vis bEntity3,1
|
||||||
|
// change icon color
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",18
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
bEntity3.pco=sys0
|
||||||
|
// set name
|
||||||
|
spstr strCommand.txt,tEntity3.txt,",",19
|
||||||
|
vis tEntity3,1
|
||||||
|
}
|
||||||
|
// get Type
|
||||||
|
spstr strCommand.txt,type4.txt,",",21
|
||||||
|
// get internal name
|
||||||
|
spstr strCommand.txt,entn4.txt,",",22
|
||||||
|
if(type4.txt=="delete"||type4.txt=="")
|
||||||
|
{
|
||||||
|
vis tEntity4,0
|
||||||
|
vis bEntity4,0
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
// change icon
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",23
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
substr pageIcons.tIcons.txt,bEntity4.txt,sys0,1
|
||||||
|
vis bEntity4,1
|
||||||
|
// change icon color
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",24
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
bEntity4.pco=sys0
|
||||||
|
// set name
|
||||||
|
spstr strCommand.txt,tEntity4.txt,",",25
|
||||||
|
vis tEntity4,1
|
||||||
|
}
|
||||||
|
// get Type
|
||||||
|
spstr strCommand.txt,type5.txt,",",27
|
||||||
|
// get internal name
|
||||||
|
spstr strCommand.txt,entn5.txt,",",28
|
||||||
|
if(type5.txt=="delete"||type5.txt=="")
|
||||||
|
{
|
||||||
|
vis tEntity5,0
|
||||||
|
vis bEntity5,0
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
// change icon
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",29
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
substr pageIcons.tIcons.txt,bEntity5.txt,sys0,1
|
||||||
|
vis bEntity5,1
|
||||||
|
// change icon color
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",30
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
bEntity5.pco=sys0
|
||||||
|
// set name
|
||||||
|
spstr strCommand.txt,tEntity5.txt,",",31
|
||||||
|
vis tEntity5,1
|
||||||
|
}
|
||||||
|
// get Type
|
||||||
|
spstr strCommand.txt,type6.txt,",",33
|
||||||
|
// get internal name
|
||||||
|
spstr strCommand.txt,entn6.txt,",",34
|
||||||
|
if(type6.txt=="delete"||type6.txt=="")
|
||||||
|
{
|
||||||
|
vis tEntity6,0
|
||||||
|
vis bEntity6,0
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
// change icon
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",35
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
substr pageIcons.tIcons.txt,bEntity6.txt,sys0,1
|
||||||
|
vis bEntity6,1
|
||||||
|
// change icon color
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",36
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
bEntity6.pco=sys0
|
||||||
|
// set name
|
||||||
|
spstr strCommand.txt,tEntity6.txt,",",37
|
||||||
|
vis tEntity6,1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(tInstruction.txt=="pageType")
|
||||||
|
{
|
||||||
|
//command format pageType,specialPageName
|
||||||
|
//write name of speical page to tId
|
||||||
|
spstr strCommand.txt,tId.txt,",",1
|
||||||
|
//save second arg if there's one
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",2
|
||||||
|
//save third arg if there's one
|
||||||
|
spstr strCommand.txt,pageIcons.tTmp2.txt,",",3
|
||||||
|
//we are going to exit this page with this command, so we have to clear the buffer, so we are not getting into a stupid loop ...
|
||||||
|
udelete payloadLength-1
|
||||||
|
bufferPos=0
|
||||||
|
if(tId.txt=="pageStartup")
|
||||||
|
{
|
||||||
|
page pageStartup
|
||||||
|
}
|
||||||
|
if(tId.txt=="screensaver")
|
||||||
|
{
|
||||||
|
page screensaver
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardEntities")
|
||||||
|
{
|
||||||
|
page cardEntities
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardGrid")
|
||||||
|
{
|
||||||
|
page cardGrid
|
||||||
|
}
|
||||||
|
if(tId.txt=="popupLight")
|
||||||
|
{
|
||||||
|
pageIcons.tTmp1.txt=tTmp.txt
|
||||||
|
page popupLight
|
||||||
|
}
|
||||||
|
if(tId.txt=="popupShutter")
|
||||||
|
{
|
||||||
|
pageIcons.tTmp1.txt=tTmp.txt
|
||||||
|
page popupShutter
|
||||||
|
}
|
||||||
|
if(tId.txt=="popupNotify")
|
||||||
|
{
|
||||||
|
page popupNotify
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardThermo")
|
||||||
|
{
|
||||||
|
page cardThermo
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardMedia")
|
||||||
|
{
|
||||||
|
page cardMedia
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardAlarm")
|
||||||
|
{
|
||||||
|
page cardAlarm
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(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
|
||||||
|
}
|
||||||
|
// end of user code
|
||||||
|
udelete payloadLength-1
|
||||||
|
bufferPos=0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// next character
|
||||||
|
bufferPos++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Timer tmSleep
|
||||||
|
Attributes
|
||||||
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Timer tmLP
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Period (ms): 500
|
||||||
|
Enabled : no
|
||||||
|
|
||||||
|
Events
|
||||||
|
Timer Event
|
||||||
|
if(tTmp.txt=="light")
|
||||||
|
{
|
||||||
|
page popupLight
|
||||||
|
}
|
||||||
|
|
||||||
|
TouchCap tc0
|
||||||
|
Attributes
|
||||||
|
Scope: local
|
||||||
|
Value: 0
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
sleepValue=0
|
||||||
|
|
||||||
674
HMI/US/portrait/n2t-out/cardMedia.txt
Normal file
674
HMI/US/portrait/n2t-out/cardMedia.txt
Normal file
@@ -0,0 +1,674 @@
|
|||||||
|
Page cardMedia
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Locked : no
|
||||||
|
Swide up page ID : disabled
|
||||||
|
Swide down page ID : disabled
|
||||||
|
Swide left page ID : disabled
|
||||||
|
Swide right page ID : disabled
|
||||||
|
|
||||||
|
Events
|
||||||
|
Preinitialize Event
|
||||||
|
vis p0,0
|
||||||
|
vis tSend,0
|
||||||
|
vis tInstruction,0
|
||||||
|
vis tTmp,0
|
||||||
|
vis tId,0
|
||||||
|
vis t5,0
|
||||||
|
//vis nPageDisp,0
|
||||||
|
|
||||||
|
Variable (string) strCommand
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 500
|
||||||
|
|
||||||
|
Variable (string) entn
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 50
|
||||||
|
|
||||||
|
Variable (string) vaSpeakerList
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 200
|
||||||
|
|
||||||
|
Variable (int32) vaSpeakerPos
|
||||||
|
Attributes
|
||||||
|
Scope: local
|
||||||
|
Value: 0
|
||||||
|
|
||||||
|
Text tSend
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 200
|
||||||
|
|
||||||
|
Text tTmp
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Text tInstruction
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 20
|
||||||
|
|
||||||
|
Text tId
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 20
|
||||||
|
|
||||||
|
Text tHeading
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 40
|
||||||
|
|
||||||
|
Text tTitle
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 50
|
||||||
|
|
||||||
|
Text tAuthor
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 50
|
||||||
|
|
||||||
|
Text t2
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : î¬
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
// event,buttonPress2,entn,media-next
|
||||||
|
//craft command
|
||||||
|
tSend.txt="event,buttonPress2,"
|
||||||
|
tSend.txt+=entn.txt+","
|
||||||
|
tSend.txt+="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
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : î£
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
// event,buttonPress2,entn,media-pause
|
||||||
|
//craft command
|
||||||
|
tSend.txt="event,buttonPress2,"
|
||||||
|
tSend.txt+=entn.txt+","
|
||||||
|
tSend.txt+="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
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : î
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
// event,buttonPress2,entn,media-back
|
||||||
|
//craft command
|
||||||
|
tSend.txt="event,buttonPress2,"
|
||||||
|
tSend.txt+=entn.txt+","
|
||||||
|
tSend.txt+="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
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Text t1
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : î
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
hVolume.val=hVolume.val-5
|
||||||
|
// event,buttonPress2,internalNameEntity,volumeSlider,50
|
||||||
|
//craft command
|
||||||
|
tSend.txt="event,buttonPress2,"+entn.txt+",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
|
||||||
|
|
||||||
|
Text t3
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : î
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
hVolume.val=hVolume.val+5
|
||||||
|
// event,buttonPress2,internalNameEntity,volumeSlider,50
|
||||||
|
//craft command
|
||||||
|
tSend.txt="event,buttonPress2,"+entn.txt+",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
|
||||||
|
|
||||||
|
Text t4
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : î
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Text tSpeaker
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 50
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
// event,buttonPress2,entn,media-next
|
||||||
|
//craft command
|
||||||
|
tSend.txt="event,buttonPress2,"
|
||||||
|
tSend.txt+=entn.txt+","
|
||||||
|
tSend.txt+="speaker-sel,"+tSpeaker.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
|
||||||
|
|
||||||
|
Text t6
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : î´
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
//speaker
|
||||||
|
tSpeaker.pco=65535
|
||||||
|
spstr vaSpeakerList.txt,tSpeaker.txt,"?",vaSpeakerPos.val
|
||||||
|
vaSpeakerPos.val+=1
|
||||||
|
if(tSpeaker.txt=="")
|
||||||
|
{
|
||||||
|
vaSpeakerPos.val=0
|
||||||
|
spstr vaSpeakerList.txt,tSpeaker.txt,"?",vaSpeakerPos.val
|
||||||
|
}
|
||||||
|
|
||||||
|
Text t5
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : î¤
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
// event,buttonPress2,entn,media-next
|
||||||
|
//craft command
|
||||||
|
tSend.txt="event,buttonPress2,"
|
||||||
|
tSend.txt+=entn.txt+","
|
||||||
|
tSend.txt+="media-OnOff"
|
||||||
|
//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
|
||||||
|
|
||||||
|
Picture p0
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
|
||||||
|
Slider hVolume
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Position : 50
|
||||||
|
Upper range limit : 100
|
||||||
|
Lower range limit : 0
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Release Event
|
||||||
|
tmCooldown.en=1
|
||||||
|
tmCooldown.tim=800
|
||||||
|
// event,buttonPress2,internalNameEntity,volumeSlider,50
|
||||||
|
//craft command
|
||||||
|
tSend.txt="event,buttonPress2,"+entn.txt+",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
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : î³
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
tSend.txt="event,buttonPress2,cardMedia,bNext"
|
||||||
|
//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
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : î°
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
tSend.txt="event,buttonPress2,cardMedia,bPrev"
|
||||||
|
//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
|
||||||
|
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
|
||||||
|
//speaker current
|
||||||
|
spstr strCommand.txt,tSpeaker.txt,"|",8
|
||||||
|
if(tSpeaker.txt!="")
|
||||||
|
{
|
||||||
|
tSpeaker.pco=1374
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
tSpeaker.pco=65535
|
||||||
|
}
|
||||||
|
//speaker list
|
||||||
|
spstr strCommand.txt,vaSpeakerList.txt,"|",9
|
||||||
|
if(vaSpeakerList.txt=="")
|
||||||
|
{
|
||||||
|
vis t6,0
|
||||||
|
}
|
||||||
|
vaSpeakerPos.val=0
|
||||||
|
// on off button
|
||||||
|
spstr strCommand.txt,tTmp.txt,"|",10
|
||||||
|
if(tTmp.txt=="disable")
|
||||||
|
{
|
||||||
|
vis t5,0
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
vis t5,1
|
||||||
|
covx tTmp.txt,t5.pco,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
|
||||||
|
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
|
||||||
|
//save third arg if there's one
|
||||||
|
spstr strCommand.txt,pageIcons.tTmp2.txt,",",3
|
||||||
|
//we are going to exit this page with this command, so we have to clear the buffer, so we are not getting into a stupid loop ...
|
||||||
|
udelete payloadLength-1
|
||||||
|
bufferPos=0
|
||||||
|
if(tId.txt=="popupLight")
|
||||||
|
{
|
||||||
|
pageIcons.tTmp1.txt=tTmp.txt
|
||||||
|
page popupLight
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardEntities")
|
||||||
|
{
|
||||||
|
page cardEntities
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardThermo")
|
||||||
|
{
|
||||||
|
page cardThermo
|
||||||
|
}
|
||||||
|
if(tId.txt=="pageStartup")
|
||||||
|
{
|
||||||
|
page pageStartup
|
||||||
|
}
|
||||||
|
if(tId.txt=="popupNotify")
|
||||||
|
{
|
||||||
|
page popupNotify
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardGrid")
|
||||||
|
{
|
||||||
|
page cardGrid
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardAlarm")
|
||||||
|
{
|
||||||
|
page cardAlarm
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// end of user code
|
||||||
|
udelete payloadLength-1
|
||||||
|
bufferPos=0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 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
|
||||||
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Timer tmCooldown
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Period (ms): 100
|
||||||
|
Enabled : no
|
||||||
|
|
||||||
|
Events
|
||||||
|
Timer Event
|
||||||
|
tmCooldown.en=0
|
||||||
|
|
||||||
|
TouchCap tc0
|
||||||
|
Attributes
|
||||||
|
Scope: local
|
||||||
|
Value: 0
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
sleepValue=0
|
||||||
|
|
||||||
948
HMI/US/portrait/n2t-out/cardThermo.txt
Normal file
948
HMI/US/portrait/n2t-out/cardThermo.txt
Normal file
@@ -0,0 +1,948 @@
|
|||||||
|
Page cardThermo
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Locked : no
|
||||||
|
Swide up page ID : disabled
|
||||||
|
Swide down page ID : disabled
|
||||||
|
Swide left page ID : disabled
|
||||||
|
Swide right page ID : disabled
|
||||||
|
|
||||||
|
Events
|
||||||
|
Preinitialize Event
|
||||||
|
vis p0,0
|
||||||
|
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 all buttons
|
||||||
|
vis bt0,0
|
||||||
|
vis bt1,0
|
||||||
|
vis bt2,0
|
||||||
|
vis bt3,0
|
||||||
|
vis bt4,0
|
||||||
|
vis bt5,0
|
||||||
|
vis bt6,0
|
||||||
|
vis bt7,0
|
||||||
|
vis bt8,0
|
||||||
|
|
||||||
|
Variable (string) strCommand
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 250
|
||||||
|
|
||||||
|
Variable (string) entn
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 50
|
||||||
|
|
||||||
|
Variable (string) va0
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 10
|
||||||
|
|
||||||
|
Variable (string) va1
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 10
|
||||||
|
|
||||||
|
Variable (string) va2
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 10
|
||||||
|
|
||||||
|
Variable (string) va3
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 10
|
||||||
|
|
||||||
|
Variable (string) va4
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 10
|
||||||
|
|
||||||
|
Variable (string) va5
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 10
|
||||||
|
|
||||||
|
Variable (string) va6
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 10
|
||||||
|
|
||||||
|
Variable (string) va7
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 10
|
||||||
|
|
||||||
|
Variable (string) va8
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 10
|
||||||
|
|
||||||
|
Number nPageDisp
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Value : 0
|
||||||
|
|
||||||
|
XFloat xTempCurr
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Value : 0
|
||||||
|
|
||||||
|
XFloat xTempDest
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Value : 0
|
||||||
|
|
||||||
|
XFloat xTempMin
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Value : 0
|
||||||
|
|
||||||
|
XFloat xTempMax
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Value : 0
|
||||||
|
|
||||||
|
XFloat xTempStep
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Value : 0
|
||||||
|
|
||||||
|
Text tSend
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : newtxt
|
||||||
|
Max. Text Size : 100
|
||||||
|
|
||||||
|
Text tTmp
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Text tInstruction
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 20
|
||||||
|
|
||||||
|
Text tId
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 20
|
||||||
|
|
||||||
|
Text tHeading
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 40
|
||||||
|
|
||||||
|
Text tStatus
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Text t2
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : î
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Picture p0
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
|
||||||
|
Button bNext
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : î³
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
tSend.txt="event,buttonPress2,cardThermo,bNext"
|
||||||
|
//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
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
if(xTempDest.val>xTempMin.val)
|
||||||
|
{
|
||||||
|
xTempDest.val=xTempDest.val-xTempStep.val
|
||||||
|
}
|
||||||
|
// event,buttonPress2,entn,tempUpd,X
|
||||||
|
//craft command
|
||||||
|
tSend.txt="event,buttonPress2,"
|
||||||
|
tSend.txt+=entn.txt+","
|
||||||
|
tSend.txt+="tempUpd,"
|
||||||
|
//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
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
if(xTempDest.val<xTempMax.val)
|
||||||
|
{
|
||||||
|
xTempDest.val=xTempDest.val+xTempStep.val
|
||||||
|
}
|
||||||
|
// event,buttonPress2,entn,tempUpd,X
|
||||||
|
//craft command
|
||||||
|
tSend.txt="event,buttonPress2,"
|
||||||
|
tSend.txt+=entn.txt+","
|
||||||
|
tSend.txt+="tempUpd,"
|
||||||
|
//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
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : î°
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
tSend.txt="event,buttonPress2,cardThermo,bPrev"
|
||||||
|
//send calc crc
|
||||||
|
btlen tSend.txt,sys0
|
||||||
|
crcrest 1,0xffff // reset CRC
|
||||||
|
crcputh 55 bb
|
||||||
|
crcputs sys0,1
|
||||||
|
crcputs tSend.txt,0
|
||||||
|
//send cmd
|
||||||
|
printh 55 bb
|
||||||
|
prints sys0,2
|
||||||
|
prints tSend.txt,0
|
||||||
|
prints crcval,2
|
||||||
|
|
||||||
|
Dual-state Button bt0
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : î
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
//craft command
|
||||||
|
tSend.txt="event,buttonPress2,"+entn.txt
|
||||||
|
tSend.txt+=",hvac_action,"+va0.txt
|
||||||
|
//send calc crc
|
||||||
|
btlen tSend.txt,sys0
|
||||||
|
crcrest 1,0xffff // reset CRC
|
||||||
|
crcputh 55 bb
|
||||||
|
crcputs sys0,1
|
||||||
|
crcputs tSend.txt,0
|
||||||
|
//send cmd
|
||||||
|
printh 55 bb
|
||||||
|
prints sys0,2
|
||||||
|
prints tSend.txt,0
|
||||||
|
prints crcval,2
|
||||||
|
|
||||||
|
Dual-state Button bt1
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : î
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
//craft command
|
||||||
|
tSend.txt="event,buttonPress2,"+entn.txt
|
||||||
|
tSend.txt+=",hvac_action,"+va1.txt
|
||||||
|
//send calc crc
|
||||||
|
btlen tSend.txt,sys0
|
||||||
|
crcrest 1,0xffff // reset CRC
|
||||||
|
crcputh 55 bb
|
||||||
|
crcputs sys0,1
|
||||||
|
crcputs tSend.txt,0
|
||||||
|
//send cmd
|
||||||
|
printh 55 bb
|
||||||
|
prints sys0,2
|
||||||
|
prints tSend.txt,0
|
||||||
|
prints crcval,2
|
||||||
|
|
||||||
|
Dual-state Button bt2
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : î
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
//craft command
|
||||||
|
tSend.txt="event,buttonPress2,"+entn.txt
|
||||||
|
tSend.txt+=",hvac_action,"+va2.txt
|
||||||
|
//send calc crc
|
||||||
|
btlen tSend.txt,sys0
|
||||||
|
crcrest 1,0xffff // reset CRC
|
||||||
|
crcputh 55 bb
|
||||||
|
crcputs sys0,1
|
||||||
|
crcputs tSend.txt,0
|
||||||
|
//send cmd
|
||||||
|
printh 55 bb
|
||||||
|
prints sys0,2
|
||||||
|
prints tSend.txt,0
|
||||||
|
prints crcval,2
|
||||||
|
|
||||||
|
Dual-state Button bt3
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : î
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
//craft command
|
||||||
|
tSend.txt="event,buttonPress2,"+entn.txt
|
||||||
|
tSend.txt+=",hvac_action,"+va3.txt
|
||||||
|
//send calc crc
|
||||||
|
btlen tSend.txt,sys0
|
||||||
|
crcrest 1,0xffff // reset CRC
|
||||||
|
crcputh 55 bb
|
||||||
|
crcputs sys0,1
|
||||||
|
crcputs tSend.txt,0
|
||||||
|
//send cmd
|
||||||
|
printh 55 bb
|
||||||
|
prints sys0,2
|
||||||
|
prints tSend.txt,0
|
||||||
|
prints crcval,2
|
||||||
|
|
||||||
|
Dual-state Button bt4
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : î
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
//craft command
|
||||||
|
tSend.txt="event,buttonPress2,"+entn.txt
|
||||||
|
tSend.txt+=",hvac_action,"+va4.txt
|
||||||
|
//send calc crc
|
||||||
|
btlen tSend.txt,sys0
|
||||||
|
crcrest 1,0xffff // reset CRC
|
||||||
|
crcputh 55 bb
|
||||||
|
crcputs sys0,1
|
||||||
|
crcputs tSend.txt,0
|
||||||
|
//send cmd
|
||||||
|
printh 55 bb
|
||||||
|
prints sys0,2
|
||||||
|
prints tSend.txt,0
|
||||||
|
prints crcval,2
|
||||||
|
|
||||||
|
Dual-state Button bt5
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : pressed
|
||||||
|
Text : î
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
//craft command
|
||||||
|
tSend.txt="event,buttonPress2,"+entn.txt
|
||||||
|
tSend.txt+=",hvac_action,"+va5.txt
|
||||||
|
//send calc crc
|
||||||
|
btlen tSend.txt,sys0
|
||||||
|
crcrest 1,0xffff // reset CRC
|
||||||
|
crcputh 55 bb
|
||||||
|
crcputs sys0,1
|
||||||
|
crcputs tSend.txt,0
|
||||||
|
//send cmd
|
||||||
|
printh 55 bb
|
||||||
|
prints sys0,2
|
||||||
|
prints tSend.txt,0
|
||||||
|
prints crcval,2
|
||||||
|
|
||||||
|
Dual-state Button bt6
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : pressed
|
||||||
|
Text : î
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
//craft command
|
||||||
|
tSend.txt="event,buttonPress2,"+entn.txt
|
||||||
|
tSend.txt+=",hvac_action,"+va6.txt
|
||||||
|
//send calc crc
|
||||||
|
btlen tSend.txt,sys0
|
||||||
|
crcrest 1,0xffff // reset CRC
|
||||||
|
crcputh 55 bb
|
||||||
|
crcputs sys0,1
|
||||||
|
crcputs tSend.txt,0
|
||||||
|
//send cmd
|
||||||
|
printh 55 bb
|
||||||
|
prints sys0,2
|
||||||
|
prints tSend.txt,0
|
||||||
|
prints crcval,2
|
||||||
|
|
||||||
|
Dual-state Button bt7
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : pressed
|
||||||
|
Text : î
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
//craft command
|
||||||
|
tSend.txt="event,buttonPress2,"+entn.txt
|
||||||
|
tSend.txt+=",hvac_action,"+va7.txt
|
||||||
|
//send calc crc
|
||||||
|
btlen tSend.txt,sys0
|
||||||
|
crcrest 1,0xffff // reset CRC
|
||||||
|
crcputh 55 bb
|
||||||
|
crcputs sys0,1
|
||||||
|
crcputs tSend.txt,0
|
||||||
|
//send cmd
|
||||||
|
printh 55 bb
|
||||||
|
prints sys0,2
|
||||||
|
prints tSend.txt,0
|
||||||
|
prints crcval,2
|
||||||
|
|
||||||
|
Dual-state Button bt8
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : pressed
|
||||||
|
Text : î
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
//craft command
|
||||||
|
tSend.txt="event,buttonPress2,"+entn.txt
|
||||||
|
tSend.txt+=",hvac_action,"+va8.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
|
||||||
|
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
|
||||||
|
// disable all buttons
|
||||||
|
vis bt0,0
|
||||||
|
vis bt1,0
|
||||||
|
vis bt2,0
|
||||||
|
vis bt3,0
|
||||||
|
vis bt4,0
|
||||||
|
vis bt5,0
|
||||||
|
vis bt6,0
|
||||||
|
vis bt7,0
|
||||||
|
vis bt8,0
|
||||||
|
//bt0
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",9
|
||||||
|
if(tTmp.txt!="")
|
||||||
|
{
|
||||||
|
// set icon
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
substr pageIcons.tIcons.txt,bt0.txt,sys0,1
|
||||||
|
// set text color on active state
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",10
|
||||||
|
covx tTmp.txt,bt0.pco2,0,0
|
||||||
|
// set state
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",11
|
||||||
|
covx tTmp.txt,bt0.val,0,0
|
||||||
|
// save action
|
||||||
|
spstr strCommand.txt,va0.txt,",",12
|
||||||
|
//enable
|
||||||
|
vis bt0,1
|
||||||
|
}
|
||||||
|
//bt1
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",13
|
||||||
|
if(tTmp.txt!="")
|
||||||
|
{
|
||||||
|
// set icon
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
substr pageIcons.tIcons.txt,bt1.txt,sys0,1
|
||||||
|
// set text color on active state
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",14
|
||||||
|
covx tTmp.txt,bt1.pco2,0,0
|
||||||
|
// set state
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",15
|
||||||
|
covx tTmp.txt,bt1.val,0,0
|
||||||
|
// save action
|
||||||
|
spstr strCommand.txt,va1.txt,",",16
|
||||||
|
//enable
|
||||||
|
vis bt1,1
|
||||||
|
}
|
||||||
|
//bt2
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",17
|
||||||
|
if(tTmp.txt!="")
|
||||||
|
{
|
||||||
|
// set icon
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
substr pageIcons.tIcons.txt,bt2.txt,sys0,1
|
||||||
|
// set text color on active state
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",18
|
||||||
|
covx tTmp.txt,bt2.pco2,0,0
|
||||||
|
// set state
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",19
|
||||||
|
covx tTmp.txt,bt2.val,0,0
|
||||||
|
// save action
|
||||||
|
spstr strCommand.txt,va2.txt,",",20
|
||||||
|
//enable
|
||||||
|
vis bt2,1
|
||||||
|
}
|
||||||
|
//bt3
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",21
|
||||||
|
if(tTmp.txt!="")
|
||||||
|
{
|
||||||
|
// set icon
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
substr pageIcons.tIcons.txt,bt3.txt,sys0,1
|
||||||
|
// set text color on active state
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",22
|
||||||
|
covx tTmp.txt,bt3.pco2,0,0
|
||||||
|
// set state
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",23
|
||||||
|
covx tTmp.txt,bt3.val,0,0
|
||||||
|
// save action
|
||||||
|
spstr strCommand.txt,va3.txt,",",24
|
||||||
|
//enable
|
||||||
|
vis bt3,1
|
||||||
|
}
|
||||||
|
//bt4
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",25
|
||||||
|
if(tTmp.txt!="")
|
||||||
|
{
|
||||||
|
// set icon
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
substr pageIcons.tIcons.txt,bt4.txt,sys0,1
|
||||||
|
// set text color on active state
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",26
|
||||||
|
covx tTmp.txt,bt4.pco2,0,0
|
||||||
|
// set state
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",27
|
||||||
|
covx tTmp.txt,bt4.val,0,0
|
||||||
|
// save action
|
||||||
|
spstr strCommand.txt,va4.txt,",",28
|
||||||
|
//enable
|
||||||
|
vis bt4,1
|
||||||
|
}
|
||||||
|
//bt5
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",29
|
||||||
|
if(tTmp.txt!="")
|
||||||
|
{
|
||||||
|
// set icon
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
substr pageIcons.tIcons.txt,bt5.txt,sys0,1
|
||||||
|
// set text color on active state
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",30
|
||||||
|
covx tTmp.txt,bt5.pco2,0,0
|
||||||
|
// set state
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",31
|
||||||
|
covx tTmp.txt,bt5.val,0,0
|
||||||
|
// save action
|
||||||
|
spstr strCommand.txt,va5.txt,",",32
|
||||||
|
//enable
|
||||||
|
vis bt5,1
|
||||||
|
}
|
||||||
|
//bt6
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",33
|
||||||
|
if(tTmp.txt!="")
|
||||||
|
{
|
||||||
|
// set icon
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
substr pageIcons.tIcons.txt,bt6.txt,sys0,1
|
||||||
|
// set text color on active state
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",34
|
||||||
|
covx tTmp.txt,bt6.pco2,0,0
|
||||||
|
// set state
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",35
|
||||||
|
covx tTmp.txt,bt6.val,0,0
|
||||||
|
// save action
|
||||||
|
spstr strCommand.txt,va6.txt,",",36
|
||||||
|
//enable
|
||||||
|
vis bt6,1
|
||||||
|
}
|
||||||
|
//bt7
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",37
|
||||||
|
if(tTmp.txt!="")
|
||||||
|
{
|
||||||
|
// set icon
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
substr pageIcons.tIcons.txt,bt7.txt,sys0,1
|
||||||
|
// set text color on active state
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",38
|
||||||
|
covx tTmp.txt,bt7.pco2,0,0
|
||||||
|
// set state
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",39
|
||||||
|
covx tTmp.txt,bt7.val,0,0
|
||||||
|
// save action
|
||||||
|
spstr strCommand.txt,va7.txt,",",40
|
||||||
|
//enable
|
||||||
|
vis bt7,1
|
||||||
|
}
|
||||||
|
//bt8
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",41
|
||||||
|
if(tTmp.txt!="")
|
||||||
|
{
|
||||||
|
// set icon
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
substr pageIcons.tIcons.txt,bt8.txt,sys0,1
|
||||||
|
// set text color on active state
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",42
|
||||||
|
covx tTmp.txt,bt8.pco2,0,0
|
||||||
|
// set state
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",43
|
||||||
|
covx tTmp.txt,bt8.val,0,0
|
||||||
|
// save action
|
||||||
|
spstr strCommand.txt,va8.txt,",",44
|
||||||
|
//enable
|
||||||
|
vis bt8,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
|
||||||
|
}
|
||||||
|
if(tInstruction.txt=="timeout")
|
||||||
|
{
|
||||||
|
//set timeout to global var
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",1
|
||||||
|
covx tTmp.txt,sleepTimeout,0,0
|
||||||
|
}
|
||||||
|
if(tInstruction.txt=="pageType")
|
||||||
|
{
|
||||||
|
//command format pageType,specialPageName
|
||||||
|
//write name of speical page to tId
|
||||||
|
spstr strCommand.txt,tId.txt,",",1
|
||||||
|
//save second arg if there's one
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",2
|
||||||
|
//save third arg if there's one
|
||||||
|
spstr strCommand.txt,pageIcons.tTmp2.txt,",",3
|
||||||
|
//we are going to exit this page with this command, so we have to clear the buffer, so we are not getting into a stupid loop ...
|
||||||
|
udelete payloadLength-1
|
||||||
|
bufferPos=0
|
||||||
|
if(tId.txt=="popupLight")
|
||||||
|
{
|
||||||
|
pageIcons.tTmp1.txt=tTmp.txt
|
||||||
|
page popupLight
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardEntities")
|
||||||
|
{
|
||||||
|
page cardEntities
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardMedia")
|
||||||
|
{
|
||||||
|
page cardMedia
|
||||||
|
}
|
||||||
|
if(tId.txt=="pageStartup")
|
||||||
|
{
|
||||||
|
page pageStartup
|
||||||
|
}
|
||||||
|
if(tId.txt=="popupNotify")
|
||||||
|
{
|
||||||
|
page popupNotify
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardGrid")
|
||||||
|
{
|
||||||
|
page cardGrid
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardAlarm")
|
||||||
|
{
|
||||||
|
page cardAlarm
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// end of user code
|
||||||
|
udelete payloadLength-1
|
||||||
|
bufferPos=0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// next character
|
||||||
|
bufferPos++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Timer tmSleep
|
||||||
|
Attributes
|
||||||
|
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
|
||||||
|
Scope: local
|
||||||
|
Value: 0
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
sleepValue=0
|
||||||
|
|
||||||
59
HMI/US/portrait/n2t-out/pageIcons.txt
Normal file
59
HMI/US/portrait/n2t-out/pageIcons.txt
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
Page pageIcons
|
||||||
|
Attributes
|
||||||
|
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
|
||||||
|
|
||||||
|
Text t0
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
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
|
||||||
|
|
||||||
|
Text tIcons
|
||||||
|
Attributes
|
||||||
|
Scope : global
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : îî´îï§îîî î
î£îîî°îîîîî½îîîîîî¾îîîîî¤î·îºîîï¤ï¡îî î îî¦îî¦îºîî
|
||||||
|
Max. Text Size : 150
|
||||||
|
|
||||||
|
Text tTmp1
|
||||||
|
Attributes
|
||||||
|
Scope : global
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 50
|
||||||
|
|
||||||
|
Text tTmp2
|
||||||
|
Attributes
|
||||||
|
Scope : global
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 50
|
||||||
|
|
||||||
|
Picture p0
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
|
||||||
207
HMI/US/portrait/n2t-out/pageSerialTest.txt
Normal file
207
HMI/US/portrait/n2t-out/pageSerialTest.txt
Normal file
@@ -0,0 +1,207 @@
|
|||||||
|
Page pageSerialTest
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Locked : no
|
||||||
|
Swide up page ID : disabled
|
||||||
|
Swide down page ID : disabled
|
||||||
|
Swide left page ID : disabled
|
||||||
|
Swide right page ID : disabled
|
||||||
|
|
||||||
|
Events
|
||||||
|
Preinitialize Event
|
||||||
|
//vis p0,0
|
||||||
|
//recmod=1
|
||||||
|
//bauds=115200
|
||||||
|
|
||||||
|
Number nCrcRecv
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Value : 0
|
||||||
|
|
||||||
|
Number nCrcCalc
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Value : 0
|
||||||
|
|
||||||
|
Number nIt
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Value : 0
|
||||||
|
|
||||||
|
Number nLength
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Value : 0
|
||||||
|
|
||||||
|
Text tStatus
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : newtxt
|
||||||
|
Max. Text Size : 100
|
||||||
|
|
||||||
|
Text tCmd
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : newtxt
|
||||||
|
Max. Text Size : 500
|
||||||
|
|
||||||
|
Text tBuffer
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : newtxt
|
||||||
|
Max. Text Size : 100
|
||||||
|
|
||||||
|
Text tDesc
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : CRC Recv:\r\nCRC Calc:\r\n\r\nStatus\r\n\r\nCommand
|
||||||
|
Max. Text Size : 60
|
||||||
|
|
||||||
|
Picture p0
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
|
||||||
|
Button b0
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : bck
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
recmod=0
|
||||||
|
page pageTest
|
||||||
|
|
||||||
|
Button b1
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : ON
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
recmod=1
|
||||||
|
bauds=115200
|
||||||
|
|
||||||
|
Timer tmSerial
|
||||||
|
Attributes
|
||||||
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
372
HMI/US/portrait/n2t-out/pageStartup.txt
Normal file
372
HMI/US/portrait/n2t-out/pageStartup.txt
Normal file
@@ -0,0 +1,372 @@
|
|||||||
|
Page pageStartup
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Locked : no
|
||||||
|
Swide up page ID : disabled
|
||||||
|
Swide down page ID : disabled
|
||||||
|
Swide left page ID : disabled
|
||||||
|
Swide right page ID : disabled
|
||||||
|
|
||||||
|
Events
|
||||||
|
Preinitialize Event
|
||||||
|
vis p0,0
|
||||||
|
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
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 50
|
||||||
|
|
||||||
|
Number frame_ptr
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Value : 0
|
||||||
|
|
||||||
|
Number spinner_w
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Value : 140
|
||||||
|
|
||||||
|
Number frapic_w
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Value : 1960
|
||||||
|
|
||||||
|
Number usual_cnt
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Value : 0
|
||||||
|
|
||||||
|
Text tSend
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : newtxt
|
||||||
|
Max. Text Size : 100
|
||||||
|
|
||||||
|
Text tTmp
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Text tInstruction
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 20
|
||||||
|
|
||||||
|
Text tId
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 20
|
||||||
|
|
||||||
|
Text tMsg1
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : Waiting for content ...
|
||||||
|
Max. Text Size : 40
|
||||||
|
|
||||||
|
Text tMsg2
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : This is taking longer than usual,
|
||||||
|
Max. Text Size : 100
|
||||||
|
|
||||||
|
Text tMsg3
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : pls check your backend configuration
|
||||||
|
Max. Text Size : 100
|
||||||
|
|
||||||
|
Text tVersion
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : 22
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Picture p0
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
|
||||||
|
Button bSendStartup
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : startup
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
recmod=1
|
||||||
|
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 mSpinner
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
sys2=sys2+1
|
||||||
|
sys2%=10
|
||||||
|
//n0.val=sys2
|
||||||
|
if(sys2==9)
|
||||||
|
{
|
||||||
|
page pageTest
|
||||||
|
}
|
||||||
|
|
||||||
|
Timer tmSerial
|
||||||
|
Attributes
|
||||||
|
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")
|
||||||
|
{
|
||||||
|
dim=100
|
||||||
|
//command format pageType,specialPageName
|
||||||
|
//write name of speical page to tId
|
||||||
|
spstr strCommand.txt,tId.txt,",",1
|
||||||
|
//save second arg if there's one
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",2
|
||||||
|
//save third arg if there's one
|
||||||
|
spstr strCommand.txt,pageIcons.tTmp2.txt,",",3
|
||||||
|
//we are going to exit this page with this command, so we have to clear the buffer, so we are not getting into a stupid loop ...
|
||||||
|
udelete payloadLength-1
|
||||||
|
bufferPos=0
|
||||||
|
if(tId.txt=="cardThermo")
|
||||||
|
{
|
||||||
|
page cardThermo
|
||||||
|
}
|
||||||
|
if(tId.txt=="screensaver")
|
||||||
|
{
|
||||||
|
page screensaver
|
||||||
|
}
|
||||||
|
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=="popupNotify")
|
||||||
|
{
|
||||||
|
page popupNotify
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardMedia")
|
||||||
|
{
|
||||||
|
page cardMedia
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardGrid")
|
||||||
|
{
|
||||||
|
page cardGrid
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardAlarm")
|
||||||
|
{
|
||||||
|
page cardAlarm
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// end of user code
|
||||||
|
udelete payloadLength-1
|
||||||
|
bufferPos=0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// next character
|
||||||
|
bufferPos++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Timer tmSpinner
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Period (ms): 80
|
||||||
|
Enabled : yes
|
||||||
|
|
||||||
|
Events
|
||||||
|
Timer Event
|
||||||
|
xpic mSpinner.x,mSpinner.y,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
|
||||||
|
}
|
||||||
|
|
||||||
178
HMI/US/portrait/n2t-out/pageTest.txt
Normal file
178
HMI/US/portrait/n2t-out/pageTest.txt
Normal file
@@ -0,0 +1,178 @@
|
|||||||
|
Page pageTest
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Locked : no
|
||||||
|
Swide up page ID : disabled
|
||||||
|
Swide down page ID : disabled
|
||||||
|
Swide left page ID : disabled
|
||||||
|
Swide right page ID : disabled
|
||||||
|
|
||||||
|
Events
|
||||||
|
Preinitialize Event
|
||||||
|
vis p0,0
|
||||||
|
|
||||||
|
Picture p0
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
|
||||||
|
Button b0
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : entities
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
page cardEntities
|
||||||
|
|
||||||
|
Button b1
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : serial
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
page pageSerialTest
|
||||||
|
|
||||||
|
Button b3
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : disable recmod
|
||||||
|
Max. Text Size : 20
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
recmod=0
|
||||||
|
|
||||||
|
Button b6
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : shutter
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
page popupShutter
|
||||||
|
|
||||||
|
Button b4
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : light
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
page popupLight
|
||||||
|
|
||||||
|
Button b5
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : thermo
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
page cardThermo
|
||||||
|
|
||||||
|
Button b7
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : media
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
page cardMedia
|
||||||
|
|
||||||
|
Button b8
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : screens
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
dimValue=50
|
||||||
|
page screensaver
|
||||||
|
|
||||||
|
Button b9
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : notify
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
page popupNotify
|
||||||
|
|
||||||
|
Button b10
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : alarm
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
page cardAlarm
|
||||||
|
|
||||||
|
Button b11
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : grid
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
page cardGrid
|
||||||
|
|
||||||
631
HMI/US/portrait/n2t-out/popupLight.txt
Normal file
631
HMI/US/portrait/n2t-out/popupLight.txt
Normal file
@@ -0,0 +1,631 @@
|
|||||||
|
Page popupLight
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Locked : no
|
||||||
|
Swide up page ID : disabled
|
||||||
|
Swide down page ID : disabled
|
||||||
|
Swide left page ID : disabled
|
||||||
|
Swide right page ID : disabled
|
||||||
|
|
||||||
|
Events
|
||||||
|
Preinitialize Event
|
||||||
|
//get entitiy name
|
||||||
|
tEntity.txt=pageIcons.tTmp1.txt
|
||||||
|
//get entity id
|
||||||
|
entn.txt=pageIcons.tTmp2.txt
|
||||||
|
vis p0,0
|
||||||
|
vis tSend,0
|
||||||
|
vis tTmp,0
|
||||||
|
vis tInstruction,0
|
||||||
|
vis tId,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 t0,0
|
||||||
|
vis pColorWheel,0
|
||||||
|
//vis t0,0
|
||||||
|
|
||||||
|
Variable (string) strCommand
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 100
|
||||||
|
|
||||||
|
Variable (string) entn
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Text : newtxt
|
||||||
|
Max. Text Size: 50
|
||||||
|
|
||||||
|
Variable (int32) mode
|
||||||
|
Attributes
|
||||||
|
Scope: local
|
||||||
|
Value: 1
|
||||||
|
|
||||||
|
Variable (int32) mode_temp
|
||||||
|
Attributes
|
||||||
|
Scope: local
|
||||||
|
Value: 0
|
||||||
|
|
||||||
|
Text tEntity
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : tEntity1
|
||||||
|
Max. Text Size : 25
|
||||||
|
|
||||||
|
Text tIcon1
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : î´
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Text t1
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : Brightness
|
||||||
|
Max. Text Size : 15
|
||||||
|
|
||||||
|
Text t2
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : î
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Text t3
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : î
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Text t4
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : Temperature
|
||||||
|
Max. Text Size : 15
|
||||||
|
|
||||||
|
Text tSend
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : newtxt
|
||||||
|
Max. Text Size : 100
|
||||||
|
|
||||||
|
Text tTmp
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Text tInstruction
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 20
|
||||||
|
|
||||||
|
Text tId
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 20
|
||||||
|
|
||||||
|
Text t0
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : Color
|
||||||
|
Max. Text Size : 15
|
||||||
|
|
||||||
|
Picture p0
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
|
||||||
|
Picture pColorWheel
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
//craft command
|
||||||
|
tSend.txt="event,buttonPress2,"+entn.txt+",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
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Position : 50
|
||||||
|
Upper range limit : 100
|
||||||
|
Lower range limit : 0
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Release Event
|
||||||
|
tmCooldown.en=1
|
||||||
|
tmCooldown.tim=2500
|
||||||
|
//craft command
|
||||||
|
tSend.txt="event,buttonPress2,"+entn.txt+",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
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Position : 50
|
||||||
|
Upper range limit : 100
|
||||||
|
Lower range limit : 0
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Release Event
|
||||||
|
tmCooldown.en=1
|
||||||
|
tmCooldown.tim=2500
|
||||||
|
//craft command
|
||||||
|
tSend.txt="event,buttonPress2,"+entn.txt+",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
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : î
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
tSend.txt="event,buttonPress2,popupLight,bExit"
|
||||||
|
//send calc crc
|
||||||
|
btlen tSend.txt,sys0
|
||||||
|
crcrest 1,0xffff // reset CRC
|
||||||
|
crcputh 55 bb
|
||||||
|
crcputs sys0,1
|
||||||
|
crcputs tSend.txt,0
|
||||||
|
//send cmd
|
||||||
|
printh 55 bb
|
||||||
|
prints sys0,2
|
||||||
|
prints tSend.txt,0
|
||||||
|
prints crcval,2
|
||||||
|
|
||||||
|
Button bColor
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : î
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
if(mode.val==1)
|
||||||
|
{
|
||||||
|
mode.val=0
|
||||||
|
//enable color wheel
|
||||||
|
vis pColorWheel,1
|
||||||
|
//disable color temp
|
||||||
|
vis t4,0
|
||||||
|
vis t3,0
|
||||||
|
vis hTempSlider,0
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
mode.val=1
|
||||||
|
//disable color wheel
|
||||||
|
vis pColorWheel,0
|
||||||
|
if(mode_temp.val==1)
|
||||||
|
{
|
||||||
|
//enable color temp
|
||||||
|
vis t4,1
|
||||||
|
vis t3,1
|
||||||
|
vis hTempSlider,1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Dual-state Button btOnOff1
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
//craft command
|
||||||
|
tSend.txt="event,buttonPress2,"+entn.txt+","+"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
|
||||||
|
Scope : local
|
||||||
|
Period (ms): 1000
|
||||||
|
Enabled : yes
|
||||||
|
|
||||||
|
Events
|
||||||
|
Timer Event
|
||||||
|
if(sleepTimeout!=0)
|
||||||
|
{
|
||||||
|
sleepValue+=1
|
||||||
|
if(sleepTimeout<=sleepValue)
|
||||||
|
{
|
||||||
|
screensaver.originPage.val=dp
|
||||||
|
sleepValue=0
|
||||||
|
click b0,1
|
||||||
|
click b0,0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Timer tmSerial
|
||||||
|
Attributes
|
||||||
|
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")
|
||||||
|
{
|
||||||
|
// change icon
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",1
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
substr pageIcons.tIcons.txt,tIcon1.txt,sys0,1
|
||||||
|
vis tIcon1,1
|
||||||
|
// change icon color
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",2
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
tIcon1.pco=sys0
|
||||||
|
// get Button State
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",3
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
btOnOff1.val=sys0
|
||||||
|
// get Brightness value
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",4
|
||||||
|
if(tTmp.txt=="disable")
|
||||||
|
{
|
||||||
|
vis t1,0
|
||||||
|
vis t2,0
|
||||||
|
vis hBrightness,0
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
vis t1,1
|
||||||
|
vis t2,1
|
||||||
|
vis hBrightness,1
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
if(tmCooldown.en==0)
|
||||||
|
{
|
||||||
|
hBrightness.val=sys0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// get ColorTemp value
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",5
|
||||||
|
if(tTmp.txt=="disable")
|
||||||
|
{
|
||||||
|
vis hTempSlider,0
|
||||||
|
vis t3,0
|
||||||
|
vis t4,0
|
||||||
|
mode_temp.val=0
|
||||||
|
// mode == 1 is temp controls currently shown
|
||||||
|
if(mode.val==1)
|
||||||
|
{
|
||||||
|
// switch mode
|
||||||
|
click bColor,1
|
||||||
|
click bColor,0
|
||||||
|
}
|
||||||
|
}else if(tTmp.txt=="unknown") // temp supported, but not in color mode
|
||||||
|
{
|
||||||
|
mode_temp.val=1
|
||||||
|
// mode == 1 is temp controls currently shown
|
||||||
|
if(mode.val==1)
|
||||||
|
{
|
||||||
|
// switch mode
|
||||||
|
click bColor,1
|
||||||
|
click bColor,0
|
||||||
|
}
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
mode_temp.val=1
|
||||||
|
vis hTempSlider,1
|
||||||
|
vis t3,1
|
||||||
|
vis t4,1
|
||||||
|
if(tmCooldown.en==0)
|
||||||
|
{
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
hTempSlider.val=sys0
|
||||||
|
}
|
||||||
|
// mode == 0 is rgb controls currently shown
|
||||||
|
if(mode.val==0)
|
||||||
|
{
|
||||||
|
// switch mode
|
||||||
|
click bColor,1
|
||||||
|
click bColor,0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// get Color value
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",6
|
||||||
|
// disable -> isn't supported
|
||||||
|
if(tTmp.txt=="disable")
|
||||||
|
{
|
||||||
|
vis t0,0
|
||||||
|
vis bColor,0
|
||||||
|
vis pColorWheel,0
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
vis t0,1
|
||||||
|
//only enable bColor button if color temp is also supported
|
||||||
|
if(mode_temp.val==1)
|
||||||
|
{
|
||||||
|
vis bColor,1
|
||||||
|
}
|
||||||
|
if(mode.val==0)
|
||||||
|
{
|
||||||
|
vis pColorWheel,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
|
||||||
|
}
|
||||||
|
if(tInstruction.txt=="timeout")
|
||||||
|
{
|
||||||
|
//set timeout to global var
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",1
|
||||||
|
covx tTmp.txt,sleepTimeout,0,0
|
||||||
|
}
|
||||||
|
if(tInstruction.txt=="pageType")
|
||||||
|
{
|
||||||
|
//command format pageType,specialPageName
|
||||||
|
//write name of speical page to tId
|
||||||
|
spstr strCommand.txt,tId.txt,",",1
|
||||||
|
//save second arg if there's one
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",2
|
||||||
|
//save third arg if there's one
|
||||||
|
spstr strCommand.txt,pageIcons.tTmp2.txt,",",3
|
||||||
|
//we are going to exit this page with this command, so we have to clear the buffer, so we are not getting into a stupid loop ...
|
||||||
|
udelete payloadLength-1
|
||||||
|
bufferPos=0
|
||||||
|
if(tId.txt=="cardEntities")
|
||||||
|
{
|
||||||
|
page cardEntities
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardMedia")
|
||||||
|
{
|
||||||
|
page cardMedia
|
||||||
|
}
|
||||||
|
if(tId.txt=="pageStartup")
|
||||||
|
{
|
||||||
|
page pageStartup
|
||||||
|
}
|
||||||
|
if(tId.txt=="popupNotify")
|
||||||
|
{
|
||||||
|
page popupNotify
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardGrid")
|
||||||
|
{
|
||||||
|
page cardGrid
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardAlarm")
|
||||||
|
{
|
||||||
|
page cardAlarm
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// end of user code
|
||||||
|
udelete payloadLength-1
|
||||||
|
bufferPos=0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// next character
|
||||||
|
bufferPos++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Timer tmCooldown
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Period (ms): 100
|
||||||
|
Enabled : no
|
||||||
|
|
||||||
|
Events
|
||||||
|
Timer Event
|
||||||
|
tmCooldown.en=0
|
||||||
|
|
||||||
|
TouchCap tc0
|
||||||
|
Attributes
|
||||||
|
Scope: local
|
||||||
|
Value: 0
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
sleepValue=0
|
||||||
|
|
||||||
397
HMI/US/portrait/n2t-out/popupNotify.txt
Normal file
397
HMI/US/portrait/n2t-out/popupNotify.txt
Normal file
@@ -0,0 +1,397 @@
|
|||||||
|
Page popupNotify
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Locked : no
|
||||||
|
Swide up page ID : disabled
|
||||||
|
Swide down page ID : disabled
|
||||||
|
Swide left page ID : disabled
|
||||||
|
Swide right page ID : disabled
|
||||||
|
|
||||||
|
Events
|
||||||
|
Preinitialize Event
|
||||||
|
vis p0,0
|
||||||
|
vis tSend,0
|
||||||
|
vis tTmp,0
|
||||||
|
vis tInstruction,0
|
||||||
|
vis tId,0
|
||||||
|
|
||||||
|
Variable (string) strCommand
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 1000
|
||||||
|
|
||||||
|
Variable (string) entn
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 30
|
||||||
|
|
||||||
|
Variable (int32) vaOldSleepT
|
||||||
|
Attributes
|
||||||
|
Scope: local
|
||||||
|
Value: 0
|
||||||
|
|
||||||
|
Text tSend
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : newtxt
|
||||||
|
Max. Text Size : 100
|
||||||
|
|
||||||
|
Text tTmp
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Text tInstruction
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 20
|
||||||
|
|
||||||
|
Text tId
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 20
|
||||||
|
|
||||||
|
Text tHeading
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 40
|
||||||
|
|
||||||
|
Text tText
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 500
|
||||||
|
|
||||||
|
Picture p0
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
|
||||||
|
Button b0
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : î
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
sleepTimeout=vaOldSleepT.val
|
||||||
|
tSend.txt="event,buttonPress2,popupNotify,bExit"
|
||||||
|
//send calc crc
|
||||||
|
btlen tSend.txt,sys0
|
||||||
|
crcrest 1,0xffff // reset CRC
|
||||||
|
crcputh 55 bb
|
||||||
|
crcputs sys0,1
|
||||||
|
crcputs tSend.txt,0
|
||||||
|
//send cmd
|
||||||
|
printh 55 bb
|
||||||
|
prints sys0,2
|
||||||
|
prints tSend.txt,0
|
||||||
|
prints crcval,2
|
||||||
|
|
||||||
|
Button b2
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
sleepTimeout=vaOldSleepT.val
|
||||||
|
//craft command
|
||||||
|
tSend.txt="event,buttonPress2,"+entn.txt+",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
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
sleepTimeout=vaOldSleepT.val
|
||||||
|
//craft command
|
||||||
|
tSend.txt="event,buttonPress2,"+entn.txt+",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
|
||||||
|
Scope : local
|
||||||
|
Period (ms): 1000
|
||||||
|
Enabled : yes
|
||||||
|
|
||||||
|
Events
|
||||||
|
Timer Event
|
||||||
|
if(sleepTimeout!=0)
|
||||||
|
{
|
||||||
|
sleepValue+=1
|
||||||
|
if(sleepTimeout<=sleepValue)
|
||||||
|
{
|
||||||
|
screensaver.originPage.val=dp
|
||||||
|
sleepValue=0
|
||||||
|
click b0,1
|
||||||
|
click b0,0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Timer tmSerial
|
||||||
|
Attributes
|
||||||
|
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 entn
|
||||||
|
spstr strCommand.txt,entn.txt,"|",1
|
||||||
|
// get Heading
|
||||||
|
spstr strCommand.txt,tHeading.txt,"|",2
|
||||||
|
// heading color
|
||||||
|
spstr strCommand.txt,tTmp.txt,"|",3
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
tHeading.pco=sys0
|
||||||
|
// get b1
|
||||||
|
spstr strCommand.txt,b1.txt,"|",4
|
||||||
|
if(b1.txt!="")
|
||||||
|
{
|
||||||
|
vis b1,1
|
||||||
|
}
|
||||||
|
// b1 color
|
||||||
|
spstr strCommand.txt,tTmp.txt,"|",5
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
b1.pco=sys0
|
||||||
|
// get b2
|
||||||
|
spstr strCommand.txt,b2.txt,"|",6
|
||||||
|
if(b2.txt!="")
|
||||||
|
{
|
||||||
|
vis b2,1
|
||||||
|
}
|
||||||
|
// b2 color
|
||||||
|
spstr strCommand.txt,tTmp.txt,"|",7
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
b2.pco=sys0
|
||||||
|
// get tText
|
||||||
|
spstr strCommand.txt,tText.txt,"|",8
|
||||||
|
// tText color
|
||||||
|
spstr strCommand.txt,tTmp.txt,"|",9
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
tText.pco=sys0
|
||||||
|
//preserve old sleepTimeout
|
||||||
|
vaOldSleepT.val=sleepTimeout
|
||||||
|
// sleep timeout
|
||||||
|
spstr strCommand.txt,tTmp.txt,"|",10
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
sleepTimeout=sys0
|
||||||
|
}
|
||||||
|
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=="exitPopup")
|
||||||
|
{
|
||||||
|
click b0,1
|
||||||
|
}
|
||||||
|
if(tInstruction.txt=="pageType")
|
||||||
|
{
|
||||||
|
sleepTimeout=vaOldSleepT.val
|
||||||
|
//command format pageType,specialPageName
|
||||||
|
//write name of speical page to tId
|
||||||
|
spstr strCommand.txt,tId.txt,",",1
|
||||||
|
//save second arg if there's one
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",2
|
||||||
|
//save third arg if there's one
|
||||||
|
spstr strCommand.txt,pageIcons.tTmp2.txt,",",3
|
||||||
|
//we are going to exit this page with this command, so we have to clear the buffer, so we are not getting into a stupid loop ...
|
||||||
|
udelete payloadLength-1
|
||||||
|
bufferPos=0
|
||||||
|
if(tId.txt=="popupLight")
|
||||||
|
{
|
||||||
|
pageIcons.tTmp1.txt=tTmp.txt
|
||||||
|
page popupLight
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardEntities")
|
||||||
|
{
|
||||||
|
page cardEntities
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardMedia")
|
||||||
|
{
|
||||||
|
page cardMedia
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardThermo")
|
||||||
|
{
|
||||||
|
page cardThermo
|
||||||
|
}
|
||||||
|
if(tId.txt=="pageStartup")
|
||||||
|
{
|
||||||
|
page pageStartup
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardGrid")
|
||||||
|
{
|
||||||
|
page cardGrid
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardAlarm")
|
||||||
|
{
|
||||||
|
page cardAlarm
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 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
|
||||||
|
Scope: local
|
||||||
|
Value: 0
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
sleepValue=0
|
||||||
|
|
||||||
429
HMI/US/portrait/n2t-out/popupShutter.txt
Normal file
429
HMI/US/portrait/n2t-out/popupShutter.txt
Normal file
@@ -0,0 +1,429 @@
|
|||||||
|
Page popupShutter
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Locked : no
|
||||||
|
Swide up page ID : disabled
|
||||||
|
Swide down page ID : disabled
|
||||||
|
Swide left page ID : disabled
|
||||||
|
Swide right page ID : disabled
|
||||||
|
|
||||||
|
Events
|
||||||
|
Preinitialize Event
|
||||||
|
//get entitiy name
|
||||||
|
tEntity.txt=pageIcons.tTmp1.txt
|
||||||
|
//get entity id
|
||||||
|
entn.txt=pageIcons.tTmp2.txt
|
||||||
|
vis p0,0
|
||||||
|
vis tSend,0
|
||||||
|
vis tTmp,0
|
||||||
|
vis tInstruction,0
|
||||||
|
vis tId,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
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 50
|
||||||
|
|
||||||
|
Variable (string) entn
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Text : newtxt
|
||||||
|
Max. Text Size: 50
|
||||||
|
|
||||||
|
Text tEntity
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : tEntity1
|
||||||
|
Max. Text Size : 25
|
||||||
|
|
||||||
|
Text tIcon1
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : î°
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Text tSend
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : newtxt
|
||||||
|
Max. Text Size : 100
|
||||||
|
|
||||||
|
Text tTmp
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Text tInstruction
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 20
|
||||||
|
|
||||||
|
Text tId
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 20
|
||||||
|
|
||||||
|
Text t1
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : Position
|
||||||
|
Max. Text Size : 15
|
||||||
|
|
||||||
|
Picture p0
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
|
||||||
|
Slider hPosition
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Position : 50
|
||||||
|
Upper range limit : 100
|
||||||
|
Lower range limit : 0
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Release Event
|
||||||
|
// event,buttonPress2,internalNameEntity,positionSlider,50
|
||||||
|
//craft command
|
||||||
|
tSend.txt="event,buttonPress2,"+entn.txt+",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
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : î
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
tSend.txt="event,buttonPress2,popupShutter,bExit"
|
||||||
|
//send calc crc
|
||||||
|
btlen tSend.txt,sys0
|
||||||
|
crcrest 1,0xffff // reset CRC
|
||||||
|
crcputh 55 bb
|
||||||
|
crcputs sys0,1
|
||||||
|
crcputs tSend.txt,0
|
||||||
|
//send cmd
|
||||||
|
printh 55 bb
|
||||||
|
prints sys0,2
|
||||||
|
prints tSend.txt,0
|
||||||
|
prints crcval,2
|
||||||
|
|
||||||
|
Button bDown1
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : î
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
tSend.txt="event,buttonPress2,"+entn.txt+",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
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : î
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
tSend.txt="event,buttonPress2,"+entn.txt+",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
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : î
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
tSend.txt="event,buttonPress2,"+entn.txt+",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
|
||||||
|
Scope : local
|
||||||
|
Period (ms): 1000
|
||||||
|
Enabled : yes
|
||||||
|
|
||||||
|
Events
|
||||||
|
Timer Event
|
||||||
|
if(sleepTimeout!=0)
|
||||||
|
{
|
||||||
|
sleepValue+=1
|
||||||
|
if(sleepTimeout<=sleepValue)
|
||||||
|
{
|
||||||
|
screensaver.originPage.val=dp
|
||||||
|
sleepValue=0
|
||||||
|
click b0,1
|
||||||
|
click b0,0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Timer tmSerial
|
||||||
|
Attributes
|
||||||
|
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
|
||||||
|
}
|
||||||
|
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
|
||||||
|
}
|
||||||
|
if(tInstruction.txt=="pageType")
|
||||||
|
{
|
||||||
|
//command format pageType,specialPageName
|
||||||
|
//write name of speical page to tId
|
||||||
|
spstr strCommand.txt,tId.txt,",",1
|
||||||
|
//save second arg if there's one
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",2
|
||||||
|
//save third arg if there's one
|
||||||
|
spstr strCommand.txt,pageIcons.tTmp2.txt,",",3
|
||||||
|
//we are going to exit this page with this command, so we have to clear the buffer, so we are not getting into a stupid loop ...
|
||||||
|
udelete payloadLength-1
|
||||||
|
bufferPos=0
|
||||||
|
if(tId.txt=="popupLight")
|
||||||
|
{
|
||||||
|
pageIcons.tTmp1.txt=tTmp.txt
|
||||||
|
page popupLight
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardEntities")
|
||||||
|
{
|
||||||
|
page cardEntities
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardMedia")
|
||||||
|
{
|
||||||
|
page cardMedia
|
||||||
|
}
|
||||||
|
if(tId.txt=="pageStartup")
|
||||||
|
{
|
||||||
|
page pageStartup
|
||||||
|
}
|
||||||
|
if(tId.txt=="popupNotify")
|
||||||
|
{
|
||||||
|
page popupNotify
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardGrid")
|
||||||
|
{
|
||||||
|
page cardGrid
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardAlarm")
|
||||||
|
{
|
||||||
|
page cardAlarm
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// end of user code
|
||||||
|
udelete payloadLength-1
|
||||||
|
bufferPos=0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 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
|
||||||
|
Scope: local
|
||||||
|
Value: 0
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
sleepValue=0
|
||||||
|
|
||||||
524
HMI/US/portrait/n2t-out/screensaver.txt
Normal file
524
HMI/US/portrait/n2t-out/screensaver.txt
Normal file
@@ -0,0 +1,524 @@
|
|||||||
|
Page screensaver
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Locked : no
|
||||||
|
Swide up page ID : disabled
|
||||||
|
Swide down page ID : disabled
|
||||||
|
Swide left page ID : disabled
|
||||||
|
Swide right page ID : disabled
|
||||||
|
|
||||||
|
Events
|
||||||
|
Preinitialize Event
|
||||||
|
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
|
||||||
|
spstr vaTime.txt,tTime.txt,"?",0
|
||||||
|
spstr vaTime.txt,tAMPM.txt,"?",1
|
||||||
|
if(tAMPM.txt=="")
|
||||||
|
{
|
||||||
|
vis tAMPM,0
|
||||||
|
}
|
||||||
|
tDate.txt=vaDate.txt
|
||||||
|
dim=dimValue
|
||||||
|
vis tSend,0
|
||||||
|
//page open event
|
||||||
|
// clear weather elements, to keep example content in HMI
|
||||||
|
tMainIcon.txt=""
|
||||||
|
tMainText.txt=""
|
||||||
|
tForecast1.txt=""
|
||||||
|
tF1Icon.txt=""
|
||||||
|
tForecast1Val.txt=""
|
||||||
|
tForecast2.txt=""
|
||||||
|
tF2Icon.txt=""
|
||||||
|
tForecast2Val.txt=""
|
||||||
|
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
|
||||||
|
|
||||||
|
Variable (string) strCommand
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 200
|
||||||
|
|
||||||
|
Variable (string) vaTime
|
||||||
|
Attributes
|
||||||
|
Scope : global
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 15
|
||||||
|
|
||||||
|
Variable (string) vaDate
|
||||||
|
Attributes
|
||||||
|
Scope : global
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 30
|
||||||
|
|
||||||
|
Variable (string) tId
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 25
|
||||||
|
|
||||||
|
Variable (int32) vaTap
|
||||||
|
Attributes
|
||||||
|
Scope: local
|
||||||
|
Value: 0
|
||||||
|
|
||||||
|
Number originPage
|
||||||
|
Attributes
|
||||||
|
Scope : global
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Value : 0
|
||||||
|
|
||||||
|
Text tInstruction
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 50
|
||||||
|
|
||||||
|
Text tTmp
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 50
|
||||||
|
|
||||||
|
Text tTime
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : 21:32
|
||||||
|
Max. Text Size : 15
|
||||||
|
|
||||||
|
Text tDate
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : Tuesday, 08. March 2022
|
||||||
|
Max. Text Size : 30
|
||||||
|
|
||||||
|
Text tSend
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 50
|
||||||
|
|
||||||
|
Text tMainIcon
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : î
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Text tMainText
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : 2,3 °C
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Text tForecast1
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : Mi
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Text tForecast1Val
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : 9,3 °C
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Text tF1Icon
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : î
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Text tForecast2
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : Do
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Text tF2Icon
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : î
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Text tForecast2Val
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : 11,9 °C
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Text t10
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : |
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Text tAMPM
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : PM
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Text tForecast3Val
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Text tF3Icon
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Text tForecast3
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Text tForecast4
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Text tF4Icon
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Text tForecast4Val
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Picture p0
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
|
||||||
|
Timer tmSerial
|
||||||
|
Attributes
|
||||||
|
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
|
||||||
|
click tc0,1
|
||||||
|
}
|
||||||
|
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
|
||||||
|
spstr vaTime.txt,tTime.txt,"?",0
|
||||||
|
spstr vaTime.txt,tAMPM.txt,"?",1
|
||||||
|
if(tAMPM.txt=="")
|
||||||
|
{
|
||||||
|
vis tAMPM,0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
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
|
||||||
|
//tForecast1
|
||||||
|
spstr strCommand.txt,tForecast1.txt,"?",3
|
||||||
|
//tF1Icon
|
||||||
|
spstr strCommand.txt,tTmp.txt,"?",4
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
substr pageIcons.tIcons.txt,tF1Icon.txt,sys0,1
|
||||||
|
//tForecast1Val
|
||||||
|
spstr strCommand.txt,tForecast1Val.txt,"?",5
|
||||||
|
//tForecast2
|
||||||
|
spstr strCommand.txt,tForecast2.txt,"?",6
|
||||||
|
//tF2Icon
|
||||||
|
spstr strCommand.txt,tTmp.txt,"?",7
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
substr pageIcons.tIcons.txt,tF2Icon.txt,sys0,1
|
||||||
|
//tForecast2Val
|
||||||
|
spstr strCommand.txt,tForecast2Val.txt,"?",8
|
||||||
|
//tForecast3
|
||||||
|
spstr strCommand.txt,tForecast3.txt,"?",9
|
||||||
|
//tF3Icon
|
||||||
|
spstr strCommand.txt,tTmp.txt,"?",10
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
substr pageIcons.tIcons.txt,tF3Icon.txt,sys0,1
|
||||||
|
//tForecast3Val
|
||||||
|
spstr strCommand.txt,tForecast3Val.txt,"?",11
|
||||||
|
//tForecast4
|
||||||
|
spstr strCommand.txt,tForecast4.txt,"?",12
|
||||||
|
//tF4Icon
|
||||||
|
spstr strCommand.txt,tTmp.txt,"?",13
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
substr pageIcons.tIcons.txt,tF4Icon.txt,sys0,1
|
||||||
|
//tForecast4Val
|
||||||
|
spstr strCommand.txt,tForecast4Val.txt,"?",14
|
||||||
|
}
|
||||||
|
if(tInstruction.txt=="pageType")
|
||||||
|
{
|
||||||
|
dim=100
|
||||||
|
//command format pageType,specialPageName
|
||||||
|
//write name of speical page to tId
|
||||||
|
spstr strCommand.txt,tId.txt,",",1
|
||||||
|
//save second arg if there's one
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",2
|
||||||
|
//save third arg if there's one
|
||||||
|
spstr strCommand.txt,pageIcons.tTmp2.txt,",",3
|
||||||
|
//we are going to exit this page with this command, so we have to clear the buffer, so we are not getting into a stupid loop ...
|
||||||
|
udelete 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=="popupNotify")
|
||||||
|
{
|
||||||
|
page popupNotify
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardGrid")
|
||||||
|
{
|
||||||
|
page cardGrid
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardEntities")
|
||||||
|
{
|
||||||
|
page cardEntities
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardAlarm")
|
||||||
|
{
|
||||||
|
page cardAlarm
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// end of user code
|
||||||
|
udelete payloadLength-1
|
||||||
|
bufferPos=0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// next character
|
||||||
|
bufferPos++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
TouchCap tc0
|
||||||
|
Attributes
|
||||||
|
Scope: local
|
||||||
|
Value: 0
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
dim=100
|
||||||
|
vaTap.val+=1
|
||||||
|
covx vaTap.val,tTmp.txt,0,0
|
||||||
|
tSend.txt="event,buttonPress2,screensaver,bExit,"+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
|
||||||
|
//dim=100
|
||||||
|
//page originPage.val
|
||||||
|
|
||||||
BIN
HMI/US/portrait/nspanel_US_P.HMI
Normal file
BIN
HMI/US/portrait/nspanel_US_P.HMI
Normal file
Binary file not shown.
BIN
HMI/US/portrait/nspanel_US_P.tft
Normal file
BIN
HMI/US/portrait/nspanel_US_P.tft
Normal file
Binary file not shown.
25592
HMI/code_gen/icons/icons.json
Normal file
25592
HMI/code_gen/icons/icons.json
Normal file
File diff suppressed because it is too large
Load Diff
103
HMI/code_gen/icons/icons.py
Normal file
103
HMI/code_gen/icons/icons.py
Normal file
@@ -0,0 +1,103 @@
|
|||||||
|
import json
|
||||||
|
import os
|
||||||
|
|
||||||
|
icons = [
|
||||||
|
"alert-circle-outline",
|
||||||
|
"lightbulb",
|
||||||
|
"thermometer",
|
||||||
|
"gesture-tap-button",
|
||||||
|
"flash",
|
||||||
|
"music",
|
||||||
|
"check-circle-outline",
|
||||||
|
"close-circle-outline",
|
||||||
|
"pause",
|
||||||
|
"play",
|
||||||
|
"palette",
|
||||||
|
"window-open",
|
||||||
|
"weather-cloudy",
|
||||||
|
"weather-fog",
|
||||||
|
"weather-hail",
|
||||||
|
"weather-lightning",
|
||||||
|
"weather-lightning-rainy",
|
||||||
|
"weather-night",
|
||||||
|
"weather-partly-cloudy",
|
||||||
|
"weather-pouring",
|
||||||
|
"weather-rainy",
|
||||||
|
"weather-snowy",
|
||||||
|
"weather-snowy-rainy",
|
||||||
|
"weather-sunny",
|
||||||
|
"weather-windy",
|
||||||
|
"weather-windy-variant",
|
||||||
|
"water-percent",
|
||||||
|
"power",
|
||||||
|
"fire",
|
||||||
|
"calendar-sync",
|
||||||
|
"fan",
|
||||||
|
"snowflake",
|
||||||
|
"solar-power",
|
||||||
|
"battery-charging-medium",
|
||||||
|
"battery-medium",
|
||||||
|
"shield-home",
|
||||||
|
"door-open",
|
||||||
|
"door-closed",
|
||||||
|
"window-closed",
|
||||||
|
"shield-off",
|
||||||
|
"shield",
|
||||||
|
"shield-lock",
|
||||||
|
"shield-airplane",
|
||||||
|
"bell-ring",
|
||||||
|
"ray-vertex"
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
__location__ = os.path.realpath(
|
||||||
|
os.path.join(os.getcwd(), os.path.dirname(__file__)))
|
||||||
|
|
||||||
|
with open(os.path.join(__location__, "icons.json"),'r') as f:
|
||||||
|
icon_metadata = json.load(f)
|
||||||
|
|
||||||
|
icon_nextion_string = ""
|
||||||
|
icon_name_list = []
|
||||||
|
|
||||||
|
for icon_name in icons:
|
||||||
|
#print(icon_name)
|
||||||
|
icon = next((item for item in icon_metadata if item["name"] == icon_name), None)
|
||||||
|
if icon is None:
|
||||||
|
print(f"WARNING ICON NOT FOUND: {icon_name}")
|
||||||
|
else:
|
||||||
|
hex = icon['hex']
|
||||||
|
s = int(hex, 16)
|
||||||
|
#print(chr(s), end = '')
|
||||||
|
icon_nextion_string += chr(s)
|
||||||
|
icon_name_list.append(icon_name)
|
||||||
|
|
||||||
|
# write mapping lib for python
|
||||||
|
with open(os.path.join(__location__, "../../../apps/nspanel-lovelace-ui/luibackend", "icon_mapping.py"), 'w') as f:
|
||||||
|
f.write("icons = {\n")
|
||||||
|
for idx, val in enumerate(icon_name_list):
|
||||||
|
f.write(f" '{val}': {idx},\n")
|
||||||
|
f.write("}\n")
|
||||||
|
f.write("""
|
||||||
|
def get_icon_id(ma_name):
|
||||||
|
if ma_name in icons:
|
||||||
|
return icons[ma_name]
|
||||||
|
else:
|
||||||
|
return icons["alert-circle-outline"]
|
||||||
|
""")
|
||||||
|
|
||||||
|
# write documentation file
|
||||||
|
with open(os.path.join(__location__, "../..","icons.md"), 'w') as f:
|
||||||
|
f.write("""
|
||||||
|
# Icons IDs
|
||||||
|
This file contains the Icons IDs included in the display firmware, addressable via serial.
|
||||||
|
|
||||||
|
ID | MD Icon Name | Icon
|
||||||
|
-- | ------------ | ----
|
||||||
|
""")
|
||||||
|
for idx, val in enumerate(icon_name_list):
|
||||||
|
f.write(f"{idx} | {val} | \n")
|
||||||
|
|
||||||
|
|
||||||
|
print("=== STRING for HMI Project ===")
|
||||||
|
print("=== Put the following string into the txt field in nextion ===")
|
||||||
|
print(icon_nextion_string)
|
||||||
51
HMI/icons.md
Normal file
51
HMI/icons.md
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
|
||||||
|
# Icons IDs
|
||||||
|
This file contains the Icons IDs included in the display firmware, addressable via serial.
|
||||||
|
|
||||||
|
ID | MD Icon Name | Icon
|
||||||
|
-- | ------------ | ----
|
||||||
|
0 | alert-circle-outline | 
|
||||||
|
1 | lightbulb | 
|
||||||
|
2 | thermometer | 
|
||||||
|
3 | gesture-tap-button | 
|
||||||
|
4 | flash | 
|
||||||
|
5 | music | 
|
||||||
|
6 | check-circle-outline | 
|
||||||
|
7 | close-circle-outline | 
|
||||||
|
8 | pause | 
|
||||||
|
9 | play | 
|
||||||
|
10 | palette | 
|
||||||
|
11 | window-open | 
|
||||||
|
12 | weather-cloudy | 
|
||||||
|
13 | weather-fog | 
|
||||||
|
14 | weather-hail | 
|
||||||
|
15 | weather-lightning | 
|
||||||
|
16 | weather-lightning-rainy | 
|
||||||
|
17 | weather-night | 
|
||||||
|
18 | weather-partly-cloudy | 
|
||||||
|
19 | weather-pouring | 
|
||||||
|
20 | weather-rainy | 
|
||||||
|
21 | weather-snowy | 
|
||||||
|
22 | weather-snowy-rainy | 
|
||||||
|
23 | weather-sunny | 
|
||||||
|
24 | weather-windy | 
|
||||||
|
25 | weather-windy-variant | 
|
||||||
|
26 | water-percent | 
|
||||||
|
27 | power | 
|
||||||
|
28 | fire | 
|
||||||
|
29 | calendar-sync | 
|
||||||
|
30 | fan | 
|
||||||
|
31 | snowflake | 
|
||||||
|
32 | solar-power | 
|
||||||
|
33 | battery-charging-medium | 
|
||||||
|
34 | battery-medium | 
|
||||||
|
35 | shield-home | 
|
||||||
|
36 | door-open | 
|
||||||
|
37 | door-closed | 
|
||||||
|
38 | window-closed | 
|
||||||
|
39 | shield-off | 
|
||||||
|
40 | shield | 
|
||||||
|
41 | shield-lock | 
|
||||||
|
42 | shield-airplane | 
|
||||||
|
43 | bell-ring | 
|
||||||
|
44 | ray-vertex | 
|
||||||
15
HMI/n2t-out-visual/Program.s.txt
Normal file
15
HMI/n2t-out-visual/Program.s.txt
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
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
|
||||||
|
// sleep timeout in s
|
||||||
|
int sleepTimeout=20
|
||||||
|
int sleepValue=0
|
||||||
|
// dim value
|
||||||
|
int dimValue=40
|
||||||
|
// fix touch offset
|
||||||
|
lcd_dev fffb 0002 0000 0020
|
||||||
|
page pageStartup
|
||||||
1238
HMI/n2t-out-visual/cardAlarm.txt
Normal file
1238
HMI/n2t-out-visual/cardAlarm.txt
Normal file
File diff suppressed because it is too large
Load Diff
2683
HMI/n2t-out-visual/cardEntities.txt
Normal file
2683
HMI/n2t-out-visual/cardEntities.txt
Normal file
File diff suppressed because it is too large
Load Diff
1279
HMI/n2t-out-visual/cardGrid.txt
Normal file
1279
HMI/n2t-out-visual/cardGrid.txt
Normal file
File diff suppressed because it is too large
Load Diff
1099
HMI/n2t-out-visual/cardMedia.txt
Normal file
1099
HMI/n2t-out-visual/cardMedia.txt
Normal file
File diff suppressed because it is too large
Load Diff
1524
HMI/n2t-out-visual/cardThermo.txt
Normal file
1524
HMI/n2t-out-visual/cardThermo.txt
Normal file
File diff suppressed because it is too large
Load Diff
62
HMI/n2t-out-visual/nspanel_Stats.txt
Normal file
62
HMI/n2t-out-visual/nspanel_Stats.txt
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
Program.s
|
||||||
|
0 Component(s)
|
||||||
|
10 Line(s) of event code
|
||||||
|
10 Unique line(s) of event code
|
||||||
|
pageIcons
|
||||||
|
6 Component(s)
|
||||||
|
0 Line(s) of event code
|
||||||
|
0 Unique line(s) of event code
|
||||||
|
pageTest
|
||||||
|
13 Component(s)
|
||||||
|
13 Line(s) of event code
|
||||||
|
13 Unique line(s) of event code
|
||||||
|
pageSerialTest
|
||||||
|
13 Component(s)
|
||||||
|
48 Line(s) of event code
|
||||||
|
43 Unique line(s) of event code
|
||||||
|
popupShutter
|
||||||
|
19 Component(s)
|
||||||
|
179 Line(s) of event code
|
||||||
|
102 Unique line(s) of event code
|
||||||
|
pageStartup
|
||||||
|
19 Component(s)
|
||||||
|
150 Line(s) of event code
|
||||||
|
113 Unique line(s) of event code
|
||||||
|
popupNotify
|
||||||
|
17 Component(s)
|
||||||
|
179 Line(s) of event code
|
||||||
|
118 Unique line(s) of event code
|
||||||
|
cardGrid
|
||||||
|
39 Component(s)
|
||||||
|
388 Line(s) of event code
|
||||||
|
224 Unique line(s) of event code
|
||||||
|
cardMedia
|
||||||
|
30 Component(s)
|
||||||
|
278 Line(s) of event code
|
||||||
|
139 Unique line(s) of event code
|
||||||
|
cardThermo
|
||||||
|
42 Component(s)
|
||||||
|
406 Line(s) of event code
|
||||||
|
218 Unique line(s) of event code
|
||||||
|
cardAlarm
|
||||||
|
35 Component(s)
|
||||||
|
276 Line(s) of event code
|
||||||
|
172 Unique line(s) of event code
|
||||||
|
popupLight
|
||||||
|
27 Component(s)
|
||||||
|
323 Line(s) of event code
|
||||||
|
174 Unique line(s) of event code
|
||||||
|
screensaver
|
||||||
|
31 Component(s)
|
||||||
|
183 Line(s) of event code
|
||||||
|
133 Unique line(s) of event code
|
||||||
|
cardEntities
|
||||||
|
62 Component(s)
|
||||||
|
930 Line(s) of event code
|
||||||
|
388 Unique line(s) of event code
|
||||||
|
|
||||||
|
Total
|
||||||
|
13 Page(s)
|
||||||
|
353 Component(s)
|
||||||
|
3363 Line(s) of event code
|
||||||
|
910 Unique line(s) of event code
|
||||||
157
HMI/n2t-out-visual/pageIcons.txt
Normal file
157
HMI/n2t-out-visual/pageIcons.txt
Normal 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 : 150
|
||||||
|
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
|
||||||
|
|
||||||
434
HMI/n2t-out-visual/pageSerialTest.txt
Normal file
434
HMI/n2t-out-visual/pageSerialTest.txt
Normal 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 : 4
|
||||||
|
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 : 4
|
||||||
|
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 : 4
|
||||||
|
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 : 4
|
||||||
|
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 : 4
|
||||||
|
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 : 4
|
||||||
|
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 : 4
|
||||||
|
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 : 4
|
||||||
|
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 : 4
|
||||||
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
File diff suppressed because it is too large
Load Diff
438
HMI/n2t-out-visual/pageTest.txt
Normal file
438
HMI/n2t-out-visual/pageTest.txt
Normal file
@@ -0,0 +1,438 @@
|
|||||||
|
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 : 4
|
||||||
|
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 : 4
|
||||||
|
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 b3
|
||||||
|
Attributes
|
||||||
|
ID : 4
|
||||||
|
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 : 4
|
||||||
|
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 : 5
|
||||||
|
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 : 4
|
||||||
|
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 : 6
|
||||||
|
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 : 4
|
||||||
|
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 : 7
|
||||||
|
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 : 4
|
||||||
|
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 : 8
|
||||||
|
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 : 4
|
||||||
|
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 : 9
|
||||||
|
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 : 4
|
||||||
|
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 : 10
|
||||||
|
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 : 4
|
||||||
|
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
|
||||||
|
|
||||||
|
Button b10
|
||||||
|
Attributes
|
||||||
|
ID : 11
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Opacity : 127
|
||||||
|
x coordinate : 115
|
||||||
|
y coordinate : 128
|
||||||
|
Width : 100
|
||||||
|
Height : 50
|
||||||
|
Effect : load
|
||||||
|
Effect Priority : 0
|
||||||
|
Effect Time : 300
|
||||||
|
Fill : solid color
|
||||||
|
Style : 3D auto
|
||||||
|
Font ID : 4
|
||||||
|
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 : alarm
|
||||||
|
Max. Text Size : 10
|
||||||
|
Word wrap : disabled
|
||||||
|
Horizontal Spacing : 0
|
||||||
|
Vertical Spacing : 0
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
page cardAlarm
|
||||||
|
|
||||||
|
Button b11
|
||||||
|
Attributes
|
||||||
|
ID : 12
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Opacity : 127
|
||||||
|
x coordinate : 117
|
||||||
|
y coordinate : 184
|
||||||
|
Width : 100
|
||||||
|
Height : 50
|
||||||
|
Effect : load
|
||||||
|
Effect Priority : 0
|
||||||
|
Effect Time : 300
|
||||||
|
Fill : solid color
|
||||||
|
Style : 3D auto
|
||||||
|
Font ID : 4
|
||||||
|
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 : grid
|
||||||
|
Max. Text Size : 10
|
||||||
|
Word wrap : disabled
|
||||||
|
Horizontal Spacing : 0
|
||||||
|
Vertical Spacing : 0
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
page cardGrid
|
||||||
|
|
||||||
979
HMI/n2t-out-visual/popupLight.txt
Normal file
979
HMI/n2t-out-visual/popupLight.txt
Normal file
@@ -0,0 +1,979 @@
|
|||||||
|
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 tId,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 t0,0
|
||||||
|
vis pColorWheel,0
|
||||||
|
//vis t0,0
|
||||||
|
|
||||||
|
Variable (string) strCommand
|
||||||
|
Attributes
|
||||||
|
ID : 17
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 100
|
||||||
|
|
||||||
|
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_temp
|
||||||
|
Attributes
|
||||||
|
ID : 24
|
||||||
|
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 : 92
|
||||||
|
y coordinate : 21
|
||||||
|
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 : 11
|
||||||
|
y coordinate : 21
|
||||||
|
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 : 226
|
||||||
|
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 : 267
|
||||||
|
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 : 181
|
||||||
|
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 : 143
|
||||||
|
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 : 7
|
||||||
|
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 tId
|
||||||
|
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 : 25
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Opacity : 127
|
||||||
|
x coordinate : 9
|
||||||
|
y coordinate : 80
|
||||||
|
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 : 167
|
||||||
|
y coordinate : 69
|
||||||
|
Width : 160
|
||||||
|
Height : 160
|
||||||
|
Effect : load
|
||||||
|
Effect Priority : 0
|
||||||
|
Effect Time : 300
|
||||||
|
Picture ID : 3
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
//craft command
|
||||||
|
tSend.txt="event,buttonPress2,"+entn.txt+",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 : 261
|
||||||
|
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
|
||||||
|
tmCooldown.en=1
|
||||||
|
tmCooldown.tim=2500
|
||||||
|
//craft command
|
||||||
|
tSend.txt="event,buttonPress2,"+entn.txt+",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 : 178
|
||||||
|
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 Release Event
|
||||||
|
tmCooldown.en=1
|
||||||
|
tmCooldown.tim=2500
|
||||||
|
//craft command
|
||||||
|
tSend.txt="event,buttonPress2,"+entn.txt+",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) : 14823
|
||||||
|
Font Color (Unpressed) : 65535
|
||||||
|
Font Color (Pressed) : 65535
|
||||||
|
Horizontal Alignment : center
|
||||||
|
Vertical Alignment : center
|
||||||
|
State : unpressed
|
||||||
|
Text : î
|
||||||
|
Max. Text Size : 10
|
||||||
|
Word wrap : disabled
|
||||||
|
Horizontal Spacing : 0
|
||||||
|
Vertical Spacing : 0
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
tSend.txt="event,buttonPress2,popupLight,bExit"
|
||||||
|
//send calc crc
|
||||||
|
btlen tSend.txt,sys0
|
||||||
|
crcrest 1,0xffff // reset CRC
|
||||||
|
crcputh 55 bb
|
||||||
|
crcputs sys0,1
|
||||||
|
crcputs tSend.txt,0
|
||||||
|
//send cmd
|
||||||
|
printh 55 bb
|
||||||
|
prints sys0,2
|
||||||
|
prints tSend.txt,0
|
||||||
|
prints crcval,2
|
||||||
|
|
||||||
|
Button bColor
|
||||||
|
Attributes
|
||||||
|
ID : 22
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Opacity : 127
|
||||||
|
x coordinate : 89
|
||||||
|
y coordinate : 68
|
||||||
|
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) : 14823
|
||||||
|
Font Color (Unpressed) : 65535
|
||||||
|
Font Color (Pressed) : 65535
|
||||||
|
Horizontal Alignment : center
|
||||||
|
Vertical Alignment : center
|
||||||
|
State : unpressed
|
||||||
|
Text : î
|
||||||
|
Max. Text Size : 10
|
||||||
|
Word wrap : disabled
|
||||||
|
Horizontal Spacing : 0
|
||||||
|
Vertical Spacing : 0
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
if(mode.val==1)
|
||||||
|
{
|
||||||
|
mode.val=0
|
||||||
|
//enable color wheel
|
||||||
|
vis pColorWheel,1
|
||||||
|
//disable color temp
|
||||||
|
vis t4,0
|
||||||
|
vis t3,0
|
||||||
|
vis hTempSlider,0
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
mode.val=1
|
||||||
|
//disable color wheel
|
||||||
|
vis pColorWheel,0
|
||||||
|
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 : 79
|
||||||
|
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
|
||||||
|
//craft command
|
||||||
|
tSend.txt="event,buttonPress2,"+entn.txt+","+"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
|
||||||
|
click b0,1
|
||||||
|
click b0,0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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")
|
||||||
|
{
|
||||||
|
// change icon
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",1
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
substr pageIcons.tIcons.txt,tIcon1.txt,sys0,1
|
||||||
|
vis tIcon1,1
|
||||||
|
// change icon color
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",2
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
tIcon1.pco=sys0
|
||||||
|
// get Button State
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",3
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
btOnOff1.val=sys0
|
||||||
|
// get Brightness value
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",4
|
||||||
|
if(tTmp.txt=="disable")
|
||||||
|
{
|
||||||
|
vis t1,0
|
||||||
|
vis t2,0
|
||||||
|
vis hBrightness,0
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
vis t1,1
|
||||||
|
vis t2,1
|
||||||
|
vis hBrightness,1
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
if(tmCooldown.en==0)
|
||||||
|
{
|
||||||
|
hBrightness.val=sys0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// get ColorTemp value
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",5
|
||||||
|
if(tTmp.txt=="disable")
|
||||||
|
{
|
||||||
|
vis hTempSlider,0
|
||||||
|
vis t3,0
|
||||||
|
vis t4,0
|
||||||
|
mode_temp.val=0
|
||||||
|
// mode == 1 is temp controls currently shown
|
||||||
|
if(mode.val==1)
|
||||||
|
{
|
||||||
|
// switch mode
|
||||||
|
click bColor,1
|
||||||
|
click bColor,0
|
||||||
|
}
|
||||||
|
}else if(tTmp.txt=="unknown") // temp supported, but not in color mode
|
||||||
|
{
|
||||||
|
mode_temp.val=1
|
||||||
|
// mode == 1 is temp controls currently shown
|
||||||
|
if(mode.val==1)
|
||||||
|
{
|
||||||
|
// switch mode
|
||||||
|
click bColor,1
|
||||||
|
click bColor,0
|
||||||
|
}
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
mode_temp.val=1
|
||||||
|
vis hTempSlider,1
|
||||||
|
vis t3,1
|
||||||
|
vis t4,1
|
||||||
|
if(tmCooldown.en==0)
|
||||||
|
{
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
hTempSlider.val=sys0
|
||||||
|
}
|
||||||
|
// mode == 0 is rgb controls currently shown
|
||||||
|
if(mode.val==0)
|
||||||
|
{
|
||||||
|
// switch mode
|
||||||
|
click bColor,1
|
||||||
|
click bColor,0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// get Color value
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",6
|
||||||
|
// disable -> isn't supported
|
||||||
|
if(tTmp.txt=="disable")
|
||||||
|
{
|
||||||
|
vis t0,0
|
||||||
|
vis bColor,0
|
||||||
|
vis pColorWheel,0
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
vis t0,1
|
||||||
|
//only enable bColor button if color temp is also supported
|
||||||
|
if(mode_temp.val==1)
|
||||||
|
{
|
||||||
|
vis bColor,1
|
||||||
|
}
|
||||||
|
if(mode.val==0)
|
||||||
|
{
|
||||||
|
vis pColorWheel,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
|
||||||
|
}
|
||||||
|
if(tInstruction.txt=="timeout")
|
||||||
|
{
|
||||||
|
//set timeout to global var
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",1
|
||||||
|
covx tTmp.txt,sleepTimeout,0,0
|
||||||
|
}
|
||||||
|
if(tInstruction.txt=="pageType")
|
||||||
|
{
|
||||||
|
//command format pageType,specialPageName
|
||||||
|
//write name of speical page to tId
|
||||||
|
spstr strCommand.txt,tId.txt,",",1
|
||||||
|
//save second arg if there's one
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",2
|
||||||
|
//save third arg if there's one
|
||||||
|
spstr strCommand.txt,pageIcons.tTmp2.txt,",",3
|
||||||
|
//we are going to exit this page with this command, so we have to clear the buffer, so we are not getting into a stupid loop ...
|
||||||
|
udelete payloadLength-1
|
||||||
|
bufferPos=0
|
||||||
|
if(tId.txt=="cardEntities")
|
||||||
|
{
|
||||||
|
page cardEntities
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardMedia")
|
||||||
|
{
|
||||||
|
page cardMedia
|
||||||
|
}
|
||||||
|
if(tId.txt=="pageStartup")
|
||||||
|
{
|
||||||
|
page pageStartup
|
||||||
|
}
|
||||||
|
if(tId.txt=="popupNotify")
|
||||||
|
{
|
||||||
|
page popupNotify
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardGrid")
|
||||||
|
{
|
||||||
|
page cardGrid
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardAlarm")
|
||||||
|
{
|
||||||
|
page cardAlarm
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// end of user code
|
||||||
|
udelete payloadLength-1
|
||||||
|
bufferPos=0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// next character
|
||||||
|
bufferPos++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Timer tmCooldown
|
||||||
|
Attributes
|
||||||
|
ID : 26
|
||||||
|
Scope : local
|
||||||
|
Period (ms): 100
|
||||||
|
Enabled : no
|
||||||
|
|
||||||
|
Events
|
||||||
|
Timer Event
|
||||||
|
tmCooldown.en=0
|
||||||
|
|
||||||
|
TouchCap tc0
|
||||||
|
Attributes
|
||||||
|
ID : 14
|
||||||
|
Scope: local
|
||||||
|
Value: 0
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
sleepValue=0
|
||||||
|
|
||||||
607
HMI/n2t-out-visual/popupNotify.txt
Normal file
607
HMI/n2t-out-visual/popupNotify.txt
Normal file
@@ -0,0 +1,607 @@
|
|||||||
|
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
|
||||||
|
|
||||||
|
Variable (string) strCommand
|
||||||
|
Attributes
|
||||||
|
ID : 8
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 1000
|
||||||
|
|
||||||
|
Variable (string) entn
|
||||||
|
Attributes
|
||||||
|
ID : 15
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 30
|
||||||
|
|
||||||
|
Variable (int32) vaOldSleepT
|
||||||
|
Attributes
|
||||||
|
ID : 16
|
||||||
|
Scope: local
|
||||||
|
Value: 0
|
||||||
|
|
||||||
|
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 : 500
|
||||||
|
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) : 14823
|
||||||
|
Font Color (Unpressed) : 65535
|
||||||
|
Font Color (Pressed) : 65535
|
||||||
|
Horizontal Alignment : center
|
||||||
|
Vertical Alignment : center
|
||||||
|
State : unpressed
|
||||||
|
Text : î
|
||||||
|
Max. Text Size : 10
|
||||||
|
Word wrap : disabled
|
||||||
|
Horizontal Spacing : 0
|
||||||
|
Vertical Spacing : 0
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
sleepTimeout=vaOldSleepT.val
|
||||||
|
tSend.txt="event,buttonPress2,popupNotify,bExit"
|
||||||
|
//send calc crc
|
||||||
|
btlen tSend.txt,sys0
|
||||||
|
crcrest 1,0xffff // reset CRC
|
||||||
|
crcputh 55 bb
|
||||||
|
crcputs sys0,1
|
||||||
|
crcputs tSend.txt,0
|
||||||
|
//send cmd
|
||||||
|
printh 55 bb
|
||||||
|
prints sys0,2
|
||||||
|
prints tSend.txt,0
|
||||||
|
prints crcval,2
|
||||||
|
|
||||||
|
Button b2
|
||||||
|
Attributes
|
||||||
|
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
|
||||||
|
sleepTimeout=vaOldSleepT.val
|
||||||
|
//craft command
|
||||||
|
tSend.txt="event,buttonPress2,"+entn.txt+",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
|
||||||
|
sleepTimeout=vaOldSleepT.val
|
||||||
|
//craft command
|
||||||
|
tSend.txt="event,buttonPress2,"+entn.txt+",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
|
||||||
|
click b0,1
|
||||||
|
click b0,0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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 entn
|
||||||
|
spstr strCommand.txt,entn.txt,"|",1
|
||||||
|
// get Heading
|
||||||
|
spstr strCommand.txt,tHeading.txt,"|",2
|
||||||
|
// heading color
|
||||||
|
spstr strCommand.txt,tTmp.txt,"|",3
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
tHeading.pco=sys0
|
||||||
|
// get b1
|
||||||
|
spstr strCommand.txt,b1.txt,"|",4
|
||||||
|
if(b1.txt!="")
|
||||||
|
{
|
||||||
|
vis b1,1
|
||||||
|
}
|
||||||
|
// b1 color
|
||||||
|
spstr strCommand.txt,tTmp.txt,"|",5
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
b1.pco=sys0
|
||||||
|
// get b2
|
||||||
|
spstr strCommand.txt,b2.txt,"|",6
|
||||||
|
if(b2.txt!="")
|
||||||
|
{
|
||||||
|
vis b2,1
|
||||||
|
}
|
||||||
|
// b2 color
|
||||||
|
spstr strCommand.txt,tTmp.txt,"|",7
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
b2.pco=sys0
|
||||||
|
// get tText
|
||||||
|
spstr strCommand.txt,tText.txt,"|",8
|
||||||
|
// tText color
|
||||||
|
spstr strCommand.txt,tTmp.txt,"|",9
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
tText.pco=sys0
|
||||||
|
//preserve old sleepTimeout
|
||||||
|
vaOldSleepT.val=sleepTimeout
|
||||||
|
// sleep timeout
|
||||||
|
spstr strCommand.txt,tTmp.txt,"|",10
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
sleepTimeout=sys0
|
||||||
|
}
|
||||||
|
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=="exitPopup")
|
||||||
|
{
|
||||||
|
click b0,1
|
||||||
|
}
|
||||||
|
if(tInstruction.txt=="pageType")
|
||||||
|
{
|
||||||
|
sleepTimeout=vaOldSleepT.val
|
||||||
|
//command format pageType,specialPageName
|
||||||
|
//write name of speical page to tId
|
||||||
|
spstr strCommand.txt,tId.txt,",",1
|
||||||
|
//save second arg if there's one
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",2
|
||||||
|
//save third arg if there's one
|
||||||
|
spstr strCommand.txt,pageIcons.tTmp2.txt,",",3
|
||||||
|
//we are going to exit this page with this command, so we have to clear the buffer, so we are not getting into a stupid loop ...
|
||||||
|
udelete payloadLength-1
|
||||||
|
bufferPos=0
|
||||||
|
if(tId.txt=="popupLight")
|
||||||
|
{
|
||||||
|
pageIcons.tTmp1.txt=tTmp.txt
|
||||||
|
page popupLight
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardEntities")
|
||||||
|
{
|
||||||
|
page cardEntities
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardMedia")
|
||||||
|
{
|
||||||
|
page cardMedia
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardThermo")
|
||||||
|
{
|
||||||
|
page cardThermo
|
||||||
|
}
|
||||||
|
if(tId.txt=="pageStartup")
|
||||||
|
{
|
||||||
|
page pageStartup
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardGrid")
|
||||||
|
{
|
||||||
|
page cardGrid
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardAlarm")
|
||||||
|
{
|
||||||
|
page cardAlarm
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 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
|
||||||
|
|
||||||
695
HMI/n2t-out-visual/popupShutter.txt
Normal file
695
HMI/n2t-out-visual/popupShutter.txt
Normal file
@@ -0,0 +1,695 @@
|
|||||||
|
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 tId,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 tId
|
||||||
|
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,buttonPress2,internalNameEntity,positionSlider,50
|
||||||
|
//craft command
|
||||||
|
tSend.txt="event,buttonPress2,"+entn.txt+",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) : 14823
|
||||||
|
Font Color (Unpressed) : 65535
|
||||||
|
Font Color (Pressed) : 65535
|
||||||
|
Horizontal Alignment : center
|
||||||
|
Vertical Alignment : center
|
||||||
|
State : unpressed
|
||||||
|
Text : î
|
||||||
|
Max. Text Size : 10
|
||||||
|
Word wrap : disabled
|
||||||
|
Horizontal Spacing : 0
|
||||||
|
Vertical Spacing : 0
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
tSend.txt="event,buttonPress2,popupShutter,bExit"
|
||||||
|
//send calc crc
|
||||||
|
btlen tSend.txt,sys0
|
||||||
|
crcrest 1,0xffff // reset CRC
|
||||||
|
crcputh 55 bb
|
||||||
|
crcputs sys0,1
|
||||||
|
crcputs tSend.txt,0
|
||||||
|
//send cmd
|
||||||
|
printh 55 bb
|
||||||
|
prints sys0,2
|
||||||
|
prints tSend.txt,0
|
||||||
|
prints crcval,2
|
||||||
|
|
||||||
|
Button bDown1
|
||||||
|
Attributes
|
||||||
|
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) : 14823
|
||||||
|
Font Color (Unpressed) : 65535
|
||||||
|
Font Color (Pressed) : 65535
|
||||||
|
Horizontal Alignment : center
|
||||||
|
Vertical Alignment : center
|
||||||
|
State : unpressed
|
||||||
|
Text : î
|
||||||
|
Max. Text Size : 10
|
||||||
|
Word wrap : disabled
|
||||||
|
Horizontal Spacing : 0
|
||||||
|
Vertical Spacing : 0
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
tSend.txt="event,buttonPress2,"+entn.txt+",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) : 14823
|
||||||
|
Font Color (Unpressed) : 65535
|
||||||
|
Font Color (Pressed) : 65535
|
||||||
|
Horizontal Alignment : center
|
||||||
|
Vertical Alignment : center
|
||||||
|
State : unpressed
|
||||||
|
Text : î
|
||||||
|
Max. Text Size : 10
|
||||||
|
Word wrap : disabled
|
||||||
|
Horizontal Spacing : 0
|
||||||
|
Vertical Spacing : 0
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
tSend.txt="event,buttonPress2,"+entn.txt+",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) : 14823
|
||||||
|
Font Color (Unpressed) : 65535
|
||||||
|
Font Color (Pressed) : 65535
|
||||||
|
Horizontal Alignment : center
|
||||||
|
Vertical Alignment : center
|
||||||
|
State : unpressed
|
||||||
|
Text : î
|
||||||
|
Max. Text Size : 10
|
||||||
|
Word wrap : disabled
|
||||||
|
Horizontal Spacing : 0
|
||||||
|
Vertical Spacing : 0
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
tSend.txt="event,buttonPress2,"+entn.txt+",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
|
||||||
|
click b0,1
|
||||||
|
click b0,0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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
|
||||||
|
}
|
||||||
|
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
|
||||||
|
}
|
||||||
|
if(tInstruction.txt=="pageType")
|
||||||
|
{
|
||||||
|
//command format pageType,specialPageName
|
||||||
|
//write name of speical page to tId
|
||||||
|
spstr strCommand.txt,tId.txt,",",1
|
||||||
|
//save second arg if there's one
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",2
|
||||||
|
//save third arg if there's one
|
||||||
|
spstr strCommand.txt,pageIcons.tTmp2.txt,",",3
|
||||||
|
//we are going to exit this page with this command, so we have to clear the buffer, so we are not getting into a stupid loop ...
|
||||||
|
udelete payloadLength-1
|
||||||
|
bufferPos=0
|
||||||
|
if(tId.txt=="popupLight")
|
||||||
|
{
|
||||||
|
pageIcons.tTmp1.txt=tTmp.txt
|
||||||
|
page popupLight
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardEntities")
|
||||||
|
{
|
||||||
|
page cardEntities
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardMedia")
|
||||||
|
{
|
||||||
|
page cardMedia
|
||||||
|
}
|
||||||
|
if(tId.txt=="pageStartup")
|
||||||
|
{
|
||||||
|
page pageStartup
|
||||||
|
}
|
||||||
|
if(tId.txt=="popupNotify")
|
||||||
|
{
|
||||||
|
page popupNotify
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardGrid")
|
||||||
|
{
|
||||||
|
page cardGrid
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardAlarm")
|
||||||
|
{
|
||||||
|
page cardAlarm
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// end of user code
|
||||||
|
udelete payloadLength-1
|
||||||
|
bufferPos=0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 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
|
||||||
|
|
||||||
990
HMI/n2t-out-visual/screensaver.txt
Normal file
990
HMI/n2t-out-visual/screensaver.txt
Normal file
@@ -0,0 +1,990 @@
|
|||||||
|
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
|
||||||
|
spstr vaTime.txt,tTime.txt,"?",0
|
||||||
|
spstr vaTime.txt,tAMPM.txt,"?",1
|
||||||
|
if(tAMPM.txt=="")
|
||||||
|
{
|
||||||
|
vis tAMPM,0
|
||||||
|
}
|
||||||
|
tDate.txt=vaDate.txt
|
||||||
|
dim=dimValue
|
||||||
|
vis tSend,0
|
||||||
|
//page open event
|
||||||
|
// clear weather elements, to keep example content in HMI
|
||||||
|
tMainIcon.txt=""
|
||||||
|
tMainText.txt=""
|
||||||
|
tForecast1.txt=""
|
||||||
|
tF1Icon.txt=""
|
||||||
|
tForecast1Val.txt=""
|
||||||
|
tForecast2.txt=""
|
||||||
|
tF2Icon.txt=""
|
||||||
|
tForecast2Val.txt=""
|
||||||
|
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
|
||||||
|
|
||||||
|
Variable (string) strCommand
|
||||||
|
Attributes
|
||||||
|
ID : 5
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 200
|
||||||
|
|
||||||
|
Variable (string) vaTime
|
||||||
|
Attributes
|
||||||
|
ID : 10
|
||||||
|
Scope : global
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 15
|
||||||
|
|
||||||
|
Variable (string) vaDate
|
||||||
|
Attributes
|
||||||
|
ID : 11
|
||||||
|
Scope : global
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 30
|
||||||
|
|
||||||
|
Variable (string) tId
|
||||||
|
Attributes
|
||||||
|
ID : 22
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 25
|
||||||
|
|
||||||
|
Variable (int32) vaTap
|
||||||
|
Attributes
|
||||||
|
ID : 30
|
||||||
|
Scope: local
|
||||||
|
Value: 0
|
||||||
|
|
||||||
|
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 : 50
|
||||||
|
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 : 50
|
||||||
|
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 : 5
|
||||||
|
Back. Color : 0
|
||||||
|
Font Color : 65535
|
||||||
|
Horizontal Alignment : center
|
||||||
|
Vertical Alignment : center
|
||||||
|
Input Type : character
|
||||||
|
Text : 21:32
|
||||||
|
Max. Text Size : 15
|
||||||
|
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 : 50
|
||||||
|
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 : 26
|
||||||
|
y coordinate : 202
|
||||||
|
Width : 70
|
||||||
|
Height : 66
|
||||||
|
Effect : load
|
||||||
|
Effect Priority : 0
|
||||||
|
Effect Time : 300
|
||||||
|
Fill : solid color
|
||||||
|
Style : flat
|
||||||
|
Associated Keyboard : none
|
||||||
|
Font ID : 3
|
||||||
|
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 : 7
|
||||||
|
y coordinate : 267
|
||||||
|
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 tForecast1
|
||||||
|
Attributes
|
||||||
|
ID : 15
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Opacity : 127
|
||||||
|
x coordinate : 128
|
||||||
|
y coordinate : 210
|
||||||
|
Width : 72
|
||||||
|
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 : 16
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Opacity : 127
|
||||||
|
x coordinate : 126
|
||||||
|
y coordinate : 277
|
||||||
|
Width : 72
|
||||||
|
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 : 17
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Opacity : 127
|
||||||
|
x coordinate : 146
|
||||||
|
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 : 18
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Opacity : 127
|
||||||
|
x coordinate : 212
|
||||||
|
y coordinate : 210
|
||||||
|
Width : 72
|
||||||
|
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 : 19
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Opacity : 127
|
||||||
|
x coordinate : 228
|
||||||
|
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 tForecast2Val
|
||||||
|
Attributes
|
||||||
|
ID : 20
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Opacity : 127
|
||||||
|
x coordinate : 212
|
||||||
|
y coordinate : 277
|
||||||
|
Width : 72
|
||||||
|
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 : 21
|
||||||
|
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
|
||||||
|
|
||||||
|
Text tAMPM
|
||||||
|
Attributes
|
||||||
|
ID : 23
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Opacity : 127
|
||||||
|
x coordinate : 343
|
||||||
|
y coordinate : 48
|
||||||
|
Width : 104
|
||||||
|
Height : 57
|
||||||
|
Effect : load
|
||||||
|
Effect Priority : 0
|
||||||
|
Effect Time : 300
|
||||||
|
Fill : solid color
|
||||||
|
Style : flat
|
||||||
|
Associated Keyboard : none
|
||||||
|
Font ID : 3
|
||||||
|
Back. Color : 0
|
||||||
|
Font Color : 65535
|
||||||
|
Horizontal Alignment : center
|
||||||
|
Vertical Alignment : center
|
||||||
|
Input Type : character
|
||||||
|
Text : PM
|
||||||
|
Max. Text Size : 10
|
||||||
|
Word wrap : disabled
|
||||||
|
Horizontal Spacing : 0
|
||||||
|
Vertical Spacing : 0
|
||||||
|
|
||||||
|
Text tForecast3Val
|
||||||
|
Attributes
|
||||||
|
ID : 24
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Opacity : 127
|
||||||
|
x coordinate : 292
|
||||||
|
y coordinate : 277
|
||||||
|
Width : 71
|
||||||
|
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 :
|
||||||
|
Max. Text Size : 10
|
||||||
|
Word wrap : disabled
|
||||||
|
Horizontal Spacing : 0
|
||||||
|
Vertical Spacing : 0
|
||||||
|
|
||||||
|
Text tF3Icon
|
||||||
|
Attributes
|
||||||
|
ID : 25
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Opacity : 127
|
||||||
|
x coordinate : 309
|
||||||
|
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 tForecast3
|
||||||
|
Attributes
|
||||||
|
ID : 26
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Opacity : 127
|
||||||
|
x coordinate : 293
|
||||||
|
y coordinate : 210
|
||||||
|
Width : 72
|
||||||
|
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 :
|
||||||
|
Max. Text Size : 10
|
||||||
|
Word wrap : disabled
|
||||||
|
Horizontal Spacing : 0
|
||||||
|
Vertical Spacing : 0
|
||||||
|
|
||||||
|
Text tForecast4
|
||||||
|
Attributes
|
||||||
|
ID : 27
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Opacity : 127
|
||||||
|
x coordinate : 374
|
||||||
|
y coordinate : 210
|
||||||
|
Width : 72
|
||||||
|
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 :
|
||||||
|
Max. Text Size : 10
|
||||||
|
Word wrap : disabled
|
||||||
|
Horizontal Spacing : 0
|
||||||
|
Vertical Spacing : 0
|
||||||
|
|
||||||
|
Text tF4Icon
|
||||||
|
Attributes
|
||||||
|
ID : 28
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Opacity : 127
|
||||||
|
x coordinate : 390
|
||||||
|
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 tForecast4Val
|
||||||
|
Attributes
|
||||||
|
ID : 29
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Opacity : 127
|
||||||
|
x coordinate : 374
|
||||||
|
y coordinate : 277
|
||||||
|
Width : 72
|
||||||
|
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 :
|
||||||
|
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
|
||||||
|
click tc0,1
|
||||||
|
}
|
||||||
|
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
|
||||||
|
spstr vaTime.txt,tTime.txt,"?",0
|
||||||
|
spstr vaTime.txt,tAMPM.txt,"?",1
|
||||||
|
if(tAMPM.txt=="")
|
||||||
|
{
|
||||||
|
vis tAMPM,0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
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
|
||||||
|
//tForecast1
|
||||||
|
spstr strCommand.txt,tForecast1.txt,"?",3
|
||||||
|
//tF1Icon
|
||||||
|
spstr strCommand.txt,tTmp.txt,"?",4
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
substr pageIcons.tIcons.txt,tF1Icon.txt,sys0,1
|
||||||
|
//tForecast1Val
|
||||||
|
spstr strCommand.txt,tForecast1Val.txt,"?",5
|
||||||
|
//tForecast2
|
||||||
|
spstr strCommand.txt,tForecast2.txt,"?",6
|
||||||
|
//tF2Icon
|
||||||
|
spstr strCommand.txt,tTmp.txt,"?",7
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
substr pageIcons.tIcons.txt,tF2Icon.txt,sys0,1
|
||||||
|
//tForecast2Val
|
||||||
|
spstr strCommand.txt,tForecast2Val.txt,"?",8
|
||||||
|
//tForecast3
|
||||||
|
spstr strCommand.txt,tForecast3.txt,"?",9
|
||||||
|
//tF3Icon
|
||||||
|
spstr strCommand.txt,tTmp.txt,"?",10
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
substr pageIcons.tIcons.txt,tF3Icon.txt,sys0,1
|
||||||
|
//tForecast3Val
|
||||||
|
spstr strCommand.txt,tForecast3Val.txt,"?",11
|
||||||
|
//tForecast4
|
||||||
|
spstr strCommand.txt,tForecast4.txt,"?",12
|
||||||
|
//tF4Icon
|
||||||
|
spstr strCommand.txt,tTmp.txt,"?",13
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
substr pageIcons.tIcons.txt,tF4Icon.txt,sys0,1
|
||||||
|
//tForecast4Val
|
||||||
|
spstr strCommand.txt,tForecast4Val.txt,"?",14
|
||||||
|
}
|
||||||
|
if(tInstruction.txt=="pageType")
|
||||||
|
{
|
||||||
|
dim=100
|
||||||
|
//command format pageType,specialPageName
|
||||||
|
//write name of speical page to tId
|
||||||
|
spstr strCommand.txt,tId.txt,",",1
|
||||||
|
//save second arg if there's one
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",2
|
||||||
|
//save third arg if there's one
|
||||||
|
spstr strCommand.txt,pageIcons.tTmp2.txt,",",3
|
||||||
|
//we are going to exit this page with this command, so we have to clear the buffer, so we are not getting into a stupid loop ...
|
||||||
|
udelete 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=="popupNotify")
|
||||||
|
{
|
||||||
|
page popupNotify
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardGrid")
|
||||||
|
{
|
||||||
|
page cardGrid
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardEntities")
|
||||||
|
{
|
||||||
|
page cardEntities
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardAlarm")
|
||||||
|
{
|
||||||
|
page cardAlarm
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 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
|
||||||
|
vaTap.val+=1
|
||||||
|
covx vaTap.val,tTmp.txt,0,0
|
||||||
|
tSend.txt="event,buttonPress2,screensaver,bExit,"+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
|
||||||
|
//dim=100
|
||||||
|
//page originPage.val
|
||||||
|
|
||||||
@@ -5,24 +5,11 @@ Program.s
|
|||||||
int recvCrc=0
|
int recvCrc=0
|
||||||
int payloadLength=0
|
int payloadLength=0
|
||||||
int par0=0,par1=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
|
// sleep timeout in s
|
||||||
int sleepTimeout=20
|
int sleepTimeout=20
|
||||||
int sleepValue=0
|
int sleepValue=0
|
||||||
// dim value
|
// dim value
|
||||||
int dimValue=40
|
int dimValue=40
|
||||||
// current page
|
|
||||||
int nPage=0
|
|
||||||
// fix touch offset
|
// fix touch offset
|
||||||
lcd_dev fffb 0002 0000 0020
|
lcd_dev fffb 0002 0000 0020
|
||||||
page pageStartup
|
page pageStartup
|
||||||
|
|||||||
705
HMI/n2t-out/cardAlarm.txt
Normal file
705
HMI/n2t-out/cardAlarm.txt
Normal file
@@ -0,0 +1,705 @@
|
|||||||
|
Page cardAlarm
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Locked : no
|
||||||
|
Swide up page ID : disabled
|
||||||
|
Swide down page ID : disabled
|
||||||
|
Swide left page ID : disabled
|
||||||
|
Swide right page ID : disabled
|
||||||
|
|
||||||
|
Events
|
||||||
|
Preinitialize Event
|
||||||
|
vis p0,0
|
||||||
|
vis tSend,0
|
||||||
|
vis tInstruction,0
|
||||||
|
vis tTmp,0
|
||||||
|
vis tId,0
|
||||||
|
//vis nPageDisp,0
|
||||||
|
vis arm1,0
|
||||||
|
vis arm2,0
|
||||||
|
vis arm3,0
|
||||||
|
vis arm4,0
|
||||||
|
vis b0,0
|
||||||
|
vis b1,0
|
||||||
|
vis b2,0
|
||||||
|
vis b3,0
|
||||||
|
vis b4,0
|
||||||
|
vis b5,0
|
||||||
|
vis b6,0
|
||||||
|
vis b7,0
|
||||||
|
vis b8,0
|
||||||
|
vis b9,0
|
||||||
|
vis b10,0
|
||||||
|
vis tCode,0
|
||||||
|
|
||||||
|
Variable (string) strCommand
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 200
|
||||||
|
|
||||||
|
Variable (string) entn
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 50
|
||||||
|
|
||||||
|
Variable (string) tSend
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 100
|
||||||
|
|
||||||
|
Variable (string) va1
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 20
|
||||||
|
|
||||||
|
Variable (string) va2
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 20
|
||||||
|
|
||||||
|
Variable (string) va3
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 20
|
||||||
|
|
||||||
|
Variable (string) va4
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 20
|
||||||
|
|
||||||
|
Text tTmp
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Text tInstruction
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 20
|
||||||
|
|
||||||
|
Text tId
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 20
|
||||||
|
|
||||||
|
Text tCode
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Text tIcon
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Picture p0
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
|
||||||
|
Button bNext
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : î³
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
tSend.txt="event,buttonPress2,cardAlarm,bNext"
|
||||||
|
//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
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : î°
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
tSend.txt="event,buttonPress2,cardAlarm,bPrev"
|
||||||
|
//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
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : 1
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
tCode.txt=tCode.txt+"1"
|
||||||
|
|
||||||
|
Button b1
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : 2
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
tCode.txt=tCode.txt+"2"
|
||||||
|
|
||||||
|
Button b2
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : 3
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
tCode.txt=tCode.txt+"3"
|
||||||
|
|
||||||
|
Button b3
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : 4
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
tCode.txt=tCode.txt+"4"
|
||||||
|
|
||||||
|
Button b4
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : 5
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
tCode.txt=tCode.txt+"5"
|
||||||
|
|
||||||
|
Button b5
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : 6
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
tCode.txt=tCode.txt+"6"
|
||||||
|
|
||||||
|
Button b6
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : 7
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
tCode.txt=tCode.txt+"7"
|
||||||
|
|
||||||
|
Button b7
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : 8
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
tCode.txt=tCode.txt+"8"
|
||||||
|
|
||||||
|
Button b8
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : 9
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
tCode.txt=tCode.txt+"9"
|
||||||
|
|
||||||
|
Button b9
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : 0
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
tCode.txt=tCode.txt+"0"
|
||||||
|
|
||||||
|
Button b10
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : CLR
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
tCode.txt=""
|
||||||
|
|
||||||
|
Button arm1
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 40
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
// event,buttonPress2,entn,arm1,tCode
|
||||||
|
tSend.txt="event,buttonPress2,"
|
||||||
|
tSend.txt+=entn.txt+","
|
||||||
|
tSend.txt+=va1.txt+","
|
||||||
|
tSend.txt+=tCode.txt
|
||||||
|
//send calc crc
|
||||||
|
btlen tSend.txt,sys0
|
||||||
|
crcrest 1,0xffff // reset CRC
|
||||||
|
crcputh 55 bb
|
||||||
|
crcputs sys0,1
|
||||||
|
crcputs tSend.txt,0
|
||||||
|
//send cmd
|
||||||
|
printh 55 bb
|
||||||
|
prints sys0,2
|
||||||
|
prints tSend.txt,0
|
||||||
|
prints crcval,2
|
||||||
|
tCode.txt=""
|
||||||
|
|
||||||
|
Button arm3
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 40
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
// event,buttonPress2,entn,arm1,tCode
|
||||||
|
tSend.txt="event,buttonPress2,"
|
||||||
|
tSend.txt+=entn.txt+","
|
||||||
|
tSend.txt+=va3.txt+","
|
||||||
|
tSend.txt+=tCode.txt
|
||||||
|
//send calc crc
|
||||||
|
btlen tSend.txt,sys0
|
||||||
|
crcrest 1,0xffff // reset CRC
|
||||||
|
crcputh 55 bb
|
||||||
|
crcputs sys0,1
|
||||||
|
crcputs tSend.txt,0
|
||||||
|
//send cmd
|
||||||
|
printh 55 bb
|
||||||
|
prints sys0,2
|
||||||
|
prints tSend.txt,0
|
||||||
|
prints crcval,2
|
||||||
|
tCode.txt=""
|
||||||
|
|
||||||
|
Button arm2
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 40
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
// event,buttonPress2,entn,arm1,tCode
|
||||||
|
tSend.txt="event,buttonPress2,"
|
||||||
|
tSend.txt+=entn.txt+","
|
||||||
|
tSend.txt+=va2.txt+","
|
||||||
|
tSend.txt+=tCode.txt
|
||||||
|
//send calc crc
|
||||||
|
btlen tSend.txt,sys0
|
||||||
|
crcrest 1,0xffff // reset CRC
|
||||||
|
crcputh 55 bb
|
||||||
|
crcputs sys0,1
|
||||||
|
crcputs tSend.txt,0
|
||||||
|
//send cmd
|
||||||
|
printh 55 bb
|
||||||
|
prints sys0,2
|
||||||
|
prints tSend.txt,0
|
||||||
|
prints crcval,2
|
||||||
|
tCode.txt=""
|
||||||
|
|
||||||
|
Button arm4
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 40
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
// event,buttonPress2,entn,arm1,tCode
|
||||||
|
tSend.txt="event,buttonPress2,"
|
||||||
|
tSend.txt+=entn.txt+","
|
||||||
|
tSend.txt+=va4.txt+","
|
||||||
|
tSend.txt+=tCode.txt
|
||||||
|
//send calc crc
|
||||||
|
btlen tSend.txt,sys0
|
||||||
|
crcrest 1,0xffff // reset CRC
|
||||||
|
crcputh 55 bb
|
||||||
|
crcputs sys0,1
|
||||||
|
crcputs tSend.txt,0
|
||||||
|
//send cmd
|
||||||
|
printh 55 bb
|
||||||
|
prints sys0,2
|
||||||
|
prints tSend.txt,0
|
||||||
|
prints crcval,2
|
||||||
|
tCode.txt=""
|
||||||
|
|
||||||
|
Timer tmSerial
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Period (ms): 50
|
||||||
|
Enabled : yes
|
||||||
|
|
||||||
|
Events
|
||||||
|
Timer Event
|
||||||
|
// data available
|
||||||
|
if(usize>1)
|
||||||
|
{
|
||||||
|
bufferPos=0
|
||||||
|
while(bufferPos<usize)
|
||||||
|
{
|
||||||
|
// check for 0x55 0xBB - Command Init Secuence
|
||||||
|
if(u[bufferPos]==187&&u[bufferPos-1]==85)
|
||||||
|
{
|
||||||
|
//remove garbage at the start of the buffer if there's any to free buffer for command
|
||||||
|
if(u[bufferPos]!=1)
|
||||||
|
{
|
||||||
|
udelete bufferPos-1
|
||||||
|
}
|
||||||
|
//instruction is now aligned with buffer, because we deleted garbage before instrcution
|
||||||
|
//get length after init sequence (check if there are more than to bytes in buffer)
|
||||||
|
if(3<usize)
|
||||||
|
{
|
||||||
|
// check if serial buffer has reached the announced length
|
||||||
|
ucopy payloadLength,2,2,0
|
||||||
|
// we are only checking payload length so we have to skip first 3 bytes (init+payload length) (-1 because of < instead of <=)
|
||||||
|
payloadLength+=3
|
||||||
|
// payload length does also not contain crc, so we are adding another 2 bytes for crc
|
||||||
|
payloadLength+=2
|
||||||
|
if(payloadLength<usize)
|
||||||
|
{
|
||||||
|
// calculate crc
|
||||||
|
crcrest 1,0xFFFF
|
||||||
|
// u[2] contains payload legth at 3rd pos in buffer, we are calculating crc from 3rd pos with number of bytes from payload length
|
||||||
|
//crcputu 3,u[2]
|
||||||
|
// u[2] cotnains payload length, we are calculating a crc over the whole message, so we have to add 3 to the length from u[2]
|
||||||
|
crcputu 0,payloadLength-1
|
||||||
|
// get recived crc to be able to compare it
|
||||||
|
ucopy recvCrc,payloadLength-1,2,0
|
||||||
|
// compare crc with recived value
|
||||||
|
if(crcval==recvCrc)
|
||||||
|
{
|
||||||
|
// crc is okay
|
||||||
|
// here is the location where acual code should be
|
||||||
|
// write command to variable strCommand
|
||||||
|
ucopy strCommand.txt,4,payloadLength-5,0
|
||||||
|
// write instruction to tInstuction (debug output, but used as variable here, ui elements will be disabled by default)
|
||||||
|
spstr strCommand.txt,tInstruction.txt,",",0
|
||||||
|
if(tInstruction.txt=="entityUpd")
|
||||||
|
{
|
||||||
|
//entn
|
||||||
|
spstr strCommand.txt,entn.txt,",",1
|
||||||
|
//text arm1
|
||||||
|
spstr strCommand.txt,arm1.txt,",",2
|
||||||
|
if(arm1.txt!="")
|
||||||
|
{
|
||||||
|
vis arm1,1
|
||||||
|
}
|
||||||
|
//id arm1
|
||||||
|
spstr strCommand.txt,va1.txt,",",3
|
||||||
|
//text arm2
|
||||||
|
spstr strCommand.txt,arm2.txt,",",4
|
||||||
|
if(arm2.txt!="")
|
||||||
|
{
|
||||||
|
vis arm2,1
|
||||||
|
}
|
||||||
|
//id arm2
|
||||||
|
spstr strCommand.txt,va2.txt,",",5
|
||||||
|
//text arm3
|
||||||
|
spstr strCommand.txt,arm3.txt,",",6
|
||||||
|
if(arm3.txt!="")
|
||||||
|
{
|
||||||
|
vis arm3,1
|
||||||
|
}
|
||||||
|
//id arm3
|
||||||
|
spstr strCommand.txt,va3.txt,",",7
|
||||||
|
//text arm4
|
||||||
|
spstr strCommand.txt,arm4.txt,",",8
|
||||||
|
if(arm4.txt!="")
|
||||||
|
{
|
||||||
|
vis arm4,1
|
||||||
|
}
|
||||||
|
//id arm4
|
||||||
|
spstr strCommand.txt,va4.txt,",",9
|
||||||
|
//icon
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",10
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
substr pageIcons.tIcons.txt,tIcon.txt,sys0,1
|
||||||
|
//icon color
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",11
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
tIcon.pco=sys0
|
||||||
|
//numpad status
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",12
|
||||||
|
if(tTmp.txt!="disable")
|
||||||
|
{
|
||||||
|
vis b0,1
|
||||||
|
vis b1,1
|
||||||
|
vis b2,1
|
||||||
|
vis b3,1
|
||||||
|
vis b4,1
|
||||||
|
vis b5,1
|
||||||
|
vis b6,1
|
||||||
|
vis b7,1
|
||||||
|
vis b8,1
|
||||||
|
vis b9,1
|
||||||
|
vis b10,1
|
||||||
|
vis tCode,1
|
||||||
|
}
|
||||||
|
//flashing status
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",13
|
||||||
|
if(tTmp.txt=="enable")
|
||||||
|
{
|
||||||
|
tmFlash.en=1
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
tmFlash.en=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
|
||||||
|
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
|
||||||
|
//save third arg if there's one
|
||||||
|
spstr strCommand.txt,pageIcons.tTmp2.txt,",",3
|
||||||
|
//we are going to exit this page with this command, so we have to clear the buffer, so we are not getting into a stupid loop ...
|
||||||
|
udelete payloadLength-1
|
||||||
|
bufferPos=0
|
||||||
|
if(tId.txt=="popupLight")
|
||||||
|
{
|
||||||
|
pageIcons.tTmp1.txt=tTmp.txt
|
||||||
|
page popupLight
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardEntities")
|
||||||
|
{
|
||||||
|
page cardEntities
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardThermo")
|
||||||
|
{
|
||||||
|
page cardThermo
|
||||||
|
}
|
||||||
|
if(tId.txt=="pageStartup")
|
||||||
|
{
|
||||||
|
page pageStartup
|
||||||
|
}
|
||||||
|
if(tId.txt=="popupNotify")
|
||||||
|
{
|
||||||
|
page popupNotify
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardGrid")
|
||||||
|
{
|
||||||
|
page cardGrid
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardMedia")
|
||||||
|
{
|
||||||
|
page cardMedia
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// end of user code
|
||||||
|
udelete payloadLength-1
|
||||||
|
bufferPos=0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// next character
|
||||||
|
bufferPos++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Timer tmSleep
|
||||||
|
Attributes
|
||||||
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Timer tmFlash
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Period (ms): 600
|
||||||
|
Enabled : no
|
||||||
|
|
||||||
|
Events
|
||||||
|
Timer Event
|
||||||
|
if(tIcon.isbr==1)
|
||||||
|
{
|
||||||
|
tIcon.isbr=0
|
||||||
|
vis tIcon,0
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
tIcon.isbr=1
|
||||||
|
vis tIcon,1
|
||||||
|
}
|
||||||
|
|
||||||
|
TouchCap tc0
|
||||||
|
Attributes
|
||||||
|
Scope: local
|
||||||
|
Value: 0
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
sleepValue=0
|
||||||
|
|
||||||
File diff suppressed because it is too large
Load Diff
839
HMI/n2t-out/cardGrid.txt
Normal file
839
HMI/n2t-out/cardGrid.txt
Normal file
@@ -0,0 +1,839 @@
|
|||||||
|
Page cardGrid
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Locked : no
|
||||||
|
Swide up page ID : disabled
|
||||||
|
Swide down page ID : disabled
|
||||||
|
Swide left page ID : disabled
|
||||||
|
Swide right page ID : disabled
|
||||||
|
|
||||||
|
Events
|
||||||
|
Preinitialize Event
|
||||||
|
//wup=cardEntities
|
||||||
|
//remove background & activate reparse mode
|
||||||
|
vis p0,0
|
||||||
|
recmod=1
|
||||||
|
bauds=115200
|
||||||
|
//debug stuff
|
||||||
|
vis tTmp,0
|
||||||
|
vis tSend,0
|
||||||
|
vis tInstruction,0
|
||||||
|
vis tId,0
|
||||||
|
vis bEntity1,0
|
||||||
|
vis bEntity2,0
|
||||||
|
vis bEntity3,0
|
||||||
|
vis bEntity4,0
|
||||||
|
vis bEntity5,0
|
||||||
|
vis bEntity6,0
|
||||||
|
vis tEntity1,0
|
||||||
|
vis tEntity2,0
|
||||||
|
vis tEntity3,0
|
||||||
|
vis tEntity4,0
|
||||||
|
vis tEntity5,0
|
||||||
|
vis tEntity6,0
|
||||||
|
|
||||||
|
Variable (string) strCommand
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 500
|
||||||
|
|
||||||
|
Variable (string) type1
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 10
|
||||||
|
|
||||||
|
Variable (string) type2
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 10
|
||||||
|
|
||||||
|
Variable (string) type3
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 10
|
||||||
|
|
||||||
|
Variable (string) type4
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 10
|
||||||
|
|
||||||
|
Variable (string) entn1
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 70
|
||||||
|
|
||||||
|
Variable (string) entn2
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 70
|
||||||
|
|
||||||
|
Variable (string) entn3
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 70
|
||||||
|
|
||||||
|
Variable (string) entn4
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 70
|
||||||
|
|
||||||
|
Variable (string) type5
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 10
|
||||||
|
|
||||||
|
Variable (string) type6
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 10
|
||||||
|
|
||||||
|
Variable (string) entn5
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 50
|
||||||
|
|
||||||
|
Variable (string) entn6
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 50
|
||||||
|
|
||||||
|
Text tHeading
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 40
|
||||||
|
|
||||||
|
Text tEntity1
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : tEntity1
|
||||||
|
Max. Text Size : 30
|
||||||
|
|
||||||
|
Text tSend
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : newtxt
|
||||||
|
Max. Text Size : 100
|
||||||
|
|
||||||
|
Text tTmp
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Text tInstruction
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 20
|
||||||
|
|
||||||
|
Text tId
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 50
|
||||||
|
|
||||||
|
Text tEntity2
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : tEntity2
|
||||||
|
Max. Text Size : 30
|
||||||
|
|
||||||
|
Text tEntity3
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : tEntity3
|
||||||
|
Max. Text Size : 30
|
||||||
|
|
||||||
|
Text tEntity4
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : tEntity4
|
||||||
|
Max. Text Size : 30
|
||||||
|
|
||||||
|
Text tEntity5
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : tEntity5
|
||||||
|
Max. Text Size : 30
|
||||||
|
|
||||||
|
Text tEntity6
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : tEntity6
|
||||||
|
Max. Text Size : 30
|
||||||
|
|
||||||
|
Picture p0
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
|
||||||
|
Button bPrev
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : î°
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
tSend.txt="event,buttonPress2,cardGrid,bPrev"
|
||||||
|
//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
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : î³
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
tSend.txt="event,buttonPress2,cardGrid,bNext"
|
||||||
|
//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 bEntity1
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : î´
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
tmLP.en=1
|
||||||
|
tTmp.txt=type1.txt
|
||||||
|
pageIcons.tTmp1.txt=tEntity1.txt
|
||||||
|
pageIcons.tTmp2.txt=entn1.txt
|
||||||
|
if(type1.txt=="shutter")
|
||||||
|
{
|
||||||
|
page popupShutter
|
||||||
|
}
|
||||||
|
|
||||||
|
Touch Release Event
|
||||||
|
tmLP.en=0
|
||||||
|
tSend.txt="event,buttonPress2,"+entn1.txt+",button"
|
||||||
|
//send calc crc
|
||||||
|
btlen tSend.txt,sys0
|
||||||
|
crcrest 1,0xffff // reset CRC
|
||||||
|
crcputh 55 bb
|
||||||
|
crcputs sys0,1
|
||||||
|
crcputs tSend.txt,0
|
||||||
|
//send cmd
|
||||||
|
printh 55 bb
|
||||||
|
prints sys0,2
|
||||||
|
prints tSend.txt,0
|
||||||
|
prints crcval,2
|
||||||
|
|
||||||
|
Button bEntity2
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : î´
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
tmLP.en=1
|
||||||
|
tTmp.txt=type2.txt
|
||||||
|
pageIcons.tTmp1.txt=tEntity2.txt
|
||||||
|
pageIcons.tTmp2.txt=entn2.txt
|
||||||
|
if(type2.txt=="shutter")
|
||||||
|
{
|
||||||
|
page popupShutter
|
||||||
|
}
|
||||||
|
|
||||||
|
Touch Release Event
|
||||||
|
tmLP.en=0
|
||||||
|
tSend.txt="event,buttonPress2,"+entn2.txt+",button"
|
||||||
|
//send calc crc
|
||||||
|
btlen tSend.txt,sys0
|
||||||
|
crcrest 1,0xffff // reset CRC
|
||||||
|
crcputh 55 bb
|
||||||
|
crcputs sys0,1
|
||||||
|
crcputs tSend.txt,0
|
||||||
|
//send cmd
|
||||||
|
printh 55 bb
|
||||||
|
prints sys0,2
|
||||||
|
prints tSend.txt,0
|
||||||
|
prints crcval,2
|
||||||
|
|
||||||
|
Button bEntity3
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : î´
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
tmLP.en=1
|
||||||
|
tTmp.txt=type3.txt
|
||||||
|
pageIcons.tTmp1.txt=tEntity3.txt
|
||||||
|
pageIcons.tTmp2.txt=entn3.txt
|
||||||
|
if(type3.txt=="shutter")
|
||||||
|
{
|
||||||
|
page popupShutter
|
||||||
|
}
|
||||||
|
|
||||||
|
Touch Release Event
|
||||||
|
tmLP.en=0
|
||||||
|
tSend.txt="event,buttonPress2,"+entn3.txt+",button"
|
||||||
|
//send calc crc
|
||||||
|
btlen tSend.txt,sys0
|
||||||
|
crcrest 1,0xffff // reset CRC
|
||||||
|
crcputh 55 bb
|
||||||
|
crcputs sys0,1
|
||||||
|
crcputs tSend.txt,0
|
||||||
|
//send cmd
|
||||||
|
printh 55 bb
|
||||||
|
prints sys0,2
|
||||||
|
prints tSend.txt,0
|
||||||
|
prints crcval,2
|
||||||
|
|
||||||
|
Button bEntity4
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : î´
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
tmLP.en=1
|
||||||
|
tTmp.txt=type4.txt
|
||||||
|
pageIcons.tTmp1.txt=tEntity4.txt
|
||||||
|
pageIcons.tTmp2.txt=entn4.txt
|
||||||
|
if(type4.txt=="shutter")
|
||||||
|
{
|
||||||
|
page popupShutter
|
||||||
|
}
|
||||||
|
|
||||||
|
Touch Release Event
|
||||||
|
tmLP.en=0
|
||||||
|
tSend.txt="event,buttonPress2,"+entn4.txt+",button"
|
||||||
|
//send calc crc
|
||||||
|
btlen tSend.txt,sys0
|
||||||
|
crcrest 1,0xffff // reset CRC
|
||||||
|
crcputh 55 bb
|
||||||
|
crcputs sys0,1
|
||||||
|
crcputs tSend.txt,0
|
||||||
|
//send cmd
|
||||||
|
printh 55 bb
|
||||||
|
prints sys0,2
|
||||||
|
prints tSend.txt,0
|
||||||
|
prints crcval,2
|
||||||
|
|
||||||
|
Button bEntity5
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : î´
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
tmLP.en=1
|
||||||
|
tTmp.txt=type5.txt
|
||||||
|
pageIcons.tTmp1.txt=tEntity5.txt
|
||||||
|
pageIcons.tTmp2.txt=entn5.txt
|
||||||
|
if(type5.txt=="shutter")
|
||||||
|
{
|
||||||
|
page popupShutter
|
||||||
|
}
|
||||||
|
|
||||||
|
Touch Release Event
|
||||||
|
tmLP.en=0
|
||||||
|
tSend.txt="event,buttonPress2,"+entn5.txt+",button"
|
||||||
|
//send calc crc
|
||||||
|
btlen tSend.txt,sys0
|
||||||
|
crcrest 1,0xffff // reset CRC
|
||||||
|
crcputh 55 bb
|
||||||
|
crcputs sys0,1
|
||||||
|
crcputs tSend.txt,0
|
||||||
|
//send cmd
|
||||||
|
printh 55 bb
|
||||||
|
prints sys0,2
|
||||||
|
prints tSend.txt,0
|
||||||
|
prints crcval,2
|
||||||
|
|
||||||
|
Button bEntity6
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : î´
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
tmLP.en=1
|
||||||
|
tTmp.txt=type6.txt
|
||||||
|
pageIcons.tTmp1.txt=tEntity6.txt
|
||||||
|
pageIcons.tTmp2.txt=entn6.txt
|
||||||
|
if(type6.txt=="shutter")
|
||||||
|
{
|
||||||
|
page popupShutter
|
||||||
|
}
|
||||||
|
|
||||||
|
Touch Release Event
|
||||||
|
tmLP.en=0
|
||||||
|
tSend.txt="event,buttonPress2,"+entn6.txt+",button"
|
||||||
|
//send calc crc
|
||||||
|
btlen tSend.txt,sys0
|
||||||
|
crcrest 1,0xffff // reset CRC
|
||||||
|
crcputh 55 bb
|
||||||
|
crcputs sys0,1
|
||||||
|
crcputs tSend.txt,0
|
||||||
|
//send cmd
|
||||||
|
printh 55 bb
|
||||||
|
prints sys0,2
|
||||||
|
prints tSend.txt,0
|
||||||
|
prints crcval,2
|
||||||
|
|
||||||
|
Hotspot mSpecial
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
sys2=sys2+1
|
||||||
|
sys2%=10
|
||||||
|
//n0.val=sys2
|
||||||
|
if(sys2==9)
|
||||||
|
{
|
||||||
|
page pageTest
|
||||||
|
}
|
||||||
|
|
||||||
|
Timer tmSerial
|
||||||
|
Attributes
|
||||||
|
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")
|
||||||
|
{
|
||||||
|
// command format: entityUpd,heading,navigation,[,type,internalName,iconId,iconColor,displayName,optionalValue]x6
|
||||||
|
spstr strCommand.txt,tHeading.txt,",",1
|
||||||
|
// get Type
|
||||||
|
spstr strCommand.txt,type1.txt,",",3
|
||||||
|
// get internal name
|
||||||
|
spstr strCommand.txt,entn1.txt,",",4
|
||||||
|
if(type1.txt=="delete"||type1.txt=="")
|
||||||
|
{
|
||||||
|
vis tEntity1,0
|
||||||
|
vis bEntity1,0
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
// change icon
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",5
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
substr pageIcons.tIcons.txt,bEntity1.txt,sys0,1
|
||||||
|
vis bEntity1,1
|
||||||
|
// change icon color
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",6
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
bEntity1.pco=sys0
|
||||||
|
// set name
|
||||||
|
spstr strCommand.txt,tEntity1.txt,",",7
|
||||||
|
vis tEntity1,1
|
||||||
|
}
|
||||||
|
// get Type
|
||||||
|
spstr strCommand.txt,type2.txt,",",9
|
||||||
|
// get internal name
|
||||||
|
spstr strCommand.txt,entn2.txt,",",10
|
||||||
|
if(type2.txt=="delete"||type2.txt=="")
|
||||||
|
{
|
||||||
|
vis tEntity2,0
|
||||||
|
vis bEntity2,0
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
// change icon
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",11
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
substr pageIcons.tIcons.txt,bEntity2.txt,sys0,1
|
||||||
|
vis bEntity2,1
|
||||||
|
// change icon color
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",12
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
bEntity2.pco=sys0
|
||||||
|
// set name
|
||||||
|
spstr strCommand.txt,tEntity2.txt,",",13
|
||||||
|
vis tEntity2,1
|
||||||
|
}
|
||||||
|
// get Type
|
||||||
|
spstr strCommand.txt,type3.txt,",",15
|
||||||
|
// get internal name
|
||||||
|
spstr strCommand.txt,entn3.txt,",",16
|
||||||
|
if(type3.txt=="delete"||type3.txt=="")
|
||||||
|
{
|
||||||
|
vis tEntity3,0
|
||||||
|
vis bEntity3,0
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
// change icon
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",17
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
substr pageIcons.tIcons.txt,bEntity3.txt,sys0,1
|
||||||
|
vis bEntity3,1
|
||||||
|
// change icon color
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",18
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
bEntity3.pco=sys0
|
||||||
|
// set name
|
||||||
|
spstr strCommand.txt,tEntity3.txt,",",19
|
||||||
|
vis tEntity3,1
|
||||||
|
}
|
||||||
|
// get Type
|
||||||
|
spstr strCommand.txt,type4.txt,",",21
|
||||||
|
// get internal name
|
||||||
|
spstr strCommand.txt,entn4.txt,",",22
|
||||||
|
if(type4.txt=="delete"||type4.txt=="")
|
||||||
|
{
|
||||||
|
vis tEntity4,0
|
||||||
|
vis bEntity4,0
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
// change icon
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",23
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
substr pageIcons.tIcons.txt,bEntity4.txt,sys0,1
|
||||||
|
vis bEntity4,1
|
||||||
|
// change icon color
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",24
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
bEntity4.pco=sys0
|
||||||
|
// set name
|
||||||
|
spstr strCommand.txt,tEntity4.txt,",",25
|
||||||
|
vis tEntity4,1
|
||||||
|
}
|
||||||
|
// get Type
|
||||||
|
spstr strCommand.txt,type5.txt,",",27
|
||||||
|
// get internal name
|
||||||
|
spstr strCommand.txt,entn5.txt,",",28
|
||||||
|
if(type5.txt=="delete"||type5.txt=="")
|
||||||
|
{
|
||||||
|
vis tEntity5,0
|
||||||
|
vis bEntity5,0
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
// change icon
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",29
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
substr pageIcons.tIcons.txt,bEntity5.txt,sys0,1
|
||||||
|
vis bEntity5,1
|
||||||
|
// change icon color
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",30
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
bEntity5.pco=sys0
|
||||||
|
// set name
|
||||||
|
spstr strCommand.txt,tEntity5.txt,",",31
|
||||||
|
vis tEntity5,1
|
||||||
|
}
|
||||||
|
// get Type
|
||||||
|
spstr strCommand.txt,type6.txt,",",33
|
||||||
|
// get internal name
|
||||||
|
spstr strCommand.txt,entn6.txt,",",34
|
||||||
|
if(type6.txt=="delete"||type6.txt=="")
|
||||||
|
{
|
||||||
|
vis tEntity6,0
|
||||||
|
vis bEntity6,0
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
// change icon
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",35
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
substr pageIcons.tIcons.txt,bEntity6.txt,sys0,1
|
||||||
|
vis bEntity6,1
|
||||||
|
// change icon color
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",36
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
bEntity6.pco=sys0
|
||||||
|
// set name
|
||||||
|
spstr strCommand.txt,tEntity6.txt,",",37
|
||||||
|
vis tEntity6,1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(tInstruction.txt=="pageType")
|
||||||
|
{
|
||||||
|
//command format pageType,specialPageName
|
||||||
|
//write name of speical page to tId
|
||||||
|
spstr strCommand.txt,tId.txt,",",1
|
||||||
|
//save second arg if there's one
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",2
|
||||||
|
//save third arg if there's one
|
||||||
|
spstr strCommand.txt,pageIcons.tTmp2.txt,",",3
|
||||||
|
//we are going to exit this page with this command, so we have to clear the buffer, so we are not getting into a stupid loop ...
|
||||||
|
udelete payloadLength-1
|
||||||
|
bufferPos=0
|
||||||
|
if(tId.txt=="pageStartup")
|
||||||
|
{
|
||||||
|
page pageStartup
|
||||||
|
}
|
||||||
|
if(tId.txt=="screensaver")
|
||||||
|
{
|
||||||
|
page screensaver
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardEntities")
|
||||||
|
{
|
||||||
|
page cardEntities
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardGrid")
|
||||||
|
{
|
||||||
|
page cardGrid
|
||||||
|
}
|
||||||
|
if(tId.txt=="popupLight")
|
||||||
|
{
|
||||||
|
pageIcons.tTmp1.txt=tTmp.txt
|
||||||
|
page popupLight
|
||||||
|
}
|
||||||
|
if(tId.txt=="popupShutter")
|
||||||
|
{
|
||||||
|
pageIcons.tTmp1.txt=tTmp.txt
|
||||||
|
page popupShutter
|
||||||
|
}
|
||||||
|
if(tId.txt=="popupNotify")
|
||||||
|
{
|
||||||
|
page popupNotify
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardThermo")
|
||||||
|
{
|
||||||
|
page cardThermo
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardMedia")
|
||||||
|
{
|
||||||
|
page cardMedia
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardAlarm")
|
||||||
|
{
|
||||||
|
page cardAlarm
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(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
|
||||||
|
}
|
||||||
|
// end of user code
|
||||||
|
udelete payloadLength-1
|
||||||
|
bufferPos=0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// next character
|
||||||
|
bufferPos++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Timer tmSleep
|
||||||
|
Attributes
|
||||||
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Timer tmLP
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Period (ms): 500
|
||||||
|
Enabled : no
|
||||||
|
|
||||||
|
Events
|
||||||
|
Timer Event
|
||||||
|
if(tTmp.txt=="light")
|
||||||
|
{
|
||||||
|
page popupLight
|
||||||
|
}
|
||||||
|
|
||||||
|
TouchCap tc0
|
||||||
|
Attributes
|
||||||
|
Scope: local
|
||||||
|
Value: 0
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
sleepValue=0
|
||||||
|
|
||||||
@@ -1,346 +1,135 @@
|
|||||||
Page cardMedia
|
Page cardMedia
|
||||||
Attributes
|
Attributes
|
||||||
ID : 0
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
Send Component ID : disabled
|
||||||
Opacity : 127
|
|
||||||
Width : 480
|
|
||||||
Effect : load
|
|
||||||
Effect Priority : 0
|
|
||||||
Effect Time : 300
|
|
||||||
Locked : no
|
Locked : no
|
||||||
Swide up page ID : disabled
|
Swide up page ID : disabled
|
||||||
Swide down page ID : disabled
|
Swide down page ID : disabled
|
||||||
Swide left page ID : disabled
|
Swide left page ID : disabled
|
||||||
Swide right page ID : disabled
|
Swide right page ID : disabled
|
||||||
Fill : solid color
|
|
||||||
Back. Color : 6371
|
|
||||||
|
|
||||||
Events
|
Events
|
||||||
Preinitialize Event
|
Preinitialize Event
|
||||||
vis p0,0
|
vis p0,0
|
||||||
vis tSend,0
|
vis tSend,0
|
||||||
vis tInstruction,0
|
vis tInstruction,0
|
||||||
vis nPageDisp,0
|
|
||||||
vis tTmp,0
|
vis tTmp,0
|
||||||
vis tId,0
|
vis tId,0
|
||||||
|
vis t5,0
|
||||||
//vis nPageDisp,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
|
Variable (string) strCommand
|
||||||
Attributes
|
Attributes
|
||||||
ID : 8
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Text :
|
Text :
|
||||||
Max. Text Size: 200
|
Max. Text Size: 500
|
||||||
|
|
||||||
Variable (string) entn
|
Variable (string) entn
|
||||||
Attributes
|
Attributes
|
||||||
ID : 19
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Text :
|
Text :
|
||||||
Max. Text Size: 50
|
Max. Text Size: 50
|
||||||
|
|
||||||
Number nPageDisp
|
Variable (string) vaSpeakerList
|
||||||
Attributes
|
Attributes
|
||||||
ID : 6
|
Scope : local
|
||||||
Scope : local
|
Text :
|
||||||
Dragging : 0
|
Max. Text Size: 200
|
||||||
Disable release event after dragging: 0
|
|
||||||
Send Component ID : disabled
|
Variable (int32) vaSpeakerPos
|
||||||
Opacity : 127
|
Attributes
|
||||||
x coordinate : 426
|
Scope: local
|
||||||
y coordinate : 0
|
Value: 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
|
Text tSend
|
||||||
Attributes
|
Attributes
|
||||||
ID : 2
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Associated Keyboard : none
|
||||||
Font ID : 0
|
Text :
|
||||||
Back. Color : 65535
|
Max. Text Size : 200
|
||||||
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
|
Text tTmp
|
||||||
Attributes
|
Attributes
|
||||||
ID : 3
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Associated Keyboard : none
|
||||||
Font ID : 0
|
|
||||||
Back. Color : 65535
|
|
||||||
Font Color : 0
|
|
||||||
Horizontal Alignment : center
|
|
||||||
Vertical Alignment : center
|
|
||||||
Input Type : character
|
|
||||||
Text :
|
Text :
|
||||||
Max. Text Size : 10
|
Max. Text Size : 10
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Text tInstruction
|
Text tInstruction
|
||||||
Attributes
|
Attributes
|
||||||
ID : 9
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Associated Keyboard : none
|
||||||
Font ID : 0
|
|
||||||
Back. Color : 65535
|
|
||||||
Font Color : 0
|
|
||||||
Horizontal Alignment : center
|
|
||||||
Vertical Alignment : center
|
|
||||||
Input Type : character
|
|
||||||
Text :
|
Text :
|
||||||
Max. Text Size : 20
|
Max. Text Size : 20
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Text tId
|
Text tId
|
||||||
Attributes
|
Attributes
|
||||||
ID : 10
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Associated Keyboard : none
|
||||||
Font ID : 0
|
|
||||||
Back. Color : 65535
|
|
||||||
Font Color : 0
|
|
||||||
Horizontal Alignment : center
|
|
||||||
Vertical Alignment : center
|
|
||||||
Input Type : character
|
|
||||||
Text :
|
Text :
|
||||||
Max. Text Size : 20
|
Max. Text Size : 20
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Text tHeading
|
Text tHeading
|
||||||
Attributes
|
Attributes
|
||||||
ID : 11
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Associated Keyboard : none
|
||||||
Font ID : 1
|
|
||||||
Back. Color : 6371
|
|
||||||
Font Color : 65535
|
|
||||||
Horizontal Alignment : center
|
|
||||||
Vertical Alignment : center
|
|
||||||
Input Type : character
|
|
||||||
Text :
|
Text :
|
||||||
Max. Text Size : 40
|
Max. Text Size : 40
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Text tTitle
|
Text tTitle
|
||||||
Attributes
|
Attributes
|
||||||
ID : 12
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Associated Keyboard : none
|
||||||
Font ID : 0
|
|
||||||
Back. Color : 6371
|
|
||||||
Font Color : 65535
|
|
||||||
Horizontal Alignment : right
|
|
||||||
Vertical Alignment : center
|
|
||||||
Input Type : character
|
|
||||||
Text :
|
Text :
|
||||||
Max. Text Size : 50
|
Max. Text Size : 50
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Text tAuthor
|
Text tAuthor
|
||||||
Attributes
|
Attributes
|
||||||
ID : 13
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Associated Keyboard : none
|
||||||
Font ID : 0
|
|
||||||
Back. Color : 6371
|
|
||||||
Font Color : 65535
|
|
||||||
Horizontal Alignment : right
|
|
||||||
Vertical Alignment : center
|
|
||||||
Input Type : character
|
|
||||||
Text :
|
Text :
|
||||||
Max. Text Size : 50
|
Max. Text Size : 50
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Text t2
|
Text t2
|
||||||
Attributes
|
Attributes
|
||||||
ID : 14
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Associated Keyboard : none
|
||||||
Font ID : 2
|
|
||||||
Back. Color : 6371
|
|
||||||
Font Color : 50712
|
|
||||||
Horizontal Alignment : center
|
|
||||||
Vertical Alignment : center
|
|
||||||
Input Type : character
|
|
||||||
Text : î¬
|
Text : î¬
|
||||||
Max. Text Size : 10
|
Max. Text Size : 10
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
// event,1,tHeading,tEntityName,1,up
|
// event,buttonPress2,entn,media-next
|
||||||
//craft command
|
//craft command
|
||||||
// convert pageNumber and write to tTmp
|
tSend.txt="event,buttonPress2,"
|
||||||
covx nPage,tTmp.txt,0,0
|
|
||||||
tSend.txt="event,buttonPress,"+tTmp.txt+","
|
|
||||||
tSend.txt+=tHeading.txt+","
|
|
||||||
tSend.txt+=entn.txt+","
|
tSend.txt+=entn.txt+","
|
||||||
tSend.txt+="1,media-next"
|
tSend.txt+="media-next"
|
||||||
//send calc crc
|
//send calc crc
|
||||||
btlen tSend.txt,sys0
|
btlen tSend.txt,sys0
|
||||||
crcrest 1,0xffff // reset CRC
|
crcrest 1,0xffff // reset CRC
|
||||||
@@ -355,44 +144,21 @@ Text t2
|
|||||||
|
|
||||||
Text tPlayPause
|
Text tPlayPause
|
||||||
Attributes
|
Attributes
|
||||||
ID : 15
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Associated Keyboard : none
|
||||||
Font ID : 2
|
|
||||||
Back. Color : 6371
|
|
||||||
Font Color : 50712
|
|
||||||
Horizontal Alignment : center
|
|
||||||
Vertical Alignment : center
|
|
||||||
Input Type : character
|
|
||||||
Text : î£
|
Text : î£
|
||||||
Max. Text Size : 10
|
Max. Text Size : 10
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
// event,1,tHeading,tEntityName,1,up
|
// event,buttonPress2,entn,media-pause
|
||||||
//craft command
|
//craft command
|
||||||
// convert pageNumber and write to tTmp
|
tSend.txt="event,buttonPress2,"
|
||||||
covx nPage,tTmp.txt,0,0
|
|
||||||
tSend.txt="event,buttonPress,"+tTmp.txt+","
|
|
||||||
tSend.txt+=tHeading.txt+","
|
|
||||||
tSend.txt+=entn.txt+","
|
tSend.txt+=entn.txt+","
|
||||||
tSend.txt+="1,media-pause"
|
tSend.txt+="media-pause"
|
||||||
//send calc crc
|
//send calc crc
|
||||||
btlen tSend.txt,sys0
|
btlen tSend.txt,sys0
|
||||||
crcrest 1,0xffff // reset CRC
|
crcrest 1,0xffff // reset CRC
|
||||||
@@ -407,44 +173,21 @@ Text tPlayPause
|
|||||||
|
|
||||||
Text t0
|
Text t0
|
||||||
Attributes
|
Attributes
|
||||||
ID : 16
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Associated Keyboard : none
|
||||||
Font ID : 2
|
|
||||||
Back. Color : 6371
|
|
||||||
Font Color : 50712
|
|
||||||
Horizontal Alignment : center
|
|
||||||
Vertical Alignment : center
|
|
||||||
Input Type : character
|
|
||||||
Text : î
|
Text : î
|
||||||
Max. Text Size : 10
|
Max. Text Size : 10
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
// event,1,tHeading,tEntityName,1,up
|
// event,buttonPress2,entn,media-back
|
||||||
//craft command
|
//craft command
|
||||||
// convert pageNumber and write to tTmp
|
tSend.txt="event,buttonPress2,"
|
||||||
covx nPage,tTmp.txt,0,0
|
|
||||||
tSend.txt="event,buttonPress,"+tTmp.txt+","
|
|
||||||
tSend.txt+=tHeading.txt+","
|
|
||||||
tSend.txt+=entn.txt+","
|
tSend.txt+=entn.txt+","
|
||||||
tSend.txt+="1,media-back"
|
tSend.txt+="media-back"
|
||||||
//send calc crc
|
//send calc crc
|
||||||
btlen tSend.txt,sys0
|
btlen tSend.txt,sys0
|
||||||
crcrest 1,0xffff // reset CRC
|
crcrest 1,0xffff // reset CRC
|
||||||
@@ -459,86 +202,188 @@ Text t0
|
|||||||
|
|
||||||
Text tIcon
|
Text tIcon
|
||||||
Attributes
|
Attributes
|
||||||
ID : 18
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Associated Keyboard : none
|
||||||
Font ID : 2
|
|
||||||
Back. Color : 6371
|
|
||||||
Font Color : 65535
|
|
||||||
Horizontal Alignment : center
|
|
||||||
Vertical Alignment : center
|
|
||||||
Input Type : character
|
|
||||||
Text :
|
Text :
|
||||||
Max. Text Size : 10
|
Max. Text Size : 10
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Picture p0
|
Text t1
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : î
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
hVolume.val=hVolume.val-5
|
||||||
|
// event,buttonPress2,internalNameEntity,volumeSlider,50
|
||||||
|
//craft command
|
||||||
|
tSend.txt="event,buttonPress2,"+entn.txt+",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
|
||||||
|
|
||||||
|
Text t3
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : î
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
hVolume.val=hVolume.val+5
|
||||||
|
// event,buttonPress2,internalNameEntity,volumeSlider,50
|
||||||
|
//craft command
|
||||||
|
tSend.txt="event,buttonPress2,"+entn.txt+",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
|
||||||
|
|
||||||
|
Text t4
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : î
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Text tSpeaker
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 50
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
// event,buttonPress2,entn,media-next
|
||||||
|
//craft command
|
||||||
|
tSend.txt="event,buttonPress2,"
|
||||||
|
tSend.txt+=entn.txt+","
|
||||||
|
tSend.txt+="speaker-sel,"+tSpeaker.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
|
||||||
|
|
||||||
|
Text t6
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : î´
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
//speaker
|
||||||
|
tSpeaker.pco=65535
|
||||||
|
spstr vaSpeakerList.txt,tSpeaker.txt,"?",vaSpeakerPos.val
|
||||||
|
vaSpeakerPos.val+=1
|
||||||
|
if(tSpeaker.txt=="")
|
||||||
|
{
|
||||||
|
vaSpeakerPos.val=0
|
||||||
|
spstr vaSpeakerList.txt,tSpeaker.txt,"?",vaSpeakerPos.val
|
||||||
|
}
|
||||||
|
|
||||||
|
Text t5
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : î¤
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
// event,buttonPress2,entn,media-next
|
||||||
|
//craft command
|
||||||
|
tSend.txt="event,buttonPress2,"
|
||||||
|
tSend.txt+=entn.txt+","
|
||||||
|
tSend.txt+="media-OnOff"
|
||||||
|
//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
|
||||||
|
|
||||||
|
Picture p0
|
||||||
Attributes
|
Attributes
|
||||||
ID : 1
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Slider hVolume
|
||||||
Attributes
|
Attributes
|
||||||
ID : 17
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Position : 50
|
||||||
Upper range limit : 100
|
Upper range limit : 100
|
||||||
Lower range limit : 0
|
Lower range limit : 0
|
||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Release Event
|
Touch Release Event
|
||||||
// event,buttonPress,D,nameEntity,internalNameEntity,1,positionSlider,50
|
tmCooldown.en=1
|
||||||
|
tmCooldown.tim=800
|
||||||
|
// event,buttonPress2,internalNameEntity,volumeSlider,50
|
||||||
//craft command
|
//craft command
|
||||||
// convert pageNumber and write to tTmp
|
tSend.txt="event,buttonPress2,"+entn.txt+",volumeSlider,"
|
||||||
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
|
covx hVolume.val,tTmp.txt,0,0
|
||||||
tSend.txt+=tTmp.txt
|
tSend.txt+=tTmp.txt
|
||||||
//send calc crc
|
//send calc crc
|
||||||
@@ -555,46 +400,17 @@ Slider hVolume
|
|||||||
|
|
||||||
Button bNext
|
Button bNext
|
||||||
Attributes
|
Attributes
|
||||||
ID : 4
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
State : unpressed
|
||||||
Text : î³
|
Text : î³
|
||||||
Max. Text Size : 10
|
Max. Text Size : 10
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
nPage=nPage+1
|
tSend.txt="event,buttonPress2,cardMedia,bNext"
|
||||||
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
|
//send calc crc
|
||||||
btlen tSend.txt,sys0
|
btlen tSend.txt,sys0
|
||||||
crcrest 1,0xffff // reset CRC
|
crcrest 1,0xffff // reset CRC
|
||||||
@@ -609,46 +425,17 @@ Button bNext
|
|||||||
|
|
||||||
Button bPrev
|
Button bPrev
|
||||||
Attributes
|
Attributes
|
||||||
ID : 5
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
State : unpressed
|
||||||
Text : î°
|
Text : î°
|
||||||
Max. Text Size : 10
|
Max. Text Size : 10
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
nPage=nPage-1
|
tSend.txt="event,buttonPress2,cardMedia,bPrev"
|
||||||
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
|
//send calc crc
|
||||||
btlen tSend.txt,sys0
|
btlen tSend.txt,sys0
|
||||||
crcrest 1,0xffff // reset CRC
|
crcrest 1,0xffff // reset CRC
|
||||||
@@ -663,7 +450,6 @@ Button bPrev
|
|||||||
|
|
||||||
Timer tmSerial
|
Timer tmSerial
|
||||||
Attributes
|
Attributes
|
||||||
ID : 7
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Period (ms): 50
|
Period (ms): 50
|
||||||
Enabled : yes
|
Enabled : yes
|
||||||
@@ -735,6 +521,32 @@ Timer tmSerial
|
|||||||
spstr strCommand.txt,tTmp.txt,"|",7
|
spstr strCommand.txt,tTmp.txt,"|",7
|
||||||
covx tTmp.txt,sys0,0,0
|
covx tTmp.txt,sys0,0,0
|
||||||
substr pageIcons.tIcons.txt,tPlayPause.txt,sys0,1
|
substr pageIcons.tIcons.txt,tPlayPause.txt,sys0,1
|
||||||
|
//speaker current
|
||||||
|
spstr strCommand.txt,tSpeaker.txt,"|",8
|
||||||
|
if(tSpeaker.txt!="")
|
||||||
|
{
|
||||||
|
tSpeaker.pco=1374
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
tSpeaker.pco=65535
|
||||||
|
}
|
||||||
|
//speaker list
|
||||||
|
spstr strCommand.txt,vaSpeakerList.txt,"|",9
|
||||||
|
if(vaSpeakerList.txt=="")
|
||||||
|
{
|
||||||
|
vis t6,0
|
||||||
|
}
|
||||||
|
vaSpeakerPos.val=0
|
||||||
|
// on off button
|
||||||
|
spstr strCommand.txt,tTmp.txt,"|",10
|
||||||
|
if(tTmp.txt=="disable")
|
||||||
|
{
|
||||||
|
vis t5,0
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
vis t5,1
|
||||||
|
covx tTmp.txt,t5.pco,0,0
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(tInstruction.txt=="time")
|
if(tInstruction.txt=="time")
|
||||||
{
|
{
|
||||||
@@ -764,14 +576,17 @@ Timer tmSerial
|
|||||||
//command format pageType,specialPageName
|
//command format pageType,specialPageName
|
||||||
//write name of speical page to tId
|
//write name of speical page to tId
|
||||||
spstr strCommand.txt,tId.txt,",",1
|
spstr strCommand.txt,tId.txt,",",1
|
||||||
if(tId.txt=="cardMedia")
|
//save second arg if there's one
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",2
|
||||||
|
//save third arg if there's one
|
||||||
|
spstr strCommand.txt,pageIcons.tTmp2.txt,",",3
|
||||||
|
//we are going to exit this page with this command, so we have to clear the buffer, so we are not getting into a stupid loop ...
|
||||||
|
udelete payloadLength-1
|
||||||
|
bufferPos=0
|
||||||
|
if(tId.txt=="popupLight")
|
||||||
{
|
{
|
||||||
//yay, we are already on the correct page
|
pageIcons.tTmp1.txt=tTmp.txt
|
||||||
}else
|
page popupLight
|
||||||
{
|
|
||||||
//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")
|
if(tId.txt=="cardEntities")
|
||||||
{
|
{
|
||||||
@@ -785,10 +600,18 @@ Timer tmSerial
|
|||||||
{
|
{
|
||||||
page pageStartup
|
page pageStartup
|
||||||
}
|
}
|
||||||
if(tId.txt=="pageNotify")
|
if(tId.txt=="popupNotify")
|
||||||
{
|
{
|
||||||
page popupNotify
|
page popupNotify
|
||||||
}
|
}
|
||||||
|
if(tId.txt=="cardGrid")
|
||||||
|
{
|
||||||
|
page cardGrid
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardAlarm")
|
||||||
|
{
|
||||||
|
page cardAlarm
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// end of user code
|
// end of user code
|
||||||
udelete payloadLength-1
|
udelete payloadLength-1
|
||||||
@@ -813,7 +636,6 @@ Timer tmSerial
|
|||||||
|
|
||||||
Timer tmSleep
|
Timer tmSleep
|
||||||
Attributes
|
Attributes
|
||||||
ID : 20
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Period (ms): 1000
|
Period (ms): 1000
|
||||||
Enabled : yes
|
Enabled : yes
|
||||||
@@ -831,9 +653,18 @@ Timer tmSleep
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Timer tmCooldown
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Period (ms): 100
|
||||||
|
Enabled : no
|
||||||
|
|
||||||
|
Events
|
||||||
|
Timer Event
|
||||||
|
tmCooldown.en=0
|
||||||
|
|
||||||
TouchCap tc0
|
TouchCap tc0
|
||||||
Attributes
|
Attributes
|
||||||
ID : 21
|
|
||||||
Scope: local
|
Scope: local
|
||||||
Value: 0
|
Value: 0
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,58 +0,0 @@
|
|||||||
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
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
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
|
|
||||||
|
|
||||||
@@ -1,157 +1,59 @@
|
|||||||
Page pageIcons
|
Page pageIcons
|
||||||
Attributes
|
Attributes
|
||||||
ID : 0
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
Send Component ID : disabled
|
||||||
Opacity : 127
|
|
||||||
Width : 480
|
|
||||||
Effect : load
|
|
||||||
Effect Priority : 0
|
|
||||||
Effect Time : 300
|
|
||||||
Locked : no
|
Locked : no
|
||||||
Swide up page ID : disabled
|
Swide up page ID : disabled
|
||||||
Swide down page ID : disabled
|
Swide down page ID : disabled
|
||||||
Swide left page ID : disabled
|
Swide left page ID : disabled
|
||||||
Swide right page ID : disabled
|
Swide right page ID : disabled
|
||||||
Fill : solid color
|
|
||||||
Back. Color : 65535
|
|
||||||
|
|
||||||
Text t0
|
Text t0
|
||||||
Attributes
|
Attributes
|
||||||
ID : 2
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
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)
|
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
|
Max. Text Size : 400
|
||||||
Word wrap : enabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Text tIcons
|
Text tIcons
|
||||||
Attributes
|
Attributes
|
||||||
ID : 3
|
|
||||||
Scope : global
|
Scope : global
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Associated Keyboard : none
|
||||||
Font ID : 1
|
Text : îî´îï§îîî î
î£îîî°îîîîî½îîîîîî¾îîîîî¤î·îºîîï¤ï¡îî î îî¦îî¦îºîî
|
||||||
Back. Color : 65535
|
Max. Text Size : 150
|
||||||
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
|
Text tTmp1
|
||||||
Attributes
|
Attributes
|
||||||
ID : 4
|
|
||||||
Scope : global
|
Scope : global
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Associated Keyboard : none
|
||||||
Font ID : 1
|
|
||||||
Back. Color : 65535
|
|
||||||
Font Color : 0
|
|
||||||
Horizontal Alignment : center
|
|
||||||
Vertical Alignment : center
|
|
||||||
Input Type : character
|
|
||||||
Text :
|
Text :
|
||||||
Max. Text Size : 50
|
Max. Text Size : 50
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Text tTmp2
|
Text tTmp2
|
||||||
Attributes
|
Attributes
|
||||||
ID : 5
|
|
||||||
Scope : global
|
Scope : global
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Associated Keyboard : none
|
||||||
Font ID : 1
|
|
||||||
Back. Color : 65535
|
|
||||||
Font Color : 0
|
|
||||||
Horizontal Alignment : center
|
|
||||||
Vertical Alignment : center
|
|
||||||
Input Type : character
|
|
||||||
Text :
|
Text :
|
||||||
Max. Text Size : 50
|
Max. Text Size : 50
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Picture p0
|
Picture p0
|
||||||
Attributes
|
Attributes
|
||||||
ID : 1
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,22 +1,14 @@
|
|||||||
Page pageSerialTest
|
Page pageSerialTest
|
||||||
Attributes
|
Attributes
|
||||||
ID : 0
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
Send Component ID : disabled
|
||||||
Opacity : 127
|
|
||||||
Width : 480
|
|
||||||
Effect : load
|
|
||||||
Effect Priority : 0
|
|
||||||
Effect Time : 300
|
|
||||||
Locked : no
|
Locked : no
|
||||||
Swide up page ID : disabled
|
Swide up page ID : disabled
|
||||||
Swide down page ID : disabled
|
Swide down page ID : disabled
|
||||||
Swide left page ID : disabled
|
Swide left page ID : disabled
|
||||||
Swide right page ID : disabled
|
Swide right page ID : disabled
|
||||||
Fill : solid color
|
|
||||||
Back. Color : 65535
|
|
||||||
|
|
||||||
Events
|
Events
|
||||||
Preinitialize Event
|
Preinitialize Event
|
||||||
@@ -26,292 +18,96 @@ Page pageSerialTest
|
|||||||
|
|
||||||
Number nCrcRecv
|
Number nCrcRecv
|
||||||
Attributes
|
Attributes
|
||||||
ID : 5
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Associated Keyboard : none
|
||||||
Font ID : 5
|
|
||||||
Back. Color : 65535
|
|
||||||
Font Color : 0
|
|
||||||
Horizontal Alignment : center
|
|
||||||
Vertical Alignment : center
|
|
||||||
Value : 0
|
Value : 0
|
||||||
Significant digits shown : all
|
|
||||||
Format : decimal with digit grouping
|
|
||||||
Word wrap : enabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Number nCrcCalc
|
Number nCrcCalc
|
||||||
Attributes
|
Attributes
|
||||||
ID : 6
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Associated Keyboard : none
|
||||||
Font ID : 5
|
|
||||||
Back. Color : 65535
|
|
||||||
Font Color : 0
|
|
||||||
Horizontal Alignment : center
|
|
||||||
Vertical Alignment : center
|
|
||||||
Value : 0
|
Value : 0
|
||||||
Significant digits shown : all
|
|
||||||
Format : decimal with digit grouping
|
|
||||||
Word wrap : enabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Number nIt
|
Number nIt
|
||||||
Attributes
|
Attributes
|
||||||
ID : 11
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Associated Keyboard : none
|
||||||
Font ID : 5
|
|
||||||
Back. Color : 65535
|
|
||||||
Font Color : 0
|
|
||||||
Horizontal Alignment : center
|
|
||||||
Vertical Alignment : center
|
|
||||||
Value : 0
|
Value : 0
|
||||||
Significant digits shown : all
|
|
||||||
Format : decimal
|
|
||||||
Word wrap : enabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Number nLength
|
Number nLength
|
||||||
Attributes
|
Attributes
|
||||||
ID : 12
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Associated Keyboard : none
|
||||||
Font ID : 0
|
|
||||||
Back. Color : 65535
|
|
||||||
Font Color : 0
|
|
||||||
Horizontal Alignment : center
|
|
||||||
Vertical Alignment : center
|
|
||||||
Value : 0
|
Value : 0
|
||||||
Significant digits shown : all
|
|
||||||
Format : decimal
|
|
||||||
Word wrap : enabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Text tStatus
|
Text tStatus
|
||||||
Attributes
|
Attributes
|
||||||
ID : 3
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Associated Keyboard : none
|
||||||
Font ID : 5
|
|
||||||
Back. Color : 65535
|
|
||||||
Font Color : 0
|
|
||||||
Horizontal Alignment : center
|
|
||||||
Vertical Alignment : center
|
|
||||||
Input Type : character
|
|
||||||
Text : newtxt
|
Text : newtxt
|
||||||
Max. Text Size : 100
|
Max. Text Size : 100
|
||||||
Word wrap : enabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Text tCmd
|
Text tCmd
|
||||||
Attributes
|
Attributes
|
||||||
ID : 4
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Associated Keyboard : none
|
||||||
Font ID : 5
|
|
||||||
Back. Color : 65535
|
|
||||||
Font Color : 0
|
|
||||||
Horizontal Alignment : center
|
|
||||||
Vertical Alignment : center
|
|
||||||
Input Type : character
|
|
||||||
Text : newtxt
|
Text : newtxt
|
||||||
Max. Text Size : 500
|
Max. Text Size : 500
|
||||||
Word wrap : enabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Text tBuffer
|
Text tBuffer
|
||||||
Attributes
|
Attributes
|
||||||
ID : 7
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Associated Keyboard : none
|
||||||
Font ID : 5
|
|
||||||
Back. Color : 65535
|
|
||||||
Font Color : 0
|
|
||||||
Horizontal Alignment : center
|
|
||||||
Vertical Alignment : center
|
|
||||||
Input Type : character
|
|
||||||
Text : newtxt
|
Text : newtxt
|
||||||
Max. Text Size : 100
|
Max. Text Size : 100
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Text tDesc
|
Text tDesc
|
||||||
Attributes
|
Attributes
|
||||||
ID : 8
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
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
|
Text : CRC Recv:\r\nCRC Calc:\r\n\r\nStatus\r\n\r\nCommand
|
||||||
Max. Text Size : 60
|
Max. Text Size : 60
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Picture p0
|
Picture p0
|
||||||
Attributes
|
Attributes
|
||||||
ID : 1
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Button b0
|
||||||
Attributes
|
Attributes
|
||||||
ID : 9
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
State : unpressed
|
||||||
Text : bck
|
Text : bck
|
||||||
Max. Text Size : 10
|
Max. Text Size : 10
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
@@ -320,35 +116,13 @@ Button b0
|
|||||||
|
|
||||||
Button b1
|
Button b1
|
||||||
Attributes
|
Attributes
|
||||||
ID : 10
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
State : unpressed
|
||||||
Text : ON
|
Text : ON
|
||||||
Max. Text Size : 10
|
Max. Text Size : 10
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
@@ -357,7 +131,6 @@ Button b1
|
|||||||
|
|
||||||
Timer tmSerial
|
Timer tmSerial
|
||||||
Attributes
|
Attributes
|
||||||
ID : 2
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Period (ms): 400
|
Period (ms): 400
|
||||||
Enabled : yes
|
Enabled : yes
|
||||||
|
|||||||
@@ -1,22 +1,14 @@
|
|||||||
Page pageStartup
|
Page pageStartup
|
||||||
Attributes
|
Attributes
|
||||||
ID : 0
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
Send Component ID : disabled
|
||||||
Opacity : 127
|
|
||||||
Width : 480
|
|
||||||
Effect : load
|
|
||||||
Effect Priority : 0
|
|
||||||
Effect Time : 300
|
|
||||||
Locked : no
|
Locked : no
|
||||||
Swide up page ID : disabled
|
Swide up page ID : disabled
|
||||||
Swide down page ID : disabled
|
Swide down page ID : disabled
|
||||||
Swide left page ID : disabled
|
Swide left page ID : disabled
|
||||||
Swide right page ID : disabled
|
Swide right page ID : disabled
|
||||||
Fill : solid color
|
|
||||||
Back. Color : 6371
|
|
||||||
|
|
||||||
Events
|
Events
|
||||||
Preinitialize Event
|
Preinitialize Event
|
||||||
@@ -43,422 +35,146 @@ Page pageStartup
|
|||||||
|
|
||||||
Variable (string) strCommand
|
Variable (string) strCommand
|
||||||
Attributes
|
Attributes
|
||||||
ID : 5
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Text :
|
Text :
|
||||||
Max. Text Size: 50
|
Max. Text Size: 50
|
||||||
|
|
||||||
Number frame_ptr
|
Number frame_ptr
|
||||||
Attributes
|
Attributes
|
||||||
ID : 10
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Associated Keyboard : none
|
||||||
Font ID : 0
|
|
||||||
Back. Color : 65535
|
|
||||||
Font Color : 0
|
|
||||||
Horizontal Alignment : center
|
|
||||||
Vertical Alignment : center
|
|
||||||
Value : 0
|
Value : 0
|
||||||
Significant digits shown : all
|
|
||||||
Format : decimal
|
|
||||||
Word wrap : enabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Number spinner_w
|
Number spinner_w
|
||||||
Attributes
|
Attributes
|
||||||
ID : 11
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Associated Keyboard : none
|
||||||
Font ID : 0
|
|
||||||
Back. Color : 65535
|
|
||||||
Font Color : 0
|
|
||||||
Horizontal Alignment : center
|
|
||||||
Vertical Alignment : center
|
|
||||||
Value : 140
|
Value : 140
|
||||||
Significant digits shown : all
|
|
||||||
Format : decimal
|
|
||||||
Word wrap : enabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Number frapic_w
|
Number frapic_w
|
||||||
Attributes
|
Attributes
|
||||||
ID : 12
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Associated Keyboard : none
|
||||||
Font ID : 0
|
|
||||||
Back. Color : 65535
|
|
||||||
Font Color : 0
|
|
||||||
Horizontal Alignment : center
|
|
||||||
Vertical Alignment : center
|
|
||||||
Value : 1960
|
Value : 1960
|
||||||
Significant digits shown : all
|
|
||||||
Format : decimal
|
|
||||||
Word wrap : enabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Number usual_cnt
|
Number usual_cnt
|
||||||
Attributes
|
Attributes
|
||||||
ID : 15
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Associated Keyboard : none
|
||||||
Font ID : 0
|
|
||||||
Back. Color : 65535
|
|
||||||
Font Color : 0
|
|
||||||
Horizontal Alignment : center
|
|
||||||
Vertical Alignment : center
|
|
||||||
Value : 0
|
Value : 0
|
||||||
Significant digits shown : all
|
|
||||||
Format : decimal
|
|
||||||
Word wrap : enabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Text tSend
|
Text tSend
|
||||||
Attributes
|
Attributes
|
||||||
ID : 2
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Associated Keyboard : none
|
||||||
Font ID : 0
|
|
||||||
Back. Color : 65535
|
|
||||||
Font Color : 0
|
|
||||||
Horizontal Alignment : center
|
|
||||||
Vertical Alignment : center
|
|
||||||
Input Type : character
|
|
||||||
Text : newtxt
|
Text : newtxt
|
||||||
Max. Text Size : 100
|
Max. Text Size : 100
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Text tTmp
|
Text tTmp
|
||||||
Attributes
|
Attributes
|
||||||
ID : 3
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Associated Keyboard : none
|
||||||
Font ID : 0
|
|
||||||
Back. Color : 65535
|
|
||||||
Font Color : 0
|
|
||||||
Horizontal Alignment : center
|
|
||||||
Vertical Alignment : center
|
|
||||||
Input Type : character
|
|
||||||
Text :
|
Text :
|
||||||
Max. Text Size : 10
|
Max. Text Size : 10
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Text tInstruction
|
Text tInstruction
|
||||||
Attributes
|
Attributes
|
||||||
ID : 6
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Associated Keyboard : none
|
||||||
Font ID : 0
|
|
||||||
Back. Color : 65535
|
|
||||||
Font Color : 0
|
|
||||||
Horizontal Alignment : center
|
|
||||||
Vertical Alignment : center
|
|
||||||
Input Type : character
|
|
||||||
Text :
|
Text :
|
||||||
Max. Text Size : 20
|
Max. Text Size : 20
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Text tId
|
Text tId
|
||||||
Attributes
|
Attributes
|
||||||
ID : 7
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Associated Keyboard : none
|
||||||
Font ID : 0
|
|
||||||
Back. Color : 65535
|
|
||||||
Font Color : 0
|
|
||||||
Horizontal Alignment : center
|
|
||||||
Vertical Alignment : center
|
|
||||||
Input Type : character
|
|
||||||
Text :
|
Text :
|
||||||
Max. Text Size : 20
|
Max. Text Size : 20
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Text tMsg1
|
Text tMsg1
|
||||||
Attributes
|
Attributes
|
||||||
ID : 8
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
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 ...
|
Text : Waiting for content ...
|
||||||
Max. Text Size : 40
|
Max. Text Size : 40
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Text tMsg2
|
Text tMsg2
|
||||||
Attributes
|
Attributes
|
||||||
ID : 13
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
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,
|
Text : This is taking longer than usual,
|
||||||
Max. Text Size : 100
|
Max. Text Size : 100
|
||||||
Word wrap : enabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Text tMsg3
|
Text tMsg3
|
||||||
Attributes
|
Attributes
|
||||||
ID : 14
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
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
|
Text : please check your backend configuration
|
||||||
Max. Text Size : 100
|
Max. Text Size : 100
|
||||||
Word wrap : enabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Text tVersion
|
Text tVersion
|
||||||
Attributes
|
Attributes
|
||||||
ID : 18
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Associated Keyboard : none
|
||||||
Font ID : 0
|
Text : 22
|
||||||
Back. Color : 65535
|
|
||||||
Font Color : 0
|
|
||||||
Horizontal Alignment : center
|
|
||||||
Vertical Alignment : center
|
|
||||||
Input Type : character
|
|
||||||
Text : 4
|
|
||||||
Max. Text Size : 10
|
Max. Text Size : 10
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Picture p0
|
Picture p0
|
||||||
Attributes
|
Attributes
|
||||||
ID : 1
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Button bSendStartup
|
||||||
Attributes
|
Attributes
|
||||||
ID : 17
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
State : unpressed
|
||||||
Text : startup
|
Text : startup
|
||||||
Max. Text Size : 10
|
Max. Text Size : 10
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
|
recmod=1
|
||||||
bauds=115200
|
bauds=115200
|
||||||
// startup event
|
// startup event
|
||||||
tSend.txt="event,startup,"+tVersion.txt
|
tSend.txt="event,startup,"+tVersion.txt
|
||||||
@@ -474,21 +190,12 @@ Button bSendStartup
|
|||||||
prints tSend.txt,0
|
prints tSend.txt,0
|
||||||
prints crcval,2
|
prints crcval,2
|
||||||
|
|
||||||
Hotspot mSpecial
|
Hotspot mSpinner
|
||||||
Attributes
|
Attributes
|
||||||
ID : 16
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
@@ -502,7 +209,6 @@ Hotspot mSpecial
|
|||||||
|
|
||||||
Timer tmSerial
|
Timer tmSerial
|
||||||
Attributes
|
Attributes
|
||||||
ID : 4
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Period (ms): 50
|
Period (ms): 50
|
||||||
Enabled : yes
|
Enabled : yes
|
||||||
@@ -576,11 +282,14 @@ Timer tmSerial
|
|||||||
}
|
}
|
||||||
if(tInstruction.txt=="pageType")
|
if(tInstruction.txt=="pageType")
|
||||||
{
|
{
|
||||||
|
dim=100
|
||||||
//command format pageType,specialPageName
|
//command format pageType,specialPageName
|
||||||
//write name of speical page to tId
|
//write name of speical page to tId
|
||||||
spstr strCommand.txt,tId.txt,",",1
|
spstr strCommand.txt,tId.txt,",",1
|
||||||
//save second arg if there's one
|
//save second arg if there's one
|
||||||
spstr strCommand.txt,tTmp.txt,",",2
|
spstr strCommand.txt,tTmp.txt,",",2
|
||||||
|
//save third arg if there's one
|
||||||
|
spstr strCommand.txt,pageIcons.tTmp2.txt,",",3
|
||||||
//we are going to exit this page with this command, so we have to clear the buffer, so we are not getting into a stupid loop ...
|
//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
|
udelete payloadLength-1
|
||||||
bufferPos=0
|
bufferPos=0
|
||||||
@@ -588,6 +297,10 @@ Timer tmSerial
|
|||||||
{
|
{
|
||||||
page cardThermo
|
page cardThermo
|
||||||
}
|
}
|
||||||
|
if(tId.txt=="screensaver")
|
||||||
|
{
|
||||||
|
page screensaver
|
||||||
|
}
|
||||||
if(tId.txt=="popupLight")
|
if(tId.txt=="popupLight")
|
||||||
{
|
{
|
||||||
pageIcons.tTmp1.txt=tTmp.txt
|
pageIcons.tTmp1.txt=tTmp.txt
|
||||||
@@ -601,10 +314,22 @@ Timer tmSerial
|
|||||||
{
|
{
|
||||||
page pageStartup
|
page pageStartup
|
||||||
}
|
}
|
||||||
if(tId.txt=="pageNotify")
|
if(tId.txt=="popupNotify")
|
||||||
{
|
{
|
||||||
page popupNotify
|
page popupNotify
|
||||||
}
|
}
|
||||||
|
if(tId.txt=="cardMedia")
|
||||||
|
{
|
||||||
|
page cardMedia
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardGrid")
|
||||||
|
{
|
||||||
|
page cardGrid
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardAlarm")
|
||||||
|
{
|
||||||
|
page cardAlarm
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// end of user code
|
// end of user code
|
||||||
udelete payloadLength-1
|
udelete payloadLength-1
|
||||||
@@ -616,27 +341,17 @@ Timer tmSerial
|
|||||||
// next character
|
// next character
|
||||||
bufferPos++
|
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
|
Timer tmSpinner
|
||||||
Attributes
|
Attributes
|
||||||
ID : 9
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Period (ms): 80
|
Period (ms): 80
|
||||||
Enabled : yes
|
Enabled : yes
|
||||||
|
|
||||||
Events
|
Events
|
||||||
Timer Event
|
Timer Event
|
||||||
xpic 154,49,spinner_w.val,140,frame_ptr.val,0,11 // draw the current frame
|
xpic mSpinner.x,mSpinner.y,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
|
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
|
doevents // finish drawing before next timer event triggers
|
||||||
if(frame_ptr.val==1820)
|
if(frame_ptr.val==1820)
|
||||||
|
|||||||
@@ -1,22 +1,14 @@
|
|||||||
Page pageTest
|
Page pageTest
|
||||||
Attributes
|
Attributes
|
||||||
ID : 0
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
Send Component ID : disabled
|
||||||
Opacity : 127
|
|
||||||
Width : 480
|
|
||||||
Effect : load
|
|
||||||
Effect Priority : 0
|
|
||||||
Effect Time : 300
|
|
||||||
Locked : no
|
Locked : no
|
||||||
Swide up page ID : disabled
|
Swide up page ID : disabled
|
||||||
Swide down page ID : disabled
|
Swide down page ID : disabled
|
||||||
Swide left page ID : disabled
|
Swide left page ID : disabled
|
||||||
Swide right page ID : disabled
|
Swide right page ID : disabled
|
||||||
Fill : solid color
|
|
||||||
Back. Color : 4226
|
|
||||||
|
|
||||||
Events
|
Events
|
||||||
Preinitialize Event
|
Preinitialize Event
|
||||||
@@ -24,52 +16,20 @@ Page pageTest
|
|||||||
|
|
||||||
Picture p0
|
Picture p0
|
||||||
Attributes
|
Attributes
|
||||||
ID : 1
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Button b0
|
||||||
Attributes
|
Attributes
|
||||||
ID : 2
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
State : unpressed
|
||||||
Text : entities
|
Text : entities
|
||||||
Max. Text Size : 10
|
Max. Text Size : 10
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
@@ -77,107 +37,27 @@ Button b0
|
|||||||
|
|
||||||
Button b1
|
Button b1
|
||||||
Attributes
|
Attributes
|
||||||
ID : 3
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
State : unpressed
|
||||||
Text : serial
|
Text : serial
|
||||||
Max. Text Size : 10
|
Max. Text Size : 10
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
page pageSerialTest
|
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
|
Button b3
|
||||||
Attributes
|
Attributes
|
||||||
ID : 5
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
State : unpressed
|
||||||
Text : disable recmod
|
Text : disable recmod
|
||||||
Max. Text Size : 20
|
Max. Text Size : 20
|
||||||
Word wrap : enabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
@@ -185,35 +65,13 @@ Button b3
|
|||||||
|
|
||||||
Button b6
|
Button b6
|
||||||
Attributes
|
Attributes
|
||||||
ID : 6
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
State : unpressed
|
||||||
Text : shutter
|
Text : shutter
|
||||||
Max. Text Size : 10
|
Max. Text Size : 10
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
@@ -221,35 +79,13 @@ Button b6
|
|||||||
|
|
||||||
Button b4
|
Button b4
|
||||||
Attributes
|
Attributes
|
||||||
ID : 7
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
State : unpressed
|
||||||
Text : light
|
Text : light
|
||||||
Max. Text Size : 10
|
Max. Text Size : 10
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
@@ -257,35 +93,13 @@ Button b4
|
|||||||
|
|
||||||
Button b5
|
Button b5
|
||||||
Attributes
|
Attributes
|
||||||
ID : 8
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
State : unpressed
|
||||||
Text : thermo
|
Text : thermo
|
||||||
Max. Text Size : 10
|
Max. Text Size : 10
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
@@ -293,35 +107,13 @@ Button b5
|
|||||||
|
|
||||||
Button b7
|
Button b7
|
||||||
Attributes
|
Attributes
|
||||||
ID : 9
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
State : unpressed
|
||||||
Text : media
|
Text : media
|
||||||
Max. Text Size : 10
|
Max. Text Size : 10
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
@@ -329,35 +121,13 @@ Button b7
|
|||||||
|
|
||||||
Button b8
|
Button b8
|
||||||
Attributes
|
Attributes
|
||||||
ID : 10
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
State : unpressed
|
||||||
Text : screens
|
Text : screens
|
||||||
Max. Text Size : 10
|
Max. Text Size : 10
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
@@ -366,37 +136,43 @@ Button b8
|
|||||||
|
|
||||||
Button b9
|
Button b9
|
||||||
Attributes
|
Attributes
|
||||||
ID : 11
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
State : unpressed
|
||||||
Text : notify
|
Text : notify
|
||||||
Max. Text Size : 10
|
Max. Text Size : 10
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
page popupNotify
|
page popupNotify
|
||||||
|
|
||||||
|
Button b10
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : alarm
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
page cardAlarm
|
||||||
|
|
||||||
|
Button b11
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : grid
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
page cardGrid
|
||||||
|
|
||||||
|
|||||||
@@ -1,22 +1,14 @@
|
|||||||
Page popupLight
|
Page popupLight
|
||||||
Attributes
|
Attributes
|
||||||
ID : 0
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
Send Component ID : disabled
|
||||||
Opacity : 127
|
|
||||||
Width : 480
|
|
||||||
Effect : load
|
|
||||||
Effect Priority : 0
|
|
||||||
Effect Time : 300
|
|
||||||
Locked : no
|
Locked : no
|
||||||
Swide up page ID : disabled
|
Swide up page ID : disabled
|
||||||
Swide down page ID : disabled
|
Swide down page ID : disabled
|
||||||
Swide left page ID : disabled
|
Swide left page ID : disabled
|
||||||
Swide right page ID : disabled
|
Swide right page ID : disabled
|
||||||
Fill : solid color
|
|
||||||
Back. Color : 6371
|
|
||||||
|
|
||||||
Events
|
Events
|
||||||
Preinitialize Event
|
Preinitialize Event
|
||||||
@@ -28,7 +20,7 @@ Page popupLight
|
|||||||
vis tSend,0
|
vis tSend,0
|
||||||
vis tTmp,0
|
vis tTmp,0
|
||||||
vis tInstruction,0
|
vis tInstruction,0
|
||||||
vis tItem,0
|
vis tId,0
|
||||||
//page open event
|
//page open event
|
||||||
// event,pageOpenDetail,typeOfPage,tEntityName
|
// event,pageOpenDetail,typeOfPage,tEntityName
|
||||||
// craft command
|
// craft command
|
||||||
@@ -54,413 +46,160 @@ Page popupLight
|
|||||||
vis hTempSlider,0
|
vis hTempSlider,0
|
||||||
//disable color wheel components by default
|
//disable color wheel components by default
|
||||||
vis bColor,0
|
vis bColor,0
|
||||||
vis pColorWheel,0
|
|
||||||
vis t0,0
|
vis t0,0
|
||||||
|
vis pColorWheel,0
|
||||||
|
//vis t0,0
|
||||||
|
|
||||||
Variable (string) strCommand
|
Variable (string) strCommand
|
||||||
Attributes
|
Attributes
|
||||||
ID : 17
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Text :
|
Text :
|
||||||
Max. Text Size: 50
|
Max. Text Size: 100
|
||||||
|
|
||||||
Variable (string) entn
|
Variable (string) entn
|
||||||
Attributes
|
Attributes
|
||||||
ID : 21
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Text : newtxt
|
Text : newtxt
|
||||||
Max. Text Size: 50
|
Max. Text Size: 50
|
||||||
|
|
||||||
Variable (int32) mode
|
Variable (int32) mode
|
||||||
Attributes
|
Attributes
|
||||||
ID : 23
|
|
||||||
Scope: local
|
Scope: local
|
||||||
Value: 1
|
Value: 1
|
||||||
|
|
||||||
Variable (int32) mode_bright
|
|
||||||
Attributes
|
|
||||||
ID : 24
|
|
||||||
Scope: local
|
|
||||||
Value: 0
|
|
||||||
|
|
||||||
Variable (int32) mode_temp
|
Variable (int32) mode_temp
|
||||||
Attributes
|
Attributes
|
||||||
ID : 25
|
|
||||||
Scope: local
|
Scope: local
|
||||||
Value: 0
|
Value: 0
|
||||||
|
|
||||||
Text tEntity
|
Text tEntity
|
||||||
Attributes
|
Attributes
|
||||||
ID : 3
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Associated Keyboard : none
|
||||||
Font ID : 0
|
|
||||||
Back. Color : 6371
|
|
||||||
Font Color : 65535
|
|
||||||
Horizontal Alignment : left
|
|
||||||
Vertical Alignment : center
|
|
||||||
Input Type : character
|
|
||||||
Text : tEntity1
|
Text : tEntity1
|
||||||
Max. Text Size : 25
|
Max. Text Size : 25
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Text tIcon1
|
Text tIcon1
|
||||||
Attributes
|
Attributes
|
||||||
ID : 4
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Associated Keyboard : none
|
||||||
Font ID : 1
|
|
||||||
Back. Color : 6371
|
|
||||||
Font Color : 17299
|
|
||||||
Horizontal Alignment : center
|
|
||||||
Vertical Alignment : center
|
|
||||||
Input Type : character
|
|
||||||
Text : î´
|
Text : î´
|
||||||
Max. Text Size : 10
|
Max. Text Size : 10
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Text t1
|
Text t1
|
||||||
Attributes
|
Attributes
|
||||||
ID : 6
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Associated Keyboard : none
|
||||||
Font ID : 0
|
|
||||||
Back. Color : 6371
|
|
||||||
Font Color : 65535
|
|
||||||
Horizontal Alignment : center
|
|
||||||
Vertical Alignment : center
|
|
||||||
Input Type : character
|
|
||||||
Text : Brightness
|
Text : Brightness
|
||||||
Max. Text Size : 15
|
Max. Text Size : 15
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Text t2
|
Text t2
|
||||||
Attributes
|
Attributes
|
||||||
ID : 9
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Associated Keyboard : none
|
||||||
Font ID : 1
|
|
||||||
Back. Color : 6371
|
|
||||||
Font Color : 40147
|
|
||||||
Horizontal Alignment : center
|
|
||||||
Vertical Alignment : center
|
|
||||||
Input Type : character
|
|
||||||
Text : î
|
Text : î
|
||||||
Max. Text Size : 10
|
Max. Text Size : 10
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Text t3
|
Text t3
|
||||||
Attributes
|
Attributes
|
||||||
ID : 10
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Associated Keyboard : none
|
||||||
Font ID : 1
|
|
||||||
Back. Color : 6371
|
|
||||||
Font Color : 40147
|
|
||||||
Horizontal Alignment : center
|
|
||||||
Vertical Alignment : center
|
|
||||||
Input Type : character
|
|
||||||
Text : î
|
Text : î
|
||||||
Max. Text Size : 10
|
Max. Text Size : 10
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Text t4
|
Text t4
|
||||||
Attributes
|
Attributes
|
||||||
ID : 11
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Associated Keyboard : none
|
||||||
Font ID : 0
|
|
||||||
Back. Color : 6371
|
|
||||||
Font Color : 65535
|
|
||||||
Horizontal Alignment : center
|
|
||||||
Vertical Alignment : center
|
|
||||||
Input Type : character
|
|
||||||
Text : Temperature
|
Text : Temperature
|
||||||
Max. Text Size : 15
|
Max. Text Size : 15
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Text tSend
|
Text tSend
|
||||||
Attributes
|
Attributes
|
||||||
ID : 12
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Associated Keyboard : none
|
||||||
Font ID : 0
|
|
||||||
Back. Color : 65535
|
|
||||||
Font Color : 0
|
|
||||||
Horizontal Alignment : center
|
|
||||||
Vertical Alignment : center
|
|
||||||
Input Type : character
|
|
||||||
Text : newtxt
|
Text : newtxt
|
||||||
Max. Text Size : 100
|
Max. Text Size : 100
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Text tTmp
|
Text tTmp
|
||||||
Attributes
|
Attributes
|
||||||
ID : 13
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Associated Keyboard : none
|
||||||
Font ID : 0
|
|
||||||
Back. Color : 65535
|
|
||||||
Font Color : 0
|
|
||||||
Horizontal Alignment : center
|
|
||||||
Vertical Alignment : center
|
|
||||||
Input Type : character
|
|
||||||
Text :
|
Text :
|
||||||
Max. Text Size : 10
|
Max. Text Size : 10
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Text tInstruction
|
Text tInstruction
|
||||||
Attributes
|
Attributes
|
||||||
ID : 18
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Associated Keyboard : none
|
||||||
Font ID : 0
|
|
||||||
Back. Color : 65535
|
|
||||||
Font Color : 0
|
|
||||||
Horizontal Alignment : center
|
|
||||||
Vertical Alignment : center
|
|
||||||
Input Type : character
|
|
||||||
Text :
|
Text :
|
||||||
Max. Text Size : 20
|
Max. Text Size : 20
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Text tItem
|
Text tId
|
||||||
Attributes
|
Attributes
|
||||||
ID : 19
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Associated Keyboard : none
|
||||||
Font ID : 0
|
|
||||||
Back. Color : 65535
|
|
||||||
Font Color : 0
|
|
||||||
Horizontal Alignment : center
|
|
||||||
Vertical Alignment : center
|
|
||||||
Input Type : character
|
|
||||||
Text :
|
Text :
|
||||||
Max. Text Size : 20
|
Max. Text Size : 20
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Text t0
|
Text t0
|
||||||
Attributes
|
Attributes
|
||||||
ID : 26
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Associated Keyboard : none
|
||||||
Font ID : 0
|
|
||||||
Back. Color : 6371
|
|
||||||
Font Color : 65535
|
|
||||||
Horizontal Alignment : center
|
|
||||||
Vertical Alignment : center
|
|
||||||
Input Type : character
|
|
||||||
Text : Color
|
Text : Color
|
||||||
Max. Text Size : 15
|
Max. Text Size : 15
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Picture p0
|
Picture p0
|
||||||
Attributes
|
Attributes
|
||||||
ID : 1
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Picture pColorWheel
|
||||||
Attributes
|
Attributes
|
||||||
ID : 2
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
// event,buttonPress,D,nameEntity,internalNameEntity,1,brightnessSlider,50
|
|
||||||
//craft command
|
//craft command
|
||||||
tSend.txt="event,buttonPress,D,"
|
tSend.txt="event,buttonPress2,"+entn.txt+",colorWheel,"
|
||||||
tSend.txt+=tEntity.txt+","
|
|
||||||
tSend.txt+=entn.txt+","
|
|
||||||
tSend.txt+="1,colorWheel,"
|
|
||||||
sys0=tch0
|
sys0=tch0
|
||||||
sys0=sys0-pColorWheel.x
|
sys0=sys0-pColorWheel.x
|
||||||
covx sys0,tTmp.txt,0,0
|
covx sys0,tTmp.txt,0,0
|
||||||
@@ -484,58 +223,20 @@ Picture pColorWheel
|
|||||||
|
|
||||||
Slider hBrightness
|
Slider hBrightness
|
||||||
Attributes
|
Attributes
|
||||||
ID : 7
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Position : 50
|
||||||
Upper range limit : 100
|
Upper range limit : 100
|
||||||
Lower range limit : 0
|
Lower range limit : 0
|
||||||
|
|
||||||
Events
|
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
|
Touch Release Event
|
||||||
// event,buttonPress,D,nameEntity,internalNameEntity,1,brightnessSlider,50
|
tmCooldown.en=1
|
||||||
|
tmCooldown.tim=2500
|
||||||
//craft command
|
//craft command
|
||||||
tSend.txt="event,buttonPress,D,"
|
tSend.txt="event,buttonPress2,"+entn.txt+",brightnessSlider,"
|
||||||
tSend.txt+=tEntity.txt+","
|
|
||||||
tSend.txt+=entn.txt+","
|
|
||||||
tSend.txt+="1,brightnessSlider,"
|
|
||||||
covx hBrightness.val,tTmp.txt,0,0
|
covx hBrightness.val,tTmp.txt,0,0
|
||||||
tSend.txt+=tTmp.txt
|
tSend.txt+=tTmp.txt
|
||||||
//send calc crc
|
//send calc crc
|
||||||
@@ -552,58 +253,20 @@ Slider hBrightness
|
|||||||
|
|
||||||
Slider hTempSlider
|
Slider hTempSlider
|
||||||
Attributes
|
Attributes
|
||||||
ID : 20
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Position : 50
|
||||||
Upper range limit : 100
|
Upper range limit : 100
|
||||||
Lower range limit : 0
|
Lower range limit : 0
|
||||||
|
|
||||||
Events
|
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
|
Touch Release Event
|
||||||
// event,buttonPress,D,nameEntity,internalNameEntity,1,colorTempSlider,50
|
tmCooldown.en=1
|
||||||
|
tmCooldown.tim=2500
|
||||||
//craft command
|
//craft command
|
||||||
tSend.txt="event,buttonPress,D,"
|
tSend.txt="event,buttonPress2,"+entn.txt+",colorTempSlider,"
|
||||||
tSend.txt+=tEntity.txt+","
|
|
||||||
tSend.txt+=entn.txt+","
|
|
||||||
tSend.txt+="1,colorTempSlider,"
|
|
||||||
covx hTempSlider.val,tTmp.txt,0,0
|
covx hTempSlider.val,tTmp.txt,0,0
|
||||||
tSend.txt+=tTmp.txt
|
tSend.txt+=tTmp.txt
|
||||||
//send calc crc
|
//send calc crc
|
||||||
@@ -620,71 +283,38 @@ Slider hTempSlider
|
|||||||
|
|
||||||
Button b0
|
Button b0
|
||||||
Attributes
|
Attributes
|
||||||
ID : 5
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
State : unpressed
|
||||||
Text : î
|
Text : î
|
||||||
Max. Text Size : 10
|
Max. Text Size : 10
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
page cardEntities
|
tSend.txt="event,buttonPress2,popupLight,bExit"
|
||||||
|
//send calc crc
|
||||||
|
btlen tSend.txt,sys0
|
||||||
|
crcrest 1,0xffff // reset CRC
|
||||||
|
crcputh 55 bb
|
||||||
|
crcputs sys0,1
|
||||||
|
crcputs tSend.txt,0
|
||||||
|
//send cmd
|
||||||
|
printh 55 bb
|
||||||
|
prints sys0,2
|
||||||
|
prints tSend.txt,0
|
||||||
|
prints crcval,2
|
||||||
|
|
||||||
Button bColor
|
Button bColor
|
||||||
Attributes
|
Attributes
|
||||||
ID : 22
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
State : unpressed
|
||||||
Text : î
|
Text : î
|
||||||
Max. Text Size : 10
|
Max. Text Size : 10
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
@@ -693,11 +323,6 @@ Button bColor
|
|||||||
mode.val=0
|
mode.val=0
|
||||||
//enable color wheel
|
//enable color wheel
|
||||||
vis pColorWheel,1
|
vis pColorWheel,1
|
||||||
vis t0,1
|
|
||||||
//disable brightness
|
|
||||||
vis t1,0
|
|
||||||
vis t2,0
|
|
||||||
vis hBrightness,0
|
|
||||||
//disable color temp
|
//disable color temp
|
||||||
vis t4,0
|
vis t4,0
|
||||||
vis t3,0
|
vis t3,0
|
||||||
@@ -707,14 +332,6 @@ Button bColor
|
|||||||
mode.val=1
|
mode.val=1
|
||||||
//disable color wheel
|
//disable color wheel
|
||||||
vis pColorWheel,0
|
vis pColorWheel,0
|
||||||
vis t0,0
|
|
||||||
if(mode_bright.val==1)
|
|
||||||
{
|
|
||||||
//enable brightness
|
|
||||||
vis t1,1
|
|
||||||
vis t2,1
|
|
||||||
vis hBrightness,1
|
|
||||||
}
|
|
||||||
if(mode_temp.val==1)
|
if(mode_temp.val==1)
|
||||||
{
|
{
|
||||||
//enable color temp
|
//enable color temp
|
||||||
@@ -726,40 +343,18 @@ Button bColor
|
|||||||
|
|
||||||
Dual-state Button btOnOff1
|
Dual-state Button btOnOff1
|
||||||
Attributes
|
Attributes
|
||||||
ID : 8
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
State : unpressed
|
||||||
Text :
|
Text :
|
||||||
Max. Text Size : 10
|
Max. Text Size : 10
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
// event,buttonPress,D,nameEntity,internalNameEntity,1,OnOff,1
|
|
||||||
//craft command
|
//craft command
|
||||||
tSend.txt="event,buttonPress,D,"
|
tSend.txt="event,buttonPress2,"+entn.txt+","+"OnOff,"
|
||||||
tSend.txt+=tEntity.txt+","
|
|
||||||
tSend.txt+=entn.txt+","
|
|
||||||
tSend.txt+="1,OnOff,"
|
|
||||||
covx btOnOff1.val,tTmp.txt,0,0
|
covx btOnOff1.val,tTmp.txt,0,0
|
||||||
tSend.txt+=tTmp.txt
|
tSend.txt+=tTmp.txt
|
||||||
//send calc crc
|
//send calc crc
|
||||||
@@ -776,7 +371,6 @@ Dual-state Button btOnOff1
|
|||||||
|
|
||||||
Timer tmSleep
|
Timer tmSleep
|
||||||
Attributes
|
Attributes
|
||||||
ID : 15
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Period (ms): 1000
|
Period (ms): 1000
|
||||||
Enabled : yes
|
Enabled : yes
|
||||||
@@ -790,13 +384,13 @@ Timer tmSleep
|
|||||||
{
|
{
|
||||||
screensaver.originPage.val=dp
|
screensaver.originPage.val=dp
|
||||||
sleepValue=0
|
sleepValue=0
|
||||||
page cardEntities
|
click b0,1
|
||||||
|
click b0,0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Timer tmSerial
|
Timer tmSerial
|
||||||
Attributes
|
Attributes
|
||||||
ID : 16
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Period (ms): 50
|
Period (ms): 50
|
||||||
Enabled : yes
|
Enabled : yes
|
||||||
@@ -848,52 +442,101 @@ Timer tmSerial
|
|||||||
spstr strCommand.txt,tInstruction.txt,",",0
|
spstr strCommand.txt,tInstruction.txt,",",0
|
||||||
if(tInstruction.txt=="entityUpdateDetail")
|
if(tInstruction.txt=="entityUpdateDetail")
|
||||||
{
|
{
|
||||||
// get Button State
|
// change icon
|
||||||
spstr strCommand.txt,tTmp.txt,",",1
|
spstr strCommand.txt,tTmp.txt,",",1
|
||||||
covx tTmp.txt,sys0,0,0
|
covx tTmp.txt,sys0,0,0
|
||||||
|
substr pageIcons.tIcons.txt,tIcon1.txt,sys0,1
|
||||||
|
vis tIcon1,1
|
||||||
|
// change icon color
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",2
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
tIcon1.pco=sys0
|
||||||
|
// get Button State
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",3
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
btOnOff1.val=sys0
|
btOnOff1.val=sys0
|
||||||
if(mode.val==1)
|
// get Brightness value
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",4
|
||||||
|
if(tTmp.txt=="disable")
|
||||||
{
|
{
|
||||||
// get Brightness value
|
vis t1,0
|
||||||
spstr strCommand.txt,tTmp.txt,",",2
|
vis t2,0
|
||||||
if(tTmp.txt=="disable")
|
vis hBrightness,0
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
vis t1,1
|
||||||
|
vis t2,1
|
||||||
|
vis hBrightness,1
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
if(tmCooldown.en==0)
|
||||||
{
|
{
|
||||||
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
|
hBrightness.val=sys0
|
||||||
}
|
}
|
||||||
// get ColorTemp value
|
}
|
||||||
spstr strCommand.txt,tTmp.txt,",",3
|
// get ColorTemp value
|
||||||
if(tTmp.txt=="disable")
|
spstr strCommand.txt,tTmp.txt,",",5
|
||||||
|
if(tTmp.txt=="disable")
|
||||||
|
{
|
||||||
|
vis hTempSlider,0
|
||||||
|
vis t3,0
|
||||||
|
vis t4,0
|
||||||
|
mode_temp.val=0
|
||||||
|
// mode == 1 is temp controls currently shown
|
||||||
|
if(mode.val==1)
|
||||||
{
|
{
|
||||||
vis t4,0
|
// switch mode
|
||||||
vis t3,0
|
click bColor,1
|
||||||
vis hTempSlider,0
|
click bColor,0
|
||||||
mode_temp.val=0
|
}
|
||||||
}else
|
}else if(tTmp.txt=="unknown") // temp supported, but not in color mode
|
||||||
|
{
|
||||||
|
mode_temp.val=1
|
||||||
|
// mode == 1 is temp controls currently shown
|
||||||
|
if(mode.val==1)
|
||||||
|
{
|
||||||
|
// switch mode
|
||||||
|
click bColor,1
|
||||||
|
click bColor,0
|
||||||
|
}
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
mode_temp.val=1
|
||||||
|
vis hTempSlider,1
|
||||||
|
vis t3,1
|
||||||
|
vis t4,1
|
||||||
|
if(tmCooldown.en==0)
|
||||||
{
|
{
|
||||||
vis t4,1
|
|
||||||
vis t3,1
|
|
||||||
vis hTempSlider,1
|
|
||||||
mode_temp.val=1
|
|
||||||
covx tTmp.txt,sys0,0,0
|
covx tTmp.txt,sys0,0,0
|
||||||
hTempSlider.val=sys0
|
hTempSlider.val=sys0
|
||||||
}
|
}
|
||||||
|
// mode == 0 is rgb controls currently shown
|
||||||
|
if(mode.val==0)
|
||||||
|
{
|
||||||
|
// switch mode
|
||||||
|
click bColor,1
|
||||||
|
click bColor,0
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// get ColorWheel value
|
// get Color value
|
||||||
spstr strCommand.txt,tTmp.txt,",",4
|
spstr strCommand.txt,tTmp.txt,",",6
|
||||||
if(tTmp.txt!="disable")
|
// disable -> isn't supported
|
||||||
|
if(tTmp.txt=="disable")
|
||||||
{
|
{
|
||||||
vis bColor,1
|
vis t0,0
|
||||||
|
vis bColor,0
|
||||||
|
vis pColorWheel,0
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
vis t0,1
|
||||||
|
//only enable bColor button if color temp is also supported
|
||||||
|
if(mode_temp.val==1)
|
||||||
|
{
|
||||||
|
vis bColor,1
|
||||||
|
}
|
||||||
|
if(mode.val==0)
|
||||||
|
{
|
||||||
|
vis pColorWheel,1
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(tInstruction.txt=="time")
|
if(tInstruction.txt=="time")
|
||||||
@@ -911,7 +554,6 @@ Timer tmSerial
|
|||||||
// get value
|
// get value
|
||||||
spstr strCommand.txt,tTmp.txt,",",1
|
spstr strCommand.txt,tTmp.txt,",",1
|
||||||
covx tTmp.txt,dimValue,0,0
|
covx tTmp.txt,dimValue,0,0
|
||||||
dim=dimValue
|
|
||||||
}
|
}
|
||||||
if(tInstruction.txt=="timeout")
|
if(tInstruction.txt=="timeout")
|
||||||
{
|
{
|
||||||
@@ -919,6 +561,43 @@ Timer tmSerial
|
|||||||
spstr strCommand.txt,tTmp.txt,",",1
|
spstr strCommand.txt,tTmp.txt,",",1
|
||||||
covx tTmp.txt,sleepTimeout,0,0
|
covx tTmp.txt,sleepTimeout,0,0
|
||||||
}
|
}
|
||||||
|
if(tInstruction.txt=="pageType")
|
||||||
|
{
|
||||||
|
//command format pageType,specialPageName
|
||||||
|
//write name of speical page to tId
|
||||||
|
spstr strCommand.txt,tId.txt,",",1
|
||||||
|
//save second arg if there's one
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",2
|
||||||
|
//save third arg if there's one
|
||||||
|
spstr strCommand.txt,pageIcons.tTmp2.txt,",",3
|
||||||
|
//we are going to exit this page with this command, so we have to clear the buffer, so we are not getting into a stupid loop ...
|
||||||
|
udelete payloadLength-1
|
||||||
|
bufferPos=0
|
||||||
|
if(tId.txt=="cardEntities")
|
||||||
|
{
|
||||||
|
page cardEntities
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardMedia")
|
||||||
|
{
|
||||||
|
page cardMedia
|
||||||
|
}
|
||||||
|
if(tId.txt=="pageStartup")
|
||||||
|
{
|
||||||
|
page pageStartup
|
||||||
|
}
|
||||||
|
if(tId.txt=="popupNotify")
|
||||||
|
{
|
||||||
|
page popupNotify
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardGrid")
|
||||||
|
{
|
||||||
|
page cardGrid
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardAlarm")
|
||||||
|
{
|
||||||
|
page cardAlarm
|
||||||
|
}
|
||||||
|
}
|
||||||
// end of user code
|
// end of user code
|
||||||
udelete payloadLength-1
|
udelete payloadLength-1
|
||||||
bufferPos=0
|
bufferPos=0
|
||||||
@@ -929,20 +608,20 @@ Timer tmSerial
|
|||||||
// next character
|
// next character
|
||||||
bufferPos++
|
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 tmCooldown
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Period (ms): 100
|
||||||
|
Enabled : no
|
||||||
|
|
||||||
|
Events
|
||||||
|
Timer Event
|
||||||
|
tmCooldown.en=0
|
||||||
|
|
||||||
TouchCap tc0
|
TouchCap tc0
|
||||||
Attributes
|
Attributes
|
||||||
ID : 14
|
|
||||||
Scope: local
|
Scope: local
|
||||||
Value: 0
|
Value: 0
|
||||||
|
|
||||||
|
|||||||
@@ -1,22 +1,14 @@
|
|||||||
Page popupNotify
|
Page popupNotify
|
||||||
Attributes
|
Attributes
|
||||||
ID : 0
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
Send Component ID : disabled
|
||||||
Opacity : 127
|
|
||||||
Width : 480
|
|
||||||
Effect : load
|
|
||||||
Effect Priority : 0
|
|
||||||
Effect Time : 300
|
|
||||||
Locked : no
|
Locked : no
|
||||||
Swide up page ID : disabled
|
Swide up page ID : disabled
|
||||||
Swide down page ID : disabled
|
Swide down page ID : disabled
|
||||||
Swide left page ID : disabled
|
Swide left page ID : disabled
|
||||||
Swide right page ID : disabled
|
Swide right page ID : disabled
|
||||||
Fill : solid color
|
|
||||||
Back. Color : 6371
|
|
||||||
|
|
||||||
Events
|
Events
|
||||||
Preinitialize Event
|
Preinitialize Event
|
||||||
@@ -25,10 +17,105 @@ Page popupNotify
|
|||||||
vis tTmp,0
|
vis tTmp,0
|
||||||
vis tInstruction,0
|
vis tInstruction,0
|
||||||
vis tId,0
|
vis tId,0
|
||||||
//page open event
|
|
||||||
// event,pageOpenDetail,typeOfPage,tEntityName
|
Variable (string) strCommand
|
||||||
// craft command
|
Attributes
|
||||||
tSend.txt="event,pageOpenDetail,notify"
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 1000
|
||||||
|
|
||||||
|
Variable (string) entn
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Text :
|
||||||
|
Max. Text Size: 30
|
||||||
|
|
||||||
|
Variable (int32) vaOldSleepT
|
||||||
|
Attributes
|
||||||
|
Scope: local
|
||||||
|
Value: 0
|
||||||
|
|
||||||
|
Text tSend
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : newtxt
|
||||||
|
Max. Text Size : 100
|
||||||
|
|
||||||
|
Text tTmp
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Text tInstruction
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 20
|
||||||
|
|
||||||
|
Text tId
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 20
|
||||||
|
|
||||||
|
Text tHeading
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 40
|
||||||
|
|
||||||
|
Text tText
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 500
|
||||||
|
|
||||||
|
Picture p0
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
|
||||||
|
Button b0
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
State : unpressed
|
||||||
|
Text : î
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Events
|
||||||
|
Touch Press Event
|
||||||
|
sleepTimeout=vaOldSleepT.val
|
||||||
|
tSend.txt="event,buttonPress2,popupNotify,bExit"
|
||||||
//send calc crc
|
//send calc crc
|
||||||
btlen tSend.txt,sys0
|
btlen tSend.txt,sys0
|
||||||
crcrest 1,0xffff // reset CRC
|
crcrest 1,0xffff // reset CRC
|
||||||
@@ -41,282 +128,21 @@ Page popupNotify
|
|||||||
prints tSend.txt,0
|
prints tSend.txt,0
|
||||||
prints crcval,2
|
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
|
Button b2
|
||||||
Attributes
|
Attributes
|
||||||
ID : 13
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
State : unpressed
|
||||||
Text :
|
Text :
|
||||||
Max. Text Size : 10
|
Max. Text Size : 10
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
|
sleepTimeout=vaOldSleepT.val
|
||||||
//craft command
|
//craft command
|
||||||
tSend.txt="event,buttonPress,D,D,D,1,notifyAction,yes"
|
tSend.txt="event,buttonPress2,"+entn.txt+",notifyAction,yes"
|
||||||
//send calc crc
|
//send calc crc
|
||||||
btlen tSend.txt,sys0
|
btlen tSend.txt,sys0
|
||||||
crcrest 1,0xffff // reset CRC
|
crcrest 1,0xffff // reset CRC
|
||||||
@@ -331,40 +157,19 @@ Button b2
|
|||||||
|
|
||||||
Button b1
|
Button b1
|
||||||
Attributes
|
Attributes
|
||||||
ID : 14
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
State : unpressed
|
||||||
Text :
|
Text :
|
||||||
Max. Text Size : 10
|
Max. Text Size : 10
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
|
sleepTimeout=vaOldSleepT.val
|
||||||
//craft command
|
//craft command
|
||||||
tSend.txt="event,buttonPress,D,D,D,1,notifyAction,no"
|
tSend.txt="event,buttonPress2,"+entn.txt+",notifyAction,no"
|
||||||
//send calc crc
|
//send calc crc
|
||||||
btlen tSend.txt,sys0
|
btlen tSend.txt,sys0
|
||||||
crcrest 1,0xffff // reset CRC
|
crcrest 1,0xffff // reset CRC
|
||||||
@@ -379,7 +184,6 @@ Button b1
|
|||||||
|
|
||||||
Timer tmSleep
|
Timer tmSleep
|
||||||
Attributes
|
Attributes
|
||||||
ID : 6
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Period (ms): 1000
|
Period (ms): 1000
|
||||||
Enabled : yes
|
Enabled : yes
|
||||||
@@ -393,13 +197,13 @@ Timer tmSleep
|
|||||||
{
|
{
|
||||||
screensaver.originPage.val=dp
|
screensaver.originPage.val=dp
|
||||||
sleepValue=0
|
sleepValue=0
|
||||||
page cardEntities
|
click b0,1
|
||||||
|
click b0,0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Timer tmSerial
|
Timer tmSerial
|
||||||
Attributes
|
Attributes
|
||||||
ID : 7
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Period (ms): 50
|
Period (ms): 50
|
||||||
Enabled : yes
|
Enabled : yes
|
||||||
@@ -451,14 +255,46 @@ Timer tmSerial
|
|||||||
spstr strCommand.txt,tInstruction.txt,",",0
|
spstr strCommand.txt,tInstruction.txt,",",0
|
||||||
if(tInstruction.txt=="entityUpdateDetail")
|
if(tInstruction.txt=="entityUpdateDetail")
|
||||||
{
|
{
|
||||||
|
// get entn
|
||||||
|
spstr strCommand.txt,entn.txt,"|",1
|
||||||
// get Heading
|
// get Heading
|
||||||
spstr strCommand.txt,tHeading.txt,",",1
|
spstr strCommand.txt,tHeading.txt,"|",2
|
||||||
|
// heading color
|
||||||
|
spstr strCommand.txt,tTmp.txt,"|",3
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
tHeading.pco=sys0
|
||||||
// get b1
|
// get b1
|
||||||
spstr strCommand.txt,b1.txt,",",2
|
spstr strCommand.txt,b1.txt,"|",4
|
||||||
|
if(b1.txt!="")
|
||||||
|
{
|
||||||
|
vis b1,1
|
||||||
|
}
|
||||||
|
// b1 color
|
||||||
|
spstr strCommand.txt,tTmp.txt,"|",5
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
b1.pco=sys0
|
||||||
// get b2
|
// get b2
|
||||||
spstr strCommand.txt,b2.txt,",",3
|
spstr strCommand.txt,b2.txt,"|",6
|
||||||
|
if(b2.txt!="")
|
||||||
|
{
|
||||||
|
vis b2,1
|
||||||
|
}
|
||||||
|
// b2 color
|
||||||
|
spstr strCommand.txt,tTmp.txt,"|",7
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
b2.pco=sys0
|
||||||
// get tText
|
// get tText
|
||||||
spstr strCommand.txt,tText.txt,",",4
|
spstr strCommand.txt,tText.txt,"|",8
|
||||||
|
// tText color
|
||||||
|
spstr strCommand.txt,tTmp.txt,"|",9
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
tText.pco=sys0
|
||||||
|
//preserve old sleepTimeout
|
||||||
|
vaOldSleepT.val=sleepTimeout
|
||||||
|
// sleep timeout
|
||||||
|
spstr strCommand.txt,tTmp.txt,"|",10
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
sleepTimeout=sys0
|
||||||
}
|
}
|
||||||
if(tInstruction.txt=="time")
|
if(tInstruction.txt=="time")
|
||||||
{
|
{
|
||||||
@@ -475,7 +311,6 @@ Timer tmSerial
|
|||||||
// get value
|
// get value
|
||||||
spstr strCommand.txt,tTmp.txt,",",1
|
spstr strCommand.txt,tTmp.txt,",",1
|
||||||
covx tTmp.txt,dimValue,0,0
|
covx tTmp.txt,dimValue,0,0
|
||||||
dim=dimValue
|
|
||||||
}
|
}
|
||||||
if(tInstruction.txt=="timeout")
|
if(tInstruction.txt=="timeout")
|
||||||
{
|
{
|
||||||
@@ -483,22 +318,23 @@ Timer tmSerial
|
|||||||
spstr strCommand.txt,tTmp.txt,",",1
|
spstr strCommand.txt,tTmp.txt,",",1
|
||||||
covx tTmp.txt,sleepTimeout,0,0
|
covx tTmp.txt,sleepTimeout,0,0
|
||||||
}
|
}
|
||||||
|
if(tInstruction.txt=="exitPopup")
|
||||||
|
{
|
||||||
|
click b0,1
|
||||||
|
}
|
||||||
if(tInstruction.txt=="pageType")
|
if(tInstruction.txt=="pageType")
|
||||||
{
|
{
|
||||||
|
sleepTimeout=vaOldSleepT.val
|
||||||
//command format pageType,specialPageName
|
//command format pageType,specialPageName
|
||||||
//write name of speical page to tId
|
//write name of speical page to tId
|
||||||
spstr strCommand.txt,tId.txt,",",1
|
spstr strCommand.txt,tId.txt,",",1
|
||||||
//save second arg if there's one
|
//save second arg if there's one
|
||||||
spstr strCommand.txt,tTmp.txt,",",2
|
spstr strCommand.txt,tTmp.txt,",",2
|
||||||
if(tId.txt=="pageNotify")
|
//save third arg if there's one
|
||||||
{
|
spstr strCommand.txt,pageIcons.tTmp2.txt,",",3
|
||||||
//yay, we are already on the correct page
|
//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 ...
|
||||||
}else
|
udelete payloadLength-1
|
||||||
{
|
bufferPos=0
|
||||||
//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")
|
if(tId.txt=="popupLight")
|
||||||
{
|
{
|
||||||
pageIcons.tTmp1.txt=tTmp.txt
|
pageIcons.tTmp1.txt=tTmp.txt
|
||||||
@@ -512,13 +348,21 @@ Timer tmSerial
|
|||||||
{
|
{
|
||||||
page cardMedia
|
page cardMedia
|
||||||
}
|
}
|
||||||
|
if(tId.txt=="cardThermo")
|
||||||
|
{
|
||||||
|
page cardThermo
|
||||||
|
}
|
||||||
if(tId.txt=="pageStartup")
|
if(tId.txt=="pageStartup")
|
||||||
{
|
{
|
||||||
page pageStartup
|
page pageStartup
|
||||||
}
|
}
|
||||||
if(tId.txt=="pageThermo")
|
if(tId.txt=="cardGrid")
|
||||||
{
|
{
|
||||||
page cardThermo
|
page cardGrid
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardAlarm")
|
||||||
|
{
|
||||||
|
page cardAlarm
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// end of user code
|
// end of user code
|
||||||
@@ -544,7 +388,6 @@ Timer tmSerial
|
|||||||
|
|
||||||
TouchCap tc0
|
TouchCap tc0
|
||||||
Attributes
|
Attributes
|
||||||
ID : 5
|
|
||||||
Scope: local
|
Scope: local
|
||||||
Value: 0
|
Value: 0
|
||||||
|
|
||||||
|
|||||||
@@ -1,22 +1,14 @@
|
|||||||
Page popupShutter
|
Page popupShutter
|
||||||
Attributes
|
Attributes
|
||||||
ID : 0
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
Send Component ID : disabled
|
||||||
Opacity : 127
|
|
||||||
Width : 480
|
|
||||||
Effect : load
|
|
||||||
Effect Priority : 0
|
|
||||||
Effect Time : 300
|
|
||||||
Locked : no
|
Locked : no
|
||||||
Swide up page ID : disabled
|
Swide up page ID : disabled
|
||||||
Swide down page ID : disabled
|
Swide down page ID : disabled
|
||||||
Swide left page ID : disabled
|
Swide left page ID : disabled
|
||||||
Swide right page ID : disabled
|
Swide right page ID : disabled
|
||||||
Fill : solid color
|
|
||||||
Back. Color : 6371
|
|
||||||
|
|
||||||
Events
|
Events
|
||||||
Preinitialize Event
|
Preinitialize Event
|
||||||
@@ -28,7 +20,7 @@ Page popupShutter
|
|||||||
vis tSend,0
|
vis tSend,0
|
||||||
vis tTmp,0
|
vis tTmp,0
|
||||||
vis tInstruction,0
|
vis tInstruction,0
|
||||||
vis tItem,0
|
vis tId,0
|
||||||
//page open event
|
//page open event
|
||||||
// event,pageOpenDetail,typeOfPage,tEntityName
|
// event,pageOpenDetail,typeOfPage,tEntityName
|
||||||
// craft command
|
// craft command
|
||||||
@@ -47,278 +39,108 @@ Page popupShutter
|
|||||||
|
|
||||||
Variable (string) strCommand
|
Variable (string) strCommand
|
||||||
Attributes
|
Attributes
|
||||||
ID : 10
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Text :
|
Text :
|
||||||
Max. Text Size: 50
|
Max. Text Size: 50
|
||||||
|
|
||||||
Variable (string) entn
|
Variable (string) entn
|
||||||
Attributes
|
Attributes
|
||||||
ID : 18
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Text : newtxt
|
Text : newtxt
|
||||||
Max. Text Size: 50
|
Max. Text Size: 50
|
||||||
|
|
||||||
Text tEntity
|
Text tEntity
|
||||||
Attributes
|
Attributes
|
||||||
ID : 2
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Associated Keyboard : none
|
||||||
Font ID : 0
|
|
||||||
Back. Color : 6371
|
|
||||||
Font Color : 65535
|
|
||||||
Horizontal Alignment : left
|
|
||||||
Vertical Alignment : center
|
|
||||||
Input Type : character
|
|
||||||
Text : tEntity1
|
Text : tEntity1
|
||||||
Max. Text Size : 25
|
Max. Text Size : 25
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Text tIcon1
|
Text tIcon1
|
||||||
Attributes
|
Attributes
|
||||||
ID : 3
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Associated Keyboard : none
|
||||||
Font ID : 1
|
|
||||||
Back. Color : 6371
|
|
||||||
Font Color : 17299
|
|
||||||
Horizontal Alignment : center
|
|
||||||
Vertical Alignment : center
|
|
||||||
Input Type : character
|
|
||||||
Text : î°
|
Text : î°
|
||||||
Max. Text Size : 10
|
Max. Text Size : 10
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Text tSend
|
Text tSend
|
||||||
Attributes
|
Attributes
|
||||||
ID : 5
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Associated Keyboard : none
|
||||||
Font ID : 0
|
|
||||||
Back. Color : 65535
|
|
||||||
Font Color : 0
|
|
||||||
Horizontal Alignment : center
|
|
||||||
Vertical Alignment : center
|
|
||||||
Input Type : character
|
|
||||||
Text : newtxt
|
Text : newtxt
|
||||||
Max. Text Size : 100
|
Max. Text Size : 100
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Text tTmp
|
Text tTmp
|
||||||
Attributes
|
Attributes
|
||||||
ID : 6
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Associated Keyboard : none
|
||||||
Font ID : 0
|
|
||||||
Back. Color : 65535
|
|
||||||
Font Color : 0
|
|
||||||
Horizontal Alignment : center
|
|
||||||
Vertical Alignment : center
|
|
||||||
Input Type : character
|
|
||||||
Text :
|
Text :
|
||||||
Max. Text Size : 10
|
Max. Text Size : 10
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Text tInstruction
|
Text tInstruction
|
||||||
Attributes
|
Attributes
|
||||||
ID : 11
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Associated Keyboard : none
|
||||||
Font ID : 0
|
|
||||||
Back. Color : 65535
|
|
||||||
Font Color : 0
|
|
||||||
Horizontal Alignment : center
|
|
||||||
Vertical Alignment : center
|
|
||||||
Input Type : character
|
|
||||||
Text :
|
Text :
|
||||||
Max. Text Size : 20
|
Max. Text Size : 20
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Text tItem
|
Text tId
|
||||||
Attributes
|
Attributes
|
||||||
ID : 12
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Associated Keyboard : none
|
||||||
Font ID : 0
|
|
||||||
Back. Color : 65535
|
|
||||||
Font Color : 0
|
|
||||||
Horizontal Alignment : center
|
|
||||||
Vertical Alignment : center
|
|
||||||
Input Type : character
|
|
||||||
Text :
|
Text :
|
||||||
Max. Text Size : 20
|
Max. Text Size : 20
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Text t1
|
Text t1
|
||||||
Attributes
|
Attributes
|
||||||
ID : 17
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Associated Keyboard : none
|
||||||
Font ID : 0
|
|
||||||
Back. Color : 6371
|
|
||||||
Font Color : 65535
|
|
||||||
Horizontal Alignment : center
|
|
||||||
Vertical Alignment : center
|
|
||||||
Input Type : character
|
|
||||||
Text : Position
|
Text : Position
|
||||||
Max. Text Size : 15
|
Max. Text Size : 15
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Picture p0
|
Picture p0
|
||||||
Attributes
|
Attributes
|
||||||
ID : 1
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Slider hPosition
|
||||||
Attributes
|
Attributes
|
||||||
ID : 16
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Position : 50
|
||||||
Upper range limit : 100
|
Upper range limit : 100
|
||||||
Lower range limit : 0
|
Lower range limit : 0
|
||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Release Event
|
Touch Release Event
|
||||||
// event,buttonPress,D,nameEntity,internalNameEntity,1,positionSlider,50
|
// event,buttonPress2,internalNameEntity,positionSlider,50
|
||||||
//craft command
|
//craft command
|
||||||
tSend.txt="event,buttonPress,D,"
|
tSend.txt="event,buttonPress2,"+entn.txt+",positionSlider,"
|
||||||
tSend.txt+=tEntity.txt+","
|
|
||||||
tSend.txt+=entn.txt+","
|
|
||||||
tSend.txt+="1,positionSlider,"
|
|
||||||
covx hPosition.val,tTmp.txt,0,0
|
covx hPosition.val,tTmp.txt,0,0
|
||||||
tSend.txt+=tTmp.txt
|
tSend.txt+=tTmp.txt
|
||||||
//send calc crc
|
//send calc crc
|
||||||
@@ -335,82 +157,42 @@ Slider hPosition
|
|||||||
|
|
||||||
Button b0
|
Button b0
|
||||||
Attributes
|
Attributes
|
||||||
ID : 4
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
State : unpressed
|
||||||
Text : î
|
Text : î
|
||||||
Max. Text Size : 10
|
Max. Text Size : 10
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
page cardEntities
|
tSend.txt="event,buttonPress2,popupShutter,bExit"
|
||||||
|
//send calc crc
|
||||||
|
btlen tSend.txt,sys0
|
||||||
|
crcrest 1,0xffff // reset CRC
|
||||||
|
crcputh 55 bb
|
||||||
|
crcputs sys0,1
|
||||||
|
crcputs tSend.txt,0
|
||||||
|
//send cmd
|
||||||
|
printh 55 bb
|
||||||
|
prints sys0,2
|
||||||
|
prints tSend.txt,0
|
||||||
|
prints crcval,2
|
||||||
|
|
||||||
Button bDown1
|
Button bDown1
|
||||||
Attributes
|
Attributes
|
||||||
ID : 13
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
State : unpressed
|
||||||
Text : î
|
Text : î
|
||||||
Max. Text Size : 10
|
Max. Text Size : 10
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
// event,1,tHeading,tEntityName,1,up
|
tSend.txt="event,buttonPress2,"+entn.txt+",down"
|
||||||
//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
|
//send calc crc
|
||||||
btlen tSend.txt,sys0
|
btlen tSend.txt,sys0
|
||||||
crcrest 1,0xffff // reset CRC
|
crcrest 1,0xffff // reset CRC
|
||||||
@@ -425,46 +207,17 @@ Button bDown1
|
|||||||
|
|
||||||
Button bStop1
|
Button bStop1
|
||||||
Attributes
|
Attributes
|
||||||
ID : 14
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
State : unpressed
|
||||||
Text : î
|
Text : î
|
||||||
Max. Text Size : 10
|
Max. Text Size : 10
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
// event,1,tHeading,tEntityName,1,up
|
tSend.txt="event,buttonPress2,"+entn.txt+",stop"
|
||||||
//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
|
//send calc crc
|
||||||
btlen tSend.txt,sys0
|
btlen tSend.txt,sys0
|
||||||
crcrest 1,0xffff // reset CRC
|
crcrest 1,0xffff // reset CRC
|
||||||
@@ -479,46 +232,17 @@ Button bStop1
|
|||||||
|
|
||||||
Button bUp1
|
Button bUp1
|
||||||
Attributes
|
Attributes
|
||||||
ID : 15
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
State : unpressed
|
||||||
Text : î
|
Text : î
|
||||||
Max. Text Size : 10
|
Max. Text Size : 10
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
// event,1,tHeading,tEntityName,1,up
|
tSend.txt="event,buttonPress2,"+entn.txt+",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
|
//send calc crc
|
||||||
btlen tSend.txt,sys0
|
btlen tSend.txt,sys0
|
||||||
crcrest 1,0xffff // reset CRC
|
crcrest 1,0xffff // reset CRC
|
||||||
@@ -533,7 +257,6 @@ Button bUp1
|
|||||||
|
|
||||||
Timer tmSleep
|
Timer tmSleep
|
||||||
Attributes
|
Attributes
|
||||||
ID : 8
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Period (ms): 1000
|
Period (ms): 1000
|
||||||
Enabled : yes
|
Enabled : yes
|
||||||
@@ -547,13 +270,13 @@ Timer tmSleep
|
|||||||
{
|
{
|
||||||
screensaver.originPage.val=dp
|
screensaver.originPage.val=dp
|
||||||
sleepValue=0
|
sleepValue=0
|
||||||
page cardEntities
|
click b0,1
|
||||||
|
click b0,0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Timer tmSerial
|
Timer tmSerial
|
||||||
Attributes
|
Attributes
|
||||||
ID : 9
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Period (ms): 50
|
Period (ms): 50
|
||||||
Enabled : yes
|
Enabled : yes
|
||||||
@@ -615,7 +338,6 @@ Timer tmSerial
|
|||||||
// get value
|
// get value
|
||||||
spstr strCommand.txt,tTmp.txt,",",1
|
spstr strCommand.txt,tTmp.txt,",",1
|
||||||
covx tTmp.txt,dimValue,0,0
|
covx tTmp.txt,dimValue,0,0
|
||||||
dim=dimValue
|
|
||||||
}
|
}
|
||||||
if(tInstruction.txt=="time")
|
if(tInstruction.txt=="time")
|
||||||
{
|
{
|
||||||
@@ -633,6 +355,48 @@ Timer tmSerial
|
|||||||
spstr strCommand.txt,tTmp.txt,",",1
|
spstr strCommand.txt,tTmp.txt,",",1
|
||||||
covx tTmp.txt,sleepTimeout,0,0
|
covx tTmp.txt,sleepTimeout,0,0
|
||||||
}
|
}
|
||||||
|
if(tInstruction.txt=="pageType")
|
||||||
|
{
|
||||||
|
//command format pageType,specialPageName
|
||||||
|
//write name of speical page to tId
|
||||||
|
spstr strCommand.txt,tId.txt,",",1
|
||||||
|
//save second arg if there's one
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",2
|
||||||
|
//save third arg if there's one
|
||||||
|
spstr strCommand.txt,pageIcons.tTmp2.txt,",",3
|
||||||
|
//we are going to exit this page with this command, so we have to clear the buffer, so we are not getting into a stupid loop ...
|
||||||
|
udelete payloadLength-1
|
||||||
|
bufferPos=0
|
||||||
|
if(tId.txt=="popupLight")
|
||||||
|
{
|
||||||
|
pageIcons.tTmp1.txt=tTmp.txt
|
||||||
|
page popupLight
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardEntities")
|
||||||
|
{
|
||||||
|
page cardEntities
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardMedia")
|
||||||
|
{
|
||||||
|
page cardMedia
|
||||||
|
}
|
||||||
|
if(tId.txt=="pageStartup")
|
||||||
|
{
|
||||||
|
page pageStartup
|
||||||
|
}
|
||||||
|
if(tId.txt=="popupNotify")
|
||||||
|
{
|
||||||
|
page popupNotify
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardGrid")
|
||||||
|
{
|
||||||
|
page cardGrid
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardAlarm")
|
||||||
|
{
|
||||||
|
page cardAlarm
|
||||||
|
}
|
||||||
|
}
|
||||||
// end of user code
|
// end of user code
|
||||||
udelete payloadLength-1
|
udelete payloadLength-1
|
||||||
bufferPos=0
|
bufferPos=0
|
||||||
@@ -656,7 +420,6 @@ Timer tmSerial
|
|||||||
|
|
||||||
TouchCap tc0
|
TouchCap tc0
|
||||||
Attributes
|
Attributes
|
||||||
ID : 7
|
|
||||||
Scope: local
|
Scope: local
|
||||||
Value: 0
|
Value: 0
|
||||||
|
|
||||||
|
|||||||
@@ -1,22 +1,14 @@
|
|||||||
Page screensaver
|
Page screensaver
|
||||||
Attributes
|
Attributes
|
||||||
ID : 0
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
Send Component ID : disabled
|
||||||
Opacity : 127
|
|
||||||
Width : 480
|
|
||||||
Effect : load
|
|
||||||
Effect Priority : 0
|
|
||||||
Effect Time : 300
|
|
||||||
Locked : no
|
Locked : no
|
||||||
Swide up page ID : disabled
|
Swide up page ID : disabled
|
||||||
Swide down page ID : disabled
|
Swide down page ID : disabled
|
||||||
Swide left page ID : disabled
|
Swide left page ID : disabled
|
||||||
Swide right page ID : disabled
|
Swide right page ID : disabled
|
||||||
Fill : solid color
|
|
||||||
Back. Color : 0
|
|
||||||
|
|
||||||
Events
|
Events
|
||||||
Preinitialize Event
|
Preinitialize Event
|
||||||
@@ -27,12 +19,26 @@ Page screensaver
|
|||||||
vis tTmp,0
|
vis tTmp,0
|
||||||
vis p0,0
|
vis p0,0
|
||||||
//load gloabl time string from pageIcons
|
//load gloabl time string from pageIcons
|
||||||
tTime.txt=vaTime.txt
|
//tTime.txt=vaTime.txt
|
||||||
|
spstr vaTime.txt,tTime.txt,"?",0
|
||||||
|
spstr vaTime.txt,tAMPM.txt,"?",1
|
||||||
|
if(tAMPM.txt=="")
|
||||||
|
{
|
||||||
|
vis tAMPM,0
|
||||||
|
}
|
||||||
tDate.txt=vaDate.txt
|
tDate.txt=vaDate.txt
|
||||||
dim=dimValue
|
dim=dimValue
|
||||||
vis tSend,0
|
vis tSend,0
|
||||||
//page open event
|
//page open event
|
||||||
// craft command
|
// clear weather elements, to keep example content in HMI
|
||||||
|
tMainIcon.txt=""
|
||||||
|
tMainText.txt=""
|
||||||
|
tForecast1.txt=""
|
||||||
|
tF1Icon.txt=""
|
||||||
|
tForecast1Val.txt=""
|
||||||
|
tForecast2.txt=""
|
||||||
|
tF2Icon.txt=""
|
||||||
|
tForecast2Val.txt=""
|
||||||
tSend.txt="event,screensaverOpen"
|
tSend.txt="event,screensaverOpen"
|
||||||
//send calc crc
|
//send calc crc
|
||||||
btlen tSend.txt,sys0
|
btlen tSend.txt,sys0
|
||||||
@@ -45,576 +51,264 @@ Page screensaver
|
|||||||
prints sys0,2
|
prints sys0,2
|
||||||
prints tSend.txt,0
|
prints tSend.txt,0
|
||||||
prints crcval,2
|
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
|
Variable (string) strCommand
|
||||||
Attributes
|
Attributes
|
||||||
ID : 5
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Text :
|
Text :
|
||||||
Max. Text Size: 100
|
Max. Text Size: 200
|
||||||
|
|
||||||
Variable (string) vaTime
|
Variable (string) vaTime
|
||||||
Attributes
|
Attributes
|
||||||
ID : 10
|
|
||||||
Scope : global
|
Scope : global
|
||||||
Text :
|
Text :
|
||||||
Max. Text Size: 10
|
Max. Text Size: 15
|
||||||
|
|
||||||
Variable (string) vaDate
|
Variable (string) vaDate
|
||||||
Attributes
|
Attributes
|
||||||
ID : 11
|
|
||||||
Scope : global
|
Scope : global
|
||||||
Text :
|
Text :
|
||||||
Max. Text Size: 30
|
Max. Text Size: 30
|
||||||
|
|
||||||
Variable (string) tId
|
Variable (string) tId
|
||||||
Attributes
|
Attributes
|
||||||
ID : 24
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Text :
|
Text :
|
||||||
Max. Text Size: 25
|
Max. Text Size: 25
|
||||||
|
|
||||||
|
Variable (int32) vaTap
|
||||||
|
Attributes
|
||||||
|
Scope: local
|
||||||
|
Value: 0
|
||||||
|
|
||||||
Number originPage
|
Number originPage
|
||||||
Attributes
|
Attributes
|
||||||
ID : 3
|
|
||||||
Scope : global
|
Scope : global
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Associated Keyboard : none
|
||||||
Font ID : 0
|
|
||||||
Back. Color : 65535
|
|
||||||
Font Color : 0
|
|
||||||
Horizontal Alignment : center
|
|
||||||
Vertical Alignment : center
|
|
||||||
Value : 0
|
Value : 0
|
||||||
Significant digits shown : all
|
|
||||||
Format : decimal
|
|
||||||
Word wrap : enabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Text tInstruction
|
Text tInstruction
|
||||||
Attributes
|
Attributes
|
||||||
ID : 6
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Associated Keyboard : none
|
||||||
Font ID : 0
|
|
||||||
Back. Color : 65535
|
|
||||||
Font Color : 0
|
|
||||||
Horizontal Alignment : center
|
|
||||||
Vertical Alignment : center
|
|
||||||
Input Type : character
|
|
||||||
Text :
|
Text :
|
||||||
Max. Text Size : 20
|
Max. Text Size : 50
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Text tTmp
|
Text tTmp
|
||||||
Attributes
|
Attributes
|
||||||
ID : 7
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Associated Keyboard : none
|
||||||
Font ID : 0
|
|
||||||
Back. Color : 65535
|
|
||||||
Font Color : 0
|
|
||||||
Horizontal Alignment : center
|
|
||||||
Vertical Alignment : center
|
|
||||||
Input Type : character
|
|
||||||
Text :
|
Text :
|
||||||
Max. Text Size : 20
|
Max. Text Size : 50
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Text tTime
|
Text tTime
|
||||||
Attributes
|
Attributes
|
||||||
ID : 8
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Associated Keyboard : none
|
||||||
Font ID : 6
|
Text : 21:32
|
||||||
Back. Color : 0
|
Max. Text Size : 15
|
||||||
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
|
Text tDate
|
||||||
Attributes
|
Attributes
|
||||||
ID : 9
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
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
|
Text : Tuesday, 08. March 2022
|
||||||
Max. Text Size : 30
|
Max. Text Size : 30
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Text tSend
|
Text tSend
|
||||||
Attributes
|
Attributes
|
||||||
ID : 12
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Associated Keyboard : none
|
||||||
Font ID : 0
|
|
||||||
Back. Color : 65535
|
|
||||||
Font Color : 0
|
|
||||||
Horizontal Alignment : center
|
|
||||||
Vertical Alignment : center
|
|
||||||
Input Type : character
|
|
||||||
Text :
|
Text :
|
||||||
Max. Text Size : 25
|
Max. Text Size : 50
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Text tMainIcon
|
Text tMainIcon
|
||||||
Attributes
|
Attributes
|
||||||
ID : 13
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Associated Keyboard : none
|
||||||
Font ID : 4
|
|
||||||
Back. Color : 0
|
|
||||||
Font Color : 65535
|
|
||||||
Horizontal Alignment : center
|
|
||||||
Vertical Alignment : center
|
|
||||||
Input Type : character
|
|
||||||
Text : î
|
Text : î
|
||||||
Max. Text Size : 10
|
Max. Text Size : 10
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Text tMainText
|
Text tMainText
|
||||||
Attributes
|
Attributes
|
||||||
ID : 14
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
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
|
Text : 2,3 °C
|
||||||
Max. Text Size : 10
|
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
|
Text tForecast1
|
||||||
Attributes
|
Attributes
|
||||||
ID : 17
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Associated Keyboard : none
|
||||||
Font ID : 0
|
|
||||||
Back. Color : 0
|
|
||||||
Font Color : 65535
|
|
||||||
Horizontal Alignment : center
|
|
||||||
Vertical Alignment : center
|
|
||||||
Input Type : character
|
|
||||||
Text : Mi
|
Text : Mi
|
||||||
Max. Text Size : 10
|
Max. Text Size : 10
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Text tForecast1Val
|
Text tForecast1Val
|
||||||
Attributes
|
Attributes
|
||||||
ID : 18
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
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
|
Text : 9,3 °C
|
||||||
Max. Text Size : 10
|
Max. Text Size : 10
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Text tF1Icon
|
Text tF1Icon
|
||||||
Attributes
|
Attributes
|
||||||
ID : 19
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Associated Keyboard : none
|
||||||
Font ID : 1
|
|
||||||
Back. Color : 0
|
|
||||||
Font Color : 65535
|
|
||||||
Horizontal Alignment : center
|
|
||||||
Vertical Alignment : center
|
|
||||||
Input Type : character
|
|
||||||
Text : î
|
Text : î
|
||||||
Max. Text Size : 10
|
Max. Text Size : 10
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Text tForecast2
|
Text tForecast2
|
||||||
Attributes
|
Attributes
|
||||||
ID : 20
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Associated Keyboard : none
|
||||||
Font ID : 0
|
|
||||||
Back. Color : 0
|
|
||||||
Font Color : 65535
|
|
||||||
Horizontal Alignment : center
|
|
||||||
Vertical Alignment : center
|
|
||||||
Input Type : character
|
|
||||||
Text : Do
|
Text : Do
|
||||||
Max. Text Size : 10
|
Max. Text Size : 10
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Text tF2Icon
|
Text tF2Icon
|
||||||
Attributes
|
Attributes
|
||||||
ID : 21
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Associated Keyboard : none
|
||||||
Font ID : 1
|
|
||||||
Back. Color : 0
|
|
||||||
Font Color : 65535
|
|
||||||
Horizontal Alignment : center
|
|
||||||
Vertical Alignment : center
|
|
||||||
Input Type : character
|
|
||||||
Text : î
|
Text : î
|
||||||
Max. Text Size : 10
|
Max. Text Size : 10
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Text tForecast2Val
|
Text tForecast2Val
|
||||||
Attributes
|
Attributes
|
||||||
ID : 22
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
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
|
Text : 11,9 °C
|
||||||
Max. Text Size : 10
|
Max. Text Size : 10
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
|
||||||
Vertical Spacing : 0
|
|
||||||
|
|
||||||
Text t10
|
Text t10
|
||||||
Attributes
|
Attributes
|
||||||
ID : 23
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Associated Keyboard : none
|
||||||
Font ID : 0
|
|
||||||
Back. Color : 65535
|
|
||||||
Font Color : 0
|
|
||||||
Horizontal Alignment : center
|
|
||||||
Vertical Alignment : center
|
|
||||||
Input Type : character
|
|
||||||
Text : |
|
Text : |
|
||||||
Max. Text Size : 10
|
Max. Text Size : 10
|
||||||
Word wrap : disabled
|
|
||||||
Horizontal Spacing : 0
|
Text tAMPM
|
||||||
Vertical Spacing : 0
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text : PM
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Text tForecast3Val
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Text tF3Icon
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Text tForecast3
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Text tForecast4
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Text tF4Icon
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
|
Text tForecast4Val
|
||||||
|
Attributes
|
||||||
|
Scope : local
|
||||||
|
Dragging : 0
|
||||||
|
Disable release event after dragging: 0
|
||||||
|
Send Component ID : disabled
|
||||||
|
Associated Keyboard : none
|
||||||
|
Text :
|
||||||
|
Max. Text Size : 10
|
||||||
|
|
||||||
Picture p0
|
Picture p0
|
||||||
Attributes
|
Attributes
|
||||||
ID : 1
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
Timer tmSerial
|
||||||
Attributes
|
Attributes
|
||||||
ID : 4
|
|
||||||
Scope : local
|
Scope : local
|
||||||
Period (ms): 50
|
Period (ms): 50
|
||||||
Enabled : yes
|
Enabled : yes
|
||||||
@@ -666,8 +360,8 @@ Timer tmSerial
|
|||||||
spstr strCommand.txt,tInstruction.txt,",",0
|
spstr strCommand.txt,tInstruction.txt,",",0
|
||||||
if(tInstruction.txt=="wake")
|
if(tInstruction.txt=="wake")
|
||||||
{
|
{
|
||||||
dim=100
|
//dim=100
|
||||||
page originPage.val
|
click tc0,1
|
||||||
}
|
}
|
||||||
if(tInstruction.txt=="dimmode")
|
if(tInstruction.txt=="dimmode")
|
||||||
{
|
{
|
||||||
@@ -680,7 +374,12 @@ Timer tmSerial
|
|||||||
{
|
{
|
||||||
//get set time to global variable
|
//get set time to global variable
|
||||||
spstr strCommand.txt,vaTime.txt,",",1
|
spstr strCommand.txt,vaTime.txt,",",1
|
||||||
tTime.txt=vaTime.txt
|
spstr vaTime.txt,tTime.txt,"?",0
|
||||||
|
spstr vaTime.txt,tAMPM.txt,"?",1
|
||||||
|
if(tAMPM.txt=="")
|
||||||
|
{
|
||||||
|
vis tAMPM,0
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(tInstruction.txt=="date")
|
if(tInstruction.txt=="date")
|
||||||
{
|
{
|
||||||
@@ -702,36 +401,49 @@ Timer tmSerial
|
|||||||
substr pageIcons.tIcons.txt,tMainIcon.txt,sys0,1
|
substr pageIcons.tIcons.txt,tMainIcon.txt,sys0,1
|
||||||
//tMainText
|
//tMainText
|
||||||
spstr strCommand.txt,tMainText.txt,"?",2
|
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
|
//tForecast1
|
||||||
spstr strCommand.txt,tForecast1.txt,"?",5
|
spstr strCommand.txt,tForecast1.txt,"?",3
|
||||||
//tF1Icon
|
//tF1Icon
|
||||||
spstr strCommand.txt,tTmp.txt,"?",6
|
spstr strCommand.txt,tTmp.txt,"?",4
|
||||||
covx tTmp.txt,sys0,0,0
|
covx tTmp.txt,sys0,0,0
|
||||||
substr pageIcons.tIcons.txt,tF1Icon.txt,sys0,1
|
substr pageIcons.tIcons.txt,tF1Icon.txt,sys0,1
|
||||||
//tForecast1Val
|
//tForecast1Val
|
||||||
spstr strCommand.txt,tForecast1Val.txt,"?",7
|
spstr strCommand.txt,tForecast1Val.txt,"?",5
|
||||||
//tForecast2
|
//tForecast2
|
||||||
spstr strCommand.txt,tForecast2.txt,"?",8
|
spstr strCommand.txt,tForecast2.txt,"?",6
|
||||||
//tF2Icon
|
//tF2Icon
|
||||||
spstr strCommand.txt,tTmp.txt,"?",9
|
spstr strCommand.txt,tTmp.txt,"?",7
|
||||||
covx tTmp.txt,sys0,0,0
|
covx tTmp.txt,sys0,0,0
|
||||||
substr pageIcons.tIcons.txt,tF2Icon.txt,sys0,1
|
substr pageIcons.tIcons.txt,tF2Icon.txt,sys0,1
|
||||||
//tForecast2Val
|
//tForecast2Val
|
||||||
spstr strCommand.txt,tForecast2Val.txt,"?",10
|
spstr strCommand.txt,tForecast2Val.txt,"?",8
|
||||||
|
//tForecast3
|
||||||
|
spstr strCommand.txt,tForecast3.txt,"?",9
|
||||||
|
//tF3Icon
|
||||||
|
spstr strCommand.txt,tTmp.txt,"?",10
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
substr pageIcons.tIcons.txt,tF3Icon.txt,sys0,1
|
||||||
|
//tForecast3Val
|
||||||
|
spstr strCommand.txt,tForecast3Val.txt,"?",11
|
||||||
|
//tForecast4
|
||||||
|
spstr strCommand.txt,tForecast4.txt,"?",12
|
||||||
|
//tF4Icon
|
||||||
|
spstr strCommand.txt,tTmp.txt,"?",13
|
||||||
|
covx tTmp.txt,sys0,0,0
|
||||||
|
substr pageIcons.tIcons.txt,tF4Icon.txt,sys0,1
|
||||||
|
//tForecast4Val
|
||||||
|
spstr strCommand.txt,tForecast4Val.txt,"?",14
|
||||||
}
|
}
|
||||||
if(tInstruction.txt=="pageType")
|
if(tInstruction.txt=="pageType")
|
||||||
{
|
{
|
||||||
|
dim=100
|
||||||
//command format pageType,specialPageName
|
//command format pageType,specialPageName
|
||||||
//write name of speical page to tId
|
//write name of speical page to tId
|
||||||
spstr strCommand.txt,tId.txt,",",1
|
spstr strCommand.txt,tId.txt,",",1
|
||||||
//save second arg if there's one
|
//save second arg if there's one
|
||||||
spstr strCommand.txt,tTmp.txt,",",2
|
spstr strCommand.txt,tTmp.txt,",",2
|
||||||
|
//save third arg if there's one
|
||||||
|
spstr strCommand.txt,pageIcons.tTmp2.txt,",",3
|
||||||
//we are going to exit this page with this command, so we have to clear the buffer, so we are not getting into a stupid loop ...
|
//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
|
udelete u[2]+3
|
||||||
bufferPos=0
|
bufferPos=0
|
||||||
@@ -756,10 +468,22 @@ Timer tmSerial
|
|||||||
{
|
{
|
||||||
page pageStartup
|
page pageStartup
|
||||||
}
|
}
|
||||||
if(tId.txt=="pageNotify")
|
if(tId.txt=="popupNotify")
|
||||||
{
|
{
|
||||||
page popupNotify
|
page popupNotify
|
||||||
}
|
}
|
||||||
|
if(tId.txt=="cardGrid")
|
||||||
|
{
|
||||||
|
page cardGrid
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardEntities")
|
||||||
|
{
|
||||||
|
page cardEntities
|
||||||
|
}
|
||||||
|
if(tId.txt=="cardAlarm")
|
||||||
|
{
|
||||||
|
page cardAlarm
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// end of user code
|
// end of user code
|
||||||
udelete payloadLength-1
|
udelete payloadLength-1
|
||||||
@@ -775,12 +499,26 @@ Timer tmSerial
|
|||||||
|
|
||||||
TouchCap tc0
|
TouchCap tc0
|
||||||
Attributes
|
Attributes
|
||||||
ID : 2
|
|
||||||
Scope: local
|
Scope: local
|
||||||
Value: 0
|
Value: 0
|
||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
dim=100
|
dim=100
|
||||||
page originPage.val
|
vaTap.val+=1
|
||||||
|
covx vaTap.val,tTmp.txt,0,0
|
||||||
|
tSend.txt="event,buttonPress2,screensaver,bExit,"+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
|
||||||
|
//dim=100
|
||||||
|
//page originPage.val
|
||||||
|
|
||||||
|
|||||||
BIN
HMI/nspanel.HMI
BIN
HMI/nspanel.HMI
Binary file not shown.
BIN
HMI/nspanel.tft
BIN
HMI/nspanel.tft
Binary file not shown.
138
README.md
138
README.md
@@ -9,10 +9,12 @@ NsPanel Lovelace UI is a Firmware for the nextion screen inside of NSPanel in th
|
|||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- Entities Page with support for cover, switch, input_boolean, sensor, button, input_button and light
|
- Entities Page with support for cover, switch, input_boolean, binary_sensor, sensor, button, scenes, input_button and light
|
||||||
- Detail Pages for Lights (Brightness and Temperature of the Light) and for Covers (Position)
|
- Grid Page with support for cover, switch, input_boolean, button, scenes, and light
|
||||||
|
- Detail Pages for Lights (Brightness, Temperature and Color of the Light) and for Covers (Position)
|
||||||
- Thermostat Page
|
- Thermostat Page
|
||||||
- Media Player Card
|
- Media Player Card
|
||||||
|
- Alarm Control Panel
|
||||||
- Screensaver Page with Time, Date and Weather Information
|
- Screensaver Page with Time, Date and Weather Information
|
||||||
|
|
||||||
It works with [Tasmota](https://tasmota.github.io/docs/) and MQTT.
|
It works with [Tasmota](https://tasmota.github.io/docs/) and MQTT.
|
||||||
@@ -33,7 +35,7 @@ For more detailed Instructions see the following Sections:
|
|||||||
- [How It Works](#how-it-works)
|
- [How It Works](#how-it-works)
|
||||||
- [Requirements](#requirements)
|
- [Requirements](#requirements)
|
||||||
|
|
||||||
- [Installation - Home Automation Part](#installation---home-automation-part)
|
- [Installation - Home Automation Part (Homeassistant)](#installation---home-automation-part-home-assistant)
|
||||||
- [Installing AppDaemon](#installing-appdaemon)
|
- [Installing AppDaemon](#installing-appdaemon)
|
||||||
- [Installing Studio Code Server (optional, recommended)](#installing-studio-code-server-optional-recommended)
|
- [Installing Studio Code Server (optional, recommended)](#installing-studio-code-server-optional-recommended)
|
||||||
- [Installing HACS (optional, recommended)](#installing-hacs-optional-recommended)
|
- [Installing HACS (optional, recommended)](#installing-hacs-optional-recommended)
|
||||||
@@ -42,6 +44,8 @@ For more detailed Instructions see the following Sections:
|
|||||||
- [Manually](#manually)
|
- [Manually](#manually)
|
||||||
- [Installing Tasmota to your NSPanel](#installing---tasmota-to-your-nspanel)
|
- [Installing Tasmota to your NSPanel](#installing---tasmota-to-your-nspanel)
|
||||||
|
|
||||||
|
- [Installation - Home Automation Part (IoBroker)](#installation---home-automation-part-iobroker)
|
||||||
|
|
||||||
- [Installation - NSPanel Part](#installation-nspanel-part)
|
- [Installation - NSPanel Part](#installation-nspanel-part)
|
||||||
- [Flash Tasmota to your NSPanel](#flash-tasmota-to-your-nspanel)
|
- [Flash Tasmota to your NSPanel](#flash-tasmota-to-your-nspanel)
|
||||||
- [Configure Tasmota Template for NSPanel](#configure-tasmota-template-for-nspanel)
|
- [Configure Tasmota Template for NSPanel](#configure-tasmota-template-for-nspanel)
|
||||||
@@ -71,9 +75,7 @@ For more details on how the display firmware works see the [README File in the H
|
|||||||
- Running [Home Assistant Instance](https://www.home-assistant.io/installation/)
|
- Running [Home Assistant Instance](https://www.home-assistant.io/installation/)
|
||||||
- Installed [MQTT Broker](https://www.home-assistant.io/docs/mqtt/broker) alongside Homeassistant
|
- Installed [MQTT Broker](https://www.home-assistant.io/docs/mqtt/broker) alongside Homeassistant
|
||||||
|
|
||||||
## Installation - Home Automation Part
|
## Installation - Home Automation Part (Home Assistant)
|
||||||
|
|
||||||
### Installing Home Assistant
|
|
||||||
|
|
||||||
### Installing AppDaemon
|
### Installing AppDaemon
|
||||||
|
|
||||||
@@ -84,6 +86,13 @@ The easiest way to install it is through Home Assistant's Supervisor Add-on Stor
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
#### Add babel package to AppDaemon Container (Optional)
|
||||||
|
|
||||||
|
For localisation (date in your local language) you need to add the python package babel to your AppDaemon Installation.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
### Installing Studio Code Server (optional, recommended)
|
### Installing Studio Code Server (optional, recommended)
|
||||||
|
|
||||||
You will need a way to edit the `apps.yaml` config file in the Appdaemon folder.
|
You will need a way to edit the `apps.yaml` config file in the Appdaemon folder.
|
||||||
@@ -136,6 +145,11 @@ Installing the Backend Application manually can be summarized by putting the con
|
|||||||
directory of your AppDaemon installation.
|
directory of your AppDaemon installation.
|
||||||
|
|
||||||
|
|
||||||
|
## Installation - Home Automation Part (IoBroker)
|
||||||
|
|
||||||
|
If you are looking for an ioBroker Integration instead of HomeAssistant take a look into the [Readme](ioBroker/README.md) of the iobroker folder.
|
||||||
|
Thanks to [britzelpuf](https://github.com/britzelpuf) for this integration.
|
||||||
|
|
||||||
## Installation - NSPanel Part
|
## Installation - NSPanel Part
|
||||||
|
|
||||||
This section describes how to free your nspanel from stock firmware and get it ready for Lovelace UI 🎉
|
This section describes how to free your nspanel from stock firmware and get it ready for Lovelace UI 🎉
|
||||||
@@ -179,8 +193,6 @@ See Tasmota [MQTT Documentation](https://tasmota.github.io/docs/MQTT/) for more
|
|||||||
|
|
||||||
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))
|
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 must be HTTP, HTTPS is not supported, due to limitations of berry lang on tasmota**
|
**Webserver must be HTTP, HTTPS is not supported, due to limitations of berry lang on tasmota**
|
||||||
|
|
||||||
`FlashNextion http://ip-address-of-your-homeassistant:8123/local/nspanel.tft`
|
`FlashNextion http://ip-address-of-your-homeassistant:8123/local/nspanel.tft`
|
||||||
@@ -191,7 +203,7 @@ Due the limitations of Berry, it's not possible to download the tft file directl
|
|||||||
|
|
||||||
The following Link has always the latest version from this repository, just execute the following Command in Tasmota:
|
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`
|
`FlashNextion http://nspanel.pky.eu/lui-release.tft`
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
@@ -233,13 +245,14 @@ Confiure your NSPanel as you like, you need to edit the `apps.yaml` inside of yo
|
|||||||
You can have multiple nspanel sections.
|
You can have multiple nspanel sections.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
|
---
|
||||||
nspanel-1:
|
nspanel-1:
|
||||||
module: nspanel-lovelace-ui
|
module: nspanel-lovelace-ui
|
||||||
class: NsPanelLovelaceUIManager
|
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"
|
||||||
timeoutScreensaver: 15 #in seconds, values between 5 and 60 are allowed
|
timeoutScreensaver: 20
|
||||||
#brightnessScreensaver: 10
|
#brightnessScreensaver: 10
|
||||||
brightnessScreensaver:
|
brightnessScreensaver:
|
||||||
- time: "7:00:00"
|
- time: "7:00:00"
|
||||||
@@ -247,9 +260,10 @@ nspanel-1:
|
|||||||
- time: "23:00:00"
|
- time: "23:00:00"
|
||||||
value: 0
|
value: 0
|
||||||
locale: "de_DE"
|
locale: "de_DE"
|
||||||
|
dateFormatBabel: "full"
|
||||||
timeFormat: "%H:%M"
|
timeFormat: "%H:%M"
|
||||||
dateFormat: "%A, %d. %B %Y"
|
dateFormat: "%A, %d. %B %Y" # ignored if babel python package is installed
|
||||||
weatherEntity: weather.example
|
weather: weather.example
|
||||||
pages:
|
pages:
|
||||||
- type: cardEntities
|
- type: cardEntities
|
||||||
heading: Example Page 1
|
heading: Example Page 1
|
||||||
@@ -264,20 +278,30 @@ nspanel-1:
|
|||||||
- button.example_button
|
- button.example_button
|
||||||
- input_button.example_input_button
|
- input_button.example_input_button
|
||||||
- light.light_example
|
- light.light_example
|
||||||
- delete # To make sure we don't keep buttons from previous page (read this as 'empty')
|
- delete # (read this as 'empty')
|
||||||
- type: cardEntities
|
- type: cardEntities
|
||||||
heading: Example Page 3
|
heading: Example Page 3
|
||||||
items:
|
items:
|
||||||
- scene.some_scene
|
- scene.example_scene
|
||||||
- scene.moodlights
|
|
||||||
- delete
|
- delete
|
||||||
- delete
|
- delete
|
||||||
|
- delete
|
||||||
|
- type: cardGrid
|
||||||
|
heading: Example Page 4
|
||||||
|
items:
|
||||||
|
- light.light_example
|
||||||
|
- button.example_button
|
||||||
|
- cover.example_cover
|
||||||
|
- scene.example_scene
|
||||||
|
- switch.example_switch
|
||||||
|
- delete
|
||||||
- type: cardThermo
|
- type: cardThermo
|
||||||
heading: Exmaple Thermostat
|
heading: Exmaple Thermostat
|
||||||
item: climate.example_climate
|
item: climate.example_climate
|
||||||
- type: cardMedia
|
- type: cardMedia
|
||||||
heading: Exampe Media
|
|
||||||
item: media_player.spotify_user
|
item: media_player.spotify_user
|
||||||
|
- type: cardAlarm
|
||||||
|
item: alarm_control_panel.alarmo
|
||||||
```
|
```
|
||||||
|
|
||||||
key | optional | type | default | description
|
key | optional | type | default | description
|
||||||
@@ -286,6 +310,58 @@ 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
|
||||||
|
|
||||||
|
Possible configuration values for config key:
|
||||||
|
|
||||||
|
key | optional | type | default | description
|
||||||
|
-- | -- | -- | -- | --
|
||||||
|
`panelRecvTopic` | False | string | `tele/tasmota_your_mqtt_topic/RESULT` | The mqtt topic used to receive messages.
|
||||||
|
`panelSendTopic` | False | string | `cmnd/tasmota_your_mqtt_topic/CustomSend` | The mqtt topic used to send messages.
|
||||||
|
`timeoutScreensaver` | True | integer | `20` | Timeout for the screen to enter screensaver, to disable screensaver use 0
|
||||||
|
`brightnessScreensaver` | True | integer/complex | `20` | Brightness for the screen to enter screensaver, see example below for complex/scheduled config.
|
||||||
|
`brightnessScreensaverTracking` | True | string | None | Forces screensaver brightness to 0 in case entity state is not_home, can be a group, person or device_tracker entity.
|
||||||
|
`locale` | True | string | `en_US` | Used by babel to determinante Date format on screensaver, also used for localization.
|
||||||
|
`dateFormatBabel` | True | string | `full` | formatting options on https://babel.pocoo.org/en/latest/dates.html?highlight=name%20of%20day#date-fields
|
||||||
|
`timeFormat` | True | string | `%H:%M` | Time Format on screensaver. Substring after `?` is displayed in a seperate smaller textbox. Useful for 12h time format with AM/PM `"%I:%M ?%p"`
|
||||||
|
`dateFormat` | True | string | `%A, %d. %B %Y` | date format used if babel is not installed
|
||||||
|
`weather` | True | string | `weather.example` | weather entity from homeassistant
|
||||||
|
`weatherOverrideForecast1` | True | string | `None` | sensor entity from home assistant here to override the first weather forecast item on the screensaver
|
||||||
|
`weatherOverrideForecast2` | True | string | `None` | sensor entity from home assistant here to override the second weather forecast item on the screensaver
|
||||||
|
`weatherOverrideForecast3` | True | string | `None` | sensor entity from home assistant here to override the third weather forecast item on the screensaver
|
||||||
|
`weatherOverrideForecast4` | True | string | `None` | sensor entity from home assistant here to override the forth weather forecast item on the screensaver
|
||||||
|
`doubleTapToUnlock` | True | boolean | `False` | requires to tap screensaver two times
|
||||||
|
`pages` | False | complex | | configuration for pages on panel
|
||||||
|
|
||||||
|
#### Schedule screensaver brightness
|
||||||
|
|
||||||
|
It is possible to schedule a brightness change for the screen at specific times.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
brightnessScreensaver:
|
||||||
|
- time: "7:00:00"
|
||||||
|
value: 10
|
||||||
|
- time: "23:00:00"
|
||||||
|
value: 0
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Override Icons or Names
|
||||||
|
|
||||||
|
To override Icons or Names of entities you can configure an icon and/or name in your configuration, please see the following example.
|
||||||
|
Only the icons listed in the [Icon Table](HMI#icons-ids) are useable.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- type: cardGrid
|
||||||
|
heading: Lights
|
||||||
|
items:
|
||||||
|
- light.wled
|
||||||
|
- light.schreibtischlampe
|
||||||
|
- switch.deckenbeleuchtung_hinten:
|
||||||
|
icon: lightbulb
|
||||||
|
name: Lampe
|
||||||
|
- delete
|
||||||
|
- delete
|
||||||
|
- type: cardMedia
|
||||||
|
```
|
||||||
|
|
||||||
## How to update
|
## How to update
|
||||||
|
|
||||||
Updating involves mainly already descriped steps from installation, so this is a short summary.
|
Updating involves mainly already descriped steps from installation, so this is a short summary.
|
||||||
@@ -301,13 +377,9 @@ HACS will show you that there is an update avalible and ask you to update.
|
|||||||
|
|
||||||
### Update Display Firmware
|
### 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.
|
Use the following command to update or use your own webserver.
|
||||||
|
|
||||||
`FlashNextionFast http://nspanel.pky.eu/lui.tft`
|
`FlashNextion http://nspanel.pky.eu/lui-release.tft`
|
||||||
|
|
||||||
In case this Update failes, reboot tasmota and use the following command:
|
|
||||||
|
|
||||||
`FlashNextion http://nspanel.pky.eu/lui.tft`
|
|
||||||
|
|
||||||
### Update Tasmota Berry Driver
|
### Update Tasmota Berry Driver
|
||||||
|
|
||||||
@@ -322,8 +394,7 @@ Since release 1.1 you can update the berry driver directly from the Tasmota Cons
|
|||||||
### Flashing of the Display Firmware with FlashNextion doesn't work
|
### Flashing of the Display Firmware with FlashNextion doesn't work
|
||||||
|
|
||||||
1. Make sure to use the [tasmota32-nspanel.bin](https://github.com/tasmota/install/raw/main/firmware/unofficial/tasmota32-nspanel.bin) Tasmota build.
|
1. Make sure to use the [tasmota32-nspanel.bin](https://github.com/tasmota/install/raw/main/firmware/unofficial/tasmota32-nspanel.bin) Tasmota build.
|
||||||
2. Make sure to use an WebServer which supports http range requests like HomeAssistant, apache2 or nginx for exmaple.
|
2. Make sure to use HTTP and **not HTTPS**
|
||||||
3. Make sure to use HTTP and **not HTTPS**
|
|
||||||
|
|
||||||
### My flashing doesn't start at all
|
### My flashing doesn't start at all
|
||||||
|
|
||||||
@@ -337,4 +408,23 @@ Reboot Tasmota and try to flash it a second time.
|
|||||||
|
|
||||||
Please check your MQTT Topics in your apps.yaml and your mqtt configuration on tasmota.
|
Please check your MQTT Topics in your apps.yaml and your mqtt configuration on tasmota.
|
||||||
|
|
||||||
|
### How to upgrade from a release to the current development version
|
||||||
|
|
||||||
|
1. Update App in HACS to main
|
||||||
|
|
||||||
|
Click redownload in the menu of the app in HACS.
|
||||||
|
|
||||||
|
Select main version.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
**Wait for it to load, dropdown needs to be selectable again**
|
||||||
|
|
||||||
|
Click download.
|
||||||
|
|
||||||
|
2. Restart AppDaemon
|
||||||
|
|
||||||
|
3. Flash current Development Firmware in Tasmota Console.
|
||||||
|
|
||||||
|
`FlashNextion http://nspanel.pky.eu/lui.tft`
|
||||||
|
|
||||||
|
|||||||
@@ -1,21 +1,24 @@
|
|||||||
---
|
---
|
||||||
nspanel:
|
nspanel-1:
|
||||||
module: nspanel-lovelace-ui
|
module: nspanel-lovelace-ui
|
||||||
class: NsPanelLovelaceUIManager
|
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"
|
||||||
timeoutScreensaver: 15 #in seconds, values between 5 and 60 are allowed
|
updateMode: "auto-notify"
|
||||||
|
timeoutScreensaver: 20
|
||||||
#brightnessScreensaver: 10
|
#brightnessScreensaver: 10
|
||||||
brightnessScreensaver:
|
brightnessScreensaver:
|
||||||
- time: "7:00:00"
|
- time: "7:00:00"
|
||||||
value: 10
|
value: 10
|
||||||
- time: "23:00:00"
|
- time: "23:00:00"
|
||||||
value: 0
|
value: 0
|
||||||
locale: "de_DE"
|
locale: "de_DE" # only used if babel python package is installed
|
||||||
|
dateFormatBabel: "full" # only used if babel python package is installed
|
||||||
|
# formatting options on https://babel.pocoo.org/en/latest/dates.html?highlight=name%20of%20day#date-fields
|
||||||
timeFormat: "%H:%M"
|
timeFormat: "%H:%M"
|
||||||
dateFormat: "%A, %d. %B %Y"
|
dateFormat: "%A, %d. %B %Y" # ignored if babel python package is installed
|
||||||
weatherEntity: weather.example
|
weather: weather.example
|
||||||
pages:
|
pages:
|
||||||
- type: cardEntities
|
- type: cardEntities
|
||||||
heading: Example Page 1
|
heading: Example Page 1
|
||||||
@@ -30,18 +33,27 @@ nspanel:
|
|||||||
- button.example_button
|
- button.example_button
|
||||||
- input_button.example_input_button
|
- input_button.example_input_button
|
||||||
- light.light_example
|
- light.light_example
|
||||||
- delete # To make sure we don't keep buttons from previous page (read this as 'empty')
|
- delete # (read this as 'empty')
|
||||||
- type: cardEntities
|
- type: cardEntities
|
||||||
heading: Example Page 3
|
heading: Example Page 3
|
||||||
items:
|
items:
|
||||||
- scene.some_scene
|
- scene.example_scene
|
||||||
- scene.moodlights
|
|
||||||
- delete
|
- delete
|
||||||
- delete
|
- delete
|
||||||
|
- delete
|
||||||
|
- type: cardGrid
|
||||||
|
heading: Example Page 4
|
||||||
|
items:
|
||||||
|
- light.light_example
|
||||||
|
- button.example_button
|
||||||
|
- cover.example_cover
|
||||||
|
- scene.example_scene
|
||||||
|
- switch.example_switch
|
||||||
|
- delete
|
||||||
- type: cardThermo
|
- type: cardThermo
|
||||||
heading: Exmaple Thermostat
|
heading: Exmaple Thermostat
|
||||||
item: climate.example_climate
|
item: climate.example_climate
|
||||||
- type: cardMedia
|
- type: cardMedia
|
||||||
heading: Exampe Media
|
|
||||||
item: media_player.spotify_user
|
item: media_player.spotify_user
|
||||||
|
- type: cardAlarm
|
||||||
|
item: alarm_control_panel.alarmo
|
||||||
160
apps/nspanel-lovelace-ui/luibackend/config.py
Normal file
160
apps/nspanel-lovelace-ui/luibackend/config.py
Normal file
@@ -0,0 +1,160 @@
|
|||||||
|
import logging
|
||||||
|
|
||||||
|
LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
class PageNode(object):
|
||||||
|
def __init__(self, data, parent=None):
|
||||||
|
self.data = data
|
||||||
|
self.name = None
|
||||||
|
self.childs = []
|
||||||
|
self.parent = parent
|
||||||
|
self.pos = None
|
||||||
|
|
||||||
|
if "items" in data:
|
||||||
|
childs = data.pop("items")
|
||||||
|
for page in childs:
|
||||||
|
self.add_child(PageNode(page, self))
|
||||||
|
|
||||||
|
name = self.data.get("heading", "unkown") if type(self.data) is dict else self.data
|
||||||
|
ptype = self.data.get("type", "unkown") if type(self.data) is dict else "leaf"
|
||||||
|
|
||||||
|
self.name = f"{ptype}.{name}" if type(self.data) is dict else self.data
|
||||||
|
self.name = self.name.replace(".","_")
|
||||||
|
self.name = self.name.replace(",","_")
|
||||||
|
self.name = self.name.replace(" ","_")
|
||||||
|
|
||||||
|
def add_child(self, obj):
|
||||||
|
obj.pos = len(self.childs)
|
||||||
|
self.childs.append(obj)
|
||||||
|
|
||||||
|
def next(self):
|
||||||
|
if self.parent is not None:
|
||||||
|
pos = self.pos
|
||||||
|
length = len(self.parent.childs)
|
||||||
|
return self.parent.childs[(pos+1)%length]
|
||||||
|
else:
|
||||||
|
return self
|
||||||
|
def prev(self):
|
||||||
|
if self.parent is not None:
|
||||||
|
pos = self.pos
|
||||||
|
length = len(self.parent.childs)
|
||||||
|
return self.parent.childs[(pos-1)%length]
|
||||||
|
else:
|
||||||
|
return self
|
||||||
|
|
||||||
|
def search_page_by_name(self, name):
|
||||||
|
name = name.replace("navigate.", "")
|
||||||
|
pages = []
|
||||||
|
for i in self.childs:
|
||||||
|
# compare name of current page
|
||||||
|
if i.name == name:
|
||||||
|
pages.append(i)
|
||||||
|
# current pages has also childs
|
||||||
|
if len(i.childs) > 0:
|
||||||
|
pages.extend(i.search_page_by_name(name))
|
||||||
|
return pages
|
||||||
|
|
||||||
|
return items
|
||||||
|
|
||||||
|
def dump(self, indent=0):
|
||||||
|
"""dump tree to string"""
|
||||||
|
tab = ' '*(indent-1) + ' |- ' if indent > 0 else ''
|
||||||
|
name = self.name
|
||||||
|
parent = self.parent.name if self.parent is not None else "root"
|
||||||
|
dumpstring = f"{tab}{self.pos}:{name} -> {parent} \n"
|
||||||
|
for obj in self.childs:
|
||||||
|
dumpstring += obj.dump(indent + 1)
|
||||||
|
return dumpstring
|
||||||
|
|
||||||
|
def get_items(self):
|
||||||
|
items = []
|
||||||
|
for i in self.childs:
|
||||||
|
if len(i.childs) > 0:
|
||||||
|
items.append(f"navigate.{i.name}")
|
||||||
|
else:
|
||||||
|
items.append(i.data)
|
||||||
|
return items
|
||||||
|
|
||||||
|
def get_all_item_names(self, recursive=True):
|
||||||
|
items = []
|
||||||
|
# current page
|
||||||
|
if type(self.data) is dict:
|
||||||
|
items.append(self.data.get("item", next(iter(self.data))))
|
||||||
|
else:
|
||||||
|
items.append(self.data)
|
||||||
|
# childs of page
|
||||||
|
for i in self.childs:
|
||||||
|
if len(i.childs) > 0:
|
||||||
|
if recursive:
|
||||||
|
items.extend(i.get_all_item_names())
|
||||||
|
else:
|
||||||
|
if type(i.data) is dict:
|
||||||
|
items.append(i.data.get("item", next(iter(i.data))))
|
||||||
|
else:
|
||||||
|
items.append(i.data)
|
||||||
|
return items
|
||||||
|
|
||||||
|
class LuiBackendConfig(object):
|
||||||
|
|
||||||
|
_DEFAULT_CONFIG = {
|
||||||
|
'panelRecvTopic': "tele/tasmota_your_mqtt_topic/RESULT",
|
||||||
|
'panelSendTopic': "cmnd/tasmota_your_mqtt_topic/CustomSend",
|
||||||
|
'updateMode': "auto-notify",
|
||||||
|
'timeoutScreensaver': 20,
|
||||||
|
'brightnessScreensaver': 20,
|
||||||
|
'brightnessScreensaverTracking': None,
|
||||||
|
'locale': "en_US",
|
||||||
|
'timeFormat': "%H:%M",
|
||||||
|
'dateFormatBabel': "full",
|
||||||
|
'dateFormat': "%A, %d. %B %Y",
|
||||||
|
'weather': 'weather.example',
|
||||||
|
'weatherOverrideForecast1': None,
|
||||||
|
'weatherOverrideForecast2': None,
|
||||||
|
'weatherOverrideForecast3': None,
|
||||||
|
'weatherOverrideForecast4': None,
|
||||||
|
'doubleTapToUnlock': False,
|
||||||
|
'pages': [{
|
||||||
|
'type': 'cardEntities',
|
||||||
|
'heading': 'Test Entities 1',
|
||||||
|
'items': ['switch.test_item', 'switch.test_item', 'switch.test_item']
|
||||||
|
}, {
|
||||||
|
'type': 'cardGrid',
|
||||||
|
'heading': 'Test Grid 1',
|
||||||
|
'items': ['switch.test_item', 'switch.test_item', 'switch.test_item']
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
def __init__(self, args=None, check=True):
|
||||||
|
self._config = {}
|
||||||
|
self._page_config = None
|
||||||
|
|
||||||
|
if args:
|
||||||
|
self.load(args)
|
||||||
|
|
||||||
|
if check:
|
||||||
|
self.check()
|
||||||
|
|
||||||
|
def load(self, args):
|
||||||
|
for k, v in args.items():
|
||||||
|
if k in self._DEFAULT_CONFIG:
|
||||||
|
self._config[k] = v
|
||||||
|
LOGGER.info(f"Loaded config: {self._config}")
|
||||||
|
|
||||||
|
root_page = {"items": self.get("pages"), "type": "internal", "heading": "root"}
|
||||||
|
self._page_config = PageNode(root_page)
|
||||||
|
|
||||||
|
LOGGER.info(f"Parsed Page config to the following Tree: \n {self._page_config.dump()}")
|
||||||
|
|
||||||
|
def check(self):
|
||||||
|
return
|
||||||
|
|
||||||
|
def get(self, name):
|
||||||
|
value = self._config.get(name)
|
||||||
|
if value is None:
|
||||||
|
value = self._DEFAULT_CONFIG.get(name)
|
||||||
|
return value
|
||||||
|
|
||||||
|
def get_root_page(self):
|
||||||
|
return self._page_config
|
||||||
|
|
||||||
232
apps/nspanel-lovelace-ui/luibackend/controller.py
Normal file
232
apps/nspanel-lovelace-ui/luibackend/controller.py
Normal file
@@ -0,0 +1,232 @@
|
|||||||
|
import logging
|
||||||
|
import datetime
|
||||||
|
from helper import scale, pos_to_color
|
||||||
|
|
||||||
|
from pages import LuiPagesGen
|
||||||
|
|
||||||
|
LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
class LuiController(object):
|
||||||
|
|
||||||
|
def __init__(self, ha_api, config, send_mqtt_msg):
|
||||||
|
self._ha_api = ha_api
|
||||||
|
self._config = config
|
||||||
|
self._send_mqtt_msg = send_mqtt_msg
|
||||||
|
|
||||||
|
# first child of root page (default, after startup)
|
||||||
|
self._current_page = self._config._page_config.childs[0]
|
||||||
|
|
||||||
|
self._pages_gen = LuiPagesGen(ha_api, config, send_mqtt_msg)
|
||||||
|
|
||||||
|
# send panel back to startup page on restart of this script
|
||||||
|
self._pages_gen.page_type("pageStartup")
|
||||||
|
|
||||||
|
# time update callback
|
||||||
|
time = datetime.time(0, 0, 0)
|
||||||
|
ha_api.run_minutely(self._pages_gen.update_time, time)
|
||||||
|
|
||||||
|
# weather callback
|
||||||
|
weather_interval = 15 * 60 # 15 minutes
|
||||||
|
ha_api.run_every(self.weather_update, "now", weather_interval)
|
||||||
|
|
||||||
|
# register callbacks
|
||||||
|
self.register_callbacks()
|
||||||
|
|
||||||
|
# register callbacks for each time
|
||||||
|
if type(self._config.get("brightnessScreensaver")) == list:
|
||||||
|
for index, timeset in enumerate(self._config.get("brightnessScreensaver")):
|
||||||
|
self._ha_api.run_daily(self.update_screensaver_brightness, timeset["time"], value=timeset["value"])
|
||||||
|
|
||||||
|
# calculate current brightness
|
||||||
|
self.current_screensaver_brightness = self.calc_current_screensaver_brightness()
|
||||||
|
|
||||||
|
# call update_screensaver_brightness on changes of entity configured in brightnessScreensaverTracking
|
||||||
|
bst = self._config.get("brightnessScreensaverTracking")
|
||||||
|
if bst is not None and self._ha_api.entity_exists(bst):
|
||||||
|
self._ha_api.listen_state(self.update_screensaver_brightness_state_callback, entity_id=bst)
|
||||||
|
|
||||||
|
def startup(self):
|
||||||
|
LOGGER.info(f"Startup Event")
|
||||||
|
# send time and date on startup
|
||||||
|
self._pages_gen.update_time("")
|
||||||
|
self._pages_gen.update_date("")
|
||||||
|
|
||||||
|
# set screensaver timeout
|
||||||
|
timeout = self._config.get("timeoutScreensaver")
|
||||||
|
self._send_mqtt_msg(f"timeout,{timeout}")
|
||||||
|
|
||||||
|
# set current screensaver brightness
|
||||||
|
self.update_screensaver_brightness(kwargs={"value": self.current_screensaver_brightness})
|
||||||
|
|
||||||
|
# send panel to screensaver
|
||||||
|
self._pages_gen.page_type("screensaver")
|
||||||
|
self.weather_update("")
|
||||||
|
|
||||||
|
def update_screensaver_brightness_state_callback(self, entity, attribute, old, new, kwargs):
|
||||||
|
self.update_screensaver_brightness(kwargs={"value": self.current_screensaver_brightness})
|
||||||
|
|
||||||
|
def update_screensaver_brightness(self, kwargs):
|
||||||
|
bst = self._config.get("brightnessScreensaverTracking")
|
||||||
|
brightness = 0
|
||||||
|
if bst is not None and self._ha_api.entity_exists(bst) and self._ha_api.get_entity(bst).state == "not_home":
|
||||||
|
brightness = 0
|
||||||
|
else:
|
||||||
|
self.current_screensaver_brightness = kwargs['value']
|
||||||
|
brightness = kwargs['value']
|
||||||
|
self._send_mqtt_msg(f"dimmode,{brightness}")
|
||||||
|
|
||||||
|
def calc_current_screensaver_brightness(self):
|
||||||
|
current_screensaver_brightness = 20
|
||||||
|
# set brightness of screensaver
|
||||||
|
if type(self._config.get("brightnessScreensaver")) == int:
|
||||||
|
current_screensaver_brightness = self._config.get("brightnessScreensaver")
|
||||||
|
elif type(self._config.get("brightnessScreensaver")) == list:
|
||||||
|
sorted_timesets = sorted(self._config.get("brightnessScreensaver"), key=lambda d: self._ha_api.parse_time(d['time']))
|
||||||
|
# calc current screensaver brightness
|
||||||
|
found_current_dim_value = False
|
||||||
|
for index, timeset in enumerate(sorted_timesets):
|
||||||
|
LOGGER.info("Current time %s", self._ha_api.get_now().time())
|
||||||
|
if self._ha_api.parse_time(timeset["time"]) > self._ha_api.get_now().time() and not found_current_dim_value:
|
||||||
|
# first time after current time, set dim value
|
||||||
|
current_screensaver_brightness = sorted_timesets[index-1]["value"]
|
||||||
|
LOGGER.info("Setting dim value to %s", sorted_timesets[index-1])
|
||||||
|
found_current_dim_value = True
|
||||||
|
# still no dim value
|
||||||
|
if not found_current_dim_value:
|
||||||
|
current_screensaver_brightness = sorted_timesets[-1]["value"]
|
||||||
|
return current_screensaver_brightness
|
||||||
|
|
||||||
|
def weather_update(self, kwargs):
|
||||||
|
we_name = self._config.get("weather")
|
||||||
|
unit = "°C"
|
||||||
|
self._pages_gen.update_screensaver_weather(kwargs={"weather": we_name, "unit": unit})
|
||||||
|
|
||||||
|
def register_callbacks(self):
|
||||||
|
items = self._config.get_root_page().get_all_item_names()
|
||||||
|
LOGGER.debug(f"Registering callbacks for the following items: {items}")
|
||||||
|
for item in items:
|
||||||
|
if self._ha_api.entity_exists(item):
|
||||||
|
self._ha_api.listen_state(self.state_change_callback, entity_id=item, attribute="all")
|
||||||
|
|
||||||
|
def state_change_callback(self, entity, attribute, old, new, kwargs):
|
||||||
|
LOGGER.debug(f"Got callback for: {entity}")
|
||||||
|
LOGGER.debug(f"Current page has the following items: {self._current_page.get_items()}")
|
||||||
|
if entity in self._current_page.get_all_item_names(recursive=False):
|
||||||
|
LOGGER.debug(f"Callback Entity is on current page: {entity}")
|
||||||
|
self._pages_gen.render_page(self._current_page, send_page_type=False)
|
||||||
|
# send detail page update, just in case
|
||||||
|
if self._current_page.data.get("type", "unknown") in ["cardGrid", "cardEntities"]:
|
||||||
|
if entity.startswith("light"):
|
||||||
|
self._pages_gen.generate_light_detail_page(entity)
|
||||||
|
if entity.startswith("cover"):
|
||||||
|
self._pages_gen.generate_shutter_detail_page(entity)
|
||||||
|
|
||||||
|
|
||||||
|
def detail_open(self, detail_type, entity_id):
|
||||||
|
if detail_type == "popupShutter":
|
||||||
|
self._pages_gen.generate_shutter_detail_page(entity_id)
|
||||||
|
if detail_type == "popupLight":
|
||||||
|
self._pages_gen.generate_light_detail_page(entity_id)
|
||||||
|
|
||||||
|
def button_press(self, entity_id, button_type, value):
|
||||||
|
LOGGER.info(f"Button Press Event; entity_id: {entity_id}; button_type: {button_type}; value: {value} ")
|
||||||
|
# internal buttons
|
||||||
|
if entity_id == "screensaver" and button_type == "bExit":
|
||||||
|
if self._config.get("doubleTapToUnlock") and int(value) >= 2:
|
||||||
|
self._pages_gen.render_page(self._current_page)
|
||||||
|
elif not self._config.get("doubleTapToUnlock"):
|
||||||
|
self._pages_gen.render_page(self._current_page)
|
||||||
|
return
|
||||||
|
if button_type == "bExit":
|
||||||
|
self._pages_gen.render_page(self._current_page)
|
||||||
|
|
||||||
|
if button_type == "bNext":
|
||||||
|
self._current_page = self._current_page.next()
|
||||||
|
self._pages_gen.render_page(self._current_page)
|
||||||
|
if button_type == "bPrev":
|
||||||
|
self._current_page = self._current_page.prev()
|
||||||
|
self._pages_gen.render_page(self._current_page)
|
||||||
|
|
||||||
|
elif entity_id == "updateDisplayNoYes" and value == "no":
|
||||||
|
self._pages_gen.render_page(self._current_page)
|
||||||
|
|
||||||
|
# buttons with actions on HA
|
||||||
|
if button_type == "OnOff":
|
||||||
|
if value == "1":
|
||||||
|
self._ha_api.turn_on(entity_id)
|
||||||
|
else:
|
||||||
|
self._ha_api.turn_off(entity_id)
|
||||||
|
|
||||||
|
if button_type == "number-set":
|
||||||
|
self._ha_api.get_entity(entity_id).call_service("set_value", value=value)
|
||||||
|
|
||||||
|
# for shutter / covers
|
||||||
|
if button_type == "up":
|
||||||
|
self._ha_api.get_entity(entity_id).call_service("open_cover")
|
||||||
|
if button_type == "stop":
|
||||||
|
self._ha_api.get_entity(entity_id).call_service("stop_cover")
|
||||||
|
if button_type == "down":
|
||||||
|
self._ha_api.get_entity(entity_id).call_service("close_cover")
|
||||||
|
if button_type == "positionSlider":
|
||||||
|
pos = int(value)
|
||||||
|
self._ha_api.get_entity(entity_id).call_service("set_cover_position", position=pos)
|
||||||
|
|
||||||
|
if button_type == "button":
|
||||||
|
if entity_id.startswith('navigate'):
|
||||||
|
# internal for navigation to nested pages
|
||||||
|
self._current_page = self._config.get_root_page().search_page_by_name(entity_id)[0]
|
||||||
|
self._pages_gen.render_page(self._current_page)
|
||||||
|
elif entity_id.startswith('scene'):
|
||||||
|
self._ha_api.get_entity(entity_id).call_service("turn_on")
|
||||||
|
elif entity_id.startswith('light') or entity_id.startswith('switch') or entity_id.startswith('input_boolean'):
|
||||||
|
self._ha_api.get_entity(entity_id).call_service("toggle")
|
||||||
|
else:
|
||||||
|
self._ha_api.get_entity(entity_id).call_service("press")
|
||||||
|
|
||||||
|
# for media page
|
||||||
|
if button_type == "media-next":
|
||||||
|
self._ha_api.get_entity(entity_id).call_service("media_next_track")
|
||||||
|
if button_type == "media-back":
|
||||||
|
self._ha_api.get_entity(entity_id).call_service("media_previous_track")
|
||||||
|
if button_type == "media-pause":
|
||||||
|
self._ha_api.get_entity(entity_id).call_service("media_play_pause")
|
||||||
|
if button_type == "media-OnOff":
|
||||||
|
if self._ha_api.get_entity(entity_id).state == "off":
|
||||||
|
self._ha_api.get_entity(entity_id).call_service("turn_on")
|
||||||
|
else:
|
||||||
|
self._ha_api.get_entity(entity_id).call_service("turn_off")
|
||||||
|
if button_type == "volumeSlider":
|
||||||
|
pos = int(value)
|
||||||
|
# HA wants this value between 0 and 1 as float
|
||||||
|
pos = pos/100
|
||||||
|
self._ha_api.get_entity(entity_id).call_service("volume_set", volume_level=pos)
|
||||||
|
if button_type == "speaker-sel":
|
||||||
|
self._ha_api.get_entity(entity_id).call_service("select_source", source=value)
|
||||||
|
|
||||||
|
# for light detail page
|
||||||
|
if button_type == "brightnessSlider":
|
||||||
|
# scale 0-100 to ha brightness range
|
||||||
|
brightness = int(scale(int(value),(0,100),(0,255)))
|
||||||
|
self._ha_api.get_entity(entity_id).call_service("turn_on", brightness=brightness)
|
||||||
|
if button_type == "colorTempSlider":
|
||||||
|
entity = self._ha_api.get_entity(entity_id)
|
||||||
|
#scale 0-100 from slider to color range of lamp
|
||||||
|
color_val = scale(int(value), (0, 100), (entity.attributes.min_mireds, entity.attributes.max_mireds))
|
||||||
|
self._ha_api.get_entity(entity_id).call_service("turn_on", color_temp=color_val)
|
||||||
|
if button_type == "colorWheel":
|
||||||
|
self._ha_api.log(value)
|
||||||
|
value = value.split('|')
|
||||||
|
color = pos_to_color(int(value[0]), int(value[1]))
|
||||||
|
self._ha_api.log(color)
|
||||||
|
self._ha_api.get_entity(entity_id).call_service("turn_on", rgb_color=color)
|
||||||
|
|
||||||
|
# for climate page
|
||||||
|
if button_type == "tempUpd":
|
||||||
|
temp = int(value)/10
|
||||||
|
self._ha_api.get_entity(entity_id).call_service("set_temperature", temperature=temp)
|
||||||
|
if button_type == "hvac_action":
|
||||||
|
self._ha_api.get_entity(entity_id).call_service("set_hvac_mode", hvac_mode=value)
|
||||||
|
|
||||||
|
# for alarm page
|
||||||
|
if button_type in ["disarm", "arm_home", "arm_away", "arm_night", "arm_vacation"]:
|
||||||
|
self._ha_api.get_entity(entity_id).call_service(f"alarm_{button_type}", code=value)
|
||||||
50
apps/nspanel-lovelace-ui/luibackend/helper.py
Normal file
50
apps/nspanel-lovelace-ui/luibackend/helper.py
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
import colorsys
|
||||||
|
import math
|
||||||
|
|
||||||
|
def scale(val, src, dst):
|
||||||
|
"""
|
||||||
|
Scale the given value from the scale of src to the scale of dst.
|
||||||
|
"""
|
||||||
|
return ((val - src[0]) / (src[1]-src[0])) * (dst[1]-dst[0]) + dst[0]
|
||||||
|
|
||||||
|
def hsv2rgb(h, s, v):
|
||||||
|
hsv = colorsys.hsv_to_rgb(h,s,v)
|
||||||
|
return tuple(round(i * 255) for i in hsv)
|
||||||
|
|
||||||
|
def pos_to_color(x, y):
|
||||||
|
r = 160/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 = hsv2rgb(hsv[0],hsv[1],hsv[2])
|
||||||
|
return rgb
|
||||||
|
|
||||||
|
def rgb_brightness(rgb_color, brightness):
|
||||||
|
# brightness values are in range 0-255
|
||||||
|
# to make sure that the color is not completly lost we need to rescale this to 70-255
|
||||||
|
brightness = int(scale(brightness,(0,255),(70,255)))
|
||||||
|
red = rgb_color[0]/255*brightness
|
||||||
|
green = rgb_color[1]/255*brightness
|
||||||
|
blue = rgb_color[2]/255*brightness
|
||||||
|
return [int(red), int(green), int(blue)]
|
||||||
|
|
||||||
|
def rgb_dec565(rgb_color):
|
||||||
|
red = rgb_color[0]
|
||||||
|
green = rgb_color[1]
|
||||||
|
blue = rgb_color[2]
|
||||||
|
# take in the red, green and blue values (0-255) as 8 bit values and then combine
|
||||||
|
# and shift them to make them a 16 bit dec value in 565 format.
|
||||||
|
return ((int(red / 255 * 31) << 11) | (int(green / 255 * 63) << 5) | (int(blue / 255 * 31)))
|
||||||
|
|
||||||
|
def get_attr_safe(entity, attr, default):
|
||||||
|
res = entity.attributes.get(attr, default)
|
||||||
|
if res is None:
|
||||||
|
res = default
|
||||||
|
return res
|
||||||
54
apps/nspanel-lovelace-ui/luibackend/icon_mapping.py
Normal file
54
apps/nspanel-lovelace-ui/luibackend/icon_mapping.py
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
icons = {
|
||||||
|
'alert-circle-outline': 0,
|
||||||
|
'lightbulb': 1,
|
||||||
|
'thermometer': 2,
|
||||||
|
'gesture-tap-button': 3,
|
||||||
|
'flash': 4,
|
||||||
|
'music': 5,
|
||||||
|
'check-circle-outline': 6,
|
||||||
|
'close-circle-outline': 7,
|
||||||
|
'pause': 8,
|
||||||
|
'play': 9,
|
||||||
|
'palette': 10,
|
||||||
|
'window-open': 11,
|
||||||
|
'weather-cloudy': 12,
|
||||||
|
'weather-fog': 13,
|
||||||
|
'weather-hail': 14,
|
||||||
|
'weather-lightning': 15,
|
||||||
|
'weather-lightning-rainy': 16,
|
||||||
|
'weather-night': 17,
|
||||||
|
'weather-partly-cloudy': 18,
|
||||||
|
'weather-pouring': 19,
|
||||||
|
'weather-rainy': 20,
|
||||||
|
'weather-snowy': 21,
|
||||||
|
'weather-snowy-rainy': 22,
|
||||||
|
'weather-sunny': 23,
|
||||||
|
'weather-windy': 24,
|
||||||
|
'weather-windy-variant': 25,
|
||||||
|
'water-percent': 26,
|
||||||
|
'power': 27,
|
||||||
|
'fire': 28,
|
||||||
|
'calendar-sync': 29,
|
||||||
|
'fan': 30,
|
||||||
|
'snowflake': 31,
|
||||||
|
'solar-power': 32,
|
||||||
|
'battery-charging-medium': 33,
|
||||||
|
'battery-medium': 34,
|
||||||
|
'shield-home': 35,
|
||||||
|
'door-open': 36,
|
||||||
|
'door-closed': 37,
|
||||||
|
'window-closed': 38,
|
||||||
|
'shield-off': 39,
|
||||||
|
'shield': 40,
|
||||||
|
'shield-lock': 41,
|
||||||
|
'shield-airplane': 42,
|
||||||
|
'bell-ring': 43,
|
||||||
|
'ray-vertex': 44,
|
||||||
|
}
|
||||||
|
|
||||||
|
def get_icon_id(ma_name):
|
||||||
|
if ma_name in icons:
|
||||||
|
return icons[ma_name]
|
||||||
|
else:
|
||||||
|
return icons["alert-circle-outline"]
|
||||||
|
|
||||||
66
apps/nspanel-lovelace-ui/luibackend/icons.py
Normal file
66
apps/nspanel-lovelace-ui/luibackend/icons.py
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
from icon_mapping import get_icon_id
|
||||||
|
|
||||||
|
weather_mapping = {
|
||||||
|
'clear-night': 'weather-night',
|
||||||
|
'cloudy': 'weather-cloudy',
|
||||||
|
'exceptional': 'alert-circle-outline',
|
||||||
|
'fog': 'weather-fog',
|
||||||
|
'hail': 'weather-hail',
|
||||||
|
'lightning': 'weather-lightning',
|
||||||
|
'lightning-rainy': 'weather-lightning-rainy',
|
||||||
|
'partlycloudy': 'weather-partly-cloudy',
|
||||||
|
'pouring': 'weather-pouring',
|
||||||
|
'rainy': 'weather-rainy',
|
||||||
|
'snowy': 'weather-snowy',
|
||||||
|
'snowy-rainy': 'weather-snowy-rainy',
|
||||||
|
'sunny': 'weather-sunny',
|
||||||
|
'windy': 'weather-windy',
|
||||||
|
'windy-variant': 'weather-windy-variant'
|
||||||
|
}
|
||||||
|
|
||||||
|
sensor_mapping_on = {
|
||||||
|
"door": "door-open",
|
||||||
|
}
|
||||||
|
|
||||||
|
sensor_mapping_off = {
|
||||||
|
"door": "door-closed",
|
||||||
|
}
|
||||||
|
|
||||||
|
sensor_mapping = {
|
||||||
|
"temperature": "thermometer",
|
||||||
|
"power": "flash"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def map_to_mdi_name(ha_type, state=None, device_class=None):
|
||||||
|
if ha_type == "weather":
|
||||||
|
return weather_mapping[state] if state in weather_mapping else "alert-circle-outline"
|
||||||
|
if ha_type == "button":
|
||||||
|
return "gesture-tap-button"
|
||||||
|
if ha_type == "scene":
|
||||||
|
return "palette"
|
||||||
|
if ha_type == "switch":
|
||||||
|
return "flash"
|
||||||
|
if ha_type == "number":
|
||||||
|
return "ray-vertex"
|
||||||
|
if ha_type == "light":
|
||||||
|
return "lightbulb"
|
||||||
|
if ha_type == "input_boolean":
|
||||||
|
return "check-circle-outline" if state == "on" else "close-circle-outline"
|
||||||
|
if ha_type == "cover":
|
||||||
|
return "window-open" if state == "open" else "window-closed"
|
||||||
|
|
||||||
|
elif ha_type == "sensor":
|
||||||
|
if state == "on":
|
||||||
|
return sensor_mapping_on[device_class] if device_class in sensor_mapping_on else "alert-circle-outline"
|
||||||
|
elif state == "off":
|
||||||
|
return sensor_mapping_off[device_class] if device_class in sensor_mapping_off else "alert-circle-outline"
|
||||||
|
else:
|
||||||
|
return sensor_mapping[device_class] if device_class in sensor_mapping else "alert-circle-outline"
|
||||||
|
|
||||||
|
return "alert-circle-outline"
|
||||||
|
|
||||||
|
def get_icon_id_ha(ha_name, state=None, device_class=None, overwrite=None):
|
||||||
|
if overwrite is not None:
|
||||||
|
return get_icon_id(overwrite)
|
||||||
|
return get_icon_id(map_to_mdi_name(ha_name, state, device_class))
|
||||||
349
apps/nspanel-lovelace-ui/luibackend/localization.py
Normal file
349
apps/nspanel-lovelace-ui/luibackend/localization.py
Normal file
@@ -0,0 +1,349 @@
|
|||||||
|
translations = {
|
||||||
|
'af_ZA': {
|
||||||
|
'ACTIVATE': "Aktiveer",
|
||||||
|
'aux_heat': "Aanvullende hitte",
|
||||||
|
'cooling': "Koel Af",
|
||||||
|
'drying': "Droog Uit",
|
||||||
|
'fan': "Waaier",
|
||||||
|
'idle': "Onaktief",
|
||||||
|
'off': "Af",
|
||||||
|
'arm_away': "Bewapen weg",
|
||||||
|
'arm_custom_bypass': "Pasgemaakte omseil",
|
||||||
|
'arm_home': "Bewapen Huis",
|
||||||
|
'arm_night': "Nag alarm",
|
||||||
|
'clear_code': "Maak skoon",
|
||||||
|
'code': "Kode",
|
||||||
|
'disarm': "Skakel Af",
|
||||||
|
},
|
||||||
|
'ca_ES': {
|
||||||
|
'PRESS': "Prem",
|
||||||
|
'ACTIVATE': "Activar",
|
||||||
|
'aux_heat': "Calefactor auxiliar",
|
||||||
|
'cooling': "Refredant",
|
||||||
|
'drying': "Assecant",
|
||||||
|
'fan': "Ventilació",
|
||||||
|
'idle': "Inactiu",
|
||||||
|
'off': "OFF",
|
||||||
|
'arm_away': "Activar, fora",
|
||||||
|
'arm_custom_bypass': "Bypass personalitzat",
|
||||||
|
'arm_home': "Activar, a casa",
|
||||||
|
'arm_night': "Activar, nocturn",
|
||||||
|
'arm_vacation': "Activa en mode vacances",
|
||||||
|
'clear_code': "Borrar",
|
||||||
|
'code': "Codi",
|
||||||
|
'disarm': "Desactivar",
|
||||||
|
},
|
||||||
|
'cs_CZ': {
|
||||||
|
'PRESS': "Stisknutí",
|
||||||
|
'ACTIVATE': "Aktivovat",
|
||||||
|
'aux_heat': "Pomocné teplo",
|
||||||
|
'cooling': "Chlazení",
|
||||||
|
'drying': "Sušení",
|
||||||
|
'fan': "Ventilátor",
|
||||||
|
'idle': "Nečinný",
|
||||||
|
'off': "Vypnuto",
|
||||||
|
'arm_away': "Aktivovat režim nepřítomnost",
|
||||||
|
'arm_custom_bypass': "Vlastní obejítí",
|
||||||
|
'arm_home': "Aktivovat režim domov",
|
||||||
|
'arm_night': "Aktivovat noční režim",
|
||||||
|
'arm_vacation': "Aktivovat režim dovolená",
|
||||||
|
'clear_code': "Zrušit",
|
||||||
|
'code': "Kód",
|
||||||
|
'disarm': "Odbezpečit",
|
||||||
|
},
|
||||||
|
'cy_GB': {
|
||||||
|
'ACTIVATE': "Actifadu",
|
||||||
|
'off': "I ffwrdd",
|
||||||
|
'arm_custom_bypass': "Ffordd osgoi personol",
|
||||||
|
'arm_night': "Larwm nos",
|
||||||
|
'code': "Cod dilysu dwy-ffactor",
|
||||||
|
},
|
||||||
|
'da_DK': {
|
||||||
|
'PRESS': "Tryk",
|
||||||
|
'ACTIVATE': "Aktiver",
|
||||||
|
'aux_heat': "Støtte-varme",
|
||||||
|
'cooling': "Køling",
|
||||||
|
'drying': "Tørring",
|
||||||
|
'fan': "Blæser",
|
||||||
|
'idle': "Inaktiv",
|
||||||
|
'off': "Fra",
|
||||||
|
'arm_away': "Tilkobl ude",
|
||||||
|
'arm_custom_bypass': "Brugerdefineret bypass",
|
||||||
|
'arm_home': "Tilkobl hjemme",
|
||||||
|
'arm_night': "Tilkoblet nat",
|
||||||
|
'arm_vacation': "Tilkobl ferie",
|
||||||
|
'clear_code': "Ryd",
|
||||||
|
'code': "Kode",
|
||||||
|
'disarm': "Frakobl",
|
||||||
|
},
|
||||||
|
'de_DE': {
|
||||||
|
'PRESS': "Drücken",
|
||||||
|
'ACTIVATE': "Aktivieren",
|
||||||
|
'aux_heat': "Hilfswärme",
|
||||||
|
'cooling': "Kühlung",
|
||||||
|
'drying': "Trocknen",
|
||||||
|
'fan': "Ventilator",
|
||||||
|
'idle': "Leerlauf",
|
||||||
|
'off': "Aus",
|
||||||
|
'arm_away': "Aktivieren - Unterwegs",
|
||||||
|
'arm_custom_bypass': "Benutzerdefinierter Bypass",
|
||||||
|
'arm_home': "Aktivieren - Zuhause",
|
||||||
|
'arm_night': "Aktivieren - Nacht",
|
||||||
|
'arm_vacation': "Aktiviere Urlaub",
|
||||||
|
'clear_code': "Löschen",
|
||||||
|
'code': "Code",
|
||||||
|
'disarm': "Deaktivieren",
|
||||||
|
},
|
||||||
|
'en_US': {
|
||||||
|
'PRESS': "Press",
|
||||||
|
'ACTIVATE': "Activate",
|
||||||
|
'aux_heat': "Aux heat",
|
||||||
|
'cooling': "Cooling",
|
||||||
|
'drying': "Drying",
|
||||||
|
'fan': "Fan",
|
||||||
|
'idle': "Idle",
|
||||||
|
'off': "Off",
|
||||||
|
'arm_away': "Arm away",
|
||||||
|
'arm_custom_bypass': "Custom bypass",
|
||||||
|
'arm_home': "Arm home",
|
||||||
|
'arm_night': "Arm night",
|
||||||
|
'arm_vacation': "Arm vacation",
|
||||||
|
'clear_code': "Clear",
|
||||||
|
'code': "Code",
|
||||||
|
'disarm': "Disarm",
|
||||||
|
},
|
||||||
|
'es_ES': {
|
||||||
|
'PRESS': "Pulsa",
|
||||||
|
'ACTIVATE': "Activar",
|
||||||
|
'aux_heat': "Calor auxiliar",
|
||||||
|
'cooling': "Enfriando",
|
||||||
|
'drying': "Secando",
|
||||||
|
'fan': "Ventilador",
|
||||||
|
'idle': "Inactivo",
|
||||||
|
'off': "Apagado",
|
||||||
|
'arm_away': "Armar ausente",
|
||||||
|
'arm_custom_bypass': "Bypass personalizada",
|
||||||
|
'arm_home': "Armar en casa",
|
||||||
|
'arm_night': "Armar noche",
|
||||||
|
'arm_vacation': "Armar por vacaciones",
|
||||||
|
'clear_code': "Limpiar",
|
||||||
|
'code': "Código",
|
||||||
|
'disarm': "Desarmar",
|
||||||
|
},
|
||||||
|
'et_EE': {
|
||||||
|
'PRESS': "Vajuta nuppu",
|
||||||
|
'ACTIVATE': "Aktiveeri",
|
||||||
|
'aux_heat': "Abiküte",
|
||||||
|
'cooling': "Jahutamine",
|
||||||
|
'drying': "Kuivatamine",
|
||||||
|
'fan': "Ventilaator",
|
||||||
|
'idle': "Ootel",
|
||||||
|
'off': "Väljas",
|
||||||
|
'arm_away': "Valvesta eemal",
|
||||||
|
'arm_custom_bypass': "Eranditega",
|
||||||
|
'arm_home': "Valvesta kodus",
|
||||||
|
'arm_night': "Valvesta öine",
|
||||||
|
'arm_vacation': "Valvesta puhkuse režiimis",
|
||||||
|
'clear_code': "Puhasta",
|
||||||
|
'code': "Kood",
|
||||||
|
'disarm': "Valvest maha",
|
||||||
|
},
|
||||||
|
'eu_ES': {
|
||||||
|
'ACTIVATE': "Aktibatu",
|
||||||
|
'off': "Itzalita",
|
||||||
|
'clear_code': "Garbitu",
|
||||||
|
'code': "Kodea",
|
||||||
|
},
|
||||||
|
'fi_FI': {
|
||||||
|
'PRESS': "Paina",
|
||||||
|
'ACTIVATE': "Aktivoi",
|
||||||
|
'aux_heat': "Lisälämpö",
|
||||||
|
'cooling': "Jäähdytys",
|
||||||
|
'drying': "Kuivaus",
|
||||||
|
'fan': "Tuuletin",
|
||||||
|
'idle': "Lepotilassa",
|
||||||
|
'off': "Pois",
|
||||||
|
'arm_away': "Viritä (poissa)",
|
||||||
|
'arm_custom_bypass': "Mukautettu ohitus",
|
||||||
|
'arm_home': "Viritä (kotona)",
|
||||||
|
'arm_night': "Viritä yöksi",
|
||||||
|
'arm_vacation': "Aktivoi lomatila",
|
||||||
|
'clear_code': "Tyhjennä",
|
||||||
|
'code': "Koodi",
|
||||||
|
'disarm': "Poista hälytys",
|
||||||
|
},
|
||||||
|
'fr_FR': {
|
||||||
|
'PRESS': "Appui",
|
||||||
|
'ACTIVATE': "Activer",
|
||||||
|
'aux_heat': "Chauffage d'appoint",
|
||||||
|
'cooling': "Refroidissement",
|
||||||
|
'drying': "Séchage",
|
||||||
|
'fan': "Ventilateur",
|
||||||
|
'idle': "Inactif",
|
||||||
|
'off': "Off",
|
||||||
|
'arm_away': "Armer (absent)",
|
||||||
|
'arm_custom_bypass': "Bypass personnalisé",
|
||||||
|
'arm_home': "Armer (présent)",
|
||||||
|
'arm_night': "Armer nuit",
|
||||||
|
'arm_vacation': "Armer vacances",
|
||||||
|
'clear_code': "Effacer",
|
||||||
|
'code': "Code",
|
||||||
|
'disarm': "Désarmer",
|
||||||
|
},
|
||||||
|
'fy_DE': {
|
||||||
|
'off': "Út",
|
||||||
|
},
|
||||||
|
'gl_ES': {
|
||||||
|
'off': "Apagado",
|
||||||
|
},
|
||||||
|
'hr_HR': {
|
||||||
|
'ACTIVATE': "Aktivirati",
|
||||||
|
'aux_heat': "Pomoćno grijanje",
|
||||||
|
'cooling': "Hlađenje",
|
||||||
|
'drying': "Sušenje",
|
||||||
|
'fan': "Ventilator",
|
||||||
|
'idle': "Neaktivan",
|
||||||
|
'off': "Isključen",
|
||||||
|
'arm_away': "Aktiviran odsutno",
|
||||||
|
'arm_custom_bypass': "Prilagođena premosnica",
|
||||||
|
'arm_home': "Aktiviran doma",
|
||||||
|
'arm_night': "Aktiviran nočni",
|
||||||
|
'clear_code': "Vedro",
|
||||||
|
'code': "Kod",
|
||||||
|
'disarm': "Deaktiviraj",
|
||||||
|
},
|
||||||
|
'id_ID': {
|
||||||
|
'PRESS': "Tekan",
|
||||||
|
'ACTIVATE': "Aktifkan",
|
||||||
|
'aux_heat': "Pemanasan tambahan",
|
||||||
|
'cooling': "Mendinginkan",
|
||||||
|
'drying': "Mengeringkan",
|
||||||
|
'fan': "Kipas",
|
||||||
|
'idle': "Diam",
|
||||||
|
'off': "Mati",
|
||||||
|
'arm_away': "Aktifkan utk keluar",
|
||||||
|
'arm_custom_bypass': "Diaktifkan khusus",
|
||||||
|
'arm_home': "Aktifkan utk di rumah",
|
||||||
|
'arm_night': "Aktifkan utk malam",
|
||||||
|
'arm_vacation': "Aktifkan utk liburan",
|
||||||
|
'clear_code': "Hapus",
|
||||||
|
'code': "Kode",
|
||||||
|
'disarm': "Nonaktifkan",
|
||||||
|
},
|
||||||
|
'is_IS': {
|
||||||
|
'PRESS': "Ýttu á",
|
||||||
|
'ACTIVATE': "Virkja",
|
||||||
|
'cooling': "Kæling",
|
||||||
|
'drying': "Þurrkun",
|
||||||
|
'fan': "Vifta",
|
||||||
|
'idle': "Aðgerðalaus",
|
||||||
|
'off': "Slökkt",
|
||||||
|
'arm_away': "Vörður úti",
|
||||||
|
'arm_custom_bypass': "Sérsniðin hjáleið",
|
||||||
|
'arm_home': "Vörður heima",
|
||||||
|
'arm_night': "Vörður nótt",
|
||||||
|
'arm_vacation': "Vörður frí",
|
||||||
|
'clear_code': "Hreinsa",
|
||||||
|
'code': "Kóði",
|
||||||
|
'disarm': "Taka af verði",
|
||||||
|
},
|
||||||
|
'it_IT': {
|
||||||
|
'PRESS': "Premi",
|
||||||
|
'ACTIVATE': "Attiva",
|
||||||
|
'aux_heat': "Riscaldamento ausiliario",
|
||||||
|
'cooling': "Raffreddamento",
|
||||||
|
'drying': "Deumidificazione",
|
||||||
|
'fan': "Ventilatore",
|
||||||
|
'idle': "Inattivo",
|
||||||
|
'off': "Spento",
|
||||||
|
'arm_away': "Attiva fuori casa",
|
||||||
|
'arm_custom_bypass': "Bypass personalizzato",
|
||||||
|
'arm_home': "Attiva in casa",
|
||||||
|
'arm_night': "Attiva notte",
|
||||||
|
'arm_vacation': "Attiva in vacanza",
|
||||||
|
'clear_code': "Canc",
|
||||||
|
'code': "Codice",
|
||||||
|
'disarm': "Disattiva",
|
||||||
|
},
|
||||||
|
'nl_NL': {
|
||||||
|
'PRESS': "Klik",
|
||||||
|
'ACTIVATE': "Activeren",
|
||||||
|
'aux_heat': "Extra warmte",
|
||||||
|
'cooling': "Koelen",
|
||||||
|
'drying': "Ontvochtigen",
|
||||||
|
'fan': "Ventilator",
|
||||||
|
'idle': "Inactief",
|
||||||
|
'off': "Uit",
|
||||||
|
'arm_away': "Inschakelen voor vertrek",
|
||||||
|
'arm_custom_bypass': "Inschakelen met overbrugging",
|
||||||
|
'arm_home': "Inschakelen voor thuis",
|
||||||
|
'arm_night': "Inschakelen voor 's nachts",
|
||||||
|
'arm_vacation': "Inschakelen voor vakantie",
|
||||||
|
'clear_code': "Wis",
|
||||||
|
'code': "Code",
|
||||||
|
'disarm': "Uitschakelen",
|
||||||
|
},
|
||||||
|
'nn_NO': {
|
||||||
|
'ACTIVATE': "Aktiver",
|
||||||
|
'aux_heat': "Aux-varme",
|
||||||
|
'cooling': "Nedkjøling",
|
||||||
|
'drying': "Tørkar",
|
||||||
|
'fan': "Vifte",
|
||||||
|
'idle': "Tomgang",
|
||||||
|
'off': "Av",
|
||||||
|
'arm_away': "Bortemodus",
|
||||||
|
'arm_custom_bypass': "Tilpassa bypass",
|
||||||
|
'arm_home': "Heimemodus",
|
||||||
|
'arm_night': "Aktiver natt",
|
||||||
|
'arm_vacation': "Armert feriemodus",
|
||||||
|
'clear_code': "Slett alt",
|
||||||
|
'code': "Kode",
|
||||||
|
'disarm': "Skru av",
|
||||||
|
},
|
||||||
|
'pt_PT': {
|
||||||
|
'PRESS': "Pressione",
|
||||||
|
'ACTIVATE': "Ativar",
|
||||||
|
'aux_heat': "Calor auxiliar",
|
||||||
|
'cooling': "Resfriar",
|
||||||
|
'drying': "Secagem",
|
||||||
|
'fan': "Ventoinha",
|
||||||
|
'idle': "Em espera",
|
||||||
|
'off': "Desligado",
|
||||||
|
'arm_away': "Armado ausente",
|
||||||
|
'arm_custom_bypass': "Desvio personalizado",
|
||||||
|
'arm_home': "Armado casa",
|
||||||
|
'arm_night': "Armado noite",
|
||||||
|
'clear_code': "Apagar",
|
||||||
|
'code': "Código",
|
||||||
|
'disarm': "Desarmar",
|
||||||
|
},
|
||||||
|
'sr_RS': {
|
||||||
|
'PRESS': "Pritisnite taster",
|
||||||
|
'ACTIVATE': "Aktiviraj",
|
||||||
|
'off': "Isključen",
|
||||||
|
},
|
||||||
|
'sv_SE': {
|
||||||
|
'PRESS': "Tryck",
|
||||||
|
'ACTIVATE': "Aktivera",
|
||||||
|
'aux_heat': "Underhållsvärme",
|
||||||
|
'cooling': "Kyler",
|
||||||
|
'drying': "Avfuktar",
|
||||||
|
'fan': "Fläkt",
|
||||||
|
'idle': "Inaktiv",
|
||||||
|
'off': "Av",
|
||||||
|
'arm_away': "Larma bortaläge",
|
||||||
|
'arm_custom_bypass': "Larm förbikopplat",
|
||||||
|
'arm_home': "Larma hemmaläge",
|
||||||
|
'arm_night': "Larma nattläge",
|
||||||
|
'arm_vacation': "Larma semesterläge",
|
||||||
|
'clear_code': "Rensa",
|
||||||
|
'code': "Kod",
|
||||||
|
'disarm': "Larma från",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
def get_translation(locale, input):
|
||||||
|
if locale in translations:
|
||||||
|
return translations.get(locale).get(input, input)
|
||||||
|
else:
|
||||||
|
return translations.get("en_US").get(input, input)
|
||||||
57
apps/nspanel-lovelace-ui/luibackend/mqttListener.py
Normal file
57
apps/nspanel-lovelace-ui/luibackend/mqttListener.py
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
import json
|
||||||
|
|
||||||
|
import logging
|
||||||
|
|
||||||
|
LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
class LuiMqttListener(object):
|
||||||
|
|
||||||
|
def __init__(self, mqtt_api, topic, controller, updater):
|
||||||
|
self._controller = controller
|
||||||
|
self._updater = updater
|
||||||
|
# Setup, mqtt subscription and callback
|
||||||
|
mqtt_api.mqtt_subscribe(topic=topic)
|
||||||
|
mqtt_api.listen_event(self.mqtt_event_callback, "MQTT_MESSAGE", topic=topic, namespace='mqtt')
|
||||||
|
|
||||||
|
|
||||||
|
def mqtt_event_callback(self, event_name, data, kwargs):
|
||||||
|
LOGGER.debug(f'MQTT callback for: {data}')
|
||||||
|
# Parse Json Message from Tasmota and strip out message from nextion display
|
||||||
|
data = json.loads(data["payload"])
|
||||||
|
if("nlui_driver_version" in data):
|
||||||
|
msg = data["nlui_driver_version"]
|
||||||
|
self._updater.set_tasmota_driver_version(int(msg))
|
||||||
|
self._updater.check_updates()
|
||||||
|
if("CustomRecv" not in data):
|
||||||
|
return
|
||||||
|
msg = data["CustomRecv"]
|
||||||
|
LOGGER.info(f"Received Message from Screen: {msg}")
|
||||||
|
# Split message into parts seperated by ","
|
||||||
|
msg = msg.split(",")
|
||||||
|
# run action based on received command
|
||||||
|
if msg[0] == "event":
|
||||||
|
if msg[1] == "startup":
|
||||||
|
display_firmware_version = int(msg[2])
|
||||||
|
self._updater.set_current_display_firmware_version(display_firmware_version)
|
||||||
|
# check for updates
|
||||||
|
msg_send = self._updater.check_updates()
|
||||||
|
# send messages for current page
|
||||||
|
if not msg_send:
|
||||||
|
self._controller.startup()
|
||||||
|
if msg[1] == "screensaverOpen":
|
||||||
|
self._controller.weather_update("")
|
||||||
|
# try to request tasmota driver version again in case it's still None
|
||||||
|
if self._updater.current_tasmota_driver_version is None:
|
||||||
|
self._updater.request_berry_driver_version()
|
||||||
|
if msg[1] == "buttonPress2":
|
||||||
|
entity_id = msg[2]
|
||||||
|
btype = msg[3]
|
||||||
|
value = msg[4] if len(msg) > 4 else None
|
||||||
|
|
||||||
|
if entity_id == "updateDisplayNoYes" and value == "yes":
|
||||||
|
self._updater.update_panel_driver()
|
||||||
|
|
||||||
|
self._controller.button_press(entity_id, btype, value)
|
||||||
|
if msg[1] == "pageOpenDetail":
|
||||||
|
self._controller.detail_open(msg[2], msg[3])
|
||||||
|
|
||||||
378
apps/nspanel-lovelace-ui/luibackend/pages.py
Normal file
378
apps/nspanel-lovelace-ui/luibackend/pages.py
Normal file
@@ -0,0 +1,378 @@
|
|||||||
|
import logging
|
||||||
|
import datetime
|
||||||
|
|
||||||
|
from icon_mapping import get_icon_id
|
||||||
|
from icons import get_icon_id_ha
|
||||||
|
from helper import scale, rgb_dec565, rgb_brightness, get_attr_safe
|
||||||
|
from localization import get_translation
|
||||||
|
|
||||||
|
# check Babel
|
||||||
|
import importlib
|
||||||
|
babel_spec = importlib.util.find_spec("babel")
|
||||||
|
if babel_spec is not None:
|
||||||
|
import babel.dates
|
||||||
|
|
||||||
|
LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
class LuiPagesGen(object):
|
||||||
|
|
||||||
|
def __init__(self, ha_api, config, send_mqtt_msg):
|
||||||
|
self._ha_api = ha_api
|
||||||
|
self._config = config
|
||||||
|
self._locale = config.get("locale")
|
||||||
|
self._send_mqtt_msg = send_mqtt_msg
|
||||||
|
|
||||||
|
def get_entity_color(self, entity):
|
||||||
|
attr = entity.attributes
|
||||||
|
default_color_on = rgb_dec565([253, 216, 53])
|
||||||
|
default_color_off = rgb_dec565([68, 115, 158])
|
||||||
|
icon_color = default_color_on if entity.state == "on" else default_color_off
|
||||||
|
|
||||||
|
if "rgb_color" in attr:
|
||||||
|
color = attr.rgb_color
|
||||||
|
if "brightness" in attr:
|
||||||
|
color = rgb_brightness(color, attr.brightness)
|
||||||
|
icon_color = rgb_dec565(color)
|
||||||
|
elif "brightness" in attr:
|
||||||
|
color = rgb_brightness([253, 216, 53], attr.brightness)
|
||||||
|
icon_color = rgb_dec565(color)
|
||||||
|
return icon_color
|
||||||
|
|
||||||
|
def update_time(self, kwargs):
|
||||||
|
time = datetime.datetime.now().strftime(self._config.get("timeFormat"))
|
||||||
|
self._send_mqtt_msg(f"time,{time}")
|
||||||
|
|
||||||
|
def update_date(self, kwargs):
|
||||||
|
global babel_spec
|
||||||
|
if babel_spec is not None:
|
||||||
|
dateformat = self._config.get("dateFormatBabel")
|
||||||
|
date = babel.dates.format_date(datetime.datetime.now(), dateformat, locale=self._locale)
|
||||||
|
else:
|
||||||
|
dateformat = self._config.get("dateFormat")
|
||||||
|
date = datetime.datetime.now().strftime(dateformat)
|
||||||
|
self._send_mqtt_msg(f"date,?{date}")
|
||||||
|
|
||||||
|
def page_type(self, target_page):
|
||||||
|
self._send_mqtt_msg(f"pageType,{target_page}")
|
||||||
|
|
||||||
|
def update_screensaver_weather(self, kwargs):
|
||||||
|
global babel_spec
|
||||||
|
we_name = kwargs['weather']
|
||||||
|
unit = kwargs['unit']
|
||||||
|
|
||||||
|
if self._ha_api.entity_exists(we_name):
|
||||||
|
we = self._ha_api.get_entity(we_name)
|
||||||
|
else:
|
||||||
|
LOGGER.error("Skipping Weather Update, entitiy not found")
|
||||||
|
return
|
||||||
|
|
||||||
|
icon_cur = get_icon_id_ha("weather", state=we.state)
|
||||||
|
text_cur = f"{we.attributes.temperature}{unit}"
|
||||||
|
|
||||||
|
weather_res = ""
|
||||||
|
for i in range(1,5):
|
||||||
|
wOF = self._config.get(f"weatherOverrideForecast{i}")
|
||||||
|
if wOF is None:
|
||||||
|
up = we.attributes.forecast[i-1]['datetime']
|
||||||
|
up = datetime.datetime.fromisoformat(up)
|
||||||
|
if babel_spec is not None:
|
||||||
|
up = babel.dates.format_date(up, "E", locale=self._locale)
|
||||||
|
else:
|
||||||
|
up = up.strftime("%a")
|
||||||
|
icon = get_icon_id_ha("weather", state=we.attributes.forecast[i-1]['condition'])
|
||||||
|
down = f"{we.attributes.forecast[i-1]['temperature']} {unit}"
|
||||||
|
else:
|
||||||
|
LOGGER.info(f"Forecast 1 is overrriden with {wOF}")
|
||||||
|
icon = None
|
||||||
|
name = None
|
||||||
|
if type(wOF) is dict:
|
||||||
|
icon = next(iter(wOF.items()))[1].get('icon')
|
||||||
|
name = next(iter(wOF.items()))[1].get('name')
|
||||||
|
wOF = next(iter(wOF.items()))[0]
|
||||||
|
entity = self._ha_api.get_entity(wOF)
|
||||||
|
up = name if name is not None else entity.attributes.friendly_name
|
||||||
|
icon = get_icon_id_ha("sensor", state=entity.state, device_class=entity.attributes.get("device_class", ""), overwrite=icon)
|
||||||
|
unit_of_measurement = entity.attributes.get("unit_of_measurement", "")
|
||||||
|
down = f"{entity.state} {unit_of_measurement}"
|
||||||
|
weather_res+=f"?{up}?{icon}?{down}"
|
||||||
|
|
||||||
|
self._send_mqtt_msg(f"weatherUpdate,?{icon_cur}?{text_cur}{weather_res}")
|
||||||
|
|
||||||
|
def generate_entities_item(self, item):
|
||||||
|
icon = None
|
||||||
|
name = None
|
||||||
|
if type(item) is dict:
|
||||||
|
icon = next(iter(item.items()))[1].get('icon')
|
||||||
|
name = next(iter(item.items()))[1].get('name')
|
||||||
|
item = next(iter(item.items()))[0]
|
||||||
|
# type of the item is the string before the "." in the item name
|
||||||
|
item_type = item.split(".")[0]
|
||||||
|
LOGGER.debug(f"Generating item command for {item} with type {item_type}",)
|
||||||
|
# Internal Entities
|
||||||
|
if item_type == "delete":
|
||||||
|
return f",{item_type},,,,,"
|
||||||
|
if item_type == "navigate":
|
||||||
|
page_search = self._config.get_root_page().search_page_by_name(item)
|
||||||
|
if len(page_search) > 0:
|
||||||
|
page_data = page_search[0].data
|
||||||
|
if name is None:
|
||||||
|
name = page_data.get("heading")
|
||||||
|
text = get_translation(self._locale,"PRESS")
|
||||||
|
icon_id = get_icon_id(icon) if icon is not None else get_icon_id(page_data.get("icon", "gesture-tap-button"))
|
||||||
|
return f",button,{item},{icon_id},17299,{name},{text}"
|
||||||
|
else:
|
||||||
|
return f",text,{item},{get_icon_id('alert-circle-outline')},17299,page not found,"
|
||||||
|
if not self._ha_api.entity_exists(item):
|
||||||
|
return f",text,{item},{get_icon_id('alert-circle-outline')},17299,Not found check, apps.yaml"
|
||||||
|
|
||||||
|
# HA Entities
|
||||||
|
entity = self._ha_api.get_entity(item)
|
||||||
|
name = name if name is not None else entity.attributes.friendly_name
|
||||||
|
if item_type == "cover":
|
||||||
|
icon_id = get_icon_id_ha("cover", state=entity.state, overwrite=icon)
|
||||||
|
return f",shutter,{item},{icon_id},17299,{name},"
|
||||||
|
if item_type in "light":
|
||||||
|
switch_val = 1 if entity.state == "on" else 0
|
||||||
|
icon_color = self.get_entity_color(entity)
|
||||||
|
icon_id = get_icon_id_ha("light", overwrite=icon)
|
||||||
|
return f",{item_type},{item},{icon_id},{icon_color},{name},{switch_val}"
|
||||||
|
if item_type in ["switch", "input_boolean"]:
|
||||||
|
switch_val = 1 if entity.state == "on" else 0
|
||||||
|
icon_color = self.get_entity_color(entity)
|
||||||
|
icon_id = get_icon_id_ha(item_type, state=entity.state, overwrite=icon)
|
||||||
|
return f",switch,{item},{icon_id},{icon_color},{name},{switch_val}"
|
||||||
|
if item_type in ["sensor", "binary_sensor"]:
|
||||||
|
device_class = entity.attributes.get("device_class", "")
|
||||||
|
icon_id = get_icon_id_ha("sensor", state=entity.state, device_class=device_class, overwrite=icon)
|
||||||
|
unit_of_measurement = entity.attributes.get("unit_of_measurement", "")
|
||||||
|
value = entity.state + " " + unit_of_measurement
|
||||||
|
icon_color = self.get_entity_color(entity)
|
||||||
|
return f",text,{item},{icon_id},{icon_color},{name},{value}"
|
||||||
|
if item_type in ["button", "input_button"]:
|
||||||
|
icon_id = get_icon_id_ha("button", overwrite=icon)
|
||||||
|
text = get_translation(self._locale,"PRESS")
|
||||||
|
return f",button,{item},{icon_id},17299,{name},{text}"
|
||||||
|
if item_type == "scene":
|
||||||
|
icon_id = get_icon_id_ha("scene", overwrite=icon)
|
||||||
|
text = get_translation(self._locale,"ACTIVATE")
|
||||||
|
return f",button,{item},{icon_id},17299,{name},{text}"
|
||||||
|
if item_type == "number":
|
||||||
|
icon_id = get_icon_id_ha("number", overwrite=icon)
|
||||||
|
min_v = entity.attributes.get("min", 0)
|
||||||
|
max_v = entity.attributes.get("max", 100)
|
||||||
|
return f",number,{item},{icon_id},17299,{name},{entity.state}|{min_v}|{max_v}"
|
||||||
|
|
||||||
|
def generate_entities_page(self, heading, items):
|
||||||
|
navigation = ""
|
||||||
|
command = f"entityUpd,{heading},{navigation}"
|
||||||
|
# Get items and construct cmd string
|
||||||
|
for item in items:
|
||||||
|
command += self.generate_entities_item(item)
|
||||||
|
self._send_mqtt_msg(command)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def generate_thermo_page(self, item):
|
||||||
|
if not self._ha_api.entity_exists(item):
|
||||||
|
command = f"entityUpd,{item},Not found,220,220,Not found,150,300,5"
|
||||||
|
else:
|
||||||
|
entity = self._ha_api.get_entity(item)
|
||||||
|
heading = entity.attributes.friendly_name
|
||||||
|
current_temp = int(get_attr_safe(entity, "current_temperature", 0)*10)
|
||||||
|
dest_temp = int(get_attr_safe(entity, "temperature", 0)*10)
|
||||||
|
status = get_attr_safe(entity, "hvac_action", "")
|
||||||
|
status = get_translation(self._locale,status)
|
||||||
|
min_temp = int(get_attr_safe(entity, "min_temp", 0)*10)
|
||||||
|
max_temp = int(get_attr_safe(entity, "max_temp", 0)*10)
|
||||||
|
step_temp = int(get_attr_safe(entity, "target_temp_step", 0.5)*10)
|
||||||
|
icon_res = ""
|
||||||
|
hvac_modes = get_attr_safe(entity, "hvac_modes", [])
|
||||||
|
for mode in hvac_modes:
|
||||||
|
icon_id = get_icon_id('alert-circle-outline')
|
||||||
|
color_on = 64512
|
||||||
|
if mode == "auto":
|
||||||
|
icon_id = get_icon_id("calendar-sync")
|
||||||
|
color_on = 1024
|
||||||
|
if mode == "heat":
|
||||||
|
icon_id = get_icon_id("fire")
|
||||||
|
color_on = 64512
|
||||||
|
if mode == "off":
|
||||||
|
icon_id = get_icon_id("power")
|
||||||
|
color_on = 35921
|
||||||
|
if mode == "cool":
|
||||||
|
icon_id = get_icon_id("snowflake")
|
||||||
|
color_on = 11487
|
||||||
|
if mode == "dry":
|
||||||
|
icon_id = get_icon_id("water-percent")
|
||||||
|
color_on = 60897
|
||||||
|
if mode == "fan_only":
|
||||||
|
icon_id = get_icon_id("fan")
|
||||||
|
color_on = 35921
|
||||||
|
state = 0
|
||||||
|
if(mode == entity.state):
|
||||||
|
state = 1
|
||||||
|
icon_res += f",{icon_id},{color_on},{state},{mode}"
|
||||||
|
|
||||||
|
len_hvac_modes = len(hvac_modes)
|
||||||
|
if len_hvac_modes%2 == 0:
|
||||||
|
# even
|
||||||
|
padding_len = int((4-len_hvac_modes)/2)
|
||||||
|
icon_res = ","*4*padding_len + icon_res + ","*4*padding_len
|
||||||
|
# use last 4 icons
|
||||||
|
icon_res = ","*4*5 + icon_res
|
||||||
|
else:
|
||||||
|
# uneven
|
||||||
|
padding_len = int((5-len_hvac_modes)/2)
|
||||||
|
icon_res = ","*4*padding_len + icon_res + ","*4*padding_len
|
||||||
|
# use first 5 icons
|
||||||
|
icon_res = icon_res + ","*4*4
|
||||||
|
command = f"entityUpd,{item},{heading},{current_temp},{dest_temp},{status},{min_temp},{max_temp},{step_temp}{icon_res}"
|
||||||
|
self._send_mqtt_msg(command)
|
||||||
|
|
||||||
|
def generate_media_page(self, item):
|
||||||
|
if not self._ha_api.entity_exists(item):
|
||||||
|
command = f"entityUpd,|{item}|Not found|{get_icon_id('alert-circle-outline')}|Please check your|apps.yaml in AppDaemon|50|{get_icon_id('alert-circle-outline')}"
|
||||||
|
else:
|
||||||
|
entity = self._ha_api.get_entity(item)
|
||||||
|
heading = entity.attributes.friendly_name
|
||||||
|
icon = 0
|
||||||
|
title = get_attr_safe(entity, "media_title", "")
|
||||||
|
author = get_attr_safe(entity, "media_artist", "")
|
||||||
|
volume = int(get_attr_safe(entity, "volume_level", 0)*100)
|
||||||
|
iconplaypause = get_icon_id("pause") if entity.state == "playing" else get_icon_id("play")
|
||||||
|
if "media_content_type" in entity.attributes:
|
||||||
|
if entity.attributes.media_content_type == "music":
|
||||||
|
icon = get_icon_id("music")
|
||||||
|
source = get_attr_safe(entity, "source", "")
|
||||||
|
speakerlist = get_attr_safe(entity, "source_list",[])
|
||||||
|
if source in speakerlist:
|
||||||
|
# move current source to the end of the list
|
||||||
|
speakerlist.remove(source)
|
||||||
|
speakerlist.append(source)
|
||||||
|
if len(speakerlist) == 1:
|
||||||
|
speakerlist = []
|
||||||
|
speakerlist = "?".join(speakerlist)
|
||||||
|
bits = entity.attributes.supported_features
|
||||||
|
onoffbutton = "disable"
|
||||||
|
if bits & 0b10000000:
|
||||||
|
if entity.state == "off":
|
||||||
|
onoffbutton = 1374
|
||||||
|
else:
|
||||||
|
onoffbutton = rgb_dec565([255,255,255])
|
||||||
|
command = f"entityUpd,|{item}|{heading}|{icon}|{title}|{author}|{volume}|{iconplaypause}|{source}|{speakerlist[:200]}|{onoffbutton}"
|
||||||
|
self._send_mqtt_msg(command)
|
||||||
|
|
||||||
|
def generate_alarm_page(self, item):
|
||||||
|
if not self._ha_api.entity_exists(item):
|
||||||
|
command = f"entityUpd,{item},Not found,Not found,Check your,Check your,apps.,apps.,yaml,yaml,0,,0"
|
||||||
|
else:
|
||||||
|
entity = self._ha_api.get_entity(item)
|
||||||
|
icon = get_icon_id("shield-off")
|
||||||
|
color = rgb_dec565([255,255,255])
|
||||||
|
supported_modes = []
|
||||||
|
numpad = "enable"
|
||||||
|
if entity.state == "disarmed":
|
||||||
|
color = rgb_dec565([13,160,53])
|
||||||
|
icon = get_icon_id("shield-off")
|
||||||
|
test = entity.attributes.get("code_arm_required", "false")
|
||||||
|
if not entity.attributes.get("code_arm_required", False):
|
||||||
|
numpad = "disable"
|
||||||
|
bits = entity.attributes.supported_features
|
||||||
|
if bits & 0b000001:
|
||||||
|
supported_modes.append("arm_home")
|
||||||
|
if bits & 0b000010:
|
||||||
|
supported_modes.append("arm_away")
|
||||||
|
if bits & 0b000100:
|
||||||
|
supported_modes.append("arm_night")
|
||||||
|
if bits & 0b100000:
|
||||||
|
supported_modes.append("arm_vacation")
|
||||||
|
else:
|
||||||
|
supported_modes.append("disarm")
|
||||||
|
|
||||||
|
if entity.state == "armed_home":
|
||||||
|
color = rgb_dec565([223,76,30])
|
||||||
|
icon = get_icon_id("shield-home")
|
||||||
|
if entity.state == "armed_away":
|
||||||
|
color = rgb_dec565([223,76,30])
|
||||||
|
icon = get_icon_id("shield-lock")
|
||||||
|
if entity.state == "armed_night":
|
||||||
|
color = rgb_dec565([223,76,30])
|
||||||
|
icon = get_icon_id("weather-night")
|
||||||
|
if entity.state == "armed_vacation":
|
||||||
|
color = rgb_dec565([223,76,30])
|
||||||
|
icon = get_icon_id("shield-airplane")
|
||||||
|
|
||||||
|
flashing = "disable"
|
||||||
|
if entity.state in ["arming", "pending"]:
|
||||||
|
color = rgb_dec565([243,179,0])
|
||||||
|
icon = get_icon_id("shield")
|
||||||
|
flashing = "enable"
|
||||||
|
if entity.state == "triggered":
|
||||||
|
color = rgb_dec565([223,76,30])
|
||||||
|
icon = get_icon_id("bell-ring")
|
||||||
|
flashing = "enable"
|
||||||
|
|
||||||
|
# add padding to arm buttons
|
||||||
|
arm_buttons = ""
|
||||||
|
for b in supported_modes:
|
||||||
|
arm_buttons += f",{get_translation(self._locale, b)},{b}"
|
||||||
|
if len(supported_modes) < 4:
|
||||||
|
arm_buttons += ","*((4-len(supported_modes))*2)
|
||||||
|
command = f"entityUpd,{item}{arm_buttons},{icon},{color},{numpad},{flashing}"
|
||||||
|
self._send_mqtt_msg(command)
|
||||||
|
|
||||||
|
def render_page(self, page, send_page_type=True):
|
||||||
|
config = page.data
|
||||||
|
page_type = config["type"]
|
||||||
|
LOGGER.info(f"Started rendering of page {page.pos} with type {page_type}")
|
||||||
|
# Switch to page
|
||||||
|
if send_page_type:
|
||||||
|
self.page_type(page_type)
|
||||||
|
if page_type in ["cardEntities", "cardGrid"]:
|
||||||
|
heading = config.get("heading", "unknown")
|
||||||
|
self.generate_entities_page(heading, page.get_items())
|
||||||
|
return
|
||||||
|
if page_type == "cardThermo":
|
||||||
|
self.generate_thermo_page(page.data.get("item"))
|
||||||
|
if page_type == "cardMedia":
|
||||||
|
self.generate_media_page(page.data.get("item"))
|
||||||
|
if page_type == "cardAlarm":
|
||||||
|
self.generate_alarm_page(page.data.get("item"))
|
||||||
|
|
||||||
|
|
||||||
|
def generate_light_detail_page(self, entity):
|
||||||
|
entity = self._ha_api.get_entity(entity)
|
||||||
|
switch_val = 1 if entity.state == "on" else 0
|
||||||
|
icon_color = self.get_entity_color(entity)
|
||||||
|
brightness = "disable"
|
||||||
|
color_temp = "disable"
|
||||||
|
color = "disable"
|
||||||
|
if entity.state == "on":
|
||||||
|
if "brightness" in entity.attributes:
|
||||||
|
# scale 0-255 brightness from ha to 0-100
|
||||||
|
brightness = int(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(scale(entity.attributes.color_temp,(entity.attributes.min_mireds, entity.attributes.max_mireds),(0,100)))
|
||||||
|
else:
|
||||||
|
color_temp = "unknown"
|
||||||
|
else:
|
||||||
|
color_temp = "disable"
|
||||||
|
list_color_modes = ["xy", "rgb", "rgbw", "hs"]
|
||||||
|
if any(item in list_color_modes for item in entity.attributes.supported_color_modes):
|
||||||
|
color = "enable"
|
||||||
|
else:
|
||||||
|
color = "disable"
|
||||||
|
self._send_mqtt_msg(f"entityUpdateDetail,{get_icon_id('lightbulb')},{icon_color},{switch_val},{brightness},{color_temp},{color}")
|
||||||
|
|
||||||
|
def generate_shutter_detail_page(self, entity):
|
||||||
|
entity = self._ha_api.get_entity(entity)
|
||||||
|
pos = 100-int(entity.attributes.get("current_position", 50))
|
||||||
|
self._send_mqtt_msg(f"entityUpdateDetail,{pos}")
|
||||||
|
|
||||||
|
def send_message_page(self, id, heading, msg, b1, b2):
|
||||||
|
self._send_mqtt_msg(f"pageType,popupNotify")
|
||||||
|
self._send_mqtt_msg(f"entityUpdateDetail,|{id}|{heading}|65535|{b1}|65535|{b2}|65535|{msg}|65535|0")
|
||||||
81
apps/nspanel-lovelace-ui/luibackend/updater.py
Normal file
81
apps/nspanel-lovelace-ui/luibackend/updater.py
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
import logging
|
||||||
|
|
||||||
|
LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
class Updater:
|
||||||
|
def __init__(self, send_mqtt_msg, topic_send, mode, desired_display_firmware_version, desired_display_firmware_url, desired_tasmota_driver_version, desired_tasmota_driver_url):
|
||||||
|
self.desired_display_firmware_version = desired_display_firmware_version
|
||||||
|
self.desired_display_firmware_url = desired_display_firmware_url
|
||||||
|
self.desired_tasmota_driver_version = desired_tasmota_driver_version
|
||||||
|
self.desired_tasmota_driver_url = desired_tasmota_driver_url
|
||||||
|
|
||||||
|
self.mode = mode
|
||||||
|
self._send_mqtt_msg = send_mqtt_msg
|
||||||
|
self.topic_send = topic_send
|
||||||
|
self.current_tasmota_driver_version = None
|
||||||
|
self.current_display_firmware_version = None
|
||||||
|
|
||||||
|
def set_tasmota_driver_version(self, driver_version):
|
||||||
|
self.current_tasmota_driver_version = driver_version
|
||||||
|
def set_current_display_firmware_version(self, panel_version):
|
||||||
|
self.current_display_firmware_version = panel_version
|
||||||
|
|
||||||
|
def check_pre_req(self):
|
||||||
|
# we need to know both versions to continue
|
||||||
|
if self.current_tasmota_driver_version is not None and self.current_display_firmware_version is not None:
|
||||||
|
# tasmota driver has to be at least version 2 for Update command
|
||||||
|
# and panel has to be at version 11 for notify commands
|
||||||
|
# version 16 for new button cmd format
|
||||||
|
if self.current_tasmota_driver_version >= 2 and self.current_display_firmware_version >= 16:
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
|
def send_message_page(self, id, heading, msg, b1, b2):
|
||||||
|
self._send_mqtt_msg(f"pageType,popupNotify")
|
||||||
|
self._send_mqtt_msg(f"entityUpdateDetail,|{id}|{heading}|65535|{b1}|65535|{b2}|65535|{msg}|65535|0")
|
||||||
|
|
||||||
|
def check_updates(self):
|
||||||
|
# return's true if a notification was send to the panel
|
||||||
|
# run pre req check
|
||||||
|
if self.check_pre_req():
|
||||||
|
LOGGER.info("Update Pre-Check sucessful Tasmota Driver Version: %s Panel Version: %s", self.current_tasmota_driver_version, self.current_display_firmware_version)
|
||||||
|
# check if tasmota driver needs update
|
||||||
|
if self.current_tasmota_driver_version < self.desired_tasmota_driver_version:
|
||||||
|
LOGGER.info("Update of Tasmota Driver needed")
|
||||||
|
# in auto mode just do the update
|
||||||
|
if self.mode == "auto":
|
||||||
|
self.update_berry_driver()
|
||||||
|
return False
|
||||||
|
# send notification about the update
|
||||||
|
if self.mode == "auto-notify":
|
||||||
|
update_msg = "There's an update available for the Tasmota Berry driver, do you want to start the update now? If you encounter issues after the update or this message appears frequently, please check the manual and repeat the installation steps for the Tasmota Berry driver. "
|
||||||
|
self.send_message_page("updateBerryNoYes", "Driver Update available!", update_msg, "Dismiss", "Yes")
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
# check if display firmware needs an update
|
||||||
|
if self.current_display_firmware_version < self.desired_display_firmware_version:
|
||||||
|
LOGGER.info("Update of Display Firmware needed")
|
||||||
|
# in auto mode just do the update
|
||||||
|
if self.mode == "auto":
|
||||||
|
self.update_panel_driver()
|
||||||
|
return False
|
||||||
|
# send notification about the update
|
||||||
|
if self.mode == "auto-notify":
|
||||||
|
update_msg = "There's a firmware update available for the Nextion screen of the NSPanel. Do you want tostart the update now? If the update fails check the installation manual and flash again over the Tasmota console. Be patient, the update will take a while."
|
||||||
|
self.send_message_page("updateDisplayNoYes", "Display Update available!", update_msg, "Dismiss", "Yes")
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
else:
|
||||||
|
LOGGER.info("Update Pre-Check failed Tasmota Driver Version: %s Panel Version: %s", self.current_tasmota_driver_version, self.current_display_firmware_version)
|
||||||
|
return False
|
||||||
|
|
||||||
|
def request_berry_driver_version(self):
|
||||||
|
topic = self.topic_send.replace("CustomSend", "GetDriverVersion")
|
||||||
|
self._send_mqtt_msg("X", topic=topic)
|
||||||
|
|
||||||
|
def update_berry_driver(self):
|
||||||
|
topic = self.topic_send.replace("CustomSend", "UpdateDriverVersion")
|
||||||
|
self._send_mqtt_msg(self.desired_tasmota_driver_url, topic=topic)
|
||||||
|
def update_panel_driver(self):
|
||||||
|
topic = self.topic_send.replace("CustomSend", "FlashNextion")
|
||||||
|
self._send_mqtt_msg(self.desired_display_firmware_url, topic=topic)
|
||||||
@@ -1,487 +1,79 @@
|
|||||||
import json
|
import logging
|
||||||
import datetime
|
import traceback
|
||||||
|
|
||||||
import hassapi as hass
|
import hassapi as hass
|
||||||
|
|
||||||
import math
|
from luibackend.config import LuiBackendConfig
|
||||||
import colorsys
|
from luibackend.controller import LuiController
|
||||||
|
from luibackend.mqttListener import LuiMqttListener
|
||||||
|
from luibackend.updater import Updater
|
||||||
|
|
||||||
|
LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
class AppDaemonLoggingHandler(logging.Handler):
|
||||||
|
def __init__(self, app):
|
||||||
|
super().__init__()
|
||||||
|
self._app = app
|
||||||
|
|
||||||
|
def emit(self, record):
|
||||||
|
message = record.getMessage()
|
||||||
|
if record.exc_info:
|
||||||
|
message += '\nTraceback (most recent call last):\n'
|
||||||
|
message += '\n'.join(traceback.format_tb(record.exc_info[2]))
|
||||||
|
message += f'{record.exc_info[0].__name__}: {record.exc_info[1]}'
|
||||||
|
self._app.log(message, level=record.levelname)
|
||||||
|
|
||||||
|
|
||||||
class NsPanelLovelaceUIManager(hass.Hass):
|
class NsPanelLovelaceUIManager(hass.Hass):
|
||||||
def initialize(self):
|
def __init__(self, *args, **kwargs):
|
||||||
|
super().__init__(*args, **kwargs)
|
||||||
|
self._redirect_logging()
|
||||||
|
|
||||||
data = self.args["config"]
|
def _redirect_logging(self):
|
||||||
NsPanelLovelaceUI(self, data)
|
# Add a handler for the logging module that will convert the
|
||||||
|
# calls to AppDaemon's logger with the self instance, so that
|
||||||
|
# we can simply use logging in the rest of the application
|
||||||
|
rlogger = logging.getLogger()
|
||||||
|
rlogger.handlers = [
|
||||||
|
h for h in rlogger.handlers
|
||||||
|
if type(h).__name__ != AppDaemonLoggingHandler.__name__
|
||||||
|
]
|
||||||
|
rlogger.addHandler(AppDaemonLoggingHandler(self))
|
||||||
|
|
||||||
class NsPanelLovelaceUI:
|
# We want to grab all the logs, AppDaemon will
|
||||||
def __init__(self, api, config):
|
# then care about filtering those we asked for
|
||||||
self.api = api
|
rlogger.setLevel(logging.DEBUG)
|
||||||
self.config = config
|
|
||||||
self.current_page_nr = 0
|
|
||||||
self.current_screensaver_brightness = 10
|
|
||||||
|
|
||||||
# check configured items
|
|
||||||
self.check_items()
|
|
||||||
|
|
||||||
# Setup, mqtt subscription and callback
|
|
||||||
self.mqtt = self.api.get_plugin_api("MQTT")
|
|
||||||
self.mqtt.mqtt_subscribe(topic=self.config["panelRecvTopic"])
|
|
||||||
self.mqtt.listen_event(self.handle_mqtt_incoming_message, "MQTT_MESSAGE", topic=self.config["panelRecvTopic"], namespace='mqtt')
|
|
||||||
|
|
||||||
# send panel back to startup page on restart of this script
|
|
||||||
self.send_mqtt_msg("pageType,pageStartup")
|
|
||||||
|
|
||||||
|
|
||||||
# Setup time callback
|
|
||||||
time = datetime.time(0, 0, 0)
|
|
||||||
self.api.run_minutely(self.update_time, time)
|
|
||||||
|
|
||||||
# Setup date callback
|
def initialize(self):
|
||||||
time = datetime.time(0, 0, 0)
|
LOGGER.info('Starting')
|
||||||
self.api.run_daily(self.update_date, time)
|
mqtt_api = self._mqtt_api = self.get_plugin_api("MQTT")
|
||||||
self.update_date("")
|
cfg = self._cfg = LuiBackendConfig(self.args["config"])
|
||||||
|
|
||||||
# Setup weather callback
|
|
||||||
weather_interval = 15 * 60 # 15 minutes
|
|
||||||
self.api.run_every(self.update_screensaver_weather, "now", weather_interval)
|
|
||||||
|
|
||||||
# set brightness of screensaver
|
|
||||||
if type(self.config["brightnessScreensaver"]) == int:
|
|
||||||
self.current_screensaver_brightness = self.config["brightnessScreensaver"]
|
|
||||||
elif type(self.config["brightnessScreensaver"]) == list:
|
|
||||||
sorted_timesets = sorted(self.config["brightnessScreensaver"], key=lambda d: self.api.parse_time(d['time']))
|
|
||||||
found_current_dim_value = False
|
|
||||||
for index, timeset in enumerate(sorted_timesets):
|
|
||||||
self.api.run_daily(self.update_screensaver_brightness, timeset["time"], value=timeset["value"])
|
|
||||||
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:
|
|
||||||
# first time after current time, set dim value
|
|
||||||
self.current_screensaver_brightness = sorted_timesets[index-1]["value"]
|
|
||||||
self.api.log("Setting dim value to %s", sorted_timesets[index-1]) #level="DEBUG"
|
|
||||||
found_current_dim_value = True
|
|
||||||
# send screensaver brightness in case config has changed
|
|
||||||
self.update_screensaver_brightness(kwargs={"value": self.current_screensaver_brightness})
|
|
||||||
|
|
||||||
# send date update in case config has been changed
|
|
||||||
self.update_date("")
|
|
||||||
|
|
||||||
|
|
||||||
# register callbacks
|
|
||||||
self.register_callbacks()
|
|
||||||
|
|
||||||
def handle_mqtt_incoming_message(self, event_name, data, kwargs):
|
|
||||||
# Parse Json Message from Tasmota and strip out message from nextion display
|
|
||||||
data = json.loads(data["payload"])
|
|
||||||
if("CustomRecv" not in data):
|
|
||||||
self.api.log("Received Message from Tasmota: %s", data, level="DEBUG")
|
|
||||||
return
|
|
||||||
msg = data["CustomRecv"]
|
|
||||||
self.api.log("Received Message from Tasmota: %s", msg, level="DEBUG")
|
|
||||||
|
|
||||||
# Split message into parts seperated by ","
|
|
||||||
msg = msg.split(",")
|
|
||||||
|
|
||||||
# run action based on received command
|
|
||||||
# TODO: replace with match case after appdeamon container swiched to python 3.10 - https://pakstech.com/blog/python-switch-case/ - https://www.python.org/dev/peps/pep-0636/
|
|
||||||
if msg[0] == "event":
|
|
||||||
|
|
||||||
if msg[1] == "startup":
|
|
||||||
self.api.log("Handling startup event", level="DEBUG")
|
|
||||||
|
|
||||||
# send date and time
|
topic_send = cfg.get("panelSendTopic")
|
||||||
self.update_time("")
|
def send_mqtt_msg(msg, topic=None):
|
||||||
self.update_date("")
|
if topic is None:
|
||||||
|
topic = topic_send
|
||||||
|
LOGGER.info(f"Sending MQTT Message: {msg}")
|
||||||
|
mqtt_api.mqtt_publish(topic, msg)
|
||||||
|
|
||||||
# set screensaver timeout
|
# Request Tasmota Driver Version
|
||||||
timeout = self.config["timeoutScreensaver"]
|
mqtt_api.mqtt_publish(topic_send.replace("CustomSend", "GetDriverVersion"), "x")
|
||||||
self.send_mqtt_msg(f"timeout,{timeout}")
|
|
||||||
|
|
||||||
# send screensaver brightness
|
controller = LuiController(self, cfg, send_mqtt_msg)
|
||||||
self.update_screensaver_brightness(kwargs={"value": self.current_screensaver_brightness})
|
|
||||||
|
|
||||||
# send messages for current page
|
desired_display_firmware_version = 22
|
||||||
page_type = self.config["pages"][self.current_page_nr]["type"]
|
desired_display_firmware_url = "http://nspanel.pky.eu/lovelace-ui/github/nspanel-v2.0.0.tft"
|
||||||
self.generate_page(self.current_page_nr, page_type)
|
desired_tasmota_driver_version = 3
|
||||||
|
desired_tasmota_driver_url = "https://raw.githubusercontent.com/joBr99/nspanel-lovelace-ui/main/tasmota/autoexec.be"
|
||||||
|
|
||||||
|
mode = cfg.get("updateMode")
|
||||||
|
topic_send = cfg.get("panelSendTopic")
|
||||||
|
updater = Updater(send_mqtt_msg, topic_send, mode, desired_display_firmware_version, desired_display_firmware_url, desired_tasmota_driver_version, desired_tasmota_driver_url)
|
||||||
|
|
||||||
if msg[1] == "pageOpen":
|
topic_recv = cfg.get("panelRecvTopic")
|
||||||
# Calculate current page
|
LuiMqttListener(mqtt_api, topic_recv, controller, updater)
|
||||||
recv_page = int(msg[2])
|
|
||||||
self.current_page_nr = recv_page % len(self.config["pages"])
|
|
||||||
self.api.log("Received pageOpen command, raw page: %i, calc page: %i", recv_page, self.current_page_nr, level="DEBUG")
|
|
||||||
# get type of current page
|
|
||||||
page_type = self.config["pages"][self.current_page_nr]["type"]
|
|
||||||
# generate commands for current page
|
|
||||||
self.generate_page(self.current_page_nr, page_type)
|
|
||||||
|
|
||||||
if msg[1] == "buttonPress":
|
LOGGER.info('Started')
|
||||||
entity_id = msg[4]
|
|
||||||
btype = msg[6]
|
|
||||||
if len(msg) > 7:
|
|
||||||
value = msg[7]
|
|
||||||
else:
|
|
||||||
value = None
|
|
||||||
self.handle_button_press(entity_id, btype, value)
|
|
||||||
|
|
||||||
if msg[1] == "pageOpenDetail":
|
|
||||||
self.api.log("Received pageOpenDetail command", level="DEBUG")
|
|
||||||
self.generate_detail_page(msg[2], msg[3])
|
|
||||||
|
|
||||||
if msg[1] == "tempUpd":
|
|
||||||
self.api.log("Received tempUpd command", level="DEBUG")
|
|
||||||
temp = int(msg[4])/10
|
|
||||||
self.api.get_entity(msg[3]).call_service("set_temperature", temperature=temp)
|
|
||||||
|
|
||||||
if msg[1] == "screensaverOpen":
|
|
||||||
self.update_screensaver_weather("")
|
|
||||||
|
|
||||||
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)
|
|
||||||
|
|
||||||
def update_time(self, kwargs):
|
|
||||||
time = datetime.datetime.now().strftime(self.config["timeFormat"])
|
|
||||||
self.send_mqtt_msg("time,{0}".format(time))
|
|
||||||
|
|
||||||
def update_date(self, kwargs):
|
|
||||||
# TODO: implement localization of date
|
|
||||||
date = datetime.datetime.now().strftime(self.config["dateFormat"])
|
|
||||||
self.send_mqtt_msg("date,?{0}".format(date))
|
|
||||||
|
|
||||||
def update_screensaver_brightness(self, kwargs):
|
|
||||||
self.current_screensaver_brightness = kwargs['value']
|
|
||||||
self.send_mqtt_msg(f"dimmode,{self.current_screensaver_brightness}")
|
|
||||||
|
|
||||||
def update_screensaver_weather(self, kwargs):
|
|
||||||
if not ("weatherEntity" in self.config and self.api.entity_exists(self.config["weatherEntity"])):
|
|
||||||
return
|
|
||||||
we = self.api.get_entity(self.config["weatherEntity"])
|
|
||||||
unit = "°C"
|
|
||||||
|
|
||||||
weathericons = {
|
|
||||||
'clear-night': 17,
|
|
||||||
'cloudy': 12,
|
|
||||||
'exceptional': 11,
|
|
||||||
'fog': 13,
|
|
||||||
'hail': 14,
|
|
||||||
'lightning': 15,
|
|
||||||
'lightning-rainy': 16,
|
|
||||||
'partlycloudy': 18,
|
|
||||||
'pouring': 19,
|
|
||||||
'rainy': 20,
|
|
||||||
'snowy': 21,
|
|
||||||
'snowy-rainy': 22,
|
|
||||||
'sunny': 23,
|
|
||||||
'windy': 24,
|
|
||||||
'windy-variant': 25
|
|
||||||
}
|
|
||||||
|
|
||||||
o1 = we.attributes.forecast[0]['datetime']
|
|
||||||
o1 = datetime.datetime.fromisoformat(o1)
|
|
||||||
o1 = o1.strftime("%a")
|
|
||||||
i1 = weathericons[we.attributes.forecast[0]['condition']]
|
|
||||||
u1 = we.attributes.forecast[0]['temperature']
|
|
||||||
o2 = we.attributes.forecast[1]['datetime']
|
|
||||||
o2 = datetime.datetime.fromisoformat(o2)
|
|
||||||
o2 = o2.strftime("%a")
|
|
||||||
i2 = weathericons[we.attributes.forecast[1]['condition']]
|
|
||||||
u2 = we.attributes.forecast[1]['temperature']
|
|
||||||
self.send_mqtt_msg(f"weatherUpdate,?{weathericons[we.state]}?{we.attributes.temperature}{unit}?{26}?{we.attributes.humidity} %?{o1}?{i1}?{u1}?{o2}?{i2}?{u2}")
|
|
||||||
|
|
||||||
def scale(self, val, src, dst):
|
|
||||||
"""
|
|
||||||
Scale the given value from the scale of src to the scale of dst.
|
|
||||||
"""
|
|
||||||
return ((val - src[0]) / (src[1]-src[0])) * (dst[1]-dst[0]) + dst[0]
|
|
||||||
|
|
||||||
def handle_button_press(self, entity_id, btype, optVal=None):
|
|
||||||
if(btype == "OnOff"):
|
|
||||||
if(optVal == "1"):
|
|
||||||
self.api.turn_on(entity_id)
|
|
||||||
else:
|
|
||||||
self.api.turn_off(entity_id)
|
|
||||||
if(btype == "up"):
|
|
||||||
self.api.get_entity(entity_id).call_service("open_cover")
|
|
||||||
if(btype == "stop"):
|
|
||||||
self.api.get_entity(entity_id).call_service("stop_cover")
|
|
||||||
if(btype == "down"):
|
|
||||||
self.api.get_entity(entity_id).call_service("close_cover")
|
|
||||||
|
|
||||||
if(btype == "button"):
|
|
||||||
if(entity_id.startswith('scene')):
|
|
||||||
self.api.get_entity(entity_id).call_service("turn_on")
|
|
||||||
else:
|
|
||||||
self.api.get_entity(entity_id).call_service("press")
|
|
||||||
|
|
||||||
if(btype == "media-next"):
|
|
||||||
self.api.get_entity(entity_id).call_service("media_next_track")
|
|
||||||
if(btype == "media-back"):
|
|
||||||
self.api.get_entity(entity_id).call_service("media_previous_track")
|
|
||||||
if(btype == "media-pause"):
|
|
||||||
self.api.get_entity(entity_id).call_service("media_play_pause")
|
|
||||||
|
|
||||||
|
|
||||||
if(btype == "brightnessSlider"):
|
|
||||||
# scale 0-100 to ha brightness range
|
|
||||||
brightness = int(self.scale(int(optVal),(0,100),(0,255)))
|
|
||||||
self.api.get_entity(entity_id).call_service("turn_on", brightness=brightness)
|
|
||||||
|
|
||||||
if(btype == "colorTempSlider"):
|
|
||||||
entity = self.api.get_entity(entity_id)
|
|
||||||
#scale 0-100 from slider to color range of lamp
|
|
||||||
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)
|
|
||||||
|
|
||||||
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"):
|
|
||||||
pos = int(optVal)
|
|
||||||
self.api.get_entity(entity_id).call_service("set_cover_position", position=pos)
|
|
||||||
|
|
||||||
if(btype == "volumeSlider"):
|
|
||||||
pos = int(optVal)
|
|
||||||
# HA wants this value between 0 and 1 as float
|
|
||||||
pos = pos/100
|
|
||||||
self.api.get_entity(entity_id).call_service("volume_set", volume_level=pos)
|
|
||||||
|
|
||||||
def check_items(self):
|
|
||||||
items = []
|
|
||||||
for page in self.config["pages"]:
|
|
||||||
if "item" in page:
|
|
||||||
items.append(page["item"])
|
|
||||||
if "items" in page:
|
|
||||||
items.extend(page["items"])
|
|
||||||
|
|
||||||
for item in items:
|
|
||||||
if self.api.entity_exists(item) or item == "delete":
|
|
||||||
self.api.log("Found configured item in Home Assistant %s", item, level="DEBUG")
|
|
||||||
else:
|
|
||||||
self.api.error("The following item does not exist in Home Assistant, configuration error: %s", item)
|
|
||||||
|
|
||||||
def register_callbacks(self):
|
|
||||||
items = []
|
|
||||||
for page in self.config["pages"]:
|
|
||||||
if "item" in page:
|
|
||||||
items.append(page["item"])
|
|
||||||
if "items" in page:
|
|
||||||
items.extend(page["items"])
|
|
||||||
|
|
||||||
for item in items:
|
|
||||||
if not self.api.entity_exists(item):
|
|
||||||
continue
|
|
||||||
self.api.log("Enable state callback for %s", item, level="DEBUG")
|
|
||||||
self.api.handle = self.api.listen_state(self.state_change_callback, entity_id=item, attribute="all")
|
|
||||||
|
|
||||||
def state_change_callback(self, entity, attribute, old, new, kwargs):
|
|
||||||
current_page_config = self.config["pages"][self.current_page_nr]
|
|
||||||
|
|
||||||
page_type = current_page_config["type"]
|
|
||||||
|
|
||||||
self.api.log("Got state_callback from {0}".format(entity), level="DEBUG")
|
|
||||||
|
|
||||||
if page_type == "cardEntities":
|
|
||||||
items = current_page_config["items"]
|
|
||||||
if entity in items:
|
|
||||||
self.api.log("State change on current page for {0}".format(entity), level="DEBUG")
|
|
||||||
# send update of the item on page
|
|
||||||
command = self.generate_entities_item(entity, items.index(entity)+1)
|
|
||||||
self.send_mqtt_msg(command)
|
|
||||||
if(entity.startswith("cover")):
|
|
||||||
self.generate_detail_page("popupShutter", entity)
|
|
||||||
if(entity.startswith("light")):
|
|
||||||
self.generate_detail_page("popupLight", entity)
|
|
||||||
|
|
||||||
return
|
|
||||||
|
|
||||||
if page_type == "cardThermo" or page_type == "cardMedia":
|
|
||||||
if entity == current_page_config["item"]:
|
|
||||||
self.api.log("State change on current page for {0}".format(entity), level="DEBUG")
|
|
||||||
# send update of the whole page
|
|
||||||
if page_type == "cardThermo":
|
|
||||||
self.send_mqtt_msg(self.generate_thermo_page(entity))
|
|
||||||
return
|
|
||||||
if page_type == "cardMedia":
|
|
||||||
self.send_mqtt_msg(self.generate_media_page(entity))
|
|
||||||
return
|
|
||||||
return
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# TODO: Call Method for refresh of the item/page of the current entity
|
|
||||||
|
|
||||||
def generate_entities_item(self, item, item_nr):
|
|
||||||
|
|
||||||
# type of item is the string before the "." in the item name
|
|
||||||
item_type = item.split(".")[0]
|
|
||||||
|
|
||||||
self.api.log("Generating item command for %s with type %s", item, item_type, level="DEBUG")
|
|
||||||
|
|
||||||
if item_type == "delete":
|
|
||||||
return "entityUpd,{0},{1}".format(item_nr, item_type)
|
|
||||||
|
|
||||||
if not self.api.entity_exists(item):
|
|
||||||
return
|
|
||||||
entity = self.api.get_entity(item)
|
|
||||||
name = entity.attributes.friendly_name
|
|
||||||
|
|
||||||
if item_type == "cover":
|
|
||||||
return "entityUpd,{0},{1},{2},{3},{4}".format(item_nr, "shutter", item, 0, name)
|
|
||||||
|
|
||||||
if item_type == "light":
|
|
||||||
switch_val = 1 if entity.state == "on" else 0
|
|
||||||
return "entityUpd,{0},{1},{2},{3},{4},{5}".format(item_nr, item_type, item, 1, name, switch_val)
|
|
||||||
|
|
||||||
if item_type == "switch" or item_type == "input_boolean":
|
|
||||||
switch_val = 1 if entity.state == "on" else 0
|
|
||||||
icon_id = 4
|
|
||||||
if item_type == "input_boolean" and switch_val == 1:
|
|
||||||
icon_id = 6
|
|
||||||
else:
|
|
||||||
icon_id = 7
|
|
||||||
|
|
||||||
return "entityUpd,{0},{1},{2},{3},{4},{5}".format(item_nr, "switch", item, icon_id, name, switch_val)
|
|
||||||
|
|
||||||
if item_type == "sensor":
|
|
||||||
icon_id = 0
|
|
||||||
icon_mapping = {
|
|
||||||
"temperature": 2,
|
|
||||||
"power": 4
|
|
||||||
}
|
|
||||||
if entity.attributes.device_class in icon_mapping:
|
|
||||||
icon_id = icon_mapping[entity.attributes.device_class]
|
|
||||||
|
|
||||||
value = entity.state + " " + entity.attributes.unit_of_measurement
|
|
||||||
return "entityUpd,{0},{1},{2},{3},{4},{5}".format(item_nr, "text", item, icon_id, name, value)
|
|
||||||
|
|
||||||
if item_type == "button" or item_type == "input_button":
|
|
||||||
return "entityUpd,{0},{1},{2},{3},{4},{5}".format(item_nr, "button", item, 3, name, "PRESS")
|
|
||||||
|
|
||||||
if item_type == "scene":
|
|
||||||
return "entityUpd,{0},{1},{2},{3},{4},{5}".format(item_nr, "button", item, 10, name, "ACTIVATE")
|
|
||||||
|
|
||||||
def generate_thermo_page(self, item):
|
|
||||||
|
|
||||||
if not self.api.entity_exists(item):
|
|
||||||
return
|
|
||||||
|
|
||||||
entity = self.api.get_entity(item)
|
|
||||||
heading = entity.attributes.friendly_name
|
|
||||||
current_temp = int(entity.attributes.current_temperature*10)
|
|
||||||
dest_temp = int(entity.attributes.temperature*10)
|
|
||||||
status = entity.attributes.hvac_action
|
|
||||||
min_temp = int(entity.attributes.min_temp*10)
|
|
||||||
max_temp = int(entity.attributes.max_temp*10)
|
|
||||||
step_temp = int(0.5*10)
|
|
||||||
|
|
||||||
return "entityUpd,{0},{1},{2},{3},{4},{5},{6},{7}".format(item, heading, current_temp, dest_temp, status, min_temp, max_temp, step_temp)
|
|
||||||
|
|
||||||
def generate_media_page(self, item):
|
|
||||||
|
|
||||||
if not self.api.entity_exists(item):
|
|
||||||
return
|
|
||||||
|
|
||||||
entity = self.api.get_entity(item)
|
|
||||||
heading = entity.attributes.friendly_name
|
|
||||||
icon = 0
|
|
||||||
title = ""
|
|
||||||
author = ""
|
|
||||||
volume = 0
|
|
||||||
#iconplaypause = 9
|
|
||||||
if "media_content_type" in entity.attributes:
|
|
||||||
if entity.attributes.media_content_type == "music":
|
|
||||||
icon = 5
|
|
||||||
if "media_title" in entity.attributes:
|
|
||||||
title = entity.attributes.media_title
|
|
||||||
if "media_artist" in entity.attributes:
|
|
||||||
author = entity.attributes.media_artist
|
|
||||||
if "volume_level" in entity.attributes:
|
|
||||||
volume = int(entity.attributes.volume_level*100)
|
|
||||||
|
|
||||||
if entity.state == "playing":
|
|
||||||
iconplaypause = 8
|
|
||||||
else:
|
|
||||||
iconplaypause = 9
|
|
||||||
|
|
||||||
return f"entityUpd,|{item}|{heading}|{icon}|{title}|{author}|{volume}|{iconplaypause}"
|
|
||||||
|
|
||||||
|
|
||||||
def generate_page(self, page_number, page_type):
|
|
||||||
self.api.log("Generating page commands for page %i with type %s", self.current_page_nr, page_type, level="DEBUG")
|
|
||||||
if page_type == "cardEntities":
|
|
||||||
# Send page type
|
|
||||||
self.send_mqtt_msg("pageType,{0}".format(page_type))
|
|
||||||
# Set Heading of Page
|
|
||||||
self.send_mqtt_msg("entityUpdHeading,{0}".format(self.config["pages"][self.current_page_nr]["heading"]))
|
|
||||||
|
|
||||||
# Set Items of Page
|
|
||||||
current_item_nr = 0
|
|
||||||
for item in self.config["pages"][self.current_page_nr]["items"]:
|
|
||||||
current_item_nr += 1
|
|
||||||
command = self.generate_entities_item(item, current_item_nr)
|
|
||||||
self.send_mqtt_msg(command)
|
|
||||||
|
|
||||||
if page_type == "cardThermo":
|
|
||||||
# Send page type
|
|
||||||
self.send_mqtt_msg("pageType,{0}".format(page_type))
|
|
||||||
command = self.generate_thermo_page(self.config["pages"][self.current_page_nr]["item"])
|
|
||||||
self.send_mqtt_msg(command)
|
|
||||||
|
|
||||||
if page_type == "cardMedia":
|
|
||||||
# Send page type
|
|
||||||
self.send_mqtt_msg("pageType,{0}".format(page_type))
|
|
||||||
command = self.generate_media_page(self.config["pages"][self.current_page_nr]["item"])
|
|
||||||
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
|
|
||||||
|
|||||||
BIN
doc-pics/appdaemon-babel.png
Normal file
BIN
doc-pics/appdaemon-babel.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
BIN
doc-pics/hacs-main.png
Normal file
BIN
doc-pics/hacs-main.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
BIN
doc-pics/nodered-remote-control.png
Normal file
BIN
doc-pics/nodered-remote-control.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 206 KiB After Width: | Height: | Size: 308 KiB |
30
info.md
30
info.md
@@ -5,23 +5,27 @@ Checkout [README](https://github.com/joBr99/nspanel-lovelace-ui/blob/main/README
|
|||||||
### App Configuration
|
### App Configuration
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
|
---
|
||||||
nspanel-1:
|
nspanel-1:
|
||||||
module: nspanel-lovelace-ui
|
module: nspanel-lovelace-ui
|
||||||
class: NsPanelLovelaceUIManager
|
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"
|
||||||
timeoutScreensaver: 15 #in seconds, values between 5 and 60 are allowed
|
updateMode: "auto-notify"
|
||||||
|
timeoutScreensaver: 20
|
||||||
#brightnessScreensaver: 10
|
#brightnessScreensaver: 10
|
||||||
brightnessScreensaver:
|
brightnessScreensaver:
|
||||||
- time: "7:00:00"
|
- time: "7:00:00"
|
||||||
value: 10
|
value: 10
|
||||||
- time: "23:00:00"
|
- time: "23:00:00"
|
||||||
value: 0
|
value: 0
|
||||||
locale: "de_DE"
|
locale: "de_DE" # only used if babel python package is installed
|
||||||
|
dateFormatBabel: "full" # only used if babel python package is installed
|
||||||
|
# formatting options on https://babel.pocoo.org/en/latest/dates.html?highlight=name%20of%20day#date-fields
|
||||||
timeFormat: "%H:%M"
|
timeFormat: "%H:%M"
|
||||||
dateFormat: "%A, %d. %B %Y"
|
dateFormat: "%A, %d. %B %Y" # ignored if babel python package is installed
|
||||||
weatherEntity: weather.example
|
weather: weather.example
|
||||||
pages:
|
pages:
|
||||||
- type: cardEntities
|
- type: cardEntities
|
||||||
heading: Example Page 1
|
heading: Example Page 1
|
||||||
@@ -36,20 +40,30 @@ nspanel-1:
|
|||||||
- button.example_button
|
- button.example_button
|
||||||
- input_button.example_input_button
|
- input_button.example_input_button
|
||||||
- light.light_example
|
- light.light_example
|
||||||
- delete # To make sure we don't keep buttons from previous page (read this as 'empty')
|
- delete # (read this as 'empty')
|
||||||
- type: cardEntities
|
- type: cardEntities
|
||||||
heading: Example Page 3
|
heading: Example Page 3
|
||||||
items:
|
items:
|
||||||
- scene.some_scene
|
- scene.example_scene
|
||||||
- scene.moodlights
|
|
||||||
- delete
|
- delete
|
||||||
- delete
|
- delete
|
||||||
|
- delete
|
||||||
|
- type: cardGrid
|
||||||
|
heading: Example Page 4
|
||||||
|
items:
|
||||||
|
- light.light_example
|
||||||
|
- button.example_button
|
||||||
|
- cover.example_cover
|
||||||
|
- scene.example_scene
|
||||||
|
- switch.example_switch
|
||||||
|
- delete
|
||||||
- type: cardThermo
|
- type: cardThermo
|
||||||
heading: Exmaple Thermostat
|
heading: Exmaple Thermostat
|
||||||
item: climate.example_climate
|
item: climate.example_climate
|
||||||
- type: cardMedia
|
- type: cardMedia
|
||||||
heading: Exampe Media
|
|
||||||
item: media_player.spotify_user
|
item: media_player.spotify_user
|
||||||
|
- type: cardAlarm
|
||||||
|
item: alarm_control_panel.alarmo
|
||||||
```
|
```
|
||||||
|
|
||||||
key | optional | type | default | description
|
key | optional | type | default | description
|
||||||
|
|||||||
829
ioBroker/NsPanelTs.ts
Normal file
829
ioBroker/NsPanelTs.ts
Normal file
@@ -0,0 +1,829 @@
|
|||||||
|
|
||||||
|
const Months = ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"];
|
||||||
|
const Days = ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"];
|
||||||
|
const Red: RGB = { red: 255, green: 0, blue: 0 };
|
||||||
|
const White: RGB = { red: 255, green: 255, blue: 255 };
|
||||||
|
const Off: RGB = { red: 68, green: 115, blue: 158 };
|
||||||
|
const On: RGB = { red: 253, green: 216, blue: 53 };
|
||||||
|
const BatteryFull: RGB = { red: 96, green: 176, blue: 62 }
|
||||||
|
const BatteryEmpty: RGB = { red: 179, green: 45, blue: 25 }
|
||||||
|
|
||||||
|
var Wohnen: PageEntities =
|
||||||
|
{
|
||||||
|
"type": "cardEntities",
|
||||||
|
"heading": "Haus",
|
||||||
|
"useColor": true,
|
||||||
|
"items": [
|
||||||
|
<PageItem>{ id: "alias.0.Stern"},
|
||||||
|
<PageItem>{ id: "alias.0.Erker"},
|
||||||
|
<PageItem>{ id: "alias.0.Küche", interpolateColor: true },
|
||||||
|
<PageItem>{ id: "alias.0.Wand" }
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
var Strom: PageEntities =
|
||||||
|
{
|
||||||
|
"type": "cardEntities",
|
||||||
|
"heading": "Strom",
|
||||||
|
"useColor": true,
|
||||||
|
"items": [
|
||||||
|
<PageItem>{ id: "alias.0.Netz", icon: 4, interpolateColor: true, offColor: BatteryFull, onColor: Red , minValue: -1000, maxValue: 1000 },
|
||||||
|
<PageItem>{ id: "alias.0.Hausverbrauch", icon: 4, interpolateColor: true, offColor: BatteryFull, onColor: Red , maxValue: 1000 },
|
||||||
|
<PageItem>{ id: "alias.0.Pv", icon: 4, interpolateColor: true, offColor: Off, onColor: BatteryFull , maxValue: 1000 },
|
||||||
|
<PageItem>{ id: "alias.0.Batterie", icon: 34, interpolateColor: true, offColor: BatteryEmpty, onColor: BatteryFull }
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
var button1Page: PageGrid =
|
||||||
|
{
|
||||||
|
"type": "cardGrid",
|
||||||
|
"heading": "Radio",
|
||||||
|
"useColor": true,
|
||||||
|
"items": [
|
||||||
|
<PageItem>{ id: "alias.0.Radio.NJoy" },
|
||||||
|
<PageItem>{ id: "alias.0.Radio.Delta_Radio" },
|
||||||
|
<PageItem>{ id: "alias.0.Radio.NDR2" },
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
var button2Page: PageEntities =
|
||||||
|
{
|
||||||
|
"type": "cardEntities",
|
||||||
|
"heading": "Knopf2",
|
||||||
|
"useColor": true,
|
||||||
|
"items": [
|
||||||
|
<PageItem>{ id: "alias.0.Schlafen" },
|
||||||
|
<PageItem>{ id: "alias.0.Stern" }
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
export const config: Config = {
|
||||||
|
panelRecvTopic: "mqtt.0.tele.WzDisplay.RESULT",
|
||||||
|
panelSendTopic: "mqtt.0.cmnd.WzDisplay.CustomSend",
|
||||||
|
firstScreensaverEntity: { ScreensaverEntity: "alias.0.Wetter.HUMIDITY", ScreensaverEntityIcon: 26, ScreensaverEntityText: "Luft", ScreensaverEntityUnitText: "%" },
|
||||||
|
secondScreensaverEntity: { ScreensaverEntity: "alias.0.Wetter.PRECIPITATION_CHANCE", ScreensaverEntityIcon: 19, ScreensaverEntityText: "Regen", ScreensaverEntityUnitText: "%" },
|
||||||
|
thirdScreensaverEntity: { ScreensaverEntity: "alias.0.Batterie.ACTUAL", ScreensaverEntityIcon: 34, ScreensaverEntityText: "Batterie", ScreensaverEntityUnitText: "%" },
|
||||||
|
fourthScreensaverEntity: { ScreensaverEntity: "alias.0.Pv.ACTUAL", ScreensaverEntityIcon: 32, ScreensaverEntityText: "PV", ScreensaverEntityUnitText: "W" },
|
||||||
|
timeoutScreensaver: 15,
|
||||||
|
dimmode: 8,
|
||||||
|
screenSaverDoubleClick: false,
|
||||||
|
locale: "de_DE",
|
||||||
|
timeFormat: "%H:%M",
|
||||||
|
dateFormat: "%A, %d. %B %Y",
|
||||||
|
weatherEntity: "alias.0.Wetter",
|
||||||
|
defaultOffColor: Off,
|
||||||
|
defaultOnColor: On,
|
||||||
|
defaultColor: Off,
|
||||||
|
temperatureUnit: "°C",
|
||||||
|
pages: [Wohnen, Strom,
|
||||||
|
{
|
||||||
|
"type": "cardThermo",
|
||||||
|
"heading": "Thermostat",
|
||||||
|
"useColor": true,
|
||||||
|
"items": [<PageItem>{ id: "alias.0.WzNsPanel" }]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
button1Page: button1Page,
|
||||||
|
button2Page: button2Page
|
||||||
|
};
|
||||||
|
|
||||||
|
var subscriptions: any = {};
|
||||||
|
|
||||||
|
var pageId = 0;
|
||||||
|
|
||||||
|
schedule("* * * * *", function () {
|
||||||
|
SendTime();
|
||||||
|
});
|
||||||
|
schedule("0 * * * *", function () {
|
||||||
|
SendDate();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// Only monitor the extra nodes if present
|
||||||
|
var updateArray: string[] = [];
|
||||||
|
if (config.firstScreensaverEntity !== null && config.firstScreensaverEntity.ScreensaverEntity != null && existsState(config.firstScreensaverEntity.ScreensaverEntity)) {
|
||||||
|
updateArray.push(config.firstScreensaverEntity.ScreensaverEntity)
|
||||||
|
}
|
||||||
|
if (config.secondScreensaverEntity !== null && config.secondScreensaverEntity.ScreensaverEntity != null && existsState(config.secondScreensaverEntity.ScreensaverEntity)) {
|
||||||
|
updateArray.push(config.secondScreensaverEntity.ScreensaverEntity)
|
||||||
|
}
|
||||||
|
if (config.thirdScreensaverEntity !== null && config.thirdScreensaverEntity.ScreensaverEntity != null && existsState(config.thirdScreensaverEntity.ScreensaverEntity)) {
|
||||||
|
updateArray.push(config.thirdScreensaverEntity.ScreensaverEntity)
|
||||||
|
}
|
||||||
|
if (config.fourthScreensaverEntity !== null && config.fourthScreensaverEntity.ScreensaverEntity != null && existsState(config.fourthScreensaverEntity.ScreensaverEntity)) {
|
||||||
|
updateArray.push(config.fourthScreensaverEntity.ScreensaverEntity)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (updateArray.length > 0) {
|
||||||
|
on(updateArray, function () {
|
||||||
|
HandleScreensaverUpdate();
|
||||||
|
})
|
||||||
|
}
|
||||||
|
on({ id: config.panelRecvTopic }, function (obj) {
|
||||||
|
if (obj.state.val.startsWith('\{"CustomRecv":')) {
|
||||||
|
var json = JSON.parse(obj.state.val);
|
||||||
|
|
||||||
|
var split = json.CustomRecv.split(",");
|
||||||
|
HandleMessage(split[0], split[1], parseInt(split[2]), split);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
function SendToPanel(val: Payload | Payload[]): void {
|
||||||
|
if (Array.isArray(val)) {
|
||||||
|
val.forEach(function (id, i) {
|
||||||
|
setState(config.panelSendTopic, id.payload);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
setState(config.panelSendTopic, val.payload);
|
||||||
|
}
|
||||||
|
|
||||||
|
function HandleMessage(typ: string, method: string, page: number, words: Array<string>): void {
|
||||||
|
if (typ == "event") {
|
||||||
|
switch (method) {
|
||||||
|
case "startup":
|
||||||
|
UnsubscribeWatcher();
|
||||||
|
HandleStartupProcess();
|
||||||
|
pageId = 0;
|
||||||
|
GeneratePage(config.pages[0]);
|
||||||
|
break;
|
||||||
|
case "pageOpenDetail":
|
||||||
|
UnsubscribeWatcher();
|
||||||
|
let pageItem = config.pages[pageId].items.find(e => e.id === words[3]);
|
||||||
|
if (pageItem !== undefined)
|
||||||
|
SendToPanel(GenerateDetailPage(words[2], pageItem));
|
||||||
|
case "buttonPress2":
|
||||||
|
HandleButtonEvent(words);
|
||||||
|
break;
|
||||||
|
case "screensaverOpen":
|
||||||
|
HandleScreensaver();
|
||||||
|
break;
|
||||||
|
case "button1":
|
||||||
|
case "button2":
|
||||||
|
HandleHardwareButton(method);
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function GeneratePage(page: Page): void {
|
||||||
|
switch (page.type) {
|
||||||
|
case "cardEntities":
|
||||||
|
SendToPanel(GenerateEntitiesPage(<PageEntities>page));
|
||||||
|
break;
|
||||||
|
case "cardThermo":
|
||||||
|
SendToPanel(GenerateThermoPage(<PageThermo>page));
|
||||||
|
break;
|
||||||
|
case "cardGrid":
|
||||||
|
SendToPanel(GenerateGridPage(<PageGrid>page));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function HandleHardwareButton(method: string): void {
|
||||||
|
let page: (PageThermo | PageEntities | PageGrid);
|
||||||
|
if (config.button1Page !== null && method == "button1") {
|
||||||
|
page = config.button1Page;
|
||||||
|
}
|
||||||
|
else if (config.button2Page !== null && method == "button2") {
|
||||||
|
page = config.button2Page;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
GeneratePage(page);
|
||||||
|
}
|
||||||
|
|
||||||
|
function HandleStartupProcess(): void {
|
||||||
|
SendDate();
|
||||||
|
SendTime();
|
||||||
|
SendToPanel({ payload: "timeout," + config.timeoutScreensaver });
|
||||||
|
SendToPanel({ payload: "dimmode," + config.dimmode });
|
||||||
|
}
|
||||||
|
|
||||||
|
function SendDate(): void {
|
||||||
|
var d = new Date();
|
||||||
|
var day = Days[d.getDay()];
|
||||||
|
var date = d.getDate();
|
||||||
|
var month = Months[d.getMonth()];
|
||||||
|
var year = d.getFullYear();
|
||||||
|
var _sendDate = "date,?" + day + " " + date + " " + month + " " + year;
|
||||||
|
SendToPanel(<Payload>{ payload: _sendDate });
|
||||||
|
}
|
||||||
|
|
||||||
|
function SendTime(): void {
|
||||||
|
var d = new Date();
|
||||||
|
var hr = d.getHours().toString();
|
||||||
|
var min = d.getMinutes().toString();
|
||||||
|
|
||||||
|
if (d.getHours() < 10) {
|
||||||
|
hr = "0" + d.getHours().toString();
|
||||||
|
}
|
||||||
|
if (d.getMinutes() < 10) {
|
||||||
|
min = "0" + d.getMinutes().toString();
|
||||||
|
}
|
||||||
|
SendToPanel(<Payload>{ payload: "time," + hr + ":" + min });
|
||||||
|
}
|
||||||
|
|
||||||
|
function GenerateEntitiesPage(page: PageEntities): Payload[] {
|
||||||
|
var out_msgs: Array<Payload> = [];
|
||||||
|
out_msgs = [{ payload: "pageType,cardEntities" }, { payload: "entityUpdHeading," + page.heading }]
|
||||||
|
out_msgs.push({ payload: GeneratePageElements(page.items, 4, page.useColor) });
|
||||||
|
return out_msgs
|
||||||
|
}
|
||||||
|
|
||||||
|
function GenerateGridPage(page: PageGrid): Payload[] {
|
||||||
|
var out_msgs: Array<Payload> = [];
|
||||||
|
out_msgs = [{ payload: "pageType,cardGrid" }, { payload: "entityUpdHeading," + page.heading }]
|
||||||
|
out_msgs.push({ payload: GeneratePageElements(page.items, 6, page.useColor) });
|
||||||
|
return out_msgs
|
||||||
|
}
|
||||||
|
|
||||||
|
function GeneratePageElements(pageItems: PageItem[], maxItems: number, useColors: boolean = false): string {
|
||||||
|
let pageData = "entityUpd";
|
||||||
|
for (let index = 0; index < maxItems; index++) {
|
||||||
|
if (pageItems[index] !== undefined) {
|
||||||
|
pageData += CreateEntity(pageItems[index], index + 1, useColors);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
pageData += CreateEntity(<PageItem>{ id: "delete" }, index + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return pageData;
|
||||||
|
}
|
||||||
|
|
||||||
|
function CreateEntity(pageItem: PageItem, placeId: number, useColors: boolean = false): string {
|
||||||
|
var iconId = 0
|
||||||
|
if (pageItem.id == "delete") {
|
||||||
|
return ",delete,,,,,"
|
||||||
|
}
|
||||||
|
var name: string;
|
||||||
|
var type: string;
|
||||||
|
// ioBroker
|
||||||
|
if (existsObject(pageItem.id)) {
|
||||||
|
let o = getObject(pageItem.id)
|
||||||
|
var val = null;
|
||||||
|
name = o.common.name.de
|
||||||
|
|
||||||
|
if (existsState(pageItem.id + ".GET")) {
|
||||||
|
val = getState(pageItem.id + ".GET").val;
|
||||||
|
RegisterEntityWatcher(pageItem.id + ".GET");
|
||||||
|
}
|
||||||
|
else if (existsState(pageItem.id + ".SET")) {
|
||||||
|
val = getState(pageItem.id + ".SET").val;
|
||||||
|
RegisterEntityWatcher(pageItem.id + ".SET");
|
||||||
|
}
|
||||||
|
var iconColor = rgb_dec565(config.defaultColor);
|
||||||
|
|
||||||
|
switch (o.common.role) {
|
||||||
|
case "light":
|
||||||
|
type = "light"
|
||||||
|
iconId = pageItem.icon !== undefined ? pageItem.icon : 1;
|
||||||
|
var optVal = "0"
|
||||||
|
|
||||||
|
if (val === true || val === "true") {
|
||||||
|
optVal = "1"
|
||||||
|
iconColor = GetIconColor(pageItem, true, useColors);
|
||||||
|
}
|
||||||
|
|
||||||
|
return "," + type + "," + pageItem.id + "," + iconId + "," + iconColor + "," + name + "," + optVal;
|
||||||
|
|
||||||
|
case "dimmer":
|
||||||
|
type = "light"
|
||||||
|
iconId = pageItem.icon !== undefined ? pageItem.icon : 1;
|
||||||
|
var optVal = "0"
|
||||||
|
if (existsState(pageItem.id + ".ON_ACTUAL")) {
|
||||||
|
val = getState(pageItem.id + ".ON_ACTUAL").val;
|
||||||
|
RegisterEntityWatcher(pageItem.id + ".ON_ACTUAL");
|
||||||
|
}
|
||||||
|
else if (existsState(pageItem.id + ".ON_SET")) {
|
||||||
|
val = getState(pageItem.id + ".ON_SET").val;
|
||||||
|
RegisterEntityWatcher(pageItem.id + ".ON_SET");
|
||||||
|
}
|
||||||
|
if (val === true || val === "true") {
|
||||||
|
optVal = "1"
|
||||||
|
iconColor = GetIconColor(pageItem, existsState(pageItem.id + ".ACTUAL") ? getState(pageItem.id + ".ACTUAL").val : true, useColors);
|
||||||
|
}
|
||||||
|
|
||||||
|
return "," + type + "," + pageItem.id + "," + iconId + "," + iconColor + "," + name + "," + optVal;
|
||||||
|
|
||||||
|
case "blind":
|
||||||
|
type = "shutter"
|
||||||
|
iconId = pageItem.icon !== undefined ? pageItem.icon : 11;
|
||||||
|
iconColor = GetIconColor(pageItem, existsState(pageItem.id + ".ACTUAL") ? getState(pageItem.id + ".ACTUAL").val : true, useColors);
|
||||||
|
return "," + type + "," + pageItem.id + "," + iconId + "," + iconColor + "," + name + ","
|
||||||
|
|
||||||
|
case "info":
|
||||||
|
case "value.temperature":
|
||||||
|
case "thermostat":
|
||||||
|
type = "text";
|
||||||
|
iconId = pageItem.icon !== undefined ? pageItem.icon : o.common.role == "value.temperature" || o.common.role == "thermostat" ? 2 : 0;
|
||||||
|
let unit = "";
|
||||||
|
var optVal = "0"
|
||||||
|
if (existsState(pageItem.id + ".ON_ACTUAL")) {
|
||||||
|
optVal = getState(pageItem.id + ".ON_ACTUAL").val;
|
||||||
|
unit = GetUnitOfMeasurement(pageItem.id + ".ON_ACTUAL");
|
||||||
|
RegisterEntityWatcher(pageItem.id + ".ON_ACTUAL");
|
||||||
|
}
|
||||||
|
else if (existsState(pageItem.id + ".ACTUAL")) {
|
||||||
|
optVal = getState(pageItem.id + ".ACTUAL").val;
|
||||||
|
unit = GetUnitOfMeasurement(pageItem.id + ".ACTUAL");
|
||||||
|
RegisterEntityWatcher(pageItem.id + ".ACTUAL");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (o.common.role == "value.temperature") {
|
||||||
|
iconId = pageItem.icon !== undefined ? pageItem.icon : 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
iconColor = GetIconColor(pageItem, parseInt(optVal), useColors);
|
||||||
|
|
||||||
|
return "," + type + "," + pageItem.id + "," + iconId + "," + iconColor + "," + name + "," + optVal + " " + unit;
|
||||||
|
|
||||||
|
case "button":
|
||||||
|
type = "button";
|
||||||
|
iconId = pageItem.icon !== undefined ? pageItem.icon : 3;
|
||||||
|
let buttonText = pageItem.buttonText !== undefined ? pageItem.buttonText : "PRESS";
|
||||||
|
iconColor = GetIconColor(pageItem, true, useColors);
|
||||||
|
return "," + type + "," + pageItem.id + "," + iconId + "," + + iconColor + "," + name + "," + buttonText;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return ",delete,,,,";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return ",delete,,,,,"
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetIconColor(pageItem: PageItem, value: (boolean | number), useColors: boolean): number {
|
||||||
|
// dimmer
|
||||||
|
if ((pageItem.useColor || useColors) && pageItem.interpolateColor && typeof (value) === "number") {
|
||||||
|
let maxValue = pageItem.maxValue !== undefined ? pageItem.maxValue : 100;
|
||||||
|
let minValue = pageItem.minValue !== undefined ? pageItem.minValue : 0;
|
||||||
|
value = value > maxValue ? maxValue : value;
|
||||||
|
value = value < minValue ? minValue : value;
|
||||||
|
return rgb_dec565(
|
||||||
|
Interpolate(
|
||||||
|
pageItem.offColor !== undefined ? pageItem.offColor : config.defaultOffColor,
|
||||||
|
pageItem.onColor !== undefined ? pageItem.onColor : config.defaultOnColor,
|
||||||
|
scale(value, minValue, maxValue, 0, 1)
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((pageItem.useColor || useColors) && ((typeof (value) === "boolean" && value) || value > (pageItem.minValue !== undefined ? pageItem.minValue : 0))) {
|
||||||
|
return rgb_dec565(pageItem.onColor !== undefined ? pageItem.onColor : config.defaultOnColor)
|
||||||
|
}
|
||||||
|
|
||||||
|
return rgb_dec565(pageItem.offColor !== undefined ? pageItem.offColor : config.defaultOffColor);
|
||||||
|
}
|
||||||
|
|
||||||
|
function RegisterEntityWatcher(id: string): void {
|
||||||
|
if (subscriptions.hasOwnProperty(id)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
subscriptions[id] = (on({ id: id, change: 'any' }, function (data) {
|
||||||
|
log("RegisterEntityWatcher PageId:" + pageId.toString())
|
||||||
|
GeneratePage(config.pages[pageId]);
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function RegisterDetailEntityWatcher(id: string, pageItem: PageItem, type: string): void {
|
||||||
|
if (subscriptions.hasOwnProperty(id)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
subscriptions[id] = (on({ id: id, change: 'any' }, function () {
|
||||||
|
SendToPanel(GenerateDetailPage(type, pageItem));
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetUnitOfMeasurement(id: string): string {
|
||||||
|
if (!existsObject(id))
|
||||||
|
return "";
|
||||||
|
|
||||||
|
let obj = getObject(id);
|
||||||
|
if (typeof obj.common.unit !== 'undefined') {
|
||||||
|
return obj.common.unit
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof obj.common.alias !== 'undefined' && typeof obj.common.alias.id !== 'undefined') {
|
||||||
|
return GetUnitOfMeasurement(obj.common.alias.id);
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
function GenerateThermoPage(page: PageThermo): Payload[] {
|
||||||
|
var id = page.items[0].id
|
||||||
|
var out_msgs: Array<Payload> = [];
|
||||||
|
out_msgs.push({ payload: "pageType,cardThermo" });
|
||||||
|
|
||||||
|
// ioBroker
|
||||||
|
if (existsObject(id)) {
|
||||||
|
let o = getObject(id)
|
||||||
|
let name = o.common.name.de
|
||||||
|
let currentTemp = 0;
|
||||||
|
if (existsState(id + ".ACTUAL"))
|
||||||
|
currentTemp = parseInt(getState(id + ".ACTUAL").val) * 10;
|
||||||
|
|
||||||
|
let destTemp = 0;
|
||||||
|
if (existsState(id + ".SET")) {
|
||||||
|
destTemp = getState(id + ".SET").val.toFixed(2) * 10;
|
||||||
|
log(id + ".SET " + destTemp)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
let status = ""
|
||||||
|
if (existsState(id + ".MODE"))
|
||||||
|
status = getState(id + ".MODE").val;
|
||||||
|
let minTemp = 180
|
||||||
|
let maxTemp = 300
|
||||||
|
let stepTemp = 5
|
||||||
|
|
||||||
|
out_msgs.push({ payload: "entityUpd," + id + "," + name + "," + currentTemp + "," + destTemp + "," + status + "," + minTemp + "," + maxTemp + "," + stepTemp })
|
||||||
|
}
|
||||||
|
|
||||||
|
return out_msgs
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function setIfExists(id: string, value: any, type: string | null = null): boolean {
|
||||||
|
if (type === null) {
|
||||||
|
if (existsState(id)) {
|
||||||
|
setState(id, value);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
let obj = getObject(id);
|
||||||
|
if (existsState(id) && obj.common.type !== undefined && obj.common.type === type) {
|
||||||
|
setState(id, value);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function toggleState(id: string): boolean {
|
||||||
|
let obj = getObject(id);
|
||||||
|
if (existsState(id) && obj.common.type !== undefined && obj.common.type === "boolean") {
|
||||||
|
setState(id, !getState(id).val);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function HandleButtonEvent(words): void {
|
||||||
|
let id = words[2]
|
||||||
|
let buttonAction = words[3];
|
||||||
|
|
||||||
|
switch (buttonAction) {
|
||||||
|
case "bNext":
|
||||||
|
var pageNum = ((pageId + 1) % config.pages.length);
|
||||||
|
pageId = Math.abs(pageNum);
|
||||||
|
UnsubscribeWatcher();
|
||||||
|
GeneratePage(config.pages[pageId]);
|
||||||
|
break;
|
||||||
|
case "bPrev":
|
||||||
|
var pageNum = ((pageId - 1) % config.pages.length);
|
||||||
|
pageId = Math.abs(pageNum);
|
||||||
|
UnsubscribeWatcher();
|
||||||
|
GeneratePage(config.pages[pageId]);
|
||||||
|
break;
|
||||||
|
case "bExit":
|
||||||
|
if (config.screenSaverDoubleClick) {
|
||||||
|
if (words[4] == 2)
|
||||||
|
GeneratePage(config.pages[pageId]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
GeneratePage(config.pages[pageId]);
|
||||||
|
break;
|
||||||
|
case "OnOff":
|
||||||
|
if (existsObject(id)) {
|
||||||
|
var action = false
|
||||||
|
if (words[4] == "1")
|
||||||
|
action = true
|
||||||
|
let o = getObject(id)
|
||||||
|
switch (o.common.role) {
|
||||||
|
case "light":
|
||||||
|
setIfExists(id + ".SET", action);
|
||||||
|
break;
|
||||||
|
case "dimmer":
|
||||||
|
setIfExists(id + ".ON_SET", action) ? true : setIfExists(id + ".ON_ACTUAL", action);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "up":
|
||||||
|
setIfExists(id + ".OPEN", true)
|
||||||
|
break;
|
||||||
|
case "stop":
|
||||||
|
setIfExists(id + ".STOP", true)
|
||||||
|
break;
|
||||||
|
case "down":
|
||||||
|
setIfExists(id + ".CLOSE", true)
|
||||||
|
break;
|
||||||
|
case "button":
|
||||||
|
toggleState(id + ".SET") ? true : toggleState(id + ".ON_SET")
|
||||||
|
break;
|
||||||
|
case "positionSlider":
|
||||||
|
case "brightnessSlider":
|
||||||
|
setIfExists(id + ".SET", parseInt(words[4])) ? true : setIfExists(id + ".ACTUAL", parseInt(words[4]));
|
||||||
|
break;
|
||||||
|
case "tempUpd":
|
||||||
|
setIfExists(id + ".SET", parseInt(words[4]) / 10)
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function GenerateDetailPage(type: string, pageItem: PageItem): Payload[] {
|
||||||
|
|
||||||
|
var out_msgs: Array<Payload> = [];
|
||||||
|
let id = pageItem.id
|
||||||
|
if (existsObject(id)) {
|
||||||
|
var o = getObject(id)
|
||||||
|
var val: (boolean | number) = 0;
|
||||||
|
let icon = 1;
|
||||||
|
var iconColor = rgb_dec565(config.defaultColor);
|
||||||
|
if (type == "popupLight") {
|
||||||
|
let switchVal = "0"
|
||||||
|
if (o.common.role == "light") {
|
||||||
|
if (existsState(id + ".GET")) {
|
||||||
|
val = getState(id + ".GET").val;
|
||||||
|
RegisterDetailEntityWatcher(id + ".GET", pageItem, type);
|
||||||
|
}
|
||||||
|
else if (existsState(id + ".SET")) {
|
||||||
|
val = getState(id + ".SET").val;
|
||||||
|
RegisterDetailEntityWatcher(id + ".SET", pageItem, type);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (val) {
|
||||||
|
switchVal = "1";
|
||||||
|
iconColor = GetIconColor(pageItem, true, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
out_msgs.push({ payload: "entityUpdateDetail," + icon + "," + + iconColor + "," + switchVal + ",disable,disable,disable" })
|
||||||
|
}
|
||||||
|
|
||||||
|
if (o.common.role == "dimmer") {
|
||||||
|
if (existsState(id + ".ON_ACTUAL")) {
|
||||||
|
val = getState(id + ".ON_ACTUAL").val;
|
||||||
|
RegisterDetailEntityWatcher(id + ".ON_ACTUAL", pageItem, type);
|
||||||
|
}
|
||||||
|
|
||||||
|
else if (existsState(id + ".ON_SET")) {
|
||||||
|
val = getState(id + ".ON_SET").val;
|
||||||
|
RegisterDetailEntityWatcher(id + ".ON_SET", pageItem, type);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (val === true) {
|
||||||
|
var iconColor = GetIconColor(pageItem, val, false);
|
||||||
|
switchVal = "1"
|
||||||
|
}
|
||||||
|
let brightness = 0;
|
||||||
|
if (existsState(id + ".ACTUAL")) {
|
||||||
|
brightness = Math.trunc(scale(getState(id + ".ACTUAL").val, 0, 100, 0, 100))
|
||||||
|
iconColor = GetIconColor(pageItem, brightness, false);
|
||||||
|
RegisterDetailEntityWatcher(id + ".ACTUAL", pageItem, type);
|
||||||
|
}
|
||||||
|
let colorTemp = "disable"
|
||||||
|
let colorMode = "disable"
|
||||||
|
//let attr_support_color = attr.supported_color_modes
|
||||||
|
//if (attr_support_color.includes("color_temp"))
|
||||||
|
// colortemp = Math.trunc(scale(attr.color_temp, attr.min_mireds, attr.max_mireds, 0, 100))
|
||||||
|
|
||||||
|
out_msgs.push({ payload: "entityUpdateDetail," + icon + "," + iconColor + "," + switchVal + "," + brightness + "," + colorTemp + "," + colorMode })
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type == "popupShutter") {
|
||||||
|
if (existsState(id + ".ACTUAL"))
|
||||||
|
val = getState(id + ".ACTUAL").val;
|
||||||
|
else if (existsState(id + ".SET"))
|
||||||
|
val = getState(id + ".SET").val;
|
||||||
|
out_msgs.push({ payload: "entityUpdateDetail," + val })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return out_msgs
|
||||||
|
}
|
||||||
|
|
||||||
|
function scale(number: number, inMin: number, inMax: number, outMin: number, outMax: number): number {
|
||||||
|
return (number - inMin) * (outMax - outMin) / (inMax - inMin) + outMin;
|
||||||
|
}
|
||||||
|
|
||||||
|
function UnsubscribeWatcher(): void {
|
||||||
|
for (const [key, value] of Object.entries(subscriptions)) {
|
||||||
|
unsubscribe(value);
|
||||||
|
delete subscriptions[key]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function HandleScreensaver(): void {
|
||||||
|
UnsubscribeWatcher();
|
||||||
|
HandleScreensaverUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
|
function HandleScreensaverUpdate(): void {
|
||||||
|
if (config.weatherEntity != null && existsObject(config.weatherEntity)) {
|
||||||
|
var icon = getState(config.weatherEntity + ".ICON").val;
|
||||||
|
|
||||||
|
let temperature: string =
|
||||||
|
existsState(config.weatherEntity + ".ACTUAL") ? getState(config.weatherEntity + ".ACTUAL").val :
|
||||||
|
existsState(config.weatherEntity + ".TEMP") ? getState(config.weatherEntity + ".TEMP").val : "null";
|
||||||
|
|
||||||
|
let payloadString =
|
||||||
|
"weatherUpdate,?" + GetAccuWeatherIcon(parseInt(icon)) + "?"
|
||||||
|
+ temperature + " " + config.temperatureUnit + "?"
|
||||||
|
|
||||||
|
payloadString += GetScreenSaverEntityString(config.firstScreensaverEntity);
|
||||||
|
payloadString += GetScreenSaverEntityString(config.secondScreensaverEntity);
|
||||||
|
payloadString += GetScreenSaverEntityString(config.thirdScreensaverEntity);
|
||||||
|
payloadString += GetScreenSaverEntityString(config.fourthScreensaverEntity);
|
||||||
|
|
||||||
|
SendToPanel(<Payload>{ payload: payloadString });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetScreenSaverEntityString(configElement: ScreenSaverElement | null): string {
|
||||||
|
if (configElement != null && configElement.ScreensaverEntity != null && existsState(configElement.ScreensaverEntity)) {
|
||||||
|
let u1 = getState(configElement.ScreensaverEntity).val;
|
||||||
|
return configElement.ScreensaverEntityText + "?" + configElement.ScreensaverEntityIcon + "?" + u1 + " " + configElement.ScreensaverEntityUnitText + "?";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return "???";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetAccuWeatherIcon(icon: number): number {
|
||||||
|
switch (icon) {
|
||||||
|
case 24: // Ice
|
||||||
|
case 30: // Hot
|
||||||
|
case 31: // Cold
|
||||||
|
return 11; // exceptional
|
||||||
|
|
||||||
|
case 7: // Cloudy
|
||||||
|
case 8: // Dreary (Overcast)
|
||||||
|
case 38: // Mostly Cloudy
|
||||||
|
return 12; // cloudy
|
||||||
|
|
||||||
|
case 11: // fog
|
||||||
|
return 13; // fog
|
||||||
|
|
||||||
|
case 25: // Sleet
|
||||||
|
return 14; // Hail
|
||||||
|
|
||||||
|
case 15: // T-Storms
|
||||||
|
return 15; // lightning
|
||||||
|
|
||||||
|
case 16: // Mostly Cloudy w/ T-Storms
|
||||||
|
case 17: // Partly Sunny w/ T-Storms
|
||||||
|
case 41: // Partly Cloudy w/ T-Storms
|
||||||
|
case 42: // Mostly Cloudy w/ T-Storms
|
||||||
|
return 16; // lightning-rainy
|
||||||
|
|
||||||
|
case 33: // Clear
|
||||||
|
case 34: // Mostly Clear
|
||||||
|
case 37: // Hazy Moonlight
|
||||||
|
return 17;
|
||||||
|
|
||||||
|
case 3: // Partly Sunny
|
||||||
|
case 4: // Intermittent Clouds
|
||||||
|
case 6: // Mostly Cloudy
|
||||||
|
case 35: // Partly Cloudy
|
||||||
|
case 36: // Intermittent Clouds
|
||||||
|
return 18; // partlycloudy
|
||||||
|
|
||||||
|
case 18: // pouring
|
||||||
|
return 19; // pouring
|
||||||
|
|
||||||
|
case 12: // Showers
|
||||||
|
case 13: // Mostly Cloudy w/ Showers
|
||||||
|
case 14: // Partly Sunny w/ Showers
|
||||||
|
case 26: // Freezing Rain
|
||||||
|
case 39: // Partly Cloudy w/ Showers
|
||||||
|
case 40: // Mostly Cloudy w/ Showers
|
||||||
|
return 20; // rainy
|
||||||
|
|
||||||
|
case 19: // Flurries
|
||||||
|
case 20: // Mostly Cloudy w/ Flurries
|
||||||
|
case 21: // Partly Sunny w/ Flurries
|
||||||
|
case 22: // Snow
|
||||||
|
case 23: // Mostly Cloudy w/ Snow
|
||||||
|
case 43: // Mostly Cloudy w/ Flurries
|
||||||
|
case 44: // Mostly Cloudy w/ Snow
|
||||||
|
return 21; // snowy
|
||||||
|
|
||||||
|
case 29: // Rain and Snow
|
||||||
|
return 22; // snowy-rainy
|
||||||
|
|
||||||
|
case 1: // Sunny
|
||||||
|
case 2: // Mostly Sunny
|
||||||
|
case 5: // Hazy Sunshine
|
||||||
|
return 23; // sunny
|
||||||
|
|
||||||
|
case 32: // windy
|
||||||
|
return 24; // windy
|
||||||
|
|
||||||
|
default:
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetBlendedColor(percentage: number): RGB {
|
||||||
|
if (percentage < 50)
|
||||||
|
return Interpolate(config.defaultOffColor, config.defaultOnColor, percentage / 50.0);
|
||||||
|
return Interpolate(Red, White, (percentage - 50) / 50.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
function Interpolate(color1: RGB, color2: RGB, fraction: number): RGB {
|
||||||
|
var r: number = InterpolateNum(color1.red, color2.red, fraction);
|
||||||
|
var g: number = InterpolateNum(color1.green, color2.green, fraction);
|
||||||
|
var b: number = InterpolateNum(color1.blue, color2.blue, fraction);
|
||||||
|
return <RGB>{ red: Math.round(r), green: Math.round(g), blue: Math.round(b) };
|
||||||
|
}
|
||||||
|
|
||||||
|
function InterpolateNum(d1: number, d2: number, fraction: number): number {
|
||||||
|
return d1 + (d2 - d1) * fraction;
|
||||||
|
}
|
||||||
|
|
||||||
|
function rgb_dec565(rgb: RGB): number {
|
||||||
|
return ((Math.floor(rgb.red / 255 * 31) << 11) | (Math.floor(rgb.green / 255 * 63) << 5) | (Math.floor(rgb.blue / 255 * 31)));
|
||||||
|
}
|
||||||
|
|
||||||
|
type RGB = {
|
||||||
|
red: number,
|
||||||
|
green: number,
|
||||||
|
blue: number
|
||||||
|
};
|
||||||
|
|
||||||
|
type Payload = {
|
||||||
|
payload: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
type Page = {
|
||||||
|
type: string,
|
||||||
|
heading: string,
|
||||||
|
items: PageItem[],
|
||||||
|
useColor: boolean
|
||||||
|
};
|
||||||
|
|
||||||
|
interface PageEntities extends Page {
|
||||||
|
type: "cardEntities",
|
||||||
|
items: PageItem[],
|
||||||
|
|
||||||
|
};
|
||||||
|
interface PageGrid extends Page {
|
||||||
|
type: "cardGrid",
|
||||||
|
items: PageItem[],
|
||||||
|
};
|
||||||
|
|
||||||
|
interface PageThermo extends Page {
|
||||||
|
type: "cardThermo",
|
||||||
|
items: PageItem[],
|
||||||
|
};
|
||||||
|
|
||||||
|
type PageItem = {
|
||||||
|
id: string,
|
||||||
|
icon: (number | undefined),
|
||||||
|
onColor: (RGB | undefined),
|
||||||
|
offColor: (RGB | undefined),
|
||||||
|
useColor: (boolean | undefined),
|
||||||
|
interpolateColor: (boolean | undefined),
|
||||||
|
minValue: (number | undefined),
|
||||||
|
maxValue: (number | undefined),
|
||||||
|
buttonText: (string | undefined)
|
||||||
|
}
|
||||||
|
|
||||||
|
type Config = {
|
||||||
|
panelRecvTopic: string,
|
||||||
|
panelSendTopic: string,
|
||||||
|
timeoutScreensaver: number,
|
||||||
|
dimmode: number,
|
||||||
|
//brightnessScreensaver:
|
||||||
|
locale: string,
|
||||||
|
timeFormat: string,
|
||||||
|
dateFormat: string,
|
||||||
|
weatherEntity: string | null,
|
||||||
|
screenSaverDoubleClick: boolean,
|
||||||
|
temperatureUnit: string,
|
||||||
|
firstScreensaverEntity: ScreenSaverElement | null,
|
||||||
|
secondScreensaverEntity: ScreenSaverElement | null,
|
||||||
|
thirdScreensaverEntity: ScreenSaverElement | null,
|
||||||
|
fourthScreensaverEntity: ScreenSaverElement | null,
|
||||||
|
defaultColor: RGB,
|
||||||
|
defaultOnColor: RGB,
|
||||||
|
defaultOffColor: RGB,
|
||||||
|
pages: (PageThermo | PageEntities | PageGrid)[],
|
||||||
|
button1Page: (PageThermo | PageEntities | PageGrid | null),
|
||||||
|
button2Page: (PageThermo | PageEntities | PageGrid | null),
|
||||||
|
};
|
||||||
|
|
||||||
|
type ScreenSaverElement = {
|
||||||
|
ScreensaverEntity: string | null,
|
||||||
|
ScreensaverEntityIcon: number | null,
|
||||||
|
ScreensaverEntityText: string | null,
|
||||||
|
ScreensaverEntityUnitText: string | null,
|
||||||
|
}
|
||||||
179
ioBroker/README.md
Normal file
179
ioBroker/README.md
Normal file
@@ -0,0 +1,179 @@
|
|||||||
|
# NSPanel ioBroker Integration
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- Thermostat Card
|
||||||
|
- Entity Card (Temperature, Switches and sensors, the script tries to figure the unit of measurement automatically)
|
||||||
|
- Grid Card
|
||||||
|
- Detail Card (only switch and normal dimmer)
|
||||||
|
- Live update (when value was changed in the backend and the page is currently open)
|
||||||
|
- Screensaver Page with Time, Date and Weather Information.
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
- ioBroker
|
||||||
|
- MQTT Broker/Client
|
||||||
|
- Javascript
|
||||||
|
- devices (default)
|
||||||
|
- all devices needs to be defined in the devices panel
|
||||||
|
- supported device roles are light, dimmer, blind, thermostat
|
||||||
|
|
||||||
|
## Note
|
||||||
|
Currently the names are pulled from the objects data field common.name.de.
|
||||||
|
If you use a different language please search and replace the "common.name.de" with your language.
|
||||||
|
You can find this in the device raw settings.
|
||||||
|
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
- Import this script into the ioBroker javascript instance and choose Typescript.
|
||||||
|
- Make sure the version of the adapter is not to old.
|
||||||
|
- Find the config variable and update to your needs.
|
||||||
|
- The format strings are not used right now.
|
||||||
|
- Make sure your device is connected with the mqtt instance. I didn't get it working with the sonoff adapter, but I didn't tried it too long.
|
||||||
|
- Create a state with a mqtt client or create one per hand. The mqtt adapter will not create the state CustomSend
|
||||||
|
- you only need to send a dummy message to cmnd/<yourPanel>/CustomSend
|
||||||
|
- then the state will be created
|
||||||
|
|
||||||
|
## Update the screensaver string
|
||||||
|
The screensaver string which is send to the display looks something like this:
|
||||||
|
weatherUpdate,?23?11 °C?26?54%?Batterie?4?12 %?PV?23?123W
|
||||||
|
All fields are seperated by a question mark. In detail the fields are:
|
||||||
|
weatherUpdate,?Icon?Text?Icon (default humidity)?Text next to the last icon?Text for the left icon on the right side?Icon?Text under the icon?Text for the right icon on the left side?Icon?Text under the icon
|
||||||
|
|
||||||
|
See the icons currently usable in the following table:
|
||||||
|
|
||||||
|
[Icon Table](../HMI#icons-ids)
|
||||||
|
|
||||||
|
You can change the string and devices in the config object.
|
||||||
|
|
||||||
|
## Hardware buttons
|
||||||
|
If you like you can add special pages for the buttons.
|
||||||
|
|
||||||
|
First you need to add this rule to Tasmota:
|
||||||
|
|
||||||
|
```
|
||||||
|
Rule2 on Button1#state do Publish tele/%topic%/RESULT {"CustomRecv":"event,button1"} endon on Button2#state do Publish tele/%topic%/RESULT {"CustomRecv":"event,button2"} endon
|
||||||
|
Rule2
|
||||||
|
```
|
||||||
|
|
||||||
|
## Colors
|
||||||
|
You can define colors this way and use them later in the PageItem element
|
||||||
|
```
|
||||||
|
const BatteryFull: RGB = { red: 96, green: 176, blue: 62 }
|
||||||
|
const BatteryEmpty: RGB = { red: 179, green: 45, blue: 25 }
|
||||||
|
```
|
||||||
|
## The config element in the script which needs to be configured
|
||||||
|
```
|
||||||
|
var config: Config = {
|
||||||
|
panelRecvTopic: "mqtt.0.tele.WzDisplay.RESULT", // This is the object where the panel send the data to.
|
||||||
|
panelSendTopic: "mqtt.0.cmnd.WzDisplay.CustomSend", // This is the object where data is send to the panel.
|
||||||
|
firstScreensaverEntity: { ScreensaverEntity: "alias.0.Wetter.HUMIDITY", ScreensaverEntityIcon: 26, ScreensaverEntityText: "Luft", ScreensaverEntityUnitText: "%" },
|
||||||
|
// Items which should be presented on the screensaver page
|
||||||
|
secondScreensaverEntity: { ScreensaverEntity: "alias.0.Wetter.PRECIPITATION_CHANCE", ScreensaverEntityIcon: 19, ScreensaverEntityText: "Regen", ScreensaverEntityUnitText: "%" },
|
||||||
|
thirdScreensaverEntity: { ScreensaverEntity: "alias.0.Batterie.ACTUAL", ScreensaverEntityIcon: 34, ScreensaverEntityText: "Batterie", ScreensaverEntityUnitText: "%" },
|
||||||
|
fourthScreensaverEntity: { ScreensaverEntity: "alias.0.Pv.ACTUAL", ScreensaverEntityIcon: 32, ScreensaverEntityText: "PV", ScreensaverEntityUnitText: "W" },
|
||||||
|
screenSaverDoubleClick: false, // Doubletouch needed for leaving screensaver.
|
||||||
|
timeoutScreensaver: 15, // Timeout for screensaver
|
||||||
|
dimmode: 8, // Display dim
|
||||||
|
locale: "de_DE", // not used right now
|
||||||
|
timeFormat: "%H:%M", // not used right now
|
||||||
|
dateFormat: "%A, %d. %B %Y", // not used right now
|
||||||
|
weatherEntity: "alias.0.Wetter",
|
||||||
|
defaultColor: Off, // Default color of all elements
|
||||||
|
defaultOnColor: RGB, // Default on state color for items
|
||||||
|
defaultOffColor: RGB, // Default off state color for page
|
||||||
|
temperatureUnit: "°C", // Unit to append on temperature sensors
|
||||||
|
<<<<<<< HEAD
|
||||||
|
pages: [Wohnen, Strom,
|
||||||
|
{
|
||||||
|
"type": "cardThermo",
|
||||||
|
"heading": "Thermostat",
|
||||||
|
"useColor": true,
|
||||||
|
"items": [<PageItem>{ id: "alias.0.WzNsPanel" }]
|
||||||
|
=======
|
||||||
|
pages: [
|
||||||
|
{
|
||||||
|
"type": "cardEntities", // card type (cardEntities, cardThermo)
|
||||||
|
"heading": "Testseite", // heading
|
||||||
|
"useColor": false, // should colors be enabled on this page, can be overridden in PageItem
|
||||||
|
"items": [ // items array (up to 4 on cardEntities, 1 for cardThermo)
|
||||||
|
<PageItem>{ id: "alias.0.Rolladen_Eltern" }, // device which must be configured in the device panel. Use only the folder for the device, not the set, get states ...
|
||||||
|
<PageItem>{ id: "alias.0.Erker" },
|
||||||
|
<PageItem>{ id: "alias.0.Küche", useColor: true },
|
||||||
|
<PageItem>{ id: "alias.0.Wand", useColor: true }
|
||||||
|
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "cardEntities",
|
||||||
|
"heading": "Strom",
|
||||||
|
"useColor": true, // should colors be enabled on this page, can be overridden in PageItem
|
||||||
|
"items": [
|
||||||
|
<PageItem>{ id: "alias.0.Netz" },
|
||||||
|
<PageItem>{ id: "alias.0.Hausverbrauch", icon: 4, interpolateColor: true, offColor: BatteryFull, onColor: Red , maxValue: 1000 },
|
||||||
|
<PageItem>{ id: "alias.0.Pv" },
|
||||||
|
<PageItem>{ id: "alias.0.Batterie", icon: 34, interpolateColor: true, offColor: BatteryEmpty, onColor: BatteryFull }
|
||||||
|
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "cardThermo",
|
||||||
|
"heading": "Thermostat",
|
||||||
|
"useColor": false, // should colors be enabled on this page, can be overridden in PageItem
|
||||||
|
"item": "alias.0.WzNsPanel" // Needs to be a thermostat in the device panel
|
||||||
|
>>>>>>> 8a48ff35d408a7712a3052ee3cf8fc84e8b699c7
|
||||||
|
}
|
||||||
|
],
|
||||||
|
button1Page: button1Page, // A cardEntities, cardThermo or nothing. This will be opened when pressing button1
|
||||||
|
button2Page: button2Page // you guess it
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
The pageItem element:
|
||||||
|
```
|
||||||
|
type PageItem = {
|
||||||
|
id: string, // the element in ioBroker devices
|
||||||
|
icon: (string | undefined), // the icon which should be displayed instead of the default detected. (not implemented)
|
||||||
|
onColor: (RGB | undefined), // the color the item will get when active
|
||||||
|
offColor: (RGB | undefined), // the color the item will get when inactive
|
||||||
|
useColor: (boolean | undefined) // override colors, only Grid pages has colors enabled per default
|
||||||
|
interpolateColor: (boolean | undefined),// fade between color on and off, useColor on Page or PageItem must be enabled
|
||||||
|
minValue: (number | undefined), // the minimum value for the fade calculation, if smaller the minimum value will be used
|
||||||
|
maxValue: (number | undefined), // the maximum value for the fade calculation, if larger the maximum value will be used
|
||||||
|
buttonText: (string | undefined) // the Button Text, default is "Press"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
If you want you can create dedicated objects, so you don't need to declare them again. Then you can use tehm in the pages array and button pages.
|
||||||
|
|
||||||
|
```
|
||||||
|
var button1Page: PageGrid =
|
||||||
|
{
|
||||||
|
"type": "cardGrid",
|
||||||
|
"heading": "Radio",
|
||||||
|
"useColor": true, // should colors be enabled on this page, can be overridden in PageItem
|
||||||
|
"items": [
|
||||||
|
<PageItem>{ id: "alias.0.Radio.NJoy" },
|
||||||
|
<PageItem>{ id: "alias.0.Radio.Delta_Radio" },
|
||||||
|
<PageItem>{ id: "alias.0.Radio.NDR2" },
|
||||||
|
]
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
Pages array can look like this, so you can add the pages as object or define them in the array itself. This is up to you.
|
||||||
|
|
||||||
|
```
|
||||||
|
pages: [
|
||||||
|
button1Page,
|
||||||
|
{
|
||||||
|
"type": "cardEntities",
|
||||||
|
"heading": "Strom",
|
||||||
|
"useColor": true, // should colors be enabled on this page, can be overridden in PageItem
|
||||||
|
"items": [
|
||||||
|
<PageItem>{ id: "alias.0.Netz" },
|
||||||
|
<PageItem>{ id: "alias.0.Hausverbrauch" },
|
||||||
|
<PageItem>{ id: "alias.0.Pv" },
|
||||||
|
<PageItem>{ id: "alias.0.Batterie" }
|
||||||
|
]
|
||||||
|
}]
|
||||||
|
```
|
||||||
@@ -1,11 +1,6 @@
|
|||||||
# Node-Red Flow
|
# Node-Red Flow
|
||||||
|
|
||||||
## Note:
|
There is no node-red backend, but for some advanced scenarios nodered can become handy, like remote controlling your nspanel.
|
||||||
**This flow has been deprecated in favour of the AppDaemon Backend.**
|
|
||||||
**It's still functioning with a limited feature set.**
|
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
This is the exmaple node red flow which an be used to control the screen over MQTT.
|
|
||||||
|
|
||||||
Import the example node-red flow from "node-red-example-flow.json" file and adjust to your needs.
|
|
||||||
File diff suppressed because one or more lines are too long
@@ -1,5 +1,44 @@
|
|||||||
# Nextion Berry Driver
|
# Nextion Berry Driver
|
||||||
|
|
||||||
|
This berry driver is intended for the usage with a custom HMI/TFT firmware on nspanel and is a customisted version form [peepshow-21's ns-flash](https://github.com/peepshow-21/ns-flash)
|
||||||
|
|
||||||
|
It adds the following commands to Tasmota:
|
||||||
|
|
||||||
|
- `Nextion Payload`
|
||||||
|
|
||||||
|
Send's normal Nextion Commands to the Screen (suffixed by 0xFFFFFF)
|
||||||
|
|
||||||
|
|
||||||
|
- `CustomSend Payload`
|
||||||
|
|
||||||
|
Send's normal Custom Commands to the Screen in the following format:
|
||||||
|
`55 BB [payload length] [payload] [crc] [crc]`
|
||||||
|
|
||||||
|
- `FlashNextion URL`
|
||||||
|
|
||||||
|
Start's flashing a tft file to the nextion screen via Nextion Upload Protocol 1.2
|
||||||
|
|
||||||
|
Webserver must be reachable via HTTP
|
||||||
|
|
||||||
|
Example: `FlashNextion http://192.168.75.30:8123/local/nspanel.tft`
|
||||||
|
|
||||||
|
- `GetDriverVersion`
|
||||||
|
|
||||||
|
Returns the version currently defined in the berry script
|
||||||
|
|
||||||
|
- `UpdateDriverVersion URL`
|
||||||
|
|
||||||
|
Downloads the autoexec.be script from the specified URL and loads it.
|
||||||
|
|
||||||
|
|
||||||
|
Besides the commands, serial input will be published on 'RESULT' Topic, depending on the input in one of the following formats:
|
||||||
|
- `{"CustomRecv":%s}`
|
||||||
|
- `{"nextion":%s}`
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Nextion Berry Driver Legacy Range (Old version with HTTP Range Method)
|
||||||
|
|
||||||
This berry driver is intended for the usage with a custom HMI/TFT firmware on nspanel.
|
This berry driver is intended for the usage with a custom HMI/TFT firmware on nspanel.
|
||||||
|
|
||||||
It adds the following commands to Tasmota:
|
It adds the following commands to Tasmota:
|
||||||
|
|||||||
409
tasmota/autoexec-legacy-range.be
Normal file
409
tasmota/autoexec-legacy-range.be
Normal file
@@ -0,0 +1,409 @@
|
|||||||
|
# Nextion Serial Protocol driver by joBr99 + nextion upload protocol 1.2 (the fast one yay) implementation using http range and tcpclient
|
||||||
|
# based on;
|
||||||
|
# Sonoff NSPanel Tasmota driver v0.47 | code by blakadder and s-hadinger
|
||||||
|
|
||||||
|
class TftDownloader
|
||||||
|
var tcp
|
||||||
|
|
||||||
|
var host
|
||||||
|
var port
|
||||||
|
var file
|
||||||
|
|
||||||
|
var s
|
||||||
|
var b
|
||||||
|
var tft_file_size
|
||||||
|
var current_chunk
|
||||||
|
var current_chunk_start
|
||||||
|
var download_range
|
||||||
|
|
||||||
|
|
||||||
|
def init(host, port, file, download_range)
|
||||||
|
self.tft_file_size = 0
|
||||||
|
|
||||||
|
self.host = host
|
||||||
|
self.port = port
|
||||||
|
self.file = file
|
||||||
|
self.download_range = download_range #32768
|
||||||
|
end
|
||||||
|
|
||||||
|
def download_chunk(b_start, b_length)
|
||||||
|
import string
|
||||||
|
self.tcp = tcpclient()
|
||||||
|
self.tcp.connect(self.host, self.port)
|
||||||
|
print("connected:", self.tcp.connected())
|
||||||
|
self.s = "GET " + self.file + " HTTP/1.0\r\n"
|
||||||
|
self.s += "HOST: " + self.host + "\r\n"
|
||||||
|
self.s += string.format("Range: bytes=%d-%d\r\n", b_start, (b_start+b_length-1))
|
||||||
|
print(string.format("Downloading Byte %d - %d", b_start, (b_start+b_length-1)))
|
||||||
|
self.s += "\r\n"
|
||||||
|
self.tcp.write(self.s)
|
||||||
|
|
||||||
|
#read one char after another until we reached end of http header
|
||||||
|
var end_of_header = false
|
||||||
|
var header = ""
|
||||||
|
while !end_of_header
|
||||||
|
if self.tcp.available() > 0
|
||||||
|
header += self.tcp.read(1)
|
||||||
|
if(string.find(header, '\r\n\r\n') != -1)
|
||||||
|
end_of_header = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
var content_length = 0
|
||||||
|
|
||||||
|
# check for 206 status code
|
||||||
|
if(string.find(header, '206 Partial Content') != -1)
|
||||||
|
# download was sucessful
|
||||||
|
else
|
||||||
|
print("Error while downloading")
|
||||||
|
print(header)
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
|
# convert header to list
|
||||||
|
header = string.split(header, '\r\n')
|
||||||
|
for i : header.iter()
|
||||||
|
#print(i)
|
||||||
|
if(string.find(i, 'Content-Range:') != -1)
|
||||||
|
if self.tft_file_size == 0
|
||||||
|
print(i)
|
||||||
|
self.tft_file_size = number(string.split(i, '/')[1])
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if(string.find(i, 'Content-Length:') != -1)
|
||||||
|
content_length = number(string.split(i, 16)[1])
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
#print(content_length)
|
||||||
|
# read bytes until content_length is reached
|
||||||
|
var content = bytes()
|
||||||
|
while content.size() != content_length
|
||||||
|
if self.tcp.available() > 0
|
||||||
|
content += self.tcp.readbytes()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
#print(content.size())
|
||||||
|
return content
|
||||||
|
end
|
||||||
|
|
||||||
|
def get_file_size()
|
||||||
|
self.download_chunk(0, 1)
|
||||||
|
return self.tft_file_size
|
||||||
|
end
|
||||||
|
|
||||||
|
# returns the next 4096 bytes after pos of the tft file
|
||||||
|
def next_chunk(pos)
|
||||||
|
if(self.current_chunk == nil)
|
||||||
|
print("current chunk empty")
|
||||||
|
self.current_chunk = self.download_chunk(pos, self.download_range)
|
||||||
|
self.current_chunk_start = pos
|
||||||
|
end
|
||||||
|
if(pos < self.current_chunk_start)
|
||||||
|
print("Requested pos is below start point of chunk in memory, not implemented")
|
||||||
|
end
|
||||||
|
if(pos >= (self.current_chunk_start+self.download_range))
|
||||||
|
print("Requested pos is after the end of chunk in memory, downloading new range")
|
||||||
|
self.current_chunk = self.download_chunk(pos, self.download_range)
|
||||||
|
self.current_chunk_start = pos
|
||||||
|
end
|
||||||
|
var start_within_current_chunk = pos - self.current_chunk_start
|
||||||
|
return self.current_chunk[start_within_current_chunk..(start_within_current_chunk+4095)]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
class Nextion : Driver
|
||||||
|
|
||||||
|
var ser
|
||||||
|
var flash_size
|
||||||
|
var flash_mode
|
||||||
|
var flash_version
|
||||||
|
var flash_skip
|
||||||
|
var flash_current_byte
|
||||||
|
var tftd
|
||||||
|
var progress_percentage_last
|
||||||
|
static header = bytes('55BB')
|
||||||
|
|
||||||
|
def init()
|
||||||
|
log("NSP: Initializing Driver")
|
||||||
|
self.ser = serial(17, 16, 115200, serial.SERIAL_8N1)
|
||||||
|
self.flash_mode = 0
|
||||||
|
self.flash_version = 1
|
||||||
|
self.flash_skip = false
|
||||||
|
tasmota.add_driver(self)
|
||||||
|
end
|
||||||
|
|
||||||
|
def crc16(data, poly)
|
||||||
|
if !poly poly = 0xA001 end
|
||||||
|
# CRC-16 MODBUS HASHING ALGORITHM
|
||||||
|
var crc = 0xFFFF
|
||||||
|
for i:0..size(data)-1
|
||||||
|
crc = crc ^ data[i]
|
||||||
|
for j:0..7
|
||||||
|
if crc & 1
|
||||||
|
crc = (crc >> 1) ^ poly
|
||||||
|
else
|
||||||
|
crc = crc >> 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return crc
|
||||||
|
end
|
||||||
|
|
||||||
|
def split_55(b)
|
||||||
|
var ret = []
|
||||||
|
var s = size(b)
|
||||||
|
var i = s-2 # start from last-1
|
||||||
|
while i > 0
|
||||||
|
if b[i] == 0x55 && b[i+1] == 0xBB
|
||||||
|
ret.push(b[i..s-1]) # push last msg to list
|
||||||
|
b = b[(0..i-1)] # write the rest back to b
|
||||||
|
end
|
||||||
|
i -= 1
|
||||||
|
end
|
||||||
|
ret.push(b)
|
||||||
|
return ret
|
||||||
|
end
|
||||||
|
|
||||||
|
# encode using custom protocol 55 BB [payload length] [payload length] [payload] [crc] [crc]
|
||||||
|
def encode(payload)
|
||||||
|
var b = bytes()
|
||||||
|
b += self.header
|
||||||
|
b.add(size(payload), 2) # add size as 2 bytes, little endian
|
||||||
|
b += bytes().fromstring(payload)
|
||||||
|
var msg_crc = self.crc16(b)
|
||||||
|
b.add(msg_crc, 2) # crc 2 bytes, little endian
|
||||||
|
return b
|
||||||
|
end
|
||||||
|
|
||||||
|
# send a nextion payload
|
||||||
|
def encodenx(payload)
|
||||||
|
var b = bytes().fromstring(payload)
|
||||||
|
b += bytes('FFFFFF')
|
||||||
|
return b
|
||||||
|
end
|
||||||
|
|
||||||
|
def sendnx(payload)
|
||||||
|
var payload_bin = self.encodenx(payload)
|
||||||
|
self.ser.write(payload_bin)
|
||||||
|
print("NSP: Sent =", payload_bin)
|
||||||
|
log("NSP: Nextion command sent = " + str(payload_bin), 3)
|
||||||
|
end
|
||||||
|
|
||||||
|
def send(payload)
|
||||||
|
var payload_bin = self.encode(payload)
|
||||||
|
if self.flash_mode==1
|
||||||
|
log("NSP: skipped command becuase still flashing", 3)
|
||||||
|
else
|
||||||
|
self.ser.write(payload_bin)
|
||||||
|
log("NSP: payload sent = " + str(payload_bin), 3)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def start_flash(url)
|
||||||
|
import string
|
||||||
|
var host
|
||||||
|
var port
|
||||||
|
var s1 = string.split(url,7)[1]
|
||||||
|
var i = string.find(s1,":")
|
||||||
|
var sa
|
||||||
|
if i<0
|
||||||
|
port = 80
|
||||||
|
i = string.find(s1,"/")
|
||||||
|
sa = string.split(s1,i)
|
||||||
|
host = sa[0]
|
||||||
|
else
|
||||||
|
sa = string.split(s1,i)
|
||||||
|
host = sa[0]
|
||||||
|
s1 = string.split(sa[1],1)[1]
|
||||||
|
i = string.find(s1,"/")
|
||||||
|
sa = string.split(s1,i)
|
||||||
|
port = int(sa[0])
|
||||||
|
end
|
||||||
|
var file = sa[1]
|
||||||
|
#print(host,port,file)
|
||||||
|
|
||||||
|
self.tftd = TftDownloader(host, port, file, 32768)
|
||||||
|
|
||||||
|
# get size of tft file
|
||||||
|
self.flash_size = self.tftd.get_file_size()
|
||||||
|
|
||||||
|
self.flash_mode = 1
|
||||||
|
self.sendnx('DRAKJHSUYDGBNCJHGJKSHBDN')
|
||||||
|
self.sendnx('recmod=0')
|
||||||
|
self.sendnx('recmod=0')
|
||||||
|
self.sendnx("connect")
|
||||||
|
self.sendnx("connect")
|
||||||
|
|
||||||
|
self.flash_current_byte = 0
|
||||||
|
end
|
||||||
|
|
||||||
|
def write_chunk(b_start)
|
||||||
|
var chunk = self.tftd.next_chunk(b_start)
|
||||||
|
#import string
|
||||||
|
#print(string.format("Sending Byte %d - %d with size of %d", b_start, b_start+4095, chunk.size()))
|
||||||
|
self.ser.write(chunk)
|
||||||
|
return chunk.size()
|
||||||
|
end
|
||||||
|
|
||||||
|
def flash_nextion()
|
||||||
|
import string
|
||||||
|
var x = self.write_chunk(self.flash_current_byte)
|
||||||
|
self.flash_current_byte = self.flash_current_byte + x
|
||||||
|
var progress_percentage = (self.flash_current_byte*100/self.flash_size)
|
||||||
|
if (self.progress_percentage_last!=progress_percentage)
|
||||||
|
print(string.format("Flashing Progress ( %d / %d ) [ %d ]", self.flash_current_byte, self.flash_size, progress_percentage))
|
||||||
|
self.progress_percentage_last = progress_percentage
|
||||||
|
tasmota.publish_result(string.format("{\"Flashing\":{\"complete\": %d}}",progress_percentage), "RESULT")
|
||||||
|
end
|
||||||
|
if (self.flash_current_byte==self.flash_size)
|
||||||
|
log("NSP: Flashing complete")
|
||||||
|
self.flash_mode = 0
|
||||||
|
end
|
||||||
|
tasmota.yield()
|
||||||
|
end
|
||||||
|
|
||||||
|
def every_100ms()
|
||||||
|
import string
|
||||||
|
if self.ser.available() > 0
|
||||||
|
var msg = self.ser.read()
|
||||||
|
if size(msg) > 0
|
||||||
|
print("NSP: Received Raw =", msg)
|
||||||
|
if self.flash_mode==1
|
||||||
|
var str = msg[0..-4].asstring()
|
||||||
|
log(str, 3)
|
||||||
|
# TODO: add check for firmware versions < 126 and send proto 1.1 command for thoose
|
||||||
|
if (string.find(str,"comok 2")==0)
|
||||||
|
if self.flash_version==1
|
||||||
|
log("NSP: Flashing 1.1")
|
||||||
|
self.sendnx(string.format("whmi-wri %d,115200,1",self.flash_size)) # Nextion Upload Protocol 1.1
|
||||||
|
else
|
||||||
|
log("NSP: Flashing 1.2")
|
||||||
|
self.sendnx(string.format("whmi-wris %d,115200,1",self.flash_size)) # Nextion Upload Protocol 1.2
|
||||||
|
end
|
||||||
|
|
||||||
|
# skip to byte (upload protocol 1.2)
|
||||||
|
elif (size(msg)==1 && msg[0]==0x08)
|
||||||
|
self.flash_skip = true
|
||||||
|
print("rec 0x08")
|
||||||
|
elif (size(msg)==4 && self.flash_skip)
|
||||||
|
var skip_to_byte = msg[0..4].get(0,4)
|
||||||
|
if(skip_to_byte == 0)
|
||||||
|
print("don't skip, offset is 0")
|
||||||
|
else
|
||||||
|
print("skip to ", skip_to_byte)
|
||||||
|
self.flash_current_byte = skip_to_byte
|
||||||
|
end
|
||||||
|
self.flash_nextion()
|
||||||
|
# send next 4096 bytes (proto 1.1/1.2)
|
||||||
|
elif (size(msg)==1 && msg[0]==0x05)
|
||||||
|
print("rec 0x05")
|
||||||
|
self.flash_nextion()
|
||||||
|
end
|
||||||
|
else
|
||||||
|
# Recive messages using custom protocol 55 BB [payload length] [payload length] [payload] [crc] [crc]
|
||||||
|
if msg[0..1] == self.header
|
||||||
|
var lst = self.split_55(msg)
|
||||||
|
for i:0..size(lst)-1
|
||||||
|
msg = lst[i]
|
||||||
|
#var j = msg[2]+2
|
||||||
|
var j = size(msg) - 3
|
||||||
|
msg = msg[4..j]
|
||||||
|
if size(msg) > 2
|
||||||
|
var jm = string.format("{\"CustomRecv\":\"%s\"}",msg.asstring())
|
||||||
|
tasmota.publish_result(jm, "RESULT")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
elif msg == bytes('000000FFFFFF88FFFFFF')
|
||||||
|
log("NSP: Screen Initialized")
|
||||||
|
else
|
||||||
|
var jm = string.format("{\"nextion\":\"%s\"}",str(msg[0..-4]))
|
||||||
|
tasmota.publish_result(jm, "RESULT")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def get_current_version(cmd, idx, payload, payload_json)
|
||||||
|
import string
|
||||||
|
var version_of_this_script = 2
|
||||||
|
var jm = string.format("{\"nlui_driver_version\":\"%s\"}", version_of_this_script)
|
||||||
|
tasmota.publish_result(jm, "RESULT")
|
||||||
|
end
|
||||||
|
|
||||||
|
tasmota.add_cmd('GetDriverVersion', get_current_version)
|
||||||
|
|
||||||
|
def update_berry_driver(cmd, idx, payload, payload_json)
|
||||||
|
def task()
|
||||||
|
import string
|
||||||
|
var cl = webclient()
|
||||||
|
cl.begin(payload)
|
||||||
|
var r = cl.GET()
|
||||||
|
if r == 200
|
||||||
|
print("Sucessfully downloaded nspanel-lovelace-ui berry driver")
|
||||||
|
else
|
||||||
|
print("Error while downloading nspanel-lovelace-ui berry driver")
|
||||||
|
end
|
||||||
|
r = cl.write_file("autoexec.be")
|
||||||
|
if r < 0
|
||||||
|
print("Error while writeing nspanel-lovelace-ui berry driver")
|
||||||
|
else
|
||||||
|
print("Scucessfully written nspanel-lovelace-ui berry driver")
|
||||||
|
var s = load('autoexec.be')
|
||||||
|
if s == true
|
||||||
|
var jm = string.format("{\"nlui_driver_update\":\"%s\"}", "succeeded")
|
||||||
|
tasmota.publish_result(jm, "RESULT")
|
||||||
|
else
|
||||||
|
var jm = string.format("{\"nlui_driver_update\":\"%s\"}", "failed")
|
||||||
|
tasmota.publish_result(jm, "RESULT")
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
||||||
|
tasmota.set_timer(0,task)
|
||||||
|
tasmota.resp_cmnd_done()
|
||||||
|
end
|
||||||
|
|
||||||
|
tasmota.add_cmd('UpdateDriverVersion', update_berry_driver)
|
||||||
|
|
||||||
|
var nextion = Nextion()
|
||||||
|
|
||||||
|
def flash_nextion(cmd, idx, payload, payload_json)
|
||||||
|
def task()
|
||||||
|
nextion.flash_version = 1
|
||||||
|
nextion.start_flash(payload)
|
||||||
|
end
|
||||||
|
tasmota.set_timer(0,task)
|
||||||
|
tasmota.resp_cmnd_done()
|
||||||
|
end
|
||||||
|
|
||||||
|
tasmota.add_cmd('FlashNextion', flash_nextion)
|
||||||
|
|
||||||
|
def flash_nextion_1_2(cmd, idx, payload, payload_json)
|
||||||
|
def task()
|
||||||
|
nextion.flash_version = 2
|
||||||
|
nextion.start_flash(payload)
|
||||||
|
end
|
||||||
|
tasmota.set_timer(0,task)
|
||||||
|
tasmota.resp_cmnd_done()
|
||||||
|
end
|
||||||
|
|
||||||
|
tasmota.add_cmd('FlashNextionFast', flash_nextion_1_2)
|
||||||
|
|
||||||
|
def send_cmd(cmd, idx, payload, payload_json)
|
||||||
|
nextion.sendnx(payload)
|
||||||
|
tasmota.resp_cmnd_done()
|
||||||
|
end
|
||||||
|
|
||||||
|
tasmota.add_cmd('Nextion', send_cmd)
|
||||||
|
|
||||||
|
def send_cmd2(cmd, idx, payload, payload_json)
|
||||||
|
nextion.send(payload)
|
||||||
|
tasmota.resp_cmnd_done()
|
||||||
|
end
|
||||||
|
|
||||||
|
tasmota.add_cmd('CustomSend', send_cmd2)
|
||||||
@@ -1,140 +1,45 @@
|
|||||||
# Nextion Serial Protocol driver by joBr99 + nextion upload protocol 1.2 (the fast one yay) implementation using http range and tcpclient
|
# Sonoff NSPanel Tasmota Lovelace UI Berry Driver | code by joBr99
|
||||||
|
# based on;
|
||||||
|
# Sonoff NSPanel Tasmota (Nextion with Flashing) driver | code by peepshow-21
|
||||||
# based on;
|
# based on;
|
||||||
# Sonoff NSPanel Tasmota driver v0.47 | code by blakadder and s-hadinger
|
# Sonoff NSPanel Tasmota driver v0.47 | code by blakadder and s-hadinger
|
||||||
|
|
||||||
class TftDownloader
|
# Example Flash
|
||||||
var tcp
|
# FlashNextion http://ip-address-of-your-homeassistant:8123/local/nspanel.tft
|
||||||
|
# FlashNextion http://nspanel.pky.eu/lui.tft
|
||||||
var host
|
|
||||||
var port
|
|
||||||
var file
|
|
||||||
|
|
||||||
var s
|
|
||||||
var b
|
|
||||||
var tft_file_size
|
|
||||||
var current_chunk
|
|
||||||
var current_chunk_start
|
|
||||||
var download_range
|
|
||||||
|
|
||||||
|
|
||||||
def init(host, port, file, download_range)
|
|
||||||
self.tft_file_size = 0
|
|
||||||
|
|
||||||
self.host = host
|
|
||||||
self.port = port
|
|
||||||
self.file = file
|
|
||||||
self.download_range = download_range #32768
|
|
||||||
end
|
|
||||||
|
|
||||||
def download_chunk(b_start, b_length)
|
|
||||||
import string
|
|
||||||
self.tcp = tcpclient()
|
|
||||||
self.tcp.connect(self.host, self.port)
|
|
||||||
print("connected:", self.tcp.connected())
|
|
||||||
self.s = "GET " + self.file + " HTTP/1.0\r\n"
|
|
||||||
self.s += "HOST: " + self.host + "\r\n"
|
|
||||||
self.s += string.format("Range: bytes=%d-%d\r\n", b_start, (b_start+b_length-1))
|
|
||||||
print(string.format("Downloading Byte %d - %d", b_start, (b_start+b_length-1)))
|
|
||||||
self.s += "\r\n"
|
|
||||||
self.tcp.write(self.s)
|
|
||||||
|
|
||||||
#read one char after another until we reached end of http header
|
|
||||||
var end_of_header = false
|
|
||||||
var header = ""
|
|
||||||
while !end_of_header
|
|
||||||
if self.tcp.available() > 0
|
|
||||||
header += self.tcp.read(1)
|
|
||||||
if(string.find(header, '\r\n\r\n') != -1)
|
|
||||||
end_of_header = true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
var content_length = 0
|
|
||||||
|
|
||||||
# check for 206 status code
|
|
||||||
if(string.find(header, '206 Partial Content') != -1)
|
|
||||||
# download was sucessful
|
|
||||||
else
|
|
||||||
print("Error while downloading")
|
|
||||||
print(header)
|
|
||||||
return nil
|
|
||||||
end
|
|
||||||
|
|
||||||
# convert header to list
|
|
||||||
header = string.split(header, '\r\n')
|
|
||||||
for i : header.iter()
|
|
||||||
#print(i)
|
|
||||||
if(string.find(i, 'Content-Range:') != -1)
|
|
||||||
if self.tft_file_size == 0
|
|
||||||
print(i)
|
|
||||||
self.tft_file_size = number(string.split(i, '/')[1])
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if(string.find(i, 'Content-Length:') != -1)
|
|
||||||
content_length = number(string.split(i, 16)[1])
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
#print(content_length)
|
|
||||||
# read bytes until content_length is reached
|
|
||||||
var content = bytes()
|
|
||||||
while content.size() != content_length
|
|
||||||
if self.tcp.available() > 0
|
|
||||||
content += self.tcp.readbytes()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
#print(content.size())
|
|
||||||
return content
|
|
||||||
end
|
|
||||||
|
|
||||||
def get_file_size()
|
|
||||||
self.download_chunk(0, 1)
|
|
||||||
return self.tft_file_size
|
|
||||||
end
|
|
||||||
|
|
||||||
# returns the next 4096 bytes after pos of the tft file
|
|
||||||
def next_chunk(pos)
|
|
||||||
if(self.current_chunk == nil)
|
|
||||||
print("current chunk empty")
|
|
||||||
self.current_chunk = self.download_chunk(pos, self.download_range)
|
|
||||||
self.current_chunk_start = pos
|
|
||||||
end
|
|
||||||
if(pos < self.current_chunk_start)
|
|
||||||
print("Requested pos is below start point of chunk in memory, not implemented")
|
|
||||||
end
|
|
||||||
if(pos >= (self.current_chunk_start+self.download_range))
|
|
||||||
print("Requested pos is after the end of chunk in memory, downloading new range")
|
|
||||||
self.current_chunk = self.download_chunk(pos, self.download_range)
|
|
||||||
self.current_chunk_start = pos
|
|
||||||
end
|
|
||||||
var start_within_current_chunk = pos - self.current_chunk_start
|
|
||||||
return self.current_chunk[start_within_current_chunk..(start_within_current_chunk+4095)]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
class Nextion : Driver
|
class Nextion : Driver
|
||||||
|
|
||||||
var ser
|
static VERSION = "1.1.3"
|
||||||
var flash_size
|
static header = bytes('55BB')
|
||||||
var flash_mode
|
|
||||||
var flash_version
|
|
||||||
var flash_skip
|
|
||||||
var flash_current_byte
|
|
||||||
var tftd
|
|
||||||
var progress_percentage_last
|
|
||||||
static header = bytes('55BB')
|
|
||||||
|
|
||||||
def init()
|
static flash_block_size = 4096
|
||||||
log("NSP: Initializing Driver")
|
|
||||||
self.ser = serial(17, 16, 115200, serial.SERIAL_8N1)
|
var flash_mode
|
||||||
self.flash_mode = 0
|
var flash_size
|
||||||
self.flash_version = 1
|
var flash_written
|
||||||
self.flash_skip = false
|
var flash_buff
|
||||||
tasmota.add_driver(self)
|
var flash_offset
|
||||||
|
var awaiting_offset
|
||||||
|
var tcp
|
||||||
|
var ser
|
||||||
|
var last_per
|
||||||
|
|
||||||
|
def split_55(b)
|
||||||
|
var ret = []
|
||||||
|
var s = size(b)
|
||||||
|
var i = s-2 # start from last-1
|
||||||
|
while i > 0
|
||||||
|
if b[i] == 0x55 && b[i+1] == 0xBB
|
||||||
|
ret.push(b[i..s-1]) # push last msg to list
|
||||||
|
b = b[(0..i-1)] # write the rest back to b
|
||||||
|
end
|
||||||
|
i -= 1
|
||||||
|
end
|
||||||
|
ret.push(b)
|
||||||
|
return ret
|
||||||
end
|
end
|
||||||
|
|
||||||
def crc16(data, poly)
|
def crc16(data, poly)
|
||||||
if !poly poly = 0xA001 end
|
if !poly poly = 0xA001 end
|
||||||
# CRC-16 MODBUS HASHING ALGORITHM
|
# CRC-16 MODBUS HASHING ALGORITHM
|
||||||
@@ -151,21 +56,6 @@ class Nextion : Driver
|
|||||||
end
|
end
|
||||||
return crc
|
return crc
|
||||||
end
|
end
|
||||||
|
|
||||||
def split_55(b)
|
|
||||||
var ret = []
|
|
||||||
var s = size(b)
|
|
||||||
var i = s-2 # start from last-1
|
|
||||||
while i > 0
|
|
||||||
if b[i] == 0x55 && b[i+1] == 0xBB
|
|
||||||
ret.push(b[i..s-1]) # push last msg to list
|
|
||||||
b = b[(0..i-1)] # write the rest back to b
|
|
||||||
end
|
|
||||||
i -= 1
|
|
||||||
end
|
|
||||||
ret.push(b)
|
|
||||||
return ret
|
|
||||||
end
|
|
||||||
|
|
||||||
# encode using custom protocol 55 BB [payload length] [payload length] [payload] [crc] [crc]
|
# encode using custom protocol 55 BB [payload length] [payload length] [payload] [crc] [crc]
|
||||||
def encode(payload)
|
def encode(payload)
|
||||||
@@ -177,33 +67,144 @@ class Nextion : Driver
|
|||||||
b.add(msg_crc, 2) # crc 2 bytes, little endian
|
b.add(msg_crc, 2) # crc 2 bytes, little endian
|
||||||
return b
|
return b
|
||||||
end
|
end
|
||||||
|
|
||||||
# send a nextion payload
|
def encodenx(payload)
|
||||||
def encodenx(payload)
|
var b = bytes().fromstring(payload)
|
||||||
var b = bytes().fromstring(payload)
|
b += bytes('FFFFFF')
|
||||||
b += bytes('FFFFFF')
|
return b
|
||||||
return b
|
end
|
||||||
end
|
|
||||||
|
def sendnx(payload)
|
||||||
def sendnx(payload)
|
import string
|
||||||
var payload_bin = self.encodenx(payload)
|
var payload_bin = self.encodenx(payload)
|
||||||
self.ser.write(payload_bin)
|
self.ser.write(payload_bin)
|
||||||
print("NSP: Sent =", payload_bin)
|
log(string.format("NXP: Nextion command sent = %s",str(payload_bin)), 3)
|
||||||
log("NSP: Nextion command sent = " + str(payload_bin), 3)
|
end
|
||||||
end
|
|
||||||
|
|
||||||
def send(payload)
|
def send(payload)
|
||||||
var payload_bin = self.encode(payload)
|
var payload_bin = self.encode(payload)
|
||||||
if self.flash_mode==1
|
if self.flash_mode==1
|
||||||
log("NSP: skipped command becuase still flashing", 3)
|
log("NXP: skipped command becuase still flashing", 3)
|
||||||
else
|
else
|
||||||
self.ser.write(payload_bin)
|
self.ser.write(payload_bin)
|
||||||
log("NSP: payload sent = " + str(payload_bin), 3)
|
log("NXP: payload sent = " + str(payload_bin), 3)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def start_flash(url)
|
def write_to_nextion(b)
|
||||||
import string
|
self.ser.write(b)
|
||||||
|
end
|
||||||
|
|
||||||
|
def screeninit()
|
||||||
|
log("NXP: Screen Initialized")
|
||||||
|
self.sendnx("recmod=1")
|
||||||
|
end
|
||||||
|
|
||||||
|
def write_block()
|
||||||
|
|
||||||
|
import string
|
||||||
|
log("FLH: Read block",3)
|
||||||
|
while size(self.flash_buff)<self.flash_block_size && self.tcp.connected()
|
||||||
|
if self.tcp.available()>0
|
||||||
|
self.flash_buff += self.tcp.readbytes()
|
||||||
|
else
|
||||||
|
tasmota.delay(50)
|
||||||
|
log("FLH: Wait for available...",3)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
log("FLH: Buff size "+str(size(self.flash_buff)),3)
|
||||||
|
var to_write
|
||||||
|
if size(self.flash_buff)>self.flash_block_size
|
||||||
|
to_write = self.flash_buff[0..self.flash_block_size-1]
|
||||||
|
self.flash_buff = self.flash_buff[self.flash_block_size..]
|
||||||
|
else
|
||||||
|
to_write = self.flash_buff
|
||||||
|
self.flash_buff = bytes()
|
||||||
|
end
|
||||||
|
log("FLH: Writing "+str(size(to_write)),3)
|
||||||
|
var per = (self.flash_written*100)/self.flash_size
|
||||||
|
if (self.last_per!=per)
|
||||||
|
self.last_per = per
|
||||||
|
tasmota.publish_result(string.format("{\"Flashing\":{\"complete\": %d}}",per), "RESULT")
|
||||||
|
end
|
||||||
|
if size(to_write)>0
|
||||||
|
self.flash_written += size(to_write)
|
||||||
|
if self.flash_offset==0 || self.flash_written>self.flash_offset
|
||||||
|
self.ser.write(to_write)
|
||||||
|
self.flash_offset = 0
|
||||||
|
else
|
||||||
|
tasmota.set_timer(10,/->self.write_block())
|
||||||
|
end
|
||||||
|
end
|
||||||
|
log("FLH: Total "+str(self.flash_written),3)
|
||||||
|
if (self.flash_written==self.flash_size)
|
||||||
|
log("FLH: Flashing complete")
|
||||||
|
self.flash_mode = 0
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
def every_100ms()
|
||||||
|
import string
|
||||||
|
if self.ser.available() > 0
|
||||||
|
var msg = self.ser.read()
|
||||||
|
if size(msg) > 0
|
||||||
|
log(string.format("NXP: Received Raw = %s",str(msg)), 3)
|
||||||
|
if (self.flash_mode==1)
|
||||||
|
var strv = msg[0..-4].asstring()
|
||||||
|
if string.find(strv,"comok 2")>=0
|
||||||
|
log("FLH: Send (High Speed) flash start")
|
||||||
|
self.sendnx(string.format("whmi-wris %d,115200,res0",self.flash_size))
|
||||||
|
elif size(msg)==1 && msg[0]==0x08
|
||||||
|
log("FLH: Waiting offset...",3)
|
||||||
|
self.awaiting_offset = 1
|
||||||
|
elif size(msg)==4 && self.awaiting_offset==1
|
||||||
|
self.awaiting_offset = 0
|
||||||
|
self.flash_offset = msg.get(0,4)
|
||||||
|
log("FLH: Flash offset marker "+str(self.flash_offset),3)
|
||||||
|
self.write_block()
|
||||||
|
elif size(msg)==1 && msg[0]==0x05
|
||||||
|
self.write_block()
|
||||||
|
else
|
||||||
|
log("FLH: Something has gone wrong flashing display firmware ["+str(msg)+"]",2)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
var msg_list = self.split_55(msg)
|
||||||
|
for i:0..size(msg_list)-1
|
||||||
|
msg = msg_list[i]
|
||||||
|
if size(msg) > 0
|
||||||
|
if msg == bytes('000000FFFFFF88FFFFFF')
|
||||||
|
self.screeninit()
|
||||||
|
elif size(msg)>=2 && msg[0]==0x55 && msg[1]==0xBB
|
||||||
|
var jm = string.format("{\"CustomRecv\":\"%s\"}",msg[4..-3].asstring())
|
||||||
|
tasmota.publish_result(jm, "RESULT")
|
||||||
|
elif msg[0]==0x07 && size(msg)==1 # BELL/Buzzer
|
||||||
|
tasmota.cmd("buzzer 1,1")
|
||||||
|
else
|
||||||
|
var jm = string.format("{\"nextion\":\"%s\"}",str(msg[0..-4]))
|
||||||
|
tasmota.publish_result(jm, "RESULT")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def begin_nextion_flash()
|
||||||
|
self.flash_written = 0
|
||||||
|
self.awaiting_offset = 0
|
||||||
|
self.flash_offset = 0
|
||||||
|
self.sendnx('DRAKJHSUYDGBNCJHGJKSHBDN')
|
||||||
|
self.sendnx('recmod=0')
|
||||||
|
self.sendnx('recmod=0')
|
||||||
|
self.flash_mode = 1
|
||||||
|
self.sendnx("connect")
|
||||||
|
end
|
||||||
|
|
||||||
|
def open_url(url)
|
||||||
|
|
||||||
|
import string
|
||||||
var host
|
var host
|
||||||
var port
|
var port
|
||||||
var s1 = string.split(url,7)[1]
|
var s1 = string.split(url,7)[1]
|
||||||
@@ -222,115 +223,109 @@ class Nextion : Driver
|
|||||||
sa = string.split(s1,i)
|
sa = string.split(s1,i)
|
||||||
port = int(sa[0])
|
port = int(sa[0])
|
||||||
end
|
end
|
||||||
var file = sa[1]
|
var get = sa[1]
|
||||||
#print(host,port,file)
|
log(string.format("FLH: host: %s, port: %s, get: %s",host,port,get))
|
||||||
|
self.tcp = tcpclient()
|
||||||
self.tftd = TftDownloader(host, port, file, 32768)
|
self.tcp.connect(host,port)
|
||||||
|
log("FLH: Connected:"+str(self.tcp.connected()),3)
|
||||||
# get size of tft file
|
var get_req = "GET "+get+" HTTP/1.0\r\n"
|
||||||
self.flash_size = self.tftd.get_file_size()
|
get_req += string.format("HOST: %s:%s\r\n\r\n",host,port)
|
||||||
|
self.tcp.write(get_req)
|
||||||
self.flash_mode = 1
|
var a = self.tcp.available()
|
||||||
self.sendnx('DRAKJHSUYDGBNCJHGJKSHBDN')
|
i = 1
|
||||||
self.sendnx('recmod=0')
|
while a==0 && i<5
|
||||||
self.sendnx('recmod=0')
|
tasmota.delay(100*i)
|
||||||
self.sendnx("connect")
|
tasmota.yield()
|
||||||
self.sendnx("connect")
|
i += 1
|
||||||
|
log("FLH: Retry "+str(i),3)
|
||||||
self.flash_current_byte = 0
|
a = self.tcp.available()
|
||||||
end
|
|
||||||
|
|
||||||
def write_chunk(b_start)
|
|
||||||
var chunk = self.tftd.next_chunk(b_start)
|
|
||||||
#import string
|
|
||||||
#print(string.format("Sending Byte %d - %d with size of %d", b_start, b_start+4095, chunk.size()))
|
|
||||||
self.ser.write(chunk)
|
|
||||||
return chunk.size()
|
|
||||||
end
|
|
||||||
|
|
||||||
def flash_nextion()
|
|
||||||
import string
|
|
||||||
var x = self.write_chunk(self.flash_current_byte)
|
|
||||||
self.flash_current_byte = self.flash_current_byte + x
|
|
||||||
var progress_percentage = (self.flash_current_byte*100/self.flash_size)
|
|
||||||
if (self.progress_percentage_last!=progress_percentage)
|
|
||||||
print(string.format("Flashing Progress ( %d / %d ) [ %d ]", self.flash_current_byte, self.flash_size, progress_percentage))
|
|
||||||
self.progress_percentage_last = progress_percentage
|
|
||||||
tasmota.publish_result(string.format("{\"Flashing\":{\"complete\": %d}}",progress_percentage), "RESULT")
|
|
||||||
end
|
end
|
||||||
if (self.flash_current_byte==self.flash_size)
|
if a==0
|
||||||
log("NSP: Flashing complete")
|
log("FLH: Nothing available to read!",3)
|
||||||
self.flash_mode = 0
|
return
|
||||||
end
|
end
|
||||||
tasmota.yield()
|
var b = self.tcp.readbytes()
|
||||||
end
|
i = 0
|
||||||
|
var end_headers = false;
|
||||||
def every_100ms()
|
var headers
|
||||||
import string
|
while i<size(b) && headers==nil
|
||||||
if self.ser.available() > 0
|
if b[i..(i+3)]==bytes().fromstring("\r\n\r\n")
|
||||||
var msg = self.ser.read()
|
headers = b[0..(i+3)].asstring()
|
||||||
if size(msg) > 0
|
self.flash_buff = b[(i+4)..]
|
||||||
print("NSP: Received Raw =", msg)
|
else
|
||||||
if self.flash_mode==1
|
i += 1
|
||||||
var str = msg[0..-4].asstring()
|
|
||||||
log(str, 3)
|
|
||||||
# TODO: add check for firmware versions < 126 and send proto 1.1 command for thoose
|
|
||||||
if (string.find(str,"comok 2")==0)
|
|
||||||
if self.flash_version==1
|
|
||||||
log("NSP: Flashing 1.1")
|
|
||||||
self.sendnx(string.format("whmi-wri %d,115200,1",self.flash_size)) # Nextion Upload Protocol 1.1
|
|
||||||
else
|
|
||||||
log("NSP: Flashing 1.2")
|
|
||||||
self.sendnx(string.format("whmi-wris %d,115200,1",self.flash_size)) # Nextion Upload Protocol 1.2
|
|
||||||
end
|
|
||||||
|
|
||||||
# skip to byte (upload protocol 1.2)
|
|
||||||
elif (size(msg)==1 && msg[0]==0x08)
|
|
||||||
self.flash_skip = true
|
|
||||||
print("rec 0x08")
|
|
||||||
elif (size(msg)==4 && self.flash_skip)
|
|
||||||
var skip_to_byte = msg[0..4].get(0,4)
|
|
||||||
if(skip_to_byte == 0)
|
|
||||||
print("don't skip, offset is 0")
|
|
||||||
else
|
|
||||||
print("skip to ", skip_to_byte)
|
|
||||||
self.flash_current_byte = skip_to_byte
|
|
||||||
end
|
|
||||||
self.flash_nextion()
|
|
||||||
# send next 4096 bytes (proto 1.1/1.2)
|
|
||||||
elif (size(msg)==1 && msg[0]==0x05)
|
|
||||||
print("rec 0x05")
|
|
||||||
self.flash_nextion()
|
|
||||||
end
|
|
||||||
else
|
|
||||||
# Recive messages using custom protocol 55 BB [payload length] [payload length] [payload] [crc] [crc]
|
|
||||||
if msg[0..1] == self.header
|
|
||||||
var lst = self.split_55(msg)
|
|
||||||
for i:0..size(lst)-1
|
|
||||||
msg = lst[i]
|
|
||||||
#var j = msg[2]+2
|
|
||||||
var j = size(msg) - 3
|
|
||||||
msg = msg[4..j]
|
|
||||||
if size(msg) > 2
|
|
||||||
var jm = string.format("{\"CustomRecv\":\"%s\"}",msg.asstring())
|
|
||||||
tasmota.publish_result(jm, "RESULT")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
elif msg == bytes('000000FFFFFF88FFFFFF')
|
|
||||||
log("NSP: Screen Initialized")
|
|
||||||
else
|
|
||||||
var jm = string.format("{\"nextion\":\"%s\"}",str(msg[0..-4]))
|
|
||||||
tasmota.publish_result(jm, "RESULT")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
#print(headers)
|
||||||
|
# check http respose for code 200
|
||||||
|
var tag = "200 OK"
|
||||||
|
i = string.find(headers,tag)
|
||||||
|
if (i>0)
|
||||||
|
log("FLH: HTTP Respose is 200 OK",3)
|
||||||
|
else
|
||||||
|
log("FLH: HTTP Respose is not 200 OK",3)
|
||||||
|
print(headers)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
# check http respose for content-length
|
||||||
|
tag = "Content-Length: "
|
||||||
|
i = string.find(headers,tag)
|
||||||
|
if (i>0)
|
||||||
|
var i2 = string.find(headers,"\r\n",i)
|
||||||
|
var s = headers[i+size(tag)..i2-1]
|
||||||
|
self.flash_size=int(s)
|
||||||
|
end
|
||||||
|
if self.flash_size==0
|
||||||
|
log("FLH: No size header, counting ...",3)
|
||||||
|
self.flash_size = size(self.flash_buff)
|
||||||
|
#print("counting start ...")
|
||||||
|
while self.tcp.connected()
|
||||||
|
while self.tcp.available()>0
|
||||||
|
self.flash_size += size(self.tcp.readbytes())
|
||||||
|
end
|
||||||
|
tasmota.delay(50)
|
||||||
|
end
|
||||||
|
#print("counting end ...",self.flash_size)
|
||||||
|
self.tcp.close()
|
||||||
|
self.open_url(url)
|
||||||
|
else
|
||||||
|
log("FLH: Size found in header, skip count",3)
|
||||||
|
end
|
||||||
|
log("FLH: Flash file size: "+str(self.flash_size),3)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def flash_nextion(url)
|
||||||
|
|
||||||
|
self.flash_size = 0
|
||||||
|
self.open_url(url)
|
||||||
|
self.begin_nextion_flash()
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
def version_number(str)
|
||||||
|
import string
|
||||||
|
var i1 = string.find(str,".",0)
|
||||||
|
var i2 = string.find(str,".",i1+1)
|
||||||
|
var num = int(str[0..i1-1])*10000+int(str[i1+1..i2-1])*100+int(str[i2+1..])
|
||||||
|
return num
|
||||||
|
end
|
||||||
|
|
||||||
|
def init()
|
||||||
|
log("NXP: Initializing Driver")
|
||||||
|
self.ser = serial(17, 16, 115200, serial.SERIAL_8N1)
|
||||||
|
self.flash_mode = 0
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
var nextion = Nextion()
|
||||||
|
|
||||||
|
tasmota.add_driver(nextion)
|
||||||
|
|
||||||
def get_current_version(cmd, idx, payload, payload_json)
|
def get_current_version(cmd, idx, payload, payload_json)
|
||||||
import string
|
import string
|
||||||
var version_of_this_script = 2
|
var version_of_this_script = 3
|
||||||
var jm = string.format("{\"nlui_driver_version\":\"%s\"}", version_of_this_script)
|
var jm = string.format("{\"nlui_driver_version\":\"%s\"}", version_of_this_script)
|
||||||
tasmota.publish_result(jm, "RESULT")
|
tasmota.publish_result(jm, "RESULT")
|
||||||
end
|
end
|
||||||
@@ -352,7 +347,7 @@ def update_berry_driver(cmd, idx, payload, payload_json)
|
|||||||
if r < 0
|
if r < 0
|
||||||
print("Error while writeing nspanel-lovelace-ui berry driver")
|
print("Error while writeing nspanel-lovelace-ui berry driver")
|
||||||
else
|
else
|
||||||
print("Scucessfully written nspanel-lovelace-ui berry driver")
|
print("Sucessfully written nspanel-lovelace-ui berry driver")
|
||||||
var s = load('autoexec.be')
|
var s = load('autoexec.be')
|
||||||
if s == true
|
if s == true
|
||||||
var jm = string.format("{\"nlui_driver_update\":\"%s\"}", "succeeded")
|
var jm = string.format("{\"nlui_driver_update\":\"%s\"}", "succeeded")
|
||||||
@@ -370,40 +365,24 @@ end
|
|||||||
|
|
||||||
tasmota.add_cmd('UpdateDriverVersion', update_berry_driver)
|
tasmota.add_cmd('UpdateDriverVersion', update_berry_driver)
|
||||||
|
|
||||||
var nextion = Nextion()
|
|
||||||
|
|
||||||
def flash_nextion(cmd, idx, payload, payload_json)
|
def flash_nextion(cmd, idx, payload, payload_json)
|
||||||
def task()
|
def task()
|
||||||
nextion.flash_version = 1
|
nextion.flash_nextion(payload)
|
||||||
nextion.start_flash(payload)
|
|
||||||
end
|
end
|
||||||
tasmota.set_timer(0,task)
|
tasmota.set_timer(0,task)
|
||||||
tasmota.resp_cmnd_done()
|
tasmota.resp_cmnd_done()
|
||||||
end
|
end
|
||||||
|
|
||||||
tasmota.add_cmd('FlashNextion', flash_nextion)
|
|
||||||
|
|
||||||
def flash_nextion_1_2(cmd, idx, payload, payload_json)
|
|
||||||
def task()
|
|
||||||
nextion.flash_version = 2
|
|
||||||
nextion.start_flash(payload)
|
|
||||||
end
|
|
||||||
tasmota.set_timer(0,task)
|
|
||||||
tasmota.resp_cmnd_done()
|
|
||||||
end
|
|
||||||
|
|
||||||
tasmota.add_cmd('FlashNextionFast', flash_nextion_1_2)
|
|
||||||
|
|
||||||
def send_cmd(cmd, idx, payload, payload_json)
|
def send_cmd(cmd, idx, payload, payload_json)
|
||||||
nextion.sendnx(payload)
|
nextion.sendnx(payload)
|
||||||
tasmota.resp_cmnd_done()
|
tasmota.resp_cmnd_done()
|
||||||
end
|
end
|
||||||
|
|
||||||
tasmota.add_cmd('Nextion', send_cmd)
|
|
||||||
|
|
||||||
def send_cmd2(cmd, idx, payload, payload_json)
|
def send_cmd2(cmd, idx, payload, payload_json)
|
||||||
nextion.send(payload)
|
nextion.send(payload)
|
||||||
tasmota.resp_cmnd_done()
|
tasmota.resp_cmnd_done()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
tasmota.add_cmd('Nextion', send_cmd)
|
||||||
tasmota.add_cmd('CustomSend', send_cmd2)
|
tasmota.add_cmd('CustomSend', send_cmd2)
|
||||||
|
tasmota.add_cmd('FlashNextion', flash_nextion)
|
||||||
|
|||||||
Reference in New Issue
Block a user