Changeset 287 in PSPA
- Timestamp:
- Jan 28, 2013, 3:21:51 PM (12 years ago)
- Location:
- Interface_Web/trunk/pspaWT
- Files:
-
- 37 edited
Legend:
- Unmodified
- Added
- Removed
-
Interface_Web/trunk/pspaWT/History
r286 r287 5 5 PSPA - Plateforme de simulation en physique des accélérateurs 6 6 ========================================================= 7 8 28 Janvier 2012 Laurent Garnier 9 - GWt_ligneFaisceau: 10 o Suppression de code inutile 11 o insertion des éléments dans la liste des objets de la ligne 12 13 - GWt_bend, GWt_drift, GWt_beam 14 GWt_soleno, GWt_fit, GWt_rfgun 15 GWt_cell : ajout d'une méthode print() 16 17 - GWt_elementLigneFaisceau.cc : Ajout d'un tooltipsurles éléments et suppression 18 de méthodes inutiles 19 20 - mixedTools.h : ajout de la méthode boolToString() 21 22 - elementRfgun, elementFit, elementSoleno 23 elementBeam, elementDrift, elementBend 24 elementCell : ajout d'une méthode print() 7 25 8 26 25 Janvier 2012 Laurent Garnier -
Interface_Web/trunk/pspaWT/sources/controler/include/abstractElement.h
r271 r287 14 14 class abstractElement 15 15 { 16 protected : 17 18 int nbParam_; 19 string* parametersString_; 20 // double phaseStep_; // a recuperer dans les parametres globaux (methode setPhaseStep) 21 double phaseStepMax_; 22 23 double defaultLength_; 24 double defaultAperture_; 25 string defaultLabel_; 26 27 string label_; 28 nomdElements elementName_; 29 30 double lenghtElem_; // cm 31 double aperture_; // cm 32 33 double stepmaxcm_; 34 // bool curvedTrajectory_; 35 36 void setDefaultValues(); 37 void setDefaults(); 38 39 public : 40 41 abstractElement(); 42 abstractElement(string lab); 43 virtual ~abstractElement(); 44 45 void setParameters(double ll,double aper); 46 void setLabel(string lab); 47 string getLabel() const; 48 // typedElement getName() const; 49 nomdElements getNomdElement() const; 50 51 /* string getElementImage() const; */ 52 /* string getElementName() const; */ 53 54 double getLenghtOfElement() const; 55 int getNbParams() const; 56 /* bool is_parmela_ignored() const; */ 57 /* bool is_parmela_element() const; */ 58 /* bool is_transport_element() const; */ 59 virtual trivaluedBool is_accepted_by_software(nomDeLogiciel soft) const; 60 virtual void setPhaseStep(double); 61 virtual double getInitialKineticEnergy() const; 62 63 virtual void setParametersString(string* param) = 0; 64 virtual string* getParametersString() const = 0; 65 virtual string parmelaOutputFlow() const = 0; 66 virtual string transportOutputFlow() const = 0; 67 virtual string FileOutputFlow() const = 0; 68 virtual void FileInput(ifstream& ifs) = 0; 16 protected : 17 18 int nbParam_; 19 string* parametersString_; 20 // double phaseStep_; // a recuperer dans les parametres globaux (methode setPhaseStep) 21 double phaseStepMax_; 22 23 double defaultLength_; 24 double defaultAperture_; 25 string defaultLabel_; 26 27 string label_; 28 nomdElements elementName_; 29 30 double lenghtElem_; // cm 31 double aperture_; // cm 32 33 double stepmaxcm_; 34 // bool curvedTrajectory_; 35 36 void setDefaultValues(); 37 void setDefaults(); 38 39 public : 40 41 abstractElement(); 42 abstractElement(string lab); 43 virtual ~abstractElement(); 44 45 void setParameters(double ll,double aper); 46 void setLabel(string lab); 47 string getLabel() const; 48 // typedElement getName() const; 49 nomdElements getNomdElement() const; 50 51 /* string getElementImage() const; */ 52 /* string getElementName() const; */ 53 54 double getLenghtOfElement() const; 55 int getNbParams() const; 56 /* bool is_parmela_ignored() const; */ 57 /* bool is_parmela_element() const; */ 58 /* bool is_transport_element() const; */ 59 virtual trivaluedBool is_accepted_by_software(nomDeLogiciel soft) const; 60 virtual void setPhaseStep(double); 61 virtual double getInitialKineticEnergy() const; 62 63 virtual void setParametersString(string* param) = 0; 64 virtual string* getParametersString() const = 0; 65 virtual string parmelaOutputFlow() const = 0; 66 virtual string transportOutputFlow() const = 0; 67 virtual string FileOutputFlow() const = 0; 68 virtual void FileInput(ifstream& ifs) = 0; 69 virtual string print() = 0; 69 70 }; 70 71 #endif -
Interface_Web/trunk/pspaWT/sources/controler/include/elementBeam.h
r257 r287 11 11 class elementBeam : public abstractElement 12 12 { 13 14 double x_, xp_, y_, yp_; 15 double dl_, del_; 16 double p0_; 17 18 double xDef_, xpDef_, yDef_, ypDef_; 19 double dlDef_, delDef_; 20 double p0Def_; 21 22 void setDefaultValues(); 23 24 void setDefaults(); 25 26 public : 27 28 elementBeam(); 29 30 ~elementBeam(); 31 32 virtual trivaluedBool is_accepted_by_software(nomDeLogiciel soft) const; 33 34 35 virtual void setParametersString(string* param); 36 37 virtual string* getParametersString() const; 38 39 virtual string parmelaOutputFlow() const; 40 41 42 virtual string transportOutputFlow() const; 43 44 45 virtual string FileOutputFlow() const; 46 47 virtual void FileInput(ifstream& ifs); 13 48 14 double x_, xp_, y_, yp_; 15 double dl_, del_; 16 double p0_; 17 18 double xDef_, xpDef_, yDef_, ypDef_; 19 double dlDef_, delDef_; 20 double p0Def_; 21 22 void setDefaultValues(); 23 24 void setDefaults(); 25 26 public : 27 28 elementBeam(); 29 30 ~elementBeam(); 31 32 virtual trivaluedBool is_accepted_by_software(nomDeLogiciel soft) const; 33 34 35 virtual void setParametersString(string* param); 36 37 virtual string* getParametersString() const; 38 39 virtual string parmelaOutputFlow() const; 40 41 42 virtual string transportOutputFlow() const; 43 44 45 virtual string FileOutputFlow() const; 46 47 virtual void FileInput(ifstream& ifs); 48 49 /** return a string with all parameters and value 50 */ 51 string print(); 52 49 53 }; 50 54 #endif -
Interface_Web/trunk/pspaWT/sources/controler/include/elementBend.h
r257 r287 7 7 #include "mathematicalTools.h" 8 8 //#include "PhysicalConstants.h" 9 9 10 10 11 11 using namespace std; … … 16 16 class elementBend : public abstractElement 17 17 { 18 19 double angleDeg_; // deg. 20 double radius_; // m 21 double beta1_; // deg. 22 double beta2_; // deg. 23 double momentum_; // MeV/c 24 25 double angleDegDef_; // deg. 26 double radiusDef_; // m 27 double beta1Def_; // deg. 28 double beta2Def_; // deg. 29 double momentumDef_; // MeV/c 30 31 32 33 void setDefaultValues(); 34 void setDefaults(); 35 36 37 public: 38 39 elementBend(); 40 41 ~elementBend() {;} 42 43 double getLenghtOfElement() const; 44 45 virtual trivaluedBool is_accepted_by_software(nomDeLogiciel soft) const; 46 47 48 virtual void setParametersString(string* param); 49 50 virtual string* getParametersString() const; 51 52 virtual string parmelaOutputFlow() const; 53 54 virtual string transportOutputFlow() const; 55 56 virtual string FileOutputFlow() const; 57 58 virtual void FileInput(ifstream& ifs); 59 18 19 double angleDeg_; // deg. 20 double radius_; // m 21 double beta1_; // deg. 22 double beta2_; // deg. 23 double momentum_; // MeV/c 24 25 double angleDegDef_; // deg. 26 double radiusDef_; // m 27 double beta1Def_; // deg. 28 double beta2Def_; // deg. 29 double momentumDef_; // MeV/c 30 31 32 33 void setDefaultValues(); 34 void setDefaults(); 35 36 37 public: 38 39 elementBend(); 40 41 ~elementBend() {;} 42 43 double getLenghtOfElement() const; 44 45 virtual trivaluedBool is_accepted_by_software(nomDeLogiciel soft) const; 46 47 48 virtual void setParametersString(string* param); 49 50 virtual string* getParametersString() const; 51 52 virtual string parmelaOutputFlow() const; 53 54 virtual string transportOutputFlow() const; 55 56 virtual string FileOutputFlow() const; 57 58 virtual void FileInput(ifstream& ifs); 59 60 /** return a string with all parameters and value 61 */ 62 string print(); 63 60 64 }; 61 65 -
Interface_Web/trunk/pspaWT/sources/controler/include/elementCell.h
r257 r287 13 13 class elementCell : public abstractElement 14 14 { 15 16 // int nbParam_; 17 // string* parametersString_; 18 19 20 double initialPhaseDef_; 21 double acceleratingFieldDef_; 22 23 string acceleratingShapeFileDef_; 24 string focusingMagFileDef_; 25 double offsetMagDef_; 26 double scaleFactorDef_; 27 28 double initialPhase_; 29 double acceleratingField_; 30 31 string acceleratingShapeFile_; 32 string focusingMagFile_; 33 double offsetMag_; 34 double scaleFactor_; 35 36 37 void setDefaultValues(); 38 39 void setDefaults(); 40 41 public : 42 43 elementCell(); 44 45 46 ~elementCell() { ;} 47 48 virtual trivaluedBool is_accepted_by_software(nomDeLogiciel soft) const; 49 50 virtual string* getParametersString() const; 51 52 virtual void setParametersString(string* param); 53 54 virtual string parmelaOutputFlow() const; 55 56 virtual string transportOutputFlow() const 57 { 58 ostringstream sortie; 59 cout << " CELL sortie transport non programmee " << endl; 60 return sortie.str(); 61 } 62 63 64 virtual string FileOutputFlow() const; 65 66 virtual void FileInput(ifstream& ifs); 67 15 16 // int nbParam_; 17 // string* parametersString_; 18 19 20 double initialPhaseDef_; 21 double acceleratingFieldDef_; 22 23 string acceleratingShapeFileDef_; 24 string focusingMagFileDef_; 25 double offsetMagDef_; 26 double scaleFactorDef_; 27 28 double initialPhase_; 29 double acceleratingField_; 30 31 string acceleratingShapeFile_; 32 string focusingMagFile_; 33 double offsetMag_; 34 double scaleFactor_; 35 36 37 void setDefaultValues(); 38 39 void setDefaults(); 40 41 public : 42 43 elementCell(); 44 45 46 ~elementCell() { ;} 47 48 virtual trivaluedBool is_accepted_by_software(nomDeLogiciel soft) const; 49 50 virtual string* getParametersString() const; 51 52 virtual void setParametersString(string* param); 53 54 virtual string parmelaOutputFlow() const; 55 56 virtual string transportOutputFlow() const 57 { 58 ostringstream sortie; 59 cout << " CELL sortie transport non programmee " << endl; 60 return sortie.str(); 61 } 62 63 64 virtual string FileOutputFlow() const; 65 66 virtual void FileInput(ifstream& ifs); 67 68 /** return a string with all parameters and value 69 */ 70 string print(); 71 68 72 }; 69 73 -
Interface_Web/trunk/pspaWT/sources/controler/include/elementDrift.h
r271 r287 9 9 class elementDrift : public abstractElement 10 10 { 11 12 void setDefaultValues(); 13 14 void setDefaults(); 15 16 public: 17 18 elementDrift(); 19 20 21 ~elementDrift() {;} 22 23 virtual trivaluedBool is_accepted_by_software(nomDeLogiciel soft) const; 24 25 26 virtual string* getParametersString() const; 27 28 virtual void setParametersString(string* param); 29 30 virtual string parmelaOutputFlow() const; 31 32 virtual string transportOutputFlow() const; 33 34 35 virtual string FileOutputFlow() const; 36 37 virtual void FileInput(ifstream& ifs); 38 11 12 void setDefaultValues(); 13 14 void setDefaults(); 15 16 public: 17 18 elementDrift(); 19 20 21 ~elementDrift() {;} 22 23 virtual trivaluedBool is_accepted_by_software(nomDeLogiciel soft) const; 24 25 26 virtual string* getParametersString() const; 27 28 virtual void setParametersString(string* param); 29 30 virtual string parmelaOutputFlow() const; 31 32 virtual string transportOutputFlow() const; 33 34 35 virtual string FileOutputFlow() const; 36 37 virtual void FileInput(ifstream& ifs); 38 39 /** return a string with all parameters and value 40 */ 41 string print(); 42 39 43 }; 40 44 -
Interface_Web/trunk/pspaWT/sources/controler/include/elementFit.h
r257 r287 11 11 class elementFit : public abstractElement 12 12 { 13 14 15 // unites transport ( cm ; mrad) 16 string variableName_; 17 double variableValue_, tolerance_; 18 19 string variableNameDef_; 20 double variableValueDef_, toleranceDef_; 21 22 void setDefaultValues(); 23 void setDefaults(); 24 25 26 public: 27 28 elementFit(); 29 ~elementFit() {;} 30 31 virtual trivaluedBool is_accepted_by_software(nomDeLogiciel soft) const; 32 33 34 virtual void setParametersString(string* param); 35 36 virtual string* getParametersString() const; 37 38 virtual string parmelaOutputFlow() const; 39 40 virtual string transportOutputFlow() const; 41 42 virtual string FileOutputFlow() const; 43 44 virtual void FileInput(ifstream& ifs); 45 13 14 15 // unites transport ( cm ; mrad) 16 string variableName_; 17 double variableValue_, tolerance_; 18 19 string variableNameDef_; 20 double variableValueDef_, toleranceDef_; 21 22 void setDefaultValues(); 23 void setDefaults(); 24 25 26 public: 27 28 elementFit(); 29 ~elementFit() {;} 30 31 virtual trivaluedBool is_accepted_by_software(nomDeLogiciel soft) const; 32 33 34 virtual void setParametersString(string* param); 35 36 virtual string* getParametersString() const; 37 38 virtual string parmelaOutputFlow() const; 39 40 virtual string transportOutputFlow() const; 41 42 virtual string FileOutputFlow() const; 43 44 virtual void FileInput(ifstream& ifs); 45 46 /** return a string with all parameters and value 47 */ 48 string print(); 49 46 50 }; 47 51 #endif -
Interface_Web/trunk/pspaWT/sources/controler/include/elementRfgun.h
r257 r287 12 12 class elementRfgun : public abstractElement 13 13 { 14 15 // int nbParam_; 16 // string* parametersString_; 17 18 double defaultPhaseStep_; 19 int defaultNmacrop_; 20 double defaultSigma_t_; 21 double defaultSigma_r_; 22 double defaultE_cin_; 23 double defaultSigma_E_; 24 double defaultNb_true_particles_; 25 26 double phaseStep_; // a recuperer dans les parametres globaux (methode setPhaseStep) 27 int nmacrop_; 28 double sigma_t_; // picoseconds 29 double sigma_r_; // cm 30 double E_cin_; // MeV 31 double sigma_E_; // MeV 32 double nb_true_particles_; 33 34 void setDefaultValues(); 35 36 void setDefaults(); 37 38 public: 39 40 elementRfgun(); 41 42 ~elementRfgun() {;} 43 44 virtual trivaluedBool is_accepted_by_software(nomDeLogiciel soft) const; 45 46 virtual void setPhaseStep(double ph) { phaseStep_ = ph;} 47 48 49 virtual string* getParametersString() const; 50 51 virtual void setParametersString(string* param); 52 53 virtual inline double getInitialKineticEnergy() const {return E_cin_;} 54 55 virtual string parmelaOutputFlow() const; 56 57 virtual string transportOutputFlow() const 58 { 59 ostringstream sortie; 60 cout << " CELL sortie transport non programmee " << endl; 61 return sortie.str(); 62 } 63 64 virtual string FileOutputFlow() const; 65 66 virtual void FileInput(ifstream& ifs); 67 68 14 15 // int nbParam_; 16 // string* parametersString_; 17 18 double defaultPhaseStep_; 19 int defaultNmacrop_; 20 double defaultSigma_t_; 21 double defaultSigma_r_; 22 double defaultE_cin_; 23 double defaultSigma_E_; 24 double defaultNb_true_particles_; 25 26 double phaseStep_; // a recuperer dans les parametres globaux (methode setPhaseStep) 27 int nmacrop_; 28 double sigma_t_; // picoseconds 29 double sigma_r_; // cm 30 double E_cin_; // MeV 31 double sigma_E_; // MeV 32 double nb_true_particles_; 33 34 void setDefaultValues(); 35 36 void setDefaults(); 37 38 public: 39 40 elementRfgun(); 41 42 ~elementRfgun() {;} 43 44 virtual trivaluedBool is_accepted_by_software(nomDeLogiciel soft) const; 45 46 virtual void setPhaseStep(double ph) { phaseStep_ = ph;} 47 48 49 virtual string* getParametersString() const; 50 51 virtual void setParametersString(string* param); 52 53 virtual inline double getInitialKineticEnergy() const {return E_cin_;} 54 55 virtual string parmelaOutputFlow() const; 56 57 virtual string transportOutputFlow() const 58 { 59 ostringstream sortie; 60 cout << " CELL sortie transport non programmee " << endl; 61 return sortie.str(); 62 } 63 64 virtual string FileOutputFlow() const; 65 66 virtual void FileInput(ifstream& ifs); 67 68 /** return a string with all parameters and value 69 */ 70 string print(); 71 72 69 73 }; 70 74 -
Interface_Web/trunk/pspaWT/sources/controler/include/elementSoleno.h
r257 r287 8 8 //#include "mathematicalTools.h" 9 9 //#include "PhysicalConstants.h" 10 10 11 11 using namespace std; 12 12 class elementSoleno : public abstractElement 13 13 { 14 15 double B0_; // en kilogauss 16 double B0Def_; // en kilogauss 17 18 bool varyB0_; 19 bool varyB0Def_; 20 21 22 23 void setDefaultValues(); 24 void setDefaults(); 25 26 27 28 public : 29 30 elementSoleno(); 31 32 ~elementSoleno() {;} 33 34 virtual trivaluedBool is_accepted_by_software(nomDeLogiciel soft) const; 35 36 virtual void setParametersString(string* param); 37 38 virtual string* getParametersString() const; 39 40 virtual string parmelaOutputFlow() const; 41 42 virtual string transportOutputFlow() const; 43 44 virtual string FileOutputFlow() const; 45 46 virtual void FileInput(ifstream& ifs); 47 14 15 double B0_; // en kilogauss 16 double B0Def_; // en kilogauss 17 18 bool varyB0_; 19 bool varyB0Def_; 20 21 22 23 void setDefaultValues(); 24 void setDefaults(); 25 26 27 28 public : 29 30 elementSoleno(); 31 32 ~elementSoleno() {;} 33 34 virtual trivaluedBool is_accepted_by_software(nomDeLogiciel soft) const; 35 36 virtual void setParametersString(string* param); 37 38 virtual string* getParametersString() const; 39 40 virtual string parmelaOutputFlow() const; 41 42 virtual string transportOutputFlow() const; 43 44 virtual string FileOutputFlow() const; 45 46 virtual void FileInput(ifstream& ifs); 47 48 /** return a string with all parameters and value 49 */ 50 string print(); 51 48 52 }; 49 53 #endif -
Interface_Web/trunk/pspaWT/sources/controler/include/mixedTools.h
r257 r287 9 9 class mixedTools 10 10 { 11 public: 12 13 static string doubleToString(double x) 14 { 15 std::ostringstream ostr; 16 ostr << x; 17 return ostr.str(); 18 } 19 static string intToString(int x) 20 { 21 std::ostringstream ostr; 22 ostr << x; 23 return ostr.str(); 24 } 11 public: 12 13 static string doubleToString(double x) 14 { 15 std::ostringstream ostr; 16 ostr << x; 17 return ostr.str(); 18 } 19 static string intToString(int x) 20 { 21 std::ostringstream ostr; 22 ostr << x; 23 return ostr.str(); 24 } 25 static string boolToString(bool x) 26 { 27 if (x) { 28 return "true"; 29 } else { 30 return "false"; 31 } 32 } 25 33 }; 26 34 27 35 #endif -
Interface_Web/trunk/pspaWT/sources/controler/src/elementBeam.cc
r271 r287 3 3 #include "mixedTools.h" 4 4 5 6 7 5 elementBeam::elementBeam() : abstractElement() { 8 setDefaultValues();9 setDefaults();10 elementName_ = nomdElements("beam");11 nbParam_ = elementName_.getElementNbParameters();12 parametersString_ = new string[nbParam_+1];13 // transportOk_ = true;6 setDefaultValues(); 7 setDefaults(); 8 elementName_ = nomdElements("beam"); 9 nbParam_ = elementName_.getElementNbParameters(); 10 parametersString_ = new string[nbParam_+1]; 11 // transportOk_ = true; 14 12 } 15 13 … … 17 15 18 16 void elementBeam::setDefaultValues() { 19 defaultLabel_ = "beam999";20 xDef_ = 0.0;21 xpDef_ = 0.0;22 yDef_ = 0.0;23 ypDef_ = 0.0;24 dlDef_ = 0.0;25 delDef_ = 0.0;26 p0Def_ = 0.0;27 17 defaultLabel_ = "beam999"; 18 xDef_ = 0.0; 19 xpDef_ = 0.0; 20 yDef_ = 0.0; 21 ypDef_ = 0.0; 22 dlDef_ = 0.0; 23 delDef_ = 0.0; 24 p0Def_ = 0.0; 25 } 28 26 29 27 void elementBeam::setDefaults() { 30 28 label_ = defaultLabel_; 31 29 x_ = xDef_; … … 36 34 del_ = delDef_; 37 35 p0_ = p0Def_; 38 36 } 39 37 40 38 trivaluedBool elementBeam::is_accepted_by_software(nomDeLogiciel soft) const { 41 if ( soft == nomDeLogiciel::transport ) return ok;42 else return error;39 if ( soft == nomDeLogiciel::transport ) return ok; 40 else return error; 43 41 } 44 42 45 43 string* elementBeam::getParametersString() const { 46 int compteur = -1;47 parametersString_[++compteur] = mixedTools::intToString(nbParam_);48 parametersString_[++compteur] = label_;49 parametersString_[++compteur] = mixedTools::doubleToString(x_);50 parametersString_[++compteur] = mixedTools::doubleToString(xp_);51 parametersString_[++compteur] = mixedTools::doubleToString(y_);52 parametersString_[++compteur] = mixedTools::doubleToString(yp_);53 parametersString_[++compteur] = mixedTools::doubleToString(dl_);54 parametersString_[++compteur] = mixedTools::doubleToString(del_);55 parametersString_[++compteur] = mixedTools::doubleToString(p0_);56 if ( compteur != nbParam_ ) {57 cerr << " elementBeam::getParametersString() : ERROR nr pf parameters dosnt match " << endl;58 return NULL;59 }60 return parametersString_;44 int compteur = -1; 45 parametersString_[++compteur] = mixedTools::intToString(nbParam_); 46 parametersString_[++compteur] = label_; 47 parametersString_[++compteur] = mixedTools::doubleToString(x_); 48 parametersString_[++compteur] = mixedTools::doubleToString(xp_); 49 parametersString_[++compteur] = mixedTools::doubleToString(y_); 50 parametersString_[++compteur] = mixedTools::doubleToString(yp_); 51 parametersString_[++compteur] = mixedTools::doubleToString(dl_); 52 parametersString_[++compteur] = mixedTools::doubleToString(del_); 53 parametersString_[++compteur] = mixedTools::doubleToString(p0_); 54 if ( compteur != nbParam_ ) { 55 cerr << " elementBeam::getParametersString() : ERROR nr pf parameters doesnt match " << endl; 56 return NULL; 57 } 58 return parametersString_; 61 59 } 62 60 63 61 void elementBeam::setParametersString(string* param) { 64 if ( param == NULL )62 if ( param == NULL ) 65 63 { 66 cerr << " elementBeam::setParametersString parameters empty parameter set";67 return;64 cerr << " elementBeam::setParametersString parameters empty parameter set"; 65 return; 68 66 } 69 int compteur = -1;70 int nbparam = atoi(param[++compteur].c_str());71 if ( nbparam != nbParam_ )67 int compteur = -1; 68 int nbparam = atoi(param[++compteur].c_str()); 69 if ( nbparam != nbParam_ ) 72 70 { 73 cerr << " elementBeam::setParametersString parameters do not match for a BEAM";74 return;71 cerr << " elementBeam::setParametersString parameters do not match for a BEAM"; 72 return; 75 73 } 76 77 label_ = param[++compteur];78 x_ = atof(param[++compteur].c_str());79 xp_ = atof(param[++compteur].c_str());80 y_ = atof(param[++compteur].c_str());81 yp_ = atof(param[++compteur].c_str());82 dl_ = atof(param[++compteur].c_str());83 del_ = atof(param[++compteur].c_str());84 p0_ = atof(param[++compteur].c_str());74 75 label_ = param[++compteur]; 76 x_ = atof(param[++compteur].c_str()); 77 xp_ = atof(param[++compteur].c_str()); 78 y_ = atof(param[++compteur].c_str()); 79 yp_ = atof(param[++compteur].c_str()); 80 dl_ = atof(param[++compteur].c_str()); 81 del_ = atof(param[++compteur].c_str()); 82 p0_ = atof(param[++compteur].c_str()); 85 83 } 86 84 87 88 85 string elementBeam::parmelaOutputFlow() const 86 { 89 87 ostringstream sortie; 90 88 cout << " BEAM sortie parmela non programmee " << endl; 91 89 return sortie.str(); 92 90 } 93 91 94 92 string elementBeam::transportOutputFlow() const { 95 ostringstream sortie;96 beam2Moments moments(x_, xp_, y_, yp_, dl_, del_);97 cout << " elementBeam::transportOutputFlow(), p0 = " << p0_ << endl;98 sortie << label_ << ":" << moments.writeToTransportInput(p0_);99 return sortie.str();93 ostringstream sortie; 94 beam2Moments moments(x_, xp_, y_, yp_, dl_, del_); 95 cout << " elementBeam::transportOutputFlow(), p0 = " << p0_ << endl; 96 sortie << label_ << ":" << moments.writeToTransportInput(p0_); 97 return sortie.str(); 100 98 } 101 99 … … 107 105 sortie << x_ << " " << xp_ << " " << y_ << " " << yp_ << endl; 108 106 sortie << dl_ << " " << del_ << " " << p0_ << endl; 109 cout << " elementBeam::FileOutputFlow, p0 = " << p0_ << endl;107 cout << " elementBeam::FileOutputFlow, p0 = " << p0_ << endl; 110 108 return sortie.str(); 111 109 } 112 110 113 111 void elementBeam::elementBeam::FileInput(ifstream& ifs) { 114 ifs >> label_;115 ifs >> x_ >> xp_ >> y_ >> yp_;116 ifs >> dl_ >> del_ >> p0_;117 cout << " elementBeam::FileFileInput, p0 = " << p0_ << endl;118 lenghtElem_ = getLenghtOfElement();112 ifs >> label_; 113 ifs >> x_ >> xp_ >> y_ >> yp_; 114 ifs >> dl_ >> del_ >> p0_; 115 cout << " elementBeam::FileFileInput, p0 = " << p0_ << endl; 116 lenghtElem_ = getLenghtOfElement(); 119 117 cout << " elementBeam::FileInput calcule longueur = " << lenghtElem_ << endl; 120 118 } 119 120 121 string elementBeam::print() { 122 string txt = ""; 123 txt += label_; 124 txt += "\n 1/2 horizontal beam extend rms (cm) : "; 125 txt += mixedTools::doubleToString(x_); 126 txt += "\n 1/2 horizontal beam divergence rms (mrad) : "; 127 txt += mixedTools::doubleToString(xp_); 128 txt += "\n1/2 vertical beam extend rms (cm) : "; 129 txt += mixedTools::doubleToString(y_); 130 txt += "\n1/2 horizontal beam divergence rms (mrad) : "; 131 txt += mixedTools::doubleToString(yp_); 132 txt += "\n1/2 longitudinal beam extend rms (cm) : "; 133 txt += mixedTools::doubleToString(dl_); 134 txt += "\n1/2 momentum spread rms (mrad) : "; 135 txt += mixedTools::doubleToString(del_); 136 txt += "\nmomentum of the central trajectory (GeV/c) : "; 137 txt += mixedTools::doubleToString(p0_); 138 139 return txt; 140 } -
Interface_Web/trunk/pspaWT/sources/controler/src/elementBend.cc
r271 r287 3 3 #include "mathematicalConstants.h" 4 4 #include "PhysicalConstants.h" 5 elementBend::elementBend() : abstractElement() 5 6 elementBend::elementBend() : abstractElement() 6 7 { 7 8 setDefaultValues(); … … 131 132 cout << " elementBend::FileInput calcule longueur = " << lenghtElem_ << endl; 132 133 } 134 135 136 string elementBend::print() { 137 string txt = ""; 138 139 txt += label_; 140 txt += "\nangle (deg.) : "; 141 txt += mixedTools::doubleToString(angleDeg_); 142 txt += "\nradius (m) : "; 143 txt += mixedTools::doubleToString(radius_); 144 txt += "\nmomentum (MeV/c) : "; 145 txt += mixedTools::doubleToString(momentum_); 146 txt += "\nlength (cm) : "; 147 txt += mixedTools::doubleToString(lenghtElem_); 148 txt += "\naperture (cm) : "; 149 txt += mixedTools::doubleToString(aperture_); 150 txt += "\npole face rotations (deg.) entrance : "; 151 txt += mixedTools::doubleToString(beta1_); 152 txt += "\nexit : "; 153 txt += mixedTools::doubleToString(beta2_); 154 155 return txt; 156 } -
Interface_Web/trunk/pspaWT/sources/controler/src/elementCell.cc
r271 r287 5 5 #include "mathematicalTools.h" 6 6 #include "mixedTools.h" 7 8 7 9 8 … … 137 136 ifs >> offsetMag_ >> scaleFactor_; 138 137 } 138 139 140 string elementCell::print() { 141 string txt = ""; 142 143 144 txt += label_; 145 txt += "\nlength (cm) : "; 146 txt += mixedTools::doubleToString(lenghtElem_); 147 txt += "\naperture (cm) : "; 148 txt += mixedTools::doubleToString(aperture_); 149 txt += "\ninitial phase (deg.) : "; 150 txt += mixedTools::doubleToString(initialPhase_); 151 txt += "\nmax phase step (deg.) : "; 152 txt += mixedTools::doubleToString(phaseStepMax_); 153 txt += "\nmax accelerating field (MV/m) : "; 154 txt += mixedTools::doubleToString(acceleratingField_); 155 txt += "\nname of file for field shape : "; 156 txt += acceleratingShapeFile_; 157 txt += "\nname of file for focusing mag. field : "; 158 txt += focusingMagFile_; 159 txt += "\n z-offset for mag. field : "; 160 txt += mixedTools::doubleToString(offsetMag_); 161 txt += "\n scaling factor for mag. field : "; 162 txt += mixedTools::doubleToString(scaleFactor_); 163 return txt; 164 } -
Interface_Web/trunk/pspaWT/sources/controler/src/elementDrift.cc
r271 r287 97 97 ifs >> lenghtElem_ >> aperture_; 98 98 } 99 100 101 string elementDrift::print() { 102 string txt = ""; 103 104 txt += label_; 105 txt += "\nlength (cm) : "; 106 txt += mixedTools::doubleToString(lenghtElem_); 107 txt += "\naperture (cm) : "; 108 txt += mixedTools::doubleToString(aperture_); 109 110 return txt; 111 } -
Interface_Web/trunk/pspaWT/sources/controler/src/elementFit.cc
r271 r287 4 4 elementFit::elementFit() : abstractElement() 5 5 { 6 setDefaultValues();7 setDefaults();8 elementName_ = nomdElements("fit");9 nbParam_ = elementName_.getElementNbParameters();10 parametersString_ = new string[nbParam_+1];11 // transportOk_ = true;12 // parmelaIgnored_ = true;6 setDefaultValues(); 7 setDefaults(); 8 elementName_ = nomdElements("fit"); 9 nbParam_ = elementName_.getElementNbParameters(); 10 parametersString_ = new string[nbParam_+1]; 11 // transportOk_ = true; 12 // parmelaIgnored_ = true; 13 13 } 14 14 15 15 void elementFit::setDefaultValues() 16 16 { 17 17 defaultLabel_ = "fit999"; 18 18 variableNameDef_ = ""; 19 19 variableValueDef_ = 0.0; 20 20 toleranceDef_ = 0.0; 21 21 } 22 22 23 23 void elementFit::setDefaults() 24 24 { 25 25 label_ = defaultLabel_; 26 26 variableName_ = variableNameDef_; 27 27 variableValue_ = variableValueDef_; 28 28 tolerance_ = toleranceDef_; 29 29 } 30 30 31 31 trivaluedBool elementFit::is_accepted_by_software(nomDeLogiciel soft) const { 32 if ( soft == nomDeLogiciel::transport ) return ok;33 else if ( soft == nomDeLogiciel::parmela ) return warning;34 else return error;32 if ( soft == nomDeLogiciel::transport ) return ok; 33 else if ( soft == nomDeLogiciel::parmela ) return warning; 34 else return error; 35 35 } 36 36 37 37 38 string* elementFit::getParametersString() const 39 40 int compteur = -1;41 parametersString_[++compteur] = mixedTools::intToString(nbParam_);42 parametersString_[++compteur] = label_;43 parametersString_[++compteur] = variableName_;44 parametersString_[++compteur] = mixedTools::doubleToString(variableValue_ );45 parametersString_[++compteur] = mixedTools::doubleToString(tolerance_);46 if ( compteur != nbParam_ ) {47 cerr << " elementFit::getParametersString() : ERROR nr pf parameters dosnt match " << endl;48 return NULL;49 }50 return parametersString_;51 38 string* elementFit::getParametersString() const 39 { 40 int compteur = -1; 41 parametersString_[++compteur] = mixedTools::intToString(nbParam_); 42 parametersString_[++compteur] = label_; 43 parametersString_[++compteur] = variableName_; 44 parametersString_[++compteur] = mixedTools::doubleToString(variableValue_ ); 45 parametersString_[++compteur] = mixedTools::doubleToString(tolerance_); 46 if ( compteur != nbParam_ ) { 47 cerr << " elementFit::getParametersString() : ERROR nr pf parameters dosnt match " << endl; 48 return NULL; 49 } 50 return parametersString_; 51 } 52 52 53 53 void elementFit::setParametersString(string* param) 54 54 { 55 if ( param == NULL )55 if ( param == NULL ) 56 56 { 57 cerr << " elementFit::setParametersString parameters empty parameter set";58 return;57 cerr << " elementFit::setParametersString parameters empty parameter set"; 58 return; 59 59 } 60 int compteur = -1;61 int nbparam = atoi(param[++compteur].c_str());62 if ( nbparam != nbParam_ )60 int compteur = -1; 61 int nbparam = atoi(param[++compteur].c_str()); 62 if ( nbparam != nbParam_ ) 63 63 { 64 cerr << " elementFit::setParametersString parameters do not match for a BEND" << endl;65 return;64 cerr << " elementFit::setParametersString parameters do not match for a BEND" << endl; 65 return; 66 66 } 67 68 label_ = param[++compteur];69 variableName_ = param[++compteur];70 variableValue_ = atof(param[++compteur].c_str());71 tolerance_ = atof(param[++compteur].c_str());67 68 label_ = param[++compteur]; 69 variableName_ = param[++compteur]; 70 variableValue_ = atof(param[++compteur].c_str()); 71 tolerance_ = atof(param[++compteur].c_str()); 72 72 } 73 73 74 74 75 75 string elementFit::parmelaOutputFlow() const 76 76 { 77 77 ostringstream sortie; 78 78 return sortie.str(); 79 79 } 80 80 81 81 string elementFit::transportOutputFlow() const 82 82 { 83 83 ostringstream sortie; 84 84 sortie << label_ << ":" << " FIT," << variableName_ << " = " << variableValue_ << ", TOLER = " << tolerance_ << " ;" << endl; 85 85 if ( variableName_ == "R11" || variableName_ == "R22" || variableName_ == "R12" || variableName_ == "R21" ) { 86 sortie << " PRINT, TRANS;" << endl;86 sortie << " PRINT, TRANS;" << endl; 87 87 } 88 88 return sortie.str(); 89 89 } 90 90 91 91 string elementFit::FileOutputFlow() const 92 92 { 93 93 ostringstream sortie; 94 94 // sortie << elementName_.getElementType() << endl; … … 97 97 sortie << variableName_ << " " << variableValue_ << " " << tolerance_ << endl; 98 98 return sortie.str(); 99 99 } 100 100 101 101 void elementFit::FileInput(ifstream& ifs) 102 102 { 103 ifs >> label_;104 ifs >> variableName_ >> variableValue_ >> tolerance_;103 ifs >> label_; 104 ifs >> variableName_ >> variableValue_ >> tolerance_; 105 105 } 106 107 108 string elementFit::print() { 109 string txt = ""; 110 111 txt += label_; 112 return txt; 113 } -
Interface_Web/trunk/pspaWT/sources/controler/src/elementRfgun.cc
r271 r287 4 4 #include "mathematicalTools.h" 5 5 #include "mixedTools.h" 6 7 6 8 7 … … 120 119 ifs >> phaseStep_ >> nb_true_particles_; 121 120 } 121 122 123 string elementRfgun::print() { 124 string txt = ""; 125 126 txt += label_; 127 txt += "\nnr of macroparticles : "; 128 txt += mixedTools::doubleToString(nb_true_particles_); 129 txt += "\nsigma_t (ps) : "; 130 txt += mixedTools::doubleToString(sigma_t_); 131 txt += "\nsigma_r (cm) : "; 132 txt += mixedTools::doubleToString(sigma_r_); 133 txt += "\ninitial kinetic energy (MeV) : "; 134 txt += mixedTools::doubleToString(E_cin_); 135 txt += "\nsigma_Ecin (MeV) : "; 136 txt += mixedTools::doubleToString(sigma_E_); 137 txt += "\ntrue number of part. in beam : "; 138 txt += mixedTools::boolToString(nmacrop_); 139 140 return txt; 141 } -
Interface_Web/trunk/pspaWT/sources/controler/src/elementSoleno.cc
r271 r287 1 1 #include "elementSoleno.h" 2 2 #include "mixedTools.h" 3 4 3 5 4 … … 109 108 ifs >> lenghtElem_ >> aperture_ >> B0_ >> varyB0_ ; 110 109 } 110 111 112 string elementSoleno::print() { 113 string txt = ""; 114 115 txt += label_; 116 txt += "\nlength (cm) : "; 117 txt += mixedTools::doubleToString(lenghtElem_); 118 txt += "\naperture (cm) : "; 119 txt += mixedTools::doubleToString(aperture_); 120 txt += "\nfield (kG) : "; 121 txt += mixedTools::doubleToString(B0_); 122 txt += "\n : may vary ? "; 123 txt += mixedTools::boolToString(varyB0_); 124 125 return txt; 126 } -
Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_abstractElement.h
r272 r287 8 8 #include <Wt/WDialog> 9 9 #include <Wt/WImage> 10 #include <Wt/WString> 10 11 #include <Wt/WPushButton> 11 12 #include <Wt/WContainerWidget> … … 47 48 virtual void dialogDone() = 0; 48 49 virtual WImage* getImage() = 0; 50 virtual WString print() = 0; 49 51 50 52 private: -
Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_beam.h
r272 r287 24 24 25 25 WImage* getImage(); 26 26 WString print(); 27 27 28 private: 28 29 WImage* image_; -
Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_bend.h
r272 r287 23 23 24 24 WImage* getImage(); 25 WString print(); 25 26 26 27 private: -
Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_cell.h
r272 r287 34 34 35 35 WImage* getImage(); 36 WString print(); 36 37 37 38 private: -
Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_drift.h
r272 r287 25 25 virtual void dialogDone(); 26 26 WImage* getImage(); 27 WString print(); 27 28 28 29 private: -
Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_elementLigneFaisceau.h
r273 r287 61 61 void removeDone(GWt_abstractElement*); 62 62 std::string getElementNumberInBeamLine(nomdElements el); 63 void removeOtherDropZone(GWt_elementLigneFaisceau*);64 63 void initialize_ligneFaisceau(abstractElement*); 65 64 GWt_dialog* messageDropZone_; -
Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_fit.h
r272 r287 20 20 21 21 WImage* getImage(); 22 WString print(); 22 23 23 24 private: -
Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_rfgun.h
r272 r287 31 31 32 32 WImage* getImage(); 33 WString print(); 33 34 34 35 private: -
Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_soleno.h
r272 r287 32 32 33 33 WImage* getImage(); 34 WString print(); 34 35 35 36 private: -
Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_beam.cc
r272 r287 79 79 return image_; 80 80 } 81 82 83 WString GWt_beam::print(){ 84 return WString(abstractElement_->print()); 85 } -
Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_bend.cc
r272 r287 83 83 return image_; 84 84 } 85 86 87 WString GWt_bend::print(){ 88 return WString(abstractElement_->print()); 89 } -
Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_cell.cc
r272 r287 107 107 return image_; 108 108 } 109 110 111 WString GWt_cell::print(){ 112 return WString(abstractElement_->print()); 113 } -
Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_drift.cc
r272 r287 54 54 return image_; 55 55 } 56 57 58 WString GWt_drift::print(){ 59 return WString(abstractElement_->print()); 60 } -
Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_dropZoneLigneFaisceau.cc
r286 r287 10 10 11 11 12 #define PSPA_DEBUG 112 //#define PSPA_DEBUG 1 13 13 14 14 GWt_dropZoneLigneFaisceau::GWt_dropZoneLigneFaisceau() … … 123 123 typedElement eType = e.getElementType(); 124 124 ligneFaisceau->addElement(eType, this); 125 126 127 /*128 nomdElements e(evt.mimeType());129 typedElement eType = e.getElementType();130 131 // update source if necessary132 cout<<"dynamic_cast SOURCE------" << evt.source() << endl;133 if (dynamic_cast <GWt_dropZoneLigneFaisceau*> (evt.source())) {134 cout<<"OKIKKKIIII" << dynamic_cast <GWt_dropZoneLigneFaisceau*> (evt.source()) << endl;135 removeOtherDropZone(dynamic_cast <GWt_dropZoneLigneFaisceau*> (evt.source()));136 }137 138 if(eType == inconnu) {139 cout << "GWt_LigneFaisceau::element type " << eType << " inconnu " << endl;140 return;141 }142 143 if ( static_cast<GWt_console*> (wApp->findWidget ("console"))) {144 GWt_console* console = static_cast<GWt_console*> (wApp->findWidget ("console"));145 console->addConsoleMessage(e.getElementName());146 }147 148 abstractElement* ptr = pspa_->getDataManager()->addElement(eType);149 150 ptr->setLabel(getElementNumberInBeamLine(e));151 152 GWt_abstractElement* insertedAbstractElement = GWt_abstractElement::ajoute(ptr);153 cout << " je vais ajouter l'element " << ptr->getNomdElement().getElementName() << " de type " << ptr->getNomdElement().getElementType() << "ID "<< insertedAbstractElement << endl;154 155 if(insertedAbstractElement == NULL) return;156 insertedAbstractElement->setLabelWidget();157 158 WSignalMapper<GWt_abstractElement *> *mapper= new WSignalMapper<GWt_abstractElement *>(this);159 mapper->mapped().connect(this,&GWt_dropZoneLigneFaisceau::onClick);160 mapper->mapConnect(insertedAbstractElement->getImage()->doubleClicked(),insertedAbstractElement);161 162 //////////////////////////////////////////////////////////////////163 164 // add the dropped widget165 printf("add the dropped widget\n");166 167 // add drop zone before and after168 if (static_cast <WContainerWidget*> (parent())) {169 WContainerWidget* wc = static_cast <WContainerWidget*> (parent());170 171 cout<<"add the dropped parent %d"<< wc << " COUNT:"<< count () <<"<---------------"<< endl;172 // do not insert new element if some element is already present173 174 WBoxLayout* layout = ((WBoxLayout*)(wc->layout()));175 bool replaceElement = false;176 177 if (abstractElement_) {178 replaceElement = true;179 }180 181 // insert one before182 if (!replaceElement) {183 // if it the first element of the beam line184 if (layout->indexOf ((WLayoutItem*)(layout->findWidgetItem (this))) == 0) {185 layout->insertWidget (layout->indexOf ((WLayoutItem*)(layout->findWidgetItem (this))), new GWt_dropZoneLigneFaisceau(pspa_,false));186 187 } else {188 layout->insertWidget (layout->indexOf ((WLayoutItem*)(layout->findWidgetItem (this))), new GWt_dropZoneLigneFaisceau(pspa_,true));189 }190 }191 // FIXME Replace192 193 // complete widget194 clear();195 arrowImage_ = NULL;196 abstractElement_ = insertedAbstractElement->getWidget();197 addWidget(abstractElement_);198 // change strech (useful if it was the last one)199 layout->setStretchFactor(this,0);200 201 // change background202 decorationStyle().setBackgroundColor (WColor("white"));203 204 // remove border205 decorationStyle().setBorder (WBorder (WBorder::None));206 207 208 // insert after209 // if it is the last, add a strech factor and no link image210 cout<<" nb elem:"<< layout->indexOf ((WLayoutItem*)(layout->findWidgetItem (this)))+1 << " COUNT:"<< wc->count () <<"<---------------ID:"<< abstractElement_ << endl;211 if (!replaceElement) {212 if (layout->indexOf ((WLayoutItem*)(layout->findWidgetItem (this)))+1 == wc->count()) {213 layout->insertWidget (layout->indexOf ((WLayoutItem*)(layout->findWidgetItem (this)))+1, new GWt_dropZoneLigneFaisceau(pspa_,false),1);214 } else {215 layout->insertWidget (layout->indexOf ((WLayoutItem*)(layout->findWidgetItem (this)))+1, new GWt_dropZoneLigneFaisceau(pspa_));216 }217 }218 */219 220 /*221 * Set the image to be draggable, showing the other image (dragImage)222 * to be used as the widget that is visually dragged.223 */224 /*225 WImage *dragImage = new WImage(e.getImageFromType(eType).c_str(),this);226 227 // setDraggable(evt.mimeType(),dragImage,true);//,insertedAbstractElement->getButton(),true);228 abstractElement_->setDraggable(evt.mimeType(),dragImage,true, this);229 230 231 cout<<"add the dropped parent %d"<< wc << " COUNT:"<< wc->count () <<"<---------------"<< endl;232 }233 234 235 236 //insertedAbstractElement->getWidget()->decorationStyle().setBackgroundColor (WColor("blue"));237 pspa_->updateSelections();238 239 */240 125 } 241 126 -
Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_elementLigneFaisceau.cc
r282 r287 125 125 dragElementZone_->setMaximumSize(32,32); 126 126 dragElementZone_->setMinimumSize(32,32); 127 dragElementZone_->setToolTip(abstractElement_->print()); 127 128 } 128 129 } … … 175 176 176 177 177 178 void GWt_elementLigneFaisceau::removeOtherDropZone(GWt_elementLigneFaisceau* other)179 {180 // 3 cases :181 // - first element : remove elem + link after182 // - last element : remove elem + link before183 // - middle element : remove elem + link after/before184 185 WContainerWidget* wc = static_cast <WContainerWidget*> (parent());186 WBoxLayout* layout = ((WBoxLayout*)(wc->layout()));187 188 #ifdef PSPA_DEBUG189 if ( static_cast<GWt_console*> (wApp->findWidget ("console"))) {190 GWt_console* console = static_cast<GWt_console*> (wApp->findWidget ("console"));191 console->addConsoleMessage("GWt_elementLigneFaisceau::mouseOut");192 console->addConsoleMessage("remove from drag Zone");193 }194 cout << "remove from drag Zone id" << layout->indexOf ((WLayoutItem*)(layout->findWidgetItem (other))) << " count:" << layout->count()<< endl;195 #endif196 // first element197 if (layout->indexOf ((WLayoutItem*)(layout->findWidgetItem (other))) == 1) {198 if (layout->itemAt (2)) {199 layout->removeItem (layout->itemAt(2));200 #ifdef PSPA_DEBUG201 if ( static_cast<GWt_console*> (wApp->findWidget ("console"))) {202 GWt_console* console = static_cast<GWt_console*> (wApp->findWidget ("console"));203 console->addConsoleMessage(" remove first link ");204 }205 #endif206 }207 208 // last and middle209 } else if (layout->indexOf ((WLayoutItem*)(layout->findWidgetItem (other))) == layout->count()-2) {210 if (layout->itemAt (layout->count()-3)) {211 layout->removeItem (layout->itemAt(layout->count()-3));212 #ifdef PSPA_DEBUG213 if ( static_cast<GWt_console*> (wApp->findWidget ("console"))) {214 GWt_console* console = static_cast<GWt_console*> (wApp->findWidget ("console"));215 console->addConsoleMessage(" remove first link ");216 }217 #endif218 }219 }220 221 // remove the drop zone222 if (layout->findWidgetItem (other)) {223 layout->removeItem (layout->itemAt(layout->indexOf((WLayoutItem*)(layout->findWidgetItem (other)))));224 #ifdef PSPA_DEBUG225 if ( static_cast<GWt_console*> (wApp->findWidget ("console"))) {226 GWt_console* console = static_cast<GWt_console*> (wApp->findWidget ("console"));227 console->addConsoleMessage(" remove drop zone ");228 }229 #endif230 }231 232 233 // FIXME ne pas passer par un label mais par un abstrastElement234 // pspa_->getDataManager()->getCollection()->eraseElement(label);235 // pspa_->updateSelections();236 }237 178 238 179 -
Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_fit.cc
r272 r287 82 82 return image_; 83 83 } 84 85 86 WString GWt_fit::print(){ 87 return WString(abstractElement_->print()); 88 } -
Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_ligneFaisceau.cc
r284 r287 65 65 { 66 66 abstractElement* ptr = pspa_->getDataManager()->getCollection()->getElementPointerFromIndex(k); 67 GWt_abstractElement* gw = GWt_abstractElement::ajoute(ptr); 68 if(gw == NULL) { 69 /* 70 GWt_dialog warningDialog("PSPA : restore configuration", " Element type "+ptr->getNomdElement().getElementName()+" not reconized", GWt_dialog::Error,true,true); 71 warningDialog.exec(); 72 */ 73 } 74 gw->setLabelWidget(); 75 67 76 68 nObjets_[ptr->getNomdElement().getElementType()].incr(); 77 69 78 70 ligneFaisceauLayout_->addWidget(new GWt_elementLigneFaisceau(ptr),1); 79 71 80 81 /* if (k < ((unsigned)nbElem-1)) {82 ligneFaisceauLayout_->addWidget(new GWt_elementLigneFaiseau());83 } else {84 ligneFaisceauLayout_->addWidget(new GWt_elementLigneFaiseau());85 }86 */87 72 } 88 73 manageLineFaisceauLayout(); … … 95 80 96 81 cout << " Entree addElement element " << nomdElements::getLabelFromType(eType) << endl; 82 83 int nElements= nomdElements ::getNumberOfElements(); 84 nObjets_= new Compteur[nElements]; 97 85 98 86 // 2 cases : … … 137 125 // ligneFaisceauLayout_->addWidget(new GWt_elementLigneFaiseau(ptr),0); 138 126 if (index != -1) { 127 nObjets_[ptr->getNomdElement().getElementType()].incr(); 139 128 ligneFaisceauLayout_->insertWidget(index,new GWt_elementLigneFaisceau(ptr),1); 140 129 } -
Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_pspaApplication.cc
r272 r287 212 212 cout << "createDragImage" << dragImage<<endl; 213 213 result->setDraggable(mimeType,dragImage,true); 214 215 214 } 216 215 -
Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_rfgun.cc
r272 r287 76 76 return image_; 77 77 } 78 79 80 WString GWt_rfgun::print(){ 81 return WString(abstractElement_->print()); 82 } -
Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_soleno.cc
r272 r287 64 64 return image_; 65 65 } 66 67 68 WString GWt_soleno::print(){ 69 return WString(abstractElement_->print()); 70 }
Note: See TracChangeset
for help on using the changeset viewer.