Esempio n. 1
0
	def OnSettingChange(self, e):
		if self.type == 'profile':
			settings.putProfileSetting(self.configName, self.GetValue())
		else:
			settings.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)
Esempio n. 2
0
	def StoreData(self):
		if self.UltimakerRadio.GetValue():
			settings.putPreference('machine_width', '205')
			settings.putPreference('machine_depth', '205')
			settings.putPreference('machine_height', '200')
			settings.putProfileSetting('nozzle_size', '0.4')
			settings.putProfileSetting('machine_center_x', '100')
			settings.putProfileSetting('machine_center_y', '100')
		else:
			settings.putPreference('machine_width', '80')
			settings.putPreference('machine_depth', '80')
			settings.putPreference('machine_height', '60')
			settings.putProfileSetting('nozzle_size', '0.5')
			settings.putProfileSetting('machine_center_x', '40')
			settings.putProfileSetting('machine_center_y', '40')
Esempio n. 3
0
	def StoreData(self):
		settings.putProfileSetting('filament_diameter', self.filamentDiameter.GetValue())