Changeset 1760 for trunk/MagicSoft/Cosy/gui
- Timestamp:
- 02/16/03 17:02:06 (22 years ago)
- Location:
- trunk/MagicSoft/Cosy/gui
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/gui/MGAccuracy.cc
r1702 r1760 206 206 int rs = (int)floor(fmod(dist, 60.)); 207 207 dist /= 60.; 208 int rm = (int) floor(fmod(dist, 60.));208 int rm = (int)dist;//floor(fmod(dist, 60.)); 209 209 210 210 char txt[100]; -
trunk/MagicSoft/Cosy/gui/MGCosy.cc
r1758 r1760 14 14 #include <TGLabel.h> // TGLabel 15 15 #include <TGListBox.h> // TGListBox 16 #include <TGComboBox.h> // TGComboBox 16 17 #include <TG3DLine.h> // TGHorizontal3DLine (TGSplitter) 17 18 #include <TGTextEntry.h> // TGTextEntry … … 53 54 kPB_LoadBending, 54 55 kPB_ResetBending, 55 kPB_CALIBSE 56 kPB_CALIBSE, 57 kCB_PredefPos 58 56 59 }; 57 60 … … 306 309 } 307 310 311 void MGCosy::CreatePredefinedPos(TGCompositeFrame *tf1) 312 { 313 TGComboBox *box = new TGComboBox(tf1, kCB_PredefPos); 314 box->Resize(120, 20); 315 box->Associate(this); 316 317 TGLayoutHints *lay = new TGLayoutHints(kLHintsLeft|kLHintsTop, 318 27, 0, 200, 0); 319 tf1->AddFrame(box, lay); 320 321 fList->Add(box); 322 fList->Add(lay); 323 324 ifstream fin("prepos.txt"); 325 if (!fin) 326 { 327 cout << "ERROR: Predifined posiion in 'prepos.txt' not found." << endl; 328 return; 329 } 330 331 int i=0; 332 while (!fin.eof()) 333 { 334 TString str; 335 Double_t zd, az; 336 fin >> str >> zd >> az; 337 box->AddEntry(str, i++); 338 339 fStarList.Add(zd, az); 340 } 341 } 342 308 343 void MGCosy::CreateTabs(TGTab *fTab) 309 344 { … … 317 352 fCZdAz->Move(27, 105); 318 353 fList->Add(fCZdAz); 354 355 CreatePredefinedPos(tf1); 319 356 320 357 fCRaDec = new MGCoordinates(tf2, kETypeRaDec); … … 866 903 time.Now(); 867 904 905 static char oldtxt[256]; 906 868 907 char text[256]; 869 908 … … 875 914 dot[2] = 0; 876 915 877 fUtc->SetText(new TGString(text)); 878 916 if (strcmp(oldtxt, text)) 917 { 918 fUtc->SetText(new TGString(text)); 919 strcpy(oldtxt, text); 920 } 921 922 static long oldmjd; 879 923 double mjd = time.GetMjd(); 880 924 881 sprintf(text, "%12.6f", mjd); 882 fMjd->SetText(new TGString(text)); 925 if (oldmjd != 1000000*mjd) 926 { 927 sprintf(text, "%12.6f", mjd); 928 fMjd->SetText(new TGString(text)); 929 930 oldmjd = (long)(1000000*mjd); 931 } 883 932 884 933 return mjd; … … 1098 1147 switch (GET_SUBMSG(msg)) 1099 1148 { 1149 case kCM_COMBOBOX: 1150 if (mp1==kCB_PredefPos) 1151 { 1152 MStar *pos = fStarList[mp2]; 1153 if (!pos) 1154 return kTRUE; 1155 fCZdAz->SetCoordinates(ZdAz(pos->GetX(), pos->GetY())); 1156 } 1157 return kTRUE; 1158 1100 1159 case kCM_TAB: 1101 1160 //cout << "Tab: " << mp1 << endl; -
trunk/MagicSoft/Cosy/gui/MGCosy.h
r1758 r1760 7 7 8 8 #ifndef MARS_MObservatory 9 #include <MObservatory.h> 9 #include "MObservatory.h" 10 #endif 11 12 #ifndef COSY_MStarList 13 #include "MStarList.h" 10 14 #endif 11 15 … … 64 68 TGLabel *fMjd; 65 69 70 MStarList fStarList; 71 66 72 MGCoordinates *fCZdAz; 67 73 MGCoordinates *fCRaDec; … … 94 100 void CreateLabel(TGCompositeFrame *f); 95 101 void CreateTabs(TGTab *fTab); 102 void CreatePredefinedPos(TGCompositeFrame *tf1); 96 103 97 104 void StartPos(); -
trunk/MagicSoft/Cosy/gui/MGSkyPosition.cc
r1758 r1760 69 69 InitArc(fSaturn, 1001, kYellow/*17*/, 16); 70 70 71 for (int i=0; i<13; i++) 72 { 73 fStars[i] = new TArc(0, 0, 1); 74 InitArc(fStars[i], 1001, kWhite, kWhite); 75 fList->Add(fStars[i]); 76 } 77 71 78 for (int i=0; i<4; i++) 72 79 { … … 97 104 } 98 105 106 void MGSkyPosition::UpdateStars() 107 { 108 RaDec stars[13]; 109 110 // 32349 Sirius -1.44 1.45 2.64 0.009 A0m 111 stars[0] = RaDec(MObservatory::Hms2Rad( 6, 45, 0), MObservatory::Dms2Rad(-16, 42, 0)); 112 // 30438 Canopus -0.62 -5.53 95.88 0.164 F0Ib 113 stars[1] = RaDec(MObservatory::Hms2Rad( 6, 23, 0), MObservatory::Dms2Rad(-52, 41, 0)); 114 // 69673 Arcturus -0.05 -0.31 11.25 1.239 K2IIIp 115 stars[2] = RaDec(MObservatory::Hms2Rad( 14, 15, 0), MObservatory::Dms2Rad( 19, 10, 0)); 116 stars[3] = RaDec(MObservatory::Hms2Rad( 01, 37, 6), MObservatory::Dms2Rad(-57, 14, 0)); 117 stars[4] = RaDec(MObservatory::Hms2Rad( 12, 26, 6), MObservatory::Dms2Rad(-63, 06, 0)); 118 stars[5] = RaDec(MObservatory::Hms2Rad( 13, 25, 2), MObservatory::Dms2Rad(-11, 10, 0)); 119 stars[6] = RaDec(MObservatory::Hms2Rad( 5, 14, 0), MObservatory::Dms2Rad(- 8, 12, 5)); 120 stars[7] = RaDec(MObservatory::Hms2Rad( 19, 50, 0), MObservatory::Dms2Rad(- 8, 52, 6)); 121 stars[8] = RaDec(MObservatory::Hms2Rad( 18, 37, 0), MObservatory::Dms2Rad( 38, 47, 0)); 122 stars[9] = RaDec(MObservatory::Hms2Rad( 5, 16, 0), MObservatory::Dms2Rad( 46, 00, 0)); 123 stars[10] = RaDec(MObservatory::Hms2Rad( 7, 39, 0), MObservatory::Dms2Rad( 5, 14, 0)); 124 stars[11] = RaDec(MObservatory::Hms2Rad( 5, 55, 0), MObservatory::Dms2Rad( 7, 24, 0)); 125 stars[12] = RaDec(MObservatory::Hms2Rad( 19, 50, 0), MObservatory::Dms2Rad( 8, 52, 0)); 126 127 for (int i=0; i<13; i++) 128 SetDot(fStars[i], stars[i], 0); 129 130 } 99 131 void MGSkyPosition::InitText() 100 132 { … … 327 359 UpdatePlanet(kESaturn, fSaturn); 328 360 361 UpdateStars(); 362 329 363 RaDec radec = fSlaStar->CalcRaDecFast(pos*kDeg2Rad); 330 364 -
trunk/MagicSoft/Cosy/gui/MGSkyPosition.h
r1758 r1760 35 35 TArc *fSaturn; 36 36 37 TArc *fStars[13]; 38 37 39 TArc *fSaturnRing; 38 40 … … 67 69 void SetDot(TArc *arc, RaDec &radec, Int_t off); 68 70 71 void UpdateStars(); 69 72 void UpdateText(Float_t zd, Float_t az); 70 73 void UpdatePlanet(Int_t planet, TArc *arc);
Note:
See TracChangeset
for help on using the changeset viewer.