Пример #1
0
def fillDescription():
        descriptionExtension = '_'
        pluginModule = archive.getModuleWithPath(os.path.join( skeinforge_craft.getPluginsDirectoryPath(), 'fill'  ))
        prefs = settings.getReadRepository(pluginModule.getNewRepository()).preferences
        for pref in prefs:
                if (pref.name == 'Activate Fill:' and pref.value == False):
                        return ''
                if (pref.name == 'Infill Solidity (ratio):'):
                        infill = pref.value
                        descriptionExtension += str(pref.value).replace('.','')+'fill'
        return descriptionExtension
Пример #2
0
def carveDescription():
        descriptionExtension = ''
        pluginModule = archive.getModuleWithPath(os.path.join( skeinforge_craft.getPluginsDirectoryPath(), 'carve'  ))
        prefs = settings.getReadRepository(pluginModule.getNewRepository()).preferences
        for pref in prefs:
                if (pref.name == 'Layer Thickness (mm):'):
                        lt = pref.value
                        descriptionExtension += str(pref.value).replace('.','')+'h'
                if (pref.name == 'Perimeter Width over Thickness (ratio):'):
                        pwot = pref.value
                        descriptionExtension += 'x' + str(lt * pwot).replace('.','') + 'w'
        return descriptionExtension
Пример #3
0
def fillDescription():
    descriptionExtension = '_'
    pluginModule = archive.getModuleWithPath(
        os.path.join(skeinforge_craft.getPluginsDirectoryPath(), 'fill'))
    prefs = settings.getReadRepository(
        pluginModule.getNewRepository()).preferences
    for pref in prefs:
        if (pref.name == 'Activate Fill:' and pref.value == False):
            return ''
        if (pref.name == 'Infill Solidity (ratio):'):
            infill = pref.value
            descriptionExtension += str(pref.value).replace('.', '') + 'fill'
    return descriptionExtension
Пример #4
0
def multiplyDescription():
        descriptionExtension = ''
        pluginModule = archive.getModuleWithPath(os.path.join( skeinforge_craft.getPluginsDirectoryPath(), 'multiply'  ))
        prefs = settings.getReadRepository(pluginModule.getNewRepository()).preferences
        for pref in prefs:
                if (pref.name == 'Activate Multiply:' and pref.value == False):
                        return ''
                if (pref.name == 'Number of Columns (integer):'):
                        cols = pref.value
                if (pref.name == 'Number of Rows (integer):'):
                        rows = pref.value
        if (cols > 1 or rows > 1) :
                descriptionExtension ='_'+str(cols * rows).replace('.','')+'off'
        return descriptionExtension
Пример #5
0
	def convertElementNode(self, elementNode, geometryOutput):
		"Convert the xml element."
		geometryOutputKeys = geometryOutput.keys()
		if len( geometryOutputKeys ) < 1:
			return None
		firstKey = geometryOutputKeys[0]
		lowerLocalName = firstKey.lower()
		if lowerLocalName not in self.namePathDictionary:
			return None
		pluginModule = archive.getModuleWithPath( self.namePathDictionary[ lowerLocalName ] )
		if pluginModule == None:
			return None
		elementNode.localName = lowerLocalName
		return pluginModule.convertElementNode(elementNode, geometryOutput[ firstKey ])
Пример #6
0
def carveDescription():
    descriptionExtension = ''
    pluginModule = archive.getModuleWithPath(
        os.path.join(skeinforge_craft.getPluginsDirectoryPath(), 'carve'))
    prefs = settings.getReadRepository(
        pluginModule.getNewRepository()).preferences
    for pref in prefs:
        if (pref.name == 'Layer Thickness (mm):'):
            lt = pref.value
            descriptionExtension += str(pref.value).replace('.', '') + 'h'
        if (pref.name == 'Perimeter Width over Thickness (ratio):'):
            pwot = pref.value
            descriptionExtension += 'x' + str(lt * pwot).replace('.', '') + 'w'
    return descriptionExtension
Пример #7
0
	def convertXMLElement( self, geometryOutput, xmlElement ):
		"Convert the xml element."
		geometryOutputKeys = geometryOutput.keys()
		if len( geometryOutputKeys ) < 1:
			return None
		firstKey = geometryOutputKeys[0]
		lowerClassName = firstKey.lower()
		if lowerClassName not in self.namePathDictionary:
			return None
		pluginModule = archive.getModuleWithPath( self.namePathDictionary[ lowerClassName ] )
		if pluginModule == None:
			return None
		xmlElement.className = lowerClassName
		return pluginModule.convertXMLElement(geometryOutput[ firstKey ], xmlElement)
