Changeset 434 in PSPA


Ignore:
Timestamp:
Nov 22, 2013, 9:57:54 AM (10 years ago)
Author:
lemeur
Message:

correction softwaregenerator

Location:
Interface_Web/trunk/pspaWT/sources
Files:
3 edited

Legend:

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

    r418 r434  
    375375void particleBeam::particlesPhaseSpaceComponent(vector<double>& coord, unsigned index)
    376376{
     377
    377378  if ( !particleRepresentationOk_ ) return;
    378379 
    379380  coord.clear();
    380381  coord.resize(relativePartic_.size(), 0.0 );
    381   cout << " particleBeam::particlesPhaseSpaceComponent index = " << index << endl;
     382  //  cout << " particleBeam::particlesPhaseSpaceComponent index = " << index << endl;
    382383
    383384  if ( index <= 2 ) {
     
    392393 
    393394  if ( index >  2 && index < 5 ) {
    394     cout << " particleBeam::particlesPhaseSpaceComponent traitement vitesses " << endl;
     395    //    cout << " particleBeam::particlesPhaseSpaceComponent traitement vitesses " << endl;
    395396    for (unsigned i = 0; i < relativePartic_.size(); ++i) {
    396397      double begamz = relativePartic_.at(i).getBetaGamma().getComponent(2);
     
    401402      }
    402403    }
    403     cout << " particleBeam::particlesPhaseSpaceComponent traitement vitesses TERMINE " << endl;
     404    //    cout << " particleBeam::particlesPhaseSpaceComponent traitement vitesses TERMINE " << endl;
    404405    return;
    405406  }
     
    727728    double gamma = relativePartic_.at(particleIndex).getGamma();
    728729    //    TRIDVECTOR pos = relativePartic_.at(particleIndex).getPosition();
     730    // cout << " ------------------ particleBeam::coordonneesDeployees ----- " << endl;
     731    //   cout << " particleBeam::coordonneesDeployees " << relativePartic_.at(particleIndex).FileOutputFlow() << endl;
     732    //   cout << " par reference x= " << relativePartic_.at(particleIndex).getReferenceToPosition().getComponent(0);
     733    // cout << " ----------------------------------------------------- " << endl;
     734
     735
     736
    729737    double xx = relativePartic_.at(particleIndex).getReferenceToPosition().getComponent(0);
    730738    double yy = relativePartic_.at(particleIndex).getReferenceToPosition().getComponent(1);
     
    733741    //    TRIDVECTOR begam= goodPartic_.at(particleIndex).getBetaGamma();
    734742    double begamz = relativePartic_.at(particleIndex).getReferenceToBetaGamma().getComponent(2);
    735     double dz = begamz * cdt / gamma;
    736     double xp = relativePartic_.at(particleIndex).getReferenceToBetaGamma().getComponent(0)/begamz;
    737     double yp = relativePartic_.at(particleIndex).getReferenceToBetaGamma().getComponent(1)/begamz;
    738     xx += xp * dz;
    739     yy += yp * dz;   
    740     return TRIDVECTOR(xx, yy, dz);
     743    double fac = cdt / gamma;
     744    //    double dz = begamz * fac;
     745    xx += relativePartic_.at(particleIndex).getReferenceToBetaGamma().getComponent(0) * fac;
     746    yy += relativePartic_.at(particleIndex).getReferenceToBetaGamma().getComponent(1) * fac;
     747    return TRIDVECTOR(xx, yy, begamz * fac);
    741748 }
  • Interface_Web/trunk/pspaWT/sources/controler/src/softwareGenerator.cc

    r418 r434  
    1515{
    1616  nameOfSoftware_ = nomDeLogiciel("generator");
    17   registerElement(nomdElements::beam,TBoolOk);
     17  registerElement(nomdElements::RFgun,TBoolOk);
    1818}
    1919
     
    227227    if ( faisceau.at(k).flag == -1 ) {
    228228      particles.push_back(bareParticle(pos,betagamma));
     229      //      cout << " generator enregistre " << particles.back().FileOutputFlow() << endl;
    229230    } else {
    230231      passiveParticles.push_back(bareParticle(pos,betagamma));
  • Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_pspaApplication.cc

    r431 r434  
    612612    seriesType = PointSeries;
    613613    titre = " phase space ";
    614     cout << " PspaApplication::faireDessinPhaseSpace APPEL " << endl;
    615614    beam->particlesPhaseSpaceData(xcor,ycor,legende,namex,namey);
    616     cout << " PspaApplication::faireDessinPhaseSpace RETOUR " << endl;
     615    // for ( int kk=0; kk < xcor.size(); kk++)
     616    //   {
     617    //  cout << " dess. phas. x= " << xcor.at(kk) << " x'= " << ycor.at(kk) << endl;
     618    //   }
    617619  } else {
    618620    GWt_dialog warningBeamState(" graphical analysis", "the beam state does not allow providing a drawing with macroparticles !", GWt_dialog::Error, false,true);
     
    874876    model->setData(i, 0, xcor.at(i));
    875877    model->setData(i, 1, ycor.at(i));
    876     //    cout << " PspaApplication::chartPlot2vec el= " << i+1 << " x= " << xcor.at(i) << " y= " << ycor.at(i) << endl;
    877   }
    878    
     878    //        cout << " PspaApplication::chartPlot2vec el= " << i+1 << " x= " << xcor.at(i) << " y= " << ycor.at(i) << endl;
     879  }
     880  //  cout << " PspaApplication::chartPlot2vec FLAG 0 " << endl;
    879881  WCartesianChart *chart = new WCartesianChart(toto);
    880882  if (!makeIcon) chart->setTitle(title);
     
    896898  chart->axis(YAxis).setLocation(value);
    897899 
     900  //  cout << " PspaApplication::chartPlot2vec FLAG 1 " << endl;
     901
    898902  WDataSeries s(1,seriesType);
    899903  s.setPen(WColor("red"));
     
    911915    chart->axis(Y1Axis).setGridLinesEnabled(true);
    912916  }
    913  
     917  //   cout << " PspaApplication::chartPlot2vec FLAG 2 " << endl;
     918
    914919  chart->resize(width,height); // WPaintedWidget must be given explicit size
    915920  chart->setMargin(10, Top | Bottom); // ?
     
    927932    chart->axis(YAxis).setLabelFont(yAxisFont);
    928933  }
     934  //  cout << " PspaApplication::chartPlot2vec FLAG 3 " << endl;
    929935
    930936#ifdef HAS_IMAGEMAGIC
     937
     938  //  cout << " PspaApplication::chartPlot2vec FLAG MAGIC " << endl;
    931939
    932940  // no background
     
    938946   
    939947  std::string name;
    940 /*
     948  /*
    941949 Wt::WRasterImage pngImage("png", 1000, 1000);
    942950  Wt::WPainter p(&pngImage);
     
    945953  std::ofstream f(name.c_str(), std::ios::out |std::ios::trunc | std::ios::binary);
    946954  pngImage.write(f);
    947 */
    948  
     955  */
    949956
    950957  Wt::WPdfImage pdfImage("1000", "600");
    951   {
     958    {
    952959   Wt::WPainter p1(&pdfImage);
    953960    chart->paint(p1);
    954   }
     961      }
    955962
    956963  name = workingDir_ + "/chart-"+sessionId ()+".pdf";
     
    961968
    962969#endif
     970  //  cout << " PspaApplication::chartPlot2vec FLAG FIN" << endl;
    963971
    964972}
Note: See TracChangeset for help on using the changeset viewer.