Changeset 920
- Timestamp:
- 08/29/01 16:44:38 (23 years ago)
- Location:
- trunk/MagicSoft
- Files:
-
- 14 added
- 28 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/Changelog
r919 r920 1 1 -*-*- END -*-*- 2 2 2001/08/29 - Thomas Bretz: 3 4 * base/BaseLinkDef.h, base/BaseIncl.h, 5 candrv/CandrvIncl.h, candrv/CandrvLinkDef.h, 6 catalog/CatalogLinkDef.h, catalog/CatalogIncl.h, 7 devdrv/DevdrvIncl.h, devdrv/DevdrvLinkDef.h, 8 gui/GuiLinkDef.h, gui/GuiIncl.h, 9 slalib/SlalibIncl.h, slalib/SlalibLinkDef.h, 10 videodev/VideodevLinkDef.h, videodev/VideodevIncl.h: 11 - added 12 13 * Makefile.rules: 14 - added CINTHEADERS 15 16 * cosy.cc: 17 - changed logging to MLog 18 19 * base/Makefile: 20 - added MLog and MLogManip 21 22 * base/log.h, candrv/canopen.[h,cc], candrv/network.[h,cc], 23 candrv/nodedrv.[h,cc], candrv/vmodican.[h,cc], 24 devdrv/macs.[h,cc] 25 - changed from ostream to MLog 26 27 * devdrv/shaftencoder.[h,cc] 28 - changed from ostream to MLog 29 - changed buffering of values 30 - removed old updating thread stuff 31 32 * catalog/SlaStars.[h,cc]: 33 - added GetApproxVel 34 35 * gui/MGAccuracy.cc: 36 - fixed the wrong deg2rad value 37 - added more accurate calculation of one dimensional 38 tracking error value 39 40 * MGCosy.[h,cc]: 41 - added a TGListBox 42 - added some Labels to display offset as value 43 - removed offset display 44 - changed layout of dialog 45 - added layout manager 46 - added status frame 47 - added tabs 48 - added status display and update 49 50 * gui/MGEmbeddedCanvas.cc: 51 - removed raised frame around embedded canvas 52 - enhanced size by 1 53 54 * gui/MGSkyPosition.cc: 55 - a new position checks now for a new angle, too 56 - removed debugging output 57 58 * slalib/Makefile: 59 - added altaz.c 3 60 4 61 * MCosy.[cc,h]: … … 8 65 - TerminateApp now sends WM_QUIT 9 66 - removed comments with old GUI thread 67 - added a missing bracket, which prevents us from stopping 68 a positioning command 69 - changed some output from cout to lout 70 - added empty prototype to Limit speed in tracking mode 71 - changed constructor to use of MLog 10 72 11 73 * base/MGList.h: 12 74 - added DBG_MGLIST for debugging 13 75 14 * devdrv/shaftencoder.[h,cc]:15 - removed old updating thread stuff16 17 * gui/MGAccuracy.[h,cc]:18 - added more accurate calculation of one dimensional19 tracking error value20 21 76 * gui/MGCoordinate.cc: 22 77 - removed logging statement from destructor 23 24 * gui/MGCosy.cc:25 - changed layout of dialog26 - added layout manager27 - added status frame28 - added tabs29 - added status display and update30 31 * gui/MGEmbeddedCanvas.cc:32 - enhanced size by 133 34 * gui/MGSkyPosition.cc:35 - removed debugging output36 78 37 79 * gui/MGVelocity.cc: -
trunk/MagicSoft/Cosy/MCosy.cc
r918 r920 13 13 #include "MGCosy.h" 14 14 #include "SlaStars.h" 15 16 #include "slalib/slalib.h" // FIXME: REMOVE 15 17 16 18 #include "macs.h" … … 202 204 cout << "SDO..." << flush; 203 205 204 while ( fMac1->IsPositioning() || fMac2->IsPositioning() && !StopWaitingForSDO())206 while ((fMac1->IsPositioning() || fMac2->IsPositioning()) && !StopWaitingForSDO()) 205 207 usleep(1); 206 208 … … 234 236 const ZdAz dest = CorrectTarget(src, dst); 235 237 236 cout << "Positioning to Target..." << endl;238 lout << "Positioning to Target..." << endl; 237 239 //cout << "Source Zd: " << src.Zd() << "se Az:" << src.Az() << "se" << endl; 238 240 //cout << "Destination Zd: " << Rad2SE(dst.Zd()) << "se Az:" << Rad2SE(dst.Az()) << "se" << endl; … … 265 267 if (!cdzd && !cdaz) 266 268 { 267 cout << "Positioning done with " << i << "manuvers." << endl;269 lout << "Positioning done with " << i << "manuvers." << endl; 268 270 return TRUE; 269 271 } … … 300 302 CheckForError(); 301 303 302 cout << "Positioning ERROR!" << endl;304 lout << "Warning: Requested position not reached." << endl; 303 305 return FALSE; 304 306 } … … 313 315 return kTRUE; 314 316 315 lout << "Error #6004 (requesting re pos from Macs) happened." << endl; 317 if (HasError()) 318 lout << "Error #6004 (requesting re pos from Macs) happened." << endl; 319 316 320 return kFALSE; 317 321 } … … 325 329 return kTRUE; 326 330 327 lout << "Error #3006 (setting velocity of Macs) happened." << endl; 331 if (HasError()) 332 lout << "Error #3006 (setting velocity of Macs) happened." << endl; 333 328 334 return kFALSE; 329 335 } … … 346 352 } 347 353 354 void MCosy::LimitSpeed(ZdAz *vt, const ZdAz &vcalc) const 355 { 356 return; 357 358 // 359 // How to limit the speed. If the wind comes and blowes 360 // we cannot forbid changing of the sign. But on the other hand 361 // we don't want fast changes! 362 // 363 364 ULong_t vrzd = fMac1->GetVelRes(); 365 ULong_t vraz = fMac2->GetVelRes(); 366 367 #define sgn(x) (x<0?-1:1) 368 369 if (sgn(vt->Az()) != sgn(vcalc.Az())) 370 vt->Az(0.1*vcalc.Az()); 371 else 372 if (fabs(vt->Az()) > 0.9*vraz) 373 vt->Az(0.9*vraz*sgn(vt->Az())); 374 375 if (sgn(vt->Zd()) != sgn(vcalc.Zd())) 376 vt->Zd(0.1*vcalc.Zd()); 377 else 378 if (fabs(vt->Zd()) > 0.9*vrzd) 379 vt->Zd(0.9*vrzd*sgn(vt->Zd())); 380 } 381 348 382 void MCosy::TrackPosition(const RaDec &dst) // ra, dec [rad] 349 383 { … … 358 392 if (!SetPosition(dest)) 359 393 { 360 cout << "ERROR: Cannot start tracking, unable to reach requested position." << endl;394 lout << "ERROR: Cannot start tracking, unable to reach requested position." << endl; 361 395 return; 362 396 } … … 386 420 InitTracking(); 387 421 388 cout << "Start tracking:";389 cout << " Ra: " << Rad2Deg(dst.Ra()) << "deg ";390 cout << "Dec: " << Rad2Deg(dst.Dec()) << "deg" << endl;422 lout << "Start tracking:"; 423 lout << " Ra: " << Rad2Deg(dst.Ra()) << "deg "; 424 lout << "Dec: " << Rad2Deg(dst.Dec()) << "deg" << endl; 391 425 392 426 // … … 414 448 // 415 449 sla.SetMjd(sla.CalcMjd()+dt/(60*60*24)); 416 dest = CorrectTarget(GetSePos(), sla.CalcZdAz(dst)); 450 dest = CorrectTarget(GetSePos(), sla.CalcZdAz(dst)); // [se] 451 452 //ZdAz vcalc = sla.GetApproxVel(dst) * kGearRatio2*4./60.; // [re/min] 417 453 418 454 // … … 428 464 // Shaft- and the rotary encoders 429 465 // 430 dest *= kGearRatio; 466 dest *= kGearRatio; // [re] 431 467 dest -= GetRePos() + fOffset; 432 468 … … 442 478 // 443 479 ZdAz vt = v/4; 480 //LimitSpeed(&vt, vcalc); 444 481 vt.Round(); 445 482 … … 449 486 if (v.Zd()>.9*fMac1->GetVelRes() || v.Az()>.9*fMac2->GetVelRes()) 450 487 { 451 cout << "Error: Tracking speed faster than possible maximum velocity." << endl;488 lout << "Error: Tracking speed faster than possible maximum velocity." << endl; 452 489 break; 453 490 } … … 490 527 SetStatus(kStopped); 491 528 492 cout << "Tracking stopped." << endl;529 lout << "Tracking stopped." << endl; 493 530 494 531 CheckForError(); … … 750 787 751 788 fWin->Update(ist, fTrackingError/kGearRatio2, 752 fVelocity, fOffset/ kGearRatio2,789 fVelocity, fOffset/*/kGearRatio2*/, 753 790 fStatus); 754 791 … … 788 825 } 789 826 790 MCosy::MCosy(const char *dev, const int baud, ostream&out)827 MCosy::MCosy(const char *dev, const int baud, MLog &out) 791 828 : Network(dev, baud, out), fTracking(kFALSE) 792 829 { … … 822 859 fAlt2->SetDisplay(fWin->GetLabel3()); 823 860 861 lout.SetOutputGui(fWin->GetLog(), kTRUE); 824 862 } 825 863 … … 857 895 cout << "Deleting MGCosy." << endl; 858 896 897 lout.DisableOutputDevice(MLog::eGui); 898 859 899 delete fWin; 860 900 -
trunk/MagicSoft/Cosy/MCosy.h
r918 r920 88 88 89 89 void InitTracking(); 90 void LimitSpeed(ZdAz *vt, const ZdAz &vcalc) const; 90 91 91 92 void TalkThread(); … … 102 103 103 104 public: 104 MCosy(const char *dev, const int baud, ostream &out=cout);105 MCosy(const char *dev, const int baud, MLog &out=gLog); 105 106 ~MCosy(); 106 107 -
trunk/MagicSoft/Cosy/Makefile.rules
r909 r920 4 4 -f Makefile.depend 2> kk.kk ; cat kk.kk 5 5 6 $(LIB): $(OBJS) $(HEADERS) 6 $(LIB): $(OBJS) $(HEADERS) $(CINT)Cint.o 7 7 @echo " - Building Library lib$(LIB) ... " 8 8 $(AR) $(LIB) *.o 9 9 10 $(CINT)Cint.cc: $( HEADERS)10 $(CINT)Cint.cc: $(CINTHEADERS) 11 11 @echo 12 12 @echo " - Generating dictionary $(CINT)Cint.cc ..." 13 13 14 14 $(ROOTSYS)/bin/rootcint -f $(CINT)Cint.cc \ 15 -c $(INCLUDES) $(DEFINES) $( HEADERS) $(CINT)Incl.h $(CINT)LinkDef.h15 -c $(INCLUDES) $(DEFINES) $(CINTHEADERS) $(CINT)Incl.h $(CINT)LinkDef.h 16 16 17 17 .cxx.o: -
trunk/MagicSoft/Cosy/ToDo
r918 r920 10 10 11 11 - Check why it crashes if you exit the program while 'going home' 12 13 - If one axis stops because of an error the other axis isn't stopped 14 ( SetPosition, software endswitch activated) 12 15 -
trunk/MagicSoft/Cosy/base/Makefile
r910 r920 36 36 MTimeout.cc \ 37 37 msgqueue.cc \ 38 MLog.cc \ 39 MLogManip.cc \ 38 40 timer.cc 41 42 CINTHEADERS = MLog.h \ 43 MLogManip.h 39 44 40 45 SRCS = $(SRCFILES) -
trunk/MagicSoft/Cosy/base/log.h
r732 r920 4 4 #include <ostream.h> 5 5 6 #include "MLog.h" 7 8 //#ifndef __CINT__ 9 extern MLog gLog; 10 //#endif 11 6 12 class Log 7 13 { 8 14 protected: 9 ostream&lout;15 MLog &lout; 10 16 11 17 public: 12 Log( ostream &out=cout) : lout(out) {}18 Log(MLog &out=gLog) : lout(out) {} 13 19 }; 14 20 -
trunk/MagicSoft/Cosy/candrv/canopen.cc
r909 r920 4 4 #include <iomanip.h> // setw, setfill 5 5 6 CanOpen::CanOpen(const char *dev, const int baud, ostream &out=cout) : VmodIcan(dev, baud, out)6 CanOpen::CanOpen(const char *dev, const int baud, MLog &out) : VmodIcan(dev, baud, out) 7 7 { 8 8 for (int i=0; i<32; i++) -
trunk/MagicSoft/Cosy/candrv/network.cc
r909 r920 24 24 } 25 25 26 Network::Network(const char *dev, const int baud, ostream&out) : CanOpen(dev, baud, out)26 Network::Network(const char *dev, const int baud, MLog &out) : CanOpen(dev, baud, out) 27 27 { 28 28 for (int i=0; i<32; i++) -
trunk/MagicSoft/Cosy/candrv/network.h
r909 r920 21 21 22 22 public: 23 Network(const char *dev, const int baud, ostream &out=cout);23 Network(const char *dev, const int baud, MLog &out=gLog); 24 24 25 25 void SetNode(NodeDrv *drv); -
trunk/MagicSoft/Cosy/candrv/nodedrv.cc
r909 r920 5 5 6 6 #include "network.h" 7 #include "MLogManip.h" 7 8 8 NodeDrv::NodeDrv(BYTE_t nodeid, ostream&out) : Log(out), fNetwork(NULL), fId(32), fError(0)9 NodeDrv::NodeDrv(BYTE_t nodeid, MLog &out) : Log(out), fNetwork(NULL), fId(32), fError(0) 9 10 { 10 11 if (nodeid>31) … … 31 32 void NodeDrv::HandleSDOOK(WORD_t idx, BYTE_t subidx) 32 33 { 34 const Bool_t gui = lout.IsOutputDeviceEnabled(MLog::eGui); 35 36 if (gui) 37 lout << ddev(MLog::eGui); 38 33 39 lout << hex << setfill('0'); 34 40 lout << "Sdo=" << idx << "/" << (int)subidx << " set."; 35 41 lout << endl; 42 43 if (gui) 44 lout << edev(MLog::eGui); 36 45 } 37 46 -
trunk/MagicSoft/Cosy/candrv/nodedrv.h
r909 r920 21 21 22 22 public: 23 NodeDrv(BYTE_t nodeid, ostream &out=cout);23 NodeDrv(BYTE_t nodeid, MLog &out=gLog); 24 24 25 25 BYTE_t GetId() { return fId; } -
trunk/MagicSoft/Cosy/candrv/vmodican.cc
r910 r920 758 758 } 759 759 760 VmodIcan::VmodIcan(const char *dev, const int baud, ostream&out) : Log(out), MThread(false)//: CanDriver(dev, baud)760 VmodIcan::VmodIcan(const char *dev, const int baud, MLog &out) : Log(out), MThread(false)//: CanDriver(dev, baud) 761 761 { 762 762 // -
trunk/MagicSoft/Cosy/candrv/vmodican.h
r910 r920 56 56 57 57 public: 58 VmodIcan(const char *dev, const int baud, ostream &out=cout);58 VmodIcan(const char *dev, const int baud, MLog &out=gLog); 59 59 virtual ~VmodIcan(); 60 60 -
trunk/MagicSoft/Cosy/catalog/SlaStars.cc
r912 r920 107 107 return AltAz(DPI/2-zdaz.Zd(), zdaz.Az()); 108 108 } 109 110 ZdAz SlaStars::GetApproxVel(const RaDec &radec) const // [rad/rad] 111 { 112 double az, vaz, aaz; 113 double el, vel, ael; 114 double pa, vpa, apa; 115 slaAltaz(GetAlpha()-radec.Ra(), radec.Dec(), GetPhi(), 116 &az, &vaz, &aaz, 117 &el, &vel, &ael, 118 &pa, &vpa, &apa); 119 120 return ZdAz(-vel, vaz); 121 } -
trunk/MagicSoft/Cosy/catalog/SlaStars.h
r912 r920 27 27 void Set(const RaDec &radec); 28 28 29 ZdAz GetApproxVel(const RaDec &radec) const; // [rad/rad]; 30 29 31 RaDec CalcRaDec(const AltAz &altaz) const; 30 32 RaDec CalcRaDec(const ZdAz &altaz) const; -
trunk/MagicSoft/Cosy/cosy.cc
r912 r920 9 9 #include <TApplication.h> 10 10 11 #include "MLogManip.h" 12 #include "base/timer.h" 13 14 #define clog(txt) \ 15 lout << edev(MLog::eStdout) << txt << endl << ddev(MLog::eStdout) 16 11 17 int main(int argc, char **argv) 12 18 { 13 cout << endl; 14 cout << "Starting..." << endl; 15 cout << endl; 19 Timer time; 20 time.Now(); 16 21 17 22 // 18 23 // this must move to MGCosy !!!! (or MApplication) 19 24 // 20 ofstream lout("cosy.log"); 21 lout << "Starting Cosy" << endl; 25 MLog lout("cosy.log", kTRUE); 26 27 clog("Starting Cosy at " << time.GetTimeStr() << " ..."); 22 28 23 29 // 24 30 // start the main window 25 31 // 26 lout << "- Initialising Root environment." << endl; 32 clog("- Initialising Root environment."); 33 27 34 TROOT root("Cosy", "Magic Control System"); 28 35 TApplication app("App", &argc, argv); … … 34 41 cosy->Start(); 35 42 36 lout << "- Starting mainloop." << endl;43 clog("- Starting mainloop."); 37 44 app.Run(kTRUE); 38 45 39 lout << "- Stopping cosy." << endl;46 clog("- Stopping cosy."); 40 47 cosy->Stop(); 41 lout << "- cosy stopped." << endl;48 clog("- cosy stopped."); 42 49 43 50 delete cosy; 44 51 45 lout << "- Terminating Program." << endl;52 clog("- Terminating Program."); 46 53 cout << "The End." << endl; 47 54 } -
trunk/MagicSoft/Cosy/devdrv/macs.cc
r912 r920 7 7 #include "network.h" 8 8 9 Macs::Macs(BYTE_t nodeid, ostream &out=cout)9 Macs::Macs(BYTE_t nodeid, MLog &out) 10 10 : NodeDrv(nodeid, out), fMacId(2*nodeid+1), 11 11 fPos(0), fPosTime(0.0), fPdoPos(0), fPdoTime(0.0), -
trunk/MagicSoft/Cosy/devdrv/macs.h
r910 r920 28 28 29 29 public: 30 Macs(BYTE_t nodeid, ostream &out=cout);30 Macs(BYTE_t nodeid, MLog &out=gLog); 31 31 virtual ~Macs(); 32 32 -
trunk/MagicSoft/Cosy/devdrv/shaftencoder.cc
r918 r920 13 13 #include <sys/resource.h> // PRIO_PROCESS 14 14 15 ShaftEncoder::ShaftEncoder(BYTE_t nodeid, ostream &out=cout) : NodeDrv(nodeid, out), fLabel(NULL)15 ShaftEncoder::ShaftEncoder(BYTE_t nodeid, MLog &out) : NodeDrv(nodeid, out), fLabel(NULL) 16 16 { 17 17 } … … 88 88 void ShaftEncoder::DisplayVal() 89 89 { 90 static LWORDS_t pos; // ticks91 static WORDS_t vel; // ticks per 5ms92 static WORDS_t acc; // ticks per 25ms^293 94 90 char text[21]; 95 91 96 if (fPos!= pos)92 if (fPos!=fUpdPos) 97 93 { 98 94 sprintf(text, "%ld", fPos); 99 95 fLabel[0]->SetText(new TGString(text)); 100 } 101 102 if (fVel!=vel) 96 fUpdPos = fPos; 97 } 98 99 if (fVel!=fUpdVel) 103 100 { 104 101 sprintf(text, "%d", fVel); 105 102 fLabel[1]->SetText(new TGString(text)); 106 } 107 108 if (fAcc!=acc) 103 fUpdVel = fVel; 104 } 105 106 if (fAcc!=fUpdAcc) 109 107 { 110 108 sprintf(text, "%d", fAcc); 111 109 fLabel[2]->SetText(new TGString(text)); 110 fUpdAcc = fAcc; 112 111 } 113 112 } -
trunk/MagicSoft/Cosy/devdrv/shaftencoder.h
r918 r920 18 18 19 19 TGLabel **fLabel; 20 LWORDS_t fUpdPos; // ticks 21 WORDS_t fUpdVel; // ticks per 5ms 22 WORDS_t fUpdAcc; // ticks per 25ms^2 20 23 21 24 Timer fTime; … … 28 31 29 32 public: 30 ShaftEncoder(BYTE_t nodeid, ostream &out=cout);33 ShaftEncoder(BYTE_t nodeid, MLog &out=gLog); 31 34 virtual ~ShaftEncoder(); 32 35 -
trunk/MagicSoft/Cosy/gui/MGAccuracy.cc
r918 r920 184 184 void MGAccuracy::UpdateText(Float_t pzd, Float_t azd, Float_t aaz) 185 185 { 186 const Float_t d2r = TMath::Pi()/ 360.;186 const Float_t d2r = TMath::Pi()/180.; 187 187 188 188 pzd *= d2r; -
trunk/MagicSoft/Cosy/gui/MGCosy.cc
r918 r920 12 12 #include <TSystem.h> // gSystem 13 13 #include <TGLabel.h> // TGLabel 14 #include <TGListBox.h> // TGListBox 14 15 #include <TG3DLine.h> // TGHorizontal3DLine (TGSplitter) 15 16 #include <TGFrame.h> // TGGroupFrame … … 72 73 void MGCosy::CreateLabel(TGCompositeFrame *f) 73 74 { 75 const int x = 180; 74 76 const int y = 25; 75 const int x = 180; 77 78 TGLabel *l; 79 80 l = new TGLabel(f, "SE-Az:"); 81 l->Move(x-60, y); 82 fList->Add(l); 83 84 l = new TGLabel(f, "SE-Zd1:"); 85 l->Move(x-60, y+20); 86 fList->Add(l); 87 88 l = new TGLabel(f, "SE-Zd2:"); 89 l->Move(x-60, y+40); 90 fList->Add(l); 91 76 92 77 93 fLabel1 = new TGLabel*[3]; … … 126 142 //f->AddFrame(fLabel3[2]); 127 143 144 l = new TGLabel(f, "Offset-Zd:"); 145 l->Move(x-60, y+80); 146 fList->Add(l); 147 148 l = new TGLabel(f, "Offset-Az:"); 149 l->Move(x-60, y+100); 150 fList->Add(l); 151 152 fOffsetZd = new TGLabel(f, "0000000"); 153 fOffsetAz = new TGLabel(f, "0000000"); 154 fOffsetZd->SetTextJustify(kTextRight); 155 fOffsetAz->SetTextJustify(kTextRight); 156 fOffsetZd->Move(x, y+80); 157 fOffsetAz->Move(x, y+100); 158 fList->Add(fOffsetZd); 159 fList->Add(fOffsetAz); 160 128 161 129 162 fError = new TGLabel(f, "Error"); … … 258 291 fAccuracy = new MGAccuracy (f, 300); 259 292 fVelocity = new MGVelocity (f, "Velocity ['/min]", 300); 260 fOffset = new MGVelocity (f, "Offset se-re [']", 300);293 // fOffset = new MGVelocity (f, "Offset se-re [']", 300); 261 294 262 295 fList->Add(fSkyPosition); 263 296 fList->Add(fAccuracy); 264 297 fList->Add(fVelocity); 265 fList->Add(fOffset);298 // fList->Add(fOffset); 266 299 267 300 TGGroupFrame *frame = new TGGroupFrame(f, "Status"); 268 301 frame->Resize(300, 300); 269 302 fList->Add(frame); 303 304 fLog = new TGListBox(f, -1, kSunkenFrame); //kSunkenFrame|kDoubleBorder, 305 fLog->Resize(300, 300); 306 fList->Add(fLog); 270 307 271 308 // … … 277 314 f->AddFrame(frame); 278 315 f->AddFrame(fVelocity); 279 f->AddFrame(f Offset);316 f->AddFrame(fLog); 280 317 281 318 AddFrame(f, new TGLayoutHints(kLHintsNormal | kLHintsExpandX, 0, 0, 1, 0)); … … 337 374 } 338 375 376 void MGCosy::UpdateOffset(ZdAz &off) 377 { 378 static Int_t zd=~0; 379 static Int_t az=~0; 380 381 char text[21]; 382 383 if (zd!=(Int_t)off.Zd()) 384 { 385 zd = (Int_t)off.Zd(); 386 sprintf(text, "%ld", zd); 387 fOffsetZd->SetText(new TGString(text)); 388 } 389 if (az!=(Int_t)off.Az()) 390 { 391 az = (Int_t)off.Az(); 392 sprintf(text, "%ld", az); 393 fOffsetAz->SetText(new TGString(text)); 394 } 395 } 396 339 397 void MGCosy::Update(ZdAz pos, ZdAz acc, ZdAz vel, ZdAz off, UInt_t stat) 340 398 { … … 342 400 fAccuracy->Update(pos, acc); 343 401 fVelocity->Update(vel); 344 fOffset->Update(off);402 UpdateOffset(off); 345 403 346 404 #define kError 0x01 … … 358 416 stat&kTracking ? fAccuracy->MapWindow() : fAccuracy->UnmapWindow(); 359 417 stat&kTracking ? fVelocity->MapWindow() : fVelocity->UnmapWindow(); 360 stat&kTracking ? fOffset->MapWindow() : fOffset->UnmapWindow(); 418 // stat&kTracking ? fOffset->MapWindow() : fOffset->UnmapWindow(); 419 420 if (!fLog->TestBit(kHasChanged)) 421 return; 422 423 fLog->MapSubwindows(); 424 fLog->Layout(); 425 fLog->ResetBit(kHasChanged); 361 426 } 362 427 // ====================================================================== -
trunk/MagicSoft/Cosy/gui/MGCosy.h
r918 r920 33 33 class TGCompositeFrame; 34 34 class TGTab; 35 class TGListBox; 35 36 36 37 class MGCosy : public TGMainFrame … … 50 51 TGLabel **fLabel3; 51 52 53 TGLabel *fOffsetZd; 54 TGLabel *fOffsetAz; 55 52 56 MGCoordinates *fCoord; 53 57 MGSkyPosition *fSkyPosition; … … 66 70 TGLabel *fStopped; 67 71 72 TGListBox *fLog; 73 68 74 void CreateMenu(); 69 75 void CreateLabel(TGCompositeFrame *f); … … 73 79 74 80 void EnableLabel(TGLabel *label, Bool_t stat); 81 void UpdateOffset(ZdAz &off); 75 82 76 83 public: … … 80 87 void CloseWindow(); 81 88 82 TGLabel **GetLabel1() { return fLabel1; } 83 TGLabel **GetLabel2() { return fLabel2; } 84 TGLabel **GetLabel3() { return fLabel3; } 89 TGLabel **GetLabel1() const { return fLabel1; } 90 TGLabel **GetLabel2() const { return fLabel2; } 91 TGLabel **GetLabel3() const { return fLabel3; } 92 93 TGListBox *GetLog() const { return fLog; } 85 94 86 95 void Update(ZdAz pos, ZdAz acc, ZdAz vel, ZdAz off, UInt_t stat); -
trunk/MagicSoft/Cosy/gui/MGEmbeddedCanvas.cc
r918 r920 12 12 MGEmbeddedCanvas::MGEmbeddedCanvas(const char *name, const TGWindow* p, 13 13 const UInt_t width, Float_t range) 14 : TRootEmbeddedCanvas(name, p, width+1, width+1, kRaisedFrame),//, 0) //234, 76, kFixedSize)14 : TRootEmbeddedCanvas(name, p, width+1, width+1, 0/*kRaisedFrame*/), 15 15 fModified(kFALSE), fWidth(width), fRange(range), fPix(2.*range/width) 16 16 { -
trunk/MagicSoft/Cosy/gui/MGSkyPosition.cc
r918 r920 203 203 void MGSkyPosition::UpdatePosition(Float_t zd, Float_t az) 204 204 { 205 static int X=~0; 206 static int Y=~0; 205 static int X =~0; 206 static int Y =~0; 207 static int Rx=~0; 208 static int Ry=~0; 207 209 208 210 const float rad = D2PI*az/360.0; … … 217 219 const int pixy = (int)(y/fPix); 218 220 219 if (X==pixx && Y==pixy) 221 const int rx = (int)(s*fWidth/2.); 222 const int ry = (int)(c*fWidth/2.); 223 224 if (X==pixx && Y==pixy && Rx==rx && Ry==ry) 220 225 return; 221 226 222 227 X = pixx; 223 228 Y = pixy; 229 230 Rx = rx; 231 Ry = ry; 224 232 225 233 const float dx = s*4.; -
trunk/MagicSoft/slalib/Makefile
r912 r920 37 37 nutc.c dmxv.c refro.c prec.c nut.c dmxm.c evp.c \ 38 38 drange.c deuler.c cldj.c aopqk.c refz.c dh2e.c de2h.c \ 39 dt.c dmoon.c planet.c planel.c el2ue.c ue2pv.c pv2ue.c 39 dt.c dmoon.c planet.c planel.c el2ue.c ue2pv.c pv2ue.c \ 40 altaz.c 40 41 # addet.c 41 42 # afin.c airmas.c altaz.c amp.c \
Note:
See TracChangeset
for help on using the changeset viewer.