Ignore:
Timestamp:
11/17/03 13:50:48 (22 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Cosy/main
Files:
5 edited

Legend:

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

    r2407 r2518  
    6868ClassImp(MBending);
    6969
     70#undef DEBUG
     71#define DEBUG(txt) txt
     72//#define DEBUG(txt)
     73
    7074const Int_t MBending::fNumPar=19;
    7175
     
    286290    AltAz p = aa;
    287291
     292    DEBUG(cout << setprecision(16));
     293    DEBUG(cout << "Bend8: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);
     294
    288295    const AltAz CRX(-fCrx*sin(p.Az()-p.Alt()),  fCrx*cos(p.Az()-p.Alt())/cos(p.Alt()));
    289296    const AltAz CRY(-fCry*cos(p.Az()-p.Alt()), -fCry*sin(p.Az()-p.Alt())/cos(p.Alt()));
     
    291298    p += CRY;
    292299
     300    DEBUG(cout << "Bend7: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);
     301
    293302    const AltAz NRX(fNrx*sin(p.Alt()), -fNrx);
    294303    const AltAz NRY(fNry*cos(p.Alt()), -fNry*tan(p.Alt()));
     
    296305    p += NRY;
    297306
     307    DEBUG(cout << "Bend6: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);
     308
    298309    const AltAz CES(-fEces*sin(p.Alt()), -fAces*sin(p.Az()));
    299310    const AltAz CEC(-fEcec*cos(p.Alt()), -fAcec*cos(p.Az()));
     
    301312    p += CEC;
    302313
     314    DEBUG(cout << "Bend5: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);
     315
    303316    const AltAz TX(Sign(fTx/tan(p.Alt()), p.Alt()), 0);
    304317    const AltAz TF(Sign(fTf*cos(p.Alt()), p.Alt()), 0);
    305     p += TX;
     318    //p += TX;
    306319    p += TF;
     320
     321    DEBUG(cout << "Bend4: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);
     322
     323    cout << fAw << " " << cos(p.Az()) << " " << tan(p.Alt()) << endl;
     324    cout << fAw* cos(p.Az())*tan(p.Alt())*180/3.1415 << endl;
    307325
    308326    const AltAz AW( fAw*sin(p.Az()), -fAw*cos(p.Az())*tan(p.Alt()));
     
    311329    p += AN;
    312330
     331    DEBUG(cout << "Bend3: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);
     332
    313333    const AltAz CA(0, -fCa/cos(p.Alt()));
    314334    p += CA;
    315335
     336    DEBUG(cout << "Bend2: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);
     337
    316338    const AltAz NPAE(0, -fNpae*tan(p.Alt()));
    317339    p += NPAE;
    318340
     341    DEBUG(cout << "Bend1: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);
     342
    319343    const AltAz FLOP(Sign(fFlop, p.Alt()), 0);
    320344    p += FLOP;
     
    323347    p += I;
    324348
     349    DEBUG(cout << "Bend0: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);
     350
    325351    return p;
    326352}
    327353
    328 AltAz MBending::CorrectBack(const AltAz &aa) const
     354AltAz MBending::AddOffsets(const AltAz &aa) const
    329355{
    330356    // Correct [rad]
     
    333359
    334360    const AltAz I(fIe, fIa);
     361    p += I;
     362
     363    return p;
     364}
     365
     366AltAz MBending::CorrectBack(const AltAz &aa) const
     367{
     368    // Correct [rad]
     369    // zdaz    [rad]
     370    AltAz p = aa;
     371
     372    DEBUG(cout << setprecision(16));
     373    DEBUG(cout << "Back0: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);
     374
     375    const AltAz I(fIe, fIa);
    335376    p -= I;
    336377
     
    338379    p -= FLOP;
    339380
     381    DEBUG(cout << "Back1: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);
     382
    340383    const AltAz NPAE(0, -fNpae*tan(p.Alt()));
    341384    p -= NPAE;
    342385
     386    DEBUG(cout << "Back2: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);
     387
    343388    const AltAz CA(0, -fCa/cos(p.Alt()));
    344389    p -= CA;
     390
     391    DEBUG(cout << "Back3: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);
     392
     393    cout << fAw << " " << cos(p.Az()) << " " << tan(p.Alt()) << endl;
     394    cout << fAw* cos(p.Az())*tan(p.Alt())*180/3.1415 << endl;
    345395
    346396    const AltAz AN(-fAn*cos(p.Az()), -fAn*sin(p.Az())*tan(p.Alt()));
     
    349399    p -= AW;
    350400
     401    DEBUG(cout << "Back4: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);
     402
    351403    const AltAz TF(Sign(fTf*cos(p.Alt()), p.Alt()), 0);
    352404    const AltAz TX(Sign(fTx/tan(p.Alt()), p.Alt()), 0);
    353405    p -= TF;
    354     p -= TX;
     406    //p -= TX;
     407
     408    DEBUG(cout << "Back5: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);
    355409
    356410    const AltAz CEC(-fEcec*cos(p.Alt()), -fAcec*cos(p.Az()));
     
    359413    p -= CES;
    360414
     415    DEBUG(cout << "Back6: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);
     416
    361417    const AltAz NRY(fNry*cos(p.Alt()), -fNry*tan(p.Alt()));
    362418    const AltAz NRX(fNrx*sin(p.Alt()), -fNrx);
     
    364420    p -= NRX;
    365421
     422    DEBUG(cout << "Back7: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);
     423
    366424    const AltAz CRY(-fCry*cos(p.Az()-p.Alt()), -fCry*sin(p.Az()-p.Alt())/cos(p.Alt()));
    367425    const AltAz CRX(-fCrx*sin(p.Az()-p.Alt()),  fCrx*cos(p.Az()-p.Alt())/cos(p.Alt()));
     
    369427    p -= CRX;
    370428
     429    DEBUG(cout << "Back8: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);
     430
    371431    return p;
    372432}
     433
     434AltAz MBending::SubtractOffsets(const AltAz &aa) const
     435{
     436    // Correct [rad]
     437    // zdaz    [rad]
     438    AltAz p = aa;
     439
     440    const AltAz I(fIe, fIa);
     441    p -= I;
     442
     443    return p;
     444}
     445
    373446
    374447ZdAz MBending::Correct(const ZdAz &zdaz) const
  • trunk/MagicSoft/Cosy/main/MBending.h

    r2407 r2518  
    9191    }
    9292
     93    AltAz  AddOffsets(const AltAz &aa) const;
     94    ZdAz   AddOffsets(const ZdAz &zdaz) const
     95    {
     96        AltAz p(TMath::Pi()/2-zdaz.Zd(), zdaz.Az());
     97        AltAz c = AddOffsets(p);
     98        return ZdAz(TMath::Pi()/2-c.Alt(), c.Az());
     99    }
     100
     101    AltAz  SubtractOffsets(const AltAz &aa) const;
     102    ZdAz   SubtractOffsets(const ZdAz &zdaz) const
     103    {
     104        AltAz p(TMath::Pi()/2-zdaz.Zd(), zdaz.Az());
     105        AltAz c = SubtractOffsets(p);
     106        return ZdAz(TMath::Pi()/2-c.Alt(), c.Az());
     107    }
     108
    93109    void SetParameters(const Double_t *par, Int_t n=fNumPar);
    94110    void GetParameters(Double_t *par, Int_t n=fNumPar) const;
  • trunk/MagicSoft/Cosy/main/MCosy.cc

    r2420 r2518  
    251251}
    252252
    253 
    254 
    255253// --------------------------------------------------------------------------
    256254//
     
    340338        usleep(1);
    341339
    342     if (Break() || HasError() || HasZombie())
    343     {
    344         lout << "WaitForEndMovement aborted... ";
    345         if (Break())
    346             lout << "Break signal." << endl;
    347         if (HasError())
    348             lout << "Network has error." << endl;
    349         if (HasZombie())
    350             lout << "Network has zombie." << endl;
    351     }
     340    if (!Break() && !HasError() && !HasZombie())
     341        return;
     342
     343    Timer t;
     344    t.Now();
     345    lout << t << " - MCosy::WaitForEndMovement aborted...";
     346    if (Break())
     347        lout << " Break signal...";
     348    if (HasError())
     349        lout << " Network has error...";
     350    if (HasZombie())
     351        lout << " Network has zombie...";
     352    lout << endl;
    352353}
    353354
     
    364365    // status is set to stopped.
    365366    //
    366     if (!HasError())
    367     {
     367    if (HasError() || HasZombie())
     368    {
     369        SetStatus(MDriveCom::kError);
     370        return;
     371    }
     372
     373    if (fMac1->IsPositioning() || fMac2->IsPositioning())
     374        SetStatus(MDriveCom::kMoving);
     375    else
    368376        SetStatus(MDriveCom::kStopped);
    369         return;
    370     }
    371377
    372378    //
    373379    // If there is an error, the error status is set to Error.
    374380    //
    375     SetStatus(MDriveCom::kError);
    376381
    377382    /*
     
    399404Bool_t MCosy::CheckRange(const ZdAz &d) const
    400405{
    401     // d [deg]
    402 
    403     if (d.Zd()<fMin.Zd() || d.Zd()>fMax.Zd())
    404     {
    405         lout << "ERROR: Requested Zenith Angle (" << d.Zd() << "deg, Az=";
    406         lout << d.Az() << ") not inside allowed range." << endl;
     406    // d [rad]
     407
     408    if (d.Zd()<fMin.Zd())
     409    {
     410        lout << "ERROR: Requested Zenith Angle below negative endswitch." << endl;
    407411        return kFALSE;
    408412    }
    409413
    410     if (d.Az()<fMin.Az() || d.Az()>fMax.Az())
    411     {
    412         lout << "ERROR: Requested Azimuth Angle (" << d.Az() << "deg, Zd=";
    413         lout << d.Zd() << ") not inside allowed range." << endl;
     414    if (d.Zd()>fMax.Zd())
     415    {
     416        lout << "ERROR: Requested Zenith Angle behind positive endswitch." << endl;
    414417        return kFALSE;
    415418    }
     419
     420    if (d.Az()<fMin.Az())
     421    {
     422        lout << "ERROR: Requested Azimuth Angle below negative endswitch." << endl;
     423        return kFALSE;
     424    }
     425
     426    if (d.Az()>fMax.Az())
     427    {
     428        lout << "ERROR: Requested Azimuth Angle behind positive endswitch." << endl;
     429        return kFALSE;
     430    }
     431
    416432
    417433    return kTRUE;
     
    437453    lout << t << " - Target Position: " << d.Zd() << "deg, " << d.Az() << "deg (Zd/Az)" << endl;
    438454
    439     if (!CheckRange(d))
    440         return kFALSE;
    441 
    442455    //
    443456    // Calculate new target position (shortest distance to go)
     
    459472    // const ZdAz dest = CorrectTarget(src, dst);
    460473    //
    461     const ZdAz dest = fBending(dst)*16384/2/TMath::Pi(); // [se]
     474    ZdAz bend = fBending(dst); // [rad]
     475
     476    const ZdAz dest = bend*16384/2/TMath::Pi(); // [se]
     477
     478    if (!CheckRange(bend))
     479        return kFALSE;
     480
     481    bend *= kRad2Deg;
    462482    fZdAzSoll = dst;
    463483
    464484    cout << "Source        Zd: " << src.Zd()  << "se  Az:" << src.Az()  << "se" << endl;
    465485    cout << "Destination   Zd: " << Rad2SE(dst.Zd()) << "se  Az:" << Rad2SE(dst.Az())  << "se" << endl;
    466     cout << "Bend'd Dest   Zd: " << Rad2SE(fZdAzSoll.Zd()) << "se  Az:" << Rad2SE(fZdAzSoll.Az()) << "se" << endl;
    467     cout << "Shortest Dest Zd: " << dest.Zd() << "se  Az:" << dest.Az() << "se" << endl;
     486    cout << "Bend'd Dest   Zd: " << dest.Zd() << "se  Az:" << dest.Az() << "se" << endl;
     487    cout << "Bend'd Dest   Zd: " << bend.Zd() << "deg  Az:" << bend.Az() << "deg" << endl;
    468488
    469489    //
     
    476496    {
    477497
    478         lout << "Step #" << i << endl;
     498        lout << "- Step #" << i << endl;
    479499        //
    480500        // Get Shaft Encoder Positions
     
    586606        //
    587607
    588         lout << "Do Relative Positioning..." << endl;
     608        lout << "- Do Relative Positioning..." << endl;
    589609        DoRelPos(rd, cdzd, cdaz);
    590         lout << "Relative Positioning Done" << endl;
     610        lout << "- Relative Positioning Done" << endl;
     611    }
     612    if (i==1 && track && !(Break() || HasError() || HasZombie()))
     613    {
     614        t.Now();
     615        lout << t << " - Positioning done." << endl;
     616        SetStatus(MDriveCom::kStopped);
     617        return TRUE;
    591618    }
    592619
     
    597624
    598625    t.Now();
    599     lout << t << " - Warning: Requested position not reached (i=" << i << ")" << endl;
     626    lout << t << " - Warning: Requested position not reached (i=" << dec << i << ")" << endl;
    600627    return FALSE;
    601628}
     
    759786        }
    760787}
    761 
     788/*
    762789Bool_t MCosy::AlignTrackingPos(ZdAz pointing, ZdAz &za) const
    763790{
     
    789816    return rc;
    790817}
     818*/
     819
     820ZdAz MCosy::AlignTrackingPos(ZdAz pointing) const
     821{
     822    // pointing [rad]
     823    // AlignTrackingPos [deg]
     824
     825    pointing *= kRad2Deg;
     826
     827    if (pointing.Zd()<0)
     828    {
     829        pointing.Zd(-pointing.Zd());
     830        pointing.Az(pointing.Az()+180);
     831    }
     832
     833    const ZdAz se = GetSePos()*2*TMath::Pi()/16384;   // [rad]
     834    const ZdAz unbendedse = fBending.CorrectBack(se)*kRad2Deg; // ist pointing
     835
     836    do
     837    {
     838        const Double_t d = unbendedse.Az() - pointing.Az();
     839        if (d>-180 && d<=180)
     840            break;
     841
     842        pointing.Az(pointing.Az()+TMath::Sign(360., d));
     843    } while (1);
     844
     845    return pointing/kRad2Deg;
     846/*
     847    const Bool_t rc = CheckRange(pointing);
     848    za = pointing/kRad2Deg; // [rad]
     849
     850    if (!rc)
     851        lout << "Error: Aligned position out of Range." << endl;
     852
     853    return rc;*/
     854}
    791855
    792856Double_t MCosy::Starguider(Double_t mjd, ZdAz &dest) const
     
    804868        return -1;
    805869
    806     ZdAz point;
     870    ZdAz point=AlignTrackingPos(ZdAz(zd, az)/kRad2Deg);
     871    /*
    807872    if (!AlignTrackingPos(ZdAz(zd, az), point))
    808873    {
    809874        cout << "Starguider position couldn't be aligned..." << endl;
    810875        return -1;
    811     }
     876    }*/
     877
     878    // FIXME: Check Range missing!
    812879
    813880    const ZdAz diff = (dest-point)*kRad2Deg;
     
    854921
    855922    if (!SetPosition(dest, kTRUE))
     923    //if (!SetPosition(dest, kFALSE))
    856924    {
    857925        lout << "Error: Cannot start tracking, positioning failed." << endl;
     
    925993        //
    926994        const Double_t mjd = sla.GetMjd()+dt/(60*60*24);
    927         const ZdAz pointing = sla.CalcZdAz(fRaDec, mjd)*kRad2Deg; // soll pointing [deg]
    928 
     995        const ZdAz pointing = sla.CalcZdAz(fRaDec, mjd); // soll pointing [deg]
     996
     997        /*
    929998        ZdAz dest;
    930999        if (!AlignTrackingPos(pointing, dest))
    9311000            break;
     1001            */
     1002        ZdAz dest = AlignTrackingPos(pointing);
    9321003
    9331004        ZdAz vcalc = sla.GetApproxVel(fRaDec) * kGearRatio2*4./60.;  // [re/min]
     
    9401011        {
    9411012            dest = fBending(dest);       // [rad]
     1013
     1014            if (!CheckRange(dest))
     1015                break;
     1016
    9421017            dest *= 16384/TMath::Pi()/2; // [se]
    9431018            dest *= kGearRatio;          // [re]
     
    10211096         */
    10221097        usleep(1000000); // 1s
     1098        cout << "." << flush;
    10231099        //usleep(50000); // 0.05s
    10241100    }
     
    11381214    //CheckConnections();
    11391215
     1216    CheckForError();
     1217
    11401218    if (HasZombie())
    11411219    {
     
    11571235    }
    11581236
     1237    CheckForError();
    11591238    return true;
    11601239}
     
    12741353        cout << "WM_Position: start." << endl;
    12751354        {
    1276             if (!CheckNetwork())
    1277                 return (void*)0xebb0;
     1355            //if (!CheckNetwork())
     1356            //    return (void*)0xebb0;
    12781357
    12791358            ZdAz dest = *((ZdAz*)mp);
     
    13871466
    13881467            ZdAz a1 = sla.CalcZdAz(rd*kDeg2Rad); // [rad]
    1389             const ZdAz a0 = a1*kRad2Deg;               // [deg]
    13901468
    13911469            cout << "Ra/Dec source: " << xy.X()  << "h " << xy.Y()  << "°" << endl;
    1392             cout << "Zd/Az target:  " << a0.Zd() << "° " << a0.Az() << "°" << endl;
     1470            cout << "Zd/Az target:  " << a1.Zd()*kRad2Deg << "° " << a1.Az()*kRad2Deg << "°" << endl;
    13931471
    13941472            if (fZd1 && fZd2 && fAz)
    1395                 AlignTrackingPos(a0, a1);
    1396 
    1397             a1 = fBending(a1)*kRad2Deg;
     1473                a1 = AlignTrackingPos(a1);
     1474
     1475            a1 = fBending(a1);
     1476            CheckRange(a1);
     1477            a1 *= kRad2Deg;
    13981478
    13991479            const ZdAz a2 = a1*16384/360;
     
    14031483        }
    14041484        return (void*)0xa17a;
     1485
     1486    case WM_ENDSWITCH:
     1487        {
     1488            ZdAz pos = GetSePos()*TMath::Pi()*2/16384;
     1489            pos = fBending.SubtractOffsets(pos)*kRad2Deg;
     1490
     1491            cout << "Endswitch Position:  Zd=" << pos.Zd() << "°  Az=";
     1492            cout << pos.Az() << "°" << endl;
     1493        }
     1494
     1495        return (void*)0x1010;
    14051496
    14061497    case WM_QUIT:
     
    14361527    fMin.Set(zmin, amin);
    14371528
    1438     cout << " Min: " << zmin << "deg  " << amin << "deg" << endl;
    1439 
    14401529    const Double_t amax = env.GetValue("Az_Max[deg]", 305.0);
    14411530    const Double_t zmax = env.GetValue("Zd_Max[deg]", 98.25);
    14421531    fMax.Set(zmax, amax);
    1443 
    1444     cout << " Max: " << zmax << "deg  " << amax << "deg" << endl;
     1532    cout << "done." << endl;
     1533
     1534    cout << " * Min:  " << zmin << "deg  " << amin << "deg" << endl;
     1535    cout << " * Max:  " << zmax << "deg  " << amax << "deg" << endl;
     1536
     1537    fMin = fBending.AddOffsets(fMin/kRad2Deg);
     1538    fMax = fBending.AddOffsets(fMax/kRad2Deg);
     1539
     1540    cout << " * Min': " << fMin.Zd()*kRad2Deg << "deg  " << fMin.Az()*kRad2Deg << "deg" << endl;
     1541    cout << " * Max': " << fMax.Zd()*kRad2Deg << "deg  " << fMax.Az()*kRad2Deg << "deg" << endl;
    14451542
    14461543    cout << "Reading gear ratios..." << flush;
     
    15151612        return;
    15161613
    1517     lout << "Tracking Thread started..." << endl;
     1614    lout << "- Tracking Thread started..." << endl;
    15181615
    15191616    SlaStars sla(fObservatory);
     
    16161713        ZdAz soll(sollzd.Zd(), sollaz.Az()); // [rad]
    16171714
    1618         AlignTrackingPos(soll*kRad2Deg, fZdAzSoll);
     1715        fZdAzSoll = AlignTrackingPos(soll);
    16191716
    16201717        ist *= TMath::Pi()*2/16384;
     
    16281725    }
    16291726
    1630     lout << "Tracking Thread done." << endl;
     1727    lout << "- Tracking Thread done." << endl;
    16311728
    16321729    //---        fout << endl << endl;
     
    18181915ZdAz MCosy::GetPointingPos() const
    18191916{
     1917    if (fZd1->IsZombieNode() || fZd2->IsZombieNode() || fAz->IsZombieNode())
     1918        return ZdAz(0, 0);
     1919
    18201920    // GetPointingPos [deg]
    18211921    const ZdAz seist = GetSePos()*2*TMath::Pi()/16384; // [se]
    1822     return fBending.CorrectBack(seist)*180/TMath::Pi();
     1922
     1923    cout << seist.Zd()*kRad2Deg << " " << seist.Az()*kRad2Deg << endl;
     1924
     1925    ZdAz back = fBending.CorrectBack(seist)*180/TMath::Pi();
     1926
     1927    cout << back.Zd() << " " << back.Az() << endl;
     1928
     1929    return back;
    18231930}
    18241931
     
    18651972    // FIXME: Not thread safe!
    18661973    static int i=0;
    1867     if (i++==8)
     1974    if (i++==7)
    18681975    {
    18691976        fCom->SendReport(fStatus, fRaDec, fZdAzSoll, bendist, fTrackingError);
     
    20022109    // Don't call this function twice!
    20032110    Network::Start();
     2111
     2112    CheckForError();
    20042113
    20052114    ReadConfig();
     
    21802289    // temp(°C) pressure(mB) height(m) humidity(1) wavelength(microm) troplapserate(K/m)
    21812290
    2182     fCom = new MDriveCom(out);
     2291    fCom = new MDriveCom(this, out);
    21832292    fCom->Start();
    21842293}
  • trunk/MagicSoft/Cosy/main/MCosy.h

    r2384 r2518  
    3131#define WM_TRACKPOS     0x100e
    3232#define WM_POSITION1    0x100f
     33#define WM_ENDSWITCH    0x1010
    3334
    3435class ShaftEncoder;
     
    115116    ofstream *tpout;
    116117
    117     Bool_t AlignTrackingPos(ZdAz pointing, ZdAz &za) const;
     118    //Bool_t AlignTrackingPos(ZdAz pointing, ZdAz &za) const;
     119    ZdAz AlignTrackingPos(ZdAz pointing) const;
    118120    Bool_t CheckRange(const ZdAz &d) const;
    119121    Double_t Starguider(Double_t mjd, ZdAz &dest) const;
  • trunk/MagicSoft/Cosy/main/MStarguider.cc

    r2278 r2518  
    176176    fInterpol->AddEntry("2",   IDM_kInterpol2);
    177177    fInterpol->AddEntry("Off", IDM_kInterpol1);
    178     fInterpol->CheckEntry(IDM_kInterpol1);
    179178    fInterpol->Associate(this);
    180179    fList->Add(fInterpol);
    181180
    182     fIntRate = 1;
     181    TString disp=gVirtualX->DisplayName();
     182    if (disp.First(':')>0)
     183        disp=disp(0, disp.First(':'));
     184
     185    if (disp.IsNull() || disp==(TString)"localhost")
     186    {
     187        fInterpol->CheckEntry(IDM_kInterpol1);
     188        fIntRate = 1;
     189    }
     190    else
     191    {
     192        fInterpol->CheckEntry(IDM_kInterpol125);
     193        fIntRate = 125;
     194    }
    183195
    184196    fSetup = new MGPopupMenu(p);
     
    347359    gVirtualX->GrabButton(fId, kButton2, 0, 0, 0, 0, kTRUE);
    348360
    349     fTimer=new TTimer(this, 1000/25); // 100ms
     361    fTimer=new TTimer(this, 1000/25); // 40ms
    350362    fTimer->TurnOn();
    351363
Note: See TracChangeset for help on using the changeset viewer.