Changeset 921 for trunk/MagicSoft/Cosy/gui/MGVelocity.cc
- Timestamp:
- 08/30/01 16:02:20 (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/gui/MGVelocity.cc
r918 r921 167 167 fText->Draw(); 168 168 fList->Add(fText); 169 170 fTextVel = new TText(2*70, 2*70, ""); 171 fTextVel->SetTextAlign(33); // right, top 172 fTextVel->SetTextColor(10); // white 173 fTextVel->Draw(); 174 fList->Add(fTextVel); 169 175 } 170 176 … … 198 204 sprintf(txt, "x%.0f", 1./fScale); 199 205 200 fText->SetText(fText->GetX() /*70*2*/, fText->GetY()/*70*2*/, txt);206 fText->SetText(fText->GetX(), fText->GetY(), txt); 201 207 } 202 208 … … 263 269 } 264 270 271 void MGVelocity::UpdateVelText(Float_t vx, Float_t vy) 272 { 273 static int X = ~0; 274 static int Y = ~0; 275 276 vx /= 60.; //['/min] 277 vy /= 60.; //['/min] 278 279 int fx = (int)floor(vx*10.); 280 int fy = (int)floor(vy*10.); 281 282 if (X==fx && Y==fy) 283 return; 284 285 X = fx; 286 Y = fy; 287 288 char txt[100]; 289 sprintf(txt, "Zd=%.1f'\nAz=%.1f'", 290 vx, vy); 291 292 fTextVel->SetText(fTextVel->GetX(), fTextVel->GetY(), txt); 293 } 265 294 266 295 void MGVelocity::Update(ZdAz &zdaz) … … 272 301 // static int Y = 0xaffe; 273 302 274 float x = zdaz.Az()*3600.; 275 float y = zdaz.Zd()*3600.; 276 277 int pixx = (int)(x*fScale/fPix); 278 int pixy = (int)(y*fScale/fPix); 303 float vx = zdaz.Az()*3600.; // ["/min] 304 float vy = zdaz.Zd()*3600.; // ["/min] 305 306 UpdateVelText(vx, vy); 307 308 int pixx = (int)(vx*fScale/fPix); 309 int pixy = (int)(vy*fScale/fPix); 279 310 280 311 // … … 284 315 285 316 if (pixx || pixy) 286 rc = UpdateAvg( x,y);317 rc = UpdateAvg(vx, vy); 287 318 288 319 if (rc) … … 296 327 // cout << zdaz.Az()*3600. << " " << zdaz.Zd()*3600. << endl; 297 328 298 x *= fScale;299 y *= fScale;300 301 fArrow->SetX2( x);302 fArrow->SetY2( y);303 304 fArrowX->SetX2( x);305 fArrowY->SetY2( y);329 vx *= fScale; 330 vy *= fScale; 331 332 fArrow->SetX2(vx); 333 fArrow->SetY2(vy); 334 335 fArrowX->SetX2(vx); 336 fArrowY->SetY2(vy); 306 337 307 338 fOld->Set(pixx, pixy); … … 309 340 SetModified(); 310 341 UpdateCanvas(); 311 312 } 342 }
Note:
See TracChangeset
for help on using the changeset viewer.