|
|
|
@ -103,29 +103,6 @@ def detect_markers(psid, pid): |
|
|
|
{textpicCmd} -save "{os.path.join(config["workdir"], pid, f"{pid}.rcproj")}" -quit' |
|
|
|
{textpicCmd} -save "{os.path.join(config["workdir"], pid, f"{pid}.rcproj")}" -quit' |
|
|
|
print(cmd) |
|
|
|
print(cmd) |
|
|
|
cmd = shlex.split(cmd) |
|
|
|
cmd = shlex.split(cmd) |
|
|
|
#res = subprocess.run(cmd) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# ######################################## |
|
|
|
|
|
|
|
process = subprocess.Popen(cmd, shell=True) |
|
|
|
|
|
|
|
# 获取主进程的 PID |
|
|
|
|
|
|
|
pidddd = process.pid |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
while True: |
|
|
|
|
|
|
|
print("process",process.wait()) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 在等待主进程的同时,检查子进程的状态 |
|
|
|
|
|
|
|
while process.poll() is None: |
|
|
|
|
|
|
|
print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} pid: {pid} 进程 {pidddd} 运行中...') |
|
|
|
|
|
|
|
# 这里可以使用 os.wait() 等待子进程的退出 |
|
|
|
|
|
|
|
time.sleep(2) |
|
|
|
|
|
|
|
print("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA") |
|
|
|
|
|
|
|
print("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA") |
|
|
|
|
|
|
|
print("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA") |
|
|
|
|
|
|
|
print("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA") |
|
|
|
|
|
|
|
print("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA") |
|
|
|
|
|
|
|
print("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA") |
|
|
|
|
|
|
|
# ######################################## |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
time.sleep(3) |
|
|
|
time.sleep(3) |
|
|
|
fix_region() |
|
|
|
fix_region() |
|
|
|
print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} pid: {pid} 定位点检测完成, 共费时{diff_time(start_time)}') |
|
|
|
print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} pid: {pid} 定位点检测完成, 共费时{diff_time(start_time)}') |
|
|
|
|