|
@@ -511,23 +511,66 @@ bool cmdMainProcess::CreateProcess_(string pathGeo, string pathParam)
|
|
|
msg_str.append("6. Save the surface mesh to .mesh (optional)");
|
|
|
emit LogMsg::getInstance()->send_to_sendClient(object->ToJson("log",msg_str));
|
|
|
string strName = get_uuid();
|
|
|
- string appPath = get_file_path(object->da_struct->geoPath);
|
|
|
+ string dirPath = get_file_path(object->da_struct->geoPath);
|
|
|
+ QDir dir1("/cephfs/mesh_results");
|
|
|
+ if(!dir1.exists())
|
|
|
+ {
|
|
|
+ dir1.mkdir("/cephfs/mesh_results");
|
|
|
+ }
|
|
|
+ string appPath("/cephfs/mesh_results");
|
|
|
+ appPath.append("/");
|
|
|
+ appPath.append(dirPath);
|
|
|
+ QDir dir2(QString::fromStdString(appPath));
|
|
|
+ if(!dir2.exists())
|
|
|
+ {
|
|
|
+ dir2.mkdir(QString::fromStdString(appPath));
|
|
|
+ }
|
|
|
if (ADIParam_.strResultFormat == ".ugrid")
|
|
|
{
|
|
|
strName = strName+".ugrid";
|
|
|
- crw->WirteUgridFoamFile(surfMesh_,(appPath+strName).c_str());
|
|
|
+ msg_str.clear();
|
|
|
+ if(true==crw->WirteUgridFoamFile(surfMesh_,(appPath+"/"+strName).c_str())){
|
|
|
+ msg_str.append("result file save path=");
|
|
|
+ msg_str.append((appPath+"/"+strName).c_str());
|
|
|
+ }else{
|
|
|
+ msg_str.append("result file save failed!");
|
|
|
+ }
|
|
|
+ emit LogMsg::getInstance()->send_to_sendClient(object->ToJson("log",msg_str));
|
|
|
}
|
|
|
else if (ADIParam_.strResultFormat == ".vtk") {
|
|
|
strName = strName+".vtk";
|
|
|
- crw->WirteVtkFoamFile(surfMesh_,(appPath + strName).c_str());
|
|
|
+ msg_str.clear();
|
|
|
+ if(true==crw->WirteVtkFoamFile(surfMesh_,(appPath+"/"+strName).c_str()))
|
|
|
+ {
|
|
|
+ msg_str.append("result file save path=");
|
|
|
+ msg_str.append((appPath+"/"+strName).c_str());
|
|
|
+ }else{
|
|
|
+ msg_str.append("result file save failed!");
|
|
|
+ }
|
|
|
+ emit LogMsg::getInstance()->send_to_sendClient(object->ToJson("log",msg_str));
|
|
|
}
|
|
|
else if (ADIParam_.strResultFormat == ".bdf") {
|
|
|
strName = strName+".bdf";
|
|
|
- crw->WirteBDFFoamFile(surfMesh_,(appPath + strName).c_str());
|
|
|
+ msg_str.clear();
|
|
|
+ if(true==crw->WirteBDFFoamFile(surfMesh_,(appPath+"/"+strName).c_str())){
|
|
|
+ msg_str.append("result file save path=");
|
|
|
+ msg_str.append((appPath+"/"+strName).c_str());
|
|
|
+ }else{
|
|
|
+ msg_str.append("result file save failed!");
|
|
|
+ }
|
|
|
+ emit LogMsg::getInstance()->send_to_sendClient(object->ToJson("log",msg_str));
|
|
|
}
|
|
|
else if (ADIParam_.strResultFormat == ".neu") {
|
|
|
strName = strName+".neu";
|
|
|
- crw->WriteNeuFoamFile(surfMesh_,(appPath + strName).c_str());
|
|
|
+ msg_str.clear();
|
|
|
+ if(true==crw->WriteNeuFoamFile(surfMesh_,(appPath+"/"+strName).c_str()))
|
|
|
+ {
|
|
|
+ msg_str.append("result file save path=");
|
|
|
+ msg_str.append((appPath+"/"+strName).c_str());
|
|
|
+ }else{
|
|
|
+ msg_str.append("result file save failed!");
|
|
|
+ }
|
|
|
+ emit LogMsg::getInstance()->send_to_sendClient(object->ToJson("log",msg_str));
|
|
|
}
|
|
|
|
|
|
|
|
@@ -615,8 +658,9 @@ void cmdMainProcess::exit_on_bad_outcome(const outcome &o)
|
|
|
string cmdMainProcess::get_file_path(string &path)
|
|
|
{
|
|
|
int num = path.find_last_of('/');
|
|
|
- path = path.substr(0,num+1);
|
|
|
- return path;
|
|
|
+ path = path.substr(0,num);
|
|
|
+ int num2 = path.find_last_of('/');
|
|
|
+ return path.substr(num2,num-num2+1);
|
|
|
}
|
|
|
|
|
|
/*
|