| 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'') |
| 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 | |