- Timestamp:
- 05/27/11 13:27:11 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/EventBuilderWrapper.h
r10854 r10856 79 79 } 80 80 81 void Start(const vector<string> &addr)81 void Start(const map<int,string> &addr) 82 82 { 83 83 if (IsThreadRunning()) … … 89 89 fMsg.Message("Starting EventBuilder thread"); 90 90 91 g_maxBoards = addr.size(); 92 g_actBoards = g_maxBoards; 93 94 g_runStat = kModeRun; 95 96 int i=0; 97 for (vector<string>::const_iterator it=addr.begin(); it!=addr.end(); it++) 91 int cnt = 0; 92 for (int i=0; i<40; i++) 98 93 { 99 94 //g_ip[i].port = 5000; 100 memset(g_ip[ i].addr, 0, 100);95 memset(g_ip[cnt].addr, 0, sizeof(g_ip[cnt].addr)); 101 96 //strncpy(g_ip[i].addr, it->c_str(), 99); 102 97 103 size_t pos = it->find_first_of(':'); 98 const map<int,string>::const_iterator it = addr.find(i); 99 if (it==addr.end()) 100 continue; 101 102 const string &dest = it->second; 103 104 size_t pos = dest.find_first_of(':'); 104 105 if (pos==string::npos) 105 106 continue; 106 107 107 string a = it->substr(0, pos);108 string p = it->substr(pos+1);109 110 strcpy(g_ip[ i].addr, "127.0.0.1");111 g_ip[ i].port = atoi(p.c_str());112 113 i++;108 string a = dest.substr(0, pos); 109 string p = dest.substr(pos+1); 110 111 strcpy(g_ip[cnt].addr, "127.0.0.1"); 112 g_ip[cnt].port = atoi(p.c_str()); 113 114 cnt++; 114 115 } 116 117 g_maxBoards = cnt; 118 g_actBoards = cnt; 119 120 g_runStat = kModeRun; 115 121 116 122 fThread = boost::thread(StartEvtBuild); … … 146 152 147 153 bool IsConnected(int i) const { return gi_NumConnect[i]==7; } 148 bool IsDisconnected(int i) const { return gi_NumConnect[i] ==0; }154 bool IsDisconnected(int i) const { return gi_NumConnect[i]<=0; } 149 155 int GetNumConnected(int i) const { return gi_NumConnect[i]; } 150 156
Note:
See TracChangeset
for help on using the changeset viewer.