Changeset 11118
- Timestamp:
- 06/22/11 20:17:06 (13 years ago)
- Location:
- trunk/FACT++/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/Connection.cc
r10983 r11118 19 19 using boost::lexical_cast; 20 20 using ba::ip::tcp; 21 22 #define DEBUG_TX23 21 24 22 // -------- Abbreviations for starting async tasks --------- … … 177 175 else 178 176 { 179 #ifdef DEBUG_TX 180 ostringstream msg; 181 msg << n << " bytes successfully sent to " << URL(); 182 Message(msg); 183 #endif 177 if (fDebugTx) 178 { 179 ostringstream msg; 180 msg << n << " bytes successfully sent to " << URL(); 181 Message(msg); 182 } 184 183 } 185 184 -
trunk/FACT++/src/Connection.h
r11093 r11118 17 17 std::string fAddress; 18 18 std::string fPort; 19 20 bool fDebugTx; 19 21 20 22 enum ConnectionStatus_t … … 107 109 bool IsConnecting() const { return fConnectionStatus==kConnecting; } 108 110 111 void SetDebugTx(bool b=true) { fDebugTx=b; } 112 109 113 std::string URL() const { return fAddress + ":" + fPort; } 110 114 }; -
trunk/FACT++/src/fadctrl.cc
r11116 r11118 574 574 bool fIsHexOutput; 575 575 bool fIsDataOutput; 576 bool fDebugTx; 576 577 577 578 bool CheckEventSize(size_t has, const char *name, size_t size) … … 840 841 return T::kSM_FatalError; 841 842 842 for (BoardList::iterator i=fBoards.begin(); i!=fBoards.end(); i++)843 for (BoardList::iterator i=fBoards.begin(); i!=fBoards.end(); i++) 843 844 i->second.second->SetDataOutput(evt.GetBool()); 845 846 return T::GetCurrentState(); 847 } 848 849 int SetDebugTx(const EventImp &evt) 850 { 851 if (!CheckEventSize(evt.GetSize(), "SetDebugTx", 1)) 852 return T::kSM_FatalError; 853 854 for (BoardList::iterator i=fBoards.begin(); i!=fBoards.end(); i++) 855 i->second.second->SetDebugTx(evt.GetBool()); 844 856 845 857 return T::GetCurrentState(); … … 1083 1095 1084 1096 ptr->SetEndpoint(str.str()); 1085 1097 ptr->StartConnect(); 1086 1098 } 1087 1099 … … 1269 1281 fBoards[i].second->SetHexOutput(fIsHexOutput); 1270 1282 fBoards[i].second->SetDataOutput(fIsDataOutput); 1283 fBoards[i].second->SetDebugTx(fDebugTx); 1271 1284 } 1272 1285 … … 1405 1418 T::AddEvent("SET_VERBOSE", "B:1") 1406 1419 (boost::bind(&StateMachineFAD::SetVerbosity, this, _1)) 1407 (" set verbosity state"1420 ("Set verbosity state" 1408 1421 "|verbosity[bool]:disable or enable verbosity for received data (yes/no), except dynamic data"); 1409 1422 1410 1423 T::AddEvent("SET_HEX_OUTPUT", "B:1") 1411 1424 (boost::bind(&StateMachineFAD::SetHexOutput, this, _1)) 1412 (" enable or disable hex output for received data"1425 ("Enable or disable hex output for received data" 1413 1426 "|hexout[bool]:disable or enable hex output for received data (yes/no)"); 1414 1427 … … 1416 1429 (boost::bind(&StateMachineFAD::SetDataOutput, this, _1)) 1417 1430 (""); 1431 1432 T::AddEvent("SET_DEBUG_TX", "B:1") 1433 (boost::bind(&StateMachineFAD::SetDebugTx, this, _1)) 1434 ("Enable or disable the output of messages in case of successfull data transmission to the boards." 1435 "|debug[bool]:disable or enable debug output for transmitted data (yes/no)"); 1418 1436 1419 1437 T::AddEvent("PRINT_EVENT", "S:1") … … 1543 1561 fIsHexOutput = conf.Get<bool>("hex-out"); 1544 1562 fIsDataOutput = conf.Get<bool>("data-out"); 1563 fDebugTx = conf.Get<bool>("debug-tx"); 1545 1564 1546 1565 SetMaxMemory(conf.Get<unsigned int>("max-mem")); … … 1712 1731 ("hex-out", po_bool(), "Enable printing contents of all printed messages also as hex data.") 1713 1732 ("data-out", po_bool(), "Enable printing received event data.") 1733 ("debug-tx", po_bool(), "Enable debugging of ethernet transmission.") 1714 1734 ; 1715 1735
Note:
See TracChangeset
for help on using the changeset viewer.