Commit 333ad311 authored by liyuanhong's avatar liyuanhong

修改了界面阻塞的问题

parent 9fc6bbb8
......@@ -25,9 +25,8 @@ class CameraArea():
data = yaml.load(fi_data,Loader=yaml.FullLoader)
self.getGetPlayUrl = data["globalCon"]["getPlayUrl"]
self.pushStatusText = None
self.logTextCtr = None
sys.stdout = self.logTextCtr
self.pushStatusText = None # 状态显示区域
self.logTextCtr = None # 日志显示区域
def setDevId(self,data):
self.devId = data
......@@ -76,7 +75,7 @@ class CameraArea():
wx.StaticText(paramView, label='频 道号:', pos=(235, 70))
channelText = wx.TextCtrl(paramView, pos=(300, 65), size=wx.Size(80, -1), value=str(self.channel)) # 频道号
wx.StaticText(paramView, label='当前状态:', pos=(10, 100))
self.pushStatusText = wx.TextCtrl(paramView, pos=(70, 95), size=wx.Size(80, -1), value="未推流",
self.pushStatusText = wx.TextCtrl(paramView, pos=(70, 95), size=wx.Size(80, -1), value="未连网",
style=wx.TE_READONLY) # 推流状态显示
self.pushStatusText.SetForegroundColour(wx.RED)
wx.StaticText(paramView, label='消息发送间隔(毫秒):', pos=(10, 130))
......@@ -101,6 +100,8 @@ class CameraArea():
rePushButton = wx.Button(ctrView, label="4、继续推流", pos=(120, 35))
stopPushButton = wx.Button(ctrView, label="5、结束推流", pos=(5, 65))
disConnectButton = wx.Button(ctrView, label="6、断网", pos=(120, 65))
self.frame.Bind(wx.EVT_BUTTON, lambda evt: self.disConnect(evt),
disConnectButton)
# ctrView.SetBackgroundColour("PINK")
boxSizer_1 = wx.BoxSizer(wx.HORIZONTAL)
......@@ -193,14 +194,14 @@ class CameraArea():
####################################################
def disConnect(self,evt):
self.pushObj.disConnectServer()
self.pushStatusText.SetValue("未连网")
####################################################
# 开始推流
####################################################
def startPush(self,evt):
# threadObj = threading.Thread(target=self.pushStream(), args=())
# threadObj.start()
wx.CallAfter(self.pushStream)
threadObj = threading.Thread(target=self.pushStream)
threadObj.start()
timeCur = self.getCurTime()
self.logTextCtr.WriteText(timeCur + "推流成功!\n")
self.pushStatusText.SetValue("推流中")
......@@ -208,3 +209,10 @@ class CameraArea():
def pushStream(self):
self.pushObj.readFlvAndSend()
class RedirectText(object):
def __init__(self, aWxTextCtrl):
self.out=aWxTextCtrl
def write(self, string):
wx.CallAfter(self.out.WriteText, string)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment