Ignore:
Timestamp:
Feb 7, 2014, 2:00:55 PM (10 years ago)
Author:
lemeur
Message:

lecture fichier sauvegarde AML

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Interface_Web/trunk/pspaWT/sources/controler/src/elementSextupole.cc

    r487 r488  
    99  defaultSpecificName_ = "spole";
    1010  specificName_ = defaultSpecificName_;
    11   length_ = 0;
     11  //  length_ = 0;
    1212  component_ = 0.0;
    1313 
     
    2222  parametersString_[++compteur]= mixedTools::intToString(nbParam_);
    2323  parametersString_[++compteur]= specificName_;
    24   parametersString_[++compteur]= mixedTools::doubleToString(length_);
     24  parametersString_[++compteur]= mixedTools::doubleToString(lenghtElem_);
    2525  parametersString_[++compteur]= mixedTools::doubleToString(component_);
    2626  if ( compteur != nbParam_ ) {
     
    4747
    4848  specificName_ = param[++compteur];
    49   length_ = atof(param[++compteur].c_str());
     49  lenghtElem_ = atof(param[++compteur].c_str());
    5050  component_ = atof(param[++compteur].c_str());
    5151}
    5252
    53 string elementSextupole::FileOutputFlow() const
    54 {
    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// }
    6161
    6262vector< pair<string, vector<string> > > elementSextupole::parametersToSoftware () const
     
    6767  sortie.back().second.push_back(specificName_);
    6868  sortie.push_back( pair<string, vector<string> >("attributes",vector<string>() ) );
    69   sortie.back().second.push_back(mixedTools::doubleToString(length_));
     69  sortie.back().second.push_back(mixedTools::doubleToString(lenghtElem_));
    7070  sortie.back().second.push_back(mixedTools::doubleToString(component_));
    7171  return sortie;
    7272}
    7373
    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// }
    7979
    8080string elementSextupole::print()
     
    8383  txt += specificName_;
    8484  txt += "\nlength (m): ";
    85   txt += mixedTools::doubleToString(length_);
     85  txt += mixedTools::doubleToString(lenghtElem_);
    8686  txt += "\ncomponent (m^-3): ";
    8787  txt += mixedTools::doubleToString(component_); 
     
    9191void elementSextupole::InputRep(UAPNode* root)
    9292{
    93   UAPNode* ele = root->addChild("element");
    94   ele->addAttribute("name",specificName_);
     93  UAPNode* ele = setAMLelementHeader(root);
    9594
    9695  string txt = "";
     
    10099  knl->addAttribute("design",txt);
    101100
    102   txt = mixedTools::doubleToString(length_);
     101  txt = mixedTools::doubleToString(lenghtElem_);
    103102  ele->addChild("length")->addAttribute("design",txt);
    104103}
     104
     105void 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.