source: trunk/yao/src/interface/src/OrderWindow.cpp @ 472

Last change on this file since 472 was 472, checked in by yerima, 14 years ago

The common object witch is the "Order" is present present both in the modinspace window than in the spaceintraj one according to the grammar. So some updates are made in those three class (OrderWindow?, ModinspaceWindow? and SpaceintrajWindow?).Visual Yao

File size: 4.5 KB
Line 
1//! \file    OrderWindow.cpp
2//! \brief   Implementation of the OrderWindow window for visual_YAO.
3//! \version 2010/10/21 (yyyy/mm/dd)
4//! \author  MAYAKI Abdouramane.
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
14#include "include/OrderWindow.hpp"
15
16using namespace std;
17using namespace yao;
18//! \class OrderWindow(QWidget *parent) : QWidget(parent)
19//! \brief Implementation of the Order window for visual_YAO.
20
21/***************************************** Implementation of the Construtor OrderWindow() *************************************************/
22OrderWindow::OrderWindow(Table <Trajectory> *aTrajectoryTable, Table <Space> *aSpaceTable, Table <Operator> *anOperatorTable, Table <Modul> *aModulTable,  Table <Order> *anOrderTable, QWidget *parent) : stateOfSpaceintrajEndCheckBox(false), QWidget(parent), m_localOrder(m_localModulTable) {
23
24        setupUi(this);
25       
26        m_localTrajectoryTable          = aTrajectoryTable;
27        m_localSpaceTable               = aSpaceTable;
28        m_localOperaTable               = anOperatorTable;
29        m_localModulTable               = aModulTable;
30        m_localOrderTable               = anOrderTable;
31       
32        /*
33        setFixedWidth(baseSize().width() + 765);
34        m_comboTrajName->insertItem(0, "");
35       
36        for (Table<Trajectory>::iterator it = m_localTrajectoryTable->begin(); it != m_localTrajectoryTable->end(); it++) {
37                m_comboTrajName->insertItem(1, QString(it->getName().c_str()));
38        }       
39
40        for (Table<Space>::iterator it = m_localSpaceTable->begin(); it != m_localSpaceTable->end(); it++) {
41               
42                m_comboSpaceOrOperaName->insertItem(1, QString(it->getName().c_str()));
43                m_comboSpaceName->insertItem(1, QString(it->getName().c_str()));       
44        }
45        */
46
47        //m_orderModel                  = new QStandardItemModel(0, 5);
48        //m_choiceComboBox              = new QComboBox;
49                m_choiceComboBox->addItem(tr("modinspace"));           
50                m_choiceComboBox->addItem(tr("spaceintraj"));           
51
52        //m_modinspaceRadioButton               = new QRadioButton("modinspace");
53        //m_spaceintrajRadioButton      = new QRadioButton("spaceintraj");     
54        ModinspaceWindow *misw          = new ModinspaceWindow(m_localModulTable, m_localSpaceTable, m_localOperaTable, m_localOrderTable, &m_localOrder); 
55        SpaceintrajWindow *sitw         = new SpaceintrajWindow(m_localTrajectoryTable, m_localSpaceTable, m_localOperaTable, &m_localOrder);
56                //sitw->show();
57       
58        //horizontalLayout              = new QHBoxLayout;
59        //      horizontalLayout->addWidget(m_modinspaceRadioButton);
60        //      horizontalLayout->addWidget(m_spaceintrajRadioButton);
61
62        stackedLayout                   = new QStackedLayout(m_mainFrame);
63                 stackedLayout->addWidget(misw);
64                 stackedLayout->addWidget(sitw);
65       
66       
67        //mainLayout = new QVBoxLayout;
68                //mainLayout->addWidget(m_choiceComboBox);
69        //      mainLayout->addLayout(stackedLayout);
70        //setLayout(mainLayout);
71       
72       
73        //setFixedWidth(baseSize().width() + 765);
74        //resize(645, 540);
75        connect(m_choiceComboBox, SIGNAL(activated(int )), stackedLayout, SLOT(setCurrentIndex(int )));
76        connect(m_helpButton, SIGNAL(clicked()), this, SLOT(theOrderHelp()));
77        //connect(m_validationButton, SIGNAL(clicked()), this, SLOT(close()));
78        connect(m_quitButton, SIGNAL(clicked()), this, SLOT(close()));
79
80        connect(sitw, SIGNAL(theEndSignal(bool)), this, SLOT(initializeTheCheckBox(bool)));
81
82}
83/*********************************************************************/
84void OrderWindow::initializeTheCheckBox(bool) {
85       
86        stateOfSpaceintrajEndCheckBox = true;
87        cout << "coché" << endl;
88}
89/*********************************************************************/
90void OrderWindow::theOrderHelp() {
91       
92        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\"."));
93
94}
95/**************************************************** Implementation of cloveEvent() method. ***********************************************/
96void OrderWindow::closeEvent(QCloseEvent *event) {
97
98        emit orderWindowIsClosed(10);
99}
100
101/***********************************************************************/
102
103/***********************************************************************/
104/***********************************************************************/
Note: See TracBrowser for help on using the repository browser.