Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mirrorSimulator
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李远洪
mirrorSimulator
Commits
333ad311
Commit
333ad311
authored
Dec 31, 2020
by
liyuanhong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改了界面阻塞的问题
parent
9fc6bbb8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
7 deletions
+15
-7
ui/CameraArea.py
ui/CameraArea.py
+15
-7
No files found.
ui/CameraArea.py
View file @
333ad311
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment