Changeset 11126
- Timestamp:
- 06/22/11 23:30:34 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/fadctrl.cc
r11118 r11126 1173 1173 } 1174 1174 1175 bool fStatusT; 1175 1176 vector<uint8_t> fStatus1; 1176 1177 vector<uint8_t> fStatus2; … … 1236 1237 // ===== Send connection status via dim ===== 1237 1238 1238 if (fStatus1!=stat1 || fStatus2!=stat2 )1239 if (fStatus1!=stat1 || fStatus2!=stat2 || fStatusT!=IsThreadRunning()) 1239 1240 { 1240 1241 fStatus1 = stat1; 1241 1242 fStatus2 = stat2; 1242 UpdateConnectionStatus(stat1, stat2); 1243 fStatusT = IsThreadRunning(); 1244 UpdateConnectionStatus(stat1, stat2, IsThreadRunning()); 1243 1245 } 1244 1246 … … 1254 1256 return FAD::kConnecting; 1255 1257 1256 // cout << 1 << " " << nconnecting1 << " " << nconnected1 << " " << nclosed1 << endl;1257 // cout << 2 << " " << nconnecting2 << " " << nconnected2 << endl;1258 1259 1258 // nconnected1 == nconnected2 == 0 1260 1259 return IsThreadRunning() ? FAD::kDisconnected : FAD::kOffline; … … 1295 1294 } 1296 1295 */ 1297 void UpdateConnectionStatus(const vector<uint8_t> &stat1, const vector<uint8_t> &stat2 )1298 { 1299 vector<uint8_t> stat(4 0);1296 void UpdateConnectionStatus(const vector<uint8_t> &stat1, const vector<uint8_t> &stat2, bool thread) 1297 { 1298 vector<uint8_t> stat(41); 1300 1299 1301 1300 for (int i=0; i<40; i++) 1302 1301 stat[i] = stat1[i]+stat2[i]; 1303 1302 1304 fDimConnection.setData(stat.data(), 40); 1303 stat[40] = thread; 1304 1305 fDimConnection.setData(stat.data(), 41); 1305 1306 fDimConnection.updateService(); 1306 1307 } … … 1309 1310 StateMachineFAD(ostream &out=cout) : 1310 1311 T(out, "FAD_CONTROL"), EventBuilderWrapper(*static_cast<MessageImp*>(this)), ba::io_service::work(static_cast<ba::io_service&>(*this)), 1311 fStatus1(40), fStatus2(40), 1312 fDimConnection("FAD_CONTROL/CONNECTIONS", "C:40 ", "")1312 fStatus1(40), fStatus2(40), fStatusT(false), 1313 fDimConnection("FAD_CONTROL/CONNECTIONS", "C:40;C:1", "") 1313 1314 { 1314 1315 // ba::io_service::work is a kind of keep_alive for the loop.
Note:
See TracChangeset
for help on using the changeset viewer.