Salome HOME
GUI pour la création du schéma YACS
authornicolas <nicolas>
Wed, 11 Sep 2013 15:07:58 +0000 (15:07 +0000)
committernicolas <nicolas>
Wed, 11 Sep 2013 15:07:58 +0000 (15:07 +0000)
14 files changed:
resources/Makefile.am
resources/yacs.png [new file with mode: 0644]
src/HOMARDGUI/CreateYACS.h [new file with mode: 0644]
src/HOMARDGUI/CreateYACS.ui [new file with mode: 0644]
src/HOMARDGUI/HOMARDGUI.cxx
src/HOMARDGUI/HOMARDGUI.h
src/HOMARDGUI/HOMARD_msg_en.ts
src/HOMARDGUI/HOMARD_msg_fr.ts
src/HOMARDGUI/HOMARD_msg_ja.ts
src/HOMARDGUI/HomardQtCommun.cxx
src/HOMARDGUI/Makefile.am
src/HOMARDGUI/MonCreateYACS.cxx [new file with mode: 0644]
src/HOMARDGUI/MonCreateYACS.h [new file with mode: 0644]
src/HOMARDGUI/MonPursueIteration.cxx

index 3ea6d8b501189e53e1248ec5174fd29f5d7fdc18..957cdc8700329954d887b494cb3c887a87d63546 100644 (file)
@@ -62,6 +62,7 @@ dist_salomeres_DATA =   \
        texte_2.png \
        triangle.png \
        whatis.png \
+       yacs.png \
        yacs_01.xml \
        zone_boxdxyz.png \
        zone_boxdxyz_2.png \
