| 23 | | #get the file names from the file name editors in the GUI |
| 24 | | self.i_file_name = self.gui.iFileNameEditor.GetLineText(0) |
| 25 | | self.q_file_name = self.gui.qFileNameEditor.GetLineText(0) |
| 26 | | |
| 27 | | #write the data out |
| 28 | | open_file = open(self.i_file_name, 'w') #open the file for writing |
| 29 | | open_file.write(str(I_data)) |
| 30 | | open_file.close() |
| 31 | | |
| 32 | | open_file = open(self.q_file_name, 'w') #open the file for writing |
| 33 | | open_file.write(str(Q_data)) |
| 34 | | open_file.close() |
| | 23 | '''Store the data to be written to file when the Write Packet button is bushed''' |
| | 24 | self.gui.I_data = I_data |
| | 25 | self.gui.Q_data = Q_data |
| | 26 | |
| 93 | | self.PushPacketBtn = wx.Button(id=wxID_PUSHPACKETBTN, label='Do Nothing', |
| 94 | | name='PushPacketBtn', parent=self.splitterWindow1, pos=wx.Point(155, 150), |
| | 85 | self.WritePacketBtn = wx.Button(id=wxID_WRITEPACKETBTN, label='Write Packet', |
| | 86 | name='WritePacketBtn', parent=self.splitterWindow1, pos=wx.Point(155, 150), |
| 96 | | self.PushPacketBtn.SetFont(wx.Font(16, wx.SWISS, wx.NORMAL, wx.BOLD, False)) |
| 97 | | self.PushPacketBtn.SetBackgroundColour("grey") |
| 98 | | self.PushPacketBtn.Bind(wx.EVT_BUTTON, self.OnPushPacketBtnButton, |
| | 88 | self.WritePacketBtn.SetFont(wx.Font(16, wx.SWISS, wx.NORMAL, wx.BOLD, False)) |
| | 89 | self.WritePacketBtn.SetBackgroundColour("green") |
| | 90 | self.WritePacketBtn.Bind(wx.EVT_BUTTON, self.OnWritePacketBtnButton, |
| 104 | | # self.PushPacketBtn = buttons.GenBitmapTextButton(self.splitterWindow1, |
| 105 | | # wxID_PUSHPACKETBTN,button_bmp, 'Push Packet', |
| 106 | | # name='PushPacketBtn', pos=wx.Point(155, 250), |
| | 96 | # self.WritePacketBtn = buttons.GenBitmapTextButton(self.splitterWindow1, |
| | 97 | # wxID_PUSHPACKETBTN,button_bmp, 'Write Packet', |
| | 98 | # name='WritePacketBtn', pos=wx.Point(155, 250), |
| 135 | | |
| 136 | | |
| 137 | | def OnPushPacketBtnButton(self,event): |
| 138 | | '''This button is not supported yet''' |
| 139 | | print "this button is not supported at the moment" |
| 140 | | |
| | 127 | def OnWritePacketBtnButton(self,event): |
| | 128 | #get the file names from the file name editors in the GUI |
| | 129 | self.i_file_name = self.iFileNameEditor.GetLineText(0) |
| | 130 | self.q_file_name = self.qFileNameEditor.GetLineText(0) |
| | 131 | |
| | 132 | #write the data out |
| | 133 | open_file = open(self.i_file_name, 'w') #open the file for writing |
| | 134 | open_file.write(str(self.I_data)) |
| | 135 | open_file.close() |
| | 136 | |
| | 137 | open_file = open(self.q_file_name, 'w') #open the file for writing |
| | 138 | open_file.write(str(self.Q_data)) |
| | 139 | open_file.close() |