Changeset 7887 for trunk/MagicSoft
- Timestamp:
- 08/19/06 20:22:55 (18 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r7886 r7887 18 18 19 19 -*-*- END OF LINE -*-*- 20 2006/08/19 Thomas Bretz 21 22 * mastro/MAstroCatalog.cc: 23 - replaced all ifstream by MZlib to allow reading gzip 24 compressed catalogs 25 26 * mbase/MString.[h,cc]: 27 - changed function Form() 28 - renamed old function Form() to Format() 29 30 * mastro/MAstroCatalog.cc, mbase/MParContainer.cc, 31 mbase/MStatusDisplay.cc, mbase/MTask.cc, mpointing/MHSrcPosCam.cc 32 mpointing/MPointingPos.cc: 33 - replaced MString::Form by new function name MString::Format 34 35 36 20 37 2006/08/18 Thomas Bretz 21 38 -
trunk/MagicSoft/Mars/NEWS
r7883 r7887 30 30 - callisto: Callisto now raises an error if one of the input files could 31 31 not be opened. 32 33 - callisto: In some rare cases it could happen that in the hi-gain 34 extraction of the digital filter the extractor returned nonsense 35 results due a wrong initializion of a variable 32 36 33 37 - callisto: The lo-gains have been marked as valid in some cases -
trunk/MagicSoft/Mars/mastro/MAstroCatalog.cc
r7491 r7887 129 129 130 130 #include <errno.h> // strerror 131 #include <fstream> // ifstream132 131 #include <stdlib.h> // ati, atof 133 132 #include <limits.h> // INT_MAX (Suse 7.3/gcc 2.95) … … 144 143 #include "MLog.h" 145 144 #include "MLogManip.h" 145 146 #include "MZlib.h" // MZlib <ifstream> 146 147 147 148 #include "MTime.h" … … 261 262 gLog << inf << "Reading Xephem catalog: " << catalog << endl; 262 263 263 ifstreamfin(catalog);264 MZlib fin(catalog); 264 265 if (!fin) 265 266 { … … 342 343 gLog << inf << "Reading NGC2000 catalog: " << catalog << endl; 343 344 344 ifstreamfin(catalog);345 MZlib fin(catalog); 345 346 if (!fin) 346 347 { … … 406 407 gLog << inf << "Reading Bright Star Catalog (BSC5) catalog: " << catalog << endl; 407 408 408 ifstreamfin(catalog);409 MZlib fin(catalog); 409 410 if (!fin) 410 411 { … … 478 479 gLog << inf << "Reading Heasarc PPM catalog: " << catalog << endl; 479 480 480 ifstreamfin(catalog);481 MZlib fin(catalog); 481 482 if (!fin) 482 483 { … … 582 583 gLog << inf << "Reading MAstroCatalog compressed catalog: " << catalog << endl; 583 584 584 ifstreamfin(catalog);585 MZlib fin(catalog); 585 586 if (!fin) 586 587 { … … 735 736 if (!str.IsNull()) 736 737 str += ": "; 737 str += MString::Form ("Ra=%.2fh Dec=%.1fd Mag=%.1f", ra, dec, mag);738 str += MString::Format("Ra=%.2fh Dec=%.1fd Mag=%.1f", ra, dec, mag); 738 739 if (txt) 739 740 { -
trunk/MagicSoft/Mars/mbase/MParContainer.cc
r7851 r7887 230 230 // 231 231 return (TString)o.GetName()==o.ClassName() ? (TString)o.ClassName() : 232 MString::Form ("%s [%s]", o.GetName(), o.ClassName());232 MString::Format("%s [%s]", o.GetName(), o.ClassName()); 233 233 } 234 234 -
trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc
r7827 r7887 253 253 filemenu->AddSeparator(); 254 254 255 const TString fname(MString::Form ("Save %s.", gROOT->GetName()));255 const TString fname(MString::Format("Save %s.", gROOT->GetName())); 256 256 MGPopupMenu *savemenu = new MGPopupMenu(gClient->GetRoot()); 257 savemenu->AddEntry(MString::Form ("%s&ps", fname.Data()), kFileSaveAsPS);258 savemenu->AddEntry(MString::Form ("%sp&df", fname.Data()), kFileSaveAsPDF);259 savemenu->AddEntry(MString::Form ("%s&svg", fname.Data()), kFileSaveAsSVG);257 savemenu->AddEntry(MString::Format("%s&ps", fname.Data()), kFileSaveAsPS); 258 savemenu->AddEntry(MString::Format("%sp&df", fname.Data()), kFileSaveAsPDF); 259 savemenu->AddEntry(MString::Format("%s&svg", fname.Data()), kFileSaveAsSVG); 260 260 savemenu->AddSeparator(); 261 savemenu->AddEntry(MString::Form ("%sp&ng", fname.Data()), kFileSaveAsPNG);262 savemenu->AddEntry(MString::Form ("%s&gif", fname.Data()), kFileSaveAsGIF);263 savemenu->AddEntry(MString::Form ("%s&jpg", fname.Data()), kFileSaveAsJPG);264 savemenu->AddEntry(MString::Form ("%s&xpm", fname.Data()), kFileSaveAsXPM);261 savemenu->AddEntry(MString::Format("%sp&ng", fname.Data()), kFileSaveAsPNG); 262 savemenu->AddEntry(MString::Format("%s&gif", fname.Data()), kFileSaveAsGIF); 263 savemenu->AddEntry(MString::Format("%s&jpg", fname.Data()), kFileSaveAsJPG); 264 savemenu->AddEntry(MString::Format("%s&xpm", fname.Data()), kFileSaveAsXPM); 265 265 //savemenu->AddEntry("Save status.x&cf", kFileSaveAsXCF); 266 266 //savemenu->AddEntry("Save status.&tiff", kFileSaveAsTIFF); … … 268 268 savemenu->AddEntry("Save status.&xml", kFileSaveAsXML); 269 269 savemenu->AddSeparator(); 270 savemenu->AddEntry(MString::Form ("%s&C", fname.Data()), kFileSaveAsC);271 savemenu->AddEntry(MString::Form ("%s&root", fname.Data()), kFileSaveAsRoot);270 savemenu->AddEntry(MString::Format("%s&C", fname.Data()), kFileSaveAsC); 271 savemenu->AddEntry(MString::Format("%s&root", fname.Data()), kFileSaveAsRoot); 272 272 savemenu->Associate(this); 273 273 … … 292 292 tabmenu->AddSeparator(); 293 293 294 const TString fname2(MString::Form ("Save %s-i.", gROOT->GetName()));294 const TString fname2(MString::Format("Save %s-i.", gROOT->GetName())); 295 295 MGPopupMenu *savemenu2 = new MGPopupMenu(gClient->GetRoot()); 296 savemenu2->AddEntry(MString::Form ("%s&ps", fname2.Data()), kTabSaveAsPS);297 savemenu2->AddEntry(MString::Form ("%sp&df", fname2.Data()), kTabSaveAsPDF);298 savemenu2->AddEntry(MString::Form ("%s&svg", fname2.Data()), kTabSaveAsSVG);296 savemenu2->AddEntry(MString::Format("%s&ps", fname2.Data()), kTabSaveAsPS); 297 savemenu2->AddEntry(MString::Format("%sp&df", fname2.Data()), kTabSaveAsPDF); 298 savemenu2->AddEntry(MString::Format("%s&svg", fname2.Data()), kTabSaveAsSVG); 299 299 savemenu2->AddSeparator(); 300 savemenu2->AddEntry(MString::Form ("%sp&ng", fname2.Data()), kTabSaveAsPNG);301 savemenu2->AddEntry(MString::Form ("%s&gif", fname2.Data()), kTabSaveAsGIF);302 savemenu2->AddEntry(MString::Form ("%s&jpg", fname2.Data()), kTabSaveAsJPG);303 savemenu2->AddEntry(MString::Form ("%s&xpm", fname2.Data()), kTabSaveAsXPM);300 savemenu2->AddEntry(MString::Format("%sp&ng", fname2.Data()), kTabSaveAsPNG); 301 savemenu2->AddEntry(MString::Format("%s&gif", fname2.Data()), kTabSaveAsGIF); 302 savemenu2->AddEntry(MString::Format("%s&jpg", fname2.Data()), kTabSaveAsJPG); 303 savemenu2->AddEntry(MString::Format("%s&xpm", fname2.Data()), kTabSaveAsXPM); 304 304 //savemenu->AddEntry("Save status.x&cf", kFileSaveAsXCF); 305 305 //savemenu->AddEntry("Save status.&tiff", kFileSaveAsTIFF); … … 307 307 savemenu->AddEntry("Save status.&xml", kFileSaveAsXML); 308 308 savemenu2->AddSeparator(); 309 savemenu2->AddEntry(MString::Form ("%s&C", fname2.Data()), kTabSaveAsC);310 savemenu2->AddEntry(MString::Form ("%s&root", fname2.Data()), kTabSaveAsRoot);309 savemenu2->AddEntry(MString::Format("%s&C", fname2.Data()), kTabSaveAsC); 310 savemenu2->AddEntry(MString::Format("%s&root", fname2.Data()), kTabSaveAsRoot); 311 311 savemenu2->Associate(this); 312 312 … … 440 440 441 441 // Add MARS version 442 TGLabel *l = new TGLabel(f, MString::Form ("Official Release: V%s", MARSVER));442 TGLabel *l = new TGLabel(f, MString::Format("Official Release: V%s", MARSVER)); 443 443 fList->Add(l); 444 444 … … 451 451 452 452 // Add root version 453 l = new TGLabel(f, MString::Form ("Using ROOT v%s", ROOTVER));453 l = new TGLabel(f, MString::Format("Using ROOT v%s", ROOTVER)); 454 454 fList->Add(l); 455 455 … … 660 660 void MStatusDisplay::SetStatusLine2(const MParContainer &cont) 661 661 { 662 SetStatusLine2(MString::Form ("%s: %s", cont.GetDescriptor().Data(), cont.GetTitle()));662 SetStatusLine2(MString::Format("%s: %s", cont.GetDescriptor().Data(), cont.GetTitle())); 663 663 } 664 664 … … 1097 1097 { 1098 1098 // Tell the X-Requester how to call this method 1099 TString str = MString::Form ("%d", (ULong_t)f);1099 TString str = MString::Format("%d", (ULong_t)f); 1100 1100 1101 1101 TMethodCall call(IsA(), "UpdateTab", "NULL"); … … 1272 1272 gSystem->Unlink(tmp); 1273 1273 1274 SetStatusLine2(MString::Form ("Done (%dpage(s))", pages));1274 SetStatusLine2(MString::Format("Done (%dpage(s))", pages)); 1275 1275 1276 1276 return pages; … … 1380 1380 1381 1381 // Code taken from TGTextEdit::Print 1382 const TString pipe = MString::Form ("a2ps -o%s", name.Data());1382 const TString pipe = MString::Format("a2ps -o%s", name.Data()); 1383 1383 FILE *p = gSystem->OpenPipe(pipe, "w"); 1384 1384 if (!p) … … 1493 1493 1494 1494 case kFileTab: 1495 AddTab(MString::Form ("%d", fTab->GetNumberOfTabs()));1495 AddTab(MString::Format("%d", fTab->GetNumberOfTabs())); 1496 1496 return kTRUE; 1497 1497 … … 1683 1683 SetStatusLine2(""); 1684 1684 *fLog << inf << "Saving log... " << flush; 1685 if (fLogBox->GetText()->Save(MString::Form ("%s.log", gROOT->GetName())))1685 if (fLogBox->GetText()->Save(MString::Format("%s.log", gROOT->GetName()))) 1686 1686 { 1687 1687 *fLog << "done." << endl; … … 1699 1699 SetStatusLine2(""); 1700 1700 *fLog << inf << "Appending log... " << flush; 1701 if (fLogBox->GetText()->Append(MString::Form ("%s.log", gROOT->GetName())))1701 if (fLogBox->GetText()->Append(MString::Format("%s.log", gROOT->GetName()))) 1702 1702 { 1703 1703 *fLog << "done." << endl; … … 1948 1948 void MStatusDisplay::UpdateMemory() const 1949 1949 { 1950 const TString path = MString::Form ("/proc/%d/status", gSystem->GetPid());1950 const TString path = MString::Format("/proc/%d/status", gSystem->GetPid()); 1951 1951 if (gSystem->AccessPathName(path, kFileExists)) 1952 1952 return; … … 1970 1970 val /= 1000; 1971 1971 } 1972 const TString txt = MString::Form ("%.1f%c", val, type);1972 const TString txt = MString::Format("%.1f%c", val, type); 1973 1973 fStatusBar->SetText(txt, 2); 1974 1974 } … … 2464 2464 } 2465 2465 2466 SetStatusLine2(MString::Form ("Tab #%d", i));2466 SetStatusLine2(MString::Format("Tab #%d", i)); 2467 2467 2468 2468 // … … 2526 2526 PSToolsTextNDC(*ps, 0.5, 1.015, TString("MARS - Magic Analysis and Reconstruction Software - ")+d.AsString()); 2527 2527 ps->SetTextAlign(31); // right top 2528 PSToolsTextNDC(*ps, 1, 1.015, MString::Form ("Page No.%i (%i) ", page++, i));2528 PSToolsTextNDC(*ps, 1, 1.015, MString::Format("Page No.%i (%i) ", page++, i)); 2529 2529 line.PaintLineNDC(0, 1.01, 1, 1.01); 2530 2530 … … 2570 2570 *fLog << inf << "done." << endl; 2571 2571 2572 SetStatusLine2(MString::Form ("Done (%dpages)", page-1));2572 SetStatusLine2(MString::Format("Done (%dpages)", page-1)); 2573 2573 2574 2574 return page-1; … … 2675 2675 } 2676 2676 2677 SetStatusLine2(MString::Form ("Tab #%d", i));2677 SetStatusLine2(MString::Format("Tab #%d", i)); 2678 2678 2679 2679 // … … 2771 2771 } 2772 2772 2773 SetStatusLine2(MString::Form ("Tab #%d", i));2773 SetStatusLine2(MString::Format("Tab #%d", i)); 2774 2774 2775 2775 // -
trunk/MagicSoft/Mars/mbase/MString.cc
r5713 r7887 120 120 // M/TString. 121 121 // 122 MString MString::Form (const char *fmt, ...)122 MString MString::Format(const char *fmt, ...) 123 123 { 124 124 va_list ap; … … 129 129 return ret; 130 130 } 131 132 // -------------------------------------------------------------------------- 133 // 134 // This is my implementation for root versions prior to 5.12/00 where 135 // TString::Form didn't exist. 136 // 137 void MString::Form(const char *fmt, ...) 138 { 139 va_list ap; 140 va_start(ap, fmt); 141 142 Print(fmt, ap); 143 } -
trunk/MagicSoft/Mars/mbase/MString.h
r7804 r7887 18 18 MString &Print(const char *fmt, ...); 19 19 20 #ifndef __CINT__ 21 static MString Form(const char *fmt, ...); 22 #endif 20 static MString Format(const char *fmt, ...); 21 22 void Form(const char *fmt, ...); 23 23 24 24 ClassDef(MString, 1) // Tool to make Form() thread safe against other TStrings -
trunk/MagicSoft/Mars/mbase/MTask.cc
r7838 r7887 361 361 // 362 362 if (fName==ClassName()) 363 return fSerialNumber==0 ? (TString)ClassName() : MString::Form ("%s;%d", ClassName(), fSerialNumber);363 return fSerialNumber==0 ? (TString)ClassName() : MString::Format("%s;%d", ClassName(), fSerialNumber); 364 364 365 365 return fSerialNumber>0 ? 366 MString::Form ("%s;%d [%s]", fName.Data(), fSerialNumber, ClassName()) :367 MString::Form ("%s [%s]", fName.Data(), ClassName());366 MString::Format("%s;%d [%s]", fName.Data(), fSerialNumber, ClassName()) : 367 MString::Format("%s [%s]", fName.Data(), ClassName()); 368 368 } 369 369 -
trunk/MagicSoft/Mars/mpointing/MHSrcPosCam.cc
r7566 r7887 113 113 114 114 const TString src = pos->GetString("radec"); 115 fHist.SetTitle(MString::Form ("SrcPos distribution in camera: %s", src.Data()));115 fHist.SetTitle(MString::Format("SrcPos distribution in camera: %s", src.Data())); 116 116 117 117 fHist.Reset(); -
trunk/MagicSoft/Mars/mpointing/MPointingPos.cc
r7726 r7887 100 100 101 101 if (opt.Contains("ra", TString::kIgnoreCase)) 102 rc += MString::Form (" Ra=%s", MAstro::GetStringHor(fRa).Data());102 rc += MString::Format(" Ra=%s", MAstro::GetStringHor(fRa).Data()); 103 103 104 104 if (opt.Contains("ha", TString::kIgnoreCase)) 105 rc += MString::Form (" Ha=%s", MAstro::GetStringHor(fHa).Data());105 rc += MString::Format(" Ha=%s", MAstro::GetStringHor(fHa).Data()); 106 106 107 107 if (opt.Contains("dec", TString::kIgnoreCase)) 108 rc += MString::Form (" Dec=%s", MAstro::GetStringDeg(fDec).Data());108 rc += MString::Format(" Dec=%s", MAstro::GetStringDeg(fDec).Data()); 109 109 110 110 if (opt.Contains("zd", TString::kIgnoreCase)) 111 rc += MString::Form (" Zd=%s", MAstro::GetStringDeg(fZd).Data());111 rc += MString::Format(" Zd=%s", MAstro::GetStringDeg(fZd).Data()); 112 112 113 113 if (opt.Contains("az", TString::kIgnoreCase)) 114 rc += MString::Form (" Az=%s", MAstro::GetStringDeg(fAz).Data());114 rc += MString::Format(" Az=%s", MAstro::GetStringDeg(fAz).Data()); 115 115 116 116 if (fTitle!=gsDefTitle) 117 rc += MString::Form (" <%s>", fTitle.Data());117 rc += MString::Format(" <%s>", fTitle.Data()); 118 118 119 119 return rc.Strip(TString::kBoth);
Note:
See TracChangeset
for help on using the changeset viewer.