00001 #!/usr/local/bin/python 00002 # 00003 # Copyright 2003 00004 # by 00005 # The Board of Trustees of the 00006 # Leland Stanford Junior University. 00007 # All rights reserved. 00008 # 00009 00010 __facility__ = "Online" 00011 __abstract__ = "GLAST Online Tower Event Display" 00012 __author__ = "A. Kavelaars <aliciak@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online" 00013 __date__ = "11/26/2003" 00014 __version__ = "$Revision: 1.7 $" 00015 __credits__ = "SLAC" 00016 00017 import LATTE.copyright_SLAC 00018 import sys 00019 from qt import * 00020 from GOTED import towerEvtDisplay 00021 00022 class towerEvtDisplayImpl(towerEvtDisplay): 00023 def __init__(self,parent = None,name = None,modal = 0,fl = 0): 00024 towerEvtDisplay.__init__(self,parent,name,fl) 00025 00026 self.towerFrame = None 00027 00028 self.final = {} 00029 00030 for i in range(16): 00031 self.final[i] = QPixmap() 00032 00033 #~ self.background = QPixmap(200, 200) 00034 #~ self.noBgrZ = QPixmap(200, 200) 00035 00036 self.background = QPixmap(self.TWR0.width(), \ 00037 self.TWR0.height()) 00038 self.noBgrZ = QPixmap(self.TWR0.width(), \ 00039 self.TWR0.height()) 00040 00041 self.towerList = [self.TWR0, 00042 self.TWR1, 00043 self.TWR2, 00044 self.TWR3, 00045 self.TWR4, 00046 self.TWR5, 00047 self.TWR6, 00048 self.TWR7, 00049 self.TWR8, 00050 self.TWR9, 00051 self.TWR10, 00052 self.TWR11, 00053 self.TWR12, 00054 self.TWR13, 00055 self.TWR14, 00056 self.TWR15 00057 ] 00058 self.connect 00059 00060 def clear(self): 00061 for i in range(16): 00062 self.final[i].fill() 00063 00064 def paintEvent(self, pe): 00065 self.background = QPixmap(self.TWR0.width(), \ 00066 self.TWR0.height()) 00067 self.noBgrZ = QPixmap(self.TWR0.width(), \ 00068 self.TWR0.height()) 00069 00070 self.__pZ_TKR = QPainter(self.background) # 00071 00072 self.__pZ_TKR.setBrush(QColor("white")) 00073 self.__pZ_TKR.setPen(QColor(166,163,157)) 00074 00075 self.__pZ_TKR.drawRect(0, 0,\ 00076 self.towerList[0].width(), \ 00077 self.towerList[0].height()) 00078 00079 self.__pZ_TKR = QPainter(self.noBgrZ) # 00080 00081 self.__pZ_TKR.setBrush(QColor(212,208,200)) 00082 self.__pZ_TKR.setPen(QColor(166,163,157)) 00083 00084 self.__pZ_TKR.drawRect(0, 0, \ 00085 self.TWR0.width(), \ 00086 self.TWR0.height()) 00087 self.__pZ_TKR.end() 00088 00089 for i in range(16): 00090 if not self.final[i].isNull(): 00091 bitBlt(self.towerList[i], \ 00092 0, 0, self.final[i]) 00093 00094 00095 if __name__ == "__main__": 00096 a = QApplication(sys.argv) 00097 QObject.connect(a,SIGNAL("lastWindowClosed()"),a,SLOT("quit()")) 00098 w = towerEvtDisplayImpl() 00099 a.setMainWidget(w) 00100 w.show() 00101 a.exec_loop()