return ;
};
+ MESSAGE( "SetEtatIter : 1" );
myIteration->SetState(Etat);
-
+ MESSAGE( "SetEtatIter : 2" );
SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder();
+ MESSAGE( "SetEtatIter : 3" );
SALOMEDS::SObject_var aIterSO = SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myIteration)));
-
+ MESSAGE( "SetEtatIter : 4" );
std::string icone ;
if ( Etat <= 0 )
icone = "iter0.png" ;
icone = "iter_calculee.png" ;
else
icone = "iter_non_calculee.png" ;
+
+ MESSAGE( "SetEtatIter : 5" );
PublishInStudyAttr(aStudyBuilder, aIterSO, NULL , NULL, icone.c_str(), NULL) ;
-
+ MESSAGE( "SetEtatIter : 6" );
aStudyBuilder->CommitCommand();
-
+ MESSAGE( "SetEtatIter : 7" );
}
//=============================================================================
//=============================================================================
if ( Option == 1 )
{
std::string nomFichier = myYACS->GetXMLFile();
+#ifndef _WIN32
std::string commande = "rm -rf " + nomFichier ;
+#else
+ std::string commande = "del /s /q " + nomFichier ;
+#endif
MESSAGE ( "commande = " << commande );
if ((system(commande.c_str())) != 0)
{
};
std::string nomDir = myIteration->GetDirName();
std::string nomFichier = myIteration->GetMeshFile();
+#ifndef _WIN32
std::string commande = "rm -rf " + std::string(nomDir);
- if ( Option == 1 ) { commande = commande + ";rm -rf " + std::string(nomFichier) ; }
+#else
+ std::string commande = "del /s /q " + std::string(nomDir);
+#endif
+ if ( Option == 1 ) {
+#ifndef _WIN32
+ commande = commande + ";rm -rf " + std::string(nomFichier) ;
+#else
+ commande = commande + " & del /s /q " + std::string(nomFichier) ;
+#endif
+ }
MESSAGE ( "commande = " << commande );
if ((system(commande.c_str())) != 0)
{
return ;
};
const char* nomDir = myIteration->GetDirName();
+#ifndef _WIN32
std::string commande = "rm -f " + std::string(nomDir) + "/info* " ;
commande += std::string(nomDir) + "/Liste.*info" ;
+#else
+ std::string commande = "del /s /q " + std::string(nomDir) + "\\info* ";
+ commande += std::string(nomDir) + "\\Liste.*info" ;
+#endif
/* MESSAGE ( "commande = " << commande );*/
if ((system(commande.c_str())) != 0)
{
}
}
std::string nomFichier = myYACS->GetXMLFile();
+#ifndef _WIN32
std::string commande = "rm -rf " + std::string(nomFichier) ;
+#else
+ std::string commande = "del /s /q " + std::string(nomFichier) ;
+#endif
MESSAGE ( "commande = " << commande );
if ((system(commande.c_str())) != 0)
{
// Creation des structures identifiees par leurs noms
//=============================================================================
//=============================================================================
+void HOMARD_Gen_i::youyou0(const char* nomCas)
+{
+ INFOS ( "youyou0 : nomCas = " << nomCas );
+}
+
+
HOMARD::HOMARD_Cas_ptr HOMARD_Gen_i::CreateCase(const char* nomCas, const char* MeshName, const char* MeshFile)
//
// Creation d'un cas initial
int option = 1 ;
if ( _PublisMeshIN != 0 ) option = 2 ;
- HOMARD::HOMARD_Cas_ptr myCase = CreateCase0(nomCas, MeshName, MeshFile, 0, 0, option) ;
+
+ youyou0(nomCas);
+ INFOS ( "CreateCase : call ptr ?");
+
+ HOMARD::HOMARD_Cas_ptr myCase = nullptr;
+
+ INFOS ( "CreateCase : call CreateCase0 ?");
+ myCase = CreateCase0(nomCas, MeshName, MeshFile, 0, 0, option) ;
// Valeurs par defaut des filtrages
myCase->SetPyram(0);
//
{
MESSAGE ( "CreateCaseFromIteration : nomCas = " << nomCas << ", DirNameStart = " << DirNameStart );
+#ifndef _WIN32
std::string nomDirWork = getenv("PWD") ;
+#else
+ std::string nomDirWork = getenv("CD") ;
+#endif
int codret ;
// A. Decodage du point de reprise
closedir(dp);
#else
HANDLE hFind = INVALID_HANDLE_VALUE;
- WIN32_FIND_DATA ffd;
- hFind = FindFirstFile(DirNameStart, &ffd);
+ WIN32_FIND_DATAA ffd;
+ hFind = FindFirstFileA(DirNameStart, &ffd);
if (INVALID_HANDLE_VALUE != hFind) {
- while (FindNextFile(hFind, &ffd) != 0) {
+ while (FindNextFileA(hFind, &ffd) != 0) {
if (ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) continue; //skip directories
std::string file_name(ffd.cFileName);
bilan = file_name.find("HOMARD.Configuration.") ;
char* nomDirIter = CreateDirNameIter(nomDirCase, 0 );
Iter->SetDirNameLoc(nomDirIter);
std::string nomDirIterTotal ;
+#ifndef _WIN32
nomDirIterTotal = std::string(nomDirCase) + "/" + std::string(nomDirIter) ;
+#else
+ nomDirIterTotal = std::string(nomDirCase) + "\\" + std::string(nomDirIter) ;
+#endif
#ifndef WIN32
if (mkdir(nomDirIterTotal.c_str(), S_IRWXU|S_IRGRP|S_IXGRP) != 0)
#else
}
// E.3. Copie du maillage HOMARD au format MED
codret = CHDIR(DirNameStart) ;
+#ifndef _WIN32
std::string commande = "cp " + file_maillage_homard + " " + nomDirIterTotal ;
+#else
+ std::string commande = "copy " + file_maillage_homard + " " + nomDirIterTotal ;
+#endif
MESSAGE ( "commande : " << commande ) ;
codret = system(commande.c_str()) ;
MESSAGE ( "codret : " << codret ) ;
MESSAGE ( "CreateCaseFromCaseLastIteration : nomCas = " << nomCas << ", DirNameStart = " << DirNameStart );
std::string DirNameStartIter = CreateCase1(DirNameStart, -1) ;
-
+#ifndef _WIN32
DirNameStartIter = string(DirNameStart) + "/" + DirNameStartIter ;
+#else
+ DirNameStartIter = string(DirNameStart) + "\\" + DirNameStartIter ;
+#endif
HOMARD::HOMARD_Cas_ptr myCase = CreateCaseFromIteration(nomCas, DirNameStartIter.c_str()) ;
return HOMARD::HOMARD_Cas::_duplicate(myCase);
};
std::string DirNameStartIter = CreateCase1(DirNameStart, Number) ;
-
+#ifndef _WIN32
DirNameStartIter = string(DirNameStart) + "/" + DirNameStartIter ;
+#else
+ DirNameStartIter = string(DirNameStart) + "\\" + DirNameStartIter ;
+#endif
HOMARD::HOMARD_Cas_ptr myCase = CreateCaseFromIteration(nomCas, DirNameStartIter.c_str()) ;
return HOMARD::HOMARD_Cas::_duplicate(myCase);
//
{
MESSAGE ( "CreateCase1 : DirNameStart = " << DirNameStart << ", Number = " << Number );
+#ifndef _WIN32
std::string nomDirWork = getenv("PWD") ;
+#else
+ std::string nomDirWork = getenv("CD") ;
+#endif
std::string DirNameStartIter ;
int codret ;
int NumeIterMax = -1 ;
std::string DirName_1(dirp->d_name);
#else
HANDLE hFind = INVALID_HANDLE_VALUE;
- WIN32_FIND_DATA ffd;
- hFind = FindFirstFile(DirNameStart, &ffd);
- if (INVALID_HANDLE_VALUE != hFind) {
- while (FindNextFile(hFind, &ffd) != 0) {
- std::string DirName_1 = "";
- if (ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
- DirName_1 = std::string(ffd.cFileName);
- }
+ WIN32_FIND_DATAA ffd;
+ hFind = FindFirstFileA(DirNameStart, &ffd);
+ while (INVALID_HANDLE_VALUE != hFind && FindNextFileA(hFind, &ffd) != 0) {
+ std::string DirName_1 = "";
+ if (ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
+ DirName_1 = std::string(ffd.cFileName);
+ }
#endif
if ( ( DirName_1 != "." ) && ( DirName_1 != ".." ) )
{
std::string file_name_1(dirp_1->d_name);
#else
HANDLE hFind1 = INVALID_HANDLE_VALUE;
- WIN32_FIND_DATA ffd1;
- hFind1 = FindFirstFile(DirName_1.c_str(), &ffd1);
- while (FindNextFile(hFind1, &ffd1) != 0)
+ WIN32_FIND_DATAA ffd1;
+ hFind1 = FindFirstFileA(DirName_1.c_str(), &ffd1);
+ while (FindNextFileA(hFind1, &ffd1) != 0)
{
if (ffd1.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) continue; //skip directories
std::string file_name_1(ffd1.cFileName);
// 1 : aucune option
// x2 : publication du maillage dans SMESH
{
- MESSAGE ( "CreateCase0 : nomCas = " << nomCas );
- MESSAGE ( "CreateCase0 : MeshName = " << MeshName << ", MeshFile = " << MeshFile << ", MeshOption = " << MeshOption );
+ INFOS ( "CreateCase0 : nomCas = " << nomCas );
+ INFOS ( "CreateCase0 : MeshName = " << MeshName << ", MeshFile = " << MeshFile << ", MeshOption = " << MeshOption );
MESSAGE ( "CreateCase0 : NumeIter = " << NumeIter << ", Option = " << Option );
//
// A. Controles
NomIteration = nom.str();
monNum += 1;
}
- MESSAGE ( "CreateCas0 : ==> NomIteration = " << NomIteration );
+ MESSAGE ( "CreateCase0 : ==> NomIteration = " << NomIteration );
// D.2. Creation de l'iteration
HOMARD::HOMARD_Iteration_var anIter = newIteration();
anIter->SetName(NomIteration.c_str());
AssociateCaseIter (nomCas, NomIteration.c_str(), "IterationHomard");
+ MESSAGE ( "CreateCase0 : existeMeshFile" );
+
// D.4. Maillage correspondant
if ( existeMeshFile != 0 )
{
anIter->SetMeshFile(MeshFile);
if ( Option % 2 == 0 ) { PublishResultInSmesh(MeshFile, 0); }
}
+ MESSAGE ( "CreateCase0 : SetMeshName" );
anIter->SetMeshName(MeshName);
+ MESSAGE ( "CreateCase0 : SetNumber" );
// D.5. Numero d'iteration
anIter->SetNumber(NumeIter);
+ MESSAGE ( "CreateCase0 : SetEtatIter" );
// D.6. Etat
SetEtatIter(NomIteration.c_str(), -NumeIter);
//
std::ostringstream iaux ;
iaux << std::setw(jaux) << std::setfill('0') << nbitercase ;
std::stringstream MeshFile;
+#ifndef _WIN32
MeshFile << nomDirCase << "/maill." << iaux.str() << ".med";
+#else
+ MeshFile << nomDirCase << "\\maill." << iaux.str() << ".med";
+#endif
myIteration->SetMeshFile(MeshFile.str().c_str());
// Association avec le cas
// B. Les répertoires
// B.1. Le répertoire courant
+#ifndef _WIN32
std::string nomDirWork = getenv("PWD") ;
+#else
+ std::string nomDirWork = getenv("CD") ;
+#endif
// B.2. Le sous-répertoire de l'iteration a traiter
char* DirCompute = ComputeDirManagement(myCase, myIteration, etatMenage);
MESSAGE( ". DirCompute = " << DirCompute );
// C. Le fichier des messages
// C.1. Le deroulement de l'execution de HOMARD
std::string LogFile = DirCompute ;
+#ifndef _WIN32
LogFile += "/Liste" ;
+#else
+ LogFile += "\\Liste" ;
+#endif
if ( modeHOMARD == 1 ) { LogFile += "." + siter + ".vers." + siterp1 ; }
LogFile += ".log" ;
MESSAGE (". LogFile = " << LogFile);
if ( modeHOMARD == 1 ) { myIteration->SetLogFile(LogFile.c_str()); }
// C.2. Le bilan de l'analyse du maillage
std::string FileInfo = DirCompute ;
+#ifndef _WIN32
FileInfo += "/" ;
+#else
+ FileInfo += "\\" ;
+#endif
if ( modeHOMARD == 1 ) { FileInfo += "apad" ; }
else
{ if ( NumeIter == 0 ) { FileInfo += "info_av" ; }
}
else
{
+#ifndef _WIN32
std::string commande = "rm -f " + std::string(MeshFile);
+#else
+ std::string commande = "del /s /q " + std::string(MeshFile);
+#endif
codret = system(commande.c_str());
if (codret != 0)
{
}
#else
HANDLE hFind = INVALID_HANDLE_VALUE;
- WIN32_FIND_DATA ffd;
- hFind = FindFirstFile(DirNameStart, &ffd);
+ WIN32_FIND_DATAA ffd;
+ hFind = FindFirstFileA(DirCompute, &ffd);
if (INVALID_HANDLE_VALUE != hFind) {
- while (FindNextFile(hFind, &ffd) != 0) {
+ while (FindNextFileA(hFind, &ffd) != 0) {
std::string file_name(ffd.cFileName);
bilan = file_name.find("fr") ;
if ( bilan != string::npos )
{
std::stringstream filename_total ;
- filename_total << DirCompute << "/" << file_name ;
+ filename_total << DirCompute << "\\" << file_name ;
theInputNodeFiles.push_back(filename_total.str()) ;
icpt += 1 ;
}
// C. Le fichier des messages
std::string LogFile = DirCompute ;
+#ifndef _WIN32
LogFile += "/Liste." + siterp1 + ".maj_coords.log" ;
+#else
+ LogFile += "\\Liste." + siterp1 + ".maj_coords.log" ;
+#endif
MESSAGE (". LogFile = " << LogFile);
myIteration->SetFileInfo(LogFile.c_str());
throw SALOME::SALOME_Exception(es);
return 0;
};
- std::string nomDirActuel = getenv("PWD") ;
+#ifndef _WIN32
+ std::string nomDiriActuel = getenv("PWD") ;
+#else
+ std::string nomDirActuel = getenv("CD") ;
+#endif
std::string DirName ;
// On boucle sur tous les noms possibles jusqu'a trouver un nom correspondant a un répertoire inconnu
bool a_chercher = true ;
std::string file_name(dirp->d_name);
#else
HANDLE hFind = INVALID_HANDLE_VALUE;
- WIN32_FIND_DATA ffd;
- hFind = FindFirstFile(nomrep, &ffd);
- if (INVALID_HANDLE_VALUE != hFind) {
- while (FindNextFile(hFind, &ffd) != 0) {
- if (ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) continue; //skip directories
- std::string file_name(ffd.cFileName);
+ WIN32_FIND_DATAA ffd;
+ hFind = FindFirstFileA(nomrep, &ffd);
+ while (INVALID_HANDLE_VALUE != hFind && FindNextFileA(hFind, &ffd) != 0) {
+ if (ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) continue; //skip directories
+ std::string file_name(ffd.cFileName);
#endif
if ( file_name == DirNameA.str() ) { existe = true ; }
}
// B.3.2. Le nom complet du sous-répertoire
std::stringstream DirCompute ;
+#ifndef _WIN32
DirCompute << nomDirCase << "/" << nomDirIt;
+#else
+ DirCompute << nomDirCase << "\\" << nomDirIt;
+#endif
MESSAGE (". DirCompute = " << DirCompute.str() );
// B.3.3. Si le sous-répertoire n'existe pas, on le cree
closedir(dp);
#else
HANDLE hFind = INVALID_HANDLE_VALUE;
- WIN32_FIND_DATA ffd;
- hFind = FindFirstFile(DirCompute.str().c_str(), &ffd);
+ WIN32_FIND_DATAA ffd;
+ hFind = FindFirstFileA(DirCompute.str().c_str(), &ffd);
bool result = true;
if (INVALID_HANDLE_VALUE != hFind) {
- while (FindNextFile(hFind, &ffd) != 0) {
+ while (FindNextFileA(hFind, &ffd) != 0) {
if (ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) continue; //skip directories
std::string file_name(ffd.cFileName);
result = file_name.empty() || file_name == "." || file_name == ".."; //if any file - break and return false
HOMARD::HOMARD_Iteration_var myIterationParent = myStudyContext._mesIterations[nomIterationParent];
const char* nomDirItPa = myIterationParent->GetDirNameLoc();
std::stringstream DirComputePa ;
+#ifndef _WIN32
DirComputePa << nomDirCase << "/" << nomDirItPa;
+#else
+ DirComputePa << nomDirCase << "\\" << nomDirItPa;
+#endif
MESSAGE( ". nomDirItPa = " << nomDirItPa);
MESSAGE( ". DirComputePa = " << DirComputePa.str() );
SALOMEDS::SObject_var aResultSO,
const char* name, const char* comment, const char* icone, const char* ior)
{
- MESSAGE("PublishInStudyAttr pour name = "<<name<<", comment = "<<comment);
+ MESSAGE("PublishInStudyAttr");
+
+ MESSAGE("PublishInStudyAttr name?"<<(name==0 ? "0": "1"));
+ MESSAGE("PublishInStudyAttr comment?"<<(comment==0 ? "0":"1"));
+ MESSAGE("PublishInStudyAttr icone?"<<(icone==0 ? "0": "1"));
+ MESSAGE("PublishInStudyAttr ior?"<<(ior==0 ? "0": "1"));
+
+ //if (name)
+// MESSAGE("PublishInStudyAttr pour name = "<<name<<", comment = "<<comment);
// MESSAGE("icone = "<<icone);
// MESSAGE("ior = "<<ior);
SALOMEDS::GenericAttribute_var anAttr ;
HOMARD::HOMARD_Cas_ptr caseyacs = GetCase(nomCas) ;
std::string dirnamecase = caseyacs->GetDirName() ;
std::string XMLFile ;
+#ifndef _WIN32
XMLFile = dirnamecase + "/schema.xml" ;
+#else
+ XMLFile = dirnamecase + "\\schema.xml" ;
+#endif
myYACS->SetXMLFile( XMLFile.c_str() ) ;
return HOMARD::HOMARD_YACS::_duplicate(myYACS);