• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python profile.putPreference函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: __init__

	def __init__(self, parent):
		super(UltimakerCalibrateStepsPerEPage, self).__init__(parent, "Ultimaker Calibration")

		if profile.getPreference('steps_per_e') == '0':
			profile.putPreference('steps_per_e', '865.888')
		
		self.AddText("Calibrating the Steps Per E requires some manual actions.")
		self.AddText("First remove any filament from your machine.")
		self.AddText("Next put in your filament so the tip is aligned with the\ntop of the extruder drive.")
		self.AddText("We'll push the filament 100mm")
		self.extrudeButton = self.AddButton("Extrude 100mm filament")
		self.AddText("Now measure the amount of extruded filament:\n(this can be more or less then 100mm)")
		p = wx.Panel(self)
		p.SetSizer(wx.BoxSizer(wx.HORIZONTAL))
		self.lengthInput = wx.TextCtrl(p, -1, '100')
		p.GetSizer().Add(self.lengthInput, 0, wx.RIGHT, 8)
		self.saveLengthButton = wx.Button(p, -1, 'Save')
		p.GetSizer().Add(self.saveLengthButton, 0)
		self.GetSizer().Add(p, 0, wx.LEFT, 5)
		self.AddText("This results in the following steps per E:")
		self.stepsPerEInput = wx.TextCtrl(self, -1, profile.getPreference('steps_per_e'))
		self.GetSizer().Add(self.stepsPerEInput, 0, wx.LEFT, 5)
		self.AddText("You can repeat these steps to get better calibration.")
		self.AddSeperator()
		self.AddText("If you still have filament in your printer which needs\nheat to remove, press the heat up button below:")
		self.heatButton = self.AddButton("Heatup for filament removal")
		
		self.saveLengthButton.Bind(wx.EVT_BUTTON, self.OnSaveLengthClick)
		self.extrudeButton.Bind(wx.EVT_BUTTON, self.OnExtrudeClick)
		self.heatButton.Bind(wx.EVT_BUTTON, self.OnHeatClick)
开发者ID:custodian,项目名称:Cura,代码行数:30,代码来源:configWizard.py


示例2: main

def main():
	parser = OptionParser(usage="usage: %prog [options] <filename>.stl")
	parser.add_option("-i", "--ini", action="store", type="string", dest="profileini", help="Load settings from a profile ini file")
	parser.add_option("-P", "--project", action="store_true", dest="openprojectplanner", help="Open the project planner")
	parser.add_option("-F", "--flat", action="store_true", dest="openflatslicer", help="Open the 2D SVG slicer (unfinished)")
	parser.add_option("-r", "--print", action="store", type="string", dest="printfile", help="Open the printing interface, instead of the normal cura interface.")
	parser.add_option("-p", "--profile", action="store", type="string", dest="profile", help="Internal option, do not use!")
	parser.add_option("-s", "--slice", action="store_true", dest="slice", help="Slice the given files instead of opening them in Cura")
	(options, args) = parser.parse_args()
	if options.profile != None:
		profile.loadGlobalProfileFromString(options.profile)
	if options.profileini != None:
		profile.loadGlobalProfile(options.profileini)
	if options.openprojectplanner != None:
		from gui import projectPlanner
		projectPlanner.main()
		return
	if options.openflatslicer != None:
		from gui import flatSlicerWindow
		flatSlicerWindow.main()
		return
	if options.printfile != None:
		from gui import printWindow
		printWindow.startPrintInterface(options.printfile)
		return

	if options.slice != None:
		from util import sliceRun
		sliceRun.runSlice(args)
	else:
		if len(args) > 0:
			profile.putPreference('lastFile', ';'.join(args))
		from gui import splashScreen
		splashScreen.showSplash(mainWindowRunCallback)
开发者ID:PKartaviy,项目名称:Cura,代码行数:34,代码来源:cura.py


