Ignore:
Timestamp:
02/13/08 19:44:39 (17 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Cosy/main
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Cosy/main/MCosy.cc

    r8856 r8862  
    1616#include "MLogManip.h"
    1717
     18#include "MEnv.h"
    1819#include "MTime.h"
    1920#include "MPointing.h"
     
    140141
    141142    //
    142     // Get the values
    143     //
    144     int p1 =  (fZd1->GetPos()+8192)%16384;
    145     int p2 = -(fZd2->GetPos()+8192)%16384;
     143    // Get the values          (FIXME!)
     144    //
     145    int p1 =  (fZd1->GetPos()/*+8192*/)%fZd1->GetPhysRes();
     146    int p2 = -(fZd2->GetPos()/*+8192*/)%fZd2->GetPhysRes();
    146147
    147148    if (fZd1->IsZombieNode())
     
    930931}
    931932
    932 void MCosy::ReadConfig()
    933 {
    934     gLog << inf2 << "Reading configuration file..." << flush;
    935     TEnv env(".cosyrc");
    936     gLog << "done." << endl;
    937 
     933void MCosy::ReadConfig(MEnv &env)
     934{
    938935    gLog << inf2 << "Reading telescope range..." << flush;
    939936    const Double_t amin = env.GetValue("Az_Min[deg]", -95.0);
     
    946943    gLog << "done." << endl;
    947944
    948     gLog << all << " * Min:  " << zmin << "deg  " << amin << "deg" << endl;
    949     gLog << all << " * Max:  " << zmax << "deg  " << amax << "deg" << endl;
     945    gLog << all << flush;
     946
     947    gLog << " * Min:  " << zmin << "deg  " << amin << "deg" << endl;
     948    gLog << " * Max:  " << zmax << "deg  " << amax << "deg" << endl;
    950949
    951950    fMin = fBending.AddOffsets(fMin/TMath::RadToDeg());
    952951    fMax = fBending.AddOffsets(fMax/TMath::RadToDeg());
    953952
    954     gLog << all << " * Min': " << fMin.Zd()*TMath::RadToDeg() << "deg  " << fMin.Az()*TMath::RadToDeg() << "deg" << endl;
    955     gLog << all << " * Max': " << fMax.Zd()*TMath::RadToDeg() << "deg  " << fMax.Az()*TMath::RadToDeg() << "deg" << endl;
    956 
    957     gLog << inf2 << "Reading gear ratios..." << flush;
    958 //    kGear.X(env.GetValue("Zd_GearRatio[U_mot/U_tel]", 1000.0));
    959 //    kGear.Y(env.GetValue("Az_GearRatio[U_mot/U_tel]", 1000.0));
     953    gLog << " * Min': " << fMin.Zd()*TMath::RadToDeg() << "deg  " << fMin.Az()*TMath::RadToDeg() << "deg" << endl;
     954    gLog << " * Max': " << fMax.Zd()*TMath::RadToDeg() << "deg  " << fMax.Az()*TMath::RadToDeg() << "deg" << endl;
     955
    960956    kGear.Set(env.GetValue("Zd_GearRatio[U_mot/U_tel]", 1000.0),
    961957              env.GetValue("Az_GearRatio[U_mot/U_tel]", 1000.0));
     
    975971    kResRE.Set(x,y);
    976972
    977     x = zd1 ? fZd1->GetPhysRes() : (zd2 ? fZd2->GetPhysRes() : env.GetValue("Zd_ResSE[se/U_mot]", 16384));
    978     y = az  ? fAz->GetPhysRes() : env.GetValue("Az_ResSE[se/U_mot]", 16384);
     973    gLog << " * Az RE resolution: " << x << " re/U_mot" << endl;
     974    gLog << " * Zd RE resolution: " << y << " re/U_mot" << endl;
     975
     976    x = zd1 ? fZd1->GetPhysRes() : (zd2 ? fZd2->GetPhysRes() : env.GetValue("Zd_ResSE[se/U_tel]", 16384));
     977    y = az  ? fAz->GetPhysRes() : env.GetValue("Az_ResSE[se/U_tel]", 16384);
    979978    kResSE.Set(x,y);
     979
     980    gLog << " * Az SE resolution: " << x << " se/U_tel" << endl;
     981    gLog << " * Zd SE resolution: " << y << " se/U_tel" << endl;
    980982
    981983    /*
     
    10191021//    kGearTot = kResRE*kGear;
    10201022
    1021     gLog << "done." << endl;
    1022 
    1023     gLog << all;
    1024     gLog << " * Setting Gear Ratios:" << endl;
    1025     gLog << "   --------------------" << endl;
     1023//    gLog << all;
     1024//    gLog << " * Setting Gear Ratios:" << endl;
     1025 //   gLog << "   --------------------" << endl;
    10261026    gLog << " *  X: " << kGear.X() << "*" << kResRE.X()/4 << "/" << kResSE.X() << "=4*" << kGearTot.X() << "/" << kResSE.X() << endl;
    10271027    gLog << " *  Y: " << kGear.Y() << "*" << kResRE.Y()/4 << "/" << kResSE.Y() << "=4*" << kGearTot.Y() << "/" << kResSE.Y() << endl;
     
    10651065
    10661066    gLog << inf2 << "Starting Shaftencoder Test..." << endl;
     1067
     1068    gLog << err << "Build in values!!!" << endl;
    10671069
    10681070    while (fBackground==kBgdSeTest)
     
    14341436// turn on the gui update
    14351437//
    1436 void MCosy::Start()
     1438void MCosy::Start(MEnv &env)
    14371439{
    14381440    // Don't call this function twice!
     
    14411443    CheckForError();
    14421444
    1443     ReadConfig();
     1445    ReadConfig(env);
    14441446
    14451447    gLog << inf << "- Starting TX Thread." << endl;
     
    16101612}
    16111613
    1612 MCosy::MCosy()
     1614MCosy::MCosy(MEnv &env, const char *addr, const char *pointing)
    16131615: Network(), fObservatory(MObservatory::kMagic1), fStarguider(NULL),
    16141616fZd1(0), fZd2(0), fAz(0), fMac1(0), fMac2(0), fMac3(0),
     
    16161618fOutTp(0), fOutRep(0)
    16171619{
    1618     TEnv env(".cosyrc");
    16191620    const Int_t id1 = env.GetValue("Az_Id-MAC1", 1); //1
    16201621    const Int_t id2 = env.GetValue("Az_Id-MAC2", 2); //2
     
    16371638    {
    16381639    case 0:
    1639         gLog << "<<Standard mode>>" << endl;*/
    1640         fBending.Load("bending.txt");
     1640    gLog << "<<Standard mode>>" << endl;*/
     1641        gLog << all << "Reading pointing model from " << pointing << "..." << endl;
     1642        if (fBending.Load(pointing))
     1643            gLog << all << "Reading pointing model from " << pointing << " successfull." << endl;
     1644        else
     1645            gLog << err << "ERROR - Reading pointing model from " << pointing << endl;
    16411646        Constructor(id1, id2, id3, id4, id5, id6);/*
    16421647        break;
     
    16511656    }
    16521657*/
     1658
    16531659    gLog.SetOutputGui(fWin->GetLog(), kTRUE);
    16541660
     
    16571663    fAz->SetDisplay(fWin->GetLabel1());
    16581664
    1659     fCom = new MDriveCom(this, fOutRep);
     1665    fCom = new MDriveCom(this, addr, fOutRep);
    16601666//    fCom->Start();
    16611667}
  • trunk/MagicSoft/Cosy/main/MCosy.h

    r8859 r8862  
    5252class MStarguider;
    5353class MDriveCom;
     54class MEnv;
    5455
    5556class MTTalk : public MThread
     
    173174    //void ConstructorDemo();
    174175
    175     void ReadConfig();
     176    void ReadConfig(MEnv &env);
    176177
    177178    bool CheckNetwork();
    178179
     180    void Start() { }
     181
    179182public:
    180     MCosy();
     183    MCosy(MEnv &env, const char *addr, const char *pointing);
    181184    ~MCosy();
    182185
    183     void Start();
     186    void Start(MEnv &env);
    184187    void Stop();
    185188
Note: See TracChangeset for help on using the changeset viewer.