def cambiarCurvaVista(self, ind): self.curva = self.curvas[ind] self.diametro.setValue(self.curva[0]) self.rpm.setValue(self.curva[1]) q = [ VolFlow(i).__getattribute__( VolFlow.__units__[self.unidadesCaudal.currentIndex()]) for i in self.curva[2] ] h = [ Length(i).__getattribute__( Length.__units__[self.unidadesCarga.currentIndex()]) for i in self.curva[3] ] P = [ Power(i).__getattribute__( Power.__units__[self.unidadesPotencia.currentIndex()]) for i in self.curva[4] ] n = [ Length(i).__getattribute__( Length.__units__[self.unidadesNPSH.currentIndex()]) for i in self.curva[5] ] self.Tabla.setMatrix(transpose([q, h, P, n])) self.Tabla.addRow()
def CalcularCurva(self): caudal = [] carga = [] potencia = [] NPSH = [] for i in range(1, self.Tabla.rowCount() - 1): q = VolFlow(float(self.Tabla.item(i, 0).text()), VolFlow.__units__[self.unidadesCaudal.currentIndex()]) caudal.append(q) h = Length(float(self.Tabla.item(i, 1).text()), Length.__units__[self.unidadesCarga.currentIndex()]) carga.append(h) P = Power(float(self.Tabla.item(i, 2).text()), Power.__units__[self.unidadesPotencia.currentIndex()]) potencia.append(P) n = Length(float(self.Tabla.item(i, 3).text()), Length.__units__[self.unidadesNPSH.currentIndex()]) NPSH.append(n) return [ self.diametro.value, self.rpm.value, caudal, carga, potencia, NPSH ]
def readStatefromJSON(self, state): """Load instance parameter from saved file""" self.deltaP = DeltaP(state["deltaP"]) self.rendimientoCalculado = Dimensionless( state["rendimientoCalculado"]) # noqa self.headCalculada = Length(state["headCalculada"]) self.power = Power(state["power"]) self.P_freno = Power(state["P_freno"]) self.Pin = Pressure(state["Pin"]) self.PoutCalculada = Pressure(state["PoutCalculada"]) self.volflow = VolFlow(state["volflow"]) self.cp_cv = Dimensionless(state["cp_cv"]) self.statusCoste = state["statusCoste"] if self.statusCoste: self.C_bomba = Currency(state["C_bomba"]) self.C_motor = Currency(state["C_motor"]) self.C_adq = Currency(state["C_adq"]) self.C_inst = Currency(state["C_inst"]) if self.kwargs["usarCurva"]: pass self.salida = [None]