From 3f8cef7b1d0e3a15869f685aab770fc09dc9aede Mon Sep 17 00:00:00 2001 From: youwater Date: Mon, 9 Oct 2023 14:56:25 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=A2=9E=E5=8A=A0wait=20title?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main_step2.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main_step2.py b/main_step2.py index 52a002d..57f519c 100644 --- a/main_step2.py +++ b/main_step2.py @@ -29,7 +29,7 @@ def make3d(pid): cmd = f'{config.rcbin} {config.r1["init"]} \ -addFolder "{os.path.join(config.workdir, pid, "photo1")}" -addFolder "{os.path.join(config.workdir, pid, "photo2")}" {add_photo3} \ -importControlPointsMeasurements "{os.path.join(config.workdir, pid, f"{pid}.controlPoints.csv")}" \ - -align -save "{os.path.join(config.workdir, pid, f"{pid}.rcproj")}"' + -align -save "{os.path.join(config.workdir, pid, f"{pid}_wait.rcproj")}" ' print(cmd) cmd = shlex.split(cmd) res = subprocess.run(cmd) @@ -37,6 +37,8 @@ def make3d(pid): # defind_distance + time.sleep(20) + shutil.move(os.path.join(config.workdir, pid, f'{pid}_wait.rcproj'), os.path.join(config.workdir, pid, f'{pid}.rcproj')) print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} pid: {pid} 定义定位点距离完成') cmd = f'{config.rcbin} {config.r1["init"]} -load "{os.path.join(config.workdir, pid, f"{pid}.rcproj")}" -update \ From 32ca229efde1bf92035be109f01a8f7ae48e3370 Mon Sep 17 00:00:00 2001 From: dongchangxi <458593490@qq.com> Date: Mon, 9 Oct 2023 15:17:26 +0800 Subject: [PATCH 2/2] =?UTF-8?q?step1=20=E7=9A=84=20=E7=A7=BB=E5=8A=A8?= =?UTF-8?q?=E5=85=B1=E4=BA=AB=E7=9B=AE=E5=BD=95=20=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=9B=B4=E5=88=B0=E6=9C=80=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main_step1.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/main_step1.py b/main_step1.py index c105048..2cd3918 100644 --- a/main_step1.py +++ b/main_step1.py @@ -157,16 +157,18 @@ def step1(pid, experience=False, makeloop=True): print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} {pid} step1图片预处理完成,共费时{libs.diff_time(start_time)}') + if os.path.exists(os.path.join(config.sharedir, pid)): + shutil.rmtree(os.path.join(config.sharedir, pid), ignore_errors=True) + shutil.copytree(os.path.join(config.workdir, pid), os.path.join(config.sharedir, pid)) + print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} {pid} step1任务完成,移动到共享目录') + # TODO: 更新本地step1任务状态,加入step2任务队列 if makeloop: os.system(f'python main_step2.py {pid}') else: os.system(f'python main_step2.py {pid}') - # if os.path.exists(os.path.join(config.sharedir, pid)): - # shutil.rmtree(os.path.join(config.sharedir, pid), ignore_errors=True) - # shutil.move(os.path.join(config.workdir, pid), config.sharedir) - - # print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} {pid} step1任务完成,移动到共享目录') + + def main(pid, experience=False, makeloop=True): if pid == '0':