Changeset 8856 for trunk/MagicSoft
- Timestamp:
- 02/05/08 11:41:55 (17 years ago)
- Location:
- trunk/MagicSoft/Cosy
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/Changelog
r8855 r8856 1 1 -*-*- END -*-*- 2 2 3 2008/02/05 Thomas Bretz (La Palma) 4 5 * cosy.cc: 6 - setup address and port in constructor of Ethernet 7 8 * candrv/ethernet.[h,cc]: 9 - added new data mebers fTxAddress and fTxPort 10 - get all io addresses in constructor 11 12 * gui/MGCosy.cc: 13 - switch off debug mode 14 15 * main/MCosy.cc, main/MStarguider.cc, videodev/Camera.cc: 16 - added missing stream manipulators 17 18 * tcpip/MCeCoCom.h: 19 - set address of CeCo in constructor of MTCpIpIO 20 21 * tcpip/MTcpIpIO.[h,cc]: 22 - moved setting of destination address into arguments of constructor 23 24 * videodev/MVideo.cc: 25 - tiny improfements to logging output 26 27 28 3 29 2008/02/04 Thomas Bretz (La Palma) 4 30 5 * candrv/interface.[h,cc], candrv/ethernet.[h,cc]: 31 * candrv/interface.[h,cc], candrv/ethernet.[h,cc], 32 MIncl.h, MLinkDef.h: 6 33 - added 34 35 * Makefile: 36 - removed readcam from list of programs 7 37 8 38 -
trunk/MagicSoft/Cosy/candrv/ethernet.cc
r8854 r8856 53 53 // and switch the can bus communication on 54 54 // 55 Ethernet::Ethernet(CanOpen *rx) : MTcpIpI(5358), Interface(rx) 55 Ethernet::Ethernet(const char *addr, const int tx, const int rx, CanOpen *receiver) 56 : MTcpIpI(rx), Interface(receiver), fTxAddress(addr), fTxPort(tx) 56 57 { 57 58 gLog << inf2 << "- Ethernet initialized." << endl; … … 191 192 */ 192 193 194 // FIXME: MUST BECOME NON-BLOCKING!!!!! 193 195 cout << "*** Send CanFrame over IP" << endl; 194 195 // MUST BECOME NON-BLOCKING!!!!! 196 197 // MTcpIpO::SendFrame("192.168.0.2", 5357, (char*)(msg.data+1), msg.len-1); 198 MTcpIpO::SendFrame("192.168.1.1", 5357, (char*)(msg.data+1), msg.len-1); 196 // FIXME: MUST BECOME NON-BLOCKING!!!!! 197 198 MTcpIpO::SendFrame(fTxAddress, fTxPort, (char*)(msg.data+1), msg.len-1); 199 199 200 200 /* -
trunk/MagicSoft/Cosy/candrv/ethernet.h
r8855 r8856 13 13 { 14 14 private: 15 TString fTxAddress; 16 Int_t fTxPort; 17 15 18 // Send interface based on MTcpIpI 16 19 void ReadSocket(TSocket &rx); … … 21 24 22 25 public: 23 Ethernet( CanOpen *rx);26 Ethernet(const char *addr, const int tx, const int rx, CanOpen *receiver); 24 27 virtual ~Ethernet(); 25 28 -
trunk/MagicSoft/Cosy/cosy.cc
r8819 r8856 180 180 MCosy *cosy = new MCosy(); 181 181 182 Interface *interface = new Ethernet( cosy);182 Interface *interface = new Ethernet("127.0.0.1", 5357, 5358, cosy); 183 183 // Interface *interface = new VmodIcan(cosy, "/dev/dpm_00", 125); 184 184 -
trunk/MagicSoft/Cosy/gui/MGCosy.cc
r8847 r8856 35 35 #include "SlaStars.h" 36 36 37 #define DEBUG38 //#undef DEBUG37 //#define DEBUG 38 #undef DEBUG 39 39 //#define EXPERT 40 40 //#define HAS_DEMO -
trunk/MagicSoft/Cosy/main/MCosy.cc
r8852 r8856 549 549 if (HasZombie()) 550 550 { 551 lout<< "- Found Zombies in Network..." << endl;551 gLog << warn << "- Found Zombies in Network..." << endl; 552 552 if (!RebootZombies()) 553 553 return false; -
trunk/MagicSoft/Cosy/main/MStarguider.cc
r8847 r8856 216 216 217 217 TString disp=gVirtualX->DisplayName(); 218 cout<< "Display: " << disp << endl;218 gLog << all << "Display: " << disp << endl; 219 219 if (disp.First(':')>=0) 220 220 disp=disp(0, disp.First(':')); … … 507 507 fStatus(MDriveCom::kStandby) 508 508 { 509 cout<< " #### FIXME: Make MCaos Thread safe!" << endl;509 gLog << warn << " #### FIXME: Make MCaos Thread safe!" << endl; 510 510 511 511 // This means that all objects added with AddFrame are deleted … … 582 582 delete fAmcSocket; 583 583 584 cout<< "Camera Display destroyed." << endl;584 gLog << inf2 << "Camera Display destroyed." << endl; 585 585 } 586 586 … … 596 596 if (len<0) 597 597 { 598 cout<< "ERROR - Sending Trigger to Amc" << endl;598 gLog << err << "ERROR - Sending Trigger to Amc" << endl; 599 599 return false; 600 600 } 601 601 if (len!=txt.Length()) 602 602 { 603 cout<< "Send wrong number (" << len << ") of Bytes to Amc." << endl;603 gLog << err << "Send wrong number (" << len << ") of Bytes to Amc." << endl; 604 604 return false; 605 605 } … … 615 615 void MStarguider::CloseWindow() 616 616 { 617 cout<< "EventDisplay::CloseWindow: Exit Application Loop." << endl;617 gLog << inf2 << "EventDisplay::CloseWindow: Exit Application Loop." << endl; 618 618 619 619 //fClient.ExitLoop(); … … 817 817 { 818 818 const Float_t pixsize = atof(fPixSize->GetText()); 819 cout<< "Pixel Size changed to " << pixsize << "\"/pix" << endl;819 gLog << all << "Pixel Size changed to " << pixsize << "\"/pix" << endl; 820 820 fSao->SetPixSize(pixsize); 821 821 return kTRUE; … … 824 824 { 825 825 const Float_t angle = atof(fAngle->GetText()); 826 cout<< "Rotation Angle changed to " << angle << "deg" << endl;826 gLog << all << "Rotation Angle changed to " << angle << "deg" << endl; 827 827 fSao->SetRotationAngle(angle); 828 828 return kTRUE; … … 831 831 { 832 832 const Float_t cut = atof(fCut->GetText()); 833 cout<< "Starguider cleaning level changed to " << cut << " sigma." << endl;833 gLog << all << "Starguider cleaning level changed to " << cut << " sigma." << endl; 834 834 return kTRUE; 835 835 } … … 1364 1364 if (num < 3) //was 1 1365 1365 { 1366 cout<< "Sorry, less than 3 detected spot in FOV!" << endl;1366 gLog << warn << "Sorry, less than 3 detected spot in FOV!" << endl; 1367 1367 if (fStargTPoint->IsDown()) 1368 1368 fStargTPoint->SetDown(kFALSE); … … 1373 1373 if (stars.GetRealEntries() < 3) 1374 1374 { 1375 cout<< "Sorry, less than 3 stars in FOV!" << endl;1375 gLog << warn << "Sorry, less than 3 stars in FOV!" << endl; 1376 1376 if (fStargTPoint->IsDown()) 1377 1377 fStargTPoint->SetDown(kFALSE); … … 1466 1466 // open tpoint file 1467 1467 const TString name = MCosy::GetFileName("tpoint", "starg", "txt"); 1468 cout<< "TPoint-Starg File ********* " << name << " ********** " << endl;1468 gLog << all << "TPoint-Starg File ********* " << name << " ********** " << endl; 1469 1469 1470 1470 fOutStargTp = new ofstream(name); … … 1579 1579 { 1580 1580 fTPoint->SetDown(kFALSE); 1581 cout<< "No star found. Couldn't take a tpoint." << endl;1581 gLog << warn << "No star found. Couldn't take a tpoint." << endl; 1582 1582 } 1583 1583 return ZdAz(.0,.0); -
trunk/MagicSoft/Cosy/tcpip/MCeCoCom.h
r8840 r8856 49 49 public: 50 50 MCeCoCom(MLog *out) 51 : MTcpIpIO( 7304, 7404), fOut(out), fStatus(0), fComStat(kNoCmdReceived),51 : MTcpIpIO("ceco", 7304, 7404), fOut(out), fStatus(0), fComStat(kNoCmdReceived), 52 52 fHumidity(0), fTemperature(0), fWindSpeed(0), fSolarRadiation(-1), 53 53 fAlarmCounter(0) -
trunk/MagicSoft/Cosy/tcpip/MTcpIpIO.cc
r8843 r8856 35 35 */ 36 36 37 MTcpIpO::MTcpIpO( Int_t tx)38 { 39 fTxSocket = new TSocket( "ceco", tx);37 MTcpIpO::MTcpIpO(const char *addr, Int_t tx) 38 { 39 fTxSocket = new TSocket(addr, tx); 40 40 } 41 41 … … 46 46 } 47 47 48 MTcpIpIO::MTcpIpIO( Int_t tx, Int_t rx) : MTcpIpI(rx), MTcpIpO(tx)48 MTcpIpIO::MTcpIpIO(const char *addr, Int_t tx, Int_t rx) : MTcpIpI(rx), MTcpIpO(addr, tx) 49 49 { 50 50 RunThread(); -
trunk/MagicSoft/Cosy/tcpip/MTcpIpIO.h
r8843 r8856 37 37 38 38 public: 39 MTcpIpO( Int_t tx);39 MTcpIpO(const char *addr, Int_t tx); 40 40 ~MTcpIpO(); 41 41 … … 53 53 54 54 public: 55 MTcpIpIO( Int_t tx, Int_t rx);55 MTcpIpIO(const char *addr, Int_t tx, Int_t rx); 56 56 ~MTcpIpIO(); 57 57 -
trunk/MagicSoft/Cosy/videodev/Camera.cc
r8843 r8856 102 102 if (!fVideo->IsOpen()) 103 103 { 104 gLog << "ERROR - Process:Device not open." << endl;104 gLog << err << "Camera::Thread: ERROR - Device not open." << endl; 105 105 return kFALSE; 106 106 } -
trunk/MagicSoft/Cosy/videodev/MVideo.cc
r8849 r8856 104 104 return -4; 105 105 106 gLog << err << "ERROR - MVideo::Ioctl -ioctl returned rc=" << rc << " '";107 gLog << strerror(errno) << " ' (errno = " << errno<< ")" << endl;106 gLog << err << "ERROR - MVideo::Ioctl 0x" << hex << req << ": errno=" << dec << errno << " - "; 107 gLog << strerror(errno) << " (rc=" << rc << ")" << endl; 108 108 usleep(10); 109 109 continue; 110 110 } 111 111 112 gLog << err << "ERROR - MVideo::Ioctl " << hex << req << ": errno=" << dec << errno << " - ";112 gLog << err << "ERROR - MVideo::Ioctl 0x" << hex << req << ": errno=" << dec << errno << " - "; 113 113 gLog << strerror(errno) << " (rc=" << rc << ")" << endl; 114 114 return rc; … … 161 161 } 162 162 163 gLog << all << "Opening " << fPath << "... " << flush;163 gLog << all << "Opening " << fPath << "... " << flush; 164 164 do 165 165 { … … 171 171 if (fFileDesc == -1) 172 172 { 173 gLog << err << "ERROR !"<< endl;173 gLog << err << "ERROR: " << strerror(errno) << endl; 174 174 return kFALSE; 175 175 } … … 263 263 fCaps.maxheight, fCaps.maxwidth, // height, width 264 264 VIDEO_PALETTE_RGB24 // palette 265 //768, 576, 266 //VIDEO_PALETTE_RGB555 // palette 265 267 }; 266 268 … … 271 273 return kTRUE; 272 274 273 if (errno == EAGAIN)275 // if (errno == EAGAIN) 274 276 gLog << err << "ERROR - Couldn't start capturing frame " << frame << " - unable to sync." << endl; 275 277 … … 341 343 342 344 memcpy(&fChannel, &ch, sizeof(fChannel)); 345 346 gLog << all << "Switched to channel " << chan << endl; 343 347 344 348 return kTRUE;
Note:
See TracChangeset
for help on using the changeset viewer.