Changeset 9132 for trunk/MagicSoft/Cosy/gui
- Timestamp:
- 08/26/08 12:11:32 (16 years ago)
- Location:
- trunk/MagicSoft/Cosy/gui
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/gui/MGCosy.cc
r8998 r9132 131 131 { 132 132 const int x = 180; 133 const int y = 2 5;133 const int y = 20; 134 134 135 135 TGLabel *l; … … 150 150 fList->Add(fMjd); 151 151 152 l = new TGLabel(f, "SE-Az:"); 152 l = new TGLabel(f, "Encoder-Az:"); 153 l->Move(x-60, y+57); 154 fList->Add(l); 155 156 l = new TGLabel(f, "Encoder-Zd:"); 153 157 l->Move(x-60, y+40); 154 158 fList->Add(l); 155 159 156 l = new TGLabel(f, "SE-Zd1:");157 l->Move(x-60, y+57);158 fList->Add(l);159 160 l = new TGLabel(f, "SE-Zd2:");161 l->Move(x-60, y+74);162 fList->Add(l);163 164 160 fWeather = new TGLabel(f, ""); 165 fWeather->MoveResize(10, y+2 80, 280, 16);161 fWeather->MoveResize(10, y+272, 280, 16); 166 162 fList->Add(fWeather); 167 163 168 fLabel1 = new TGLabel(f, "00000000"); // Max: 16384 169 fLabel2 = new TGLabel(f, "00000000"); 170 fLabel3 = new TGLabel(f, "00000000"); 164 fLabel1 = new TGLabel(f, "0000000000"); 165 fLabel2 = new TGLabel(f, "0000000000"); 171 166 fLabel1->SetTextJustify(kTextRight); 172 167 fLabel2->SetTextJustify(kTextRight); 173 fLabel3->SetTextJustify(kTextRight); 174 fLabel1->Move(x, y+40); 175 fLabel2->Move(x, y+57); 176 fLabel3->Move(x, y+74); 168 fLabel1->Move(x+30, y+57); 169 fLabel2->Move(x+30, y+40); 177 170 fList->Add(fLabel1); 178 171 fList->Add(fLabel2); 179 fList->Add(fLabel3); 180 /* 181 l = new TGLabel(f, "Offset-Zd:"); 182 l->Move(x-60, y+102); 172 173 l = new TGLabel(f, "Ra (estimated):"); 174 l->Move(x-60, y+57+23); 183 175 fList->Add(l); 184 176 185 l = new TGLabel(f, " Offset-Az:");186 l->Move(x-60, y+ 119);177 l = new TGLabel(f, "Ra (nominal):"); 178 l->Move(x-60, y+57+40); 187 179 fList->Add(l); 188 180 189 fOffsetZd = new TGLabel(f, "000000000"); 190 fOffsetAz = new TGLabel(f, "000000000"); 191 fOffsetZd->SetTextJustify(kTextRight); 192 fOffsetAz->SetTextJustify(kTextRight); 193 fOffsetZd->Move(x+15, y+102); 194 fOffsetAz->Move(x+15, y+119); 195 fList->Add(fOffsetZd); 196 fList->Add(fOffsetAz); 197 */ 198 l = new TGLabel(f, "Ra (estimated):"); 199 l->Move(x-60, y+142-20); 181 l = new TGLabel(f, "Dec (estimated):"); 182 l->Move(x-60, y+57+40+23); 200 183 fList->Add(l); 201 184 202 l = new TGLabel(f, " Ra(nominal):");203 l->Move(x-60, y+ 159-20);185 l = new TGLabel(f, "Dec (nominal):"); 186 l->Move(x-60, y+57+40+40); 204 187 fList->Add(l); 205 188 206 l = new TGLabel(f, " Dec (estimated):");207 l->Move(x-60, y+ 182-20);189 l = new TGLabel(f, "Zd (nominal):"); 190 l->Move(x-60, y+57+80+23); 208 191 fList->Add(l); 209 192 210 l = new TGLabel(f, "Dec (nominal):");211 l->Move(x-60, y+199-20);212 fList->Add(l);213 214 l = new TGLabel(f, "Zd (nominal):");215 l->Move(x-60, y+222);216 fList->Add(l);217 218 193 l = new TGLabel(f, "Az (nominal):"); 219 l->Move(x-60, y+ 239);194 l->Move(x-60, y+57+80+40); 220 195 fList->Add(l); 221 196 … … 232 207 fZdSoll->SetTextJustify(kTextRight); 233 208 fAzSoll->SetTextJustify(kTextRight); 234 fRaEst->Move(x+30, y+ 142-20);235 fRaSoll->Move(x+30, y+ 159-20);236 fDecEst->Move(x+30, y+ 182-20);237 fDecSoll->Move(x+30, y+ 199-20);238 fZdSoll->Move(x+30, y+ 222);239 fAzSoll->Move(x+30, y+ 239);209 fRaEst->Move(x+30, y+57+23); 210 fRaSoll->Move(x+30, y+57+40); 211 fDecEst->Move(x+30, y+57+40+23); 212 fDecSoll->Move(x+30, y+57+40+40); 213 fZdSoll->Move(x+30, y+57+80+23); 214 fAzSoll->Move(x+30, y+57+80+40); 240 215 fList->Add(fRaEst); 241 216 fList->Add(fDecEst); … … 251 226 fStopping = new TGLabel(f, "Stopping"); 252 227 fStopped = new TGLabel(f, "Stopped"); 253 fAvailMac1 = new TGLabel(f, "- MACS1 -"); 254 fAvailMac2 = new TGLabel(f, "- MACS2 -"); 255 //fAvailMac3 = new TGLabel(f, "- MAC3 -"); 256 fAvailSe1 = new TGLabel(f, "-SE/Zd1-"); 257 fAvailSe2 = new TGLabel(f, "-SE/Zd2-"); 258 fAvailSe3 = new TGLabel(f, "- SE/Az -"); 228 //fAvailDkc1 = new TGLabel(f, "- DKC/Zd -"); 229 //fAvailDkc2 = new TGLabel(f, "- DKC/Az -"); 230 fAvailTcp = new TGLabel(f, "- TCP/IP -"); 231 232 fDkcReady1 = new TGLabel(f, "bb"); 233 fDkcReady2 = new TGLabel(f, "bb"); 234 fDkcEmergency = new TGLabel(f, "Emergency"); 235 fDkcPcMode = new TGLabel(f, "PC mode"); 236 fDkcRF1 = new TGLabel(f, "AF"); 237 fDkcRF2 = new TGLabel(f, "AF"); 238 fDkcBrake = new TGLabel(f, "Zd Brake"); 239 fDkcPower = new TGLabel(f, "Power on"); 240 241 fMsgAz = new TGLabel(f, " xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"); 242 fMsgZd = new TGLabel(f, " xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"); 259 243 260 244 ULong_t color; … … 264 248 gClient->GetColorByName("Red", color); 265 249 fError->SetBackgroundColor(color); 266 fAvailMac1->SetBackgroundColor(color); 267 fAvailMac2->SetBackgroundColor(color); 268 //fAvailMac3->SetBackgroundColor(color); 269 fAvailSe1->SetBackgroundColor(color); 270 fAvailSe2->SetBackgroundColor(color); 271 fAvailSe3->SetBackgroundColor(color); 250 fDkcReady1->SetBackgroundColor(color); 251 fDkcReady2->SetBackgroundColor(color); 252 fDkcEmergency->SetBackgroundColor(color); 253 fDkcPcMode->SetBackgroundColor(color); 254 fDkcRF1->SetBackgroundColor(color); 255 fDkcRF2->SetBackgroundColor(color); 256 fDkcBrake->SetBackgroundColor(color); 257 fDkcPower->SetBackgroundColor(color); 258 fAvailTcp->SetBackgroundColor(color); 272 259 gClient->GetColorByName("LightBlue", color); 273 260 fMoving->SetBackgroundColor(color); … … 279 266 fStopped->SetBackgroundColor(color); 280 267 281 fArmed ->MoveResize(10, 25, 70, 20); 282 fError ->MoveResize(10, 25+25, 70, 20); 283 fMoving ->MoveResize(10, 25+25+20, 70, 20); 284 fTracking->MoveResize(10, 25+25+40, 70, 20); 285 fStopping->MoveResize(10, 25+25+60, 70, 20); 286 fStopped ->MoveResize(10, 25+25+80, 70, 20); 287 fAvailMac1->MoveResize(10, 25+25+120, 70, 20); 288 fAvailMac2->MoveResize(10, 25+25+140, 70, 20); 289 //fAvailMac3->Move(10, 25+160); 290 fAvailSe1->MoveResize(10, 25+25+200, 70, 20); 291 fAvailSe2->MoveResize(10, 25+25+220, 70, 20); 292 fAvailSe3->MoveResize(10, 25+25+180, 70, 20); 268 gClient->GetColorByName("White", color); 269 fMsgAz->SetBackgroundColor(color); 270 fMsgZd->SetBackgroundColor(color); 271 272 fArmed ->MoveResize(10, 20, 70, 20); 273 fError ->MoveResize(10, 20+25, 70, 20); 274 fMoving ->MoveResize(10, 20+25+20, 70, 20); 275 fTracking->MoveResize(10, 20+25+40, 70, 20); 276 fStopping->MoveResize(10, 20+25+60, 70, 20); 277 fStopped ->MoveResize(10, 20+25+80, 70, 20); 278 279 fAvailTcp ->MoveResize( 10, 80+20+102, 75, 20); 280 281 fDkcEmergency->MoveResize( 10, 80+20+124, 75, 20); 282 fDkcPcMode ->MoveResize( 89, 80+20+124, 75, 20); 283 fDkcPower ->MoveResize(168, 80+20+124, 75, 20); 284 fDkcBrake ->MoveResize(247, 80+20+124, 75, 20); 285 286 fDkcReady1->MoveResize( 10, 248+2, 16, 16); 287 fDkcReady2->MoveResize( 10, 268+0, 16, 16); 288 fDkcRF1 ->MoveResize( 10+18, 248+2, 18, 16); 289 fDkcRF2 ->MoveResize( 10+18, 268+0, 18, 16); 290 291 fMsgAz->MoveResize(10+38, 248+2, 310-34, 16); // x-95 292 fMsgZd->MoveResize(10+38, 268+0, 310-34, 16); // x-95 293 294 fMsgAz->SetTextJustify(kTextLeft); 295 fMsgZd->SetTextJustify(kTextLeft); 293 296 294 297 fList->Add(fArmed); … … 298 301 fList->Add(fStopping); 299 302 fList->Add(fStopped); 300 fList->Add(fAvailMac1); 301 fList->Add(fAvailMac2); 302 //fList->Add(fAvailMac3); 303 fList->Add(fAvailSe1); 304 fList->Add(fAvailSe2); 305 fList->Add(fAvailSe3); 303 //fList->Add(fAvailDkc1); 304 //fList->Add(fAvailDkc2); 305 fList->Add(fAvailTcp); 306 307 fList->Add(fDkcReady1 ); 308 fList->Add(fDkcReady2 ); 309 fList->Add(fDkcEmergency); 310 fList->Add(fDkcPcMode ); 311 fList->Add(fDkcRF1 ); 312 fList->Add(fDkcRF2 ); 313 fList->Add(fDkcBrake ); 314 fList->Add(fDkcPower ); 315 316 fList->Add(fMsgZd); 317 fList->Add(fMsgAz); 306 318 } 307 319 … … 716 728 } 717 729 718 MGCosy::MGCosy(MObservatory::LocationName_t key, MsgQueue *q , const TGWindow *p, UInt_t w, UInt_t h)719 : TGMainFrame( p, w, h), fObservatory(key), fQueue(q)730 MGCosy::MGCosy(MObservatory::LocationName_t key, MsgQueue *q) 731 : TGMainFrame(gClient->GetRoot(), 1, 1), fObservatory(key), fQueue(q) 720 732 { 721 733 // This means that all objects added with AddFrame are deleted … … 806 818 CreateLabel(frame); 807 819 820 808 821 // 809 822 // Map the window, set up the layout, etc. 810 823 // 811 824 const Int_t ww = 1010; 812 const Int_t hh = 700;825 const Int_t hh = 680; 813 826 SetWMSizeHints(ww, hh, ww, hh, 1, 1); // set the smallest and biggest size of the Main frame 814 827 … … 1038 1051 } 1039 1052 1040 void MGCosy::Update(ZdAz pos, ZdAz acc, ZdAz vel, /*ZdAz off,*/ RaDec radec,1041 ZdAz soll, UInt_t stat, UInt_t stat2, Bool_t armed)1053 void MGCosy::Update(ZdAz pos, ZdAz acc, /*ZdAz vel, ZdAz off,*/ RaDec radec, 1054 ZdAz soll, UInt_t stat, UInt_t pdo3, UInt_t stat2, Bool_t armed, const TString &statzd, const TString &stataz) 1042 1055 { 1043 1056 // acc [rad] … … 1060 1073 EnableLabel(fAzSoll, stat&MDriveCom::kMoving); 1061 1074 1062 SetLabelColor(fAvailMac1, stat2&0x01); 1063 SetLabelColor(fAvailMac2, stat2&0x02); 1064 //SetLabelColor(fAvailMac3, stat2&0x04); 1065 SetLabelColor(fAvailSe1, stat2&0x08); 1066 SetLabelColor(fAvailSe2, stat2&0x10); 1067 SetLabelColor(fAvailSe3, stat2&0x20); 1068 1069 EnableLabel(fArmed, armed);//stat2&0x40); 1075 SetLabelColor(fAvailTcp, stat2); 1076 1077 if (!stat2) 1078 pdo3 = 0; 1079 1080 SetLabelColor(fDkcReady1, pdo3&0x0001); 1081 SetLabelColor(fDkcReady2, pdo3&0x0100); 1082 SetLabelColor(fDkcEmergency, (pdo3&0x0404)==0x0404); 1083 SetLabelColor(fDkcPcMode, (pdo3&0x1010)!=0x1010 && pdo3); 1084 SetLabelColor(fDkcRF1, pdo3&0x0020); 1085 SetLabelColor(fDkcRF2, pdo3&0x2000); 1086 SetLabelColor(fDkcBrake, (pdo3&0x4040)==0x4040); 1087 SetLabelColor(fDkcPower, (pdo3&0x8080)==0x8080); 1088 1089 EnableLabel(fArmed, armed); 1090 1091 fMsgZd->SetText(new TGString(TString(" Zd: ")+statzd)); 1092 fMsgAz->SetText(new TGString(TString(" Az: ")+stataz)); 1093 1070 1094 1071 1095 if (stat&MDriveCom::kTracking) -
trunk/MagicSoft/Cosy/gui/MGCosy.h
r8865 r9132 49 49 TGLabel *fLabel1; 50 50 TGLabel *fLabel2; 51 TGLabel *fLabel3;51 // TGLabel *fLabel3; 52 52 53 53 // TGLabel *fOffsetZd; … … 62 62 TGLabel *fZdSoll; 63 63 TGLabel *fAzSoll; 64 65 TGLabel *fMsgZd; 66 TGLabel *fMsgAz; 64 67 65 68 TGLabel *fUtc; … … 77 80 MGSkyPosition *fSkyPosition; 78 81 MGAccuracy *fAccuracy; 79 //MGAccuracyTime *fAccuracyTime;80 82 MGVelocity *fVelocity; 81 83 MGVelocity *fOffset; … … 93 95 TGLabel *fStopping; 94 96 TGLabel *fStopped; 95 TGLabel *fAvailMac1; 96 TGLabel *fAvailMac2; 97 TGLabel *fAvailMac3; 98 TGLabel *fAvailSe1; 99 TGLabel *fAvailSe2; 100 TGLabel *fAvailSe3; 97 //TGLabel *fAvailDkc1; 98 //TGLabel *fAvailDkc2; 99 TGLabel *fAvailTcp; 100 101 TGLabel *fDkcReady1; 102 TGLabel *fDkcReady2; 103 TGLabel *fDkcEmergency; 104 TGLabel *fDkcPcMode; 105 TGLabel *fDkcRF1; 106 TGLabel *fDkcRF2; 107 TGLabel *fDkcBrake; 108 TGLabel *fDkcPower; 101 109 102 110 TGTextView *fLog; … … 125 133 126 134 public: 127 MGCosy(MObservatory::LocationName_t key, MsgQueue *q , const TGWindow *p, UInt_t w, UInt_t h);135 MGCosy(MObservatory::LocationName_t key, MsgQueue *q); 128 136 ~MGCosy(); 129 137 … … 132 140 TGLabel *GetLabel1() const { return fLabel1; } 133 141 TGLabel *GetLabel2() const { return fLabel2; } 134 TGLabel *GetLabel3() const { return fLabel3; }142 //TGLabel *GetLabel3() const { return fLabel3; } 135 143 136 144 TGTextView *GetLog() const { return fLog; } 137 145 MGImage *GetImage() { return fImage; } 138 146 139 void Update(ZdAz pos, ZdAz acc, ZdAz vel, /*ZdAz off,*/ RaDec radec, ZdAz soll, UInt_t stat, UInt_t stat2, Bool_t armed);147 void Update(ZdAz pos, ZdAz acc, /*ZdAz vel, ZdAz off,*/ RaDec radec, ZdAz soll, UInt_t stat, UInt_t pdo3, UInt_t stat2, Bool_t armed, const TString &statzd, const TString &stataz); 140 148 void UpdateWeather(const MCeCoCom &com); 141 149 -
trunk/MagicSoft/Cosy/gui/MGSkyPosition.cc
r8852 r9132 74 74 InitArc(fSaturn, 1001, kYellow/*17*/, 16); 75 75 76 for (int i=0; i<1 4; i++)76 for (int i=0; i<15; i++) 77 77 { 78 78 fStars[i] = new TArc(0, 0, 1); … … 115 115 } 116 116 117 static const RaDec stars[1 4] =117 static const RaDec stars[15] = 118 118 { 119 119 // 32349 Sirius -1.44 1.45 2.64 0.009 A0m … … 138 138 (RaDec(MAstro::Hms2Rad( 5, 16, 0), MAstro::Dms2Rad( 46, 00, 0))), 139 139 (RaDec(MAstro::Hms2Rad( 7, 39, 0), MAstro::Dms2Rad( 5, 14, 0))), 140 (RaDec(MAstro::Hms2Rad( 5, 55, 0), MAstro::Dms2Rad( 7, 24, 0))) 140 (RaDec(MAstro::Hms2Rad( 5, 55, 0), MAstro::Dms2Rad( 7, 24, 0))), 141 // Polaris 2.02 142 (RaDec(MAstro::Hms2Rad( 2, 31, 49), MAstro::Dms2Rad( 89, 15, 51))), 141 143 }; 142 144 143 145 void MGSkyPosition::UpdateStars() 144 146 { 145 for (int i=0; i<1 4; i++)147 for (int i=0; i<15; i++) 146 148 SetDot(fStars[i], stars[i], 0); 147 149 } … … 370 372 fSlaStar->SetMjd(mjd); 371 373 374 UpdateStars(); 375 372 376 UpdatePlanet(kESun, fSun); 373 377 UpdatePlanet(kEMoon, fMoon); … … 377 381 UpdatePlanet(kESaturn, fSaturn); 378 382 379 UpdateStars();380 381 383 RaDec radec = fSlaStar->CalcRaDecFast(pos*TMath::DegToRad()); 382 384 UpdatePosition(radec, pos.Zd(), pos.Az()); -
trunk/MagicSoft/Cosy/gui/MGSkyPosition.h
r4076 r9132 35 35 TArc *fSaturn; 36 36 37 TArc *fStars[1 4];37 TArc *fStars[15]; 38 38 39 39 TArc *fSaturnRing;
Note:
See TracChangeset
for help on using the changeset viewer.