|
|
|
@ -103,7 +103,26 @@ 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) |
|
|
|
#res = subprocess.run(cmd) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# ######################################## |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
|
|
|
|
|
|
|
# 检查进程是否完成 |
|
|
|
|
|
|
|
while True: |
|
|
|
|
|
|
|
retcode = process.poll() # 返回值为None表示进程尚未结束 |
|
|
|
|
|
|
|
if retcode is not None: |
|
|
|
|
|
|
|
# 如果进程已经完成,打印退出状态码 |
|
|
|
|
|
|
|
print(f"Process exited with code: {retcode}") |
|
|
|
|
|
|
|
break |
|
|
|
|
|
|
|
else: |
|
|
|
|
|
|
|
print("Process is still running...") |
|
|
|
|
|
|
|
time.sleep(1) # 每隔1秒检查一次 |
|
|
|
|
|
|
|
stdout, stderr = process.communicate() |
|
|
|
|
|
|
|
print(f"Output: {stdout.decode()}") |
|
|
|
|
|
|
|
print(f"Error: {stderr.decode()}") |
|
|
|
|
|
|
|
# ######################################## |
|
|
|
|
|
|
|
|
|
|
|
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)}') |
|
|
|
|