def __init__(self,observer, variableX,valuesX, variableY,valuesY, t): self.matcher=IScatter(variableX,valuesX, variableY,valuesY,t) self.observer=observer self.type="scatter" Scatter.nscatter +=1 self.name="scatter_%d"%Scatter.nscatter Subscriber.__init__(self,observer)
class Scatter(Subscriber): nscatter = 0 """ """ def __init__(self, observer, variableX, valuesX, variableY, valuesY, t): self.matcher = IScatter(variableX, valuesX, variableY, valuesY, t) self.observer = observer self.type = "scatter" Scatter.nscatter += 1 self.name = "scatter_%d" % Scatter.nscatter Subscriber.__init__(self, observer) def selectPoints(self, pointIds): print self.name, " will select points", pointIds def selectedPoints(self, pointIds): print self.name, "selected point", pointIds def brushPoints(self, pointIds): print self.name, " will brush on points", pointIds def selectObservations(self, observations): print self.name, "will select ids associated with observations" ids = self.matcher.matchObservations(observations) self.selectPoints(ids) def selectedObservations(self, observations): #self.dispatch("selectObservations",observations) self.selectObservations(observations) #print "snd" self.publish("selectedObservations", observations) #self.selectObservations(observations) def updateTime(self, tsId): tsid = tsId[0].ts print self.name, " is updating to time period", tsid def buildMethods(self): m = {} m = { "selectPoints": self.selectPoints, "selectedPoints": self.selectedPoints, "brushPoints": self.brushPoints, "selectObservations": self.selectObservations, "selectedObservations": self.selectedObservations, "updateTime": self.updateTime } self.methods = m
class Scatter(Subscriber): nscatter = 0 """ """ def __init__(self,observer, variableX,valuesX, variableY,valuesY, t): self.matcher=IScatter(variableX,valuesX, variableY,valuesY,t) self.observer=observer self.type="scatter" Scatter.nscatter +=1 self.name="scatter_%d"%Scatter.nscatter Subscriber.__init__(self,observer) def selectPoints(self,pointIds): print self.name," will select points",pointIds def selectedPoints(self,pointIds): print self.name,"selected point",pointIds def brushPoints(self,pointIds): print self.name," will brush on points",pointIds def selectObservations(self,observations): print self.name, "will select ids associated with observations" ids = self.matcher.matchObservations(observations) self.selectPoints(ids) def selectedObservations(self,observations): #self.dispatch("selectObservations",observations) self.selectObservations(observations) #print "snd" self.publish("selectedObservations",observations) #self.selectObservations(observations) def updateTime(self,tsId): tsid = tsId[0].ts print self.name," is updating to time period",tsid def buildMethods(self): m={} m={"selectPoints":self.selectPoints, "selectedPoints":self.selectedPoints, "brushPoints":self.brushPoints, "selectObservations":self.selectObservations, "selectedObservations":self.selectedObservations, "updateTime":self.updateTime} self.methods=m