Changeset 428 in PSPA


Ignore:
Timestamp:
Nov 4, 2013, 12:21:18 PM (11 years ago)
Author:
touze
Message:

sauver/restaurer une config ok

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

Legend:

Unmodified
Added
Removed
  • Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_globalParameters.h

    r426 r428  
    3333  GWt_globalParameters() {;}
    3434  GWt_globalParameters(dataManager*);
    35   GWt_globalParameters(dataManager*,WContainerWidget*);
    3635  virtual ~GWt_globalParameters() {;}
    3736   
     
    4039  void updateGlobals();
    4140  void renew();
    42   string* getGlobalParameters();
     41  void setText(WContainerWidget*);
    4342};
    4443#endif
  • Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_globalParameters.cc

    r427 r428  
    1515}
    1616
    17 GWt_globalParameters::GWt_globalParameters(dataManager* dt,WContainerWidget* wt)
     17void GWt_globalParameters::setText(WContainerWidget* wt)
    1818{
    19   dt_ = dt;
    2019  status_ = new WText("Go ahead...",wt);
    2120}
     
    2322void GWt_globalParameters::initilializeDialog()
    2423{
     24  dialog_ = new WDialog("global parameters");
    2525  string* param = dialogBegin();
    2626
    27   dialog_ = new WDialog("global parameters");
    2827  new WText("Enter frequency (MHz) : ",dialog_->contents());
    2928  frequencyEdit_ = new WLineEdit(param[1].c_str(),dialog_->contents());
     
    7271  envoi_[3] = param[3].c_str();
    7372  envoi_[4] = param[4].c_str();
    74   setStatus();
    7573  return param;
    7674}
     
    7876void GWt_globalParameters::dialogDone(WDialog::DialogCode code)
    7977{
    80   if (code == WDialog::Accepted) updateGlobals();
     78  if (code == WDialog::Accepted) {
     79    updateGlobals();
     80    setStatus();
     81  }
    8182  return;
    8283}
     
    8990  envoi_[3] = nstepMAxEdit_->text().toUTF8();
    9091  envoi_[4] = nscEdit_->text().toUTF8();
    91 
    92   setStatus();
    9392  dt_->getGlobalParameters()->setParametersString(envoi_);
    9493}
     
    9796{
    9897  string* param = dialogBegin();
    99 
    100   frequencyEdit_->setText(param[1].c_str());
    101   stepEdit_->setText(param[2].c_str());
    102   nstepMAxEdit_->setText(param[3].c_str());
    103   nscEdit_->setText(param[4].c_str());
    104 }
    105 
    106 string* GWt_globalParameters::getGlobalParameters()
    107 {
    108   return envoi_;
     98  setStatus();
     99  frequencyEdit_ = new WLineEdit(param[1].c_str());
     100  stepEdit_ = new WLineEdit(param[2].c_str());
     101  nstepMAxEdit_ = new WLineEdit(param[3].c_str());
     102  nscEdit_ = new WLineEdit(param[4].c_str());
    109103}
    110104
  • Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_pspaApplication.cc

    r427 r428  
    143143  // xx mainGridLayout->addWidget(globalParam_,3,1);
    144144
     145  globalParam_ = new GWt_globalParameters(dtmanage_);
    145146  WWidget* dboard = createDashBoard();
    146147  dboard->setMinimumSize(300,100);
     
    187188  textdiv = new WContainerWidget();
    188189  textdiv->setStyleClass("text");
    189  
    190   globalParam_ = new GWt_globalParameters(dtmanage_,textdiv);
     190  globalParam_->setText(textdiv);
    191191
    192192  WContainerWidget *cnt = new WContainerWidget();
     
    396396}
    397397
    398 
    399398void PspaApplication::dialogSaveDone(WDialog::DialogCode code)
    400399{
    401     if ( code != Wt::WDialog::Accepted ) {
    402         return;
    403     }
    404     nameOfCase_ = saveNameEdit_->text().toUTF8();
    405     delete dialogSave_;
    406     dialogSave_ = NULL;
    407 
    408     GWt_globalParameters* bibi = static_cast<GWt_globalParameters*>(globalParam_);
    409     bibi->updateGlobals();
    410 
    411     //  dtmanage_->saveConfiguration(nameOfCase_);
    412     dtmanage_->saveConfiguration(sessionId(),nameOfCase_);
    413 
    414     // en test: j'ajoute la sauvegarde sur .aml
    415     dtmanage_->writeToAMLFile(nameOfCase_);
    416 }
    417 
     400  if ( code != Wt::WDialog::Accepted ) {
     401    return;
     402  }
     403  nameOfCase_ = saveNameEdit_->text().toUTF8();
     404  delete dialogSave_;
     405  dialogSave_ = NULL;
     406
     407  globalParam_->updateGlobals();
     408
     409  //  dtmanage_->saveConfiguration(nameOfCase_);
     410  dtmanage_->saveConfiguration(sessionId(),nameOfCase_);
     411
     412  // en test: j'ajoute la sauvegarde sur .aml
     413  dtmanage_->writeToAMLFile(nameOfCase_);
     414}
    418415
    419416void PspaApplication::restaurer()
     
    432429  if (nameOfCase_ == "")
    433430    return;
    434   cout << " je restaure le fichier " << fileName << endl;
     431  cout << " PspaApplication:: restaure le fichier " << fileName << endl;
    435432  dialogSave_ = NULL;
    436433 
     
    445442  }
    446443 
    447   GWt_globalParameters* bibi = static_cast<GWt_globalParameters*>(globalParam_);
    448   bibi->renew();
    449  
     444  globalParam_->renew(); 
    450445  console_->addConsoleMessage(string("restauration terminee \n"));
    451446}
Note: See TracChangeset for help on using the changeset viewer.