Changeset 10439
- Timestamp:
- 04/21/11 09:50:11 (14 years ago)
- Location:
- trunk/FACT++/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/DimNetwork.cc
r10420 r10439 3 3 StateClient::StateClient(const std::string &name, MessageImp &imp) : 4 4 MessageDimRX(name, imp), fState(-2), 5 fInfoState((name + "/STATE").c_str(), const_cast<char*>(""), this)5 fInfoState((name + "/STATE").c_str(), const_cast<char*>(""), 0, this) 6 6 { 7 7 } … … 20 20 if (curr==&fInfoState) 21 21 { 22 const char *txt = fInfoState.getString();22 const bool disconnected = fInfoState.getSize()==0; 23 23 24 fState = strlen(txt)==0? -2 : fInfoState.getQuality();24 fState = disconnected ? -2 : fInfoState.getQuality(); 25 25 fStateTime = Time(fInfoState.getTimestamp(), 26 26 fInfoState.getTimestampMillisecs()*1000); … … 28 28 const string name = fInfoState.getName(); 29 29 30 fMsg.StateChanged(fStateTime, name.substr(0, name.length()-6), txt, fState); 30 fMsg.StateChanged(fStateTime, name.substr(0, name.length()-6), 31 disconnected ? "" : fInfoState.getString(), fState); 31 32 32 33 return; -
trunk/FACT++/src/DimNetwork.h
r10419 r10439 22 22 int fState; /// -2 not initialized, -1 not connected, 0>= state of client 23 23 24 Dim StampedInfo fInfoState; /// The dim service subscription24 DimNetworkInfo fInfoState; /// The dim service subscription 25 25 26 26 protected: … … 33 33 int GetState() const { return fState; } 34 34 35 const char *GetName() const { return const_cast<Dim StampedInfo&>(fInfoState).getName(); }35 const char *GetName() const { return const_cast<DimNetworkInfo&>(fInfoState).getName(); } 36 36 }; 37 37 -
trunk/FACT++/src/MessageDim.cc
r10422 r10439 112 112 MessageDimRX::MessageDimRX(const std::string &name, MessageImp &imp) 113 113 : fMinLogLevel(0), fConnected(false), fMsg(imp), 114 fDimMessage((name+"/MESSAGE").c_str(), const_cast<char*>(""), this)114 fDimMessage((name+"/MESSAGE").c_str(), const_cast<char*>(""), 0, this) 115 115 { 116 116 } … … 127 127 return; 128 128 129 fConnected = getInfo()->getSize()!=0; 130 129 131 // The server is diconnected. Do nothing 130 if ( getInfo()->getTimestamp()==0 || getInfo()->getSize()==1)132 if (!fConnected) 131 133 { 132 fConnected=false;133 134 fMsg.Message("Disconnected."); 134 135 return; 135 136 } 136 137 fConnected=true;138 137 139 138 // skip all messages with a severity smaller than the minimum log level -
trunk/FACT++/src/MessageDim.h
r10422 r10439 26 26 #include <dic.hxx> // DimStampedInfo 27 27 28 class DimNetworkInfo : public DimStampedInfo 29 { 30 public: 31 DimNetworkInfo(const char *name, const char *nolink, int size, DimInfoHandler *ptr) 32 : DimStampedInfo(name, const_cast<char*>(nolink), size, ptr) 33 { 34 secs = 0; 35 millisecs = 0; 36 } 37 }; 38 28 39 class MessageDimRX : public DimInfoHandler 29 40 { … … 36 47 37 48 private: 38 Dim StampedInfo fDimMessage;49 DimNetworkInfo fDimMessage; 39 50 40 51 protected: … … 49 60 50 61 #endif 62 63 // ************************************************************************** 64 /** @class DimNetworkInfo 65 66 @brief Direct derivative of DimStampedInfo 67 68 Since secs and millisecs are not initialized in the base class 69 valgrind throws a couple of warnings debugging applications. 70 71 This derivative just initialized them with 0. It will be removed as 72 soon as the initialization was done in Dim itself. 73 74 **/ 75 // **************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.