当前位置: 首页>>代码示例>>Python>>正文


Python page.Page类代码示例

本文整理汇总了Python中configtool.page.Page的典型用法代码示例。如果您正苦于以下问题:Python Page类的具体用法?Python Page怎么用?Python Page使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Page类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

  def __init__(self, parent, nb, idPg, font):
    wx.Panel.__init__(self, nb, wx.ID_ANY)
    Page.__init__(self, font)
    self.parent = parent
    self.id = idPg

    self.labels = {'DISPLAY_BUS': "Display Bus:",
                   'DISPLAY_TYPE': "Display Type:",
                   'DISPLAY_BUS_4BIT': "Direct with 4 pins",
                   'DISPLAY_BUS_8BIT': "Direct with 8 pins",
                   'DISPLAY_BUS_I2C': "I²C ( = TWI)",
                   'DISPLAY_BUS_SPI': "SPI",
                   'DISPLAY_TYPE_SSD1306': "SSD1306 O-LED, 128x32",
                   'DISPLAY_TYPE_LCD1302': "LCD 1302"}

    sz = wx.GridBagSizer()
    sz.AddSpacer((20, 40), pos = (0, 0))

    ch = self.addBoolChoice('DISPLAY_BUS', True, 100, self.onBusChoice,
                            size = (160, -1))
    sz.Add(ch, pos = (1, 1))
    sz.AddSpacer((100, 10), pos = (1, 2))

    ch = self.addBoolChoice('DISPLAY_TYPE', False, 100, self.onChoice,
                            size = (200, -1))
    sz.Add(ch, pos = (1, 3))

    self.SetSizer(sz)
    self.enableAll(False)
开发者ID:applemuncy,项目名称:Teacup_Firmware,代码行数:29,代码来源:displaypage.py

示例2: __init__

  def __init__(self, parent, nb, idPg, font):
    wx.Panel.__init__(self, nb, wx.ID_ANY)
    Page.__init__(self, font)
    self.parent = parent
    self.id = idPg

    self.labels = {'F_CPU': "CPU Clock Rate:", 'CPU': "Processor Type:"}
    self.clocks = []
    self.processors = []

    sz = wx.GridBagSizer()
    sz.AddSpacer((20, 40), pos = (0, 0))

    k = 'F_CPU'
    ch = self.addChoice(k, self.clocks, 0, 100, self.onChoice, size = (140, -1))
    sz.Add(ch, pos = (1, 1))
    sz.AddSpacer((100, 10), pos = (1, 2))

    k = 'CPU'
    ch = self.addChoice(k, self.processors, 0, 100, self.onChoice,
                        size = (140, -1))
    sz.Add(ch, pos = (1, 3))

    self.SetSizer(sz)
    self.enableAll(False)
开发者ID:DEMI1,项目名称:Teacup_Firmware,代码行数:25,代码来源:cpupage.py

示例3: __init__

  def __init__(self, parent, nb, idPg, font):
    wx.Panel.__init__(self, nb, wx.ID_ANY)
    Page.__init__(self, font)
    self.parent = parent
    self.id = idPg
    self.defaultBaud = '115200'

    self.bauds = ['19200', '38400', '57600', self.defaultBaud]

    self.labels = {'XONXOFF': "XON/XOFF Flow Control", 'BAUD': "Baud Rate:",
                   'USB_SERIAL': "USB Serial"}

    sz = wx.GridBagSizer()
    sz.AddSpacer((20, 40), pos = (0, 0))

    k = 'USB_SERIAL'
    cb = self.addCheckBox(k, self.onUSBCheckBox)
    sz.Add(cb, pos = (1, 1))

    ch = self.addChoice('BAUD', self.bauds, self.bauds.index(self.defaultBaud),
                        80, self.onChoice)
    sz.Add(ch, pos = (1, 3))

    cb = self.addCheckBox('XONXOFF', self.onCheckBox)
    sz.Add(cb, pos = (3, 3))

    sz.AddSpacer((100, 10), pos = (2, 2))

    self.SetSizer(sz)
    self.enableAll(False)
开发者ID:mteletin,项目名称:Teacup_Firmware,代码行数:30,代码来源:communicationspage.py

