def setupUi(self,): self.slider.setMaximum(self.npoints-1) conecta(self.slider, QtCore.SIGNAL("valueChanged(int)"), self.updateFromSlider) self._d = [] for f, i in zip([self.atras, self.adelante], [-1, 1]): self._d.append(partial(self.estadoAnimacion,i)) conecta(f, QtCore.SIGNAL("clicked()"), self._d[-1]) def changeText(btn,text): btn.setText(text) # conecta(self.adelante, QtCore.SIGNAL("clicked()"), partial(changeText,self.adelante,"||")) # conecta(self.adelante, QtCore.SIGNAL("clicked()"), partial(changeText,self.atras,"<")) # conecta(self.atras, QtCore.SIGNAL("clicked()"), partial(changeText,self.atras,"||")) # conecta(self.atras, QtCore.SIGNAL("clicked()"), partial(changeText,self.adelante,"<")) conecta(self.timeline, QtCore.SIGNAL("finished()"), partial(changeText,self.adelante,">")) conecta(self.timeline, QtCore.SIGNAL("finished()"), partial(changeText,self.atras,"<"))
def setupUi(self,): self.nombre.setTitle(self.name + ": %.3f" % self.intervalo.t) self.slider.setMaximum(self.intervalo.npoints-1) self.slider.setValue(self.intervalo.n) conecta(self.slider, QtCore.SIGNAL("valueChanged(int)"), self.updateFromSlider) self._d = [] for f, i in zip([self.atras, self.pausa, self.adelante], [-1, 0, 1]): self._d.append(partial(self.estadoAnimacion,i)) conecta(f, QtCore.SIGNAL("clicked()"), self._d[-1])
def setupUi(self, ): self.nombre.setTitle(self.name + ": %.3f" % self.intervalo.t) self.slider.setMaximum(self.intervalo.npoints - 1) self.slider.setValue(self.intervalo.n) conecta(self.slider, QtCore.SIGNAL("valueChanged(int)"), self.updateFromSlider) self._d = [] for f, i in zip([self.atras, self.pausa, self.adelante], [-1, 0, 1]): self._d.append(partial(self.estadoAnimacion, i)) conecta(f, QtCore.SIGNAL("clicked()"), self._d[-1])
def updateRange(self, rangep): ## rangep = (vmin, vmax, vini) self.timeline = QtCore.QTimeLine(self.timeline.duration()) self.range = rangep + type(rangep)([self.npoints]) self.vmin, self.vmax, self.vini, self.npoints = self.range self.funcTrans = partial(segment, self.vmin, self.vmax) self.timeline.setFrameRange(0, self.npoints-1) curTime = float(self.vini - self.vmin) /(self.vmax - self.vmin) * self.timeline.duration() self.timeline.setCurrentTime(curTime) ## ============================ conecta(self.timeline, QtCore.SIGNAL("valueChanged(qreal)"), lambda t: self.func(self.funcTrans(t))) conecta(self.timeline, QtCore.SIGNAL("valueChanged(qreal)"), lambda t: self.updateLabel(self.funcTrans(t))) conecta(self.timeline, QtCore.SIGNAL("frameChanged(int)"), self.updateSlider) ## ============================ # self.nombre.setTitle(self.name + ": %.3f" % self.vini) hasattr(self, 'nombre') and self.nombre.setText(self.name + ": %.3f" % self.vini) self.slider.setValue(self.timeline.currentFrame())
def make_curva(c): return partial(par_parab, c)
def make_tang(c): return partial(esfera_v, c)
def make_curva(c): return partial(par_esfera, c)
def make_curva(c): return partial(par_curva, c)
def make_circulo(t): return partial(par_esfera, t)
def make_tang(c): return partial(toro_v, c)
def make_tang(c): return partial(par_tang,c)
def make_curva(c): return partial(par_parab,c)
def make_curva(c): return partial(par_curva,c)
def make_tang(c): return partial(par_tang, c)
def make_curva(c): return partial(toroParam1, c)
def make_curva(c): return partial(toroParam1,c)
def make_tang(c): return partial(toro_v,c)