[171] | 1 | //! \file OrderWindow.cpp |
---|
| 2 | //! \brief Implementation of the OrderWindow window for visual_YAO. |
---|
[460] | 3 | //! \version 2010/10/21 (yyyy/mm/dd) |
---|
[341] | 4 | //! \author MAYAKI Abdouramane. |
---|
[171] | 5 | |
---|
| 6 | /* |
---|
| 7 | Nom du Fichier: OrderWindow.cpp |
---|
| 8 | Nom de classe: OrderWindow |
---|
| 9 | Role: |
---|
| 10 | Nombre de methodes: |
---|
| 11 | Nombre d'attributs: |
---|
| 12 | */ |
---|
| 13 | |
---|
[315] | 14 | #include "include/OrderWindow.hpp" |
---|
[171] | 15 | |
---|
[400] | 16 | using namespace std; |
---|
| 17 | using namespace yao; |
---|
[171] | 18 | //! \class OrderWindow(QWidget *parent) : QWidget(parent) |
---|
| 19 | //! \brief Implementation of the Order window for visual_YAO. |
---|
| 20 | |
---|
[400] | 21 | /***************************************** Implementation of the Construtor OrderWindow() *************************************************/ |
---|
[471] | 22 | OrderWindow::OrderWindow(Table <Trajectory> *aTrajectoryTable, Table <Space> *aSpaceTable, Table <Operator> *anOperatorTable, Table <Modul> *aModulTable, Table <Order> *anOrderTable, QWidget *parent) : stateOfSpaceintrajEndCheckBox(false), QWidget(parent) { |
---|
[171] | 23 | |
---|
[341] | 24 | setupUi(this); |
---|
[442] | 25 | |
---|
[471] | 26 | m_localTrajectoryTable = aTrajectoryTable; |
---|
| 27 | m_localSpaceTable = aSpaceTable; |
---|
| 28 | m_localOperaTable = anOperatorTable; |
---|
| 29 | m_localModulTable = aModulTable; |
---|
| 30 | m_localOrderTable = anOrderTable; |
---|
[442] | 31 | /* |
---|
[350] | 32 | setFixedWidth(baseSize().width() + 765); |
---|
[419] | 33 | m_comboTrajName->insertItem(0, ""); |
---|
[357] | 34 | |
---|
[471] | 35 | for (Table<Trajectory>::iterator it = m_localTrajectoryTable->begin(); it != m_localTrajectoryTable->end(); it++) { |
---|
[419] | 36 | m_comboTrajName->insertItem(1, QString(it->getName().c_str())); |
---|
| 37 | } |
---|
| 38 | |
---|
[471] | 39 | for (Table<Space>::iterator it = m_localSpaceTable->begin(); it != m_localSpaceTable->end(); it++) { |
---|
[419] | 40 | |
---|
| 41 | m_comboSpaceOrOperaName->insertItem(1, QString(it->getName().c_str())); |
---|
| 42 | m_comboSpaceName->insertItem(1, QString(it->getName().c_str())); |
---|
| 43 | } |
---|
[442] | 44 | */ |
---|
| 45 | |
---|
| 46 | //m_orderModel = new QStandardItemModel(0, 5); |
---|
| 47 | //m_choiceComboBox = new QComboBox; |
---|
| 48 | m_choiceComboBox->addItem(tr("modinspace")); |
---|
| 49 | m_choiceComboBox->addItem(tr("spaceintraj")); |
---|
| 50 | |
---|
| 51 | //m_modinspaceRadioButton = new QRadioButton("modinspace"); |
---|
| 52 | //m_spaceintrajRadioButton = new QRadioButton("spaceintraj"); |
---|
[471] | 53 | ModinspaceWindow *misw = new ModinspaceWindow(m_localModulTable, m_localSpaceTable, m_localOperaTable, m_localOrderTable); |
---|
| 54 | SpaceintrajWindow *sitw = new SpaceintrajWindow(m_localTrajectoryTable, m_localSpaceTable, m_localOperaTable); |
---|
[442] | 55 | //sitw->show(); |
---|
[419] | 56 | |
---|
[442] | 57 | //horizontalLayout = new QHBoxLayout; |
---|
| 58 | // horizontalLayout->addWidget(m_modinspaceRadioButton); |
---|
| 59 | // horizontalLayout->addWidget(m_spaceintrajRadioButton); |
---|
| 60 | |
---|
| 61 | stackedLayout = new QStackedLayout(m_mainFrame); |
---|
| 62 | stackedLayout->addWidget(misw); |
---|
| 63 | stackedLayout->addWidget(sitw); |
---|
[419] | 64 | |
---|
[442] | 65 | |
---|
| 66 | //mainLayout = new QVBoxLayout; |
---|
| 67 | //mainLayout->addWidget(m_choiceComboBox); |
---|
| 68 | // mainLayout->addLayout(stackedLayout); |
---|
| 69 | //setLayout(mainLayout); |
---|
| 70 | |
---|
| 71 | |
---|
| 72 | //setFixedWidth(baseSize().width() + 765); |
---|
| 73 | //resize(645, 540); |
---|
| 74 | connect(m_choiceComboBox, SIGNAL(activated(int )), stackedLayout, SLOT(setCurrentIndex(int ))); |
---|
[459] | 75 | connect(m_helpButton, SIGNAL(clicked()), this, SLOT(theOrderHelp())); |
---|
| 76 | //connect(m_validationButton, SIGNAL(clicked()), this, SLOT(close())); |
---|
[442] | 77 | connect(m_quitButton, SIGNAL(clicked()), this, SLOT(close())); |
---|
[459] | 78 | |
---|
| 79 | connect(sitw, SIGNAL(theEndSignal(bool)), this, SLOT(initializeTheCheckBox(bool))); |
---|
| 80 | |
---|
[171] | 81 | } |
---|
[459] | 82 | /*********************************************************************/ |
---|
| 83 | void OrderWindow::initializeTheCheckBox(bool) { |
---|
| 84 | |
---|
| 85 | stateOfSpaceintrajEndCheckBox = true; |
---|
| 86 | cout << "coché" << endl; |
---|
| 87 | } |
---|
| 88 | /*********************************************************************/ |
---|
| 89 | void OrderWindow::theOrderHelp() { |
---|
| 90 | |
---|
[469] | 91 | QMessageBox::about(this, tr("Aide sur la directive Order"), ("Order permet d'indiquer l'enchainement, l'ordre de calcul dans YAO. Il existent deux cas d'utilisation: modinspace et spaceintraj. Les étapes à suivre sont les suivantes: <br> Faire un choix dans le champ deroulant \"modinspace/spaceintraj\"; <br> Pour le cas de modinspace, indiquer d'abord les coordonnées (possibilité de répeter les operations), ensuite les modules (possibilité de faire plusieurs opérations) et enfin préciser la condition d'arrêt.<br> Pour le cas de spaceintraj, choisir respectivement la trajectoire, les espaces et cocher la case \"Fin de saisie\".")); |
---|
[356] | 92 | |
---|
[459] | 93 | } |
---|
[400] | 94 | /**************************************************** Implementation of cloveEvent() method. ***********************************************/ |
---|
[351] | 95 | void OrderWindow::closeEvent(QCloseEvent *event) { |
---|
| 96 | |
---|
| 97 | emit orderWindowIsClosed(10); |
---|
| 98 | } |
---|
[356] | 99 | |
---|
| 100 | /***********************************************************************/ |
---|
[442] | 101 | |
---|
| 102 | /***********************************************************************/ |
---|
| 103 | /***********************************************************************/ |
---|