def init(self): ns = egi.Netstation() ns.connect( '10.0.0.42', 55513 ) # sample address and port -- change according to your network settings ns.BeginSession() ns.sync() ns.StartRecording() # save it to obj namespace for later use. self.ns = ns
def __init__(self, to_send, received): """ the thread will send the strings from the 'to_send' queue, read the response with the read functions packed together with the strings to send, put the result in the 'received' queue """ Thread.__init__(self) self.setName("Netstation Thread") # =%:-) self._netstation_object = internal.Netstation() self._to_send = to_send self._received = received
Note that egi pynetstation can also be used in a multi-threaded form. See the pynetstation documentation for further information. """ from __future__ import division # Set up: import egi.simple as egi # import egi.threaded as egi # ms_localtime = egi.egi_internal.ms_localtime ms_localtime = egi.ms_localtime ns = egi.Netstation() # sample address and port; change according to your network settings ns.connect('11.0.0.42', 55513) # ns.initialize('11.0.0.42', 55513) ns.BeginSession() ns.sync() ns.StartRecording() # Send many events here: # optionally can perform additional synchronization # ns.sync() ns.send_event('evt_', label="event",