From af67fbcc0cbcf404979b6b71fa0603da26a078fa Mon Sep 17 00:00:00 2001 From: dongchangxi <458593490@qq.com> Date: Sat, 11 Jan 2025 23:47:31 +0800 Subject: [PATCH 1/8] 1 --- yj_local_build/main_step1.py | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/yj_local_build/main_step1.py b/yj_local_build/main_step1.py index 08f0a26..61d3ef7 100644 --- a/yj_local_build/main_step1.py +++ b/yj_local_build/main_step1.py @@ -103,7 +103,26 @@ def detect_markers(psid, pid): {textpicCmd} -save "{os.path.join(config["workdir"], pid, f"{pid}.rcproj")}" -quit' print(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) fix_region() print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} pid: {pid} 定位点检测完成, 共费时{diff_time(start_time)}') From 90783ed742eabfb8541f23c1581ef8894325a539 Mon Sep 17 00:00:00 2001 From: dongchangxi <458593490@qq.com> Date: Sat, 11 Jan 2025 23:50:42 +0800 Subject: [PATCH 2/8] 1 --- yj_local_build/main_step1.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/yj_local_build/main_step1.py b/yj_local_build/main_step1.py index 61d3ef7..0429b23 100644 --- a/yj_local_build/main_step1.py +++ b/yj_local_build/main_step1.py @@ -121,6 +121,12 @@ def detect_markers(psid, pid): stdout, stderr = process.communicate() print(f"Output: {stdout.decode()}") print(f"Error: {stderr.decode()}") + print("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA") + print("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA") + print("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA") + print("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA") + print("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA") + print("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA") # ######################################## time.sleep(3) From 82dec6d40ccda0db71d9ed7c870bbb4290032449 Mon Sep 17 00:00:00 2001 From: dongchangxi <458593490@qq.com> Date: Sat, 11 Jan 2025 23:56:17 +0800 Subject: [PATCH 3/8] 1 --- yj_local_build/main_step1.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/yj_local_build/main_step1.py b/yj_local_build/main_step1.py index 0429b23..43bdea0 100644 --- a/yj_local_build/main_step1.py +++ b/yj_local_build/main_step1.py @@ -108,17 +108,11 @@ def detect_markers(psid, pid): # ######################################## 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秒检查一次 + # 使用 communicate() 等待进程完成 stdout, stderr = process.communicate() + # 获取进程的退出码 + exit_code = process.returncode + print(f"Process exited with code: {exit_code}") print(f"Output: {stdout.decode()}") print(f"Error: {stderr.decode()}") print("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA") From fadf6c300ed24cc44f040ad9c8c4b25512b39280 Mon Sep 17 00:00:00 2001 From: dongchangxi <458593490@qq.com> Date: Sun, 12 Jan 2025 00:00:16 +0800 Subject: [PATCH 4/8] 1 --- yj_local_build/main_step1.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/yj_local_build/main_step1.py b/yj_local_build/main_step1.py index 43bdea0..3be70ce 100644 --- a/yj_local_build/main_step1.py +++ b/yj_local_build/main_step1.py @@ -106,15 +106,15 @@ def detect_markers(psid, pid): #res = subprocess.run(cmd) # ######################################## - - process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - # 使用 communicate() 等待进程完成 - stdout, stderr = process.communicate() - # 获取进程的退出码 - exit_code = process.returncode - print(f"Process exited with code: {exit_code}") - print(f"Output: {stdout.decode()}") - print(f"Error: {stderr.decode()}") + process = subprocess.Popen(cmd, shell=True) + # 获取主进程的 PID + pidddd = process.pid + + # 在等待主进程的同时,检查子进程的状态 + 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") From 6dcfe5a8fdd67cf1c531b67d6252d6a2cc6dfbf1 Mon Sep 17 00:00:00 2001 From: dongchangxi <458593490@qq.com> Date: Sun, 12 Jan 2025 00:04:54 +0800 Subject: [PATCH 5/8] 1 --- yj_local_build/main_step1.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/yj_local_build/main_step1.py b/yj_local_build/main_step1.py index 3be70ce..926a036 100644 --- a/yj_local_build/main_step1.py +++ b/yj_local_build/main_step1.py @@ -109,6 +109,9 @@ def detect_markers(psid, pid): process = subprocess.Popen(cmd, shell=True) # 获取主进程的 PID pidddd = process.pid + + while True: + print("process",process.wait()) # 在等待主进程的同时,检查子进程的状态 while process.poll() is None: From 006eef1d948adcb928b19ecd647cf3df34ae3157 Mon Sep 17 00:00:00 2001 From: dongchangxi <458593490@qq.com> Date: Sun, 12 Jan 2025 00:07:45 +0800 Subject: [PATCH 6/8] 1 --- yj_local_build/main_step1.py | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/yj_local_build/main_step1.py b/yj_local_build/main_step1.py index 926a036..90a8866 100644 --- a/yj_local_build/main_step1.py +++ b/yj_local_build/main_step1.py @@ -102,30 +102,7 @@ def detect_markers(psid, pid): -exportReconstructionRegion "{os.path.join(config["workdir"], pid, f"{pid}.rcbox")}" \ {textpicCmd} -save "{os.path.join(config["workdir"], pid, f"{pid}.rcproj")}" -quit' print(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") - # ######################################## - + cmd = shlex.split(cmd) time.sleep(3) fix_region() print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} pid: {pid} 定位点检测完成, 共费时{diff_time(start_time)}') From 920399f4a0725f8316a8e4246fc40e97a647d917 Mon Sep 17 00:00:00 2001 From: dongchangxi <458593490@qq.com> Date: Sun, 12 Jan 2025 00:25:49 +0800 Subject: [PATCH 7/8] 1 --- yj_local_build/main_step1.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yj_local_build/main_step1.py b/yj_local_build/main_step1.py index 90a8866..380da85 100644 --- a/yj_local_build/main_step1.py +++ b/yj_local_build/main_step1.py @@ -93,9 +93,9 @@ def detect_markers(psid, pid): cmd = f'{config["rcbin"]} {config["r2"]["init"]} -setInstanceName {pid} \ -save "{os.path.join(config["workdir"], pid, f"{pid}.rcproj")}" \ - -addFolder "{os.path.join(config["workdir"], pid, "photo1")}" {config["r"]["setTextureFalse"]}\ - -addFolder "{os.path.join(config["workdir"], pid, "photo2")}" -align -detectMarkers "{dirCurr}\detectMarkers_1.5.config.xml"\ - -align -align -detectMarkers "{dirCurr}\detectMarkers_1.5.config.xml" -align -align -selectAllImages \ + -addFolder "{os.path.join(config["workdir"], pid, "photo1")}" {config["r"]["setTextureFalse"]} \ + -addFolder "{os.path.join(config["workdir"], pid, "photo2")}" -align -detectMarkers "{dirCurr}\detectMarkers_1.5.config.xml" \ + -align -align -align -align -selectAllImages -detectMarkers "{dirCurr}\detectMarkers_1.5.config.xml" \ -defineDistance 36h11:001 36h11:002 1 -defineDistance 36h11:002 36h11:004 1 -defineDistance 36h11:004 36h11:003 1 -defineDistance 36h11:003 36h11:001 1 -align -align -update {config["r2"]["setRegion"]} \ -exportXMP "{dirCurr}\exportXMP.1.5.draft.config.xml" \ -exportControlPointsMeasurements "{os.path.join(config["workdir"], pid, f"{pid}.controlPoints.csv")}" "{dirCurr}\exportControlPoints.config.xml" \ From ee5f0247229174a3ce202fc3769c7a03619c5bb9 Mon Sep 17 00:00:00 2001 From: dongchangxi <458593490@qq.com> Date: Sun, 12 Jan 2025 00:29:32 +0800 Subject: [PATCH 8/8] 1 --- yj_local_build/main_step1.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/yj_local_build/main_step1.py b/yj_local_build/main_step1.py index 380da85..38920c3 100644 --- a/yj_local_build/main_step1.py +++ b/yj_local_build/main_step1.py @@ -103,6 +103,8 @@ def detect_markers(psid, pid): {textpicCmd} -save "{os.path.join(config["workdir"], pid, f"{pid}.rcproj")}" -quit' print(cmd) cmd = shlex.split(cmd) + res = subprocess.run(cmd) + print("res",res) time.sleep(3) fix_region() print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} pid: {pid} 定位点检测完成, 共费时{diff_time(start_time)}')