Skip to content

Commit b41a304

Browse files
committed
bg colors and positioning
made bg color more uniform, moved positions of plotting and side bar area... still needs more work, not sure how to precisely move the whole right side properly
1 parent 4a3c40a commit b41a304

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed

drivers/flight_gui.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def init(config=Config.FLIGHT):
100100
"Telemetry monitor",
101101
show_send_value=False,
102102
serial_console_height=5,
103-
plots_size=(10,10),
103+
plots_size=(11.5,10),
104104
default_baud=57600)
105105

106106
running = False
@@ -148,13 +148,13 @@ def state_name(name):
148148
return lower_name.replace("_", " ")
149149

150150
# Add custom gui controls
151-
Label(app, text="\nControls").pack()
151+
Label(app, text="\nControls", bg= '#69615e').pack()
152152

153153
# Sensor controls
154154
#Label(app, text="\nSensor Controls").pack()
155155
controlsFrame = Frame(app, bg= '#69615e')
156156
controlsFrame.pack() #expand=1
157-
sensorStatus = Label(controlsFrame, text="All sensors functional", fg='green', font=("Helvetica", 17))
157+
sensorStatus = Label(controlsFrame, text="All sensors functional", fg='green', font=("Helvetica", 17), bg= '#b9b1ae')
158158
sensorStatus.grid(row=0,column=0,columnspan=4)
159159
#Button(controlsFrame, text="Zero force", command=lambda: app.sendValue("zero_force")).pack(side=LEFT)
160160
#Button(controlsFrame, text="Zero pressure", command=lambda: app.sendValue("zero_pressure")).pack(side=LEFT)
@@ -215,11 +215,11 @@ def state_name(name):
215215
#Label(app, text="\nThrottle Controls").pack()
216216
throttleFrame = Frame(app, bg= '#69615e') #bg or background works
217217
throttleFrame.pack()
218-
Label(throttleFrame, text="Drouge", font=("Helvetica", 15)).grid(row=0, column=1)
219-
Label(throttleFrame, text="Main", font=("Helvetica", 15)).grid(row=0, column=2, padx=15)
220-
Label(throttleFrame, text="1", font=("Helvetica", 15)).grid(row=1, column=0, sticky=W, padx=5)
221-
Label(throttleFrame, text="2", font=("Helvetica", 15)).grid(row=2, column=0, sticky=W, padx=5)
222-
Label(throttleFrame, text="Cam", font=("Helvetica", 15)).grid(row=3, column=0, sticky=W, padx=5)
218+
Label(throttleFrame, text="Drouge", font=("Helvetica", 15), bg= '#69615e').grid(row=0, column=1)
219+
Label(throttleFrame, text="Main", font=("Helvetica", 15), bg= '#69615e').grid(row=0, column=2, padx=15)
220+
Label(throttleFrame, text="1", font=("Helvetica", 15), bg= '#69615e').grid(row=1, column=0, sticky=W, padx=5)
221+
Label(throttleFrame, text="2", font=("Helvetica", 15), bg= '#69615e').grid(row=2, column=0, sticky=W, padx=5)
222+
Label(throttleFrame, text="Cam", font=("Helvetica", 15), bg= '#69615e').grid(row=3, column=0, sticky=W, padx=5)
223223
Button(throttleFrame, text="Reset board", command=lambda: app.sendValue("reset")).grid(row=3, column=2, sticky=W, padx=5)
224224

225225

@@ -238,7 +238,7 @@ def state_name(name):
238238
runFrame.pack()
239239
start_abort_button = Button(runFrame, text="Start", command=start_abort_handler, bg="lime green", height=3, width=10)
240240
start_abort_button.pack(side=LEFT)
241-
countdown = Label(runFrame, text=" T-01:00:00", fg="red", font=("Helvetica", 20, "bold"))
241+
countdown = Label(runFrame, text=" T-01:00:00", fg="red", font=("Helvetica", 20, "bold"), bg= '#b9b1ae')
242242
countdown.pack()
243243
status = Label(runFrame, text=" Stand by", width=15, font=("Helvetica", 17))
244244
status.pack()

src/gui.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def __init__(self,
5050
'serial_console_height': 15,
5151
'default_baud': 9600,
5252
'plots_size': (12,10),
53-
'plots_background': 'white'}
53+
'plots_background': '#69615e'}
5454
new_flags.update(flags)
5555
self.flags = new_flags
5656

@@ -69,8 +69,8 @@ def __init__(self,
6969
self.flags['full_screen'] = args.full_screen
7070

7171
# Init gui
72-
Frame.__init__(self, master)
73-
self.pack()
72+
Frame.__init__(self, master, bg='#69615e') #set whole background color here!
73+
self.pack(side=LEFT) #side=LEFT
7474
#master.iconbitmap('telemetry.png')
7575
master.attributes("-fullscreen", self.flags['full_screen'])
7676
master.bind('<Escape>', self.unmaximize)
@@ -118,7 +118,7 @@ def _createWidgets(self):
118118
"""Initialize the various widgets in the main frame."""
119119
self._setupPlots()
120120

121-
buttons = Frame(self)
121+
buttons = Frame(self) #, bg='red' buttons cover everything tho
122122
self.controlButton = Button(buttons, text="Start", command=self.start, bg="lime green")
123123
self.controlButton.pack(side=LEFT)
124124

@@ -137,13 +137,13 @@ def _createWidgets(self):
137137
self.thresholdButton = Button(buttons, text="Set thresholds...", command=self.configureThresholds)
138138
self.thresholdButton.pack(side=LEFT)
139139

140-
buttons.pack()
141-
142-
serialLabel = Label(self, text="\nSerial console")
140+
buttons.pack() #side=RIGHT,fill=BOTH move to right
141+
#fill=BOTH, expand=50
142+
serialLabel = Label(self, text="\nSerial console", bg= '#69615e')
143143
serialLabel.pack()
144144

145145
serial = Frame(self, bg= '#69615e')
146-
serialControls = Frame(serial)
146+
serialControls = Frame(serial, bg= '#69615e')
147147

148148
self.serialPort = StringVar(self)
149149
self.serialSelect = OptionMenu(serialControls, self.serialPort, [])
@@ -205,7 +205,7 @@ def _createWidgets(self):
205205
sendValues.pack()
206206

207207
# Value readout widget
208-
valuesLabel = Label(self, text="\nCurrent values")
208+
valuesLabel = Label(self, text="\nCurrent values", bg= '#69615e')
209209
if self.flags['show_current_values']:
210210
valuesLabel.pack()
211211

src/plot.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def __init__(self,
3737
suffix = suffix.replace("_", " ")
3838
if " " in suffix:
3939
suffix = suffix[suffix.index(" "):]
40-
40+
4141
if ys_names:
4242
self.ys_names = ys_names
4343
elif suffix:
@@ -133,7 +133,7 @@ def fn(x_data, y_data, y=y):
133133
j += 1
134134
x_data = new_x_data
135135
y_data = new_y_data
136-
136+
137137
assert len(x_data) == len(y_data)
138138
# 'Prune' plotted data to avoid slow-down with large amounts of data
139139
indices = range(0, len(x_data), max(len(x_data) // max_points, 1))
@@ -167,7 +167,7 @@ def gen_layout(plots):
167167
available = {(i, j): True
168168
for i in range(width)
169169
for j in range(height)}
170-
170+
171171
# List of info for each plot
172172
layout = []
173173

0 commit comments

Comments
 (0)