示例4: __init__

  def __init__(self, parent, nb, idPg, heatersPage, font):
    wx.Panel.__init__(self, nb, wx.ID_ANY)
    Page.__init__(self, font)
    self.parent = parent
    self.heatersPage = heatersPage
    self.font = font
    self.id = idPg

    self.sensorTypeKeys = {'TT_MAX6675': 'TEMP_MAX6675',
                           'TT_THERMISTOR': 'TEMP_THERMISTOR',
                           'TT_AD595': 'TEMP_AD595', 'TT_PT100': 'TEMP_PT100',
                           'TT_INTERCOM': 'TEMP_INTERCOM'}
    self.labels = {'TEMP_MAX6675': "MAX6675", 'TEMP_THERMISTOR': "Thermistor",
                   'TEMP_AD595': "AD595", 'TEMP_PT100': "PT100",
                   'TEMP_INTERCOM': "Intercom"}

    self.validPins = pinNames

    sz = wx.GridBagSizer()
    sz.AddSpacer((10, 10), pos = (0, 0))

    self.sensors = []

    self.lb = SensorList(self, font)
    sz.Add(self.lb, pos = (1, 1))
    sz.AddSpacer((20, 20), pos = (1, 2))

    bsz = wx.BoxSizer(wx.VERTICAL)
    self.bAdd = wx.Button(self, wx.ID_ANY, "Add", size = BSIZESMALL)
    self.bAdd.SetBackgroundColour(self.deco.getBackgroundColour())
    self.bAdd.SetFont(font)
    self.Bind(wx.EVT_BUTTON, self.doAdd, self.bAdd)
    self.bAdd.Enable(False)
    self.bAdd.SetToolTipString("Add a sensor to the configuration.")

    bsz.Add(self.bAdd)

    bsz.AddSpacer((10, 10))
    self.bModify = wx.Button(self, wx.ID_ANY, "Modify", size = BSIZESMALL)
    self.bModify.SetBackgroundColour(self.deco.getBackgroundColour())
    self.bModify.SetFont(font)
    self.bModify.Enable(False)
    self.Bind(wx.EVT_BUTTON, self.doModify, self.bModify)
    bsz.Add(self.bModify)
    self.bModify.SetToolTipString("Modify the selected temperature sensor.")

    bsz.AddSpacer((10, 10))
    self.bDelete = wx.Button(self, wx.ID_ANY, "Delete", size = BSIZESMALL)
    self.bDelete.SetBackgroundColour(self.deco.getBackgroundColour())
    self.bDelete.SetFont(font)
    self.bDelete.Enable(False)
    self.Bind(wx.EVT_BUTTON, self.doDelete, self.bDelete)
    bsz.Add(self.bDelete)
    self.bDelete.SetToolTipString("Remove the selected temperature sensor "
                                  "from the configuration.")

    sz.Add(bsz, pos = (1, 3))

    self.SetSizer(sz)
    self.enableAll(False)
开发者ID:OKComputing,项目名称:Teacup_Firmware,代码行数:60,代码来源:sensorpage.py

示例5: insertValues

  def insertValues(self, cfgValues):
    Page.insertValues(self, cfgValues)

    if len(self.clocks) > 0:
      self.setChoice('F_CPU', cfgValues, self.clocks[0])
    if len(self.processors) > 0:
      self.setChoice('CPU', cfgValues, self.processors[0])
开发者ID:OKComputing,项目名称:Teacup_Firmware,代码行数:7,代码来源:cpupage.py

