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

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

After working on the visual Yao script (called "configure"), some updates are made in the modinspace class (data are added in the Yao structures depending on the space or the operator.) Visual Yao.

File size: 4.4 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) {
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        setFixedWidth(baseSize().width() + 765);
33        m_comboTrajName->insertItem(0, "");
34       
35        for (Table<Trajectory>::iterator it = m_localTrajectoryTable->begin(); it != m_localTrajectoryTable->end(); it++) {
36                m_comboTrajName->insertItem(1, QString(it->getName().c_str()));
37        }       
38
39        for (Table<Space>::iterator it = m_localSpaceTable->begin(); it != m_localSpaceTable->end(); it++) {
40               
41                m_comboSpaceOrOperaName->insertItem(1, QString(it->getName().c_str()));
42                m_comboSpaceName->insertItem(1, QString(it->getName().c_str()));       
43        }
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");     
53        ModinspaceWindow *misw          = new ModinspaceWindow(m_localModulTable, m_localSpaceTable, m_localOperaTable, m_localOrderTable); 
54        SpaceintrajWindow *sitw         = new SpaceintrajWindow(m_localTrajectoryTable, m_localSpaceTable, m_localOperaTable);
55                //sitw->show();
56       
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);
64       
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 )));
75        connect(m_helpButton, SIGNAL(clicked()), this, SLOT(theOrderHelp()));
76        //connect(m_validationButton, SIGNAL(clicked()), this, SLOT(close()));
77        connect(m_quitButton, SIGNAL(clicked()), this, SLOT(close()));
78
79        connect(sitw, SIGNAL(theEndSignal(bool)), this, SLOT(initializeTheCheckBox(bool)));
80
81}
82/*********************************************************************/
83void OrderWindow::initializeTheCheckBox(bool) {
84       
85        stateOfSpaceintrajEndCheckBox = true;
86        cout << "coché" << endl;
87}
88/*********************************************************************/
89void OrderWindow::theOrderHelp() {
90       
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\"."));
92
93}
94/**************************************************** Implementation of cloveEvent() method. ***********************************************/
95void OrderWindow::closeEvent(QCloseEvent *event) {
96
97        emit orderWindowIsClosed(10);
98}
99
100/***********************************************************************/
101
102/***********************************************************************/
103/***********************************************************************/
Note: See TracBrowser for help on using the repository browser.