Changeset 12589 for trunk/Cosy/gui
- Timestamp:
- 11/21/11 11:31:09 (13 years ago)
- Location:
- trunk/Cosy/gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Cosy/gui/MGCosy.cc
r9439 r12589 75 75 kCB_PredefPos, 76 76 kCB_StarList, 77 kCB_CelestList, 77 78 kPB_SavePreDef, 78 79 kPB_SaveStar, … … 391 392 } 392 393 394 void MGCosy::CreateCelestList(TGCompositeFrame *tf1) 395 { 396 TGComboBox *box = new TGComboBox(tf1, kCB_CelestList); 397 box->Resize(170, 20); 398 box->Associate(this); 399 400 TGLayoutHints *lay = new TGLayoutHints(kLHintsLeft|kLHintsTop, 401 27, 0, 70, 0); 402 tf1->AddFrame(box, lay); 403 404 fList->Add(box); 405 fList->Add(lay); 406 407 box->AddEntry("Moon", 3); 408 box->AddEntry("Mercury", 1); 409 box->AddEntry("Venus", 2); 410 box->AddEntry("Mars", 4); 411 box->AddEntry("Jupiter", 5); 412 box->AddEntry("Saturn", 6); 413 box->AddEntry("Uranus", 7); 414 box->AddEntry("Neptune", 8); 415 box->AddEntry("Pluto", 9); 416 417 box->Select(3); 418 } 419 393 420 void MGCosy::CreateTabs(const char *prepos) 394 421 { 395 422 TGCompositeFrame *tf1 = fTab->AddTab("Position"); 396 423 TGCompositeFrame *tf2 = fTab->AddTab("Track"); 424 TGCompositeFrame *tf7 = fTab->AddTab("Celest"); 397 425 TGCompositeFrame *tf4 = fTab->AddTab("Calib"); 398 426 #ifdef EXPERT … … 410 438 CreatePredefinedPos(tf1, prepos); 411 439 CreateStarList(tf4); 440 CreateCelestList(tf7); 412 441 413 442 fCRaDec = new MGCoordinates(tf2, kETypeRaDec); … … 462 491 fList->Add(l3); 463 492 //fList->Add(l4); 493 494 l1 = new TGLabel(tf7, "Track a celestial object by object name."); 495 // l2 = new TGLabel(tf7, "Right Ascension and declination must be given"); 496 // l3 = new TGLabel(tf7, "in the FK5, J2000 coordinate system."); 497 l1->Move(x, y); 498 // l2->Move(x, y+h); 499 // l3->Move(x, y+2*h); 500 fList->Add(l1); 501 // fList->Add(l2); 502 // fList->Add(l3); 503 464 504 465 505 #ifdef EXPERT … … 729 769 730 770 MGCosy::MGCosy(MObservatory::LocationName_t key, const char *prepos, MsgQueue *q) 731 : TGMainFrame(gClient->GetRoot(), 1, 1), fObservatory(key), fQueue(q) 771 : TGMainFrame(gClient->GetRoot(), 1, 1), fObservatory(key), fQueue(q), fCelestObj(3) 732 772 { 733 773 // This means that all objects added with AddFrame are deleted … … 1072 1112 EnableLabel(fRaSoll, stat&MDriveCom::kTracking); 1073 1113 EnableLabel(fDecSoll, stat&MDriveCom::kTracking); 1074 EnableLabel(fZdSoll, stat&MDriveCom::kMoving );1075 EnableLabel(fAzSoll, stat&MDriveCom::kMoving );1114 EnableLabel(fZdSoll, stat&MDriveCom::kMoving || stat&MDriveCom::kTracking); 1115 EnableLabel(fAzSoll, stat&MDriveCom::kMoving || stat&MDriveCom::kTracking); 1076 1116 1077 1117 SetLabelColor(fAvailTcp, stat2); … … 1080 1120 pdo3 = 0; 1081 1121 1122 // 1 X Ab 1123 // 2 1 1124 // 4 Emergency 1125 // 8 OverVolt 1126 // 10 Move (Drehen-soll) 1127 // 20 X Af 1128 // 40 1 1129 // 80 Power on Az 1130 // ------------------ 1131 // 100 NOT UPS Alarm 1132 // 200 UPS on Battery 1133 // 400 UPS charging 1134 1135 #ifdef FACT 1136 SetLabelColor(fDkcReady1, pdo3&0x00000001); 1137 SetLabelColor(fDkcReady2, pdo3&0x00010000); 1138 SetLabelColor(fDkcEmergency, (pdo3&0x00040004)==0x00040004); 1139 SetLabelColor(fDkcPcMode, (pdo3&0x00100010)!=0x00100010); 1140 SetLabelColor(fDkcRF1, pdo3&0x00000020); 1141 SetLabelColor(fDkcRF2, pdo3&0x00200000); 1142 SetLabelColor(fDkcBrake, (pdo3&0x00400040)==0x00400040); 1143 SetLabelColor(fDkcPower, (pdo3&0x00800080)==0x00800080); 1144 #else 1082 1145 SetLabelColor(fDkcReady1, pdo3&0x0001); 1083 1146 SetLabelColor(fDkcReady2, pdo3&0x0100); … … 1088 1151 SetLabelColor(fDkcBrake, (pdo3&0x4040)==0x4040); 1089 1152 SetLabelColor(fDkcPower, (pdo3&0x8080)==0x8080); 1153 #endif 1090 1154 1091 1155 EnableLabel(fArmed, armed); … … 1192 1256 1193 1257 cout << "PostMsg (WM_Track) returned." << endl; 1258 } 1259 1260 void MGCosy::StartCelest() 1261 { 1262 cout << "Start celest." << endl; 1263 1264 Double_t tx[3] = { fCelestObj, 0, 0 }; 1265 1266 fQueue->PostMsg(WM_CELEST, tx, sizeof(Double_t)*3); 1267 1268 cout << "PostMsg (WM_CELEST) returned." << endl; 1194 1269 } 1195 1270 … … 1380 1455 return kTRUE; 1381 1456 } 1457 case kCB_CelestList: 1458 { 1459 fCelestObj = mp2; 1460 return kTRUE; 1461 } 1382 1462 } 1383 1463 return kTRUE; … … 1410 1490 return kTRUE; 1411 1491 case 2: 1492 StartCelest(); 1493 return kTRUE; 1494 case 3: 1412 1495 fCRaDec->SetCoordinates(fCCalib->GetCoordinates()); 1413 1496 StartTrack(false); 1414 1497 return kTRUE; 1415 case 3:1498 case 4: 1416 1499 fQueue->Proc(WM_TESTSE, (void*)1); 1417 1500 return kTRUE; 1418 case 4:1501 case 5: 1419 1502 fQueue->Proc(WM_GEAR, (void*)1); 1420 1503 return kTRUE; 1421 1504 #ifdef HAS_DEMO 1422 case 5:1505 case 6: 1423 1506 StartDemo(); 1424 1507 return kTRUE; … … 1433 1516 #endif 1434 1517 fQueue->PostMsg(WM_STOP); 1435 if (fTab->GetCurrent()== 3)1518 if (fTab->GetCurrent()==4) 1436 1519 fQueue->Proc(WM_TESTSE); 1437 if (fTab->GetCurrent()== 4)1520 if (fTab->GetCurrent()==5) 1438 1521 fQueue->Proc(WM_GEAR); 1439 1522 cout << "PostMsg (WM_Stop) returned." << endl; -
trunk/Cosy/gui/MGCosy.h
r9439 r12589 111 111 112 112 FontStruct_t fFont; 113 Int_t fCelestObj; 113 114 114 115 void CreateMenu(); … … 117 118 void CreatePredefinedPos(TGCompositeFrame *tf1, const char *prepos); 118 119 void CreateStarList(TGCompositeFrame *tf1); 120 void CreateCelestList(TGCompositeFrame *tf1); 119 121 120 122 void StartPos(); 121 123 void StartTrack(bool track); 124 void StartCelest(); 122 125 void StartTrackPos(Long_t mp1=0); 123 126 void StartDemo();
Note:
See TracChangeset
for help on using the changeset viewer.