Changeset 449 in PSPA


Ignore:
Timestamp:
Dec 12, 2013, 12:14:25 PM (10 years ago)
Author:
garnier
Message:

Modifications en vue de changer l'interface utilisateur

Location:
Interface_Web/trunk/pspaWT
Files:
2 deleted
18 edited

Legend:

Unmodified
Added
Removed
  • Interface_Web/trunk/pspaWT/History

    r443 r449  
    55     PSPA - Plateforme de simulation en physique des accélérateurs
    66     =========================================================
     7
     812 Décembre 2013 : Laurent Garnier
     9Modifications en vue de changer l'interface utilisateur :
     10- GWt_softwarePanel : Changement du container parent
     11- GWt_sector : Nouvelle classe pour gérer les secteur au niveau UI
     12- GWt_accelerator : Nouvelle classe pour gérer les accelerateurs au niveau UI
     13- PspaApplication : Nouveau layout (suppression de la grille de fond)
     14- GWt_LigneFaisceau, GWt_elementLigneFaisceau, GWt_console
     15 - Changements mineurs
     16- GWt_dropZoneLigneFaisceau : Changement de comportement du drop
     17- dataManager : Ajout de méthode pour ajouter un secteur addNewSector() et du
     18  vecteur de sector associé.
     19- sector : Changement des noms setReflectedFrom en setDuplicatedFrom
     20
     21Ajout de la classe Section et quelques modifications dans le pspa.css
     22
    72311 Décembre 2013 : Laurent Garnier
    8 - Ajout de la classe Section et quelques modiications dans le pspa.css
     24- Ajout de la classe Section et quelques modifications dans le pspa.css
    925
    102621 juin 2013  : Guy Le Meur
  • Interface_Web/trunk/pspaWT/cmt/requirements

    r443 r449  
    6565 ../sources/userInterface/src/GWt_draggableImage.cc \
    6666 ../sources/userInterface/src/GWt_serverFileSelector.cc \
     67 ../sources/userInterface/src/GWt_sector.cc \
     68 ../sources/userInterface/src/GWt_accelerator.cc \
    6769 ../sources/userInterface/src/GWt_sectionToExecute.cc
    6870 
  • Interface_Web/trunk/pspaWT/sources/controler/include/dataManager.h

    r431 r449  
    1313#include "parmelaParticle.h"
    1414#include "nomDeLogiciel.h"
     15#include "sector.h"
    1516
    1617#include "sectorParameters.h" //xx
     
    4142  abstractElement* addElement(nomdElements::typedElement elemType);
    4243  void removeElement(string);
     44 
     45/** Add a new sector
     46 */
     47  sector* addNewSector();
     48 
     49  /** return all sectors
     50   */
     51  inline std::vector <sector*> getSectors() {return sectors_;};
    4352 
    4453  /**
     
    102111  vector<unsigned> indexElementToIndexDiag_;
    103112  vector<sectionToExecute*> jobList_;
    104  
     113  vector <sector*> sectors_;
    105114  void removeFile(string nameOfFile);
    106115  void clearSectionToExecute();
  • Interface_Web/trunk/pspaWT/sources/controler/include/sector.h

    r443 r449  
    99  public :
    1010 
    11   sector();
     11  sector(std::string name = "sector default name");
    1212  virtual ~sector();
    1313  /**
     
    2121
    2222  /**
    23    Set the original sector from where this sector is reflected
     23   Set the original sector from where this sector is reflected/duplicated
    2424   */
    25   inline void setReflectedFrom(sector* s) { reflectedFrom_ = s;};
     25  inline void setDuplicatedFrom(sector* s) { duplicatedFrom_ = s;};
    2626  /**
    27    Get the original sector from where this sector is reflected. return NULL if not
     27   Get the original sector from where this sector is reflected/duplicated. Return NULL if not
    2828   */
    29   inline sector* getReflectedFrom() { return reflectedFrom_;};
     29  inline sector* getDuplicatedFrom() { return duplicatedFrom_;};
    3030
    3131
     
    7878  std::string name_;
    7979  bool reflected_;
    80   sector* reflectedFrom_;
     80  sector* duplicatedFrom_;
    8181  unsigned int repetitionNumber_;
    8282};
  • Interface_Web/trunk/pspaWT/sources/controler/src/dataManager.cc

    r442 r449  
    441441  }
    442442}
     443
     444sector* dataManager::addNewSector() {
     445  std::stringstream str;
     446  str << getSectors().size()+1;
     447  std::string result;
     448  str >> result;
     449 
     450  sector* sect = new sector(std::string("sector ") + result);
     451  sectors_.push_back(sect);
     452  return sect;
     453}
     454
  • Interface_Web/trunk/pspaWT/sources/controler/src/sector.cc

    r444 r449  
    99#include "sector.h"
    1010
    11 sector::sector():
     11sector::sector(std::string name):
    1212reflected_(false),
    13 reflectedFrom_(NULL),
    14 repetitionNumber_(1)
     13duplicatedFrom_(NULL),
     14repetitionNumber_(1),
     15name_(name)
    1516{
    1617 
  • Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_console.h

    r437 r449  
    1515   
    1616public:
    17   GWt_console();
     17  GWt_console(WContainerWidget* parent);
    1818  virtual ~GWt_console();
    1919  void addConsoleMessage(WString msg);
  • Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_dropZoneLigneFaisceau.h

    r437 r449  
    33
    44#include "GWt_pspaApplication.h"
     5#include "GWt_LigneFaisceau.h"
    56
    67#include <Wt/WContainerWidget>
     
    1314    public :
    1415   
    15     GWt_dropZoneLigneFaisceau(PspaApplication* pspa_);
     16    GWt_dropZoneLigneFaisceau(PspaApplication* pspa_,GWt_LigneFaisceau* parent);
    1617    ~GWt_dropZoneLigneFaisceau();
    17    
     18    inline GWt_LigneFaisceau* getParent() {return parent_;};
     19
    1820private:
    1921    void initialise( PspaApplication* pspa);
     
    2426    void mouseIsDragged(const WMouseEvent &e );
    2527    void dropEvent(WDropEvent evt);
     28
     29  GWt_LigneFaisceau* parent_;
    2630};
    2731#endif
  • Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_elementLigneFaisceau.h

    r437 r449  
    3131     */
    3232   
    33     GWt_elementLigneFaisceau(PspaApplication*);
    34     GWt_elementLigneFaisceau(nomdElements::typedElement,PspaApplication*);
     33    GWt_elementLigneFaisceau(PspaApplication*,GWt_LigneFaisceau*);
     34    GWt_elementLigneFaisceau(nomdElements::typedElement,PspaApplication*,GWt_LigneFaisceau*);
    3535   
    3636    ~GWt_elementLigneFaisceau();
     
    6767    void removeDone(GWt_abstractElement*);
    6868    std::string getElementNumberInBeamLine(nomdElements el);
    69     void initialize_ligneFaisceau(nomdElements::typedElement eType);
     69    void initialize_ligneFaisceau(nomdElements::typedElement eType,GWt_LigneFaisceau* ligne);
    7070    void mouseWentOut();
    7171    void mouseWentOver();
  • Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_ligneFaisceau.h

    r437 r449  
    2626class GWt_LigneFaisceau : public WContainerWidget
    2727{
    28     WHBoxLayout* ligneFaisceauLayout_;
    2928    PspaApplication* pspa_;
    3029   
     
    8685    void manageLineFaisceauLayout();
    8786    GWt_dropZoneLigneFaisceau* allDropZone_;
    88    
     87    WHBoxLayout* ligneFaisceauLayout_;
    8988};
    9089
  • Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_pspaApplication.h

    r437 r449  
    7272     
    7373  WText* createTitle(const WString&);
    74   WWidget* createPalette();
     74  WWidget* createPalette(WContainerWidget* parent);
    7575  WWidget* createBeamLine();
    7676  WWidget* createExecuteWidget();
    7777  WContainerWidget* createDrawingWidget();
    7878
    79   WWidget* createDashBoard();
     79  WWidget* createDashBoard(WContainerWidget*);
    8080  void messageBox1();
    8181  void messageBox2();
  • Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_softwarePanel.h

    r437 r449  
    2525 public :
    2626 
    27   GWt_softwarePanel(dataManager*, PspaApplication*);
     27  GWt_softwarePanel(dataManager*, PspaApplication*,WContainerWidget*);
    2828  virtual ~GWt_softwarePanel();
    2929
  • Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_console.cc

    r427 r449  
    1313
    1414
    15 GWt_console::GWt_console() : WContainerWidget()
     15GWt_console::GWt_console(WContainerWidget* parent) : WContainerWidget(parent)
    1616{
    1717  setObjectName("console");
  • Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_dropZoneLigneFaisceau.cc

    r437 r449  
    1010#include "nomdElements.h"
    1111
    12 GWt_dropZoneLigneFaisceau::GWt_dropZoneLigneFaisceau( PspaApplication* pspa)
    13   : WContainerWidget()
     12GWt_dropZoneLigneFaisceau::GWt_dropZoneLigneFaisceau( PspaApplication* pspa,GWt_LigneFaisceau* parent)
     13  : WContainerWidget(),
     14parent_(parent)
    1415{
    1516  initialise(pspa);
     
    6263void GWt_dropZoneLigneFaisceau::dropEvent(WDropEvent evt)
    6364{
    64   // get LigneFaiseau widget and add new elementLigneFaiseau
    65   GWt_LigneFaisceau* ligneFaisceau = NULL;
    66   if ( static_cast<GWt_LigneFaisceau*> (wApp->findWidget ("ligneFaisceau"))) {
    67     ligneFaisceau = static_cast<GWt_LigneFaisceau*> (wApp->findWidget ("ligneFaisceau"));
    68   } else {
    69     return;
    70   }
    71  
    7265  // get the type of element
    7366  nomdElements e(evt.mimeType());
    7467  nomdElements::typedElement eType = e.getElementType();
    75   ligneFaisceau->addElement(eType, this);
     68  getParent()->addElement(eType, this);
    7669}
    7770
  • Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_elementLigneFaisceau.cc

    r437 r449  
    1919#define PSPA_DEBUG 1
    2020
    21 GWt_elementLigneFaisceau::GWt_elementLigneFaisceau(PspaApplication* pspa)
     21GWt_elementLigneFaisceau::GWt_elementLigneFaisceau(PspaApplication* pspa,GWt_LigneFaisceau* ligne)
    2222  : WContainerWidget(),
    2323    firstTimeInsertMessage_(NULL),
     
    2828    pspa_(pspa)
    2929{
    30   initialize_ligneFaisceau(nomdElements::inconnu);
    31 }
    32 
    33 
    34 GWt_elementLigneFaisceau::GWt_elementLigneFaisceau(nomdElements::typedElement type,PspaApplication* pspa)
     30  initialize_ligneFaisceau(nomdElements::inconnu,ligne);
     31}
     32
     33
     34GWt_elementLigneFaisceau::GWt_elementLigneFaisceau(nomdElements::typedElement type,PspaApplication* pspa,GWt_LigneFaisceau* ligne)
    3535  : WContainerWidget(),
    3636    firstTimeInsertMessage_(NULL),
     
    4343  // set the css name
    4444  setObjectName("elementLigneFaisceau");
    45   initialize_ligneFaisceau(type);
    46 }
    47 
    48 void GWt_elementLigneFaisceau::initialize_ligneFaisceau(nomdElements::typedElement eType)
     45  initialize_ligneFaisceau(type,ligne);
     46}
     47
     48void GWt_elementLigneFaisceau::initialize_ligneFaisceau(nomdElements::typedElement eType,GWt_LigneFaisceau* ligne)
    4949{   
    5050  cout << " new GWt_elementLigneFaisceau : "<< nomdElements::getLabelFromType(eType) << endl;
     
    6262 
    6363  // add first line :  initialize arrow and link images
    64   dropZoneLeft_ = new GWt_dropZoneLigneFaisceau(pspa_);
    65   dropZoneRight_ = new GWt_dropZoneLigneFaisceau(pspa_);
     64  dropZoneLeft_ = new GWt_dropZoneLigneFaisceau(pspa_,ligne);
     65  dropZoneRight_ = new GWt_dropZoneLigneFaisceau(pspa_,ligne);
    6666 
    6767  // change object name in order to manage css :
     
    7373 
    7474  // add first line :  initialize arrow and link images
    75   dropZoneLeft_ = new GWt_dropZoneLigneFaisceau(pspa_);
    76   dropZoneRight_ = new GWt_dropZoneLigneFaisceau(pspa_);
     75  dropZoneLeft_ = new GWt_dropZoneLigneFaisceau(pspa_,ligne);
     76  dropZoneRight_ = new GWt_dropZoneLigneFaisceau(pspa_,ligne);
    7777 
    7878  // change object name in order to manage css :
  • Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_ligneFaisceau.cc

    r437 r449  
    1616{
    1717 
    18   cout<<"GWt_LigneFaisceau::GWt_LigneFaisceau() %d"<< this << "<---------------"<< endl;
    19    
    2018  ligneFaisceauLayout_ = new WHBoxLayout();
    21   //  decorationStyle().setBackgroundColor (WColor(245,245,245));
    2219  ligneFaisceauLayout_->setContentsMargins(0,0,0,0);
    2320  ligneFaisceauLayout_->setSpacing(0);
     
    3734  // add the first drop zone
    3835  decorationStyle().setBorder (WBorder (WBorder::Dotted));
    39   allDropZone_ = new GWt_dropZoneLigneFaisceau(pspa_);
     36  allDropZone_ = new GWt_dropZoneLigneFaisceau(pspa_,this);
    4037  WVBoxLayout* fit = new WVBoxLayout();
    4138  allDropZone_->setLayout(fit);
     
    7774      ligneFaisceauLayout_->clear();
    7875      // add first element
    79       GWt_elementLigneFaisceau* elemLigneFaisceau = new GWt_elementLigneFaisceau(eType,pspa_);
     76      GWt_elementLigneFaisceau* elemLigneFaisceau = new GWt_elementLigneFaisceau(eType,pspa_,this);
    8077      ligneFaisceauLayout_->addWidget(elemLigneFaisceau,1);
    8178      GWtAbstractElem = elemLigneFaisceau->getGWt_AbstractElement();
     
    10198   
    10299    //  ligneFaisceauLayout_->addWidget(new GWt_elementLigneFaiseau(ptr),0);
    103     GWt_elementLigneFaisceau* elemLigneFaisceau = new GWt_elementLigneFaisceau(eType, pspa_);
     100    GWt_elementLigneFaisceau* elemLigneFaisceau = new GWt_elementLigneFaisceau(eType, pspa_,this);
    104101    if (index != -1) {
    105102      ligneFaisceauLayout_->insertWidget(index,elemLigneFaisceau,1);
  • Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_pspaApplication.cc

    r437 r449  
    66#include "GWt_abstractElementFactory.h"
    77#include "GWt_serverFileSelector.h"
     8#include "GWt_accelerator.h"
    89#include "particleBeam.h"
    910#include "bareParticle.h"
     
    2728#include <Wt/WRadioButton>
    2829#include <Wt/WMessageBox>
     30#include <Wt/WScrollArea>
     31#include <Wt/WLabel>
    2932
    3033#define HAS_IMAGEMAGIC 1
     
    6669 
    6770  // include the styleSheetcd
    68   WContainerWidget *widroot = root();
     71  WContainerWidget *mainContainerWidget = root();
    6972  useStyleSheet("htdocs/pspa.css");
    7073  dtmanage_ = new dataManager(this);
    7174
    7275  // The main layout is a 4x3 grid layout.
    73   WGridLayout *mainGridLayout = new WGridLayout(); 
    7476  WHBoxLayout *toolbarLayout = new WHBoxLayout();
    7577 
     
    116118  toolbarLayout->addWidget(new WText("") , 1,Wt::AlignMiddle);
    117119 
     120  WGridLayout* gridLayout = new WGridLayout(mainContainerWidget);
     121
    118122  WContainerWidget * toolbarLayoutContainer = new WContainerWidget();
    119123  toolbarLayoutContainer->setLayout(toolbarLayout);
    120124  toolbarLayoutContainer->decorationStyle().setBackgroundImage ("/htdocs/fond_toolbar.png");
    121    
    122   mainGridLayout->addWidget(toolbarLayoutContainer, 1, 0, 1, 3);
    123   mainGridLayout->addWidget(createPalette(), 2, 0, 4, 1);
    124 
    125   WScrollArea* scroll = new  WScrollArea();
     125  // menu menu on the top
     126  gridLayout->addWidget(toolbarLayoutContainer, 1,0,1,2);
     127  // palette on the left
     128  gridLayout->addWidget(createPalette(mainContainerWidget), 2, 0);
     129 
     130  // create accelerator main widget
     131  WContainerWidget* acceleratorContainerWidget = new WContainerWidget();
     132  gridLayout->addWidget(acceleratorContainerWidget, 2, 1);
     133
     134  // Let column 2 take the excess space.
     135  gridLayout->setColumnStretch(1,1);
     136  // Let row 1 take the excess space.
     137  gridLayout->setRowStretch(2,1);
     138
     139 
     140  GWt_accelerator* accel = new GWt_accelerator(acceleratorContainerWidget,this);
     141  new WBreak(acceleratorContainerWidget);
     142
     143  WScrollArea* scroll = new  WScrollArea(acceleratorContainerWidget);
    126144  scroll->setWidget(createBeamLine());
    127145  scroll->setMinimumSize(300,150);
    128   mainGridLayout->addWidget(scroll, 2, 1, 1, 2);
    129 
     146
     147  new WBreak(acceleratorContainerWidget);
    130148  //-----------
    131149
     
    136154  globalParam_ = new GWt_globalParameters(dtmanage_);
    137155  sectorParam_ = new GWt_sectorParameters(dtmanage_);
    138   WWidget* dboard = createDashBoard();
     156  WWidget* dboard = createDashBoard(acceleratorContainerWidget);
    139157  dboard->setMinimumSize(300,100);
    140   mainGridLayout->addWidget(dboard,3,1);
     158
     159  new WBreak(acceleratorContainerWidget);
     160
    141161  //-----------
    142162
     
    146166  graphicsDialog_->hide();
    147167 
    148   executeWidget_ = new GWt_softwarePanel(dtmanage_,this);
     168  executeWidget_ = new GWt_softwarePanel(dtmanage_,this,acceleratorContainerWidget);
    149169  executeWidget_->setMinimumSize(400,100);
    150   mainGridLayout->addWidget(executeWidget_,4,1);
    151  
    152   console_ = new GWt_console();
     170 
     171  new WBreak(acceleratorContainerWidget);
     172 
     173  console_ = new GWt_console(acceleratorContainerWidget);
    153174  console_->setMinimumSize(300,100);
    154   mainGridLayout->addWidget(console_,3,2,2,1);
    155 
    156   // Let row 2 and column 1 take the excess space.
    157   mainGridLayout->setRowStretch(4,1);
    158   mainGridLayout->setColumnStretch(2,1);
    159  
    160   widroot->setLayout(mainGridLayout);
     175
     176 
    161177  // set auto scrollbar if needed
    162   widroot->setOverflow(WContainerWidget::OverflowAuto);
    163 }
    164 
    165 WWidget* PspaApplication::createDashBoard()
     178  mainContainerWidget->setOverflow(WContainerWidget::OverflowAuto);
     179}
     180
     181WWidget* PspaApplication::createDashBoard(WContainerWidget* parent)
    166182{
    167183  WContainerWidget *wt= new WContainerWidget();
     
    185201  cnt->addWidget(wt);
    186202
    187   WContainerWidget *result = new WContainerWidget();
     203  WContainerWidget *result = new WContainerWidget(parent);
    188204  WPanel *panel = new WPanel(result);
    189205  panel->setTitle("dashboard");
     
    207223}
    208224
    209 WWidget* PspaApplication::createPalette()
    210 {
    211   WContainerWidget* palette = new WContainerWidget();
     225WWidget* PspaApplication::createPalette(WContainerWidget* parent)
     226{
     227  WContainerWidget* palette = new WContainerWidget(parent);
    212228  vector <GWt_abstractElement*> elems = abstractElementFactory_->getAllElements();
    213229  for (unsigned a = 0; a < elems.size(); a++) {
  • Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_softwarePanel.cc

    r442 r449  
    2323#define BAVARD 0
    2424
    25 GWt_softwarePanel::GWt_softwarePanel(dataManager* dataManager,PspaApplication* pspa)
    26   : WContainerWidget()
     25GWt_softwarePanel::GWt_softwarePanel(dataManager* dataManager,PspaApplication* pspa,WContainerWidget* parent)
     26  : WContainerWidget(parent)
    2727{
    2828  dtmanage_ = dataManager;
Note: See TracChangeset for help on using the changeset viewer.