Commit 333ad311 authored by liyuanhong's avatar liyuanhong

修改了界面阻塞的问题

parent 9fc6bbb8
...@@ -25,9 +25,8 @@ class CameraArea(): ...@@ -25,9 +25,8 @@ class CameraArea():
data = yaml.load(fi_data,Loader=yaml.FullLoader) data = yaml.load(fi_data,Loader=yaml.FullLoader)
self.getGetPlayUrl = data["globalCon"]["getPlayUrl"] self.getGetPlayUrl = data["globalCon"]["getPlayUrl"]
self.pushStatusText = None self.pushStatusText = None # 状态显示区域
self.logTextCtr = None self.logTextCtr = None # 日志显示区域
sys.stdout = self.logTextCtr
def setDevId(self,data): def setDevId(self,data):
self.devId = data self.devId = data
...@@ -76,7 +75,7 @@ class CameraArea(): ...@@ -76,7 +75,7 @@ class CameraArea():
wx.StaticText(paramView, label='频 道号:', pos=(235, 70)) wx.StaticText(paramView, label='频 道号:', pos=(235, 70))
channelText = wx.TextCtrl(paramView, pos=(300, 65), size=wx.Size(80, -1), value=str(self.channel)) # 频道号 channelText = wx.TextCtrl(paramView, pos=(300, 65), size=wx.Size(80, -1), value=str(self.channel)) # 频道号
wx.StaticText(paramView, label='当前状态:', pos=(10, 100)) 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) # 推流状态显示 style=wx.TE_READONLY) # 推流状态显示
self.pushStatusText.SetForegroundColour(wx.RED) self.pushStatusText.SetForegroundColour(wx.RED)
wx.StaticText(paramView, label='消息发送间隔(毫秒):', pos=(10, 130)) wx.StaticText(paramView, label='消息发送间隔(毫秒):', pos=(10, 130))
...@@ -101,6 +100,8 @@ class CameraArea(): ...@@ -101,6 +100,8 @@ class CameraArea():
rePushButton = wx.Button(ctrView, label="4、继续推流", pos=(120, 35)) rePushButton = wx.Button(ctrView, label="4、继续推流", pos=(120, 35))
stopPushButton = wx.Button(ctrView, label="5、结束推流", pos=(5, 65)) stopPushButton = wx.Button(ctrView, label="5、结束推流", pos=(5, 65))
disConnectButton = wx.Button(ctrView, label="6、断网", pos=(120, 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") # ctrView.SetBackgroundColour("PINK")
boxSizer_1 = wx.BoxSizer(wx.HORIZONTAL) boxSizer_1 = wx.BoxSizer(wx.HORIZONTAL)
...@@ -193,14 +194,14 @@ class CameraArea(): ...@@ -193,14 +194,14 @@ class CameraArea():
#################################################### ####################################################
def disConnect(self,evt): def disConnect(self,evt):
self.pushObj.disConnectServer() self.pushObj.disConnectServer()
self.pushStatusText.SetValue("未连网")
#################################################### ####################################################
# 开始推流 # 开始推流
#################################################### ####################################################
def startPush(self,evt): def startPush(self,evt):
# threadObj = threading.Thread(target=self.pushStream(), args=()) threadObj = threading.Thread(target=self.pushStream)
# threadObj.start() threadObj.start()
wx.CallAfter(self.pushStream)
timeCur = self.getCurTime() timeCur = self.getCurTime()
self.logTextCtr.WriteText(timeCur + "推流成功!\n") self.logTextCtr.WriteText(timeCur + "推流成功!\n")
self.pushStatusText.SetValue("推流中") self.pushStatusText.SetValue("推流中")
...@@ -208,3 +209,10 @@ class CameraArea(): ...@@ -208,3 +209,10 @@ class CameraArea():
def pushStream(self): def pushStream(self):
self.pushObj.readFlvAndSend() 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