Changeset 2805 for trunk/MagicSoft
- Timestamp:
- 01/14/04 18:06:11 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 2 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r2804 r2805 14 14 - include MFFT 15 15 - put MCurrents.cc back into the Makefile (was only in the LinkDef) 16 16 17 17 18 2004/01/14: Abelardo Moralejo … … 22 23 rms = 0 later resulted in the pixel being eliminated in the 23 24 image cleaning. 25 26 24 27 25 28 2004/01/14: Thomas Bretz … … 62 65 - removed forbidden underscore from member variable 63 66 - 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 64 78 65 79 -
trunk/MagicSoft/Mars/manalysis/Makefile
r2804 r2805 77 77 MCT1PadONOFF.cc \ 78 78 MPad.cc \ 79 MCurrents.cc \80 79 MPedestalWorkaround.cc \ 81 80 MExtractedSignalCam.cc \ -
trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc
r2788 r2805 190 190 filemenu->AddEntry("Save As status.&root", kFileSaveAsRoot); 191 191 filemenu->AddSeparator(); 192 filemenu->AddEntry("&Open...", kFileOpen); 192 193 filemenu->AddEntry("Save &As...", kFileSaveAs); 193 194 filemenu->AddSeparator(); … … 1088 1089 return kTRUE; 1089 1090 1091 case kFileOpen: 1092 Open(); 1093 return kTRUE; 1094 1090 1095 case kFileSaveAs: 1091 1096 SaveAs(); … … 1725 1730 { 1726 1731 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(); 1728 1756 1729 1757 Long_t t[4]; // { id, size, flags, modtime } … … 1768 1796 delete c[1]; 1769 1797 delete c[0]; 1798 */ 1770 1799 } 1771 1800 … … 2155 2184 { 2156 2185 "PostScript", "*.ps", 2157 // "Encapsulated PostScript", "*.eps",2158 2186 "Gif files", "*.gif", 2159 2187 "Macro files", "*.C", … … 2186 2214 Warning("MStatusDisplay::SaveAs", "Unknown Extension: %s", fi.fFilename); 2187 2215 return 0; 2216 } 2217 2218 // -------------------------------------------------------------------------- 2219 // 2220 // Open contents of a MStatusDisplay with key name from file fname. 2221 // 2222 Int_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 // 2238 Int_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); 2188 2262 } 2189 2263 -
trunk/MagicSoft/Mars/mbase/MStatusDisplay.h
r2787 r2805 39 39 typedef enum { 40 40 // kFile 41 kFileBrowser, kFileCanvas, kFile Save, kFileSaveAs, kFileSaveAsPS,41 kFileBrowser, kFileCanvas, kFileOpen, kFileSave, kFileSaveAs, kFileSaveAsPS, 42 42 kFileSaveAsRoot, kFileSaveAsGIF, kFileSaveAsC, kFilePrint, 43 43 kFilePrinterName, kFileClose, kFileExit, kFileReset, … … 183 183 184 184 Int_t SaveAs(Int_t num=-1); 185 Int_t Open(TString fname, const char *name="MStatusDisplay"); 186 Int_t Open(); 185 187 186 188 Status_t CheckStatus() const { return fStatus; }
Note:
See TracChangeset
for help on using the changeset viewer.