本文整理汇总了Python中configtool.page.Page.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Page.__init__方法的具体用法?Python Page.__init__怎么用?Python Page.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类configtool.page.Page
的用法示例。
在下文中一共展示了Page.__init__方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from configtool.page import Page [as 别名]
# 或者: from configtool.page.Page import __init__ [as 别名]
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)
示例2: __init__
# 需要导入模块: from configtool.page import Page [as 别名]
# 或者: from configtool.page.Page import __init__ [as 别名]
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)
示例3: __init__
# 需要导入模块: from configtool.page import Page [as 别名]
# 或者: from configtool.page.Page import __init__ [as 别名]
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)
示例4: __init__
# 需要导入模块: from configtool.page import Page [as 别名]
# 或者: from configtool.page.Page import __init__ [as 别名]
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)
示例5: __init__
# 需要导入模块: from configtool.page import Page [as 别名]
# 或者: from configtool.page.Page import __init__ [as 别名]
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)
示例6: __init__
# 需要导入模块: from configtool.page import Page [as 别名]
# 或者: from configtool.page.Page import __init__ [as 别名]
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)
示例7: __init__
# 需要导入模块: from configtool.page import Page [as 别名]
# 或者: from configtool.page.Page import __init__ [as 别名]
def __init__(self, parent, nb, idPg, font):
wx.Panel.__init__(self, nb, wx.ID_ANY)
Page.__init__(self, font)
self.id = idPg
self.parent = parent
self.font = font
self.spmKeys = ['STEPS_PER_M_X', 'STEPS_PER_M_Y', 'STEPS_PER_M_Z',
'STEPS_PER_M_E']
self.mfrKeys = ['MAXIMUM_FEEDRATE_X', 'MAXIMUM_FEEDRATE_Y',
'MAXIMUM_FEEDRATE_Z', 'MAXIMUM_FEEDRATE_E']
self.msrKeys = ['SEARCH_FEEDRATE_X', 'SEARCH_FEEDRATE_Y',
'SEARCH_FEEDRATE_Z']
self.eclKeys = ['ENDSTOP_CLEARANCE_X', 'ENDSTOP_CLEARANCE_Y',
'ENDSTOP_CLEARANCE_Z']
self.minmaxKeys = ['X_MIN', 'X_MAX', 'Y_MIN', 'Y_MAX', 'Z_MIN', 'Z_MAX']
self.kinematicsKeys = ['KINEMATICS_STRAIGHT', 'KINEMATICS_COREXY']
self.labels = {'STEPS_PER_M_X': "X:", 'STEPS_PER_M_Y': "Y:",
'STEPS_PER_M_Z': "Z:", 'STEPS_PER_M_E' : "E:",
'MAXIMUM_FEEDRATE_X': "X:", 'MAXIMUM_FEEDRATE_Y': "Y:",
'MAXIMUM_FEEDRATE_Z': "Z:", 'MAXIMUM_FEEDRATE_E': "E:",
'SEARCH_FEEDRATE_X': "X:", 'SEARCH_FEEDRATE_Y': "Y:",
'SEARCH_FEEDRATE_Z': "Z:",
'ENDSTOP_CLEARANCE_X': "X:", 'ENDSTOP_CLEARANCE_Y': "Y:",
'ENDSTOP_CLEARANCE_Z': "Z:",
'X_MIN': "Min X:", 'X_MAX': "Max X:", 'Y_MIN': "Min Y:",
'Y_MAX': "Max Y:", 'Z_MIN': "Min Z:", 'Z_MAX': "Max Z:",
'E_ABSOLUTE': "Absolute E Coordinates",
'KINEMATICS_STRAIGHT': "Straight",
'KINEMATICS_COREXY': "CoreXY"}
labelWidth = 40;
sz = wx.GridBagSizer()
sz.AddSpacer((10, 10), pos = (0, 0))
sz.AddSpacer((90, 10), pos = (0, 4))
b = wx.StaticBox(self, wx.ID_ANY, "Steps Per Meter")
b.SetFont(font)
sbox = wx.StaticBoxSizer(b, wx.VERTICAL)
sbox.AddSpacer((5, 5))
for k in self.spmKeys:
tc = self.addTextCtrl(k, labelWidth, self.onTextCtrlInteger)
sbox.Add(tc)
sbox.AddSpacer((5, 5))
sz.Add(sbox, pos = (1, 1))
b = wx.StaticBox(self, wx.ID_ANY, "Maximum Feedrate")
b.SetFont(font)
sbox = wx.StaticBoxSizer(b, wx.VERTICAL)
sbox.AddSpacer((5, 5))
for k in self.mfrKeys:
tc = self.addTextCtrl(k, labelWidth, self.onTextCtrlInteger)
sbox.Add(tc)
sbox.AddSpacer((5, 5))
sz.Add(sbox, pos = (1, 5))
b = wx.StaticBox(self, wx.ID_ANY, "Search Feedrate")
b.SetFont(font)
sbox = wx.StaticBoxSizer(b, wx.VERTICAL)
sbox.AddSpacer((5, 5))
for k in self.msrKeys:
tc = self.addTextCtrl(k, labelWidth, self.onTextCtrlInteger)
sbox.Add(tc)
sbox.AddSpacer((5, 5))
sz.Add(sbox, pos = (1, 7))
b = wx.StaticBox(self, wx.ID_ANY, "Endstop Clearance")
b.SetFont(font)
sbox = wx.StaticBoxSizer(b, wx.VERTICAL)
sbox.AddSpacer((5, 5))
for k in self.eclKeys:
tc = self.addTextCtrl(k, labelWidth, self.onTextCtrlInteger)
sbox.Add(tc)
sbox.AddSpacer((5, 5))
sz.Add(sbox, pos = (3, 5))
b = wx.StaticBox(self, wx.ID_ANY, "Travel Limits")
b.SetFont(font)
sbox = wx.StaticBoxSizer(b, wx.VERTICAL)
sbox.AddSpacer((5, 5))
for k in self.minmaxKeys:
tc = self.addTextCtrl(k, labelWidth + 20, self.onTextCtrlFloat)
sbox.Add(tc)
sbox.AddSpacer((5, 5))
sz.Add(sbox, pos = (3, 7))
vsz = wx.BoxSizer(wx.VERTICAL)
#.........这里部分代码省略.........
示例8: __init__
# 需要导入模块: from configtool.page import Page [as 别名]
# 或者: from configtool.page.Page import __init__ [as 别名]
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
pinXkeys = [
("X_STEP_PIN", 2),
("X_DIR_PIN", 2),
("X_MIN_PIN", 2),
("X_MAX_PIN", 2),
("X_ENABLE_PIN", 2),
("X_INVERT_DIR", 1),
("X_INVERT_MIN", 1),
("X_INVERT_MAX", 1),
("X_INVERT_ENABLE", 1),
]
pinYkeys = [
("Y_STEP_PIN", 2),
("Y_DIR_PIN", 2),
("Y_MIN_PIN", 2),
("Y_MAX_PIN", 2),
("Y_ENABLE_PIN", 2),
("Y_INVERT_DIR", 1),
("Y_INVERT_MIN", 1),
("Y_INVERT_MAX", 1),
("Y_INVERT_ENABLE", 1),
]
pinZkeys = [
("Z_STEP_PIN", 2),
("Z_DIR_PIN", 2),
("Z_MIN_PIN", 2),
("Z_MAX_PIN", 2),
("Z_ENABLE_PIN", 2),
("Z_INVERT_DIR", 1),
("Z_INVERT_MIN", 1),
("Z_INVERT_MAX", 1),
("Z_INVERT_ENABLE", 1),
]
pinEkeys = [
("E_STEP_PIN", 2),
("E_DIR_PIN", 2),
("E_ENABLE_PIN", 2),
("E_INVERT_DIR", 1),
("E_INVERT_ENABLE", 1),
]
self.labels = {
"X_STEP_PIN": "Step Pin:",
"X_DIR_PIN": "Direction Pin:",
"X_MIN_PIN": "Minimum Pin:",
"X_MAX_PIN": "Maximum Pin:",
"X_ENABLE_PIN": "Enable Pin:",
"X_INVERT_DIR": "Invert Direction",
"X_INVERT_MIN": "Invert Minimum",
"X_INVERT_MAX": "Invert Maximum",
"X_INVERT_ENABLE": "Invert Enable",
"Y_STEP_PIN": "Step Pin:",
"Y_DIR_PIN": "Direction Pin:",
"Y_MIN_PIN": "Minimum Pin:",
"Y_MAX_PIN": "Maximum Pin:",
"Y_ENABLE_PIN": "Enable Pin:",
"Y_INVERT_DIR": "Invert Direction",
"Y_INVERT_MIN": "Invert Minimum",
"Y_INVERT_MAX": "Invert Maximum",
"Y_INVERT_ENABLE": "Invert Enable",
"Z_STEP_PIN": "Step Pin:",
"Z_DIR_PIN": "Direction Pin:",
"Z_MIN_PIN": "Minimum Pin:",
"Z_MAX_PIN": "Maximum Pin:",
"Z_ENABLE_PIN": "Enable Pin:",
"Z_INVERT_DIR": "Invert Direction",
"Z_INVERT_MIN": "Invert Minimum",
"Z_INVERT_MAX": "Invert Maximum",
"Z_INVERT_ENABLE": "Invert Enable",
"E_STEP_PIN": "Step Pin:",
"E_DIR_PIN": "Direction Pin:",
"E_ENABLE_PIN": "Enable Pin:",
"E_INVERT_DIR": "Invert Direction",
"E_INVERT_ENABLE": "Invert Enable",
"PS_ON_PIN": "PSU On Pin:",
"PS_MOSFET_PIN": "PSU MOSFET Pin:",
"STEPPER_ENABLE_PIN": "Stepper Enable Pin:",
"STEPPER_INVERT_ENABLE": "Stepper Invert Enable",
"DEBUG_LED_PIN": "Debug LED Pin:",
}
labelWidth = 120
sz = wx.GridBagSizer()
sz.AddSpacer((10, 10), pos=(0, 0))
b = wx.StaticBox(self, wx.ID_ANY, "X Axis")
b.SetFont(font)
sbox = wx.StaticBoxSizer(b, wx.VERTICAL)
sbox.AddSpacer((5, 5))
for k, ctype in pinXkeys:
if ctype == 0:
tc = self.addTextCtrl(k, labelWidth, self.onTextCtrlPin)
sbox.Add(tc)
#.........这里部分代码省略.........
示例9: __init__
# 需要导入模块: from configtool.page import Page [as 别名]
# 或者: from configtool.page.Page import __init__ [as 别名]
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.font = font
self.labels = {'USE_INTERNAL_PULLUPS': "Use Internal Pullups",
'EECONFIG': "Enable EEPROM Storage",
'BANG_BANG': "Enable",
'BANG_BANG_ON': "On PWM Level:",
'BANG_BANG_OFF': "Off PWM Level:",
'REPORT_TARGET_TEMPS': "Report Target Temperatures",
'MOVEBUFFER_SIZE': "Movebuffer Size:",
'DC_EXTRUDER': "Heater:", 'DC_EXTRUDER_PWM': "PWM:",
'USE_WATCHDOG': "Use the Watchdog Timer",
'TH_COUNT': "Temperature History Size:",
'FAST_PWM': "Fast PWM",
'ENDSTOP_STEPS': "Endstop Steps:",
'PID_SCALE': "PID Scaling Factor:",
'TEMP_HYSTERESIS': "Temperature Hysteresis:",
'TEMP_RESIDENCY_TIME': "Temperature Residency Time:",
'TEMP_EWMA': "Temperature EWMA:",
'HEATER_SANITY_CHECK': "Heater Sanity Check"}
self.heaterNameNone = "<none>"
self.heaterNames = [self.heaterNameNone]
self.boardHeaters = []
self.processors = []
sz = wx.GridBagSizer()
sz.AddSpacer((20, 40), pos = (0, 0))
sz.AddSpacer((40, 40), pos = (0, 2))
sz.AddSpacer((40, 40), pos = (0, 4))
sz.AddSpacer((20, 30), pos = (1, 0))
sz.AddSpacer((20, 30), pos = (2, 0))
sz.AddSpacer((20, 30), pos = (3, 0))
sz.AddSpacer((20, 30), pos = (4, 0))
sz.AddSpacer((20, 30), pos = (5, 0))
sz.AddSpacer((20, 30), pos = (6, 0))
sz.AddSpacer((20, 30), pos = (7, 0))
sz.AddSpacer((20, 30), pos = (8, 0))
labelWidth = 140
k = 'EECONFIG'
cb = self.addCheckBox(k, self.onCheckBox)
sz.Add(cb, pos = (1, 1))
k = 'USE_INTERNAL_PULLUPS'
cb = self.addCheckBox(k, self.onCheckBox)
sz.Add(cb, pos = (2, 1))
k = 'USE_WATCHDOG'
cb = self.addCheckBox(k, self.onCheckBox)
sz.Add(cb, pos = (3, 1))
k = 'FAST_PWM'
cb = self.addCheckBox(k, self.onCheckBox)
sz.Add(cb, pos = (4, 1))
k = 'HEATER_SANITY_CHECK'
cb = self.addCheckBox(k, self.onCheckBox)
sz.Add(cb, pos = (5, 1))
k = 'REPORT_TARGET_TEMPS'
cb = self.addCheckBox(k, self.onCheckBox)
sz.Add(cb, pos = (6, 1))
b = wx.StaticBox(self, wx.ID_ANY, "BANG BANG Bed Control")
b.SetFont(font)
sbox = wx.StaticBoxSizer(b, wx.VERTICAL)
sbox.AddSpacer((5, 5))
k = 'BANG_BANG'
cb = self.addCheckBox(k, self.onCheckBox)
sbox.Add(cb, 1, wx.LEFT, 60)
sbox.AddSpacer((5, 20))
k = 'BANG_BANG_ON'
tc = self.addTextCtrl(k, 100, self.onTextCtrlInteger)
sbox.Add(tc)
sbox.AddSpacer((5, 5))
k = 'BANG_BANG_OFF'
tc = self.addTextCtrl(k, 100, self.onTextCtrlInteger)
sbox.Add(tc)
sbox.AddSpacer((5, 5))
sz.Add(sbox, pos = (1, 3), span = (5, 1), flag = wx.ALIGN_CENTER_HORIZONTAL)
b = wx.StaticBox(self, wx.ID_ANY, "DC Motor Extruder")
b.SetFont(font)
sbox = wx.StaticBoxSizer(b, wx.VERTICAL)
sbox.AddSpacer((5, 5))
k = 'DC_EXTRUDER'
ch = self.addChoice(k, self.heaterNames, 0, 60, self.onChoice)
sbox.Add(ch)
sbox.AddSpacer((5, 5))
#.........这里部分代码省略.........
示例10: __init__
# 需要导入模块: from configtool.page import Page [as 别名]
# 或者: from configtool.page.Page import __init__ [as 别名]
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.accTypeKeys = ['ACCELERATION_REPRAP', 'ACCELERATION_RAMPING',
'ACCELERATION_TEMPORAL']
self.jerkKeys = ['MAX_JERK_X', 'MAX_JERK_Y', 'MAX_JERK_Z', 'MAX_JERK_E']
self.labels = {'ACCELERATION_REPRAP': "RepRap",
'ACCELERATION_RAMPING': "Ramping",
'ACCELERATION_TEMPORAL': "Temporal",
'ACCELERATION': "Acceleration:",
'LOOKAHEAD': "Look Ahead",
'MAX_JERK_X': "X:", 'MAX_JERK_Y': "Y:", 'MAX_JERK_Z': "Z:",
'MAX_JERK_E': "E:"}
sz = wx.GridBagSizer()
sz.AddSpacer((20, 40), pos = (0, 0))
b = wx.StaticBox(self, wx.ID_ANY, "Acceleration Type")
b.SetFont(font)
sbox = wx.StaticBoxSizer(b, wx.VERTICAL)
sbox.AddSpacer((5, 5))
style = wx.RB_GROUP
for k in self.accTypeKeys:
rb = self.addRadioButton(k, style, self.onAccTypeSelect, b)
style = 0
sbox.Add(rb, 1, wx.LEFT + wx.RIGHT, 16)
sbox.AddSpacer((5, 5))
self.rbNone = wx.RadioButton(self, wx.ID_ANY, "None", style = style)
self.rbNone.SetFont(font)
self.rbNone.SetValue(True)
self.Bind(wx.EVT_RADIOBUTTON, self.onAccTypeSelect, self.rbNone)
sbox.Add(self.rbNone, 1, wx.LEFT + wx.RIGHT, 16)
sbox.AddSpacer((5, 5))
sz.Add(sbox, pos = (1, 1))
b = wx.StaticBox(self, wx.ID_ANY, "Ramping Parameters")
b.SetFont(font)
sbox = wx.StaticBoxSizer(b, wx.VERTICAL)
sbox.AddSpacer((5, 5))
k = 'ACCELERATION'
tc = self.addTextCtrl(k, 80, self.onTextCtrlFloat)
self.textControls[k].Enable(False)
sbox.Add(tc)
sbox.AddSpacer((5, 5))
k = 'LOOKAHEAD'
cb = self.addCheckBox(k, self.onCheckBox)
self.checkBoxes[k].Enable(False)
sbox.Add(cb, 1, wx.ALIGN_CENTER_HORIZONTAL)
sbox.AddSpacer((5, 5))
sz.Add(sbox, pos = (1, 3))
b = wx.StaticBox(self, wx.ID_ANY, "Maximum Jerk")
b.SetFont(font)
sbox = wx.StaticBoxSizer(b, wx.VERTICAL)
sbox.AddSpacer((5, 5))
for k in self.jerkKeys:
tc = self.addTextCtrl(k, 40, self.onTextCtrlInteger)
sbox.Add(tc)
sbox.AddSpacer((5, 5))
sz.AddSpacer((80, 20), pos = (1, 4))
sz.Add(sbox, pos = (1, 5))
self.SetSizer(sz)
self.enableAll(False)