示例6: __init__

  def __init__(self, parent, nb, idPg, font):
    wx.Panel.__init__(self, nb, wx.ID_ANY)
    Page.__init__(self, font)
    self.parent = parent
    self.font = font
    self.id = idPg

    self.labels = {'FORCE_SOFTWARE_PWM':"Force software PWM"}

    sz = wx.GridBagSizer()
    sz.AddSpacer((30, 30), pos = (0, 0))

    self.heaters = []
    self.validPins = pinNames

    self.lb = HeaterList(self, font)
    sz.Add(self.lb, pos = (1, 1))
    sz.AddSpacer((20, 20), pos = (1, 2))

    k = 'FORCE_SOFTWARE_PWM'
    cb = self.addCheckBox(k, self.onCheckBox)

    sz.Add(cb, pos = (2, 1))
    sz.AddSpacer((20, 20), pos = (2, 2))

    bsz = wx.BoxSizer(wx.VERTICAL)

    self.bAdd = wx.Button(self, wx.ID_ANY, "Add", size = BSIZESMALL)
    self.bAdd.SetBackgroundColour(self.deco.getBackgroundColour())
    self.bAdd.SetFont(font)
    self.Bind(wx.EVT_BUTTON, self.doAdd, self.bAdd)
    self.bAdd.SetToolTipString("Add a heater to the configuration.")
    bsz.Add(self.bAdd)

    bsz.AddSpacer((10, 10))

    self.bModify = wx.Button(self, wx.ID_ANY, "Modify", size = BSIZESMALL)
    self.bModify.SetBackgroundColour(self.deco.getBackgroundColour())
    self.bModify.SetFont(font)
    self.bModify.Enable(False)
    self.Bind(wx.EVT_BUTTON, self.doModify, self.bModify)
    self.bModify.SetToolTipString("Modify the selected heater.")
    bsz.Add(self.bModify)

    bsz.AddSpacer((10, 10))

    self.bDelete = wx.Button(self, wx.ID_ANY, "Delete", size = BSIZESMALL)
    self.bDelete.SetBackgroundColour(self.deco.getBackgroundColour())
    self.bDelete.SetFont(font)
    self.bDelete.Enable(False)
    self.Bind(wx.EVT_BUTTON, self.doDelete, self.bDelete)
    self.bDelete.SetToolTipString("Remove the selected heater from the "
                                  "configuration.")
    bsz.Add(self.bDelete)

    sz.Add(bsz, pos = (1, 3))

    self.SetSizer(sz)
    self.enableAll(False)
开发者ID:Traumflug,项目名称:Teacup_Firmware,代码行数:59,代码来源:heaterspage.py

示例7: onBusChoice

  def onBusChoice(self, evt):
    choice = self.boolChoices['DISPLAY_BUS']
    if choice.GetClientData(choice.GetSelection()):
      self.boolChoices['DISPLAY_TYPE'].Enable(True)
    else:
      self.boolChoices['DISPLAY_TYPE'].Enable(False)

    Page.onChoice(self, evt)
开发者ID:applemuncy,项目名称:Teacup_Firmware,代码行数:8,代码来源:displaypage.py

示例8: insertValues

  def insertValues(self, cfgValues):
    Page.insertValues(self, cfgValues)

    for k in self.choices.keys():
      if k in cfgValues.keys():
        self.choicesOriginal[k] = cfgValues[k]
        self.setChoice(k, cfgValues, "-")
      else:
        print "Key " + k + " not found in config data."
开发者ID:OKComputing,项目名称:Teacup_Firmware,代码行数:9,代码来源:pinoutspage.py

示例9: insertValues

  def insertValues(self, cfgValues):
    Page.insertValues(self, cfgValues)

    k = 'BAUD'
    self.setChoice(k, cfgValues, self.defaultBaud)

    if self.checkBoxes['USB_SERIAL'].IsChecked():
      self.checkBoxes['XONXOFF'].Enable(False)
      self.choices['BAUD'].Enable(False)
开发者ID:mteletin,项目名称:Teacup_Firmware,代码行数:9,代码来源:communicationspage.py

示例10: insertValues

    def insertValues(self, cfgValues):
        Page.insertValues(self, cfgValues)

        k = "BAUD"
        self.setChoice(k, cfgValues, self.defaultBaud)
        if k in cfgValues.keys():
            self.choicesOriginal[k] = cfgValues[k]

        if self.checkBoxes["USB_SERIAL"].IsChecked():
            self.checkBoxes["XONXOFF"].Enable(False)
            self.choices["BAUD"].Enable(False)
开发者ID:OKComputing,项目名称:Teacup_Firmware,代码行数:11,代码来源:communicationspage.py

示例11: insertValues

  def insertValues(self, cfgValues):
    Page.insertValues(self, cfgValues)

    self.checkBoxes['LOOKAHEAD'].Enable(False)
    self.textControls['ACCELERATION'].Enable(False)
    for tag in self.accTypeKeys:
      if tag in cfgValues.keys() and cfgValues[tag]:
        self.radioButtons[tag].SetValue(True)
        if tag == 'ACCELERATION_RAMPING':
          self.checkBoxes['LOOKAHEAD'].Enable(True)
          self.textControls['ACCELERATION'].Enable(True)
开发者ID:OKComputing,项目名称:Teacup_Firmware,代码行数:11,代码来源:accelerationpage.py

