Changeset 8852 for trunk/MagicSoft/Cosy/main
- Timestamp:
- 02/02/08 13:06:37 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.