def __init__(self,osc): atom.Atom.__init__(self,policy=policy.FastReadOnlyPolicy(),domain=domain.Aniso(),protocols='nostage') self.__send_queue = piw.fastdata(0) self.__recv_queue = piw.fastdata(0) piw.tsd_fastdata(self.__send_queue) piw.tsd_fastdata(self.__recv_queue) self.send_channel = None self.__monitor = Monitor(self.__recv_queue,osc,self) self.get_policy().set_source(self.__send_queue) self.__osc = osc self.__name = '' self.have_target = False self.have_widget = False
def __init__(self, key, fast, text, index): self.__key = key self.__index = index self.__fastdata = piw.fastdata(0) piw.tsd_fastdata(self.__fastdata) self.__fastdata.set_upstream(fast) atom.Atom.__init__(self, domain=domain.Aniso(), policy=policy.FastReadOnlyPolicy(), names='action', ordinal=index) self.get_policy().set_source(self.__fastdata) self.status_input = bundles.VectorInput( self.__key.key_aggregator.get_output(self.__index), self.__key.agent.domain, signals=(1, )) self.set_property_string('help', text) self[1] = atom.Atom(domain=domain.BoundedFloat(0, 1), policy=self.status_input.vector_policy( 1, False, clocked=False), names='status input', protocols='nostage')
def __init__(self, fast, text, index): self.__index = index self.__fastdata = piw.fastdata(0) piw.tsd_fastdata(self.__fastdata) self.__fastdata.set_upstream(fast) atom.Atom.__init__(self, domain=domain.Aniso(), policy=policy.FastReadOnlyPolicy()) self.get_policy().set_source(self.__fastdata) self.set_private( node.Server(value=piw.makestring(text, 0), change=self.__change))
def plumb(self): if monitor_debug: print '- Monitor: plumb - unplumbing first...' self.unplumb() if monitor_debug: print '- Monitor: plumbing...' if self.is_fast(): if monitor_debug: print '- Monitor: plumbed fast' self.set_sink(self.__recv) self.__fast = True else: if monitor_debug: print '- Monitor: not plumbed fast' self.__aux = piw.fastdata(const.fastdata_sender) piw.tsd_fastdata(self.__aux) self.__recv.set_upstream(self.__aux) self.__auxq = piw.tsd_dataqueue(16) self.__aux.send_slow(piw.pathnull(piw.tsd_time()), self.__auxq) self.set_change_handler(self.__auxq.sender_slow()) data = self.get_data() if not data.is_null(): if monitor_debug: print 'target=', self.target_id, 'data="', self.get_data( ), '" ready=', self.is_ready(), 'type=', type(data) self.__auxq.sender_slow()(data) self.__fast = False # called when a connection can successfully be made if self.__widget.send_channel is not None: if monitor_debug: print '- Monitor: set_connected true', self.__widget.send_channel self.__osc.set_connected(self.__widget.send_channel, True) else: if monitor_debug: print '- Monitor: **** not set_connected ****' # try sending change in status osc_path = self.__widget.get_property_string('target-name') if osc_path != '': if monitor_debug: print '- Monitor: sent osc connected 1' self.__osc.send(osc_path + '/connected', 1)