diff --git a/resources/yacs.png b/resources/yacs.png
new file mode 100644 (file)
index 0000000..39c00aa
Binary files /dev/null and b/resources/yacs.png differ
diff --git a/src/HOMARDGUI/CreateYACS.h b/src/HOMARDGUI/CreateYACS.h
new file mode 100644 (file)
index 0000000..0b9f45e
--- /dev/null
@@ -0,0 +1,260 @@
+/********************************************************************************
+** Form generated from reading UI file 'CreateYACS.ui'
+**
+** Created: Wed Sep 11 16:01:30 2013
+**      by: Qt User Interface Compiler version 4.6.3
+**
+** WARNING! All changes made in this file will be lost when recompiling UI file!
+********************************************************************************/
+
+#ifndef CREATEYACS_H
+#define CREATEYACS_H
+
+#include <QtCore/QVariant>
+#include <QtGui/QAction>
+#include <QtGui/QApplication>
+#include <QtGui/QButtonGroup>
+#include <QtGui/QDialog>
+#include <QtGui/QGridLayout>
+#include <QtGui/QGroupBox>
+#include <QtGui/QHBoxLayout>
+#include <QtGui/QHeaderView>
+#include <QtGui/QLabel>
+#include <QtGui/QLineEdit>
+#include <QtGui/QPushButton>
+#include <QtGui/QRadioButton>
+#include <QtGui/QSpacerItem>
+
+QT_BEGIN_NAMESPACE
+
+class Ui_CreateYACS
+{
+public:
+    QGridLayout *gridLayout_2;
+    QGridLayout *gridLayout;
+    QLabel *Case;
+    QPushButton *PBCaseName;
+    QLineEdit *LECaseName;
+    QHBoxLayout *_2;
+    QLabel *Script;
+    QPushButton *PushFile;
+    QLineEdit *LEFileNameScript;
+    QHBoxLayout *hboxLayout;
+    QLabel *DirectoryStart;
+    QPushButton *PushDir;
+    QLineEdit *LEDirName;
+    QHBoxLayout *_3;
+    QLabel *MeshFile;
+    QPushButton *PushFile_2;
+    QLineEdit *LEFileNameMesh;
+    QRadioButton *RBStatic;
+    QRadioButton *RBTransient;
+    QGroupBox *GroupButtons;
+    QGridLayout *gridLayout1;
+    QPushButton *buttonHelp;
+    QPushButton *buttonApply;
+    QPushButton *buttonOk;
+    QPushButton *buttonCancel;
+    QSpacerItem *spacer_2;
+
+    void setupUi(QDialog *CreateYACS)
+    {
+        if (CreateYACS->objectName().isEmpty())
+            CreateYACS->setObjectName(QString::fromUtf8("CreateYACS"));
+        CreateYACS->resize(601, 300);
+        QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
+        sizePolicy.setHorizontalStretch(0);
+        sizePolicy.setVerticalStretch(0);
+        sizePolicy.setHeightForWidth(CreateYACS->sizePolicy().hasHeightForWidth());
+        CreateYACS->setSizePolicy(sizePolicy);
+        CreateYACS->setAutoFillBackground(true);
+        gridLayout_2 = new QGridLayout(CreateYACS);
+        gridLayout_2->setObjectName(QString::fromUtf8("gridLayout_2"));
+        gridLayout = new QGridLayout();
+        gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
+        Case = new QLabel(CreateYACS);
+        Case->setObjectName(QString::fromUtf8("Case"));
+
+        gridLayout->addWidget(Case, 0, 0, 1, 1);
+
+        PBCaseName = new QPushButton(CreateYACS);
+        PBCaseName->setObjectName(QString::fromUtf8("PBCaseName"));
+        PBCaseName->setEnabled(true);
+        PBCaseName->setMaximumSize(QSize(50, 27));
+
+        gridLayout->addWidget(PBCaseName, 0, 1, 1, 1);
+
+        LECaseName = new QLineEdit(CreateYACS);
+        LECaseName->setObjectName(QString::fromUtf8("LECaseName"));
+        LECaseName->setMinimumSize(QSize(382, 21));
+
+        gridLayout->addWidget(LECaseName, 0, 2, 1, 1);
+
+
+        gridLayout_2->addLayout(gridLayout, 0, 0, 1, 3);
+
+        _2 = new QHBoxLayout();
+#ifndef Q_OS_MAC
+        _2->setSpacing(6);
+#endif
+        _2->setContentsMargins(0, 0, 0, 0);
+        _2->setObjectName(QString::fromUtf8("_2"));
+        Script = new QLabel(CreateYACS);
+        Script->setObjectName(QString::fromUtf8("Script"));
+
+        _2->addWidget(Script);
+
+        PushFile = new QPushButton(CreateYACS);
+        PushFile->setObjectName(QString::fromUtf8("PushFile"));
+        PushFile->setAutoDefault(false);
+
+        _2->addWidget(PushFile);
+
+        LEFileNameScript = new QLineEdit(CreateYACS);
+        LEFileNameScript->setObjectName(QString::fromUtf8("LEFileNameScript"));
+        LEFileNameScript->setMinimumSize(QSize(382, 21));
+
+        _2->addWidget(LEFileNameScript);
+
+
+        gridLayout_2->addLayout(_2, 1, 0, 1, 3);
+
+        hboxLayout = new QHBoxLayout();
+#ifndef Q_OS_MAC
+        hboxLayout->setSpacing(6);
+#endif
+        hboxLayout->setContentsMargins(0, 0, 0, 0);
+        hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
+        DirectoryStart = new QLabel(CreateYACS);
+        DirectoryStart->setObjectName(QString::fromUtf8("DirectoryStart"));
+
+        hboxLayout->addWidget(DirectoryStart);
+
+        PushDir = new QPushButton(CreateYACS);
+        PushDir->setObjectName(QString::fromUtf8("PushDir"));
+        PushDir->setAutoDefault(false);
+
+        hboxLayout->addWidget(PushDir);
+
+        LEDirName = new QLineEdit(CreateYACS);
+        LEDirName->setObjectName(QString::fromUtf8("LEDirName"));
+        LEDirName->setMinimumSize(QSize(382, 21));
+
+        hboxLayout->addWidget(LEDirName);
+
+
+        gridLayout_2->addLayout(hboxLayout, 2, 0, 1, 3);
+
+        _3 = new QHBoxLayout();
+#ifndef Q_OS_MAC
+        _3->setSpacing(6);
+#endif
+        _3->setContentsMargins(0, 0, 0, 0);
+        _3->setObjectName(QString::fromUtf8("_3"));
+        MeshFile = new QLabel(CreateYACS);
+        MeshFile->setObjectName(QString::fromUtf8("MeshFile"));
+
+        _3->addWidget(MeshFile);
+
+        PushFile_2 = new QPushButton(CreateYACS);
+        PushFile_2->setObjectName(QString::fromUtf8("PushFile_2"));
+        PushFile_2->setAutoDefault(false);
+
+        _3->addWidget(PushFile_2);
+
+        LEFileNameMesh = new QLineEdit(CreateYACS);
+        LEFileNameMesh->setObjectName(QString::fromUtf8("LEFileNameMesh"));
+        LEFileNameMesh->setMinimumSize(QSize(382, 21));
+
+        _3->addWidget(LEFileNameMesh);
+
+
+        gridLayout_2->addLayout(_3, 3, 0, 1, 3);
+
+        RBStatic = new QRadioButton(CreateYACS);
+        RBStatic->setObjectName(QString::fromUtf8("RBStatic"));
+        RBStatic->setChecked(true);
+
+        gridLayout_2->addWidget(RBStatic, 4, 0, 1, 1);
+
+        RBTransient = new QRadioButton(CreateYACS);
+        RBTransient->setObjectName(QString::fromUtf8("RBTransient"));
+
+        gridLayout_2->addWidget(RBTransient, 4, 1, 1, 1);
+
+        GroupButtons = new QGroupBox(CreateYACS);
+        GroupButtons->setObjectName(QString::fromUtf8("GroupButtons"));
+        gridLayout1 = new QGridLayout(GroupButtons);
+#ifndef Q_OS_MAC
+        gridLayout1->setSpacing(6);
+#endif
+#ifndef Q_OS_MAC
+        gridLayout1->setContentsMargins(9, 9, 9, 9);
+#endif
+        gridLayout1->setObjectName(QString::fromUtf8("gridLayout1"));
+        buttonHelp = new QPushButton(GroupButtons);
+        buttonHelp->setObjectName(QString::fromUtf8("buttonHelp"));
+        buttonHelp->setAutoDefault(false);
+
+        gridLayout1->addWidget(buttonHelp, 0, 4, 1, 1);
+
+        buttonApply = new QPushButton(GroupButtons);
+        buttonApply->setObjectName(QString::fromUtf8("buttonApply"));
+        buttonApply->setAutoDefault(false);
+
+        gridLayout1->addWidget(buttonApply, 0, 1, 1, 1);
+
+        buttonOk = new QPushButton(GroupButtons);
+        buttonOk->setObjectName(QString::fromUtf8("buttonOk"));
+        buttonOk->setAutoDefault(false);
+
+        gridLayout1->addWidget(buttonOk, 0, 0, 1, 1);
+
+        buttonCancel = new QPushButton(GroupButtons);
+        buttonCancel->setObjectName(QString::fromUtf8("buttonCancel"));
+        buttonCancel->setAutoDefault(false);
+
+        gridLayout1->addWidget(buttonCancel, 0, 2, 1, 1);
+
+
+        gridLayout_2->addWidget(GroupButtons, 5, 0, 1, 2);
+
+        spacer_2 = new QSpacerItem(128, 25, QSizePolicy::Fixed, QSizePolicy::Minimum);
+
+        gridLayout_2->addItem(spacer_2, 5, 2, 1, 1);
+
+
+        retranslateUi(CreateYACS);
+
+        QMetaObject::connectSlotsByName(CreateYACS);
+    } // setupUi
+
+    void retranslateUi(QDialog *CreateYACS)
+    {
+        CreateYACS->setWindowTitle(QApplication::translate("CreateYACS", "Create YACS", 0, QApplication::UnicodeUTF8));
+        Case->setText(QApplication::translate("CreateYACS", "Case", 0, QApplication::UnicodeUTF8));
+        PBCaseName->setText(QString());
+        Script->setText(QApplication::translate("CreateYACS", "Script", 0, QApplication::UnicodeUTF8));
+        PushFile->setText(QString());
+        DirectoryStart->setText(QApplication::translate("CreateYACS", "Directory", 0, QApplication::UnicodeUTF8));
+        PushDir->setText(QString());
+        MeshFile->setText(QApplication::translate("CreateYACS", "Mesh file", 0, QApplication::UnicodeUTF8));
+        PushFile_2->setText(QString());
+        RBStatic->setText(QApplication::translate("CreateYACS", "Static", 0, QApplication::UnicodeUTF8));
+        RBTransient->setText(QApplication::translate("CreateYACS", "Transient", 0, QApplication::UnicodeUTF8));
+        GroupButtons->setTitle(QString());
+        buttonHelp->setText(QApplication::translate("CreateYACS", "Help", 0, QApplication::UnicodeUTF8));
+        buttonApply->setText(QApplication::translate("CreateYACS", "Apply", 0, QApplication::UnicodeUTF8));
+        buttonOk->setText(QApplication::translate("CreateYACS", "OK", 0, QApplication::UnicodeUTF8));
+        buttonCancel->setText(QApplication::translate("CreateYACS", "Cancel", 0, QApplication::UnicodeUTF8));
+    } // retranslateUi
+
+};
+
+namespace Ui {
+    class CreateYACS: public Ui_CreateYACS {};
+} // namespace Ui
+
+QT_END_NAMESPACE
+
+#endif // CREATEYACS_H
diff --git a/src/HOMARDGUI/CreateYACS.ui b/src/HOMARDGUI/CreateYACS.ui
new file mode 100644 (file)
index 0000000..8e55a8a
--- /dev/null
@@ -0,0 +1,266 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>CreateYACS</class>
+ <widget class="QDialog" name="CreateYACS">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>601</width>
+    <height>300</height>
+   </rect>
+  </property>
+  <property name="sizePolicy">
+   <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+    <horstretch>0</horstretch>
+    <verstretch>0</verstretch>
+   </sizepolicy>
+  </property>
+  <property name="windowTitle">
+   <string>Create YACS</string>
+  </property>
+  <property name="autoFillBackground">
+   <bool>true</bool>
+  </property>
+  <layout class="QGridLayout" name="gridLayout_2">
+   <item row="0" column="0" colspan="3">
+    <layout class="QGridLayout" name="gridLayout">
+     <item row="0" column="0">
+      <widget class="QLabel" name="Case">
+       <property name="text">
+        <string>Case</string>
+       </property>
+      </widget>
+     </item>
+     <item row="0" column="1">
+      <widget class="QPushButton" name="PBCaseName">
+       <property name="enabled">
+        <bool>true</bool>
+       </property>
+       <property name="maximumSize">
+        <size>
+         <width>50</width>
+         <height>27</height>
+        </size>
+       </property>
+       <property name="text">
+        <string/>
+       </property>
+      </widget>
+     </item>
+     <item row="0" column="2">
+      <widget class="QLineEdit" name="LECaseName">
+       <property name="minimumSize">
+        <size>
+         <width>382</width>
+         <height>21</height>
+        </size>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </item>
+   <item row="1" column="0" colspan="3">
+    <layout class="QHBoxLayout" name="_2">
+     <property name="spacing">
+      <number>6</number>
+     </property>
+     <property name="margin">
+      <number>0</number>
+     </property>
+     <item>
+      <widget class="QLabel" name="Script">
+       <property name="text">
+        <string>Script</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QPushButton" name="PushFile">
+       <property name="text">
+        <string/>
+       </property>
+       <property name="autoDefault">
+        <bool>false</bool>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QLineEdit" name="LEFileNameScript">
+       <property name="minimumSize">
+        <size>
+         <width>382</width>
+         <height>21</height>
+        </size>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </item>
+   <item row="2" column="0" colspan="3">
+    <layout class="QHBoxLayout">
+     <property name="spacing">
+      <number>6</number>
+     </property>
+     <property name="margin">
+      <number>0</number>
+     </property>
+     <item>
+      <widget class="QLabel" name="DirectoryStart">
+       <property name="text">
+        <string>Directory</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QPushButton" name="PushDir">
+       <property name="text">
+        <string/>
+       </property>
+       <property name="autoDefault">
+        <bool>false</bool>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QLineEdit" name="LEDirName">
+       <property name="minimumSize">
+        <size>
+         <width>382</width>
+         <height>21</height>
+        </size>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </item>
+   <item row="3" column="0" colspan="3">
+    <layout class="QHBoxLayout" name="_3">
+     <property name="spacing">
+      <number>6</number>
+     </property>
+     <property name="margin">
+      <number>0</number>
+     </property>
+     <item>
+      <widget class="QLabel" name="MeshFile">
+       <property name="text">
+        <string>Mesh file</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QPushButton" name="PushFile_2">
+       <property name="text">
+        <string/>
+       </property>
+       <property name="autoDefault">
+        <bool>false</bool>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QLineEdit" name="LEFileNameMesh">
+       <property name="minimumSize">
+        <size>
+         <width>382</width>
+         <height>21</height>
+        </size>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </item>
+   <item row="4" column="0">
+    <widget class="QRadioButton" name="RBStatic">
+     <property name="text">
+      <string>Static</string>
+     </property>
+     <property name="checked">
+      <bool>true</bool>
+     </property>
+    </widget>
+   </item>
+   <item row="4" column="1">
+    <widget class="QRadioButton" name="RBTransient">
+     <property name="text">
+      <string>Transient</string>
+     </property>
+    </widget>
+   </item>
+   <item row="5" column="0" colspan="2">
+    <widget class="QGroupBox" name="GroupButtons">
+     <property name="title">
+      <string/>
+     </property>
+     <layout class="QGridLayout">
+      <property name="margin">
+       <number>9</number>
+      </property>
+      <property name="spacing">
+       <number>6</number>
+      </property>
+      <item row="0" column="4">
+       <widget class="QPushButton" name="buttonHelp">
+        <property name="text">
+         <string>Help</string>
+        </property>
+        <property name="autoDefault">
+         <bool>false</bool>
+        </property>
+       </widget>
+      </item>
+      <item row="0" column="1">
+       <widget class="QPushButton" name="buttonApply">
+        <property name="text">
+         <string>Apply</string>
+        </property>
+        <property name="autoDefault">
+         <bool>false</bool>
+        </property>
+       </widget>
+      </item>
+      <item row="0" column="0">
+       <widget class="QPushButton" name="buttonOk">
+        <property name="text">
+         <string>OK</string>
+        </property>
+        <property name="autoDefault">
+         <bool>false</bool>
+        </property>
+       </widget>
+      </item>
+      <item row="0" column="2">
+       <widget class="QPushButton" name="buttonCancel">
+        <property name="text">
+         <string>Cancel</string>
+        </property>
+        <property name="autoDefault">
+         <bool>false</bool>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item row="5" column="2">
+    <spacer name="spacer_2">
+     <property name="orientation">
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="sizeType">
+      <enum>QSizePolicy::Fixed</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>128</width>
+       <height>25</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
index 30a4944734cf40b0e7b767c6f0d66dbf20022c48..58f7111aaf8d0ca590168e3683c2740f2721b21b 100644 (file)
@@ -68,6 +68,7 @@ using namespace std;
 #include "MonEditBoundaryAn.h"
 #include "MonEditBoundaryDi.h"
 #include "MonMeshInfo.h"
