Changeset 5932 for trunk/MagicSoft


Ignore:
Timestamp:
01/21/05 14:06:16 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r5930 r5932  
    3131     - add place for LoGainSwitch
    3232
     33
     34
    3335 2005/01/21 Florian Goebel
    3436
     
    3739
    3840
     41
    3942 2005/01/20 Thomas Bretz
    4043
    4144   * mpointing/MSrcPosFromModel.cc:
    4245     - fixed crash in Process if no pointing model available
     46
     47   * mastro/MObservatory.[h,cc]:
     48     - added ReadEnv member function
    4349
    4450
  • trunk/MagicSoft/Mars/mastro/MObservatory.cc

    r3927 r5932  
    130130    return MAstro::RotationAngle(fSinLatitude, fCosLatitude, theta, phi);
    131131}
     132
     133
     134// --------------------------------------------------------------------------
     135//
     136// Setup the observatory location from resource file:
     137//    MObservatory.Name: Magic1, WuerzburgCity
     138//
     139Int_t MObservatory::ReadEnv(const TEnv &env, TString prefix, Bool_t print)
     140{
     141    if (IsEnvDefined(env, prefix, "Name", print))
     142    {
     143        TString name = GetEnvValue(env, prefix, "Name", "Magic1");
     144        name = name.Strip(TString::kBoth);
     145
     146        if (name==(TString)"Magic1")
     147        {
     148            SetLocation(kMagic1);
     149            return kTRUE;
     150        }
     151
     152        if (name==(TString)"WuerzburgCity")
     153        {
     154            SetLocation(kWuerzburgCity);
     155            return kTRUE;
     156        }
     157
     158        *fLog << err << "MObservatory::ReadEnv - ERROR: Observatory " << name << " unknown." << endl;
     159        return kERROR;
     160    }
     161
     162    return kFALSE;
     163
     164}
  • trunk/MagicSoft/Mars/mastro/MObservatory.h

    r3957 r5932  
    7272    LocationName_t GetObservatoryKey() const { return fObservatoryKey; }
    7373
     74    Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print=kFALSE);
     75
    7476    ClassDef(MObservatory, 0) // class storing observatory locations
    7577};
Note: See TracChangeset for help on using the changeset viewer.