本文整理汇总了Python中util.profile.putPreference函数的典型用法代码示例。如果您正苦于以下问题:Python putPreference函数的具体用法?Python putPreference怎么用?Python putPreference使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了putPreference函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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)
示例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)
示例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)
示例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()
示例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()
示例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()
示例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()
示例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()
示例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")
示例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
示例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()
示例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()
示例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
示例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()))
示例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()