async def main(): # Setup the SLM to run LAeq SLM_Setup_LAeq(host) # Get ID and object of sequence, the data for the wanted logging mode ID, sequence = seq.get_sequence(host, sequenceId) # Get URI for stream uri = stream.setup_stream(host, ip, ID, "Test") # Get datatype of the logging data data_type = sequence["DataType"] # Start a measurement. This is needed to obtain data from the device meas.start_pause_measurement(host, True) # Initilize a MovingLeq object to handle the data. # This example uses a 10s moving leq (assuming 1s logging) leq_10_mov = MovingLeq(10) # Create lambda function to use for the stream message. In this example is a function # call used msg_func = lambda msg: print_LAeq_mov(msg, data_type, leq_10_mov) # Initilize and run the websocket to retrive data await webSocket.next_async_websocket(uri, msg_func)
def streamInit(self): SLM_Setup_LAeq(host) self.ID, self.sequence = seq.get_sequence(host, sequenceID) # Get datatype of the logging data self.data_type = self.sequence["DataType"] # Get URI for stream self.uri = stream.setup_stream(host,ip,self.ID,"LAeqStream") # Start a measurement. This is needed to obtain data from the device meas.start_pause_measurement(host,True)
def streamInit(self): self.IDs = [] self.sequences = [] self.sequenceFuncs = [] for x in sequenceNames: ID, sequence = seq.get_sequence(host, getSequenceID(host, x)) self.IDs.append(ID) self.sequences.append(sequence) self.sequenceFuncs.append( MovingLeq(10, storedata=True, windowSize=100)) self.uri = stream.setup_stream(host, ip, self.IDs, "MultipleSequences") # Start a measurement. This is needed to obtain data from the device meas.start_pause_measurement(host, True)
async def main(): IDs = [] sequences = [] sequenceFuncs = [] for x in sequenceNames: ID, sequence = seq.get_sequence(host, getSequenceID(host, x)) IDs.append(ID) sequences.append(sequence) sequenceFuncs.append(MovingLeq(10, storedata=True)) uri = stream.setup_stream(host, ip, IDs, "MultipleSequences") # Start a measurement. This is needed to obtain data from the device meas.start_pause_measurement(host,True) msg_func = lambda msg : print_data(msg, IDs, sequences, sequenceFuncs) await webSocket.next_async_websocket(uri, msg_func)
def streamInit(self): self.uri = stream.setup_stream(host, ip, self.sequenceID, self.streamName) meas.start_pause_measurement(host, True)