| 34 | | [wxID_MAINFRAME, wxID_SPLITTERWINDOW1, wxID_WRITEPACKETBTN, wxID_IFILENAMEEDITOR, wxID_QFILENAMEEDITOR, wxID_IFILESTATICTEXT,wxID_QFILESTATICTEXT] = [wx.NewId() for _init_ctrls in range(7)] |
| | 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)] |
| 92 | | |
| | 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 | |
| | 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() |