- Timestamp:
- 02/13/08 19:44:39 (17 years ago)
- Location:
- trunk/MagicSoft/Cosy
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/Changelog
r8861 r8862 1 1 -*-*- END -*-*- 2 3 2008/02/13 Thomas Bretz (La Palma) 4 5 * cosy.cc: 6 - added debug-env command line options 7 - added config command line option 8 - added command line options for the ip-addresses 9 - read in an MEnv 10 11 * candrv/canopen.cc: 12 - commented an obsolete output 13 14 * candrv/ethernet.[h,cc]: 15 - changed some cout to gLog stream 16 - impoved output 17 - added some some DEBUG precompiler ifs 18 19 * candrv/interface.cc: 20 - fixed an if: fReceiver instead of !fReceiver 21 22 * candrv/network.cc: 23 - fixed some problems with hex/dec output 24 25 * devdrv/shaftencoder.[h,cc]: 26 - decode all bytes in PDO2 27 - devide by fTicks instead of a fixed number 28 - improved some comments 29 30 * main/MCosy.[h,cc]: 31 - removed the arbitrary offset in GetSePos 32 (FIXME: This needs to become an option in the rc-file) 33 - take an MEnv instead of a local TEnv 34 - improved output 35 - get name for pointing model as argument 36 37 * tcpip/MCeCoCom.h, tcpip/MDriveCom.h: 38 - get ip-address as argument 39 40 * tcpip/MTcpIpIO.[h,cc]: 41 - added GetSocketAddress functions 42 - changed some cout to gLog 43 - improved output 44 45 * videodev/MVideo.[h,cc]: 46 - added an argument to Ioctl to suppress an expected error 47 48 2 49 3 50 2008/02/12 Thomas Bretz (La Palma) -
trunk/MagicSoft/Cosy/candrv/canopen.cc
r8813 r8862 88 88 // In case of a PDO the conditional semaphore corresponding to this PDO 89 89 // is raised (WaitForNextPDO) 90 // HandleSDO: handles a SDO message91 // HandlePDO1/2/3/4: handles received PDOs90 // HandleSDO: handles a SDO message 91 // HandlePDO1/2/3/4: handles received PDOs 92 92 // 93 93 void CanOpen::HandleCanMessage(WORD_t cobid, const BYTE_t *data, const timeval_t &tv) … … 127 127 const WORD_t subidx = data[3]; 128 128 129 cout << "SND NODE: " << (int)node << " " << flush;129 //cout << "SDO_rx: node=" << (int)node << hex << " cmd=0x" << (int)cmd << " idx=0x" << idx << " subidx=0x" << subidx << dec << endl; 130 130 HandleSDO(node, cmd, idx, subidx, dat, tv); 131 131 -
trunk/MagicSoft/Cosy/candrv/ethernet.cc
r8856 r8862 39 39 ClassImp(Ethernet); 40 40 41 #undef DEBUG 42 41 43 using namespace std; 42 44 … … 54 56 // 55 57 Ethernet::Ethernet(const char *addr, const int tx, const int rx, CanOpen *receiver) 56 : MTcpIpI(rx), Interface(receiver), fTxAddress(addr), fTxPort(tx)58 : MTcpIpI(rx),/* MTcpIpO(addr, tx),*/ Interface(receiver), fTxAddress(addr), fTxPort(tx) 57 59 { 58 60 gLog << inf2 << "- Ethernet initialized." << endl; … … 81 83 msg.data[1] = 0; 82 84 85 const TString address = MTcpIpO::GetSocketAddress(rx); 86 83 87 while (!IsThreadCanceled()) 84 88 { … … 100 104 if (len==0) 101 105 { 102 // THIS MEANS CONNECTIION LOST!!!! 103 cout << "============> LEN==0 (CONNECTION LOST?)" << endl; 104 break; // This break is for TEST PURPOSE FIXME!!! 106 gLog << warn << "WARNING - Connection lost (received 0bytes) to " << address << endl; 107 //break; // This break is for TEST PURPOSE FIXME!!! 105 108 continue; 106 109 } … … 109 112 if (len>1) 110 113 { 111 cout << "Data too long!!!" << endl;114 gLog << err << "Data received from " << address << " is more than one byte!" << endl; 112 115 break; 113 116 } … … 117 120 if (c>=MSGLEN) 118 121 { 119 cout << " Received datatoo long (> " << MSGLEN << ")" << endl;122 cout << "Data received from " << address << " too long (> " << MSGLEN << ")" << endl; 120 123 break; 121 124 } … … 133 136 continue; 134 137 138 #ifdef DEBUG 135 139 cout << "*** RcvdCanFrame len=" << dec << msg.len << ": "; 136 140 for (int i=0; i<msg.len; i++) 137 141 cout << "0x" << setfill('0') << setw(2) << hex << (int)((msg.data+2)[i]) << " "; 138 cout << endl; 142 cout << dec << endl; 143 #endif 139 144 140 145 pos = -1; … … 192 197 */ 193 198 199 #ifdef DEBUG 194 200 // FIXME: MUST BECOME NON-BLOCKING!!!!! 195 cout << "*** Send CanFrame over IP " << endl;201 cout << "*** Send CanFrame over IP " << endl; 196 202 // FIXME: MUST BECOME NON-BLOCKING!!!!! 203 #endif 197 204 198 205 MTcpIpO::SendFrame(fTxAddress, fTxPort, (char*)(msg.data+1), msg.len-1); 206 //Send((char*)(msg.data+1), msg.len-1); 199 207 200 208 /* -
trunk/MagicSoft/Cosy/candrv/ethernet.h
r8856 r8862 10 10 #endif 11 11 12 class Ethernet : public MTcpIpI, public Interface12 class Ethernet : public MTcpIpI, /*public MTcpIpO,*/ public Interface 13 13 { 14 14 private: -
trunk/MagicSoft/Cosy/candrv/interface.cc
r8854 r8862 56 56 void Interface::HandleMessage(const Message &msg) const 57 57 { 58 if ( fReceiver)58 if (!fReceiver) 59 59 return; 60 60 -
trunk/MagicSoft/Cosy/candrv/network.cc
r8835 r8862 132 132 for (int i=0; i<8; i++) 133 133 gLog << " 0x" << (int)data[i]; 134 gLog << endl;134 gLog << dec << endl; 135 135 return; 136 136 } … … 150 150 for (int i=0; i<8; i++) 151 151 gLog << " 0x" << (int)data[i]; 152 gLog << endl;152 gLog << dec << endl; 153 153 return; 154 154 } … … 168 168 for (int i=0; i<8; i++) 169 169 gLog << " 0x" << (int)data[i]; 170 gLog << endl;170 gLog << dec << endl; 171 171 return; 172 172 } … … 186 186 for (int i=0; i<8; i++) 187 187 gLog << " 0x" << (int)data[i]; 188 gLog << endl;188 gLog << dec << endl; 189 189 return; 190 190 } -
trunk/MagicSoft/Cosy/cosy.cc
r8860 r8862 10 10 #include "vmodican.h" 11 11 12 #include "MEnv.h" 12 13 #include "MArgs.h" 13 14 #include "MCosy.h" … … 50 51 gLog << " Options:" << endl; 51 52 gLog.Usage(); 53 gLog << " --debug-env=0 Disable debugging setting resources <default>" << endl; 54 gLog << " --debug-env[=1] Display untouched resources after program execution" << endl; 55 gLog << " --debug-env=2 Display untouched resources after eventloop setup" << endl; 56 gLog << " --debug-env=3 Debug setting resources from resource file and command line" << endl; 57 gLog << " --debug-mem Debug memory usage" << endl << endl; 52 58 gLog << " --debug-threads Debug threads" << endl << endl; 59 gLog << " --rc=Name:option Set or overwrite a resource of the resource file." << endl << endl; 53 60 gLog << " --version, -V Show startup message with version number" << endl; 54 61 gLog << " -?, -h, --help This help" << endl << endl; … … 80 87 } 81 88 82 const Int_t channel = arg.GetIntAndRemove("--channel=", 0); 83 const Bool_t kDebugMem = arg.HasOnlyAndRemove("--debug-mem"); 84 const Bool_t kDebugThreads = arg.HasOnlyAndRemove("--debug-threads"); 89 const Int_t channel = arg.GetIntAndRemove("--channel=", 0); 90 const Bool_t kDebugMem = arg.HasOnlyAndRemove("--debug-mem"); 91 const Bool_t kDebugThreads = arg.HasOnlyAndRemove("--debug-threads"); 92 const TString sps = arg.GetStringAndRemove("--sps=", "127.0.0.1"); 93 const TString ceco = arg.GetStringAndRemove("--cc=", "ceco"); // ceco 94 const TString pointing = arg.GetStringAndRemove("--pointing-model=", "bending2.txt"); // ceco 95 const TString kConfig = arg.GetStringAndRemove("--config=", ".cosyrc"); // ceco 96 Int_t kDebugEnv = arg.HasOnlyAndRemove("--debug-env") ? 1 : 0; 97 kDebugEnv = arg.GetIntAndRemove("--debug-env=", kDebugEnv); 85 98 86 99 // … … 93 106 return 2; 94 107 } 95 /* 108 96 109 // 97 110 // Now we access/read the resource file. This will remove all … … 108 121 if (!env.TakeEnv(arg, kDebugEnv>2)) 109 122 return 0xfd; 110 */ 123 111 124 // 112 125 // check for the right usage of the program (number of options) … … 178 191 } 179 192 */ 180 MCosy *cosy = new MCosy( );181 182 Interface *interface = new Ethernet( "127.0.0.1", 5357, 5358, cosy);193 MCosy *cosy = new MCosy(env, ceco, pointing); 194 195 Interface *interface = new Ethernet(sps, 5357, 5358, cosy); 183 196 // Interface *interface = new VmodIcan(cosy, "/dev/dpm_00", 125); 184 197 185 198 gLog << all << "- Starting MCosy." << endl; 186 199 187 cosy->Start(); 200 cosy->Start(env); 201 202 // FIXME: Is this the right position? 203 if (kDebugEnv>0) 204 env.PrintUntouched(); 205 188 206 189 207 MStarguider *client=0; -
trunk/MagicSoft/Cosy/devdrv/shaftencoder.cc
r8835 r8862 278 278 // Decode information, we have a 14bit only 279 279 // 280 LWORDS_t pos = data[0] | (data[1]<<8) | (data[2]<<16) ; //| (data[3]<<24);280 LWORDS_t pos = data[0] | (data[1]<<8) | (data[2]<<16) | (data[3]<<24); 281 281 282 282 fVel = data[4] | (data[5]<<8); … … 465 465 return; 466 466 467 fPos = pre% 16384;468 fTurn = pre/ 16384;467 fPos = pre%fTicks; 468 fTurn = pre/fTicks; 469 469 fDirChangedPos = fPos; 470 470 fOffset = fMotor ? fMotor->GetPdoPos() : 0; -
trunk/MagicSoft/Cosy/devdrv/shaftencoder.h
r8835 r8862 22 22 WORDS_t fAcc; // ticks per 25ms^2 23 23 WORDS_t fTurn; // Number of turn 24 LWORD_t fTicks; // Number of ticks per turn24 LWORD_t fTicks; // Number of ticks per revolution (resolution) 25 25 WORD_t fTurns; // Number of possible turns 26 26 -
trunk/MagicSoft/Cosy/main/MCosy.cc
r8856 r8862 16 16 #include "MLogManip.h" 17 17 18 #include "MEnv.h" 18 19 #include "MTime.h" 19 20 #include "MPointing.h" … … 140 141 141 142 // 142 // Get the values 143 // 144 int p1 = (fZd1->GetPos() +8192)%16384;145 int p2 = -(fZd2->GetPos() +8192)%16384;143 // Get the values (FIXME!) 144 // 145 int p1 = (fZd1->GetPos()/*+8192*/)%fZd1->GetPhysRes(); 146 int p2 = -(fZd2->GetPos()/*+8192*/)%fZd2->GetPhysRes(); 146 147 147 148 if (fZd1->IsZombieNode()) … … 930 931 } 931 932 932 void MCosy::ReadConfig() 933 { 934 gLog << inf2 << "Reading configuration file..." << flush; 935 TEnv env(".cosyrc"); 936 gLog << "done." << endl; 937 933 void MCosy::ReadConfig(MEnv &env) 934 { 938 935 gLog << inf2 << "Reading telescope range..." << flush; 939 936 const Double_t amin = env.GetValue("Az_Min[deg]", -95.0); … … 946 943 gLog << "done." << endl; 947 944 948 gLog << all << " * Min: " << zmin << "deg " << amin << "deg" << endl; 949 gLog << all << " * Max: " << zmax << "deg " << amax << "deg" << endl; 945 gLog << all << flush; 946 947 gLog << " * Min: " << zmin << "deg " << amin << "deg" << endl; 948 gLog << " * Max: " << zmax << "deg " << amax << "deg" << endl; 950 949 951 950 fMin = fBending.AddOffsets(fMin/TMath::RadToDeg()); 952 951 fMax = fBending.AddOffsets(fMax/TMath::RadToDeg()); 953 952 954 gLog << all << " * Min': " << fMin.Zd()*TMath::RadToDeg() << "deg " << fMin.Az()*TMath::RadToDeg() << "deg" << endl; 955 gLog << all << " * Max': " << fMax.Zd()*TMath::RadToDeg() << "deg " << fMax.Az()*TMath::RadToDeg() << "deg" << endl; 956 957 gLog << inf2 << "Reading gear ratios..." << flush; 958 // kGear.X(env.GetValue("Zd_GearRatio[U_mot/U_tel]", 1000.0)); 959 // kGear.Y(env.GetValue("Az_GearRatio[U_mot/U_tel]", 1000.0)); 953 gLog << " * Min': " << fMin.Zd()*TMath::RadToDeg() << "deg " << fMin.Az()*TMath::RadToDeg() << "deg" << endl; 954 gLog << " * Max': " << fMax.Zd()*TMath::RadToDeg() << "deg " << fMax.Az()*TMath::RadToDeg() << "deg" << endl; 955 960 956 kGear.Set(env.GetValue("Zd_GearRatio[U_mot/U_tel]", 1000.0), 961 957 env.GetValue("Az_GearRatio[U_mot/U_tel]", 1000.0)); … … 975 971 kResRE.Set(x,y); 976 972 977 x = zd1 ? fZd1->GetPhysRes() : (zd2 ? fZd2->GetPhysRes() : env.GetValue("Zd_ResSE[se/U_mot]", 16384)); 978 y = az ? fAz->GetPhysRes() : env.GetValue("Az_ResSE[se/U_mot]", 16384); 973 gLog << " * Az RE resolution: " << x << " re/U_mot" << endl; 974 gLog << " * Zd RE resolution: " << y << " re/U_mot" << endl; 975 976 x = zd1 ? fZd1->GetPhysRes() : (zd2 ? fZd2->GetPhysRes() : env.GetValue("Zd_ResSE[se/U_tel]", 16384)); 977 y = az ? fAz->GetPhysRes() : env.GetValue("Az_ResSE[se/U_tel]", 16384); 979 978 kResSE.Set(x,y); 979 980 gLog << " * Az SE resolution: " << x << " se/U_tel" << endl; 981 gLog << " * Zd SE resolution: " << y << " se/U_tel" << endl; 980 982 981 983 /* … … 1019 1021 // kGearTot = kResRE*kGear; 1020 1022 1021 gLog << "done." << endl; 1022 1023 gLog << all; 1024 gLog << " * Setting Gear Ratios:" << endl; 1025 gLog << " --------------------" << endl; 1023 // gLog << all; 1024 // gLog << " * Setting Gear Ratios:" << endl; 1025 // gLog << " --------------------" << endl; 1026 1026 gLog << " * X: " << kGear.X() << "*" << kResRE.X()/4 << "/" << kResSE.X() << "=4*" << kGearTot.X() << "/" << kResSE.X() << endl; 1027 1027 gLog << " * Y: " << kGear.Y() << "*" << kResRE.Y()/4 << "/" << kResSE.Y() << "=4*" << kGearTot.Y() << "/" << kResSE.Y() << endl; … … 1065 1065 1066 1066 gLog << inf2 << "Starting Shaftencoder Test..." << endl; 1067 1068 gLog << err << "Build in values!!!" << endl; 1067 1069 1068 1070 while (fBackground==kBgdSeTest) … … 1434 1436 // turn on the gui update 1435 1437 // 1436 void MCosy::Start( )1438 void MCosy::Start(MEnv &env) 1437 1439 { 1438 1440 // Don't call this function twice! … … 1441 1443 CheckForError(); 1442 1444 1443 ReadConfig( );1445 ReadConfig(env); 1444 1446 1445 1447 gLog << inf << "- Starting TX Thread." << endl; … … 1610 1612 } 1611 1613 1612 MCosy::MCosy( )1614 MCosy::MCosy(MEnv &env, const char *addr, const char *pointing) 1613 1615 : Network(), fObservatory(MObservatory::kMagic1), fStarguider(NULL), 1614 1616 fZd1(0), fZd2(0), fAz(0), fMac1(0), fMac2(0), fMac3(0), … … 1616 1618 fOutTp(0), fOutRep(0) 1617 1619 { 1618 TEnv env(".cosyrc");1619 1620 const Int_t id1 = env.GetValue("Az_Id-MAC1", 1); //1 1620 1621 const Int_t id2 = env.GetValue("Az_Id-MAC2", 2); //2 … … 1637 1638 { 1638 1639 case 0: 1639 gLog << "<<Standard mode>>" << endl;*/ 1640 fBending.Load("bending.txt"); 1640 gLog << "<<Standard mode>>" << endl;*/ 1641 gLog << all << "Reading pointing model from " << pointing << "..." << endl; 1642 if (fBending.Load(pointing)) 1643 gLog << all << "Reading pointing model from " << pointing << " successfull." << endl; 1644 else 1645 gLog << err << "ERROR - Reading pointing model from " << pointing << endl; 1641 1646 Constructor(id1, id2, id3, id4, id5, id6);/* 1642 1647 break; … … 1651 1656 } 1652 1657 */ 1658 1653 1659 gLog.SetOutputGui(fWin->GetLog(), kTRUE); 1654 1660 … … 1657 1663 fAz->SetDisplay(fWin->GetLabel1()); 1658 1664 1659 fCom = new MDriveCom(this, fOutRep);1665 fCom = new MDriveCom(this, addr, fOutRep); 1660 1666 // fCom->Start(); 1661 1667 } -
trunk/MagicSoft/Cosy/main/MCosy.h
r8859 r8862 52 52 class MStarguider; 53 53 class MDriveCom; 54 class MEnv; 54 55 55 56 class MTTalk : public MThread … … 173 174 //void ConstructorDemo(); 174 175 175 void ReadConfig( );176 void ReadConfig(MEnv &env); 176 177 177 178 bool CheckNetwork(); 178 179 180 void Start() { } 181 179 182 public: 180 MCosy( );183 MCosy(MEnv &env, const char *addr, const char *pointing); 181 184 ~MCosy(); 182 185 183 void Start( );186 void Start(MEnv &env); 184 187 void Stop(); 185 188 -
trunk/MagicSoft/Cosy/tcpip/MCeCoCom.h
r8856 r8862 48 48 49 49 public: 50 MCeCoCom( MLog *out)51 : MTcpIpIO( "ceco", 7304, 7404), fOut(out), fStatus(0), fComStat(kNoCmdReceived),50 MCeCoCom(const char *addr, MLog *out) 51 : MTcpIpIO(addr, 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/MDriveCom.h
r8816 r8862 41 41 }; 42 42 43 MDriveCom(MsgQueue *q, MLog *out) : MCeCoCom(out), fQueue(q) {}43 MDriveCom(MsgQueue *q, const char *addr, MLog *out) : MCeCoCom(addr, out), fQueue(q) {} 44 44 45 45 bool SendReport(UInt_t stat, RaDec rd, ZdAz so, ZdAz is, ZdAz er); -
trunk/MagicSoft/Cosy/tcpip/MTcpIpIO.cc
r8856 r8862 8 8 #include "MLog.h" 9 9 #include "MLogManip.h" 10 11 #include "MString.h" 10 12 11 13 #undef DEBUG … … 55 57 } 56 58 59 TString MTcpIpO::GetSocketAddress(const TSocket &s) 60 { 61 if (!s.IsValid()) 62 return "n/a"; 63 64 const TInetAddress &a = s.GetInetAddress(); 65 if (!a.IsValid()) 66 return "undefined"; 67 68 return MString::Format("%s:%d", a.GetHostAddress(), a.GetPort()); 69 } 70 71 TString MTcpIpO::GetSocketAddress() const 72 { 73 return GetSocketAddress(*fTxSocket); 74 } 75 57 76 bool MTcpIpO::SendFrame(TSocket &tx, const char *msg, int len) 58 77 { 59 78 if (!tx.IsValid()) 60 79 { 61 // cout << "*!* Transmit socket invalid!" << endl;80 //gLog << warn << "WARNING - No transmission to " << GetSocketAddress(tx) << " possible." << endl; 62 81 return false; 63 82 } … … 66 85 if (l<0) 67 86 { 68 cout << "ERROR - Sending Message"<< endl;87 gLog << err << "ERROR - Sending TCP/IP frame to " << GetSocketAddress(tx) << endl; 69 88 return false; 70 89 } … … 72 91 if (l!=len) 73 92 { 74 cout << "Send wrong number (" << l << ") of Bytes."<< endl;93 gLog << err << "ERROR - Sent wrong number (" << l << ") of bytes to " << GetSocketAddress(tx) << endl; 75 94 return false; 76 95 } … … 86 105 { 87 106 // R__LOCKGUARD2(myMutex); 88 107 #ifdef DEBUG 89 108 cout << "Connecting to " << addr << ":" << port << endl; 109 #endif 90 110 91 111 // FIXME: Set tx-socket to nonblocking? 92 112 TSocket tx(addr, port); 93 //return SendFrame(tx, msg, len);94 113 return SendFrame(tx, msg, len); 114 /* 95 115 if (!tx.IsValid()) 96 116 { 97 //cout << "*!* Transmit socket invalid!" << endl;98 return false; 99 } 100 101 cout<< "Sending to " << addr << ":" << port << endl;117 gLog << warn << "WARNING - No transmission to " << addr << ":" << port << " possible." << endl; 118 return false; 119 } 120 121 gLog << dbg << "Sending to " << addr << ":" << port << endl; 102 122 103 123 const Int_t l = tx.SendRaw(msg, len, kDontBlock); 104 124 if (l<0) 105 125 { 106 cout << "ERROR - Sending Message"<< endl;126 gLog << err << "ERROR - Sending TCP/IP frame to " << addr << ":" << port << endl; 107 127 return false; 108 128 } … … 110 130 if (l!=len) 111 131 { 112 cout << "Send wrong number (" << l << ") of Bytes."<< endl;132 gLog << err << "ERROR - Sent wrong number (" << l << ") of bytes to " << addr << ":" << port << endl; 113 133 return false; 114 134 } … … 119 139 120 140 return true; 141 */ 121 142 } 122 143 … … 188 209 gLog << inf << "- Starting receiver on port " << fPortRx << "..." << endl; 189 210 211 // if (fPortRx==7404) 212 // { 213 // gLog << err << "CeCo communication skipped." << endl; 214 // return 0; 215 // } 216 190 217 TServerSocket *fServSock=NULL; 191 218 TSocket *fRxSocket=NULL; … … 197 224 if (!fServSock->IsValid()) 198 225 { 199 cout<< "ServerSocket on port " << fPortRx << " invalid: ";226 gLog << err << "ServerSocket on port " << fPortRx << " invalid: "; 200 227 switch (fServSock->GetErrorCode()) 201 228 { 202 case 0: cout<< "No error." << endl; break;203 case -1: cout<< "low level socket() call failed." << endl; break;204 case -2: cout<< "low level bind() call failed." << endl; break;205 case -3: cout<< "low level listen() call failed." << endl; break;206 default: cout<< "Unknown." << endl; break;229 case 0: gLog << "No error." << endl; break; 230 case -1: gLog << "low level socket() call failed." << endl; break; 231 case -2: gLog << "low level bind() call failed." << endl; break; 232 case -3: gLog << "low level listen() call failed." << endl; break; 233 default: gLog << "Unknown." << endl; break; 207 234 } 208 235 delete fServSock; … … 214 241 fServSock->SetOption(kNoBlock, 1); 215 242 216 cout<< "Waiting for connection on port " << fPortRx << "..." << endl;243 gLog << all << "Waiting for connection on port " << fPortRx << "..." << endl; 217 244 // while (!HasStopFlag() && (Long_t)fRxSocket<=0) 218 245 while (!IsThreadCanceled() && (Long_t)fRxSocket<=0) … … 247 274 } 248 275 249 cout<< "Connection established on port " << fPortRx << "." << endl;276 gLog << all << "Connection established on port " << fPortRx << "." << endl; 250 277 251 278 fRxSocket->SetOption(kNoBlock, 1); -
trunk/MagicSoft/Cosy/tcpip/MTcpIpIO.h
r8856 r8862 40 40 ~MTcpIpO(); 41 41 42 static bool SendFrame(TSocket &tx, const char *msg, int len); 43 static bool SendFrame(const char *addr, int port, const char *msg, int len); 42 static TString GetSocketAddress(const TSocket &s); 43 static bool SendFrame(TSocket &tx, const char *msg, int len); 44 static bool SendFrame(const char *addr, int port, const char *msg, int len); 44 45 45 bool Send(const char *msg, int len); 46 TString GetSocketAddress() const; 47 bool Send(const char *msg, int len); 46 48 }; 47 49 -
trunk/MagicSoft/Cosy/videodev/MVideo.cc
r8861 r8862 101 101 // Mapper around ioctl for easier access to the device 102 102 // 103 int MVideo::Ioctl(int req, void *opt, bool allowirq ) const103 int MVideo::Ioctl(int req, void *opt, bool allowirq, bool force) const 104 104 { 105 105 if (fFileDesc<0) … … 129 129 } 130 130 131 gLog << err << "ERROR - MVideo::Ioctl 0x" << hex << req << ": errno=" << dec << errno << " - "; 132 gLog << strerror(errno) << " (rc=" << rc << ")" << endl; 131 if (!force) 132 { 133 gLog << err << "ERROR - MVideo::Ioctl 0x" << hex << req << ": errno=" << dec << errno << " - "; 134 gLog << strerror(errno) << " (rc=" << rc << ")" << endl; 135 } 133 136 return rc; 134 137 } … … 186 189 while (1) 187 190 { 188 if (Ioctl (VIDIOC_QUERYCTRL, &qctrl)==-1)191 if (Ioctl(VIDIOC_QUERYCTRL, &qctrl, true, true)==-1) 189 192 break; 190 193 … … 769 772 void MVideo::Print() const 770 773 { 771 gLog << all ;774 gLog << all << dec; 772 775 773 776 gLog << "Device " << fPath << " " << (IsOpen()?"open":"closed") << "." << endl; … … 818 821 gLog << dec << endl; 819 822 820 gLog << "Controls:" << endl;823 gLog << inf2 << "Controls:" << endl; 821 824 fControls.Print(); 822 825 } -
trunk/MagicSoft/Cosy/videodev/MVideo.h
r8861 r8862 62 62 63 63 private: 64 int Ioctl(int req, void *opt, bool allowirq=true ) const;64 int Ioctl(int req, void *opt, bool allowirq=true, bool force=false) const; 65 65 66 66 void Reset();
Note:
See TracChangeset
for help on using the changeset viewer.