Ejemplo n.º 1
0
 def start_actions(self):
     core_logger.info(
         f"划分网格信息写入数据库 | mesh_app: {self.mesh_app}"
         f" | work_path: {self.work_path} | cad:name: {self.cad_file_path}"
         f" | mesh_name: {self.mesh_name}")
     mesh_id = DB.write_mesh(meshing_path=self.work_path,
                             cad_path=self.cad_file_path,
                             username=self.username,
                             mesh_app=self.mesh_app,
                             mesh_config=self.mesh_config,
                             launch_script=str(self.lanuch_script))
     core_logger.info(f"异步进行网格的划分 | mesh_id: {mesh_id}")
     try:
         mc_process = Process(target=self._asyc_mesh, args=(mesh_id, ))
         mc_process.start()
         core_logger.info(
             f"异步mesh_convert进程开始 | pid: {mc_process.pid} | mesh_id: {mesh_id}"
         )
         # self._asyc_mesh(mesh_id)
     except ProcessError:
         # TODO 更新数据库
         core_logger.exception(f"开启转换进程失败 | mesh_id: {mesh_id}")
         return -1, "开启网格进程失败"
     return mesh_id, "success!"