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/elementSoleno.cc

    r424 r488  
    8484//   }
    8585
    86 string elementSoleno::FileOutputFlow() const
    87 {
    88   ostringstream sortie;
    89   //    sortie << elementName_.getElementType() << endl;
    90   sortie << elementName_.getGenericLabel() << endl;
    91   sortie  << specificName_ << endl;
    92   sortie << lenghtElem_ << "  " << aperture_<< " "  << B0_ << " " << varyB0_ << endl;
    93   return sortie.str();
    94 }
     86// string elementSoleno::FileOutputFlow() const
     87// {
     88//   ostringstream sortie;
     89//   //    sortie << elementName_.getElementType() << endl;
     90//   sortie << elementName_.getGenericLabel() << endl;
     91//   sortie  << specificName_ << endl;
     92//   sortie << lenghtElem_ << "  " << aperture_<< " "  << B0_ << " " << varyB0_ << endl;
     93//   return sortie.str();
     94// }
    9595
    9696
     
    110110}
    111111
    112 void elementSoleno::FileInput(ifstream& ifs)
    113 {
    114   ifs >> specificName_;
    115   ifs >> lenghtElem_ >>  aperture_ >> B0_ >> varyB0_ ;
    116 }
     112// void elementSoleno::FileInput(ifstream& ifs)
     113// {
     114//   ifs >> specificName_;
     115//   ifs >> lenghtElem_ >>  aperture_ >> B0_ >> varyB0_ ;
     116// }
    117117
    118118string elementSoleno::print()
     
    133133void elementSoleno::InputRep(UAPNode* root)
    134134{
    135   UAPNode* ele = root->addChild("element");
    136   ele->addAttribute("name",specificName_);
     135  // UAPNode* ele = root->addChild("element");
     136  // ele->addAttribute("name",specificName_);
     137  UAPNode* ele = setAMLelementHeader(root);
    137138
    138139  string txt = "";
     
    158159  }
    159160}
     161
     162void elementSoleno::FileAMLInput(UAPNode* entree)
     163{
     164  if ( !checkAMLelementGenericName(entree) ) return;
     165  AMLtools::readAMLParameterAttribut(entree, "length", "design", lenghtElem_);
     166
     167  UAPNode* ouverture = entree->getChildByName("aperture");
     168  if ( !ouverture ) {
     169    cout << " elementSoleno::FileAMLInput ERREUR pas de noeud AML <aperture>  " << endl;
     170    return;
     171  }
     172  AMLtools::readAMLParameterAttribut(ouverture, "xy_limit", "design", aperture_);
     173  UAPNode* solenoide = entree->getChildByName("solenoid");
     174  if ( !solenoide ) {
     175    cout << " elementSoleno::FileAMLInput ERREUR pas de noeud AML <solenoide>  " << endl;
     176    return;
     177  }
     178  AMLtools::readAMLParameterAttribut(solenoide, "ksol", "design", B0_);
     179  string vrai;
     180  AMLtools::readAMLParameterAttribut(solenoide, "vary", "is_on", vrai);
     181  if ( vrai == string("true")) varyB0_ = true;
     182  else varyB0_ = false;
     183}
Note: See TracChangeset for help on using the changeset viewer.