import  ch.psi.pshell.bs.Scalar as Scalar
import  ch.psi.pshell.bs.Waveform as Waveform
import ch.psi.pshell.bs.Stream as Stream
import ch.psi.bsread.configuration.Channel as ReceiverChannel


def str1():
    s1 = Stream("stream1", bs)
    channels = [ 'Int8Scalar', 'Int16Scalar', 'Int32Scalar', 'Int64Scalar',
         'UInt8Scalar', 'UInt16Scalar', 'UInt32Scalar', 'UInt64Scalar',
         'Float32Scalar', 'Float64Scalar', 'BoolScalar', 'StringScalar',]
    for c in channels:
            add_device(Scalar(c, s1, c, 10), True)
    add_device(s1, True)
    s1.start()

def str2():
    s2 = Stream("stream2", bs)
    channels = [ 'Int8Waveform', 'Int16Waveform',  'Int32Waveform',  'Int64Waveform',      
         'UInt8Waveform', 'UInt16Waveform', 'UInt32Waveform',  'UInt64Waveform',
         'Float32Waveform', 'Float64Waveform', 'BoolWaveform']
    for c in channels:
            add_device(Waveform(c, s2, c, 10), True)
    add_device(s2, True)
    s2.start()


#str1()
parallelize(str1, str2)




#s.start()



#s.stop()

#s.close()