Changeset 13766
- Timestamp:
- 05/17/12 20:20:58 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/gui/FactGui.h
r13692 r13766 7 7 #include <valarray> 8 8 9 #include <boost/bind.hpp>10 9 #include <boost/regex.hpp> 11 10 … … 166 165 { 167 166 public: 168 boost::function<void(const QEvent &)> fFunction;169 170 FunctionEvent(const boost::function<void(const QEvent &)> &f)167 function<void(const QEvent &)> fFunction; 168 169 FunctionEvent(const function<void(const QEvent &)> &f) 171 170 : QEvent((QEvent::Type)QEvent::registerEventType()), 172 171 fFunction(f) { } … … 273 272 // ===================== Services and Commands ========================== 274 273 275 QStandardItem *AddServiceItem(const st d::string &server, const std::string &service, bool iscmd)274 QStandardItem *AddServiceItem(const string &server, const string &service, bool iscmd) 276 275 { 277 276 QListView *servers = iscmd ? fDimCmdServers : fDimSvcServers; … … 350 349 } 351 350 352 void AddServer(const st d::string &s)351 void AddServer(const string &s) 353 352 { 354 353 DimNetwork::AddServer(s); 355 354 356 355 QApplication::postEvent(this, 357 new FunctionEvent(b oost::bind(&FactGui::handleAddServer, this, s)));358 } 359 360 void AddService(const st d::string &server, const std::string &service, const std::string &fmt, bool iscmd)356 new FunctionEvent(bind(&FactGui::handleAddServer, this, s))); 357 } 358 359 void AddService(const string &server, const string &service, const string &fmt, bool iscmd) 361 360 { 362 361 QApplication::postEvent(this, 363 new FunctionEvent(b oost::bind(&FactGui::handleAddService, this, server, service, fmt, iscmd)));364 } 365 366 void RemoveService(st d::string server, std::string service, bool iscmd)362 new FunctionEvent(bind(&FactGui::handleAddService, this, server, service, fmt, iscmd))); 363 } 364 365 void RemoveService(string server, string service, bool iscmd) 367 366 { 368 367 UnsubscribeService(server+'/'+service, true); 369 368 370 369 QApplication::postEvent(this, 371 new FunctionEvent(b oost::bind(&FactGui::handleRemoveService, this, server, service, iscmd)));372 } 373 374 void RemoveAllServices(const st d::string &server)370 new FunctionEvent(bind(&FactGui::handleRemoveService, this, server, service, iscmd))); 371 } 372 373 void RemoveAllServices(const string &server) 375 374 { 376 375 UnsubscribeAllServices(server); 377 376 378 377 QApplication::postEvent(this, 379 new FunctionEvent(b oost::bind(&FactGui::handleRemoveAllServices, this, server)));380 } 381 382 void AddDescription(const st d::string &server, const std::string &service, const vector<Description> &vec)378 new FunctionEvent(bind(&FactGui::handleRemoveAllServices, this, server))); 379 } 380 381 void AddDescription(const string &server, const string &service, const vector<Description> &vec) 383 382 { 384 383 QApplication::postEvent(this, 385 new FunctionEvent(b oost::bind(&FactGui::handleAddDescription, this, server, service, vec)));384 new FunctionEvent(bind(&FactGui::handleAddDescription, this, server, service, vec))); 386 385 } 387 386 388 387 // ====================================================================== 389 388 390 void handleAddServer(const st d::string &server)389 void handleAddServer(const string &server) 391 390 { 392 391 const State s = GetState(server, GetCurrentState(server)); … … 394 393 } 395 394 396 void handleAddService(const st d::string &server, const std::string &service, const std::string &/*fmt*/, bool iscmd)395 void handleAddService(const string &server, const string &service, const string &/*fmt*/, bool iscmd) 397 396 { 398 397 QStandardItem *item = AddServiceItem(server, service, iscmd); … … 401 400 } 402 401 403 void handleRemoveService(const st d::string &server, const std::string &service, bool iscmd)402 void handleRemoveService(const string &server, const string &service, bool iscmd) 404 403 { 405 404 QListView *servers = iscmd ? fDimCmdServers : fDimSvcServers; … … 424 423 } 425 424 426 void handleRemoveAllServices(const st d::string &server)425 void handleRemoveAllServices(const string &server) 427 426 { 428 427 handleStateChanged(Time(), server, State(-2, "Offline", "No connection via DIM.")); … … 444 443 } 445 444 446 void handleAddDescription(const st d::string &server, const std::string &service, const vector<Description> &vec)445 void handleAddDescription(const string &server, const string &service, const vector<Description> &vec) 447 446 { 448 447 const bool iscmd = IsCommand(server, service)==true; … … 2606 2605 dat[i] -= fVecBiasVolt[entry.hv()]/fBiasOffsets[entry.hv()]*1e6; 2607 2606 2608 //dat[i] /= entry.group()==0 ? 4 : 5;2607 dat[i] *= 4.5 / (entry.group() ? 5 : 4); 2609 2608 2610 2609 fBiasCamA->SetEnable(i, uint16_t(ptr[entry.hv()])!=0x8000); … … 2622 2621 bool fChatOnline; 2623 2622 2624 void handleStateChanged(const Time &time, const st d::string &server,2623 void handleStateChanged(const Time &time, const string &server, 2625 2624 const State &s) 2626 2625 { … … 2983 2982 } 2984 2983 2985 void IndicateStateChange(const Time &time, const st d::string &server)2984 void IndicateStateChange(const Time &time, const string &server) 2986 2985 { 2987 2986 const State s = GetState(server, GetCurrentState(server)); 2988 2987 2989 2988 QApplication::postEvent(this, 2990 new FunctionEvent(b oost::bind(&FactGui::handleStateChanged, this, time, server, s)));2989 new FunctionEvent(bind(&FactGui::handleStateChanged, this, time, server, s))); 2991 2990 } 2992 2991 … … 2994 2993 { 2995 2994 QApplication::postEvent(this, 2996 new FunctionEvent(b oost::bind(&FactGui::handleWrite, this, time, txt, qos)));2995 new FunctionEvent(bind(&FactGui::handleWrite, this, time, txt, qos))); 2997 2996 2998 2997 return 0; … … 3057 3056 3058 3057 QApplication::postEvent(this, 3059 new FunctionEvent(b oost::bind(&FactGui::handleDimService, this, str)));3058 new FunctionEvent(bind(&FactGui::handleDimService, this, str))); 3060 3059 } 3061 3060 … … 3081 3080 //const boost::function<void()> f = boost::bind(handler, this, DimData(getInfo())); 3082 3081 3083 FunctionEvent *evt = new FunctionEvent(b oost::bind(&FactGui::CallInfoHandler, this, handler, DimData(getInfo())));3082 FunctionEvent *evt = new FunctionEvent(bind(&FactGui::CallInfoHandler, this, handler, DimData(getInfo()))); 3084 3083 // FunctionEvent *evt = new FunctionEvent(boost::bind(&FactGui::CallInfoHandler, this, f)); 3085 3084 // FunctionEvent *evt = new FunctionEvent(boost::bind(handler, this, DimData(getInfo()))));
Note:
See TracChangeset
for help on using the changeset viewer.