#include "GWt_accelerator.h" #include "GWt_sector.h" #include "GWt_machine.h" #include #include #include #include #include #include #include #include #include #include #include //- Ouvrir le premier secteur quand il est chargé //- Ajouter les sectionToExecute //- Fixer le addConsoleMessage() //- remise a jour des éléments si on on change un bout de section GWt_accelerator::GWt_accelerator(WContainerWidget* parent, dataManager* dt) : WContainerWidget(parent), dataManager_(dt) { cout << " GWt_accelerator::GWt_accelerator CONSTRUCTION NOUVEL ACCELERATOR " << endl; setObjectName("accelerator"); addStyleClass("acceleratorPanel"); nameOfCase_ = "pspa"; // default // FIXME WContainerWidget* menu = new WContainerWidget(this); menu->addStyleClass("acceleratorMenu"); // Wt::WHBoxLayout* hTopLineLayout = new WHBoxLayout(); // topLine->setLayout(hTopLineLayout); new WLabel("my accelerator ",menu); // Parameters WPushButton* actionParameters = new WPushButton("",menu); // set tooltips actionParameters->setToolTip("change parameters"); // Set class for actions elements actionParameters->setStyleClass("Button WhiteButton parameters"); actionParameters->setMaximumSize(32,32); actionParameters->setMinimumSize(32,32); // Add sector WPushButton* addSectorParameters = new WPushButton("",menu); // set tooltips addSectorParameters->setToolTip("add a sector"); // Set class for actions elements addSectorParameters->setStyleClass("Button WhiteButton addSector"); addSectorParameters->setMaximumSize(32,32); addSectorParameters->setMinimumSize(32,32); // expand machine WPushButton* expandMachine = new WPushButton("init/expand machine",menu); // set tooltips expandMachine->setToolTip("expand the machine"); // Set class for actions elements expandMachine->setStyleClass("Button WhiteButton expand"); expandMachine->setMaximumSize(128,32); expandMachine->setMinimumSize(128,32); // action expandMachine->clicked().connect(this,&GWt_accelerator::expandMachine); // Run WPushButton* runParameters = new WPushButton("",menu); // set tooltips runParameters->setToolTip("run this accelerator"); // Set class for actions elements runParameters->setStyleClass("Button WhiteButton run"); runParameters->setMaximumSize(32,32); runParameters->setMinimumSize(32,32); WPushButton* boutongraphicalAnalysis = new WPushButton("",menu); boutongraphicalAnalysis->setStyleClass("histoButton"); boutongraphicalAnalysis->setToolTip ("analyse graphique"); boutongraphicalAnalysis->setMaximumSize(32,32); boutongraphicalAnalysis->setMinimumSize(32,32); new WBreak(this); WScrollArea* scrollWidget = new WScrollArea(this); WContainerWidget* acceleratorScrollArea = new WContainerWidget(); scrollWidget->setWidget(acceleratorScrollArea); acceleratorScrollArea->setStyleClass("acceleratorContent"); WContainerWidget* acceleratorGlobalView = new WGroupBox("Global view",acceleratorScrollArea); acceleratorDetailledView_ = new WGroupBox("Detailled view of sector",acceleratorScrollArea); acceleratorComputingView_ = new WGroupBox("Computing view",acceleratorScrollArea); acceleratorGlobalViewLayout_= new WHBoxLayout(); acceleratorGlobalView->setLayout(acceleratorGlobalViewLayout_); // read configuration readConfiguration(); // Actions addSectorParameters->clicked().connect(this,&GWt_accelerator::addSector); runParameters->clicked().connect(this,&GWt_accelerator::run); boutongraphicalAnalysis->clicked().connect(this, &GWt_accelerator::dialogOnGraphics); graphicsDialog_ = new GWt_dialog("graphical analysis",createDrawingWidget(),false); graphicsDialog_->setMinimumSize(400,400); graphicsDialog_->setClosable(true); graphicsDialog_->hide(); } GWt_accelerator::~GWt_accelerator() { } void GWt_accelerator::addSector() { sector* sect = getDataManager()->addNewSector(); new GWt_sector(this,sect); } void GWt_accelerator::readConfiguration() { std::vector sect = dataManager_->getSectors(); if (sect.size() == 0) { // Add the first sector addSector(); } else { for (unsigned long a=0; a< sect.size(); a++) { new GWt_sector(this,sect[a]); } } // cout << " INTERVENTION GWt_accelerator::readConfiguration " << endl; // if ( dataManager_->getCurrentMachine() ) cout << " GWt_accelerator::readConfiguration nb elem. " << dataManager_->getCurrentMachine()->getNumberOfElements() << endl; new GWt_machine(this, dataManager_->getCurrentMachine()); } void GWt_accelerator::expandMachine() { cout << " coucou depuis GWt_accelerator::expandMachine() " << endl; if (getDataManager()->expandMachine()) new GWt_machine(this, dataManager_->getCurrentMachine()); } void GWt_accelerator::run() { cout << "***********************************" << endl; cout << " GWt_accelerator::executer() " << endl<(pspa_->getGlobalParam())->updateGlobals(); GWt_dialog calculDialog("Calcul en cours", "Veuillez patienter...", GWt_dialog::Wait, true,false); calculDialog.show(); wApp->processEvents(); if (!getDataManager()->executeAll()) { GWt_dialog warningDialog("PSPA : Echec", " echec lors de l'exécution !", GWt_dialog::Error, true,true); warningDialog.exec(); } // exec_go_->setDisabled(true); calculDialog.hide(); faireDessin(); } // recuperer les noms d'elements pour remplir les combos des menus de graphique void GWt_accelerator::faireDessin() { choixElementDessin_->clear(); choixHistoDessin_->clear(); if ( getDataManager()->getCurrentMachine() ) { for (unsigned k = 0; k < getDataManager()->getCurrentMachine()->getComputingBlocks().size(); k++) { computingBlock* cpblk = getDataManager()->getCurrentMachine()->getComputingBlocks().at(k); for (unsigned l = 0; l < cpblk->getNumberOfElements(); l++) { abstractElement* elPtr = cpblk->getElement(k); choixElementDessin_->addItem(elPtr->getLabel()); choixHistoDessin_->addItem(elPtr->getLabel()); } } } // for (unsigned k = 0; k < getDataManager()->getSectors().size(); k++) { // sector* sector = getDataManager()->getSectors()[k]; // for (unsigned l = 0; l < sector->getSectionsToExecute().size(); l++) { // sectionToExecute* section = sector->getSectionsToExecute()[l]; // for (unsigned m = 0; m < section->getElements().size(); m++) { // abstractElement* elPtr = section->getElements()[m]; // // if(elPtr->getNomdElement().getElementType() == snapshot) continue; // choixElementDessin_->addItem(elPtr->getLabel()); // choixHistoDessin_->addItem(elPtr->getLabel()); // } // } // } } WContainerWidget* GWt_accelerator::createDrawingWidget() { WGridLayout *glayout= new WGridLayout(); WContainerWidget* dessin = new WContainerWidget(); dessin->setLayout(glayout); group_ = new Wt::WButtonGroup(this); ///////////////////////////////////////////////////////////////////// choixEnveloppeDessin_ = new WComboBox(); choixEnveloppeDessin_->addItem("x"); // choixEnveloppeDessin_->addItem("y"); Wt::WRadioButton *button1= new WRadioButton(" enveloppe"); group_->addButton(button1,1); glayout->addWidget(button1,0,1); glayout->addWidget(choixEnveloppeDessin_,0,2); ///////////////////////////////////////////////////////////////////// choixElementDessin_ = new WComboBox(); choixElementDessin_->setMinimumSize(50,10); choixTypeDessinFaisceau_ = new WComboBox(); choixTypeDessinFaisceau_->addItem("courant_snyder"); choixTypeDessinFaisceau_->addItem("macroparticles"); Wt::WRadioButton *button2= new WRadioButton(" phase space after element"); choixAbsPhase_ = new WComboBox(); choixAbsPhase_->addItem("x"); choixAbsPhase_->addItem("y"); choixAbsPhase_->addItem("dz"); choixAbsPhase_->addItem("xp"); choixAbsPhase_->addItem("yp"); choixAbsPhase_->addItem("dE/E"); choixAbsPhase_->setCurrentIndex(0); choixOrdPhase_ = new WComboBox(); choixOrdPhase_->addItem("x"); choixOrdPhase_->addItem("y"); choixOrdPhase_->addItem("dz"); choixOrdPhase_->addItem("xp"); choixOrdPhase_->addItem("yp"); choixOrdPhase_->addItem("dE/E"); choixOrdPhase_->setCurrentIndex(3); group_->addButton(button2,2); glayout->addWidget(button2,1,1); glayout->addWidget(choixElementDessin_,1,2); glayout->addWidget(choixTypeDessinFaisceau_,1,3); // glayout->addWidget(new WText("abs. :"),2,2); glayout->addWidget(choixAbsPhase_,2,2); // glayout->addWidget(new WText("ord. :"),2,4); glayout->addWidget(choixOrdPhase_,2,3); ///////////////////////////////////////////////////////////////////// choixVariableHisto_= new WComboBox(); choixVariableHisto_->addItem("x"); choixVariableHisto_->addItem("y"); choixVariableHisto_->addItem("z"); choixVariableHisto_->addItem("xp"); choixVariableHisto_->addItem("yp"); choixVariableHisto_->addItem("dE/E"); choixVariableHisto_->setCurrentIndex(5); choixHistoDessin_ = new WComboBox(); Wt::WRadioButton *button3= new WRadioButton(" histogram after element "); group_->addButton(button3,3); glayout->addWidget(button3,3,1); glayout->addWidget(choixHistoDessin_,3,2); glayout->addWidget(choixVariableHisto_,3,3); ///////////////////////////////////////////////////////////////////// WPushButton *close= new WPushButton("close"); glayout->addWidget(close,4,1); close->clicked().connect(this,&GWt_accelerator::closeGraphicDialog); WPushButton *draw= new WPushButton("draw"); glayout->addWidget(draw,4,2,2,1); draw->clicked().connect(this,&GWt_accelerator::dessiner); ///////////////////////////////////////////////////////////////////// toto_ = new WContainerWidget(); dessin->addWidget(toto_); return dessin; } void GWt_accelerator::dialogOnGraphics() { graphicsDialog_->show(); } void GWt_accelerator::closeGraphicDialog() { cout << " close graphicsDialog_" << endl; for(unsigned i = 0; i < eDialog_.size(); i++) eDialog_[i]->done(WDialog::Rejected); eDialog_.clear(); graphicsDialog_->done(WDialog::Rejected); } void GWt_accelerator::dessiner() { int k= group_->checkedId(); cout << "dessiner k= " << k << endl; switch(k) { case 1: dessinerEnveloppe(); break; case 2: dessinerPhaseSpace(); break; case 3: dessinerHistogramme(); break; default: GWt_dialog graphicalWarning("graphical analysis","select a button",GWt_dialog::Warning,false,true); graphicalWarning.exec(); break; } } void GWt_accelerator::dessinerPhaseSpace() { int typeFaisceau = choixTypeDessinFaisceau_->currentIndex(); // int index = choixElementDessin_->currentIndex(); string nameAbs = choixAbsPhase_->currentText().toUTF8(); string nameOrd = choixOrdPhase_->currentText().toUTF8(); if ( nameAbs == nameOrd ) { GWt_dialog phaseSpaceError(" graphical analysis", "the beam coordinates must be different !", GWt_dialog::Error, false,true); phaseSpaceError.exec(); return; } string elementLabel = choixElementDessin_->currentText().toUTF8(); particleBeam* beam = dataManager_->getDiagnosticBeam_deprecated(elementLabel); // particleBeam* beam = dtmanage_->getDiagnosticBeam(index); if ( beam == NULL ) { GWt_dialog warningBeamState(" graphical analysis", "the beam does not exist at the end of this element !", GWt_dialog::Error, false,true); warningBeamState.exec(); return; } toto_->clear(); faireDessinPhaseSpace(toto_, beam, elementLabel, nameAbs, nameOrd, typeFaisceau); // if ( typeFaisceau == 0 ) // { // if ( !beam->momentRepresentationOk() ) beam->buildMomentRepresentation(); // faireDessinTransport(toto_, beam, nameAbs, nameOrd ); // } // else if ( typeFaisceau == 1 ) // { // if ( beam->particleRepresentationOk() ) faireDessinParmela(toto_, beam, nameAbs, nameOrd ); // else { // GWt_dialog warningBeamState(" graphical analysis", "the beam state does not allow providing a drawing with macroparticles !", GWt_dialog::Error, false,true); // warningBeamState.exec(); // } // } // else { // GWt_dialog warningTypeDrawing(" graphical analysis", "type of drawing not programmed !", GWt_dialog::Error, false,true); // warningTypeDrawing.exec(); // } } void GWt_accelerator::dessinerEnveloppe() { toto_->clear(); int typeEnveloppe = choixEnveloppeDessin_->currentIndex(); if ( typeEnveloppe == 0 ) { faireDessinEnveloppe(toto_, "x"); } else { GWt_dialog warningTypeEnveloppe(" graphical analysis", "type of enveloppe drawing not programmed !", GWt_dialog::Error, false,true); warningTypeEnveloppe.exec(); } } void GWt_accelerator::faireDessinEnveloppe(WContainerWidget* toto, string type) { std::time_t result = std::time(NULL); GWt_dialog* envDialog = new GWt_dialog(WString("enveloppe     (")+std::asctime(std::localtime(&result))+")",toto,false); eDialog_.push_back(envDialog); envDialog->setMinimumSize(400,400); envDialog->setClosable(true); envDialog->show(); // unsigned nbel = dtmanage_->getBeamLineSize(); vector xcor; vector ycor; string titre; string legendx; string legendy; dataManager_->donneesRmsEnveloppe(type,xcor,ycor,titre,legendx,legendy); Wt::Chart::SeriesType seriesType = Wt::Chart::LineSeries; Wt::Chart::FillRangeType fillRange = Wt::Chart::NoFill; Wt::Chart::AxisValue location = Wt::Chart::ZeroValue; bool isGridLinesEnabled = false; chartPlot2vec(envDialog->contents(),xcor,ycor,seriesType,fillRange,location,isGridLinesEnabled,titre,legendx,legendy,500,300); } void GWt_accelerator::faireDessinPhaseSpace(WContainerWidget* toto, particleBeam* beam, string elementLabel, string namex, string namey, int typeFaisceau) { vector xcor; vector ycor; vector legende; string titre; Wt::Chart::SeriesType seriesType; if ( typeFaisceau == 0 ) { seriesType = Wt::Chart::LineSeries; titre = "phase space rms"; beam->donneesDessinEllipse(xcor,ycor,legende,namex,namey); } else if ( typeFaisceau == 1 ) { seriesType = Wt::Chart::PointSeries; titre = " phase space "; beam->particlesPhaseSpaceData(xcor,ycor,legende,namex,namey); // for ( int kk=0; kk < xcor.size(); kk++) // { // cout << " dess. phas. x= " << xcor.at(kk) << " x'= " << ycor.at(kk) << endl; // } } else { GWt_dialog warningBeamState(" graphical analysis", "the beam state does not allow providing a drawing with macroparticles !", GWt_dialog::Error, false,true); warningBeamState.exec(); return; } std::time_t result = std::time(NULL); GWt_dialog* phaseSpaceDialog = new GWt_dialog(WString("phase space     (")+std::asctime(std::localtime(&result))+")",toto,false); eDialog_.push_back(phaseSpaceDialog); phaseSpaceDialog->setMinimumSize(400,400); phaseSpaceDialog->setClosable(true); new WText(" case : " + nameOfCase_, phaseSpaceDialog->contents()); new WBreak(phaseSpaceDialog->contents()); new WText(" after element : " + elementLabel, phaseSpaceDialog->contents()); for (int k=0 ; k < (int)legende.size(); k++) { new WBreak(phaseSpaceDialog->contents()); new WText(legende.at(k), phaseSpaceDialog->contents()); } Wt::Chart::FillRangeType fillRange = Wt::Chart::NoFill; Wt::Chart::AxisValue location = Wt::Chart::ZeroValue; bool isGridLinesEnabled = false; chartPlot2vec(phaseSpaceDialog->contents(),xcor,ycor,seriesType,fillRange,location,isGridLinesEnabled,titre,namex,namey,500,300); phaseSpaceDialog->show(); } void GWt_accelerator::dessinerHistogramme() { toto_->clear(); // std::time_t result = std::time(NULL); // GWt_dialog* histoDialog = new GWt_dialog(WString("histogramme     (")+std::asctime(std::localtime(&result))+")",toto_,false); // eDialog_.push_back(histoDialog); // histoDialog->setMinimumSize(400,400); // histoDialog->setClosable(true); string elementLabel = choixHistoDessin_->currentText().toUTF8(); particleBeam* beam = dataManager_->getDiagnosticBeam_deprecated(elementLabel); if (beam == NULL) { GWt_dialog warningBeamState("histogram","the beam does not exist at the end of this element !", GWt_dialog::Error, false,true); warningBeamState.exec(); return; } if (!beam->particleRepresentationOk()) { GWt_dialog warningBeamState("histogram", "the beam state does not allow providing a drawing with macroparticles !", GWt_dialog::Error, false,true); warningBeamState.exec(); return; } unsigned iabs= choixVariableHisto_->currentIndex(); vector xcor; vector hist; // double out[3]= {0.0}; vector legende; beam->histogramme(iabs,xcor,hist,legende); cout<<"xcor.size()= "<setMinimumSize(400,400); histoDialog->setClosable(true); histoDialog->show(); WContainerWidget *w= histoDialog->contents(); // // legendes // string unites[2]; // if(iabs == 0 || iabs == 1 || iabs == 2) { // unites[0]= unites[1]= " mm"; // } // if(iabs == 3 || iabs == 4) { // unites[0]= unites[1]= " mrad"; // } // if(iabs == 5) { // unites[0]= " MeV"; unites[1]= " KeV"; // } new WText(" case : " + nameOfCase_, w); new WBreak(w); new WText(" after element : " + elementLabel, w); for (int k=0 ; k < (int)legende.size(); k++) { new WBreak(w); new WText(legende.at(k), w); } // new WText(" entries : "+ mixedTools::intToString((int)out[0]),w); // new WBreak(w); // new WText(" mean : "+ mixedTools::doubleToString(out[1])+unites[0],w); // new WBreak(w); // new WText(" sigma rms : "+ mixedTools::doubleToString(out[2])+unites[1],w); ////////////////////////////////////////////////////////////////////////////////// string titre; if(iabs == 0) titre="x-coordinate"; if(iabs == 1) titre="y-coordinate"; if(iabs == 2) titre="z-coordinate"; if(iabs == 3) titre="xp-divergence"; if(iabs == 4) titre="yp-devergence"; if(iabs == 5) titre="kinetic energy"; string xname; if(iabs == 0) xname=" x (mm)"; if(iabs == 1) xname=" y (mm)"; if(iabs == 2) xname=" z (mm)"; if(iabs == 3) xname=" xp (mrad)"; if(iabs == 4) xname=" yp (mrad)"; if(iabs == 5) xname=" dEcin/Ecin (%)"; string yname; Wt::Chart::SeriesType seriesType = Wt::Chart::LineSeries; Wt::Chart::FillRangeType fillRange = Wt::Chart::ZeroValueFill; Wt::Chart::AxisValue location = Wt::Chart::MinimumValue; bool isGridLinesEnabled = true; chartPlot2vec(w,x,y,seriesType,fillRange,location,isGridLinesEnabled,titre,xname,yname,500,300); } void GWt_accelerator::chartPlot2vec(WContainerWidget* toto,vector& xcor,vector& ycor,Wt::Chart::SeriesType seriesType,Wt::Chart::FillRangeType fillRange,Wt::Chart::AxisValue value,bool isGridLinesEnables,string title,string legendx,string legendy,int width,int height,bool makeIcon) { int nbpts = xcor.size(); cout << " PspaApplication::chartPlot2vec nbpts = " << nbpts << endl; WStandardItemModel *model = new WStandardItemModel(nbpts, 2, toto); for (int i = 0; i < nbpts; ++i) { model->setData(i, 0, xcor.at(i)); model->setData(i, 1, ycor.at(i)); // cout << " PspaApplication::chartPlot2vec el= " << i+1 << " x= " << xcor.at(i) << " y= " << ycor.at(i) << endl; } // cout << " PspaApplication::chartPlot2vec FLAG 0 " << endl; Wt::Chart::WCartesianChart *chart = new Wt::Chart::WCartesianChart(toto); if (!makeIcon) chart->setTitle(title); chart->initLayout(); chart->setModel(model); // set the model chart->setXSeriesColumn(0); // set the column that holds the X data chart->setType(Wt::Chart::ScatterPlot); // set type to ScatterPlot chart->setLegendEnabled(false); // enable the legend // Provide space for the X and Y axis and title. chart->setPlotAreaPadding(80, Left); chart->setPlotAreaPadding(40, Bottom); chart->setPlotAreaPadding(60, Top); // Typically, for mathematical functions, you want the axes to cross // at the 0 mark (value= ZeroValue) chart->axis(Wt::Chart::XAxis).setLocation(value); chart->axis(Wt::Chart::YAxis).setLocation(value); // cout << " PspaApplication::chartPlot2vec FLAG 1 " << endl; Wt::Chart::WDataSeries s(1,seriesType); s.setPen(WColor("red")); s.setFillRange(fillRange); chart->addSeries(s); Wt::Chart::WAxis& axis = chart->axis(Wt::Chart::XAxis); axis.setLabelFormat("%.3f"); axis.setTitle(legendx); chart->axis(Wt::Chart::Y1Axis).setTitle(legendy); if(isGridLinesEnables) { axis.setGridLinesEnabled(true); chart->axis(Wt::Chart::Y1Axis).setGridLinesEnabled(true); } // cout << " PspaApplication::chartPlot2vec FLAG 2 " << endl; chart->resize(width,height); // WPaintedWidget must be given explicit size chart->setMargin(10, Top | Bottom); // ? chart->setMargin(WLength::Auto, Left | Right); //? if (makeIcon) { chart->setLegendEnabled(false); // enable the legend chart->setPlotAreaPadding(0); chart->setAxisPadding(0); WFont xAxisFont = chart->axis(Wt::Chart::XAxis).labelFont(); xAxisFont.setSize(8); WFont yAxisFont = chart->axis(Wt::Chart::YAxis).labelFont(); yAxisFont.setSize(8); chart->axis(Wt::Chart::XAxis).setLabelFont(xAxisFont); chart->axis(Wt::Chart::YAxis).setLabelFont(yAxisFont); } // cout << " PspaApplication::chartPlot2vec FLAG 3 " << endl; #ifdef HAS_IMAGEMAGIC // cout << " PspaApplication::chartPlot2vec FLAG MAGIC " << endl; // no background chart->setBackground(WBrush(Wt::NoBrush)); // axis black chart->axis(XAxis).setPen(WColor("black")); chart->axis(YAxis).setPen(WColor("black")); std::string name; /* Wt::WRasterImage pngImage("png", 1000, 1000); Wt::WPainter p(&pngImage); chart->paint(p); name = workingDir_ + "/chart-"+sessionId ()+".png"; std::ofstream f(name.c_str(), std::ios::out |std::ios::trunc | std::ios::binary); pngImage.write(f); */ Wt::WPdfImage pdfImage("1000", "600"); { Wt::WPainter p1(&pdfImage); chart->paint(p1); } name = workingDir_ + "/chart-"+sessionId ()+".pdf"; std::ofstream f1(name.c_str(), std::ios::out | std::ios::binary); pdfImage.write(f1); new WText("Sauvegarder l'image",toto); #endif // cout << " PspaApplication::chartPlot2vec FLAG FIN" << endl; } bool GWt_accelerator::areDataCoherent() { // FIXME cout << "***********************************" << endl; cout << "** GWt_accelerator::areDataCoherent() **" << endl; cout << "***********************************" << endl; if ( !dataManager_ ) return false; return dataManager_->areDataCoherent(); // return true; // bool caMarche = true; /* // initialize dataManager dtmanage_->initializeExecution(); // intialize User Interface if (pspa_->getBeamLine_deprecated()) { pspa_->getBeamLine_deprecated()->initializeSoftwares(); } string diagnosticErrors; string diagnosticWarnings; for (int a = 0; a < sections_.size(); a++) { string debString= sections_[a]->getFirstElementCurrentText().toUTF8(); string finString= sections_[a]->getLastElementCurrentText().toUTF8(); int debut = pspa_->getBeamLine_deprecated()->getAbstractElementNumeroFromLabel(debString); int fin = pspa_->getBeamLine_deprecated()->getAbstractElementNumeroFromLabel(finString); string currentSoft= sections_[a]->getSoftwareCurrentText().toUTF8(); nomDeLogiciel prog = nomDeLogiciel(currentSoft); sectionToExecute* sectToExec = dtmanage_->addSectionToExecute(pspa_->getBeamLine_deprecated()->getAbstractElement(debut),debut,pspa_->getBeamLine_deprecated()->getAbstractElement(fin),fin,prog); abstractSoftware* softToExec = sectToExec->getSoftware(); diagnosticErrors = ""; diagnosticWarnings = ""; for(int i = debut-1; i < fin; i++) // check sections { if (!pspa_->getBeamLine_deprecated()) continue; abstractElement* elPtr= pspa_->getBeamLine_deprecated()->getAbstractElement(i); if (!elPtr) continue; trivaluedBool tb = softToExec->doAcceptElement(elPtr->getNomdElement().getElementType()); cout << " GWt_softwarePanel::areDataCoherent() el " << elPtr->getLabel() << " tb= " << tb << endl; if (tb == TBoolOk ) { elPtr->setSoftware(softToExec); } else { elPtr->setSoftware(NULL); if (tb == TBoolIgnore) { if(prog.getString() != "unknownSoftware") diagnosticWarnings += elPtr->getLabel() + " will be ignored by "+ prog.getString() + "
"; } else { // j'insiste pour remettre le nom generique de l'element refuse (glm / 30/03/2013) diagnosticErrors += elPtr->getNomdElement().getExpandedName() + " is not allowed with " + prog.getString() + "
"; caMarche = false; } } pspa_->getBeamLine_deprecated()->update(i); } //i // set errors and warnings sections_[a]->setErrors(diagnosticErrors); sections_[a]->setWarnings(diagnosticWarnings); }//a */ // return caMarche; }