Skip to content

Commit 896f8c7

Browse files
committed
Add page canvas
Experimental
1 parent 447b3ec commit 896f8c7

File tree

7 files changed

+244
-1
lines changed

7 files changed

+244
-1
lines changed

components/nspanel_easy/pages.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ constexpr const char *const page_names[] = {
2626
"climate", "settings", "screensaver", "light", "cover", "buttonpage01", "buttonpage02",
2727
"buttonpage03", "buttonpage04", "notification", "qrcode", "entitypage01", "entitypage02", "entitypage03",
2828
"entitypage04", "fan", "alarm", "keyb_num", "media_player", "confirm", "utilities",
29-
"home_smpl", "debug", "water_heater", "theme_apply", "switch", "button"};
29+
"home_smpl", "debug", "water_heater", "theme_apply", "switch", "button", "canvas"};
3030

3131
constexpr size_t PAGE_COUNT = sizeof(page_names) / sizeof(page_names[0]);
3232
static_assert(PAGE_COUNT <= UINT8_MAX, "PAGE_COUNT exceeds uint8_t range");
@@ -98,6 +98,7 @@ static_assert(get_page_id("buttonpage01") != UINT8_MAX, "Missing required page:
9898
static_assert(get_page_id("buttonpage02") != UINT8_MAX, "Missing required page: buttonpage02");
9999
static_assert(get_page_id("buttonpage03") != UINT8_MAX, "Missing required page: buttonpage03");
100100
static_assert(get_page_id("buttonpage04") != UINT8_MAX, "Missing required page: buttonpage04");
101+
static_assert(get_page_id("canvas") != UINT8_MAX, "Missing required page: canvas");
101102
static_assert(get_page_id("climate") != UINT8_MAX, "Missing required page: climate");
102103
static_assert(get_page_id("confirm") != UINT8_MAX, "Missing required page: confirm");
103104
static_assert(get_page_id("cover") != UINT8_MAX, "Missing required page: cover");
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
Page canvas
2+
Attributes
3+
ID : 0
4+
Scope : local
5+
Dragging : 0
6+
Send Component ID : on press and release
7+
Opacity : 127
8+
Width : 480
9+
Effect : load
10+
Effect Priority : 0
11+
Effect Time : 300
12+
Locked : no
13+
Swide up page ID : disabled
14+
Swide down page ID : disabled
15+
Swide left page ID : disabled
16+
Swide right page ID: disabled
17+
Fill : picture
18+
Back. Picture ID : 0
19+
20+
Events
21+
Preinitialize Event
22+
if(api==0)
23+
{
24+
page home_page_id
25+
}
26+
// set background image and fg color to all components
27+
canvas.pic=pic_background_main
28+
icon_state.picc=pic_background_main
29+
page_label.picc=pic_background_main
30+
button_back.font=button_back_font
31+
button_back.pco=color_pco_navigation
32+
button_back.picc2=pic_background_main
33+
dim=brightness
34+
sendme
35+
36+
Text page_label
37+
Attributes
38+
ID : 1
39+
Scope : local
40+
Dragging : 0
41+
Send Component ID : on press and release
42+
Opacity : 127
43+
x coordinate : 48
44+
y coordinate : 8
45+
Width : 300
46+
Height : 30
47+
Effect : load
48+
Effect Priority : 0
49+
Effect Time : 300
50+
Fill : crop image
51+
Associated Keyboard : none
52+
Font ID : 2
53+
Cropped Back. Picture ID: 0
54+
Horizontal Alignment : left
55+
Vertical Alignment : center
56+
Input Type : character
57+
Text :
58+
Max. Text Size : 100
59+
Word wrap : disabled
60+
Horizontal Spacing : 0
61+
Vertical Spacing : 0
62+
63+
Text icon_state
64+
Attributes
65+
ID : 2
66+
Scope : local
67+
Dragging : 0
68+
Send Component ID : on press and release
69+
Opacity : 127
70+
x coordinate : 12
71+
y coordinate : 8
72+
Width : 35
73+
Height : 35
74+
Effect : load
75+
Effect Priority : 0
76+
Effect Time : 300
77+
Fill : crop image
78+
Associated Keyboard : none
79+
Font ID : 8
80+
Cropped Back. Picture ID: 0
81+
Horizontal Alignment : center
82+
Vertical Alignment : center
83+
Input Type : character
84+
Text :
85+
Max. Text Size : 10
86+
Word wrap : disabled
87+
Horizontal Spacing : 0
88+
Vertical Spacing : 0
89+
90+
Button button_back
91+
Attributes
92+
ID : 3
93+
Scope : local
94+
Dragging : 0
95+
Send Component ID : on press and release
96+
Opacity : 127
97+
x coordinate : 385
98+
y coordinate : 0
99+
Width : 95
100+
Height : 48
101+
Effect : load
102+
Effect Priority : 0
103+
Effect Time : 300
104+
Fill : crop image
105+
Font ID : 8
106+
Cropped Back. Picture ID (Unpressed): 0
107+
Back. Picture ID (Pressed) : 65535
108+
Cropped Back. Picture ID (Pressed) : 0
109+
Horizontal Alignment : center
110+
Vertical Alignment : top
111+
State : unpressed
112+
Text : \xee\x85\x98
113+
Max. Text Size : 3
114+
Word wrap : disabled
115+
Horizontal Spacing : 0
116+
Vertical Spacing : 0
117+
118+
Events
119+
Touch Press Event
120+
page back_page_id
121+
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
Page canvas
2+
Attributes
3+
ID : 0
4+
Scope : local
5+
Dragging : 0
6+
Send Component ID : on press and release
7+
Opacity : 127
8+
Width : 320
9+
Effect : load
10+
Effect Priority : 0
11+
Effect Time : 300
12+
Locked : no
13+
Swide up page ID : disabled
14+
Swide down page ID : disabled
15+
Swide left page ID : disabled
16+
Swide right page ID: disabled
17+
Fill : picture
18+
Back. Picture ID : 0
19+
20+
Events
21+
Preinitialize Event
22+
if(api==0)
23+
{
24+
page home_page_id
25+
}
26+
// set background image and fg color to all components
27+
canvas.pic=pic_background_main
28+
icon_state.picc=pic_background_main
29+
page_label.picc=pic_background_main
30+
button_back.font=button_back_font
31+
button_back.pco=color_pco_navigation
32+
button_back.picc2=pic_background_main
33+
dim=brightness
34+
sendme
35+
36+
Text page_label
37+
Attributes
38+
ID : 1
39+
Scope : local
40+
Dragging : 0
41+
Send Component ID : on press and release
42+
Opacity : 127
43+
x coordinate : 46
44+
y coordinate : 8
45+
Width : 204
46+
Height : 30
47+
Effect : load
48+
Effect Priority : 0
49+
Effect Time : 300
50+
Fill : crop image
51+
Associated Keyboard : none
52+
Font ID : 2
53+
Cropped Back. Picture ID: 0
54+
Horizontal Alignment : left
55+
Vertical Alignment : center
56+
Input Type : character
57+
Text :
58+
Max. Text Size : 100
59+
Word wrap : disabled
60+
Horizontal Spacing : 0
61+
Vertical Spacing : 0
62+
63+
Text icon_state
64+
Attributes
65+
ID : 2
66+
Scope : local
67+
Dragging : 0
68+
Send Component ID : on press and release
69+
Opacity : 127
70+
x coordinate : 10
71+
y coordinate : 8
72+
Width : 35
73+
Height : 35
74+
Effect : load
75+
Effect Priority : 0
76+
Effect Time : 300
77+
Fill : crop image
78+
Associated Keyboard : none
79+
Font ID : 8
80+
Cropped Back. Picture ID: 0
81+
Horizontal Alignment : center
82+
Vertical Alignment : center
83+
Input Type : character
84+
Text :
85+
Max. Text Size : 10
86+
Word wrap : disabled
87+
Horizontal Spacing : 0
88+
Vertical Spacing : 0
89+
90+
Button button_back
91+
Attributes
92+
ID : 3
93+
Scope : local
94+
Dragging : 0
95+
Send Component ID : on press and release
96+
Opacity : 127
97+
x coordinate : 260
98+
y coordinate : 0
99+
Width : 60
100+
Height : 48
101+
Effect : load
102+
Effect Priority : 0
103+
Effect Time : 300
104+
Fill : crop image
105+
Font ID : 8
106+
Cropped Back. Picture ID (Unpressed): 0
107+
Back. Picture ID (Pressed) : 65535
108+
Cropped Back. Picture ID (Pressed) : 0
109+
Horizontal Alignment : center
110+
Vertical Alignment : top
111+
State : unpressed
112+
Text : \xee\x85\x98
113+
Max. Text Size : 3
114+
Word wrap : disabled
115+
Horizontal Spacing : 0
116+
Vertical Spacing : 0
117+
118+
Events
119+
Touch Press Event
120+
page back_page_id
121+

hmi/nspanel_landscape.hmi

0 Bytes
Binary file not shown.

hmi/nspanel_landscape.tft

5.57 KB
Binary file not shown.

hmi/nspanel_portrait.hmi

0 Bytes
Binary file not shown.

hmi/nspanel_portrait.tft

5.57 KB
Binary file not shown.

0 commit comments

Comments
 (0)