Changeset 17669
- Timestamp:
- 04/16/14 18:43:26 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/agilentctrl.cc
r17361 r17669 24 24 class ConnectionAgilent : public Connection 25 25 { 26 public: 27 static string fMode; 28 29 private: 26 30 bool fIsVerbose; 27 31 bool fDebugRx; … … 285 289 }; 286 290 291 string ConnectionAgilent::fMode; 292 287 293 // ------------------------------------------------------------------------ 288 294 … … 303 309 ConnectionDimAgilent(ba::io_service& ioservice, MessageImp &imp) : 304 310 ConnectionAgilent(ioservice, imp), 305 fDim("AGILENT_CONTROL /DATA", "F:1;F:1;F:1;F:1",311 fDim("AGILENT_CONTROL_"+fMode+"/DATA", "F:1;F:1;F:1;F:1", 306 312 "|U_nom[V]: Nominal output voltage" 307 313 "|U_mes[V]: Measured output voltage" … … 418 424 public: 419 425 StateMachineAgilent(ostream &out=cout) : 420 StateMachineAsio<T>(out, "AGILENT_CONTROL "), fAgilent(*this, *this)426 StateMachineAsio<T>(out, "AGILENT_CONTROL_"+S::fMode), fAgilent(*this, *this) 421 427 { 422 428 // State names … … 481 487 fAgilent.SetInterval(conf.Get<uint16_t>("interval")); 482 488 483 SetEndpoint(conf.Get<string>("addr")); 489 SetEndpoint(conf.Get<string>("addr.", S::fMode)); 490 491 const std::vector<std::string> opts = conf.GetWildcardOptions("addr.*"); 492 for (auto it=opts.begin(); it!=opts.end(); it++) 493 conf.Get<string>(*it); 484 494 485 495 return -1; … … 502 512 control.add_options() 503 513 ("no-dim", po_bool(), "Disable dim services") 504 ("addr,a", var<string>("10.0.100.220:5025"), "network address of Agilent") 514 ("mode,m", var<string>()->required(), "Mode (e.g. 24V, 50V, 80V)") 515 ("addr.*", var<string>(), "Network address of Agilent specified by mode") 505 516 ("debug-rx", po_bool(false), "Enable raw debug output wehen receiving data") 506 517 ("interval", var<uint16_t>(15), "Interval in seconds in which the Agilent status is requested") … … 508 519 ; 509 520 521 po::positional_options_description p; 522 p.add("mode", 1); // The first positional options 523 510 524 conf.AddOptions(control); 525 conf.SetArgumentPositions(p); 511 526 } 512 527 … … 523 538 { 524 539 cout << 525 "The agilentctrl controls the FACT camera power supply.\n\n"540 "The agilentctrl controls the FACT Agilent power supplies.\n\n" 526 541 "\n" 527 542 "The default is that the program is started without user intercation. " … … 530 545 "help message about the usuage can be brought to the screen.\n" 531 546 "\n" 532 "Usage: agilentctrl [-c type] [OPTIONS] \n"533 " or: agilentctrl [OPTIONS] \n";547 "Usage: agilentctrl [-c type] [OPTIONS] mode\n" 548 " or: agilentctrl [OPTIONS] mode\n"; 534 549 cout << endl; 535 550 } … … 550 565 return 127; 551 566 567 ConnectionAgilent::fMode = conf.Get<string>("mode"); 568 552 569 //try 553 570 {
Note:
See TracChangeset
for help on using the changeset viewer.