FACT++  1.0
bool ConnectionAgilent::SetPower ( bool  on)
inline

Definition at line 240 of file agilentctrl.cc.

References Error().

241  {
242  if (!IsConnected())
243  return false;
244 
245  if (fLastCommand+boost::posix_time::seconds(59)>Time())
246  {
247  Error("Last power command within the last 59 seconds... ignored.");
248  return false;
249  }
250 
251  PostMessage("outp "+string(on?"on":"off")+"\n*IDN?\nvolt?\nmeas:volt?\nmeas:curr?\ncurr?\n");
252  fLastCommand = Time();
253 
254  // Stop any pending power cycling
255  fTimeoutPowerCycle.cancel();
256 
257  return true;
258  }
void PostMessage(const void *msg, size_t s=0)
Adds some functionality to boost::posix_time::ptime for our needs.
Definition: Time.h:30
boost::asio::deadline_timer fTimeoutPowerCycle
Definition: agilentctrl.cc:36
bool IsConnected() const
Definition: Connection.h:145
int Error(const std::string &str)
Definition: MessageImp.h:49

+ Here is the call graph for this function: