Changeset 1953 for trunk/MagicSoft/Cosy/gui
- Timestamp:
- 04/12/03 19:06:27 (22 years ago)
- Location:
- trunk/MagicSoft/Cosy/gui
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/gui/MGAccuracy.cc
r1819 r1953 246 246 // 247 247 // calculate actual time for planet positions 248 // acc [deg] 248 249 // 249 250 static int X = ~0; -
trunk/MagicSoft/Cosy/gui/MGCosy.cc
r1793 r1953 32 32 33 33 #undef DEBUG 34 #define EXPERT 34 35 35 36 ClassImp(MGCosy); … … 44 45 kPB_TRACK, 45 46 kPB_STOP, 46 kPB_ HOME,47 kPB_TRACKPOS, 47 48 kPB_CALCALTAZ, 48 49 kPB_TPOINT, … … 126 127 fList->Add(l); 127 128 128 fLabel1 = new TGLabel*[3]; 129 fLabel1[0] = new TGLabel(f, "00000"); // Max: 16384 130 fLabel1[1] = new TGLabel(f, "000"); // Max: 256 131 fLabel1[2] = new TGLabel(f, "000"); // Max: 256 132 fLabel1[0]->SetTextJustify(kTextRight); 133 fLabel1[1]->SetTextJustify(kTextRight); 134 fLabel1[2]->SetTextJustify(kTextRight); 135 fLabel1[0]->Move(x, y+40); 136 fLabel1[1]->Move(x+43, y+40); 137 fLabel1[2]->Move(x+70, y+40); 138 fList->Add(fLabel1[0]); 139 fList->Add(fLabel1[1]); 140 fList->Add(fLabel1[2]); 141 //f->AddFrame(fLabel1[0]); 142 //f->AddFrame(fLabel1[1]); 143 //f->AddFrame(fLabel1[2]); 144 145 fLabel2 = new TGLabel*[3]; 146 fLabel2[0] = new TGLabel(f, "00000"); 147 fLabel2[1] = new TGLabel(f, "000"); 148 fLabel2[2] = new TGLabel(f, "000"); 149 fLabel2[0]->SetTextJustify(kTextRight); 150 fLabel2[1]->SetTextJustify(kTextRight); 151 fLabel2[2]->SetTextJustify(kTextRight); 152 fLabel2[0]->Move(x, y+57); 153 fLabel2[1]->Move(x+43, y+57); 154 fLabel2[2]->Move(x+70, y+57); 155 fList->Add(fLabel2[0]); 156 fList->Add(fLabel2[1]); 157 fList->Add(fLabel2[2]); 158 //f->AddFrame(fLabel2[0]); 159 //f->AddFrame(fLabel2[1]); 160 //f->AddFrame(fLabel2[2]); 161 162 fLabel3 = new TGLabel*[3]; 163 fLabel3[0] = new TGLabel(f, "00000"); 164 fLabel3[1] = new TGLabel(f, "000"); 165 fLabel3[2] = new TGLabel(f, "000"); 166 fLabel3[0]->SetTextJustify(kTextRight); 167 fLabel3[1]->SetTextJustify(kTextRight); 168 fLabel3[2]->SetTextJustify(kTextRight); 169 fLabel3[0]->Move(x, y+74); 170 fLabel3[1]->Move(x+43, y+74); 171 fLabel3[2]->Move(x+70, y+74); 172 fList->Add(fLabel3[0]); 173 fList->Add(fLabel3[1]); 174 fList->Add(fLabel3[2]); 175 //f->AddFrame(fLabel3[0]); 176 //f->AddFrame(fLabel3[1]); 177 //f->AddFrame(fLabel3[2]); 129 fLabel1 = new TGLabel(f, "00000"); // Max: 16384 130 fLabel2 = new TGLabel(f, "00000"); 131 fLabel3 = new TGLabel(f, "00000"); 132 fLabel1->SetTextJustify(kTextRight); 133 fLabel2->SetTextJustify(kTextRight); 134 fLabel3->SetTextJustify(kTextRight); 135 fLabel1->Move(x, y+40); 136 fLabel2->Move(x, y+57); 137 fLabel3->Move(x, y+74); 138 fList->Add(fLabel1); 139 fList->Add(fLabel2); 140 fList->Add(fLabel3); 178 141 179 142 l = new TGLabel(f, "Offset-Zd:"); … … 250 213 fAvailMac1 = new TGLabel(f, "- MAC1 -"); 251 214 fAvailMac2 = new TGLabel(f, "- MAC2 -"); 252 fAvailMac3 = new TGLabel(f, "- MAC3 -");215 //fAvailMac3 = new TGLabel(f, "- MAC3 -"); 253 216 fAvailSe1 = new TGLabel(f, "-SE/Zd1-"); 254 217 fAvailSe2 = new TGLabel(f, "-SE/Zd2-"); … … 261 224 fAvailMac1->SetBackgroundColor(color); 262 225 fAvailMac2->SetBackgroundColor(color); 263 fAvailMac3->SetBackgroundColor(color);226 //fAvailMac3->SetBackgroundColor(color); 264 227 fAvailSe1->SetBackgroundColor(color); 265 228 fAvailSe2->SetBackgroundColor(color); … … 281 244 fAvailMac1->Move(10, 25+120); 282 245 fAvailMac2->Move(10, 25+140); 283 fAvailMac3->Move(10, 25+160);246 //fAvailMac3->Move(10, 25+160); 284 247 fAvailSe1->Move(10, 25+180); 285 248 fAvailSe2->Move(10, 25+200); … … 293 256 fAvailMac1->Resize(60, 20); 294 257 fAvailMac2->Resize(60, 20); 295 fAvailMac3->Resize(60, 20);258 //fAvailMac3->Resize(60, 20); 296 259 fAvailSe1->Resize(60, 20); 297 260 fAvailSe2->Resize(60, 20); … … 305 268 fList->Add(fAvailMac1); 306 269 fList->Add(fAvailMac2); 307 fList->Add(fAvailMac3);270 //fList->Add(fAvailMac3); 308 271 fList->Add(fAvailSe1); 309 272 fList->Add(fAvailSe2); … … 332 295 333 296 int i=0; 334 while ( !fin.eof())297 while (1) 335 298 { 336 299 TString str; 337 300 Double_t zd, az; 338 301 fin >> str >> zd >> az; 302 if (!fin) 303 break; 339 304 box->AddEntry(str, i++); 340 305 … … 347 312 TGCompositeFrame *tf1 = fTab->AddTab("Position"); 348 313 TGCompositeFrame *tf2 = fTab->AddTab("Track"); 314 #ifdef EXPERT 349 315 TGCompositeFrame *tf4 = fTab->AddTab("Calib"); 350 316 TGCompositeFrame *tf5 = fTab->AddTab("Test SE"); 351 317 TGCompositeFrame *tf6 = fTab->AddTab("Gear"); 352 /*TGCompositeFrame *tf3 =*/ fTab->AddTab("Demo"); 318 #endif 319 /*TGCompositeFrame *tf3 =*/// fTab->AddTab("Demo"); 353 320 354 321 fCZdAz = new MGCoordinates(tf1, kETypeZdAz); … … 362 329 fList->Add(fCRaDec); 363 330 331 #ifdef EXPERT 364 332 fCCalib = new MGCoordinates(tf4, kETypeRaDec); 365 333 fCCalib->Move(27, 105); 366 334 fList->Add(fCCalib); 335 #endif 367 336 368 337 const int x=15; … … 372 341 TGLabel *l1 = new TGLabel(tf1, "Move the telescope to a position given in"); 373 342 TGLabel *l2 = new TGLabel(tf1, "local coordinates. The given coordinates"); 374 TGLabel *l3 = new TGLabel(tf1, "are pointing coordinates , which means that the");375 TGLabel *l4 = new TGLabel(tf1, " coordinates are corrected for the bending of");376 TGLabel *l5 = new TGLabel(tf1, " the telescope.");343 TGLabel *l3 = new TGLabel(tf1, "are pointing coordinates. Enter the coordinates"); 344 TGLabel *l4 = new TGLabel(tf1, "manually or choose a predefined position"); 345 TGLabel *l5 = new TGLabel(tf1, "from the combobox below."); 377 346 l1->Move(x, y); 378 347 l2->Move(x, y+h); … … 396 365 fList->Add(l3); 397 366 367 #ifdef EXPERT 398 368 l1 = new TGLabel(tf4, "Start the calibration using the Start button."); 399 369 l2 = new TGLabel(tf4, "Write a coordinate pair to a TPoint file using"); 400 l3 = new TGLabel(tf4, "the TPoint button. To set the Shaftencoder offset"); 401 l4 = new TGLabel(tf4, "use the Calib SE button."); 370 l3 = new TGLabel(tf4, "the TPoint button."); 371 //l3 = new TGLabel(tf4, "the TPoint button. To set the Shaftencoder offset"); 372 //l4 = new TGLabel(tf4, "use the Calib SE button."); 402 373 l1->Move(x, y); 403 374 l2->Move(x, y+h); … … 425 396 l1->Move(x, y); 426 397 fList->Add(l1); 398 #endif 427 399 428 400 // … … 465 437 fList->Add(but); 466 438 467 but = new TGTextButton(tf1, " Home", kPB_HOME);468 but->Resize( 80, 25);469 but->Move( 160, 197);470 but->SetToolTipText(" Initiate Home Drive.");439 but = new TGTextButton(tf1, "Move'n'Track", kPB_TRACKPOS); 440 but->Resize(100, 25); 441 but->Move(25, 242); 442 but->SetToolTipText("Move telescope to a Zd/Az position and start tracking."); 471 443 but->Associate(this); 472 444 fList->Add(but); 473 445 446 but= new TGTextButton(tf2, "Calc Zd/Az", kPB_CALCALTAZ); 447 but->Resize(80, 25); 448 but->Move(165, 197); 449 but->SetToolTipText("Calculate Zd/Az corresponding to Ra/Dec."); 450 but->Associate(this); 451 fList->Add(but); 452 453 #ifdef EXPERT 474 454 but = new TGTextButton(tf5, "Display", kPB_DISPLAY1); 475 455 but->Resize(80, 25); … … 486 466 fList->Add(but); 487 467 488 but= new TGTextButton(tf2, "Calc Zd/Az", kPB_CALCALTAZ); 489 but->Resize(80, 25); 490 but->Move(165, 197); 491 but->SetToolTipText("Calculate Zd/Az corresponding to Ra/Dec."); 492 but->Associate(this); 493 fList->Add(but); 494 495 but = new TGTextButton(tf4, "TPoint", kPB_TPOINT); 496 but->Resize(80, 25); 497 but->Move(25, 190); 498 but->SetToolTipText("Trigger writing a tpoint coordinate pair."); 499 but->Associate(this); 500 fList->Add(but); 501 468 /* 502 469 but = new TGTextButton(tf4, "Calib SE", kPB_CALIBSE); 503 470 but->Resize(80, 25); … … 506 473 but->Associate(this); 507 474 fList->Add(but); 508 475 */ 509 476 but = new TGTextButton(tf4, "Load", kPB_LoadBending); 510 477 but->Resize(80, 25); 511 but->Move(25, 220);478 but->Move(25, 190); 512 479 but->SetToolTipText("Load bending corrections from file 'bending.txt'"); 513 480 but->Associate(this); … … 516 483 but = new TGTextButton(tf4, "Reset", kPB_ResetBending); 517 484 but->Resize(80, 25); 518 but->Move(25, 2 50);485 but->Move(25, 220); 519 486 but->SetToolTipText("Reset bending correction (coefficients=0)"); 520 487 but->Associate(this); 521 488 fList->Add(but); 489 490 but = new TGTextButton(tf4, "TPoint", kPB_TPOINT); 491 but->Resize(80, 25); 492 but->Move(25, 250); 493 but->SetToolTipText("Trigger writing a tpoint coordinate pair."); 494 but->Associate(this); 495 fList->Add(but); 496 #endif 522 497 523 498 ULong_t color; … … 958 933 ZdAz soll, UInt_t stat, UInt_t stat2) 959 934 { 935 // acc [rad] 936 acc *= kRad2Deg; // [deg] 937 960 938 double mjd = UpdateTime(); 961 939 fSkyPosition->Update(pos, mjd); … … 984 962 SetLabelColor(fAvailMac1, stat2&0x01); 985 963 SetLabelColor(fAvailMac2, stat2&0x02); 986 SetLabelColor(fAvailMac3, stat2&0x04);964 //SetLabelColor(fAvailMac3, stat2&0x04); 987 965 SetLabelColor(fAvailSe1, stat2&0x08); 988 966 SetLabelColor(fAvailSe2, stat2&0x10); … … 1033 1011 } 1034 1012 1013 void MGCosy::StartTrackPos() 1014 { 1015 cout << "Start tracking Zd/Az pos." << endl; 1016 1017 const XY &xy = fCZdAz->GetCoordinates(); 1018 1019 ZdAz za(xy.X(), xy.Y()); 1020 1021 cout << za.Zd() << "\xb0 " << za.Az() << "\xb0" << endl; 1022 1023 fQueue->PostMsg(WM_TRACKPOS, &za, sizeof(za)); 1024 1025 cout << "PostMsg (WM_TrackPos) returned." << endl; 1026 } 1027 1035 1028 void MGCosy::StartPos() 1036 1029 { … … 1050 1043 // ************************** For demo purpose ********************** 1051 1044 // 1045 /* 1052 1046 #include <TRandom.h> 1053 1047 class MDemo : public MThread … … 1068 1062 Timer tm; 1069 1063 tm.Now(); 1070 /* 1071 Float_t h = 2.+tm.H()+(10.7+tm.M())/60.; 1072 RaDec dest(h*15, 129.7); 1073 1074 cout << dest.Ra()/15 << "h " << dest.Dec() << "°" << endl; 1075 1076 fQueue->PostMsg(WM_TRACK, &dest, sizeof(dest)); 1064 1065 //fQueue->PostMsg(WM_STOP, 0, 0); 1066 1067 ZdAz dest1((float)fRand.Integer(120)-60., 0);//fRand.Integer(25)+90); 1068 1069 cout << "Demo: Zd=" << dest1.Zd() << "° Az=" << dest1.Az() << "°" << endl; 1070 1071 fQueue->PostMsg(WM_POSITION, &dest1, sizeof(dest1)); 1077 1072 1078 1073 int i = 0; 1079 while (!HasStopFlag() && i++<60) // 2.5min 1080 usleep(1000000); 1081 if (HasStopFlag()) 1082 break; 1083 */ 1084 1085 //fQueue->PostMsg(WM_STOP, 0, 0); 1086 1087 ZdAz dest1((float)fRand.Integer(120)-60., 0);//fRand.Integer(25)+90); 1088 1089 cout << "Demo: Zd=" << dest1.Zd() << "° Az=" << dest1.Az() << "°" << endl; 1090 1091 fQueue->PostMsg(WM_POSITION, &dest1, sizeof(dest1)); 1092 1093 int i = 0; 1094 while (!HasStopFlag() && i++<5/*5*/) // 30s 1074 while (!HasStopFlag() && i++<5) // 30s 1095 1075 usleep(1000000); 1096 1076 if (HasStopFlag()) … … 1099 1079 //ZdAz dest2(5, 30); 1100 1080 //fQueue->PostMsg(WM_POSITION, &dest2, sizeof(dest2)); 1101 /*1102 i = 0;1103 while (!HasStopFlag() && i++<30) // 30s1104 usleep(1000000);1105 */1106 1081 //if (HasStopFlag()) 1107 1082 // break; … … 1129 1104 demo.Stop(); 1130 1105 } 1131 1106 */ 1107 /* 1132 1108 void MGCosy::StartCalib() 1133 1109 { … … 1141 1117 cout << "PostMsg (WM_Calib) returned." << endl; 1142 1118 } 1143 1119 */ 1144 1120 void MGCosy::StartTPoint() 1145 1121 { … … 1213 1189 fQueue->Proc(WM_GEAR, (void*)1); 1214 1190 return kTRUE; 1191 /* 1215 1192 case 5: 1216 1193 StartDemo(); 1217 1194 return kTRUE; 1195 */ 1218 1196 } 1219 1197 return kTRUE; … … 1221 1199 case kPB_STOP: 1222 1200 cout << "Sending stop movement msg." << endl; 1223 StopDemo();1201 //StopDemo(); 1224 1202 fQueue->PostMsg(WM_STOP, 0, 0); 1225 1203 if (fTab->GetCurrent()==3) … … 1270 1248 StartTPoint(); 1271 1249 return kTRUE; 1250 /* 1272 1251 case kPB_CALIBSE: 1273 1252 StartCalib(); 1274 1253 return kTRUE; 1254 */ 1275 1255 case kPB_LoadBending: 1276 1256 fQueue->Proc(WM_LOADBENDING, NULL); … … 1279 1259 fQueue->Proc(WM_RESETBENDING, NULL); 1280 1260 return kTRUE; 1261 /* 1281 1262 case kPB_HOME: 1282 1263 fQueue->PostMsg(WM_HOME, 0, 0); 1264 return kTRUE; 1265 */ 1266 case kPB_TRACKPOS: 1267 StartTrackPos(); 1283 1268 return kTRUE; 1284 1269 case kPB_DISPLAY1: -
trunk/MagicSoft/Cosy/gui/MGCosy.h
r1760 r1953 49 49 MGList *fList; 50 50 51 TGLabel **fLabel1;52 TGLabel **fLabel2;53 TGLabel **fLabel3;51 TGLabel *fLabel1; 52 TGLabel *fLabel2; 53 TGLabel *fLabel3; 54 54 55 55 TGLabel *fOffsetZd; … … 104 104 void StartPos(); 105 105 void StartTrack(); 106 void StartTrackPos(); 106 107 void StartDemo(); 107 void StartCalib();108 //void StartCalib(); 108 109 void StartTPoint(); 109 110 … … 121 122 void CloseWindow(); 122 123 123 TGLabel * *GetLabel1() const { return fLabel1; }124 TGLabel * *GetLabel2() const { return fLabel2; }125 TGLabel * *GetLabel3() const { return fLabel3; }124 TGLabel *GetLabel1() const { return fLabel1; } 125 TGLabel *GetLabel2() const { return fLabel2; } 126 TGLabel *GetLabel3() const { return fLabel3; } 126 127 127 128 TGListBox *GetLog() const { return fLog; } -
trunk/MagicSoft/Cosy/gui/MGStarguider.cc
r1819 r1953 74 74 IDM_kLimMag9, 75 75 IDM_kPixSize, 76 IDM_kAngle, 76 77 IDM_kInterpol125, 77 78 IDM_kInterpol25, … … 217 218 fWriteType->AddEntry("&Once", IDM_kOnce); 218 219 fWriteType->AddEntry("&Continous", IDM_kContinous); 220 fWriteType->CheckEntry(IDM_kOnce); 219 221 fWriteType->Associate(this); 220 222 fList->Add(fWriteType); … … 334 336 l = new TGLabel(this, "arcsec/pix"); 335 337 l->SetTextJustify(kTextLeft); 336 l->Move(605, fMenu->GetDefaultHeight()+619); 338 l->Move(605, fMenu->GetDefaultHeight()+619+13); 339 AddFrame(l); 340 fList->Add(l); 341 342 l = new TGLabel(this, "deg"); 343 l->SetTextJustify(kTextLeft); 344 l->Move(605, fMenu->GetDefaultHeight()+619-10); 337 345 AddFrame(l); 338 346 fList->Add(l); … … 347 355 348 356 fSao->SetPixSize(pixsize/3600); 357 fSao->SetRotationAngle(0); 349 358 350 359 TString txt; … … 353 362 fPixSize = new TGTextEntry(this, txt, IDM_kPixSize); 354 363 fPixSize->SetAlignment(kTextCenterX); 355 fPixSize->Move(547, fMenu->GetDefaultHeight()+617 );364 fPixSize->Move(547, fMenu->GetDefaultHeight()+617+13); 356 365 AddFrame(fPixSize); 357 366 fList->Add(fPixSize); 367 368 fAngle = new TGTextEntry(this, " 0", IDM_kAngle); 369 fAngle->SetAlignment(kTextCenterX); 370 fAngle->Move(547, fMenu->GetDefaultHeight()+617-10); 371 AddFrame(fAngle); 372 fList->Add(fAngle); 358 373 359 374 // TGHorizontal3DLine *fLineSep = new TGHorizontal3DLine(this); … … 582 597 case kC_TEXTENTRY: 583 598 if (GET_SUBMSG(msg)==kTE_ENTER) 584 { 585 const Float_t pixsize = atof(fPixSize->GetText()); 586 cout << "Pixel Size changed to " << pixsize << "\"/pix" << endl; 587 fSao->SetPixSize(pixsize/3600); 588 } 599 switch (mp1) 600 { 601 case IDM_kPixSize: 602 { 603 const Float_t pixsize = atof(fPixSize->GetText()); 604 cout << "Pixel Size changed to " << pixsize << "\"/pix" << endl; 605 fSao->SetPixSize(pixsize/3600); 606 return kTRUE; 607 } 608 case IDM_kAngle: 609 { 610 const Float_t angle = atof(fAngle->GetText()); 611 cout << "Rotation Angle changed to " << angle << "deg" << endl; 612 fSao->SetRotationAngle(angle); 613 return kTRUE; 614 } 615 } 589 616 return kTRUE; 590 617 … … 896 923 AltAz pos1 = fSao->CalcAltAzFromPix(768/2+g.GetMean(1), 576/2+g.GetMean(2))*kRad2Deg; 897 924 925 ofstream fout1("pointingpos.txt"); 926 fout1 << setprecision(10) << fSao->GetMjd()-52000 << " " << -pos1.Alt() << " " << pos1.Az() << endl; 927 898 928 pos1 -= pos0; 899 929 900 ofstream fout("tracking_error.txt"); 901 fout << setprecision(10) << fSao->GetMjd()-52000 << " " << -pos1.Alt() << " " << pos1.Az() << endl; 902 fout.close(); 930 ofstream fout2("tracking_error.txt"); 931 fout2 << setprecision(10) << fSao->GetMjd()-52000 << " " << -pos1.Alt() << " " << pos1.Az() << endl; 903 932 904 933 return ZdAz(-pos1.Alt(), pos1.Az()); … … 1172 1201 fDy = dy; 1173 1202 1174 cout << "New coordinates for zoom: " << fDx << " " << fDy << endl; 1203 fSao->Now(); 1204 AltAz aa = fSao->CalcAltAzFromPix(fDx, fDy)*kRad2Deg; 1205 1206 cout << "New coordinates for zoom - x, y : " << fDx << " " << fDy << endl; 1207 cout << "New coordinates for zoom - Alt, az: " << aa.Alt() << " " << aa.Az() << endl; 1175 1208 1176 1209 return kTRUE; -
trunk/MagicSoft/Cosy/gui/MGStarguider.h
r1819 r1953 89 89 90 90 TGTextEntry *fPixSize; 91 TGTextEntry *fAngle; 91 92 92 93 StarCatalog *fSao;
Note:
See TracChangeset
for help on using the changeset viewer.