Changeset 3851

Show
Ignore:
Timestamp:
05/22/07 15:07:18 (6 years ago)
Author:
DrewCormier
Message:

changed tool name in code. removed unneeded display items

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • experimental/display/trunk/display/display.py

    r3850 r3851  
    1212# import wx.lib.buttons as buttons #for special wx buttons 
    1313 
    14 class write_to_file_short(standardInterfaces__POA.complexShort): 
     14class display_short(standardInterfaces__POA.complexShort): 
    1515    '''Writes I and Q data to 2 files''' 
    1616 
     
    3232 
    3333#generate wx ids for my wx controls 
    34 [wxID_MAINFRAME, wxID_SPLITTERWINDOW1, wxID_WRITEPACKETBTN, wxID_WRITEBUFFERBTN, wxID_IFILENAMEEDITOR, wxID_QFILENAMEEDITOR, wxID_IFILESTATICTEXT,wxID_QFILESTATICTEXT] = [wx.NewId() for _init_ctrls in range(8)] 
     34[wxID_MAINFRAME, wxID_SPLITTERWINDOW1] = [wx.NewId() for _init_ctrls in range(2)] 
    3535 
    3636 
     
    8686              True, True, True, True)) 
    8787 
    88         self.WritePacketBtn = wx.Button(id=wxID_WRITEPACKETBTN, label='Write Packet', 
    89               name='WritePacketBtn', parent=self.splitterWindow1, pos=wx.Point(155, 150), 
    90               size=wx.Size(165, 50)) 
    91         self.WritePacketBtn.SetFont(wx.Font(16, wx.SWISS, wx.NORMAL, wx.BOLD, False)) 
    92         self.WritePacketBtn.SetBackgroundColour("green") 
    93         self.WritePacketBtn.Bind(wx.EVT_BUTTON, self.OnWritePacketBtnButton, 
    94               id=wxID_WRITEPACKETBTN) 
    95  
    96         self.WriteBufferBtn = wx.Button(id=wxID_WRITEBUFFERBTN, label='Write BUFFER', 
    97               name='WriteBufferBtn', parent=self.splitterWindow1, pos=wx.Point(155, 210), 
    98               size=wx.Size(165, 50)) 
    99         self.WriteBufferBtn.SetFont(wx.Font(16, wx.SWISS, wx.NORMAL, wx.BOLD, False)) 
    100         self.WriteBufferBtn.SetBackgroundColour("green") 
    101         self.WriteBufferBtn.Bind(wx.EVT_BUTTON, self.OnWriteBufferBtnButton, 
    102               id=wxID_WRITEBUFFERBTN) 
    103  
    104         ##### 
    105         ## if you want an image on the button 
    106         # button_bmp = wx.Image("../AWG/my_image.bmp", wx.BITMAP_TYPE_BMP).ConvertToBitmap() 
    107         # self.WritePacketBtn = buttons.GenBitmapTextButton(self.splitterWindow1, 
    108         #       wxID_WRITEPACKETBTN,button_bmp, 'Write Packet', 
    109         #       name='WritePacketBtn', pos=wx.Point(155, 250), 
    110         #       size=wx.Size(300, 100), style=0) 
    111         # self.WritePacketBtn.Bind(wx.EVT_BUTTON, self.OnWritePacketBtnButton, 
    112         #       id=wxID_WRITEPACKETBTN) 
    113         ##### 
    114  
    115         
    116         self.iFileNameEditor = wx.TextCtrl(id=wxID_IFILENAMEEDITOR, 
    117               name=u'iFileNameEditor', parent=self.splitterWindow1, pos=wx.Point(215, 50), 
    118               size=wx.Size(250, 30), style=0, value=u'') 
    119                            
    120  
    121         self.qFileNameEditor = wx.TextCtrl(id=wxID_QFILENAMEEDITOR, 
    122               name=u'qFileNameEditor', parent=self.splitterWindow1, pos=wx.Point(215, 100), 
    123               size=wx.Size(250, 30), style=0, value=u'') 
    12488 
    12589 
    126         self.iFileStaticText = wx.StaticText(id=wxID_IFILESTATICTEXT, 
    127               label=u'I channel file:', name='qFileStaticText', parent=self.splitterWindow1, 
    128               pos=wx.Point(55, 50), size= wx.Size(100, 20), style=0) 
    129         self.iFileStaticText.SetFont(wx.Font(10,wx.SWISS,wx.NORMAL,wx.BOLD,True,u'Sans')) 
    130  
    131         self.qFileStaticText = wx.StaticText(id=wxID_QFILESTATICTEXT, 
    132               label=u'Q channel file:', name='qFileStaticText', parent=self.splitterWindow1, 
    133               pos=wx.Point(55, 100), size= wx.Size(100, 20), style=0) 
    134         self.qFileStaticText.SetFont(wx.Font(10,wx.SWISS,wx.NORMAL,wx.BOLD,True,u'Sans')) 
    135    
    136   
    137  
    138     def OnWritePacketBtnButton(self,event): 
    139         #get the file names from the file name editors in the GUI 
    140         self.i_file_name = self.iFileNameEditor.GetLineText(0) 
    141         self.q_file_name = self.qFileNameEditor.GetLineText(0) 
    142  
    143         #write the data out 
    144         open_file = open(self.i_file_name, 'w')   #open the file for writing 
    145         open_file.write(str(self.I_data)) 
    146         open_file.close() 
    147  
    148         open_file = open(self.q_file_name, 'w')   #open the file for writing 
    149         open_file.write(str(self.Q_data)) 
    150         open_file.close() 
    151  
    152     def OnWriteBufferBtnButton(self,event): 
    153         #get the file names from the file name editors in the GUI 
    154         self.i_file_name = self.iFileNameEditor.GetLineText(0) 
    155         self.q_file_name = self.qFileNameEditor.GetLineText(0) 
    156  
    157         #write the data out 
    158         open_file = open(self.i_file_name, 'w')   #open the file for writing 
    159         open_file.write(str(self.I_data)) 
    160         open_file.close() 
    161  
    162         open_file = open(self.q_file_name, 'w')   #open the file for writing 
    163         open_file.write(str(self.Q_data)) 
    164         open_file.close() 
    165  
     90     
    16691    def OnFileExit(self, event): 
    16792        '''This is what will happen when you select File -> Exit in the menu bar''' 
     
    203128          
    204129         
    205          #create the class instance of the write_to_file class  
    206          self.my_file_writer = write_to_file_short(self.orb, self) 
     130         #create the class instance of the display class  
     131         self.my_file_writer = display_short(self.orb, self) 
    207132 
    208133         obj_poa = self.orb.resolve_initial_references("RootPOA") 
     
    210135         poaManager.activate() 
    211136         obj_poa.activate_object(self.my_file_writer) 
    212          self.PortHandle.connectPort(self.my_file_writer._this(), "thisismyconnectionid_w2file") 
     137         self.PortHandle.connectPort(self.my_file_writer._this(), "thisismyconnectionid_disp") 
    213138         #orb.run() 
    214139 
     
    221146    def __del__(self): 
    222147        if self.CORBA_being_used: 
    223             self.PortHandle.disconnectPort("thisismyconnectionid_w2file") 
     148            self.PortHandle.disconnectPort("thisismyconnectionid_disp") 
    224149            while (_time.time() - self.my_local_plot.end_time) < 1.5: 
    225150                #print (time.time() - self.my_local_plot.end_time)