Changeset 4104 for trunk/MagicSoft/Cosy/gui
- Timestamp:
- 05/20/04 04:42:48 (20 years ago)
- Location:
- trunk/MagicSoft/Cosy/gui
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/gui/GuiLinkDef.h
r2278 r4104 4 4 #pragma link off all classes; 5 5 #pragma link off all functions; 6 7 #pragma link C++ class MGAccuracy+;8 6 9 7 #pragma link C++ class MGCoordinate+; … … 14 12 #pragma link C++ class MGImage+; 15 13 14 #pragma link C++ class MGAccuracy+; 16 15 #pragma link C++ class MGSkyPosition+; 17 #pragma link C++ class MGVelocity+;18 16 19 17 #pragma link C++ class MGCosy+; -
trunk/MagicSoft/Cosy/gui/MGCosy.cc
r2615 r4104 24 24 #include "MCosy.h" 25 25 #include "MTime.h" 26 #include "MString.h" 26 27 #include "MAstro.h" 27 28 #include "MGList.h" 28 29 #include "MDriveCom.h" 30 #include "MGImage.h" 29 31 #include "MGAccuracy.h" 32 //#include "MGAccuracyTime.h" 30 33 #include "MGCoordinates.h" 31 34 #include "MGSkyPosition.h" … … 161 164 fList->Add(l); 162 165 166 fWeather = new TGLabel(f, ""); 167 fWeather->MoveResize(10, y+280, 280, 16); 168 fList->Add(fWeather); 169 163 170 fLabel1 = new TGLabel(f, "00000"); // Max: 16384 164 171 fLabel2 = new TGLabel(f, "00000"); … … 733 740 cout << "MGCosy: Creating MGVelocity" << endl; 734 741 #endif 735 fVelocity = new MGVelocity(f2, "Velocity [\"/min]", 300); 736 // fOffset = new MGVelocity (f, "Offset se-re [']", 300); 742 743 fImage = new MGImage(f2, 768/2-1, 576/2-1, kRaisedFrame); 744 //fVelocity = new MGVelocity(f2, "Velocity [U_{mot}/min]", 300); 745 // fOffset = new MGVelocity (f, "Offset se-re [']", 300); 746 #ifdef DEBUG 747 cout << "MGCosy: Creating MGVelocityTime" << endl; 748 #endif 749 // fAccuracyTime = new MGAccuracyTime(f2, 300); 737 750 738 751 fList->Add(fSkyPosition); 739 752 fList->Add(fAccuracy); 740 fList->Add(fVelocity); 741 // fList->Add(fOffset); 753 // fList->Add(fAccuracyTime); 754 // fList->Add(fVelocity); 755 // fList->Add(fOffset); 756 fList->Add(fImage); 742 757 743 758 #ifdef DEBUG … … 757 772 TGLayoutHints *hints1 = new TGLayoutHints(kLHintsNormal | kLHintsExpandX|kLHintsExpandY, 6, 6, 6, 3); 758 773 TGLayoutHints *hints2 = new TGLayoutHints(kLHintsNormal | kLHintsExpandX|kLHintsExpandY, 6, 6, 3, 6); 759 TGLayoutHints *hints1a = new TGLayoutHints(kLHintsLeft | kLHintsTop |kLHintsExpandX|kLHintsExpandY); 760 TGLayoutHints *hints2a = new TGLayoutHints(kLHintsCenterY | kLHintsTop |kLHintsExpandX|kLHintsExpandY, 6, 6); 761 TGLayoutHints *hints3a = new TGLayoutHints(kLHintsRight | kLHintsTop |kLHintsExpandX|kLHintsExpandY); 762 TGLayoutHints *hints1b = new TGLayoutHints(kLHintsLeft | kLHintsBottom|kLHintsExpandX|kLHintsExpandY); 763 TGLayoutHints *hints2b = new TGLayoutHints(kLHintsCenterY | kLHintsBottom|kLHintsExpandX|kLHintsExpandY, 6, 6); 764 TGLayoutHints *hints3b = new TGLayoutHints(kLHintsRight | kLHintsBottom|kLHintsExpandX|kLHintsExpandY); 774 775 TGLayoutHints *hints1a = new TGLayoutHints(kLHintsLeft | kLHintsCenterY|kLHintsExpandX|kLHintsExpandY); 776 TGLayoutHints *hints2a = new TGLayoutHints(kLHintsCenterX | kLHintsCenterY|kLHintsExpandX|kLHintsExpandY, 6, 6); 777 TGLayoutHints *hints3a = new TGLayoutHints(kLHintsRight | kLHintsCenterY|kLHintsExpandX|kLHintsExpandY); 778 TGLayoutHints *hints1b = new TGLayoutHints(kLHintsLeft | kLHintsCenterY|kLHintsExpandX|kLHintsExpandY); 779 TGLayoutHints *hints2b = new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 6, 6); 780 TGLayoutHints *hints3b = new TGLayoutHints(kLHintsRight | kLHintsCenterY|kLHintsExpandX|kLHintsExpandY); 765 781 766 782 fList->Add(hints1); … … 779 795 780 796 // Layout upper frame 781 f2->AddFrame(frame, hints1b); 782 f2->AddFrame(fVelocity, hints2b); 783 f2->AddFrame(fLog, hints3b); 797 f2->AddFrame(frame, hints1b); 798 f2->AddFrame(fImage, hints2b); 799 //f2->AddFrame(fVelocity, hints2b); 800 //f2->AddFrame(fAccuracyTime, hints2b); 801 f2->AddFrame(fLog, hints3b); 784 802 785 803 // Layout window … … 802 820 cout << "MGCosy: Setting Size" << endl; 803 821 #endif 804 const Int_t w = 940;805 const Int_t h = 660;822 const Int_t w = 1010; 823 const Int_t h = 700; 806 824 SetWMSizeHints(w, h, 1280, 900, 10, 10); // set the smallest and biggest size of the Main frame 807 825 … … 1013 1031 if (oldmjd != (ULong_t)(1000000*mjd)) 1014 1032 { 1015 fMjd->SetText(new TGString(Form("%12.6f", mjd))); 1033 MString str; 1034 str.Print("%12.6f", mjd); 1035 fMjd->SetText(new TGString(str)); 1016 1036 oldmjd = (ULong_t)(1000000*mjd); 1017 1037 } … … 1052 1072 { 1053 1073 fAccuracy->Update(pos, acc); 1054 fVelocity->Update(vel); 1074 // fAccuracyTime->Update(pos, acc); 1075 // fVelocity->Update(vel); 1055 1076 fAccuracy->MapWindow(); 1056 fVelocity->MapWindow(); 1077 // fAccuracyTime->MapWindow(); 1078 // fVelocity->MapWindow(); 1057 1079 } 1058 1080 else 1059 1081 { 1060 1082 fAccuracy->UnmapWindow(); 1061 fVelocity->UnmapWindow(); 1083 // fAccuracyTime->UnmapWindow(); 1084 // fVelocity->UnmapWindow(); 1062 1085 } 1063 1086 // stat&kTracking ? fOffset->MapWindow() : fOffset->UnmapWindow(); 1064 1087 1065 /* 1066 if (fLog->TestBit(kHasChanged)) 1067 { 1068 fLog->MapSubwindows(); 1069 fLog->Layout(); 1070 fLog->ResetBit(kHasChanged); 1071 }*/ 1072 } 1073 // ====================================================================== 1088 //unsigned char empty[(768/2-1)*(576/2-1)]; 1089 //fImage->DrawImg(empty); 1090 //fImage->DoRedraw(); 1091 1092 // if (IsMapped()) 1093 // fImage->DoRedraw(); 1094 } 1095 1096 void MGCosy::UpdateWeather(const MCeCoCom &com) 1097 { 1098 ULong_t color; 1099 switch (com.GetWeatherStatus()) 1100 { 1101 case 0: 1102 color=TGFrame::GetDefaultFrameBackground(); 1103 break; 1104 case 1: 1105 gClient->GetColorByName("Yellow", color); 1106 break; 1107 case 2: 1108 gClient->GetColorByName("Orange", color); 1109 break; 1110 default: 1111 gClient->GetColorByName("Red", color); 1112 break; 1113 } 1114 1115 if (com.HasAlarm()) 1116 { 1117 static int i=0; 1118 if ((i++/4)%2==0) 1119 color = TGFrame::GetDefaultFrameBackground(); 1120 } 1121 1122 const TString old(fWeather->GetText()->GetString()); 1123 const TString txt(com.GetWeather()); 1124 1125 // Color is only updated if the text has changed 1126 if (old!=txt || color!=fWeather->GetBackground()) 1127 fWeather->SetText(txt); 1128 1129 if (color!=fWeather->GetBackground()) 1130 fWeather->SetBackgroundColor(color); 1131 } 1074 1132 1075 1133 void MGCosy::CloseWindow() -
trunk/MagicSoft/Cosy/gui/MGCosy.h
r2280 r4104 28 28 class RaDec; 29 29 class MsgQueue; 30 class MCeCoCom; 30 31 31 32 class MGList; 32 33 class MGImage; 33 34 class MGAccuracy; 35 class MGAccuracyTime; 34 36 class MGVelocity; 35 37 class MGCoordinates; … … 65 67 TGLabel *fMjd; 66 68 69 TGLabel *fWeather; 70 67 71 MStarList fPreDefList; 68 72 MStarList fStarList; … … 72 76 MGCoordinates *fCCalib; 73 77 74 MGSkyPosition *fSkyPosition; 75 MGAccuracy *fAccuracy; 76 MGVelocity *fVelocity; 77 MGVelocity *fOffset; 78 MGSkyPosition *fSkyPosition; 79 MGAccuracy *fAccuracy; 80 //MGAccuracyTime *fAccuracyTime; 81 MGVelocity *fVelocity; 82 MGVelocity *fOffset; 83 84 MGImage *fImage; 78 85 79 86 MsgQueue *fQueue; … … 128 135 129 136 TGTextView *GetLog() const { return fLog; } 137 MGImage *GetImage() { return fImage; } 130 138 131 139 void Update(ZdAz pos, ZdAz acc, ZdAz vel, /*ZdAz off,*/ RaDec radec, ZdAz soll, UInt_t stat, UInt_t stat2); 140 void UpdateWeather(const MCeCoCom &com); 132 141 133 142 Bool_t ProcessMessage(Long_t msg, Long_t mp1, Long_t mp2); -
trunk/MagicSoft/Cosy/gui/Makefile
r2384 r4104 38 38 MGEmbeddedCanvas.cc \ 39 39 MGAccuracy.cc \ 40 MGVelocity.cc \ 41 MGSkyPosition.cc \ 42 MGMenu.cc 40 MGSkyPosition.cc 43 41 44 42 SRCS = $(SRCFILES)
Note:
See TracChangeset
for help on using the changeset viewer.