FACT++  1.0
Bool_t MVideo::WriteControl ( MVideoCtrl vctrl,
Int_t  val 
) const

Definition at line 286 of file MVideo.cc.

References MVideoCtrl::fId, MVideoCtrl::fMaximum, MVideoCtrl::fMinimum, MVideoCtrl::fName, MVideoCtrl::fValue, gLog, and Ioctl().

Referenced by ResetControl(), and SetControls().

287 {
288  if (val<vctrl.fMinimum)
289  {
290  gLog << err << "ERROR - Value of " << val << " below minimum of " << vctrl.fMinimum << " for " << vctrl.fName << endl;
291  return kFALSE;
292  }
293 
294  if (val>vctrl.fMaximum)
295  {
296  gLog << err << "ERROR - Value of " << val << " above maximum of " << vctrl.fMaximum << " for " << vctrl.fName << endl;
297  return kFALSE;
298  }
299 
300  struct v4l2_control ctrl = { vctrl.fId, val };
301  if (Ioctl(VIDIOC_S_CTRL, &ctrl)==-1)
302  return kFALSE;
303 
304  vctrl.fValue = val;
305 
306  return kTRUE;
307 }
TString fName
Definition: MVideo.h:32
Int_t fMaximum
Definition: MVideo.h:34
int Ioctl(int req, void *opt, bool allowirq=true, bool force=false) const
Definition: MVideo.cc:108
#define gLog
Definition: fits.h:36
UInt_t fId
Definition: MVideo.h:30
UInt_t fValue
Definition: MVideo.h:39
Int_t fMinimum
Definition: MVideo.h:33

+ Here is the call graph for this function:

+ Here is the caller graph for this function: