class StringDev(ReadonlyRegisterBase, Readable.StringType):
    def doRead(self):
        time.sleep(0.001)    
        return str(time.time())

class BoolDevS(ReadonlyRegisterBase):
    def doRead(self):
        return (int(time.time()) %2) == 0  
        
class BoolDev(ReadonlyRegisterBase, Readable.BooleanType):
    def doRead(self):
        return (int(time.time()) %2) == 0  

class ImageDev(ReadonlyRegisterBase, ReadonlyRegisterMatrix,  Readable.IntegerType):
    def doRead(self):
        return mt1.read()

    def getWidth(self):
        return mt1.width

    def getHeight(self):
        return mt1.height
                
    

add_device(StringDev(), True)
add_device(BoolDev(), True)
add_device(BoolDevS(), True)
add_device(ImageDev(), True)

tscan((StringDev, BoolDev, BoolDevS, sin, arr, arr1, mt, mt1, cm1, ImageDev), 10, 0.1, compression =ImageDev)