Changeset 2278 for trunk/MagicSoft/Cosy/gui/MGVelocity.cc
- Timestamp:
- 07/15/03 15:05:21 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/gui/MGVelocity.cc
r1702 r2278 24 24 void MGVelocity::DrawCoordinateSystem() 25 25 { 26 /*27 TArc arc;28 arc.SetFillStyle(4000); // transparent29 arc.SetFillColor(39);30 arc.SetLineColor(3); // green31 arc.SetLineStyle(2); // dashed (s. TAttLine)32 arc.DrawArc(0, 0, 20);33 34 arc.SetLineColor(5); // yellow35 arc.DrawArc(0, 0, 40);36 37 arc.SetLineColor(2); // red38 arc.DrawArc(0, 0, 60);39 */40 //41 // FIXME? Use TAxis?42 //43 /*44 TLine line;45 line.SetLineColor(13);46 line.SetLineStyle(3); // dotted (s. TAttLine)47 line.DrawLine(-30., -65., -30., 65.);48 line.DrawLine(-65., -30., 65., -30.);49 line.DrawLine( 30., -65., 30., 65.);50 line.DrawLine( -6., 30., 65., 30.);51 52 line.DrawLine(-15., -65., -15., 65.);53 line.DrawLine(-65., -15., 65., -15.);54 line.DrawLine( 15., -65., 15., 65.);55 line.DrawLine(-65., 15., 65., 15.);56 57 line.DrawLine(-45., -65., -45., 65.);58 line.DrawLine(-65., -45., 65., -45.);59 line.DrawLine( 45., -65., 45., 65.);60 line.DrawLine(-65., 45., 65., 45.);61 62 line.SetLineColor(12);63 line.SetLineStyle(2); // dashed (s. TAttLine)64 line.DrawLine(-60., -65., -60., 65.);65 line.DrawLine(-65., -60., 65., -60.);66 line.DrawLine( 60., -65., 60., 65.);67 line.DrawLine(-65., 60., 65., 60.);68 69 line.SetLineColor(1); // black70 line.SetLineStyle(1); // solid (s. TAttLine)71 line.DrawLine(-65., 0, 65., 0);72 line.DrawLine( 0, -65., 0, 65.);73 74 line.DrawLine(-1., 60., 1., 60.);75 line.DrawLine(-1., -60., 1., -60.);76 line.DrawLine(-1., 30., 1., 30.);77 line.DrawLine(-1., -30., 1., -30.);78 79 line.DrawLine( 60., -1., 60., 1.);80 line.DrawLine(-60., -1., -60., 1.);81 line.DrawLine( 30., -1., 30., 1.);82 line.DrawLine(-30., -1., -30., 1.);83 84 TText text;85 text.SetTextAlign(22); // centered, centered (s.TAttText)86 text.DrawText(60., 5., "vAz['/min]");87 text.DrawText(0, 70., "vZd['/min]");88 89 text.SetTextAlign(23); // centered, centered (s.TAttText)90 text.DrawText(-60., -2., "-1'");91 text.DrawText( 60., -2., "1'");92 text.DrawText(-30., -2., "-.5'");93 text.DrawText( 30., -2., ".5'");94 95 text.SetTextAlign(32); // centered, centered (s.TAttText)96 text.DrawText(-2., -60., "-1'");97 text.DrawText(-2., 60., "1'");98 text.DrawText(-2., -30., "-.5'");99 text.DrawText(-2., 30., ".5'");100 */101 26 TWbox box; 102 27 box.DrawWbox(-145, 145, -35, 120, 18, 2, 1); … … 130 55 void MGVelocity::InitVelocity() 131 56 { 132 /*133 fLin1 = new TLine(0, 0, 0, 0);134 fLin2 = new TLine(0, 0, 0, 0);135 136 fLin1->SetLineColor(10); // white (s. TAttFill)137 fLin2->SetLineColor(10); // white138 fLin1->SetLineStyle(1); // solid (s. TAttLine)139 fLin2->SetLineStyle(1);140 141 fLin1->Draw();142 fLin2->Draw();143 144 fList->Add(fLin1);145 fList->Add(fLin2);146 */147 57 fArrow = new TArrow(0, 0, 0, 0, 0.01); 148 58 fArrowX = new TArrow(0, 0, 0, 0, 0.01); … … 170 80 fText->Draw(); 171 81 fList->Add(fText); 172 173 fTextVel = new TText(2*70, 2*70, "");174 fTextVel->SetTextAlign(33); // right, top175 fTextVel->SetTextColor(10); // white176 fTextVel->Draw();177 fList->Add(fTextVel);178 82 } 179 83 … … 255 159 fArrowAvg->SetX2(avgx); 256 160 fArrowAvg->SetY2(avgy); 257 258 // cout << avgx << " " << avgy << endl;259 161 260 162 if ((fabs(avgx)>/*40.*/110. || fabs(avgy)>/*40.*/110.)) … … 274 176 } 275 177 276 void MGVelocity::UpdateVelText(Float_t vx, Float_t vy)277 {278 static int X = ~0;279 static int Y = ~0;280 281 vx /= 60.; //['/min]282 vy /= 60.; //['/min]283 284 int fx = (int)/*floor*/(vx*10.);285 int fy = (int)/*floor*/(vy*10.);286 287 if (X==fx && Y==fy)288 return;289 290 X = fx;291 Y = fy;292 293 char txt[100];294 sprintf(txt, "Zd=%.1f'\nAz=%.1f'",295 vy, vx);296 297 fTextVel->SetText(fTextVel->GetX(), fTextVel->GetY(), txt);298 }299 300 178 void MGVelocity::Update(ZdAz &zdaz) 301 179 { … … 303 181 // calculate actual time for planet positions 304 182 // 305 // static int X = 0xaffe;306 // static int Y = 0xaffe;307 308 183 float vx = zdaz.Az()*3600.; // ["/min] 309 184 float vy = zdaz.Zd()*3600.; // ["/min] 310 185 311 UpdateVelText(vx, vy);312 313 186 int pixx = (int)(vx*fScale/fPix); 314 187 int pixy = (int)(vy*fScale/fPix); … … 328 201 return; 329 202 330 // cout << fScale << ": " << pixx << " " << pixy;331 // cout << fScale << ": " << (int)rc << (int)((int)fOld->X()==pixx) << (int)((int)fOld->Y()==pixy) << " ";332 // cout << zdaz.Az()*3600. << " " << zdaz.Zd()*3600. << endl;333 334 203 vx *= fScale; 335 204 vy *= fScale;
Note:
See TracChangeset
for help on using the changeset viewer.