Changeset 418 in PSPA for Interface_Web/trunk/pspaWT/sources/controler/src/elementSoleno.cc
- Timestamp:
- Jun 21, 2013, 10:16:56 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Interface_Web/trunk/pspaWT/sources/controler/src/elementSoleno.cc
r387 r418 11 11 nbParam_ = elementName_.getElementNbParameters(); 12 12 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); 15 15 } 16 16 … … 18 18 void elementSoleno::setDefaultValues() 19 19 { 20 default Label_ = "solnd";20 defaultSpecificName_ = "solnd"; 21 21 B0Def_ = 0.0; 22 22 varyB0Def_ = false; … … 25 25 void elementSoleno::setDefaults() 26 26 { 27 label_ = defaultLabel_;27 specificName_ = defaultSpecificName_; 28 28 B0_ = B0Def_; 29 29 varyB0_ = varyB0Def_; … … 36 36 int compteur = -1; 37 37 parametersString_[++compteur] = mixedTools::intToString(nbParam_); 38 parametersString_[++compteur] = label_;38 parametersString_[++compteur] = specificName_; 39 39 parametersString_[++compteur] = mixedTools::doubleToString(lenghtElem_); 40 40 parametersString_[++compteur] = mixedTools::doubleToString(aperture_); … … 63 63 return; 64 64 } 65 label_ = param[++compteur];65 specificName_ = param[++compteur]; 66 66 lenghtElem_ = atof(param[++compteur].c_str()); 67 67 aperture_ = atof(param[++compteur].c_str()); … … 70 70 } 71 71 72 string elementSoleno::parmelaOutputFlow() const73 {74 ostringstream sortie;75 // on passe l'induction magnetique en Gauss76 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 // } 79 79 80 string elementSoleno::transportOutputFlow() const81 {82 ostringstream sortie;83 // on passe la longueur en metres84 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 // } 90 90 91 91 string elementSoleno::FileOutputFlow() const … … 93 93 ostringstream sortie; 94 94 // sortie << elementName_.getElementType() << endl; 95 sortie << elementName_.get ElementLabel() << endl;96 sortie << label_ << endl;95 sortie << elementName_.getGenericLabel() << endl; 96 sortie << specificName_ << endl; 97 97 sortie << lenghtElem_ << " " << aperture_<< " " << B0_ << " " << varyB0_ << endl; 98 98 return sortie.str(); 99 99 } 100 100 101 102 vector< 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 101 118 void elementSoleno::FileInput(ifstream& ifs) 102 119 { 103 ifs >> label_;120 ifs >> specificName_; 104 121 ifs >> lenghtElem_ >> aperture_ >> B0_ >> varyB0_ ; 105 122 } … … 109 126 string txt = ""; 110 127 111 txt += label_;128 txt += specificName_; 112 129 txt += "\nlength (cm) : "; 113 130 txt += mixedTools::doubleToString(lenghtElem_);
Note: See TracChangeset
for help on using the changeset viewer.