Changeset 418 in PSPA for Interface_Web/trunk/pspaWT/sources/controler/src/elementBeam.cc
- Timestamp:
- Jun 21, 2013, 10:16:56 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Interface_Web/trunk/pspaWT/sources/controler/src/elementBeam.cc
r387 r418 10 10 parametersString_ = new string[nbParam_+1]; 11 11 // transportOk_ = true; 12 registerAcceptableSoftware(nomDeLogiciel::transport, TBoolOk);12 // registerAcceptableSoftware(nomDeLogiciel::transport, TBoolOk); 13 13 } 14 14 … … 16 16 17 17 void elementBeam::setDefaultValues() { 18 default Label_ = "beam";18 defaultSpecificName_ = "beam"; 19 19 xDef_ = 0.0; 20 20 xpDef_ = 0.0; … … 27 27 28 28 void elementBeam::setDefaults() { 29 label_ = defaultLabel_;29 specificName_ = defaultSpecificName_; 30 30 x_ = xDef_; 31 31 xp_ = xpDef_; … … 41 41 int compteur = -1; 42 42 parametersString_[++compteur] = mixedTools::intToString(nbParam_); 43 parametersString_[++compteur] = label_;43 parametersString_[++compteur] = specificName_; 44 44 parametersString_[++compteur] = mixedTools::doubleToString(x_); 45 45 parametersString_[++compteur] = mixedTools::doubleToString(xp_); … … 55 55 return parametersString_; 56 56 } 57 58 59 57 60 58 61 void elementBeam::setParametersString(string* param) { … … 70 73 } 71 74 72 label_ = param[++compteur];75 specificName_ = param[++compteur]; 73 76 x_ = atof(param[++compteur].c_str()); 74 77 xp_ = atof(param[++compteur].c_str()); … … 80 83 } 81 84 82 string elementBeam::parmelaOutputFlow() const83 {84 ostringstream sortie;85 cout << " BEAM sortie parmela non programmee " << endl;86 return sortie.str();87 }85 // string elementBeam::parmelaOutputFlow() const 86 // { 87 // ostringstream sortie; 88 // cout << " BEAM sortie parmela non programmee " << endl; 89 // return sortie.str(); 90 // } 88 91 89 string elementBeam::transportOutputFlow() const {90 ostringstream sortie;91 beam2Moments moments(x_, xp_, y_, yp_, dl_, del_);92 cout << " elementBeam::transportOutputFlow(), p0 = " << p0_ << endl;93 sortie << label_ << ":" << moments.writeToTransportInput(p0_) << endl;94 return sortie.str();95 }92 // string elementBeam::transportOutputFlow() const { 93 // ostringstream sortie; 94 // beam2Moments moments(x_, xp_, y_, yp_, dl_, del_); 95 // cout << " elementBeam::transportOutputFlow(), p0 = " << p0_ << endl; 96 // sortie << specificName_ << ":" << moments.writeToTransportInput(p0_) << endl; 97 // return sortie.str(); 98 // } 96 99 97 100 string elementBeam::FileOutputFlow() const { 98 101 ostringstream sortie; 99 102 // sortie << elementName_.getElementType() << endl; 100 sortie << elementName_.get ElementLabel() << endl;101 sortie << label_ << endl;103 sortie << elementName_.getGenericLabel() << endl; 104 sortie << specificName_ << endl; 102 105 sortie << x_ << " " << xp_ << " " << y_ << " " << yp_ << endl; 103 106 sortie << dl_ << " " << del_ << " " << p0_ << endl; … … 106 109 } 107 110 111 vector< pair<string, vector<string> > > elementBeam::parametersToSoftware () const { 112 vector< pair<string, vector<string> > > sortie; 113 sortie.push_back( pair<string, vector<string> >("labelsGenericSpecific", vector<string>() ) ); 114 sortie.back().second.push_back(elementName_.getGenericLabel()); 115 sortie.back().second.push_back(specificName_); 116 sortie.push_back( pair<string, vector<string> >("transverseCoordinates", vector<string>() ) ); 117 sortie.back().second.push_back(mixedTools::doubleToString(x_)); 118 sortie.back().second.push_back(mixedTools::doubleToString(xp_)); 119 sortie.back().second.push_back(mixedTools::doubleToString(y_)); 120 sortie.back().second.push_back(mixedTools::doubleToString(xp_)); 121 sortie.push_back( pair<string, vector<string> >("longitudinalCoordinates", vector<string>() ) ); 122 sortie.back().second.push_back(mixedTools::doubleToString(dl_)); 123 sortie.back().second.push_back(mixedTools::doubleToString(del_)); 124 sortie.push_back( pair<string, vector<string> >("momentum", vector<string>() ) ); 125 sortie.back().second.push_back(mixedTools::doubleToString(p0_)); 126 return sortie; 127 } 128 129 108 130 void elementBeam::elementBeam::FileInput(ifstream& ifs) { 109 ifs >> label_;131 ifs >> specificName_; 110 132 ifs >> x_ >> xp_ >> y_ >> yp_; 111 133 ifs >> dl_ >> del_ >> p0_; … … 118 140 string elementBeam::print() { 119 141 string txt = ""; 120 txt += label_;142 txt += specificName_; 121 143 txt += "\n 1/2 horizontal beam extend rms (cm) : "; 122 144 txt += mixedTools::doubleToString(x_);
Note: See TracChangeset
for help on using the changeset viewer.