Changeset 2805


Ignore:
Timestamp:
01/14/04 18:06:11 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
2 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r2804 r2805  
    1414     - include MFFT
    1515     - put MCurrents.cc back into the Makefile (was only in the LinkDef)
     16
    1617
    1718 2004/01/14: Abelardo Moralejo
     
    2223       rms = 0 later resulted in the pixel being eliminated in the
    2324       image cleaning.
     25
     26
    2427
    2528 2004/01/14: Thomas Bretz
     
    6265     - removed forbidden underscore from member variable
    6366     - changed wrong 0/1 in allocation of fResult into kFALSE/TRUE
     67
     68   * mbase/MStatusDisplay.[h,cc]:
     69     - added new member function Open
     70     - added new menu entry kFileOpen
     71     - changed UpdatePSheader algorithm (the old one was much too slow)
     72
     73   * manalysis/MCurrents.[h,cc]:
     74     - removed (old outdated)
     75
     76   * manalysis/Makefile, manalysis/AnalysisLinkDef.h:
     77     - removed MCurrents
    6478
    6579
  • trunk/MagicSoft/Mars/manalysis/Makefile

    r2804 r2805  
    7777           MCT1PadONOFF.cc  \
    7878           MPad.cc  \
    79            MCurrents.cc  \
    8079           MPedestalWorkaround.cc \
    8180           MExtractedSignalCam.cc \
  • trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc

    r2788 r2805  
    190190    filemenu->AddEntry("Save As status.&root", kFileSaveAsRoot);
    191191    filemenu->AddSeparator();
     192    filemenu->AddEntry("&Open...",             kFileOpen);
    192193    filemenu->AddEntry("Save &As...",          kFileSaveAs);
    193194    filemenu->AddSeparator();
     
    10881089        return kTRUE;
    10891090
     1091    case kFileOpen:
     1092        Open();
     1093        return kTRUE;
     1094
    10901095    case kFileSaveAs:
    10911096        SaveAs();
     
    17251730{
    17261731    const TString newstr("%%DocumentPaperSizes: a4\n%%Orientation: Landscape\n");
    1727     const Int_t   l = newstr.Length();
     1732
     1733    ifstream fin(name);
     1734    ofstream fout(name+".$$$");
     1735
     1736    char c;
     1737
     1738    TString str;
     1739    fin >> str >> c;                // Read "%!PS-Adobe-2.0\n"
     1740    fout << str << endl << newstr;
     1741
     1742    // Doing it in blocks seems not to gain much for small (MB) files
     1743    while (fin)
     1744    {
     1745        fin.read(&c, 1);
     1746        fout.write(&c, 1);
     1747    }
     1748
     1749    gSystem->Unlink(name);
     1750    gSystem->Rename(name+".$$$", name);
     1751/*
     1752    //
     1753    // Old style algorithm. Shifts blocks inside a single file --- SLOW!
     1754    //
     1755    const Int_t l = newstr.Length();
    17281756
    17291757    Long_t t[4]; // { id, size, flags, modtime }
     
    17681796    delete c[1];
    17691797    delete c[0];
     1798*/
    17701799}
    17711800
     
    21552184    {
    21562185        "PostScript",   "*.ps",
    2157         // "Encapsulated PostScript", "*.eps",
    21582186        "Gif files",    "*.gif",
    21592187        "Macro files",  "*.C",
     
    21862214    Warning("MStatusDisplay::SaveAs", "Unknown Extension: %s", fi.fFilename);
    21872215    return 0;
     2216}
     2217
     2218// --------------------------------------------------------------------------
     2219//
     2220//  Open contents of a MStatusDisplay with key name from file fname.
     2221//
     2222Int_t MStatusDisplay::Open(TString fname, const char *name)
     2223{
     2224    TFile file(fname, "READ");
     2225    if (file.IsZombie())
     2226    {
     2227        gLog << warn << "WARNING - Cannot open file " << fname << endl;
     2228        return 0;
     2229    }
     2230
     2231    return Read(name);
     2232}
     2233
     2234// --------------------------------------------------------------------------
     2235//
     2236//  Opens an open dialog
     2237//
     2238Int_t MStatusDisplay::Open()
     2239{
     2240    static const char *gOpenTypes[] =
     2241    {
     2242        "ROOT files", "*.root",
     2243        "All files",  "*",
     2244        NULL,           NULL
     2245    };
     2246
     2247    static TString dir(".");
     2248
     2249    TGFileInfo fi; // fFileName and fIniDir deleted in ~TGFileInfo
     2250
     2251    fi.fFileTypes = (const char**)gOpenTypes;
     2252    fi.fIniDir    = StrDup(dir);
     2253
     2254    new TGFileDialog(fClient->GetRoot(), this, kFDSave, &fi);
     2255
     2256    if (!fi.fFilename)
     2257        return 0;
     2258
     2259    dir = fi.fIniDir;
     2260
     2261    return Open(fi.fFilename);
    21882262}
    21892263
  • trunk/MagicSoft/Mars/mbase/MStatusDisplay.h

    r2787 r2805  
    3939    typedef enum {
    4040        // kFile
    41         kFileBrowser, kFileCanvas, kFileSave, kFileSaveAs, kFileSaveAsPS,
     41        kFileBrowser, kFileCanvas, kFileOpen, kFileSave, kFileSaveAs, kFileSaveAsPS,
    4242        kFileSaveAsRoot, kFileSaveAsGIF, kFileSaveAsC, kFilePrint,
    4343        kFilePrinterName, kFileClose, kFileExit, kFileReset,
     
    183183
    184184     Int_t  SaveAs(Int_t num=-1);
     185     Int_t  Open(TString fname, const char *name="MStatusDisplay");
     186     Int_t  Open();
    185187
    186188     Status_t CheckStatus() const { return fStatus; }
Note: See TracChangeset for help on using the changeset viewer.