示例3: OnSettingChange

	def OnSettingChange(self, e):
		if self.type == 'profile':
			profile.putProfileSetting(self.configName, self.GetValue())
		else:
			profile.putPreference(self.configName, self.GetValue())
		result = validators.SUCCESS
		msgs = []
		for validator in self.validators:
			res, err = validator.validate()
			if res == validators.ERROR:
				result = res
			elif res == validators.WARNING and result != validators.ERROR:
				result = res
			if res != validators.SUCCESS:
				msgs.append(err)
		if result == validators.ERROR:
			self.ctrl.SetBackgroundColour('Red')
		elif result == validators.WARNING:
			self.ctrl.SetBackgroundColour('Yellow')
		else:
			self.ctrl.SetBackgroundColour(self.defaultBGColour)
		self.ctrl.Refresh()

		self.validationMsg = '\n'.join(msgs)
		self.panel.main.UpdatePopup(self)
开发者ID:CNCBASHER,项目名称:Cura,代码行数:25,代码来源:configBase.py


示例4: OnLoadModel

	def OnLoadModel(self, e):
		dlg=wx.FileDialog(self, "Open file to print", os.path.split(profile.getPreference('lastFile'))[0], style=wx.FD_OPEN|wx.FD_FILE_MUST_EXIST)
		dlg.SetWildcard("STL files (*.stl)|*.stl;*.STL")
		if dlg.ShowModal() == wx.ID_OK:
			self.filelist = [dlg.GetPath()]
			profile.putPreference('lastFile', ';'.join(self.filelist))
			self.preview3d.loadModelFiles(self.filelist)
			self.preview3d.setViewMode("Normal")
		dlg.Destroy()
开发者ID:felipesanches,项目名称:Cura,代码行数:9,代码来源:simpleMode.py


示例5: main

def main():
	#app = wx.App(False)
	if profile.getPreference('wizardDone') == 'False':
		configWizard.configWizard()
		profile.putPreference("wizardDone", "True")
	if profile.getPreference('startMode') == 'Simple':
		simpleMode.simpleModeWindow()
	else:
		mainWindow()
开发者ID:CNCBASHER,项目名称:Cura,代码行数:9,代码来源:mainWindow.py


示例6: OnDropFiles

	def OnDropFiles(self, filenames):
		for filename in filenames:
			item = ProjectObject(self, filename)
			profile.putPreference('lastFile', item.filename)
			self.list.append(item)
			self.selection = item
			self._updateListbox()
		self.OnListSelect(None)
		self.preview.Refresh()
开发者ID:custodian,项目名称:Cura,代码行数:9,代码来源:projectPlanner.py


示例7: OnAddModel

	def OnAddModel(self, e):
		dlg=wx.FileDialog(self, "Open file to batch slice", os.path.split(profile.getPreference('lastFile'))[0], style=wx.FD_OPEN|wx.FD_FILE_MUST_EXIST|wx.FD_MULTIPLE)
		dlg.SetWildcard("STL files (*.stl)|*.stl;*.STL")
		if dlg.ShowModal() == wx.ID_OK:
			for filename in dlg.GetPaths():
				profile.putPreference('lastFile', filename)
				self.list.append(filename)
				self.selection = filename
				self._updateListbox()
		dlg.Destroy()
开发者ID:custodian,项目名称:Cura,代码行数:10,代码来源:batchRun.py


示例8: main

def main():
    app = wx.App(False)
    if profile.getPreference("wizardDone") == "False":
        configWizard.configWizard()
        profile.putPreference("wizardDone", "True")
    if profile.getPreference("startMode") == "Simple":
        simpleMode.simpleModeWindow()
    else:
        mainWindow()
    app.MainLoop()
开发者ID:younew,项目名称:Cura,代码行数:10,代码来源:mainWindow.py


示例9: _showModelLoadDialog

	def _showModelLoadDialog(self, amount):
		filelist = []
		for i in xrange(0, amount):
			filelist.append(self._showOpenDialog("Open file to print"))
			if filelist[-1] == False:
				return
			self.SetTitle(filelist[-1] + ' - Cura - ' + version.getVersion())
		self.filelist = filelist
		profile.putPreference('lastFile', ';'.join(self.filelist))
		self.preview3d.loadModelFiles(self.filelist)
		self.preview3d.setViewMode("Normal")
开发者ID:felipesanches,项目名称:Cura,代码行数:11,代码来源:mainWindow.py


