]> SALOME platform Git repositories - modules/homard.git/blobdiff - src/HOMARDGUI/MonCreateHypothesis.cxx
Salome HOME
Merge from V6_main 01/04/2013
[modules/homard.git] / src / HOMARDGUI / MonCreateHypothesis.cxx
index bffc7df57f0ef14e48c2870c816b83f9e04295cc..c3f6880eaa75789e83921607f3a7e52f984f6097 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2011-2012  CEA/DEN, EDF R&D
+// Copyright (C) 2011-2013  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
@@ -51,7 +51,9 @@ MonCreateHypothesis::MonCreateHypothesis(MonCreateIteration* parent, bool modal,
     _UsField(0), _UsCmpI(0), _TypeFieldInterp(0),
     _NivMax(-1),
     _DiamMin(-1.),
-    _AdapInit(0)
+    _AdapInit(0),
+    _LevelOutput(0)
+
 {
       MESSAGE("Constructeur") ;
       _myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen);
@@ -70,6 +72,7 @@ MonCreateHypothesis::MonCreateHypothesis(MonCreateIteration* parent, bool modal,
       }
       SetFieldNo();
       GBAdvancedOptions->setVisible(0);
+      CBLevelOutput->setChecked(false);
 }
 
 // ------------------------------------------------------------------------
@@ -91,10 +94,12 @@ void MonCreateHypothesis::InitConnect()
     connect( CBFieldName,  SIGNAL(activated(int)), this, SLOT( SetFieldName()));
     connect( RBRPE,        SIGNAL(clicked()), this, SLOT(SetRPE()));
     connect( RBRRel,       SIGNAL(clicked()), this, SLOT(SetRRel()));
+    connect( RBRMuSigma,   SIGNAL(clicked()), this, SLOT(SetRMS()));
     connect( RBRAbs,       SIGNAL(clicked()), this, SLOT(SetRAbs()));
     connect( RBRNo,        SIGNAL(clicked()), this, SLOT(SetRNo()));
     connect( RBCPE,        SIGNAL(clicked()), this, SLOT(SetCPE()));
     connect( RBCRel,       SIGNAL(clicked()), this, SLOT(SetCRel()));
+    connect( RBCMuSigma,   SIGNAL(clicked()), this, SLOT(SetCMS()));
     connect( RBCAbs,       SIGNAL(clicked()), this, SLOT(SetCAbs()));
     connect( RBCNo,        SIGNAL(clicked()), this, SLOT(SetCNo()));
     connect( RBL2,         SIGNAL(clicked()), this, SLOT(SetUCL2()));
@@ -176,9 +181,13 @@ bool MonCreateHypothesis::PushOnApply()
     _aHypothesis->SetDiamMin(_DiamMin);
 // Enregistrement de l'intialisation de l'adaptation
     _aHypothesis->SetAdapInit(_AdapInit);
+// Sortie des niveaux de raffinement
+    if (CBLevelOutput->isChecked()) { _LevelOutput = 1 ; }
+    _aHypothesis->SetLevelOutput(_LevelOutput);
   }
 
-  HOMARD_UTILS::updateObjBrowser();
+  HOMARD_UTILS::updateObjBrowser() ;
+
   return true;
 }
 
@@ -201,7 +210,7 @@ void MonCreateHypothesis::SetNewHypothesisName()
 // --------------------------------------------------
 {
 
-  HOMARD::listeHypotheses_var  MyHypos = _myHomardGen->GetAllHypotheses();
+  HOMARD::listeHypotheses_var  MyHypos = _myHomardGen->GetAllHypothesesName();
   int num = 0;//
   QString aHypothesisName="";
   while (aHypothesisName=="" )
@@ -310,7 +319,7 @@ void MonCreateHypothesis::PushZoneDelete()
 {
   MESSAGE("Debut de MonCreateHypothesis::PushZoneDelete")
   QMessageBox::warning( 0, QObject::tr("HOM_WARNING"),
-                        QObject::tr("HOM_INACTIVE_BUTTON") );
+                          QObject::tr("HOM_INACTIVE_BUTTON") );
   return;
 }
 
@@ -322,7 +331,7 @@ void MonCreateHypothesis::GetAllZones()
 // Par defaut, aucune n'est selectionnee
 {
   MESSAGE("Debut de GetAllZones") ;
-  HOMARD::listeZones_var mesZones = _myHomardGen->GetAllZones();
+  HOMARD::listeZones_var mesZones = _myHomardGen->GetAllZonesName();
   int nbrow=TWZone->rowCount();
   for ( int row=0; row< nbrow; row++)
   {
@@ -535,6 +544,7 @@ void MonCreateHypothesis::SetRPE()
   SpinBox_RPE->setEnabled(true);
   SpinBox_RRel->setEnabled(false);
   SpinBox_RAbs->setEnabled(false);
+  SpinBox_RMuSigma->setEnabled(false);
 }
 // ------------------------------------------------------------------------
 void MonCreateHypothesis::SetRRel()
@@ -546,6 +556,7 @@ void MonCreateHypothesis::SetRRel()
   SpinBox_RPE->setEnabled(false);
   SpinBox_RRel->setEnabled(true);
   SpinBox_RAbs->setEnabled(false);
+  SpinBox_RMuSigma->setEnabled(false);
 }
 // ------------------------------------------------------------------------
 void MonCreateHypothesis::SetRAbs()
