Changeset 126 in PSPA for Interface_Web/trunk/pspaWT/include


Ignore:
Timestamp:
Dec 3, 2012, 5:53:56 PM (12 years ago)
Author:
touze
Message:

use factory & create new class nomdElements

Location:
Interface_Web/trunk/pspaWT/include
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • Interface_Web/trunk/pspaWT/include/GWt_LigneFaisceau.h

    r118 r126  
    2727  WHBoxLayout* beamLayout_;
    2828  PspaApplication* pspa_;
    29   Compteur *nObjets_[nElements];
     29  //Compteur *nObjets_[nElements];
     30  Compteur *nObjets_;
    3031
    31 
    32   string createLabel(abstractElement* elem, int n);
     32  //string createLabel(abstractElement* elem, int n);
     33  string createLabel(nomdElements el,int n);
    3334
    3435 public :
     36
    3537  GWt_LigneFaisceau(PspaApplication*);
    3638  void restoreElementCollection();
    3739
    3840 private :
     41
    3942  void dropEvent(WDropEvent evt);
    4043};
    4144
    42 
    4345#endif
  • Interface_Web/trunk/pspaWT/include/GWt_abstractElement.h

    r118 r126  
    55#include "abstractElement.h"
    66
    7 #include <Wt/WContainerWidget>
    87#include <Wt/WDialog>
    98#include <Wt/WPushButton>
     9#include <Wt/WContainerWidget>
    1010
    1111#include <iostream>
     
    3434  GWt_abstractElement(PspaApplication* ps,abstractElement* elem,string image);
    3535
     36  // methode Factory
     37  static GWt_abstractElement *ajoute(PspaApplication* ps,abstractElement* ptr,const string& type);
     38
    3639  void clicked();
    3740  void doubleClicked();
    38   //  void createLabel(int n);
    3941  void updateLabelWidget();
    4042  WPushButton* getButton();
  • Interface_Web/trunk/pspaWT/include/abstractElement.h

    r114 r126  
    2424
    2525  string label_;
    26   nomdElement elementName_;
     26  typedElement elementName_;
    2727  //  string transportElementName_;
    2828  double lenghtElem_; // cm
     
    4444  void setLabel(string lab);
    4545  string getLabel() const;
    46   nomdElement getName() const;
     46  typedElement getName() const;
    4747  string getNameOfElement();
    4848  string getNameString() const;
  • Interface_Web/trunk/pspaWT/include/dataManager.h

    r118 r126  
    4343  void addSectionToExecute(int debut, int fin, nomDeLogiciel prog);
    4444 
    45   abstractElement* addElement(nomdElement elemType);
     45  abstractElement* addElement(typedElement elemType);
    4646  string getLabelFromElementNumero(int numero);
    4747  void initializeExecution();
  • Interface_Web/trunk/pspaWT/include/elementsCollection.h

    r118 r126  
    2222  void raz();
    2323  int size(); 
    24   abstractElement* addElement(nomdElement elemType);
     24  abstractElement* addElement(typedElement elemType);
    2525  abstractElement* getElementPointer(string label) const;
    2626  abstractElement* getElementPointer(unsigned int index) const;
  • Interface_Web/trunk/pspaWT/include/nomdElements.h

    r113 r126  
    44using namespace std;
    55
    6 typedef enum {
    7   initialBeam, drift, cell, bend, soleno
    8 } nomdElement;
     6enum typedElement {initialBeam, drift, cell, bend, soleno, inconnu};
    97
    10 #define nElements 5
     8class nomdElements
     9{
     10  typedElement e_;
     11  std::string eStr_;
     12  std::string eImg_;
    1113
     14  typedElement fromString(std::string s);
     15  std::string toString(typedElement eType);
     16  std::string toImage(typedElement eType);
     17
     18 public :
     19 
     20  nomdElements();
     21  nomdElements(const std::string& s);
     22  nomdElements(typedElement& eType);
     23
     24
     25  int getNumberOfElements();
     26  typedElement getElementType() const;
     27  std::string getElementName() const;
     28  std::string getElementLabel();
     29  std::string getElementImage() const;
     30};
    1231#endif
Note: See TracChangeset for help on using the changeset viewer.