]> SALOME platform Git repositories - modules/homard.git/blobdiff - src/HOMARDGUI/MonEditIteration.cxx
Salome HOME
Copyright update 2022
[modules/homard.git] / src / HOMARDGUI / MonEditIteration.cxx
index 0261e80989f1b2912176c990b0aafae94f92b1bd..5202b3596437a1c42dda38a2de5cc729108355fb 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2011-2013  CEA/DEN, EDF R&D
+// Copyright (C) 2011-2022  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -17,8 +17,6 @@
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
-using namespace std;
-
 #include "MonEditIteration.h"
 
 #include "SalomeApp_Tools.h"
@@ -26,6 +24,7 @@ using namespace std;
 #include "HomardQtCommun.h"
 #include <utilities.h>
 
+using namespace std;
 
 // -------------------------------------------------------------------------------------------------------------------------------------
 MonEditIteration::MonEditIteration ( QWidget* parent, bool modal,
@@ -41,7 +40,7 @@ MonEditIteration::MonEditIteration ( QWidget* parent, bool modal,
     MESSAGE("Debut de  MonEditIteration" << IterName.toStdString().c_str());
     setWindowTitle(QObject::tr("HOM_ITER_EDIT_WINDOW_TITLE"));
     _IterationName = IterName;
-    aIter = _myHomardGen->GetIteration(_IterationName.toStdString().c_str());
+    aIter = myHomardGen->GetIteration(_IterationName.toStdString().c_str());
 
 //  Attention au cas ou c'est une iteration initiale : il faut inhiber l'essentiel
     int etat = aIter->GetState() ;
@@ -60,8 +59,8 @@ void MonEditIteration::InitValEdit0(int etat)
 //    Cas d'une iteration initiale d'un cas (initial ou poursuite)
 {
 //
-      LEIterationName->setText(_IterationName);
-      LEIterationName->setReadOnly(true);
+      LEName->setText(_IterationName);
+      LEName->setReadOnly(true);
 
 //    Invisibilite de l'iteration parent
       Iter_Parent->setVisible(0);
@@ -82,7 +81,6 @@ void MonEditIteration::InitValEdit0(int etat)
 //    Invisibilite des hypotheses et des champs
       Hypothese->setVisible(0);
       GBField->setVisible(0);
-      adjustSize();
 //
 }
 // ------------------------------
@@ -91,36 +89,36 @@ void MonEditIteration::InitValEdit()
 //    Cas d'une iteration courante
 {
 //    Affichage bloque du nom de l'iteration
-  LEIterationName->setText(_IterationName);
-  LEIterationName->setReadOnly(true);
+  LEName->setText(_IterationName);
+  LEName->setReadOnly(true);
 
-//    Affichage bloque du nom de l'iteration parent
+  //    Affichage bloque du nom de l'iteration parent
   _IterParentName = aIter->GetIterParentName();
   LEIterationParentName->setText(_IterParentName);
   LEIterationParentName->setReadOnly(true);
   PBIterParent->setEnabled(false);
   PBIterParent->setVisible(0);
 
-//    Affichage bloque du nom du maillage de l'iteration parent
-  aIterParent = _myHomardGen->GetIteration(_IterParentName.toStdString().c_str());
+  //    Affichage bloque du nom du maillage de l'iteration parent
+  aIterParent = myHomardGen->GetIteration(_IterParentName.toStdString().c_str());
   QString MeshNameParent = aIterParent->GetMeshName();
   LEMeshName_n->setText(MeshNameParent);
   LEMeshName_n->setReadOnly(1);
 
-//    Affichage bloque du nom du maillage de l'iteration courante
+  //    Affichage bloque du nom du maillage de l'iteration courante
   QString MeshName = aIter->GetMeshName();
   LEMeshName_np1->setText(MeshName);
   LEMeshName_np1->setReadOnly(1);
 
-//    Affichage de la bonne hypothese
+  //    Affichage de la bonne hypothese
   QString HypoName = aIter->GetHypoName();
   CBHypothese->insertItem(0,HypoName);
   CBHypothese->setCurrentIndex(0);
   CBHypothese->setEnabled(false);
   PBHypoNew->setVisible(0);
 
-//    Pour une adaptation selon un champ
-  HOMARD::HOMARD_Hypothesis_var myHypo = _myHomardGen->GetHypothesis(HypoName.toStdString().c_str()) ;
+  //    Pour une adaptation selon un champ
+  HOMARD::HOMARD_Hypothesis_var myHypo = myHomardGen->GetHypothesis(HypoName.toStdString().c_str()) ;
   _aTypeAdap = myHypo->GetAdapType() ;
   if ( _aTypeAdap == 1 )
   {
@@ -131,7 +129,7 @@ void MonEditIteration::InitValEdit()
     _rank = aIter->GetRank() ;
     SpinBox_Rank->setValue(_rank);
 
-// Cas ou on prend le dernier pas de temps ou sans pas de temps
+  // Cas ou on prend le dernier pas de temps ou sans pas de temps
     if ( _step <= -1 )
     {
       Rank->setVisible(0);
@@ -143,7 +141,7 @@ void MonEditIteration::InitValEdit()
       else               { RBNo->setChecked(true); }
     }
 
-// Cas avec pas de temps
+  // Cas avec pas de temps
     else
     {
       Rank->setVisible(1);
@@ -157,6 +155,7 @@ void MonEditIteration::InitValEdit()
   {
     GBField->setVisible(0);
   }
+//
   adjustSize();
 //
 }
@@ -168,8 +167,8 @@ bool MonEditIteration::PushOnApply()
   if ( _aTypeAdap ==  1)
   {
 // Pour du raffinement selon un champ, les instants ont-ils change ?
-    if ( (_FieldFile != LEFieldFile->text().trimmed()) or
-       (  _rank != SpinBox_Rank->value())  or
+    if ( (_FieldFile != LEFieldFile->text().trimmed()) ||
+       (  _rank != SpinBox_Rank->value())  ||
        (  _step != SpinBox_TimeStep->value()))
     {
       _FieldFile = LEFieldFile->text().trimmed();
@@ -178,7 +177,7 @@ bool MonEditIteration::PushOnApply()
       _step = SpinBox_TimeStep->value();
       if ( _step == -2 ) { aIter->SetTimeStepRankLast(); }
       else               { aIter->SetTimeStepRank(_step, _rank); }
-      _myHomardGen->InvalideIter(_IterationName.toStdString().c_str());
+      myHomardGen->InvalideIter(_IterationName.toStdString().c_str());
       HOMARD_UTILS::updateObjBrowser();
     }
   }