示例12: insertValues

  def insertValues(self, cfgValues):
    Page.insertValues(self, cfgValues)

    self.prepareHomingValues('HOMING_STEP1', 0, cfgValues)
    self.prepareHomingValues('HOMING_STEP2', 1, cfgValues)
    self.prepareHomingValues('HOMING_STEP3', 2, cfgValues)
    self.prepareHomingValues('HOMING_STEP4', 3, cfgValues)

    for tag in self.kinematicsKeys:
      if tag in cfgValues.keys() and cfgValues[tag]:
        self.radioButtons[tag].SetValue(True)
开发者ID:Traumflug,项目名称:Teacup_Firmware,代码行数:11,代码来源:mechanicalpage.py

示例13: insertValues

  def insertValues(self, cfgValues):
    Page.insertValues(self, cfgValues)

    k = 'KINEMATICS'
    if k in cfgValues.keys():
      k = cfgValues[k]
      if k in self.kinematicsKeys:
        self.radioButtons[k].SetValue(True)
      else:
        self.radioButtons[self.kinematicsKeys[0]].SetValue(True)
    else:
      self.radioButtons[self.kinematicsKeys[0]].SetValue(True)
开发者ID:OKComputing,项目名称:Teacup_Firmware,代码行数:12,代码来源:mechanicalpage.py

示例14: __init__

  def __init__(self, parent, nb, idPg, font):
    wx.Panel.__init__(self, nb, wx.ID_ANY)
    Page.__init__(self, font)
    self.parent = parent
    self.id = idPg

    self.labels = {'DISPLAY_BUS': "Display Bus:",
                   'DISPLAY_TYPE': "Display Type:",
                   'DISPLAY_BUS_4BIT': "Direct with 4 pins",
                   'DISPLAY_BUS_8BIT': "Direct with 8 pins",
                   'DISPLAY_BUS_I2C': "I²C ( = TWI)",
                   'DISPLAY_BUS_SPI': "SPI",
                   'DISPLAY_TYPE_SSD1306': "SSD1306 O-LED, 128x32 pixels",
                   'DISPLAY_TYPE_HD44780': "HD44780 or 1602A, 16x2 characters",
                   'DISPLAY_RS_PIN': "RS pin",
                   'DISPLAY_RW_PIN': "R/W pin",
                   'DISPLAY_E_PIN': "E pin",
                   'DISPLAY_D4_PIN': "D4 pin",
                   'DISPLAY_D5_PIN': "D5 pin",
                   'DISPLAY_D6_PIN': "D6 pin",
                   'DISPLAY_D7_PIN': "D7 pin"}

    sz = wx.GridBagSizer()
    sz.AddSpacer((20, 40), pos = (0, 0))

    ch = self.addBoolChoice('DISPLAY_BUS', True, 100, self.onBusChoice,
                            size = (160, -1))
    sz.Add(ch, pos = (1, 1))
    sz.AddSpacer((100, 10), pos = (1, 2))

    ch = self.addBoolChoice('DISPLAY_TYPE', False, 100, self.onChoice,
                            size = (240, -1))
    sz.Add(ch, pos = (1, 3))

    b = wx.StaticBox(self, wx.ID_ANY, "Direct 4-bit Bus Pins:")
    b.SetFont(font)
    self.pinbox = wx.StaticBoxSizer(b, wx.VERTICAL)
    self.pinbox.AddSpacer((5, 5))
    for k in ('DISPLAY_RS_PIN', 'DISPLAY_RW_PIN', 'DISPLAY_E_PIN',
              'DISPLAY_D4_PIN', 'DISPLAY_D5_PIN', 'DISPLAY_D6_PIN',
              'DISPLAY_D7_PIN'):
      tc = self.addPinChoice(k, 200)
      self.pinbox.Add(tc)
      self.pinbox.AddSpacer((5, 5))
    sz.Add(self.pinbox, pos = (3, 1))

    self.SetSizer(sz)
    self.enableAll(False)
开发者ID:Traumflug,项目名称:Teacup_Firmware,代码行数:48,代码来源:displaypage.py

示例15: getValues

  def getValues(self):
    result = Page.getValues(self)

    for tag in self.kinematicsKeys:
      result[tag] = self.radioButtons[tag].GetValue()

    return result
开发者ID:Wurstnase,项目名称:Teacup_Firmware,代码行数:7,代码来源:mechanicalpage.py


注:本文中的configtool.page.Page类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。