def HistoryDataQuery(self, functionPara): Obj = ReqData() startTime = (int(self.StartTimeYear.GetValue()), int(self.StartTimeMonth.GetValue()), int(self.StartTimeDay.GetValue()), int(self.StartTimeHour.GetValue()), int(self.StartTimeMinute.GetValue())) endTime = (int(self.EndTimeYear.GetValue()), int(self.EndTimeMonth.GetValue()), int(self.EndTimeDay.GetValue()), int(self.EndTimeHour.GetValue()), int(self.EndTimeMinute.GetValue())) apointID = int(self.ApointID.GetValue()) Obj.CommonHeader = FrameHeader(0x55, functionPara, staticVar.getid() & 0x00FF, staticVar.getid() >> 8) Obj.CommonTail = FrameTail(0, 0, 0xAA) Obj.ApointID_h = apointID >> 8 Obj.ApointID_l = apointID & 0x00FF Obj.StartTime = self.ByteToTime(startTime) Obj.EndTime = self.ByteToTime(endTime) if (staticVar.getSock()): staticVar.getSock().sendall(bytearray(Obj))
def __init__(self, parent, func): wx.Dialog.__init__(self, parent, -1, u"台站登记属性查询", size=(300, 200)) self.SetFont( wx.Font(10, wx.ROMAN, wx.NORMAL, wx.LIGHT, underline=False, faceName=u"微软雅黑", encoding=wx.FONTENCODING_DEFAULT)) ############################### self.parent = parent self.tail = FrameTail(0, 0, 0xAA) self.id = staticVar.getid() self.lowid = self.id & 0x00FF self.highid = self.id >> 8 self.func = func ############################################### panel = wx.Panel(self, -1) sizer = wx.BoxSizer(wx.VERTICAL) self.FreqStart = wx.TextCtrl(panel, -1, size=(60, 25)) self.FreqEnd = wx.TextCtrl(panel, -1, size=(60, 25)) sizer.Add((20, 15)) sizer.Add(wx.StaticText(panel, -1, u"台站指定频率范围(MHz): ", size=(150, 25)), 0, wx.LEFT, 20) sizer.Add((20, 10)) hBox3 = wx.BoxSizer(wx.HORIZONTAL) hBox3.Add(self.FreqStart, 0, wx.LEFT | wx.ALIGN_BOTTOM, 20) hBox3.Add(wx.StaticText(panel, -1, u"——"), 0, wx.LEFT | wx.RIGHT | wx.ALIGN_BOTTOM, 10) hBox3.Add(self.FreqEnd, 0, wx.ALIGN_BOTTOM, 20) sizer.Add(hBox3) sizer.Add((20, 20)) hBox1 = wx.BoxSizer(wx.HORIZONTAL) self.btn_ok = wx.Button(panel, -1, "OK", size=(60, 25)) hBox1.Add(self.btn_ok, 0, wx.LEFT, 20) hBox1.Add(wx.Button(panel, wx.ID_CANCEL, "CANCEL", size=(60, 25)), 0, wx.LEFT, 20) sizer.Add(hBox1) panel.SetSizer(sizer) self.Layout() self.Centre(wx.BOTH) #Events self.btn_ok.Bind(wx.EVT_BUTTON, self.OnbtnOk)
def OnbtnOk(self, event): ID = int(self.StationID.GetValue()) curStationPro = QueryCurStationPro() curStationPro.CommonHeader = FrameHeader(0x55, 0xA6, staticVar.getid() & 0x00FF, staticVar.getid() >> 8) curStationPro.CommonTail = FrameTail(0, 0, 0xAA) curStationPro.Identifier_h = ID >> 16 curStationPro.Identifier_m = (ID & 0x00FF00) >> 8 curStationPro.Identifier_l = ID & 0x0000FF if (self.radioBox.GetSelection()): curStationPro.LocateWay = 0x0F centreFreq = float(self.CentreFreq.GetValue()) bandWidth = int(self.BandWidth.GetSelection()) + 1 centreFreq_I = int(centreFreq) centreFreq_F = int((centreFreq - int(centreFreq)) * 2**10) curStationPro.Param.HighCentreFreqInteger = centreFreq_I >> 6 curStationPro.Param.LowCentreFreqInteger = centreFreq_I & 0x003F curStationPro.Param.HighCentreFreqFraction = centreFreq_F >> 8 curStationPro.Param.LowCentreFreqFraction = centreFreq_F & 0x0FF curStationPro.Param.UploadNum = int(self.UploadNum.GetValue()) curStationPro.Param.DataRate = bandWidth curStationPro.Param.BandWidth = bandWidth startTime=(int(self.StartTimeYear.GetValue()),int(self.StartTimeMonth.GetValue()), \ int(self.StartTimeDay.GetValue()),int(self.StartTimeHour.GetValue()), \ int(self.StartTimeMinute.GetValue()),int(self.StartTimeSecond.GetValue())) curStationPro.Time.HighYear = startTime[0] >> 4 curStationPro.Time.LowYear = startTime[0] & 0x00F curStationPro.Time.Month = startTime[1] curStationPro.Time.Day = startTime[2] curStationPro.Time.HighHour = startTime[3] >> 2 curStationPro.Time.LowHour = startTime[3] & 0x03 curStationPro.Time.Minute = startTime[4] curStationPro.Time.Second = startTime[5] # # if(staticVar.getSock()): # staticVar.getSock().sendall(bytearray(curStationPro)) self.parent.queueRequest.put(curStationPro) self.Close()
class QueryPort: ############################### tail = FrameTail(0, 0, 0xAA) @classmethod def query_port(cls, func): id_for = staticVar.getid() lowid = id_for & 0x00FF highid = id_for >> 8 query = Query() query.CommonHeader = FrameHeader(0x55, func, lowid, highid) query.CommonTail = cls.tail for i in bytearray(query): print i, staticVar.getSock().sendall(bytearray(query))
def __init__(self,parent): wx.Dialog.__init__(self,parent,-1,u"录音回放",wx.DefaultPosition,wx.Size(408,400)) ##############硬件通信############### self.id = staticVar.getid() self.lowid = self.id & 0x00FF self.highid = self.id >> 8 self.tail = FrameTail(0,0,0xAA) self.outPoint = staticVar.outPoint ################################## self.wave2_head_flag = 1 self.count_last = 0 self.time_val_last = 0 self.save_wave2_flg = 1 self.file_path_last = u'' self.choosefilemode = 2 self.iq_file_flg = 1 # self.drawFlag = 1 ################################## self.parent = parent self.CreatePanel() self.Layout()
def __init__(self, parent): wx.Dialog.__init__(self, parent, id=wx.ID_ANY, title=u"压制发射", pos=wx.DefaultPosition, size=wx.Size(392, 382), style=wx.DEFAULT_DIALOG_STYLE) ########################################### self.T1 = 0 self.T2 = 0 self.T3 = 0 self.T4 = 0 self.press_mode = 5 self.id = staticVar.getid() self.lowid = self.id & 0x00FF self.highid = self.id >> 8 self.tail = FrameTail(0, 0, 0xAA) self.outPoint = staticVar.outPoint #### show ###### self.parent = parent self.show_recv_set = self.parent.show_recv_set self.byte_to_package = self.parent.byte_to_package ########################################### self.SetSizeHintsSz(wx.DefaultSize, wx.DefaultSize) gSizer7 = wx.GridSizer(1, 1, 0, 0) self.m_notebook2 = wx.Notebook(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, 0) self.m_notebook2.SetFont( wx.Font(10, wx.ROMAN, wx.NORMAL, wx.LIGHT, underline=False, faceName=u"微软雅黑", encoding=wx.FONTENCODING_DEFAULT)) self.m_panel7 = wx.Panel(self.m_notebook2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL) gSizer8 = wx.GridSizer(8, 2, 0, 0) gSizer8.AddSpacer((0, 0), 1, wx.EXPAND, 5) gSizer8.AddSpacer((0, 0), 1, wx.EXPAND, 5) self.m_staticText3 = wx.StaticText(self.m_panel7, wx.ID_ANY, u"压制设置", wx.DefaultPosition, wx.DefaultSize, 0) self.m_staticText3.Wrap(-1) gSizer8.Add(self.m_staticText3, 0, wx.ALL, 5) m_press_setChoices = [u"结束压制", u"单频点自动", u"单频点手动", u"双频点自动", u"双频点手动"] self.m_press_set = wx.Choice(self.m_panel7, wx.ID_ANY, wx.DefaultPosition, wx.Size(140, -1), m_press_setChoices, 0) self.m_press_set.SetSelection(0) gSizer8.Add(self.m_press_set, 0, wx.ALL, 5) self.m_staticText4 = wx.StaticText(self.m_panel7, wx.ID_ANY, u"压制信号类型", wx.DefaultPosition, wx.DefaultSize, 0) self.m_staticText4.Wrap(-1) gSizer8.Add(self.m_staticText4, 0, wx.ALL, 5) m_press_signaltypeChoices = [ u"单频正弦波信号", u"等幅多频信号", u"噪声调频信号", u"数字射频储存DRM信号" ] self.m_press_signaltype = wx.Choice(self.m_panel7, wx.ID_ANY, wx.DefaultPosition, wx.Size(140, -1), m_press_signaltypeChoices, 0) self.m_press_signaltype.SetSelection(0) gSizer8.Add(self.m_press_signaltype, 0, wx.ALL, 5) self.m_staticText5 = wx.StaticText(self.m_panel7, wx.ID_ANY, u"压制带宽", wx.DefaultPosition, wx.DefaultSize, 0) self.m_staticText5.Wrap(-1) gSizer8.Add(self.m_staticText5, 0, wx.ALL, 5) m_press_bwChoices = [u"单谱线(正弦波)", u"(等幅多边,噪声调频)", u"直接IQ调制发射(DRM)"] self.m_press_bw = wx.Choice(self.m_panel7, wx.ID_ANY, wx.DefaultPosition, wx.Size(140, -1), m_press_bwChoices, 0) self.m_press_bw.SetSelection(0) gSizer8.Add(self.m_press_bw, 0, wx.ALL, 5) self.m_staticText6 = wx.StaticText(self.m_panel7, wx.ID_ANY, u"压制频率1(MHz)", wx.DefaultPosition, wx.DefaultSize, 0) self.m_staticText6.Wrap(-1) gSizer8.Add(self.m_staticText6, 0, wx.ALL, 5) self.m_freq1 = wx.TextCtrl(self.m_panel7, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0) gSizer8.Add(self.m_freq1, 0, wx.ALL, 5) self.m_staticText7 = wx.StaticText(self.m_panel7, wx.ID_ANY, u"压制频率2(MHz)", wx.DefaultPosition, wx.DefaultSize, 0) self.m_staticText7.Wrap(-1) gSizer8.Add(self.m_staticText7, 0, wx.ALL, 5) self.m_freq2 = wx.TextCtrl(self.m_panel7, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0) gSizer8.Add(self.m_freq2, 0, wx.ALL, 5) self.btn_press_set = wx.Button(self.m_panel7, wx.ID_ANY, u"设置", wx.DefaultPosition, wx.DefaultSize, 0) gSizer8.Add(self.btn_press_set, 0, wx.ALL, 5) self.btn_press_cancel = wx.Button(self.m_panel7, wx.ID_ANY, u"取消", wx.DefaultPosition, wx.DefaultSize, 0) gSizer8.Add(self.btn_press_cancel, 0, wx.ALL, 5) self.m_panel7.SetSizer(gSizer8) self.m_panel7.Layout() gSizer8.Fit(self.m_panel7) self.m_notebook2.AddPage(self.m_panel7, u"压制设置", False) self.m_panel8 = wx.Panel(self.m_notebook2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL) gSizer4 = wx.GridSizer(6, 2, 0, 0) gSizer4.AddSpacer((0, 0), 1, wx.EXPAND, 5) gSizer4.AddSpacer((0, 0), 1, wx.EXPAND, 5) self.m_staticText71 = wx.StaticText(self.m_panel8, wx.ID_ANY, u"压制发射衰减(dB)", wx.DefaultPosition, wx.DefaultSize, 0) self.m_staticText71.Wrap(-1) gSizer4.Add(self.m_staticText71, 0, wx.ALL, 5) self.m_slider_weak = wx.Slider( self.m_panel8, wx.ID_ANY, 0, 0, 89, wx.DefaultPosition, wx.Size(150, -1), wx.SL_HORIZONTAL | wx.SL_LABELS | wx.SL_SELRANGE) gSizer4.Add(self.m_slider_weak, 0, wx.ALL, 5) self.btn_param_set = wx.Button(self.m_panel8, wx.ID_ANY, u"设置", wx.DefaultPosition, wx.DefaultSize, 0) gSizer4.Add(self.btn_param_set, 0, wx.ALL, 5) self.m_button7 = wx.Button(self.m_panel8, wx.ID_ANY, u"取消", wx.DefaultPosition, wx.DefaultSize, 0) gSizer4.Add(self.m_button7, 0, wx.ALL, 5) self.m_panel8.SetSizer(gSizer4) self.m_panel8.Layout() gSizer4.Fit(self.m_panel8) self.m_notebook2.AddPage(self.m_panel8, u"参数设置", True) self.m_panel9 = wx.Panel(self.m_notebook2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL) gSizer71 = wx.GridSizer(7, 1, 0, 0) Choices = [u"压制发射衰减", u"压制中心频率", u"压制模式查询"] self.radio_pressquery = wx.RadioBox(self.m_panel9, wx.ID_ANY, u"查询项", wx.DefaultPosition, wx.Size(120, 140), Choices, 1, wx.RA_SPECIFY_COLS) self.radio_pressquery.SetSelection(2) gSizer71.Add(self.radio_pressquery, 0, wx.ALL, 5) gSizer71.AddSpacer((0, 0), 1, wx.EXPAND, 5) gSizer71.AddSpacer((0, 0), 1, wx.EXPAND, 5) gSizer71.AddSpacer((0, 0), 1, wx.EXPAND, 5) self.btn_press_query = wx.Button(self.m_panel9, wx.ID_ANY, u"查询", wx.DefaultPosition, wx.DefaultSize, 0) # gSizer71.Add( self.btn_press_query, 0, wx.ALL, 5 ) gSizer71.Add(self.btn_press_query, 0, wx.ALIGN_BOTTOM | wx.ALIGN_CENTER, 5) self.m_panel9.SetSizer(gSizer71) self.m_panel9.Layout() gSizer71.Fit(self.m_panel9) self.m_notebook2.AddPage(self.m_panel9, u"查询", False) gSizer7.Add(self.m_notebook2, 1, wx.EXPAND | wx.ALL, 5) self.SetSizer(gSizer7) self.Layout() self.Centre(wx.BOTH) # Connect Events self.m_press_set.Bind(wx.EVT_CHOICE, self.m_press_setOnChoice) self.btn_press_set.Bind(wx.EVT_BUTTON, self.btn_press_setOnChoice) self.btn_param_set.Bind(wx.EVT_BUTTON, self.btn_param_setOnChoice) self.btn_press_query.Bind(wx.EVT_BUTTON, self.btn_press_queryOnChoice)
def __init__( self, parent ): wx.Dialog.__init__ ( self, parent, id = wx.ID_ANY, title = u"定频接收", pos = wx.DefaultPosition, size = wx.Size( 387,392 ), style = wx.DEFAULT_DIALOG_STYLE ) ############################## self.id=staticVar.getid() self.lowid=self.id&0x00FF self.highid=self.id>>8 self.tail=FrameTail(0,0,0xAA) self.outPoint=staticVar.outPoint ############################### self.parent=parent #### show ######### self.show_recv_set=self.parent.show_recv_set self.byte_to_package=self.parent.byte_to_package self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize ) gSizer1 = wx.GridSizer( 1, 1, 0, 0 ) self.m_notebook1 = wx.Notebook( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_notebook1.SetFont(wx.Font( 10,wx.ROMAN,wx.NORMAL,wx.LIGHT,underline=False,faceName=u"微软雅黑",encoding=wx.FONTENCODING_DEFAULT )) self.m_panel1 = wx.Panel( self.m_notebook1, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL ) gSizer2 = wx.GridSizer( 9, 3, 0, 0 ) gSizer2.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 ) gSizer2.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 ) gSizer2.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 ) self.m_check_freq1 = wx.CheckBox( self.m_panel1, wx.ID_ANY, u"第一个中心频率", wx.DefaultPosition, wx.DefaultSize, 0 ) gSizer2.Add( self.m_check_freq1, 0, wx.ALL, 5 ) self.m_text_freq1 = wx.TextCtrl( self.m_panel1, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 ) gSizer2.Add( self.m_text_freq1, 0, wx.ALL, 5 ) self.m_staticText6 = wx.StaticText( self.m_panel1, wx.ID_ANY, u"Mhz", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText6.Wrap( -1 ) gSizer2.Add( self.m_staticText6, 0, wx.ALL, 5 ) self.m_check_freq2 = wx.CheckBox( self.m_panel1, wx.ID_ANY, u"第二个中心频率", wx.DefaultPosition, wx.DefaultSize, 0 ) gSizer2.Add( self.m_check_freq2, 0, wx.ALL, 5 ) self.m_text_freq2 = wx.TextCtrl( self.m_panel1, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 ) gSizer2.Add( self.m_text_freq2, 0, wx.ALL, 5 ) self.m_staticText7 = wx.StaticText( self.m_panel1, wx.ID_ANY, u"Mhz", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText7.Wrap( -1 ) gSizer2.Add( self.m_staticText7, 0, wx.ALL, 5 ) self.m_check_freq3 = wx.CheckBox( self.m_panel1, wx.ID_ANY, u"第三个中心频率", wx.DefaultPosition, wx.DefaultSize, 0 ) gSizer2.Add( self.m_check_freq3, 0, wx.ALL, 5 ) self.m_text_freq3 = wx.TextCtrl( self.m_panel1, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 ) gSizer2.Add( self.m_text_freq3, 0, wx.ALL, 5 ) self.m_staticText8 = wx.StaticText( self.m_panel1, wx.ID_ANY, u"Mhz", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText8.Wrap( -1 ) gSizer2.Add( self.m_staticText8, 0, wx.ALL, 5 ) self.m_staticText11 = wx.StaticText( self.m_panel1, wx.ID_ANY, u"IQ 带宽/数据率", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText11.Wrap( -1 ) gSizer2.Add( self.m_staticText11, 0, wx.ALL, 5 ) m_choice_bwChoices = [ u"5", u"2.5", u"1", u"0.5", u"0.1" ] self.m_choice_bw = wx.Choice( self.m_panel1, wx.ID_ANY, wx.DefaultPosition, wx.Size( 110,-1 ), m_choice_bwChoices, 0 ) self.m_choice_bw.SetSelection( 0 ) gSizer2.Add( self.m_choice_bw, 0, wx.ALL, 5 ) self.m_staticText12 = wx.StaticText( self.m_panel1, wx.ID_ANY, u"Mhz", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText12.Wrap( -1 ) gSizer2.Add( self.m_staticText12, 0, wx.ALL, 5 ) self.m_staticText13 = wx.StaticText( self.m_panel1, wx.ID_ANY, u"上传数据块个数", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText13.Wrap( -1 ) gSizer2.Add( self.m_staticText13, 0, wx.ALL, 5 ) self.m_text_up_num = wx.TextCtrl( self.m_panel1, wx.ID_ANY, u"1", wx.DefaultPosition, wx.DefaultSize, 0 ) gSizer2.Add( self.m_text_up_num, 0, wx.ALL, 5 ) self.m_staticText14 = wx.StaticText( self.m_panel1, wx.ID_ANY, u"(<=256)", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText14.Wrap( -1 ) gSizer2.Add( self.m_staticText14, 0, wx.ALL, 5 ) self.m_staticText15 = wx.StaticText( self.m_panel1, wx.ID_ANY, u"延时时间", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText15.Wrap( -1 ) gSizer2.Add( self.m_staticText15, 0, wx.ALL, 5 ) self.m_text_dtime = wx.TextCtrl( self.m_panel1, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 ) gSizer2.Add( self.m_text_dtime, 0, wx.ALL, 5 ) self.m_staticText16 = wx.StaticText( self.m_panel1, wx.ID_ANY, u"s", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText16.Wrap( -1 ) gSizer2.Add( self.m_staticText16, 0, wx.ALL, 5 ) gSizer2.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 ) self.m_btn_set = wx.Button( self.m_panel1, wx.ID_ANY, u"确定", wx.DefaultPosition, wx.DefaultSize, 0 ) gSizer2.Add( self.m_btn_set, 0, wx.ALL, 5 ) self.m_btn_cancel = wx.Button( self.m_panel1, wx.ID_ANY, u"取消", wx.DefaultPosition, wx.DefaultSize, 0 ) gSizer2.Add( self.m_btn_cancel, 0,wx.ALL, 5 ) self.m_panel1.SetSizer( gSizer2 ) self.m_panel1.Layout() gSizer2.Fit( self.m_panel1 ) self.m_notebook1.AddPage( self.m_panel1, u"定频设置", False ) self.m_panel2 = wx.Panel( self.m_notebook1, wx.ID_ANY, wx.DefaultPosition, wx.Size( 200,-1 ), wx.TAB_TRAVERSAL ) gSizer4 = wx.GridSizer( 9, 3, 0, 0 ) gSizer4.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 ) gSizer4.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 ) gSizer4.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 ) gSizer4.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 ) gSizer4.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 ) gSizer4.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 ) gSizer4.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 ) gSizer4.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 ) gSizer4.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 ) self.m_staticText19 = wx.StaticText( self.m_panel2, wx.ID_ANY, u"接收增益(dB)", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText19.Wrap( -1 ) gSizer4.Add( self.m_staticText19, 0, wx.ALIGN_CENTER|wx.ALIGN_RIGHT|wx.ALIGN_TOP|wx.ALL, 5 ) self.m_slider_gain = wx.Slider( self.m_panel2, wx.ID_ANY, 7, -1, 73, wx.Point( -1,-1 ), wx.Size( 150,20 ), wx.SL_HORIZONTAL|wx.SL_LABELS|wx.SL_SELRANGE ) gSizer4.Add( self.m_slider_gain, 0, wx.ALIGN_CENTER|wx.ALL, 5 ) gSizer4.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 ) gSizer4.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 ) gSizer4.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 ) gSizer4.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 ) gSizer4.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 ) gSizer4.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 ) gSizer4.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 ) gSizer4.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 ) gSizer4.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 ) gSizer4.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 ) gSizer4.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 ) self.btn_ok_param = wx.Button( self.m_panel2, wx.ID_ANY, u"确定", wx.DefaultPosition, wx.DefaultSize, 0 ) gSizer4.Add( self.btn_ok_param, 0, wx.ALL, 5 ) self.btn_cancel_param = wx.Button( self.m_panel2, wx.ID_ANY, u"取消", wx.DefaultPosition, wx.DefaultSize, 0 ) gSizer4.Add( self.btn_cancel_param, 0, wx.ALL, 5 ) self.m_panel2.SetSizer( gSizer4 ) self.m_panel2.Layout() self.m_notebook1.AddPage( self.m_panel2, u"参数设置", False ) self.m_panel3 = wx.Panel( self.m_notebook1, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL ) gSizer5 = wx.GridSizer( 9, 3, 0, 0 ) gSizer5.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 ) gSizer5.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 ) gSizer5.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 ) self.m_check_wave = wx.CheckBox( self.m_panel3, wx.ID_ANY, u"波形图", wx.DefaultPosition, wx.DefaultSize, 0 ) gSizer5.Add( self.m_check_wave, 0, wx.ALL, 5 ) self.m_check_spec = wx.CheckBox( self.m_panel3, wx.ID_ANY, u"功率谱", wx.DefaultPosition, wx.DefaultSize, 0 ) gSizer5.Add( self.m_check_spec, 0, wx.ALL, 5 ) self.m_check_water = wx.CheckBox( self.m_panel3, wx.ID_ANY, u"瀑布图", wx.DefaultPosition, wx.DefaultSize, 0 ) gSizer5.Add( self.m_check_water, 0, wx.ALL, 5 ) img_waveform = wx.Image('..//icons//waveform.png',wx.BITMAP_TYPE_ANY) bmp_waveform = wx.StaticBitmap(self.m_panel3,-1,wx.BitmapFromImage(img_waveform)) gSizer5.Add(bmp_waveform , 0 , wx.ALIGN_TOP|wx.ALIGN_CENTER_HORIZONTAL) img_spectrum = wx.Image('..//icons//spectrum.png',wx.BITMAP_TYPE_ANY) bmp_spectrum = wx.StaticBitmap(self.m_panel3,-1,wx.BitmapFromImage(img_spectrum)) gSizer5.Add(bmp_spectrum , 0 , wx.ALIGN_TOP|wx.ALIGN_CENTER_HORIZONTAL) img_waterfall = wx.Image('..//icons//waterfull.png',wx.BITMAP_TYPE_ANY) bmp_waterfall = wx.StaticBitmap(self.m_panel3,-1,wx.BitmapFromImage(img_waterfall)) gSizer5.Add(bmp_waterfall, 0 , wx.ALIGN_TOP|wx.ALIGN_CENTER_HORIZONTAL) gSizer5.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 ) gSizer5.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 ) gSizer5.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 ) self.m_check_CCDF = wx.CheckBox( self.m_panel3, wx.ID_ANY, u"CCDF", wx.DefaultPosition, wx.DefaultSize, 0 ) gSizer5.Add( self.m_check_CCDF, 0, wx.ALL, 5 ) self.m_check_eye = wx.CheckBox( self.m_panel3, wx.ID_ANY, u"眼图", wx.DefaultPosition, wx.DefaultSize, 0 ) gSizer5.Add( self.m_check_eye, 0, wx.ALL, 5 ) self.m_check_constel = wx.CheckBox( self.m_panel3, wx.ID_ANY, u"星座图", wx.DefaultPosition, wx.DefaultSize, 0 ) gSizer5.Add( self.m_check_constel, 0, wx.ALL, 5 ) img_ccdf = wx.Image('..//icons//ccdf.png',wx.BITMAP_TYPE_ANY) bmp_ccdf = wx.StaticBitmap(self.m_panel3,-1,wx.BitmapFromImage(img_ccdf)) gSizer5.Add(bmp_ccdf, 0 , wx.ALIGN_TOP|wx.ALIGN_CENTER_HORIZONTAL) img_eye = wx.Image('..//icons//eye.png',wx.BITMAP_TYPE_ANY) bmp_eye = wx.StaticBitmap(self.m_panel3,-1,wx.BitmapFromImage(img_eye)) gSizer5.Add(bmp_eye, 0 , wx.ALIGN_TOP|wx.ALIGN_CENTER_HORIZONTAL) img_constellation = wx.Image('..//icons//constellation.png',wx.BITMAP_TYPE_ANY) bmp_constellation = wx.StaticBitmap(self.m_panel3,-1,wx.BitmapFromImage(img_constellation)) gSizer5.Add(bmp_constellation, 0 , wx.ALIGN_TOP|wx.ALIGN_CENTER_HORIZONTAL) gSizer5.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 ) gSizer5.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 ) gSizer5.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 ) gSizer5.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 ) self.btn_display = wx.Button( self.m_panel3, wx.ID_ANY, u"确定", wx.DefaultPosition, wx.DefaultSize, 0 ) gSizer5.Add( self.btn_display, 0, wx.ALL, 5 ) self.btn_display_cancel = wx.Button( self.m_panel3, wx.ID_ANY, u"取消", wx.DefaultPosition, wx.DefaultSize, 0 ) gSizer5.Add( self.btn_display_cancel, 0, wx.ALL, 5 ) self.m_panel3.SetSizer( gSizer5 ) self.m_panel3.Layout() gSizer5.Fit( self.m_panel3 ) self.m_notebook1.AddPage( self.m_panel3, u"窗口显示", False ) self.m_panel4 = wx.Panel( self.m_notebook1, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL ) gSizer6 = wx.GridSizer( 5, 1, 0, 0 ) gSizer6.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 ) m_radio_chooseChoices = [ u"定频中心频率", u"定频公共参数" ] self.m_radio_choose = wx.RadioBox( self.m_panel4, wx.ID_ANY, u"查询项", wx.DefaultPosition, wx.DefaultSize, m_radio_chooseChoices, 1, wx.RA_SPECIFY_COLS ) self.m_radio_choose.SetSelection( 0 ) gSizer6.Add( self.m_radio_choose, 0, wx.ALL, 5 ) gSizer6.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 ) gSizer6.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 ) self.m_btn_query = wx.Button( self.m_panel4, wx.ID_ANY, u"查询", wx.DefaultPosition, wx.DefaultSize, 0 ) gSizer6.Add( self.m_btn_query, 0, wx.ALIGN_CENTER_HORIZONTAL, 5 ) self.m_panel4.SetSizer( gSizer6 ) self.m_panel4.Layout() gSizer6.Fit( self.m_panel4 ) self.m_notebook1.AddPage( self.m_panel4, u"查询", True ) gSizer1.Add( self.m_notebook1, 1, wx.EXPAND |wx.ALL, 5 ) self.SetSizer( gSizer1 ) self.Layout() self.Centre( wx.BOTH ) #Events self.m_btn_set.Bind( wx.EVT_BUTTON, self.m_btn_setOnButtonClick ) self.btn_ok_param.Bind(wx.EVT_BUTTON, self.btn_ok_paramOnButtonClick) self.btn_display.Bind(wx.EVT_BUTTON, self.btn_displayOnButtonClick) self.m_btn_query.Bind(wx.EVT_BUTTON,self.m_btn_queryOnButtonClick)
def __init__(self, parent): wx.aui.AuiMDIParentFrame.__init__ ( self, parent, -1, title = wx.EmptyString, \ pos = wx.DefaultPosition, size = wx.Size( 887,545 ), \ style = wx.DEFAULT_FRAME_STYLE|wx.TAB_TRAVERSAL ) ####################################### matplotlib.rcParams["figure.facecolor"] = '#F2F5FA' matplotlib.rcParams["axes.facecolor"] = '0' matplotlib.rcParams["ytick.color"] = '0' matplotlib.rcParams["xtick.color"] = '0' matplotlib.rcParams["grid.color"] = 'w' matplotlib.rcParams["text.color"] = 'w' matplotlib.rcParams["figure.edgecolor"] = "0" matplotlib.rcParams["xtick.labelsize"] = 12 matplotlib.rcParams["ytick.labelsize"] = 12 matplotlib.rcParams["axes.labelsize"] = 14 matplotlib.rcParams["grid.linestyle"] = "-" matplotlib.rcParams["grid.linewidth"] = 0.5 matplotlib.rcParams["grid.color"] = '#707070' ####################################### # os.chdir("./apache-tomcat-7.0.68//bin//") # os.chdir("../apache-tomcat-7.0.68//bin//") os.system("startup.bat") dirname, filename = os.path.split(os.path.abspath(sys.argv[0])) os.chdir(dirname) ########### 初始化变量 ################# self.start_local_iq = 0 ########### 心跳相关 ########## self.timer = 0 self.count_heart = 0 self.frame_count = 0 #打开的窗口数量# self.FreqMin = 70 self.FreqMax = 5995 self.tail = FrameTail(0, 0, 0xAA) #### 窗口################ self.SpecFrame = Spectrum_1.Spec(self) self.SpecFrame.Activate() self.WaterFrame = None self.WaveFrame = None self.MapFrame = None ################################# staticVar.setid(11) #初始化id print staticVar.getid() # staticVar.initPort() #初始化硬件 端口 self.serverCom = ServerCommunication() #实例化服务器连接对象 ########## 用于显示的 ############ self.show_recv_set = ShowRecvAndSet(self) self.byte_to_package = ByteToPackage() self.GPS_list = [] ##记录GPS 查询信息,发送给服务器 ####上传的队列############ self.queueFFTUpload = Queue.Queue() self.queueAbUpload = Queue.Queue() ###本地存储的队列############# self.queueFFTLocalSave = Queue.Queue() self.queueAbLocalSave = Queue.Queue() ### 画地图所使用的队列 (FFT的经纬度打包放进去)######### self.queueRouteMap = Queue.Queue() ###### 创建数据表 ############# if (not os.path.isfile("C:\\DataBase\\PortSRF.db")): os.mkdir(r'C:/DataBase/') CreateAllTable.create_all_table() ##### thread 管理 ######### self.thread_recvfft = 0 self.thread_upload = 0 self.thread_station = 0 self.thread_route_map = 0 ''' if (configfpga.get_fx3_status()[0] == 0x04): pass else: configfpga.load_fpga('c:/top_sao.bit') wx.MessageBox('Config OK!', 'Alert', wx.ICON_EXCLAMATION | wx.STAY_ON_TOP) ''' self.SetSizeHintsSz(wx.DefaultSize, wx.DefaultSize) self.m_toolBar1 = self.CreateToolBar(wx.TB_HORIZONTAL | wx.TB_TEXT, wx.ID_ANY) self.m_start_hw = self.m_toolBar1.AddLabelTool( wx.ID_ANY, u"硬件上传", wx.Bitmap(".//icons//green_2.png", wx.BITMAP_TYPE_ANY), wx.NullBitmap, wx.ITEM_NORMAL, wx.EmptyString, wx.EmptyString, None) self.m_toolBar1.AddSeparator() self.m_toolBar1.AddSeparator() self.m_toolBar1.AddSeparator() self.m_connect = self.m_toolBar1.AddLabelTool( wx.ID_ANY, u"服务器连接", wx.Bitmap(".//icons//link_start.jpg", wx.BITMAP_TYPE_ANY), wx.NullBitmap, wx.ITEM_NORMAL, wx.EmptyString, wx.EmptyString, None) self.m_toolBar1.AddSeparator() self.m_toolBar1.AddSeparator() self.m_toolBar1.AddSeparator() self.m_tool_sweep = self.m_toolBar1.AddLabelTool( wx.ID_ANY, u"扫频接收 ", wx.Bitmap(".//icons//open_1.png", wx.BITMAP_TYPE_ANY), wx.NullBitmap, wx.ITEM_NORMAL, wx.EmptyString, wx.EmptyString, None) self.m_toolBar1.AddSeparator() self.m_toolBar1.AddSeparator() self.m_toolBar1.AddSeparator() self.m_tool_iq = self.m_toolBar1.AddLabelTool( wx.ID_ANY, u"定频接收 ", wx.Bitmap(".//icons//link_a.png", wx.BITMAP_TYPE_ANY), wx.NullBitmap, wx.ITEM_NORMAL, wx.EmptyString, wx.EmptyString, None) self.m_toolBar1.AddSeparator() self.m_toolBar1.AddSeparator() self.m_toolBar1.AddSeparator() self.m_tool_press = self.m_toolBar1.AddLabelTool( wx.ID_ANY, u"压制发射", wx.Bitmap(".//icons//red_1.png", wx.BITMAP_TYPE_ANY), wx.NullBitmap, wx.ITEM_NORMAL, wx.EmptyString, wx.EmptyString, None) self.m_toolBar1.AddSeparator() self.m_toolBar1.AddSeparator() self.m_tool_map = self.m_toolBar1.AddLabelTool( wx.ID_ANY, u"地图服务", wx.Bitmap(".//icons//Play_1.png", wx.BITMAP_TYPE_ANY), wx.NullBitmap, wx.ITEM_NORMAL, wx.EmptyString, wx.EmptyString, None) self.m_toolBar1.AddSeparator() self.m_toolBar1.AddSeparator() self.m_toolBar1.AddSeparator() self.m_tool_freqplan = self.m_toolBar1.AddLabelTool( wx.ID_ANY, u"频率规划", wx.Bitmap(".//icons//Pause_1.png", wx.BITMAP_TYPE_ANY), wx.NullBitmap, wx.ITEM_NORMAL, wx.EmptyString, wx.EmptyString, None) self.m_toolBar1.AddSeparator() self.m_toolBar1.AddSeparator() self.m_toolBar1.AddSeparator() self.m_tool_remoteCtrl = self.m_toolBar1.AddLabelTool( wx.ID_ANY, u"远程控制", wx.Bitmap(".//icons//laba_1.png", wx.BITMAP_TYPE_ANY), wx.NullBitmap, wx.ITEM_NORMAL, wx.EmptyString, wx.EmptyString, None) self.m_toolBar1.AddSeparator() self.m_toolBar1.AddSeparator() self.m_toolBar1.AddSeparator() self.m_tool_replay = self.m_toolBar1.AddLabelTool( wx.ID_ANY, u"历史回放", wx.Bitmap(".//icons//local_read_a.png", wx.BITMAP_TYPE_ANY), wx.NullBitmap, wx.ITEM_NORMAL, wx.EmptyString, wx.EmptyString, None) self.m_toolBar1.Realize() self.Centre(wx.BOTH) # Connect Events self.Bind(wx.EVT_CLOSE, self.OnDoClose) self.Bind(wx.EVT_TOOL, self.m_start_hwOnToolClicked, id=self.m_start_hw.GetId()) self.Bind(wx.EVT_TOOL, self.m_connectOnToolClicked, id=self.m_connect.GetId()) self.Bind(wx.EVT_TOOL, self.m_tool_sweepOnToolClicked, id=self.m_tool_sweep.GetId()) self.Bind(wx.EVT_TOOL, self.m_tool_iqOnToolClicked, id=self.m_tool_iq.GetId()) self.Bind(wx.EVT_TOOL, self.m_tool_pressOnToolClicked, id=self.m_tool_press.GetId()) self.Bind(wx.EVT_TOOL, self.m_tool_mapOnToolClicked, id=self.m_tool_map.GetId()) self.Bind(wx.EVT_TOOL, self.m_tool_freqplanOnToolClicked, id=self.m_tool_freqplan.GetId()) self.Bind(wx.EVT_TOOL, self.m_tool_remoteCtrlOnToolClicked, id=self.m_tool_remoteCtrl.GetId()) self.Bind(wx.EVT_TOOL, self.m_tool_replayOnToolClicked, id=self.m_tool_replay.GetId())
def __init__(self, parent): wx.Dialog.__init__(self, parent, -1, u"登记台站当前属性查询", size=(500, 500)) self.SetFont( wx.Font(10, wx.ROMAN, wx.NORMAL, wx.LIGHT, underline=False, faceName=u"微软雅黑", encoding=wx.FONTENCODING_DEFAULT)) ######################################### self.parent = parent self.tail = FrameTail(0, 0, 0xAA) self.id = staticVar.getid() self.lowid = self.id & 0x00FF self.highid = self.id >> 8 ############################################### panel = wx.Panel(self, -1) self.StationID = wx.TextCtrl(panel, -1, size=(80, 25)) sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add((20, 30)) hBox3 = wx.BoxSizer(wx.HORIZONTAL) hBox3.Add(wx.StaticText(panel, -1, u"指定台站识别码: ", size=(100, 25)), 0, wx.LEFT, 20) hBox3.Add(self.StationID, 0, wx.LEFT | wx.ALIGN_BOTTOM, 20) sizer.Add(hBox3) sizer.Add((20, 20)) self.CentreFreq = wx.TextCtrl(panel, -1, size=(80, 25)) self.UploadNum = wx.TextCtrl(panel, -1, "1", size=(80, 25)) self.radioBox = wx.RadioBox(panel, -1, choices=["POA", "POA/TDOA"]) self.radioBox.SetSelection(0) sampleList = ['5/5', '2.5/2.5', '1/1', '0.5/0/5', '0.1/0/1'] self.BandWidth = wx.ComboBox(panel, -1, '5/5', size=(80, 30), choices=sampleList) self.BandWidth.SetSelection(0) self.StartTimeYear = wx.ComboBox( panel, -1, "2015", choices=["2015", "2016", "2017", "2018"]) self.StartTimeMonth = wx.ComboBox(panel, -1, "12", choices=[ "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12" ]) self.StartTimeDay = wx.TextCtrl(panel, -1, "1", size=(60, 25)) self.StartTimeHour = wx.TextCtrl(panel, -1, "0", size=(60, 25)) self.StartTimeMinute = wx.TextCtrl(panel, -1, "0", size=(60, 25)) self.StartTimeSecond = wx.TextCtrl(panel, -1, "0", size=(60, 25)) self.StartTimeYear.SetSelection(0) self.StartTimeMonth.SetSelection(11) sizer.Add(wx.StaticText(panel, -1, u"几何定位方法", size=(120, 25)), 0, wx.LEFT, 20) sizer.Add(self.radioBox, 0, wx.LEFT, 20) sizer.Add((10, 10)) hBox1 = wx.BoxSizer(wx.HORIZONTAL) hBox1.Add(wx.StaticText(panel, -1, u"中心频率(MHz)", size=(160, 25)), 0, wx.LEFT, 20) hBox1.Add(self.CentreFreq, 0, wx.LEFT, 20) sizer.Add(hBox1) sizer.Add((10, 10)) hBox1 = wx.BoxSizer(wx.HORIZONTAL) hBox1.Add( wx.StaticText(panel, -1, u"带宽/数据率 (MHz/Msps):", size=(160, 25)), 0, wx.LEFT, 20) hBox1.Add(self.BandWidth, 0, wx.LEFT, 20) sizer.Add(hBox1) sizer.Add((10, 10)) hBox1 = wx.BoxSizer(wx.HORIZONTAL) hBox1.Add(wx.StaticText(panel, -1, u"上传数据块个数(1-256):", size=(160, 25)), 0, wx.LEFT, 20) hBox1.Add(self.UploadNum, 0, wx.LEFT, 20) sizer.Add(hBox1) sizer.Add((10, 10)) sizer.Add(wx.StaticText(panel, -1, u"采集起始时间(年-月-日-时-分-秒):"), 0, wx.LEFT, 20) sizer.Add((10, 10)) hBox1 = wx.BoxSizer(wx.HORIZONTAL) hBox1.Add(self.StartTimeYear, 0, wx.LEFT, 20) hBox1.Add(wx.StaticText(panel, -1, "-"), 0, wx.LEFT | wx.RIGHT | wx.ALIGN_BOTTOM, 5) hBox1.Add(self.StartTimeMonth, 0) hBox1.Add(wx.StaticText(panel, -1, "-"), 0, wx.LEFT | wx.RIGHT | wx.ALIGN_BOTTOM, 5) hBox1.Add(self.StartTimeDay, 0) hBox1.Add(wx.StaticText(panel, -1, "-"), 0, wx.LEFT | wx.RIGHT | wx.ALIGN_BOTTOM, 5) hBox1.Add(self.StartTimeHour, 0) hBox1.Add(wx.StaticText(panel, -1, "-"), 0, wx.LEFT | wx.RIGHT | wx.ALIGN_BOTTOM, 5) hBox1.Add(self.StartTimeMinute, 0) hBox1.Add(wx.StaticText(panel, -1, "-"), 0, wx.LEFT | wx.RIGHT | wx.ALIGN_BOTTOM, 5) hBox1.Add(self.StartTimeSecond, 0) sizer.Add(hBox1) sizer.Add((20, 20)) hBox1 = wx.BoxSizer(wx.HORIZONTAL) self.btn_ok = wx.Button(panel, -1, "OK", size=(60, 25)) hBox1.Add(self.btn_ok, 0, wx.LEFT, 20) hBox1.Add(wx.Button(panel, wx.ID_CANCEL, "CANCEL", size=(60, 25)), 0, wx.LEFT, 20) sizer.Add(hBox1) panel.SetSizer(sizer) self.Layout() self.Centre(wx.BOTH) #Events self.btn_ok.Bind(wx.EVT_BUTTON, self.OnbtnOk)
def __init__(self): wx.Dialog.__init__(self, None, -1, u"电磁分布态势数据请求", size=(400, 500)) self.SetFont( wx.Font(10, wx.ROMAN, wx.NORMAL, wx.LIGHT, underline=False, faceName=u"微软雅黑", encoding=wx.FONTENCODING_DEFAULT)) ############################### self.tail = FrameTail(0, 0, 0xAA) self.id = staticVar.getid() self.lowid = self.id & 0x00FF self.highid = self.id >> 8 self.List = staticVar.getCentreFreq() self.ListFreq = staticVar.getFreq() ############################## panel = wx.Panel(self, -1) self.FreqSection = wx.ComboBox(panel, -1, u"FM调频广播频段", choices=self.List) self.FreqSection.SetSelection(0) self.radioChoose = wx.RadioButton(panel, -1, u"选择频率") self.radioHand = wx.RadioButton(panel, -1, u"手动频率") self.CentreFreq = wx.TextCtrl(panel, -1, size=(80, 25)) self.BandWidth = wx.TextCtrl(panel, -1, size=(80, 25)) self.Radius = wx.TextCtrl(panel, -1, size=(80, 25)) self.FenBianLv = wx.TextCtrl(panel, -1, size=(80, 25)) self.RefreshIntv = wx.TextCtrl(panel, -1, size=(80, 25)) ############################################# curTime = time.strftime('%Y%m%d%H%M%S', time.localtime(time.time())) Year = int(curTime[0:4]) Month = int(curTime[4:6]) Day = int(curTime[6:8]) Hour = int(curTime[8:10]) Min = int(curTime[10:12]) + 2 ############################################### self.StartTimeYear = wx.ComboBox( panel, -1, str(Year), choices=["2015", "2016", "2017", "2018"]) self.StartTimeMonth = wx.ComboBox(panel, -1, str(Month), choices=[ "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12" ]) self.StartTimeDay = wx.TextCtrl(panel, -1, str(Day), size=(60, 25)) self.StartTimeHour = wx.TextCtrl(panel, -1, str(Hour), size=(60, 25)) self.StartTimeMinute = wx.TextCtrl(panel, -1, str(Min), size=(60, 25)) self.EndTimeYear = wx.ComboBox( panel, -1, str(Year), choices=["2015", "2016", "2017", "2018"]) self.EndTimeMonth = wx.ComboBox(panel, -1, str(Month), choices=[ "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12" ]) self.EndTimeDay = wx.TextCtrl(panel, -1, str(Day), size=(60, 25)) self.EndTimeHour = wx.TextCtrl(panel, -1, str(Hour), size=(60, 25)) self.EndTimeMinute = wx.TextCtrl(panel, -1, str(Min), size=(60, 25)) sizer = wx.BoxSizer(wx.VERTICAL) hBox = wx.BoxSizer(wx.HORIZONTAL) sizer.Add((30, 30)) hBox.Add(self.radioChoose, 0, wx.LEFT, 20) hBox.Add(self.radioHand, 0, wx.LEFT, 20) sizer.Add(hBox) sizer.Add(self.FreqSection, 0, wx.LEFT | wx.TOP, 20) sizer.Add((10, 10)) hBox1 = wx.BoxSizer(wx.HORIZONTAL) hBox1.Add(wx.StaticText(panel, -1, u"中心频率(MHz)", size=(100, 25)), 0, wx.LEFT, 20) hBox1.Add(self.CentreFreq, 0, wx.LEFT, 20) sizer.Add(hBox1) sizer.Add((10, 10)) hBox1 = wx.BoxSizer(wx.HORIZONTAL) hBox1.Add(wx.StaticText(panel, -1, u"带宽(MHz)", size=(100, 25)), 0, wx.LEFT, 20) hBox1.Add(self.BandWidth, 0, wx.LEFT, 20) sizer.Add(hBox1) sizer.Add((10, 10)) hBox1 = wx.BoxSizer(wx.HORIZONTAL) hBox1.Add(wx.StaticText(panel, -1, u"地理半径(km)", size=(100, 25)), 0, wx.LEFT, 20) hBox1.Add(self.Radius, 0, wx.LEFT, 20) sizer.Add(hBox1) sizer.Add((10, 10)) hBox1 = wx.BoxSizer(wx.HORIZONTAL) hBox1.Add(wx.StaticText(panel, -1, u"经纬度分辨率", size=(100, 25)), 0, wx.LEFT, 20) hBox1.Add(self.FenBianLv, 0, wx.LEFT, 20) sizer.Add(hBox1) sizer.Add((10, 10)) hBox1 = wx.BoxSizer(wx.HORIZONTAL) hBox1.Add(wx.StaticText(panel, -1, u"动态刷新间隔(Min)", size=(130, 25)), 0, wx.LEFT, 20) hBox1.Add(self.RefreshIntv, 0, wx.LEFT, 20) sizer.Add(hBox1) sizer.Add( wx.StaticText(panel, -1, u"起始时间(年-月-日-时-分):", size=(160, 25)), 0, wx.LEFT, 20) sizer.Add((10, 10)) hBox1 = wx.BoxSizer(wx.HORIZONTAL) hBox1.Add(self.StartTimeYear, 0, wx.LEFT, 20) hBox1.Add(wx.StaticText(panel, -1, "-"), 0, wx.LEFT | wx.RIGHT | wx.ALIGN_BOTTOM, 5) hBox1.Add(self.StartTimeMonth, 0) hBox1.Add(wx.StaticText(panel, -1, "-"), 0, wx.LEFT | wx.RIGHT | wx.ALIGN_BOTTOM, 5) hBox1.Add(self.StartTimeDay, 0) hBox1.Add(wx.StaticText(panel, -1, "-"), 0, wx.LEFT | wx.RIGHT | wx.ALIGN_BOTTOM, 5) hBox1.Add(self.StartTimeHour, 0) hBox1.Add(wx.StaticText(panel, -1, "-"), 0, wx.LEFT | wx.RIGHT | wx.ALIGN_BOTTOM, 5) hBox1.Add(self.StartTimeMinute, 0) sizer.Add(hBox1) sizer.Add( wx.StaticText(panel, -1, u"终止时间(年-月-日-时-分):", size=(160, 25)), 0, wx.LEFT, 20) sizer.Add((10, 10)) hBox1 = wx.BoxSizer(wx.HORIZONTAL) hBox1.Add(self.EndTimeYear, 0, wx.LEFT, 20) hBox1.Add(wx.StaticText(panel, -1, "-"), 0, wx.LEFT | wx.RIGHT | wx.ALIGN_BOTTOM, 5) hBox1.Add(self.EndTimeMonth, 0) hBox1.Add(wx.StaticText(panel, -1, "-"), 0, wx.LEFT | wx.RIGHT | wx.ALIGN_BOTTOM, 5) hBox1.Add(self.EndTimeDay, 0) hBox1.Add(wx.StaticText(panel, -1, "-"), 0, wx.LEFT | wx.RIGHT | wx.ALIGN_BOTTOM, 5) hBox1.Add(self.EndTimeHour, 0) hBox1.Add(wx.StaticText(panel, -1, "-"), 0, wx.LEFT | wx.RIGHT | wx.ALIGN_BOTTOM, 5) hBox1.Add(self.EndTimeMinute, 0) sizer.Add(hBox1) sizer.Add((30, 30)) hBox1 = wx.BoxSizer(wx.HORIZONTAL) self.btn_ok = wx.Button(panel, -1, "OK", size=(60, 25)) hBox1.Add(self.btn_ok, 0, wx.LEFT, 20) hBox1.Add(wx.Button(panel, wx.ID_CANCEL, "CANCEL", size=(60, 25)), 0, wx.LEFT, 20) sizer.Add(hBox1) panel.SetSizer(sizer) self.CentreFreq.Enable(True) self.BandWidth.Enable(True) self.radioHand.SetValue(True) self.Layout() self.Centre(wx.BOTH) ##Events self.btn_ok.Bind(wx.EVT_BUTTON, self.OnbtnOK) self.Bind(wx.EVT_RADIOBUTTON, self.OnRadio)
def __init__(self, parent): wx.Dialog.__init__(self, None, -1, u"电磁路径分布数据请求", size=(400, 650)) self.SetFont( wx.Font(10, wx.ROMAN, wx.NORMAL, wx.LIGHT, underline=False, faceName=u"微软雅黑", encoding=wx.FONTENCODING_DEFAULT)) panel = wx.Panel(self, -1) ############################### self.parent = parent self.tail = FrameTail(0, 0, 0xAA) self.id = staticVar.getid() self.lowid = self.id & 0x00FF self.highid = self.id >> 8 self.List = staticVar.getCentreFreq() self.ListFreq = staticVar.getFreq() ############################################### self.radioBox1 = wx.RadioBox(panel, -1, choices=[u"本地获取", u"中心站获取"], style=wx.RA_VERTICAL) self.radioBox2 = wx.RadioBox(panel, -1, choices=[u"显示历史分布", u"显示实时分布"], style=wx.RA_VERTICAL) self.radioBox3 = wx.RadioBox(panel, -1, choices=[u"选择频率", u"手动频率"]) self.radioBox4 = wx.RadioBox(panel, -1, choices=[u"YES", u"NO"]) self.radioBox1.SetSelection(1) self.radioBox2.SetSelection(1) self.radioBox3.SetSelection(1) self.radioBox4.SetSelection(1) self.FreqSection = wx.ComboBox(panel, -1, u"FM调频广播频段", choices=self.List) self.FreqSection.SetSelection(0) self.CentreFreq = wx.TextCtrl(panel, -1, size=(80, 25)) self.BandWidth = wx.TextCtrl(panel, -1, size=(80, 25)) ############################################# curTime = time.strftime('%Y%m%d%H%M%S', time.localtime(time.time())) Year = int(curTime[0:4]) Month = int(curTime[4:6]) Day = int(curTime[6:8]) Hour = int(curTime[8:10]) Min = int(curTime[10:12]) + 2 ############################################### self.StartTimeYear = wx.ComboBox( panel, -1, str(Year), choices=["2015", "2016", "2017", "2018"]) self.StartTimeMonth = wx.ComboBox(panel, -1, str(Month), choices=[ "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12" ]) self.StartTimeDay = wx.TextCtrl(panel, -1, str(Day), size=(60, 25)) self.StartTimeHour = wx.TextCtrl(panel, -1, str(Hour), size=(60, 25)) self.StartTimeMinute = wx.TextCtrl(panel, -1, str(Min), size=(60, 25)) self.EndTimeYear = wx.ComboBox( panel, -1, str(Year), choices=["2015", "2016", "2017", "2018"]) self.EndTimeMonth = wx.ComboBox(panel, -1, str(Month), choices=[ "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12" ]) self.EndTimeDay = wx.TextCtrl(panel, -1, str(Day), size=(60, 25)) self.EndTimeHour = wx.TextCtrl(panel, -1, str(Hour), size=(60, 25)) self.EndTimeMinute = wx.TextCtrl(panel, -1, str(Min), size=(60, 25)) sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add((15, 15)) sizer.Add(self.radioBox3, 0, wx.LEFT, 20) sizer.Add(self.FreqSection, 0, wx.LEFT | wx.TOP, 20) sizer.Add((10, 10)) hBox1 = wx.BoxSizer(wx.HORIZONTAL) hBox1.Add(wx.StaticText(panel, -1, u"中心频率(MHz)", size=(100, 25)), 0, wx.LEFT, 20) hBox1.Add(self.CentreFreq, 0, wx.LEFT, 20) sizer.Add(hBox1) sizer.Add((10, 10)) hBox1 = wx.BoxSizer(wx.HORIZONTAL) hBox1.Add(wx.StaticText(panel, -1, u"带宽(MHz)", size=(100, 25)), 0, wx.LEFT, 20) hBox1.Add(self.BandWidth, 0, wx.LEFT, 20) sizer.Add(hBox1) sizer.Add((10, 10)) hBox1 = wx.BoxSizer(wx.HORIZONTAL) hBox1.Add(wx.StaticText(panel, -1, u"分布数据来源:", size=(100, 25)), 0, wx.LEFT | wx.ALIGN_TOP, 20) hBox1.Add(self.radioBox1, 0, wx.LEFT | wx.ALIGN_TOP, 20) sizer.Add(hBox1) sizer.Add((10, 10)) hBox1 = wx.BoxSizer(wx.HORIZONTAL) hBox1.Add(wx.StaticText(panel, -1, u"T-POA定位:", size=(100, 25)), 0, wx.LEFT | wx.ALIGN_TOP, 20) hBox1.Add(self.radioBox4, 0, wx.LEFT | wx.ALIGN_TOP, 20) sizer.Add(hBox1) sizer.Add((10, 10)) hBox1 = wx.BoxSizer(wx.HORIZONTAL) hBox1.Add(wx.StaticText(panel, -1, u"显示数据来源:", size=(100, 25)), 0, wx.LEFT | wx.ALIGN_TOP, 20) hBox1.Add(self.radioBox2, 0, wx.LEFT | wx.ALIGN_TOP, 20) sizer.Add(hBox1) sizer.Add((10, 10)) sizer.Add( wx.StaticText(panel, -1, u"起始时间(年-月-日-时-分):", size=(160, 25)), 0, wx.LEFT, 20) sizer.Add((10, 10)) hBox1 = wx.BoxSizer(wx.HORIZONTAL) hBox1.Add(self.StartTimeYear, 0, wx.LEFT, 20) hBox1.Add(wx.StaticText(panel, -1, "-"), 0, wx.LEFT | wx.RIGHT | wx.ALIGN_BOTTOM, 5) hBox1.Add(self.StartTimeMonth, 0) hBox1.Add(wx.StaticText(panel, -1, "-"), 0, wx.LEFT | wx.RIGHT | wx.ALIGN_BOTTOM, 5) hBox1.Add(self.StartTimeDay, 0) hBox1.Add(wx.StaticText(panel, -1, "-"), 0, wx.LEFT | wx.RIGHT | wx.ALIGN_BOTTOM, 5) hBox1.Add(self.StartTimeHour, 0) hBox1.Add(wx.StaticText(panel, -1, "-"), 0, wx.LEFT | wx.RIGHT | wx.ALIGN_BOTTOM, 5) hBox1.Add(self.StartTimeMinute, 0) sizer.Add(hBox1) sizer.Add( wx.StaticText(panel, -1, u"终止时间(年-月-日-时-分):", size=(160, 25)), 0, wx.LEFT, 20) sizer.Add((10, 10)) hBox1 = wx.BoxSizer(wx.HORIZONTAL) hBox1.Add(self.EndTimeYear, 0, wx.LEFT, 20) hBox1.Add(wx.StaticText(panel, -1, "-"), 0, wx.LEFT | wx.RIGHT | wx.ALIGN_BOTTOM, 5) hBox1.Add(self.EndTimeMonth, 0) hBox1.Add(wx.StaticText(panel, -1, "-"), 0, wx.LEFT | wx.RIGHT | wx.ALIGN_BOTTOM, 5) hBox1.Add(self.EndTimeDay, 0) hBox1.Add(wx.StaticText(panel, -1, "-"), 0, wx.LEFT | wx.RIGHT | wx.ALIGN_BOTTOM, 5) hBox1.Add(self.EndTimeHour, 0) hBox1.Add(wx.StaticText(panel, -1, "-"), 0, wx.LEFT | wx.RIGHT | wx.ALIGN_BOTTOM, 5) hBox1.Add(self.EndTimeMinute, 0) sizer.Add(hBox1) sizer.Add((30, 30)) hBox1 = wx.BoxSizer(wx.HORIZONTAL) self.btn_ok = wx.Button(panel, -1, "OK", size=(60, 25)) hBox1.Add(self.btn_ok, 0, wx.LEFT, 20) hBox1.Add(wx.Button(panel, wx.ID_CANCEL, "CANCEL", size=(60, 25)), 0, wx.LEFT, 20) sizer.Add(hBox1) panel.SetSizer(sizer) self.Layout() self.Centre(wx.BOTH) #Events self.Bind(wx.EVT_RADIOBOX, self.OnRadio, self.radioBox3) self.btn_ok.Bind(wx.EVT_BUTTON, self.OnbtnOk) self.FreqSection.Enable(False) self.CentreFreq.Enable(True) self.BandWidth.Enable(True)