Skip to content

Commit

Permalink
[python] Nederdrone Status Window: CAN Esc Status and Fuel-cell status (
Browse files Browse the repository at this point in the history
  • Loading branch information
dewagter committed May 20, 2021
1 parent bb6740d commit 030c5e7
Show file tree
Hide file tree
Showing 13 changed files with 603 additions and 16 deletions.
2 changes: 2 additions & 0 deletions conf/tools/nederdrone_status.xml
@@ -0,0 +1,2 @@
<program command="sw/ground_segment/python/fuelcell/fuel_cell.py" name="NederdroneStatus" />

2 changes: 1 addition & 1 deletion sw/ground_segment/python/atc/atc.py
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
#
# Copyright (C) 2016 TUDelft
#
Expand Down
4 changes: 2 additions & 2 deletions sw/ground_segment/python/atc/atc_frame.py
Expand Up @@ -24,7 +24,7 @@
import threading
import math
import array
from cStringIO import StringIO
from io import StringIO

PPRZ_HOME = os.getenv("PAPARAZZI_HOME", os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(__file__)),
'../../../..')))
Expand Down Expand Up @@ -154,7 +154,7 @@ def __init__(self):
if self.cfg.Exists('left'):
self.x = int(self.cfg.Read('left'))
self.y = int(self.cfg.Read('top'))
self.SetPosition(wx.Point(self.x,self.y), wx.SIZE_USE_EXISTING)
self.SetPosition(wx.Point(self.x,self.y))

def OnClose(self, event):
self.interface.shutdown()
Expand Down
2 changes: 1 addition & 1 deletion sw/ground_segment/python/distance_counter/dist.py
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
#
# Copyright (C) 2016 TUDelft
#
Expand Down
Expand Up @@ -25,7 +25,7 @@
import threading
import socket
import array
from cStringIO import StringIO
from io import StringIO
import wx
import array
from PIL import Image
Expand Down
2 changes: 1 addition & 1 deletion sw/ground_segment/python/energy_mon/energy_mon.py
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
#
# Copyright (C) 2018 TUDelft
#
Expand Down
6 changes: 3 additions & 3 deletions sw/ground_segment/python/energy_mon/energy_mon_viewer.py
Expand Up @@ -291,7 +291,7 @@ def StatusBox(self, dc, nr, txt, percent, color):
spacing = boxh+10

dc.SetPen(wx.Pen(wx.Colour(0,0,0)))
dc.SetBrush(wx.Brush(wx.Colour(220,220,220)))
dc.SetBrush(wx.Brush(wx.Colour(220,220,220)))
dc.DrawRectangle(tdx, int(nr*spacing+tdx), int(boxw), boxh)
dc.SetTextForeground(wx.Colour(0, 0, 0))
if color < 0.2:
Expand All @@ -317,7 +317,7 @@ def plot(self, dc, i1, i2):
def DischargePlot(self, dc):
self.tdx = int(self.stat * 10.0 / 300.0)
dc.SetPen(wx.Pen(wx.Colour(0,0,0),1))
dc.SetBrush(wx.Brush(wx.Colour(250,250,250)))
dc.SetBrush(wx.Brush(wx.Colour(250,250,250)))
dc.DrawRectangle(self.plot_x(0.0), self.plot_y(1.0), self.w-self.stat-2*self.tdx, self.h-2*self.tdx)

for i in range(0,6):
Expand Down Expand Up @@ -427,7 +427,7 @@ def __init__(self):
if self.cfg.Exists('left'):
self.x = int(self.cfg.Read('left'))
self.y = int(self.cfg.Read('top'))
self.SetPosition(wx.Point(self.x,self.y), wx.SIZE_USE_EXISTING)
self.SetPosition(wx.Point(self.x,self.y))

self.Bind(wx.EVT_PAINT, self.OnPaint)
self.Bind(wx.EVT_SIZE, self.OnSize)
Expand Down
36 changes: 36 additions & 0 deletions sw/ground_segment/python/fuelcell/fuel_cell.py
@@ -0,0 +1,36 @@
#!/usr/bin/env python3
#
# Copyright (C) 2018 TUDelft
#
# This file is part of paparazzi.
#
# paparazzi is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# paparazzi is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with paparazzi. If not, see <http://www.gnu.org/licenses/>.
#

import wx
import fuel_cell_viewer

class FuelCellApp(wx.App):
def OnInit(self):
self.main = fuel_cell_viewer.FuelCellFrame()
self.main.Show()
self.SetTopWindow(self.main)
return True

def main():
application = FuelCellApp(0)
application.MainLoop()

if __name__ == '__main__':
main()

0 comments on commit 030c5e7

Please sign in to comment.