Changeset 1701 for trunk/MagicSoft/Cosy/main/MCosy.cc
- Timestamp:
- 01/10/03 15:38:47 (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/main/MCosy.cc
r1699 r1701 395 395 // const ZdAz dest = CorrectTarget(src, dst); 396 396 // 397 const ZdAz bend= fBending(dst);398 const ZdAz dest = bend*16384/2/TMath::Pi();397 fZdAzSoll = fBending(dst); 398 const ZdAz dest = fZdAzSoll*16384/2/TMath::Pi(); 399 399 400 400 lout << "Positioning to Target..." << endl; 401 401 cout << "Source Zd: " << src.Zd() << "se Az:" << src.Az() << "se" << endl; 402 402 cout << "Destination Zd: " << Rad2SE(dst.Zd()) << "se Az:" << Rad2SE(dst.Az()) << "se" << endl; 403 cout << "Bend'd Dest Zd: " << Rad2SE( bend.Zd()) << "se Az:" << Rad2SE(bend.Az()) << "se" << endl;403 cout << "Bend'd Dest Zd: " << Rad2SE(fZdAzSoll.Zd()) << "se Az:" << Rad2SE(fZdAzSoll.Az()) << "se" << endl; 404 404 cout << "Shortest Dest Zd: " << dest.Zd() << "se Az:" << dest.Az() << "se" << endl; 405 405 … … 674 674 { 675 675 // 676 // The loop should not be executed faster than the ramp of677 // a change in the velocity can be followed.678 // (This is important on fast machines >500MHz)679 //680 //usleep(100000000);681 682 //683 676 // Request Target position for this moment 684 677 // … … 759 752 // update time 760 753 // 754 // 755 // The loop should not be executed faster than the ramp of 756 // a change in the velocity can be followed. 757 // (This is important on fast machines >500MHz) 758 // 761 759 usleep(50000); // 0.05s 762 760 } … … 779 777 return; 780 778 // 781 // Set status to stopped779 // Set status to Stopping 782 780 // 783 781 SetStatus(MCosy::kStopping); … … 812 810 void *MCosy::Proc(int msg, void *mp) 813 811 { 814 cout << "MCosy::Proc: 0x" << msg << endl;815 812 switch (msg) 816 813 { … … 820 817 821 818 case WM_STOP: 819 cout << "MCosy::Proc: Stop." << endl; 822 820 StopMovement(); 823 821 return NULL; … … 923 921 cout << "WM_ResetBending: done. (return 0xbe0e)" << endl; 924 922 return (void*)0xbe0e; 923 924 case WM_HOME: 925 cout << "WM_Home: START" << endl; 926 if (fMac1 && fMac2) 927 { 928 cout << "Going Home..." << endl; 929 fMac1->SetHome(250000, 100); 930 fMac2->SetHome(250000, 100); 931 932 fAz->SetPreset(); 933 fZd1->SetPreset(); 934 fZd2->SetPreset(); 935 936 fMac1->ReqPos(); 937 fMac2->ReqPos(); 938 } 939 cout << "WM_Home: done. (return 0x403e)" << endl; 940 return (void*)0x403e; 925 941 926 942 case WM_CALCALTAZ: … … 954 970 return (void*)0xaaaa; 955 971 } 956 cout << " Unknown Msg"<< endl;972 cout << "MCosy::Proc: Unknown message 0x" << msg << endl; 957 973 return (void*)0xffffffff; 958 974 } … … 988 1004 else 989 1005 resrezd = env.GetValue("Zd_ResRE[re/U_mot]", 1500); 990 1006 991 1007 Double_t ressezd = 0; 992 1008 if (fZd1) … … 1004 1020 resseaz = env.GetValue("Az_ResSE[se/U_mot]", 16384); 1005 1021 1006 /* WORKAROUND !!!!!!!!!!!!! FIXME !!!!!!!!!!! */1007 resrezd = 500;1008 resreaz = 500;1009 1010 1022 kGearRatio.Set (gzd*resrezd/ressezd, gaz*resreaz/resseaz); //[re/se] 1011 1023 kGearRatio2.Set(gzd*resrezd/360.0, gaz*resreaz/360.0); //[re/deg] … … 1036 1048 } 1037 1049 1038 fMac1->EnableTimeout(kTRUE, 500);1039 fMac2->EnableTimeout(kTRUE, 500);1050 //fMac1->EnableTimeout(kTRUE, 500); 1051 //fMac2->EnableTimeout(kTRUE, 500); 1040 1052 1041 1053 if (!(fZd1 && fZd2 && fAz)) 1042 1054 return; 1043 1055 1044 /* 1056 1045 1057 // 1046 1058 // Start the Network … … 1049 1061 TEnv env(".cosyrc"); 1050 1062 cout << "done." << endl; 1051 1063 /* 1052 1064 const int res = fMac3->GetVelRes(); 1053 1065 … … 1222 1234 } 1223 1235 1236 fZdAzSoll.Set(sollzd.Zd(), sollaz.Az()); 1237 fZdAzSoll *= 2*TMath::Pi()/16384; 1238 1224 1239 fTrackingError.Set((ist.Zd()-sollzd.Zd())*kGearRatio.X(), 1225 1240 (ist.Az()-sollaz.Az())*kGearRatio.Y()); … … 1248 1263 1249 1264 fWin->Update(bendist*(360.0/2/TMath::Pi()), fTrackingError/kGearRatio2, 1250 fVelocity, fOffset/*/kGearRatio2*/, 1265 fVelocity, fOffset/*/kGearRatio2*/, fRaDec, fZdAzSoll, 1251 1266 fStatus); 1252 1267 … … 1291 1306 lout << "- Starting TX Thread." << endl; 1292 1307 fTTalk = new MTTalk(this); 1308 // fTGui = new MTGui(this); 1293 1309 1294 1310 lout << "- Starting GUI update." << endl; 1295 1311 fUpdateGui->TurnOn(); 1296 // fTGui = new MTGui(this);1297 1312 } 1298 1313
Note:
See TracChangeset
for help on using the changeset viewer.