Changeset 10859 for trunk/FACT++
- Timestamp:
- 05/27/11 13:34:43 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/fadctrl.cc
r10844 r10859 812 812 switch (fStatus2[i->first]) 813 813 { 814 case 0: str << "1-7:not connected)"; break;815 case 1: str << "1-7:connecting [" << GetNumConnected(i->first) << "])";break;816 case 2: str << "1-7:connected)";break;814 case 0: str << "1-7:not connected)"; break; 815 case 7: str << "1-7:connected)"; break; 816 default: str << "1-7:connecting [" << fStatus2[i->first] << "])"; break; 817 817 } 818 818 … … 882 882 { 883 883 vector<string> addr; 884 for (BoardList::iterator i=fBoards.begin(); i!=fBoards.end(); i++) 884 885 for (BoardList::const_iterator i=fBoards.begin(); i!=fBoards.end(); i++) 885 886 addr.push_back(i->second.first); 886 887 … … 959 960 vector<char> stat1(40); 960 961 vector<char> stat2(40); 962 963 int cnt = 0; 961 964 for (BoardList::const_iterator i=fBoards.begin(); i!=fBoards.end(); i++) 962 965 { 963 966 const ConnectionFAD &c = *i->second.second; 964 965 const int &idx = i->first;966 967 967 968 // ----- Command socket ----- 968 969 if (c.IsConnecting()) 969 970 { 970 stat1[i dx] = 1;971 stat1[i->first] = 1; 971 972 nconnecting1++; 972 973 } 973 974 if (c.IsConnected()) 974 975 { 975 stat1[i dx] = 2;976 stat1[i->first] = 2; 976 977 nconnected1++; 977 978 } 978 979 979 980 // ----- Event builder ----- 980 if (!IsConnected(idx) && !IsDisconnected(idx))981 { 982 stat2[idx] = 1;981 stat2[i->first] = GetNumConnected(cnt); 982 983 if (!IsConnected(cnt) && !IsDisconnected(cnt)) 983 984 nconnecting2++; 984 } 985 986 if (IsConnected(idx)) 987 { 988 stat2[idx] = 2; 985 986 if (IsConnected(cnt)) 989 987 nconnected2++; 990 }991 988 } 992 989 … … 1195 1192 SetMaxMemory(conf.Get<unsigned int>("max-mem")); 1196 1193 1194 // vvvvv for debugging vvvvv 1195 if (conf.Has("debug-port")) 1196 { 1197 const int port = conf.Get<unsigned int>("debug-port"); 1198 const int num = conf.Get<unsigned int>("debug-num"); 1199 for (int i=0; i<num; i++) 1200 { 1201 ostringstream str; 1202 str << "localhost:" << port+8*i; 1203 AddEndpoint(str.str()); 1204 } 1205 Connect(); 1206 return true; 1207 } 1208 // ^^^^^ for debugging ^^^^^ 1209 1197 1210 if (!(conf.Has("base-addr") ^ conf.Has("addr"))) 1198 1211 { … … 1355 1368 po::options_description control("FAD control options"); 1356 1369 control.add_options() 1357 // ("addr,a", var<string>("localhost:5000"), "Network address of FTM")1358 1370 ("quiet,q", po_bool(), "Disable printing contents of all received messages in clear text.") 1359 1371 ("hex-out", po_bool(), "Enable printing contents of all printed messages also as hex data.") 1360 1372 ("data-out", po_bool(), "Enable printing received event data.") 1373 ; 1374 1375 po::options_description builder("Event builder options"); 1376 builder.add_options() 1377 ("max-mem,m", var<unsigned int>(100), "Maximum memory the event builder thread is allowed to consume for its event buffer") 1378 ; 1379 1380 po::options_description connect("FAD connection options"); 1381 connect.add_options() 1361 1382 ("addr", vars<string>(), "Network address of FAD") 1362 1383 ("base-addr", var<string>(), "Base address of all FAD") 1363 ("max-mem,m", var<unsigned int>(100), "Maximum memory the event builder thread is allowed to consume for its event buffer") 1384 ("debug-num,n", var<unsigned int>(40), "Sets the number of fake boards to be connected locally") 1385 ("debug-port,p", var<unsigned int>(), "Sets <debug-num> addresses to 'localhost:<debug-port>' in steps of 8") 1364 1386 ; 1365 1387 … … 1368 1390 conf.AddOptions(config); 1369 1391 conf.AddOptions(control); 1392 conf.AddOptions(builder); 1393 conf.AddOptions(connect); 1370 1394 } 1371 1395
Note:
See TracChangeset
for help on using the changeset viewer.