From: nicolas Date: Thu, 19 Dec 2013 14:58:56 +0000 (+0000) Subject: Correction de la publication et de l'enregistrement des associations entre frontiÃ... X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=681b3991b72f9b752de781496058b4db243b9466;p=modules%2Fhomard.git Correction de la publication et de l'enregistrement des associations entre frontières et groupes --- diff --git a/src/HOMARDGUI/MonCreateCase.cxx b/src/HOMARDGUI/MonCreateCase.cxx index dc8966cd..42250931 100644 --- a/src/HOMARDGUI/MonCreateCase.cxx +++ b/src/HOMARDGUI/MonCreateCase.cxx @@ -99,7 +99,7 @@ void MonCreateCase::InitConnect() connect( CBAdvanced, SIGNAL(stateChanged(int)), this, SLOT(SetAdvanced())); connect( buttonOk, SIGNAL(pressed()), this, SLOT(PushOnOK())); - connect( buttonApply, SIGNAL(pressed()), this, SLOT(PushOnApply())); + connect( buttonApply, SIGNAL(pressed()), this, SLOT(PushOnApply(0))); connect( buttonCancel, SIGNAL(pressed()), this, SLOT(close())); connect( buttonHelp, SIGNAL(pressed()), this, SLOT(PushOnHelp())); } @@ -138,7 +138,7 @@ void MonCreateCase::InitBoundarys() TWBoundary->clearSelection(); } // ------------------------------- -bool MonCreateCase::PushOnApply() +bool MonCreateCase::PushOnApply(int option) // -------------------------------- { MESSAGE("PushOnApply"); @@ -243,17 +243,6 @@ bool MonCreateCase::PushOnApply() { QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), QObject::tr(CORBA::string_dup(S_ex.details.text)) ); - try - { - aCase = myHomardGen->GetCase(_aCaseName.toStdString().c_str()); - string iter0 = aCase->GetIter0Name(); - HOMARD::HOMARD_Iteration_var aIter = myHomardGen->GetIteration(iter0.c_str()); - QString aFileName = aIter->GetMeshFile(); - LEFileName->setText(aFileName); - LEFileName->setReadOnly(true); - PushFichier->hide(); - } - catch( SALOME::SALOME_Exception& S_ex ) {}; return false; } LEFileName->setReadOnly(true); @@ -269,39 +258,41 @@ bool MonCreateCase::PushOnApply() // Menage des eventuelles frontieres deja enregistrees aCase->SupprBoundaryGroup() ; -// Enregistrement de la frontiere discrete - if (CBBoundaryD->isChecked()) + // Enregistrement et publication dans l'arbre d'etudes a la sortie definitive + if ( option > 0 ) { - QString monBoundaryDiName=CBBoundaryDi->currentText(); - if (monBoundaryDiName != "" ) + if (CBBoundaryD->isChecked()) { - aCase->AddBoundaryGroup(monBoundaryDiName.toStdString().c_str(), ""); + QString monBoundaryDiName=CBBoundaryDi->currentText(); + if (monBoundaryDiName != "" ) + { + aCase->AddBoundaryGroup(monBoundaryDiName.toStdString().c_str(), ""); + } } - } - -// Enregistrement des liens (groupe,frontiere analytique) - if (CBBoundaryA->isChecked()) - { - QString NomGroup ; - int nbcol = TWBoundary->columnCount(); - int nbrow = TWBoundary->rowCount(); - for ( int col=1; col< nbcol; col++) + if (CBBoundaryA->isChecked()) { - for ( int row=0; row< nbrow; row++) + QString NomGroup ; + int nbcol = TWBoundary->columnCount(); + int nbrow = TWBoundary->rowCount(); + for ( int col=1; col< nbcol; col++) { - if ( TWBoundary->item( row, col )->checkState() == Qt::Checked ) + for ( int row=0; row< nbrow; row++) { -// Nom du groupe - NomGroup = QString(TWBoundary->item(row, 0)->text()) ; -// Nom de la frontiere - QTableWidgetItem *__colItem = new QTableWidgetItem(); - __colItem = TWBoundary->horizontalHeaderItem(col); - aCase->AddBoundaryGroup(QString(__colItem->text()).toStdString().c_str(), NomGroup.toStdString().c_str()); + if ( TWBoundary->item( row, col )->checkState() == Qt::Checked ) + { + // Nom du groupe + NomGroup = QString(TWBoundary->item(row, 0)->text()) ; + // Nom de la frontiere + QTableWidgetItem *__colItem = new QTableWidgetItem(); + __colItem = TWBoundary->horizontalHeaderItem(col); + aCase->AddBoundaryGroup(QString(__colItem->text()).toStdString().c_str(), NomGroup.toStdString().c_str()); + } } } } } + // Options avancees if (CBAdvanced->isChecked()) { @@ -317,7 +308,7 @@ bool MonCreateCase::PushOnApply() void MonCreateCase::PushOnOK() // --------------------------- { - bool bOK = PushOnApply(); + bool bOK = PushOnApply(1); if ( bOK ) this->close(); } //------------------------------ @@ -409,7 +400,7 @@ void MonCreateCase::SetBoundaryD() MESSAGE("Debut de SetBoundaryD "); if (CBBoundaryD->isChecked()) { - bool bOK = PushOnApply(); + bool bOK = PushOnApply(0); if (bOK) { GBBoundaryD->setVisible(1); } else { GBBoundaryD->setVisible(0); CBBoundaryD->setChecked(0); @@ -456,7 +447,7 @@ void MonCreateCase::SetBoundaryA() MESSAGE("Debut de SetBoundaryA "); if (CBBoundaryA->isChecked()) { - bool bOK = PushOnApply(); + bool bOK = PushOnApply(0); if (bOK) { GBBoundaryA->setVisible(1); } else { GBBoundaryA->setVisible(0); CBBoundaryA->setChecked(0); diff --git a/src/HOMARDGUI/MonCreateCase.h b/src/HOMARDGUI/MonCreateCase.h index cf2bb6d9..16186f3d 100644 --- a/src/HOMARDGUI/MonCreateCase.h +++ b/src/HOMARDGUI/MonCreateCase.h @@ -80,7 +80,7 @@ public slots: virtual void SetAdvanced(); virtual void PushOnOK(); - virtual bool PushOnApply(); + virtual bool PushOnApply(int option); virtual void PushOnHelp(); virtual void CaseNameChanged(); diff --git a/src/HOMARD_I/HOMARD_Cas_i.cxx b/src/HOMARD_I/HOMARD_Cas_i.cxx index 91b0825f..105a487a 100755 --- a/src/HOMARD_I/HOMARD_Cas_i.cxx +++ b/src/HOMARD_I/HOMARD_Cas_i.cxx @@ -334,7 +334,7 @@ void HOMARD_Cas_i::AddBoundaryGroup( const char* BoundaryName, const char* Group it++ ; // MESSAGE (".. Group : "<< *it ); if ( *it == Group ) - { INFOS ("Le groupe " << Group << " est deja associe a la frontiere " << boun) ; + { INFOS ("Frontiere " << boun << " Un groupe est deja associe " << Group ) ; SALOME::ExceptionStruct es; es.type = SALOME::BAD_PARAM; es.text = "Invalid AddBoundaryGroup";