//
//
+// La creation des schemas YACS
HOMARD_YACS CreateYACSSchema(in string YACSName, in string CaseName, in string ScriptFile, in string DirName, in string MeshFile)
raises(SALOME::SALOME_Exception);
long YACSWrite (in string YACSName) raises (SALOME::SALOME_Exception);
raises(SALOME::SALOME_Exception);
//
+// Les preferences
void SetLanguageShort (in string LanguageShort) raises (SALOME::SALOME_Exception);
string GetLanguageShort () raises (SALOME::SALOME_Exception);
void SetPublisMesh (in long PublisMeshIN, in long PublisMeshOUT)
raises (SALOME::SALOME_Exception);
long GetPublisMeshIN () raises (SALOME::SALOME_Exception);
long GetPublisMeshOUT () raises (SALOME::SALOME_Exception);
+ void SetYACSMaximum(in long YACSMaxIter, in long YACSMaxNode, in long YACSMaxElem)
+ raises (SALOME::SALOME_Exception);
+ long GetYACSMaxIter() raises (SALOME::SALOME_Exception);
+ long GetYACSMaxNode() raises (SALOME::SALOME_Exception);
+ long GetYACSMaxElem() raises (SALOME::SALOME_Exception);
};
};
SalomeApp_Module( "HOMARD" ) // default name
{
}
-
-
//=======================================================================
// function : ~HOMARDGUI()
// purpose : Destructor
Bloc = addPreference( tr( "PREF_YACS_MAX" ), Onglet );
setPreferenceProperty( Bloc, "columns", 1 );
- Pref = addPreference( tr( "PREF_YACS_MAX_ITER" ), Bloc, LightApp_Preferences::IntSpin, "HOMARD", "max_iter" );
+ Pref = addPreference( tr( "PREF_YACS_MAX_ITER" ), Bloc, LightApp_Preferences::IntSpin, "HOMARD", "yacs_max_iter" );
setPreferenceProperty( Pref, "min", 0 );
setPreferenceProperty( Pref, "max", 100000000 );
setPreferenceProperty( Pref, "step", 1 );
- Pref = addPreference( tr( "PREF_YACS_MAX_NODE" ), Bloc, LightApp_Preferences::IntSpin, "HOMARD", "max_node" );
+ Pref = addPreference( tr( "PREF_YACS_MAX_NODE" ), Bloc, LightApp_Preferences::IntSpin, "HOMARD", "yacs_max_node" );
setPreferenceProperty( Pref, "min", 0 );
setPreferenceProperty( Pref, "max", 100000000 );
setPreferenceProperty( Pref, "step", 1000 );
- Pref = addPreference( tr( "PREF_YACS_MAX_ELEM" ), Bloc, LightApp_Preferences::IntSpin, "HOMARD", "max_elem" );
+ Pref = addPreference( tr( "PREF_YACS_MAX_ELEM" ), Bloc, LightApp_Preferences::IntSpin, "HOMARD", "yacs_max_elem" );
setPreferenceProperty( Pref, "min", 0 );
setPreferenceProperty( Pref, "max", 100000000 );
setPreferenceProperty( Pref, "step", 1000 );
//================================================
// function : recupPreferences
+// Pour chaque valeur, le defaut est la valeur definie dans HOMARD_Gen
+// . Si la recuperation dans config/salome s'est bien passee a la creation de HOMARD_Gen,
+// ces valeurs sont les valeurs definies.
+// . Si cela ne s'est pas bien passe, ce sont les valeurs par defaut de HOMARD_Gen
//================================================
void HOMARDGUI::recupPreferences()
{
MESSAGE("recupPreferences")
//
-// . La langue
+// A. Declarations
+//
+ SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( application() );
+ HOMARD::HOMARD_Gen_var homardGen = HOMARDGUI::InitHOMARDGen(app);
+ int defaut_i ;
+ std::string defaut_s ;
+//
+// B. Les valeurs
+// B.1. La langue
+//
+ defaut_s = homardGen->GetLanguageShort();
SUIT_ResourceMgr* resMgr = getApp()->resourceMgr();
- _LanguageShort = resMgr->stringValue("language", "language", "en");
- MESSAGE("_LanguageShort " << _LanguageShort.toStdString().c_str() );
+ _LanguageShort = resMgr->stringValue("language", "language", QString(defaut_s.c_str()));
//
-// . Les publications
- _publish_mesh_in = resMgr->booleanValue("HOMARD", "publish_mesh_in", false );
- int pu_m_in = 0 ;
- if ( _publish_mesh_in ) pu_m_in = 1 ;
+// B.2. Les publications
+ bool publish_mesh ;
//
- _publish_mesh_out = resMgr->booleanValue("HOMARD", "publish_mesh_out", false );
- int pu_m_out = 0 ;
- if ( _publish_mesh_out ) pu_m_out = 1 ;
- MESSAGE("_publish_mesh_in " << _publish_mesh_in << ", _publish_mesh_out " << _publish_mesh_out );
+ _PublisMeshIN = homardGen->GetPublisMeshIN();
+ if ( _PublisMeshIN == 1 ) { publish_mesh = true ; }
+ else { publish_mesh = false ; }
+ publish_mesh = resMgr->booleanValue("HOMARD", "publish_mesh_in", publish_mesh );
+ if ( publish_mesh ) { _PublisMeshIN = 1 ; }
+ else { _PublisMeshIN = 0 ; }
+//
+ _PublisMeshOUT = homardGen->GetPublisMeshOUT();
+ if ( _PublisMeshOUT == 1 ) { publish_mesh = true ; }
+ else { publish_mesh = false ; }
+ publish_mesh = resMgr->booleanValue("HOMARD", "publish_mesh_out", publish_mesh );
+ if ( publish_mesh ) { _PublisMeshOUT = 1 ; }
+ else { _PublisMeshOUT = 0 ; }
+//
+// B.3. Les maximum pour YACS
+//
+ defaut_i = homardGen->GetYACSMaxIter();
+ _YACSMaxIter = resMgr->integerValue("HOMARD", "yacs_max_iter", defaut_i );
+//
+ defaut_i = homardGen->GetYACSMaxNode();
+ _YACSMaxNode = resMgr->integerValue("HOMARD", "yacs_max_node", defaut_i );
+//
+ defaut_i = homardGen->GetYACSMaxElem();
+ _YACSMaxElem = resMgr->integerValue("HOMARD", "yacs_max_elem", defaut_i );
+//
+// C. Enregistrement dans l'objet general
+//
+ MESSAGE ("Enregistrement de LanguageShort = " << _LanguageShort.toStdString().c_str() );
+ MESSAGE ("Enregistrement de PublisMeshIN = " << _PublisMeshIN<<", PublisMeshOUT = "<< _PublisMeshOUT);
+ MESSAGE ("Enregistrement de YACSMaxIter = " << _YACSMaxIter<<", YACSMaxNode = "<< _YACSMaxNode<<", YACSMaxElem = "<< _YACSMaxElem);
//
-// . Enregistrement dans l'objet general
- SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( application() );
- HOMARD::HOMARD_Gen_var homardGen = HOMARDGUI::InitHOMARDGen(app);
homardGen->SetLanguageShort(_LanguageShort.toStdString().c_str());
- homardGen->SetPublisMesh(pu_m_in, pu_m_out);
+ homardGen->SetPublisMesh(_PublisMeshIN, _PublisMeshOUT);
+ homardGen->SetYACSMaximum(_YACSMaxIter, _YACSMaxNode, _YACSMaxElem);
}
//================================================
MESSAGE("OnGUIEvent()")
setOrb();
const QObject* obj = sender();
- if ( !obj || !obj->inherits( "QAction" ) )
- return;
+ if ( !obj || !obj->inherits( "QAction" ) ) { return; }
int id = actionId((QAction*)obj);
- bool ret;
- if ( id != -1 )
- ret = OnGUIEvent( id );
- MESSAGE("************** End of OnGUIEvent()");
+ if ( id != -1 ) { bool ret = OnGUIEvent( id ); }
+ MESSAGE("Fin de OnGUIEvent()");
}
//=======================================================================
bool HOMARDGUI::OnGUIEvent (int theCommandID)
{
MESSAGE("OnGUIEvent avec theCommandID = "<<theCommandID);
+// A. Controles
SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( application() );
if ( !app ) return false;
SalomeApp_Study* stud = dynamic_cast<SalomeApp_Study*> ( app->activeStudy() );
- if ( !stud ) {
+ if ( !stud )
+ {
MESSAGE ( "FAILED to cast active study to SalomeApp_Study" );
return false;
}
}
getApp()->updateObjectBrowser();
-
+// B. Choix selon les commandes
SCRUTE(theCommandID);
switch (theCommandID)
{
int anId;
QString _ObjectName;
QString _LanguageShort ;
- bool _publish_mesh_in ;
- bool _publish_mesh_out ;
+ int _PublisMeshIN ;
+ int _PublisMeshOUT ;
+ int _YACSMaxIter ;
+ int _YACSMaxNode ;
+ int _YACSMaxElem ;
};
#endif
void MonCreateBoundaryAn::PushOnHelp()
// ------------------------------------------------------------------------
{
- char* LanguageShort = myHomardGen->GetLanguageShort();
- HOMARD_UTILS::PushOnHelp(QString("gui_create_boundary.html"), QString("un-cylindre"), QString(LanguageShort));
+ std::string LanguageShort = myHomardGen->GetLanguageShort();
+ HOMARD_UTILS::PushOnHelp(QString("gui_create_boundary.html"), QString("un-cylindre"), QString(LanguageShort.c_str()));
}
// -----------------------------------
void MonCreateBoundaryDi::PushOnHelp()
// ------------------------------------------------------------------------
{
- char* LanguageShort = myHomardGen->GetLanguageShort();
- HOMARD_UTILS::PushOnHelp(QString("gui_create_boundary.html"), QString("frontiere-discrete"), QString(LanguageShort));
+ std::string LanguageShort = myHomardGen->GetLanguageShort();
+ HOMARD_UTILS::PushOnHelp(QString("gui_create_boundary.html"), QString("frontiere-discrete"), QString(LanguageShort.c_str()));
}
// ------------------------------------------------------------------------
void MonCreateBoundaryDi::AssocieLesGroupes()
void MonCreateCase::PushOnHelp()
//-------------------------------
{
- char* LanguageShort = myHomardGen->GetLanguageShort();
- HOMARD_UTILS::PushOnHelp(QString("gui_create_case.html"), QString(""), QString(LanguageShort));
+ std::string LanguageShort = myHomardGen->GetLanguageShort();
+ HOMARD_UTILS::PushOnHelp(QString("gui_create_case.html"), QString(""), QString(LanguageShort.c_str()));
}
// ---------------------------------
void MonCreateCase::SetNewName()
void MonCreateCase::PushBoundaryDiHelp()
// ------------------------------------------------------------------------
{
- char* LanguageShort = myHomardGen->GetLanguageShort();
- HOMARD_UTILS::PushOnHelp(QString("gui_create_boundary.html"), QString("frontiere-discrete"), QString(LanguageShort));
+ std::string LanguageShort = myHomardGen->GetLanguageShort();
+ HOMARD_UTILS::PushOnHelp(QString("gui_create_boundary.html"), QString("frontiere-discrete"), QString(LanguageShort.c_str()));
}
// ------------------------------------------------------------------------
void MonCreateCase::SetBoundaryA()
void MonCreateCase::PushBoundaryAnHelp()
// ------------------------------------------------------------------------
{
- char* LanguageShort = myHomardGen->GetLanguageShort();
- HOMARD_UTILS::PushOnHelp(QString("gui_create_boundary.html"), QString("frontiere-analytique"), QString(LanguageShort));
+ std::string LanguageShort = myHomardGen->GetLanguageShort();
+ HOMARD_UTILS::PushOnHelp(QString("gui_create_boundary.html"), QString("frontiere-analytique"), QString(LanguageShort.c_str()));
}
// ------------------------------------------------------------------------
void MonCreateCase::CaseNameChanged()
void MonCreateHypothesis::PushOnHelp()
// ------------------------------------------------------------------------
{
- char* LanguageShort = myHomardGen->GetLanguageShort();
- HOMARD_UTILS::PushOnHelp(QString("gui_create_hypothese.html"), QString(""), QString(LanguageShort));
+ std::string LanguageShort = myHomardGen->GetLanguageShort();
+ HOMARD_UTILS::PushOnHelp(QString("gui_create_hypothese.html"), QString(""), QString(LanguageShort.c_str()));
}
// -------------------------------------------------
void MonCreateHypothesis::SetNewName()
void MonCreateIteration::PushOnHelp()
// ------------------------------------------------------------------------
{
- char* LanguageShort = myHomardGen->GetLanguageShort();
- HOMARD_UTILS::PushOnHelp(QString("gui_create_iteration.html"), QString(""), QString(LanguageShort));
+ std::string LanguageShort = myHomardGen->GetLanguageShort();
+ HOMARD_UTILS::PushOnHelp(QString("gui_create_iteration.html"), QString(""), QString(LanguageShort.c_str()));
}
// ------------------------------------------------------------------------
void MonCreateIteration::SetIterParentName()
void MonCreateListGroup::PushOnHelp()
// ------------------------------------------------------------------------
{
- char* LanguageShort = myHomardGen->GetLanguageShort();
- HOMARD_UTILS::PushOnHelp(QString("gui_create_hypothese.html"), QString(""), QString(LanguageShort));
+ std::string LanguageShort = myHomardGen->GetLanguageShort();
+ HOMARD_UTILS::PushOnHelp(QString("gui_create_hypothese.html"), QString(""), QString(LanguageShort.c_str()));
}
// ------------------------------------------------------------------------
void MonCreateListGroup::InitGroupes()
void MonCreateYACS::PushOnHelp()
//-------------------------------
{
- char* LanguageShort = myHomardGen->GetLanguageShort();
- HOMARD_UTILS::PushOnHelp(QString("yacs.html"), QString(""), QString(LanguageShort));
+ std::string LanguageShort = myHomardGen->GetLanguageShort();
+ HOMARD_UTILS::PushOnHelp(QString("yacs.html"), QString(""), QString(LanguageShort.c_str()));
}
// -------------------------------------------------
void MonCreateYACS::SetNewName()
void MonCreateZone::PushOnHelp()
// ------------------------------------------------------------------------
{
- char* LanguageShort = myHomardGen->GetLanguageShort();
- HOMARD_UTILS::PushOnHelp(QString("gui_create_zone.html"), QString(""), QString(LanguageShort));
+ std::string LanguageShort = myHomardGen->GetLanguageShort();
+ HOMARD_UTILS::PushOnHelp(QString("gui_create_zone.html"), QString(""), QString(LanguageShort.c_str()));
}
// -----------------------------------
void MonIterInfo::PushOnHelp()
//-------------------------------
{
- char* LanguageShort = myHomardGen->GetLanguageShort();
- HOMARD_UTILS::PushOnHelp(QString("gui_mesh_info.html"), QString(""), QString(LanguageShort));
+ std::string LanguageShort = myHomardGen->GetLanguageShort();
+ HOMARD_UTILS::PushOnHelp(QString("gui_mesh_info.html"), QString(""), QString(LanguageShort.c_str()));
}
// ------------------------------------------------------------------------
void MonIterInfo::SetBlockSize()
void MonMeshInfo::PushOnHelp()
//-------------------------------
{
- char* LanguageShort = myHomardGen->GetLanguageShort();
- HOMARD_UTILS::PushOnHelp(QString("gui_create_case.html"), QString(""), QString(LanguageShort));
+ std::string LanguageShort = myHomardGen->GetLanguageShort();
+ HOMARD_UTILS::PushOnHelp(QString("gui_create_case.html"), QString(""), QString(LanguageShort.c_str()));
}
// ---------------------------------
void MonMeshInfo::SetNewCaseName()
void MonPursueIteration::PushOnHelp()
//-------------------------------
{
- char* LanguageShort = myHomardGen->GetLanguageShort();
- HOMARD_UTILS::PushOnHelp(QString("gui_create_case.html"), QString(""), QString(LanguageShort));
+ std::string LanguageShort = myHomardGen->GetLanguageShort();
+ HOMARD_UTILS::PushOnHelp(QString("gui_create_case.html"), QString(""), QString(LanguageShort.c_str()));
}
// ---------------------------------
void MonPursueIteration::SetNewCaseName()
bool ok = true ;
// A. Les valeurs par defaut ; elles doivent etre coherentes
- std::string LanguageShort = "fr" ;
+ std::string LanguageShort = "en" ;
int PublisMeshIN = 0 ;
int PublisMeshOUT = 0 ;
int YACSMaxIter = 0 ;
ligne_bis >> mot_cle ;
std::string chaine2 = GetStringInTexte ( mot_cle, "\"", 1 ) ;
chaine2 = GetStringInTexte ( chaine2, "\"", 0 ) ;
-// MESSAGE("chaine2 = "<<chaine2<<"|");
+ MESSAGE("chaine2 = "<<chaine2<<"|");
// 3.1. La langue
if ( section_langue )
{ if ( chaine2 == "language" ) { LanguageShort = chaine ; } }
if ( chaine2 == "publish_mesh_in" ) { chainebis >> PublisMeshIN ; }
if ( chaine2 == "publish_mesh_out" ) { chainebis >> PublisMeshOUT ; }
// 3.2.2. Les maximum pour YACS
- if ( chaine2 == "max_iter" ) { chainebis >> YACSMaxIter ; }
- if ( chaine2 == "max_node" ) { chainebis >> YACSMaxNode ; }
- if ( chaine2 == "max_elem" ) { chainebis >> YACSMaxElem ; }
+ if ( chaine2 == "yacs_max_iter" ) { chainebis >> YACSMaxIter ; }
+ if ( chaine2 == "yacs_max_node" ) { chainebis >> YACSMaxNode ; }
+ if ( chaine2 == "yacs_max_elem" ) { chainebis >> YACSMaxElem ; }
}
}
}