FACT++  1.0
int StateMachineFeedback::Calibrate ( )
inlineprivate

Definition at line 992 of file feedback.cc.

References Feedback::State::kCalibrating, BIAS::kNumChannels, BIAS::State::kVoltageOff, Dim::SendCommandNB(), and DimState::state().

Referenced by StateMachineFeedback().

993  {
995  {
996  Warn("Calibration can only be started when biasctrl is in state VoltageOff.");
997  return GetCurrentState();
998  }
999 
1000  Message("Starting calibration (ignore="+to_string(fNumCalibIgnore)+", N="+to_string(fNumCalibRequests)+")");
1001 
1003  fCurrentsAvg.assign(BIAS::kNumChannels, 0);
1004  fCurrentsRms.assign(BIAS::kNumChannels, 0);
1005 
1006  fBiasDac.assign(BIAS::kNumChannels, 0);
1007 
1008  fCalibStep = 3;
1009  fTimeCalib = Time();
1010 
1011  // Ramp all channels to the calibration setting except the one
1012  // with a shortcut
1013  vector<uint16_t> vec(BIAS::kNumChannels, uint16_t(256+512*fCalibStep));
1014  vec[272] = 0;
1015  Dim::SendCommandNB("BIAS_CONTROL/SET_ALL_CHANNELS_DAC", vec);
1016 
1017  //Dim::SendCommandNB("BIAS_CONTROL/SET_GLOBAL_DAC", uint16_t(256+512*fCalibStep));
1018 
1020  }
DimDescribedState fDimBias
Definition: feedback.cc:38
int GetCurrentState() const
return the current state of the machine
Adds some functionality to boost::posix_time::ptime for our needs.
Definition: Time.h:30
uint16_t fCalibStep
Definition: feedback.cc:82
const int32_t & state() const
Definition: DimState.h:80
vector< int64_t > fCurrentsAvg
Definition: feedback.cc:49
uint16_t fNumCalibIgnore
Definition: feedback.cc:80
uint16_t fNumCalibRequests
Definition: feedback.cc:81
vector< uint16_t > fBiasDac
Definition: feedback.cc:55
vector< int64_t > fCurrentsRms
Definition: feedback.cc:50
void SendCommandNB(const std::string &command)
Definition: Dim.h:30
int Warn(const std::string &str)
Definition: MessageImp.h:48
int Message(const std::string &str)
Definition: MessageImp.h:46

+ Here is the call graph for this function:

+ Here is the caller graph for this function: