1 // Copyright (C) 2011-2013 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #include "MonEditYACS.h"
22 #include "SalomeApp_Tools.h"
23 #include "HOMARDGUI_Utils.h"
24 #include "HomardQtCommun.h"
25 #include <utilities.h>
29 // -------------------------------------------------------------
30 /* Constructs a MonEditYACS
31 herite de MonCreateYACS
33 // -------------------------------------------------------------
34 MonEditYACS::MonEditYACS ( bool modal,
35 HOMARD::HOMARD_Gen_var myHomardGen,
37 MonCreateYACS(myHomardGen, Name)
39 MESSAGE("Debut de MonEditYACS" << Name.toStdString().c_str());
40 setWindowTitle(QObject::tr("HOM_YACS_EDIT_WINDOW_TITLE"));
42 aYACS = myHomardGen->GetYACS(_Name.toStdString().c_str());
45 // ------------------------------
46 MonEditYACS::~MonEditYACS()
47 // ------------------------------
50 // ------------------------------
51 void MonEditYACS::InitValEdit()
52 // ------------------------------
54 MESSAGE("InitValEdit");
55 LEName->setText(_Name);
56 LEName->setReadOnly(true);
58 QString _aCaseName = aYACS->GetCaseName();
59 LECaseName->setText(_aCaseName);
60 LECaseName->setReadOnly(true);
61 PBCaseName->setVisible(0);
63 QString aScriptFile = aYACS->GetScriptFile();
64 LEScriptFile->setText(aScriptFile);
66 QString aDirName = aYACS->GetDirName();
67 LEDirName->setText(aDirName);
69 QString aMeshFile = aYACS->GetMeshFile();
70 LEMeshFile->setText(aMeshFile);
72 int Type=aYACS->GetType();
73 if(Type==1) { RBConstant->setChecked(true); }
74 else { RBVariable->setChecked(true); };
75 RBConstant->setEnabled(false);
76 RBVariable->setEnabled(false);
81 // ---------------------------------------------------
82 bool MonEditYACS:: CreateOrUpdate()
83 //----------------------------------------------------
84 // Modification du schema
86 MESSAGE("CreateOrUpdate");
89 QString aScriptFile=LEScriptFile->text().trimmed();
90 if ( aScriptFile != _aScriptFile )
92 _aScriptFile = aScriptFile ;
93 aYACS->SetScriptFile(CORBA::string_dup(_aScriptFile.toStdString().c_str())) ;
95 QString aDirName=LEDirName->text().trimmed();
96 if ( aDirName != _aDirName )
98 _aDirName = aDirName ;
99 aYACS->SetDirName(CORBA::string_dup(_aDirName.toStdString().c_str())) ;
101 QString aMeshFile=LEMeshFile->text().trimmed();
102 if ( aMeshFile != _aMeshFile )
104 _aMeshFile = aMeshFile ;
105 aYACS->SetMeshFile(CORBA::string_dup(_aMeshFile.toStdString().c_str())) ;