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
22 #include "MonEditYACS.h"
24 #include "SalomeApp_Tools.h"
25 #include "HOMARDGUI_Utils.h"
26 #include "HomardQtCommun.h"
27 #include <utilities.h>
30 // -------------------------------------------------------------
31 /* Constructs a MonEditYACS
32 herite de MonCreateYACS
34 // -------------------------------------------------------------
35 MonEditYACS::MonEditYACS ( bool modal,
36 HOMARD::HOMARD_Gen_var myHomardGen,
38 MonCreateYACS(myHomardGen, Name)
40 MESSAGE("Debut de MonEditYACS" << Name.toStdString().c_str());
41 setWindowTitle(QObject::tr("HOM_YACS_EDIT_WINDOW_TITLE"));
43 aYACS = myHomardGen->GetYACS(_Name.toStdString().c_str());
46 // ------------------------------
47 MonEditYACS::~MonEditYACS()
48 // ------------------------------
51 // ------------------------------
52 void MonEditYACS::InitValEdit()
53 // ------------------------------
55 MESSAGE("InitValEdit");
56 LEName->setText(_Name);
57 LEName->setReadOnly(true);
59 QString _aCaseName = aYACS->GetCaseName();
60 LECaseName->setText(_aCaseName);
61 LECaseName->setReadOnly(true);
62 PBCaseName->setVisible(0);
64 QString aScriptFile = aYACS->GetScriptFile();
65 LEScriptFile->setText(aScriptFile);
67 QString aDirName = aYACS->GetDirName();
68 LEDirName->setText(aDirName);
70 QString aMeshFile = aYACS->GetMeshFile();
71 LEMeshFile->setText(aMeshFile);
73 int Type=aYACS->GetType();
74 if(Type==1) { RBStatic->setChecked(true); }
75 else { RBTransient->setChecked(true); };
76 RBStatic->setEnabled(false);
77 RBTransient->setEnabled(false);
82 // ---------------------------------------------------
83 bool MonEditYACS:: CreateOrUpdate()
84 //----------------------------------------------------
85 // Modification du schema
87 MESSAGE("CreateOrUpdate");
90 QString aScriptFile=LEScriptFile->text().trimmed();
91 if ( aScriptFile != _aScriptFile )
93 _aScriptFile = aScriptFile ;
94 aYACS->SetScriptFile(CORBA::string_dup(_aScriptFile.toStdString().c_str())) ;
96 QString aDirName=LEDirName->text().trimmed();
97 if ( aDirName != _aDirName )
99 _aDirName = aDirName ;
100 aYACS->SetDirName(CORBA::string_dup(_aDirName.toStdString().c_str())) ;
102 QString aMeshFile=LEMeshFile->text().trimmed();
103 if ( aMeshFile != _aMeshFile )
105 _aMeshFile = aMeshFile ;
106 aYACS->SetMeshFile(CORBA::string_dup(_aMeshFile.toStdString().c_str())) ;