Changeset 8825


Ignore:
Timestamp:
01/24/08 09:26:36 (17 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r8814 r8825  
    11#include "MTracking.h"
     2
     3#include "MLogManip.h"
    24
    35#include "macs.h"
     
    5254    //
    5355    if (fCosy->HasError())
    54         gLog << "Error while requesting re pos from Macs (SDO #6004)" << endl;
     56        gLog << err << "ERROR - while requesting re pos from Macs (SDO #6004)" << endl;
    5557
    5658    return false;
     
    9395    //
    9496    if (fCosy->HasError())
    95         gLog << "Error while setting tracking velocity (SDO #3006)" << endl;
     97        gLog << err << "ERROR - while setting tracking velocity (SDO #3006)" << endl;
    9698
    9799    return kFALSE;
     
    223225    {
    224226        vt->Az(maxtrack*vraz*4*sgn(vcalc.Az()));
    225         gLog << "Warning: Azimuth speed limit (" << maxtrack*100 << "%) exceeded (" << fabs(vt->Az()) << " > " << maxtrack*vraz << ")... limited." << endl;
     227        gLog << warn << "Warning: Azimuth speed limit (" << maxtrack*100 << "%) exceeded (" << fabs(vt->Az()) << " > " << maxtrack*vraz << ")... limited." << endl;
    226228        gLog << "Vcalc: " << vcalc.Zd() << " " << vcalc.Az() << "re/min" <<endl;
    227229        rc=kTRUE;
     
    230232    {
    231233        vt->Zd(maxtrack*vrzd*4*sgn(vcalc.Zd()));
    232         gLog << "Warning: Altitude speed limit (" << maxtrack*100 << "%) exceeded (" << fabs(vt->Zd()) <<" > " << maxtrack*vrzd << ")... limited." << endl;
     234        gLog << warn << "Warning: Altitude speed limit (" << maxtrack*100 << "%) exceeded (" << fabs(vt->Zd()) <<" > " << maxtrack*vrzd << ")... limited." << endl;
    233235        gLog << "Vcalc: " << vcalc.Zd() << " " << vcalc.Az() << "re/min" <<endl;
    234236        rc=kTRUE;
     
    247249{
    248250     // Conversion factor from se to re
    249      const XY re = fCosy->kGearTot/fCosy->kResSE; //[re/se]
     251     //const XY re = fCosy->kGearTot/fCosy->kResSE; //[re/se]
     252     const XY re = Div(fCosy->kGearTot, fCosy->kResSE); //[re/se]
    250253
    251254     // Check wether moving direction has changed
     
    329332    ZdAz dest = sla.CalcZdAz(dst);
    330333
    331     gLog << sla.GetTime() << ": Track Position " << dst.Ra()*kRad2Deg/15 << "h, " << dst.Dec()*kRad2Deg <<"deg" << endl;
     334    gLog << all << sla.GetTime() << ": Track Position " << dst.Ra()*kRad2Deg/15 << "h, " << dst.Dec()*kRad2Deg <<"deg" << endl;
    332335
    333336    // If the star is culminating behind the zenith (South) we want to
     
    338341    {
    339342        // align az from -180/180 to 0/360
    340         gLog << "Star culminating behind zenith: Adding 360deg to Azimuth " << dest.Az()*kRad2Deg << endl;
     343        gLog << inf2 << "Star culminating behind zenith: Adding 360deg to Azimuth " << dest.Az()*kRad2Deg << endl;
    341344        dest.Az(dest.Az() + TMath::TwoPi());
    342345    }
     
    347350    if (!SetPosition(dest, kTRUE))
    348351    {
    349         gLog << "Error: Cannot start tracking, positioning failed." << endl;
     352        gLog << err << "ERROR - Cannot start tracking, positioning failed." << endl;
    350353        return;
    351354    }
     
    385388
    386389    // Some output
    387     XY xy(Rad2Deg(dst.Ra())*24/360, Rad2Deg(dst.Dec()));
    388     gLog << sla.GetTime() << " - Start Tracking: Ra=" << xy.X() << "h Dec=";
     390    XY xy(TMath::RadToDeg()*dst.Ra()*24/360, TMath::RadToDeg()*dst.Dec());
     391    gLog << all << sla.GetTime() << " - Start Tracking: Ra=" << xy.X() << "h Dec=";
    389392    gLog << xy.Y() << "\xb0 @ Zd=" << pos.Zd()*kRad2Deg <<"deg Az=" << pos.Az()*kRad2Deg <<"deg" << endl;
    390393
     
    469472        if (LimitSpeed(&v, sla))
    470473        {
    471             gLog << "vt: " << v.Zd() << " " << v.Az() << "re/min" << endl;
     474            gLog << dbg << "vt: " << v.Zd() << " " << v.Az() << "re/min" << endl;
    472475            gLog << "Dest: " << dest.Zd() << " " << dest.Az() << endl;
    473476        }
     
    487490        if (vt.Zd()>.9*fCosy->fMac1->GetVelRes() || vt.Az()>.9*fCosy->fMac2->GetVelRes())
    488491        {
    489             gLog << "Error: Tracking speed faster than 90% of possible maximum velocity." << endl;
     492            gLog << err << "ERROR - Tracking speed faster than 90% of possible maximum velocity." << endl;
    490493            break;
    491494        }
     
    532535    fCosy->StopMovement();
    533536
    534     gLog << sla.GetTime() << " - Tracking stopped @ Zd=";
     537    gLog << all << sla.GetTime() << " - Tracking stopped @ Zd=";
    535538    gLog << fCosy->fZdAzSoll.Zd()*TMath::RadToDeg() <<"deg Az=";
    536539    gLog << fCosy->fZdAzSoll.Az()*TMath::RadToDeg() <<"deg" << endl;
     
    548551        return 3;
    549552
    550     gLog << "- Tracking Thread started (" << MTime(-1) << ")" << endl;
     553    gLog << inf2 << "- Tracking Thread started (" << MTime(-1) << ")" << endl;
    551554
    552555    //const XY re2se = fCosy->kGearTot/fCosy->kResSE; //[re/se]
     
    648651    }
    649652
    650     gLog << "- Tracking Thread done. (" << MTime(-1) << ")" << endl;
     653    gLog << inf2 << "- Tracking Thread done. (" << MTime(-1) << ")" << endl;
    651654    return 0;
    652655}
Note: See TracChangeset for help on using the changeset viewer.