X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHOMARDGUI%2FMonEditYACS.cxx;h=a346596006b8c8bf209011225caa76143fd691aa;hb=refs%2Ftags%2FV9_13_0b1;hp=99ff258b6601c356ad67a01df9b41c0bb83916db;hpb=97e4e858387f05b6260ff7ed68c9b73f99aecb22;p=modules%2Fhomard.git diff --git a/src/HOMARDGUI/MonEditYACS.cxx b/src/HOMARDGUI/MonEditYACS.cxx index 99ff258b..a3465960 100644 --- a/src/HOMARDGUI/MonEditYACS.cxx +++ b/src/HOMARDGUI/MonEditYACS.cxx @@ -1,9 +1,9 @@ -// Copyright (C) 2011-2013 CEA/DEN, EDF R&D +// Copyright (C) 2011-2024 CEA, EDF // // 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 "MonEditYACS.h" #include "SalomeApp_Tools.h" @@ -26,6 +24,7 @@ using namespace std; #include "HomardQtCommun.h" #include +using namespace std; // ------------------------------------------------------------- /* Constructs a MonEditYACS @@ -56,55 +55,94 @@ void MonEditYACS::InitValEdit() LEName->setText(_Name); LEName->setReadOnly(true); - QString _aCaseName = aYACS->GetCaseName(); + _aCaseName = aYACS->GetCaseName(); LECaseName->setText(_aCaseName); LECaseName->setReadOnly(true); PBCaseName->setVisible(0); - QString aScriptFile = aYACS->GetScriptFile(); - LEScriptFile->setText(aScriptFile); + _aScriptFile = aYACS->GetScriptFile(); + LEScriptFile->setText(_aScriptFile); + + _aDirName = aYACS->GetDirName(); + LEDirName->setText(_aDirName); + LEDirName->setReadOnly(true); - QString aDirName = aYACS->GetDirName(); - LEDirName->setText(aDirName); + _aMeshFile = aYACS->GetMeshFile(); + LEMeshFile->setText(_aMeshFile); - QString aMeshFile = aYACS->GetMeshFile(); - LEMeshFile->setText(aMeshFile); + _Type=aYACS->GetType(); + if(_Type==1) { RBConstant->setChecked(true); } + else { RBVariable->setChecked(true); }; + RBConstant->setEnabled(false); + RBVariable->setEnabled(false); - int Type=aYACS->GetType(); - if(Type==1) { RBStatic->setChecked(true); } - else { RBTransient->setChecked(true); }; - RBStatic->setEnabled(false); - RBTransient->setEnabled(false); + _MaxIter = aYACS->GetMaxIter(); + SpinBoxMaxIter->setValue(_MaxIter) ; + _MaxNode = aYACS->GetMaxNode(); + SpinBoxMaxNode->setValue(_MaxNode) ; + _MaxElem = aYACS->GetMaxElem(); + SpinBoxMaxElem->setValue(_MaxElem) ; // - adjustSize(); } // --------------------------------------------------- bool MonEditYACS:: CreateOrUpdate() //---------------------------------------------------- -// Modification du schema +// Edition/modification du schema { MESSAGE("CreateOrUpdate"); - - // Les donnees + bool chgt = false ; + int valeur_i ; + // A. Recuperation et comparaison des valeurs + // A.1. Le script de lancement QString aScriptFile=LEScriptFile->text().trimmed(); if ( aScriptFile != _aScriptFile ) { +// MESSAGE("modification de ScriptFile : "<<_aScriptFile.toStdString()<<" devient "<SetScriptFile(CORBA::string_dup(_aScriptFile.toStdString().c_str())) ; + chgt = true ; } - QString aDirName=LEDirName->text().trimmed(); - if ( aDirName != _aDirName ) - { - _aDirName = aDirName ; - aYACS->SetDirName(CORBA::string_dup(_aDirName.toStdString().c_str())) ; - } + // A.2. Le maillage initial QString aMeshFile=LEMeshFile->text().trimmed(); if ( aMeshFile != _aMeshFile ) { +// MESSAGE("modification de aMeshFile : "<<_aMeshFile.toStdString()<<" devient "<SetMeshFile(CORBA::string_dup(_aMeshFile.toStdString().c_str())) ; + chgt = true ; + } + // A.3. La convergence + valeur_i = SpinBoxMaxIter->value() ; + if ( valeur_i != _MaxIter ) + { +// MESSAGE("modification de MaxIter : "<<_MaxIter<<" devient "<SetMaxIter(_MaxIter) ; + chgt = true ; + } + valeur_i = SpinBoxMaxNode->value() ; + if ( valeur_i != _MaxNode ) + { +// MESSAGE("modification de MaxNode : "<<_MaxNode<<" devient "<SetMaxNode(_MaxNode) ; + chgt = true ; + } + valeur_i = SpinBoxMaxElem->value() ; + if ( valeur_i != _MaxElem ) + { +// MESSAGE("modification de MaxElem : "<<_MaxElem<<" devient "<SetMaxElem(_MaxElem) ; + chgt = true ; + } +// B. Si changement + if ( chgt ) + { + myHomardGen->InvalideYACS(_Name.toStdString().c_str()); } + HOMARD_UTILS::updateObjBrowser(); return true ; }