本文整理汇总了Python中util.profile.getProfileSetting函数的典型用法代码示例。如果您正苦于以下问题:Python getProfileSetting函数的具体用法?Python getProfileSetting怎么用?Python getProfileSetting使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getProfileSetting函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(
self,
parent,
profileSetting,
bitmapFilenameOn,
bitmapFilenameOff,
helpText="",
id=-1,
callback=None,
size=(20, 20),
):
self.bitmapOn = getBitmapImage(bitmapFilenameOn)
self.bitmapOff = getBitmapImage(bitmapFilenameOff)
super(ToggleButton, self).__init__(parent, id, self.bitmapOff, size=size)
self.callback = callback
self.profileSetting = profileSetting
self.helpText = helpText
self.SetBezelWidth(1)
self.SetUseFocusIndicator(False)
if self.profileSetting != "":
self.SetValue(profile.getProfileSetting(self.profileSetting) == "True")
self.Bind(wx.EVT_BUTTON, self.OnButtonProfile)
else:
self.Bind(wx.EVT_BUTTON, self.OnButton)
self.Bind(wx.EVT_ENTER_WINDOW, self.OnMouseEnter)
self.Bind(wx.EVT_LEAVE_WINDOW, self.OnMouseLeave)
parent.AddControl(self)
开发者ID:CNCBASHER,项目名称:Cura,代码行数:33,代码来源:toolbarUtil.py
示例2: updateProfileToControls
def updateProfileToControls(self):
"Update the configuration wx controls to show the new configuration settings"
for setting in self.settingControlList:
if setting.type == "profile":
setting.SetValue(profile.getProfileSetting(setting.configName))
else:
setting.SetValue(profile.getPreference(setting.configName))
开发者ID:greenarrow,项目名称:Cura,代码行数:7,代码来源:configBase.py
示例3: _doAutoPlace
def _doAutoPlace(self, allowedSizeY):
extraSizeMin = self.headSizeMin
extraSizeMax = self.headSizeMax
if profile.getProfileSettingFloat('skirt_line_count') > 0:
skirtSize = profile.getProfileSettingFloat('skirt_line_count') * profile.calculateEdgeWidth() + profile.getProfileSettingFloat('skirt_gap')
extraSizeMin = extraSizeMin + util3d.Vector3(skirtSize, skirtSize, 0)
extraSizeMax = extraSizeMax + util3d.Vector3(skirtSize, skirtSize, 0)
if profile.getProfileSetting('support') != 'None':
extraSizeMin = extraSizeMin + util3d.Vector3(3.0, 0, 0)
extraSizeMax = extraSizeMax + util3d.Vector3(3.0, 0, 0)
if self.printMode == 1:
extraSizeMin = util3d.Vector3(6.0, 6.0, 0)
extraSizeMax = util3d.Vector3(6.0, 6.0, 0)
if extraSizeMin.x > extraSizeMax.x:
posX = self.machineSize.x
dirX = -1
else:
posX = 0
dirX = 1
posY = 0
dirY = 1
minX = self.machineSize.x
minY = self.machineSize.y
maxX = 0
maxY = 0
for item in self.list:
item.centerX = posX + item.getMaximum().x * item.scale * dirX
item.centerY = posY + item.getMaximum().y * item.scale * dirY
if item.centerY + item.getSize().y >= allowedSizeY:
if dirX < 0:
posX = minX - extraSizeMax.x - 1
else:
posX = maxX + extraSizeMin.x + 1
posY = 0
item.centerX = posX + item.getMaximum().x * item.scale * dirX
item.centerY = posY + item.getMaximum().y * item.scale * dirY
posY += item.getSize().y * item.scale * dirY + extraSizeMin.y + 1
minX = min(minX, item.centerX - item.getSize().x * item.scale / 2)
minY = min(minY, item.centerY - item.getSize().y * item.scale / 2)
maxX = max(maxX, item.centerX + item.getSize().x * item.scale / 2)
maxY = max(maxY, item.centerY + item.getSize().y * item.scale / 2)
for item in self.list:
if dirX < 0:
item.centerX -= minX / 2
else:
item.centerX += (self.machineSize.x - maxX) / 2
item.centerY += (self.machineSize.y - maxY) / 2
if minX < 0 or maxX > self.machineSize.x:
return ((maxX - minX) + (maxY - minY)) * 100
return (maxX - minX) + (maxY - minY)
开发者ID:danilke,项目名称:Cura,代码行数:56,代码来源:projectPlanner.py
示例4: getExtraHeadSize
def getExtraHeadSize(self):
extraSizeMin = self.headSizeMin
extraSizeMax = self.headSizeMax
if profile.getProfileSettingFloat('skirt_line_count') > 0:
skirtSize = profile.getProfileSettingFloat('skirt_line_count') * profile.calculateEdgeWidth() + profile.getProfileSettingFloat('skirt_gap')
extraSizeMin = extraSizeMin + numpy.array([skirtSize, skirtSize, 0])
extraSizeMax = extraSizeMax + numpy.array([skirtSize, skirtSize, 0])
if profile.getProfileSetting('enable_raft') != 'False':
raftSize = profile.getProfileSettingFloat('raft_margin') * 2
extraSizeMin = extraSizeMin + numpy.array([raftSize, raftSize, 0])
extraSizeMax = extraSizeMax + numpy.array([raftSize, raftSize, 0])
if profile.getProfileSetting('support') != 'None':
extraSizeMin = extraSizeMin + numpy.array([3.0, 0, 0])
extraSizeMax = extraSizeMax + numpy.array([3.0, 0, 0])
if self.printMode == 1:
extraSizeMin = numpy.array([6.0, 6.0, 0])
extraSizeMax = numpy.array([6.0, 6.0, 0])
return extraSizeMin, extraSizeMax
开发者ID:custodian,项目名称:Cura,代码行数:20,代码来源:projectPlanner.py
示例5: updateModelTransform
def updateModelTransform(self, f=0):
if len(self.objectList) < 1 or self.objectList[0].mesh == None:
return
rotate = profile.getProfileSettingFloat('model_rotate_base')
mirrorX = profile.getProfileSetting('flip_x') == 'True'
mirrorY = profile.getProfileSetting('flip_y') == 'True'
mirrorZ = profile.getProfileSetting('flip_z') == 'True'
swapXZ = profile.getProfileSetting('swap_xz') == 'True'
swapYZ = profile.getProfileSetting('swap_yz') == 'True'
for obj in self.objectList:
if obj.mesh == None:
continue
obj.mesh.setRotateMirror(rotate, mirrorX, mirrorY, mirrorZ, swapXZ, swapYZ)
minV = self.objectList[0].mesh.getMinimum()
maxV = self.objectList[0].mesh.getMaximum()
for obj in self.objectList:
if obj.mesh == None:
continue
obj.mesh.getMinimumZ()
minV = numpy.minimum(minV, obj.mesh.getMinimum())
maxV = numpy.maximum(maxV, obj.mesh.getMaximum())
self.objectsMaxV = maxV
self.objectsMinV = minV
for obj in self.objectList:
if obj.mesh == None:
continue
obj.mesh.vertexes -= numpy.array([minV[0] + (maxV[0] - minV[0]) / 2, minV[1] + (maxV[1] - minV[1]) / 2, minV[2]])
#for v in obj.mesh.vertexes:
# v[2] -= minV[2]
# v[0] -= minV[0] + (maxV[0] - minV[0]) / 2
# v[1] -= minV[1] + (maxV[1] - minV[1]) / 2
obj.mesh.getMinimumZ()
obj.dirty = True
self.glCanvas.Refresh()
开发者ID:bwattendorf,项目名称:Cura,代码行数:40,代码来源:preview3d.py
示例6: updateModelTransform
def updateModelTransform(self, f=0):
if len(self.objectList) < 1 or self.objectList[0].mesh == None:
return
rotate = profile.getProfileSettingFloat('model_rotate_base')
mirrorX = profile.getProfileSetting('flip_x') == 'True'
mirrorY = profile.getProfileSetting('flip_y') == 'True'
mirrorZ = profile.getProfileSetting('flip_z') == 'True'
swapXZ = profile.getProfileSetting('swap_xz') == 'True'
swapYZ = profile.getProfileSetting('swap_yz') == 'True'
for obj in self.objectList:
if obj.mesh == None:
continue
obj.mesh.setRotateMirror(rotate, mirrorX, mirrorY, mirrorZ, swapXZ, swapYZ)
minV = self.objectList[0].mesh.getMinimum()
maxV = self.objectList[0].mesh.getMaximum()
for obj in self.objectList:
if obj.mesh == None:
continue
obj.mesh.getMinimumZ()
minV = minV.min(obj.mesh.getMinimum())
maxV = maxV.max(obj.mesh.getMaximum())
self.objectsMaxV = maxV
self.objectsMinV = minV
for obj in self.objectList:
if obj.mesh == None:
continue
for v in obj.mesh.vertexes:
v.z -= minV.z
v.x -= minV.x + (maxV.x - minV.x) / 2
v.y -= minV.y + (maxV.y - minV.y) / 2
obj.mesh.getMinimumZ()
obj.dirty = True
self.glCanvas.Refresh()
开发者ID:danilke,项目名称:Cura,代码行数:39,代码来源:preview3d.py
示例7: updateProfileToControls
def updateProfileToControls(self):
self.scale.SetValue(profile.getProfileSetting('model_scale'))
self.rotate.SetValue(profile.getProfileSettingFloat('model_rotate_base'))
self.mirrorX.SetValue(profile.getProfileSetting('flip_x') == 'True')
self.mirrorY.SetValue(profile.getProfileSetting('flip_y') == 'True')
self.mirrorZ.SetValue(profile.getProfileSetting('flip_z') == 'True')
self.swapXZ.SetValue(profile.getProfileSetting('swap_xz') == 'True')
self.swapYZ.SetValue(profile.getProfileSetting('swap_yz') == 'True')
self.updateModelTransform()
开发者ID:danilke,项目名称:Cura,代码行数:9,代码来源:preview3d.py
示例8: __init__
def __init__(self, parent):
super(UltimakerCalibrationPage, self).__init__(parent, "Ultimaker Calibration")
self.AddText("Your Ultimaker requires some calibration.")
self.AddText("This calibration is needed for a proper extrusion amount.")
self.AddSeperator()
self.AddText("The following values are needed:")
self.AddText("* Diameter of filament")
self.AddText("* Number of steps per mm of filament extrusion")
self.AddSeperator()
self.AddText("The better you have calibrated these values, the better your prints\nwill become.")
self.AddSeperator()
self.AddText("First we need the diameter of your filament:")
self.filamentDiameter = self.AddTextCtrl(profile.getProfileSetting('filament_diameter'))
self.AddText("If you do not own digital Calipers that can measure\nat least 2 digits then use 2.89mm.\nWhich is the average diameter of most filament.")
self.AddText("Note: This value can be changed later at any time.")
开发者ID:PKartaviy,项目名称:Cura,代码行数:16,代码来源:configWizard.py
示例9: StoreData
def StoreData(self):
if self.UltimakerRadio.GetValue():
profile.putPreference("machine_width", "205")
profile.putPreference("machine_depth", "205")
profile.putPreference("machine_height", "200")
profile.putProfileSetting("nozzle_size", "0.4")
profile.putProfileSetting("machine_center_x", "100")
profile.putProfileSetting("machine_center_y", "100")
else:
profile.putPreference("machine_width", "80")
profile.putPreference("machine_depth", "80")
profile.putPreference("machine_height", "60")
profile.putProfileSetting("nozzle_size", "0.5")
profile.putProfileSetting("machine_center_x", "40")
profile.putProfileSetting("machine_center_y", "40")
profile.putProfileSetting("wall_thickness", float(profile.getProfileSetting("nozzle_size")) * 2)
开发者ID:greenarrow,项目名称:Cura,代码行数:16,代码来源:configWizard.py
示例10: StoreData
def StoreData(self):
if self.UltimakerRadio.GetValue():
profile.putPreference('machine_width', '205')
profile.putPreference('machine_depth', '205')
profile.putPreference('machine_height', '200')
profile.putProfileSetting('nozzle_size', '0.4')
profile.putProfileSetting('machine_center_x', '100')
profile.putProfileSetting('machine_center_y', '100')
else:
profile.putPreference('machine_width', '80')
profile.putPreference('machine_depth', '80')
profile.putPreference('machine_height', '60')
profile.putProfileSetting('nozzle_size', '0.5')
profile.putProfileSetting('machine_center_x', '40')
profile.putProfileSetting('machine_center_y', '40')
profile.putProfileSetting('wall_thickness', float(profile.getProfileSetting('nozzle_size')) * 2)
开发者ID:felipesanches,项目名称:Cura,代码行数:16,代码来源:configWizard.py
示例11: raftLayerCount
def raftLayerCount(setting):
if profile.getProfileSetting('enable_raft') == "True":
return '1'
return '0'
开发者ID:darkomen,项目名称:Cura,代码行数:4,代码来源:settings.py
示例12: ifSettingIs
def ifSettingIs(name, value):
return lambda setting: profile.getProfileSetting(name) == value
开发者ID:darkomen,项目名称:Cura,代码行数:2,代码来源:settings.py
示例13: storedSettingInvertBoolean
def storedSettingInvertBoolean(name):
return lambda setting: profile.getProfileSetting(name) == "False"
开发者ID:darkomen,项目名称:Cura,代码行数:2,代码来源:settings.py
示例14: storedSetting
def storedSetting(name):
return lambda setting: profile.getProfileSetting(name)
开发者ID:darkomen,项目名称:Cura,代码行数:2,代码来源:settings.py
示例15: __init__
def __init__(self, parent):
super(previewPanel, self).__init__(parent,-1)
self.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_3DDKSHADOW))
self.SetMinSize((440,320))
self.objectList = []
self.errorList = []
self.gcode = None
self.objectsMinV = None
self.objectsMaxV = None
self.loadThread = None
self.machineSize = util3d.Vector3(profile.getPreferenceFloat('machine_width'), profile.getPreferenceFloat('machine_depth'), profile.getPreferenceFloat('machine_height'))
self.machineCenter = util3d.Vector3(float(profile.getProfileSetting('machine_center_x')), float(profile.getProfileSetting('machine_center_y')), 0)
self.glCanvas = PreviewGLCanvas(self)
#Create the popup window
self.warningPopup = wx.PopupWindow(self, flags=wx.BORDER_SIMPLE)
self.warningPopup.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_INFOBK))
self.warningPopup.text = wx.StaticText(self.warningPopup, -1, 'Reset scale, rotation and mirror?')
self.warningPopup.yesButton = wx.Button(self.warningPopup, -1, 'yes', style=wx.BU_EXACTFIT)
self.warningPopup.noButton = wx.Button(self.warningPopup, -1, 'no', style=wx.BU_EXACTFIT)
self.warningPopup.sizer = wx.BoxSizer(wx.HORIZONTAL)
self.warningPopup.SetSizer(self.warningPopup.sizer)
self.warningPopup.sizer.Add(self.warningPopup.text, 1, flag=wx.ALL|wx.ALIGN_CENTER_VERTICAL, border=1)
self.warningPopup.sizer.Add(self.warningPopup.yesButton, 0, flag=wx.EXPAND|wx.ALL, border=1)
self.warningPopup.sizer.Add(self.warningPopup.noButton, 0, flag=wx.EXPAND|wx.ALL, border=1)
self.warningPopup.Fit()
self.warningPopup.Layout()
self.warningPopup.timer = wx.Timer(self)
self.Bind(wx.EVT_TIMER, self.OnHideWarning, self.warningPopup.timer)
self.Bind(wx.EVT_BUTTON, self.OnResetAll, self.warningPopup.yesButton)
self.Bind(wx.EVT_BUTTON, self.OnHideWarning, self.warningPopup.noButton)
parent.Bind(wx.EVT_MOVE, self.OnMove)
parent.Bind(wx.EVT_SIZE, self.OnMove)
self.toolbar = toolbarUtil.Toolbar(self)
group = []
toolbarUtil.RadioButton(self.toolbar, group, 'object-3d-on.png', 'object-3d-off.png', '3D view', callback=self.On3DClick)
toolbarUtil.RadioButton(self.toolbar, group, 'object-top-on.png', 'object-top-off.png', 'Topdown view', callback=self.OnTopClick)
self.toolbar.AddSeparator()
self.showBorderButton = toolbarUtil.ToggleButton(self.toolbar, '', 'view-border-on.png', 'view-border-off.png', 'Show model borders', callback=self.OnViewChange)
self.toolbar.AddSeparator()
group = []
self.normalViewButton = toolbarUtil.RadioButton(self.toolbar, group, 'view-normal-on.png', 'view-normal-off.png', 'Normal model view', callback=self.OnViewChange)
self.transparentViewButton = toolbarUtil.RadioButton(self.toolbar, group, 'view-transparent-on.png', 'view-transparent-off.png', 'Transparent model view', callback=self.OnViewChange)
self.xrayViewButton = toolbarUtil.RadioButton(self.toolbar, group, 'view-xray-on.png', 'view-xray-off.png', 'X-Ray view', callback=self.OnViewChange)
self.gcodeViewButton = toolbarUtil.RadioButton(self.toolbar, group, 'view-gcode-on.png', 'view-gcode-off.png', 'GCode view', callback=self.OnViewChange)
self.mixedViewButton = toolbarUtil.RadioButton(self.toolbar, group, 'view-mixed-on.png', 'view-mixed-off.png', 'Mixed model/GCode view', callback=self.OnViewChange)
self.toolbar.AddSeparator()
self.layerSpin = wx.SpinCtrl(self.toolbar, -1, '', size=(21*4,21), style=wx.SP_ARROW_KEYS)
self.toolbar.AddControl(self.layerSpin)
self.Bind(wx.EVT_SPINCTRL, self.OnLayerNrChange, self.layerSpin)
self.toolbar2 = toolbarUtil.Toolbar(self)
# Mirror
self.mirrorX = toolbarUtil.ToggleButton(self.toolbar2, 'flip_x', 'object-mirror-x-on.png', 'object-mirror-x-off.png', 'Mirror X', callback=self.updateModelTransform)
self.mirrorY = toolbarUtil.ToggleButton(self.toolbar2, 'flip_y', 'object-mirror-y-on.png', 'object-mirror-y-off.png', 'Mirror Y', callback=self.updateModelTransform)
self.mirrorZ = toolbarUtil.ToggleButton(self.toolbar2, 'flip_z', 'object-mirror-z-on.png', 'object-mirror-z-off.png', 'Mirror Z', callback=self.updateModelTransform)
self.toolbar2.AddSeparator()
# Swap
self.swapXZ = toolbarUtil.ToggleButton(self.toolbar2, 'swap_xz', 'object-swap-xz-on.png', 'object-swap-xz-off.png', 'Swap XZ', callback=self.updateModelTransform)
self.swapYZ = toolbarUtil.ToggleButton(self.toolbar2, 'swap_yz', 'object-swap-yz-on.png', 'object-swap-yz-off.png', 'Swap YZ', callback=self.updateModelTransform)
self.toolbar2.AddSeparator()
# Scale
self.scaleReset = toolbarUtil.NormalButton(self.toolbar2, self.OnScaleReset, 'object-scale.png', 'Reset model scale')
self.scale = wx.TextCtrl(self.toolbar2, -1, profile.getProfileSetting('model_scale'), size=(21*2,21))
self.toolbar2.AddControl(self.scale)
self.scale.Bind(wx.EVT_TEXT, self.OnScale)
self.scaleMax = toolbarUtil.NormalButton(self.toolbar2, self.OnScaleMax, 'object-max-size.png', 'Scale object to fit machine size')
self.toolbar2.AddSeparator()
# Multiply
#self.mulXadd = toolbarUtil.NormalButton(self.toolbar2, self.OnMulXAddClick, 'object-mul-x-add.png', 'Increase number of models on X axis')
#self.mulXsub = toolbarUtil.NormalButton(self.toolbar2, self.OnMulXSubClick, 'object-mul-x-sub.png', 'Decrease number of models on X axis')
#self.mulYadd = toolbarUtil.NormalButton(self.toolbar2, self.OnMulYAddClick, 'object-mul-y-add.png', 'Increase number of models on Y axis')
#self.mulYsub = toolbarUtil.NormalButton(self.toolbar2, self.OnMulYSubClick, 'object-mul-y-sub.png', 'Decrease number of models on Y axis')
#self.toolbar2.AddSeparator()
# Rotate
self.rotateReset = toolbarUtil.NormalButton(self.toolbar2, self.OnRotateReset, 'object-rotate.png', 'Reset model rotation')
self.rotate = wx.SpinCtrl(self.toolbar2, -1, profile.getProfileSetting('model_rotate_base'), size=(21*3,21), style=wx.SP_WRAP|wx.SP_ARROW_KEYS)
self.rotate.SetRange(0, 360)
self.rotate.Bind(wx.EVT_TEXT, self.OnRotate)
self.toolbar2.AddControl(self.rotate)
self.toolbar2.Realize()
self.OnViewChange()
sizer = wx.BoxSizer(wx.VERTICAL)
sizer.Add(self.toolbar, 0, flag=wx.EXPAND|wx.TOP|wx.LEFT|wx.RIGHT, border=1)
#.........这里部分代码省略.........
开发者ID:bwattendorf,项目名称:Cura,代码行数:101,代码来源:preview3d.py
示例16: OnDraw
def OnDraw(self):
machineSize = self.parent.machineSize
opengl.DrawMachine(machineSize)
extraSizeMin = self.parent.headSizeMin
extraSizeMax = self.parent.headSizeMax
if profile.getProfileSettingFloat('skirt_line_count') > 0:
skirtSize = profile.getProfileSettingFloat('skirt_line_count') * profile.calculateEdgeWidth() + profile.getProfileSettingFloat('skirt_gap')
extraSizeMin = extraSizeMin + util3d.Vector3(skirtSize, skirtSize, 0)
extraSizeMax = extraSizeMax + util3d.Vector3(skirtSize, skirtSize, 0)
if profile.getProfileSetting('support') != 'None':
extraSizeMin = extraSizeMin + util3d.Vector3(3.0, 0, 0)
extraSizeMax = extraSizeMax + util3d.Vector3(3.0, 0, 0)
if self.parent.printMode == 1:
extraSizeMin = util3d.Vector3(6.0, 6.0, 0)
extraSizeMax = util3d.Vector3(6.0, 6.0, 0)
for item in self.parent.list:
item.validPlacement = True
item.gotHit = False
for idx1 in xrange(0, len(self.parent.list)):
item = self.parent.list[idx1]
iMin1 = item.getMinimum() * item.scale + util3d.Vector3(item.centerX, item.centerY, 0) - extraSizeMin - self.parent.extruderOffset[item.extruder]
iMax1 = item.getMaximum() * item.scale + util3d.Vector3(item.centerX, item.centerY, 0) + extraSizeMax - self.parent.extruderOffset[item.extruder]
for idx2 in xrange(0, idx1):
item2 = self.parent.list[idx2]
iMin2 = item2.getMinimum() * item2.scale + util3d.Vector3(item2.centerX, item2.centerY, 0)
iMax2 = item2.getMaximum() * item2.scale + util3d.Vector3(item2.centerX, item2.centerY, 0)
if item != item2 and iMax1.x >= iMin2.x and iMin1.x <= iMax2.x and iMax1.y >= iMin2.y and iMin1.y <= iMax2.y:
item.validPlacement = False
item2.gotHit = True
seenSelected = False
for item in self.parent.list:
if item == self.parent.selection:
seenSelected = True
if item.modelDisplayList == None:
item.modelDisplayList = glGenLists(1);
if item.modelDirty:
item.modelDirty = False
modelSize = item.getMaximum() - item.getMinimum()
glNewList(item.modelDisplayList, GL_COMPILE)
opengl.DrawSTL(item)
glEndList()
if item.validPlacement:
if self.parent.selection == item:
glLightfv(GL_LIGHT0, GL_DIFFUSE, [1.0, 0.9, 0.7, 1.0])
glLightfv(GL_LIGHT0, GL_AMBIENT, [0.2, 0.3, 0.2, 0.0])
else:
glLightfv(GL_LIGHT0, GL_DIFFUSE, [1.0, 0.8, 0.6, 1.0])
glLightfv(GL_LIGHT0, GL_AMBIENT, [0.2, 0.1, 0.1, 0.0])
else:
if self.parent.selection == item:
glLightfv(GL_LIGHT0, GL_DIFFUSE, [1.0, 0.0, 0.0, 0.0])
glLightfv(GL_LIGHT0, GL_AMBIENT, [0.2, 0.0, 0.0, 0.0])
else:
glLightfv(GL_LIGHT0, GL_DIFFUSE, [1.0, 0.0, 0.0, 0.0])
glLightfv(GL_LIGHT0, GL_AMBIENT, [0.2, 0.0, 0.0, 0.0])
glPushMatrix()
glEnable(GL_LIGHTING)
glTranslate(item.centerX, item.centerY, 0)
glPushMatrix()
glEnable(GL_NORMALIZE)
glScalef(item.scale, item.scale, item.scale)
glCallList(item.modelDisplayList)
glPopMatrix()
vMin = item.getMinimum() * item.scale
vMax = item.getMaximum() * item.scale
vMinHead = vMin - extraSizeMin - self.parent.extruderOffset[item.extruder]
vMaxHead = vMax + extraSizeMax - self.parent.extruderOffset[item.extruder]
glDisable(GL_LIGHTING)
if self.parent.selection == item:
if item.gotHit:
glColor3f(1.0,0.0,0.3)
else:
glColor3f(1.0,0.0,1.0)
opengl.DrawBox(vMin, vMax)
if item.gotHit:
glColor3f(1.0,0.3,0.0)
else:
glColor3f(1.0,1.0,0.0)
opengl.DrawBox(vMinHead, vMaxHead)
elif seenSelected:
if item.gotHit:
glColor3f(0.5,0.0,0.1)
else:
glColor3f(0.5,0.0,0.5)
opengl.DrawBox(vMinHead, vMaxHead)
else:
if item.gotHit:
glColor3f(0.7,0.1,0.0)
else:
glColor3f(0.7,0.7,0.0)
opengl.DrawBox(vMin, vMax)
#.........这里部分代码省略.........
开发者ID:danilke,项目名称:Cura,代码行数:101,代码来源:projectPlanner.py
示例17: getSliceCommand
def getSliceCommand(filename):
if profile.getPreference('slicer').startswith('Slic3r') and getSlic3rExe() != False:
slic3rExe = getSlic3rExe()
if slic3rExe == False:
return False
cmd = [slic3rExe,
'--output-filename-format', '[input_filename_base]_export.gcode',
'--nozzle-diameter', str(profile.calculateEdgeWidth()),
'--print-center', '%s,%s' % (profile.getProfileSetting('machine_center_x'), profile.getProfileSetting('machine_center_y')),
'--z-offset', '0',
'--gcode-flavor', 'reprap',
'--gcode-comments',
'--filament-diameter', profile.getProfileSetting('filament_diameter'),
'--extrusion-multiplier', str(1.0 / float(profile.getProfileSetting('filament_density'))),
'--temperature', profile.getProfileSetting('print_temperature'),
'--travel-speed', profile.getProfileSetting('travel_speed'),
'--perimeter-speed', profile.getProfileSetting('print_speed'),
'--small-perimeter-speed', profile.getProfileSetting('print_speed'),
'--infill-speed', profile.getProfileSetting('print_speed'),
'--solid-infill-speed', profile.getProfileSetting('print_speed'),
'--bridge-speed', profile.getProfileSetting('print_speed'),
'--bottom-layer-speed-ratio', str(float(profile.getProfileSetting('bottom_layer_speed')) / float(profile.getProfileSetting('print_speed'))),
'--layer-height', profile.getProfileSetting('layer_height'),
'--first-layer-height-ratio', '1.0',
'--infill-every-layers', '1',
'--perimeters', str(profile.calculateLineCount()),
'--solid-layers', str(profile.calculateSolidLayerCount()),
'--fill-density', str(float(profile.getProfileSetting('fill_density'))/100),
'--fill-angle', '45',
'--fill-pattern', 'rectilinear', #rectilinear line concentric hilbertcurve archimedeanchords octagramspiral
'--solid-fill-pattern', 'rectilinear',
'--start-gcode', profile.getAlterationFilePath('start.gcode'),
'--end-gcode', profile.getAlterationFilePath('end.gcode'),
'--retract-length', profile.getProfileSetting('retraction_amount'),
'--retract-speed', str(int(float(profile.getProfileSetting('retraction_speed')))),
'--retract-restart-extra', profile.getProfileSetting('retraction_extra'),
'--retract-before-travel', profile.getProfileSetting('retraction_min_travel'),
'--retract-lift', '0',
'--slowdown-below-layer-time', profile.getProfileSetting('cool_min_layer_time'),
'--min-print-speed', profile.getProfileSetting('cool_min_feedrate'),
'--skirts', profile.getProfileSetting('skirt_line_count'),
'--skirt-distance', str(int(float(profile.getProfileSetting('skirt_gap')))),
'--skirt-height', '1',
'--scale', profile.getProfileSetting('model_scale'),
'--rotate', profile.getProfileSetting('model_rotate_base'),
'--duplicate-x', profile.getProfileSetting('model_multiply_x'),
'--duplicate-y', profile.getProfileSetting('model_multiply_y'),
'--duplicate-distance', '10']
if profile.getProfileSetting('support') != 'None':
cmd.extend(['--support-material'])
cmd.extend([filename])
return cmd
else:
pypyExe = getPyPyExe()
if pypyExe == False:
pypyExe = sys.executable
#In case we have a frozen exe, then argv[0] points to the executable, but we want to give pypy a real script file.
if hasattr(sys, 'frozen'):
mainScriptFile = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), "../..", "cura_sf.zip"))
else:
mainScriptFile = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", os.path.split(sys.argv[0])[1]))
cmd = [pypyExe, mainScriptFile, '-p', profile.getGlobalProfileString()]
if platform.system() == "Windows":
try:
cmd.append(str(filename))
except UnicodeEncodeError:
cmd.append("#UTF8#" + filename.encode("utf-8"))
else:
cmd.append(filename)
return cmd
开发者ID:danilke,项目名称:Cura,代码行数:71,代码来源:sliceRun.py
示例18: __init__
def __init__(self):
super(simpleModeWindow, self).__init__(title='Cura - Quickprint - ' + version.getVersion())
wx.EVT_CLOSE(self, self.OnClose)
#self.SetIcon(icon.getMainIcon())
menubar = wx.MenuBar()
fileMenu = wx.Menu()
i = fileMenu.Append(-1, 'Load model file...')
self.Bind(wx.EVT_MENU, self.OnLoadModel, i)
fileMenu.AppendSeparator()
i = fileMenu.Append(-1, 'Preferences...')
self.Bind(wx.EVT_MENU, self.OnPreferences, i)
fileMenu.AppendSeparator()
i = fileMenu.Append(wx.ID_EXIT, 'Quit')
self.Bind(wx.EVT_MENU, self.OnQuit, i)
menubar.Append(fileMenu, '&File')
expertMenu = wx.Menu()
i = expertMenu.Append(-1, 'Switch to Normal mode...')
self.Bind(wx.EVT_MENU, self.OnNormalSwitch, i)
expertMenu.AppendSeparator()
i = expertMenu.Append(-1, 'ReRun first run wizard...')
self.Bind(wx.EVT_MENU, self.OnFirstRunWizard, i)
menubar.Append(expertMenu, 'Expert')
helpMenu = wx.Menu()
i = helpMenu.Append(-1, 'Online documentation...')
self.Bind(wx.EVT_MENU, lambda e: webbrowser.open('https://github.com/daid/Cura/wiki'), i)
i = helpMenu.Append(-1, 'Report a problem...')
self.Bind(wx.EVT_MENU, lambda e: webbrowser.open('https://github.com/daid/Cura/issues'), i)
menubar.Append(helpMenu, 'Help')
self.SetMenuBar(menubar)
if profile.getPreference('lastFile') != '':
self.filelist = profile.getPreference('lastFile').split(';')
self.SetTitle(self.filelist[-1] + ' - Cura - ' + version.getVersion())
else:
self.filelist = []
self.progressPanelList = []
#Preview window
self.preview3d = preview3d.previewPanel(self)
configPanel = wx.Panel(self)
self.printTypeNormal = wx.RadioButton(configPanel, -1, 'Normal quality print', style=wx.RB_GROUP)
self.printTypeLow = wx.RadioButton(configPanel, -1, 'Fast low quality print')
self.printTypeHigh = wx.RadioButton(configPanel, -1, 'High quality print')
self.printTypeJoris = wx.RadioButton(configPanel, -1, 'Thin walled cup or vase')
self.printMaterialPLA = wx.RadioButton(configPanel, -1, 'PLA', style=wx.RB_GROUP)
self.printMaterialABS = wx.RadioButton(configPanel, -1, 'ABS')
self.printMaterialDiameter = wx.TextCtrl(configPanel, -1, profile.getProfileSetting('filament_diameter'))
self.printSupport = wx.CheckBox(configPanel, -1, 'Print support structure')
sizer = wx.GridBagSizer()
configPanel.SetSizer(sizer)
sb = wx.StaticBox(configPanel, label="Select a print type:")
boxsizer = wx.StaticBoxSizer(sb, wx.VERTICAL)
boxsizer.Add(self.printTypeNormal)
boxsizer.Add(self.printTypeLow)
boxsizer.Add(self.printTypeHigh)
boxsizer.Add(self.printTypeJoris)
sizer.Add(boxsizer, (0,0), flag=wx.EXPAND)
sb = wx.StaticBox(configPanel, label="Material:")
boxsizer = wx.StaticBoxSizer(sb, wx.VERTICAL)
boxsizer.Add(self.printMaterialPLA)
boxsizer.Add(self.printMaterialABS)
boxsizer.Add(wx.StaticText(configPanel, -1, 'Diameter:'))
boxsizer.Add(self.printMaterialDiameter)
sizer.Add(boxsizer, (1,0), flag=wx.EXPAND)
sb = wx.StaticBox(configPanel, label="Other:")
boxsizer = wx.StaticBoxSizer(sb, wx.VERTICAL)
boxsizer.Add(self.printSupport)
sizer.Add(boxsizer, (2,0), flag=wx.EXPAND)
# load and slice buttons.
loadButton = wx.Button(self, -1, 'Load Model')
sliceButton = wx.Button(self, -1, 'Slice to GCode')
printButton = wx.Button(self, -1, 'Print GCode')
self.Bind(wx.EVT_BUTTON, self.OnLoadModel, loadButton)
self.Bind(wx.EVT_BUTTON, self.OnSlice, sliceButton)
self.Bind(wx.EVT_BUTTON, self.OnPrint, printButton)
#Also bind double clicking the 3D preview to load an STL file.
self.preview3d.glCanvas.Bind(wx.EVT_LEFT_DCLICK, self.OnLoadModel, self.preview3d.glCanvas)
#Main sizer, to position the preview window, buttons and tab control
sizer = wx.GridBagSizer()
self.SetSizer(sizer)
sizer.Add(configPanel, (0,0), span=(1,1), flag=wx.EXPAND)
sizer.Add(self.preview3d, (0,1), span=(1,3), flag=wx.EXPAND)
sizer.AddGrowableCol(2)
sizer.AddGrowableRow(0)
sizer.Add(loadButton, (1,1), flag=wx.RIGHT, border=5)
sizer.Add(sliceButton, (1,2), flag=wx.RIGHT, border=5)
sizer.Add(printButton, (1,3), flag=wx.RIGHT, border=5)
#.........这里部分代码省略.........
开发者ID:felipesanches,项目名称:Cura,代码行数:101,代码来源:simpleMode.py
示例19: raftLayerCount
def raftLayerCount(setting):
if profile.getProfileSetting("enable_raft") == "True":
return "1"
return "0"
开发者ID:younew,项目名称:Cura,代码行数:4,代码来源:settings.py
示例20: getProfileInformation
#.........这里部分代码省略.........
'Object_First_Layer_Infill_Temperature_Celcius': DEFSET,#storedSettingFloat("print_temperature"),
'Object_First_Layer_Perimeter_Temperature_Celcius': DEFSET,#storedSettingFloat("print_temperature"),
'Object_Next_Layers_Temperature_Celcius': DEFSET,#storedSettingFloat("print_temperature"),
'Support_Layers_Temperature_Celcius': DEFSET,#storedSettingFloat("print_temperature"),
'Supported_Layers_Temperature_Celcius': DEFSET,#storedSettingFloat("print_temperature"),
},'raft': {
'Activate_Raft': "True",
'Add_Raft,_Elevate_Nozzle,_Orbit': DEFSET,
'Base_Feed_Rate_Multiplier_ratio': DEFSET,
'Base_Flow_Rate_Multiplier_ratio': storedPercentSetting('raft_base_material_amount'),
'Base_Infill_Density_ratio': DEFSET,
'Base_Layer_Thickness_over_Layer_Thickness': DEFSET,
'Base_Layers_integer': raftLayerCount,
'Base_Nozzle_Lift_over_Base_Layer_Thickness_ratio': DEFSET,
'Initial_Circling': DEFSET,
'Infill_Overhang_over_Extrusion_Width_ratio': DEFSET,
'Interface_Feed_Rate_Multiplier_ratio': DEFSET,
'Interface_Flow_Rate_Multiplier_ratio': storedPercentSetting('raft_interface_material_amount'),
'Interface_Infill_Density_ratio': DEFSET,
'Interface_Layer_Thickness_over_Layer_Thickness': DEFSET,
'Interface_Layers_integer': raftLayerCount,
'Interface_Nozzle_Lift_over_Interface_Layer_Thickness_ratio': DEFSET,
'Name_of_Support_End_File': DEFSET,
'Name_of_Support_Start_File': DEFSET,
'Operating_Nozzle_Lift_over_Layer_Thickness_ratio': DEFSET,
'Raft_Additional_Margin_over_Length_%': DEFSET,
'Raft_Margin_mm': storedSettingFloat('raft_margin'),
'Support_Cross_Hatch': 'False',
'Support_Flow_Rate_over_Operating_Flow_Rate_ratio': storedPercentSetting('support_rate'),
'Support_Gap_over_Perimeter_Extrusion_Width_ratio': calcSupportDistanceRatio,
'Support_Material_Choice_': storedSetting('support'),
'Support_Minimum_Angle_degrees': DEFSET,
'Support_Margin_mm': '3.0',
'Support_Offset_X_mm': lambda setting: -profile.getPreferenceFloat('extruder_offset_x1') if profile.getProfileSetting('support_dual_extrusion') == 'True' and int(profile.getPreference('extruder_amount')) > 1 else '0',
'Support_Offset_Y_mm': lambda setting: -profile.getPreferenceFloat('extruder_offset_y1') if profile.getProfileSetting('support_dual_extrusion') == 'True' and int(profile.getPreference('extruder_amount')) > 1 else '0',
},'skirt': {
'Skirt_line_count': storedSetting("skirt_line_count"),
'Convex': "True",
'Gap_Width_mm': storedSetting("skirt_gap"),
'Layers_To_index': "1",
},'joris': {
'Activate_Joris': storedSetting("joris"),
'Layers_From_index': calculateSolidLayerCount,
},'chamber': {
'Activate_Chamber': "False",
'Bed_Temperature_Celcius': DEFSET,
'Bed_Temperature_Begin_Change_Height_mm': DEFSET,
'Bed_Temperature_End_Change_Height_mm': DEFSET,
'Bed_Temperature_End_Celcius': DEFSET,
'Chamber_Temperature_Celcius': DEFSET,
'Holding_Force_bar': DEFSET,
},'tower': {
'Activate_Tower': "False",
'Extruder_Possible_Collision_Cone_Angle_degrees': DEFSET,
'Maximum_Tower_Height_layers': DEFSET,
'Tower_Start_Layer_integer': DEFSET,
},'jitter': {
'Activate_Jitter': "False",
'Jitter_Over_Perimeter_Width_ratio': DEFSET,
},'clip': {
'Activate_Clip': "False",
'Clip_Over_Perimeter_Width_ratio': DEFSET,
'Maximum_Connection_Distance_Over_Perimeter_Width_ratio': DEFSET,
},'smooth': {
'Activate_Smooth': "False",
'Layers_From_index': DEFSET,
开发者ID:darkomen,项目名称:Cura,代码行数:67,代码来源:settings.py
注:本文中的util.profile.getProfileSetting函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论