@@ -557,6 +568,19 @@ void MonCreateHypothesis::SetRAbs()
   SpinBox_RPE->setEnabled(false);
   SpinBox_RRel->setEnabled(false);
   SpinBox_RAbs->setEnabled(true);
+  SpinBox_RMuSigma->setEnabled(false);
+}
+// ------------------------------------------------------------------------
+void MonCreateHypothesis::SetRMS()
+// ------------------------------------------------------------------------
+{
+  _aTypeRaff = 1 ;
+  _TypeThR = 4 ;
+  RBRMuSigma->setChecked(true);
+  SpinBox_RPE->setEnabled(false);
+  SpinBox_RRel->setEnabled(false);
+  SpinBox_RAbs->setEnabled(false);
+  SpinBox_RMuSigma->setEnabled(true);
 }
 // ------------------------------------------------------------------------
 void MonCreateHypothesis::SetRNo()
@@ -568,6 +592,7 @@ void MonCreateHypothesis::SetRNo()
   SpinBox_RPE->setEnabled(false);
   SpinBox_RRel->setEnabled(false);
   SpinBox_RAbs->setEnabled(false);
+  SpinBox_RMuSigma->setEnabled(false);
 }
 // ------------------------------------------------------------------------
 void MonCreateHypothesis::SetCPE()
@@ -579,6 +604,7 @@ void MonCreateHypothesis::SetCPE()
   SpinBox_CPE->setEnabled(true);
   SpinBox_CRel->setEnabled(false);
   SpinBox_CAbs->setEnabled(false);
+  SpinBox_CMuSigma->setEnabled(false);
 }
 // ------------------------------------------------------------------------
 void MonCreateHypothesis::SetCRel()
@@ -590,6 +616,7 @@ void MonCreateHypothesis::SetCRel()
   SpinBox_CPE->setEnabled(false);
   SpinBox_CRel->setEnabled(true);
   SpinBox_CAbs->setEnabled(false);
+  SpinBox_CMuSigma->setEnabled(false);
 }
 // ------------------------------------------------------------------------
 void MonCreateHypothesis::SetCAbs()
@@ -601,6 +628,19 @@ void MonCreateHypothesis::SetCAbs()
   SpinBox_CPE->setEnabled(false);
   SpinBox_CRel->setEnabled(false);
   SpinBox_CAbs->setEnabled(true);
+  SpinBox_CMuSigma->setEnabled(false);
+}
+// ------------------------------------------------------------------------
+void MonCreateHypothesis::SetCMS()
+// ------------------------------------------------------------------------
+{
+  _aTypeDera = 1 ;
+  _TypeThC = 4 ;
+  RBCMuSigma->setChecked(true);
+  SpinBox_CPE->setEnabled(false);
+  SpinBox_CRel->setEnabled(false);
+  SpinBox_CAbs->setEnabled(false);
+  SpinBox_CMuSigma->setEnabled(true);
 }
 // ------------------------------------------------------------------------
 void MonCreateHypothesis::SetCNo()
@@ -612,6 +652,7 @@ void MonCreateHypothesis::SetCNo()
   SpinBox_CPE->setEnabled(false);
   SpinBox_CRel->setEnabled(false);
   SpinBox_CAbs->setEnabled(false);
+  SpinBox_CMuSigma->setEnabled(false);
 }
 // ------------------------------------------------------------------------
 void MonCreateHypothesis::SetUCL2()
@@ -694,7 +735,7 @@ void MonCreateHypothesis::AssocieLesZones()
   for ( int i=0 ; i< _aListeZone.count() ; i++ )
   { if ( _aListeZone[i+1] == Raff ) { TypeUse =  1 ; }
     else                            { TypeUse = -1 ; }
-   _myHomardGen->AssociateHypoZone(_aHypothesisName.toStdString().c_str(), _aListeZone[i].toStdString().c_str(), TypeUse);
+    _aHypothesis->AddZone(_aListeZone[i].toStdString().c_str(), TypeUse);
     i += 1 ;
   }
   MESSAGE( "Fin de AssocieLesZones" );
@@ -711,11 +752,13 @@ void MonCreateHypothesis::AssocieComposants()
   if ( _TypeThR == 1 ) { _ThreshR = SpinBox_RAbs->value();}
   if ( _TypeThR == 2 ) { _ThreshR = SpinBox_RRel->value();}
   if ( _TypeThR == 3 ) { _ThreshR = SpinBox_RPE->value(); }
+  if ( _TypeThR == 4 ) { _ThreshR = SpinBox_RMuSigma->value(); }
 
   _ThreshC = 0;
   if ( _TypeThC == 1 ) { _ThreshC = SpinBox_CAbs->value();}
   if ( _TypeThC == 2 ) { _ThreshC = SpinBox_CRel->value();}
   if ( _TypeThC == 3 ) { _ThreshC = SpinBox_CPE->value(); }
+  if ( _TypeThC == 4 ) { _ThreshC = SpinBox_CMuSigma->value(); }
 
   _aFieldName=CBFieldName->currentText();
   _aHypothesis->SetField(CORBA::string_dup(_aFieldName.toStdString().c_str()) ) ;
@@ -839,6 +882,8 @@ void MonCreateHypothesis::SetAdvanced()
     _NivMax = -1 ;
     _DiamMin = -1. ;
     _AdapInit = 0 ;
+    CBLevelOutput->setChecked(false);
+    _LevelOutput = 0 ;
   }
   adjustSize();
 }