Changeset 730 for trunk/MagicSoft/Mars


Ignore:
Timestamp:
04/09/01 14:06:04 (24 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r729 r730  
    55 * mgui/MGeomPix.cc:
    66   - fixed a small error in SetNeighbors (thanks to Oscar)
     7   
     8 * mgui/MGFadcDisp.[h,cc]:
     9   - Fixed many small errors which caused the display to display nonsens
     10     in some situations
    711
    812
  • trunk/MagicSoft/Mars/meventdisp/MGFadcDisp.cc

    r705 r730  
    273273       
    274274
    275 void MGFadcDisp::CreatePixelList() {
    276   //
    277   //   after a new event is read in one has to update
    278   //   the list of pixels in the fPixelList (TGListBox)
    279   //
    280   const Int_t redraw = fPixelList->GetSelected() ;
    281  
    282   MRawEvtPixelIter fPixelIter( fEvtData );
    283 
    284   //
    285   //   put the selection of the last event in memory
    286   //
    287   fPixelList->RemoveEntries(0, fPixelIter.GetNumPixels()) ;
    288 
    289   while ( fPixelIter.Next() )
     275void MGFadcDisp::CreatePixelList(Int_t lastsel)
     276{
     277    //
     278    //   after a new event is read in one has to update
     279    //   the list of pixels in the fPixelList (TGListBox)
     280    //
     281
     282    //
     283    //   put the selection of the last event in memory
     284    //
     285    MRawEvtPixelIter pixel(fEvtData);
     286    while (pixel.Next())
    290287    {
    291288        char wortdummy[100] ;
    292         //      cout << fPixelIter.GetPixelId() << endl ;
    293         sprintf( wortdummy, "%d", fPixelIter.GetPixelId() ) ;
    294 
    295         fPixelList->AddEntry( wortdummy, fPixelIter.GetNumEntry()) ;
     289        sprintf(wortdummy, "%d", pixel.GetPixelId());
     290        fPixelList->AddEntry(wortdummy, pixel.GetPixelId());
    296291    }
    297292
    298   fPixelList->MapSubwindows() ;
    299   fPixelList->Layout() ;
    300 
    301   // check if the pixel from last event also occurs in this event
    302 
    303   fPixelIter.Reset() ;
    304 
    305   while ( fPixelIter.Next() )
    306   {
    307       if (fPixelIter.GetPixelId() != redraw )
    308           continue;
    309 
    310       fCan->Clear() ;
    311       fCan->cd() ;
    312 
    313       char wortdummy[100] ;
    314       sprintf(wortdummy, "GRAPH%d", redraw ) ;
    315       fEvtData->Draw(wortdummy) ;
    316 
    317       fCan->Modified() ;
    318       fCan->Update() ;
    319 
    320       fPixelList->Select(redraw, kTRUE) ;
    321       return;
    322   }
    323 
    324   fCan->Clear() ;
    325   fCan->cd() ;
    326   fCan->Modified() ;
    327   fCan->Update() ;
     293    fPixelList->MapSubwindows();
     294    fPixelList->Layout();
     295
     296    //
     297    // check if the pixel from last event also occurs in this event
     298    //
     299    fCan->Clear() ;
     300    fCan->cd() ;
     301
     302    if (lastsel<0 || !pixel.Jump(lastsel))
     303    {
     304        pixel.Reset();
     305        lastsel=pixel.GetPixelId();
     306
     307    }
     308
     309    char wortdummy[100] ;
     310    sprintf(wortdummy, "GRAPH%d", lastsel);
     311    fEvtData->Draw(wortdummy);
     312    fPixelList->Select(lastsel, kTRUE);
     313
     314    fCan->Modified();
     315    fCan->Update();
    328316}
    329317
     
    355343    else
    356344    {
    357         fReadTree->SetEventNum(iEvt) ;
    358         fReadTree->GetEvent() ;
    359         CreatePixelList() ;
     345        const Int_t lastsel = fPixelList->GetSelected();
     346
     347        fPixelList->RemoveEntries(0, fEvtData->GetNumPixels());
     348
     349        fReadTree->SetEventNum(iEvt);
     350        fReadTree->GetEvent();
     351
     352        CreatePixelList(lastsel);
    360353    }
    361354
    362     UpdateEventCounter() ;
     355    UpdateEventCounter();
    363356}
    364357
     
    416409            {
    417410            case M_PIXELLIST:
    418               sprintf(wortdummy, "GRAPH%d",fPixelList->GetSelected() ) ;
    419 
    420               fCan->Clear() ; 
     411              sprintf(wortdummy, "GRAPH%d", fPixelList->GetSelected());
     412
     413              fCan->Clear() ;
    421414              fCan->cd() ;
    422415
     
    438431            break ;
    439432
    440         case kTE_ENTER:
    441           sprintf(wortdummy, "%s",  fTxtEvtNr->GetText()) ;
    442           cout << wortdummy<< endl  ;
    443           cout << atoi(wortdummy) << endl ;
    444          
    445           ReadinEvent( atoi(wortdummy) ) ;
     433        case kTE_ENTER:
     434            {
     435                const char *txt = fTxtEvtNr->GetText();
     436                ReadinEvent(atoi(txt));
     437            }
    446438          break;
    447439        }
  • trunk/MagicSoft/Mars/meventdisp/MGFadcDisp.h

    r698 r730  
    112112  void CloseWindow() ;
    113113
    114   void CreatePixelList() ;
     114  void CreatePixelList(Int_t lastsel=-1) ;
    115115  void UpdateEventCounter() ;
    116116  void ReadinEvent(UInt_t iEvt) ;
Note: See TracChangeset for help on using the changeset viewer.