@@ -50,7 +50,8 @@ def init(config=Config.FLIGHT):
5050 manager .DataType ('temperature' , float , units = 'deg C' , thresholds = (- 20 , 80 )),
5151 manager .DataType ('gps_vel' , float , units = 'xy m/s' , thresholds = (- 20 , 100 )),
5252 manager .DataType ('gps_dir' , float , units = 'xy deg' , thresholds = (- 20 , 365 )),
53- manager .DataType ('xy_from_lanch' , float , units = 'xy m' , thresholds = (- 20 , 100000 )),
53+ manager .DataType ('x_from_launch' , float , units = 'm' , thresholds = (- 100000 , 100000 )),
54+ manager .DataType ('y_from_launch' , float , units = 'm' , thresholds = (- 100000 , 100000 )),
5455 manager .DataType ('dir_from_launch' , float , units = 'xy deg' , thresholds = (- 20 , 365 )),
5556 manager .DataType ('P1_setting' , bool ),
5657 manager .DataType ('P2_setting' , bool ),
@@ -65,14 +66,10 @@ def init(config=Config.FLIGHT):
6566 manager .DataType ('launch_lon' , float ),
6667 manager .DataType ('land_lat' , float ),
6768 manager .DataType ('land_lon' , float ),
68- manager .DataType ('gps_n' , float , units = "m" ),
69- manager .DataType ('gps_e' , float , units = "m" ),
7069
71- manager .DataType ('up' , bool ),
72- manager .DataType ('down' , bool ),
7370 manager .DataType ('gps_d' , bool ),
7471 manager .DataType ('bmp_d' , bool ),
75- manager .DataType ('bmp_d2' , bool ),
72+ # manager.DataType('bmp_d2', bool),
7673 manager .DataType ('bno_d' , bool ),
7774
7875 manager .DataType ('run_time' , int , units = "ms" ),
@@ -93,6 +90,7 @@ def init(config=Config.FLIGHT):
9390 dispatcher = manager .Dispatcher (* dts )
9491 data_manager = manager .DataManager (dispatcher )
9592 root = Tk ()
93+ < << << << HEAD
9694 root .configure (background = '#69615e' )
9795 app = gui .Application (
9896 dispatcher , data_manager , plots , master = root ,
@@ -106,8 +104,20 @@ def init(config=Config.FLIGHT):
106104 plots_background = '#69615e' ,
107105 controls_background = '#69615e' ,
108106 default_baud = 57600 )
107+ == == == =
108+ app = gui .Application (dispatcher , data_manager , plots , master = root ,
109+ window_manager_title =
110+ "Telemetry monitor - Demo" if config == Config .DEMO else
111+ "Telemetry monitor - Flight" if config == Config .FLIGHT else
112+ "Telemetry monitor" ,
113+ show_send_value = False ,
114+ serial_console_height = 5 ,
115+ plots_size = (10 ,10 ),
116+ default_baud = 57600 )
117+ >> >> >> > parent of b41a304 ... bg colors and positioning
109118
110119 running = False
120+
111121 def heartbeat ():
112122 if running : #get link2ground status all the time, exept if I delete this line, the start/abort button doesn't work right for some reason
113123 app .sendValue ("c" ) #c stands for connection, i.e. heartbeat
@@ -128,29 +138,36 @@ def check_stop(time, status):
128138 nonlocal running
129139 if status == 'STAND_BY' : #was 'STAND_BY'
130140 #status.config(bg='#0fe9f5')
131- app .stop ()
141+ app .stop () #app.stop()
132142 running = False
133143 if config == Config .DEMO :
134144 countdown .config (text = " T-00:10:00" )
135145 else :
136146 countdown .config (text = " T-01:00:00" )
137147 start_abort_button .config (text = "Start" , bg = 'lime green' )
138148 elif status == 'TERMINAL_COUNT' :
149+ running = True
150+ app .start ()
139151 status .config (bg = '#e6d925' )
152+ start_abort_button .config (text = "Abort" , bg = 'red' )
140153 elif status == 'POWERED_ASCENT' :
141154 status .config (bg = '#e04122' )
142-
155+ start_abort_button . config ( text = "Abort" , bg = 'red' )
143156 elif status == 'UNPOWERED_ASCENT' :
144157 status .config (bg = '#bd857b' )
158+ start_abort_button .config (text = "Abort" , bg = 'red' )
145159 elif status == 'FREEFALL' :
146160 status .config (bg = '#760e99' )
161+ start_abort_button .config (text = "Abort" , bg = 'red' )
147162 elif status == 'DROGUE_DESCENT' :
148163 status .config (bg = '#8b65ba' )
164+ start_abort_button .config (text = "Abort" , bg = 'red' )
149165 elif status == 'MAIN_DESCENT' :
150166 status .config (bg = '#402aa1' )
151-
167+ start_abort_button . config ( text = "Abort" , bg = 'red' )
152168 elif status == 'LANDED' :
153169 status .config (bg = '#4395d9' )
170+ start_abort_button .config (text = "Abort" , bg = 'red' )
154171 else :
155172 start_abort_button .config (text = "Abort" , bg = 'red' )
156173
@@ -169,13 +186,22 @@ def state_name(name):
169186 return lower_name .replace ("_" , " " )
170187
171188 # Add custom gui controls
189+ < << << << HEAD
172190 Label (app , text = "\n Controls" , bg = '#69615e' ).pack (side = TOP )
191+ == == == =
192+ Label (app , text = "\n Controls" ).pack ()
193+ >> >> >> > parent of b41a304 ... bg colors and positioning
173194
174195 # Sensor controls
175196 #Label(app, text="\nSensor Controls").pack()
176197 controlsFrame = Frame (app , bg = '#69615e' )
198+ < << << << HEAD
177199 controlsFrame .pack (side = TOP ) #expand=1
178200 sensorStatus = Label (controlsFrame , text = "All sensors functional" , fg = 'green' , font = ("Helvetica" , 12 ), bg = '#c9c1be' ) #light grey c9c1be
201+ == == == =
202+ controlsFrame .pack () #expand=1
203+ sensorStatus = Label (controlsFrame , text = "All sensors functional" , fg = 'green' , font = ("Helvetica" , 17 ))
204+ >> >> >> > parent of b41a304 ... bg colors and positioning
179205 sensorStatus .grid (row = 0 ,column = 0 ,columnspan = 4 )
180206 #Button(controlsFrame, text="Zero force", command=lambda: app.sendValue("zero_force")).pack(side=LEFT)
181207 #Button(controlsFrame, text="Zero pressure", command=lambda: app.sendValue("zero_pressure")).pack(side=LEFT)
@@ -236,12 +262,21 @@ def state_name(name):
236262 #Label(app, text="\nThrottle Controls").pack()
237263 throttleFrame = Frame (app , bg = '#69615e' ) #bg or background works
238264 throttleFrame .pack ()
265+ < << << << HEAD
239266 Label (throttleFrame , text = "Drogue" , font = ("Helvetica" , 10 ), bg = '#69615e' ).grid (row = 0 , column = 1 , sticky = W )
240267 Label (throttleFrame , text = "Main" , font = ("Helvetica" , 10 ), bg = '#69615e' ).grid (row = 0 , column = 2 , padx = 15 , sticky = W )
241268 Label (throttleFrame , text = "1" , font = ("Helvetica" , 10 ), bg = '#69615e' ).grid (row = 1 , column = 0 , sticky = W , padx = 5 )
242269 Label (throttleFrame , text = "2" , font = ("Helvetica" , 10 ), bg = '#69615e' ).grid (row = 2 , column = 0 , sticky = W , padx = 5 )
243270 Label (throttleFrame , text = "Cam" , font = ("Helvetica" , 10 ), bg = '#69615e' ).grid (row = 3 , column = 0 , sticky = W , padx = 5 )
244- Button (throttleFrame , text = "Reset board" , font = ("Helvetica" , 8 ), command = lambda : app .sendValue ("reset" )).grid (row = 3 , column = 2 , sticky = W , padx = 5 )
271+ Button (throttleFrame , text = "Reset board" , font = ("Helvetica" , 8 ), command = lambda : app .sendValue ("r" )).grid (row = 3 , column = 2 , sticky = W , padx = 5 )
272+ == == == =
273+ Label (throttleFrame , text = "Drouge" , font = ("Helvetica" , 15 )).grid (row = 0 , column = 1 )
274+ Label (throttleFrame , text = "Main" , font = ("Helvetica" , 15 )).grid (row = 0 , column = 2 , padx = 15 )
275+ Label (throttleFrame , text = "1" , font = ("Helvetica" , 15 )).grid (row = 1 , column = 0 , sticky = W , padx = 5 )
276+ Label (throttleFrame , text = "2" , font = ("Helvetica" , 15 )).grid (row = 2 , column = 0 , sticky = W , padx = 5 )
277+ Label (throttleFrame , text = "Cam" , font = ("Helvetica" , 15 )).grid (row = 3 , column = 0 , sticky = W , padx = 5 )
278+ Button (throttleFrame , text = "Reset board" , command = lambda : app .sendValue ("reset" )).grid (row = 3 , column = 2 , sticky = W , padx = 5 )
279+ >> >> >> > parent of b41a304 ... bg colors and positioning
245280
246281
247282 valves = ['P1' , 'P2' , 'P3' , 'P4' , 'P5' ] #indexing starts at 0
@@ -259,11 +294,18 @@ def state_name(name):
259294 runFrame .pack (side = TOP )
260295 start_abort_button = Button (runFrame , text = "Start" , command = start_abort_handler , bg = "lime green" , height = 2 , width = 8 )
261296 start_abort_button .pack (side = LEFT )
297+ < << << << HEAD
262298 countdown = Label (runFrame , text = " T-01:00:00" , width = 10 , fg = "red" , font = ("Helvetica" , 16 , "bold" ), bg = '#c9c1be' ) #b9b1ae
263299 countdown .pack (side = TOP )
264300
265301 status = Label (runFrame , text = " Stand by" , width = 16 , font = ("Helvetica" , 10 ), bg = '#c9c1be' )
266302 status .pack (side = TOP )
303+ == == == =
304+ countdown = Label (runFrame , text = " T-01:00:00" , fg = "red" , font = ("Helvetica" , 20 , "bold" ))
305+ countdown .pack ()
306+ status = Label (runFrame , text = " Stand by" , width = 15 , font = ("Helvetica" , 17 ))
307+ status .pack ()
308+ >> >> >> > parent of b41a304 ... bg colors and positioning
267309
268310 # Listeners
269311 app .dispatcher .add_listener ('status' , lambda time , val : status .config (text = " " + state_name (val )))
0 commit comments