MCPcopy Index your code
hub / github.com/FrameworkComputer/inputmodule-rs / run_gui

Function run_gui

python/inputmodule/gui/__init__.py:52–277  ·  view source on GitHub ↗
(devices)

Source from the content-addressed store, hash-verified

50
51
52def run_gui(devices):
53 device_checkboxes = []
54 for dev in devices:
55 version = get_version(dev)
56 device_info = (
57 f"{dev.name}\nSerial No: {dev.serial_number}\nFW Version:{version}"
58 )
59 checkbox = sg.Checkbox(
60 device_info, default=True, key=f"-CHECKBOX-{dev.name}-", enable_events=True
61 )
62 device_checkboxes.append([checkbox])
63
64 layout = (
65 [
66 [sg.Text("Detected Devices")],
67 ]
68 + device_checkboxes
69 + [
70 [sg.HorizontalSeparator()],
71 [sg.Text("Device Control")],
72 [sg.Button("Bootloader"), sg.Button("Sleep"), sg.Button("Wake")],
73 [sg.HorizontalSeparator()],
74 [sg.Text("Brightness")],
75 # TODO: Get default from device
76 [
77 sg.Slider(
78 (0, 255),
79 orientation="h",
80 default_value=120,
81 k="-BRIGHTNESS-",
82 enable_events=True,
83 )
84 ],
85 [sg.HorizontalSeparator()],
86 [sg.Text("Animation")],
87 [sg.Button("Start Animation"), sg.Button("Stop Animation")],
88 [sg.HorizontalSeparator()],
89 [sg.Text("Pattern")],
90 [sg.Combo(PATTERNS, k="-PATTERN-", enable_events=True)],
91 [sg.HorizontalSeparator()],
92 [sg.Text("Fill screen X% (could be volume indicator)")],
93 [
94 sg.Slider(
95 (0, 100), orientation="h", k="-PERCENTAGE-", enable_events=True
96 )
97 ],
98 [sg.HorizontalSeparator()],
99 [sg.Text("Countdown Timer")],
100 [
101 sg.Spin([i for i in range(1, 60)],
102 initial_value=10, k="-COUNTDOWN-"),
103 sg.Text("Seconds"),
104 sg.Button("Start", k="-START-COUNTDOWN-"),
105 sg.Button("Stop", k="-STOP-COUNTDOWN-"),
106 ],
107 [sg.HorizontalSeparator()],
108 [
109 sg.Column(

Callers

nothing calls this directly

Calls 15

get_versionFunction · 0.90
is_dev_disconnectedFunction · 0.90
snakeFunction · 0.90
stop_threadFunction · 0.90
bootloaderFunction · 0.90
patternFunction · 0.90
pwm_freqFunction · 0.90
animateFunction · 0.90
brightnessFunction · 0.90
percentageFunction · 0.90
image_blFunction · 0.90
image_greyscaleFunction · 0.90

Tested by

no test coverage detected