Changeset 488 in PSPA for Interface_Web/trunk/pspaWT/sources/controler/src/elementRfgun.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/elementRfgun.cc
r424 r488 126 126 // } 127 127 128 string elementRfgun::FileOutputFlow() const129 {130 ostringstream sortie;131 // on prend les troncatures tmax et rmax à 3 sigmas132 // sortie << elementName_.getElementType() << endl;133 sortie << elementName_.getGenericLabel() << endl;134 sortie << specificName_ << endl;135 sortie << nmacrop_ << " " << sigma_t_ << " " << sigma_r_ << endl;136 sortie << emit_x_ << " " << emit_y_ << endl;137 sortie << E_cin_ << " " << sigma_E_ << endl;138 sortie << phaseStep_ << " " << totalCharge_ << endl;139 return sortie.str();140 }128 // string elementRfgun::FileOutputFlow() const 129 // { 130 // ostringstream sortie; 131 // // on prend les troncatures tmax et rmax à 3 sigmas 132 // // sortie << elementName_.getElementType() << endl; 133 // sortie << elementName_.getGenericLabel() << endl; 134 // sortie << specificName_ << endl; 135 // sortie << nmacrop_ << " " << sigma_t_ << " " << sigma_r_ << endl; 136 // sortie << emit_x_ << " " << emit_y_ << endl; 137 // sortie << E_cin_ << " " << sigma_E_ << endl; 138 // sortie << phaseStep_ << " " << totalCharge_ << endl; 139 // return sortie.str(); 140 // } 141 141 142 142 vector< pair<string, vector<string> > > elementRfgun::parametersToSoftware () const … … 164 164 } 165 165 166 void elementRfgun::FileInput(ifstream& ifs)167 {168 ifs >> specificName_;169 ifs >> nmacrop_ >> sigma_t_ >> sigma_r_;170 ifs >> emit_x_ >> emit_y_;171 ifs >> E_cin_ >> sigma_E_;172 ifs >> phaseStep_ >> totalCharge_;173 }166 // void elementRfgun::FileInput(ifstream& ifs) 167 // { 168 // ifs >> specificName_; 169 // ifs >> nmacrop_ >> sigma_t_ >> sigma_r_; 170 // ifs >> emit_x_ >> emit_y_; 171 // ifs >> E_cin_ >> sigma_E_; 172 // ifs >> phaseStep_ >> totalCharge_; 173 // } 174 174 175 175 string elementRfgun::print() … … 198 198 void elementRfgun::InputRep(UAPNode* root) 199 199 { 200 UAPNode* ele = root->addChild("element"); 201 ele->addAttribute("name",specificName_); 202 200 // UAPNode* ele = root->addChild("element"); 201 // ele->addAttribute("name",specificName_); 202 // UAPNode* node = NULL; 203 // node = ele->addChild("description"); 204 // node->addAttribute("type",elementName_.getGenericLabel()); 205 UAPNode* ele = setAMLelementHeader(root); 203 206 UAPNode* node = ele->addChild("comment"); 204 207 node->addAttribute("type","RFgun"); … … 217 220 node->addChild("emittance_b")->addAttribute("design",txt); 218 221 txt = mixedTools::doubleToString(E_cin_); 219 txt = mixedTools::doubleToString(E_cin_);220 222 node->addChild("total_energy")->addAttribute("design",txt); 221 223 txt = mixedTools::doubleToString(sigma_E_); … … 232 234 } 233 235 236 void elementRfgun::FileAMLInput(UAPNode* entree) 237 { 238 if ( !checkAMLelementGenericName(entree) ) return; 239 UAPNode* beam = entree->getChildByName("beam"); 240 AMLtools::readAMLParameterAttribut(beam, "n_particles", "design", nmacrop_); 241 AMLtools::readAMLParameterAttribut(beam, "sig_t", "design", sigma_t_); 242 AMLtools::readAMLParameterAttribut(beam, "emittance_a", "design", emit_x_); 243 AMLtools::readAMLParameterAttribut(beam, "emittance_b", "design", emit_y_); 244 AMLtools::readAMLParameterAttribut(beam, "total_energy", "design", E_cin_); 245 AMLtools::readAMLParameterAttribut(beam, "sig_e", "design", sigma_E_); 246 AMLtools::readAMLParameterAttribut(beam, "particle_charge", "design", totalCharge_); 247 248 AMLtools::readAMLParameterAttribut(entree, "sigma_r", "value", sigma_r_); 249 AMLtools::readAMLParameterAttribut(entree, "phaseStep", "value", phaseStep_); 250 251 }
Note: See TracChangeset
for help on using the changeset viewer.