SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder();
SALOMEDS::SObject_var aIterSO = SALOMEDS::SObject::_narrow(myCurrentStudy->FindObjectIOR(_orb->object_to_string(myIteration)));
- const char* icone ;
+ std::string icone ;
if ( Etat <= 0 )
icone = "iter0.png" ;
else if ( Etat == 2 )
icone = "iter_calculee.png" ;
else
icone = "iter_non_calculee.png" ;
- PublishInStudyAttr(aStudyBuilder, aIterSO, NULL , NULL, icone, NULL) ;
+ PublishInStudyAttr(aStudyBuilder, aIterSO, NULL , NULL, icone.c_str(), NULL) ;
aStudyBuilder->CommitCommand();
throw SALOME::SALOME_Exception(es);
return ;
};
- const char* dirCase = myCase->GetDirName();
const char* nomDir = myIteration->GetDirName();
const char* nomFichier = myIteration->GetMeshFile();
- std::string commande= "rm -rf " + std::string(dirCase) + "/" + std::string(nomDir);
+ std::string commande= "rm -rf " + std::string(nomDir);
if ( Option == 1 ) { commande = commande + ";rm -rf " + std::string(nomFichier) ; }
MESSAGE ( "commande = " << commande );
if ((system(commande.c_str())) != 0)
throw SALOME::SALOME_Exception(es);
return ;
};
- const char* dirCase = myCase->GetDirName();
const char* nomDir = myIteration->GetDirName();
- std::string commande = "rm -f " + std::string(dirCase) + "/" + std::string(nomDir) + "/info* " ;
- commande += std::string(dirCase) + "/" + std::string(nomDir) + "/Liste.*info" ;
+ std::string commande = "rm -f " + std::string(nomDir) + "/info* " ;
+ commande += std::string(nomDir) + "/Liste.*info" ;
/* MESSAGE ( "commande = " << commande );*/
if ((system(commande.c_str())) != 0)
{
//
{
MESSAGE ( "CreateCaseFromIteration : nomCas = " << nomCas << ", DirNameStart = " << DirNameStart );
- char* nomDirWork = getenv("PWD") ;
+ std::string nomDirWork = getenv("PWD") ;
int codret ;
// A. Decodage du point de reprise
IterName = myCase->GetIter0Name() ;
HOMARD::HOMARD_Iteration_var Iter = GetIteration(IterName) ;
char* nomDirIter = CreateDirNameIter(nomDirCase, 0 );
- Iter->SetDirName(nomDirIter);
+ Iter->SetDirNameLoc(nomDirIter);
std::string nomDirIterTotal ;
nomDirIterTotal = std::string(nomDirCase) + "/" + std::string(nomDirIter) ;
if (mkdir(nomDirIterTotal.c_str(), S_IRWXU|S_IRGRP|S_IXGRP) != 0)
delete[] MeshName ;
delete[] MeshFile ;
- chdir(nomDirWork);
+ chdir(nomDirWork.c_str());
return HOMARD::HOMARD_Cas::_duplicate(myCase);
}
{
SALOME::ExceptionStruct es;
es.type = SALOME::BAD_PARAM;
- es.text = "This directory of the case does not exist.";
+ es.text = "The directory of the case for the pursuit does not exist.";
throw SALOME::SALOME_Exception(es);
return 0;
};
// la creation d'un sous-repertoire unique
int nbitercase = myCase->GetNumberofIter();
char* nomDirIter = CreateDirNameIter(nomDirCase, nbitercase );
- myIteration->SetDirName(nomDirIter);
+ myIteration->SetDirNameLoc(nomDirIter);
// Le nom du fichier du maillage MED est indice par le nombre d'iterations du cas.
// Si on a une chaine unique depuis le depart, ce nombre est le meme que le
// B. Les repertoires
// B.1. Le repertoire courant
- char* nomDirWork = getenv("PWD") ;
+ std::string nomDirWork = getenv("PWD") ;
// B.2. Le sous-repertoire de l'iteration a traiter
char* DirCompute = ComputeDirManagement(myCase, myIteration, etatMenage);
MESSAGE( ". DirCompute = " << DirCompute );
{
delete myDriver;
MESSAGE ( ". On retourne dans nomDirWork = " << nomDirWork );
- chdir(nomDirWork);
+ chdir(nomDirWork.c_str());
}
return codretexec ;
return codret ;
}
//=============================================================================
-// Creation d'un nom de sous-repertoire pour l'iteration au sein d'un repertoire
+// Creation d'un nom de sous-repertoire pour l'iteration au sein d'un repertoire parent
// nomrep : nom du repertoire parent
// num : le nom du sous-repertoire est sous la forme 'In', n est >= num
//=============================================================================
char* HOMARD_Gen_i::CreateDirNameIter(const char* nomrep, CORBA::Long num )
{
MESSAGE ( "CreateDirNameIter : nomrep ="<< nomrep << ", num = "<<num);
- char* nomDirActuel = getenv("PWD") ;
+ // On verifie que le repertoire parent existe
+ int codret = chdir(nomrep) ;
+ if ( codret != 0 )
+ {
+ SALOME::ExceptionStruct es;
+ es.type = SALOME::BAD_PARAM;
+ es.text = "The directory of the case does not exist.";
+ throw SALOME::SALOME_Exception(es);
+ return 0;
+ };
+ std::string nomDirActuel = getenv("PWD") ;
std::string DirName ;
// On boucle sur tous les noms possibles jusqu'a trouver un nom correspondant a un repertoire inconnu
bool a_chercher = true ;
MESSAGE ( "==> DirName = " << DirName);
MESSAGE ( ". On retourne dans nomDirActuel = " << nomDirActuel );
- chdir(nomDirActuel);
+ chdir(nomDirActuel.c_str());
return CORBA::string_dup( DirName.c_str() );
}
// B.3. Le sous-repertoire de l'iteration a calculer, puis le repertoire complet a creer
// B.3.1. Le nom du sous-repertoire
- const char* nomDirIt = myIteration->GetDirName();
+ const char* nomDirIt = myIteration->GetDirNameLoc();
// B.3.2. Le nom complet du sous-repertoire
std::stringstream DirCompute ;
const char* nomIterationParent = myIteration->GetIterParentName();
HOMARD::HOMARD_Iteration_var myIterationParent = myContextMap[GetCurrentStudyID()]._mesIterations[nomIterationParent];
- const char* nomDirItPa = myIterationParent->GetDirName();
+ const char* nomDirItPa = myIterationParent->GetDirNameLoc();
std::stringstream DirComputePa ;
DirComputePa << nomDirCase << "/" << nomDirItPa;
MESSAGE( ". nomDirItPa = " << nomDirItPa);
else { MESSAGE("La categorie des zones existe deja."); }
aResultSO = aStudyBuilder->NewObject(aSOZone);
- const char* icone ;
+ std::string icone ;
switch (ZoneType)
{
case 11 :
break ;
}
}
- PublishInStudyAttr(aStudyBuilder, aResultSO, theName, "ZoneHomard", icone, _orb->object_to_string(theObject) ) ;
+ PublishInStudyAttr(aStudyBuilder, aResultSO, theName, "ZoneHomard", icone.c_str(), _orb->object_to_string(theObject) ) ;
return aResultSO._retn();
}
aResultSO = aStudyBuilder->NewObject(aSOBoundary);
CORBA::Long BoundaryType = myBoundary->GetType();
// MESSAGE("BoundaryType : "<<BoundaryType);
- const char* icone ;
- const char* value ;
+ std::string icone ;
+ std::string value ;
switch (BoundaryType)
{
case 0 :
break;
}
}
- PublishInStudyAttr(aStudyBuilder, aResultSO, theName, value, icone, _orb->object_to_string(theObject));
+ PublishInStudyAttr(aStudyBuilder, aResultSO, theName, value.c_str(), icone.c_str(), _orb->object_to_string(theObject));
return aResultSO._retn();
}
// Pour les fichiers med, on affiche une icone de maillage
// Pour les fichiers qui sont texte, on affiche une icone de fichier texte 'texte'
// Le reperage se fait par la 1ere lettre du commentaire : I pour Iteration n
- const char* icone ;
- const char* ior = " " ;
+ std::string icone ;
+ std::string ior = " " ;
if ( Commentaire[0] == 'I' )
{ icone = "med.png" ; }
else
{ icone = "texte_2.png" ; }
- PublishInStudyAttr(aStudyBuilder, aSubSO, NomFich, Commentaire, icone, ior ) ;
+ PublishInStudyAttr(aStudyBuilder, aSubSO, NomFich, Commentaire, icone.c_str(), ior.c_str() ) ;
aStudyBuilder->CommitCommand();
}