示例10: _showOpenDialog

	def _showOpenDialog(self, title, wildcard = meshLoader.wildcardFilter()):
		dlg=wx.FileDialog(self, title, os.path.split(profile.getPreference('lastFile'))[0], style=wx.FD_OPEN|wx.FD_FILE_MUST_EXIST)
		dlg.SetWildcard(wildcard)
		if dlg.ShowModal() == wx.ID_OK:
			filename = dlg.GetPath()
			dlg.Destroy()
			if not(os.path.exists(filename)):
				return False
			profile.putPreference('lastFile', filename)
			return filename
		dlg.Destroy()
		return False
开发者ID:festlv,项目名称:Cura,代码行数:12,代码来源:mainWindow.py


示例11: OnAddModel

	def OnAddModel(self, e):
		dlg=wx.FileDialog(self, "Open file to print", os.path.split(profile.getPreference('lastFile'))[0], style=wx.FD_OPEN|wx.FD_FILE_MUST_EXIST|wx.FD_MULTIPLE)
		dlg.SetWildcard("STL files (*.stl)|*.stl;*.STL")
		if dlg.ShowModal() == wx.ID_OK:
			for filename in dlg.GetPaths():
				item = ProjectObject(self, filename)
				profile.putPreference('lastFile', item.filename)
				self.list.append(item)
				self.selection = item
				self._updateListbox()
				self.OnListSelect(None)
		self.preview.Refresh()
		dlg.Destroy()
开发者ID:custodian,项目名称:Cura,代码行数:13,代码来源:projectPlanner.py


示例12: onLoad

	def onLoad(self, event):

		dlg = wx.FileDialog(self, "Open file to print", style=wx.FD_OPEN | wx.FD_FILE_MUST_EXIST)
		dlg.SetWildcard(meshLoader.wildcardFilter())

		if dlg.ShowModal() == wx.ID_OK:
			frame = self.GetParent().GetParent().GetParent()
			frame.filename = dlg.GetPath() 
			frame.step5_panel.ClearPrintSummary()
			profile.putPreference('lastFile', frame.filename)
			transform = frame.step2_panel
			transform.load(frame.filename)
			frame.onNext(None)
		dlg.Destroy()
开发者ID:xtarn,项目名称:Cura-v2,代码行数:14,代码来源:LoadPanel.py


示例13: _showOpenDialog

 def _showOpenDialog(self, title, wildcard="STL files (*.stl)|*.stl;*.STL"):
     dlg = wx.FileDialog(
         self, title, os.path.split(profile.getPreference("lastFile"))[0], style=wx.FD_OPEN | wx.FD_FILE_MUST_EXIST
     )
     dlg.SetWildcard(wildcard)
     if dlg.ShowModal() == wx.ID_OK:
         filename = dlg.GetPath()
         dlg.Destroy()
         if not (os.path.exists(filename)):
             return False
         profile.putPreference("lastFile", filename)
         return filename
     dlg.Destroy()
     return False
开发者ID:younew,项目名称:Cura,代码行数:14,代码来源:mainWindow.py


示例14: StoreData

	def StoreData(self):
		profile.putPreference('machine_width', self.machineWidth.GetValue())
		profile.putPreference('machine_depth', self.machineDepth.GetValue())
		profile.putPreference('machine_height', self.machineHeight.GetValue())
		profile.putProfileSetting('nozzle_size', self.nozzleSize.GetValue())
		profile.putProfileSetting('machine_center_x', profile.getPreferenceFloat('machine_width') / 2)
		profile.putProfileSetting('machine_center_y', profile.getPreferenceFloat('machine_depth') / 2)
		profile.putProfileSetting('wall_thickness', float(profile.getProfileSettingFloat('nozzle_size')) * 2)
		profile.putPreference('has_heated_bed', str(self.heatedBed.GetValue()))
开发者ID:PKartaviy,项目名称:Cura,代码行数:9,代码来源:configWizard.py


示例15: main

