Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
vue_django_test
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
周田
vue_django_test
Commits
1ba96316
Commit
1ba96316
authored
Sep 20, 2023
by
周田
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:linux下正常关闭子进程
parent
462b2eed
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
10 deletions
+5
-10
device_manager.py
simulate_device_manager/device_manager.py
+4
-4
HY_ACU7M5_Antenna_PROTOCOL.py
...ce_manager/simulate_devices/HY_ACU7M5_Antenna_PROTOCOL.py
+1
-6
No files found.
simulate_device_manager/device_manager.py
View file @
1ba96316
...
...
@@ -28,7 +28,8 @@ def start_signal_callback(sender, **kwargs):
process
=
subprocess
.
Popen
([
'python'
,
f
'./simulate_device_manager/simulate_devices/{protocol_name}.py'
,
f
'{device_port}'
])
f
'{device_port}'
],
preexec_fn
=
os
.
setsid
)
SIMULATE_DEVICE_PROCESS
[
device_name
]
=
process
...
...
@@ -43,7 +44,6 @@ def stop_signal_callback(sender, **kwargs):
assert
device_name
is
not
None
,
'device_name is None'
process
=
SIMULATE_DEVICE_PROCESS
.
get
(
device_name
)
process
.
terminate
()
process
.
wait
()
os
.
kill
(
process
.
pid
,
signal
.
SIGTERM
)
if
process
.
poll
()
is
None
:
os
.
killpg
(
process
.
pid
,
signal
.
SIGTERM
)
del
SIMULATE_DEVICE_PROCESS
[
device_name
]
simulate_device_manager/simulate_devices/HY_ACU7M5_Antenna_PROTOCOL.py
View file @
1ba96316
...
...
@@ -6,15 +6,10 @@ import re
import
threading
import
datetime
import
sys
import
configparser
config
=
configparser
.
ConfigParser
()
# 类实例化
# 定义ini文件路径 这个文件用于存放 天控器当前的报警状态
path
=
r'acu7m5_hyds.ini'
path
=
r'./simulate_device_manager/simulate_devices/acu7m5_hyds.ini'
argv
=
sys
.
argv
[
1
:]
tcp_port
=
int
(
argv
[
0
])
...
...
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