- Timestamp:
- 02/02/08 13:06:37 (17 years ago)
- Location:
- trunk/MagicSoft/Cosy
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/Changelog
r8848 r8852 1 1 -*-*- END -*-*- 2 3 2008/02/02 Thomas Bretz 4 5 * main/MCosy.cc, candrv/vmodican.cc, gui/MGCoordinates.cc, 6 gui/MGSkyPosition.cc: 7 - added stream modifiers 8 9 2 10 3 11 2008/01/31 Thomas Bretz -
trunk/MagicSoft/Cosy/candrv/vmodican.cc
r8831 r8852 41 41 42 42 #include "MLog.h" 43 #include "MLogManip.h" 43 44 44 45 ClassImp(VmodIcan); … … 81 82 while (!Send(&msg)); 82 83 83 gLog << "- CAN Bus Termination set to " << (state?"on":"off") << endl;84 gLog << inf2 << "- CAN Bus Termination set to " << (state?"on":"off") << endl; 84 85 } 85 86 … … 95 96 return 0; 96 97 97 gLog << "- Starting Receiver Loop." << endl;98 gLog << inf2 << "- Starting Receiver Loop." << endl; 98 99 99 100 while (1) … … 313 314 while (!Send(&msg)); /* transmitt to module */ 314 315 315 gLog << "- Baudrate set to " << rate << "kbps" << endl;316 gLog << inf2 << "- Baudrate set to " << rate << "kbps" << endl; 316 317 } 317 318 … … 342 343 while (!Send(&msg)); 343 344 344 gLog << "- Controller connected to bus" << endl;345 gLog << inf2 << "- Controller connected to bus" << endl; 345 346 } 346 347 … … 387 388 return -1; 388 389 389 gLog << "- Fast Host Interface Enabled" << endl;390 gLog << inf2 << "- Fast Host Interface Enabled" << endl; 390 391 391 392 return 0; … … 415 416 void VmodIcan::DisableCanBusConnection() 416 417 { 417 gLog << "- Disconnect VmodIcan module from Bus!" << endl;418 gLog << inf2 << "- Disconnect VmodIcan module from Bus!" << endl; 418 419 419 420 Message msg; /* buffer for module messages */ … … 424 425 while (!Send(&msg)); 425 426 426 gLog << "- VmodIcan disconnected." << endl;427 gLog << inf2 << "- VmodIcan disconnected." << endl; 427 428 } 428 429 … … 451 452 void VmodIcan::Close() 452 453 { 453 gLog << "- Closing device VmodIcan #" << (int)fd << endl;454 gLog << inf2 << "- Closing device VmodIcan #" << (int)fd << endl; 454 455 455 456 Message msg; /* disconnect message */ … … 462 463 close(fd); 463 464 464 gLog << "- Device closed." << endl;465 gLog << inf2 << "- Device closed." << endl; 465 466 } 466 467 … … 479 480 while (!Send(&msg)); 480 481 481 gLog << "- Fifo enabled" << endl;482 gLog << inf2 << "- Fifo enabled" << endl; 482 483 483 484 return TRUE; … … 492 493 const int rc = Ioctl(DPM_RESET, 0); 493 494 494 gLog << "- Reset done." << endl;495 gLog << inf2 << "- Reset done." << endl; 495 496 496 497 return rc; … … 516 517 if (fd < 0) 517 518 { 518 gLog << "Error: Opening device '" << devname << "' (rc=" << fd << ")" << endl;519 gLog << err << "Error: Opening device '" << devname << "' (rc=" << fd << ")" << endl; 519 520 gLog << strerror(errno) << endl; 520 521 return FALSE; 521 522 } 522 523 523 gLog << "- Device " << devname << " #" << fd << " open." << endl;524 gLog << inf << "- Device " << devname << " #" << fd << " open." << endl; 524 525 525 526 return TRUE; … … 582 583 Ioctl(DPM_INIT_NEW_HOSTIF_PRIO, &hdp); 583 584 584 gLog << "- New style host interface enabled" << endl;585 gLog << inf2 << "- New style host interface enabled" << endl; 585 586 586 587 return 0; … … 757 758 while (!Send(&msg)); 758 759 759 gLog << "- All CobIds disabled." << endl;760 gLog << inf2 << "- All CobIds disabled." << endl; 760 761 } 761 762 … … 868 869 */ 869 870 870 gLog << "- VmodIcan initialized." << endl;871 gLog << inf << "- VmodIcan initialized." << endl; 871 872 872 873 } … … 879 880 VmodIcan::~VmodIcan() 880 881 { 881 gLog << "- Stopping VmodIcan module." << endl;882 gLog << inf2 << "- Stopping VmodIcan module." << endl; 882 883 CancelThread(); 883 884 DisableCanBusConnection(); 884 885 Close(); 885 gLog << "- VmodIcan stopped." << endl;886 } 886 gLog << inf << "- VmodIcan stopped." << endl; 887 } -
trunk/MagicSoft/Cosy/gui/MGCoordinates.cc
r8847 r8852 7 7 #include "MGCoordinates.h" 8 8 9 #include <iostream> // cout9 #include "MGCoordinate.h" 10 10 11 #include "MGCoordinate.h" 11 #include "MLog.h" 12 #include "MLogManip.h" 12 13 13 14 ClassImp(MGCoordinates); … … 41 42 delete fX; 42 43 43 cout<< "MGCoordinates destroyed." << endl;44 gLog << inf2 << "MGCoordinates destroyed." << endl; 44 45 } 45 46 -
trunk/MagicSoft/Cosy/gui/MGImage.cc
r7787 r8852 20 20 #include "MGImage.h" 21 21 22 #include <iostream>23 24 22 #include <TGX11.h> 25 23 #include <TMutex.h> 24 25 #include "MLog.h" 26 #include "MLogManip.h" 26 27 27 28 ClassImp(MGImage); … … 49 50 fImage = (XImage*)gVirtualX->CreateImage(fWidth, fHeight); 50 51 51 cout<< "Detected Color Depth: " << gVirtualX->GetDepth() << endl;52 gLog << all << "Detected Color Depth: " << gVirtualX->GetDepth() << endl; 52 53 } 53 54 … … 57 58 cout << "MGImage::~MGImage - mutex is already locked by this thread" << endl; 58 59 59 cout<< "Deleting MGImage..." << endl;60 gLog << inf2 << "Deleting MGImage..." << endl; 60 61 61 62 gVirtualX->DeleteGC(fDefGC); 62 63 gVirtualX->DeleteImage((Drawable_t)fImage); 63 64 65 //cout << fMuxPixmap->UnLock() << endl; 66 64 67 delete fMuxPixmap; 65 68 66 cout<< "MGImage destroyed." << endl;69 gLog << inf2 << "MGImage destroyed." << endl; 67 70 } 68 71 … … 87 90 if (TestBit(kSyncMode)) 88 91 if (fMuxPixmap->UnLock()==13) 89 cout<< "MGImage::DoRedraw - tried to unlock mutex locked by other thread." << endl;92 gLog << warn << "MGImage::DoRedraw - tried to unlock mutex locked by other thread." << endl; 90 93 } 91 94 -
trunk/MagicSoft/Cosy/gui/MGSkyPosition.cc
r8847 r8852 7 7 #include "MGSkyPosition.h" 8 8 9 #include <iostream> // cout10 11 9 #include <TArc.h> 12 10 #include <TLine.h> … … 14 12 #include <TList.h> 15 13 #include <TCanvas.h> 14 15 #include "MLog.h" 16 #include "MLogManip.h" 16 17 17 18 #include "MAstro.h" … … 249 250 delete fSlaStar; 250 251 251 cout<< "MGSkyPosition destroyed." << endl;252 gLog << inf2 << "MGSkyPosition destroyed." << endl; 252 253 } 253 254 -
trunk/MagicSoft/Cosy/main/MCosy.cc
r8839 r8852 214 214 215 215 MTime t(-1); 216 gLog << t << " - MCosy::WaitForEndMovement aborted...";216 gLog << inf << t << " - MCosy::WaitForEndMovement aborted..."; 217 217 if (Break()) 218 218 gLog << " Break signal..."; … … 279 279 if (d.Zd()<fMin.Zd()) 280 280 { 281 gLog << "ERROR: Requested Zenith Angle below negative endswitch." << endl;281 gLog << err << "ERROR: Requested Zenith Angle below negative endswitch." << endl; 282 282 return kFALSE; 283 283 } … … 285 285 if (d.Zd()>fMax.Zd()) 286 286 { 287 gLog << "ERROR: Requested Zenith Angle behind positive endswitch." << endl;287 gLog << err << "ERROR: Requested Zenith Angle behind positive endswitch." << endl; 288 288 return kFALSE; 289 289 } … … 291 291 if (d.Az()<fMin.Az()) 292 292 { 293 gLog << "ERROR: Requested Azimuth Angle below negative endswitch." << endl;293 gLog << err << "ERROR: Requested Azimuth Angle below negative endswitch." << endl; 294 294 return kFALSE; 295 295 } … … 297 297 if (d.Az()>fMax.Az()) 298 298 { 299 gLog << "ERROR: Requested Azimuth Angle behind positive endswitch." << endl;299 gLog << err << "ERROR: Requested Azimuth Angle behind positive endswitch." << endl; 300 300 return kFALSE; 301 301 } … … 497 497 // set deceleration to 50% 498 498 // 499 cout<< "Stopping movement (dec=30%)..." << endl;499 gLog << inf2 << "Stopping movement (dec=30%)..." << endl; 500 500 if (fMac1 && fMac2) 501 501 { … … 575 575 { 576 576 case WM_WAIT: 577 cout<< "Wait for execution of Proc(WM_*, ): done." << endl;577 gLog << inf2 << "Wait for execution of Proc(WM_*, ): done." << endl; 578 578 return 0; 579 579 … … 913 913 if (!CheckNetwork()) 914 914 { 915 gLog << "ERROR: Cannot shutdown CANbus network." << endl;915 gLog << err << "ERROR: Cannot shutdown CANbus network." << endl; 916 916 return 0xebb0; 917 917 } … … 932 932 void MCosy::ReadConfig() 933 933 { 934 cout<< "Reading configuration file..." << flush;934 gLog << inf2 << "Reading configuration file..." << flush; 935 935 TEnv env(".cosyrc"); 936 cout<< "done." << endl;937 938 cout<< "Reading telescope range..." << flush;936 gLog << "done." << endl; 937 938 gLog << inf2 << "Reading telescope range..." << flush; 939 939 const Double_t amin = env.GetValue("Az_Min[deg]", -95.0); 940 940 const Double_t zmin = env.GetValue("Zd_Min[deg]", -75.0); … … 944 944 const Double_t zmax = env.GetValue("Zd_Max[deg]", 98.25); 945 945 fMax.Set(zmax, amax); 946 cout<< "done." << endl;947 948 cout<< " * Min: " << zmin << "deg " << amin << "deg" << endl;949 cout<< " * Max: " << zmax << "deg " << amax << "deg" << endl;946 gLog << "done." << endl; 947 948 gLog << all << " * Min: " << zmin << "deg " << amin << "deg" << endl; 949 gLog << all << " * Max: " << zmax << "deg " << amax << "deg" << endl; 950 950 951 951 fMin = fBending.AddOffsets(fMin/TMath::RadToDeg()); 952 952 fMax = fBending.AddOffsets(fMax/TMath::RadToDeg()); 953 953 954 cout<< " * Min': " << fMin.Zd()*TMath::RadToDeg() << "deg " << fMin.Az()*TMath::RadToDeg() << "deg" << endl;955 cout<< " * Max': " << fMax.Zd()*TMath::RadToDeg() << "deg " << fMax.Az()*TMath::RadToDeg() << "deg" << endl;956 957 cout<< "Reading gear ratios..." << flush;954 gLog << all << " * Min': " << fMin.Zd()*TMath::RadToDeg() << "deg " << fMin.Az()*TMath::RadToDeg() << "deg" << endl; 955 gLog << all << " * Max': " << fMax.Zd()*TMath::RadToDeg() << "deg " << fMax.Az()*TMath::RadToDeg() << "deg" << endl; 956 957 gLog << inf2 << "Reading gear ratios..." << flush; 958 958 // kGear.X(env.GetValue("Zd_GearRatio[U_mot/U_tel]", 1000.0)); 959 959 // kGear.Y(env.GetValue("Az_GearRatio[U_mot/U_tel]", 1000.0)); … … 1019 1019 // kGearTot = kResRE*kGear; 1020 1020 1021 cout << "done." << endl; 1022 1023 cout << " * Setting Gear Ratios:" << endl; 1024 cout << " --------------------" << endl; 1025 cout << " * X: " << kGear.X() << "*" << kResRE.X()/4 << "/" << kResSE.X() << "=4*" << kGearTot.X() << "/" << kResSE.X() << endl; 1026 cout << " * Y: " << kGear.Y() << "*" << kResRE.Y()/4 << "/" << kResSE.Y() << "=4*" << kGearTot.Y() << "/" << kResSE.Y() << endl; 1021 gLog << "done." << endl; 1022 1023 gLog << all; 1024 gLog << " * Setting Gear Ratios:" << endl; 1025 gLog << " --------------------" << endl; 1026 gLog << " * X: " << kGear.X() << "*" << kResRE.X()/4 << "/" << kResSE.X() << "=4*" << kGearTot.X() << "/" << kResSE.X() << endl; 1027 gLog << " * Y: " << kGear.Y() << "*" << kResRE.Y()/4 << "/" << kResSE.Y() << "=4*" << kGearTot.Y() << "/" << kResSE.Y() << endl; 1027 1028 } 1028 1029 /* … … 1050 1051 if (fHist) 1051 1052 { 1052 gLog << "You are much too fast... try again." << endl;1053 gLog << err << "You are much too fast... try again." << endl; 1053 1054 return; 1054 1055 } … … 1063 1064 int cnt = 0; 1064 1065 1065 gLog << "Starting Shaftencoder Test..." << endl;1066 gLog << inf2 << "Starting Shaftencoder Test..." << endl; 1066 1067 1067 1068 while (fBackground==kBgdSeTest) … … 1102 1103 } 1103 1104 1104 gLog << "Shaftencoder Test Stopped... displaying Histogram." << endl;1105 gLog << inf2 << "Shaftencoder Test Stopped... displaying Histogram." << endl; 1105 1106 1106 1107 fBackground=kBgdSeTestDispl; … … 1114 1115 if (fHist) 1115 1116 { 1116 gLog << "You are much too fast... try again." << endl;1117 gLog << err << "You are much too fast... try again." << endl; 1117 1118 return; 1118 1119 } … … 1127 1128 fHist->SetZTitle("Re/Se"); 1128 1129 1129 gLog << "Starting Gear determination..." << endl;1130 gLog << inf2 << "Starting Gear determination..." << endl; 1130 1131 1131 1132 ZdAz se0 = GetSePos(); … … 1173 1174 } 1174 1175 } 1175 gLog << "Gear Test Stopped... displaying Histogram." << endl;1176 gLog << inf2 << "Gear Test Stopped... displaying Histogram." << endl; 1176 1177 1177 1178 fBackground=kBgdGearDispl; … … 1249 1250 const Int_t rc = fMutexGui.TryLock(); 1250 1251 if (rc==13) 1251 cout<< "MCosy::HandleTimer - mutex is already locked by this thread" << endl;1252 gLog << warn << "MCosy::HandleTimer - mutex is already locked by this thread" << endl; 1252 1253 1253 1254 if (rc) 1254 1255 { 1255 gLog << "* GUI update skipped due to locked mutex." << endl;1256 gLog << warn << "* GUI update skipped due to locked mutex." << endl; 1256 1257 return kTRUE; 1257 1258 } … … 1303 1304 1304 1305 if (fMutexGui.UnLock()==13) 1305 cout<< "MCosy::HandleTimer - tried to unlock mutex locked by other thread." << endl;1306 gLog << warn << "MCosy::HandleTimer - tried to unlock mutex locked by other thread." << endl; 1306 1307 1307 1308 return kTRUE; … … 1310 1311 void MCosy::DisplayHistTestSe(Bool_t del) 1311 1312 { 1312 gLog << "Displaying histogram..." << endl;1313 gLog << inf2 << "Displaying histogram..." << endl; 1313 1314 1314 1315 TH2F &hist = *(TH2F*)fHist; … … 1348 1349 void MCosy::DisplayHistGear(Bool_t del) 1349 1350 { 1350 gLog << "Displaying histogram..." << endl;1351 gLog << inf2 << "Displaying histogram..." << endl; 1351 1352 1352 1353 TH3F &hist = *(TH3F*)fHist; … … 1442 1443 ReadConfig(); 1443 1444 1444 gLog << "- Starting TX Thread." << endl;1445 gLog << inf << "- Starting TX Thread." << endl; 1445 1446 fTTalk = new MTTalk(this); 1446 1447 1447 gLog << "- Starting GUI update." << endl;1448 gLog << inf << "- Starting GUI update." << endl; 1448 1449 fUpdateGui->TurnOn(); 1449 1450 } … … 1486 1487 // Create Nodes 1487 1488 // 1488 gLog << "- Setting up network." << endl;1489 gLog << inf << "- Setting up network." << endl; 1489 1490 1490 1491 fMac1=new Macs(id1, "Mac/Az"); … … 1505 1506 fZd2->SetMotor(fMac2); 1506 1507 1507 gLog << "- Connecting devices to network." << endl;1508 gLog << inf << "- Connecting devices to network." << endl; 1508 1509 1509 1510 // … … 1521 1522 // Create Gui Event timer and Gui 1522 1523 // 1523 gLog << "- Initializing GUI Timer." << endl;1524 gLog << inf << "- Initializing GUI Timer." << endl; 1524 1525 fUpdateGui = new TTimer(this, 100); // 100ms 1525 1526 1526 gLog << "- Starting GUI." << endl;1527 gLog << all << "- Starting GUI." << endl; 1527 1528 fWin=new MGCosy(fObservatory, this, gClient->GetRoot(), 1, 1); 1528 1529 } … … 1624 1625 1625 1626 TString name = GetFileName("rep", "cosy", "rep"); 1626 cout<< "Open Repfile: " << name << endl;1627 gLog << inf << "Open Repfile: " << name << endl; 1627 1628 fOutRep = new MLog(name, kTRUE); 1628 1629 *fOutRep << "[Drive Report File]" << endl; … … 1662 1663 void MCosy::TerminateApp() 1663 1664 { 1664 cout<< "MCosy::TerminateApp()" << endl;1665 gLog << inf2 << "MCosy::TerminateApp()" << endl; 1665 1666 /* 1666 1667 Int_t rc; … … 1682 1683 MCosy::~MCosy() 1683 1684 { 1684 cout<< "Deleting GUI timer." << endl;1685 gLog << inf2 << "Deleting GUI timer." << endl; 1685 1686 // FIXME: Wait until last Update was finished!!! 1686 1687 delete fUpdateGui; … … 1689 1690 1690 1691 // Now the files can safely be closed 1691 cout<< "Closing output files." << endl;1692 gLog << inf2 << "Closing output files." << endl; 1692 1693 if (fOutTp) 1693 1694 { … … 1697 1698 delete fOutRep; 1698 1699 1699 cout<< "Deleting CC communication." << endl;1700 gLog << inf2 << "Deleting CC communication." << endl; 1700 1701 delete fCom; 1701 1702 1702 cout<< "Deleting Nodes." << endl;1703 gLog << inf2 << "Deleting Nodes." << endl; 1703 1704 fZd1->SetReport(0); 1704 1705 fZd2->SetReport(0); … … 1713 1714 delete fMac3; 1714 1715 1715 cout<< "Deleting MGCosy." << endl;1716 gLog << inf2 << "Deleting MGCosy." << endl; 1716 1717 1717 1718 gLog.DisableOutputDevice(MLog::eGui); … … 1719 1720 delete fWin; 1720 1721 1721 cout<< "MGCosy destructed." << endl;1722 } 1722 gLog << inf2 << "MGCosy destructed." << endl; 1723 }
Note:
See TracChangeset
for help on using the changeset viewer.