def main(splash):
	#app = wx.App(False)
	if profile.getPreference('machine_type') == 'unknown':
		if platform.system() == "Darwin":
			#Check if we need to copy our examples
			exampleFile = os.path.expanduser('~/CuraExamples/UltimakerRobot_support.stl')
			if not os.path.isfile(exampleFile):
				try:
					os.makedirs(os.path.dirname(exampleFile))
				except:
					pass
				for filename in glob.glob(os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', 'example', '*.*'))):
					shutil.copy(filename, os.path.join(os.path.dirname(exampleFile), os.path.basename(filename)))
				profile.putPreference('lastFile', exampleFile)
		splash.Show(False)
		configWizard.configWizard()
	if profile.getPreference('startMode') == 'Simple':
		simpleMode.simpleModeWindow()
	else:
		mainWindow()
开发者ID:flothesof,项目名称:Cura,代码行数:20,代码来源:mainWindow.py


示例16: __init__

	def __init__(self, port = None, baudrate = None, callbackObject = None):
		if port == None:
			port = profile.getPreference('serial_port')
		if baudrate == None:
			if profile.getPreference('serial_baud') == 'AUTO':
				baudrate = 0
			else:
				baudrate = int(profile.getPreference('serial_baud'))
		if callbackObject == None:
			callbackObject = MachineComPrintCallback()

		self._callback = callbackObject
		self._state = self.STATE_NONE
		self._serial = None
		self._baudrateDetectList = baudrateList()
		self._baudrateDetectRetry = 0
		self._temp = 0
		self._bedTemp = 0
		self._gcodeList = None
		self._gcodePos = 0
		self._commandQueue = queue.Queue()
		self._logQueue = queue.Queue(256)
		self._feedRateModifier = {}
		self._currentZ = -1
		
		if port == 'AUTO':
			programmer = stk500v2.Stk500v2()
			self._log("Serial port list: %s" % (str(serialList())))
			for p in serialList():
				try:
					self._log("Connecting to: %s" % (p))
					programmer.connect(p)
					self._serial = programmer.leaveISP()
					profile.putPreference('serial_port_auto', p)
					break
				except ispBase.IspError as (e):
					self._log("Error while connecting to %s: %s" % (p, str(e)))
					pass
				except:
					self._log("Unexpected error while connecting to serial port: %s %s" % (p, getExceptionString()))
				programmer.close()
		elif port == 'VIRTUAL':
			self._serial = VirtualPrinter()
		else:
			try:
				self._log("Connecting to: %s" % (port))
				if baudrate == 0:
					self._serial = Serial(port, 115200, timeout=0.1)
				else:
					self._serial = Serial(port, baudrate, timeout=2)
			except:
				self._log("Unexpected error while connecting to serial port: %s %s" % (port, getExceptionString()))
		if self._serial == None:
			self._log("Failed to open serial port (%s)" % (port))
			self._errorValue = 'Failed to autodetect serial port.'
			self._changeState(self.STATE_ERROR)
			return
		self._log("Connected to: %s, starting monitor" % (self._serial))
		if baudrate == 0:
			self._changeState(self.STATE_DETECT_BAUDRATE)
		else:
			self._changeState(self.STATE_CONNECTING)
		self.thread = threading.Thread(target=self._monitor)
		self.thread.daemon = True
		self.thread.start()
开发者ID:martinxyz,项目名称:Cura,代码行数:65,代码来源:machineCom.py


示例17: 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


示例18: _loadModels

 def _loadModels(self, filelist):
     self.filelist = filelist
     self.SetTitle(filelist[-1] + " - Cura - " + version.getVersion())
     profile.putPreference("lastFile", ";".join(self.filelist))
     self.preview3d.loadModelFiles(self.filelist, True)
     self.preview3d.setViewMode("Normal")
开发者ID:younew,项目名称:Cura,代码行数:6,代码来源:mainWindow.py


示例19: OnSimpleSwitch

 def OnSimpleSwitch(self, e):
     profile.putPreference("startMode", "Simple")
     simpleMode.simpleModeWindow()
     self.Close()
开发者ID:younew,项目名称:Cura,代码行数:4,代码来源:mainWindow.py


示例20: OnNormalSwitch

	def OnNormalSwitch(self, e):
		from gui import mainWindow
		profile.putPreference('startMode', 'Normal')
		mainWindow.mainWindow()
		self.Close()
开发者ID:felipesanches,项目名称:Cura,代码行数:5,代码来源:simpleMode.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python profile.putProfileSetting函数代码示例发布时间:2022-05-26
下一篇:
Python profile.getProfileSettingFloat函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap