Changeset 488 in PSPA for Interface_Web/trunk/pspaWT/sources/controler/src/elementSextupole.cc
- Timestamp:
- Feb 7, 2014, 2:00:55 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Interface_Web/trunk/pspaWT/sources/controler/src/elementSextupole.cc
r487 r488 9 9 defaultSpecificName_ = "spole"; 10 10 specificName_ = defaultSpecificName_; 11 length_ = 0;11 // length_ = 0; 12 12 component_ = 0.0; 13 13 … … 22 22 parametersString_[++compteur]= mixedTools::intToString(nbParam_); 23 23 parametersString_[++compteur]= specificName_; 24 parametersString_[++compteur]= mixedTools::doubleToString(leng th_);24 parametersString_[++compteur]= mixedTools::doubleToString(lenghtElem_); 25 25 parametersString_[++compteur]= mixedTools::doubleToString(component_); 26 26 if ( compteur != nbParam_ ) { … … 47 47 48 48 specificName_ = param[++compteur]; 49 leng th_ = atof(param[++compteur].c_str());49 lenghtElem_ = atof(param[++compteur].c_str()); 50 50 component_ = atof(param[++compteur].c_str()); 51 51 } 52 52 53 string elementSextupole::FileOutputFlow() const54 {55 ostringstream sortie;56 sortie << elementName_.getGenericLabel() << endl;57 sortie << specificName_ << endl;58 sortie << length_ << " " << component_ <<endl;59 return sortie.str();60 }53 // string elementSextupole::FileOutputFlow() const 54 // { 55 // ostringstream sortie; 56 // sortie << elementName_.getGenericLabel() << endl; 57 // sortie << specificName_ << endl; 58 // sortie << lenghtElem_ << " " << component_ <<endl; 59 // return sortie.str(); 60 // } 61 61 62 62 vector< pair<string, vector<string> > > elementSextupole::parametersToSoftware () const … … 67 67 sortie.back().second.push_back(specificName_); 68 68 sortie.push_back( pair<string, vector<string> >("attributes",vector<string>() ) ); 69 sortie.back().second.push_back(mixedTools::doubleToString(leng th_));69 sortie.back().second.push_back(mixedTools::doubleToString(lenghtElem_)); 70 70 sortie.back().second.push_back(mixedTools::doubleToString(component_)); 71 71 return sortie; 72 72 } 73 73 74 void elementSextupole::FileInput(ifstream& ifs)75 {76 ifs >> specificName_;77 ifs >> length_ >> component_;78 }74 // void elementSextupole::FileInput(ifstream& ifs) 75 // { 76 // ifs >> specificName_; 77 // ifs >> lenghtElem_ >> component_; 78 // } 79 79 80 80 string elementSextupole::print() … … 83 83 txt += specificName_; 84 84 txt += "\nlength (m): "; 85 txt += mixedTools::doubleToString(leng th_);85 txt += mixedTools::doubleToString(lenghtElem_); 86 86 txt += "\ncomponent (m^-3): "; 87 87 txt += mixedTools::doubleToString(component_); … … 91 91 void elementSextupole::InputRep(UAPNode* root) 92 92 { 93 UAPNode* ele = root->addChild("element"); 94 ele->addAttribute("name",specificName_); 93 UAPNode* ele = setAMLelementHeader(root); 95 94 96 95 string txt = ""; … … 100 99 knl->addAttribute("design",txt); 101 100 102 txt = mixedTools::doubleToString(leng th_);101 txt = mixedTools::doubleToString(lenghtElem_); 103 102 ele->addChild("length")->addAttribute("design",txt); 104 103 } 104 105 void elementSextupole::FileAMLInput(UAPNode* entree) 106 { 107 if ( !checkAMLelementGenericName(entree) ) return; 108 109 AMLtools::readAMLParameterAttribut(entree, "length", "design", lenghtElem_); 110 111 112 UAPNode* sextupole = entree->getChildByName("sextupole"); 113 if ( ! sextupole ) { 114 cout << " elementSextupole::FileAMLInput ERREUR pas de noeud AML <sextupole> " << endl; 115 return; 116 } 117 AMLtools::readAMLParameterAttribut(sextupole, "k", "design", component_); 118 }
Note: See TracChangeset
for help on using the changeset viewer.