From: azakir Date: Mon, 21 Dec 2020 14:46:50 +0000 (+0100) Subject: correct timestep issues X-Git-Tag: V9_7_0a1~18^2~44 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=147d2c026ddc55eea8b101eb608f698e763a472a;p=modules%2Fsmesh.git correct timestep issues --- diff --git a/src/SMESHGUI/MG_ADAPT.cxx b/src/SMESHGUI/MG_ADAPT.cxx index 3a1f56832..b65696e97 100644 --- a/src/SMESHGUI/MG_ADAPT.cxx +++ b/src/SMESHGUI/MG_ADAPT.cxx @@ -1366,9 +1366,18 @@ void MgAdapt::getTimeStepInfos(std::string aFile, med_int& numdt, med_int& numit med_float dt; med_int tmp_numdt, tmp_numit; - med_int step = data->myUseLastTimeStep ? nbofcstp : data->myTimeStep+1; + //~med_int step = data->myUseLastTimeStep ? nbofcstp : data->myTimeStep+1; //~myPrint("step ", step); - erreur = MEDfieldComputingStepInfo ( medIdt, nomcha, step, &tmp_numdt, &tmp_numit, &dt ); + erreur = MEDfieldComputingStepInfo ( medIdt, nomcha, 1, &numdt, &numit, &dt ); + for(med_int step = 1; step <= nbofcstp; step++ ) + { + erreur = MEDfieldComputingStepInfo ( medIdt, nomcha, step, &tmp_numdt, &tmp_numit, &dt ); + if(tmp_numdt > numdt) + { + numdt = tmp_numdt; + numit = tmp_numit; + } + } if ( erreur < 0 ) { @@ -1377,8 +1386,6 @@ void MgAdapt::getTimeStepInfos(std::string aFile, med_int& numdt, med_int& numit return; } - numdt = tmp_numdt; - numit = tmp_numit; // Fermeture du fichier diff --git a/src/SMESHGUI/MG_ADAPTGUI.cxx b/src/SMESHGUI/MG_ADAPTGUI.cxx index 564271ac9..598e0cf3f 100644 --- a/src/SMESHGUI/MG_ADAPTGUI.cxx +++ b/src/SMESHGUI/MG_ADAPTGUI.cxx @@ -693,7 +693,7 @@ void SMESHGUI_MgAdaptArguments::onSelectMedFileBackgroundbutton() { fieldNameCmb->insertItem(0,QString(it->first)); int typeStepInField = it->second > 2 ? 2 : it->second ; - timeStepGroupChanged(typeStepInField, true, it->second-1); + timeStepGroupChanged(typeStepInField, true); } } @@ -794,7 +794,7 @@ void SMESHGUI_MgAdaptArguments::onLocalSelected(QString filePath) { fieldNameCmb->insertItem(0,QString(it->first)); int typeStepInField = it->second > 2 ? 2 : it->second ; - timeStepGroupChanged(typeStepInField, true, it->second-1); + timeStepGroupChanged(typeStepInField, true); } }