Ignore:
Timestamp:
Jun 21, 2013, 10:16:56 AM (11 years ago)
Author:
lemeur
Message:

definition des compatibilites des elements dans les software

File:
1 edited

Legend:

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

    r387 r418  
    1111    nbParam_ = elementName_.getElementNbParameters();
    1212    parametersString_ = new string[nbParam_+1];
    13     registerAcceptableSoftware(nomDeLogiciel::transport, TBoolOk);
    14     registerAcceptableSoftware(nomDeLogiciel::parmela, TBoolOk);
     13    // registerAcceptableSoftware(nomDeLogiciel::transport, TBoolOk);
     14    // registerAcceptableSoftware(nomDeLogiciel::parmela, TBoolOk);
    1515}
    1616
     
    1818  void elementSoleno::setDefaultValues()
    1919  {
    20     defaultLabel_ = "solnd";
     20    defaultSpecificName_ = "solnd";
    2121    B0Def_ = 0.0;
    2222    varyB0Def_ = false;
     
    2525  void elementSoleno::setDefaults()
    2626  {
    27     label_ = defaultLabel_;
     27    specificName_ = defaultSpecificName_;
    2828    B0_ = B0Def_;
    2929    varyB0_ = varyB0Def_;
     
    3636   int compteur = -1;
    3737   parametersString_[++compteur] = mixedTools::intToString(nbParam_);
    38    parametersString_[++compteur] = label_;
     38   parametersString_[++compteur] = specificName_;
    3939   parametersString_[++compteur] = mixedTools::doubleToString(lenghtElem_);
    4040   parametersString_[++compteur] = mixedTools::doubleToString(aperture_);
     
    6363          return;
    6464        }
    65   label_ = param[++compteur];
     65  specificName_ = param[++compteur];
    6666    lenghtElem_ = atof(param[++compteur].c_str());
    6767    aperture_  = atof(param[++compteur].c_str());
     
    7070 }
    7171
    72 string elementSoleno::parmelaOutputFlow() const
    73   {
    74     ostringstream sortie;
    75     // on passe l'induction magnetique en Gauss
    76     sortie << "SOLENOID /l=" << lenghtElem_ << "  /aper=" << aperture_ << "  /iout=1 /h=" << 1000.*B0_  << endl;
    77     return sortie.str();
    78   }
     72// string elementSoleno::parmelaOutputFlow() const
     73//   {
     74//     ostringstream sortie;
     75//     // on passe l'induction magnetique en Gauss
     76//     sortie << "SOLENOID /l=" << lenghtElem_ << "  /aper=" << aperture_ << "  /iout=1 /h=" << 1000.*B0_  << endl;
     77//     return sortie.str();
     78//   }
    7979
    80 string elementSoleno::transportOutputFlow() const
    81   {
    82     ostringstream sortie;
    83     // on passe la longueur en metres
    84     sortie << label_ << ":" << "  SOLENOID, L=" << 0.01*lenghtElem_ << ", B=" << B0_ << ";" << endl;
    85     if ( varyB0_ ) {
    86       sortie <<  "  VARY, " << label_+"[B]"  << ";" << endl;
    87     }
    88     return sortie.str();
    89   }
     80// string elementSoleno::transportOutputFlow() const
     81//   {
     82//     ostringstream sortie;
     83//     // on passe la longueur en metres
     84//     sortie << specificName_ << ":" << "  SOLENOID, L=" << 0.01*lenghtElem_ << ", B=" << B0_ << ";" << endl;
     85//     if ( varyB0_ ) {
     86//       sortie <<  "  VARY, " << specificName_+"[B]"  << ";" << endl;
     87//     }
     88//     return sortie.str();
     89//   }
    9090
    9191string elementSoleno::FileOutputFlow() const
     
    9393    ostringstream sortie;
    9494    //    sortie << elementName_.getElementType() << endl;
    95     sortie << elementName_.getElementLabel() << endl;
    96     sortie  << label_ << endl;
     95    sortie << elementName_.getGenericLabel() << endl;
     96    sortie  << specificName_ << endl;
    9797    sortie << lenghtElem_ << "  " << aperture_<< " "  << B0_ << " " << varyB0_ << endl;
    9898    return sortie.str();
    9999  }
    100100
     101
     102vector< pair<string, vector<string> > > elementSoleno::parametersToSoftware () const {
     103  vector< pair<string, vector<string> > >  sortie;
     104  sortie.push_back( pair<string, vector<string> >("labelsGenericSpecific",  vector<string>() ) );
     105  sortie.back().second.push_back(elementName_.getGenericLabel());
     106  sortie.back().second.push_back(specificName_);
     107  sortie.push_back( pair<string, vector<string> >("lenghtAperture",  vector<string>() ) );
     108  sortie.back().second.push_back(mixedTools::doubleToString(lenghtElem_));
     109  sortie.back().second.push_back(mixedTools::doubleToString(aperture_));
     110  sortie.push_back( pair<string, vector<string> >("field",  vector<string>() ) );
     111  sortie.back().second.push_back(mixedTools::doubleToString(B0_));
     112  sortie.push_back( pair<string, vector<string> >("isBvariable",  vector<string>() ) );
     113  sortie.back().second.push_back(mixedTools::intToString(varyB0_));
     114  return sortie;
     115}
     116
     117
    101118void elementSoleno::FileInput(ifstream& ifs)
    102119{
    103   ifs >> label_;
     120  ifs >> specificName_;
    104121  ifs >> lenghtElem_ >>  aperture_ >> B0_ >> varyB0_ ;
    105122}
     
    109126    string txt = "";
    110127
    111     txt += label_;
     128    txt += specificName_;
    112129    txt += "\nlength (cm) : ";
    113130    txt += mixedTools::doubleToString(lenghtElem_);
Note: See TracChangeset for help on using the changeset viewer.