+#include "MonCreateYACS.h"
 #include "MonIterInfo.h"
 #include "HomardQtCommun.h"
 
@@ -165,6 +166,8 @@ void HOMARDGUI::createActions(){
 //
   createHOMARDAction( 1301, "MESH_INFO",        "advanced_mesh_info.png" );
   createHOMARDAction( 1302, "EDIT_MESS_FILE",   "texte.png"              );
+//
+  createHOMARDAction( 1401, "YACS",             "yacs.png" );
 //
 }
 
@@ -205,6 +208,10 @@ void HOMARDGUI::createMenus(){
   createMenu( separator(), HOMARD_Id,-1);
   createMenu( 1201, HOMARD_Id, -1 ); //Edit
   createMenu( separator(), HOMARD_Id,-1);
+//
+  HOMARD_Id  = createMenu( tr( "HOM_MEN_YACS" ),  -1,  5, 10 );
+  createMenu( 1401, HOMARD_Id, -1 ); // Création d'un schéma YACS
+  createMenu( separator(), HOMARD_Id,-1);
 //
 /*// La langue des preferences
   SUIT_ResourceMgr* resMgr = getApp()->resourceMgr();
@@ -233,7 +240,7 @@ void HOMARDGUI::OnGUIEvent()
 //=======================================================================
 bool HOMARDGUI::OnGUIEvent (int theCommandID)
 {
-  MESSAGE("OnGUIEvent(int)");
+  MESSAGE("OnGUIEvent avec theCommandID = "<<theCommandID);
   SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( application() );
   if ( !app ) return false;
 
@@ -466,7 +473,18 @@ bool HOMARDGUI::OnGUIEvent (int theCommandID)
           if ( aDlg->_codret == 0 ) { aDlg->show(); }
       }
       break;
-     }
+    }
+
+    case 1401: // Création d'un schéma YACS
+    {
+      MESSAGE("etape 1401")
+      MESSAGE("command " << theCommandID << " activated");
+      QString CaseName=HOMARD_QT_COMMUN::SelectionArbreEtude(QString("CasHomard"), 1);
+      MESSAGE("CaseName " << CaseName.toStdString().c_str() << " choisi dans arbre");
+      MonCreateYACS *aDlg = new MonCreateYACS( parent, true, HOMARD::HOMARD_Gen::_duplicate(homardGen), CaseName ) ;
+      aDlg->show();
+      break;
+    }
 
   }
   getApp()->updateObjectBrowser();
@@ -543,22 +561,20 @@ void HOMARDGUI::setOrb()
 _PTR(SObject) HOMARDGUI::chercheMonObjet()
 //========================================
 {
-
-    SALOMEDSClient_SObject* aSO = NULL;
-    _PTR(SObject) obj;
-    SALOME_ListIO lst;
-    getApp()->selectionMgr()->selectedObjects( lst );
-    if (  lst.Extent() == 1 )
-    {
-       Handle(SALOME_InteractiveObject) io = lst.First();
-       SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( application()->activeStudy() );
-       _PTR(Study) study = appStudy->studyDS();
-       _PTR(SObject) obj = study->FindObjectID( io->getEntry() );
-       _ObjectName = QString( obj->GetName().c_str() );
-        return obj;
-     }
-     else
-         return _PTR(SObject)(aSO);
+  SALOMEDSClient_SObject* aSO = NULL;
+  _PTR(SObject) obj;
+  SALOME_ListIO lst;
+  getApp()->selectionMgr()->selectedObjects( lst );
+  if (  lst.Extent() == 1 )
+  {
+    Handle(SALOME_InteractiveObject) io = lst.First();
+    SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( application()->activeStudy() );
+    _PTR(Study) study = appStudy->studyDS();
+    _PTR(SObject) obj = study->FindObjectID( io->getEntry() );
+    _ObjectName = QString( obj->GetName().c_str() );
+    return obj;
+  }
+  else { return _PTR(SObject)(aSO); }
 }
 //=============================================================================
 void HOMARDGUI::contextMenuPopup( const QString& client, QMenu* menu, QString& title )
@@ -609,6 +625,8 @@ void HOMARDGUI::contextMenuPopup( const QString& client, QMenu* menu, QString& t
     }
     else if ( HOMARD_UTILS::isCase(obj) )
     {
+      pix = resMgr->loadPixmap( "HOMARD", "yacs.png" );
+      menu->addAction(QIcon(pix), tr(QString("HOM_MEN_YACS").toLatin1().data()), this, SLOT(YACS()));
       EditObject = true ;
       DeleteObject = true ;
     }
@@ -667,6 +685,12 @@ void HOMARDGUI::EditAsciiFile()
   this->OnGUIEvent(1302);
 }
 
+void HOMARDGUI::YACS()
+{
+  this->OnGUIEvent(1401);
+}
+
+
 //
 //=============================================================================
 // Export the module
index 460de11eb4066fcf8695b4bba0b2fd6086554dad..ee3e64ab5688bb5d7bc067b645351c23b238e340 100644 (file)
@@ -65,6 +65,7 @@ private slots:
     void LanceCalcul();
     void IterInfo();
     void NextIter();
+    void YACS();
     void Edit();
     void Delete();
     void XmGraceFichier();
index e984097f7b6ede200ef867824a6d82a0444357fd..59ea6a10af36917ae8fdf937ceefd58e96cb16fa 100644 (file)
         <source>HOM_MEN_INFORMATION</source>
         <translation>Information</translation>
     </message>
+    <message>
+        <source>HOM_MEN_YACS</source>
+        <translation>YACS</translation>
+    </message>
     <message>
         <source>HOM_MEN_NEW_CASE</source>
         <translation>New case</translation>
         <source>HOM_SELECT_FILE_3</source>
         <translation>This file cannot be opened.</translation>
     </message>
+    <message>
+        <source>HOM_SCRIPT_FILE</source>
+        <translation>A script file must be given.</translation>
+    </message>
     <message>
         <source>HOM_MED_FILE_1</source>
         <translation>This MED file cannot be read.</translation>
         <source>HOM_CASE_DIRECTORY_3</source>
         <translation>A valid directory for the case must be selected.</translation>
     </message>
+    <message>
+        <source>HOM_CASE_DIRECTORY_4</source>
+        <translation>A directory for the computation must be selected.</translation>
+    </message>
     <message>
         <source>HOM_CASE_MESH</source>
         <translation>The file of the initial mesh must be selected.</translation>
index a7ca7c716c692185191fb7ce4639b251965a02ce..1309e5a5c8cd927b6e202b127e4e6a780c4747b2 100644 (file)
         <source>HOM_MEN_INFORMATION</source>
         <translation>Information</translation>
     </message>
+    <message>
+        <source>HOM_MEN_YACS</source>
+        <translation>YACS</translation>
+    </message>
     <message>
         <source>HOM_MEN_NEW_CASE</source>
         <translation>Nouveau cas</translation>
         <source>HOM_SELECT_FILE_3</source>
         <translation>Impossible d'ouvrir ce fichier.</translation>
     </message>
+    <message>
+        <source>HOM_SCRIPT_FILE</source>
+        <translation>Il faut donner un fichier pour le script python.</translation>
+    </message>
     <message>
         <source>HOM_MED_FILE_1</source>
         <translation>Ce fichier MED est illisible.</translation>
         <source>HOM_CASE_DIRECTORY_3</source>
         <translation>Un répertoire valide doit être choisi.</translation>
     </message>
+    <message>
+        <source>HOM_CASE_DIRECTORY_4</source>
+        <translation>Il faut choisir un répertoire de travail pour le calcul.</translation>
+    </message>
     <message>
         <source>HOM_CASE_MESH</source>
         <translation>Il faut choisir le maillage initial.</translation>
         <source>Number of iteration</source>
         <translation>Numéro de l'itération</translation>
     </message>
+    <message>
+        <source>Case</source>
+        <translation>Cas</translation>
+    </message>
+    <message>
+        <source>Mesh file</source>
+        <translation>Maillage initial</translation>
+    </message>
+    <message>
+        <source>Static</source>
+        <translation>Statique</translation>
+    </message>
+    <message>
+        <source>Transient</source>
+        <translation>Transitoire</translation>
+    </message>
     <message>
         <source>Edit a file</source>
         <translation>Affichage d'un fichier</translation>
index 6dfefe8825e4873849316ea4276ab4ece970a2ac..8aa05da1352ce2a34fc5aa8a553f7233f2d435c7 100644 (file)
         <source>HOM_MEN_INFORMATION</source>
         <translation>Information</translation>
     </message>
+    <message>
+        <source>HOM_MEN_YACS</source>
+        <translation>YACS</translation>
+    </message>
     <message>
         <source>HOM_MEN_NEW_CASE</source>
         <translation>New case</translation>
         <source>HOM_SELECT_FILE_3</source>
         <translation>This file cannot be opened.</translation>
     </message>
+    <message>
+        <source>HOM_SCRIPT_FILE</source>
+        <translation>A script file must be given.</translation>
+    </message>
     <message>
         <source>HOM_MED_FILE_1</source>
         <translation>This MED file cannot be read.</translation>
         <source>HOM_CASE_DIRECTORY_3</source>
         <translation>A valid directory for the case must be selected.</translation>
     </message>
+    <message>
+        <source>HOM_CASE_DIRECTORY_4</source>
+        <translation>A directory for the computation must be selected.</translation>
+    </message>
     <message>
         <source>HOM_CASE_MESH</source>
         <translation>The file of the initial mesh must be selected.</translation>
         <source>Number of iteration</source>
         <translation>Number of iteration</translation>
     </message>
+    <message>
+        <source>Case</source>
+        <translation>Case</translation>
+    </message>
+    <message>
+        <source>Mesh file</source>
+        <translation>Mesh File</translation>
+    </message>
+    <message>
+        <source>Static</source>
+        <translation>Static</translation>
+    </message>
+    <message>
+        <source>Transient</source>
+        <translation>Transient</translation>
+    </message>
     <message>
         <source>Edit a file</source>
         <translation>Edit a file</translation>
index 188b6ed665bdc65e2f9054b04a8e314341e1fab5..4d8214ef9ae3ccae365fdcc3dddbc89a1bf5da4b 100644 (file)
@@ -48,7 +48,7 @@ QString HOMARD_QT_COMMUN::SelectionArbreEtude(QString commentaire, int option )
 // . si le commentaire est une chaine vide, on ne tient pas compte du type de l'objet
 //   et on retourne le nom de cet objet
 // . sinon :
-//   . si l'objet est du type defini par commentaitr, retourne le nom de cet objet
+//   . si l'objet est du type defini par commentaite, retourne le nom de cet objet
 //   . sinon on retourne une QString("")
 // option :
 // . Si option = 0, ce n'est pas grave de ne rien trouver ; aucun message n'est emis
index 12d17bc13e39d67608d33eb5d4b9c41891476c45..0ba0c29d2d96527e673153f13fa16ea9d928cc9e 100644 (file)
@@ -51,6 +51,8 @@ salomeinclude_HEADERS =       \
        MeshInfo.h            \
        MonIterInfo.h         \
        IterInfo.h            \
+       MonCreateYACS.h       \
+       CreateYACS.h          \
        HOMARDGUI.h           \
        HOMARDGUI_Utils.h     \
        EditFile.h            \
@@ -81,6 +83,7 @@ dist_libHOMARD_la_SOURCES =     \
        MonEditZone.cxx         \
        MonMeshInfo.cxx         \
        MonIterInfo.cxx         \
+       MonCreateYACS.cxx       \
        MonEditFile.cxx         \
        HomardQtCommun.cxx
 
@@ -104,6 +107,7 @@ MOC_FILES =                         \
        MonPursueIteration_moc.cxx  \
        MonMeshInfo_moc.cxx         \
        MonIterInfo_moc.cxx         \
+       MonCreateYACS_moc.cxx       \
        MonEditFile_moc.cxx
 
 nodist_libHOMARD_la_SOURCES = $(MOC_FILES)
@@ -152,6 +156,7 @@ CreateZone.ui       \
 PursueIteration.ui  \
 MeshInfo.ui         \
 IterInfo.ui         \
+CreateYACS.ui  \
 EditFile.ui
 
 EXTRA_DIST += $(UI_FILES)
diff --git a/src/HOMARDGUI/MonCreateYACS.cxx b/src/HOMARDGUI/MonCreateYACS.cxx
new file mode 100644 (file)
index 0000000..6612fba
--- /dev/null
@@ -0,0 +1,199 @@
+// Copyright (C) 2011-2012  CEA/DEN, EDF R&D
+//
+// 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.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+using namespace std;
+
+#include "MonCreateYACS.h"
+
+#include <QFileDialog>
+#include <QMessageBox>
+
+#include "SalomeApp_Tools.h"
+#include "HOMARDGUI_Utils.h"
+#include "HomardQtCommun.h"
+#include <utilities.h>
+
+
+// -----------------------------------------------------------------------------------------
+/* Constructs a MonCreateYACS
+ * Sets attributes to default values
+ */
+// -----------------------------------------------------------------------------------------
+MonCreateYACS::MonCreateYACS (QWidget* parent, bool modal, HOMARD::HOMARD_Gen_var myHomardGen, QString CaseName )
+    :
+    Ui_CreateYACS(),
+    _aCaseName(CaseName),
+    _aFileNameScript(""),
+    _aDirName(""),
+    _aFileNameMesh("")
+{
+  MESSAGE("Debut du constructeur de MonCreateYACS");
+  _myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen);
+  setupUi(this);
+  setModal(modal);
+
+  InitConnect();
+
+  if (_aCaseName != QString(""))
+    { SetCaseName(); }
+  else
+    {setModal(false); /* permet selection du cas dans l arbre d etude */}
+
+  adjustSize();
+  MESSAGE("Fin du constructeur de MonCreateYACS");
+}
+
+// ------------------------------------------------------------------------
+MonCreateYACS::~MonCreateYACS()
+// ------------------------------------------------------------------------
+{
+    // no need to delete child widgets, Qt does it all for us
+}
+// ------------------------------------------------------------------------
+void MonCreateYACS::InitConnect()
+// ------------------------------------------------------------------------
+{
+    connect( PBCaseName,     SIGNAL(pressed()), this, SLOT(SetCaseName()));
+    connect( PushDir,        SIGNAL(pressed()), this, SLOT(SetDirName()));
+    connect( PushFile,       SIGNAL(pressed()), this, SLOT(SetFileNameScript()));
+    connect( PushFile_2,     SIGNAL(pressed()), this, SLOT(SetFileNameMesh()));
+
+    connect( RBStatic,       SIGNAL(clicked()), this, SLOT(FromIteration()));
+    connect( RBTransient,    SIGNAL(clicked()), this, SLOT(FromCase()));
+
+    connect( buttonOk,       SIGNAL(pressed()), this, SLOT(PushOnOK()));
+    connect( buttonApply,    SIGNAL(pressed()), this, SLOT(PushOnApply()));
+    connect( buttonCancel,   SIGNAL(pressed()), this, SLOT(close()));
+    connect( buttonHelp,     SIGNAL(pressed()), this, SLOT(PushOnHelp()));
+}
+// -------------------------------
+bool MonCreateYACS::PushOnApply()
+// --------------------------------
+{
+  MESSAGE("PushOnApply");
+
+  if ( _aCaseName == QString (""))
+  {
+    QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
+                              QObject::tr("HOM_CASE_NAME") );
+    return false;
+  }
+// Le fichier du script
+  QString aFileName=LEFileNameScript->text().trimmed();
+  if (aFileName ==QString(""))
+  {
+    QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
+                              QObject::tr("HOM_SCRIPT_FILE") );
+    return false;
+  }
+
+// Le repertoire de calcul
+  QString aDirName=LEDirName->text().trimmed();
+  if (aDirName == QString(""))
+  {
+    QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
+                              QObject::tr("HOM_CASE_DIRECTORY_4") );
+    return false;
+  }
+  if ((aDirName != _aDirName) and (_myHomardGen->VerifieDir( aDirName.toStdString().c_str()) == false))
+  {
+    QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
+                              QObject::tr("HOM_CASE_DIRECTORY_2") );
+    return false;
+  }
+  if (chdir(aDirName.toStdString().c_str()) != 0)
+  {
+    QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
+                              QObject::tr("HOM_CASE_DIRECTORY_3") );
+    return false;
+  }
+
+// Le fichier du tout premier maillage
+  aFileName=LEFileNameMesh->text().trimmed();
+  if (aFileName ==QString(""))
+  {
+    QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
+                              QObject::tr("HOM_CASE_MESH") );
+    return false;
+  }
+  QString aMeshName = HOMARD_QT_COMMUN::LireNomMaillage(aFileName);
+  if (aMeshName == "" )
+  {
+    QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
+                              QObject::tr("HOM_MED_FILE_2") );
+    return false;
+  }
+
+  HOMARD_UTILS::updateObjBrowser();
+  MESSAGE ("_aCaseName.toStdString " << _aCaseName.toStdString() );
+
+  return true;
+}
+// ---------------------------
+void MonCreateYACS::PushOnOK()
+// ---------------------------
+{
+  bool bOK = PushOnApply();
+  if ( bOK )  this->close();
+}
+//------------------------------
+void MonCreateYACS::PushOnHelp()
+//-------------------------------
+{
+  HOMARD_UTILS::PushOnHelp(QString("gui_create_case.html"), QString(""));
+}
+// ------------------------------------------------------------------------
+void MonCreateYACS::SetCaseName()
+// ------------------------------------------------------------------------
+{
+  MESSAGE ("SetCaseName avec _aCaseName = " << _aCaseName.toStdString() );
+  if (_aCaseName == QString(""))
+  {
+    _aCaseName=HOMARD_QT_COMMUN::SelectionArbreEtude(QString("CasHomard"), 1);
+    if (_aCaseName == QString("")) { raise();return;};
+  }
+/*  MESSAGE ("appel de GetCase avec _aCaseName = " << _aCaseName.toStdString() );*/
+  aCase = _myHomardGen->GetCase(_aCaseName.toStdString().c_str());
+  LECaseName->setText(_aCaseName);
+}
+// ------------------------------------------------------------------------
+void MonCreateYACS::SetDirName()
+// ------------------------------------------------------------------------
+{
+  QString aDirName=QFileDialog::getExistingDirectory ();
+  if (!(aDirName.isEmpty()))LEDirName->setText(aDirName);
+}
+// ------------------------------------------------------------------------
+void MonCreateYACS::SetFileNameScript()
+// ------------------------------------------------------------------------
+{
+  QString fileName0 = LEFileNameScript->text().trimmed();
+  QString fileName = HOMARD_QT_COMMUN::PushNomFichier(false);
+  if (fileName.isEmpty()) fileName = fileName0 ;
+  LEFileNameScript->setText(fileName);
+}
+// ------------------------------------------------------------------------
+void MonCreateYACS::SetFileNameMesh()
+// ------------------------------------------------------------------------
+{
+  QString fileName0 = LEFileNameMesh->text().trimmed();
+  QString fileName = HOMARD_QT_COMMUN::PushNomFichier(false);
+  if (fileName.isEmpty()) fileName = fileName0 ;
+  LEFileNameMesh->setText(fileName);
+}
diff --git a/src/HOMARDGUI/MonCreateYACS.h b/src/HOMARDGUI/MonCreateYACS.h
new file mode 100644 (file)
index 0000000..2f8d5e2
--- /dev/null
@@ -0,0 +1,66 @@
+// Copyright (C) 2011-2012  CEA/DEN, EDF R&D
+//
+// 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.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef MON_CREATEYACS_H
+#define MON_CREATEYACS_H
+
+#include <SALOMEconfig.h>
+#include <SalomeApp_Module.h>
+
+#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
+#include CORBA_CLIENT_HEADER(HOMARD_Gen)
+#include CORBA_CLIENT_HEADER(HOMARD_Cas)
+
+#include <CreateYACS.h>
+#include <QWidget>
+
+class MonCreateYACS : public QDialog, public Ui_CreateYACS
+{
+    Q_OBJECT
+
+  public:
+    MonCreateYACS( QWidget* parent, bool modal, HOMARD::HOMARD_Gen_var myHomardGen, QString CaseName);
+    virtual ~MonCreateYACS();
+
+  protected :
+    QString _aCaseName;
+    QString _aFileNameScript;
+    QString _aDirName;
+    QString _aFileNameMesh;
+
+
+    HOMARD::HOMARD_Cas_var aCase ;
+    HOMARD::HOMARD_Gen_var _myHomardGen;
+
+    virtual void InitConnect();
+
+  public slots:
+    virtual void SetCaseName();
+    virtual void SetDirName();
+
+    virtual void SetFileNameScript();
+    virtual void SetFileNameMesh();
+
+    virtual void PushOnOK();
+    virtual bool PushOnApply();
+    virtual void PushOnHelp();
+
+};
+
+#endif // MON_CREATEYACS_H
index d89500137534872c38442ebfc39c47e989fd5561..599b04ac717a9f6c8fe7f46749f1a9bdc83bd128 100644 (file)
@@ -32,7 +32,6 @@ using namespace std;
 
 // -----------------------------------------------------------------------------------------
 /* Constructs a MonPursueIteration
- * Inherits from CasHomard
  * Sets attributes to default values
  */
 // -----------------------------------------------------------------------------------------