Ignore:
Timestamp:
Feb 26, 2013, 2:35:45 PM (11 years ago)
Author:
touze
Message:

nvx element snapshot

File:
1 edited

Legend:

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

    r316 r342  
     1
    12#include "softwareGenerator.h"
    23#include "abstractElement.h"
     
    45#include "mathematicalConstants.h"
    56#include "PhysicalConstants.h"
    6 //#include "dataManager.h"
    7 
    87
    98softwareGenerator::softwareGenerator() : abstractSoftware()
    10 {
    11   ;
    12 }
    13 
    14 
    15 
     9{;}
    1610
    1711softwareGenerator::softwareGenerator(string inputFileName, globalParameters* globals, dataManager* dt) : abstractSoftware(inputFileName, globals, dt)
    18 {
    19   ;
    20 }
    21 
     12{;}
    2213
    2314bool softwareGenerator::createInputFile(particleBeam* beamBefore, unsigned int numeroDeb, unsigned int numeroFin, string workingDir)
     
    3324    return false;
    3425  }
     26
    3527  ofstream outfile;
    3628  string name = workingDir + inputFileName_;
     
    5345}
    5446
    55 
    56 bool  softwareGenerator::execute(unsigned int numeroDeb,unsigned int numeroFin,string workingDir) {
     47bool softwareGenerator::execute(unsigned int numeroDeb,unsigned int numeroFin,string workingDir) {
     48 
     49  bool ExecuteStatus = true;
     50 
    5751  ostringstream sortie;
    58   bool ExecuteStatus = true;
    59   //  resul.clear();
    6052  sortie << " EXECUTION DE GENERATOR DE l'ELEMENT " << numeroDeb << " A L'ELEMENT " << numeroFin << endl;
    6153
    62   char buf[132];
    6354  string generatorJob = workingDir + "generator";
    6455  generatorJob += string("   ");
    6556  generatorJob += workingDir + inputFileName_;
    6657
    67 
    68   ofstream outfile;
    69   string nameOut = workingDir + "generator.output";
    7058  string resultOfRun;
    71   bool success = launchJob(generatorJob, resultOfRun);
     59  bool success = launchJob(generatorJob,resultOfRun);
    7260  sortie << resultOfRun << endl;
    73   if ( !success) {
     61  if ( !success ) {
    7462    sortie << " launching of generator failed " << endl;
    7563    ExecuteStatus = false;
    76   }
    77   else {
     64  } else {
    7865    cout << " execution generator MARCHE " << endl;
    7966    sortie << resultOfRun;
     67    string nameOut = workingDir + "generator.output";
     68    ofstream outfile;
    8069    outfile.open(nameOut.c_str(), ios::out);
    81     if (!outfile)
    82       {
    83         sortie << " error first opening transport output stream " << nameOut << endl;
    84         ExecuteStatus = false;
    85       }
    86     else {
     70    if (!outfile) {
     71      sortie << " error first opening transport output stream " << nameOut << endl;
     72      ExecuteStatus = false;
     73    } else {
    8774      // on copie la sortie dans un fichier 'generator.out'
    8875      outfile << resultOfRun << endl;
     
    9077    }
    9178  }
    92   //  resul =  sortie.str();
    93     dataManager_->consoleMessage(sortie.str());
     79 
     80  dataManager_->consoleMessage(sortie.str());
    9481  return ExecuteStatus;
    9582}
Note: See TracChangeset for help on using the changeset viewer.