Changeset 3588

Show
Ignore:
Timestamp:
05/02/07 10:32:09 (6 years ago)
Author:
DrewCormier
Message:

added labels. GUI format changes

Location:
experimental/AWG/trunk/AWG
Files:
2 modified

Legend:

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

    r3587 r3588  
    5252 
    5353#generate wx ids for my wx controls 
    54 [wxID_MAINFRAME, wxID_SPLITTERWINDOW1, wxID_PUSHPACKETBTN, wxID_ISOURCECHOICE, wxID_IFILENAMEEDITOR, wxID_QSOURCECHOICE, wxID_QFILENAMEEDITOR, wxID_IFILESTATICTEXT,wxID_QFILESTATICTEXT] = [wx.NewId() for _init_ctrls in range(9)] 
     54[wxID_MAINFRAME, wxID_SPLITTERWINDOW1, wxID_PUSHPACKETBTN, wxID_ISOURCECHOICE, wxID_IFILENAMEEDITOR, wxID_QSOURCECHOICE, wxID_QFILENAMEEDITOR, wxID_ISOURCESTATICTEXT, wxID_QSOURCESTATICTEXT, wxID_IFILESTATICTEXT,wxID_QFILESTATICTEXT] = [wx.NewId() for _init_ctrls in range(11)] 
    5555 
    5656 
     
    103103    def _init_ctrls(self, prnt): 
    104104        wx.Frame.__init__(self, id=wxID_MAINFRAME, name='', parent=prnt, 
    105               pos=wx.Point(374, 370), size=wx.Size(570, 570), 
     105              pos=wx.Point(374, 370), size=wx.Size(520, 370), 
    106106              style=wx.DEFAULT_FRAME_STYLE, title='Arbitrary Waveform Generator') 
    107107 
    108108        self.splitterWindow1 = wx.SplitterWindow(id=wxID_SPLITTERWINDOW1, 
    109109              name='splitterWindow1', parent=self, point=wx.Point(1, 1), 
    110               size=wx.Size(570, 570), style=wx.SP_3D) 
     110              size=wx.Size(570, 370), style=wx.SP_3D) 
    111111        self.splitterWindow1.SetConstraints(LayoutAnchors(self.splitterWindow1, 
    112112              True, True, True, True)) 
     
    114114        self.PushPacketBtn = wx.Button(id=wxID_PUSHPACKETBTN, label='PushPacket', 
    115115              name='PushPacketBtn', parent=self.splitterWindow1, pos=wx.Point(155, 250), 
    116               size=wx.Size(130, 27), style=0) 
     116              size=wx.Size(130, 55), style=0) 
    117117        self.PushPacketBtn.Bind(wx.EVT_BUTTON, self.OnPushPacketBtnButton, 
    118118              id=wxID_PUSHPACKETBTN) 
     
    127127        self.iFileNameEditor = wx.TextCtrl(id=wxID_IFILENAMEEDITOR, 
    128128              name=u'iFileNameEditor', parent=self.splitterWindow1, pos=wx.Point(215, 150), 
    129               size=wx.Size(200, 30), style=0, value=u'') 
     129              size=wx.Size(250, 30), style=0, value=u'') 
    130130                           
    131131        self.qSourceChoice = wx.Choice(choices=self.available_sources,  
     
    138138        self.qFileNameEditor = wx.TextCtrl(id=wxID_QFILENAMEEDITOR, 
    139139              name=u'qFileNameEditor', parent=self.splitterWindow1, pos=wx.Point(215, 200), 
    140               size=wx.Size(200, 30), style=0, value=u'') 
    141  
     140              size=wx.Size(250, 30), style=0, value=u'') 
     141 
     142        self.iSourceStaticText = wx.StaticText(id=wxID_ISOURCESTATICTEXT, 
     143              label=u'I channel source:', name='qSourceStaticText', parent=self.splitterWindow1, 
     144              pos=wx.Point(55, 50), size= wx.Size(100, 20), style=0) 
     145        self.iSourceStaticText.SetFont(wx.Font(10,wx.SWISS,wx.NORMAL,wx.BOLD,True,u'Sans')) 
     146 
     147        self.qSourceStaticText = wx.StaticText(id=wxID_QSOURCESTATICTEXT, 
     148              label=u'Q channel Source:', name='qSourceStaticText', parent=self.splitterWindow1, 
     149              pos=wx.Point(55, 100), size= wx.Size(100, 20), style=0) 
     150        self.qSourceStaticText.SetFont(wx.Font(10,wx.SWISS,wx.NORMAL,wx.BOLD,True,u'Sans')) 
     151   
     152 
     153        self.iFileStaticText = wx.StaticText(id=wxID_IFILESTATICTEXT, 
     154              label=u'I channel file:', name='qFileStaticText', parent=self.splitterWindow1, 
     155              pos=wx.Point(55, 150), size= wx.Size(100, 20), style=0) 
     156        self.iFileStaticText.SetFont(wx.Font(10,wx.SWISS,wx.NORMAL,wx.BOLD,True,u'Sans')) 
     157 
     158        self.qFileStaticText = wx.StaticText(id=wxID_QFILESTATICTEXT, 
     159              label=u'Q channel file:', name='qFileStaticText', parent=self.splitterWindow1, 
     160              pos=wx.Point(55, 200), size= wx.Size(100, 20), style=0) 
     161        self.qFileStaticText.SetFont(wx.Font(10,wx.SWISS,wx.NORMAL,wx.BOLD,True,u'Sans')) 
     162   
     163  
    142164 
    143165    def OnSourceChoiceChoice(self,event): 
    144         # #TODO: move this suff to push packet button method 
    145         # if i_source_selected == 'file' or q_source_selected == 'file': 
    146         #     pass   #wait for push packet to be pressed 
    147         # else: 
    148         #     AWG_instance = AWG(self) 
    149         #     self.I = AWG_instance.get_signal(i_source_selected, 'none')  #'none' is no file name 
    150         #     self.Q = AWG_instance.get_signal(q_source_selected, 'none')  #'none' is no file name 
    151         pass 
     166        '''If a source option other than "file" is selected, "grey out" the file input field''' 
     167 
     168        i_source = self.iSourceChoice.GetStringSelection() 
     169        if i_source == 'file': 
     170            self.iFileNameEditor.Enable(True) 
     171        else: 
     172            self.iFileNameEditor.Enable(False) 
     173 
     174        q_source = self.qSourceChoice.GetStringSelection() 
     175        if q_source == 'file': 
     176            self.qFileNameEditor.Enable(True) 
     177        else: 
     178            self.qFileNameEditor.Enable(False) 
     179         
    152180 
    153181    def OnPushPacketBtnButton(self,event): 
  • experimental/AWG/trunk/AWG/sources.py

    r3585 r3588  
    1010    def get_sources_list(self): 
    1111        #TODO: setupt __init__ in AWG Frame so that 'file' can be first 
    12         return ['sine', 'cosine', 'random', 'file', 'zeros'] 
     12        return ['file','sine', 'cosine', 'random', 'zeros'] 
    1313 
    1414    def gen_sine(self, freq, len, type):