# Form implementation generated from reading ui file 'test2.ui'
#
# Created: Fri Jan 24 14:16:14 2003
#      by: The PyQt User Interface Compiler (pyuic)
#
# WARNING! All changes made in this file will be lost!


import sys
from qt import *
from sihippo import *
import threading
from random import shuffle
from time import sleep

image0_data = [
"48 48 11 1",
"# c #000000",
"a c #000010",
"c c #001000",
". c #100000",
"b c #505050",
"i c #e0e0e0",
"f c #e0f0f0",
"h c #f00000",
"e c #f0e0f0",
"g c #f0f0e0",
"d c #f0f0f0",
".###.###.###.###.###.###.###.###.###.###.###.###",
"###ab##a###a###a###bb####b##b###bb#b###a###a###a",
"##b##b###############b#b#b##b#b####bb###########",
"##c###c###c###c###########c##bc###c###c###c###c#",
".###.###.###.###.###.###.###.###.###.###.###.###",
"##bb###########################################a",
"#b#####dddd#dddddddddddddddd#ddddddddddddddddd##",
"###b###ddddddddddddddddddddddddddddddddddddddd##",
".###.##ddddddddddddddddddddddddddddddddddddddd##",
"###a###dddddddddd##ddddddddddddddddddddddddddd#a",
"#######dddddddddd##dddddddddddedddedddeddddddd##",
"##c####dddddddddd##dddddddddddddfdddfddddddddd##",
".###b##dddddddddd##ddddgdddgdddgdddgdddgdddgdd##",
"#b#####dddddddddd##ddddddddddddddddddddddddddd#a",
"#######dddddddddd##dddedddedddedddedddedddeddd##",
"##c####dddddddddd##dddddfdddfdddfdddfdddfddddd##",
".###.####dddddddd##ddddgdddgdddgdddgdddgdddg####",
"###a###dddddddddd##ddddddddddddddddddddddddddd#a",
"#######dddddddddd##dddedddedddedddedddedddeddd##",
"##c####ddddddddd###dddddfdddfdddfdddfdddfddddd##",
".##b###ddddddddd#h#ddddgdddgdddgdddgdddgdddgdd##",
"####b##ddddddddd#h#ddddddddddddddddddddddddddd#a",
"#######ddddddddd#h#dddedddedddedddedddedddeddd##",
"##c####ddddddddd#h#dddddfdddfdddfdddfdddfddddd##",
".###.##ddddddddd#h#ddddgdddgdddgdddgdddgdddgdd##",
"###a###ddddddddd#h#ddddddddddddddddddddddddddd#a",
"#######ddddddddd#h#dddedddedddedddedddedddeddd##",
"##c####dddddddd##h#dddddfdddfdddfdddfdddfddddd##",
".b#b###dddddddd#hh##dddgdddgdddgdddgdddgdddgdd##",
"###a#####dddddd#hhh#dddddddddddddddddddddddddd#a",
"#######dddddddd#hhh#idedddedddedddedddeddded####",
"##c####dddddddd#hhh#ddddfdddfdddfdddfdddfddddd##",
".###.##dddddddd#hhh#dddgdddgdddgdddgdddgdddgdd##",
"###a###dddddddd#hhh#dddddddddddddddddddddddddd#a",
"#######dddddddd#hhh#ddedddedddedddedddedddeddd##",
"#b#####dddddddd#hhh##dddfdddfdddfdddfdddfddddd##",
".###.##dddddddd#hhhh#ddddddddddddddddddddddddd##",
"###a###ddddddd##hhhh#dddddd#dddddddddddddddddd#a",
"#######ddddddd#hhhhh##ddddd#dddddddddddddd#ddd##",
"##c####dddddd##hhhhhh##dddd##dddd#ddddd##d#ddd##",
".###.##dddd###hhhhhhh##d##d#h##dd##dd#d##d#d#d##",
"###a###dd####hhhhhhhhh##hh#h#h###hh####h#h###d#a",
"#b######################################h#######",
"##c##b####c###b###c###b#b#c###c###c####b#b####c#",
".##b#b######.###.###.#######.#######.#######.###",
"#######a###a###a###a###a###a###a###a###a###a###a",
"################################################",
"##c###c###c###c###c###c###c###c###c###c###c###c#"
]

class Form2(QWidget):
    def __init__(self,parent = None,name = None,fl = 0):
        QWidget.__init__(self,parent,name,fl)

        image0 = QPixmap(image0_data)

        if not name:
            self.setName("Form2")

        self.nt = None

        Form2Layout = QGridLayout(self,1,1,11,6,"Form2Layout")

        self.frame11 = QFrame(self,"frame11")
        self.frame11.setFrameShape(QFrame.StyledPanel)
        self.frame11.setFrameShadow(QFrame.Raised)
        frame11Layout = QGridLayout(self.frame11,1,1,11,6,"frame11Layout")


        Form2Layout.addWidget(self.frame11,0,0)

        self.resize(QSize(645,629).expandedTo(self.minimumSizeHint()))

        self.tViewWidget3 = QtViewWidget(self.frame11,"tViewWidget3", Qt.WStaticContents | Qt.WRepaintNoErase)
        self.tViewWidget3.setDoubleBuffering(1)

        frame11Layout.addWidget(self.tViewWidget3,0,0)
        ntc = NTupleController.instance()
        self.nt = ntc.createNTuple()

        labels = ['test1', 'test2']
        self.nt = NTuple ( labels )
        ntc.registerNTuple ( self.nt )
        self.nt.setTitle('Test')
        for i in range ( 10 ) :
            self.nt.addRow([i, 2*i])
        dc = DisplayController.instance()
        plot = dc.createDisplay('Strip Chart', self.nt, labels)
        self.tViewWidget3.setPlotter (plot)


if __name__ == "__main__":
    a = QApplication(sys.argv)
    QObject.connect(a,SIGNAL("lastWindowClosed()"),a,SLOT("quit()"))
    w = Form2()
    a.setMainWidget(w)
    w.show()
    a.exec_loop()
