Changeset 6841 for trunk/MagicSoft


Ignore:
Timestamp:
03/17/05 11:02:59 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Cosy
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Cosy/Changelog

    r4888 r6841  
    11                                                                  -*-*- END -*-*-
     2
     3 2005/03/17 - Thomas Bretz
     4
     5   * main/MCosy.[h,cc]:
     6     - implemented WM_GRB and TrackPositionGRB for GRB mode
     7
     8   * main/MStarguider.cc:
     9     - added 'status' to FINDSTAR-REPORT
     10     - send STARG-REPORT only if Starguider is switched on
     11     - enhanced output in starguider report
     12
     13   * tcpip/MCeCoCom.cc:
     14     - tried to backengineer the CC-REPORT because it is not documented
     15       in the CC TDAS
     16     - changed critical values for windspeed from 10/20/30 to 30/40/50
     17
     18   * tcpip/MDriveCom.[h,cc]:
     19     - implemented handling of GRB command
     20     - enhanced SendStargReport. Starguider Report now:
     21       misszd[%05.3f] missaz[%05.3f]
     22       nomzd[%c %03d %02d %03d] nomaz[%c %03d %02d %03d]
     23       centerx[%05.1f] centery[%05.1f] n[%04d]
     24       bright[%03.1f] mjd[%12.6f]
     25
     26
    227
    328 2004/09/05 - Robert Wagner (La Palma)
  • trunk/MagicSoft/Cosy/main/MCosy.cc

    r4255 r6841  
    415415
    416416void MCosy::TrackPosition(const RaDec &dst) // ra, dec [rad]
     417{
     418    MTracking track(this, lout);
     419    track.SetOut(fOutRep);
     420//#ifdef EXPERT
     421//    track.SetPointAccDec(0.4, 0.4);
     422//    track.SetPointVelocity(0.2); // fast: 0.6, slow: 0.2
     423//#else
     424    track.SetPointAccDec(0.2, 0.1);
     425    track.SetPointVelocity(0.1);
     426//#endif
     427    track.SetTrackAccDec(0.1, 0.1);
     428
     429    track.TrackPosition(dst);
     430}
     431
     432void MCosy::TrackPositionGRB(const RaDec &dst) // ra, dec [rad]
    417433{
    418434    MTracking track(this, lout);
     
    701717        return (void*)0x8888;
    702718
     719    case WM_GRB:
     720        //cout << "WM_Track: START" << endl;
     721        {
     722            RaDec dest = ((RaDec*)mp)[0];
     723            if (fStarguider)
     724                fStarguider->SetPointingPosition(((RaDec*)mp)[1]);
     725            if (!CheckNetwork())
     726                return (void*)0xebb0;
     727            TrackPositionGRB(dest*kDeg2Rad);
     728        }
     729        //cout << "WM_Track: done. (return 0x8888)" << endl;
     730        return (void*)0x8888;
     731
    703732    case WM_NEWTRACK:
    704733        //cout << "WM_NewTrack: START" << endl;
  • trunk/MagicSoft/Cosy/main/MCosy.h

    r4865 r6841  
    3737#define WM_POSITION1    0x100f
    3838#define WM_ENDSWITCH    0x1010
     39#define WM_GRB          0x1011
    3940
    4041class ShaftEncoder;
     
    153154    int  SetPosition(const ZdAz &dst, Bool_t track=kFALSE);
    154155    void TrackPosition(const RaDec &dst); // ra, dec [rad]
     156    void TrackPositionGRB(const RaDec &dst); // ra, dec [rad]
    155157
    156158    void TerminateApp();
  • trunk/MagicSoft/Cosy/main/MStarguider.cc

    r4888 r6841  
    12191219    if (outrep.Lock("MStarguider::FindStar"))
    12201220    {
    1221         outrep << "FINDSTAR-REPORT " << MTime(-1) << " " << setprecision(7);
     1221        outrep << "FINDSTAR-REPORT 00 " << MTime(-1) << " " << setprecision(7);
    12221222        outrep << 90-za0.Alt() << " " << za0.Az() << " ";
    12231223        outrep << za1.Zd() << " " << za1.Az() << " ";
     
    13671367            fStargCaos->Run(img, kFALSE, kFALSE, pos, t, 30, 3.0); // [px]
    13681368        const Float_t pixsize = atof(fPixSize->GetText()); // [arcsec/px]
    1369         sgcenterzdaz.Zd((sgcenter.GetY()-293.6) * pixsize /3600 );
     1369
     1370        // BE CAREFULL: This transformation is WRONG. It is just
     1371        // a transformation of units, but this implies, that the
     1372        // coordiante axis in both units look the same. This is
     1373        // wrong exspecially near the zenith were az-lines are highly
     1374        // curved around the zenith!
     1375        sgcenterzdaz.Zd((sgcenter.GetY()-293.6) * pixsize /3600 );
    13701376        sgcenterzdaz.Az((sgcenter.GetX()-53.2) * pixsize /3600 );
    13711377#ifdef EXPERT
     
    14871493        f2.DrawCircle(skycenter, 3.84*.5*74.0, 0x0a);
    14881494
     1495        if (fCosy) {
     1496            MDriveCom &com = *fCosy->GetDriveCom();
     1497            com.SendStargReport(fStatus, fD, fSao->GetZdAz(), sgcenter, spots.GetEntries(), bright, time.GetMjd());    // Report
     1498        }
    14891499    } //CalcStars
    1490 
    1491     if (fCosy) {
    1492         MDriveCom &com = *fCosy->GetDriveCom();
    1493         com.SendStargReport(fStatus, fD);    // Report
    1494     }
    14951500
    14961501    // Draw Circles around center of Camera
  • trunk/MagicSoft/Cosy/tcpip/MCeCoCom.cc

    r4865 r6841  
    3232    // Remove the 30 tokens of the subsystem status
    3333    //  table 12.1 p59
    34     for (int i=0; i<30; i++)
     34    for (int i=0; i<31; i++)
    3535        str.Remove(0, str.First(' ')+1);
    3636
     
    3838    float zd, az, dec, ra, temp, solar, wind, hum;
    3939    n=sscanf(str.Data(),
    40              "%f %f %f %f %f %f %f %f %*f %*f %n",
     40             "%f %f %f %f %f %f %f %f %*f %*f %*s %*s %*s %*s %n",
    4141             &zd, &az, &dec, &ra, &temp, &solar, &wind, &hum, &len);
    4242    if (n!=8)
     
    6060    fWindSpeed = wind;
    6161
    62     if (fWindSpeed>30)
     62    if (fWindSpeed>50)
    6363        fAlarmCounter++;
    6464    else
     
    136136    if (fHumidity>80)
    137137        rc++;
    138     if (fWindSpeed>10)
     138    if (fWindSpeed>30)
    139139        rc++;
    140     if (fWindSpeed>20)
     140    if (fWindSpeed>40)
    141141        rc++;
    142     if (fWindSpeed>30)
     142    if (fWindSpeed>50)
    143143        rc++;
    144144
  • trunk/MagicSoft/Cosy/tcpip/MDriveCom.cc

    r4865 r6841  
    77#include "MCosy.h"
    88#include "MString.h"
     9#include "Ring.h"
    910
    1011using namespace std;
     
    6263    //cout << "MDriveCom - TRACK... start." << endl;
    6364    fQueue->PostMsg(WM_TRACK, &rd, sizeof(rd));
     65    //cout << "MDriveCom - TRACK... done." << endl;
     66    return true;
     67}
     68
     69bool MDriveCom::CommandGRB(TString &str)
     70{
     71    Double_t ra, dec;
     72    if (!ReadPosition(str, ra, dec))
     73    {
     74        cout << "ERROR - Reading position from GRB" << endl;
     75        return false;
     76    }
     77    if (!str.IsNull())
     78    {
     79        cout << "ERROR - Too many bytes in command GRB" << endl;
     80        return false;
     81    }
     82
     83    cout << "CC-COMMAND " << MTime(-1) << " GRB " << ra << "h " << dec << "d '" << str << "'" << endl;
     84
     85    ra *= 15; // h -> deg
     86
     87    RaDec rd[2] = { RaDec(ra, dec), RaDec(ra, dec) };
     88
     89    //cout << "MDriveCom - TRACK... start." << endl;
     90    fQueue->PostMsg(WM_GRB, &rd, sizeof(rd));
    6491    //cout << "MDriveCom - TRACK... done." << endl;
    6592    return true;
     
    113140    if (cmd==(TString)"RADEC")
    114141        return CommandRADEC(str);
     142
     143    if (cmd==(TString)"GRB")
     144        return CommandGRB(str);
    115145
    116146    if (cmd==(TString)"ZDAZ")
     
    190220}
    191221
    192 bool MDriveCom::SendStargReport(UInt_t stat, ZdAz miss)
    193 {
    194    
    195     // miss [rad]
     222bool MDriveCom::SendStargReport(UInt_t stat, ZdAz miss, ZdAz nompos, Ring center, Int_t n, Double_t bright, Double_t mjd)
     223{
     224    // miss   [deg]
     225    // nompos [rad]
    196226    const MTime t(-1);
    197227
    198     miss *= kRad2Deg;
     228    miss   *= 60;        // [arcmin]
     229    nompos *= kRad2Deg;  // [deg]
    199230
    200231    // Set status flag
     
    211242
    212243    TString str;
    213     str += txt.Print("%05.3f ", miss.Zd());
    214     str += txt.Print("%05.3f", miss.Az());
     244    str += txt.Print("%05.3f ", miss.Zd());       //[arcmin]
     245    str += txt.Print("%05.3f ", miss.Az());       //[arcmin]
     246    Print(str, nompos.Zd());                      //[deg]
     247    Print(str, nompos.Az());                      //[deg]
     248    str += txt.Print("%05.1f ",   center.GetX()); //number
     249    str += txt.Print("%05.1f ",   center.GetY()); //number
     250    str += txt.Print("%04d ",   n);               //number
     251    str += txt.Print("%03.1f",  bright);
     252    str += txt.Print("%12.6f ", t.GetMjd());      // mjd
    215253   
    216254    return Send("STARG-REPORT", str, kTRUE);
  • trunk/MagicSoft/Cosy/tcpip/MDriveCom.h

    r4865 r6841  
    99class ZdAz;
    1010class MsgQueue;
     11class Ring;
    1112
    1213class MDriveCom : public MCeCoCom
     
    2223
    2324    bool CommandRADEC(TString &str);
     25    bool CommandGRB(TString &str);
    2426    bool CommandZDAZ(TString &str);
    2527
     
    3941
    4042    bool SendReport(UInt_t stat, RaDec rd, ZdAz so, ZdAz is, ZdAz er);
    41     bool SendStargReport(UInt_t stat, ZdAz miss);
     43    bool SendStargReport(UInt_t stat, ZdAz miss, ZdAz nompos, Ring center, Int_t n, Double_t bright, Double_t mjd);
    4244    bool SendStatus(const char *stat);
    4345};
Note: See TracChangeset for help on using the changeset viewer.