Ignore:
Timestamp:
Nov 15, 2013, 3:30:50 PM (11 years ago)
Author:
touze
Message:

systeme periodique (mailles) + multipoles + madx

File:
1 edited

Legend:

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

    r419 r431  
    22#include "dataManager.h"
    33#include <algorithm>
     4
    45abstractSoftware::abstractSoftware()
    56{
    67  globParamPtr_ = NULL;
     8  sectParamPtr_ = NULL; //xx
    79  dataManager_ = NULL;
    810  nameOfSoftware_ = nomDeLogiciel("unknownSoftware");
    911}
    1012
    11 abstractSoftware::abstractSoftware(string inputFileName, globalParameters* globals, dataManager* dt) {
     13abstractSoftware::abstractSoftware(string inputFileName, globalParameters* globals, dataManager* dt)
     14{
    1215  inputFileName_ = inputFileName;
    1316  globParamPtr_ = globals;
     17  sectParamPtr_ = NULL; //xx
    1418  dataManager_ = dt;
    1519  numeroDeb_ = 0;
     
    1822}
    1923
    20 bool abstractSoftware::initComputationLimits(unsigned int numeroDeb,unsigned int numeroFin) {
     24abstractSoftware::abstractSoftware(string inputFileName,sectorParameters* lattice,dataManager* dt)
     25{
     26  inputFileName_ = inputFileName;
     27  globParamPtr_ = NULL;
     28  sectParamPtr_ = lattice;
     29  dataManager_ = dt;
     30  numeroDeb_ = 0;
     31  numeroFin_ = 0;
     32  nameOfSoftware_ = nomDeLogiciel("unknownSoftware");
     33}
     34
     35bool abstractSoftware::initComputationLimits(unsigned int numeroDeb,unsigned int numeroFin)
     36{
    2137  numeroDeb_ = numeroDeb;
    2238  numeroFin_ = numeroFin;
     
    2440}
    2541
    26 bool abstractSoftware::ComputationLimitsOk() const {
    27   if (   numeroDeb_ < 1 ||  numeroFin_ < 1 || numeroDeb_ > dataManager_->getBeamLineSize() || numeroFin_ > dataManager_->getBeamLineSize() ) {
    28   dataManager_->consoleMessage(" abstractSoftware::initComputationLimit : numero of element out of limits in software " + getName() );
     42bool abstractSoftware::ComputationLimitsOk() const
     43{
     44  if (numeroDeb_ < 1 || numeroFin_ < 1 || numeroDeb_ > dataManager_->getBeamLineSize() || numeroFin_ > dataManager_->getBeamLineSize() ) {
     45    dataManager_->consoleMessage(" abstractSoftware::initComputationLimit : num of element out of limits in software " + getName() );
    2946    return false;
    3047  } else {
     
    3350}
    3451
    35 
    36 void abstractSoftware::registerElement(nomdElements::typedElement nomdel,trivaluedBool b) {
     52void abstractSoftware::registerElement(nomdElements::typedElement nomdel,trivaluedBool b)
     53{
    3754  if (b == TBoolIgnore) {
    3855    ignoredElements_.push_back(nomdel);
     
    4259}
    4360
    44 trivaluedBool abstractSoftware::doAcceptElement(nomdElements::typedElement typdel) {
    45   if (acceptedElements_.size() == 0) {
     61trivaluedBool abstractSoftware::doAcceptElement(nomdElements::typedElement typdel)
     62{
     63
     64  //xx
     65  if (acceptedElements_.size() == 0 && nameOfSoftware_ != nomDeLogiciel::unknownSoftware) {
    4666    return TBoolError;
    4767  }
    48   if ( std::find(acceptedElements_.begin(), acceptedElements_.end(), typdel) != acceptedElements_.end()) {
     68
     69  if (std::find(acceptedElements_.begin(),acceptedElements_.end(),typdel) != acceptedElements_.end()) {
    4970    return TBoolOk;
    5071  }
     72
    5173  if (ignoredElements_.size() == 0) {
    5274    return TBoolError;
    5375  }
    54   if ( std::find(ignoredElements_.begin(), ignoredElements_.end(), typdel) != ignoredElements_.end()) {
     76
     77  if (std::find(ignoredElements_.begin(),ignoredElements_.end(),typdel) != ignoredElements_.end()) {
    5578    return TBoolIgnore;
    5679  }
     80
    5781  return TBoolOk;
    5882}
    59 
    6083
    6184bool abstractSoftware::launchJob(string commandLine, string& resul)
     
    6689  ostringstream sortie;
    6790  if (pp == NULL) {
    68     sortie << " launching  failed : " << commandLine << endl;
     91    sortie << " launching failed : " << commandLine << endl;
    6992    ExecuteStatus = false;
    7093  } else {
    71     cout << " executing command :  "  << commandLine << endl;
    7294    // on copie la sortie dans le fichier assigne
    7395    char buf[132];
Note: See TracChangeset for help on using the changeset viewer.