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 __init__(self,agent,index): self.agent = agent self.__fastdata = bundles.FastSender() collection.Collection.__init__(self,domain=domain.Aniso(),policy=policy.FastReadOnlyPolicy(),creator=self.__create,wrecker=self.__wreck,ordinal=index,names='row',protocols='hidden-connection remove explicit') self.get_policy().set_source(self.__fastdata) self.get_policy().set_clock(self.agent.model.get_clock()) self.set_private(node.static(_1=node.Server(change=self.__changetarget))) self.target = self.get_private()[1] if index is not None: self.__changetarget(piw.makelong(index-1,0))
def __init__(self,agent,row=None): self.__agent = agent self.__fastdata = bundles.FastSender() atom.Atom.__init__(self,domain=domain.Aniso(),policy=policy.FastReadOnlyPolicy()) self.get_policy().set_source(self.__fastdata) self.get_policy().set_clock(self.__agent.model.get_clock()) self.set_private(node.static(_1=node.Server(change=self.__changetarget),_2=node.Server(value=piw.makelong(1,0),change=self.__changerefs))) self.target = self.get_private()[1] self.refs = self.get_private()[2] if row is not None: self.__changetarget(piw.makelong(row,0))
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, finder, trigger, status_cookie, names='action', ordinal=None, protocols=None): p = protocols + ' nostage hidden-connection explicit' if protocols else 'nostage hidden-connection explicit' atom.Atom.__init__(self, domain=domain.String(), policy=atom.default_policy(self.__change), names='action', protocols=p, ordinal=ordinal) self.__finder = finder self.__domain = piw.clockdomain_ctl() self.__domain.set_source(piw.makestring('*', 0)) self.__loading = False self.__active_phrase_operation = False self.__pending_set_phrase = None self.__pending_clear_phrase = False self.__pending_redo = False if status_cookie: self.status_input = bundles.VectorInput(status_cookie, self.__domain, signals=(1, )) self[1] = atom.Atom(domain=domain.BoundedFloat(0, 1), policy=self.status_input.vector_policy( 1, False, clocked=False), names='status input', protocols='nostage hidden-connection explicit') self[2] = atom.Atom(domain=domain.Aniso(), policy=policy.FastReadOnlyPolicy(), names='trigger output', protocols='hidden-connection explicit') self[2].get_policy().set_source(trigger) # prevent running coroutines from being garbage collected self.__running = []