Changeset 7790 for trunk/MagicSoft/Cosy/gui
- Timestamp:
- 07/14/06 13:19:54 (18 years ago)
- Location:
- trunk/MagicSoft/Cosy/gui
- Files:
-
- 2 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/gui/GuiLinkDef.h
r4865 r7790 15 15 #pragma link C++ class MGSkyPosition+; 16 16 #pragma link C++ class MGStarg+; 17 #pragma link C++ class MGNumStars+; 17 18 18 19 #pragma link C++ class MGCosy+; -
trunk/MagicSoft/Cosy/gui/MGAccuracy.cc
r7788 r7790 1 //2 // This File contains the definition of the MGCoordinates-class3 //4 // Author: Thomas Bretz5 // Version: V1.0 (1-8-2000)6 7 1 #include "MGAccuracy.h" 8 2 … … 13 7 #include <TText.h> 14 8 #include <TWbox.h> 15 #include <TList.h>16 9 #include <TGaxis.h> 17 10 #include <TGraph.h> … … 24 17 ClassImp(MGAccuracy); 25 18 26 void MGAccuracy::Draw CoordinateSystem()27 { 28 TWbox box;29 box.DrawWbox(-145*2, 145*2, -15*2, 120*2, 18, 2, 1);19 void MGAccuracy::DrawText(const char *c1, const char *c2, const char *c3, const char*txt) 20 { 21 fCanvas->SetEditable(kTRUE); 22 fCanvas->cd(); 30 23 31 24 TText text; 32 25 text.SetTextAlign(22); // centered, centered (s.TAttText) 33 text.DrawText(-80*2, 132.5*2, "Ctrl Deviation [min]"); 34 26 text.DrawText(-150, 265, txt); 27 28 text.SetTextAlign(11); // left, bottom (s.TAttText) 29 text.SetTextColor(3); 30 text.DrawText(220, -220, c1); 31 32 text.SetTextColor(5); 33 text.DrawText(220, -250, c2); 34 35 text.SetTextColor(2); 36 text.DrawText(220, -280, c3); 37 38 fCanvas->SetEditable(kFALSE); 39 } 40 41 void MGAccuracy::DrawCircles(Double_t rad) 42 { 43 fCanvas->SetEditable(kTRUE); 44 fCanvas->cd(); 35 45 36 46 TArc arc; … … 39 49 arc.SetLineColor(3); // green 40 50 arc.SetLineStyle(2); // dashed (s. TAttLine) 41 arc.DrawArc(0, 0, 79.1/2.);// 0.5se51 arc.DrawArc(0, 0, rad/2.); // 0.5se 42 52 43 53 arc.SetLineColor(5); // yellow 44 arc.DrawArc(0, 0, 79.1); // 1.0se54 arc.DrawArc(0, 0, rad); // 1.0se 45 55 46 56 arc.SetLineColor(2); // red 47 arc.DrawArc(0, 0, 79.1*2.); // 2.0se 48 49 50 text.SetTextAlign(11); // left, bottom (s.TAttText) 51 text.SetTextColor(3); 52 text.DrawText(220, -220, "0.5se"); 53 54 text.SetTextColor(5); 55 text.DrawText(220, -250, "1.0se"); 56 57 text.SetTextColor(2); 58 text.DrawText(220, -280, "2.0se"); 59 60 61 TLine line; 62 line.DrawLine(-65*4, 0, 65*4, 0); 63 line.DrawLine( 0, -65*4, 0, 65*4); 57 arc.DrawArc(0, 0, rad*2.); // 2.0se 58 59 fCanvas->SetEditable(kFALSE); 60 } 61 62 void MGAccuracy::DrawCoordinateSystem() 63 { 64 TWbox box; 65 box.DrawWbox(-290, 290, -10, 240, 18, 2, 1); 66 67 // TLine line; 68 // line.DrawLine(-65*4, 0, 65*4, 0); 69 // line.DrawLine( 0, -65*4, 0, 65*4); 64 70 65 71 // … … 122 128 123 129 MGAccuracy::MGAccuracy(const TGWindow* p, const UInt_t w) 124 : MGEmbeddedCanvas("Accuracy", p, w, 300) 130 : MGEmbeddedCanvas("Accuracy", p, w, 300), fColorScale(360*60/16384) 125 131 { 126 132 // FIXME: Overload MapWindow in newer Root versions to remove … … 133 139 fGraph->Draw("LP"); 134 140 fList->Add(fGraph); 135 //fGraph->SetNameTitle("AccVsT", "Accuracy vs Min of Time");136 //fGraph->Draw("APL");137 //fGraph->SetMarkerSize(2);138 141 139 142 DrawCoordinateSystem(); … … 153 156 MGAccuracy::~MGAccuracy() 154 157 { 155 // cout << "MGAccuracy destroyed." << endl;156 158 } 157 159 … … 172 174 173 175 fBar->SetY2(dist*60); // [sec] 174 if (dist *16384<1*360*60)176 if (dist<fColorScale) //1*360*60/16384 175 177 fBar->SetLineColor(kGreen); 176 178 else 177 if (dist *16384<2*360*60)179 if (dist<2*fColorScale) //2*360*60/16384 178 180 fBar->SetLineColor(kYellow); 179 181 else … … 227 229 228 230 SetModified(); 229 230 //cout << "N1 == " << fGraph->GetN() << endl;231 232 //fGraph->GetHistogram()->SetXTitle("Time");233 //fGraph->GetHistogram()->SetYTitle("\\Delta [arcmin]");234 //fGraph->GetHistogram()->GetXaxis()->SetTimeFormat("%M %F1995-01-01 00:00:00");235 //fGraph->GetHistogram()->GetXaxis()->SetTimeDisplay(1);236 //fGraph->GetHistogram()->GetXaxis()->SetLabelSize(0.033);237 231 } 238 232 … … 248 242 { 249 243 // 250 // calculate actual time for planet positions251 // acc [deg]252 //253 244 // x["], y["] 254 245 // -
trunk/MagicSoft/Cosy/gui/MGAccuracy.h
r4076 r7790 1 #ifndef MGACCURACY_H2 #define MGACCURACY_H1 #ifndef COSY_MGAccuracy 2 #define COSY_MGAccuracy 3 3 4 4 // … … 20 20 class MGAccuracy : public MGEmbeddedCanvas 21 21 { 22 protected: 22 23 TLine *fLin1; 23 24 TLine *fLin2; … … 30 31 31 32 Double_t fTime; 33 Double_t fColorScale; 32 34 33 35 void DrawCoordinateSystem(); … … 46 48 ~MGAccuracy(); 47 49 50 void DrawText(const char *c1, const char *c2, const char *c3, const char *txt); 51 void DrawCircles(Double_t rad=79.1); 52 53 void SetColorScale(Double_t scale=1) { fColorScale=scale; } 54 48 55 void Update(ZdAz &pos, ZdAz &acc); 49 56 … … 51 58 }; 52 59 53 #endif // MGSKYPOSITION_H60 #endif // COSY_MGAccuracy -
trunk/MagicSoft/Cosy/gui/MGCoordinate.cc
r7787 r7790 26 26 27 27 MGCoordinate::MGCoordinate(const TGWindow* p, const Int_t type=kETypeDeg, 28 const Bool_t flag, const char *txt,28 const Int_t flag, const char *txt, 29 29 const Int_t deg, const UInt_t min, const UInt_t sec) 30 : TGFrame(p, 119, flag ?76:46, kSunkenFrame|kFixedSize), fSign('+'), fDeg(deg), fMin(min), fSec(sec)30 : TGFrame(p, 119, flag==1?76:46-(TString(txt).IsNull()?23:0), kSunkenFrame|kFixedSize), fSign('+'), fDeg(deg), fMin(min), fSec(sec), fLabel(0) 31 31 { 32 32 fList = new MGList; 33 33 34 const Int_t offset = TString(txt).IsNull() ? 23 : 0; 35 34 36 // p = pointer to MainFrame (not owner) 35 if (flag )37 if (flag==1) 36 38 { 37 39 fTextEntryDeg = new TGTextEntry(this, "****", IDM_kDeg); … … 41 43 // fTextEntryMin->SetAlignment(kTextCenterX); 42 44 // fTextEntrySec->SetAlignment(kTextCenterX); 43 fTextEntryDeg->Move( 7, 26 );44 fTextEntryMin->Move(47, 26 );45 fTextEntrySec->Move(81, 26 );45 fTextEntryDeg->Move( 7, 26-offset); 46 fTextEntryMin->Move(47, 26-offset); 47 fTextEntrySec->Move(81, 26-offset); 46 48 fTextEntryDeg->MapWindow(); 47 49 fTextEntryMin->MapWindow(); … … 56 58 } 57 59 58 const int ypos = flag?56:26;60 const int ypos = (flag==1?56:26)-offset; 59 61 60 62 fLabelDeg = new TGLabel(this, "****"); … … 78 80 Set(fLabelSec, fSec); 79 81 80 fLabel = new TGLabel(this, txt); 81 fLabel->SetTextJustify(kTextLeft); 82 fLabel->Move(4, 4); 83 fLabel->MapWindow(); 84 fList->Add(fLabel); 82 if (!TString(txt).IsNull()) 83 { 84 fLabel = new TGLabel(this, txt); 85 fLabel->SetTextJustify(kTextLeft); 86 fLabel->Move(4, 4); 87 fLabel->MapWindow(); 88 fList->Add(fLabel); 89 } 85 90 86 91 TGLabel *label; … … 90 95 const char *sec = type==kETypeDeg ? "\"" : "s"; 91 96 92 if (flag )97 if (flag==1) 93 98 { 94 99 label = new TGLabel(this, deg); 95 100 label->SetTextJustify(kTextLeft); 96 label->Move(37, 29 );101 label->Move(37, 29-offset); 97 102 label->MapWindow(); 98 103 fList->Add(label); … … 100 105 label = new TGLabel(this, min); 101 106 label->SetTextJustify(kTextLeft); 102 label->Move(71, 29 );107 label->Move(71, 29-offset); 103 108 label->MapWindow(); 104 109 fList->Add(label); … … 106 111 label = new TGLabel(this, sec); 107 112 label->SetTextJustify(kTextLeft); 108 label->Move(107, 29 );113 label->Move(107, 29-offset); 109 114 label->MapWindow(); 110 115 fList->Add(label); … … 146 151 void MGCoordinate::Print() 147 152 { 148 cout << fLabel->GetText()->GetString() << " " << fSign << fDeg << "\xb0 " << fMin << "' " << fSec << "\"" << endl; 153 if (fLabel) 154 cout << fLabel->GetText()->GetString() << " "; 155 cout << fSign << fDeg << "\xb0 " << fMin << "' " << fSec << "\"" << endl; 149 156 } 150 157 -
trunk/MagicSoft/Cosy/gui/MGCoordinate.h
r1531 r7790 1 #ifndef MGCOORDINATE_H2 #define MGCOORDINATE_H1 #ifndef COSY_MGCoordinate 2 #define COSY_MGCoordinate 3 3 4 4 // … … 49 49 public: 50 50 MGCoordinate(const TGWindow* p, const Int_t type=kETypeDeg, 51 const Bool_t flag=kTRUE, const char *txt="Coordinates:",51 const Int_t flag=1, const char *txt="Coordinates:", 52 52 const Int_t deg=0, const UInt_t min=0, const UInt_t sec=0); 53 53 ~MGCoordinate(); … … 63 63 }; 64 64 65 #endif // MGIMAGE_H65 #endif // COSY_MGCoordinates -
trunk/MagicSoft/Cosy/gui/MGCoordinates.cc
r1111 r7790 16 16 MGCoordinates::MGCoordinates(const TGWindow* p, 17 17 const Int_t type, 18 const Bool_t flag,18 const Int_t flag, 19 19 const Int_t deg1, const UInt_t min1, const UInt_t sec1, 20 20 const Int_t deg2, const UInt_t min2, const UInt_t sec2) … … 23 23 const Int_t t = type==kETypeZdAz ? kETypeDeg : kETypeH; 24 24 const char *txt1 = type==kETypeZdAz ? "Zenith Dist [\xb0]:" : "Right Ascension [h]:"; 25 const char *txt2 = type==kETypeZdAz ? "Azimuth [\xb0]:" : "Declination [\xb0]:";25 const char *txt2 = type==kETypeZdAz ? "Azimuth [\xb0]:" : "Declination [\xb0]:"; 26 26 27 27 // p = pointer to MainFrame (not owner) 28 fX = new MGCoordinate(this, t, flag, txt1, deg1, min1, sec1);28 fX = new MGCoordinate(this, t, flag, flag>1?"":txt1, deg1, min1, sec1); 29 29 fX->Move(0, 0); 30 30 31 fY = new MGCoordinate(this, kETypeDeg, flag, txt2, deg2, min2, sec2);31 fY = new MGCoordinate(this, kETypeDeg, flag, flag>1?"":txt2, deg2, min2, sec2); 32 32 fY->Move(125, 0); 33 33 -
trunk/MagicSoft/Cosy/gui/MGCoordinates.h
r1111 r7790 1 #ifndef MGCOORDINATES_H2 #define MGCOORDINATES_H1 #ifndef COSY_MGCoordinates 2 #define COSY_MGCoordinates 3 3 4 4 // … … 15 15 16 16 enum { 17 kETypeZdAz, 18 kETypeRaDec 17 kETypeZdAz = BIT(0), 18 kETypeRaDec= BIT(1), 19 kETypeNone = BIT(3) 19 20 }; 20 21 … … 28 29 public: 29 30 MGCoordinates(const TGWindow* p, const Int_t type=kETypeZdAz, 30 const Bool_t flag=kTRUE,31 const Int_t flag=1, 31 32 const Int_t deg1=0, const UInt_t min1=0, const UInt_t sec1=0, 32 33 const Int_t deg2=0, const UInt_t min2=0, const UInt_t sec2=0); … … 41 42 }; 42 43 43 #endif // MGIMAGE_H44 #endif // COSY_MGCoordinates -
trunk/MagicSoft/Cosy/gui/MGCosy.cc
r4104 r7790 247 247 fList->Add(fAzSoll); 248 248 249 fArmed = new TGLabel(f, "Armed"); 249 250 fError = new TGLabel(f, "Error"); 250 251 fMoving = new TGLabel(f, "Moving"); … … 261 262 ULong_t color; 262 263 264 gClient->GetColorByName("Magenta", color); 265 fArmed->SetBackgroundColor(color); 263 266 gClient->GetColorByName("Red", color); 264 267 fError->SetBackgroundColor(color); … … 278 281 fStopped->SetBackgroundColor(color); 279 282 280 fError ->MoveResize(10, 25, 60, 20); 281 fMoving ->MoveResize(10, 25+20, 60, 20); 282 fTracking->MoveResize(10, 25+40, 60, 20); 283 fStopping->MoveResize(10, 25+60, 60, 20); 284 fStopped ->MoveResize(10, 25+80, 60, 20); 285 fAvailMac1->MoveResize(10, 25+120, 60, 20); 286 fAvailMac2->MoveResize(10, 25+140, 60, 20); 283 fArmed ->MoveResize(10, 25, 60, 20); 284 fError ->MoveResize(10, 25+25, 60, 20); 285 fMoving ->MoveResize(10, 25+25+20, 60, 20); 286 fTracking->MoveResize(10, 25+25+40, 60, 20); 287 fStopping->MoveResize(10, 25+25+60, 60, 20); 288 fStopped ->MoveResize(10, 25+25+80, 60, 20); 289 fAvailMac1->MoveResize(10, 25+25+120, 60, 20); 290 fAvailMac2->MoveResize(10, 25+25+140, 60, 20); 287 291 //fAvailMac3->Move(10, 25+160); 288 fAvailSe1->MoveResize(10, 25+200, 60, 20); 289 fAvailSe2->MoveResize(10, 25+220, 60, 20); 290 fAvailSe3->MoveResize(10, 25+180, 60, 20); 291 292 fAvailSe1->MoveResize(10, 25+25+200, 60, 20); 293 fAvailSe2->MoveResize(10, 25+25+220, 60, 20); 294 fAvailSe3->MoveResize(10, 25+25+180, 60, 20); 295 296 fList->Add(fArmed); 292 297 fList->Add(fError); 293 298 fList->Add(fMoving); … … 737 742 #endif 738 743 fAccuracy = new MGAccuracy(f1, 300); 744 fAccuracy->DrawText("0.5se", "1.0se", "2.0se", "Ctrl Deviation [min]"); 745 fAccuracy->DrawCircles(); 739 746 #ifdef DEBUG 740 747 cout << "MGCosy: Creating MGVelocity" << endl; … … 822 829 const Int_t w = 1010; 823 830 const Int_t h = 700; 824 SetWMSizeHints(w, h, 1280, 900, 10, 10); // set the smallest and biggest size of the Main frame831 SetWMSizeHints(w, h, w, h, 1, 1); // set the smallest and biggest size of the Main frame 825 832 826 833 SetWindowName("Cosy Main Window"); … … 1068 1075 SetLabelColor(fAvailSe2, stat2&0x10); 1069 1076 SetLabelColor(fAvailSe3, stat2&0x20); 1077 1078 EnableLabel(fArmed, 1);//stat2&0x40); 1070 1079 1071 1080 if (stat&MDriveCom::kTracking) -
trunk/MagicSoft/Cosy/gui/MGCosy.h
r4104 r7790 88 88 TGTab *fTab; 89 89 90 TGLabel *fArmed; 90 91 TGLabel *fError; 91 92 TGLabel *fMoving; -
trunk/MagicSoft/Cosy/gui/MGStarg.cc
r7788 r7790 1 1 #include "MGStarg.h" 2 2 3 #include <iostream.h> // cout4 5 #include <TArc.h>6 #include <TLine.h>7 #include <TText.h>8 #include <TWbox.h>9 #include <TList.h>10 #include <TGaxis.h>11 #include <TGraph.h>12 3 #include <TCanvas.h> 13 4 14 5 #include <MHexagon.h> 15 6 16 #include "coord.h"17 #include "MTime.h"18 #include "MAstro.h"19 20 7 ClassImp(MGStarg); 21 8 22 void MGStarg::Draw CoordinateSystem()9 void MGStarg::DrawHexagon() 23 10 { 24 TWbox box; 25 box.DrawWbox(-145*2, 145*2, -15*2, 120*2, 18, 2, 1); 26 27 TText text; 28 text.SetTextAlign(22); // centered, centered (s.TAttText) 29 text.DrawText(-80*2, 132.5*2, "Misspointing [min]"); 11 fCanvas->SetEditable(kTRUE); 12 fCanvas->cd(); 30 13 31 14 MHexagon hex; 32 hex.SetFillColor(39);33 15 hex.SetFillStyle(4000); 34 16 hex.SetLineColor(17); 35 hex.DrawHexagon(0, 0,177.5*2);17 hex.DrawHexagon(0, 0, 177.5*2); 36 18 37 text.SetTextAlign(11); // left, bottom (s.TAttText) 38 text.SetTextColor(3); 39 text.DrawText(220, -220, "0.75'"); 40 41 text.SetTextColor(5); 42 text.DrawText(220, -250, "1.50'"); 43 44 text.SetTextColor(2); 45 text.DrawText(220, -280, "3.00'"); 46 47 48 TLine line; 49 line.DrawLine(-65*4, 0, 65*4, 0); 50 line.DrawLine( 0, -65*4, 0, 65*4); 51 52 // 53 // Can be replaced by TGaxis axe; in a later root version 54 // than 3.01/06. I talked to Rene 55 // 56 TGaxis *axe; 57 axe = new TGaxis(-60*4, 0, 60*4, 0, -4, 4, 30204, "+-N"); 58 axe->SetTitle("Az"); // \xb0 59 axe->SetBit(kCanDelete); 60 axe->Draw(); 61 62 axe = new TGaxis( 0, -60*4, 0, 60*4, -4, 4, 304, "+-N"); 63 axe->SetTitle("Zd"); // \xb0 64 axe->SetLabelOffset(-0.02); 65 axe->SetBit(kCanDelete); 66 axe->Draw(); 67 } 68 69 void MGStarg::InitText() 70 { 71 fTxt = new TText(280, 280, "0' / 0'"); 72 fTxt->SetTextAlign(33); // right, top 73 fTxt->SetTextColor(10); 74 fTxt->Draw(); 75 76 fList->Add(fTxt); 77 } 78 79 void MGStarg::InitBar() 80 { 81 fBar = new TLine(0, 0, 0, 0); 82 fBar->SetLineColor(kBlack); 83 fBar->SetLineStyle(1); 84 fBar->SetLineWidth(5); 85 fBar->Draw(); 86 87 fList->Add(fBar); 88 } 89 90 void MGStarg::InitCross() 91 { 92 fLin1 = new TLine(0, 0, 0, 0); 93 fLin2 = new TLine(0, 0, 0, 0); 94 95 fLin1->SetLineColor(10); // white (s. TAttFill) 96 fLin2->SetLineColor(10); // white 97 fLin1->SetLineStyle(1); // solid (s. TAttLine) 98 fLin2->SetLineStyle(1); 99 100 fLin1->SetLineWidth(2); 101 fLin2->SetLineWidth(2); 102 103 fLin1->Draw(); 104 fLin2->Draw(); 105 106 fList->Add(fLin1); 107 fList->Add(fLin2); 19 fCanvas->SetEditable(kFALSE); 108 20 } 109 21 110 22 MGStarg::MGStarg(const TGWindow* p, const UInt_t w) 111 : MG EmbeddedCanvas("Starg", p, w, 300)23 : MGAccuracy(p, w) 112 24 { 113 // FIXME: Overload MapWindow in newer Root versions to remove 114 // the contents of the graph! 115 fGraph = new TGraph; 116 fGraph->SetPoint(0, 0, 0); 117 fGraph->SetLineColor(kBlue); 118 fGraph->SetMarkerColor(kBlue); 119 fGraph->SetMarkerStyle(kFullDotMedium); 120 fGraph->Draw("LP"); 121 fList->Add(fGraph); 122 //fGraph->SetNameTitle("AccVsT", "Accuracy vs Min of Time"); 123 //fGraph->Draw("APL"); 124 //fGraph->SetMarkerSize(2); 125 126 DrawCoordinateSystem(); 127 128 InitText(); 129 InitCross(); 130 InitBar(); 131 132 InitCanvas(); 133 134 SetNoContextMenu(); 135 136 MTime t(-1); 137 fTime = t.GetAxisTime(); 25 SetColorScale(1.5); 138 26 } 139 140 MGStarg::~MGStarg()141 {142 // cout << "MGStarg destroyed." << endl;143 }144 145 // dist [deg]146 void MGStarg::UpdateText(Float_t dist)147 {148 dist *= 3600.; // [sec]149 150 int rs = (int)floor(fmod(dist, 60.));151 152 dist /= 60.; // [min]153 int rm = (int)dist;154 155 char txt[100];156 rm ? sprintf(txt, "%d'%02d\"", rm, rs) : sprintf(txt, "%d\"", rs);157 158 fTxt->SetText(fTxt->GetX(), fTxt->GetY(), txt);159 160 fBar->SetY2(dist*60); // [sec]161 if (dist<1.5)162 fBar->SetLineColor(kGreen);163 else164 if (dist<3)165 fBar->SetLineColor(kYellow);166 else167 fBar->SetLineColor(kRed);168 169 SetModified();170 }171 172 // dist [deg]173 void MGStarg::UpdateGraph(Float_t dist)174 {175 MTime t(-1);176 const Double_t dtime = t.GetAxisTime()-fTime; // range [-0.5h, 0h]177 178 dist *= 60; // min179 180 static int odist = -1;181 if (odist==(int)(dist*10*60) && dtime<10)182 return;183 184 odist = (int)(dist*10*60);185 186 fGraph->SetPoint(fGraph->GetN(), dtime, dist*60);187 188 const Double_t ntime = dtime;189 for (int i=0; i<fGraph->GetN(); i++)190 {191 Double_t x, y;192 fGraph->GetPoint(i, x, y);193 fGraph->SetPoint(i, x-ntime, y);194 //cout << i << ": " << x-ntime << " / " << y << endl;195 }196 while (fGraph->GetN()>0)197 {198 Double_t x, y;199 fGraph->GetPoint(0, x, y);200 201 if (x==-ntime && y==0)202 {203 fGraph->RemovePoint(0);204 continue;205 }206 207 if (x>-4.75*60)208 break;209 210 fGraph->RemovePoint(0);211 }212 213 fTime = t.GetAxisTime();214 215 SetModified();216 217 }218 219 void MGStarg::Update(Float_t pzd, Float_t azd, Float_t aaz)220 {221 const double dist = MAstro::GetDevAbs(pzd, azd, aaz);222 223 UpdateText(dist);224 UpdateGraph(dist);225 }226 227 void MGStarg::UpdateCross(Float_t x, Float_t y)228 {229 //230 // x["], y["]231 //232 static int X = ~0;233 static int Y = ~0;234 235 int pixx = (int)(x/fPix); // [pix]236 int pixy = (int)(y/fPix); // [pix]237 238 if (X==pixx && Y==pixy)239 return;240 241 X = pixx;242 Y = pixy;243 244 fLin1->SetX1(x-5.);245 fLin1->SetX2(x+5.);246 247 fLin2->SetX1(x-5.);248 fLin2->SetX2(x+5.);249 250 fLin1->SetY1(y-5.);251 fLin1->SetY2(y+5.);252 253 fLin2->SetY1(y+5.);254 fLin2->SetY2(y-5.);255 256 SetModified();257 }258 259 void MGStarg::Update(ZdAz &pos, ZdAz &dev)260 {261 // Estimate the distance in az direction on the camera plane262 const double daz = MAstro::GetDevAbs(pos.Zd(), 0, dev.Az())*3600.;263 264 //cout << "--> S: " << dev.Az()*60 << " " << dev.Zd()*60. << endl;265 266 UpdateCross(TMath::Sign(daz, dev.Az()), dev.Zd()*3600.);267 Update(pos.Zd(), dev.Zd(), dev.Az());268 269 UpdateCanvas();270 } -
trunk/MagicSoft/Cosy/gui/MGStarg.h
r4865 r7790 1 #ifndef MGSTARG_H2 #define MGSTARG_H1 #ifndef COSY_MGStarg 2 #define COSY_MGStarg 3 3 4 #ifndef COSY_MG EmbeddedCanvas5 #include "MG EmbeddedCanvas.h"4 #ifndef COSY_MGAccuracy 5 #include "MGAccuracy.h" 6 6 #endif 7 7 … … 12 12 class ZdAz; 13 13 14 class MGStarg : public MG EmbeddedCanvas14 class MGStarg : public MGAccuracy 15 15 { 16 TLine *fLin1;17 TLine *fLin2;16 // TLine *fLin1; 17 // TLine *fLin2; 18 18 19 TText *fTxt;19 // TText *fTxt; 20 20 21 TLine *fBar;21 // TLine *fBar; 22 22 23 TGraph *fGraph;23 // TGraph *fGraph; 24 24 25 Double_t fTime;25 // Double_t fTime; 26 26 27 void DrawCoordinateSystem(); 27 // void InitText(); 28 // void InitCross(); 29 // void InitBar(); 28 30 29 void InitText(); 30 void InitCross(); 31 void InitBar(); 31 // void UpdateCross(Float_t x, Float_t y); 32 // void UpdateText(Float_t dist); 33 // void UpdateGraph(Float_t acc); 34 // void Update(Float_t zd, Float_t x, Float_t y); 32 35 33 void UpdateCross(Float_t x, Float_t y);34 void UpdateText(Float_t acc);35 void UpdateGraph(Float_t acc);36 void Update(Float_t zd, Float_t x, Float_t y);37 36 38 37 public: 39 38 MGStarg(const TGWindow* p, const UInt_t w); 40 ~MGStarg();39 // ~MGStarg(); 41 40 42 void Update(ZdAz &pos, ZdAz &acc); 41 // virtual void DrawText(); 42 void DrawHexagon(); 43 44 // void Update(ZdAz &pos, ZdAz &acc); 43 45 44 46 ClassDef(MGStarg, 0) 45 47 }; 46 48 47 #endif // MGSTARG_H49 #endif // COSY_MGStarg -
trunk/MagicSoft/Cosy/gui/Makefile
r7787 r7790 40 40 MGAccuracy.cc \ 41 41 MGStarg.cc \ 42 MGNumStars.cc \ 42 43 MGSkyPosition.cc 43 44
Note:
See TracChangeset
for help on using the changeset viewer.