Changeset 8856


Ignore:
Timestamp:
02/05/08 11:41:55 (17 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Cosy
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Cosy/Changelog

    r8855 r8856  
    11                                                                  -*-*- END -*-*-
    22
     3 2008/02/05 Thomas Bretz (La Palma)
     4
     5   * cosy.cc:
     6     - setup address and port in constructor of Ethernet
     7
     8   * candrv/ethernet.[h,cc]:
     9     - added new data mebers fTxAddress and fTxPort
     10     - get all io addresses in constructor
     11
     12   * gui/MGCosy.cc:
     13     - switch off debug mode
     14
     15   * main/MCosy.cc, main/MStarguider.cc, videodev/Camera.cc:
     16     - added missing stream manipulators
     17
     18   * tcpip/MCeCoCom.h:
     19     - set address of CeCo in constructor of MTCpIpIO
     20
     21   * tcpip/MTcpIpIO.[h,cc]:
     22     - moved setting of destination address into arguments of constructor
     23
     24   * videodev/MVideo.cc:
     25     - tiny improfements to logging output
     26
     27
     28
    329 2008/02/04 Thomas Bretz (La Palma)
    430
    5    * candrv/interface.[h,cc], candrv/ethernet.[h,cc]:
     31   * candrv/interface.[h,cc], candrv/ethernet.[h,cc],
     32     MIncl.h, MLinkDef.h:
    633     - added
     34
     35   * Makefile:
     36     - removed readcam from list of programs
    737
    838
  • trunk/MagicSoft/Cosy/candrv/ethernet.cc

    r8854 r8856  
    5353//  and switch the can bus communication on
    5454//
    55 Ethernet::Ethernet(CanOpen *rx) : MTcpIpI(5358), Interface(rx)
     55Ethernet::Ethernet(const char *addr, const int tx, const int rx, CanOpen *receiver)
     56    : MTcpIpI(rx), Interface(receiver), fTxAddress(addr), fTxPort(tx)
    5657{
    5758    gLog << inf2 << "- Ethernet initialized." << endl;
     
    191192    */
    192193
     194    // FIXME: MUST BECOME NON-BLOCKING!!!!!
    193195    cout << "*** Send CanFrame over IP" << endl;
    194 
    195     // MUST BECOME NON-BLOCKING!!!!!
    196 
    197 //    MTcpIpO::SendFrame("192.168.0.2", 5357, (char*)(msg.data+1), msg.len-1);
    198     MTcpIpO::SendFrame("192.168.1.1", 5357, (char*)(msg.data+1), msg.len-1);
     196    // FIXME: MUST BECOME NON-BLOCKING!!!!!
     197
     198    MTcpIpO::SendFrame(fTxAddress, fTxPort, (char*)(msg.data+1), msg.len-1);
    199199
    200200    /*
  • trunk/MagicSoft/Cosy/candrv/ethernet.h

    r8855 r8856  
    1313{
    1414private:
     15    TString fTxAddress;
     16    Int_t   fTxPort;
     17
    1518    // Send interface based on MTcpIpI
    1619    void ReadSocket(TSocket &rx);
     
    2124
    2225public:
    23     Ethernet(CanOpen *rx);
     26    Ethernet(const char *addr, const int tx, const int rx, CanOpen *receiver);
    2427    virtual ~Ethernet();
    2528
  • trunk/MagicSoft/Cosy/cosy.cc

    r8819 r8856  
    180180    MCosy *cosy = new MCosy();
    181181
    182     Interface *interface = new Ethernet(cosy);
     182    Interface *interface = new Ethernet("127.0.0.1", 5357, 5358, cosy);
    183183    // Interface *interface = new VmodIcan(cosy, "/dev/dpm_00", 125);
    184184
  • trunk/MagicSoft/Cosy/gui/MGCosy.cc

    r8847 r8856  
    3535#include "SlaStars.h"
    3636
    37 #define DEBUG
    38 //#undef DEBUG
     37//#define DEBUG
     38#undef DEBUG
    3939//#define EXPERT
    4040//#define HAS_DEMO
  • trunk/MagicSoft/Cosy/main/MCosy.cc

    r8852 r8856  
    549549    if (HasZombie())
    550550    {
    551         lout << "- Found Zombies in Network..." << endl;
     551        gLog << warn << "- Found Zombies in Network..." << endl;
    552552        if (!RebootZombies())
    553553            return false;
  • trunk/MagicSoft/Cosy/main/MStarguider.cc

    r8847 r8856  
    216216
    217217    TString disp=gVirtualX->DisplayName();
    218     cout << "Display: " << disp << endl;
     218    gLog << all << "Display: " << disp << endl;
    219219    if (disp.First(':')>=0)
    220220        disp=disp(0, disp.First(':'));
     
    507507      fStatus(MDriveCom::kStandby)
    508508{
    509     cout << " #### FIXME: Make MCaos Thread safe!" << endl;
     509    gLog << warn << " #### FIXME: Make MCaos Thread safe!" << endl;
    510510
    511511    // This means that all objects added with AddFrame are deleted
     
    582582    delete fAmcSocket;
    583583
    584     cout << "Camera Display destroyed." << endl;
     584    gLog << inf2 << "Camera Display destroyed." << endl;
    585585}
    586586
     
    596596    if (len<0)
    597597    {
    598         cout << "ERROR - Sending Trigger to Amc" << endl;
     598        gLog << err << "ERROR - Sending Trigger to Amc" << endl;
    599599        return false;
    600600    }
    601601    if (len!=txt.Length())
    602602    {
    603         cout << "Send wrong number (" << len << ") of Bytes to Amc." << endl;
     603        gLog << err << "Send wrong number (" << len << ") of Bytes to Amc." << endl;
    604604        return false;
    605605    }
     
    615615void MStarguider::CloseWindow()
    616616{
    617     cout << "EventDisplay::CloseWindow: Exit Application Loop." << endl;
     617    gLog << inf2 << "EventDisplay::CloseWindow: Exit Application Loop." << endl;
    618618
    619619    //fClient.ExitLoop();
     
    817817                {
    818818                    const Float_t pixsize = atof(fPixSize->GetText());
    819                     cout << "Pixel Size changed to " << pixsize << "\"/pix" << endl;
     819                    gLog << all << "Pixel Size changed to " << pixsize << "\"/pix" << endl;
    820820                    fSao->SetPixSize(pixsize);
    821821                    return kTRUE;
     
    824824                {
    825825                    const Float_t angle = atof(fAngle->GetText());
    826                     cout << "Rotation Angle changed to " << angle << "deg" << endl;
     826                    gLog << all << "Rotation Angle changed to " << angle << "deg" << endl;
    827827                    fSao->SetRotationAngle(angle);
    828828                    return kTRUE;
     
    831831                {
    832832                    const Float_t cut = atof(fCut->GetText());
    833                     cout << "Starguider cleaning level changed to " << cut << " sigma." << endl;
     833                    gLog << all << "Starguider cleaning level changed to " << cut << " sigma." << endl;
    834834                    return kTRUE;
    835835                }
     
    13641364    if (num < 3) //was 1
    13651365    {
    1366         cout << "Sorry, less than 3 detected spot in FOV!" << endl;
     1366        gLog << warn << "Sorry, less than 3 detected spot in FOV!" << endl;
    13671367        if (fStargTPoint->IsDown())
    13681368            fStargTPoint->SetDown(kFALSE);
     
    13731373    if (stars.GetRealEntries() < 3)
    13741374    {
    1375         cout << "Sorry, less than 3 stars in FOV!" << endl;
     1375        gLog << warn << "Sorry, less than 3 stars in FOV!" << endl;
    13761376        if (fStargTPoint->IsDown())
    13771377            fStargTPoint->SetDown(kFALSE);
     
    14661466        // open tpoint file
    14671467        const TString name = MCosy::GetFileName("tpoint", "starg", "txt");
    1468         cout << "TPoint-Starg File ********* " << name << " ********** " << endl;
     1468        gLog << all << "TPoint-Starg File ********* " << name << " ********** " << endl;
    14691469
    14701470        fOutStargTp = new ofstream(name);
     
    15791579        {
    15801580            fTPoint->SetDown(kFALSE);
    1581             cout << "No star found. Couldn't take a tpoint." << endl;
     1581            gLog << warn << "No star found. Couldn't take a tpoint." << endl;
    15821582        }
    15831583        return ZdAz(.0,.0);
  • trunk/MagicSoft/Cosy/tcpip/MCeCoCom.h

    r8840 r8856  
    4949public:
    5050    MCeCoCom(MLog *out)
    51         : MTcpIpIO(7304, 7404), fOut(out), fStatus(0), fComStat(kNoCmdReceived),
     51        : MTcpIpIO("ceco", 7304, 7404), fOut(out), fStatus(0), fComStat(kNoCmdReceived),
    5252        fHumidity(0), fTemperature(0), fWindSpeed(0), fSolarRadiation(-1),
    5353        fAlarmCounter(0)
  • trunk/MagicSoft/Cosy/tcpip/MTcpIpIO.cc

    r8843 r8856  
    3535     */
    3636
    37 MTcpIpO::MTcpIpO(Int_t tx)
    38 {
    39     fTxSocket = new TSocket("ceco", tx);
     37MTcpIpO::MTcpIpO(const char *addr, Int_t tx)
     38{
     39    fTxSocket = new TSocket(addr, tx);
    4040}
    4141
     
    4646}
    4747
    48 MTcpIpIO::MTcpIpIO(Int_t tx, Int_t rx) : MTcpIpI(rx), MTcpIpO(tx)
     48MTcpIpIO::MTcpIpIO(const char *addr, Int_t tx, Int_t rx) : MTcpIpI(rx), MTcpIpO(addr, tx)
    4949{
    5050    RunThread();
  • trunk/MagicSoft/Cosy/tcpip/MTcpIpIO.h

    r8843 r8856  
    3737
    3838public:
    39     MTcpIpO(Int_t tx);
     39    MTcpIpO(const char *addr, Int_t tx);
    4040    ~MTcpIpO();
    4141
     
    5353
    5454public:
    55     MTcpIpIO(Int_t tx, Int_t rx);
     55    MTcpIpIO(const char *addr, Int_t tx, Int_t rx);
    5656    ~MTcpIpIO();
    5757
  • trunk/MagicSoft/Cosy/videodev/Camera.cc

    r8843 r8856  
    102102    if (!fVideo->IsOpen())
    103103    {
    104         gLog << "ERROR - Process: Device not open." << endl;
     104        gLog << err << "Camera::Thread: ERROR - Device not open." << endl;
    105105        return kFALSE;
    106106    }
  • trunk/MagicSoft/Cosy/videodev/MVideo.cc

    r8849 r8856  
    104104                return -4;
    105105
    106             gLog << err << "ERROR - MVideo::Ioctl -ioctl returned rc=" << rc << " '";
    107             gLog << strerror(errno) << "' (errno = " << errno << ")" << endl;
     106            gLog << err << "ERROR - MVideo::Ioctl 0x" << hex << req << ": errno=" << dec << errno << " - ";
     107            gLog << strerror(errno) << " (rc=" << rc << ")" << endl;
    108108            usleep(10);
    109109            continue;
    110110        }
    111111
    112         gLog << err << "ERROR - MVideo::Ioctl " << hex << req << ": errno=" << dec << errno << " - ";
     112        gLog << err << "ERROR - MVideo::Ioctl 0x" << hex << req << ": errno=" << dec << errno << " - ";
    113113        gLog << strerror(errno) << " (rc=" << rc << ")" << endl;
    114114        return rc;
     
    161161    }
    162162
    163     gLog << all << "Opening " << fPath << "..." << flush;
     163    gLog << all << "Opening " << fPath << "... " << flush;
    164164    do
    165165    {
     
    171171    if (fFileDesc == -1)
    172172    {
    173         gLog << err << "ERROR!" << endl;
     173        gLog << err << "ERROR: " << strerror(errno) << endl;
    174174        return kFALSE;
    175175    }
     
    263263        fCaps.maxheight, fCaps.maxwidth, // height, width
    264264        VIDEO_PALETTE_RGB24              // palette
     265        //768, 576,
     266        //VIDEO_PALETTE_RGB555             // palette
    265267    };
    266268
     
    271273        return kTRUE;
    272274
    273     if (errno == EAGAIN)
     275//    if (errno == EAGAIN)
    274276        gLog << err << "ERROR - Couldn't start capturing frame " << frame << " - unable to sync." << endl;
    275277
     
    341343
    342344    memcpy(&fChannel, &ch, sizeof(fChannel));
     345
     346    gLog << all << "Switched to channel " << chan << endl;
    343347
    344348    return kTRUE;
Note: See TracChangeset for help on using the changeset viewer.