def valueChanged(self): self.mash = Mash() self.mash.name = self.ui.lineEditName.text() self.mash.ph = self.ui.doubleSpinBoxPh.value() self.mash.grainTemp = 0 self.mash.tunTemp = 0 self.mash.spargeTemp = self.ui.doubleSpinBoxSpargeT.value()
def mashComboChanged(self): self.brewdayLock = 0 try: i = self.comboBoxMashProfiles.currentIndex() self.currentMash = ImportBase().listeMashes[i] except: self.currentMash = self.currentRecipeMash if i == -1: self.currentMash = Mash() self.recipe.mash = self.currentMash
def importBSMXMash(data): mash = Mash() mash.name = data.find('F_MH_NAME').text mash.grainTemp = "%.2f" % farenheit_to_celsius( float(data.find('F_MH_GRAIN_TEMP').text)) mash.tunTemp = "%.2f" % farenheit_to_celsius( float(data.find('F_MH_TUN_TEMP').text)) mash.spargeTemp = "%.2f" % farenheit_to_celsius( float(data.find('F_MH_SPARGE_TEMP').text)) mash.ph = "%.1f" % float(data.find('F_MH_PH').text) mashSteps = data.find('steps').find('Data').findall('MashStep') for step in mashSteps: mash.listeSteps.append(importBSMXMashStep(step)) return mash
def __init__(self): self.path = "" self.name = "" self.brewer = "" self.type = model.constants.RECIPE_TYPE_ALL_GRAIN self.volume = 0.0 self.efficiency = 0.0 self.boil = 0.0 self.recipeNotes = "" self.style = "" self.mash = Mash() self.listeFermentables = list() self.listeHops = list() self.listeYeasts = list() self.listeMiscs = list() self.listeMashSteps = list()
def addMash(self): new_mash = Mash() new_mash.name = 'Nouveau profil' new_mash.grainTemp = '0' new_mash.tunTemp = '0' new_mash.spargeTemp = '78' new_mash.ph = 5.4 new_step = MashStep() new_step.name = 'Nouveau Palier' new_step.type = 'Infusion' new_step.time = '0' new_step.temp = '0' new_mash.listeSteps.append(new_step) ImportBase().listeMashes.append(new_mash) self.seeMash() self.listWidgetMashProfiles.setCurrentRow( len(ImportBase().listeMashes) - 1)
def importBeerXMLMash(data): mash = Mash() for child in data: if 'NAME' == child.tag: mash.name = child.text if 'GRAIN_TEMP' == child.tag: mash.grainTemp = child.text if 'TUN_TEMP' == child.tag: mash.tunTemp = child.text if 'SPARGE_TEMP' == child.tag: mash.spargeTemp = "%.1f" % float(child.text) if 'PH' == child.tag: mash.ph = "%.1f" % float(child.text) mashStep = data.findall('.//MASH_STEP') for element in mashStep: mash.listeSteps.append(importBeerXMLMashStep(element)) return mash