コード例 #1
0
ファイル: settings.py プロジェクト: jbernardis/reprapnb
	def __init__(self, app, name):
		self.app = app
		self.name = name
		self.settings = {}
		self.modified = False
		self.type = None
		if self.name == 'slic3r':
			self.type = Slic3r(self.app, self)
		elif self.name == 'skeinforge':
			self.type = Skeinforge(self.app, self)
		elif self.name == 'cura':
			self.type = Cura(self.app, self)
		else:
			self.type = None
			print "Unknown slicer type: %s" % self.name
コード例 #2
0
ファイル: settings.py プロジェクト: jbernardis/reprapnb
class SlicerSettings:
	def __init__(self, app, name):
		self.app = app
		self.name = name
		self.settings = {}
		self.modified = False
		self.type = None
		if self.name == 'slic3r':
			self.type = Slic3r(self.app, self)
		elif self.name == 'skeinforge':
			self.type = Skeinforge(self.app, self)
		elif self.name == 'cura':
			self.type = Cura(self.app, self)
		else:
			self.type = None
			print "Unknown slicer type: %s" % self.name
	
	def setModified(self, flag=True):
		self.modified = flag
		
	def checkModified(self):
		return self.modified
	
	def initialize(self):
		if self.type is not None:
			self.type.initialize(True)
			
	def getSettingsKeys(self):
		if self.type is None:
			return [], []
		
		return self.type.getSettingsKeys()
	
	def buildSliceOutputFile(self, fn):
		if self.type is None:
			return None
		
		return self.type.buildSliceOutputFile(fn)
	
	def setLogger(self, logger):
		if self.type is None:
			return None
		
		return self.type.setLogger(logger)
	
	def setOverrides(self, overrides):
		if self.type is None:
			return None
		
		return self.type.setOverrides(overrides)
	
	def buildSliceCommand(self):
		if self.type is None:
			return None
		
		return self.type.buildSliceCommand()
	
	def sliceComplete(self):
		if self.type is not None:
			self.type.sliceComplete()
			
	def fileTypes(self):
		if self.type is None:
			return ""

		return self.type.fileTypes()
			
	def configSlicer(self):
		if self.type is None:
			return False

		return self.type.configSlicer()
		
	def getConfigString(self):
		if self.type is None:
			return None
		
		return self.type.getConfigString()
	
	def getFilamentInfo(self):
		if self.type is None:
			return None
		
		fd = self.getDimensionInfo()[1]
		if fd is None:
			return None
		else:
			return fd
	
	def getSlicerName(self):
		return self.name
		
	def getDimensionInfo(self):
		if self.type is None:
			return None
		
		return self.type.getDimensionInfo()
		
	def getTempProfileString(self):
		if self.type is None:
			return None
		
		bed, hes = self.type.getTempProfile()
		
		if bed is None:
			strBed = "B:??"
		else:
			strBed = "B%.1f/%.1f" % (bed[0], bed[1])
			
		strHe = ""
		for t in range(MAX_EXTRUDERS):
			txt = "T%d:" % t
			if hes[t] is None:
				txt += "??"
			else:
				txt += "%.1f/%.1f" % (hes[t][0], hes[t][1])
				
			if len(strHe) != 0:
				strHe += ", "
			strHe += txt
		return strBed + " " + strHe
		
	def getTempProfile(self):
		if self.type is None:
			return None
		
		return self.type.getTempProfile()
	
	def getOverrideHelpText(self):
		if self.type is None:
			return None
		
		return self.type.getOverrideHelpText()