Changeset 8862 for trunk/MagicSoft/Cosy/main
- Timestamp:
- 02/13/08 19:44:39 (17 years ago)
- Location:
- trunk/MagicSoft/Cosy/main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/main/MCosy.cc
r8856 r8862 16 16 #include "MLogManip.h" 17 17 18 #include "MEnv.h" 18 19 #include "MTime.h" 19 20 #include "MPointing.h" … … 140 141 141 142 // 142 // Get the values 143 // 144 int p1 = (fZd1->GetPos() +8192)%16384;145 int p2 = -(fZd2->GetPos() +8192)%16384;143 // Get the values (FIXME!) 144 // 145 int p1 = (fZd1->GetPos()/*+8192*/)%fZd1->GetPhysRes(); 146 int p2 = -(fZd2->GetPos()/*+8192*/)%fZd2->GetPhysRes(); 146 147 147 148 if (fZd1->IsZombieNode()) … … 930 931 } 931 932 932 void MCosy::ReadConfig() 933 { 934 gLog << inf2 << "Reading configuration file..." << flush; 935 TEnv env(".cosyrc"); 936 gLog << "done." << endl; 937 933 void MCosy::ReadConfig(MEnv &env) 934 { 938 935 gLog << inf2 << "Reading telescope range..." << flush; 939 936 const Double_t amin = env.GetValue("Az_Min[deg]", -95.0); … … 946 943 gLog << "done." << endl; 947 944 948 gLog << all << " * Min: " << zmin << "deg " << amin << "deg" << endl; 949 gLog << all << " * Max: " << zmax << "deg " << amax << "deg" << endl; 945 gLog << all << flush; 946 947 gLog << " * Min: " << zmin << "deg " << amin << "deg" << endl; 948 gLog << " * Max: " << zmax << "deg " << amax << "deg" << endl; 950 949 951 950 fMin = fBending.AddOffsets(fMin/TMath::RadToDeg()); 952 951 fMax = fBending.AddOffsets(fMax/TMath::RadToDeg()); 953 952 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 // kGear.X(env.GetValue("Zd_GearRatio[U_mot/U_tel]", 1000.0)); 959 // kGear.Y(env.GetValue("Az_GearRatio[U_mot/U_tel]", 1000.0)); 953 gLog << " * Min': " << fMin.Zd()*TMath::RadToDeg() << "deg " << fMin.Az()*TMath::RadToDeg() << "deg" << endl; 954 gLog << " * Max': " << fMax.Zd()*TMath::RadToDeg() << "deg " << fMax.Az()*TMath::RadToDeg() << "deg" << endl; 955 960 956 kGear.Set(env.GetValue("Zd_GearRatio[U_mot/U_tel]", 1000.0), 961 957 env.GetValue("Az_GearRatio[U_mot/U_tel]", 1000.0)); … … 975 971 kResRE.Set(x,y); 976 972 977 x = zd1 ? fZd1->GetPhysRes() : (zd2 ? fZd2->GetPhysRes() : env.GetValue("Zd_ResSE[se/U_mot]", 16384)); 978 y = az ? fAz->GetPhysRes() : env.GetValue("Az_ResSE[se/U_mot]", 16384); 973 gLog << " * Az RE resolution: " << x << " re/U_mot" << endl; 974 gLog << " * Zd RE resolution: " << y << " re/U_mot" << endl; 975 976 x = zd1 ? fZd1->GetPhysRes() : (zd2 ? fZd2->GetPhysRes() : env.GetValue("Zd_ResSE[se/U_tel]", 16384)); 977 y = az ? fAz->GetPhysRes() : env.GetValue("Az_ResSE[se/U_tel]", 16384); 979 978 kResSE.Set(x,y); 979 980 gLog << " * Az SE resolution: " << x << " se/U_tel" << endl; 981 gLog << " * Zd SE resolution: " << y << " se/U_tel" << endl; 980 982 981 983 /* … … 1019 1021 // kGearTot = kResRE*kGear; 1020 1022 1021 gLog << "done." << endl; 1022 1023 gLog << all; 1024 gLog << " * Setting Gear Ratios:" << endl; 1025 gLog << " --------------------" << endl; 1023 // gLog << all; 1024 // gLog << " * Setting Gear Ratios:" << endl; 1025 // gLog << " --------------------" << endl; 1026 1026 gLog << " * X: " << kGear.X() << "*" << kResRE.X()/4 << "/" << kResSE.X() << "=4*" << kGearTot.X() << "/" << kResSE.X() << endl; 1027 1027 gLog << " * Y: " << kGear.Y() << "*" << kResRE.Y()/4 << "/" << kResSE.Y() << "=4*" << kGearTot.Y() << "/" << kResSE.Y() << endl; … … 1065 1065 1066 1066 gLog << inf2 << "Starting Shaftencoder Test..." << endl; 1067 1068 gLog << err << "Build in values!!!" << endl; 1067 1069 1068 1070 while (fBackground==kBgdSeTest) … … 1434 1436 // turn on the gui update 1435 1437 // 1436 void MCosy::Start( )1438 void MCosy::Start(MEnv &env) 1437 1439 { 1438 1440 // Don't call this function twice! … … 1441 1443 CheckForError(); 1442 1444 1443 ReadConfig( );1445 ReadConfig(env); 1444 1446 1445 1447 gLog << inf << "- Starting TX Thread." << endl; … … 1610 1612 } 1611 1613 1612 MCosy::MCosy( )1614 MCosy::MCosy(MEnv &env, const char *addr, const char *pointing) 1613 1615 : Network(), fObservatory(MObservatory::kMagic1), fStarguider(NULL), 1614 1616 fZd1(0), fZd2(0), fAz(0), fMac1(0), fMac2(0), fMac3(0), … … 1616 1618 fOutTp(0), fOutRep(0) 1617 1619 { 1618 TEnv env(".cosyrc");1619 1620 const Int_t id1 = env.GetValue("Az_Id-MAC1", 1); //1 1620 1621 const Int_t id2 = env.GetValue("Az_Id-MAC2", 2); //2 … … 1637 1638 { 1638 1639 case 0: 1639 gLog << "<<Standard mode>>" << endl;*/ 1640 fBending.Load("bending.txt"); 1640 gLog << "<<Standard mode>>" << endl;*/ 1641 gLog << all << "Reading pointing model from " << pointing << "..." << endl; 1642 if (fBending.Load(pointing)) 1643 gLog << all << "Reading pointing model from " << pointing << " successfull." << endl; 1644 else 1645 gLog << err << "ERROR - Reading pointing model from " << pointing << endl; 1641 1646 Constructor(id1, id2, id3, id4, id5, id6);/* 1642 1647 break; … … 1651 1656 } 1652 1657 */ 1658 1653 1659 gLog.SetOutputGui(fWin->GetLog(), kTRUE); 1654 1660 … … 1657 1663 fAz->SetDisplay(fWin->GetLabel1()); 1658 1664 1659 fCom = new MDriveCom(this, fOutRep);1665 fCom = new MDriveCom(this, addr, fOutRep); 1660 1666 // fCom->Start(); 1661 1667 } -
trunk/MagicSoft/Cosy/main/MCosy.h
r8859 r8862 52 52 class MStarguider; 53 53 class MDriveCom; 54 class MEnv; 54 55 55 56 class MTTalk : public MThread … … 173 174 //void ConstructorDemo(); 174 175 175 void ReadConfig( );176 void ReadConfig(MEnv &env); 176 177 177 178 bool CheckNetwork(); 178 179 180 void Start() { } 181 179 182 public: 180 MCosy( );183 MCosy(MEnv &env, const char *addr, const char *pointing); 181 184 ~MCosy(); 182 185 183 void Start( );186 void Start(MEnv &env); 184 187 void Stop(); 185 188
Note:
See TracChangeset
for help on using the changeset viewer.