Ignore:
Timestamp:
03/07/02 15:28:30 (23 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mbase/MWriteAsciiFile.cc

    r1222 r1235  
    148148    while ((cont=(MParContainer*)NextCont()))
    149149    {
    150         const TObject *memb = NextMemb();
     150        const MScale *memb = (MScale*)NextMemb();
    151151
    152152        if (!cont->IsReadyToSave())
     
    160160        else
    161161        {
    162             if (!cont->WriteDataMember(*fOut, memb->GetName()))
     162            if (!cont->WriteDataMember(*fOut, memb->GetName(), memb->GetScale()))
    163163                continue;
    164164        }
     
    196196Bool_t MWriteAsciiFile::GetContainer(MParList *pList)
    197197{
    198     TObject *obj = NULL;
     198    MScale *obj = NULL;
    199199
    200200    TIter Next(&fContNames);
    201201
    202     while ((obj=Next()))
     202    while ((obj=(MScale*)Next()))
    203203    {
    204204        const char *name = obj->GetName();
     
    211211        }
    212212
    213         AddContainer(cont, obj->GetTitle());
     213        AddContainer(cont, obj->GetTitle(), obj->GetScale());
    214214    }
    215215
     
    223223// If you want to write only one data member of the container
    224224// specify the name of the data member (eg. fAlpha) Make sure,
    225 // that a "GetteMethod" for this data type exists (strif the f and
     225// that a "GetteMethod" for this data type exists (strip the f and
    226226// replace it by Get)
    227 //
    228 void MWriteAsciiFile::AddContainer(const char *cname, const char *member)
    229 {
    230     TNamed *named = new TNamed(cname, member);
    231     fContNames.AddLast(named);
     227// If you specify a single data member you can add a scale-factor which
     228// is (in case of the data member being a floating point value) multiplied
     229// with the data member value. This is usefull if you are want to
     230// change the scale (unit) of a data member for writing (eg.
     231// writing degrees for the hillas parameters instead of the internally
     232// used millimeters)
     233//
     234void MWriteAsciiFile::AddContainer(const char *cname, const char *member, Double_t scale)
     235{
     236    MScale *name = new MScale(cname, member, scale);
     237    fContNames.AddLast(name);
    232238}
    233239
     
    238244// If you want to write only one data member of the container
    239245// specify the name of the data member (eg. fAlpha) Make sure,
    240 // that a "GetteMethod" for this data type exists (strif the f and
     246// that a "GetteMethod" for this data type exists (strip the f and
    241247// replace it by Get)
    242 //
    243 void MWriteAsciiFile::AddContainer(MParContainer *cont, const char *member)
     248// If you specify a single data member you can add a scale-factor which
     249// is (in case of the data member being a floating point value) multiplied
     250// with the data member value. This is usefull if you are want to
     251// change the scale (unit) of a data member for writing (eg.
     252// writing degrees for the hillas parameters instead of the internally
     253// used millimeters)
     254//
     255void MWriteAsciiFile::AddContainer(MParContainer *cont, const char *member, Double_t scale)
    244256{
    245257    fContainer.AddLast(cont);
    246258
    247     TNamed *named = new TNamed(member, "");
    248     fMembers.AddLast(named);
    249 }
    250 
     259    MScale *name = new MScale(member, "", scale);
     260    fMembers.AddLast(name);
     261}
     262
Note: See TracChangeset for help on using the changeset viewer.