FACT++  1.0
void ConnectionBias::ConnectionEstablished ( )
inlineprivatevirtual

Reimplemented from ConnectionUSB.

Definition at line 609 of file biasctrl.cc.

References buffer, kNumChannels, and BIAS::kSynchronize.

610  {
611  // We connect for the first time or haven't received
612  // a valid warp counter yet... this procedure also sets
613  // our volatges to 0 if we have connected but never received
614  // any answer.
615  if (fWrapCounter<0)
616  {
617  fDacTarget.assign(kNumChannels, 0);
618  fDacCommand.assign(kNumChannels, 0);
619  fDacActual.assign(kNumChannels, 0);
620  }
621 
622  // Reset everything....
623  fSendCounter = -1;
624  fWrapCounter = -1;
625  fGlobalDacCmd = -1;
626  fIsInitializing = 1;
627  fIsRamping = false;
628 
629  fLastConnect = Time();
630 
631  // Send a single 0 (and possible two consecutive 0's
632  // to make sure we are in sync with the device)
633  PostMessage("\0", 1);
634  AsyncRead(ba::buffer(fBuffer, 3), kSynchronize, 0);//++fSendCounter);
636 
637  // Wait for some time before sending the next 0
638  ScheduleSync();
639  }
vector< uint8_t > fBuffer
Definition: biasctrl.cc:38
void PostMessage(const void *msg, size_t s=0)
int64_t fWrapCounter
Definition: biasctrl.cc:47
int16_t fGlobalDacCmd
Definition: biasctrl.cc:50
Adds some functionality to boost::posix_time::ptime for our needs.
Definition: Time.h:30
void AsyncRead(const boost::asio::mutable_buffers_1 buffers, int type=0, int counter=0)
int64_t fSendCounter
Definition: biasctrl.cc:48
bool fIsRamping
Definition: biasctrl.cc:60
int buffer[BUFFSIZE]
Definition: db_dim_client.c:14
int fIsInitializing
Definition: biasctrl.cc:59
Time fLastConnect
Definition: biasctrl.cc:65
int fWaitingForAnswer
Definition: biasctrl.cc:61
void ScheduleSync(int counter=0)
Definition: biasctrl.cc:602
vector< uint16_t > fDacTarget
Definition: biasctrl.cc:99
vector< uint16_t > fDacActual
Definition: biasctrl.cc:101
vector< uint16_t > fDacCommand
Definition: biasctrl.cc:100