From 5e46af59684e7cdf480e523e46c5e1b5dfc9ee12 Mon Sep 17 00:00:00 2001 From: GERALD NICOLAS Date: Fri, 29 Jan 2021 16:39:42 +0100 Subject: [PATCH] =?utf8?q?Mise=20=C3=A0=20jour=20des=20messages=20et=20d?= =?utf8?q?=C3=A9faut?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/SMESH/MG_ADAPT.cxx | 60 +++---- src/SMESHGUI/MG_ADAPTGUI.cxx | 66 ++++---- src/SMESHGUI/MG_ADAPTGUI.hxx | 9 +- src/SMESHGUI/SMESH_msg_en.ts | 34 +--- src/SMESHGUI/SMESH_msg_fr.ts | 308 ++++++++++++++++++----------------- 5 files changed, 230 insertions(+), 247 deletions(-) diff --git a/src/SMESH/MG_ADAPT.cxx b/src/SMESH/MG_ADAPT.cxx index 2445d8cdb..b59fde866 100644 --- a/src/SMESH/MG_ADAPT.cxx +++ b/src/SMESH/MG_ADAPT.cxx @@ -45,14 +45,14 @@ static std::string removeFile(std::string fileName, int& notOk) notOk = std::remove(fileName.c_str()); if (notOk) errStr = ToComment(" \n error while removing file : ") << fileName; - else errStr= ToComment("\n file : ")<< fileName << " succesfully deleted! \n "; - - return errStr; + else errStr= ToComment("\n file : ")<< fileName << " succesfully deleted! \n "; + + return errStr; } std::string remove_extension(const std::string& filename) { size_t lastdot = filename.find_last_of("."); if (lastdot == std::string::npos) return filename; - return filename.substr(0, lastdot); + return filename.substr(0, lastdot); } namespace { @@ -176,7 +176,7 @@ void MgAdapt::buildModel() _defaultOptionValues["adaptation" ] = "both"; _defaultOptionValues["components" ] = "outside components"; - _defaultOptionValues["compute_ridges" ] = "yes"; + _defaultOptionValues["compute_ridges" ] = "yes"; _defaultOptionValues["max_memory" ] = ToComment(defaultMaximumMemory()); } @@ -295,11 +295,11 @@ void MgAdapt::setTimeStepRankLast() myUseNoTimeStep = false; //~med_int aRank, tmst; //~std::string fieldFile = useBackgroundMap ? sizeMapFile : medFileIn; - //~getTimeStepInfos(fieldFile, tmst, aRank); + //~getTimeStepInfos(fieldFile, tmst, aRank); //~setRankTimeStep((int) tmst, (int) aRank); } void MgAdapt::setNoTimeStep() -{ +{ myUseLastTimeStep = false; myUseChosenTimeStep = false; myUseNoTimeStep = true; @@ -308,7 +308,7 @@ void MgAdapt::setNoTimeStep() //~setRankTimeStep(tmst, aRank); } void MgAdapt::setChosenTimeStepRank() -{ +{ myUseLastTimeStep = false; myUseChosenTimeStep = true; myUseNoTimeStep = false; @@ -481,7 +481,7 @@ bool MgAdapt::setAll() else if (data->myUseLastTimeStep) setTimeStepRankLast(); else - { + { setChosenTimeStepRank(); setRankTimeStep(data->myTimeStep, data->myRank); } @@ -521,7 +521,7 @@ throw (std::invalid_argument) if (op_val->second != optionValue) { - + std::string lowerOptionValue = toLowerStr(optionValue); const char* ptr = lowerOptionValue.c_str(); // strip white spaces @@ -536,7 +536,7 @@ throw (std::invalid_argument) if (i == 0) { // empty string } else if (_charOptions.count(optionName)) { - // do not check strings + // do not check strings } else if (_doubleOptions.count(optionName)) { // check if value is double toDbl(ptr, &typeOk); @@ -621,7 +621,7 @@ throw (std::invalid_argument) } //================================================================================ /*! - * \brief Converts a string to a lower + * \brief Converts a string to a lower */ //================================================================================ std::string MgAdapt::toLowerStr(const std::string& str) @@ -743,10 +743,10 @@ void MgAdapt::execCmd( const char* cmd, int& err) } else { - buf = std::cout.rdbuf(); + buf = std::cout.rdbuf(); } std::ostream logStream(buf); - + std::unique_ptr pipe(popen(cmd, "r"), pclose ); if(!pipe) { @@ -759,9 +759,9 @@ void MgAdapt::execCmd( const char* cmd, int& err) err = 0; } /* - * to delete tmp files .mesh, .sol and if needed + * to delete tmp files .mesh, .sol and if needed * the log file - * + * */ void MgAdapt::cleanUp() { @@ -769,9 +769,9 @@ void MgAdapt::cleanUp() std::string errStr; if(toKeepWorkingFiles) return; - if(removeOnSuccess && printLogInFile) + if(removeOnSuccess && printLogInFile) tmpFilesToBeDeleted.push_back(logFile); - + std::vector< std::string>::iterator it = tmpFilesToBeDeleted.begin(); for (; it!=tmpFilesToBeDeleted.end(); ++it) { @@ -780,16 +780,16 @@ void MgAdapt::cleanUp() { appendMsgToLogFile(errStr); } - + } } void MgAdapt::appendMsgToLogFile(std::string& msg) { - std::ofstream logStream; + std::ofstream logStream; logStream.open(logFile, std::ofstream::out | std::ofstream::app); logStream<< msg; - logStream.close(); + logStream.close(); } //================================================================================ /*! @@ -849,13 +849,13 @@ std::string MgAdapt::getCommandToRun() cmd+= " --write_sizemap "+ solFileOut; solFormatOutput.push_back(solFileOut); tmpFilesToBeDeleted.push_back(solFileOut); - } + } if (verbosityLevel != defaultVerboseLevel()) { cmd+= " --verbose "+ ToComment(verbosityLevel); } - + std::string option, value; bool isDefault; const TOptionValues* options[] = { &_option2value, &_customOption2value }; @@ -1261,7 +1261,7 @@ void MgAdapt::restorefams(MEDCoupling::MEDFileMesh* fileMesh) const std::vector::const_iterator fIt = famVec.begin(); for (; fIt!=famVec.end(); ++fIt) - { + { try // { std::string givenFamNameFromMeshGemConverter = fileMesh->getFamilyNameGivenId( std::abs(fIt->_famId) ); @@ -1271,7 +1271,7 @@ void MgAdapt::restorefams(MEDCoupling::MEDFileMesh* fileMesh) const catch (const std::exception& e) { std::cerr<& fie tmpWriter.setMeshFileName(meshFormatsizeMapFile); tmpWriter.setFieldFileNames( fieldFileNames); tmpWriter.setMEDFileDS(tmpMfd); - tmpWriter.write(); + tmpWriter.write(); } // ======================================================================= med_idt MgAdapt::openMedFile(const std::string aFile) @@ -1413,8 +1413,8 @@ void MgAdapt::getTimeStepInfos(std::string aFile, med_int& numdt, med_int& numit if(tmp_numdt > numdt) { numdt = tmp_numdt; - numit = tmp_numit; - } + numit = tmp_numit; + } } if ( erreur < 0 ) { @@ -1434,7 +1434,7 @@ void MgAdapt::getTimeStepInfos(std::string aFile, med_int& numdt, med_int& numit void MgAdapt::updateTimeStepRank() { - + med_int arank; med_int tmst; if (myUseNoTimeStep) diff --git a/src/SMESHGUI/MG_ADAPTGUI.cxx b/src/SMESHGUI/MG_ADAPTGUI.cxx index dcca5a7a6..1e4b4a5df 100644 --- a/src/SMESHGUI/MG_ADAPTGUI.cxx +++ b/src/SMESHGUI/MG_ADAPTGUI.cxx @@ -124,12 +124,12 @@ void SMESHGUI_MgAdaptDlg::buildDlg() SMESH::str_array* str = model->getOptionValuesStrVec(); SMESH::str_array* str2 = model->getCustomOptionValuesStrVec(); std::vector s; - for (int i = 0; i< str->length(); i++) s.push_back( (*str)[i].in()); - for (int j = str->length(); j< str2->length(); j++) s.push_back((*str2)[ j - str->length() ].in() ); + for (int i = 0; i< str->length(); i++) s.push_back( (*str)[i].in()); + for (int j = str->length(); j< str2->length(); j++) s.push_back((*str2)[ j - str->length() ].in() ); //~str.insert( str.end(), str2.begin(), str2.end() ); myAdvOpt = new MgAdaptAdvWidget(myTabWidget, &s); - + int argsTab = myTabWidget->addTab( myArgs, tr( "Args" ) ); int advTab = myTabWidget->addTab( myAdvOpt, tr( "ADVOP" ) ); @@ -597,6 +597,7 @@ SMESHGUI_MgAdaptArguments::SMESHGUI_MgAdaptArguments( QWidget* parent ) // Initial state setMode( Mesh, Local); medFileCheckBox->setChecked(true); + visibleTimeStepRankLabel (false); // Connections connect( meshInGroup, SIGNAL( buttonClicked( int ) ), this, SLOT( modeChanged( int ) ) ); @@ -622,46 +623,39 @@ void SMESHGUI_MgAdaptArguments::onNoTimeStep(bool disableOther) { noTimeStep->setChecked(true); - rankLabel->setVisible(0); - rankSpinBox->setVisible(0); + visibleTimeStepRankLabel (false); rankSpinBox->setValue(-2); - - timeStepLabel->setVisible(0); - timeStep->setVisible(0); timeStep->setValue(-2); lastTimeStep->setDisabled(disableOther); chosenTimeStep->setDisabled(disableOther); - - } void SMESHGUI_MgAdaptArguments::onLastTimeStep(bool disableOther) { lastTimeStep->setChecked(true); - rankLabel->setVisible(0); - rankSpinBox->setVisible(0); + visibleTimeStepRankLabel (false); rankSpinBox->setValue(-1); - - timeStepLabel->setVisible(0); - timeStep->setVisible(0); timeStep->setValue(-1); noTimeStep->setDisabled(disableOther); } - void SMESHGUI_MgAdaptArguments::onChosenTimeStep(bool disableOther, int max) { chosenTimeStep->setChecked(true); - rankLabel->setVisible(1); - rankSpinBox->setVisible(1); + visibleTimeStepRankLabel (true); rankSpinBox->setValue(0); - - timeStepLabel->setVisible(1); - timeStep->setVisible(1); timeStep->setValue(0); if (max) timeStep->setMaximum(max); +} +void SMESHGUI_MgAdaptArguments::visibleTimeStepRankLabel(bool visible) +{ + rankLabel->setVisible(visible); + rankSpinBox->setVisible(visible); + + timeStepLabel->setVisible(visible); + timeStep->setVisible(visible); } void SMESHGUI_MgAdaptArguments::onSelectOutMedFilebutton() @@ -994,12 +988,12 @@ void MgAdaptAdvWidget::AddOption( const char* option, bool isCustom ) if(it != optionTreeWidgetItem.end()) return; // option exist else { - row = getNewQTreeWidgetItem(table, option, name, isCustom); - } + row = getNewQTreeWidgetItem(table, option, name, isCustom); + } } - else + else { - row = getNewQTreeWidgetItem(table, option, name, isCustom); + row = getNewQTreeWidgetItem(table, option, name, isCustom); } row->setText( 0, tr( name.toLatin1().constData() )); row->setText( 1, tr( value.toLatin1().constData() )); @@ -1019,8 +1013,8 @@ QTreeWidgetItem* MgAdaptAdvWidget::getNewQTreeWidgetItem(QTreeWidget* table, con QTreeWidgetItem* row = new QTreeWidgetItem( table ); row->setData( NAME_COL, EDITABLE_ROLE, int( isCustom && !option )); row->setFlags( row->flags() | Qt::ItemIsEditable ); - optionTreeWidgetItem.insert(std::pair (name, row)); - + optionTreeWidgetItem.insert(std::pair (name, row)); + return row; } @@ -1167,34 +1161,34 @@ void MgAdaptAdvWidget::onMeshDimChanged(ADAPTATION_MODE aMode) /* default adaptation mode * assume that if meshDim == 2 -->adaptation surface * if meshDim == 3 and if there is not 2D mesh -->VOLUME - * else BOTH + * else BOTH */ - + QString adaptation("adaptation"), value; switch(aMode) { case ADAPTATION_MODE::SURFACE: - { - value ="surface"; + { + value ="surface"; setOptionValue(adaptation, value); break; } case ADAPTATION_MODE::BOTH : { - value = "both"; + value = "both"; setOptionValue(adaptation, value); break; } case ADAPTATION_MODE::VOLUME : { - value = "volume"; + value = "volume"; setOptionValue(adaptation, value); break; } - } + } } void MgAdaptAdvWidget::setOptionValue(QString& option, QString& value) -{ +{ std::map::iterator it = optionTreeWidgetItem.find(option); if (it != optionTreeWidgetItem.end()) @@ -1450,7 +1444,7 @@ std::map GetListeChamps(QString aFile, bool errorMessage) std::string remove_extension(const std::string& filename) { size_t lastdot = filename.find_last_of("."); if (lastdot == std::string::npos) return filename; - return filename.substr(0, lastdot); + return filename.substr(0, lastdot); } diff --git a/src/SMESHGUI/MG_ADAPTGUI.hxx b/src/SMESHGUI/MG_ADAPTGUI.hxx index 7b50a32a5..2319d735c 100644 --- a/src/SMESHGUI/MG_ADAPTGUI.hxx +++ b/src/SMESHGUI/MG_ADAPTGUI.hxx @@ -102,10 +102,10 @@ med_idt OuvrirFichier(QString aFile); std::string remove_extension(const std::string& filename); -enum ADAPTATION_MODE{ +enum ADAPTATION_MODE{ SURFACE, // surface adaption when meshDim == 2 - VOLUME, // - BOTH + VOLUME, // + BOTH }; //================================================================================= // class : SMESHGUI_MgAdaptDlg @@ -238,6 +238,7 @@ private slots: void onNoTimeStep(bool disableOther = false); void onLastTimeStep(bool disableOther = false); void onChosenTimeStep(bool disableOther = false, int max = 0); + void visibleTimeStepRankLabel(bool visible); private: @@ -297,7 +298,7 @@ private slots: private: void setOptionValue(QString& option, QString& value); std::map optionTreeWidgetItem; - + QTreeWidgetItem* getNewQTreeWidgetItem(QTreeWidget* table, const char* option, QString& name, bool isCustom); }; diff --git a/src/SMESHGUI/SMESH_msg_en.ts b/src/SMESHGUI/SMESH_msg_en.ts index fde42d2f4..90a784488 100644 --- a/src/SMESHGUI/SMESH_msg_en.ts +++ b/src/SMESHGUI/SMESH_msg_en.ts @@ -396,7 +396,7 @@ Publish_MG_ADAPT Publish - + SIZE_MAP_FIELD Size map field @@ -3137,37 +3137,13 @@ Check algorithm documentation for supported geometry ADAPT_PREF_MG_ADAPT_SIZE_MAP_BACKGROUND Background - - ADAPT_PREF_MG_ADAPT_MED_SIZE_MAP_BACKGROUND - MED file background size map - - - ADAPT_PREF_MG_ADAPT_TIME_STEP - Time step - - - ADAPT_PREF_MG_ADAPT_NO_TIME_STEP - No time step - ADAPT_PREF_MG_ADAPT_TIME_STEP_LAST Last - ADAPT_PREF_MG_ADAPT_AR - Arguments - - - ADAPT_PREF_MG_ADAPT_ADVOP - Advanced Options - - - ADAPT_PREF_MG_ADAPT_TIME_LAST_STEP - Last time step - - - ADAPT_PREF_MG_ADAPT_TIME_C_STEP - Chosen time step + ADAPT_PREF_MG_ADAPT_TIME_STEP + Choosen time step ADAPT_PREF_MG_ADAPT_TIME_STEP_C @@ -3177,6 +3153,10 @@ Check algorithm documentation for supported geometry MG_ADAPT_SELECT_FILE_0 MG-ADAPT select file + + ADAPT_PREF_MG_ADAPT_ADVOP + Advanced Options + SMESH_VISU_PROBLEM Mesh visualization failed diff --git a/src/SMESHGUI/SMESH_msg_fr.ts b/src/SMESHGUI/SMESH_msg_fr.ts index 4177ac636..a23d20e5a 100644 --- a/src/SMESHGUI/SMESH_msg_fr.ts +++ b/src/SMESHGUI/SMESH_msg_fr.ts @@ -340,6 +340,150 @@ MEN_CONSTRUCT_GROUP Construire un groupe + + MEN_REF_ALL + Raffinement uniforme + + + MEN_REF_HOMARD + Raffinement avec HOMARD + + + MEN_HOMARD_CREATE_CASE + Création d'un cas d'adaptation + + + MEN_HOMARD_FOLLOW_ITERATION + Poursuite d'une itération d'adaptation + + + MEN_HOMARD_NEW_ITERATION + Création d'une itération d'adaptation + + + MEN_HOMARD_COMPUTE + Calculer + + + MEN_HOMARD_COMPUTE_PUBLISH + Calculer et publier + + + MEN_MG_ADAPT + Remaillage avec MG_Adapt + + + Args + Arguments + + + MeshOut + Maillage en sortie + + + MeshIn + Maillage en entrée + + + MEDFile + Fichier MED + + + Browser + Arbre d'études + + + Publish_MG_ADAPT + Publication + + + SIZE_MAP_FIELD + Champ de la carte de taille + + + MG_ADAPT_FIELD_NAME + Nom du champ + + + MG_ADAPT_MED_FILE_1 + Ce fichier MED est illisible. + + + MG_ADAPT_MED_FILE_2 + Ce fichier MED ne contient aucun maillage. + + + MG_ADAPT_MED_FILE_3 + Ce fichier MED contient plus d'un maillage. + + + MG_ADAPT_MED_FILE_4 + Impossible de lire le maillage de ce fichier MED. + + + MG_ADAPT_MED_FILE_5 + Ce fichier MED ne contient aucun champ. + + + MG_ADAPT_MED_FILE_6 + Impossible de lire le(s) champ(s) de ce fichier MED. + + + MG_ADAPT_ERROR + Erreur + + + MG_ADAPT_CH_ST + Pas de temps choisi + + + MG_ADAPT_RANK + Numéro d'ordre + + + MG_ADAPT_TSTP + Pas de temps + + + MG_ADAPT_NO_T_ST + Sans pas de temps + + + MG_ADAPT_L_ST + Dernier pas de temps + + + MeshName + Nom du maillage + + + LOCAL_MG_ADAPT + Locale + + + BACKGRND_MG_ADAPT + Arrière-plan + + + CNST_MG_ADAPT + Constante + + + MED_FILE_BCKG + Fichier MED de la carte en arrière-plan + + + VALUE_MG_ADAPT + Valeur + + + SIZE_MAP_DEF + Définition de la carte de taille + + + ADVOP + Options avancées + MEN_CONV_TO_QUAD Convertir vers/depuis quadratique @@ -792,114 +936,6 @@ MEN_ADAPT Adaptation - - Args - Arguments - - - MeshOut - Maillage en sortie - - - MEDFile - Fichier MED - - - Browser - Arbre d'études - - - BACKGRND_MG_ADAPT - Arrière-plan - - - CNST_MG_ADAPT - Constante - - - SIZE_MAP_FIELD - Champ de la carte de taille - - - MG_ADAPT_FIELD_NAME - Nom du champ - - - MG_ADAPT_MED_FILE_1 - Ce fichier MED est illisible. - - - MG_ADAPT_MED_FILE_2 - Ce fichier MED ne contient aucun maillage. - - - MG_ADAPT_MED_FILE_3 - Ce fichier MED contient plus d'un maillage. - - - MG_ADAPT_MED_FILE_4 - Impossible de lire le maillage de ce fichier MED. - - - MG_ADAPT_MED_FILE_5 - Ce fichier MED ne contient aucun champ. - - - MG_ADAPT_MED_FILE_6 - Impossible de lire le(s) champ(s) de ce fichier MED. - - - MG_ADAPT_NO_T_ST - Sans pas de temps - - - MG_ADAPT_CH_ST - Pas de temps choisi - - - MG_ADAPT_RANK - Numéro d'ordre - - - MG_ADAPT_TSTP - Pas de temps - - - MG_ADAPT_L_ST - Dernier pas de temps - - - MED_FILE_BCKG - fichier MED de la carte en arrière-plan - - - VALUE_MG_ADAPT - Valeur - - - Publish_MG_ADAPT - Publication - - - LOCAL_MG_ADAPT - locale - - - MeshName - Nom du maillage - - - MeshIn - Maillage en entrée - - - SIZE_MAP_DEF - Définition de la carte de taille - - - ADVOP - Advanced Options - MEN_MEASURE Outils de mesure @@ -1240,38 +1276,6 @@ MEN_TRANSF Transformation - - MEN_REF_ALL - Raffinement uniforme - - - MEN_REF_HOMARD - Raffinement avec HOMARD - - - MEN_HOMARD_CREATE_CASE - Création d'un cas d'adaptation - - - MEN_HOMARD_FOLLOW_ITERATION - Poursuite d'une itération d'adaptation - - - MEN_HOMARD_NEW_ITERATION - Création d'une itération d'adaptation - - - MEN_HOMARD_COMPUTE - Calculer - - - MEN_HOMARD_COMPUTE_PUBLISH - Calculer et publier - - - MEN_MG_ADAPT - Remaillage avec MG_Adapt - MEN_TRANSP Transparence @@ -3105,15 +3109,15 @@ Référez-vous à la documentation sur l'algorithme et la géométrie supportée max_memory - Maximum memoire (Mb) + Maximum mémoire (Mb) - components - Composants + Adaption + Adaptation - - Adapation - adaptation + + components + Composantes ADAPT_PREF_MG_ADAPT_SIZE_MAP @@ -3127,14 +3131,14 @@ Référez-vous à la documentation sur l'algorithme et la géométrie supportée ADAPT_PREF_MG_ADAPT_SIZE_MAP_BACKGROUND Arrière-plan - - ADAPT_PREF_MG_ADAPT_TIME_STEP - Choix du pas de temps - ADAPT_PREF_MG_ADAPT_TIME_STEP_LAST Dernier + + ADAPT_PREF_MG_ADAPT_TIME_STEP + Choix du pas de temps + ADAPT_PREF_MG_ADAPT_TIME_STEP_C Valeur @@ -3143,6 +3147,10 @@ Référez-vous à la documentation sur l'algorithme et la géométrie supportée MG_ADAPT_SELECT_FILE_0 MG-ADAPT selection fichier MED + + ADAPT_PREF_MG_ADAPT_ADVOP + Options avancées + SMESH_VISU_PROBLEM Impossible de visualiser le maillage, probablement à cause d'un manque de mémoire -- 2.30.2