FACT++  1.0
bool ConnectionBias::RampOneStep ( )
inlineprivate

Definition at line 759 of file biasctrl.cc.

References kNumChannels, and BIAS::kNumChannelsPerBoard.

760  {
761  if (fRampTime<0)
762  {
763  Warn("Ramping step time not yet set... ramping not started.");
764  return false;
765  }
766  if (fRampStep<0)
767  {
768  Warn("Ramping step not yet set... ramping not started.");
769  return false;
770  }
771 
772  vector<uint16_t> dac(kNumChannels);
773 
774  bool identical = true;
775  for (int ch=0; ch<kNumChannels; ch++)
776  {
777  dac[ch] = RampOneStep(ch);
778  if (dac[ch]!=fDacActual[ch] && fPresent[ch/kNumChannelsPerBoard])
779  identical = false;
780  }
781 
782  if (identical)
783  {
784  Info("Ramping: target values reached.");
785  return false;
786  }
787 
788  if (fWaitingForAnswer<0)
789  {
790  SetAllChannels(dac);
791  return true;
792  }
793 
794  ostringstream msg;
795  msg << "RampOneStep while waiting for answer to last command (id=" << fWaitingForAnswer << ")... ramp step delayed.";
796  Warn(msg);
797 
798  // Delay ramping
800  return true;
801  }
void ScheduleRampStep()
Definition: biasctrl.cc:846
void SetAllChannels(const vector< uint16_t > &dac, bool special=false)
Definition: biasctrl.cc:718
bool RampOneStep()
Definition: biasctrl.cc:759
int Warn(const std::string &str)
Definition: MessageImp.h:48
int16_t fRampStep
Definition: biasctrl.cc:52
int Info(const std::string &str)
Definition: MessageImp.h:47
int fWaitingForAnswer
Definition: biasctrl.cc:61
vector< bool > fPresent
Definition: biasctrl.cc:45
int16_t fRampTime
Definition: biasctrl.cc:53
vector< uint16_t > fDacActual
Definition: biasctrl.cc:101