Changeset 1702 for trunk/MagicSoft/Cosy/gui
- Timestamp:
- 01/13/03 18:18:15 (22 years ago)
- Location:
- trunk/MagicSoft/Cosy/gui
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/gui/MGAccuracy.cc
r1701 r1702 178 178 179 179 InitCanvas(); 180 181 SetNoContextMenu(); 180 182 } 181 183 -
trunk/MagicSoft/Cosy/gui/MGCosy.cc
r1701 r1702 238 238 fList->Add(fAzSoll); 239 239 240 241 fError = new TGLabel(f, "Error"); 242 fMoving = new TGLabel(f, "Moving"); 243 fTracking = new TGLabel(f, "Tracking"); 244 fStopping = new TGLabel(f, "Stopping"); 245 fStopped = new TGLabel(f, "Stopped"); 246 240 fError = new TGLabel(f, "Error"); 241 fMoving = new TGLabel(f, "Moving"); 242 fTracking = new TGLabel(f, "Tracking"); 243 fStopping = new TGLabel(f, "Stopping"); 244 fStopped = new TGLabel(f, "Stopped"); 245 fAvailMac1 = new TGLabel(f, "- MAC1 -"); 246 fAvailMac2 = new TGLabel(f, "- MAC2 -"); 247 fAvailMac3 = new TGLabel(f, "- MAC3 -"); 248 fAvailSe1 = new TGLabel(f, "-SE/Zd1-"); 249 fAvailSe2 = new TGLabel(f, "-SE/Zd2-"); 250 fAvailSe3 = new TGLabel(f, "- SE/Az -"); 247 251 248 252 ULong_t color; … … 250 254 gClient->GetColorByName("Red", color); 251 255 fError->SetBackgroundColor(color); 256 fAvailMac1->SetBackgroundColor(color); 257 fAvailMac2->SetBackgroundColor(color); 258 fAvailMac3->SetBackgroundColor(color); 259 fAvailSe1->SetBackgroundColor(color); 260 fAvailSe2->SetBackgroundColor(color); 261 fAvailSe3->SetBackgroundColor(color); 252 262 gClient->GetColorByName("LightBlue", color); 253 263 fMoving->SetBackgroundColor(color); … … 264 274 fStopping->Move(10, 25+60); 265 275 fStopped ->Move(10, 25+80); 276 fAvailMac1->Move(10, 25+120); 277 fAvailMac2->Move(10, 25+140); 278 fAvailMac3->Move(10, 25+160); 279 fAvailSe1->Move(10, 25+180); 280 fAvailSe2->Move(10, 25+200); 281 fAvailSe3->Move(10, 25+220); 266 282 267 283 fError ->Resize(60, 20); … … 270 286 fStopping->Resize(60, 20); 271 287 fStopped ->Resize(60, 20); 288 fAvailMac1->Resize(60, 20); 289 fAvailMac2->Resize(60, 20); 290 fAvailMac3->Resize(60, 20); 291 fAvailSe1->Resize(60, 20); 292 fAvailSe2->Resize(60, 20); 293 fAvailSe3->Resize(60, 20); 272 294 273 295 fList->Add(fError); … … 276 298 fList->Add(fStopping); 277 299 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); 278 306 } 279 307 … … 679 707 cout << "MGCosy::~MGCosy done." << endl; 680 708 } 709 710 void MGCosy::SetLabelColor(TGLabel *label, Bool_t col) 711 { 712 ULong_t red, green; 713 714 gClient->GetColorByName("Red", red); 715 gClient->GetColorByName("Green", green); 716 717 if (col && label->TestBit(BIT(14))) 718 return; 719 720 if (!col && !label->TestBit(BIT(14))) 721 return; 722 723 col ? label->SetBit(BIT(14)) : label->ResetBit(BIT(14)); 724 725 label->UnmapWindow(); 726 label->SetBackgroundColor(col ? green : red); 727 label->MapWindow(); 728 } 729 681 730 // ====================================================================== 682 731 void MGCosy::EnableLabel(TGLabel *label, Bool_t stat) … … 823 872 824 873 void MGCosy::Update(ZdAz pos, ZdAz acc, ZdAz vel, ZdAz off, RaDec radec, 825 ZdAz soll, UInt_t stat )874 ZdAz soll, UInt_t stat, UInt_t stat2) 826 875 { 827 876 double mjd = UpdateTime(); … … 848 897 EnableLabel(fZdSoll, stat&kMoving); 849 898 EnableLabel(fAzSoll, stat&kMoving); 899 900 SetLabelColor(fAvailMac1, stat2&0x01); 901 SetLabelColor(fAvailMac2, stat2&0x02); 902 SetLabelColor(fAvailMac3, stat2&0x04); 903 SetLabelColor(fAvailSe1, stat2&0x08); 904 SetLabelColor(fAvailSe2, stat2&0x10); 905 SetLabelColor(fAvailSe3, stat2&0x20); 850 906 851 907 stat&kTracking ? fAccuracy->MapWindow() : fAccuracy->UnmapWindow(); -
trunk/MagicSoft/Cosy/gui/MGCosy.h
r1701 r1702 77 77 TGLabel *fStopping; 78 78 TGLabel *fStopped; 79 TGLabel *fAvailMac1; 80 TGLabel *fAvailMac2; 81 TGLabel *fAvailMac3; 82 TGLabel *fAvailSe1; 83 TGLabel *fAvailSe2; 84 TGLabel *fAvailSe3; 79 85 80 86 TGListBox *fLog; … … 91 97 92 98 void EnableLabel(TGLabel *label, Bool_t stat); 99 void SetLabelColor(TGLabel *label, Bool_t col); 93 100 void UpdateOffset(ZdAz &off); 94 101 void UpdateZdAz(ZdAz &off); … … 108 115 TGListBox *GetLog() const { return fLog; } 109 116 110 void Update(ZdAz pos, ZdAz acc, ZdAz vel, ZdAz off, RaDec radec, ZdAz soll, UInt_t stat );117 void Update(ZdAz pos, ZdAz acc, ZdAz vel, ZdAz off, RaDec radec, ZdAz soll, UInt_t stat, UInt_t stat2); 111 118 112 119 Bool_t ProcessMessage(Long_t msg, Long_t mp1, Long_t mp2); -
trunk/MagicSoft/Cosy/gui/MGEmbeddedCanvas.cc
r1690 r1702 52 52 } 53 53 54 // ------------------------------------------------------------------------ 55 // 56 // Map the subwindows, resize to its quadratic size, map the window itself 57 // and set it to Non-Editable. 58 // 54 59 void MGEmbeddedCanvas::InitCanvas() 55 60 { … … 71 76 // X11 Pixmap error) Update hangs the Gui system. 72 77 // 73 // Fixed: Using root 3.01/06 and doing the update from within the78 // Fixed: By using root 3.01/06 and doing the update from within the 74 79 // mainthread. 75 80 // … … 80 85 fModified = kFALSE; 81 86 } 87 88 // ------------------------------------------------------------------------ 89 // 90 // Set's the kNoContextMenu bit for all primitives in the embedded canvas 91 // and the canvas itself, so that no context menu is displayed. 92 // 93 void MGEmbeddedCanvas::SetNoContextMenu() 94 { 95 TList &list = *fCanvas->GetListOfPrimitives(); 96 list.ForEach(TObject, SetBit)(kNoContextMenu); 97 98 fCanvas->SetBit(kNoContextMenu); 99 } -
trunk/MagicSoft/Cosy/gui/MGEmbeddedCanvas.h
r1111 r1702 41 41 void SetModified() { fModified = kTRUE; } 42 42 43 void SetNoContextMenu(); 44 43 45 ClassDef(MGEmbeddedCanvas, 0) 44 46 }; -
trunk/MagicSoft/Cosy/gui/MGSkyPosition.cc
r1690 r1702 177 177 InitText(); 178 178 InitCanvas(); 179 SetNoContextMenu(); 179 180 } 180 181 -
trunk/MagicSoft/Cosy/gui/MGVelocity.cc
r1701 r1702 188 188 189 189 InitCanvas(); 190 191 SetNoContextMenu(); 190 192 } 191 193
Note:
See TracChangeset
for help on using the changeset viewer.