分布式处理和脚底板文件

This commit is contained in:
dongchangxi committed 2023-11-09 11:27:00 +08:00
1 parent f4254f0051
commit 2c036235a6
19 files changed
+1932 -56

No files matched your search

+23
View File
@@ -113,6 +113,28 @@ def change_rcbox_s(pid,new_value):
with open(rcbox_path, 'w') as f:
f.write(new_content)
#读取 rcbox 修改 widthHeightDepth 重建区域的深度
def change_rcbox_deepth(pid,new_value):
rcbox_path = os.path.join(config.workdir, pid, f"{pid}.rcbox")
old_value_pattern = r'<widthHeightDepth>(.*?)</widthHeightDepth>'
#读取文件内容
with open(rcbox_path, 'r') as f:
content = f.read()
#使用正则表达式进行匹配
match = re.search(old_value_pattern,content)
if match:
old_value = match.group(1)
if old_value == "":
return
#分割字符串
arrStr = old_value.split(" ")
#重新拼接字符串
strs = arrStr[0]+" "+arrStr[1]+" "+str(float(arrStr[2])+new_value)
new_content = re.sub(old_value_pattern,f'<widthHeightDepth>{strs}</widthHeightDepth>',content)
#重新写入进去
with open(rcbox_path, 'w') as f:
f.write(new_content)
#修改rcproj文件,删除没有模型的component,保留最多model 的component
def changeRcprojFile(pid):
# 解析XML文件
@@ -180,6 +202,7 @@ def down_points_from_oss(pid,psid):
#判断oss上是否存在指定的controlpoints文件
def isExistControlPointsOss(pid):
return False
psid = libs.getPSid(pid)
filePath = f'points/{psid}/controlpoints_{psid}.dat'
#判断oss上是否存在