Changeset 1916


Ignore:
Timestamp:
04/07/03 18:30:43 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r1915 r1916  
    4242     - changed naming style of variables
    4343     - changes array access
     44
     45   * mhist/MHFadcCam.[h,cc]:
     46     - added HasHi
     47     - added Exists
     48
     49   * mmain/MDataCheck.cc:
     50     - removed unimplemented buttons
     51
     52   * mdatacheck/MGDisplayAdc.[h,cc]:
     53     - tried to implement some unimplemented buttons
     54     - don't display non existing (empty) histograms in list
    4455
    4556
  • trunk/MagicSoft/Mars/mdatacheck/MGDisplayAdc.cc

    r1654 r1916  
    2626#include "MGDisplayAdc.h"
    2727
     28#include <stdlib.h>              // mkstemp
    2829#include <iostream.h>            // cout for debugging
    2930
     31#include <TSystem.h>             // gSystem
     32#include <TCanvas.h>             // TCanvas.h
     33#include <TGSlider.h>            // TGVSlider
    3034#include <TGButton.h>            // TGTextButton
    31 #include <TCanvas.h>             // TCanvas.h
    3235#include <TGMsgBox.h>            // TGMsgBox
    3336#include <TGListBox.h>           // TGListBox
    34 #include <TGSlider.h>            // TGVSlider
    3537#include <TGButtonGroup.h>       // TGVButtonGroup
    3638#include <TRootEmbeddedCanvas.h> // TRootEmbeddedCanvas
     
    302304
    303305    for (Int_t i=0; i<nhi; i++)
    304         fHistoList->AddEntry(fHists->GetHistHi(i)->GetName(), i+1);
     306        if (fHists->Exists(i))
     307            fHistoList->AddEntry(fHists->GetHistHi(i)->GetName(), i+1);
    305308
    306309    fHistoList->MapSubwindows();
     
    323326
    324327    fCanvas->Clear();
     328
     329    if (!fHists->Exists(selected-1))
     330        return;
    325331
    326332    const Int_t type = fHists->HasLo(selected-1) ? fHistoType : M_RADIO_HI;
     
    372378            {
    373379            case M_BUTTON_SAVE:
    374                 cout << "Sorry, not yet implemented!" << endl;
     380                fCanvas->SaveAs();
     381                cout << "Sorry, no well implemented!" << endl;
    375382                return kTRUE;
    376383
    377384            case M_BUTTON_PRINT:
    378                 cout << "Sorry, not yet implemented!" << endl;
     385                {
     386                    char *txt = (char*)"canvasXXXXXX";
     387                    mkstemp(txt);
     388                    TString name = txt;
     389                    name += ".ps";
     390                    fCanvas->SaveAs(name);
     391                    cout << "Calling 'lpr " << name << ".ps'" << endl;
     392                    gSystem->Exec(TString("lpr ")+name+".ps");
     393                    gSystem->Exec(TString("rm ")+name+".ps");
     394                }
     395                cout << "Sorry, not well implemented!" << endl;
    379396                return kTRUE;
    380397
     
    426443            return kTRUE;
    427444
    428         // Check for the slider movement and sicronise with TGListBox
     445        // Check for the slider movement and synchronise with TGListBox
    429446        if (parm2<1 || parm2>577)
    430447            return kTRUE;
  • trunk/MagicSoft/Mars/mhist/MHFadcCam.cc

    r1652 r1916  
    130130{
    131131    for (Int_t i=0; i<577; i++)
    132     {
    133         GetHistHi(i)->Reset();
    134         GetHistLo(i)->Reset();
    135     }
     132        Reset(i);
    136133}
     134
     135void MHFadcCam::Reset(Int_t i)
     136{
     137    GetHistHi(i)->Reset();
     138    GetHistLo(i)->Reset();
     139}
  • trunk/MagicSoft/Mars/mhist/MHFadcCam.h

    r1655 r1916  
    4949
    5050    void ResetHistograms();
     51    void Reset(Int_t i);
    5152
    5253    //
     
    5758
    5859    Bool_t HasLo(UInt_t i) const { return GetHistLo(i)->GetEntries()>0; }
     60    Bool_t HasHi(UInt_t i) const { return GetHistHi(i)->GetEntries()>0; }
     61
     62    Bool_t Exists(UInt_t i) const { return HasLo(i) && HasHi(i); }
    5963
    6064    void DrawPix(UInt_t i)     { (*this)[i].Draw(); }
  • trunk/MagicSoft/Mars/mmain/MDataCheck.cc

    r1668 r1916  
    5858: MBrowser(/*main,*/ p, w, h)
    5959{
    60     TGTextButton *pedadc = new TGTextButton(fTop1, "ADC Spectra of Pedestals", kButPedAdc);
     60    //TGTextButton *pedadc = new TGTextButton(fTop1, "ADC Spectra of Pedestals", kButPedAdc);
    6161    TGTextButton *cradc  = new TGTextButton(fTop1, "ADC Spectra of Cosmics",    kButEvtAdc);
    62     TGTextButton *pedtdc = new TGTextButton(fTop3, "Run Spectra of Pedestals", kButPedTdc);
    63     TGTextButton *crtdc  = new TGTextButton(fTop3, "Run Spectra of Cosmics",    kButEvtTdc);
    64 
    65     pedadc->Associate(this);
     62    //TGTextButton *pedtdc = new TGTextButton(fTop3, "Run Spectra of Pedestals", kButPedTdc);
     63    //TGTextButton *crtdc  = new TGTextButton(fTop3, "Run Spectra of Cosmics",    kButEvtTdc);
     64
     65    //pedadc->Associate(this);
    6666    cradc ->Associate(this);
    67     pedtdc->Associate(this);
    68     crtdc ->Associate(this);
    69 
    70     fList->Add(pedadc);
     67    //pedtdc->Associate(this);
     68    //crtdc ->Associate(this);
     69
     70    //fList->Add(pedadc);
    7171    fList->Add(cradc);
    72     fList->Add(pedtdc);
    73     fList->Add(crtdc);
     72    //fList->Add(pedtdc);
     73    //fList->Add(crtdc);
    7474
    7575    TGLayoutHints *laybut = new TGLayoutHints(kLHintsTop|kLHintsLeft, 10, 10, 5, 5);
    7676    fList->Add(laybut);
    7777
    78     fTop1->AddFrame(pedadc, laybut);
     78    //fTop1->AddFrame(pedadc, laybut);
    7979    fTop1->AddFrame(cradc,  laybut);
    8080
    81     fTop3->AddFrame(pedtdc, laybut);
    82     fTop3->AddFrame(crtdc,  laybut);
     81    //fTop3->AddFrame(pedtdc, laybut);
     82    //fTop3->AddFrame(crtdc,  laybut);
    8383
    8484    MapSubwindows();
Note: See TracChangeset for help on using the changeset viewer.