-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathexample1.py
35 lines (26 loc) · 964 Bytes
/
example1.py
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
27
28
29
30
31
32
33
34
35
"""Example 1
Create ./example1.bob with 3 widgets
"""
import phoebusgen
pv_prefix = 'loc://example1'
my_screen = phoebusgen.screen.Screen('Phoebusgen Example 1')
my_screen.macro('PV_PREFIX', pv_prefix)
my_screen.background_color(204, 255, 255)
widgets = []
# don't worry about width and height, we will use auto-size after setting font size
title = phoebusgen.widget.Label('TitleLabel', 'Example 1 Phoebusgen Title', 0, 0, 0, 0)
title.font_size(36)
title.auto_size()
widgets.append(title)
pv_name = pv_prefix + ':BOOL<VEnum>(0, "OFF", "ON")'
check_box = phoebusgen.widget.CheckBox('MyCheckBox', 'Boolean PV', pv_name, 0, 80, 190, 70)
check_box.font_style_bold()
check_box.font_size(24)
widgets.append(check_box)
led = phoebusgen.widget.LED('MyLED', pv_name, 230, 60, 140, 110)
led.off_color(255, 0, 0)
widgets.append(led)
# add all widgets to our screen
my_screen.add_widget(widgets)
# write to specified file
my_screen.write_screen('./example1.bob')