dongchangxi 4 weeks ago
parent
commit
5b7197a2ab
  1. 6
      script/factory_sliceing/type_setting_order.py

6
script/factory_sliceing/type_setting_order.py

@ -118,7 +118,7 @@ def step1(versionId):
os.makedirs(jsonSubDir) os.makedirs(jsonSubDir)
# 移动JSON文件到新目录 # 移动JSON文件到新目录
newJsonPath = os.path.join(jsonSubDir, f'{versionId}.json') newJsonPath = os.path.join(jsonSubDir, '3DPrintLayout.json')
if os.path.exists(localFilePath): if os.path.exists(localFilePath):
if os.path.exists(newJsonPath): if os.path.exists(newJsonPath):
os.remove(newJsonPath) os.remove(newJsonPath)
@ -197,7 +197,7 @@ def main(work_dir=None):
print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} JSON文件下载数据失败,等待10秒') print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} JSON文件下载数据失败,等待10秒')
time.sleep(10) time.sleep(10)
continue continue
jsonFilePath = os.path.join(res, 'json', f'{versionId}.json') jsonFilePath = os.path.join(res, 'json', '3DPrintLayout.json')
# 确保 jsonFilePath 是文件而不是目录 # 确保 jsonFilePath 是文件而不是目录
if not os.path.isfile(jsonFilePath): if not os.path.isfile(jsonFilePath):
print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} JSON文件不存在: {jsonFilePath},等待10秒') print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} JSON文件不存在: {jsonFilePath},等待10秒')
@ -215,7 +215,7 @@ def main(work_dir=None):
if file.endswith('.obj'): if file.endswith('.obj'):
objCounts += 1 objCounts += 1
requestApiToUpdateSliceStatus(versionId,objCounts) requestApiToUpdateSliceStatus(versionId,objCounts)
time.sleep(10) #time.sleep(10)
if __name__ == '__main__': if __name__ == '__main__':

Loading…
Cancel
Save