Changeset 3135 in Sophya for trunk/SophyaPI/PIext/sohiswrap.h


Ignore:
Timestamp:
Jan 12, 2007, 7:36:32 PM (19 years ago)
Author:
cmv
Message:

suite du display des HistoErr avec Wrapper cmv 12/01/07

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/PIext/sohiswrap.h

    r3132 r3135  
    2525  {
    2626    if (h == NULL) throw NullPtrError("HistoWrapper(Histo* h = NULL)");
    27     mHis = h;  mAD = ad;
     27    mHis = h;
     28    mHpr = dynamic_cast<HProf*>(h);
     29    mAD = ad;
    2830  }
    2931  ~HistoWrapper() { if (mAD) delete mHis; }
     
    4042  virtual r_8 Value(int_4 i) { return (*mHis)(i) ; }
    4143  virtual r_8 Error(int_4 i) { return mHis->Error(i) ; }
     44  virtual r_8 NbEntries(int_4 i) { if(mHpr) return mHpr->SumW(i); else return 0.; }
    4245
    4346  virtual void Update() { mHis->UpdateHisto(); }
     
    5962  // pointeur sur l'objet histo
    6063  inline Histo* getHisto() { return mHis; }
     64
    6165protected:
    6266  Histo* mHis;
     67  HProf* mHpr;
    6368  bool mAD;
    6469};
     
    8792  virtual r_8 Value(int_4 i) { return (*mHis)(i) ; }
    8893  virtual r_8 Error(int_4 i) { return mHis->Error(i) ; }
    89 
    90   // CMV $CHECK$  pas besoin ? virtual void Update() { }
     94  virtual r_8 NbEntries(int_4 i) { return mHis->NEntBin(i) ; }
    9195
    9296  // ajoute des lignes de texte avec les infos statistiques
    9397  virtual int GetStatInfoAsText(vector<string> & text)
    9498  {
    95     // CMV $CHECK$  Y-a-t il qque chose a ecrire ?
    96     string s = "HistoErr";
    97     text.push_back(s);
     99    char label[64]; string s;
     100
     101    sprintf(label, "NCor= %d",mHis->NCorrel());
     102    s = label; text.push_back(s);
     103
    98104    return 1;
    99105  }
     
    101107  // pointeur sur l'objet histo
    102108  inline HistoErr* getHistoErr() { return mHis; }
     109
    103110protected:
    104111  HistoErr* mHis;
Note: See TracChangeset for help on using the changeset viewer.