bms-can-ui/BmsView.py
2020-02-19 19:24:40 -08:00

98 lines
3.6 KiB
Python

#!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
# generated by wxGlade 0.9.5 on Wed Feb 19 19:23:19 2020
#
import wx
import wx.grid
import wx.propgrid
# begin wxGlade: dependencies
import gettext
# end wxGlade
# begin wxGlade: extracode
# end wxGlade
class BmsMonitorFrame(wx.Frame):
def __init__(self, *args, **kwds):
# begin wxGlade: BmsMonitorFrame.__init__
kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_FRAME_STYLE
wx.Frame.__init__(self, *args, **kwds)
self.SetSize((798, 638))
self.choice_2 = wx.Choice(self, wx.ID_ANY, choices=[_("choice 1")])
self.choice_1 = wx.Choice(self, wx.ID_ANY, choices=[_("0x02"), _("0x03"), _("0x04"), _("0x05"), _("0x06"), _("0x07"), _("0x08"), _("0x09")])
self.property_grid_1 = wx.propgrid.PropertyGridManager(self, wx.ID_ANY, style=wx.propgrid.PG_DESCRIPTION | wx.propgrid.PG_TOOLBAR)
self.tree_ctrl_1 = wx.TreeCtrl(self, wx.ID_ANY, style=wx.TR_HAS_BUTTONS | wx.TR_HIDE_ROOT)
self.grid_1 = wx.grid.Grid(self, wx.ID_ANY, size=(1, 1))
self.__set_properties()
self.__do_layout()
# end wxGlade
def __set_properties(self):
# begin wxGlade: BmsMonitorFrame.__set_properties
self.SetTitle(_("frame"))
self.choice_2.SetSelection(0)
self.choice_1.SetSelection(0)
self.grid_1.CreateGrid(12, 3)
self.grid_1.SetColLabelValue(0, _("Voltage"))
self.grid_1.SetColLabelValue(1, _("Temperature"))
self.grid_1.SetColLabelValue(2, _("Balancing"))
self.grid_1.SetRowLabelValue(0, _("Cell 1"))
self.grid_1.SetRowLabelValue(1, _("Cell 2"))
self.grid_1.SetRowLabelValue(2, _("Cell 3"))
self.grid_1.SetRowLabelValue(3, _("Cell 4"))
self.grid_1.SetRowLabelValue(4, _("Cell 5"))
self.grid_1.SetRowLabelValue(5, _("Cell 6"))
self.grid_1.SetRowLabelValue(6, _("Cell 7"))
self.grid_1.SetRowLabelValue(7, _("Cell 8"))
self.grid_1.SetRowLabelValue(8, _("Cell 9"))
self.grid_1.SetRowLabelValue(9, _("Cell 10"))
self.grid_1.SetRowLabelValue(10, _("Cell 11"))
self.grid_1.SetRowLabelValue(11, _("Cell 12"))
# end wxGlade
def __do_layout(self):
# begin wxGlade: BmsMonitorFrame.__do_layout
sizer_1 = wx.BoxSizer(wx.HORIZONTAL)
sizer_4 = wx.BoxSizer(wx.VERTICAL)
sizer_3 = wx.BoxSizer(wx.VERTICAL)
sizer_2 = wx.BoxSizer(wx.HORIZONTAL)
label_1 = wx.StaticText(self, wx.ID_ANY, _("CAN Device"))
sizer_2.Add(label_1, 0, 0, 0)
sizer_2.Add((20, 20), 0, 0, 0)
sizer_2.Add(self.choice_2, 0, 0, 0)
sizer_2.Add((20, 20), 0, 0, 0)
label_2 = wx.StaticText(self, wx.ID_ANY, _("Master BMS ID"))
sizer_2.Add(label_2, 0, 0, 0)
sizer_2.Add((20, 20), 0, 0, 0)
sizer_2.Add(self.choice_1, 0, 0, 0)
sizer_3.Add(sizer_2, 0, wx.EXPAND, 0)
sizer_3.Add(self.property_grid_1, 1, wx.EXPAND, 0)
sizer_1.Add(sizer_3, 1, wx.EXPAND, 0)
sizer_4.Add(self.tree_ctrl_1, 1, wx.EXPAND, 0)
sizer_4.Add(self.grid_1, 1, wx.EXPAND, 0)
sizer_1.Add(sizer_4, 1, wx.EXPAND, 0)
self.SetSizer(sizer_1)
self.Layout()
# end wxGlade
# end of class BmsMonitorFrame
class BmsApp(wx.App):
def OnInit(self):
self.frame = BmsMonitorFrame(None, wx.ID_ANY, "")
self.SetTopWindow(self.frame)
self.frame.Show()
return True
# end of class BmsApp
if __name__ == "__main__":
gettext.install("app") # replace with the appropriate catalog name
app = BmsApp(0)
app.MainLoop()