Пример #8
0
	def convertXMLElement( self, geometryOutput, xmlElement ):
		"Convert the xml element."
		geometryOutputKeys = geometryOutput.keys()
		if len( geometryOutputKeys ) < 1:
			return None
		firstKey = geometryOutputKeys[0]
		lowerClassName = firstKey.lower()
		if lowerClassName not in self.namePathDictionary:
			return None
		pluginModule = archive.getModuleWithPath( self.namePathDictionary[ lowerClassName ] )
		if pluginModule == None:
			return None
		xmlElement.className = lowerClassName
		return pluginModule.convertXMLElement(geometryOutput[ firstKey ], xmlElement)
Пример #9
0
	def convertElementNode(self, elementNode, geometryOutput):
		"Convert the xml element."
		geometryOutputKeys = geometryOutput.keys()
		if len( geometryOutputKeys ) < 1:
			return None
		firstKey = geometryOutputKeys[0]
		lowerLocalName = firstKey.lower()
		if lowerLocalName not in self.namePathDictionary:
			return None
		pluginModule = archive.getModuleWithPath( self.namePathDictionary[ lowerLocalName ] )
		if pluginModule == None:
			return None
		elementNode.localName = lowerLocalName
		return pluginModule.convertElementNode(elementNode, geometryOutput[ firstKey ])
Пример #10
0
def _getAccessibleAttribute(attributeName, xmlElement):
	'Get the accessible attribute.'
	functionName = attributeName[len('get') :].lower()
	if functionName not in evaluate.globalCreationDictionary:
		print('Warning, functionName not in globalCreationDictionary in _getAccessibleAttribute in creation for:')
		print(functionName)
		print(xmlElement)
		return None
	pluginModule = archive.getModuleWithPath(evaluate.globalCreationDictionary[functionName])
	if pluginModule == None:
		print('Warning, _getAccessibleAttribute in creation can not get a pluginModule for:')
		print(functionName)
		print(xmlElement)
		return None
	return Creation(pluginModule, xmlElement).getCreation
Пример #11
0
def _getAccessibleAttribute(attributeName, xmlElement):
	'Get the accessible attribute.'
	functionName = attributeName[len('get') :].lower()
	if functionName not in evaluate.globalCreationDictionary:
		print('Warning, functionName not in globalCreationDictionary in _getAccessibleAttribute in creation for:')
		print(functionName)
		print(xmlElement)
		return None
	pluginModule = archive.getModuleWithPath(evaluate.globalCreationDictionary[functionName])
	if pluginModule == None:
		print('Warning, _getAccessibleAttribute in creation can not get a pluginModule for:')
		print(functionName)
		print(xmlElement)
		return None
	return Creation(pluginModule, xmlElement).getCreation
Пример #12
0
	def processXMLElement(self, xmlElement):
		'Process the xml element.'
		lowerClassName = xmlElement.className.lower()
		if lowerClassName not in self.namePathDictionary:
			return None
		pluginModule = archive.getModuleWithPath(self.namePathDictionary[lowerClassName])
		if pluginModule == None:
			return None
		try:
			return pluginModule.processXMLElement(xmlElement)
		except:
			print('Warning, could not processXMLElement in fabmetheus for:')
			print( pluginModule )
			print(xmlElement)
			traceback.print_exc(file=sys.stdout)
		return None
Пример #13
0
	def processElementNode(self, elementNode):
		'Process the xml element.'
		lowerLocalName = elementNode.getNodeName().lower()
		if lowerLocalName not in self.namePathDictionary:
			return None
		pluginModule = archive.getModuleWithPath(self.namePathDictionary[lowerLocalName])
		if pluginModule == None:
			return None
		try:
			return pluginModule.processElementNode(elementNode)
		except:
			print('Warning, could not processElementNode in fabmetheus for:')
			print(pluginModule)
			print(elementNode)
			traceback.print_exc(file=sys.stdout)
		return None
Пример #14
0
def multiplyDescription():
    descriptionExtension = ''
    pluginModule = archive.getModuleWithPath(
        os.path.join(skeinforge_craft.getPluginsDirectoryPath(), 'multiply'))
    prefs = settings.getReadRepository(
        pluginModule.getNewRepository()).preferences
    for pref in prefs:
        if (pref.name == 'Activate Multiply:' and pref.value == False):
            return ''
        if (pref.name == 'Number of Columns (integer):'):
            cols = pref.value
        if (pref.name == 'Number of Rows (integer):'):
            rows = pref.value
    if (cols > 1 or rows > 1):
        descriptionExtension = '_' + str(cols * rows).replace('.', '') + 'off'
    return descriptionExtension
