def __init__(self, font): self.modified = False self.valid = True self.fieldValid = {} self.textControls = {} self.checkBoxes = {} self.radioButtons = {} self.radioButtonBoxes = {} self.choices = {} self.deco = Decoration() self.font = font self.SetBackgroundColour(self.deco.getBackgroundColour()) self.Bind(wx.EVT_PAINT, self.deco.onPaintBackground)
def __init__(self): wx.Frame.__init__(self, None, -1, "Teacup Configtool", size=(880, 550)) self.Bind(wx.EVT_CLOSE, self.onClose) self.Bind(wx.EVT_SIZE, self.onResize) self.deco = Decoration() panel = wx.Panel(self, -1) panel.SetBackgroundColour(self.deco.getBackgroundColour()) panel.Bind(wx.EVT_PAINT, self.deco.onPaintBackground) self.settings = Settings(self, cmd_folder) self.settings.font = wx.Font(8, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD) self.settings.folder = cmd_folder self.heaters = [] self.savePrtEna = False self.saveBrdEna = False self.protPrtFile = False self.protBrdFile = False sz = wx.BoxSizer(wx.HORIZONTAL) self.nb = wx.Notebook(panel, wx.ID_ANY, size=(880, 550), style=wx.BK_DEFAULT) self.nb.SetBackgroundColour(self.deco.getBackgroundColour()) self.nb.SetFont(self.settings.font) self.printerFileName = None self.printerTabDecor = "" self.printerBaseText = "Printer" self.pgPrinter = PrinterPanel(self, self.nb, self.settings) self.nb.AddPage(self.pgPrinter, self.printerBaseText) self.boardFileName = None self.boardTabDecor = "" self.boardBaseText = "Board" self.pgBoard = BoardPanel(self, self.nb, self.settings) self.nb.AddPage(self.pgBoard, self.boardBaseText) panel.Fit() self.panel = panel sz.Add(self.nb, 1, wx.EXPAND + wx.ALL, 5) self.SetSizer(sz) self.makeMenu()
def __init__(self, parent, nb, settings): wx.Panel.__init__(self, nb, wx.ID_ANY) self.parent = parent self.settings = settings self.protFileLoaded = False self.deco = Decoration() self.configFile = None self.cfgValues = {} self.heaters = [] self.sensors = [] self.candHeatPins = [] self.candThermPins = [] self.dir = os.path.join(self.settings.folder, "config") self.cfgDir = os.path.join(self.settings.folder, "configtool") self.SetBackgroundColour(self.deco.getBackgroundColour()) self.Bind(wx.EVT_PAINT, self.deco.onPaintBackground) sz = wx.BoxSizer(wx.HORIZONTAL) self.nb = wx.Notebook(self, wx.ID_ANY, size=(21, 21), style=wx.BK_DEFAULT) self.nb.SetBackgroundColour(self.deco.getBackgroundColour()) self.nb.SetFont(self.settings.font) self.pages = [] self.titles = [] self.pageModified = [] self.pageValid = [] self.pgCpu = self.registerPage(CpuPage, "CPU") self.pgPins = self.registerPage(PinoutsPage, "Pinouts") self.pgDisplay = self.registerPage(DisplayPage, "Display") self.pgHeaters = self.registerPage(HeatersPage, "Heaters") self.pgSensors = self.registerPage(SensorsPage, "Temperature Sensors", heatersPage=self.pgHeaters) self.pgCommunications = self.registerPage(CommunicationsPage, "Communications") sz.Add(self.nb, 1, wx.EXPAND + wx.ALL, 5) self.SetSizer(sz) self.Fit()
def __init__(self, parent, nb, settings): wx.Panel.__init__(self, nb, wx.ID_ANY) self.parent = parent self.deco = Decoration() self.configFile = None self.protFileLoaded = False self.settings = settings self.cfgValues = {} self.heaters = [] self.dir = os.path.join(self.settings.folder, "config") self.cfgDir = os.path.join(self.settings.folder, "configtool") self.SetBackgroundColour(self.deco.getBackgroundColour()) self.Bind(wx.EVT_PAINT, self.deco.onPaintBackground) sz = wx.BoxSizer(wx.HORIZONTAL) self.nb = wx.Notebook(self, wx.ID_ANY, size=(21, 21), style=wx.BK_DEFAULT) self.nb.SetBackgroundColour(self.deco.getBackgroundColour()) self.nb.SetFont(self.settings.font) self.pages = [] self.titles = [] self.pageModified = [] self.pageValid = [] self.pgMech = self.registerPage(MechanicalPage, "Mechanical") self.pgAcc = self.registerPage(AccelerationPage, "Acceleration") self.pgMiscellaneous = self.registerPage(MiscellaneousPage, "Miscellaneous") sz.Add(self.nb, 1, wx.EXPAND + wx.ALL, 5) self.SetSizer(sz) self.Fit()
def __init__(self, parent, nb, settings): wx.Panel.__init__(self, nb, wx.ID_ANY) self.parent = parent self.settings = settings self.protFileLoaded = False self.deco = Decoration() self.configFile = None self.cfgValues = {} self.heaters = [] self.sensors = [] self.candHeatPins = [] self.candThermPins = [] self.dir = os.path.join(self.settings.folder, "config") self.SetBackgroundColour(self.deco.getBackgroundColour()) self.Bind(wx.EVT_PAINT, self.deco.onPaintBackground) sz = wx.BoxSizer(wx.HORIZONTAL) self.nb = wx.Notebook(self, wx.ID_ANY, size = (21, 21), style = wx.BK_DEFAULT) self.nb.SetBackgroundColour(self.deco.getBackgroundColour()) self.nb.SetFont(self.settings.font) self.pages = [] self.titles = [] self.pageModified = [] self.pageValid = [] self.pgCpu = CpuPage(self, self.nb, len(self.pages), self.settings.font) text = "CPU" self.nb.AddPage(self.pgCpu, text) self.pages.append(self.pgCpu) self.titles.append(text) self.pageModified.append(False) self.pageValid.append(True) self.pgPins = PinoutsPage(self, self.nb, len(self.pages), self.settings.font) text = "Pinouts" self.nb.AddPage(self.pgPins, text) self.pages.append(self.pgPins) self.titles.append(text) self.pageModified.append(False) self.pageValid.append(True) self.pgHeaters = HeatersPage(self, self.nb, len(self.pages), self.settings.font) text = "Heaters" self.nb.AddPage(self.pgHeaters, text) self.pages.append(self.pgHeaters) self.titles.append(text) self.pageModified.append(False) self.pageValid.append(True) self.pgSensors = SensorsPage(self, self.nb, len(self.pages), self.pgHeaters, self.settings.font) text = "Temperature Sensors" self.nb.AddPage(self.pgSensors, text) self.pages.append(self.pgSensors) self.titles.append(text) self.pageModified.append(False) self.pageValid.append(True) self.pgCommunications = CommunicationsPage(self, self.nb, len(self.pages), self.settings.font) text = "Communications" self.nb.AddPage(self.pgCommunications, text) self.pages.append(self.pgCommunications) self.titles.append(text) self.pageModified.append(False) self.pageValid.append(True) sz.Add(self.nb, 1, wx.EXPAND + wx.ALL, 5) self.SetSizer(sz) self.Fit()