Пример #15
0
	def processElementNode(self, elementNode):
		'Process the xml element.'
		lowerLocalName = elementNode.getNodeName().lower()
		if lowerLocalName not in self.namePathDictionary:
			return None
		pluginModule = archive.getModuleWithPath(self.namePathDictionary[lowerLocalName])
		if pluginModule == None:
			return None
		try:
			return pluginModule.processElementNode(elementNode)
		except:
			print('Warning, could not processElementNode in fabmetheus for:')
			print(pluginModule)
			print(elementNode)
			traceback.print_exc(file=sys.stdout)
		return None
Пример #16
0
def speedDescription():
        descriptionExtension = '_'
        pluginModule = archive.getModuleWithPath(os.path.join( skeinforge_craft.getPluginsDirectoryPath(), 'speed'  ))
        prefs = settings.getReadRepository(pluginModule.getNewRepository()).preferences
        for pref in prefs:
                if (pref.name == 'Activate Speed:' and pref.value == False):
                        return ''
                if (pref.name == 'Feed Rate (mm/s):'):
                        feedrate = pref.value
                if (pref.name == 'Flow Rate Setting (float):'):
                        flowrate = pref.value
        if (feedrate == flowrate):
                descriptionExtension += str(feedrate).replace('.0','')+'Ff'
        else :
                descriptionExtension += str(feedrate).replace('.0','')+'F'+str(flowrate).replace('.0','')+'f'
        return descriptionExtension
Пример #17
0
	def processXMLElement(self, xmlElement):
		'Process the xml element.'
		lowerClassName = xmlElement.className.lower()
		if lowerClassName not in self.namePathDictionary:
			return None
		pluginModule = archive.getModuleWithPath(self.namePathDictionary[lowerClassName])
		if pluginModule == None:
			return None
		try:
			return pluginModule.processXMLElement(xmlElement)
		except:
			print('Warning, could not processXMLElement in fabmetheus for:')
			print( pluginModule )
			print(xmlElement)
			traceback.print_exc(file=sys.stdout)
		return None
Пример #18
0
        def readSettings(self):
                self.output = cStringIO.StringIO()                
                profileDirectory = skeinforge_profile.getProfileDirectory()
                craftRepo = skeinforge_craft.CraftRepository()
                profileBaseName = settings.getProfileBaseName( craftRepo )
                allCraftNames = archive.getPluginFileNamesFromDirectoryPath( skeinforge_craft.getPluginsDirectoryPath() )

                fullProfilePath = os.path.join( archive.getSettingsPath() , 'profiles' )
                fullProfileDirectory = os.path.join( fullProfilePath , profileDirectory )

                for craftName in allCraftNames:
                        pluginModule = archive.getModuleWithPath(os.path.join( skeinforge_craft.getPluginsDirectoryPath(), craftName  ))

                        repo = pluginModule.getNewRepository()
                        self.outputSettings(craftName, settings.getReadRepository(repo).preferences)

                return self.output.getvalue()
Пример #19
0
def speedDescription():
    descriptionExtension = '_'
    pluginModule = archive.getModuleWithPath(
        os.path.join(skeinforge_craft.getPluginsDirectoryPath(), 'speed'))
    prefs = settings.getReadRepository(
        pluginModule.getNewRepository()).preferences
    for pref in prefs:
        if (pref.name == 'Activate Speed:' and pref.value == False):
            return ''
        if (pref.name == 'Feed Rate (mm/s):'):
            feedrate = pref.value
        if (pref.name == 'Flow Rate Setting (float):'):
            flowrate = pref.value
    if (feedrate == flowrate):
        descriptionExtension += str(feedrate).replace('.0', '') + 'Ff'
    else:
        descriptionExtension += str(feedrate).replace(
            '.0', '') + 'F' + str(flowrate).replace('.0', '') + 'f'
    return descriptionExtension
Пример #20
0
    def readSettings(self):
        self.output = cStringIO.StringIO()
        profileDirectory = skeinforge_profile.getProfileDirectory()
        craftRepo = skeinforge_craft.CraftRepository()
        profileBaseName = settings.getProfileBaseName(craftRepo)
        allCraftNames = archive.getPluginFileNamesFromDirectoryPath(
            skeinforge_craft.getPluginsDirectoryPath())

        fullProfilePath = os.path.join(archive.getSettingsPath(), 'profiles')
        fullProfileDirectory = os.path.join(fullProfilePath, profileDirectory)

        for craftName in allCraftNames:
            pluginModule = archive.getModuleWithPath(
                os.path.join(skeinforge_craft.getPluginsDirectoryPath(),
                             craftName))

            repo = pluginModule.getNewRepository()
            self.outputSettings(craftName,
                                settings.getReadRepository(repo).preferences)

        return self.output.getvalue()